@moontra/moonui-pro 3.4.41 → 3.4.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/index.global.js +111 -111
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/next-config-plugin.mjs +1 -1
- package/dist/server.mjs +984 -765
- package/dist/styles/nprogress.mjs +1 -1
- package/dist/vite-plugin.mjs +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.cjs +66 -113
package/dist/server.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import crypto__default from 'crypto';
|
|
|
6
6
|
/**
|
|
7
7
|
* @moontra/moonui-pro v2.0.9
|
|
8
8
|
* Premium UI components for MoonUI
|
|
9
|
-
* (c)
|
|
9
|
+
* (c) 2026 MoonUI. All rights reserved.
|
|
10
10
|
* @license Commercial - https://moonui.dev/license
|
|
11
11
|
*/
|
|
12
12
|
var __create = Object.create;
|
|
@@ -543,232 +543,6 @@ var require_work_async_storage_external = __commonJS({
|
|
|
543
543
|
}
|
|
544
544
|
});
|
|
545
545
|
|
|
546
|
-
// ../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js
|
|
547
|
-
var require_work_unit_async_storage_instance = __commonJS({
|
|
548
|
-
"../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js"(exports) {
|
|
549
|
-
Object.defineProperty(exports, "__esModule", {
|
|
550
|
-
value: true
|
|
551
|
-
});
|
|
552
|
-
Object.defineProperty(exports, "workUnitAsyncStorageInstance", {
|
|
553
|
-
enumerable: true,
|
|
554
|
-
get: function() {
|
|
555
|
-
return workUnitAsyncStorageInstance;
|
|
556
|
-
}
|
|
557
|
-
});
|
|
558
|
-
var _asynclocalstorage = require_async_local_storage();
|
|
559
|
-
var workUnitAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
560
|
-
}
|
|
561
|
-
});
|
|
562
|
-
|
|
563
|
-
// ../../node_modules/next/dist/client/components/app-router-headers.js
|
|
564
|
-
var require_app_router_headers = __commonJS({
|
|
565
|
-
"../../node_modules/next/dist/client/components/app-router-headers.js"(exports, module) {
|
|
566
|
-
Object.defineProperty(exports, "__esModule", {
|
|
567
|
-
value: true
|
|
568
|
-
});
|
|
569
|
-
function _export(target, all) {
|
|
570
|
-
for (var name in all)
|
|
571
|
-
Object.defineProperty(target, name, {
|
|
572
|
-
enumerable: true,
|
|
573
|
-
get: all[name]
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
_export(exports, {
|
|
577
|
-
ACTION_HEADER: function() {
|
|
578
|
-
return ACTION_HEADER;
|
|
579
|
-
},
|
|
580
|
-
FLIGHT_HEADERS: function() {
|
|
581
|
-
return FLIGHT_HEADERS;
|
|
582
|
-
},
|
|
583
|
-
NEXT_DID_POSTPONE_HEADER: function() {
|
|
584
|
-
return NEXT_DID_POSTPONE_HEADER;
|
|
585
|
-
},
|
|
586
|
-
NEXT_HMR_REFRESH_HASH_COOKIE: function() {
|
|
587
|
-
return NEXT_HMR_REFRESH_HASH_COOKIE;
|
|
588
|
-
},
|
|
589
|
-
NEXT_HMR_REFRESH_HEADER: function() {
|
|
590
|
-
return NEXT_HMR_REFRESH_HEADER;
|
|
591
|
-
},
|
|
592
|
-
NEXT_IS_PRERENDER_HEADER: function() {
|
|
593
|
-
return NEXT_IS_PRERENDER_HEADER;
|
|
594
|
-
},
|
|
595
|
-
NEXT_REWRITTEN_PATH_HEADER: function() {
|
|
596
|
-
return NEXT_REWRITTEN_PATH_HEADER;
|
|
597
|
-
},
|
|
598
|
-
NEXT_REWRITTEN_QUERY_HEADER: function() {
|
|
599
|
-
return NEXT_REWRITTEN_QUERY_HEADER;
|
|
600
|
-
},
|
|
601
|
-
NEXT_ROUTER_PREFETCH_HEADER: function() {
|
|
602
|
-
return NEXT_ROUTER_PREFETCH_HEADER;
|
|
603
|
-
},
|
|
604
|
-
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER: function() {
|
|
605
|
-
return NEXT_ROUTER_SEGMENT_PREFETCH_HEADER;
|
|
606
|
-
},
|
|
607
|
-
NEXT_ROUTER_STALE_TIME_HEADER: function() {
|
|
608
|
-
return NEXT_ROUTER_STALE_TIME_HEADER;
|
|
609
|
-
},
|
|
610
|
-
NEXT_ROUTER_STATE_TREE_HEADER: function() {
|
|
611
|
-
return NEXT_ROUTER_STATE_TREE_HEADER;
|
|
612
|
-
},
|
|
613
|
-
NEXT_RSC_UNION_QUERY: function() {
|
|
614
|
-
return NEXT_RSC_UNION_QUERY;
|
|
615
|
-
},
|
|
616
|
-
NEXT_URL: function() {
|
|
617
|
-
return NEXT_URL;
|
|
618
|
-
},
|
|
619
|
-
RSC_CONTENT_TYPE_HEADER: function() {
|
|
620
|
-
return RSC_CONTENT_TYPE_HEADER;
|
|
621
|
-
},
|
|
622
|
-
RSC_HEADER: function() {
|
|
623
|
-
return RSC_HEADER;
|
|
624
|
-
}
|
|
625
|
-
});
|
|
626
|
-
var RSC_HEADER = "RSC";
|
|
627
|
-
var ACTION_HEADER = "Next-Action";
|
|
628
|
-
var NEXT_ROUTER_STATE_TREE_HEADER = "Next-Router-State-Tree";
|
|
629
|
-
var NEXT_ROUTER_PREFETCH_HEADER = "Next-Router-Prefetch";
|
|
630
|
-
var NEXT_ROUTER_SEGMENT_PREFETCH_HEADER = "Next-Router-Segment-Prefetch";
|
|
631
|
-
var NEXT_HMR_REFRESH_HEADER = "Next-HMR-Refresh";
|
|
632
|
-
var NEXT_HMR_REFRESH_HASH_COOKIE = "__next_hmr_refresh_hash__";
|
|
633
|
-
var NEXT_URL = "Next-Url";
|
|
634
|
-
var RSC_CONTENT_TYPE_HEADER = "text/x-component";
|
|
635
|
-
var FLIGHT_HEADERS = [
|
|
636
|
-
RSC_HEADER,
|
|
637
|
-
NEXT_ROUTER_STATE_TREE_HEADER,
|
|
638
|
-
NEXT_ROUTER_PREFETCH_HEADER,
|
|
639
|
-
NEXT_HMR_REFRESH_HEADER,
|
|
640
|
-
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER
|
|
641
|
-
];
|
|
642
|
-
var NEXT_RSC_UNION_QUERY = "_rsc";
|
|
643
|
-
var NEXT_ROUTER_STALE_TIME_HEADER = "x-nextjs-stale-time";
|
|
644
|
-
var NEXT_DID_POSTPONE_HEADER = "x-nextjs-postponed";
|
|
645
|
-
var NEXT_REWRITTEN_PATH_HEADER = "x-nextjs-rewritten-path";
|
|
646
|
-
var NEXT_REWRITTEN_QUERY_HEADER = "x-nextjs-rewritten-query";
|
|
647
|
-
var NEXT_IS_PRERENDER_HEADER = "x-nextjs-prerender";
|
|
648
|
-
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
649
|
-
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
650
|
-
Object.assign(exports.default, exports);
|
|
651
|
-
module.exports = exports.default;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
});
|
|
655
|
-
|
|
656
|
-
// ../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js
|
|
657
|
-
var require_work_unit_async_storage_external = __commonJS({
|
|
658
|
-
"../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js"(exports) {
|
|
659
|
-
Object.defineProperty(exports, "__esModule", {
|
|
660
|
-
value: true
|
|
661
|
-
});
|
|
662
|
-
function _export(target, all) {
|
|
663
|
-
for (var name in all)
|
|
664
|
-
Object.defineProperty(target, name, {
|
|
665
|
-
enumerable: true,
|
|
666
|
-
get: all[name]
|
|
667
|
-
});
|
|
668
|
-
}
|
|
669
|
-
_export(exports, {
|
|
670
|
-
getDraftModeProviderForCacheScope: function() {
|
|
671
|
-
return getDraftModeProviderForCacheScope;
|
|
672
|
-
},
|
|
673
|
-
getExpectedRequestStore: function() {
|
|
674
|
-
return getExpectedRequestStore;
|
|
675
|
-
},
|
|
676
|
-
getHmrRefreshHash: function() {
|
|
677
|
-
return getHmrRefreshHash;
|
|
678
|
-
},
|
|
679
|
-
getPrerenderResumeDataCache: function() {
|
|
680
|
-
return getPrerenderResumeDataCache;
|
|
681
|
-
},
|
|
682
|
-
getRenderResumeDataCache: function() {
|
|
683
|
-
return getRenderResumeDataCache;
|
|
684
|
-
},
|
|
685
|
-
throwForMissingRequestStore: function() {
|
|
686
|
-
return throwForMissingRequestStore;
|
|
687
|
-
},
|
|
688
|
-
workUnitAsyncStorage: function() {
|
|
689
|
-
return _workunitasyncstorageinstance.workUnitAsyncStorageInstance;
|
|
690
|
-
}
|
|
691
|
-
});
|
|
692
|
-
var _workunitasyncstorageinstance = require_work_unit_async_storage_instance();
|
|
693
|
-
var _approuterheaders = require_app_router_headers();
|
|
694
|
-
function getExpectedRequestStore(callingExpression) {
|
|
695
|
-
const workUnitStore = _workunitasyncstorageinstance.workUnitAsyncStorageInstance.getStore();
|
|
696
|
-
if (!workUnitStore) {
|
|
697
|
-
throwForMissingRequestStore(callingExpression);
|
|
698
|
-
}
|
|
699
|
-
switch (workUnitStore.type) {
|
|
700
|
-
case "request":
|
|
701
|
-
return workUnitStore;
|
|
702
|
-
case "prerender":
|
|
703
|
-
case "prerender-ppr":
|
|
704
|
-
case "prerender-legacy":
|
|
705
|
-
throw Object.defineProperty(new Error(`\`${callingExpression}\` cannot be called inside a prerender. This is a bug in Next.js.`), "__NEXT_ERROR_CODE", {
|
|
706
|
-
value: "E401",
|
|
707
|
-
enumerable: false,
|
|
708
|
-
configurable: true
|
|
709
|
-
});
|
|
710
|
-
case "cache":
|
|
711
|
-
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", {
|
|
712
|
-
value: "E37",
|
|
713
|
-
enumerable: false,
|
|
714
|
-
configurable: true
|
|
715
|
-
});
|
|
716
|
-
case "unstable-cache":
|
|
717
|
-
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", {
|
|
718
|
-
value: "E69",
|
|
719
|
-
enumerable: false,
|
|
720
|
-
configurable: true
|
|
721
|
-
});
|
|
722
|
-
default:
|
|
723
|
-
const _exhaustiveCheck = workUnitStore;
|
|
724
|
-
return _exhaustiveCheck;
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
function throwForMissingRequestStore(callingExpression) {
|
|
728
|
-
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", {
|
|
729
|
-
value: "E251",
|
|
730
|
-
enumerable: false,
|
|
731
|
-
configurable: true
|
|
732
|
-
});
|
|
733
|
-
}
|
|
734
|
-
function getPrerenderResumeDataCache(workUnitStore) {
|
|
735
|
-
if (workUnitStore.type === "prerender" || workUnitStore.type === "prerender-ppr") {
|
|
736
|
-
return workUnitStore.prerenderResumeDataCache;
|
|
737
|
-
}
|
|
738
|
-
return null;
|
|
739
|
-
}
|
|
740
|
-
function getRenderResumeDataCache(workUnitStore) {
|
|
741
|
-
if (workUnitStore.type !== "prerender-legacy" && workUnitStore.type !== "cache" && workUnitStore.type !== "unstable-cache") {
|
|
742
|
-
if (workUnitStore.type === "request") {
|
|
743
|
-
return workUnitStore.renderResumeDataCache;
|
|
744
|
-
}
|
|
745
|
-
return workUnitStore.prerenderResumeDataCache;
|
|
746
|
-
}
|
|
747
|
-
return null;
|
|
748
|
-
}
|
|
749
|
-
function getHmrRefreshHash(workStore, workUnitStore) {
|
|
750
|
-
var _workUnitStore_cookies_get;
|
|
751
|
-
if (!workStore.dev) {
|
|
752
|
-
return void 0;
|
|
753
|
-
}
|
|
754
|
-
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 : void 0;
|
|
755
|
-
}
|
|
756
|
-
function getDraftModeProviderForCacheScope(workStore, workUnitStore) {
|
|
757
|
-
if (workStore.isDraftMode) {
|
|
758
|
-
switch (workUnitStore.type) {
|
|
759
|
-
case "cache":
|
|
760
|
-
case "unstable-cache":
|
|
761
|
-
case "request":
|
|
762
|
-
return workUnitStore.draftMode;
|
|
763
|
-
default:
|
|
764
|
-
return void 0;
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
return void 0;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
});
|
|
771
|
-
|
|
772
546
|
// ../../node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js
|
|
773
547
|
var require_request_cookies = __commonJS({
|
|
774
548
|
"../../node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js"(exports) {
|
|
@@ -798,20 +572,19 @@ var require_request_cookies = __commonJS({
|
|
|
798
572
|
areCookiesMutableInCurrentPhase: function() {
|
|
799
573
|
return areCookiesMutableInCurrentPhase;
|
|
800
574
|
},
|
|
575
|
+
createCookiesWithMutableAccessCheck: function() {
|
|
576
|
+
return createCookiesWithMutableAccessCheck;
|
|
577
|
+
},
|
|
801
578
|
getModifiedCookieValues: function() {
|
|
802
579
|
return getModifiedCookieValues;
|
|
803
580
|
},
|
|
804
581
|
responseCookiesToRequestCookies: function() {
|
|
805
582
|
return responseCookiesToRequestCookies;
|
|
806
|
-
},
|
|
807
|
-
wrapWithMutableAccessCheck: function() {
|
|
808
|
-
return wrapWithMutableAccessCheck;
|
|
809
583
|
}
|
|
810
584
|
});
|
|
811
585
|
var _cookies = require_cookies2();
|
|
812
586
|
var _reflect = require_reflect();
|
|
813
587
|
var _workasyncstorageexternal = require_work_async_storage_external();
|
|
814
|
-
var _workunitasyncstorageexternal = require_work_unit_async_storage_external();
|
|
815
588
|
var ReadonlyRequestCookiesError = class extends Error {
|
|
816
589
|
constructor() {
|
|
817
590
|
super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options");
|
|
@@ -917,19 +690,19 @@ var require_request_cookies = __commonJS({
|
|
|
917
690
|
return wrappedCookies;
|
|
918
691
|
}
|
|
919
692
|
};
|
|
920
|
-
function
|
|
921
|
-
const wrappedCookies = new Proxy(
|
|
693
|
+
function createCookiesWithMutableAccessCheck(requestStore) {
|
|
694
|
+
const wrappedCookies = new Proxy(requestStore.mutableCookies, {
|
|
922
695
|
get(target, prop, receiver) {
|
|
923
696
|
switch (prop) {
|
|
924
697
|
case "delete":
|
|
925
698
|
return function(...args) {
|
|
926
|
-
ensureCookiesAreStillMutable(
|
|
699
|
+
ensureCookiesAreStillMutable(requestStore);
|
|
927
700
|
target.delete(...args);
|
|
928
701
|
return wrappedCookies;
|
|
929
702
|
};
|
|
930
703
|
case "set":
|
|
931
704
|
return function(...args) {
|
|
932
|
-
ensureCookiesAreStillMutable(
|
|
705
|
+
ensureCookiesAreStillMutable(requestStore);
|
|
933
706
|
target.set(...args);
|
|
934
707
|
return wrappedCookies;
|
|
935
708
|
};
|
|
@@ -943,8 +716,7 @@ var require_request_cookies = __commonJS({
|
|
|
943
716
|
function areCookiesMutableInCurrentPhase(requestStore) {
|
|
944
717
|
return requestStore.phase === "action";
|
|
945
718
|
}
|
|
946
|
-
function ensureCookiesAreStillMutable(
|
|
947
|
-
const requestStore = (0, _workunitasyncstorageexternal.getExpectedRequestStore)(callingExpression);
|
|
719
|
+
function ensureCookiesAreStillMutable(requestStore, _callingExpression) {
|
|
948
720
|
if (!areCookiesMutableInCurrentPhase(requestStore)) {
|
|
949
721
|
throw new ReadonlyRequestCookiesError();
|
|
950
722
|
}
|
|
@@ -954,7 +726,333 @@ var require_request_cookies = __commonJS({
|
|
|
954
726
|
for (const cookie of responseCookies.getAll()) {
|
|
955
727
|
requestCookies.set(cookie);
|
|
956
728
|
}
|
|
957
|
-
return requestCookies;
|
|
729
|
+
return requestCookies;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
// ../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js
|
|
735
|
+
var require_work_unit_async_storage_instance = __commonJS({
|
|
736
|
+
"../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js"(exports) {
|
|
737
|
+
Object.defineProperty(exports, "__esModule", {
|
|
738
|
+
value: true
|
|
739
|
+
});
|
|
740
|
+
Object.defineProperty(exports, "workUnitAsyncStorageInstance", {
|
|
741
|
+
enumerable: true,
|
|
742
|
+
get: function() {
|
|
743
|
+
return workUnitAsyncStorageInstance;
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
var _asynclocalstorage = require_async_local_storage();
|
|
747
|
+
var workUnitAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
// ../../node_modules/next/dist/client/components/app-router-headers.js
|
|
752
|
+
var require_app_router_headers = __commonJS({
|
|
753
|
+
"../../node_modules/next/dist/client/components/app-router-headers.js"(exports, module) {
|
|
754
|
+
Object.defineProperty(exports, "__esModule", {
|
|
755
|
+
value: true
|
|
756
|
+
});
|
|
757
|
+
function _export(target, all) {
|
|
758
|
+
for (var name in all)
|
|
759
|
+
Object.defineProperty(target, name, {
|
|
760
|
+
enumerable: true,
|
|
761
|
+
get: all[name]
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
_export(exports, {
|
|
765
|
+
ACTION_HEADER: function() {
|
|
766
|
+
return ACTION_HEADER;
|
|
767
|
+
},
|
|
768
|
+
FLIGHT_HEADERS: function() {
|
|
769
|
+
return FLIGHT_HEADERS;
|
|
770
|
+
},
|
|
771
|
+
NEXT_ACTION_NOT_FOUND_HEADER: function() {
|
|
772
|
+
return NEXT_ACTION_NOT_FOUND_HEADER;
|
|
773
|
+
},
|
|
774
|
+
NEXT_DID_POSTPONE_HEADER: function() {
|
|
775
|
+
return NEXT_DID_POSTPONE_HEADER;
|
|
776
|
+
},
|
|
777
|
+
NEXT_HMR_REFRESH_HASH_COOKIE: function() {
|
|
778
|
+
return NEXT_HMR_REFRESH_HASH_COOKIE;
|
|
779
|
+
},
|
|
780
|
+
NEXT_HMR_REFRESH_HEADER: function() {
|
|
781
|
+
return NEXT_HMR_REFRESH_HEADER;
|
|
782
|
+
},
|
|
783
|
+
NEXT_IS_PRERENDER_HEADER: function() {
|
|
784
|
+
return NEXT_IS_PRERENDER_HEADER;
|
|
785
|
+
},
|
|
786
|
+
NEXT_REWRITTEN_PATH_HEADER: function() {
|
|
787
|
+
return NEXT_REWRITTEN_PATH_HEADER;
|
|
788
|
+
},
|
|
789
|
+
NEXT_REWRITTEN_QUERY_HEADER: function() {
|
|
790
|
+
return NEXT_REWRITTEN_QUERY_HEADER;
|
|
791
|
+
},
|
|
792
|
+
NEXT_ROUTER_PREFETCH_HEADER: function() {
|
|
793
|
+
return NEXT_ROUTER_PREFETCH_HEADER;
|
|
794
|
+
},
|
|
795
|
+
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER: function() {
|
|
796
|
+
return NEXT_ROUTER_SEGMENT_PREFETCH_HEADER;
|
|
797
|
+
},
|
|
798
|
+
NEXT_ROUTER_STALE_TIME_HEADER: function() {
|
|
799
|
+
return NEXT_ROUTER_STALE_TIME_HEADER;
|
|
800
|
+
},
|
|
801
|
+
NEXT_ROUTER_STATE_TREE_HEADER: function() {
|
|
802
|
+
return NEXT_ROUTER_STATE_TREE_HEADER;
|
|
803
|
+
},
|
|
804
|
+
NEXT_RSC_UNION_QUERY: function() {
|
|
805
|
+
return NEXT_RSC_UNION_QUERY;
|
|
806
|
+
},
|
|
807
|
+
NEXT_URL: function() {
|
|
808
|
+
return NEXT_URL;
|
|
809
|
+
},
|
|
810
|
+
RSC_CONTENT_TYPE_HEADER: function() {
|
|
811
|
+
return RSC_CONTENT_TYPE_HEADER;
|
|
812
|
+
},
|
|
813
|
+
RSC_HEADER: function() {
|
|
814
|
+
return RSC_HEADER;
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
var RSC_HEADER = "rsc";
|
|
818
|
+
var ACTION_HEADER = "next-action";
|
|
819
|
+
var NEXT_ROUTER_STATE_TREE_HEADER = "next-router-state-tree";
|
|
820
|
+
var NEXT_ROUTER_PREFETCH_HEADER = "next-router-prefetch";
|
|
821
|
+
var NEXT_ROUTER_SEGMENT_PREFETCH_HEADER = "next-router-segment-prefetch";
|
|
822
|
+
var NEXT_HMR_REFRESH_HEADER = "next-hmr-refresh";
|
|
823
|
+
var NEXT_HMR_REFRESH_HASH_COOKIE = "__next_hmr_refresh_hash__";
|
|
824
|
+
var NEXT_URL = "next-url";
|
|
825
|
+
var RSC_CONTENT_TYPE_HEADER = "text/x-component";
|
|
826
|
+
var FLIGHT_HEADERS = [
|
|
827
|
+
RSC_HEADER,
|
|
828
|
+
NEXT_ROUTER_STATE_TREE_HEADER,
|
|
829
|
+
NEXT_ROUTER_PREFETCH_HEADER,
|
|
830
|
+
NEXT_HMR_REFRESH_HEADER,
|
|
831
|
+
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER
|
|
832
|
+
];
|
|
833
|
+
var NEXT_RSC_UNION_QUERY = "_rsc";
|
|
834
|
+
var NEXT_ROUTER_STALE_TIME_HEADER = "x-nextjs-stale-time";
|
|
835
|
+
var NEXT_DID_POSTPONE_HEADER = "x-nextjs-postponed";
|
|
836
|
+
var NEXT_REWRITTEN_PATH_HEADER = "x-nextjs-rewritten-path";
|
|
837
|
+
var NEXT_REWRITTEN_QUERY_HEADER = "x-nextjs-rewritten-query";
|
|
838
|
+
var NEXT_IS_PRERENDER_HEADER = "x-nextjs-prerender";
|
|
839
|
+
var NEXT_ACTION_NOT_FOUND_HEADER = "x-nextjs-action-not-found";
|
|
840
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
841
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
842
|
+
Object.assign(exports.default, exports);
|
|
843
|
+
module.exports = exports.default;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
|
|
848
|
+
// ../../node_modules/next/dist/shared/lib/invariant-error.js
|
|
849
|
+
var require_invariant_error = __commonJS({
|
|
850
|
+
"../../node_modules/next/dist/shared/lib/invariant-error.js"(exports) {
|
|
851
|
+
Object.defineProperty(exports, "__esModule", {
|
|
852
|
+
value: true
|
|
853
|
+
});
|
|
854
|
+
Object.defineProperty(exports, "InvariantError", {
|
|
855
|
+
enumerable: true,
|
|
856
|
+
get: function() {
|
|
857
|
+
return InvariantError;
|
|
858
|
+
}
|
|
859
|
+
});
|
|
860
|
+
var InvariantError = class extends Error {
|
|
861
|
+
constructor(message, options) {
|
|
862
|
+
super("Invariant: " + (message.endsWith(".") ? message : message + ".") + " This is a bug in Next.js.", options);
|
|
863
|
+
this.name = "InvariantError";
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
|
|
869
|
+
// ../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js
|
|
870
|
+
var require_work_unit_async_storage_external = __commonJS({
|
|
871
|
+
"../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js"(exports) {
|
|
872
|
+
Object.defineProperty(exports, "__esModule", {
|
|
873
|
+
value: true
|
|
874
|
+
});
|
|
875
|
+
function _export(target, all) {
|
|
876
|
+
for (var name in all)
|
|
877
|
+
Object.defineProperty(target, name, {
|
|
878
|
+
enumerable: true,
|
|
879
|
+
get: all[name]
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
_export(exports, {
|
|
883
|
+
getCacheSignal: function() {
|
|
884
|
+
return getCacheSignal;
|
|
885
|
+
},
|
|
886
|
+
getDraftModeProviderForCacheScope: function() {
|
|
887
|
+
return getDraftModeProviderForCacheScope;
|
|
888
|
+
},
|
|
889
|
+
getHmrRefreshHash: function() {
|
|
890
|
+
return getHmrRefreshHash;
|
|
891
|
+
},
|
|
892
|
+
getPrerenderResumeDataCache: function() {
|
|
893
|
+
return getPrerenderResumeDataCache;
|
|
894
|
+
},
|
|
895
|
+
getRenderResumeDataCache: function() {
|
|
896
|
+
return getRenderResumeDataCache;
|
|
897
|
+
},
|
|
898
|
+
getRuntimeStagePromise: function() {
|
|
899
|
+
return getRuntimeStagePromise;
|
|
900
|
+
},
|
|
901
|
+
getServerComponentsHmrCache: function() {
|
|
902
|
+
return getServerComponentsHmrCache;
|
|
903
|
+
},
|
|
904
|
+
isHmrRefresh: function() {
|
|
905
|
+
return isHmrRefresh;
|
|
906
|
+
},
|
|
907
|
+
throwForMissingRequestStore: function() {
|
|
908
|
+
return throwForMissingRequestStore;
|
|
909
|
+
},
|
|
910
|
+
throwInvariantForMissingStore: function() {
|
|
911
|
+
return throwInvariantForMissingStore;
|
|
912
|
+
},
|
|
913
|
+
workUnitAsyncStorage: function() {
|
|
914
|
+
return _workunitasyncstorageinstance.workUnitAsyncStorageInstance;
|
|
915
|
+
}
|
|
916
|
+
});
|
|
917
|
+
var _workunitasyncstorageinstance = require_work_unit_async_storage_instance();
|
|
918
|
+
var _approuterheaders = require_app_router_headers();
|
|
919
|
+
var _invarianterror = require_invariant_error();
|
|
920
|
+
function throwForMissingRequestStore(callingExpression) {
|
|
921
|
+
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", {
|
|
922
|
+
value: "E251",
|
|
923
|
+
enumerable: false,
|
|
924
|
+
configurable: true
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
function throwInvariantForMissingStore() {
|
|
928
|
+
throw Object.defineProperty(new _invarianterror.InvariantError("Expected workUnitAsyncStorage to have a store."), "__NEXT_ERROR_CODE", {
|
|
929
|
+
value: "E696",
|
|
930
|
+
enumerable: false,
|
|
931
|
+
configurable: true
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
function getPrerenderResumeDataCache(workUnitStore) {
|
|
935
|
+
switch (workUnitStore.type) {
|
|
936
|
+
case "prerender":
|
|
937
|
+
case "prerender-runtime":
|
|
938
|
+
case "prerender-ppr":
|
|
939
|
+
return workUnitStore.prerenderResumeDataCache;
|
|
940
|
+
case "prerender-client":
|
|
941
|
+
return workUnitStore.prerenderResumeDataCache;
|
|
942
|
+
case "prerender-legacy":
|
|
943
|
+
case "request":
|
|
944
|
+
case "cache":
|
|
945
|
+
case "private-cache":
|
|
946
|
+
case "unstable-cache":
|
|
947
|
+
return null;
|
|
948
|
+
default:
|
|
949
|
+
return workUnitStore;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
function getRenderResumeDataCache(workUnitStore) {
|
|
953
|
+
switch (workUnitStore.type) {
|
|
954
|
+
case "request":
|
|
955
|
+
return workUnitStore.renderResumeDataCache;
|
|
956
|
+
case "prerender":
|
|
957
|
+
case "prerender-runtime":
|
|
958
|
+
case "prerender-client":
|
|
959
|
+
if (workUnitStore.renderResumeDataCache) {
|
|
960
|
+
return workUnitStore.renderResumeDataCache;
|
|
961
|
+
}
|
|
962
|
+
case "prerender-ppr":
|
|
963
|
+
return workUnitStore.prerenderResumeDataCache;
|
|
964
|
+
case "cache":
|
|
965
|
+
case "private-cache":
|
|
966
|
+
case "unstable-cache":
|
|
967
|
+
case "prerender-legacy":
|
|
968
|
+
return null;
|
|
969
|
+
default:
|
|
970
|
+
return workUnitStore;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
function getHmrRefreshHash(workStore, workUnitStore) {
|
|
974
|
+
if (workStore.dev) {
|
|
975
|
+
switch (workUnitStore.type) {
|
|
976
|
+
case "cache":
|
|
977
|
+
case "private-cache":
|
|
978
|
+
case "prerender":
|
|
979
|
+
case "prerender-runtime":
|
|
980
|
+
return workUnitStore.hmrRefreshHash;
|
|
981
|
+
case "request":
|
|
982
|
+
var _workUnitStore_cookies_get;
|
|
983
|
+
return (_workUnitStore_cookies_get = workUnitStore.cookies.get(_approuterheaders.NEXT_HMR_REFRESH_HASH_COOKIE)) == null ? void 0 : _workUnitStore_cookies_get.value;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
return void 0;
|
|
987
|
+
}
|
|
988
|
+
function isHmrRefresh(workStore, workUnitStore) {
|
|
989
|
+
if (workStore.dev) {
|
|
990
|
+
switch (workUnitStore.type) {
|
|
991
|
+
case "cache":
|
|
992
|
+
case "private-cache":
|
|
993
|
+
case "request":
|
|
994
|
+
return workUnitStore.isHmrRefresh ?? false;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
return false;
|
|
998
|
+
}
|
|
999
|
+
function getServerComponentsHmrCache(workStore, workUnitStore) {
|
|
1000
|
+
if (workStore.dev) {
|
|
1001
|
+
switch (workUnitStore.type) {
|
|
1002
|
+
case "cache":
|
|
1003
|
+
case "private-cache":
|
|
1004
|
+
case "request":
|
|
1005
|
+
return workUnitStore.serverComponentsHmrCache;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
return void 0;
|
|
1009
|
+
}
|
|
1010
|
+
function getDraftModeProviderForCacheScope(workStore, workUnitStore) {
|
|
1011
|
+
if (workStore.isDraftMode) {
|
|
1012
|
+
switch (workUnitStore.type) {
|
|
1013
|
+
case "cache":
|
|
1014
|
+
case "private-cache":
|
|
1015
|
+
case "unstable-cache":
|
|
1016
|
+
case "prerender-runtime":
|
|
1017
|
+
case "request":
|
|
1018
|
+
return workUnitStore.draftMode;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
return void 0;
|
|
1022
|
+
}
|
|
1023
|
+
function getCacheSignal(workUnitStore) {
|
|
1024
|
+
switch (workUnitStore.type) {
|
|
1025
|
+
case "prerender":
|
|
1026
|
+
case "prerender-client":
|
|
1027
|
+
case "prerender-runtime":
|
|
1028
|
+
return workUnitStore.cacheSignal;
|
|
1029
|
+
case "prerender-ppr":
|
|
1030
|
+
case "prerender-legacy":
|
|
1031
|
+
case "request":
|
|
1032
|
+
case "cache":
|
|
1033
|
+
case "private-cache":
|
|
1034
|
+
case "unstable-cache":
|
|
1035
|
+
return null;
|
|
1036
|
+
default:
|
|
1037
|
+
return workUnitStore;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
function getRuntimeStagePromise(workUnitStore) {
|
|
1041
|
+
switch (workUnitStore.type) {
|
|
1042
|
+
case "prerender-runtime":
|
|
1043
|
+
case "private-cache":
|
|
1044
|
+
return workUnitStore.runtimeStagePromise;
|
|
1045
|
+
case "prerender":
|
|
1046
|
+
case "prerender-client":
|
|
1047
|
+
case "prerender-ppr":
|
|
1048
|
+
case "prerender-legacy":
|
|
1049
|
+
case "request":
|
|
1050
|
+
case "cache":
|
|
1051
|
+
case "unstable-cache":
|
|
1052
|
+
return null;
|
|
1053
|
+
default:
|
|
1054
|
+
return workUnitStore;
|
|
1055
|
+
}
|
|
958
1056
|
}
|
|
959
1057
|
}
|
|
960
1058
|
});
|
|
@@ -1058,6 +1156,9 @@ var require_dynamic_rendering_utils = __commonJS({
|
|
|
1058
1156
|
isHangingPromiseRejectionError: function() {
|
|
1059
1157
|
return isHangingPromiseRejectionError;
|
|
1060
1158
|
},
|
|
1159
|
+
makeDevtoolsIOAwarePromise: function() {
|
|
1160
|
+
return makeDevtoolsIOAwarePromise;
|
|
1161
|
+
},
|
|
1061
1162
|
makeHangingPromise: function() {
|
|
1062
1163
|
return makeHangingPromise;
|
|
1063
1164
|
}
|
|
@@ -1070,17 +1171,17 @@ var require_dynamic_rendering_utils = __commonJS({
|
|
|
1070
1171
|
}
|
|
1071
1172
|
var HANGING_PROMISE_REJECTION = "HANGING_PROMISE_REJECTION";
|
|
1072
1173
|
var HangingPromiseRejectionError = class extends Error {
|
|
1073
|
-
constructor(expression) {
|
|
1074
|
-
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;
|
|
1174
|
+
constructor(route, expression) {
|
|
1175
|
+
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 occurred at route "${route}".`), this.route = route, this.expression = expression, this.digest = HANGING_PROMISE_REJECTION;
|
|
1075
1176
|
}
|
|
1076
1177
|
};
|
|
1077
1178
|
var abortListenersBySignal = /* @__PURE__ */ new WeakMap();
|
|
1078
|
-
function makeHangingPromise(signal, expression) {
|
|
1179
|
+
function makeHangingPromise(signal, route, expression) {
|
|
1079
1180
|
if (signal.aborted) {
|
|
1080
|
-
return Promise.reject(new HangingPromiseRejectionError(expression));
|
|
1181
|
+
return Promise.reject(new HangingPromiseRejectionError(route, expression));
|
|
1081
1182
|
} else {
|
|
1082
1183
|
const hangingPromise = new Promise((_, reject) => {
|
|
1083
|
-
const boundRejection = reject.bind(null, new HangingPromiseRejectionError(expression));
|
|
1184
|
+
const boundRejection = reject.bind(null, new HangingPromiseRejectionError(route, expression));
|
|
1084
1185
|
let currentListeners = abortListenersBySignal.get(signal);
|
|
1085
1186
|
if (currentListeners) {
|
|
1086
1187
|
currentListeners.push(boundRejection);
|
|
@@ -1104,12 +1205,19 @@ var require_dynamic_rendering_utils = __commonJS({
|
|
|
1104
1205
|
}
|
|
1105
1206
|
function ignoreReject() {
|
|
1106
1207
|
}
|
|
1208
|
+
function makeDevtoolsIOAwarePromise(underlying) {
|
|
1209
|
+
return new Promise((resolve) => {
|
|
1210
|
+
setTimeout(() => {
|
|
1211
|
+
resolve(underlying);
|
|
1212
|
+
}, 0);
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1107
1215
|
}
|
|
1108
1216
|
});
|
|
1109
1217
|
|
|
1110
|
-
// ../../node_modules/next/dist/lib/
|
|
1111
|
-
var
|
|
1112
|
-
"../../node_modules/next/dist/lib/
|
|
1218
|
+
// ../../node_modules/next/dist/lib/framework/boundary-constants.js
|
|
1219
|
+
var require_boundary_constants = __commonJS({
|
|
1220
|
+
"../../node_modules/next/dist/lib/framework/boundary-constants.js"(exports) {
|
|
1113
1221
|
Object.defineProperty(exports, "__esModule", {
|
|
1114
1222
|
value: true
|
|
1115
1223
|
});
|
|
@@ -1127,6 +1235,9 @@ var require_metadata_constants = __commonJS({
|
|
|
1127
1235
|
OUTLET_BOUNDARY_NAME: function() {
|
|
1128
1236
|
return OUTLET_BOUNDARY_NAME;
|
|
1129
1237
|
},
|
|
1238
|
+
ROOT_LAYOUT_BOUNDARY_NAME: function() {
|
|
1239
|
+
return ROOT_LAYOUT_BOUNDARY_NAME;
|
|
1240
|
+
},
|
|
1130
1241
|
VIEWPORT_BOUNDARY_NAME: function() {
|
|
1131
1242
|
return VIEWPORT_BOUNDARY_NAME;
|
|
1132
1243
|
}
|
|
@@ -1134,6 +1245,7 @@ var require_metadata_constants = __commonJS({
|
|
|
1134
1245
|
var METADATA_BOUNDARY_NAME = "__next_metadata_boundary__";
|
|
1135
1246
|
var VIEWPORT_BOUNDARY_NAME = "__next_viewport_boundary__";
|
|
1136
1247
|
var OUTLET_BOUNDARY_NAME = "__next_outlet_boundary__";
|
|
1248
|
+
var ROOT_LAYOUT_BOUNDARY_NAME = "__next_root_layout_boundary__";
|
|
1137
1249
|
}
|
|
1138
1250
|
});
|
|
1139
1251
|
|
|
@@ -1193,6 +1305,42 @@ var require_scheduler = __commonJS({
|
|
|
1193
1305
|
}
|
|
1194
1306
|
});
|
|
1195
1307
|
|
|
1308
|
+
// ../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js
|
|
1309
|
+
var require_bailout_to_csr = __commonJS({
|
|
1310
|
+
"../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js"(exports) {
|
|
1311
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1312
|
+
value: true
|
|
1313
|
+
});
|
|
1314
|
+
function _export(target, all) {
|
|
1315
|
+
for (var name in all)
|
|
1316
|
+
Object.defineProperty(target, name, {
|
|
1317
|
+
enumerable: true,
|
|
1318
|
+
get: all[name]
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
_export(exports, {
|
|
1322
|
+
BailoutToCSRError: function() {
|
|
1323
|
+
return BailoutToCSRError;
|
|
1324
|
+
},
|
|
1325
|
+
isBailoutToCSRError: function() {
|
|
1326
|
+
return isBailoutToCSRError;
|
|
1327
|
+
}
|
|
1328
|
+
});
|
|
1329
|
+
var BAILOUT_TO_CSR = "BAILOUT_TO_CLIENT_SIDE_RENDERING";
|
|
1330
|
+
var BailoutToCSRError = class extends Error {
|
|
1331
|
+
constructor(reason) {
|
|
1332
|
+
super("Bail out to client-side rendering: " + reason), this.reason = reason, this.digest = BAILOUT_TO_CSR;
|
|
1333
|
+
}
|
|
1334
|
+
};
|
|
1335
|
+
function isBailoutToCSRError(err) {
|
|
1336
|
+
if (typeof err !== "object" || err === null || !("digest" in err)) {
|
|
1337
|
+
return false;
|
|
1338
|
+
}
|
|
1339
|
+
return err.digest === BAILOUT_TO_CSR;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1343
|
+
|
|
1196
1344
|
// ../../node_modules/next/dist/server/app-render/dynamic-rendering.js
|
|
1197
1345
|
var require_dynamic_rendering = __commonJS({
|
|
1198
1346
|
"../../node_modules/next/dist/server/app-render/dynamic-rendering.js"(exports) {
|
|
@@ -1210,6 +1358,9 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1210
1358
|
Postpone: function() {
|
|
1211
1359
|
return Postpone;
|
|
1212
1360
|
},
|
|
1361
|
+
PreludeState: function() {
|
|
1362
|
+
return PreludeState;
|
|
1363
|
+
},
|
|
1213
1364
|
abortAndThrowOnSynchronousRequestDataAccess: function() {
|
|
1214
1365
|
return abortAndThrowOnSynchronousRequestDataAccess;
|
|
1215
1366
|
},
|
|
@@ -1234,8 +1385,11 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1234
1385
|
createHangingInputAbortSignal: function() {
|
|
1235
1386
|
return createHangingInputAbortSignal;
|
|
1236
1387
|
},
|
|
1237
|
-
|
|
1238
|
-
return
|
|
1388
|
+
createRenderInBrowserAbortSignal: function() {
|
|
1389
|
+
return createRenderInBrowserAbortSignal;
|
|
1390
|
+
},
|
|
1391
|
+
delayUntilRuntimeStage: function() {
|
|
1392
|
+
return delayUntilRuntimeStage;
|
|
1239
1393
|
},
|
|
1240
1394
|
formatDynamicAPIAccesses: function() {
|
|
1241
1395
|
return formatDynamicAPIAccesses;
|
|
@@ -1249,6 +1403,9 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1249
1403
|
isPrerenderInterruptedError: function() {
|
|
1250
1404
|
return isPrerenderInterruptedError;
|
|
1251
1405
|
},
|
|
1406
|
+
logDisallowedDynamicError: function() {
|
|
1407
|
+
return logDisallowedDynamicError;
|
|
1408
|
+
},
|
|
1252
1409
|
markCurrentScopeAsDynamic: function() {
|
|
1253
1410
|
return markCurrentScopeAsDynamic;
|
|
1254
1411
|
},
|
|
@@ -1267,9 +1424,6 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1267
1424
|
trackDynamicDataInDynamicRender: function() {
|
|
1268
1425
|
return trackDynamicDataInDynamicRender;
|
|
1269
1426
|
},
|
|
1270
|
-
trackFallbackParamAccessed: function() {
|
|
1271
|
-
return trackFallbackParamAccessed;
|
|
1272
|
-
},
|
|
1273
1427
|
trackSynchronousPlatformIOAccessInDev: function() {
|
|
1274
1428
|
return trackSynchronousPlatformIOAccessInDev;
|
|
1275
1429
|
},
|
|
@@ -1278,6 +1432,9 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1278
1432
|
},
|
|
1279
1433
|
useDynamicRouteParams: function() {
|
|
1280
1434
|
return useDynamicRouteParams;
|
|
1435
|
+
},
|
|
1436
|
+
warnOnSyncDynamicError: function() {
|
|
1437
|
+
return warnOnSyncDynamicError;
|
|
1281
1438
|
}
|
|
1282
1439
|
});
|
|
1283
1440
|
var _react = /* @__PURE__ */ _interop_require_default(__require("react"));
|
|
@@ -1286,8 +1443,10 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1286
1443
|
var _workunitasyncstorageexternal = require_work_unit_async_storage_external();
|
|
1287
1444
|
var _workasyncstorageexternal = require_work_async_storage_external();
|
|
1288
1445
|
var _dynamicrenderingutils = require_dynamic_rendering_utils();
|
|
1289
|
-
var
|
|
1446
|
+
var _boundaryconstants = require_boundary_constants();
|
|
1290
1447
|
var _scheduler = require_scheduler();
|
|
1448
|
+
var _bailouttocsr = require_bailout_to_csr();
|
|
1449
|
+
var _invarianterror = require_invariant_error();
|
|
1291
1450
|
function _interop_require_default(obj) {
|
|
1292
1451
|
return obj && obj.__esModule ? obj : {
|
|
1293
1452
|
default: obj
|
|
@@ -1298,16 +1457,15 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1298
1457
|
return {
|
|
1299
1458
|
isDebugDynamicAccesses,
|
|
1300
1459
|
dynamicAccesses: [],
|
|
1301
|
-
syncDynamicExpression: void 0,
|
|
1302
1460
|
syncDynamicErrorWithStack: null
|
|
1303
1461
|
};
|
|
1304
1462
|
}
|
|
1305
1463
|
function createDynamicValidationState() {
|
|
1306
1464
|
return {
|
|
1307
|
-
|
|
1465
|
+
hasSuspenseAboveBody: false,
|
|
1308
1466
|
hasDynamicMetadata: false,
|
|
1309
1467
|
hasDynamicViewport: false,
|
|
1310
|
-
|
|
1468
|
+
hasAllowedDynamic: false,
|
|
1311
1469
|
dynamicErrors: []
|
|
1312
1470
|
};
|
|
1313
1471
|
}
|
|
@@ -1317,8 +1475,12 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1317
1475
|
}
|
|
1318
1476
|
function markCurrentScopeAsDynamic(store, workUnitStore, expression) {
|
|
1319
1477
|
if (workUnitStore) {
|
|
1320
|
-
|
|
1321
|
-
|
|
1478
|
+
switch (workUnitStore.type) {
|
|
1479
|
+
case "cache":
|
|
1480
|
+
case "unstable-cache":
|
|
1481
|
+
return;
|
|
1482
|
+
case "private-cache":
|
|
1483
|
+
return;
|
|
1322
1484
|
}
|
|
1323
1485
|
}
|
|
1324
1486
|
if (store.forceDynamic || store.forceStatic)
|
|
@@ -1331,29 +1493,27 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1331
1493
|
});
|
|
1332
1494
|
}
|
|
1333
1495
|
if (workUnitStore) {
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1496
|
+
switch (workUnitStore.type) {
|
|
1497
|
+
case "prerender-ppr":
|
|
1498
|
+
return postponeWithTracking(store.route, expression, workUnitStore.dynamicTracking);
|
|
1499
|
+
case "prerender-legacy":
|
|
1500
|
+
workUnitStore.revalidate = 0;
|
|
1501
|
+
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", {
|
|
1502
|
+
value: "E550",
|
|
1503
|
+
enumerable: false,
|
|
1504
|
+
configurable: true
|
|
1505
|
+
});
|
|
1506
|
+
store.dynamicUsageDescription = expression;
|
|
1507
|
+
store.dynamicUsageStack = err.stack;
|
|
1508
|
+
throw err;
|
|
1509
|
+
case "request":
|
|
1510
|
+
{
|
|
1511
|
+
workUnitStore.usedDynamic = true;
|
|
1512
|
+
}
|
|
1513
|
+
break;
|
|
1348
1514
|
}
|
|
1349
1515
|
}
|
|
1350
1516
|
}
|
|
1351
|
-
function trackFallbackParamAccessed(store, expression) {
|
|
1352
|
-
const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
1353
|
-
if (!prerenderStore || prerenderStore.type !== "prerender-ppr")
|
|
1354
|
-
return;
|
|
1355
|
-
postponeWithTracking(store.route, expression, prerenderStore.dynamicTracking);
|
|
1356
|
-
}
|
|
1357
1517
|
function throwToInterruptStaticGeneration(expression, store, prerenderStore) {
|
|
1358
1518
|
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", {
|
|
1359
1519
|
value: "E558",
|
|
@@ -1365,17 +1525,24 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1365
1525
|
store.dynamicUsageStack = err.stack;
|
|
1366
1526
|
throw err;
|
|
1367
1527
|
}
|
|
1368
|
-
function trackDynamicDataInDynamicRender(
|
|
1369
|
-
|
|
1370
|
-
|
|
1528
|
+
function trackDynamicDataInDynamicRender(workUnitStore) {
|
|
1529
|
+
switch (workUnitStore.type) {
|
|
1530
|
+
case "cache":
|
|
1531
|
+
case "unstable-cache":
|
|
1371
1532
|
return;
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1533
|
+
case "private-cache":
|
|
1534
|
+
return;
|
|
1535
|
+
case "prerender":
|
|
1536
|
+
case "prerender-runtime":
|
|
1537
|
+
case "prerender-legacy":
|
|
1538
|
+
case "prerender-ppr":
|
|
1539
|
+
case "prerender-client":
|
|
1540
|
+
break;
|
|
1541
|
+
case "request":
|
|
1542
|
+
{
|
|
1543
|
+
workUnitStore.usedDynamic = true;
|
|
1544
|
+
}
|
|
1545
|
+
break;
|
|
1379
1546
|
}
|
|
1380
1547
|
}
|
|
1381
1548
|
function abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore) {
|
|
@@ -1394,13 +1561,12 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1394
1561
|
}
|
|
1395
1562
|
function abortOnSynchronousPlatformIOAccess(route, expression, errorWithStack, prerenderStore) {
|
|
1396
1563
|
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
1564
|
+
abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);
|
|
1397
1565
|
if (dynamicTracking) {
|
|
1398
1566
|
if (dynamicTracking.syncDynamicErrorWithStack === null) {
|
|
1399
|
-
dynamicTracking.syncDynamicExpression = expression;
|
|
1400
1567
|
dynamicTracking.syncDynamicErrorWithStack = errorWithStack;
|
|
1401
1568
|
}
|
|
1402
1569
|
}
|
|
1403
|
-
abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);
|
|
1404
1570
|
}
|
|
1405
1571
|
function trackSynchronousPlatformIOAccessInDev(requestStore) {
|
|
1406
1572
|
requestStore.prerenderPhase = false;
|
|
@@ -1408,20 +1574,21 @@ var require_dynamic_rendering = __commonJS({
|
|
|
1408
1574
|
function abortAndThrowOnSynchronousRequestDataAccess(route, expression, errorWithStack, prerenderStore) {
|
|
1409
1575
|
const prerenderSignal = prerenderStore.controller.signal;
|
|
1410
1576
|
if (prerenderSignal.aborted === false) {
|
|
1577
|
+
abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);
|
|
1411
1578
|
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
1412
1579
|
if (dynamicTracking) {
|
|
1413
1580
|
if (dynamicTracking.syncDynamicErrorWithStack === null) {
|
|
1414
|
-
dynamicTracking.syncDynamicExpression = expression;
|
|
1415
1581
|
dynamicTracking.syncDynamicErrorWithStack = errorWithStack;
|
|
1416
|
-
if (prerenderStore.validating === true) {
|
|
1417
|
-
dynamicTracking.syncDynamicLogged = true;
|
|
1418
|
-
}
|
|
1419
1582
|
}
|
|
1420
1583
|
}
|
|
1421
|
-
abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);
|
|
1422
1584
|
}
|
|
1423
1585
|
throw createPrerenderInterruptedError(`Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`);
|
|
1424
1586
|
}
|
|
1587
|
+
function warnOnSyncDynamicError(dynamicTracking) {
|
|
1588
|
+
if (dynamicTracking.syncDynamicErrorWithStack) {
|
|
1589
|
+
console.error(dynamicTracking.syncDynamicErrorWithStack);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1425
1592
|
var trackSynchronousRequestDataAccessInDev = trackSynchronousPlatformIOAccessInDev;
|
|
1426
1593
|
function Postpone({ reason, route }) {
|
|
1427
1594
|
const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
@@ -1506,26 +1673,42 @@ ${stack}`;
|
|
|
1506
1673
|
});
|
|
1507
1674
|
}
|
|
1508
1675
|
}
|
|
1509
|
-
function
|
|
1510
|
-
assertPostpone();
|
|
1676
|
+
function createRenderInBrowserAbortSignal() {
|
|
1511
1677
|
const controller = new AbortController();
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
}
|
|
1678
|
+
controller.abort(Object.defineProperty(new _bailouttocsr.BailoutToCSRError("Render in Browser"), "__NEXT_ERROR_CODE", {
|
|
1679
|
+
value: "E721",
|
|
1680
|
+
enumerable: false,
|
|
1681
|
+
configurable: true
|
|
1682
|
+
}));
|
|
1517
1683
|
return controller.signal;
|
|
1518
1684
|
}
|
|
1519
1685
|
function createHangingInputAbortSignal(workUnitStore) {
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
controller
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1686
|
+
switch (workUnitStore.type) {
|
|
1687
|
+
case "prerender":
|
|
1688
|
+
case "prerender-runtime":
|
|
1689
|
+
const controller = new AbortController();
|
|
1690
|
+
if (workUnitStore.cacheSignal) {
|
|
1691
|
+
workUnitStore.cacheSignal.inputReady().then(() => {
|
|
1692
|
+
controller.abort();
|
|
1693
|
+
});
|
|
1694
|
+
} else {
|
|
1695
|
+
const runtimeStagePromise = (0, _workunitasyncstorageexternal.getRuntimeStagePromise)(workUnitStore);
|
|
1696
|
+
if (runtimeStagePromise) {
|
|
1697
|
+
runtimeStagePromise.then(() => (0, _scheduler.scheduleOnNextTick)(() => controller.abort()));
|
|
1698
|
+
} else {
|
|
1699
|
+
(0, _scheduler.scheduleOnNextTick)(() => controller.abort());
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
return controller.signal;
|
|
1703
|
+
case "prerender-client":
|
|
1704
|
+
case "prerender-ppr":
|
|
1705
|
+
case "prerender-legacy":
|
|
1706
|
+
case "request":
|
|
1707
|
+
case "cache":
|
|
1708
|
+
case "private-cache":
|
|
1709
|
+
case "unstable-cache":
|
|
1710
|
+
return void 0;
|
|
1527
1711
|
}
|
|
1528
|
-
return controller.signal;
|
|
1529
1712
|
}
|
|
1530
1713
|
function annotateDynamicAccess(expression, prerenderStore) {
|
|
1531
1714
|
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
@@ -1538,24 +1721,47 @@ ${stack}`;
|
|
|
1538
1721
|
}
|
|
1539
1722
|
function useDynamicRouteParams(expression) {
|
|
1540
1723
|
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1724
|
+
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
1725
|
+
if (workStore && workUnitStore) {
|
|
1726
|
+
switch (workUnitStore.type) {
|
|
1727
|
+
case "prerender-client":
|
|
1728
|
+
case "prerender": {
|
|
1729
|
+
const fallbackParams = workUnitStore.fallbackRouteParams;
|
|
1730
|
+
if (fallbackParams && fallbackParams.size > 0) {
|
|
1731
|
+
_react.default.use((0, _dynamicrenderingutils.makeHangingPromise)(workUnitStore.renderSignal, workStore.route, expression));
|
|
1732
|
+
}
|
|
1733
|
+
break;
|
|
1734
|
+
}
|
|
1735
|
+
case "prerender-ppr": {
|
|
1736
|
+
const fallbackParams = workUnitStore.fallbackRouteParams;
|
|
1737
|
+
if (fallbackParams && fallbackParams.size > 0) {
|
|
1738
|
+
return postponeWithTracking(workStore.route, expression, workUnitStore.dynamicTracking);
|
|
1739
|
+
}
|
|
1740
|
+
break;
|
|
1550
1741
|
}
|
|
1742
|
+
case "prerender-runtime":
|
|
1743
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`\`${expression}\` was called during a runtime prerender. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
1744
|
+
value: "E771",
|
|
1745
|
+
enumerable: false,
|
|
1746
|
+
configurable: true
|
|
1747
|
+
});
|
|
1748
|
+
case "cache":
|
|
1749
|
+
case "private-cache":
|
|
1750
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`\`${expression}\` was called inside a cache scope. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
1751
|
+
value: "E745",
|
|
1752
|
+
enumerable: false,
|
|
1753
|
+
configurable: true
|
|
1754
|
+
});
|
|
1551
1755
|
}
|
|
1552
1756
|
}
|
|
1553
1757
|
}
|
|
1554
1758
|
var hasSuspenseRegex = /\n\s+at Suspense \(<anonymous>\)/;
|
|
1555
|
-
var
|
|
1556
|
-
var
|
|
1557
|
-
var
|
|
1558
|
-
|
|
1759
|
+
var bodyAndImplicitTags = "body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6";
|
|
1760
|
+
var hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex = new RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:${bodyAndImplicitTags}) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${_boundaryconstants.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`);
|
|
1761
|
+
var hasMetadataRegex = new RegExp(`\\n\\s+at ${_boundaryconstants.METADATA_BOUNDARY_NAME}[\\n\\s]`);
|
|
1762
|
+
var hasViewportRegex = new RegExp(`\\n\\s+at ${_boundaryconstants.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`);
|
|
1763
|
+
var hasOutletRegex = new RegExp(`\\n\\s+at ${_boundaryconstants.OUTLET_BOUNDARY_NAME}[\\n\\s]`);
|
|
1764
|
+
function trackAllowedDynamicAccess(workStore, componentStack, dynamicValidation, clientDynamic) {
|
|
1559
1765
|
if (hasOutletRegex.test(componentStack)) {
|
|
1560
1766
|
return;
|
|
1561
1767
|
} else if (hasMetadataRegex.test(componentStack)) {
|
|
@@ -1564,89 +1770,87 @@ ${stack}`;
|
|
|
1564
1770
|
} else if (hasViewportRegex.test(componentStack)) {
|
|
1565
1771
|
dynamicValidation.hasDynamicViewport = true;
|
|
1566
1772
|
return;
|
|
1773
|
+
} else if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) {
|
|
1774
|
+
dynamicValidation.hasAllowedDynamic = true;
|
|
1775
|
+
dynamicValidation.hasSuspenseAboveBody = true;
|
|
1776
|
+
return;
|
|
1567
1777
|
} else if (hasSuspenseRegex.test(componentStack)) {
|
|
1568
|
-
dynamicValidation.
|
|
1778
|
+
dynamicValidation.hasAllowedDynamic = true;
|
|
1569
1779
|
return;
|
|
1570
|
-
} else if (
|
|
1571
|
-
dynamicValidation.
|
|
1780
|
+
} else if (clientDynamic.syncDynamicErrorWithStack) {
|
|
1781
|
+
dynamicValidation.dynamicErrors.push(clientDynamic.syncDynamicErrorWithStack);
|
|
1572
1782
|
return;
|
|
1573
1783
|
} else {
|
|
1574
|
-
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.
|
|
1575
|
-
const error =
|
|
1784
|
+
const message = `Route "${workStore.route}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`;
|
|
1785
|
+
const error = createErrorWithComponentOrOwnerStack(message, componentStack);
|
|
1576
1786
|
dynamicValidation.dynamicErrors.push(error);
|
|
1577
1787
|
return;
|
|
1578
1788
|
}
|
|
1579
1789
|
}
|
|
1580
|
-
function
|
|
1790
|
+
function createErrorWithComponentOrOwnerStack(message, componentStack) {
|
|
1791
|
+
const ownerStack = _react.default.captureOwnerStack ? _react.default.captureOwnerStack() : null;
|
|
1581
1792
|
const error = Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
1582
1793
|
value: "E394",
|
|
1583
1794
|
enumerable: false,
|
|
1584
1795
|
configurable: true
|
|
1585
1796
|
});
|
|
1586
|
-
error.stack = "
|
|
1797
|
+
error.stack = error.name + ": " + message + (ownerStack ?? componentStack);
|
|
1587
1798
|
return error;
|
|
1588
1799
|
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
syncLogged = false;
|
|
1605
|
-
}
|
|
1606
|
-
if (dynamicValidation.hasSyncDynamicErrors && syncError) {
|
|
1607
|
-
if (!syncLogged) {
|
|
1608
|
-
console.error(syncError);
|
|
1800
|
+
var PreludeState = /* @__PURE__ */ function(PreludeState2) {
|
|
1801
|
+
PreludeState2[PreludeState2["Full"] = 0] = "Full";
|
|
1802
|
+
PreludeState2[PreludeState2["Empty"] = 1] = "Empty";
|
|
1803
|
+
PreludeState2[PreludeState2["Errored"] = 2] = "Errored";
|
|
1804
|
+
return PreludeState2;
|
|
1805
|
+
}({});
|
|
1806
|
+
function logDisallowedDynamicError(workStore, error) {
|
|
1807
|
+
console.error(error);
|
|
1808
|
+
if (!workStore.dev) {
|
|
1809
|
+
if (workStore.hasReadableErrorStacks) {
|
|
1810
|
+
console.error(`To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "${workStore.route}" in your browser to investigate the error.`);
|
|
1811
|
+
} else {
|
|
1812
|
+
console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
|
|
1813
|
+
- Start the app in development mode by running \`next dev\`, then open "${workStore.route}" in your browser to investigate the error.
|
|
1814
|
+
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`);
|
|
1609
1815
|
}
|
|
1610
|
-
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
1611
1816
|
}
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1817
|
+
}
|
|
1818
|
+
function throwIfDisallowedDynamic(workStore, prelude, dynamicValidation, serverDynamic) {
|
|
1819
|
+
if (prelude !== 0) {
|
|
1820
|
+
if (dynamicValidation.hasSuspenseAboveBody) {
|
|
1821
|
+
return;
|
|
1616
1822
|
}
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
enumerable: false,
|
|
1626
|
-
configurable: true
|
|
1627
|
-
});
|
|
1628
|
-
}
|
|
1629
|
-
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", {
|
|
1630
|
-
value: "E534",
|
|
1631
|
-
enumerable: false,
|
|
1632
|
-
configurable: true
|
|
1633
|
-
});
|
|
1634
|
-
} else if (dynamicValidation.hasDynamicViewport) {
|
|
1635
|
-
if (syncError) {
|
|
1636
|
-
console.error(syncError);
|
|
1637
|
-
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", {
|
|
1638
|
-
value: "E573",
|
|
1639
|
-
enumerable: false,
|
|
1640
|
-
configurable: true
|
|
1641
|
-
});
|
|
1823
|
+
if (serverDynamic.syncDynamicErrorWithStack) {
|
|
1824
|
+
logDisallowedDynamicError(workStore, serverDynamic.syncDynamicErrorWithStack);
|
|
1825
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
1826
|
+
}
|
|
1827
|
+
const dynamicErrors = dynamicValidation.dynamicErrors;
|
|
1828
|
+
if (dynamicErrors.length > 0) {
|
|
1829
|
+
for (let i = 0; i < dynamicErrors.length; i++) {
|
|
1830
|
+
logDisallowedDynamicError(workStore, dynamicErrors[i]);
|
|
1642
1831
|
}
|
|
1643
|
-
throw
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1832
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
1833
|
+
}
|
|
1834
|
+
if (dynamicValidation.hasDynamicViewport) {
|
|
1835
|
+
console.error(`Route "${workStore.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`);
|
|
1836
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
1648
1837
|
}
|
|
1838
|
+
if (prelude === 1) {
|
|
1839
|
+
console.error(`Route "${workStore.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`);
|
|
1840
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
1841
|
+
}
|
|
1842
|
+
} else {
|
|
1843
|
+
if (dynamicValidation.hasAllowedDynamic === false && dynamicValidation.hasDynamicMetadata) {
|
|
1844
|
+
console.error(`Route "${workStore.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`);
|
|
1845
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
function delayUntilRuntimeStage(prerenderStore, result) {
|
|
1850
|
+
if (prerenderStore.runtimeStagePromise) {
|
|
1851
|
+
return prerenderStore.runtimeStagePromise.then(() => result);
|
|
1649
1852
|
}
|
|
1853
|
+
return result;
|
|
1650
1854
|
}
|
|
1651
1855
|
}
|
|
1652
1856
|
});
|
|
@@ -1710,7 +1914,7 @@ var require_create_deduped_by_callsite_server_error_logger = __commonJS({
|
|
|
1710
1914
|
current: null
|
|
1711
1915
|
};
|
|
1712
1916
|
var cache = typeof _react.cache === "function" ? _react.cache : (fn) => fn;
|
|
1713
|
-
var logErrorOrWarn = process.env.
|
|
1917
|
+
var logErrorOrWarn = process.env.__NEXT_CACHE_COMPONENTS ? console.error : console.warn;
|
|
1714
1918
|
var flushCurrentErrorIfNew = cache(
|
|
1715
1919
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- cache key
|
|
1716
1920
|
(key) => {
|
|
@@ -1816,13 +2020,14 @@ var require_utils = __commonJS({
|
|
|
1816
2020
|
configurable: true
|
|
1817
2021
|
});
|
|
1818
2022
|
}
|
|
1819
|
-
function throwForSearchParamsAccessInUseCache(workStore) {
|
|
1820
|
-
const error = Object.defineProperty(new Error(`Route ${workStore.route} used "searchParams" inside "use cache". Accessing
|
|
1821
|
-
value: "
|
|
2023
|
+
function throwForSearchParamsAccessInUseCache(workStore, constructorOpt) {
|
|
2024
|
+
const error = Object.defineProperty(new Error(`Route ${workStore.route} used "searchParams" inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await "searchParams" outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
|
2025
|
+
value: "E779",
|
|
1822
2026
|
enumerable: false,
|
|
1823
2027
|
configurable: true
|
|
1824
2028
|
});
|
|
1825
|
-
|
|
2029
|
+
Error.captureStackTrace(error, constructorOpt);
|
|
2030
|
+
workStore.invalidDynamicUsageError ?? (workStore.invalidDynamicUsageError = error);
|
|
1826
2031
|
throw error;
|
|
1827
2032
|
}
|
|
1828
2033
|
function isRequestAPICallableInsideAfter() {
|
|
@@ -1840,193 +2045,123 @@ var require_cookies3 = __commonJS({
|
|
|
1840
2045
|
});
|
|
1841
2046
|
Object.defineProperty(exports, "cookies", {
|
|
1842
2047
|
enumerable: true,
|
|
1843
|
-
get: function() {
|
|
1844
|
-
return cookies2;
|
|
1845
|
-
}
|
|
1846
|
-
});
|
|
1847
|
-
var _requestcookies = require_request_cookies();
|
|
1848
|
-
var _cookies = require_cookies2();
|
|
1849
|
-
var _workasyncstorageexternal = require_work_async_storage_external();
|
|
1850
|
-
var _workunitasyncstorageexternal = require_work_unit_async_storage_external();
|
|
1851
|
-
var _dynamicrendering = require_dynamic_rendering();
|
|
1852
|
-
var _staticgenerationbailout = require_static_generation_bailout();
|
|
1853
|
-
var _dynamicrenderingutils = require_dynamic_rendering_utils();
|
|
1854
|
-
var _creatededupedbycallsiteservererrorlogger = require_create_deduped_by_callsite_server_error_logger();
|
|
1855
|
-
var
|
|
1856
|
-
var
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
const
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
function makeDynamicallyTrackedExoticCookies(route, prerenderStore) {
|
|
1927
|
-
const cachedPromise = CachedCookies.get(prerenderStore);
|
|
1928
|
-
if (cachedPromise) {
|
|
1929
|
-
return cachedPromise;
|
|
1930
|
-
}
|
|
1931
|
-
const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, "`cookies()`");
|
|
1932
|
-
CachedCookies.set(prerenderStore, promise);
|
|
1933
|
-
Object.defineProperties(promise, {
|
|
1934
|
-
[Symbol.iterator]: {
|
|
1935
|
-
value: function() {
|
|
1936
|
-
const expression = "`cookies()[Symbol.iterator]()`";
|
|
1937
|
-
const error = createCookiesAccessError(route, expression);
|
|
1938
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
1939
|
-
}
|
|
1940
|
-
},
|
|
1941
|
-
size: {
|
|
1942
|
-
get() {
|
|
1943
|
-
const expression = "`cookies().size`";
|
|
1944
|
-
const error = createCookiesAccessError(route, expression);
|
|
1945
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
1946
|
-
}
|
|
1947
|
-
},
|
|
1948
|
-
get: {
|
|
1949
|
-
value: function get() {
|
|
1950
|
-
let expression;
|
|
1951
|
-
if (arguments.length === 0) {
|
|
1952
|
-
expression = "`cookies().get()`";
|
|
1953
|
-
} else {
|
|
1954
|
-
expression = `\`cookies().get(${describeNameArg(arguments[0])})\``;
|
|
1955
|
-
}
|
|
1956
|
-
const error = createCookiesAccessError(route, expression);
|
|
1957
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
1958
|
-
}
|
|
1959
|
-
},
|
|
1960
|
-
getAll: {
|
|
1961
|
-
value: function getAll() {
|
|
1962
|
-
let expression;
|
|
1963
|
-
if (arguments.length === 0) {
|
|
1964
|
-
expression = "`cookies().getAll()`";
|
|
1965
|
-
} else {
|
|
1966
|
-
expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``;
|
|
1967
|
-
}
|
|
1968
|
-
const error = createCookiesAccessError(route, expression);
|
|
1969
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
1970
|
-
}
|
|
1971
|
-
},
|
|
1972
|
-
has: {
|
|
1973
|
-
value: function has() {
|
|
1974
|
-
let expression;
|
|
1975
|
-
if (arguments.length === 0) {
|
|
1976
|
-
expression = "`cookies().has()`";
|
|
1977
|
-
} else {
|
|
1978
|
-
expression = `\`cookies().has(${describeNameArg(arguments[0])})\``;
|
|
1979
|
-
}
|
|
1980
|
-
const error = createCookiesAccessError(route, expression);
|
|
1981
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
1982
|
-
}
|
|
1983
|
-
},
|
|
1984
|
-
set: {
|
|
1985
|
-
value: function set() {
|
|
1986
|
-
let expression;
|
|
1987
|
-
if (arguments.length === 0) {
|
|
1988
|
-
expression = "`cookies().set()`";
|
|
1989
|
-
} else {
|
|
1990
|
-
const arg = arguments[0];
|
|
1991
|
-
if (arg) {
|
|
1992
|
-
expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``;
|
|
2048
|
+
get: function() {
|
|
2049
|
+
return cookies2;
|
|
2050
|
+
}
|
|
2051
|
+
});
|
|
2052
|
+
var _requestcookies = require_request_cookies();
|
|
2053
|
+
var _cookies = require_cookies2();
|
|
2054
|
+
var _workasyncstorageexternal = require_work_async_storage_external();
|
|
2055
|
+
var _workunitasyncstorageexternal = require_work_unit_async_storage_external();
|
|
2056
|
+
var _dynamicrendering = require_dynamic_rendering();
|
|
2057
|
+
var _staticgenerationbailout = require_static_generation_bailout();
|
|
2058
|
+
var _dynamicrenderingutils = require_dynamic_rendering_utils();
|
|
2059
|
+
var _creatededupedbycallsiteservererrorlogger = require_create_deduped_by_callsite_server_error_logger();
|
|
2060
|
+
var _utils = require_utils();
|
|
2061
|
+
var _invarianterror = require_invariant_error();
|
|
2062
|
+
var _reflect = require_reflect();
|
|
2063
|
+
function cookies2() {
|
|
2064
|
+
const callingExpression = "cookies";
|
|
2065
|
+
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
2066
|
+
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
2067
|
+
if (workStore) {
|
|
2068
|
+
if (workUnitStore && workUnitStore.phase === "after" && !(0, _utils.isRequestAPICallableInsideAfter)()) {
|
|
2069
|
+
throw Object.defineProperty(new Error(
|
|
2070
|
+
// TODO(after): clarify that this only applies to pages?
|
|
2071
|
+
`Route ${workStore.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`
|
|
2072
|
+
), "__NEXT_ERROR_CODE", {
|
|
2073
|
+
value: "E88",
|
|
2074
|
+
enumerable: false,
|
|
2075
|
+
configurable: true
|
|
2076
|
+
});
|
|
2077
|
+
}
|
|
2078
|
+
if (workStore.forceStatic) {
|
|
2079
|
+
const underlyingCookies = createEmptyCookies();
|
|
2080
|
+
return makeUntrackedExoticCookies(underlyingCookies);
|
|
2081
|
+
}
|
|
2082
|
+
if (workStore.dynamicShouldError) {
|
|
2083
|
+
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
|
2084
|
+
value: "E549",
|
|
2085
|
+
enumerable: false,
|
|
2086
|
+
configurable: true
|
|
2087
|
+
});
|
|
2088
|
+
}
|
|
2089
|
+
if (workUnitStore) {
|
|
2090
|
+
switch (workUnitStore.type) {
|
|
2091
|
+
case "cache":
|
|
2092
|
+
const error = Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
|
2093
|
+
value: "E398",
|
|
2094
|
+
enumerable: false,
|
|
2095
|
+
configurable: true
|
|
2096
|
+
});
|
|
2097
|
+
Error.captureStackTrace(error, cookies2);
|
|
2098
|
+
workStore.invalidDynamicUsageError ?? (workStore.invalidDynamicUsageError = error);
|
|
2099
|
+
throw error;
|
|
2100
|
+
case "unstable-cache":
|
|
2101
|
+
throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
|
2102
|
+
value: "E157",
|
|
2103
|
+
enumerable: false,
|
|
2104
|
+
configurable: true
|
|
2105
|
+
});
|
|
2106
|
+
case "prerender":
|
|
2107
|
+
return makeHangingCookies(workStore, workUnitStore);
|
|
2108
|
+
case "prerender-client":
|
|
2109
|
+
const exportName = "`cookies`";
|
|
2110
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
2111
|
+
value: "E693",
|
|
2112
|
+
enumerable: false,
|
|
2113
|
+
configurable: true
|
|
2114
|
+
});
|
|
2115
|
+
case "prerender-ppr":
|
|
2116
|
+
return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking);
|
|
2117
|
+
case "prerender-legacy":
|
|
2118
|
+
return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore);
|
|
2119
|
+
case "prerender-runtime":
|
|
2120
|
+
return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, makeUntrackedCookies(workUnitStore.cookies));
|
|
2121
|
+
case "private-cache":
|
|
2122
|
+
if (process.env.__NEXT_CACHE_COMPONENTS) {
|
|
2123
|
+
return makeUntrackedCookies(workUnitStore.cookies);
|
|
2124
|
+
}
|
|
2125
|
+
return makeUntrackedExoticCookies(workUnitStore.cookies);
|
|
2126
|
+
case "request":
|
|
2127
|
+
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore);
|
|
2128
|
+
let underlyingCookies;
|
|
2129
|
+
if ((0, _requestcookies.areCookiesMutableInCurrentPhase)(workUnitStore)) {
|
|
2130
|
+
underlyingCookies = workUnitStore.userspaceMutableCookies;
|
|
1993
2131
|
} else {
|
|
1994
|
-
|
|
2132
|
+
underlyingCookies = workUnitStore.cookies;
|
|
2133
|
+
}
|
|
2134
|
+
{
|
|
2135
|
+
if (process.env.__NEXT_CACHE_COMPONENTS) {
|
|
2136
|
+
return makeUntrackedCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route);
|
|
2137
|
+
}
|
|
2138
|
+
return makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route);
|
|
1995
2139
|
}
|
|
1996
|
-
}
|
|
1997
|
-
const error = createCookiesAccessError(route, expression);
|
|
1998
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
1999
|
-
}
|
|
2000
|
-
},
|
|
2001
|
-
delete: {
|
|
2002
|
-
value: function() {
|
|
2003
|
-
let expression;
|
|
2004
|
-
if (arguments.length === 0) {
|
|
2005
|
-
expression = "`cookies().delete()`";
|
|
2006
|
-
} else if (arguments.length === 1) {
|
|
2007
|
-
expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``;
|
|
2008
|
-
} else {
|
|
2009
|
-
expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``;
|
|
2010
|
-
}
|
|
2011
|
-
const error = createCookiesAccessError(route, expression);
|
|
2012
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2013
|
-
}
|
|
2014
|
-
},
|
|
2015
|
-
clear: {
|
|
2016
|
-
value: function clear() {
|
|
2017
|
-
const expression = "`cookies().clear()`";
|
|
2018
|
-
const error = createCookiesAccessError(route, expression);
|
|
2019
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2020
|
-
}
|
|
2021
|
-
},
|
|
2022
|
-
toString: {
|
|
2023
|
-
value: function toString() {
|
|
2024
|
-
const expression = "`cookies().toString()`";
|
|
2025
|
-
const error = createCookiesAccessError(route, expression);
|
|
2026
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2027
2140
|
}
|
|
2028
2141
|
}
|
|
2029
|
-
}
|
|
2142
|
+
}
|
|
2143
|
+
(0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression);
|
|
2144
|
+
}
|
|
2145
|
+
function createEmptyCookies() {
|
|
2146
|
+
return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({})));
|
|
2147
|
+
}
|
|
2148
|
+
var CachedCookies = /* @__PURE__ */ new WeakMap();
|
|
2149
|
+
function makeHangingCookies(workStore, prerenderStore) {
|
|
2150
|
+
const cachedPromise = CachedCookies.get(prerenderStore);
|
|
2151
|
+
if (cachedPromise) {
|
|
2152
|
+
return cachedPromise;
|
|
2153
|
+
}
|
|
2154
|
+
const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, "`cookies()`");
|
|
2155
|
+
CachedCookies.set(prerenderStore, promise);
|
|
2156
|
+
return promise;
|
|
2157
|
+
}
|
|
2158
|
+
function makeUntrackedCookies(underlyingCookies) {
|
|
2159
|
+
const cachedCookies = CachedCookies.get(underlyingCookies);
|
|
2160
|
+
if (cachedCookies) {
|
|
2161
|
+
return cachedCookies;
|
|
2162
|
+
}
|
|
2163
|
+
const promise = Promise.resolve(underlyingCookies);
|
|
2164
|
+
CachedCookies.set(underlyingCookies, promise);
|
|
2030
2165
|
return promise;
|
|
2031
2166
|
}
|
|
2032
2167
|
function makeUntrackedExoticCookies(underlyingCookies) {
|
|
@@ -2089,7 +2224,7 @@ var require_cookies3 = __commonJS({
|
|
|
2089
2224
|
if (cachedCookies) {
|
|
2090
2225
|
return cachedCookies;
|
|
2091
2226
|
}
|
|
2092
|
-
const promise =
|
|
2227
|
+
const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies);
|
|
2093
2228
|
CachedCookies.set(underlyingCookies, promise);
|
|
2094
2229
|
Object.defineProperties(promise, {
|
|
2095
2230
|
[Symbol.iterator]: {
|
|
@@ -2210,14 +2345,50 @@ var require_cookies3 = __commonJS({
|
|
|
2210
2345
|
});
|
|
2211
2346
|
return promise;
|
|
2212
2347
|
}
|
|
2348
|
+
function makeUntrackedCookiesWithDevWarnings(underlyingCookies, route) {
|
|
2349
|
+
const cachedCookies = CachedCookies.get(underlyingCookies);
|
|
2350
|
+
if (cachedCookies) {
|
|
2351
|
+
return cachedCookies;
|
|
2352
|
+
}
|
|
2353
|
+
const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies);
|
|
2354
|
+
const proxiedPromise = new Proxy(promise, {
|
|
2355
|
+
get(target, prop, receiver) {
|
|
2356
|
+
switch (prop) {
|
|
2357
|
+
case Symbol.iterator: {
|
|
2358
|
+
warnForSyncAccess(route, "`...cookies()` or similar iteration");
|
|
2359
|
+
break;
|
|
2360
|
+
}
|
|
2361
|
+
case "size":
|
|
2362
|
+
case "get":
|
|
2363
|
+
case "getAll":
|
|
2364
|
+
case "has":
|
|
2365
|
+
case "set":
|
|
2366
|
+
case "delete":
|
|
2367
|
+
case "clear":
|
|
2368
|
+
case "toString": {
|
|
2369
|
+
warnForSyncAccess(route, `\`cookies().${prop}\``);
|
|
2370
|
+
break;
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
|
2374
|
+
}
|
|
2375
|
+
});
|
|
2376
|
+
CachedCookies.set(underlyingCookies, proxiedPromise);
|
|
2377
|
+
return proxiedPromise;
|
|
2378
|
+
}
|
|
2213
2379
|
function describeNameArg(arg) {
|
|
2214
2380
|
return typeof arg === "object" && arg !== null && typeof arg.name === "string" ? `'${arg.name}'` : typeof arg === "string" ? `'${arg}'` : "...";
|
|
2215
2381
|
}
|
|
2216
2382
|
function syncIODev(route, expression) {
|
|
2217
2383
|
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
2218
|
-
if (workUnitStore
|
|
2219
|
-
|
|
2220
|
-
|
|
2384
|
+
if (workUnitStore) {
|
|
2385
|
+
switch (workUnitStore.type) {
|
|
2386
|
+
case "request":
|
|
2387
|
+
if (workUnitStore.prerenderPhase === true) {
|
|
2388
|
+
(0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore);
|
|
2389
|
+
}
|
|
2390
|
+
break;
|
|
2391
|
+
}
|
|
2221
2392
|
}
|
|
2222
2393
|
warnForSyncAccess(route, expression);
|
|
2223
2394
|
}
|
|
@@ -2439,9 +2610,11 @@ var require_headers2 = __commonJS({
|
|
|
2439
2610
|
var _staticgenerationbailout = require_static_generation_bailout();
|
|
2440
2611
|
var _dynamicrenderingutils = require_dynamic_rendering_utils();
|
|
2441
2612
|
var _creatededupedbycallsiteservererrorlogger = require_create_deduped_by_callsite_server_error_logger();
|
|
2442
|
-
var _scheduler = require_scheduler();
|
|
2443
2613
|
var _utils = require_utils();
|
|
2614
|
+
var _invarianterror = require_invariant_error();
|
|
2615
|
+
var _reflect = require_reflect();
|
|
2444
2616
|
function headers2() {
|
|
2617
|
+
const callingExpression = "headers";
|
|
2445
2618
|
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
2446
2619
|
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
2447
2620
|
if (workStore) {
|
|
@@ -2457,18 +2630,33 @@ var require_headers2 = __commonJS({
|
|
|
2457
2630
|
return makeUntrackedExoticHeaders(underlyingHeaders);
|
|
2458
2631
|
}
|
|
2459
2632
|
if (workUnitStore) {
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2633
|
+
switch (workUnitStore.type) {
|
|
2634
|
+
case "cache": {
|
|
2635
|
+
const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
|
2636
|
+
value: "E304",
|
|
2637
|
+
enumerable: false,
|
|
2638
|
+
configurable: true
|
|
2639
|
+
});
|
|
2640
|
+
Error.captureStackTrace(error, headers2);
|
|
2641
|
+
workStore.invalidDynamicUsageError ?? (workStore.invalidDynamicUsageError = error);
|
|
2642
|
+
throw error;
|
|
2643
|
+
}
|
|
2644
|
+
case "private-cache": {
|
|
2645
|
+
const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache: private". Accessing "headers" inside a private cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
|
2646
|
+
value: "E742",
|
|
2647
|
+
enumerable: false,
|
|
2648
|
+
configurable: true
|
|
2649
|
+
});
|
|
2650
|
+
Error.captureStackTrace(error, headers2);
|
|
2651
|
+
workStore.invalidDynamicUsageError ?? (workStore.invalidDynamicUsageError = error);
|
|
2652
|
+
throw error;
|
|
2653
|
+
}
|
|
2654
|
+
case "unstable-cache":
|
|
2655
|
+
throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
|
2656
|
+
value: "E127",
|
|
2657
|
+
enumerable: false,
|
|
2658
|
+
configurable: true
|
|
2659
|
+
});
|
|
2472
2660
|
}
|
|
2473
2661
|
}
|
|
2474
2662
|
if (workStore.dynamicShouldError) {
|
|
@@ -2479,110 +2667,42 @@ var require_headers2 = __commonJS({
|
|
|
2479
2667
|
});
|
|
2480
2668
|
}
|
|
2481
2669
|
if (workUnitStore) {
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2670
|
+
switch (workUnitStore.type) {
|
|
2671
|
+
case "prerender":
|
|
2672
|
+
case "prerender-runtime":
|
|
2673
|
+
return makeHangingHeaders(workStore, workUnitStore);
|
|
2674
|
+
case "prerender-client":
|
|
2675
|
+
const exportName = "`headers`";
|
|
2676
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
2677
|
+
value: "E693",
|
|
2678
|
+
enumerable: false,
|
|
2679
|
+
configurable: true
|
|
2680
|
+
});
|
|
2681
|
+
case "prerender-ppr":
|
|
2682
|
+
return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking);
|
|
2683
|
+
case "prerender-legacy":
|
|
2684
|
+
return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore);
|
|
2685
|
+
case "request":
|
|
2686
|
+
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore);
|
|
2687
|
+
{
|
|
2688
|
+
if (process.env.__NEXT_CACHE_COMPONENTS) {
|
|
2689
|
+
return makeUntrackedHeadersWithDevWarnings(workUnitStore.headers, workStore == null ? void 0 : workStore.route);
|
|
2690
|
+
}
|
|
2691
|
+
return makeUntrackedExoticHeadersWithDevWarnings(workUnitStore.headers, workStore == null ? void 0 : workStore.route);
|
|
2692
|
+
}
|
|
2488
2693
|
}
|
|
2489
2694
|
}
|
|
2490
|
-
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(workStore, workUnitStore);
|
|
2491
|
-
}
|
|
2492
|
-
const requestStore = (0, _workunitasyncstorageexternal.getExpectedRequestStore)("headers");
|
|
2493
|
-
if (!(workStore == null ? void 0 : workStore.isPrefetchRequest)) {
|
|
2494
|
-
return makeUntrackedExoticHeadersWithDevWarnings(requestStore.headers, workStore == null ? void 0 : workStore.route);
|
|
2495
|
-
} else {
|
|
2496
|
-
return makeUntrackedExoticHeaders(requestStore.headers);
|
|
2497
2695
|
}
|
|
2696
|
+
(0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression);
|
|
2498
2697
|
}
|
|
2499
2698
|
var CachedHeaders = /* @__PURE__ */ new WeakMap();
|
|
2500
|
-
function
|
|
2699
|
+
function makeHangingHeaders(workStore, prerenderStore) {
|
|
2501
2700
|
const cachedHeaders = CachedHeaders.get(prerenderStore);
|
|
2502
2701
|
if (cachedHeaders) {
|
|
2503
2702
|
return cachedHeaders;
|
|
2504
2703
|
}
|
|
2505
|
-
const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, "`headers()`");
|
|
2704
|
+
const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, "`headers()`");
|
|
2506
2705
|
CachedHeaders.set(prerenderStore, promise);
|
|
2507
|
-
Object.defineProperties(promise, {
|
|
2508
|
-
append: {
|
|
2509
|
-
value: function append() {
|
|
2510
|
-
const expression = `\`headers().append(${describeNameArg(arguments[0])}, ...)\``;
|
|
2511
|
-
const error = createHeadersAccessError(route, expression);
|
|
2512
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2513
|
-
}
|
|
2514
|
-
},
|
|
2515
|
-
delete: {
|
|
2516
|
-
value: function _delete() {
|
|
2517
|
-
const expression = `\`headers().delete(${describeNameArg(arguments[0])})\``;
|
|
2518
|
-
const error = createHeadersAccessError(route, expression);
|
|
2519
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2520
|
-
}
|
|
2521
|
-
},
|
|
2522
|
-
get: {
|
|
2523
|
-
value: function get() {
|
|
2524
|
-
const expression = `\`headers().get(${describeNameArg(arguments[0])})\``;
|
|
2525
|
-
const error = createHeadersAccessError(route, expression);
|
|
2526
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2527
|
-
}
|
|
2528
|
-
},
|
|
2529
|
-
has: {
|
|
2530
|
-
value: function has() {
|
|
2531
|
-
const expression = `\`headers().has(${describeNameArg(arguments[0])})\``;
|
|
2532
|
-
const error = createHeadersAccessError(route, expression);
|
|
2533
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2534
|
-
}
|
|
2535
|
-
},
|
|
2536
|
-
set: {
|
|
2537
|
-
value: function set() {
|
|
2538
|
-
const expression = `\`headers().set(${describeNameArg(arguments[0])}, ...)\``;
|
|
2539
|
-
const error = createHeadersAccessError(route, expression);
|
|
2540
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2541
|
-
}
|
|
2542
|
-
},
|
|
2543
|
-
getSetCookie: {
|
|
2544
|
-
value: function getSetCookie() {
|
|
2545
|
-
const expression = "`headers().getSetCookie()`";
|
|
2546
|
-
const error = createHeadersAccessError(route, expression);
|
|
2547
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2548
|
-
}
|
|
2549
|
-
},
|
|
2550
|
-
forEach: {
|
|
2551
|
-
value: function forEach() {
|
|
2552
|
-
const expression = "`headers().forEach(...)`";
|
|
2553
|
-
const error = createHeadersAccessError(route, expression);
|
|
2554
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2555
|
-
}
|
|
2556
|
-
},
|
|
2557
|
-
keys: {
|
|
2558
|
-
value: function keys() {
|
|
2559
|
-
const expression = "`headers().keys()`";
|
|
2560
|
-
const error = createHeadersAccessError(route, expression);
|
|
2561
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2562
|
-
}
|
|
2563
|
-
},
|
|
2564
|
-
values: {
|
|
2565
|
-
value: function values() {
|
|
2566
|
-
const expression = "`headers().values()`";
|
|
2567
|
-
const error = createHeadersAccessError(route, expression);
|
|
2568
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2569
|
-
}
|
|
2570
|
-
},
|
|
2571
|
-
entries: {
|
|
2572
|
-
value: function entries() {
|
|
2573
|
-
const expression = "`headers().entries()`";
|
|
2574
|
-
const error = createHeadersAccessError(route, expression);
|
|
2575
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2576
|
-
}
|
|
2577
|
-
},
|
|
2578
|
-
[Symbol.iterator]: {
|
|
2579
|
-
value: function() {
|
|
2580
|
-
const expression = "`headers()[Symbol.iterator]()`";
|
|
2581
|
-
const error = createHeadersAccessError(route, expression);
|
|
2582
|
-
(0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(route, expression, error, prerenderStore);
|
|
2583
|
-
}
|
|
2584
|
-
}
|
|
2585
|
-
});
|
|
2586
2706
|
return promise;
|
|
2587
2707
|
}
|
|
2588
2708
|
function makeUntrackedExoticHeaders(underlyingHeaders) {
|
|
@@ -2634,7 +2754,7 @@ var require_headers2 = __commonJS({
|
|
|
2634
2754
|
if (cachedHeaders) {
|
|
2635
2755
|
return cachedHeaders;
|
|
2636
2756
|
}
|
|
2637
|
-
const promise =
|
|
2757
|
+
const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders);
|
|
2638
2758
|
CachedHeaders.set(underlyingHeaders, promise);
|
|
2639
2759
|
Object.defineProperties(promise, {
|
|
2640
2760
|
append: {
|
|
@@ -2717,14 +2837,52 @@ var require_headers2 = __commonJS({
|
|
|
2717
2837
|
});
|
|
2718
2838
|
return promise;
|
|
2719
2839
|
}
|
|
2840
|
+
function makeUntrackedHeadersWithDevWarnings(underlyingHeaders, route) {
|
|
2841
|
+
const cachedHeaders = CachedHeaders.get(underlyingHeaders);
|
|
2842
|
+
if (cachedHeaders) {
|
|
2843
|
+
return cachedHeaders;
|
|
2844
|
+
}
|
|
2845
|
+
const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders);
|
|
2846
|
+
const proxiedPromise = new Proxy(promise, {
|
|
2847
|
+
get(target, prop, receiver) {
|
|
2848
|
+
switch (prop) {
|
|
2849
|
+
case Symbol.iterator: {
|
|
2850
|
+
warnForSyncAccess(route, "`...headers()` or similar iteration");
|
|
2851
|
+
break;
|
|
2852
|
+
}
|
|
2853
|
+
case "append":
|
|
2854
|
+
case "delete":
|
|
2855
|
+
case "get":
|
|
2856
|
+
case "has":
|
|
2857
|
+
case "set":
|
|
2858
|
+
case "getSetCookie":
|
|
2859
|
+
case "forEach":
|
|
2860
|
+
case "keys":
|
|
2861
|
+
case "values":
|
|
2862
|
+
case "entries": {
|
|
2863
|
+
warnForSyncAccess(route, `\`headers().${prop}\``);
|
|
2864
|
+
break;
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
|
2868
|
+
}
|
|
2869
|
+
});
|
|
2870
|
+
CachedHeaders.set(underlyingHeaders, proxiedPromise);
|
|
2871
|
+
return proxiedPromise;
|
|
2872
|
+
}
|
|
2720
2873
|
function describeNameArg(arg) {
|
|
2721
2874
|
return typeof arg === "string" ? `'${arg}'` : "...";
|
|
2722
2875
|
}
|
|
2723
2876
|
function syncIODev(route, expression) {
|
|
2724
2877
|
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
2725
|
-
if (workUnitStore
|
|
2726
|
-
|
|
2727
|
-
|
|
2878
|
+
if (workUnitStore) {
|
|
2879
|
+
switch (workUnitStore.type) {
|
|
2880
|
+
case "request":
|
|
2881
|
+
if (workUnitStore.prerenderPhase === true) {
|
|
2882
|
+
(0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore);
|
|
2883
|
+
}
|
|
2884
|
+
break;
|
|
2885
|
+
}
|
|
2728
2886
|
}
|
|
2729
2887
|
warnForSyncAccess(route, expression);
|
|
2730
2888
|
}
|
|
@@ -2758,6 +2916,8 @@ var require_draft_mode = __commonJS({
|
|
|
2758
2916
|
var _creatededupedbycallsiteservererrorlogger = require_create_deduped_by_callsite_server_error_logger();
|
|
2759
2917
|
var _staticgenerationbailout = require_static_generation_bailout();
|
|
2760
2918
|
var _hooksservercontext = require_hooks_server_context();
|
|
2919
|
+
var _invarianterror = require_invariant_error();
|
|
2920
|
+
var _reflect = require_reflect();
|
|
2761
2921
|
function draftMode() {
|
|
2762
2922
|
const callingExpression = "draftMode";
|
|
2763
2923
|
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
@@ -2766,43 +2926,49 @@ var require_draft_mode = __commonJS({
|
|
|
2766
2926
|
(0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression);
|
|
2767
2927
|
}
|
|
2768
2928
|
switch (workUnitStore.type) {
|
|
2929
|
+
case "prerender-runtime":
|
|
2930
|
+
return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, createOrGetCachedDraftMode(workUnitStore.draftMode, workStore));
|
|
2769
2931
|
case "request":
|
|
2770
|
-
return
|
|
2932
|
+
return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore);
|
|
2771
2933
|
case "cache":
|
|
2934
|
+
case "private-cache":
|
|
2772
2935
|
case "unstable-cache":
|
|
2773
2936
|
const draftModeProvider = (0, _workunitasyncstorageexternal.getDraftModeProviderForCacheScope)(workStore, workUnitStore);
|
|
2774
2937
|
if (draftModeProvider) {
|
|
2775
|
-
return
|
|
2938
|
+
return createOrGetCachedDraftMode(draftModeProvider, workStore);
|
|
2776
2939
|
}
|
|
2777
2940
|
case "prerender":
|
|
2941
|
+
case "prerender-client":
|
|
2778
2942
|
case "prerender-ppr":
|
|
2779
2943
|
case "prerender-legacy":
|
|
2780
|
-
|
|
2781
|
-
const route = workStore == null ? void 0 : workStore.route;
|
|
2782
|
-
return createExoticDraftModeWithDevWarnings(null, route);
|
|
2783
|
-
} else {
|
|
2784
|
-
return createExoticDraftMode(null);
|
|
2785
|
-
}
|
|
2944
|
+
return createOrGetCachedDraftMode(null, workStore);
|
|
2786
2945
|
default:
|
|
2787
|
-
|
|
2788
|
-
return _exhaustiveCheck;
|
|
2946
|
+
return workUnitStore;
|
|
2789
2947
|
}
|
|
2790
2948
|
}
|
|
2791
|
-
function
|
|
2792
|
-
const
|
|
2949
|
+
function createOrGetCachedDraftMode(draftModeProvider, workStore) {
|
|
2950
|
+
const cacheKey = draftModeProvider ?? NullDraftMode;
|
|
2951
|
+
const cachedDraftMode = CachedDraftModes.get(cacheKey);
|
|
2793
2952
|
if (cachedDraftMode) {
|
|
2794
2953
|
return cachedDraftMode;
|
|
2795
2954
|
}
|
|
2796
2955
|
let promise;
|
|
2797
2956
|
if (!(workStore == null ? void 0 : workStore.isPrefetchRequest)) {
|
|
2798
2957
|
const route = workStore == null ? void 0 : workStore.route;
|
|
2958
|
+
if (process.env.__NEXT_CACHE_COMPONENTS) {
|
|
2959
|
+
return createDraftModeWithDevWarnings(draftModeProvider, route);
|
|
2960
|
+
}
|
|
2799
2961
|
promise = createExoticDraftModeWithDevWarnings(draftModeProvider, route);
|
|
2800
2962
|
} else {
|
|
2963
|
+
if (process.env.__NEXT_CACHE_COMPONENTS) {
|
|
2964
|
+
return Promise.resolve(new DraftMode(draftModeProvider));
|
|
2965
|
+
}
|
|
2801
2966
|
promise = createExoticDraftMode(draftModeProvider);
|
|
2802
2967
|
}
|
|
2803
|
-
CachedDraftModes.set(
|
|
2968
|
+
CachedDraftModes.set(cacheKey, promise);
|
|
2804
2969
|
return promise;
|
|
2805
2970
|
}
|
|
2971
|
+
var NullDraftMode = {};
|
|
2806
2972
|
var CachedDraftModes = /* @__PURE__ */ new WeakMap();
|
|
2807
2973
|
function createExoticDraftMode(underlyingProvider) {
|
|
2808
2974
|
const instance = new DraftMode(underlyingProvider);
|
|
@@ -2811,13 +2977,6 @@ var require_draft_mode = __commonJS({
|
|
|
2811
2977
|
get() {
|
|
2812
2978
|
return instance.isEnabled;
|
|
2813
2979
|
},
|
|
2814
|
-
set(newValue) {
|
|
2815
|
-
Object.defineProperty(promise, "isEnabled", {
|
|
2816
|
-
value: newValue,
|
|
2817
|
-
writable: true,
|
|
2818
|
-
enumerable: true
|
|
2819
|
-
});
|
|
2820
|
-
},
|
|
2821
2980
|
enumerable: true,
|
|
2822
2981
|
configurable: true
|
|
2823
2982
|
});
|
|
@@ -2834,13 +2993,6 @@ var require_draft_mode = __commonJS({
|
|
|
2834
2993
|
syncIODev(route, expression);
|
|
2835
2994
|
return instance.isEnabled;
|
|
2836
2995
|
},
|
|
2837
|
-
set(newValue) {
|
|
2838
|
-
Object.defineProperty(promise, "isEnabled", {
|
|
2839
|
-
value: newValue,
|
|
2840
|
-
writable: true,
|
|
2841
|
-
enumerable: true
|
|
2842
|
-
});
|
|
2843
|
-
},
|
|
2844
2996
|
enumerable: true,
|
|
2845
2997
|
configurable: true
|
|
2846
2998
|
});
|
|
@@ -2860,6 +3012,26 @@ var require_draft_mode = __commonJS({
|
|
|
2860
3012
|
});
|
|
2861
3013
|
return promise;
|
|
2862
3014
|
}
|
|
3015
|
+
function createDraftModeWithDevWarnings(underlyingProvider, route) {
|
|
3016
|
+
const instance = new DraftMode(underlyingProvider);
|
|
3017
|
+
const promise = Promise.resolve(instance);
|
|
3018
|
+
const proxiedPromise = new Proxy(promise, {
|
|
3019
|
+
get(target, prop, receiver) {
|
|
3020
|
+
switch (prop) {
|
|
3021
|
+
case "isEnabled":
|
|
3022
|
+
warnForSyncAccess(route, `\`draftMode().${prop}\``);
|
|
3023
|
+
break;
|
|
3024
|
+
case "enable":
|
|
3025
|
+
case "disable": {
|
|
3026
|
+
warnForSyncAccess(route, `\`draftMode().${prop}()\``);
|
|
3027
|
+
break;
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
|
3031
|
+
}
|
|
3032
|
+
});
|
|
3033
|
+
return proxiedPromise;
|
|
3034
|
+
}
|
|
2863
3035
|
var DraftMode = class {
|
|
2864
3036
|
constructor(provider) {
|
|
2865
3037
|
this._provider = provider;
|
|
@@ -2871,13 +3043,13 @@ var require_draft_mode = __commonJS({
|
|
|
2871
3043
|
return false;
|
|
2872
3044
|
}
|
|
2873
3045
|
enable() {
|
|
2874
|
-
trackDynamicDraftMode("draftMode().enable()");
|
|
3046
|
+
trackDynamicDraftMode("draftMode().enable()", this.enable);
|
|
2875
3047
|
if (this._provider !== null) {
|
|
2876
3048
|
this._provider.enable();
|
|
2877
3049
|
}
|
|
2878
3050
|
}
|
|
2879
3051
|
disable() {
|
|
2880
|
-
trackDynamicDraftMode("draftMode().disable()");
|
|
3052
|
+
trackDynamicDraftMode("draftMode().disable()", this.disable);
|
|
2881
3053
|
if (this._provider !== null) {
|
|
2882
3054
|
this._provider.disable();
|
|
2883
3055
|
}
|
|
@@ -2885,9 +3057,14 @@ var require_draft_mode = __commonJS({
|
|
|
2885
3057
|
};
|
|
2886
3058
|
function syncIODev(route, expression) {
|
|
2887
3059
|
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
2888
|
-
if (workUnitStore
|
|
2889
|
-
|
|
2890
|
-
|
|
3060
|
+
if (workUnitStore) {
|
|
3061
|
+
switch (workUnitStore.type) {
|
|
3062
|
+
case "request":
|
|
3063
|
+
if (workUnitStore.prerenderPhase === true) {
|
|
3064
|
+
(0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore);
|
|
3065
|
+
}
|
|
3066
|
+
break;
|
|
3067
|
+
}
|
|
2891
3068
|
}
|
|
2892
3069
|
warnForSyncAccess(route, expression);
|
|
2893
3070
|
}
|
|
@@ -2900,60 +3077,74 @@ var require_draft_mode = __commonJS({
|
|
|
2900
3077
|
configurable: true
|
|
2901
3078
|
});
|
|
2902
3079
|
}
|
|
2903
|
-
function trackDynamicDraftMode(expression) {
|
|
2904
|
-
const
|
|
3080
|
+
function trackDynamicDraftMode(expression, constructorOpt) {
|
|
3081
|
+
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
2905
3082
|
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
2906
|
-
if (
|
|
2907
|
-
if (workUnitStore) {
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
});
|
|
2914
|
-
} else if (workUnitStore.type === "unstable-cache") {
|
|
2915
|
-
throw Object.defineProperty(new Error(`Route ${store.route} used "${expression}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
|
2916
|
-
value: "E259",
|
|
2917
|
-
enumerable: false,
|
|
2918
|
-
configurable: true
|
|
2919
|
-
});
|
|
2920
|
-
} else if (workUnitStore.phase === "after") {
|
|
2921
|
-
throw Object.defineProperty(new Error(`Route ${store.route} used "${expression}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", {
|
|
2922
|
-
value: "E348",
|
|
2923
|
-
enumerable: false,
|
|
2924
|
-
configurable: true
|
|
2925
|
-
});
|
|
2926
|
-
}
|
|
3083
|
+
if (workStore) {
|
|
3084
|
+
if ((workUnitStore == null ? void 0 : workUnitStore.phase) === "after") {
|
|
3085
|
+
throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", {
|
|
3086
|
+
value: "E348",
|
|
3087
|
+
enumerable: false,
|
|
3088
|
+
configurable: true
|
|
3089
|
+
});
|
|
2927
3090
|
}
|
|
2928
|
-
if (
|
|
2929
|
-
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${
|
|
3091
|
+
if (workStore.dynamicShouldError) {
|
|
3092
|
+
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.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", {
|
|
2930
3093
|
value: "E553",
|
|
2931
3094
|
enumerable: false,
|
|
2932
3095
|
configurable: true
|
|
2933
3096
|
});
|
|
2934
3097
|
}
|
|
2935
3098
|
if (workUnitStore) {
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
3099
|
+
switch (workUnitStore.type) {
|
|
3100
|
+
case "cache":
|
|
3101
|
+
case "private-cache": {
|
|
3102
|
+
const error = Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
|
3103
|
+
value: "E246",
|
|
3104
|
+
enumerable: false,
|
|
3105
|
+
configurable: true
|
|
3106
|
+
});
|
|
3107
|
+
Error.captureStackTrace(error, constructorOpt);
|
|
3108
|
+
workStore.invalidDynamicUsageError ?? (workStore.invalidDynamicUsageError = error);
|
|
3109
|
+
throw error;
|
|
3110
|
+
}
|
|
3111
|
+
case "unstable-cache":
|
|
3112
|
+
throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
|
3113
|
+
value: "E259",
|
|
3114
|
+
enumerable: false,
|
|
3115
|
+
configurable: true
|
|
3116
|
+
});
|
|
3117
|
+
case "prerender":
|
|
3118
|
+
case "prerender-runtime": {
|
|
3119
|
+
const error = Object.defineProperty(new Error(`Route ${workStore.route} used ${expression} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`), "__NEXT_ERROR_CODE", {
|
|
3120
|
+
value: "E126",
|
|
3121
|
+
enumerable: false,
|
|
3122
|
+
configurable: true
|
|
3123
|
+
});
|
|
3124
|
+
return (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(workStore.route, expression, error, workUnitStore);
|
|
3125
|
+
}
|
|
3126
|
+
case "prerender-client":
|
|
3127
|
+
const exportName = "`draftMode`";
|
|
3128
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
3129
|
+
value: "E693",
|
|
3130
|
+
enumerable: false,
|
|
3131
|
+
configurable: true
|
|
3132
|
+
});
|
|
3133
|
+
case "prerender-ppr":
|
|
3134
|
+
return (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, workUnitStore.dynamicTracking);
|
|
3135
|
+
case "prerender-legacy":
|
|
3136
|
+
workUnitStore.revalidate = 0;
|
|
3137
|
+
const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${workStore.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", {
|
|
3138
|
+
value: "E558",
|
|
3139
|
+
enumerable: false,
|
|
3140
|
+
configurable: true
|
|
3141
|
+
});
|
|
3142
|
+
workStore.dynamicUsageDescription = expression;
|
|
3143
|
+
workStore.dynamicUsageStack = err.stack;
|
|
3144
|
+
throw err;
|
|
3145
|
+
case "request":
|
|
3146
|
+
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore);
|
|
3147
|
+
break;
|
|
2957
3148
|
}
|
|
2958
3149
|
}
|
|
2959
3150
|
}
|
|
@@ -3342,6 +3533,34 @@ function readLicenseTokenServer() {
|
|
|
3342
3533
|
}
|
|
3343
3534
|
const fs2 = __require("fs");
|
|
3344
3535
|
const path2 = __require("path");
|
|
3536
|
+
const base64TokenPaths = [
|
|
3537
|
+
path2.join(process.cwd(), ".moonui-license-token"),
|
|
3538
|
+
path2.join(process.cwd(), "..", ".moonui-license-token"),
|
|
3539
|
+
path2.join(process.cwd(), "..", "..", ".moonui-license-token"),
|
|
3540
|
+
"/tmp/.moonui-license-token"
|
|
3541
|
+
];
|
|
3542
|
+
if (process.env.VERCEL_ARTIFACTS_PATH) {
|
|
3543
|
+
base64TokenPaths.push(path2.join(process.env.VERCEL_ARTIFACTS_PATH, ".moonui-license-token"));
|
|
3544
|
+
}
|
|
3545
|
+
if (process.env.NETLIFY_BUILD_BASE) {
|
|
3546
|
+
base64TokenPaths.push(path2.join(process.env.NETLIFY_BUILD_BASE, ".moonui-license-token"));
|
|
3547
|
+
}
|
|
3548
|
+
for (const p of base64TokenPaths) {
|
|
3549
|
+
if (fs2.existsSync(p)) {
|
|
3550
|
+
try {
|
|
3551
|
+
const token2 = JSON.parse(
|
|
3552
|
+
Buffer.from(fs2.readFileSync(p, "utf8").trim(), "base64").toString("utf8")
|
|
3553
|
+
);
|
|
3554
|
+
if (token2.expiresAt && token2.expiresAt < Date.now()) {
|
|
3555
|
+
console.log("[MoonUI] License token expired, re-validation required");
|
|
3556
|
+
return null;
|
|
3557
|
+
}
|
|
3558
|
+
console.log("[MoonUI] License token loaded (base64) from:", p);
|
|
3559
|
+
return token2;
|
|
3560
|
+
} catch (e) {
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3345
3564
|
const possiblePaths = [
|
|
3346
3565
|
path2.join(process.cwd(), ".moonui-license"),
|
|
3347
3566
|
path2.join(process.cwd(), "..", ".moonui-license"),
|