lkd-web-kit 0.0.0 → 0.0.1
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 +6 -11
- package/dist/components.d.ts +116 -0
- package/dist/consts.d.ts +73 -0
- package/dist/contexts.d.ts +39 -0
- package/dist/{index.d.ts → form.d.ts} +6 -0
- package/dist/hocs.d.ts +34 -0
- package/dist/hooks.d.ts +11 -0
- package/dist/index.cjs +3 -33
- package/dist/index.js +1 -35
- package/dist/index2.cjs +2 -0
- package/dist/index2.js +1 -0
- package/dist/index3.cjs +80 -0
- package/dist/index3.js +75 -0
- package/dist/index4.cjs +78 -0
- package/dist/index4.js +70 -0
- package/dist/index5.cjs +74 -0
- package/dist/index5.js +69 -0
- package/dist/index6.cjs +29 -0
- package/dist/index6.js +24 -0
- package/dist/index7.cjs +58 -0
- package/dist/index7.js +51 -0
- package/dist/index8.cjs +83 -0
- package/dist/index8.js +74 -0
- package/dist/index9.cjs +3402 -0
- package/dist/index9.js +3395 -0
- package/dist/mantine.d.ts +16 -0
- package/dist/navigation-DnFkn_t2.cjs +2518 -0
- package/dist/navigation-sZaWnl2V.js +2513 -0
- package/dist/types.d.ts +33 -0
- package/dist/useFetchNextPageOnScroll-08q9N5OE.js +49 -0
- package/dist/useFetchNextPageOnScroll-Fqj7Vp-O.cjs +52 -0
- package/dist/utils.d.ts +29 -0
- package/dist/zodValidator-Bx6RMGoL.cjs +13 -0
- package/dist/zodValidator-ChEQ3cmF.js +11 -0
- package/package.json +91 -7
package/dist/index9.js
ADDED
|
@@ -0,0 +1,3395 @@
|
|
|
1
|
+
import require$$1, { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Center, Loader, useCombobox, Combobox, InputBase, Input, ScrollArea, Stack, NavLink } from '@mantine/core';
|
|
3
|
+
import require$$0, { useRef } from 'react';
|
|
4
|
+
import { u as useFetchNextPageOnScroll } from './useFetchNextPageOnScroll-08q9N5OE.js';
|
|
5
|
+
import { r as require_interop_require_wildcard, a as requireSegment, b as require_interop_require_default, n as navigationExports } from './navigation-sZaWnl2V.js';
|
|
6
|
+
|
|
7
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
8
|
+
|
|
9
|
+
const Icon = ({
|
|
10
|
+
i: I,
|
|
11
|
+
size = "md",
|
|
12
|
+
style,
|
|
13
|
+
rotate,
|
|
14
|
+
className,
|
|
15
|
+
...rest
|
|
16
|
+
}) => {
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
I,
|
|
19
|
+
{
|
|
20
|
+
...typeof size === "number" ? {
|
|
21
|
+
height: size,
|
|
22
|
+
width: size
|
|
23
|
+
} : stylesBySize[size],
|
|
24
|
+
viewBox: "0 0 24 24",
|
|
25
|
+
style: {
|
|
26
|
+
...style,
|
|
27
|
+
transform: `rotate(${rotate}deg)`
|
|
28
|
+
},
|
|
29
|
+
className: clsx("shrink-0", className),
|
|
30
|
+
...rest
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
const stylesBySize = {
|
|
35
|
+
xs: {
|
|
36
|
+
height: 16,
|
|
37
|
+
width: 16
|
|
38
|
+
},
|
|
39
|
+
sm: {
|
|
40
|
+
height: 20,
|
|
41
|
+
width: 20
|
|
42
|
+
},
|
|
43
|
+
md: {
|
|
44
|
+
height: 24,
|
|
45
|
+
width: 24
|
|
46
|
+
},
|
|
47
|
+
lg: {
|
|
48
|
+
height: 28,
|
|
49
|
+
width: 28
|
|
50
|
+
},
|
|
51
|
+
xl: {
|
|
52
|
+
height: 32,
|
|
53
|
+
width: 32
|
|
54
|
+
},
|
|
55
|
+
["2xl"]: {
|
|
56
|
+
height: 40,
|
|
57
|
+
width: 40
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const pxBySize = {
|
|
62
|
+
sm: 48,
|
|
63
|
+
md: 60,
|
|
64
|
+
lg: 84
|
|
65
|
+
};
|
|
66
|
+
const EmptyState = ({
|
|
67
|
+
label,
|
|
68
|
+
action,
|
|
69
|
+
icon,
|
|
70
|
+
className,
|
|
71
|
+
size = "md",
|
|
72
|
+
...props
|
|
73
|
+
}) => {
|
|
74
|
+
return /* @__PURE__ */ jsxs(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: clsx("justfiy-center flex flex-col items-center gap-1", className),
|
|
78
|
+
...props,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
Icon,
|
|
82
|
+
{
|
|
83
|
+
i: icon,
|
|
84
|
+
size: pxBySize[size],
|
|
85
|
+
className: "text-gray-2"
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-6 text-sm font-semibold", children: label }),
|
|
89
|
+
/* @__PURE__ */ jsx("div", { children: action })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const InfinityLoader = ({ infinity, loaderProps, ...props }) => {
|
|
96
|
+
return /* @__PURE__ */ jsx(Center, { ...props, children: infinity.isFetching ? /* @__PURE__ */ jsx(Loader, { ...loaderProps }) : !infinity.hasNextPage && (infinity.data?.pages.length ?? 0) > 1 && /* @__PURE__ */ jsx("p", { children: "No hay más resultados" }) });
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
function SelectInfinity({
|
|
100
|
+
value,
|
|
101
|
+
onChange,
|
|
102
|
+
data = [],
|
|
103
|
+
searchValue,
|
|
104
|
+
onSearchChange,
|
|
105
|
+
renderOption,
|
|
106
|
+
onOptionSubmit,
|
|
107
|
+
nothingFoundMessage,
|
|
108
|
+
infinity,
|
|
109
|
+
placeholder,
|
|
110
|
+
...props
|
|
111
|
+
}) {
|
|
112
|
+
const combobox = useCombobox({
|
|
113
|
+
onDropdownClose: () => {
|
|
114
|
+
combobox.resetSelectedOption();
|
|
115
|
+
combobox.focusTarget();
|
|
116
|
+
onSearchChange?.("");
|
|
117
|
+
},
|
|
118
|
+
onDropdownOpen: () => {
|
|
119
|
+
combobox.focusSearchInput();
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
const options = data.map((i) => /* @__PURE__ */ jsx(
|
|
123
|
+
Combobox.Option,
|
|
124
|
+
{
|
|
125
|
+
value: i.value,
|
|
126
|
+
children: renderOption ? renderOption({ option: i }) : i.label
|
|
127
|
+
},
|
|
128
|
+
i.value
|
|
129
|
+
));
|
|
130
|
+
const selectedOption = data.find((i) => i.value === value);
|
|
131
|
+
const scrollAreaRef = useRef(null);
|
|
132
|
+
useFetchNextPageOnScroll(infinity, scrollAreaRef);
|
|
133
|
+
return /* @__PURE__ */ jsxs(
|
|
134
|
+
Combobox,
|
|
135
|
+
{
|
|
136
|
+
store: combobox,
|
|
137
|
+
middlewares: {
|
|
138
|
+
shift: {
|
|
139
|
+
crossAxis: true
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
onOptionSubmit: (val) => {
|
|
143
|
+
onChange?.(val);
|
|
144
|
+
onOptionSubmit?.(val);
|
|
145
|
+
combobox.closeDropdown();
|
|
146
|
+
},
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ jsx(Combobox.Target, { children: /* @__PURE__ */ jsx(
|
|
149
|
+
InputBase,
|
|
150
|
+
{
|
|
151
|
+
component: "button",
|
|
152
|
+
type: "button",
|
|
153
|
+
pointer: true,
|
|
154
|
+
rightSection: /* @__PURE__ */ jsx(Combobox.Chevron, {}),
|
|
155
|
+
onClick: () => combobox.toggleDropdown(),
|
|
156
|
+
rightSectionPointerEvents: "none",
|
|
157
|
+
...props,
|
|
158
|
+
children: selectedOption?.label || /* @__PURE__ */ jsx(Input.Placeholder, { children: placeholder })
|
|
159
|
+
}
|
|
160
|
+
) }),
|
|
161
|
+
/* @__PURE__ */ jsxs(Combobox.Dropdown, { children: [
|
|
162
|
+
/* @__PURE__ */ jsx(
|
|
163
|
+
Combobox.Search,
|
|
164
|
+
{
|
|
165
|
+
value: searchValue,
|
|
166
|
+
onChange: (event) => onSearchChange?.(event.currentTarget.value),
|
|
167
|
+
placeholder: "Escribe para buscar"
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ jsx(Combobox.Options, { children: /* @__PURE__ */ jsxs(
|
|
171
|
+
ScrollArea.Autosize,
|
|
172
|
+
{
|
|
173
|
+
mah: 200,
|
|
174
|
+
type: "scroll",
|
|
175
|
+
viewportRef: scrollAreaRef,
|
|
176
|
+
children: [
|
|
177
|
+
options.length > 0 ? options : !infinity.isFetching ? /* @__PURE__ */ jsx(
|
|
178
|
+
Combobox.Empty,
|
|
179
|
+
{
|
|
180
|
+
onClick: () => combobox.closeDropdown(),
|
|
181
|
+
className: "min-h-6",
|
|
182
|
+
children: nothingFoundMessage ?? "Sin resultados"
|
|
183
|
+
}
|
|
184
|
+
) : null,
|
|
185
|
+
/* @__PURE__ */ jsx(
|
|
186
|
+
InfinityLoader,
|
|
187
|
+
{
|
|
188
|
+
className: "text-sm",
|
|
189
|
+
infinity,
|
|
190
|
+
loaderProps: {
|
|
191
|
+
size: "sm",
|
|
192
|
+
className: "mt-1 mb-2"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
) })
|
|
199
|
+
] })
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function getDefaultExportFromCjs (x) {
|
|
206
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
var link$1 = {exports: {}};
|
|
210
|
+
|
|
211
|
+
var resolveHref = {exports: {}};
|
|
212
|
+
|
|
213
|
+
var querystring = {};
|
|
214
|
+
|
|
215
|
+
var hasRequiredQuerystring;
|
|
216
|
+
|
|
217
|
+
function requireQuerystring () {
|
|
218
|
+
if (hasRequiredQuerystring) return querystring;
|
|
219
|
+
hasRequiredQuerystring = 1;
|
|
220
|
+
(function (exports) {
|
|
221
|
+
Object.defineProperty(exports, "__esModule", {
|
|
222
|
+
value: true
|
|
223
|
+
});
|
|
224
|
+
function _export(target, all) {
|
|
225
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: all[name]
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
_export(exports, {
|
|
231
|
+
assign: function() {
|
|
232
|
+
return assign;
|
|
233
|
+
},
|
|
234
|
+
searchParamsToUrlQuery: function() {
|
|
235
|
+
return searchParamsToUrlQuery;
|
|
236
|
+
},
|
|
237
|
+
urlQueryToSearchParams: function() {
|
|
238
|
+
return urlQueryToSearchParams;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
function searchParamsToUrlQuery(searchParams) {
|
|
242
|
+
const query = {};
|
|
243
|
+
for (const [key, value] of searchParams.entries()){
|
|
244
|
+
const existing = query[key];
|
|
245
|
+
if (typeof existing === 'undefined') {
|
|
246
|
+
query[key] = value;
|
|
247
|
+
} else if (Array.isArray(existing)) {
|
|
248
|
+
existing.push(value);
|
|
249
|
+
} else {
|
|
250
|
+
query[key] = [
|
|
251
|
+
existing,
|
|
252
|
+
value
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return query;
|
|
257
|
+
}
|
|
258
|
+
function stringifyUrlQueryParam(param) {
|
|
259
|
+
if (typeof param === 'string') {
|
|
260
|
+
return param;
|
|
261
|
+
}
|
|
262
|
+
if (typeof param === 'number' && !isNaN(param) || typeof param === 'boolean') {
|
|
263
|
+
return String(param);
|
|
264
|
+
} else {
|
|
265
|
+
return '';
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function urlQueryToSearchParams(query) {
|
|
269
|
+
const searchParams = new URLSearchParams();
|
|
270
|
+
for (const [key, value] of Object.entries(query)){
|
|
271
|
+
if (Array.isArray(value)) {
|
|
272
|
+
for (const item of value){
|
|
273
|
+
searchParams.append(key, stringifyUrlQueryParam(item));
|
|
274
|
+
}
|
|
275
|
+
} else {
|
|
276
|
+
searchParams.set(key, stringifyUrlQueryParam(value));
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return searchParams;
|
|
280
|
+
}
|
|
281
|
+
function assign(target) {
|
|
282
|
+
for(var _len = arguments.length, searchParamsList = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
283
|
+
searchParamsList[_key - 1] = arguments[_key];
|
|
284
|
+
}
|
|
285
|
+
for (const searchParams of searchParamsList){
|
|
286
|
+
for (const key of searchParams.keys()){
|
|
287
|
+
target.delete(key);
|
|
288
|
+
}
|
|
289
|
+
for (const [key, value] of searchParams.entries()){
|
|
290
|
+
target.append(key, value);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return target;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
} (querystring));
|
|
298
|
+
return querystring;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
var formatUrl = {};
|
|
302
|
+
|
|
303
|
+
var hasRequiredFormatUrl;
|
|
304
|
+
|
|
305
|
+
function requireFormatUrl () {
|
|
306
|
+
if (hasRequiredFormatUrl) return formatUrl;
|
|
307
|
+
hasRequiredFormatUrl = 1;
|
|
308
|
+
(function (exports) {
|
|
309
|
+
Object.defineProperty(exports, "__esModule", {
|
|
310
|
+
value: true
|
|
311
|
+
});
|
|
312
|
+
function _export(target, all) {
|
|
313
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
314
|
+
enumerable: true,
|
|
315
|
+
get: all[name]
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
_export(exports, {
|
|
319
|
+
formatUrl: function() {
|
|
320
|
+
return formatUrl;
|
|
321
|
+
},
|
|
322
|
+
formatWithValidation: function() {
|
|
323
|
+
return formatWithValidation;
|
|
324
|
+
},
|
|
325
|
+
urlObjectKeys: function() {
|
|
326
|
+
return urlObjectKeys;
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
const _interop_require_wildcard = /*@__PURE__*/ require_interop_require_wildcard();
|
|
330
|
+
const _querystring = /*#__PURE__*/ _interop_require_wildcard._(requireQuerystring());
|
|
331
|
+
const slashedProtocols = /https?|ftp|gopher|file/;
|
|
332
|
+
function formatUrl(urlObj) {
|
|
333
|
+
let { auth, hostname } = urlObj;
|
|
334
|
+
let protocol = urlObj.protocol || '';
|
|
335
|
+
let pathname = urlObj.pathname || '';
|
|
336
|
+
let hash = urlObj.hash || '';
|
|
337
|
+
let query = urlObj.query || '';
|
|
338
|
+
let host = false;
|
|
339
|
+
auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ':') + '@' : '';
|
|
340
|
+
if (urlObj.host) {
|
|
341
|
+
host = auth + urlObj.host;
|
|
342
|
+
} else if (hostname) {
|
|
343
|
+
host = auth + (~hostname.indexOf(':') ? "[" + hostname + "]" : hostname);
|
|
344
|
+
if (urlObj.port) {
|
|
345
|
+
host += ':' + urlObj.port;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
if (query && typeof query === 'object') {
|
|
349
|
+
query = String(_querystring.urlQueryToSearchParams(query));
|
|
350
|
+
}
|
|
351
|
+
let search = urlObj.search || query && "?" + query || '';
|
|
352
|
+
if (protocol && !protocol.endsWith(':')) protocol += ':';
|
|
353
|
+
if (urlObj.slashes || (!protocol || slashedProtocols.test(protocol)) && host !== false) {
|
|
354
|
+
host = '//' + (host || '');
|
|
355
|
+
if (pathname && pathname[0] !== '/') pathname = '/' + pathname;
|
|
356
|
+
} else if (!host) {
|
|
357
|
+
host = '';
|
|
358
|
+
}
|
|
359
|
+
if (hash && hash[0] !== '#') hash = '#' + hash;
|
|
360
|
+
if (search && search[0] !== '?') search = '?' + search;
|
|
361
|
+
pathname = pathname.replace(/[?#]/g, encodeURIComponent);
|
|
362
|
+
search = search.replace('#', '%23');
|
|
363
|
+
return "" + protocol + host + pathname + search + hash;
|
|
364
|
+
}
|
|
365
|
+
const urlObjectKeys = [
|
|
366
|
+
'auth',
|
|
367
|
+
'hash',
|
|
368
|
+
'host',
|
|
369
|
+
'hostname',
|
|
370
|
+
'href',
|
|
371
|
+
'path',
|
|
372
|
+
'pathname',
|
|
373
|
+
'port',
|
|
374
|
+
'protocol',
|
|
375
|
+
'query',
|
|
376
|
+
'search',
|
|
377
|
+
'slashes'
|
|
378
|
+
];
|
|
379
|
+
function formatWithValidation(url) {
|
|
380
|
+
if (process.env.NODE_ENV === 'development') {
|
|
381
|
+
if (url !== null && typeof url === 'object') {
|
|
382
|
+
Object.keys(url).forEach((key)=>{
|
|
383
|
+
if (!urlObjectKeys.includes(key)) {
|
|
384
|
+
console.warn("Unknown key passed via urlObject into url.format: " + key);
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return formatUrl(url);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
} (formatUrl));
|
|
394
|
+
return formatUrl;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
var omit = {};
|
|
398
|
+
|
|
399
|
+
var hasRequiredOmit;
|
|
400
|
+
|
|
401
|
+
function requireOmit () {
|
|
402
|
+
if (hasRequiredOmit) return omit;
|
|
403
|
+
hasRequiredOmit = 1;
|
|
404
|
+
(function (exports) {
|
|
405
|
+
Object.defineProperty(exports, "__esModule", {
|
|
406
|
+
value: true
|
|
407
|
+
});
|
|
408
|
+
Object.defineProperty(exports, "omit", {
|
|
409
|
+
enumerable: true,
|
|
410
|
+
get: function() {
|
|
411
|
+
return omit;
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
function omit(object, keys) {
|
|
415
|
+
const omitted = {};
|
|
416
|
+
Object.keys(object).forEach((key)=>{
|
|
417
|
+
if (!keys.includes(key)) {
|
|
418
|
+
omitted[key] = object[key];
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
return omitted;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
} (omit));
|
|
426
|
+
return omit;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
var utils$1 = {};
|
|
430
|
+
|
|
431
|
+
var hasRequiredUtils$1;
|
|
432
|
+
|
|
433
|
+
function requireUtils$1 () {
|
|
434
|
+
if (hasRequiredUtils$1) return utils$1;
|
|
435
|
+
hasRequiredUtils$1 = 1;
|
|
436
|
+
(function (exports) {
|
|
437
|
+
Object.defineProperty(exports, "__esModule", {
|
|
438
|
+
value: true
|
|
439
|
+
});
|
|
440
|
+
function _export(target, all) {
|
|
441
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
442
|
+
enumerable: true,
|
|
443
|
+
get: all[name]
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
_export(exports, {
|
|
447
|
+
DecodeError: function() {
|
|
448
|
+
return DecodeError;
|
|
449
|
+
},
|
|
450
|
+
MiddlewareNotFoundError: function() {
|
|
451
|
+
return MiddlewareNotFoundError;
|
|
452
|
+
},
|
|
453
|
+
MissingStaticPage: function() {
|
|
454
|
+
return MissingStaticPage;
|
|
455
|
+
},
|
|
456
|
+
NormalizeError: function() {
|
|
457
|
+
return NormalizeError;
|
|
458
|
+
},
|
|
459
|
+
PageNotFoundError: function() {
|
|
460
|
+
return PageNotFoundError;
|
|
461
|
+
},
|
|
462
|
+
SP: function() {
|
|
463
|
+
return SP;
|
|
464
|
+
},
|
|
465
|
+
ST: function() {
|
|
466
|
+
return ST;
|
|
467
|
+
},
|
|
468
|
+
WEB_VITALS: function() {
|
|
469
|
+
return WEB_VITALS;
|
|
470
|
+
},
|
|
471
|
+
execOnce: function() {
|
|
472
|
+
return execOnce;
|
|
473
|
+
},
|
|
474
|
+
getDisplayName: function() {
|
|
475
|
+
return getDisplayName;
|
|
476
|
+
},
|
|
477
|
+
getLocationOrigin: function() {
|
|
478
|
+
return getLocationOrigin;
|
|
479
|
+
},
|
|
480
|
+
getURL: function() {
|
|
481
|
+
return getURL;
|
|
482
|
+
},
|
|
483
|
+
isAbsoluteUrl: function() {
|
|
484
|
+
return isAbsoluteUrl;
|
|
485
|
+
},
|
|
486
|
+
isResSent: function() {
|
|
487
|
+
return isResSent;
|
|
488
|
+
},
|
|
489
|
+
loadGetInitialProps: function() {
|
|
490
|
+
return loadGetInitialProps;
|
|
491
|
+
},
|
|
492
|
+
normalizeRepeatedSlashes: function() {
|
|
493
|
+
return normalizeRepeatedSlashes;
|
|
494
|
+
},
|
|
495
|
+
stringifyError: function() {
|
|
496
|
+
return stringifyError;
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
const WEB_VITALS = [
|
|
500
|
+
'CLS',
|
|
501
|
+
'FCP',
|
|
502
|
+
'FID',
|
|
503
|
+
'INP',
|
|
504
|
+
'LCP',
|
|
505
|
+
'TTFB'
|
|
506
|
+
];
|
|
507
|
+
function execOnce(fn) {
|
|
508
|
+
let used = false;
|
|
509
|
+
let result;
|
|
510
|
+
return function() {
|
|
511
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
512
|
+
args[_key] = arguments[_key];
|
|
513
|
+
}
|
|
514
|
+
if (!used) {
|
|
515
|
+
used = true;
|
|
516
|
+
result = fn(...args);
|
|
517
|
+
}
|
|
518
|
+
return result;
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
|
|
522
|
+
// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
|
|
523
|
+
const ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
|
|
524
|
+
const isAbsoluteUrl = (url)=>ABSOLUTE_URL_REGEX.test(url);
|
|
525
|
+
function getLocationOrigin() {
|
|
526
|
+
const { protocol, hostname, port } = window.location;
|
|
527
|
+
return protocol + "//" + hostname + (port ? ':' + port : '');
|
|
528
|
+
}
|
|
529
|
+
function getURL() {
|
|
530
|
+
const { href } = window.location;
|
|
531
|
+
const origin = getLocationOrigin();
|
|
532
|
+
return href.substring(origin.length);
|
|
533
|
+
}
|
|
534
|
+
function getDisplayName(Component) {
|
|
535
|
+
return typeof Component === 'string' ? Component : Component.displayName || Component.name || 'Unknown';
|
|
536
|
+
}
|
|
537
|
+
function isResSent(res) {
|
|
538
|
+
return res.finished || res.headersSent;
|
|
539
|
+
}
|
|
540
|
+
function normalizeRepeatedSlashes(url) {
|
|
541
|
+
const urlParts = url.split('?');
|
|
542
|
+
const urlNoQuery = urlParts[0];
|
|
543
|
+
return urlNoQuery// first we replace any non-encoded backslashes with forward
|
|
544
|
+
// then normalize repeated forward slashes
|
|
545
|
+
.replace(/\\/g, '/').replace(/\/\/+/g, '/') + (urlParts[1] ? "?" + urlParts.slice(1).join('?') : '');
|
|
546
|
+
}
|
|
547
|
+
async function loadGetInitialProps(App, ctx) {
|
|
548
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
549
|
+
var _App_prototype;
|
|
550
|
+
if ((_App_prototype = App.prototype) == null ? void 0 : _App_prototype.getInitialProps) {
|
|
551
|
+
const message = '"' + getDisplayName(App) + '.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.';
|
|
552
|
+
throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
553
|
+
value: "E394",
|
|
554
|
+
enumerable: false,
|
|
555
|
+
configurable: true
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
// when called from _app `ctx` is nested in `ctx`
|
|
560
|
+
const res = ctx.res || ctx.ctx && ctx.ctx.res;
|
|
561
|
+
if (!App.getInitialProps) {
|
|
562
|
+
if (ctx.ctx && ctx.Component) {
|
|
563
|
+
// @ts-ignore pageProps default
|
|
564
|
+
return {
|
|
565
|
+
pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx)
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
return {};
|
|
569
|
+
}
|
|
570
|
+
const props = await App.getInitialProps(ctx);
|
|
571
|
+
if (res && isResSent(res)) {
|
|
572
|
+
return props;
|
|
573
|
+
}
|
|
574
|
+
if (!props) {
|
|
575
|
+
const message = '"' + getDisplayName(App) + '.getInitialProps()" should resolve to an object. But found "' + props + '" instead.';
|
|
576
|
+
throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
577
|
+
value: "E394",
|
|
578
|
+
enumerable: false,
|
|
579
|
+
configurable: true
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
583
|
+
if (Object.keys(props).length === 0 && !ctx.ctx) {
|
|
584
|
+
console.warn("" + getDisplayName(App) + " returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps");
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
return props;
|
|
588
|
+
}
|
|
589
|
+
const SP = typeof performance !== 'undefined';
|
|
590
|
+
const ST = SP && [
|
|
591
|
+
'mark',
|
|
592
|
+
'measure',
|
|
593
|
+
'getEntriesByName'
|
|
594
|
+
].every((method)=>typeof performance[method] === 'function');
|
|
595
|
+
class DecodeError extends Error {
|
|
596
|
+
}
|
|
597
|
+
class NormalizeError extends Error {
|
|
598
|
+
}
|
|
599
|
+
class PageNotFoundError extends Error {
|
|
600
|
+
constructor(page){
|
|
601
|
+
super();
|
|
602
|
+
this.code = 'ENOENT';
|
|
603
|
+
this.name = 'PageNotFoundError';
|
|
604
|
+
this.message = "Cannot find module for page: " + page;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
class MissingStaticPage extends Error {
|
|
608
|
+
constructor(page, message){
|
|
609
|
+
super();
|
|
610
|
+
this.message = "Failed to load static file for page: " + page + " " + message;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
class MiddlewareNotFoundError extends Error {
|
|
614
|
+
constructor(){
|
|
615
|
+
super();
|
|
616
|
+
this.code = 'ENOENT';
|
|
617
|
+
this.message = "Cannot find the middleware module";
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function stringifyError(error) {
|
|
621
|
+
return JSON.stringify({
|
|
622
|
+
message: error.message,
|
|
623
|
+
stack: error.stack
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
} (utils$1));
|
|
629
|
+
return utils$1;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
var normalizeTrailingSlash = {exports: {}};
|
|
633
|
+
|
|
634
|
+
var removeTrailingSlash = {};
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Removes the trailing slash for a given route or page path. Preserves the
|
|
638
|
+
* root page. Examples:
|
|
639
|
+
* - `/foo/bar/` -> `/foo/bar`
|
|
640
|
+
* - `/foo/bar` -> `/foo/bar`
|
|
641
|
+
* - `/` -> `/`
|
|
642
|
+
*/
|
|
643
|
+
|
|
644
|
+
var hasRequiredRemoveTrailingSlash;
|
|
645
|
+
|
|
646
|
+
function requireRemoveTrailingSlash () {
|
|
647
|
+
if (hasRequiredRemoveTrailingSlash) return removeTrailingSlash;
|
|
648
|
+
hasRequiredRemoveTrailingSlash = 1;
|
|
649
|
+
(function (exports) {
|
|
650
|
+
Object.defineProperty(exports, "__esModule", {
|
|
651
|
+
value: true
|
|
652
|
+
});
|
|
653
|
+
Object.defineProperty(exports, "removeTrailingSlash", {
|
|
654
|
+
enumerable: true,
|
|
655
|
+
get: function() {
|
|
656
|
+
return removeTrailingSlash;
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
function removeTrailingSlash(route) {
|
|
660
|
+
return route.replace(/\/$/, '') || '/';
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
} (removeTrailingSlash));
|
|
665
|
+
return removeTrailingSlash;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
var parsePath = {};
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Given a path this function will find the pathname, query and hash and return
|
|
672
|
+
* them. This is useful to parse full paths on the client side.
|
|
673
|
+
* @param path A path to parse e.g. /foo/bar?id=1#hash
|
|
674
|
+
*/
|
|
675
|
+
|
|
676
|
+
var hasRequiredParsePath;
|
|
677
|
+
|
|
678
|
+
function requireParsePath () {
|
|
679
|
+
if (hasRequiredParsePath) return parsePath;
|
|
680
|
+
hasRequiredParsePath = 1;
|
|
681
|
+
(function (exports) {
|
|
682
|
+
Object.defineProperty(exports, "__esModule", {
|
|
683
|
+
value: true
|
|
684
|
+
});
|
|
685
|
+
Object.defineProperty(exports, "parsePath", {
|
|
686
|
+
enumerable: true,
|
|
687
|
+
get: function() {
|
|
688
|
+
return parsePath;
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
function parsePath(path) {
|
|
692
|
+
const hashIndex = path.indexOf('#');
|
|
693
|
+
const queryIndex = path.indexOf('?');
|
|
694
|
+
const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);
|
|
695
|
+
if (hasQuery || hashIndex > -1) {
|
|
696
|
+
return {
|
|
697
|
+
pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),
|
|
698
|
+
query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined) : '',
|
|
699
|
+
hash: hashIndex > -1 ? path.slice(hashIndex) : ''
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
return {
|
|
703
|
+
pathname: path,
|
|
704
|
+
query: '',
|
|
705
|
+
hash: ''
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
} (parsePath));
|
|
711
|
+
return parsePath;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
var hasRequiredNormalizeTrailingSlash;
|
|
715
|
+
|
|
716
|
+
function requireNormalizeTrailingSlash () {
|
|
717
|
+
if (hasRequiredNormalizeTrailingSlash) return normalizeTrailingSlash.exports;
|
|
718
|
+
hasRequiredNormalizeTrailingSlash = 1;
|
|
719
|
+
(function (module, exports) {
|
|
720
|
+
Object.defineProperty(exports, "__esModule", {
|
|
721
|
+
value: true
|
|
722
|
+
});
|
|
723
|
+
Object.defineProperty(exports, "normalizePathTrailingSlash", {
|
|
724
|
+
enumerable: true,
|
|
725
|
+
get: function() {
|
|
726
|
+
return normalizePathTrailingSlash;
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
const _removetrailingslash = requireRemoveTrailingSlash();
|
|
730
|
+
const _parsepath = requireParsePath();
|
|
731
|
+
const normalizePathTrailingSlash = (path)=>{
|
|
732
|
+
if (!path.startsWith('/') || process.env.__NEXT_MANUAL_TRAILING_SLASH) {
|
|
733
|
+
return path;
|
|
734
|
+
}
|
|
735
|
+
const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
|
|
736
|
+
if (process.env.__NEXT_TRAILING_SLASH) {
|
|
737
|
+
if (/\.[^/]+\/?$/.test(pathname)) {
|
|
738
|
+
return "" + (0, _removetrailingslash.removeTrailingSlash)(pathname) + query + hash;
|
|
739
|
+
} else if (pathname.endsWith('/')) {
|
|
740
|
+
return "" + pathname + query + hash;
|
|
741
|
+
} else {
|
|
742
|
+
return pathname + "/" + query + hash;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
return "" + (0, _removetrailingslash.removeTrailingSlash)(pathname) + query + hash;
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
749
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
750
|
+
Object.assign(exports.default, exports);
|
|
751
|
+
module.exports = exports.default;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
} (normalizeTrailingSlash, normalizeTrailingSlash.exports));
|
|
756
|
+
return normalizeTrailingSlash.exports;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
var isLocalUrl = {};
|
|
760
|
+
|
|
761
|
+
var hasBasePath = {exports: {}};
|
|
762
|
+
|
|
763
|
+
var pathHasPrefix = {};
|
|
764
|
+
|
|
765
|
+
var hasRequiredPathHasPrefix;
|
|
766
|
+
|
|
767
|
+
function requirePathHasPrefix () {
|
|
768
|
+
if (hasRequiredPathHasPrefix) return pathHasPrefix;
|
|
769
|
+
hasRequiredPathHasPrefix = 1;
|
|
770
|
+
(function (exports) {
|
|
771
|
+
Object.defineProperty(exports, "__esModule", {
|
|
772
|
+
value: true
|
|
773
|
+
});
|
|
774
|
+
Object.defineProperty(exports, "pathHasPrefix", {
|
|
775
|
+
enumerable: true,
|
|
776
|
+
get: function() {
|
|
777
|
+
return pathHasPrefix;
|
|
778
|
+
}
|
|
779
|
+
});
|
|
780
|
+
const _parsepath = requireParsePath();
|
|
781
|
+
function pathHasPrefix(path, prefix) {
|
|
782
|
+
if (typeof path !== 'string') {
|
|
783
|
+
return false;
|
|
784
|
+
}
|
|
785
|
+
const { pathname } = (0, _parsepath.parsePath)(path);
|
|
786
|
+
return pathname === prefix || pathname.startsWith(prefix + '/');
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
} (pathHasPrefix));
|
|
791
|
+
return pathHasPrefix;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
var hasRequiredHasBasePath;
|
|
795
|
+
|
|
796
|
+
function requireHasBasePath () {
|
|
797
|
+
if (hasRequiredHasBasePath) return hasBasePath.exports;
|
|
798
|
+
hasRequiredHasBasePath = 1;
|
|
799
|
+
(function (module, exports) {
|
|
800
|
+
Object.defineProperty(exports, "__esModule", {
|
|
801
|
+
value: true
|
|
802
|
+
});
|
|
803
|
+
Object.defineProperty(exports, "hasBasePath", {
|
|
804
|
+
enumerable: true,
|
|
805
|
+
get: function() {
|
|
806
|
+
return hasBasePath;
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
const _pathhasprefix = requirePathHasPrefix();
|
|
810
|
+
const basePath = process.env.__NEXT_ROUTER_BASEPATH || '';
|
|
811
|
+
function hasBasePath(path) {
|
|
812
|
+
return (0, _pathhasprefix.pathHasPrefix)(path, basePath);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
816
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
817
|
+
Object.assign(exports.default, exports);
|
|
818
|
+
module.exports = exports.default;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
} (hasBasePath, hasBasePath.exports));
|
|
823
|
+
return hasBasePath.exports;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
var hasRequiredIsLocalUrl;
|
|
827
|
+
|
|
828
|
+
function requireIsLocalUrl () {
|
|
829
|
+
if (hasRequiredIsLocalUrl) return isLocalUrl;
|
|
830
|
+
hasRequiredIsLocalUrl = 1;
|
|
831
|
+
(function (exports) {
|
|
832
|
+
Object.defineProperty(exports, "__esModule", {
|
|
833
|
+
value: true
|
|
834
|
+
});
|
|
835
|
+
Object.defineProperty(exports, "isLocalURL", {
|
|
836
|
+
enumerable: true,
|
|
837
|
+
get: function() {
|
|
838
|
+
return isLocalURL;
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
const _utils = requireUtils$1();
|
|
842
|
+
const _hasbasepath = requireHasBasePath();
|
|
843
|
+
function isLocalURL(url) {
|
|
844
|
+
// prevent a hydration mismatch on href for url with anchor refs
|
|
845
|
+
if (!(0, _utils.isAbsoluteUrl)(url)) return true;
|
|
846
|
+
try {
|
|
847
|
+
// absolute urls can be local if they are on the same origin
|
|
848
|
+
const locationOrigin = (0, _utils.getLocationOrigin)();
|
|
849
|
+
const resolved = new URL(url, locationOrigin);
|
|
850
|
+
return resolved.origin === locationOrigin && (0, _hasbasepath.hasBasePath)(resolved.pathname);
|
|
851
|
+
} catch (_) {
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
} (isLocalUrl));
|
|
858
|
+
return isLocalUrl;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
var utils = {};
|
|
862
|
+
|
|
863
|
+
var sortedRoutes = {};
|
|
864
|
+
|
|
865
|
+
var hasRequiredSortedRoutes;
|
|
866
|
+
|
|
867
|
+
function requireSortedRoutes () {
|
|
868
|
+
if (hasRequiredSortedRoutes) return sortedRoutes;
|
|
869
|
+
hasRequiredSortedRoutes = 1;
|
|
870
|
+
(function (exports) {
|
|
871
|
+
Object.defineProperty(exports, "__esModule", {
|
|
872
|
+
value: true
|
|
873
|
+
});
|
|
874
|
+
function _export(target, all) {
|
|
875
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
876
|
+
enumerable: true,
|
|
877
|
+
get: all[name]
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
_export(exports, {
|
|
881
|
+
getSortedRouteObjects: function() {
|
|
882
|
+
return getSortedRouteObjects;
|
|
883
|
+
},
|
|
884
|
+
getSortedRoutes: function() {
|
|
885
|
+
return getSortedRoutes;
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
class UrlNode {
|
|
889
|
+
insert(urlPath) {
|
|
890
|
+
this._insert(urlPath.split('/').filter(Boolean), [], false);
|
|
891
|
+
}
|
|
892
|
+
smoosh() {
|
|
893
|
+
return this._smoosh();
|
|
894
|
+
}
|
|
895
|
+
_smoosh(prefix) {
|
|
896
|
+
if (prefix === void 0) prefix = '/';
|
|
897
|
+
const childrenPaths = [
|
|
898
|
+
...this.children.keys()
|
|
899
|
+
].sort();
|
|
900
|
+
if (this.slugName !== null) {
|
|
901
|
+
childrenPaths.splice(childrenPaths.indexOf('[]'), 1);
|
|
902
|
+
}
|
|
903
|
+
if (this.restSlugName !== null) {
|
|
904
|
+
childrenPaths.splice(childrenPaths.indexOf('[...]'), 1);
|
|
905
|
+
}
|
|
906
|
+
if (this.optionalRestSlugName !== null) {
|
|
907
|
+
childrenPaths.splice(childrenPaths.indexOf('[[...]]'), 1);
|
|
908
|
+
}
|
|
909
|
+
const routes = childrenPaths.map((c)=>this.children.get(c)._smoosh("" + prefix + c + "/")).reduce((prev, curr)=>[
|
|
910
|
+
...prev,
|
|
911
|
+
...curr
|
|
912
|
+
], []);
|
|
913
|
+
if (this.slugName !== null) {
|
|
914
|
+
routes.push(...this.children.get('[]')._smoosh(prefix + "[" + this.slugName + "]/"));
|
|
915
|
+
}
|
|
916
|
+
if (!this.placeholder) {
|
|
917
|
+
const r = prefix === '/' ? '/' : prefix.slice(0, -1);
|
|
918
|
+
if (this.optionalRestSlugName != null) {
|
|
919
|
+
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", {
|
|
920
|
+
value: "E458",
|
|
921
|
+
enumerable: false,
|
|
922
|
+
configurable: true
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
routes.unshift(r);
|
|
926
|
+
}
|
|
927
|
+
if (this.restSlugName !== null) {
|
|
928
|
+
routes.push(...this.children.get('[...]')._smoosh(prefix + "[..." + this.restSlugName + "]/"));
|
|
929
|
+
}
|
|
930
|
+
if (this.optionalRestSlugName !== null) {
|
|
931
|
+
routes.push(...this.children.get('[[...]]')._smoosh(prefix + "[[..." + this.optionalRestSlugName + "]]/"));
|
|
932
|
+
}
|
|
933
|
+
return routes;
|
|
934
|
+
}
|
|
935
|
+
_insert(urlPaths, slugNames, isCatchAll) {
|
|
936
|
+
if (urlPaths.length === 0) {
|
|
937
|
+
this.placeholder = false;
|
|
938
|
+
return;
|
|
939
|
+
}
|
|
940
|
+
if (isCatchAll) {
|
|
941
|
+
throw Object.defineProperty(new Error("Catch-all must be the last part of the URL."), "__NEXT_ERROR_CODE", {
|
|
942
|
+
value: "E392",
|
|
943
|
+
enumerable: false,
|
|
944
|
+
configurable: true
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
// The next segment in the urlPaths list
|
|
948
|
+
let nextSegment = urlPaths[0];
|
|
949
|
+
// Check if the segment matches `[something]`
|
|
950
|
+
if (nextSegment.startsWith('[') && nextSegment.endsWith(']')) {
|
|
951
|
+
// Strip `[` and `]`, leaving only `something`
|
|
952
|
+
let segmentName = nextSegment.slice(1, -1);
|
|
953
|
+
let isOptional = false;
|
|
954
|
+
if (segmentName.startsWith('[') && segmentName.endsWith(']')) {
|
|
955
|
+
// Strip optional `[` and `]`, leaving only `something`
|
|
956
|
+
segmentName = segmentName.slice(1, -1);
|
|
957
|
+
isOptional = true;
|
|
958
|
+
}
|
|
959
|
+
if (segmentName.startsWith('…')) {
|
|
960
|
+
throw Object.defineProperty(new Error("Detected a three-dot character ('…') at ('" + segmentName + "'). Did you mean ('...')?"), "__NEXT_ERROR_CODE", {
|
|
961
|
+
value: "E147",
|
|
962
|
+
enumerable: false,
|
|
963
|
+
configurable: true
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
if (segmentName.startsWith('...')) {
|
|
967
|
+
// Strip `...`, leaving only `something`
|
|
968
|
+
segmentName = segmentName.substring(3);
|
|
969
|
+
isCatchAll = true;
|
|
970
|
+
}
|
|
971
|
+
if (segmentName.startsWith('[') || segmentName.endsWith(']')) {
|
|
972
|
+
throw Object.defineProperty(new Error("Segment names may not start or end with extra brackets ('" + segmentName + "')."), "__NEXT_ERROR_CODE", {
|
|
973
|
+
value: "E421",
|
|
974
|
+
enumerable: false,
|
|
975
|
+
configurable: true
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
if (segmentName.startsWith('.')) {
|
|
979
|
+
throw Object.defineProperty(new Error("Segment names may not start with erroneous periods ('" + segmentName + "')."), "__NEXT_ERROR_CODE", {
|
|
980
|
+
value: "E288",
|
|
981
|
+
enumerable: false,
|
|
982
|
+
configurable: true
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
function handleSlug(previousSlug, nextSlug) {
|
|
986
|
+
if (previousSlug !== null) {
|
|
987
|
+
// If the specific segment already has a slug but the slug is not `something`
|
|
988
|
+
// This prevents collisions like:
|
|
989
|
+
// pages/[post]/index.js
|
|
990
|
+
// pages/[id]/index.js
|
|
991
|
+
// Because currently multiple dynamic params on the same segment level are not supported
|
|
992
|
+
if (previousSlug !== nextSlug) {
|
|
993
|
+
// TODO: This error seems to be confusing for users, needs an error link, the description can be based on above comment.
|
|
994
|
+
throw Object.defineProperty(new Error("You cannot use different slug names for the same dynamic path ('" + previousSlug + "' !== '" + nextSlug + "')."), "__NEXT_ERROR_CODE", {
|
|
995
|
+
value: "E337",
|
|
996
|
+
enumerable: false,
|
|
997
|
+
configurable: true
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
slugNames.forEach((slug)=>{
|
|
1002
|
+
if (slug === nextSlug) {
|
|
1003
|
+
throw Object.defineProperty(new Error('You cannot have the same slug name "' + nextSlug + '" repeat within a single dynamic path'), "__NEXT_ERROR_CODE", {
|
|
1004
|
+
value: "E247",
|
|
1005
|
+
enumerable: false,
|
|
1006
|
+
configurable: true
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
if (slug.replace(/\W/g, '') === nextSegment.replace(/\W/g, '')) {
|
|
1010
|
+
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", {
|
|
1011
|
+
value: "E499",
|
|
1012
|
+
enumerable: false,
|
|
1013
|
+
configurable: true
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
slugNames.push(nextSlug);
|
|
1018
|
+
}
|
|
1019
|
+
if (isCatchAll) {
|
|
1020
|
+
if (isOptional) {
|
|
1021
|
+
if (this.restSlugName != null) {
|
|
1022
|
+
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", {
|
|
1023
|
+
value: "E299",
|
|
1024
|
+
enumerable: false,
|
|
1025
|
+
configurable: true
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
handleSlug(this.optionalRestSlugName, segmentName);
|
|
1029
|
+
// slugName is kept as it can only be one particular slugName
|
|
1030
|
+
this.optionalRestSlugName = segmentName;
|
|
1031
|
+
// nextSegment is overwritten to [[...]] so that it can later be sorted specifically
|
|
1032
|
+
nextSegment = '[[...]]';
|
|
1033
|
+
} else {
|
|
1034
|
+
if (this.optionalRestSlugName != null) {
|
|
1035
|
+
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", {
|
|
1036
|
+
value: "E300",
|
|
1037
|
+
enumerable: false,
|
|
1038
|
+
configurable: true
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
handleSlug(this.restSlugName, segmentName);
|
|
1042
|
+
// slugName is kept as it can only be one particular slugName
|
|
1043
|
+
this.restSlugName = segmentName;
|
|
1044
|
+
// nextSegment is overwritten to [...] so that it can later be sorted specifically
|
|
1045
|
+
nextSegment = '[...]';
|
|
1046
|
+
}
|
|
1047
|
+
} else {
|
|
1048
|
+
if (isOptional) {
|
|
1049
|
+
throw Object.defineProperty(new Error('Optional route parameters are not yet supported ("' + urlPaths[0] + '").'), "__NEXT_ERROR_CODE", {
|
|
1050
|
+
value: "E435",
|
|
1051
|
+
enumerable: false,
|
|
1052
|
+
configurable: true
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
handleSlug(this.slugName, segmentName);
|
|
1056
|
+
// slugName is kept as it can only be one particular slugName
|
|
1057
|
+
this.slugName = segmentName;
|
|
1058
|
+
// nextSegment is overwritten to [] so that it can later be sorted specifically
|
|
1059
|
+
nextSegment = '[]';
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
// If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode
|
|
1063
|
+
if (!this.children.has(nextSegment)) {
|
|
1064
|
+
this.children.set(nextSegment, new UrlNode());
|
|
1065
|
+
}
|
|
1066
|
+
this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);
|
|
1067
|
+
}
|
|
1068
|
+
constructor(){
|
|
1069
|
+
this.placeholder = true;
|
|
1070
|
+
this.children = new Map();
|
|
1071
|
+
this.slugName = null;
|
|
1072
|
+
this.restSlugName = null;
|
|
1073
|
+
this.optionalRestSlugName = null;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
function getSortedRoutes(normalizedPages) {
|
|
1077
|
+
// First the UrlNode is created, and every UrlNode can have only 1 dynamic segment
|
|
1078
|
+
// Eg you can't have pages/[post]/abc.js and pages/[hello]/something-else.js
|
|
1079
|
+
// Only 1 dynamic segment per nesting level
|
|
1080
|
+
// So in the case that is test/integration/dynamic-routing it'll be this:
|
|
1081
|
+
// pages/[post]/comments.js
|
|
1082
|
+
// pages/blog/[post]/comment/[id].js
|
|
1083
|
+
// Both are fine because `pages/[post]` and `pages/blog` are on the same level
|
|
1084
|
+
// So in this case `UrlNode` created here has `this.slugName === 'post'`
|
|
1085
|
+
// And since your PR passed through `slugName` as an array basically it'd including it in too many possibilities
|
|
1086
|
+
// Instead what has to be passed through is the upwards path's dynamic names
|
|
1087
|
+
const root = new UrlNode();
|
|
1088
|
+
// Here the `root` gets injected multiple paths, and insert will break them up into sublevels
|
|
1089
|
+
normalizedPages.forEach((pagePath)=>root.insert(pagePath));
|
|
1090
|
+
// Smoosh will then sort those sublevels up to the point where you get the correct route definition priority
|
|
1091
|
+
return root.smoosh();
|
|
1092
|
+
}
|
|
1093
|
+
function getSortedRouteObjects(objects, getter) {
|
|
1094
|
+
// We're assuming here that all the pathnames are unique, that way we can
|
|
1095
|
+
// sort the list and use the index as the key.
|
|
1096
|
+
const indexes = {};
|
|
1097
|
+
const pathnames = [];
|
|
1098
|
+
for(let i = 0; i < objects.length; i++){
|
|
1099
|
+
const pathname = getter(objects[i]);
|
|
1100
|
+
indexes[pathname] = i;
|
|
1101
|
+
pathnames[i] = pathname;
|
|
1102
|
+
}
|
|
1103
|
+
// Sort the pathnames.
|
|
1104
|
+
const sorted = getSortedRoutes(pathnames);
|
|
1105
|
+
// Map the sorted pathnames back to the original objects using the new sorted
|
|
1106
|
+
// index.
|
|
1107
|
+
return sorted.map((pathname)=>objects[indexes[pathname]]);
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
|
|
1111
|
+
} (sortedRoutes));
|
|
1112
|
+
return sortedRoutes;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
var isDynamic = {};
|
|
1116
|
+
|
|
1117
|
+
var interceptionRoutes = {};
|
|
1118
|
+
|
|
1119
|
+
var appPaths = {};
|
|
1120
|
+
|
|
1121
|
+
var ensureLeadingSlash = {};
|
|
1122
|
+
|
|
1123
|
+
/**
|
|
1124
|
+
* For a given page path, this function ensures that there is a leading slash.
|
|
1125
|
+
* If there is not a leading slash, one is added, otherwise it is noop.
|
|
1126
|
+
*/
|
|
1127
|
+
|
|
1128
|
+
var hasRequiredEnsureLeadingSlash;
|
|
1129
|
+
|
|
1130
|
+
function requireEnsureLeadingSlash () {
|
|
1131
|
+
if (hasRequiredEnsureLeadingSlash) return ensureLeadingSlash;
|
|
1132
|
+
hasRequiredEnsureLeadingSlash = 1;
|
|
1133
|
+
(function (exports) {
|
|
1134
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1135
|
+
value: true
|
|
1136
|
+
});
|
|
1137
|
+
Object.defineProperty(exports, "ensureLeadingSlash", {
|
|
1138
|
+
enumerable: true,
|
|
1139
|
+
get: function() {
|
|
1140
|
+
return ensureLeadingSlash;
|
|
1141
|
+
}
|
|
1142
|
+
});
|
|
1143
|
+
function ensureLeadingSlash(path) {
|
|
1144
|
+
return path.startsWith('/') ? path : "/" + path;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
} (ensureLeadingSlash));
|
|
1149
|
+
return ensureLeadingSlash;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
var hasRequiredAppPaths;
|
|
1153
|
+
|
|
1154
|
+
function requireAppPaths () {
|
|
1155
|
+
if (hasRequiredAppPaths) return appPaths;
|
|
1156
|
+
hasRequiredAppPaths = 1;
|
|
1157
|
+
(function (exports) {
|
|
1158
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1159
|
+
value: true
|
|
1160
|
+
});
|
|
1161
|
+
function _export(target, all) {
|
|
1162
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1163
|
+
enumerable: true,
|
|
1164
|
+
get: all[name]
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
_export(exports, {
|
|
1168
|
+
normalizeAppPath: function() {
|
|
1169
|
+
return normalizeAppPath;
|
|
1170
|
+
},
|
|
1171
|
+
normalizeRscURL: function() {
|
|
1172
|
+
return normalizeRscURL;
|
|
1173
|
+
}
|
|
1174
|
+
});
|
|
1175
|
+
const _ensureleadingslash = requireEnsureLeadingSlash();
|
|
1176
|
+
const _segment = requireSegment();
|
|
1177
|
+
function normalizeAppPath(route) {
|
|
1178
|
+
return (0, _ensureleadingslash.ensureLeadingSlash)(route.split('/').reduce((pathname, segment, index, segments)=>{
|
|
1179
|
+
// Empty segments are ignored.
|
|
1180
|
+
if (!segment) {
|
|
1181
|
+
return pathname;
|
|
1182
|
+
}
|
|
1183
|
+
// Groups are ignored.
|
|
1184
|
+
if ((0, _segment.isGroupSegment)(segment)) {
|
|
1185
|
+
return pathname;
|
|
1186
|
+
}
|
|
1187
|
+
// Parallel segments are ignored.
|
|
1188
|
+
if (segment[0] === '@') {
|
|
1189
|
+
return pathname;
|
|
1190
|
+
}
|
|
1191
|
+
// The last segment (if it's a leaf) should be ignored.
|
|
1192
|
+
if ((segment === 'page' || segment === 'route') && index === segments.length - 1) {
|
|
1193
|
+
return pathname;
|
|
1194
|
+
}
|
|
1195
|
+
return pathname + "/" + segment;
|
|
1196
|
+
}, ''));
|
|
1197
|
+
}
|
|
1198
|
+
function normalizeRscURL(url) {
|
|
1199
|
+
return url.replace(/\.rsc($|\?)/, // $1 ensures `?` is preserved
|
|
1200
|
+
'$1');
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
} (appPaths));
|
|
1205
|
+
return appPaths;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
var hasRequiredInterceptionRoutes;
|
|
1209
|
+
|
|
1210
|
+
function requireInterceptionRoutes () {
|
|
1211
|
+
if (hasRequiredInterceptionRoutes) return interceptionRoutes;
|
|
1212
|
+
hasRequiredInterceptionRoutes = 1;
|
|
1213
|
+
(function (exports) {
|
|
1214
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1215
|
+
value: true
|
|
1216
|
+
});
|
|
1217
|
+
function _export(target, all) {
|
|
1218
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1219
|
+
enumerable: true,
|
|
1220
|
+
get: all[name]
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
_export(exports, {
|
|
1224
|
+
INTERCEPTION_ROUTE_MARKERS: function() {
|
|
1225
|
+
return INTERCEPTION_ROUTE_MARKERS;
|
|
1226
|
+
},
|
|
1227
|
+
extractInterceptionRouteInformation: function() {
|
|
1228
|
+
return extractInterceptionRouteInformation;
|
|
1229
|
+
},
|
|
1230
|
+
isInterceptionRouteAppPath: function() {
|
|
1231
|
+
return isInterceptionRouteAppPath;
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1234
|
+
const _apppaths = requireAppPaths();
|
|
1235
|
+
const INTERCEPTION_ROUTE_MARKERS = [
|
|
1236
|
+
'(..)(..)',
|
|
1237
|
+
'(.)',
|
|
1238
|
+
'(..)',
|
|
1239
|
+
'(...)'
|
|
1240
|
+
];
|
|
1241
|
+
function isInterceptionRouteAppPath(path) {
|
|
1242
|
+
// TODO-APP: add more serious validation
|
|
1243
|
+
return path.split('/').find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined;
|
|
1244
|
+
}
|
|
1245
|
+
function extractInterceptionRouteInformation(path) {
|
|
1246
|
+
let interceptingRoute, marker, interceptedRoute;
|
|
1247
|
+
for (const segment of path.split('/')){
|
|
1248
|
+
marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
|
|
1249
|
+
if (marker) {
|
|
1250
|
+
[interceptingRoute, interceptedRoute] = path.split(marker, 2);
|
|
1251
|
+
break;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
if (!interceptingRoute || !marker || !interceptedRoute) {
|
|
1255
|
+
throw Object.defineProperty(new Error("Invalid interception route: " + path + ". Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>"), "__NEXT_ERROR_CODE", {
|
|
1256
|
+
value: "E269",
|
|
1257
|
+
enumerable: false,
|
|
1258
|
+
configurable: true
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
interceptingRoute = (0, _apppaths.normalizeAppPath)(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed
|
|
1262
|
+
;
|
|
1263
|
+
switch(marker){
|
|
1264
|
+
case '(.)':
|
|
1265
|
+
// (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route
|
|
1266
|
+
if (interceptingRoute === '/') {
|
|
1267
|
+
interceptedRoute = "/" + interceptedRoute;
|
|
1268
|
+
} else {
|
|
1269
|
+
interceptedRoute = interceptingRoute + '/' + interceptedRoute;
|
|
1270
|
+
}
|
|
1271
|
+
break;
|
|
1272
|
+
case '(..)':
|
|
1273
|
+
// (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route
|
|
1274
|
+
if (interceptingRoute === '/') {
|
|
1275
|
+
throw Object.defineProperty(new Error("Invalid interception route: " + path + ". Cannot use (..) marker at the root level, use (.) instead."), "__NEXT_ERROR_CODE", {
|
|
1276
|
+
value: "E207",
|
|
1277
|
+
enumerable: false,
|
|
1278
|
+
configurable: true
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
interceptedRoute = interceptingRoute.split('/').slice(0, -1).concat(interceptedRoute).join('/');
|
|
1282
|
+
break;
|
|
1283
|
+
case '(...)':
|
|
1284
|
+
// (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route
|
|
1285
|
+
interceptedRoute = '/' + interceptedRoute;
|
|
1286
|
+
break;
|
|
1287
|
+
case '(..)(..)':
|
|
1288
|
+
// (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route
|
|
1289
|
+
const splitInterceptingRoute = interceptingRoute.split('/');
|
|
1290
|
+
if (splitInterceptingRoute.length <= 2) {
|
|
1291
|
+
throw Object.defineProperty(new Error("Invalid interception route: " + path + ". Cannot use (..)(..) marker at the root level or one level up."), "__NEXT_ERROR_CODE", {
|
|
1292
|
+
value: "E486",
|
|
1293
|
+
enumerable: false,
|
|
1294
|
+
configurable: true
|
|
1295
|
+
});
|
|
1296
|
+
}
|
|
1297
|
+
interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join('/');
|
|
1298
|
+
break;
|
|
1299
|
+
default:
|
|
1300
|
+
throw Object.defineProperty(new Error('Invariant: unexpected marker'), "__NEXT_ERROR_CODE", {
|
|
1301
|
+
value: "E112",
|
|
1302
|
+
enumerable: false,
|
|
1303
|
+
configurable: true
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
return {
|
|
1307
|
+
interceptingRoute,
|
|
1308
|
+
interceptedRoute
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
} (interceptionRoutes));
|
|
1314
|
+
return interceptionRoutes;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
var hasRequiredIsDynamic;
|
|
1318
|
+
|
|
1319
|
+
function requireIsDynamic () {
|
|
1320
|
+
if (hasRequiredIsDynamic) return isDynamic;
|
|
1321
|
+
hasRequiredIsDynamic = 1;
|
|
1322
|
+
(function (exports) {
|
|
1323
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1324
|
+
value: true
|
|
1325
|
+
});
|
|
1326
|
+
Object.defineProperty(exports, "isDynamicRoute", {
|
|
1327
|
+
enumerable: true,
|
|
1328
|
+
get: function() {
|
|
1329
|
+
return isDynamicRoute;
|
|
1330
|
+
}
|
|
1331
|
+
});
|
|
1332
|
+
const _interceptionroutes = requireInterceptionRoutes();
|
|
1333
|
+
// Identify /.*[param].*/ in route string
|
|
1334
|
+
const TEST_ROUTE = /\/[^/]*\[[^/]+\][^/]*(?=\/|$)/;
|
|
1335
|
+
// Identify /[param]/ in route string
|
|
1336
|
+
const TEST_STRICT_ROUTE = /\/\[[^/]+\](?=\/|$)/;
|
|
1337
|
+
function isDynamicRoute(route, strict) {
|
|
1338
|
+
if (strict === void 0) strict = true;
|
|
1339
|
+
if ((0, _interceptionroutes.isInterceptionRouteAppPath)(route)) {
|
|
1340
|
+
route = (0, _interceptionroutes.extractInterceptionRouteInformation)(route).interceptedRoute;
|
|
1341
|
+
}
|
|
1342
|
+
if (strict) {
|
|
1343
|
+
return TEST_STRICT_ROUTE.test(route);
|
|
1344
|
+
}
|
|
1345
|
+
return TEST_ROUTE.test(route);
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
} (isDynamic));
|
|
1350
|
+
return isDynamic;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
var hasRequiredUtils;
|
|
1354
|
+
|
|
1355
|
+
function requireUtils () {
|
|
1356
|
+
if (hasRequiredUtils) return utils;
|
|
1357
|
+
hasRequiredUtils = 1;
|
|
1358
|
+
(function (exports) {
|
|
1359
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1360
|
+
value: true
|
|
1361
|
+
});
|
|
1362
|
+
function _export(target, all) {
|
|
1363
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1364
|
+
enumerable: true,
|
|
1365
|
+
get: all[name]
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
_export(exports, {
|
|
1369
|
+
getSortedRouteObjects: function() {
|
|
1370
|
+
return _sortedroutes.getSortedRouteObjects;
|
|
1371
|
+
},
|
|
1372
|
+
getSortedRoutes: function() {
|
|
1373
|
+
return _sortedroutes.getSortedRoutes;
|
|
1374
|
+
},
|
|
1375
|
+
isDynamicRoute: function() {
|
|
1376
|
+
return _isdynamic.isDynamicRoute;
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1379
|
+
const _sortedroutes = requireSortedRoutes();
|
|
1380
|
+
const _isdynamic = requireIsDynamic();
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
} (utils));
|
|
1384
|
+
return utils;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
var interpolateAs = {};
|
|
1388
|
+
|
|
1389
|
+
var routeMatcher = {};
|
|
1390
|
+
|
|
1391
|
+
var hasRequiredRouteMatcher;
|
|
1392
|
+
|
|
1393
|
+
function requireRouteMatcher () {
|
|
1394
|
+
if (hasRequiredRouteMatcher) return routeMatcher;
|
|
1395
|
+
hasRequiredRouteMatcher = 1;
|
|
1396
|
+
(function (exports) {
|
|
1397
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1398
|
+
value: true
|
|
1399
|
+
});
|
|
1400
|
+
Object.defineProperty(exports, "getRouteMatcher", {
|
|
1401
|
+
enumerable: true,
|
|
1402
|
+
get: function() {
|
|
1403
|
+
return getRouteMatcher;
|
|
1404
|
+
}
|
|
1405
|
+
});
|
|
1406
|
+
const _utils = requireUtils$1();
|
|
1407
|
+
function getRouteMatcher(param) {
|
|
1408
|
+
let { re, groups } = param;
|
|
1409
|
+
return (pathname)=>{
|
|
1410
|
+
const routeMatch = re.exec(pathname);
|
|
1411
|
+
if (!routeMatch) return false;
|
|
1412
|
+
const decode = (param)=>{
|
|
1413
|
+
try {
|
|
1414
|
+
return decodeURIComponent(param);
|
|
1415
|
+
} catch (e) {
|
|
1416
|
+
throw Object.defineProperty(new _utils.DecodeError('failed to decode param'), "__NEXT_ERROR_CODE", {
|
|
1417
|
+
value: "E528",
|
|
1418
|
+
enumerable: false,
|
|
1419
|
+
configurable: true
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
const params = {};
|
|
1424
|
+
for (const [key, group] of Object.entries(groups)){
|
|
1425
|
+
const match = routeMatch[group.pos];
|
|
1426
|
+
if (match !== undefined) {
|
|
1427
|
+
if (group.repeat) {
|
|
1428
|
+
params[key] = match.split('/').map((entry)=>decode(entry));
|
|
1429
|
+
} else {
|
|
1430
|
+
params[key] = decode(match);
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
return params;
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
} (routeMatcher));
|
|
1440
|
+
return routeMatcher;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
var routeRegex = {};
|
|
1444
|
+
|
|
1445
|
+
var constants = {};
|
|
1446
|
+
|
|
1447
|
+
var hasRequiredConstants;
|
|
1448
|
+
|
|
1449
|
+
function requireConstants () {
|
|
1450
|
+
if (hasRequiredConstants) return constants;
|
|
1451
|
+
hasRequiredConstants = 1;
|
|
1452
|
+
(function (exports) {
|
|
1453
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1454
|
+
value: true
|
|
1455
|
+
});
|
|
1456
|
+
function _export(target, all) {
|
|
1457
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1458
|
+
enumerable: true,
|
|
1459
|
+
get: all[name]
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
_export(exports, {
|
|
1463
|
+
ACTION_SUFFIX: function() {
|
|
1464
|
+
return ACTION_SUFFIX;
|
|
1465
|
+
},
|
|
1466
|
+
APP_DIR_ALIAS: function() {
|
|
1467
|
+
return APP_DIR_ALIAS;
|
|
1468
|
+
},
|
|
1469
|
+
CACHE_ONE_YEAR: function() {
|
|
1470
|
+
return CACHE_ONE_YEAR;
|
|
1471
|
+
},
|
|
1472
|
+
DOT_NEXT_ALIAS: function() {
|
|
1473
|
+
return DOT_NEXT_ALIAS;
|
|
1474
|
+
},
|
|
1475
|
+
ESLINT_DEFAULT_DIRS: function() {
|
|
1476
|
+
return ESLINT_DEFAULT_DIRS;
|
|
1477
|
+
},
|
|
1478
|
+
GSP_NO_RETURNED_VALUE: function() {
|
|
1479
|
+
return GSP_NO_RETURNED_VALUE;
|
|
1480
|
+
},
|
|
1481
|
+
GSSP_COMPONENT_MEMBER_ERROR: function() {
|
|
1482
|
+
return GSSP_COMPONENT_MEMBER_ERROR;
|
|
1483
|
+
},
|
|
1484
|
+
GSSP_NO_RETURNED_VALUE: function() {
|
|
1485
|
+
return GSSP_NO_RETURNED_VALUE;
|
|
1486
|
+
},
|
|
1487
|
+
INFINITE_CACHE: function() {
|
|
1488
|
+
return INFINITE_CACHE;
|
|
1489
|
+
},
|
|
1490
|
+
INSTRUMENTATION_HOOK_FILENAME: function() {
|
|
1491
|
+
return INSTRUMENTATION_HOOK_FILENAME;
|
|
1492
|
+
},
|
|
1493
|
+
MATCHED_PATH_HEADER: function() {
|
|
1494
|
+
return MATCHED_PATH_HEADER;
|
|
1495
|
+
},
|
|
1496
|
+
MIDDLEWARE_FILENAME: function() {
|
|
1497
|
+
return MIDDLEWARE_FILENAME;
|
|
1498
|
+
},
|
|
1499
|
+
MIDDLEWARE_LOCATION_REGEXP: function() {
|
|
1500
|
+
return MIDDLEWARE_LOCATION_REGEXP;
|
|
1501
|
+
},
|
|
1502
|
+
NEXT_BODY_SUFFIX: function() {
|
|
1503
|
+
return NEXT_BODY_SUFFIX;
|
|
1504
|
+
},
|
|
1505
|
+
NEXT_CACHE_IMPLICIT_TAG_ID: function() {
|
|
1506
|
+
return NEXT_CACHE_IMPLICIT_TAG_ID;
|
|
1507
|
+
},
|
|
1508
|
+
NEXT_CACHE_REVALIDATED_TAGS_HEADER: function() {
|
|
1509
|
+
return NEXT_CACHE_REVALIDATED_TAGS_HEADER;
|
|
1510
|
+
},
|
|
1511
|
+
NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: function() {
|
|
1512
|
+
return NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER;
|
|
1513
|
+
},
|
|
1514
|
+
NEXT_CACHE_SOFT_TAG_MAX_LENGTH: function() {
|
|
1515
|
+
return NEXT_CACHE_SOFT_TAG_MAX_LENGTH;
|
|
1516
|
+
},
|
|
1517
|
+
NEXT_CACHE_TAGS_HEADER: function() {
|
|
1518
|
+
return NEXT_CACHE_TAGS_HEADER;
|
|
1519
|
+
},
|
|
1520
|
+
NEXT_CACHE_TAG_MAX_ITEMS: function() {
|
|
1521
|
+
return NEXT_CACHE_TAG_MAX_ITEMS;
|
|
1522
|
+
},
|
|
1523
|
+
NEXT_CACHE_TAG_MAX_LENGTH: function() {
|
|
1524
|
+
return NEXT_CACHE_TAG_MAX_LENGTH;
|
|
1525
|
+
},
|
|
1526
|
+
NEXT_DATA_SUFFIX: function() {
|
|
1527
|
+
return NEXT_DATA_SUFFIX;
|
|
1528
|
+
},
|
|
1529
|
+
NEXT_INTERCEPTION_MARKER_PREFIX: function() {
|
|
1530
|
+
return NEXT_INTERCEPTION_MARKER_PREFIX;
|
|
1531
|
+
},
|
|
1532
|
+
NEXT_META_SUFFIX: function() {
|
|
1533
|
+
return NEXT_META_SUFFIX;
|
|
1534
|
+
},
|
|
1535
|
+
NEXT_QUERY_PARAM_PREFIX: function() {
|
|
1536
|
+
return NEXT_QUERY_PARAM_PREFIX;
|
|
1537
|
+
},
|
|
1538
|
+
NEXT_RESUME_HEADER: function() {
|
|
1539
|
+
return NEXT_RESUME_HEADER;
|
|
1540
|
+
},
|
|
1541
|
+
NON_STANDARD_NODE_ENV: function() {
|
|
1542
|
+
return NON_STANDARD_NODE_ENV;
|
|
1543
|
+
},
|
|
1544
|
+
PAGES_DIR_ALIAS: function() {
|
|
1545
|
+
return PAGES_DIR_ALIAS;
|
|
1546
|
+
},
|
|
1547
|
+
PRERENDER_REVALIDATE_HEADER: function() {
|
|
1548
|
+
return PRERENDER_REVALIDATE_HEADER;
|
|
1549
|
+
},
|
|
1550
|
+
PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: function() {
|
|
1551
|
+
return PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER;
|
|
1552
|
+
},
|
|
1553
|
+
PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {
|
|
1554
|
+
return PUBLIC_DIR_MIDDLEWARE_CONFLICT;
|
|
1555
|
+
},
|
|
1556
|
+
ROOT_DIR_ALIAS: function() {
|
|
1557
|
+
return ROOT_DIR_ALIAS;
|
|
1558
|
+
},
|
|
1559
|
+
RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {
|
|
1560
|
+
return RSC_ACTION_CLIENT_WRAPPER_ALIAS;
|
|
1561
|
+
},
|
|
1562
|
+
RSC_ACTION_ENCRYPTION_ALIAS: function() {
|
|
1563
|
+
return RSC_ACTION_ENCRYPTION_ALIAS;
|
|
1564
|
+
},
|
|
1565
|
+
RSC_ACTION_PROXY_ALIAS: function() {
|
|
1566
|
+
return RSC_ACTION_PROXY_ALIAS;
|
|
1567
|
+
},
|
|
1568
|
+
RSC_ACTION_VALIDATE_ALIAS: function() {
|
|
1569
|
+
return RSC_ACTION_VALIDATE_ALIAS;
|
|
1570
|
+
},
|
|
1571
|
+
RSC_CACHE_WRAPPER_ALIAS: function() {
|
|
1572
|
+
return RSC_CACHE_WRAPPER_ALIAS;
|
|
1573
|
+
},
|
|
1574
|
+
RSC_MOD_REF_PROXY_ALIAS: function() {
|
|
1575
|
+
return RSC_MOD_REF_PROXY_ALIAS;
|
|
1576
|
+
},
|
|
1577
|
+
RSC_PREFETCH_SUFFIX: function() {
|
|
1578
|
+
return RSC_PREFETCH_SUFFIX;
|
|
1579
|
+
},
|
|
1580
|
+
RSC_SEGMENTS_DIR_SUFFIX: function() {
|
|
1581
|
+
return RSC_SEGMENTS_DIR_SUFFIX;
|
|
1582
|
+
},
|
|
1583
|
+
RSC_SEGMENT_SUFFIX: function() {
|
|
1584
|
+
return RSC_SEGMENT_SUFFIX;
|
|
1585
|
+
},
|
|
1586
|
+
RSC_SUFFIX: function() {
|
|
1587
|
+
return RSC_SUFFIX;
|
|
1588
|
+
},
|
|
1589
|
+
SERVER_PROPS_EXPORT_ERROR: function() {
|
|
1590
|
+
return SERVER_PROPS_EXPORT_ERROR;
|
|
1591
|
+
},
|
|
1592
|
+
SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {
|
|
1593
|
+
return SERVER_PROPS_GET_INIT_PROPS_CONFLICT;
|
|
1594
|
+
},
|
|
1595
|
+
SERVER_PROPS_SSG_CONFLICT: function() {
|
|
1596
|
+
return SERVER_PROPS_SSG_CONFLICT;
|
|
1597
|
+
},
|
|
1598
|
+
SERVER_RUNTIME: function() {
|
|
1599
|
+
return SERVER_RUNTIME;
|
|
1600
|
+
},
|
|
1601
|
+
SSG_FALLBACK_EXPORT_ERROR: function() {
|
|
1602
|
+
return SSG_FALLBACK_EXPORT_ERROR;
|
|
1603
|
+
},
|
|
1604
|
+
SSG_GET_INITIAL_PROPS_CONFLICT: function() {
|
|
1605
|
+
return SSG_GET_INITIAL_PROPS_CONFLICT;
|
|
1606
|
+
},
|
|
1607
|
+
STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {
|
|
1608
|
+
return STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR;
|
|
1609
|
+
},
|
|
1610
|
+
UNSTABLE_REVALIDATE_RENAME_ERROR: function() {
|
|
1611
|
+
return UNSTABLE_REVALIDATE_RENAME_ERROR;
|
|
1612
|
+
},
|
|
1613
|
+
WEBPACK_LAYERS: function() {
|
|
1614
|
+
return WEBPACK_LAYERS;
|
|
1615
|
+
},
|
|
1616
|
+
WEBPACK_RESOURCE_QUERIES: function() {
|
|
1617
|
+
return WEBPACK_RESOURCE_QUERIES;
|
|
1618
|
+
}
|
|
1619
|
+
});
|
|
1620
|
+
const NEXT_QUERY_PARAM_PREFIX = 'nxtP';
|
|
1621
|
+
const NEXT_INTERCEPTION_MARKER_PREFIX = 'nxtI';
|
|
1622
|
+
const MATCHED_PATH_HEADER = 'x-matched-path';
|
|
1623
|
+
const PRERENDER_REVALIDATE_HEADER = 'x-prerender-revalidate';
|
|
1624
|
+
const PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = 'x-prerender-revalidate-if-generated';
|
|
1625
|
+
const RSC_PREFETCH_SUFFIX = '.prefetch.rsc';
|
|
1626
|
+
const RSC_SEGMENTS_DIR_SUFFIX = '.segments';
|
|
1627
|
+
const RSC_SEGMENT_SUFFIX = '.segment.rsc';
|
|
1628
|
+
const RSC_SUFFIX = '.rsc';
|
|
1629
|
+
const ACTION_SUFFIX = '.action';
|
|
1630
|
+
const NEXT_DATA_SUFFIX = '.json';
|
|
1631
|
+
const NEXT_META_SUFFIX = '.meta';
|
|
1632
|
+
const NEXT_BODY_SUFFIX = '.body';
|
|
1633
|
+
const NEXT_CACHE_TAGS_HEADER = 'x-next-cache-tags';
|
|
1634
|
+
const NEXT_CACHE_REVALIDATED_TAGS_HEADER = 'x-next-revalidated-tags';
|
|
1635
|
+
const NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = 'x-next-revalidate-tag-token';
|
|
1636
|
+
const NEXT_RESUME_HEADER = 'next-resume';
|
|
1637
|
+
const NEXT_CACHE_TAG_MAX_ITEMS = 128;
|
|
1638
|
+
const NEXT_CACHE_TAG_MAX_LENGTH = 256;
|
|
1639
|
+
const NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;
|
|
1640
|
+
const NEXT_CACHE_IMPLICIT_TAG_ID = '_N_T_';
|
|
1641
|
+
const CACHE_ONE_YEAR = 31536000;
|
|
1642
|
+
const INFINITE_CACHE = 0xfffffffe;
|
|
1643
|
+
const MIDDLEWARE_FILENAME = 'middleware';
|
|
1644
|
+
const MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;
|
|
1645
|
+
const INSTRUMENTATION_HOOK_FILENAME = 'instrumentation';
|
|
1646
|
+
const PAGES_DIR_ALIAS = 'private-next-pages';
|
|
1647
|
+
const DOT_NEXT_ALIAS = 'private-dot-next';
|
|
1648
|
+
const ROOT_DIR_ALIAS = 'private-next-root-dir';
|
|
1649
|
+
const APP_DIR_ALIAS = 'private-next-app-dir';
|
|
1650
|
+
const RSC_MOD_REF_PROXY_ALIAS = 'private-next-rsc-mod-ref-proxy';
|
|
1651
|
+
const RSC_ACTION_VALIDATE_ALIAS = 'private-next-rsc-action-validate';
|
|
1652
|
+
const RSC_ACTION_PROXY_ALIAS = 'private-next-rsc-server-reference';
|
|
1653
|
+
const RSC_CACHE_WRAPPER_ALIAS = 'private-next-rsc-cache-wrapper';
|
|
1654
|
+
const RSC_ACTION_ENCRYPTION_ALIAS = 'private-next-rsc-action-encryption';
|
|
1655
|
+
const RSC_ACTION_CLIENT_WRAPPER_ALIAS = 'private-next-rsc-action-client-wrapper';
|
|
1656
|
+
const 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`;
|
|
1657
|
+
const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;
|
|
1658
|
+
const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;
|
|
1659
|
+
const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;
|
|
1660
|
+
const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;
|
|
1661
|
+
const SERVER_PROPS_EXPORT_ERROR = `pages with \`getServerSideProps\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;
|
|
1662
|
+
const GSP_NO_RETURNED_VALUE = 'Your `getStaticProps` function did not return an object. Did you forget to add a `return`?';
|
|
1663
|
+
const GSSP_NO_RETURNED_VALUE = 'Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?';
|
|
1664
|
+
const UNSTABLE_REVALIDATE_RENAME_ERROR = 'The `unstable_revalidate` property is available for general use.\n' + 'Please use `revalidate` instead.';
|
|
1665
|
+
const 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`;
|
|
1666
|
+
const 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`;
|
|
1667
|
+
const 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`;
|
|
1668
|
+
const ESLINT_DEFAULT_DIRS = [
|
|
1669
|
+
'app',
|
|
1670
|
+
'pages',
|
|
1671
|
+
'components',
|
|
1672
|
+
'lib',
|
|
1673
|
+
'src'
|
|
1674
|
+
];
|
|
1675
|
+
const SERVER_RUNTIME = {
|
|
1676
|
+
edge: 'edge',
|
|
1677
|
+
experimentalEdge: 'experimental-edge',
|
|
1678
|
+
nodejs: 'nodejs'
|
|
1679
|
+
};
|
|
1680
|
+
/**
|
|
1681
|
+
* The names of the webpack layers. These layers are the primitives for the
|
|
1682
|
+
* webpack chunks.
|
|
1683
|
+
*/ const WEBPACK_LAYERS_NAMES = {
|
|
1684
|
+
/**
|
|
1685
|
+
* The layer for the shared code between the client and server bundles.
|
|
1686
|
+
*/ shared: 'shared',
|
|
1687
|
+
/**
|
|
1688
|
+
* The layer for server-only runtime and picking up `react-server` export conditions.
|
|
1689
|
+
* Including app router RSC pages and app router custom routes and metadata routes.
|
|
1690
|
+
*/ reactServerComponents: 'rsc',
|
|
1691
|
+
/**
|
|
1692
|
+
* Server Side Rendering layer for app (ssr).
|
|
1693
|
+
*/ serverSideRendering: 'ssr',
|
|
1694
|
+
/**
|
|
1695
|
+
* The browser client bundle layer for actions.
|
|
1696
|
+
*/ actionBrowser: 'action-browser',
|
|
1697
|
+
/**
|
|
1698
|
+
* The Node.js bundle layer for the API routes.
|
|
1699
|
+
*/ apiNode: 'api-node',
|
|
1700
|
+
/**
|
|
1701
|
+
* The Edge Lite bundle layer for the API routes.
|
|
1702
|
+
*/ apiEdge: 'api-edge',
|
|
1703
|
+
/**
|
|
1704
|
+
* The layer for the middleware code.
|
|
1705
|
+
*/ middleware: 'middleware',
|
|
1706
|
+
/**
|
|
1707
|
+
* The layer for the instrumentation hooks.
|
|
1708
|
+
*/ instrument: 'instrument',
|
|
1709
|
+
/**
|
|
1710
|
+
* The layer for assets on the edge.
|
|
1711
|
+
*/ edgeAsset: 'edge-asset',
|
|
1712
|
+
/**
|
|
1713
|
+
* The browser client bundle layer for App directory.
|
|
1714
|
+
*/ appPagesBrowser: 'app-pages-browser',
|
|
1715
|
+
/**
|
|
1716
|
+
* The browser client bundle layer for Pages directory.
|
|
1717
|
+
*/ pagesDirBrowser: 'pages-dir-browser',
|
|
1718
|
+
/**
|
|
1719
|
+
* The Edge Lite bundle layer for Pages directory.
|
|
1720
|
+
*/ pagesDirEdge: 'pages-dir-edge',
|
|
1721
|
+
/**
|
|
1722
|
+
* The Node.js bundle layer for Pages directory.
|
|
1723
|
+
*/ pagesDirNode: 'pages-dir-node'
|
|
1724
|
+
};
|
|
1725
|
+
const WEBPACK_LAYERS = {
|
|
1726
|
+
...WEBPACK_LAYERS_NAMES,
|
|
1727
|
+
GROUP: {
|
|
1728
|
+
builtinReact: [
|
|
1729
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
1730
|
+
WEBPACK_LAYERS_NAMES.actionBrowser
|
|
1731
|
+
],
|
|
1732
|
+
serverOnly: [
|
|
1733
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
1734
|
+
WEBPACK_LAYERS_NAMES.actionBrowser,
|
|
1735
|
+
WEBPACK_LAYERS_NAMES.instrument,
|
|
1736
|
+
WEBPACK_LAYERS_NAMES.middleware
|
|
1737
|
+
],
|
|
1738
|
+
neutralTarget: [
|
|
1739
|
+
// pages api
|
|
1740
|
+
WEBPACK_LAYERS_NAMES.apiNode,
|
|
1741
|
+
WEBPACK_LAYERS_NAMES.apiEdge
|
|
1742
|
+
],
|
|
1743
|
+
clientOnly: [
|
|
1744
|
+
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
|
1745
|
+
WEBPACK_LAYERS_NAMES.appPagesBrowser
|
|
1746
|
+
],
|
|
1747
|
+
bundled: [
|
|
1748
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
1749
|
+
WEBPACK_LAYERS_NAMES.actionBrowser,
|
|
1750
|
+
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
|
1751
|
+
WEBPACK_LAYERS_NAMES.appPagesBrowser,
|
|
1752
|
+
WEBPACK_LAYERS_NAMES.shared,
|
|
1753
|
+
WEBPACK_LAYERS_NAMES.instrument,
|
|
1754
|
+
WEBPACK_LAYERS_NAMES.middleware
|
|
1755
|
+
],
|
|
1756
|
+
appPages: [
|
|
1757
|
+
// app router pages and layouts
|
|
1758
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
1759
|
+
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
|
1760
|
+
WEBPACK_LAYERS_NAMES.appPagesBrowser,
|
|
1761
|
+
WEBPACK_LAYERS_NAMES.actionBrowser
|
|
1762
|
+
]
|
|
1763
|
+
}
|
|
1764
|
+
};
|
|
1765
|
+
const WEBPACK_RESOURCE_QUERIES = {
|
|
1766
|
+
edgeSSREntry: '__next_edge_ssr_entry__',
|
|
1767
|
+
metadata: '__next_metadata__',
|
|
1768
|
+
metadataRoute: '__next_metadata_route__',
|
|
1769
|
+
metadataImageMeta: '__next_metadata_image_meta__'
|
|
1770
|
+
};
|
|
1771
|
+
|
|
1772
|
+
|
|
1773
|
+
} (constants));
|
|
1774
|
+
return constants;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
var escapeRegexp = {};
|
|
1778
|
+
|
|
1779
|
+
var hasRequiredEscapeRegexp;
|
|
1780
|
+
|
|
1781
|
+
function requireEscapeRegexp () {
|
|
1782
|
+
if (hasRequiredEscapeRegexp) return escapeRegexp;
|
|
1783
|
+
hasRequiredEscapeRegexp = 1;
|
|
1784
|
+
(function (exports) {
|
|
1785
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1786
|
+
value: true
|
|
1787
|
+
});
|
|
1788
|
+
Object.defineProperty(exports, "escapeStringRegexp", {
|
|
1789
|
+
enumerable: true,
|
|
1790
|
+
get: function() {
|
|
1791
|
+
return escapeStringRegexp;
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
const reHasRegExp = /[|\\{}()[\]^$+*?.-]/;
|
|
1795
|
+
const reReplaceRegExp = /[|\\{}()[\]^$+*?.-]/g;
|
|
1796
|
+
function escapeStringRegexp(str) {
|
|
1797
|
+
// see also: https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/escapeRegExp.js#L23
|
|
1798
|
+
if (reHasRegExp.test(str)) {
|
|
1799
|
+
return str.replace(reReplaceRegExp, '\\$&');
|
|
1800
|
+
}
|
|
1801
|
+
return str;
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
|
|
1805
|
+
} (escapeRegexp));
|
|
1806
|
+
return escapeRegexp;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
var hasRequiredRouteRegex;
|
|
1810
|
+
|
|
1811
|
+
function requireRouteRegex () {
|
|
1812
|
+
if (hasRequiredRouteRegex) return routeRegex;
|
|
1813
|
+
hasRequiredRouteRegex = 1;
|
|
1814
|
+
(function (exports) {
|
|
1815
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1816
|
+
value: true
|
|
1817
|
+
});
|
|
1818
|
+
function _export(target, all) {
|
|
1819
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1820
|
+
enumerable: true,
|
|
1821
|
+
get: all[name]
|
|
1822
|
+
});
|
|
1823
|
+
}
|
|
1824
|
+
_export(exports, {
|
|
1825
|
+
getNamedMiddlewareRegex: function() {
|
|
1826
|
+
return getNamedMiddlewareRegex;
|
|
1827
|
+
},
|
|
1828
|
+
getNamedRouteRegex: function() {
|
|
1829
|
+
return getNamedRouteRegex;
|
|
1830
|
+
},
|
|
1831
|
+
getRouteRegex: function() {
|
|
1832
|
+
return getRouteRegex;
|
|
1833
|
+
},
|
|
1834
|
+
parseParameter: function() {
|
|
1835
|
+
return parseParameter;
|
|
1836
|
+
}
|
|
1837
|
+
});
|
|
1838
|
+
const _constants = requireConstants();
|
|
1839
|
+
const _interceptionroutes = requireInterceptionRoutes();
|
|
1840
|
+
const _escaperegexp = requireEscapeRegexp();
|
|
1841
|
+
const _removetrailingslash = requireRemoveTrailingSlash();
|
|
1842
|
+
/**
|
|
1843
|
+
* Regular expression pattern used to match route parameters.
|
|
1844
|
+
* Matches both single parameters and parameter groups.
|
|
1845
|
+
* Examples:
|
|
1846
|
+
* - `[[...slug]]` matches parameter group with key 'slug', repeat: true, optional: true
|
|
1847
|
+
* - `[...slug]` matches parameter group with key 'slug', repeat: true, optional: false
|
|
1848
|
+
* - `[[foo]]` matches parameter with key 'foo', repeat: false, optional: true
|
|
1849
|
+
* - `[bar]` matches parameter with key 'bar', repeat: false, optional: false
|
|
1850
|
+
*/ const PARAMETER_PATTERN = /^([^[]*)\[((?:\[[^\]]*\])|[^\]]+)\](.*)$/;
|
|
1851
|
+
function parseParameter(param) {
|
|
1852
|
+
const match = param.match(PARAMETER_PATTERN);
|
|
1853
|
+
if (!match) {
|
|
1854
|
+
return parseMatchedParameter(param);
|
|
1855
|
+
}
|
|
1856
|
+
return parseMatchedParameter(match[2]);
|
|
1857
|
+
}
|
|
1858
|
+
/**
|
|
1859
|
+
* Parses a matched parameter from the PARAMETER_PATTERN regex to a data structure that can be used
|
|
1860
|
+
* to generate the parametrized route.
|
|
1861
|
+
* Examples:
|
|
1862
|
+
* - `[...slug]` -> `{ key: 'slug', repeat: true, optional: true }`
|
|
1863
|
+
* - `...slug` -> `{ key: 'slug', repeat: true, optional: false }`
|
|
1864
|
+
* - `[foo]` -> `{ key: 'foo', repeat: false, optional: true }`
|
|
1865
|
+
* - `bar` -> `{ key: 'bar', repeat: false, optional: false }`
|
|
1866
|
+
* @param param - The matched parameter to parse.
|
|
1867
|
+
* @returns The parsed parameter as a data structure.
|
|
1868
|
+
*/ function parseMatchedParameter(param) {
|
|
1869
|
+
const optional = param.startsWith('[') && param.endsWith(']');
|
|
1870
|
+
if (optional) {
|
|
1871
|
+
param = param.slice(1, -1);
|
|
1872
|
+
}
|
|
1873
|
+
const repeat = param.startsWith('...');
|
|
1874
|
+
if (repeat) {
|
|
1875
|
+
param = param.slice(3);
|
|
1876
|
+
}
|
|
1877
|
+
return {
|
|
1878
|
+
key: param,
|
|
1879
|
+
repeat,
|
|
1880
|
+
optional
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
function getParametrizedRoute(route, includeSuffix, includePrefix) {
|
|
1884
|
+
const groups = {};
|
|
1885
|
+
let groupIndex = 1;
|
|
1886
|
+
const segments = [];
|
|
1887
|
+
for (const segment of (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split('/')){
|
|
1888
|
+
const markerMatch = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
|
|
1889
|
+
const paramMatches = segment.match(PARAMETER_PATTERN) // Check for parameters
|
|
1890
|
+
;
|
|
1891
|
+
if (markerMatch && paramMatches && paramMatches[2]) {
|
|
1892
|
+
const { key, optional, repeat } = parseMatchedParameter(paramMatches[2]);
|
|
1893
|
+
groups[key] = {
|
|
1894
|
+
pos: groupIndex++,
|
|
1895
|
+
repeat,
|
|
1896
|
+
optional
|
|
1897
|
+
};
|
|
1898
|
+
segments.push("/" + (0, _escaperegexp.escapeStringRegexp)(markerMatch) + "([^/]+?)");
|
|
1899
|
+
} else if (paramMatches && paramMatches[2]) {
|
|
1900
|
+
const { key, repeat, optional } = parseMatchedParameter(paramMatches[2]);
|
|
1901
|
+
groups[key] = {
|
|
1902
|
+
pos: groupIndex++,
|
|
1903
|
+
repeat,
|
|
1904
|
+
optional
|
|
1905
|
+
};
|
|
1906
|
+
if (includePrefix && paramMatches[1]) {
|
|
1907
|
+
segments.push("/" + (0, _escaperegexp.escapeStringRegexp)(paramMatches[1]));
|
|
1908
|
+
}
|
|
1909
|
+
let s = repeat ? optional ? '(?:/(.+?))?' : '/(.+?)' : '/([^/]+?)';
|
|
1910
|
+
// Remove the leading slash if includePrefix already added it.
|
|
1911
|
+
if (includePrefix && paramMatches[1]) {
|
|
1912
|
+
s = s.substring(1);
|
|
1913
|
+
}
|
|
1914
|
+
segments.push(s);
|
|
1915
|
+
} else {
|
|
1916
|
+
segments.push("/" + (0, _escaperegexp.escapeStringRegexp)(segment));
|
|
1917
|
+
}
|
|
1918
|
+
// If there's a suffix, add it to the segments if it's enabled.
|
|
1919
|
+
if (includeSuffix && paramMatches && paramMatches[3]) {
|
|
1920
|
+
segments.push((0, _escaperegexp.escapeStringRegexp)(paramMatches[3]));
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
return {
|
|
1924
|
+
parameterizedRoute: segments.join(''),
|
|
1925
|
+
groups
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
function getRouteRegex(normalizedRoute, param) {
|
|
1929
|
+
let { includeSuffix = false, includePrefix = false, excludeOptionalTrailingSlash = false } = param === void 0 ? {} : param;
|
|
1930
|
+
const { parameterizedRoute, groups } = getParametrizedRoute(normalizedRoute, includeSuffix, includePrefix);
|
|
1931
|
+
let re = parameterizedRoute;
|
|
1932
|
+
if (!excludeOptionalTrailingSlash) {
|
|
1933
|
+
re += '(?:/)?';
|
|
1934
|
+
}
|
|
1935
|
+
return {
|
|
1936
|
+
re: new RegExp("^" + re + "$"),
|
|
1937
|
+
groups: groups
|
|
1938
|
+
};
|
|
1939
|
+
}
|
|
1940
|
+
/**
|
|
1941
|
+
* Builds a function to generate a minimal routeKey using only a-z and minimal
|
|
1942
|
+
* number of characters.
|
|
1943
|
+
*/ function buildGetSafeRouteKey() {
|
|
1944
|
+
let i = 0;
|
|
1945
|
+
return ()=>{
|
|
1946
|
+
let routeKey = '';
|
|
1947
|
+
let j = ++i;
|
|
1948
|
+
while(j > 0){
|
|
1949
|
+
routeKey += String.fromCharCode(97 + (j - 1) % 26);
|
|
1950
|
+
j = Math.floor((j - 1) / 26);
|
|
1951
|
+
}
|
|
1952
|
+
return routeKey;
|
|
1953
|
+
};
|
|
1954
|
+
}
|
|
1955
|
+
function getSafeKeyFromSegment(param) {
|
|
1956
|
+
let { interceptionMarker, getSafeRouteKey, segment, routeKeys, keyPrefix, backreferenceDuplicateKeys } = param;
|
|
1957
|
+
const { key, optional, repeat } = parseMatchedParameter(segment);
|
|
1958
|
+
// replace any non-word characters since they can break
|
|
1959
|
+
// the named regex
|
|
1960
|
+
let cleanedKey = key.replace(/\W/g, '');
|
|
1961
|
+
if (keyPrefix) {
|
|
1962
|
+
cleanedKey = "" + keyPrefix + cleanedKey;
|
|
1963
|
+
}
|
|
1964
|
+
let invalidKey = false;
|
|
1965
|
+
// check if the key is still invalid and fallback to using a known
|
|
1966
|
+
// safe key
|
|
1967
|
+
if (cleanedKey.length === 0 || cleanedKey.length > 30) {
|
|
1968
|
+
invalidKey = true;
|
|
1969
|
+
}
|
|
1970
|
+
if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) {
|
|
1971
|
+
invalidKey = true;
|
|
1972
|
+
}
|
|
1973
|
+
if (invalidKey) {
|
|
1974
|
+
cleanedKey = getSafeRouteKey();
|
|
1975
|
+
}
|
|
1976
|
+
const duplicateKey = cleanedKey in routeKeys;
|
|
1977
|
+
if (keyPrefix) {
|
|
1978
|
+
routeKeys[cleanedKey] = "" + keyPrefix + key;
|
|
1979
|
+
} else {
|
|
1980
|
+
routeKeys[cleanedKey] = key;
|
|
1981
|
+
}
|
|
1982
|
+
// if the segment has an interception marker, make sure that's part of the regex pattern
|
|
1983
|
+
// this is to ensure that the route with the interception marker doesn't incorrectly match
|
|
1984
|
+
// the non-intercepted route (ie /app/(.)[username] should not match /app/[username])
|
|
1985
|
+
const interceptionPrefix = interceptionMarker ? (0, _escaperegexp.escapeStringRegexp)(interceptionMarker) : '';
|
|
1986
|
+
let pattern;
|
|
1987
|
+
if (duplicateKey && backreferenceDuplicateKeys) {
|
|
1988
|
+
// Use a backreference to the key to ensure that the key is the same value
|
|
1989
|
+
// in each of the placeholders.
|
|
1990
|
+
pattern = "\\k<" + cleanedKey + ">";
|
|
1991
|
+
} else if (repeat) {
|
|
1992
|
+
pattern = "(?<" + cleanedKey + ">.+?)";
|
|
1993
|
+
} else {
|
|
1994
|
+
pattern = "(?<" + cleanedKey + ">[^/]+?)";
|
|
1995
|
+
}
|
|
1996
|
+
return optional ? "(?:/" + interceptionPrefix + pattern + ")?" : "/" + interceptionPrefix + pattern;
|
|
1997
|
+
}
|
|
1998
|
+
function getNamedParametrizedRoute(route, prefixRouteKeys, includeSuffix, includePrefix, backreferenceDuplicateKeys) {
|
|
1999
|
+
const getSafeRouteKey = buildGetSafeRouteKey();
|
|
2000
|
+
const routeKeys = {};
|
|
2001
|
+
const segments = [];
|
|
2002
|
+
for (const segment of (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split('/')){
|
|
2003
|
+
const hasInterceptionMarker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((m)=>segment.startsWith(m));
|
|
2004
|
+
const paramMatches = segment.match(PARAMETER_PATTERN) // Check for parameters
|
|
2005
|
+
;
|
|
2006
|
+
if (hasInterceptionMarker && paramMatches && paramMatches[2]) {
|
|
2007
|
+
// If there's an interception marker, add it to the segments.
|
|
2008
|
+
segments.push(getSafeKeyFromSegment({
|
|
2009
|
+
getSafeRouteKey,
|
|
2010
|
+
interceptionMarker: paramMatches[1],
|
|
2011
|
+
segment: paramMatches[2],
|
|
2012
|
+
routeKeys,
|
|
2013
|
+
keyPrefix: prefixRouteKeys ? _constants.NEXT_INTERCEPTION_MARKER_PREFIX : undefined,
|
|
2014
|
+
backreferenceDuplicateKeys
|
|
2015
|
+
}));
|
|
2016
|
+
} else if (paramMatches && paramMatches[2]) {
|
|
2017
|
+
// If there's a prefix, add it to the segments if it's enabled.
|
|
2018
|
+
if (includePrefix && paramMatches[1]) {
|
|
2019
|
+
segments.push("/" + (0, _escaperegexp.escapeStringRegexp)(paramMatches[1]));
|
|
2020
|
+
}
|
|
2021
|
+
let s = getSafeKeyFromSegment({
|
|
2022
|
+
getSafeRouteKey,
|
|
2023
|
+
segment: paramMatches[2],
|
|
2024
|
+
routeKeys,
|
|
2025
|
+
keyPrefix: prefixRouteKeys ? _constants.NEXT_QUERY_PARAM_PREFIX : undefined,
|
|
2026
|
+
backreferenceDuplicateKeys
|
|
2027
|
+
});
|
|
2028
|
+
// Remove the leading slash if includePrefix already added it.
|
|
2029
|
+
if (includePrefix && paramMatches[1]) {
|
|
2030
|
+
s = s.substring(1);
|
|
2031
|
+
}
|
|
2032
|
+
segments.push(s);
|
|
2033
|
+
} else {
|
|
2034
|
+
segments.push("/" + (0, _escaperegexp.escapeStringRegexp)(segment));
|
|
2035
|
+
}
|
|
2036
|
+
// If there's a suffix, add it to the segments if it's enabled.
|
|
2037
|
+
if (includeSuffix && paramMatches && paramMatches[3]) {
|
|
2038
|
+
segments.push((0, _escaperegexp.escapeStringRegexp)(paramMatches[3]));
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
return {
|
|
2042
|
+
namedParameterizedRoute: segments.join(''),
|
|
2043
|
+
routeKeys
|
|
2044
|
+
};
|
|
2045
|
+
}
|
|
2046
|
+
function getNamedRouteRegex(normalizedRoute, options) {
|
|
2047
|
+
var _options_includeSuffix, _options_includePrefix, _options_backreferenceDuplicateKeys;
|
|
2048
|
+
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);
|
|
2049
|
+
let namedRegex = result.namedParameterizedRoute;
|
|
2050
|
+
if (!options.excludeOptionalTrailingSlash) {
|
|
2051
|
+
namedRegex += '(?:/)?';
|
|
2052
|
+
}
|
|
2053
|
+
return {
|
|
2054
|
+
...getRouteRegex(normalizedRoute, options),
|
|
2055
|
+
namedRegex: "^" + namedRegex + "$",
|
|
2056
|
+
routeKeys: result.routeKeys
|
|
2057
|
+
};
|
|
2058
|
+
}
|
|
2059
|
+
function getNamedMiddlewareRegex(normalizedRoute, options) {
|
|
2060
|
+
const { parameterizedRoute } = getParametrizedRoute(normalizedRoute, false, false);
|
|
2061
|
+
const { catchAll = true } = options;
|
|
2062
|
+
if (parameterizedRoute === '/') {
|
|
2063
|
+
let catchAllRegex = catchAll ? '.*' : '';
|
|
2064
|
+
return {
|
|
2065
|
+
namedRegex: "^/" + catchAllRegex + "$"
|
|
2066
|
+
};
|
|
2067
|
+
}
|
|
2068
|
+
const { namedParameterizedRoute } = getNamedParametrizedRoute(normalizedRoute, false, false, false, false);
|
|
2069
|
+
let catchAllGroupedRegex = catchAll ? '(?:(/.*)?)' : '';
|
|
2070
|
+
return {
|
|
2071
|
+
namedRegex: "^" + namedParameterizedRoute + catchAllGroupedRegex + "$"
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
|
|
2076
|
+
} (routeRegex));
|
|
2077
|
+
return routeRegex;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
var hasRequiredInterpolateAs;
|
|
2081
|
+
|
|
2082
|
+
function requireInterpolateAs () {
|
|
2083
|
+
if (hasRequiredInterpolateAs) return interpolateAs;
|
|
2084
|
+
hasRequiredInterpolateAs = 1;
|
|
2085
|
+
(function (exports) {
|
|
2086
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2087
|
+
value: true
|
|
2088
|
+
});
|
|
2089
|
+
Object.defineProperty(exports, "interpolateAs", {
|
|
2090
|
+
enumerable: true,
|
|
2091
|
+
get: function() {
|
|
2092
|
+
return interpolateAs;
|
|
2093
|
+
}
|
|
2094
|
+
});
|
|
2095
|
+
const _routematcher = requireRouteMatcher();
|
|
2096
|
+
const _routeregex = requireRouteRegex();
|
|
2097
|
+
function interpolateAs(route, asPathname, query) {
|
|
2098
|
+
let interpolatedRoute = '';
|
|
2099
|
+
const dynamicRegex = (0, _routeregex.getRouteRegex)(route);
|
|
2100
|
+
const dynamicGroups = dynamicRegex.groups;
|
|
2101
|
+
const dynamicMatches = // Try to match the dynamic route against the asPath
|
|
2102
|
+
(asPathname !== route ? (0, _routematcher.getRouteMatcher)(dynamicRegex)(asPathname) : '') || // Fall back to reading the values from the href
|
|
2103
|
+
// TODO: should this take priority; also need to change in the router.
|
|
2104
|
+
query;
|
|
2105
|
+
interpolatedRoute = route;
|
|
2106
|
+
const params = Object.keys(dynamicGroups);
|
|
2107
|
+
if (!params.every((param)=>{
|
|
2108
|
+
let value = dynamicMatches[param] || '';
|
|
2109
|
+
const { repeat, optional } = dynamicGroups[param];
|
|
2110
|
+
// support single-level catch-all
|
|
2111
|
+
// TODO: more robust handling for user-error (passing `/`)
|
|
2112
|
+
let replaced = "[" + (repeat ? '...' : '') + param + "]";
|
|
2113
|
+
if (optional) {
|
|
2114
|
+
replaced = (!value ? '/' : '') + "[" + replaced + "]";
|
|
2115
|
+
}
|
|
2116
|
+
if (repeat && !Array.isArray(value)) value = [
|
|
2117
|
+
value
|
|
2118
|
+
];
|
|
2119
|
+
return (optional || param in dynamicMatches) && // Interpolate group into data URL if present
|
|
2120
|
+
(interpolatedRoute = interpolatedRoute.replace(replaced, repeat ? value.map(// these values should be fully encoded instead of just
|
|
2121
|
+
// path delimiter escaped since they are being inserted
|
|
2122
|
+
// into the URL and we expect URL encoded segments
|
|
2123
|
+
// when parsing dynamic route params
|
|
2124
|
+
(segment)=>encodeURIComponent(segment)).join('/') : encodeURIComponent(value)) || '/');
|
|
2125
|
+
})) {
|
|
2126
|
+
interpolatedRoute = '' // did not satisfy all requirements
|
|
2127
|
+
;
|
|
2128
|
+
// n.b. We ignore this error because we handle warning for this case in
|
|
2129
|
+
// development in the `<Link>` component directly.
|
|
2130
|
+
}
|
|
2131
|
+
return {
|
|
2132
|
+
params,
|
|
2133
|
+
result: interpolatedRoute
|
|
2134
|
+
};
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
|
|
2138
|
+
} (interpolateAs));
|
|
2139
|
+
return interpolateAs;
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
var hasRequiredResolveHref;
|
|
2143
|
+
|
|
2144
|
+
function requireResolveHref () {
|
|
2145
|
+
if (hasRequiredResolveHref) return resolveHref.exports;
|
|
2146
|
+
hasRequiredResolveHref = 1;
|
|
2147
|
+
(function (module, exports) {
|
|
2148
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2149
|
+
value: true
|
|
2150
|
+
});
|
|
2151
|
+
Object.defineProperty(exports, "resolveHref", {
|
|
2152
|
+
enumerable: true,
|
|
2153
|
+
get: function() {
|
|
2154
|
+
return resolveHref;
|
|
2155
|
+
}
|
|
2156
|
+
});
|
|
2157
|
+
const _querystring = requireQuerystring();
|
|
2158
|
+
const _formaturl = requireFormatUrl();
|
|
2159
|
+
const _omit = requireOmit();
|
|
2160
|
+
const _utils = requireUtils$1();
|
|
2161
|
+
const _normalizetrailingslash = requireNormalizeTrailingSlash();
|
|
2162
|
+
const _islocalurl = requireIsLocalUrl();
|
|
2163
|
+
const _utils1 = requireUtils();
|
|
2164
|
+
const _interpolateas = requireInterpolateAs();
|
|
2165
|
+
function resolveHref(router, href, resolveAs) {
|
|
2166
|
+
// we use a dummy base url for relative urls
|
|
2167
|
+
let base;
|
|
2168
|
+
let urlAsString = typeof href === 'string' ? href : (0, _formaturl.formatWithValidation)(href);
|
|
2169
|
+
// repeated slashes and backslashes in the URL are considered
|
|
2170
|
+
// invalid and will never match a Next.js page/file
|
|
2171
|
+
const urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\/\//);
|
|
2172
|
+
const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
|
|
2173
|
+
const urlParts = urlAsStringNoProto.split('?', 1);
|
|
2174
|
+
if ((urlParts[0] || '').match(/(\/\/|\\)/)) {
|
|
2175
|
+
console.error("Invalid href '" + urlAsString + "' passed to next/router in page: '" + router.pathname + "'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");
|
|
2176
|
+
const normalizedUrl = (0, _utils.normalizeRepeatedSlashes)(urlAsStringNoProto);
|
|
2177
|
+
urlAsString = (urlProtoMatch ? urlProtoMatch[0] : '') + normalizedUrl;
|
|
2178
|
+
}
|
|
2179
|
+
// Return because it cannot be routed by the Next.js router
|
|
2180
|
+
if (!(0, _islocalurl.isLocalURL)(urlAsString)) {
|
|
2181
|
+
return resolveAs ? [
|
|
2182
|
+
urlAsString
|
|
2183
|
+
] : urlAsString;
|
|
2184
|
+
}
|
|
2185
|
+
try {
|
|
2186
|
+
base = new URL(urlAsString.startsWith('#') ? router.asPath : router.pathname, 'http://n');
|
|
2187
|
+
} catch (_) {
|
|
2188
|
+
// fallback to / for invalid asPath values e.g. //
|
|
2189
|
+
base = new URL('/', 'http://n');
|
|
2190
|
+
}
|
|
2191
|
+
try {
|
|
2192
|
+
const finalUrl = new URL(urlAsString, base);
|
|
2193
|
+
finalUrl.pathname = (0, _normalizetrailingslash.normalizePathTrailingSlash)(finalUrl.pathname);
|
|
2194
|
+
let interpolatedAs = '';
|
|
2195
|
+
if ((0, _utils1.isDynamicRoute)(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
|
|
2196
|
+
const query = (0, _querystring.searchParamsToUrlQuery)(finalUrl.searchParams);
|
|
2197
|
+
const { result, params } = (0, _interpolateas.interpolateAs)(finalUrl.pathname, finalUrl.pathname, query);
|
|
2198
|
+
if (result) {
|
|
2199
|
+
interpolatedAs = (0, _formaturl.formatWithValidation)({
|
|
2200
|
+
pathname: result,
|
|
2201
|
+
hash: finalUrl.hash,
|
|
2202
|
+
query: (0, _omit.omit)(query, params)
|
|
2203
|
+
});
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
// if the origin didn't change, it means we received a relative href
|
|
2207
|
+
const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
|
|
2208
|
+
return resolveAs ? [
|
|
2209
|
+
resolvedHref,
|
|
2210
|
+
interpolatedAs || resolvedHref
|
|
2211
|
+
] : resolvedHref;
|
|
2212
|
+
} catch (_) {
|
|
2213
|
+
return resolveAs ? [
|
|
2214
|
+
urlAsString
|
|
2215
|
+
] : urlAsString;
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2220
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2221
|
+
Object.assign(exports.default, exports);
|
|
2222
|
+
module.exports = exports.default;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
|
|
2226
|
+
} (resolveHref, resolveHref.exports));
|
|
2227
|
+
return resolveHref.exports;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
var addLocale$1 = {exports: {}};
|
|
2231
|
+
|
|
2232
|
+
var addLocale = {};
|
|
2233
|
+
|
|
2234
|
+
var addPathPrefix = {};
|
|
2235
|
+
|
|
2236
|
+
var hasRequiredAddPathPrefix;
|
|
2237
|
+
|
|
2238
|
+
function requireAddPathPrefix () {
|
|
2239
|
+
if (hasRequiredAddPathPrefix) return addPathPrefix;
|
|
2240
|
+
hasRequiredAddPathPrefix = 1;
|
|
2241
|
+
(function (exports) {
|
|
2242
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2243
|
+
value: true
|
|
2244
|
+
});
|
|
2245
|
+
Object.defineProperty(exports, "addPathPrefix", {
|
|
2246
|
+
enumerable: true,
|
|
2247
|
+
get: function() {
|
|
2248
|
+
return addPathPrefix;
|
|
2249
|
+
}
|
|
2250
|
+
});
|
|
2251
|
+
const _parsepath = requireParsePath();
|
|
2252
|
+
function addPathPrefix(path, prefix) {
|
|
2253
|
+
if (!path.startsWith('/') || !prefix) {
|
|
2254
|
+
return path;
|
|
2255
|
+
}
|
|
2256
|
+
const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
|
|
2257
|
+
return "" + prefix + pathname + query + hash;
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
|
|
2261
|
+
} (addPathPrefix));
|
|
2262
|
+
return addPathPrefix;
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
var hasRequiredAddLocale$1;
|
|
2266
|
+
|
|
2267
|
+
function requireAddLocale$1 () {
|
|
2268
|
+
if (hasRequiredAddLocale$1) return addLocale;
|
|
2269
|
+
hasRequiredAddLocale$1 = 1;
|
|
2270
|
+
(function (exports) {
|
|
2271
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2272
|
+
value: true
|
|
2273
|
+
});
|
|
2274
|
+
Object.defineProperty(exports, "addLocale", {
|
|
2275
|
+
enumerable: true,
|
|
2276
|
+
get: function() {
|
|
2277
|
+
return addLocale;
|
|
2278
|
+
}
|
|
2279
|
+
});
|
|
2280
|
+
const _addpathprefix = requireAddPathPrefix();
|
|
2281
|
+
const _pathhasprefix = requirePathHasPrefix();
|
|
2282
|
+
function addLocale(path, locale, defaultLocale, ignorePrefix) {
|
|
2283
|
+
// If no locale was given or the locale is the default locale, we don't need
|
|
2284
|
+
// to prefix the path.
|
|
2285
|
+
if (!locale || locale === defaultLocale) return path;
|
|
2286
|
+
const lower = path.toLowerCase();
|
|
2287
|
+
// If the path is an API path or the path already has the locale prefix, we
|
|
2288
|
+
// don't need to prefix the path.
|
|
2289
|
+
if (!ignorePrefix) {
|
|
2290
|
+
if ((0, _pathhasprefix.pathHasPrefix)(lower, '/api')) return path;
|
|
2291
|
+
if ((0, _pathhasprefix.pathHasPrefix)(lower, "/" + locale.toLowerCase())) return path;
|
|
2292
|
+
}
|
|
2293
|
+
// Add the locale prefix to the path.
|
|
2294
|
+
return (0, _addpathprefix.addPathPrefix)(path, "/" + locale);
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
|
|
2298
|
+
} (addLocale));
|
|
2299
|
+
return addLocale;
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
var hasRequiredAddLocale;
|
|
2303
|
+
|
|
2304
|
+
function requireAddLocale () {
|
|
2305
|
+
if (hasRequiredAddLocale) return addLocale$1.exports;
|
|
2306
|
+
hasRequiredAddLocale = 1;
|
|
2307
|
+
(function (module, exports) {
|
|
2308
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2309
|
+
value: true
|
|
2310
|
+
});
|
|
2311
|
+
Object.defineProperty(exports, "addLocale", {
|
|
2312
|
+
enumerable: true,
|
|
2313
|
+
get: function() {
|
|
2314
|
+
return addLocale;
|
|
2315
|
+
}
|
|
2316
|
+
});
|
|
2317
|
+
const _normalizetrailingslash = requireNormalizeTrailingSlash();
|
|
2318
|
+
const addLocale = function(path) {
|
|
2319
|
+
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
2320
|
+
args[_key - 1] = arguments[_key];
|
|
2321
|
+
}
|
|
2322
|
+
if (process.env.__NEXT_I18N_SUPPORT) {
|
|
2323
|
+
return (0, _normalizetrailingslash.normalizePathTrailingSlash)(requireAddLocale$1().addLocale(path, ...args));
|
|
2324
|
+
}
|
|
2325
|
+
return path;
|
|
2326
|
+
};
|
|
2327
|
+
|
|
2328
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2329
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2330
|
+
Object.assign(exports.default, exports);
|
|
2331
|
+
module.exports = exports.default;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
} (addLocale$1, addLocale$1.exports));
|
|
2336
|
+
return addLocale$1.exports;
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
var routerContext_sharedRuntime = {};
|
|
2340
|
+
|
|
2341
|
+
var hasRequiredRouterContext_sharedRuntime;
|
|
2342
|
+
|
|
2343
|
+
function requireRouterContext_sharedRuntime () {
|
|
2344
|
+
if (hasRequiredRouterContext_sharedRuntime) return routerContext_sharedRuntime;
|
|
2345
|
+
hasRequiredRouterContext_sharedRuntime = 1;
|
|
2346
|
+
(function (exports) {
|
|
2347
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2348
|
+
value: true
|
|
2349
|
+
});
|
|
2350
|
+
Object.defineProperty(exports, "RouterContext", {
|
|
2351
|
+
enumerable: true,
|
|
2352
|
+
get: function() {
|
|
2353
|
+
return RouterContext;
|
|
2354
|
+
}
|
|
2355
|
+
});
|
|
2356
|
+
const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
|
|
2357
|
+
const _react = /*#__PURE__*/ _interop_require_default._(require$$0);
|
|
2358
|
+
const RouterContext = _react.default.createContext(null);
|
|
2359
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2360
|
+
RouterContext.displayName = 'RouterContext';
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
|
|
2364
|
+
} (routerContext_sharedRuntime));
|
|
2365
|
+
return routerContext_sharedRuntime;
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
var useIntersection = {exports: {}};
|
|
2369
|
+
|
|
2370
|
+
var requestIdleCallback = {exports: {}};
|
|
2371
|
+
|
|
2372
|
+
var hasRequiredRequestIdleCallback;
|
|
2373
|
+
|
|
2374
|
+
function requireRequestIdleCallback () {
|
|
2375
|
+
if (hasRequiredRequestIdleCallback) return requestIdleCallback.exports;
|
|
2376
|
+
hasRequiredRequestIdleCallback = 1;
|
|
2377
|
+
(function (module, exports) {
|
|
2378
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2379
|
+
value: true
|
|
2380
|
+
});
|
|
2381
|
+
function _export(target, all) {
|
|
2382
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
2383
|
+
enumerable: true,
|
|
2384
|
+
get: all[name]
|
|
2385
|
+
});
|
|
2386
|
+
}
|
|
2387
|
+
_export(exports, {
|
|
2388
|
+
cancelIdleCallback: function() {
|
|
2389
|
+
return cancelIdleCallback;
|
|
2390
|
+
},
|
|
2391
|
+
requestIdleCallback: function() {
|
|
2392
|
+
return requestIdleCallback;
|
|
2393
|
+
}
|
|
2394
|
+
});
|
|
2395
|
+
const requestIdleCallback = typeof self !== 'undefined' && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
|
|
2396
|
+
let start = Date.now();
|
|
2397
|
+
return self.setTimeout(function() {
|
|
2398
|
+
cb({
|
|
2399
|
+
didTimeout: false,
|
|
2400
|
+
timeRemaining: function() {
|
|
2401
|
+
return Math.max(0, 50 - (Date.now() - start));
|
|
2402
|
+
}
|
|
2403
|
+
});
|
|
2404
|
+
}, 1);
|
|
2405
|
+
};
|
|
2406
|
+
const cancelIdleCallback = typeof self !== 'undefined' && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
|
|
2407
|
+
return clearTimeout(id);
|
|
2408
|
+
};
|
|
2409
|
+
|
|
2410
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2411
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2412
|
+
Object.assign(exports.default, exports);
|
|
2413
|
+
module.exports = exports.default;
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
|
|
2417
|
+
} (requestIdleCallback, requestIdleCallback.exports));
|
|
2418
|
+
return requestIdleCallback.exports;
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
var hasRequiredUseIntersection;
|
|
2422
|
+
|
|
2423
|
+
function requireUseIntersection () {
|
|
2424
|
+
if (hasRequiredUseIntersection) return useIntersection.exports;
|
|
2425
|
+
hasRequiredUseIntersection = 1;
|
|
2426
|
+
(function (module, exports) {
|
|
2427
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2428
|
+
value: true
|
|
2429
|
+
});
|
|
2430
|
+
Object.defineProperty(exports, "useIntersection", {
|
|
2431
|
+
enumerable: true,
|
|
2432
|
+
get: function() {
|
|
2433
|
+
return useIntersection;
|
|
2434
|
+
}
|
|
2435
|
+
});
|
|
2436
|
+
const _react = require$$0;
|
|
2437
|
+
const _requestidlecallback = requireRequestIdleCallback();
|
|
2438
|
+
const hasIntersectionObserver = typeof IntersectionObserver === 'function';
|
|
2439
|
+
const observers = new Map();
|
|
2440
|
+
const idList = [];
|
|
2441
|
+
function createObserver(options) {
|
|
2442
|
+
const id = {
|
|
2443
|
+
root: options.root || null,
|
|
2444
|
+
margin: options.rootMargin || ''
|
|
2445
|
+
};
|
|
2446
|
+
const existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin);
|
|
2447
|
+
let instance;
|
|
2448
|
+
if (existing) {
|
|
2449
|
+
instance = observers.get(existing);
|
|
2450
|
+
if (instance) {
|
|
2451
|
+
return instance;
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
const elements = new Map();
|
|
2455
|
+
const observer = new IntersectionObserver((entries)=>{
|
|
2456
|
+
entries.forEach((entry)=>{
|
|
2457
|
+
const callback = elements.get(entry.target);
|
|
2458
|
+
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
|
|
2459
|
+
if (callback && isVisible) {
|
|
2460
|
+
callback(isVisible);
|
|
2461
|
+
}
|
|
2462
|
+
});
|
|
2463
|
+
}, options);
|
|
2464
|
+
instance = {
|
|
2465
|
+
id,
|
|
2466
|
+
observer,
|
|
2467
|
+
elements
|
|
2468
|
+
};
|
|
2469
|
+
idList.push(id);
|
|
2470
|
+
observers.set(id, instance);
|
|
2471
|
+
return instance;
|
|
2472
|
+
}
|
|
2473
|
+
function observe(element, callback, options) {
|
|
2474
|
+
const { id, observer, elements } = createObserver(options);
|
|
2475
|
+
elements.set(element, callback);
|
|
2476
|
+
observer.observe(element);
|
|
2477
|
+
return function unobserve() {
|
|
2478
|
+
elements.delete(element);
|
|
2479
|
+
observer.unobserve(element);
|
|
2480
|
+
// Destroy observer when there's nothing left to watch:
|
|
2481
|
+
if (elements.size === 0) {
|
|
2482
|
+
observer.disconnect();
|
|
2483
|
+
observers.delete(id);
|
|
2484
|
+
const index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin);
|
|
2485
|
+
if (index > -1) {
|
|
2486
|
+
idList.splice(index, 1);
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2491
|
+
function useIntersection(param) {
|
|
2492
|
+
let { rootRef, rootMargin, disabled } = param;
|
|
2493
|
+
const isDisabled = disabled || !hasIntersectionObserver;
|
|
2494
|
+
const [visible, setVisible] = (0, _react.useState)(false);
|
|
2495
|
+
const elementRef = (0, _react.useRef)(null);
|
|
2496
|
+
const setElement = (0, _react.useCallback)((element)=>{
|
|
2497
|
+
elementRef.current = element;
|
|
2498
|
+
}, []);
|
|
2499
|
+
(0, _react.useEffect)(()=>{
|
|
2500
|
+
if (hasIntersectionObserver) {
|
|
2501
|
+
if (isDisabled || visible) return;
|
|
2502
|
+
const element = elementRef.current;
|
|
2503
|
+
if (element && element.tagName) {
|
|
2504
|
+
const unobserve = observe(element, (isVisible)=>isVisible && setVisible(isVisible), {
|
|
2505
|
+
root: rootRef == null ? void 0 : rootRef.current,
|
|
2506
|
+
rootMargin
|
|
2507
|
+
});
|
|
2508
|
+
return unobserve;
|
|
2509
|
+
}
|
|
2510
|
+
} else {
|
|
2511
|
+
if (!visible) {
|
|
2512
|
+
const idleCallback = (0, _requestidlecallback.requestIdleCallback)(()=>setVisible(true));
|
|
2513
|
+
return ()=>(0, _requestidlecallback.cancelIdleCallback)(idleCallback);
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2517
|
+
}, [
|
|
2518
|
+
isDisabled,
|
|
2519
|
+
rootMargin,
|
|
2520
|
+
rootRef,
|
|
2521
|
+
visible,
|
|
2522
|
+
elementRef.current
|
|
2523
|
+
]);
|
|
2524
|
+
const resetVisible = (0, _react.useCallback)(()=>{
|
|
2525
|
+
setVisible(false);
|
|
2526
|
+
}, []);
|
|
2527
|
+
return [
|
|
2528
|
+
setElement,
|
|
2529
|
+
visible,
|
|
2530
|
+
resetVisible
|
|
2531
|
+
];
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2535
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2536
|
+
Object.assign(exports.default, exports);
|
|
2537
|
+
module.exports = exports.default;
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
|
|
2541
|
+
} (useIntersection, useIntersection.exports));
|
|
2542
|
+
return useIntersection.exports;
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
var getDomainLocale = {exports: {}};
|
|
2546
|
+
|
|
2547
|
+
var normalizeLocalePath$1 = {exports: {}};
|
|
2548
|
+
|
|
2549
|
+
var normalizeLocalePath = {};
|
|
2550
|
+
|
|
2551
|
+
var hasRequiredNormalizeLocalePath$1;
|
|
2552
|
+
|
|
2553
|
+
function requireNormalizeLocalePath$1 () {
|
|
2554
|
+
if (hasRequiredNormalizeLocalePath$1) return normalizeLocalePath;
|
|
2555
|
+
hasRequiredNormalizeLocalePath$1 = 1;
|
|
2556
|
+
(function (exports) {
|
|
2557
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2558
|
+
value: true
|
|
2559
|
+
});
|
|
2560
|
+
Object.defineProperty(exports, "normalizeLocalePath", {
|
|
2561
|
+
enumerable: true,
|
|
2562
|
+
get: function() {
|
|
2563
|
+
return normalizeLocalePath;
|
|
2564
|
+
}
|
|
2565
|
+
});
|
|
2566
|
+
/**
|
|
2567
|
+
* A cache of lowercased locales for each list of locales. This is stored as a
|
|
2568
|
+
* WeakMap so if the locales are garbage collected, the cache entry will be
|
|
2569
|
+
* removed as well.
|
|
2570
|
+
*/ const cache = new WeakMap();
|
|
2571
|
+
function normalizeLocalePath(pathname, locales) {
|
|
2572
|
+
// If locales is undefined, return the pathname as is.
|
|
2573
|
+
if (!locales) return {
|
|
2574
|
+
pathname
|
|
2575
|
+
};
|
|
2576
|
+
// Get the cached lowercased locales or create a new cache entry.
|
|
2577
|
+
let lowercasedLocales = cache.get(locales);
|
|
2578
|
+
if (!lowercasedLocales) {
|
|
2579
|
+
lowercasedLocales = locales.map((locale)=>locale.toLowerCase());
|
|
2580
|
+
cache.set(locales, lowercasedLocales);
|
|
2581
|
+
}
|
|
2582
|
+
let detectedLocale;
|
|
2583
|
+
// The first segment will be empty, because it has a leading `/`. If
|
|
2584
|
+
// there is no further segment, there is no locale (or it's the default).
|
|
2585
|
+
const segments = pathname.split('/', 2);
|
|
2586
|
+
// If there's no second segment (ie, the pathname is just `/`), there's no
|
|
2587
|
+
// locale.
|
|
2588
|
+
if (!segments[1]) return {
|
|
2589
|
+
pathname
|
|
2590
|
+
};
|
|
2591
|
+
// The second segment will contain the locale part if any.
|
|
2592
|
+
const segment = segments[1].toLowerCase();
|
|
2593
|
+
// See if the segment matches one of the locales. If it doesn't, there is
|
|
2594
|
+
// no locale (or it's the default).
|
|
2595
|
+
const index = lowercasedLocales.indexOf(segment);
|
|
2596
|
+
if (index < 0) return {
|
|
2597
|
+
pathname
|
|
2598
|
+
};
|
|
2599
|
+
// Return the case-sensitive locale.
|
|
2600
|
+
detectedLocale = locales[index];
|
|
2601
|
+
// Remove the `/${locale}` part of the pathname.
|
|
2602
|
+
pathname = pathname.slice(detectedLocale.length + 1) || '/';
|
|
2603
|
+
return {
|
|
2604
|
+
pathname,
|
|
2605
|
+
detectedLocale
|
|
2606
|
+
};
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
|
|
2610
|
+
} (normalizeLocalePath));
|
|
2611
|
+
return normalizeLocalePath;
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
var hasRequiredNormalizeLocalePath;
|
|
2615
|
+
|
|
2616
|
+
function requireNormalizeLocalePath () {
|
|
2617
|
+
if (hasRequiredNormalizeLocalePath) return normalizeLocalePath$1.exports;
|
|
2618
|
+
hasRequiredNormalizeLocalePath = 1;
|
|
2619
|
+
(function (module, exports) {
|
|
2620
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2621
|
+
value: true
|
|
2622
|
+
});
|
|
2623
|
+
Object.defineProperty(exports, "normalizeLocalePath", {
|
|
2624
|
+
enumerable: true,
|
|
2625
|
+
get: function() {
|
|
2626
|
+
return normalizeLocalePath;
|
|
2627
|
+
}
|
|
2628
|
+
});
|
|
2629
|
+
const normalizeLocalePath = (pathname, locales)=>{
|
|
2630
|
+
if (process.env.__NEXT_I18N_SUPPORT) {
|
|
2631
|
+
return requireNormalizeLocalePath$1().normalizeLocalePath(pathname, locales);
|
|
2632
|
+
}
|
|
2633
|
+
return {
|
|
2634
|
+
pathname,
|
|
2635
|
+
detectedLocale: undefined
|
|
2636
|
+
};
|
|
2637
|
+
};
|
|
2638
|
+
|
|
2639
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2640
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2641
|
+
Object.assign(exports.default, exports);
|
|
2642
|
+
module.exports = exports.default;
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2645
|
+
|
|
2646
|
+
} (normalizeLocalePath$1, normalizeLocalePath$1.exports));
|
|
2647
|
+
return normalizeLocalePath$1.exports;
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
var detectDomainLocale$1 = {exports: {}};
|
|
2651
|
+
|
|
2652
|
+
var detectDomainLocale = {};
|
|
2653
|
+
|
|
2654
|
+
var hasRequiredDetectDomainLocale$1;
|
|
2655
|
+
|
|
2656
|
+
function requireDetectDomainLocale$1 () {
|
|
2657
|
+
if (hasRequiredDetectDomainLocale$1) return detectDomainLocale;
|
|
2658
|
+
hasRequiredDetectDomainLocale$1 = 1;
|
|
2659
|
+
(function (exports) {
|
|
2660
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2661
|
+
value: true
|
|
2662
|
+
});
|
|
2663
|
+
Object.defineProperty(exports, "detectDomainLocale", {
|
|
2664
|
+
enumerable: true,
|
|
2665
|
+
get: function() {
|
|
2666
|
+
return detectDomainLocale;
|
|
2667
|
+
}
|
|
2668
|
+
});
|
|
2669
|
+
function detectDomainLocale(domainItems, hostname, detectedLocale) {
|
|
2670
|
+
if (!domainItems) return;
|
|
2671
|
+
if (detectedLocale) {
|
|
2672
|
+
detectedLocale = detectedLocale.toLowerCase();
|
|
2673
|
+
}
|
|
2674
|
+
for (const item of domainItems){
|
|
2675
|
+
var _item_domain, _item_locales;
|
|
2676
|
+
// remove port if present
|
|
2677
|
+
const domainHostname = (_item_domain = item.domain) == null ? void 0 : _item_domain.split(':', 1)[0].toLowerCase();
|
|
2678
|
+
if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((_item_locales = item.locales) == null ? void 0 : _item_locales.some((locale)=>locale.toLowerCase() === detectedLocale))) {
|
|
2679
|
+
return item;
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2684
|
+
|
|
2685
|
+
} (detectDomainLocale));
|
|
2686
|
+
return detectDomainLocale;
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
var hasRequiredDetectDomainLocale;
|
|
2690
|
+
|
|
2691
|
+
function requireDetectDomainLocale () {
|
|
2692
|
+
if (hasRequiredDetectDomainLocale) return detectDomainLocale$1.exports;
|
|
2693
|
+
hasRequiredDetectDomainLocale = 1;
|
|
2694
|
+
(function (module, exports) {
|
|
2695
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2696
|
+
value: true
|
|
2697
|
+
});
|
|
2698
|
+
Object.defineProperty(exports, "detectDomainLocale", {
|
|
2699
|
+
enumerable: true,
|
|
2700
|
+
get: function() {
|
|
2701
|
+
return detectDomainLocale;
|
|
2702
|
+
}
|
|
2703
|
+
});
|
|
2704
|
+
const detectDomainLocale = function() {
|
|
2705
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
2706
|
+
args[_key] = arguments[_key];
|
|
2707
|
+
}
|
|
2708
|
+
if (process.env.__NEXT_I18N_SUPPORT) {
|
|
2709
|
+
return requireDetectDomainLocale$1().detectDomainLocale(...args);
|
|
2710
|
+
}
|
|
2711
|
+
};
|
|
2712
|
+
|
|
2713
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2714
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2715
|
+
Object.assign(exports.default, exports);
|
|
2716
|
+
module.exports = exports.default;
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
|
|
2720
|
+
} (detectDomainLocale$1, detectDomainLocale$1.exports));
|
|
2721
|
+
return detectDomainLocale$1.exports;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
var hasRequiredGetDomainLocale;
|
|
2725
|
+
|
|
2726
|
+
function requireGetDomainLocale () {
|
|
2727
|
+
if (hasRequiredGetDomainLocale) return getDomainLocale.exports;
|
|
2728
|
+
hasRequiredGetDomainLocale = 1;
|
|
2729
|
+
(function (module, exports) {
|
|
2730
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2731
|
+
value: true
|
|
2732
|
+
});
|
|
2733
|
+
Object.defineProperty(exports, "getDomainLocale", {
|
|
2734
|
+
enumerable: true,
|
|
2735
|
+
get: function() {
|
|
2736
|
+
return getDomainLocale;
|
|
2737
|
+
}
|
|
2738
|
+
});
|
|
2739
|
+
const _normalizetrailingslash = requireNormalizeTrailingSlash();
|
|
2740
|
+
const basePath = process.env.__NEXT_ROUTER_BASEPATH || '';
|
|
2741
|
+
function getDomainLocale(path, locale, locales, domainLocales) {
|
|
2742
|
+
if (process.env.__NEXT_I18N_SUPPORT) {
|
|
2743
|
+
const normalizeLocalePath = requireNormalizeLocalePath().normalizeLocalePath;
|
|
2744
|
+
const detectDomainLocale = requireDetectDomainLocale().detectDomainLocale;
|
|
2745
|
+
const target = locale || normalizeLocalePath(path, locales).detectedLocale;
|
|
2746
|
+
const domain = detectDomainLocale(domainLocales, undefined, target);
|
|
2747
|
+
if (domain) {
|
|
2748
|
+
const proto = "http" + (domain.http ? '' : 's') + "://";
|
|
2749
|
+
const finalLocale = target === domain.defaultLocale ? '' : "/" + target;
|
|
2750
|
+
return "" + proto + domain.domain + (0, _normalizetrailingslash.normalizePathTrailingSlash)("" + basePath + finalLocale + path);
|
|
2751
|
+
}
|
|
2752
|
+
return false;
|
|
2753
|
+
} else {
|
|
2754
|
+
return false;
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2759
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2760
|
+
Object.assign(exports.default, exports);
|
|
2761
|
+
module.exports = exports.default;
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
|
|
2765
|
+
} (getDomainLocale, getDomainLocale.exports));
|
|
2766
|
+
return getDomainLocale.exports;
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
var addBasePath = {exports: {}};
|
|
2770
|
+
|
|
2771
|
+
var hasRequiredAddBasePath;
|
|
2772
|
+
|
|
2773
|
+
function requireAddBasePath () {
|
|
2774
|
+
if (hasRequiredAddBasePath) return addBasePath.exports;
|
|
2775
|
+
hasRequiredAddBasePath = 1;
|
|
2776
|
+
(function (module, exports) {
|
|
2777
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2778
|
+
value: true
|
|
2779
|
+
});
|
|
2780
|
+
Object.defineProperty(exports, "addBasePath", {
|
|
2781
|
+
enumerable: true,
|
|
2782
|
+
get: function() {
|
|
2783
|
+
return addBasePath;
|
|
2784
|
+
}
|
|
2785
|
+
});
|
|
2786
|
+
const _addpathprefix = requireAddPathPrefix();
|
|
2787
|
+
const _normalizetrailingslash = requireNormalizeTrailingSlash();
|
|
2788
|
+
const basePath = process.env.__NEXT_ROUTER_BASEPATH || '';
|
|
2789
|
+
function addBasePath(path, required) {
|
|
2790
|
+
return (0, _normalizetrailingslash.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required ? path : (0, _addpathprefix.addPathPrefix)(path, basePath));
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2794
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2795
|
+
Object.assign(exports.default, exports);
|
|
2796
|
+
module.exports = exports.default;
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2799
|
+
|
|
2800
|
+
} (addBasePath, addBasePath.exports));
|
|
2801
|
+
return addBasePath.exports;
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
var useMergedRef = {exports: {}};
|
|
2805
|
+
|
|
2806
|
+
var hasRequiredUseMergedRef;
|
|
2807
|
+
|
|
2808
|
+
function requireUseMergedRef () {
|
|
2809
|
+
if (hasRequiredUseMergedRef) return useMergedRef.exports;
|
|
2810
|
+
hasRequiredUseMergedRef = 1;
|
|
2811
|
+
(function (module, exports) {
|
|
2812
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2813
|
+
value: true
|
|
2814
|
+
});
|
|
2815
|
+
Object.defineProperty(exports, "useMergedRef", {
|
|
2816
|
+
enumerable: true,
|
|
2817
|
+
get: function() {
|
|
2818
|
+
return useMergedRef;
|
|
2819
|
+
}
|
|
2820
|
+
});
|
|
2821
|
+
const _react = require$$0;
|
|
2822
|
+
function useMergedRef(refA, refB) {
|
|
2823
|
+
const cleanupA = (0, _react.useRef)(null);
|
|
2824
|
+
const cleanupB = (0, _react.useRef)(null);
|
|
2825
|
+
// NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.
|
|
2826
|
+
// (this happens often if the user doesn't pass a ref to Link/Form/Image)
|
|
2827
|
+
// But this can cause us to leak a cleanup-ref into user code (e.g. via `<Link legacyBehavior>`),
|
|
2828
|
+
// and the user might pass that ref into ref-merging library that doesn't support cleanup refs
|
|
2829
|
+
// (because it hasn't been updated for React 19)
|
|
2830
|
+
// which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.
|
|
2831
|
+
// So in practice, it's safer to be defensive and always wrap the ref, even on React 19.
|
|
2832
|
+
return (0, _react.useCallback)((current)=>{
|
|
2833
|
+
if (current === null) {
|
|
2834
|
+
const cleanupFnA = cleanupA.current;
|
|
2835
|
+
if (cleanupFnA) {
|
|
2836
|
+
cleanupA.current = null;
|
|
2837
|
+
cleanupFnA();
|
|
2838
|
+
}
|
|
2839
|
+
const cleanupFnB = cleanupB.current;
|
|
2840
|
+
if (cleanupFnB) {
|
|
2841
|
+
cleanupB.current = null;
|
|
2842
|
+
cleanupFnB();
|
|
2843
|
+
}
|
|
2844
|
+
} else {
|
|
2845
|
+
if (refA) {
|
|
2846
|
+
cleanupA.current = applyRef(refA, current);
|
|
2847
|
+
}
|
|
2848
|
+
if (refB) {
|
|
2849
|
+
cleanupB.current = applyRef(refB, current);
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
}, [
|
|
2853
|
+
refA,
|
|
2854
|
+
refB
|
|
2855
|
+
]);
|
|
2856
|
+
}
|
|
2857
|
+
function applyRef(refA, current) {
|
|
2858
|
+
if (typeof refA === 'function') {
|
|
2859
|
+
const cleanup = refA(current);
|
|
2860
|
+
if (typeof cleanup === 'function') {
|
|
2861
|
+
return cleanup;
|
|
2862
|
+
} else {
|
|
2863
|
+
return ()=>refA(null);
|
|
2864
|
+
}
|
|
2865
|
+
} else {
|
|
2866
|
+
refA.current = current;
|
|
2867
|
+
return ()=>{
|
|
2868
|
+
refA.current = null;
|
|
2869
|
+
};
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2873
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2874
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2875
|
+
Object.assign(exports.default, exports);
|
|
2876
|
+
module.exports = exports.default;
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
|
|
2880
|
+
} (useMergedRef, useMergedRef.exports));
|
|
2881
|
+
return useMergedRef.exports;
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
var errorOnce = {};
|
|
2885
|
+
|
|
2886
|
+
var hasRequiredErrorOnce;
|
|
2887
|
+
|
|
2888
|
+
function requireErrorOnce () {
|
|
2889
|
+
if (hasRequiredErrorOnce) return errorOnce;
|
|
2890
|
+
hasRequiredErrorOnce = 1;
|
|
2891
|
+
(function (exports) {
|
|
2892
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2893
|
+
value: true
|
|
2894
|
+
});
|
|
2895
|
+
Object.defineProperty(exports, "errorOnce", {
|
|
2896
|
+
enumerable: true,
|
|
2897
|
+
get: function() {
|
|
2898
|
+
return errorOnce;
|
|
2899
|
+
}
|
|
2900
|
+
});
|
|
2901
|
+
let errorOnce = (_)=>{};
|
|
2902
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2903
|
+
const errors = new Set();
|
|
2904
|
+
errorOnce = (msg)=>{
|
|
2905
|
+
if (!errors.has(msg)) {
|
|
2906
|
+
console.error(msg);
|
|
2907
|
+
}
|
|
2908
|
+
errors.add(msg);
|
|
2909
|
+
};
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
|
|
2913
|
+
} (errorOnce));
|
|
2914
|
+
return errorOnce;
|
|
2915
|
+
}
|
|
2916
|
+
|
|
2917
|
+
var hasRequiredLink$1;
|
|
2918
|
+
|
|
2919
|
+
function requireLink$1 () {
|
|
2920
|
+
if (hasRequiredLink$1) return link$1.exports;
|
|
2921
|
+
hasRequiredLink$1 = 1;
|
|
2922
|
+
(function (module, exports) {
|
|
2923
|
+
'use client';
|
|
2924
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2925
|
+
value: true
|
|
2926
|
+
});
|
|
2927
|
+
function _export(target, all) {
|
|
2928
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
2929
|
+
enumerable: true,
|
|
2930
|
+
get: all[name]
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
_export(exports, {
|
|
2934
|
+
default: function() {
|
|
2935
|
+
return _default;
|
|
2936
|
+
},
|
|
2937
|
+
useLinkStatus: function() {
|
|
2938
|
+
return useLinkStatus;
|
|
2939
|
+
}
|
|
2940
|
+
});
|
|
2941
|
+
const _interop_require_wildcard = /*@__PURE__*/ require_interop_require_wildcard();
|
|
2942
|
+
const _jsxruntime = require$$1;
|
|
2943
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require$$0);
|
|
2944
|
+
const _resolvehref = requireResolveHref();
|
|
2945
|
+
const _islocalurl = requireIsLocalUrl();
|
|
2946
|
+
const _formaturl = requireFormatUrl();
|
|
2947
|
+
const _utils = requireUtils$1();
|
|
2948
|
+
const _addlocale = requireAddLocale();
|
|
2949
|
+
const _routercontextsharedruntime = requireRouterContext_sharedRuntime();
|
|
2950
|
+
const _useintersection = requireUseIntersection();
|
|
2951
|
+
const _getdomainlocale = requireGetDomainLocale();
|
|
2952
|
+
const _addbasepath = requireAddBasePath();
|
|
2953
|
+
const _usemergedref = requireUseMergedRef();
|
|
2954
|
+
const _erroronce = requireErrorOnce();
|
|
2955
|
+
const prefetched = new Set();
|
|
2956
|
+
function prefetch(router, href, as, options) {
|
|
2957
|
+
if (typeof window === 'undefined') {
|
|
2958
|
+
return;
|
|
2959
|
+
}
|
|
2960
|
+
if (!(0, _islocalurl.isLocalURL)(href)) {
|
|
2961
|
+
return;
|
|
2962
|
+
}
|
|
2963
|
+
// We should only dedupe requests when experimental.optimisticClientCache is
|
|
2964
|
+
// disabled.
|
|
2965
|
+
if (!options.bypassPrefetchedCheck) {
|
|
2966
|
+
const locale = // Let the link's locale prop override the default router locale.
|
|
2967
|
+
typeof options.locale !== 'undefined' ? options.locale : 'locale' in router ? router.locale : undefined;
|
|
2968
|
+
const prefetchedKey = href + '%' + as + '%' + locale;
|
|
2969
|
+
// If we've already fetched the key, then don't prefetch it again!
|
|
2970
|
+
if (prefetched.has(prefetchedKey)) {
|
|
2971
|
+
return;
|
|
2972
|
+
}
|
|
2973
|
+
// Mark this URL as prefetched.
|
|
2974
|
+
prefetched.add(prefetchedKey);
|
|
2975
|
+
}
|
|
2976
|
+
// Prefetch the JSON page if asked (only in the client)
|
|
2977
|
+
// We need to handle a prefetch error here since we may be
|
|
2978
|
+
// loading with priority which can reject but we don't
|
|
2979
|
+
// want to force navigation since this is only a prefetch
|
|
2980
|
+
router.prefetch(href, as, options).catch((err)=>{
|
|
2981
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2982
|
+
// rethrow to show invalid URL errors
|
|
2983
|
+
throw err;
|
|
2984
|
+
}
|
|
2985
|
+
});
|
|
2986
|
+
}
|
|
2987
|
+
function isModifiedEvent(event) {
|
|
2988
|
+
const eventTarget = event.currentTarget;
|
|
2989
|
+
const target = eventTarget.getAttribute('target');
|
|
2990
|
+
return target && target !== '_self' || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || // triggers resource download
|
|
2991
|
+
event.nativeEvent && event.nativeEvent.which === 2;
|
|
2992
|
+
}
|
|
2993
|
+
function linkClicked(e, router, href, as, replace, shallow, scroll, locale, onNavigate) {
|
|
2994
|
+
const { nodeName } = e.currentTarget;
|
|
2995
|
+
// anchors inside an svg have a lowercase nodeName
|
|
2996
|
+
const isAnchorNodeName = nodeName.toUpperCase() === 'A';
|
|
2997
|
+
if (isAnchorNodeName && isModifiedEvent(e) || e.currentTarget.hasAttribute('download')) {
|
|
2998
|
+
// ignore click for browser’s default behavior
|
|
2999
|
+
return;
|
|
3000
|
+
}
|
|
3001
|
+
if (!(0, _islocalurl.isLocalURL)(href)) {
|
|
3002
|
+
if (replace) {
|
|
3003
|
+
// browser default behavior does not replace the history state
|
|
3004
|
+
// so we need to do it manually
|
|
3005
|
+
e.preventDefault();
|
|
3006
|
+
location.replace(href);
|
|
3007
|
+
}
|
|
3008
|
+
// ignore click for browser’s default behavior
|
|
3009
|
+
return;
|
|
3010
|
+
}
|
|
3011
|
+
e.preventDefault();
|
|
3012
|
+
const navigate = ()=>{
|
|
3013
|
+
if (onNavigate) {
|
|
3014
|
+
let isDefaultPrevented = false;
|
|
3015
|
+
onNavigate({
|
|
3016
|
+
preventDefault: ()=>{
|
|
3017
|
+
isDefaultPrevented = true;
|
|
3018
|
+
}
|
|
3019
|
+
});
|
|
3020
|
+
if (isDefaultPrevented) {
|
|
3021
|
+
return;
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
// If the router is an NextRouter instance it will have `beforePopState`
|
|
3025
|
+
const routerScroll = scroll != null ? scroll : true;
|
|
3026
|
+
if ('beforePopState' in router) {
|
|
3027
|
+
router[replace ? 'replace' : 'push'](href, as, {
|
|
3028
|
+
shallow,
|
|
3029
|
+
locale,
|
|
3030
|
+
scroll: routerScroll
|
|
3031
|
+
});
|
|
3032
|
+
} else {
|
|
3033
|
+
router[replace ? 'replace' : 'push'](as || href, {
|
|
3034
|
+
scroll: routerScroll
|
|
3035
|
+
});
|
|
3036
|
+
}
|
|
3037
|
+
};
|
|
3038
|
+
navigate();
|
|
3039
|
+
}
|
|
3040
|
+
function formatStringOrUrl(urlObjOrString) {
|
|
3041
|
+
if (typeof urlObjOrString === 'string') {
|
|
3042
|
+
return urlObjOrString;
|
|
3043
|
+
}
|
|
3044
|
+
return (0, _formaturl.formatUrl)(urlObjOrString);
|
|
3045
|
+
}
|
|
3046
|
+
/**
|
|
3047
|
+
* A React component that extends the HTML `<a>` element to provide [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)
|
|
3048
|
+
* and client-side navigation between routes.
|
|
3049
|
+
*
|
|
3050
|
+
* It is the primary way to navigate between routes in Next.js.
|
|
3051
|
+
*
|
|
3052
|
+
* Read more: [Next.js docs: `<Link>`](https://nextjs.org/docs/app/api-reference/components/link)
|
|
3053
|
+
*/ const Link = /*#__PURE__*/ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
|
|
3054
|
+
let children;
|
|
3055
|
+
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;
|
|
3056
|
+
children = childrenProp;
|
|
3057
|
+
if (legacyBehavior && (typeof children === 'string' || typeof children === 'number')) {
|
|
3058
|
+
children = /*#__PURE__*/ (0, _jsxruntime.jsx)("a", {
|
|
3059
|
+
children: children
|
|
3060
|
+
});
|
|
3061
|
+
}
|
|
3062
|
+
const router = _react.default.useContext(_routercontextsharedruntime.RouterContext);
|
|
3063
|
+
const prefetchEnabled = prefetchProp !== false;
|
|
3064
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3065
|
+
function createPropError(args) {
|
|
3066
|
+
return Object.defineProperty(new Error("Failed prop type: The prop `" + args.key + "` expects a " + args.expected + " in `<Link>`, but got `" + args.actual + "` instead." + (typeof window !== 'undefined' ? "\nOpen your browser's console to view the Component stack trace." : '')), "__NEXT_ERROR_CODE", {
|
|
3067
|
+
value: "E319",
|
|
3068
|
+
enumerable: false,
|
|
3069
|
+
configurable: true
|
|
3070
|
+
});
|
|
3071
|
+
}
|
|
3072
|
+
// TypeScript trick for type-guarding:
|
|
3073
|
+
const requiredPropsGuard = {
|
|
3074
|
+
href: true
|
|
3075
|
+
};
|
|
3076
|
+
const requiredProps = Object.keys(requiredPropsGuard);
|
|
3077
|
+
requiredProps.forEach((key)=>{
|
|
3078
|
+
if (key === 'href') {
|
|
3079
|
+
if (props[key] == null || typeof props[key] !== 'string' && typeof props[key] !== 'object') {
|
|
3080
|
+
throw createPropError({
|
|
3081
|
+
key,
|
|
3082
|
+
expected: '`string` or `object`',
|
|
3083
|
+
actual: props[key] === null ? 'null' : typeof props[key]
|
|
3084
|
+
});
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
3087
|
+
});
|
|
3088
|
+
// TypeScript trick for type-guarding:
|
|
3089
|
+
const optionalPropsGuard = {
|
|
3090
|
+
as: true,
|
|
3091
|
+
replace: true,
|
|
3092
|
+
scroll: true,
|
|
3093
|
+
shallow: true,
|
|
3094
|
+
passHref: true,
|
|
3095
|
+
prefetch: true,
|
|
3096
|
+
locale: true,
|
|
3097
|
+
onClick: true,
|
|
3098
|
+
onMouseEnter: true,
|
|
3099
|
+
onTouchStart: true,
|
|
3100
|
+
legacyBehavior: true,
|
|
3101
|
+
onNavigate: true
|
|
3102
|
+
};
|
|
3103
|
+
const optionalProps = Object.keys(optionalPropsGuard);
|
|
3104
|
+
optionalProps.forEach((key)=>{
|
|
3105
|
+
const valType = typeof props[key];
|
|
3106
|
+
if (key === 'as') {
|
|
3107
|
+
if (props[key] && valType !== 'string' && valType !== 'object') {
|
|
3108
|
+
throw createPropError({
|
|
3109
|
+
key,
|
|
3110
|
+
expected: '`string` or `object`',
|
|
3111
|
+
actual: valType
|
|
3112
|
+
});
|
|
3113
|
+
}
|
|
3114
|
+
} else if (key === 'locale') {
|
|
3115
|
+
if (props[key] && valType !== 'string') {
|
|
3116
|
+
throw createPropError({
|
|
3117
|
+
key,
|
|
3118
|
+
expected: '`string`',
|
|
3119
|
+
actual: valType
|
|
3120
|
+
});
|
|
3121
|
+
}
|
|
3122
|
+
} else if (key === 'onClick' || key === 'onMouseEnter' || key === 'onTouchStart' || key === 'onNavigate') {
|
|
3123
|
+
if (props[key] && valType !== 'function') {
|
|
3124
|
+
throw createPropError({
|
|
3125
|
+
key,
|
|
3126
|
+
expected: '`function`',
|
|
3127
|
+
actual: valType
|
|
3128
|
+
});
|
|
3129
|
+
}
|
|
3130
|
+
} else if (key === 'replace' || key === 'scroll' || key === 'shallow' || key === 'passHref' || key === 'prefetch' || key === 'legacyBehavior') {
|
|
3131
|
+
if (props[key] != null && valType !== 'boolean') {
|
|
3132
|
+
throw createPropError({
|
|
3133
|
+
key,
|
|
3134
|
+
expected: '`boolean`',
|
|
3135
|
+
actual: valType
|
|
3136
|
+
});
|
|
3137
|
+
}
|
|
3138
|
+
} else ;
|
|
3139
|
+
});
|
|
3140
|
+
}
|
|
3141
|
+
const { href, as } = _react.default.useMemo(()=>{
|
|
3142
|
+
if (!router) {
|
|
3143
|
+
const resolvedHref = formatStringOrUrl(hrefProp);
|
|
3144
|
+
return {
|
|
3145
|
+
href: resolvedHref,
|
|
3146
|
+
as: asProp ? formatStringOrUrl(asProp) : resolvedHref
|
|
3147
|
+
};
|
|
3148
|
+
}
|
|
3149
|
+
const [resolvedHref, resolvedAs] = (0, _resolvehref.resolveHref)(router, hrefProp, true);
|
|
3150
|
+
return {
|
|
3151
|
+
href: resolvedHref,
|
|
3152
|
+
as: asProp ? (0, _resolvehref.resolveHref)(router, asProp) : resolvedAs || resolvedHref
|
|
3153
|
+
};
|
|
3154
|
+
}, [
|
|
3155
|
+
router,
|
|
3156
|
+
hrefProp,
|
|
3157
|
+
asProp
|
|
3158
|
+
]);
|
|
3159
|
+
const previousHref = _react.default.useRef(href);
|
|
3160
|
+
const previousAs = _react.default.useRef(as);
|
|
3161
|
+
// This will return the first child, if multiple are provided it will throw an error
|
|
3162
|
+
let child;
|
|
3163
|
+
if (legacyBehavior) {
|
|
3164
|
+
if (process.env.NODE_ENV === 'development') {
|
|
3165
|
+
if (onClick) {
|
|
3166
|
+
console.warn('"onClick" was passed to <Link> with `href` of `' + hrefProp + '` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link');
|
|
3167
|
+
}
|
|
3168
|
+
if (onMouseEnterProp) {
|
|
3169
|
+
console.warn('"onMouseEnter" was passed to <Link> with `href` of `' + hrefProp + '` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link');
|
|
3170
|
+
}
|
|
3171
|
+
try {
|
|
3172
|
+
child = _react.default.Children.only(children);
|
|
3173
|
+
} catch (err) {
|
|
3174
|
+
if (!children) {
|
|
3175
|
+
throw Object.defineProperty(new Error("No children were passed to <Link> with `href` of `" + hrefProp + "` but one child is required https://nextjs.org/docs/messages/link-no-children"), "__NEXT_ERROR_CODE", {
|
|
3176
|
+
value: "E320",
|
|
3177
|
+
enumerable: false,
|
|
3178
|
+
configurable: true
|
|
3179
|
+
});
|
|
3180
|
+
}
|
|
3181
|
+
throw Object.defineProperty(new Error("Multiple children were passed to <Link> with `href` of `" + hrefProp + "` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children" + (typeof window !== 'undefined' ? " \nOpen your browser's console to view the Component stack trace." : '')), "__NEXT_ERROR_CODE", {
|
|
3182
|
+
value: "E266",
|
|
3183
|
+
enumerable: false,
|
|
3184
|
+
configurable: true
|
|
3185
|
+
});
|
|
3186
|
+
}
|
|
3187
|
+
} else {
|
|
3188
|
+
child = _react.default.Children.only(children);
|
|
3189
|
+
}
|
|
3190
|
+
} else {
|
|
3191
|
+
if (process.env.NODE_ENV === 'development') {
|
|
3192
|
+
if ((children == null ? void 0 : children.type) === 'a') {
|
|
3193
|
+
throw Object.defineProperty(new Error('Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'), "__NEXT_ERROR_CODE", {
|
|
3194
|
+
value: "E209",
|
|
3195
|
+
enumerable: false,
|
|
3196
|
+
configurable: true
|
|
3197
|
+
});
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
3201
|
+
const childRef = legacyBehavior ? child && typeof child === 'object' && child.ref : forwardedRef;
|
|
3202
|
+
const [setIntersectionRef, isVisible, resetVisible] = (0, _useintersection.useIntersection)({
|
|
3203
|
+
rootMargin: '200px'
|
|
3204
|
+
});
|
|
3205
|
+
const setIntersectionWithResetRef = _react.default.useCallback((el)=>{
|
|
3206
|
+
// Before the link getting observed, check if visible state need to be reset
|
|
3207
|
+
if (previousAs.current !== as || previousHref.current !== href) {
|
|
3208
|
+
resetVisible();
|
|
3209
|
+
previousAs.current = as;
|
|
3210
|
+
previousHref.current = href;
|
|
3211
|
+
}
|
|
3212
|
+
setIntersectionRef(el);
|
|
3213
|
+
}, [
|
|
3214
|
+
as,
|
|
3215
|
+
href,
|
|
3216
|
+
resetVisible,
|
|
3217
|
+
setIntersectionRef
|
|
3218
|
+
]);
|
|
3219
|
+
const setRef = (0, _usemergedref.useMergedRef)(setIntersectionWithResetRef, childRef);
|
|
3220
|
+
// Prefetch the URL if we haven't already and it's visible.
|
|
3221
|
+
_react.default.useEffect(()=>{
|
|
3222
|
+
// in dev, we only prefetch on hover to avoid wasting resources as the prefetch will trigger compiling the page.
|
|
3223
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3224
|
+
return;
|
|
3225
|
+
}
|
|
3226
|
+
if (!router) {
|
|
3227
|
+
return;
|
|
3228
|
+
}
|
|
3229
|
+
// If we don't need to prefetch the URL, don't do prefetch.
|
|
3230
|
+
if (!isVisible || !prefetchEnabled) {
|
|
3231
|
+
return;
|
|
3232
|
+
}
|
|
3233
|
+
// Prefetch the URL.
|
|
3234
|
+
prefetch(router, href, as, {
|
|
3235
|
+
locale
|
|
3236
|
+
});
|
|
3237
|
+
}, [
|
|
3238
|
+
as,
|
|
3239
|
+
href,
|
|
3240
|
+
isVisible,
|
|
3241
|
+
locale,
|
|
3242
|
+
prefetchEnabled,
|
|
3243
|
+
router == null ? void 0 : router.locale,
|
|
3244
|
+
router
|
|
3245
|
+
]);
|
|
3246
|
+
const childProps = {
|
|
3247
|
+
ref: setRef,
|
|
3248
|
+
onClick (e) {
|
|
3249
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3250
|
+
if (!e) {
|
|
3251
|
+
throw Object.defineProperty(new Error('Component rendered inside next/link has to pass click event to "onClick" prop.'), "__NEXT_ERROR_CODE", {
|
|
3252
|
+
value: "E312",
|
|
3253
|
+
enumerable: false,
|
|
3254
|
+
configurable: true
|
|
3255
|
+
});
|
|
3256
|
+
}
|
|
3257
|
+
}
|
|
3258
|
+
if (!legacyBehavior && typeof onClick === 'function') {
|
|
3259
|
+
onClick(e);
|
|
3260
|
+
}
|
|
3261
|
+
if (legacyBehavior && child.props && typeof child.props.onClick === 'function') {
|
|
3262
|
+
child.props.onClick(e);
|
|
3263
|
+
}
|
|
3264
|
+
if (!router) {
|
|
3265
|
+
return;
|
|
3266
|
+
}
|
|
3267
|
+
if (e.defaultPrevented) {
|
|
3268
|
+
return;
|
|
3269
|
+
}
|
|
3270
|
+
linkClicked(e, router, href, as, replace, shallow, scroll, locale, onNavigate);
|
|
3271
|
+
},
|
|
3272
|
+
onMouseEnter (e) {
|
|
3273
|
+
if (!legacyBehavior && typeof onMouseEnterProp === 'function') {
|
|
3274
|
+
onMouseEnterProp(e);
|
|
3275
|
+
}
|
|
3276
|
+
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === 'function') {
|
|
3277
|
+
child.props.onMouseEnter(e);
|
|
3278
|
+
}
|
|
3279
|
+
if (!router) {
|
|
3280
|
+
return;
|
|
3281
|
+
}
|
|
3282
|
+
prefetch(router, href, as, {
|
|
3283
|
+
locale,
|
|
3284
|
+
priority: true,
|
|
3285
|
+
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
|
|
3286
|
+
bypassPrefetchedCheck: true
|
|
3287
|
+
});
|
|
3288
|
+
},
|
|
3289
|
+
onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START ? undefined : function onTouchStart(e) {
|
|
3290
|
+
if (!legacyBehavior && typeof onTouchStartProp === 'function') {
|
|
3291
|
+
onTouchStartProp(e);
|
|
3292
|
+
}
|
|
3293
|
+
if (legacyBehavior && child.props && typeof child.props.onTouchStart === 'function') {
|
|
3294
|
+
child.props.onTouchStart(e);
|
|
3295
|
+
}
|
|
3296
|
+
if (!router) {
|
|
3297
|
+
return;
|
|
3298
|
+
}
|
|
3299
|
+
prefetch(router, href, as, {
|
|
3300
|
+
locale,
|
|
3301
|
+
priority: true,
|
|
3302
|
+
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
|
|
3303
|
+
bypassPrefetchedCheck: true
|
|
3304
|
+
});
|
|
3305
|
+
}
|
|
3306
|
+
};
|
|
3307
|
+
// If child is an <a> tag and doesn't have a href attribute, or if the 'passHref' property is
|
|
3308
|
+
// defined, we specify the current 'href', so that repetition is not needed by the user.
|
|
3309
|
+
// If the url is absolute, we can bypass the logic to prepend the domain and locale.
|
|
3310
|
+
if ((0, _utils.isAbsoluteUrl)(as)) {
|
|
3311
|
+
childProps.href = as;
|
|
3312
|
+
} else if (!legacyBehavior || passHref || child.type === 'a' && !('href' in child.props)) {
|
|
3313
|
+
const curLocale = typeof locale !== 'undefined' ? locale : router == null ? void 0 : router.locale;
|
|
3314
|
+
// we only render domain locales if we are currently on a domain locale
|
|
3315
|
+
// so that locale links are still visitable in development/preview envs
|
|
3316
|
+
const localeDomain = (router == null ? void 0 : router.isLocaleDomain) && (0, _getdomainlocale.getDomainLocale)(as, curLocale, router == null ? void 0 : router.locales, router == null ? void 0 : router.domainLocales);
|
|
3317
|
+
childProps.href = localeDomain || (0, _addbasepath.addBasePath)((0, _addlocale.addLocale)(as, curLocale, router == null ? void 0 : router.defaultLocale));
|
|
3318
|
+
}
|
|
3319
|
+
if (legacyBehavior) {
|
|
3320
|
+
if (process.env.NODE_ENV === 'development') {
|
|
3321
|
+
(0, _erroronce.errorOnce)('`legacyBehavior` is deprecated and will be removed in a future ' + 'release. A codemod is available to upgrade your components:\n\n' + 'npx @next/codemod@latest new-link .\n\n' + 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components');
|
|
3322
|
+
}
|
|
3323
|
+
return /*#__PURE__*/ _react.default.cloneElement(child, childProps);
|
|
3324
|
+
}
|
|
3325
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("a", {
|
|
3326
|
+
...restProps,
|
|
3327
|
+
...childProps,
|
|
3328
|
+
children: children
|
|
3329
|
+
});
|
|
3330
|
+
});
|
|
3331
|
+
const LinkStatusContext = /*#__PURE__*/ (0, _react.createContext)({
|
|
3332
|
+
// We do not support link status in the Pages Router, so we always return false
|
|
3333
|
+
pending: false
|
|
3334
|
+
});
|
|
3335
|
+
const useLinkStatus = ()=>{
|
|
3336
|
+
// This behaviour is like React's useFormStatus. When the component is not under
|
|
3337
|
+
// a <form> tag, it will get the default value, instead of throwing an error.
|
|
3338
|
+
return (0, _react.useContext)(LinkStatusContext);
|
|
3339
|
+
};
|
|
3340
|
+
const _default = Link;
|
|
3341
|
+
|
|
3342
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
3343
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
3344
|
+
Object.assign(exports.default, exports);
|
|
3345
|
+
module.exports = exports.default;
|
|
3346
|
+
}
|
|
3347
|
+
|
|
3348
|
+
|
|
3349
|
+
} (link$1, link$1.exports));
|
|
3350
|
+
return link$1.exports;
|
|
3351
|
+
}
|
|
3352
|
+
|
|
3353
|
+
var link;
|
|
3354
|
+
var hasRequiredLink;
|
|
3355
|
+
|
|
3356
|
+
function requireLink () {
|
|
3357
|
+
if (hasRequiredLink) return link;
|
|
3358
|
+
hasRequiredLink = 1;
|
|
3359
|
+
link = requireLink$1();
|
|
3360
|
+
return link;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3363
|
+
var linkExports = requireLink();
|
|
3364
|
+
const Link = /*@__PURE__*/getDefaultExportFromCjs(linkExports);
|
|
3365
|
+
|
|
3366
|
+
const NavItems = ({ items }) => {
|
|
3367
|
+
const pathname = navigationExports.usePathname();
|
|
3368
|
+
return /* @__PURE__ */ jsx(Stack, { gap: 0, children: items.map(({ href, isActive, ...navLinkProps }) => {
|
|
3369
|
+
if (href) {
|
|
3370
|
+
const active = isActive ?? href.includes(pathname);
|
|
3371
|
+
return /* @__PURE__ */ jsx(
|
|
3372
|
+
NavLink,
|
|
3373
|
+
{
|
|
3374
|
+
active,
|
|
3375
|
+
component: Link,
|
|
3376
|
+
prefetch: false,
|
|
3377
|
+
href,
|
|
3378
|
+
...navLinkProps
|
|
3379
|
+
},
|
|
3380
|
+
navLinkProps.label
|
|
3381
|
+
);
|
|
3382
|
+
}
|
|
3383
|
+
return /* @__PURE__ */ jsx(
|
|
3384
|
+
NavLink,
|
|
3385
|
+
{
|
|
3386
|
+
active: isActive,
|
|
3387
|
+
component: "button",
|
|
3388
|
+
...navLinkProps
|
|
3389
|
+
},
|
|
3390
|
+
navLinkProps.label
|
|
3391
|
+
);
|
|
3392
|
+
}) });
|
|
3393
|
+
};
|
|
3394
|
+
|
|
3395
|
+
export { EmptyState, InfinityLoader, NavItems, SelectInfinity };
|