@withl5e/l5e 0.3.3-alpha.4 → 1.0.0
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/README.md +1 -1
- package/dist/action.js +10 -9
- package/dist/action.js.map +1 -1
- package/dist/defineMiddleware-D017PWDc.js +8 -0
- package/dist/defineMiddleware-D017PWDc.js.map +1 -0
- package/dist/entry-server.js +161 -176
- package/dist/entry-server.js.map +1 -1
- package/dist/exceptions-D4OdiQjY.js +30 -0
- package/dist/exceptions-D4OdiQjY.js.map +1 -0
- package/dist/generateMetadata-DcdY-XC1.js +303 -0
- package/dist/generateMetadata-DcdY-XC1.js.map +1 -0
- package/dist/global-style-BhiGjxVU.js +21 -0
- package/dist/global-style-BhiGjxVU.js.map +1 -0
- package/dist/i18n.js +8 -11
- package/dist/i18n.js.map +1 -1
- package/dist/index.js +9 -55
- package/dist/island/client.js +2 -5
- package/dist/island/runtime.js +90 -107
- package/dist/island/runtime.js.map +1 -1
- package/dist/island.js +38 -56
- package/dist/island.js.map +1 -1
- package/dist/jsx-runtime-CI0Jmr-C.js +275 -0
- package/dist/jsx-runtime-CI0Jmr-C.js.map +1 -0
- package/dist/jsx-runtime.js +2 -31
- package/dist/middleware-CnDqZobD.js +217 -0
- package/dist/middleware-CnDqZobD.js.map +1 -0
- package/dist/middleware.js +3 -8
- package/dist/render-hUQUreah.js +152 -0
- package/dist/render-hUQUreah.js.map +1 -0
- package/dist/rolldown-runtime-B0aSnxlc.js +20 -0
- package/dist/router.js +72 -68
- package/dist/router.js.map +1 -1
- package/dist/seo.js +3 -7
- package/dist/server-5BEwGAL4.js +461 -0
- package/dist/server-5BEwGAL4.js.map +1 -0
- package/dist/server.js +2 -515
- package/dist/strategy-registry-wmHnsHQb.js +9 -0
- package/dist/strategy-registry-wmHnsHQb.js.map +1 -0
- package/dist/swap/server.js +11 -14
- package/dist/swap/server.js.map +1 -1
- package/dist/swap.js +109 -116
- package/dist/swap.js.map +1 -1
- package/dist/tooltip.js +145 -141
- package/dist/tooltip.js.map +1 -1
- package/dist/vite-plugin.js +315 -372
- package/dist/vite-plugin.js.map +1 -1
- package/package.json +8 -8
- package/src/core/bundler.ts +41 -25
- package/src/core/vite-plugin.ts +14 -15
- package/dist/client-D67hK4Yy.js +0 -9
- package/dist/client-D67hK4Yy.js.map +0 -1
- package/dist/defineMiddleware-VdHQuiUc.js +0 -7
- package/dist/defineMiddleware-VdHQuiUc.js.map +0 -1
- package/dist/exceptions-CHPz01DJ.js +0 -39
- package/dist/exceptions-CHPz01DJ.js.map +0 -1
- package/dist/generateMetadata-Cn8BIxq6.js +0 -144
- package/dist/generateMetadata-Cn8BIxq6.js.map +0 -1
- package/dist/global-style-DFvaBcuR.js +0 -27
- package/dist/global-style-DFvaBcuR.js.map +0 -1
- package/dist/index-CybB8Tdk.js +0 -315
- package/dist/index-CybB8Tdk.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/island/client.js.map +0 -1
- package/dist/jsx-runtime-DqAp8xlt.js +0 -296
- package/dist/jsx-runtime-DqAp8xlt.js.map +0 -1
- package/dist/jsx-runtime.js.map +0 -1
- package/dist/middleware.js.map +0 -1
- package/dist/render-CRag-5V7.js +0 -202
- package/dist/render-CRag-5V7.js.map +0 -1
- package/dist/seo.js.map +0 -1
- package/dist/server.js.map +0 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { AsyncLocalStorage as e } from "async_hooks";
|
|
2
|
+
//#region src/core/head-priority.ts
|
|
3
|
+
var t = {
|
|
4
|
+
CRITICAL: 0,
|
|
5
|
+
HIGH: 10,
|
|
6
|
+
MEDIUM: 50,
|
|
7
|
+
SEO: 80,
|
|
8
|
+
LOW: 100,
|
|
9
|
+
SCRIPTS: 200,
|
|
10
|
+
STYLES: 300
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/seo/mergeMetadata.ts
|
|
14
|
+
function n(e, t) {
|
|
15
|
+
if (!e) return t || {};
|
|
16
|
+
if (!t) return e;
|
|
17
|
+
let n = {
|
|
18
|
+
...e,
|
|
19
|
+
...t
|
|
20
|
+
};
|
|
21
|
+
return (t.openGraph || e.openGraph) && (n.openGraph = t.openGraph && e.openGraph ? {
|
|
22
|
+
...e.openGraph,
|
|
23
|
+
...t.openGraph,
|
|
24
|
+
images: t.openGraph.images ?? e.openGraph.images,
|
|
25
|
+
videos: t.openGraph.videos ?? e.openGraph.videos,
|
|
26
|
+
audio: t.openGraph.audio ?? e.openGraph.audio,
|
|
27
|
+
alternateLocale: t.openGraph.alternateLocale ?? e.openGraph.alternateLocale,
|
|
28
|
+
authors: t.openGraph.authors ?? e.openGraph.authors,
|
|
29
|
+
tags: t.openGraph.tags ?? e.openGraph.tags
|
|
30
|
+
} : t.openGraph || e.openGraph), (t.twitter || e.twitter) && (n.twitter = t.twitter && e.twitter ? {
|
|
31
|
+
...e.twitter,
|
|
32
|
+
...t.twitter,
|
|
33
|
+
images: t.twitter.images ?? e.twitter.images,
|
|
34
|
+
app: t.twitter.app ? {
|
|
35
|
+
...e.twitter.app,
|
|
36
|
+
...t.twitter.app,
|
|
37
|
+
id: {
|
|
38
|
+
...e.twitter.app?.id,
|
|
39
|
+
...t.twitter.app.id
|
|
40
|
+
},
|
|
41
|
+
url: {
|
|
42
|
+
...e.twitter.app?.url,
|
|
43
|
+
...t.twitter.app.url
|
|
44
|
+
}
|
|
45
|
+
} : e.twitter.app
|
|
46
|
+
} : t.twitter || e.twitter), (t.icons || e.icons) && (n.icons = t.icons && e.icons ? {
|
|
47
|
+
icon: t.icons.icon ?? e.icons.icon,
|
|
48
|
+
shortcut: t.icons.shortcut ?? e.icons.shortcut,
|
|
49
|
+
apple: t.icons.apple ?? e.icons.apple,
|
|
50
|
+
other: t.icons.other ?? e.icons.other
|
|
51
|
+
} : t.icons || e.icons), (t.verification || e.verification) && (n.verification = t.verification && e.verification ? {
|
|
52
|
+
...e.verification,
|
|
53
|
+
...t.verification,
|
|
54
|
+
other: t.verification.other ? {
|
|
55
|
+
...e.verification.other,
|
|
56
|
+
...t.verification.other
|
|
57
|
+
} : e.verification.other,
|
|
58
|
+
me: t.verification.me ?? e.verification.me
|
|
59
|
+
} : t.verification || e.verification), (t.appLinks || e.appLinks) && (n.appLinks = t.appLinks && e.appLinks ? {
|
|
60
|
+
ios: t.appLinks.ios ? {
|
|
61
|
+
...e.appLinks.ios,
|
|
62
|
+
...t.appLinks.ios
|
|
63
|
+
} : e.appLinks.ios,
|
|
64
|
+
android: t.appLinks.android ? {
|
|
65
|
+
...e.appLinks.android,
|
|
66
|
+
...t.appLinks.android
|
|
67
|
+
} : e.appLinks.android,
|
|
68
|
+
web: t.appLinks.web ? {
|
|
69
|
+
...e.appLinks.web,
|
|
70
|
+
...t.appLinks.web
|
|
71
|
+
} : e.appLinks.web
|
|
72
|
+
} : t.appLinks || e.appLinks), (t.formatDetection || e.formatDetection) && (n.formatDetection = t.formatDetection && e.formatDetection ? {
|
|
73
|
+
...e.formatDetection,
|
|
74
|
+
...t.formatDetection
|
|
75
|
+
} : t.formatDetection || e.formatDetection), t.viewport && e.viewport && (n.viewport = typeof t.viewport == "object" && typeof e.viewport == "object" ? {
|
|
76
|
+
...e.viewport,
|
|
77
|
+
...t.viewport
|
|
78
|
+
} : t.viewport), t.robots && e.robots && (n.robots = typeof t.robots == "object" && typeof e.robots == "object" ? {
|
|
79
|
+
...e.robots,
|
|
80
|
+
...t.robots
|
|
81
|
+
} : t.robots), n.keywords = t.keywords ?? e.keywords, n.themeColor = t.themeColor ?? e.themeColor, n.archives = t.archives ?? e.archives, n.assets = t.assets ?? e.assets, (t.other || e.other) && (n.other = t.other && e.other ? {
|
|
82
|
+
...e.other,
|
|
83
|
+
...t.other
|
|
84
|
+
} : t.other || e.other), n;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/core/const.ts
|
|
88
|
+
var r = Symbol("rawHtml");
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/core/jsx-runtime.ts
|
|
91
|
+
function i(e, t, ...n) {
|
|
92
|
+
return {
|
|
93
|
+
type: e,
|
|
94
|
+
props: t || {},
|
|
95
|
+
children: n.flat()
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function a({ children: e, ...t }) {
|
|
99
|
+
return t.setHtml === void 0 ? e : {
|
|
100
|
+
[r]: !0,
|
|
101
|
+
content: t.setHtml?.toString() || ""
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
var o = new e();
|
|
105
|
+
function s(e, t) {
|
|
106
|
+
return {
|
|
107
|
+
clientJsRegistry: [],
|
|
108
|
+
cssRegistry: [],
|
|
109
|
+
islandRegistry: [],
|
|
110
|
+
ssrIslands: [],
|
|
111
|
+
externalizeIslandProps: t?.externalizeIslandProps ?? !1,
|
|
112
|
+
islandProps: [],
|
|
113
|
+
cacheTags: /* @__PURE__ */ new Set(),
|
|
114
|
+
headRegistry: [],
|
|
115
|
+
metadataStack: [],
|
|
116
|
+
schemaRegistry: [],
|
|
117
|
+
request: e
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function c(e) {
|
|
121
|
+
let t = e.trim().replace(/\\/g, "/");
|
|
122
|
+
return t.startsWith("/") ? t : `/${t}`;
|
|
123
|
+
}
|
|
124
|
+
function l(e) {
|
|
125
|
+
if (typeof e == "string" && e.trim().length > 0) {
|
|
126
|
+
let t = o.getStore();
|
|
127
|
+
if (t) {
|
|
128
|
+
let n = c(e);
|
|
129
|
+
t.clientJsRegistry.some((e) => e.path === n) || t.clientJsRegistry.push({
|
|
130
|
+
path: n,
|
|
131
|
+
from: "Unknown"
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return "";
|
|
136
|
+
}
|
|
137
|
+
function u(e, t, n) {
|
|
138
|
+
let r = o.getStore();
|
|
139
|
+
r && (r.islandRegistry.some((t) => t.key === e) || r.islandRegistry.push({
|
|
140
|
+
key: e,
|
|
141
|
+
src: t,
|
|
142
|
+
name: n
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
function d() {
|
|
146
|
+
let e = o.getStore();
|
|
147
|
+
return e ? e.islandRegistry.slice() : [];
|
|
148
|
+
}
|
|
149
|
+
function f() {
|
|
150
|
+
return o.getStore()?.externalizeIslandProps ?? !1;
|
|
151
|
+
}
|
|
152
|
+
function p(e) {
|
|
153
|
+
let t = o.getStore();
|
|
154
|
+
return t ? t.islandProps.push(e) - 1 : -1;
|
|
155
|
+
}
|
|
156
|
+
function m() {
|
|
157
|
+
let e = o.getStore();
|
|
158
|
+
return e ? e.islandProps.slice() : [];
|
|
159
|
+
}
|
|
160
|
+
function h(e, t, n) {
|
|
161
|
+
let r = o.getStore();
|
|
162
|
+
if (!r) return "";
|
|
163
|
+
let i = `__L5E_SSR_${r.ssrIslands.length}__`;
|
|
164
|
+
return r.ssrIslands.push({
|
|
165
|
+
token: i,
|
|
166
|
+
src: e,
|
|
167
|
+
name: t,
|
|
168
|
+
props: n
|
|
169
|
+
}), i;
|
|
170
|
+
}
|
|
171
|
+
function g() {
|
|
172
|
+
let e = o.getStore();
|
|
173
|
+
return e ? e.ssrIslands.slice() : [];
|
|
174
|
+
}
|
|
175
|
+
function _(e) {
|
|
176
|
+
if (typeof e == "string" && e.trim().length > 0) {
|
|
177
|
+
let t = o.getStore();
|
|
178
|
+
if (t) {
|
|
179
|
+
let n = c(e);
|
|
180
|
+
t.cssRegistry.some((e) => e.path === n) || t.cssRegistry.push({
|
|
181
|
+
path: n,
|
|
182
|
+
from: "Unknown"
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return "";
|
|
187
|
+
}
|
|
188
|
+
function v(e, t, n, r) {
|
|
189
|
+
let i = s(t, r);
|
|
190
|
+
return n && (i.viewName = n), o.run(i, () => Promise.resolve(e()));
|
|
191
|
+
}
|
|
192
|
+
function y(e) {
|
|
193
|
+
let t = o.getStore();
|
|
194
|
+
t && (t.viewName = e);
|
|
195
|
+
}
|
|
196
|
+
function b() {
|
|
197
|
+
let e = o.getStore();
|
|
198
|
+
return e ? e.clientJsRegistry.slice() : [];
|
|
199
|
+
}
|
|
200
|
+
function x() {
|
|
201
|
+
let e = o.getStore();
|
|
202
|
+
return e ? Array.from(e.cacheTags) : [];
|
|
203
|
+
}
|
|
204
|
+
function S(e) {
|
|
205
|
+
let t = o.getStore();
|
|
206
|
+
t && (Array.isArray(e) ? e.forEach((e) => {
|
|
207
|
+
typeof e == "string" && e.trim() && t.cacheTags.add(e.trim());
|
|
208
|
+
}) : typeof e == "string" && e.trim() ? t.cacheTags.add(e.trim()) : typeof e == "object" && e && Object.entries(e).forEach(([e, n]) => {
|
|
209
|
+
n && typeof e == "string" && e.trim() && t.cacheTags.add(e.trim());
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
function C() {
|
|
213
|
+
let e = o.getStore();
|
|
214
|
+
return e ? e.cssRegistry.slice() : [];
|
|
215
|
+
}
|
|
216
|
+
function w({ children: e, priority: n = t.LOW }) {
|
|
217
|
+
let r = o.getStore();
|
|
218
|
+
return r && e && (r.headRegistry.push({
|
|
219
|
+
content: e,
|
|
220
|
+
priority: typeof n == "number" ? n : t.LOW,
|
|
221
|
+
source: "manual"
|
|
222
|
+
}), r.headRegistry.sort((e, t) => e.priority - t.priority)), null;
|
|
223
|
+
}
|
|
224
|
+
function T() {
|
|
225
|
+
let e = o.getStore();
|
|
226
|
+
return e ? e.headRegistry.map((e) => e.content) : [];
|
|
227
|
+
}
|
|
228
|
+
function E(e) {
|
|
229
|
+
let t = o.getStore();
|
|
230
|
+
t && e && t.metadataStack.push(e);
|
|
231
|
+
}
|
|
232
|
+
function D() {
|
|
233
|
+
let e = o.getStore();
|
|
234
|
+
return !e || e.metadataStack.length === 0 ? null : e.metadataStack.reduce((e, t) => n(e, t), null);
|
|
235
|
+
}
|
|
236
|
+
function O(e) {
|
|
237
|
+
let t = o.getStore();
|
|
238
|
+
t && (Array.isArray(e) ? t.schemaRegistry.push(...e) : t.schemaRegistry.push(e));
|
|
239
|
+
}
|
|
240
|
+
function k() {
|
|
241
|
+
let e = o.getStore();
|
|
242
|
+
return e ? e.schemaRegistry.slice() : [];
|
|
243
|
+
}
|
|
244
|
+
function A() {
|
|
245
|
+
let e = o.getStore();
|
|
246
|
+
if (!e) throw Error("useRequest called outside of render context");
|
|
247
|
+
return {
|
|
248
|
+
request: e.request,
|
|
249
|
+
view: e.viewName,
|
|
250
|
+
locals: e.request.locals ?? {},
|
|
251
|
+
params: e.request.params ?? {},
|
|
252
|
+
addCacheTag: (e) => {
|
|
253
|
+
S(e);
|
|
254
|
+
},
|
|
255
|
+
getCacheTags: () => Array.from(e.cacheTags)
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
function j(e) {
|
|
259
|
+
return typeof e == "object" && !!e && "type" in e && "props" in e && "children" in e && (typeof e.type == "string" || typeof e.type == "function");
|
|
260
|
+
}
|
|
261
|
+
function M(e, t, ...n) {
|
|
262
|
+
let r = {
|
|
263
|
+
...e.props,
|
|
264
|
+
...t
|
|
265
|
+
}, i = n.length > 0 ? n.flat() : e.children;
|
|
266
|
+
return {
|
|
267
|
+
type: e.type,
|
|
268
|
+
props: r,
|
|
269
|
+
children: i
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
//#endregion
|
|
273
|
+
export { y as C, r as D, A as E, n as O, v as S, _ as T, E as _, x as a, h as b, T as c, k as d, g as f, p as g, i as h, M as i, t as k, d as l, j as m, w as n, b as o, f as p, S as r, C as s, a as t, m as u, O as v, l as w, D as x, u as y };
|
|
274
|
+
|
|
275
|
+
//# sourceMappingURL=jsx-runtime-CI0Jmr-C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime-CI0Jmr-C.js","names":[],"sources":["../src/core/head-priority.ts","../src/seo/mergeMetadata.ts","../src/core/const.ts","../src/core/jsx-runtime.ts"],"sourcesContent":["/**\n * Priority constants for Head component rendering order\n * Lower numbers render first (higher priority)\n */\nexport const HEAD_PRIORITY = {\n CRITICAL: 0, // charset, viewport - must be first\n HIGH: 10, // title, description, canonical\n MEDIUM: 50, // meta tags, robots\n SEO: 80, // OpenGraph, Twitter\n LOW: 100, // Custom head elements\n SCRIPTS: 200, // Scripts\n STYLES: 300, // Styles\n} as const;\n\nexport type HeadPriority = (typeof HEAD_PRIORITY)[keyof typeof HEAD_PRIORITY] | number;\n","import type { Metadata } from './types';\n\n/**\n * Merges parent and child metadata objects\n * Follows Next.js shallow merge pattern with deep merge for nested objects\n *\n * @param parent - Parent metadata (from layout/global loader)\n * @param child - Child metadata (from page/view loader)\n * @returns Merged metadata object\n */\nexport function mergeMetadata(\n parent: Metadata | null | undefined,\n child: Metadata | null | undefined,\n): Metadata {\n // If no parent, return child (or empty object)\n if (!parent) {\n return child || {};\n }\n\n // If no child, return parent\n if (!child) {\n return parent;\n }\n\n // Shallow merge base properties (child overrides parent)\n const merged: Metadata = {\n ...parent,\n ...child,\n };\n\n // Deep merge for nested objects\n // OpenGraph: merge nested properties\n if (child.openGraph || parent.openGraph) {\n if (child.openGraph && parent.openGraph) {\n merged.openGraph = {\n ...parent.openGraph,\n ...child.openGraph,\n // Deep merge for nested arrays/objects in openGraph\n images: child.openGraph.images ?? parent.openGraph.images,\n videos: child.openGraph.videos ?? parent.openGraph.videos,\n audio: child.openGraph.audio ?? parent.openGraph.audio,\n alternateLocale: child.openGraph.alternateLocale ?? parent.openGraph.alternateLocale,\n authors: child.openGraph.authors ?? parent.openGraph.authors,\n tags: child.openGraph.tags ?? parent.openGraph.tags,\n };\n } else {\n merged.openGraph = child.openGraph || parent.openGraph;\n }\n }\n\n // Twitter: merge nested properties\n if (child.twitter || parent.twitter) {\n if (child.twitter && parent.twitter) {\n merged.twitter = {\n ...parent.twitter,\n ...child.twitter,\n // Deep merge for nested objects\n images: child.twitter.images ?? parent.twitter.images,\n app: child.twitter.app\n ? {\n ...parent.twitter.app,\n ...child.twitter.app,\n id: {\n ...parent.twitter.app?.id,\n ...child.twitter.app.id,\n },\n url: {\n ...parent.twitter.app?.url,\n ...child.twitter.app.url,\n },\n }\n : parent.twitter.app,\n };\n } else {\n merged.twitter = child.twitter || parent.twitter;\n }\n }\n\n // Icons: merge nested properties\n if (child.icons || parent.icons) {\n if (child.icons && parent.icons) {\n merged.icons = {\n icon: child.icons.icon ?? parent.icons.icon,\n shortcut: child.icons.shortcut ?? parent.icons.shortcut,\n apple: child.icons.apple ?? parent.icons.apple,\n other: child.icons.other ?? parent.icons.other,\n };\n } else {\n merged.icons = child.icons || parent.icons;\n }\n }\n\n // Verification: merge nested properties\n if (child.verification || parent.verification) {\n if (child.verification && parent.verification) {\n merged.verification = {\n ...parent.verification,\n ...child.verification,\n // Deep merge for other verification tags\n other: child.verification.other\n ? {\n ...parent.verification.other,\n ...child.verification.other,\n }\n : parent.verification.other,\n me: child.verification.me ?? parent.verification.me,\n };\n } else {\n merged.verification = child.verification || parent.verification;\n }\n }\n\n // AppLinks: merge nested properties\n if (child.appLinks || parent.appLinks) {\n if (child.appLinks && parent.appLinks) {\n merged.appLinks = {\n ios: child.appLinks.ios\n ? {\n ...parent.appLinks.ios,\n ...child.appLinks.ios,\n }\n : parent.appLinks.ios,\n android: child.appLinks.android\n ? {\n ...parent.appLinks.android,\n ...child.appLinks.android,\n }\n : parent.appLinks.android,\n web: child.appLinks.web\n ? {\n ...parent.appLinks.web,\n ...child.appLinks.web,\n }\n : parent.appLinks.web,\n };\n } else {\n merged.appLinks = child.appLinks || parent.appLinks;\n }\n }\n\n // FormatDetection: merge nested properties\n if (child.formatDetection || parent.formatDetection) {\n if (child.formatDetection && parent.formatDetection) {\n merged.formatDetection = {\n ...parent.formatDetection,\n ...child.formatDetection,\n };\n } else {\n merged.formatDetection = child.formatDetection || parent.formatDetection;\n }\n }\n\n // Viewport: merge if both are objects\n if (child.viewport && parent.viewport) {\n if (typeof child.viewport === 'object' && typeof parent.viewport === 'object') {\n merged.viewport = {\n ...parent.viewport,\n ...child.viewport,\n } as Metadata['viewport'];\n } else {\n // If either is string, child overrides\n merged.viewport = child.viewport;\n }\n }\n\n // Robots: merge if both are objects\n if (child.robots && parent.robots) {\n if (typeof child.robots === 'object' && typeof parent.robots === 'object') {\n merged.robots = {\n ...parent.robots,\n ...child.robots,\n } as Metadata['robots'];\n } else {\n // If either is string, child overrides\n merged.robots = child.robots;\n }\n }\n\n // Array fields: child overrides parent (shallow merge behavior)\n // These are already handled by spread operator above\n // But we explicitly handle them for clarity:\n merged.keywords = child.keywords ?? parent.keywords;\n merged.themeColor = child.themeColor ?? parent.themeColor;\n merged.archives = child.archives ?? parent.archives;\n merged.assets = child.assets ?? parent.assets;\n\n // Other: merge objects\n if (child.other || parent.other) {\n if (child.other && parent.other) {\n merged.other = {\n ...parent.other,\n ...child.other,\n };\n } else {\n merged.other = child.other || parent.other;\n }\n }\n\n return merged;\n}\n","// Marker object để đánh dấu raw HTML không escape\nexport const RAW_HTML_MARKER = Symbol('rawHtml');\n","import { mergeMetadata } from '../seo/mergeMetadata';\nimport type { Metadata } from '../seo/types';\nimport { RAW_HTML_MARKER } from './const';\nimport { RequestInfo } from './entry-server';\nimport { HEAD_PRIORITY, type HeadPriority } from './head-priority';\n\nexport type JSXChild =\n | string\n | number\n | boolean\n | null\n | undefined\n | JSXNode\n | JSXChild[]\n | RawHtmlObject\n | HtmlContentObject;\n\nexport type RawHtmlObject = {\n [RAW_HTML_MARKER]: true;\n content: string;\n};\n\nexport type HtmlContentObject = {\n htmlContent: string;\n};\n\nexport type RenderedNode = {\n string: string;\n};\n\nexport type JSXNode = {\n type: string | ((props: any) => JSXChild);\n props: Record<string, any>;\n children: JSXChild[];\n};\n\nexport function jsxFactory(type: any, props: any, ...children: any): JSXNode {\n return { type, props: props || {}, children: children.flat() };\n}\n\nexport function Fragment({\n children,\n ...props\n}: { children?: JSXChild; setHtml?: unknown } & Record<string, any>): JSXChild {\n // Hỗ trợ setHtml cho Fragment\n if (props.setHtml !== undefined) {\n // Trả về object đặc biệt để không bị escape\n return { [RAW_HTML_MARKER]: true, content: props.setHtml?.toString() || '' };\n }\n return children;\n}\n\n// AsyncLocalStorage for render context (request-level)\nimport { AsyncLocalStorage } from 'async_hooks';\n\ninterface HeadEntry {\n content: JSXChild;\n priority: number; // Số càng nhỏ, render càng sớm\n source?: string; // Để debug (ví dụ: 'layout', 'page', 'seo')\n}\n\ninterface IslandEntry {\n key: string; // \"Counter_a3f2\" — registry key\n src: string; // \"src/views/.../Counter.tsx\" — manifest-compatible path\n name: string; // \"Counter\" — export name\n}\n\n/**\n * A pending server-side render request for an `ssr` island.\n * Collected during the synchronous render pass and filled in afterwards by\n * entry-server (which can `await import()` the component + call renderToString).\n */\ninterface SsrIslandEntry {\n token: string; // unique placeholder token embedded in the HTML body\n src: string; // \"src/views/.../Counter.tsx\" — manifest-compatible path (no leading slash)\n name: string; // \"Counter\" — export name\n props: Record<string, any>;\n}\n\ninterface RenderContext {\n clientJsRegistry: Array<{ path: string; from: string }>;\n cssRegistry: Array<{ path: string; from: string }>;\n islandRegistry: IslandEntry[];\n ssrIslands: SsrIslandEntry[];\n /**\n * When true, ClientIsland writes its props into `islandProps` (referenced by a\n * `data-island-idx`) instead of inlining a `data-island-props` attribute, so a\n * single `<script id=\"_l5e_data_\">` at the end of the document carries all\n * island props — keeping the SSR HTML lean for crawlers reading top-down.\n */\n externalizeIslandProps: boolean;\n /** Ordered island props; index === the element's `data-island-idx`. */\n islandProps: unknown[];\n cacheTags: Set<string>;\n headRegistry: HeadEntry[]; // Thay vì JSXChild[]\n metadataStack: Metadata[]; // Stack để track metadata hierarchy\n schemaRegistry: Array<Record<string, any>>; // Schema.org structured data từ loaders\n request: RequestInfo;\n viewName?: string; // View name from route handler\n}\n\nconst renderStore = new AsyncLocalStorage<RenderContext>();\n\nexport interface RenderContextOptions {\n /** Default true — see RenderContext.externalizeIslandProps. */\n externalizeIslandProps?: boolean;\n}\n\n// Create context for each request\nfunction createRequestContext(\n requestInfo: RequestInfo,\n options?: RenderContextOptions,\n): RenderContext {\n return {\n clientJsRegistry: [],\n cssRegistry: [],\n islandRegistry: [],\n ssrIslands: [],\n externalizeIslandProps: options?.externalizeIslandProps ?? false,\n islandProps: [],\n cacheTags: new Set(),\n headRegistry: [],\n metadataStack: [],\n schemaRegistry: [],\n request: requestInfo,\n };\n}\n\n/**\n * Chuẩn hoá path asset về dạng web path có leading `/`.\n * Dev sinh thẻ thẳng từ path này, còn prod strip leading `/` để tra manifest —\n * không normalize thì `'src/a.css'` và `'/src/a.css'` là hai entry khác nhau ở\n * dev nhưng lại trỏ cùng một manifest key ở prod.\n */\nfunction normalizeAssetPath(path: string): string {\n const normalized = path.trim().replace(/\\\\/g, '/');\n return normalized.startsWith('/') ? normalized : `/${normalized}`;\n}\n\nexport function useClientJs(path: string): string {\n if (typeof path === 'string' && path.trim().length > 0) {\n const renderContext = renderStore.getStore();\n if (renderContext) {\n const normalized = normalizeAssetPath(path);\n // Dedupe theo path, giữ thứ tự lần gọi đầu tiên\n if (!renderContext.clientJsRegistry.some((entry) => entry.path === normalized)) {\n renderContext.clientJsRegistry.push({ path: normalized, from: 'Unknown' });\n }\n }\n }\n return '';\n}\n\nexport function registerIsland(key: string, src: string, name: string): void {\n const renderContext = renderStore.getStore();\n if (renderContext) {\n // Dedupe by key\n if (!renderContext.islandRegistry.some((e) => e.key === key)) {\n renderContext.islandRegistry.push({ key, src, name });\n }\n }\n}\n\nexport function getIslandEntries(): IslandEntry[] {\n const context = renderStore.getStore();\n if (!context) return [];\n return context.islandRegistry.slice();\n}\n\n/** True when island props should be externalized into the `_l5e_data_` script. */\nexport function isIslandPropsExternalized(): boolean {\n return renderStore.getStore()?.externalizeIslandProps ?? false;\n}\n\n/**\n * Append island props to the per-request store and return its index (used as the\n * element's `data-island-idx`). Returns -1 outside a render context so the caller\n * can fall back to inlining the props.\n */\nexport function pushIslandProps(props: unknown): number {\n const context = renderStore.getStore();\n if (!context) return -1;\n return context.islandProps.push(props) - 1;\n}\n\n/** Ordered island props for the trailing `_l5e_data_` script (index === data-island-idx). */\nexport function getIslandProps(): unknown[] {\n const context = renderStore.getStore();\n if (!context) return [];\n return context.islandProps.slice();\n}\n\n/**\n * Register a pending SSR island render. Returns a unique placeholder token that\n * the caller embeds (as raw HTML) in the island's body. entry-server replaces\n * the token with the server-rendered component HTML after the sync render pass.\n */\nexport function registerSsrIsland(src: string, name: string, props: Record<string, any>): string {\n const renderContext = renderStore.getStore();\n if (!renderContext) return '';\n const token = `__L5E_SSR_${renderContext.ssrIslands.length}__`;\n renderContext.ssrIslands.push({ token, src, name, props });\n return token;\n}\n\nexport function getSsrIslands(): SsrIslandEntry[] {\n const context = renderStore.getStore();\n if (!context) return [];\n return context.ssrIslands.slice();\n}\n\nexport function useCss(path: string): string {\n if (typeof path === 'string' && path.trim().length > 0) {\n const renderContext = renderStore.getStore();\n if (renderContext) {\n const normalized = normalizeAssetPath(path);\n // Dedupe theo path — thứ tự lần gọi đầu tiên quyết định thứ tự cascade\n if (!renderContext.cssRegistry.some((entry) => entry.path === normalized)) {\n renderContext.cssRegistry.push({ path: normalized, from: 'Unknown' });\n }\n }\n }\n return '';\n}\n\n// Wrapper to run render in async context\nexport function runInRenderContext<T>(\n renderFn: () => T | Promise<T>,\n requestInfo: RequestInfo,\n viewName?: string,\n options?: RenderContextOptions,\n): Promise<T> {\n const context = createRequestContext(requestInfo, options);\n if (viewName) {\n context.viewName = viewName;\n }\n return renderStore.run(context, () => Promise.resolve(renderFn()));\n}\n\n// Set view name in current render context\nexport function setViewName(viewName: string): void {\n const context = renderStore.getStore();\n if (context) {\n context.viewName = viewName;\n }\n}\n\n// Get entries from current context\nexport function getClientJsEntries(): Array<{ path: string; from: string }> {\n const context = renderStore.getStore();\n if (!context) return [];\n return context.clientJsRegistry.slice();\n}\n\n// Get cache tags from current context\nexport function getCacheTags(): string[] {\n const context = renderStore.getStore();\n if (!context) return [];\n return Array.from(context.cacheTags);\n}\n\n// Add cache tags to current context\nexport function addCacheTag(tag: string | string[] | Record<string, boolean>): void {\n const context = renderStore.getStore();\n if (!context) return;\n\n if (Array.isArray(tag)) {\n tag.forEach((t) => {\n if (typeof t === 'string' && t.trim()) {\n context.cacheTags.add(t.trim());\n }\n });\n } else if (typeof tag === 'string' && tag.trim()) {\n context.cacheTags.add(tag.trim());\n } else if (typeof tag === 'object' && tag !== null) {\n Object.entries(tag).forEach(([key, value]) => {\n if (value && typeof key === 'string' && key.trim()) {\n context.cacheTags.add(key.trim());\n }\n });\n }\n}\n\n// Get CSS entries from current context\nexport function getCssEntries(): Array<{ path: string; from: string }> {\n const context = renderStore.getStore();\n if (!context) return [];\n return context.cssRegistry.slice();\n}\n\n// Head component to collect head elements with priority support\nexport function Head({\n children,\n priority = HEAD_PRIORITY.LOW, // Default priority\n}: {\n children?: JSXChild;\n priority?: HeadPriority;\n}): null {\n const renderContext = renderStore.getStore();\n if (renderContext && children) {\n renderContext.headRegistry.push({\n content: children,\n priority: typeof priority === 'number' ? priority : HEAD_PRIORITY.LOW,\n source: 'manual',\n });\n\n // Sort theo priority sau mỗi lần push để đảm bảo thứ tự đúng\n renderContext.headRegistry.sort((a, b) => a.priority - b.priority);\n }\n return null;\n}\n\n// Get head content from current context (already sorted by priority)\nexport function getHeadContent(): JSXChild[] {\n const context = renderStore.getStore();\n if (!context) return [];\n // Đã được sort trong Head component, chỉ cần map để lấy content\n return context.headRegistry.map((entry) => entry.content);\n}\n\n// Push metadata to stack (for hierarchical metadata support)\nexport function pushMetadata(metadata: Metadata): void {\n const context = renderStore.getStore();\n if (context && metadata) {\n context.metadataStack.push(metadata);\n }\n}\n\n// Resolve and merge all metadata from stack (root → leaf)\nexport function resolveMetadata(): Metadata | null {\n const context = renderStore.getStore();\n if (!context || context.metadataStack.length === 0) {\n return null;\n }\n\n // Merge from root → leaf (reduce left to right)\n return context.metadataStack.reduce(\n (acc, current) => mergeMetadata(acc, current),\n null as Metadata | null,\n );\n}\n\n// Push schema to registry (for schema markup from loaders)\n// Accepts schema-dts types (WithContext<T> or array of schemas)\nexport function pushSchema(schema: any | Array<any>): void {\n const context = renderStore.getStore();\n if (!context) return;\n\n if (Array.isArray(schema)) {\n context.schemaRegistry.push(...schema);\n } else {\n context.schemaRegistry.push(schema);\n }\n}\n\n// Get all schemas from registry\nexport function getSchemas(): Array<Record<string, any>> {\n const context = renderStore.getStore();\n if (!context) return [];\n return context.schemaRegistry.slice();\n}\n\n// Hook to get render request context\nexport function useRequest() {\n const context = renderStore.getStore();\n\n if (!context) {\n throw new Error('useRequest called outside of render context');\n }\n\n return {\n request: context.request,\n view: context.viewName,\n locals: (context.request.locals ?? {}) as Record<string, unknown>,\n params: (context.request.params ?? {}) as Record<string, any>,\n\n // Add cache tags\n addCacheTag: (tag: string | string[] | Record<string, boolean>) => {\n addCacheTag(tag);\n },\n\n // Get all cache tags\n getCacheTags: () => {\n return Array.from(context.cacheTags);\n },\n };\n}\n\n/**\n * Checks if a value is a valid JSX element (JSXNode)\n * Similar to React.isValidElement\n */\nexport function isValidElement(value: any): value is JSXNode {\n return (\n value !== null &&\n typeof value === 'object' &&\n 'type' in value &&\n 'props' in value &&\n 'children' in value &&\n (typeof value.type === 'string' || typeof value.type === 'function')\n );\n}\n\n/**\n * Clones a JSX element with new props and/or children\n * Similar to React.cloneElement\n */\nexport function cloneElement(\n element: JSXNode,\n props?: Record<string, any>,\n ...children: JSXChild[]\n): JSXNode {\n const newProps = { ...element.props, ...props };\n const newChildren = children.length > 0 ? children.flat() : element.children;\n\n return {\n type: element.type,\n props: newProps,\n children: newChildren,\n };\n}\n"],"mappings":";;AAIA,IAAa,IAAgB;CAC3B,UAAU;CACV,MAAM;CACN,QAAQ;CACR,KAAK;CACL,KAAK;CACL,SAAS;CACT,QAAQ;AACV;;;ACFA,SAAgB,EACd,GACA,GACU;CAEV,IAAI,CAAC,GACH,OAAO,KAAS,CAAC;CAInB,IAAI,CAAC,GACH,OAAO;CAIT,IAAM,IAAmB;EACvB,GAAG;EACH,GAAG;CACL;CA0KA,QAtKI,EAAM,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AW;EAAE,GAAG,EAAQ;EAAO,GAAG;CAAM,GACxC,IAAc,EAAS,SAAS,IAAI,EAAS,KAAK,IAAI,EAAQ;CAEpE,OAAO;EACL,MAAM,EAAQ;EACd,OAAO;EACP,UAAU;CACZ;AACF"}
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
t as Fragment,
|
|
5
|
-
n as Head,
|
|
6
|
-
r as addCacheTag,
|
|
7
|
-
d as cloneElement,
|
|
8
|
-
l as getCacheTags,
|
|
9
|
-
g as getClientJsEntries,
|
|
10
|
-
i as getCssEntries,
|
|
11
|
-
o as getHeadContent,
|
|
12
|
-
m as getIslandEntries,
|
|
13
|
-
p as getIslandProps,
|
|
14
|
-
u as getSchemas,
|
|
15
|
-
h as getSsrIslands,
|
|
16
|
-
C as isIslandPropsExternalized,
|
|
17
|
-
I as isValidElement,
|
|
18
|
-
c as jsxFactory,
|
|
19
|
-
E as pushIslandProps,
|
|
20
|
-
x as pushMetadata,
|
|
21
|
-
S as pushSchema,
|
|
22
|
-
F as registerIsland,
|
|
23
|
-
P as registerSsrIsland,
|
|
24
|
-
f as resolveMetadata,
|
|
25
|
-
j as runInRenderContext,
|
|
26
|
-
q as setViewName,
|
|
27
|
-
v as useClientJs,
|
|
28
|
-
w as useCss,
|
|
29
|
-
y as useRequest
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=jsx-runtime.js.map
|
|
1
|
+
import { C as e, E as t, S as n, T as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "./jsx-runtime-CI0Jmr-C.js";
|
|
2
|
+
export { b as Fragment, h as Head, v as addCacheTag, f as cloneElement, a as getCacheTags, g as getClientJsEntries, y as getCssEntries, s as getHeadContent, p as getIslandEntries, x as getIslandProps, c as getSchemas, l as getSsrIslands, _ as isIslandPropsExternalized, m as isValidElement, d as jsxFactory, u as pushIslandProps, i as pushMetadata, S as pushSchema, T as registerIsland, o as registerSsrIsland, w as resolveMetadata, n as runInRenderContext, e as setViewName, C as useClientJs, r as useCss, t as useRequest };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-B0aSnxlc.js";
|
|
2
|
+
import { t } from "./defineMiddleware-D017PWDc.js";
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/core/request.ts
|
|
5
|
+
var n = (/* @__PURE__ */ e(((e) => {
|
|
6
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.parse = s, e.stringifySetCookie = c, e.serialize = c, e.stringifySetCookie = c, e.serialize = c;
|
|
7
|
+
var t = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/, n = /^[\u0021-\u003A\u003C-\u007E]*$/, r = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, i = /^[\u0020-\u003A\u003D-\u007E]*$/, a = Object.prototype.toString, o = /* @__PURE__ */ (() => {
|
|
8
|
+
let e = function() {};
|
|
9
|
+
return e.prototype = Object.create(null), e;
|
|
10
|
+
})();
|
|
11
|
+
function s(e, t) {
|
|
12
|
+
let n = new o(), r = e.length;
|
|
13
|
+
if (r < 2) return n;
|
|
14
|
+
let i = t?.decode || f, a = 0;
|
|
15
|
+
do {
|
|
16
|
+
let t = u(e, a, r);
|
|
17
|
+
if (t === -1) break;
|
|
18
|
+
let o = l(e, a, r);
|
|
19
|
+
if (t > o) {
|
|
20
|
+
a = e.lastIndexOf(";", t - 1) + 1;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
let s = d(e, a, t);
|
|
24
|
+
n[s] === void 0 && (n[s] = i(d(e, t + 1, o))), a = o + 1;
|
|
25
|
+
} while (a < r);
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
function c(e, a, o) {
|
|
29
|
+
let s = typeof e == "object" ? e : {
|
|
30
|
+
...o,
|
|
31
|
+
name: e,
|
|
32
|
+
value: String(a)
|
|
33
|
+
}, c = (typeof a == "object" ? a : o)?.encode || encodeURIComponent;
|
|
34
|
+
if (!t.test(s.name)) throw TypeError(`argument name is invalid: ${s.name}`);
|
|
35
|
+
let l = s.value ? c(s.value) : "";
|
|
36
|
+
if (!n.test(l)) throw TypeError(`argument val is invalid: ${s.value}`);
|
|
37
|
+
let u = s.name + "=" + l;
|
|
38
|
+
if (s.maxAge !== void 0) {
|
|
39
|
+
if (!Number.isInteger(s.maxAge)) throw TypeError(`option maxAge is invalid: ${s.maxAge}`);
|
|
40
|
+
u += "; Max-Age=" + s.maxAge;
|
|
41
|
+
}
|
|
42
|
+
if (s.domain) {
|
|
43
|
+
if (!r.test(s.domain)) throw TypeError(`option domain is invalid: ${s.domain}`);
|
|
44
|
+
u += "; Domain=" + s.domain;
|
|
45
|
+
}
|
|
46
|
+
if (s.path) {
|
|
47
|
+
if (!i.test(s.path)) throw TypeError(`option path is invalid: ${s.path}`);
|
|
48
|
+
u += "; Path=" + s.path;
|
|
49
|
+
}
|
|
50
|
+
if (s.expires) {
|
|
51
|
+
if (!p(s.expires) || !Number.isFinite(s.expires.valueOf())) throw TypeError(`option expires is invalid: ${s.expires}`);
|
|
52
|
+
u += "; Expires=" + s.expires.toUTCString();
|
|
53
|
+
}
|
|
54
|
+
if (s.httpOnly && (u += "; HttpOnly"), s.secure && (u += "; Secure"), s.partitioned && (u += "; Partitioned"), s.priority) switch (typeof s.priority == "string" ? s.priority.toLowerCase() : void 0) {
|
|
55
|
+
case "low":
|
|
56
|
+
u += "; Priority=Low";
|
|
57
|
+
break;
|
|
58
|
+
case "medium":
|
|
59
|
+
u += "; Priority=Medium";
|
|
60
|
+
break;
|
|
61
|
+
case "high":
|
|
62
|
+
u += "; Priority=High";
|
|
63
|
+
break;
|
|
64
|
+
default: throw TypeError(`option priority is invalid: ${s.priority}`);
|
|
65
|
+
}
|
|
66
|
+
if (s.sameSite) switch (typeof s.sameSite == "string" ? s.sameSite.toLowerCase() : s.sameSite) {
|
|
67
|
+
case !0:
|
|
68
|
+
case "strict":
|
|
69
|
+
u += "; SameSite=Strict";
|
|
70
|
+
break;
|
|
71
|
+
case "lax":
|
|
72
|
+
u += "; SameSite=Lax";
|
|
73
|
+
break;
|
|
74
|
+
case "none":
|
|
75
|
+
u += "; SameSite=None";
|
|
76
|
+
break;
|
|
77
|
+
default: throw TypeError(`option sameSite is invalid: ${s.sameSite}`);
|
|
78
|
+
}
|
|
79
|
+
return u;
|
|
80
|
+
}
|
|
81
|
+
function l(e, t, n) {
|
|
82
|
+
let r = e.indexOf(";", t);
|
|
83
|
+
return r === -1 ? n : r;
|
|
84
|
+
}
|
|
85
|
+
function u(e, t, n) {
|
|
86
|
+
let r = e.indexOf("=", t);
|
|
87
|
+
return r < n ? r : -1;
|
|
88
|
+
}
|
|
89
|
+
function d(e, t, n) {
|
|
90
|
+
let r = t, i = n;
|
|
91
|
+
do {
|
|
92
|
+
let t = e.charCodeAt(r);
|
|
93
|
+
if (t !== 32 && t !== 9) break;
|
|
94
|
+
} while (++r < i);
|
|
95
|
+
for (; i > r;) {
|
|
96
|
+
let t = e.charCodeAt(i - 1);
|
|
97
|
+
if (t !== 32 && t !== 9) break;
|
|
98
|
+
i--;
|
|
99
|
+
}
|
|
100
|
+
return e.slice(r, i);
|
|
101
|
+
}
|
|
102
|
+
function f(e) {
|
|
103
|
+
if (e.indexOf("%") === -1) return e;
|
|
104
|
+
try {
|
|
105
|
+
return decodeURIComponent(e);
|
|
106
|
+
} catch {
|
|
107
|
+
return e;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function p(e) {
|
|
111
|
+
return a.call(e) === "[object Date]";
|
|
112
|
+
}
|
|
113
|
+
})))();
|
|
114
|
+
function r(e) {
|
|
115
|
+
if (!e) return {};
|
|
116
|
+
let t = (0, n.parse)(e), r = {};
|
|
117
|
+
for (let [e, n] of Object.entries(t)) n !== void 0 && (r[e] = n);
|
|
118
|
+
return r;
|
|
119
|
+
}
|
|
120
|
+
function i(e) {
|
|
121
|
+
let t = new Headers();
|
|
122
|
+
return Object.entries(e.headers).forEach(([e, n]) => {
|
|
123
|
+
if (n !== void 0) {
|
|
124
|
+
if (Array.isArray(n)) {
|
|
125
|
+
n.forEach((n) => t.append(e, n));
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
t.set(e, n);
|
|
129
|
+
}
|
|
130
|
+
}), t;
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/middleware/sequence.ts
|
|
134
|
+
function a(...e) {
|
|
135
|
+
let n = e.filter(Boolean), r = n.length;
|
|
136
|
+
return t(r ? (e, t) => {
|
|
137
|
+
let i;
|
|
138
|
+
return a(0, e);
|
|
139
|
+
function a(e, s) {
|
|
140
|
+
let c = n[e];
|
|
141
|
+
return c(s, async (n) => e < r - 1 ? (n && (i = n, o(s, n)), a(e + 1, s)) : t(n ?? i));
|
|
142
|
+
}
|
|
143
|
+
} : (e, t) => t());
|
|
144
|
+
}
|
|
145
|
+
function o(e, t) {
|
|
146
|
+
let n;
|
|
147
|
+
n = t instanceof Request ? t : t instanceof URL ? new Request(t.href, e.request.clone()) : new Request(new URL(t, e.url).href, e.request.clone());
|
|
148
|
+
let i = e.url, a = new URL(n.url), o = r(n.headers.get("cookie") ?? void 0);
|
|
149
|
+
if (e.request = n, e.url = a, e.cookies = o, e.requestInfo) {
|
|
150
|
+
let t = {};
|
|
151
|
+
n.headers.forEach((e, n) => {
|
|
152
|
+
t[n] = e;
|
|
153
|
+
}), e.requestInfo = {
|
|
154
|
+
...e.requestInfo,
|
|
155
|
+
url: a,
|
|
156
|
+
path: s(a, i, e.requestInfo.path),
|
|
157
|
+
pathname: a.pathname,
|
|
158
|
+
method: n.method,
|
|
159
|
+
headers: t,
|
|
160
|
+
cookies: o,
|
|
161
|
+
query: Object.fromEntries(a.searchParams.entries())
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function s(e, t, n) {
|
|
166
|
+
let r = `${e.pathname}${e.search}` || "/";
|
|
167
|
+
if (!n) return r;
|
|
168
|
+
let i = n.split("?")[0] || "/";
|
|
169
|
+
if (i === t.pathname || !t.pathname.endsWith(i)) return r;
|
|
170
|
+
let a = t.pathname.slice(0, t.pathname.length - i.length);
|
|
171
|
+
if (!a || !e.pathname.startsWith(a)) return r;
|
|
172
|
+
let o = e.pathname.slice(a.length) || "/";
|
|
173
|
+
return `${o.startsWith("/") ? o : `/${o}`}${e.search}`;
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/middleware/index.ts
|
|
177
|
+
function c({ request: e, requestInfo: t, locals: n = {}, clientAddress: i }) {
|
|
178
|
+
let a = {
|
|
179
|
+
cookies: r(e.headers.get("cookie") ?? void 0),
|
|
180
|
+
request: e,
|
|
181
|
+
requestInfo: t,
|
|
182
|
+
url: new URL(e.url),
|
|
183
|
+
redirect(e, t = 302) {
|
|
184
|
+
return new Response(null, {
|
|
185
|
+
status: t,
|
|
186
|
+
headers: { Location: e.toString() }
|
|
187
|
+
});
|
|
188
|
+
},
|
|
189
|
+
rewrite(e) {
|
|
190
|
+
return Promise.resolve(new Response(null));
|
|
191
|
+
},
|
|
192
|
+
get clientAddress() {
|
|
193
|
+
if (i) return i;
|
|
194
|
+
throw Error("clientAddress is not available for this request.");
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
return Object.defineProperty(a, "locals", {
|
|
198
|
+
enumerable: !0,
|
|
199
|
+
get() {
|
|
200
|
+
if (typeof n != "object" || !n || Array.isArray(n)) throw Error("Middleware locals must be a plain object.");
|
|
201
|
+
return n;
|
|
202
|
+
},
|
|
203
|
+
set() {
|
|
204
|
+
throw Error("Middleware locals cannot be reassigned. Mutate its properties instead.");
|
|
205
|
+
}
|
|
206
|
+
}), a.rewrite = (e) => Promise.resolve(new Response(null, {
|
|
207
|
+
status: 307,
|
|
208
|
+
headers: { "X-L5E-Rewrite": l(e, a.url) }
|
|
209
|
+
})), a;
|
|
210
|
+
}
|
|
211
|
+
function l(e, t) {
|
|
212
|
+
return e instanceof Request ? e.url : e instanceof URL ? e.href : new URL(e, t).href;
|
|
213
|
+
}
|
|
214
|
+
//#endregion
|
|
215
|
+
export { r as i, a as n, i as r, c as t };
|
|
216
|
+
|
|
217
|
+
//# sourceMappingURL=middleware-CnDqZobD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware-CnDqZobD.js","names":["parseCookieHeader"],"sources":["../../../node_modules/.pnpm/cookie@1.1.1/node_modules/cookie/dist/index.js","../src/core/request.ts","../src/middleware/sequence.ts","../src/middleware/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseCookie = parseCookie;\nexports.parse = parseCookie;\nexports.stringifyCookie = stringifyCookie;\nexports.stringifySetCookie = stringifySetCookie;\nexports.serialize = stringifySetCookie;\nexports.parseSetCookie = parseSetCookie;\nexports.stringifySetCookie = stringifySetCookie;\nexports.serialize = stringifySetCookie;\n/**\n * RegExp to match cookie-name in RFC 6265 sec 4.1.1\n * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2\n * which has been replaced by the token definition in RFC 7230 appendix B.\n *\n * cookie-name = token\n * token = 1*tchar\n * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" /\n * \"*\" / \"+\" / \"-\" / \".\" / \"^\" / \"_\" /\n * \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n *\n * Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191\n * Allow same range as cookie value, except `=`, which delimits end of name.\n */\nconst cookieNameRegExp = /^[\\u0021-\\u003A\\u003C\\u003E-\\u007E]+$/;\n/**\n * RegExp to match cookie-value in RFC 6265 sec 4.1.1\n *\n * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n * ; US-ASCII characters excluding CTLs,\n * ; whitespace DQUOTE, comma, semicolon,\n * ; and backslash\n *\n * Allowing more characters: https://github.com/jshttp/cookie/issues/191\n * Comma, backslash, and DQUOTE are not part of the parsing algorithm.\n */\nconst cookieValueRegExp = /^[\\u0021-\\u003A\\u003C-\\u007E]*$/;\n/**\n * RegExp to match domain-value in RFC 6265 sec 4.1.1\n *\n * domain-value = <subdomain>\n * ; defined in [RFC1034], Section 3.5, as\n * ; enhanced by [RFC1123], Section 2.1\n * <subdomain> = <label> | <subdomain> \".\" <label>\n * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]\n * Labels must be 63 characters or less.\n * 'let-dig' not 'letter' in the first char, per RFC1123\n * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>\n * <let-dig-hyp> = <let-dig> | \"-\"\n * <let-dig> = <letter> | <digit>\n * <letter> = any one of the 52 alphabetic characters A through Z in\n * upper case and a through z in lower case\n * <digit> = any one of the ten digits 0 through 9\n *\n * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173\n *\n * > (Note that a leading %x2E (\".\"), if present, is ignored even though that\n * character is not permitted, but a trailing %x2E (\".\"), if present, will\n * cause the user agent to ignore the attribute.)\n */\nconst domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;\n/**\n * RegExp to match path-value in RFC 6265 sec 4.1.1\n *\n * path-value = <any CHAR except CTLs or \";\">\n * CHAR = %x01-7F\n * ; defined in RFC 5234 appendix B.1\n */\nconst pathValueRegExp = /^[\\u0020-\\u003A\\u003D-\\u007E]*$/;\n/**\n * RegExp to match max-age-value in RFC 6265 sec 5.6.2\n */\nconst maxAgeRegExp = /^-?\\d+$/;\nconst __toString = Object.prototype.toString;\nconst NullObject = /* @__PURE__ */ (() => {\n const C = function () { };\n C.prototype = Object.create(null);\n return C;\n})();\n/**\n * Parse a `Cookie` header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n */\nfunction parseCookie(str, options) {\n const obj = new NullObject();\n const len = str.length;\n // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.\n if (len < 2)\n return obj;\n const dec = options?.decode || decode;\n let index = 0;\n do {\n const eqIdx = eqIndex(str, index, len);\n if (eqIdx === -1)\n break; // No more cookie pairs.\n const endIdx = endIndex(str, index, len);\n if (eqIdx > endIdx) {\n // backtrack on prior semicolon\n index = str.lastIndexOf(\";\", eqIdx - 1) + 1;\n continue;\n }\n const key = valueSlice(str, index, eqIdx);\n // only assign once\n if (obj[key] === undefined) {\n obj[key] = dec(valueSlice(str, eqIdx + 1, endIdx));\n }\n index = endIdx + 1;\n } while (index < len);\n return obj;\n}\n/**\n * Stringifies an object into an HTTP `Cookie` header.\n */\nfunction stringifyCookie(cookie, options) {\n const enc = options?.encode || encodeURIComponent;\n const cookieStrings = [];\n for (const name of Object.keys(cookie)) {\n const val = cookie[name];\n if (val === undefined)\n continue;\n if (!cookieNameRegExp.test(name)) {\n throw new TypeError(`cookie name is invalid: ${name}`);\n }\n const value = enc(val);\n if (!cookieValueRegExp.test(value)) {\n throw new TypeError(`cookie val is invalid: ${val}`);\n }\n cookieStrings.push(`${name}=${value}`);\n }\n return cookieStrings.join(\"; \");\n}\nfunction stringifySetCookie(_name, _val, _opts) {\n const cookie = typeof _name === \"object\"\n ? _name\n : { ..._opts, name: _name, value: String(_val) };\n const options = typeof _val === \"object\" ? _val : _opts;\n const enc = options?.encode || encodeURIComponent;\n if (!cookieNameRegExp.test(cookie.name)) {\n throw new TypeError(`argument name is invalid: ${cookie.name}`);\n }\n const value = cookie.value ? enc(cookie.value) : \"\";\n if (!cookieValueRegExp.test(value)) {\n throw new TypeError(`argument val is invalid: ${cookie.value}`);\n }\n let str = cookie.name + \"=\" + value;\n if (cookie.maxAge !== undefined) {\n if (!Number.isInteger(cookie.maxAge)) {\n throw new TypeError(`option maxAge is invalid: ${cookie.maxAge}`);\n }\n str += \"; Max-Age=\" + cookie.maxAge;\n }\n if (cookie.domain) {\n if (!domainValueRegExp.test(cookie.domain)) {\n throw new TypeError(`option domain is invalid: ${cookie.domain}`);\n }\n str += \"; Domain=\" + cookie.domain;\n }\n if (cookie.path) {\n if (!pathValueRegExp.test(cookie.path)) {\n throw new TypeError(`option path is invalid: ${cookie.path}`);\n }\n str += \"; Path=\" + cookie.path;\n }\n if (cookie.expires) {\n if (!isDate(cookie.expires) || !Number.isFinite(cookie.expires.valueOf())) {\n throw new TypeError(`option expires is invalid: ${cookie.expires}`);\n }\n str += \"; Expires=\" + cookie.expires.toUTCString();\n }\n if (cookie.httpOnly) {\n str += \"; HttpOnly\";\n }\n if (cookie.secure) {\n str += \"; Secure\";\n }\n if (cookie.partitioned) {\n str += \"; Partitioned\";\n }\n if (cookie.priority) {\n const priority = typeof cookie.priority === \"string\"\n ? cookie.priority.toLowerCase()\n : undefined;\n switch (priority) {\n case \"low\":\n str += \"; Priority=Low\";\n break;\n case \"medium\":\n str += \"; Priority=Medium\";\n break;\n case \"high\":\n str += \"; Priority=High\";\n break;\n default:\n throw new TypeError(`option priority is invalid: ${cookie.priority}`);\n }\n }\n if (cookie.sameSite) {\n const sameSite = typeof cookie.sameSite === \"string\"\n ? cookie.sameSite.toLowerCase()\n : cookie.sameSite;\n switch (sameSite) {\n case true:\n case \"strict\":\n str += \"; SameSite=Strict\";\n break;\n case \"lax\":\n str += \"; SameSite=Lax\";\n break;\n case \"none\":\n str += \"; SameSite=None\";\n break;\n default:\n throw new TypeError(`option sameSite is invalid: ${cookie.sameSite}`);\n }\n }\n return str;\n}\n/**\n * Deserialize a `Set-Cookie` header into an object.\n *\n * deserialize('foo=bar; httpOnly')\n * => { name: 'foo', value: 'bar', httpOnly: true }\n */\nfunction parseSetCookie(str, options) {\n const dec = options?.decode || decode;\n const len = str.length;\n const endIdx = endIndex(str, 0, len);\n const eqIdx = eqIndex(str, 0, endIdx);\n const setCookie = eqIdx === -1\n ? { name: \"\", value: dec(valueSlice(str, 0, endIdx)) }\n : {\n name: valueSlice(str, 0, eqIdx),\n value: dec(valueSlice(str, eqIdx + 1, endIdx)),\n };\n let index = endIdx + 1;\n while (index < len) {\n const endIdx = endIndex(str, index, len);\n const eqIdx = eqIndex(str, index, endIdx);\n const attr = eqIdx === -1\n ? valueSlice(str, index, endIdx)\n : valueSlice(str, index, eqIdx);\n const val = eqIdx === -1 ? undefined : valueSlice(str, eqIdx + 1, endIdx);\n switch (attr.toLowerCase()) {\n case \"httponly\":\n setCookie.httpOnly = true;\n break;\n case \"secure\":\n setCookie.secure = true;\n break;\n case \"partitioned\":\n setCookie.partitioned = true;\n break;\n case \"domain\":\n setCookie.domain = val;\n break;\n case \"path\":\n setCookie.path = val;\n break;\n case \"max-age\":\n if (val && maxAgeRegExp.test(val))\n setCookie.maxAge = Number(val);\n break;\n case \"expires\":\n if (!val)\n break;\n const date = new Date(val);\n if (Number.isFinite(date.valueOf()))\n setCookie.expires = date;\n break;\n case \"priority\":\n if (!val)\n break;\n const priority = val.toLowerCase();\n if (priority === \"low\" ||\n priority === \"medium\" ||\n priority === \"high\") {\n setCookie.priority = priority;\n }\n break;\n case \"samesite\":\n if (!val)\n break;\n const sameSite = val.toLowerCase();\n if (sameSite === \"lax\" ||\n sameSite === \"strict\" ||\n sameSite === \"none\") {\n setCookie.sameSite = sameSite;\n }\n break;\n }\n index = endIdx + 1;\n }\n return setCookie;\n}\n/**\n * Find the `;` character between `min` and `len` in str.\n */\nfunction endIndex(str, min, len) {\n const index = str.indexOf(\";\", min);\n return index === -1 ? len : index;\n}\n/**\n * Find the `=` character between `min` and `max` in str.\n */\nfunction eqIndex(str, min, max) {\n const index = str.indexOf(\"=\", min);\n return index < max ? index : -1;\n}\n/**\n * Slice out a value between startPod to max.\n */\nfunction valueSlice(str, min, max) {\n let start = min;\n let end = max;\n do {\n const code = str.charCodeAt(start);\n if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n break;\n } while (++start < end);\n while (end > start) {\n const code = str.charCodeAt(end - 1);\n if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n break;\n end--;\n }\n return str.slice(start, end);\n}\n/**\n * URL-decode string value. Optimized to skip native call when no %.\n */\nfunction decode(str) {\n if (str.indexOf(\"%\") === -1)\n return str;\n try {\n return decodeURIComponent(str);\n }\n catch (e) {\n return str;\n }\n}\n/**\n * Determine if value is a Date.\n */\nfunction isDate(val) {\n return __toString.call(val) === \"[object Date]\";\n}\n//# sourceMappingURL=index.js.map","import { parse as parseCookieHeader } from 'cookie';\nimport type { Request } from 'express';\n\nexport function parseCookies(cookieHeader?: string): Record<string, string> {\n if (!cookieHeader) return {};\n\n // `cookie.parse` decodes values safely (malformed %-sequences fall back to the\n // raw value instead of throwing) and ignores prototype keys.\n const parsed = parseCookieHeader(cookieHeader);\n const cookies: Record<string, string> = {};\n for (const [name, value] of Object.entries(parsed)) {\n if (value !== undefined) {\n cookies[name] = value;\n }\n }\n return cookies;\n}\n\nexport function createHeadersFromExpressRequest(req: Request): Headers {\n const headers = new Headers();\n\n Object.entries(req.headers).forEach(([key, value]) => {\n if (value === undefined) return;\n if (Array.isArray(value)) {\n value.forEach((item) => headers.append(key, item));\n return;\n }\n headers.set(key, value);\n });\n\n return headers;\n}\n","import { parseCookies } from '../core/request';\nimport { defineMiddleware } from './defineMiddleware';\nimport type { MiddlewareContext, MiddlewareHandler, RewritePayload } from './types';\n\n// From SvelteKit via Astro: compose middleware handlers in declaration order.\nexport function sequence(...handlers: Array<MiddlewareHandler | false | null | undefined>) {\n const filtered = handlers.filter(Boolean) as MiddlewareHandler[];\n const length = filtered.length;\n\n if (!length) {\n return defineMiddleware((_context, next) => {\n return next();\n });\n }\n\n return defineMiddleware((context, next) => {\n let carriedPayload: RewritePayload | undefined;\n return applyHandle(0, context);\n\n function applyHandle(\n i: number,\n handleContext: MiddlewareContext,\n ): Promise<Response> | Response {\n const handle = filtered[i];\n\n return handle(handleContext, async (payload?: RewritePayload) => {\n if (i < length - 1) {\n if (payload) {\n carriedPayload = payload;\n updateContextForRewrite(handleContext, payload);\n }\n return applyHandle(i + 1, handleContext);\n }\n\n return next(payload ?? carriedPayload);\n });\n }\n });\n}\n\nfunction updateContextForRewrite(context: MiddlewareContext, payload: RewritePayload): void {\n let request: Request;\n\n if (payload instanceof Request) {\n request = payload;\n } else if (payload instanceof URL) {\n request = new Request(payload.href, context.request.clone());\n } else {\n request = new Request(new URL(payload, context.url).href, context.request.clone());\n }\n\n const previousUrl = context.url;\n const nextUrl = new URL(request.url);\n const nextCookies = parseCookies(request.headers.get('cookie') ?? undefined);\n context.request = request;\n context.url = nextUrl;\n context.cookies = nextCookies;\n\n if (context.requestInfo) {\n const headers: Record<string, string> = {};\n request.headers.forEach((value, key) => {\n headers[key] = value;\n });\n\n context.requestInfo = {\n ...context.requestInfo,\n url: nextUrl,\n path: getRequestInfoPath(nextUrl, previousUrl, context.requestInfo.path),\n pathname: nextUrl.pathname,\n method: request.method,\n headers,\n cookies: nextCookies,\n query: Object.fromEntries(nextUrl.searchParams.entries()),\n };\n }\n}\n\nfunction getRequestInfoPath(nextUrl: URL, previousUrl: URL, previousPath?: string): string {\n const nextPath = `${nextUrl.pathname}${nextUrl.search}` || '/';\n if (!previousPath) {\n return nextPath;\n }\n\n const previousPathname = previousPath.split('?')[0] || '/';\n if (\n previousPathname === previousUrl.pathname ||\n !previousUrl.pathname.endsWith(previousPathname)\n ) {\n return nextPath;\n }\n\n const basePathname = previousUrl.pathname.slice(\n 0,\n previousUrl.pathname.length - previousPathname.length,\n );\n if (!basePathname || !nextUrl.pathname.startsWith(basePathname)) {\n return nextPath;\n }\n\n const strippedPathname = nextUrl.pathname.slice(basePathname.length) || '/';\n const normalizedPathname = strippedPathname.startsWith('/')\n ? strippedPathname\n : `/${strippedPathname}`;\n return `${normalizedPathname}${nextUrl.search}`;\n}\n","import { parseCookies } from '../core/request';\nimport { defineMiddleware } from './defineMiddleware';\nimport { sequence } from './sequence';\nimport type { CreateContext, MiddlewareContext, RewritePayload } from './types';\n\nexport type {\n CreateContext,\n MiddlewareContext,\n MiddlewareHandler,\n MiddlewareNext,\n RewritePayload,\n} from './types';\n\nexport { defineMiddleware, sequence };\n\nexport function createContext({\n request,\n requestInfo,\n locals = {},\n clientAddress,\n}: CreateContext): MiddlewareContext {\n const context = {\n cookies: parseCookies(request.headers.get('cookie') ?? undefined),\n request,\n requestInfo,\n url: new URL(request.url),\n redirect(path: string | URL, status = 302) {\n return new Response(null, {\n status,\n headers: {\n Location: path.toString(),\n },\n });\n },\n rewrite(payload: RewritePayload) {\n return Promise.resolve(new Response(null));\n },\n get clientAddress() {\n if (clientAddress) {\n return clientAddress;\n }\n throw new Error('clientAddress is not available for this request.');\n },\n } as Omit<MiddlewareContext, 'locals'> & {\n locals: Record<string, unknown>;\n };\n\n Object.defineProperty(context, 'locals', {\n enumerable: true,\n get() {\n if (typeof locals !== 'object' || locals === null || Array.isArray(locals)) {\n throw new Error('Middleware locals must be a plain object.');\n }\n return locals;\n },\n set() {\n throw new Error('Middleware locals cannot be reassigned. Mutate its properties instead.');\n },\n });\n\n context.rewrite = (payload: RewritePayload) => {\n return Promise.resolve(\n new Response(null, {\n status: 307,\n headers: {\n 'X-L5E-Rewrite': stringifyRewritePayload(payload, context.url),\n },\n }),\n );\n };\n\n return context;\n}\n\nfunction stringifyRewritePayload(payload: RewritePayload, currentUrl: URL): string {\n if (payload instanceof Request) {\n return payload.url;\n }\n\n if (payload instanceof URL) {\n return payload.href;\n }\n\n return new URL(payload, currentUrl).href;\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;CASA,AARA,OAAO,eAAe,GAAS,cAAc,EAAE,OAAO,GAAK,CAAC,GAE5D,EAAQ,QAAQ,GAEhB,EAAQ,qBAAqB,GAC7B,EAAQ,YAAY,GAEpB,EAAQ,qBAAqB,GAC7B,EAAQ,YAAY;CAepB,I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AAQ,QACb,IAAI,SAAS,MAAM;EACjB,QAAQ;EACR,SAAS,EACP,iBAAiB,EAAwB,GAAS,EAAQ,GAAG,EAC/D;CACF,CAAC,CACH,GAGK;AACT;AAEA,SAAS,EAAwB,GAAyB,GAAyB;CASjF,OARI,aAAmB,UACd,EAAQ,MAGb,aAAmB,MACd,EAAQ,OAGV,IAAI,IAAI,GAAS,CAAU,CAAC,CAAC;AACtC"}
|
package/dist/middleware.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
a as createContext,
|
|
5
|
-
t as defineMiddleware,
|
|
6
|
-
o as sequence
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=middleware.js.map
|
|
1
|
+
import { n as e, t } from "./middleware-CnDqZobD.js";
|
|
2
|
+
import { t as n } from "./defineMiddleware-D017PWDc.js";
|
|
3
|
+
export { t as createContext, n as defineMiddleware, e as sequence };
|