@arenarium/maps 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const un=!1;var fn=Array.isArray,cr=Array.prototype.indexOf,hr=Array.from,vt=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,pr=Object.prototype,dr=Array.prototype,vr=Object.getPrototypeOf,Kt=Object.isExtensible;function mr(t){for(var e=0;e<t.length;e++)t[e]()}function yr(){var t,e,n=new Promise((r,i)=>{t=r,e=i});return{promise:n,resolve:t,reject:e}}const F=2,Pt=4,cn=8,De=16,ae=32,me=64,St=128,U=256,tt=512,T=1024,V=2048,le=4096,xe=8192,Ce=16384,At=32768,hn=65536,Jt=1<<17,gr=1<<18,Te=1<<19,_r=1<<20,mt=1<<21,Dt=1<<22,pe=1<<23,Qe=Symbol("$state"),Ct=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function wr(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function br(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Er(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function kr(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Mr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xr(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Pr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Sr(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Ar(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Dr=2,M=Symbol();function Cr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function pn(t){return t===this.v}let Tr=!1,q=null;function Pe(t){q=t}function Tt(t,e=!1,n){q={p:q,c:null,e:null,s:t,x:null,l:null}}function Lt(t){var e=q,n=e.e;if(n!==null){e.e=null;for(var r of n)Pn(r)}return t!==void 0&&(e.x=t),q=e.p,t??{}}function dn(){return!0}let we=[];function Lr(){var t=we;we=[],mr(t)}function ot(t){if(we.length===0){var e=we;queueMicrotask(()=>{e===we&&Lr()})}we.push(t)}const Ir=new WeakMap;function vn(t){var e=m;if(e===null)return v.f|=pe,t;if((e.f&At)===0){if((e.f&St)===0)throw!e.parent&&t instanceof Error&&mn(t),t;e.b.error(t)}else Se(t,e)}function Se(t,e){for(;e!==null;){if((e.f&St)!==0)try{e.b.error(t);return}catch(n){t=n}e=e.parent}throw t instanceof Error&&mn(t),t}function mn(t){const e=Ir.get(t);e&&(vt(t,"message",{value:e.message}),vt(t,"stack",{value:e.stack}))}const ht=new Set;let S=null,yt=new Set,Ue=[],It=null,gt=!1;class ee{current=new Map;#e=new Map;#t=new Set;#a=0;#r=null;#c=!1;#o=[];#i=[];#n=[];#s=[];#l=[];#h=[];#f=[];skipped_effects=new Set;process(e){Ue=[];for(const i of e)this.#p(i);if(this.#o.length===0&&this.#a===0){this.#d();var n=this.#n,r=this.#s;this.#n=[],this.#s=[],this.#l=[],S=null,Qt(n),Qt(r),S===null?S=this:ht.delete(this),this.#r?.resolve()}else this.#u(this.#n),this.#u(this.#s),this.#u(this.#l);for(const i of this.#o)Me(i);for(const i of this.#i)Me(i);this.#o=[],this.#i=[]}#p(e){e.f^=T;for(var n=e.first;n!==null;){var r=n.f,i=(r&(ae|me))!==0,s=i&&(r&T)!==0,o=s||(r&xe)!==0||this.skipped_effects.has(n);if(!o&&n.fn!==null){if(i)n.f^=T;else if((r&Pt)!==0)this.#s.push(n);else if((r&T)===0)if((r&Dt)!==0){var a=n.b?.is_pending()?this.#i:this.#o;a.push(n)}else lt(n)&&((n.f&De)!==0&&this.#l.push(n),Me(n));var l=n.first;if(l!==null){n=l;continue}}var u=n.parent;for(n=n.next;n===null&&u!==null;)n=u.next,u=u.parent}}#u(e){for(const n of e)((n.f&V)!==0?this.#h:this.#f).push(n),Z(n,T);e.length=0}capture(e,n){this.#e.has(e)||this.#e.set(e,n),this.current.set(e,e.v)}activate(){S=this}deactivate(){S=null;for(const e of yt)if(yt.delete(e),e(),S!==null)break}neuter(){this.#c=!0}flush(){Ue.length>0?Or():this.#d(),S===this&&(this.#a===0&&ht.delete(this),this.deactivate())}#d(){if(!this.#c)for(const e of this.#t)e();this.#t.clear()}increment(){this.#a+=1}decrement(){if(this.#a-=1,this.#a===0){for(const e of this.#h)Z(e,V),Ze(e);for(const e of this.#f)Z(e,le),Ze(e);this.#n=[],this.#s=[],this.flush()}else this.deactivate()}add_callback(e){this.#t.add(e)}settled(){return(this.#r??=yr()).promise}static ensure(){if(S===null){const e=S=new ee;ht.add(S),ee.enqueue(()=>{S===e&&e.flush()})}return S}static enqueue(e){ot(e)}}function Or(){var t=ke;gt=!0;try{var e=0;for(en(!0);Ue.length>0;){var n=ee.ensure();if(e++>1e3){var r,i;Fr()}n.process(Ue),oe.clear()}}finally{gt=!1,en(t),It=null}}function Fr(){try{Mr()}catch(t){Se(t,It)}}let he=null;function Qt(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(Ce|xe))===0&&lt(r)&&(he=[],Me(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null&&r.ac===null?Cn(r):r.fn=null),he?.length>0)){oe.clear();for(const i of he)Me(i);he=[]}}he=null}}function Ze(t){for(var e=It=t;e.parent!==null;){e=e.parent;var n=e.f;if(gt&&e===m&&(n&De)!==0)return;if((n&(me|ae))!==0){if((n&T)===0)return;e.f^=T}}Ue.push(e)}function Rr(t){let e=0,n=at(0),r;return()=>{Jr()&&(_(n),Rt(()=>(e===0&&(r=Nn(()=>t(()=>Re(n)))),e+=1,()=>{ot(()=>{e-=1,e===0&&(r?.(),r=void 0,Re(n))})})))}}var Nr=hn|Te|St;function jr(t,e,n){new zr(t,e,n)}class zr{parent;#e=!1;#t;#a=null;#r;#c;#o;#i=null;#n=null;#s=null;#l=null;#h=0;#f=0;#p=!1;#u=null;#d=()=>{this.#u&&nt(this.#u,this.#h)};#g=Rr(()=>(this.#u=at(this.#h),()=>{this.#u=null}));constructor(e,n,r){this.#t=e,this.#r=n,this.#c=r,this.parent=m.b,this.#e=!!this.#r.pending,this.#o=ti(()=>{m.b=this;{try{this.#i=ce(()=>r(this.#t))}catch(i){this.error(i)}this.#f>0?this.#m():this.#e=!1}},Nr)}#_(){try{this.#i=ce(()=>this.#c(this.#t))}catch(e){this.error(e)}this.#e=!1}#w(){const e=this.#r.pending;e&&(this.#n=ce(()=>e(this.#t)),ee.enqueue(()=>{this.#i=this.#v(()=>(ee.ensure(),ce(()=>this.#c(this.#t)))),this.#f>0?this.#m():($e(this.#n,()=>{this.#n=null}),this.#e=!1)}))}is_pending(){return this.#e||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#r.pending}#v(e){var n=m,r=v,i=q;Q(this.#o),L(this.#o),Pe(this.#o.ctx);try{return e()}catch(s){return vn(s),null}finally{Q(n),L(r),Pe(i)}}#m(){const e=this.#r.pending;this.#i!==null&&(this.#l=document.createDocumentFragment(),Br(this.#i,this.#l)),this.#n===null&&(this.#n=ce(()=>e(this.#t)))}#y(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(e);return}this.#f+=e,this.#f===0&&(this.#e=!1,this.#n&&$e(this.#n,()=>{this.#n=null}),this.#l&&(this.#t.before(this.#l),this.#l=null))}update_pending_count(e){this.#y(e),this.#h+=e,yt.add(this.#d)}get_effect_pending(){return this.#g(),_(this.#u)}error(e){var n=this.#r.onerror;let r=this.#r.failed;if(this.#p||!n&&!r)throw e;this.#i&&(J(this.#i),this.#i=null),this.#n&&(J(this.#n),this.#n=null),this.#s&&(J(this.#s),this.#s=null);var i=!1,s=!1;const o=()=>{if(i){Cr();return}i=!0,s&&Ar(),ee.ensure(),this.#h=0,this.#s!==null&&$e(this.#s,()=>{this.#s=null}),this.#e=this.has_pending_snippet(),this.#i=this.#v(()=>(this.#p=!1,ce(()=>this.#c(this.#t)))),this.#f>0?this.#m():this.#e=!1};var a=v;try{L(null),s=!0,n?.(e,o),s=!1}catch(l){Se(l,this.#o&&this.#o.parent)}finally{L(a)}r&&ot(()=>{this.#s=this.#v(()=>{this.#p=!0;try{return ce(()=>{r(this.#t,()=>e,()=>o)})}catch(l){return Se(l,this.#o.parent),null}finally{this.#p=!1}})})}}function Br(t,e){for(var n=t.nodes_start,r=t.nodes_end;n!==null;){var i=n===r?null:Ft(n);e.append(n),n=i}}function Ur(t,e,n){const r=qr;if(e.length===0){n(t.map(r));return}var i=S,s=m,o=Zr();Promise.all(e.map(a=>Hr(a))).then(a=>{i?.activate(),o();try{n([...t.map(r),...a])}catch(l){(s.f&Ce)===0&&Se(l,s)}i?.deactivate(),yn()}).catch(a=>{Se(a,s)})}function Zr(){var t=m,e=v,n=q,r=S;return function(){Q(t),L(e),Pe(n),r?.activate()}}function yn(){Q(null),L(null),Pe(null)}function qr(t){var e=F|V,n=v!==null&&(v.f&F)!==0?v:null;return m===null||n!==null&&(n.f&U)!==0?e|=U:m.f|=Te,{ctx:q,deps:null,effects:null,equals:pn,f:e,fn:t,reactions:null,rv:0,v:M,wv:0,parent:n??m,ac:null}}function Hr(t,e){let n=m;n===null&&wr();var r=n.b,i=void 0,s=at(M),o=null,a=!v;return ei(()=>{try{var l=t();o&&Promise.resolve(l).catch(()=>{})}catch(c){l=Promise.reject(c)}var u=()=>l;i=o?.then(u,u)??Promise.resolve(l),o=i;var f=S,h=r.is_pending();a&&(r.update_pending_count(1),h||f.increment());const p=(c,d=void 0)=>{o=null,h||f.activate(),d?d!==Ct&&(s.f|=pe,nt(s,d)):((s.f&pe)!==0&&(s.f^=pe),nt(s,c)),a&&(r.update_pending_count(-1),h||f.decrement()),yn()};if(i.then(p,c=>p(null,c||"unknown")),f)return()=>{queueMicrotask(()=>f.neuter())}}),new Promise(l=>{function u(f){function h(){f===i?l(s):u(i)}f.then(h,h)}u(i)})}function gn(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)J(e[n])}}function Yr(t){for(var e=t.parent;e!==null;){if((e.f&F)===0)return e;e=e.parent}return null}function Ot(t){var e,n=m;Q(Yr(t));try{gn(t),e=Fn(t)}finally{Q(n)}return e}function _n(t){var e=Ot(t);if(t.equals(e)||(t.v=e,t.wv=In()),!Le){var n=(se||(t.f&U)!==0)&&t.deps!==null?le:T;Z(t,n)}}const oe=new Map;function at(t,e){var n={f:0,v:t,reactions:null,equals:pn,rv:0,wv:0};return n}function A(t,e){const n=at(t);return si(n),n}function x(t,e,n=!1){v!==null&&(!Y||(v.f&Jt)!==0)&&dn()&&(v.f&(F|De|Dt|Jt))!==0&&!te?.includes(t)&&Sr();let r=n?Oe(e):e;return nt(t,r)}function nt(t,e){if(!t.equals(e)){var n=t.v;Le?oe.set(t,e):oe.set(t,n),t.v=e;var r=ee.ensure();r.capture(t,n),(t.f&F)!==0&&((t.f&V)!==0&&Ot(t),Z(t,(t.f&U)===0?T:le)),t.wv=In(),wn(t,V),m!==null&&(m.f&T)!==0&&(m.f&(ae|me))===0&&(N===null?oi([t]):N.push(t))}return e}function Re(t){x(t,t.v+1)}function wn(t,e){var n=t.reactions;if(n!==null)for(var r=n.length,i=0;i<r;i++){var s=n[i],o=s.f,a=(o&V)===0;a&&Z(s,e),(o&F)!==0?wn(s,le):a&&((o&De)!==0&&he!==null&&he.push(s),Ze(s))}}function Oe(t){if(typeof t!="object"||t===null||Qe in t)return t;const e=vr(t);if(e!==pr&&e!==dr)return t;var n=new Map,r=fn(t),i=A(0),s=de,o=a=>{if(de===s)return a();var l=v,u=de;L(null),nn(s);var f=a();return L(l),nn(u),f};return r&&n.set("length",A(t.length)),new Proxy(t,{defineProperty(a,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&xr();var f=n.get(l);return f===void 0?f=o(()=>{var h=A(u.value);return n.set(l,h),h}):x(f,u.value,!0),!0},deleteProperty(a,l){var u=n.get(l);if(u===void 0){if(l in a){const f=o(()=>A(M));n.set(l,f),Re(i)}}else x(u,M),Re(i);return!0},get(a,l,u){if(l===Qe)return t;var f=n.get(l),h=l in a;if(f===void 0&&(!h||Fe(a,l)?.writable)&&(f=o(()=>{var c=Oe(h?a[l]:M),d=A(c);return d}),n.set(l,f)),f!==void 0){var p=_(f);return p===M?void 0:p}return Reflect.get(a,l,u)},getOwnPropertyDescriptor(a,l){var u=Reflect.getOwnPropertyDescriptor(a,l);if(u&&"value"in u){var f=n.get(l);f&&(u.value=_(f))}else if(u===void 0){var h=n.get(l),p=h?.v;if(h!==void 0&&p!==M)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return u},has(a,l){if(l===Qe)return!0;var u=n.get(l),f=u!==void 0&&u.v!==M||Reflect.has(a,l);if(u!==void 0||m!==null&&(!f||Fe(a,l)?.writable)){u===void 0&&(u=o(()=>{var p=f?Oe(a[l]):M,c=A(p);return c}),n.set(l,u));var h=_(u);if(h===M)return!1}return f},set(a,l,u,f){var h=n.get(l),p=l in a;if(r&&l==="length")for(var c=u;c<h.v;c+=1){var d=n.get(c+"");d!==void 0?x(d,M):c in a&&(d=o(()=>A(M)),n.set(c+"",d))}if(h===void 0)(!p||Fe(a,l)?.writable)&&(h=o(()=>A(void 0)),x(h,Oe(u)),n.set(l,h));else{p=h.v!==M;var k=o(()=>Oe(u));x(h,k)}var I=Reflect.getOwnPropertyDescriptor(a,l);if(I?.set&&I.set.call(f,u),!p){if(r&&typeof l=="string"){var X=n.get("length"),w=Number(l);Number.isInteger(w)&&w>=X.v&&x(X,w+1)}Re(i)}return!0},ownKeys(a){_(i);var l=Reflect.ownKeys(a).filter(h=>{var p=n.get(h);return p===void 0||p.v!==M});for(var[u,f]of n)f.v!==M&&!(u in a)&&l.push(u);return l},setPrototypeOf(){Pr()}})}var $t,bn,En,kn;function Vr(){if($t===void 0){$t=window,bn=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;En=Fe(e,"firstChild").get,kn=Fe(e,"nextSibling").get,Kt(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Kt(n)&&(n.__t=void 0)}}function Xr(t=""){return document.createTextNode(t)}function Mn(t){return En.call(t)}function Ft(t){return kn.call(t)}function _t(t,e){return Mn(t)}function Wr(t,e=1,n=!1){let r=t;for(;e--;)r=Ft(r);return r}function xn(t){var e=v,n=m;L(null),Q(null);try{return t()}finally{L(e),Q(n)}}function Gr(t){m===null&&v===null&&kr(),v!==null&&(v.f&U)!==0&&m===null&&Er(),Le&&br()}function Kr(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function ue(t,e,n,r=!0){var i=m;i!==null&&(i.f&xe)!==0&&(t|=xe);var s={ctx:q,deps:null,nodes_start:null,nodes_end:null,f:t|V,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{Me(s),s.f|=At}catch(l){throw J(s),l}else e!==null&&Ze(s);if(r){var o=s;if(n&&o.deps===null&&o.teardown===null&&o.nodes_start===null&&o.first===o.last&&(o.f&Te)===0&&(o=o.first),o!==null&&(o.parent=i,i!==null&&Kr(o,i),v!==null&&(v.f&F)!==0&&(t&me)===0)){var a=v;(a.effects??=[]).push(o)}}return s}function Jr(){return v!==null&&!Y}function W(t){Gr();var e=m.f,n=!v&&(e&ae)!==0&&(e&At)===0;if(n){var r=q;(r.e??=[]).push(t)}else return Pn(t)}function Pn(t){return ue(Pt|_r,t,!1)}function Qr(t){ee.ensure();const e=ue(me|Te,t,!0);return(n={})=>new Promise(r=>{n.outro?$e(e,()=>{J(e),r(void 0)}):(J(e),r(void 0))})}function $r(t){return ue(Pt,t,!1)}function ei(t){return ue(Dt|Te,t,!0)}function Rt(t,e=0){return ue(cn|e,t,!0)}function Sn(t,e=[],n=[]){Ur(e,n,r=>{ue(cn,()=>t(...r.map(_)),!0)})}function ti(t,e=0){var n=ue(De|e,t,!0);return n}function ce(t,e=!0){return ue(ae|Te,t,!0,e)}function An(t){var e=t.teardown;if(e!==null){const n=Le,r=v;tn(!0),L(null);try{e.call(null)}finally{tn(n),L(r)}}}function Dn(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&xn(()=>{i.abort(Ct)});var r=n.next;(n.f&me)!==0?n.parent=null:J(n,e),n=r}}function ni(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&ae)===0&&J(e),e=n}}function J(t,e=!0){var n=!1;(e||(t.f&gr)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(ri(t.nodes_start,t.nodes_end),n=!0),Dn(t,e&&!n),rt(t,0),Z(t,Ce);var r=t.transitions;if(r!==null)for(const s of r)s.stop();An(t);var i=t.parent;i!==null&&i.first!==null&&Cn(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function ri(t,e){for(;t!==null;){var n=t===e?null:Ft(t);t.remove(),t=n}}function Cn(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function $e(t,e){var n=[];Tn(t,n,!0),ii(n,()=>{J(t),e&&e()})}function ii(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var i of t)i.out(r)}else e()}function Tn(t,e,n){if((t.f&xe)===0){if(t.f^=xe,t.transitions!==null)for(const o of t.transitions)(o.is_global||n)&&e.push(o);for(var r=t.first;r!==null;){var i=r.next,s=(r.f&hn)!==0||(r.f&ae)!==0;Tn(r,e,s?n:!1),r=i}}}let ke=!1;function en(t){ke=t}let Le=!1;function tn(t){Le=t}let v=null,Y=!1;function L(t){v=t}let m=null;function Q(t){m=t}let te=null;function si(t){v!==null&&(te===null?te=[t]:te.push(t))}let D=null,O=0,N=null;function oi(t){N=t}let Ln=1,qe=0,de=qe;function nn(t){de=t}let se=!1;function In(){return++Ln}function lt(t){var e=t.f;if((e&V)!==0)return!0;if((e&le)!==0){var n=t.deps,r=(e&U)!==0;if(n!==null){var i,s,o=(e&tt)!==0,a=r&&m!==null&&!se,l=n.length;if((o||a)&&(m===null||(m.f&Ce)===0)){var u=t,f=u.parent;for(i=0;i<l;i++)s=n[i],(o||!s?.reactions?.includes(u))&&(s.reactions??=[]).push(u);o&&(u.f^=tt),a&&f!==null&&(f.f&U)===0&&(u.f^=U)}for(i=0;i<l;i++)if(s=n[i],lt(s)&&_n(s),s.wv>t.wv)return!0}(!r||m!==null&&!se)&&Z(t,T)}return!1}function On(t,e,n=!0){var r=t.reactions;if(r!==null&&!te?.includes(t))for(var i=0;i<r.length;i++){var s=r[i];(s.f&F)!==0?On(s,e,!1):e===s&&(n?Z(s,V):(s.f&T)!==0&&Z(s,le),Ze(s))}}function Fn(t){var e=D,n=O,r=N,i=v,s=se,o=te,a=q,l=Y,u=de,f=t.f;D=null,O=0,N=null,se=(f&U)!==0&&(Y||!ke||v===null),v=(f&(ae|me))===0?t:null,te=null,Pe(t.ctx),Y=!1,de=++qe,t.ac!==null&&(xn(()=>{t.ac.abort(Ct)}),t.ac=null);try{t.f|=mt;var h=t.fn,p=h(),c=t.deps;if(D!==null){var d;if(rt(t,O),c!==null&&O>0)for(c.length=O+D.length,d=0;d<D.length;d++)c[O+d]=D[d];else t.deps=c=D;if(!se||(f&F)!==0&&t.reactions!==null)for(d=O;d<c.length;d++)(c[d].reactions??=[]).push(t)}else c!==null&&O<c.length&&(rt(t,O),c.length=O);if(dn()&&N!==null&&!Y&&c!==null&&(t.f&(F|le|V))===0)for(d=0;d<N.length;d++)On(N[d],t);return i!==null&&i!==t&&(qe++,N!==null&&(r===null?r=N:r.push(...N))),(t.f&pe)!==0&&(t.f^=pe),p}catch(k){return vn(k)}finally{t.f^=mt,D=e,O=n,N=r,v=i,se=s,te=o,Pe(a),Y=l,de=u}}function ai(t,e){let n=e.reactions;if(n!==null){var r=cr.call(n,t);if(r!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[r]=n[i],n.pop())}}n===null&&(e.f&F)!==0&&(D===null||!D.includes(e))&&(Z(e,le),(e.f&(U|tt))===0&&(e.f^=tt),gn(e),rt(e,0))}function rt(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)ai(t,n[r])}function Me(t){var e=t.f;if((e&Ce)===0){Z(t,T);var n=m,r=ke;m=t,ke=!0;try{(e&De)!==0?ni(t):Dn(t),An(t);var i=Fn(t);t.teardown=typeof i=="function"?i:null,t.wv=Ln;var s;un&&Tr&&(t.f&V)!==0&&t.deps}finally{ke=r,m=n}}}function _(t){var e=t.f,n=(e&F)!==0;if(v!==null&&!Y){var r=m!==null&&(m.f&Ce)!==0;if(!r&&!te?.includes(t)){var i=v.deps;if((v.f&mt)!==0)t.rv<qe&&(t.rv=qe,D===null&&i!==null&&i[O]===t?O++:D===null?D=[t]:(!se||!D.includes(t))&&D.push(t));else{(v.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[v]:s.includes(v)||s.push(v)}}}else if(n&&t.deps===null&&t.effects===null){var o=t,a=o.parent;a!==null&&(a.f&U)===0&&(o.f^=U)}if(Le){if(oe.has(t))return oe.get(t);if(n){o=t;var l=o.v;return((o.f&T)===0&&o.reactions!==null||Rn(o))&&(l=Ot(o)),oe.set(o,l),l}}else n&&(o=t,lt(o)&&_n(o));if((t.f&pe)!==0)throw t.v;return t.v}function Rn(t){if(t.v===M)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(oe.has(e)||(e.f&F)!==0&&Rn(e))return!0;return!1}function Nn(t){var e=Y;try{return Y=!0,t()}finally{Y=e}}const li=-7169;function Z(t,e){t.f=t.f&li|e}const ui=["touchstart","touchmove"];function fi(t){return ui.includes(t)}const ci=new Set,rn=new Set;let sn=null;function Ke(t){var e=this,n=e.ownerDocument,r=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;sn=t;var o=0,a=sn===t&&t.__root;if(a){var l=i.indexOf(a);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;l<=u&&(o=l)}if(s=i[o]||t.target,s!==e){vt(t,"currentTarget",{configurable:!0,get(){return s||n}});var f=v,h=m;L(null),Q(null);try{for(var p,c=[];s!==null;){var d=s.assignedSlot||s.parentNode||s.host||null;try{var k=s["__"+r];if(k!=null&&(!s.disabled||t.target===s))if(fn(k)){var[I,...X]=k;I.apply(s,[t,...X])}else k.call(s,t)}catch(w){p?c.push(w):p=w}if(t.cancelBubble||d===e||d===null)break;s=d}if(p){for(let w of c)queueMicrotask(()=>{throw w});throw p}}finally{t.__root=e,delete t.currentTarget,L(f),Q(h)}}}function hi(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function pi(t,e){var n=m;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function jn(t,e){var n=(e&Dr)!==0,r,i=!t.startsWith("<!>");return()=>{r===void 0&&(r=hi(i?t:"<!>"+t),r=Mn(r));var s=n||bn?document.importNode(r,!0):r.cloneNode(!0);return pi(s,s),s}}function zn(t,e){t!==null&&t.before(e)}function Nt(t,e){return di(t,e)}const _e=new Map;function di(t,{target:e,anchor:n,props:r={},events:i,context:s,intro:o=!0}){Vr();var a=new Set,l=h=>{for(var p=0;p<h.length;p++){var c=h[p];if(!a.has(c)){a.add(c);var d=fi(c);e.addEventListener(c,Ke,{passive:d});var k=_e.get(c);k===void 0?(document.addEventListener(c,Ke,{passive:d}),_e.set(c,1)):_e.set(c,k+1)}}};l(hr(ci)),rn.add(l);var u=void 0,f=Qr(()=>{var h=n??e.appendChild(Xr());return jr(h,{pending:()=>{}},p=>{if(s){Tt({});var c=q;c.c=s}i&&(r.$$events=i),u=t(p,r)||{},s&&Lt()}),()=>{for(var p of a){e.removeEventListener(p,Ke);var c=_e.get(p);--c===0?(document.removeEventListener(p,Ke),_e.delete(p)):_e.set(p,c)}rn.delete(l),h!==n&&h.parentNode?.removeChild(h)}});return vi.set(u,f),u}let vi=new WeakMap;function Bn(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Bn(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function mi(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Bn(t))&&(r&&(r+=" "),r+=e);return r}function Un(t){return typeof t=="object"?mi(t):t??""}function yi(t,e,n){var r=t==null?"":""+t;return e&&(r=r?r+" "+e:e),r===""?null:r}function gi(t,e){return t==null?null:String(t)}function Zn(t,e,n,r,i,s){var o=t.__className;if(o!==n||o===void 0){var a=yi(n,r);a==null?t.removeAttribute("class"):t.className=a,t.__className=n}return s}function it(t,e,n,r){var i=t.__style;if(i!==e){var s=gi(e);s==null?t.removeAttribute("style"):t.style.cssText=s,t.__style=e}return r}const _i=()=>performance.now(),G={tick:t=>requestAnimationFrame(t),now:()=>_i(),tasks:new Set};function qn(){const t=G.now();G.tasks.forEach(e=>{e.c(t)||(G.tasks.delete(e),e.f())}),G.tasks.size!==0&&G.tick(qn)}function wi(t){let e;return G.tasks.size===0&&G.tick(qn),{promise:new Promise(n=>{G.tasks.add(e={c:t,f:n})}),abort(){G.tasks.delete(e)}}}function on(t,e){return t===e||t?.[Qe]===e}function be(t={},e,n,r){return $r(()=>{var i,s;return Rt(()=>{i=s,s=[],Nn(()=>{t!==n(...s)&&(e(t,...s),i&&on(n(...i),t)&&e(null,...i))})}),()=>{ot(()=>{s&&on(n(...s),t)&&e(null,...s)})}}),t}const bi="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(bi);function Ei(t){return t}function wt(t){return-.5*(Math.cos(Math.PI*t)-1)}function ki(t){const e=Math.cos(t*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function Mi(t){return Math.sin(t*Math.PI/2)}const xi=128,Pi=0,Si=1,Ai=2;class Di{animationsStarted=!1;animationsCount=0;animationsLimit=xi;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 n=this.layers[e];if(n==null)continue;const r=n.animations;if(r!=null)for(let i=0;i<r.length;i++){const s=r[i];if(s!=null){for(const o of s.values())if(!o.executed&&(o.executed=!0,o.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,n,r,i){let s=this.layers[e];s==null&&(s=this.layers[e]={animations:new Array});let o=s.animations[n];o==null&&(o=s.animations[n]=new Map);let a={id:r,priority:n,executed:!1,function:i};o.set(r,a),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,n){for(let r=0;r<this.layers.length;r++){let i=this.layers[r];if(i==null)continue;let s=i.animations[e];if(s==null)return;let o=s.get(n);if(o==null||o.executed==!1)return;s.delete(n)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const ie=new Di;function an(t){return Object.prototype.toString.call(t)==="[object Date]"}function bt(t,e){if(t===e||t!==t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const r=e.map((i,s)=>bt(t[s],i));return i=>r.map(s=>s(i))}if(n==="object"){if(!t||!e)throw new Error("Object cannot be null");if(an(t)&&an(e)){const s=t.getTime(),a=e.getTime()-s;return l=>new Date(s+l*a)}const r=Object.keys(e),i={};return r.forEach(s=>{i[s]=bt(t[s],e[s])}),s=>{const o={};return r.forEach(a=>{o[a]=i[a](s)}),o}}if(n==="number"){const r=e-t;return i=>t+i*r}return()=>e}class jt{#e;#t;#a;#r=null;constructor(e,n={}){this.#e=A(e),this.#t=A(e),this.#a=n}static of(e,n){const r=new jt(e(),n);return Rt(()=>{r.set(e())}),r}set(e,n){x(this.#t,e);let{delay:r=0,duration:i=400,easing:s=Ei,interpolate:o=bt}={...this.#a,...n};if(i===0)return this.#r?.abort(),x(this.#e,e),Promise.resolve();const a=G.now()+r;let l,u=!1,f=this.#r;return this.#r=wi(h=>{if(h<a)return!0;if(!u){u=!0;const c=this.#e.v;l=o(c,e),typeof i=="function"&&(i=i(c,e)),f?.abort()}const p=h-a;return p>i?(x(this.#e,e),!1):(x(this.#e,l(s(p/i))),!0)}),this.#r.promise}get current(){return _(this.#e)}get target(){return _(this.#t)}set target(e){this.set(e)}}class et{value;motion;constructor(e,n){this.value=e,this.motion=new jt(e,n)}set(e,n){this.value=e,this.motion.set(e,n)}update(e){this.motion.set(this.value,e)}snap(){this.motion.set(this.value,{duration:0})}}var Ci=jn('<div><div class="body svelte-zz3jrb"></div></div>');function Ti(t,e){Tt(e,!0);let n,r;function i(){return r}let s=A(!1);function o(E){x(s,E,!0)}function a(){return _(s)}let l=A(!0),u=0,f=150;function h(E){E!=_(l)&&(x(l,E,!0),u=performance.now())}function p(){return performance.now()-u<f?d.motion.current==0:d.value==0}let c=0,d=new et(0,{easing:wt});W(()=>{_(s)==!1&&(d.snap(),ie.clear(e.priority,e.id))}),W(()=>{d.set(_(l)?0:c,{duration:75})}),W(()=>{k(d.motion.current)});function k(E){n&&ie.equeue(e.layer,e.priority,e.id,()=>{n.style.scale=E.toString(),n.style.filter=`brightness(${.25+.75*E})`,r.style.opacity=E.toString()})}function I(E){E!=c&&(c=E,d.set(E,{duration:75}))}function X(){return d.value}var w={getBody:i,setDisplayed:o,getDisplayed:a,setCollapsed:h,getCollapsed:p,setScale:I,getScale:X},fe=Ci(),ne=_t(fe);return be(ne,E=>r=E,()=>r),be(fe,E=>n=E,()=>n),Sn(()=>{Zn(fe,1,Un(["pin",_(s)&&"displayed"]),"svelte-zz3jrb"),it(fe,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px`),it(ne,`width: ${e.width-4}px; height: ${e.height-4}px; border-radius: ${e.radius-2}px`)}),zn(t,fe),Lt(w)}var Ne;(t=>{function e(n,r,i){const s=n/2,o=r/2,a=Math.sqrt(s*s+o*o),l=Math.atan(o/s)*(180/Math.PI),u=i*(Math.PI/180);return i<180?i<90?i<l?{x:0,y:a*Math.sin(u)-o}:{x:a*Math.cos(u)-s,y:0}:i<180-l?{x:a*Math.cos(u)-s,y:0}:{x:-n,y:a*Math.sin(u)-o}:i<270?i<180+l?{x:-n,y:a*Math.sin(u)-o}:{x:a*Math.cos(u)-s,y:-r}:i<360-l?{x:a*Math.cos(u)-s,y:-r}:{x:0,y:a*Math.sin(u)-o}}t.getOffsets=e})(Ne||(Ne={}));var Li=jn('<div><div class="pointer svelte-11extwn"></div> <div class="bubble svelte-11extwn"><div class="body svelte-11extwn"></div></div></div>');function Hn(t,e){Tt(e,!0);let n,r,i,s;const o=e.width+2*e.margin,a=e.height+2*e.margin,l=()=>s;W(()=>{i.style.width=`${e.margin*4}px`,i.style.height=`${e.margin*4}px`});let u=A(!0);function f(y){x(u,y,!0)}function h(){return _(u)}let p=A(!0),c=0,d=300;function k(y){y!=_(p)&&(x(p,y,!0),c=performance.now())}function I(){return performance.now()-c<d?w.motion.current==0:w.value==0}function X(){return performance.now()-c<d?w.motion.current==1:w.value==1}let w=new et(0);W(()=>{_(u)==!1&&(w.snap(),ie.clear(e.priority,e.id+"_scale"))}),W(()=>{_(p)==!0&&w.value!=0&&(ie.stacked()?w.set(0,{duration:0}):w.set(0,{duration:150,easing:ki})),_(p)==!1&&w.value!=1&&w.set(1,{duration:150,easing:Mi})}),W(()=>{fe(w.motion.current)});function fe(y){!n||!r||!i||ie.equeue(_(p)?0:e.layer,e.priority,e.id+"_scale",()=>{n.style.opacity=`${y}`,r.style.scale=`${y}`,i.style.scale=`${y}`})}let ne=NaN,E=A(!1),re=new et(-o/2,{easing:wt}),Ve=new et(-a/2,{easing:wt});W(()=>{_(u)==!1&&(re.snap(),re.snap(),ie.clear(e.priority,e.id+"_angle"))}),W(()=>{_(p)==!0&&_(E)&&(re.update({duration:75}),re.update({duration:75}))}),W(()=>{Yt(re.motion.current,Ve.motion.current)});function Yt(y,We){if(!n||!r||!i)return;const $=y+o/2,Ge=We+a/2,ye=a<o?$*a/o:$,ge=a>o?Ge*o/a:Ge,or=Math.atan2(ge,ye)/Math.PI*180-45,Wt=0,ar=30,ct=Math.sqrt(ye*ye+ge*ge),Ie=Math.min(o,a)/2,lr=Ie*Math.SQRT2,ur=(ct-Ie)/(lr-Ie),Gt=Wt+ur*(ar-Wt),fr=ct<Ie?ct/Ie:1;ie.equeue(e.layer,e.priority,e.id+"_angle",()=>{r.style.transform=`translate(${Math.round(y)}px, ${Math.round(We)}px)`,i.style.transform=`scale(${fr}) rotate(${or}deg) skew(${Gt}deg, ${Gt}deg)`})}function rr(y,We){if(_(E)==!1||We==!0){let $=Ne.getOffsets(o,a,y);re.set(Math.round($.x),{duration:0}),Ve.set(Math.round($.y),{duration:0}),Yt(re.value,Ve.value),ne=y,x(E,!0)}else if(y!=ne){let $=Math.abs(y-ne),Ge=$<180?$:360-$,ye=Math.log(Ge)*75,ge=Ne.getOffsets(o,a,y);re.set(Math.round(ge.x),{duration:ye}),Ve.set(Math.round(ge.y),{duration:ye}),ne=y}}function ir(){return Ne.getOffsets(o,a,ne)}var sr={getBody:l,setDisplayed:f,getDisplayed:h,setCollapsed:k,getCollapsed:I,getExpanded:X,setAngle:rr,getOffsets:ir},Xe=Li(),Vt=_t(Xe);be(Vt,y=>i=y,()=>i);var ft=Wr(Vt,2),Xt=_t(ft);return be(Xt,y=>s=y,()=>s),be(ft,y=>r=y,()=>r),be(Xe,y=>n=y,()=>n),Sn(()=>{Zn(Xe,1,Un(["anchor",_(u)&&"displayed"]),"svelte-11extwn"),it(ft,`margin: ${e.margin}px;`),it(Xt,`width: ${e.width}px; height: ${e.height}px; border-radius: ${e.radius}px;`)}),zn(t,Xe),Lt(sr)}var je;(t=>{async function e(r,i){const s=await fetch(r,i);if(!s.ok)throw new Error(s.statusText);return s.json()}t.get=e;async function n(r,i,s){const o=await fetch(r,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json",...s?.headers},...s});if(!o.ok)throw new Error(o.statusText);return o.json()}t.post=n})(je||(je={}));var Ee;(t=>{function e(a,l,u){return{x:r(l)*u,y:i(a)*u}}t.project=e;function n(a,l,u){return{lat:o(l/u),lng:s(a/u)}}t.unproject=n;function r(a){return(180+a)/360}function i(a){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360}function s(a){return a*360-180}function o(a){return 360/Math.PI*Math.atan(Math.exp((180-a*360)*Math.PI/180))-90}})(Ee||(Ee={}));class Yn{swLat;swLng;neLat;neLng;constructor(e,n,r,i,s){const o=r*Math.pow(2,n),a=Ee.project(e.sw.lat,e.sw.lng,o),l=Ee.project(e.ne.lat,e.ne.lng,o),u=a.x-i,f=a.y+s,h=l.x+i,p=l.y-s,c=Ee.unproject(u,f,o),d=Ee.unproject(h,p,o);this.swLat=c.lat,this.swLng=c.lng,this.neLat=d.lat,this.neLng=d.lng}contains(e,n){return this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=n&&n<=this.neLng:n<=this.neLng||this.swLng<=n:!1}}var pt;function Vn(t){return{lang:t?.lang??pt?.lang,message:t?.message,abortEarly:t?.abortEarly??pt?.abortEarly,abortPipeEarly:t?.abortPipeEarly??pt?.abortPipeEarly}}var Ii;function Oi(t){return Ii?.get(t)}var Fi;function Ri(t){return Fi?.get(t)}var Ni;function ji(t,e){return Ni?.get(t)?.get(e)}function He(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function P(t,e,n,r,i){const s=i&&"input"in i?i.input:n.value,o=i?.expected??t.expects??null,a=i?.received??He(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},u=t.kind==="schema",f=i?.message??t.message??ji(t.reference,l.lang)??(u?Ri(l.lang):null)??r.message??Oi(l.lang);f!==void 0&&(l.message=typeof f=="function"?f(l):f),u&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function R(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Vn())}}}var ut=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function j(t){return{kind:"transformation",type:"args",reference:j,async:!1,schema:t,"~run"(e,n){const r=e.value;return e.value=(...i)=>{const s=this.schema["~run"]({value:i},n);if(s.issues)throw new ut(s.issues);return r(...s.value)},e}}}function Xn(){return{kind:"transformation",type:"await",reference:Xn,async:!0,async"~run"(t){return t.value=await t.value,t}}}function Wn(t,e){return{kind:"validation",type:"check",reference:Wn,async:!1,expects:null,requirement:t,message:e,"~run"(n,r){return n.typed&&!this.requirement(n.value)&&P(this,"input",n,r),n}}}function Gn(t,e){return{kind:"validation",type:"length",reference:Gn,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(n,r){return n.typed&&n.value.length!==this.requirement&&P(this,"length",n,r,{received:`${n.value.length}`}),n}}}function Ae(t,e){return{kind:"validation",type:"max_value",reference:Ae,async:!1,expects:`<=${t instanceof Date?t.toJSON():He(t)}`,requirement:t,message:e,"~run"(n,r){return n.typed&&!(n.value<=this.requirement)&&P(this,"value",n,r,{received:n.value instanceof Date?n.value.toJSON():He(n.value)}),n}}}function zt(t,e){return{kind:"validation",type:"min_length",reference:zt,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(n,r){return n.typed&&n.value.length<this.requirement&&P(this,"length",n,r,{received:`${n.value.length}`}),n}}}function K(t,e){return{kind:"validation",type:"min_value",reference:K,async:!1,expects:`>=${t instanceof Date?t.toJSON():He(t)}`,requirement:t,message:e,"~run"(n,r){return n.typed&&!(n.value>=this.requirement)&&P(this,"value",n,r,{received:n.value instanceof Date?n.value.toJSON():He(n.value)}),n}}}function H(t){return{kind:"transformation",type:"returns",reference:H,async:!1,schema:t,"~run"(e,n){const r=e.value;return e.value=(...i)=>{const s=this.schema["~run"]({value:r(...i)},n);if(s.issues)throw new ut(s.issues);return s.value},e}}}function Kn(t){return{kind:"transformation",type:"returns",reference:Kn,async:!1,schema:t,"~run"(e,n){const r=e.value;return e.value=async(...i)=>{const s=await this.schema["~run"]({value:await r(...i)},n);if(s.issues)throw new ut(s.issues);return s.value},e}}}function zi(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function Jn(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Qn(t,e){return{kind:"schema",type:"array",reference:Qn,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return R(this)},"~run"(n,r){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let s=0;s<i.length;s++){const o=i[s],a=this.item["~run"]({value:o},r);if(a.issues){const l={type:"array",origin:"value",input:i,key:s,value:o};for(const u of a.issues)u.path?u.path.unshift(l):u.path=[l],n.issues?.push(u);if(n.issues||(n.issues=a.issues),r.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else P(this,"type",n,r);return n}}}function $n(t){return{kind:"schema",type:"boolean",reference:$n,expects:"boolean",async:!1,message:t,get"~standard"(){return R(this)},"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:P(this,"type",e,n),e}}}function er(t,e){return{kind:"schema",type:"custom",reference:er,expects:"unknown",async:!1,check:t,message:e,get"~standard"(){return R(this)},"~run"(n,r){return this.check(n.value)?n.typed=!0:P(this,"type",n,r),n}}}function z(t){return{kind:"schema",type:"function",reference:z,expects:"Function",async:!1,message:t,get"~standard"(){return R(this)},"~run"(e,n){return typeof e.value=="function"?e.typed=!0:P(this,"type",e,n),e}}}function g(t){return{kind:"schema",type:"number",reference:g,expects:"number",async:!1,message:t,get"~standard"(){return R(this)},"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:P(this,"type",e,n),e}}}function C(t,e){return{kind:"schema",type:"object",reference:C,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return R(this)},"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const s in this.entries){const o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=s in i?i[s]:Jn(o),l=o["~run"]({value:a},r);if(l.issues){const u={type:"object",origin:"value",input:i,key:s,value:a};for(const f of l.issues)f.path?f.path.unshift(u):f.path=[u],n.issues?.push(f);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[s]=l.value}else if(o.fallback!==void 0)n.value[s]=zi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(P(this,"key",n,r,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),r.abortEarly))break}}else P(this,"type",n,r);return n}}}function Et(t,e){return{kind:"schema",type:"optional",reference:Et,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return R(this)},"~run"(n,r){return n.value===void 0&&(this.default!==void 0&&(n.value=Jn(this,n,r)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function tr(t){return{kind:"schema",type:"promise",reference:tr,expects:"Promise",async:!1,message:t,get"~standard"(){return R(this)},"~run"(e,n){return e.value instanceof Promise?e.typed=!0:P(this,"type",e,n),e}}}function Ye(t){return{kind:"schema",type:"string",reference:Ye,expects:"string",async:!1,message:t,get"~standard"(){return R(this)},"~run"(e,n){return typeof e.value=="string"?e.typed=!0:P(this,"type",e,n),e}}}function B(t,e){return{kind:"schema",type:"tuple",reference:B,expects:"Array",async:!1,items:t,message:e,get"~standard"(){return R(this)},"~run"(n,r){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let s=0;s<this.items.length;s++){const o=i[s],a=this.items[s]["~run"]({value:o},r);if(a.issues){const l={type:"array",origin:"value",input:i,key:s,value:o};for(const u of a.issues)u.path?u.path.unshift(l):u.path=[l],n.issues?.push(u);if(n.issues||(n.issues=a.issues),r.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else P(this,"type",n,r);return n}}}function ze(t){return{kind:"schema",type:"void",reference:ze,expects:"void",async:!1,message:t,get"~standard"(){return R(this)},"~run"(e,n){return e.value===void 0?e.typed=!0:P(this,"type",e,n),e}}}function Je(t,e,n){const r=t["~run"]({value:e},Vn(n));if(r.issues)throw new ut(r.issues);return r.value}function b(...t){return{...t[0],pipe:t,get"~standard"(){return R(this)},"~run"(e,n){for(const r of t)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=r["~run"](e,n))}return e}}}function Bi(...t){return{...t[0],pipe:t,async:!0,get"~standard"(){return R(this)},async"~run"(e,n){for(const r of t)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=await r["~run"](e,n))}return e}}}const kt=b(g(),K(-90),Ae(90)),Mt=b(g(),K(-180),Ae(180)),Ui=C({sw:C({lat:kt,lng:Mt}),ne:C({lat:kt,lng:Mt})}),xt=er(t=>t instanceof HTMLElement,"Must be an HTMLElement"),Zi=C({mapSize:b(g(),K(1)),zoomMin:b(g(),K(0)),zoomMax:b(g(),K(0)),zoomScale:b(g(),K(1),Ae(10))}),qi=C({inserted:b(z(),j(B([])),H($n())),insert:b(z(),j(B([])),H(ze())),remove:b(z(),j(B([])),H(ze())),update:b(z(),j(B([g()])),H(ze()))}),Hi=C({getParameters:b(z(),j(B([])),H(Zi)),getContainer:b(z(),j(B([])),H(xt)),getZoom:b(z(),j(B([])),H(g())),getBounds:b(z(),j(B([])),H(Ui)),panBy:b(z(),j(B([g(),g()])),H(ze())),createMarker:b(z(),j(B([xt,kt,Mt,g()])),H(qi))}),dt=b(z(),j(B([Ye()])),Kn(Bi(tr(),Xn(),xt))),Yi=C({id:b(Ye(),zt(1)),rank:b(g(),K(0)),lat:b(g(),K(-90),Ae(90)),lng:b(g(),K(-180),Ae(180)),tooltip:C({style:b(C({width:g(),height:g(),margin:g(),radius:g()}),Wn(t=>Math.min(t.width,t.height)/t.margin>=6,"Tooltip: minimum of width or height must be greater than or equal to 6 * margin")),body:dt}),pin:Et(C({style:C({width:g(),height:g(),radius:g()}),body:dt})),popup:Et(C({style:C({width:g(),height:g(),radius:g(),margin:g()}),body:dt}))}),Vi=Qn(Yi);var ve;(t=>{t.COUNT=12,t.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],t.DEGREES_DEFAULT=270})(ve||(ve={}));const Xi=b(Ye(),Gn(32)),Wi=b(Ye(),zt(1)),ln="1.1.4",Bt="https://maps.api.arenarium.dev",Gi=`${Bt}/auth`,Ki=`${Bt}/states`,Ji=`${Bt}/log`;class Ut{apiKey;apiToken;apiDevEnvironment;mapProvider;markerDataArray=new Array;markerDataMap=new Map;markerDataUpdating=!1;markerPinProcessor;markerTooltipProcessor;markerPopupProcessor;constructor(e,n,r,i){Je(Xi,e),Je(Wi,n),Je(Hi,r),this.apiKey=e,this.apiToken=n,this.apiDevEnvironment=window?.location.host.startsWith("localhost")||window?.location.host.startsWith("127.0.0.1"),this.mapProvider=r,this.markerPinProcessor=new st(r),this.markerTooltipProcessor=new $i(r),this.markerPopupProcessor=new es(r),this.setConfiguration(i)}static async create(e,n,r){const i={key:e,version:ln};let o=(await je.post(Gi,i)).token;if(!o)throw new Error("Failed to get api token");return new Ut(e,o,n,r)}setConfiguration(e){ie.setLimit(e?.animation?.queue?.limit??8*navigator.hardwareConcurrency),this.markerPinProcessor.setConfiguration(e)}async updateMarkers(e){Je(Vi,e);try{await this.updateMarkerData(e),this.processMarkerDataCallback()}catch(n){throw console.error(n),this.removeMarkerData(),n instanceof Error&&this.log("error","Failed to update markers",n),n}}removeMarkers(){try{this.removeMarkerData()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const n of this.markerDataArray)n.marker.id==e?this.markerPopupProcessor.show(n):this.markerPopupProcessor.hide(n)}catch(n){console.error(n);for(const r of this.markerDataArray)this.markerPopupProcessor.hide(r);throw n instanceof Error&&this.log("error","Failed to show popup",n),n}}hidePopup(e){try{if(e){const n=this.markerDataMap.get(e);if(n==null)return;this.markerPopupProcessor.hide(n)}else for(const n of this.markerDataArray)this.markerPopupProcessor.hide(n)}catch(n){console.error(n);for(const r of this.markerDataArray)this.markerPopupProcessor.hide(r);throw n instanceof Error&&this.log("error","Failed to hide popup",n),n}}async updateMarkerData(e){try{let n=this.markerDataArray.map(i=>i.marker);for(let i=0;i<e.length;i++){const s=e[i];this.markerDataMap.get(s.id)||n.push(s)}const r=await this.getMarkerStates(n);try{this.markerDataUpdating=!0;for(let i=0;i<n.length;i++){const s=n[i],o=r[i],a=this.markerDataMap.get(s.id);if(a)a.update(o);else{const l=new Qi(this.mapProvider,s,o);l.create(),this.markerDataMap.set(s.id,l),this.markerDataArray.push(l)}}this.markerDataArray.sort((i,s)=>i.zoom-s.zoom),this.markerPinProcessor.updateElements(this.markerDataArray.map(i=>i.pin)),this.markerTooltipProcessor.updateElements(this.markerDataArray.map(i=>i.tooltip)),this.markerPopupProcessor.updateElements(this.markerDataArray.map(i=>i.popup).filter(i=>i!=null))}finally{this.markerDataUpdating=!1}}catch(n){throw console.error(n),this.markerDataArray.forEach(r=>r.remove()),this.markerDataArray.length=0,this.markerDataMap.clear(),n instanceof Error&&this.log("error","Failed to update marker data",n),n}finally{this.markerDataUpdating=!1}}removeMarkerData(){try{this.markerDataUpdating=!0,this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.removeElements(),this.markerDataArray.length=0,this.markerDataMap.clear()}catch(e){throw console.error(e),e instanceof Error&&this.log("error","Failed to remove marker data",e),e}finally{this.markerDataUpdating=!1}}async getMarkerStates(e){if(e.length==0)return[];if(e.length==1)return[[0,[[0,ve.DEGREES.indexOf(ve.DEGREES_DEFAULT)]]]];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})),r={key:this.apiKey,token:this.apiToken,parameters:this.mapProvider.getParameters(),input:n},i=await je.post(Ki,r,{headers:{"Cache-Control":this.apiDevEnvironment?"no-cache":""}});return i.token&&(this.apiToken=i.token),i.states}processMarkerDataCallback(){if(this.mapProvider.getContainer().parentElement!=null&&this.markerDataArray.length!=0)try{this.processMarkerData(),window.setTimeout(this.processMarkerDataCallback.bind(this),25)}catch(e){console.error(e),e instanceof Error&&this.log("error","Failed to process marker data",e)}}processMarkerData(){if(this.markerDataUpdating)return;const e=this.mapProvider.getBounds(),n=this.mapProvider.getZoom();this.markerPopupProcessor.process(),this.markerTooltipProcessor.process(e,n),this.markerPinProcessor.process(e,n)}async log(e,n,r){if(!this.apiDevEnvironment)try{const i={key:this.apiKey,title:n,level:e,content:{version:ln,...r}};await je.post(Ji,i)}catch(i){console.error(i)}}}class Qi{marker;zoom;pin;tooltip;popup;constructor(e,n,r){this.marker=n,this.zoom=r[0],this.pin=new Be(e,n,r),this.tooltip=new qt(e,n,r),n.popup&&(this.popup=new Ht(e,n))}create(){this.pin.create(),this.tooltip.create(),this.popup?.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove(),this.popup?.remove()}}class Zt{provider;id;lat;lng;shown;element;component;marker;constructor(e,n){this.provider=e,this.id=n.id,this.lat=n.lat,this.lng=n.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 n=this.marker,r=this.component;if(n==null||r==null)throw new Error("Failed to update provider marker map");e?n.inserted()==!1&&n.insert():n.inserted()==!0&&n.remove()}getZindex(){throw new Error("Get z-index not implemented")}remove(){this.marker?.remove()}}class Be extends Zt{static DEFAULT_SIZE=16;width;height;radius;zoom;bodyLoading=!1;bodyLoaded=!1;bodyCallback;constructor(e,n,r){super(e,n),this.width=n.pin?.style.width??Be.DEFAULT_SIZE,this.height=n.pin?.style.height??Be.DEFAULT_SIZE,this.radius=n.pin?.style.radius??Be.DEFAULT_SIZE,this.zoom=r[0],this.bodyCallback=n.pin?.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=Nt(Ti,{target:this.element,props:{id:this.id+"_pin",layer:Ai,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,radius:this.radius}})}update(e){this.zoom=e[0],this.updateZIndex()}updateMap(e){super.updateMap(e),this.component?.setDisplayed(e)}updateBody(){if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const e=this.component?.getBody();e!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?e.appendChild(n):console.error("Failed to load pin body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(e){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setCollapsed(e)}setScale(e){if(this.component==null)throw new Error("Failed to set pin scale");this.component.setScale(e)}getScaleFromZoomDistance(e){return this.zoom<e?1:Math.max(0,1-(this.zoom-e)*.125)}getZindex(){const e=this.provider.getParameters();return Math.round((e.zoomMax-this.zoom)*e.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}}class st{static MAP_PINS_MAX_ZOOM=2;static MAP_PINS_MAX_COUNT=128;provider;pinElements=new Array;pinMaxWidth=0;pinMaxHeight=0;pinFade=!1;pinMaxCount=0;pinMaxZoomDelta=0;constructor(e){this.provider=e}setConfiguration(e){this.pinFade=e?.pin?.fade??!0,this.pinMaxCount=e?.pin?.maxCount??Math.max(st.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=e?.pin?.maxZoom??st.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((n,r)=>Math.max(n,r.width),0),this.pinMaxHeight=e.reduce((n,r)=>Math.max(n,r.height),0)}removeElements(){this.pinElements.forEach(e=>e.remove()),this.pinElements.length=0}process(e,n){const r=this.provider.getParameters().mapSize,i=new Yn(e,n,r,this.pinMaxWidth*2,this.pinMaxHeight*2);let s=0;for(const o of this.pinElements)i.contains(o.lat,o.lng)?o.shown&&n<o.zoom&&o.zoom<n+this.pinMaxZoomDelta?(s<this.pinMaxCount&&(o.setCollapsed(!1),o.setScale(this.pinFade?o.getScaleFromZoomDistance(n):1),o.updateMap(!0),o.isBodyLoaded()==!1&&o.updateBody()),s++):(o.setCollapsed(!0),o.isCollapsed()&&o.updateMap(!1)):o.updateMap(!1)}}class qt extends Zt{static Z_INDEX_OFFSET=1e6;width;height;margin;radius;zoom;angle;states;bodyLoading=!1;bodyLoaded=!1;bodyCallback;constructor(e,n,r){super(e,n),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=r[0],this.angle=ve.DEGREES_DEFAULT,this.states=r[1].map(i=>[i[0],ve.DEGREES[i[1]]]),this.bodyCallback=n.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=Nt(Hn,{target:this.element,props:{id:this.id+"_tooltip",layer:Si,priority:this.zoom*this.provider.getParameters().zoomScale,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}update(e){this.zoom=e[0],this.states=e[1].map(n=>[n[0],ve.DEGREES[n[1]]]),this.updateZIndex()}updateMap(e){super.updateMap(e),this.component?.setDisplayed(e)}updateState(e){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(e),this.component.setAngle(this.angle)}updateBody(){if(this.bodyLoaded||this.bodyLoading)return;const e=this.component?.getBody();e!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?e.appendChild(n):console.error("Failed to load tooltip body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(e){const n=this.states.findLast(r=>r[0]<=e);if(!n)throw new Error("Angle not found");return n[1]}getZindex(){const e=this.provider.getParameters();return Math.round((e.zoomMax-this.zoom)*e.zoomScale)+qt.Z_INDEX_OFFSET}setCollapsed(e){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(e)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}}class $i{provider;tooltipElements=new Array;tooltipMaxWidth=0;tooltipMaxHeight=0;constructor(e){this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((n,r)=>Math.max(n,r.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((n,r)=>Math.max(n,r.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.remove()),this.tooltipElements.length=0}process(e,n){const r=this.provider.getParameters().mapSize,i=new Yn(e,n,r,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const s of this.tooltipElements)i.contains(s.lat,s.lng)?s.shown&&s.zoom<=n?(s.updateState(n),s.setCollapsed(!1),s.updateMap(!0),s.isCollapsed()==!1&&s.isBodyLoaded()==!1&&s.updateBody()):(s.setCollapsed(!0),s.isCollapsed()&&s.updateMap(!1)):s.updateMap(!1)}}class Ht extends Zt{static Z_INDEX_OFFSET=2e6;width;height;margin;radius;bodyLoading=!1;bodyLoaded=!1;bodyCallback;constructor(e,n){if(n.popup==null)throw new Error("Failed to create popup");super(e,n),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=Nt(Hn,{target:this.element,props:{id:this.id+"_popup",layer:Pi,priority:0,width:this.width,height:this.height,margin:this.margin,radius:this.radius}})}updateMap(e){super.updateMap(e),this.component?.setDisplayed(e)}updateBody(){if(this.bodyLoaded||this.bodyLoading)return;const e=this.component?.getBody();e!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(n=>{n instanceof HTMLElement?e.appendChild(n):console.error("Failed to load popup body")}).catch(n=>console.error(n)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return Ht.Z_INDEX_OFFSET}setCollapsed(e){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(e)}setAngle(e){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(e,!0)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}}class es{provider;popupElements=new Array;popupPositioned=new Map;constructor(e){this.provider=e}show(e){e.popup&&(e.pin.shown=!1,e.tooltip.shown=!1,this.popupPositioned.set(e.marker.id,!1),e.popup.setAngle(e.tooltip.angle),e.popup.shown=!0)}hide(e){e.popup&&(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}updateElements(e){this.popupElements=e,this.popupPositioned=new Map(e.map(n=>[n.id,!1]))}removeElements(){this.popupElements.forEach(e=>e.remove()),this.popupElements.length=0,this.popupPositioned.clear()}process(){for(const e of this.popupElements)if(e.shown){if(e.setCollapsed(!1),e.updateMap(!0),e.isExpanded()&&e.isBodyLoaded()==!1&&e.updateBody(),e.isCollapsed()==!1&&this.popupPositioned.get(e.id)==!1){const n=e.component?.getBody();if(n==null)continue;const r=e.component?.getOffsets();if(r==null)continue;const i=n.getBoundingClientRect();if(i.x==0&&i.y==0&&i.width==0&&i.height==0)continue;const s=i.x+i.width/2,o=i.y+i.height/2,a=s+r.x,l=o+r.y,u=a+e.width,f=l+e.height,h=this.provider.getContainer().getBoundingClientRect(),p=a-h.left,c=h.right-u,d=l-h.top,k=h.bottom-f,I=Math.min(e.width,e.height)/4,X=p<0?p-I:c<0?-c+I:0,w=d<0?d-I:k<0?-k+I:0;this.provider.panBy(X,w),this.popupPositioned.set(e.id,!0)}}else e.setCollapsed(!0),e.isCollapsed()&&e.updateMap(!1)}}const nr=()=>'<img src="https://arenarium.dev/favicon.svg" alt="Arenarium Maps" style="height: 1.25em; vertical-align: middle;" />',ts=()=>`<a href="https://arenarium.dev" target="_blank" style="color: inherit;">${nr()}<span>&nbsp;@arenarium/maps</span></a>`;exports.MapManager=Ut;exports.getAttributionHtml=ts;exports.getImageHtml=nr;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const kr=!1;var br=Array.isArray,xn=Array.prototype.indexOf,Pn=Array.from,xt=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,Sn=Object.prototype,An=Array.prototype,Cn=Object.getPrototypeOf,or=Object.isExtensible;function Tn(t){for(var e=0;e<t.length;e++)t[e]()}function Ln(){var t,e,r=new Promise((n,i)=>{t=n,e=i});return{promise:r,resolve:t,reject:e}}const R=2,Dt=4,Mr=8,Ie=16,fe=32,ge=64,Ft=128,q=256,ot=512,I=1024,K=2048,ce=4096,Ae=8192,Oe=16384,Rt=32768,xr=65536,ar=1<<17,In=1<<18,De=1<<19,On=1<<20,Pt=1<<21,Nt=1<<22,ve=1<<23,nt=Symbol("$state"),jt=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function Dn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Fn(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Rn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Nn(t){throw new Error("https://svelte.dev/e/effect_orphan")}function jn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function zn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Bn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Un(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Zn(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const qn=2,x=Symbol();function Hn(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Pr(t){return t===this.v}let Yn=!1,Y=null;function Ce(t){Y=t}function zt(t,e=!1,r){Y={p:Y,c:null,e:null,s:t,x:null,l:null}}function Bt(t){var e=Y,r=e.e;if(r!==null){e.e=null;for(var n of r)zr(n)}return t!==void 0&&(e.x=t),Y=e.p,t??{}}function Sr(){return!0}let Me=[];function Vn(){var t=Me;Me=[],Tn(t)}function ft(t){if(Me.length===0){var e=Me;queueMicrotask(()=>{e===Me&&Vn()})}Me.push(t)}const Xn=new WeakMap;function Ar(t){var e=m;if(e===null)return v.f|=ve,t;if((e.f&Rt)===0){if((e.f&Ft)===0)throw!e.parent&&t instanceof Error&&Cr(t),t;e.b.error(t)}else Te(t,e)}function Te(t,e){for(;e!==null;){if((e.f&Ft)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t instanceof Error&&Cr(t),t}function Cr(t){const e=Xn.get(t);e&&(xt(t,"message",{value:e.message}),xt(t,"stack",{value:e.stack}))}const Et=new Set;let A=null,St=new Set,Xe=[],Ut=null,At=!1;class ie{current=new Map;#e=new Map;#t=new Set;#a=0;#n=null;#c=!1;#o=[];#i=[];#r=[];#s=[];#l=[];#p=[];#f=[];skipped_effects=new Set;process(e){Xe=[];for(const i of e)this.#h(i);if(this.#o.length===0&&this.#a===0){this.#d();var r=this.#r,n=this.#s;this.#r=[],this.#s=[],this.#l=[],A=null,lr(r),lr(n),A===null?A=this:Et.delete(this),this.#n?.resolve()}else this.#u(this.#r),this.#u(this.#s),this.#u(this.#l);for(const i of this.#o)Se(i);for(const i of this.#i)Se(i);this.#o=[],this.#i=[]}#h(e){e.f^=I;for(var r=e.first;r!==null;){var n=r.f,i=(n&(fe|ge))!==0,s=i&&(n&I)!==0,o=s||(n&Ae)!==0||this.skipped_effects.has(r);if(!o&&r.fn!==null){if(i)r.f^=I;else if((n&Dt)!==0)this.#s.push(r);else if((n&I)===0)if((n&Nt)!==0){var l=r.b?.is_pending()?this.#i:this.#o;l.push(r)}else pt(r)&&((r.f&Ie)!==0&&this.#l.push(r),Se(r));var a=r.first;if(a!==null){r=a;continue}}var u=r.parent;for(r=r.next;r===null&&u!==null;)r=u.next,u=u.parent}}#u(e){for(const r of e)((r.f&K)!==0?this.#p:this.#f).push(r),H(r,I);e.length=0}capture(e,r){this.#e.has(e)||this.#e.set(e,r),this.current.set(e,e.v)}activate(){A=this}deactivate(){A=null;for(const e of St)if(St.delete(e),e(),A!==null)break}neuter(){this.#c=!0}flush(){Xe.length>0?Wn():this.#d(),A===this&&(this.#a===0&&Et.delete(this),this.deactivate())}#d(){if(!this.#c)for(const e of this.#t)e();this.#t.clear()}increment(){this.#a+=1}decrement(){if(this.#a-=1,this.#a===0){for(const e of this.#p)H(e,K),We(e);for(const e of this.#f)H(e,ce),We(e);this.#r=[],this.#s=[],this.flush()}else this.deactivate()}add_callback(e){this.#t.add(e)}settled(){return(this.#n??=Ln()).promise}static ensure(){if(A===null){const e=A=new ie;Et.add(A),ie.enqueue(()=>{A===e&&e.flush()})}return A}static enqueue(e){ft(e)}}function Wn(){var t=Pe;At=!0;try{var e=0;for(cr(!0);Xe.length>0;){var r=ie.ensure();if(e++>1e3){var n,i;Gn()}r.process(Xe),ue.clear()}}finally{At=!1,cr(t),Ut=null}}function Gn(){try{jn()}catch(t){Te(t,Ut)}}let de=null;function lr(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&(Oe|Ae))===0&&pt(n)&&(de=[],Se(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null&&n.ac===null?qr(n):n.fn=null),de?.length>0)){ue.clear();for(const i of de)Se(i);de=[]}}de=null}}function We(t){for(var e=Ut=t;e.parent!==null;){e=e.parent;var r=e.f;if(At&&e===m&&(r&Ie)!==0)return;if((r&(ge|fe))!==0){if((r&I)===0)return;e.f^=I}}Xe.push(e)}function Kn(t){let e=0,r=ct(0),n;return()=>{ci()&&(g(r),Ht(()=>(e===0&&(n=Kr(()=>t(()=>Ze(r)))),e+=1,()=>{ft(()=>{e-=1,e===0&&(n?.(),n=void 0,Ze(r))})})))}}var Jn=xr|De|Ft;function Qn(t,e,r){new $n(t,e,r)}class $n{parent;#e=!1;#t;#a=null;#n;#c;#o;#i=null;#r=null;#s=null;#l=null;#p=0;#f=0;#h=!1;#u=null;#d=()=>{this.#u&&at(this.#u,this.#p)};#g=Kn(()=>(this.#u=ct(this.#p),()=>{this.#u=null}));constructor(e,r,n){this.#t=e,this.#n=r,this.#c=n,this.parent=m.b,this.#e=!!this.#n.pending,this.#o=vi(()=>{m.b=this;{try{this.#i=he(()=>n(this.#t))}catch(i){this.error(i)}this.#f>0?this.#m():this.#e=!1}},Jn)}#_(){try{this.#i=he(()=>this.#c(this.#t))}catch(e){this.error(e)}this.#e=!1}#w(){const e=this.#n.pending;e&&(this.#r=he(()=>e(this.#t)),ie.enqueue(()=>{this.#i=this.#v(()=>(ie.ensure(),he(()=>this.#c(this.#t)))),this.#f>0?this.#m():(it(this.#r,()=>{this.#r=null}),this.#e=!1)}))}is_pending(){return this.#e||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#n.pending}#v(e){var r=m,n=v,i=Y;ne(this.#o),O(this.#o),Ce(this.#o.ctx);try{return e()}catch(s){return Ar(s),null}finally{ne(r),O(n),Ce(i)}}#m(){const e=this.#n.pending;this.#i!==null&&(this.#l=document.createDocumentFragment(),ei(this.#i,this.#l)),this.#r===null&&(this.#r=he(()=>e(this.#t)))}#y(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(e);return}this.#f+=e,this.#f===0&&(this.#e=!1,this.#r&&it(this.#r,()=>{this.#r=null}),this.#l&&(this.#t.before(this.#l),this.#l=null))}update_pending_count(e){this.#y(e),this.#p+=e,St.add(this.#d)}get_effect_pending(){return this.#g(),g(this.#u)}error(e){var r=this.#n.onerror;let n=this.#n.failed;if(this.#h||!r&&!n)throw e;this.#i&&(te(this.#i),this.#i=null),this.#r&&(te(this.#r),this.#r=null),this.#s&&(te(this.#s),this.#s=null);var i=!1,s=!1;const o=()=>{if(i){Hn();return}i=!0,s&&Zn(),ie.ensure(),this.#p=0,this.#s!==null&&it(this.#s,()=>{this.#s=null}),this.#e=this.has_pending_snippet(),this.#i=this.#v(()=>(this.#h=!1,he(()=>this.#c(this.#t)))),this.#f>0?this.#m():this.#e=!1};var l=v;try{O(null),s=!0,r?.(e,o),s=!1}catch(a){Te(a,this.#o&&this.#o.parent)}finally{O(l)}n&&ft(()=>{this.#s=this.#v(()=>{this.#h=!0;try{return he(()=>{n(this.#t,()=>e,()=>o)})}catch(a){return Te(a,this.#o.parent),null}finally{this.#h=!1}})})}}function ei(t,e){for(var r=t.nodes_start,n=t.nodes_end;r!==null;){var i=r===n?null:qt(r);e.append(r),r=i}}function ti(t,e,r){const n=ni;if(e.length===0){r(t.map(n));return}var i=A,s=m,o=ri();Promise.all(e.map(l=>ii(l))).then(l=>{i?.activate(),o();try{r([...t.map(n),...l])}catch(a){(s.f&Oe)===0&&Te(a,s)}i?.deactivate(),Tr()}).catch(l=>{Te(l,s)})}function ri(){var t=m,e=v,r=Y,n=A;return function(){ne(t),O(e),Ce(r),n?.activate()}}function Tr(){ne(null),O(null),Ce(null)}function ni(t){var e=R|K,r=v!==null&&(v.f&R)!==0?v:null;return m===null||r!==null&&(r.f&q)!==0?e|=q:m.f|=De,{ctx:Y,deps:null,effects:null,equals:Pr,f:e,fn:t,reactions:null,rv:0,v:x,wv:0,parent:r??m,ac:null}}function ii(t,e){let r=m;r===null&&Dn();var n=r.b,i=void 0,s=ct(x),o=null,l=!v;return di(()=>{try{var a=t();o&&Promise.resolve(a).catch(()=>{})}catch(c){a=Promise.reject(c)}var u=()=>a;i=o?.then(u,u)??Promise.resolve(a),o=i;var f=A,h=n.is_pending();l&&(n.update_pending_count(1),h||f.increment());const p=(c,d=void 0)=>{o=null,h||f.activate(),d?d!==jt&&(s.f|=ve,at(s,d)):((s.f&ve)!==0&&(s.f^=ve),at(s,c)),l&&(n.update_pending_count(-1),h||f.decrement()),Tr()};if(i.then(p,c=>p(null,c||"unknown")),f)return()=>{queueMicrotask(()=>f.neuter())}}),new Promise(a=>{function u(f){function h(){f===i?a(s):u(i)}f.then(h,h)}u(i)})}function Lr(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)te(e[r])}}function si(t){for(var e=t.parent;e!==null;){if((e.f&R)===0)return e;e=e.parent}return null}function Zt(t){var e,r=m;ne(si(t));try{Lr(t),e=Wr(t)}finally{ne(r)}return e}function Ir(t){var e=Zt(t);if(t.equals(e)||(t.v=e,t.wv=Vr()),!Fe){var r=(le||(t.f&q)!==0)&&t.deps!==null?ce:I;H(t,r)}}const ue=new Map;function ct(t,e){var r={f:0,v:t,reactions:null,equals:Pr,rv:0,wv:0};return r}function C(t,e){const r=ct(t);return _i(r),r}function P(t,e,r=!1){v!==null&&(!G||(v.f&ar)!==0)&&Sr()&&(v.f&(R|Ie|Nt|ar))!==0&&!se?.includes(t)&&Un();let n=r?je(e):e;return at(t,n)}function at(t,e){if(!t.equals(e)){var r=t.v;Fe?ue.set(t,e):ue.set(t,r),t.v=e;var n=ie.ensure();n.capture(t,r),(t.f&R)!==0&&((t.f&K)!==0&&Zt(t),H(t,(t.f&q)===0?I:ce)),t.wv=Vr(),Or(t,K),m!==null&&(m.f&I)!==0&&(m.f&(fe|ge))===0&&(j===null?wi([t]):j.push(t))}return e}function Ze(t){P(t,t.v+1)}function Or(t,e){var r=t.reactions;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i],o=s.f,l=(o&K)===0;l&&H(s,e),(o&R)!==0?Or(s,ce):l&&((o&Ie)!==0&&de!==null&&de.push(s),We(s))}}function je(t){if(typeof t!="object"||t===null||nt in t)return t;const e=Cn(t);if(e!==Sn&&e!==An)return t;var r=new Map,n=br(t),i=C(0),s=me,o=l=>{if(me===s)return l();var a=v,u=me;O(null),hr(s);var f=l();return O(a),hr(u),f};return n&&r.set("length",C(t.length)),new Proxy(t,{defineProperty(l,a,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&zn();var f=r.get(a);return f===void 0?f=o(()=>{var h=C(u.value);return r.set(a,h),h}):P(f,u.value,!0),!0},deleteProperty(l,a){var u=r.get(a);if(u===void 0){if(a in l){const f=o(()=>C(x));r.set(a,f),Ze(i)}}else P(u,x),Ze(i);return!0},get(l,a,u){if(a===nt)return t;var f=r.get(a),h=a in l;if(f===void 0&&(!h||Ue(l,a)?.writable)&&(f=o(()=>{var c=je(h?l[a]:x),d=C(c);return d}),r.set(a,f)),f!==void 0){var p=g(f);return p===x?void 0:p}return Reflect.get(l,a,u)},getOwnPropertyDescriptor(l,a){var u=Reflect.getOwnPropertyDescriptor(l,a);if(u&&"value"in u){var f=r.get(a);f&&(u.value=g(f))}else if(u===void 0){var h=r.get(a),p=h?.v;if(h!==void 0&&p!==x)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return u},has(l,a){if(a===nt)return!0;var u=r.get(a),f=u!==void 0&&u.v!==x||Reflect.has(l,a);if(u!==void 0||m!==null&&(!f||Ue(l,a)?.writable)){u===void 0&&(u=o(()=>{var p=f?je(l[a]):x,c=C(p);return c}),r.set(a,u));var h=g(u);if(h===x)return!1}return f},set(l,a,u,f){var h=r.get(a),p=a in l;if(n&&a==="length")for(var c=u;c<h.v;c+=1){var d=r.get(c+"");d!==void 0?P(d,x):c in l&&(d=o(()=>C(x)),r.set(c+"",d))}if(h===void 0)(!p||Ue(l,a)?.writable)&&(h=o(()=>C(void 0)),P(h,je(u)),r.set(a,h));else{p=h.v!==x;var w=o(()=>je(u));P(h,w)}var D=Reflect.getOwnPropertyDescriptor(l,a);if(D?.set&&D.set.call(f,u),!p){if(n&&typeof a=="string"){var J=r.get("length"),b=Number(a);Number.isInteger(b)&&b>=J.v&&P(J,b+1)}Ze(i)}return!0},ownKeys(l){g(i);var a=Reflect.ownKeys(l).filter(h=>{var p=r.get(h);return p===void 0||p.v!==x});for(var[u,f]of r)f.v!==x&&!(u in l)&&a.push(u);return a},setPrototypeOf(){Bn()}})}var ur,Dr,Fr,Rr;function oi(){if(ur===void 0){ur=window,Dr=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Fr=Ue(e,"firstChild").get,Rr=Ue(e,"nextSibling").get,or(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),or(r)&&(r.__t=void 0)}}function ai(t=""){return document.createTextNode(t)}function Nr(t){return Fr.call(t)}function qt(t){return Rr.call(t)}function fr(t,e){return Nr(t)}function li(t,e=1,r=!1){let n=t;for(;e--;)n=qt(n);return n}function jr(t){var e=v,r=m;O(null),ne(null);try{return t()}finally{O(e),ne(r)}}function ui(t){m===null&&v===null&&Nn(),v!==null&&(v.f&q)!==0&&m===null&&Rn(),Fe&&Fn()}function fi(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function pe(t,e,r,n=!0){var i=m;i!==null&&(i.f&Ae)!==0&&(t|=Ae);var s={ctx:Y,deps:null,nodes_start:null,nodes_end:null,f:t|K,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{Se(s),s.f|=Rt}catch(a){throw te(s),a}else e!==null&&We(s);if(n){var o=s;if(r&&o.deps===null&&o.teardown===null&&o.nodes_start===null&&o.first===o.last&&(o.f&De)===0&&(o=o.first),o!==null&&(o.parent=i,i!==null&&fi(o,i),v!==null&&(v.f&R)!==0&&(t&ge)===0)){var l=v;(l.effects??=[]).push(o)}}return s}function ci(){return v!==null&&!G}function Q(t){ui();var e=m.f,r=!v&&(e&fe)!==0&&(e&Rt)===0;if(r){var n=Y;(n.e??=[]).push(t)}else return zr(t)}function zr(t){return pe(Dt|On,t,!1)}function pi(t){ie.ensure();const e=pe(ge|De,t,!0);return(r={})=>new Promise(n=>{r.outro?it(e,()=>{te(e),n(void 0)}):(te(e),n(void 0))})}function hi(t){return pe(Dt,t,!1)}function di(t){return pe(Nt|De,t,!0)}function Ht(t,e=0){return pe(Mr|e,t,!0)}function Br(t,e=[],r=[]){ti(e,r,n=>{pe(Mr,()=>t(...n.map(g)),!0)})}function vi(t,e=0){var r=pe(Ie|e,t,!0);return r}function he(t,e=!0){return pe(fe|De,t,!0,e)}function Ur(t){var e=t.teardown;if(e!==null){const r=Fe,n=v;pr(!0),O(null);try{e.call(null)}finally{pr(r),O(n)}}}function Zr(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const i=r.ac;i!==null&&jr(()=>{i.abort(jt)});var n=r.next;(r.f&ge)!==0?r.parent=null:te(r,e),r=n}}function mi(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&fe)===0&&te(e),e=r}}function te(t,e=!0){var r=!1;(e||(t.f&In)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(yi(t.nodes_start,t.nodes_end),r=!0),Zr(t,e&&!r),lt(t,0),H(t,Oe);var n=t.transitions;if(n!==null)for(const s of n)s.stop();Ur(t);var i=t.parent;i!==null&&i.first!==null&&qr(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function yi(t,e){for(;t!==null;){var r=t===e?null:qt(t);t.remove(),t=r}}function qr(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function it(t,e){var r=[];Hr(t,r,!0),gi(r,()=>{te(t),e&&e()})}function gi(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var i of t)i.out(n)}else e()}function Hr(t,e,r){if((t.f&Ae)===0){if(t.f^=Ae,t.transitions!==null)for(const o of t.transitions)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var i=n.next,s=(n.f&xr)!==0||(n.f&fe)!==0;Hr(n,e,s?r:!1),n=i}}}let Pe=!1;function cr(t){Pe=t}let Fe=!1;function pr(t){Fe=t}let v=null,G=!1;function O(t){v=t}let m=null;function ne(t){m=t}let se=null;function _i(t){v!==null&&(se===null?se=[t]:se.push(t))}let T=null,F=0,j=null;function wi(t){j=t}let Yr=1,Ge=0,me=Ge;function hr(t){me=t}let le=!1;function Vr(){return++Yr}function pt(t){var e=t.f;if((e&K)!==0)return!0;if((e&ce)!==0){var r=t.deps,n=(e&q)!==0;if(r!==null){var i,s,o=(e&ot)!==0,l=n&&m!==null&&!le,a=r.length;if((o||l)&&(m===null||(m.f&Oe)===0)){var u=t,f=u.parent;for(i=0;i<a;i++)s=r[i],(o||!s?.reactions?.includes(u))&&(s.reactions??=[]).push(u);o&&(u.f^=ot),l&&f!==null&&(f.f&q)===0&&(u.f^=q)}for(i=0;i<a;i++)if(s=r[i],pt(s)&&Ir(s),s.wv>t.wv)return!0}(!n||m!==null&&!le)&&H(t,I)}return!1}function Xr(t,e,r=!0){var n=t.reactions;if(n!==null&&!se?.includes(t))for(var i=0;i<n.length;i++){var s=n[i];(s.f&R)!==0?Xr(s,e,!1):e===s&&(r?H(s,K):(s.f&I)!==0&&H(s,ce),We(s))}}function Wr(t){var e=T,r=F,n=j,i=v,s=le,o=se,l=Y,a=G,u=me,f=t.f;T=null,F=0,j=null,le=(f&q)!==0&&(G||!Pe||v===null),v=(f&(fe|ge))===0?t:null,se=null,Ce(t.ctx),G=!1,me=++Ge,t.ac!==null&&(jr(()=>{t.ac.abort(jt)}),t.ac=null);try{t.f|=Pt;var h=t.fn,p=h(),c=t.deps;if(T!==null){var d;if(lt(t,F),c!==null&&F>0)for(c.length=F+T.length,d=0;d<T.length;d++)c[F+d]=T[d];else t.deps=c=T;if(!le||(f&R)!==0&&t.reactions!==null)for(d=F;d<c.length;d++)(c[d].reactions??=[]).push(t)}else c!==null&&F<c.length&&(lt(t,F),c.length=F);if(Sr()&&j!==null&&!G&&c!==null&&(t.f&(R|ce|K))===0)for(d=0;d<j.length;d++)Xr(j[d],t);return i!==null&&i!==t&&(Ge++,j!==null&&(n===null?n=j:n.push(...j))),(t.f&ve)!==0&&(t.f^=ve),p}catch(w){return Ar(w)}finally{t.f^=Pt,T=e,F=r,j=n,v=i,le=s,se=o,Ce(l),G=a,me=u}}function Ei(t,e){let r=e.reactions;if(r!==null){var n=xn.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}r===null&&(e.f&R)!==0&&(T===null||!T.includes(e))&&(H(e,ce),(e.f&(q|ot))===0&&(e.f^=ot),Lr(e),lt(e,0))}function lt(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Ei(t,r[n])}function Se(t){var e=t.f;if((e&Oe)===0){H(t,I);var r=m,n=Pe;m=t,Pe=!0;try{(e&Ie)!==0?mi(t):Zr(t),Ur(t);var i=Wr(t);t.teardown=typeof i=="function"?i:null,t.wv=Yr;var s;kr&&Yn&&(t.f&K)!==0&&t.deps}finally{Pe=n,m=r}}}function g(t){var e=t.f,r=(e&R)!==0;if(v!==null&&!G){var n=m!==null&&(m.f&Oe)!==0;if(!n&&!se?.includes(t)){var i=v.deps;if((v.f&Pt)!==0)t.rv<Ge&&(t.rv=Ge,T===null&&i!==null&&i[F]===t?F++:T===null?T=[t]:(!le||!T.includes(t))&&T.push(t));else{(v.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[v]:s.includes(v)||s.push(v)}}}else if(r&&t.deps===null&&t.effects===null){var o=t,l=o.parent;l!==null&&(l.f&q)===0&&(o.f^=q)}if(Fe){if(ue.has(t))return ue.get(t);if(r){o=t;var a=o.v;return((o.f&I)===0&&o.reactions!==null||Gr(o))&&(a=Zt(o)),ue.set(o,a),a}}else r&&(o=t,pt(o)&&Ir(o));if((t.f&ve)!==0)throw t.v;return t.v}function Gr(t){if(t.v===x)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(ue.has(e)||(e.f&R)!==0&&Gr(e))return!0;return!1}function Kr(t){var e=G;try{return G=!0,t()}finally{G=e}}const ki=-7169;function H(t,e){t.f=t.f&ki|e}const bi=["touchstart","touchmove"];function Mi(t){return bi.includes(t)}const xi=new Set,dr=new Set;let vr=null;function tt(t){var e=this,r=e.ownerDocument,n=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;vr=t;var o=0,l=vr===t&&t.__root;if(l){var a=i.indexOf(l);if(a!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;a<=u&&(o=a)}if(s=i[o]||t.target,s!==e){xt(t,"currentTarget",{configurable:!0,get(){return s||r}});var f=v,h=m;O(null),ne(null);try{for(var p,c=[];s!==null;){var d=s.assignedSlot||s.parentNode||s.host||null;try{var w=s["__"+n];if(w!=null&&(!s.disabled||t.target===s))if(br(w)){var[D,...J]=w;D.apply(s,[t,...J])}else w.call(s,t)}catch(b){p?c.push(b):p=b}if(t.cancelBubble||d===e||d===null)break;s=d}if(p){for(let b of c)queueMicrotask(()=>{throw b});throw p}}finally{t.__root=e,delete t.currentTarget,O(f),ne(h)}}}function Pi(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Si(t,e){var r=m;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function Jr(t,e){var r=(e&qn)!==0,n,i=!t.startsWith("<!>");return()=>{n===void 0&&(n=Pi(i?t:"<!>"+t),n=Nr(n));var s=r||Dr?document.importNode(n,!0):n.cloneNode(!0);return Si(s,s),s}}function Qr(t,e){t!==null&&t.before(e)}function Yt(t,e){return Ai(t,e)}const be=new Map;function Ai(t,{target:e,anchor:r,props:n={},events:i,context:s,intro:o=!0}){oi();var l=new Set,a=h=>{for(var p=0;p<h.length;p++){var c=h[p];if(!l.has(c)){l.add(c);var d=Mi(c);e.addEventListener(c,tt,{passive:d});var w=be.get(c);w===void 0?(document.addEventListener(c,tt,{passive:d}),be.set(c,1)):be.set(c,w+1)}}};a(Pn(xi)),dr.add(a);var u=void 0,f=pi(()=>{var h=r??e.appendChild(ai());return Qn(h,{pending:()=>{}},p=>{if(s){zt({});var c=Y;c.c=s}i&&(n.$$events=i),u=t(p,n)||{},s&&Bt()}),()=>{for(var p of l){e.removeEventListener(p,tt);var c=be.get(p);--c===0?(document.removeEventListener(p,tt),be.delete(p)):be.set(p,c)}dr.delete(a),h!==r&&h.parentNode?.removeChild(h)}});return Ci.set(u,f),u}let Ci=new WeakMap;function $r(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=$r(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Ti(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=$r(t))&&(n&&(n+=" "),n+=e);return n}function en(t){return typeof t=="object"?Ti(t):t??""}function Li(t,e,r){var n=t==null?"":""+t;return e&&(n=n?n+" "+e:e),n===""?null:n}function mr(t,e=!1){var r=e?" !important;":";",n="";for(var i in t){var s=t[i];s!=null&&s!==""&&(n+=" "+i+": "+s+r)}return n}function Ii(t,e){if(e){var r="",n,i;return Array.isArray(e)?(n=e[0],i=e[1]):n=e,n&&(r+=mr(n)),i&&(r+=mr(i,!0)),r=r.trim(),r===""?null:r}return String(t)}function tn(t,e,r,n,i,s){var o=t.__className;if(o!==r||o===void 0){var l=Li(r,n);l==null?t.removeAttribute("class"):t.className=l,t.__className=r}return s}function kt(t,e={},r,n){for(var i in r){var s=r[i];e[i]!==s&&(r[i]==null?t.style.removeProperty(i):t.style.setProperty(i,s,n))}}function ze(t,e,r,n){var i=t.__style;if(i!==e){var s=Ii(e,n);s==null?t.removeAttribute("style"):t.style.cssText=s,t.__style=e}else n&&(Array.isArray(n)?(kt(t,r?.[0],n[0]),kt(t,r?.[1],n[1],"important")):kt(t,r,n));return n}const Oi=()=>performance.now(),$={tick:t=>requestAnimationFrame(t),now:()=>Oi(),tasks:new Set};function rn(){const t=$.now();$.tasks.forEach(e=>{e.c(t)||($.tasks.delete(e),e.f())}),$.tasks.size!==0&&$.tick(rn)}function Di(t){let e;return $.tasks.size===0&&$.tick(rn),{promise:new Promise(r=>{$.tasks.add(e={c:t,f:r})}),abort(){$.tasks.delete(e)}}}function yr(t,e){return t===e||t?.[nt]===e}function Be(t={},e,r,n){return hi(()=>{var i,s;return Ht(()=>{i=s,s=[],Kr(()=>{t!==r(...s)&&(e(t,...s),i&&yr(r(...i),t)&&e(null,...i))})}),()=>{ft(()=>{s&&yr(r(...s),t)&&e(null,...s)})}}),t}const Fi="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Fi);function Ri(t){return t}function Ct(t){return-.5*(Math.cos(Math.PI*t)-1)}function Ni(t){const e=Math.cos(t*Math.PI*.5);return Math.abs(e)<1e-14?1:1-e}function ji(t){return Math.sin(t*Math.PI/2)}const zi=128,Bi=0,Ui=1,Zi=2;class qi{animationsStarted=!1;animationsCount=0;animationsLimit=zi;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 r=this.layers[e];if(r==null)continue;const n=r.animations;if(n!=null)for(let i=0;i<n.length;i++){const s=n[i];if(s!=null){for(const o of s.values())if(!o.executed&&(o.executed=!0,o.function(),this.animationsCount++,this.animationsCount==this.animationsLimit))return}}}}catch{}finally{window.requestAnimationFrame(this.tick.bind(this))}}equeue(e,r,n,i){let s=this.layers[e];s==null&&(s=this.layers[e]={animations:new Array});let o=s.animations[r];o==null&&(o=s.animations[r]=new Map);let l={id:n,priority:r,executed:!1,function:i};o.set(n,l),this.animationsStarted==!1&&(this.animationsStarted=!0,this.start())}clear(e,r){for(let n=0;n<this.layers.length;n++){let i=this.layers[n];if(i==null)continue;let s=i.animations[e];if(s==null)return;let o=s.get(r);if(o==null||o.executed==!1)return;s.delete(r)}}speed(){return Math.pow(2,2*this.animationsCount/this.animationsLimit)}stacked(){return this.animationsCount==this.animationsLimit}setLimit(e){this.animationsLimit=e}}const ae=new qi;function gr(t){return Object.prototype.toString.call(t)==="[object Date]"}function Tt(t,e){if(t===e||t!==t)return()=>t;const r=typeof t;if(r!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map((i,s)=>Tt(t[s],i));return i=>n.map(s=>s(i))}if(r==="object"){if(!t||!e)throw new Error("Object cannot be null");if(gr(t)&&gr(e)){const s=t.getTime(),l=e.getTime()-s;return a=>new Date(s+a*l)}const n=Object.keys(e),i={};return n.forEach(s=>{i[s]=Tt(t[s],e[s])}),s=>{const o={};return n.forEach(l=>{o[l]=i[l](s)}),o}}if(r==="number"){const n=e-t;return i=>t+i*n}return()=>e}class Vt{#e;#t;#a;#n=null;constructor(e,r={}){this.#e=C(e),this.#t=C(e),this.#a=r}static of(e,r){const n=new Vt(e(),r);return Ht(()=>{n.set(e())}),n}set(e,r){P(this.#t,e);let{delay:n=0,duration:i=400,easing:s=Ri,interpolate:o=Tt}={...this.#a,...r};if(i===0)return this.#n?.abort(),P(this.#e,e),Promise.resolve();const l=$.now()+n;let a,u=!1,f=this.#n;return this.#n=Di(h=>{if(h<l)return!0;if(!u){u=!0;const c=this.#e.v;a=o(c,e),typeof i=="function"&&(i=i(c,e)),f?.abort()}const p=h-l;return p>i?(P(this.#e,e),!1):(P(this.#e,a(s(p/i))),!0)}),this.#n.promise}get current(){return g(this.#e)}get target(){return g(this.#t)}set target(e){this.set(e)}}class st{value;motion;constructor(e,r){this.value=e,this.motion=new Vt(e,r)}set(e,r){this.value=e,this.motion.set(e,r)}update(e){this.motion.set(this.value,e)}snap(){this.motion.set(this.value,{duration:0})}}var Hi=Jr("<div></div>");function Yi(t,e){zt(e,!0);let r=e.style.width,n=e.style.height,i=e.style.radius,s=e.colors?.background??"darkgreen",o=e.colors?.border??"white",l=e.colors?.shadow??"0px 2px 2px rgba(0, 0, 0, 0.5)",a;function u(){return a}let f=C(!1);function h(E){P(f,E,!0)}function p(){return g(f)}let c=C(!0),d=0,w=150;function D(E){E!=g(c)&&(P(c,E,!0),d=performance.now())}function J(){return performance.now()-d<w?V.motion.current==0:V.value==0}let b=0,V=new st(0,{easing:Ct});Q(()=>{g(f)==!1&&(V.snap(),ae.clear(e.priority,e.id))}),Q(()=>{V.set(g(c)?0:b,{duration:75})}),Q(()=>{Qe(V.motion.current)});function Qe(E){a&&ae.equeue(e.layer,e.priority,e.id,()=>{a.style.scale=E.toString(),a.style.filter=`brightness(${.25+.75*E})`})}function dt(E){E!=b&&(b=E,V.set(E,{duration:75}))}function vt(){return V.value}var mt={getBody:u,setDisplayed:h,getDisplayed:p,setCollapsed:D,getCollapsed:J,setScale:dt,getScale:vt},M=Hi();let $e;return Be(M,E=>a=E,()=>a),Br(E=>{tn(M,1,en(["pin",g(f)&&"displayed"]),"svelte-zz3jrb"),$e=ze(M,"",$e,E)},[()=>({width:`${r}px`,height:`${n}px`,"border-radius":`${i}px`,"border-color":o,"background-color":s,"box-shadow":l})]),Qr(t,M),Bt(mt)}class Je{provider;providerMarker;id;lat;lng;shown;element;component;constructor(e,r){if(new.target===Je)throw new Error("Cannot instantiate an abstract class directly.");this.provider=e,this.id=r.id,this.lat=r.lat,this.lng=r.lng,this.shown=!0}create(){this.createElement(),this.createMarker(),this.setZIndex()}remove(){this.removeMarker()}createElement(){throw new Error("Create element not implemented")}createMarker(){const e=this.element;if(!e)throw new Error("Failed to create provider marker");this.providerMarker=this.provider.createMarker(e,this.lat,this.lng,this.getZindex())}updateMarker(e){if(this.providerMarker==null)throw new Error("Failed to update provider marker map");e?this.providerMarker.inserted()==!1&&this.providerMarker.insert():this.providerMarker.inserted()==!0&&this.providerMarker.remove()}removeMarker(){this.providerMarker?.remove()}setZIndex(){if(this.providerMarker==null)throw new Error("Failed to update provider marker z-index");this.providerMarker.update(this.getZindex())}getZindex(){throw new Error("Get z-index not implemented")}}var bt;function nn(t){return{lang:t?.lang??bt?.lang,message:t?.message,abortEarly:t?.abortEarly??bt?.abortEarly,abortPipeEarly:t?.abortPipeEarly??bt?.abortPipeEarly}}var Vi;function Xi(t){return Vi?.get(t)}var Wi;function Gi(t){return Wi?.get(t)}var Ki;function Ji(t,e){return Ki?.get(t)?.get(e)}function Ke(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function S(t,e,r,n,i){const s=i&&"input"in i?i.input:r.value,o=i?.expected??t.expects??null,l=i?.received??Ke(s),a={kind:t.kind,type:t.type,input:s,expected:o,received:l,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${l}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},u=t.kind==="schema",f=i?.message??t.message??Ji(t.reference,a.lang)??(u?Gi(a.lang):null)??n.message??Xi(a.lang);f!==void 0&&(a.message=typeof f=="function"?f(a):f),u&&(r.typed=!1),r.issues?r.issues.push(a):r.issues=[a]}function N(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},nn())}}}var ht=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function z(t){return{kind:"transformation",type:"args",reference:z,async:!1,schema:t,"~run"(e,r){const n=e.value;return e.value=(...i)=>{const s=this.schema["~run"]({value:i},r);if(s.issues)throw new ht(s.issues);return n(...s.value)},e}}}function sn(){return{kind:"transformation",type:"await",reference:sn,async:!0,async"~run"(t){return t.value=await t.value,t}}}function on(t,e){return{kind:"validation",type:"check",reference:on,async:!1,expects:null,requirement:t,message:e,"~run"(r,n){return r.typed&&!this.requirement(r.value)&&S(this,"input",r,n),r}}}function an(t,e){return{kind:"validation",type:"length",reference:an,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length!==this.requirement&&S(this,"length",r,n,{received:`${r.value.length}`}),r}}}function Le(t,e){return{kind:"validation",type:"max_value",reference:Le,async:!1,expects:`<=${t instanceof Date?t.toJSON():Ke(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value<=this.requirement)&&S(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():Ke(r.value)}),r}}}function Xt(t,e){return{kind:"validation",type:"min_length",reference:Xt,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&S(this,"length",r,n,{received:`${r.value.length}`}),r}}}function ee(t,e){return{kind:"validation",type:"min_value",reference:ee,async:!1,expects:`>=${t instanceof Date?t.toJSON():Ke(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value>=this.requirement)&&S(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():Ke(r.value)}),r}}}function W(t){return{kind:"transformation",type:"returns",reference:W,async:!1,schema:t,"~run"(e,r){const n=e.value;return e.value=(...i)=>{const s=this.schema["~run"]({value:n(...i)},r);if(s.issues)throw new ht(s.issues);return s.value},e}}}function ln(t){return{kind:"transformation",type:"returns",reference:ln,async:!1,schema:t,"~run"(e,r){const n=e.value;return e.value=async(...i)=>{const s=await this.schema["~run"]({value:await n(...i)},r);if(s.issues)throw new ht(s.issues);return s.value},e}}}function Qi(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function un(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function fn(t,e){return{kind:"schema",type:"array",reference:fn,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return N(this)},"~run"(r,n){const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){const o=i[s],l=this.item["~run"]({value:o},n);if(l.issues){const a={type:"array",origin:"value",input:i,key:s,value:o};for(const u of l.issues)u.path?u.path.unshift(a):u.path=[a],r.issues?.push(u);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value.push(l.value)}}else S(this,"type",r,n);return r}}}function cn(t){return{kind:"schema",type:"boolean",reference:cn,expects:"boolean",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:S(this,"type",e,r),e}}}function pn(t,e){return{kind:"schema",type:"custom",reference:pn,expects:"unknown",async:!1,check:t,message:e,get"~standard"(){return N(this)},"~run"(r,n){return this.check(r.value)?r.typed=!0:S(this,"type",r,n),r}}}function B(t){return{kind:"schema",type:"function",reference:B,expects:"Function",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return typeof e.value=="function"?e.typed=!0:S(this,"type",e,r),e}}}function k(t){return{kind:"schema",type:"number",reference:k,expects:"number",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:S(this,"type",e,r),e}}}function L(t,e){return{kind:"schema",type:"object",reference:L,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return N(this)},"~run"(r,n){const i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(const s in this.entries){const o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const l=s in i?i[s]:un(o),a=o["~run"]({value:l},n);if(a.issues){const u={type:"object",origin:"value",input:i,key:s,value:l};for(const f of a.issues)f.path?f.path.unshift(u):f.path=[u],r.issues?.push(f);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value[s]=a.value}else if(o.fallback!==void 0)r.value[s]=Qi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(S(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else S(this,"type",r,n);return r}}}function U(t,e){return{kind:"schema",type:"optional",reference:U,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return N(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=un(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function hn(t){return{kind:"schema",type:"promise",reference:hn,expects:"Promise",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return e.value instanceof Promise?e.typed=!0:S(this,"type",e,r),e}}}function re(t){return{kind:"schema",type:"string",reference:re,expects:"string",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:S(this,"type",e,r),e}}}function Z(t,e){return{kind:"schema",type:"tuple",reference:Z,expects:"Array",async:!1,items:t,message:e,get"~standard"(){return N(this)},"~run"(r,n){const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<this.items.length;s++){const o=i[s],l=this.items[s]["~run"]({value:o},n);if(l.issues){const a={type:"array",origin:"value",input:i,key:s,value:o};for(const u of l.issues)u.path?u.path.unshift(a):u.path=[a],r.issues?.push(u);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value.push(l.value)}}else S(this,"type",r,n);return r}}}function qe(t){return{kind:"schema",type:"void",reference:qe,expects:"void",async:!1,message:t,get"~standard"(){return N(this)},"~run"(e,r){return e.value===void 0?e.typed=!0:S(this,"type",e,r),e}}}function rt(t,e,r){const n=t["~run"]({value:e},nn(r));if(n.issues)throw new ht(n.issues);return n.value}function _(...t){return{...t[0],pipe:t,get"~standard"(){return N(this)},"~run"(e,r){for(const n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}function $i(...t){return{...t[0],pipe:t,async:!0,get"~standard"(){return N(this)},async"~run"(e,r){for(const n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=await n["~run"](e,r))}return e}}}const Lt=_(k(),ee(-90),Le(90)),It=_(k(),ee(-180),Le(180)),es=L({sw:L({lat:Lt,lng:It}),ne:L({lat:Lt,lng:It})}),Ot=pn(t=>t instanceof HTMLElement,"Must be an HTMLElement"),ts=L({mapSize:_(k(),ee(1)),zoomMin:_(k(),ee(0)),zoomMax:_(k(),ee(0)),zoomScale:_(k(),ee(1),Le(10))}),rs=L({inserted:_(B(),z(Z([])),W(cn())),insert:_(B(),z(Z([])),W(qe())),remove:_(B(),z(Z([])),W(qe())),update:_(B(),z(Z([k()])),W(qe()))}),ns=L({getParameters:_(B(),z(Z([])),W(ts)),getContainer:_(B(),z(Z([])),W(Ot)),getZoom:_(B(),z(Z([])),W(k())),getBounds:_(B(),z(Z([])),W(es)),panBy:_(B(),z(Z([k(),k()])),W(qe())),createMarker:_(B(),z(Z([Ot,Lt,It,k()])),W(rs))}),Mt=_(B(),z(Z([re()])),ln($i(hn(),sn(),Ot))),is=L({background:U(re()),border:U(re()),shadow:U(re())}),ss=L({width:k(),height:k(),radius:k()}),_r=L({background:U(re()),shadow:U(re())}),wr=_(L({width:k(),height:k(),margin:k(),radius:k()}),on(t=>Math.min(t.width,t.height)/t.margin>=6,"Minimum of width or height must be greater than or equal to 6 * margin")),os=L({id:_(re(),Xt(1)),rank:_(k(),ee(0)),lat:_(k(),ee(-90),Le(90)),lng:_(k(),ee(-180),Le(180)),tooltip:L({body:Mt,style:wr,colors:U(_r)}),pin:U(L({body:Mt,style:U(ss),colors:U(is)})),popup:U(L({body:Mt,style:wr,colors:U(_r)}))}),as=fn(os);class He extends Je{static DEFAULT_SIZE=16;style;colors;zoom;bodyLoading=!1;bodyLoaded=!1;bodyCallback;constructor(e,r,n){super(e,r),this.style=r.pin?.style??{width:He.DEFAULT_SIZE,height:He.DEFAULT_SIZE,radius:He.DEFAULT_SIZE},this.colors=r.pin?.colors,this.zoom=n,this.bodyCallback=r.pin?.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("pin"),this.component=Yt(Yi,{target:this.element,props:{id:this.id+"_pin",layer:Zi,priority:this.zoom*this.provider.getParameters().zoomScale,style:this.style,colors:this.colors}})}update(e){this.zoom=e[0],this.setZIndex()}updateMarker(e){super.updateMarker(e),this.component?.setDisplayed(e)}updateBody(){if(this.bodyCallback==null||this.bodyLoaded||this.bodyLoading)return;const e=this.component?.getBody();e!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(r=>{r instanceof HTMLElement?e.appendChild(r):console.error("Failed to load pin body")}).catch(r=>console.error(r)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}setCollapsed(e){if(this.component==null)throw new Error("Failed to set pin collapsed");this.component.setCollapsed(e)}setScale(e){if(this.component==null)throw new Error("Failed to set pin scale");this.component.setScale(e)}getScaleFromZoomDistance(e){return this.zoom<e?1:Math.max(0,1-(this.zoom-e)*.125)}getZindex(){const e=this.provider.getParameters();return Math.round((e.zoomMax-this.zoom)*e.zoomScale)}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyCallback==null||this.bodyLoaded}}var Ye;(t=>{function e(r,n,i){const s=r/2,o=n/2,l=Math.sqrt(s*s+o*o),a=Math.atan(o/s)*(180/Math.PI),u=i*(Math.PI/180);return i<180?i<90?i<a?{x:0,y:l*Math.sin(u)-o}:{x:l*Math.cos(u)-s,y:0}:i<180-a?{x:l*Math.cos(u)-s,y:0}:{x:-r,y:l*Math.sin(u)-o}:i<270?i<180+a?{x:-r,y:l*Math.sin(u)-o}:{x:l*Math.cos(u)-s,y:-n}:i<360-a?{x:l*Math.cos(u)-s,y:-n}:{x:0,y:l*Math.sin(u)-o}}t.getOffsets=e})(Ye||(Ye={}));var ls=Jr('<div><div class="pointer svelte-11extwn"></div> <div class="bubble svelte-11extwn"><div class="body svelte-11extwn"></div></div></div>');function dn(t,e){zt(e,!0);let r=e.style.width,n=e.style.height,i=e.style.margin,s=e.style.radius,o=e.colors?.background??"white",l=e.colors?.shadow??"0px 2px 2px rgba(0, 0, 0, 0.5)",a,u,f,h;const p=r+2*i,c=n+2*i,d=()=>h;Q(()=>{f.style.width=`${i*4}px`,f.style.height=`${i*4}px`});let w=C(!0);function D(y){P(w,y,!0)}function J(){return g(w)}let b=C(!0),V=0,Qe=300;function dt(y){y!=g(b)&&(P(b,y,!0),V=performance.now())}function vt(){return performance.now()-V<Qe?M.motion.current==0:M.value==0}function mt(){return performance.now()-V<Qe?M.motion.current==1:M.value==1}let M=new st(0);Q(()=>{g(w)==!1&&(M.snap(),ae.clear(e.priority,e.id+"_scale"))}),Q(()=>{g(b)==!0&&M.value!=0&&(ae.stacked()?M.set(0,{duration:0}):M.set(0,{duration:150,easing:Ni})),g(b)==!1&&M.value!=1&&M.set(1,{duration:150,easing:ji})}),Q(()=>{$e(M.motion.current)});function $e(y){!a||!u||!f||ae.equeue(g(b)?0:e.layer,e.priority,e.id+"_scale",()=>{a.style.opacity=`${y}`,u.style.scale=`${y}`,f.style.scale=`${y}`})}let E=NaN,yt=C(!1),oe=new st(-p/2,{easing:Ct}),et=new st(-c/2,{easing:Ct});Q(()=>{g(w)==!1&&(oe.snap(),oe.snap(),ae.clear(e.priority,e.id+"_angle"))}),Q(()=>{g(b)==!0&&g(yt)&&(oe.update({duration:75}),oe.update({duration:75}))}),Q(()=>{Qt(oe.motion.current,et.motion.current)});function Qt(y,_e){if(!a||!u||!f)return;const X=y+p/2,we=_e+c/2,Ee=c<p?X*c/p:X,ke=c>p?we*p/c:we,wn=Math.atan2(ke,Ee)/Math.PI*180-45,ir=0,En=30,wt=Math.sqrt(Ee*Ee+ke*ke),Ne=Math.min(p,c)/2,kn=Ne*Math.SQRT2,bn=(wt-Ne)/(kn-Ne),sr=ir+bn*(En-ir),Mn=wt<Ne?wt/Ne:1;ae.equeue(e.layer,e.priority,e.id+"_angle",()=>{u.style.transform=`translate(${Math.round(y)}px, ${Math.round(_e)}px)`,f.style.transform=`scale(${Mn}) rotate(${wn}deg) skew(${sr}deg, ${sr}deg)`})}function yn(y,_e){if(g(yt)==!1||_e==!0){let X=Ye.getOffsets(p,c,y);oe.set(Math.round(X.x),{duration:0}),et.set(Math.round(X.y),{duration:0}),Qt(oe.value,et.value),E=y,P(yt,!0)}else if(y!=E){let X=Math.abs(y-E),we=X<180?X:360-X,Ee=Math.log(we)*75,ke=Ye.getOffsets(p,c,y);oe.set(Math.round(ke.x),{duration:Ee}),et.set(Math.round(ke.y),{duration:Ee}),E=y}}function gn(){return Ye.getOffsets(p,c,E)}var _n={getBody:d,setDisplayed:D,getDisplayed:J,setCollapsed:dt,getCollapsed:vt,getExpanded:mt,setAngle:yn,getOffsets:gn},Re=ls();let $t;var gt=fr(Re);let er;Be(gt,y=>f=y,()=>f);var _t=li(gt,2);let tr;var rr=fr(_t);let nr;return Be(rr,y=>h=y,()=>h),Be(_t,y=>u=y,()=>u),Be(Re,y=>a=y,()=>a),Br((y,_e,X,we)=>{tn(Re,1,en(["anchor",g(w)&&"displayed"]),"svelte-11extwn"),$t=ze(Re,"",$t,y),er=ze(gt,"",er,_e),tr=ze(_t,"",tr,X),nr=ze(rr,"",nr,we)},[()=>({filter:`drop-shadow(${l})`}),()=>({"background-color":o}),()=>({margin:`${i}px;`}),()=>({width:`${r}px`,height:`${n}px`,"border-radius":`${s}px;`,"background-color":o})]),Qr(t,Re),Bt(_n)}class Wt extends Je{static Z_INDEX_OFFSET=2e6;style;colors;bodyLoading=!1;bodyLoaded=!1;bodyCallback;constructor(e,r){if(r.popup==null)throw new Error("Failed to create popup");super(e,r),this.shown=!1,this.style=r.popup.style,this.colors=r.popup.colors,this.bodyCallback=r.popup.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("popup"),this.component=Yt(dn,{target:this.element,props:{id:this.id+"_popup",layer:Bi,priority:0,style:this.style,colors:this.colors}})}updateMarker(e){super.updateMarker(e),this.component?.setDisplayed(e)}updateBody(){if(this.bodyLoaded||this.bodyLoading)return;const e=this.component?.getBody();e!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(r=>{r instanceof HTMLElement?e.appendChild(r):console.error("Failed to load popup body")}).catch(r=>console.error(r)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getZindex(){return Wt.Z_INDEX_OFFSET}setCollapsed(e){if(this.component==null)throw new Error("Failed to set popup collapsed");this.component.setCollapsed(e)}setAngle(e){if(this.component==null)throw new Error("Failed to set popup angle");this.component.setAngle(e,!0)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}}var ye;(t=>{t.COUNT=12,t.DEGREES=[0,30,60,90,120,150,180,210,240,270,300,330],t.DEGREES_DEFAULT=270})(ye||(ye={}));class Gt extends Je{static Z_INDEX_OFFSET=1e6;style;colors;zoom;angle;states;bodyLoading=!1;bodyLoaded=!1;bodyCallback;constructor(e,r,n){super(e,r),this.style=r.tooltip.style,this.colors=r.tooltip.colors,this.zoom=n[0],this.angle=ye.DEGREES_DEFAULT,this.states=n[1].map(i=>[i[0],ye.DEGREES[i[1]]]),this.bodyCallback=r.tooltip.body}createElement(){this.element=document.createElement("div"),this.element.classList.add("tooltip"),this.component=Yt(dn,{target:this.element,props:{id:this.id+"_tooltip",layer:Ui,priority:this.zoom*this.provider.getParameters().zoomScale,style:this.style,colors:this.colors}})}update(e){this.zoom=e[0],this.states=e[1].map(r=>[r[0],ye.DEGREES[r[1]]]),this.setZIndex()}updateMarker(e){super.updateMarker(e),this.component?.setDisplayed(e)}updateState(e){if(this.component==null)throw new Error("Failed to update tooltip state");this.angle=this.getAngle(e),this.component.setAngle(this.angle)}updateBody(){if(this.bodyLoaded||this.bodyLoading)return;const e=this.component?.getBody();e!=null&&(this.bodyLoading=!0,this.bodyCallback(this.id).then(r=>{r instanceof HTMLElement?e.appendChild(r):console.error("Failed to load tooltip body")}).catch(r=>console.error(r)).finally(()=>{this.bodyLoaded=!0,this.bodyLoading=!1}))}getAngle(e){const r=this.states.findLast(n=>n[0]<=e);if(!r)throw new Error("Angle not found");return r[1]}getZindex(){const e=this.provider.getParameters();return Math.round((e.zoomMax-this.zoom)*e.zoomScale)+Gt.Z_INDEX_OFFSET}setCollapsed(e){if(this.component==null)throw new Error("Failed to set tooltip collapsed");this.component.setCollapsed(e)}isExpanded(){return this.component==null?!1:this.component.getExpanded()}isCollapsed(){return this.component==null?!1:this.component.getCollapsed()}isBodyLoaded(){return this.bodyLoaded}}class us{marker;zoom;pin;tooltip;popup;constructor(e,r,n){this.marker=r,this.zoom=n[0],this.pin=new He(e,r,n[0]),this.tooltip=new Gt(e,r,n),this.popup=r.popup?new Wt(e,r):void 0}create(){this.pin.create(),this.tooltip.create(),this.popup?.create()}update(e){this.pin.update(e),this.tooltip.update(e)}remove(){this.pin.remove(),this.tooltip.remove(),this.popup?.remove()}}var xe;(t=>{function e(l,a,u){return{x:n(a)*u,y:i(l)*u}}t.project=e;function r(l,a,u){return{lat:o(a/u),lng:s(l/u)}}t.unproject=r;function n(l){return(180+l)/360}function i(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function s(l){return l*360-180}function o(l){return 360/Math.PI*Math.atan(Math.exp((180-l*360)*Math.PI/180))-90}})(xe||(xe={}));class vn{swLat;swLng;neLat;neLng;constructor(e,r,n,i,s){const o=n*Math.pow(2,r),l=xe.project(e.sw.lat,e.sw.lng,o),a=xe.project(e.ne.lat,e.ne.lng,o),u=l.x-i,f=l.y+s,h=a.x+i,p=a.y-s,c=xe.unproject(u,f,o),d=xe.unproject(h,p,o);this.swLat=c.lat,this.swLng=c.lng,this.neLat=d.lat,this.neLng=d.lng}contains(e,r){return this.swLat<=e&&e<=this.neLat?this.swLng<this.neLng?this.swLng<=r&&r<=this.neLng:r<=this.neLng||this.swLng<=r:!1}}class ut{static MAP_PINS_MAX_ZOOM=2;static MAP_PINS_MAX_COUNT=128;provider;pinElements=new Array;pinMaxWidth=0;pinMaxHeight=0;pinFade=!1;pinMaxCount=0;pinMaxZoomDelta=0;constructor(e){this.provider=e}setConfiguration(e){this.pinFade=e?.pin?.fade??!0,this.pinMaxCount=e?.pin?.maxCount??Math.max(ut.MAP_PINS_MAX_COUNT,8*navigator.hardwareConcurrency),this.pinMaxZoomDelta=e?.pin?.maxZoom??ut.MAP_PINS_MAX_ZOOM}updateElements(e){this.pinElements=e,this.pinMaxWidth=e.reduce((r,n)=>Math.max(r,n.style.width),0),this.pinMaxHeight=e.reduce((r,n)=>Math.max(r,n.style.height),0)}removeElements(){this.pinElements.forEach(e=>e.removeMarker()),this.pinElements.length=0}process(e,r){const n=this.provider.getParameters().mapSize,i=new vn(e,r,n,this.pinMaxWidth*2,this.pinMaxHeight*2);let s=0;for(const o of this.pinElements)i.contains(o.lat,o.lng)?o.shown&&r<o.zoom&&o.zoom<r+this.pinMaxZoomDelta?(s<this.pinMaxCount&&(o.setCollapsed(!1),o.setScale(this.pinFade?o.getScaleFromZoomDistance(r):1),o.updateMarker(!0),o.isBodyLoaded()==!1&&o.updateBody()),s++):(o.setCollapsed(!0),o.isCollapsed()&&o.updateMarker(!1)):o.updateMarker(!1)}}class fs{provider;tooltipElements=new Array;tooltipMaxWidth=0;tooltipMaxHeight=0;constructor(e){this.provider=e}updateElements(e){this.tooltipElements=e,this.tooltipMaxWidth=this.tooltipElements.reduce((r,n)=>Math.max(r,n.style.width),0),this.tooltipMaxHeight=this.tooltipElements.reduce((r,n)=>Math.max(r,n.style.height),0)}removeElements(){this.tooltipElements.forEach(e=>e.removeMarker()),this.tooltipElements.length=0}process(e,r){const n=this.provider.getParameters().mapSize,i=new vn(e,r,n,this.tooltipMaxWidth*2,this.tooltipMaxHeight*2);for(const s of this.tooltipElements)i.contains(s.lat,s.lng)?s.shown&&s.zoom<=r?(s.updateState(r),s.setCollapsed(!1),s.updateMarker(!0),s.isCollapsed()==!1&&s.isBodyLoaded()==!1&&s.updateBody()):(s.setCollapsed(!0),s.isCollapsed()&&s.updateMarker(!1)):s.updateMarker(!1)}}class cs{provider;popupElements=new Array;popupPositioned=new Map;constructor(e){this.provider=e}show(e){e.popup&&(e.pin.shown=!1,e.tooltip.shown=!1,this.popupPositioned.set(e.marker.id,!1),e.popup.setAngle(e.tooltip.angle),e.popup.shown=!0)}hide(e){e.popup&&(e.pin.shown=!0,e.tooltip.shown=!0,e.popup.shown=!1)}updateElements(e){this.popupElements=e,this.popupPositioned=new Map(e.map(r=>[r.id,!1]))}removeElements(){this.popupElements.forEach(e=>e.removeMarker()),this.popupElements.length=0,this.popupPositioned.clear()}process(){for(const e of this.popupElements)if(e.shown){if(e.setCollapsed(!1),e.updateMarker(!0),e.isExpanded()&&e.isBodyLoaded()==!1&&e.updateBody(),e.isCollapsed()==!1&&this.popupPositioned.get(e.id)==!1){const r=e.component?.getBody();if(r==null)continue;const n=e.component?.getOffsets();if(n==null)continue;const i=r.getBoundingClientRect();if(i.x==0&&i.y==0&&i.width==0&&i.height==0)continue;const s=i.x+i.width/2,o=i.y+i.height/2,l=s+n.x,a=o+n.y,u=l+e.style.width,f=a+e.style.height,h=this.provider.getContainer().getBoundingClientRect(),p=l-h.left,c=h.right-u,d=a-h.top,w=h.bottom-f,D=Math.min(e.style.width,e.style.height)/4,J=p<0?p-D:c<0?-c+D:0,b=d<0?d-D:w<0?-w+D:0;this.provider.panBy(J,b),this.popupPositioned.set(e.id,!0)}}else e.setCollapsed(!0),e.isCollapsed()&&e.updateMarker(!1)}}class ps{markerPinProcessor;markerTooltipProcessor;markerPopupProcessor;constructor(e){this.markerPinProcessor=new ut(e),this.markerTooltipProcessor=new fs(e),this.markerPopupProcessor=new cs(e)}setConfiguration(e){this.markerPinProcessor.setConfiguration(e)}updateElements(e){this.markerPinProcessor.updateElements(e.map(r=>r.pin)),this.markerTooltipProcessor.updateElements(e.map(r=>r.tooltip)),this.markerPopupProcessor.updateElements(e.map(r=>r.popup).filter(r=>r!=null))}removeElements(){this.markerPinProcessor.removeElements(),this.markerTooltipProcessor.removeElements(),this.markerPopupProcessor.removeElements()}processElements(e,r){this.markerPinProcessor.process(e,r),this.markerTooltipProcessor.process(e,r),this.markerPopupProcessor.process()}showPopup(e){this.markerPopupProcessor.show(e)}hidePopup(e){this.markerPopupProcessor.hide(e)}}var Ve;(t=>{async function e(n,i){const s=await fetch(n,i);if(!s.ok)throw new Error(s.statusText);return s.json()}t.get=e;async function r(n,i,s){const o=await fetch(n,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json",...s?.headers},...s});if(!o.ok)throw new Error(o.statusText);return o.json()}t.post=r})(Ve||(Ve={}));const hs=_(re(),an(32)),ds=_(re(),Xt(1)),Er="1.2.1",Kt="https://maps.api.arenarium.dev",vs=`${Kt}/auth`,ms=`${Kt}/states`,ys=`${Kt}/log`;class Jt{apiKey;apiToken;apiDevEnvironment;mapProvider;mapMarkerProcessor;mapMarkerElementArray=new Array;mapMarkerElementMap=new Map;mapMarkerElementsUpdating=!1;constructor(e,r,n,i){rt(hs,e),rt(ds,r),rt(ns,n),this.apiKey=e,this.apiToken=r,this.apiDevEnvironment=window?.location.host.startsWith("localhost")||window?.location.host.startsWith("127.0.0.1"),this.mapProvider=n,this.mapMarkerProcessor=new ps(n),this.setConfiguration(i)}static async create(e,r,n){const i={key:e,version:Er};let o=(await Ve.post(vs,i)).token;if(!o)throw new Error("Failed to get api token");return new Jt(e,o,r,n)}setConfiguration(e){ae.setLimit(e?.animation?.queue?.limit??8*navigator.hardwareConcurrency),this.mapMarkerProcessor.setConfiguration(e)}async updateMarkers(e){rt(as,e);try{await this.updateMarkerElements(e),this.processMarkerElementsCallback()}catch(r){throw this.removeMarkerElements(),this.log("error","Failed to update markers",r),r}}removeMarkers(){try{this.removeMarkerElements()}catch(e){throw this.log("error","Failed to remove markers",e),e}}showPopup(e){try{for(const r of this.mapMarkerElementArray)r.marker.id==e?this.mapMarkerProcessor.showPopup(r):this.mapMarkerProcessor.hidePopup(r)}catch(r){for(const n of this.mapMarkerElementArray)this.mapMarkerProcessor.hidePopup(n);throw this.log("error","Failed to show popup",r),r}}hidePopup(e){try{if(e){const r=this.mapMarkerElementMap.get(e);if(r==null)return;this.mapMarkerProcessor.hidePopup(r)}else for(const r of this.mapMarkerElementArray)this.mapMarkerProcessor.hidePopup(r)}catch(r){for(const n of this.mapMarkerElementArray)this.mapMarkerProcessor.hidePopup(n);throw this.log("error","Failed to hide popup",r),r}}async updateMarkerElements(e){try{let r=this.mapMarkerElementArray.map(i=>i.marker);for(let i=0;i<e.length;i++){const s=e[i];this.mapMarkerElementMap.get(s.id)||r.push(s)}const n=await this.getMarkerStates(r);try{this.mapMarkerElementsUpdating=!0;for(let i=0;i<r.length;i++){const s=r[i],o=n[i],l=this.mapMarkerElementMap.get(s.id);if(l)l.update(o);else{const a=new us(this.mapProvider,s,o);a.create(),this.mapMarkerElementMap.set(s.id,a),this.mapMarkerElementArray.push(a)}}this.mapMarkerElementArray.sort((i,s)=>i.zoom-s.zoom),this.mapMarkerProcessor.updateElements(this.mapMarkerElementArray)}finally{this.mapMarkerElementsUpdating=!1}}catch(r){throw this.mapMarkerProcessor.removeElements(),this.mapMarkerElementArray.length=0,this.mapMarkerElementMap.clear(),r}finally{this.mapMarkerElementsUpdating=!1}}removeMarkerElements(){try{this.mapMarkerElementsUpdating=!0,this.mapMarkerProcessor.removeElements(),this.mapMarkerElementArray.length=0,this.mapMarkerElementMap.clear()}finally{this.mapMarkerElementsUpdating=!1}}async getMarkerStates(e){if(e.length==0)return[];if(e.length==1)return[[0,[[0,ye.DEGREES.indexOf(ye.DEGREES_DEFAULT)]]]];const r=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})),n={key:this.apiKey,token:this.apiToken,parameters:this.mapProvider.getParameters(),input:r},i=await Ve.post(ms,n,{headers:{"Cache-Control":this.apiDevEnvironment?"no-cache":""}});return i.token&&(this.apiToken=i.token),i.states}processMarkerElementsCallback(){if(this.mapProvider.getContainer().parentElement!=null&&this.mapMarkerElementArray.length!=0)try{this.processMarkerElements(),window.setTimeout(this.processMarkerElementsCallback.bind(this),25)}catch(e){this.log("error","Failed to process marker elements",e)}}processMarkerElements(){if(this.mapMarkerElementsUpdating)return;const e=this.mapProvider.getBounds(),r=this.mapProvider.getZoom();this.mapMarkerProcessor.processElements(e,r)}async log(e,r,n){switch(e){case"info":console.info(n);break;case"warn":console.warn(n);break;case"error":console.error(n);break}if(n instanceof Error&&!this.apiDevEnvironment)try{const i={key:this.apiKey,title:r,level:e,content:{version:Er,...n}};await Ve.post(ys,i)}catch(i){console.error(i)}}}const mn=()=>'<img src="https://arenarium.dev/favicon.svg" alt="Arenarium Maps" style="height: 1.25em; vertical-align: middle;" />',gs=()=>`<a href="https://arenarium.dev" target="_blank" style="color: inherit;">${mn()}<span>&nbsp;@arenarium/maps</span></a>`;exports.MapManager=Jt;exports.getAttributionHtml=gs;exports.getImageHtml=mn;
package/dist/main.d.ts CHANGED
@@ -37,12 +37,10 @@ export declare class MapManager {
37
37
  private apiToken;
38
38
  private apiDevEnvironment;
39
39
  private mapProvider;
40
- private markerDataArray;
41
- private markerDataMap;
42
- private markerDataUpdating;
43
- private markerPinProcessor;
44
- private markerTooltipProcessor;
45
- private markerPopupProcessor;
40
+ private mapMarkerProcessor;
41
+ private mapMarkerElementArray;
42
+ private mapMarkerElementMap;
43
+ private mapMarkerElementsUpdating;
46
44
  private constructor();
47
45
  static create(apiKey: string, mapProvider: MapProvider, mapConfiguration?: MapConfiguration): Promise<MapManager>;
48
46
  setConfiguration(configuration: MapConfiguration | undefined): void;
@@ -50,11 +48,11 @@ export declare class MapManager {
50
48
  removeMarkers(): void;
51
49
  showPopup(id: string): void;
52
50
  hidePopup(id?: string): void;
53
- private updateMarkerData;
54
- private removeMarkerData;
51
+ private updateMarkerElements;
52
+ private removeMarkerElements;
55
53
  private getMarkerStates;
56
- private processMarkerDataCallback;
57
- private processMarkerData;
54
+ private processMarkerElementsCallback;
55
+ private processMarkerElements;
58
56
  private log;
59
57
  }
60
58
 
@@ -66,6 +64,7 @@ declare const mapMarkerSchema: v.ObjectSchema<{
66
64
  readonly lat: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -90, undefined>, v.MaxValueAction<number, 90, undefined>]>;
67
65
  readonly lng: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -180, undefined>, v.MaxValueAction<number, 180, undefined>]>;
68
66
  readonly tooltip: v.ObjectSchema<{
67
+ readonly body: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.StringSchema<undefined>], undefined>>, v.ReturnsActionAsync<(args_0: string) => unknown, v.SchemaWithPipeAsync<readonly [v.PromiseSchema<undefined>, v.AwaitActionAsync<Promise<unknown>>, v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>]>>]>;
69
68
  readonly style: v.SchemaWithPipe<readonly [v.ObjectSchema<{
70
69
  readonly width: v.NumberSchema<undefined>;
71
70
  readonly height: v.NumberSchema<undefined>;
@@ -76,25 +75,42 @@ declare const mapMarkerSchema: v.ObjectSchema<{
76
75
  height: number;
77
76
  margin: number;
78
77
  radius: number;
79
- }, "Tooltip: minimum of width or height must be greater than or equal to 6 * margin">]>;
80
- readonly body: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.StringSchema<undefined>], undefined>>, v.ReturnsActionAsync<(args_0: string) => unknown, v.SchemaWithPipeAsync<readonly [v.PromiseSchema<undefined>, v.AwaitActionAsync<Promise<unknown>>, v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>]>>]>;
78
+ }, "Minimum of width or height must be greater than or equal to 6 * margin">]>;
79
+ readonly colors: v.OptionalSchema<v.ObjectSchema<{
80
+ readonly background: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
81
+ readonly shadow: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
82
+ }, undefined>, undefined>;
81
83
  }, undefined>;
82
84
  readonly pin: v.OptionalSchema<v.ObjectSchema<{
83
- readonly style: v.ObjectSchema<{
85
+ readonly body: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.StringSchema<undefined>], undefined>>, v.ReturnsActionAsync<(args_0: string) => unknown, v.SchemaWithPipeAsync<readonly [v.PromiseSchema<undefined>, v.AwaitActionAsync<Promise<unknown>>, v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>]>>]>;
86
+ readonly style: v.OptionalSchema<v.ObjectSchema<{
84
87
  readonly width: v.NumberSchema<undefined>;
85
88
  readonly height: v.NumberSchema<undefined>;
86
89
  readonly radius: v.NumberSchema<undefined>;
87
- }, undefined>;
88
- readonly body: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.StringSchema<undefined>], undefined>>, v.ReturnsActionAsync<(args_0: string) => unknown, v.SchemaWithPipeAsync<readonly [v.PromiseSchema<undefined>, v.AwaitActionAsync<Promise<unknown>>, v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>]>>]>;
90
+ }, undefined>, undefined>;
91
+ readonly colors: v.OptionalSchema<v.ObjectSchema<{
92
+ readonly background: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
93
+ readonly border: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
94
+ readonly shadow: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
95
+ }, undefined>, undefined>;
89
96
  }, undefined>, undefined>;
90
97
  readonly popup: v.OptionalSchema<v.ObjectSchema<{
91
- readonly style: v.ObjectSchema<{
98
+ readonly body: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.StringSchema<undefined>], undefined>>, v.ReturnsActionAsync<(args_0: string) => unknown, v.SchemaWithPipeAsync<readonly [v.PromiseSchema<undefined>, v.AwaitActionAsync<Promise<unknown>>, v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>]>>]>;
99
+ readonly style: v.SchemaWithPipe<readonly [v.ObjectSchema<{
92
100
  readonly width: v.NumberSchema<undefined>;
93
101
  readonly height: v.NumberSchema<undefined>;
94
- readonly radius: v.NumberSchema<undefined>;
95
102
  readonly margin: v.NumberSchema<undefined>;
96
- }, undefined>;
97
- readonly body: v.SchemaWithPipe<readonly [v.FunctionSchema<undefined>, v.ArgsAction<(...args: unknown[]) => unknown, v.TupleSchema<[v.StringSchema<undefined>], undefined>>, v.ReturnsActionAsync<(args_0: string) => unknown, v.SchemaWithPipeAsync<readonly [v.PromiseSchema<undefined>, v.AwaitActionAsync<Promise<unknown>>, v.CustomSchema<HTMLElement, v.ErrorMessage<v.CustomIssue> | undefined>]>>]>;
103
+ readonly radius: v.NumberSchema<undefined>;
104
+ }, undefined>, v.CheckAction<{
105
+ width: number;
106
+ height: number;
107
+ margin: number;
108
+ radius: number;
109
+ }, "Minimum of width or height must be greater than or equal to 6 * margin">]>;
110
+ readonly colors: v.OptionalSchema<v.ObjectSchema<{
111
+ readonly background: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
112
+ readonly shadow: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
113
+ }, undefined>, undefined>;
98
114
  }, undefined>, undefined>;
99
115
  }, undefined>;
100
116