@manyducks.co/dolla 2.0.0-alpha.3 → 2.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  var pt = Object.defineProperty;
2
- var Ze = (n) => {
3
- throw TypeError(n);
2
+ var Ze = (a) => {
3
+ throw TypeError(a);
4
4
  };
5
- var mt = (n, e, t) => e in n ? pt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
6
- var k = (n, e, t) => mt(n, typeof e != "symbol" ? e + "" : e, t), Fe = (n, e, t) => e.has(n) || Ze("Cannot " + t);
7
- var a = (n, e, t) => (Fe(n, e, "read from private field"), t ? t.call(n) : e.get(n)), u = (n, e, t) => e.has(n) ? Ze("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), m = (n, e, t, r) => (Fe(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), P = (n, e, t) => (Fe(n, e, "access private method"), t);
8
- var et = (n, e, t, r) => ({
9
- set _(s) {
10
- m(n, e, s, t);
5
+ var mt = (a, e, t) => e in a ? pt(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
6
+ var L = (a, e, t) => mt(a, typeof e != "symbol" ? e + "" : e, t), Fe = (a, e, t) => e.has(a) || Ze("Cannot " + t);
7
+ var n = (a, e, t) => (Fe(a, e, "read from private field"), t ? t.call(a) : e.get(a)), h = (a, e, t) => e.has(a) ? Ze("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t), p = (a, e, t, r) => (Fe(a, e, "write to private field"), r ? r.call(a, t) : e.set(a, t), t), P = (a, e, t) => (Fe(a, e, "access private method"), t);
8
+ var et = (a, e, t, r) => ({
9
+ set _(i) {
10
+ p(a, e, i, t);
11
11
  },
12
12
  get _() {
13
- return a(n, e, r);
13
+ return n(a, e, r);
14
14
  }
15
15
  });
16
- import { h as tt, c as yt, i as Ie, s as Ge, a as wt, d as Be, b as bt, e as Xe, f as D, g as K, j as lt, k as vt, w as ht, P as ut, l as rt, m as $t, t as Et, n as kt, o as Lt, p as Pt, q as nt, r as at, u as St, v as Oe, x as Te, y as Rt, z as xt, A as Mt } from "./passthrough-DrtCifRF.js";
17
- import { B as rr, C as nr, D as ar } from "./passthrough-DrtCifRF.js";
18
- function Nt(n) {
16
+ import { h as tt, c as yt, i as Ie, s as Ge, a as wt, d as Be, b as bt, e as Xe, f as V, g as K, j as lt, k as vt, w as ut, P as ht, l as rt, m as $t, t as Et, n as kt, o as Lt, p as Pt, q as nt, r as at, u as St, v as Oe, x as Te, y as Rt, z as xt, A as Mt } from "./passthrough-CtoBcpag.js";
17
+ import { B as rr, C as nr, D as ar } from "./passthrough-CtoBcpag.js";
18
+ function Nt(a) {
19
19
  return tt`
20
20
  <div
21
21
  style=${{
@@ -29,8 +29,8 @@ function Nt(n) {
29
29
  >
30
30
  <h1 style=${{ marginBottom: "0.5rem" }}>The app has crashed</h1>
31
31
  <p style=${{ marginBottom: "0.25rem" }}>
32
- <span style=${{ fontFamily: "monospace" }}>${n.loggerName}</span>
33
- ${yt(n.uid, tt`<span style=${{ fontFamily: "monospace", opacity: 0.5 }}> [uid: ${n.uid}]</span>`)}
32
+ <span style=${{ fontFamily: "monospace" }}>${a.loggerName}</span>
33
+ ${yt(a.uid, tt`<span style=${{ fontFamily: "monospace", opacity: 0.5 }}> [uid: ${a.uid}]</span>`)}
34
34
  ${" "}says:
35
35
  </p>
36
36
  <blockquote
@@ -53,21 +53,21 @@ function Nt(n) {
53
53
  fontWeight: "bold"
54
54
  }}
55
55
  >
56
- ${n.error.name}
56
+ ${a.error.name}
57
57
  </span>
58
- ${n.error.message}
58
+ ${a.error.message}
59
59
  </blockquote>
60
60
 
61
61
  <p>Please see the browser console for details.</p>
62
62
  </div>
63
63
  `;
64
64
  }
65
- var J, _e, N, q;
65
+ var J, _e, O, D;
66
66
  class Ot {
67
67
  constructor() {
68
- u(this, N);
69
- u(this, J, []);
70
- u(this, _e, Tt());
68
+ h(this, O);
69
+ h(this, J, []);
70
+ h(this, _e, Tt());
71
71
  }
72
72
  /**
73
73
  * Adds a new middleware that will apply to subsequent requests.
@@ -76,42 +76,42 @@ class Ot {
76
76
  * @param middleware - A middleware function that will intercept requests.
77
77
  */
78
78
  use(e) {
79
- return a(this, J).push(e), () => {
80
- a(this, J).splice(a(this, J).indexOf(e), 1);
79
+ return n(this, J).push(e), () => {
80
+ n(this, J).splice(n(this, J).indexOf(e), 1);
81
81
  };
82
82
  }
83
83
  async get(e, t) {
84
- return P(this, N, q).call(this, "get", e, t);
84
+ return P(this, O, D).call(this, "get", e, t);
85
85
  }
86
86
  async put(e, t) {
87
- return P(this, N, q).call(this, "put", e, t);
87
+ return P(this, O, D).call(this, "put", e, t);
88
88
  }
89
89
  async patch(e, t) {
90
- return P(this, N, q).call(this, "patch", e, t);
90
+ return P(this, O, D).call(this, "patch", e, t);
91
91
  }
92
92
  async post(e, t) {
93
- return P(this, N, q).call(this, "post", e, t);
93
+ return P(this, O, D).call(this, "post", e, t);
94
94
  }
95
95
  async delete(e, t) {
96
- return P(this, N, q).call(this, "delete", e, t);
96
+ return P(this, O, D).call(this, "delete", e, t);
97
97
  }
98
98
  async head(e, t) {
99
- return P(this, N, q).call(this, "head", e, t);
99
+ return P(this, O, D).call(this, "head", e, t);
100
100
  }
101
101
  async options(e, t) {
102
- return P(this, N, q).call(this, "options", e, t);
102
+ return P(this, O, D).call(this, "options", e, t);
103
103
  }
104
104
  async trace(e, t) {
105
- return P(this, N, q).call(this, "trace", e, t);
105
+ return P(this, O, D).call(this, "trace", e, t);
106
106
  }
107
107
  }
108
- J = new WeakMap(), _e = new WeakMap(), N = new WeakSet(), q = async function(e, t, r) {
108
+ J = new WeakMap(), _e = new WeakMap(), O = new WeakSet(), D = async function(e, t, r) {
109
109
  return jt({
110
110
  ...r,
111
111
  method: e,
112
112
  uri: t,
113
- middleware: a(this, J),
114
- fetch: a(this, _e)
113
+ middleware: n(this, J),
114
+ fetch: n(this, _e)
115
115
  });
116
116
  };
117
117
  function Tt() {
@@ -123,71 +123,71 @@ function Tt() {
123
123
  }
124
124
  class At extends Error {
125
125
  constructor(t) {
126
- const { status: r, statusText: s, method: i, uri: o } = t, f = `${r} ${s}: Request failed (${i.toUpperCase()} ${o})`;
126
+ const { status: r, statusText: i, method: s, uri: o } = t, f = `${r} ${i}: Request failed (${s.toUpperCase()} ${o})`;
127
127
  super(f);
128
- k(this, "response");
128
+ L(this, "response");
129
129
  this.response = t;
130
130
  }
131
131
  }
132
- async function jt(n) {
133
- const { headers: e, query: t, fetch: r, middleware: s } = n, i = {
134
- method: n.method,
135
- uri: n.uri,
132
+ async function jt(a) {
133
+ const { headers: e, query: t, fetch: r, middleware: i } = a, s = {
134
+ method: a.method,
135
+ uri: a.uri,
136
136
  get sameOrigin() {
137
- return !i.uri.startsWith("http");
137
+ return !s.uri.startsWith("http");
138
138
  },
139
139
  query: new URLSearchParams(),
140
140
  headers: new Headers(),
141
- body: n.body
141
+ body: a.body
142
142
  };
143
143
  if (e)
144
144
  if (e instanceof Map || e instanceof Headers)
145
145
  e.forEach((c, y) => {
146
- i.headers.set(y, c);
146
+ s.headers.set(y, c);
147
147
  });
148
148
  else if (e != null && typeof e == "object" && !Array.isArray(e))
149
149
  for (const c in e) {
150
150
  const y = e[c];
151
- y instanceof Date ? i.headers.set(c, y.toISOString()) : y != null && i.headers.set(c, String(y));
151
+ y instanceof Date ? s.headers.set(c, y.toISOString()) : y != null && s.headers.set(c, String(y));
152
152
  }
153
153
  else
154
154
  throw new TypeError(`Unknown headers type. Got: ${e}`);
155
155
  if (t)
156
156
  if (t instanceof Map || t instanceof URLSearchParams)
157
157
  t.forEach((c, y) => {
158
- i.query.set(y, c);
158
+ s.query.set(y, c);
159
159
  });
160
160
  else if (t != null && typeof t == "object" && !Array.isArray(t))
161
161
  for (const c in t) {
162
162
  const y = t[c];
163
- y instanceof Date ? i.query.set(c, y.toISOString()) : y != null && i.query.set(c, String(y));
163
+ y instanceof Date ? s.query.set(c, y.toISOString()) : y != null && s.query.set(c, String(y));
164
164
  }
165
165
  else
166
166
  throw new TypeError(`Unknown query params type. Got: ${t}`);
167
167
  let o;
168
168
  const f = async () => {
169
- const c = i.query.toString(), y = c.length > 0 ? i.uri + "?" + c : i.uri;
169
+ const c = s.query.toString(), y = c.length > 0 ? s.uri + "?" + c : s.uri;
170
170
  let w;
171
- !i.headers.has("content-type") && Ie(i.body) ? (i.headers.set("content-type", "application/json"), w = JSON.stringify(i.body)) : w = i.body;
172
- const p = await r(y, {
173
- method: i.method,
174
- headers: i.headers,
171
+ !s.headers.has("content-type") && Ie(s.body) ? (s.headers.set("content-type", "application/json"), w = JSON.stringify(s.body)) : w = s.body;
172
+ const m = await r(y, {
173
+ method: s.method,
174
+ headers: s.headers,
175
175
  body: w
176
- }), d = Object.fromEntries(p.headers.entries()), b = d["content-type"];
176
+ }), d = Object.fromEntries(m.headers.entries()), b = d["content-type"];
177
177
  let $;
178
- b != null && b.includes("application/json") ? $ = await p.json() : b != null && b.includes("application/x-www-form-urlencoded") ? $ = await p.formData() : $ = await p.text(), o = {
179
- method: i.method,
180
- uri: i.uri,
181
- status: p.status,
182
- statusText: p.statusText,
178
+ b != null && b.includes("application/json") ? $ = await m.json() : b != null && b.includes("application/x-www-form-urlencoded") ? $ = await m.formData() : $ = await m.text(), o = {
179
+ method: s.method,
180
+ uri: s.uri,
181
+ status: m.status,
182
+ statusText: m.statusText,
183
183
  headers: d,
184
184
  body: $
185
185
  };
186
186
  };
187
- if (s.length > 0) {
187
+ if (i.length > 0) {
188
188
  const c = (y = 0) => {
189
- const w = s[y], p = s[y + 1] ? c(y + 1) : f;
190
- return async () => w(i, async () => (await p(), o));
189
+ const w = i[y], m = i[y + 1] ? c(y + 1) : f;
190
+ return async () => w(s, async () => (await m(), o));
191
191
  };
192
192
  await c()();
193
193
  } else
@@ -198,9 +198,9 @@ async function jt(n) {
198
198
  }
199
199
  class Ct {
200
200
  constructor(e, t) {
201
- k(this, "dolla");
202
- k(this, "config");
203
- k(this, "strings");
201
+ L(this, "dolla");
202
+ L(this, "config");
203
+ L(this, "strings");
204
204
  this.config = e, this.dolla = t;
205
205
  }
206
206
  async load() {
@@ -211,7 +211,7 @@ class Ct {
211
211
  this.strings = e;
212
212
  else
213
213
  throw new Error(`Fetch function did not return an object of language strings: ${e}`);
214
- } else if (D(this.config.path)) {
214
+ } else if (V(this.config.path)) {
215
215
  const e = await this.dolla.http.get(this.config.path);
216
216
  if (e.status >= 200 && e.status < 300)
217
217
  if (Ie(e.body))
@@ -229,65 +229,65 @@ class Ct {
229
229
  return this.strings;
230
230
  }
231
231
  }
232
- var ye, Y, x, ie, we, be, se, ve, We, ft;
233
- class qt {
232
+ var we, Y, x, se, be, ve, ie, $e, We, ft;
233
+ class Dt {
234
234
  constructor(e) {
235
- u(this, We);
236
- u(this, ye);
237
- u(this, Y);
238
- u(this, x, /* @__PURE__ */ new Map());
239
- u(this, ie, []);
240
- u(this, we, "auto");
241
- k(this, "$current");
242
- u(this, be);
243
- u(this, se);
244
- u(this, ve);
245
- m(this, ye, e), m(this, Y, e.createLogger("dolla/language"));
246
- const [t, r] = K(), [s, i] = K();
247
- this.$current = t, m(this, be, r), m(this, se, s), m(this, ve, i), e.beforeMount(async () => {
248
- a(this, x).size > 0 && await this.setLanguage(a(this, we));
235
+ h(this, We);
236
+ h(this, we);
237
+ h(this, Y);
238
+ h(this, x, /* @__PURE__ */ new Map());
239
+ h(this, se, []);
240
+ h(this, be, "auto");
241
+ L(this, "$current");
242
+ h(this, ve);
243
+ h(this, ie);
244
+ h(this, $e);
245
+ p(this, we, e), p(this, Y, e.createLogger("dolla/language"));
246
+ const [t, r] = K(), [i, s] = K();
247
+ this.$current = t, p(this, ve, r), p(this, ie, i), p(this, $e, s), e.beforeMount(async () => {
248
+ n(this, x).size > 0 && await this.setLanguage(n(this, be));
249
249
  });
250
250
  }
251
251
  get supportedLanguages() {
252
- return [...a(this, x).keys()];
252
+ return [...n(this, x).keys()];
253
253
  }
254
254
  setup(e) {
255
255
  if (e.languages.forEach((t) => {
256
- a(this, x).set(t.name, new Ct(t, a(this, ye)));
256
+ n(this, x).set(t.name, new Ct(t, n(this, we)));
257
257
  }), e.initialLanguage && e.initialLanguage !== "auto") {
258
258
  if (!e.languages.some((r) => r.name === e.initialLanguage))
259
259
  throw new Error(`Initial language '${e.initialLanguage}' has no registered translation.`);
260
- m(this, we, e.initialLanguage);
260
+ p(this, be, e.initialLanguage);
261
261
  }
262
- a(this, Y).info(
263
- `${a(this, x).size} language${a(this, x).size === 1 ? "" : "s"} supported: '${[...a(this, x).keys()].join("', '")}'`
262
+ n(this, Y).info(
263
+ `${n(this, x).size} language${n(this, x).size === 1 ? "" : "s"} supported: '${[...n(this, x).keys()].join("', '")}'`
264
264
  );
265
265
  }
266
266
  async setLanguage(e) {
267
- var s;
267
+ var i;
268
268
  let t;
269
269
  if (e === "auto") {
270
- let i = [];
270
+ let s = [];
271
271
  if (typeof navigator == "object") {
272
272
  const o = navigator;
273
- ((s = o.languages) == null ? void 0 : s.length) > 0 ? i.push(...o.languages) : o.language ? i.push(o.language) : o.browserLanguage ? i.push(o.browserLanguage) : o.userLanguage && i.push(o.userLanguage);
273
+ ((i = o.languages) == null ? void 0 : i.length) > 0 ? s.push(...o.languages) : o.language ? s.push(o.language) : o.browserLanguage ? s.push(o.browserLanguage) : o.userLanguage && s.push(o.userLanguage);
274
274
  }
275
- for (const o of i)
276
- a(this, x).has(o) && (t = o);
275
+ for (const o of s)
276
+ n(this, x).has(o) && (t = o);
277
277
  } else
278
- a(this, x).has(e) && (t = e);
278
+ n(this, x).has(e) && (t = e);
279
279
  if (t == null) {
280
- const i = a(this, x).keys().next().value;
281
- i && (t = i);
280
+ const s = n(this, x).keys().next().value;
281
+ s && (t = s);
282
282
  }
283
- if (!t || !a(this, x).has(t))
283
+ if (!t || !n(this, x).has(t))
284
284
  throw new Error(`Language '${e}' is not configured for this app.`);
285
- const r = a(this, x).get(t);
285
+ const r = n(this, x).get(t);
286
286
  try {
287
- const i = await r.load();
288
- a(this, ve).call(this, i), a(this, be).call(this, t), a(this, Y).info("set language to " + t);
289
- } catch (i) {
290
- i instanceof Error && a(this, Y).crash(i);
287
+ const s = await r.load();
288
+ n(this, $e).call(this, s), n(this, ve).call(this, t), n(this, Y).info("set language to " + t);
289
+ } catch (s) {
290
+ s instanceof Error && n(this, Y).crash(s);
291
291
  }
292
292
  }
293
293
  /**
@@ -302,71 +302,71 @@ class qt {
302
302
  `The 't' function cannot be destructured. If you need a standalone version you can import it like so: 'import { t } from "@manyducks.co/dolla"'`
303
303
  );
304
304
  if (!this.$current.get())
305
- return Ut;
305
+ return qt;
306
306
  const r = P(this, We, ft).call(this, e, t);
307
307
  if (r)
308
308
  return r;
309
309
  if (t) {
310
- const i = {};
310
+ const s = {};
311
311
  for (const [f, c] of Object.entries(t))
312
- wt(c) && (i[f] = c);
313
- const o = Object.entries(i);
312
+ wt(c) && (s[f] = c);
313
+ const o = Object.entries(s);
314
314
  if (o.length > 0) {
315
- const f = o.map((y) => y[1]), c = Be([a(this, se), ...f], (y, ...w) => {
316
- const p = w.map(($, j) => o[j]), d = {
315
+ const f = o.map((y) => y[1]), c = Be([n(this, ie), ...f], (y, ...w) => {
316
+ const m = w.map(($, j) => o[j]), d = {
317
317
  ...t
318
318
  };
319
- for (let $ = 0; $ < p.length; $++) {
320
- const j = p[$][0];
319
+ for (let $ = 0; $ < m.length; $++) {
320
+ const j = m[$][0];
321
321
  d[j] = w[$];
322
322
  }
323
- const b = st(y, e) || `[NO TRANSLATION: ${e}]`;
324
- return it(b, d);
323
+ const b = it(y, e) || `[NO TRANSLATION: ${e}]`;
324
+ return st(b, d);
325
325
  });
326
- return a(this, ie).push([e, t, c]), c;
326
+ return n(this, se).push([e, t, c]), c;
327
327
  }
328
328
  }
329
- const s = Be([a(this, se)], (i) => {
330
- let o = st(i, e) || `[NO TRANSLATION: ${e}]`;
331
- return t && (o = it(o, t)), o;
329
+ const i = Be([n(this, ie)], (s) => {
330
+ let o = it(s, e) || `[NO TRANSLATION: ${e}]`;
331
+ return t && (o = st(o, t)), o;
332
332
  });
333
- return a(this, ie).push([e, t, s]), s;
333
+ return n(this, se).push([e, t, i]), i;
334
334
  }
335
335
  }
336
- ye = new WeakMap(), Y = new WeakMap(), x = new WeakMap(), ie = new WeakMap(), we = new WeakMap(), be = new WeakMap(), se = new WeakMap(), ve = new WeakMap(), We = new WeakSet(), ft = function(e, t) {
337
- for (const r of a(this, ie))
336
+ we = new WeakMap(), Y = new WeakMap(), x = new WeakMap(), se = new WeakMap(), be = new WeakMap(), ve = new WeakMap(), ie = new WeakMap(), $e = new WeakMap(), We = new WeakSet(), ft = function(e, t) {
337
+ for (const r of n(this, se))
338
338
  if (r[0] === e && bt(r[1], t))
339
339
  return r[2];
340
340
  };
341
- const Ut = Ge("[NO LANGUAGE SET]");
342
- function it(n, e) {
341
+ const qt = Ge("[NO LANGUAGE SET]");
342
+ function st(a, e) {
343
343
  for (const t in e)
344
- n = n.replace(`{{${t}}}`, String(e[t]));
345
- return n;
344
+ a = a.replace(`{{${t}}}`, String(e[t]));
345
+ return a;
346
346
  }
347
- function st(n, e) {
348
- const t = String(e).split(/[\.\[\]]/).filter((s) => s.trim() !== "");
349
- let r = n;
347
+ function it(a, e) {
348
+ const t = String(e).split(/[\.\[\]]/).filter((i) => i.trim() !== "");
349
+ let r = a;
350
350
  for (; t.length > 0; ) {
351
- const s = t.shift();
352
- r != null ? r = r[s] : r = void 0;
351
+ const i = t.shift();
352
+ r != null ? r = r[i] : r = void 0;
353
353
  }
354
354
  return r;
355
355
  }
356
- var X, $e, H, _, oe, U, ce, Ae;
357
- class Vt {
356
+ var X, Ee, H, _, oe, q, ce, Ae;
357
+ class Ut {
358
358
  constructor(e) {
359
- u(this, ce);
360
- u(this, X);
361
- u(this, $e);
359
+ h(this, ce);
360
+ h(this, X);
361
+ h(this, Ee);
362
362
  // Keyed updates ensure only the most recent callback queued with a certain key
363
363
  // will be called, keeping DOM operations to a minimum.
364
- u(this, H, /* @__PURE__ */ new Map());
364
+ h(this, H, /* @__PURE__ */ new Map());
365
365
  // All unkeyed updates are run on every batch.
366
- u(this, _, []);
367
- u(this, oe, []);
368
- u(this, U, !1);
369
- m(this, X, e), m(this, $e, e.createLogger("dolla/render"));
366
+ h(this, _, []);
367
+ h(this, oe, []);
368
+ h(this, q, !1);
369
+ p(this, X, e), p(this, Ee, e.createLogger("dolla/render"));
370
370
  }
371
371
  /**
372
372
  * Queues a callback to run in the next render batch.
@@ -375,11 +375,11 @@ class Vt {
375
375
  */
376
376
  update(e, t) {
377
377
  return new Promise((r) => {
378
- t ? a(this, H).set(t, () => {
378
+ t ? n(this, H).set(t, () => {
379
379
  e(), r();
380
- }) : a(this, _).push(() => {
380
+ }) : n(this, _).push(() => {
381
381
  e(), r();
382
- }), !a(this, U) && a(this, X).isMounted && (m(this, U, !0), P(this, ce, Ae).call(this));
382
+ }), !n(this, q) && n(this, X).isMounted && (p(this, q, !0), P(this, ce, Ae).call(this));
383
383
  });
384
384
  }
385
385
  /**
@@ -389,51 +389,50 @@ class Vt {
389
389
  */
390
390
  async read(e) {
391
391
  return new Promise((t) => {
392
- a(this, oe).push(() => {
392
+ n(this, oe).push(() => {
393
393
  e(), t();
394
- }), !a(this, U) && a(this, X).isMounted && (m(this, U, !0), P(this, ce, Ae).call(this));
394
+ }), !n(this, q) && n(this, X).isMounted && (p(this, q, !0), P(this, ce, Ae).call(this));
395
395
  });
396
396
  }
397
397
  }
398
- X = new WeakMap(), $e = new WeakMap(), H = new WeakMap(), _ = new WeakMap(), oe = new WeakMap(), U = new WeakMap(), ce = new WeakSet(), Ae = function() {
399
- const e = a(this, H).size + a(this, _).length;
400
- if ((!a(this, X).isMounted || e === 0) && m(this, U, !1), !a(this, U)) {
401
- for (const t of a(this, oe))
398
+ X = new WeakMap(), Ee = new WeakMap(), H = new WeakMap(), _ = new WeakMap(), oe = new WeakMap(), q = new WeakMap(), ce = new WeakSet(), Ae = function() {
399
+ const e = n(this, H).size + n(this, _).length;
400
+ if ((!n(this, X).isMounted || e === 0) && p(this, q, !1), !n(this, q)) {
401
+ for (const t of n(this, oe))
402
402
  t();
403
- m(this, oe, []);
403
+ p(this, oe, []);
404
404
  return;
405
405
  }
406
406
  requestAnimationFrame(() => {
407
- a(this, $e).info(`Batching ${a(this, H).size + a(this, _).length} queued DOM update(s).`);
408
- for (const t of a(this, H).values())
407
+ n(this, Ee).info(`Batching ${n(this, H).size + n(this, _).length} queued DOM update(s).`);
408
+ for (const t of n(this, H).values())
409
409
  t();
410
- a(this, H).clear();
411
- for (const t of a(this, _))
410
+ n(this, H).clear();
411
+ for (const t of n(this, _))
412
412
  t();
413
- m(this, _, []), P(this, ce, Ae).call(this);
413
+ p(this, _, []), P(this, ce, Ae).call(this);
414
414
  });
415
415
  };
416
- function fe() {
417
- return fe = Object.assign || function(n) {
416
+ function de() {
417
+ return de = Object.assign ? Object.assign.bind() : function(a) {
418
418
  for (var e = 1; e < arguments.length; e++) {
419
419
  var t = arguments[e];
420
- for (var r in t)
421
- Object.prototype.hasOwnProperty.call(t, r) && (n[r] = t[r]);
420
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (a[r] = t[r]);
422
421
  }
423
- return n;
424
- }, fe.apply(this, arguments);
422
+ return a;
423
+ }, de.apply(null, arguments);
425
424
  }
426
425
  var A;
427
- (function(n) {
428
- n.Pop = "POP", n.Push = "PUSH", n.Replace = "REPLACE";
426
+ (function(a) {
427
+ a.Pop = "POP", a.Push = "PUSH", a.Replace = "REPLACE";
429
428
  })(A || (A = {}));
430
- var Ue = process.env.NODE_ENV !== "production" ? function(n) {
431
- return Object.freeze(n);
432
- } : function(n) {
433
- return n;
429
+ var qe = process.env.NODE_ENV !== "production" ? function(a) {
430
+ return Object.freeze(a);
431
+ } : function(a) {
432
+ return a;
434
433
  };
435
- function je(n, e) {
436
- if (!n) {
434
+ function je(a, e) {
435
+ if (!a) {
437
436
  typeof console < "u" && console.warn(e);
438
437
  try {
439
438
  throw new Error(e);
@@ -441,15 +440,15 @@ function je(n, e) {
441
440
  }
442
441
  }
443
442
  }
444
- var Ve = "beforeunload", Dt = "hashchange", dt = "popstate";
445
- function Ht(n) {
446
- n === void 0 && (n = {});
447
- var e = n, t = e.window, r = t === void 0 ? document.defaultView : t, s = r.history;
448
- function i() {
449
- var g = r.location, l = g.pathname, h = g.search, v = g.hash, E = s.state || {};
450
- return [E.idx, Ue({
443
+ var Ue = "beforeunload", Vt = "hashchange", dt = "popstate";
444
+ function Ht(a) {
445
+ a === void 0 && (a = {});
446
+ var e = a, t = e.window, r = t === void 0 ? document.defaultView : t, i = r.history;
447
+ function s() {
448
+ var g = r.location, l = g.pathname, u = g.search, v = g.hash, E = i.state || {};
449
+ return [E.idx, qe({
451
450
  pathname: l,
452
- search: h,
451
+ search: u,
453
452
  hash: v,
454
453
  state: E.usr || null,
455
454
  key: E.key || "default"
@@ -460,17 +459,17 @@ function Ht(n) {
460
459
  if (o)
461
460
  b.call(o), o = null;
462
461
  else {
463
- var g = A.Pop, l = i(), h = l[0], v = l[1];
462
+ var g = A.Pop, l = s(), u = l[0], v = l[1];
464
463
  if (b.length)
465
- if (h != null) {
466
- var E = w - h;
464
+ if (u != null) {
465
+ var E = w - u;
467
466
  E && (o = {
468
467
  action: g,
469
468
  location: v,
470
469
  retry: function() {
471
- V(E * -1);
470
+ U(E * -1);
472
471
  }
473
- }, V(E));
472
+ }, U(E));
474
473
  } else
475
474
  process.env.NODE_ENV !== "production" && je(
476
475
  !1,
@@ -484,16 +483,16 @@ function Ht(n) {
484
483
  }
485
484
  }
486
485
  r.addEventListener(dt, f);
487
- var c = A.Pop, y = i(), w = y[0], p = y[1], d = He(), b = He();
488
- w == null && (w = 0, s.replaceState(fe({}, s.state, {
486
+ var c = A.Pop, y = s(), w = y[0], m = y[1], d = He(), b = He();
487
+ w == null && (w = 0, i.replaceState(de({}, i.state, {
489
488
  idx: w
490
489
  }), ""));
491
490
  function $(g) {
492
491
  return typeof g == "string" ? g : Ce(g);
493
492
  }
494
493
  function j(g, l) {
495
- return l === void 0 && (l = null), Ue(fe({
496
- pathname: p.pathname,
494
+ return l === void 0 && (l = null), qe(de({
495
+ pathname: m.pathname,
497
496
  hash: "",
498
497
  search: ""
499
498
  }, typeof g == "string" ? Qe(g) : g, {
@@ -501,94 +500,94 @@ function Ht(n) {
501
500
  key: gt()
502
501
  }));
503
502
  }
504
- function de(g, l) {
503
+ function ge(g, l) {
505
504
  return [{
506
505
  usr: g.state,
507
506
  key: g.key,
508
507
  idx: l
509
508
  }, $(g)];
510
509
  }
511
- function ge(g, l, h) {
510
+ function pe(g, l, u) {
512
511
  return !b.length || (b.call({
513
512
  action: g,
514
513
  location: l,
515
- retry: h
514
+ retry: u
516
515
  }), !1);
517
516
  }
518
517
  function re(g) {
519
518
  c = g;
520
- var l = i();
521
- w = l[0], p = l[1], d.call({
519
+ var l = s();
520
+ w = l[0], m = l[1], d.call({
522
521
  action: c,
523
- location: p
522
+ location: m
524
523
  });
525
524
  }
526
525
  function ne(g, l) {
527
- var h = A.Push, v = j(g, l);
526
+ var u = A.Push, v = j(g, l);
528
527
  function E() {
529
528
  ne(g, l);
530
529
  }
531
- if (ge(h, v, E)) {
532
- var S = de(v, w + 1), M = S[0], O = S[1];
530
+ if (pe(u, v, E)) {
531
+ var S = ge(v, w + 1), N = S[0], T = S[1];
533
532
  try {
534
- s.pushState(M, "", O);
533
+ i.pushState(N, "", T);
535
534
  } catch {
536
- r.location.assign(O);
535
+ r.location.assign(T);
537
536
  }
538
- re(h);
537
+ re(u);
539
538
  }
540
539
  }
541
- function pe(g, l) {
542
- var h = A.Replace, v = j(g, l);
540
+ function me(g, l) {
541
+ var u = A.Replace, v = j(g, l);
543
542
  function E() {
544
- pe(g, l);
543
+ me(g, l);
545
544
  }
546
- if (ge(h, v, E)) {
547
- var S = de(v, w), M = S[0], O = S[1];
548
- s.replaceState(M, "", O), re(h);
545
+ if (pe(u, v, E)) {
546
+ var S = ge(v, w), N = S[0], T = S[1];
547
+ i.replaceState(N, "", T), re(u);
549
548
  }
550
549
  }
551
- function V(g) {
552
- s.go(g);
550
+ function U(g) {
551
+ i.go(g);
553
552
  }
554
553
  var Q = {
555
554
  get action() {
556
555
  return c;
557
556
  },
558
557
  get location() {
559
- return p;
558
+ return m;
560
559
  },
561
560
  createHref: $,
562
561
  push: ne,
563
- replace: pe,
564
- go: V,
562
+ replace: me,
563
+ go: U,
565
564
  back: function() {
566
- V(-1);
565
+ U(-1);
567
566
  },
568
567
  forward: function() {
569
- V(1);
568
+ U(1);
570
569
  },
571
570
  listen: function(l) {
572
571
  return d.push(l);
573
572
  },
574
573
  block: function(l) {
575
- var h = b.push(l);
576
- return b.length === 1 && r.addEventListener(Ve, De), function() {
577
- h(), b.length || r.removeEventListener(Ve, De);
574
+ var u = b.push(l);
575
+ return b.length === 1 && r.addEventListener(Ue, Ve), function() {
576
+ u(), b.length || r.removeEventListener(Ue, Ve);
578
577
  };
579
578
  }
580
579
  };
581
580
  return Q;
582
581
  }
583
- function _t(n) {
584
- n === void 0 && (n = {});
585
- var e = n, t = e.window, r = t === void 0 ? document.defaultView : t, s = r.history;
586
- function i() {
587
- var l = Qe(r.location.hash.substr(1)), h = l.pathname, v = h === void 0 ? "/" : h, E = l.search, S = E === void 0 ? "" : E, M = l.hash, O = M === void 0 ? "" : M, C = s.state || {};
588
- return [C.idx, Ue({
582
+ function _t(a) {
583
+ a === void 0 && (a = {});
584
+ var e = a, t = e.window, r = t === void 0 ? document.defaultView : t, i = r.history;
585
+ function s() {
586
+ var l = Qe(r.location.hash.substr(1)), u = l.pathname, v = u === void 0 ? "/" : u, E = l.search, S = E === void 0 ? "" : E, N = l.hash, T = N === void 0 ? "" : N, C = i.state || {};
587
+ return [C.idx, qe({
589
588
  pathname: v,
590
589
  search: S,
591
- hash: O,
590
+ hash: T,
592
591
  state: C.usr || null,
593
592
  key: C.key || "default"
594
593
  })];
@@ -598,7 +597,7 @@ function _t(n) {
598
597
  if (o)
599
598
  b.call(o), o = null;
600
599
  else {
601
- var l = A.Pop, h = i(), v = h[0], E = h[1];
600
+ var l = A.Pop, u = s(), v = u[0], E = u[1];
602
601
  if (b.length)
603
602
  if (v != null) {
604
603
  var S = w - v;
@@ -621,95 +620,95 @@ function _t(n) {
621
620
  ne(l);
622
621
  }
623
622
  }
624
- r.addEventListener(dt, f), r.addEventListener(Dt, function() {
625
- var l = i(), h = l[1];
626
- Ce(h) !== Ce(p) && f();
623
+ r.addEventListener(dt, f), r.addEventListener(Vt, function() {
624
+ var l = s(), u = l[1];
625
+ Ce(u) !== Ce(m) && f();
627
626
  });
628
- var c = A.Pop, y = i(), w = y[0], p = y[1], d = He(), b = He();
629
- w == null && (w = 0, s.replaceState(fe({}, s.state, {
627
+ var c = A.Pop, y = s(), w = y[0], m = y[1], d = He(), b = He();
628
+ w == null && (w = 0, i.replaceState(de({}, i.state, {
630
629
  idx: w
631
630
  }), ""));
632
631
  function $() {
633
- var l = document.querySelector("base"), h = "";
632
+ var l = document.querySelector("base"), u = "";
634
633
  if (l && l.getAttribute("href")) {
635
634
  var v = r.location.href, E = v.indexOf("#");
636
- h = E === -1 ? v : v.slice(0, E);
635
+ u = E === -1 ? v : v.slice(0, E);
637
636
  }
638
- return h;
637
+ return u;
639
638
  }
640
639
  function j(l) {
641
640
  return $() + "#" + (typeof l == "string" ? l : Ce(l));
642
641
  }
643
- function de(l, h) {
644
- return h === void 0 && (h = null), Ue(fe({
645
- pathname: p.pathname,
642
+ function ge(l, u) {
643
+ return u === void 0 && (u = null), qe(de({
644
+ pathname: m.pathname,
646
645
  hash: "",
647
646
  search: ""
648
647
  }, typeof l == "string" ? Qe(l) : l, {
649
- state: h,
648
+ state: u,
650
649
  key: gt()
651
650
  }));
652
651
  }
653
- function ge(l, h) {
652
+ function pe(l, u) {
654
653
  return [{
655
654
  usr: l.state,
656
655
  key: l.key,
657
- idx: h
656
+ idx: u
658
657
  }, j(l)];
659
658
  }
660
- function re(l, h, v) {
659
+ function re(l, u, v) {
661
660
  return !b.length || (b.call({
662
661
  action: l,
663
- location: h,
662
+ location: u,
664
663
  retry: v
665
664
  }), !1);
666
665
  }
667
666
  function ne(l) {
668
667
  c = l;
669
- var h = i();
670
- w = h[0], p = h[1], d.call({
668
+ var u = s();
669
+ w = u[0], m = u[1], d.call({
671
670
  action: c,
672
- location: p
671
+ location: m
673
672
  });
674
673
  }
675
- function pe(l, h) {
676
- var v = A.Push, E = de(l, h);
674
+ function me(l, u) {
675
+ var v = A.Push, E = ge(l, u);
677
676
  function S() {
678
- pe(l, h);
677
+ me(l, u);
679
678
  }
680
679
  if (process.env.NODE_ENV !== "production" && je(E.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), re(v, E, S)) {
681
- var M = ge(E, w + 1), O = M[0], C = M[1];
680
+ var N = pe(E, w + 1), T = N[0], C = N[1];
682
681
  try {
683
- s.pushState(O, "", C);
682
+ i.pushState(T, "", C);
684
683
  } catch {
685
684
  r.location.assign(C);
686
685
  }
687
686
  ne(v);
688
687
  }
689
688
  }
690
- function V(l, h) {
691
- var v = A.Replace, E = de(l, h);
689
+ function U(l, u) {
690
+ var v = A.Replace, E = ge(l, u);
692
691
  function S() {
693
- V(l, h);
692
+ U(l, u);
694
693
  }
695
694
  if (process.env.NODE_ENV !== "production" && je(E.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), re(v, E, S)) {
696
- var M = ge(E, w), O = M[0], C = M[1];
697
- s.replaceState(O, "", C), ne(v);
695
+ var N = pe(E, w), T = N[0], C = N[1];
696
+ i.replaceState(T, "", C), ne(v);
698
697
  }
699
698
  }
700
699
  function Q(l) {
701
- s.go(l);
700
+ i.go(l);
702
701
  }
703
702
  var g = {
704
703
  get action() {
705
704
  return c;
706
705
  },
707
706
  get location() {
708
- return p;
707
+ return m;
709
708
  },
710
709
  createHref: j,
711
- push: pe,
712
- replace: V,
710
+ push: me,
711
+ replace: U,
713
712
  go: Q,
714
713
  back: function() {
715
714
  Q(-1);
@@ -717,36 +716,36 @@ function _t(n) {
717
716
  forward: function() {
718
717
  Q(1);
719
718
  },
720
- listen: function(h) {
721
- return d.push(h);
719
+ listen: function(u) {
720
+ return d.push(u);
722
721
  },
723
- block: function(h) {
724
- var v = b.push(h);
725
- return b.length === 1 && r.addEventListener(Ve, De), function() {
726
- v(), b.length || r.removeEventListener(Ve, De);
722
+ block: function(u) {
723
+ var v = b.push(u);
724
+ return b.length === 1 && r.addEventListener(Ue, Ve), function() {
725
+ v(), b.length || r.removeEventListener(Ue, Ve);
727
726
  };
728
727
  }
729
728
  };
730
729
  return g;
731
730
  }
732
- function De(n) {
733
- n.preventDefault(), n.returnValue = "";
731
+ function Ve(a) {
732
+ a.preventDefault(), a.returnValue = "";
734
733
  }
735
734
  function He() {
736
- var n = [];
735
+ var a = [];
737
736
  return {
738
737
  get length() {
739
- return n.length;
738
+ return a.length;
740
739
  },
741
740
  push: function(t) {
742
- return n.push(t), function() {
743
- n = n.filter(function(r) {
741
+ return a.push(t), function() {
742
+ a = a.filter(function(r) {
744
743
  return r !== t;
745
744
  });
746
745
  };
747
746
  },
748
747
  call: function(t) {
749
- n.forEach(function(r) {
748
+ a.forEach(function(r) {
750
749
  return r && r(t);
751
750
  });
752
751
  }
@@ -755,42 +754,42 @@ function He() {
755
754
  function gt() {
756
755
  return Math.random().toString(36).substr(2, 8);
757
756
  }
758
- function Ce(n) {
759
- var e = n.pathname, t = e === void 0 ? "/" : e, r = n.search, s = r === void 0 ? "" : r, i = n.hash, o = i === void 0 ? "" : i;
760
- return s && s !== "?" && (t += s.charAt(0) === "?" ? s : "?" + s), o && o !== "#" && (t += o.charAt(0) === "#" ? o : "#" + o), t;
757
+ function Ce(a) {
758
+ var e = a.pathname, t = e === void 0 ? "/" : e, r = a.search, i = r === void 0 ? "" : r, s = a.hash, o = s === void 0 ? "" : s;
759
+ return i && i !== "?" && (t += i.charAt(0) === "?" ? i : "?" + i), o && o !== "#" && (t += o.charAt(0) === "#" ? o : "#" + o), t;
761
760
  }
762
- function Qe(n) {
761
+ function Qe(a) {
763
762
  var e = {};
764
- if (n) {
765
- var t = n.indexOf("#");
766
- t >= 0 && (e.hash = n.substr(t), n = n.substr(0, t));
767
- var r = n.indexOf("?");
768
- r >= 0 && (e.search = n.substr(r), n = n.substr(0, r)), n && (e.pathname = n);
763
+ if (a) {
764
+ var t = a.indexOf("#");
765
+ t >= 0 && (e.hash = a.substr(t), a = a.substr(0, t));
766
+ var r = a.indexOf("?");
767
+ r >= 0 && (e.search = a.substr(r), a = a.substr(0, r)), a && (e.pathname = a);
769
768
  }
770
769
  return e;
771
770
  }
772
- function me(n) {
773
- return lt(n, "Expected `path` to be a string. Got type: %t, value: %v"), n.split("/").map((e) => e.trim()).filter((e) => e !== "");
771
+ function ye(a) {
772
+ return lt(a, "Expected `path` to be a string. Got type: %t, value: %v"), a.split("/").map((e) => e.trim()).filter((e) => e !== "");
774
773
  }
775
- function ae(n) {
774
+ function ae(a) {
776
775
  var t;
777
776
  vt(
778
777
  (r) => Xe(r == null ? void 0 : r.toString),
779
- n,
778
+ a,
780
779
  "Expected `parts` to be an array of objects with a .toString() method. Got type: %t, value: %v"
781
- ), n = n.filter((r) => r).flatMap(String);
782
- let e = (t = n.shift()) == null ? void 0 : t.toString();
780
+ ), a = a.filter((r) => r).flatMap(String);
781
+ let e = (t = a.shift()) == null ? void 0 : t.toString();
783
782
  if (e) {
784
- for (const r of n.map((s) => s.toString()))
785
- r.startsWith(".") ? e = qe(e, r) : e[e.length - 1] !== "/" ? r[0] !== "/" ? e += "/" + r : e += r : r[0] === "/" ? e += r.slice(1) : e += r;
783
+ for (const r of a.map((i) => i.toString()))
784
+ r.startsWith(".") ? e = De(e, r) : e[e.length - 1] !== "/" ? r[0] !== "/" ? e += "/" + r : e += r : r[0] === "/" ? e += r.slice(1) : e += r;
786
785
  e && e !== "/" && e.endsWith("/") && (e = e.slice(0, e.length - 1));
787
786
  }
788
787
  return e ?? "";
789
788
  }
790
- function qe(n, e) {
791
- if (lt(n, "Expected `base` to be a string. Got type: %t, value: %v"), e == null && (e = n, n = ""), e.startsWith("/"))
789
+ function De(a, e) {
790
+ if (lt(a, "Expected `base` to be a string. Got type: %t, value: %v"), e == null && (e = a, a = ""), e.startsWith("/"))
792
791
  return e;
793
- let t = n;
792
+ let t = a;
794
793
  for (; ; )
795
794
  if (e.startsWith("..")) {
796
795
  for (let r = t.length; r > 0; --r)
@@ -804,25 +803,25 @@ function qe(n, e) {
804
803
  break;
805
804
  return ae([t, e]);
806
805
  }
807
- function Ke(n) {
808
- if (!n) return {};
809
- n.startsWith("?") && (n = n.slice(1));
810
- const e = n.split("&").filter((t) => t.trim() !== "").map((t) => {
811
- const [r, s] = t.split("=").map((i) => i.trim());
812
- return s.toLowerCase() === "true" ? [r, !0] : s.toLowerCase() === "false" ? [r, !1] : isNaN(Number(s)) ? [r, s] : [r, Number(s)];
806
+ function Ke(a) {
807
+ if (!a) return {};
808
+ a.startsWith("?") && (a = a.slice(1));
809
+ const e = a.split("&").filter((t) => t.trim() !== "").map((t) => {
810
+ const [r, i] = t.split("=").map((s) => s.trim());
811
+ return i.toLowerCase() === "true" ? [r, !0] : i.toLowerCase() === "false" ? [r, !1] : isNaN(Number(i)) ? [r, i] : [r, Number(i)];
813
812
  });
814
813
  return Object.fromEntries(e);
815
814
  }
816
- function ot(n, e, t = {}) {
815
+ function ot(a, e, t = {}) {
817
816
  var o;
818
- const [r, s] = e.split("?"), i = me(r);
819
- e: for (const f of n) {
817
+ const [r, i] = e.split("?"), s = ye(r);
818
+ e: for (const f of a) {
820
819
  const { fragments: c } = f;
821
- if (!(((o = c[c.length - 1]) == null ? void 0 : o.type) === 3) && c.length !== i.length || t.willMatch && !t.willMatch(f))
820
+ if (!(((o = c[c.length - 1]) == null ? void 0 : o.type) === 3) && c.length !== s.length || t.willMatch && !t.willMatch(f))
822
821
  continue e;
823
822
  const w = [];
824
823
  t: for (let d = 0; d < c.length; d++) {
825
- const b = i[d], $ = c[d];
824
+ const b = s[d], $ = c[d];
826
825
  if (b == null && $.type !== 3)
827
826
  continue e;
828
827
  switch ($.type) {
@@ -836,7 +835,7 @@ function ot(n, e, t = {}) {
836
835
  w.push({ ...$, value: b });
837
836
  break;
838
837
  case 3:
839
- w.push({ ...$, value: i.slice(d).join("/") });
838
+ w.push({ ...$, value: s.slice(d).join("/") });
840
839
  break t;
841
840
  case 4:
842
841
  if (isNaN(Number(b)))
@@ -847,26 +846,26 @@ function ot(n, e, t = {}) {
847
846
  throw new Error(`Unknown fragment type: ${$.type}`);
848
847
  }
849
848
  }
850
- const p = /* @__PURE__ */ Object.create(null);
849
+ const m = /* @__PURE__ */ Object.create(null);
851
850
  for (const d of w)
852
- d.type === 2 && (p[d.name] = decodeURIComponent(d.value)), d.type === 4 && (p[d.name] = d.value), d.type === 3 && (p.wildcard = "/" + decodeURIComponent(d.value));
851
+ d.type === 2 && (m[d.name] = decodeURIComponent(d.value)), d.type === 4 && (m[d.name] = d.value), d.type === 3 && (m.wildcard = "/" + decodeURIComponent(d.value));
853
852
  return {
854
853
  path: "/" + w.map((d) => d.value).join("/"),
855
854
  pattern: "/" + c.map((d) => d.type === 2 ? `{${d.name}}` : d.type === 4 ? `{#${d.name}}` : d.name).join("/"),
856
- params: p,
857
- query: Ke(s),
855
+ params: m,
856
+ query: Ke(i),
858
857
  meta: f.meta
859
858
  };
860
859
  }
861
860
  }
862
- function Wt(n) {
863
- const e = [], t = [], r = [], s = [];
864
- for (const o of n) {
861
+ function Wt(a) {
862
+ const e = [], t = [], r = [], i = [];
863
+ for (const o of a) {
865
864
  const { fragments: f } = o;
866
865
  f.some(
867
866
  (c) => c.type === 3
868
867
  /* Wildcard */
869
- ) ? s.push(o) : f.some(
868
+ ) ? i.push(o) : f.some(
870
869
  (c) => c.type === 4
871
870
  /* NumericParam */
872
871
  ) ? t.push(o) : f.some(
@@ -874,107 +873,115 @@ function Wt(n) {
874
873
  /* Param */
875
874
  ) ? r.push(o) : e.push(o);
876
875
  }
877
- const i = (o, f) => o.fragments.length > f.fragments.length ? -1 : 1;
878
- return e.sort(i), t.sort(i), r.sort(i), s.sort(i), [...e, ...t, ...r, ...s];
876
+ const s = (o, f) => o.fragments.length > f.fragments.length ? -1 : 1;
877
+ return e.sort(s), t.sort(s), r.sort(s), i.sort(s), [...e, ...t, ...r, ...i];
879
878
  }
880
- function zt(n) {
881
- const e = me(n), t = [];
879
+ function zt(a) {
880
+ const e = ye(a), t = [];
882
881
  for (let r = 0; r < e.length; r++) {
883
- const s = e[r];
884
- if (s === "*") {
882
+ const i = e[r];
883
+ if (i === "*") {
885
884
  if (r !== e.length - 1)
886
- throw new Error(`Wildcard must be at the end of a pattern. Received: ${n}`);
885
+ throw new Error(`Wildcard must be at the end of a pattern. Received: ${a}`);
887
886
  t.push({
888
887
  type: 3,
889
888
  name: "*",
890
889
  value: null
891
890
  });
892
- } else s.at(0) === "{" && s.at(-1) === "}" ? t.push({
893
- type: s[1] === "#" ? 4 : 2,
894
- name: s[1] === "#" ? s.slice(2, -1) : s.slice(1, -1),
891
+ } else i.at(0) === "{" && i.at(-1) === "}" ? t.push({
892
+ type: i[1] === "#" ? 4 : 2,
893
+ name: i[1] === "#" ? i.slice(2, -1) : i.slice(1, -1),
895
894
  value: null
896
895
  }) : t.push({
897
896
  type: 1,
898
- name: s,
899
- value: s
897
+ name: i,
898
+ value: i
900
899
  });
901
900
  }
902
901
  return t;
903
902
  }
904
- var Ee, T, Z, L, ze, W, ke, ee, z, le, he, ue, Le, B, Je, Ye;
903
+ var le, M, Z, k, ze, W, ke, ee, z, ue, he, fe, Le, B, Je, Ye;
905
904
  class Ft {
906
905
  constructor(e, t) {
907
- u(this, B);
908
- u(this, Ee);
909
- u(this, T);
910
- u(this, Z);
911
- u(this, L, Ht());
912
- u(this, ze, 0);
913
- u(this, W, []);
914
- u(this, ke);
915
- u(this, ee, []);
906
+ h(this, B);
907
+ h(this, le);
908
+ h(this, M);
909
+ h(this, Z);
910
+ h(this, k);
911
+ h(this, ze, 0);
912
+ h(this, W, []);
913
+ h(this, ke);
914
+ h(this, ee, []);
916
915
  // Callbacks that need to be called on unmount.
917
- u(this, z, []);
916
+ h(this, z, []);
918
917
  /**
919
918
  * The currently matched route pattern, if any.
920
919
  */
921
- k(this, "$pattern");
922
- u(this, le);
920
+ L(this, "$pattern");
921
+ h(this, ue);
923
922
  /**
924
923
  * The current URL path.
925
924
  */
926
- k(this, "$path");
927
- u(this, he);
925
+ L(this, "$path");
926
+ h(this, he);
928
927
  /**
929
928
  * The current named path params.
930
929
  */
931
- k(this, "$params");
932
- u(this, ue);
930
+ L(this, "$params");
931
+ h(this, fe);
933
932
  /**
934
933
  * The current query params. Changes to this object will be reflected in the URL.
935
934
  */
936
- k(this, "$query");
937
- u(this, Le);
938
- m(this, Ee, e), m(this, T, e.createLogger("dolla/router")), m(this, Z, t);
939
- const [r, s] = K(null), [i, o] = K(""), [f, c] = K({}), [y, w] = K(Ke(window.location.search));
940
- this.$pattern = r, m(this, le, s), this.$path = i, m(this, he, o), this.$params = f, m(this, ue, c), this.$query = y, m(this, Le, w), e.beforeMount(() => {
941
- a(this, z).push(
942
- ht([y], (p) => {
935
+ L(this, "$query");
936
+ h(this, Le);
937
+ p(this, le, e), p(this, M, e.createLogger("dolla/router")), p(this, Z, t);
938
+ const [r, i] = K(null), [s, o] = K(""), [f, c] = K({}), [y, w] = K(
939
+ Ke(typeof window > "u" ? "" : window.location.search ?? "")
940
+ );
941
+ this.$pattern = r, p(this, ue, i), this.$path = s, p(this, he, o), this.$params = f, p(this, fe, c), this.$query = y, p(this, Le, w), e.beforeMount(() => {
942
+ n(this, k) != null && (n(this, z).push(
943
+ ut([y], (m) => {
943
944
  const d = new URLSearchParams();
944
- for (const $ in p)
945
- d.set($, String(p[$]));
945
+ for (const $ in m)
946
+ d.set($, String(m[$]));
946
947
  const b = "?" + d.toString();
947
- b != a(this, L).location.search && a(this, L).replace({
948
- pathname: a(this, L).location.pathname,
948
+ b != n(this, k).location.search && n(this, k).replace({
949
+ pathname: n(this, k).location.pathname,
949
950
  search: b
950
951
  });
951
952
  })
952
- ), a(this, z).push(a(this, L).listen(P(this, B, Ye).bind(this))), P(this, B, Ye).call(this, a(this, L)), a(this, z).push(
953
- Bt(a(this, Z).rootElement, (p) => {
954
- let d = p.getAttribute("href");
955
- a(this, T).info("Intercepted link click", p, d), /^https?:\/\/|^\//.test(d) || (d = ae([a(this, L).location.pathname, d])), a(this, L).push(d);
953
+ ), n(this, z).push(n(this, k).listen(P(this, B, Ye).bind(this))), P(this, B, Ye).call(this, n(this, k)), n(this, z).push(
954
+ Bt(n(this, Z).rootElement, (m) => {
955
+ let d = m.getAttribute("href");
956
+ n(this, M).info("Intercepted link click", m, d), /^https?:\/\/|^\//.test(d) || (d = ae([n(this, k).location.pathname, d])), n(this, k).push(d);
956
957
  })
957
- ), a(this, T).info("Intercepting <a> clicks within root element:", a(this, Z).rootElement);
958
+ ), n(this, M).info("Intercepting <a> clicks within root element:", n(this, Z).rootElement));
958
959
  }), e.onUnmount(() => {
959
- for (; a(this, z).length > 0; )
960
- a(this, z).pop()();
960
+ for (; n(this, z).length > 0; )
961
+ n(this, z).pop()();
961
962
  });
962
963
  }
963
964
  setup(e) {
964
- e.style === "hash" && m(this, L, _t()), m(this, ee, Wt(
965
+ if (n(this, le).isMounted) {
966
+ n(this, M).crash(
967
+ new Error("Dolla is already mounted. Router setup must be called before Dolla.mount is called.")
968
+ );
969
+ return;
970
+ }
971
+ e.style === "hash" ? p(this, k, _t()) : p(this, k, Ht()), p(this, ee, Wt(
965
972
  e.routes.flatMap((t) => P(this, B, Je).call(this, t)).map((t) => ({
966
973
  pattern: t.pattern,
967
974
  meta: t.meta,
968
975
  fragments: zt(t.pattern)
969
976
  }))
970
977
  ));
971
- for (const t of a(this, ee))
978
+ for (const t of n(this, ee))
972
979
  if (t.meta.redirect) {
973
980
  let r;
974
- if (!Xe(t.meta.redirect)) if (D(t.meta.redirect)) {
975
- if (r = t.meta.redirect, !ot(a(this, ee), r, {
976
- willMatch(i) {
977
- return i !== t;
981
+ if (!Xe(t.meta.redirect)) if (V(t.meta.redirect)) {
982
+ if (r = t.meta.redirect, !ot(n(this, ee), r, {
983
+ willMatch(s) {
984
+ return s !== t;
978
985
  }
979
986
  }))
980
987
  throw new Error(
@@ -992,23 +999,47 @@ class Ft {
992
999
  * navigate(["/users", 215], { replace: true }); // replace current history entry with `/users/215`
993
1000
  */
994
1001
  go(e, t = {}) {
1002
+ if (n(this, k) == null) {
1003
+ n(this, M).crash(
1004
+ new Error(
1005
+ "Router.go was called, but the router was never configured! Run 'Dolla.router.setup' before 'Dolla.mount' to configure routes."
1006
+ )
1007
+ );
1008
+ return;
1009
+ }
995
1010
  let r;
996
- Array.isArray(e) ? r = ae(e) : r = e.toString(), r = qe(a(this, L).location.pathname, r), t.preserveQuery && (r += a(this, L).location.search), t.replace ? a(this, L).replace(r) : a(this, L).push(r);
1011
+ Array.isArray(e) ? r = ae(e) : r = e.toString(), r = De(n(this, k).location.pathname, r), t.preserveQuery && (r += n(this, k).location.search), t.replace ? n(this, k).replace(r) : n(this, k).push(r);
997
1012
  }
998
1013
  /**
999
1014
  * Navigate backward. Pass a number of steps to hit the back button that many times.
1000
1015
  */
1001
1016
  back(e = 1) {
1002
- a(this, L).go(-e);
1017
+ if (n(this, k) == null) {
1018
+ n(this, M).crash(
1019
+ new Error(
1020
+ "Router.back was called, but the router was never configured! Run 'Dolla.router.setup' before 'Dolla.mount' to configure routes."
1021
+ )
1022
+ );
1023
+ return;
1024
+ }
1025
+ n(this, k).go(-e);
1003
1026
  }
1004
1027
  /**
1005
1028
  * Navigate forward. Pass a number of steps to hit the forward button that many times.
1006
1029
  */
1007
1030
  forward(e = 1) {
1008
- a(this, L).go(e);
1031
+ if (n(this, k) == null) {
1032
+ n(this, M).crash(
1033
+ new Error(
1034
+ "Router.forward was called, but the router was never configured! Run 'Dolla.router.setup' before 'Dolla.mount' to configure routes."
1035
+ )
1036
+ );
1037
+ return;
1038
+ }
1039
+ n(this, k).go(e);
1009
1040
  }
1010
1041
  }
1011
- Ee = new WeakMap(), T = new WeakMap(), Z = new WeakMap(), L = new WeakMap(), ze = new WeakMap(), W = new WeakMap(), ke = new WeakMap(), ee = new WeakMap(), z = new WeakMap(), le = new WeakMap(), he = new WeakMap(), ue = new WeakMap(), Le = new WeakMap(), B = new WeakSet(), /**
1042
+ le = new WeakMap(), M = new WeakMap(), Z = new WeakMap(), k = new WeakMap(), ze = new WeakMap(), W = new WeakMap(), ke = new WeakMap(), ee = new WeakMap(), z = new WeakMap(), ue = new WeakMap(), he = new WeakMap(), fe = new WeakMap(), Le = new WeakMap(), B = new WeakSet(), /**
1012
1043
  * Parses a route definition object into a set of matchable routes.
1013
1044
  *
1014
1045
  * @param route - Route config object.
@@ -1023,21 +1054,21 @@ Je = function(e, t = [], r = []) {
1023
1054
  throw new Error("Route cannot have both a 'redirect' and a 'view'.");
1024
1055
  if (!e.view && !e.routes && !e.redirect)
1025
1056
  throw new Error("Route must have a 'view', a 'redirect', or a set of nested 'routes'.");
1026
- let s = [];
1057
+ let i = [];
1027
1058
  for (const c of t)
1028
- s.push(...me(c.path));
1029
- s.push(...me(e.path)), s[s.length - 1] === "*" && s.pop();
1030
- const i = [];
1059
+ i.push(...ye(c.path));
1060
+ i.push(...ye(e.path)), i[i.length - 1] === "*" && i.pop();
1061
+ const s = [];
1031
1062
  if (e.redirect) {
1032
1063
  let c = e.redirect;
1033
- return D(c) && (c = qe(ae(s), c), c.startsWith("/") || (c = "/" + c)), i.push({
1034
- pattern: "/" + ae([...s, ...me(e.path)]),
1064
+ return V(c) && (c = De(ae(i), c), c.startsWith("/") || (c = "/" + c)), s.push({
1065
+ pattern: "/" + ae([...i, ...ye(e.path)]),
1035
1066
  meta: {
1036
1067
  redirect: c
1037
1068
  }
1038
- }), i;
1069
+ }), s;
1039
1070
  }
1040
- let o = ut;
1071
+ let o = ht;
1041
1072
  if (typeof e.view == "function")
1042
1073
  o = e.view;
1043
1074
  else if (e.view)
@@ -1045,9 +1076,9 @@ Je = function(e, t = [], r = []) {
1045
1076
  const f = { id: et(this, ze)._++, view: o };
1046
1077
  if (e.routes)
1047
1078
  for (const c of e.routes)
1048
- i.push(...P(this, B, Je).call(this, c, [...t, e], [...r, f]));
1079
+ s.push(...P(this, B, Je).call(this, c, [...t, e], [...r, f]));
1049
1080
  else
1050
- i.push({
1081
+ s.push({
1051
1082
  pattern: parent ? ae([...t.map((c) => c.path), e.path]) : e.path,
1052
1083
  meta: {
1053
1084
  pattern: e.path,
@@ -1055,12 +1086,12 @@ Je = function(e, t = [], r = []) {
1055
1086
  beforeMatch: e.beforeMatch
1056
1087
  }
1057
1088
  });
1058
- return i;
1089
+ return s;
1059
1090
  }, Ye = async function({ location: e }) {
1060
- e.search !== a(this, ke) && (m(this, ke, e.search), a(this, Le).call(this, Ke(e.search)));
1061
- const t = ot(a(this, ee), e.pathname);
1091
+ e.search !== n(this, ke) && (p(this, ke, e.search), n(this, Le).call(this, Ke(e.search)));
1092
+ const t = ot(n(this, ee), e.pathname);
1062
1093
  if (!t) {
1063
- a(this, le).call(this, null), a(this, he).call(this, e.pathname), a(this, ue).call(this, {
1094
+ n(this, ue).call(this, null), n(this, he).call(this, e.pathname), n(this, fe).call(this, {
1064
1095
  wildcard: e.pathname
1065
1096
  });
1066
1097
  return;
@@ -1069,10 +1100,10 @@ Je = function(e, t = [], r = []) {
1069
1100
  redirect: (r) => {
1070
1101
  throw new Error("Redirect not yet implemented.");
1071
1102
  }
1072
- }), a(this, T).info(`Matched route: '${t.pattern}' ('${t.path}')`), t.meta.redirect != null)
1103
+ }), n(this, M).info(`Matched route: '${t.pattern}' ('${t.path}')`), t.meta.redirect != null)
1073
1104
  if (typeof t.meta.redirect == "string") {
1074
1105
  const r = Qt(t.meta.redirect, t.params);
1075
- a(this, T).info(`Redirecting to: '${r}'`), a(this, L).replace(r);
1106
+ n(this, M).info(`Redirecting to: '${r}'`), n(this, k).replace(r);
1076
1107
  } else if (typeof t.meta.redirect == "function") {
1077
1108
  const r = {
1078
1109
  path: t.path,
@@ -1080,86 +1111,86 @@ Je = function(e, t = [], r = []) {
1080
1111
  params: t.params,
1081
1112
  query: t.query
1082
1113
  };
1083
- let s = await t.meta.redirect(r);
1084
- if (typeof s != "string")
1114
+ let i = await t.meta.redirect(r);
1115
+ if (typeof i != "string")
1085
1116
  throw new Error("Redirect function must return a path to redirect to.");
1086
- s.startsWith("/") || (s = qe(t.path, s)), a(this, T).info(`Redirecting to: '${s}'`), a(this, L).replace(s);
1117
+ i.startsWith("/") || (i = De(t.path, i)), n(this, M).info(`Redirecting to: '${i}'`), n(this, k).replace(i);
1087
1118
  } else
1088
1119
  throw new TypeError("Redirect must either be a path string or a function.");
1089
- else if (a(this, he).call(this, t.path), a(this, ue).call(this, t.params), t.pattern !== this.$pattern.get()) {
1090
- a(this, le).call(this, t.pattern);
1120
+ else if (n(this, he).call(this, t.path), n(this, fe).call(this, t.params), t.pattern !== this.$pattern.get()) {
1121
+ n(this, ue).call(this, t.pattern);
1091
1122
  const r = t.meta.layers;
1092
- for (let s = 0; s < r.length; s++) {
1093
- const i = r[s], o = a(this, W)[s];
1094
- if ((o == null ? void 0 : o.id) !== i.id) {
1095
- a(this, T).info(`Replacing layer @${s} (active ID: ${o == null ? void 0 : o.id}, matched ID: ${i.id})`), m(this, W, a(this, W).slice(0, s));
1096
- const f = a(this, W).at(-1), c = a(this, Ee).constructView(i.view, {});
1097
- o && o.node.isMounted && o.node.unmount(), f ? f.node.setChildren([c]) : a(this, Z).rootView.setChildren([c]), a(this, W).push({ id: i.id, node: c });
1123
+ for (let i = 0; i < r.length; i++) {
1124
+ const s = r[i], o = n(this, W)[i];
1125
+ if ((o == null ? void 0 : o.id) !== s.id) {
1126
+ n(this, M).info(`Replacing layer @${i} (active ID: ${o == null ? void 0 : o.id}, matched ID: ${s.id})`), p(this, W, n(this, W).slice(0, i));
1127
+ const f = n(this, W).at(-1), c = n(this, le).constructView(s.view, {});
1128
+ o && o.node.isMounted && o.node.unmount(), f ? f.node.setChildren([c]) : n(this, Z).rootView.setChildren([c]), n(this, W).push({ id: s.id, node: c });
1098
1129
  }
1099
1130
  }
1100
1131
  }
1101
1132
  };
1102
1133
  const It = /(noopener|noreferrer) (noopener|noreferrer)/, Gt = /^[\w-_]+:/;
1103
- function Bt(n, e, t = window) {
1104
- function r(i) {
1105
- return !i || i === n ? null : i.localName !== "a" || i.href === void 0 ? r(i.parentNode) : i;
1134
+ function Bt(a, e, t = window) {
1135
+ function r(s) {
1136
+ return !s || s === a ? null : s.localName !== "a" || s.href === void 0 ? r(s.parentNode) : s;
1106
1137
  }
1107
- function s(i) {
1108
- if (i.button && i.button !== 0 || i.ctrlKey || i.metaKey || i.altKey || i.shiftKey || i.defaultPrevented)
1138
+ function i(s) {
1139
+ if (s.button && s.button !== 0 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey || s.defaultPrevented)
1109
1140
  return;
1110
- const o = r(i.target);
1111
- o && (t.location.protocol !== o.protocol || t.location.hostname !== o.hostname || t.location.port !== o.port || o.hasAttribute("data-router-ignore") || o.hasAttribute("download") || o.getAttribute("target") === "_blank" && It.test(o.getAttribute("rel")) || Gt.test(o.getAttribute("href")) || (i.preventDefault(), e(o)));
1141
+ const o = r(s.target);
1142
+ o && (t.location.protocol !== o.protocol || t.location.hostname !== o.hostname || t.location.port !== o.port || o.hasAttribute("data-router-ignore") || o.hasAttribute("download") || o.getAttribute("target") === "_blank" && It.test(o.getAttribute("rel")) || Gt.test(o.getAttribute("href")) || (s.preventDefault(), e(o)));
1112
1143
  }
1113
- return n.addEventListener("click", s), function() {
1114
- n.removeEventListener("click", s);
1144
+ return a.addEventListener("click", i), function() {
1145
+ a.removeEventListener("click", i);
1115
1146
  };
1116
1147
  }
1117
- function Qt(n, e) {
1148
+ function Qt(a, e) {
1118
1149
  for (const t in e) {
1119
1150
  const r = e[t].toString();
1120
- n = n.replace(`{${t}}`, r).replace(`{#${t}}`, r);
1151
+ a = a.replace(`{${t}}`, r).replace(`{#${t}}`, r);
1121
1152
  }
1122
- return n;
1153
+ return a;
1123
1154
  }
1124
1155
  var F, Pe, I, te, Se, Re, xe, Me, Ne, R, G;
1125
1156
  class Kt {
1126
1157
  constructor() {
1127
- k(this, "http");
1128
- k(this, "language");
1129
- k(this, "render");
1130
- k(this, "router");
1131
- u(this, F, !1);
1132
- u(this, Pe, "production");
1133
- u(this, I);
1134
- u(this, te);
1135
- u(this, Se, Nt);
1136
- u(this, Re, []);
1137
- u(this, xe, []);
1138
- u(this, Me, []);
1139
- u(this, Ne, []);
1140
- u(this, R, {
1158
+ L(this, "http");
1159
+ L(this, "language");
1160
+ L(this, "render");
1161
+ L(this, "router");
1162
+ h(this, F, !1);
1163
+ h(this, Pe, "production");
1164
+ h(this, I);
1165
+ h(this, te);
1166
+ h(this, Se, Nt);
1167
+ h(this, Re, []);
1168
+ h(this, xe, []);
1169
+ h(this, Me, []);
1170
+ h(this, Ne, []);
1171
+ h(this, R, {
1141
1172
  info: "development",
1142
1173
  log: "development",
1143
1174
  warn: "development",
1144
1175
  error: !0
1145
1176
  });
1146
- u(this, G, rt("*,-dolla/*"));
1147
- k(this, "createSignal", K);
1148
- k(this, "createSettableSignal", $t);
1149
- k(this, "toSettableSignal", Et);
1150
- k(this, "signalify", Ge);
1151
- k(this, "designalify", kt);
1152
- k(this, "derive", Be);
1153
- k(this, "watch", ht);
1154
- k(this, "createRef", Lt);
1155
- k(this, "isRef", Pt);
1177
+ h(this, G, rt("*,-dolla/*"));
1178
+ L(this, "createSignal", K);
1179
+ L(this, "createSettableSignal", $t);
1180
+ L(this, "toSettableSignal", Et);
1181
+ L(this, "signalify", Ge);
1182
+ L(this, "designalify", kt);
1183
+ L(this, "derive", Be);
1184
+ L(this, "watch", ut);
1185
+ L(this, "createRef", Lt);
1186
+ L(this, "isRef", Pt);
1156
1187
  const e = this;
1157
- this.http = new Ot(), this.language = new qt(this), this.render = new Vt(this), this.router = new Ft(this, {
1188
+ this.http = new Ot(), this.language = new Dt(this), this.render = new Ut(this), this.router = new Ft(this, {
1158
1189
  get rootElement() {
1159
- return a(e, I);
1190
+ return n(e, I);
1160
1191
  },
1161
1192
  get rootView() {
1162
- return a(e, te);
1193
+ return n(e, te);
1163
1194
  }
1164
1195
  });
1165
1196
  }
@@ -1167,47 +1198,47 @@ class Kt {
1167
1198
  * True when the app is connected to a DOM node and displayed to the user.
1168
1199
  */
1169
1200
  get isMounted() {
1170
- return a(this, F);
1201
+ return n(this, F);
1171
1202
  }
1172
1203
  /**
1173
1204
  * Get the current environment that this app is running in.
1174
1205
  * Environment affects which log messages will print and how much debugging info is included in the DOM.
1175
1206
  */
1176
1207
  getEnv() {
1177
- return a(this, Pe);
1208
+ return n(this, Pe);
1178
1209
  }
1179
1210
  /**
1180
1211
  * Sets the environment that this app is running in.
1181
1212
  * Environment affects which log messages will print and how much debugging info is included in the DOM.
1182
1213
  */
1183
1214
  setEnv(e) {
1184
- m(this, Pe, e);
1215
+ p(this, Pe, e);
1185
1216
  }
1186
1217
  /**
1187
1218
  * Sets the view that will be shown when the `crash` method is called on any logger.
1188
1219
  * When a crash is reported the app will be unmounted and replaced with this crash page.
1189
1220
  */
1190
1221
  setCrashView(e) {
1191
- m(this, Se, e);
1222
+ p(this, Se, e);
1192
1223
  }
1193
1224
  async mount(e, t) {
1194
- if (a(this, F))
1225
+ if (n(this, F))
1195
1226
  throw new Error("Dolla is already mounted.");
1196
- if (D(e)) {
1197
- const s = document.querySelector(e);
1198
- nt(HTMLElement, s, `Selector '${e}' did not match any element.`), m(this, I, s);
1227
+ if (V(e)) {
1228
+ const i = document.querySelector(e);
1229
+ nt(HTMLElement, i, `Selector '${e}' did not match any element.`), p(this, I, i);
1199
1230
  } else
1200
- nt(HTMLElement, e, "Expected an HTML element or a selector string. Got type: %t, value: %v"), m(this, I, e);
1231
+ nt(HTMLElement, e, "Expected an HTML element or a selector string. Got type: %t, value: %v"), p(this, I, e);
1201
1232
  let r;
1202
- t ? r = at(t) : r = at(ut), m(this, te, this.constructView(r.type, r.props)), await Promise.all(a(this, Re).map((s) => s())), a(this, te).mount(a(this, I)), m(this, F, !0);
1203
- for (const s of a(this, xe))
1204
- s();
1233
+ t ? r = at(t) : r = at(ht), p(this, te, this.constructView(r.type, r.props)), await Promise.all(n(this, Re).map((i) => i())), n(this, te).mount(n(this, I)), p(this, F, !0);
1234
+ for (const i of n(this, xe))
1235
+ i();
1205
1236
  }
1206
1237
  async unmount() {
1207
1238
  var e;
1208
- if (a(this, F)) {
1209
- await Promise.all(a(this, Me).map((t) => t())), (e = a(this, te)) == null || e.unmount(), m(this, F, !1);
1210
- for (const t of a(this, Ne))
1239
+ if (n(this, F)) {
1240
+ await Promise.all(n(this, Me).map((t) => t())), (e = n(this, te)) == null || e.unmount(), p(this, F, !1);
1241
+ for (const t of n(this, Ne))
1211
1242
  t();
1212
1243
  }
1213
1244
  }
@@ -1216,26 +1247,26 @@ class Kt {
1216
1247
  * it will be awaited before mounting finishes. Use this to perform initial setup before the app is displayed to the user.
1217
1248
  */
1218
1249
  beforeMount(e) {
1219
- a(this, Re).push(e);
1250
+ n(this, Re).push(e);
1220
1251
  }
1221
1252
  /**
1222
1253
  * Registers a `callback` to run after the app is mounted.
1223
1254
  */
1224
1255
  onMount(e) {
1225
- a(this, xe).push(e);
1256
+ n(this, xe).push(e);
1226
1257
  }
1227
1258
  /**
1228
1259
  * Registers a `callback` to run after `Dolla.unmount` is called, before the app is unmounted. If `callback` returns a Promise,
1229
1260
  * it will be awaited before unmounting finishes. Use this to perform cleanup.
1230
1261
  */
1231
1262
  beforeUnmount(e) {
1232
- a(this, Me).push(e);
1263
+ n(this, Me).push(e);
1233
1264
  }
1234
1265
  /**
1235
1266
  * Registers a `callback` to run after the app is unmounted.
1236
1267
  */
1237
1268
  onUnmount(e) {
1238
- a(this, Ne).push(e);
1269
+ n(this, Ne).push(e);
1239
1270
  }
1240
1271
  /**
1241
1272
  * Update log type toggles. Values that are not passed will remain unchanged.
@@ -1243,24 +1274,24 @@ class Kt {
1243
1274
  setLoggles(e) {
1244
1275
  for (const t in e) {
1245
1276
  const r = e[t];
1246
- r && (a(this, R)[t] = r);
1277
+ r && (n(this, R)[t] = r);
1247
1278
  }
1248
1279
  }
1249
1280
  setLogFilter(e) {
1250
- m(this, G, rt(e));
1281
+ p(this, G, rt(e));
1251
1282
  }
1252
1283
  createLogger(e, t) {
1253
- const r = Ge(e), s = (t == null ? void 0 : t.console) ?? St(), i = this;
1284
+ const r = Ge(e), i = (t == null ? void 0 : t.console) ?? St(), s = this;
1254
1285
  return {
1255
1286
  get info() {
1256
1287
  var f;
1257
1288
  const o = r.get();
1258
- if (a(i, R).info === !1 || D(a(i, R).info) && a(i, R).info !== i.getEnv() || !a(f = i, G).call(f, o))
1289
+ if (n(s, R).info === !1 || V(n(s, R).info) && n(s, R).info !== s.getEnv() || !n(f = s, G).call(f, o))
1259
1290
  return Oe;
1260
1291
  {
1261
1292
  let c = `%c${o}`;
1262
- return t != null && t.uid ? c += ` %c[uid: %c${t.uid}%c]` : c += "%c%c%c", s.info.bind(
1263
- s,
1293
+ return t != null && t.uid ? c += ` %c[uid: %c${t.uid}%c]` : c += "%c%c%c", i.info.bind(
1294
+ i,
1264
1295
  c,
1265
1296
  `color:${Te(c)};font-weight:bold`,
1266
1297
  "color:#777",
@@ -1272,12 +1303,12 @@ class Kt {
1272
1303
  get log() {
1273
1304
  var f;
1274
1305
  const o = r.get();
1275
- if (a(i, R).log === !1 || D(a(i, R).log) && a(i, R).log !== i.getEnv() || !a(f = i, G).call(f, o))
1306
+ if (n(s, R).log === !1 || V(n(s, R).log) && n(s, R).log !== s.getEnv() || !n(f = s, G).call(f, o))
1276
1307
  return Oe;
1277
1308
  {
1278
1309
  let c = `%c${o}`;
1279
- return t != null && t.uid ? c += ` %c[uid: %c${t.uid}%c]` : c += "%c%c%c", s.log.bind(
1280
- s,
1310
+ return t != null && t.uid ? c += ` %c[uid: %c${t.uid}%c]` : c += "%c%c%c", i.log.bind(
1311
+ i,
1281
1312
  c,
1282
1313
  `color:${Te(c)};font-weight:bold`,
1283
1314
  "color:#777",
@@ -1289,12 +1320,12 @@ class Kt {
1289
1320
  get warn() {
1290
1321
  var f;
1291
1322
  const o = r.get();
1292
- if (a(i, R).warn === !1 || D(a(i, R).warn) && a(i, R).warn !== i.getEnv() || !a(f = i, G).call(f, o))
1323
+ if (n(s, R).warn === !1 || V(n(s, R).warn) && n(s, R).warn !== s.getEnv() || !n(f = s, G).call(f, o))
1293
1324
  return Oe;
1294
1325
  {
1295
1326
  let c = `%c${o}`;
1296
- return t != null && t.uid ? c += ` %c[uid: %c${t.uid}%c]` : c += "%c%c%c", s.warn.bind(
1297
- s,
1327
+ return t != null && t.uid ? c += ` %c[uid: %c${t.uid}%c]` : c += "%c%c%c", i.warn.bind(
1328
+ i,
1298
1329
  c,
1299
1330
  `color:${Te(c)};font-weight:bold`,
1300
1331
  "color:#777",
@@ -1306,12 +1337,12 @@ class Kt {
1306
1337
  get error() {
1307
1338
  var f;
1308
1339
  const o = r.get();
1309
- if (a(i, R).error === !1 || D(a(i, R).error) && a(i, R).error !== i.getEnv() || !a(f = i, G).call(f, o))
1340
+ if (n(s, R).error === !1 || V(n(s, R).error) && n(s, R).error !== s.getEnv() || !n(f = s, G).call(f, o))
1310
1341
  return Oe;
1311
1342
  {
1312
1343
  let c = `%c${o}`;
1313
- return t != null && t.uid ? c += ` %c[uid: %c${t.uid}%c]` : c += "%c%c%c", s.error.bind(
1314
- s,
1344
+ return t != null && t.uid ? c += ` %c[uid: %c${t.uid}%c]` : c += "%c%c%c", i.error.bind(
1345
+ i,
1315
1346
  c,
1316
1347
  `color:${Te(c)};font-weight:bold`,
1317
1348
  "color:#777",
@@ -1321,11 +1352,11 @@ class Kt {
1321
1352
  }
1322
1353
  },
1323
1354
  crash(o) {
1324
- throw i.isMounted && (i.unmount(), i.constructView(a(i, Se), {
1355
+ throw s.isMounted && (s.unmount(), s.constructView(n(s, Se), {
1325
1356
  error: o,
1326
1357
  loggerName: r.get(),
1327
1358
  uid: t == null ? void 0 : t.uid
1328
- }).mount(a(i, I))), o;
1359
+ }).mount(n(s, I))), o;
1329
1360
  }
1330
1361
  };
1331
1362
  }
@@ -1360,7 +1391,6 @@ export {
1360
1391
  ar as repeat,
1361
1392
  Ge as signalify,
1362
1393
  Zt as t,
1363
- Et as toSettableSignal,
1364
- ht as watch
1394
+ Et as toSettableSignal
1365
1395
  };
1366
1396
  //# sourceMappingURL=index.js.map