@arenarium/maps 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +724 -715
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(z,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(z=typeof globalThis<"u"?globalThis:z||self,N(z.arenarium={}))})(this,(function(z){"use strict";var Ho=Object.defineProperty;var ba=z=>{throw TypeError(z)};var Yo=(z,N,I)=>N in z?Ho(z,N,{enumerable:!0,configurable:!0,writable:!0,value:I}):z[N]=I;var d=(z,N,I)=>Yo(z,typeof N!="symbol"?N+"":N,I),Qr=(z,N,I)=>N.has(z)||ba("Cannot "+I);var k=(z,N,I)=>(Qr(z,N,"read from private field"),I?I.call(z):N.get(z)),Z=(z,N,I)=>N.has(z)?ba("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(z):N.set(z,I),U=(z,N,I,jt)=>(Qr(z,N,"write to private field"),jt?jt.call(z,I):N.set(z,I),I),Ue=(z,N,I)=>(Qr(z,N,"access private method"),I);var Tt,ot,Ne,At,Nt,Fe,st,Be,Le,lt,Lt,Rt,oe,ka,ar,en,ya,_e,ct,Pt,Ve;var I=Array.isArray,jt=Array.prototype.indexOf,Sa=Array.from,ir=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,za=Object.prototype,Ea=Array.prototype,Ma=Object.getPrototypeOf,tn=Object.isExtensible;function Ca(r){for(var e=0;e<r.length;e++)r[e]()}function Ta(){var r,e,t=new Promise((n,a)=>{r=n,e=a});return{promise:t,resolve:r,reject:e}}const J=2,or=4,rn=8,mt=16,xe=32,Pe=64,nn=128,ee=256,It=512,G=1024,le=2048,we=4096,$e=8192,qe=16384,sr=32768,Aa=65536,an=1<<17,Na=1<<18,yt=1<<19,La=1<<20,lr=1<<21,cr=1<<22,Oe=1<<23,Dt=Symbol("$state"),ur=new class extends Error{constructor(){super(...arguments);d(this,"name","StaleReactionError");d(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Ra(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Pa(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Oa(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ja(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ia(r){throw new Error("https://svelte.dev/e/effect_orphan")}function Da(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Za(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Fa(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ba(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const Va=2,B=Symbol();function on(r){return r===this.v}let Go=!1,ae=null;function Zt(r){ae=r}function dr(r,e=!1,t){ae={p:ae,c:null,e:null,s:r,x:null,l:null}}function pr(r){var e=ae,t=e.e;if(t!==null){e.e=null;for(var n of t)Sn(n)}return r!==void 0&&(e.x=r),ae=e.p,r??{}}function sn(){return!0}const Ua=new WeakMap;function $a(r){var e=T;if(e===null)return E.f|=Oe,r;if((e.f&sr)===0){if((e.f&nn)===0)throw!e.parent&&r instanceof Error&&ln(r),r;e.b.error(r)}else hr(r,e)}function hr(r,e){for(;e!==null;){if((e.f&nn)!==0)try{e.b.error(r);return}catch(t){r=t}e=e.parent}throw r instanceof Error&&ln(r),r}function ln(r){const e=Ua.get(r);e&&(ir(r,"message",{value:e.message}),ir(r,"stack",{value:e.stack}))}let We=[];function qa(){var r=We;We=[],Ca(r)}function cn(r){if(We.length===0){var e=We;queueMicrotask(()=>{e===We&&qa()})}We.push(r)}function Wa(){const r=T.b;return r===null&&Ra(),r}function Ha(r){var e=J|le,t=E!==null&&(E.f&J)!==0?E:null;return T===null||t!==null&&(t.f&ee)!==0?e|=ee:T.f|=yt,{ctx:ae,deps:null,effects:null,equals:on,f:e,fn:r,reactions:null,rv:0,v:B,wv:0,parent:t??T,ac:null}}function Ya(r,e){let t=T;t===null&&Pa();var n=t.b,a=void 0,i=mn(B),o=null,s=!E;return si(()=>{try{var l=r();o&&Promise.resolve(l).catch(()=>{})}catch(m){l=Promise.reject(m)}var c=()=>l;a=(o==null?void 0:o.then(c,c))??Promise.resolve(l),o=a;var u=$,f=n.is_pending();s&&(n.update_pending_count(1),f||u.increment());const _=(m,v=void 0)=>{o=null,f||u.activate(),v?v!==ur&&(i.f|=Oe,_r(i,v)):((i.f&Oe)!==0&&(i.f^=Oe),_r(i,m)),s&&(n.update_pending_count(-1),f||u.decrement()),pn()};if(a.then(_,m=>_(null,m||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),new Promise(l=>{function c(u){function f(){u===a?l(i):c(a)}u.then(f,f)}c(a)})}function un(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Ie(e[t])}}function Ga(r){for(var e=r.parent;e!==null;){if((e.f&J)===0)return e;e=e.parent}return null}function fr(r){var e,t=T;ke(Ga(r));try{un(r),e=In(r)}finally{ke(t)}return e}function dn(r){var e=fr(r);if(r.equals(e)||(r.v=e,r.wv=On()),!Ye){var t=(Se||(r.f&ee)!==0)&&r.deps!==null?we:G;re(r,t)}}function Xa(r,e,t){const n=Ha;if(e.length===0){t(r.map(n));return}var a=$,i=T,o=Ja(),s=Wa();Promise.all(e.map(l=>Ya(l))).then(l=>{a==null||a.activate(),o();try{t([...r.map(n),...l])}catch(c){(i.f&qe)===0&&hr(c,i)}a==null||a.deactivate(),pn()}).catch(l=>{s.error(l)})}function Ja(){var r=T,e=E,t=ae,n=$;return function(){ke(r),de(e),Zt(t),n==null||n.activate()}}function pn(){ke(null),de(null),Zt(null)}const mr=new Set;let $=null,hn=new Set,gt=[],yr=null,gr=!1;const Jt=class Jt{constructor(){Z(this,oe);d(this,"current",new Map);Z(this,Tt,new Map);Z(this,ot,new Set);Z(this,Ne,0);Z(this,At,null);Z(this,Nt,!1);Z(this,Fe,[]);Z(this,st,[]);Z(this,Be,[]);Z(this,Le,[]);Z(this,lt,[]);Z(this,Lt,[]);Z(this,Rt,[]);d(this,"skipped_effects",new Set)}process(e){var a;gt=[];for(const i of e)Ue(this,oe,ka).call(this,i);if(k(this,Fe).length===0&&k(this,Ne)===0){Ue(this,oe,en).call(this);var t=k(this,Be),n=k(this,Le);U(this,Be,[]),U(this,Le,[]),U(this,lt,[]),$=null,fn(t),fn(n),$===null?$=this:mr.delete(this),(a=k(this,At))==null||a.resolve()}else Ue(this,oe,ar).call(this,k(this,Be)),Ue(this,oe,ar).call(this,k(this,Le)),Ue(this,oe,ar).call(this,k(this,lt));for(const i of k(this,Fe))Ge(i);for(const i of k(this,st))Ge(i);U(this,Fe,[]),U(this,st,[])}capture(e,t){k(this,Tt).has(e)||k(this,Tt).set(e,t),this.current.set(e,e.v)}activate(){$=this}deactivate(){$=null;for(const e of hn)if(hn.delete(e),e(),$!==null)break}neuter(){U(this,Nt,!0)}flush(){gt.length>0?Ka():Ue(this,oe,en).call(this),$===this&&(k(this,Ne)===0&&mr.delete(this),this.deactivate())}increment(){U(this,Ne,k(this,Ne)+1)}decrement(){if(U(this,Ne,k(this,Ne)-1),k(this,Ne)===0){for(const e of k(this,Lt))re(e,le),vt(e);for(const e of k(this,Rt))re(e,we),vt(e);U(this,Be,[]),U(this,Le,[]),this.flush()}else this.deactivate()}add_callback(e){k(this,ot).add(e)}settled(){return(k(this,At)??U(this,At,Ta())).promise}static ensure(){if($===null){const e=$=new Jt;mr.add($),Jt.enqueue(()=>{$===e&&e.flush()})}return $}static enqueue(e){cn(e)}};Tt=new WeakMap,ot=new WeakMap,Ne=new WeakMap,At=new WeakMap,Nt=new WeakMap,Fe=new WeakMap,st=new WeakMap,Be=new WeakMap,Le=new WeakMap,lt=new WeakMap,Lt=new WeakMap,Rt=new WeakMap,oe=new WeakSet,ka=function(e){var u;e.f^=G;for(var t=e.first;t!==null;){var n=t.f,a=(n&(xe|Pe))!==0,i=a&&(n&G)!==0,o=i||(n&$e)!==0||this.skipped_effects.has(t);if(!o&&t.fn!==null){if(a)t.f^=G;else if((n&or)!==0)k(this,Le).push(t);else if((n&G)===0)if((n&cr)!==0){var s=(u=t.b)!=null&&u.is_pending()?k(this,st):k(this,Fe);s.push(t)}else Ft(t)&&((t.f&mt)!==0&&k(this,lt).push(t),Ge(t));var l=t.first;if(l!==null){t=l;continue}}var c=t.parent;for(t=t.next;t===null&&c!==null;)t=c.next,c=c.parent}},ar=function(e){for(const t of e)((t.f&le)!==0?k(this,Lt):k(this,Rt)).push(t),re(t,G);e.length=0},en=function(){if(!k(this,Nt))for(const e of k(this,ot))e();k(this,ot).clear()};let _t=Jt;function Ka(){var r=He;gr=!0;try{var e=0;for(Nn(!0);gt.length>0;){var t=_t.ensure();if(e++>1e3){var n,a;Qa()}t.process(gt),be.clear()}}finally{gr=!1,Nn(r),yr=null}}function Qa(){try{Da()}catch(r){hr(r,yr)}}let ye=null;function fn(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var n=r[t++];if((n.f&(qe|$e))===0&&Ft(n)&&(ye=[],Ge(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null&&n.ac===null?Tn(n):n.fn=null),(ye==null?void 0:ye.length)>0)){be.clear();for(const a of ye)Ge(a);ye=[]}}ye=null}}function vt(r){for(var e=yr=r;e.parent!==null;){e=e.parent;var t=e.f;if(gr&&e===T&&(t&mt)!==0)return;if((t&(Pe|xe))!==0){if((t&G)===0)return;e.f^=G}}gt.push(e)}const be=new Map;function mn(r,e){var t={f:0,v:r,reactions:null,equals:on,rv:0,wv:0};return t}function q(r,e){const t=mn(r);return hi(t),t}function V(r,e,t=!1){E!==null&&(!ue||(E.f&an)!==0)&&sn()&&(E.f&(J|mt|cr|an))!==0&&!(W!=null&&W.includes(r))&&Ba();let n=t?xt(e):e;return _r(r,n)}function _r(r,e){if(!r.equals(e)){var t=r.v;Ye?be.set(r,e):be.set(r,t),r.v=e;var n=_t.ensure();n.capture(r,t),(r.f&J)!==0&&((r.f&le)!==0&&fr(r),re(r,(r.f&ee)===0?G:we)),r.wv=On(),yn(r,le),T!==null&&(T.f&G)!==0&&(T.f&(xe|Pe))===0&&(te===null?fi([r]):te.push(r))}return e}function vr(r){V(r,r.v+1)}function yn(r,e){var t=r.reactions;if(t!==null)for(var n=t.length,a=0;a<n;a++){var i=t[a],o=i.f,s=(o&le)===0;s&&re(i,e),(o&J)!==0?yn(i,we):s&&((o&mt)!==0&&ye!==null&&ye.push(i),vt(i))}}function xt(r){if(typeof r!="object"||r===null||Dt in r)return r;const e=Ma(r);if(e!==za&&e!==Ea)return r;var t=new Map,n=I(r),a=q(0),i=De,o=s=>{if(De===i)return s();var l=E,c=De;de(null),Pn(i);var u=s();return de(l),Pn(c),u};return n&&t.set("length",q(r.length)),new Proxy(r,{defineProperty(s,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Za();var u=t.get(l);return u===void 0?u=o(()=>{var f=q(c.value);return t.set(l,f),f}):V(u,c.value,!0),!0},deleteProperty(s,l){var c=t.get(l);if(c===void 0){if(l in s){const u=o(()=>q(B));t.set(l,u),vr(a)}}else V(c,B),vr(a);return!0},get(s,l,c){var m;if(l===Dt)return r;var u=t.get(l),f=l in s;if(u===void 0&&(!f||(m=ft(s,l))!=null&&m.writable)&&(u=o(()=>{var v=xt(f?s[l]:B),O=q(v);return O}),t.set(l,u)),u!==void 0){var _=R(u);return _===B?void 0:_}return Reflect.get(s,l,c)},getOwnPropertyDescriptor(s,l){var c=Reflect.getOwnPropertyDescriptor(s,l);if(c&&"value"in c){var u=t.get(l);u&&(c.value=R(u))}else if(c===void 0){var f=t.get(l),_=f==null?void 0:f.v;if(f!==void 0&&_!==B)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return c},has(s,l){var _;if(l===Dt)return!0;var c=t.get(l),u=c!==void 0&&c.v!==B||Reflect.has(s,l);if(c!==void 0||T!==null&&(!u||(_=ft(s,l))!=null&&_.writable)){c===void 0&&(c=o(()=>{var m=u?xt(s[l]):B,v=q(m);return v}),t.set(l,c));var f=R(c);if(f===B)return!1}return u},set(s,l,c,u){var F;var f=t.get(l),_=l in s;if(n&&l==="length")for(var m=c;m<f.v;m+=1){var v=t.get(m+"");v!==void 0?V(v,B):m in s&&(v=o(()=>q(B)),t.set(m+"",v))}if(f===void 0)(!_||(F=ft(s,l))!=null&&F.writable)&&(f=o(()=>q(void 0)),V(f,xt(c)),t.set(l,f));else{_=f.v!==B;var O=o(()=>xt(c));V(f,O)}var Y=Reflect.getOwnPropertyDescriptor(s,l);if(Y!=null&&Y.set&&Y.set.call(u,c),!_){if(n&&typeof l=="string"){var se=t.get("length"),L=Number(l);Number.isInteger(L)&&L>=se.v&&V(se,L+1)}vr(a)}return!0},ownKeys(s){R(a);var l=Reflect.ownKeys(s).filter(f=>{var _=t.get(f);return _===void 0||_.v!==B});for(var[c,u]of t)u.v!==B&&!(c in s)&&l.push(c);return l},setPrototypeOf(){Fa()}})}var gn,_n,vn,xn;function ei(){if(gn===void 0){gn=window,_n=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;vn=ft(e,"firstChild").get,xn=ft(e,"nextSibling").get,tn(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),tn(t)&&(t.__t=void 0)}}function ti(r=""){return document.createTextNode(r)}function wn(r){return vn.call(r)}function bn(r){return xn.call(r)}function xr(r,e){return wn(r)}function ri(r,e=1,t=!1){let n=r;for(;e--;)n=bn(n);return n}function kn(r){var e=E,t=T;de(null),ke(null);try{return r()}finally{de(e),ke(t)}}function ni(r){T===null&&E===null&&Ia(),E!==null&&(E.f&ee)!==0&&T===null&&ja(),Ye&&Oa()}function ai(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function je(r,e,t,n=!0){var a=T;a!==null&&(a.f&$e)!==0&&(r|=$e);var i={ctx:ae,deps:null,nodes_start:null,nodes_end:null,f:r|le,first:null,fn:e,last:null,next:null,parent:a,b:a&&a.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{Ge(i),i.f|=sr}catch(l){throw Ie(i),l}else e!==null&&vt(i);if(n){var o=i;if(t&&o.deps===null&&o.teardown===null&&o.nodes_start===null&&o.first===o.last&&(o.f&yt)===0&&(o=o.first),o!==null&&(o.parent=a,a!==null&&ai(o,a),E!==null&&(E.f&J)!==0&&(r&Pe)===0)){var s=E;(s.effects??(s.effects=[])).push(o)}}return i}function ce(r){ni();var e=T.f,t=!E&&(e&xe)!==0&&(e&sr)===0;if(t){var n=ae;(n.e??(n.e=[])).push(r)}else return Sn(r)}function Sn(r){return je(or|La,r,!1)}function ii(r){_t.ensure();const e=je(Pe|yt,r,!0);return(t={})=>new Promise(n=>{t.outro?di(e,()=>{Ie(e),n(void 0)}):(Ie(e),n(void 0))})}function oi(r){return je(or,r,!1)}function si(r){return je(cr|yt,r,!0)}function zn(r,e=0){return je(rn|e,r,!0)}function En(r,e=[],t=[]){Xa(e,t,n=>{je(rn,()=>r(...n.map(R)),!0)})}function li(r,e=!0){return je(xe|yt,r,!0,e)}function Mn(r){var e=r.teardown;if(e!==null){const t=Ye,n=E;Ln(!0),de(null);try{e.call(null)}finally{Ln(t),de(n)}}}function Cn(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){const a=t.ac;a!==null&&kn(()=>{a.abort(ur)});var n=t.next;(t.f&Pe)!==0?t.parent=null:Ie(t,e),t=n}}function ci(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&xe)===0&&Ie(e),e=t}}function Ie(r,e=!0){var t=!1;(e||(r.f&Na)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(ui(r.nodes_start,r.nodes_end),t=!0),Cn(r,e&&!t),Bt(r,0),re(r,qe);var n=r.transitions;if(n!==null)for(const i of n)i.stop();Mn(r);var a=r.parent;a!==null&&a.first!==null&&Tn(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=r.ac=null}function ui(r,e){for(;r!==null;){var t=r===e?null:bn(r);r.remove(),r=t}}function Tn(r){var e=r.parent,t=r.prev,n=r.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===r&&(e.first=n),e.last===r&&(e.last=t))}function di(r,e){var t=[];An(r,t,!0),pi(t,()=>{Ie(r),e&&e()})}function pi(r,e){var t=r.length;if(t>0){var n=()=>--t||e();for(var a of r)a.out(n)}else e()}function An(r,e,t){if((r.f&$e)===0){if(r.f^=$e,r.transitions!==null)for(const o of r.transitions)(o.is_global||t)&&e.push(o);for(var n=r.first;n!==null;){var a=n.next,i=(n.f&Aa)!==0||(n.f&xe)!==0;An(n,e,i?t:!1),n=a}}}let He=!1;function Nn(r){He=r}let Ye=!1;function Ln(r){Ye=r}let E=null,ue=!1;function de(r){E=r}let T=null;function ke(r){T=r}let W=null;function hi(r){E!==null&&(W===null?W=[r]:W.push(r))}let H=null,K=0,te=null;function fi(r){te=r}let Rn=1,wt=0,De=wt;function Pn(r){De=r}let Se=!1;function On(){return++Rn}function Ft(r){var f;var e=r.f;if((e&le)!==0)return!0;if((e&we)!==0){var t=r.deps,n=(e&ee)!==0;if(t!==null){var a,i,o=(e&It)!==0,s=n&&T!==null&&!Se,l=t.length;if((o||s)&&(T===null||(T.f&qe)===0)){var c=r,u=c.parent;for(a=0;a<l;a++)i=t[a],(o||!((f=i==null?void 0:i.reactions)!=null&&f.includes(c)))&&(i.reactions??(i.reactions=[])).push(c);o&&(c.f^=It),s&&u!==null&&(u.f&ee)===0&&(c.f^=ee)}for(a=0;a<l;a++)if(i=t[a],Ft(i)&&dn(i),i.wv>r.wv)return!0}(!n||T!==null&&!Se)&&re(r,G)}return!1}function jn(r,e,t=!0){var n=r.reactions;if(n!==null&&!(W!=null&&W.includes(r)))for(var a=0;a<n.length;a++){var i=n[a];(i.f&J)!==0?jn(i,e,!1):e===i&&(t?re(i,le):(i.f&G)!==0&&re(i,we),vt(i))}}function In(r){var O;var e=H,t=K,n=te,a=E,i=Se,o=W,s=ae,l=ue,c=De,u=r.f;H=null,K=0,te=null,Se=(u&ee)!==0&&(ue||!He||E===null),E=(u&(xe|Pe))===0?r:null,W=null,Zt(r.ctx),ue=!1,De=++wt,r.ac!==null&&(kn(()=>{r.ac.abort(ur)}),r.ac=null);try{r.f|=lr;var f=r.fn,_=f(),m=r.deps;if(H!==null){var v;if(Bt(r,K),m!==null&&K>0)for(m.length=K+H.length,v=0;v<H.length;v++)m[K+v]=H[v];else r.deps=m=H;if(!Se||(u&J)!==0&&r.reactions!==null)for(v=K;v<m.length;v++)((O=m[v]).reactions??(O.reactions=[])).push(r)}else m!==null&&K<m.length&&(Bt(r,K),m.length=K);if(sn()&&te!==null&&!ue&&m!==null&&(r.f&(J|we|le))===0)for(v=0;v<te.length;v++)jn(te[v],r);return a!==null&&a!==r&&(wt++,te!==null&&(n===null?n=te:n.push(...te))),(r.f&Oe)!==0&&(r.f^=Oe),_}catch(Y){return $a(Y)}finally{r.f^=lr,H=e,K=t,te=n,E=a,Se=i,W=o,Zt(s),ue=l,De=c}}function mi(r,e){let t=e.reactions;if(t!==null){var n=jt.call(t,r);if(n!==-1){var a=t.length-1;a===0?t=e.reactions=null:(t[n]=t[a],t.pop())}}t===null&&(e.f&J)!==0&&(H===null||!H.includes(e))&&(re(e,we),(e.f&(ee|It))===0&&(e.f^=It),un(e),Bt(e,0))}function Bt(r,e){var t=r.deps;if(t!==null)for(var n=e;n<t.length;n++)mi(r,t[n])}function Ge(r){var e=r.f;if((e&qe)===0){re(r,G);var t=T,n=He;T=r,He=!0;try{(e&mt)!==0?ci(r):Cn(r),Mn(r);var a=In(r);r.teardown=typeof a=="function"?a:null,r.wv=Rn;var i}finally{He=n,T=t}}}function R(r){var e=r.f,t=(e&J)!==0;if(E!==null&&!ue){var n=T!==null&&(T.f&qe)!==0;if(!n&&!(W!=null&&W.includes(r))){var a=E.deps;if((E.f&lr)!==0)r.rv<wt&&(r.rv=wt,H===null&&a!==null&&a[K]===r?K++:H===null?H=[r]:(!Se||!H.includes(r))&&H.push(r));else{(E.deps??(E.deps=[])).push(r);var i=r.reactions;i===null?r.reactions=[E]:i.includes(E)||i.push(E)}}}else if(t&&r.deps===null&&r.effects===null){var o=r,s=o.parent;s!==null&&(s.f&ee)===0&&(o.f^=ee)}if(Ye){if(be.has(r))return be.get(r);if(t){o=r;var l=o.v;return((o.f&G)===0&&o.reactions!==null||Dn(o))&&(l=fr(o)),be.set(o,l),l}}else t&&(o=r,Ft(o)&&dn(o));if((r.f&Oe)!==0)throw r.v;return r.v}function Dn(r){if(r.v===B)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(be.has(e)||(e.f&J)!==0&&Dn(e))return!0;return!1}function yi(r){var e=ue;try{return ue=!0,r()}finally{ue=e}}const gi=-7169;function re(r,e){r.f=r.f&gi|e}const _i=["touchstart","touchmove"];function vi(r){return _i.includes(r)}const xi=new Set,Zn=new Set;let Fn=null;function Vt(r){var L;var e=this,t=e.ownerDocument,n=r.type,a=((L=r.composedPath)==null?void 0:L.call(r))||[],i=a[0]||r.target;Fn=r;var o=0,s=Fn===r&&r.__root;if(s){var l=a.indexOf(s);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var c=a.indexOf(e);if(c===-1)return;l<=c&&(o=l)}if(i=a[o]||r.target,i!==e){ir(r,"currentTarget",{configurable:!0,get(){return i||t}});var u=E,f=T;de(null),ke(null);try{for(var _,m=[];i!==null;){var v=i.assignedSlot||i.parentNode||i.host||null;try{var O=i["__"+n];if(O!=null&&(!i.disabled||r.target===i))if(I(O)){var[Y,...se]=O;Y.apply(i,[r,...se])}else O.call(i,r)}catch(F){_?m.push(F):_=F}if(r.cancelBubble||v===e||v===null)break;i=v}if(_){for(let F of m)queueMicrotask(()=>{throw F});throw _}}finally{r.__root=e,delete r.currentTarget,de(u),ke(f)}}}function wi(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function bi(r,e){var t=T;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function Bn(r,e){var t=(e&Va)!==0,n,a=!r.startsWith("<!>");return()=>{n===void 0&&(n=wi(a?r:"<!>"+r),n=wn(n));var i=t||_n?document.importNode(n,!0):n.cloneNode(!0);return bi(i,i),i}}function Vn(r,e){r!==null&&r.before(e)}function wr(r,e){return ki(r,e)}const Xe=new Map;function ki(r,{target:e,anchor:t,props:n={},events:a,context:i,intro:o=!0}){ei();var s=new Set,l=f=>{for(var _=0;_<f.length;_++){var m=f[_];if(!s.has(m)){s.add(m);var v=vi(m);e.addEventListener(m,Vt,{passive:v});var O=Xe.get(m);O===void 0?(document.addEventListener(m,Vt,{passive:v}),Xe.set(m,1)):Xe.set(m,O+1)}}};l(Sa(xi)),Zn.add(l);var c=void 0,u=ii(()=>{var f=t??e.appendChild(ti());return li(()=>{if(i){dr({});var _=ae;_.c=i}a&&(n.$$events=a),c=r(f,n)||{},i&&pr()}),()=>{var v;for(var _ of s){e.removeEventListener(_,Vt);var m=Xe.get(_);--m===0?(document.removeEventListener(_,Vt),Xe.delete(_)):Xe.set(_,m)}Zn.delete(l),f!==t&&((v=f.parentNode)==null||v.removeChild(f))}});return Si.set(c,u),c}let Si=new WeakMap;function Un(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=Un(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function zi(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=Un(r))&&(n&&(n+=" "),n+=e);return n}function $n(r){return typeof r=="object"?zi(r):r??""}function Ei(r,e,t){var n=r==null?"":""+r;return e&&(n=n?n+" "+e:e),n===""?null:n}function Mi(r,e){return r==null?null:String(r)}function qn(r,e,t,n,a,i){var o=r.__className;if(o!==t||o===void 0){var s=Ei(t,n);s==null?r.removeAttribute("class"):r.className=s,r.__className=t}return i}function Ut(r,e,t,n){var a=r.__style;if(a!==e){var i=Mi(e);i==null?r.removeAttribute("style"):r.style.cssText=i,r.__style=e}return n}const Ci=()=>performance.now(),pe={tick:r=>requestAnimationFrame(r),now:()=>Ci(),tasks:new Set};function Wn(){const r=pe.now();pe.tasks.forEach(e=>{e.c(r)||(pe.tasks.delete(e),e.f())}),pe.tasks.size!==0&&pe.tick(Wn)}function Ti(r){let e;return pe.tasks.size===0&&pe.tick(Wn),{promise:new Promise(t=>{pe.tasks.add(e={c:r,f:t})}),abort(){pe.tasks.delete(e)}}}function Hn(r,e){return r===e||(r==null?void 0:r[Dt])===e}function Je(r={},e,t,n){return oi(()=>{var a,i;return zn(()=>{a=i,i=[],yi(()=>{r!==t(...i)&&(e(r,...i),a&&Hn(t(...a),r)&&e(null,...a))})}),()=>{cn(()=>{i&&Hn(t(...i),r)&&e(null,...i)})}}),r}const Ai="5";typeof window<"u"&&((ya=window.__svelte??(window.__svelte={})).v??(ya.v=new Set)).add(Ai);function Ni(r){return r}function br(r){return-.5*(Math.cos(Math.PI*r)-1)}function Li(r){const e=Math.cos(r*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function Ri(r){return Math.sin(r*Math.PI/2)}const Pi=128,Oi=0,ji=1,Ii=2;class Di{constructor(){d(this,"animationsStarted",!1);d(this,"animationsCount",0);d(this,"animationsLimit",Pi);d(this,"layers",new Array)}start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let e=0;e<this.layers.length;e++){const t=this.layers[e];if(t==null)continue;const n=t.animations;if(n!=null)for(let a=0;a<n.length;a++){const i=n[a];if(i!=null){for(const o of i.values())if(!o.executed&&(o.executed=!0,o.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,n,a){let i=this.layers[e];i==null&&(i=this.layers[e]={animations:new Array});let o=i.animations[t];o==null&&(o=i.animations[t]=new Map);let s={id:n,priority:t,executed:!1,function:a};o.set(n,s),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let n=0;n<this.layers.length;n++){let a=this.layers[n];if(a==null)continue;let i=a.animations[e];if(i==null)return;let o=i.get(t);if(o==null||o.executed==!1)return;i.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const ze=new Di;function Yn(r){return Object.prototype.toString.call(r)==="[object Date]"}function kr(r,e){if(r===e||r!==r)return()=>r;const t=typeof r;if(t!==typeof e||Array.isArray(r)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(r)){const n=e.map((a,i)=>kr(r[i],a));return a=>n.map(i=>i(a))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(Yn(r)&&Yn(e)){const i=r.getTime(),s=e.getTime()-i;return l=>new Date(i+l*s)}const n=Object.keys(e),a={};return n.forEach(i=>{a[i]=kr(r[i],e[i])}),i=>{const o={};return n.forEach(s=>{o[s]=a[s](i)}),o}}if(t==="number"){const n=e-r;return a=>r+a*n}return()=>e}const Xr=class Xr{constructor(e,t={}){Z(this,_e);Z(this,ct);Z(this,Pt);Z(this,Ve,null);U(this,_e,q(e)),U(this,ct,q(e)),U(this,Pt,t)}static of(e,t){const n=new Xr(e(),t);return zn(()=>{n.set(e())}),n}set(e,t){var f;V(k(this,ct),e);let{delay:n=0,duration:a=400,easing:i=Ni,interpolate:o=kr}={...k(this,Pt),...t};if(a===0)return(f=k(this,Ve))==null||f.abort(),V(k(this,_e),e),Promise.resolve();const s=pe.now()+n;let l,c=!1,u=k(this,Ve);return U(this,Ve,Ti(_=>{if(_<s)return!0;if(!c){c=!0;const v=k(this,_e).v;l=o(v,e),typeof a=="function"&&(a=a(v,e)),u==null||u.abort()}const m=_-s;return m>a?(V(k(this,_e),e),!1):(V(k(this,_e),l(i(m/a))),!0)})),k(this,Ve).promise}get current(){return R(k(this,_e))}get target(){return R(k(this,ct))}set target(e){this.set(e)}};_e=new WeakMap,ct=new WeakMap,Pt=new WeakMap,Ve=new WeakMap;let Sr=Xr;class $t{constructor(e,t){d(this,"value");d(this,"motion");this.value=e,this.motion=new Sr(e,t)}set(e,t){this.value=e,this.motion.set(e,t)}update(e){this.motion.set(this.value,e)}snap(){this.motion.set(this.value,{duration:0})}}var Zi=Bn('<div><div class="body svelte-zz3jrb"></div></div>');function Fi(r,e){dr(e,!0);let t,n;function a(){return n}let i=q(!1);function o(j){V(i,j,!0)}function s(){return R(i)}let l=q(!0),c=0,u=150;function f(j){j!=R(l)&&(V(l,j,!0),c=performance.now())}function _(){return performance.now()-c<u?v.motion.current==0:v.value==0}let m=0,v=new $t(0,{easing:br});ce(()=>{R(i)==!1&&(v.snap(),ze.clear(e.priority,e.id))}),ce(()=>{v.set(R(l)?0:m,{duration:75})}),ce(()=>{O(v.motion.current)});function O(j){t&&ze.equeue(e.layer,e.priority,e.id,()=>{t.style.scale=j.toString(),t.style.filter=`brightness(${.25+.75*j})`,n.style.opacity=j.toString()})}function Y(j){j!=m&&(m=j,v.set(j,{duration:75}))}function se(){return v.value}var L={getBody:a,setDisplayed:o,getDisplayed:s,setCollapsed:f,getCollapsed:_,setScale:Y,getScale:se},F=Zi(),me=xr(F);return Je(me,j=>n=j,()=>n),Je(F,j=>t=j,()=>t),En(()=>{qn(F,1,$n(["pin",R(i)&&"displayed"]),"svelte-zz3jrb"),Ut(F,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px`),Ut(me,`width: ${e.width-4}px; height: ${e.height-4}px; border-radius: ${e.radius-2}px`)}),Vn(r,F),pr(L)}var bt;(r=>{function e(t,n,a){const i=t/2,o=n/2,s=Math.sqrt(i*i+o*o),l=Math.atan(o/i)*(180/Math.PI),c=a*(Math.PI/180);return a<180?a<90?a<l?{x:0,y:s*Math.sin(c)-o}:{x:s*Math.cos(c)-i,y:0}:a<180-l?{x:s*Math.cos(c)-i,y:0}:{x:-t,y:s*Math.sin(c)-o}:a<270?a<180+l?{x:-t,y:s*Math.sin(c)-o}:{x:s*Math.cos(c)-i,y:-n}:a<360-l?{x:s*Math.cos(c)-i,y:-n}:{x:0,y:s*Math.sin(c)-o}}r.getOffsets=e})(bt||(bt={}));var Bi=Bn('<div><div class="pointer svelte-11extwn"></div> <div class="bubble svelte-11extwn"><div class="body svelte-11extwn"></div></div></div>');function Gn(r,e){dr(e,!0);let t,n,a,i;const o=e.width+2*e.margin,s=e.height+2*e.margin,l=()=>i;ce(()=>{a.style.width=`${e.margin*4}px`,a.style.height=`${e.margin*4}px`});let c=q(!0);function u(A){V(c,A,!0)}function f(){return R(c)}let _=q(!0),m=0,v=300;function O(A){A!=R(_)&&(V(_,A,!0),m=performance.now())}function Y(){return performance.now()-m<v?L.motion.current==0:L.value==0}function se(){return performance.now()-m<v?L.motion.current==1:L.value==1}let L=new $t(0);ce(()=>{R(c)==!1&&(L.snap(),ze.clear(e.priority,e.id+"_scale"))}),ce(()=>{R(_)==!0&&L.value!=0&&(ze.stacked()?L.set(0,{duration:0}):L.set(0,{duration:150,easing:Li})),R(_)==!1&&L.value!=1&&L.set(1,{duration:150,easing:Ri})}),ce(()=>{F(L.motion.current)});function F(A){!t||!n||!a||ze.equeue(R(_)?0:e.layer,e.priority,e.id+"_scale",()=>{t.style.opacity=`${A}`,n.style.scale=`${A}`,a.style.scale=`${A}`})}let me=NaN,j=q(!1),Re=new $t(-o/2,{easing:br}),er=new $t(-s/2,{easing:br});ce(()=>{R(c)==!1&&(Re.snap(),Re.snap(),ze.clear(e.priority,e.id+"_angle"))}),ce(()=>{R(_)==!0&&R(j)&&(Re.update({duration:75}),Re.update({duration:75}))}),ce(()=>{ga(Re.motion.current,er.motion.current)});function ga(A,rr){if(!t||!n||!a)return;const ve=A+o/2,nr=rr+s/2,pt=s<o?ve*s/o:ve,ht=s>o?nr*o/s:nr,Vo=Math.atan2(ht,pt)/Math.PI*180-45,xa=0,Uo=30,Kr=Math.sqrt(pt*pt+ht*ht),Ot=Math.min(o,s)/2,$o=Ot*Math.SQRT2,qo=(Kr-Ot)/($o-Ot),wa=xa+qo*(Uo-xa),Wo=Kr<Ot?Kr/Ot:1;ze.equeue(e.layer,e.priority,e.id+"_angle",()=>{n.style.transform=`translate(${Math.round(A)}px, ${Math.round(rr)}px)`,a.style.transform=`scale(${Wo}) rotate(${Vo}deg) skew(${wa}deg, ${wa}deg)`})}function Zo(A,rr){if(R(j)==!1||rr==!0){let ve=bt.getOffsets(o,s,A);Re.set(Math.round(ve.x),{duration:0}),er.set(Math.round(ve.y),{duration:0}),ga(Re.value,er.value),me=A,V(j,!0)}else if(A!=me){let ve=Math.abs(A-me),nr=ve<180?ve:360-ve,pt=Math.log(nr)*75,ht=bt.getOffsets(o,s,A);Re.set(Math.round(ht.x),{duration:pt}),er.set(Math.round(ht.y),{duration:pt}),me=A}}function Fo(){return bt.getOffsets(o,s,me)}var Bo={getBody:l,setDisplayed:u,getDisplayed:f,setCollapsed:O,getCollapsed:Y,getExpanded:se,setAngle:Zo,getOffsets:Fo},tr=Bi(),_a=xr(tr);Je(_a,A=>a=A,()=>a);var Jr=ri(_a,2),va=xr(Jr);return Je(va,A=>i=A,()=>i),Je(Jr,A=>n=A,()=>n),Je(tr,A=>t=A,()=>t),En(()=>{qn(tr,1,$n(["anchor",R(c)&&"displayed"]),"svelte-11extwn"),Ut(Jr,`margin: ${e.margin}px;`),Ut(va,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)}),Vn(r,tr),pr(Bo)}var Ke;(r=>{function e(s,l,c){return{x:n(l)*c,y:a(s)*c}}r.project=e;function t(s,l,c){return{lat:o(l/c),lng:i(s/c)}}r.unproject=t;function n(s){return(180+s)/360}function a(s){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s*Math.PI/360)))/360}function i(s){return s*360-180}function o(s){return 360/Math.PI*Math.atan(Math.exp((180-s*360)*Math.PI/180))-90}})(Ke||(Ke={}));class Xn{constructor(e,t,n,a,i){d(this,"swLat");d(this,"swLng");d(this,"neLat");d(this,"neLng");const o=n*Math.pow(2,t),s=Ke.project(e.sw.lat,e.sw.lng,o),l=Ke.project(e.ne.lat,e.ne.lng,o),c=s.x-a,u=s.y+i,f=l.x+a,_=l.y-i,m=Ke.unproject(c,u,o),v=Ke.unproject(f,_,o);this.swLat=m.lat,this.swLng=m.lng,this.neLat=v.lat,this.neLng=v.lng}contains(e,t){return this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=t&&t<=this.neLng:t<=this.neLng||this.swLng<=t:!1}}var C;(function(r){r.assertEqual=a=>{};function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},r.getValidEnumValues=a=>{const i=r.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return r.objectValues(o)},r.objectValues=a=>r.objectKeys(a).map(function(i){return a[i]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},r.find=(a,i)=>{for(const o of a)if(i(o))return o},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(C||(C={}));var Jn;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Jn||(Jn={}));const y=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ee=r=>{switch(typeof r){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(r)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(r)?y.array:r===null?y.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?y.promise:typeof Map<"u"&&r instanceof Map?y.map:typeof Set<"u"&&r instanceof Set?y.set:typeof Date<"u"&&r instanceof Date?y.date:y.object;default:return y.unknown}},p=C.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ne extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let s=n,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(o))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return a(this),n}static assert(e){if(!(e instanceof ne))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];t[i]=t[i]||[],t[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ne.create=r=>new ne(r);const kt=(r,e)=>{let t;switch(r.code){case p.invalid_type:r.received===y.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case p.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,C.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:t=`Unrecognized key(s) in object: ${C.joinValues(r.keys,", ")}`;break;case p.invalid_union:t="Invalid input";break;case p.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${C.joinValues(r.options)}`;break;case p.invalid_enum_value:t=`Invalid enum value. Expected ${C.joinValues(r.options)}, received '${r.received}'`;break;case p.invalid_arguments:t="Invalid function arguments";break;case p.invalid_return_type:t="Invalid function return type";break;case p.invalid_date:t="Invalid date";break;case p.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:C.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case p.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case p.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case p.custom:t="Invalid input";break;case p.invalid_intersection_types:t="Intersection results could not be merged";break;case p.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case p.not_finite:t="Number must be finite";break;default:t=e.defaultError,C.assertNever(r)}return{message:t}};let Vi=kt;function zr(){return Vi}const Er=r=>{const{data:e,path:t,errorMaps:n,issueData:a}=r,i=[...t,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)s=c(o,{data:e,defaultError:s}).message;return{...a,path:i,message:s}};function h(r,e){const t=zr(),n=Er({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===kt?void 0:kt].filter(a=>!!a)});r.common.issues.push(n)}class Q{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if(a.status==="aborted")return x;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const a of t){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return Q.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return x;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}}const x=Object.freeze({status:"aborted"}),St=r=>({status:"dirty",value:r}),X=r=>({status:"valid",value:r}),Kn=r=>r.status==="aborted",Qn=r=>r.status==="dirty",Qe=r=>r.status==="valid",qt=r=>typeof Promise<"u"&&r instanceof Promise;var g;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(g||(g={}));class Me{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ea=(r,e)=>{if(Qe(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ne(r.common.issues);return this._error=t,this._error}}};function S(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,s)=>{const{message:l}=r;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??t??s.defaultError}},description:a}}class M{get description(){return this._def.description}_getType(e){return Ee(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ee(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Q,ctx:{common:e.parent.common,data:e.data,parsedType:Ee(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(qt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ee(e)},a=this._parseSync({data:e,path:n.path,parent:n});return ea(n,a)}"~validate"(e){var n,a;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ee(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return Qe(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>Qe(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ee(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(qt(a)?a:Promise.resolve(a));return ea(n,i)}refine(e,t){const n=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{const o=e(a),s=()=>i.addIssue({code:p.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new at({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Ae.create(this,this._def)}nullable(){return it.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return he.create(this)}promise(){return Ct.create(this,this._def)}or(e){return Ht.create([this,e],this._def)}and(e){return Yt.create(this,e,this._def)}transform(e){return new at({...S(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Lr({...S(this._def),innerType:this,defaultValue:t,typeName:w.ZodDefault})}brand(){return new po({typeName:w.ZodBranded,type:this,...S(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Rr({...S(this._def),innerType:this,catchValue:t,typeName:w.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Pr.create(this,e)}readonly(){return Or.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ui=/^c[^\s-]{8,}$/i,$i=/^[0-9a-z]+$/,qi=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Wi=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Hi=/^[a-z0-9_-]{21}$/i,Yi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Gi=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xi=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ji="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mr;const Ki=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,eo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,to=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ro=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,no=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ta="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ao=new RegExp(`^${ta}$`);function ra(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function io(r){return new RegExp(`^${ra(r)}$`)}function oo(r){let e=`${ta}T${ra(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function so(r,e){return!!((e==="v4"||!e)&&Ki.test(r)||(e==="v6"||!e)&&eo.test(r))}function lo(r,e){if(!Yi.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function co(r,e){return!!((e==="v4"||!e)&&Qi.test(r)||(e==="v6"||!e)&&to.test(r))}class Ce extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){const i=this._getOrReturnCtx(e);return h(i,{code:p.invalid_type,expected:y.string,received:i.parsedType}),x}const n=new Q;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:p.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:p.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,s=e.data.length<i.value;(o||s)&&(a=this._getOrReturnCtx(e,a),o?h(a,{code:p.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&h(a,{code:p.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Xi.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"email",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Mr||(Mr=new RegExp(Ji,"u")),Mr.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"emoji",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Wi.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"uuid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Hi.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"nanoid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Ui.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")$i.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid2",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")qi.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"ulid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),h(a,{validation:"url",code:p.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"regex",code:p.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),h(a,{code:p.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:p.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:p.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?oo(i).test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:p.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ao.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:p.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?io(i).test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:p.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Gi.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"duration",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?so(e.data,i.version)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"ip",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?lo(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"jwt",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?co(e.data,i.version)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cidr",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?ro.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"base64",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?no.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"base64url",code:p.invalid_string,message:i.message}),n.dirty()):C.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),{validation:t,code:p.invalid_string,...g.errToObj(n)})}_addCheck(e){return new Ce({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...g.errToObj(e)})}url(e){return this._addCheck({kind:"url",...g.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...g.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...g.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...g.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...g.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...g.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...g.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...g.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...g.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...g.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...g.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...g.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...g.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...g.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...g.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...g.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...g.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...g.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...g.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...g.errToObj(t)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Ce.create=r=>new Ce({checks:[],typeName:w.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...S(r)});function uo(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,i=Number.parseInt(r.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return i%o/10**a}class et extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==y.number){const i=this._getOrReturnCtx(e);return h(i,{code:p.invalid_type,expected:y.number,received:i.parsedType}),x}let n;const a=new Q;for(const i of this._def.checks)i.kind==="int"?C.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:p.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:p.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:p.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?uo(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),h(n,{code:p.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:p.not_finite,message:i.message}),a.dirty()):C.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,g.toString(t))}gt(e,t){return this.setLimit("min",e,!1,g.toString(t))}lte(e,t){return this.setLimit("max",e,!0,g.toString(t))}lt(e,t){return this.setLimit("max",e,!1,g.toString(t))}setLimit(e,t,n,a){return new et({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:g.toString(a)}]})}_addCheck(e){return new et({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:g.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:g.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&C.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}et.create=r=>new et({checks:[],typeName:w.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...S(r)});class zt extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==y.bigint)return this._getInvalidInput(e);let n;const a=new Q;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:p.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:p.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),h(n,{code:p.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):C.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return h(t,{code:p.invalid_type,expected:y.bigint,received:t.parsedType}),x}gte(e,t){return this.setLimit("min",e,!0,g.toString(t))}gt(e,t){return this.setLimit("min",e,!1,g.toString(t))}lte(e,t){return this.setLimit("max",e,!0,g.toString(t))}lt(e,t){return this.setLimit("max",e,!1,g.toString(t))}setLimit(e,t,n,a){return new zt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:g.toString(a)}]})}_addCheck(e){return new zt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}zt.create=r=>new zt({checks:[],typeName:w.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...S(r)});class Cr extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){const n=this._getOrReturnCtx(e);return h(n,{code:p.invalid_type,expected:y.boolean,received:n.parsedType}),x}return X(e.data)}}Cr.create=r=>new Cr({typeName:w.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...S(r)});class Wt extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){const i=this._getOrReturnCtx(e);return h(i,{code:p.invalid_type,expected:y.date,received:i.parsedType}),x}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return h(i,{code:p.invalid_date}),x}const n=new Q;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:p.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:p.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):C.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:g.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:g.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Wt.create=r=>new Wt({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:w.ZodDate,...S(r)});class na extends M{_parse(e){if(this._getType(e)!==y.symbol){const n=this._getOrReturnCtx(e);return h(n,{code:p.invalid_type,expected:y.symbol,received:n.parsedType}),x}return X(e.data)}}na.create=r=>new na({typeName:w.ZodSymbol,...S(r)});class aa extends M{_parse(e){if(this._getType(e)!==y.undefined){const n=this._getOrReturnCtx(e);return h(n,{code:p.invalid_type,expected:y.undefined,received:n.parsedType}),x}return X(e.data)}}aa.create=r=>new aa({typeName:w.ZodUndefined,...S(r)});class ia extends M{_parse(e){if(this._getType(e)!==y.null){const n=this._getOrReturnCtx(e);return h(n,{code:p.invalid_type,expected:y.null,received:n.parsedType}),x}return X(e.data)}}ia.create=r=>new ia({typeName:w.ZodNull,...S(r)});class Tr extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return X(e.data)}}Tr.create=r=>new Tr({typeName:w.ZodAny,...S(r)});class tt extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return X(e.data)}}tt.create=r=>new tt({typeName:w.ZodUnknown,...S(r)});class Te extends M{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:p.invalid_type,expected:y.never,received:t.parsedType}),x}}Te.create=r=>new Te({typeName:w.ZodNever,...S(r)});class Ar extends M{_parse(e){if(this._getType(e)!==y.undefined){const n=this._getOrReturnCtx(e);return h(n,{code:p.invalid_type,expected:y.void,received:n.parsedType}),x}return X(e.data)}}Ar.create=r=>new Ar({typeName:w.ZodVoid,...S(r)});class he extends M{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==y.array)return h(t,{code:p.invalid_type,expected:y.array,received:t.parsedType}),x;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(o||s)&&(h(t,{code:o?p.too_big:p.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(h(t,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(h(t,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,s)=>a.type._parseAsync(new Me(t,o,t.path,s)))).then(o=>Q.mergeArray(n,o));const i=[...t.data].map((o,s)=>a.type._parseSync(new Me(t,o,t.path,s)));return Q.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new he({...this._def,minLength:{value:e,message:g.toString(t)}})}max(e,t){return new he({...this._def,maxLength:{value:e,message:g.toString(t)}})}length(e,t){return new he({...this._def,exactLength:{value:e,message:g.toString(t)}})}nonempty(e){return this.min(1,e)}}he.create=(r,e)=>new he({type:r,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...S(e)});function rt(r){if(r instanceof D){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=Ae.create(rt(n))}return new D({...r._def,shape:()=>e})}else return r instanceof he?new he({...r._def,type:rt(r.element)}):r instanceof Ae?Ae.create(rt(r.unwrap())):r instanceof it?it.create(rt(r.unwrap())):r instanceof ge?ge.create(r.items.map(e=>rt(e))):r}class D extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=C.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==y.object){const c=this._getOrReturnCtx(e);return h(c,{code:p.invalid_type,expected:y.object,received:c.parsedType}),x}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Te&&this._def.unknownKeys==="strip"))for(const c in a.data)o.includes(c)||s.push(c);const l=[];for(const c of o){const u=i[c],f=a.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Me(a,f,a.path,c)),alwaysSet:c in a.data})}if(this._def.catchall instanceof Te){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(c==="strict")s.length>0&&(h(a,{code:p.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of s){const f=a.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Me(a,f,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,_=await u.value;c.push({key:f,value:_,alwaysSet:u.alwaysSet})}return c}).then(c=>Q.mergeObjectSync(n,c)):Q.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return g.errToObj,new D({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:g.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new D({...this._def,unknownKeys:"strip"})}passthrough(){return new D({...this._def,unknownKeys:"passthrough"})}extend(e){return new D({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new D({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new D({...this._def,catchall:e})}pick(e){const t={};for(const n of C.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new D({...this._def,shape:()=>t})}omit(e){const t={};for(const n of C.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new D({...this._def,shape:()=>t})}deepPartial(){return rt(this)}partial(e){const t={};for(const n of C.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new D({...this._def,shape:()=>t})}required(e){const t={};for(const n of C.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Ae;)i=i._def.innerType;t[n]=i}return new D({...this._def,shape:()=>t})}keyof(){return ca(C.objectKeys(this.shape))}}D.create=(r,e)=>new D({shape:()=>r,unknownKeys:"strip",catchall:Te.create(),typeName:w.ZodObject,...S(e)}),D.strictCreate=(r,e)=>new D({shape:()=>r,unknownKeys:"strict",catchall:Te.create(),typeName:w.ZodObject,...S(e)}),D.lazycreate=(r,e)=>new D({shape:r,unknownKeys:"strip",catchall:Te.create(),typeName:w.ZodObject,...S(e)});class Ht extends M{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new ne(s.ctx.common.issues));return h(t,{code:p.invalid_union,unionErrors:o}),x}if(t.common.async)return Promise.all(n.map(async i=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const l of n){const c={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(l=>new ne(l));return h(t,{code:p.invalid_union,unionErrors:s}),x}}get options(){return this._def.options}}Ht.create=(r,e)=>new Ht({options:r,typeName:w.ZodUnion,...S(e)});function Nr(r,e){const t=Ee(r),n=Ee(e);if(r===e)return{valid:!0,data:r};if(t===y.object&&n===y.object){const a=C.objectKeys(e),i=C.objectKeys(r).filter(s=>a.indexOf(s)!==-1),o={...r,...e};for(const s of i){const l=Nr(r[s],e[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(t===y.array&&n===y.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<r.length;i++){const o=r[i],s=e[i],l=Nr(o,s);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return t===y.date&&n===y.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class Yt extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(Kn(i)||Kn(o))return x;const s=Nr(i.value,o.value);return s.valid?((Qn(i)||Qn(o))&&t.dirty(),{status:t.value,value:s.data}):(h(n,{code:p.invalid_intersection_types}),x)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Yt.create=(r,e,t)=>new Yt({left:r,right:e,typeName:w.ZodIntersection,...S(t)});class ge extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.array)return h(n,{code:p.invalid_type,expected:y.array,received:n.parsedType}),x;if(n.data.length<this._def.items.length)return h(n,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&n.data.length>this._def.items.length&&(h(n,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Me(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>Q.mergeArray(t,o)):Q.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new ge({...this._def,rest:e})}}ge.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ge({items:r,typeName:w.ZodTuple,rest:null,...S(e)})};class oa extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.map)return h(n,{code:p.invalid_type,expected:y.map,received:n.parsedType}),x;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,l],c)=>({key:a._parse(new Me(n,s,n.path,[c,"key"])),value:i._parse(new Me(n,l,n.path,[c,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return x;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),s.set(c.value,u.value)}return{status:t.value,value:s}})}else{const s=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return x;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),s.set(c.value,u.value)}return{status:t.value,value:s}}}}oa.create=(r,e,t)=>new oa({valueType:e,keyType:r,typeName:w.ZodMap,...S(t)});class Et extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.set)return h(n,{code:p.invalid_type,expected:y.set,received:n.parsedType}),x;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(h(n,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(h(n,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const i=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return x;u.status==="dirty"&&t.dirty(),c.add(u.value)}return{status:t.value,value:c}}const s=[...n.data.values()].map((l,c)=>i._parse(new Me(n,l,n.path,c)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(e,t){return new Et({...this._def,minSize:{value:e,message:g.toString(t)}})}max(e,t){return new Et({...this._def,maxSize:{value:e,message:g.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Et.create=(r,e)=>new Et({valueType:r,minSize:null,maxSize:null,typeName:w.ZodSet,...S(e)});class Mt extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.function)return h(t,{code:p.invalid_type,expected:y.function,received:t.parsedType}),x;function n(s,l){return Er({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,zr(),kt].filter(c=>!!c),issueData:{code:p.invalid_arguments,argumentsError:l}})}function a(s,l){return Er({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,zr(),kt].filter(c=>!!c),issueData:{code:p.invalid_return_type,returnTypeError:l}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Ct){const s=this;return X(async function(...l){const c=new ne([]),u=await s._def.args.parseAsync(l,i).catch(m=>{throw c.addIssue(n(l,m)),c}),f=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(f,i).catch(m=>{throw c.addIssue(a(f,m)),c})})}else{const s=this;return X(function(...l){const c=s._def.args.safeParse(l,i);if(!c.success)throw new ne([n(l,c.error)]);const u=Reflect.apply(o,this,c.data),f=s._def.returns.safeParse(u,i);if(!f.success)throw new ne([a(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Mt({...this._def,args:ge.create(e).rest(tt.create())})}returns(e){return new Mt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Mt({args:e||ge.create([]).rest(tt.create()),returns:t||tt.create(),typeName:w.ZodFunction,...S(n)})}}class sa extends M{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}sa.create=(r,e)=>new sa({getter:r,typeName:w.ZodLazy,...S(e)});class la extends M{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:p.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}la.create=(r,e)=>new la({value:r,typeName:w.ZodLiteral,...S(e)});function ca(r,e){return new nt({values:r,typeName:w.ZodEnum,...S(e)})}class nt extends M{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return h(t,{expected:C.joinValues(n),received:t.parsedType,code:p.invalid_type}),x}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return h(t,{received:t.data,code:p.invalid_enum_value,options:n}),x}return X(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return nt.create(e,{...this._def,...t})}exclude(e,t=this._def){return nt.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}nt.create=ca;class ua extends M{_parse(e){const t=C.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==y.string&&n.parsedType!==y.number){const a=C.objectValues(t);return h(n,{expected:C.joinValues(a),received:n.parsedType,code:p.invalid_type}),x}if(this._cache||(this._cache=new Set(C.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=C.objectValues(t);return h(n,{received:n.data,code:p.invalid_enum_value,options:a}),x}return X(e.data)}get enum(){return this._def.values}}ua.create=(r,e)=>new ua({values:r,typeName:w.ZodNativeEnum,...S(e)});class Ct extends M{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.promise&&t.common.async===!1)return h(t,{code:p.invalid_type,expected:y.promise,received:t.parsedType}),x;const n=t.parsedType===y.promise?t.data:Promise.resolve(t.data);return X(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ct.create=(r,e)=>new Ct({type:r,typeName:w.ZodPromise,...S(e)});class at extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{h(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async s=>{if(t.value==="aborted")return x;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?x:l.status==="dirty"||t.value==="dirty"?St(l.value):l});{if(t.value==="aborted")return x;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?x:s.status==="dirty"||t.value==="dirty"?St(s.value):s}}if(a.type==="refinement"){const o=s=>{const l=a.refinement(s,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?x:(s.status==="dirty"&&t.dirty(),o(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?x:(s.status==="dirty"&&t.dirty(),o(s.value).then(()=>({status:t.value,value:s.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Qe(o))return x;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Qe(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:t.value,value:s})):x);C.assertNever(a)}}at.create=(r,e,t)=>new at({schema:r,typeName:w.ZodEffects,effect:e,...S(t)}),at.createWithPreprocess=(r,e,t)=>new at({schema:e,effect:{type:"preprocess",transform:r},typeName:w.ZodEffects,...S(t)});class Ae extends M{_parse(e){return this._getType(e)===y.undefined?X(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ae.create=(r,e)=>new Ae({innerType:r,typeName:w.ZodOptional,...S(e)});class it extends M{_parse(e){return this._getType(e)===y.null?X(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}it.create=(r,e)=>new it({innerType:r,typeName:w.ZodNullable,...S(e)});class Lr extends M{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===y.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Lr.create=(r,e)=>new Lr({innerType:r,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});class Rr extends M{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return qt(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ne(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ne(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Rr.create=(r,e)=>new Rr({innerType:r,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});class da extends M{_parse(e){if(this._getType(e)!==y.nan){const n=this._getOrReturnCtx(e);return h(n,{code:p.invalid_type,expected:y.nan,received:n.parsedType}),x}return{status:"valid",value:e.data}}}da.create=r=>new da({typeName:w.ZodNaN,...S(r)});class po extends M{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Pr extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?x:i.status==="dirty"?(t.dirty(),St(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?x:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new Pr({in:e,out:t,typeName:w.ZodPipeline})}}class Or extends M{_parse(e){const t=this._def.innerType._parse(e),n=a=>(Qe(a)&&(a.value=Object.freeze(a.value)),a);return qt(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}}Or.create=(r,e)=>new Or({innerType:r,typeName:w.ZodReadonly,...S(e)});var w;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(w||(w={}));const fe=Ce.create,b=et.create,pa=Cr.create,jr=Tr.create;tt.create,Te.create;const Gt=Ar.create,Xt=he.create,P=D.create;Ht.create,Yt.create;const ha=ge.create,ie=Mt.create,ho=nt.create,fo=Ct.create;Ae.create,it.create,P({pin:P({fade:pa().optional(),maxCount:b().optional(),maxZoom:b().optional()}).optional(),animation:P({queue:P({limit:b().optional()}).optional()}).optional()});const Ir=b().min(-90).max(90),Dr=b().min(-180).max(180),mo=P({sw:P({lat:Ir,lng:Dr}),ne:P({lat:Ir,lng:Dr})}),Zr=jr().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),yo=P({mapSize:b().min(1),zoomMin:b().min(0),zoomMax:b().min(0),zoomScale:b().min(1).max(10)}),go=P({instance:jr(),inserted:ie().returns(pa()),insert:ie().returns(Gt()),remove:ie().returns(Gt()),update:ie().args(b()).returns(Gt())}),_o=P({getParameters:ie().args().returns(yo),getContainer:ie().args().returns(Zr),getZoom:ie().args().returns(b()),getBounds:ie().args().returns(mo),panBy:ie().args(b(),b()).returns(Gt()),createMarker:ie().args(Zr,Ir,Dr,b()).returns(go)}),Fr=ie().args(fe()).returns(fo(Zr)),vo=P({id:fe().min(1),rank:b(),lat:b().min(-90).max(90),lng:b().min(-180).max(180),tooltip:P({style:P({width:b(),height:b(),margin:b(),radius:b()}).refine(r=>Math.min(r.width,r.height)/r.margin>=6,"Tooltip: minimum of width or height must be greater than or equal to 6 * margin"),body:Fr}),pin:P({style:P({width:b(),height:b(),radius:b()}),body:Fr}).optional(),popup:P({style:P({width:b(),height:b(),radius:b(),margin:b()}),body:Fr}).optional()}),xo=Xt(vo);var Ze;(r=>{r.COUNT=12,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],r.DEGREES_DEFAULT=270})(Ze||(Ze={}));const Br=fe().length(32),wo=fe().min(1);P({key:Br,version:fe()});const bo=ha([b(),Xt(ha([b(),b()]))]),fa=P({mapSize:b().min(1),zoomMin:b().min(0).max(24),zoomMax:b().min(0).max(24),zoomScale:b().min(1).max(10)}),ko=P({id:fe(),rank:b(),lat:b(),lng:b(),width:b(),height:b(),margin:b()});P({key:Br,parameters:fa,input:Xt(ko),token:fe().optional()}),P({token:fe().optional(),states:Xt(bo)});const So=ho(["info","warn","error"]);P({level:So,key:fe(),title:fe(),content:jr()});const ma="1.1.1",Vr="https://maps.api.arenarium.dev",zo=`${Vr}/auth`,Eo=`${Vr}/states`,Mo=`${Vr}/log`;class Ur{constructor(e,t,n,a){d(this,"apiKey");d(this,"apiToken");d(this,"apiDevEnvironment");d(this,"mapProvider");d(this,"markerDataArray",new Array);d(this,"markerDataMap",new Map);d(this,"markerDataUpdating",!1);d(this,"markerPinProcessor");d(this,"markerTooltipProcessor");d(this,"markerPopupProcessor");Br.parse(e),wo.parse(t),_o.parse(n),this.apiKey=e,this.apiToken=t,this.apiDevEnvironment=(window==null?void 0:window.location.host.startsWith("localhost"))||(window==null?void 0:window.location.host.startsWith("127.0.0.1")),this.mapProvider=n,this.markerPinProcessor=new Wr(n),this.markerTooltipProcessor=new To(n),this.markerPopupProcessor=new Ao(n),this.setConfiguration(a)}static async create(e,t,n){const i=await fetch(zo,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,version:ma})});if(i==null)throw new Error("Failed to authenticate");if(i.status!=200)throw new Error(i.statusText);let o=await i.text();if(o==null)throw new Error("Failed to get api token");return new Ur(e,o,t,n)}setConfiguration(e){var t,n;ze.setLimit(((n=(t=e==null?void 0:e.animation)==null?void 0:t.queue)==null?void 0:n.limit)??8*navigator.hardwareConcurrency),this.markerPinProcessor.setConfiguration(e)}async updateMarkers(e){xo.parse(e);try{await this.updateMarkerData(e),this.processMarkerDataCallback()}catch(t){throw console.error(t),this.removeMarkerData(),t instanceof Error&&this.log("error","Failed to update markers",t),t}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const t of this.markerDataArray)t.marker.id==e?this.markerPopupProcessor.show(t):this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const n of this.markerDataArray)this.markerPopupProcessor.hide(n);throw t instanceof Error&&this.log("error","Failed to show popup",t),t}}hidePopup(e){try{if(e){const t=this.markerDataMap.get(e);if(t==null)return;this.markerPopupProcessor.hide(t)}else for(const t of this.markerDataArray)this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const n of this.markerDataArray)this.markerPopupProcessor.hide(n);throw t instanceof Error&&this.log("error","Failed to hide popup",t),t}}async updateMarkerData(e){try{let t=this.markerDataArray.map(a=>a.marker);for(let a=0;a<e.length;a++){const i=e[a];this.markerDataMap.get(i.id)||t.push(i)}const n=await this.getMarkerStates(t);try{this.markerDataUpdating=!0;for(let a=0;a<t.length;a++){const i=t[a],o=n[a],s=this.markerDataMap.get(i.id);if(s)s.update(o);else{const l=new Co(this.mapProvider,i,o);l.create(),this.markerDataMap.set(i.id,l),this.markerDataArray.push(l)}}this.markerDataArray.sort((a,i)=>a.zoom-i.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(a=>a.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(a=>a.tooltip)),this.markerPopupProcessor.updateElements(this.markerDataArray.map(a=>a.popup).filter(a=>a!=null))}finally{this.markerDataUpdating=!1}}catch(t){throw console.error(t),this.markerDataArray.forEach(n=>n.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),t instanceof Error&&this.log("error","Failed to update marker data",t),t}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.removeElements(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove marker data",e),e}finally{this.markerDataUpdating=!1}}async getMarkerStates(e){if(e.length==0)return[];if(e.length==1)return[[0,[[0,Ze.DEGREES.indexOf(Ze.DEGREES_DEFAULT)]]]];const t=this.mapProvider.getParameters();fa.parse(t);const n=e.map(s=>({id:s.id,rank:s.rank,lat:s.lat,lng:s.lng,width:s.tooltip.style.width,height:s.tooltip.style.height,margin:s.tooltip.style.margin})),a={key:this.apiKey,token:this.apiToken,parameters:t,input:n},i=await fetch(Eo,{method:"POST",headers:{"Content-Type":"application/json","Cache-Control":this.apiDevEnvironment?"no-cache":""},body:JSON.stringify(a)});if(!i.ok)throw new Error("Failed to get marker states: "+i.statusText);const o=await i.json();return o.token&&(this.apiToken=o.token),o.states}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e),e instanceof Error&&this.log("error","Failed to process marker data",e)}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.mapProvider.getBounds(),t=this.mapProvider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,t),this.markerPinProcessor.process(e,t)}async log(e,t,n){if(!this.apiDevEnvironment)try{const a={key:this.apiKey,title:t,level:e,content:{version:ma,...n}};await fetch(Mo,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(a){console.error(a)}}}class Co{constructor(e,t,n){d(this,"marker");d(this,"zoom");d(this,"pin");d(this,"tooltip");d(this,"popup");this.marker=t,this.zoom=n[0],this.pin=new qr(e,t,n),this.tooltip=new Hr(e,t,n),t.popup&&(this.popup=new Yr(e,t))}create(){var e;this.pin.create(),this.tooltip.create(),(e=this.popup)==null||e.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){var e;this.pin.remove(),this.tooltip.remove(),(e=this.popup)==null||e.remove()}}class $r{constructor(e,t){d(this,"provider");d(this,"id");d(this,"lat");d(this,"lng");d(this,"shown");d(this,"element");d(this,"component");d(this,"marker");this.provider=e,this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.updateZIndex()}createElement(){throw new Error("Create element not implemented")}createMarker(){const e=this.element;if(!e)throw new Error("Failed to create provider marker");this.marker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}updateZIndex(){if(this.marker==null)throw new Error("Failed to update provider marker z-index");this.marker.update(this.getZindex())}updateMap(e){const t=this.marker,n=this.component;if(t==null||n==null)throw new Error("Failed to update provider marker map");e?t.inserted()==!1&&t.insert():t.inserted()==!0&&t.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){var e;(e=this.marker)==null||e.remove()}}const ut=class ut extends $r{constructor(t,n,a){var i,o,s,l;super(t,n);d(this,"width");d(this,"height");d(this,"radius");d(this,"zoom");d(this,"bodyLoading",!1);d(this,"bodyLoaded",!1);d(this,"bodyCallback");this.width=((i=n.pin)==null?void 0:i.style.width)??ut.DEFAULT_SIZE,this.height=((o=n.pin)==null?void 0:o.style.height)??ut.DEFAULT_SIZE,this.radius=((s=n.pin)==null?void 0:s.style.radius)??ut.DEFAULT_SIZE,this.zoom=a[0],this.bodyCallback=(l=n.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=wr(Fi,{target:this.element,props:{id:this.id+"_pin",layer:Ii,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(t){this.zoom=t[0],this.updateZIndex()}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateBody(){var n;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{a instanceof HTMLElement?t.appendChild(a):console.error("Failed to load pin body")}).catch(a=>console.error(a)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(t){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setCollapsed(t)}setScale(t){if(this.component==null)throw new Error("Failed to set pin scale");this.component.setScale(t)}getScaleFromZoomDistance(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};d(ut,"DEFAULT_SIZE",16);let qr=ut;const dt=class dt{constructor(e){d(this,"provider");d(this,"pinElements",new Array);d(this,"pinMaxWidth",0);d(this,"pinMaxHeight",0);d(this,"pinFade",!1);d(this,"pinMaxCount",0);d(this,"pinMaxZoomDelta",0);this.provider=e}setConfiguration(e){var t,n,a;this.pinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.pinMaxCount=((n=e==null?void 0:e.pin)==null?void 0:n.maxCount)??Math.max(dt.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((a=e==null?void 0:e.pin)==null?void 0:a.maxZoom)??dt.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((t,n)=>Math.max(t,n.width),0),this.pinMaxHeight=e.reduce((t,n)=>Math.max(t,n.height),0)}removeElements(){this.pinElements.forEach(e=>e.remove()),this.pinElements.length=0}process(e,t){const n=this.provider.getParameters().mapSize,a=new Xn(e,t,n,this.pinMaxWidth*2,this.pinMaxHeight*2);let i=0;for(const o of this.pinElements)a.contains(o.lat,o.lng)?o.shown&&t<o.zoom&&o.zoom<t+this.pinMaxZoomDelta?(i<this.pinMaxCount&&(o.setCollapsed(!1),o.setScale(this.pinFade?o.getScaleFromZoomDistance(t):1),o.updateMap(!0),o.isBodyLoaded()==!1&&o.updateBody()),i++):(o.setCollapsed(!0),o.isCollapsed()&&o.updateMap(!1)):o.updateMap(!1)}};d(dt,"MAP_PINS_MAX_ZOOM",2),d(dt,"MAP_PINS_MAX_COUNT",128);let Wr=dt;const Kt=class Kt extends $r{constructor(t,n,a){super(t,n);d(this,"width");d(this,"height");d(this,"margin");d(this,"radius");d(this,"zoom");d(this,"angle");d(this,"states");d(this,"bodyLoading",!1);d(this,"bodyLoaded",!1);d(this,"bodyCallback");this.width=n.tooltip.style.width,this.height=n.tooltip.style.height,this.margin=n.tooltip.style.margin,this.radius=n.tooltip.style.radius,this.zoom=a[0],this.angle=Ze.DEGREES_DEFAULT,this.states=a[1].map(i=>[i[0],Ze.DEGREES[i[1]]]),this.bodyCallback=n.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=wr(Gn,{target:this.element,props:{id:this.id+"_tooltip",layer:ji,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(t){this.zoom=t[0],this.states=t[1].map(n=>[n[0],Ze.DEGREES[n[1]]]),this.updateZIndex()}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(t),this.component.setAngle(this.angle)}updateBody(){var n;if(this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{a instanceof HTMLElement?t.appendChild(a):console.error("Failed to load tooltip body")}).catch(a=>console.error(a)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(t){const n=this.states.findLast(a=>a[0]<=t);if(!n)throw new Error("Angle not found");return n[1]}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)+Kt.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(t)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};d(Kt,"Z_INDEX_OFFSET",1e6);let Hr=Kt;class To{constructor(e){d(this,"provider");d(this,"tooltipElements",new Array);d(this,"tooltipMaxWidth",0);d(this,"tooltipMaxHeight",0);this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((t,n)=>Math.max(t,n.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((t,n)=>Math.max(t,n.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.remove()),this.tooltipElements.length=0}process(e,t){const n=this.provider.getParameters().mapSize,a=new Xn(e,t,n,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const i of this.tooltipElements)a.contains(i.lat,i.lng)?i.shown&&i.zoom<=t?(i.updateState(t),i.setCollapsed(!1),i.updateMap(!0),i.isCollapsed()==!1&&i.isBodyLoaded()==!1&&i.updateBody()):(i.setCollapsed(!0),i.isCollapsed()&&i.updateMap(!1)):i.updateMap(!1)}}const Qt=class Qt extends $r{constructor(t,n){if(n.popup==null)throw new Error("Failed to create popup");super(t,n);d(this,"width");d(this,"height");d(this,"margin");d(this,"radius");d(this,"bodyLoading",!1);d(this,"bodyLoaded",!1);d(this,"bodyCallback");this.shown=!1,this.width=n.popup.style.width,this.height=n.popup.style.height,this.margin=n.popup.style.margin,this.radius=n.popup.style.radius,this.bodyCallback=n.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=wr(Gn,{target:this.element,props:{id:this.id+"_popup",layer:Oi,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateBody(){var n;if(this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{a instanceof HTMLElement?t.appendChild(a):console.error("Failed to load popup body")}).catch(a=>console.error(a)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return Qt.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(t)}setAngle(t){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(t,!0)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};d(Qt,"Z_INDEX_OFFSET",2e6);let Yr=Qt;class Ao{constructor(e){d(this,"provider");d(this,"popupElements",new Array);d(this,"popupPositioned",new Map);this.provider=e}show(e){e.popup&&(e.pin.shown=!1,e.tooltip.shown=!1,this.popupPositioned.set(e.marker.id,!1),e.popup.setAngle(e.tooltip.angle),e.popup.shown=!0)}hide(e){e.popup&&(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}updateElements(e){this.popupElements=e,this.popupPositioned=new Map(e.map(t=>[t.id,!1]))}removeElements(){this.popupElements.forEach(e=>e.remove()),this.popupElements.length=0,this.popupPositioned.clear()}process(){var e,t;for(const n of this.popupElements)if(n.shown){if(n.setCollapsed(!1),n.updateMap(!0),n.isExpanded()&&n.isBodyLoaded()==!1&&n.updateBody(),n.isCollapsed()==!1&&this.popupPositioned.get(n.id)==!1){const a=(e=n.component)==null?void 0:e.getBody();if(a==null)continue;const i=(t=n.component)==null?void 0:t.getOffsets();if(i==null)continue;const o=a.getBoundingClientRect();if(o.x==0&&o.y==0&&o.width==0&&o.height==0)continue;const s=o.x+o.width/2,l=o.y+o.height/2,c=s+i.x,u=l+i.y,f=c+n.width,_=u+n.height,m=this.provider.getContainer().getBoundingClientRect(),v=c-m.left,O=m.right-f,Y=u-m.top,se=m.bottom-_,L=Math.min(n.width,n.height)/4,F=v<0?v-L:O<0?-O+L:0,me=Y<0?Y-L:se<0?-se+L:0;this.provider.panBy(F,me),this.popupPositioned.set(n.id,!0)}}else n.setCollapsed(!0),n.isCollapsed()&&n.updateMap(!1)}}const No=()=>'<img src="https://arenarium.dev/favicon.svg" alt="Arenarium Maps" style="height: 1.25em; vertical-align: middle;" />',Gr=()=>`<a href="https://arenarium.dev" target="_blank" style="color: inherit;">${No()}<span> @arenarium/maps</span></a>`;class Lo{constructor(e,t,n){d(this,"MapClass");d(this,"MapMarkerClass");d(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...n,minZoom:Math.max(n.minZoom??0,0),maxZoom:Math.min(n.maxZoom??22,24),style:n.style??"https://tiles.openfreemap.org/styles/liberty",pitchWithRotate:!1,attributionControl:n.attributionControl??{compact:!1,customAttribution:Gr()}}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable(),this.map.on("load",()=>{const a=this.map.getContainer();a!=null&&(a.style.zIndex="0");const i=document.getElementsByClassName("maplibregl-ctrl-bottom-right")[0];i!=null&&(i.style.zIndex=Number.MAX_SAFE_INTEGER.toString())})}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds(),t=e.getSouthWest(),n=e.getNorthEast();return{sw:t,ne:n}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,n){const a=new this.MapMarkerClass({element:e});return a.setLngLat([n,t]),{instance:a,inserted:()=>a._map!=null,insert:()=>a.addTo(this.map),remove:()=>a.remove(),update:i=>a.getElement().style.zIndex=i.toString()}}}const Ro={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(120, 120, 120, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(128, 128, 128, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(56, 56, 56, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(153, 153, 153, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(104, 104, 104, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(56, 56, 56, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(136, 136, 136, 1)","fill-outline-color":"rgba(102, 102, 102, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(50, 50, 50, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(52, 52, 52, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(88, 88, 88, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20],"line-color":"rgba(102, 102, 102, 1)"}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23],"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":2,"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(51, 51, 51, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(51, 51, 51, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(255, 255, 255, 1)","text-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]},Po={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(220, 220, 220, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(228, 228, 228, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(156, 156, 156, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(253, 253, 253, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(204, 204, 204, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(156, 156, 156, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(236, 236, 236, 1)","fill-outline-color":"rgba(202, 202, 202, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(185, 185, 185)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(150, 150, 150, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(152, 152, 152, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(188, 188, 188)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(185, 185, 185)","line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23]}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":2}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(151, 151, 151, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(151, 151, 151, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1.5}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(0, 0, 0, 1)","text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]};class Oo{constructor(e,t,n){d(this,"MapClass");d(this,"MapMarkerClass");d(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...n,minZoom:Math.max(n.minZoom??0,0),maxZoom:Math.min(n.maxZoom??22,24),projection:"mercator",pitchWithRotate:!1,customAttribution:n.customAttribution??Gr()}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable(),this.map.on("load",()=>{const a=this.map.getContainer();a!=null&&(a.style.zIndex="0");const i=document.getElementsByClassName("mapboxgl-ctrl-bottom-right")[0];i!=null&&(i.style.zIndex=Number.MAX_SAFE_INTEGER.toString())})}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds();if(!e)return{sw:{lat:0,lng:0},ne:{lat:0,lng:0}};const t=e.getSouthWest(),n=e.getNorthEast();return{sw:t,ne:n}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,n){const a=new this.MapMarkerClass({element:e});return a.setLngLat([n,t]),{instance:a,inserted:()=>a._map!=null,insert:()=>a.addTo(this.map),remove:()=>a.remove(),update:i=>a.getElement().style.zIndex=i.toString()}}}class jo{constructor(e,t,n,a){d(this,"MapClass");d(this,"MapMarkerClass");d(this,"map");d(this,"options");d(this,"attributionObserver");d(this,"attributionElement");this.MapClass=e,this.MapMarkerClass=t,this.options=a,this.map=new this.MapClass(n,{...a}),(a.attribution||a.attribution==null)&&(this.map.addListener("idle",()=>{this.attributionObserver||(this.attributionObserver=new MutationObserver((i,o)=>{this.insertAttributionElement(),this.attributionElement!=null&&(this.updateAttributionElement(),o.disconnect())}),this.attributionObserver.observe(n,{childList:!0,subtree:!0}))}),this.map.addListener("bounds_changed",()=>{this.updateAttributionElement()}))}insertAttributionElement(){var i,o;const e=this.map.getDiv();if(e==null)return;const t=e.getElementsByClassName("gmnoprint")[0];if(t==null||t.parentElement==null)return;const n=t.cloneNode(!0),a=(o=(i=n.childNodes.item(0))==null?void 0:i.childNodes.item(1))==null?void 0:o.childNodes.item(0);a!=null&&(a.title="",a.innerHTML=Gr(),t.parentElement.insertBefore(n,t),this.attributionElement=a)}updateAttributionElement(){var n,a;const e=this.map.getDiv();if(e==null)return;const t=(a=(n=this.attributionElement)==null?void 0:n.childNodes.item(0))==null?void 0:a.childNodes.item(1);t!=null&&(t.style.display=e.clientWidth>500?"initial":"none")}getParameters(){return{mapSize:256,zoomMin:this.options.minZoom??0,zoomMax:this.options.maxZoom??24,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getDiv()}getZoom(){return this.map.getZoom()??NaN}getBounds(){const e=this.map.getBounds();if(e==null)return{sw:{lat:NaN,lng:NaN},ne:{lat:NaN,lng:NaN}};const t=e.getSouthWest(),n=e.getNorthEast();return{sw:{lat:t.lat(),lng:t.lng()},ne:{lat:n.lat(),lng:n.lng()}}}panBy(e,t){this.map.panBy(e,t)}createMarker(e,t,n,a){const i=new this.MapMarkerClass({position:{lat:t,lng:n},content:e,zIndex:a});return{instance:i,inserted:()=>i.map!=null&&i.map==this.map,insert:()=>i.map=this.map,remove:()=>i.map=void 0,update:o=>i.zIndex=o}}}const Io=[{elementType:"labels.icon",stylers:[{visibility:"off"}]},{stylers:[{saturation:-100},{lightness:-10}]},{featureType:"landscape",stylers:[{lightness:30}]},{featureType:"road",elementType:"geometry",stylers:[{saturation:-100}]}],Do=[{elementType:"labels.icon",stylers:[{visibility:"off"}]},{stylers:[{saturation:-100}]},{elementType:"geometry",stylers:[{lightness:-45}]},{elementType:"labels.text.fill",stylers:[{lightness:-100}]},{elementType:"labels.text.stroke",stylers:[{lightness:-15}]},{featureType:"water",elementType:"geometry",stylers:[{lightness:-50}]}];z.GoogleMapDarkStyle=Do,z.GoogleMapLightStyle=Io,z.GoogleMapsProvider=jo,z.MapManager=Ur,z.MapboxProvider=Oo,z.MaplibreDarkStyle=Ro,z.MaplibreLightStyle=Po,z.MaplibreProvider=Lo,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(z,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(z=typeof globalThis<"u"?globalThis:z||self,N(z.arenarium={}))})(this,(function(z){"use strict";var Yo=Object.defineProperty;var Sa=z=>{throw TypeError(z)};var Go=(z,N,j)=>N in z?Yo(z,N,{enumerable:!0,configurable:!0,writable:!0,value:j}):z[N]=j;var d=(z,N,j)=>Go(z,typeof N!="symbol"?N+"":N,j),en=(z,N,j)=>N.has(z)||Sa("Cannot "+j);var k=(z,N,j)=>(en(z,N,"read from private field"),j?j.call(z):N.get(z)),Z=(z,N,j)=>N.has(z)?Sa("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(z):N.set(z,j),U=(z,N,j,jt)=>(en(z,N,"write to private field"),jt?jt.call(z,j):N.set(z,j),j),Ue=(z,N,j)=>(en(z,N,"access private method"),j);var At,ot,Ne,Nt,Lt,Fe,st,Be,Le,lt,Rt,Pt,oe,za,ir,tn,_a,_e,ct,Ot,Ve;var j=Array.isArray,jt=Array.prototype.indexOf,Ea=Array.from,or=Object.defineProperty,ht=Object.getOwnPropertyDescriptor,Ma=Object.prototype,Ca=Array.prototype,Ta=Object.getPrototypeOf,rn=Object.isExtensible;function Aa(r){for(var e=0;e<r.length;e++)r[e]()}function Na(){var r,e,t=new Promise((n,a)=>{r=n,e=a});return{promise:t,resolve:r,reject:e}}const J=2,sr=4,nn=8,mt=16,xe=32,Pe=64,an=128,ee=256,Dt=512,G=1024,le=2048,we=4096,$e=8192,qe=16384,lr=32768,La=65536,on=1<<17,Ra=1<<18,yt=1<<19,Pa=1<<20,cr=1<<21,ur=1<<22,Oe=1<<23,Zt=Symbol("$state"),dr=new class extends Error{constructor(){super(...arguments);d(this,"name","StaleReactionError");d(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Oa(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Ia(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function ja(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Da(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Za(r){throw new Error("https://svelte.dev/e/effect_orphan")}function Fa(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ba(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Va(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ua(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const $a=2,B=Symbol();function sn(r){return r===this.v}let Xo=!1,ae=null;function Ft(r){ae=r}function pr(r,e=!1,t){ae={p:ae,c:null,e:null,s:r,x:null,l:null}}function fr(r){var e=ae,t=e.e;if(t!==null){e.e=null;for(var n of t)zn(n)}return r!==void 0&&(e.x=r),ae=e.p,r??{}}function ln(){return!0}const qa=new WeakMap;function Wa(r){var e=T;if(e===null)return E.f|=Oe,r;if((e.f&lr)===0){if((e.f&an)===0)throw!e.parent&&r instanceof Error&&cn(r),r;e.b.error(r)}else hr(r,e)}function hr(r,e){for(;e!==null;){if((e.f&an)!==0)try{e.b.error(r);return}catch(t){r=t}e=e.parent}throw r instanceof Error&&cn(r),r}function cn(r){const e=qa.get(r);e&&(or(r,"message",{value:e.message}),or(r,"stack",{value:e.stack}))}let We=[];function Ha(){var r=We;We=[],Aa(r)}function un(r){if(We.length===0){var e=We;queueMicrotask(()=>{e===We&&Ha()})}We.push(r)}function Ya(){const r=T.b;return r===null&&Oa(),r}function Ga(r){var e=J|le,t=E!==null&&(E.f&J)!==0?E:null;return T===null||t!==null&&(t.f&ee)!==0?e|=ee:T.f|=yt,{ctx:ae,deps:null,effects:null,equals:sn,f:e,fn:r,reactions:null,rv:0,v:B,wv:0,parent:t??T,ac:null}}function Xa(r,e){let t=T;t===null&&Ia();var n=t.b,a=void 0,i=yn(B),o=null,s=!E;return ci(()=>{try{var l=r();o&&Promise.resolve(l).catch(()=>{})}catch(m){l=Promise.reject(m)}var c=()=>l;a=(o==null?void 0:o.then(c,c))??Promise.resolve(l),o=a;var u=$,h=n.is_pending();s&&(n.update_pending_count(1),h||u.increment());const _=(m,v=void 0)=>{o=null,h||u.activate(),v?v!==dr&&(i.f|=Oe,vr(i,v)):((i.f&Oe)!==0&&(i.f^=Oe),vr(i,m)),s&&(n.update_pending_count(-1),h||u.decrement()),fn()};if(a.then(_,m=>_(null,m||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),new Promise(l=>{function c(u){function h(){u===a?l(i):c(a)}u.then(h,h)}c(a)})}function dn(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)je(e[t])}}function Ja(r){for(var e=r.parent;e!==null;){if((e.f&J)===0)return e;e=e.parent}return null}function mr(r){var e,t=T;ke(Ja(r));try{dn(r),e=Dn(r)}finally{ke(t)}return e}function pn(r){var e=mr(r);if(r.equals(e)||(r.v=e,r.wv=In()),!Ye){var t=(Se||(r.f&ee)!==0)&&r.deps!==null?we:G;re(r,t)}}function Ka(r,e,t){const n=Ga;if(e.length===0){t(r.map(n));return}var a=$,i=T,o=Qa(),s=Ya();Promise.all(e.map(l=>Xa(l))).then(l=>{a==null||a.activate(),o();try{t([...r.map(n),...l])}catch(c){(i.f&qe)===0&&hr(c,i)}a==null||a.deactivate(),fn()}).catch(l=>{s.error(l)})}function Qa(){var r=T,e=E,t=ae,n=$;return function(){ke(r),de(e),Ft(t),n==null||n.activate()}}function fn(){ke(null),de(null),Ft(null)}const yr=new Set;let $=null,hn=new Set,gt=[],gr=null,_r=!1;const Kt=class Kt{constructor(){Z(this,oe);d(this,"current",new Map);Z(this,At,new Map);Z(this,ot,new Set);Z(this,Ne,0);Z(this,Nt,null);Z(this,Lt,!1);Z(this,Fe,[]);Z(this,st,[]);Z(this,Be,[]);Z(this,Le,[]);Z(this,lt,[]);Z(this,Rt,[]);Z(this,Pt,[]);d(this,"skipped_effects",new Set)}process(e){var a;gt=[];for(const i of e)Ue(this,oe,za).call(this,i);if(k(this,Fe).length===0&&k(this,Ne)===0){Ue(this,oe,tn).call(this);var t=k(this,Be),n=k(this,Le);U(this,Be,[]),U(this,Le,[]),U(this,lt,[]),$=null,mn(t),mn(n),$===null?$=this:yr.delete(this),(a=k(this,Nt))==null||a.resolve()}else Ue(this,oe,ir).call(this,k(this,Be)),Ue(this,oe,ir).call(this,k(this,Le)),Ue(this,oe,ir).call(this,k(this,lt));for(const i of k(this,Fe))Ge(i);for(const i of k(this,st))Ge(i);U(this,Fe,[]),U(this,st,[])}capture(e,t){k(this,At).has(e)||k(this,At).set(e,t),this.current.set(e,e.v)}activate(){$=this}deactivate(){$=null;for(const e of hn)if(hn.delete(e),e(),$!==null)break}neuter(){U(this,Lt,!0)}flush(){gt.length>0?ei():Ue(this,oe,tn).call(this),$===this&&(k(this,Ne)===0&&yr.delete(this),this.deactivate())}increment(){U(this,Ne,k(this,Ne)+1)}decrement(){if(U(this,Ne,k(this,Ne)-1),k(this,Ne)===0){for(const e of k(this,Rt))re(e,le),vt(e);for(const e of k(this,Pt))re(e,we),vt(e);U(this,Be,[]),U(this,Le,[]),this.flush()}else this.deactivate()}add_callback(e){k(this,ot).add(e)}settled(){return(k(this,Nt)??U(this,Nt,Na())).promise}static ensure(){if($===null){const e=$=new Kt;yr.add($),Kt.enqueue(()=>{$===e&&e.flush()})}return $}static enqueue(e){un(e)}};At=new WeakMap,ot=new WeakMap,Ne=new WeakMap,Nt=new WeakMap,Lt=new WeakMap,Fe=new WeakMap,st=new WeakMap,Be=new WeakMap,Le=new WeakMap,lt=new WeakMap,Rt=new WeakMap,Pt=new WeakMap,oe=new WeakSet,za=function(e){var u;e.f^=G;for(var t=e.first;t!==null;){var n=t.f,a=(n&(xe|Pe))!==0,i=a&&(n&G)!==0,o=i||(n&$e)!==0||this.skipped_effects.has(t);if(!o&&t.fn!==null){if(a)t.f^=G;else if((n&sr)!==0)k(this,Le).push(t);else if((n&G)===0)if((n&ur)!==0){var s=(u=t.b)!=null&&u.is_pending()?k(this,st):k(this,Fe);s.push(t)}else Bt(t)&&((t.f&mt)!==0&&k(this,lt).push(t),Ge(t));var l=t.first;if(l!==null){t=l;continue}}var c=t.parent;for(t=t.next;t===null&&c!==null;)t=c.next,c=c.parent}},ir=function(e){for(const t of e)((t.f&le)!==0?k(this,Rt):k(this,Pt)).push(t),re(t,G);e.length=0},tn=function(){if(!k(this,Lt))for(const e of k(this,ot))e();k(this,ot).clear()};let _t=Kt;function ei(){var r=He;_r=!0;try{var e=0;for(Ln(!0);gt.length>0;){var t=_t.ensure();if(e++>1e3){var n,a;ti()}t.process(gt),be.clear()}}finally{_r=!1,Ln(r),gr=null}}function ti(){try{Fa()}catch(r){hr(r,gr)}}let ye=null;function mn(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var n=r[t++];if((n.f&(qe|$e))===0&&Bt(n)&&(ye=[],Ge(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null&&n.ac===null?An(n):n.fn=null),(ye==null?void 0:ye.length)>0)){be.clear();for(const a of ye)Ge(a);ye=[]}}ye=null}}function vt(r){for(var e=gr=r;e.parent!==null;){e=e.parent;var t=e.f;if(_r&&e===T&&(t&mt)!==0)return;if((t&(Pe|xe))!==0){if((t&G)===0)return;e.f^=G}}gt.push(e)}const be=new Map;function yn(r,e){var t={f:0,v:r,reactions:null,equals:sn,rv:0,wv:0};return t}function q(r,e){const t=yn(r);return mi(t),t}function V(r,e,t=!1){E!==null&&(!ue||(E.f&on)!==0)&&ln()&&(E.f&(J|mt|ur|on))!==0&&!(W!=null&&W.includes(r))&&Ua();let n=t?xt(e):e;return vr(r,n)}function vr(r,e){if(!r.equals(e)){var t=r.v;Ye?be.set(r,e):be.set(r,t),r.v=e;var n=_t.ensure();n.capture(r,t),(r.f&J)!==0&&((r.f&le)!==0&&mr(r),re(r,(r.f&ee)===0?G:we)),r.wv=In(),gn(r,le),T!==null&&(T.f&G)!==0&&(T.f&(xe|Pe))===0&&(te===null?yi([r]):te.push(r))}return e}function xr(r){V(r,r.v+1)}function gn(r,e){var t=r.reactions;if(t!==null)for(var n=t.length,a=0;a<n;a++){var i=t[a],o=i.f,s=(o&le)===0;s&&re(i,e),(o&J)!==0?gn(i,we):s&&((o&mt)!==0&&ye!==null&&ye.push(i),vt(i))}}function xt(r){if(typeof r!="object"||r===null||Zt in r)return r;const e=Ta(r);if(e!==Ma&&e!==Ca)return r;var t=new Map,n=j(r),a=q(0),i=De,o=s=>{if(De===i)return s();var l=E,c=De;de(null),On(i);var u=s();return de(l),On(c),u};return n&&t.set("length",q(r.length)),new Proxy(r,{defineProperty(s,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Ba();var u=t.get(l);return u===void 0?u=o(()=>{var h=q(c.value);return t.set(l,h),h}):V(u,c.value,!0),!0},deleteProperty(s,l){var c=t.get(l);if(c===void 0){if(l in s){const u=o(()=>q(B));t.set(l,u),xr(a)}}else V(c,B),xr(a);return!0},get(s,l,c){var m;if(l===Zt)return r;var u=t.get(l),h=l in s;if(u===void 0&&(!h||(m=ht(s,l))!=null&&m.writable)&&(u=o(()=>{var v=xt(h?s[l]:B),O=q(v);return O}),t.set(l,u)),u!==void 0){var _=P(u);return _===B?void 0:_}return Reflect.get(s,l,c)},getOwnPropertyDescriptor(s,l){var c=Reflect.getOwnPropertyDescriptor(s,l);if(c&&"value"in c){var u=t.get(l);u&&(c.value=P(u))}else if(c===void 0){var h=t.get(l),_=h==null?void 0:h.v;if(h!==void 0&&_!==B)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return c},has(s,l){var _;if(l===Zt)return!0;var c=t.get(l),u=c!==void 0&&c.v!==B||Reflect.has(s,l);if(c!==void 0||T!==null&&(!u||(_=ht(s,l))!=null&&_.writable)){c===void 0&&(c=o(()=>{var m=u?xt(s[l]):B,v=q(m);return v}),t.set(l,c));var h=P(c);if(h===B)return!1}return u},set(s,l,c,u){var F;var h=t.get(l),_=l in s;if(n&&l==="length")for(var m=c;m<h.v;m+=1){var v=t.get(m+"");v!==void 0?V(v,B):m in s&&(v=o(()=>q(B)),t.set(m+"",v))}if(h===void 0)(!_||(F=ht(s,l))!=null&&F.writable)&&(h=o(()=>q(void 0)),V(h,xt(c)),t.set(l,h));else{_=h.v!==B;var O=o(()=>xt(c));V(h,O)}var Y=Reflect.getOwnPropertyDescriptor(s,l);if(Y!=null&&Y.set&&Y.set.call(u,c),!_){if(n&&typeof l=="string"){var se=t.get("length"),L=Number(l);Number.isInteger(L)&&L>=se.v&&V(se,L+1)}xr(a)}return!0},ownKeys(s){P(a);var l=Reflect.ownKeys(s).filter(h=>{var _=t.get(h);return _===void 0||_.v!==B});for(var[c,u]of t)u.v!==B&&!(c in s)&&l.push(c);return l},setPrototypeOf(){Va()}})}var _n,vn,xn,wn;function ri(){if(_n===void 0){_n=window,vn=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;xn=ht(e,"firstChild").get,wn=ht(e,"nextSibling").get,rn(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),rn(t)&&(t.__t=void 0)}}function ni(r=""){return document.createTextNode(r)}function bn(r){return xn.call(r)}function kn(r){return wn.call(r)}function wr(r,e){return bn(r)}function ai(r,e=1,t=!1){let n=r;for(;e--;)n=kn(n);return n}function Sn(r){var e=E,t=T;de(null),ke(null);try{return r()}finally{de(e),ke(t)}}function ii(r){T===null&&E===null&&Za(),E!==null&&(E.f&ee)!==0&&T===null&&Da(),Ye&&ja()}function oi(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Ie(r,e,t,n=!0){var a=T;a!==null&&(a.f&$e)!==0&&(r|=$e);var i={ctx:ae,deps:null,nodes_start:null,nodes_end:null,f:r|le,first:null,fn:e,last:null,next:null,parent:a,b:a&&a.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{Ge(i),i.f|=lr}catch(l){throw je(i),l}else e!==null&&vt(i);if(n){var o=i;if(t&&o.deps===null&&o.teardown===null&&o.nodes_start===null&&o.first===o.last&&(o.f&yt)===0&&(o=o.first),o!==null&&(o.parent=a,a!==null&&oi(o,a),E!==null&&(E.f&J)!==0&&(r&Pe)===0)){var s=E;(s.effects??(s.effects=[])).push(o)}}return i}function ce(r){ii();var e=T.f,t=!E&&(e&xe)!==0&&(e&lr)===0;if(t){var n=ae;(n.e??(n.e=[])).push(r)}else return zn(r)}function zn(r){return Ie(sr|Pa,r,!1)}function si(r){_t.ensure();const e=Ie(Pe|yt,r,!0);return(t={})=>new Promise(n=>{t.outro?fi(e,()=>{je(e),n(void 0)}):(je(e),n(void 0))})}function li(r){return Ie(sr,r,!1)}function ci(r){return Ie(ur|yt,r,!0)}function En(r,e=0){return Ie(nn|e,r,!0)}function Mn(r,e=[],t=[]){Ka(e,t,n=>{Ie(nn,()=>r(...n.map(P)),!0)})}function ui(r,e=!0){return Ie(xe|yt,r,!0,e)}function Cn(r){var e=r.teardown;if(e!==null){const t=Ye,n=E;Rn(!0),de(null);try{e.call(null)}finally{Rn(t),de(n)}}}function Tn(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){const a=t.ac;a!==null&&Sn(()=>{a.abort(dr)});var n=t.next;(t.f&Pe)!==0?t.parent=null:je(t,e),t=n}}function di(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&xe)===0&&je(e),e=t}}function je(r,e=!0){var t=!1;(e||(r.f&Ra)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(pi(r.nodes_start,r.nodes_end),t=!0),Tn(r,e&&!t),Vt(r,0),re(r,qe);var n=r.transitions;if(n!==null)for(const i of n)i.stop();Cn(r);var a=r.parent;a!==null&&a.first!==null&&An(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=r.ac=null}function pi(r,e){for(;r!==null;){var t=r===e?null:kn(r);r.remove(),r=t}}function An(r){var e=r.parent,t=r.prev,n=r.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===r&&(e.first=n),e.last===r&&(e.last=t))}function fi(r,e){var t=[];Nn(r,t,!0),hi(t,()=>{je(r),e&&e()})}function hi(r,e){var t=r.length;if(t>0){var n=()=>--t||e();for(var a of r)a.out(n)}else e()}function Nn(r,e,t){if((r.f&$e)===0){if(r.f^=$e,r.transitions!==null)for(const o of r.transitions)(o.is_global||t)&&e.push(o);for(var n=r.first;n!==null;){var a=n.next,i=(n.f&La)!==0||(n.f&xe)!==0;Nn(n,e,i?t:!1),n=a}}}let He=!1;function Ln(r){He=r}let Ye=!1;function Rn(r){Ye=r}let E=null,ue=!1;function de(r){E=r}let T=null;function ke(r){T=r}let W=null;function mi(r){E!==null&&(W===null?W=[r]:W.push(r))}let H=null,K=0,te=null;function yi(r){te=r}let Pn=1,wt=0,De=wt;function On(r){De=r}let Se=!1;function In(){return++Pn}function Bt(r){var h;var e=r.f;if((e&le)!==0)return!0;if((e&we)!==0){var t=r.deps,n=(e&ee)!==0;if(t!==null){var a,i,o=(e&Dt)!==0,s=n&&T!==null&&!Se,l=t.length;if((o||s)&&(T===null||(T.f&qe)===0)){var c=r,u=c.parent;for(a=0;a<l;a++)i=t[a],(o||!((h=i==null?void 0:i.reactions)!=null&&h.includes(c)))&&(i.reactions??(i.reactions=[])).push(c);o&&(c.f^=Dt),s&&u!==null&&(u.f&ee)===0&&(c.f^=ee)}for(a=0;a<l;a++)if(i=t[a],Bt(i)&&pn(i),i.wv>r.wv)return!0}(!n||T!==null&&!Se)&&re(r,G)}return!1}function jn(r,e,t=!0){var n=r.reactions;if(n!==null&&!(W!=null&&W.includes(r)))for(var a=0;a<n.length;a++){var i=n[a];(i.f&J)!==0?jn(i,e,!1):e===i&&(t?re(i,le):(i.f&G)!==0&&re(i,we),vt(i))}}function Dn(r){var O;var e=H,t=K,n=te,a=E,i=Se,o=W,s=ae,l=ue,c=De,u=r.f;H=null,K=0,te=null,Se=(u&ee)!==0&&(ue||!He||E===null),E=(u&(xe|Pe))===0?r:null,W=null,Ft(r.ctx),ue=!1,De=++wt,r.ac!==null&&(Sn(()=>{r.ac.abort(dr)}),r.ac=null);try{r.f|=cr;var h=r.fn,_=h(),m=r.deps;if(H!==null){var v;if(Vt(r,K),m!==null&&K>0)for(m.length=K+H.length,v=0;v<H.length;v++)m[K+v]=H[v];else r.deps=m=H;if(!Se||(u&J)!==0&&r.reactions!==null)for(v=K;v<m.length;v++)((O=m[v]).reactions??(O.reactions=[])).push(r)}else m!==null&&K<m.length&&(Vt(r,K),m.length=K);if(ln()&&te!==null&&!ue&&m!==null&&(r.f&(J|we|le))===0)for(v=0;v<te.length;v++)jn(te[v],r);return a!==null&&a!==r&&(wt++,te!==null&&(n===null?n=te:n.push(...te))),(r.f&Oe)!==0&&(r.f^=Oe),_}catch(Y){return Wa(Y)}finally{r.f^=cr,H=e,K=t,te=n,E=a,Se=i,W=o,Ft(s),ue=l,De=c}}function gi(r,e){let t=e.reactions;if(t!==null){var n=jt.call(t,r);if(n!==-1){var a=t.length-1;a===0?t=e.reactions=null:(t[n]=t[a],t.pop())}}t===null&&(e.f&J)!==0&&(H===null||!H.includes(e))&&(re(e,we),(e.f&(ee|Dt))===0&&(e.f^=Dt),dn(e),Vt(e,0))}function Vt(r,e){var t=r.deps;if(t!==null)for(var n=e;n<t.length;n++)gi(r,t[n])}function Ge(r){var e=r.f;if((e&qe)===0){re(r,G);var t=T,n=He;T=r,He=!0;try{(e&mt)!==0?di(r):Tn(r),Cn(r);var a=Dn(r);r.teardown=typeof a=="function"?a:null,r.wv=Pn;var i}finally{He=n,T=t}}}function P(r){var e=r.f,t=(e&J)!==0;if(E!==null&&!ue){var n=T!==null&&(T.f&qe)!==0;if(!n&&!(W!=null&&W.includes(r))){var a=E.deps;if((E.f&cr)!==0)r.rv<wt&&(r.rv=wt,H===null&&a!==null&&a[K]===r?K++:H===null?H=[r]:(!Se||!H.includes(r))&&H.push(r));else{(E.deps??(E.deps=[])).push(r);var i=r.reactions;i===null?r.reactions=[E]:i.includes(E)||i.push(E)}}}else if(t&&r.deps===null&&r.effects===null){var o=r,s=o.parent;s!==null&&(s.f&ee)===0&&(o.f^=ee)}if(Ye){if(be.has(r))return be.get(r);if(t){o=r;var l=o.v;return((o.f&G)===0&&o.reactions!==null||Zn(o))&&(l=mr(o)),be.set(o,l),l}}else t&&(o=r,Bt(o)&&pn(o));if((r.f&Oe)!==0)throw r.v;return r.v}function Zn(r){if(r.v===B)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(be.has(e)||(e.f&J)!==0&&Zn(e))return!0;return!1}function _i(r){var e=ue;try{return ue=!0,r()}finally{ue=e}}const vi=-7169;function re(r,e){r.f=r.f&vi|e}const xi=["touchstart","touchmove"];function wi(r){return xi.includes(r)}const bi=new Set,Fn=new Set;let Bn=null;function Ut(r){var L;var e=this,t=e.ownerDocument,n=r.type,a=((L=r.composedPath)==null?void 0:L.call(r))||[],i=a[0]||r.target;Bn=r;var o=0,s=Bn===r&&r.__root;if(s){var l=a.indexOf(s);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var c=a.indexOf(e);if(c===-1)return;l<=c&&(o=l)}if(i=a[o]||r.target,i!==e){or(r,"currentTarget",{configurable:!0,get(){return i||t}});var u=E,h=T;de(null),ke(null);try{for(var _,m=[];i!==null;){var v=i.assignedSlot||i.parentNode||i.host||null;try{var O=i["__"+n];if(O!=null&&(!i.disabled||r.target===i))if(j(O)){var[Y,...se]=O;Y.apply(i,[r,...se])}else O.call(i,r)}catch(F){_?m.push(F):_=F}if(r.cancelBubble||v===e||v===null)break;i=v}if(_){for(let F of m)queueMicrotask(()=>{throw F});throw _}}finally{r.__root=e,delete r.currentTarget,de(u),ke(h)}}}function ki(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function Si(r,e){var t=T;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function Vn(r,e){var t=(e&$a)!==0,n,a=!r.startsWith("<!>");return()=>{n===void 0&&(n=ki(a?r:"<!>"+r),n=bn(n));var i=t||vn?document.importNode(n,!0):n.cloneNode(!0);return Si(i,i),i}}function Un(r,e){r!==null&&r.before(e)}function br(r,e){return zi(r,e)}const Xe=new Map;function zi(r,{target:e,anchor:t,props:n={},events:a,context:i,intro:o=!0}){ri();var s=new Set,l=h=>{for(var _=0;_<h.length;_++){var m=h[_];if(!s.has(m)){s.add(m);var v=wi(m);e.addEventListener(m,Ut,{passive:v});var O=Xe.get(m);O===void 0?(document.addEventListener(m,Ut,{passive:v}),Xe.set(m,1)):Xe.set(m,O+1)}}};l(Ea(bi)),Fn.add(l);var c=void 0,u=si(()=>{var h=t??e.appendChild(ni());return ui(()=>{if(i){pr({});var _=ae;_.c=i}a&&(n.$$events=a),c=r(h,n)||{},i&&fr()}),()=>{var v;for(var _ of s){e.removeEventListener(_,Ut);var m=Xe.get(_);--m===0?(document.removeEventListener(_,Ut),Xe.delete(_)):Xe.set(_,m)}Fn.delete(l),h!==t&&((v=h.parentNode)==null||v.removeChild(h))}});return Ei.set(c,u),c}let Ei=new WeakMap;function $n(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=$n(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function Mi(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=$n(r))&&(n&&(n+=" "),n+=e);return n}function qn(r){return typeof r=="object"?Mi(r):r??""}function Ci(r,e,t){var n=r==null?"":""+r;return e&&(n=n?n+" "+e:e),n===""?null:n}function Ti(r,e){return r==null?null:String(r)}function Wn(r,e,t,n,a,i){var o=r.__className;if(o!==t||o===void 0){var s=Ci(t,n);s==null?r.removeAttribute("class"):r.className=s,r.__className=t}return i}function $t(r,e,t,n){var a=r.__style;if(a!==e){var i=Ti(e);i==null?r.removeAttribute("style"):r.style.cssText=i,r.__style=e}return n}const Ai=()=>performance.now(),pe={tick:r=>requestAnimationFrame(r),now:()=>Ai(),tasks:new Set};function Hn(){const r=pe.now();pe.tasks.forEach(e=>{e.c(r)||(pe.tasks.delete(e),e.f())}),pe.tasks.size!==0&&pe.tick(Hn)}function Ni(r){let e;return pe.tasks.size===0&&pe.tick(Hn),{promise:new Promise(t=>{pe.tasks.add(e={c:r,f:t})}),abort(){pe.tasks.delete(e)}}}function Yn(r,e){return r===e||(r==null?void 0:r[Zt])===e}function Je(r={},e,t,n){return li(()=>{var a,i;return En(()=>{a=i,i=[],_i(()=>{r!==t(...i)&&(e(r,...i),a&&Yn(t(...a),r)&&e(null,...a))})}),()=>{un(()=>{i&&Yn(t(...i),r)&&e(null,...i)})}}),r}const Li="5";typeof window<"u"&&((_a=window.__svelte??(window.__svelte={})).v??(_a.v=new Set)).add(Li);function Ri(r){return r}function kr(r){return-.5*(Math.cos(Math.PI*r)-1)}function Pi(r){const e=Math.cos(r*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function Oi(r){return Math.sin(r*Math.PI/2)}const Ii=128,ji=0,Di=1,Zi=2;class Fi{constructor(){d(this,"animationsStarted",!1);d(this,"animationsCount",0);d(this,"animationsLimit",Ii);d(this,"layers",new Array)}start(){window.requestAnimationFrame(this.tick.bind(this))}tick(){try{this.animationsCount=0;for(let e=0;e<this.layers.length;e++){const t=this.layers[e];if(t==null)continue;const n=t.animations;if(n!=null)for(let a=0;a<n.length;a++){const i=n[a];if(i!=null){for(const o of i.values())if(!o.executed&&(o.executed=!0,o.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,n,a){let i=this.layers[e];i==null&&(i=this.layers[e]={animations:new Array});let o=i.animations[t];o==null&&(o=i.animations[t]=new Map);let s={id:n,priority:t,executed:!1,function:a};o.set(n,s),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let n=0;n<this.layers.length;n++){let a=this.layers[n];if(a==null)continue;let i=a.animations[e];if(i==null)return;let o=i.get(t);if(o==null||o.executed==!1)return;i.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const ze=new Fi;function Gn(r){return Object.prototype.toString.call(r)==="[object Date]"}function Sr(r,e){if(r===e||r!==r)return()=>r;const t=typeof r;if(t!==typeof e||Array.isArray(r)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(r)){const n=e.map((a,i)=>Sr(r[i],a));return a=>n.map(i=>i(a))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(Gn(r)&&Gn(e)){const i=r.getTime(),s=e.getTime()-i;return l=>new Date(i+l*s)}const n=Object.keys(e),a={};return n.forEach(i=>{a[i]=Sr(r[i],e[i])}),i=>{const o={};return n.forEach(s=>{o[s]=a[s](i)}),o}}if(t==="number"){const n=e-r;return a=>r+a*n}return()=>e}const Jr=class Jr{constructor(e,t={}){Z(this,_e);Z(this,ct);Z(this,Ot);Z(this,Ve,null);U(this,_e,q(e)),U(this,ct,q(e)),U(this,Ot,t)}static of(e,t){const n=new Jr(e(),t);return En(()=>{n.set(e())}),n}set(e,t){var h;V(k(this,ct),e);let{delay:n=0,duration:a=400,easing:i=Ri,interpolate:o=Sr}={...k(this,Ot),...t};if(a===0)return(h=k(this,Ve))==null||h.abort(),V(k(this,_e),e),Promise.resolve();const s=pe.now()+n;let l,c=!1,u=k(this,Ve);return U(this,Ve,Ni(_=>{if(_<s)return!0;if(!c){c=!0;const v=k(this,_e).v;l=o(v,e),typeof a=="function"&&(a=a(v,e)),u==null||u.abort()}const m=_-s;return m>a?(V(k(this,_e),e),!1):(V(k(this,_e),l(i(m/a))),!0)})),k(this,Ve).promise}get current(){return P(k(this,_e))}get target(){return P(k(this,ct))}set target(e){this.set(e)}};_e=new WeakMap,ct=new WeakMap,Ot=new WeakMap,Ve=new WeakMap;let zr=Jr;class qt{constructor(e,t){d(this,"value");d(this,"motion");this.value=e,this.motion=new zr(e,t)}set(e,t){this.value=e,this.motion.set(e,t)}update(e){this.motion.set(this.value,e)}snap(){this.motion.set(this.value,{duration:0})}}var Bi=Vn('<div><div class="body svelte-zz3jrb"></div></div>');function Vi(r,e){pr(e,!0);let t,n;function a(){return n}let i=q(!1);function o(I){V(i,I,!0)}function s(){return P(i)}let l=q(!0),c=0,u=150;function h(I){I!=P(l)&&(V(l,I,!0),c=performance.now())}function _(){return performance.now()-c<u?v.motion.current==0:v.value==0}let m=0,v=new qt(0,{easing:kr});ce(()=>{P(i)==!1&&(v.snap(),ze.clear(e.priority,e.id))}),ce(()=>{v.set(P(l)?0:m,{duration:75})}),ce(()=>{O(v.motion.current)});function O(I){t&&ze.equeue(e.layer,e.priority,e.id,()=>{t.style.scale=I.toString(),t.style.filter=`brightness(${.25+.75*I})`,n.style.opacity=I.toString()})}function Y(I){I!=m&&(m=I,v.set(I,{duration:75}))}function se(){return v.value}var L={getBody:a,setDisplayed:o,getDisplayed:s,setCollapsed:h,getCollapsed:_,setScale:Y,getScale:se},F=Bi(),me=wr(F);return Je(me,I=>n=I,()=>n),Je(F,I=>t=I,()=>t),Mn(()=>{Wn(F,1,qn(["pin",P(i)&&"displayed"]),"svelte-zz3jrb"),$t(F,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px`),$t(me,`width: ${e.width-4}px; height: ${e.height-4}px; border-radius: ${e.radius-2}px`)}),Un(r,F),fr(L)}var bt;(r=>{function e(t,n,a){const i=t/2,o=n/2,s=Math.sqrt(i*i+o*o),l=Math.atan(o/i)*(180/Math.PI),c=a*(Math.PI/180);return a<180?a<90?a<l?{x:0,y:s*Math.sin(c)-o}:{x:s*Math.cos(c)-i,y:0}:a<180-l?{x:s*Math.cos(c)-i,y:0}:{x:-t,y:s*Math.sin(c)-o}:a<270?a<180+l?{x:-t,y:s*Math.sin(c)-o}:{x:s*Math.cos(c)-i,y:-n}:a<360-l?{x:s*Math.cos(c)-i,y:-n}:{x:0,y:s*Math.sin(c)-o}}r.getOffsets=e})(bt||(bt={}));var Ui=Vn('<div><div class="pointer svelte-11extwn"></div> <div class="bubble svelte-11extwn"><div class="body svelte-11extwn"></div></div></div>');function Xn(r,e){pr(e,!0);let t,n,a,i;const o=e.width+2*e.margin,s=e.height+2*e.margin,l=()=>i;ce(()=>{a.style.width=`${e.margin*4}px`,a.style.height=`${e.margin*4}px`});let c=q(!0);function u(A){V(c,A,!0)}function h(){return P(c)}let _=q(!0),m=0,v=300;function O(A){A!=P(_)&&(V(_,A,!0),m=performance.now())}function Y(){return performance.now()-m<v?L.motion.current==0:L.value==0}function se(){return performance.now()-m<v?L.motion.current==1:L.value==1}let L=new qt(0);ce(()=>{P(c)==!1&&(L.snap(),ze.clear(e.priority,e.id+"_scale"))}),ce(()=>{P(_)==!0&&L.value!=0&&(ze.stacked()?L.set(0,{duration:0}):L.set(0,{duration:150,easing:Pi})),P(_)==!1&&L.value!=1&&L.set(1,{duration:150,easing:Oi})}),ce(()=>{F(L.motion.current)});function F(A){!t||!n||!a||ze.equeue(P(_)?0:e.layer,e.priority,e.id+"_scale",()=>{t.style.opacity=`${A}`,n.style.scale=`${A}`,a.style.scale=`${A}`})}let me=NaN,I=q(!1),Re=new qt(-o/2,{easing:kr}),tr=new qt(-s/2,{easing:kr});ce(()=>{P(c)==!1&&(Re.snap(),Re.snap(),ze.clear(e.priority,e.id+"_angle"))}),ce(()=>{P(_)==!0&&P(I)&&(Re.update({duration:75}),Re.update({duration:75}))}),ce(()=>{va(Re.motion.current,tr.motion.current)});function va(A,nr){if(!t||!n||!a)return;const ve=A+o/2,ar=nr+s/2,pt=s<o?ve*s/o:ve,ft=s>o?ar*o/s:ar,Uo=Math.atan2(ft,pt)/Math.PI*180-45,ba=0,$o=30,Qr=Math.sqrt(pt*pt+ft*ft),It=Math.min(o,s)/2,qo=It*Math.SQRT2,Wo=(Qr-It)/(qo-It),ka=ba+Wo*($o-ba),Ho=Qr<It?Qr/It:1;ze.equeue(e.layer,e.priority,e.id+"_angle",()=>{n.style.transform=`translate(${Math.round(A)}px, ${Math.round(nr)}px)`,a.style.transform=`scale(${Ho}) rotate(${Uo}deg) skew(${ka}deg, ${ka}deg)`})}function Fo(A,nr){if(P(I)==!1||nr==!0){let ve=bt.getOffsets(o,s,A);Re.set(Math.round(ve.x),{duration:0}),tr.set(Math.round(ve.y),{duration:0}),va(Re.value,tr.value),me=A,V(I,!0)}else if(A!=me){let ve=Math.abs(A-me),ar=ve<180?ve:360-ve,pt=Math.log(ar)*75,ft=bt.getOffsets(o,s,A);Re.set(Math.round(ft.x),{duration:pt}),tr.set(Math.round(ft.y),{duration:pt}),me=A}}function Bo(){return bt.getOffsets(o,s,me)}var Vo={getBody:l,setDisplayed:u,getDisplayed:h,setCollapsed:O,getCollapsed:Y,getExpanded:se,setAngle:Fo,getOffsets:Bo},rr=Ui(),xa=wr(rr);Je(xa,A=>a=A,()=>a);var Kr=ai(xa,2),wa=wr(Kr);return Je(wa,A=>i=A,()=>i),Je(Kr,A=>n=A,()=>n),Je(rr,A=>t=A,()=>t),Mn(()=>{Wn(rr,1,qn(["anchor",P(c)&&"displayed"]),"svelte-11extwn"),$t(Kr,`margin: ${e.margin}px;`),$t(wa,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)}),Un(r,rr),fr(Vo)}var kt;(r=>{async function e(n,a){const i=await fetch(n,a);if(!i.ok)throw new Error(i.statusText);return i.json()}r.get=e;async function t(n,a,i){const o=await fetch(n,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",...i==null?void 0:i.headers},...i});if(!o.ok)throw new Error(o.statusText);return o.json()}r.post=t})(kt||(kt={}));var Ke;(r=>{function e(s,l,c){return{x:n(l)*c,y:a(s)*c}}r.project=e;function t(s,l,c){return{lat:o(l/c),lng:i(s/c)}}r.unproject=t;function n(s){return(180+s)/360}function a(s){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s*Math.PI/360)))/360}function i(s){return s*360-180}function o(s){return 360/Math.PI*Math.atan(Math.exp((180-s*360)*Math.PI/180))-90}})(Ke||(Ke={}));class Jn{constructor(e,t,n,a,i){d(this,"swLat");d(this,"swLng");d(this,"neLat");d(this,"neLng");const o=n*Math.pow(2,t),s=Ke.project(e.sw.lat,e.sw.lng,o),l=Ke.project(e.ne.lat,e.ne.lng,o),c=s.x-a,u=s.y+i,h=l.x+a,_=l.y-i,m=Ke.unproject(c,u,o),v=Ke.unproject(h,_,o);this.swLat=m.lat,this.swLng=m.lng,this.neLat=v.lat,this.neLng=v.lng}contains(e,t){return this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=t&&t<=this.neLng:t<=this.neLng||this.swLng<=t:!1}}var C;(function(r){r.assertEqual=a=>{};function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},r.getValidEnumValues=a=>{const i=r.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return r.objectValues(o)},r.objectValues=a=>r.objectKeys(a).map(function(i){return a[i]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},r.find=(a,i)=>{for(const o of a)if(i(o))return o},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(C||(C={}));var Kn;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Kn||(Kn={}));const y=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ee=r=>{switch(typeof r){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(r)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(r)?y.array:r===null?y.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?y.promise:typeof Map<"u"&&r instanceof Map?y.map:typeof Set<"u"&&r instanceof Set?y.set:typeof Date<"u"&&r instanceof Date?y.date:y.object;default:return y.unknown}},p=C.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ne extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let s=n,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(o))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return a(this),n}static assert(e){if(!(e instanceof ne))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];t[i]=t[i]||[],t[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ne.create=r=>new ne(r);const St=(r,e)=>{let t;switch(r.code){case p.invalid_type:r.received===y.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case p.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,C.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:t=`Unrecognized key(s) in object: ${C.joinValues(r.keys,", ")}`;break;case p.invalid_union:t="Invalid input";break;case p.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${C.joinValues(r.options)}`;break;case p.invalid_enum_value:t=`Invalid enum value. Expected ${C.joinValues(r.options)}, received '${r.received}'`;break;case p.invalid_arguments:t="Invalid function arguments";break;case p.invalid_return_type:t="Invalid function return type";break;case p.invalid_date:t="Invalid date";break;case p.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:C.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case p.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case p.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case p.custom:t="Invalid input";break;case p.invalid_intersection_types:t="Intersection results could not be merged";break;case p.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case p.not_finite:t="Number must be finite";break;default:t=e.defaultError,C.assertNever(r)}return{message:t}};let $i=St;function Er(){return $i}const Mr=r=>{const{data:e,path:t,errorMaps:n,issueData:a}=r,i=[...t,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)s=c(o,{data:e,defaultError:s}).message;return{...a,path:i,message:s}};function f(r,e){const t=Er(),n=Mr({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===St?void 0:St].filter(a=>!!a)});r.common.issues.push(n)}class Q{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if(a.status==="aborted")return x;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const a of t){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return Q.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return x;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}}const x=Object.freeze({status:"aborted"}),zt=r=>({status:"dirty",value:r}),X=r=>({status:"valid",value:r}),Qn=r=>r.status==="aborted",ea=r=>r.status==="dirty",Qe=r=>r.status==="valid",Wt=r=>typeof Promise<"u"&&r instanceof Promise;var g;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(g||(g={}));class Me{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ta=(r,e)=>{if(Qe(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ne(r.common.issues);return this._error=t,this._error}}};function S(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,s)=>{const{message:l}=r;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??t??s.defaultError}},description:a}}class M{get description(){return this._def.description}_getType(e){return Ee(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ee(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Q,ctx:{common:e.parent.common,data:e.data,parsedType:Ee(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Wt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ee(e)},a=this._parseSync({data:e,path:n.path,parent:n});return ta(n,a)}"~validate"(e){var n,a;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ee(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return Qe(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>Qe(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ee(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(Wt(a)?a:Promise.resolve(a));return ta(n,i)}refine(e,t){const n=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{const o=e(a),s=()=>i.addIssue({code:p.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new at({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Ae.create(this,this._def)}nullable(){return it.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this)}promise(){return Tt.create(this,this._def)}or(e){return Yt.create([this,e],this._def)}and(e){return Gt.create(this,e,this._def)}transform(e){return new at({...S(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Rr({...S(this._def),innerType:this,defaultValue:t,typeName:w.ZodDefault})}brand(){return new ho({typeName:w.ZodBranded,type:this,...S(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Pr({...S(this._def),innerType:this,catchValue:t,typeName:w.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Or.create(this,e)}readonly(){return Ir.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const qi=/^c[^\s-]{8,}$/i,Wi=/^[0-9a-z]+$/,Hi=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Yi=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Gi=/^[a-z0-9_-]{21}$/i,Xi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ji=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ki=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cr;const eo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,to=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ro=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,no=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ao=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,io=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ra="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oo=new RegExp(`^${ra}$`);function na(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function so(r){return new RegExp(`^${na(r)}$`)}function lo(r){let e=`${ra}T${na(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function co(r,e){return!!((e==="v4"||!e)&&eo.test(r)||(e==="v6"||!e)&&ro.test(r))}function uo(r,e){if(!Xi.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function po(r,e){return!!((e==="v4"||!e)&&to.test(r)||(e==="v6"||!e)&&no.test(r))}class Ce extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){const i=this._getOrReturnCtx(e);return f(i,{code:p.invalid_type,expected:y.string,received:i.parsedType}),x}const n=new Q;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,s=e.data.length<i.value;(o||s)&&(a=this._getOrReturnCtx(e,a),o?f(a,{code:p.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&f(a,{code:p.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")Ki.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"email",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Cr||(Cr=new RegExp(Qi,"u")),Cr.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"emoji",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Yi.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"uuid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Gi.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"nanoid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")qi.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"cuid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Wi.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"cuid2",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Hi.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"ulid",code:p.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),f(a,{validation:"url",code:p.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"regex",code:p.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?lo(i).test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?oo.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?so(i).test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Ji.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"duration",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?co(e.data,i.version)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"ip",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?uo(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"jwt",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?po(e.data,i.version)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"cidr",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?ao.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"base64",code:p.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?io.test(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{validation:"base64url",code:p.invalid_string,message:i.message}),n.dirty()):C.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),{validation:t,code:p.invalid_string,...g.errToObj(n)})}_addCheck(e){return new Ce({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...g.errToObj(e)})}url(e){return this._addCheck({kind:"url",...g.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...g.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...g.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...g.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...g.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...g.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...g.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...g.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...g.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...g.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...g.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...g.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...g.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...g.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...g.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...g.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...g.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...g.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...g.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...g.errToObj(t)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ce({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Ce.create=r=>new Ce({checks:[],typeName:w.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...S(r)});function fo(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,i=Number.parseInt(r.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return i%o/10**a}class et extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==y.number){const i=this._getOrReturnCtx(e);return f(i,{code:p.invalid_type,expected:y.number,received:i.parsedType}),x}let n;const a=new Q;for(const i of this._def.checks)i.kind==="int"?C.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:p.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?fo(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:p.not_finite,message:i.message}),a.dirty()):C.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,g.toString(t))}gt(e,t){return this.setLimit("min",e,!1,g.toString(t))}lte(e,t){return this.setLimit("max",e,!0,g.toString(t))}lt(e,t){return this.setLimit("max",e,!1,g.toString(t))}setLimit(e,t,n,a){return new et({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:g.toString(a)}]})}_addCheck(e){return new et({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:g.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:g.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&C.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}et.create=r=>new et({checks:[],typeName:w.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...S(r)});class Et extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==y.bigint)return this._getInvalidInput(e);let n;const a=new Q;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),f(n,{code:p.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):C.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return f(t,{code:p.invalid_type,expected:y.bigint,received:t.parsedType}),x}gte(e,t){return this.setLimit("min",e,!0,g.toString(t))}gt(e,t){return this.setLimit("min",e,!1,g.toString(t))}lte(e,t){return this.setLimit("max",e,!0,g.toString(t))}lt(e,t){return this.setLimit("max",e,!1,g.toString(t))}setLimit(e,t,n,a){return new Et({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:g.toString(a)}]})}_addCheck(e){return new Et({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Et.create=r=>new Et({checks:[],typeName:w.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...S(r)});class Tr extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:y.boolean,received:n.parsedType}),x}return X(e.data)}}Tr.create=r=>new Tr({typeName:w.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...S(r)});class Ht extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){const i=this._getOrReturnCtx(e);return f(i,{code:p.invalid_type,expected:y.date,received:i.parsedType}),x}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return f(i,{code:p.invalid_date}),x}const n=new Q;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):C.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ht({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:g.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:g.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Ht.create=r=>new Ht({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:w.ZodDate,...S(r)});class aa extends M{_parse(e){if(this._getType(e)!==y.symbol){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:y.symbol,received:n.parsedType}),x}return X(e.data)}}aa.create=r=>new aa({typeName:w.ZodSymbol,...S(r)});class ia extends M{_parse(e){if(this._getType(e)!==y.undefined){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:y.undefined,received:n.parsedType}),x}return X(e.data)}}ia.create=r=>new ia({typeName:w.ZodUndefined,...S(r)});class oa extends M{_parse(e){if(this._getType(e)!==y.null){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:y.null,received:n.parsedType}),x}return X(e.data)}}oa.create=r=>new oa({typeName:w.ZodNull,...S(r)});class Ar extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return X(e.data)}}Ar.create=r=>new Ar({typeName:w.ZodAny,...S(r)});class tt extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return X(e.data)}}tt.create=r=>new tt({typeName:w.ZodUnknown,...S(r)});class Te extends M{_parse(e){const t=this._getOrReturnCtx(e);return f(t,{code:p.invalid_type,expected:y.never,received:t.parsedType}),x}}Te.create=r=>new Te({typeName:w.ZodNever,...S(r)});class Nr extends M{_parse(e){if(this._getType(e)!==y.undefined){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:y.void,received:n.parsedType}),x}return X(e.data)}}Nr.create=r=>new Nr({typeName:w.ZodVoid,...S(r)});class fe extends M{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==y.array)return f(t,{code:p.invalid_type,expected:y.array,received:t.parsedType}),x;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(o||s)&&(f(t,{code:o?p.too_big:p.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(f(t,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(f(t,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,s)=>a.type._parseAsync(new Me(t,o,t.path,s)))).then(o=>Q.mergeArray(n,o));const i=[...t.data].map((o,s)=>a.type._parseSync(new Me(t,o,t.path,s)));return Q.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new fe({...this._def,minLength:{value:e,message:g.toString(t)}})}max(e,t){return new fe({...this._def,maxLength:{value:e,message:g.toString(t)}})}length(e,t){return new fe({...this._def,exactLength:{value:e,message:g.toString(t)}})}nonempty(e){return this.min(1,e)}}fe.create=(r,e)=>new fe({type:r,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...S(e)});function rt(r){if(r instanceof D){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=Ae.create(rt(n))}return new D({...r._def,shape:()=>e})}else return r instanceof fe?new fe({...r._def,type:rt(r.element)}):r instanceof Ae?Ae.create(rt(r.unwrap())):r instanceof it?it.create(rt(r.unwrap())):r instanceof ge?ge.create(r.items.map(e=>rt(e))):r}class D extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=C.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==y.object){const c=this._getOrReturnCtx(e);return f(c,{code:p.invalid_type,expected:y.object,received:c.parsedType}),x}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Te&&this._def.unknownKeys==="strip"))for(const c in a.data)o.includes(c)||s.push(c);const l=[];for(const c of o){const u=i[c],h=a.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Me(a,h,a.path,c)),alwaysSet:c in a.data})}if(this._def.catchall instanceof Te){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(c==="strict")s.length>0&&(f(a,{code:p.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of s){const h=a.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Me(a,h,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const h=await u.key,_=await u.value;c.push({key:h,value:_,alwaysSet:u.alwaysSet})}return c}).then(c=>Q.mergeObjectSync(n,c)):Q.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return g.errToObj,new D({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:g.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new D({...this._def,unknownKeys:"strip"})}passthrough(){return new D({...this._def,unknownKeys:"passthrough"})}extend(e){return new D({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new D({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new D({...this._def,catchall:e})}pick(e){const t={};for(const n of C.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new D({...this._def,shape:()=>t})}omit(e){const t={};for(const n of C.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new D({...this._def,shape:()=>t})}deepPartial(){return rt(this)}partial(e){const t={};for(const n of C.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new D({...this._def,shape:()=>t})}required(e){const t={};for(const n of C.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Ae;)i=i._def.innerType;t[n]=i}return new D({...this._def,shape:()=>t})}keyof(){return ua(C.objectKeys(this.shape))}}D.create=(r,e)=>new D({shape:()=>r,unknownKeys:"strip",catchall:Te.create(),typeName:w.ZodObject,...S(e)}),D.strictCreate=(r,e)=>new D({shape:()=>r,unknownKeys:"strict",catchall:Te.create(),typeName:w.ZodObject,...S(e)}),D.lazycreate=(r,e)=>new D({shape:r,unknownKeys:"strip",catchall:Te.create(),typeName:w.ZodObject,...S(e)});class Yt extends M{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new ne(s.ctx.common.issues));return f(t,{code:p.invalid_union,unionErrors:o}),x}if(t.common.async)return Promise.all(n.map(async i=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const l of n){const c={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(l=>new ne(l));return f(t,{code:p.invalid_union,unionErrors:s}),x}}get options(){return this._def.options}}Yt.create=(r,e)=>new Yt({options:r,typeName:w.ZodUnion,...S(e)});function Lr(r,e){const t=Ee(r),n=Ee(e);if(r===e)return{valid:!0,data:r};if(t===y.object&&n===y.object){const a=C.objectKeys(e),i=C.objectKeys(r).filter(s=>a.indexOf(s)!==-1),o={...r,...e};for(const s of i){const l=Lr(r[s],e[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(t===y.array&&n===y.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<r.length;i++){const o=r[i],s=e[i],l=Lr(o,s);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return t===y.date&&n===y.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class Gt extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(Qn(i)||Qn(o))return x;const s=Lr(i.value,o.value);return s.valid?((ea(i)||ea(o))&&t.dirty(),{status:t.value,value:s.data}):(f(n,{code:p.invalid_intersection_types}),x)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Gt.create=(r,e,t)=>new Gt({left:r,right:e,typeName:w.ZodIntersection,...S(t)});class ge extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.array)return f(n,{code:p.invalid_type,expected:y.array,received:n.parsedType}),x;if(n.data.length<this._def.items.length)return f(n,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&n.data.length>this._def.items.length&&(f(n,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Me(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>Q.mergeArray(t,o)):Q.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new ge({...this._def,rest:e})}}ge.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ge({items:r,typeName:w.ZodTuple,rest:null,...S(e)})};class sa extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.map)return f(n,{code:p.invalid_type,expected:y.map,received:n.parsedType}),x;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,l],c)=>({key:a._parse(new Me(n,s,n.path,[c,"key"])),value:i._parse(new Me(n,l,n.path,[c,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return x;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),s.set(c.value,u.value)}return{status:t.value,value:s}})}else{const s=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return x;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),s.set(c.value,u.value)}return{status:t.value,value:s}}}}sa.create=(r,e,t)=>new sa({valueType:e,keyType:r,typeName:w.ZodMap,...S(t)});class Mt extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.set)return f(n,{code:p.invalid_type,expected:y.set,received:n.parsedType}),x;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(f(n,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(f(n,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const i=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return x;u.status==="dirty"&&t.dirty(),c.add(u.value)}return{status:t.value,value:c}}const s=[...n.data.values()].map((l,c)=>i._parse(new Me(n,l,n.path,c)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(e,t){return new Mt({...this._def,minSize:{value:e,message:g.toString(t)}})}max(e,t){return new Mt({...this._def,maxSize:{value:e,message:g.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Mt.create=(r,e)=>new Mt({valueType:r,minSize:null,maxSize:null,typeName:w.ZodSet,...S(e)});class Ct extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.function)return f(t,{code:p.invalid_type,expected:y.function,received:t.parsedType}),x;function n(s,l){return Mr({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Er(),St].filter(c=>!!c),issueData:{code:p.invalid_arguments,argumentsError:l}})}function a(s,l){return Mr({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Er(),St].filter(c=>!!c),issueData:{code:p.invalid_return_type,returnTypeError:l}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Tt){const s=this;return X(async function(...l){const c=new ne([]),u=await s._def.args.parseAsync(l,i).catch(m=>{throw c.addIssue(n(l,m)),c}),h=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(h,i).catch(m=>{throw c.addIssue(a(h,m)),c})})}else{const s=this;return X(function(...l){const c=s._def.args.safeParse(l,i);if(!c.success)throw new ne([n(l,c.error)]);const u=Reflect.apply(o,this,c.data),h=s._def.returns.safeParse(u,i);if(!h.success)throw new ne([a(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ct({...this._def,args:ge.create(e).rest(tt.create())})}returns(e){return new Ct({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ct({args:e||ge.create([]).rest(tt.create()),returns:t||tt.create(),typeName:w.ZodFunction,...S(n)})}}class la extends M{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}la.create=(r,e)=>new la({getter:r,typeName:w.ZodLazy,...S(e)});class ca extends M{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return f(t,{received:t.data,code:p.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}ca.create=(r,e)=>new ca({value:r,typeName:w.ZodLiteral,...S(e)});function ua(r,e){return new nt({values:r,typeName:w.ZodEnum,...S(e)})}class nt extends M{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return f(t,{expected:C.joinValues(n),received:t.parsedType,code:p.invalid_type}),x}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return f(t,{received:t.data,code:p.invalid_enum_value,options:n}),x}return X(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return nt.create(e,{...this._def,...t})}exclude(e,t=this._def){return nt.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}nt.create=ua;class da extends M{_parse(e){const t=C.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==y.string&&n.parsedType!==y.number){const a=C.objectValues(t);return f(n,{expected:C.joinValues(a),received:n.parsedType,code:p.invalid_type}),x}if(this._cache||(this._cache=new Set(C.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=C.objectValues(t);return f(n,{received:n.data,code:p.invalid_enum_value,options:a}),x}return X(e.data)}get enum(){return this._def.values}}da.create=(r,e)=>new da({values:r,typeName:w.ZodNativeEnum,...S(e)});class Tt extends M{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.promise&&t.common.async===!1)return f(t,{code:p.invalid_type,expected:y.promise,received:t.parsedType}),x;const n=t.parsedType===y.promise?t.data:Promise.resolve(t.data);return X(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Tt.create=(r,e)=>new Tt({type:r,typeName:w.ZodPromise,...S(e)});class at extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{f(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async s=>{if(t.value==="aborted")return x;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?x:l.status==="dirty"||t.value==="dirty"?zt(l.value):l});{if(t.value==="aborted")return x;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?x:s.status==="dirty"||t.value==="dirty"?zt(s.value):s}}if(a.type==="refinement"){const o=s=>{const l=a.refinement(s,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?x:(s.status==="dirty"&&t.dirty(),o(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?x:(s.status==="dirty"&&t.dirty(),o(s.value).then(()=>({status:t.value,value:s.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Qe(o))return x;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Qe(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:t.value,value:s})):x);C.assertNever(a)}}at.create=(r,e,t)=>new at({schema:r,typeName:w.ZodEffects,effect:e,...S(t)}),at.createWithPreprocess=(r,e,t)=>new at({schema:e,effect:{type:"preprocess",transform:r},typeName:w.ZodEffects,...S(t)});class Ae extends M{_parse(e){return this._getType(e)===y.undefined?X(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ae.create=(r,e)=>new Ae({innerType:r,typeName:w.ZodOptional,...S(e)});class it extends M{_parse(e){return this._getType(e)===y.null?X(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}it.create=(r,e)=>new it({innerType:r,typeName:w.ZodNullable,...S(e)});class Rr extends M{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===y.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Rr.create=(r,e)=>new Rr({innerType:r,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});class Pr extends M{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Wt(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ne(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ne(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Pr.create=(r,e)=>new Pr({innerType:r,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});class pa extends M{_parse(e){if(this._getType(e)!==y.nan){const n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:y.nan,received:n.parsedType}),x}return{status:"valid",value:e.data}}}pa.create=r=>new pa({typeName:w.ZodNaN,...S(r)});class ho extends M{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Or extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?x:i.status==="dirty"?(t.dirty(),zt(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?x:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new Or({in:e,out:t,typeName:w.ZodPipeline})}}class Ir extends M{_parse(e){const t=this._def.innerType._parse(e),n=a=>(Qe(a)&&(a.value=Object.freeze(a.value)),a);return Wt(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}}Ir.create=(r,e)=>new Ir({innerType:r,typeName:w.ZodReadonly,...S(e)});var w;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(w||(w={}));const he=Ce.create,b=et.create,fa=Tr.create,jr=Ar.create;tt.create,Te.create;const Xt=Nr.create,Jt=fe.create,R=D.create;Yt.create,Gt.create;const ha=ge.create,ie=Ct.create,mo=nt.create,yo=Tt.create;Ae.create,it.create,R({pin:R({fade:fa().optional(),maxCount:b().optional(),maxZoom:b().optional()}).optional(),animation:R({queue:R({limit:b().optional()}).optional()}).optional()});const Dr=b().min(-90).max(90),Zr=b().min(-180).max(180),go=R({sw:R({lat:Dr,lng:Zr}),ne:R({lat:Dr,lng:Zr})}),Fr=jr().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),_o=R({mapSize:b().min(1),zoomMin:b().min(0),zoomMax:b().min(0),zoomScale:b().min(1).max(10)}),vo=R({instance:jr(),inserted:ie().returns(fa()),insert:ie().returns(Xt()),remove:ie().returns(Xt()),update:ie().args(b()).returns(Xt())}),xo=R({getParameters:ie().args().returns(_o),getContainer:ie().args().returns(Fr),getZoom:ie().args().returns(b()),getBounds:ie().args().returns(go),panBy:ie().args(b(),b()).returns(Xt()),createMarker:ie().args(Fr,Dr,Zr,b()).returns(vo)}),Br=ie().args(he()).returns(yo(Fr)),wo=R({id:he().min(1),rank:b(),lat:b().min(-90).max(90),lng:b().min(-180).max(180),tooltip:R({style:R({width:b(),height:b(),margin:b(),radius:b()}).refine(r=>Math.min(r.width,r.height)/r.margin>=6,"Tooltip: minimum of width or height must be greater than or equal to 6 * margin"),body:Br}),pin:R({style:R({width:b(),height:b(),radius:b()}),body:Br}).optional(),popup:R({style:R({width:b(),height:b(),radius:b(),margin:b()}),body:Br}).optional()}),bo=Jt(wo);var Ze;(r=>{r.COUNT=12,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],r.DEGREES_DEFAULT=270})(Ze||(Ze={}));const Vr=he().length(32),ma=he().min(1);R({key:Vr,version:he()}),R({token:ma});const ko=ha([b(),Jt(ha([b(),b()]))]),ya=R({mapSize:b().min(1),zoomMin:b().min(0).max(24),zoomMax:b().min(0).max(24),zoomScale:b().min(1).max(10)}),So=R({id:he(),rank:b(),lat:b(),lng:b(),width:b(),height:b(),margin:b()});R({key:Vr,parameters:ya,input:Jt(So),token:he().optional()}),R({token:he().optional(),states:Jt(ko)});const zo=mo(["info","warn","error"]);R({level:zo,key:he(),title:he(),content:jr()});const ga="1.1.2",Ur="https://maps.api.arenarium.dev",Eo=`${Ur}/auth`,Mo=`${Ur}/states`,Co=`${Ur}/log`;class $r{constructor(e,t,n,a){d(this,"apiKey");d(this,"apiToken");d(this,"apiDevEnvironment");d(this,"mapProvider");d(this,"markerDataArray",new Array);d(this,"markerDataMap",new Map);d(this,"markerDataUpdating",!1);d(this,"markerPinProcessor");d(this,"markerTooltipProcessor");d(this,"markerPopupProcessor");Vr.parse(e),ma.parse(t),xo.parse(n),this.apiKey=e,this.apiToken=t,this.apiDevEnvironment=(window==null?void 0:window.location.host.startsWith("localhost"))||(window==null?void 0:window.location.host.startsWith("127.0.0.1")),this.mapProvider=n,this.markerPinProcessor=new Hr(n),this.markerTooltipProcessor=new Ao(n),this.markerPopupProcessor=new No(n),this.setConfiguration(a)}static async create(e,t,n){const a={key:e,version:ga};let o=(await kt.post(Eo,a)).token;if(!o)throw new Error("Failed to get api token");return new $r(e,o,t,n)}setConfiguration(e){var t,n;ze.setLimit(((n=(t=e==null?void 0:e.animation)==null?void 0:t.queue)==null?void 0:n.limit)??8*navigator.hardwareConcurrency),this.markerPinProcessor.setConfiguration(e)}async updateMarkers(e){bo.parse(e);try{await this.updateMarkerData(e),this.processMarkerDataCallback()}catch(t){throw console.error(t),this.removeMarkerData(),t instanceof Error&&this.log("error","Failed to update markers",t),t}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const t of this.markerDataArray)t.marker.id==e?this.markerPopupProcessor.show(t):this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const n of this.markerDataArray)this.markerPopupProcessor.hide(n);throw t instanceof Error&&this.log("error","Failed to show popup",t),t}}hidePopup(e){try{if(e){const t=this.markerDataMap.get(e);if(t==null)return;this.markerPopupProcessor.hide(t)}else for(const t of this.markerDataArray)this.markerPopupProcessor.hide(t)}catch(t){console.error(t);for(const n of this.markerDataArray)this.markerPopupProcessor.hide(n);throw t instanceof Error&&this.log("error","Failed to hide popup",t),t}}async updateMarkerData(e){try{let t=this.markerDataArray.map(a=>a.marker);for(let a=0;a<e.length;a++){const i=e[a];this.markerDataMap.get(i.id)||t.push(i)}const n=await this.getMarkerStates(t);try{this.markerDataUpdating=!0;for(let a=0;a<t.length;a++){const i=t[a],o=n[a],s=this.markerDataMap.get(i.id);if(s)s.update(o);else{const l=new To(this.mapProvider,i,o);l.create(),this.markerDataMap.set(i.id,l),this.markerDataArray.push(l)}}this.markerDataArray.sort((a,i)=>a.zoom-i.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(a=>a.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(a=>a.tooltip)),this.markerPopupProcessor.updateElements(this.markerDataArray.map(a=>a.popup).filter(a=>a!=null))}finally{this.markerDataUpdating=!1}}catch(t){throw console.error(t),this.markerDataArray.forEach(n=>n.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),t instanceof Error&&this.log("error","Failed to update marker data",t),t}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.removeElements(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove marker data",e),e}finally{this.markerDataUpdating=!1}}async getMarkerStates(e){if(e.length==0)return[];if(e.length==1)return[[0,[[0,Ze.DEGREES.indexOf(Ze.DEGREES_DEFAULT)]]]];const t=this.mapProvider.getParameters();ya.parse(t);const n=e.map(o=>({id:o.id,rank:o.rank,lat:o.lat,lng:o.lng,width:o.tooltip.style.width,height:o.tooltip.style.height,margin:o.tooltip.style.margin})),a={key:this.apiKey,token:this.apiToken,parameters:t,input:n},i=await kt.post(Mo,a,{headers:{"Cache-Control":this.apiDevEnvironment?"no-cache":""}});return i.token&&(this.apiToken=i.token),i.states}processMarkerDataCallback(){if(this.mapProvider.getContainer().parentElement!=null&&this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e),e instanceof Error&&this.log("error","Failed to process marker data",e)}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.mapProvider.getBounds(),t=this.mapProvider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,t),this.markerPinProcessor.process(e,t)}async log(e,t,n){if(!this.apiDevEnvironment)try{const a={key:this.apiKey,title:t,level:e,content:{version:ga,...n}};await kt.post(Co,a)}catch(a){console.error(a)}}}class To{constructor(e,t,n){d(this,"marker");d(this,"zoom");d(this,"pin");d(this,"tooltip");d(this,"popup");this.marker=t,this.zoom=n[0],this.pin=new Wr(e,t,n),this.tooltip=new Yr(e,t,n),t.popup&&(this.popup=new Gr(e,t))}create(){var e;this.pin.create(),this.tooltip.create(),(e=this.popup)==null||e.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){var e;this.pin.remove(),this.tooltip.remove(),(e=this.popup)==null||e.remove()}}class qr{constructor(e,t){d(this,"provider");d(this,"id");d(this,"lat");d(this,"lng");d(this,"shown");d(this,"element");d(this,"component");d(this,"marker");this.provider=e,this.id=t.id,this.lat=t.lat,this.lng=t.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.updateZIndex()}createElement(){throw new Error("Create element not implemented")}createMarker(){const e=this.element;if(!e)throw new Error("Failed to create provider marker");this.marker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}updateZIndex(){if(this.marker==null)throw new Error("Failed to update provider marker z-index");this.marker.update(this.getZindex())}updateMap(e){const t=this.marker,n=this.component;if(t==null||n==null)throw new Error("Failed to update provider marker map");e?t.inserted()==!1&&t.insert():t.inserted()==!0&&t.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){var e;(e=this.marker)==null||e.remove()}}const ut=class ut extends qr{constructor(t,n,a){var i,o,s,l;super(t,n);d(this,"width");d(this,"height");d(this,"radius");d(this,"zoom");d(this,"bodyLoading",!1);d(this,"bodyLoaded",!1);d(this,"bodyCallback");this.width=((i=n.pin)==null?void 0:i.style.width)??ut.DEFAULT_SIZE,this.height=((o=n.pin)==null?void 0:o.style.height)??ut.DEFAULT_SIZE,this.radius=((s=n.pin)==null?void 0:s.style.radius)??ut.DEFAULT_SIZE,this.zoom=a[0],this.bodyCallback=(l=n.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=br(Vi,{target:this.element,props:{id:this.id+"_pin",layer:Zi,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(t){this.zoom=t[0],this.updateZIndex()}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateBody(){var n;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{a instanceof HTMLElement?t.appendChild(a):console.error("Failed to load pin body")}).catch(a=>console.error(a)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(t){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setCollapsed(t)}setScale(t){if(this.component==null)throw new Error("Failed to set pin scale");this.component.setScale(t)}getScaleFromZoomDistance(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};d(ut,"DEFAULT_SIZE",16);let Wr=ut;const dt=class dt{constructor(e){d(this,"provider");d(this,"pinElements",new Array);d(this,"pinMaxWidth",0);d(this,"pinMaxHeight",0);d(this,"pinFade",!1);d(this,"pinMaxCount",0);d(this,"pinMaxZoomDelta",0);this.provider=e}setConfiguration(e){var t,n,a;this.pinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.pinMaxCount=((n=e==null?void 0:e.pin)==null?void 0:n.maxCount)??Math.max(dt.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((a=e==null?void 0:e.pin)==null?void 0:a.maxZoom)??dt.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((t,n)=>Math.max(t,n.width),0),this.pinMaxHeight=e.reduce((t,n)=>Math.max(t,n.height),0)}removeElements(){this.pinElements.forEach(e=>e.remove()),this.pinElements.length=0}process(e,t){const n=this.provider.getParameters().mapSize,a=new Jn(e,t,n,this.pinMaxWidth*2,this.pinMaxHeight*2);let i=0;for(const o of this.pinElements)a.contains(o.lat,o.lng)?o.shown&&t<o.zoom&&o.zoom<t+this.pinMaxZoomDelta?(i<this.pinMaxCount&&(o.setCollapsed(!1),o.setScale(this.pinFade?o.getScaleFromZoomDistance(t):1),o.updateMap(!0),o.isBodyLoaded()==!1&&o.updateBody()),i++):(o.setCollapsed(!0),o.isCollapsed()&&o.updateMap(!1)):o.updateMap(!1)}};d(dt,"MAP_PINS_MAX_ZOOM",2),d(dt,"MAP_PINS_MAX_COUNT",128);let Hr=dt;const Qt=class Qt extends qr{constructor(t,n,a){super(t,n);d(this,"width");d(this,"height");d(this,"margin");d(this,"radius");d(this,"zoom");d(this,"angle");d(this,"states");d(this,"bodyLoading",!1);d(this,"bodyLoaded",!1);d(this,"bodyCallback");this.width=n.tooltip.style.width,this.height=n.tooltip.style.height,this.margin=n.tooltip.style.margin,this.radius=n.tooltip.style.radius,this.zoom=a[0],this.angle=Ze.DEGREES_DEFAULT,this.states=a[1].map(i=>[i[0],Ze.DEGREES[i[1]]]),this.bodyCallback=n.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=br(Xn,{target:this.element,props:{id:this.id+"_tooltip",layer:Di,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(t){this.zoom=t[0],this.states=t[1].map(n=>[n[0],Ze.DEGREES[n[1]]]),this.updateZIndex()}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(t),this.component.setAngle(this.angle)}updateBody(){var n;if(this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{a instanceof HTMLElement?t.appendChild(a):console.error("Failed to load tooltip body")}).catch(a=>console.error(a)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(t){const n=this.states.findLast(a=>a[0]<=t);if(!n)throw new Error("Angle not found");return n[1]}getZindex(){const t=this.provider.getParameters();return Math.round((t.zoomMax-this.zoom)*t.zoomScale)+Qt.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(t)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};d(Qt,"Z_INDEX_OFFSET",1e6);let Yr=Qt;class Ao{constructor(e){d(this,"provider");d(this,"tooltipElements",new Array);d(this,"tooltipMaxWidth",0);d(this,"tooltipMaxHeight",0);this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((t,n)=>Math.max(t,n.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((t,n)=>Math.max(t,n.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.remove()),this.tooltipElements.length=0}process(e,t){const n=this.provider.getParameters().mapSize,a=new Jn(e,t,n,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const i of this.tooltipElements)a.contains(i.lat,i.lng)?i.shown&&i.zoom<=t?(i.updateState(t),i.setCollapsed(!1),i.updateMap(!0),i.isCollapsed()==!1&&i.isBodyLoaded()==!1&&i.updateBody()):(i.setCollapsed(!0),i.isCollapsed()&&i.updateMap(!1)):i.updateMap(!1)}}const er=class er extends qr{constructor(t,n){if(n.popup==null)throw new Error("Failed to create popup");super(t,n);d(this,"width");d(this,"height");d(this,"margin");d(this,"radius");d(this,"bodyLoading",!1);d(this,"bodyLoaded",!1);d(this,"bodyCallback");this.shown=!1,this.width=n.popup.style.width,this.height=n.popup.style.height,this.margin=n.popup.style.margin,this.radius=n.popup.style.radius,this.bodyCallback=n.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=br(Xn,{target:this.element,props:{id:this.id+"_popup",layer:ji,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(t){var n;super.updateMap(t),(n=this.component)==null||n.setDisplayed(t)}updateBody(){var n;if(this.bodyLoaded||this.bodyLoading)return;const t=(n=this.component)==null?void 0:n.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(a=>{a instanceof HTMLElement?t.appendChild(a):console.error("Failed to load popup body")}).catch(a=>console.error(a)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return er.Z_INDEX_OFFSET}setCollapsed(t){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(t)}setAngle(t){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(t,!0)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};d(er,"Z_INDEX_OFFSET",2e6);let Gr=er;class No{constructor(e){d(this,"provider");d(this,"popupElements",new Array);d(this,"popupPositioned",new Map);this.provider=e}show(e){e.popup&&(e.pin.shown=!1,e.tooltip.shown=!1,this.popupPositioned.set(e.marker.id,!1),e.popup.setAngle(e.tooltip.angle),e.popup.shown=!0)}hide(e){e.popup&&(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}updateElements(e){this.popupElements=e,this.popupPositioned=new Map(e.map(t=>[t.id,!1]))}removeElements(){this.popupElements.forEach(e=>e.remove()),this.popupElements.length=0,this.popupPositioned.clear()}process(){var e,t;for(const n of this.popupElements)if(n.shown){if(n.setCollapsed(!1),n.updateMap(!0),n.isExpanded()&&n.isBodyLoaded()==!1&&n.updateBody(),n.isCollapsed()==!1&&this.popupPositioned.get(n.id)==!1){const a=(e=n.component)==null?void 0:e.getBody();if(a==null)continue;const i=(t=n.component)==null?void 0:t.getOffsets();if(i==null)continue;const o=a.getBoundingClientRect();if(o.x==0&&o.y==0&&o.width==0&&o.height==0)continue;const s=o.x+o.width/2,l=o.y+o.height/2,c=s+i.x,u=l+i.y,h=c+n.width,_=u+n.height,m=this.provider.getContainer().getBoundingClientRect(),v=c-m.left,O=m.right-h,Y=u-m.top,se=m.bottom-_,L=Math.min(n.width,n.height)/4,F=v<0?v-L:O<0?-O+L:0,me=Y<0?Y-L:se<0?-se+L:0;this.provider.panBy(F,me),this.popupPositioned.set(n.id,!0)}}else n.setCollapsed(!0),n.isCollapsed()&&n.updateMap(!1)}}const Lo=()=>'<img src="https://arenarium.dev/favicon.svg" alt="Arenarium Maps" style="height: 1.25em; vertical-align: middle;" />',Xr=()=>`<a href="https://arenarium.dev" target="_blank" style="color: inherit;">${Lo()}<span> @arenarium/maps</span></a>`;class Ro{constructor(e,t,n){d(this,"MapClass");d(this,"MapMarkerClass");d(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...n,minZoom:Math.max(n.minZoom??0,0),maxZoom:Math.min(n.maxZoom??22,24),style:n.style??"https://tiles.openfreemap.org/styles/liberty",pitchWithRotate:!1,attributionControl:n.attributionControl??{compact:!1,customAttribution:Xr()}}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable(),this.map.on("load",()=>{const a=this.map.getContainer();a!=null&&(a.style.zIndex="0");const i=document.getElementsByClassName("maplibregl-ctrl-bottom-right")[0];i!=null&&(i.style.zIndex=Number.MAX_SAFE_INTEGER.toString())})}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds(),t=e.getSouthWest(),n=e.getNorthEast();return{sw:t,ne:n}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,n){const a=new this.MapMarkerClass({element:e});return a.setLngLat([n,t]),{instance:a,inserted:()=>a._map!=null,insert:()=>a.addTo(this.map),remove:()=>a.remove(),update:i=>a.getElement().style.zIndex=i.toString()}}}const Po={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(120, 120, 120, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(128, 128, 128, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(56, 56, 56, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(153, 153, 153, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(104, 104, 104, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(56, 56, 56, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(136, 136, 136, 1)","fill-outline-color":"rgba(102, 102, 102, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(128, 128, 128, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(50, 50, 50, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(52, 52, 52, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(88, 88, 88, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20],"line-color":"rgba(102, 102, 102, 1)"}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23],"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":2,"line-color":"rgba(85, 85, 85, 1)"}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(102, 102, 102, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(85, 85, 85, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(102, 102, 102, 1)",6,"rgba(85, 85, 85, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(68, 68, 68, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(51, 51, 51, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(51, 51, 51, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(255, 255, 255, 1)","text-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]},Oo={version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},glyphs:"https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"rgba(220, 220, 220, 1)"}},{id:"park",type:"fill",source:"openmaptiles","source-layer":"park",filter:["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],paint:{"fill-color":"rgba(228, 228, 228, 1)"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["!=",["get","brunnel"],"tunnel"]],paint:{"fill-antialias":!0,"fill-color":"rgba(156, 156, 156, 1)"}},{id:"landcover_ice_shelf",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"ice_shelf"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":.7}},{id:"landcover_glacier",type:"fill",source:"openmaptiles","source-layer":"landcover",maxzoom:8,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","subclass"],"glacier"]],paint:{"fill-color":"rgba(253, 253, 253, 1)","fill-opacity":["interpolate",["linear"],["zoom"],0,1,8,.5]}},{id:"landuse_residential",type:"fill",source:"openmaptiles","source-layer":"landuse",maxzoom:16,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"residential"]],paint:{"fill-color":"rgba(204, 204, 204, 1)","fill-opacity":["interpolate",["exponential",.6],["zoom"],8,.8,9,.6]}},{id:"landcover_wood",type:"fill",source:"openmaptiles","source-layer":"landcover",minzoom:10,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"wood"]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],8,0,12,1]}},{id:"waterway",type:"line",source:"openmaptiles","source-layer":"waterway",filter:["==",["geometry-type"],"LineString"],paint:{"line-color":"rgba(156, 156, 156, 1)"}},{id:"building",type:"fill",source:"openmaptiles","source-layer":"building",minzoom:12,paint:{"fill-antialias":!0,"fill-color":"rgba(236, 236, 236, 1)","fill-outline-color":"rgba(202, 202, 202, 1)"}},{id:"tunnel_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"tunnel_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"tunnel"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(185, 185, 185)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"aeroway-taxiway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["match",["get","class"],["taxiway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"aeroway-runway-casing",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["match",["get","class"],["runway"],!0,!1],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,6,17,55]}},{id:"aeroway-area",type:"fill",source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["match",["get","class"],["runway","taxiway"],!0,!1]],paint:{"fill-color":"rgba(228, 228, 228, 1)","fill-opacity":["interpolate",["linear"],["zoom"],13,0,14,1]}},{id:"aeroway-runway",type:"line",source:"openmaptiles","source-layer":"aeroway",minzoom:11,filter:["all",["match",["get","class"],["runway"],!0,!1],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-opacity":1,"line-width":["interpolate",["exponential",1.5],["zoom"],11,4,17,50]}},{id:"road_area_pier",type:"fill",source:"openmaptiles","source-layer":"transportation",filter:["all",["in",["geometry-type"],["literal",["Polygon","MultiPolygon"]]],["==",["get","class"],"pier"]],paint:{"fill-antialias":!0,"fill-color":"rgba(150, 150, 150, 1)"}},{id:"road_pier",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["pier"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(152, 152, 152, 1)","line-width":["interpolate",["exponential",1.2],["zoom"],15,1,17,4]}},{id:"highway_path",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"path"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgb(188, 188, 188)","line-opacity":.9,"line-width":["interpolate",["exponential",1.2],["zoom"],13,1,20,10]}},{id:"highway_minor",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:8,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-opacity":.9,"line-width":["interpolate",["exponential",1.55],["zoom"],13,1.8,20,20]}},{id:"highway_major_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(185, 185, 185)","line-dasharray":[12,0],"line-width":["interpolate",["exponential",1.3],["zoom"],10,3,20,23]}},{id:"highway_major_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],10,2,20,20]}},{id:"highway_major_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:11,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":2}},{id:"highway_motorway_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,3,20,40]}},{id:"highway_motorway_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["match",["get","brunnel"],["bridge","tunnel"],!1,!0],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"highway_motorway_subtle",type:"line",source:"openmaptiles","source-layer":"transportation",maxzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"motorway"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3]}},{id:"railway_transit",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":3}},{id:"railway_transit_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"transit"],["match",["get","brunnel"],["tunnel"],!1,!0]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway_service",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","class"],"rail"],["has","service"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(202, 202, 202, 1)","line-width":3}},{id:"railway_service_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:16,filter:["all",["==",["geometry-type"],"LineString"],["==",["get","class"],"rail"],["has","service"]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-dasharray":[3,3],"line-width":2}},{id:"railway",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(185, 185, 185, 1)","line-width":["interpolate",["exponential",1.3],["zoom"],16,3,20,7]}},{id:"railway_dashline",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["==",["geometry-type"],"LineString"],["all",["!",["has","service"]],["==",["get","class"],"rail"]]],layout:{"line-join":"round"},paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[3,3],"line-width":["interpolate",["exponential",1.3],["zoom"],16,2,20,6]}},{id:"highway_motorway_bridge_casing",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"butt","line-join":"miter"},paint:{"line-color":"rgb(168, 168, 168)","line-dasharray":[2,0],"line-opacity":1,"line-width":["interpolate",["exponential",1.4],["zoom"],5.8,0,6,5,20,45]}},{id:"highway_motorway_bridge_inner",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:6,filter:["all",["==",["geometry-type"],"LineString"],["all",["==",["get","brunnel"],"bridge"],["==",["get","class"],"motorway"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["interpolate",["linear"],["zoom"],5.8,"rgba(202, 202, 202, 1)",6,"rgba(185, 185, 185, 1)"],"line-width":["interpolate",["exponential",1.4],["zoom"],4,2,6,1.3,20,30]}},{id:"boundary_3",type:"line",source:"openmaptiles","source-layer":"boundary",minzoom:8,filter:["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],6],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],paint:{"line-color":"rgba(168, 168, 168, 1)","line-dasharray":[1,1],"line-width":["interpolate",["linear"],["zoom"],7,1,11,2]}},{id:"boundary_2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1],["!=",["get","disputed"],1],["!",["has","claimed_by"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(151, 151, 151, 1)","line-opacity":["interpolate",["linear"],["zoom"],0,.4,4,1],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"boundary_disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=",["get","maritime"],1],["==",["get","disputed"],1]],paint:{"line-color":"rgba(151, 151, 151, 1)","line-dasharray":[1,2],"line-width":["interpolate",["linear"],["zoom"],3,1,5,1.2,12,3]}},{id:"waterway_line_label",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:10,filter:["==",["geometry-type"],"LineString"],layout:{"symbol-placement":"line","symbol-spacing":350,"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":5,"text-size":14},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1.5}},{id:"water_name_point_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",minzoom:0,filter:["==",["geometry-type"],"Point"],layout:{visibility:"none"}},{id:"water_name_line_label",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==",["geometry-type"],"LineString"],layout:{visibility:"none"}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==",["get","class"],"path"],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(158, 158, 158, 1)","text-halo-color":"rgba(244, 244, 244, 1)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==",["geometry-type"],"LineString"],["match",["get","class"],["minor","service","track"],!0,!1]],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["match",["get","class"],["primary","secondary","tertiary","trunk"],!0,!1],layout:{"symbol-placement":"line","text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"map","text-size":["interpolate",["linear"],["zoom"],13,12,14,13]},paint:{"text-color":"rgba(34, 34, 34, 1)","text-halo-width":1,"text-halo-color":"rgba(255, 255, 255, 1)"}},{id:"highway-shield-non-us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-interstate","us-state"],!1,!0]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10},paint:{"text-halo-color":"rgba(0, 0, 0, 1)","text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:11,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-interstate"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",7,"line",8,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"road_shield_us",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12,filter:["all",["<=",["get","ref_length"],6],["==",["geometry-type"],"LineString"],["match",["get","network"],["us-highway","us-state"],!0,!1]],layout:{"icon-rotation-alignment":"viewport","icon-size":1,"symbol-placement":["step",["zoom"],"point",11,"line"],"symbol-spacing":200,"text-field":["to-string",["get","ref"]],"text-font":["Noto Sans Regular"],"text-rotation-alignment":"viewport","text-size":10}},{id:"airport",type:"symbol",source:"openmaptiles","source-layer":"aerodrome_label",minzoom:11,filter:["all",["has","iata"]],layout:{"icon-size":1,"text-anchor":"top","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":9,"text-offset":[0,.6],"text-optional":!0,"text-padding":2,"text-size":12},paint:{"text-color":"rgba(51, 51, 51, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_other",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:8,filter:["match",["get","class"],["city","continent","country","state","town","village"],!1,!0],layout:{"text-field":["get","name:latin"],"text-font":["Noto Sans Regular"],"text-letter-spacing":.1,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],8,9,12,10],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_village",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:9,filter:["==",["get","class"],"village"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,10,11,12]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_town",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:6,filter:["==",["get","class"],"town"],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.2,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-size":["interpolate",["exponential",1.2],["zoom"],7,12,11,14]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_state",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:5,maxzoom:8,filter:["==",["get","class"],"state"],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-letter-spacing":.2,"text-max-width":9,"text-size":["interpolate",["linear"],["zoom"],5,10,8,14],"text-transform":"uppercase"},paint:{"text-color":"rgba(17, 17, 17, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["!=",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.4,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Regular"],"text-max-width":8,"text-offset":[0,-.1],"text-size":["interpolate",["exponential",1.2],["zoom"],4,11,7,13,11,18]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_city_capital",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:3,filter:["all",["==",["get","class"],"city"],["==",["get","capital"],2]],layout:{"icon-allow-overlap":!0,"icon-optional":!1,"icon-size":.5,"text-anchor":"bottom","text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":8,"text-offset":[0,-.2],"text-size":["interpolate",["exponential",1.2],["zoom"],4,12,7,14,11,20]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_3",type:"symbol",source:"openmaptiles","source-layer":"place",minzoom:2,maxzoom:9,filter:["all",["==",["get","class"],"country"],[">=",["get","rank"],3]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],3,9,7,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_2",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],2]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],2,9,5,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}},{id:"label_country_1",type:"symbol",source:"openmaptiles","source-layer":"place",maxzoom:9,filter:["all",["==",["get","class"],"country"],["==",["get","rank"],1]],layout:{"text-field":["coalesce",["get","name_en"],["get","name:latin"]],"text-font":["Noto Sans Bold"],"text-max-width":6.25,"text-size":["interpolate",["linear"],["zoom"],1,9,4,17]},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"rgba(255, 255, 255, 1)","text-halo-width":1}}]};class Io{constructor(e,t,n){d(this,"MapClass");d(this,"MapMarkerClass");d(this,"map");this.MapClass=e,this.MapMarkerClass=t,this.map=new this.MapClass({...n,minZoom:Math.max(n.minZoom??0,0),maxZoom:Math.min(n.maxZoom??22,24),projection:"mercator",pitchWithRotate:!1,customAttribution:n.customAttribution??Xr()}),this.map.dragRotate.disable(),this.map.keyboard.disable(),this.map.touchZoomRotate.disableRotation(),this.map.touchPitch.disable(),this.map.on("load",()=>{const a=this.map.getContainer();a!=null&&(a.style.zIndex="0");const i=document.getElementsByClassName("mapboxgl-ctrl-bottom-right")[0];i!=null&&(i.style.zIndex=Number.MAX_SAFE_INTEGER.toString())})}getParameters(){return{mapSize:512,zoomMin:this.map.getMinZoom()??0,zoomMax:this.map.getMaxZoom()??22,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getContainer()}getZoom(){return this.map.getZoom()}getBounds(){const e=this.map.getBounds();if(!e)return{sw:{lat:0,lng:0},ne:{lat:0,lng:0}};const t=e.getSouthWest(),n=e.getNorthEast();return{sw:t,ne:n}}panBy(e,t){this.map.panBy([e,t])}createMarker(e,t,n){const a=new this.MapMarkerClass({element:e});return a.setLngLat([n,t]),{instance:a,inserted:()=>a._map!=null,insert:()=>a.addTo(this.map),remove:()=>a.remove(),update:i=>a.getElement().style.zIndex=i.toString()}}}class jo{constructor(e,t,n,a){d(this,"MapClass");d(this,"MapMarkerClass");d(this,"map");d(this,"options");d(this,"attributionObserver");d(this,"attributionElement");this.MapClass=e,this.MapMarkerClass=t,this.options=a,this.map=new this.MapClass(n,{...a}),(a.attribution||a.attribution==null)&&(this.map.addListener("idle",()=>{this.attributionObserver||(this.attributionObserver=new MutationObserver((i,o)=>{this.insertAttributionElement(),this.attributionElement!=null&&(this.updateAttributionElement(),o.disconnect())}),this.attributionObserver.observe(n,{childList:!0,subtree:!0}))}),this.map.addListener("bounds_changed",()=>{this.updateAttributionElement()}))}insertAttributionElement(){var i,o;const e=this.map.getDiv();if(e==null)return;const t=e.getElementsByClassName("gmnoprint")[0];if(t==null||t.parentElement==null)return;const n=t.cloneNode(!0),a=(o=(i=n.childNodes.item(0))==null?void 0:i.childNodes.item(1))==null?void 0:o.childNodes.item(0);a!=null&&(a.title="",a.innerHTML=Xr(),t.parentElement.insertBefore(n,t),this.attributionElement=a)}updateAttributionElement(){var n,a;const e=this.map.getDiv();if(e==null)return;const t=(a=(n=this.attributionElement)==null?void 0:n.childNodes.item(0))==null?void 0:a.childNodes.item(1);t!=null&&(t.style.display=e.clientWidth>500?"initial":"none")}getParameters(){return{mapSize:256,zoomMin:this.options.minZoom??0,zoomMax:this.options.maxZoom??24,zoomScale:10}}getMap(){return this.map}getContainer(){return this.map.getDiv()}getZoom(){return this.map.getZoom()??NaN}getBounds(){const e=this.map.getBounds();if(e==null)return{sw:{lat:NaN,lng:NaN},ne:{lat:NaN,lng:NaN}};const t=e.getSouthWest(),n=e.getNorthEast();return{sw:{lat:t.lat(),lng:t.lng()},ne:{lat:n.lat(),lng:n.lng()}}}panBy(e,t){this.map.panBy(e,t)}createMarker(e,t,n,a){const i=new this.MapMarkerClass({position:{lat:t,lng:n},content:e,zIndex:a});return{instance:i,inserted:()=>i.map!=null&&i.map==this.map,insert:()=>i.map=this.map,remove:()=>i.map=void 0,update:o=>i.zIndex=o}}}const Do=[{elementType:"labels.icon",stylers:[{visibility:"off"}]},{stylers:[{saturation:-100},{lightness:-10}]},{featureType:"landscape",stylers:[{lightness:30}]},{featureType:"road",elementType:"geometry",stylers:[{saturation:-100}]}],Zo=[{elementType:"labels.icon",stylers:[{visibility:"off"}]},{stylers:[{saturation:-100}]},{elementType:"geometry",stylers:[{lightness:-45}]},{elementType:"labels.text.fill",stylers:[{lightness:-100}]},{elementType:"labels.text.stroke",stylers:[{lightness:-15}]},{featureType:"water",elementType:"geometry",stylers:[{lightness:-50}]}];z.GoogleMapDarkStyle=Zo,z.GoogleMapLightStyle=Do,z.GoogleMapsProvider=jo,z.MapManager=$r,z.MapboxProvider=Io,z.MaplibreDarkStyle=Po,z.MaplibreLightStyle=Oo,z.MaplibreProvider=Ro,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));
|