@arenarium/maps 1.2.22 → 1.2.24

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