@noego/forge 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.mjs CHANGED
@@ -1,77 +1,77 @@
1
- import { p as G, a as g } from "./page.svelte-Bq1Q01H0.js";
2
- import { s as yt } from "./page.svelte-Bq1Q01H0.js";
3
- import * as F from "svelte/internal/client";
4
- import { hydrate as Y } from "svelte";
5
- import J from "../src/components/RecursiveRender.svelte";
6
- function K(t) {
7
- const a = new G(t);
8
- return (n) => a.match(n) || null;
9
- }
10
- function Q(t) {
11
- return t.map((a) => {
12
- const n = a.path, r = K(n);
13
- return { pattern: n, parser: r };
1
+ import { p as $t, a as E } from "./page.svelte-Bq1Q01H0.js";
2
+ import { s as Ve } from "./page.svelte-Bq1Q01H0.js";
3
+ import * as pt from "svelte/internal/client";
4
+ import { hydrate as Ft } from "svelte";
5
+ import Dt from "../src/components/RecursiveRender.svelte";
6
+ function Gt(t) {
7
+ const r = new $t(t);
8
+ return (e) => r.match(e) || null;
9
+ }
10
+ function Vt(t) {
11
+ return t.map((r) => {
12
+ const e = r.path, n = Gt(e);
13
+ return { pattern: e, parser: n };
14
14
  });
15
15
  }
16
- function A() {
17
- return A = Object.assign ? Object.assign.bind() : function(t) {
18
- for (var a = 1; a < arguments.length; a++) {
19
- var n = arguments[a];
20
- for (var r in n) ({}).hasOwnProperty.call(n, r) && (t[r] = n[r]);
16
+ function G() {
17
+ return G = Object.assign ? Object.assign.bind() : function(t) {
18
+ for (var r = 1; r < arguments.length; r++) {
19
+ var e = arguments[r];
20
+ for (var n in e) ({}).hasOwnProperty.call(e, n) && (t[n] = e[n]);
21
21
  }
22
22
  return t;
23
- }, A.apply(null, arguments);
23
+ }, G.apply(null, arguments);
24
24
  }
25
- var O;
25
+ var j;
26
26
  (function(t) {
27
27
  t.Pop = "POP", t.Push = "PUSH", t.Replace = "REPLACE";
28
- })(O || (O = {}));
29
- var M = process.env.NODE_ENV !== "production" ? function(t) {
28
+ })(j || (j = {}));
29
+ var at = process.env.NODE_ENV !== "production" ? function(t) {
30
30
  return Object.freeze(t);
31
31
  } : function(t) {
32
32
  return t;
33
33
  };
34
- function X(t, a) {
34
+ function Mt(t, r) {
35
35
  {
36
- typeof console < "u" && console.warn(a);
36
+ typeof console < "u" && console.warn(r);
37
37
  try {
38
- throw new Error(a);
38
+ throw new Error(r);
39
39
  } catch {
40
40
  }
41
41
  }
42
42
  }
43
- var z = "beforeunload", Z = "popstate";
44
- function tt(t) {
43
+ var st = "beforeunload", Ht = "popstate";
44
+ function Wt(t) {
45
45
  t === void 0 && (t = {});
46
- var a = t, n = a.window, r = n === void 0 ? document.defaultView : n, i = r.history;
47
- function o() {
48
- var p = r.location, m = p.pathname, y = p.search, b = p.hash, P = i.state || {};
49
- return [P.idx, M({
46
+ var r = t, e = r.window, n = e === void 0 ? document.defaultView : e, o = n.history;
47
+ function i() {
48
+ var p = n.location, m = p.pathname, _ = p.search, x = p.hash, O = o.state || {};
49
+ return [O.idx, at({
50
50
  pathname: m,
51
- search: y,
52
- hash: b,
53
- state: P.usr || null,
54
- key: P.key || "default"
51
+ search: _,
52
+ hash: x,
53
+ state: O.usr || null,
54
+ key: O.key || "default"
55
55
  })];
56
56
  }
57
- var c = null;
58
- function l() {
59
- if (c)
60
- h.call(c), c = null;
57
+ var a = null;
58
+ function c() {
59
+ if (a)
60
+ l.call(a), a = null;
61
61
  else {
62
- var p = O.Pop, m = o(), y = m[0], b = m[1];
63
- if (h.length)
64
- if (y != null) {
65
- var P = u - y;
66
- P && (c = {
62
+ var p = j.Pop, m = i(), _ = m[0], x = m[1];
63
+ if (l.length)
64
+ if (_ != null) {
65
+ var O = f - _;
66
+ O && (a = {
67
67
  action: p,
68
- location: b,
68
+ location: x,
69
69
  retry: function() {
70
- j(P * -1);
70
+ U(O * -1);
71
71
  }
72
- }, j(P));
72
+ }, U(O));
73
73
  } else
74
- process.env.NODE_ENV !== "production" && X(
74
+ process.env.NODE_ENV !== "production" && Mt(
75
75
  !1,
76
76
  // TODO: Write up a doc that explains our blocking strategy in
77
77
  // detail and link to it here so people can understand better what
@@ -79,387 +79,1423 @@ function tt(t) {
79
79
  "You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
80
80
  );
81
81
  else
82
- _(p);
82
+ A(p);
83
83
  }
84
84
  }
85
- r.addEventListener(Z, l);
86
- var e = O.Pop, s = o(), u = s[0], d = s[1], f = I(), h = I();
87
- u == null && (u = 0, i.replaceState(A({}, i.state, {
88
- idx: u
85
+ n.addEventListener(Ht, c);
86
+ var s = j.Pop, u = i(), f = u[0], h = u[1], d = ut(), l = ut();
87
+ f == null && (f = 0, o.replaceState(G({}, o.state, {
88
+ idx: f
89
89
  }), ""));
90
- function w(p) {
91
- return typeof p == "string" ? p : nt(p);
90
+ function y(p) {
91
+ return typeof p == "string" ? p : Yt(p);
92
92
  }
93
- function L(p, m) {
94
- return m === void 0 && (m = null), M(A({
95
- pathname: d.pathname,
93
+ function w(p, m) {
94
+ return m === void 0 && (m = null), at(G({
95
+ pathname: h.pathname,
96
96
  hash: "",
97
97
  search: ""
98
- }, typeof p == "string" ? rt(p) : p, {
98
+ }, typeof p == "string" ? Bt(p) : p, {
99
99
  state: m,
100
- key: et()
100
+ key: zt()
101
101
  }));
102
102
  }
103
- function k(p, m) {
103
+ function S(p, m) {
104
104
  return [{
105
105
  usr: p.state,
106
106
  key: p.key,
107
107
  idx: m
108
- }, w(p)];
108
+ }, y(p)];
109
109
  }
110
- function R(p, m, y) {
111
- return !h.length || (h.call({
110
+ function v(p, m, _) {
111
+ return !l.length || (l.call({
112
112
  action: p,
113
113
  location: m,
114
- retry: y
114
+ retry: _
115
115
  }), !1);
116
116
  }
117
- function _(p) {
118
- e = p;
119
- var m = o();
120
- u = m[0], d = m[1], f.call({
121
- action: e,
122
- location: d
117
+ function A(p) {
118
+ s = p;
119
+ var m = i();
120
+ f = m[0], h = m[1], d.call({
121
+ action: s,
122
+ location: h
123
123
  });
124
124
  }
125
- function W(p, m) {
126
- var y = O.Push, b = L(p, m);
127
- function P() {
128
- W(p, m);
125
+ function ot(p, m) {
126
+ var _ = j.Push, x = w(p, m);
127
+ function O() {
128
+ ot(p, m);
129
129
  }
130
- if (R(y, b, P)) {
131
- var E = k(b, u + 1), x = E[0], N = E[1];
130
+ if (v(_, x, O)) {
131
+ var T = S(x, f + 1), Y = T[0], C = T[1];
132
132
  try {
133
- i.pushState(x, "", N);
133
+ o.pushState(Y, "", C);
134
134
  } catch {
135
- r.location.assign(N);
135
+ n.location.assign(C);
136
136
  }
137
- _(y);
137
+ A(_);
138
138
  }
139
139
  }
140
- function D(p, m) {
141
- var y = O.Replace, b = L(p, m);
142
- function P() {
143
- D(p, m);
140
+ function it(p, m) {
141
+ var _ = j.Replace, x = w(p, m);
142
+ function O() {
143
+ it(p, m);
144
144
  }
145
- if (R(y, b, P)) {
146
- var E = k(b, u), x = E[0], N = E[1];
147
- i.replaceState(x, "", N), _(y);
145
+ if (v(_, x, O)) {
146
+ var T = S(x, f), Y = T[0], C = T[1];
147
+ o.replaceState(Y, "", C), A(_);
148
148
  }
149
149
  }
150
- function j(p) {
151
- i.go(p);
150
+ function U(p) {
151
+ o.go(p);
152
152
  }
153
- var V = {
153
+ var qt = {
154
154
  get action() {
155
- return e;
155
+ return s;
156
156
  },
157
157
  get location() {
158
- return d;
158
+ return h;
159
159
  },
160
- createHref: w,
161
- push: W,
162
- replace: D,
163
- go: j,
160
+ createHref: y,
161
+ push: ot,
162
+ replace: it,
163
+ go: U,
164
164
  back: function() {
165
- j(-1);
165
+ U(-1);
166
166
  },
167
167
  forward: function() {
168
- j(1);
168
+ U(1);
169
169
  },
170
170
  listen: function(m) {
171
- return f.push(m);
171
+ return d.push(m);
172
172
  },
173
173
  block: function(m) {
174
- var y = h.push(m);
175
- return h.length === 1 && r.addEventListener(z, H), function() {
176
- y(), h.length || r.removeEventListener(z, H);
174
+ var _ = l.push(m);
175
+ return l.length === 1 && n.addEventListener(st, ct), function() {
176
+ _(), l.length || n.removeEventListener(st, ct);
177
177
  };
178
178
  }
179
179
  };
180
- return V;
180
+ return qt;
181
181
  }
182
- function H(t) {
182
+ function ct(t) {
183
183
  t.preventDefault(), t.returnValue = "";
184
184
  }
185
- function I() {
185
+ function ut() {
186
186
  var t = [];
187
187
  return {
188
188
  get length() {
189
189
  return t.length;
190
190
  },
191
- push: function(n) {
192
- return t.push(n), function() {
193
- t = t.filter(function(r) {
194
- return r !== n;
191
+ push: function(e) {
192
+ return t.push(e), function() {
193
+ t = t.filter(function(n) {
194
+ return n !== e;
195
195
  });
196
196
  };
197
197
  },
198
- call: function(n) {
199
- t.forEach(function(r) {
200
- return r && r(n);
198
+ call: function(e) {
199
+ t.forEach(function(n) {
200
+ return n && n(e);
201
201
  });
202
202
  }
203
203
  };
204
204
  }
205
- function et() {
205
+ function zt() {
206
206
  return Math.random().toString(36).substr(2, 8);
207
207
  }
208
- function nt(t) {
209
- var a = t.pathname, n = a === void 0 ? "/" : a, r = t.search, i = r === void 0 ? "" : r, o = t.hash, c = o === void 0 ? "" : o;
210
- return i && i !== "?" && (n += i.charAt(0) === "?" ? i : "?" + i), c && c !== "#" && (n += c.charAt(0) === "#" ? c : "#" + c), n;
208
+ function Yt(t) {
209
+ var r = t.pathname, e = r === void 0 ? "/" : r, n = t.search, o = n === void 0 ? "" : n, i = t.hash, a = i === void 0 ? "" : i;
210
+ return o && o !== "?" && (e += o.charAt(0) === "?" ? o : "?" + o), a && a !== "#" && (e += a.charAt(0) === "#" ? a : "#" + a), e;
211
+ }
212
+ function Bt(t) {
213
+ var r = {};
214
+ if (t) {
215
+ var e = t.indexOf("#");
216
+ e >= 0 && (r.hash = t.substr(e), t = t.substr(0, e));
217
+ var n = t.indexOf("?");
218
+ n >= 0 && (r.search = t.substr(n), t = t.substr(0, n)), t && (r.pathname = t);
219
+ }
220
+ return r;
221
+ }
222
+ var Q = function(t, r) {
223
+ return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
224
+ e.__proto__ = n;
225
+ } || function(e, n) {
226
+ for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
227
+ }, Q(t, r);
228
+ };
229
+ function N(t, r) {
230
+ if (typeof r != "function" && r !== null)
231
+ throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
232
+ Q(t, r);
233
+ function e() {
234
+ this.constructor = t;
235
+ }
236
+ t.prototype = r === null ? Object.create(r) : (e.prototype = r.prototype, new e());
211
237
  }
212
- function rt(t) {
213
- var a = {};
238
+ function Jt(t, r, e, n) {
239
+ function o(i) {
240
+ return i instanceof e ? i : new e(function(a) {
241
+ a(i);
242
+ });
243
+ }
244
+ return new (e || (e = Promise))(function(i, a) {
245
+ function c(f) {
246
+ try {
247
+ u(n.next(f));
248
+ } catch (h) {
249
+ a(h);
250
+ }
251
+ }
252
+ function s(f) {
253
+ try {
254
+ u(n.throw(f));
255
+ } catch (h) {
256
+ a(h);
257
+ }
258
+ }
259
+ function u(f) {
260
+ f.done ? i(f.value) : o(f.value).then(c, s);
261
+ }
262
+ u((n = n.apply(t, r || [])).next());
263
+ });
264
+ }
265
+ function vt(t, r) {
266
+ var e = { label: 0, sent: function() {
267
+ if (i[0] & 1) throw i[1];
268
+ return i[1];
269
+ }, trys: [], ops: [] }, n, o, i, a = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
270
+ return a.next = c(0), a.throw = c(1), a.return = c(2), typeof Symbol == "function" && (a[Symbol.iterator] = function() {
271
+ return this;
272
+ }), a;
273
+ function c(u) {
274
+ return function(f) {
275
+ return s([u, f]);
276
+ };
277
+ }
278
+ function s(u) {
279
+ if (n) throw new TypeError("Generator is already executing.");
280
+ for (; a && (a = 0, u[0] && (e = 0)), e; ) try {
281
+ if (n = 1, o && (i = u[0] & 2 ? o.return : u[0] ? o.throw || ((i = o.return) && i.call(o), 0) : o.next) && !(i = i.call(o, u[1])).done) return i;
282
+ switch (o = 0, i && (u = [u[0] & 2, i.value]), u[0]) {
283
+ case 0:
284
+ case 1:
285
+ i = u;
286
+ break;
287
+ case 4:
288
+ return e.label++, { value: u[1], done: !1 };
289
+ case 5:
290
+ e.label++, o = u[1], u = [0];
291
+ continue;
292
+ case 7:
293
+ u = e.ops.pop(), e.trys.pop();
294
+ continue;
295
+ default:
296
+ if (i = e.trys, !(i = i.length > 0 && i[i.length - 1]) && (u[0] === 6 || u[0] === 2)) {
297
+ e = 0;
298
+ continue;
299
+ }
300
+ if (u[0] === 3 && (!i || u[1] > i[0] && u[1] < i[3])) {
301
+ e.label = u[1];
302
+ break;
303
+ }
304
+ if (u[0] === 6 && e.label < i[1]) {
305
+ e.label = i[1], i = u;
306
+ break;
307
+ }
308
+ if (i && e.label < i[2]) {
309
+ e.label = i[2], e.ops.push(u);
310
+ break;
311
+ }
312
+ i[2] && e.ops.pop(), e.trys.pop();
313
+ continue;
314
+ }
315
+ u = r.call(t, e);
316
+ } catch (f) {
317
+ u = [6, f], o = 0;
318
+ } finally {
319
+ n = i = 0;
320
+ }
321
+ if (u[0] & 5) throw u[1];
322
+ return { value: u[0] ? u[1] : void 0, done: !0 };
323
+ }
324
+ }
325
+ function L(t) {
326
+ var r = typeof Symbol == "function" && Symbol.iterator, e = r && t[r], n = 0;
327
+ if (e) return e.call(t);
328
+ if (t && typeof t.length == "number") return {
329
+ next: function() {
330
+ return t && n >= t.length && (t = void 0), { value: t && t[n++], done: !t };
331
+ }
332
+ };
333
+ throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined.");
334
+ }
335
+ function X(t, r) {
336
+ var e = typeof Symbol == "function" && t[Symbol.iterator];
337
+ if (!e) return t;
338
+ var n = e.call(t), o, i = [], a;
339
+ try {
340
+ for (; (r === void 0 || r-- > 0) && !(o = n.next()).done; ) i.push(o.value);
341
+ } catch (c) {
342
+ a = { error: c };
343
+ } finally {
344
+ try {
345
+ o && !o.done && (e = n.return) && e.call(n);
346
+ } finally {
347
+ if (a) throw a.error;
348
+ }
349
+ }
350
+ return i;
351
+ }
352
+ function Z(t, r, e) {
353
+ if (e || arguments.length === 2) for (var n = 0, o = r.length, i; n < o; n++)
354
+ (i || !(n in r)) && (i || (i = Array.prototype.slice.call(r, 0, n)), i[n] = r[n]);
355
+ return t.concat(i || Array.prototype.slice.call(r));
356
+ }
357
+ function k(t) {
358
+ return this instanceof k ? (this.v = t, this) : new k(t);
359
+ }
360
+ function Kt(t, r, e) {
361
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
362
+ var n = e.apply(t, r || []), o, i = [];
363
+ return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), c("next"), c("throw"), c("return", a), o[Symbol.asyncIterator] = function() {
364
+ return this;
365
+ }, o;
366
+ function a(l) {
367
+ return function(y) {
368
+ return Promise.resolve(y).then(l, h);
369
+ };
370
+ }
371
+ function c(l, y) {
372
+ n[l] && (o[l] = function(w) {
373
+ return new Promise(function(S, v) {
374
+ i.push([l, w, S, v]) > 1 || s(l, w);
375
+ });
376
+ }, y && (o[l] = y(o[l])));
377
+ }
378
+ function s(l, y) {
379
+ try {
380
+ u(n[l](y));
381
+ } catch (w) {
382
+ d(i[0][3], w);
383
+ }
384
+ }
385
+ function u(l) {
386
+ l.value instanceof k ? Promise.resolve(l.value.v).then(f, h) : d(i[0][2], l);
387
+ }
388
+ function f(l) {
389
+ s("next", l);
390
+ }
391
+ function h(l) {
392
+ s("throw", l);
393
+ }
394
+ function d(l, y) {
395
+ l(y), i.shift(), i.length && s(i[0][0], i[0][1]);
396
+ }
397
+ }
398
+ function Qt(t) {
399
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
400
+ var r = t[Symbol.asyncIterator], e;
401
+ return r ? r.call(t) : (t = typeof L == "function" ? L(t) : t[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
402
+ return this;
403
+ }, e);
404
+ function n(i) {
405
+ e[i] = t[i] && function(a) {
406
+ return new Promise(function(c, s) {
407
+ a = t[i](a), o(c, s, a.done, a.value);
408
+ });
409
+ };
410
+ }
411
+ function o(i, a, c, s) {
412
+ Promise.resolve(s).then(function(u) {
413
+ i({ value: u, done: c });
414
+ }, a);
415
+ }
416
+ }
417
+ function g(t) {
418
+ return typeof t == "function";
419
+ }
420
+ function yt(t) {
421
+ var r = function(n) {
422
+ Error.call(n), n.stack = new Error().stack;
423
+ }, e = t(r);
424
+ return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
425
+ }
426
+ var B = yt(function(t) {
427
+ return function(e) {
428
+ t(this), this.message = e ? e.length + ` errors occurred during unsubscription:
429
+ ` + e.map(function(n, o) {
430
+ return o + 1 + ") " + n.toString();
431
+ }).join(`
432
+ `) : "", this.name = "UnsubscriptionError", this.errors = e;
433
+ };
434
+ });
435
+ function tt(t, r) {
214
436
  if (t) {
215
- var n = t.indexOf("#");
216
- n >= 0 && (a.hash = t.substr(n), t = t.substr(0, n));
217
- var r = t.indexOf("?");
218
- r >= 0 && (a.search = t.substr(r), t = t.substr(0, r)), t && (a.pathname = t);
437
+ var e = t.indexOf(r);
438
+ 0 <= e && t.splice(e, 1);
219
439
  }
220
- return a;
221
440
  }
222
- const ot = tt(), v = F.proxy({
441
+ var H = function() {
442
+ function t(r) {
443
+ this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
444
+ }
445
+ return t.prototype.unsubscribe = function() {
446
+ var r, e, n, o, i;
447
+ if (!this.closed) {
448
+ this.closed = !0;
449
+ var a = this._parentage;
450
+ if (a)
451
+ if (this._parentage = null, Array.isArray(a))
452
+ try {
453
+ for (var c = L(a), s = c.next(); !s.done; s = c.next()) {
454
+ var u = s.value;
455
+ u.remove(this);
456
+ }
457
+ } catch (w) {
458
+ r = { error: w };
459
+ } finally {
460
+ try {
461
+ s && !s.done && (e = c.return) && e.call(c);
462
+ } finally {
463
+ if (r) throw r.error;
464
+ }
465
+ }
466
+ else
467
+ a.remove(this);
468
+ var f = this.initialTeardown;
469
+ if (g(f))
470
+ try {
471
+ f();
472
+ } catch (w) {
473
+ i = w instanceof B ? w.errors : [w];
474
+ }
475
+ var h = this._finalizers;
476
+ if (h) {
477
+ this._finalizers = null;
478
+ try {
479
+ for (var d = L(h), l = d.next(); !l.done; l = d.next()) {
480
+ var y = l.value;
481
+ try {
482
+ lt(y);
483
+ } catch (w) {
484
+ i = i ?? [], w instanceof B ? i = Z(Z([], X(i)), X(w.errors)) : i.push(w);
485
+ }
486
+ }
487
+ } catch (w) {
488
+ n = { error: w };
489
+ } finally {
490
+ try {
491
+ l && !l.done && (o = d.return) && o.call(d);
492
+ } finally {
493
+ if (n) throw n.error;
494
+ }
495
+ }
496
+ }
497
+ if (i)
498
+ throw new B(i);
499
+ }
500
+ }, t.prototype.add = function(r) {
501
+ var e;
502
+ if (r && r !== this)
503
+ if (this.closed)
504
+ lt(r);
505
+ else {
506
+ if (r instanceof t) {
507
+ if (r.closed || r._hasParent(this))
508
+ return;
509
+ r._addParent(this);
510
+ }
511
+ (this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(r);
512
+ }
513
+ }, t.prototype._hasParent = function(r) {
514
+ var e = this._parentage;
515
+ return e === r || Array.isArray(e) && e.includes(r);
516
+ }, t.prototype._addParent = function(r) {
517
+ var e = this._parentage;
518
+ this._parentage = Array.isArray(e) ? (e.push(r), e) : e ? [e, r] : r;
519
+ }, t.prototype._removeParent = function(r) {
520
+ var e = this._parentage;
521
+ e === r ? this._parentage = null : Array.isArray(e) && tt(e, r);
522
+ }, t.prototype.remove = function(r) {
523
+ var e = this._finalizers;
524
+ e && tt(e, r), r instanceof t && r._removeParent(this);
525
+ }, t.EMPTY = function() {
526
+ var r = new t();
527
+ return r.closed = !0, r;
528
+ }(), t;
529
+ }(), wt = H.EMPTY;
530
+ function mt(t) {
531
+ return t instanceof H || t && "closed" in t && g(t.remove) && g(t.add) && g(t.unsubscribe);
532
+ }
533
+ function lt(t) {
534
+ g(t) ? t() : t.unsubscribe();
535
+ }
536
+ var Xt = {
537
+ Promise: void 0
538
+ }, Zt = {
539
+ setTimeout: function(t, r) {
540
+ for (var e = [], n = 2; n < arguments.length; n++)
541
+ e[n - 2] = arguments[n];
542
+ return setTimeout.apply(void 0, Z([t, r], X(e)));
543
+ },
544
+ clearTimeout: function(t) {
545
+ return clearTimeout(t);
546
+ },
547
+ delegate: void 0
548
+ };
549
+ function bt(t) {
550
+ Zt.setTimeout(function() {
551
+ throw t;
552
+ });
553
+ }
554
+ function ft() {
555
+ }
556
+ function F(t) {
557
+ t();
558
+ }
559
+ var rt = function(t) {
560
+ N(r, t);
561
+ function r(e) {
562
+ var n = t.call(this) || this;
563
+ return n.isStopped = !1, e ? (n.destination = e, mt(e) && e.add(n)) : n.destination = re, n;
564
+ }
565
+ return r.create = function(e, n, o) {
566
+ return new et(e, n, o);
567
+ }, r.prototype.next = function(e) {
568
+ this.isStopped || this._next(e);
569
+ }, r.prototype.error = function(e) {
570
+ this.isStopped || (this.isStopped = !0, this._error(e));
571
+ }, r.prototype.complete = function() {
572
+ this.isStopped || (this.isStopped = !0, this._complete());
573
+ }, r.prototype.unsubscribe = function() {
574
+ this.closed || (this.isStopped = !0, t.prototype.unsubscribe.call(this), this.destination = null);
575
+ }, r.prototype._next = function(e) {
576
+ this.destination.next(e);
577
+ }, r.prototype._error = function(e) {
578
+ try {
579
+ this.destination.error(e);
580
+ } finally {
581
+ this.unsubscribe();
582
+ }
583
+ }, r.prototype._complete = function() {
584
+ try {
585
+ this.destination.complete();
586
+ } finally {
587
+ this.unsubscribe();
588
+ }
589
+ }, r;
590
+ }(H), te = function() {
591
+ function t(r) {
592
+ this.partialObserver = r;
593
+ }
594
+ return t.prototype.next = function(r) {
595
+ var e = this.partialObserver;
596
+ if (e.next)
597
+ try {
598
+ e.next(r);
599
+ } catch (n) {
600
+ q(n);
601
+ }
602
+ }, t.prototype.error = function(r) {
603
+ var e = this.partialObserver;
604
+ if (e.error)
605
+ try {
606
+ e.error(r);
607
+ } catch (n) {
608
+ q(n);
609
+ }
610
+ else
611
+ q(r);
612
+ }, t.prototype.complete = function() {
613
+ var r = this.partialObserver;
614
+ if (r.complete)
615
+ try {
616
+ r.complete();
617
+ } catch (e) {
618
+ q(e);
619
+ }
620
+ }, t;
621
+ }(), et = function(t) {
622
+ N(r, t);
623
+ function r(e, n, o) {
624
+ var i = t.call(this) || this, a;
625
+ return g(e) || !e ? a = {
626
+ next: e ?? void 0,
627
+ error: n ?? void 0,
628
+ complete: o ?? void 0
629
+ } : a = e, i.destination = new te(a), i;
630
+ }
631
+ return r;
632
+ }(rt);
633
+ function q(t) {
634
+ bt(t);
635
+ }
636
+ function ee(t) {
637
+ throw t;
638
+ }
639
+ var re = {
640
+ closed: !0,
641
+ next: ft,
642
+ error: ee,
643
+ complete: ft
644
+ }, nt = function() {
645
+ return typeof Symbol == "function" && Symbol.observable || "@@observable";
646
+ }();
647
+ function ne(t) {
648
+ return t;
649
+ }
650
+ function oe(t) {
651
+ return t.length === 0 ? ne : t.length === 1 ? t[0] : function(e) {
652
+ return t.reduce(function(n, o) {
653
+ return o(n);
654
+ }, e);
655
+ };
656
+ }
657
+ var P = function() {
658
+ function t(r) {
659
+ r && (this._subscribe = r);
660
+ }
661
+ return t.prototype.lift = function(r) {
662
+ var e = new t();
663
+ return e.source = this, e.operator = r, e;
664
+ }, t.prototype.subscribe = function(r, e, n) {
665
+ var o = this, i = ae(r) ? r : new et(r, e, n);
666
+ return F(function() {
667
+ var a = o, c = a.operator, s = a.source;
668
+ i.add(c ? c.call(i, s) : s ? o._subscribe(i) : o._trySubscribe(i));
669
+ }), i;
670
+ }, t.prototype._trySubscribe = function(r) {
671
+ try {
672
+ return this._subscribe(r);
673
+ } catch (e) {
674
+ r.error(e);
675
+ }
676
+ }, t.prototype.forEach = function(r, e) {
677
+ var n = this;
678
+ return e = ht(e), new e(function(o, i) {
679
+ var a = new et({
680
+ next: function(c) {
681
+ try {
682
+ r(c);
683
+ } catch (s) {
684
+ i(s), a.unsubscribe();
685
+ }
686
+ },
687
+ error: i,
688
+ complete: o
689
+ });
690
+ n.subscribe(a);
691
+ });
692
+ }, t.prototype._subscribe = function(r) {
693
+ var e;
694
+ return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(r);
695
+ }, t.prototype[nt] = function() {
696
+ return this;
697
+ }, t.prototype.pipe = function() {
698
+ for (var r = [], e = 0; e < arguments.length; e++)
699
+ r[e] = arguments[e];
700
+ return oe(r)(this);
701
+ }, t.prototype.toPromise = function(r) {
702
+ var e = this;
703
+ return r = ht(r), new r(function(n, o) {
704
+ var i;
705
+ e.subscribe(function(a) {
706
+ return i = a;
707
+ }, function(a) {
708
+ return o(a);
709
+ }, function() {
710
+ return n(i);
711
+ });
712
+ });
713
+ }, t.create = function(r) {
714
+ return new t(r);
715
+ }, t;
716
+ }();
717
+ function ht(t) {
718
+ var r;
719
+ return (r = t ?? Xt.Promise) !== null && r !== void 0 ? r : Promise;
720
+ }
721
+ function ie(t) {
722
+ return t && g(t.next) && g(t.error) && g(t.complete);
723
+ }
724
+ function ae(t) {
725
+ return t && t instanceof rt || ie(t) && mt(t);
726
+ }
727
+ function se(t) {
728
+ return g(t == null ? void 0 : t.lift);
729
+ }
730
+ function W(t) {
731
+ return function(r) {
732
+ if (se(r))
733
+ return r.lift(function(e) {
734
+ try {
735
+ return t(e, this);
736
+ } catch (n) {
737
+ this.error(n);
738
+ }
739
+ });
740
+ throw new TypeError("Unable to lift unknown Observable type");
741
+ };
742
+ }
743
+ function V(t, r, e, n, o) {
744
+ return new ce(t, r, e, n, o);
745
+ }
746
+ var ce = function(t) {
747
+ N(r, t);
748
+ function r(e, n, o, i, a, c) {
749
+ var s = t.call(this, e) || this;
750
+ return s.onFinalize = a, s.shouldUnsubscribe = c, s._next = n ? function(u) {
751
+ try {
752
+ n(u);
753
+ } catch (f) {
754
+ e.error(f);
755
+ }
756
+ } : t.prototype._next, s._error = i ? function(u) {
757
+ try {
758
+ i(u);
759
+ } catch (f) {
760
+ e.error(f);
761
+ } finally {
762
+ this.unsubscribe();
763
+ }
764
+ } : t.prototype._error, s._complete = o ? function() {
765
+ try {
766
+ o();
767
+ } catch (u) {
768
+ e.error(u);
769
+ } finally {
770
+ this.unsubscribe();
771
+ }
772
+ } : t.prototype._complete, s;
773
+ }
774
+ return r.prototype.unsubscribe = function() {
775
+ var e;
776
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
777
+ var n = this.closed;
778
+ t.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
779
+ }
780
+ }, r;
781
+ }(rt), ue = yt(function(t) {
782
+ return function() {
783
+ t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
784
+ };
785
+ }), gt = function(t) {
786
+ N(r, t);
787
+ function r() {
788
+ var e = t.call(this) || this;
789
+ return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
790
+ }
791
+ return r.prototype.lift = function(e) {
792
+ var n = new dt(this, this);
793
+ return n.operator = e, n;
794
+ }, r.prototype._throwIfClosed = function() {
795
+ if (this.closed)
796
+ throw new ue();
797
+ }, r.prototype.next = function(e) {
798
+ var n = this;
799
+ F(function() {
800
+ var o, i;
801
+ if (n._throwIfClosed(), !n.isStopped) {
802
+ n.currentObservers || (n.currentObservers = Array.from(n.observers));
803
+ try {
804
+ for (var a = L(n.currentObservers), c = a.next(); !c.done; c = a.next()) {
805
+ var s = c.value;
806
+ s.next(e);
807
+ }
808
+ } catch (u) {
809
+ o = { error: u };
810
+ } finally {
811
+ try {
812
+ c && !c.done && (i = a.return) && i.call(a);
813
+ } finally {
814
+ if (o) throw o.error;
815
+ }
816
+ }
817
+ }
818
+ });
819
+ }, r.prototype.error = function(e) {
820
+ var n = this;
821
+ F(function() {
822
+ if (n._throwIfClosed(), !n.isStopped) {
823
+ n.hasError = n.isStopped = !0, n.thrownError = e;
824
+ for (var o = n.observers; o.length; )
825
+ o.shift().error(e);
826
+ }
827
+ });
828
+ }, r.prototype.complete = function() {
829
+ var e = this;
830
+ F(function() {
831
+ if (e._throwIfClosed(), !e.isStopped) {
832
+ e.isStopped = !0;
833
+ for (var n = e.observers; n.length; )
834
+ n.shift().complete();
835
+ }
836
+ });
837
+ }, r.prototype.unsubscribe = function() {
838
+ this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
839
+ }, Object.defineProperty(r.prototype, "observed", {
840
+ get: function() {
841
+ var e;
842
+ return ((e = this.observers) === null || e === void 0 ? void 0 : e.length) > 0;
843
+ },
844
+ enumerable: !1,
845
+ configurable: !0
846
+ }), r.prototype._trySubscribe = function(e) {
847
+ return this._throwIfClosed(), t.prototype._trySubscribe.call(this, e);
848
+ }, r.prototype._subscribe = function(e) {
849
+ return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
850
+ }, r.prototype._innerSubscribe = function(e) {
851
+ var n = this, o = this, i = o.hasError, a = o.isStopped, c = o.observers;
852
+ return i || a ? wt : (this.currentObservers = null, c.push(e), new H(function() {
853
+ n.currentObservers = null, tt(c, e);
854
+ }));
855
+ }, r.prototype._checkFinalizedStatuses = function(e) {
856
+ var n = this, o = n.hasError, i = n.thrownError, a = n.isStopped;
857
+ o ? e.error(i) : a && e.complete();
858
+ }, r.prototype.asObservable = function() {
859
+ var e = new P();
860
+ return e.source = this, e;
861
+ }, r.create = function(e, n) {
862
+ return new dt(e, n);
863
+ }, r;
864
+ }(P), dt = function(t) {
865
+ N(r, t);
866
+ function r(e, n) {
867
+ var o = t.call(this) || this;
868
+ return o.destination = e, o.source = n, o;
869
+ }
870
+ return r.prototype.next = function(e) {
871
+ var n, o;
872
+ (o = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || o === void 0 || o.call(n, e);
873
+ }, r.prototype.error = function(e) {
874
+ var n, o;
875
+ (o = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || o === void 0 || o.call(n, e);
876
+ }, r.prototype.complete = function() {
877
+ var e, n;
878
+ (n = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || n === void 0 || n.call(e);
879
+ }, r.prototype._subscribe = function(e) {
880
+ var n, o;
881
+ return (o = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(e)) !== null && o !== void 0 ? o : wt;
882
+ }, r;
883
+ }(gt), St = function(t) {
884
+ return t && typeof t.length == "number" && typeof t != "function";
885
+ };
886
+ function _t(t) {
887
+ return g(t == null ? void 0 : t.then);
888
+ }
889
+ function Et(t) {
890
+ return g(t[nt]);
891
+ }
892
+ function Ot(t) {
893
+ return Symbol.asyncIterator && g(t == null ? void 0 : t[Symbol.asyncIterator]);
894
+ }
895
+ function Pt(t) {
896
+ return new TypeError("You provided " + (t !== null && typeof t == "object" ? "an invalid object" : "'" + t + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
897
+ }
898
+ function le() {
899
+ return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
900
+ }
901
+ var xt = le();
902
+ function It(t) {
903
+ return g(t == null ? void 0 : t[xt]);
904
+ }
905
+ function At(t) {
906
+ return Kt(this, arguments, function() {
907
+ var e, n, o, i;
908
+ return vt(this, function(a) {
909
+ switch (a.label) {
910
+ case 0:
911
+ e = t.getReader(), a.label = 1;
912
+ case 1:
913
+ a.trys.push([1, , 9, 10]), a.label = 2;
914
+ case 2:
915
+ return [4, k(e.read())];
916
+ case 3:
917
+ return n = a.sent(), o = n.value, i = n.done, i ? [4, k(void 0)] : [3, 5];
918
+ case 4:
919
+ return [2, a.sent()];
920
+ case 5:
921
+ return [4, k(o)];
922
+ case 6:
923
+ return [4, a.sent()];
924
+ case 7:
925
+ return a.sent(), [3, 2];
926
+ case 8:
927
+ return [3, 10];
928
+ case 9:
929
+ return e.releaseLock(), [7];
930
+ case 10:
931
+ return [2];
932
+ }
933
+ });
934
+ });
935
+ }
936
+ function Tt(t) {
937
+ return g(t == null ? void 0 : t.getReader);
938
+ }
939
+ function z(t) {
940
+ if (t instanceof P)
941
+ return t;
942
+ if (t != null) {
943
+ if (Et(t))
944
+ return fe(t);
945
+ if (St(t))
946
+ return he(t);
947
+ if (_t(t))
948
+ return de(t);
949
+ if (Ot(t))
950
+ return Rt(t);
951
+ if (It(t))
952
+ return pe(t);
953
+ if (Tt(t))
954
+ return ve(t);
955
+ }
956
+ throw Pt(t);
957
+ }
958
+ function fe(t) {
959
+ return new P(function(r) {
960
+ var e = t[nt]();
961
+ if (g(e.subscribe))
962
+ return e.subscribe(r);
963
+ throw new TypeError("Provided object does not correctly implement Symbol.observable");
964
+ });
965
+ }
966
+ function he(t) {
967
+ return new P(function(r) {
968
+ for (var e = 0; e < t.length && !r.closed; e++)
969
+ r.next(t[e]);
970
+ r.complete();
971
+ });
972
+ }
973
+ function de(t) {
974
+ return new P(function(r) {
975
+ t.then(function(e) {
976
+ r.closed || (r.next(e), r.complete());
977
+ }, function(e) {
978
+ return r.error(e);
979
+ }).then(null, bt);
980
+ });
981
+ }
982
+ function pe(t) {
983
+ return new P(function(r) {
984
+ var e, n;
985
+ try {
986
+ for (var o = L(t), i = o.next(); !i.done; i = o.next()) {
987
+ var a = i.value;
988
+ if (r.next(a), r.closed)
989
+ return;
990
+ }
991
+ } catch (c) {
992
+ e = { error: c };
993
+ } finally {
994
+ try {
995
+ i && !i.done && (n = o.return) && n.call(o);
996
+ } finally {
997
+ if (e) throw e.error;
998
+ }
999
+ }
1000
+ r.complete();
1001
+ });
1002
+ }
1003
+ function Rt(t) {
1004
+ return new P(function(r) {
1005
+ ye(t, r).catch(function(e) {
1006
+ return r.error(e);
1007
+ });
1008
+ });
1009
+ }
1010
+ function ve(t) {
1011
+ return Rt(At(t));
1012
+ }
1013
+ function ye(t, r) {
1014
+ var e, n, o, i;
1015
+ return Jt(this, void 0, void 0, function() {
1016
+ var a, c;
1017
+ return vt(this, function(s) {
1018
+ switch (s.label) {
1019
+ case 0:
1020
+ s.trys.push([0, 5, 6, 11]), e = Qt(t), s.label = 1;
1021
+ case 1:
1022
+ return [4, e.next()];
1023
+ case 2:
1024
+ if (n = s.sent(), !!n.done) return [3, 4];
1025
+ if (a = n.value, r.next(a), r.closed)
1026
+ return [2];
1027
+ s.label = 3;
1028
+ case 3:
1029
+ return [3, 1];
1030
+ case 4:
1031
+ return [3, 11];
1032
+ case 5:
1033
+ return c = s.sent(), o = { error: c }, [3, 11];
1034
+ case 6:
1035
+ return s.trys.push([6, , 9, 10]), n && !n.done && (i = e.return) ? [4, i.call(e)] : [3, 8];
1036
+ case 7:
1037
+ s.sent(), s.label = 8;
1038
+ case 8:
1039
+ return [3, 10];
1040
+ case 9:
1041
+ if (o) throw o.error;
1042
+ return [7];
1043
+ case 10:
1044
+ return [7];
1045
+ case 11:
1046
+ return r.complete(), [2];
1047
+ }
1048
+ });
1049
+ });
1050
+ }
1051
+ function I(t, r, e, n, o) {
1052
+ n === void 0 && (n = 0), o === void 0 && (o = !1);
1053
+ var i = r.schedule(function() {
1054
+ e(), o ? t.add(this.schedule(null, n)) : this.unsubscribe();
1055
+ }, n);
1056
+ if (t.add(i), !o)
1057
+ return i;
1058
+ }
1059
+ function jt(t, r) {
1060
+ return r === void 0 && (r = 0), W(function(e, n) {
1061
+ e.subscribe(V(n, function(o) {
1062
+ return I(n, t, function() {
1063
+ return n.next(o);
1064
+ }, r);
1065
+ }, function() {
1066
+ return I(n, t, function() {
1067
+ return n.complete();
1068
+ }, r);
1069
+ }, function(o) {
1070
+ return I(n, t, function() {
1071
+ return n.error(o);
1072
+ }, r);
1073
+ }));
1074
+ });
1075
+ }
1076
+ function kt(t, r) {
1077
+ return r === void 0 && (r = 0), W(function(e, n) {
1078
+ n.add(t.schedule(function() {
1079
+ return e.subscribe(n);
1080
+ }, r));
1081
+ });
1082
+ }
1083
+ function we(t, r) {
1084
+ return z(t).pipe(kt(r), jt(r));
1085
+ }
1086
+ function me(t, r) {
1087
+ return z(t).pipe(kt(r), jt(r));
1088
+ }
1089
+ function be(t, r) {
1090
+ return new P(function(e) {
1091
+ var n = 0;
1092
+ return r.schedule(function() {
1093
+ n === t.length ? e.complete() : (e.next(t[n++]), e.closed || this.schedule());
1094
+ });
1095
+ });
1096
+ }
1097
+ function ge(t, r) {
1098
+ return new P(function(e) {
1099
+ var n;
1100
+ return I(e, r, function() {
1101
+ n = t[xt](), I(e, r, function() {
1102
+ var o, i, a;
1103
+ try {
1104
+ o = n.next(), i = o.value, a = o.done;
1105
+ } catch (c) {
1106
+ e.error(c);
1107
+ return;
1108
+ }
1109
+ a ? e.complete() : e.next(i);
1110
+ }, 0, !0);
1111
+ }), function() {
1112
+ return g(n == null ? void 0 : n.return) && n.return();
1113
+ };
1114
+ });
1115
+ }
1116
+ function Lt(t, r) {
1117
+ if (!t)
1118
+ throw new Error("Iterable cannot be null");
1119
+ return new P(function(e) {
1120
+ I(e, r, function() {
1121
+ var n = t[Symbol.asyncIterator]();
1122
+ I(e, r, function() {
1123
+ n.next().then(function(o) {
1124
+ o.done ? e.complete() : e.next(o.value);
1125
+ });
1126
+ }, 0, !0);
1127
+ });
1128
+ });
1129
+ }
1130
+ function Se(t, r) {
1131
+ return Lt(At(t), r);
1132
+ }
1133
+ function _e(t, r) {
1134
+ if (t != null) {
1135
+ if (Et(t))
1136
+ return we(t, r);
1137
+ if (St(t))
1138
+ return be(t, r);
1139
+ if (_t(t))
1140
+ return me(t, r);
1141
+ if (Ot(t))
1142
+ return Lt(t, r);
1143
+ if (It(t))
1144
+ return ge(t, r);
1145
+ if (Tt(t))
1146
+ return Se(t, r);
1147
+ }
1148
+ throw Pt(t);
1149
+ }
1150
+ function Ee(t, r) {
1151
+ return r ? _e(t, r) : z(t);
1152
+ }
1153
+ function Oe(t, r) {
1154
+ return W(function(e, n) {
1155
+ var o = 0;
1156
+ e.subscribe(V(n, function(i) {
1157
+ return t.call(r, i, o++) && n.next(i);
1158
+ }));
1159
+ });
1160
+ }
1161
+ function Pe(t, r) {
1162
+ return W(function(e, n) {
1163
+ var o = null, i = 0, a = !1, c = function() {
1164
+ return a && !o && n.complete();
1165
+ };
1166
+ e.subscribe(V(n, function(s) {
1167
+ o == null || o.unsubscribe();
1168
+ var u = 0, f = i++;
1169
+ z(t(s, f)).subscribe(o = V(n, function(h) {
1170
+ return n.next(r ? r(s, h, f, u++) : h);
1171
+ }, function() {
1172
+ o = null, c();
1173
+ }));
1174
+ }, function() {
1175
+ a = !0, c();
1176
+ }));
1177
+ });
1178
+ }
1179
+ const xe = Wt(), Ut = new gt();
1180
+ let Nt = null;
1181
+ Ut.pipe(
1182
+ Oe((t) => t.url === Nt && !t.update ? (console.log("[NAVIGATION] Skipping duplicate navigation to", t.url), !1) : !0),
1183
+ Pe((t) => Ee(Te(t)))
1184
+ ).subscribe({
1185
+ error: (t) => console.error("[NAVIGATION] Stream error:", t)
1186
+ });
1187
+ function Ie(t) {
1188
+ Ut.next(t);
1189
+ }
1190
+ const b = pt.proxy({
223
1191
  layouts: [],
224
1192
  view: null,
225
1193
  data: null,
226
1194
  params: null,
227
1195
  urlParams: null,
228
1196
  query: null,
229
- page: g
1197
+ page: E
230
1198
  });
231
- function q(...t) {
232
- let a = t.map((n, r) => r === 0 ? n.replace(/\/+$/, "") : n.replace(/^\/+|\/+$/g, "")).join("/");
233
- return a.startsWith("/") || (a = "/" + a), a.split("?")[0];
1199
+ function M(...t) {
1200
+ let r = t.map((e, n) => n === 0 ? e.replace(/\/+$/, "") : e.replace(/^\/+|\/+$/g, "")).join("/");
1201
+ return r.startsWith("/") || (r = "/" + r), r.split("?")[0];
234
1202
  }
235
- async function at(t, a, n, r, i, o) {
1203
+ async function Ae(t, r, e, n, o, i) {
236
1204
  try {
237
- const c = typeof a == "string" && a.indexOf("assets") !== -1, l = (n.layout || []).map((d) => {
238
- let f = q(a, d).toString();
239
- return c && (f = f.endsWith(".svelte") ? f.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(f) ? f : f + ".js"), f;
1205
+ const a = typeof r == "string" && r.indexOf("assets") !== -1, c = (e.layout || []).map((h) => {
1206
+ let d = M(r, h).toString();
1207
+ return a && (d = d.endsWith(".svelte") ? d.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(d) ? d : d + ".js"), d;
240
1208
  });
241
- let e = q(a, n.view).toString();
242
- c && (e = e.endsWith(".svelte") ? e.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(e) ? e : e + ".js");
243
- const s = await Promise.all(l.map((d) => import(
1209
+ let s = M(r, e.view).toString();
1210
+ a && (s = s.endsWith(".svelte") ? s.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(s) ? s : s + ".js");
1211
+ const u = await Promise.all(c.map((h) => import(
244
1212
  /* @vite-ignore */
245
- d
246
- ).then((f) => f.default)));
247
- e.startsWith("/") || (e = "/" + e);
248
- const u = await import(
1213
+ h
1214
+ ).then((d) => d.default)));
1215
+ s.startsWith("/") || (s = "/" + s);
1216
+ const f = await import(
249
1217
  /* @vite-ignore */
250
- e
251
- ).then((d) => d.default);
252
- v.layouts = s, v.view = u, v.params = r, v.data = window.__INITIAL_DATA__, v.urlParams = i, v.query = o, Y(J, { target: t, props: v });
253
- } catch (c) {
254
- console.error("Client-side route loading failed:", c);
1218
+ s
1219
+ ).then((h) => h.default);
1220
+ b.layouts = u, b.view = f, b.params = n, b.data = window.__INITIAL_DATA__, b.urlParams = o, b.query = i, Ft(Dt, { target: t, props: b });
1221
+ } catch (a) {
1222
+ console.error("Client-side route loading failed:", a);
255
1223
  }
256
1224
  }
257
- async function U(t, a, n, r, i, o, c = !1, l = !0) {
1225
+ function $(t, r, e, n, o, i, a = !1, c = !0) {
1226
+ Ie({
1227
+ url: t,
1228
+ base_path: r,
1229
+ route: e,
1230
+ params: n,
1231
+ urlParams: o,
1232
+ query: i,
1233
+ server_loading: a,
1234
+ update: c
1235
+ });
1236
+ }
1237
+ async function Te(t) {
1238
+ const {
1239
+ url: r,
1240
+ base_path: e,
1241
+ route: n,
1242
+ params: o,
1243
+ urlParams: i,
1244
+ query: a,
1245
+ server_loading: c,
1246
+ update: s
1247
+ } = t;
1248
+ console.log("[NAVIGATION] updateRoute called", {
1249
+ url: r,
1250
+ server_loading: c,
1251
+ route_path: n.path,
1252
+ route_middleware: n.middleware
1253
+ });
258
1254
  try {
259
- const e = typeof a == "string" && a.indexOf("assets") !== -1, s = (n.layout || []).map((h) => {
260
- let w = q(a, h).toString();
261
- return e && (w = w.endsWith(".svelte") ? w.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(w) ? w : w + ".js"), w;
262
- });
263
- let u = q(a, n.view).toString();
264
- e && (u = u.endsWith(".svelte") ? u.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(u) ? u : u + ".js");
265
- const d = await Promise.all(s.map((h) => import(
266
- /* @vite-ignore */
267
- h
268
- ).then((w) => w.default))), f = await import(
269
- /* @vite-ignore */
270
- u
271
- ).then((h) => h.default);
1255
+ let u = null, f = !1;
272
1256
  if (c) {
273
- const h = {
1257
+ console.log("[NAVIGATION] Making server fetch FIRST for", r);
1258
+ const S = {
274
1259
  method: n.method,
275
1260
  headers: {
276
1261
  "Content-Type": "application/json",
277
1262
  Accept: "application/json"
278
1263
  }
279
1264
  };
280
- h[B] = !0, await fetch(t, h).then((w) => {
281
- if (w.ok)
282
- return w.json();
1265
+ if (S[Ct] = !0, await fetch(r, S).then((v) => {
1266
+ if (console.log("[NAVIGATION] Fetch response", {
1267
+ url: r,
1268
+ ok: v.ok,
1269
+ status: v.status,
1270
+ type: v.type,
1271
+ redirected: v.redirected,
1272
+ finalUrl: v.url
1273
+ }), v.redirected)
1274
+ return console.log("[NAVIGATION] Redirect detected, not loading components"), f = !0, null;
1275
+ if (v.ok)
1276
+ return v.json();
283
1277
  throw new Error("Network response was not ok");
284
- }).then((w) => {
285
- v.data = w, v.params = r, v.layouts = d, v.view = f, v.urlParams = i, v.query = o;
286
- });
287
- } else
288
- v.data = { layout: [], view: {} }, v.params = r, v.layouts = d, v.view = f, v.urlParams = i, v.query = o;
289
- window && window.scroll(0, 0), l && ot.push(t);
290
- } catch (e) {
291
- console.error("Client-side navigation failed for URL:", t, e);
1278
+ }).then((v) => {
1279
+ u = v;
1280
+ }), f) {
1281
+ console.log("[NAVIGATION] Exiting early due to redirect");
1282
+ return;
1283
+ }
1284
+ }
1285
+ const h = typeof e == "string" && e.indexOf("assets") !== -1, d = (n.layout || []).map((S) => {
1286
+ let v = M(e, S).toString();
1287
+ return h && (v = v.endsWith(".svelte") ? v.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(v) ? v : v + ".js"), v;
1288
+ });
1289
+ let l = M(e, n.view).toString();
1290
+ h && (l = l.endsWith(".svelte") ? l.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(l) ? l : l + ".js");
1291
+ const y = await Promise.all(d.map((S) => import(
1292
+ /* @vite-ignore */
1293
+ S
1294
+ ).then((v) => v.default))), w = await import(
1295
+ /* @vite-ignore */
1296
+ l
1297
+ ).then((S) => S.default);
1298
+ c ? (b.data = u, b.params = o, b.layouts = y, b.view = w, b.urlParams = i, b.query = a) : (console.log("[NAVIGATION] No server loading needed for", r), b.data = { layout: [], view: {} }, b.params = o, b.layouts = y, b.view = w, b.urlParams = i, b.query = a), window && window.scroll(0, 0), s && xe.push(r), Nt = r;
1299
+ } catch (u) {
1300
+ console.error("Client-side navigation failed for URL:", r, u);
292
1301
  }
293
1302
  }
294
- const S = F.proxy({});
295
- async function it() {
296
- Object.assign(S, window.__MANIFEST__);
1303
+ const R = pt.proxy({});
1304
+ async function Re() {
1305
+ Object.assign(R, window.__MANIFEST__);
297
1306
  }
298
- function st(t, a, n) {
1307
+ function je(t, r, e) {
299
1308
  if (!document) {
300
1309
  console.error("Document not found");
301
1310
  return;
302
1311
  }
303
- document.addEventListener("click", (r) => {
304
- var c, l;
305
- const i = window.location.pathname, o = ((c = r.target) == null ? void 0 : c.tagName) === "A" ? r.target : (l = r.target) == null ? void 0 : l.closest("A");
306
- if (o) {
307
- let e = o.getAttribute("href");
308
- if (i === e) {
309
- r.preventDefault();
1312
+ document.addEventListener("click", (n) => {
1313
+ var a, c;
1314
+ const o = window.location.pathname, i = ((a = n.target) == null ? void 0 : a.tagName) === "A" ? n.target : (c = n.target) == null ? void 0 : c.closest("A");
1315
+ if (i) {
1316
+ let s = i.getAttribute("href");
1317
+ if (o === s) {
1318
+ n.preventDefault();
310
1319
  return;
311
1320
  }
312
- if (e && e.startsWith("/") || e.startsWith(".")) {
313
- const s = e.split("?")[0], u = o.getAttribute("method") || "get", d = a.find((f) => f.method.toLowerCase() === u && n.find((h) => h.parser(s) && h.pattern === f.path));
314
- if (d) {
315
- r.preventDefault();
316
- const f = n.find((_) => _.parser(s) && _.pattern === d.path), h = (f == null ? void 0 : f.parser(s)) || {}, w = new URLSearchParams(e.split("?")[1] || ""), L = Object.fromEntries(w.entries()) || {}, k = { ...h, ...L }, R = S[f == null ? void 0 : f.pattern];
317
- U(e, t, d, k, h, L, R);
1321
+ if (s && s.startsWith("/") || s.startsWith(".")) {
1322
+ const u = s.split("?")[0], f = i.getAttribute("method") || "get", h = r.find((d) => d.method.toLowerCase() === f && e.find((l) => l.parser(u) && l.pattern === d.path));
1323
+ if (h) {
1324
+ n.preventDefault();
1325
+ const d = e.find((A) => A.parser(u) && A.pattern === h.path), l = (d == null ? void 0 : d.parser(u)) || {}, y = new URLSearchParams(s.split("?")[1] || ""), w = Object.fromEntries(y.entries()) || {}, S = { ...l, ...w }, v = R[d == null ? void 0 : d.pattern];
1326
+ console.log("[EVENTS] Navigation to", s, {
1327
+ pattern: d == null ? void 0 : d.pattern,
1328
+ requires_server_data: v,
1329
+ manifest_store: R,
1330
+ middleware: h.middleware
1331
+ }), $(s, t, h, S, l, w, v);
318
1332
  } else
319
- console.log("No matching route found for URL:", e, "- using fallback navigation");
1333
+ console.log("No matching route found for URL:", s, "- using fallback navigation");
320
1334
  }
321
1335
  }
322
- }), window.addEventListener("popstate", (r) => {
323
- const i = window.location.pathname, o = window.location.pathname + window.location.search;
324
- g.url = o, g.pathname = window.location.pathname;
325
- const c = "get", l = a.find((e) => e.method.toLowerCase() === c && n.find((s) => s.parser(i) && s.pattern === e.path));
326
- if (l) {
327
- const e = n.find((w) => w.parser(i) && w.pattern === l.path), s = (e == null ? void 0 : e.parser(i)) || {}, u = new URLSearchParams(window.location.search), d = Object.fromEntries(u.entries()) || {};
328
- g.params = s, g.query = d;
329
- const f = { ...s, ...d }, h = S[e == null ? void 0 : e.pattern];
330
- U(o, t, l, f, s, d, h, !1);
1336
+ }), window.addEventListener("popstate", (n) => {
1337
+ const o = window.location.pathname, i = window.location.pathname + window.location.search;
1338
+ E.url = i, E.pathname = window.location.pathname;
1339
+ const a = "get", c = r.find((s) => s.method.toLowerCase() === a && e.find((u) => u.parser(o) && u.pattern === s.path));
1340
+ if (c) {
1341
+ const s = e.find((y) => y.parser(o) && y.pattern === c.path), u = (s == null ? void 0 : s.parser(o)) || {}, f = new URLSearchParams(window.location.search), h = Object.fromEntries(f.entries()) || {};
1342
+ E.params = u, E.query = h;
1343
+ const d = { ...u, ...h }, l = R[s == null ? void 0 : s.pattern];
1344
+ $(i, t, c, d, u, h, l, !1);
331
1345
  } else
332
- console.log("No matching route found for popstate navigation to:", i, "- using fallback navigation"), window.location.href = i;
1346
+ console.log("No matching route found for popstate navigation to:", o, "- using fallback navigation"), window.location.href = o;
333
1347
  }), function() {
334
- const r = history.pushState, i = history.replaceState;
335
- history.pushState = function(...o) {
336
- const c = r.apply(this, o), l = new Event("pushstate");
337
- return l.state = o[0], l.url = o[2], window.dispatchEvent(l), c;
338
- }, history.replaceState = function(...o) {
339
- const c = i.apply(this, o), l = o[2], e = window.location.pathname;
340
- if ((l ? new URL(l, window.location.origin).pathname : e) !== e) {
341
- const u = new Event("replacestate");
342
- u.state = o[0], u.url = o[2], window.dispatchEvent(u);
1348
+ const n = history.pushState, o = history.replaceState;
1349
+ history.pushState = function(...i) {
1350
+ const a = n.apply(this, i), c = new Event("pushstate");
1351
+ return c.state = i[0], c.url = i[2], window.dispatchEvent(c), a;
1352
+ }, history.replaceState = function(...i) {
1353
+ const a = o.apply(this, i), c = i[2], s = window.location.pathname;
1354
+ if ((c ? new URL(c, window.location.origin).pathname : s) !== s) {
1355
+ const f = new Event("replacestate");
1356
+ f.state = i[0], f.url = i[2], window.dispatchEvent(f);
343
1357
  }
344
- return c;
1358
+ return a;
345
1359
  };
346
- }(), window.addEventListener("pushstate", (r) => {
347
- const i = r.url || window.location.pathname + window.location.search, o = i.split("?")[0], c = "get", l = a.find((e) => e.method.toLowerCase() === c && n.find((s) => s.parser(o) && s.pattern === e.path));
348
- if (l) {
349
- const e = n.find((w) => w.parser(o) && w.pattern === l.path), s = e == null ? void 0 : e.parser(o), u = new URLSearchParams(i.split("?")[1] || ""), d = Object.fromEntries(u.entries());
350
- g.url = i, g.pathname = window.location.pathname, Object.assign(g.params, s), Object.assign(g.query, d);
351
- const f = { ...s, ...d }, h = S[e == null ? void 0 : e.pattern];
352
- U(i, t, l, f, s, d, h, !1);
1360
+ }(), window.addEventListener("pushstate", (n) => {
1361
+ const o = n.url || window.location.pathname + window.location.search, i = o.split("?")[0], a = "get", c = r.find((s) => s.method.toLowerCase() === a && e.find((u) => u.parser(i) && u.pattern === s.path));
1362
+ if (c) {
1363
+ const s = e.find((y) => y.parser(i) && y.pattern === c.path), u = s == null ? void 0 : s.parser(i), f = new URLSearchParams(o.split("?")[1] || ""), h = Object.fromEntries(f.entries());
1364
+ E.url = o, E.pathname = window.location.pathname, Object.assign(E.params, u), Object.assign(E.query, h);
1365
+ const d = { ...u, ...h }, l = R[s == null ? void 0 : s.pattern];
1366
+ $(o, t, c, d, u, h, l, !1);
353
1367
  } else
354
- console.log("No matching route found for pushstate to:", o, "- using fallback navigation"), window.location.href = o;
355
- }), window.addEventListener("replacestate", (r) => {
356
- const i = r.url || window.location.pathname + window.location.search, o = i.split("?")[0];
357
- g.url = i, g.pathname = window.location.pathname, g.query = Object.fromEntries(new URLSearchParams(i.split("?")[1] || ""));
358
- const c = "get", l = a.find((e) => e.method.toLowerCase() === c && n.find((s) => s.parser(o) && s.pattern === e.path));
359
- if (l) {
360
- const e = n.find((w) => w.parser(o) && w.pattern === l.path), s = (e == null ? void 0 : e.parser(o)) || {}, u = new URLSearchParams(i.split("?")[1] || ""), d = Object.fromEntries(u.entries()) || {}, f = { ...s, ...d }, h = S[e == null ? void 0 : e.pattern];
361
- U(i, t, l, f, s, d, h, !1);
1368
+ console.log("No matching route found for pushstate to:", i, "- using fallback navigation"), window.location.href = i;
1369
+ }), window.addEventListener("replacestate", (n) => {
1370
+ const o = n.url || window.location.pathname + window.location.search, i = o.split("?")[0];
1371
+ E.url = o, E.pathname = window.location.pathname, E.query = Object.fromEntries(new URLSearchParams(o.split("?")[1] || ""));
1372
+ const a = "get", c = r.find((s) => s.method.toLowerCase() === a && e.find((u) => u.parser(i) && u.pattern === s.path));
1373
+ if (c) {
1374
+ const s = e.find((y) => y.parser(i) && y.pattern === c.path), u = (s == null ? void 0 : s.parser(i)) || {}, f = new URLSearchParams(o.split("?")[1] || ""), h = Object.fromEntries(f.entries()) || {}, d = { ...u, ...h }, l = R[s == null ? void 0 : s.pattern];
1375
+ $(o, t, c, d, u, h, l, !1);
362
1376
  } else
363
- console.log("No matching route found for replacestate to:", o, "- using fallback navigation"), window.location.href = o;
1377
+ console.log("No matching route found for replacestate to:", i, "- using fallback navigation"), window.location.href = i;
364
1378
  });
365
1379
  }
366
- const B = Symbol("forge-load-function");
367
- let $ = [], T = null;
368
- function ct(t) {
1380
+ const Ct = Symbol("forge-load-function");
1381
+ let D = [], J = null;
1382
+ function ke(t) {
369
1383
  try {
370
- const a = new URL(t, window.location.origin);
371
- return a.origin === window.location.origin && !a.pathname.startsWith("/api/");
1384
+ const r = new URL(t, window.location.origin);
1385
+ return r.origin === window.location.origin && !r.pathname.startsWith("/api/");
372
1386
  } catch {
373
1387
  return !t.startsWith("/api/");
374
1388
  }
375
1389
  }
376
- function lt() {
377
- typeof window < "u" && !T && (T = window.fetch, window.fetch = async function(t, a = {}) {
378
- let n = { ...a };
379
- for (const i of $)
1390
+ function Le() {
1391
+ typeof window < "u" && !J && (J = window.fetch, window.fetch = async function(t, r = {}) {
1392
+ let e = { ...r };
1393
+ for (const i of D)
380
1394
  try {
381
1395
  if (i.length === 2) {
382
- const o = new Headers(n.headers), c = Object.fromEntries(o.entries());
383
- await new Promise((l, e) => {
1396
+ const a = new Headers(e.headers), c = Object.fromEntries(a.entries());
1397
+ await new Promise((s, u) => {
384
1398
  try {
385
- i(c, (s) => {
386
- if (s)
387
- e(s);
1399
+ i(c, (f) => {
1400
+ if (f)
1401
+ u(f);
388
1402
  else {
389
- const u = new Headers();
390
- Object.entries(c).forEach(([d, f]) => {
391
- f !== void 0 && u.set(d, f);
392
- }), n.headers = u, l();
1403
+ const h = new Headers();
1404
+ Object.entries(c).forEach(([d, l]) => {
1405
+ l !== void 0 && h.set(d, l);
1406
+ }), e.headers = h, s();
393
1407
  }
394
1408
  });
395
- } catch (s) {
396
- e(s);
1409
+ } catch (f) {
1410
+ u(f);
397
1411
  }
398
1412
  });
399
1413
  } else {
400
- const o = await i(n, t);
401
- o && typeof o == "object" && (n = o);
1414
+ const a = await i(e, t);
1415
+ a && typeof a == "object" && (e = a);
402
1416
  }
403
- } catch (o) {
404
- throw console.error("🔴 Middleware error:", o), o;
1417
+ } catch (a) {
1418
+ throw console.error("🔴 Middleware error:", a), a;
1419
+ }
1420
+ const n = e == null ? void 0 : e[Ct];
1421
+ console.log("[FETCH OVERRIDE] Request", {
1422
+ url: t,
1423
+ hasForgeSymbol: n,
1424
+ headers: e == null ? void 0 : e.headers
1425
+ });
1426
+ const o = await J(t, e);
1427
+ if (console.log("[FETCH OVERRIDE] Response", {
1428
+ url: t,
1429
+ responseUrl: o.url,
1430
+ redirected: o.redirected,
1431
+ status: o.status,
1432
+ type: o.type,
1433
+ hasForgeSymbol: n
1434
+ }), n && o.redirected) {
1435
+ const i = typeof t == "string" ? t : t.url, a = o.url;
1436
+ if (console.log("[FORGE REDIRECT] Detected redirect", {
1437
+ requested: i,
1438
+ final: a,
1439
+ redirected: o.redirected
1440
+ }), ke(a)) {
1441
+ const c = new URL(a), s = c.pathname + c.search;
1442
+ return console.log("[FORGE REDIRECT] Using pushState for SPA navigation to:", s, "from:", a), history.pushState(null, "", s), new Response(JSON.stringify({ layout: [], view: {} }), {
1443
+ status: 200,
1444
+ headers: { "Content-Type": "application/json" }
1445
+ });
405
1446
  }
406
- const r = await T(t, n);
407
- if (r.status >= 300 && r.status < 400 && a[B]) {
408
- const i = r.headers.get("location");
409
- if (i && ct(i))
410
- return window.location.href = i, r;
411
1447
  }
412
- return r;
1448
+ return o;
413
1449
  });
414
1450
  }
415
- lt();
416
- const ht = {
1451
+ Le();
1452
+ const $e = {
417
1453
  /**
418
1454
  * Add middleware to the fetch pipeline
419
1455
  */
420
1456
  configUpdate(t) {
421
1457
  if (typeof t != "function")
422
1458
  throw new Error("Middleware must be a function");
423
- $.push(t);
1459
+ D.push(t);
424
1460
  },
425
1461
  /**
426
1462
  * Reset all middleware
427
1463
  */
428
1464
  reset() {
429
- $.length = 0;
1465
+ D.length = 0;
430
1466
  },
431
1467
  /**
432
1468
  * Get current middleware count (for debugging)
433
1469
  */
434
1470
  getMiddlewareCount() {
435
- return $.length;
1471
+ return D.length;
436
1472
  }
437
1473
  };
438
- let C;
439
- async function wt(t, a) {
440
- let n = window.__COMPONENT_DIR__ || a.component_dir;
441
- if (!n && typeof n != "string")
1474
+ let K;
1475
+ async function Fe(t, r) {
1476
+ let e = window.__COMPONENT_DIR__ || r.component_dir;
1477
+ if (!e && typeof e != "string")
442
1478
  throw new Error("No component directory provided");
443
- let r = window.__ROUTING__;
444
- if (C = Q(r), window && window.location) {
445
- const i = (window.location.pathname || "/").split("?")[0], o = C.find((l) => l.parser(i));
446
- let c = o ? r.find((l) => l.path === o.pattern) : null;
447
- if (o && c) {
448
- const l = o.parser(i) || {}, e = new URLSearchParams(window.location.search), s = Object.fromEntries(e.entries()) || {}, u = { ...l, ...s };
449
- it(), at(t, n, c, u, l, s), st(n, r, C);
1479
+ let n = window.__ROUTING__;
1480
+ if (K = Vt(n), window && window.location) {
1481
+ const o = (window.location.pathname || "/").split("?")[0], i = K.find((c) => c.parser(o));
1482
+ let a = i ? n.find((c) => c.path === i.pattern) : null;
1483
+ if (i && a) {
1484
+ const c = i.parser(o) || {}, s = new URLSearchParams(window.location.search), u = Object.fromEntries(s.entries()) || {}, f = { ...c, ...u };
1485
+ Re(), Ae(t, e, a, f, c, u), je(e, n, K);
450
1486
  } else
451
- console.warn("No matching route found for:", i);
1487
+ console.warn("No matching route found for:", o);
452
1488
  }
453
1489
  }
454
1490
  export {
455
- S as MANIFEST_STORE,
456
- st as bootstrap_events,
457
- wt as createApp,
458
- ht as fetch,
459
- at as loadRoute,
460
- g as page,
461
- yt as shadowUrl,
462
- it as updateManifestStore,
463
- U as updateRoute
1491
+ R as MANIFEST_STORE,
1492
+ je as bootstrap_events,
1493
+ Fe as createApp,
1494
+ $e as fetch,
1495
+ Ae as loadRoute,
1496
+ E as page,
1497
+ Ve as shadowUrl,
1498
+ Re as updateManifestStore,
1499
+ $ as updateRoute
464
1500
  };
465
1501
  //# sourceMappingURL=client.mjs.map