@arenarium/maps 1.0.164 → 1.0.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +13 -23
- package/dist/index.js +2 -2
- package/dist/main.cjs.js +2 -2
- package/dist/main.d.ts +13 -23
- package/dist/main.es.js +3019 -2339
- package/package.json +4 -4
package/dist/main.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Ys=Object.defineProperty;var Er=r=>{throw TypeError(r)};var Ws=(r,e,t)=>e in r?Ys(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var f=(r,e,t)=>Ws(r,typeof e!="symbol"?e+"":e,t),Cr=(r,e,t)=>e.has(r)||Er("Cannot "+t);var X=(r,e,t)=>(Cr(r,e,"read from private field"),t?t.call(r):e.get(r)),qe=(r,e,t)=>e.has(r)?Er("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Ye=(r,e,t,s)=>(Cr(r,e,"write to private field"),s?s.call(r,t):e.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Sr=!1;var es=Array.isArray,Xs=Array.prototype.indexOf,Hs=Array.from,Gs=Object.defineProperty,He=Object.getOwnPropertyDescriptor,Js=Object.prototype,Qs=Array.prototype,Ks=Object.getPrototypeOf,Tr=Object.isExtensible;function en(r){for(var e=0;e<r.length;e++)r[e]()}const $=2,nr=4,ar=8,ir=16,ve=32,Ve=64,or=128,U=256,ft=512,J=1024,ie=2048,Ee=4096,ht=8192,lr=16384,ts=32768,tn=65536,Ar=1<<17,rn=1<<18,rs=1<<19,Dt=1<<20,ss=1<<21,lt=Symbol("$state"),ns=new class extends Error{constructor(){super(...arguments);f(this,"name","StaleReactionError");f(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function as(r){return r===this.v}function sn(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function nn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function an(r){throw new Error("https://svelte.dev/e/effect_orphan")}function on(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ln(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function un(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function dn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let cn=!1;const Z=Symbol();let re=null;function Mr(r){re=r}function ur(r,e=!1,t){re={p:re,c:null,e:null,s:r,x:null,l:null}}function dr(r){var e=re,t=e.e;if(t!==null){e.e=null;for(var s of t)ms(s)}return r!==void 0&&(e.x=r),re=e.p,r??{}}function is(){return!0}function We(r){if(typeof r!="object"||r===null||lt in r)return r;const e=Ks(r);if(e!==Js&&e!==Qs)return r;var t=new Map,s=es(r),n=z(0),a=we,i=o=>{if(we===a)return o();var l=A,u=we;Le(null),Ir(a);var d=o();return Le(l),Ir(u),d};return s&&t.set("length",z(r.length)),new Proxy(r,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&ln();var d=t.get(l);return d===void 0?d=i(()=>{var h=z(u.value);return t.set(l,h),h}):P(d,u.value,!0),!0},deleteProperty(o,l){var u=t.get(l);if(u===void 0){if(l in o){const p=i(()=>z(Z));t.set(l,p),Nt(n)}}else{if(s&&typeof l=="string"){var d=t.get("length"),h=Number(l);Number.isInteger(h)&&h<d.v&&P(d,h)}P(u,Z),Nt(n)}return!0},get(o,l,u){var v;if(l===lt)return r;var d=t.get(l),h=l in o;if(d===void 0&&(!h||(v=He(o,l))!=null&&v.writable)&&(d=i(()=>{var x=We(h?o[l]:Z),M=z(x);return M}),t.set(l,d)),d!==void 0){var p=R(d);return p===Z?void 0:p}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var d=t.get(l);d&&(u.value=R(d))}else if(u===void 0){var h=t.get(l),p=h==null?void 0:h.v;if(h!==void 0&&p!==Z)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return u},has(o,l){var p;if(l===lt)return!0;var u=t.get(l),d=u!==void 0&&u.v!==Z||Reflect.has(o,l);if(u!==void 0||N!==null&&(!d||(p=He(o,l))!=null&&p.writable)){u===void 0&&(u=i(()=>{var v=d?We(o[l]):Z,x=z(v);return x}),t.set(l,u));var h=R(u);if(h===Z)return!1}return d},set(o,l,u,d){var D;var h=t.get(l),p=l in o;if(s&&l==="length")for(var v=u;v<h.v;v+=1){var x=t.get(v+"");x!==void 0?P(x,Z):v in o&&(x=i(()=>z(Z)),t.set(v+"",x))}if(h===void 0)(!p||(D=He(o,l))!=null&&D.writable)&&(h=i(()=>z(void 0)),P(h,We(u)),t.set(l,h));else{p=h.v!==Z;var M=i(()=>We(u));P(h,M)}var O=Reflect.getOwnPropertyDescriptor(o,l);if(O!=null&&O.set&&O.set.call(d,u),!p){if(s&&typeof l=="string"){var Y=t.get("length"),C=Number(l);Number.isInteger(C)&&C>=Y.v&&P(Y,C+1)}Nt(n)}return!0},ownKeys(o){R(n);var l=Reflect.ownKeys(o).filter(h=>{var p=t.get(h);return p===void 0||p.v!==Z});for(var[u,d]of t)d.v!==Z&&!(u in o)&&l.push(u);return l},setPrototypeOf(){un()}})}function fn(r){var e=$|ie,t=A!==null&&(A.f&$)!==0?A:null;return N===null||t!==null&&(t.f&U)!==0?e|=U:N.f|=rs,{ctx:re,deps:null,effects:null,equals:as,f:e,fn:r,reactions:null,rv:0,v:Z,wv:0,parent:t??N,ac:null}}function os(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)xe(e[t])}}function hn(r){for(var e=r.parent;e!==null;){if((e.f&$)===0)return e;e=e.parent}return null}function cr(r){var e,t=N;vt(hn(r));try{os(r),e=Cs(r)}finally{vt(t)}return e}function ls(r){var e=cr(r);if(r.equals(e)||(r.v=e,r.wv=bs()),!be){var t=(ce||(r.f&U)!==0)&&r.deps!==null?Ee:J;oe(r,t)}}const ye=new Map;function pn(r,e){var t={f:0,v:r,reactions:null,equals:as,rv:0,wv:0};return t}function z(r,e){const t=pn(r);return In(t),t}function P(r,e,t=!1){A!==null&&(!Q||(A.f&Ar)!==0)&&is()&&(A.f&($|ir|Ar))!==0&&!(F!=null&&F.includes(r))&&dn();let s=t?We(e):e;return mn(r,s)}function mn(r,e){if(!r.equals(e)){var t=r.v;be?ye.set(r,e):ye.set(r,t),r.v=e,(r.f&$)!==0&&((r.f&ie)!==0&&cr(r),oe(r,(r.f&U)===0?J:Ee)),r.wv=bs(),us(r,ie),N!==null&&(N.f&J)!==0&&(N.f&(ve|Ve))===0&&(H===null?Rn([r]):H.push(r))}return e}function Nt(r){P(r,r.v+1)}function us(r,e){var t=r.reactions;if(t!==null)for(var s=t.length,n=0;n<s;n++){var a=t[n],i=a.f;(i&ie)===0&&(oe(a,e),(i&(J|U))!==0&&((i&$)!==0?us(a,Ee):Tt(a)))}}var Or,ds,cs,fs;function vn(){if(Or===void 0){Or=window,ds=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;cs=He(e,"firstChild").get,fs=He(e,"nextSibling").get,Tr(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),Tr(t)&&(t.__t=void 0)}}function gn(r=""){return document.createTextNode(r)}function hs(r){return cs.call(r)}function ps(r){return fs.call(r)}function Zt(r,e){return hs(r)}function yn(r,e=1,t=!1){let s=r;for(;e--;)s=ps(s);return s}function _n(r){N===null&&A===null&&an(),A!==null&&(A.f&U)!==0&&N===null&&nn(),be&&sn()}function wn(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Be(r,e,t,s=!0){var n=N,a={ctx:re,deps:null,nodes_start:null,nodes_end:null,f:r|ie,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{fr(a),a.f|=ts}catch(l){throw xe(a),l}else e!==null&&Tt(a);var i=t&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&(rs|or))===0;if(!i&&s&&(n!==null&&wn(a,n),A!==null&&(A.f&$)!==0)){var o=A;(o.effects??(o.effects=[])).push(a)}return a}function ne(r){if(_n(),!A&&N&&(N.f&ve)!==0){var e=re;(e.e??(e.e=[])).push(r)}else return ms(r)}function ms(r){return Be(nr|ss,r,!1)}function kn(r){const e=Be(Ve,r,!0);return(t={})=>new Promise(s=>{t.outro?Tn(e,()=>{xe(e),s(void 0)}):(xe(e),s(void 0))})}function xn(r){return Be(nr,r,!1)}function vs(r){return Be(ar,r,!0)}function gs(r,e=[],t=fn){const s=e.map(t);return bn(()=>r(...s.map(R)))}function bn(r,e=0){var t=Be(ar|ir|e,r,!0);return t}function En(r,e=!0){return Be(ar|ve,r,!0,e)}function ys(r){var e=r.teardown;if(e!==null){const t=be,s=A;Nr(!0),Le(null);try{e.call(null)}finally{Nr(t),Le(s)}}}function _s(r,e=!1){var n;var t=r.first;for(r.first=r.last=null;t!==null;){(n=t.ac)==null||n.abort(ns);var s=t.next;(t.f&Ve)!==0?t.parent=null:xe(t,e),t=s}}function Cn(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&ve)===0&&xe(e),e=t}}function xe(r,e=!0){var t=!1;(e||(r.f&rn)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(Sn(r.nodes_start,r.nodes_end),t=!0),_s(r,e&&!t),yt(r,0),oe(r,lr);var s=r.transitions;if(s!==null)for(const a of s)a.stop();ys(r);var n=r.parent;n!==null&&n.first!==null&&ws(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=r.ac=null}function Sn(r,e){for(;r!==null;){var t=r===e?null:ps(r);r.remove(),r=t}}function ws(r){var e=r.parent,t=r.prev,s=r.next;t!==null&&(t.next=s),s!==null&&(s.prev=t),e!==null&&(e.first===r&&(e.first=s),e.last===r&&(e.last=t))}function Tn(r,e){var t=[];ks(r,t,!0),An(t,()=>{xe(r),e&&e()})}function An(r,e){var t=r.length;if(t>0){var s=()=>--t||e();for(var n of r)n.out(s)}else e()}function ks(r,e,t){if((r.f&ht)===0){if(r.f^=ht,r.transitions!==null)for(const i of r.transitions)(i.is_global||t)&&e.push(i);for(var s=r.first;s!==null;){var n=s.next,a=(s.f&tn)!==0||(s.f&ve)!==0;ks(s,e,a?t:!1),s=n}}}let pt=[];function Mn(){var r=pt;pt=[],en(r)}function On(r){pt.length===0&&queueMicrotask(Mn),pt.push(r)}function Nn(r){var e=N;if((e.f&ts)===0){if((e.f&or)===0)throw r;e.fn(r)}else xs(r,e)}function xs(r,e){for(;e!==null;){if((e.f&or)!==0)try{e.b.error(r);return}catch{}e=e.parent}throw r}let jt=!1,mt=null,_e=!1,be=!1;function Nr(r){be=r}let ut=[];let A=null,Q=!1;function Le(r){A=r}let N=null;function vt(r){N=r}let F=null;function In(r){A!==null&&A.f&Dt&&(F===null?F=[r]:F.push(r))}let j=null,B=0,H=null;function Rn(r){H=r}let gt=1,Qe=0,we=Qe;function Ir(r){we=r}let ce=!1;function bs(){return++gt}function St(r){var h;var e=r.f;if((e&ie)!==0)return!0;if((e&Ee)!==0){var t=r.deps,s=(e&U)!==0;if(t!==null){var n,a,i=(e&ft)!==0,o=s&&N!==null&&!ce,l=t.length;if(i||o){var u=r,d=u.parent;for(n=0;n<l;n++)a=t[n],(i||!((h=a==null?void 0:a.reactions)!=null&&h.includes(u)))&&(a.reactions??(a.reactions=[])).push(u);i&&(u.f^=ft),o&&d!==null&&(d.f&U)===0&&(u.f^=U)}for(n=0;n<l;n++)if(a=t[n],St(a)&&ls(a),a.wv>r.wv)return!0}(!s||N!==null&&!ce)&&oe(r,J)}return!1}function Es(r,e,t=!0){var s=r.reactions;if(s!==null&&!(F!=null&&F.includes(r)))for(var n=0;n<s.length;n++){var a=s[n];(a.f&$)!==0?Es(a,e,!1):e===a&&(t?oe(a,ie):(a.f&J)!==0&&oe(a,Ee),Tt(a))}}function Cs(r){var x;var e=j,t=B,s=H,n=A,a=ce,i=F,o=re,l=Q,u=we,d=r.f;j=null,B=0,H=null,ce=(d&U)!==0&&(Q||!_e||A===null),A=(d&(ve|Ve))===0?r:null,F=null,Mr(r.ctx),Q=!1,we=++Qe,r.f|=Dt,r.ac!==null&&(r.ac.abort(ns),r.ac=null);try{var h=(0,r.fn)(),p=r.deps;if(j!==null){var v;if(yt(r,B),p!==null&&B>0)for(p.length=B+j.length,v=0;v<j.length;v++)p[B+v]=j[v];else r.deps=p=j;if(!ce||(d&$)!==0&&r.reactions!==null)for(v=B;v<p.length;v++)((x=p[v]).reactions??(x.reactions=[])).push(r)}else p!==null&&B<p.length&&(yt(r,B),p.length=B);if(is()&&H!==null&&!Q&&p!==null&&(r.f&($|Ee|ie))===0)for(v=0;v<H.length;v++)Es(H[v],r);return n!==null&&n!==r&&(Qe++,H!==null&&(s===null?s=H:s.push(...H))),h}catch(M){Nn(M)}finally{j=e,B=t,H=s,A=n,ce=a,F=i,Mr(o),Q=l,we=u,r.f^=Dt}}function Ln(r,e){let t=e.reactions;if(t!==null){var s=Xs.call(t,r);if(s!==-1){var n=t.length-1;n===0?t=e.reactions=null:(t[s]=t[n],t.pop())}}t===null&&(e.f&$)!==0&&(j===null||!j.includes(e))&&(oe(e,Ee),(e.f&(U|ft))===0&&(e.f^=ft),os(e),yt(e,0))}function yt(r,e){var t=r.deps;if(t!==null)for(var s=e;s<t.length;s++)Ln(r,t[s])}function fr(r){var e=r.f;if((e&lr)===0){oe(r,J);var t=N,s=_e;N=r,_e=!0;try{(e&ir)!==0?Cn(r):_s(r),ys(r);var n=Cs(r);r.teardown=typeof n=="function"?n:null,r.wv=gt;var a;Sr&&cn&&(r.f&ie)!==0&&r.deps}finally{_e=s,N=t}}}function Pn(){try{on()}catch(r){if(mt!==null)xs(r,mt);else throw r}}function Dn(){var r=_e;try{var e=0;for(_e=!0;ut.length>0;){e++>1e3&&Pn();var t=ut,s=t.length;ut=[];for(var n=0;n<s;n++){var a=jn(t[n]);Zn(a)}ye.clear()}}finally{jt=!1,_e=r,mt=null}}function Zn(r){var e=r.length;if(e!==0){for(var t=0;t<e;t++){var s=r[t];if((s.f&(lr|ht))===0&&St(s)){var n=gt;if(fr(s),s.deps===null&&s.first===null&&s.nodes_start===null&&(s.teardown===null?ws(s):s.fn=null),gt>n&&(s.f&ss)!==0)break}}for(;t<e;t+=1)Tt(r[t])}}function Tt(r){jt||(jt=!0,queueMicrotask(Dn));for(var e=mt=r;e.parent!==null;){e=e.parent;var t=e.f;if((t&(Ve|ve))!==0){if((t&J)===0)return;e.f^=J}}ut.push(e)}function jn(r){for(var e=[],t=r;t!==null;){var s=t.f,n=(s&(ve|Ve))!==0,a=n&&(s&J)!==0;if(!a&&(s&ht)===0){(s&nr)!==0?e.push(t):n?t.f^=J:St(t)&&fr(t);var i=t.first;if(i!==null){t=i;continue}}var o=t.parent;for(t=t.next;t===null&&o!==null;)t=o.next,o=o.parent}return e}function R(r){var e=r.f,t=(e&$)!==0;if(A!==null&&!Q){if(!(F!=null&&F.includes(r))){var s=A.deps;r.rv<Qe&&(r.rv=Qe,j===null&&s!==null&&s[B]===r?B++:j===null?j=[r]:(!ce||!j.includes(r))&&j.push(r))}}else if(t&&r.deps===null&&r.effects===null){var n=r,a=n.parent;a!==null&&(a.f&U)===0&&(n.f^=U)}if(t&&!be&&(n=r,St(n)&&ls(n)),be){if(ye.has(r))return ye.get(r);if(t){n=r;var i=n.v;return((n.f&J)!==0||Ss(n))&&(i=cr(n)),ye.set(n,i),i}}return r.v}function Ss(r){if(r.v===Z)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(ye.has(e)||(e.f&$)!==0&&Ss(e))return!0;return!1}function Fn(r){var e=Q;try{return Q=!0,r()}finally{Q=e}}const zn=-7169;function oe(r,e){r.f=r.f&zn|e}const Vn=["touchstart","touchmove"];function Bn(r){return Vn.includes(r)}const Un=new Set,Rr=new Set;function ot(r){var C;var e=this,t=e.ownerDocument,s=r.type,n=((C=r.composedPath)==null?void 0:C.call(r))||[],a=n[0]||r.target,i=0,o=r.__root;if(o){var l=n.indexOf(o);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var u=n.indexOf(e);if(u===-1)return;l<=u&&(i=l)}if(a=n[i]||r.target,a!==e){Gs(r,"currentTarget",{configurable:!0,get(){return a||t}});var d=A,h=N;Le(null),vt(null);try{for(var p,v=[];a!==null;){var x=a.assignedSlot||a.parentNode||a.host||null;try{var M=a["__"+s];if(M!=null&&(!a.disabled||r.target===a))if(es(M)){var[O,...Y]=M;O.apply(a,[r,...Y])}else M.call(a,r)}catch(D){p?v.push(D):p=D}if(r.cancelBubble||x===e||x===null)break;a=x}if(p){for(let D of v)queueMicrotask(()=>{throw D});throw p}}finally{r.__root=e,delete r.currentTarget,Le(d),vt(h)}}}function $n(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function qn(r,e){var t=N;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function Ts(r,e){var t,s=!r.startsWith("<!>");return()=>{t===void 0&&(t=$n(s?r:"<!>"+r),t=hs(t));var n=ds?document.importNode(t,!0):t.cloneNode(!0);return qn(n,n),n}}function As(r,e){r!==null&&r.before(e)}function hr(r,e){return Yn(r,e)}const Se=new Map;function Yn(r,{target:e,anchor:t,props:s={},events:n,context:a,intro:i=!0}){vn();var o=new Set,l=h=>{for(var p=0;p<h.length;p++){var v=h[p];if(!o.has(v)){o.add(v);var x=Bn(v);e.addEventListener(v,ot,{passive:x});var M=Se.get(v);M===void 0?(document.addEventListener(v,ot,{passive:x}),Se.set(v,1)):Se.set(v,M+1)}}};l(Hs(Un)),Rr.add(l);var u=void 0,d=kn(()=>{var h=t??e.appendChild(gn());return En(()=>{if(a){ur({});var p=re;p.c=a}n&&(s.$$events=n),u=r(h,s)||{},a&&dr()}),()=>{var x;for(var p of o){e.removeEventListener(p,ot);var v=Se.get(p);--v===0?(document.removeEventListener(p,ot),Se.delete(p)):Se.set(p,v)}Rr.delete(l),h!==t&&((x=h.parentNode)==null||x.removeChild(h))}});return Wn.set(u,d),u}let Wn=new WeakMap;const Lr=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function Xn(r,e,t){var s=r==null?"":""+r;if(t){for(var n in t)if(t[n])s=s?s+" "+n:n;else if(s.length)for(var a=n.length,i=0;(i=s.indexOf(n,i))>=0;){var o=i+a;(i===0||Lr.includes(s[i-1]))&&(o===s.length||Lr.includes(s[o]))?s=(i===0?"":s.substring(0,i))+s.substring(o+1):i=o}}return s===""?null:s}function Pr(r,e=!1){var t=e?" !important;":";",s="";for(var n in r){var a=r[n];a!=null&&a!==""&&(s+=" "+n+": "+a+t)}return s}function It(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function Hn(r,e){if(e){var t="",s,n;if(Array.isArray(e)?(s=e[0],n=e[1]):s=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,i=0,o=!1,l=[];s&&l.push(...Object.keys(s).map(It)),n&&l.push(...Object.keys(n).map(It));var u=0,d=-1;const M=r.length;for(var h=0;h<M;h++){var p=r[h];if(o?p==="/"&&r[h-1]==="*"&&(o=!1):a?a===p&&(a=!1):p==="/"&&r[h+1]==="*"?o=!0:p==='"'||p==="'"?a=p:p==="("?i++:p===")"&&i--,!o&&a===!1&&i===0){if(p===":"&&d===-1)d=h;else if(p===";"||h===M-1){if(d!==-1){var v=It(r.substring(u,d).trim());if(!l.includes(v)){p!==";"&&h++;var x=r.substring(u,h).trim();t+=" "+x+";"}}u=h+1,d=-1}}}}return s&&(t+=Pr(s)),n&&(t+=Pr(n,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function Ms(r,e,t,s,n,a){var i=r.__className;if(i!==t||i===void 0){var o=Xn(t,s,a);o==null?r.removeAttribute("class"):r.className=o,r.__className=t}else if(a&&n!==a)for(var l in a){var u=!!a[l];(n==null||u!==!!n[l])&&r.classList.toggle(l,u)}return a}function Rt(r,e={},t,s){for(var n in t){var a=t[n];e[n]!==a&&(t[n]==null?r.style.removeProperty(n):r.style.setProperty(n,a,s))}}function _t(r,e,t,s){var n=r.__style;if(n!==e){var a=Hn(e,s);a==null?r.removeAttribute("style"):r.style.cssText=a,r.__style=e}else s&&(Array.isArray(s)?(Rt(r,t==null?void 0:t[0],s[0]),Rt(r,t==null?void 0:t[1],s[1],"important")):Rt(r,t,s));return s}const Gn=()=>performance.now(),K={tick:r=>requestAnimationFrame(r),now:()=>Gn(),tasks:new Set};function Os(){const r=K.now();K.tasks.forEach(e=>{e.c(r)||(K.tasks.delete(e),e.f())}),K.tasks.size!==0&&K.tick(Os)}function Jn(r){let e;return K.tasks.size===0&&K.tick(Os),{promise:new Promise(t=>{K.tasks.add(e={c:r,f:t})}),abort(){K.tasks.delete(e)}}}function Dr(r,e){return r===e||(r==null?void 0:r[lt])===e}function Ae(r={},e,t,s){return xn(()=>{var n,a;return vs(()=>{n=a,a=[],Fn(()=>{r!==t(...a)&&(e(r,...a),n&&Dr(t(...n),r)&&e(null,...n))})}),()=>{On(()=>{a&&Dr(t(...a),r)&&e(null,...a)})}}),r}const Qn="5";var Kr;typeof window<"u"&&((Kr=window.__svelte??(window.__svelte={})).v??(Kr.v=new Set)).add(Qn);function Kn(r){return r}function Ft(r){return-.5*(Math.cos(Math.PI*r)-1)}function ea(r){const e=Math.cos(r*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function ta(r){return Math.sin(r*Math.PI/2)}const ra=128,sa=0,na=1,aa=2;class ia{constructor(){f(this,"animationsStarted",!1);f(this,"animationsCount",0);f(this,"animationsLimit",ra);f(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 s=t.animations;if(s!=null)for(let n=0;n<s.length;n++){const a=s[n];if(a!=null){for(const i of a.values())if(!i.executed&&(i.executed=!0,i.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,s,n){let a=this.layers[e];a==null&&(a=this.layers[e]={animations:new Array});let i=a.animations[t];i==null&&(i=a.animations[t]=new Map);let o={id:s,priority:t,executed:!1,function:n};i.set(s,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let s=0;s<this.layers.length;s++){let n=this.layers[s];if(n==null)continue;let a=n.animations[e];if(a==null)return;let i=a.get(t);if(i==null||i.executed==!1)return;a.delete(t)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const de=new ia;function Zr(r){return Object.prototype.toString.call(r)==="[object Date]"}function zt(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 s=e.map((n,a)=>zt(r[a],n));return n=>s.map(a=>a(n))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(Zr(r)&&Zr(e)){const a=r.getTime(),o=e.getTime()-a;return l=>new Date(a+l*o)}const s=Object.keys(e),n={};return s.forEach(a=>{n[a]=zt(r[a],e[a])}),a=>{const i={};return s.forEach(o=>{i[o]=n[o](a)}),i}}if(t==="number"){const s=e-r;return n=>r+n*s}return()=>e}var ae,Re,st,ge;const gr=class gr{constructor(e,t={}){qe(this,ae);qe(this,Re);qe(this,st);qe(this,ge,null);Ye(this,ae,z(e)),Ye(this,Re,z(e)),Ye(this,st,t)}static of(e,t){const s=new gr(e(),t);return vs(()=>{s.set(e())}),s}set(e,t){var h;P(X(this,Re),e);let{delay:s=0,duration:n=400,easing:a=Kn,interpolate:i=zt}={...X(this,st),...t};if(n===0)return(h=X(this,ge))==null||h.abort(),P(X(this,ae),e),Promise.resolve();const o=K.now()+s;let l,u=!1,d=X(this,ge);return Ye(this,ge,Jn(p=>{if(p<o)return!0;if(!u){u=!0;const x=X(this,ae).v;l=i(x,e),typeof n=="function"&&(n=n(x,e)),d==null||d.abort()}const v=p-o;return v>n?(P(X(this,ae),e),!1):(P(X(this,ae),l(a(v/n))),!0)})),X(this,ge).promise}get current(){return R(X(this,ae))}get target(){return R(X(this,Re))}set target(e){this.set(e)}};ae=new WeakMap,Re=new WeakMap,st=new WeakMap,ge=new WeakMap;let Vt=gr;class dt{constructor(e,t){f(this,"value");f(this,"motion");this.value=e,this.motion=new Vt(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 oa=Ts('<div><div class="body svelte-1nfn9j8"></div></div>');function la(r,e){ur(e,!0);let t,s;function n(){return s}let a=z(!1);function i(C){P(a,C,!0)}function o(){return R(a)}let l=new dt(0,{easing:Ft});ne(()=>{u(l.motion.current)}),ne(()=>{R(a)==!1&&(l.snap(),de.clear(e.priority,e.id))});function u(C){t&&de.equeue(e.layer,e.priority,e.id,()=>{t.style.scale=C.toString(),t.style.filter=`brightness(${.25+.75*C})`,s.style.opacity=C.toString()})}function d(C){C!=l.value&&l.set(C,{duration:75})}function h(){return l.motion.current==0}function p(){return l.value}var v=oa();let x,M;var O=Zt(v);let Y;return Ae(O,C=>s=C,()=>s),Ae(v,C=>t=C,()=>t),gs((C,D,W)=>{x=Ms(v,1,"pin svelte-1nfn9j8",null,x,C),M=_t(v,"",M,D),Y=_t(O,"",Y,W)},[()=>({displayed:R(a)}),()=>({width:`${e.width}px`,height:`${e.height}px`,"border-radius":`${e.radius}px`}),()=>({width:`${e.width-4}px`,height:`${e.height-4}px`,"border-radius":`${e.radius-2}px`})]),As(r,v),dr({getBody:n,setDisplayed:i,getDisplayed:o,setScale:d,getCollapsed:h,getScale:p})}var Ge;(r=>{function e(t,s,n){const a=t/2,i=s/2,o=Math.sqrt(a*a+i*i),l=Math.atan(i/a)*(180/Math.PI),u=n*(Math.PI/180);return n<180?n<90?n<l?{offsetX:0,offsetY:o*Math.sin(u)-i}:{offsetX:o*Math.cos(u)-a,offsetY:0}:n<180-l?{offsetX:o*Math.cos(u)-a,offsetY:0}:{offsetX:-t,offsetY:o*Math.sin(u)-i}:n<270?n<180+l?{offsetX:-t,offsetY:o*Math.sin(u)-i}:{offsetX:o*Math.cos(u)-a,offsetY:-s}:n<360-l?{offsetX:o*Math.cos(u)-a,offsetY:-s}:{offsetX:0,offsetY:o*Math.sin(u)-i}}r.getOffsets=e})(Ge||(Ge={}));var ua=Ts('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');function Ns(r,e){ur(e,!0);let t,s,n,a;const i=e.width+2*e.margin,o=e.height+2*e.margin,l=()=>a;ne(()=>{n.style.width=`${e.margin*4}px`,n.style.height=`${e.margin*4}px`});let u=z(!0);function d(T){P(u,T,!0)}function h(){return R(u)}let p=z(!0);function v(T){P(p,T,!0)}function x(){return O.motion.current==0}function M(){return O.motion.current==1}let O=new dt(0);ne(()=>{Y(O.motion.current)}),ne(()=>{R(u)==!1&&(O.snap(),de.clear(e.priority,e.id+"_scale"))}),ne(()=>{R(p)==!0&&O.value!=0&&(de.stacked()?O.set(0,{duration:0}):O.set(0,{duration:150,easing:ea})),R(p)==!1&&O.value!=1&&O.set(1,{duration:150,easing:ta})});function Y(T){!t||!s||!n||de.equeue(R(p)?0:e.layer,e.priority,e.id+"_scale",()=>{t.style.opacity=`${T}`,s.style.scale=`${T}`,n.style.scale=`${T}`})}let C=NaN,D=z(!1),W=new dt(-i/2,{easing:Ft}),nt=new dt(-o/2,{easing:Ft});ne(()=>{yr(W.motion.current,nt.motion.current)}),ne(()=>{R(u)==!1&&(W.snap(),W.snap(),de.clear(e.priority,e.id+"_angle"))}),ne(()=>{R(p)==!0&&R(D)&&(W.update({duration:75}),W.update({duration:75}))});function yr(T,se){if(!t||!s||!n)return;const it=T+i/2,Ue=se+o/2,Ce=o<i?it*o/i:it,Mt=o>i?Ue*i/o:Ue,Vs=Math.atan2(Mt,Ce)/Math.PI*180-45,xr=0,Bs=30,Ot=Math.sqrt(Ce*Ce+Mt*Mt),$e=Math.min(i,o)/2,Us=$e*Math.SQRT2,$s=(Ot-$e)/(Us-$e),br=xr+$s*(Bs-xr),qs=Ot<$e?Ot/$e:1;de.equeue(e.layer,e.priority,e.id+"_angle",()=>{s.style.transform=`translate(${Math.round(T)}px, ${Math.round(se)}px)`,n.style.transform=`scale(${qs}) rotate(${Vs}deg) skew(${br}deg, ${br}deg)`})}function Fs(T){if(R(D)==!1){let se=Ge.getOffsets(i,o,T);W.set(Math.round(se.offsetX),{duration:0}),nt.set(Math.round(se.offsetY),{duration:0}),yr(W.value,nt.value),C=T,P(D,!0)}else if(T!=C){let se=Math.abs(T-C),it=se<180?se:360-se,Ue=Math.log(it)*75,Ce=Ge.getOffsets(i,o,T);W.set(Math.round(Ce.offsetX),{duration:Ue}),nt.set(Math.round(Ce.offsetY),{duration:Ue}),C=T}}function zs(){return Ge.getOffsets(i,o,C)}var at=ua();let _r;var wr=Zt(at);Ae(wr,T=>n=T,()=>n);var At=yn(wr,2),kr=Zt(At);return Ae(kr,T=>a=T,()=>a),Ae(At,T=>s=T,()=>s),Ae(at,T=>t=T,()=>t),gs(T=>{_r=Ms(at,1,"anchor svelte-j5igi2",null,_r,T),_t(At,`margin: ${e.margin}px;`),_t(kr,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)},[()=>({displayed:R(u)})]),As(r,at),dr({getBody:l,setDisplayed:d,getDisplayed:h,setCollapsed:v,getCollapsed:x,getExpanded:M,setAngle:Fs,getOffsets:zs})}var Me;(r=>{function e(o,l,u){return{x:s(l)*u,y:n(o)*u}}r.project=e;function t(o,l,u){return{lat:i(l/u),lng:a(o/u)}}r.unproject=t;function s(o){return(180+o)/360}function n(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function a(o){return o*360-180}function i(o){return 360/Math.PI*Math.atan(Math.exp((180-o*360)*Math.PI/180))-90}})(Me||(Me={}));class Is{constructor(e,t,s,n,a){f(this,"swLat");f(this,"swLng");f(this,"neLat");f(this,"neLng");f(this,"contains",(e,t)=>this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=t&&t<=this.neLng:t<=this.neLng||this.swLng<=t:!1);const i=s*Math.pow(2,t),o=Me.project(e.sw.lat,e.sw.lng,i),l=Me.project(e.ne.lat,e.ne.lng,i),u=o.x-n,d=o.y+a,h=l.x+n,p=l.y-a,v=Me.unproject(u,d,i),x=Me.unproject(h,p,i);this.swLat=v.lat,this.swLng=v.lng,this.neLat=x.lat,this.neLng=x.lng}}var S;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(S||(S={}));var jr;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(jr||(jr={}));const g=S.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ue=r=>{switch(typeof r){case"undefined":return g.undefined;case"string":return g.string;case"number":return Number.isNaN(r)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":return Array.isArray(r)?g.array:r===null?g.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?g.promise:typeof Map<"u"&&r instanceof Map?g.map:typeof Set<"u"&&r instanceof Set?g.set:typeof Date<"u"&&r instanceof Date?g.date:g.object;default:return g.unknown}},c=S.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 G extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};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(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(i))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return n(this),s}static assert(e){if(!(e instanceof G))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,S.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}G.create=r=>new G(r);const Ke=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===g.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,S.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${S.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${S.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${S.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:S.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="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 c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,S.assertNever(r)}return{message:t}};let da=Ke;function Bt(){return da}const Ut=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const l=s.filter(u=>!!u).slice().reverse();for(const u of l)o=u(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function m(r,e){const t=Bt(),s=Ut({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===Ke?void 0:Ke].filter(n=>!!n)});r.common.issues.push(s)}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 s=[];for(const n of t){if(n.status==="aborted")return _;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return q.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return _;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const _=Object.freeze({status:"aborted"}),Xe=r=>({status:"dirty",value:r}),V=r=>({status:"valid",value:r}),Fr=r=>r.status==="aborted",zr=r=>r.status==="dirty",Pe=r=>r.status==="valid",wt=r=>typeof Promise<"u"&&r instanceof Promise;var y;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(y||(y={}));class pe{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Vr=(r,e)=>{if(Pe(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 G(r.common.issues);return this._error=t,this._error}}};function k(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:l}=r;return i.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??s??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:n}}class E{get description(){return this._def.description}_getType(e){return ue(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ue(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:ue(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 s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={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:ue(e)},n=this._parseSync({data:e,path:s.path,parent:s});return Vr(s,n)}"~validate"(e){var s,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ue(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return Pe(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>Pe(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={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:ue(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(wt(n)?n:Promise.resolve(n));return Vr(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new je({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 he.create(this,this._def)}nullable(){return Fe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return te.create(this)}promise(){return rt.create(this,this._def)}or(e){return xt.create([this,e],this._def)}and(e){return bt.create(this,e,this._def)}transform(e){return new je({...k(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Xt({...k(this._def),innerType:this,defaultValue:t,typeName:w.ZodDefault})}brand(){return new Ra({typeName:w.ZodBranded,type:this,...k(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Ht({...k(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 Gt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ca=/^c[^\s-]{8,}$/i,fa=/^[0-9a-z]+$/,ha=/^[0-9A-HJKMNP-TV-Z]{26}$/i,pa=/^[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,ma=/^[a-z0-9_-]{21}$/i,va=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ga=/^[-+]?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)?)??$/,ya=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_a="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Lt;const wa=/^(?:(?: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])$/,ka=/^(?:(?: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])$/,xa=/^(([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]))$/,ba=/^(([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])$/,Ea=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ca=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Rs="((\\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])))",Sa=new RegExp(`^${Rs}$`);function Ls(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 Ta(r){return new RegExp(`^${Ls(r)}$`)}function Aa(r){let e=`${Rs}T${Ls(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 Ma(r,e){return!!((e==="v4"||!e)&&wa.test(r)||(e==="v6"||!e)&&xa.test(r))}function Oa(r,e){if(!va.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Na(r,e){return!!((e==="v4"||!e)&&ka.test(r)||(e==="v6"||!e)&&ba.test(r))}class fe extends E{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){const a=this._getOrReturnCtx(e);return m(a,{code:c.invalid_type,expected:g.string,received:a.parsedType}),_}const s=new q;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),m(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),m(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?m(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&m(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ya.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Lt||(Lt=new RegExp(_a,"u")),Lt.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")pa.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")ma.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")ca.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")fa.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")ha.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),m(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),m(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),m(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),m(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?Aa(a).test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?Sa.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?Ta(a).test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?ga.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Ma(e.data,a.version)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?Oa(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"jwt",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?Na(e.data,a.version)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"cidr",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?Ea.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?Ca.test(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{validation:"base64url",code:c.invalid_string,message:a.message}),s.dirty()):S.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...y.errToObj(s)})}_addCheck(e){return new fe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...y.errToObj(e)})}url(e){return this._addCheck({kind:"url",...y.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...y.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...y.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...y.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...y.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...y.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...y.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...y.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...y.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...y.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...y.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...y.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,...y.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,...y.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...y.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...y.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...y.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...y.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...y.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...y.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...y.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...y.errToObj(t)})}nonempty(e){return this.min(1,y.errToObj(e))}trim(){return new fe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fe({...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}}fe.create=r=>new fe({checks:[],typeName:w.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...k(r)});function Ia(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=Number.parseInt(r.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class De extends E{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)!==g.number){const a=this._getOrReturnCtx(e);return m(a,{code:c.invalid_type,expected:g.number,received:a.parsedType}),_}let s;const n=new q;for(const a of this._def.checks)a.kind==="int"?S.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),m(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),m(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Ia(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),m(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{code:c.not_finite,message:a.message}),n.dirty()):S.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,y.toString(t))}gt(e,t){return this.setLimit("min",e,!1,y.toString(t))}lte(e,t){return this.setLimit("max",e,!0,y.toString(t))}lt(e,t){return this.setLimit("max",e,!1,y.toString(t))}setLimit(e,t,s,n){return new De({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:y.toString(n)}]})}_addCheck(e){return new De({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:y.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:y.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.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"&&S.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}De.create=r=>new De({checks:[],typeName:w.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...k(r)});class et extends E{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)!==g.bigint)return this._getInvalidInput(e);let s;const n=new q;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),m(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),m(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),m(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):S.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return m(t,{code:c.invalid_type,expected:g.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,y.toString(t))}gt(e,t){return this.setLimit("min",e,!1,y.toString(t))}lte(e,t){return this.setLimit("max",e,!0,y.toString(t))}lt(e,t){return this.setLimit("max",e,!1,y.toString(t))}setLimit(e,t,s,n){return new et({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:y.toString(n)}]})}_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:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:y.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,...k(r)});class $t extends E{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){const s=this._getOrReturnCtx(e);return m(s,{code:c.invalid_type,expected:g.boolean,received:s.parsedType}),_}return V(e.data)}}$t.create=r=>new $t({typeName:w.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...k(r)});class kt extends E{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){const a=this._getOrReturnCtx(e);return m(a,{code:c.invalid_type,expected:g.date,received:a.parsedType}),_}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return m(a,{code:c.invalid_date}),_}const s=new q;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),m(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),m(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):S.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new kt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:y.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:y.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}}kt.create=r=>new kt({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:w.ZodDate,...k(r)});class Br extends E{_parse(e){if(this._getType(e)!==g.symbol){const s=this._getOrReturnCtx(e);return m(s,{code:c.invalid_type,expected:g.symbol,received:s.parsedType}),_}return V(e.data)}}Br.create=r=>new Br({typeName:w.ZodSymbol,...k(r)});class Ur extends E{_parse(e){if(this._getType(e)!==g.undefined){const s=this._getOrReturnCtx(e);return m(s,{code:c.invalid_type,expected:g.undefined,received:s.parsedType}),_}return V(e.data)}}Ur.create=r=>new Ur({typeName:w.ZodUndefined,...k(r)});class $r extends E{_parse(e){if(this._getType(e)!==g.null){const s=this._getOrReturnCtx(e);return m(s,{code:c.invalid_type,expected:g.null,received:s.parsedType}),_}return V(e.data)}}$r.create=r=>new $r({typeName:w.ZodNull,...k(r)});class qt extends E{constructor(){super(...arguments),this._any=!0}_parse(e){return V(e.data)}}qt.create=r=>new qt({typeName:w.ZodAny,...k(r)});class Ie extends E{constructor(){super(...arguments),this._unknown=!0}_parse(e){return V(e.data)}}Ie.create=r=>new Ie({typeName:w.ZodUnknown,...k(r)});class me extends E{_parse(e){const t=this._getOrReturnCtx(e);return m(t,{code:c.invalid_type,expected:g.never,received:t.parsedType}),_}}me.create=r=>new me({typeName:w.ZodNever,...k(r)});class Yt extends E{_parse(e){if(this._getType(e)!==g.undefined){const s=this._getOrReturnCtx(e);return m(s,{code:c.invalid_type,expected:g.void,received:s.parsedType}),_}return V(e.data)}}Yt.create=r=>new Yt({typeName:w.ZodVoid,...k(r)});class te extends E{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==g.array)return m(t,{code:c.invalid_type,expected:g.array,received:t.parsedType}),_;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(m(t,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(m(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(m(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new pe(t,i,t.path,o)))).then(i=>q.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new pe(t,i,t.path,o)));return q.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new te({...this._def,minLength:{value:e,message:y.toString(t)}})}max(e,t){return new te({...this._def,maxLength:{value:e,message:y.toString(t)}})}length(e,t){return new te({...this._def,exactLength:{value:e,message:y.toString(t)}})}nonempty(e){return this.min(1,e)}}te.create=(r,e)=>new te({type:r,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...k(e)});function Te(r){if(r instanceof L){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=he.create(Te(s))}return new L({...r._def,shape:()=>e})}else return r instanceof te?new te({...r._def,type:Te(r.element)}):r instanceof he?he.create(Te(r.unwrap())):r instanceof Fe?Fe.create(Te(r.unwrap())):r instanceof le?le.create(r.items.map(e=>Te(e))):r}class L extends E{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=S.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==g.object){const u=this._getOrReturnCtx(e);return m(u,{code:c.invalid_type,expected:g.object,received:u.parsedType}),_}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof me&&this._def.unknownKeys==="strip"))for(const u in n.data)i.includes(u)||o.push(u);const l=[];for(const u of i){const d=a[u],h=n.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new pe(n,h,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof me){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)l.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")o.length>0&&(m(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const h=n.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new pe(n,h,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const h=await d.key,p=await d.value;u.push({key:h,value:p,alwaysSet:d.alwaysSet})}return u}).then(u=>q.mergeObjectSync(s,u)):q.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(e){return y.errToObj,new L({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,s).message)??s.defaultError;return t.code==="unrecognized_keys"?{message:y.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new L({...this._def,unknownKeys:"strip"})}passthrough(){return new L({...this._def,unknownKeys:"passthrough"})}extend(e){return new L({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new L({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 L({...this._def,catchall:e})}pick(e){const t={};for(const s of S.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new L({...this._def,shape:()=>t})}omit(e){const t={};for(const s of S.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new L({...this._def,shape:()=>t})}deepPartial(){return Te(this)}partial(e){const t={};for(const s of S.objectKeys(this.shape)){const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new L({...this._def,shape:()=>t})}required(e){const t={};for(const s of S.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof he;)a=a._def.innerType;t[s]=a}return new L({...this._def,shape:()=>t})}keyof(){return Ps(S.objectKeys(this.shape))}}L.create=(r,e)=>new L({shape:()=>r,unknownKeys:"strip",catchall:me.create(),typeName:w.ZodObject,...k(e)});L.strictCreate=(r,e)=>new L({shape:()=>r,unknownKeys:"strict",catchall:me.create(),typeName:w.ZodObject,...k(e)});L.lazycreate=(r,e)=>new L({shape:r,unknownKeys:"strip",catchall:me.create(),typeName:w.ZodObject,...k(e)});class xt extends E{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new G(o.ctx.common.issues));return m(t,{code:c.invalid_union,unionErrors:i}),_}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const l of s){const u={...t,common:{...t.common,issues:[]},parent:null},d=l._parseSync({data:t.data,path:t.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(l=>new G(l));return m(t,{code:c.invalid_union,unionErrors:o}),_}}get options(){return this._def.options}}xt.create=(r,e)=>new xt({options:r,typeName:w.ZodUnion,...k(e)});function Wt(r,e){const t=ue(r),s=ue(e);if(r===e)return{valid:!0,data:r};if(t===g.object&&s===g.object){const n=S.objectKeys(e),a=S.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const l=Wt(r[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(t===g.array&&s===g.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],l=Wt(i,o);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return t===g.date&&s===g.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class bt extends E{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(Fr(a)||Fr(i))return _;const o=Wt(a.value,i.value);return o.valid?((zr(a)||zr(i))&&t.dirty(),{status:t.value,value:o.data}):(m(s,{code:c.invalid_intersection_types}),_)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}bt.create=(r,e,t)=>new bt({left:r,right:e,typeName:w.ZodIntersection,...k(t)});class le extends E{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==g.array)return m(s,{code:c.invalid_type,expected:g.array,received:s.parsedType}),_;if(s.data.length<this._def.items.length)return m(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&s.data.length>this._def.items.length&&(m(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new pe(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>q.mergeArray(t,i)):q.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new le({...this._def,rest:e})}}le.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new le({items:r,typeName:w.ZodTuple,rest:null,...k(e)})};class qr extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==g.map)return m(s,{code:c.invalid_type,expected:g.map,received:s.parsedType}),_;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,l],u)=>({key:n._parse(new pe(s,o,s.path,[u,"key"])),value:a._parse(new pe(s,l,s.path,[u,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return _;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of i){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return _;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}}}}qr.create=(r,e,t)=>new qr({valueType:e,keyType:r,typeName:w.ZodMap,...k(t)});class tt extends E{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==g.set)return m(s,{code:c.invalid_type,expected:g.set,received:s.parsedType}),_;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(m(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(m(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(l){const u=new Set;for(const d of l){if(d.status==="aborted")return _;d.status==="dirty"&&t.dirty(),u.add(d.value)}return{status:t.value,value:u}}const o=[...s.data.values()].map((l,u)=>a._parse(new pe(s,l,s.path,u)));return s.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,t){return new tt({...this._def,minSize:{value:e,message:y.toString(t)}})}max(e,t){return new tt({...this._def,maxSize:{value:e,message:y.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}tt.create=(r,e)=>new tt({valueType:r,minSize:null,maxSize:null,typeName:w.ZodSet,...k(e)});class Je extends E{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==g.function)return m(t,{code:c.invalid_type,expected:g.function,received:t.parsedType}),_;function s(o,l){return Ut({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Bt(),Ke].filter(u=>!!u),issueData:{code:c.invalid_arguments,argumentsError:l}})}function n(o,l){return Ut({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Bt(),Ke].filter(u=>!!u),issueData:{code:c.invalid_return_type,returnTypeError:l}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof rt){const o=this;return V(async function(...l){const u=new G([]),d=await o._def.args.parseAsync(l,a).catch(v=>{throw u.addIssue(s(l,v)),u}),h=await Reflect.apply(i,this,d);return await o._def.returns._def.type.parseAsync(h,a).catch(v=>{throw u.addIssue(n(h,v)),u})})}else{const o=this;return V(function(...l){const u=o._def.args.safeParse(l,a);if(!u.success)throw new G([s(l,u.error)]);const d=Reflect.apply(i,this,u.data),h=o._def.returns.safeParse(d,a);if(!h.success)throw new G([n(d,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Je({...this._def,args:le.create(e).rest(Ie.create())})}returns(e){return new Je({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new Je({args:e||le.create([]).rest(Ie.create()),returns:t||Ie.create(),typeName:w.ZodFunction,...k(s)})}}class Yr extends E{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})}}Yr.create=(r,e)=>new Yr({getter:r,typeName:w.ZodLazy,...k(e)});class Wr extends E{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return m(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}Wr.create=(r,e)=>new Wr({value:r,typeName:w.ZodLiteral,...k(e)});function Ps(r,e){return new Ze({values:r,typeName:w.ZodEnum,...k(e)})}class Ze extends E{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return m(t,{expected:S.joinValues(s),received:t.parsedType,code:c.invalid_type}),_}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return m(t,{received:t.data,code:c.invalid_enum_value,options:s}),_}return V(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 Ze.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ze.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}Ze.create=Ps;class Xr extends E{_parse(e){const t=S.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==g.string&&s.parsedType!==g.number){const n=S.objectValues(t);return m(s,{expected:S.joinValues(n),received:s.parsedType,code:c.invalid_type}),_}if(this._cache||(this._cache=new Set(S.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=S.objectValues(t);return m(s,{received:s.data,code:c.invalid_enum_value,options:n}),_}return V(e.data)}get enum(){return this._def.values}}Xr.create=(r,e)=>new Xr({values:r,typeName:w.ZodNativeEnum,...k(e)});class rt extends E{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==g.promise&&t.common.async===!1)return m(t,{code:c.invalid_type,expected:g.promise,received:t.parsedType}),_;const s=t.parsedType===g.promise?t.data:Promise.resolve(t.data);return V(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}rt.create=(r,e)=>new rt({type:r,typeName:w.ZodPromise,...k(e)});class je extends E{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:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{m(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return _;const l=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return l.status==="aborted"?_:l.status==="dirty"||t.value==="dirty"?Xe(l.value):l});{if(t.value==="aborted")return _;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?_:o.status==="dirty"||t.value==="dirty"?Xe(o.value):o}}if(n.type==="refinement"){const i=o=>{const l=n.refinement(o,a);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Pe(i))return _;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>Pe(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):_);S.assertNever(n)}}je.create=(r,e,t)=>new je({schema:r,typeName:w.ZodEffects,effect:e,...k(t)});je.createWithPreprocess=(r,e,t)=>new je({schema:e,effect:{type:"preprocess",transform:r},typeName:w.ZodEffects,...k(t)});class he extends E{_parse(e){return this._getType(e)===g.undefined?V(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}he.create=(r,e)=>new he({innerType:r,typeName:w.ZodOptional,...k(e)});class Fe extends E{_parse(e){return this._getType(e)===g.null?V(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Fe.create=(r,e)=>new Fe({innerType:r,typeName:w.ZodNullable,...k(e)});class Xt extends E{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===g.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Xt.create=(r,e)=>new Xt({innerType:r,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});class Ht extends E{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return wt(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new G(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new G(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Ht.create=(r,e)=>new Ht({innerType:r,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});class Hr extends E{_parse(e){if(this._getType(e)!==g.nan){const s=this._getOrReturnCtx(e);return m(s,{code:c.invalid_type,expected:g.nan,received:s.parsedType}),_}return{status:"valid",value:e.data}}}Hr.create=r=>new Hr({typeName:w.ZodNaN,...k(r)});class Ra extends E{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class pr extends E{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?_:a.status==="dirty"?(t.dirty(),Xe(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?_:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new pr({in:e,out:t,typeName:w.ZodPipeline})}}class Gt extends E{_parse(e){const t=this._def.innerType._parse(e),s=n=>(Pe(n)&&(n.value=Object.freeze(n.value)),n);return wt(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}Gt.create=(r,e)=>new Gt({innerType:r,typeName:w.ZodReadonly,...k(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 ze=fe.create,b=De.create,Ds=$t.create,Zs=qt.create;Ie.create;me.create;const ct=Yt.create,mr=te.create,I=L.create;xt.create;bt.create;const Gr=le.create,ee=Je.create;Ze.create;const La=rt.create;he.create;Fe.create;I({pin:I({fade:Ds().optional(),maxCount:b().optional(),maxZoom:b().optional()}).optional(),animation:I({queue:I({limit:b().optional()}).optional()}).optional(),states:I({api:ze().optional()}).optional(),log:I({api:ze().optional()}).optional()});const Jt=b().min(-90).max(90),Qt=b().min(-180).max(180),Pa=I({sw:I({lat:Jt,lng:Qt}),ne:I({lat:Jt,lng:Qt})}),Kt=Zs().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),js=I({mapSize:b(),zoomMin:b(),zoomMax:b(),zoomScale:b()}),Da=I({instance:Zs(),inserted:ee().returns(Ds()),insert:ee().returns(ct()),remove:ee().returns(ct()),update:ee().args(b()).returns(ct())}),Za=I({parameters:js,getContainer:ee().args().returns(Kt),getZoom:ee().args().returns(b()),getBounds:ee().args().returns(Pa),panBy:ee().args(b(),b()).returns(ct()),createMarker:ee().args(Kt,Jt,Qt,b()).returns(Da)}),Pt=ee().args(ze()).returns(La(Kt)),ja=I({id:ze().min(1),rank:b(),lat:b().min(-90).max(90),lng:b().min(-180).max(180),tooltip:I({style:I({width:b(),height:b(),margin:b(),radius:b()}).refine(r=>Math.min(r.width,r.height)/r.margin>=5,"Tooltip width and height must be at least 5 times the margin"),body:Pt}),pin:I({style:I({width:b(),height:b(),radius:b()}),body:Pt}).optional(),popup:I({style:I({width:b(),height:b(),radius:b(),margin:b()}),body:Pt}).optional()}),Fa=mr(ja);Gr([b(),mr(Gr([b(),b()]))]);const za=I({id:ze(),rank:b(),lat:b(),lng:b(),width:b(),height:b(),margin:b()});I({key:ze(),parameters:js,input:mr(za)});var ke;(r=>{r.COUNT=12,r.DEFAULT=270,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330]})(ke||(ke={}));const Jr="https://arenarium.dev/api/public/v1/tooltip/states",Va="https://arenarium.dev/api/public/v1/log";class Ba{constructor(e,t,s){f(this,"key");f(this,"provider");f(this,"apiStatesUrl",Jr);f(this,"apiLogUrl",Va);f(this,"markerDataArray",new Array);f(this,"markerDataMap",new Map);f(this,"markerDataUpdating",!1);f(this,"markerPinProcessor");f(this,"markerTooltipProcessor");f(this,"markerPopupProcessor");Za.parse(t),this.key=e,this.provider=t,this.markerPinProcessor=new tr(t),this.markerTooltipProcessor=new Ua(t),this.markerPopupProcessor=new $a(t),this.configuration=s}set configuration(e){var t,s,n;this.apiStatesUrl=((t=e==null?void 0:e.states)==null?void 0:t.api)??Jr,this.markerPinProcessor.setConfiguration(e),de.setLimit(((n=(s=e==null?void 0:e.animation)==null?void 0:s.queue)==null?void 0:n.limit)??8*navigator.hardwareConcurrency)}async updateMarkers(e){await Fa.parseAsync(e);try{if(e.length>1){const t={key:this.key,parameters:this.provider.parameters,input:e.map(a=>({id:a.id,rank:a.rank,lat:a.lat,lng:a.lng,width:a.tooltip.style.width,height:a.tooltip.style.height,margin:a.tooltip.style.margin}))},s=await fetch(this.apiStatesUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok||!s.body)throw new Error("Failed to get marker states: "+s.statusText);const n=await s.json();this.updateMarkerData(e,n)}else{const t=[[0,[[0,ke.DEGREES.indexOf(ke.DEFAULT)]]]];this.updateMarkerData(e,t)}this.processMarkerDataCallback()}catch(t){throw console.error(t),this.log("[Error] Failed to update markers",{message:t.message,stack:t.stack}),t}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(e),this.log("[Error] Failed to remove markers",{message:e.message,stack:e.stack}),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),this.log("[Error] Failed to show popup",{message:t.message,stack:t.stack});for(const s of this.markerDataArray)this.markerPopupProcessor.hide(s);throw 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),this.log("[Error] Failed to hide popup",{message:t.message,stack:t.stack});for(const s of this.markerDataArray)this.markerPopupProcessor.hide(s);throw t}}updateMarkerData(e,t){try{this.markerDataUpdating=!0;const s=new Map(e.map((a,i)=>[a.id,new Qr(this.provider,a,t[i])])),n=Array.from(this.markerDataArray);for(const a of n)s.has(a.marker.id)==!1&&(a.remove(),this.markerDataMap.delete(a.marker.id),this.markerDataArray.splice(this.markerDataArray.indexOf(a),1));for(let a=0;a<e.length;a++){const i=e[a],o=t[a],l=this.markerDataMap.get(i.id);if(l)l.update(o);else{const u=new Qr(this.provider,i,o);u.create(),this.markerDataMap.set(i.id,u),this.markerDataArray.push(u)}}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))}catch(s){throw console.error(s),this.markerDataArray.forEach(n=>n.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),s}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.clear(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e}finally{this.markerDataUpdating=!1}}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e),this.log("[Error] Failed to process markers",{message:e.message,stack:e.stack})}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.provider.getBounds(),t=this.provider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,t),this.markerPinProcessor.process(e,t)}async log(e,t){try{const s={title:e,content:t};await fetch(this.apiLogUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch(s){console.error(s)}}}class Qr{constructor(e,t,s){f(this,"marker");f(this,"zoom");f(this,"pin");f(this,"tooltip");this.marker=t,this.zoom=s[0],this.pin=new er(e,t,s),this.tooltip=new rr(e,t,s)}create(){this.pin.create(),this.tooltip.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove()}}class vr{constructor(e,t){f(this,"provider");f(this,"id");f(this,"lat");f(this,"lng");f(this,"shown");f(this,"element");f(this,"component");f(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,s=this.component;if(t==null||s==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,t;(e=this.marker)==null||e.remove(),(t=this.element)==null||t.remove()}}const Oe=class Oe extends vr{constructor(t,s,n){var a,i,o,l;super(t,s);f(this,"width");f(this,"height");f(this,"radius");f(this,"zoom");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.width=((a=s.pin)==null?void 0:a.style.width)??Oe.DEFAULT_SIZE,this.height=((i=s.pin)==null?void 0:i.style.height)??Oe.DEFAULT_SIZE,this.radius=((o=s.pin)==null?void 0:o.style.radius)??Oe.DEFAULT_SIZE,this.zoom=n[0],this.bodyCallback=(l=s.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=hr(la,{target:this.element,props:{id:this.id+"_pin",layer:aa,priority:this.zoom*this.provider.parameters.zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(t){this.zoom=t[0],this.updateZIndex()}updateMap(t){var s;super.updateMap(t),(s=this.component)==null||s.setDisplayed(t)}updateState(t){if(this.component==null)throw new Error("Failed to update pin state");this.component.setScale(this.getScale(t))}updateBody(){var s;if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const t=(s=this.component)==null?void 0:s.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>t.appendChild(n)).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(t){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setScale(t?0:1)}getScale(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}getZindex(){return Math.round((this.provider.parameters.zoomMax-this.zoom)*this.provider.parameters.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};f(Oe,"DEFAULT_SIZE",16);let er=Oe;const Ne=class Ne{constructor(e){f(this,"provider");f(this,"pinElements",new Array);f(this,"pinMaxWidth",0);f(this,"pinMaxHeight",0);f(this,"pinFade",!1);f(this,"pinMaxCount",0);f(this,"pinMaxZoomDelta",0);this.provider=e}setConfiguration(e){var t,s,n;this.pinFade=((t=e==null?void 0:e.pin)==null?void 0:t.fade)??!0,this.pinMaxCount=((s=e==null?void 0:e.pin)==null?void 0:s.maxCount)??Math.max(Ne.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((n=e==null?void 0:e.pin)==null?void 0:n.maxZoom)??Ne.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((t,s)=>Math.max(t,s.width),0),this.pinMaxHeight=e.reduce((t,s)=>Math.max(t,s.height),0)}removeElements(){this.pinElements.forEach(e=>e.remove()),this.pinElements.length=0}process(e,t){const s=this.provider.parameters.mapSize,n=new Is(e,t,s,this.pinMaxWidth*2,this.pinMaxHeight*2);let a=0;for(const i of this.pinElements)n.contains(i.lat,i.lng)?i.shown&&t<=i.zoom&&i.zoom<=t+this.pinMaxZoomDelta?(a<this.pinMaxCount&&(this.pinFade==!0?i.updateState(t):i.setCollapsed(!1),i.updateMap(!0),i.isBodyLoaded()==!1&&i.updateBody()),a++):(i.setCollapsed(!0),i.isCollapsed()&&i.updateMap(!1)):i.updateMap(!1)}};f(Ne,"MAP_PINS_MAX_ZOOM",2),f(Ne,"MAP_PINS_MAX_COUNT",128);let tr=Ne;const Et=class Et extends vr{constructor(t,s,n){super(t,s);f(this,"width");f(this,"height");f(this,"margin");f(this,"radius");f(this,"zoom");f(this,"angle");f(this,"states");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.width=s.tooltip.style.width,this.height=s.tooltip.style.height,this.margin=s.tooltip.style.margin,this.radius=s.tooltip.style.radius,this.zoom=n[0],this.angle=ke.DEFAULT,this.states=n[1].map(a=>[a[0],ke.DEGREES[a[1]]]),this.bodyCallback=s.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=hr(Ns,{target:this.element,props:{id:this.id+"_tooltip",layer:na,priority:this.zoom*this.provider.parameters.zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(t){this.zoom=t[0],this.states=t[1].map(s=>[s[0],ke.DEGREES[s[1]]]),this.updateZIndex()}updateMap(t){var s;super.updateMap(t),(s=this.component)==null||s.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 s;if(this.bodyLoaded||this.bodyLoading)return;const t=(s=this.component)==null?void 0:s.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>t.appendChild(n)).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(t){const s=this.states.findLast(n=>n[0]<=t);if(!s)throw new Error("Angle not found");return s[1]}getZindex(){return Math.round((this.provider.parameters.zoomMax-this.zoom)*this.provider.parameters.zoomScale)+Et.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}};f(Et,"Z_INDEX_OFFSET",1e6);let rr=Et;class Ua{constructor(e){f(this,"provider");f(this,"tooltipElements",new Array);f(this,"tooltipMaxWidth",0);f(this,"tooltipMaxHeight",0);this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((t,s)=>Math.max(t,s.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((t,s)=>Math.max(t,s.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.remove()),this.tooltipElements.length=0}process(e,t){const s=this.provider.parameters.mapSize,n=new Is(e,t,s,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const a of this.tooltipElements)n.contains(a.lat,a.lng)?a.shown&&a.zoom<=t?(a.updateState(t),a.setCollapsed(!1),a.updateMap(!0),a.isCollapsed()==!1&&a.isBodyLoaded()==!1&&a.updateBody()):(a.setCollapsed(!0),a.isCollapsed()&&a.updateMap(!1)):a.updateMap(!1)}}const Ct=class Ct extends vr{constructor(t,s){if(s.popup==null)throw new Error("Failed to create popup");super(t,s);f(this,"width");f(this,"height");f(this,"margin");f(this,"radius");f(this,"bodyLoading",!1);f(this,"bodyLoaded",!1);f(this,"bodyCallback");this.shown=!1,this.width=s.popup.style.width,this.height=s.popup.style.height,this.margin=s.popup.style.margin,this.radius=s.popup.style.radius,this.bodyCallback=s.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=hr(Ns,{target:this.element,props:{id:this.id+"_popup",layer:sa,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(t){var s;super.updateMap(t),(s=this.component)==null||s.setDisplayed(t)}updateBody(){var s;if(this.bodyLoaded||this.bodyLoading)return;const t=(s=this.component)==null?void 0:s.getBody();t!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>t.appendChild(n)).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return Ct.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)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};f(Ct,"Z_INDEX_OFFSET",2e6);let sr=Ct;class $a{constructor(e){f(this,"provider");f(this,"popupElements",new Map);f(this,"popupPositioned",new Map);this.provider=e}show(e){e.pin.shown=!1,e.tooltip.shown=!1;const t=new sr(this.provider,e.marker);this.popupElements.set(e.marker.id,t),this.popupPositioned.set(e.marker.id,!1),t.create(),t.setAngle(e.tooltip.angle),t.shown=!0}hide(e){e.pin.shown=!0,e.tooltip.shown=!0;const t=this.popupElements.get(e.marker.id);t!=null&&(t.shown=!1)}clear(){this.popupElements.values().forEach(e=>e.remove()),this.popupElements.clear(),this.popupPositioned.clear()}process(){var e,t;for(const s of this.popupElements.values())if(s.shown){if(s.setCollapsed(!1),s.updateMap(!0),s.isExpanded()&&s.isBodyLoaded()==!1&&s.updateBody(),s.isCollapsed()==!1&&this.popupPositioned.get(s.id)==!1){const n=(e=s.component)==null?void 0:e.getBody();if(n==null)continue;const a=(t=s.component)==null?void 0:t.getOffsets();if(a==null)continue;const i=n.getBoundingClientRect();if(i.x==0&&i.y==0&&i.width==0&&i.height==0)continue;const o=i.x+i.width/2,l=i.y+i.height/2,u=o+a.offsetX,d=l+a.offsetY,h=u+s.width,p=d+s.height,v=this.provider.getContainer().getBoundingClientRect(),x=u-v.left,M=v.right-h,O=d-v.top,Y=v.bottom-p,C=Math.min(s.width,s.height)/4,D=x<0?x-C:M<0?-M+C:0,W=O<0?O-C:Y<0?-Y+C:0;this.provider.panBy(D,W),this.popupPositioned.set(s.id,!0)}}else s.setCollapsed(!0),s.isCollapsed()&&(s.updateMap(!1),s.remove(),this.popupElements.delete(s.id),this.popupPositioned.delete(s.id))}}exports.MapManager=Ba;
|
|
1
|
+
"use strict";var Ss=Object.defineProperty;var an=r=>{throw TypeError(r)};var Cs=(r,e,t)=>e in r?Ss(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var h=(r,e,t)=>Cs(r,typeof e!="symbol"?e+"":e,t),fr=(r,e,t)=>e.has(r)||an("Cannot "+t);var T=(r,e,t)=>(fr(r,e,"read from private field"),t?t.call(r):e.get(r)),W=(r,e,t)=>e.has(r)?an("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),$=(r,e,t,n)=>(fr(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),Et=(r,e,t)=>(fr(r,e,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const on=!1;var Pn=Array.isArray,Ms=Array.prototype.indexOf,Ts=Array.from,yr=Object.defineProperty,Tt=Object.getOwnPropertyDescriptor,Os=Object.prototype,Ns=Array.prototype,Is=Object.getPrototypeOf,ln=Object.isExtensible;function Rs(r){for(var e=0;e<r.length;e++)r[e]()}function Ds(){var r,e,t=new Promise((n,s)=>{r=n,e=s});return{promise:t,resolve:r,reject:e}}const ie=2,Ur=4,Ln=8,ur=16,je=32,xt=64,Zn=128,se=256,Ht=512,X=1024,le=2048,He=4096,ft=8192,wt=16384,Wr=32768,Ps=65536,un=1<<17,Ls=1<<18,$r=1<<19,jn=1<<20,_r=1<<21,qr=1<<22,We=1<<23,qt=Symbol("$state"),Yr=new class extends Error{constructor(){super(...arguments);h(this,"name","StaleReactionError");h(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Zs(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function js(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function zs(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Fs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Bs(r){throw new Error("https://svelte.dev/e/effect_orphan")}function Vs(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Us(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ws(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function $s(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const qs=2,q=Symbol();function zn(r){return r===this.v}let Ys=!1,fe=null;function Gt(r){fe=r}function Xr(r,e=!1,t){fe={p:fe,c:null,e:null,s:r,x:null,l:null}}function Hr(r){var e=fe,t=e.e;if(t!==null){e.e=null;for(var n of t)es(n)}return r!==void 0&&(e.x=r),fe=e.p,r??{}}function Fn(){return!0}const Xs=new WeakMap;function Hs(r){var e=Z;if(e===null)return R.f|=We,r;if((e.f&Wr)===0){if((e.f&Zn)===0)throw!e.parent&&r instanceof Error&&Bn(r),r;e.b.error(r)}else Gr(r,e)}function Gr(r,e){for(;e!==null;){if((e.f&Zn)!==0)try{e.b.error(r);return}catch{}e=e.parent}throw r instanceof Error&&Bn(r),r}function Bn(r){const e=Xs.get(r);e&&(yr(r,"message",{value:e.message}),yr(r,"stack",{value:e.stack}))}let Jt=[];function Gs(){var r=Jt;Jt=[],Rs(r)}function Js(r){Jt.length===0&&queueMicrotask(Gs),Jt.push(r)}function Ks(){for(var r=Z.b;r!==null&&!r.has_pending_snippet();)r=r.parent;return r===null&&Zs(),r}function Qs(r){var e=ie|le,t=R!==null&&(R.f&ie)!==0?R:null;return Z===null||t!==null&&(t.f&se)!==0?e|=se:Z.f|=$r,{ctx:fe,deps:null,effects:null,equals:zn,f:e,fn:r,reactions:null,rv:0,v:q,wv:0,parent:t??Z,ac:null}}function ei(r,e){let t=Z;t===null&&js();var n=t.b,s=void 0,i=Yn(q),a=null,o=!R;return fi(()=>{try{var l=r()}catch(y){l=Promise.reject(y)}var u=()=>l;s=(a==null?void 0:a.then(u,u))??Promise.resolve(l),a=s;var c=de,d=n.pending;o&&(n.update_pending_count(1),d||c.increment());const p=(y,S=void 0)=>{a=null,d||c.activate(),S?S!==Yr&&(i.f|=We,kr(i,S)):((i.f&We)!==0&&(i.f^=We),kr(i,y)),o&&(n.update_pending_count(-1),d||c.decrement()),Wn()};if(s.then(p,y=>p(null,y||"unknown")),c)return()=>{queueMicrotask(()=>c.neuter())}}),new Promise(l=>{function u(c){function d(){c===s?l(i):u(s)}c.then(d,d)}u(s)})}function Vn(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Xe(e[t])}}function ti(r){for(var e=r.parent;e!==null;){if((e.f&ie)===0)return e;e=e.parent}return null}function Jr(r){var e,t=Z;ht(ti(r));try{Vn(r),e=us(r)}finally{ht(t)}return e}function Un(r){var e=Jr(r);if(r.equals(e)||(r.v=e,r.wv=os()),!kt)if(Ne!==null)Ne.set(r,r.v);else{var t=(Ie||(r.f&se)!==0)&&r.deps!==null?He:X;G(r,t)}}function ri(r,e,t){const n=Qs;if(e.length===0){t(r.map(n));return}var s=de,i=Z,a=ni(),o=Ks();Promise.all(e.map(l=>ei(l))).then(l=>{s==null||s.activate(),a();try{t([...r.map(n),...l])}catch(u){(i.f&wt)===0&&Gr(u,i)}s==null||s.deactivate(),Wn()}).catch(l=>{o.error(l)})}function ni(){var r=Z,e=R,t=fe;return function(){ht(r),Pe(e),Gt(t)}}function Wn(){ht(null),Pe(null),Gt(null)}const Wt=new Set;let de=null,Ne=null;let St=[],Kt=null,xr=!1;var jt,lt,ut,Te,zt,Ft,Be,ct,Oe,we,Ve,Ae,$n,qn,wr;const rn=class rn{constructor(){W(this,Ae);W(this,jt,new Map);W(this,lt,new Map);W(this,ut,new Set);W(this,Te,0);W(this,zt,null);W(this,Ft,!1);W(this,Be,[]);W(this,ct,[]);W(this,Oe,[]);W(this,we,[]);W(this,Ve,[]);h(this,"skipped_effects",new Set)}capture(e,t){T(this,lt).has(e)||T(this,lt).set(e,t),T(this,jt).set(e,e.v)}activate(){de=this}deactivate(){de=null}neuter(){$(this,Ft,!0)}flush(){St.length>0?this.flush_effects():Et(this,Ae,wr).call(this),de===this&&(T(this,Te)===0&&Wt.delete(this),de=null)}flush_effects(){var e=it;xr=!0;try{var t=0;for(fn(!0);St.length>0;)t++>1e3&&si(),Et(this,Ae,$n).call(this,St),qe.clear()}finally{xr=!1,fn(e),Kt=null}}increment(){$(this,Te,T(this,Te)+1)}decrement(){if($(this,Te,T(this,Te)-1),T(this,Te)===0){for(const e of T(this,Oe))G(e,le),$e(e);for(const e of T(this,we))G(e,le),$e(e);for(const e of T(this,Ve))G(e,le),$e(e);$(this,Oe,[]),$(this,we,[]),this.flush()}}add_callback(e){T(this,ut).add(e)}settled(){return(T(this,zt)??$(this,zt,Ds())).promise}static ensure(){if(de===null){const e=de=new rn;Wt.add(de),queueMicrotask(()=>{de===e&&e.flush()})}return de}};jt=new WeakMap,lt=new WeakMap,ut=new WeakMap,Te=new WeakMap,zt=new WeakMap,Ft=new WeakMap,Be=new WeakMap,ct=new WeakMap,Oe=new WeakMap,we=new WeakMap,Ve=new WeakMap,Ae=new WeakSet,$n=function(e){var i;St=[];var t=null;if(Wt.size>1){t=new Map,Ne=new Map;for(const[a,o]of T(this,jt))t.set(a,{v:a.v,wv:a.wv}),a.v=o;for(const a of Wt)if(a!==this)for(const[o,l]of T(a,lt))t.has(o)||(t.set(o,{v:o.v,wv:o.wv}),o.v=l)}for(const a of e)Et(this,Ae,qn).call(this,a);if(T(this,Be).length===0&&T(this,Te)===0){var n=T(this,Oe),s=T(this,we);$(this,Oe,[]),$(this,we,[]),$(this,Ve,[]),Et(this,Ae,wr).call(this),cn(n),cn(s),(i=T(this,zt))==null||i.resolve()}else{for(const a of T(this,Oe))G(a,X);for(const a of T(this,we))G(a,X);for(const a of T(this,Ve))G(a,X)}if(t){for(const[a,{v:o,wv:l}]of t)a.wv<=l&&(a.v=o);Ne=null}for(const a of T(this,Be))Ot(a);for(const a of T(this,ct))Ot(a);$(this,Be,[]),$(this,ct,[])},qn=function(e){var c;e.f^=X;for(var t=e.first;t!==null;){var n=t.f,s=(n&(je|xt))!==0,i=s&&(n&X)!==0,a=i||(n&ft)!==0||this.skipped_effects.has(t);if(!a&&t.fn!==null){if(s)t.f^=X;else if((n&Ur)!==0)T(this,we).push(t);else if(cr(t))if((n&qr)!==0){var o=(c=t.b)!=null&&c.pending?T(this,ct):T(this,Be);o.push(t)}else(t.f&ur)!==0&&T(this,Ve).push(t),Ot(t);var l=t.first;if(l!==null){t=l;continue}}var u=t.parent;for(t=t.next;t===null&&u!==null;)t=u.next,u=u.parent}},wr=function(){if(!T(this,Ft))for(const e of T(this,ut))e();T(this,ut).clear()};let Qt=rn;function si(){try{Vs()}catch(r){if(Kt!==null)Gr(r,Kt);else throw r}}function cn(r){var e=r.length;if(e!==0){for(var t=0;t<e;t++){var n=r[t];if((n.f&(wt|ft))===0&&cr(n)){var s=er;if(Ot(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?is(n):n.fn=null),er>s&&(n.f&jn)!==0)break}}for(;t<e;t+=1)$e(r[t])}}function $e(r){for(var e=Kt=r;e.parent!==null;){e=e.parent;var t=e.f;if(xr&&e===Z&&(t&ur)!==0)return;if((t&(xt|je))!==0){if((t&X)===0)return;e.f^=X}}St.push(e)}const qe=new Map;function Yn(r,e){var t={f:0,v:r,reactions:null,equals:zn,rv:0,wv:0};return t}function Q(r,e){const t=Yn(r);return yi(t),t}function Y(r,e,t=!1){R!==null&&(!me||(R.f&un)!==0)&&Fn()&&(R.f&(ie|ur|qr|un))!==0&&!(J!=null&&J.includes(r))&&$s();let n=t?Ct(e):e;return kr(r,n)}function kr(r,e){if(!r.equals(e)){var t=r.v;kt?qe.set(r,e):qe.set(r,t),r.v=e,Qt.ensure().capture(r,t),(r.f&ie)!==0&&((r.f&le)!==0&&Jr(r),G(r,(r.f&se)===0?X:He)),r.wv=os(),Xn(r,le),Z!==null&&(Z.f&X)!==0&&(Z.f&(je|xt))===0&&(oe===null?_i([r]):oe.push(r))}return e}function hr(r){Y(r,r.v+1)}function Xn(r,e){var t=r.reactions;if(t!==null)for(var n=t.length,s=0;s<n;s++){var i=t[s],a=i.f;(a&le)===0&&(G(i,e),(a&(X|se))!==0&&((a&ie)!==0?Xn(i,He):$e(i)))}}function Ct(r){if(typeof r!="object"||r===null||qt in r)return r;const e=Is(r);if(e!==Os&&e!==Ns)return r;var t=new Map,n=Pn(r),s=Q(0),i=Ye,a=o=>{if(Ye===i)return o();var l=R,u=Ye;Pe(null),pn(i);var c=o();return Pe(l),pn(u),c};return n&&t.set("length",Q(r.length)),new Proxy(r,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Us();var c=t.get(l);return c===void 0?c=a(()=>{var d=Q(u.value);return t.set(l,d),d}):Y(c,u.value,!0),!0},deleteProperty(o,l){var u=t.get(l);if(u===void 0){if(l in o){const p=a(()=>Q(q));t.set(l,p),hr(s)}}else{if(n&&typeof l=="string"){var c=t.get("length"),d=Number(l);Number.isInteger(d)&&d<c.v&&Y(c,d)}Y(u,q),hr(s)}return!0},get(o,l,u){var y;if(l===qt)return r;var c=t.get(l),d=l in o;if(c===void 0&&(!d||(y=Tt(o,l))!=null&&y.writable)&&(c=a(()=>{var S=Ct(d?o[l]:q),x=Q(S);return x}),t.set(l,c)),c!==void 0){var p=F(c);return p===q?void 0:p}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var c=t.get(l);c&&(u.value=F(c))}else if(u===void 0){var d=t.get(l),p=d==null?void 0:d.v;if(d!==void 0&&p!==q)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return u},has(o,l){var p;if(l===qt)return!0;var u=t.get(l),c=u!==void 0&&u.v!==q||Reflect.has(o,l);if(u!==void 0||Z!==null&&(!c||(p=Tt(o,l))!=null&&p.writable)){u===void 0&&(u=a(()=>{var y=c?Ct(o[l]):q,S=Q(y);return S}),t.set(l,u));var d=F(u);if(d===q)return!1}return c},set(o,l,u,c){var v;var d=t.get(l),p=l in o;if(n&&l==="length")for(var y=u;y<d.v;y+=1){var S=t.get(y+"");S!==void 0?Y(S,q):y in o&&(S=a(()=>Q(q)),t.set(y+"",S))}if(d===void 0)(!p||(v=Tt(o,l))!=null&&v.writable)&&(d=a(()=>Q(void 0)),Y(d,Ct(u)),t.set(l,d));else{p=d.v!==q;var x=a(()=>Ct(u));Y(d,x)}var f=Reflect.getOwnPropertyDescriptor(o,l);if(f!=null&&f.set&&f.set.call(c,u),!p){if(n&&typeof l=="string"){var _=t.get("length"),g=Number(l);Number.isInteger(g)&&g>=_.v&&Y(_,g+1)}hr(s)}return!0},ownKeys(o){F(s);var l=Reflect.ownKeys(o).filter(d=>{var p=t.get(d);return p===void 0||p.v!==q});for(var[u,c]of t)c.v!==q&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Ws()}})}var dn,Hn,Gn,Jn;function ii(){if(dn===void 0){dn=window,Hn=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;Gn=Tt(e,"firstChild").get,Jn=Tt(e,"nextSibling").get,ln(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),ln(t)&&(t.__t=void 0)}}function ai(r=""){return document.createTextNode(r)}function Kn(r){return Gn.call(r)}function Qn(r){return Jn.call(r)}function br(r,e){return Kn(r)}function oi(r,e=1,t=!1){let n=r;for(;e--;)n=Qn(n);return n}function li(r){Z===null&&R===null&&Bs(),R!==null&&(R.f&se)!==0&&Z===null&&Fs(),kt&&zs()}function ui(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Ge(r,e,t,n=!0){var s=Z;s!==null&&(s.f&ft)!==0&&(r|=ft);var i={ctx:fe,deps:null,nodes_start:null,nodes_end:null,f:r|le,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(t)try{Ot(i),i.f|=Wr}catch(l){throw Xe(i),l}else e!==null&&$e(i);var a=t&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&$r)===0;if(!a&&n&&(s!==null&&ui(i,s),R!==null&&(R.f&ie)!==0)){var o=R;(o.effects??(o.effects=[])).push(i)}return i}function xe(r){li();var e=Z.f,t=!R&&(e&je)!==0&&(e&Wr)===0;if(t){var n=fe;(n.e??(n.e=[])).push(r)}else return es(r)}function es(r){return Ge(Ur|jn,r,!1)}function ci(r){Qt.ensure();const e=Ge(xt,r,!0);return(t={})=>new Promise(n=>{t.outro?gi(e,()=>{Xe(e),n(void 0)}):(Xe(e),n(void 0))})}function di(r){return Ge(Ur,r,!1)}function fi(r){return Ge(qr|$r,r,!0)}function ts(r,e=0){return Ge(Ln|e,r,!0)}function rs(r,e=[],t=[]){ri(e,t,n=>{Ge(Ln,()=>r(...n.map(F)),!0)})}function hi(r,e=!0){return Ge(je,r,!0,e)}function ns(r){var e=r.teardown;if(e!==null){const t=kt,n=R;hn(!0),Pe(null);try{e.call(null)}finally{hn(t),Pe(n)}}}function ss(r,e=!1){var s;var t=r.first;for(r.first=r.last=null;t!==null;){(s=t.ac)==null||s.abort(Yr);var n=t.next;(t.f&xt)!==0?t.parent=null:Xe(t,e),t=n}}function pi(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&je)===0&&Xe(e),e=t}}function Xe(r,e=!0){var t=!1;(e||(r.f&Ls)!==0)&&r.nodes_start!==null&&r.nodes_end!==null&&(mi(r.nodes_start,r.nodes_end),t=!0),ss(r,e&&!t),tr(r,0),G(r,wt);var n=r.transitions;if(n!==null)for(const i of n)i.stop();ns(r);var s=r.parent;s!==null&&s.first!==null&&is(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes_start=r.nodes_end=r.ac=null}function mi(r,e){for(;r!==null;){var t=r===e?null:Qn(r);r.remove(),r=t}}function is(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 gi(r,e){var t=[];as(r,t,!0),vi(t,()=>{Xe(r),e&&e()})}function vi(r,e){var t=r.length;if(t>0){var n=()=>--t||e();for(var s of r)s.out(n)}else e()}function as(r,e,t){if((r.f&ft)===0){if(r.f^=ft,r.transitions!==null)for(const a of r.transitions)(a.is_global||t)&&e.push(a);for(var n=r.first;n!==null;){var s=n.next,i=(n.f&Ps)!==0||(n.f&je)!==0;as(n,e,i?t:!1),n=s}}}let it=!1;function fn(r){it=r}let kt=!1;function hn(r){kt=r}let R=null,me=!1;function Pe(r){R=r}let Z=null;function ht(r){Z=r}let J=null;function yi(r){R!==null&&(J===null?J=[r]:J.push(r))}let H=null,ne=0,oe=null;function _i(r){oe=r}let er=1,Rt=0,Ye=Rt;function pn(r){Ye=r}let Ie=!1;function os(){return++er}function cr(r){var d;var e=r.f;if((e&le)!==0)return!0;if((e&He)!==0){var t=r.deps,n=(e&se)!==0;if(t!==null){var s,i,a=(e&Ht)!==0,o=n&&Z!==null&&!Ie,l=t.length;if((a||o)&&(Z===null||(Z.f&wt)===0)){var u=r,c=u.parent;for(s=0;s<l;s++)i=t[s],(a||!((d=i==null?void 0:i.reactions)!=null&&d.includes(u)))&&(i.reactions??(i.reactions=[])).push(u);a&&(u.f^=Ht),o&&c!==null&&(c.f&se)===0&&(u.f^=se)}for(s=0;s<l;s++)if(i=t[s],cr(i)&&Un(i),i.wv>r.wv)return!0}(!n||Z!==null&&!Ie)&&G(r,X)}return!1}function ls(r,e,t=!0){var n=r.reactions;if(n!==null&&!(J!=null&&J.includes(r)))for(var s=0;s<n.length;s++){var i=n[s];(i.f&ie)!==0?ls(i,e,!1):e===i&&(t?G(i,le):(i.f&X)!==0&&G(i,He),$e(i))}}function us(r){var S;var e=H,t=ne,n=oe,s=R,i=Ie,a=J,o=fe,l=me,u=Ye,c=r.f;H=null,ne=0,oe=null,Ie=(c&se)!==0&&(me||!it||R===null),R=(c&(je|xt))===0?r:null,J=null,Gt(r.ctx),me=!1,Ye=++Rt,r.ac!==null&&(r.ac.abort(Yr),r.ac=null);try{r.f|=_r;var d=(0,r.fn)(),p=r.deps;if(H!==null){var y;if(tr(r,ne),p!==null&&ne>0)for(p.length=ne+H.length,y=0;y<H.length;y++)p[ne+y]=H[y];else r.deps=p=H;if(!Ie||(c&ie)!==0&&r.reactions!==null)for(y=ne;y<p.length;y++)((S=p[y]).reactions??(S.reactions=[])).push(r)}else p!==null&&ne<p.length&&(tr(r,ne),p.length=ne);if(Fn()&&oe!==null&&!me&&p!==null&&(r.f&(ie|He|le))===0)for(y=0;y<oe.length;y++)ls(oe[y],r);return s!==null&&s!==r&&(Rt++,oe!==null&&(n===null?n=oe:n.push(...oe))),(r.f&We)!==0&&(r.f^=We),d}catch(x){return Hs(x)}finally{r.f^=_r,H=e,ne=t,oe=n,R=s,Ie=i,J=a,Gt(o),me=l,Ye=u}}function xi(r,e){let t=e.reactions;if(t!==null){var n=Ms.call(t,r);if(n!==-1){var s=t.length-1;s===0?t=e.reactions=null:(t[n]=t[s],t.pop())}}t===null&&(e.f&ie)!==0&&(H===null||!H.includes(e))&&(G(e,He),(e.f&(se|Ht))===0&&(e.f^=Ht),Vn(e),tr(e,0))}function tr(r,e){var t=r.deps;if(t!==null)for(var n=e;n<t.length;n++)xi(r,t[n])}function Ot(r){var e=r.f;if((e&wt)===0){G(r,X);var t=Z,n=it;Z=r,it=!0;try{(e&ur)!==0?pi(r):ss(r),ns(r);var s=us(r);r.teardown=typeof s=="function"?s:null,r.wv=er;var i;on&&Ys&&(r.f&le)!==0&&r.deps}finally{it=n,Z=t}}}function F(r){var e=r.f,t=(e&ie)!==0;if(R!==null&&!me){var n=Z!==null&&(Z.f&wt)!==0;if(!n&&!(J!=null&&J.includes(r))){var s=R.deps;if((R.f&_r)!==0)r.rv<Rt&&(r.rv=Rt,H===null&&s!==null&&s[ne]===r?ne++:H===null?H=[r]:(!Ie||!H.includes(r))&&H.push(r));else{(R.deps??(R.deps=[])).push(r);var i=r.reactions;i===null?r.reactions=[R]:i.includes(R)||i.push(R)}}}else if(t&&r.deps===null&&r.effects===null){var a=r,o=a.parent;o!==null&&(o.f&se)===0&&(a.f^=se)}if(kt){if(qe.has(r))return qe.get(r);if(t){a=r;var l=a.v;return((a.f&X)!==0||cs(a))&&(l=Jr(a)),qe.set(a,l),l}}else if(t){if(a=r,Ne!=null&&Ne.has(a))return Ne.get(a);cr(a)&&Un(a)}if((r.f&We)!==0)throw r.v;return r.v}function cs(r){if(r.v===q)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(qe.has(e)||(e.f&ie)!==0&&cs(e))return!0;return!1}function wi(r){var e=me;try{return me=!0,r()}finally{me=e}}const ki=-7169;function G(r,e){r.f=r.f&ki|e}const bi=["touchstart","touchmove"];function Ai(r){return bi.includes(r)}const Ei=new Set,mn=new Set;function $t(r){var g;var e=this,t=e.ownerDocument,n=r.type,s=((g=r.composedPath)==null?void 0:g.call(r))||[],i=s[0]||r.target,a=0,o=r.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){r.__root=e;return}var u=s.indexOf(e);if(u===-1)return;l<=u&&(a=l)}if(i=s[a]||r.target,i!==e){yr(r,"currentTarget",{configurable:!0,get(){return i||t}});var c=R,d=Z;Pe(null),ht(null);try{for(var p,y=[];i!==null;){var S=i.assignedSlot||i.parentNode||i.host||null;try{var x=i["__"+n];if(x!=null&&(!i.disabled||r.target===i))if(Pn(x)){var[f,..._]=x;f.apply(i,[r,..._])}else x.call(i,r)}catch(v){p?y.push(v):p=v}if(r.cancelBubble||S===e||S===null)break;i=S}if(p){for(let v of y)queueMicrotask(()=>{throw v});throw p}}finally{r.__root=e,delete r.currentTarget,Pe(c),ht(d)}}}function Si(r){var e=document.createElement("template");return e.innerHTML=r.replaceAll("<!>","<!---->"),e.content}function Ci(r,e){var t=Z;t.nodes_start===null&&(t.nodes_start=r,t.nodes_end=e)}function ds(r,e){var t=(e&qs)!==0,n,s=!r.startsWith("<!>");return()=>{n===void 0&&(n=Si(s?r:"<!>"+r),n=Kn(n));var i=t||Hn?document.importNode(n,!0):n.cloneNode(!0);return Ci(i,i),i}}function fs(r,e){r!==null&&r.before(e)}function Kr(r,e){return Mi(r,e)}const et=new Map;function Mi(r,{target:e,anchor:t,props:n={},events:s,context:i,intro:a=!0}){ii();var o=new Set,l=d=>{for(var p=0;p<d.length;p++){var y=d[p];if(!o.has(y)){o.add(y);var S=Ai(y);e.addEventListener(y,$t,{passive:S});var x=et.get(y);x===void 0?(document.addEventListener(y,$t,{passive:S}),et.set(y,1)):et.set(y,x+1)}}};l(Ts(Ei)),mn.add(l);var u=void 0,c=ci(()=>{var d=t??e.appendChild(ai());return hi(()=>{if(i){Xr({});var p=fe;p.c=i}s&&(n.$$events=s),u=r(d,n)||{},i&&Hr()}),()=>{var S;for(var p of o){e.removeEventListener(p,$t);var y=et.get(p);--y===0?(document.removeEventListener(p,$t),et.delete(p)):et.set(p,y)}mn.delete(l),d!==t&&((S=d.parentNode)==null||S.removeChild(d))}});return Ti.set(u,c),u}let Ti=new WeakMap;const gn=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function Oi(r,e,t){var n=r==null?"":""+r;if(t){for(var s in t)if(t[s])n=n?n+" "+s:s;else if(n.length)for(var i=s.length,a=0;(a=n.indexOf(s,a))>=0;){var o=a+i;(a===0||gn.includes(n[a-1]))&&(o===n.length||gn.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}function vn(r,e=!1){var t=e?" !important;":";",n="";for(var s in r){var i=r[s];i!=null&&i!==""&&(n+=" "+s+": "+i+t)}return n}function pr(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function Ni(r,e){if(e){var t="",n,s;if(Array.isArray(e)?(n=e[0],s=e[1]):n=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,a=0,o=!1,l=[];n&&l.push(...Object.keys(n).map(pr)),s&&l.push(...Object.keys(s).map(pr));var u=0,c=-1;const x=r.length;for(var d=0;d<x;d++){var p=r[d];if(o?p==="/"&&r[d-1]==="*"&&(o=!1):i?i===p&&(i=!1):p==="/"&&r[d+1]==="*"?o=!0:p==='"'||p==="'"?i=p:p==="("?a++:p===")"&&a--,!o&&i===!1&&a===0){if(p===":"&&c===-1)c=d;else if(p===";"||d===x-1){if(c!==-1){var y=pr(r.substring(u,c).trim());if(!l.includes(y)){p!==";"&&d++;var S=r.substring(u,d).trim();t+=" "+S+";"}}u=d+1,c=-1}}}}return n&&(t+=vn(n)),s&&(t+=vn(s,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function hs(r,e,t,n,s,i){var a=r.__className;if(a!==t||a===void 0){var o=Oi(t,n,i);o==null?r.removeAttribute("class"):r.className=o,r.__className=t}else if(i&&s!==i)for(var l in i){var u=!!i[l];(s==null||u!==!!s[l])&&r.classList.toggle(l,u)}return i}function mr(r,e={},t,n){for(var s in t){var i=t[s];e[s]!==i&&(t[s]==null?r.style.removeProperty(s):r.style.setProperty(s,i,n))}}function rr(r,e,t,n){var s=r.__style;if(s!==e){var i=Ni(e,n);i==null?r.removeAttribute("style"):r.style.cssText=i,r.__style=e}else n&&(Array.isArray(n)?(mr(r,t==null?void 0:t[0],n[0]),mr(r,t==null?void 0:t[1],n[1],"important")):mr(r,t,n));return n}const Ii=()=>performance.now(),ge={tick:r=>requestAnimationFrame(r),now:()=>Ii(),tasks:new Set};function ps(){const r=ge.now();ge.tasks.forEach(e=>{e.c(r)||(ge.tasks.delete(e),e.f())}),ge.tasks.size!==0&&ge.tick(ps)}function Ri(r){let e;return ge.tasks.size===0&&ge.tick(ps),{promise:new Promise(t=>{ge.tasks.add(e={c:r,f:t})}),abort(){ge.tasks.delete(e)}}}function yn(r,e){return r===e||(r==null?void 0:r[qt])===e}function rt(r={},e,t,n){return di(()=>{var s,i;return ts(()=>{s=i,i=[],wi(()=>{r!==t(...i)&&(e(r,...i),s&&yn(t(...s),r)&&e(null,...s))})}),()=>{Js(()=>{i&&yn(t(...i),r)&&e(null,...i)})}}),r}const Di="5";var Dn;typeof window<"u"&&((Dn=window.__svelte??(window.__svelte={})).v??(Dn.v=new Set)).add(Di);function Pi(r){return r}function Ar(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 Zi(r){return Math.sin(r*Math.PI/2)}const ji=128,zi=0,Fi=1,Bi=2;class Vi{constructor(){h(this,"animationsStarted",!1);h(this,"animationsCount",0);h(this,"animationsLimit",ji);h(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 s=0;s<n.length;s++){const i=n[s];if(i!=null){for(const a of i.values())if(!a.executed&&(a.executed=!0,a.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,t,n,s){let i=this.layers[e];i==null&&(i=this.layers[e]={animations:new Array});let a=i.animations[t];a==null&&(a=i.animations[t]=new Map);let o={id:n,priority:t,executed:!1,function:s};a.set(n,o),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,t){for(let n=0;n<this.layers.length;n++){let s=this.layers[n];if(s==null)continue;let i=s.animations[e];if(i==null)return;let a=i.get(t);if(a==null||a.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 Me=new Vi;function _n(r){return Object.prototype.toString.call(r)==="[object Date]"}function Er(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((s,i)=>Er(r[i],s));return s=>n.map(i=>i(s))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(_n(r)&&_n(e)){const i=r.getTime(),o=e.getTime()-i;return l=>new Date(i+l*o)}const n=Object.keys(e),s={};return n.forEach(i=>{s[i]=Er(r[i],e[i])}),i=>{const a={};return n.forEach(o=>{a[o]=s[o](i)}),a}}if(t==="number"){const n=e-r;return s=>r+s*n}return()=>e}var ke,dt,Bt,Ue;const nn=class nn{constructor(e,t={}){W(this,ke);W(this,dt);W(this,Bt);W(this,Ue,null);$(this,ke,Q(e)),$(this,dt,Q(e)),$(this,Bt,t)}static of(e,t){const n=new nn(e(),t);return ts(()=>{n.set(e())}),n}set(e,t){var d;Y(T(this,dt),e);let{delay:n=0,duration:s=400,easing:i=Pi,interpolate:a=Er}={...T(this,Bt),...t};if(s===0)return(d=T(this,Ue))==null||d.abort(),Y(T(this,ke),e),Promise.resolve();const o=ge.now()+n;let l,u=!1,c=T(this,Ue);return $(this,Ue,Ri(p=>{if(p<o)return!0;if(!u){u=!0;const S=T(this,ke).v;l=a(S,e),typeof s=="function"&&(s=s(S,e)),c==null||c.abort()}const y=p-o;return y>s?(Y(T(this,ke),e),!1):(Y(T(this,ke),l(i(y/s))),!0)})),T(this,Ue).promise}get current(){return F(T(this,ke))}get target(){return F(T(this,dt))}set target(e){this.set(e)}};ke=new WeakMap,dt=new WeakMap,Bt=new WeakMap,Ue=new WeakMap;let Sr=nn;class Yt{constructor(e,t){h(this,"value");h(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 Ui=ds('<div><div class="body svelte-1nfn9j8"></div></div>');function Wi(r,e){Xr(e,!0);let t,n;function s(){return n}let i=Q(!1);function a(g){Y(i,g,!0)}function o(){return F(i)}let l=new Yt(0,{easing:Ar});xe(()=>{u(l.motion.current)}),xe(()=>{F(i)==!1&&(l.snap(),Me.clear(e.priority,e.id))});function u(g){t&&Me.equeue(e.layer,e.priority,e.id,()=>{t.style.scale=g.toString(),t.style.filter=`brightness(${.25+.75*g})`,n.style.opacity=g.toString()})}function c(g){g!=l.value&&l.set(g,{duration:75})}function d(){return l.motion.current==0}function p(){return l.value}var y=Ui();let S,x;var f=br(y);let _;return rt(f,g=>n=g,()=>n),rt(y,g=>t=g,()=>t),rs((g,v,E)=>{S=hs(y,1,"pin svelte-1nfn9j8",null,S,g),x=rr(y,"",x,v),_=rr(f,"",_,E)},[()=>({displayed:F(i)}),()=>({width:`${e.width}px`,height:`${e.height}px`,"border-radius":`${e.radius}px`}),()=>({width:`${e.width-4}px`,height:`${e.height-4}px`,"border-radius":`${e.radius-2}px`})]),fs(r,y),Hr({getBody:s,setDisplayed:a,getDisplayed:o,setScale:c,getCollapsed:d,getScale:p})}var at;(r=>{function e(t,n,s){const i=t/2,a=n/2,o=Math.sqrt(i*i+a*a),l=Math.atan(a/i)*(180/Math.PI),u=s*(Math.PI/180);return s<180?s<90?s<l?{offsetX:0,offsetY:o*Math.sin(u)-a}:{offsetX:o*Math.cos(u)-i,offsetY:0}:s<180-l?{offsetX:o*Math.cos(u)-i,offsetY:0}:{offsetX:-t,offsetY:o*Math.sin(u)-a}:s<270?s<180+l?{offsetX:-t,offsetY:o*Math.sin(u)-a}:{offsetX:o*Math.cos(u)-i,offsetY:-n}:s<360-l?{offsetX:o*Math.cos(u)-i,offsetY:-n}:{offsetX:0,offsetY:o*Math.sin(u)-a}}r.getOffsets=e})(at||(at={}));var $i=ds('<div><div class="pointer svelte-j5igi2"></div> <div class="bubble svelte-j5igi2"><div class="body svelte-j5igi2"></div></div></div>');function ms(r,e){Xr(e,!0);let t,n,s,i;const a=e.width+2*e.margin,o=e.height+2*e.margin,l=()=>i;xe(()=>{s.style.width=`${e.margin*4}px`,s.style.height=`${e.margin*4}px`});let u=Q(!0);function c(P){Y(u,P,!0)}function d(){return F(u)}let p=Q(!0);function y(P){Y(p,P,!0)}function S(){return f.motion.current==0}function x(){return f.motion.current==1}let f=new Yt(0);xe(()=>{_(f.motion.current)}),xe(()=>{F(u)==!1&&(f.snap(),Me.clear(e.priority,e.id+"_scale"))}),xe(()=>{F(p)==!0&&f.value!=0&&(Me.stacked()?f.set(0,{duration:0}):f.set(0,{duration:150,easing:Li})),F(p)==!1&&f.value!=1&&f.set(1,{duration:150,easing:Zi})});function _(P){!t||!n||!s||Me.equeue(F(p)?0:e.layer,e.priority,e.id+"_scale",()=>{t.style.opacity=`${P}`,n.style.scale=`${P}`,s.style.scale=`${P}`})}let g=NaN,v=Q(!1),E=new Yt(-a/2,{easing:Ar}),A=new Yt(-o/2,{easing:Ar});xe(()=>{O(E.motion.current,A.motion.current)}),xe(()=>{F(u)==!1&&(E.snap(),E.snap(),Me.clear(e.priority,e.id+"_angle"))}),xe(()=>{F(p)==!0&&F(v)&&(E.update({duration:75}),E.update({duration:75}))});function O(P,ce){if(!t||!n||!s)return;const Je=P+a/2,_e=ce+o/2,pe=o<a?Je*o/a:Je,Ke=o>a?_e*a/o:_e,Vt=Math.atan2(Ke,pe)/Math.PI*180-45,bt=0,Ut=30,Qe=Math.sqrt(pe*pe+Ke*Ke),At=Math.min(a,o)/2,bs=At*Math.SQRT2,As=(Qe-At)/(bs-At),sn=bt+As*(Ut-bt),Es=Qe<At?Qe/At:1;Me.equeue(e.layer,e.priority,e.id+"_angle",()=>{n.style.transform=`translate(${Math.round(P)}px, ${Math.round(ce)}px)`,s.style.transform=`scale(${Es}) rotate(${Vt}deg) skew(${sn}deg, ${sn}deg)`})}function j(P){if(F(v)==!1){let ce=at.getOffsets(a,o,P);E.set(Math.round(ce.offsetX),{duration:0}),A.set(Math.round(ce.offsetY),{duration:0}),O(E.value,A.value),g=P,Y(v,!0)}else if(P!=g){let ce=Math.abs(P-g),Je=ce<180?ce:360-ce,_e=Math.log(Je)*75,pe=at.getOffsets(a,o,P);E.set(Math.round(pe.offsetX),{duration:_e}),A.set(Math.round(pe.offsetY),{duration:_e}),g=P}}function te(){return at.getOffsets(a,o,g)}var re=$i();let he;var Ee=br(re);rt(Ee,P=>s=P,()=>s);var K=oi(Ee,2),Se=br(K);return rt(Se,P=>i=P,()=>i),rt(K,P=>n=P,()=>n),rt(re,P=>t=P,()=>t),rs(P=>{he=hs(re,1,"anchor svelte-j5igi2",null,he,P),rr(K,`margin: ${e.margin}px;`),rr(Se,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)},[()=>({displayed:F(u)})]),fs(r,re),Hr({getBody:l,setDisplayed:c,getDisplayed:d,setCollapsed:y,getCollapsed:S,getExpanded:x,setAngle:j,getOffsets:te})}var Fe;(r=>{function e(o,l,u){return{x:n(l)*u,y:s(o)*u}}r.project=e;function t(o,l,u){return{lat:a(l/u),lng:i(o/u)}}r.unproject=t;function n(o){return(180+o)/360}function s(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function i(o){return o*360-180}function a(o){return 360/Math.PI*Math.atan(Math.exp((180-o*360)*Math.PI/180))-90}})(Fe||(Fe={}));class gs{constructor(e,t,n,s,i){h(this,"swLat");h(this,"swLng");h(this,"neLat");h(this,"neLng");const a=n*Math.pow(2,t),o=Fe.project(e.sw.lat,e.sw.lng,a),l=Fe.project(e.ne.lat,e.ne.lng,a),u=o.x-s,c=o.y+i,d=l.x+s,p=l.y-i,y=Fe.unproject(u,c,a),S=Fe.unproject(d,p,a);this.swLat=y.lat,this.swLng=y.lng,this.neLat=S.lat,this.neLng=S.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 U;(r=>{r.COUNT=12,r.DEFAULT=270,r.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330]})(U||(U={}));var Nt;(r=>{let e;(a=>{a.RADIANS=U.DEGREES.map(u=>u*Math.PI/180),a.RADIANS_COS=a.RADIANS.map(u=>Math.cos(u)),a.RADIANS_SIN=a.RADIANS.map(u=>Math.sin(u));function o(u,c){const d=Math.abs(c/u);return d<1?d<.26795?0:1:d<3.73205?2:3}function l(u,c){const d=o(u,c);return u>0?c>0?(12-d)%12:0+d:c>0?6+d:6-d}a.getAngleIndex=l})(e=r.Angle||(r.Angle={}));class t{constructor(o,l,u,c){h(this,"center");h(this,"width");h(this,"height");h(this,"index");this.center=o,this.width=l,this.height=u,this.index=c}}r.Particle=t;function n(a){let o=!0;for(let l=0;l<a.length;l++){const[u,c]=a[l],d=u.index,p=u.center,y=u.width,S=u.height,x=i(d,-1),f=i(d,1),_=p.x+y*e.RADIANS_COS[x],g=p.y+S*e.RADIANS_SIN[x],v=p.x+y*e.RADIANS_COS[d],E=p.y+S*e.RADIANS_SIN[d],A=p.x+y*e.RADIANS_COS[f],O=p.y+S*e.RADIANS_SIN[f];let j=0,te=0,re=0;for(let Ee=0;Ee<c.length;Ee++){const K=c[Ee],Se=K.index,P=K.center,ce=K.width,Je=K.height,_e=P.x+ce*e.RADIANS_COS[Se],pe=P.y+Je*e.RADIANS_SIN[Se],Ke=_-_e,dr=g-pe;j+=1/(Ke*Ke+dr*dr);const Vt=v-_e,bt=E-pe;te+=1/(Vt*Vt+bt*bt);const Ut=A-_e,Qe=O-pe;re+=1/(Ut*Ut+Qe*Qe)}let he=0;j<te&&j<re&&(he=-1),re<te&&re<j&&(he=1),u.index=i(d,he),he!==0&&(o=!1)}return o}r.updatePointIndexes=n;function s(a){for(let o=0;o<a.length;o++){const[l,u]=a[o],c=l.center;let d=0,p=0;for(let y=0;y<u.length;y++){const x=u[y].center,f=c.x-x.x,_=c.y-x.y;if(f==0&&_==0)continue;const g=Math.sqrt(f*f+_*_),v=1/(g*g);d+=v*f/g,p+=-(v*_)/g}l.index=e.getAngleIndex(d,p)}}r.initializePointIndexes=s;function i(a,o){return o==0?a:((a+o)%U.COUNT+U.COUNT)%U.COUNT}})(Nt||(Nt={}));var ze;(r=>{function e(n,s){return!(n.x-n.left>s.x+s.right||n.x+n.right<s.x-s.left||n.y-n.top>s.y+s.bottom||n.y+n.bottom<s.y-s.top)}r.areOverlaping=e;function t(n,s){let i=Math.abs(n.x-s.x),o=(n.x<s.x?n.right+s.left:n.left+s.right)/i,l=Math.abs(n.y-s.y),c=(n.y<s.y?n.bottom+s.top:n.top+s.bottom)/l,d=Math.min(o,c);return Math.log2(d)}r.getZoomWhenTouching=t})(ze||(ze={}));var z;(r=>{class e{constructor(){h(this,"zoomAfterExpanded");h(this,"zoomAfterAngleIndexes");this.zoomAfterExpanded=NaN,this.zoomAfterAngleIndexes=[]}}r.Tooltip=e;class t{constructor(f,_,g){h(this,"index");h(this,"id");h(this,"rank");h(this,"x");h(this,"y");h(this,"width");h(this,"height");h(this,"expanded");h(this,"angle");h(this,"bounds");h(this,"particle");h(this,"neighbours");const v=Fe.project(_.lat,_.lng,f.mapSize),E=_.width+2*_.margin,A=_.height+2*_.margin;this.index=g,this.id=_.id,this.rank=_.rank,this.x=v.x,this.y=v.y,this.width=E,this.height=A,this.expanded=!0,this.angle=U.DEFAULT,this.bounds=this.getBounds(1),this.particle=new Nt.Particle({x:v.x,y:v.y},this.getParticleWidth(1),this.getParticleHeight(1),U.DEGREES.indexOf(U.DEFAULT)),this.neighbours=new Array}getBounds(f){let{offsetX:_,offsetY:g}=at.getOffsets(this.width,this.height,this.angle),v=-_,E=this.width-v,A=-g,O=this.height-A;return{x:this.x,y:this.y,left:v/f,right:E/f,top:A/f,bottom:O/f}}getParticleWidth(f){return this.width/2/f}getParticleHeight(f){return this.height/2/f}updateBounds(f){this.bounds=this.getBounds(f)}updateParticle(f){this.particle.width=this.getParticleWidth(f),this.particle.height=this.getParticleHeight(f)}}r.Node=t;class n{constructor(f){h(this,"min");h(this,"max");h(this,"scale");h(this,"step");this.min=f.zoomMin,this.max=f.zoomMax,this.scale=f.zoomScale,this.step=1/this.scale}addSteps(f,_){return Math.round((f+_*this.step)*this.scale)/this.scale}getIndex(f){if(!(f<this.min))return Math.min(Math.ceil(f*this.scale),this.max*this.scale)}getMax(f){let _=this.min;for(let g=0;g<f.length;g++){const E=f[g].keys();for(const A of E){const O=Number(A)/this.scale;O>_&&(_=O)}}return _}}r.Zoom=n;function s(x,f){let _=new Array(f.length);for(let g=0;g<f.length;g++)_[g]=new t(x,f[g],g);return _}r.createNodes=s;function i(x,f){const _=new Array;for(let v=0;v<f.length;v++)_[v]=new Array;const g=new Array(f.length);for(let v=0;v<f.length;v++){const E=f[v];g[v]={x:E.x,y:E.y,left:E.width,right:E.width,top:E.height,bottom:E.height}}for(let v=0;v<f.length;v++){const E=f[v],A=g[v],O=_[v];for(let j=v+1;j<f.length;j++){const te=f[j],re=g[j],he=_[j],Ee=ze.getZoomWhenTouching(A,re),K=x.getIndex(Ee);if(K==null)continue;const Se=O[K],P=he[K];Se?Se.push(te):O[K]=[te],P?P.push(E):he[K]=[E]}}return _}r.createNeighbourDeltas=i;function a(x){const f=new Set,_=[];for(let g=0;g<x.length;g++){let v=x[g];if(v.expanded==!1||v.neighbours.length==0||f.has(v))continue;f.add(v);const E=[],A=[v];for(;A.length>0;){const O=A.pop();E.push(O);for(const j of O.neighbours)f.has(j)||(f.add(j),A.push(j))}_.push(E)}return _}r.getNeighbourGraphs=a;function o(x,f,_){for(let g=0;g<x.length;g++){let v=x[g];if(v.expanded==!1){v.neighbours.length=0;continue}const A=f[g][_];if(A!=null)for(let O=0;O<A.length;O++){const j=A[O];j.expanded!=!1&&v.neighbours.push(j)}}}r.updateNeighbours=o;function l(x){x.expanded=!1;const f=x.neighbours;for(let _=0;_<f.length;_++){const g=f[_],v=g.neighbours.indexOf(x);g.neighbours.splice(v,1)}}r.updateCollapsed=l;function u(x,f,_){for(let g=0;g<x.length;g++){const v=x[g];if(v.expanded==!1)continue;const E=f.get(v.id);if(!E)throw new Error("Tooltip not found");E.zoomAfterExpanded=_;const A=U.DEGREES.indexOf(v.angle);E.zoomAfterAngleIndexes.length==0?E.zoomAfterAngleIndexes.push([_,A]):E.zoomAfterAngleIndexes[0][1]!=A?E.zoomAfterAngleIndexes.unshift([_,A]):E.zoomAfterAngleIndexes[0][0]=_}}r.updateTooltips=u;function c(x,f){for(let _=0;_<x.length;_++)x[_].updateBounds(f)}r.updateBounds=c;function d(x){const f=new Set;for(let _=0;_<x.length;_++){const g=x[_],v=g.bounds,E=x[_].neighbours;for(let A=0;A<E.length;A++){const O=E[A],j=O.bounds;ze.areOverlaping(j,v)&&(f.add(g),f.add(O))}}return f}r.getOverlaps=d;function p(x,f){let _=!1;for(let g=0;g<f.length;g++){const v=f[g],E=v.bounds,A=f[g].neighbours;for(let O=0;O<A.length;O++){const j=A[O],te=j.bounds;ze.areOverlaping(te,E)&&(x.has(v)||(x.add(v),_=!0),x.has(j)||(x.add(j),_=!0))}}return _}r.updateOverlaps=p;function y(x){let f,_=0;for(let g=0;g<x.length;g++){const v=x[g],E=v.bounds,A=x[g].neighbours;let O=0;for(let j=0;j<A.length;j++){const te=A[j],re=te.bounds;ze.areOverlaping(re,E)&&(O+=1+(te.rank-v.rank))}O=O*A.length,O>_&&(_=O,f=v)}return f}r.getOverlapsWorstNode=y;function S(x){for(let f=0;f<x.length;f++){const g=x[f].bounds;for(let v=f+1;v<x.length;v++){const A=x[v].bounds;if(ze.areOverlaping(A,g))return!0}}return!1}r.areOverlaping=S,(x=>{function f(v){const E=v.map(A=>A.particle);Nt.initializePointIndexes(E.map(A=>[A,E]));for(let A=0;A<v.length;A++){const O=v[A];O.angle=U.DEGREES[O.particle.index]}}x.initializeAngles=f;function _(v){const E=Nt.updatePointIndexes(v.map(A=>[A.particle,A.neighbours.map(O=>O.particle)]));for(let A=0;A<v.length;A++){const O=v[A];O.angle=U.DEGREES[O.particle.index]}return E}x.updateAngles=_;function g(v,E){for(let A=0;A<v.length;A++)v[A].updateParticle(E)}x.updateParticles=g})(r.Simulation||(r.Simulation={}))})(z||(z={}));function qi(r,e){const t=new z.Zoom(r);if(e.length==0)return[];if(e.length==1)return[[t.min,[[t.min,U.DEGREES.indexOf(U.DEFAULT)]]]];const n=new Map(e.map(l=>[l.id,new z.Tooltip])),s=z.createNodes(r,e),i=z.createNeighbourDeltas(t,s),a=t.min,o=t.getMax(i);z.Simulation.initializeAngles(s),z.updateTooltips(s,n,t.addSteps(t.max,1));for(let l=o;l>=a;l=t.addSteps(l,-1)){const u=Math.pow(2,l),c=Math.round(l*t.scale);z.updateNeighbours(s,i,c);const d=z.getNeighbourGraphs(s);for(const p of d){z.updateBounds(p,u),z.Simulation.updateParticles(p,u);const y=z.getOverlaps(p);for(;y.size>1;){const S=Array.from(y);for(;;){const _=z.Simulation.updateAngles(S);if(z.updateBounds(S,u),_==!0||z.areOverlaping(S)==!1)break}if(z.updateOverlaps(y,S))continue;const f=z.getOverlapsWorstNode(S);if(f==null)break;z.updateCollapsed(f),y.delete(f)}}z.updateTooltips(s,n,Number(l.toFixed(1)))}return Array.from(n.values()).map(l=>[l.zoomAfterExpanded,l.zoomAfterAngleIndexes])}var L;(function(r){r.assertEqual=s=>{};function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},r.getValidEnumValues=s=>{const i=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(const o of i)a[o]=s[o];return r.objectValues(a)},r.objectValues=s=>r.objectKeys(s).map(function(i){return s[i]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},r.find=(s,i)=>{for(const a of s)if(i(a))return a},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(L||(L={}));var xn;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(xn||(xn={}));const k=L.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ce=r=>{switch(typeof r){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(r)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(r)?k.array:r===null?k.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?k.promise:typeof Map<"u"&&r instanceof Map?k.map:typeof Set<"u"&&r instanceof Set?k.set:typeof Date<"u"&&r instanceof Date?k.date:k.object;default:return k.unknown}},m=L.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 ue 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:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let o=n,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(a))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return s(this),n}static assert(e){if(!(e instanceof ue))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,L.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];t[i]=t[i]||[],t[i].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}ue.create=r=>new ue(r);const Dt=(r,e)=>{let t;switch(r.code){case m.invalid_type:r.received===k.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case m.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,L.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:t=`Unrecognized key(s) in object: ${L.joinValues(r.keys,", ")}`;break;case m.invalid_union:t="Invalid input";break;case m.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${L.joinValues(r.options)}`;break;case m.invalid_enum_value:t=`Invalid enum value. Expected ${L.joinValues(r.options)}, received '${r.received}'`;break;case m.invalid_arguments:t="Invalid function arguments";break;case m.invalid_return_type:t="Invalid function return type";break;case m.invalid_date:t="Invalid date";break;case m.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}"`:L.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case m.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 m.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 m.custom:t="Invalid input";break;case m.invalid_intersection_types:t="Intersection results could not be merged";break;case m.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case m.not_finite:t="Number must be finite";break;default:t=e.defaultError,L.assertNever(r)}return{message:t}};let Yi=Dt;function Cr(){return Yi}const Mr=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,i=[...t,...s.path||[]],a={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let o="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)o=u(a,{data:e,defaultError:o}).message;return{...s,path:i,message:o}};function w(r,e){const t=Cr(),n=Mr({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===Dt?void 0:Dt].filter(s=>!!s)});r.common.issues.push(n)}class ae{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 s of t){if(s.status==="aborted")return C;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const i=await s.key,a=await s.value;n.push({key:i,value:a})}return ae.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:i,value:a}=s;if(i.status==="aborted"||a.status==="aborted")return C;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[i.value]=a.value)}return{status:e.value,value:n}}}const C=Object.freeze({status:"aborted"}),Mt=r=>({status:"dirty",value:r}),ee=r=>({status:"valid",value:r}),wn=r=>r.status==="aborted",kn=r=>r.status==="dirty",pt=r=>r.status==="valid",nr=r=>typeof Promise<"u"&&r instanceof Promise;var b;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));class Le{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}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 bn=(r,e)=>{if(pt(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 ue(r.common.issues);return this._error=t,this._error}}};function N(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=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:s}:{errorMap:(a,o)=>{const{message:l}=r;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:s}}class D{get description(){return this._def.description}_getType(e){return Ce(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ae,ctx:{common:e.parent.common,data:e.data,parsedType:Ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(nr(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:Ce(e)},s=this._parseSync({data:e,path:n.path,parent:n});return bn(n,s)}"~validate"(e){var n,s;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ce(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return pt(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(s=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>pt(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:Ce(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(nr(s)?s:Promise.resolve(s));return bn(n,i)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,i)=>{const a=e(s),o=()=>i.addIssue({code:m.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new vt({schema:this,typeName:M.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return De.create(this,this._def)}nullable(){return yt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ye.create(this)}promise(){return Zt.create(this,this._def)}or(e){return ir.create([this,e],this._def)}and(e){return ar.create(this,e,this._def)}transform(e){return new vt({...N(this._def),schema:this,typeName:M.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Rr({...N(this._def),innerType:this,defaultValue:t,typeName:M.ZodDefault})}brand(){return new ga({typeName:M.ZodBranded,type:this,...N(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Dr({...N(this._def),innerType:this,catchValue:t,typeName:M.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Qr.create(this,e)}readonly(){return Pr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xi=/^c[^\s-]{8,}$/i,Hi=/^[0-9a-z]+$/,Gi=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ji=/^[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,Ki=/^[a-z0-9_-]{21}$/i,Qi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ea=/^[-+]?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)?)??$/,ta=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ra="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let gr;const na=/^(?:(?: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])$/,sa=/^(?:(?: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])$/,ia=/^(([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]))$/,aa=/^(([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])$/,oa=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,la=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vs="((\\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])))",ua=new RegExp(`^${vs}$`);function ys(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 ca(r){return new RegExp(`^${ys(r)}$`)}function da(r){let e=`${vs}T${ys(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 fa(r,e){return!!((e==="v4"||!e)&&na.test(r)||(e==="v6"||!e)&&ia.test(r))}function ha(r,e){if(!Qi.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,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function pa(r,e){return!!((e==="v4"||!e)&&sa.test(r)||(e==="v6"||!e)&&aa.test(r))}class Re extends D{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){const i=this._getOrReturnCtx(e);return w(i,{code:m.invalid_type,expected:k.string,received:i.parsedType}),C}const n=new ae;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),w(s,{code:m.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&&(s=this._getOrReturnCtx(e,s),w(s,{code:m.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const a=e.data.length>i.value,o=e.data.length<i.value;(a||o)&&(s=this._getOrReturnCtx(e,s),a?w(s,{code:m.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&w(s,{code:m.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")ta.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"email",code:m.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")gr||(gr=new RegExp(ra,"u")),gr.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"emoji",code:m.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")Ji.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"uuid",code:m.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")Ki.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"nanoid",code:m.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Xi.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"cuid",code:m.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Hi.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"cuid2",code:m.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Gi.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"ulid",code:m.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),w(s,{validation:"url",code:m.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"regex",code:m.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)||(s=this._getOrReturnCtx(e,s),w(s,{code:m.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)||(s=this._getOrReturnCtx(e,s),w(s,{code:m.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),w(s,{code:m.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?da(i).test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:m.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ua.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:m.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?ca(i).test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{code:m.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?ea.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"duration",code:m.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?fa(e.data,i.version)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"ip",code:m.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?ha(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"jwt",code:m.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?pa(e.data,i.version)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"cidr",code:m.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?oa.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"base64",code:m.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?la.test(e.data)||(s=this._getOrReturnCtx(e,s),w(s,{validation:"base64url",code:m.invalid_string,message:i.message}),n.dirty()):L.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:m.invalid_string,...b.errToObj(n)})}_addCheck(e){return new Re({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.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,...b.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,...b.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...b.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new Re({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Re({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Re({...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}}Re.create=r=>new Re({checks:[],typeName:M.ZodString,coerce:(r==null?void 0:r.coerce)??!1,...N(r)});function ma(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,i=Number.parseInt(r.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return i%a/10**s}class mt extends D{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)!==k.number){const i=this._getOrReturnCtx(e);return w(i,{code:m.invalid_type,expected:k.number,received:i.parsedType}),C}let n;const s=new ae;for(const i of this._def.checks)i.kind==="int"?L.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{code:m.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),w(n,{code:m.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),w(n,{code:m.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?ma(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),w(n,{code:m.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{code:m.not_finite,message:i.message}),s.dirty()):L.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,s){return new mt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(s)}]})}_addCheck(e){return new mt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.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"&&L.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)}}mt.create=r=>new mt({checks:[],typeName:M.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...N(r)});class Pt extends D{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)!==k.bigint)return this._getInvalidInput(e);let n;const s=new ae;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),w(n,{code:m.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),w(n,{code:m.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),w(n,{code:m.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):L.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return w(t,{code:m.invalid_type,expected:k.bigint,received:t.parsedType}),C}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,s){return new Pt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(s)}]})}_addCheck(e){return new Pt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.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}}Pt.create=r=>new Pt({checks:[],typeName:M.ZodBigInt,coerce:(r==null?void 0:r.coerce)??!1,...N(r)});class Tr extends D{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){const n=this._getOrReturnCtx(e);return w(n,{code:m.invalid_type,expected:k.boolean,received:n.parsedType}),C}return ee(e.data)}}Tr.create=r=>new Tr({typeName:M.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...N(r)});class sr extends D{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){const i=this._getOrReturnCtx(e);return w(i,{code:m.invalid_type,expected:k.date,received:i.parsedType}),C}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return w(i,{code:m.invalid_date}),C}const n=new ae;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),w(s,{code:m.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),w(s,{code:m.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):L.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.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}}sr.create=r=>new sr({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:M.ZodDate,...N(r)});class An extends D{_parse(e){if(this._getType(e)!==k.symbol){const n=this._getOrReturnCtx(e);return w(n,{code:m.invalid_type,expected:k.symbol,received:n.parsedType}),C}return ee(e.data)}}An.create=r=>new An({typeName:M.ZodSymbol,...N(r)});class En extends D{_parse(e){if(this._getType(e)!==k.undefined){const n=this._getOrReturnCtx(e);return w(n,{code:m.invalid_type,expected:k.undefined,received:n.parsedType}),C}return ee(e.data)}}En.create=r=>new En({typeName:M.ZodUndefined,...N(r)});class Sn extends D{_parse(e){if(this._getType(e)!==k.null){const n=this._getOrReturnCtx(e);return w(n,{code:m.invalid_type,expected:k.null,received:n.parsedType}),C}return ee(e.data)}}Sn.create=r=>new Sn({typeName:M.ZodNull,...N(r)});class Or extends D{constructor(){super(...arguments),this._any=!0}_parse(e){return ee(e.data)}}Or.create=r=>new Or({typeName:M.ZodAny,...N(r)});class ot extends D{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ee(e.data)}}ot.create=r=>new ot({typeName:M.ZodUnknown,...N(r)});class Ze extends D{_parse(e){const t=this._getOrReturnCtx(e);return w(t,{code:m.invalid_type,expected:k.never,received:t.parsedType}),C}}Ze.create=r=>new Ze({typeName:M.ZodNever,...N(r)});class Nr extends D{_parse(e){if(this._getType(e)!==k.undefined){const n=this._getOrReturnCtx(e);return w(n,{code:m.invalid_type,expected:k.void,received:n.parsedType}),C}return ee(e.data)}}Nr.create=r=>new Nr({typeName:M.ZodVoid,...N(r)});class ye extends D{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==k.array)return w(t,{code:m.invalid_type,expected:k.array,received:t.parsedType}),C;if(s.exactLength!==null){const a=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(a||o)&&(w(t,{code:a?m.too_big:m.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(w(t,{code:m.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(w(t,{code:m.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((a,o)=>s.type._parseAsync(new Le(t,a,t.path,o)))).then(a=>ae.mergeArray(n,a));const i=[...t.data].map((a,o)=>s.type._parseSync(new Le(t,a,t.path,o)));return ae.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new ye({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new ye({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new ye({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}}ye.create=(r,e)=>new ye({type:r,minLength:null,maxLength:null,exactLength:null,typeName:M.ZodArray,...N(e)});function tt(r){if(r instanceof B){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=De.create(tt(n))}return new B({...r._def,shape:()=>e})}else return r instanceof ye?new ye({...r._def,type:tt(r.element)}):r instanceof De?De.create(tt(r.unwrap())):r instanceof yt?yt.create(tt(r.unwrap())):r instanceof be?be.create(r.items.map(e=>tt(e))):r}class B extends D{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=L.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==k.object){const u=this._getOrReturnCtx(e);return w(u,{code:m.invalid_type,expected:k.object,received:u.parsedType}),C}const{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ze&&this._def.unknownKeys==="strip"))for(const u in s.data)a.includes(u)||o.push(u);const l=[];for(const u of a){const c=i[u],d=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Le(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Ze){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of o)l.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});else if(u==="strict")o.length>0&&(w(s,{code:m.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of o){const d=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Le(s,d,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,p=await c.value;u.push({key:d,value:p,alwaysSet:c.alwaysSet})}return u}).then(u=>ae.mergeObjectSync(n,u)):ae.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new B({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,a;const s=((a=(i=this._def).errorMap)==null?void 0:a.call(i,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:b.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new B({...this._def,unknownKeys:"strip"})}passthrough(){return new B({...this._def,unknownKeys:"passthrough"})}extend(e){return new B({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new B({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:M.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new B({...this._def,catchall:e})}pick(e){const t={};for(const n of L.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new B({...this._def,shape:()=>t})}omit(e){const t={};for(const n of L.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new B({...this._def,shape:()=>t})}deepPartial(){return tt(this)}partial(e){const t={};for(const n of L.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new B({...this._def,shape:()=>t})}required(e){const t={};for(const n of L.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof De;)i=i._def.innerType;t[n]=i}return new B({...this._def,shape:()=>t})}keyof(){return _s(L.objectKeys(this.shape))}}B.create=(r,e)=>new B({shape:()=>r,unknownKeys:"strip",catchall:Ze.create(),typeName:M.ZodObject,...N(e)});B.strictCreate=(r,e)=>new B({shape:()=>r,unknownKeys:"strict",catchall:Ze.create(),typeName:M.ZodObject,...N(e)});B.lazycreate=(r,e)=>new B({shape:r,unknownKeys:"strip",catchall:Ze.create(),typeName:M.ZodObject,...N(e)});class ir extends D{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(o=>new ue(o.ctx.common.issues));return w(t,{code:m.invalid_union,unionErrors:a}),C}if(t.common.async)return Promise.all(n.map(async i=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(s);{let i;const a=[];for(const l of n){const u={...t,common:{...t.common,issues:[]},parent:null},c=l._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const o=a.map(l=>new ue(l));return w(t,{code:m.invalid_union,unionErrors:o}),C}}get options(){return this._def.options}}ir.create=(r,e)=>new ir({options:r,typeName:M.ZodUnion,...N(e)});function Ir(r,e){const t=Ce(r),n=Ce(e);if(r===e)return{valid:!0,data:r};if(t===k.object&&n===k.object){const s=L.objectKeys(e),i=L.objectKeys(r).filter(o=>s.indexOf(o)!==-1),a={...r,...e};for(const o of i){const l=Ir(r[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(t===k.array&&n===k.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<r.length;i++){const a=r[i],o=e[i],l=Ir(a,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return t===k.date&&n===k.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class ar extends D{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(i,a)=>{if(wn(i)||wn(a))return C;const o=Ir(i.value,a.value);return o.valid?((kn(i)||kn(a))&&t.dirty(),{status:t.value,value:o.data}):(w(n,{code:m.invalid_intersection_types}),C)};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,a])=>s(i,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ar.create=(r,e,t)=>new ar({left:r,right:e,typeName:M.ZodIntersection,...N(t)});class be extends D{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.array)return w(n,{code:m.invalid_type,expected:k.array,received:n.parsedType}),C;if(n.data.length<this._def.items.length)return w(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),C;!this._def.rest&&n.data.length>this._def.items.length&&(w(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...n.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new Le(n,a,n.path,o)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>ae.mergeArray(t,a)):ae.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new be({...this._def,rest:e})}}be.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new be({items:r,typeName:M.ZodTuple,rest:null,...N(e)})};class Cn extends D{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!==k.map)return w(n,{code:m.invalid_type,expected:k.map,received:n.parsedType}),C;const s=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([o,l],u)=>({key:s._parse(new Le(n,o,n.path,[u,"key"])),value:i._parse(new Le(n,l,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return C;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(u.value,c.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of a){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return C;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),o.set(u.value,c.value)}return{status:t.value,value:o}}}}Cn.create=(r,e,t)=>new Cn({valueType:e,keyType:r,typeName:M.ZodMap,...N(t)});class Lt extends D{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.set)return w(n,{code:m.invalid_type,expected:k.set,received:n.parsedType}),C;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(w(n,{code:m.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(w(n,{code:m.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const i=this._def.valueType;function a(l){const u=new Set;for(const c of l){if(c.status==="aborted")return C;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const o=[...n.data.values()].map((l,u)=>i._parse(new Le(n,l,n.path,u)));return n.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,t){return new Lt({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new Lt({...this._def,maxSize:{value:e,message:b.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Lt.create=(r,e)=>new Lt({valueType:r,minSize:null,maxSize:null,typeName:M.ZodSet,...N(e)});class It extends D{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==k.function)return w(t,{code:m.invalid_type,expected:k.function,received:t.parsedType}),C;function n(o,l){return Mr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cr(),Dt].filter(u=>!!u),issueData:{code:m.invalid_arguments,argumentsError:l}})}function s(o,l){return Mr({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cr(),Dt].filter(u=>!!u),issueData:{code:m.invalid_return_type,returnTypeError:l}})}const i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Zt){const o=this;return ee(async function(...l){const u=new ue([]),c=await o._def.args.parseAsync(l,i).catch(y=>{throw u.addIssue(n(l,y)),u}),d=await Reflect.apply(a,this,c);return await o._def.returns._def.type.parseAsync(d,i).catch(y=>{throw u.addIssue(s(d,y)),u})})}else{const o=this;return ee(function(...l){const u=o._def.args.safeParse(l,i);if(!u.success)throw new ue([n(l,u.error)]);const c=Reflect.apply(a,this,u.data),d=o._def.returns.safeParse(c,i);if(!d.success)throw new ue([s(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new It({...this._def,args:be.create(e).rest(ot.create())})}returns(e){return new It({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new It({args:e||be.create([]).rest(ot.create()),returns:t||ot.create(),typeName:M.ZodFunction,...N(n)})}}class Mn extends D{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})}}Mn.create=(r,e)=>new Mn({getter:r,typeName:M.ZodLazy,...N(e)});class Tn extends D{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return w(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),C}return{status:"valid",value:e.data}}get value(){return this._def.value}}Tn.create=(r,e)=>new Tn({value:r,typeName:M.ZodLiteral,...N(e)});function _s(r,e){return new gt({values:r,typeName:M.ZodEnum,...N(e)})}class gt extends D{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return w(t,{expected:L.joinValues(n),received:t.parsedType,code:m.invalid_type}),C}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 w(t,{received:t.data,code:m.invalid_enum_value,options:n}),C}return ee(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 gt.create(e,{...this._def,...t})}exclude(e,t=this._def){return gt.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}gt.create=_s;class On extends D{_parse(e){const t=L.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==k.string&&n.parsedType!==k.number){const s=L.objectValues(t);return w(n,{expected:L.joinValues(s),received:n.parsedType,code:m.invalid_type}),C}if(this._cache||(this._cache=new Set(L.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=L.objectValues(t);return w(n,{received:n.data,code:m.invalid_enum_value,options:s}),C}return ee(e.data)}get enum(){return this._def.values}}On.create=(r,e)=>new On({values:r,typeName:M.ZodNativeEnum,...N(e)});class Zt extends D{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==k.promise&&t.common.async===!1)return w(t,{code:m.invalid_type,expected:k.promise,received:t.parsedType}),C;const n=t.parsedType===k.promise?t.data:Promise.resolve(t.data);return ee(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Zt.create=(r,e)=>new Zt({type:r,typeName:M.ZodPromise,...N(e)});class vt extends D{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===M.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:a=>{w(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const a=s.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(async o=>{if(t.value==="aborted")return C;const l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?C:l.status==="dirty"||t.value==="dirty"?Mt(l.value):l});{if(t.value==="aborted")return C;const o=this._def.schema._parseSync({data:a,path:n.path,parent:n});return o.status==="aborted"?C:o.status==="dirty"||t.value==="dirty"?Mt(o.value):o}}if(s.type==="refinement"){const a=o=>{const l=s.refinement(o,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 o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?C:(o.status==="dirty"&&t.dirty(),a(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?C:(o.status==="dirty"&&t.dirty(),a(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!pt(a))return C;const o=s.transform(a.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>pt(a)?Promise.resolve(s.transform(a.value,i)).then(o=>({status:t.value,value:o})):C);L.assertNever(s)}}vt.create=(r,e,t)=>new vt({schema:r,typeName:M.ZodEffects,effect:e,...N(t)});vt.createWithPreprocess=(r,e,t)=>new vt({schema:e,effect:{type:"preprocess",transform:r},typeName:M.ZodEffects,...N(t)});class De extends D{_parse(e){return this._getType(e)===k.undefined?ee(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}De.create=(r,e)=>new De({innerType:r,typeName:M.ZodOptional,...N(e)});class yt extends D{_parse(e){return this._getType(e)===k.null?ee(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}yt.create=(r,e)=>new yt({innerType:r,typeName:M.ZodNullable,...N(e)});class Rr extends D{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===k.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:M.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...N(e)});class Dr extends D{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return nr(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ue(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ue(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Dr.create=(r,e)=>new Dr({innerType:r,typeName:M.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...N(e)});class Nn extends D{_parse(e){if(this._getType(e)!==k.nan){const n=this._getOrReturnCtx(e);return w(n,{code:m.invalid_type,expected:k.nan,received:n.parsedType}),C}return{status:"valid",value:e.data}}}Nn.create=r=>new Nn({typeName:M.ZodNaN,...N(r)});class ga extends D{_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 Qr extends D{_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"?C:i.status==="dirty"?(t.dirty(),Mt(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?C:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new Qr({in:e,out:t,typeName:M.ZodPipeline})}}class Pr extends D{_parse(e){const t=this._def.innerType._parse(e),n=s=>(pt(s)&&(s.value=Object.freeze(s.value)),s);return nr(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}Pr.create=(r,e)=>new Pr({innerType:r,typeName:M.ZodReadonly,...N(e)});var M;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(M||(M={}));const _t=Re.create,I=mt.create,xs=Tr.create,ws=Or.create;ot.create;Ze.create;const Xt=Nr.create,en=ye.create,V=B.create;ir.create;ar.create;const In=be.create,ve=It.create;gt.create;const va=Zt.create;De.create;yt.create;V({pin:V({fade:xs().optional(),maxCount:I().optional(),maxZoom:I().optional()}).optional(),animation:V({queue:V({limit:I().optional()}).optional()}).optional(),states:V({url:_t(),key:_t()}).optional()});const Lr=I().min(-90).max(90),Zr=I().min(-180).max(180),ya=V({sw:V({lat:Lr,lng:Zr}),ne:V({lat:Lr,lng:Zr})}),jr=ws().refine(r=>r instanceof HTMLElement,"Must be an HTMLElement"),ks=V({mapSize:I(),zoomMin:I(),zoomMax:I(),zoomScale:I()}),_a=V({instance:ws(),inserted:ve().returns(xs()),insert:ve().returns(Xt()),remove:ve().returns(Xt()),update:ve().args(I()).returns(Xt())}),xa=V({parameters:ks,getContainer:ve().args().returns(jr),getZoom:ve().args().returns(I()),getBounds:ve().args().returns(ya),panBy:ve().args(I(),I()).returns(Xt()),createMarker:ve().args(jr,Lr,Zr,I()).returns(_a)}),vr=ve().args(_t()).returns(va(jr)),wa=V({id:_t().min(1),rank:I(),lat:I().min(-90).max(90),lng:I().min(-180).max(180),tooltip:V({style:V({width:I(),height:I(),margin:I(),radius:I()}).refine(r=>Math.min(r.width,r.height)/r.margin>=5,"Tooltip width and height must be at least 5 times the margin"),body:vr}),pin:V({style:V({width:I(),height:I(),radius:I()}),body:vr}).optional(),popup:V({style:V({width:I(),height:I(),radius:I(),margin:I()}),body:vr}).optional()}),ka=en(wa);In([I(),en(In([I(),I()]))]);const ba=V({id:_t(),rank:I(),lat:I(),lng:I(),width:I(),height:I(),margin:I()});V({key:_t(),parameters:ks,input:en(ba)});class Aa{constructor(e,t){h(this,"provider");h(this,"statesApiUrl");h(this,"statesApiKey");h(this,"markerDataArray",new Array);h(this,"markerDataMap",new Map);h(this,"markerDataUpdating",!1);h(this,"markerPinProcessor");h(this,"markerTooltipProcessor");h(this,"markerPopupProcessor");xa.parse(e),this.provider=e,this.markerPinProcessor=new Fr(e),this.markerTooltipProcessor=new Ea(e),this.markerPopupProcessor=new Sa(e),this.configuration=t}set configuration(e){var t,n,s,i;this.statesApiUrl=(t=e==null?void 0:e.states)==null?void 0:t.url,this.statesApiKey=(n=e==null?void 0:e.states)==null?void 0:n.key,this.markerPinProcessor.setConfiguration(e),Me.setLimit(((i=(s=e==null?void 0:e.animation)==null?void 0:s.queue)==null?void 0:i.limit)??8*navigator.hardwareConcurrency)}async updateMarkers(e){await ka.parseAsync(e);try{let t;if(e.length>1){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}));if(this.statesApiUrl!=null&&this.statesApiKey!=null){const s={key:this.statesApiKey,parameters:this.provider.parameters,input:n},i=await fetch(this.statesApiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!i.ok||!i.body)throw new Error("Failed to get marker states: "+i.statusText);t=await i.json()}else t=qi(this.provider.parameters,n)}else t=[[0,[[0,U.DEGREES.indexOf(U.DEFAULT)]]]],this.updateMarkerData(e,t);this.updateMarkerData(e,t),this.processMarkerDataCallback()}catch(t){throw console.error(t),this.removeMarkerData(),t}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(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}}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}}updateMarkerData(e,t){try{this.markerDataUpdating=!0;const n=new Map(e.map((i,a)=>[i.id,new Rn(this.provider,i,t[a])])),s=Array.from(this.markerDataArray);for(const i of s)n.has(i.marker.id)==!1&&(i.remove(),this.markerDataMap.delete(i.marker.id),this.markerDataArray.splice(this.markerDataArray.indexOf(i),1));for(let i=0;i<e.length;i++){const a=e[i],o=t[i],l=this.markerDataMap.get(a.id);if(l)l.update(o);else{const u=new Rn(this.provider,a,o);u.create(),this.markerDataMap.set(a.id,u),this.markerDataArray.push(u)}}this.markerDataArray.sort((i,a)=>i.zoom-a.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(i=>i.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(i=>i.tooltip))}catch(n){throw console.error(n),this.markerDataArray.forEach(s=>s.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),n}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.clear(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e}finally{this.markerDataUpdating=!1}}processMarkerDataCallback(){if(this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e)}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.provider.getBounds(),t=this.provider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,t),this.markerPinProcessor.process(e,t)}}class Rn{constructor(e,t,n){h(this,"marker");h(this,"zoom");h(this,"pin");h(this,"tooltip");this.marker=t,this.zoom=n[0],this.pin=new zr(e,t,n),this.tooltip=new Br(e,t,n)}create(){this.pin.create(),this.tooltip.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove()}}class tn{constructor(e,t){h(this,"provider");h(this,"id");h(this,"lat");h(this,"lng");h(this,"shown");h(this,"element");h(this,"component");h(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,t;(e=this.marker)==null||e.remove(),(t=this.element)==null||t.remove()}}const nt=class nt extends tn{constructor(t,n,s){var i,a,o,l;super(t,n);h(this,"width");h(this,"height");h(this,"radius");h(this,"zoom");h(this,"bodyLoading",!1);h(this,"bodyLoaded",!1);h(this,"bodyCallback");this.width=((i=n.pin)==null?void 0:i.style.width)??nt.DEFAULT_SIZE,this.height=((a=n.pin)==null?void 0:a.style.height)??nt.DEFAULT_SIZE,this.radius=((o=n.pin)==null?void 0:o.style.radius)??nt.DEFAULT_SIZE,this.zoom=s[0],this.bodyCallback=(l=n.pin)==null?void 0:l.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=Kr(Wi,{target:this.element,props:{id:this.id+"_pin",layer:Bi,priority:this.zoom*this.provider.parameters.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)}updateState(t){if(this.component==null)throw new Error("Failed to update pin state");this.component.setScale(this.getScale(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(s=>t.appendChild(s)).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(t){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setScale(t?0:1)}getScale(t){return this.zoom<t?1:Math.max(0,1-(this.zoom-t)*.125)}getZindex(){return Math.round((this.provider.parameters.zoomMax-this.zoom)*this.provider.parameters.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}};h(nt,"DEFAULT_SIZE",16);let zr=nt;const st=class st{constructor(e){h(this,"provider");h(this,"pinElements",new Array);h(this,"pinMaxWidth",0);h(this,"pinMaxHeight",0);h(this,"pinFade",!1);h(this,"pinMaxCount",0);h(this,"pinMaxZoomDelta",0);this.provider=e}setConfiguration(e){var t,n,s;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(st.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=((s=e==null?void 0:e.pin)==null?void 0:s.maxZoom)??st.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.parameters.mapSize,s=new gs(e,t,n,this.pinMaxWidth*2,this.pinMaxHeight*2);let i=0;for(const a of this.pinElements)s.contains(a.lat,a.lng)?a.shown&&t<=a.zoom&&a.zoom<=t+this.pinMaxZoomDelta?(i<this.pinMaxCount&&(this.pinFade==!0?a.updateState(t):a.setCollapsed(!1),a.updateMap(!0),a.isBodyLoaded()==!1&&a.updateBody()),i++):(a.setCollapsed(!0),a.isCollapsed()&&a.updateMap(!1)):a.updateMap(!1)}};h(st,"MAP_PINS_MAX_ZOOM",2),h(st,"MAP_PINS_MAX_COUNT",128);let Fr=st;const or=class or extends tn{constructor(t,n,s){super(t,n);h(this,"width");h(this,"height");h(this,"margin");h(this,"radius");h(this,"zoom");h(this,"angle");h(this,"states");h(this,"bodyLoading",!1);h(this,"bodyLoaded",!1);h(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=s[0],this.angle=U.DEFAULT,this.states=s[1].map(i=>[i[0],U.DEGREES[i[1]]]),this.bodyCallback=n.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=Kr(ms,{target:this.element,props:{id:this.id+"_tooltip",layer:Fi,priority:this.zoom*this.provider.parameters.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],U.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(s=>t.appendChild(s)).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(t){const n=this.states.findLast(s=>s[0]<=t);if(!n)throw new Error("Angle not found");return n[1]}getZindex(){return Math.round((this.provider.parameters.zoomMax-this.zoom)*this.provider.parameters.zoomScale)+or.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}};h(or,"Z_INDEX_OFFSET",1e6);let Br=or;class Ea{constructor(e){h(this,"provider");h(this,"tooltipElements",new Array);h(this,"tooltipMaxWidth",0);h(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.parameters.mapSize,s=new gs(e,t,n,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const i of this.tooltipElements)s.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 lr=class lr extends tn{constructor(t,n){if(n.popup==null)throw new Error("Failed to create popup");super(t,n);h(this,"width");h(this,"height");h(this,"margin");h(this,"radius");h(this,"bodyLoading",!1);h(this,"bodyLoaded",!1);h(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=Kr(ms,{target:this.element,props:{id:this.id+"_popup",layer:zi,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(s=>t.appendChild(s)).catch(s=>console.error(s)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return lr.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)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}};h(lr,"Z_INDEX_OFFSET",2e6);let Vr=lr;class Sa{constructor(e){h(this,"provider");h(this,"popupElements",new Map);h(this,"popupPositioned",new Map);this.provider=e}show(e){e.pin.shown=!1,e.tooltip.shown=!1;const t=new Vr(this.provider,e.marker);this.popupElements.set(e.marker.id,t),this.popupPositioned.set(e.marker.id,!1),t.create(),t.setAngle(e.tooltip.angle),t.shown=!0}hide(e){e.pin.shown=!0,e.tooltip.shown=!0;const t=this.popupElements.get(e.marker.id);t!=null&&(t.shown=!1)}clear(){this.popupElements.values().forEach(e=>e.remove()),this.popupElements.clear(),this.popupPositioned.clear()}process(){var e,t;for(const n of this.popupElements.values())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 s=(e=n.component)==null?void 0:e.getBody();if(s==null)continue;const i=(t=n.component)==null?void 0:t.getOffsets();if(i==null)continue;const a=s.getBoundingClientRect();if(a.x==0&&a.y==0&&a.width==0&&a.height==0)continue;const o=a.x+a.width/2,l=a.y+a.height/2,u=o+i.offsetX,c=l+i.offsetY,d=u+n.width,p=c+n.height,y=this.provider.getContainer().getBoundingClientRect(),S=u-y.left,x=y.right-d,f=c-y.top,_=y.bottom-p,g=Math.min(n.width,n.height)/4,v=S<0?S-g:x<0?-x+g:0,E=f<0?f-g:_<0?-_+g:0;this.provider.panBy(v,E),this.popupPositioned.set(n.id,!0)}}else n.setCollapsed(!0),n.isCollapsed()&&(n.updateMap(!1),n.remove(),this.popupElements.delete(n.id),this.popupPositioned.delete(n.id))}}exports.MapManager=Aa;
|
package/dist/main.d.ts
CHANGED
|
@@ -34,18 +34,14 @@ declare const mapConfigurationSchema: z.ZodObject<{
|
|
|
34
34
|
} | undefined;
|
|
35
35
|
}>>;
|
|
36
36
|
states: z.ZodOptional<z.ZodObject<{
|
|
37
|
-
|
|
37
|
+
url: z.ZodString;
|
|
38
|
+
key: z.ZodString;
|
|
38
39
|
}, "strip", z.ZodTypeAny, {
|
|
39
|
-
|
|
40
|
+
url: string;
|
|
41
|
+
key: string;
|
|
40
42
|
}, {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
log: z.ZodOptional<z.ZodObject<{
|
|
44
|
-
api: z.ZodOptional<z.ZodString>;
|
|
45
|
-
}, "strip", z.ZodTypeAny, {
|
|
46
|
-
api?: string | undefined;
|
|
47
|
-
}, {
|
|
48
|
-
api?: string | undefined;
|
|
43
|
+
url: string;
|
|
44
|
+
key: string;
|
|
49
45
|
}>>;
|
|
50
46
|
}, "strip", z.ZodTypeAny, {
|
|
51
47
|
pin?: {
|
|
@@ -59,10 +55,8 @@ declare const mapConfigurationSchema: z.ZodObject<{
|
|
|
59
55
|
} | undefined;
|
|
60
56
|
} | undefined;
|
|
61
57
|
states?: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
log?: {
|
|
65
|
-
api?: string | undefined;
|
|
58
|
+
url: string;
|
|
59
|
+
key: string;
|
|
66
60
|
} | undefined;
|
|
67
61
|
}, {
|
|
68
62
|
pin?: {
|
|
@@ -76,25 +70,22 @@ declare const mapConfigurationSchema: z.ZodObject<{
|
|
|
76
70
|
} | undefined;
|
|
77
71
|
} | undefined;
|
|
78
72
|
states?: {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
log?: {
|
|
82
|
-
api?: string | undefined;
|
|
73
|
+
url: string;
|
|
74
|
+
key: string;
|
|
83
75
|
} | undefined;
|
|
84
76
|
}>;
|
|
85
77
|
|
|
86
78
|
export declare class MapManager {
|
|
87
|
-
private key;
|
|
88
79
|
private provider;
|
|
89
|
-
private
|
|
90
|
-
private
|
|
80
|
+
private statesApiUrl;
|
|
81
|
+
private statesApiKey;
|
|
91
82
|
private markerDataArray;
|
|
92
83
|
private markerDataMap;
|
|
93
84
|
private markerDataUpdating;
|
|
94
85
|
private markerPinProcessor;
|
|
95
86
|
private markerTooltipProcessor;
|
|
96
87
|
private markerPopupProcessor;
|
|
97
|
-
constructor(
|
|
88
|
+
constructor(mapProvider: MapProvider, mapConfiguration?: MapConfiguration);
|
|
98
89
|
set configuration(configuration: MapConfiguration | undefined);
|
|
99
90
|
updateMarkers(markers: MapMarker[]): Promise<void>;
|
|
100
91
|
removeMarkers(): void;
|
|
@@ -104,7 +95,6 @@ export declare class MapManager {
|
|
|
104
95
|
private removeMarkerData;
|
|
105
96
|
private processMarkerDataCallback;
|
|
106
97
|
private processMarkerData;
|
|
107
|
-
private log;
|
|
108
98
|
}
|
|
109
99
|
|
|
110
100
|
export declare type MapMarker = z.infer<typeof mapMarkerSchema>;
|