@noego/forge 0.0.22 → 0.0.23
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.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +206 -212
- package/dist/client.mjs.map +1 -1
- package/dist/plugins-cjs/routing/html_render/html_render.js +90 -2
- package/dist/plugins-cjs/routing/html_render/html_render.js.map +1 -1
- package/dist/plugins-es/routing/html_render/html_render.js +90 -2
- package/dist/plugins-es/routing/html_render/html_render.js.map +1 -1
- package/dist/routing/html_render/html_render.js +90 -2
- package/dist/routing/html_render/html_render.js.map +1 -1
- package/dist-ssr/server.cjs +80 -2
- package/dist-ssr/server.cjs.map +1 -1
- package/dist-ssr/server.js +80 -2
- package/dist-ssr/server.js.map +1 -1
- package/package.json +1 -1
package/dist/client.mjs
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { p as G, a as
|
|
2
|
-
import { s as
|
|
3
|
-
import * as
|
|
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
4
|
import { hydrate as Y } from "svelte";
|
|
5
5
|
import J from "../src/components/RecursiveRender.svelte";
|
|
6
6
|
function K(t) {
|
|
7
|
-
const
|
|
8
|
-
return (n) =>
|
|
7
|
+
const a = new G(t);
|
|
8
|
+
return (n) => a.match(n) || null;
|
|
9
9
|
}
|
|
10
10
|
function Q(t) {
|
|
11
|
-
return t.map((
|
|
12
|
-
const n =
|
|
13
|
-
return { pattern: n, parser:
|
|
11
|
+
return t.map((a) => {
|
|
12
|
+
const n = a.path, r = K(n);
|
|
13
|
+
return { pattern: n, parser: r };
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
18
|
-
for (var
|
|
19
|
-
var n = arguments[
|
|
20
|
-
for (var
|
|
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]);
|
|
21
21
|
}
|
|
22
22
|
return t;
|
|
23
|
-
},
|
|
23
|
+
}, A.apply(null, arguments);
|
|
24
24
|
}
|
|
25
25
|
var O;
|
|
26
26
|
(function(t) {
|
|
27
27
|
t.Pop = "POP", t.Push = "PUSH", t.Replace = "REPLACE";
|
|
28
28
|
})(O || (O = {}));
|
|
29
|
-
var
|
|
29
|
+
var M = 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,
|
|
34
|
+
function X(t, a) {
|
|
35
35
|
{
|
|
36
|
-
typeof console < "u" && console.warn(
|
|
36
|
+
typeof console < "u" && console.warn(a);
|
|
37
37
|
try {
|
|
38
|
-
throw new Error(
|
|
38
|
+
throw new Error(a);
|
|
39
39
|
} catch {
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var z = "beforeunload", Z = "popstate";
|
|
44
44
|
function tt(t) {
|
|
45
45
|
t === void 0 && (t = {});
|
|
46
|
-
var
|
|
47
|
-
function
|
|
48
|
-
var
|
|
49
|
-
return [P.idx,
|
|
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({
|
|
50
50
|
pathname: m,
|
|
51
|
-
search:
|
|
51
|
+
search: y,
|
|
52
52
|
hash: b,
|
|
53
53
|
state: P.usr || null,
|
|
54
54
|
key: P.key || "default"
|
|
@@ -57,19 +57,19 @@ function tt(t) {
|
|
|
57
57
|
var c = null;
|
|
58
58
|
function l() {
|
|
59
59
|
if (c)
|
|
60
|
-
|
|
60
|
+
h.call(c), c = null;
|
|
61
61
|
else {
|
|
62
|
-
var
|
|
63
|
-
if (
|
|
64
|
-
if (
|
|
65
|
-
var P = u -
|
|
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
66
|
P && (c = {
|
|
67
|
-
action:
|
|
67
|
+
action: p,
|
|
68
68
|
location: b,
|
|
69
69
|
retry: function() {
|
|
70
|
-
|
|
70
|
+
j(P * -1);
|
|
71
71
|
}
|
|
72
|
-
},
|
|
72
|
+
}, j(P));
|
|
73
73
|
} else
|
|
74
74
|
process.env.NODE_ENV !== "production" && X(
|
|
75
75
|
!1,
|
|
@@ -79,110 +79,110 @@ 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
|
-
|
|
82
|
+
_(p);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
var e = O.Pop, s =
|
|
87
|
-
u == null && (u = 0,
|
|
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
88
|
idx: u
|
|
89
89
|
}), ""));
|
|
90
|
-
function
|
|
91
|
-
return typeof
|
|
90
|
+
function w(p) {
|
|
91
|
+
return typeof p == "string" ? p : nt(p);
|
|
92
92
|
}
|
|
93
|
-
function L(
|
|
94
|
-
return m === void 0 && (m = null),
|
|
95
|
-
pathname:
|
|
93
|
+
function L(p, m) {
|
|
94
|
+
return m === void 0 && (m = null), M(A({
|
|
95
|
+
pathname: d.pathname,
|
|
96
96
|
hash: "",
|
|
97
97
|
search: ""
|
|
98
|
-
}, typeof
|
|
98
|
+
}, typeof p == "string" ? rt(p) : p, {
|
|
99
99
|
state: m,
|
|
100
100
|
key: et()
|
|
101
101
|
}));
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function k(p, m) {
|
|
104
104
|
return [{
|
|
105
|
-
usr:
|
|
106
|
-
key:
|
|
105
|
+
usr: p.state,
|
|
106
|
+
key: p.key,
|
|
107
107
|
idx: m
|
|
108
|
-
},
|
|
108
|
+
}, w(p)];
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return !
|
|
112
|
-
action:
|
|
110
|
+
function R(p, m, y) {
|
|
111
|
+
return !h.length || (h.call({
|
|
112
|
+
action: p,
|
|
113
113
|
location: m,
|
|
114
|
-
retry:
|
|
114
|
+
retry: y
|
|
115
115
|
}), !1);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
e =
|
|
119
|
-
var m =
|
|
120
|
-
u = m[0],
|
|
117
|
+
function _(p) {
|
|
118
|
+
e = p;
|
|
119
|
+
var m = o();
|
|
120
|
+
u = m[0], d = m[1], f.call({
|
|
121
121
|
action: e,
|
|
122
|
-
location:
|
|
122
|
+
location: d
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
var
|
|
125
|
+
function W(p, m) {
|
|
126
|
+
var y = O.Push, b = L(p, m);
|
|
127
127
|
function P() {
|
|
128
|
-
|
|
128
|
+
W(p, m);
|
|
129
129
|
}
|
|
130
|
-
if (
|
|
131
|
-
var
|
|
130
|
+
if (R(y, b, P)) {
|
|
131
|
+
var E = k(b, u + 1), x = E[0], N = E[1];
|
|
132
132
|
try {
|
|
133
|
-
|
|
133
|
+
i.pushState(x, "", N);
|
|
134
134
|
} catch {
|
|
135
|
-
|
|
135
|
+
r.location.assign(N);
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
_(y);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
var
|
|
140
|
+
function D(p, m) {
|
|
141
|
+
var y = O.Replace, b = L(p, m);
|
|
142
142
|
function P() {
|
|
143
|
-
|
|
143
|
+
D(p, m);
|
|
144
144
|
}
|
|
145
|
-
if (
|
|
146
|
-
var
|
|
147
|
-
|
|
145
|
+
if (R(y, b, P)) {
|
|
146
|
+
var E = k(b, u), x = E[0], N = E[1];
|
|
147
|
+
i.replaceState(x, "", N), _(y);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
150
|
+
function j(p) {
|
|
151
|
+
i.go(p);
|
|
152
152
|
}
|
|
153
153
|
var V = {
|
|
154
154
|
get action() {
|
|
155
155
|
return e;
|
|
156
156
|
},
|
|
157
157
|
get location() {
|
|
158
|
-
return
|
|
158
|
+
return d;
|
|
159
159
|
},
|
|
160
|
-
createHref:
|
|
161
|
-
push:
|
|
162
|
-
replace:
|
|
163
|
-
go:
|
|
160
|
+
createHref: w,
|
|
161
|
+
push: W,
|
|
162
|
+
replace: D,
|
|
163
|
+
go: j,
|
|
164
164
|
back: function() {
|
|
165
|
-
|
|
165
|
+
j(-1);
|
|
166
166
|
},
|
|
167
167
|
forward: function() {
|
|
168
|
-
|
|
168
|
+
j(1);
|
|
169
169
|
},
|
|
170
170
|
listen: function(m) {
|
|
171
171
|
return f.push(m);
|
|
172
172
|
},
|
|
173
173
|
block: function(m) {
|
|
174
|
-
var
|
|
175
|
-
return
|
|
176
|
-
|
|
174
|
+
var y = h.push(m);
|
|
175
|
+
return h.length === 1 && r.addEventListener(z, H), function() {
|
|
176
|
+
y(), h.length || r.removeEventListener(z, H);
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
180
|
return V;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function H(t) {
|
|
183
183
|
t.preventDefault(), t.returnValue = "";
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function I() {
|
|
186
186
|
var t = [];
|
|
187
187
|
return {
|
|
188
188
|
get length() {
|
|
@@ -190,14 +190,14 @@ function F() {
|
|
|
190
190
|
},
|
|
191
191
|
push: function(n) {
|
|
192
192
|
return t.push(n), function() {
|
|
193
|
-
t = t.filter(function(
|
|
194
|
-
return
|
|
193
|
+
t = t.filter(function(r) {
|
|
194
|
+
return r !== n;
|
|
195
195
|
});
|
|
196
196
|
};
|
|
197
197
|
},
|
|
198
198
|
call: function(n) {
|
|
199
|
-
t.forEach(function(
|
|
200
|
-
return
|
|
199
|
+
t.forEach(function(r) {
|
|
200
|
+
return r && r(n);
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
};
|
|
@@ -206,190 +206,189 @@ function et() {
|
|
|
206
206
|
return Math.random().toString(36).substr(2, 8);
|
|
207
207
|
}
|
|
208
208
|
function nt(t) {
|
|
209
|
-
var
|
|
210
|
-
return
|
|
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;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
var
|
|
212
|
+
function rt(t) {
|
|
213
|
+
var a = {};
|
|
214
214
|
if (t) {
|
|
215
215
|
var n = t.indexOf("#");
|
|
216
|
-
n >= 0 && (
|
|
217
|
-
var
|
|
218
|
-
|
|
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);
|
|
219
219
|
}
|
|
220
|
-
return
|
|
220
|
+
return a;
|
|
221
221
|
}
|
|
222
|
-
const
|
|
222
|
+
const ot = tt(), v = F.proxy({
|
|
223
223
|
layouts: [],
|
|
224
224
|
view: null,
|
|
225
225
|
data: null,
|
|
226
226
|
params: null,
|
|
227
227
|
urlParams: null,
|
|
228
228
|
query: null,
|
|
229
|
-
page:
|
|
229
|
+
page: g
|
|
230
230
|
});
|
|
231
|
-
function
|
|
232
|
-
let
|
|
233
|
-
return
|
|
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];
|
|
234
234
|
}
|
|
235
|
-
async function at(t,
|
|
235
|
+
async function at(t, a, n, r, i, o) {
|
|
236
236
|
try {
|
|
237
|
-
const c = typeof
|
|
238
|
-
let f =
|
|
237
|
+
const c = typeof a == "string" && a.indexOf("assets") !== -1, l = (n.layout || []).map((d) => {
|
|
238
|
+
let f = q(a, d).toString();
|
|
239
239
|
return c && (f = f.endsWith(".svelte") ? f.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(f) ? f : f + ".js"), f;
|
|
240
240
|
});
|
|
241
|
-
let e =
|
|
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((
|
|
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(
|
|
244
244
|
/* @vite-ignore */
|
|
245
|
-
|
|
245
|
+
d
|
|
246
246
|
).then((f) => f.default)));
|
|
247
247
|
e.startsWith("/") || (e = "/" + e);
|
|
248
248
|
const u = await import(
|
|
249
249
|
/* @vite-ignore */
|
|
250
250
|
e
|
|
251
|
-
).then((
|
|
252
|
-
|
|
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
253
|
} catch (c) {
|
|
254
254
|
console.error("Client-side route loading failed:", c);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
async function U(t,
|
|
257
|
+
async function U(t, a, n, r, i, o, c = !1, l = !0) {
|
|
258
258
|
try {
|
|
259
|
-
const e = typeof
|
|
260
|
-
let
|
|
261
|
-
return e && (
|
|
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
262
|
});
|
|
263
|
-
let u =
|
|
263
|
+
let u = q(a, n.view).toString();
|
|
264
264
|
e && (u = u.endsWith(".svelte") ? u.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(u) ? u : u + ".js");
|
|
265
|
-
const
|
|
265
|
+
const d = await Promise.all(s.map((h) => import(
|
|
266
266
|
/* @vite-ignore */
|
|
267
|
-
|
|
268
|
-
).then((
|
|
267
|
+
h
|
|
268
|
+
).then((w) => w.default))), f = await import(
|
|
269
269
|
/* @vite-ignore */
|
|
270
270
|
u
|
|
271
|
-
).then((
|
|
271
|
+
).then((h) => h.default);
|
|
272
272
|
if (c) {
|
|
273
|
-
const
|
|
273
|
+
const h = {
|
|
274
274
|
method: n.method,
|
|
275
275
|
headers: {
|
|
276
276
|
"Content-Type": "application/json",
|
|
277
277
|
Accept: "application/json"
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
|
-
|
|
281
|
-
if (
|
|
282
|
-
return
|
|
280
|
+
h[B] = !0, await fetch(t, h).then((w) => {
|
|
281
|
+
if (w.ok)
|
|
282
|
+
return w.json();
|
|
283
283
|
throw new Error("Network response was not ok");
|
|
284
|
-
}).then((
|
|
285
|
-
|
|
284
|
+
}).then((w) => {
|
|
285
|
+
v.data = w, v.params = r, v.layouts = d, v.view = f, v.urlParams = i, v.query = o;
|
|
286
286
|
});
|
|
287
287
|
} else
|
|
288
|
-
|
|
289
|
-
window && window.scroll(0, 0), l &&
|
|
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
290
|
} catch (e) {
|
|
291
291
|
console.error("Client-side navigation failed for URL:", t, e);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
const
|
|
294
|
+
const S = F.proxy({});
|
|
295
295
|
async function it() {
|
|
296
|
-
Object.assign(
|
|
296
|
+
Object.assign(S, window.__MANIFEST__);
|
|
297
297
|
}
|
|
298
|
-
function st(t,
|
|
298
|
+
function st(t, a, n) {
|
|
299
299
|
if (!document) {
|
|
300
300
|
console.error("Document not found");
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
|
-
document.addEventListener("click", (
|
|
303
|
+
document.addEventListener("click", (r) => {
|
|
304
304
|
var c, l;
|
|
305
|
-
const
|
|
306
|
-
if (
|
|
307
|
-
let e =
|
|
308
|
-
if (
|
|
309
|
-
|
|
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();
|
|
310
310
|
return;
|
|
311
311
|
}
|
|
312
312
|
if (e && e.startsWith("/") || e.startsWith(".")) {
|
|
313
|
-
const s = e.split("?")[0], u =
|
|
314
|
-
if (
|
|
315
|
-
|
|
316
|
-
const f = n.find((
|
|
317
|
-
U(e, t,
|
|
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);
|
|
318
318
|
} else
|
|
319
319
|
console.log("No matching route found for URL:", e, "- using fallback navigation");
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
}), window.addEventListener("popstate", (
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
const c = "get", l =
|
|
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
326
|
if (l) {
|
|
327
|
-
const e = n.find((
|
|
328
|
-
|
|
329
|
-
const f = { ...s, ...
|
|
330
|
-
U(
|
|
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);
|
|
331
331
|
} else
|
|
332
|
-
console.log("No matching route found for popstate navigation to:",
|
|
332
|
+
console.log("No matching route found for popstate navigation to:", i, "- using fallback navigation"), window.location.href = i;
|
|
333
333
|
}), function() {
|
|
334
|
-
const
|
|
335
|
-
history.pushState = function(...
|
|
336
|
-
const c =
|
|
337
|
-
return l.state =
|
|
338
|
-
}, history.replaceState = function(...
|
|
339
|
-
const c =
|
|
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
340
|
if ((l ? new URL(l, window.location.origin).pathname : e) !== e) {
|
|
341
341
|
const u = new Event("replacestate");
|
|
342
|
-
u.state =
|
|
342
|
+
u.state = o[0], u.url = o[2], window.dispatchEvent(u);
|
|
343
343
|
}
|
|
344
344
|
return c;
|
|
345
345
|
};
|
|
346
|
-
}(), window.addEventListener("pushstate", (
|
|
347
|
-
const
|
|
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
348
|
if (l) {
|
|
349
|
-
const e = n.find((
|
|
350
|
-
|
|
351
|
-
const f = { ...s, ...
|
|
352
|
-
U(
|
|
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);
|
|
353
353
|
} else
|
|
354
|
-
console.log("No matching route found for pushstate to:",
|
|
355
|
-
}), window.addEventListener("replacestate", (
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
const c = "get", l =
|
|
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
359
|
if (l) {
|
|
360
|
-
const e = n.find((
|
|
361
|
-
U(
|
|
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);
|
|
362
362
|
} else
|
|
363
|
-
console.log("No matching route found for replacestate to:",
|
|
363
|
+
console.log("No matching route found for replacestate to:", o, "- using fallback navigation"), window.location.href = o;
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
const B = Symbol("forge-load-function");
|
|
367
|
-
let $ = [],
|
|
367
|
+
let $ = [], T = null;
|
|
368
368
|
function ct(t) {
|
|
369
369
|
try {
|
|
370
|
-
const
|
|
371
|
-
return
|
|
370
|
+
const a = new URL(t, window.location.origin);
|
|
371
|
+
return a.origin === window.location.origin && !a.pathname.startsWith("/api/");
|
|
372
372
|
} catch {
|
|
373
373
|
return !t.startsWith("/api/");
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
function lt() {
|
|
377
|
-
typeof window < "u" && !
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
for (const a of $)
|
|
377
|
+
typeof window < "u" && !T && (T = window.fetch, window.fetch = async function(t, a = {}) {
|
|
378
|
+
let n = { ...a };
|
|
379
|
+
for (const i of $)
|
|
381
380
|
try {
|
|
382
|
-
if (
|
|
383
|
-
const
|
|
384
|
-
|
|
381
|
+
if (i.length === 2) {
|
|
382
|
+
const o = new Headers(n.headers), c = Object.fromEntries(o.entries());
|
|
383
|
+
await new Promise((l, e) => {
|
|
385
384
|
try {
|
|
386
|
-
|
|
385
|
+
i(c, (s) => {
|
|
387
386
|
if (s)
|
|
388
387
|
e(s);
|
|
389
388
|
else {
|
|
390
389
|
const u = new Headers();
|
|
391
|
-
Object.entries(c).forEach(([
|
|
392
|
-
f !== void 0 && u.set(
|
|
390
|
+
Object.entries(c).forEach(([d, f]) => {
|
|
391
|
+
f !== void 0 && u.set(d, f);
|
|
393
392
|
}), n.headers = u, l();
|
|
394
393
|
}
|
|
395
394
|
});
|
|
@@ -398,21 +397,19 @@ function lt() {
|
|
|
398
397
|
}
|
|
399
398
|
});
|
|
400
399
|
} else {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
r && typeof r == "object" ? (console.log("🟢 Middleware returned RequestInit:", r), n = r) : console.log("🟢 Middleware returned:", r);
|
|
400
|
+
const o = await i(n, t);
|
|
401
|
+
o && typeof o == "object" && (n = o);
|
|
404
402
|
}
|
|
405
|
-
} catch (
|
|
406
|
-
throw console.error("🔴 Middleware error:",
|
|
403
|
+
} catch (o) {
|
|
404
|
+
throw console.error("🔴 Middleware error:", o), o;
|
|
407
405
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
return window.location.href = a, o;
|
|
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;
|
|
414
411
|
}
|
|
415
|
-
return
|
|
412
|
+
return r;
|
|
416
413
|
});
|
|
417
414
|
}
|
|
418
415
|
lt();
|
|
@@ -438,33 +435,30 @@ const ht = {
|
|
|
438
435
|
return $.length;
|
|
439
436
|
}
|
|
440
437
|
};
|
|
441
|
-
let
|
|
442
|
-
async function wt(t,
|
|
443
|
-
let n = window.__COMPONENT_DIR__ ||
|
|
438
|
+
let C;
|
|
439
|
+
async function wt(t, a) {
|
|
440
|
+
let n = window.__COMPONENT_DIR__ || a.component_dir;
|
|
444
441
|
if (!n && typeof n != "string")
|
|
445
442
|
throw new Error("No component directory provided");
|
|
446
|
-
let
|
|
447
|
-
if (
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
console.log("Found route:", c);
|
|
454
|
-
const l = r.parser(a) || {}, e = new URLSearchParams(window.location.search), s = Object.fromEntries(e.entries()) || {}, u = { ...l, ...s };
|
|
455
|
-
it(), at(t, n, c, u, l, s), st(n, o, T);
|
|
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);
|
|
456
450
|
} else
|
|
457
|
-
console.warn("No matching route found for:",
|
|
451
|
+
console.warn("No matching route found for:", i);
|
|
458
452
|
}
|
|
459
453
|
}
|
|
460
454
|
export {
|
|
461
|
-
|
|
455
|
+
S as MANIFEST_STORE,
|
|
462
456
|
st as bootstrap_events,
|
|
463
457
|
wt as createApp,
|
|
464
458
|
ht as fetch,
|
|
465
459
|
at as loadRoute,
|
|
466
|
-
|
|
467
|
-
|
|
460
|
+
g as page,
|
|
461
|
+
yt as shadowUrl,
|
|
468
462
|
it as updateManifestStore,
|
|
469
463
|
U as updateRoute
|
|
470
464
|
};
|