lkd-web-kit 0.0.1 → 0.0.3

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.
@@ -5,8 +5,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
  const require$$1 = require('react/jsx-runtime');
6
6
  const core = require('@mantine/core');
7
7
  const require$$0 = require('react');
8
- const useFetchNextPageOnScroll = require('./useFetchNextPageOnScroll-Fqj7Vp-O.cjs');
9
- const navigation = require('./navigation-DnFkn_t2.cjs');
8
+ const reactHookForm = require('react-hook-form');
9
+ const zod = require('zod');
10
10
 
11
11
  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}
12
12
 
@@ -100,6 +100,52 @@ const InfinityLoader = ({ infinity, loaderProps, ...props }) => {
100
100
  return /* @__PURE__ */ require$$1.jsx(core.Center, { ...props, children: infinity.isFetching ? /* @__PURE__ */ require$$1.jsx(core.Loader, { ...loaderProps }) : !infinity.hasNextPage && (infinity.data?.pages.length ?? 0) > 1 && /* @__PURE__ */ require$$1.jsx("p", { children: "No hay más resultados" }) });
101
101
  };
102
102
 
103
+ const useOnScrollProgress = (triggerPercentage, callback, elementRef) => {
104
+ if (triggerPercentage < 0 || triggerPercentage > 1) {
105
+ throw new Error("El porcentaje debe estar entre 0 y 1");
106
+ }
107
+ require$$0.useEffect(() => {
108
+ let hasTriggered = false;
109
+ const handleScroll = () => {
110
+ const el = elementRef?.current;
111
+ const target = el ?? document.documentElement;
112
+ const scrollHeight = target.scrollHeight - target.clientHeight;
113
+ const scrollTop = el ? target.scrollTop : window.scrollY;
114
+ const scrollProgress = scrollHeight > 0 ? Math.min(1, scrollTop / scrollHeight) : 0;
115
+ if (!hasTriggered && scrollProgress >= triggerPercentage) {
116
+ callback();
117
+ hasTriggered = true;
118
+ }
119
+ };
120
+ const scrollTarget = elementRef?.current ?? window;
121
+ scrollTarget.addEventListener("scroll", handleScroll);
122
+ handleScroll();
123
+ return () => {
124
+ scrollTarget.removeEventListener("scroll", handleScroll);
125
+ };
126
+ }, [triggerPercentage, callback, elementRef]);
127
+ };
128
+
129
+ const useFetchNextPageOnScroll = (infinity, elementRef) => {
130
+ useOnScrollProgress(
131
+ 0.9,
132
+ () => {
133
+ if (infinity.hasNextPage) {
134
+ infinity.fetchNextPage();
135
+ }
136
+ },
137
+ elementRef
138
+ );
139
+ require$$0.useEffect(() => {
140
+ const el = elementRef?.current;
141
+ const scrollTarget = el ?? document.documentElement;
142
+ const hasScroll = scrollTarget.scrollHeight > scrollTarget.clientHeight;
143
+ if (!hasScroll && infinity.hasNextPage) {
144
+ infinity.fetchNextPage();
145
+ }
146
+ }, [infinity.data, elementRef]);
147
+ };
148
+
103
149
  function SelectInfinity({
104
150
  value,
105
151
  onChange,
@@ -133,7 +179,7 @@ function SelectInfinity({
133
179
  ));
134
180
  const selectedOption = data.find((i) => i.value === value);
135
181
  const scrollAreaRef = require$$0.useRef(null);
136
- useFetchNextPageOnScroll.useFetchNextPageOnScroll(infinity, scrollAreaRef);
182
+ useFetchNextPageOnScroll(infinity, scrollAreaRef);
137
183
  return /* @__PURE__ */ require$$1.jsxs(
138
184
  core.Combobox,
139
185
  {
@@ -212,6 +258,53 @@ function getDefaultExportFromCjs (x) {
212
258
 
213
259
  var link$1 = {exports: {}};
214
260
 
261
+ var _interop_require_wildcard = {};
262
+
263
+ var hasRequired_interop_require_wildcard;
264
+
265
+ function require_interop_require_wildcard () {
266
+ if (hasRequired_interop_require_wildcard) return _interop_require_wildcard;
267
+ hasRequired_interop_require_wildcard = 1;
268
+
269
+ function _getRequireWildcardCache(nodeInterop) {
270
+ if (typeof WeakMap !== "function") return null;
271
+
272
+ var cacheBabelInterop = new WeakMap();
273
+ var cacheNodeInterop = new WeakMap();
274
+
275
+ return (_getRequireWildcardCache = function(nodeInterop) {
276
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
277
+ })(nodeInterop);
278
+ }
279
+ function _interop_require_wildcard$1(obj, nodeInterop) {
280
+ if (!nodeInterop && obj && obj.__esModule) return obj;
281
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj };
282
+
283
+ var cache = _getRequireWildcardCache(nodeInterop);
284
+
285
+ if (cache && cache.has(obj)) return cache.get(obj);
286
+
287
+ var newObj = { __proto__: null };
288
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
289
+
290
+ for (var key in obj) {
291
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
292
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
293
+ if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
294
+ else newObj[key] = obj[key];
295
+ }
296
+ }
297
+
298
+ newObj.default = obj;
299
+
300
+ if (cache) cache.set(obj, newObj);
301
+
302
+ return newObj;
303
+ }
304
+ _interop_require_wildcard._ = _interop_require_wildcard$1;
305
+ return _interop_require_wildcard;
306
+ }
307
+
215
308
  var resolveHref = {exports: {}};
216
309
 
217
310
  var querystring = {};
@@ -330,7 +423,7 @@ function requireFormatUrl () {
330
423
  return urlObjectKeys;
331
424
  }
332
425
  });
333
- const _interop_require_wildcard = /*@__PURE__*/ navigation.require_interop_require_wildcard();
426
+ const _interop_require_wildcard = /*@__PURE__*/ require_interop_require_wildcard();
334
427
  const _querystring = /*#__PURE__*/ _interop_require_wildcard._(requireQuerystring());
335
428
  const slashedProtocols = /https?|ftp|gopher|file/;
336
429
  function formatUrl(urlObj) {
@@ -1153,6 +1246,63 @@ function requireEnsureLeadingSlash () {
1153
1246
  return ensureLeadingSlash;
1154
1247
  }
1155
1248
 
1249
+ var segment = {};
1250
+
1251
+ var hasRequiredSegment;
1252
+
1253
+ function requireSegment () {
1254
+ if (hasRequiredSegment) return segment;
1255
+ hasRequiredSegment = 1;
1256
+ (function (exports) {
1257
+ Object.defineProperty(exports, "__esModule", {
1258
+ value: true
1259
+ });
1260
+ function _export(target, all) {
1261
+ for(var name in all)Object.defineProperty(target, name, {
1262
+ enumerable: true,
1263
+ get: all[name]
1264
+ });
1265
+ }
1266
+ _export(exports, {
1267
+ DEFAULT_SEGMENT_KEY: function() {
1268
+ return DEFAULT_SEGMENT_KEY;
1269
+ },
1270
+ PAGE_SEGMENT_KEY: function() {
1271
+ return PAGE_SEGMENT_KEY;
1272
+ },
1273
+ addSearchParamsIfPageSegment: function() {
1274
+ return addSearchParamsIfPageSegment;
1275
+ },
1276
+ isGroupSegment: function() {
1277
+ return isGroupSegment;
1278
+ },
1279
+ isParallelRouteSegment: function() {
1280
+ return isParallelRouteSegment;
1281
+ }
1282
+ });
1283
+ function isGroupSegment(segment) {
1284
+ // Use array[0] for performant purpose
1285
+ return segment[0] === '(' && segment.endsWith(')');
1286
+ }
1287
+ function isParallelRouteSegment(segment) {
1288
+ return segment.startsWith('@') && segment !== '@children';
1289
+ }
1290
+ function addSearchParamsIfPageSegment(segment, searchParams) {
1291
+ const isPageSegment = segment.includes(PAGE_SEGMENT_KEY);
1292
+ if (isPageSegment) {
1293
+ const stringifiedQuery = JSON.stringify(searchParams);
1294
+ return stringifiedQuery !== '{}' ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery : PAGE_SEGMENT_KEY;
1295
+ }
1296
+ return segment;
1297
+ }
1298
+ const PAGE_SEGMENT_KEY = '__PAGE__';
1299
+ const DEFAULT_SEGMENT_KEY = '__DEFAULT__';
1300
+
1301
+
1302
+ } (segment));
1303
+ return segment;
1304
+ }
1305
+
1156
1306
  var hasRequiredAppPaths;
1157
1307
 
1158
1308
  function requireAppPaths () {
@@ -1177,7 +1327,7 @@ function requireAppPaths () {
1177
1327
  }
1178
1328
  });
1179
1329
  const _ensureleadingslash = requireEnsureLeadingSlash();
1180
- const _segment = navigation.requireSegment();
1330
+ const _segment = requireSegment();
1181
1331
  function normalizeAppPath(route) {
1182
1332
  return (0, _ensureleadingslash.ensureLeadingSlash)(route.split('/').reduce((pathname, segment, index, segments)=>{
1183
1333
  // Empty segments are ignored.
@@ -2342,6 +2492,21 @@ function requireAddLocale () {
2342
2492
 
2343
2493
  var routerContext_sharedRuntime = {};
2344
2494
 
2495
+ var _interop_require_default = {};
2496
+
2497
+ var hasRequired_interop_require_default;
2498
+
2499
+ function require_interop_require_default () {
2500
+ if (hasRequired_interop_require_default) return _interop_require_default;
2501
+ hasRequired_interop_require_default = 1;
2502
+
2503
+ function _interop_require_default$1(obj) {
2504
+ return obj && obj.__esModule ? obj : { default: obj };
2505
+ }
2506
+ _interop_require_default._ = _interop_require_default$1;
2507
+ return _interop_require_default;
2508
+ }
2509
+
2345
2510
  var hasRequiredRouterContext_sharedRuntime;
2346
2511
 
2347
2512
  function requireRouterContext_sharedRuntime () {
@@ -2357,7 +2522,7 @@ function requireRouterContext_sharedRuntime () {
2357
2522
  return RouterContext;
2358
2523
  }
2359
2524
  });
2360
- const _interop_require_default = /*@__PURE__*/ navigation.require_interop_require_default();
2525
+ const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
2361
2526
  const _react = /*#__PURE__*/ _interop_require_default._(require$$0);
2362
2527
  const RouterContext = _react.default.createContext(null);
2363
2528
  if (process.env.NODE_ENV !== 'production') {
@@ -2942,7 +3107,7 @@ function requireLink$1 () {
2942
3107
  return useLinkStatus;
2943
3108
  }
2944
3109
  });
2945
- const _interop_require_wildcard = /*@__PURE__*/ navigation.require_interop_require_wildcard();
3110
+ const _interop_require_wildcard = /*@__PURE__*/ require_interop_require_wildcard();
2946
3111
  const _jsxruntime = require$$1;
2947
3112
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require$$0);
2948
3113
  const _resolvehref = requireResolveHref();
@@ -3367,36 +3532,2802 @@ function requireLink () {
3367
3532
  var linkExports = requireLink();
3368
3533
  const Link = /*@__PURE__*/getDefaultExportFromCjs(linkExports);
3369
3534
 
3370
- const NavItems = ({ items }) => {
3371
- const pathname = navigation.navigationExports.usePathname();
3372
- return /* @__PURE__ */ require$$1.jsx(core.Stack, { gap: 0, children: items.map(({ href, isActive, ...navLinkProps }) => {
3373
- if (href) {
3374
- const active = isActive ?? href.includes(pathname);
3375
- return /* @__PURE__ */ require$$1.jsx(
3376
- core.NavLink,
3377
- {
3378
- active,
3379
- component: Link,
3380
- prefetch: false,
3381
- href,
3382
- ...navLinkProps
3383
- },
3384
- navLinkProps.label
3385
- );
3386
- }
3387
- return /* @__PURE__ */ require$$1.jsx(
3388
- core.NavLink,
3389
- {
3390
- active: isActive,
3391
- component: "button",
3392
- ...navLinkProps
3393
- },
3394
- navLinkProps.label
3395
- );
3396
- }) });
3535
+ var navigation$1 = {exports: {}};
3536
+
3537
+ var appRouterContext_sharedRuntime = {};
3538
+
3539
+ var hasRequiredAppRouterContext_sharedRuntime;
3540
+
3541
+ function requireAppRouterContext_sharedRuntime () {
3542
+ if (hasRequiredAppRouterContext_sharedRuntime) return appRouterContext_sharedRuntime;
3543
+ hasRequiredAppRouterContext_sharedRuntime = 1;
3544
+ (function (exports) {
3545
+ 'use client';
3546
+ Object.defineProperty(exports, "__esModule", {
3547
+ value: true
3548
+ });
3549
+ function _export(target, all) {
3550
+ for(var name in all)Object.defineProperty(target, name, {
3551
+ enumerable: true,
3552
+ get: all[name]
3553
+ });
3554
+ }
3555
+ _export(exports, {
3556
+ AppRouterContext: function() {
3557
+ return AppRouterContext;
3558
+ },
3559
+ GlobalLayoutRouterContext: function() {
3560
+ return GlobalLayoutRouterContext;
3561
+ },
3562
+ LayoutRouterContext: function() {
3563
+ return LayoutRouterContext;
3564
+ },
3565
+ MissingSlotContext: function() {
3566
+ return MissingSlotContext;
3567
+ },
3568
+ TemplateContext: function() {
3569
+ return TemplateContext;
3570
+ }
3571
+ });
3572
+ const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
3573
+ const _react = /*#__PURE__*/ _interop_require_default._(require$$0);
3574
+ const AppRouterContext = _react.default.createContext(null);
3575
+ const LayoutRouterContext = _react.default.createContext(null);
3576
+ const GlobalLayoutRouterContext = _react.default.createContext(null);
3577
+ const TemplateContext = _react.default.createContext(null);
3578
+ if (process.env.NODE_ENV !== 'production') {
3579
+ AppRouterContext.displayName = 'AppRouterContext';
3580
+ LayoutRouterContext.displayName = 'LayoutRouterContext';
3581
+ GlobalLayoutRouterContext.displayName = 'GlobalLayoutRouterContext';
3582
+ TemplateContext.displayName = 'TemplateContext';
3583
+ }
3584
+ const MissingSlotContext = _react.default.createContext(new Set());
3585
+
3586
+
3587
+ } (appRouterContext_sharedRuntime));
3588
+ return appRouterContext_sharedRuntime;
3589
+ }
3590
+
3591
+ var hooksClientContext_sharedRuntime = {};
3592
+
3593
+ var hasRequiredHooksClientContext_sharedRuntime;
3594
+
3595
+ function requireHooksClientContext_sharedRuntime () {
3596
+ if (hasRequiredHooksClientContext_sharedRuntime) return hooksClientContext_sharedRuntime;
3597
+ hasRequiredHooksClientContext_sharedRuntime = 1;
3598
+ (function (exports) {
3599
+ 'use client';
3600
+ Object.defineProperty(exports, "__esModule", {
3601
+ value: true
3602
+ });
3603
+ function _export(target, all) {
3604
+ for(var name in all)Object.defineProperty(target, name, {
3605
+ enumerable: true,
3606
+ get: all[name]
3607
+ });
3608
+ }
3609
+ _export(exports, {
3610
+ PathParamsContext: function() {
3611
+ return PathParamsContext;
3612
+ },
3613
+ PathnameContext: function() {
3614
+ return PathnameContext;
3615
+ },
3616
+ SearchParamsContext: function() {
3617
+ return SearchParamsContext;
3618
+ }
3619
+ });
3620
+ const _react = require$$0;
3621
+ const SearchParamsContext = (0, _react.createContext)(null);
3622
+ const PathnameContext = (0, _react.createContext)(null);
3623
+ const PathParamsContext = (0, _react.createContext)(null);
3624
+ if (process.env.NODE_ENV !== 'production') {
3625
+ SearchParamsContext.displayName = 'SearchParamsContext';
3626
+ PathnameContext.displayName = 'PathnameContext';
3627
+ PathParamsContext.displayName = 'PathParamsContext';
3628
+ }
3629
+
3630
+
3631
+ } (hooksClientContext_sharedRuntime));
3632
+ return hooksClientContext_sharedRuntime;
3633
+ }
3634
+
3635
+ var getSegmentValue = {exports: {}};
3636
+
3637
+ var hasRequiredGetSegmentValue;
3638
+
3639
+ function requireGetSegmentValue () {
3640
+ if (hasRequiredGetSegmentValue) return getSegmentValue.exports;
3641
+ hasRequiredGetSegmentValue = 1;
3642
+ (function (module, exports) {
3643
+ Object.defineProperty(exports, "__esModule", {
3644
+ value: true
3645
+ });
3646
+ Object.defineProperty(exports, "getSegmentValue", {
3647
+ enumerable: true,
3648
+ get: function() {
3649
+ return getSegmentValue;
3650
+ }
3651
+ });
3652
+ function getSegmentValue(segment) {
3653
+ return Array.isArray(segment) ? segment[1] : segment;
3654
+ }
3655
+
3656
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
3657
+ Object.defineProperty(exports.default, '__esModule', { value: true });
3658
+ Object.assign(exports.default, exports);
3659
+ module.exports = exports.default;
3660
+ }
3661
+
3662
+
3663
+ } (getSegmentValue, getSegmentValue.exports));
3664
+ return getSegmentValue.exports;
3665
+ }
3666
+
3667
+ var navigation_reactServer = {exports: {}};
3668
+
3669
+ var redirect = {exports: {}};
3670
+
3671
+ var redirectStatusCode = {exports: {}};
3672
+
3673
+ var hasRequiredRedirectStatusCode;
3674
+
3675
+ function requireRedirectStatusCode () {
3676
+ if (hasRequiredRedirectStatusCode) return redirectStatusCode.exports;
3677
+ hasRequiredRedirectStatusCode = 1;
3678
+ (function (module, exports) {
3679
+ Object.defineProperty(exports, "__esModule", {
3680
+ value: true
3681
+ });
3682
+ Object.defineProperty(exports, "RedirectStatusCode", {
3683
+ enumerable: true,
3684
+ get: function() {
3685
+ return RedirectStatusCode;
3686
+ }
3687
+ });
3688
+ var RedirectStatusCode = /*#__PURE__*/ function(RedirectStatusCode) {
3689
+ RedirectStatusCode[RedirectStatusCode["SeeOther"] = 303] = "SeeOther";
3690
+ RedirectStatusCode[RedirectStatusCode["TemporaryRedirect"] = 307] = "TemporaryRedirect";
3691
+ RedirectStatusCode[RedirectStatusCode["PermanentRedirect"] = 308] = "PermanentRedirect";
3692
+ return RedirectStatusCode;
3693
+ }({});
3694
+
3695
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
3696
+ Object.defineProperty(exports.default, '__esModule', { value: true });
3697
+ Object.assign(exports.default, exports);
3698
+ module.exports = exports.default;
3699
+ }
3700
+
3701
+
3702
+ } (redirectStatusCode, redirectStatusCode.exports));
3703
+ return redirectStatusCode.exports;
3704
+ }
3705
+
3706
+ var redirectError = {exports: {}};
3707
+
3708
+ var hasRequiredRedirectError;
3709
+
3710
+ function requireRedirectError () {
3711
+ if (hasRequiredRedirectError) return redirectError.exports;
3712
+ hasRequiredRedirectError = 1;
3713
+ (function (module, exports) {
3714
+ Object.defineProperty(exports, "__esModule", {
3715
+ value: true
3716
+ });
3717
+ function _export(target, all) {
3718
+ for(var name in all)Object.defineProperty(target, name, {
3719
+ enumerable: true,
3720
+ get: all[name]
3721
+ });
3722
+ }
3723
+ _export(exports, {
3724
+ REDIRECT_ERROR_CODE: function() {
3725
+ return REDIRECT_ERROR_CODE;
3726
+ },
3727
+ RedirectType: function() {
3728
+ return RedirectType;
3729
+ },
3730
+ isRedirectError: function() {
3731
+ return isRedirectError;
3732
+ }
3733
+ });
3734
+ const _redirectstatuscode = requireRedirectStatusCode();
3735
+ const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT';
3736
+ var RedirectType = /*#__PURE__*/ function(RedirectType) {
3737
+ RedirectType["push"] = "push";
3738
+ RedirectType["replace"] = "replace";
3739
+ return RedirectType;
3740
+ }({});
3741
+ function isRedirectError(error) {
3742
+ if (typeof error !== 'object' || error === null || !('digest' in error) || typeof error.digest !== 'string') {
3743
+ return false;
3744
+ }
3745
+ const digest = error.digest.split(';');
3746
+ const [errorCode, type] = digest;
3747
+ const destination = digest.slice(2, -2).join(';');
3748
+ const status = digest.at(-2);
3749
+ const statusCode = Number(status);
3750
+ return errorCode === REDIRECT_ERROR_CODE && (type === 'replace' || type === 'push') && typeof destination === 'string' && !isNaN(statusCode) && statusCode in _redirectstatuscode.RedirectStatusCode;
3751
+ }
3752
+
3753
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
3754
+ Object.defineProperty(exports.default, '__esModule', { value: true });
3755
+ Object.assign(exports.default, exports);
3756
+ module.exports = exports.default;
3757
+ }
3758
+
3759
+
3760
+ } (redirectError, redirectError.exports));
3761
+ return redirectError.exports;
3762
+ }
3763
+
3764
+ var actionAsyncStorage_external = {};
3765
+
3766
+ var actionAsyncStorageInstance = {};
3767
+
3768
+ var asyncLocalStorage = {};
3769
+
3770
+ var hasRequiredAsyncLocalStorage;
3771
+
3772
+ function requireAsyncLocalStorage () {
3773
+ if (hasRequiredAsyncLocalStorage) return asyncLocalStorage;
3774
+ hasRequiredAsyncLocalStorage = 1;
3775
+ (function (exports) {
3776
+ Object.defineProperty(exports, "__esModule", {
3777
+ value: true
3778
+ });
3779
+ function _export(target, all) {
3780
+ for(var name in all)Object.defineProperty(target, name, {
3781
+ enumerable: true,
3782
+ get: all[name]
3783
+ });
3784
+ }
3785
+ _export(exports, {
3786
+ bindSnapshot: function() {
3787
+ return bindSnapshot;
3788
+ },
3789
+ createAsyncLocalStorage: function() {
3790
+ return createAsyncLocalStorage;
3791
+ },
3792
+ createSnapshot: function() {
3793
+ return createSnapshot;
3794
+ }
3795
+ });
3796
+ const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), "__NEXT_ERROR_CODE", {
3797
+ value: "E504",
3798
+ enumerable: false,
3799
+ configurable: true
3800
+ });
3801
+ class FakeAsyncLocalStorage {
3802
+ disable() {
3803
+ throw sharedAsyncLocalStorageNotAvailableError;
3804
+ }
3805
+ getStore() {
3806
+ // This fake implementation of AsyncLocalStorage always returns `undefined`.
3807
+ return undefined;
3808
+ }
3809
+ run() {
3810
+ throw sharedAsyncLocalStorageNotAvailableError;
3811
+ }
3812
+ exit() {
3813
+ throw sharedAsyncLocalStorageNotAvailableError;
3814
+ }
3815
+ enterWith() {
3816
+ throw sharedAsyncLocalStorageNotAvailableError;
3817
+ }
3818
+ static bind(fn) {
3819
+ return fn;
3820
+ }
3821
+ }
3822
+ const maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage;
3823
+ function createAsyncLocalStorage() {
3824
+ if (maybeGlobalAsyncLocalStorage) {
3825
+ return new maybeGlobalAsyncLocalStorage();
3826
+ }
3827
+ return new FakeAsyncLocalStorage();
3828
+ }
3829
+ function bindSnapshot(fn) {
3830
+ if (maybeGlobalAsyncLocalStorage) {
3831
+ return maybeGlobalAsyncLocalStorage.bind(fn);
3832
+ }
3833
+ return FakeAsyncLocalStorage.bind(fn);
3834
+ }
3835
+ function createSnapshot() {
3836
+ if (maybeGlobalAsyncLocalStorage) {
3837
+ return maybeGlobalAsyncLocalStorage.snapshot();
3838
+ }
3839
+ return function(fn, ...args) {
3840
+ return fn(...args);
3841
+ };
3842
+ }
3843
+
3844
+
3845
+ } (asyncLocalStorage));
3846
+ return asyncLocalStorage;
3847
+ }
3848
+
3849
+ var hasRequiredActionAsyncStorageInstance;
3850
+
3851
+ function requireActionAsyncStorageInstance () {
3852
+ if (hasRequiredActionAsyncStorageInstance) return actionAsyncStorageInstance;
3853
+ hasRequiredActionAsyncStorageInstance = 1;
3854
+ (function (exports) {
3855
+ Object.defineProperty(exports, "__esModule", {
3856
+ value: true
3857
+ });
3858
+ Object.defineProperty(exports, "actionAsyncStorageInstance", {
3859
+ enumerable: true,
3860
+ get: function() {
3861
+ return actionAsyncStorageInstance;
3862
+ }
3863
+ });
3864
+ const _asynclocalstorage = requireAsyncLocalStorage();
3865
+ const actionAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
3866
+
3867
+
3868
+ } (actionAsyncStorageInstance));
3869
+ return actionAsyncStorageInstance;
3870
+ }
3871
+
3872
+ var hasRequiredActionAsyncStorage_external;
3873
+
3874
+ function requireActionAsyncStorage_external () {
3875
+ if (hasRequiredActionAsyncStorage_external) return actionAsyncStorage_external;
3876
+ hasRequiredActionAsyncStorage_external = 1;
3877
+ (function (exports) {
3878
+ Object.defineProperty(exports, "__esModule", {
3879
+ value: true
3880
+ });
3881
+ Object.defineProperty(exports, "actionAsyncStorage", {
3882
+ enumerable: true,
3883
+ get: function() {
3884
+ return _actionasyncstorageinstance.actionAsyncStorageInstance;
3885
+ }
3886
+ });
3887
+ const _actionasyncstorageinstance = requireActionAsyncStorageInstance();
3888
+
3889
+
3890
+ } (actionAsyncStorage_external));
3891
+ return actionAsyncStorage_external;
3892
+ }
3893
+
3894
+ var hasRequiredRedirect;
3895
+
3896
+ function requireRedirect () {
3897
+ if (hasRequiredRedirect) return redirect.exports;
3898
+ hasRequiredRedirect = 1;
3899
+ (function (module, exports) {
3900
+ Object.defineProperty(exports, "__esModule", {
3901
+ value: true
3902
+ });
3903
+ function _export(target, all) {
3904
+ for(var name in all)Object.defineProperty(target, name, {
3905
+ enumerable: true,
3906
+ get: all[name]
3907
+ });
3908
+ }
3909
+ _export(exports, {
3910
+ getRedirectError: function() {
3911
+ return getRedirectError;
3912
+ },
3913
+ getRedirectStatusCodeFromError: function() {
3914
+ return getRedirectStatusCodeFromError;
3915
+ },
3916
+ getRedirectTypeFromError: function() {
3917
+ return getRedirectTypeFromError;
3918
+ },
3919
+ getURLFromRedirectError: function() {
3920
+ return getURLFromRedirectError;
3921
+ },
3922
+ permanentRedirect: function() {
3923
+ return permanentRedirect;
3924
+ },
3925
+ redirect: function() {
3926
+ return redirect;
3927
+ }
3928
+ });
3929
+ const _redirectstatuscode = requireRedirectStatusCode();
3930
+ const _redirecterror = requireRedirectError();
3931
+ const actionAsyncStorage = typeof window === 'undefined' ? requireActionAsyncStorage_external().actionAsyncStorage : undefined;
3932
+ function getRedirectError(url, type, statusCode) {
3933
+ if (statusCode === void 0) statusCode = _redirectstatuscode.RedirectStatusCode.TemporaryRedirect;
3934
+ const error = Object.defineProperty(new Error(_redirecterror.REDIRECT_ERROR_CODE), "__NEXT_ERROR_CODE", {
3935
+ value: "E394",
3936
+ enumerable: false,
3937
+ configurable: true
3938
+ });
3939
+ error.digest = _redirecterror.REDIRECT_ERROR_CODE + ";" + type + ";" + url + ";" + statusCode + ";";
3940
+ return error;
3941
+ }
3942
+ function redirect(/** The URL to redirect to */ url, type) {
3943
+ var _actionAsyncStorage_getStore;
3944
+ type != null ? type : type = (actionAsyncStorage == null ? void 0 : (_actionAsyncStorage_getStore = actionAsyncStorage.getStore()) == null ? void 0 : _actionAsyncStorage_getStore.isAction) ? _redirecterror.RedirectType.push : _redirecterror.RedirectType.replace;
3945
+ throw getRedirectError(url, type, _redirectstatuscode.RedirectStatusCode.TemporaryRedirect);
3946
+ }
3947
+ function permanentRedirect(/** The URL to redirect to */ url, type) {
3948
+ if (type === void 0) type = _redirecterror.RedirectType.replace;
3949
+ throw getRedirectError(url, type, _redirectstatuscode.RedirectStatusCode.PermanentRedirect);
3950
+ }
3951
+ function getURLFromRedirectError(error) {
3952
+ if (!(0, _redirecterror.isRedirectError)(error)) return null;
3953
+ // Slices off the beginning of the digest that contains the code and the
3954
+ // separating ';'.
3955
+ return error.digest.split(';').slice(2, -2).join(';');
3956
+ }
3957
+ function getRedirectTypeFromError(error) {
3958
+ if (!(0, _redirecterror.isRedirectError)(error)) {
3959
+ throw Object.defineProperty(new Error('Not a redirect error'), "__NEXT_ERROR_CODE", {
3960
+ value: "E260",
3961
+ enumerable: false,
3962
+ configurable: true
3963
+ });
3964
+ }
3965
+ return error.digest.split(';', 2)[1];
3966
+ }
3967
+ function getRedirectStatusCodeFromError(error) {
3968
+ if (!(0, _redirecterror.isRedirectError)(error)) {
3969
+ throw Object.defineProperty(new Error('Not a redirect error'), "__NEXT_ERROR_CODE", {
3970
+ value: "E260",
3971
+ enumerable: false,
3972
+ configurable: true
3973
+ });
3974
+ }
3975
+ return Number(error.digest.split(';').at(-2));
3976
+ }
3977
+
3978
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
3979
+ Object.defineProperty(exports.default, '__esModule', { value: true });
3980
+ Object.assign(exports.default, exports);
3981
+ module.exports = exports.default;
3982
+ }
3983
+
3984
+
3985
+ } (redirect, redirect.exports));
3986
+ return redirect.exports;
3987
+ }
3988
+
3989
+ var notFound = {exports: {}};
3990
+
3991
+ var httpAccessFallback = {exports: {}};
3992
+
3993
+ var hasRequiredHttpAccessFallback;
3994
+
3995
+ function requireHttpAccessFallback () {
3996
+ if (hasRequiredHttpAccessFallback) return httpAccessFallback.exports;
3997
+ hasRequiredHttpAccessFallback = 1;
3998
+ (function (module, exports) {
3999
+ Object.defineProperty(exports, "__esModule", {
4000
+ value: true
4001
+ });
4002
+ function _export(target, all) {
4003
+ for(var name in all)Object.defineProperty(target, name, {
4004
+ enumerable: true,
4005
+ get: all[name]
4006
+ });
4007
+ }
4008
+ _export(exports, {
4009
+ HTTPAccessErrorStatus: function() {
4010
+ return HTTPAccessErrorStatus;
4011
+ },
4012
+ HTTP_ERROR_FALLBACK_ERROR_CODE: function() {
4013
+ return HTTP_ERROR_FALLBACK_ERROR_CODE;
4014
+ },
4015
+ getAccessFallbackErrorTypeByStatus: function() {
4016
+ return getAccessFallbackErrorTypeByStatus;
4017
+ },
4018
+ getAccessFallbackHTTPStatus: function() {
4019
+ return getAccessFallbackHTTPStatus;
4020
+ },
4021
+ isHTTPAccessFallbackError: function() {
4022
+ return isHTTPAccessFallbackError;
4023
+ }
4024
+ });
4025
+ const HTTPAccessErrorStatus = {
4026
+ NOT_FOUND: 404,
4027
+ FORBIDDEN: 403,
4028
+ UNAUTHORIZED: 401
4029
+ };
4030
+ const ALLOWED_CODES = new Set(Object.values(HTTPAccessErrorStatus));
4031
+ const HTTP_ERROR_FALLBACK_ERROR_CODE = 'NEXT_HTTP_ERROR_FALLBACK';
4032
+ function isHTTPAccessFallbackError(error) {
4033
+ if (typeof error !== 'object' || error === null || !('digest' in error) || typeof error.digest !== 'string') {
4034
+ return false;
4035
+ }
4036
+ const [prefix, httpStatus] = error.digest.split(';');
4037
+ return prefix === HTTP_ERROR_FALLBACK_ERROR_CODE && ALLOWED_CODES.has(Number(httpStatus));
4038
+ }
4039
+ function getAccessFallbackHTTPStatus(error) {
4040
+ const httpStatus = error.digest.split(';')[1];
4041
+ return Number(httpStatus);
4042
+ }
4043
+ function getAccessFallbackErrorTypeByStatus(status) {
4044
+ switch(status){
4045
+ case 401:
4046
+ return 'unauthorized';
4047
+ case 403:
4048
+ return 'forbidden';
4049
+ case 404:
4050
+ return 'not-found';
4051
+ default:
4052
+ return;
4053
+ }
4054
+ }
4055
+
4056
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
4057
+ Object.defineProperty(exports.default, '__esModule', { value: true });
4058
+ Object.assign(exports.default, exports);
4059
+ module.exports = exports.default;
4060
+ }
4061
+
4062
+
4063
+ } (httpAccessFallback, httpAccessFallback.exports));
4064
+ return httpAccessFallback.exports;
4065
+ }
4066
+
4067
+ var hasRequiredNotFound;
4068
+
4069
+ function requireNotFound () {
4070
+ if (hasRequiredNotFound) return notFound.exports;
4071
+ hasRequiredNotFound = 1;
4072
+ (function (module, exports) {
4073
+ Object.defineProperty(exports, "__esModule", {
4074
+ value: true
4075
+ });
4076
+ Object.defineProperty(exports, "notFound", {
4077
+ enumerable: true,
4078
+ get: function() {
4079
+ return notFound;
4080
+ }
4081
+ });
4082
+ const _httpaccessfallback = requireHttpAccessFallback();
4083
+ /**
4084
+ * This function allows you to render the [not-found.js file](https://nextjs.org/docs/app/api-reference/file-conventions/not-found)
4085
+ * within a route segment as well as inject a tag.
4086
+ *
4087
+ * `notFound()` can be used in
4088
+ * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),
4089
+ * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and
4090
+ * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).
4091
+ *
4092
+ * - In a Server Component, this will insert a `<meta name="robots" content="noindex" />` meta tag and set the status code to 404.
4093
+ * - In a Route Handler or Server Action, it will serve a 404 to the caller.
4094
+ *
4095
+ * Read more: [Next.js Docs: `notFound`](https://nextjs.org/docs/app/api-reference/functions/not-found)
4096
+ */ const DIGEST = "" + _httpaccessfallback.HTTP_ERROR_FALLBACK_ERROR_CODE + ";404";
4097
+ function notFound() {
4098
+ // eslint-disable-next-line no-throw-literal
4099
+ const error = Object.defineProperty(new Error(DIGEST), "__NEXT_ERROR_CODE", {
4100
+ value: "E394",
4101
+ enumerable: false,
4102
+ configurable: true
4103
+ });
4104
+ error.digest = DIGEST;
4105
+ throw error;
4106
+ }
4107
+
4108
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
4109
+ Object.defineProperty(exports.default, '__esModule', { value: true });
4110
+ Object.assign(exports.default, exports);
4111
+ module.exports = exports.default;
4112
+ }
4113
+
4114
+
4115
+ } (notFound, notFound.exports));
4116
+ return notFound.exports;
4117
+ }
4118
+
4119
+ var forbidden = {exports: {}};
4120
+
4121
+ var hasRequiredForbidden;
4122
+
4123
+ function requireForbidden () {
4124
+ if (hasRequiredForbidden) return forbidden.exports;
4125
+ hasRequiredForbidden = 1;
4126
+ (function (module, exports) {
4127
+ Object.defineProperty(exports, "__esModule", {
4128
+ value: true
4129
+ });
4130
+ Object.defineProperty(exports, "forbidden", {
4131
+ enumerable: true,
4132
+ get: function() {
4133
+ return forbidden;
4134
+ }
4135
+ });
4136
+ const _httpaccessfallback = requireHttpAccessFallback();
4137
+ // TODO: Add `forbidden` docs
4138
+ /**
4139
+ * @experimental
4140
+ * This function allows you to render the [forbidden.js file](https://nextjs.org/docs/app/api-reference/file-conventions/forbidden)
4141
+ * within a route segment as well as inject a tag.
4142
+ *
4143
+ * `forbidden()` can be used in
4144
+ * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),
4145
+ * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and
4146
+ * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).
4147
+ *
4148
+ * Read more: [Next.js Docs: `forbidden`](https://nextjs.org/docs/app/api-reference/functions/forbidden)
4149
+ */ const DIGEST = "" + _httpaccessfallback.HTTP_ERROR_FALLBACK_ERROR_CODE + ";403";
4150
+ function forbidden() {
4151
+ if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {
4152
+ throw Object.defineProperty(new Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."), "__NEXT_ERROR_CODE", {
4153
+ value: "E488",
4154
+ enumerable: false,
4155
+ configurable: true
4156
+ });
4157
+ }
4158
+ // eslint-disable-next-line no-throw-literal
4159
+ const error = Object.defineProperty(new Error(DIGEST), "__NEXT_ERROR_CODE", {
4160
+ value: "E394",
4161
+ enumerable: false,
4162
+ configurable: true
4163
+ });
4164
+ error.digest = DIGEST;
4165
+ throw error;
4166
+ }
4167
+
4168
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
4169
+ Object.defineProperty(exports.default, '__esModule', { value: true });
4170
+ Object.assign(exports.default, exports);
4171
+ module.exports = exports.default;
4172
+ }
4173
+
4174
+
4175
+ } (forbidden, forbidden.exports));
4176
+ return forbidden.exports;
4177
+ }
4178
+
4179
+ var unauthorized = {exports: {}};
4180
+
4181
+ var hasRequiredUnauthorized;
4182
+
4183
+ function requireUnauthorized () {
4184
+ if (hasRequiredUnauthorized) return unauthorized.exports;
4185
+ hasRequiredUnauthorized = 1;
4186
+ (function (module, exports) {
4187
+ Object.defineProperty(exports, "__esModule", {
4188
+ value: true
4189
+ });
4190
+ Object.defineProperty(exports, "unauthorized", {
4191
+ enumerable: true,
4192
+ get: function() {
4193
+ return unauthorized;
4194
+ }
4195
+ });
4196
+ const _httpaccessfallback = requireHttpAccessFallback();
4197
+ // TODO: Add `unauthorized` docs
4198
+ /**
4199
+ * @experimental
4200
+ * This function allows you to render the [unauthorized.js file](https://nextjs.org/docs/app/api-reference/file-conventions/unauthorized)
4201
+ * within a route segment as well as inject a tag.
4202
+ *
4203
+ * `unauthorized()` can be used in
4204
+ * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),
4205
+ * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and
4206
+ * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).
4207
+ *
4208
+ *
4209
+ * Read more: [Next.js Docs: `unauthorized`](https://nextjs.org/docs/app/api-reference/functions/unauthorized)
4210
+ */ const DIGEST = "" + _httpaccessfallback.HTTP_ERROR_FALLBACK_ERROR_CODE + ";401";
4211
+ function unauthorized() {
4212
+ if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {
4213
+ throw Object.defineProperty(new Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."), "__NEXT_ERROR_CODE", {
4214
+ value: "E411",
4215
+ enumerable: false,
4216
+ configurable: true
4217
+ });
4218
+ }
4219
+ // eslint-disable-next-line no-throw-literal
4220
+ const error = Object.defineProperty(new Error(DIGEST), "__NEXT_ERROR_CODE", {
4221
+ value: "E394",
4222
+ enumerable: false,
4223
+ configurable: true
4224
+ });
4225
+ error.digest = DIGEST;
4226
+ throw error;
4227
+ }
4228
+
4229
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
4230
+ Object.defineProperty(exports.default, '__esModule', { value: true });
4231
+ Object.assign(exports.default, exports);
4232
+ module.exports = exports.default;
4233
+ }
4234
+
4235
+
4236
+ } (unauthorized, unauthorized.exports));
4237
+ return unauthorized.exports;
4238
+ }
4239
+
4240
+ var unstableRethrow = {exports: {}};
4241
+
4242
+ var unstableRethrow_server = {exports: {}};
4243
+
4244
+ var dynamicRenderingUtils = {};
4245
+
4246
+ var hasRequiredDynamicRenderingUtils;
4247
+
4248
+ function requireDynamicRenderingUtils () {
4249
+ if (hasRequiredDynamicRenderingUtils) return dynamicRenderingUtils;
4250
+ hasRequiredDynamicRenderingUtils = 1;
4251
+ (function (exports) {
4252
+ Object.defineProperty(exports, "__esModule", {
4253
+ value: true
4254
+ });
4255
+ function _export(target, all) {
4256
+ for(var name in all)Object.defineProperty(target, name, {
4257
+ enumerable: true,
4258
+ get: all[name]
4259
+ });
4260
+ }
4261
+ _export(exports, {
4262
+ isHangingPromiseRejectionError: function() {
4263
+ return isHangingPromiseRejectionError;
4264
+ },
4265
+ makeHangingPromise: function() {
4266
+ return makeHangingPromise;
4267
+ }
4268
+ });
4269
+ function isHangingPromiseRejectionError(err) {
4270
+ if (typeof err !== 'object' || err === null || !('digest' in err)) {
4271
+ return false;
4272
+ }
4273
+ return err.digest === HANGING_PROMISE_REJECTION;
4274
+ }
4275
+ const HANGING_PROMISE_REJECTION = 'HANGING_PROMISE_REJECTION';
4276
+ class HangingPromiseRejectionError extends Error {
4277
+ constructor(expression){
4278
+ super(`During prerendering, ${expression} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${expression} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context.`), this.expression = expression, this.digest = HANGING_PROMISE_REJECTION;
4279
+ }
4280
+ }
4281
+ const abortListenersBySignal = new WeakMap();
4282
+ function makeHangingPromise(signal, expression) {
4283
+ if (signal.aborted) {
4284
+ return Promise.reject(new HangingPromiseRejectionError(expression));
4285
+ } else {
4286
+ const hangingPromise = new Promise((_, reject)=>{
4287
+ const boundRejection = reject.bind(null, new HangingPromiseRejectionError(expression));
4288
+ let currentListeners = abortListenersBySignal.get(signal);
4289
+ if (currentListeners) {
4290
+ currentListeners.push(boundRejection);
4291
+ } else {
4292
+ const listeners = [
4293
+ boundRejection
4294
+ ];
4295
+ abortListenersBySignal.set(signal, listeners);
4296
+ signal.addEventListener('abort', ()=>{
4297
+ for(let i = 0; i < listeners.length; i++){
4298
+ listeners[i]();
4299
+ }
4300
+ }, {
4301
+ once: true
4302
+ });
4303
+ }
4304
+ });
4305
+ // We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so
4306
+ // we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct
4307
+ // your own promise out of it you'll need to ensure you handle the error when it rejects.
4308
+ hangingPromise.catch(ignoreReject);
4309
+ return hangingPromise;
4310
+ }
4311
+ }
4312
+ function ignoreReject() {}
4313
+
4314
+
4315
+ } (dynamicRenderingUtils));
4316
+ return dynamicRenderingUtils;
4317
+ }
4318
+
4319
+ var isPostpone = {};
4320
+
4321
+ var hasRequiredIsPostpone;
4322
+
4323
+ function requireIsPostpone () {
4324
+ if (hasRequiredIsPostpone) return isPostpone;
4325
+ hasRequiredIsPostpone = 1;
4326
+ (function (exports) {
4327
+ Object.defineProperty(exports, "__esModule", {
4328
+ value: true
4329
+ });
4330
+ Object.defineProperty(exports, "isPostpone", {
4331
+ enumerable: true,
4332
+ get: function() {
4333
+ return isPostpone;
4334
+ }
4335
+ });
4336
+ const REACT_POSTPONE_TYPE = Symbol.for('react.postpone');
4337
+ function isPostpone(error) {
4338
+ return typeof error === 'object' && error !== null && error.$$typeof === REACT_POSTPONE_TYPE;
4339
+ }
4340
+
4341
+
4342
+ } (isPostpone));
4343
+ return isPostpone;
4344
+ }
4345
+
4346
+ var bailoutToCsr = {};
4347
+
4348
+ var hasRequiredBailoutToCsr;
4349
+
4350
+ function requireBailoutToCsr () {
4351
+ if (hasRequiredBailoutToCsr) return bailoutToCsr;
4352
+ hasRequiredBailoutToCsr = 1;
4353
+ (function (exports) {
4354
+ Object.defineProperty(exports, "__esModule", {
4355
+ value: true
4356
+ });
4357
+ function _export(target, all) {
4358
+ for(var name in all)Object.defineProperty(target, name, {
4359
+ enumerable: true,
4360
+ get: all[name]
4361
+ });
4362
+ }
4363
+ _export(exports, {
4364
+ BailoutToCSRError: function() {
4365
+ return BailoutToCSRError;
4366
+ },
4367
+ isBailoutToCSRError: function() {
4368
+ return isBailoutToCSRError;
4369
+ }
4370
+ });
4371
+ const BAILOUT_TO_CSR = 'BAILOUT_TO_CLIENT_SIDE_RENDERING';
4372
+ class BailoutToCSRError extends Error {
4373
+ constructor(reason){
4374
+ super("Bail out to client-side rendering: " + reason), this.reason = reason, this.digest = BAILOUT_TO_CSR;
4375
+ }
4376
+ }
4377
+ function isBailoutToCSRError(err) {
4378
+ if (typeof err !== 'object' || err === null || !('digest' in err)) {
4379
+ return false;
4380
+ }
4381
+ return err.digest === BAILOUT_TO_CSR;
4382
+ }
4383
+
4384
+
4385
+ } (bailoutToCsr));
4386
+ return bailoutToCsr;
4387
+ }
4388
+
4389
+ var isNextRouterError = {exports: {}};
4390
+
4391
+ var hasRequiredIsNextRouterError;
4392
+
4393
+ function requireIsNextRouterError () {
4394
+ if (hasRequiredIsNextRouterError) return isNextRouterError.exports;
4395
+ hasRequiredIsNextRouterError = 1;
4396
+ (function (module, exports) {
4397
+ Object.defineProperty(exports, "__esModule", {
4398
+ value: true
4399
+ });
4400
+ Object.defineProperty(exports, "isNextRouterError", {
4401
+ enumerable: true,
4402
+ get: function() {
4403
+ return isNextRouterError;
4404
+ }
4405
+ });
4406
+ const _httpaccessfallback = requireHttpAccessFallback();
4407
+ const _redirecterror = requireRedirectError();
4408
+ function isNextRouterError(error) {
4409
+ return (0, _redirecterror.isRedirectError)(error) || (0, _httpaccessfallback.isHTTPAccessFallbackError)(error);
4410
+ }
4411
+
4412
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
4413
+ Object.defineProperty(exports.default, '__esModule', { value: true });
4414
+ Object.assign(exports.default, exports);
4415
+ module.exports = exports.default;
4416
+ }
4417
+
4418
+
4419
+ } (isNextRouterError, isNextRouterError.exports));
4420
+ return isNextRouterError.exports;
4421
+ }
4422
+
4423
+ var dynamicRendering = {};
4424
+
4425
+ var hooksServerContext = {exports: {}};
4426
+
4427
+ var hasRequiredHooksServerContext;
4428
+
4429
+ function requireHooksServerContext () {
4430
+ if (hasRequiredHooksServerContext) return hooksServerContext.exports;
4431
+ hasRequiredHooksServerContext = 1;
4432
+ (function (module, exports) {
4433
+ Object.defineProperty(exports, "__esModule", {
4434
+ value: true
4435
+ });
4436
+ function _export(target, all) {
4437
+ for(var name in all)Object.defineProperty(target, name, {
4438
+ enumerable: true,
4439
+ get: all[name]
4440
+ });
4441
+ }
4442
+ _export(exports, {
4443
+ DynamicServerError: function() {
4444
+ return DynamicServerError;
4445
+ },
4446
+ isDynamicServerError: function() {
4447
+ return isDynamicServerError;
4448
+ }
4449
+ });
4450
+ const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE';
4451
+ class DynamicServerError extends Error {
4452
+ constructor(description){
4453
+ super("Dynamic server usage: " + description), this.description = description, this.digest = DYNAMIC_ERROR_CODE;
4454
+ }
4455
+ }
4456
+ function isDynamicServerError(err) {
4457
+ if (typeof err !== 'object' || err === null || !('digest' in err) || typeof err.digest !== 'string') {
4458
+ return false;
4459
+ }
4460
+ return err.digest === DYNAMIC_ERROR_CODE;
4461
+ }
4462
+
4463
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
4464
+ Object.defineProperty(exports.default, '__esModule', { value: true });
4465
+ Object.assign(exports.default, exports);
4466
+ module.exports = exports.default;
4467
+ }
4468
+
4469
+
4470
+ } (hooksServerContext, hooksServerContext.exports));
4471
+ return hooksServerContext.exports;
4472
+ }
4473
+
4474
+ var staticGenerationBailout = {exports: {}};
4475
+
4476
+ var hasRequiredStaticGenerationBailout;
4477
+
4478
+ function requireStaticGenerationBailout () {
4479
+ if (hasRequiredStaticGenerationBailout) return staticGenerationBailout.exports;
4480
+ hasRequiredStaticGenerationBailout = 1;
4481
+ (function (module, exports) {
4482
+ Object.defineProperty(exports, "__esModule", {
4483
+ value: true
4484
+ });
4485
+ function _export(target, all) {
4486
+ for(var name in all)Object.defineProperty(target, name, {
4487
+ enumerable: true,
4488
+ get: all[name]
4489
+ });
4490
+ }
4491
+ _export(exports, {
4492
+ StaticGenBailoutError: function() {
4493
+ return StaticGenBailoutError;
4494
+ },
4495
+ isStaticGenBailoutError: function() {
4496
+ return isStaticGenBailoutError;
4497
+ }
4498
+ });
4499
+ const NEXT_STATIC_GEN_BAILOUT = 'NEXT_STATIC_GEN_BAILOUT';
4500
+ class StaticGenBailoutError extends Error {
4501
+ constructor(...args){
4502
+ super(...args), this.code = NEXT_STATIC_GEN_BAILOUT;
4503
+ }
4504
+ }
4505
+ function isStaticGenBailoutError(error) {
4506
+ if (typeof error !== 'object' || error === null || !('code' in error)) {
4507
+ return false;
4508
+ }
4509
+ return error.code === NEXT_STATIC_GEN_BAILOUT;
4510
+ }
4511
+
4512
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
4513
+ Object.defineProperty(exports.default, '__esModule', { value: true });
4514
+ Object.assign(exports.default, exports);
4515
+ module.exports = exports.default;
4516
+ }
4517
+
4518
+
4519
+ } (staticGenerationBailout, staticGenerationBailout.exports));
4520
+ return staticGenerationBailout.exports;
4521
+ }
4522
+
4523
+ var workUnitAsyncStorage_external = {};
4524
+
4525
+ var workUnitAsyncStorageInstance = {};
4526
+
4527
+ var hasRequiredWorkUnitAsyncStorageInstance;
4528
+
4529
+ function requireWorkUnitAsyncStorageInstance () {
4530
+ if (hasRequiredWorkUnitAsyncStorageInstance) return workUnitAsyncStorageInstance;
4531
+ hasRequiredWorkUnitAsyncStorageInstance = 1;
4532
+ (function (exports) {
4533
+ Object.defineProperty(exports, "__esModule", {
4534
+ value: true
4535
+ });
4536
+ Object.defineProperty(exports, "workUnitAsyncStorageInstance", {
4537
+ enumerable: true,
4538
+ get: function() {
4539
+ return workUnitAsyncStorageInstance;
4540
+ }
4541
+ });
4542
+ const _asynclocalstorage = requireAsyncLocalStorage();
4543
+ const workUnitAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
4544
+
4545
+
4546
+ } (workUnitAsyncStorageInstance));
4547
+ return workUnitAsyncStorageInstance;
4548
+ }
4549
+
4550
+ var appRouterHeaders = {exports: {}};
4551
+
4552
+ var hasRequiredAppRouterHeaders;
4553
+
4554
+ function requireAppRouterHeaders () {
4555
+ if (hasRequiredAppRouterHeaders) return appRouterHeaders.exports;
4556
+ hasRequiredAppRouterHeaders = 1;
4557
+ (function (module, exports) {
4558
+ Object.defineProperty(exports, "__esModule", {
4559
+ value: true
4560
+ });
4561
+ function _export(target, all) {
4562
+ for(var name in all)Object.defineProperty(target, name, {
4563
+ enumerable: true,
4564
+ get: all[name]
4565
+ });
4566
+ }
4567
+ _export(exports, {
4568
+ ACTION_HEADER: function() {
4569
+ return ACTION_HEADER;
4570
+ },
4571
+ FLIGHT_HEADERS: function() {
4572
+ return FLIGHT_HEADERS;
4573
+ },
4574
+ NEXT_DID_POSTPONE_HEADER: function() {
4575
+ return NEXT_DID_POSTPONE_HEADER;
4576
+ },
4577
+ NEXT_HMR_REFRESH_HASH_COOKIE: function() {
4578
+ return NEXT_HMR_REFRESH_HASH_COOKIE;
4579
+ },
4580
+ NEXT_HMR_REFRESH_HEADER: function() {
4581
+ return NEXT_HMR_REFRESH_HEADER;
4582
+ },
4583
+ NEXT_IS_PRERENDER_HEADER: function() {
4584
+ return NEXT_IS_PRERENDER_HEADER;
4585
+ },
4586
+ NEXT_REWRITTEN_PATH_HEADER: function() {
4587
+ return NEXT_REWRITTEN_PATH_HEADER;
4588
+ },
4589
+ NEXT_REWRITTEN_QUERY_HEADER: function() {
4590
+ return NEXT_REWRITTEN_QUERY_HEADER;
4591
+ },
4592
+ NEXT_ROUTER_PREFETCH_HEADER: function() {
4593
+ return NEXT_ROUTER_PREFETCH_HEADER;
4594
+ },
4595
+ NEXT_ROUTER_SEGMENT_PREFETCH_HEADER: function() {
4596
+ return NEXT_ROUTER_SEGMENT_PREFETCH_HEADER;
4597
+ },
4598
+ NEXT_ROUTER_STALE_TIME_HEADER: function() {
4599
+ return NEXT_ROUTER_STALE_TIME_HEADER;
4600
+ },
4601
+ NEXT_ROUTER_STATE_TREE_HEADER: function() {
4602
+ return NEXT_ROUTER_STATE_TREE_HEADER;
4603
+ },
4604
+ NEXT_RSC_UNION_QUERY: function() {
4605
+ return NEXT_RSC_UNION_QUERY;
4606
+ },
4607
+ NEXT_URL: function() {
4608
+ return NEXT_URL;
4609
+ },
4610
+ RSC_CONTENT_TYPE_HEADER: function() {
4611
+ return RSC_CONTENT_TYPE_HEADER;
4612
+ },
4613
+ RSC_HEADER: function() {
4614
+ return RSC_HEADER;
4615
+ }
4616
+ });
4617
+ const RSC_HEADER = 'RSC';
4618
+ const ACTION_HEADER = 'Next-Action';
4619
+ const NEXT_ROUTER_STATE_TREE_HEADER = 'Next-Router-State-Tree';
4620
+ const NEXT_ROUTER_PREFETCH_HEADER = 'Next-Router-Prefetch';
4621
+ const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER = 'Next-Router-Segment-Prefetch';
4622
+ const NEXT_HMR_REFRESH_HEADER = 'Next-HMR-Refresh';
4623
+ const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__';
4624
+ const NEXT_URL = 'Next-Url';
4625
+ const RSC_CONTENT_TYPE_HEADER = 'text/x-component';
4626
+ const FLIGHT_HEADERS = [
4627
+ RSC_HEADER,
4628
+ NEXT_ROUTER_STATE_TREE_HEADER,
4629
+ NEXT_ROUTER_PREFETCH_HEADER,
4630
+ NEXT_HMR_REFRESH_HEADER,
4631
+ NEXT_ROUTER_SEGMENT_PREFETCH_HEADER
4632
+ ];
4633
+ const NEXT_RSC_UNION_QUERY = '_rsc';
4634
+ const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time';
4635
+ const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed';
4636
+ const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path';
4637
+ const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query';
4638
+ const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender';
4639
+
4640
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
4641
+ Object.defineProperty(exports.default, '__esModule', { value: true });
4642
+ Object.assign(exports.default, exports);
4643
+ module.exports = exports.default;
4644
+ }
4645
+
4646
+
4647
+ } (appRouterHeaders, appRouterHeaders.exports));
4648
+ return appRouterHeaders.exports;
4649
+ }
4650
+
4651
+ var hasRequiredWorkUnitAsyncStorage_external;
4652
+
4653
+ function requireWorkUnitAsyncStorage_external () {
4654
+ if (hasRequiredWorkUnitAsyncStorage_external) return workUnitAsyncStorage_external;
4655
+ hasRequiredWorkUnitAsyncStorage_external = 1;
4656
+ (function (exports) {
4657
+ Object.defineProperty(exports, "__esModule", {
4658
+ value: true
4659
+ });
4660
+ function _export(target, all) {
4661
+ for(var name in all)Object.defineProperty(target, name, {
4662
+ enumerable: true,
4663
+ get: all[name]
4664
+ });
4665
+ }
4666
+ _export(exports, {
4667
+ getDraftModeProviderForCacheScope: function() {
4668
+ return getDraftModeProviderForCacheScope;
4669
+ },
4670
+ getExpectedRequestStore: function() {
4671
+ return getExpectedRequestStore;
4672
+ },
4673
+ getHmrRefreshHash: function() {
4674
+ return getHmrRefreshHash;
4675
+ },
4676
+ getPrerenderResumeDataCache: function() {
4677
+ return getPrerenderResumeDataCache;
4678
+ },
4679
+ getRenderResumeDataCache: function() {
4680
+ return getRenderResumeDataCache;
4681
+ },
4682
+ throwForMissingRequestStore: function() {
4683
+ return throwForMissingRequestStore;
4684
+ },
4685
+ workUnitAsyncStorage: function() {
4686
+ return _workunitasyncstorageinstance.workUnitAsyncStorageInstance;
4687
+ }
4688
+ });
4689
+ const _workunitasyncstorageinstance = requireWorkUnitAsyncStorageInstance();
4690
+ const _approuterheaders = requireAppRouterHeaders();
4691
+ function getExpectedRequestStore(callingExpression) {
4692
+ const workUnitStore = _workunitasyncstorageinstance.workUnitAsyncStorageInstance.getStore();
4693
+ if (!workUnitStore) {
4694
+ throwForMissingRequestStore(callingExpression);
4695
+ }
4696
+ switch(workUnitStore.type){
4697
+ case 'request':
4698
+ return workUnitStore;
4699
+ case 'prerender':
4700
+ case 'prerender-ppr':
4701
+ case 'prerender-legacy':
4702
+ // This should not happen because we should have checked it already.
4703
+ throw Object.defineProperty(new Error(`\`${callingExpression}\` cannot be called inside a prerender. This is a bug in Next.js.`), "__NEXT_ERROR_CODE", {
4704
+ value: "E401",
4705
+ enumerable: false,
4706
+ configurable: true
4707
+ });
4708
+ case 'cache':
4709
+ throw Object.defineProperty(new Error(`\`${callingExpression}\` cannot be called inside "use cache". Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
4710
+ value: "E37",
4711
+ enumerable: false,
4712
+ configurable: true
4713
+ });
4714
+ case 'unstable-cache':
4715
+ throw Object.defineProperty(new Error(`\`${callingExpression}\` cannot be called inside unstable_cache. Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
4716
+ value: "E69",
4717
+ enumerable: false,
4718
+ configurable: true
4719
+ });
4720
+ default:
4721
+ const _exhaustiveCheck = workUnitStore;
4722
+ return _exhaustiveCheck;
4723
+ }
4724
+ }
4725
+ function throwForMissingRequestStore(callingExpression) {
4726
+ throw Object.defineProperty(new Error(`\`${callingExpression}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`), "__NEXT_ERROR_CODE", {
4727
+ value: "E251",
4728
+ enumerable: false,
4729
+ configurable: true
4730
+ });
4731
+ }
4732
+ function getPrerenderResumeDataCache(workUnitStore) {
4733
+ if (workUnitStore.type === 'prerender' || workUnitStore.type === 'prerender-ppr') {
4734
+ return workUnitStore.prerenderResumeDataCache;
4735
+ }
4736
+ return null;
4737
+ }
4738
+ function getRenderResumeDataCache(workUnitStore) {
4739
+ if (workUnitStore.type !== 'prerender-legacy' && workUnitStore.type !== 'cache' && workUnitStore.type !== 'unstable-cache') {
4740
+ if (workUnitStore.type === 'request') {
4741
+ return workUnitStore.renderResumeDataCache;
4742
+ }
4743
+ // We return the mutable resume data cache here as an immutable version of
4744
+ // the cache as it can also be used for reading.
4745
+ return workUnitStore.prerenderResumeDataCache;
4746
+ }
4747
+ return null;
4748
+ }
4749
+ function getHmrRefreshHash(workStore, workUnitStore) {
4750
+ var _workUnitStore_cookies_get;
4751
+ if (!workStore.dev) {
4752
+ return undefined;
4753
+ }
4754
+ return workUnitStore.type === 'cache' || workUnitStore.type === 'prerender' ? workUnitStore.hmrRefreshHash : workUnitStore.type === 'request' ? (_workUnitStore_cookies_get = workUnitStore.cookies.get(_approuterheaders.NEXT_HMR_REFRESH_HASH_COOKIE)) == null ? void 0 : _workUnitStore_cookies_get.value : undefined;
4755
+ }
4756
+ function getDraftModeProviderForCacheScope(workStore, workUnitStore) {
4757
+ if (workStore.isDraftMode) {
4758
+ switch(workUnitStore.type){
4759
+ case 'cache':
4760
+ case 'unstable-cache':
4761
+ case 'request':
4762
+ return workUnitStore.draftMode;
4763
+ default:
4764
+ return undefined;
4765
+ }
4766
+ }
4767
+ return undefined;
4768
+ }
4769
+
4770
+
4771
+ } (workUnitAsyncStorage_external));
4772
+ return workUnitAsyncStorage_external;
4773
+ }
4774
+
4775
+ var workAsyncStorage_external = {};
4776
+
4777
+ var workAsyncStorageInstance = {};
4778
+
4779
+ var hasRequiredWorkAsyncStorageInstance;
4780
+
4781
+ function requireWorkAsyncStorageInstance () {
4782
+ if (hasRequiredWorkAsyncStorageInstance) return workAsyncStorageInstance;
4783
+ hasRequiredWorkAsyncStorageInstance = 1;
4784
+ (function (exports) {
4785
+ Object.defineProperty(exports, "__esModule", {
4786
+ value: true
4787
+ });
4788
+ Object.defineProperty(exports, "workAsyncStorageInstance", {
4789
+ enumerable: true,
4790
+ get: function() {
4791
+ return workAsyncStorageInstance;
4792
+ }
4793
+ });
4794
+ const _asynclocalstorage = requireAsyncLocalStorage();
4795
+ const workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
4796
+
4797
+
4798
+ } (workAsyncStorageInstance));
4799
+ return workAsyncStorageInstance;
4800
+ }
4801
+
4802
+ var hasRequiredWorkAsyncStorage_external;
4803
+
4804
+ function requireWorkAsyncStorage_external () {
4805
+ if (hasRequiredWorkAsyncStorage_external) return workAsyncStorage_external;
4806
+ hasRequiredWorkAsyncStorage_external = 1;
4807
+ (function (exports) {
4808
+ Object.defineProperty(exports, "__esModule", {
4809
+ value: true
4810
+ });
4811
+ Object.defineProperty(exports, "workAsyncStorage", {
4812
+ enumerable: true,
4813
+ get: function() {
4814
+ return _workasyncstorageinstance.workAsyncStorageInstance;
4815
+ }
4816
+ });
4817
+ const _workasyncstorageinstance = requireWorkAsyncStorageInstance();
4818
+
4819
+
4820
+ } (workAsyncStorage_external));
4821
+ return workAsyncStorage_external;
4822
+ }
4823
+
4824
+ var metadataConstants = {};
4825
+
4826
+ var hasRequiredMetadataConstants;
4827
+
4828
+ function requireMetadataConstants () {
4829
+ if (hasRequiredMetadataConstants) return metadataConstants;
4830
+ hasRequiredMetadataConstants = 1;
4831
+ (function (exports) {
4832
+ Object.defineProperty(exports, "__esModule", {
4833
+ value: true
4834
+ });
4835
+ function _export(target, all) {
4836
+ for(var name in all)Object.defineProperty(target, name, {
4837
+ enumerable: true,
4838
+ get: all[name]
4839
+ });
4840
+ }
4841
+ _export(exports, {
4842
+ METADATA_BOUNDARY_NAME: function() {
4843
+ return METADATA_BOUNDARY_NAME;
4844
+ },
4845
+ OUTLET_BOUNDARY_NAME: function() {
4846
+ return OUTLET_BOUNDARY_NAME;
4847
+ },
4848
+ VIEWPORT_BOUNDARY_NAME: function() {
4849
+ return VIEWPORT_BOUNDARY_NAME;
4850
+ }
4851
+ });
4852
+ const METADATA_BOUNDARY_NAME = '__next_metadata_boundary__';
4853
+ const VIEWPORT_BOUNDARY_NAME = '__next_viewport_boundary__';
4854
+ const OUTLET_BOUNDARY_NAME = '__next_outlet_boundary__';
4855
+
4856
+
4857
+ } (metadataConstants));
4858
+ return metadataConstants;
4859
+ }
4860
+
4861
+ var scheduler = {};
4862
+
4863
+ var hasRequiredScheduler;
4864
+
4865
+ function requireScheduler () {
4866
+ if (hasRequiredScheduler) return scheduler;
4867
+ hasRequiredScheduler = 1;
4868
+ (function (exports) {
4869
+ Object.defineProperty(exports, "__esModule", {
4870
+ value: true
4871
+ });
4872
+ function _export(target, all) {
4873
+ for(var name in all)Object.defineProperty(target, name, {
4874
+ enumerable: true,
4875
+ get: all[name]
4876
+ });
4877
+ }
4878
+ _export(exports, {
4879
+ atLeastOneTask: function() {
4880
+ return atLeastOneTask;
4881
+ },
4882
+ scheduleImmediate: function() {
4883
+ return scheduleImmediate;
4884
+ },
4885
+ scheduleOnNextTick: function() {
4886
+ return scheduleOnNextTick;
4887
+ },
4888
+ waitAtLeastOneReactRenderTask: function() {
4889
+ return waitAtLeastOneReactRenderTask;
4890
+ }
4891
+ });
4892
+ const scheduleOnNextTick = (cb)=>{
4893
+ // We use Promise.resolve().then() here so that the operation is scheduled at
4894
+ // the end of the promise job queue, we then add it to the next process tick
4895
+ // to ensure it's evaluated afterwards.
4896
+ //
4897
+ // This was inspired by the implementation of the DataLoader interface: https://github.com/graphql/dataloader/blob/d336bd15282664e0be4b4a657cb796f09bafbc6b/src/index.js#L213-L255
4898
+ //
4899
+ Promise.resolve().then(()=>{
4900
+ if (process.env.NEXT_RUNTIME === 'edge') {
4901
+ setTimeout(cb, 0);
4902
+ } else {
4903
+ process.nextTick(cb);
4904
+ }
4905
+ });
4906
+ };
4907
+ const scheduleImmediate = (cb)=>{
4908
+ if (process.env.NEXT_RUNTIME === 'edge') {
4909
+ setTimeout(cb, 0);
4910
+ } else {
4911
+ setImmediate(cb);
4912
+ }
4913
+ };
4914
+ function atLeastOneTask() {
4915
+ return new Promise((resolve)=>scheduleImmediate(resolve));
4916
+ }
4917
+ function waitAtLeastOneReactRenderTask() {
4918
+ if (process.env.NEXT_RUNTIME === 'edge') {
4919
+ return new Promise((r)=>setTimeout(r, 0));
4920
+ } else {
4921
+ return new Promise((r)=>setImmediate(r));
4922
+ }
4923
+ }
4924
+
4925
+
4926
+ } (scheduler));
4927
+ return scheduler;
4928
+ }
4929
+
4930
+ /**
4931
+ * The functions provided by this module are used to communicate certain properties
4932
+ * about the currently running code so that Next.js can make decisions on how to handle
4933
+ * the current execution in different rendering modes such as pre-rendering, resuming, and SSR.
4934
+ *
4935
+ * Today Next.js treats all code as potentially static. Certain APIs may only make sense when dynamically rendering.
4936
+ * Traditionally this meant deopting the entire render to dynamic however with PPR we can now deopt parts
4937
+ * of a React tree as dynamic while still keeping other parts static. There are really two different kinds of
4938
+ * Dynamic indications.
4939
+ *
4940
+ * The first is simply an intention to be dynamic. unstable_noStore is an example of this where
4941
+ * the currently executing code simply declares that the current scope is dynamic but if you use it
4942
+ * inside unstable_cache it can still be cached. This type of indication can be removed if we ever
4943
+ * make the default dynamic to begin with because the only way you would ever be static is inside
4944
+ * a cache scope which this indication does not affect.
4945
+ *
4946
+ * The second is an indication that a dynamic data source was read. This is a stronger form of dynamic
4947
+ * because it means that it is inappropriate to cache this at all. using a dynamic data source inside
4948
+ * unstable_cache should error. If you want to use some dynamic data inside unstable_cache you should
4949
+ * read that data outside the cache and pass it in as an argument to the cached function.
4950
+ */
4951
+
4952
+ var hasRequiredDynamicRendering;
4953
+
4954
+ function requireDynamicRendering () {
4955
+ if (hasRequiredDynamicRendering) return dynamicRendering;
4956
+ hasRequiredDynamicRendering = 1;
4957
+ (function (exports) {
4958
+ Object.defineProperty(exports, "__esModule", {
4959
+ value: true
4960
+ });
4961
+ function _export(target, all) {
4962
+ for(var name in all)Object.defineProperty(target, name, {
4963
+ enumerable: true,
4964
+ get: all[name]
4965
+ });
4966
+ }
4967
+ _export(exports, {
4968
+ Postpone: function() {
4969
+ return Postpone;
4970
+ },
4971
+ abortAndThrowOnSynchronousRequestDataAccess: function() {
4972
+ return abortAndThrowOnSynchronousRequestDataAccess;
4973
+ },
4974
+ abortOnSynchronousPlatformIOAccess: function() {
4975
+ return abortOnSynchronousPlatformIOAccess;
4976
+ },
4977
+ accessedDynamicData: function() {
4978
+ return accessedDynamicData;
4979
+ },
4980
+ annotateDynamicAccess: function() {
4981
+ return annotateDynamicAccess;
4982
+ },
4983
+ consumeDynamicAccess: function() {
4984
+ return consumeDynamicAccess;
4985
+ },
4986
+ createDynamicTrackingState: function() {
4987
+ return createDynamicTrackingState;
4988
+ },
4989
+ createDynamicValidationState: function() {
4990
+ return createDynamicValidationState;
4991
+ },
4992
+ createHangingInputAbortSignal: function() {
4993
+ return createHangingInputAbortSignal;
4994
+ },
4995
+ createPostponedAbortSignal: function() {
4996
+ return createPostponedAbortSignal;
4997
+ },
4998
+ formatDynamicAPIAccesses: function() {
4999
+ return formatDynamicAPIAccesses;
5000
+ },
5001
+ getFirstDynamicReason: function() {
5002
+ return getFirstDynamicReason;
5003
+ },
5004
+ isDynamicPostpone: function() {
5005
+ return isDynamicPostpone;
5006
+ },
5007
+ isPrerenderInterruptedError: function() {
5008
+ return isPrerenderInterruptedError;
5009
+ },
5010
+ markCurrentScopeAsDynamic: function() {
5011
+ return markCurrentScopeAsDynamic;
5012
+ },
5013
+ postponeWithTracking: function() {
5014
+ return postponeWithTracking;
5015
+ },
5016
+ throwIfDisallowedDynamic: function() {
5017
+ return throwIfDisallowedDynamic;
5018
+ },
5019
+ throwToInterruptStaticGeneration: function() {
5020
+ return throwToInterruptStaticGeneration;
5021
+ },
5022
+ trackAllowedDynamicAccess: function() {
5023
+ return trackAllowedDynamicAccess;
5024
+ },
5025
+ trackDynamicDataInDynamicRender: function() {
5026
+ return trackDynamicDataInDynamicRender;
5027
+ },
5028
+ trackFallbackParamAccessed: function() {
5029
+ return trackFallbackParamAccessed;
5030
+ },
5031
+ trackSynchronousPlatformIOAccessInDev: function() {
5032
+ return trackSynchronousPlatformIOAccessInDev;
5033
+ },
5034
+ trackSynchronousRequestDataAccessInDev: function() {
5035
+ return trackSynchronousRequestDataAccessInDev;
5036
+ },
5037
+ useDynamicRouteParams: function() {
5038
+ return useDynamicRouteParams;
5039
+ }
5040
+ });
5041
+ const _react = /*#__PURE__*/ _interop_require_default(require$$0);
5042
+ const _hooksservercontext = requireHooksServerContext();
5043
+ const _staticgenerationbailout = requireStaticGenerationBailout();
5044
+ const _workunitasyncstorageexternal = requireWorkUnitAsyncStorage_external();
5045
+ const _workasyncstorageexternal = requireWorkAsyncStorage_external();
5046
+ const _dynamicrenderingutils = requireDynamicRenderingUtils();
5047
+ const _metadataconstants = requireMetadataConstants();
5048
+ const _scheduler = requireScheduler();
5049
+ function _interop_require_default(obj) {
5050
+ return obj && obj.__esModule ? obj : {
5051
+ default: obj
5052
+ };
5053
+ }
5054
+ const hasPostpone = typeof _react.default.unstable_postpone === 'function';
5055
+ function createDynamicTrackingState(isDebugDynamicAccesses) {
5056
+ return {
5057
+ isDebugDynamicAccesses,
5058
+ dynamicAccesses: [],
5059
+ syncDynamicExpression: undefined,
5060
+ syncDynamicErrorWithStack: null
5061
+ };
5062
+ }
5063
+ function createDynamicValidationState() {
5064
+ return {
5065
+ hasSuspendedDynamic: false,
5066
+ hasDynamicMetadata: false,
5067
+ hasDynamicViewport: false,
5068
+ hasSyncDynamicErrors: false,
5069
+ dynamicErrors: []
5070
+ };
5071
+ }
5072
+ function getFirstDynamicReason(trackingState) {
5073
+ var _trackingState_dynamicAccesses_;
5074
+ return (_trackingState_dynamicAccesses_ = trackingState.dynamicAccesses[0]) == null ? void 0 : _trackingState_dynamicAccesses_.expression;
5075
+ }
5076
+ function markCurrentScopeAsDynamic(store, workUnitStore, expression) {
5077
+ if (workUnitStore) {
5078
+ if (workUnitStore.type === 'cache' || workUnitStore.type === 'unstable-cache') {
5079
+ // inside cache scopes marking a scope as dynamic has no effect because the outer cache scope
5080
+ // creates a cache boundary. This is subtly different from reading a dynamic data source which is
5081
+ // forbidden inside a cache scope.
5082
+ return;
5083
+ }
5084
+ }
5085
+ // If we're forcing dynamic rendering or we're forcing static rendering, we
5086
+ // don't need to do anything here because the entire page is already dynamic
5087
+ // or it's static and it should not throw or postpone here.
5088
+ if (store.forceDynamic || store.forceStatic) return;
5089
+ if (store.dynamicShouldError) {
5090
+ throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${store.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
5091
+ value: "E553",
5092
+ enumerable: false,
5093
+ configurable: true
5094
+ });
5095
+ }
5096
+ if (workUnitStore) {
5097
+ if (workUnitStore.type === 'prerender-ppr') {
5098
+ postponeWithTracking(store.route, expression, workUnitStore.dynamicTracking);
5099
+ } else if (workUnitStore.type === 'prerender-legacy') {
5100
+ workUnitStore.revalidate = 0;
5101
+ // We aren't prerendering but we are generating a static page. We need to bail out of static generation
5102
+ const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", {
5103
+ value: "E550",
5104
+ enumerable: false,
5105
+ configurable: true
5106
+ });
5107
+ store.dynamicUsageDescription = expression;
5108
+ store.dynamicUsageStack = err.stack;
5109
+ throw err;
5110
+ } else if (process.env.NODE_ENV === 'development' && workUnitStore && workUnitStore.type === 'request') {
5111
+ workUnitStore.usedDynamic = true;
5112
+ }
5113
+ }
5114
+ }
5115
+ function trackFallbackParamAccessed(store, expression) {
5116
+ const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
5117
+ if (!prerenderStore || prerenderStore.type !== 'prerender-ppr') return;
5118
+ postponeWithTracking(store.route, expression, prerenderStore.dynamicTracking);
5119
+ }
5120
+ function throwToInterruptStaticGeneration(expression, store, prerenderStore) {
5121
+ // We aren't prerendering but we are generating a static page. We need to bail out of static generation
5122
+ const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", {
5123
+ value: "E558",
5124
+ enumerable: false,
5125
+ configurable: true
5126
+ });
5127
+ prerenderStore.revalidate = 0;
5128
+ store.dynamicUsageDescription = expression;
5129
+ store.dynamicUsageStack = err.stack;
5130
+ throw err;
5131
+ }
5132
+ function trackDynamicDataInDynamicRender(_store, workUnitStore) {
5133
+ if (workUnitStore) {
5134
+ if (workUnitStore.type === 'cache' || workUnitStore.type === 'unstable-cache') {
5135
+ // inside cache scopes marking a scope as dynamic has no effect because the outer cache scope
5136
+ // creates a cache boundary. This is subtly different from reading a dynamic data source which is
5137
+ // forbidden inside a cache scope.
5138
+ return;
5139
+ }
5140
+ if (workUnitStore.type === 'prerender' || workUnitStore.type === 'prerender-legacy') {
5141
+ workUnitStore.revalidate = 0;
5142
+ }
5143
+ if (process.env.NODE_ENV === 'development' && workUnitStore.type === 'request') {
5144
+ workUnitStore.usedDynamic = true;
5145
+ }
5146
+ }
5147
+ }
5148
+ // Despite it's name we don't actually abort unless we have a controller to call abort on
5149
+ // There are times when we let a prerender run long to discover caches where we want the semantics
5150
+ // of tracking dynamic access without terminating the prerender early
5151
+ function abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore) {
5152
+ const reason = `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`;
5153
+ const error = createPrerenderInterruptedError(reason);
5154
+ prerenderStore.controller.abort(error);
5155
+ const dynamicTracking = prerenderStore.dynamicTracking;
5156
+ if (dynamicTracking) {
5157
+ dynamicTracking.dynamicAccesses.push({
5158
+ // When we aren't debugging, we don't need to create another error for the
5159
+ // stack trace.
5160
+ stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,
5161
+ expression
5162
+ });
5163
+ }
5164
+ }
5165
+ function abortOnSynchronousPlatformIOAccess(route, expression, errorWithStack, prerenderStore) {
5166
+ const dynamicTracking = prerenderStore.dynamicTracking;
5167
+ if (dynamicTracking) {
5168
+ if (dynamicTracking.syncDynamicErrorWithStack === null) {
5169
+ dynamicTracking.syncDynamicExpression = expression;
5170
+ dynamicTracking.syncDynamicErrorWithStack = errorWithStack;
5171
+ }
5172
+ }
5173
+ abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);
5174
+ }
5175
+ function trackSynchronousPlatformIOAccessInDev(requestStore) {
5176
+ // We don't actually have a controller to abort but we do the semantic equivalent by
5177
+ // advancing the request store out of prerender mode
5178
+ requestStore.prerenderPhase = false;
5179
+ }
5180
+ function abortAndThrowOnSynchronousRequestDataAccess(route, expression, errorWithStack, prerenderStore) {
5181
+ const prerenderSignal = prerenderStore.controller.signal;
5182
+ if (prerenderSignal.aborted === false) {
5183
+ // TODO it would be better to move this aborted check into the callsite so we can avoid making
5184
+ // the error object when it isn't relevant to the aborting of the prerender however
5185
+ // since we need the throw semantics regardless of whether we abort it is easier to land
5186
+ // this way. See how this was handled with `abortOnSynchronousPlatformIOAccess` for a closer
5187
+ // to ideal implementation
5188
+ const dynamicTracking = prerenderStore.dynamicTracking;
5189
+ if (dynamicTracking) {
5190
+ if (dynamicTracking.syncDynamicErrorWithStack === null) {
5191
+ dynamicTracking.syncDynamicExpression = expression;
5192
+ dynamicTracking.syncDynamicErrorWithStack = errorWithStack;
5193
+ if (prerenderStore.validating === true) {
5194
+ // We always log Request Access in dev at the point of calling the function
5195
+ // So we mark the dynamic validation as not requiring it to be printed
5196
+ dynamicTracking.syncDynamicLogged = true;
5197
+ }
5198
+ }
5199
+ }
5200
+ abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);
5201
+ }
5202
+ throw createPrerenderInterruptedError(`Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`);
5203
+ }
5204
+ const trackSynchronousRequestDataAccessInDev = trackSynchronousPlatformIOAccessInDev;
5205
+ function Postpone({ reason, route }) {
5206
+ const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
5207
+ const dynamicTracking = prerenderStore && prerenderStore.type === 'prerender-ppr' ? prerenderStore.dynamicTracking : null;
5208
+ postponeWithTracking(route, reason, dynamicTracking);
5209
+ }
5210
+ function postponeWithTracking(route, expression, dynamicTracking) {
5211
+ assertPostpone();
5212
+ if (dynamicTracking) {
5213
+ dynamicTracking.dynamicAccesses.push({
5214
+ // When we aren't debugging, we don't need to create another error for the
5215
+ // stack trace.
5216
+ stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,
5217
+ expression
5218
+ });
5219
+ }
5220
+ _react.default.unstable_postpone(createPostponeReason(route, expression));
5221
+ }
5222
+ function createPostponeReason(route, expression) {
5223
+ return `Route ${route} needs to bail out of prerendering at this point because it used ${expression}. ` + `React throws this special object to indicate where. It should not be caught by ` + `your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;
5224
+ }
5225
+ function isDynamicPostpone(err) {
5226
+ if (typeof err === 'object' && err !== null && typeof err.message === 'string') {
5227
+ return isDynamicPostponeReason(err.message);
5228
+ }
5229
+ return false;
5230
+ }
5231
+ function isDynamicPostponeReason(reason) {
5232
+ return reason.includes('needs to bail out of prerendering at this point because it used') && reason.includes('Learn more: https://nextjs.org/docs/messages/ppr-caught-error');
5233
+ }
5234
+ if (isDynamicPostponeReason(createPostponeReason('%%%', '^^^')) === false) {
5235
+ throw Object.defineProperty(new Error('Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js'), "__NEXT_ERROR_CODE", {
5236
+ value: "E296",
5237
+ enumerable: false,
5238
+ configurable: true
5239
+ });
5240
+ }
5241
+ const NEXT_PRERENDER_INTERRUPTED = 'NEXT_PRERENDER_INTERRUPTED';
5242
+ function createPrerenderInterruptedError(message) {
5243
+ const error = Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
5244
+ value: "E394",
5245
+ enumerable: false,
5246
+ configurable: true
5247
+ });
5248
+ error.digest = NEXT_PRERENDER_INTERRUPTED;
5249
+ return error;
5250
+ }
5251
+ function isPrerenderInterruptedError(error) {
5252
+ return typeof error === 'object' && error !== null && error.digest === NEXT_PRERENDER_INTERRUPTED && 'name' in error && 'message' in error && error instanceof Error;
5253
+ }
5254
+ function accessedDynamicData(dynamicAccesses) {
5255
+ return dynamicAccesses.length > 0;
5256
+ }
5257
+ function consumeDynamicAccess(serverDynamic, clientDynamic) {
5258
+ // We mutate because we only call this once we are no longer writing
5259
+ // to the dynamicTrackingState and it's more efficient than creating a new
5260
+ // array.
5261
+ serverDynamic.dynamicAccesses.push(...clientDynamic.dynamicAccesses);
5262
+ return serverDynamic.dynamicAccesses;
5263
+ }
5264
+ function formatDynamicAPIAccesses(dynamicAccesses) {
5265
+ return dynamicAccesses.filter((access)=>typeof access.stack === 'string' && access.stack.length > 0).map(({ expression, stack })=>{
5266
+ stack = stack.split('\n')// Remove the "Error: " prefix from the first line of the stack trace as
5267
+ // well as the first 4 lines of the stack trace which is the distance
5268
+ // from the user code and the `new Error().stack` call.
5269
+ .slice(4).filter((line)=>{
5270
+ // Exclude Next.js internals from the stack trace.
5271
+ if (line.includes('node_modules/next/')) {
5272
+ return false;
5273
+ }
5274
+ // Exclude anonymous functions from the stack trace.
5275
+ if (line.includes(' (<anonymous>)')) {
5276
+ return false;
5277
+ }
5278
+ // Exclude Node.js internals from the stack trace.
5279
+ if (line.includes(' (node:')) {
5280
+ return false;
5281
+ }
5282
+ return true;
5283
+ }).join('\n');
5284
+ return `Dynamic API Usage Debug - ${expression}:\n${stack}`;
5285
+ });
5286
+ }
5287
+ function assertPostpone() {
5288
+ if (!hasPostpone) {
5289
+ throw Object.defineProperty(new Error(`Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js`), "__NEXT_ERROR_CODE", {
5290
+ value: "E224",
5291
+ enumerable: false,
5292
+ configurable: true
5293
+ });
5294
+ }
5295
+ }
5296
+ function createPostponedAbortSignal(reason) {
5297
+ assertPostpone();
5298
+ const controller = new AbortController();
5299
+ // We get our hands on a postpone instance by calling postpone and catching the throw
5300
+ try {
5301
+ _react.default.unstable_postpone(reason);
5302
+ } catch (x) {
5303
+ controller.abort(x);
5304
+ }
5305
+ return controller.signal;
5306
+ }
5307
+ function createHangingInputAbortSignal(workUnitStore) {
5308
+ const controller = new AbortController();
5309
+ if (workUnitStore.cacheSignal) {
5310
+ // If we have a cacheSignal it means we're in a prospective render. If the input
5311
+ // we're waiting on is coming from another cache, we do want to wait for it so that
5312
+ // we can resolve this cache entry too.
5313
+ workUnitStore.cacheSignal.inputReady().then(()=>{
5314
+ controller.abort();
5315
+ });
5316
+ } else {
5317
+ // Otherwise we're in the final render and we should already have all our caches
5318
+ // filled. We might still be waiting on some microtasks so we wait one tick before
5319
+ // giving up. When we give up, we still want to render the content of this cache
5320
+ // as deeply as we can so that we can suspend as deeply as possible in the tree
5321
+ // or not at all if we don't end up waiting for the input.
5322
+ (0, _scheduler.scheduleOnNextTick)(()=>controller.abort());
5323
+ }
5324
+ return controller.signal;
5325
+ }
5326
+ function annotateDynamicAccess(expression, prerenderStore) {
5327
+ const dynamicTracking = prerenderStore.dynamicTracking;
5328
+ if (dynamicTracking) {
5329
+ dynamicTracking.dynamicAccesses.push({
5330
+ stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,
5331
+ expression
5332
+ });
5333
+ }
5334
+ }
5335
+ function useDynamicRouteParams(expression) {
5336
+ const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
5337
+ if (workStore && workStore.isStaticGeneration && workStore.fallbackRouteParams && workStore.fallbackRouteParams.size > 0) {
5338
+ // There are fallback route params, we should track these as dynamic
5339
+ // accesses.
5340
+ const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
5341
+ if (workUnitStore) {
5342
+ // We're prerendering with dynamicIO or PPR or both
5343
+ if (workUnitStore.type === 'prerender') {
5344
+ // We are in a prerender with dynamicIO semantics
5345
+ // We are going to hang here and never resolve. This will cause the currently
5346
+ // rendering component to effectively be a dynamic hole
5347
+ _react.default.use((0, _dynamicrenderingutils.makeHangingPromise)(workUnitStore.renderSignal, expression));
5348
+ } else if (workUnitStore.type === 'prerender-ppr') {
5349
+ // We're prerendering with PPR
5350
+ postponeWithTracking(workStore.route, expression, workUnitStore.dynamicTracking);
5351
+ } else if (workUnitStore.type === 'prerender-legacy') {
5352
+ throwToInterruptStaticGeneration(expression, workStore, workUnitStore);
5353
+ }
5354
+ }
5355
+ }
5356
+ }
5357
+ const hasSuspenseRegex = /\n\s+at Suspense \(<anonymous>\)/;
5358
+ const hasMetadataRegex = new RegExp(`\\n\\s+at ${_metadataconstants.METADATA_BOUNDARY_NAME}[\\n\\s]`);
5359
+ const hasViewportRegex = new RegExp(`\\n\\s+at ${_metadataconstants.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`);
5360
+ const hasOutletRegex = new RegExp(`\\n\\s+at ${_metadataconstants.OUTLET_BOUNDARY_NAME}[\\n\\s]`);
5361
+ function trackAllowedDynamicAccess(route, componentStack, dynamicValidation, serverDynamic, clientDynamic) {
5362
+ if (hasOutletRegex.test(componentStack)) {
5363
+ // We don't need to track that this is dynamic. It is only so when something else is also dynamic.
5364
+ return;
5365
+ } else if (hasMetadataRegex.test(componentStack)) {
5366
+ dynamicValidation.hasDynamicMetadata = true;
5367
+ return;
5368
+ } else if (hasViewportRegex.test(componentStack)) {
5369
+ dynamicValidation.hasDynamicViewport = true;
5370
+ return;
5371
+ } else if (hasSuspenseRegex.test(componentStack)) {
5372
+ dynamicValidation.hasSuspendedDynamic = true;
5373
+ return;
5374
+ } else if (serverDynamic.syncDynamicErrorWithStack || clientDynamic.syncDynamicErrorWithStack) {
5375
+ dynamicValidation.hasSyncDynamicErrors = true;
5376
+ return;
5377
+ } else {
5378
+ const message = `Route "${route}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`;
5379
+ const error = createErrorWithComponentStack(message, componentStack);
5380
+ dynamicValidation.dynamicErrors.push(error);
5381
+ return;
5382
+ }
5383
+ }
5384
+ function createErrorWithComponentStack(message, componentStack) {
5385
+ const error = Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
5386
+ value: "E394",
5387
+ enumerable: false,
5388
+ configurable: true
5389
+ });
5390
+ error.stack = 'Error: ' + message + componentStack;
5391
+ return error;
5392
+ }
5393
+ function throwIfDisallowedDynamic(route, dynamicValidation, serverDynamic, clientDynamic) {
5394
+ let syncError;
5395
+ let syncExpression;
5396
+ let syncLogged;
5397
+ if (serverDynamic.syncDynamicErrorWithStack) {
5398
+ syncError = serverDynamic.syncDynamicErrorWithStack;
5399
+ syncExpression = serverDynamic.syncDynamicExpression;
5400
+ syncLogged = serverDynamic.syncDynamicLogged === true;
5401
+ } else if (clientDynamic.syncDynamicErrorWithStack) {
5402
+ syncError = clientDynamic.syncDynamicErrorWithStack;
5403
+ syncExpression = clientDynamic.syncDynamicExpression;
5404
+ syncLogged = clientDynamic.syncDynamicLogged === true;
5405
+ } else {
5406
+ syncError = null;
5407
+ syncExpression = undefined;
5408
+ syncLogged = false;
5409
+ }
5410
+ if (dynamicValidation.hasSyncDynamicErrors && syncError) {
5411
+ if (!syncLogged) {
5412
+ // In dev we already log errors about sync dynamic access. But during builds we need to ensure
5413
+ // the offending sync error is logged before we exit the build
5414
+ console.error(syncError);
5415
+ }
5416
+ // The actual error should have been logged when the sync access ocurred
5417
+ throw new _staticgenerationbailout.StaticGenBailoutError();
5418
+ }
5419
+ const dynamicErrors = dynamicValidation.dynamicErrors;
5420
+ if (dynamicErrors.length) {
5421
+ for(let i = 0; i < dynamicErrors.length; i++){
5422
+ console.error(dynamicErrors[i]);
5423
+ }
5424
+ throw new _staticgenerationbailout.StaticGenBailoutError();
5425
+ }
5426
+ if (!dynamicValidation.hasSuspendedDynamic) {
5427
+ if (dynamicValidation.hasDynamicMetadata) {
5428
+ if (syncError) {
5429
+ console.error(syncError);
5430
+ throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route "${route}" has a \`generateMetadata\` that could not finish rendering before ${syncExpression} was used. Follow the instructions in the error for this expression to resolve.`), "__NEXT_ERROR_CODE", {
5431
+ value: "E608",
5432
+ enumerable: false,
5433
+ configurable: true
5434
+ });
5435
+ }
5436
+ throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route "${route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or external data (\`fetch(...)\`, etc...) but the rest of the route was static or only used cached data (\`"use cache"\`). If you expected this route to be prerenderable update your \`generateMetadata\` to not use Request data and only use cached external data. Otherwise, add \`await connection()\` somewhere within this route to indicate explicitly it should not be prerendered.`), "__NEXT_ERROR_CODE", {
5437
+ value: "E534",
5438
+ enumerable: false,
5439
+ configurable: true
5440
+ });
5441
+ } else if (dynamicValidation.hasDynamicViewport) {
5442
+ if (syncError) {
5443
+ console.error(syncError);
5444
+ throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route "${route}" has a \`generateViewport\` that could not finish rendering before ${syncExpression} was used. Follow the instructions in the error for this expression to resolve.`), "__NEXT_ERROR_CODE", {
5445
+ value: "E573",
5446
+ enumerable: false,
5447
+ configurable: true
5448
+ });
5449
+ }
5450
+ throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route "${route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or external data (\`fetch(...)\`, etc...) but the rest of the route was static or only used cached data (\`"use cache"\`). If you expected this route to be prerenderable update your \`generateViewport\` to not use Request data and only use cached external data. Otherwise, add \`await connection()\` somewhere within this route to indicate explicitly it should not be prerendered.`), "__NEXT_ERROR_CODE", {
5451
+ value: "E590",
5452
+ enumerable: false,
5453
+ configurable: true
5454
+ });
5455
+ }
5456
+ }
5457
+ }
5458
+
5459
+
5460
+ } (dynamicRendering));
5461
+ return dynamicRendering;
5462
+ }
5463
+
5464
+ var hasRequiredUnstableRethrow_server;
5465
+
5466
+ function requireUnstableRethrow_server () {
5467
+ if (hasRequiredUnstableRethrow_server) return unstableRethrow_server.exports;
5468
+ hasRequiredUnstableRethrow_server = 1;
5469
+ (function (module, exports) {
5470
+ Object.defineProperty(exports, "__esModule", {
5471
+ value: true
5472
+ });
5473
+ Object.defineProperty(exports, "unstable_rethrow", {
5474
+ enumerable: true,
5475
+ get: function() {
5476
+ return unstable_rethrow;
5477
+ }
5478
+ });
5479
+ const _dynamicrenderingutils = requireDynamicRenderingUtils();
5480
+ const _ispostpone = requireIsPostpone();
5481
+ const _bailouttocsr = requireBailoutToCsr();
5482
+ const _isnextroutererror = requireIsNextRouterError();
5483
+ const _dynamicrendering = requireDynamicRendering();
5484
+ const _hooksservercontext = requireHooksServerContext();
5485
+ function unstable_rethrow(error) {
5486
+ if ((0, _isnextroutererror.isNextRouterError)(error) || (0, _bailouttocsr.isBailoutToCSRError)(error) || (0, _hooksservercontext.isDynamicServerError)(error) || (0, _dynamicrendering.isDynamicPostpone)(error) || (0, _ispostpone.isPostpone)(error) || (0, _dynamicrenderingutils.isHangingPromiseRejectionError)(error)) {
5487
+ throw error;
5488
+ }
5489
+ if (error instanceof Error && 'cause' in error) {
5490
+ unstable_rethrow(error.cause);
5491
+ }
5492
+ }
5493
+
5494
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
5495
+ Object.defineProperty(exports.default, '__esModule', { value: true });
5496
+ Object.assign(exports.default, exports);
5497
+ module.exports = exports.default;
5498
+ }
5499
+
5500
+
5501
+ } (unstableRethrow_server, unstableRethrow_server.exports));
5502
+ return unstableRethrow_server.exports;
5503
+ }
5504
+
5505
+ var unstableRethrow_browser = {exports: {}};
5506
+
5507
+ var hasRequiredUnstableRethrow_browser;
5508
+
5509
+ function requireUnstableRethrow_browser () {
5510
+ if (hasRequiredUnstableRethrow_browser) return unstableRethrow_browser.exports;
5511
+ hasRequiredUnstableRethrow_browser = 1;
5512
+ (function (module, exports) {
5513
+ Object.defineProperty(exports, "__esModule", {
5514
+ value: true
5515
+ });
5516
+ Object.defineProperty(exports, "unstable_rethrow", {
5517
+ enumerable: true,
5518
+ get: function() {
5519
+ return unstable_rethrow;
5520
+ }
5521
+ });
5522
+ const _bailouttocsr = requireBailoutToCsr();
5523
+ const _isnextroutererror = requireIsNextRouterError();
5524
+ function unstable_rethrow(error) {
5525
+ if ((0, _isnextroutererror.isNextRouterError)(error) || (0, _bailouttocsr.isBailoutToCSRError)(error)) {
5526
+ throw error;
5527
+ }
5528
+ if (error instanceof Error && 'cause' in error) {
5529
+ unstable_rethrow(error.cause);
5530
+ }
5531
+ }
5532
+
5533
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
5534
+ Object.defineProperty(exports.default, '__esModule', { value: true });
5535
+ Object.assign(exports.default, exports);
5536
+ module.exports = exports.default;
5537
+ }
5538
+
5539
+
5540
+ } (unstableRethrow_browser, unstableRethrow_browser.exports));
5541
+ return unstableRethrow_browser.exports;
5542
+ }
5543
+
5544
+ /**
5545
+ * This function should be used to rethrow internal Next.js errors so that they can be handled by the framework.
5546
+ * When wrapping an API that uses errors to interrupt control flow, you should use this function before you do any error handling.
5547
+ * This function will rethrow the error if it is a Next.js error so it can be handled, otherwise it will do nothing.
5548
+ *
5549
+ * Read more: [Next.js Docs: `unstable_rethrow`](https://nextjs.org/docs/app/api-reference/functions/unstable_rethrow)
5550
+ */
5551
+
5552
+ var hasRequiredUnstableRethrow;
5553
+
5554
+ function requireUnstableRethrow () {
5555
+ if (hasRequiredUnstableRethrow) return unstableRethrow.exports;
5556
+ hasRequiredUnstableRethrow = 1;
5557
+ (function (module, exports) {
5558
+ Object.defineProperty(exports, "__esModule", {
5559
+ value: true
5560
+ });
5561
+ Object.defineProperty(exports, "unstable_rethrow", {
5562
+ enumerable: true,
5563
+ get: function() {
5564
+ return unstable_rethrow;
5565
+ }
5566
+ });
5567
+ const unstable_rethrow = typeof window === 'undefined' ? requireUnstableRethrow_server().unstable_rethrow : requireUnstableRethrow_browser().unstable_rethrow;
5568
+
5569
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
5570
+ Object.defineProperty(exports.default, '__esModule', { value: true });
5571
+ Object.assign(exports.default, exports);
5572
+ module.exports = exports.default;
5573
+ }
5574
+
5575
+
5576
+ } (unstableRethrow, unstableRethrow.exports));
5577
+ return unstableRethrow.exports;
5578
+ }
5579
+
5580
+ /** @internal */
5581
+
5582
+ var hasRequiredNavigation_reactServer;
5583
+
5584
+ function requireNavigation_reactServer () {
5585
+ if (hasRequiredNavigation_reactServer) return navigation_reactServer.exports;
5586
+ hasRequiredNavigation_reactServer = 1;
5587
+ (function (module, exports) {
5588
+ Object.defineProperty(exports, "__esModule", {
5589
+ value: true
5590
+ });
5591
+ function _export(target, all) {
5592
+ for(var name in all)Object.defineProperty(target, name, {
5593
+ enumerable: true,
5594
+ get: all[name]
5595
+ });
5596
+ }
5597
+ _export(exports, {
5598
+ ReadonlyURLSearchParams: function() {
5599
+ return ReadonlyURLSearchParams;
5600
+ },
5601
+ RedirectType: function() {
5602
+ return _redirecterror.RedirectType;
5603
+ },
5604
+ forbidden: function() {
5605
+ return _forbidden.forbidden;
5606
+ },
5607
+ notFound: function() {
5608
+ return _notfound.notFound;
5609
+ },
5610
+ permanentRedirect: function() {
5611
+ return _redirect.permanentRedirect;
5612
+ },
5613
+ redirect: function() {
5614
+ return _redirect.redirect;
5615
+ },
5616
+ unauthorized: function() {
5617
+ return _unauthorized.unauthorized;
5618
+ },
5619
+ unstable_rethrow: function() {
5620
+ return _unstablerethrow.unstable_rethrow;
5621
+ }
5622
+ });
5623
+ const _redirect = requireRedirect();
5624
+ const _redirecterror = requireRedirectError();
5625
+ const _notfound = requireNotFound();
5626
+ const _forbidden = requireForbidden();
5627
+ const _unauthorized = requireUnauthorized();
5628
+ const _unstablerethrow = requireUnstableRethrow();
5629
+ class ReadonlyURLSearchParamsError extends Error {
5630
+ constructor(){
5631
+ super('Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams');
5632
+ }
5633
+ }
5634
+ class ReadonlyURLSearchParams extends URLSearchParams {
5635
+ /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ append() {
5636
+ throw new ReadonlyURLSearchParamsError();
5637
+ }
5638
+ /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ delete() {
5639
+ throw new ReadonlyURLSearchParamsError();
5640
+ }
5641
+ /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ set() {
5642
+ throw new ReadonlyURLSearchParamsError();
5643
+ }
5644
+ /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ sort() {
5645
+ throw new ReadonlyURLSearchParamsError();
5646
+ }
5647
+ }
5648
+
5649
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
5650
+ Object.defineProperty(exports.default, '__esModule', { value: true });
5651
+ Object.assign(exports.default, exports);
5652
+ module.exports = exports.default;
5653
+ }
5654
+
5655
+
5656
+ } (navigation_reactServer, navigation_reactServer.exports));
5657
+ return navigation_reactServer.exports;
5658
+ }
5659
+
5660
+ var serverInsertedHtml_sharedRuntime = {};
5661
+
5662
+ var hasRequiredServerInsertedHtml_sharedRuntime;
5663
+
5664
+ function requireServerInsertedHtml_sharedRuntime () {
5665
+ if (hasRequiredServerInsertedHtml_sharedRuntime) return serverInsertedHtml_sharedRuntime;
5666
+ hasRequiredServerInsertedHtml_sharedRuntime = 1;
5667
+ (function (exports) {
5668
+ 'use client';
5669
+ Object.defineProperty(exports, "__esModule", {
5670
+ value: true
5671
+ });
5672
+ function _export(target, all) {
5673
+ for(var name in all)Object.defineProperty(target, name, {
5674
+ enumerable: true,
5675
+ get: all[name]
5676
+ });
5677
+ }
5678
+ _export(exports, {
5679
+ ServerInsertedHTMLContext: function() {
5680
+ return ServerInsertedHTMLContext;
5681
+ },
5682
+ useServerInsertedHTML: function() {
5683
+ return useServerInsertedHTML;
5684
+ }
5685
+ });
5686
+ const _interop_require_wildcard = /*@__PURE__*/ require_interop_require_wildcard();
5687
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require$$0);
5688
+ const ServerInsertedHTMLContext = /*#__PURE__*/ _react.default.createContext(null);
5689
+ function useServerInsertedHTML(callback) {
5690
+ const addInsertedServerHTMLCallback = (0, _react.useContext)(ServerInsertedHTMLContext);
5691
+ // Should have no effects on client where there's no flush effects provider
5692
+ if (addInsertedServerHTMLCallback) {
5693
+ addInsertedServerHTMLCallback(callback);
5694
+ }
5695
+ }
5696
+
5697
+
5698
+ } (serverInsertedHtml_sharedRuntime));
5699
+ return serverInsertedHtml_sharedRuntime;
5700
+ }
5701
+
5702
+ var bailoutToClientRendering = {exports: {}};
5703
+
5704
+ var hasRequiredBailoutToClientRendering;
5705
+
5706
+ function requireBailoutToClientRendering () {
5707
+ if (hasRequiredBailoutToClientRendering) return bailoutToClientRendering.exports;
5708
+ hasRequiredBailoutToClientRendering = 1;
5709
+ (function (module, exports) {
5710
+ Object.defineProperty(exports, "__esModule", {
5711
+ value: true
5712
+ });
5713
+ Object.defineProperty(exports, "bailoutToClientRendering", {
5714
+ enumerable: true,
5715
+ get: function() {
5716
+ return bailoutToClientRendering;
5717
+ }
5718
+ });
5719
+ const _bailouttocsr = requireBailoutToCsr();
5720
+ const _workasyncstorageexternal = requireWorkAsyncStorage_external();
5721
+ function bailoutToClientRendering(reason) {
5722
+ const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
5723
+ if (workStore == null ? void 0 : workStore.forceStatic) return;
5724
+ if (workStore == null ? void 0 : workStore.isStaticGeneration) throw Object.defineProperty(new _bailouttocsr.BailoutToCSRError(reason), "__NEXT_ERROR_CODE", {
5725
+ value: "E394",
5726
+ enumerable: false,
5727
+ configurable: true
5728
+ });
5729
+ }
5730
+
5731
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
5732
+ Object.defineProperty(exports.default, '__esModule', { value: true });
5733
+ Object.assign(exports.default, exports);
5734
+ module.exports = exports.default;
5735
+ }
5736
+
5737
+
5738
+ } (bailoutToClientRendering, bailoutToClientRendering.exports));
5739
+ return bailoutToClientRendering.exports;
5740
+ }
5741
+
5742
+ var hasRequiredNavigation$1;
5743
+
5744
+ function requireNavigation$1 () {
5745
+ if (hasRequiredNavigation$1) return navigation$1.exports;
5746
+ hasRequiredNavigation$1 = 1;
5747
+ (function (module, exports) {
5748
+ Object.defineProperty(exports, "__esModule", {
5749
+ value: true
5750
+ });
5751
+ function _export(target, all) {
5752
+ for(var name in all)Object.defineProperty(target, name, {
5753
+ enumerable: true,
5754
+ get: all[name]
5755
+ });
5756
+ }
5757
+ _export(exports, {
5758
+ ReadonlyURLSearchParams: function() {
5759
+ return _navigationreactserver.ReadonlyURLSearchParams;
5760
+ },
5761
+ RedirectType: function() {
5762
+ return _navigationreactserver.RedirectType;
5763
+ },
5764
+ ServerInsertedHTMLContext: function() {
5765
+ return _serverinsertedhtmlsharedruntime.ServerInsertedHTMLContext;
5766
+ },
5767
+ forbidden: function() {
5768
+ return _navigationreactserver.forbidden;
5769
+ },
5770
+ notFound: function() {
5771
+ return _navigationreactserver.notFound;
5772
+ },
5773
+ permanentRedirect: function() {
5774
+ return _navigationreactserver.permanentRedirect;
5775
+ },
5776
+ redirect: function() {
5777
+ return _navigationreactserver.redirect;
5778
+ },
5779
+ unauthorized: function() {
5780
+ return _navigationreactserver.unauthorized;
5781
+ },
5782
+ unstable_rethrow: function() {
5783
+ return _navigationreactserver.unstable_rethrow;
5784
+ },
5785
+ useParams: function() {
5786
+ return useParams;
5787
+ },
5788
+ usePathname: function() {
5789
+ return usePathname;
5790
+ },
5791
+ useRouter: function() {
5792
+ return useRouter;
5793
+ },
5794
+ useSearchParams: function() {
5795
+ return useSearchParams;
5796
+ },
5797
+ useSelectedLayoutSegment: function() {
5798
+ return useSelectedLayoutSegment;
5799
+ },
5800
+ useSelectedLayoutSegments: function() {
5801
+ return useSelectedLayoutSegments;
5802
+ },
5803
+ useServerInsertedHTML: function() {
5804
+ return _serverinsertedhtmlsharedruntime.useServerInsertedHTML;
5805
+ }
5806
+ });
5807
+ const _react = require$$0;
5808
+ const _approutercontextsharedruntime = requireAppRouterContext_sharedRuntime();
5809
+ const _hooksclientcontextsharedruntime = requireHooksClientContext_sharedRuntime();
5810
+ const _getsegmentvalue = requireGetSegmentValue();
5811
+ const _segment = requireSegment();
5812
+ const _navigationreactserver = requireNavigation_reactServer();
5813
+ const _serverinsertedhtmlsharedruntime = requireServerInsertedHtml_sharedRuntime();
5814
+ const useDynamicRouteParams = typeof window === 'undefined' ? requireDynamicRendering().useDynamicRouteParams : undefined;
5815
+ function useSearchParams() {
5816
+ const searchParams = (0, _react.useContext)(_hooksclientcontextsharedruntime.SearchParamsContext);
5817
+ // In the case where this is `null`, the compat types added in
5818
+ // `next-env.d.ts` will add a new overload that changes the return type to
5819
+ // include `null`.
5820
+ const readonlySearchParams = (0, _react.useMemo)(()=>{
5821
+ if (!searchParams) {
5822
+ // When the router is not ready in pages, we won't have the search params
5823
+ // available.
5824
+ return null;
5825
+ }
5826
+ return new _navigationreactserver.ReadonlyURLSearchParams(searchParams);
5827
+ }, [
5828
+ searchParams
5829
+ ]);
5830
+ if (typeof window === 'undefined') {
5831
+ // AsyncLocalStorage should not be included in the client bundle.
5832
+ const { bailoutToClientRendering } = requireBailoutToClientRendering();
5833
+ // TODO-APP: handle dynamic = 'force-static' here and on the client
5834
+ bailoutToClientRendering('useSearchParams()');
5835
+ }
5836
+ return readonlySearchParams;
5837
+ }
5838
+ function usePathname() {
5839
+ useDynamicRouteParams == null ? void 0 : useDynamicRouteParams('usePathname()');
5840
+ // In the case where this is `null`, the compat types added in `next-env.d.ts`
5841
+ // will add a new overload that changes the return type to include `null`.
5842
+ return (0, _react.useContext)(_hooksclientcontextsharedruntime.PathnameContext);
5843
+ }
5844
+ function useRouter() {
5845
+ const router = (0, _react.useContext)(_approutercontextsharedruntime.AppRouterContext);
5846
+ if (router === null) {
5847
+ throw Object.defineProperty(new Error('invariant expected app router to be mounted'), "__NEXT_ERROR_CODE", {
5848
+ value: "E238",
5849
+ enumerable: false,
5850
+ configurable: true
5851
+ });
5852
+ }
5853
+ return router;
5854
+ }
5855
+ function useParams() {
5856
+ useDynamicRouteParams == null ? void 0 : useDynamicRouteParams('useParams()');
5857
+ return (0, _react.useContext)(_hooksclientcontextsharedruntime.PathParamsContext);
5858
+ }
5859
+ /** Get the canonical parameters from the current level to the leaf node. */ // Client components API
5860
+ function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first, segmentPath) {
5861
+ if (first === void 0) first = true;
5862
+ if (segmentPath === void 0) segmentPath = [];
5863
+ let node;
5864
+ if (first) {
5865
+ // Use the provided parallel route key on the first parallel route
5866
+ node = tree[1][parallelRouteKey];
5867
+ } else {
5868
+ // After first parallel route prefer children, if there's no children pick the first parallel route.
5869
+ const parallelRoutes = tree[1];
5870
+ var _parallelRoutes_children;
5871
+ node = (_parallelRoutes_children = parallelRoutes.children) != null ? _parallelRoutes_children : Object.values(parallelRoutes)[0];
5872
+ }
5873
+ if (!node) return segmentPath;
5874
+ const segment = node[0];
5875
+ let segmentValue = (0, _getsegmentvalue.getSegmentValue)(segment);
5876
+ if (!segmentValue || segmentValue.startsWith(_segment.PAGE_SEGMENT_KEY)) {
5877
+ return segmentPath;
5878
+ }
5879
+ segmentPath.push(segmentValue);
5880
+ return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath);
5881
+ }
5882
+ function useSelectedLayoutSegments(parallelRouteKey) {
5883
+ if (parallelRouteKey === void 0) parallelRouteKey = 'children';
5884
+ useDynamicRouteParams == null ? void 0 : useDynamicRouteParams('useSelectedLayoutSegments()');
5885
+ const context = (0, _react.useContext)(_approutercontextsharedruntime.LayoutRouterContext);
5886
+ // @ts-expect-error This only happens in `pages`. Type is overwritten in navigation.d.ts
5887
+ if (!context) return null;
5888
+ return getSelectedLayoutSegmentPath(context.parentTree, parallelRouteKey);
5889
+ }
5890
+ function useSelectedLayoutSegment(parallelRouteKey) {
5891
+ if (parallelRouteKey === void 0) parallelRouteKey = 'children';
5892
+ useDynamicRouteParams == null ? void 0 : useDynamicRouteParams('useSelectedLayoutSegment()');
5893
+ const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey);
5894
+ if (!selectedLayoutSegments || selectedLayoutSegments.length === 0) {
5895
+ return null;
5896
+ }
5897
+ const selectedLayoutSegment = parallelRouteKey === 'children' ? selectedLayoutSegments[0] : selectedLayoutSegments[selectedLayoutSegments.length - 1];
5898
+ // if the default slot is showing, we return null since it's not technically "selected" (it's a fallback)
5899
+ // and returning an internal value like `__DEFAULT__` would be confusing.
5900
+ return selectedLayoutSegment === _segment.DEFAULT_SEGMENT_KEY ? null : selectedLayoutSegment;
5901
+ }
5902
+
5903
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
5904
+ Object.defineProperty(exports.default, '__esModule', { value: true });
5905
+ Object.assign(exports.default, exports);
5906
+ module.exports = exports.default;
5907
+ }
5908
+
5909
+
5910
+ } (navigation$1, navigation$1.exports));
5911
+ return navigation$1.exports;
5912
+ }
5913
+
5914
+ var navigation;
5915
+ var hasRequiredNavigation;
5916
+
5917
+ function requireNavigation () {
5918
+ if (hasRequiredNavigation) return navigation;
5919
+ hasRequiredNavigation = 1;
5920
+ navigation = requireNavigation$1();
5921
+ return navigation;
5922
+ }
5923
+
5924
+ var navigationExports = requireNavigation();
5925
+
5926
+ const NavItems = ({ items }) => {
5927
+ const pathname = navigationExports.usePathname();
5928
+ return /* @__PURE__ */ require$$1.jsx(core.Stack, { gap: 0, children: items.map(({ href, isActive, ...navLinkProps }) => {
5929
+ if (href) {
5930
+ const active = isActive ?? href.includes(pathname);
5931
+ return /* @__PURE__ */ require$$1.jsx(
5932
+ core.NavLink,
5933
+ {
5934
+ active,
5935
+ component: Link,
5936
+ prefetch: false,
5937
+ href,
5938
+ ...navLinkProps
5939
+ },
5940
+ navLinkProps.label
5941
+ );
5942
+ }
5943
+ return /* @__PURE__ */ require$$1.jsx(
5944
+ core.NavLink,
5945
+ {
5946
+ active: isActive,
5947
+ component: "button",
5948
+ ...navLinkProps
5949
+ },
5950
+ navLinkProps.label
5951
+ );
5952
+ }) });
5953
+ };
5954
+
5955
+ var HttpStatus = /* @__PURE__ */ ((HttpStatus2) => {
5956
+ HttpStatus2[HttpStatus2["Continue"] = 100] = "Continue";
5957
+ HttpStatus2[HttpStatus2["SwitchingProtocols"] = 101] = "SwitchingProtocols";
5958
+ HttpStatus2[HttpStatus2["Processing"] = 102] = "Processing";
5959
+ HttpStatus2[HttpStatus2["EarlyHints"] = 103] = "EarlyHints";
5960
+ HttpStatus2[HttpStatus2["Ok"] = 200] = "Ok";
5961
+ HttpStatus2[HttpStatus2["Created"] = 201] = "Created";
5962
+ HttpStatus2[HttpStatus2["Accepted"] = 202] = "Accepted";
5963
+ HttpStatus2[HttpStatus2["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
5964
+ HttpStatus2[HttpStatus2["NoContent"] = 204] = "NoContent";
5965
+ HttpStatus2[HttpStatus2["ResetContent"] = 205] = "ResetContent";
5966
+ HttpStatus2[HttpStatus2["PartialContent"] = 206] = "PartialContent";
5967
+ HttpStatus2[HttpStatus2["MultiStatus"] = 207] = "MultiStatus";
5968
+ HttpStatus2[HttpStatus2["AlreadyReported"] = 208] = "AlreadyReported";
5969
+ HttpStatus2[HttpStatus2["ImUsed"] = 226] = "ImUsed";
5970
+ HttpStatus2[HttpStatus2["MultipleChoices"] = 300] = "MultipleChoices";
5971
+ HttpStatus2[HttpStatus2["MovedPermanently"] = 301] = "MovedPermanently";
5972
+ HttpStatus2[HttpStatus2["Found"] = 302] = "Found";
5973
+ HttpStatus2[HttpStatus2["SeeOther"] = 303] = "SeeOther";
5974
+ HttpStatus2[HttpStatus2["NotModified"] = 304] = "NotModified";
5975
+ HttpStatus2[HttpStatus2["UseProxy"] = 305] = "UseProxy";
5976
+ HttpStatus2[HttpStatus2["TemporaryRedirect"] = 307] = "TemporaryRedirect";
5977
+ HttpStatus2[HttpStatus2["PermanentRedirect"] = 308] = "PermanentRedirect";
5978
+ HttpStatus2[HttpStatus2["BadRequest"] = 400] = "BadRequest";
5979
+ HttpStatus2[HttpStatus2["Unauthorized"] = 401] = "Unauthorized";
5980
+ HttpStatus2[HttpStatus2["PaymentRequired"] = 402] = "PaymentRequired";
5981
+ HttpStatus2[HttpStatus2["Forbidden"] = 403] = "Forbidden";
5982
+ HttpStatus2[HttpStatus2["NotFound"] = 404] = "NotFound";
5983
+ HttpStatus2[HttpStatus2["MethodNotAllowed"] = 405] = "MethodNotAllowed";
5984
+ HttpStatus2[HttpStatus2["NotAcceptable"] = 406] = "NotAcceptable";
5985
+ HttpStatus2[HttpStatus2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
5986
+ HttpStatus2[HttpStatus2["RequestTimeout"] = 408] = "RequestTimeout";
5987
+ HttpStatus2[HttpStatus2["Conflict"] = 409] = "Conflict";
5988
+ HttpStatus2[HttpStatus2["Gone"] = 410] = "Gone";
5989
+ HttpStatus2[HttpStatus2["LengthRequired"] = 411] = "LengthRequired";
5990
+ HttpStatus2[HttpStatus2["PreconditionFailed"] = 412] = "PreconditionFailed";
5991
+ HttpStatus2[HttpStatus2["PayloadTooLarge"] = 413] = "PayloadTooLarge";
5992
+ HttpStatus2[HttpStatus2["UriTooLong"] = 414] = "UriTooLong";
5993
+ HttpStatus2[HttpStatus2["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
5994
+ HttpStatus2[HttpStatus2["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
5995
+ HttpStatus2[HttpStatus2["ExpectationFailed"] = 417] = "ExpectationFailed";
5996
+ HttpStatus2[HttpStatus2["MisdirectedRequest"] = 421] = "MisdirectedRequest";
5997
+ HttpStatus2[HttpStatus2["UnprocessableEntity"] = 422] = "UnprocessableEntity";
5998
+ HttpStatus2[HttpStatus2["Locked"] = 423] = "Locked";
5999
+ HttpStatus2[HttpStatus2["FailedDependency"] = 424] = "FailedDependency";
6000
+ HttpStatus2[HttpStatus2["TooEarly"] = 425] = "TooEarly";
6001
+ HttpStatus2[HttpStatus2["UpgradeRequired"] = 426] = "UpgradeRequired";
6002
+ HttpStatus2[HttpStatus2["PreconditionRequired"] = 428] = "PreconditionRequired";
6003
+ HttpStatus2[HttpStatus2["TooManyRequests"] = 429] = "TooManyRequests";
6004
+ HttpStatus2[HttpStatus2["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
6005
+ HttpStatus2[HttpStatus2["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
6006
+ HttpStatus2[HttpStatus2["InternalServerError"] = 500] = "InternalServerError";
6007
+ HttpStatus2[HttpStatus2["NotImplemented"] = 501] = "NotImplemented";
6008
+ HttpStatus2[HttpStatus2["BadGateway"] = 502] = "BadGateway";
6009
+ HttpStatus2[HttpStatus2["ServiceUnavailable"] = 503] = "ServiceUnavailable";
6010
+ HttpStatus2[HttpStatus2["GatewayTimeout"] = 504] = "GatewayTimeout";
6011
+ HttpStatus2[HttpStatus2["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
6012
+ HttpStatus2[HttpStatus2["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
6013
+ HttpStatus2[HttpStatus2["InsufficientStorage"] = 507] = "InsufficientStorage";
6014
+ HttpStatus2[HttpStatus2["LoopDetected"] = 508] = "LoopDetected";
6015
+ HttpStatus2[HttpStatus2["NotExtended"] = 510] = "NotExtended";
6016
+ HttpStatus2[HttpStatus2["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
6017
+ return HttpStatus2;
6018
+ })(HttpStatus || {});
6019
+
6020
+ var Revalidate = /* @__PURE__ */ ((Revalidate2) => {
6021
+ Revalidate2[Revalidate2["OneHour"] = 3600] = "OneHour";
6022
+ Revalidate2[Revalidate2["OneDay"] = 86400] = "OneDay";
6023
+ Revalidate2[Revalidate2["OneWeek"] = 604800] = "OneWeek";
6024
+ Revalidate2[Revalidate2["OneMonth"] = 2592e3] = "OneMonth";
6025
+ Revalidate2[Revalidate2["OneYear"] = 31536e3] = "OneYear";
6026
+ return Revalidate2;
6027
+ })(Revalidate || {});
6028
+
6029
+ const NavigationHistoryContext = require$$0.createContext(null);
6030
+ function NavigationHistoryProvider({ children }) {
6031
+ const pathname = navigationExports.usePathname();
6032
+ const searchParams = navigationExports.useSearchParams();
6033
+ const [history, setHistory] = require$$0.useState([]);
6034
+ require$$0.useEffect(() => {
6035
+ const fullPath = searchParams?.size ? `${pathname}?${searchParams.toString()}` : pathname;
6036
+ if (fullPath) {
6037
+ setHistory((prev) => {
6038
+ if (prev.length > 0 && prev[prev.length - 1] === fullPath) {
6039
+ return prev;
6040
+ }
6041
+ return [...prev, fullPath];
6042
+ });
6043
+ }
6044
+ }, [pathname, searchParams]);
6045
+ return /* @__PURE__ */ require$$1.jsx(NavigationHistoryContext.Provider, { value: { history }, children });
6046
+ }
6047
+ const QP_BACK_URL_NAME = "backUrl";
6048
+ function useNavigationHistory() {
6049
+ const context = require$$0.useContext(NavigationHistoryContext);
6050
+ const router = navigationExports.useRouter();
6051
+ if (!context) {
6052
+ throw new Error("useNavigationHistory debe usarse dentro de un NavigationHistoryProvider");
6053
+ }
6054
+ const searchParams = navigationExports.useSearchParams();
6055
+ const { history } = context;
6056
+ const goBack = (fallback) => {
6057
+ const returnUrl = searchParams.get(QP_BACK_URL_NAME);
6058
+ if (returnUrl) {
6059
+ router.push(returnUrl);
6060
+ return;
6061
+ }
6062
+ if (history.length <= 1) {
6063
+ router.push(fallback ?? "/");
6064
+ return;
6065
+ }
6066
+ const previousRoute = history[history.length - 2];
6067
+ const currentRoute = history[history.length - 1];
6068
+ if (history.length >= 3 && history[history.length - 3] === currentRoute) {
6069
+ router.push(fallback ?? "/");
6070
+ return;
6071
+ }
6072
+ router.push(previousRoute ?? "/");
6073
+ };
6074
+ return {
6075
+ history,
6076
+ goBack,
6077
+ currentRoute: history.length > 0 ? history[history.length - 1] : null,
6078
+ hasPreviousRoute: history.length > 1,
6079
+ getPreviousRoute: () => history.length >= 2 ? history[history.length - 2] : null
6080
+ };
6081
+ }
6082
+
6083
+ const PageData = require$$0.createContext(void 0);
6084
+ const PageDataProvider = ({
6085
+ value,
6086
+ children
6087
+ }) => /* @__PURE__ */ require$$1.jsx(PageData.Provider, { value, children });
6088
+ const usePageData = () => {
6089
+ const data = require$$0.useContext(PageData);
6090
+ if (data === void 0) throw new Error("Out of context: usePageData");
6091
+ return data;
6092
+ };
6093
+
6094
+ const Form = ({
6095
+ methods,
6096
+ onSubmit = () => {
6097
+ },
6098
+ onSubmitError,
6099
+ ...rest
6100
+ }) => {
6101
+ return /* @__PURE__ */ require$$1.jsx(reactHookForm.FormProvider, { ...methods, children: /* @__PURE__ */ require$$1.jsx(
6102
+ core.Box,
6103
+ {
6104
+ component: "form",
6105
+ onSubmit: methods.handleSubmit(onSubmit, onSubmitError),
6106
+ ...rest
6107
+ }
6108
+ ) });
6109
+ };
6110
+
6111
+ const FormButtonSubmit = (props) => {
6112
+ const { formState } = reactHookForm.useFormContext();
6113
+ const { isSubmitting } = formState;
6114
+ return /* @__PURE__ */ require$$1.jsx(
6115
+ core.Button,
6116
+ {
6117
+ loading: isSubmitting,
6118
+ type: "submit",
6119
+ ...props
6120
+ }
6121
+ );
6122
+ };
6123
+
6124
+ const zodValidator = (schema) => {
6125
+ return (values) => {
6126
+ const result = schema.safeParse(values);
6127
+ if (result.success) return;
6128
+ const { error } = result;
6129
+ const firstError = error.issues[0];
6130
+ return firstError?.message;
6131
+ };
6132
+ };
6133
+
6134
+ const nullableInput = (schema, message = "Campo requerido") => {
6135
+ return schema.nullable().transform((val, ctx) => {
6136
+ if (val === null) {
6137
+ ctx.addIssue({
6138
+ code: zod.z.ZodIssueCode.custom,
6139
+ fatal: true,
6140
+ message
6141
+ });
6142
+ return zod.z.NEVER;
6143
+ }
6144
+ return val;
6145
+ });
6146
+ };
6147
+
6148
+ const withForm = (WrappedComponent, getControllerProps) => {
6149
+ const FormField = (props) => {
6150
+ const { validate, name = "", placeholder, label, description, ...withFormRestProps } = props;
6151
+ return /* @__PURE__ */ require$$1.jsx(
6152
+ reactHookForm.Controller,
6153
+ {
6154
+ name,
6155
+ defaultValue: "",
6156
+ rules: {
6157
+ validate: validate && !props.disabled ? zodValidator(validate) : void 0
6158
+ },
6159
+ disabled: props.disabled,
6160
+ ...getControllerProps?.(props),
6161
+ render: (renderProps) => {
6162
+ const {
6163
+ fieldState: { isTouched, error }
6164
+ } = renderProps;
6165
+ const fieldProps = {
6166
+ ...renderProps,
6167
+ props: {
6168
+ ...props,
6169
+ validate: void 0
6170
+ },
6171
+ field: {
6172
+ ...renderProps.field,
6173
+ label,
6174
+ placeholder,
6175
+ description,
6176
+ error: error?.message
6177
+ },
6178
+ ...withFormRestProps
6179
+ };
6180
+ return /* @__PURE__ */ require$$1.jsx(WrappedComponent, { ...fieldProps });
6181
+ }
6182
+ }
6183
+ );
6184
+ };
6185
+ FormField.displayName = `withForm(${WrappedComponent.displayName})`;
6186
+ return FormField;
6187
+ };
6188
+
6189
+ const withModalManager = (WrappedComponent) => {
6190
+ const Component = ({
6191
+ removeModal,
6192
+ opened,
6193
+ ...props
6194
+ }) => {
6195
+ const [isOpen, setIsOpen] = require$$0.useState(false);
6196
+ const onClose = () => {
6197
+ setIsOpen(false);
6198
+ setTimeout(() => removeModal(), 200);
6199
+ props.onClose?.();
6200
+ };
6201
+ require$$0.useEffect(() => {
6202
+ if (opened) setTimeout(() => setIsOpen(true), 0);
6203
+ else onClose();
6204
+ }, [opened]);
6205
+ return /* @__PURE__ */ require$$1.jsx(WrappedComponent, { ...props, opened: isOpen, onClose });
6206
+ };
6207
+ Component.displayName = `withModalManager(${WrappedComponent.displayName})`;
6208
+ return Component;
6209
+ };
6210
+
6211
+ const breakpointsWithPx = {
6212
+ xs: "576px",
6213
+ sm: "640px",
6214
+ md: "768px",
6215
+ lg: "1024px",
6216
+ xl: "1280px",
6217
+ ["2xl"]: "1536px"
6218
+ };
6219
+
6220
+ const toTailwindColors = (colors) => Object.entries(colors).reduce(
6221
+ (acc, [key, value]) => {
6222
+ acc[key] = value.reduce(
6223
+ (acc2, color, index) => {
6224
+ acc2[index] = color;
6225
+ return acc2;
6226
+ },
6227
+ {}
6228
+ );
6229
+ return acc;
6230
+ },
6231
+ {}
6232
+ );
6233
+
6234
+ function formatBytes(bytes, decimals = 2) {
6235
+ if (!+bytes) return "0 Bytes";
6236
+ const k = 1024;
6237
+ const dm = decimals < 0 ? 0 : decimals;
6238
+ const sizes = ["Bytes", "KB", "MB"];
6239
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
6240
+ return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
6241
+ }
6242
+
6243
+ const parseJSON = async (response) => {
6244
+ return response.text().then(function(text) {
6245
+ return text ? JSON.parse(text) : {};
6246
+ });
6247
+ };
6248
+
6249
+ const addBodyJsonHook = async (error) => {
6250
+ error.response.bodyJson = await parseJSON(error.response);
6251
+ return error;
6252
+ };
6253
+
6254
+ function indexBy(arr, getKey, getValue) {
6255
+ if (getValue)
6256
+ return arr.reduce(
6257
+ (acc, item) => {
6258
+ const key = getKey(item);
6259
+ if (key === void 0) return acc;
6260
+ acc[key] = getValue(item);
6261
+ return acc;
6262
+ },
6263
+ {}
6264
+ );
6265
+ return arr.reduce(
6266
+ (acc, item) => {
6267
+ const key = getKey(item);
6268
+ if (key === void 0) return acc;
6269
+ acc[key] = item;
6270
+ return acc;
6271
+ },
6272
+ {}
6273
+ );
6274
+ }
6275
+ const groupBy = (arr, getKey) => {
6276
+ const groups = {};
6277
+ arr?.forEach((item) => {
6278
+ const key = getKey(item);
6279
+ if (key === null) return;
6280
+ if (Array.isArray(key)) {
6281
+ key.forEach((k) => {
6282
+ if (!groups[k]) groups[k] = [];
6283
+ groups[k]?.push(item);
6284
+ });
6285
+ return;
6286
+ }
6287
+ if (!groups[key]) groups[key] = [];
6288
+ groups[key]?.push(item);
6289
+ });
6290
+ return groups;
6291
+ };
6292
+
6293
+ const shuffleArray = (array) => {
6294
+ const shuffledArray = [...array];
6295
+ let currentIndex = shuffledArray.length, randomIndex;
6296
+ while (currentIndex > 0) {
6297
+ randomIndex = Math.floor(Math.random() * currentIndex);
6298
+ currentIndex--;
6299
+ [shuffledArray[currentIndex], shuffledArray[randomIndex]] = [
6300
+ shuffledArray[randomIndex],
6301
+ shuffledArray[currentIndex]
6302
+ ];
6303
+ }
6304
+ return shuffledArray;
3397
6305
  };
3398
6306
 
3399
6307
  exports.EmptyState = EmptyState;
6308
+ exports.Form = Form;
6309
+ exports.FormButtonSubmit = FormButtonSubmit;
6310
+ exports.HttpStatus = HttpStatus;
3400
6311
  exports.InfinityLoader = InfinityLoader;
3401
6312
  exports.NavItems = NavItems;
6313
+ exports.NavigationHistoryProvider = NavigationHistoryProvider;
6314
+ exports.PageDataProvider = PageDataProvider;
6315
+ exports.QP_BACK_URL_NAME = QP_BACK_URL_NAME;
6316
+ exports.Revalidate = Revalidate;
3402
6317
  exports.SelectInfinity = SelectInfinity;
6318
+ exports.addBodyJsonHook = addBodyJsonHook;
6319
+ exports.breakpointsWithPx = breakpointsWithPx;
6320
+ exports.formatBytes = formatBytes;
6321
+ exports.groupBy = groupBy;
6322
+ exports.indexBy = indexBy;
6323
+ exports.nullableInput = nullableInput;
6324
+ exports.parseJSON = parseJSON;
6325
+ exports.shuffleArray = shuffleArray;
6326
+ exports.toTailwindColors = toTailwindColors;
6327
+ exports.useFetchNextPageOnScroll = useFetchNextPageOnScroll;
6328
+ exports.useNavigationHistory = useNavigationHistory;
6329
+ exports.useOnScrollProgress = useOnScrollProgress;
6330
+ exports.usePageData = usePageData;
6331
+ exports.withForm = withForm;
6332
+ exports.withModalManager = withModalManager;
6333
+ exports.zodValidator = zodValidator;