@openpkg-ts/react 0.2.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 +134 -0
- package/dist/index.d.ts +221 -0
- package/dist/index.js +34 -0
- package/dist/shared/chunk-0h2j0jvb.js +670 -0
- package/dist/styled.d.ts +504 -0
- package/dist/styled.js +4719 -0
- package/package.json +73 -0
package/dist/styled.js
ADDED
|
@@ -0,0 +1,4719 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
CollapsibleMethod,
|
|
4
|
+
ExampleBlock,
|
|
5
|
+
ExpandableProperty,
|
|
6
|
+
MemberRow,
|
|
7
|
+
MembersTable,
|
|
8
|
+
NestedProperty,
|
|
9
|
+
ParamRow,
|
|
10
|
+
ParamTable,
|
|
11
|
+
Signature,
|
|
12
|
+
TypeTable,
|
|
13
|
+
__commonJS,
|
|
14
|
+
__toESM,
|
|
15
|
+
cleanCode,
|
|
16
|
+
getExampleCode,
|
|
17
|
+
getExampleLanguage,
|
|
18
|
+
getExampleTitle,
|
|
19
|
+
groupMembersByKind
|
|
20
|
+
} from "./shared/chunk-0h2j0jvb.js";
|
|
21
|
+
|
|
22
|
+
// ../../node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs
|
|
23
|
+
var require__interop_require_wildcard = __commonJS((exports) => {
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
25
|
+
if (typeof WeakMap !== "function")
|
|
26
|
+
return null;
|
|
27
|
+
var cacheBabelInterop = new WeakMap;
|
|
28
|
+
var cacheNodeInterop = new WeakMap;
|
|
29
|
+
return (_getRequireWildcardCache = function(nodeInterop2) {
|
|
30
|
+
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
31
|
+
})(nodeInterop);
|
|
32
|
+
}
|
|
33
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
34
|
+
if (!nodeInterop && obj && obj.__esModule)
|
|
35
|
+
return obj;
|
|
36
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function")
|
|
37
|
+
return { default: obj };
|
|
38
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
39
|
+
if (cache && cache.has(obj))
|
|
40
|
+
return cache.get(obj);
|
|
41
|
+
var newObj = { __proto__: null };
|
|
42
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
43
|
+
for (var key in obj) {
|
|
44
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
45
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
46
|
+
if (desc && (desc.get || desc.set))
|
|
47
|
+
Object.defineProperty(newObj, key, desc);
|
|
48
|
+
else
|
|
49
|
+
newObj[key] = obj[key];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
newObj.default = obj;
|
|
53
|
+
if (cache)
|
|
54
|
+
cache.set(obj, newObj);
|
|
55
|
+
return newObj;
|
|
56
|
+
}
|
|
57
|
+
exports._ = _interop_require_wildcard;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/querystring.js
|
|
61
|
+
var require_querystring = __commonJS((exports) => {
|
|
62
|
+
Object.defineProperty(exports, "__esModule", {
|
|
63
|
+
value: true
|
|
64
|
+
});
|
|
65
|
+
function _export(target, all) {
|
|
66
|
+
for (var name in all)
|
|
67
|
+
Object.defineProperty(target, name, {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: all[name]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
_export(exports, {
|
|
73
|
+
assign: function() {
|
|
74
|
+
return assign;
|
|
75
|
+
},
|
|
76
|
+
searchParamsToUrlQuery: function() {
|
|
77
|
+
return searchParamsToUrlQuery;
|
|
78
|
+
},
|
|
79
|
+
urlQueryToSearchParams: function() {
|
|
80
|
+
return urlQueryToSearchParams;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
function searchParamsToUrlQuery(searchParams) {
|
|
84
|
+
const query = {};
|
|
85
|
+
for (const [key, value] of searchParams.entries()) {
|
|
86
|
+
const existing = query[key];
|
|
87
|
+
if (typeof existing === "undefined") {
|
|
88
|
+
query[key] = value;
|
|
89
|
+
} else if (Array.isArray(existing)) {
|
|
90
|
+
existing.push(value);
|
|
91
|
+
} else {
|
|
92
|
+
query[key] = [
|
|
93
|
+
existing,
|
|
94
|
+
value
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return query;
|
|
99
|
+
}
|
|
100
|
+
function stringifyUrlQueryParam(param) {
|
|
101
|
+
if (typeof param === "string") {
|
|
102
|
+
return param;
|
|
103
|
+
}
|
|
104
|
+
if (typeof param === "number" && !isNaN(param) || typeof param === "boolean") {
|
|
105
|
+
return String(param);
|
|
106
|
+
} else {
|
|
107
|
+
return "";
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function urlQueryToSearchParams(query) {
|
|
111
|
+
const searchParams = new URLSearchParams;
|
|
112
|
+
for (const [key, value] of Object.entries(query)) {
|
|
113
|
+
if (Array.isArray(value)) {
|
|
114
|
+
for (const item of value) {
|
|
115
|
+
searchParams.append(key, stringifyUrlQueryParam(item));
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
searchParams.set(key, stringifyUrlQueryParam(value));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return searchParams;
|
|
122
|
+
}
|
|
123
|
+
function assign(target) {
|
|
124
|
+
for (var _len = arguments.length, searchParamsList = new Array(_len > 1 ? _len - 1 : 0), _key = 1;_key < _len; _key++) {
|
|
125
|
+
searchParamsList[_key - 1] = arguments[_key];
|
|
126
|
+
}
|
|
127
|
+
for (const searchParams of searchParamsList) {
|
|
128
|
+
for (const key of searchParams.keys()) {
|
|
129
|
+
target.delete(key);
|
|
130
|
+
}
|
|
131
|
+
for (const [key, value] of searchParams.entries()) {
|
|
132
|
+
target.append(key, value);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return target;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/format-url.js
|
|
140
|
+
var require_format_url = __commonJS((exports) => {
|
|
141
|
+
Object.defineProperty(exports, "__esModule", {
|
|
142
|
+
value: true
|
|
143
|
+
});
|
|
144
|
+
function _export(target, all) {
|
|
145
|
+
for (var name in all)
|
|
146
|
+
Object.defineProperty(target, name, {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: all[name]
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
_export(exports, {
|
|
152
|
+
formatUrl: function() {
|
|
153
|
+
return formatUrl;
|
|
154
|
+
},
|
|
155
|
+
formatWithValidation: function() {
|
|
156
|
+
return formatWithValidation;
|
|
157
|
+
},
|
|
158
|
+
urlObjectKeys: function() {
|
|
159
|
+
return urlObjectKeys;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
var _interop_require_wildcard = require__interop_require_wildcard();
|
|
163
|
+
var _querystring = /* @__PURE__ */ _interop_require_wildcard._(require_querystring());
|
|
164
|
+
var slashedProtocols = /https?|ftp|gopher|file/;
|
|
165
|
+
function formatUrl(urlObj) {
|
|
166
|
+
let { auth, hostname } = urlObj;
|
|
167
|
+
let protocol = urlObj.protocol || "";
|
|
168
|
+
let pathname = urlObj.pathname || "";
|
|
169
|
+
let hash = urlObj.hash || "";
|
|
170
|
+
let query = urlObj.query || "";
|
|
171
|
+
let host = false;
|
|
172
|
+
auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ":") + "@" : "";
|
|
173
|
+
if (urlObj.host) {
|
|
174
|
+
host = auth + urlObj.host;
|
|
175
|
+
} else if (hostname) {
|
|
176
|
+
host = auth + (~hostname.indexOf(":") ? "[" + hostname + "]" : hostname);
|
|
177
|
+
if (urlObj.port) {
|
|
178
|
+
host += ":" + urlObj.port;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (query && typeof query === "object") {
|
|
182
|
+
query = String(_querystring.urlQueryToSearchParams(query));
|
|
183
|
+
}
|
|
184
|
+
let search = urlObj.search || query && "?" + query || "";
|
|
185
|
+
if (protocol && !protocol.endsWith(":"))
|
|
186
|
+
protocol += ":";
|
|
187
|
+
if (urlObj.slashes || (!protocol || slashedProtocols.test(protocol)) && host !== false) {
|
|
188
|
+
host = "//" + (host || "");
|
|
189
|
+
if (pathname && pathname[0] !== "/")
|
|
190
|
+
pathname = "/" + pathname;
|
|
191
|
+
} else if (!host) {
|
|
192
|
+
host = "";
|
|
193
|
+
}
|
|
194
|
+
if (hash && hash[0] !== "#")
|
|
195
|
+
hash = "#" + hash;
|
|
196
|
+
if (search && search[0] !== "?")
|
|
197
|
+
search = "?" + search;
|
|
198
|
+
pathname = pathname.replace(/[?#]/g, encodeURIComponent);
|
|
199
|
+
search = search.replace("#", "%23");
|
|
200
|
+
return "" + protocol + host + pathname + search + hash;
|
|
201
|
+
}
|
|
202
|
+
var urlObjectKeys = [
|
|
203
|
+
"auth",
|
|
204
|
+
"hash",
|
|
205
|
+
"host",
|
|
206
|
+
"hostname",
|
|
207
|
+
"href",
|
|
208
|
+
"path",
|
|
209
|
+
"pathname",
|
|
210
|
+
"port",
|
|
211
|
+
"protocol",
|
|
212
|
+
"query",
|
|
213
|
+
"search",
|
|
214
|
+
"slashes"
|
|
215
|
+
];
|
|
216
|
+
function formatWithValidation(url) {
|
|
217
|
+
if (false) {}
|
|
218
|
+
return formatUrl(url);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/omit.js
|
|
223
|
+
var require_omit = __commonJS((exports) => {
|
|
224
|
+
Object.defineProperty(exports, "__esModule", {
|
|
225
|
+
value: true
|
|
226
|
+
});
|
|
227
|
+
Object.defineProperty(exports, "omit", {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
get: function() {
|
|
230
|
+
return omit;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
function omit(object, keys) {
|
|
234
|
+
const omitted = {};
|
|
235
|
+
Object.keys(object).forEach((key) => {
|
|
236
|
+
if (!keys.includes(key)) {
|
|
237
|
+
omitted[key] = object[key];
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
return omitted;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
// ../../node_modules/next/dist/shared/lib/utils.js
|
|
245
|
+
var require_utils = __commonJS((exports) => {
|
|
246
|
+
Object.defineProperty(exports, "__esModule", {
|
|
247
|
+
value: true
|
|
248
|
+
});
|
|
249
|
+
function _export(target, all) {
|
|
250
|
+
for (var name in all)
|
|
251
|
+
Object.defineProperty(target, name, {
|
|
252
|
+
enumerable: true,
|
|
253
|
+
get: all[name]
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
_export(exports, {
|
|
257
|
+
DecodeError: function() {
|
|
258
|
+
return DecodeError;
|
|
259
|
+
},
|
|
260
|
+
MiddlewareNotFoundError: function() {
|
|
261
|
+
return MiddlewareNotFoundError;
|
|
262
|
+
},
|
|
263
|
+
MissingStaticPage: function() {
|
|
264
|
+
return MissingStaticPage;
|
|
265
|
+
},
|
|
266
|
+
NormalizeError: function() {
|
|
267
|
+
return NormalizeError;
|
|
268
|
+
},
|
|
269
|
+
PageNotFoundError: function() {
|
|
270
|
+
return PageNotFoundError;
|
|
271
|
+
},
|
|
272
|
+
SP: function() {
|
|
273
|
+
return SP;
|
|
274
|
+
},
|
|
275
|
+
ST: function() {
|
|
276
|
+
return ST;
|
|
277
|
+
},
|
|
278
|
+
WEB_VITALS: function() {
|
|
279
|
+
return WEB_VITALS;
|
|
280
|
+
},
|
|
281
|
+
execOnce: function() {
|
|
282
|
+
return execOnce;
|
|
283
|
+
},
|
|
284
|
+
getDisplayName: function() {
|
|
285
|
+
return getDisplayName;
|
|
286
|
+
},
|
|
287
|
+
getLocationOrigin: function() {
|
|
288
|
+
return getLocationOrigin;
|
|
289
|
+
},
|
|
290
|
+
getURL: function() {
|
|
291
|
+
return getURL;
|
|
292
|
+
},
|
|
293
|
+
isAbsoluteUrl: function() {
|
|
294
|
+
return isAbsoluteUrl;
|
|
295
|
+
},
|
|
296
|
+
isResSent: function() {
|
|
297
|
+
return isResSent;
|
|
298
|
+
},
|
|
299
|
+
loadGetInitialProps: function() {
|
|
300
|
+
return loadGetInitialProps;
|
|
301
|
+
},
|
|
302
|
+
normalizeRepeatedSlashes: function() {
|
|
303
|
+
return normalizeRepeatedSlashes;
|
|
304
|
+
},
|
|
305
|
+
stringifyError: function() {
|
|
306
|
+
return stringifyError;
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
var WEB_VITALS = [
|
|
310
|
+
"CLS",
|
|
311
|
+
"FCP",
|
|
312
|
+
"FID",
|
|
313
|
+
"INP",
|
|
314
|
+
"LCP",
|
|
315
|
+
"TTFB"
|
|
316
|
+
];
|
|
317
|
+
function execOnce(fn) {
|
|
318
|
+
let used = false;
|
|
319
|
+
let result;
|
|
320
|
+
return function() {
|
|
321
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) {
|
|
322
|
+
args[_key] = arguments[_key];
|
|
323
|
+
}
|
|
324
|
+
if (!used) {
|
|
325
|
+
used = true;
|
|
326
|
+
result = fn(...args);
|
|
327
|
+
}
|
|
328
|
+
return result;
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
var ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
|
|
332
|
+
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
333
|
+
function getLocationOrigin() {
|
|
334
|
+
const { protocol, hostname, port } = window.location;
|
|
335
|
+
return protocol + "//" + hostname + (port ? ":" + port : "");
|
|
336
|
+
}
|
|
337
|
+
function getURL() {
|
|
338
|
+
const { href } = window.location;
|
|
339
|
+
const origin = getLocationOrigin();
|
|
340
|
+
return href.substring(origin.length);
|
|
341
|
+
}
|
|
342
|
+
function getDisplayName(Component) {
|
|
343
|
+
return typeof Component === "string" ? Component : Component.displayName || Component.name || "Unknown";
|
|
344
|
+
}
|
|
345
|
+
function isResSent(res) {
|
|
346
|
+
return res.finished || res.headersSent;
|
|
347
|
+
}
|
|
348
|
+
function normalizeRepeatedSlashes(url) {
|
|
349
|
+
const urlParts = url.split("?");
|
|
350
|
+
const urlNoQuery = urlParts[0];
|
|
351
|
+
return urlNoQuery.replace(/\\/g, "/").replace(/\/\/+/g, "/") + (urlParts[1] ? "?" + urlParts.slice(1).join("?") : "");
|
|
352
|
+
}
|
|
353
|
+
async function loadGetInitialProps(App, ctx) {
|
|
354
|
+
if (false) {
|
|
355
|
+
var _App_prototype;
|
|
356
|
+
}
|
|
357
|
+
const res = ctx.res || ctx.ctx && ctx.ctx.res;
|
|
358
|
+
if (!App.getInitialProps) {
|
|
359
|
+
if (ctx.ctx && ctx.Component) {
|
|
360
|
+
return {
|
|
361
|
+
pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx)
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
return {};
|
|
365
|
+
}
|
|
366
|
+
const props = await App.getInitialProps(ctx);
|
|
367
|
+
if (res && isResSent(res)) {
|
|
368
|
+
return props;
|
|
369
|
+
}
|
|
370
|
+
if (!props) {
|
|
371
|
+
const message = '"' + getDisplayName(App) + '.getInitialProps()" should resolve to an object. But found "' + props + '" instead.';
|
|
372
|
+
throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
373
|
+
value: "E394",
|
|
374
|
+
enumerable: false,
|
|
375
|
+
configurable: true
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
if (false) {}
|
|
379
|
+
return props;
|
|
380
|
+
}
|
|
381
|
+
var SP = typeof performance !== "undefined";
|
|
382
|
+
var ST = SP && [
|
|
383
|
+
"mark",
|
|
384
|
+
"measure",
|
|
385
|
+
"getEntriesByName"
|
|
386
|
+
].every((method) => typeof performance[method] === "function");
|
|
387
|
+
|
|
388
|
+
class DecodeError extends Error {
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
class NormalizeError extends Error {
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
class PageNotFoundError extends Error {
|
|
395
|
+
constructor(page) {
|
|
396
|
+
super();
|
|
397
|
+
this.code = "ENOENT";
|
|
398
|
+
this.name = "PageNotFoundError";
|
|
399
|
+
this.message = "Cannot find module for page: " + page;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
class MissingStaticPage extends Error {
|
|
404
|
+
constructor(page, message) {
|
|
405
|
+
super();
|
|
406
|
+
this.message = "Failed to load static file for page: " + page + " " + message;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
class MiddlewareNotFoundError extends Error {
|
|
411
|
+
constructor() {
|
|
412
|
+
super();
|
|
413
|
+
this.code = "ENOENT";
|
|
414
|
+
this.message = "Cannot find the middleware module";
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function stringifyError(error) {
|
|
418
|
+
return JSON.stringify({
|
|
419
|
+
message: error.message,
|
|
420
|
+
stack: error.stack
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js
|
|
426
|
+
var require_remove_trailing_slash = __commonJS((exports) => {
|
|
427
|
+
Object.defineProperty(exports, "__esModule", {
|
|
428
|
+
value: true
|
|
429
|
+
});
|
|
430
|
+
Object.defineProperty(exports, "removeTrailingSlash", {
|
|
431
|
+
enumerable: true,
|
|
432
|
+
get: function() {
|
|
433
|
+
return removeTrailingSlash;
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
function removeTrailingSlash(route) {
|
|
437
|
+
return route.replace(/\/$/, "") || "/";
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/parse-path.js
|
|
442
|
+
var require_parse_path = __commonJS((exports) => {
|
|
443
|
+
Object.defineProperty(exports, "__esModule", {
|
|
444
|
+
value: true
|
|
445
|
+
});
|
|
446
|
+
Object.defineProperty(exports, "parsePath", {
|
|
447
|
+
enumerable: true,
|
|
448
|
+
get: function() {
|
|
449
|
+
return parsePath;
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
function parsePath(path) {
|
|
453
|
+
const hashIndex = path.indexOf("#");
|
|
454
|
+
const queryIndex = path.indexOf("?");
|
|
455
|
+
const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);
|
|
456
|
+
if (hasQuery || hashIndex > -1) {
|
|
457
|
+
return {
|
|
458
|
+
pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),
|
|
459
|
+
query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined) : "",
|
|
460
|
+
hash: hashIndex > -1 ? path.slice(hashIndex) : ""
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
return {
|
|
464
|
+
pathname: path,
|
|
465
|
+
query: "",
|
|
466
|
+
hash: ""
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
// ../../node_modules/next/dist/client/normalize-trailing-slash.js
|
|
472
|
+
var require_normalize_trailing_slash = __commonJS((exports, module) => {
|
|
473
|
+
Object.defineProperty(exports, "__esModule", {
|
|
474
|
+
value: true
|
|
475
|
+
});
|
|
476
|
+
Object.defineProperty(exports, "normalizePathTrailingSlash", {
|
|
477
|
+
enumerable: true,
|
|
478
|
+
get: function() {
|
|
479
|
+
return normalizePathTrailingSlash;
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
var _removetrailingslash = require_remove_trailing_slash();
|
|
483
|
+
var _parsepath = require_parse_path();
|
|
484
|
+
var normalizePathTrailingSlash = (path) => {
|
|
485
|
+
if (!path.startsWith("/") || process.env.__NEXT_MANUAL_TRAILING_SLASH) {
|
|
486
|
+
return path;
|
|
487
|
+
}
|
|
488
|
+
const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
|
|
489
|
+
if (process.env.__NEXT_TRAILING_SLASH) {
|
|
490
|
+
if (/\.[^/]+\/?$/.test(pathname)) {
|
|
491
|
+
return "" + (0, _removetrailingslash.removeTrailingSlash)(pathname) + query + hash;
|
|
492
|
+
} else if (pathname.endsWith("/")) {
|
|
493
|
+
return "" + pathname + query + hash;
|
|
494
|
+
} else {
|
|
495
|
+
return pathname + "/" + query + hash;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return "" + (0, _removetrailingslash.removeTrailingSlash)(pathname) + query + hash;
|
|
499
|
+
};
|
|
500
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
501
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
502
|
+
Object.assign(exports.default, exports);
|
|
503
|
+
module.exports = exports.default;
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js
|
|
508
|
+
var require_path_has_prefix = __commonJS((exports) => {
|
|
509
|
+
Object.defineProperty(exports, "__esModule", {
|
|
510
|
+
value: true
|
|
511
|
+
});
|
|
512
|
+
Object.defineProperty(exports, "pathHasPrefix", {
|
|
513
|
+
enumerable: true,
|
|
514
|
+
get: function() {
|
|
515
|
+
return pathHasPrefix;
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
var _parsepath = require_parse_path();
|
|
519
|
+
function pathHasPrefix(path, prefix) {
|
|
520
|
+
if (typeof path !== "string") {
|
|
521
|
+
return false;
|
|
522
|
+
}
|
|
523
|
+
const { pathname } = (0, _parsepath.parsePath)(path);
|
|
524
|
+
return pathname === prefix || pathname.startsWith(prefix + "/");
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
// ../../node_modules/next/dist/client/has-base-path.js
|
|
529
|
+
var require_has_base_path = __commonJS((exports, module) => {
|
|
530
|
+
Object.defineProperty(exports, "__esModule", {
|
|
531
|
+
value: true
|
|
532
|
+
});
|
|
533
|
+
Object.defineProperty(exports, "hasBasePath", {
|
|
534
|
+
enumerable: true,
|
|
535
|
+
get: function() {
|
|
536
|
+
return hasBasePath;
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
var _pathhasprefix = require_path_has_prefix();
|
|
540
|
+
var basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
|
|
541
|
+
function hasBasePath(path) {
|
|
542
|
+
return (0, _pathhasprefix.pathHasPrefix)(path, basePath);
|
|
543
|
+
}
|
|
544
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
545
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
546
|
+
Object.assign(exports.default, exports);
|
|
547
|
+
module.exports = exports.default;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/is-local-url.js
|
|
552
|
+
var require_is_local_url = __commonJS((exports) => {
|
|
553
|
+
Object.defineProperty(exports, "__esModule", {
|
|
554
|
+
value: true
|
|
555
|
+
});
|
|
556
|
+
Object.defineProperty(exports, "isLocalURL", {
|
|
557
|
+
enumerable: true,
|
|
558
|
+
get: function() {
|
|
559
|
+
return isLocalURL;
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
var _utils = require_utils();
|
|
563
|
+
var _hasbasepath = require_has_base_path();
|
|
564
|
+
function isLocalURL(url) {
|
|
565
|
+
if (!(0, _utils.isAbsoluteUrl)(url))
|
|
566
|
+
return true;
|
|
567
|
+
try {
|
|
568
|
+
const locationOrigin = (0, _utils.getLocationOrigin)();
|
|
569
|
+
const resolved = new URL(url, locationOrigin);
|
|
570
|
+
return resolved.origin === locationOrigin && (0, _hasbasepath.hasBasePath)(resolved.pathname);
|
|
571
|
+
} catch (_) {
|
|
572
|
+
return false;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/sorted-routes.js
|
|
578
|
+
var require_sorted_routes = __commonJS((exports) => {
|
|
579
|
+
Object.defineProperty(exports, "__esModule", {
|
|
580
|
+
value: true
|
|
581
|
+
});
|
|
582
|
+
function _export(target, all) {
|
|
583
|
+
for (var name in all)
|
|
584
|
+
Object.defineProperty(target, name, {
|
|
585
|
+
enumerable: true,
|
|
586
|
+
get: all[name]
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
_export(exports, {
|
|
590
|
+
getSortedRouteObjects: function() {
|
|
591
|
+
return getSortedRouteObjects;
|
|
592
|
+
},
|
|
593
|
+
getSortedRoutes: function() {
|
|
594
|
+
return getSortedRoutes;
|
|
595
|
+
}
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
class UrlNode {
|
|
599
|
+
insert(urlPath) {
|
|
600
|
+
this._insert(urlPath.split("/").filter(Boolean), [], false);
|
|
601
|
+
}
|
|
602
|
+
smoosh() {
|
|
603
|
+
return this._smoosh();
|
|
604
|
+
}
|
|
605
|
+
_smoosh(prefix) {
|
|
606
|
+
if (prefix === undefined)
|
|
607
|
+
prefix = "/";
|
|
608
|
+
const childrenPaths = [
|
|
609
|
+
...this.children.keys()
|
|
610
|
+
].sort();
|
|
611
|
+
if (this.slugName !== null) {
|
|
612
|
+
childrenPaths.splice(childrenPaths.indexOf("[]"), 1);
|
|
613
|
+
}
|
|
614
|
+
if (this.restSlugName !== null) {
|
|
615
|
+
childrenPaths.splice(childrenPaths.indexOf("[...]"), 1);
|
|
616
|
+
}
|
|
617
|
+
if (this.optionalRestSlugName !== null) {
|
|
618
|
+
childrenPaths.splice(childrenPaths.indexOf("[[...]]"), 1);
|
|
619
|
+
}
|
|
620
|
+
const routes = childrenPaths.map((c) => this.children.get(c)._smoosh("" + prefix + c + "/")).reduce((prev, curr) => [
|
|
621
|
+
...prev,
|
|
622
|
+
...curr
|
|
623
|
+
], []);
|
|
624
|
+
if (this.slugName !== null) {
|
|
625
|
+
routes.push(...this.children.get("[]")._smoosh(prefix + "[" + this.slugName + "]/"));
|
|
626
|
+
}
|
|
627
|
+
if (!this.placeholder) {
|
|
628
|
+
const r = prefix === "/" ? "/" : prefix.slice(0, -1);
|
|
629
|
+
if (this.optionalRestSlugName != null) {
|
|
630
|
+
throw Object.defineProperty(new Error('You cannot define a route with the same specificity as a optional catch-all route ("' + r + '" and "' + r + "[[..." + this.optionalRestSlugName + ']]").'), "__NEXT_ERROR_CODE", {
|
|
631
|
+
value: "E458",
|
|
632
|
+
enumerable: false,
|
|
633
|
+
configurable: true
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
routes.unshift(r);
|
|
637
|
+
}
|
|
638
|
+
if (this.restSlugName !== null) {
|
|
639
|
+
routes.push(...this.children.get("[...]")._smoosh(prefix + "[..." + this.restSlugName + "]/"));
|
|
640
|
+
}
|
|
641
|
+
if (this.optionalRestSlugName !== null) {
|
|
642
|
+
routes.push(...this.children.get("[[...]]")._smoosh(prefix + "[[..." + this.optionalRestSlugName + "]]/"));
|
|
643
|
+
}
|
|
644
|
+
return routes;
|
|
645
|
+
}
|
|
646
|
+
_insert(urlPaths, slugNames, isCatchAll) {
|
|
647
|
+
if (urlPaths.length === 0) {
|
|
648
|
+
this.placeholder = false;
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
if (isCatchAll) {
|
|
652
|
+
throw Object.defineProperty(new Error("Catch-all must be the last part of the URL."), "__NEXT_ERROR_CODE", {
|
|
653
|
+
value: "E392",
|
|
654
|
+
enumerable: false,
|
|
655
|
+
configurable: true
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
let nextSegment = urlPaths[0];
|
|
659
|
+
if (nextSegment.startsWith("[") && nextSegment.endsWith("]")) {
|
|
660
|
+
let handleSlug = function(previousSlug, nextSlug) {
|
|
661
|
+
if (previousSlug !== null) {
|
|
662
|
+
if (previousSlug !== nextSlug) {
|
|
663
|
+
throw Object.defineProperty(new Error("You cannot use different slug names for the same dynamic path ('" + previousSlug + "' !== '" + nextSlug + "')."), "__NEXT_ERROR_CODE", {
|
|
664
|
+
value: "E337",
|
|
665
|
+
enumerable: false,
|
|
666
|
+
configurable: true
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
slugNames.forEach((slug) => {
|
|
671
|
+
if (slug === nextSlug) {
|
|
672
|
+
throw Object.defineProperty(new Error('You cannot have the same slug name "' + nextSlug + '" repeat within a single dynamic path'), "__NEXT_ERROR_CODE", {
|
|
673
|
+
value: "E247",
|
|
674
|
+
enumerable: false,
|
|
675
|
+
configurable: true
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
if (slug.replace(/\W/g, "") === nextSegment.replace(/\W/g, "")) {
|
|
679
|
+
throw Object.defineProperty(new Error('You cannot have the slug names "' + slug + '" and "' + nextSlug + '" differ only by non-word symbols within a single dynamic path'), "__NEXT_ERROR_CODE", {
|
|
680
|
+
value: "E499",
|
|
681
|
+
enumerable: false,
|
|
682
|
+
configurable: true
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
slugNames.push(nextSlug);
|
|
687
|
+
};
|
|
688
|
+
let segmentName = nextSegment.slice(1, -1);
|
|
689
|
+
let isOptional = false;
|
|
690
|
+
if (segmentName.startsWith("[") && segmentName.endsWith("]")) {
|
|
691
|
+
segmentName = segmentName.slice(1, -1);
|
|
692
|
+
isOptional = true;
|
|
693
|
+
}
|
|
694
|
+
if (segmentName.startsWith("…")) {
|
|
695
|
+
throw Object.defineProperty(new Error("Detected a three-dot character ('…') at ('" + segmentName + "'). Did you mean ('...')?"), "__NEXT_ERROR_CODE", {
|
|
696
|
+
value: "E147",
|
|
697
|
+
enumerable: false,
|
|
698
|
+
configurable: true
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
if (segmentName.startsWith("...")) {
|
|
702
|
+
segmentName = segmentName.substring(3);
|
|
703
|
+
isCatchAll = true;
|
|
704
|
+
}
|
|
705
|
+
if (segmentName.startsWith("[") || segmentName.endsWith("]")) {
|
|
706
|
+
throw Object.defineProperty(new Error("Segment names may not start or end with extra brackets ('" + segmentName + "')."), "__NEXT_ERROR_CODE", {
|
|
707
|
+
value: "E421",
|
|
708
|
+
enumerable: false,
|
|
709
|
+
configurable: true
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
if (segmentName.startsWith(".")) {
|
|
713
|
+
throw Object.defineProperty(new Error("Segment names may not start with erroneous periods ('" + segmentName + "')."), "__NEXT_ERROR_CODE", {
|
|
714
|
+
value: "E288",
|
|
715
|
+
enumerable: false,
|
|
716
|
+
configurable: true
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
if (isCatchAll) {
|
|
720
|
+
if (isOptional) {
|
|
721
|
+
if (this.restSlugName != null) {
|
|
722
|
+
throw Object.defineProperty(new Error('You cannot use both an required and optional catch-all route at the same level ("[...' + this.restSlugName + ']" and "' + urlPaths[0] + '" ).'), "__NEXT_ERROR_CODE", {
|
|
723
|
+
value: "E299",
|
|
724
|
+
enumerable: false,
|
|
725
|
+
configurable: true
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
handleSlug(this.optionalRestSlugName, segmentName);
|
|
729
|
+
this.optionalRestSlugName = segmentName;
|
|
730
|
+
nextSegment = "[[...]]";
|
|
731
|
+
} else {
|
|
732
|
+
if (this.optionalRestSlugName != null) {
|
|
733
|
+
throw Object.defineProperty(new Error('You cannot use both an optional and required catch-all route at the same level ("[[...' + this.optionalRestSlugName + ']]" and "' + urlPaths[0] + '").'), "__NEXT_ERROR_CODE", {
|
|
734
|
+
value: "E300",
|
|
735
|
+
enumerable: false,
|
|
736
|
+
configurable: true
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
handleSlug(this.restSlugName, segmentName);
|
|
740
|
+
this.restSlugName = segmentName;
|
|
741
|
+
nextSegment = "[...]";
|
|
742
|
+
}
|
|
743
|
+
} else {
|
|
744
|
+
if (isOptional) {
|
|
745
|
+
throw Object.defineProperty(new Error('Optional route parameters are not yet supported ("' + urlPaths[0] + '").'), "__NEXT_ERROR_CODE", {
|
|
746
|
+
value: "E435",
|
|
747
|
+
enumerable: false,
|
|
748
|
+
configurable: true
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
handleSlug(this.slugName, segmentName);
|
|
752
|
+
this.slugName = segmentName;
|
|
753
|
+
nextSegment = "[]";
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
if (!this.children.has(nextSegment)) {
|
|
757
|
+
this.children.set(nextSegment, new UrlNode);
|
|
758
|
+
}
|
|
759
|
+
this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);
|
|
760
|
+
}
|
|
761
|
+
constructor() {
|
|
762
|
+
this.placeholder = true;
|
|
763
|
+
this.children = new Map;
|
|
764
|
+
this.slugName = null;
|
|
765
|
+
this.restSlugName = null;
|
|
766
|
+
this.optionalRestSlugName = null;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
function getSortedRoutes(normalizedPages) {
|
|
770
|
+
const root = new UrlNode;
|
|
771
|
+
normalizedPages.forEach((pagePath) => root.insert(pagePath));
|
|
772
|
+
return root.smoosh();
|
|
773
|
+
}
|
|
774
|
+
function getSortedRouteObjects(objects, getter) {
|
|
775
|
+
const indexes = {};
|
|
776
|
+
const pathnames = [];
|
|
777
|
+
for (let i = 0;i < objects.length; i++) {
|
|
778
|
+
const pathname = getter(objects[i]);
|
|
779
|
+
indexes[pathname] = i;
|
|
780
|
+
pathnames[i] = pathname;
|
|
781
|
+
}
|
|
782
|
+
const sorted = getSortedRoutes(pathnames);
|
|
783
|
+
return sorted.map((pathname) => objects[indexes[pathname]]);
|
|
784
|
+
}
|
|
785
|
+
});
|
|
786
|
+
|
|
787
|
+
// ../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js
|
|
788
|
+
var require_ensure_leading_slash = __commonJS((exports) => {
|
|
789
|
+
Object.defineProperty(exports, "__esModule", {
|
|
790
|
+
value: true
|
|
791
|
+
});
|
|
792
|
+
Object.defineProperty(exports, "ensureLeadingSlash", {
|
|
793
|
+
enumerable: true,
|
|
794
|
+
get: function() {
|
|
795
|
+
return ensureLeadingSlash;
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
function ensureLeadingSlash(path) {
|
|
799
|
+
return path.startsWith("/") ? path : "/" + path;
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
|
|
803
|
+
// ../../node_modules/next/dist/shared/lib/segment.js
|
|
804
|
+
var require_segment = __commonJS((exports) => {
|
|
805
|
+
Object.defineProperty(exports, "__esModule", {
|
|
806
|
+
value: true
|
|
807
|
+
});
|
|
808
|
+
function _export(target, all) {
|
|
809
|
+
for (var name in all)
|
|
810
|
+
Object.defineProperty(target, name, {
|
|
811
|
+
enumerable: true,
|
|
812
|
+
get: all[name]
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
_export(exports, {
|
|
816
|
+
DEFAULT_SEGMENT_KEY: function() {
|
|
817
|
+
return DEFAULT_SEGMENT_KEY;
|
|
818
|
+
},
|
|
819
|
+
PAGE_SEGMENT_KEY: function() {
|
|
820
|
+
return PAGE_SEGMENT_KEY;
|
|
821
|
+
},
|
|
822
|
+
addSearchParamsIfPageSegment: function() {
|
|
823
|
+
return addSearchParamsIfPageSegment;
|
|
824
|
+
},
|
|
825
|
+
isGroupSegment: function() {
|
|
826
|
+
return isGroupSegment;
|
|
827
|
+
},
|
|
828
|
+
isParallelRouteSegment: function() {
|
|
829
|
+
return isParallelRouteSegment;
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
function isGroupSegment(segment) {
|
|
833
|
+
return segment[0] === "(" && segment.endsWith(")");
|
|
834
|
+
}
|
|
835
|
+
function isParallelRouteSegment(segment) {
|
|
836
|
+
return segment.startsWith("@") && segment !== "@children";
|
|
837
|
+
}
|
|
838
|
+
function addSearchParamsIfPageSegment(segment, searchParams) {
|
|
839
|
+
const isPageSegment = segment.includes(PAGE_SEGMENT_KEY);
|
|
840
|
+
if (isPageSegment) {
|
|
841
|
+
const stringifiedQuery = JSON.stringify(searchParams);
|
|
842
|
+
return stringifiedQuery !== "{}" ? PAGE_SEGMENT_KEY + "?" + stringifiedQuery : PAGE_SEGMENT_KEY;
|
|
843
|
+
}
|
|
844
|
+
return segment;
|
|
845
|
+
}
|
|
846
|
+
var PAGE_SEGMENT_KEY = "__PAGE__";
|
|
847
|
+
var DEFAULT_SEGMENT_KEY = "__DEFAULT__";
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/app-paths.js
|
|
851
|
+
var require_app_paths = __commonJS((exports) => {
|
|
852
|
+
Object.defineProperty(exports, "__esModule", {
|
|
853
|
+
value: true
|
|
854
|
+
});
|
|
855
|
+
function _export(target, all) {
|
|
856
|
+
for (var name in all)
|
|
857
|
+
Object.defineProperty(target, name, {
|
|
858
|
+
enumerable: true,
|
|
859
|
+
get: all[name]
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
_export(exports, {
|
|
863
|
+
normalizeAppPath: function() {
|
|
864
|
+
return normalizeAppPath;
|
|
865
|
+
},
|
|
866
|
+
normalizeRscURL: function() {
|
|
867
|
+
return normalizeRscURL;
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
var _ensureleadingslash = require_ensure_leading_slash();
|
|
871
|
+
var _segment = require_segment();
|
|
872
|
+
function normalizeAppPath(route) {
|
|
873
|
+
return (0, _ensureleadingslash.ensureLeadingSlash)(route.split("/").reduce((pathname, segment, index, segments) => {
|
|
874
|
+
if (!segment) {
|
|
875
|
+
return pathname;
|
|
876
|
+
}
|
|
877
|
+
if ((0, _segment.isGroupSegment)(segment)) {
|
|
878
|
+
return pathname;
|
|
879
|
+
}
|
|
880
|
+
if (segment[0] === "@") {
|
|
881
|
+
return pathname;
|
|
882
|
+
}
|
|
883
|
+
if ((segment === "page" || segment === "route") && index === segments.length - 1) {
|
|
884
|
+
return pathname;
|
|
885
|
+
}
|
|
886
|
+
return pathname + "/" + segment;
|
|
887
|
+
}, ""));
|
|
888
|
+
}
|
|
889
|
+
function normalizeRscURL(url) {
|
|
890
|
+
return url.replace(/\.rsc($|\?)/, "$1");
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
|
|
894
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/interception-routes.js
|
|
895
|
+
var require_interception_routes = __commonJS((exports) => {
|
|
896
|
+
Object.defineProperty(exports, "__esModule", {
|
|
897
|
+
value: true
|
|
898
|
+
});
|
|
899
|
+
function _export(target, all) {
|
|
900
|
+
for (var name in all)
|
|
901
|
+
Object.defineProperty(target, name, {
|
|
902
|
+
enumerable: true,
|
|
903
|
+
get: all[name]
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
_export(exports, {
|
|
907
|
+
INTERCEPTION_ROUTE_MARKERS: function() {
|
|
908
|
+
return INTERCEPTION_ROUTE_MARKERS;
|
|
909
|
+
},
|
|
910
|
+
extractInterceptionRouteInformation: function() {
|
|
911
|
+
return extractInterceptionRouteInformation;
|
|
912
|
+
},
|
|
913
|
+
isInterceptionRouteAppPath: function() {
|
|
914
|
+
return isInterceptionRouteAppPath;
|
|
915
|
+
}
|
|
916
|
+
});
|
|
917
|
+
var _apppaths = require_app_paths();
|
|
918
|
+
var INTERCEPTION_ROUTE_MARKERS = [
|
|
919
|
+
"(..)(..)",
|
|
920
|
+
"(.)",
|
|
921
|
+
"(..)",
|
|
922
|
+
"(...)"
|
|
923
|
+
];
|
|
924
|
+
function isInterceptionRouteAppPath(path) {
|
|
925
|
+
return path.split("/").find((segment) => INTERCEPTION_ROUTE_MARKERS.find((m) => segment.startsWith(m))) !== undefined;
|
|
926
|
+
}
|
|
927
|
+
function extractInterceptionRouteInformation(path) {
|
|
928
|
+
let interceptingRoute, marker, interceptedRoute;
|
|
929
|
+
for (const segment of path.split("/")) {
|
|
930
|
+
marker = INTERCEPTION_ROUTE_MARKERS.find((m) => segment.startsWith(m));
|
|
931
|
+
if (marker) {
|
|
932
|
+
[interceptingRoute, interceptedRoute] = path.split(marker, 2);
|
|
933
|
+
break;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
if (!interceptingRoute || !marker || !interceptedRoute) {
|
|
937
|
+
throw Object.defineProperty(new Error("Invalid interception route: " + path + ". Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>"), "__NEXT_ERROR_CODE", {
|
|
938
|
+
value: "E269",
|
|
939
|
+
enumerable: false,
|
|
940
|
+
configurable: true
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
interceptingRoute = (0, _apppaths.normalizeAppPath)(interceptingRoute);
|
|
944
|
+
switch (marker) {
|
|
945
|
+
case "(.)":
|
|
946
|
+
if (interceptingRoute === "/") {
|
|
947
|
+
interceptedRoute = "/" + interceptedRoute;
|
|
948
|
+
} else {
|
|
949
|
+
interceptedRoute = interceptingRoute + "/" + interceptedRoute;
|
|
950
|
+
}
|
|
951
|
+
break;
|
|
952
|
+
case "(..)":
|
|
953
|
+
if (interceptingRoute === "/") {
|
|
954
|
+
throw Object.defineProperty(new Error("Invalid interception route: " + path + ". Cannot use (..) marker at the root level, use (.) instead."), "__NEXT_ERROR_CODE", {
|
|
955
|
+
value: "E207",
|
|
956
|
+
enumerable: false,
|
|
957
|
+
configurable: true
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
interceptedRoute = interceptingRoute.split("/").slice(0, -1).concat(interceptedRoute).join("/");
|
|
961
|
+
break;
|
|
962
|
+
case "(...)":
|
|
963
|
+
interceptedRoute = "/" + interceptedRoute;
|
|
964
|
+
break;
|
|
965
|
+
case "(..)(..)":
|
|
966
|
+
const splitInterceptingRoute = interceptingRoute.split("/");
|
|
967
|
+
if (splitInterceptingRoute.length <= 2) {
|
|
968
|
+
throw Object.defineProperty(new Error("Invalid interception route: " + path + ". Cannot use (..)(..) marker at the root level or one level up."), "__NEXT_ERROR_CODE", {
|
|
969
|
+
value: "E486",
|
|
970
|
+
enumerable: false,
|
|
971
|
+
configurable: true
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join("/");
|
|
975
|
+
break;
|
|
976
|
+
default:
|
|
977
|
+
throw Object.defineProperty(new Error("Invariant: unexpected marker"), "__NEXT_ERROR_CODE", {
|
|
978
|
+
value: "E112",
|
|
979
|
+
enumerable: false,
|
|
980
|
+
configurable: true
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
return {
|
|
984
|
+
interceptingRoute,
|
|
985
|
+
interceptedRoute
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
|
|
990
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/is-dynamic.js
|
|
991
|
+
var require_is_dynamic = __commonJS((exports) => {
|
|
992
|
+
Object.defineProperty(exports, "__esModule", {
|
|
993
|
+
value: true
|
|
994
|
+
});
|
|
995
|
+
Object.defineProperty(exports, "isDynamicRoute", {
|
|
996
|
+
enumerable: true,
|
|
997
|
+
get: function() {
|
|
998
|
+
return isDynamicRoute;
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
var _interceptionroutes = require_interception_routes();
|
|
1002
|
+
var TEST_ROUTE = /\/[^/]*\[[^/]+\][^/]*(?=\/|$)/;
|
|
1003
|
+
var TEST_STRICT_ROUTE = /\/\[[^/]+\](?=\/|$)/;
|
|
1004
|
+
function isDynamicRoute(route, strict) {
|
|
1005
|
+
if (strict === undefined)
|
|
1006
|
+
strict = true;
|
|
1007
|
+
if ((0, _interceptionroutes.isInterceptionRouteAppPath)(route)) {
|
|
1008
|
+
route = (0, _interceptionroutes.extractInterceptionRouteInformation)(route).interceptedRoute;
|
|
1009
|
+
}
|
|
1010
|
+
if (strict) {
|
|
1011
|
+
return TEST_STRICT_ROUTE.test(route);
|
|
1012
|
+
}
|
|
1013
|
+
return TEST_ROUTE.test(route);
|
|
1014
|
+
}
|
|
1015
|
+
});
|
|
1016
|
+
|
|
1017
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/index.js
|
|
1018
|
+
var require_utils2 = __commonJS((exports) => {
|
|
1019
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1020
|
+
value: true
|
|
1021
|
+
});
|
|
1022
|
+
function _export(target, all) {
|
|
1023
|
+
for (var name in all)
|
|
1024
|
+
Object.defineProperty(target, name, {
|
|
1025
|
+
enumerable: true,
|
|
1026
|
+
get: all[name]
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
_export(exports, {
|
|
1030
|
+
getSortedRouteObjects: function() {
|
|
1031
|
+
return _sortedroutes.getSortedRouteObjects;
|
|
1032
|
+
},
|
|
1033
|
+
getSortedRoutes: function() {
|
|
1034
|
+
return _sortedroutes.getSortedRoutes;
|
|
1035
|
+
},
|
|
1036
|
+
isDynamicRoute: function() {
|
|
1037
|
+
return _isdynamic.isDynamicRoute;
|
|
1038
|
+
}
|
|
1039
|
+
});
|
|
1040
|
+
var _sortedroutes = require_sorted_routes();
|
|
1041
|
+
var _isdynamic = require_is_dynamic();
|
|
1042
|
+
});
|
|
1043
|
+
|
|
1044
|
+
// ../../node_modules/next/dist/compiled/path-to-regexp/index.js
|
|
1045
|
+
var require_path_to_regexp = __commonJS((exports, module) => {
|
|
1046
|
+
var __dirname = "/Users/ryanwaits/Code/projects/openpkg-ts/node_modules/next/dist/compiled/path-to-regexp";
|
|
1047
|
+
(() => {
|
|
1048
|
+
if (typeof __nccwpck_require__ !== "undefined")
|
|
1049
|
+
__nccwpck_require__.ab = __dirname + "/";
|
|
1050
|
+
var e = {};
|
|
1051
|
+
(() => {
|
|
1052
|
+
var n = e;
|
|
1053
|
+
Object.defineProperty(n, "__esModule", { value: true });
|
|
1054
|
+
n.pathToRegexp = n.tokensToRegexp = n.regexpToFunction = n.match = n.tokensToFunction = n.compile = n.parse = undefined;
|
|
1055
|
+
function lexer(e2) {
|
|
1056
|
+
var n2 = [];
|
|
1057
|
+
var r = 0;
|
|
1058
|
+
while (r < e2.length) {
|
|
1059
|
+
var t = e2[r];
|
|
1060
|
+
if (t === "*" || t === "+" || t === "?") {
|
|
1061
|
+
n2.push({ type: "MODIFIER", index: r, value: e2[r++] });
|
|
1062
|
+
continue;
|
|
1063
|
+
}
|
|
1064
|
+
if (t === "\\") {
|
|
1065
|
+
n2.push({ type: "ESCAPED_CHAR", index: r++, value: e2[r++] });
|
|
1066
|
+
continue;
|
|
1067
|
+
}
|
|
1068
|
+
if (t === "{") {
|
|
1069
|
+
n2.push({ type: "OPEN", index: r, value: e2[r++] });
|
|
1070
|
+
continue;
|
|
1071
|
+
}
|
|
1072
|
+
if (t === "}") {
|
|
1073
|
+
n2.push({ type: "CLOSE", index: r, value: e2[r++] });
|
|
1074
|
+
continue;
|
|
1075
|
+
}
|
|
1076
|
+
if (t === ":") {
|
|
1077
|
+
var a = "";
|
|
1078
|
+
var i = r + 1;
|
|
1079
|
+
while (i < e2.length) {
|
|
1080
|
+
var o = e2.charCodeAt(i);
|
|
1081
|
+
if (o >= 48 && o <= 57 || o >= 65 && o <= 90 || o >= 97 && o <= 122 || o === 95) {
|
|
1082
|
+
a += e2[i++];
|
|
1083
|
+
continue;
|
|
1084
|
+
}
|
|
1085
|
+
break;
|
|
1086
|
+
}
|
|
1087
|
+
if (!a)
|
|
1088
|
+
throw new TypeError("Missing parameter name at ".concat(r));
|
|
1089
|
+
n2.push({ type: "NAME", index: r, value: a });
|
|
1090
|
+
r = i;
|
|
1091
|
+
continue;
|
|
1092
|
+
}
|
|
1093
|
+
if (t === "(") {
|
|
1094
|
+
var c = 1;
|
|
1095
|
+
var f = "";
|
|
1096
|
+
var i = r + 1;
|
|
1097
|
+
if (e2[i] === "?") {
|
|
1098
|
+
throw new TypeError('Pattern cannot start with "?" at '.concat(i));
|
|
1099
|
+
}
|
|
1100
|
+
while (i < e2.length) {
|
|
1101
|
+
if (e2[i] === "\\") {
|
|
1102
|
+
f += e2[i++] + e2[i++];
|
|
1103
|
+
continue;
|
|
1104
|
+
}
|
|
1105
|
+
if (e2[i] === ")") {
|
|
1106
|
+
c--;
|
|
1107
|
+
if (c === 0) {
|
|
1108
|
+
i++;
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
} else if (e2[i] === "(") {
|
|
1112
|
+
c++;
|
|
1113
|
+
if (e2[i + 1] !== "?") {
|
|
1114
|
+
throw new TypeError("Capturing groups are not allowed at ".concat(i));
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
f += e2[i++];
|
|
1118
|
+
}
|
|
1119
|
+
if (c)
|
|
1120
|
+
throw new TypeError("Unbalanced pattern at ".concat(r));
|
|
1121
|
+
if (!f)
|
|
1122
|
+
throw new TypeError("Missing pattern at ".concat(r));
|
|
1123
|
+
n2.push({ type: "PATTERN", index: r, value: f });
|
|
1124
|
+
r = i;
|
|
1125
|
+
continue;
|
|
1126
|
+
}
|
|
1127
|
+
n2.push({ type: "CHAR", index: r, value: e2[r++] });
|
|
1128
|
+
}
|
|
1129
|
+
n2.push({ type: "END", index: r, value: "" });
|
|
1130
|
+
return n2;
|
|
1131
|
+
}
|
|
1132
|
+
function parse(e2, n2) {
|
|
1133
|
+
if (n2 === undefined) {
|
|
1134
|
+
n2 = {};
|
|
1135
|
+
}
|
|
1136
|
+
var r = lexer(e2);
|
|
1137
|
+
var t = n2.prefixes, a = t === undefined ? "./" : t, i = n2.delimiter, o = i === undefined ? "/#?" : i;
|
|
1138
|
+
var c = [];
|
|
1139
|
+
var f = 0;
|
|
1140
|
+
var u = 0;
|
|
1141
|
+
var p = "";
|
|
1142
|
+
var tryConsume = function(e3) {
|
|
1143
|
+
if (u < r.length && r[u].type === e3)
|
|
1144
|
+
return r[u++].value;
|
|
1145
|
+
};
|
|
1146
|
+
var mustConsume = function(e3) {
|
|
1147
|
+
var n3 = tryConsume(e3);
|
|
1148
|
+
if (n3 !== undefined)
|
|
1149
|
+
return n3;
|
|
1150
|
+
var t2 = r[u], a2 = t2.type, i2 = t2.index;
|
|
1151
|
+
throw new TypeError("Unexpected ".concat(a2, " at ").concat(i2, ", expected ").concat(e3));
|
|
1152
|
+
};
|
|
1153
|
+
var consumeText = function() {
|
|
1154
|
+
var e3 = "";
|
|
1155
|
+
var n3;
|
|
1156
|
+
while (n3 = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR")) {
|
|
1157
|
+
e3 += n3;
|
|
1158
|
+
}
|
|
1159
|
+
return e3;
|
|
1160
|
+
};
|
|
1161
|
+
var isSafe = function(e3) {
|
|
1162
|
+
for (var n3 = 0, r2 = o;n3 < r2.length; n3++) {
|
|
1163
|
+
var t2 = r2[n3];
|
|
1164
|
+
if (e3.indexOf(t2) > -1)
|
|
1165
|
+
return true;
|
|
1166
|
+
}
|
|
1167
|
+
return false;
|
|
1168
|
+
};
|
|
1169
|
+
var safePattern = function(e3) {
|
|
1170
|
+
var n3 = c[c.length - 1];
|
|
1171
|
+
var r2 = e3 || (n3 && typeof n3 === "string" ? n3 : "");
|
|
1172
|
+
if (n3 && !r2) {
|
|
1173
|
+
throw new TypeError('Must have text between two parameters, missing text after "'.concat(n3.name, '"'));
|
|
1174
|
+
}
|
|
1175
|
+
if (!r2 || isSafe(r2))
|
|
1176
|
+
return "[^".concat(escapeString(o), "]+?");
|
|
1177
|
+
return "(?:(?!".concat(escapeString(r2), ")[^").concat(escapeString(o), "])+?");
|
|
1178
|
+
};
|
|
1179
|
+
while (u < r.length) {
|
|
1180
|
+
var v = tryConsume("CHAR");
|
|
1181
|
+
var s = tryConsume("NAME");
|
|
1182
|
+
var d = tryConsume("PATTERN");
|
|
1183
|
+
if (s || d) {
|
|
1184
|
+
var g = v || "";
|
|
1185
|
+
if (a.indexOf(g) === -1) {
|
|
1186
|
+
p += g;
|
|
1187
|
+
g = "";
|
|
1188
|
+
}
|
|
1189
|
+
if (p) {
|
|
1190
|
+
c.push(p);
|
|
1191
|
+
p = "";
|
|
1192
|
+
}
|
|
1193
|
+
c.push({ name: s || f++, prefix: g, suffix: "", pattern: d || safePattern(g), modifier: tryConsume("MODIFIER") || "" });
|
|
1194
|
+
continue;
|
|
1195
|
+
}
|
|
1196
|
+
var x = v || tryConsume("ESCAPED_CHAR");
|
|
1197
|
+
if (x) {
|
|
1198
|
+
p += x;
|
|
1199
|
+
continue;
|
|
1200
|
+
}
|
|
1201
|
+
if (p) {
|
|
1202
|
+
c.push(p);
|
|
1203
|
+
p = "";
|
|
1204
|
+
}
|
|
1205
|
+
var h = tryConsume("OPEN");
|
|
1206
|
+
if (h) {
|
|
1207
|
+
var g = consumeText();
|
|
1208
|
+
var l = tryConsume("NAME") || "";
|
|
1209
|
+
var m = tryConsume("PATTERN") || "";
|
|
1210
|
+
var T = consumeText();
|
|
1211
|
+
mustConsume("CLOSE");
|
|
1212
|
+
c.push({ name: l || (m ? f++ : ""), pattern: l && !m ? safePattern(g) : m, prefix: g, suffix: T, modifier: tryConsume("MODIFIER") || "" });
|
|
1213
|
+
continue;
|
|
1214
|
+
}
|
|
1215
|
+
mustConsume("END");
|
|
1216
|
+
}
|
|
1217
|
+
return c;
|
|
1218
|
+
}
|
|
1219
|
+
n.parse = parse;
|
|
1220
|
+
function compile(e2, n2) {
|
|
1221
|
+
return tokensToFunction(parse(e2, n2), n2);
|
|
1222
|
+
}
|
|
1223
|
+
n.compile = compile;
|
|
1224
|
+
function tokensToFunction(e2, n2) {
|
|
1225
|
+
if (n2 === undefined) {
|
|
1226
|
+
n2 = {};
|
|
1227
|
+
}
|
|
1228
|
+
var r = flags(n2);
|
|
1229
|
+
var t = n2.encode, a = t === undefined ? function(e3) {
|
|
1230
|
+
return e3;
|
|
1231
|
+
} : t, i = n2.validate, o = i === undefined ? true : i;
|
|
1232
|
+
var c = e2.map(function(e3) {
|
|
1233
|
+
if (typeof e3 === "object") {
|
|
1234
|
+
return new RegExp("^(?:".concat(e3.pattern, ")$"), r);
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
1237
|
+
return function(n3) {
|
|
1238
|
+
var r2 = "";
|
|
1239
|
+
for (var t2 = 0;t2 < e2.length; t2++) {
|
|
1240
|
+
var i2 = e2[t2];
|
|
1241
|
+
if (typeof i2 === "string") {
|
|
1242
|
+
r2 += i2;
|
|
1243
|
+
continue;
|
|
1244
|
+
}
|
|
1245
|
+
var f = n3 ? n3[i2.name] : undefined;
|
|
1246
|
+
var u = i2.modifier === "?" || i2.modifier === "*";
|
|
1247
|
+
var p = i2.modifier === "*" || i2.modifier === "+";
|
|
1248
|
+
if (Array.isArray(f)) {
|
|
1249
|
+
if (!p) {
|
|
1250
|
+
throw new TypeError('Expected "'.concat(i2.name, '" to not repeat, but got an array'));
|
|
1251
|
+
}
|
|
1252
|
+
if (f.length === 0) {
|
|
1253
|
+
if (u)
|
|
1254
|
+
continue;
|
|
1255
|
+
throw new TypeError('Expected "'.concat(i2.name, '" to not be empty'));
|
|
1256
|
+
}
|
|
1257
|
+
for (var v = 0;v < f.length; v++) {
|
|
1258
|
+
var s = a(f[v], i2);
|
|
1259
|
+
if (o && !c[t2].test(s)) {
|
|
1260
|
+
throw new TypeError('Expected all "'.concat(i2.name, '" to match "').concat(i2.pattern, '", but got "').concat(s, '"'));
|
|
1261
|
+
}
|
|
1262
|
+
r2 += i2.prefix + s + i2.suffix;
|
|
1263
|
+
}
|
|
1264
|
+
continue;
|
|
1265
|
+
}
|
|
1266
|
+
if (typeof f === "string" || typeof f === "number") {
|
|
1267
|
+
var s = a(String(f), i2);
|
|
1268
|
+
if (o && !c[t2].test(s)) {
|
|
1269
|
+
throw new TypeError('Expected "'.concat(i2.name, '" to match "').concat(i2.pattern, '", but got "').concat(s, '"'));
|
|
1270
|
+
}
|
|
1271
|
+
r2 += i2.prefix + s + i2.suffix;
|
|
1272
|
+
continue;
|
|
1273
|
+
}
|
|
1274
|
+
if (u)
|
|
1275
|
+
continue;
|
|
1276
|
+
var d = p ? "an array" : "a string";
|
|
1277
|
+
throw new TypeError('Expected "'.concat(i2.name, '" to be ').concat(d));
|
|
1278
|
+
}
|
|
1279
|
+
return r2;
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
n.tokensToFunction = tokensToFunction;
|
|
1283
|
+
function match(e2, n2) {
|
|
1284
|
+
var r = [];
|
|
1285
|
+
var t = pathToRegexp(e2, r, n2);
|
|
1286
|
+
return regexpToFunction(t, r, n2);
|
|
1287
|
+
}
|
|
1288
|
+
n.match = match;
|
|
1289
|
+
function regexpToFunction(e2, n2, r) {
|
|
1290
|
+
if (r === undefined) {
|
|
1291
|
+
r = {};
|
|
1292
|
+
}
|
|
1293
|
+
var t = r.decode, a = t === undefined ? function(e3) {
|
|
1294
|
+
return e3;
|
|
1295
|
+
} : t;
|
|
1296
|
+
return function(r2) {
|
|
1297
|
+
var t2 = e2.exec(r2);
|
|
1298
|
+
if (!t2)
|
|
1299
|
+
return false;
|
|
1300
|
+
var i = t2[0], o = t2.index;
|
|
1301
|
+
var c = Object.create(null);
|
|
1302
|
+
var _loop_1 = function(e3) {
|
|
1303
|
+
if (t2[e3] === undefined)
|
|
1304
|
+
return "continue";
|
|
1305
|
+
var r3 = n2[e3 - 1];
|
|
1306
|
+
if (r3.modifier === "*" || r3.modifier === "+") {
|
|
1307
|
+
c[r3.name] = t2[e3].split(r3.prefix + r3.suffix).map(function(e4) {
|
|
1308
|
+
return a(e4, r3);
|
|
1309
|
+
});
|
|
1310
|
+
} else {
|
|
1311
|
+
c[r3.name] = a(t2[e3], r3);
|
|
1312
|
+
}
|
|
1313
|
+
};
|
|
1314
|
+
for (var f = 1;f < t2.length; f++) {
|
|
1315
|
+
_loop_1(f);
|
|
1316
|
+
}
|
|
1317
|
+
return { path: i, index: o, params: c };
|
|
1318
|
+
};
|
|
1319
|
+
}
|
|
1320
|
+
n.regexpToFunction = regexpToFunction;
|
|
1321
|
+
function escapeString(e2) {
|
|
1322
|
+
return e2.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
|
|
1323
|
+
}
|
|
1324
|
+
function flags(e2) {
|
|
1325
|
+
return e2 && e2.sensitive ? "" : "i";
|
|
1326
|
+
}
|
|
1327
|
+
function regexpToRegexp(e2, n2) {
|
|
1328
|
+
if (!n2)
|
|
1329
|
+
return e2;
|
|
1330
|
+
var r = /\((?:\?<(.*?)>)?(?!\?)/g;
|
|
1331
|
+
var t = 0;
|
|
1332
|
+
var a = r.exec(e2.source);
|
|
1333
|
+
while (a) {
|
|
1334
|
+
n2.push({ name: a[1] || t++, prefix: "", suffix: "", modifier: "", pattern: "" });
|
|
1335
|
+
a = r.exec(e2.source);
|
|
1336
|
+
}
|
|
1337
|
+
return e2;
|
|
1338
|
+
}
|
|
1339
|
+
function arrayToRegexp(e2, n2, r) {
|
|
1340
|
+
var t = e2.map(function(e3) {
|
|
1341
|
+
return pathToRegexp(e3, n2, r).source;
|
|
1342
|
+
});
|
|
1343
|
+
return new RegExp("(?:".concat(t.join("|"), ")"), flags(r));
|
|
1344
|
+
}
|
|
1345
|
+
function stringToRegexp(e2, n2, r) {
|
|
1346
|
+
return tokensToRegexp(parse(e2, r), n2, r);
|
|
1347
|
+
}
|
|
1348
|
+
function tokensToRegexp(e2, n2, r) {
|
|
1349
|
+
if (r === undefined) {
|
|
1350
|
+
r = {};
|
|
1351
|
+
}
|
|
1352
|
+
var t = r.strict, a = t === undefined ? false : t, i = r.start, o = i === undefined ? true : i, c = r.end, f = c === undefined ? true : c, u = r.encode, p = u === undefined ? function(e3) {
|
|
1353
|
+
return e3;
|
|
1354
|
+
} : u, v = r.delimiter, s = v === undefined ? "/#?" : v, d = r.endsWith, g = d === undefined ? "" : d;
|
|
1355
|
+
var x = "[".concat(escapeString(g), "]|$");
|
|
1356
|
+
var h = "[".concat(escapeString(s), "]");
|
|
1357
|
+
var l = o ? "^" : "";
|
|
1358
|
+
for (var m = 0, T = e2;m < T.length; m++) {
|
|
1359
|
+
var E = T[m];
|
|
1360
|
+
if (typeof E === "string") {
|
|
1361
|
+
l += escapeString(p(E));
|
|
1362
|
+
} else {
|
|
1363
|
+
var w = escapeString(p(E.prefix));
|
|
1364
|
+
var y = escapeString(p(E.suffix));
|
|
1365
|
+
if (E.pattern) {
|
|
1366
|
+
if (n2)
|
|
1367
|
+
n2.push(E);
|
|
1368
|
+
if (w || y) {
|
|
1369
|
+
if (E.modifier === "+" || E.modifier === "*") {
|
|
1370
|
+
var R = E.modifier === "*" ? "?" : "";
|
|
1371
|
+
l += "(?:".concat(w, "((?:").concat(E.pattern, ")(?:").concat(y).concat(w, "(?:").concat(E.pattern, "))*)").concat(y, ")").concat(R);
|
|
1372
|
+
} else {
|
|
1373
|
+
l += "(?:".concat(w, "(").concat(E.pattern, ")").concat(y, ")").concat(E.modifier);
|
|
1374
|
+
}
|
|
1375
|
+
} else {
|
|
1376
|
+
if (E.modifier === "+" || E.modifier === "*") {
|
|
1377
|
+
throw new TypeError('Can not repeat "'.concat(E.name, '" without a prefix and suffix'));
|
|
1378
|
+
}
|
|
1379
|
+
l += "(".concat(E.pattern, ")").concat(E.modifier);
|
|
1380
|
+
}
|
|
1381
|
+
} else {
|
|
1382
|
+
l += "(?:".concat(w).concat(y, ")").concat(E.modifier);
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
if (f) {
|
|
1387
|
+
if (!a)
|
|
1388
|
+
l += "".concat(h, "?");
|
|
1389
|
+
l += !r.endsWith ? "$" : "(?=".concat(x, ")");
|
|
1390
|
+
} else {
|
|
1391
|
+
var A = e2[e2.length - 1];
|
|
1392
|
+
var _ = typeof A === "string" ? h.indexOf(A[A.length - 1]) > -1 : A === undefined;
|
|
1393
|
+
if (!a) {
|
|
1394
|
+
l += "(?:".concat(h, "(?=").concat(x, "))?");
|
|
1395
|
+
}
|
|
1396
|
+
if (!_) {
|
|
1397
|
+
l += "(?=".concat(h, "|").concat(x, ")");
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
return new RegExp(l, flags(r));
|
|
1401
|
+
}
|
|
1402
|
+
n.tokensToRegexp = tokensToRegexp;
|
|
1403
|
+
function pathToRegexp(e2, n2, r) {
|
|
1404
|
+
if (e2 instanceof RegExp)
|
|
1405
|
+
return regexpToRegexp(e2, n2);
|
|
1406
|
+
if (Array.isArray(e2))
|
|
1407
|
+
return arrayToRegexp(e2, n2, r);
|
|
1408
|
+
return stringToRegexp(e2, n2, r);
|
|
1409
|
+
}
|
|
1410
|
+
n.pathToRegexp = pathToRegexp;
|
|
1411
|
+
})();
|
|
1412
|
+
module.exports = e;
|
|
1413
|
+
})();
|
|
1414
|
+
});
|
|
1415
|
+
|
|
1416
|
+
// ../../node_modules/next/dist/lib/route-pattern-normalizer.js
|
|
1417
|
+
var require_route_pattern_normalizer = __commonJS((exports) => {
|
|
1418
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1419
|
+
value: true
|
|
1420
|
+
});
|
|
1421
|
+
function _export(target, all) {
|
|
1422
|
+
for (var name in all)
|
|
1423
|
+
Object.defineProperty(target, name, {
|
|
1424
|
+
enumerable: true,
|
|
1425
|
+
get: all[name]
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
_export(exports, {
|
|
1429
|
+
hasAdjacentParameterIssues: function() {
|
|
1430
|
+
return hasAdjacentParameterIssues;
|
|
1431
|
+
},
|
|
1432
|
+
normalizeAdjacentParameters: function() {
|
|
1433
|
+
return normalizeAdjacentParameters;
|
|
1434
|
+
},
|
|
1435
|
+
normalizeTokensForRegexp: function() {
|
|
1436
|
+
return normalizeTokensForRegexp;
|
|
1437
|
+
},
|
|
1438
|
+
stripParameterSeparators: function() {
|
|
1439
|
+
return stripParameterSeparators;
|
|
1440
|
+
}
|
|
1441
|
+
});
|
|
1442
|
+
var PARAM_SEPARATOR = "_NEXTSEP_";
|
|
1443
|
+
function hasAdjacentParameterIssues(route) {
|
|
1444
|
+
if (typeof route !== "string")
|
|
1445
|
+
return false;
|
|
1446
|
+
if (/\/\(\.{1,3}\):[^/\s]+/.test(route)) {
|
|
1447
|
+
return true;
|
|
1448
|
+
}
|
|
1449
|
+
if (/:[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*/.test(route)) {
|
|
1450
|
+
return true;
|
|
1451
|
+
}
|
|
1452
|
+
return false;
|
|
1453
|
+
}
|
|
1454
|
+
function normalizeAdjacentParameters(route) {
|
|
1455
|
+
let normalized = route;
|
|
1456
|
+
normalized = normalized.replace(/(\([^)]*\)):([^/\s]+)/g, `$1${PARAM_SEPARATOR}:$2`);
|
|
1457
|
+
normalized = normalized.replace(/:([^:/\s)]+)(?=:)/g, `:$1${PARAM_SEPARATOR}`);
|
|
1458
|
+
return normalized;
|
|
1459
|
+
}
|
|
1460
|
+
function normalizeTokensForRegexp(tokens) {
|
|
1461
|
+
return tokens.map((token) => {
|
|
1462
|
+
if (typeof token === "object" && token !== null && "modifier" in token && (token.modifier === "*" || token.modifier === "+") && "prefix" in token && "suffix" in token && token.prefix === "" && token.suffix === "") {
|
|
1463
|
+
return {
|
|
1464
|
+
...token,
|
|
1465
|
+
prefix: "/"
|
|
1466
|
+
};
|
|
1467
|
+
}
|
|
1468
|
+
return token;
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1471
|
+
function stripParameterSeparators(params) {
|
|
1472
|
+
const cleaned = {};
|
|
1473
|
+
for (const [key, value] of Object.entries(params)) {
|
|
1474
|
+
if (typeof value === "string") {
|
|
1475
|
+
cleaned[key] = value.replace(new RegExp(`^${PARAM_SEPARATOR}`), "");
|
|
1476
|
+
} else if (Array.isArray(value)) {
|
|
1477
|
+
cleaned[key] = value.map((item) => typeof item === "string" ? item.replace(new RegExp(`^${PARAM_SEPARATOR}`), "") : item);
|
|
1478
|
+
} else {
|
|
1479
|
+
cleaned[key] = value;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
return cleaned;
|
|
1483
|
+
}
|
|
1484
|
+
});
|
|
1485
|
+
|
|
1486
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/route-match-utils.js
|
|
1487
|
+
var require_route_match_utils = __commonJS((exports) => {
|
|
1488
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1489
|
+
value: true
|
|
1490
|
+
});
|
|
1491
|
+
function _export(target, all) {
|
|
1492
|
+
for (var name in all)
|
|
1493
|
+
Object.defineProperty(target, name, {
|
|
1494
|
+
enumerable: true,
|
|
1495
|
+
get: all[name]
|
|
1496
|
+
});
|
|
1497
|
+
}
|
|
1498
|
+
_export(exports, {
|
|
1499
|
+
safeCompile: function() {
|
|
1500
|
+
return safeCompile;
|
|
1501
|
+
},
|
|
1502
|
+
safePathToRegexp: function() {
|
|
1503
|
+
return safePathToRegexp;
|
|
1504
|
+
},
|
|
1505
|
+
safeRegexpToFunction: function() {
|
|
1506
|
+
return safeRegexpToFunction;
|
|
1507
|
+
},
|
|
1508
|
+
safeRouteMatcher: function() {
|
|
1509
|
+
return safeRouteMatcher;
|
|
1510
|
+
}
|
|
1511
|
+
});
|
|
1512
|
+
var _pathtoregexp = require_path_to_regexp();
|
|
1513
|
+
var _routepatternnormalizer = require_route_pattern_normalizer();
|
|
1514
|
+
function safePathToRegexp(route, keys, options) {
|
|
1515
|
+
if (typeof route !== "string") {
|
|
1516
|
+
return (0, _pathtoregexp.pathToRegexp)(route, keys, options);
|
|
1517
|
+
}
|
|
1518
|
+
const needsNormalization = (0, _routepatternnormalizer.hasAdjacentParameterIssues)(route);
|
|
1519
|
+
const routeToUse = needsNormalization ? (0, _routepatternnormalizer.normalizeAdjacentParameters)(route) : route;
|
|
1520
|
+
try {
|
|
1521
|
+
return (0, _pathtoregexp.pathToRegexp)(routeToUse, keys, options);
|
|
1522
|
+
} catch (error) {
|
|
1523
|
+
if (!needsNormalization) {
|
|
1524
|
+
try {
|
|
1525
|
+
const normalizedRoute = (0, _routepatternnormalizer.normalizeAdjacentParameters)(route);
|
|
1526
|
+
return (0, _pathtoregexp.pathToRegexp)(normalizedRoute, keys, options);
|
|
1527
|
+
} catch (retryError) {
|
|
1528
|
+
throw error;
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
throw error;
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
function safeCompile(route, options) {
|
|
1535
|
+
const needsNormalization = (0, _routepatternnormalizer.hasAdjacentParameterIssues)(route);
|
|
1536
|
+
const routeToUse = needsNormalization ? (0, _routepatternnormalizer.normalizeAdjacentParameters)(route) : route;
|
|
1537
|
+
try {
|
|
1538
|
+
return (0, _pathtoregexp.compile)(routeToUse, options);
|
|
1539
|
+
} catch (error) {
|
|
1540
|
+
if (!needsNormalization) {
|
|
1541
|
+
try {
|
|
1542
|
+
const normalizedRoute = (0, _routepatternnormalizer.normalizeAdjacentParameters)(route);
|
|
1543
|
+
return (0, _pathtoregexp.compile)(normalizedRoute, options);
|
|
1544
|
+
} catch (retryError) {
|
|
1545
|
+
throw error;
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
throw error;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
function safeRegexpToFunction(regexp, keys) {
|
|
1552
|
+
const originalMatcher = (0, _pathtoregexp.regexpToFunction)(regexp, keys || []);
|
|
1553
|
+
return (pathname) => {
|
|
1554
|
+
const result = originalMatcher(pathname);
|
|
1555
|
+
if (!result)
|
|
1556
|
+
return false;
|
|
1557
|
+
return {
|
|
1558
|
+
...result,
|
|
1559
|
+
params: (0, _routepatternnormalizer.stripParameterSeparators)(result.params)
|
|
1560
|
+
};
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
function safeRouteMatcher(matcherFn) {
|
|
1564
|
+
return (pathname) => {
|
|
1565
|
+
const result = matcherFn(pathname);
|
|
1566
|
+
if (!result)
|
|
1567
|
+
return false;
|
|
1568
|
+
return (0, _routepatternnormalizer.stripParameterSeparators)(result);
|
|
1569
|
+
};
|
|
1570
|
+
}
|
|
1571
|
+
});
|
|
1572
|
+
|
|
1573
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/route-matcher.js
|
|
1574
|
+
var require_route_matcher = __commonJS((exports) => {
|
|
1575
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1576
|
+
value: true
|
|
1577
|
+
});
|
|
1578
|
+
Object.defineProperty(exports, "getRouteMatcher", {
|
|
1579
|
+
enumerable: true,
|
|
1580
|
+
get: function() {
|
|
1581
|
+
return getRouteMatcher;
|
|
1582
|
+
}
|
|
1583
|
+
});
|
|
1584
|
+
var _utils = require_utils();
|
|
1585
|
+
var _routematchutils = require_route_match_utils();
|
|
1586
|
+
function getRouteMatcher(param) {
|
|
1587
|
+
let { re, groups } = param;
|
|
1588
|
+
const rawMatcher = (pathname) => {
|
|
1589
|
+
const routeMatch = re.exec(pathname);
|
|
1590
|
+
if (!routeMatch)
|
|
1591
|
+
return false;
|
|
1592
|
+
const decode = (param2) => {
|
|
1593
|
+
try {
|
|
1594
|
+
return decodeURIComponent(param2);
|
|
1595
|
+
} catch (e) {
|
|
1596
|
+
throw Object.defineProperty(new _utils.DecodeError("failed to decode param"), "__NEXT_ERROR_CODE", {
|
|
1597
|
+
value: "E528",
|
|
1598
|
+
enumerable: false,
|
|
1599
|
+
configurable: true
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
const params = {};
|
|
1604
|
+
for (const [key, group] of Object.entries(groups)) {
|
|
1605
|
+
const match = routeMatch[group.pos];
|
|
1606
|
+
if (match !== undefined) {
|
|
1607
|
+
if (group.repeat) {
|
|
1608
|
+
params[key] = match.split("/").map((entry) => decode(entry));
|
|
1609
|
+
} else {
|
|
1610
|
+
params[key] = decode(match);
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
return params;
|
|
1615
|
+
};
|
|
1616
|
+
return (0, _routematchutils.safeRouteMatcher)(rawMatcher);
|
|
1617
|
+
}
|
|
1618
|
+
});
|
|
1619
|
+
|
|
1620
|
+
// ../../node_modules/next/dist/lib/constants.js
|
|
1621
|
+
var require_constants = __commonJS((exports) => {
|
|
1622
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1623
|
+
value: true
|
|
1624
|
+
});
|
|
1625
|
+
function _export(target, all) {
|
|
1626
|
+
for (var name in all)
|
|
1627
|
+
Object.defineProperty(target, name, {
|
|
1628
|
+
enumerable: true,
|
|
1629
|
+
get: all[name]
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1632
|
+
_export(exports, {
|
|
1633
|
+
ACTION_SUFFIX: function() {
|
|
1634
|
+
return ACTION_SUFFIX;
|
|
1635
|
+
},
|
|
1636
|
+
APP_DIR_ALIAS: function() {
|
|
1637
|
+
return APP_DIR_ALIAS;
|
|
1638
|
+
},
|
|
1639
|
+
CACHE_ONE_YEAR: function() {
|
|
1640
|
+
return CACHE_ONE_YEAR;
|
|
1641
|
+
},
|
|
1642
|
+
DOT_NEXT_ALIAS: function() {
|
|
1643
|
+
return DOT_NEXT_ALIAS;
|
|
1644
|
+
},
|
|
1645
|
+
ESLINT_DEFAULT_DIRS: function() {
|
|
1646
|
+
return ESLINT_DEFAULT_DIRS;
|
|
1647
|
+
},
|
|
1648
|
+
GSP_NO_RETURNED_VALUE: function() {
|
|
1649
|
+
return GSP_NO_RETURNED_VALUE;
|
|
1650
|
+
},
|
|
1651
|
+
GSSP_COMPONENT_MEMBER_ERROR: function() {
|
|
1652
|
+
return GSSP_COMPONENT_MEMBER_ERROR;
|
|
1653
|
+
},
|
|
1654
|
+
GSSP_NO_RETURNED_VALUE: function() {
|
|
1655
|
+
return GSSP_NO_RETURNED_VALUE;
|
|
1656
|
+
},
|
|
1657
|
+
HTML_CONTENT_TYPE_HEADER: function() {
|
|
1658
|
+
return HTML_CONTENT_TYPE_HEADER;
|
|
1659
|
+
},
|
|
1660
|
+
INFINITE_CACHE: function() {
|
|
1661
|
+
return INFINITE_CACHE;
|
|
1662
|
+
},
|
|
1663
|
+
INSTRUMENTATION_HOOK_FILENAME: function() {
|
|
1664
|
+
return INSTRUMENTATION_HOOK_FILENAME;
|
|
1665
|
+
},
|
|
1666
|
+
JSON_CONTENT_TYPE_HEADER: function() {
|
|
1667
|
+
return JSON_CONTENT_TYPE_HEADER;
|
|
1668
|
+
},
|
|
1669
|
+
MATCHED_PATH_HEADER: function() {
|
|
1670
|
+
return MATCHED_PATH_HEADER;
|
|
1671
|
+
},
|
|
1672
|
+
MIDDLEWARE_FILENAME: function() {
|
|
1673
|
+
return MIDDLEWARE_FILENAME;
|
|
1674
|
+
},
|
|
1675
|
+
MIDDLEWARE_LOCATION_REGEXP: function() {
|
|
1676
|
+
return MIDDLEWARE_LOCATION_REGEXP;
|
|
1677
|
+
},
|
|
1678
|
+
NEXT_BODY_SUFFIX: function() {
|
|
1679
|
+
return NEXT_BODY_SUFFIX;
|
|
1680
|
+
},
|
|
1681
|
+
NEXT_CACHE_IMPLICIT_TAG_ID: function() {
|
|
1682
|
+
return NEXT_CACHE_IMPLICIT_TAG_ID;
|
|
1683
|
+
},
|
|
1684
|
+
NEXT_CACHE_REVALIDATED_TAGS_HEADER: function() {
|
|
1685
|
+
return NEXT_CACHE_REVALIDATED_TAGS_HEADER;
|
|
1686
|
+
},
|
|
1687
|
+
NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: function() {
|
|
1688
|
+
return NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER;
|
|
1689
|
+
},
|
|
1690
|
+
NEXT_CACHE_SOFT_TAG_MAX_LENGTH: function() {
|
|
1691
|
+
return NEXT_CACHE_SOFT_TAG_MAX_LENGTH;
|
|
1692
|
+
},
|
|
1693
|
+
NEXT_CACHE_TAGS_HEADER: function() {
|
|
1694
|
+
return NEXT_CACHE_TAGS_HEADER;
|
|
1695
|
+
},
|
|
1696
|
+
NEXT_CACHE_TAG_MAX_ITEMS: function() {
|
|
1697
|
+
return NEXT_CACHE_TAG_MAX_ITEMS;
|
|
1698
|
+
},
|
|
1699
|
+
NEXT_CACHE_TAG_MAX_LENGTH: function() {
|
|
1700
|
+
return NEXT_CACHE_TAG_MAX_LENGTH;
|
|
1701
|
+
},
|
|
1702
|
+
NEXT_DATA_SUFFIX: function() {
|
|
1703
|
+
return NEXT_DATA_SUFFIX;
|
|
1704
|
+
},
|
|
1705
|
+
NEXT_INTERCEPTION_MARKER_PREFIX: function() {
|
|
1706
|
+
return NEXT_INTERCEPTION_MARKER_PREFIX;
|
|
1707
|
+
},
|
|
1708
|
+
NEXT_META_SUFFIX: function() {
|
|
1709
|
+
return NEXT_META_SUFFIX;
|
|
1710
|
+
},
|
|
1711
|
+
NEXT_QUERY_PARAM_PREFIX: function() {
|
|
1712
|
+
return NEXT_QUERY_PARAM_PREFIX;
|
|
1713
|
+
},
|
|
1714
|
+
NEXT_RESUME_HEADER: function() {
|
|
1715
|
+
return NEXT_RESUME_HEADER;
|
|
1716
|
+
},
|
|
1717
|
+
NON_STANDARD_NODE_ENV: function() {
|
|
1718
|
+
return NON_STANDARD_NODE_ENV;
|
|
1719
|
+
},
|
|
1720
|
+
PAGES_DIR_ALIAS: function() {
|
|
1721
|
+
return PAGES_DIR_ALIAS;
|
|
1722
|
+
},
|
|
1723
|
+
PRERENDER_REVALIDATE_HEADER: function() {
|
|
1724
|
+
return PRERENDER_REVALIDATE_HEADER;
|
|
1725
|
+
},
|
|
1726
|
+
PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: function() {
|
|
1727
|
+
return PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER;
|
|
1728
|
+
},
|
|
1729
|
+
PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {
|
|
1730
|
+
return PUBLIC_DIR_MIDDLEWARE_CONFLICT;
|
|
1731
|
+
},
|
|
1732
|
+
ROOT_DIR_ALIAS: function() {
|
|
1733
|
+
return ROOT_DIR_ALIAS;
|
|
1734
|
+
},
|
|
1735
|
+
RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {
|
|
1736
|
+
return RSC_ACTION_CLIENT_WRAPPER_ALIAS;
|
|
1737
|
+
},
|
|
1738
|
+
RSC_ACTION_ENCRYPTION_ALIAS: function() {
|
|
1739
|
+
return RSC_ACTION_ENCRYPTION_ALIAS;
|
|
1740
|
+
},
|
|
1741
|
+
RSC_ACTION_PROXY_ALIAS: function() {
|
|
1742
|
+
return RSC_ACTION_PROXY_ALIAS;
|
|
1743
|
+
},
|
|
1744
|
+
RSC_ACTION_VALIDATE_ALIAS: function() {
|
|
1745
|
+
return RSC_ACTION_VALIDATE_ALIAS;
|
|
1746
|
+
},
|
|
1747
|
+
RSC_CACHE_WRAPPER_ALIAS: function() {
|
|
1748
|
+
return RSC_CACHE_WRAPPER_ALIAS;
|
|
1749
|
+
},
|
|
1750
|
+
RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS: function() {
|
|
1751
|
+
return RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS;
|
|
1752
|
+
},
|
|
1753
|
+
RSC_MOD_REF_PROXY_ALIAS: function() {
|
|
1754
|
+
return RSC_MOD_REF_PROXY_ALIAS;
|
|
1755
|
+
},
|
|
1756
|
+
RSC_PREFETCH_SUFFIX: function() {
|
|
1757
|
+
return RSC_PREFETCH_SUFFIX;
|
|
1758
|
+
},
|
|
1759
|
+
RSC_SEGMENTS_DIR_SUFFIX: function() {
|
|
1760
|
+
return RSC_SEGMENTS_DIR_SUFFIX;
|
|
1761
|
+
},
|
|
1762
|
+
RSC_SEGMENT_SUFFIX: function() {
|
|
1763
|
+
return RSC_SEGMENT_SUFFIX;
|
|
1764
|
+
},
|
|
1765
|
+
RSC_SUFFIX: function() {
|
|
1766
|
+
return RSC_SUFFIX;
|
|
1767
|
+
},
|
|
1768
|
+
SERVER_PROPS_EXPORT_ERROR: function() {
|
|
1769
|
+
return SERVER_PROPS_EXPORT_ERROR;
|
|
1770
|
+
},
|
|
1771
|
+
SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {
|
|
1772
|
+
return SERVER_PROPS_GET_INIT_PROPS_CONFLICT;
|
|
1773
|
+
},
|
|
1774
|
+
SERVER_PROPS_SSG_CONFLICT: function() {
|
|
1775
|
+
return SERVER_PROPS_SSG_CONFLICT;
|
|
1776
|
+
},
|
|
1777
|
+
SERVER_RUNTIME: function() {
|
|
1778
|
+
return SERVER_RUNTIME;
|
|
1779
|
+
},
|
|
1780
|
+
SSG_FALLBACK_EXPORT_ERROR: function() {
|
|
1781
|
+
return SSG_FALLBACK_EXPORT_ERROR;
|
|
1782
|
+
},
|
|
1783
|
+
SSG_GET_INITIAL_PROPS_CONFLICT: function() {
|
|
1784
|
+
return SSG_GET_INITIAL_PROPS_CONFLICT;
|
|
1785
|
+
},
|
|
1786
|
+
STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {
|
|
1787
|
+
return STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR;
|
|
1788
|
+
},
|
|
1789
|
+
TEXT_PLAIN_CONTENT_TYPE_HEADER: function() {
|
|
1790
|
+
return TEXT_PLAIN_CONTENT_TYPE_HEADER;
|
|
1791
|
+
},
|
|
1792
|
+
UNSTABLE_REVALIDATE_RENAME_ERROR: function() {
|
|
1793
|
+
return UNSTABLE_REVALIDATE_RENAME_ERROR;
|
|
1794
|
+
},
|
|
1795
|
+
WEBPACK_LAYERS: function() {
|
|
1796
|
+
return WEBPACK_LAYERS;
|
|
1797
|
+
},
|
|
1798
|
+
WEBPACK_RESOURCE_QUERIES: function() {
|
|
1799
|
+
return WEBPACK_RESOURCE_QUERIES;
|
|
1800
|
+
}
|
|
1801
|
+
});
|
|
1802
|
+
var TEXT_PLAIN_CONTENT_TYPE_HEADER = "text/plain";
|
|
1803
|
+
var HTML_CONTENT_TYPE_HEADER = "text/html; charset=utf-8";
|
|
1804
|
+
var JSON_CONTENT_TYPE_HEADER = "application/json; charset=utf-8";
|
|
1805
|
+
var NEXT_QUERY_PARAM_PREFIX = "nxtP";
|
|
1806
|
+
var NEXT_INTERCEPTION_MARKER_PREFIX = "nxtI";
|
|
1807
|
+
var MATCHED_PATH_HEADER = "x-matched-path";
|
|
1808
|
+
var PRERENDER_REVALIDATE_HEADER = "x-prerender-revalidate";
|
|
1809
|
+
var PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = "x-prerender-revalidate-if-generated";
|
|
1810
|
+
var RSC_PREFETCH_SUFFIX = ".prefetch.rsc";
|
|
1811
|
+
var RSC_SEGMENTS_DIR_SUFFIX = ".segments";
|
|
1812
|
+
var RSC_SEGMENT_SUFFIX = ".segment.rsc";
|
|
1813
|
+
var RSC_SUFFIX = ".rsc";
|
|
1814
|
+
var ACTION_SUFFIX = ".action";
|
|
1815
|
+
var NEXT_DATA_SUFFIX = ".json";
|
|
1816
|
+
var NEXT_META_SUFFIX = ".meta";
|
|
1817
|
+
var NEXT_BODY_SUFFIX = ".body";
|
|
1818
|
+
var NEXT_CACHE_TAGS_HEADER = "x-next-cache-tags";
|
|
1819
|
+
var NEXT_CACHE_REVALIDATED_TAGS_HEADER = "x-next-revalidated-tags";
|
|
1820
|
+
var NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = "x-next-revalidate-tag-token";
|
|
1821
|
+
var NEXT_RESUME_HEADER = "next-resume";
|
|
1822
|
+
var NEXT_CACHE_TAG_MAX_ITEMS = 128;
|
|
1823
|
+
var NEXT_CACHE_TAG_MAX_LENGTH = 256;
|
|
1824
|
+
var NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;
|
|
1825
|
+
var NEXT_CACHE_IMPLICIT_TAG_ID = "_N_T_";
|
|
1826
|
+
var CACHE_ONE_YEAR = 31536000;
|
|
1827
|
+
var INFINITE_CACHE = 4294967294;
|
|
1828
|
+
var MIDDLEWARE_FILENAME = "middleware";
|
|
1829
|
+
var MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;
|
|
1830
|
+
var INSTRUMENTATION_HOOK_FILENAME = "instrumentation";
|
|
1831
|
+
var PAGES_DIR_ALIAS = "private-next-pages";
|
|
1832
|
+
var DOT_NEXT_ALIAS = "private-dot-next";
|
|
1833
|
+
var ROOT_DIR_ALIAS = "private-next-root-dir";
|
|
1834
|
+
var APP_DIR_ALIAS = "private-next-app-dir";
|
|
1835
|
+
var RSC_MOD_REF_PROXY_ALIAS = "private-next-rsc-mod-ref-proxy";
|
|
1836
|
+
var RSC_ACTION_VALIDATE_ALIAS = "private-next-rsc-action-validate";
|
|
1837
|
+
var RSC_ACTION_PROXY_ALIAS = "private-next-rsc-server-reference";
|
|
1838
|
+
var RSC_CACHE_WRAPPER_ALIAS = "private-next-rsc-cache-wrapper";
|
|
1839
|
+
var RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS = "private-next-rsc-track-dynamic-import";
|
|
1840
|
+
var RSC_ACTION_ENCRYPTION_ALIAS = "private-next-rsc-action-encryption";
|
|
1841
|
+
var RSC_ACTION_CLIENT_WRAPPER_ALIAS = "private-next-rsc-action-client-wrapper";
|
|
1842
|
+
var PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;
|
|
1843
|
+
var SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;
|
|
1844
|
+
var SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;
|
|
1845
|
+
var SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;
|
|
1846
|
+
var STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;
|
|
1847
|
+
var SERVER_PROPS_EXPORT_ERROR = `pages with \`getServerSideProps\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;
|
|
1848
|
+
var GSP_NO_RETURNED_VALUE = "Your `getStaticProps` function did not return an object. Did you forget to add a `return`?";
|
|
1849
|
+
var GSSP_NO_RETURNED_VALUE = "Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?";
|
|
1850
|
+
var UNSTABLE_REVALIDATE_RENAME_ERROR = "The `unstable_revalidate` property is available for general use.\n" + "Please use `revalidate` instead.";
|
|
1851
|
+
var GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;
|
|
1852
|
+
var NON_STANDARD_NODE_ENV = `You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;
|
|
1853
|
+
var SSG_FALLBACK_EXPORT_ERROR = `Pages with \`fallback\` enabled in \`getStaticPaths\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;
|
|
1854
|
+
var ESLINT_DEFAULT_DIRS = [
|
|
1855
|
+
"app",
|
|
1856
|
+
"pages",
|
|
1857
|
+
"components",
|
|
1858
|
+
"lib",
|
|
1859
|
+
"src"
|
|
1860
|
+
];
|
|
1861
|
+
var SERVER_RUNTIME = {
|
|
1862
|
+
edge: "edge",
|
|
1863
|
+
experimentalEdge: "experimental-edge",
|
|
1864
|
+
nodejs: "nodejs"
|
|
1865
|
+
};
|
|
1866
|
+
var WEBPACK_LAYERS_NAMES = {
|
|
1867
|
+
shared: "shared",
|
|
1868
|
+
reactServerComponents: "rsc",
|
|
1869
|
+
serverSideRendering: "ssr",
|
|
1870
|
+
actionBrowser: "action-browser",
|
|
1871
|
+
apiNode: "api-node",
|
|
1872
|
+
apiEdge: "api-edge",
|
|
1873
|
+
middleware: "middleware",
|
|
1874
|
+
instrument: "instrument",
|
|
1875
|
+
edgeAsset: "edge-asset",
|
|
1876
|
+
appPagesBrowser: "app-pages-browser",
|
|
1877
|
+
pagesDirBrowser: "pages-dir-browser",
|
|
1878
|
+
pagesDirEdge: "pages-dir-edge",
|
|
1879
|
+
pagesDirNode: "pages-dir-node"
|
|
1880
|
+
};
|
|
1881
|
+
var WEBPACK_LAYERS = {
|
|
1882
|
+
...WEBPACK_LAYERS_NAMES,
|
|
1883
|
+
GROUP: {
|
|
1884
|
+
builtinReact: [
|
|
1885
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
1886
|
+
WEBPACK_LAYERS_NAMES.actionBrowser
|
|
1887
|
+
],
|
|
1888
|
+
serverOnly: [
|
|
1889
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
1890
|
+
WEBPACK_LAYERS_NAMES.actionBrowser,
|
|
1891
|
+
WEBPACK_LAYERS_NAMES.instrument,
|
|
1892
|
+
WEBPACK_LAYERS_NAMES.middleware
|
|
1893
|
+
],
|
|
1894
|
+
neutralTarget: [
|
|
1895
|
+
WEBPACK_LAYERS_NAMES.apiNode,
|
|
1896
|
+
WEBPACK_LAYERS_NAMES.apiEdge
|
|
1897
|
+
],
|
|
1898
|
+
clientOnly: [
|
|
1899
|
+
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
|
1900
|
+
WEBPACK_LAYERS_NAMES.appPagesBrowser
|
|
1901
|
+
],
|
|
1902
|
+
bundled: [
|
|
1903
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
1904
|
+
WEBPACK_LAYERS_NAMES.actionBrowser,
|
|
1905
|
+
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
|
1906
|
+
WEBPACK_LAYERS_NAMES.appPagesBrowser,
|
|
1907
|
+
WEBPACK_LAYERS_NAMES.shared,
|
|
1908
|
+
WEBPACK_LAYERS_NAMES.instrument,
|
|
1909
|
+
WEBPACK_LAYERS_NAMES.middleware
|
|
1910
|
+
],
|
|
1911
|
+
appPages: [
|
|
1912
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
1913
|
+
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
|
1914
|
+
WEBPACK_LAYERS_NAMES.appPagesBrowser,
|
|
1915
|
+
WEBPACK_LAYERS_NAMES.actionBrowser
|
|
1916
|
+
]
|
|
1917
|
+
}
|
|
1918
|
+
};
|
|
1919
|
+
var WEBPACK_RESOURCE_QUERIES = {
|
|
1920
|
+
edgeSSREntry: "__next_edge_ssr_entry__",
|
|
1921
|
+
metadata: "__next_metadata__",
|
|
1922
|
+
metadataRoute: "__next_metadata_route__",
|
|
1923
|
+
metadataImageMeta: "__next_metadata_image_meta__"
|
|
1924
|
+
};
|
|
1925
|
+
});
|
|
1926
|
+
|
|
1927
|
+
// ../../node_modules/next/dist/shared/lib/escape-regexp.js
|
|
1928
|
+
var require_escape_regexp = __commonJS((exports) => {
|
|
1929
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1930
|
+
value: true
|
|
1931
|
+
});
|
|
1932
|
+
Object.defineProperty(exports, "escapeStringRegexp", {
|
|
1933
|
+
enumerable: true,
|
|
1934
|
+
get: function() {
|
|
1935
|
+
return escapeStringRegexp;
|
|
1936
|
+
}
|
|
1937
|
+
});
|
|
1938
|
+
var reHasRegExp = /[|\\{}()[\]^$+*?.-]/;
|
|
1939
|
+
var reReplaceRegExp = /[|\\{}()[\]^$+*?.-]/g;
|
|
1940
|
+
function escapeStringRegexp(str) {
|
|
1941
|
+
if (reHasRegExp.test(str)) {
|
|
1942
|
+
return str.replace(reReplaceRegExp, "\\$&");
|
|
1943
|
+
}
|
|
1944
|
+
return str;
|
|
1945
|
+
}
|
|
1946
|
+
});
|
|
1947
|
+
|
|
1948
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js
|
|
1949
|
+
var require_get_dynamic_param = __commonJS((exports) => {
|
|
1950
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1951
|
+
value: true
|
|
1952
|
+
});
|
|
1953
|
+
function _export(target, all) {
|
|
1954
|
+
for (var name in all)
|
|
1955
|
+
Object.defineProperty(target, name, {
|
|
1956
|
+
enumerable: true,
|
|
1957
|
+
get: all[name]
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
_export(exports, {
|
|
1961
|
+
PARAMETER_PATTERN: function() {
|
|
1962
|
+
return PARAMETER_PATTERN;
|
|
1963
|
+
},
|
|
1964
|
+
getDynamicParam: function() {
|
|
1965
|
+
return getDynamicParam;
|
|
1966
|
+
},
|
|
1967
|
+
parseMatchedParameter: function() {
|
|
1968
|
+
return parseMatchedParameter;
|
|
1969
|
+
},
|
|
1970
|
+
parseParameter: function() {
|
|
1971
|
+
return parseParameter;
|
|
1972
|
+
}
|
|
1973
|
+
});
|
|
1974
|
+
function getDynamicParam(params, segmentKey, dynamicParamType, pagePath, fallbackRouteParams) {
|
|
1975
|
+
let value = params[segmentKey];
|
|
1976
|
+
if (fallbackRouteParams && fallbackRouteParams.has(segmentKey)) {
|
|
1977
|
+
value = fallbackRouteParams.get(segmentKey);
|
|
1978
|
+
} else if (Array.isArray(value)) {
|
|
1979
|
+
value = value.map((i) => encodeURIComponent(i));
|
|
1980
|
+
} else if (typeof value === "string") {
|
|
1981
|
+
value = encodeURIComponent(value);
|
|
1982
|
+
}
|
|
1983
|
+
if (!value) {
|
|
1984
|
+
const isCatchall = dynamicParamType === "c";
|
|
1985
|
+
const isOptionalCatchall = dynamicParamType === "oc";
|
|
1986
|
+
if (isCatchall || isOptionalCatchall) {
|
|
1987
|
+
if (isOptionalCatchall) {
|
|
1988
|
+
return {
|
|
1989
|
+
param: segmentKey,
|
|
1990
|
+
value: null,
|
|
1991
|
+
type: dynamicParamType,
|
|
1992
|
+
treeSegment: [
|
|
1993
|
+
segmentKey,
|
|
1994
|
+
"",
|
|
1995
|
+
dynamicParamType
|
|
1996
|
+
]
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
value = pagePath.split("/").slice(1).flatMap((pathSegment) => {
|
|
2000
|
+
const param = parseParameter(pathSegment);
|
|
2001
|
+
var _params_param_key;
|
|
2002
|
+
return (_params_param_key = params[param.key]) != null ? _params_param_key : param.key;
|
|
2003
|
+
});
|
|
2004
|
+
return {
|
|
2005
|
+
param: segmentKey,
|
|
2006
|
+
value,
|
|
2007
|
+
type: dynamicParamType,
|
|
2008
|
+
treeSegment: [
|
|
2009
|
+
segmentKey,
|
|
2010
|
+
value.join("/"),
|
|
2011
|
+
dynamicParamType
|
|
2012
|
+
]
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
return {
|
|
2017
|
+
param: segmentKey,
|
|
2018
|
+
value,
|
|
2019
|
+
treeSegment: [
|
|
2020
|
+
segmentKey,
|
|
2021
|
+
Array.isArray(value) ? value.join("/") : value,
|
|
2022
|
+
dynamicParamType
|
|
2023
|
+
],
|
|
2024
|
+
type: dynamicParamType
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
var PARAMETER_PATTERN = /^([^[]*)\[((?:\[[^\]]*\])|[^\]]+)\](.*)$/;
|
|
2028
|
+
function parseParameter(param) {
|
|
2029
|
+
const match = param.match(PARAMETER_PATTERN);
|
|
2030
|
+
if (!match) {
|
|
2031
|
+
return parseMatchedParameter(param);
|
|
2032
|
+
}
|
|
2033
|
+
return parseMatchedParameter(match[2]);
|
|
2034
|
+
}
|
|
2035
|
+
function parseMatchedParameter(param) {
|
|
2036
|
+
const optional = param.startsWith("[") && param.endsWith("]");
|
|
2037
|
+
if (optional) {
|
|
2038
|
+
param = param.slice(1, -1);
|
|
2039
|
+
}
|
|
2040
|
+
const repeat = param.startsWith("...");
|
|
2041
|
+
if (repeat) {
|
|
2042
|
+
param = param.slice(3);
|
|
2043
|
+
}
|
|
2044
|
+
return {
|
|
2045
|
+
key: param,
|
|
2046
|
+
repeat,
|
|
2047
|
+
optional
|
|
2048
|
+
};
|
|
2049
|
+
}
|
|
2050
|
+
});
|
|
2051
|
+
|
|
2052
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/route-regex.js
|
|
2053
|
+
var require_route_regex = __commonJS((exports) => {
|
|
2054
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2055
|
+
value: true
|
|
2056
|
+
});
|
|
2057
|
+
function _export(target, all) {
|
|
2058
|
+
for (var name in all)
|
|
2059
|
+
Object.defineProperty(target, name, {
|
|
2060
|
+
enumerable: true,
|
|
2061
|
+
get: all[name]
|
|
2062
|
+
});
|
|
2063
|
+
}
|
|
2064
|
+
_export(exports, {
|
|
2065
|
+
getNamedMiddlewareRegex: function() {
|
|
2066
|
+
return getNamedMiddlewareRegex;
|
|
2067
|
+
},
|
|
2068
|
+
getNamedRouteRegex: function() {
|
|
2069
|
+
return getNamedRouteRegex;
|
|
2070
|
+
},
|
|
2071
|
+
getRouteRegex: function() {
|
|
2072
|
+
return getRouteRegex;
|
|
2073
|
+
}
|
|
2074
|
+
});
|
|
2075
|
+
var _constants = require_constants();
|
|
2076
|
+
var _interceptionroutes = require_interception_routes();
|
|
2077
|
+
var _escaperegexp = require_escape_regexp();
|
|
2078
|
+
var _removetrailingslash = require_remove_trailing_slash();
|
|
2079
|
+
var _getdynamicparam = require_get_dynamic_param();
|
|
2080
|
+
function getParametrizedRoute(route, includeSuffix, includePrefix) {
|
|
2081
|
+
const groups = {};
|
|
2082
|
+
let groupIndex = 1;
|
|
2083
|
+
const segments = [];
|
|
2084
|
+
for (const segment of (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split("/")) {
|
|
2085
|
+
const markerMatch = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((m) => segment.startsWith(m));
|
|
2086
|
+
const paramMatches = segment.match(_getdynamicparam.PARAMETER_PATTERN);
|
|
2087
|
+
if (markerMatch && paramMatches && paramMatches[2]) {
|
|
2088
|
+
const { key, optional, repeat } = (0, _getdynamicparam.parseMatchedParameter)(paramMatches[2]);
|
|
2089
|
+
groups[key] = {
|
|
2090
|
+
pos: groupIndex++,
|
|
2091
|
+
repeat,
|
|
2092
|
+
optional
|
|
2093
|
+
};
|
|
2094
|
+
segments.push("/" + (0, _escaperegexp.escapeStringRegexp)(markerMatch) + "([^/]+?)");
|
|
2095
|
+
} else if (paramMatches && paramMatches[2]) {
|
|
2096
|
+
const { key, repeat, optional } = (0, _getdynamicparam.parseMatchedParameter)(paramMatches[2]);
|
|
2097
|
+
groups[key] = {
|
|
2098
|
+
pos: groupIndex++,
|
|
2099
|
+
repeat,
|
|
2100
|
+
optional
|
|
2101
|
+
};
|
|
2102
|
+
if (includePrefix && paramMatches[1]) {
|
|
2103
|
+
segments.push("/" + (0, _escaperegexp.escapeStringRegexp)(paramMatches[1]));
|
|
2104
|
+
}
|
|
2105
|
+
let s = repeat ? optional ? "(?:/(.+?))?" : "/(.+?)" : "/([^/]+?)";
|
|
2106
|
+
if (includePrefix && paramMatches[1]) {
|
|
2107
|
+
s = s.substring(1);
|
|
2108
|
+
}
|
|
2109
|
+
segments.push(s);
|
|
2110
|
+
} else {
|
|
2111
|
+
segments.push("/" + (0, _escaperegexp.escapeStringRegexp)(segment));
|
|
2112
|
+
}
|
|
2113
|
+
if (includeSuffix && paramMatches && paramMatches[3]) {
|
|
2114
|
+
segments.push((0, _escaperegexp.escapeStringRegexp)(paramMatches[3]));
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
return {
|
|
2118
|
+
parameterizedRoute: segments.join(""),
|
|
2119
|
+
groups
|
|
2120
|
+
};
|
|
2121
|
+
}
|
|
2122
|
+
function getRouteRegex(normalizedRoute, param) {
|
|
2123
|
+
let { includeSuffix = false, includePrefix = false, excludeOptionalTrailingSlash = false } = param === undefined ? {} : param;
|
|
2124
|
+
const { parameterizedRoute, groups } = getParametrizedRoute(normalizedRoute, includeSuffix, includePrefix);
|
|
2125
|
+
let re = parameterizedRoute;
|
|
2126
|
+
if (!excludeOptionalTrailingSlash) {
|
|
2127
|
+
re += "(?:/)?";
|
|
2128
|
+
}
|
|
2129
|
+
return {
|
|
2130
|
+
re: new RegExp("^" + re + "$"),
|
|
2131
|
+
groups
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
function buildGetSafeRouteKey() {
|
|
2135
|
+
let i = 0;
|
|
2136
|
+
return () => {
|
|
2137
|
+
let routeKey = "";
|
|
2138
|
+
let j = ++i;
|
|
2139
|
+
while (j > 0) {
|
|
2140
|
+
routeKey += String.fromCharCode(97 + (j - 1) % 26);
|
|
2141
|
+
j = Math.floor((j - 1) / 26);
|
|
2142
|
+
}
|
|
2143
|
+
return routeKey;
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
function getSafeKeyFromSegment(param) {
|
|
2147
|
+
let { interceptionMarker, getSafeRouteKey, segment, routeKeys, keyPrefix, backreferenceDuplicateKeys } = param;
|
|
2148
|
+
const { key, optional, repeat } = (0, _getdynamicparam.parseMatchedParameter)(segment);
|
|
2149
|
+
let cleanedKey = key.replace(/\W/g, "");
|
|
2150
|
+
if (keyPrefix) {
|
|
2151
|
+
cleanedKey = "" + keyPrefix + cleanedKey;
|
|
2152
|
+
}
|
|
2153
|
+
let invalidKey = false;
|
|
2154
|
+
if (cleanedKey.length === 0 || cleanedKey.length > 30) {
|
|
2155
|
+
invalidKey = true;
|
|
2156
|
+
}
|
|
2157
|
+
if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) {
|
|
2158
|
+
invalidKey = true;
|
|
2159
|
+
}
|
|
2160
|
+
if (invalidKey) {
|
|
2161
|
+
cleanedKey = getSafeRouteKey();
|
|
2162
|
+
}
|
|
2163
|
+
const duplicateKey = cleanedKey in routeKeys;
|
|
2164
|
+
if (keyPrefix) {
|
|
2165
|
+
routeKeys[cleanedKey] = "" + keyPrefix + key;
|
|
2166
|
+
} else {
|
|
2167
|
+
routeKeys[cleanedKey] = key;
|
|
2168
|
+
}
|
|
2169
|
+
const interceptionPrefix = interceptionMarker ? (0, _escaperegexp.escapeStringRegexp)(interceptionMarker) : "";
|
|
2170
|
+
let pattern;
|
|
2171
|
+
if (duplicateKey && backreferenceDuplicateKeys) {
|
|
2172
|
+
pattern = "\\k<" + cleanedKey + ">";
|
|
2173
|
+
} else if (repeat) {
|
|
2174
|
+
pattern = "(?<" + cleanedKey + ">.+?)";
|
|
2175
|
+
} else {
|
|
2176
|
+
pattern = "(?<" + cleanedKey + ">[^/]+?)";
|
|
2177
|
+
}
|
|
2178
|
+
return optional ? "(?:/" + interceptionPrefix + pattern + ")?" : "/" + interceptionPrefix + pattern;
|
|
2179
|
+
}
|
|
2180
|
+
function getNamedParametrizedRoute(route, prefixRouteKeys, includeSuffix, includePrefix, backreferenceDuplicateKeys) {
|
|
2181
|
+
const getSafeRouteKey = buildGetSafeRouteKey();
|
|
2182
|
+
const routeKeys = {};
|
|
2183
|
+
const segments = [];
|
|
2184
|
+
for (const segment of (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split("/")) {
|
|
2185
|
+
const hasInterceptionMarker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m));
|
|
2186
|
+
const paramMatches = segment.match(_getdynamicparam.PARAMETER_PATTERN);
|
|
2187
|
+
if (hasInterceptionMarker && paramMatches && paramMatches[2]) {
|
|
2188
|
+
segments.push(getSafeKeyFromSegment({
|
|
2189
|
+
getSafeRouteKey,
|
|
2190
|
+
interceptionMarker: paramMatches[1],
|
|
2191
|
+
segment: paramMatches[2],
|
|
2192
|
+
routeKeys,
|
|
2193
|
+
keyPrefix: prefixRouteKeys ? _constants.NEXT_INTERCEPTION_MARKER_PREFIX : undefined,
|
|
2194
|
+
backreferenceDuplicateKeys
|
|
2195
|
+
}));
|
|
2196
|
+
} else if (paramMatches && paramMatches[2]) {
|
|
2197
|
+
if (includePrefix && paramMatches[1]) {
|
|
2198
|
+
segments.push("/" + (0, _escaperegexp.escapeStringRegexp)(paramMatches[1]));
|
|
2199
|
+
}
|
|
2200
|
+
let s = getSafeKeyFromSegment({
|
|
2201
|
+
getSafeRouteKey,
|
|
2202
|
+
segment: paramMatches[2],
|
|
2203
|
+
routeKeys,
|
|
2204
|
+
keyPrefix: prefixRouteKeys ? _constants.NEXT_QUERY_PARAM_PREFIX : undefined,
|
|
2205
|
+
backreferenceDuplicateKeys
|
|
2206
|
+
});
|
|
2207
|
+
if (includePrefix && paramMatches[1]) {
|
|
2208
|
+
s = s.substring(1);
|
|
2209
|
+
}
|
|
2210
|
+
segments.push(s);
|
|
2211
|
+
} else {
|
|
2212
|
+
segments.push("/" + (0, _escaperegexp.escapeStringRegexp)(segment));
|
|
2213
|
+
}
|
|
2214
|
+
if (includeSuffix && paramMatches && paramMatches[3]) {
|
|
2215
|
+
segments.push((0, _escaperegexp.escapeStringRegexp)(paramMatches[3]));
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
return {
|
|
2219
|
+
namedParameterizedRoute: segments.join(""),
|
|
2220
|
+
routeKeys
|
|
2221
|
+
};
|
|
2222
|
+
}
|
|
2223
|
+
function getNamedRouteRegex(normalizedRoute, options) {
|
|
2224
|
+
var _options_includeSuffix, _options_includePrefix, _options_backreferenceDuplicateKeys;
|
|
2225
|
+
const result = getNamedParametrizedRoute(normalizedRoute, options.prefixRouteKeys, (_options_includeSuffix = options.includeSuffix) != null ? _options_includeSuffix : false, (_options_includePrefix = options.includePrefix) != null ? _options_includePrefix : false, (_options_backreferenceDuplicateKeys = options.backreferenceDuplicateKeys) != null ? _options_backreferenceDuplicateKeys : false);
|
|
2226
|
+
let namedRegex = result.namedParameterizedRoute;
|
|
2227
|
+
if (!options.excludeOptionalTrailingSlash) {
|
|
2228
|
+
namedRegex += "(?:/)?";
|
|
2229
|
+
}
|
|
2230
|
+
return {
|
|
2231
|
+
...getRouteRegex(normalizedRoute, options),
|
|
2232
|
+
namedRegex: "^" + namedRegex + "$",
|
|
2233
|
+
routeKeys: result.routeKeys
|
|
2234
|
+
};
|
|
2235
|
+
}
|
|
2236
|
+
function getNamedMiddlewareRegex(normalizedRoute, options) {
|
|
2237
|
+
const { parameterizedRoute } = getParametrizedRoute(normalizedRoute, false, false);
|
|
2238
|
+
const { catchAll = true } = options;
|
|
2239
|
+
if (parameterizedRoute === "/") {
|
|
2240
|
+
let catchAllRegex = catchAll ? ".*" : "";
|
|
2241
|
+
return {
|
|
2242
|
+
namedRegex: "^/" + catchAllRegex + "$"
|
|
2243
|
+
};
|
|
2244
|
+
}
|
|
2245
|
+
const { namedParameterizedRoute } = getNamedParametrizedRoute(normalizedRoute, false, false, false, false);
|
|
2246
|
+
let catchAllGroupedRegex = catchAll ? "(?:(/.*)?)" : "";
|
|
2247
|
+
return {
|
|
2248
|
+
namedRegex: "^" + namedParameterizedRoute + catchAllGroupedRegex + "$"
|
|
2249
|
+
};
|
|
2250
|
+
}
|
|
2251
|
+
});
|
|
2252
|
+
|
|
2253
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/interpolate-as.js
|
|
2254
|
+
var require_interpolate_as = __commonJS((exports) => {
|
|
2255
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2256
|
+
value: true
|
|
2257
|
+
});
|
|
2258
|
+
Object.defineProperty(exports, "interpolateAs", {
|
|
2259
|
+
enumerable: true,
|
|
2260
|
+
get: function() {
|
|
2261
|
+
return interpolateAs;
|
|
2262
|
+
}
|
|
2263
|
+
});
|
|
2264
|
+
var _routematcher = require_route_matcher();
|
|
2265
|
+
var _routeregex = require_route_regex();
|
|
2266
|
+
function interpolateAs(route, asPathname, query) {
|
|
2267
|
+
let interpolatedRoute = "";
|
|
2268
|
+
const dynamicRegex = (0, _routeregex.getRouteRegex)(route);
|
|
2269
|
+
const dynamicGroups = dynamicRegex.groups;
|
|
2270
|
+
const dynamicMatches = (asPathname !== route ? (0, _routematcher.getRouteMatcher)(dynamicRegex)(asPathname) : "") || query;
|
|
2271
|
+
interpolatedRoute = route;
|
|
2272
|
+
const params = Object.keys(dynamicGroups);
|
|
2273
|
+
if (!params.every((param) => {
|
|
2274
|
+
let value = dynamicMatches[param] || "";
|
|
2275
|
+
const { repeat, optional } = dynamicGroups[param];
|
|
2276
|
+
let replaced = "[" + (repeat ? "..." : "") + param + "]";
|
|
2277
|
+
if (optional) {
|
|
2278
|
+
replaced = (!value ? "/" : "") + "[" + replaced + "]";
|
|
2279
|
+
}
|
|
2280
|
+
if (repeat && !Array.isArray(value))
|
|
2281
|
+
value = [
|
|
2282
|
+
value
|
|
2283
|
+
];
|
|
2284
|
+
return (optional || (param in dynamicMatches)) && (interpolatedRoute = interpolatedRoute.replace(replaced, repeat ? value.map((segment) => encodeURIComponent(segment)).join("/") : encodeURIComponent(value)) || "/");
|
|
2285
|
+
})) {
|
|
2286
|
+
interpolatedRoute = "";
|
|
2287
|
+
}
|
|
2288
|
+
return {
|
|
2289
|
+
params,
|
|
2290
|
+
result: interpolatedRoute
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
});
|
|
2294
|
+
|
|
2295
|
+
// ../../node_modules/next/dist/client/resolve-href.js
|
|
2296
|
+
var require_resolve_href = __commonJS((exports, module) => {
|
|
2297
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2298
|
+
value: true
|
|
2299
|
+
});
|
|
2300
|
+
Object.defineProperty(exports, "resolveHref", {
|
|
2301
|
+
enumerable: true,
|
|
2302
|
+
get: function() {
|
|
2303
|
+
return resolveHref;
|
|
2304
|
+
}
|
|
2305
|
+
});
|
|
2306
|
+
var _querystring = require_querystring();
|
|
2307
|
+
var _formaturl = require_format_url();
|
|
2308
|
+
var _omit = require_omit();
|
|
2309
|
+
var _utils = require_utils();
|
|
2310
|
+
var _normalizetrailingslash = require_normalize_trailing_slash();
|
|
2311
|
+
var _islocalurl = require_is_local_url();
|
|
2312
|
+
var _utils1 = require_utils2();
|
|
2313
|
+
var _interpolateas = require_interpolate_as();
|
|
2314
|
+
var _routeregex = require_route_regex();
|
|
2315
|
+
var _routematcher = require_route_matcher();
|
|
2316
|
+
function resolveHref(router, href, resolveAs) {
|
|
2317
|
+
let base;
|
|
2318
|
+
let urlAsString = typeof href === "string" ? href : (0, _formaturl.formatWithValidation)(href);
|
|
2319
|
+
const urlProtoMatch = urlAsString.match(/^[a-z][a-z0-9+.-]*:\/\//i);
|
|
2320
|
+
const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
|
|
2321
|
+
const urlParts = urlAsStringNoProto.split("?", 1);
|
|
2322
|
+
if ((urlParts[0] || "").match(/(\/\/|\\)/)) {
|
|
2323
|
+
console.error("Invalid href '" + urlAsString + "' passed to next/router in page: '" + router.pathname + "'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");
|
|
2324
|
+
const normalizedUrl = (0, _utils.normalizeRepeatedSlashes)(urlAsStringNoProto);
|
|
2325
|
+
urlAsString = (urlProtoMatch ? urlProtoMatch[0] : "") + normalizedUrl;
|
|
2326
|
+
}
|
|
2327
|
+
if (!(0, _islocalurl.isLocalURL)(urlAsString)) {
|
|
2328
|
+
return resolveAs ? [
|
|
2329
|
+
urlAsString
|
|
2330
|
+
] : urlAsString;
|
|
2331
|
+
}
|
|
2332
|
+
try {
|
|
2333
|
+
let baseBase = urlAsString.startsWith("#") ? router.asPath : router.pathname;
|
|
2334
|
+
if (urlAsString.startsWith("?")) {
|
|
2335
|
+
baseBase = router.asPath;
|
|
2336
|
+
if ((0, _utils1.isDynamicRoute)(router.pathname)) {
|
|
2337
|
+
baseBase = router.pathname;
|
|
2338
|
+
const routeRegex = (0, _routeregex.getRouteRegex)(router.pathname);
|
|
2339
|
+
const match = (0, _routematcher.getRouteMatcher)(routeRegex)(router.asPath);
|
|
2340
|
+
if (!match) {
|
|
2341
|
+
baseBase = router.asPath;
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
base = new URL(baseBase, "http://n");
|
|
2346
|
+
} catch (_) {
|
|
2347
|
+
base = new URL("/", "http://n");
|
|
2348
|
+
}
|
|
2349
|
+
try {
|
|
2350
|
+
const finalUrl = new URL(urlAsString, base);
|
|
2351
|
+
finalUrl.pathname = (0, _normalizetrailingslash.normalizePathTrailingSlash)(finalUrl.pathname);
|
|
2352
|
+
let interpolatedAs = "";
|
|
2353
|
+
if ((0, _utils1.isDynamicRoute)(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
|
|
2354
|
+
const query = (0, _querystring.searchParamsToUrlQuery)(finalUrl.searchParams);
|
|
2355
|
+
const { result, params } = (0, _interpolateas.interpolateAs)(finalUrl.pathname, finalUrl.pathname, query);
|
|
2356
|
+
if (result) {
|
|
2357
|
+
interpolatedAs = (0, _formaturl.formatWithValidation)({
|
|
2358
|
+
pathname: result,
|
|
2359
|
+
hash: finalUrl.hash,
|
|
2360
|
+
query: (0, _omit.omit)(query, params)
|
|
2361
|
+
});
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
|
|
2365
|
+
return resolveAs ? [
|
|
2366
|
+
resolvedHref,
|
|
2367
|
+
interpolatedAs || resolvedHref
|
|
2368
|
+
] : resolvedHref;
|
|
2369
|
+
} catch (_) {
|
|
2370
|
+
return resolveAs ? [
|
|
2371
|
+
urlAsString
|
|
2372
|
+
] : urlAsString;
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
2376
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
2377
|
+
Object.assign(exports.default, exports);
|
|
2378
|
+
module.exports = exports.default;
|
|
2379
|
+
}
|
|
2380
|
+
});
|
|
2381
|
+
|
|
2382
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js
|
|
2383
|
+
var require_add_path_prefix = __commonJS((exports) => {
|
|
2384
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2385
|
+
value: true
|
|
2386
|
+
});
|
|
2387
|
+
Object.defineProperty(exports, "addPathPrefix", {
|
|
2388
|
+
enumerable: true,
|
|
2389
|
+
get: function() {
|
|
2390
|
+
return addPathPrefix;
|
|
2391
|
+
}
|
|
2392
|
+
});
|
|
2393
|
+
var _parsepath = require_parse_path();
|
|
2394
|
+
function addPathPrefix(path, prefix) {
|
|
2395
|
+
if (!path.startsWith("/") || !prefix) {
|
|
2396
|
+
return path;
|
|
2397
|
+
}
|
|
2398
|
+
const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
|
|
2399
|
+
return "" + prefix + pathname + query + hash;
|
|
2400
|
+
}
|
|
2401
|
+
});
|
|
2402
|
+
|
|
2403
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/add-locale.js
|
|
2404
|
+
var require_add_locale = __commonJS((exports) => {
|
|
2405
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2406
|
+
value: true
|
|
2407
|
+
});
|
|
2408
|
+
Object.defineProperty(exports, "addLocale", {
|
|
2409
|
+
enumerable: true,
|
|
2410
|
+
get: function() {
|
|
2411
|
+
return addLocale;
|
|
2412
|
+
}
|
|
2413
|
+
});
|
|
2414
|
+
var _addpathprefix = require_add_path_prefix();
|
|
2415
|
+
var _pathhasprefix = require_path_has_prefix();
|
|
2416
|
+
function addLocale(path, locale, defaultLocale, ignorePrefix) {
|
|
2417
|
+
if (!locale || locale === defaultLocale)
|
|
2418
|
+
return path;
|
|
2419
|
+
const lower = path.toLowerCase();
|
|
2420
|
+
if (!ignorePrefix) {
|
|
2421
|
+
if ((0, _pathhasprefix.pathHasPrefix)(lower, "/api"))
|
|
2422
|
+
return path;
|
|
2423
|
+
if ((0, _pathhasprefix.pathHasPrefix)(lower, "/" + locale.toLowerCase()))
|
|
2424
|
+
return path;
|
|
2425
|
+
}
|
|
2426
|
+
return (0, _addpathprefix.addPathPrefix)(path, "/" + locale);
|
|
2427
|
+
}
|
|
2428
|
+
});
|
|
2429
|
+
|
|
2430
|
+
// ../../node_modules/next/dist/client/add-locale.js
|
|
2431
|
+
var require_add_locale2 = __commonJS((exports, module) => {
|
|
2432
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2433
|
+
value: true
|
|
2434
|
+
});
|
|
2435
|
+
Object.defineProperty(exports, "addLocale", {
|
|
2436
|
+
enumerable: true,
|
|
2437
|
+
get: function() {
|
|
2438
|
+
return addLocale;
|
|
2439
|
+
}
|
|
2440
|
+
});
|
|
2441
|
+
var _normalizetrailingslash = require_normalize_trailing_slash();
|
|
2442
|
+
var addLocale = function(path) {
|
|
2443
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1;_key < _len; _key++) {
|
|
2444
|
+
args[_key - 1] = arguments[_key];
|
|
2445
|
+
}
|
|
2446
|
+
if (process.env.__NEXT_I18N_SUPPORT) {
|
|
2447
|
+
return (0, _normalizetrailingslash.normalizePathTrailingSlash)(require_add_locale().addLocale(path, ...args));
|
|
2448
|
+
}
|
|
2449
|
+
return path;
|
|
2450
|
+
};
|
|
2451
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
2452
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
2453
|
+
Object.assign(exports.default, exports);
|
|
2454
|
+
module.exports = exports.default;
|
|
2455
|
+
}
|
|
2456
|
+
});
|
|
2457
|
+
|
|
2458
|
+
// ../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs
|
|
2459
|
+
var require__interop_require_default = __commonJS((exports) => {
|
|
2460
|
+
function _interop_require_default(obj) {
|
|
2461
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
2462
|
+
}
|
|
2463
|
+
exports._ = _interop_require_default;
|
|
2464
|
+
});
|
|
2465
|
+
|
|
2466
|
+
// ../../node_modules/next/dist/shared/lib/router-context.shared-runtime.js
|
|
2467
|
+
import * as react from "react";
|
|
2468
|
+
var require_router_context_shared_runtime = __commonJS((exports) => {
|
|
2469
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2470
|
+
value: true
|
|
2471
|
+
});
|
|
2472
|
+
Object.defineProperty(exports, "RouterContext", {
|
|
2473
|
+
enumerable: true,
|
|
2474
|
+
get: function() {
|
|
2475
|
+
return RouterContext;
|
|
2476
|
+
}
|
|
2477
|
+
});
|
|
2478
|
+
var _interop_require_default = require__interop_require_default();
|
|
2479
|
+
var _react = /* @__PURE__ */ _interop_require_default._(react);
|
|
2480
|
+
var RouterContext = _react.default.createContext(null);
|
|
2481
|
+
if (false) {}
|
|
2482
|
+
});
|
|
2483
|
+
|
|
2484
|
+
// ../../node_modules/next/dist/client/request-idle-callback.js
|
|
2485
|
+
var require_request_idle_callback = __commonJS((exports, module) => {
|
|
2486
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2487
|
+
value: true
|
|
2488
|
+
});
|
|
2489
|
+
function _export(target, all) {
|
|
2490
|
+
for (var name in all)
|
|
2491
|
+
Object.defineProperty(target, name, {
|
|
2492
|
+
enumerable: true,
|
|
2493
|
+
get: all[name]
|
|
2494
|
+
});
|
|
2495
|
+
}
|
|
2496
|
+
_export(exports, {
|
|
2497
|
+
cancelIdleCallback: function() {
|
|
2498
|
+
return cancelIdleCallback;
|
|
2499
|
+
},
|
|
2500
|
+
requestIdleCallback: function() {
|
|
2501
|
+
return requestIdleCallback;
|
|
2502
|
+
}
|
|
2503
|
+
});
|
|
2504
|
+
var requestIdleCallback = typeof self !== "undefined" && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
|
|
2505
|
+
let start = Date.now();
|
|
2506
|
+
return self.setTimeout(function() {
|
|
2507
|
+
cb({
|
|
2508
|
+
didTimeout: false,
|
|
2509
|
+
timeRemaining: function() {
|
|
2510
|
+
return Math.max(0, 50 - (Date.now() - start));
|
|
2511
|
+
}
|
|
2512
|
+
});
|
|
2513
|
+
}, 1);
|
|
2514
|
+
};
|
|
2515
|
+
var cancelIdleCallback = typeof self !== "undefined" && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
|
|
2516
|
+
return clearTimeout(id);
|
|
2517
|
+
};
|
|
2518
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
2519
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
2520
|
+
Object.assign(exports.default, exports);
|
|
2521
|
+
module.exports = exports.default;
|
|
2522
|
+
}
|
|
2523
|
+
});
|
|
2524
|
+
|
|
2525
|
+
// ../../node_modules/next/dist/client/use-intersection.js
|
|
2526
|
+
import * as _react from "react";
|
|
2527
|
+
var require_use_intersection = __commonJS((exports, module) => {
|
|
2528
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2529
|
+
value: true
|
|
2530
|
+
});
|
|
2531
|
+
Object.defineProperty(exports, "useIntersection", {
|
|
2532
|
+
enumerable: true,
|
|
2533
|
+
get: function() {
|
|
2534
|
+
return useIntersection;
|
|
2535
|
+
}
|
|
2536
|
+
});
|
|
2537
|
+
var _requestidlecallback = require_request_idle_callback();
|
|
2538
|
+
var hasIntersectionObserver = typeof IntersectionObserver === "function";
|
|
2539
|
+
var observers = new Map;
|
|
2540
|
+
var idList = [];
|
|
2541
|
+
function createObserver(options) {
|
|
2542
|
+
const id = {
|
|
2543
|
+
root: options.root || null,
|
|
2544
|
+
margin: options.rootMargin || ""
|
|
2545
|
+
};
|
|
2546
|
+
const existing = idList.find((obj) => obj.root === id.root && obj.margin === id.margin);
|
|
2547
|
+
let instance;
|
|
2548
|
+
if (existing) {
|
|
2549
|
+
instance = observers.get(existing);
|
|
2550
|
+
if (instance) {
|
|
2551
|
+
return instance;
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
const elements = new Map;
|
|
2555
|
+
const observer = new IntersectionObserver((entries) => {
|
|
2556
|
+
entries.forEach((entry) => {
|
|
2557
|
+
const callback = elements.get(entry.target);
|
|
2558
|
+
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
|
|
2559
|
+
if (callback && isVisible) {
|
|
2560
|
+
callback(isVisible);
|
|
2561
|
+
}
|
|
2562
|
+
});
|
|
2563
|
+
}, options);
|
|
2564
|
+
instance = {
|
|
2565
|
+
id,
|
|
2566
|
+
observer,
|
|
2567
|
+
elements
|
|
2568
|
+
};
|
|
2569
|
+
idList.push(id);
|
|
2570
|
+
observers.set(id, instance);
|
|
2571
|
+
return instance;
|
|
2572
|
+
}
|
|
2573
|
+
function observe(element, callback, options) {
|
|
2574
|
+
const { id, observer, elements } = createObserver(options);
|
|
2575
|
+
elements.set(element, callback);
|
|
2576
|
+
observer.observe(element);
|
|
2577
|
+
return function unobserve() {
|
|
2578
|
+
elements.delete(element);
|
|
2579
|
+
observer.unobserve(element);
|
|
2580
|
+
if (elements.size === 0) {
|
|
2581
|
+
observer.disconnect();
|
|
2582
|
+
observers.delete(id);
|
|
2583
|
+
const index = idList.findIndex((obj) => obj.root === id.root && obj.margin === id.margin);
|
|
2584
|
+
if (index > -1) {
|
|
2585
|
+
idList.splice(index, 1);
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
};
|
|
2589
|
+
}
|
|
2590
|
+
function useIntersection(param) {
|
|
2591
|
+
let { rootRef, rootMargin, disabled } = param;
|
|
2592
|
+
const isDisabled = disabled || !hasIntersectionObserver;
|
|
2593
|
+
const [visible, setVisible] = (0, _react.useState)(false);
|
|
2594
|
+
const elementRef = (0, _react.useRef)(null);
|
|
2595
|
+
const setElement = (0, _react.useCallback)((element) => {
|
|
2596
|
+
elementRef.current = element;
|
|
2597
|
+
}, []);
|
|
2598
|
+
(0, _react.useEffect)(() => {
|
|
2599
|
+
if (hasIntersectionObserver) {
|
|
2600
|
+
if (isDisabled || visible)
|
|
2601
|
+
return;
|
|
2602
|
+
const element = elementRef.current;
|
|
2603
|
+
if (element && element.tagName) {
|
|
2604
|
+
const unobserve = observe(element, (isVisible) => isVisible && setVisible(isVisible), {
|
|
2605
|
+
root: rootRef == null ? undefined : rootRef.current,
|
|
2606
|
+
rootMargin
|
|
2607
|
+
});
|
|
2608
|
+
return unobserve;
|
|
2609
|
+
}
|
|
2610
|
+
} else {
|
|
2611
|
+
if (!visible) {
|
|
2612
|
+
const idleCallback = (0, _requestidlecallback.requestIdleCallback)(() => setVisible(true));
|
|
2613
|
+
return () => (0, _requestidlecallback.cancelIdleCallback)(idleCallback);
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
}, [
|
|
2617
|
+
isDisabled,
|
|
2618
|
+
rootMargin,
|
|
2619
|
+
rootRef,
|
|
2620
|
+
visible,
|
|
2621
|
+
elementRef.current
|
|
2622
|
+
]);
|
|
2623
|
+
const resetVisible = (0, _react.useCallback)(() => {
|
|
2624
|
+
setVisible(false);
|
|
2625
|
+
}, []);
|
|
2626
|
+
return [
|
|
2627
|
+
setElement,
|
|
2628
|
+
visible,
|
|
2629
|
+
resetVisible
|
|
2630
|
+
];
|
|
2631
|
+
}
|
|
2632
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
2633
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
2634
|
+
Object.assign(exports.default, exports);
|
|
2635
|
+
module.exports = exports.default;
|
|
2636
|
+
}
|
|
2637
|
+
});
|
|
2638
|
+
|
|
2639
|
+
// ../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
|
|
2640
|
+
var require_normalize_locale_path = __commonJS((exports) => {
|
|
2641
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2642
|
+
value: true
|
|
2643
|
+
});
|
|
2644
|
+
Object.defineProperty(exports, "normalizeLocalePath", {
|
|
2645
|
+
enumerable: true,
|
|
2646
|
+
get: function() {
|
|
2647
|
+
return normalizeLocalePath;
|
|
2648
|
+
}
|
|
2649
|
+
});
|
|
2650
|
+
var cache = new WeakMap;
|
|
2651
|
+
function normalizeLocalePath(pathname, locales) {
|
|
2652
|
+
if (!locales)
|
|
2653
|
+
return {
|
|
2654
|
+
pathname
|
|
2655
|
+
};
|
|
2656
|
+
let lowercasedLocales = cache.get(locales);
|
|
2657
|
+
if (!lowercasedLocales) {
|
|
2658
|
+
lowercasedLocales = locales.map((locale) => locale.toLowerCase());
|
|
2659
|
+
cache.set(locales, lowercasedLocales);
|
|
2660
|
+
}
|
|
2661
|
+
let detectedLocale;
|
|
2662
|
+
const segments = pathname.split("/", 2);
|
|
2663
|
+
if (!segments[1])
|
|
2664
|
+
return {
|
|
2665
|
+
pathname
|
|
2666
|
+
};
|
|
2667
|
+
const segment = segments[1].toLowerCase();
|
|
2668
|
+
const index = lowercasedLocales.indexOf(segment);
|
|
2669
|
+
if (index < 0)
|
|
2670
|
+
return {
|
|
2671
|
+
pathname
|
|
2672
|
+
};
|
|
2673
|
+
detectedLocale = locales[index];
|
|
2674
|
+
pathname = pathname.slice(detectedLocale.length + 1) || "/";
|
|
2675
|
+
return {
|
|
2676
|
+
pathname,
|
|
2677
|
+
detectedLocale
|
|
2678
|
+
};
|
|
2679
|
+
}
|
|
2680
|
+
});
|
|
2681
|
+
|
|
2682
|
+
// ../../node_modules/next/dist/client/normalize-locale-path.js
|
|
2683
|
+
var require_normalize_locale_path2 = __commonJS((exports, module) => {
|
|
2684
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2685
|
+
value: true
|
|
2686
|
+
});
|
|
2687
|
+
Object.defineProperty(exports, "normalizeLocalePath", {
|
|
2688
|
+
enumerable: true,
|
|
2689
|
+
get: function() {
|
|
2690
|
+
return normalizeLocalePath;
|
|
2691
|
+
}
|
|
2692
|
+
});
|
|
2693
|
+
var normalizeLocalePath = (pathname, locales) => {
|
|
2694
|
+
if (process.env.__NEXT_I18N_SUPPORT) {
|
|
2695
|
+
return require_normalize_locale_path().normalizeLocalePath(pathname, locales);
|
|
2696
|
+
}
|
|
2697
|
+
return {
|
|
2698
|
+
pathname,
|
|
2699
|
+
detectedLocale: undefined
|
|
2700
|
+
};
|
|
2701
|
+
};
|
|
2702
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
2703
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
2704
|
+
Object.assign(exports.default, exports);
|
|
2705
|
+
module.exports = exports.default;
|
|
2706
|
+
}
|
|
2707
|
+
});
|
|
2708
|
+
|
|
2709
|
+
// ../../node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
|
|
2710
|
+
var require_detect_domain_locale = __commonJS((exports) => {
|
|
2711
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2712
|
+
value: true
|
|
2713
|
+
});
|
|
2714
|
+
Object.defineProperty(exports, "detectDomainLocale", {
|
|
2715
|
+
enumerable: true,
|
|
2716
|
+
get: function() {
|
|
2717
|
+
return detectDomainLocale;
|
|
2718
|
+
}
|
|
2719
|
+
});
|
|
2720
|
+
function detectDomainLocale(domainItems, hostname, detectedLocale) {
|
|
2721
|
+
if (!domainItems)
|
|
2722
|
+
return;
|
|
2723
|
+
if (detectedLocale) {
|
|
2724
|
+
detectedLocale = detectedLocale.toLowerCase();
|
|
2725
|
+
}
|
|
2726
|
+
for (const item of domainItems) {
|
|
2727
|
+
var _item_domain, _item_locales;
|
|
2728
|
+
const domainHostname = (_item_domain = item.domain) == null ? undefined : _item_domain.split(":", 1)[0].toLowerCase();
|
|
2729
|
+
if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((_item_locales = item.locales) == null ? undefined : _item_locales.some((locale) => locale.toLowerCase() === detectedLocale))) {
|
|
2730
|
+
return item;
|
|
2731
|
+
}
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
});
|
|
2735
|
+
|
|
2736
|
+
// ../../node_modules/next/dist/client/detect-domain-locale.js
|
|
2737
|
+
var require_detect_domain_locale2 = __commonJS((exports, module) => {
|
|
2738
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2739
|
+
value: true
|
|
2740
|
+
});
|
|
2741
|
+
Object.defineProperty(exports, "detectDomainLocale", {
|
|
2742
|
+
enumerable: true,
|
|
2743
|
+
get: function() {
|
|
2744
|
+
return detectDomainLocale;
|
|
2745
|
+
}
|
|
2746
|
+
});
|
|
2747
|
+
var detectDomainLocale = function() {
|
|
2748
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) {
|
|
2749
|
+
args[_key] = arguments[_key];
|
|
2750
|
+
}
|
|
2751
|
+
if (process.env.__NEXT_I18N_SUPPORT) {
|
|
2752
|
+
return require_detect_domain_locale().detectDomainLocale(...args);
|
|
2753
|
+
}
|
|
2754
|
+
};
|
|
2755
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
2756
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
2757
|
+
Object.assign(exports.default, exports);
|
|
2758
|
+
module.exports = exports.default;
|
|
2759
|
+
}
|
|
2760
|
+
});
|
|
2761
|
+
|
|
2762
|
+
// ../../node_modules/next/dist/client/get-domain-locale.js
|
|
2763
|
+
var require_get_domain_locale = __commonJS((exports, module) => {
|
|
2764
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2765
|
+
value: true
|
|
2766
|
+
});
|
|
2767
|
+
Object.defineProperty(exports, "getDomainLocale", {
|
|
2768
|
+
enumerable: true,
|
|
2769
|
+
get: function() {
|
|
2770
|
+
return getDomainLocale;
|
|
2771
|
+
}
|
|
2772
|
+
});
|
|
2773
|
+
var _normalizetrailingslash = require_normalize_trailing_slash();
|
|
2774
|
+
var basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
|
|
2775
|
+
function getDomainLocale(path, locale, locales, domainLocales) {
|
|
2776
|
+
if (process.env.__NEXT_I18N_SUPPORT) {
|
|
2777
|
+
const normalizeLocalePath = require_normalize_locale_path2().normalizeLocalePath;
|
|
2778
|
+
const detectDomainLocale = require_detect_domain_locale2().detectDomainLocale;
|
|
2779
|
+
const target = locale || normalizeLocalePath(path, locales).detectedLocale;
|
|
2780
|
+
const domain = detectDomainLocale(domainLocales, undefined, target);
|
|
2781
|
+
if (domain) {
|
|
2782
|
+
const proto = "http" + (domain.http ? "" : "s") + "://";
|
|
2783
|
+
const finalLocale = target === domain.defaultLocale ? "" : "/" + target;
|
|
2784
|
+
return "" + proto + domain.domain + (0, _normalizetrailingslash.normalizePathTrailingSlash)("" + basePath + finalLocale + path);
|
|
2785
|
+
}
|
|
2786
|
+
return false;
|
|
2787
|
+
} else {
|
|
2788
|
+
return false;
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
2792
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
2793
|
+
Object.assign(exports.default, exports);
|
|
2794
|
+
module.exports = exports.default;
|
|
2795
|
+
}
|
|
2796
|
+
});
|
|
2797
|
+
|
|
2798
|
+
// ../../node_modules/next/dist/client/add-base-path.js
|
|
2799
|
+
var require_add_base_path = __commonJS((exports, module) => {
|
|
2800
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2801
|
+
value: true
|
|
2802
|
+
});
|
|
2803
|
+
Object.defineProperty(exports, "addBasePath", {
|
|
2804
|
+
enumerable: true,
|
|
2805
|
+
get: function() {
|
|
2806
|
+
return addBasePath;
|
|
2807
|
+
}
|
|
2808
|
+
});
|
|
2809
|
+
var _addpathprefix = require_add_path_prefix();
|
|
2810
|
+
var _normalizetrailingslash = require_normalize_trailing_slash();
|
|
2811
|
+
var basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
|
|
2812
|
+
function addBasePath(path, required) {
|
|
2813
|
+
return (0, _normalizetrailingslash.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required ? path : (0, _addpathprefix.addPathPrefix)(path, basePath));
|
|
2814
|
+
}
|
|
2815
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
2816
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
2817
|
+
Object.assign(exports.default, exports);
|
|
2818
|
+
module.exports = exports.default;
|
|
2819
|
+
}
|
|
2820
|
+
});
|
|
2821
|
+
|
|
2822
|
+
// ../../node_modules/next/dist/client/use-merged-ref.js
|
|
2823
|
+
import * as _react2 from "react";
|
|
2824
|
+
var require_use_merged_ref = __commonJS((exports, module) => {
|
|
2825
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2826
|
+
value: true
|
|
2827
|
+
});
|
|
2828
|
+
Object.defineProperty(exports, "useMergedRef", {
|
|
2829
|
+
enumerable: true,
|
|
2830
|
+
get: function() {
|
|
2831
|
+
return useMergedRef;
|
|
2832
|
+
}
|
|
2833
|
+
});
|
|
2834
|
+
function useMergedRef(refA, refB) {
|
|
2835
|
+
const cleanupA = (0, _react2.useRef)(null);
|
|
2836
|
+
const cleanupB = (0, _react2.useRef)(null);
|
|
2837
|
+
return (0, _react2.useCallback)((current) => {
|
|
2838
|
+
if (current === null) {
|
|
2839
|
+
const cleanupFnA = cleanupA.current;
|
|
2840
|
+
if (cleanupFnA) {
|
|
2841
|
+
cleanupA.current = null;
|
|
2842
|
+
cleanupFnA();
|
|
2843
|
+
}
|
|
2844
|
+
const cleanupFnB = cleanupB.current;
|
|
2845
|
+
if (cleanupFnB) {
|
|
2846
|
+
cleanupB.current = null;
|
|
2847
|
+
cleanupFnB();
|
|
2848
|
+
}
|
|
2849
|
+
} else {
|
|
2850
|
+
if (refA) {
|
|
2851
|
+
cleanupA.current = applyRef(refA, current);
|
|
2852
|
+
}
|
|
2853
|
+
if (refB) {
|
|
2854
|
+
cleanupB.current = applyRef(refB, current);
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
}, [
|
|
2858
|
+
refA,
|
|
2859
|
+
refB
|
|
2860
|
+
]);
|
|
2861
|
+
}
|
|
2862
|
+
function applyRef(refA, current) {
|
|
2863
|
+
if (typeof refA === "function") {
|
|
2864
|
+
const cleanup = refA(current);
|
|
2865
|
+
if (typeof cleanup === "function") {
|
|
2866
|
+
return cleanup;
|
|
2867
|
+
} else {
|
|
2868
|
+
return () => refA(null);
|
|
2869
|
+
}
|
|
2870
|
+
} else {
|
|
2871
|
+
refA.current = current;
|
|
2872
|
+
return () => {
|
|
2873
|
+
refA.current = null;
|
|
2874
|
+
};
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2877
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
2878
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
2879
|
+
Object.assign(exports.default, exports);
|
|
2880
|
+
module.exports = exports.default;
|
|
2881
|
+
}
|
|
2882
|
+
});
|
|
2883
|
+
|
|
2884
|
+
// ../../node_modules/next/dist/shared/lib/utils/error-once.js
|
|
2885
|
+
var require_error_once = __commonJS((exports) => {
|
|
2886
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2887
|
+
value: true
|
|
2888
|
+
});
|
|
2889
|
+
Object.defineProperty(exports, "errorOnce", {
|
|
2890
|
+
enumerable: true,
|
|
2891
|
+
get: function() {
|
|
2892
|
+
return errorOnce;
|
|
2893
|
+
}
|
|
2894
|
+
});
|
|
2895
|
+
var errorOnce = (_) => {};
|
|
2896
|
+
if (false) {}
|
|
2897
|
+
});
|
|
2898
|
+
|
|
2899
|
+
// ../../node_modules/next/dist/client/link.js
|
|
2900
|
+
import * as _jsxruntime from "react/jsx-runtime";
|
|
2901
|
+
import * as react2 from "react";
|
|
2902
|
+
var require_link = __commonJS((exports, module) => {
|
|
2903
|
+
|
|
2904
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2905
|
+
value: true
|
|
2906
|
+
});
|
|
2907
|
+
function _export(target, all) {
|
|
2908
|
+
for (var name in all)
|
|
2909
|
+
Object.defineProperty(target, name, {
|
|
2910
|
+
enumerable: true,
|
|
2911
|
+
get: all[name]
|
|
2912
|
+
});
|
|
2913
|
+
}
|
|
2914
|
+
_export(exports, {
|
|
2915
|
+
default: function() {
|
|
2916
|
+
return _default;
|
|
2917
|
+
},
|
|
2918
|
+
useLinkStatus: function() {
|
|
2919
|
+
return useLinkStatus;
|
|
2920
|
+
}
|
|
2921
|
+
});
|
|
2922
|
+
var _interop_require_wildcard = require__interop_require_wildcard();
|
|
2923
|
+
var _react3 = /* @__PURE__ */ _interop_require_wildcard._(react2);
|
|
2924
|
+
var _resolvehref = require_resolve_href();
|
|
2925
|
+
var _islocalurl = require_is_local_url();
|
|
2926
|
+
var _formaturl = require_format_url();
|
|
2927
|
+
var _utils = require_utils();
|
|
2928
|
+
var _addlocale = require_add_locale2();
|
|
2929
|
+
var _routercontextsharedruntime = require_router_context_shared_runtime();
|
|
2930
|
+
var _useintersection = require_use_intersection();
|
|
2931
|
+
var _getdomainlocale = require_get_domain_locale();
|
|
2932
|
+
var _addbasepath = require_add_base_path();
|
|
2933
|
+
var _usemergedref = require_use_merged_ref();
|
|
2934
|
+
var _erroronce = require_error_once();
|
|
2935
|
+
var prefetched = new Set;
|
|
2936
|
+
function prefetch(router, href, as, options) {
|
|
2937
|
+
if (typeof window === "undefined") {
|
|
2938
|
+
return;
|
|
2939
|
+
}
|
|
2940
|
+
if (!(0, _islocalurl.isLocalURL)(href)) {
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
if (!options.bypassPrefetchedCheck) {
|
|
2944
|
+
const locale = typeof options.locale !== "undefined" ? options.locale : ("locale" in router) ? router.locale : undefined;
|
|
2945
|
+
const prefetchedKey = href + "%" + as + "%" + locale;
|
|
2946
|
+
if (prefetched.has(prefetchedKey)) {
|
|
2947
|
+
return;
|
|
2948
|
+
}
|
|
2949
|
+
prefetched.add(prefetchedKey);
|
|
2950
|
+
}
|
|
2951
|
+
router.prefetch(href, as, options).catch((err) => {
|
|
2952
|
+
if (false) {}
|
|
2953
|
+
});
|
|
2954
|
+
}
|
|
2955
|
+
function isModifiedEvent(event) {
|
|
2956
|
+
const eventTarget = event.currentTarget;
|
|
2957
|
+
const target = eventTarget.getAttribute("target");
|
|
2958
|
+
return target && target !== "_self" || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.nativeEvent && event.nativeEvent.which === 2;
|
|
2959
|
+
}
|
|
2960
|
+
function linkClicked(e, router, href, as, replace, shallow, scroll, locale, onNavigate) {
|
|
2961
|
+
const { nodeName } = e.currentTarget;
|
|
2962
|
+
const isAnchorNodeName = nodeName.toUpperCase() === "A";
|
|
2963
|
+
if (isAnchorNodeName && isModifiedEvent(e) || e.currentTarget.hasAttribute("download")) {
|
|
2964
|
+
return;
|
|
2965
|
+
}
|
|
2966
|
+
if (!(0, _islocalurl.isLocalURL)(href)) {
|
|
2967
|
+
if (replace) {
|
|
2968
|
+
e.preventDefault();
|
|
2969
|
+
location.replace(href);
|
|
2970
|
+
}
|
|
2971
|
+
return;
|
|
2972
|
+
}
|
|
2973
|
+
e.preventDefault();
|
|
2974
|
+
const navigate = () => {
|
|
2975
|
+
if (onNavigate) {
|
|
2976
|
+
let isDefaultPrevented = false;
|
|
2977
|
+
onNavigate({
|
|
2978
|
+
preventDefault: () => {
|
|
2979
|
+
isDefaultPrevented = true;
|
|
2980
|
+
}
|
|
2981
|
+
});
|
|
2982
|
+
if (isDefaultPrevented) {
|
|
2983
|
+
return;
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
const routerScroll = scroll != null ? scroll : true;
|
|
2987
|
+
if ("beforePopState" in router) {
|
|
2988
|
+
router[replace ? "replace" : "push"](href, as, {
|
|
2989
|
+
shallow,
|
|
2990
|
+
locale,
|
|
2991
|
+
scroll: routerScroll
|
|
2992
|
+
});
|
|
2993
|
+
} else {
|
|
2994
|
+
router[replace ? "replace" : "push"](as || href, {
|
|
2995
|
+
scroll: routerScroll
|
|
2996
|
+
});
|
|
2997
|
+
}
|
|
2998
|
+
};
|
|
2999
|
+
navigate();
|
|
3000
|
+
}
|
|
3001
|
+
function formatStringOrUrl(urlObjOrString) {
|
|
3002
|
+
if (typeof urlObjOrString === "string") {
|
|
3003
|
+
return urlObjOrString;
|
|
3004
|
+
}
|
|
3005
|
+
return (0, _formaturl.formatUrl)(urlObjOrString);
|
|
3006
|
+
}
|
|
3007
|
+
var Link = /* @__PURE__ */ _react3.default.forwardRef(function LinkComponent(props, forwardedRef) {
|
|
3008
|
+
let children;
|
|
3009
|
+
const { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, locale, onClick, onNavigate, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false, ...restProps } = props;
|
|
3010
|
+
children = childrenProp;
|
|
3011
|
+
if (legacyBehavior && (typeof children === "string" || typeof children === "number")) {
|
|
3012
|
+
children = /* @__PURE__ */ (0, _jsxruntime.jsx)("a", {
|
|
3013
|
+
children
|
|
3014
|
+
});
|
|
3015
|
+
}
|
|
3016
|
+
const router = _react3.default.useContext(_routercontextsharedruntime.RouterContext);
|
|
3017
|
+
const prefetchEnabled = prefetchProp !== false;
|
|
3018
|
+
if (false) {
|
|
3019
|
+
let createPropError = function(args) {};
|
|
3020
|
+
}
|
|
3021
|
+
const { href, as } = _react3.default.useMemo(() => {
|
|
3022
|
+
if (!router) {
|
|
3023
|
+
const resolvedHref2 = formatStringOrUrl(hrefProp);
|
|
3024
|
+
return {
|
|
3025
|
+
href: resolvedHref2,
|
|
3026
|
+
as: asProp ? formatStringOrUrl(asProp) : resolvedHref2
|
|
3027
|
+
};
|
|
3028
|
+
}
|
|
3029
|
+
const [resolvedHref, resolvedAs] = (0, _resolvehref.resolveHref)(router, hrefProp, true);
|
|
3030
|
+
return {
|
|
3031
|
+
href: resolvedHref,
|
|
3032
|
+
as: asProp ? (0, _resolvehref.resolveHref)(router, asProp) : resolvedAs || resolvedHref
|
|
3033
|
+
};
|
|
3034
|
+
}, [
|
|
3035
|
+
router,
|
|
3036
|
+
hrefProp,
|
|
3037
|
+
asProp
|
|
3038
|
+
]);
|
|
3039
|
+
const previousHref = _react3.default.useRef(href);
|
|
3040
|
+
const previousAs = _react3.default.useRef(as);
|
|
3041
|
+
let child;
|
|
3042
|
+
if (legacyBehavior) {
|
|
3043
|
+
if (false) {} else {
|
|
3044
|
+
child = _react3.default.Children.only(children);
|
|
3045
|
+
}
|
|
3046
|
+
} else {
|
|
3047
|
+
if (false) {}
|
|
3048
|
+
}
|
|
3049
|
+
const childRef = legacyBehavior ? child && typeof child === "object" && child.ref : forwardedRef;
|
|
3050
|
+
const [setIntersectionRef, isVisible, resetVisible] = (0, _useintersection.useIntersection)({
|
|
3051
|
+
rootMargin: "200px"
|
|
3052
|
+
});
|
|
3053
|
+
const setIntersectionWithResetRef = _react3.default.useCallback((el) => {
|
|
3054
|
+
if (previousAs.current !== as || previousHref.current !== href) {
|
|
3055
|
+
resetVisible();
|
|
3056
|
+
previousAs.current = as;
|
|
3057
|
+
previousHref.current = href;
|
|
3058
|
+
}
|
|
3059
|
+
setIntersectionRef(el);
|
|
3060
|
+
}, [
|
|
3061
|
+
as,
|
|
3062
|
+
href,
|
|
3063
|
+
resetVisible,
|
|
3064
|
+
setIntersectionRef
|
|
3065
|
+
]);
|
|
3066
|
+
const setRef = (0, _usemergedref.useMergedRef)(setIntersectionWithResetRef, childRef);
|
|
3067
|
+
_react3.default.useEffect(() => {
|
|
3068
|
+
if (false) {}
|
|
3069
|
+
if (!router) {
|
|
3070
|
+
return;
|
|
3071
|
+
}
|
|
3072
|
+
if (!isVisible || !prefetchEnabled) {
|
|
3073
|
+
return;
|
|
3074
|
+
}
|
|
3075
|
+
prefetch(router, href, as, {
|
|
3076
|
+
locale
|
|
3077
|
+
});
|
|
3078
|
+
}, [
|
|
3079
|
+
as,
|
|
3080
|
+
href,
|
|
3081
|
+
isVisible,
|
|
3082
|
+
locale,
|
|
3083
|
+
prefetchEnabled,
|
|
3084
|
+
router == null ? undefined : router.locale,
|
|
3085
|
+
router
|
|
3086
|
+
]);
|
|
3087
|
+
const childProps = {
|
|
3088
|
+
ref: setRef,
|
|
3089
|
+
onClick(e) {
|
|
3090
|
+
if (false) {}
|
|
3091
|
+
if (!legacyBehavior && typeof onClick === "function") {
|
|
3092
|
+
onClick(e);
|
|
3093
|
+
}
|
|
3094
|
+
if (legacyBehavior && child.props && typeof child.props.onClick === "function") {
|
|
3095
|
+
child.props.onClick(e);
|
|
3096
|
+
}
|
|
3097
|
+
if (!router) {
|
|
3098
|
+
return;
|
|
3099
|
+
}
|
|
3100
|
+
if (e.defaultPrevented) {
|
|
3101
|
+
return;
|
|
3102
|
+
}
|
|
3103
|
+
linkClicked(e, router, href, as, replace, shallow, scroll, locale, onNavigate);
|
|
3104
|
+
},
|
|
3105
|
+
onMouseEnter(e) {
|
|
3106
|
+
if (!legacyBehavior && typeof onMouseEnterProp === "function") {
|
|
3107
|
+
onMouseEnterProp(e);
|
|
3108
|
+
}
|
|
3109
|
+
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === "function") {
|
|
3110
|
+
child.props.onMouseEnter(e);
|
|
3111
|
+
}
|
|
3112
|
+
if (!router) {
|
|
3113
|
+
return;
|
|
3114
|
+
}
|
|
3115
|
+
prefetch(router, href, as, {
|
|
3116
|
+
locale,
|
|
3117
|
+
priority: true,
|
|
3118
|
+
bypassPrefetchedCheck: true
|
|
3119
|
+
});
|
|
3120
|
+
},
|
|
3121
|
+
onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START ? undefined : function onTouchStart(e) {
|
|
3122
|
+
if (!legacyBehavior && typeof onTouchStartProp === "function") {
|
|
3123
|
+
onTouchStartProp(e);
|
|
3124
|
+
}
|
|
3125
|
+
if (legacyBehavior && child.props && typeof child.props.onTouchStart === "function") {
|
|
3126
|
+
child.props.onTouchStart(e);
|
|
3127
|
+
}
|
|
3128
|
+
if (!router) {
|
|
3129
|
+
return;
|
|
3130
|
+
}
|
|
3131
|
+
prefetch(router, href, as, {
|
|
3132
|
+
locale,
|
|
3133
|
+
priority: true,
|
|
3134
|
+
bypassPrefetchedCheck: true
|
|
3135
|
+
});
|
|
3136
|
+
}
|
|
3137
|
+
};
|
|
3138
|
+
if ((0, _utils.isAbsoluteUrl)(as)) {
|
|
3139
|
+
childProps.href = as;
|
|
3140
|
+
} else if (!legacyBehavior || passHref || child.type === "a" && !("href" in child.props)) {
|
|
3141
|
+
const curLocale = typeof locale !== "undefined" ? locale : router == null ? undefined : router.locale;
|
|
3142
|
+
const localeDomain = (router == null ? undefined : router.isLocaleDomain) && (0, _getdomainlocale.getDomainLocale)(as, curLocale, router == null ? undefined : router.locales, router == null ? undefined : router.domainLocales);
|
|
3143
|
+
childProps.href = localeDomain || (0, _addbasepath.addBasePath)((0, _addlocale.addLocale)(as, curLocale, router == null ? undefined : router.defaultLocale));
|
|
3144
|
+
}
|
|
3145
|
+
if (legacyBehavior) {
|
|
3146
|
+
if (false) {}
|
|
3147
|
+
return /* @__PURE__ */ _react3.default.cloneElement(child, childProps);
|
|
3148
|
+
}
|
|
3149
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)("a", {
|
|
3150
|
+
...restProps,
|
|
3151
|
+
...childProps,
|
|
3152
|
+
children
|
|
3153
|
+
});
|
|
3154
|
+
});
|
|
3155
|
+
var LinkStatusContext = /* @__PURE__ */ (0, _react3.createContext)({
|
|
3156
|
+
pending: false
|
|
3157
|
+
});
|
|
3158
|
+
var useLinkStatus = () => {
|
|
3159
|
+
return (0, _react3.useContext)(LinkStatusContext);
|
|
3160
|
+
};
|
|
3161
|
+
var _default = Link;
|
|
3162
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
3163
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
3164
|
+
Object.assign(exports.default, exports);
|
|
3165
|
+
module.exports = exports.default;
|
|
3166
|
+
}
|
|
3167
|
+
});
|
|
3168
|
+
// src/components/styled/index.ts
|
|
3169
|
+
import {
|
|
3170
|
+
CodeTabs,
|
|
3171
|
+
ImportSection
|
|
3172
|
+
} from "@openpkg-ts/ui/api";
|
|
3173
|
+
|
|
3174
|
+
// src/components/styled/sections/ClassSection.tsx
|
|
3175
|
+
import { APIParameterItem, APISection, ParameterList } from "@openpkg-ts/ui/docskit";
|
|
3176
|
+
|
|
3177
|
+
// src/adapters/spec-to-docskit.ts
|
|
3178
|
+
import { formatSchema } from "@openpkg-ts/sdk";
|
|
3179
|
+
function specSchemaToAPISchema(schema) {
|
|
3180
|
+
if (!schema || typeof schema !== "object")
|
|
3181
|
+
return;
|
|
3182
|
+
const s = schema;
|
|
3183
|
+
const result = {};
|
|
3184
|
+
result.type = formatSchema(schema);
|
|
3185
|
+
result.typeString = result.type;
|
|
3186
|
+
if (typeof s.description === "string") {
|
|
3187
|
+
result.description = s.description;
|
|
3188
|
+
}
|
|
3189
|
+
if (s.type === "object" && s.properties && typeof s.properties === "object") {
|
|
3190
|
+
result.properties = {};
|
|
3191
|
+
for (const [key, value] of Object.entries(s.properties)) {
|
|
3192
|
+
const nestedSchema = specSchemaToAPISchema(value);
|
|
3193
|
+
if (nestedSchema) {
|
|
3194
|
+
result.properties[key] = nestedSchema;
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
if (Array.isArray(s.required)) {
|
|
3198
|
+
result.required = s.required;
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
3201
|
+
return result;
|
|
3202
|
+
}
|
|
3203
|
+
function specParamToAPIParam(param) {
|
|
3204
|
+
const type = formatSchema(param.schema);
|
|
3205
|
+
const children = specSchemaToAPISchema(param.schema);
|
|
3206
|
+
const hasNestedProperties = children?.properties && Object.keys(children.properties).length > 0;
|
|
3207
|
+
return {
|
|
3208
|
+
name: param.name ?? "unknown",
|
|
3209
|
+
type,
|
|
3210
|
+
required: param.required !== false,
|
|
3211
|
+
description: param.description,
|
|
3212
|
+
children: hasNestedProperties ? children : undefined
|
|
3213
|
+
};
|
|
3214
|
+
}
|
|
3215
|
+
function specExamplesToCodeExamples(examples, defaultLang = "typescript") {
|
|
3216
|
+
if (!examples?.length)
|
|
3217
|
+
return [];
|
|
3218
|
+
return examples.map((example) => {
|
|
3219
|
+
if (typeof example === "string") {
|
|
3220
|
+
return {
|
|
3221
|
+
languageId: defaultLang,
|
|
3222
|
+
code: example,
|
|
3223
|
+
highlightLang: getLangForHighlight(defaultLang)
|
|
3224
|
+
};
|
|
3225
|
+
}
|
|
3226
|
+
return {
|
|
3227
|
+
languageId: example.language || defaultLang,
|
|
3228
|
+
code: example.code,
|
|
3229
|
+
highlightLang: getLangForHighlight(example.language || defaultLang)
|
|
3230
|
+
};
|
|
3231
|
+
});
|
|
3232
|
+
}
|
|
3233
|
+
function getLangForHighlight(lang) {
|
|
3234
|
+
const langMap = {
|
|
3235
|
+
typescript: "ts",
|
|
3236
|
+
javascript: "js",
|
|
3237
|
+
ts: "ts",
|
|
3238
|
+
js: "js",
|
|
3239
|
+
tsx: "tsx",
|
|
3240
|
+
jsx: "jsx",
|
|
3241
|
+
bash: "bash",
|
|
3242
|
+
shell: "bash",
|
|
3243
|
+
sh: "bash",
|
|
3244
|
+
curl: "bash",
|
|
3245
|
+
json: "json",
|
|
3246
|
+
python: "python",
|
|
3247
|
+
py: "python",
|
|
3248
|
+
go: "go",
|
|
3249
|
+
rust: "rust",
|
|
3250
|
+
ruby: "ruby"
|
|
3251
|
+
};
|
|
3252
|
+
return langMap[lang.toLowerCase()] || lang;
|
|
3253
|
+
}
|
|
3254
|
+
function getLanguagesFromExamples(examples) {
|
|
3255
|
+
if (!examples?.length)
|
|
3256
|
+
return [];
|
|
3257
|
+
const langSet = new Set;
|
|
3258
|
+
const languages = [];
|
|
3259
|
+
for (const example of examples) {
|
|
3260
|
+
const lang = typeof example === "string" ? "typescript" : example.language || "typescript";
|
|
3261
|
+
if (!langSet.has(lang)) {
|
|
3262
|
+
langSet.add(lang);
|
|
3263
|
+
languages.push({
|
|
3264
|
+
id: lang,
|
|
3265
|
+
label: getLanguageLabel(lang)
|
|
3266
|
+
});
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
return languages;
|
|
3270
|
+
}
|
|
3271
|
+
function getLanguageLabel(lang) {
|
|
3272
|
+
const labels = {
|
|
3273
|
+
typescript: "TypeScript",
|
|
3274
|
+
javascript: "JavaScript",
|
|
3275
|
+
ts: "TypeScript",
|
|
3276
|
+
js: "JavaScript",
|
|
3277
|
+
tsx: "TSX",
|
|
3278
|
+
jsx: "JSX",
|
|
3279
|
+
bash: "Bash",
|
|
3280
|
+
shell: "Shell",
|
|
3281
|
+
sh: "Shell",
|
|
3282
|
+
curl: "cURL",
|
|
3283
|
+
json: "JSON",
|
|
3284
|
+
python: "Python",
|
|
3285
|
+
py: "Python",
|
|
3286
|
+
go: "Go",
|
|
3287
|
+
rust: "Rust",
|
|
3288
|
+
ruby: "Ruby",
|
|
3289
|
+
node: "Node.js"
|
|
3290
|
+
};
|
|
3291
|
+
return labels[lang.toLowerCase()] || lang;
|
|
3292
|
+
}
|
|
3293
|
+
function buildImportStatement(exp, spec) {
|
|
3294
|
+
const packageName = spec.meta?.name || "package";
|
|
3295
|
+
const presentation = spec.extensions?.presentation?.[exp.id];
|
|
3296
|
+
const importPath = presentation?.importPath || packageName;
|
|
3297
|
+
const alias = presentation?.alias || exp.name;
|
|
3298
|
+
if (exp.kind === "type" || exp.kind === "interface") {
|
|
3299
|
+
return `import type { ${alias} } from '${importPath}'`;
|
|
3300
|
+
}
|
|
3301
|
+
return `import { ${alias} } from '${importPath}'`;
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
// src/components/styled/sections/ClassSection.tsx
|
|
3305
|
+
import { formatSchema as formatSchema2 } from "@openpkg-ts/sdk";
|
|
3306
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3307
|
+
|
|
3308
|
+
function formatMethodSignature(member) {
|
|
3309
|
+
const sig = member.signatures?.[0];
|
|
3310
|
+
const params = sig?.parameters ?? [];
|
|
3311
|
+
const returnType = formatSchema2(sig?.returns?.schema);
|
|
3312
|
+
const paramStr = params.map((p) => `${p.name}${p.required === false ? "?" : ""}: ${formatSchema2(p.schema)}`).join(", ");
|
|
3313
|
+
return `(${paramStr}): ${returnType}`;
|
|
3314
|
+
}
|
|
3315
|
+
function getMemberBadges(member) {
|
|
3316
|
+
const badges = [];
|
|
3317
|
+
const flags = member.flags;
|
|
3318
|
+
if (member.visibility && member.visibility !== "public") {
|
|
3319
|
+
badges.push(member.visibility);
|
|
3320
|
+
}
|
|
3321
|
+
if (flags?.static)
|
|
3322
|
+
badges.push("static");
|
|
3323
|
+
if (flags?.readonly)
|
|
3324
|
+
badges.push("readonly");
|
|
3325
|
+
if (flags?.async)
|
|
3326
|
+
badges.push("async");
|
|
3327
|
+
if (flags?.abstract)
|
|
3328
|
+
badges.push("abstract");
|
|
3329
|
+
return badges;
|
|
3330
|
+
}
|
|
3331
|
+
function formatDecorators(decorators) {
|
|
3332
|
+
if (!decorators?.length)
|
|
3333
|
+
return "";
|
|
3334
|
+
return decorators.map((d) => {
|
|
3335
|
+
const args = d.argumentsText?.length ? `(${d.argumentsText.join(", ")})` : "";
|
|
3336
|
+
return `@${d.name}${args}`;
|
|
3337
|
+
}).join(" ");
|
|
3338
|
+
}
|
|
3339
|
+
function buildMemberDescription(member) {
|
|
3340
|
+
const parts = [];
|
|
3341
|
+
const decoratorsStr = formatDecorators(member.decorators);
|
|
3342
|
+
if (decoratorsStr)
|
|
3343
|
+
parts.push(decoratorsStr);
|
|
3344
|
+
if ("inheritedFrom" in member && member.inheritedFrom) {
|
|
3345
|
+
parts.push(`Inherited from ${member.inheritedFrom}`);
|
|
3346
|
+
}
|
|
3347
|
+
if (member.description)
|
|
3348
|
+
parts.push(member.description);
|
|
3349
|
+
return parts.length > 0 ? parts.join(" • ") : undefined;
|
|
3350
|
+
}
|
|
3351
|
+
function ClassSection({ export: exp, spec }) {
|
|
3352
|
+
const constructors = exp.members?.filter((m) => m.kind === "constructor") ?? [];
|
|
3353
|
+
const properties = exp.members?.filter((m) => m.kind === "property" || m.kind === "field") ?? [];
|
|
3354
|
+
const methods = exp.members?.filter((m) => m.kind === "method") ?? [];
|
|
3355
|
+
const staticProperties = properties.filter((m) => m.flags?.static);
|
|
3356
|
+
const instanceProperties = properties.filter((m) => !m.flags?.static);
|
|
3357
|
+
const staticMethods = methods.filter((m) => m.flags?.static);
|
|
3358
|
+
const instanceMethods = methods.filter((m) => !m.flags?.static);
|
|
3359
|
+
const constructorSig = constructors[0]?.signatures?.[0];
|
|
3360
|
+
const constructorParams = constructorSig?.parameters ?? [];
|
|
3361
|
+
const languages = getLanguagesFromExamples(exp.examples);
|
|
3362
|
+
const examples = specExamplesToCodeExamples(exp.examples);
|
|
3363
|
+
const importStatement = buildImportStatement(exp, spec);
|
|
3364
|
+
const displayExamples = examples.length > 0 ? examples : [
|
|
3365
|
+
{
|
|
3366
|
+
languageId: "typescript",
|
|
3367
|
+
code: `${importStatement}
|
|
3368
|
+
|
|
3369
|
+
const instance = new ${exp.name}(${constructorParams.map((p) => p.name).join(", ")});`,
|
|
3370
|
+
highlightLang: "ts"
|
|
3371
|
+
}
|
|
3372
|
+
];
|
|
3373
|
+
const displayLanguages = languages.length > 0 ? languages : [{ id: "typescript", label: "TypeScript" }];
|
|
3374
|
+
const inheritance = [
|
|
3375
|
+
exp.extends && `extends ${exp.extends}`,
|
|
3376
|
+
exp.implements?.length && `implements ${exp.implements.join(", ")}`
|
|
3377
|
+
].filter(Boolean).join(" ");
|
|
3378
|
+
return /* @__PURE__ */ jsxs(APISection, {
|
|
3379
|
+
id: exp.id || exp.name,
|
|
3380
|
+
title: `class ${exp.name}`,
|
|
3381
|
+
description: /* @__PURE__ */ jsxs("div", {
|
|
3382
|
+
className: "space-y-3",
|
|
3383
|
+
children: [
|
|
3384
|
+
inheritance && /* @__PURE__ */ jsx("p", {
|
|
3385
|
+
className: "font-mono text-sm text-muted-foreground",
|
|
3386
|
+
children: inheritance
|
|
3387
|
+
}),
|
|
3388
|
+
exp.description && /* @__PURE__ */ jsx("p", {
|
|
3389
|
+
children: exp.description
|
|
3390
|
+
}),
|
|
3391
|
+
/* @__PURE__ */ jsx("code", {
|
|
3392
|
+
className: "text-sm font-mono bg-muted px-2 py-1 rounded inline-block",
|
|
3393
|
+
children: importStatement
|
|
3394
|
+
})
|
|
3395
|
+
]
|
|
3396
|
+
}),
|
|
3397
|
+
languages: displayLanguages,
|
|
3398
|
+
examples: displayExamples,
|
|
3399
|
+
codePanelTitle: `new ${exp.name}()`,
|
|
3400
|
+
children: [
|
|
3401
|
+
constructorParams.length > 0 && /* @__PURE__ */ jsx(ParameterList, {
|
|
3402
|
+
title: "Constructor",
|
|
3403
|
+
children: constructorParams.map((param, index) => {
|
|
3404
|
+
const apiParam = specParamToAPIParam(param);
|
|
3405
|
+
return /* @__PURE__ */ jsx(APIParameterItem, {
|
|
3406
|
+
name: apiParam.name,
|
|
3407
|
+
type: apiParam.type,
|
|
3408
|
+
required: apiParam.required,
|
|
3409
|
+
description: apiParam.description,
|
|
3410
|
+
children: apiParam.children
|
|
3411
|
+
}, param.name ?? index);
|
|
3412
|
+
})
|
|
3413
|
+
}),
|
|
3414
|
+
(staticProperties.length > 0 || staticMethods.length > 0) && /* @__PURE__ */ jsxs(ParameterList, {
|
|
3415
|
+
title: "Static Members",
|
|
3416
|
+
className: "mt-6",
|
|
3417
|
+
children: [
|
|
3418
|
+
staticProperties.map((member) => {
|
|
3419
|
+
const badges = getMemberBadges(member);
|
|
3420
|
+
const desc = buildMemberDescription(member);
|
|
3421
|
+
return /* @__PURE__ */ jsx(APIParameterItem, {
|
|
3422
|
+
name: member.name,
|
|
3423
|
+
type: formatSchema2(member.schema),
|
|
3424
|
+
description: badges.length > 0 ? `[${badges.join(", ")}] ${desc || ""}` : desc
|
|
3425
|
+
}, member.name);
|
|
3426
|
+
}),
|
|
3427
|
+
staticMethods.map((member) => {
|
|
3428
|
+
const badges = getMemberBadges(member);
|
|
3429
|
+
const desc = buildMemberDescription(member);
|
|
3430
|
+
return /* @__PURE__ */ jsx(APIParameterItem, {
|
|
3431
|
+
name: `${member.name}()`,
|
|
3432
|
+
type: formatMethodSignature(member),
|
|
3433
|
+
description: badges.length > 0 ? `[${badges.join(", ")}] ${desc || ""}` : desc
|
|
3434
|
+
}, member.name);
|
|
3435
|
+
})
|
|
3436
|
+
]
|
|
3437
|
+
}),
|
|
3438
|
+
instanceMethods.length > 0 && /* @__PURE__ */ jsx(ParameterList, {
|
|
3439
|
+
title: "Methods",
|
|
3440
|
+
className: "mt-6",
|
|
3441
|
+
children: instanceMethods.map((member) => {
|
|
3442
|
+
const badges = getMemberBadges(member);
|
|
3443
|
+
const desc = buildMemberDescription(member);
|
|
3444
|
+
return /* @__PURE__ */ jsx(APIParameterItem, {
|
|
3445
|
+
name: `${member.name}()`,
|
|
3446
|
+
type: formatMethodSignature(member),
|
|
3447
|
+
description: badges.length > 0 ? `[${badges.join(", ")}] ${desc || ""}` : desc
|
|
3448
|
+
}, member.name);
|
|
3449
|
+
})
|
|
3450
|
+
}),
|
|
3451
|
+
instanceProperties.length > 0 && /* @__PURE__ */ jsx(ParameterList, {
|
|
3452
|
+
title: "Properties",
|
|
3453
|
+
className: "mt-6",
|
|
3454
|
+
children: instanceProperties.map((member) => {
|
|
3455
|
+
const badges = getMemberBadges(member);
|
|
3456
|
+
const desc = buildMemberDescription(member);
|
|
3457
|
+
return /* @__PURE__ */ jsx(APIParameterItem, {
|
|
3458
|
+
name: member.name,
|
|
3459
|
+
type: formatSchema2(member.schema),
|
|
3460
|
+
description: badges.length > 0 ? `[${badges.join(", ")}] ${desc || ""}` : desc
|
|
3461
|
+
}, member.name);
|
|
3462
|
+
})
|
|
3463
|
+
})
|
|
3464
|
+
]
|
|
3465
|
+
});
|
|
3466
|
+
}
|
|
3467
|
+
|
|
3468
|
+
// src/components/styled/ClassPage.tsx
|
|
3469
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
3470
|
+
|
|
3471
|
+
function ClassPage({ export: exp, spec }) {
|
|
3472
|
+
return /* @__PURE__ */ jsx2("div", {
|
|
3473
|
+
className: "doccov-class-page not-prose",
|
|
3474
|
+
children: /* @__PURE__ */ jsx2(ClassSection, {
|
|
3475
|
+
export: exp,
|
|
3476
|
+
spec
|
|
3477
|
+
})
|
|
3478
|
+
});
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
// src/components/styled/sections/EnumSection.tsx
|
|
3482
|
+
import { APIParameterItem as APIParameterItem2, APISection as APISection2, ParameterList as ParameterList2 } from "@openpkg-ts/ui/docskit";
|
|
3483
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
3484
|
+
|
|
3485
|
+
function EnumSection({ export: exp, spec }) {
|
|
3486
|
+
const members = exp.members ?? [];
|
|
3487
|
+
const languages = getLanguagesFromExamples(exp.examples);
|
|
3488
|
+
const examples = specExamplesToCodeExamples(exp.examples);
|
|
3489
|
+
const importStatement = buildImportStatement(exp, spec);
|
|
3490
|
+
const enumDefinition = members.length > 0 ? `enum ${exp.name} {
|
|
3491
|
+
${members.map((m) => {
|
|
3492
|
+
const value = m.schema !== undefined ? typeof m.schema === "object" && m.schema !== null ? m.schema.const ?? m.schema.default : m.schema : undefined;
|
|
3493
|
+
return ` ${m.name}${value !== undefined ? ` = ${JSON.stringify(value)}` : ""},`;
|
|
3494
|
+
}).join(`
|
|
3495
|
+
`)}
|
|
3496
|
+
}` : `enum ${exp.name} { }`;
|
|
3497
|
+
const displayExamples = examples.length > 0 ? examples : [
|
|
3498
|
+
{
|
|
3499
|
+
languageId: "typescript",
|
|
3500
|
+
code: `${importStatement}
|
|
3501
|
+
|
|
3502
|
+
${enumDefinition}`,
|
|
3503
|
+
highlightLang: "ts"
|
|
3504
|
+
}
|
|
3505
|
+
];
|
|
3506
|
+
const displayLanguages = languages.length > 0 ? languages : [{ id: "typescript", label: "TypeScript" }];
|
|
3507
|
+
return /* @__PURE__ */ jsx3(APISection2, {
|
|
3508
|
+
id: exp.id || exp.name,
|
|
3509
|
+
title: `enum ${exp.name}`,
|
|
3510
|
+
description: /* @__PURE__ */ jsxs2("div", {
|
|
3511
|
+
className: "space-y-3",
|
|
3512
|
+
children: [
|
|
3513
|
+
exp.description && /* @__PURE__ */ jsx3("p", {
|
|
3514
|
+
children: exp.description
|
|
3515
|
+
}),
|
|
3516
|
+
exp.deprecated && /* @__PURE__ */ jsxs2("div", {
|
|
3517
|
+
className: "rounded-md bg-yellow-500/10 border border-yellow-500/20 px-3 py-2 text-sm text-yellow-600 dark:text-yellow-400",
|
|
3518
|
+
children: [
|
|
3519
|
+
/* @__PURE__ */ jsx3("strong", {
|
|
3520
|
+
children: "Deprecated:"
|
|
3521
|
+
}),
|
|
3522
|
+
" This export is deprecated."
|
|
3523
|
+
]
|
|
3524
|
+
}),
|
|
3525
|
+
/* @__PURE__ */ jsx3("code", {
|
|
3526
|
+
className: "text-sm font-mono bg-muted px-2 py-1 rounded inline-block",
|
|
3527
|
+
children: importStatement
|
|
3528
|
+
})
|
|
3529
|
+
]
|
|
3530
|
+
}),
|
|
3531
|
+
languages: displayLanguages,
|
|
3532
|
+
examples: displayExamples,
|
|
3533
|
+
codePanelTitle: exp.name,
|
|
3534
|
+
children: members.length > 0 && /* @__PURE__ */ jsx3(ParameterList2, {
|
|
3535
|
+
title: "Members",
|
|
3536
|
+
children: members.map((member, index) => {
|
|
3537
|
+
const value = member.schema !== undefined ? typeof member.schema === "object" && member.schema !== null ? member.schema.const ?? member.schema.default ?? undefined : member.schema : undefined;
|
|
3538
|
+
return /* @__PURE__ */ jsx3(APIParameterItem2, {
|
|
3539
|
+
name: member.name,
|
|
3540
|
+
type: value !== undefined ? String(value) : "auto",
|
|
3541
|
+
description: member.description
|
|
3542
|
+
}, member.name ?? index);
|
|
3543
|
+
})
|
|
3544
|
+
})
|
|
3545
|
+
});
|
|
3546
|
+
}
|
|
3547
|
+
|
|
3548
|
+
// src/components/styled/EnumPage.tsx
|
|
3549
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
3550
|
+
|
|
3551
|
+
function EnumPage({ export: exp, spec }) {
|
|
3552
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
3553
|
+
className: "doccov-enum-page not-prose",
|
|
3554
|
+
children: /* @__PURE__ */ jsx4(EnumSection, {
|
|
3555
|
+
export: exp,
|
|
3556
|
+
spec
|
|
3557
|
+
})
|
|
3558
|
+
});
|
|
3559
|
+
}
|
|
3560
|
+
|
|
3561
|
+
// src/components/styled/ExportIndexPage.tsx
|
|
3562
|
+
import { cn as cn2 } from "@openpkg-ts/ui/lib/utils";
|
|
3563
|
+
import { Search } from "lucide-react";
|
|
3564
|
+
import { useMemo, useState } from "react";
|
|
3565
|
+
|
|
3566
|
+
// src/components/styled/ExportCard.tsx
|
|
3567
|
+
var import_link = __toESM(require_link(), 1);
|
|
3568
|
+
import { cn } from "@openpkg-ts/ui/lib/utils";
|
|
3569
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
3570
|
+
|
|
3571
|
+
var KIND_COLORS = {
|
|
3572
|
+
function: "group-hover:text-blue-600 dark:group-hover:text-blue-400",
|
|
3573
|
+
class: "group-hover:text-purple-600 dark:group-hover:text-purple-400",
|
|
3574
|
+
interface: "group-hover:text-green-600 dark:group-hover:text-green-400",
|
|
3575
|
+
type: "group-hover:text-amber-600 dark:group-hover:text-amber-400",
|
|
3576
|
+
enum: "group-hover:text-rose-600 dark:group-hover:text-rose-400",
|
|
3577
|
+
variable: "group-hover:text-cyan-600 dark:group-hover:text-cyan-400"
|
|
3578
|
+
};
|
|
3579
|
+
var KIND_BADGE_COLORS = {
|
|
3580
|
+
function: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
|
|
3581
|
+
class: "bg-purple-500/10 text-purple-600 dark:text-purple-400",
|
|
3582
|
+
interface: "bg-green-500/10 text-green-600 dark:text-green-400",
|
|
3583
|
+
type: "bg-amber-500/10 text-amber-600 dark:text-amber-400",
|
|
3584
|
+
enum: "bg-rose-500/10 text-rose-600 dark:text-rose-400",
|
|
3585
|
+
variable: "bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"
|
|
3586
|
+
};
|
|
3587
|
+
function ExportCard({
|
|
3588
|
+
name,
|
|
3589
|
+
description,
|
|
3590
|
+
href,
|
|
3591
|
+
kind = "function",
|
|
3592
|
+
className
|
|
3593
|
+
}) {
|
|
3594
|
+
const isFunction = kind === "function";
|
|
3595
|
+
const hoverColor = KIND_COLORS[kind];
|
|
3596
|
+
const badgeColor = KIND_BADGE_COLORS[kind];
|
|
3597
|
+
return /* @__PURE__ */ jsxs3(import_link.default, {
|
|
3598
|
+
href,
|
|
3599
|
+
className: cn("group block rounded-lg border border-border bg-card/50 p-4", "transition-all duration-200 ease-out", "hover:border-primary/30 hover:bg-card hover:shadow-lg hover:shadow-primary/5", "hover:-translate-y-1", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", className),
|
|
3600
|
+
children: [
|
|
3601
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
3602
|
+
className: "flex items-center gap-2 mb-2",
|
|
3603
|
+
children: [
|
|
3604
|
+
/* @__PURE__ */ jsx5("span", {
|
|
3605
|
+
className: cn("font-mono text-base font-medium text-foreground transition-colors duration-200", hoverColor),
|
|
3606
|
+
children: name
|
|
3607
|
+
}),
|
|
3608
|
+
isFunction && /* @__PURE__ */ jsx5("span", {
|
|
3609
|
+
className: "font-mono text-base text-muted-foreground",
|
|
3610
|
+
children: "()"
|
|
3611
|
+
}),
|
|
3612
|
+
/* @__PURE__ */ jsx5("span", {
|
|
3613
|
+
className: cn("ml-auto text-xs px-2 py-0.5 rounded-full font-medium", badgeColor),
|
|
3614
|
+
children: kind
|
|
3615
|
+
})
|
|
3616
|
+
]
|
|
3617
|
+
}),
|
|
3618
|
+
description && /* @__PURE__ */ jsx5("p", {
|
|
3619
|
+
className: "text-sm text-muted-foreground line-clamp-2 leading-relaxed group-hover:text-muted-foreground/80 transition-colors",
|
|
3620
|
+
children: description
|
|
3621
|
+
})
|
|
3622
|
+
]
|
|
3623
|
+
});
|
|
3624
|
+
}
|
|
3625
|
+
|
|
3626
|
+
// src/components/styled/ExportIndexPage.tsx
|
|
3627
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3628
|
+
|
|
3629
|
+
var KIND_ORDER = ["function", "class", "interface", "type", "enum", "variable"];
|
|
3630
|
+
var KIND_LABELS = {
|
|
3631
|
+
function: "Functions",
|
|
3632
|
+
class: "Classes",
|
|
3633
|
+
interface: "Interfaces",
|
|
3634
|
+
type: "Types",
|
|
3635
|
+
enum: "Enums",
|
|
3636
|
+
variable: "Variables"
|
|
3637
|
+
};
|
|
3638
|
+
var KIND_SLUGS = {
|
|
3639
|
+
function: "functions",
|
|
3640
|
+
class: "classes",
|
|
3641
|
+
interface: "interfaces",
|
|
3642
|
+
type: "types",
|
|
3643
|
+
enum: "enums",
|
|
3644
|
+
variable: "variables"
|
|
3645
|
+
};
|
|
3646
|
+
function groupByKind(exports) {
|
|
3647
|
+
const groups = new Map;
|
|
3648
|
+
for (const exp of exports) {
|
|
3649
|
+
const kind = exp.kind || "variable";
|
|
3650
|
+
const normalizedKind = KIND_ORDER.includes(kind) ? kind : "variable";
|
|
3651
|
+
const list = groups.get(normalizedKind) || [];
|
|
3652
|
+
list.push(exp);
|
|
3653
|
+
groups.set(normalizedKind, list);
|
|
3654
|
+
}
|
|
3655
|
+
return KIND_ORDER.filter((kind) => groups.has(kind)).map((kind) => ({
|
|
3656
|
+
kind,
|
|
3657
|
+
label: KIND_LABELS[kind],
|
|
3658
|
+
exports: groups.get(kind).sort((a, b) => a.name.localeCompare(b.name))
|
|
3659
|
+
}));
|
|
3660
|
+
}
|
|
3661
|
+
function ExportIndexPage({
|
|
3662
|
+
spec,
|
|
3663
|
+
baseHref,
|
|
3664
|
+
description,
|
|
3665
|
+
className,
|
|
3666
|
+
showSearch = true,
|
|
3667
|
+
showFilters = true
|
|
3668
|
+
}) {
|
|
3669
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
3670
|
+
const [activeFilter, setActiveFilter] = useState("all");
|
|
3671
|
+
if (false) {}
|
|
3672
|
+
const allGroups = useMemo(() => groupByKind(spec.exports), [spec.exports]);
|
|
3673
|
+
const filteredGroups = useMemo(() => {
|
|
3674
|
+
const query = searchQuery.toLowerCase().trim();
|
|
3675
|
+
return allGroups.filter((group) => activeFilter === "all" || group.kind === activeFilter).map((group) => ({
|
|
3676
|
+
...group,
|
|
3677
|
+
exports: group.exports.filter((exp) => {
|
|
3678
|
+
if (!query)
|
|
3679
|
+
return true;
|
|
3680
|
+
return exp.name.toLowerCase().includes(query) || exp.description?.toLowerCase().includes(query);
|
|
3681
|
+
})
|
|
3682
|
+
})).filter((group) => group.exports.length > 0);
|
|
3683
|
+
}, [allGroups, searchQuery, activeFilter]);
|
|
3684
|
+
const availableKinds = useMemo(() => allGroups.map((g) => g.kind), [allGroups]);
|
|
3685
|
+
const totalExports = filteredGroups.reduce((sum, g) => sum + g.exports.length, 0);
|
|
3686
|
+
return /* @__PURE__ */ jsxs4("div", {
|
|
3687
|
+
className: cn2("doccov-index-page space-y-8 not-prose", className),
|
|
3688
|
+
children: [
|
|
3689
|
+
/* @__PURE__ */ jsxs4("div", {
|
|
3690
|
+
children: [
|
|
3691
|
+
/* @__PURE__ */ jsx6("h1", {
|
|
3692
|
+
className: "text-3xl font-bold text-foreground mb-3",
|
|
3693
|
+
children: spec.meta.name || "API Reference"
|
|
3694
|
+
}),
|
|
3695
|
+
(description || spec.meta.description) && /* @__PURE__ */ jsx6("p", {
|
|
3696
|
+
className: "text-muted-foreground text-lg leading-relaxed max-w-3xl",
|
|
3697
|
+
children: description || spec.meta.description
|
|
3698
|
+
})
|
|
3699
|
+
]
|
|
3700
|
+
}),
|
|
3701
|
+
(showSearch || showFilters) && /* @__PURE__ */ jsxs4("div", {
|
|
3702
|
+
className: "space-y-4",
|
|
3703
|
+
children: [
|
|
3704
|
+
showSearch && /* @__PURE__ */ jsxs4("div", {
|
|
3705
|
+
className: "relative max-w-md",
|
|
3706
|
+
children: [
|
|
3707
|
+
/* @__PURE__ */ jsx6(Search, {
|
|
3708
|
+
size: 18,
|
|
3709
|
+
className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
3710
|
+
}),
|
|
3711
|
+
/* @__PURE__ */ jsx6("input", {
|
|
3712
|
+
type: "text",
|
|
3713
|
+
placeholder: "Search exports...",
|
|
3714
|
+
value: searchQuery,
|
|
3715
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
3716
|
+
className: cn2("w-full pl-10 pr-4 py-2 rounded-lg", "border border-border bg-background", "text-sm text-foreground placeholder:text-muted-foreground", "focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent", "transition-shadow")
|
|
3717
|
+
})
|
|
3718
|
+
]
|
|
3719
|
+
}),
|
|
3720
|
+
showFilters && availableKinds.length > 1 && /* @__PURE__ */ jsxs4("div", {
|
|
3721
|
+
className: "flex flex-wrap gap-2",
|
|
3722
|
+
children: [
|
|
3723
|
+
/* @__PURE__ */ jsx6("button", {
|
|
3724
|
+
type: "button",
|
|
3725
|
+
onClick: () => setActiveFilter("all"),
|
|
3726
|
+
className: cn2("px-3 py-1.5 text-sm rounded-md transition-all cursor-pointer", activeFilter === "all" ? "bg-primary text-primary-foreground font-medium" : "bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"),
|
|
3727
|
+
children: "All"
|
|
3728
|
+
}),
|
|
3729
|
+
availableKinds.map((kind) => /* @__PURE__ */ jsx6("button", {
|
|
3730
|
+
type: "button",
|
|
3731
|
+
onClick: () => setActiveFilter(kind),
|
|
3732
|
+
className: cn2("px-3 py-1.5 text-sm rounded-md transition-all cursor-pointer", activeFilter === kind ? "bg-primary text-primary-foreground font-medium" : "bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"),
|
|
3733
|
+
children: KIND_LABELS[kind]
|
|
3734
|
+
}, kind))
|
|
3735
|
+
]
|
|
3736
|
+
})
|
|
3737
|
+
]
|
|
3738
|
+
}),
|
|
3739
|
+
(searchQuery || activeFilter !== "all") && /* @__PURE__ */ jsxs4("p", {
|
|
3740
|
+
className: "text-sm text-muted-foreground",
|
|
3741
|
+
children: [
|
|
3742
|
+
totalExports,
|
|
3743
|
+
" ",
|
|
3744
|
+
totalExports === 1 ? "result" : "results",
|
|
3745
|
+
searchQuery && ` for "${searchQuery}"`
|
|
3746
|
+
]
|
|
3747
|
+
}),
|
|
3748
|
+
filteredGroups.map((group) => /* @__PURE__ */ jsxs4("section", {
|
|
3749
|
+
children: [
|
|
3750
|
+
/* @__PURE__ */ jsx6("h2", {
|
|
3751
|
+
className: "text-sm font-semibold uppercase tracking-wide text-muted-foreground mb-4",
|
|
3752
|
+
children: group.label
|
|
3753
|
+
}),
|
|
3754
|
+
/* @__PURE__ */ jsx6("div", {
|
|
3755
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
3756
|
+
children: group.exports.map((exp) => /* @__PURE__ */ jsx6(ExportCard, {
|
|
3757
|
+
name: exp.name,
|
|
3758
|
+
description: exp.description,
|
|
3759
|
+
href: `${baseHref}/${KIND_SLUGS[group.kind]}/${exp.id}`,
|
|
3760
|
+
kind: exp.kind
|
|
3761
|
+
}, exp.id))
|
|
3762
|
+
})
|
|
3763
|
+
]
|
|
3764
|
+
}, group.kind)),
|
|
3765
|
+
filteredGroups.length === 0 && /* @__PURE__ */ jsxs4("div", {
|
|
3766
|
+
className: "rounded-lg border border-border bg-card/50 p-8 text-center",
|
|
3767
|
+
children: [
|
|
3768
|
+
/* @__PURE__ */ jsx6("p", {
|
|
3769
|
+
className: "text-muted-foreground",
|
|
3770
|
+
children: searchQuery || activeFilter !== "all" ? "No exports match your search." : "No exports found in this package."
|
|
3771
|
+
}),
|
|
3772
|
+
(searchQuery || activeFilter !== "all") && /* @__PURE__ */ jsx6("button", {
|
|
3773
|
+
type: "button",
|
|
3774
|
+
onClick: () => {
|
|
3775
|
+
setSearchQuery("");
|
|
3776
|
+
setActiveFilter("all");
|
|
3777
|
+
},
|
|
3778
|
+
className: "mt-3 text-sm text-primary hover:underline cursor-pointer",
|
|
3779
|
+
children: "Clear filters"
|
|
3780
|
+
})
|
|
3781
|
+
]
|
|
3782
|
+
})
|
|
3783
|
+
]
|
|
3784
|
+
});
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3787
|
+
// src/components/styled/sections/FunctionSection.tsx
|
|
3788
|
+
import { APIParameterItem as APIParameterItem3, APISection as APISection3, ParameterList as ParameterList3, ResponseBlock } from "@openpkg-ts/ui/docskit";
|
|
3789
|
+
import { formatSchema as formatSchema3 } from "@openpkg-ts/sdk";
|
|
3790
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
3791
|
+
|
|
3792
|
+
function FunctionSection({ export: exp, spec }) {
|
|
3793
|
+
const sig = exp.signatures?.[0];
|
|
3794
|
+
const hasParams = sig?.parameters && sig.parameters.length > 0;
|
|
3795
|
+
const languages = getLanguagesFromExamples(exp.examples);
|
|
3796
|
+
const examples = specExamplesToCodeExamples(exp.examples);
|
|
3797
|
+
const importStatement = buildImportStatement(exp, spec);
|
|
3798
|
+
const displayExamples = examples.length > 0 ? examples : [
|
|
3799
|
+
{
|
|
3800
|
+
languageId: "typescript",
|
|
3801
|
+
code: `${importStatement}
|
|
3802
|
+
|
|
3803
|
+
// Usage
|
|
3804
|
+
${exp.name}(${sig?.parameters?.map((p) => p.name).join(", ") || ""})`,
|
|
3805
|
+
highlightLang: "ts"
|
|
3806
|
+
}
|
|
3807
|
+
];
|
|
3808
|
+
const displayLanguages = languages.length > 0 ? languages : [{ id: "typescript", label: "TypeScript" }];
|
|
3809
|
+
return /* @__PURE__ */ jsxs5(APISection3, {
|
|
3810
|
+
id: exp.id || exp.name,
|
|
3811
|
+
title: `${exp.name}()`,
|
|
3812
|
+
description: /* @__PURE__ */ jsxs5("div", {
|
|
3813
|
+
className: "space-y-3",
|
|
3814
|
+
children: [
|
|
3815
|
+
exp.description && /* @__PURE__ */ jsx7("p", {
|
|
3816
|
+
children: exp.description
|
|
3817
|
+
}),
|
|
3818
|
+
/* @__PURE__ */ jsx7("code", {
|
|
3819
|
+
className: "text-sm font-mono bg-muted px-2 py-1 rounded inline-block",
|
|
3820
|
+
children: importStatement
|
|
3821
|
+
})
|
|
3822
|
+
]
|
|
3823
|
+
}),
|
|
3824
|
+
languages: displayLanguages,
|
|
3825
|
+
examples: displayExamples,
|
|
3826
|
+
codePanelTitle: `${exp.name}()`,
|
|
3827
|
+
children: [
|
|
3828
|
+
hasParams && /* @__PURE__ */ jsx7(ParameterList3, {
|
|
3829
|
+
title: "Parameters",
|
|
3830
|
+
children: sig.parameters.map((param, index) => {
|
|
3831
|
+
const apiParam = specParamToAPIParam(param);
|
|
3832
|
+
return /* @__PURE__ */ jsx7(APIParameterItem3, {
|
|
3833
|
+
name: apiParam.name,
|
|
3834
|
+
type: apiParam.type,
|
|
3835
|
+
required: apiParam.required,
|
|
3836
|
+
description: apiParam.description,
|
|
3837
|
+
children: apiParam.children
|
|
3838
|
+
}, param.name ?? index);
|
|
3839
|
+
})
|
|
3840
|
+
}),
|
|
3841
|
+
sig?.returns && /* @__PURE__ */ jsx7(ResponseBlock, {
|
|
3842
|
+
description: /* @__PURE__ */ jsxs5("span", {
|
|
3843
|
+
children: [
|
|
3844
|
+
/* @__PURE__ */ jsx7("span", {
|
|
3845
|
+
className: "font-mono text-sm font-medium",
|
|
3846
|
+
children: formatSchema3(sig.returns.schema)
|
|
3847
|
+
}),
|
|
3848
|
+
sig.returns.description && /* @__PURE__ */ jsx7("span", {
|
|
3849
|
+
className: "ml-2 text-muted-foreground",
|
|
3850
|
+
children: sig.returns.description
|
|
3851
|
+
})
|
|
3852
|
+
]
|
|
3853
|
+
}),
|
|
3854
|
+
className: "mt-6"
|
|
3855
|
+
}),
|
|
3856
|
+
sig?.throws && sig.throws.length > 0 && /* @__PURE__ */ jsxs5("div", {
|
|
3857
|
+
className: "mt-6 rounded-md bg-destructive/10 border border-destructive/20 p-4",
|
|
3858
|
+
children: [
|
|
3859
|
+
/* @__PURE__ */ jsx7("h4", {
|
|
3860
|
+
className: "text-xs font-semibold uppercase tracking-wide text-destructive mb-2",
|
|
3861
|
+
children: "Throws"
|
|
3862
|
+
}),
|
|
3863
|
+
/* @__PURE__ */ jsx7("div", {
|
|
3864
|
+
className: "space-y-1",
|
|
3865
|
+
children: sig.throws.map((t, i) => /* @__PURE__ */ jsxs5("div", {
|
|
3866
|
+
className: "text-sm",
|
|
3867
|
+
children: [
|
|
3868
|
+
t.type && /* @__PURE__ */ jsx7("code", {
|
|
3869
|
+
className: "font-mono text-destructive",
|
|
3870
|
+
children: t.type
|
|
3871
|
+
}),
|
|
3872
|
+
t.type && t.description && /* @__PURE__ */ jsx7("span", {
|
|
3873
|
+
className: "mx-1",
|
|
3874
|
+
children: "—"
|
|
3875
|
+
}),
|
|
3876
|
+
t.description && /* @__PURE__ */ jsx7("span", {
|
|
3877
|
+
className: "text-muted-foreground",
|
|
3878
|
+
children: t.description
|
|
3879
|
+
})
|
|
3880
|
+
]
|
|
3881
|
+
}, i))
|
|
3882
|
+
})
|
|
3883
|
+
]
|
|
3884
|
+
}),
|
|
3885
|
+
exp.typeParameters && exp.typeParameters.length > 0 && /* @__PURE__ */ jsx7(ParameterList3, {
|
|
3886
|
+
title: "Type Parameters",
|
|
3887
|
+
className: "mt-6",
|
|
3888
|
+
children: exp.typeParameters.map((tp) => /* @__PURE__ */ jsx7(APIParameterItem3, {
|
|
3889
|
+
name: tp.name,
|
|
3890
|
+
type: tp.constraint || "unknown",
|
|
3891
|
+
description: tp.default ? `Default: ${tp.default}` : undefined
|
|
3892
|
+
}, tp.name))
|
|
3893
|
+
})
|
|
3894
|
+
]
|
|
3895
|
+
});
|
|
3896
|
+
}
|
|
3897
|
+
|
|
3898
|
+
// src/components/styled/FunctionPage.tsx
|
|
3899
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
3900
|
+
|
|
3901
|
+
function FunctionPage({ export: exp, spec }) {
|
|
3902
|
+
return /* @__PURE__ */ jsx8("div", {
|
|
3903
|
+
className: "doccov-function-page not-prose",
|
|
3904
|
+
children: /* @__PURE__ */ jsx8(FunctionSection, {
|
|
3905
|
+
export: exp,
|
|
3906
|
+
spec
|
|
3907
|
+
})
|
|
3908
|
+
});
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
// src/components/styled/sections/InterfaceSection.tsx
|
|
3912
|
+
import { APIParameterItem as APIParameterItem4, APISection as APISection4, ParameterList as ParameterList4 } from "@openpkg-ts/ui/docskit";
|
|
3913
|
+
import { formatSchema as formatSchema4 } from "@openpkg-ts/sdk";
|
|
3914
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3915
|
+
|
|
3916
|
+
function formatMethodSignature2(member) {
|
|
3917
|
+
const sig = member.signatures?.[0];
|
|
3918
|
+
const params = sig?.parameters ?? [];
|
|
3919
|
+
const returnType = formatSchema4(sig?.returns?.schema);
|
|
3920
|
+
const paramStr = params.map((p) => `${p.name}${p.required === false ? "?" : ""}: ${formatSchema4(p.schema)}`).join(", ");
|
|
3921
|
+
return `(${paramStr}): ${returnType}`;
|
|
3922
|
+
}
|
|
3923
|
+
function formatDecorators2(decorators) {
|
|
3924
|
+
if (!decorators?.length)
|
|
3925
|
+
return "";
|
|
3926
|
+
return decorators.map((d) => {
|
|
3927
|
+
const args = d.argumentsText?.length ? `(${d.argumentsText.join(", ")})` : "";
|
|
3928
|
+
return `@${d.name}${args}`;
|
|
3929
|
+
}).join(" ");
|
|
3930
|
+
}
|
|
3931
|
+
function buildMemberDescription2(member) {
|
|
3932
|
+
const parts = [];
|
|
3933
|
+
const decoratorsStr = formatDecorators2(member.decorators);
|
|
3934
|
+
if (decoratorsStr)
|
|
3935
|
+
parts.push(decoratorsStr);
|
|
3936
|
+
if (member.description)
|
|
3937
|
+
parts.push(member.description);
|
|
3938
|
+
return parts.length > 0 ? parts.join(" • ") : undefined;
|
|
3939
|
+
}
|
|
3940
|
+
function InterfaceSection({ export: exp, spec }) {
|
|
3941
|
+
const properties = exp.members?.filter((m) => m.kind === "property" || m.kind === "field" || !m.kind) ?? [];
|
|
3942
|
+
const methods = exp.members?.filter((m) => m.kind === "method" || m.kind === "function") ?? [];
|
|
3943
|
+
const languages = getLanguagesFromExamples(exp.examples);
|
|
3944
|
+
const examples = specExamplesToCodeExamples(exp.examples);
|
|
3945
|
+
const importStatement = buildImportStatement(exp, spec);
|
|
3946
|
+
const typeDefinition = properties.length > 0 ? `${exp.kind === "type" ? "type" : "interface"} ${exp.name} {
|
|
3947
|
+
${properties.map((p) => ` ${p.name}${p.required === false ? "?" : ""}: ${formatSchema4(p.schema)};`).join(`
|
|
3948
|
+
`)}
|
|
3949
|
+
}` : `${exp.kind === "type" ? "type" : "interface"} ${exp.name} { }`;
|
|
3950
|
+
const displayExamples = examples.length > 0 ? examples : [
|
|
3951
|
+
{
|
|
3952
|
+
languageId: "typescript",
|
|
3953
|
+
code: `${importStatement}
|
|
3954
|
+
|
|
3955
|
+
${typeDefinition}`,
|
|
3956
|
+
highlightLang: "ts"
|
|
3957
|
+
}
|
|
3958
|
+
];
|
|
3959
|
+
const displayLanguages = languages.length > 0 ? languages : [{ id: "typescript", label: "TypeScript" }];
|
|
3960
|
+
const kindLabel = exp.kind === "type" ? "type" : "interface";
|
|
3961
|
+
return /* @__PURE__ */ jsxs6(APISection4, {
|
|
3962
|
+
id: exp.id || exp.name,
|
|
3963
|
+
title: `${kindLabel} ${exp.name}`,
|
|
3964
|
+
description: /* @__PURE__ */ jsxs6("div", {
|
|
3965
|
+
className: "space-y-3",
|
|
3966
|
+
children: [
|
|
3967
|
+
exp.extends && /* @__PURE__ */ jsxs6("p", {
|
|
3968
|
+
className: "font-mono text-sm text-muted-foreground",
|
|
3969
|
+
children: [
|
|
3970
|
+
"extends ",
|
|
3971
|
+
exp.extends
|
|
3972
|
+
]
|
|
3973
|
+
}),
|
|
3974
|
+
exp.description && /* @__PURE__ */ jsx9("p", {
|
|
3975
|
+
children: exp.description
|
|
3976
|
+
}),
|
|
3977
|
+
exp.deprecated && /* @__PURE__ */ jsxs6("div", {
|
|
3978
|
+
className: "rounded-md bg-yellow-500/10 border border-yellow-500/20 px-3 py-2 text-sm text-yellow-600 dark:text-yellow-400",
|
|
3979
|
+
children: [
|
|
3980
|
+
/* @__PURE__ */ jsx9("strong", {
|
|
3981
|
+
children: "Deprecated:"
|
|
3982
|
+
}),
|
|
3983
|
+
" This export is deprecated."
|
|
3984
|
+
]
|
|
3985
|
+
}),
|
|
3986
|
+
/* @__PURE__ */ jsx9("code", {
|
|
3987
|
+
className: "text-sm font-mono bg-muted px-2 py-1 rounded inline-block",
|
|
3988
|
+
children: importStatement
|
|
3989
|
+
})
|
|
3990
|
+
]
|
|
3991
|
+
}),
|
|
3992
|
+
languages: displayLanguages,
|
|
3993
|
+
examples: displayExamples,
|
|
3994
|
+
codePanelTitle: exp.name,
|
|
3995
|
+
children: [
|
|
3996
|
+
properties.length > 0 && /* @__PURE__ */ jsx9(ParameterList4, {
|
|
3997
|
+
title: "Properties",
|
|
3998
|
+
children: properties.map((prop, index) => {
|
|
3999
|
+
const type = formatSchema4(prop.schema);
|
|
4000
|
+
const children = specSchemaToAPISchema(prop.schema);
|
|
4001
|
+
const hasNestedProperties = children?.properties && Object.keys(children.properties).length > 0;
|
|
4002
|
+
return /* @__PURE__ */ jsx9(APIParameterItem4, {
|
|
4003
|
+
name: prop.name,
|
|
4004
|
+
type,
|
|
4005
|
+
description: buildMemberDescription2(prop),
|
|
4006
|
+
children: hasNestedProperties ? children : undefined
|
|
4007
|
+
}, prop.name ?? index);
|
|
4008
|
+
})
|
|
4009
|
+
}),
|
|
4010
|
+
methods.length > 0 && /* @__PURE__ */ jsx9(ParameterList4, {
|
|
4011
|
+
title: "Methods",
|
|
4012
|
+
className: "mt-6",
|
|
4013
|
+
children: methods.map((method, index) => /* @__PURE__ */ jsx9(APIParameterItem4, {
|
|
4014
|
+
name: `${method.name}()`,
|
|
4015
|
+
type: formatMethodSignature2(method),
|
|
4016
|
+
description: buildMemberDescription2(method)
|
|
4017
|
+
}, method.name ?? index))
|
|
4018
|
+
})
|
|
4019
|
+
]
|
|
4020
|
+
});
|
|
4021
|
+
}
|
|
4022
|
+
|
|
4023
|
+
// src/components/styled/InterfacePage.tsx
|
|
4024
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
4025
|
+
|
|
4026
|
+
function InterfacePage({ export: exp, spec }) {
|
|
4027
|
+
return /* @__PURE__ */ jsx10("div", {
|
|
4028
|
+
className: "doccov-interface-page not-prose",
|
|
4029
|
+
children: /* @__PURE__ */ jsx10(InterfaceSection, {
|
|
4030
|
+
export: exp,
|
|
4031
|
+
spec
|
|
4032
|
+
})
|
|
4033
|
+
});
|
|
4034
|
+
}
|
|
4035
|
+
|
|
4036
|
+
// src/components/styled/sections/VariableSection.tsx
|
|
4037
|
+
import { APIParameterItem as APIParameterItem5, APISection as APISection5, ParameterList as ParameterList5 } from "@openpkg-ts/ui/docskit";
|
|
4038
|
+
import { formatSchema as formatSchema5 } from "@openpkg-ts/sdk";
|
|
4039
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4040
|
+
|
|
4041
|
+
function VariableSection({ export: exp, spec }) {
|
|
4042
|
+
const typeValue = typeof exp.type === "string" ? exp.type : formatSchema5(exp.schema);
|
|
4043
|
+
const languages = getLanguagesFromExamples(exp.examples);
|
|
4044
|
+
const examples = specExamplesToCodeExamples(exp.examples);
|
|
4045
|
+
const importStatement = buildImportStatement(exp, spec);
|
|
4046
|
+
const constValue = exp.schema && typeof exp.schema === "object" ? exp.schema.const : undefined;
|
|
4047
|
+
const displayExamples = examples.length > 0 ? examples : [
|
|
4048
|
+
{
|
|
4049
|
+
languageId: "typescript",
|
|
4050
|
+
code: `${importStatement}
|
|
4051
|
+
|
|
4052
|
+
console.log(${exp.name}); // ${constValue !== undefined ? JSON.stringify(constValue) : typeValue}`,
|
|
4053
|
+
highlightLang: "ts"
|
|
4054
|
+
}
|
|
4055
|
+
];
|
|
4056
|
+
const displayLanguages = languages.length > 0 ? languages : [{ id: "typescript", label: "TypeScript" }];
|
|
4057
|
+
return /* @__PURE__ */ jsx11(APISection5, {
|
|
4058
|
+
id: exp.id || exp.name,
|
|
4059
|
+
title: `const ${exp.name}`,
|
|
4060
|
+
description: /* @__PURE__ */ jsxs7("div", {
|
|
4061
|
+
className: "space-y-3",
|
|
4062
|
+
children: [
|
|
4063
|
+
exp.description && /* @__PURE__ */ jsx11("p", {
|
|
4064
|
+
children: exp.description
|
|
4065
|
+
}),
|
|
4066
|
+
exp.deprecated && /* @__PURE__ */ jsxs7("div", {
|
|
4067
|
+
className: "rounded-md bg-yellow-500/10 border border-yellow-500/20 px-3 py-2 text-sm text-yellow-600 dark:text-yellow-400",
|
|
4068
|
+
children: [
|
|
4069
|
+
/* @__PURE__ */ jsx11("strong", {
|
|
4070
|
+
children: "Deprecated:"
|
|
4071
|
+
}),
|
|
4072
|
+
" This export is deprecated."
|
|
4073
|
+
]
|
|
4074
|
+
}),
|
|
4075
|
+
/* @__PURE__ */ jsx11("code", {
|
|
4076
|
+
className: "text-sm font-mono bg-muted px-2 py-1 rounded inline-block",
|
|
4077
|
+
children: importStatement
|
|
4078
|
+
})
|
|
4079
|
+
]
|
|
4080
|
+
}),
|
|
4081
|
+
languages: displayLanguages,
|
|
4082
|
+
examples: displayExamples,
|
|
4083
|
+
codePanelTitle: exp.name,
|
|
4084
|
+
children: /* @__PURE__ */ jsx11(ParameterList5, {
|
|
4085
|
+
title: "Type",
|
|
4086
|
+
children: /* @__PURE__ */ jsx11(APIParameterItem5, {
|
|
4087
|
+
name: exp.name,
|
|
4088
|
+
type: typeValue,
|
|
4089
|
+
description: constValue !== undefined ? `Value: ${JSON.stringify(constValue)}` : undefined
|
|
4090
|
+
})
|
|
4091
|
+
})
|
|
4092
|
+
});
|
|
4093
|
+
}
|
|
4094
|
+
|
|
4095
|
+
// src/components/styled/VariablePage.tsx
|
|
4096
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
4097
|
+
|
|
4098
|
+
function VariablePage({ export: exp, spec }) {
|
|
4099
|
+
return /* @__PURE__ */ jsx12("div", {
|
|
4100
|
+
className: "doccov-variable-page not-prose",
|
|
4101
|
+
children: /* @__PURE__ */ jsx12(VariableSection, {
|
|
4102
|
+
export: exp,
|
|
4103
|
+
spec
|
|
4104
|
+
})
|
|
4105
|
+
});
|
|
4106
|
+
}
|
|
4107
|
+
|
|
4108
|
+
// src/components/styled/APIPage.tsx
|
|
4109
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
4110
|
+
|
|
4111
|
+
function NotFound({ id }) {
|
|
4112
|
+
return /* @__PURE__ */ jsx13("div", {
|
|
4113
|
+
className: "rounded-lg border border-border bg-card p-6 text-center",
|
|
4114
|
+
children: /* @__PURE__ */ jsxs8("p", {
|
|
4115
|
+
className: "text-muted-foreground",
|
|
4116
|
+
children: [
|
|
4117
|
+
"Export ",
|
|
4118
|
+
/* @__PURE__ */ jsx13("code", {
|
|
4119
|
+
className: "font-mono text-primary",
|
|
4120
|
+
children: id
|
|
4121
|
+
}),
|
|
4122
|
+
" not found in spec."
|
|
4123
|
+
]
|
|
4124
|
+
})
|
|
4125
|
+
});
|
|
4126
|
+
}
|
|
4127
|
+
function NoSpec() {
|
|
4128
|
+
return /* @__PURE__ */ jsx13("div", {
|
|
4129
|
+
className: "rounded-lg border border-red-500/20 bg-red-500/10 p-6 text-center",
|
|
4130
|
+
children: /* @__PURE__ */ jsxs8("p", {
|
|
4131
|
+
className: "text-red-600 dark:text-red-400",
|
|
4132
|
+
children: [
|
|
4133
|
+
"No spec provided. Pass either ",
|
|
4134
|
+
/* @__PURE__ */ jsx13("code", {
|
|
4135
|
+
children: "spec"
|
|
4136
|
+
}),
|
|
4137
|
+
" or ",
|
|
4138
|
+
/* @__PURE__ */ jsx13("code", {
|
|
4139
|
+
children: "instance"
|
|
4140
|
+
}),
|
|
4141
|
+
" prop."
|
|
4142
|
+
]
|
|
4143
|
+
})
|
|
4144
|
+
});
|
|
4145
|
+
}
|
|
4146
|
+
function APIPage({
|
|
4147
|
+
spec,
|
|
4148
|
+
instance,
|
|
4149
|
+
id,
|
|
4150
|
+
baseHref = "",
|
|
4151
|
+
description,
|
|
4152
|
+
renderExample
|
|
4153
|
+
}) {
|
|
4154
|
+
const resolvedSpec = spec ?? instance?.spec;
|
|
4155
|
+
if (!resolvedSpec) {
|
|
4156
|
+
return /* @__PURE__ */ jsx13(NoSpec, {});
|
|
4157
|
+
}
|
|
4158
|
+
if (!id) {
|
|
4159
|
+
return /* @__PURE__ */ jsx13(ExportIndexPage, {
|
|
4160
|
+
spec: resolvedSpec,
|
|
4161
|
+
baseHref,
|
|
4162
|
+
description
|
|
4163
|
+
});
|
|
4164
|
+
}
|
|
4165
|
+
const exp = resolvedSpec.exports.find((e) => e.id === id);
|
|
4166
|
+
if (!exp) {
|
|
4167
|
+
return /* @__PURE__ */ jsx13(NotFound, {
|
|
4168
|
+
id
|
|
4169
|
+
});
|
|
4170
|
+
}
|
|
4171
|
+
const pageProps = { export: exp, spec: resolvedSpec, renderExample };
|
|
4172
|
+
switch (exp.kind) {
|
|
4173
|
+
case "function":
|
|
4174
|
+
return /* @__PURE__ */ jsx13(FunctionPage, {
|
|
4175
|
+
...pageProps
|
|
4176
|
+
});
|
|
4177
|
+
case "class":
|
|
4178
|
+
return /* @__PURE__ */ jsx13(ClassPage, {
|
|
4179
|
+
...pageProps
|
|
4180
|
+
});
|
|
4181
|
+
case "interface":
|
|
4182
|
+
case "type":
|
|
4183
|
+
return /* @__PURE__ */ jsx13(InterfacePage, {
|
|
4184
|
+
...pageProps
|
|
4185
|
+
});
|
|
4186
|
+
case "enum":
|
|
4187
|
+
return /* @__PURE__ */ jsx13(EnumPage, {
|
|
4188
|
+
...pageProps
|
|
4189
|
+
});
|
|
4190
|
+
default:
|
|
4191
|
+
return /* @__PURE__ */ jsx13(VariablePage, {
|
|
4192
|
+
...pageProps
|
|
4193
|
+
});
|
|
4194
|
+
}
|
|
4195
|
+
}
|
|
4196
|
+
// src/components/styled/FullAPIReferencePage.tsx
|
|
4197
|
+
import { APIReferencePage } from "@openpkg-ts/ui/docskit";
|
|
4198
|
+
import { cn as cn3 } from "@openpkg-ts/ui/lib/utils";
|
|
4199
|
+
import { useCallback, useEffect, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
4200
|
+
|
|
4201
|
+
// src/components/styled/sections/ExportSection.tsx
|
|
4202
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
4203
|
+
|
|
4204
|
+
function ExportSection({ export: exp, spec }) {
|
|
4205
|
+
const props = { export: exp, spec };
|
|
4206
|
+
switch (exp.kind) {
|
|
4207
|
+
case "function":
|
|
4208
|
+
return /* @__PURE__ */ jsx14(FunctionSection, {
|
|
4209
|
+
...props
|
|
4210
|
+
});
|
|
4211
|
+
case "class":
|
|
4212
|
+
return /* @__PURE__ */ jsx14(ClassSection, {
|
|
4213
|
+
...props
|
|
4214
|
+
});
|
|
4215
|
+
case "interface":
|
|
4216
|
+
case "type":
|
|
4217
|
+
return /* @__PURE__ */ jsx14(InterfaceSection, {
|
|
4218
|
+
...props
|
|
4219
|
+
});
|
|
4220
|
+
case "enum":
|
|
4221
|
+
return /* @__PURE__ */ jsx14(EnumSection, {
|
|
4222
|
+
...props
|
|
4223
|
+
});
|
|
4224
|
+
default:
|
|
4225
|
+
return /* @__PURE__ */ jsx14(VariableSection, {
|
|
4226
|
+
...props
|
|
4227
|
+
});
|
|
4228
|
+
}
|
|
4229
|
+
}
|
|
4230
|
+
|
|
4231
|
+
// src/components/styled/FullAPIReferencePage.tsx
|
|
4232
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
4233
|
+
|
|
4234
|
+
var KIND_ORDER2 = ["function", "class", "interface", "type", "enum", "variable"];
|
|
4235
|
+
var KIND_LABELS2 = {
|
|
4236
|
+
function: "Functions",
|
|
4237
|
+
class: "Classes",
|
|
4238
|
+
interface: "Interfaces",
|
|
4239
|
+
type: "Types",
|
|
4240
|
+
enum: "Enums",
|
|
4241
|
+
variable: "Variables"
|
|
4242
|
+
};
|
|
4243
|
+
function getExportTitle(exp) {
|
|
4244
|
+
switch (exp.kind) {
|
|
4245
|
+
case "function":
|
|
4246
|
+
return `${exp.name}()`;
|
|
4247
|
+
case "class":
|
|
4248
|
+
return `class ${exp.name}`;
|
|
4249
|
+
case "interface":
|
|
4250
|
+
case "type":
|
|
4251
|
+
return exp.name;
|
|
4252
|
+
case "enum":
|
|
4253
|
+
return `enum ${exp.name}`;
|
|
4254
|
+
default:
|
|
4255
|
+
return exp.name;
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
function FullAPIReferencePage({
|
|
4259
|
+
spec,
|
|
4260
|
+
kinds,
|
|
4261
|
+
showFilters = true,
|
|
4262
|
+
showTOC = false,
|
|
4263
|
+
title,
|
|
4264
|
+
description,
|
|
4265
|
+
className
|
|
4266
|
+
}) {
|
|
4267
|
+
const [activeFilter, setActiveFilter] = useState2("all");
|
|
4268
|
+
const [activeSection, setActiveSection] = useState2(null);
|
|
4269
|
+
const isScrollingRef = useRef(false);
|
|
4270
|
+
const availableKinds = useMemo2(() => {
|
|
4271
|
+
const kindSet = new Set;
|
|
4272
|
+
for (const exp of spec.exports) {
|
|
4273
|
+
const kind = exp.kind;
|
|
4274
|
+
if (KIND_ORDER2.includes(kind)) {
|
|
4275
|
+
kindSet.add(kind);
|
|
4276
|
+
}
|
|
4277
|
+
}
|
|
4278
|
+
return KIND_ORDER2.filter((k) => kindSet.has(k));
|
|
4279
|
+
}, [spec.exports]);
|
|
4280
|
+
const filteredExports = useMemo2(() => {
|
|
4281
|
+
let exports = spec.exports;
|
|
4282
|
+
if (kinds?.length) {
|
|
4283
|
+
exports = exports.filter((e) => kinds.includes(e.kind));
|
|
4284
|
+
}
|
|
4285
|
+
if (activeFilter !== "all") {
|
|
4286
|
+
exports = exports.filter((e) => e.kind === activeFilter);
|
|
4287
|
+
}
|
|
4288
|
+
return exports.sort((a, b) => {
|
|
4289
|
+
const kindOrderA = KIND_ORDER2.indexOf(a.kind);
|
|
4290
|
+
const kindOrderB = KIND_ORDER2.indexOf(b.kind);
|
|
4291
|
+
if (kindOrderA !== kindOrderB) {
|
|
4292
|
+
return kindOrderA - kindOrderB;
|
|
4293
|
+
}
|
|
4294
|
+
return a.name.localeCompare(b.name);
|
|
4295
|
+
});
|
|
4296
|
+
}, [spec.exports, kinds, activeFilter]);
|
|
4297
|
+
const groupedExports = useMemo2(() => {
|
|
4298
|
+
const groups = new Map;
|
|
4299
|
+
for (const exp of filteredExports) {
|
|
4300
|
+
const kind = exp.kind;
|
|
4301
|
+
if (!groups.has(kind)) {
|
|
4302
|
+
groups.set(kind, []);
|
|
4303
|
+
}
|
|
4304
|
+
groups.get(kind).push(exp);
|
|
4305
|
+
}
|
|
4306
|
+
return groups;
|
|
4307
|
+
}, [filteredExports]);
|
|
4308
|
+
useEffect(() => {
|
|
4309
|
+
if (typeof window === "undefined")
|
|
4310
|
+
return;
|
|
4311
|
+
const hash = window.location.hash.slice(1);
|
|
4312
|
+
if (hash) {
|
|
4313
|
+
const timer = setTimeout(() => {
|
|
4314
|
+
const element = document.getElementById(hash);
|
|
4315
|
+
if (element) {
|
|
4316
|
+
isScrollingRef.current = true;
|
|
4317
|
+
element.scrollIntoView({ behavior: "smooth" });
|
|
4318
|
+
setActiveSection(hash);
|
|
4319
|
+
setTimeout(() => {
|
|
4320
|
+
isScrollingRef.current = false;
|
|
4321
|
+
}, 1000);
|
|
4322
|
+
}
|
|
4323
|
+
}, 100);
|
|
4324
|
+
return () => clearTimeout(timer);
|
|
4325
|
+
}
|
|
4326
|
+
}, []);
|
|
4327
|
+
useEffect(() => {
|
|
4328
|
+
if (!showTOC || typeof window === "undefined")
|
|
4329
|
+
return;
|
|
4330
|
+
const sectionIds = filteredExports.map((exp) => exp.id || exp.name);
|
|
4331
|
+
const _observers = [];
|
|
4332
|
+
const handleIntersect = (entries) => {
|
|
4333
|
+
if (isScrollingRef.current)
|
|
4334
|
+
return;
|
|
4335
|
+
for (const entry of entries) {
|
|
4336
|
+
if (entry.isIntersecting && entry.intersectionRatio > 0) {
|
|
4337
|
+
const id = entry.target.id;
|
|
4338
|
+
setActiveSection(id);
|
|
4339
|
+
if (typeof window !== "undefined") {
|
|
4340
|
+
window.history.replaceState(null, "", `#${id}`);
|
|
4341
|
+
}
|
|
4342
|
+
break;
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
};
|
|
4346
|
+
const observer = new IntersectionObserver(handleIntersect, {
|
|
4347
|
+
rootMargin: "-20% 0px -70% 0px",
|
|
4348
|
+
threshold: 0
|
|
4349
|
+
});
|
|
4350
|
+
for (const id of sectionIds) {
|
|
4351
|
+
const element = document.getElementById(id);
|
|
4352
|
+
if (element) {
|
|
4353
|
+
observer.observe(element);
|
|
4354
|
+
}
|
|
4355
|
+
}
|
|
4356
|
+
return () => {
|
|
4357
|
+
observer.disconnect();
|
|
4358
|
+
};
|
|
4359
|
+
}, [showTOC, filteredExports]);
|
|
4360
|
+
const handleTOCClick = useCallback((id) => {
|
|
4361
|
+
const element = document.getElementById(id);
|
|
4362
|
+
if (element) {
|
|
4363
|
+
isScrollingRef.current = true;
|
|
4364
|
+
element.scrollIntoView({ behavior: "smooth" });
|
|
4365
|
+
setActiveSection(id);
|
|
4366
|
+
window.history.replaceState(null, "", `#${id}`);
|
|
4367
|
+
setTimeout(() => {
|
|
4368
|
+
isScrollingRef.current = false;
|
|
4369
|
+
}, 1000);
|
|
4370
|
+
}
|
|
4371
|
+
}, []);
|
|
4372
|
+
const defaultDescription = /* @__PURE__ */ jsxs9("div", {
|
|
4373
|
+
children: [
|
|
4374
|
+
spec.meta.description && /* @__PURE__ */ jsx15("p", {
|
|
4375
|
+
children: spec.meta.description
|
|
4376
|
+
}),
|
|
4377
|
+
spec.meta.version && /* @__PURE__ */ jsxs9("p", {
|
|
4378
|
+
className: "text-sm text-muted-foreground mt-2",
|
|
4379
|
+
children: [
|
|
4380
|
+
"Version ",
|
|
4381
|
+
spec.meta.version
|
|
4382
|
+
]
|
|
4383
|
+
})
|
|
4384
|
+
]
|
|
4385
|
+
});
|
|
4386
|
+
const shouldShowFilters = showFilters && !kinds?.length && availableKinds.length > 1;
|
|
4387
|
+
return /* @__PURE__ */ jsxs9("div", {
|
|
4388
|
+
className: cn3("doccov-full-reference-page not-prose", showTOC && "lg:grid lg:grid-cols-[220px_1fr] lg:gap-8", className),
|
|
4389
|
+
children: [
|
|
4390
|
+
showTOC && /* @__PURE__ */ jsx15("aside", {
|
|
4391
|
+
className: "hidden lg:block",
|
|
4392
|
+
children: /* @__PURE__ */ jsxs9("nav", {
|
|
4393
|
+
className: "sticky top-20 max-h-[calc(100vh-6rem)] overflow-y-auto pr-4",
|
|
4394
|
+
children: [
|
|
4395
|
+
/* @__PURE__ */ jsx15("h4", {
|
|
4396
|
+
className: "text-sm font-semibold text-foreground mb-3",
|
|
4397
|
+
children: "On this page"
|
|
4398
|
+
}),
|
|
4399
|
+
/* @__PURE__ */ jsx15("div", {
|
|
4400
|
+
className: "space-y-4",
|
|
4401
|
+
children: KIND_ORDER2.map((kind) => {
|
|
4402
|
+
const exports = groupedExports.get(kind);
|
|
4403
|
+
if (!exports?.length)
|
|
4404
|
+
return null;
|
|
4405
|
+
return /* @__PURE__ */ jsxs9("div", {
|
|
4406
|
+
children: [
|
|
4407
|
+
/* @__PURE__ */ jsx15("h5", {
|
|
4408
|
+
className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",
|
|
4409
|
+
children: KIND_LABELS2[kind]
|
|
4410
|
+
}),
|
|
4411
|
+
/* @__PURE__ */ jsx15("ul", {
|
|
4412
|
+
className: "space-y-1",
|
|
4413
|
+
children: exports.map((exp) => {
|
|
4414
|
+
const id = exp.id || exp.name;
|
|
4415
|
+
const isActive = activeSection === id;
|
|
4416
|
+
return /* @__PURE__ */ jsx15("li", {
|
|
4417
|
+
children: /* @__PURE__ */ jsx15("button", {
|
|
4418
|
+
type: "button",
|
|
4419
|
+
onClick: () => handleTOCClick(id),
|
|
4420
|
+
className: cn3("block w-full text-left text-sm py-1 px-2 rounded-md transition-colors cursor-pointer truncate", isActive ? "bg-primary/10 text-primary font-medium" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"),
|
|
4421
|
+
title: getExportTitle(exp),
|
|
4422
|
+
children: getExportTitle(exp)
|
|
4423
|
+
})
|
|
4424
|
+
}, id);
|
|
4425
|
+
})
|
|
4426
|
+
})
|
|
4427
|
+
]
|
|
4428
|
+
}, kind);
|
|
4429
|
+
})
|
|
4430
|
+
})
|
|
4431
|
+
]
|
|
4432
|
+
})
|
|
4433
|
+
}),
|
|
4434
|
+
/* @__PURE__ */ jsx15("div", {
|
|
4435
|
+
children: /* @__PURE__ */ jsxs9(APIReferencePage, {
|
|
4436
|
+
title: title || spec.meta.name || "API Reference",
|
|
4437
|
+
description: description || defaultDescription,
|
|
4438
|
+
children: [
|
|
4439
|
+
shouldShowFilters && /* @__PURE__ */ jsxs9("div", {
|
|
4440
|
+
className: "flex flex-wrap gap-2 mb-8 -mt-4",
|
|
4441
|
+
children: [
|
|
4442
|
+
/* @__PURE__ */ jsx15("button", {
|
|
4443
|
+
type: "button",
|
|
4444
|
+
onClick: () => setActiveFilter("all"),
|
|
4445
|
+
className: cn3("px-3 py-1.5 text-sm rounded-md transition-all cursor-pointer", activeFilter === "all" ? "bg-primary text-primary-foreground font-medium" : "bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"),
|
|
4446
|
+
children: "All"
|
|
4447
|
+
}),
|
|
4448
|
+
availableKinds.map((kind) => /* @__PURE__ */ jsx15("button", {
|
|
4449
|
+
type: "button",
|
|
4450
|
+
onClick: () => setActiveFilter(kind),
|
|
4451
|
+
className: cn3("px-3 py-1.5 text-sm rounded-md transition-all cursor-pointer", activeFilter === kind ? "bg-primary text-primary-foreground font-medium" : "bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"),
|
|
4452
|
+
children: KIND_LABELS2[kind]
|
|
4453
|
+
}, kind))
|
|
4454
|
+
]
|
|
4455
|
+
}),
|
|
4456
|
+
filteredExports.map((exp) => /* @__PURE__ */ jsx15(ExportSection, {
|
|
4457
|
+
export: exp,
|
|
4458
|
+
spec
|
|
4459
|
+
}, exp.id || exp.name)),
|
|
4460
|
+
filteredExports.length === 0 && /* @__PURE__ */ jsxs9("div", {
|
|
4461
|
+
className: "rounded-lg border border-border bg-card/50 p-8 text-center",
|
|
4462
|
+
children: [
|
|
4463
|
+
/* @__PURE__ */ jsx15("p", {
|
|
4464
|
+
className: "text-muted-foreground",
|
|
4465
|
+
children: activeFilter !== "all" ? `No ${KIND_LABELS2[activeFilter].toLowerCase()} found.` : "No exports found in this package."
|
|
4466
|
+
}),
|
|
4467
|
+
activeFilter !== "all" && /* @__PURE__ */ jsx15("button", {
|
|
4468
|
+
type: "button",
|
|
4469
|
+
onClick: () => setActiveFilter("all"),
|
|
4470
|
+
className: "mt-3 text-sm text-primary hover:underline cursor-pointer",
|
|
4471
|
+
children: "Show all exports"
|
|
4472
|
+
})
|
|
4473
|
+
]
|
|
4474
|
+
})
|
|
4475
|
+
]
|
|
4476
|
+
})
|
|
4477
|
+
})
|
|
4478
|
+
]
|
|
4479
|
+
});
|
|
4480
|
+
}
|
|
4481
|
+
// src/components/styled/ParameterItem.tsx
|
|
4482
|
+
import { cn as cn4 } from "@openpkg-ts/ui/lib/utils";
|
|
4483
|
+
import { ChevronRight } from "lucide-react";
|
|
4484
|
+
import { useState as useState3 } from "react";
|
|
4485
|
+
import { formatSchema as formatSchema6 } from "@openpkg-ts/sdk";
|
|
4486
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
4487
|
+
|
|
4488
|
+
function getNestedProperties(schema) {
|
|
4489
|
+
if (!schema || typeof schema !== "object")
|
|
4490
|
+
return null;
|
|
4491
|
+
const s = schema;
|
|
4492
|
+
if (s.type === "object" && s.properties && typeof s.properties === "object") {
|
|
4493
|
+
return s.properties;
|
|
4494
|
+
}
|
|
4495
|
+
return null;
|
|
4496
|
+
}
|
|
4497
|
+
function getRequiredFields(schema) {
|
|
4498
|
+
if (!schema || typeof schema !== "object")
|
|
4499
|
+
return [];
|
|
4500
|
+
const s = schema;
|
|
4501
|
+
if (Array.isArray(s.required)) {
|
|
4502
|
+
return s.required;
|
|
4503
|
+
}
|
|
4504
|
+
return [];
|
|
4505
|
+
}
|
|
4506
|
+
function countProperties(schema) {
|
|
4507
|
+
const props = getNestedProperties(schema);
|
|
4508
|
+
return props ? Object.keys(props).length : 0;
|
|
4509
|
+
}
|
|
4510
|
+
function NestedPropertyItem({
|
|
4511
|
+
name,
|
|
4512
|
+
schema,
|
|
4513
|
+
required = false,
|
|
4514
|
+
depth = 0
|
|
4515
|
+
}) {
|
|
4516
|
+
const [expanded, setExpanded] = useState3(false);
|
|
4517
|
+
const type = formatSchema6(schema);
|
|
4518
|
+
const nestedProps = getNestedProperties(schema);
|
|
4519
|
+
const nestedCount = countProperties(schema);
|
|
4520
|
+
const hasNested = nestedCount > 0;
|
|
4521
|
+
const schemaObj = schema;
|
|
4522
|
+
const description = schemaObj?.description;
|
|
4523
|
+
return /* @__PURE__ */ jsxs10("div", {
|
|
4524
|
+
className: cn4("border-t border-border first:border-t-0", depth > 0 && "ml-4"),
|
|
4525
|
+
children: [
|
|
4526
|
+
/* @__PURE__ */ jsx16("div", {
|
|
4527
|
+
className: "py-3",
|
|
4528
|
+
children: /* @__PURE__ */ jsxs10("div", {
|
|
4529
|
+
className: "flex items-start gap-2",
|
|
4530
|
+
children: [
|
|
4531
|
+
hasNested && /* @__PURE__ */ jsx16("button", {
|
|
4532
|
+
type: "button",
|
|
4533
|
+
onClick: () => setExpanded(!expanded),
|
|
4534
|
+
className: "mt-0.5 p-0.5 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
4535
|
+
"aria-label": expanded ? "Collapse" : "Expand",
|
|
4536
|
+
children: /* @__PURE__ */ jsx16(ChevronRight, {
|
|
4537
|
+
size: 14,
|
|
4538
|
+
className: cn4("transition-transform duration-200", expanded && "rotate-90")
|
|
4539
|
+
})
|
|
4540
|
+
}),
|
|
4541
|
+
!hasNested && /* @__PURE__ */ jsx16("div", {
|
|
4542
|
+
className: "w-5"
|
|
4543
|
+
}),
|
|
4544
|
+
/* @__PURE__ */ jsxs10("div", {
|
|
4545
|
+
className: "flex-1 min-w-0",
|
|
4546
|
+
children: [
|
|
4547
|
+
/* @__PURE__ */ jsxs10("div", {
|
|
4548
|
+
className: "flex items-baseline gap-2 flex-wrap",
|
|
4549
|
+
children: [
|
|
4550
|
+
/* @__PURE__ */ jsxs10("span", {
|
|
4551
|
+
className: "font-mono text-sm text-foreground",
|
|
4552
|
+
children: [
|
|
4553
|
+
name,
|
|
4554
|
+
!required && /* @__PURE__ */ jsx16("span", {
|
|
4555
|
+
className: "text-muted-foreground",
|
|
4556
|
+
children: "?"
|
|
4557
|
+
})
|
|
4558
|
+
]
|
|
4559
|
+
}),
|
|
4560
|
+
/* @__PURE__ */ jsx16("span", {
|
|
4561
|
+
className: "font-mono text-sm text-muted-foreground",
|
|
4562
|
+
children: hasNested ? "object" : type
|
|
4563
|
+
}),
|
|
4564
|
+
hasNested && /* @__PURE__ */ jsxs10("button", {
|
|
4565
|
+
type: "button",
|
|
4566
|
+
onClick: () => setExpanded(!expanded),
|
|
4567
|
+
className: "text-xs text-primary hover:underline cursor-pointer",
|
|
4568
|
+
children: [
|
|
4569
|
+
nestedCount,
|
|
4570
|
+
" ",
|
|
4571
|
+
nestedCount === 1 ? "property" : "properties"
|
|
4572
|
+
]
|
|
4573
|
+
})
|
|
4574
|
+
]
|
|
4575
|
+
}),
|
|
4576
|
+
description && /* @__PURE__ */ jsx16("p", {
|
|
4577
|
+
className: "text-sm text-muted-foreground mt-1",
|
|
4578
|
+
children: description
|
|
4579
|
+
})
|
|
4580
|
+
]
|
|
4581
|
+
})
|
|
4582
|
+
]
|
|
4583
|
+
})
|
|
4584
|
+
}),
|
|
4585
|
+
hasNested && expanded && nestedProps && /* @__PURE__ */ jsx16("div", {
|
|
4586
|
+
className: "border-l border-border ml-2",
|
|
4587
|
+
children: Object.entries(nestedProps).map(([propName, propSchema]) => /* @__PURE__ */ jsx16(NestedPropertyItem, {
|
|
4588
|
+
name: propName,
|
|
4589
|
+
schema: propSchema,
|
|
4590
|
+
required: getRequiredFields(schema).includes(propName),
|
|
4591
|
+
depth: depth + 1
|
|
4592
|
+
}, propName))
|
|
4593
|
+
})
|
|
4594
|
+
]
|
|
4595
|
+
});
|
|
4596
|
+
}
|
|
4597
|
+
function ParameterItem({
|
|
4598
|
+
param,
|
|
4599
|
+
depth = 0,
|
|
4600
|
+
className
|
|
4601
|
+
}) {
|
|
4602
|
+
const [expanded, setExpanded] = useState3(false);
|
|
4603
|
+
const type = formatSchema6(param.schema);
|
|
4604
|
+
const isRequired = param.required !== false;
|
|
4605
|
+
const nestedProps = getNestedProperties(param.schema);
|
|
4606
|
+
const nestedCount = countProperties(param.schema);
|
|
4607
|
+
const hasNested = nestedCount > 0;
|
|
4608
|
+
return /* @__PURE__ */ jsxs10("div", {
|
|
4609
|
+
className: cn4("border-b border-border last:border-b-0", className),
|
|
4610
|
+
children: [
|
|
4611
|
+
/* @__PURE__ */ jsx16("div", {
|
|
4612
|
+
className: "py-3",
|
|
4613
|
+
children: /* @__PURE__ */ jsxs10("div", {
|
|
4614
|
+
className: "flex items-start gap-2",
|
|
4615
|
+
children: [
|
|
4616
|
+
hasNested && /* @__PURE__ */ jsx16("button", {
|
|
4617
|
+
type: "button",
|
|
4618
|
+
onClick: () => setExpanded(!expanded),
|
|
4619
|
+
className: "mt-0.5 p-0.5 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
4620
|
+
"aria-label": expanded ? "Collapse" : "Expand",
|
|
4621
|
+
children: /* @__PURE__ */ jsx16(ChevronRight, {
|
|
4622
|
+
size: 14,
|
|
4623
|
+
className: cn4("transition-transform duration-200", expanded && "rotate-90")
|
|
4624
|
+
})
|
|
4625
|
+
}),
|
|
4626
|
+
!hasNested && /* @__PURE__ */ jsx16("div", {
|
|
4627
|
+
className: "w-5"
|
|
4628
|
+
}),
|
|
4629
|
+
/* @__PURE__ */ jsxs10("div", {
|
|
4630
|
+
className: "flex-1 min-w-0",
|
|
4631
|
+
children: [
|
|
4632
|
+
/* @__PURE__ */ jsxs10("div", {
|
|
4633
|
+
className: "flex items-baseline gap-2 flex-wrap",
|
|
4634
|
+
children: [
|
|
4635
|
+
/* @__PURE__ */ jsx16("span", {
|
|
4636
|
+
className: "font-mono text-sm font-medium text-foreground",
|
|
4637
|
+
children: param.name
|
|
4638
|
+
}),
|
|
4639
|
+
isRequired && /* @__PURE__ */ jsx16("span", {
|
|
4640
|
+
className: "text-[10px] font-semibold px-1.5 py-0.5 rounded border border-border bg-muted text-muted-foreground uppercase tracking-wide",
|
|
4641
|
+
children: "Required"
|
|
4642
|
+
}),
|
|
4643
|
+
/* @__PURE__ */ jsx16("span", {
|
|
4644
|
+
className: "font-mono text-sm text-muted-foreground",
|
|
4645
|
+
children: hasNested ? "object" : type
|
|
4646
|
+
}),
|
|
4647
|
+
hasNested && /* @__PURE__ */ jsxs10("button", {
|
|
4648
|
+
type: "button",
|
|
4649
|
+
onClick: () => setExpanded(!expanded),
|
|
4650
|
+
className: "text-xs text-primary hover:underline cursor-pointer",
|
|
4651
|
+
children: [
|
|
4652
|
+
nestedCount,
|
|
4653
|
+
" ",
|
|
4654
|
+
nestedCount === 1 ? "property" : "properties"
|
|
4655
|
+
]
|
|
4656
|
+
})
|
|
4657
|
+
]
|
|
4658
|
+
}),
|
|
4659
|
+
param.description && /* @__PURE__ */ jsx16("p", {
|
|
4660
|
+
className: "text-sm text-muted-foreground mt-1",
|
|
4661
|
+
children: param.description
|
|
4662
|
+
})
|
|
4663
|
+
]
|
|
4664
|
+
})
|
|
4665
|
+
]
|
|
4666
|
+
})
|
|
4667
|
+
}),
|
|
4668
|
+
hasNested && expanded && nestedProps && /* @__PURE__ */ jsx16("div", {
|
|
4669
|
+
className: "border-l border-border ml-2 mb-3",
|
|
4670
|
+
children: Object.entries(nestedProps).map(([propName, propSchema]) => /* @__PURE__ */ jsx16(NestedPropertyItem, {
|
|
4671
|
+
name: propName,
|
|
4672
|
+
schema: propSchema,
|
|
4673
|
+
required: getRequiredFields(param.schema).includes(propName),
|
|
4674
|
+
depth: depth + 1
|
|
4675
|
+
}, propName))
|
|
4676
|
+
})
|
|
4677
|
+
]
|
|
4678
|
+
});
|
|
4679
|
+
}
|
|
4680
|
+
export {
|
|
4681
|
+
specSchemaToAPISchema,
|
|
4682
|
+
specParamToAPIParam,
|
|
4683
|
+
specExamplesToCodeExamples,
|
|
4684
|
+
groupMembersByKind,
|
|
4685
|
+
getLanguagesFromExamples,
|
|
4686
|
+
getExampleTitle,
|
|
4687
|
+
getExampleLanguage,
|
|
4688
|
+
getExampleCode,
|
|
4689
|
+
cleanCode,
|
|
4690
|
+
buildImportStatement,
|
|
4691
|
+
VariableSection,
|
|
4692
|
+
VariablePage,
|
|
4693
|
+
TypeTable,
|
|
4694
|
+
Signature,
|
|
4695
|
+
ParameterItem,
|
|
4696
|
+
ParamTable,
|
|
4697
|
+
ParamRow,
|
|
4698
|
+
NestedProperty,
|
|
4699
|
+
MembersTable,
|
|
4700
|
+
MemberRow,
|
|
4701
|
+
InterfaceSection,
|
|
4702
|
+
InterfacePage,
|
|
4703
|
+
ImportSection,
|
|
4704
|
+
FunctionSection,
|
|
4705
|
+
FunctionPage,
|
|
4706
|
+
FullAPIReferencePage,
|
|
4707
|
+
ExportSection,
|
|
4708
|
+
ExportIndexPage,
|
|
4709
|
+
ExportCard,
|
|
4710
|
+
ExpandableProperty,
|
|
4711
|
+
ExampleBlock,
|
|
4712
|
+
EnumSection,
|
|
4713
|
+
EnumPage,
|
|
4714
|
+
CollapsibleMethod,
|
|
4715
|
+
CodeTabs,
|
|
4716
|
+
ClassSection,
|
|
4717
|
+
ClassPage,
|
|
4718
|
+
APIPage
|
|
4719
|
+
};
|