@arenarium/maps 1.2.23 → 1.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +1002 -959
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- class Bt {
1
+ class Ut {
2
2
  invoked = !1;
3
3
  interval;
4
4
  timeout;
@@ -17,7 +17,7 @@ class Bt {
17
17
  this.invoked = !1, this.timeout && window.clearTimeout(this.timeout), this.timeout = void 0;
18
18
  }
19
19
  }
20
- class gs {
20
+ class ws {
21
21
  data;
22
22
  state;
23
23
  constructor(e) {
@@ -50,8 +50,8 @@ class ys {
50
50
  this.id != null && (window.clearInterval(this.id), this.id = void 0);
51
51
  }
52
52
  }
53
- const ws = 100;
54
- class ks {
53
+ const ks = 100;
54
+ class bs {
55
55
  viewport = void 0;
56
56
  state = "idle";
57
57
  provider;
@@ -62,7 +62,7 @@ class ks {
62
62
  onIdle;
63
63
  onClick;
64
64
  constructor(e, n, r, s, i, a) {
65
- this.provider = e, this.interval = new ys(this.onInterval.bind(this), ws / (navigator?.hardwareConcurrency ?? 1)), this.onCancel = n, this.onError = r, this.onMove = s, this.onIdle = i, this.onClick = a;
65
+ this.provider = e, this.interval = new ys(this.onInterval.bind(this), ks / (navigator?.hardwareConcurrency ?? 1)), this.onCancel = n, this.onError = r, this.onMove = s, this.onIdle = i, this.onClick = a;
66
66
  }
67
67
  start() {
68
68
  this.interval.start(), this.provider.getContainer().addEventListener("click", this.onClick.bind(this));
@@ -86,7 +86,7 @@ class ks {
86
86
  }
87
87
  }
88
88
  }
89
- class Jn {
89
+ class Qn {
90
90
  worker;
91
91
  workerInvocations;
92
92
  workerInvocationCounter = 0;
@@ -111,7 +111,7 @@ class Jn {
111
111
  this.workerInvocations.forEach((e) => e.reject(new Error("Terminated"))), this.workerInvocations.clear(), this.worker.terminate();
112
112
  }
113
113
  }
114
- class Be {
114
+ class je {
115
115
  remove;
116
116
  insert;
117
117
  constructor(e, n) {
@@ -119,17 +119,17 @@ class Be {
119
119
  }
120
120
  static from(e, n) {
121
121
  const r = new Set(e), s = new Set(n), i = Array.from(r.difference(s)), a = Array.from(s.difference(r));
122
- return new Be(i, a);
122
+ return new je(i, a);
123
123
  }
124
124
  static empty() {
125
- return new Be([], []);
125
+ return new je([], []);
126
126
  }
127
127
  }
128
- const Gn = '(function(){"use strict";function w(l,t,e){return{x:T(t)*e,y:I(l)*e}}function m(l,t,e){return{lat:R(t/e),lng:P(l/e)}}function T(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 P(l){return l*360-180}function R(l){return 360/Math.PI*Math.atan(Math.exp((180-l*360)*Math.PI/180))-90}class c{sw;ne;constructor(t,e,n,s){if(n<t)throw new Error(`Invalid bounds: ${t}, ${e}, ${n}, ${s}`);if(s<e)throw new Error(`Invalid bounds: ${t}, ${e}, ${n}, ${s}`);this.sw={lat:t,lng:e},this.ne={lat:n,lng:s}}contains(t,e){return!(t<this.sw.lat||this.ne.lat<t||e<this.sw.lng||this.ne.lng<e)}intersects(t){return!(t.ne.lat<this.sw.lat||this.ne.lat<t.sw.lat||t.ne.lng<this.sw.lng||this.ne.lng<t.sw.lng)}}class h{blockL;blockR;sw;ne;constructor(t,e,n,s){if(n<t)throw new Error(`Invalid bounds: ${t}, ${e}, ${n}, ${s}`);this.sw={lat:t,lng:e},this.ne={lat:n,lng:s},e<s?(this.blockL=new c(t,e,n,s),this.blockR=new c(0,0,0,0)):(this.blockL=new c(t,-180,n,s),this.blockR=new c(t,e,n,180))}static bounds(t){const e=t.bounds,n=t.center;return e.sw.lng<=n.lng&&e.ne.lng<=n.lng?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:e.sw.lng>=n.lng&&e.ne.lng>=n.lng?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:Math.abs(e.ne.lng-n.lng)+Math.abs(e.sw.lng-n.lng)>360?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:e.ne.lng-e.sw.lng>360?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:t.bounds}static create(t){const e=this.bounds(t),n=e.sw,s=e.ne;return new h(n.lat,n.lng,s.lat,s.lng)}static offset(t,e,n){const s=this.bounds(t),r=t.zoom,o=e*Math.pow(2,r),i=w(s.sw.lat,s.sw.lng,o),a=w(s.ne.lat,s.ne.lng,o);let g=Math.max(i.x-n.left,0),f=Math.min(i.y+n.bottom,o),D=Math.min(a.x+n.right,o),N=Math.max(a.y-n.top,0);const z=m(g,f,o),C=m(D,N,o);return new h(z.lat,z.lng,C.lat,C.lng)}contains(t,e){return this.blockL.contains(t,e)||this.blockR.contains(t,e)}intersects(t){return this.blockL.intersects(t)||this.blockR.intersects(t)}}class S{id;bounds;markers;constructor(t,e){this.id=t,this.bounds=e,this.markers=[]}belongs(t){const e=this.bounds.sw;if(t.lat<e.lat||t.lng<e.lng)return!1;const n=this.bounds.ne;return!(n.lat<t.lat||n.lng<t.lng)}neighbours(t,e){const n=Math.abs(t.id.length-this.id.length);if(n>e)return!1;const s=Math.min(this.id.length,t.id.length)-e+n;for(let r=0;r<s;r++)if(this.id[r]!=t.id[r])return!1;return!0}}class u{tree;zoom;cell;branches;constructor(t,e,n,s){this.tree=t,this.zoom=n,this.cell=new S(e,s),this.branches=new Array}split(){const t=this.cell.bounds,e=Math.pow(2,this.tree.depth),n=(t.ne.lat-t.sw.lat)/e,s=(t.ne.lng-t.sw.lng)/e;for(let r=0;r<e;r++)for(let o=0;o<e;o++){const i=t.sw.lat+r*n,a=t.sw.lng+o*s,g=i+n,f=a+s;this.branches.push(new u(this.tree,`${this.cell.id}${r*2+o}`,this.zoom+this.tree.depth,{sw:{lat:i,lng:a},ne:{lat:g,lng:f}}))}}add(t){if(this.cell.belongs(t)==!1)return!1;if(this.cell.markers.length<this.tree.capacity)return this.cell.markers.push(t),!0;this.branches.length==0&&this.split();for(let e=0;e<this.branches.length;e++)if(this.branches[e].add(t))return!0;throw new Error("Failed to add marker to branch")}compact(){if(this.branches.length==0)return;for(let s=0;s<this.branches.length;s++)this.branches[s].compact();const t=new Array,e=new Array;for(let s=0;s<this.branches.length;s++){const r=this.branches[s];t.push(...r.branches),e.push(...r.cell.markers)}const n=new u(this.tree,this.cell.id,this.zoom+this.tree.depth,this.cell.bounds);n.branches=t,n.cell.markers=e,this.branches=[n]}cells(t,e,n){if(t<this.zoom||e.intersects(this.cell.bounds)==!1)return n;n.push(this.cell);for(let s=0;s<this.branches.length;s++)this.branches[s].cells(t,e,n);return n}print(t){console.log(`${"---".repeat(t)}|${this.cell.id} zoom=[${this.zoom}] markers=[${this.cell.markers.length}]`);for(let e=0;e<this.branches.length;e++)this.branches[e].print(t+1)}count(){return this.cell.markers.length+this.branches.reduce((t,e)=>t+e.count(),0)}}class x{capacity;depth;root;constructor(t,e,n){this.capacity=n,this.depth=e,this.root=new u(this,"R",t,{sw:{lat:-90,lng:-180},ne:{lat:90,lng:180}})}add(t){return this.root.add(t)}compact(){this.root.compact()}cells(t,e){const n=new Array;return this.root.cells(t,e,n),n}print(){this.root.print(0)}}const A=16,p=2,k=1,M=A*4;let b,d,E=p,$=k,y=M;const v={update(l,t,e){const n=-Math.floor(Math.log2(l.mapSize/y)),s=new x(n,$,E);for(let o=0;o<t.length;o++){const i=t[o];if(!s.add(i))throw new Error("Failed to add marker to tree")}const r=-n;for(let o=0;o<r;o++)s.compact();b=s,d=e},configure(l){E=l?.process?.visibility?.cell?.capacity??p,$=l?.process?.visibility?.cell?.depth??k,y=l?.process?.visibility?.cell?.size??M},filter(l,t){if(!b||!d)return[];const e=h.create(t);let n=[],s=t.zoom;for(;s<l.zoomMax&&n.length<d;)n=b.cells(s,e).flatMap(r=>r.markers),s++;return n.map(r=>r.index)}};class _{methods;constructor(t){this.methods=t}listen(){self.onmessage=this.onmessage.bind(this)}async onmessage(t){const{id:e,method:n,args:s}=t.data;try{const r=this.methods[n];if(typeof r!="function")throw new Error(`Unknown method: ${n}`);const o=await r(...s),i={id:e,result:o};self.postMessage(i)}catch(r){const o=r instanceof Error?r.message:String(r),i={id:e,error:o};self.postMessage(i)}}}new _(v).listen()})();\n', Sn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Gn], { type: "text/javascript;charset=utf-8" });
128
+ const er = '(function(){"use strict";function w(l,t,e){return{x:T(t)*e,y:I(l)*e}}function m(l,t,e){return{lat:R(t/e),lng:P(l/e)}}function T(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 P(l){return l*360-180}function R(l){return 360/Math.PI*Math.atan(Math.exp((180-l*360)*Math.PI/180))-90}class c{sw;ne;constructor(t,e,n,s){if(n<t)throw new Error(`Invalid bounds: ${t}, ${e}, ${n}, ${s}`);if(s<e)throw new Error(`Invalid bounds: ${t}, ${e}, ${n}, ${s}`);this.sw={lat:t,lng:e},this.ne={lat:n,lng:s}}contains(t,e){return!(t<this.sw.lat||this.ne.lat<t||e<this.sw.lng||this.ne.lng<e)}intersects(t){return!(t.ne.lat<this.sw.lat||this.ne.lat<t.sw.lat||t.ne.lng<this.sw.lng||this.ne.lng<t.sw.lng)}}class h{blockL;blockR;sw;ne;constructor(t,e,n,s){if(n<t)throw new Error(`Invalid bounds: ${t}, ${e}, ${n}, ${s}`);this.sw={lat:t,lng:e},this.ne={lat:n,lng:s},e<s?(this.blockL=new c(t,e,n,s),this.blockR=new c(0,0,0,0)):(this.blockL=new c(t,-180,n,s),this.blockR=new c(t,e,n,180))}static bounds(t){const e=t.bounds,n=t.center;return e.sw.lng<=n.lng&&e.ne.lng<=n.lng?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:e.sw.lng>=n.lng&&e.ne.lng>=n.lng?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:Math.abs(e.ne.lng-n.lng)+Math.abs(e.sw.lng-n.lng)>360?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:e.ne.lng-e.sw.lng>360?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:t.bounds}static create(t){const e=this.bounds(t),n=e.sw,s=e.ne;return new h(n.lat,n.lng,s.lat,s.lng)}static offset(t,e,n){const s=this.bounds(t),r=t.zoom,o=e*Math.pow(2,r),i=w(s.sw.lat,s.sw.lng,o),a=w(s.ne.lat,s.ne.lng,o);let g=Math.max(i.x-n.left,0),f=Math.min(i.y+n.bottom,o),D=Math.min(a.x+n.right,o),N=Math.max(a.y-n.top,0);const z=m(g,f,o),C=m(D,N,o);return new h(z.lat,z.lng,C.lat,C.lng)}contains(t,e){return this.blockL.contains(t,e)||this.blockR.contains(t,e)}intersects(t){return this.blockL.intersects(t)||this.blockR.intersects(t)}}class S{id;bounds;markers;constructor(t,e){this.id=t,this.bounds=e,this.markers=[]}belongs(t){const e=this.bounds.sw;if(t.lat<e.lat||t.lng<e.lng)return!1;const n=this.bounds.ne;return!(n.lat<t.lat||n.lng<t.lng)}neighbours(t,e){const n=Math.abs(t.id.length-this.id.length);if(n>e)return!1;const s=Math.min(this.id.length,t.id.length)-e+n;for(let r=0;r<s;r++)if(this.id[r]!=t.id[r])return!1;return!0}}class u{tree;zoom;cell;branches;constructor(t,e,n,s){this.tree=t,this.zoom=n,this.cell=new S(e,s),this.branches=new Array}split(){const t=this.cell.bounds,e=Math.pow(2,this.tree.depth),n=(t.ne.lat-t.sw.lat)/e,s=(t.ne.lng-t.sw.lng)/e;for(let r=0;r<e;r++)for(let o=0;o<e;o++){const i=t.sw.lat+r*n,a=t.sw.lng+o*s,g=i+n,f=a+s;this.branches.push(new u(this.tree,`${this.cell.id}${r*2+o}`,this.zoom+this.tree.depth,{sw:{lat:i,lng:a},ne:{lat:g,lng:f}}))}}add(t){if(this.cell.belongs(t)==!1)return!1;if(this.cell.markers.length<this.tree.capacity)return this.cell.markers.push(t),!0;this.branches.length==0&&this.split();for(let e=0;e<this.branches.length;e++)if(this.branches[e].add(t))return!0;throw new Error("Failed to add marker to branch")}compact(){if(this.branches.length==0)return;for(let s=0;s<this.branches.length;s++)this.branches[s].compact();const t=new Array,e=new Array;for(let s=0;s<this.branches.length;s++){const r=this.branches[s];t.push(...r.branches),e.push(...r.cell.markers)}const n=new u(this.tree,this.cell.id,this.zoom+this.tree.depth,this.cell.bounds);n.branches=t,n.cell.markers=e,this.branches=[n]}cells(t,e,n){if(t<this.zoom||e.intersects(this.cell.bounds)==!1)return n;n.push(this.cell);for(let s=0;s<this.branches.length;s++)this.branches[s].cells(t,e,n);return n}print(t){console.log(`${"---".repeat(t)}|${this.cell.id} zoom=[${this.zoom}] markers=[${this.cell.markers.length}]`);for(let e=0;e<this.branches.length;e++)this.branches[e].print(t+1)}count(){return this.cell.markers.length+this.branches.reduce((t,e)=>t+e.count(),0)}}class x{capacity;depth;root;constructor(t,e,n){this.capacity=n,this.depth=e,this.root=new u(this,"R",t,{sw:{lat:-90,lng:-180},ne:{lat:90,lng:180}})}add(t){return this.root.add(t)}compact(){this.root.compact()}cells(t,e){const n=new Array;return this.root.cells(t,e,n),n}print(){this.root.print(0)}}const A=16,p=2,k=1,M=A*4;let b,d,E=p,$=k,y=M;const v={update(l,t,e){const n=-Math.floor(Math.log2(l.mapSize/y)),s=new x(n,$,E);for(let o=0;o<t.length;o++){const i=t[o];if(!s.add(i))throw new Error("Failed to add marker to tree")}const r=-n;for(let o=0;o<r;o++)s.compact();b=s,d=e},configure(l){E=l?.process?.visibility?.cell?.capacity??p,$=l?.process?.visibility?.cell?.depth??k,y=l?.process?.visibility?.cell?.size??M},filter(l,t){if(!b||!d)return[];const e=h.create(t);let n=[],s=t.zoom;for(;s<l.zoomMax&&n.length<d;)n=b.cells(s,e).flatMap(r=>r.markers),s++;return n.map(r=>r.index)}};class _{methods;constructor(t){this.methods=t}listen(){self.onmessage=this.onmessage.bind(this)}async onmessage(t){const{id:e,method:n,args:s}=t.data;try{const r=this.methods[n];if(typeof r!="function")throw new Error(`Unknown method: ${n}`);const o=await r(...s),i={id:e,result:o};self.postMessage(i)}catch(r){const o=r instanceof Error?r.message:String(r),i={id:e,error:o};self.postMessage(i)}}}new _(v).listen()})();\n', In = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", er], { type: "text/javascript;charset=utf-8" });
129
129
  function _s(t) {
130
130
  let e;
131
131
  try {
132
- if (e = Sn && (self.URL || self.webkitURL).createObjectURL(Sn), !e) throw "";
132
+ if (e = In && (self.URL || self.webkitURL).createObjectURL(In), !e) throw "";
133
133
  const n = new Worker(e, {
134
134
  name: t?.name
135
135
  });
@@ -138,7 +138,7 @@ function _s(t) {
138
138
  }), n;
139
139
  } catch {
140
140
  return new Worker(
141
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Gn),
141
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(er),
142
142
  {
143
143
  name: t?.name
144
144
  }
@@ -146,24 +146,24 @@ function _s(t) {
146
146
  }
147
147
  }
148
148
  function st(t, e, n) {
149
- return { x: bs(e) * n, y: Ms(t) * n };
149
+ return { x: Ms(e) * n, y: Es(t) * n };
150
150
  }
151
- function Pn(t, e, n) {
152
- return { lat: xs(e / n), lng: Es(t / n) };
151
+ function Tn(t, e, n) {
152
+ return { lat: Ss(e / n), lng: xs(t / n) };
153
153
  }
154
- function bs(t) {
154
+ function Ms(t) {
155
155
  return (180 + t) / 360;
156
156
  }
157
- function Ms(t) {
157
+ function Es(t) {
158
158
  return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + t * Math.PI / 360))) / 360;
159
159
  }
160
- function Es(t) {
160
+ function xs(t) {
161
161
  return t * 360 - 180;
162
162
  }
163
- function xs(t) {
163
+ function Ss(t) {
164
164
  return 360 / Math.PI * Math.atan(Math.exp((180 - t * 360) * Math.PI / 180)) - 90;
165
165
  }
166
- class mt {
166
+ class vt {
167
167
  sw;
168
168
  ne;
169
169
  constructor(e, n, r, s) {
@@ -185,7 +185,7 @@ class ot {
185
185
  ne;
186
186
  constructor(e, n, r, s) {
187
187
  if (r < e) throw new Error(`Invalid bounds: ${e}, ${n}, ${r}, ${s}`);
188
- this.sw = { lat: e, lng: n }, this.ne = { lat: r, lng: s }, n < s ? (this.blockL = new mt(e, n, r, s), this.blockR = new mt(0, 0, 0, 0)) : (this.blockL = new mt(e, -180, r, s), this.blockR = new mt(e, n, r, 180));
188
+ this.sw = { lat: e, lng: n }, this.ne = { lat: r, lng: s }, n < s ? (this.blockL = new vt(e, n, r, s), this.blockR = new vt(0, 0, 0, 0)) : (this.blockL = new vt(e, -180, r, s), this.blockR = new vt(e, n, r, 180));
189
189
  }
190
190
  static bounds(e) {
191
191
  const n = e.bounds, r = e.center;
@@ -203,9 +203,9 @@ class ot {
203
203
  */
204
204
  static offset(e, n, r) {
205
205
  const s = this.bounds(e), i = e.zoom, a = n * Math.pow(2, i), o = st(s.sw.lat, s.sw.lng, a), l = st(s.ne.lat, s.ne.lng, a);
206
- let u = Math.max(o.x - r.left, 0), c = Math.min(o.y + r.bottom, a), f = Math.min(l.x + r.right, a), h = Math.max(l.y - r.top, 0);
207
- const m = Pn(u, c, a), p = Pn(f, h, a);
208
- return new ot(m.lat, m.lng, p.lat, p.lng);
206
+ let u = Math.max(o.x - r.left, 0), c = Math.min(o.y + r.bottom, a), d = Math.min(l.x + r.right, a), f = Math.max(l.y - r.top, 0);
207
+ const m = Tn(u, c, a), h = Tn(d, f, a);
208
+ return new ot(m.lat, m.lng, h.lat, h.lng);
209
209
  }
210
210
  contains(e, n) {
211
211
  return this.blockL.contains(e, n) || this.blockR.contains(e, n);
@@ -214,8 +214,8 @@ class ot {
214
214
  return this.blockL.intersects(e) || this.blockR.intersects(e);
215
215
  }
216
216
  }
217
- const Ss = 75, Ps = 150, In = 25e-5, Is = 1e6, As = 2e6, An = 3e6, Kn = 10, Ut = 16, Qn = 2, Fe = 0.5, Yt = "white", Ts = "darkgreen", er = "0px 2px 2px rgba(0, 0, 0, 0.5)", Tn = 1024;
218
- class Ns {
217
+ const Ps = 75, Is = 150, An = 25e-5, Ts = 1e6, As = 2e6, Nn = 3e6, tr = 10, Wt = 16, nr = 2, Le = 0.5, Xt = "white", Ns = "darkgreen", rr = "0px 2px 2px rgba(0, 0, 0, 0.5)", Cn = 1024;
218
+ class Cs {
219
219
  // Services
220
220
  provider;
221
221
  // State
@@ -223,28 +223,28 @@ class Ns {
223
223
  markersVisible;
224
224
  markerVisibilityTreeWorker;
225
225
  markerVisibilityTreeWorkerClient;
226
- markerVisibilityTreeLimit = Tn;
226
+ markerVisibilityTreeLimit = Cn;
227
227
  constructor(e) {
228
228
  this.provider = e;
229
229
  }
230
230
  set configuration(e) {
231
- this.markerVisibilityTreeWorkerClient?.invoke("configure", e), this.markerVisibilityTreeLimit = e?.process?.visibility?.limit ?? Tn;
231
+ this.markerVisibilityTreeWorkerClient?.invoke("configure", e), this.markerVisibilityTreeLimit = e?.process?.visibility?.limit ?? Cn;
232
232
  }
233
233
  getMarkers() {
234
234
  return Array.from(this.markersVisible ?? []);
235
235
  }
236
236
  async getMarkersDelta(e, n) {
237
237
  if (this.markerVisibilityTreeWorkerClient && this.markers) {
238
- const r = await this.markerVisibilityTreeWorkerClient.invoke("filter", e, n), s = this.markersVisible, i = r.map((o) => this.markers[o]), a = Be.from(s, i);
238
+ const r = await this.markerVisibilityTreeWorkerClient.invoke("filter", e, n), s = this.markersVisible, i = r.map((o) => this.markers[o]), a = je.from(s, i);
239
239
  return this.markersVisible = i, a;
240
240
  } else if (this.markers != this.markersVisible) {
241
- const r = this.markersVisible, s = this.markers, i = Be.from(r, s);
241
+ const r = this.markersVisible, s = this.markers, i = je.from(r, s);
242
242
  return this.markersVisible = s, i;
243
243
  } else
244
- return Be.empty();
244
+ return je.empty();
245
245
  }
246
246
  async updateMarkers(e, n) {
247
- this.markers = n, n.length > this.markerVisibilityTreeLimit ? (this.markerVisibilityTreeWorker = new _s(), this.markerVisibilityTreeWorkerClient = new Jn(this.markerVisibilityTreeWorker), await this.markerVisibilityTreeWorkerClient.invoke(
247
+ this.markers = n, n.length > this.markerVisibilityTreeLimit ? (this.markerVisibilityTreeWorker = new _s(), this.markerVisibilityTreeWorkerClient = new Qn(this.markerVisibilityTreeWorker), await this.markerVisibilityTreeWorkerClient.invoke(
248
248
  "update",
249
249
  e,
250
250
  n.map((r, s) => ({ index: s, lat: r.data.lat, lng: r.data.lng })),
@@ -255,54 +255,56 @@ class Ns {
255
255
  this.markers = void 0, this.markersVisible = void 0, this.markerVisibilityTreeWorker = void 0, this.markerVisibilityTreeWorkerClient = void 0;
256
256
  }
257
257
  }
258
- const Xt = !1;
259
- var Cs = Array.isArray, Rs = Array.prototype.indexOf, He = Array.prototype.includes, Ds = Array.from, Os = Object.defineProperty, it = Object.getOwnPropertyDescriptor, $s = Object.prototype, zs = Array.prototype, Fs = Object.getPrototypeOf, Nn = Object.isExtensible;
260
- function Ls(t) {
258
+ const Jt = !1;
259
+ var Rs = Array.isArray, Ds = Array.prototype.indexOf, He = Array.prototype.includes, Os = Array.from, zs = Object.defineProperty, it = Object.getOwnPropertyDescriptor, $s = Object.prototype, Ls = Array.prototype, Fs = Object.getPrototypeOf, Rn = Object.isExtensible;
260
+ const Vs = () => {
261
+ };
262
+ function js(t) {
261
263
  for (var e = 0; e < t.length; e++)
262
264
  t[e]();
263
265
  }
264
- function tr() {
266
+ function sr() {
265
267
  var t, e, n = new Promise((r, s) => {
266
268
  t = r, e = s;
267
269
  });
268
270
  return { promise: n, resolve: t, reject: e };
269
271
  }
270
- const O = 2, Mt = 4, It = 8, nr = 1 << 24, ge = 16, Se = 32, $e = 64, nn = 128, J = 512, D = 1024, F = 2048, se = 4096, _e = 8192, be = 16384, rr = 32768, Et = 65536, Cn = 1 << 17, sr = 1 << 18, Ge = 1 << 19, Vs = 1 << 20, Oe = 32768, Jt = 1 << 21, rn = 1 << 22, Me = 1 << 23, kt = /* @__PURE__ */ Symbol("$state"), Ve = new class extends Error {
272
+ const O = 2, lt = 4, It = 8, ir = 1 << 24, ge = 16, Se = 32, ze = 64, Gt = 128, K = 512, D = 1024, F = 2048, ie = 4096, be = 8192, _e = 16384, Tt = 32768, xt = 65536, Dn = 1 << 17, ar = 1 << 18, Ge = 1 << 19, Bs = 1 << 20, Oe = 65536, Kt = 1 << 21, sn = 1 << 22, Me = 1 << 23, _t = /* @__PURE__ */ Symbol("$state"), Te = new class extends Error {
271
273
  name = "StaleReactionError";
272
274
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
273
275
  }();
274
- function js() {
276
+ function Us() {
275
277
  throw new Error("https://svelte.dev/e/async_derived_orphan");
276
278
  }
277
- function Bs() {
279
+ function Ws() {
278
280
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
279
281
  }
280
- function Us() {
282
+ function Hs() {
281
283
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
282
284
  }
283
- function Ws() {
285
+ function qs() {
284
286
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
285
287
  }
286
- function qs() {
288
+ function Zs() {
287
289
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
288
290
  }
289
- function Hs() {
291
+ function Ys() {
290
292
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
291
293
  }
292
- const N = /* @__PURE__ */ Symbol();
293
- function Zs() {
294
+ const N = /* @__PURE__ */ Symbol(), Xs = "http://www.w3.org/1999/xhtml";
295
+ function Js() {
294
296
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
295
297
  }
296
- function ir(t) {
298
+ function or(t) {
297
299
  return t === this.v;
298
300
  }
299
- let Ys = !1, ie = null;
300
- function Ze(t) {
301
- ie = t;
301
+ let Gs = !1, ae = null;
302
+ function qe(t) {
303
+ ae = t;
302
304
  }
303
- function sn(t, e = !1, n) {
304
- ie = {
305
- p: ie,
305
+ function an(t, e = !1, n) {
306
+ ae = {
307
+ p: ae,
306
308
  i: !1,
307
309
  c: null,
308
310
  e: null,
@@ -311,80 +313,80 @@ function sn(t, e = !1, n) {
311
313
  l: null
312
314
  };
313
315
  }
314
- function an(t) {
316
+ function on(t) {
315
317
  var e = (
316
318
  /** @type {ComponentContext} */
317
- ie
319
+ ae
318
320
  ), n = e.e;
319
321
  if (n !== null) {
320
322
  e.e = null;
321
323
  for (var r of n)
322
- pi(r);
324
+ yi(r);
323
325
  }
324
- return t !== void 0 && (e.x = t), e.i = !0, ie = e.p, t ?? /** @type {T} */
326
+ return t !== void 0 && (e.x = t), e.i = !0, ae = e.p, t ?? /** @type {T} */
325
327
  {};
326
328
  }
327
- function ar() {
329
+ function lr() {
328
330
  return !0;
329
331
  }
330
- let je = [];
331
- function Xs() {
332
- var t = je;
333
- je = [], Ls(t);
332
+ let Ve = [];
333
+ function Ks() {
334
+ var t = Ve;
335
+ Ve = [], js(t);
334
336
  }
335
337
  function Ne(t) {
336
- if (je.length === 0) {
337
- var e = je;
338
+ if (Ve.length === 0) {
339
+ var e = Ve;
338
340
  queueMicrotask(() => {
339
- e === je && Xs();
341
+ e === Ve && Ks();
340
342
  });
341
343
  }
342
- je.push(t);
344
+ Ve.push(t);
343
345
  }
344
- function or(t) {
346
+ function ur(t) {
345
347
  var e = _;
346
348
  if (e === null)
347
- return w.f |= Me, t;
348
- if ((e.f & rr) === 0) {
349
- if ((e.f & nn) === 0)
350
- throw t;
351
- e.b.error(t);
352
- } else
353
- Ye(t, e);
349
+ return y.f |= Me, t;
350
+ if ((e.f & Tt) === 0 && (e.f & lt) === 0)
351
+ throw t;
352
+ Ze(t, e);
354
353
  }
355
- function Ye(t, e) {
354
+ function Ze(t, e) {
356
355
  for (; e !== null; ) {
357
- if ((e.f & nn) !== 0)
356
+ if ((e.f & Gt) !== 0) {
357
+ if ((e.f & Tt) === 0)
358
+ throw t;
358
359
  try {
359
360
  e.b.error(t);
360
361
  return;
361
362
  } catch (n) {
362
363
  t = n;
363
364
  }
365
+ }
364
366
  e = e.parent;
365
367
  }
366
368
  throw t;
367
369
  }
368
- const Js = -7169;
370
+ const Qs = -7169;
369
371
  function P(t, e) {
370
- t.f = t.f & Js | e;
372
+ t.f = t.f & Qs | e;
371
373
  }
372
- function on(t) {
373
- (t.f & J) !== 0 || t.deps === null ? P(t, D) : P(t, se);
374
+ function ln(t) {
375
+ (t.f & K) !== 0 || t.deps === null ? P(t, D) : P(t, ie);
374
376
  }
375
- function lr(t) {
377
+ function cr(t) {
376
378
  if (t !== null)
377
379
  for (const e of t)
378
- (e.f & O) === 0 || (e.f & Oe) === 0 || (e.f ^= Oe, lr(
380
+ (e.f & O) === 0 || (e.f & Oe) === 0 || (e.f ^= Oe, cr(
379
381
  /** @type {Derived} */
380
382
  e.deps
381
383
  ));
382
384
  }
383
- function ur(t, e, n) {
384
- (t.f & F) !== 0 ? e.add(t) : (t.f & se) !== 0 && n.add(t), lr(t.deps), P(t, D);
385
+ function fr(t, e, n) {
386
+ (t.f & F) !== 0 ? e.add(t) : (t.f & ie) !== 0 && n.add(t), cr(t.deps), P(t, D);
385
387
  }
386
- const vt = /* @__PURE__ */ new Set();
387
- let S = null, te = null, ee = [], ln = null, Gt = !1;
388
+ const gt = /* @__PURE__ */ new Set();
389
+ let S = null, ne = null, G = [], un = null, Qt = !1;
388
390
  class Ee {
389
391
  committed = !1;
390
392
  /**
@@ -409,7 +411,7 @@ class Ee {
409
411
  * If a fork is discarded, we need to destroy any effects that are no longer needed
410
412
  * @type {Set<(batch: Batch) => void>}
411
413
  */
412
- #f = /* @__PURE__ */ new Set();
414
+ #h = /* @__PURE__ */ new Set();
413
415
  /**
414
416
  * The number of async effects that are currently in flight
415
417
  */
@@ -423,12 +425,12 @@ class Ee {
423
425
  * TODO replace with Promise.withResolvers once supported widely enough
424
426
  * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
425
427
  */
426
- #i = null;
428
+ #s = null;
427
429
  /**
428
430
  * Deferred effects (which run after async work has completed) that are DIRTY
429
431
  * @type {Set<Effect>}
430
432
  */
431
- #s = /* @__PURE__ */ new Set();
433
+ #i = /* @__PURE__ */ new Set();
432
434
  /**
433
435
  * Deferred effects that are MAYBE_DIRTY
434
436
  * @type {Set<Effect>}
@@ -464,9 +466,9 @@ class Ee {
464
466
  if (n) {
465
467
  this.#t.delete(e);
466
468
  for (var r of n.d)
467
- P(r, F), oe(r);
469
+ P(r, F), le(r);
468
470
  for (r of n.m)
469
- P(r, se), oe(r);
471
+ P(r, ie), le(r);
470
472
  }
471
473
  }
472
474
  /**
@@ -474,19 +476,19 @@ class Ee {
474
476
  * @param {Effect[]} root_effects
475
477
  */
476
478
  process(e) {
477
- ee = [], this.apply();
479
+ G = [], this.apply();
478
480
  var n = [], r = [];
479
481
  for (const s of e)
480
- this.#l(s, n, r);
482
+ this.#u(s, n, r);
481
483
  if (this.is_deferred()) {
482
- this.#u(r), this.#u(n);
484
+ this.#l(r), this.#l(n);
483
485
  for (const [s, i] of this.#t)
484
- fr(s, i);
486
+ dr(s, i);
485
487
  } else {
486
488
  for (const s of this.#n) s();
487
- this.#n.clear(), this.#r === 0 && this.#c(), S = null, Rn(r), Rn(n), this.#i?.resolve();
489
+ this.#n.clear(), this.#r === 0 && this.#f(), S = null, On(r), On(n), this.#s?.resolve();
488
490
  }
489
- te = null;
491
+ ne = null;
490
492
  }
491
493
  /**
492
494
  * Traverse the effect tree, executing effects or stashing
@@ -495,29 +497,35 @@ class Ee {
495
497
  * @param {Effect[]} effects
496
498
  * @param {Effect[]} render_effects
497
499
  */
498
- #l(e, n, r) {
500
+ #u(e, n, r) {
499
501
  e.f ^= D;
500
502
  for (var s = e.first, i = null; s !== null; ) {
501
- var a = s.f, o = (a & (Se | $e)) !== 0, l = o && (a & D) !== 0, u = l || (a & _e) !== 0 || this.#t.has(s);
503
+ var a = s.f, o = (a & (Se | ze)) !== 0, l = o && (a & D) !== 0, u = l || (a & be) !== 0 || this.#t.has(s);
502
504
  if (!u && s.fn !== null) {
503
- o ? s.f ^= D : i !== null && (a & (Mt | It | nr)) !== 0 ? i.b.defer_effect(s) : (a & Mt) !== 0 ? n.push(s) : ht(s) && ((a & ge) !== 0 && this.#e.add(s), lt(s));
505
+ o ? s.f ^= D : i !== null && (a & (lt | It | ir)) !== 0 ? i.b.defer_effect(s) : (a & lt) !== 0 ? n.push(s) : ht(s) && ((a & ge) !== 0 && this.#e.add(s), Xe(s));
504
506
  var c = s.first;
505
507
  if (c !== null) {
506
508
  s = c;
507
509
  continue;
508
510
  }
509
511
  }
510
- var f = s.parent;
511
- for (s = s.next; s === null && f !== null; )
512
- f === i && (i = null), s = f.next, f = f.parent;
512
+ for (; s !== null; ) {
513
+ s === i && (i = null);
514
+ var d = s.next;
515
+ if (d !== null) {
516
+ s = d;
517
+ break;
518
+ }
519
+ s = s.parent;
520
+ }
513
521
  }
514
522
  }
515
523
  /**
516
524
  * @param {Effect[]} effects
517
525
  */
518
- #u(e) {
526
+ #l(e) {
519
527
  for (var n = 0; n < e.length; n += 1)
520
- ur(e[n], this.#s, this.#e);
528
+ fr(e[n], this.#i, this.#e);
521
529
  }
522
530
  /**
523
531
  * Associate a change to a given source with the current
@@ -526,30 +534,30 @@ class Ee {
526
534
  * @param {any} value
527
535
  */
528
536
  capture(e, n) {
529
- n !== N && !this.previous.has(e) && this.previous.set(e, n), (e.f & Me) === 0 && (this.current.set(e, e.v), te?.set(e, e.v));
537
+ n !== N && !this.previous.has(e) && this.previous.set(e, n), (e.f & Me) === 0 && (this.current.set(e, e.v), ne?.set(e, e.v));
530
538
  }
531
539
  activate() {
532
540
  S = this, this.apply();
533
541
  }
534
542
  deactivate() {
535
- S === this && (S = null, te = null);
543
+ S === this && (S = null, ne = null);
536
544
  }
537
545
  flush() {
538
- if (this.activate(), ee.length > 0) {
539
- if (Gs(), S !== null && S !== this)
546
+ if (this.activate(), G.length > 0) {
547
+ if (ei(), S !== null && S !== this)
540
548
  return;
541
549
  } else this.#r === 0 && this.process([]);
542
550
  this.deactivate();
543
551
  }
544
552
  discard() {
545
- for (const e of this.#f) e(this);
546
- this.#f.clear();
553
+ for (const e of this.#h) e(this);
554
+ this.#h.clear();
547
555
  }
548
- #c() {
549
- if (vt.size > 1) {
556
+ #f() {
557
+ if (gt.size > 1) {
550
558
  this.previous.clear();
551
- var e = te, n = !0;
552
- for (const s of vt) {
559
+ var e = ne, n = !0;
560
+ for (const s of gt) {
553
561
  if (s === this) {
554
562
  n = !1;
555
563
  continue;
@@ -567,23 +575,23 @@ class Ee {
567
575
  continue;
568
576
  const a = [...s.current.keys()].filter((o) => !this.current.has(o));
569
577
  if (a.length > 0) {
570
- var r = ee;
571
- ee = [];
578
+ var r = G;
579
+ G = [];
572
580
  const o = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
573
581
  for (const u of i)
574
- cr(u, a, o, l);
575
- if (ee.length > 0) {
582
+ hr(u, a, o, l);
583
+ if (G.length > 0) {
576
584
  S = s, s.apply();
577
- for (const u of ee)
578
- s.#l(u, [], []);
585
+ for (const u of G)
586
+ s.#u(u, [], []);
579
587
  s.deactivate();
580
588
  }
581
- ee = r;
589
+ G = r;
582
590
  }
583
591
  }
584
- S = null, te = e;
592
+ S = null, ne = e;
585
593
  }
586
- this.committed = !0, vt.delete(this);
594
+ this.committed = !0, gt.delete(this);
587
595
  }
588
596
  /**
589
597
  *
@@ -598,14 +606,14 @@ class Ee {
598
606
  */
599
607
  decrement(e) {
600
608
  this.#r -= 1, e && (this.#o -= 1), !this.#a && (this.#a = !0, Ne(() => {
601
- this.#a = !1, this.is_deferred() ? ee.length > 0 && this.flush() : this.revive();
609
+ this.#a = !1, this.is_deferred() ? G.length > 0 && this.flush() : this.revive();
602
610
  }));
603
611
  }
604
612
  revive() {
605
- for (const e of this.#s)
606
- this.#e.delete(e), P(e, F), oe(e);
613
+ for (const e of this.#i)
614
+ this.#e.delete(e), P(e, F), le(e);
607
615
  for (const e of this.#e)
608
- P(e, se), oe(e);
616
+ P(e, ie), le(e);
609
617
  this.flush();
610
618
  }
611
619
  /** @param {() => void} fn */
@@ -614,15 +622,15 @@ class Ee {
614
622
  }
615
623
  /** @param {(batch: Batch) => void} fn */
616
624
  ondiscard(e) {
617
- this.#f.add(e);
625
+ this.#h.add(e);
618
626
  }
619
627
  settled() {
620
- return (this.#i ??= tr()).promise;
628
+ return (this.#s ??= sr()).promise;
621
629
  }
622
630
  static ensure() {
623
631
  if (S === null) {
624
632
  const e = S = new Ee();
625
- vt.add(S), Ne(() => {
633
+ gt.add(S), Ne(() => {
626
634
  S === e && e.flush();
627
635
  });
628
636
  }
@@ -631,46 +639,46 @@ class Ee {
631
639
  apply() {
632
640
  }
633
641
  }
634
- function Gs() {
635
- Gt = !0;
642
+ function ei() {
643
+ Qt = !0;
636
644
  var t = null;
637
645
  try {
638
- for (var e = 0; ee.length > 0; ) {
646
+ for (var e = 0; G.length > 0; ) {
639
647
  var n = Ee.ensure();
640
648
  if (e++ > 1e3) {
641
649
  var r, s;
642
- Ks();
650
+ ti();
643
651
  }
644
- n.process(ee), xe.clear();
652
+ n.process(G), xe.clear();
645
653
  }
646
654
  } finally {
647
- Gt = !1, ln = null;
655
+ G = [], Qt = !1, un = null;
648
656
  }
649
657
  }
650
- function Ks() {
658
+ function ti() {
651
659
  try {
652
- Bs();
660
+ Ws();
653
661
  } catch (t) {
654
- Ye(t, ln);
662
+ Ze(t, un);
655
663
  }
656
664
  }
657
665
  let ve = null;
658
- function Rn(t) {
666
+ function On(t) {
659
667
  var e = t.length;
660
668
  if (e !== 0) {
661
669
  for (var n = 0; n < e; ) {
662
670
  var r = t[n++];
663
- if ((r.f & (be | _e)) === 0 && ht(r) && (ve = /* @__PURE__ */ new Set(), lt(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? Pr(r) : r.fn = null), ve?.size > 0)) {
671
+ if ((r.f & (_e | be)) === 0 && ht(r) && (ve = /* @__PURE__ */ new Set(), Xe(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Ir(r), ve?.size > 0)) {
664
672
  xe.clear();
665
673
  for (const s of ve) {
666
- if ((s.f & (be | _e)) !== 0) continue;
674
+ if ((s.f & (_e | be)) !== 0) continue;
667
675
  const i = [s];
668
676
  let a = s.parent;
669
677
  for (; a !== null; )
670
678
  ve.has(a) && (ve.delete(a), i.push(a)), a = a.parent;
671
679
  for (let o = i.length - 1; o >= 0; o--) {
672
680
  const l = i[o];
673
- (l.f & (be | _e)) === 0 && lt(l);
681
+ (l.f & (_e | be)) === 0 && Xe(l);
674
682
  }
675
683
  }
676
684
  ve.clear();
@@ -679,30 +687,30 @@ function Rn(t) {
679
687
  ve = null;
680
688
  }
681
689
  }
682
- function cr(t, e, n, r) {
690
+ function hr(t, e, n, r) {
683
691
  if (!n.has(t) && (n.add(t), t.reactions !== null))
684
692
  for (const s of t.reactions) {
685
693
  const i = s.f;
686
- (i & O) !== 0 ? cr(
694
+ (i & O) !== 0 ? hr(
687
695
  /** @type {Derived} */
688
696
  s,
689
697
  e,
690
698
  n,
691
699
  r
692
- ) : (i & (rn | ge)) !== 0 && (i & F) === 0 && hr(s, e, r) && (P(s, F), oe(
700
+ ) : (i & (sn | ge)) !== 0 && (i & F) === 0 && pr(s, e, r) && (P(s, F), le(
693
701
  /** @type {Effect} */
694
702
  s
695
703
  ));
696
704
  }
697
705
  }
698
- function hr(t, e, n) {
706
+ function pr(t, e, n) {
699
707
  const r = n.get(t);
700
708
  if (r !== void 0) return r;
701
709
  if (t.deps !== null)
702
710
  for (const s of t.deps) {
703
711
  if (He.call(e, s))
704
712
  return !0;
705
- if ((s.f & O) !== 0 && hr(
713
+ if ((s.f & O) !== 0 && pr(
706
714
  /** @type {Derived} */
707
715
  s,
708
716
  e,
@@ -716,72 +724,69 @@ function hr(t, e, n) {
716
724
  }
717
725
  return n.set(t, !1), !1;
718
726
  }
719
- function oe(t) {
720
- for (var e = ln = t; e.parent !== null; ) {
727
+ function le(t) {
728
+ for (var e = un = t; e.parent !== null; ) {
721
729
  e = e.parent;
722
730
  var n = e.f;
723
- if (Gt && e === _ && (n & ge) !== 0 && (n & sr) === 0)
731
+ if (Qt && e === _ && (n & ge) !== 0 && (n & ar) === 0)
724
732
  return;
725
- if ((n & ($e | Se)) !== 0) {
733
+ if ((n & (ze | Se)) !== 0) {
726
734
  if ((n & D) === 0) return;
727
735
  e.f ^= D;
728
736
  }
729
737
  }
730
- ee.push(e);
738
+ G.push(e);
731
739
  }
732
- function fr(t, e) {
740
+ function dr(t, e) {
733
741
  if (!((t.f & Se) !== 0 && (t.f & D) !== 0)) {
734
- (t.f & F) !== 0 ? e.d.push(t) : (t.f & se) !== 0 && e.m.push(t), P(t, D);
742
+ (t.f & F) !== 0 ? e.d.push(t) : (t.f & ie) !== 0 && e.m.push(t), P(t, D);
735
743
  for (var n = t.first; n !== null; )
736
- fr(n, e), n = n.next;
744
+ dr(n, e), n = n.next;
737
745
  }
738
746
  }
739
- function Qs(t) {
747
+ function ni(t) {
740
748
  let e = 0, n = At(0), r;
741
749
  return () => {
742
- hn() && (M(n), Mr(() => (e === 0 && (r = Or(() => t(() => at(n)))), e += 1, () => {
750
+ hn() && (E(n), xr(() => (e === 0 && (r = zr(() => t(() => at(n)))), e += 1, () => {
743
751
  Ne(() => {
744
752
  e -= 1, e === 0 && (r?.(), r = void 0, at(n));
745
753
  });
746
754
  })));
747
755
  };
748
756
  }
749
- var ei = Et | Ge | nn;
750
- function ti(t, e, n) {
751
- new ni(t, e, n);
757
+ var ri = xt | Ge;
758
+ function si(t, e, n) {
759
+ new ii(t, e, n);
752
760
  }
753
- class ni {
761
+ class ii {
754
762
  /** @type {Boundary | null} */
755
763
  parent;
756
764
  is_pending = !1;
757
765
  /** @type {TemplateNode} */
758
766
  #n;
759
767
  /** @type {TemplateNode | null} */
760
- #f = null;
768
+ #h = null;
761
769
  /** @type {BoundaryProps} */
762
770
  #r;
763
771
  /** @type {((anchor: Node) => void)} */
764
772
  #o;
765
773
  /** @type {Effect} */
766
- #i;
774
+ #s;
767
775
  /** @type {Effect | null} */
768
- #s = null;
776
+ #i = null;
769
777
  /** @type {Effect | null} */
770
778
  #e = null;
771
779
  /** @type {Effect | null} */
772
780
  #t = null;
773
781
  /** @type {DocumentFragment | null} */
774
782
  #a = null;
775
- /** @type {TemplateNode | null} */
776
- #l = null;
777
783
  #u = 0;
778
- #c = 0;
779
- #d = !1;
780
- #p = !1;
784
+ #l = 0;
785
+ #f = !1;
781
786
  /** @type {Set<Effect>} */
782
- #m = /* @__PURE__ */ new Set();
787
+ #p = /* @__PURE__ */ new Set();
783
788
  /** @type {Set<Effect>} */
784
- #v = /* @__PURE__ */ new Set();
789
+ #d = /* @__PURE__ */ new Set();
785
790
  /**
786
791
  * A source containing the number of pending async deriveds/expressions.
787
792
  * Only created if `$effect.pending()` is used inside the boundary,
@@ -789,9 +794,9 @@ class ni {
789
794
  * calls followed by no-op flushes
790
795
  * @type {Source<number> | null}
791
796
  */
792
- #h = null;
793
- #_ = Qs(() => (this.#h = At(this.#u), () => {
794
- this.#h = null;
797
+ #c = null;
798
+ #w = ni(() => (this.#c = At(this.#u), () => {
799
+ this.#c = null;
795
800
  }));
796
801
  /**
797
802
  * @param {TemplateNode} node
@@ -799,35 +804,29 @@ class ni {
799
804
  * @param {((anchor: Node) => void)} children
800
805
  */
801
806
  constructor(e, n, r) {
802
- this.#n = e, this.#r = n, this.#o = r, this.parent = /** @type {Effect} */
803
- _.b, this.is_pending = !!this.#r.pending, this.#i = gi(() => {
804
- _.b = this;
805
- {
806
- var s = this.#w();
807
- try {
808
- this.#s = Ae(() => r(s));
809
- } catch (i) {
810
- this.error(i);
811
- }
812
- this.#c > 0 ? this.#y() : this.is_pending = !1;
813
- }
814
- return () => {
815
- this.#l?.remove();
816
- };
817
- }, ei);
807
+ this.#n = e, this.#r = n, this.#o = (s) => {
808
+ var i = (
809
+ /** @type {Effect} */
810
+ _
811
+ );
812
+ i.b = this, i.f |= Gt, r(s);
813
+ }, this.parent = /** @type {Effect} */
814
+ _.b, this.#s = Mi(() => {
815
+ this.#v();
816
+ }, ri);
818
817
  }
819
- #b() {
818
+ #y() {
820
819
  try {
821
- this.#s = Ae(() => this.#o(this.#n));
820
+ this.#i = Fe(() => this.#o(this.#n));
822
821
  } catch (e) {
823
822
  this.error(e);
824
823
  }
825
824
  }
826
- #M() {
825
+ #k() {
827
826
  const e = this.#r.pending;
828
- e && (this.#e = Ae(() => e(this.#n)), Ne(() => {
829
- var n = this.#w();
830
- this.#s = this.#g(() => (Ee.ensure(), Ae(() => this.#o(n)))), this.#c > 0 ? this.#y() : (_t(
827
+ e && (this.is_pending = !0, this.#e = Fe(() => e(this.#n)), Ne(() => {
828
+ var n = this.#a = document.createDocumentFragment(), r = _r();
829
+ n.append(r), this.#i = this.#m(() => (Ee.ensure(), Fe(() => this.#o(r)))), this.#l === 0 && (this.#n.before(n), this.#a = null, Mt(
831
830
  /** @type {Effect} */
832
831
  this.#e,
833
832
  () => {
@@ -836,16 +835,30 @@ class ni {
836
835
  ), this.is_pending = !1);
837
836
  }));
838
837
  }
839
- #w() {
840
- var e = this.#n;
841
- return this.is_pending && (this.#l = kr(), this.#n.before(this.#l), e = this.#l), e;
838
+ #v() {
839
+ try {
840
+ if (this.is_pending = this.has_pending_snippet(), this.#l = 0, this.#u = 0, this.#i = Fe(() => {
841
+ this.#o(this.#n);
842
+ }), this.#l > 0) {
843
+ var e = this.#a = document.createDocumentFragment();
844
+ Si(this.#i, e);
845
+ const n = (
846
+ /** @type {(anchor: Node) => void} */
847
+ this.#r.pending
848
+ );
849
+ this.#e = Fe(() => n(this.#n));
850
+ } else
851
+ this.is_pending = !1;
852
+ } catch (n) {
853
+ this.error(n);
854
+ }
842
855
  }
843
856
  /**
844
857
  * Defer an effect inside a pending boundary until the boundary resolves
845
858
  * @param {Effect} effect
846
859
  */
847
860
  defer_effect(e) {
848
- ur(e, this.#m, this.#v);
861
+ fr(e, this.#p, this.#d);
849
862
  }
850
863
  /**
851
864
  * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
@@ -858,46 +871,37 @@ class ni {
858
871
  return !!this.#r.pending;
859
872
  }
860
873
  /**
861
- * @param {() => Effect | null} fn
874
+ * @template T
875
+ * @param {() => T} fn
862
876
  */
863
- #g(e) {
864
- var n = _, r = w, s = ie;
865
- ce(this.#i), K(this.#i), Ze(this.#i.ctx);
877
+ #m(e) {
878
+ var n = _, r = y, s = ae;
879
+ fe(this.#s), ee(this.#s), qe(this.#s.ctx);
866
880
  try {
867
881
  return e();
868
882
  } catch (i) {
869
- return or(i), null;
883
+ return ur(i), null;
870
884
  } finally {
871
- ce(n), K(r), Ze(s);
885
+ fe(n), ee(r), qe(s);
872
886
  }
873
887
  }
874
- #y() {
875
- const e = (
876
- /** @type {(anchor: Node) => void} */
877
- this.#r.pending
878
- );
879
- this.#s !== null && (this.#a = document.createDocumentFragment(), this.#a.append(
880
- /** @type {TemplateNode} */
881
- this.#l
882
- ), ki(this.#s, this.#a)), this.#e === null && (this.#e = Ae(() => e(this.#n)));
883
- }
884
888
  /**
885
889
  * Updates the pending count associated with the currently visible pending snippet,
886
890
  * if any, such that we can replace the snippet with content once work is done
887
891
  * @param {1 | -1} d
888
892
  */
889
- #k(e) {
893
+ #g(e) {
890
894
  if (!this.has_pending_snippet()) {
891
- this.parent && this.parent.#k(e);
895
+ this.parent && this.parent.#g(e);
892
896
  return;
893
897
  }
894
- if (this.#c += e, this.#c === 0) {
898
+ if (this.#l += e, this.#l === 0) {
895
899
  this.is_pending = !1;
896
- for (const n of this.#m)
897
- P(n, F), oe(n);
898
- for (const n of this.#v)
899
- P(n, se), oe(n);
900
- this.#m.clear(), this.#v.clear(), this.#e && _t(this.#e, () => {
900
+ for (const n of this.#p)
901
+ P(n, F), le(n);
902
+ for (const n of this.#d)
903
+ P(n, ie), le(n);
904
+ this.#p.clear(), this.#d.clear(), this.#e && Mt(this.#e, () => {
901
905
  this.#e = null;
902
906
  }), this.#a && (this.#n.before(this.#a), this.#a = null);
903
907
  }
@@ -909,65 +913,69 @@ class ni {
909
913
  * @param {1 | -1} d
910
914
  */
911
915
  update_pending_count(e) {
912
- this.#k(e), this.#u += e, !(!this.#h || this.#d) && (this.#d = !0, Ne(() => {
913
- this.#d = !1, this.#h && xt(this.#h, this.#u);
916
+ this.#g(e), this.#u += e, !(!this.#c || this.#f) && (this.#f = !0, Ne(() => {
917
+ this.#f = !1, this.#c && St(this.#c, this.#u);
914
918
  }));
915
919
  }
916
920
  get_effect_pending() {
917
- return this.#_(), M(
921
+ return this.#w(), E(
918
922
  /** @type {Source<number>} */
919
- this.#h
923
+ this.#c
920
924
  );
921
925
  }
922
926
  /** @param {unknown} error */
923
927
  error(e) {
924
928
  var n = this.#r.onerror;
925
929
  let r = this.#r.failed;
926
- if (this.#p || !n && !r)
930
+ if (!n && !r)
927
931
  throw e;
928
- this.#s && (le(this.#s), this.#s = null), this.#e && (le(this.#e), this.#e = null), this.#t && (le(this.#t), this.#t = null);
932
+ this.#i && (ue(this.#i), this.#i = null), this.#e && (ue(this.#e), this.#e = null), this.#t && (ue(this.#t), this.#t = null);
929
933
  var s = !1, i = !1;
930
934
  const a = () => {
931
935
  if (s) {
932
- Zs();
936
+ Js();
933
937
  return;
934
938
  }
935
- s = !0, i && Hs(), Ee.ensure(), this.#u = 0, this.#t !== null && _t(this.#t, () => {
939
+ s = !0, i && Ys(), this.#t !== null && Mt(this.#t, () => {
936
940
  this.#t = null;
937
- }), this.is_pending = this.has_pending_snippet(), this.#s = this.#g(() => (this.#p = !1, Ae(() => this.#o(this.#n)))), this.#c > 0 ? this.#y() : this.is_pending = !1;
941
+ }), this.#m(() => {
942
+ Ee.ensure(), this.#v();
943
+ });
938
944
  };
939
945
  Ne(() => {
940
946
  try {
941
947
  i = !0, n?.(e, a), i = !1;
942
948
  } catch (o) {
943
- Ye(o, this.#i && this.#i.parent);
949
+ Ze(o, this.#s && this.#s.parent);
944
950
  }
945
- r && (this.#t = this.#g(() => {
946
- Ee.ensure(), this.#p = !0;
951
+ r && (this.#t = this.#m(() => {
952
+ Ee.ensure();
947
953
  try {
948
- return Ae(() => {
949
- r(
954
+ return Fe(() => {
955
+ var o = (
956
+ /** @type {Effect} */
957
+ _
958
+ );
959
+ o.b = this, o.f |= Gt, r(
950
960
  this.#n,
951
961
  () => e,
952
962
  () => a
953
963
  );
954
964
  });
955
965
  } catch (o) {
956
- return Ye(
966
+ return Ze(
957
967
  o,
958
968
  /** @type {Effect} */
959
- this.#i.parent
969
+ this.#s.parent
960
970
  ), null;
961
- } finally {
962
- this.#p = !1;
963
971
  }
964
972
  }));
965
973
  });
966
974
  }
967
975
  }
968
- function ri(t, e, n, r) {
969
- const s = ii;
970
- var i = t.filter((h) => !h.settled);
976
+ function ai(t, e, n, r) {
977
+ const s = li;
978
+ var i = t.filter((f) => !f.settled);
971
979
  if (n.length === 0 && i.length === 0) {
972
980
  r(e.map(s));
973
981
  return;
@@ -975,45 +983,45 @@ function ri(t, e, n, r) {
975
983
  var a = S, o = (
976
984
  /** @type {Effect} */
977
985
  _
978
- ), l = si(), u = i.length === 1 ? i[0].promise : i.length > 1 ? Promise.all(i.map((h) => h.promise)) : null;
979
- function c(h) {
986
+ ), l = oi(), u = i.length === 1 ? i[0].promise : i.length > 1 ? Promise.all(i.map((f) => f.promise)) : null;
987
+ function c(f) {
980
988
  l();
981
989
  try {
982
- r(h);
990
+ r(f);
983
991
  } catch (m) {
984
- (o.f & be) === 0 && Ye(m, o);
992
+ (o.f & _e) === 0 && Ze(m, o);
985
993
  }
986
- a?.deactivate(), Kt();
994
+ a?.deactivate(), en();
987
995
  }
988
996
  if (n.length === 0) {
989
997
  u.then(() => c(e.map(s)));
990
998
  return;
991
999
  }
992
- function f() {
993
- l(), Promise.all(n.map((h) => /* @__PURE__ */ ai(h))).then((h) => c([...e.map(s), ...h])).catch((h) => Ye(h, o));
1000
+ function d() {
1001
+ l(), Promise.all(n.map((f) => /* @__PURE__ */ ui(f))).then((f) => c([...e.map(s), ...f])).catch((f) => Ze(f, o));
994
1002
  }
995
- u ? u.then(f) : f();
1003
+ u ? u.then(d) : d();
996
1004
  }
997
- function si() {
998
- var t = _, e = w, n = ie, r = S;
1005
+ function oi() {
1006
+ var t = _, e = y, n = ae, r = S;
999
1007
  return function(i = !0) {
1000
- ce(t), K(e), Ze(n), i && r?.activate();
1008
+ fe(t), ee(e), qe(n), i && r?.activate();
1001
1009
  };
1002
1010
  }
1003
- function Kt() {
1004
- ce(null), K(null), Ze(null);
1011
+ function en() {
1012
+ fe(null), ee(null), qe(null);
1005
1013
  }
1006
1014
  // @__NO_SIDE_EFFECTS__
1007
- function ii(t) {
1008
- var e = O | F, n = w !== null && (w.f & O) !== 0 ? (
1015
+ function li(t) {
1016
+ var e = O | F, n = y !== null && (y.f & O) !== 0 ? (
1009
1017
  /** @type {Derived} */
1010
- w
1018
+ y
1011
1019
  ) : null;
1012
1020
  return _ !== null && (_.f |= Ge), {
1013
- ctx: ie,
1021
+ ctx: ae,
1014
1022
  deps: null,
1015
1023
  effects: null,
1016
- equals: ir,
1024
+ equals: or,
1017
1025
  f: e,
1018
1026
  fn: t,
1019
1027
  reactions: null,
@@ -1028,12 +1036,12 @@ function ii(t) {
1028
1036
  };
1029
1037
  }
1030
1038
  // @__NO_SIDE_EFFECTS__
1031
- function ai(t, e, n) {
1039
+ function ui(t, e, n) {
1032
1040
  let r = (
1033
1041
  /** @type {Effect | null} */
1034
1042
  _
1035
1043
  );
1036
- r === null && js();
1044
+ r === null && Us();
1037
1045
  var s = (
1038
1046
  /** @type {Boundary} */
1039
1047
  r.b
@@ -1044,66 +1052,66 @@ function ai(t, e, n) {
1044
1052
  ), a = At(
1045
1053
  /** @type {V} */
1046
1054
  N
1047
- ), o = !w, l = /* @__PURE__ */ new Map();
1048
- return vi(() => {
1049
- var u = tr();
1055
+ ), o = !y, l = /* @__PURE__ */ new Map();
1056
+ return _i(() => {
1057
+ var u = sr();
1050
1058
  i = u.promise;
1051
1059
  try {
1052
1060
  Promise.resolve(t()).then(u.resolve, u.reject).then(() => {
1053
- c === S && c.committed && c.deactivate(), Kt();
1061
+ c === S && c.committed && c.deactivate(), en();
1054
1062
  });
1055
1063
  } catch (m) {
1056
- u.reject(m), Kt();
1064
+ u.reject(m), en();
1057
1065
  }
1058
1066
  var c = (
1059
1067
  /** @type {Batch} */
1060
1068
  S
1061
1069
  );
1062
1070
  if (o) {
1063
- var f = s.is_rendered();
1064
- s.update_pending_count(1), c.increment(f), l.get(c)?.reject(Ve), l.delete(c), l.set(c, u);
1071
+ var d = s.is_rendered();
1072
+ s.update_pending_count(1), c.increment(d), l.get(c)?.reject(Te), l.delete(c), l.set(c, u);
1065
1073
  }
1066
- const h = (m, p = void 0) => {
1067
- if (c.activate(), p)
1068
- p !== Ve && (a.f |= Me, xt(a, p));
1074
+ const f = (m, h = void 0) => {
1075
+ if (c.activate(), h)
1076
+ h !== Te && (a.f |= Me, St(a, h));
1069
1077
  else {
1070
- (a.f & Me) !== 0 && (a.f ^= Me), xt(a, m);
1071
- for (const [v, x] of l) {
1078
+ (a.f & Me) !== 0 && (a.f ^= Me), St(a, m);
1079
+ for (const [v, b] of l) {
1072
1080
  if (l.delete(v), v === c) break;
1073
- x.reject(Ve);
1081
+ b.reject(Te);
1074
1082
  }
1075
1083
  }
1076
- o && (s.update_pending_count(-1), c.decrement(f));
1084
+ o && (s.update_pending_count(-1), c.decrement(d));
1077
1085
  };
1078
- u.promise.then(h, (m) => h(null, m || "unknown"));
1079
- }), fi(() => {
1086
+ u.promise.then(f, (m) => f(null, m || "unknown"));
1087
+ }), wi(() => {
1080
1088
  for (const u of l.values())
1081
- u.reject(Ve);
1089
+ u.reject(Te);
1082
1090
  }), new Promise((u) => {
1083
- function c(f) {
1084
- function h() {
1085
- f === i ? u(a) : c(i);
1091
+ function c(d) {
1092
+ function f() {
1093
+ d === i ? u(a) : c(i);
1086
1094
  }
1087
- f.then(h, h);
1095
+ d.then(f, f);
1088
1096
  }
1089
1097
  c(i);
1090
1098
  });
1091
1099
  }
1092
- function pr(t) {
1100
+ function ci(t) {
1093
1101
  var e = t.effects;
1094
1102
  if (e !== null) {
1095
1103
  t.effects = null;
1096
1104
  for (var n = 0; n < e.length; n += 1)
1097
- le(
1105
+ ue(
1098
1106
  /** @type {Effect} */
1099
1107
  e[n]
1100
1108
  );
1101
1109
  }
1102
1110
  }
1103
- function oi(t) {
1111
+ function fi(t) {
1104
1112
  for (var e = t.parent; e !== null; ) {
1105
1113
  if ((e.f & O) === 0)
1106
- return (e.f & be) === 0 ? (
1114
+ return (e.f & _e) === 0 ? (
1107
1115
  /** @type {Effect} */
1108
1116
  e
1109
1117
  ) : null;
@@ -1111,77 +1119,87 @@ function oi(t) {
1111
1119
  }
1112
1120
  return null;
1113
1121
  }
1114
- function un(t) {
1122
+ function cn(t) {
1115
1123
  var e, n = _;
1116
- ce(oi(t));
1124
+ fe(fi(t));
1117
1125
  try {
1118
- t.f &= ~Oe, pr(t), e = Cr(t);
1126
+ t.f &= ~Oe, ci(t), e = Rr(t);
1119
1127
  } finally {
1120
- ce(n);
1128
+ fe(n);
1121
1129
  }
1122
1130
  return e;
1123
1131
  }
1124
- function dr(t) {
1125
- var e = un(t);
1126
- if (!t.equals(e) && (t.wv = Tr(), (!S?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
1132
+ function mr(t) {
1133
+ var e = cn(t);
1134
+ if (!t.equals(e) && (t.wv = Nr(), (!S?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
1127
1135
  P(t, D);
1128
1136
  return;
1129
1137
  }
1130
- Xe || (te !== null ? (hn() || S?.is_fork) && te.set(t, e) : on(t));
1138
+ Ye || (ne !== null ? (hn() || S?.is_fork) && ne.set(t, e) : ln(t));
1139
+ }
1140
+ function hi(t) {
1141
+ if (t.effects !== null)
1142
+ for (const e of t.effects)
1143
+ (e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(Te), e.teardown = Vs, e.ac = null, ut(e, 0), pn(e));
1131
1144
  }
1132
- let Qt = /* @__PURE__ */ new Set();
1145
+ function vr(t) {
1146
+ if (t.effects !== null)
1147
+ for (const e of t.effects)
1148
+ e.teardown && Xe(e);
1149
+ }
1150
+ let tn = /* @__PURE__ */ new Set();
1133
1151
  const xe = /* @__PURE__ */ new Map();
1134
- let mr = !1;
1152
+ let gr = !1;
1135
1153
  function At(t, e) {
1136
1154
  var n = {
1137
1155
  f: 0,
1138
1156
  // TODO ideally we could skip this altogether, but it causes type errors
1139
1157
  v: t,
1140
1158
  reactions: null,
1141
- equals: ir,
1159
+ equals: or,
1142
1160
  rv: 0,
1143
1161
  wv: 0
1144
1162
  };
1145
1163
  return n;
1146
1164
  }
1147
1165
  // @__NO_SIDE_EFFECTS__
1148
- function B(t, e) {
1166
+ function U(t, e) {
1149
1167
  const n = At(t);
1150
- return _i(n), n;
1168
+ return Pi(n), n;
1151
1169
  }
1152
- function W(t, e, n = !1) {
1153
- w !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1170
+ function H(t, e, n = !1) {
1171
+ y !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1154
1172
  // to ensure we error if state is set inside an inspect effect
1155
- (!ne || (w.f & Cn) !== 0) && ar() && (w.f & (O | ge | rn | Cn)) !== 0 && (G === null || !He.call(G, t)) && qs();
1173
+ (!re || (y.f & Dn) !== 0) && lr() && (y.f & (O | ge | sn | Dn)) !== 0 && (Q === null || !He.call(Q, t)) && Zs();
1156
1174
  let r = n ? tt(e) : e;
1157
- return xt(t, r);
1175
+ return St(t, r);
1158
1176
  }
1159
- function xt(t, e) {
1177
+ function St(t, e) {
1160
1178
  if (!t.equals(e)) {
1161
1179
  var n = t.v;
1162
- Xe ? xe.set(t, e) : xe.set(t, n), t.v = e;
1180
+ Ye ? xe.set(t, e) : xe.set(t, n), t.v = e;
1163
1181
  var r = Ee.ensure();
1164
1182
  if (r.capture(t, n), (t.f & O) !== 0) {
1165
1183
  const s = (
1166
1184
  /** @type {Derived} */
1167
1185
  t
1168
1186
  );
1169
- (t.f & F) !== 0 && un(s), on(s);
1187
+ (t.f & F) !== 0 && cn(s), ln(s);
1170
1188
  }
1171
- t.wv = Tr(), vr(t, F), _ !== null && (_.f & D) !== 0 && (_.f & (Se | $e)) === 0 && (X === null ? bi([t]) : X.push(t)), !r.is_fork && Qt.size > 0 && !mr && li();
1189
+ t.wv = Nr(), wr(t, F), _ !== null && (_.f & D) !== 0 && (_.f & (Se | ze)) === 0 && (J === null ? Ii([t]) : J.push(t)), !r.is_fork && tn.size > 0 && !gr && pi();
1172
1190
  }
1173
1191
  return e;
1174
1192
  }
1175
- function li() {
1176
- mr = !1;
1177
- for (const t of Qt)
1178
- (t.f & D) !== 0 && P(t, se), ht(t) && lt(t);
1179
- Qt.clear();
1193
+ function pi() {
1194
+ gr = !1;
1195
+ for (const t of tn)
1196
+ (t.f & D) !== 0 && P(t, ie), ht(t) && Xe(t);
1197
+ tn.clear();
1180
1198
  }
1181
1199
  function at(t) {
1182
- W(t, t.v + 1);
1200
+ H(t, t.v + 1);
1183
1201
  }
1184
- function vr(t, e) {
1202
+ function wr(t, e) {
1185
1203
  var n = t.reactions;
1186
1204
  if (n !== null)
1187
1205
  for (var r = n.length, s = 0; s < r; s++) {
@@ -1191,31 +1209,31 @@ function vr(t, e) {
1191
1209
  /** @type {Derived} */
1192
1210
  i
1193
1211
  );
1194
- te?.delete(l), (a & Oe) === 0 && (a & J && (i.f |= Oe), vr(l, se));
1212
+ ne?.delete(l), (a & Oe) === 0 && (a & K && (i.f |= Oe), wr(l, ie));
1195
1213
  } else o && ((a & ge) !== 0 && ve !== null && ve.add(
1196
1214
  /** @type {Effect} */
1197
1215
  i
1198
- ), oe(
1216
+ ), le(
1199
1217
  /** @type {Effect} */
1200
1218
  i
1201
1219
  ));
1202
1220
  }
1203
1221
  }
1204
1222
  function tt(t) {
1205
- if (typeof t != "object" || t === null || kt in t)
1223
+ if (typeof t != "object" || t === null || _t in t)
1206
1224
  return t;
1207
1225
  const e = Fs(t);
1208
- if (e !== $s && e !== zs)
1226
+ if (e !== $s && e !== Ls)
1209
1227
  return t;
1210
- var n = /* @__PURE__ */ new Map(), r = Cs(t), s = /* @__PURE__ */ B(0), i = Ce, a = (o) => {
1228
+ var n = /* @__PURE__ */ new Map(), r = Rs(t), s = /* @__PURE__ */ U(0), i = Ce, a = (o) => {
1211
1229
  if (Ce === i)
1212
1230
  return o();
1213
- var l = w, u = Ce;
1214
- K(null), zn(i);
1231
+ var l = y, u = Ce;
1232
+ ee(null), Fn(i);
1215
1233
  var c = o();
1216
- return K(l), zn(u), c;
1234
+ return ee(l), Fn(u), c;
1217
1235
  };
1218
- return r && n.set("length", /* @__PURE__ */ B(
1236
+ return r && n.set("length", /* @__PURE__ */ U(
1219
1237
  /** @type {any[]} */
1220
1238
  t.length
1221
1239
  )), new Proxy(
@@ -1223,34 +1241,34 @@ function tt(t) {
1223
1241
  t,
1224
1242
  {
1225
1243
  defineProperty(o, l, u) {
1226
- (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Us();
1244
+ (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Hs();
1227
1245
  var c = n.get(l);
1228
- return c === void 0 ? c = a(() => {
1229
- var f = /* @__PURE__ */ B(u.value);
1230
- return n.set(l, f), f;
1231
- }) : W(c, u.value, !0), !0;
1246
+ return c === void 0 ? a(() => {
1247
+ var d = /* @__PURE__ */ U(u.value);
1248
+ return n.set(l, d), d;
1249
+ }) : H(c, u.value, !0), !0;
1232
1250
  },
1233
1251
  deleteProperty(o, l) {
1234
1252
  var u = n.get(l);
1235
1253
  if (u === void 0) {
1236
1254
  if (l in o) {
1237
- const c = a(() => /* @__PURE__ */ B(N));
1255
+ const c = a(() => /* @__PURE__ */ U(N));
1238
1256
  n.set(l, c), at(s);
1239
1257
  }
1240
1258
  } else
1241
- W(u, N), at(s);
1259
+ H(u, N), at(s);
1242
1260
  return !0;
1243
1261
  },
1244
1262
  get(o, l, u) {
1245
- if (l === kt)
1263
+ if (l === _t)
1246
1264
  return t;
1247
- var c = n.get(l), f = l in o;
1248
- if (c === void 0 && (!f || it(o, l)?.writable) && (c = a(() => {
1249
- var m = tt(f ? o[l] : N), p = /* @__PURE__ */ B(m);
1250
- return p;
1265
+ var c = n.get(l), d = l in o;
1266
+ if (c === void 0 && (!d || it(o, l)?.writable) && (c = a(() => {
1267
+ var m = tt(d ? o[l] : N), h = /* @__PURE__ */ U(m);
1268
+ return h;
1251
1269
  }), n.set(l, c)), c !== void 0) {
1252
- var h = M(c);
1253
- return h === N ? void 0 : h;
1270
+ var f = E(c);
1271
+ return f === N ? void 0 : f;
1254
1272
  }
1255
1273
  return Reflect.get(o, l, u);
1256
1274
  },
@@ -1258,134 +1276,140 @@ function tt(t) {
1258
1276
  var u = Reflect.getOwnPropertyDescriptor(o, l);
1259
1277
  if (u && "value" in u) {
1260
1278
  var c = n.get(l);
1261
- c && (u.value = M(c));
1279
+ c && (u.value = E(c));
1262
1280
  } else if (u === void 0) {
1263
- var f = n.get(l), h = f?.v;
1264
- if (f !== void 0 && h !== N)
1281
+ var d = n.get(l), f = d?.v;
1282
+ if (d !== void 0 && f !== N)
1265
1283
  return {
1266
1284
  enumerable: !0,
1267
1285
  configurable: !0,
1268
- value: h,
1286
+ value: f,
1269
1287
  writable: !0
1270
1288
  };
1271
1289
  }
1272
1290
  return u;
1273
1291
  },
1274
1292
  has(o, l) {
1275
- if (l === kt)
1293
+ if (l === _t)
1276
1294
  return !0;
1277
1295
  var u = n.get(l), c = u !== void 0 && u.v !== N || Reflect.has(o, l);
1278
1296
  if (u !== void 0 || _ !== null && (!c || it(o, l)?.writable)) {
1279
1297
  u === void 0 && (u = a(() => {
1280
- var h = c ? tt(o[l]) : N, m = /* @__PURE__ */ B(h);
1298
+ var f = c ? tt(o[l]) : N, m = /* @__PURE__ */ U(f);
1281
1299
  return m;
1282
1300
  }), n.set(l, u));
1283
- var f = M(u);
1284
- if (f === N)
1301
+ var d = E(u);
1302
+ if (d === N)
1285
1303
  return !1;
1286
1304
  }
1287
1305
  return c;
1288
1306
  },
1289
1307
  set(o, l, u, c) {
1290
- var f = n.get(l), h = l in o;
1308
+ var d = n.get(l), f = l in o;
1291
1309
  if (r && l === "length")
1292
1310
  for (var m = u; m < /** @type {Source<number>} */
1293
- f.v; m += 1) {
1294
- var p = n.get(m + "");
1295
- p !== void 0 ? W(p, N) : m in o && (p = a(() => /* @__PURE__ */ B(N)), n.set(m + "", p));
1311
+ d.v; m += 1) {
1312
+ var h = n.get(m + "");
1313
+ h !== void 0 ? H(h, N) : m in o && (h = a(() => /* @__PURE__ */ U(N)), n.set(m + "", h));
1296
1314
  }
1297
- if (f === void 0)
1298
- (!h || it(o, l)?.writable) && (f = a(() => /* @__PURE__ */ B(void 0)), W(f, tt(u)), n.set(l, f));
1315
+ if (d === void 0)
1316
+ (!f || it(o, l)?.writable) && (d = a(() => /* @__PURE__ */ U(void 0)), H(d, tt(u)), n.set(l, d));
1299
1317
  else {
1300
- h = f.v !== N;
1318
+ f = d.v !== N;
1301
1319
  var v = a(() => tt(u));
1302
- W(f, v);
1320
+ H(d, v);
1303
1321
  }
1304
- var x = Reflect.getOwnPropertyDescriptor(o, l);
1305
- if (x?.set && x.set.call(c, u), !h) {
1322
+ var b = Reflect.getOwnPropertyDescriptor(o, l);
1323
+ if (b?.set && b.set.call(c, u), !f) {
1306
1324
  if (r && typeof l == "string") {
1307
- var H = (
1325
+ var z = (
1308
1326
  /** @type {Source<number>} */
1309
1327
  n.get("length")
1310
- ), he = Number(l);
1311
- Number.isInteger(he) && he >= H.v && W(H, he + 1);
1328
+ ), Z = Number(l);
1329
+ Number.isInteger(Z) && Z >= z.v && H(z, Z + 1);
1312
1330
  }
1313
1331
  at(s);
1314
1332
  }
1315
1333
  return !0;
1316
1334
  },
1317
1335
  ownKeys(o) {
1318
- M(s);
1319
- var l = Reflect.ownKeys(o).filter((f) => {
1320
- var h = n.get(f);
1321
- return h === void 0 || h.v !== N;
1336
+ E(s);
1337
+ var l = Reflect.ownKeys(o).filter((d) => {
1338
+ var f = n.get(d);
1339
+ return f === void 0 || f.v !== N;
1322
1340
  });
1323
1341
  for (var [u, c] of n)
1324
1342
  c.v !== N && !(u in o) && l.push(u);
1325
1343
  return l;
1326
1344
  },
1327
1345
  setPrototypeOf() {
1328
- Ws();
1346
+ qs();
1329
1347
  }
1330
1348
  }
1331
1349
  );
1332
1350
  }
1333
- var Dn, gr, yr, wr;
1334
- function ui() {
1335
- if (Dn === void 0) {
1336
- Dn = window, gr = /Firefox/.test(navigator.userAgent);
1351
+ var zn, yr, kr, br;
1352
+ function di() {
1353
+ if (zn === void 0) {
1354
+ zn = window, yr = /Firefox/.test(navigator.userAgent);
1337
1355
  var t = Element.prototype, e = Node.prototype, n = Text.prototype;
1338
- yr = it(e, "firstChild").get, wr = it(e, "nextSibling").get, Nn(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Nn(n) && (n.__t = void 0);
1356
+ kr = it(e, "firstChild").get, br = it(e, "nextSibling").get, Rn(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Rn(n) && (n.__t = void 0);
1339
1357
  }
1340
1358
  }
1341
- function kr(t = "") {
1359
+ function _r(t = "") {
1342
1360
  return document.createTextNode(t);
1343
1361
  }
1344
1362
  // @__NO_SIDE_EFFECTS__
1345
- function _r(t) {
1363
+ function Mr(t) {
1346
1364
  return (
1347
1365
  /** @type {TemplateNode | null} */
1348
- yr.call(t)
1366
+ kr.call(t)
1349
1367
  );
1350
1368
  }
1351
1369
  // @__NO_SIDE_EFFECTS__
1352
- function cn(t) {
1370
+ function fn(t) {
1353
1371
  return (
1354
1372
  /** @type {TemplateNode | null} */
1355
- wr.call(t)
1373
+ br.call(t)
1356
1374
  );
1357
1375
  }
1358
- function On(t, e) {
1359
- return /* @__PURE__ */ _r(t);
1376
+ function $n(t, e) {
1377
+ return /* @__PURE__ */ Mr(t);
1360
1378
  }
1361
- function ci(t, e = 1, n = !1) {
1379
+ function mi(t, e = 1, n = !1) {
1362
1380
  let r = t;
1363
1381
  for (; e--; )
1364
1382
  r = /** @type {TemplateNode} */
1365
- /* @__PURE__ */ cn(r);
1383
+ /* @__PURE__ */ fn(r);
1366
1384
  return r;
1367
1385
  }
1368
- function br(t) {
1369
- var e = w, n = _;
1370
- K(null), ce(null);
1386
+ function vi(t, e, n) {
1387
+ return (
1388
+ /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
1389
+ document.createElementNS(Xs, t, void 0)
1390
+ );
1391
+ }
1392
+ function Er(t) {
1393
+ var e = y, n = _;
1394
+ ee(null), fe(null);
1371
1395
  try {
1372
1396
  return t();
1373
1397
  } finally {
1374
- K(e), ce(n);
1398
+ ee(e), fe(n);
1375
1399
  }
1376
1400
  }
1377
- function hi(t, e) {
1401
+ function gi(t, e) {
1378
1402
  var n = e.last;
1379
1403
  n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t);
1380
1404
  }
1381
- function ye(t, e, n) {
1405
+ function we(t, e, n) {
1382
1406
  var r = _;
1383
- r !== null && (r.f & _e) !== 0 && (t |= _e);
1407
+ r !== null && (r.f & be) !== 0 && (t |= be);
1384
1408
  var s = {
1385
- ctx: ie,
1409
+ ctx: ae,
1386
1410
  deps: null,
1387
1411
  nodes: null,
1388
- f: t | F | J,
1412
+ f: t | F | K,
1389
1413
  first: null,
1390
1414
  fn: e,
1391
1415
  last: null,
@@ -1399,121 +1423,121 @@ function ye(t, e, n) {
1399
1423
  };
1400
1424
  if (n)
1401
1425
  try {
1402
- lt(s), s.f |= rr;
1426
+ Xe(s);
1403
1427
  } catch (o) {
1404
- throw le(s), o;
1428
+ throw ue(s), o;
1405
1429
  }
1406
- else e !== null && oe(s);
1430
+ else e !== null && le(s);
1407
1431
  var i = s;
1408
1432
  if (n && i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && // either `null`, or a singular child
1409
- (i.f & Ge) === 0 && (i = i.first, (t & ge) !== 0 && (t & Et) !== 0 && i !== null && (i.f |= Et)), i !== null && (i.parent = r, r !== null && hi(i, r), w !== null && (w.f & O) !== 0 && (t & $e) === 0)) {
1433
+ (i.f & Ge) === 0 && (i = i.first, (t & ge) !== 0 && (t & xt) !== 0 && i !== null && (i.f |= xt)), i !== null && (i.parent = r, r !== null && gi(i, r), y !== null && (y.f & O) !== 0 && (t & ze) === 0)) {
1410
1434
  var a = (
1411
1435
  /** @type {Derived} */
1412
- w
1436
+ y
1413
1437
  );
1414
1438
  (a.effects ??= []).push(i);
1415
1439
  }
1416
1440
  return s;
1417
1441
  }
1418
1442
  function hn() {
1419
- return w !== null && !ne;
1443
+ return y !== null && !re;
1420
1444
  }
1421
- function fi(t) {
1422
- const e = ye(It, null, !1);
1445
+ function wi(t) {
1446
+ const e = we(It, null, !1);
1423
1447
  return P(e, D), e.teardown = t, e;
1424
1448
  }
1425
- function pi(t) {
1426
- return ye(Mt | Vs, t, !1);
1449
+ function yi(t) {
1450
+ return we(lt | Bs, t, !1);
1427
1451
  }
1428
- function di(t) {
1452
+ function ki(t) {
1429
1453
  Ee.ensure();
1430
- const e = ye($e | Ge, t, !0);
1454
+ const e = we(ze | Ge, t, !0);
1431
1455
  return (n = {}) => new Promise((r) => {
1432
- n.outro ? _t(e, () => {
1433
- le(e), r(void 0);
1434
- }) : (le(e), r(void 0));
1456
+ n.outro ? Mt(e, () => {
1457
+ ue(e), r(void 0);
1458
+ }) : (ue(e), r(void 0));
1435
1459
  });
1436
1460
  }
1437
- function mi(t) {
1438
- return ye(Mt, t, !1);
1461
+ function bi(t) {
1462
+ return we(lt, t, !1);
1439
1463
  }
1440
- function vi(t) {
1441
- return ye(rn | Ge, t, !0);
1464
+ function _i(t) {
1465
+ return we(sn | Ge, t, !0);
1442
1466
  }
1443
- function Mr(t, e = 0) {
1444
- return ye(It | e, t, !0);
1467
+ function xr(t, e = 0) {
1468
+ return we(It | e, t, !0);
1445
1469
  }
1446
- function Er(t, e = [], n = [], r = []) {
1447
- ri(r, e, n, (s) => {
1448
- ye(It, () => t(...s.map(M)), !0);
1470
+ function Sr(t, e = [], n = [], r = []) {
1471
+ ai(r, e, n, (s) => {
1472
+ we(It, () => t(...s.map(E)), !0);
1449
1473
  });
1450
1474
  }
1451
- function gi(t, e = 0) {
1452
- var n = ye(ge | e, t, !0);
1475
+ function Mi(t, e = 0) {
1476
+ var n = we(ge | e, t, !0);
1453
1477
  return n;
1454
1478
  }
1455
- function Ae(t) {
1456
- return ye(Se | Ge, t, !0);
1479
+ function Fe(t) {
1480
+ return we(Se | Ge, t, !0);
1457
1481
  }
1458
- function xr(t) {
1482
+ function Pr(t) {
1459
1483
  var e = t.teardown;
1460
1484
  if (e !== null) {
1461
- const n = Xe, r = w;
1462
- $n(!0), K(null);
1485
+ const n = Ye, r = y;
1486
+ Ln(!0), ee(null);
1463
1487
  try {
1464
1488
  e.call(null);
1465
1489
  } finally {
1466
- $n(n), K(r);
1490
+ Ln(n), ee(r);
1467
1491
  }
1468
1492
  }
1469
1493
  }
1470
- function Sr(t, e = !1) {
1494
+ function pn(t, e = !1) {
1471
1495
  var n = t.first;
1472
1496
  for (t.first = t.last = null; n !== null; ) {
1473
1497
  const s = n.ac;
1474
- s !== null && br(() => {
1475
- s.abort(Ve);
1498
+ s !== null && Er(() => {
1499
+ s.abort(Te);
1476
1500
  });
1477
1501
  var r = n.next;
1478
- (n.f & $e) !== 0 ? n.parent = null : le(n, e), n = r;
1502
+ (n.f & ze) !== 0 ? n.parent = null : ue(n, e), n = r;
1479
1503
  }
1480
1504
  }
1481
- function yi(t) {
1505
+ function Ei(t) {
1482
1506
  for (var e = t.first; e !== null; ) {
1483
1507
  var n = e.next;
1484
- (e.f & Se) === 0 && le(e), e = n;
1508
+ (e.f & Se) === 0 && ue(e), e = n;
1485
1509
  }
1486
1510
  }
1487
- function le(t, e = !0) {
1511
+ function ue(t, e = !0) {
1488
1512
  var n = !1;
1489
- (e || (t.f & sr) !== 0) && t.nodes !== null && t.nodes.end !== null && (wi(
1513
+ (e || (t.f & ar) !== 0) && t.nodes !== null && t.nodes.end !== null && (xi(
1490
1514
  t.nodes.start,
1491
1515
  /** @type {TemplateNode} */
1492
1516
  t.nodes.end
1493
- ), n = !0), Sr(t, e && !n), St(t, 0), P(t, be);
1517
+ ), n = !0), pn(t, e && !n), ut(t, 0), P(t, _e);
1494
1518
  var r = t.nodes && t.nodes.t;
1495
1519
  if (r !== null)
1496
1520
  for (const i of r)
1497
1521
  i.stop();
1498
- xr(t);
1522
+ Pr(t);
1499
1523
  var s = t.parent;
1500
- s !== null && s.first !== null && Pr(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1524
+ s !== null && s.first !== null && Ir(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1501
1525
  }
1502
- function wi(t, e) {
1526
+ function xi(t, e) {
1503
1527
  for (; t !== null; ) {
1504
- var n = t === e ? null : /* @__PURE__ */ cn(t);
1528
+ var n = t === e ? null : /* @__PURE__ */ fn(t);
1505
1529
  t.remove(), t = n;
1506
1530
  }
1507
1531
  }
1508
- function Pr(t) {
1532
+ function Ir(t) {
1509
1533
  var e = t.parent, n = t.prev, r = t.next;
1510
1534
  n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n));
1511
1535
  }
1512
- function _t(t, e, n = !0) {
1536
+ function Mt(t, e, n = !0) {
1513
1537
  var r = [];
1514
- Ir(t, r, !0);
1538
+ Tr(t, r, !0);
1515
1539
  var s = () => {
1516
- n && le(t), e && e();
1540
+ n && ue(t), e && e();
1517
1541
  }, i = r.length;
1518
1542
  if (i > 0) {
1519
1543
  var a = () => --i || s();
@@ -1522,61 +1546,61 @@ function _t(t, e, n = !0) {
1522
1546
  } else
1523
1547
  s();
1524
1548
  }
1525
- function Ir(t, e, n) {
1526
- if ((t.f & _e) === 0) {
1527
- t.f ^= _e;
1549
+ function Tr(t, e, n) {
1550
+ if ((t.f & be) === 0) {
1551
+ t.f ^= be;
1528
1552
  var r = t.nodes && t.nodes.t;
1529
1553
  if (r !== null)
1530
1554
  for (const o of r)
1531
1555
  (o.is_global || n) && e.push(o);
1532
1556
  for (var s = t.first; s !== null; ) {
1533
- var i = s.next, a = (s.f & Et) !== 0 || // If this is a branch effect without a block effect parent,
1557
+ var i = s.next, a = (s.f & xt) !== 0 || // If this is a branch effect without a block effect parent,
1534
1558
  // it means the parent block effect was pruned. In that case,
1535
1559
  // transparency information was transferred to the branch effect.
1536
1560
  (s.f & Se) !== 0 && (t.f & ge) !== 0;
1537
- Ir(s, e, a ? n : !1), s = i;
1561
+ Tr(s, e, a ? n : !1), s = i;
1538
1562
  }
1539
1563
  }
1540
1564
  }
1541
- function ki(t, e) {
1565
+ function Si(t, e) {
1542
1566
  if (t.nodes)
1543
1567
  for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) {
1544
- var s = n === r ? null : /* @__PURE__ */ cn(n);
1568
+ var s = n === r ? null : /* @__PURE__ */ fn(n);
1545
1569
  e.append(n), n = s;
1546
1570
  }
1547
1571
  }
1548
- let bt = !1, Xe = !1;
1549
- function $n(t) {
1550
- Xe = t;
1572
+ let Et = !1, Ye = !1;
1573
+ function Ln(t) {
1574
+ Ye = t;
1551
1575
  }
1552
- let w = null, ne = !1;
1553
- function K(t) {
1554
- w = t;
1576
+ let y = null, re = !1;
1577
+ function ee(t) {
1578
+ y = t;
1555
1579
  }
1556
1580
  let _ = null;
1557
- function ce(t) {
1581
+ function fe(t) {
1558
1582
  _ = t;
1559
1583
  }
1560
- let G = null;
1561
- function _i(t) {
1562
- w !== null && (G === null ? G = [t] : G.push(t));
1584
+ let Q = null;
1585
+ function Pi(t) {
1586
+ y !== null && (Q === null ? Q = [t] : Q.push(t));
1563
1587
  }
1564
- let U = null, Y = 0, X = null;
1565
- function bi(t) {
1566
- X = t;
1588
+ let W = null, X = 0, J = null;
1589
+ function Ii(t) {
1590
+ J = t;
1567
1591
  }
1568
- let Ar = 1, Te = 0, Ce = Te;
1569
- function zn(t) {
1592
+ let Ar = 1, Ae = 0, Ce = Ae;
1593
+ function Fn(t) {
1570
1594
  Ce = t;
1571
1595
  }
1572
- function Tr() {
1596
+ function Nr() {
1573
1597
  return ++Ar;
1574
1598
  }
1575
1599
  function ht(t) {
1576
1600
  var e = t.f;
1577
1601
  if ((e & F) !== 0)
1578
1602
  return !0;
1579
- if (e & O && (t.f &= ~Oe), (e & se) !== 0) {
1603
+ if (e & O && (t.f &= ~Oe), (e & ie) !== 0) {
1580
1604
  for (var n = (
1581
1605
  /** @type {Value[]} */
1582
1606
  t.deps
@@ -1585,86 +1609,88 @@ function ht(t) {
1585
1609
  if (ht(
1586
1610
  /** @type {Derived} */
1587
1611
  i
1588
- ) && dr(
1612
+ ) && mr(
1589
1613
  /** @type {Derived} */
1590
1614
  i
1591
1615
  ), i.wv > t.wv)
1592
1616
  return !0;
1593
1617
  }
1594
- (e & J) !== 0 && // During time traveling we don't want to reset the status so that
1618
+ (e & K) !== 0 && // During time traveling we don't want to reset the status so that
1595
1619
  // traversal of the graph in the other batches still happens
1596
- te === null && P(t, D);
1620
+ ne === null && P(t, D);
1597
1621
  }
1598
1622
  return !1;
1599
1623
  }
1600
- function Nr(t, e, n = !0) {
1624
+ function Cr(t, e, n = !0) {
1601
1625
  var r = t.reactions;
1602
- if (r !== null && !(G !== null && He.call(G, t)))
1626
+ if (r !== null && !(Q !== null && He.call(Q, t)))
1603
1627
  for (var s = 0; s < r.length; s++) {
1604
1628
  var i = r[s];
1605
- (i.f & O) !== 0 ? Nr(
1629
+ (i.f & O) !== 0 ? Cr(
1606
1630
  /** @type {Derived} */
1607
1631
  i,
1608
1632
  e,
1609
1633
  !1
1610
- ) : e === i && (n ? P(i, F) : (i.f & D) !== 0 && P(i, se), oe(
1634
+ ) : e === i && (n ? P(i, F) : (i.f & D) !== 0 && P(i, ie), le(
1611
1635
  /** @type {Effect} */
1612
1636
  i
1613
1637
  ));
1614
1638
  }
1615
1639
  }
1616
- function Cr(t) {
1617
- var e = U, n = Y, r = X, s = w, i = G, a = ie, o = ne, l = Ce, u = t.f;
1618
- U = /** @type {null | Value[]} */
1619
- null, Y = 0, X = null, w = (u & (Se | $e)) === 0 ? t : null, G = null, Ze(t.ctx), ne = !1, Ce = ++Te, t.ac !== null && (br(() => {
1620
- t.ac.abort(Ve);
1640
+ function Rr(t) {
1641
+ var e = W, n = X, r = J, s = y, i = Q, a = ae, o = re, l = Ce, u = t.f;
1642
+ W = /** @type {null | Value[]} */
1643
+ null, X = 0, J = null, y = (u & (Se | ze)) === 0 ? t : null, Q = null, qe(t.ctx), re = !1, Ce = ++Ae, t.ac !== null && (Er(() => {
1644
+ t.ac.abort(Te);
1621
1645
  }), t.ac = null);
1622
1646
  try {
1623
- t.f |= Jt;
1647
+ t.f |= Kt;
1624
1648
  var c = (
1625
1649
  /** @type {Function} */
1626
1650
  t.fn
1627
- ), f = c(), h = t.deps, m = S?.is_fork;
1628
- if (U !== null) {
1629
- var p;
1630
- if (m || St(t, Y), h !== null && Y > 0)
1631
- for (h.length = Y + U.length, p = 0; p < U.length; p++)
1632
- h[Y + p] = U[p];
1651
+ ), d = c();
1652
+ t.f |= Tt;
1653
+ var f = t.deps, m = S?.is_fork;
1654
+ if (W !== null) {
1655
+ var h;
1656
+ if (m || ut(t, X), f !== null && X > 0)
1657
+ for (f.length = X + W.length, h = 0; h < W.length; h++)
1658
+ f[X + h] = W[h];
1633
1659
  else
1634
- t.deps = h = U;
1635
- if (hn() && (t.f & J) !== 0)
1636
- for (p = Y; p < h.length; p++)
1637
- (h[p].reactions ??= []).push(t);
1638
- } else !m && h !== null && Y < h.length && (St(t, Y), h.length = Y);
1639
- if (ar() && X !== null && !ne && h !== null && (t.f & (O | se | F)) === 0)
1640
- for (p = 0; p < /** @type {Source[]} */
1641
- X.length; p++)
1642
- Nr(
1643
- X[p],
1660
+ t.deps = f = W;
1661
+ if (hn() && (t.f & K) !== 0)
1662
+ for (h = X; h < f.length; h++)
1663
+ (f[h].reactions ??= []).push(t);
1664
+ } else !m && f !== null && X < f.length && (ut(t, X), f.length = X);
1665
+ if (lr() && J !== null && !re && f !== null && (t.f & (O | ie | F)) === 0)
1666
+ for (h = 0; h < /** @type {Source[]} */
1667
+ J.length; h++)
1668
+ Cr(
1669
+ J[h],
1644
1670
  /** @type {Effect} */
1645
1671
  t
1646
1672
  );
1647
1673
  if (s !== null && s !== t) {
1648
- if (Te++, s.deps !== null)
1674
+ if (Ae++, s.deps !== null)
1649
1675
  for (let v = 0; v < n; v += 1)
1650
- s.deps[v].rv = Te;
1676
+ s.deps[v].rv = Ae;
1651
1677
  if (e !== null)
1652
1678
  for (const v of e)
1653
- v.rv = Te;
1654
- X !== null && (r === null ? r = X : r.push(.../** @type {Source[]} */
1655
- X));
1679
+ v.rv = Ae;
1680
+ J !== null && (r === null ? r = J : r.push(.../** @type {Source[]} */
1681
+ J));
1656
1682
  }
1657
- return (t.f & Me) !== 0 && (t.f ^= Me), f;
1683
+ return (t.f & Me) !== 0 && (t.f ^= Me), d;
1658
1684
  } catch (v) {
1659
- return or(v);
1685
+ return ur(v);
1660
1686
  } finally {
1661
- t.f ^= Jt, U = e, Y = n, X = r, w = s, G = i, Ze(a), ne = o, Ce = l;
1687
+ t.f ^= Kt, W = e, X = n, J = r, y = s, Q = i, qe(a), re = o, Ce = l;
1662
1688
  }
1663
1689
  }
1664
- function Mi(t, e) {
1690
+ function Ti(t, e) {
1665
1691
  let n = e.reactions;
1666
1692
  if (n !== null) {
1667
- var r = Rs.call(n, t);
1693
+ var r = Ds.call(n, t);
1668
1694
  if (r !== -1) {
1669
1695
  var s = n.length - 1;
1670
1696
  s === 0 ? n = e.reactions = null : (n[r] = n[s], n.pop());
@@ -1673,108 +1699,109 @@ function Mi(t, e) {
1673
1699
  if (n === null && (e.f & O) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1674
1700
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1675
1701
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1676
- (U === null || !He.call(U, e))) {
1702
+ (W === null || !He.call(W, e))) {
1677
1703
  var i = (
1678
1704
  /** @type {Derived} */
1679
1705
  e
1680
1706
  );
1681
- (i.f & J) !== 0 && (i.f ^= J, i.f &= ~Oe), on(i), pr(i), St(i, 0);
1707
+ (i.f & K) !== 0 && (i.f ^= K, i.f &= ~Oe), ln(i), hi(i), ut(i, 0);
1682
1708
  }
1683
1709
  }
1684
- function St(t, e) {
1710
+ function ut(t, e) {
1685
1711
  var n = t.deps;
1686
1712
  if (n !== null)
1687
1713
  for (var r = e; r < n.length; r++)
1688
- Mi(t, n[r]);
1714
+ Ti(t, n[r]);
1689
1715
  }
1690
- function lt(t) {
1716
+ function Xe(t) {
1691
1717
  var e = t.f;
1692
- if ((e & be) === 0) {
1718
+ if ((e & _e) === 0) {
1693
1719
  P(t, D);
1694
- var n = _, r = bt;
1695
- _ = t, bt = !0;
1720
+ var n = _, r = Et;
1721
+ _ = t, Et = !0;
1696
1722
  try {
1697
- (e & (ge | nr)) !== 0 ? yi(t) : Sr(t), xr(t);
1698
- var s = Cr(t);
1723
+ (e & (ge | ir)) !== 0 ? Ei(t) : pn(t), Pr(t);
1724
+ var s = Rr(t);
1699
1725
  t.teardown = typeof s == "function" ? s : null, t.wv = Ar;
1700
1726
  var i;
1701
- Xt && Ys && (t.f & F) !== 0 && t.deps;
1727
+ Jt && Gs && (t.f & F) !== 0 && t.deps;
1702
1728
  } finally {
1703
- bt = r, _ = n;
1729
+ Et = r, _ = n;
1704
1730
  }
1705
1731
  }
1706
1732
  }
1707
- function M(t) {
1733
+ function E(t) {
1708
1734
  var e = t.f, n = (e & O) !== 0;
1709
- if (w !== null && !ne) {
1710
- var r = _ !== null && (_.f & be) !== 0;
1711
- if (!r && (G === null || !He.call(G, t))) {
1712
- var s = w.deps;
1713
- if ((w.f & Jt) !== 0)
1714
- t.rv < Te && (t.rv = Te, U === null && s !== null && s[Y] === t ? Y++ : U === null ? U = [t] : U.push(t));
1735
+ if (y !== null && !re) {
1736
+ var r = _ !== null && (_.f & _e) !== 0;
1737
+ if (!r && (Q === null || !He.call(Q, t))) {
1738
+ var s = y.deps;
1739
+ if ((y.f & Kt) !== 0)
1740
+ t.rv < Ae && (t.rv = Ae, W === null && s !== null && s[X] === t ? X++ : W === null ? W = [t] : W.push(t));
1715
1741
  else {
1716
- (w.deps ??= []).push(t);
1742
+ (y.deps ??= []).push(t);
1717
1743
  var i = t.reactions;
1718
- i === null ? t.reactions = [w] : He.call(i, w) || i.push(w);
1744
+ i === null ? t.reactions = [y] : He.call(i, y) || i.push(y);
1719
1745
  }
1720
1746
  }
1721
1747
  }
1722
- if (Xe && xe.has(t))
1748
+ if (Ye && xe.has(t))
1723
1749
  return xe.get(t);
1724
1750
  if (n) {
1725
1751
  var a = (
1726
1752
  /** @type {Derived} */
1727
1753
  t
1728
1754
  );
1729
- if (Xe) {
1755
+ if (Ye) {
1730
1756
  var o = a.v;
1731
- return ((a.f & D) === 0 && a.reactions !== null || Dr(a)) && (o = un(a)), xe.set(a, o), o;
1757
+ return ((a.f & D) === 0 && a.reactions !== null || Or(a)) && (o = cn(a)), xe.set(a, o), o;
1732
1758
  }
1733
- var l = (a.f & J) === 0 && !ne && w !== null && (bt || (w.f & J) !== 0), u = a.deps === null;
1734
- ht(a) && (l && (a.f |= J), dr(a)), l && !u && Rr(a);
1759
+ var l = (a.f & K) === 0 && !re && y !== null && (Et || (y.f & K) !== 0), u = (a.f & Tt) === 0;
1760
+ ht(a) && (l && (a.f |= K), mr(a)), l && !u && (vr(a), Dr(a));
1735
1761
  }
1736
- if (te?.has(t))
1737
- return te.get(t);
1762
+ if (ne?.has(t))
1763
+ return ne.get(t);
1738
1764
  if ((t.f & Me) !== 0)
1739
1765
  throw t.v;
1740
1766
  return t.v;
1741
1767
  }
1742
- function Rr(t) {
1743
- if (t.deps !== null) {
1744
- t.f |= J;
1768
+ function Dr(t) {
1769
+ if (t.f |= K, t.deps !== null)
1745
1770
  for (const e of t.deps)
1746
- (e.reactions ??= []).push(t), (e.f & O) !== 0 && (e.f & J) === 0 && Rr(
1771
+ (e.reactions ??= []).push(t), (e.f & O) !== 0 && (e.f & K) === 0 && (vr(
1747
1772
  /** @type {Derived} */
1748
1773
  e
1749
- );
1750
- }
1774
+ ), Dr(
1775
+ /** @type {Derived} */
1776
+ e
1777
+ ));
1751
1778
  }
1752
- function Dr(t) {
1779
+ function Or(t) {
1753
1780
  if (t.v === N) return !0;
1754
1781
  if (t.deps === null) return !1;
1755
1782
  for (const e of t.deps)
1756
- if (xe.has(e) || (e.f & O) !== 0 && Dr(
1783
+ if (xe.has(e) || (e.f & O) !== 0 && Or(
1757
1784
  /** @type {Derived} */
1758
1785
  e
1759
1786
  ))
1760
1787
  return !0;
1761
1788
  return !1;
1762
1789
  }
1763
- function Or(t) {
1764
- var e = ne;
1790
+ function zr(t) {
1791
+ var e = re;
1765
1792
  try {
1766
- return ne = !0, t();
1793
+ return re = !0, t();
1767
1794
  } finally {
1768
- ne = e;
1795
+ re = e;
1769
1796
  }
1770
1797
  }
1771
- const Ei = ["touchstart", "touchmove"];
1772
- function xi(t) {
1773
- return Ei.includes(t);
1798
+ const Ai = ["touchstart", "touchmove"];
1799
+ function Ni(t) {
1800
+ return Ai.includes(t);
1774
1801
  }
1775
- const Si = /* @__PURE__ */ new Set(), Fn = /* @__PURE__ */ new Set();
1776
- let Ln = null;
1777
- function gt(t) {
1802
+ const wt = /* @__PURE__ */ Symbol("events"), Ci = /* @__PURE__ */ new Set(), Vn = /* @__PURE__ */ new Set();
1803
+ let jn = null;
1804
+ function Bn(t) {
1778
1805
  var e = this, n = (
1779
1806
  /** @type {Node} */
1780
1807
  e.ownerDocument
@@ -1782,13 +1809,13 @@ function gt(t) {
1782
1809
  /** @type {null | Element} */
1783
1810
  s[0] || t.target
1784
1811
  );
1785
- Ln = t;
1786
- var a = 0, o = Ln === t && t.__root;
1812
+ jn = t;
1813
+ var a = 0, o = jn === t && t[wt];
1787
1814
  if (o) {
1788
1815
  var l = s.indexOf(o);
1789
1816
  if (l !== -1 && (e === document || e === /** @type {any} */
1790
1817
  window)) {
1791
- t.__root = e;
1818
+ t[wt] = e;
1792
1819
  return;
1793
1820
  }
1794
1821
  var u = s.indexOf(e);
@@ -1798,48 +1825,61 @@ function gt(t) {
1798
1825
  }
1799
1826
  if (i = /** @type {Element} */
1800
1827
  s[a] || t.target, i !== e) {
1801
- Os(t, "currentTarget", {
1828
+ zs(t, "currentTarget", {
1802
1829
  configurable: !0,
1803
1830
  get() {
1804
1831
  return i || n;
1805
1832
  }
1806
1833
  });
1807
- var c = w, f = _;
1808
- K(null), ce(null);
1834
+ var c = y, d = _;
1835
+ ee(null), fe(null);
1809
1836
  try {
1810
- for (var h, m = []; i !== null; ) {
1811
- var p = i.assignedSlot || i.parentNode || /** @type {any} */
1837
+ for (var f, m = []; i !== null; ) {
1838
+ var h = i.assignedSlot || i.parentNode || /** @type {any} */
1812
1839
  i.host || null;
1813
1840
  try {
1814
- var v = i["__" + r];
1841
+ var v = i[wt]?.[r];
1815
1842
  v != null && (!/** @type {any} */
1816
1843
  i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1817
1844
  // -> the target could not have been disabled because it emits the event in the first place
1818
1845
  t.target === i) && v.call(i, t);
1819
- } catch (x) {
1820
- h ? m.push(x) : h = x;
1846
+ } catch (b) {
1847
+ f ? m.push(b) : f = b;
1821
1848
  }
1822
- if (t.cancelBubble || p === e || p === null)
1849
+ if (t.cancelBubble || h === e || h === null)
1823
1850
  break;
1824
- i = p;
1851
+ i = h;
1825
1852
  }
1826
- if (h) {
1827
- for (let x of m)
1853
+ if (f) {
1854
+ for (let b of m)
1828
1855
  queueMicrotask(() => {
1829
- throw x;
1856
+ throw b;
1830
1857
  });
1831
- throw h;
1858
+ throw f;
1832
1859
  }
1833
1860
  } finally {
1834
- t.__root = e, delete t.currentTarget, K(c), ce(f);
1861
+ t[wt] = e, delete t.currentTarget, ee(c), fe(d);
1835
1862
  }
1836
1863
  }
1837
1864
  }
1838
- function Pi(t) {
1839
- var e = document.createElement("template");
1840
- return e.innerHTML = t.replaceAll("<!>", "<!---->"), e.content;
1865
+ const Ri = (
1866
+ // We gotta write it like this because after downleveling the pure comment may end up in the wrong location
1867
+ globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
1868
+ /** @param {string} html */
1869
+ createHTML: (t) => t
1870
+ })
1871
+ );
1872
+ function Di(t) {
1873
+ return (
1874
+ /** @type {string} */
1875
+ Ri?.createHTML(t) ?? t
1876
+ );
1841
1877
  }
1842
- function Ii(t, e) {
1878
+ function Oi(t, e = !1) {
1879
+ var n = vi("template");
1880
+ return t = t.replaceAll("<!>", "<!---->"), n.innerHTML = e ? Di(t) : t, n.content;
1881
+ }
1882
+ function zi(t, e) {
1843
1883
  var n = (
1844
1884
  /** @type {Effect} */
1845
1885
  _
@@ -1850,75 +1890,78 @@ function Ii(t, e) {
1850
1890
  function $r(t, e) {
1851
1891
  var n, r = !t.startsWith("<!>");
1852
1892
  return () => {
1853
- n === void 0 && (n = Pi(r ? t : "<!>" + t), n = /** @type {TemplateNode} */
1854
- /* @__PURE__ */ _r(n));
1893
+ n === void 0 && (n = Oi(r ? t : "<!>" + t, !0), n = /** @type {TemplateNode} */
1894
+ /* @__PURE__ */ Mr(n));
1855
1895
  var s = (
1856
1896
  /** @type {TemplateNode} */
1857
- gr ? document.importNode(n, !0) : n.cloneNode(!0)
1897
+ yr ? document.importNode(n, !0) : n.cloneNode(!0)
1858
1898
  );
1859
- return Ii(s, s), s;
1899
+ return zi(s, s), s;
1860
1900
  };
1861
1901
  }
1862
- function zr(t, e) {
1902
+ function Lr(t, e) {
1863
1903
  t !== null && t.before(
1864
1904
  /** @type {Node} */
1865
1905
  e
1866
1906
  );
1867
1907
  }
1868
- function fn(t, e) {
1869
- return Ai(t, e);
1870
- }
1871
- const Le = /* @__PURE__ */ new Map();
1872
- function Ai(t, { target: e, anchor: n, props: r = {}, events: s, context: i, intro: a = !0 }) {
1873
- ui();
1874
- var o = /* @__PURE__ */ new Set(), l = (f) => {
1875
- for (var h = 0; h < f.length; h++) {
1876
- var m = f[h];
1877
- if (!o.has(m)) {
1878
- o.add(m);
1879
- var p = xi(m);
1880
- e.addEventListener(m, gt, { passive: p });
1881
- var v = Le.get(m);
1882
- v === void 0 ? (document.addEventListener(m, gt, { passive: p }), Le.set(m, 1)) : Le.set(m, v + 1);
1883
- }
1884
- }
1885
- };
1886
- l(Ds(Si)), Fn.add(l);
1887
- var u = void 0, c = di(() => {
1888
- var f = n ?? e.appendChild(kr());
1889
- return ti(
1908
+ function dn(t, e) {
1909
+ return $i(t, e);
1910
+ }
1911
+ const yt = /* @__PURE__ */ new Map();
1912
+ function $i(t, { target: e, anchor: n, props: r = {}, events: s, context: i, intro: a = !0 }) {
1913
+ di();
1914
+ var o = void 0, l = ki(() => {
1915
+ var u = n ?? e.appendChild(_r());
1916
+ si(
1890
1917
  /** @type {TemplateNode} */
1891
- f,
1918
+ u,
1892
1919
  {
1893
1920
  pending: () => {
1894
1921
  }
1895
1922
  },
1896
- (h) => {
1897
- if (i) {
1898
- sn({});
1899
- var m = (
1900
- /** @type {ComponentContext} */
1901
- ie
1902
- );
1903
- m.c = i;
1904
- }
1905
- s && (r.$$events = s), u = t(h, r) || {}, i && an();
1906
- }
1907
- ), () => {
1908
- for (var h of o) {
1909
- e.removeEventListener(h, gt);
1923
+ (f) => {
1924
+ an({});
1910
1925
  var m = (
1911
- /** @type {number} */
1912
- Le.get(h)
1926
+ /** @type {ComponentContext} */
1927
+ ae
1913
1928
  );
1914
- --m === 0 ? (document.removeEventListener(h, gt), Le.delete(h)) : Le.set(h, m);
1929
+ i && (m.c = i), s && (r.$$events = s), o = t(f, r) || {}, on();
1930
+ }
1931
+ );
1932
+ var c = /* @__PURE__ */ new Set(), d = (f) => {
1933
+ for (var m = 0; m < f.length; m++) {
1934
+ var h = f[m];
1935
+ if (!c.has(h)) {
1936
+ c.add(h);
1937
+ var v = Ni(h);
1938
+ for (const Z of [e, document]) {
1939
+ var b = yt.get(Z);
1940
+ b === void 0 && (b = /* @__PURE__ */ new Map(), yt.set(Z, b));
1941
+ var z = b.get(h);
1942
+ z === void 0 ? (Z.addEventListener(h, Bn, { passive: v }), b.set(h, 1)) : b.set(h, z + 1);
1943
+ }
1944
+ }
1915
1945
  }
1916
- Fn.delete(l), f !== n && f.parentNode?.removeChild(f);
1946
+ };
1947
+ return d(Os(Ci)), Vn.add(d), () => {
1948
+ for (var f of c)
1949
+ for (const v of [e, document]) {
1950
+ var m = (
1951
+ /** @type {Map<string, number>} */
1952
+ yt.get(v)
1953
+ ), h = (
1954
+ /** @type {number} */
1955
+ m.get(f)
1956
+ );
1957
+ --h == 0 ? (v.removeEventListener(f, Bn), m.delete(f), m.size === 0 && yt.delete(v)) : m.set(f, h);
1958
+ }
1959
+ Vn.delete(d), u !== n && u.parentNode?.removeChild(u);
1917
1960
  };
1918
1961
  });
1919
- return Ti.set(u, c), u;
1962
+ return Li.set(o, l), o;
1920
1963
  }
1921
- let Ti = /* @__PURE__ */ new WeakMap();
1964
+ let Li = /* @__PURE__ */ new WeakMap();
1922
1965
  function Fr(t) {
1923
1966
  var e, n, r = "";
1924
1967
  if (typeof t == "string" || typeof t == "number") r += t;
@@ -1928,18 +1971,18 @@ function Fr(t) {
1928
1971
  } else for (n in t) t[n] && (r && (r += " "), r += n);
1929
1972
  return r;
1930
1973
  }
1931
- function Ni() {
1974
+ function Fi() {
1932
1975
  for (var t, e, n = 0, r = "", s = arguments.length; n < s; n++) (t = arguments[n]) && (e = Fr(t)) && (r && (r += " "), r += e);
1933
1976
  return r;
1934
1977
  }
1935
- function Lr(t) {
1936
- return typeof t == "object" ? Ni(t) : t ?? "";
1978
+ function Vr(t) {
1979
+ return typeof t == "object" ? Fi(t) : t ?? "";
1937
1980
  }
1938
- function Ci(t, e, n) {
1981
+ function Vi(t, e, n) {
1939
1982
  var r = t == null ? "" : "" + t;
1940
1983
  return e && (r = r ? r + " " + e : e), r === "" ? null : r;
1941
1984
  }
1942
- function Vn(t, e = !1) {
1985
+ function Un(t, e = !1) {
1943
1986
  var n = e ? " !important;" : ";", r = "";
1944
1987
  for (var s in t) {
1945
1988
  var i = t[s];
@@ -1947,22 +1990,22 @@ function Vn(t, e = !1) {
1947
1990
  }
1948
1991
  return r;
1949
1992
  }
1950
- function Ri(t, e) {
1993
+ function ji(t, e) {
1951
1994
  if (e) {
1952
1995
  var n = "", r, s;
1953
- return Array.isArray(e) ? (r = e[0], s = e[1]) : r = e, r && (n += Vn(r)), s && (n += Vn(s, !0)), n = n.trim(), n === "" ? null : n;
1996
+ return Array.isArray(e) ? (r = e[0], s = e[1]) : r = e, r && (n += Un(r)), s && (n += Un(s, !0)), n = n.trim(), n === "" ? null : n;
1954
1997
  }
1955
1998
  return String(t);
1956
1999
  }
1957
- function Vr(t, e, n, r, s, i) {
2000
+ function jr(t, e, n, r, s, i) {
1958
2001
  var a = t.__className;
1959
2002
  if (a !== n || a === void 0) {
1960
- var o = Ci(n, r);
2003
+ var o = Vi(n, r);
1961
2004
  o == null ? t.removeAttribute("class") : t.className = o, t.__className = n;
1962
2005
  }
1963
2006
  return i;
1964
2007
  }
1965
- function Wt(t, e = {}, n, r) {
2008
+ function Ht(t, e = {}, n, r) {
1966
2009
  for (var s in n) {
1967
2010
  var i = n[s];
1968
2011
  e[s] !== i && (n[s] == null ? t.style.removeProperty(s) : t.style.setProperty(s, i, r));
@@ -1971,29 +2014,29 @@ function Wt(t, e = {}, n, r) {
1971
2014
  function nt(t, e, n, r) {
1972
2015
  var s = t.__style;
1973
2016
  if (s !== e) {
1974
- var i = Ri(e, r);
2017
+ var i = ji(e, r);
1975
2018
  i == null ? t.removeAttribute("style") : t.style.cssText = i, t.__style = e;
1976
- } else r && (Array.isArray(r) ? (Wt(t, n?.[0], r[0]), Wt(t, n?.[1], r[1], "important")) : Wt(t, n, r));
2019
+ } else r && (Array.isArray(r) ? (Ht(t, n?.[0], r[0]), Ht(t, n?.[1], r[1], "important")) : Ht(t, n, r));
1977
2020
  return r;
1978
2021
  }
1979
- function jn(t, e) {
1980
- return t === e || t?.[kt] === e;
2022
+ function Wn(t, e) {
2023
+ return t === e || t?.[_t] === e;
1981
2024
  }
1982
2025
  function rt(t = {}, e, n, r) {
1983
- return mi(() => {
2026
+ return bi(() => {
1984
2027
  var s, i;
1985
- return Mr(() => {
1986
- s = i, i = [], Or(() => {
1987
- t !== n(...i) && (e(t, ...i), s && jn(n(...s), t) && e(null, ...s));
2028
+ return xr(() => {
2029
+ s = i, i = [], zr(() => {
2030
+ t !== n(...i) && (e(t, ...i), s && Wn(n(...s), t) && e(null, ...s));
1988
2031
  });
1989
2032
  }), () => {
1990
2033
  Ne(() => {
1991
- i && jn(n(...i), t) && e(null, ...i);
2034
+ i && Wn(n(...i), t) && e(null, ...i);
1992
2035
  });
1993
2036
  };
1994
2037
  }), t;
1995
2038
  }
1996
- class pn {
2039
+ class mn {
1997
2040
  div;
1998
2041
  marker;
1999
2042
  constructor(e, n, r, s) {
@@ -2009,7 +2052,7 @@ class pn {
2009
2052
  this.marker.update(e);
2010
2053
  }
2011
2054
  }
2012
- class ft {
2055
+ class pt {
2013
2056
  shown;
2014
2057
  id;
2015
2058
  lat;
@@ -2017,16 +2060,16 @@ class ft {
2017
2060
  rank;
2018
2061
  marker;
2019
2062
  constructor(e, n) {
2020
- if (new.target === ft) throw new Error("Unsupported code");
2063
+ if (new.target === pt) throw new Error("Unsupported code");
2021
2064
  this.shown = !0, this.id = e.id, this.lat = e.lat, this.lng = e.lng, this.rank = e.rank, this.marker = n;
2022
2065
  }
2023
2066
  }
2024
- const Di = "5";
2025
- typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Di);
2026
- function jr(t) {
2067
+ const Bi = "5";
2068
+ typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Bi);
2069
+ function Br(t) {
2027
2070
  return -0.5 * (Math.cos(Math.PI * t) - 1);
2028
2071
  }
2029
- class Br {
2072
+ class Ur {
2030
2073
  animating;
2031
2074
  animationEasing;
2032
2075
  animationCallback;
@@ -2070,104 +2113,104 @@ class Br {
2070
2113
  return performance.now() > this.time.end;
2071
2114
  }
2072
2115
  }
2073
- var Oi = /* @__PURE__ */ $r("<div></div>");
2074
- function $i(t, e) {
2075
- sn(e, !0);
2116
+ var Ui = /* @__PURE__ */ $r("<div></div>");
2117
+ function Wi(t, e) {
2118
+ an(e, !0);
2076
2119
  let n = e.id, r = e.style, s = e.content, i = {
2077
- setDisplayed: he,
2078
- getDisplayed: ze,
2120
+ setDisplayed: Z,
2121
+ getDisplayed: $e,
2079
2122
  setSuppressed: Ie,
2080
- setCollapsed: fe,
2081
- getCollapsed: we,
2123
+ setCollapsed: he,
2124
+ getCollapsed: ye,
2082
2125
  setScale: Ke
2083
2126
  };
2084
2127
  function a() {
2085
2128
  return i;
2086
2129
  }
2087
- let o, l = r.dimensions.width, u = r.dimensions.height, c = r.dimensions.radius, f = r.dimensions.padding ?? Qn, h = r.colors?.border ?? Yt, m = r.colors?.background ?? Ts, p = r.colors?.shadow ?? er, v = /* @__PURE__ */ B(!1), x = !1, H = !1;
2088
- function he(k) {
2089
- if (k != M(v)) {
2090
- if (W(v, k, !0), k == !0) {
2091
- if (s == null || H || x) return;
2092
- x = !0, s(n).then((ke) => {
2130
+ let o, l = r.dimensions.width, u = r.dimensions.height, c = r.dimensions.radius, d = r.dimensions.padding ?? nr, f = r.colors?.border ?? Xt, m = r.colors?.background ?? Ns, h = r.colors?.shadow ?? rr, v = /* @__PURE__ */ U(!1), b = !1, z = !1;
2131
+ function Z(k) {
2132
+ if (k != E(v)) {
2133
+ if (H(v, k, !0), k == !0) {
2134
+ if (s == null || z || b) return;
2135
+ b = !0, s(n).then((ke) => {
2093
2136
  ke instanceof HTMLElement ? o.appendChild(ke) : console.error("Failed to load pin content");
2094
2137
  }).catch((ke) => console.error(ke)).finally(() => {
2095
- H = !0, x = !1;
2138
+ z = !0, b = !1;
2096
2139
  });
2097
2140
  }
2098
- k == !1 && Z.end();
2141
+ k == !1 && Y.end();
2099
2142
  }
2100
2143
  }
2101
- function ze() {
2102
- return M(v);
2144
+ function $e() {
2145
+ return E(v);
2103
2146
  }
2104
- let Pe = /* @__PURE__ */ B(!0);
2147
+ let Pe = /* @__PURE__ */ U(!0);
2105
2148
  function Ie(k) {
2106
- k != M(Pe) && (W(Pe, k, !0), k && (Q = Fe, Z.set(Fe)));
2149
+ k != E(Pe) && (H(Pe, k, !0), k && (te = Le, Y.set(Le)));
2107
2150
  }
2108
- let j = /* @__PURE__ */ B(!0);
2109
- function fe(k) {
2110
- k != M(j) && (W(j, k, !0), Z.target(M(j) ? 0 : Q));
2151
+ let B = /* @__PURE__ */ U(!0);
2152
+ function he(k) {
2153
+ k != E(B) && (H(B, k, !0), Y.target(E(B) ? 0 : te));
2111
2154
  }
2112
- function we() {
2113
- return M(v) ? Z.expired() : !0;
2155
+ function ye() {
2156
+ return E(v) ? Y.expired() : !0;
2114
2157
  }
2115
- let Q = Fe, Z = new Br({
2116
- value: Fe,
2158
+ let te = Le, Y = new Ur({
2159
+ value: Le,
2117
2160
  min: 0,
2118
2161
  max: 1,
2119
- timespan: Ss,
2120
- easing: jr,
2121
- callback: Nt
2162
+ timespan: Ps,
2163
+ easing: Br,
2164
+ callback: Ct
2122
2165
  });
2123
2166
  function Ke(k) {
2124
- Q = k, Z.target(k);
2167
+ te = k, Y.target(k);
2125
2168
  }
2126
- function Nt(k) {
2127
- o.style.scale = k.toString(), o.style.filter = `brightness(${pt(k)})`;
2169
+ function Ct(k) {
2170
+ o.style.scale = k.toString(), o.style.filter = `brightness(${dt(k)})`;
2128
2171
  }
2129
- function pt(k) {
2172
+ function dt(k) {
2130
2173
  return 0.25 + 0.75 * k;
2131
2174
  }
2132
- var Ct = { invoke: a }, pe = Oi();
2133
- let dt;
2134
- return rt(pe, (k) => o = k, () => o), Er(
2175
+ var Rt = { invoke: a }, pe = Ui();
2176
+ let mt;
2177
+ return rt(pe, (k) => o = k, () => o), Sr(
2135
2178
  (k) => {
2136
- Vr(
2179
+ jr(
2137
2180
  pe,
2138
2181
  1,
2139
- Lr([
2182
+ Vr([
2140
2183
  "pin",
2141
- M(v) && "displayed",
2142
- M(Pe) && "suppressed"
2184
+ E(v) && "displayed",
2185
+ E(Pe) && "suppressed"
2143
2186
  ]),
2144
2187
  "svelte-10kxbrm"
2145
- ), dt = nt(pe, "", dt, k);
2188
+ ), mt = nt(pe, "", mt, k);
2146
2189
  },
2147
2190
  [
2148
2191
  () => ({
2149
2192
  width: `${l}px`,
2150
2193
  height: `${u}px`,
2151
2194
  "border-radius": `${c}px`,
2152
- "border-color": h,
2195
+ "border-color": f,
2153
2196
  "background-color": m,
2154
- "border-width": `${f}px`,
2155
- "box-shadow": p,
2156
- scale: Fe,
2157
- filter: `brightness(${pt(Fe)})`
2197
+ "border-width": `${d}px`,
2198
+ "box-shadow": h,
2199
+ scale: Le,
2200
+ filter: `brightness(${dt(Le)})`
2158
2201
  })
2159
2202
  ]
2160
- ), zr(t, pe), an(Ct);
2203
+ ), Lr(t, pe), on(Rt);
2161
2204
  }
2162
- class zi extends ft {
2205
+ class Hi extends pt {
2163
2206
  width;
2164
2207
  height;
2165
2208
  zoom;
2166
2209
  component;
2167
2210
  constructor(e, n) {
2168
- super(e, new pn(n, e.lat, e.lng, e.rank));
2169
- const r = e.pin?.style.dimensions.width ?? Ut, s = e.pin?.style.dimensions.height ?? Ut, i = e.pin?.style.dimensions.padding ?? Qn, a = e.pin?.style.dimensions.radius ?? Ut / 2;
2170
- this.width = r, this.height = s, this.zoom = NaN, this.component = fn($i, {
2211
+ super(e, new mn(n, e.lat, e.lng, e.rank));
2212
+ const r = e.pin?.style.dimensions.width ?? Wt, s = e.pin?.style.dimensions.height ?? Wt, i = e.pin?.style.dimensions.padding ?? nr, a = e.pin?.style.dimensions.radius ?? Wt / 2;
2213
+ this.width = r, this.height = s, this.zoom = NaN, this.component = dn(Wi, {
2171
2214
  target: this.marker.div,
2172
2215
  props: {
2173
2216
  id: this.id,
@@ -2185,10 +2228,10 @@ class zi extends ft {
2185
2228
  });
2186
2229
  }
2187
2230
  get zIndex() {
2188
- return Number.isNaN(this.zoom) ? this.rank : Math.round(-this.zoom * Kn) + Is;
2231
+ return Number.isNaN(this.zoom) ? this.rank : Math.round(-this.zoom * tr) + Ts;
2189
2232
  }
2190
2233
  }
2191
- class Bn {
2234
+ class Hn {
2192
2235
  animating;
2193
2236
  animationTimestamp;
2194
2237
  animationEnd;
@@ -2242,134 +2285,134 @@ class Bn {
2242
2285
  return performance.now() > this.animationEnd;
2243
2286
  }
2244
2287
  }
2245
- function en(t, e, n) {
2288
+ function nn(t, e, n) {
2246
2289
  if (t <= 0 || e <= 0) return { x: 0, y: 0 };
2247
2290
  let r = t / 2, s = e / 2, i = Math.sqrt(r * r + s * s), a = Math.atan(s / r) * (180 / Math.PI), o = n * (Math.PI / 180);
2248
2291
  return n < 180 ? n < 90 ? n < a ? { x: 0, y: i * Math.sin(o) - s } : { x: i * Math.cos(o) - r, y: 0 } : n < 180 - a ? { x: i * Math.cos(o) - r, y: 0 } : { x: -t, y: i * Math.sin(o) - s } : n < 270 ? n < 180 + a ? { x: -t, y: i * Math.sin(o) - s } : { x: i * Math.cos(o) - r, y: -e } : n < 360 - a ? { x: i * Math.cos(o) - r, y: -e } : { x: 0, y: i * Math.sin(o) - s };
2249
2292
  }
2250
- var Fi = /* @__PURE__ */ $r('<div><div class="element pointer svelte-1no6o2a"></div> <div class="element tooltip svelte-1no6o2a"><div class="element body svelte-1no6o2a"></div></div></div>');
2251
- function Ur(t, e) {
2252
- sn(e, !0);
2293
+ var qi = /* @__PURE__ */ $r('<div><div class="element pointer svelte-1no6o2a"></div> <div class="element tooltip svelte-1no6o2a"><div class="element body svelte-1no6o2a"></div></div></div>');
2294
+ function Wr(t, e) {
2295
+ an(e, !0);
2253
2296
  let n = e.id, r = e.style, s = e.content, i = {
2254
- setDisplayed: Q,
2255
- getDisplayed: Z,
2256
- setCollapsed: Nt,
2257
- getCollapsed: pt,
2258
- getExpanded: Ct,
2259
- setAngle: ls
2297
+ setDisplayed: te,
2298
+ getDisplayed: Y,
2299
+ setCollapsed: Ct,
2300
+ getCollapsed: dt,
2301
+ getExpanded: Rt,
2302
+ setAngle: us
2260
2303
  };
2261
2304
  function a() {
2262
2305
  return i;
2263
2306
  }
2264
- let o, l = r.colors?.shadow ?? er, u, c = Math.min(r.dimensions.width, r.dimensions.height) / Math.SQRT2 - r.dimensions.margin, f = r.colors?.background ?? Yt, h = Math.max(1, r.dimensions.radius / c), m, p = r.dimensions.width + 2 * r.dimensions.margin, v = r.dimensions.height + 2 * r.dimensions.margin, x = r.dimensions.margin, H, he = r.dimensions.width, ze = r.dimensions.height, Pe = r.dimensions.radius, Ie = r.colors?.background ?? Yt, j = /* @__PURE__ */ B(!1), fe = !1, we = !1;
2265
- function Q(y) {
2266
- if (y != M(j)) {
2267
- if (W(j, y, !0), y) {
2268
- if (s == null || we || fe) return;
2269
- fe = !0, s(n).then((de) => {
2270
- de instanceof HTMLElement ? H.appendChild(de) : console.error("Failed to load tooltip content");
2307
+ let o, l = r.colors?.shadow ?? rr, u, c = Math.min(r.dimensions.width, r.dimensions.height) / Math.SQRT2 - r.dimensions.margin, d = r.colors?.background ?? Xt, f = Math.max(1, r.dimensions.radius / c), m, h = r.dimensions.width + 2 * r.dimensions.margin, v = r.dimensions.height + 2 * r.dimensions.margin, b = r.dimensions.margin, z, Z = r.dimensions.width, $e = r.dimensions.height, Pe = r.dimensions.radius, Ie = r.colors?.background ?? Xt, B = /* @__PURE__ */ U(!1), he = !1, ye = !1;
2308
+ function te(w) {
2309
+ if (w != E(B)) {
2310
+ if (H(B, w, !0), w) {
2311
+ if (s == null || ye || he) return;
2312
+ he = !0, s(n).then((de) => {
2313
+ de instanceof HTMLElement ? z.appendChild(de) : console.error("Failed to load tooltip content");
2271
2314
  }).catch((de) => console.error(de)).finally(() => {
2272
- we = !0, fe = !1;
2315
+ ye = !0, he = !1;
2273
2316
  });
2274
2317
  }
2275
- y == !1 && (pe.end(), Rt.end(), Dt.end());
2318
+ w == !1 && (pe.end(), Dt.end(), Ot.end());
2276
2319
  }
2277
2320
  }
2278
- function Z() {
2279
- return M(j);
2321
+ function Y() {
2322
+ return E(B);
2280
2323
  }
2281
- let Ke = /* @__PURE__ */ B(!0);
2282
- function Nt(y) {
2283
- y != M(Ke) && (W(Ke, y, !0), pe.target(M(Ke) ? 0 : 1));
2324
+ let Ke = /* @__PURE__ */ U(!0);
2325
+ function Ct(w) {
2326
+ w != E(Ke) && (H(Ke, w, !0), pe.target(E(Ke) ? 0 : 1));
2284
2327
  }
2285
- function pt() {
2286
- return M(j) ? pe.expired() : !0;
2328
+ function dt() {
2329
+ return E(B) ? pe.expired() : !0;
2287
2330
  }
2288
- function Ct() {
2289
- return M(j) ? pe.expired() : !1;
2331
+ function Rt() {
2332
+ return E(B) ? pe.expired() : !1;
2290
2333
  }
2291
- let pe = new Br({
2334
+ let pe = new Ur({
2292
2335
  value: 0,
2293
2336
  min: 0,
2294
2337
  max: 1,
2295
- timespan: Ps,
2296
- easing: jr,
2297
- callback: dt
2338
+ timespan: Is,
2339
+ easing: Br,
2340
+ callback: mt
2298
2341
  });
2299
- function dt(y) {
2300
- o.style.opacity = `${y}`, m.style.scale = `${y}`, u.style.scale = `${y}`;
2342
+ function mt(w) {
2343
+ o.style.opacity = `${w}`, m.style.scale = `${w}`, u.style.scale = `${w}`;
2301
2344
  }
2302
- let k = NaN, ke = /* @__PURE__ */ B(!1), vn = -p / 2, Rt = new Bn({
2303
- value: -p / 2,
2304
- min: -p,
2345
+ let k = NaN, ke = /* @__PURE__ */ U(!1), wn = -h / 2, Dt = new Hn({
2346
+ value: -h / 2,
2347
+ min: -h,
2305
2348
  max: 0,
2306
2349
  precision: 1,
2307
- stiffness: In,
2308
- callback: us
2309
- }), gn = -v / 2, Dt = new Bn({
2350
+ stiffness: An,
2351
+ callback: cs
2352
+ }), yn = -v / 2, Ot = new Hn({
2310
2353
  value: -v / 2,
2311
2354
  min: -v,
2312
2355
  max: 0,
2313
2356
  precision: 1,
2314
- stiffness: In,
2315
- callback: cs
2357
+ stiffness: An,
2358
+ callback: fs
2316
2359
  });
2317
- function ls(y, de) {
2318
- if (Number.isNaN(y)) {
2319
- k = NaN, W(ke, !1);
2360
+ function us(w, de) {
2361
+ if (Number.isNaN(w)) {
2362
+ k = NaN, H(ke, !1);
2320
2363
  return;
2321
2364
  }
2322
- if (M(ke) == !1 || de == !0) {
2323
- W(ke, !0), k = y;
2324
- const me = en(p, v, y);
2325
- Rt.set(Math.round(me.x)), Dt.set(Math.round(me.y));
2365
+ if (E(ke) == !1 || de == !0) {
2366
+ H(ke, !0), k = w;
2367
+ const me = nn(h, v, w);
2368
+ Dt.set(Math.round(me.x)), Ot.set(Math.round(me.y));
2326
2369
  return;
2327
2370
  }
2328
- if (k != y) {
2329
- k = y;
2330
- const me = en(p, v, y);
2331
- Rt.target(Math.round(me.x)), Dt.target(Math.round(me.y));
2371
+ if (k != w) {
2372
+ k = w;
2373
+ const me = nn(h, v, w);
2374
+ Dt.target(Math.round(me.x)), Ot.target(Math.round(me.y));
2332
2375
  return;
2333
2376
  }
2334
2377
  }
2335
- function us(y) {
2336
- vn = y, yn();
2378
+ function cs(w) {
2379
+ wn = w, kn();
2337
2380
  }
2338
- function cs(y) {
2339
- gn = y, yn();
2381
+ function fs(w) {
2382
+ yn = w, kn();
2340
2383
  }
2341
- function yn() {
2342
- const y = vn, de = gn, me = y + p / 2, zt = de + v / 2, Ft = v < p ? me * v / p : me, Lt = v > p ? zt * p / v : zt, fs = Math.atan2(Lt, Ft) / Math.PI * 180 - 45, Vt = Math.sqrt(Ft * Ft + Lt * Lt), et = Math.min(p, v) / 2, ps = et * Math.SQRT2, jt = (Vt - et) / (ps - et), En = 0, xn = En + jt * (22.5 - En), ds = Vt < et ? Vt / et : 1, ms = -x * (me / p) * jt, vs = -x * (zt / v) * jt;
2343
- m.style.transform = `translate(${Math.round(y)}px, ${Math.round(de)}px)`, u.style.transform = `scale(${ds}) rotate(${fs}deg) skew(${xn}deg, ${xn}deg)`, H.style.transform = `translate(${Math.round(ms)}px, ${Math.round(vs)}px)`;
2384
+ function kn() {
2385
+ const w = wn, de = yn, me = w + h / 2, Lt = de + v / 2, Ft = v < h ? me * v / h : me, Vt = v > h ? Lt * h / v : Lt, ps = Math.atan2(Vt, Ft) / Math.PI * 180 - 45, jt = Math.sqrt(Ft * Ft + Vt * Vt), et = Math.min(h, v) / 2, ds = et * Math.SQRT2, Bt = (jt - et) / (ds - et), Sn = 0, Pn = Sn + Bt * (22.5 - Sn), ms = jt < et ? jt / et : 1, vs = -b * (me / h) * Bt, gs = -b * (Lt / v) * Bt;
2386
+ m.style.transform = `translate(${Math.round(w)}px, ${Math.round(de)}px)`, u.style.transform = `scale(${ms}) rotate(${ps}deg) skew(${Pn}deg, ${Pn}deg)`, z.style.transform = `translate(${Math.round(vs)}px, ${Math.round(gs)}px)`;
2344
2387
  }
2345
- var hs = { invoke: a }, Qe = Fi();
2346
- let wn;
2347
- var Ot = On(Qe);
2348
- let kn;
2349
- rt(Ot, (y) => u = y, () => u);
2350
- var $t = ci(Ot, 2);
2388
+ var hs = { invoke: a }, Qe = qi();
2389
+ let bn;
2390
+ var zt = $n(Qe);
2351
2391
  let _n;
2352
- var bn = On($t);
2392
+ rt(zt, (w) => u = w, () => u);
2393
+ var $t = mi(zt, 2);
2353
2394
  let Mn;
2354
- return rt(bn, (y) => H = y, () => H), rt($t, (y) => m = y, () => m), rt(Qe, (y) => o = y, () => o), Er(() => {
2355
- Vr(Qe, 1, Lr(["element anchor", M(j) && "displayed"]), "svelte-1no6o2a"), wn = nt(Qe, "", wn, { filter: `drop-shadow(${l})` }), kn = nt(Ot, "", kn, {
2395
+ var En = $n($t);
2396
+ let xn;
2397
+ return rt(En, (w) => z = w, () => z), rt($t, (w) => m = w, () => m), rt(Qe, (w) => o = w, () => o), Sr(() => {
2398
+ jr(Qe, 1, Vr(["element anchor", E(B) && "displayed"]), "svelte-1no6o2a"), bn = nt(Qe, "", bn, { filter: `drop-shadow(${l})` }), _n = nt(zt, "", _n, {
2356
2399
  width: `${c}px`,
2357
2400
  height: `${c}px`,
2358
- "background-color": f,
2359
- "border-radius": `${h}px`
2360
- }), _n = nt($t, "", _n, {
2361
- width: `${p}px`,
2401
+ "background-color": d,
2402
+ "border-radius": `${f}px`
2403
+ }), Mn = nt($t, "", Mn, {
2404
+ width: `${h}px`,
2362
2405
  height: `${v}px`,
2363
- padding: `${x}px`
2364
- }), Mn = nt(bn, "", Mn, {
2365
- width: `${he}px`,
2366
- height: `${ze}px`,
2406
+ padding: `${b}px`
2407
+ }), xn = nt(En, "", xn, {
2408
+ width: `${Z}px`,
2409
+ height: `${$e}px`,
2367
2410
  "border-radius": `${Pe}px`,
2368
2411
  "background-color": Ie
2369
2412
  });
2370
- }), zr(t, Qe), an(hs);
2413
+ }), Lr(t, Qe), on(hs);
2371
2414
  }
2372
- class Li extends ft {
2415
+ class Zi extends pt {
2373
2416
  width;
2374
2417
  height;
2375
2418
  zoom;
@@ -2377,7 +2420,7 @@ class Li extends ft {
2377
2420
  states;
2378
2421
  component;
2379
2422
  constructor(e, n) {
2380
- super(e, new pn(n, e.lat, e.lng, e.rank)), this.width = e.tooltip.style.dimensions.width + e.tooltip.style.dimensions.margin * 2, this.height = e.tooltip.style.dimensions.height + e.tooltip.style.dimensions.margin * 2, this.zoom = NaN, this.angle = NaN, this.states = [], this.component = fn(Ur, {
2423
+ super(e, new mn(n, e.lat, e.lng, e.rank)), this.width = e.tooltip.style.dimensions.width + e.tooltip.style.dimensions.margin * 2, this.height = e.tooltip.style.dimensions.height + e.tooltip.style.dimensions.margin * 2, this.zoom = NaN, this.angle = NaN, this.states = [], this.component = dn(Wr, {
2381
2424
  target: this.marker.div,
2382
2425
  props: {
2383
2426
  id: this.id,
@@ -2387,10 +2430,10 @@ class Li extends ft {
2387
2430
  });
2388
2431
  }
2389
2432
  get zIndex() {
2390
- return Number.isNaN(this.zoom) ? this.rank : Math.round(-this.zoom * Kn) + As;
2433
+ return Number.isNaN(this.zoom) ? this.rank : Math.round(-this.zoom * tr) + As;
2391
2434
  }
2392
2435
  }
2393
- class Vi extends ft {
2436
+ class Yi extends pt {
2394
2437
  width;
2395
2438
  height;
2396
2439
  margin;
@@ -2398,7 +2441,7 @@ class Vi extends ft {
2398
2441
  component;
2399
2442
  constructor(e, n) {
2400
2443
  if (e.popup == null) throw new Error("Failed to create popup");
2401
- super(e, new pn(n, e.lat, e.lng, An)), this.width = e.popup.style.dimensions.width, this.height = e.popup.style.dimensions.height, this.margin = e.popup.style.dimensions.margin, this.angle = NaN, this.shown = !1, this.component = fn(Ur, {
2444
+ super(e, new mn(n, e.lat, e.lng, Nn)), this.width = e.popup.style.dimensions.width, this.height = e.popup.style.dimensions.height, this.margin = e.popup.style.dimensions.margin, this.angle = NaN, this.shown = !1, this.component = dn(Wr, {
2402
2445
  target: this.marker.div,
2403
2446
  props: {
2404
2447
  id: this.id,
@@ -2408,21 +2451,21 @@ class Vi extends ft {
2408
2451
  });
2409
2452
  }
2410
2453
  get zIndex() {
2411
- return An;
2454
+ return Nn;
2412
2455
  }
2413
2456
  }
2414
- class ji {
2457
+ class Xi {
2415
2458
  id;
2416
2459
  state = void 0;
2417
2460
  pin;
2418
2461
  tooltip;
2419
2462
  popup;
2420
2463
  constructor(e, n) {
2421
- this.id = e.id, this.pin = new zi(e, n), this.tooltip = new Li(e, n), e.popup != null && (this.popup = new Vi(e, n));
2464
+ this.id = e.id, this.pin = new Hi(e, n), this.tooltip = new Zi(e, n), e.popup != null && (this.popup = new Yi(e, n));
2422
2465
  }
2423
2466
  }
2424
2467
  const qt = 4;
2425
- class Bi {
2468
+ class Ji {
2426
2469
  // Elements
2427
2470
  pins = /* @__PURE__ */ new Set();
2428
2471
  // Configuration
@@ -2461,8 +2504,8 @@ class Bi {
2461
2504
  i.contains(a.lat, a.lng) ? Number.isNaN(a.zoom) ? (a.component.invoke().setDisplayed(!0), a.component.invoke().setSuppressed(!0), a.component.invoke().setCollapsed(!1), a.marker.insert()) : (a.component.invoke().setSuppressed(!1), a.shown && r < a.zoom && a.zoom < r + this.pinZoomDelta ? (a.component.invoke().setDisplayed(!0), a.component.invoke().setCollapsed(!1), a.component.invoke().setScale(this.pinFade ? Math.max(0, 1 - (a.zoom - r) * 0.2) : 1), a.marker.insert()) : (a.component.invoke().setCollapsed(!0), a.component.invoke().getCollapsed() && (a.component.invoke().setDisplayed(!1), a.marker.remove()))) : (a.component.invoke().setDisplayed(!1), a.marker.remove());
2462
2505
  }
2463
2506
  }
2464
- var Wr = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], Ui = 270;
2465
- class Wi {
2507
+ var Hr = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], Gi = 270;
2508
+ class Ki {
2466
2509
  // Elements
2467
2510
  tooltips = /* @__PURE__ */ new Set();
2468
2511
  // Configuration
@@ -2472,7 +2515,7 @@ class Wi {
2472
2515
  this.update(e, n), this.tooltips.add(e);
2473
2516
  }
2474
2517
  update(e, n) {
2475
- n ? (e.zoom = n[0], e.states = n[1].map((r) => [r[0], Wr[r[1]]])) : (e.zoom = NaN, e.states = []), e.marker.update(e.zIndex);
2518
+ n ? (e.zoom = n[0], e.states = n[1].map((r) => [r[0], Hr[r[1]]])) : (e.zoom = NaN, e.states = []), e.marker.update(e.zIndex);
2476
2519
  }
2477
2520
  remove(e) {
2478
2521
  e.shown = !0, e.zoom = NaN, e.angle = NaN, e.states = [], e.component.invoke().setAngle(NaN), e.component.invoke().setCollapsed(!0), e.component.invoke().setDisplayed(!1), e.marker.update(e.zIndex), e.marker.remove(), this.tooltips.delete(e);
@@ -2503,7 +2546,7 @@ class Wi {
2503
2546
  a.component.invoke().setDisplayed(!1), a.marker.remove();
2504
2547
  }
2505
2548
  }
2506
- class qi {
2549
+ class Qi {
2507
2550
  // Elements
2508
2551
  popups = /* @__PURE__ */ new Set();
2509
2552
  // Configuration
@@ -2522,11 +2565,11 @@ class qi {
2522
2565
  }
2523
2566
  show(e, n) {
2524
2567
  if (!e.popup || !e.tooltip || !e.pin || (e.pin.shown = !1, e.tooltip.shown = !1, e.popup.angle = e.tooltip.angle, e.popup.shown = !0, this.pan == !1)) return;
2525
- const r = e.popup, s = n.getViewport(), i = s.bounds, a = s.zoom, l = n.getParameters().mapSize * Math.pow(2, a), u = st(i.ne.lat, i.sw.lng, l), c = st(i.sw.lat, i.ne.lng, l), f = c.x - u.x, h = c.y - u.y, m = r.width + r.margin * 8, p = r.height + r.margin * 8, v = st(r.lat, r.lng, l), x = en(m, p, e.tooltip.angle), H = v.x + x.x, he = H + m, ze = v.y + x.y, Pe = ze + p, Ie = H - u.x, j = c.x - he, fe = ze - u.y, we = c.y - Pe;
2526
- let Q = 0;
2527
- f < m ? Q = (Ie - j) / 2 : (Ie < 0 && (Q = Ie), j < 0 && (Q = -j));
2528
- let Z = 0;
2529
- h < p ? Z = (fe - we) / 2 : (fe < 0 && (Z = fe), we < 0 && (Z = -we)), (Q != 0 || Z != 0) && n.panBy(Q, Z);
2568
+ const r = e.popup, s = n.getViewport(), i = s.bounds, a = s.zoom, l = n.getParameters().mapSize * Math.pow(2, a), u = st(i.ne.lat, i.sw.lng, l), c = st(i.sw.lat, i.ne.lng, l), d = c.x - u.x, f = c.y - u.y, m = r.width + r.margin * 8, h = r.height + r.margin * 8, v = st(r.lat, r.lng, l), b = nn(m, h, e.tooltip.angle), z = v.x + b.x, Z = z + m, $e = v.y + b.y, Pe = $e + h, Ie = z - u.x, B = c.x - Z, he = $e - u.y, ye = c.y - Pe;
2569
+ let te = 0;
2570
+ d < m ? te = (Ie - B) / 2 : (Ie < 0 && (te = Ie), B < 0 && (te = -B));
2571
+ let Y = 0;
2572
+ f < h ? Y = (he - ye) / 2 : (he < 0 && (Y = he), ye < 0 && (Y = -ye)), (te != 0 || Y != 0) && n.panBy(te, Y);
2530
2573
  }
2531
2574
  hide(e) {
2532
2575
  !e.popup || !e.tooltip || !e.pin || (e.pin.shown = !0, e.tooltip.shown = !0, e.popup.shown = !1);
@@ -2536,14 +2579,14 @@ class qi {
2536
2579
  e.shown ? (e.component.invoke().setDisplayed(!0), e.component.invoke().setCollapsed(!1), e.component.invoke().setAngle(e.angle, !0), e.marker.insert()) : (e.component.invoke().setCollapsed(!0), e.component.invoke().getCollapsed() && (e.component.invoke().setDisplayed(!1), e.marker.remove()));
2537
2580
  }
2538
2581
  }
2539
- class Hi {
2582
+ class ea {
2540
2583
  mapProvider;
2541
2584
  pinManager;
2542
2585
  tooltipManager;
2543
2586
  popupManager;
2544
2587
  elementsStore;
2545
2588
  constructor(e) {
2546
- this.mapProvider = e, this.pinManager = new Bi(), this.tooltipManager = new Wi(), this.popupManager = new qi(), this.elementsStore = /* @__PURE__ */ new Map();
2589
+ this.mapProvider = e, this.pinManager = new Ji(), this.tooltipManager = new Ki(), this.popupManager = new Qi(), this.elementsStore = /* @__PURE__ */ new Map();
2547
2590
  }
2548
2591
  set configuration(e) {
2549
2592
  this.pinManager.configuration = e, this.popupManager.configuration = e;
@@ -2568,7 +2611,7 @@ class Hi {
2568
2611
  insertElements(e, n) {
2569
2612
  for (const r of e) {
2570
2613
  let s = this.elementsStore.get(r.data.id);
2571
- s == null && (s = new ji(r.data, this.mapProvider), s.tooltip.marker.div.addEventListener("click", (i) => n(i, r.data.id)), this.elementsStore.set(r.data.id, s)), this.pinManager.insert(s.pin, r.state), this.tooltipManager.insert(s.tooltip, r.state), s.popup != null && this.popupManager.insert(s.popup);
2614
+ s == null && (s = new Xi(r.data, this.mapProvider), s.tooltip.marker.div.addEventListener("click", (i) => n(i, r.data.id)), this.elementsStore.set(r.data.id, s)), this.pinManager.insert(s.pin, r.state), this.tooltipManager.insert(s.tooltip, r.state), s.popup != null && this.popupManager.insert(s.popup);
2572
2615
  }
2573
2616
  this.pinManager.refresh(), this.tooltipManager.refresh();
2574
2617
  }
@@ -2593,11 +2636,11 @@ class Hi {
2593
2636
  }
2594
2637
  //#endregion
2595
2638
  }
2596
- const qr = '(function(){"use strict";var i=a=>new Promise(t=>setTimeout(t,a));async function h(a,t){let s=0,o=Math.max(1,t?.retry?.times??1);for(;s<o;)try{return{data:await a(),error:null}}catch(r){if(s++,s==o){if(r instanceof Error)return(!t?.exceptions||t.exceptions.some(e=>r instanceof e)==!1)&&t?.catch?.(r),{data:null,error:r};throw t?.catch?.(r),r}else t?.retry?.delay&&await i(t.retry.delay)}throw Error("Unreachable code")}async function l(a,t,s,o,r){let e=await h(async()=>await(await fetch(a,{...s,method:"POST",body:t?JSON.stringify(t):void 0,headers:{...s?.headers,"Content-Type":"application/json"}})).json(),{retry:{times:o,delay:r}});if(e.error)throw e.error;return e.data}const f="https://maps.api.arenarium.dev/states",m=3,d=500,u={async fetch(a){const s={headers:{"Cache-Control":self?.location.host.startsWith("localhost")||self?.location.host.startsWith("127.0.0.1")?"no-cache":""}};return await l(f,a,s,m,d)}};class y{methods;constructor(t){this.methods=t}listen(){self.onmessage=this.onmessage.bind(this)}async onmessage(t){const{id:s,method:o,args:r}=t.data;try{const e=this.methods[o];if(typeof e!="function")throw new Error(`Unknown method: ${o}`);const n=await e(...r),c={id:s,result:n};self.postMessage(c)}catch(e){const n=e instanceof Error?e.message:String(e),c={id:s,error:n};self.postMessage(c)}}}new y(u).listen()})();\n', Un = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", qr], { type: "text/javascript;charset=utf-8" });
2597
- function Zi(t) {
2639
+ const qr = '(function(){"use strict";var i=a=>new Promise(t=>setTimeout(t,a));async function h(a,t){let s=0,o=Math.max(1,t?.retry?.times??1);for(;s<o;)try{return{data:await a(),error:null}}catch(r){if(s++,s==o){if(r instanceof Error)return(!t?.exceptions||t.exceptions.some(e=>r instanceof e)==!1)&&t?.catch?.(r),{data:null,error:r};throw t?.catch?.(r),r}else t?.retry?.delay&&await i(t.retry.delay)}throw Error("Unreachable code")}async function l(a,t,s,o,r){let e=await h(async()=>await(await fetch(a,{...s,method:"POST",body:t?JSON.stringify(t):void 0,headers:{...s?.headers,"Content-Type":"application/json"}})).json(),{retry:{times:o,delay:r}});if(e.error)throw e.error;return e.data}const f="https://maps.api.arenarium.dev/states",m=3,d=500,u={async fetch(a){const s={headers:{"Cache-Control":self?.location.host.startsWith("localhost")||self?.location.host.startsWith("127.0.0.1")?"no-cache":""}};return await l(f,a,s,m,d)}};class y{methods;constructor(t){this.methods=t}listen(){self.onmessage=this.onmessage.bind(this)}async onmessage(t){const{id:s,method:o,args:r}=t.data;try{const e=this.methods[o];if(typeof e!="function")throw new Error(`Unknown method: ${o}`);const n=await e(...r),c={id:s,result:n};self.postMessage(c)}catch(e){const n=e instanceof Error?e.message:String(e),c={id:s,error:n};self.postMessage(c)}}}new y(u).listen()})();\n', qn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", qr], { type: "text/javascript;charset=utf-8" });
2640
+ function ta(t) {
2598
2641
  let e;
2599
2642
  try {
2600
- if (e = Un && (self.URL || self.webkitURL).createObjectURL(Un), !e) throw "";
2643
+ if (e = qn && (self.URL || self.webkitURL).createObjectURL(qn), !e) throw "";
2601
2644
  const n = new Worker(e, {
2602
2645
  name: t?.name
2603
2646
  });
@@ -2613,8 +2656,8 @@ function Zi(t) {
2613
2656
  );
2614
2657
  }
2615
2658
  }
2616
- var Yi = (t) => new Promise((e) => setTimeout(e, t));
2617
- async function Hr(t, e) {
2659
+ var na = (t) => new Promise((e) => setTimeout(e, t));
2660
+ async function Zr(t, e) {
2618
2661
  let n = 0, r = Math.max(1, e?.retry?.times ?? 1);
2619
2662
  for (; n < r; ) try {
2620
2663
  return { data: await t(), error: null };
@@ -2623,137 +2666,137 @@ async function Hr(t, e) {
2623
2666
  if (s instanceof Error)
2624
2667
  return (!e?.exceptions || e.exceptions.some((i) => s instanceof i) == !1) && e?.catch?.(s), { data: null, error: s };
2625
2668
  throw e?.catch?.(s), s;
2626
- } else e?.retry?.delay && await Yi(e.retry.delay);
2669
+ } else e?.retry?.delay && await na(e.retry.delay);
2627
2670
  }
2628
2671
  throw Error("Unreachable code");
2629
2672
  }
2630
- async function Xi(t, e, n, r, s) {
2631
- let i = await Hr(async () => await (await fetch(t, { ...n, method: "POST", body: e ? JSON.stringify(e) : void 0, headers: { ...n?.headers, "Content-Type": "application/json" } })).json(), { retry: { times: r, delay: s } });
2673
+ async function ra(t, e, n, r, s) {
2674
+ let i = await Zr(async () => await (await fetch(t, { ...n, method: "POST", body: e ? JSON.stringify(e) : void 0, headers: { ...n?.headers, "Content-Type": "application/json" } })).json(), { retry: { times: r, delay: s } });
2632
2675
  if (i.error) throw i.error;
2633
2676
  return i.data;
2634
2677
  }
2635
- async function Ji(t, e, n, r, s) {
2636
- let i = await Hr(async () => {
2678
+ async function sa(t, e, n, r, s) {
2679
+ let i = await Zr(async () => {
2637
2680
  await fetch(t, { ...n, method: "PUT", body: e ? JSON.stringify(e) : void 0, headers: { ...n?.headers, "Content-Type": "application/json" } });
2638
2681
  }, { retry: { times: r, delay: s } });
2639
2682
  if (i.error) throw i.error;
2640
2683
  }
2641
- const Ue = 0xc3a5c85c97cb3127n, ae = 0xb492b66fbe98f273n, We = 0x9ae16a3b2f90404fn, Zr = 0xc949d7c7509e6557n, q = 0xffffffffffffffffn;
2642
- function d(t) {
2684
+ const Be = 0xc3a5c85c97cb3127n, oe = 0xb492b66fbe98f273n, Ue = 0x9ae16a3b2f90404fn, Yr = 0xc949d7c7509e6557n, q = 0xffffffffffffffffn;
2685
+ function p(t) {
2643
2686
  return t & q;
2644
2687
  }
2645
- function T(t, e) {
2688
+ function A(t, e) {
2646
2689
  return e === 0 ? t & q : (t = t & q, (t >> BigInt(e) | t << BigInt(64 - e)) & q);
2647
2690
  }
2648
- function Gi(t, e) {
2691
+ function ia(t, e) {
2649
2692
  return t = t & q, (t >> BigInt(e) | t << BigInt(64 - e)) & q;
2650
2693
  }
2651
- function ut(t) {
2652
- return d(t ^ t >> 47n);
2694
+ function ct(t) {
2695
+ return p(t ^ t >> 47n);
2653
2696
  }
2654
- function b(t, e = 0) {
2697
+ function M(t, e = 0) {
2655
2698
  let n = 0n;
2656
2699
  for (let r = 0; r < 8; r++)
2657
2700
  e + r < t.length && (n |= BigInt(t[e + r]) << BigInt(r * 8));
2658
2701
  return n & q;
2659
2702
  }
2660
- function Wn(t, e = 0) {
2703
+ function Zn(t, e = 0) {
2661
2704
  let n = 0n;
2662
2705
  for (let r = 0; r < 4; r++)
2663
2706
  e + r < t.length && (n |= BigInt(t[e + r]) << BigInt(r * 8));
2664
2707
  return n & 0xffffffffn;
2665
2708
  }
2666
- function Ki(t) {
2709
+ function aa(t) {
2667
2710
  const e = 0x9ddfea08eb382d69n;
2668
2711
  let n = (t.first ^ t.second) * e & q;
2669
2712
  n ^= n >> 47n, n = n & q;
2670
2713
  let r = (t.second ^ n) * e & q;
2671
2714
  return r ^= r >> 47n, r = r * e & q, r;
2672
2715
  }
2673
- function qe(t, e) {
2674
- return Ki({ first: t, second: e });
2716
+ function We(t, e) {
2717
+ return aa({ first: t, second: e });
2675
2718
  }
2676
- function Qi(t) {
2719
+ function oa(t) {
2677
2720
  const e = t.length;
2678
2721
  if (e > 8) {
2679
- const n = b(t), r = b(t, e - 8);
2680
- return (qe(n, Gi(r + BigInt(e) & q, e)) ^ r) & q;
2722
+ const n = M(t), r = M(t, e - 8);
2723
+ return (We(n, ia(r + BigInt(e) & q, e)) ^ r) & q;
2681
2724
  }
2682
2725
  if (e >= 4) {
2683
- const n = Wn(t);
2684
- return qe(BigInt(e) + (n << 3n) & q, Wn(t, e - 4));
2726
+ const n = Zn(t);
2727
+ return We(BigInt(e) + (n << 3n) & q, Zn(t, e - 4));
2685
2728
  }
2686
2729
  if (e > 0) {
2687
- const n = BigInt(t[0]), r = BigInt(t[e >> 1]), s = BigInt(t[e - 1]), i = d(n + (r << 8n)), a = d(BigInt(e) + (s << 2n));
2688
- return d(ut(d(i * We) ^ d(a * Zr)) * We);
2730
+ const n = BigInt(t[0]), r = BigInt(t[e >> 1]), s = BigInt(t[e - 1]), i = p(n + (r << 8n)), a = p(BigInt(e) + (s << 2n));
2731
+ return p(ct(p(i * Ue) ^ p(a * Yr)) * Ue);
2689
2732
  }
2690
- return We;
2733
+ return Ue;
2691
2734
  }
2692
- function ea(t) {
2693
- const e = t.length, n = d(b(t) * ae), r = b(t, 8), s = d(b(t, e - 8) * We), i = d(b(t, e - 16) * Ue);
2694
- return qe(d(T(d(n - r), 43) + T(s, 30) + i), d(n + T(r ^ Zr, 20) - s + BigInt(e)));
2735
+ function la(t) {
2736
+ const e = t.length, n = p(M(t) * oe), r = M(t, 8), s = p(M(t, e - 8) * Ue), i = p(M(t, e - 16) * Be);
2737
+ return We(p(A(p(n - r), 43) + A(s, 30) + i), p(n + A(r ^ Yr, 20) - s + BigInt(e)));
2695
2738
  }
2696
- function ta(t, e, n, r, s, i) {
2697
- s = d(s + t), i = T(d(i + s + r), 21);
2739
+ function ua(t, e, n, r, s, i) {
2740
+ s = p(s + t), i = A(p(i + s + r), 21);
2698
2741
  const a = s;
2699
- return s = d(s + e), s = d(s + n), i = d(i + T(s, 44)), { first: d(s + r), second: d(i + a) };
2700
- }
2701
- function yt(t, e, n, r) {
2702
- return ta(b(t, e), b(t, e + 8), b(t, e + 16), b(t, e + 24), n, r);
2703
- }
2704
- function na(t) {
2705
- const e = t.length, n = b(t, 24);
2706
- let r = d(b(t) + d((BigInt(e) + b(t, e - 16)) * Ue)), s = T(d(r + n), 52), i = T(r, 37);
2707
- r = d(r + b(t, 8)), i = d(i + T(r, 7)), r = d(r + b(t, 16));
2708
- const a = d(r + n), o = d(s + T(r, 31) + i);
2709
- r = d(b(t, 16) + b(t, e - 32));
2710
- const l = b(t, e - 8);
2711
- s = T(d(r + l), 52), i = T(r, 37), r = d(r + b(t, e - 24)), i = d(i + T(r, 7)), r = d(r + b(t, e - 16));
2712
- const u = d(r + l), c = d(s + T(r, 31) + i), f = ut(d(d(a + c) * We + d(u + o) * Ue));
2713
- return d(ut(d(f * Ue + o)) * We);
2714
- }
2715
- function ra(t) {
2742
+ return s = p(s + e), s = p(s + n), i = p(i + A(s, 44)), { first: p(s + r), second: p(i + a) };
2743
+ }
2744
+ function kt(t, e, n, r) {
2745
+ return ua(M(t, e), M(t, e + 8), M(t, e + 16), M(t, e + 24), n, r);
2746
+ }
2747
+ function ca(t) {
2748
+ const e = t.length, n = M(t, 24);
2749
+ let r = p(M(t) + p((BigInt(e) + M(t, e - 16)) * Be)), s = A(p(r + n), 52), i = A(r, 37);
2750
+ r = p(r + M(t, 8)), i = p(i + A(r, 7)), r = p(r + M(t, 16));
2751
+ const a = p(r + n), o = p(s + A(r, 31) + i);
2752
+ r = p(M(t, 16) + M(t, e - 32));
2753
+ const l = M(t, e - 8);
2754
+ s = A(p(r + l), 52), i = A(r, 37), r = p(r + M(t, e - 24)), i = p(i + A(r, 7)), r = p(r + M(t, e - 16));
2755
+ const u = p(r + l), c = p(s + A(r, 31) + i), d = ct(p(p(a + c) * Ue + p(u + o) * Be));
2756
+ return p(ct(p(d * Be + o)) * Ue);
2757
+ }
2758
+ function fa(t) {
2716
2759
  let e;
2717
2760
  typeof t == "string" ? e = new TextEncoder().encode(t) : e = t;
2718
2761
  const n = e.length;
2719
2762
  if (n <= 32)
2720
- return n <= 16 ? Qi(e) : ea(e);
2763
+ return n <= 16 ? oa(e) : la(e);
2721
2764
  if (n <= 64)
2722
- return na(e);
2723
- let r = b(e), s = d(b(e, n - 16) ^ ae), i = d(b(e, n - 56) ^ Ue), a = yt(e, n - 64, BigInt(n), s), o = yt(e, n - 32, d(BigInt(n) * ae), Ue);
2724
- i = d(i + ut(a.second) * ae), r = d(T(d(i + r), 39) * ae), s = d(T(s, 33) * ae);
2765
+ return ca(e);
2766
+ let r = M(e), s = p(M(e, n - 16) ^ oe), i = p(M(e, n - 56) ^ Be), a = kt(e, n - 64, BigInt(n), s), o = kt(e, n - 32, p(BigInt(n) * oe), Be);
2767
+ i = p(i + ct(a.second) * oe), r = p(A(p(i + r), 39) * oe), s = p(A(s, 33) * oe);
2725
2768
  let l = n - 1 & -64, u = 0;
2726
2769
  for (; l > 0; )
2727
- r = d(T(d(r + s + a.first + b(e, u + 16)), 37) * ae), s = d(T(d(s + a.second + b(e, u + 48)), 42) * ae), r ^= o.second, s ^= a.first, i = T(i ^ o.first, 33), a = yt(e, u, d(a.second * ae), d(r + o.first)), o = yt(e, u + 32, d(i + o.second), s), [i, r] = [r, i], u += 64, l -= 64;
2728
- return qe(qe(a.first, o.first) + d(ut(s) * ae) + i, qe(a.second, o.second) + r);
2770
+ r = p(A(p(r + s + a.first + M(e, u + 16)), 37) * oe), s = p(A(p(s + a.second + M(e, u + 48)), 42) * oe), r ^= o.second, s ^= a.first, i = A(i ^ o.first, 33), a = kt(e, u, p(a.second * oe), p(r + o.first)), o = kt(e, u + 32, p(i + o.second), s), [i, r] = [r, i], u += 64, l -= 64;
2771
+ return We(We(a.first, o.first) + p(ct(s) * oe) + i, We(a.second, o.second) + r);
2729
2772
  }
2730
- function sa(t) {
2731
- return ra(JSON.stringify(t)).toString();
2773
+ function ha(t) {
2774
+ return fa(JSON.stringify(t)).toString();
2732
2775
  }
2733
- let Ht;
2776
+ let Zt;
2734
2777
  // @__NO_SIDE_EFFECTS__
2735
- function Yr(t) {
2778
+ function Xr(t) {
2736
2779
  return {
2737
- lang: Ht?.lang,
2780
+ lang: Zt?.lang,
2738
2781
  message: t?.message,
2739
- abortEarly: Ht?.abortEarly,
2740
- abortPipeEarly: Ht?.abortPipeEarly
2782
+ abortEarly: Zt?.abortEarly,
2783
+ abortPipeEarly: Zt?.abortPipeEarly
2741
2784
  };
2742
2785
  }
2743
- let ia;
2786
+ let pa;
2744
2787
  // @__NO_SIDE_EFFECTS__
2745
- function aa(t) {
2746
- return ia?.get(t);
2788
+ function da(t) {
2789
+ return pa?.get(t);
2747
2790
  }
2748
- let oa;
2791
+ let ma;
2749
2792
  // @__NO_SIDE_EFFECTS__
2750
- function la(t) {
2751
- return oa?.get(t);
2793
+ function va(t) {
2794
+ return ma?.get(t);
2752
2795
  }
2753
- let ua;
2796
+ let ga;
2754
2797
  // @__NO_SIDE_EFFECTS__
2755
- function ca(t, e) {
2756
- return ua?.get(t)?.get(e);
2798
+ function wa(t, e) {
2799
+ return ga?.get(t)?.get(e);
2757
2800
  }
2758
2801
  // @__NO_SIDE_EFFECTS__
2759
2802
  function Je(t) {
@@ -2774,25 +2817,25 @@ function I(t, e, n, r, s) {
2774
2817
  lang: r.lang,
2775
2818
  abortEarly: r.abortEarly,
2776
2819
  abortPipeEarly: r.abortPipeEarly
2777
- }, u = t.kind === "schema", c = s?.message ?? t.message ?? /* @__PURE__ */ ca(t.reference, l.lang) ?? (u ? /* @__PURE__ */ la(l.lang) : null) ?? r.message ?? /* @__PURE__ */ aa(l.lang);
2820
+ }, u = t.kind === "schema", c = s?.message ?? t.message ?? /* @__PURE__ */ wa(t.reference, l.lang) ?? (u ? /* @__PURE__ */ va(l.lang) : null) ?? r.message ?? /* @__PURE__ */ da(l.lang);
2778
2821
  c !== void 0 && (l.message = typeof c == "function" ? c(l) : c), u && (n.typed = !1), n.issues ? n.issues.push(l) : n.issues = [l];
2779
2822
  }
2780
2823
  // @__NO_SIDE_EFFECTS__
2781
- function V(t) {
2824
+ function j(t) {
2782
2825
  return {
2783
2826
  version: 1,
2784
2827
  vendor: "valibot",
2785
2828
  validate(e) {
2786
- return t["~run"]({ value: e }, /* @__PURE__ */ Yr());
2829
+ return t["~run"]({ value: e }, /* @__PURE__ */ Xr());
2787
2830
  }
2788
2831
  };
2789
2832
  }
2790
2833
  // @__NO_SIDE_EFFECTS__
2791
- function ha(t, e) {
2834
+ function ya(t, e) {
2792
2835
  const n = [...new Set(t)];
2793
2836
  return n.length > 1 ? `(${n.join(` ${e} `)})` : n[0] ?? "never";
2794
2837
  }
2795
- var Tt = class extends Error {
2838
+ var Nt = class extends Error {
2796
2839
  /**
2797
2840
  * Creates a Valibot error with useful information.
2798
2841
  *
@@ -2814,18 +2857,18 @@ function $(t) {
2814
2857
  const r = e.value;
2815
2858
  return e.value = (...s) => {
2816
2859
  const i = this.schema["~run"]({ value: s }, n);
2817
- if (i.issues) throw new Tt(i.issues);
2860
+ if (i.issues) throw new Nt(i.issues);
2818
2861
  return r(...i.value);
2819
2862
  }, e;
2820
2863
  }
2821
2864
  };
2822
2865
  }
2823
2866
  // @__NO_SIDE_EFFECTS__
2824
- function Xr() {
2867
+ function Jr() {
2825
2868
  return {
2826
2869
  kind: "transformation",
2827
2870
  type: "await",
2828
- reference: Xr,
2871
+ reference: Jr,
2829
2872
  async: !0,
2830
2873
  async "~run"(t) {
2831
2874
  return t.value = await t.value, t;
@@ -2833,11 +2876,11 @@ function Xr() {
2833
2876
  };
2834
2877
  }
2835
2878
  // @__NO_SIDE_EFFECTS__
2836
- function Jr(t, e) {
2879
+ function Gr(t, e) {
2837
2880
  return {
2838
2881
  kind: "validation",
2839
2882
  type: "check",
2840
- reference: Jr,
2883
+ reference: Gr,
2841
2884
  async: !1,
2842
2885
  expects: null,
2843
2886
  requirement: t,
@@ -2848,11 +2891,11 @@ function Jr(t, e) {
2848
2891
  };
2849
2892
  }
2850
2893
  // @__NO_SIDE_EFFECTS__
2851
- function Gr(t, e) {
2894
+ function Kr(t, e) {
2852
2895
  return {
2853
2896
  kind: "validation",
2854
2897
  type: "length",
2855
- reference: Gr,
2898
+ reference: Kr,
2856
2899
  async: !1,
2857
2900
  expects: `${t}`,
2858
2901
  requirement: t,
@@ -2863,11 +2906,11 @@ function Gr(t, e) {
2863
2906
  };
2864
2907
  }
2865
2908
  // @__NO_SIDE_EFFECTS__
2866
- function ct(t, e) {
2909
+ function ft(t, e) {
2867
2910
  return {
2868
2911
  kind: "validation",
2869
2912
  type: "max_value",
2870
- reference: ct,
2913
+ reference: ft,
2871
2914
  async: !1,
2872
2915
  expects: `<=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ Je(t)}`,
2873
2916
  requirement: t,
@@ -2878,11 +2921,11 @@ function ct(t, e) {
2878
2921
  };
2879
2922
  }
2880
2923
  // @__NO_SIDE_EFFECTS__
2881
- function dn(t, e) {
2924
+ function vn(t, e) {
2882
2925
  return {
2883
2926
  kind: "validation",
2884
2927
  type: "min_length",
2885
- reference: dn,
2928
+ reference: vn,
2886
2929
  async: !1,
2887
2930
  expects: `>=${t}`,
2888
2931
  requirement: t,
@@ -2908,61 +2951,61 @@ function C(t, e) {
2908
2951
  };
2909
2952
  }
2910
2953
  // @__NO_SIDE_EFFECTS__
2911
- function L(t) {
2954
+ function V(t) {
2912
2955
  return {
2913
2956
  kind: "transformation",
2914
2957
  type: "returns",
2915
- reference: L,
2958
+ reference: V,
2916
2959
  async: !1,
2917
2960
  schema: t,
2918
2961
  "~run"(e, n) {
2919
2962
  const r = e.value;
2920
2963
  return e.value = (...s) => {
2921
2964
  const i = this.schema["~run"]({ value: r(...s) }, n);
2922
- if (i.issues) throw new Tt(i.issues);
2965
+ if (i.issues) throw new Nt(i.issues);
2923
2966
  return i.value;
2924
2967
  }, e;
2925
2968
  }
2926
2969
  };
2927
2970
  }
2928
2971
  // @__NO_SIDE_EFFECTS__
2929
- function Kr(t) {
2972
+ function Qr(t) {
2930
2973
  return {
2931
2974
  kind: "transformation",
2932
2975
  type: "returns",
2933
- reference: Kr,
2976
+ reference: Qr,
2934
2977
  async: !1,
2935
2978
  schema: t,
2936
2979
  "~run"(e, n) {
2937
2980
  const r = e.value;
2938
2981
  return e.value = async (...s) => {
2939
2982
  const i = await this.schema["~run"]({ value: await r(...s) }, n);
2940
- if (i.issues) throw new Tt(i.issues);
2983
+ if (i.issues) throw new Nt(i.issues);
2941
2984
  return i.value;
2942
2985
  }, e;
2943
2986
  }
2944
2987
  };
2945
2988
  }
2946
2989
  // @__NO_SIDE_EFFECTS__
2947
- function fa(t, e, n) {
2990
+ function ka(t, e, n) {
2948
2991
  return typeof t.fallback == "function" ? t.fallback(e, n) : t.fallback;
2949
2992
  }
2950
2993
  // @__NO_SIDE_EFFECTS__
2951
- function Qr(t, e, n) {
2994
+ function es(t, e, n) {
2952
2995
  return typeof t.default == "function" ? t.default(e, n) : t.default;
2953
2996
  }
2954
2997
  // @__NO_SIDE_EFFECTS__
2955
- function es(t, e) {
2998
+ function ts(t, e) {
2956
2999
  return {
2957
3000
  kind: "schema",
2958
3001
  type: "array",
2959
- reference: es,
3002
+ reference: ts,
2960
3003
  expects: "Array",
2961
3004
  async: !1,
2962
3005
  item: t,
2963
3006
  message: e,
2964
3007
  get "~standard"() {
2965
- return /* @__PURE__ */ V(this);
3008
+ return /* @__PURE__ */ j(this);
2966
3009
  },
2967
3010
  "~run"(n, r) {
2968
3011
  const s = n.value;
@@ -2993,16 +3036,16 @@ function es(t, e) {
2993
3036
  };
2994
3037
  }
2995
3038
  // @__NO_SIDE_EFFECTS__
2996
- function ts(t) {
3039
+ function ns(t) {
2997
3040
  return {
2998
3041
  kind: "schema",
2999
3042
  type: "boolean",
3000
- reference: ts,
3043
+ reference: ns,
3001
3044
  expects: "boolean",
3002
3045
  async: !1,
3003
3046
  message: t,
3004
3047
  get "~standard"() {
3005
- return /* @__PURE__ */ V(this);
3048
+ return /* @__PURE__ */ j(this);
3006
3049
  },
3007
3050
  "~run"(e, n) {
3008
3051
  return typeof e.value == "boolean" ? e.typed = !0 : I(this, "type", e, n), e;
@@ -3010,17 +3053,17 @@ function ts(t) {
3010
3053
  };
3011
3054
  }
3012
3055
  // @__NO_SIDE_EFFECTS__
3013
- function ns(t, e) {
3056
+ function rs(t, e) {
3014
3057
  return {
3015
3058
  kind: "schema",
3016
3059
  type: "custom",
3017
- reference: ns,
3060
+ reference: rs,
3018
3061
  expects: "unknown",
3019
3062
  async: !1,
3020
3063
  check: t,
3021
3064
  message: e,
3022
3065
  get "~standard"() {
3023
- return /* @__PURE__ */ V(this);
3066
+ return /* @__PURE__ */ j(this);
3024
3067
  },
3025
3068
  "~run"(n, r) {
3026
3069
  return this.check(n.value) ? n.typed = !0 : I(this, "type", n, r), n;
@@ -3028,16 +3071,16 @@ function ns(t, e) {
3028
3071
  };
3029
3072
  }
3030
3073
  // @__NO_SIDE_EFFECTS__
3031
- function A(t) {
3074
+ function T(t) {
3032
3075
  return {
3033
3076
  kind: "schema",
3034
3077
  type: "function",
3035
- reference: A,
3078
+ reference: T,
3036
3079
  expects: "Function",
3037
3080
  async: !1,
3038
3081
  message: t,
3039
3082
  get "~standard"() {
3040
- return /* @__PURE__ */ V(this);
3083
+ return /* @__PURE__ */ j(this);
3041
3084
  },
3042
3085
  "~run"(e, n) {
3043
3086
  return typeof e.value == "function" ? e.typed = !0 : I(this, "type", e, n), e;
@@ -3055,7 +3098,7 @@ function Re(t, e) {
3055
3098
  literal: t,
3056
3099
  message: e,
3057
3100
  get "~standard"() {
3058
- return /* @__PURE__ */ V(this);
3101
+ return /* @__PURE__ */ j(this);
3059
3102
  },
3060
3103
  "~run"(n, r) {
3061
3104
  return n.value === this.literal ? n.typed = !0 : I(this, "type", n, r), n;
@@ -3063,16 +3106,16 @@ function Re(t, e) {
3063
3106
  };
3064
3107
  }
3065
3108
  // @__NO_SIDE_EFFECTS__
3066
- function E(t) {
3109
+ function x(t) {
3067
3110
  return {
3068
3111
  kind: "schema",
3069
3112
  type: "number",
3070
- reference: E,
3113
+ reference: x,
3071
3114
  expects: "number",
3072
3115
  async: !1,
3073
3116
  message: t,
3074
3117
  get "~standard"() {
3075
- return /* @__PURE__ */ V(this);
3118
+ return /* @__PURE__ */ j(this);
3076
3119
  },
3077
3120
  "~run"(e, n) {
3078
3121
  return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : I(this, "type", e, n), e;
@@ -3090,7 +3133,7 @@ function R(t, e) {
3090
3133
  entries: t,
3091
3134
  message: e,
3092
3135
  get "~standard"() {
3093
- return /* @__PURE__ */ V(this);
3136
+ return /* @__PURE__ */ j(this);
3094
3137
  },
3095
3138
  "~run"(n, r) {
3096
3139
  const s = n.value;
@@ -3099,7 +3142,7 @@ function R(t, e) {
3099
3142
  for (const i in this.entries) {
3100
3143
  const a = this.entries[i];
3101
3144
  if (i in s || (a.type === "exact_optional" || a.type === "optional" || a.type === "nullish") && a.default !== void 0) {
3102
- const o = i in s ? s[i] : /* @__PURE__ */ Qr(a), l = a["~run"]({ value: o }, r);
3145
+ const o = i in s ? s[i] : /* @__PURE__ */ es(a), l = a["~run"]({ value: o }, r);
3103
3146
  if (l.issues) {
3104
3147
  const u = {
3105
3148
  type: "object",
@@ -3116,7 +3159,7 @@ function R(t, e) {
3116
3159
  }
3117
3160
  }
3118
3161
  l.typed || (n.typed = !1), n.value[i] = l.value;
3119
- } else if (a.fallback !== void 0) n.value[i] = /* @__PURE__ */ fa(a);
3162
+ } else if (a.fallback !== void 0) n.value[i] = /* @__PURE__ */ ka(a);
3120
3163
  else if (a.type !== "exact_optional" && a.type !== "optional" && a.type !== "nullish" && (I(this, "key", n, r, {
3121
3164
  input: void 0,
3122
3165
  expected: `"${i}"`,
@@ -3136,34 +3179,34 @@ function R(t, e) {
3136
3179
  };
3137
3180
  }
3138
3181
  // @__NO_SIDE_EFFECTS__
3139
- function re(t, e) {
3182
+ function se(t, e) {
3140
3183
  return {
3141
3184
  kind: "schema",
3142
3185
  type: "optional",
3143
- reference: re,
3186
+ reference: se,
3144
3187
  expects: `(${t.expects} | undefined)`,
3145
3188
  async: !1,
3146
3189
  wrapped: t,
3147
3190
  default: e,
3148
3191
  get "~standard"() {
3149
- return /* @__PURE__ */ V(this);
3192
+ return /* @__PURE__ */ j(this);
3150
3193
  },
3151
3194
  "~run"(n, r) {
3152
- return n.value === void 0 && (this.default !== void 0 && (n.value = /* @__PURE__ */ Qr(this, n, r)), n.value === void 0) ? (n.typed = !0, n) : this.wrapped["~run"](n, r);
3195
+ return n.value === void 0 && (this.default !== void 0 && (n.value = /* @__PURE__ */ es(this, n, r)), n.value === void 0) ? (n.typed = !0, n) : this.wrapped["~run"](n, r);
3153
3196
  }
3154
3197
  };
3155
3198
  }
3156
3199
  // @__NO_SIDE_EFFECTS__
3157
- function rs(t) {
3200
+ function ss(t) {
3158
3201
  return {
3159
3202
  kind: "schema",
3160
3203
  type: "promise",
3161
- reference: rs,
3204
+ reference: ss,
3162
3205
  expects: "Promise",
3163
3206
  async: !1,
3164
3207
  message: t,
3165
3208
  get "~standard"() {
3166
- return /* @__PURE__ */ V(this);
3209
+ return /* @__PURE__ */ j(this);
3167
3210
  },
3168
3211
  "~run"(e, n) {
3169
3212
  return e.value instanceof Promise ? e.typed = !0 : I(this, "type", e, n), e;
@@ -3171,16 +3214,16 @@ function rs(t) {
3171
3214
  };
3172
3215
  }
3173
3216
  // @__NO_SIDE_EFFECTS__
3174
- function ue(t) {
3217
+ function ce(t) {
3175
3218
  return {
3176
3219
  kind: "schema",
3177
3220
  type: "string",
3178
- reference: ue,
3221
+ reference: ce,
3179
3222
  expects: "string",
3180
3223
  async: !1,
3181
3224
  message: t,
3182
3225
  get "~standard"() {
3183
- return /* @__PURE__ */ V(this);
3226
+ return /* @__PURE__ */ j(this);
3184
3227
  },
3185
3228
  "~run"(e, n) {
3186
3229
  return typeof e.value == "string" ? e.typed = !0 : I(this, "type", e, n), e;
@@ -3188,17 +3231,17 @@ function ue(t) {
3188
3231
  };
3189
3232
  }
3190
3233
  // @__NO_SIDE_EFFECTS__
3191
- function z(t, e) {
3234
+ function L(t, e) {
3192
3235
  return {
3193
3236
  kind: "schema",
3194
3237
  type: "tuple",
3195
- reference: z,
3238
+ reference: L,
3196
3239
  expects: "Array",
3197
3240
  async: !1,
3198
3241
  items: t,
3199
3242
  message: e,
3200
3243
  get "~standard"() {
3201
- return /* @__PURE__ */ V(this);
3244
+ return /* @__PURE__ */ j(this);
3202
3245
  },
3203
3246
  "~run"(n, r) {
3204
3247
  const s = n.value;
@@ -3229,23 +3272,23 @@ function z(t, e) {
3229
3272
  };
3230
3273
  }
3231
3274
  // @__NO_SIDE_EFFECTS__
3232
- function qn(t) {
3275
+ function Yn(t) {
3233
3276
  let e;
3234
3277
  if (t) for (const n of t) e ? e.push(...n.issues) : e = n.issues;
3235
3278
  return e;
3236
3279
  }
3237
3280
  // @__NO_SIDE_EFFECTS__
3238
- function mn(t, e) {
3281
+ function gn(t, e) {
3239
3282
  return {
3240
3283
  kind: "schema",
3241
3284
  type: "union",
3242
- reference: mn,
3243
- expects: /* @__PURE__ */ ha(t.map((n) => n.expects), "|"),
3285
+ reference: gn,
3286
+ expects: /* @__PURE__ */ ya(t.map((n) => n.expects), "|"),
3244
3287
  async: !1,
3245
3288
  options: t,
3246
3289
  message: e,
3247
3290
  get "~standard"() {
3248
- return /* @__PURE__ */ V(this);
3291
+ return /* @__PURE__ */ j(this);
3249
3292
  },
3250
3293
  "~run"(n, r) {
3251
3294
  let s, i, a;
@@ -3261,10 +3304,10 @@ function mn(t, e) {
3261
3304
  if (s) return s;
3262
3305
  if (i) {
3263
3306
  if (i.length === 1) return i[0];
3264
- I(this, "type", n, r, { issues: /* @__PURE__ */ qn(i) }), n.typed = !0;
3307
+ I(this, "type", n, r, { issues: /* @__PURE__ */ Yn(i) }), n.typed = !0;
3265
3308
  } else {
3266
3309
  if (a?.length === 1) return a[0];
3267
- I(this, "type", n, r, { issues: /* @__PURE__ */ qn(a) });
3310
+ I(this, "type", n, r, { issues: /* @__PURE__ */ Yn(a) });
3268
3311
  }
3269
3312
  return n;
3270
3313
  }
@@ -3280,16 +3323,16 @@ function De(t) {
3280
3323
  async: !1,
3281
3324
  message: t,
3282
3325
  get "~standard"() {
3283
- return /* @__PURE__ */ V(this);
3326
+ return /* @__PURE__ */ j(this);
3284
3327
  },
3285
3328
  "~run"(e, n) {
3286
3329
  return e.value === void 0 ? e.typed = !0 : I(this, "type", e, n), e;
3287
3330
  }
3288
3331
  };
3289
3332
  }
3290
- function wt(t, e, n) {
3291
- const r = t["~run"]({ value: e }, /* @__PURE__ */ Yr(n));
3292
- if (r.issues) throw new Tt(r.issues);
3333
+ function bt(t, e, n) {
3334
+ const r = t["~run"]({ value: e }, /* @__PURE__ */ Xr(n));
3335
+ if (r.issues) throw new Nt(r.issues);
3293
3336
  return r.value;
3294
3337
  }
3295
3338
  // @__NO_SIDE_EFFECTS__
@@ -3298,7 +3341,7 @@ function g(...t) {
3298
3341
  ...t[0],
3299
3342
  pipe: t,
3300
3343
  get "~standard"() {
3301
- return /* @__PURE__ */ V(this);
3344
+ return /* @__PURE__ */ j(this);
3302
3345
  },
3303
3346
  "~run"(e, n) {
3304
3347
  for (const r of t) if (r.kind !== "metadata") {
@@ -3313,13 +3356,13 @@ function g(...t) {
3313
3356
  };
3314
3357
  }
3315
3358
  // @__NO_SIDE_EFFECTS__
3316
- function pa(...t) {
3359
+ function ba(...t) {
3317
3360
  return {
3318
3361
  ...t[0],
3319
3362
  pipe: t,
3320
3363
  async: !0,
3321
3364
  get "~standard"() {
3322
- return /* @__PURE__ */ V(this);
3365
+ return /* @__PURE__ */ j(this);
3323
3366
  },
3324
3367
  async "~run"(e, n) {
3325
3368
  for (const r of t) if (r.kind !== "metadata") {
@@ -3333,15 +3376,15 @@ function pa(...t) {
3333
3376
  }
3334
3377
  };
3335
3378
  }
3336
- var da = /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ Gr(32)), ma = /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ dn(1)), ss = /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-90), /* @__PURE__ */ ct(90)), is = /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-180), /* @__PURE__ */ ct(180)), Pt = /* @__PURE__ */ R({ lat: ss, lng: is }), as = /* @__PURE__ */ R({ sw: Pt, ne: Pt }), va = /* @__PURE__ */ R({ bounds: as, center: Pt, zoom: /* @__PURE__ */ E() }), tn = /* @__PURE__ */ ns((t) => t instanceof HTMLElement, "Must be an HTMLElement"), ga = /* @__PURE__ */ R({ mapSize: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(1)), zoomMin: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), zoomMax: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), zoomScale: /* @__PURE__ */ mn([/* @__PURE__ */ Re(1), /* @__PURE__ */ Re(2), /* @__PURE__ */ Re(10)]) }), ya = /* @__PURE__ */ R({ inserted: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(/* @__PURE__ */ ts())), insert: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(/* @__PURE__ */ De())), remove: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(/* @__PURE__ */ De())), update: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([/* @__PURE__ */ E()])), /* @__PURE__ */ L(/* @__PURE__ */ De())) }), Hn = /* @__PURE__ */ mn([/* @__PURE__ */ Re("idle"), /* @__PURE__ */ Re("move"), /* @__PURE__ */ Re("click")]), wa = /* @__PURE__ */ R({ getParameters: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(ga)), getContainer: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(tn)), getZoom: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(/* @__PURE__ */ E())), getBounds: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(as)), getCenter: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(Pt)), getViewport: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(va)), panBy: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([/* @__PURE__ */ E(), /* @__PURE__ */ E()])), /* @__PURE__ */ L(/* @__PURE__ */ De())), createMarker: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([tn, ss, is, /* @__PURE__ */ E()])), /* @__PURE__ */ L(ya)), subscribe: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([Hn, /* @__PURE__ */ A()])), /* @__PURE__ */ L(/* @__PURE__ */ De())), unsubscribe: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([Hn, /* @__PURE__ */ A()])), /* @__PURE__ */ L(/* @__PURE__ */ De())) }), Zt = /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([/* @__PURE__ */ ue()])), /* @__PURE__ */ Kr(/* @__PURE__ */ pa(/* @__PURE__ */ rs(), /* @__PURE__ */ Xr(), tn))), ka = /* @__PURE__ */ R({ dimensions: /* @__PURE__ */ R({ width: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), height: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), padding: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), radius: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)) }), colors: /* @__PURE__ */ re(/* @__PURE__ */ R({ background: /* @__PURE__ */ re(/* @__PURE__ */ ue()), border: /* @__PURE__ */ re(/* @__PURE__ */ ue()), shadow: /* @__PURE__ */ re(/* @__PURE__ */ ue()) })) }), Zn = /* @__PURE__ */ R({ dimensions: /* @__PURE__ */ g(/* @__PURE__ */ R({ width: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), height: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), margin: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), radius: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)) }), /* @__PURE__ */ Jr((t) => Math.min(t.width, t.height) / t.margin >= 4, "Minimum of width or height must be greater than or equal to 4 * margin")), colors: /* @__PURE__ */ re(/* @__PURE__ */ R({ background: /* @__PURE__ */ re(/* @__PURE__ */ ue()), shadow: /* @__PURE__ */ re(/* @__PURE__ */ ue()) })) }), _a = /* @__PURE__ */ R({ id: /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ dn(1)), rank: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), lat: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-90), /* @__PURE__ */ ct(90)), lng: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-180), /* @__PURE__ */ ct(180)), tooltip: /* @__PURE__ */ R({ style: Zn, body: Zt }), pin: /* @__PURE__ */ re(/* @__PURE__ */ R({ style: ka, body: /* @__PURE__ */ re(Zt) })), popup: /* @__PURE__ */ re(/* @__PURE__ */ R({ style: Zn, body: Zt })) });
3337
- class ba {
3379
+ var _a = /* @__PURE__ */ g(/* @__PURE__ */ ce(), /* @__PURE__ */ Kr(32)), Ma = /* @__PURE__ */ g(/* @__PURE__ */ ce(), /* @__PURE__ */ vn(1)), is = /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(-90), /* @__PURE__ */ ft(90)), as = /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(-180), /* @__PURE__ */ ft(180)), Pt = /* @__PURE__ */ R({ lat: is, lng: as }), os = /* @__PURE__ */ R({ sw: Pt, ne: Pt }), Ea = /* @__PURE__ */ R({ bounds: os, center: Pt, zoom: /* @__PURE__ */ x() }), rn = /* @__PURE__ */ rs((t) => t instanceof HTMLElement, "Must be an HTMLElement"), xa = /* @__PURE__ */ R({ mapSize: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(1)), zoomMin: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), zoomMax: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), zoomScale: /* @__PURE__ */ gn([/* @__PURE__ */ Re(1), /* @__PURE__ */ Re(2), /* @__PURE__ */ Re(10)]) }), Sa = /* @__PURE__ */ R({ inserted: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([])), /* @__PURE__ */ V(/* @__PURE__ */ ns())), insert: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([])), /* @__PURE__ */ V(/* @__PURE__ */ De())), remove: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([])), /* @__PURE__ */ V(/* @__PURE__ */ De())), update: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([/* @__PURE__ */ x()])), /* @__PURE__ */ V(/* @__PURE__ */ De())) }), Xn = /* @__PURE__ */ gn([/* @__PURE__ */ Re("idle"), /* @__PURE__ */ Re("move"), /* @__PURE__ */ Re("click")]), Pa = /* @__PURE__ */ R({ getParameters: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([])), /* @__PURE__ */ V(xa)), getContainer: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([])), /* @__PURE__ */ V(rn)), getZoom: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([])), /* @__PURE__ */ V(/* @__PURE__ */ x())), getBounds: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([])), /* @__PURE__ */ V(os)), getCenter: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([])), /* @__PURE__ */ V(Pt)), getViewport: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([])), /* @__PURE__ */ V(Ea)), panBy: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([/* @__PURE__ */ x(), /* @__PURE__ */ x()])), /* @__PURE__ */ V(/* @__PURE__ */ De())), createMarker: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([rn, is, as, /* @__PURE__ */ x()])), /* @__PURE__ */ V(Sa)), subscribe: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([Xn, /* @__PURE__ */ T()])), /* @__PURE__ */ V(/* @__PURE__ */ De())), unsubscribe: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([Xn, /* @__PURE__ */ T()])), /* @__PURE__ */ V(/* @__PURE__ */ De())) }), Yt = /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ $(/* @__PURE__ */ L([/* @__PURE__ */ ce()])), /* @__PURE__ */ Qr(/* @__PURE__ */ ba(/* @__PURE__ */ ss(), /* @__PURE__ */ Jr(), rn))), Ia = /* @__PURE__ */ R({ dimensions: /* @__PURE__ */ R({ width: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), height: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), padding: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), radius: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)) }), colors: /* @__PURE__ */ se(/* @__PURE__ */ R({ background: /* @__PURE__ */ se(/* @__PURE__ */ ce()), border: /* @__PURE__ */ se(/* @__PURE__ */ ce()), shadow: /* @__PURE__ */ se(/* @__PURE__ */ ce()) })) }), Jn = /* @__PURE__ */ R({ dimensions: /* @__PURE__ */ g(/* @__PURE__ */ R({ width: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), height: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), margin: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), radius: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)) }), /* @__PURE__ */ Gr((t) => Math.min(t.width, t.height) / t.margin >= 4, "Minimum of width or height must be greater than or equal to 4 * margin")), colors: /* @__PURE__ */ se(/* @__PURE__ */ R({ background: /* @__PURE__ */ se(/* @__PURE__ */ ce()), shadow: /* @__PURE__ */ se(/* @__PURE__ */ ce()) })) }), Ta = /* @__PURE__ */ R({ id: /* @__PURE__ */ g(/* @__PURE__ */ ce(), /* @__PURE__ */ vn(1)), rank: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), lat: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(-90), /* @__PURE__ */ ft(90)), lng: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(-180), /* @__PURE__ */ ft(180)), tooltip: /* @__PURE__ */ R({ style: Jn, body: Yt }), pin: /* @__PURE__ */ se(/* @__PURE__ */ R({ style: Ia, body: /* @__PURE__ */ se(Yt) })), popup: /* @__PURE__ */ se(/* @__PURE__ */ R({ style: Jn, body: Yt })) });
3380
+ class Aa {
3338
3381
  apiKey;
3339
3382
  apiJwt;
3340
3383
  markerStatesStore;
3341
3384
  markerStatesWorker;
3342
3385
  markerStatesWorkerClient;
3343
3386
  constructor(e, n) {
3344
- this.apiKey = e, this.apiJwt = n, this.markerStatesStore = /* @__PURE__ */ new Map(), this.markerStatesWorker = new Zi(), this.markerStatesWorkerClient = new Jn(this.markerStatesWorker);
3387
+ this.apiKey = e, this.apiJwt = n, this.markerStatesStore = /* @__PURE__ */ new Map(), this.markerStatesWorker = new ta(), this.markerStatesWorkerClient = new Qn(this.markerStatesWorker);
3345
3388
  }
3346
3389
  clearStates() {
3347
3390
  this.markerStatesStore.clear();
@@ -3355,7 +3398,7 @@ class ba {
3355
3398
  async updateStates(e, n) {
3356
3399
  if (e.length == 0) return;
3357
3400
  e.sort((a, o) => a.data.id.localeCompare(o.data.id));
3358
- const r = e.map((a) => a.input), s = sa(r);
3401
+ const r = e.map((a) => a.input), s = ha(r);
3359
3402
  let i = this.markerStatesStore.get(s);
3360
3403
  i == null && (i = await this.fetchStates(r, n), this.markerStatesStore.set(s, i));
3361
3404
  for (let a = 0; a < e.length; a++) {
@@ -3365,7 +3408,7 @@ class ba {
3365
3408
  }
3366
3409
  async fetchStates(e, n) {
3367
3410
  if (e.length == 0) return [];
3368
- if (e.length == 1) return [[0, [[0, Wr.indexOf(Ui)]]]];
3411
+ if (e.length == 1) return [[0, [[0, Hr.indexOf(Gi)]]]];
3369
3412
  const r = {
3370
3413
  key: this.apiKey,
3371
3414
  jwt: this.apiJwt,
@@ -3375,8 +3418,8 @@ class ba {
3375
3418
  return s.jwt && (this.apiJwt = s.jwt), s.states;
3376
3419
  }
3377
3420
  }
3378
- const Yn = "1.2.22", Ma = "https://maps.api.arenarium.dev/auth", Ea = "https://maps.api.arenarium.dev/log", Xn = 500;
3379
- class os {
3421
+ const Gn = "1.2.24", Na = "https://maps.api.arenarium.dev/auth", Ca = "https://maps.api.arenarium.dev/log", Kn = 500;
3422
+ class ls {
3380
3423
  apiKey;
3381
3424
  mapProvider;
3382
3425
  mapStateProvider;
@@ -3387,26 +3430,26 @@ class os {
3387
3430
  markerVisibilityProcessor;
3388
3431
  markerElementsProcessor;
3389
3432
  markerStateProcessor;
3390
- markerStatesProcessDelay = Xn;
3433
+ markerStatesProcessDelay = Kn;
3391
3434
  markerStatesProcessTimeout = void 0;
3392
3435
  constructor(e, n, r, s) {
3393
- wt(da, e), wt(ma, n), wt(wa, r), this.apiKey = e, this.mapProvider = r, this.mapStateProvider = new ks(
3436
+ bt(_a, e), bt(Ma, n), bt(Pa, r), this.apiKey = e, this.mapProvider = r, this.mapStateProvider = new bs(
3394
3437
  this.mapProvider,
3395
3438
  this.detached.bind(this),
3396
3439
  this.error.bind(this),
3397
3440
  this.onMapMove.bind(this),
3398
3441
  this.onMapIdle.bind(this),
3399
3442
  this.onMapClick.bind(this)
3400
- ), this.markers = /* @__PURE__ */ new Map(), this.markerVisibilityManager = new Ns(this.mapProvider), this.markerElementsManager = new Hi(this.mapProvider), this.markerStatesManager = new ba(e, n), this.markerVisibilityProcessor = new Bt(this.onMarkersVisiblityProcess.bind(this)), this.markerElementsProcessor = new Bt(this.onMarkersRenderProcess.bind(this)), this.markerStateProcessor = new Bt(this.onMarkersStateProcess.bind(this)), this.configuration = s;
3443
+ ), this.markers = /* @__PURE__ */ new Map(), this.markerVisibilityManager = new Cs(this.mapProvider), this.markerElementsManager = new ea(this.mapProvider), this.markerStatesManager = new Aa(e, n), this.markerVisibilityProcessor = new Ut(this.onMarkersVisiblityProcess.bind(this)), this.markerElementsProcessor = new Ut(this.onMarkersRenderProcess.bind(this)), this.markerStateProcessor = new Ut(this.onMarkersStateProcess.bind(this)), this.configuration = s;
3401
3444
  }
3402
3445
  //#region Core
3403
3446
  static async create(e, n, r) {
3404
- let a = (await Xi(Ma, { key: e, version: Yn })).jwt;
3447
+ let a = (await ra(Na, { key: e, version: Gn })).jwt;
3405
3448
  if (!a) throw new Error("Failed to get api jwt");
3406
- return new os(e, a, n, r);
3449
+ return new ls(e, a, n, r);
3407
3450
  }
3408
3451
  set configuration(e) {
3409
- this.markerStatesProcessDelay = e?.process?.states?.delay ?? Xn, this.markerVisibilityManager.configuration = e, this.markerElementsManager.configuration = e;
3452
+ this.markerStatesProcessDelay = e?.process?.states?.delay ?? Kn, this.markerVisibilityManager.configuration = e, this.markerElementsManager.configuration = e;
3410
3453
  }
3411
3454
  clear() {
3412
3455
  this.markers.clear(), this.markerVisibilityManager.clearMarkers(), this.markerStatesManager.clearStates(), this.markerElementsManager.clearElements(), this.mapStateProvider.stop(), this.markerVisibilityProcessor.stop(), this.markerStateProcessor.stop(), this.markerElementsProcessor.stop();
@@ -3432,18 +3475,18 @@ class os {
3432
3475
  if (r instanceof Error)
3433
3476
  try {
3434
3477
  const s = {
3435
- key: this.apiKey,
3436
3478
  title: n,
3437
3479
  level: e,
3438
3480
  content: {
3439
- version: Yn,
3481
+ version: Gn,
3482
+ key: this.apiKey,
3440
3483
  name: r.name,
3441
3484
  message: r.message,
3442
3485
  cause: r.cause,
3443
3486
  stack: r.stack
3444
3487
  }
3445
3488
  };
3446
- await Ji(Ea, s);
3489
+ await sa(Ca, s);
3447
3490
  } catch (s) {
3448
3491
  console.error(s);
3449
3492
  }
@@ -3494,11 +3537,11 @@ class os {
3494
3537
  //#endregion
3495
3538
  //#region Public
3496
3539
  async updateMarkers(e) {
3497
- wt(/* @__PURE__ */ es(_a), e);
3540
+ bt(/* @__PURE__ */ ts(Ta), e);
3498
3541
  try {
3499
3542
  const n = this.mapProvider.getParameters();
3500
3543
  for (const s of e)
3501
- this.markers.has(s.id) == !1 && this.markers.set(s.id, new gs(s));
3544
+ this.markers.has(s.id) == !1 && this.markers.set(s.id, new ws(s));
3502
3545
  const r = Array.from(this.markers.values());
3503
3546
  r.sort((s, i) => i.data.rank - s.data.rank), await this.markerVisibilityManager.updateMarkers(n, r), this.mapStateProvider.start(), this.markerVisibilityProcessor.run(), this.markerStateProcessor.run(), this.markerElementsProcessor.run();
3504
3547
  } catch (n) {
@@ -3535,5 +3578,5 @@ class os {
3535
3578
  //#endregion
3536
3579
  }
3537
3580
  export {
3538
- os as MapManager
3581
+ ls as MapManager
3539
3582
  };