zudoku 0.39.4 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/entry.client.js +2 -0
- package/dist/app/entry.client.js.map +1 -1
- package/dist/config/config.d.ts +3 -1
- package/dist/config/loader.d.ts +1 -0
- package/dist/config/loader.js +1 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/BuildSchema.d.ts +59 -0
- package/dist/config/validators/BuildSchema.js +31 -0
- package/dist/config/validators/BuildSchema.js.map +1 -0
- package/dist/config/validators/common.d.ts +7 -51
- package/dist/config/validators/common.js +1 -7
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/icon-types.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +2 -18
- package/dist/index.d.ts +1 -1
- package/dist/lib/authentication/providers/clerk.js +2 -2
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/components/Footer.js +2 -2
- package/dist/lib/components/Footer.js.map +1 -1
- package/dist/lib/components/Layout.js +2 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Search.js +7 -1
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.js +3 -1
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/processors/removeExtensions.js.map +1 -0
- package/dist/lib/plugins/openapi/processors/removeExtensions.test.js.map +1 -0
- package/dist/lib/plugins/openapi/processors/removeParameters.js.map +1 -0
- package/dist/lib/plugins/openapi/processors/removeParameters.test.js.map +1 -0
- package/dist/lib/plugins/openapi/processors/removePaths.js.map +1 -0
- package/dist/lib/plugins/openapi/processors/removePaths.test.js.map +1 -0
- package/dist/lib/plugins/openapi/processors/traverse.js.map +1 -0
- package/dist/lib/ui/Callout.js +1 -1
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Form.d.ts +1 -1
- package/dist/lib/util/MdxComponents.d.ts +1 -0
- package/dist/lib/util/MdxComponents.js +2 -0
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/detectOS.d.ts +1 -0
- package/dist/lib/util/detectOS.js +11 -0
- package/dist/lib/util/detectOS.js.map +1 -0
- package/dist/vite/api/schema-codegen.js +8 -7
- package/dist/vite/api/schema-codegen.js.map +1 -1
- package/dist/vite/plugin-api.js +34 -13
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-sidebar.js +1 -1
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/prerender/prerender.js +6 -5
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/zuplo/with-zuplo-processors.js +3 -3
- package/dist/zuplo/with-zuplo-processors.js.map +1 -1
- package/dist/zuplo/with-zuplo.d.ts +1 -1
- package/lib/{AuthenticationPlugin-foqdvvkf.js → AuthenticationPlugin-CJOFRBk3.js} +4 -4
- package/lib/{AuthenticationPlugin-foqdvvkf.js.map → AuthenticationPlugin-CJOFRBk3.js.map} +1 -1
- package/lib/{Button-Fp19CMUr.js → Button-BBNrKpQd.js} +2 -2
- package/lib/{Button-Fp19CMUr.js.map → Button-BBNrKpQd.js.map} +1 -1
- package/lib/{Callout-B2vsR09t.js → Callout-D3Ja4OPX.js} +14 -13
- package/lib/{Callout-B2vsR09t.js.map → Callout-D3Ja4OPX.js.map} +1 -1
- package/lib/{CategoryHeading-DpB47wvk.js → CategoryHeading-D06WK_Wo.js} +2 -2
- package/lib/{CategoryHeading-DpB47wvk.js.map → CategoryHeading-D06WK_Wo.js.map} +1 -1
- package/lib/{Dialog-sbgekbjb.js → Dialog-ByYz4ABw.js} +2 -2
- package/lib/{Dialog-sbgekbjb.js.map → Dialog-ByYz4ABw.js.map} +1 -1
- package/lib/{Drawer-kDAfOq_2.js → Drawer-CEwbkLDb.js} +2 -2
- package/lib/Drawer-CEwbkLDb.js.map +1 -0
- package/lib/{Markdown-aF5FdsNi.js → Markdown-C5h6bxbE.js} +4239 -4073
- package/lib/Markdown-C5h6bxbE.js.map +1 -0
- package/lib/{MdxPage-Vw_dc9Yz.js → MdxPage-B66ht0D_.js} +9 -9
- package/lib/{MdxPage-Vw_dc9Yz.js.map → MdxPage-B66ht0D_.js.map} +1 -1
- package/lib/{OasProvider-CjXTP-nz.js → OasProvider-BKPF0Pbt.js} +6 -6
- package/lib/{OasProvider-CjXTP-nz.js.map → OasProvider-BKPF0Pbt.js.map} +1 -1
- package/lib/{OperationList-BYemrDYk.js → OperationList-0bhBU7ME.js} +121 -120
- package/lib/OperationList-0bhBU7ME.js.map +1 -0
- package/lib/{Pagination-SdlocK96.js → Pagination-Bt1czAiJ.js} +4 -4
- package/lib/{Pagination-SdlocK96.js.map → Pagination-Bt1czAiJ.js.map} +1 -1
- package/lib/{RouteGuard-CqZPoZYJ.js → RouteGuard-BZ_VsiXc.js} +6 -6
- package/lib/{RouteGuard-CqZPoZYJ.js.map → RouteGuard-BZ_VsiXc.js.map} +1 -1
- package/lib/{SchemaList-CAeKy9pV.js → SchemaList-CsTIT1pi.js} +10 -10
- package/lib/{SchemaList-CAeKy9pV.js.map → SchemaList-CsTIT1pi.js.map} +1 -1
- package/lib/{SchemaView-B3fOPR4V.js → SchemaView-DCSWtnYr.js} +5 -5
- package/lib/{SchemaView-B3fOPR4V.js.map → SchemaView-DCSWtnYr.js.map} +1 -1
- package/lib/{Select-DVFRKf1R.js → Select-Dg5R11Dx.js} +4 -4
- package/lib/{Select-DVFRKf1R.js.map → Select-Dg5R11Dx.js.map} +1 -1
- package/lib/{SlotletProvider-DXvc0aY6.js → SlotletProvider-VUmTNmLZ.js} +41 -39
- package/lib/SlotletProvider-VUmTNmLZ.js.map +1 -0
- package/lib/{Spinner-CE68iCm0.js → Spinner-mNLZ6awP.js} +2 -2
- package/lib/{Spinner-CE68iCm0.js.map → Spinner-mNLZ6awP.js.map} +1 -1
- package/lib/{SyntaxHighlight-BEoSoPEo.js → SyntaxHighlight-CxhyyMkF.js} +6 -6
- package/lib/{SyntaxHighlight-BEoSoPEo.js.map → SyntaxHighlight-CxhyyMkF.js.map} +1 -1
- package/lib/{Toc-YBsgI72s.js → Toc-BK39DQvI.js} +3 -3
- package/lib/{Toc-YBsgI72s.js.map → Toc-BK39DQvI.js.map} +1 -1
- package/lib/{_commonjsHelpers-BkfeUUK-.js → _commonjsHelpers-B4e78b8K.js} +2 -2
- package/lib/_commonjsHelpers-B4e78b8K.js.map +1 -0
- package/lib/{chunk-HA7DTUK3-C4gP41vD.js → chunk-KNED5TY2-BUPjb3LQ.js} +314 -313
- package/lib/chunk-KNED5TY2-BUPjb3LQ.js.map +1 -0
- package/lib/{context-DLCwaMXN.js → context-Lrf2Y9bR.js} +2 -2
- package/lib/{context-DLCwaMXN.js.map → context-Lrf2Y9bR.js.map} +1 -1
- package/lib/{createServer-mYvGvmc0.js → createServer-DLN7APz_.js} +5381 -5517
- package/lib/createServer-DLN7APz_.js.map +1 -0
- package/lib/{hook-CqpVYDqN.js → hook-pPrHCB6G.js} +460 -465
- package/lib/hook-pPrHCB6G.js.map +1 -0
- package/lib/{index-C1OzjGUK.js → index-Ba_X7EnR.js} +16 -16
- package/lib/{index-C1OzjGUK.js.map → index-Ba_X7EnR.js.map} +1 -1
- package/lib/index-CuBIgTKC.js +316 -0
- package/lib/index-CuBIgTKC.js.map +1 -0
- package/lib/{index-Dl3Yl0yb.js → index-DcHeSvkE.js} +51 -38
- package/lib/index-DcHeSvkE.js.map +1 -0
- package/lib/index-DwT-v3zK.js.map +1 -1
- package/lib/{index-D48iOQvJ.js → index-tpbiZmWp.js} +586 -543
- package/lib/index-tpbiZmWp.js.map +1 -0
- package/lib/index.esm-D2ZUREQN.js +1216 -0
- package/lib/index.esm-D2ZUREQN.js.map +1 -0
- package/lib/jsx-runtime-C5mzlN2N.js +285 -0
- package/lib/jsx-runtime-C5mzlN2N.js.map +1 -0
- package/lib/{mutation-8LjrN7uz.js → mutation-Csa9eQDM.js} +70 -67
- package/lib/mutation-Csa9eQDM.js.map +1 -0
- package/lib/{prism-csharp.min-bQAo2pmx.js → prism-csharp.min-C43x1RY2.js} +2 -2
- package/lib/{prism-csharp.min-bQAo2pmx.js.map → prism-csharp.min-C43x1RY2.js.map} +1 -1
- package/lib/{prism-java.min-BpvsOuIa.js → prism-java.min-CQzr40NQ.js} +2 -2
- package/lib/{prism-java.min-BpvsOuIa.js.map → prism-java.min-CQzr40NQ.js.map} +1 -1
- package/lib/{prism-ruby.min-Dx9KO9ds.js → prism-ruby.min-L9OdQ6tU.js} +2 -2
- package/lib/{prism-ruby.min-Dx9KO9ds.js.map → prism-ruby.min-L9OdQ6tU.js.map} +1 -1
- package/lib/{prism-typescript.min-CD7H2IYQ.js → prism-typescript.min-qTySPvCh.js} +2 -2
- package/lib/{prism-typescript.min-CD7H2IYQ.js.map → prism-typescript.min-qTySPvCh.js.map} +1 -1
- package/lib/processors/removeExtensions.js.map +1 -0
- package/lib/processors/removeParameters.js.map +1 -0
- package/lib/processors/removePaths.js.map +1 -0
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +3 -3
- package/lib/ui/Alert.js +1 -1
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +1 -1
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +1 -1
- package/lib/ui/Callout.js +10 -9
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +207 -207
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +1 -1
- package/lib/ui/Command.js +3 -3
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/Form.js +2 -2
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Label.js +1 -1
- package/lib/ui/Pagination.js +1 -1
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Stepper.js +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +2 -2
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +1 -1
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Tooltip.js +1 -1
- package/lib/{useExposedProps-B9qXJedG.js → useExposedProps-Dq2yUQIG.js} +2 -2
- package/lib/{useExposedProps-B9qXJedG.js.map → useExposedProps-Dq2yUQIG.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +4 -4
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +5 -5
- package/lib/zudoku.components.js +7 -7
- package/lib/zudoku.hooks.js +1 -1
- package/lib/zudoku.icons.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +6 -6
- package/lib/zudoku.plugin-api-keys.js +6 -6
- package/lib/zudoku.plugin-custom-pages.js +3 -3
- package/lib/zudoku.plugin-markdown.js +2 -2
- package/lib/zudoku.plugin-openapi.js +4 -4
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +7 -7
- package/package.json +62 -63
- package/src/app/entry.client.tsx +2 -0
- package/src/app/main.css +8 -2
- package/src/lib/authentication/providers/clerk.tsx +2 -2
- package/src/lib/components/Footer.tsx +6 -3
- package/src/lib/components/Layout.tsx +8 -1
- package/src/lib/components/Search.tsx +14 -3
- package/src/lib/components/navigation/Sidebar.tsx +8 -1
- package/src/lib/components/navigation/SidebarWrapper.tsx +1 -1
- package/src/lib/ui/Callout.tsx +1 -0
- package/src/lib/util/MdxComponents.tsx +2 -0
- package/src/lib/util/detectOS.ts +9 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +0 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +0 -1
- package/dist/lib/plugins/openapi/post-processors/removeParameters.js.map +0 -1
- package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js.map +0 -1
- package/dist/lib/plugins/openapi/post-processors/removePaths.js.map +0 -1
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.js.map +0 -1
- package/dist/lib/plugins/openapi/post-processors/traverse.js.map +0 -1
- package/lib/Drawer-kDAfOq_2.js.map +0 -1
- package/lib/Markdown-aF5FdsNi.js.map +0 -1
- package/lib/OperationList-BYemrDYk.js.map +0 -1
- package/lib/SlotletProvider-DXvc0aY6.js.map +0 -1
- package/lib/_commonjsHelpers-BkfeUUK-.js.map +0 -1
- package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +0 -1
- package/lib/createServer-mYvGvmc0.js.map +0 -1
- package/lib/hook-CqpVYDqN.js.map +0 -1
- package/lib/index-D48iOQvJ.js.map +0 -1
- package/lib/index-Dl3Yl0yb.js.map +0 -1
- package/lib/index-gQD2h1wX.js +0 -447
- package/lib/index-gQD2h1wX.js.map +0 -1
- package/lib/index.esm--gIChbWs.js +0 -1207
- package/lib/index.esm--gIChbWs.js.map +0 -1
- package/lib/jsx-runtime-CYK1ROHF.js +0 -446
- package/lib/jsx-runtime-CYK1ROHF.js.map +0 -1
- package/lib/mutation-8LjrN7uz.js.map +0 -1
- package/lib/post-processors/removeExtensions.js.map +0 -1
- package/lib/post-processors/removeParameters.js.map +0 -1
- package/lib/post-processors/removePaths.js.map +0 -1
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removeExtensions.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removeExtensions.js +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removeExtensions.test.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removeExtensions.test.js +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removeParameters.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removeParameters.js +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removeParameters.test.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removeParameters.test.js +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removePaths.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removePaths.js +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removePaths.test.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/removePaths.test.js +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/traverse.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{post-processors → processors}/traverse.js +0 -0
- /package/lib/{post-processors → processors}/removeExtensions.js +0 -0
- /package/lib/{post-processors → processors}/removeParameters.js +0 -0
- /package/lib/{post-processors → processors}/removePaths.js +0 -0
- /package/lib/{post-processors → processors}/traverse.js +0 -0
- /package/lib/{post-processors → processors}/traverse.js.map +0 -0
- /package/src/lib/plugins/openapi/{post-processors → processors}/removeExtensions.test.ts +0 -0
- /package/src/lib/plugins/openapi/{post-processors → processors}/removeExtensions.ts +0 -0
- /package/src/lib/plugins/openapi/{post-processors → processors}/removeParameters.test.ts +0 -0
- /package/src/lib/plugins/openapi/{post-processors → processors}/removeParameters.ts +0 -0
- /package/src/lib/plugins/openapi/{post-processors → processors}/removePaths.test.ts +0 -0
- /package/src/lib/plugins/openapi/{post-processors → processors}/removePaths.ts +0 -0
- /package/src/lib/plugins/openapi/{post-processors → processors}/traverse.ts +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var $e = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var n = (t, e, s) => (
|
|
4
|
+
var be = (t, e, s) => e.has(t) || $e("Cannot " + s);
|
|
5
|
+
var n = (t, e, s) => (be(t, e, "read from private field"), s ? s.call(t) : e.get(t)), b = (t, e, s) => e.has(t) ? $e("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), f = (t, e, s, r) => (be(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), w = (t, e, s) => (be(t, e, "access private method"), s);
|
|
6
6
|
import * as j from "react";
|
|
7
7
|
import Ge, { createContext as Et, useContext as Ct } from "react";
|
|
8
|
-
import { j as Ot } from "./jsx-runtime-
|
|
9
|
-
import { u as
|
|
10
|
-
var
|
|
8
|
+
import { j as Ot } from "./jsx-runtime-C5mzlN2N.js";
|
|
9
|
+
import { u as me, m as ze } from "./chunk-KNED5TY2-BUPjb3LQ.js";
|
|
10
|
+
var Qe = class {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
13
13
|
}
|
|
@@ -23,10 +23,10 @@ var qe = class {
|
|
|
23
23
|
}
|
|
24
24
|
onUnsubscribe() {
|
|
25
25
|
}
|
|
26
|
-
},
|
|
26
|
+
}, J = typeof window > "u" || "Deno" in globalThis;
|
|
27
27
|
function Se() {
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function gs(t, e) {
|
|
30
30
|
return typeof t == "function" ? t(e) : t;
|
|
31
31
|
}
|
|
32
32
|
function we(t) {
|
|
@@ -35,26 +35,26 @@ function we(t) {
|
|
|
35
35
|
function ot(t, e) {
|
|
36
36
|
return Math.max(t + (e || 0) - Date.now(), 0);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function pe(t, e) {
|
|
39
39
|
return typeof t == "function" ? t(e) : t;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function k(t, e) {
|
|
42
42
|
return typeof t == "function" ? t(e) : t;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ss(t, e) {
|
|
45
45
|
const {
|
|
46
46
|
type: s = "all",
|
|
47
47
|
exact: r,
|
|
48
48
|
fetchStatus: i,
|
|
49
49
|
predicate: a,
|
|
50
|
-
queryKey:
|
|
51
|
-
stale:
|
|
50
|
+
queryKey: o,
|
|
51
|
+
stale: u
|
|
52
52
|
} = t;
|
|
53
|
-
if (
|
|
53
|
+
if (o) {
|
|
54
54
|
if (r) {
|
|
55
|
-
if (e.queryHash !==
|
|
55
|
+
if (e.queryHash !== Ft(o, e.options))
|
|
56
56
|
return !1;
|
|
57
|
-
} else if (!
|
|
57
|
+
} else if (!Ne(e.queryKey, o))
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
60
|
if (s !== "all") {
|
|
@@ -62,9 +62,9 @@ function ms(t, e) {
|
|
|
62
62
|
if (s === "active" && !l || s === "inactive" && l)
|
|
63
63
|
return !1;
|
|
64
64
|
}
|
|
65
|
-
return !(typeof
|
|
65
|
+
return !(typeof u == "boolean" && e.isStale() !== u || i && i !== e.state.fetchStatus || a && !a(e));
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function ws(t, e) {
|
|
68
68
|
const { exact: s, status: r, predicate: i, mutationKey: a } = t;
|
|
69
69
|
if (a) {
|
|
70
70
|
if (!e.options.mutationKey)
|
|
@@ -72,12 +72,12 @@ function gs(t, e) {
|
|
|
72
72
|
if (s) {
|
|
73
73
|
if (Re(e.options.mutationKey) !== Re(a))
|
|
74
74
|
return !1;
|
|
75
|
-
} else if (!
|
|
75
|
+
} else if (!Ne(e.options.mutationKey, a))
|
|
76
76
|
return !1;
|
|
77
77
|
}
|
|
78
78
|
return !(r && e.state.status !== r || i && !i(e));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function Ft(t, e) {
|
|
81
81
|
return ((e == null ? void 0 : e.queryKeyHashFn) || Re)(t);
|
|
82
82
|
}
|
|
83
83
|
function Re(t) {
|
|
@@ -86,21 +86,21 @@ function Re(t) {
|
|
|
86
86
|
(e, s) => Oe(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ?
|
|
89
|
+
function Ne(t, e) {
|
|
90
|
+
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => Ne(t[s], e[s])) : !1;
|
|
91
91
|
}
|
|
92
92
|
function Ee(t, e) {
|
|
93
93
|
if (t === e)
|
|
94
94
|
return t;
|
|
95
|
-
const s =
|
|
95
|
+
const s = Ve(t) && Ve(e);
|
|
96
96
|
if (s || Oe(t) && Oe(e)) {
|
|
97
|
-
const r = s ? t : Object.keys(t), i = r.length, a = s ? e : Object.keys(e),
|
|
97
|
+
const r = s ? t : Object.keys(t), i = r.length, a = s ? e : Object.keys(e), o = a.length, u = s ? [] : {};
|
|
98
98
|
let l = 0;
|
|
99
|
-
for (let
|
|
100
|
-
const
|
|
101
|
-
(!s && r.includes(
|
|
99
|
+
for (let y = 0; y < o; y++) {
|
|
100
|
+
const g = s ? y : a[y];
|
|
101
|
+
(!s && r.includes(g) || s) && t[g] === void 0 && e[g] === void 0 ? (u[g] = void 0, l++) : (u[g] = Ee(t[g], e[g]), u[g] === t[g] && t[g] !== void 0 && l++);
|
|
102
102
|
}
|
|
103
|
-
return i ===
|
|
103
|
+
return i === o && l === i ? t : u;
|
|
104
104
|
}
|
|
105
105
|
return e;
|
|
106
106
|
}
|
|
@@ -112,27 +112,27 @@ function Ce(t, e) {
|
|
|
112
112
|
return !1;
|
|
113
113
|
return !0;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Ve(t) {
|
|
116
116
|
return Array.isArray(t) && t.length === Object.keys(t).length;
|
|
117
117
|
}
|
|
118
118
|
function Oe(t) {
|
|
119
|
-
if (!
|
|
119
|
+
if (!Je(t))
|
|
120
120
|
return !1;
|
|
121
121
|
const e = t.constructor;
|
|
122
122
|
if (e === void 0)
|
|
123
123
|
return !0;
|
|
124
124
|
const s = e.prototype;
|
|
125
|
-
return !(!
|
|
125
|
+
return !(!Je(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Je(t) {
|
|
128
128
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function It(t) {
|
|
131
131
|
return new Promise((e) => {
|
|
132
132
|
setTimeout(e, t);
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Fe(t, e, s) {
|
|
136
136
|
if (typeof s.structuralSharing == "function")
|
|
137
137
|
return s.structuralSharing(t, e);
|
|
138
138
|
if (s.structuralSharing !== !1) {
|
|
@@ -140,39 +140,39 @@ function Ie(t, e, s) {
|
|
|
140
140
|
try {
|
|
141
141
|
return Ee(t, e);
|
|
142
142
|
} catch (r) {
|
|
143
|
-
console.error(
|
|
143
|
+
throw console.error(
|
|
144
144
|
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`
|
|
145
|
-
);
|
|
145
|
+
), r;
|
|
146
146
|
}
|
|
147
147
|
return Ee(t, e);
|
|
148
148
|
}
|
|
149
149
|
return e;
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function Rs(t) {
|
|
152
152
|
return t;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function Es(t, e, s = 0) {
|
|
155
155
|
const r = [...t, e];
|
|
156
156
|
return s && r.length > s ? r.slice(1) : r;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Cs(t, e, s = 0) {
|
|
159
159
|
const r = [e, ...t];
|
|
160
160
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
161
161
|
}
|
|
162
|
-
var
|
|
162
|
+
var ve = Symbol();
|
|
163
163
|
function Pt(t, e) {
|
|
164
|
-
return process.env.NODE_ENV !== "production" && t.queryFn ===
|
|
164
|
+
return process.env.NODE_ENV !== "production" && t.queryFn === ve && console.error(
|
|
165
165
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
|
|
166
|
-
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn ===
|
|
166
|
+
), !t.queryFn && (e != null && e.initialPromise) ? () => e.initialPromise : !t.queryFn || t.queryFn === ve ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
|
|
167
167
|
}
|
|
168
|
-
var H,
|
|
168
|
+
var H, Q, Y, st, Tt = (st = class extends Qe {
|
|
169
169
|
constructor() {
|
|
170
170
|
super();
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (!
|
|
171
|
+
b(this, H);
|
|
172
|
+
b(this, Q);
|
|
173
|
+
b(this, Y);
|
|
174
|
+
f(this, Y, (e) => {
|
|
175
|
+
if (!J && window.addEventListener) {
|
|
176
176
|
const s = () => e();
|
|
177
177
|
return window.addEventListener("visibilitychange", s, !1), () => {
|
|
178
178
|
window.removeEventListener("visibilitychange", s);
|
|
@@ -181,20 +181,20 @@ var H, L, X, st, Tt = (st = class extends qe {
|
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
onSubscribe() {
|
|
184
|
-
n(this,
|
|
184
|
+
n(this, Q) || this.setEventListener(n(this, Y));
|
|
185
185
|
}
|
|
186
186
|
onUnsubscribe() {
|
|
187
187
|
var e;
|
|
188
|
-
this.hasListeners() || ((e = n(this,
|
|
188
|
+
this.hasListeners() || ((e = n(this, Q)) == null || e.call(this), f(this, Q, void 0));
|
|
189
189
|
}
|
|
190
190
|
setEventListener(e) {
|
|
191
191
|
var s;
|
|
192
|
-
|
|
192
|
+
f(this, Y, e), (s = n(this, Q)) == null || s.call(this), f(this, Q, e((r) => {
|
|
193
193
|
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
|
|
194
194
|
}));
|
|
195
195
|
}
|
|
196
196
|
setFocused(e) {
|
|
197
|
-
n(this, H) !== e && (
|
|
197
|
+
n(this, H) !== e && (f(this, H, e), this.onFocus());
|
|
198
198
|
}
|
|
199
199
|
onFocus() {
|
|
200
200
|
const e = this.isFocused();
|
|
@@ -206,14 +206,14 @@ var H, L, X, st, Tt = (st = class extends qe {
|
|
|
206
206
|
var e;
|
|
207
207
|
return typeof n(this, H) == "boolean" ? n(this, H) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
|
|
208
208
|
}
|
|
209
|
-
}, H = new WeakMap(),
|
|
209
|
+
}, H = new WeakMap(), Q = new WeakMap(), Y = new WeakMap(), st), ut = new Tt(), X, N, ee, rt, Dt = (rt = class extends Qe {
|
|
210
210
|
constructor() {
|
|
211
211
|
super();
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
if (!
|
|
212
|
+
b(this, X, !0);
|
|
213
|
+
b(this, N);
|
|
214
|
+
b(this, ee);
|
|
215
|
+
f(this, ee, (e) => {
|
|
216
|
+
if (!J && window.addEventListener) {
|
|
217
217
|
const s = () => e(!0), r = () => e(!1);
|
|
218
218
|
return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
|
|
219
219
|
window.removeEventListener("online", s), window.removeEventListener("offline", r);
|
|
@@ -222,26 +222,26 @@ var H, L, X, st, Tt = (st = class extends qe {
|
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
onSubscribe() {
|
|
225
|
-
n(this,
|
|
225
|
+
n(this, N) || this.setEventListener(n(this, ee));
|
|
226
226
|
}
|
|
227
227
|
onUnsubscribe() {
|
|
228
228
|
var e;
|
|
229
|
-
this.hasListeners() || ((e = n(this,
|
|
229
|
+
this.hasListeners() || ((e = n(this, N)) == null || e.call(this), f(this, N, void 0));
|
|
230
230
|
}
|
|
231
231
|
setEventListener(e) {
|
|
232
232
|
var s;
|
|
233
|
-
|
|
233
|
+
f(this, ee, e), (s = n(this, N)) == null || s.call(this), f(this, N, e(this.setOnline.bind(this)));
|
|
234
234
|
}
|
|
235
235
|
setOnline(e) {
|
|
236
|
-
n(this,
|
|
236
|
+
n(this, X) !== e && (f(this, X, e), this.listeners.forEach((r) => {
|
|
237
237
|
r(e);
|
|
238
238
|
}));
|
|
239
239
|
}
|
|
240
240
|
isOnline() {
|
|
241
|
-
return n(this,
|
|
241
|
+
return n(this, X);
|
|
242
242
|
}
|
|
243
|
-
},
|
|
244
|
-
function
|
|
243
|
+
}, X = new WeakMap(), N = new WeakMap(), ee = new WeakMap(), rt), ct = new Dt();
|
|
244
|
+
function Ie() {
|
|
245
245
|
let t, e;
|
|
246
246
|
const s = new Promise((i, a) => {
|
|
247
247
|
t = i, e = a;
|
|
@@ -279,98 +279,99 @@ function ge(t) {
|
|
|
279
279
|
}
|
|
280
280
|
function At(t) {
|
|
281
281
|
let e = !1, s = 0, r = !1, i;
|
|
282
|
-
const a =
|
|
282
|
+
const a = Ie(), o = (h) => {
|
|
283
283
|
var v;
|
|
284
284
|
r || (p(new lt(h)), (v = t.abort) == null || v.call(t));
|
|
285
|
-
},
|
|
285
|
+
}, u = () => {
|
|
286
286
|
e = !0;
|
|
287
287
|
}, l = () => {
|
|
288
288
|
e = !1;
|
|
289
|
-
},
|
|
289
|
+
}, y = () => ut.isFocused() && (t.networkMode === "always" || ct.isOnline()) && t.canRun(), g = () => ht(t.networkMode) && t.canRun(), c = (h) => {
|
|
290
290
|
var v;
|
|
291
291
|
r || (r = !0, (v = t.onSuccess) == null || v.call(t, h), i == null || i(), a.resolve(h));
|
|
292
292
|
}, p = (h) => {
|
|
293
293
|
var v;
|
|
294
294
|
r || (r = !0, (v = t.onError) == null || v.call(t, h), i == null || i(), a.reject(h));
|
|
295
|
-
},
|
|
295
|
+
}, d = () => new Promise((h) => {
|
|
296
296
|
var v;
|
|
297
|
-
i = (
|
|
298
|
-
(r ||
|
|
297
|
+
i = (C) => {
|
|
298
|
+
(r || y()) && h(C);
|
|
299
299
|
}, (v = t.onPause) == null || v.call(t);
|
|
300
300
|
}).then(() => {
|
|
301
301
|
var h;
|
|
302
302
|
i = void 0, r || (h = t.onContinue) == null || h.call(t);
|
|
303
|
-
}),
|
|
303
|
+
}), E = () => {
|
|
304
304
|
if (r)
|
|
305
305
|
return;
|
|
306
306
|
let h;
|
|
307
307
|
const v = s === 0 ? t.initialPromise : void 0;
|
|
308
308
|
try {
|
|
309
309
|
h = v ?? t.fn();
|
|
310
|
-
} catch (
|
|
311
|
-
h = Promise.reject(
|
|
310
|
+
} catch (C) {
|
|
311
|
+
h = Promise.reject(C);
|
|
312
312
|
}
|
|
313
|
-
Promise.resolve(h).then(c).catch((
|
|
314
|
-
var
|
|
313
|
+
Promise.resolve(h).then(c).catch((C) => {
|
|
314
|
+
var oe;
|
|
315
315
|
if (r)
|
|
316
316
|
return;
|
|
317
|
-
const R = t.retry ?? (
|
|
317
|
+
const R = t.retry ?? (J ? 0 : 3), O = t.retryDelay ?? jt, q = typeof O == "function" ? O(s, C) : O, Z = R === !0 || typeof R == "number" && s < R || typeof R == "function" && R(s, C);
|
|
318
318
|
if (e || !Z) {
|
|
319
|
-
p(
|
|
319
|
+
p(C);
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
|
-
s++, (
|
|
323
|
-
e ? p(
|
|
322
|
+
s++, (oe = t.onFail) == null || oe.call(t, s, C), It(q).then(() => y() ? void 0 : d()).then(() => {
|
|
323
|
+
e ? p(C) : E();
|
|
324
324
|
});
|
|
325
325
|
});
|
|
326
326
|
};
|
|
327
327
|
return {
|
|
328
328
|
promise: a,
|
|
329
|
-
cancel:
|
|
329
|
+
cancel: o,
|
|
330
330
|
continue: () => (i == null || i(), a),
|
|
331
|
-
cancelRetry:
|
|
331
|
+
cancelRetry: u,
|
|
332
332
|
continueRetry: l,
|
|
333
|
-
canStart:
|
|
334
|
-
start: () => (
|
|
333
|
+
canStart: g,
|
|
334
|
+
start: () => (g() ? E() : d().then(E), a)
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
+
var kt = (t) => setTimeout(t, 0);
|
|
337
338
|
function xt() {
|
|
338
|
-
let t = [], e = 0, s = (
|
|
339
|
-
|
|
340
|
-
}, r = (
|
|
341
|
-
|
|
342
|
-
}, i =
|
|
343
|
-
const a = (
|
|
344
|
-
e ? t.push(
|
|
345
|
-
s(
|
|
339
|
+
let t = [], e = 0, s = (u) => {
|
|
340
|
+
u();
|
|
341
|
+
}, r = (u) => {
|
|
342
|
+
u();
|
|
343
|
+
}, i = kt;
|
|
344
|
+
const a = (u) => {
|
|
345
|
+
e ? t.push(u) : i(() => {
|
|
346
|
+
s(u);
|
|
346
347
|
});
|
|
347
|
-
},
|
|
348
|
-
const
|
|
349
|
-
t = [],
|
|
348
|
+
}, o = () => {
|
|
349
|
+
const u = t;
|
|
350
|
+
t = [], u.length && i(() => {
|
|
350
351
|
r(() => {
|
|
351
|
-
|
|
352
|
+
u.forEach((l) => {
|
|
352
353
|
s(l);
|
|
353
354
|
});
|
|
354
355
|
});
|
|
355
356
|
});
|
|
356
357
|
};
|
|
357
358
|
return {
|
|
358
|
-
batch: (
|
|
359
|
+
batch: (u) => {
|
|
359
360
|
let l;
|
|
360
361
|
e++;
|
|
361
362
|
try {
|
|
362
|
-
l =
|
|
363
|
+
l = u();
|
|
363
364
|
} finally {
|
|
364
|
-
e--, e ||
|
|
365
|
+
e--, e || o();
|
|
365
366
|
}
|
|
366
367
|
return l;
|
|
367
368
|
},
|
|
368
369
|
/**
|
|
369
370
|
* All calls to the wrapped function will be batched.
|
|
370
371
|
*/
|
|
371
|
-
batchCalls: (
|
|
372
|
+
batchCalls: (u) => (...l) => {
|
|
372
373
|
a(() => {
|
|
373
|
-
|
|
374
|
+
u(...l);
|
|
374
375
|
});
|
|
375
376
|
},
|
|
376
377
|
schedule: a,
|
|
@@ -378,61 +379,61 @@ function xt() {
|
|
|
378
379
|
* Use this method to set a custom notify function.
|
|
379
380
|
* This can be used to for example wrap notifications with `React.act` while running tests.
|
|
380
381
|
*/
|
|
381
|
-
setNotifyFunction: (
|
|
382
|
-
s =
|
|
382
|
+
setNotifyFunction: (u) => {
|
|
383
|
+
s = u;
|
|
383
384
|
},
|
|
384
385
|
/**
|
|
385
386
|
* Use this method to set a custom function to batch notifications together into a single tick.
|
|
386
387
|
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
387
388
|
*/
|
|
388
|
-
setBatchNotifyFunction: (
|
|
389
|
-
r =
|
|
389
|
+
setBatchNotifyFunction: (u) => {
|
|
390
|
+
r = u;
|
|
390
391
|
},
|
|
391
|
-
setScheduler: (
|
|
392
|
-
i =
|
|
392
|
+
setScheduler: (u) => {
|
|
393
|
+
i = u;
|
|
393
394
|
}
|
|
394
395
|
};
|
|
395
396
|
}
|
|
396
|
-
var
|
|
397
|
+
var Le = xt(), K, nt, qt = (nt = class {
|
|
397
398
|
constructor() {
|
|
398
|
-
|
|
399
|
+
b(this, K);
|
|
399
400
|
}
|
|
400
401
|
destroy() {
|
|
401
402
|
this.clearGcTimeout();
|
|
402
403
|
}
|
|
403
404
|
scheduleGc() {
|
|
404
|
-
this.clearGcTimeout(), we(this.gcTime) &&
|
|
405
|
+
this.clearGcTimeout(), we(this.gcTime) && f(this, K, setTimeout(() => {
|
|
405
406
|
this.optionalRemove();
|
|
406
407
|
}, this.gcTime));
|
|
407
408
|
}
|
|
408
409
|
updateGcTime(t) {
|
|
409
410
|
this.gcTime = Math.max(
|
|
410
411
|
this.gcTime || 0,
|
|
411
|
-
t ?? (
|
|
412
|
+
t ?? (J ? 1 / 0 : 5 * 60 * 1e3)
|
|
412
413
|
);
|
|
413
414
|
}
|
|
414
415
|
clearGcTimeout() {
|
|
415
|
-
n(this, K) && (clearTimeout(n(this, K)),
|
|
416
|
+
n(this, K) && (clearTimeout(n(this, K)), f(this, K, void 0));
|
|
416
417
|
}
|
|
417
|
-
}, K = new WeakMap(), nt),
|
|
418
|
+
}, K = new WeakMap(), nt), te, se, D, B, F, he, $, A, U, it, Os = (it = class extends qt {
|
|
418
419
|
constructor(e) {
|
|
419
420
|
super();
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
421
|
+
b(this, A);
|
|
422
|
+
b(this, te);
|
|
423
|
+
b(this, se);
|
|
424
|
+
b(this, D);
|
|
425
|
+
b(this, B);
|
|
426
|
+
b(this, F);
|
|
427
|
+
b(this, he);
|
|
428
|
+
b(this, $);
|
|
429
|
+
f(this, $, !1), f(this, he, e.defaultOptions), this.setOptions(e.options), this.observers = [], f(this, B, e.client), f(this, D, n(this, B).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, f(this, te, Ut(this.options)), this.state = e.state ?? n(this, te), this.scheduleGc();
|
|
429
430
|
}
|
|
430
431
|
get meta() {
|
|
431
432
|
return this.options.meta;
|
|
432
433
|
}
|
|
433
434
|
get promise() {
|
|
434
435
|
var e;
|
|
435
|
-
return (e = n(this,
|
|
436
|
+
return (e = n(this, F)) == null ? void 0 : e.promise;
|
|
436
437
|
}
|
|
437
438
|
setOptions(e) {
|
|
438
439
|
this.options = { ...n(this, he), ...e }, this.updateGcTime(this.options.gcTime);
|
|
@@ -441,8 +442,8 @@ var Me = xt(), K, nt, kt = (nt = class {
|
|
|
441
442
|
!this.observers.length && this.state.fetchStatus === "idle" && n(this, D).remove(this);
|
|
442
443
|
}
|
|
443
444
|
setData(e, s) {
|
|
444
|
-
const r =
|
|
445
|
-
return w(this, A,
|
|
445
|
+
const r = Fe(this.state.data, e, this.options);
|
|
446
|
+
return w(this, A, U).call(this, {
|
|
446
447
|
data: r,
|
|
447
448
|
type: "success",
|
|
448
449
|
dataUpdatedAt: s == null ? void 0 : s.updatedAt,
|
|
@@ -450,26 +451,26 @@ var Me = xt(), K, nt, kt = (nt = class {
|
|
|
450
451
|
}), r;
|
|
451
452
|
}
|
|
452
453
|
setState(e, s) {
|
|
453
|
-
w(this, A,
|
|
454
|
+
w(this, A, U).call(this, { type: "setState", state: e, setStateOptions: s });
|
|
454
455
|
}
|
|
455
456
|
cancel(e) {
|
|
456
457
|
var r, i;
|
|
457
|
-
const s = (r = n(this,
|
|
458
|
-
return (i = n(this,
|
|
458
|
+
const s = (r = n(this, F)) == null ? void 0 : r.promise;
|
|
459
|
+
return (i = n(this, F)) == null || i.cancel(e), s ? s.then(Se).catch(Se) : Promise.resolve();
|
|
459
460
|
}
|
|
460
461
|
destroy() {
|
|
461
462
|
super.destroy(), this.cancel({ silent: !0 });
|
|
462
463
|
}
|
|
463
464
|
reset() {
|
|
464
|
-
this.destroy(), this.setState(n(this,
|
|
465
|
+
this.destroy(), this.setState(n(this, te));
|
|
465
466
|
}
|
|
466
467
|
isActive() {
|
|
467
468
|
return this.observers.some(
|
|
468
|
-
(e) =>
|
|
469
|
+
(e) => k(e.options.enabled, this) !== !1
|
|
469
470
|
);
|
|
470
471
|
}
|
|
471
472
|
isDisabled() {
|
|
472
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
473
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === ve || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
473
474
|
}
|
|
474
475
|
isStale() {
|
|
475
476
|
return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
|
|
@@ -482,32 +483,32 @@ var Me = xt(), K, nt, kt = (nt = class {
|
|
|
482
483
|
onFocus() {
|
|
483
484
|
var s;
|
|
484
485
|
const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
|
|
485
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this,
|
|
486
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, F)) == null || s.continue();
|
|
486
487
|
}
|
|
487
488
|
onOnline() {
|
|
488
489
|
var s;
|
|
489
490
|
const e = this.observers.find((r) => r.shouldFetchOnReconnect());
|
|
490
|
-
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this,
|
|
491
|
+
e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, F)) == null || s.continue();
|
|
491
492
|
}
|
|
492
493
|
addObserver(e) {
|
|
493
494
|
this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), n(this, D).notify({ type: "observerAdded", query: this, observer: e }));
|
|
494
495
|
}
|
|
495
496
|
removeObserver(e) {
|
|
496
|
-
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (n(this,
|
|
497
|
+
this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (n(this, F) && (n(this, $) ? n(this, F).cancel({ revert: !0 }) : n(this, F).cancelRetry()), this.scheduleGc()), n(this, D).notify({ type: "observerRemoved", query: this, observer: e }));
|
|
497
498
|
}
|
|
498
499
|
getObserversCount() {
|
|
499
500
|
return this.observers.length;
|
|
500
501
|
}
|
|
501
502
|
invalidate() {
|
|
502
|
-
this.state.isInvalidated || w(this, A,
|
|
503
|
+
this.state.isInvalidated || w(this, A, U).call(this, { type: "invalidate" });
|
|
503
504
|
}
|
|
504
505
|
fetch(e, s) {
|
|
505
|
-
var l,
|
|
506
|
+
var l, y, g;
|
|
506
507
|
if (this.state.fetchStatus !== "idle") {
|
|
507
508
|
if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
|
|
508
509
|
this.cancel({ silent: !0 });
|
|
509
|
-
else if (n(this,
|
|
510
|
-
return n(this,
|
|
510
|
+
else if (n(this, F))
|
|
511
|
+
return n(this, F).continueRetry(), n(this, F).promise;
|
|
511
512
|
}
|
|
512
513
|
if (e && this.setOptions(e), !this.options.queryFn) {
|
|
513
514
|
const c = this.observers.find((p) => p.options.queryFn);
|
|
@@ -519,7 +520,7 @@ var Me = xt(), K, nt, kt = (nt = class {
|
|
|
519
520
|
const r = new AbortController(), i = (c) => {
|
|
520
521
|
Object.defineProperty(c, "signal", {
|
|
521
522
|
enumerable: !0,
|
|
522
|
-
get: () => (
|
|
523
|
+
get: () => (f(this, $, !0), r.signal)
|
|
523
524
|
});
|
|
524
525
|
}, a = () => {
|
|
525
526
|
const c = Pt(this.options, s), p = {
|
|
@@ -527,12 +528,12 @@ var Me = xt(), K, nt, kt = (nt = class {
|
|
|
527
528
|
queryKey: this.queryKey,
|
|
528
529
|
meta: this.meta
|
|
529
530
|
};
|
|
530
|
-
return i(p),
|
|
531
|
+
return i(p), f(this, $, !1), this.options.persister ? this.options.persister(
|
|
531
532
|
c,
|
|
532
533
|
p,
|
|
533
534
|
this
|
|
534
535
|
) : c(p);
|
|
535
|
-
},
|
|
536
|
+
}, o = {
|
|
536
537
|
fetchOptions: s,
|
|
537
538
|
options: this.options,
|
|
538
539
|
queryKey: this.queryKey,
|
|
@@ -540,68 +541,68 @@ var Me = xt(), K, nt, kt = (nt = class {
|
|
|
540
541
|
state: this.state,
|
|
541
542
|
fetchFn: a
|
|
542
543
|
};
|
|
543
|
-
i(
|
|
544
|
-
|
|
544
|
+
i(o), (l = this.options.behavior) == null || l.onFetch(
|
|
545
|
+
o,
|
|
545
546
|
this
|
|
546
|
-
),
|
|
547
|
-
const
|
|
548
|
-
var p,
|
|
549
|
-
ge(c) && c.silent || w(this, A,
|
|
547
|
+
), f(this, se, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((y = o.fetchOptions) == null ? void 0 : y.meta)) && w(this, A, U).call(this, { type: "fetch", meta: (g = o.fetchOptions) == null ? void 0 : g.meta });
|
|
548
|
+
const u = (c) => {
|
|
549
|
+
var p, d, E, h;
|
|
550
|
+
ge(c) && c.silent || w(this, A, U).call(this, {
|
|
550
551
|
type: "error",
|
|
551
552
|
error: c
|
|
552
|
-
}), ge(c) || ((
|
|
553
|
+
}), ge(c) || ((d = (p = n(this, D).config).onError) == null || d.call(
|
|
553
554
|
p,
|
|
554
555
|
c,
|
|
555
556
|
this
|
|
556
|
-
), (h = (
|
|
557
|
-
|
|
557
|
+
), (h = (E = n(this, D).config).onSettled) == null || h.call(
|
|
558
|
+
E,
|
|
558
559
|
this.state.data,
|
|
559
560
|
c,
|
|
560
561
|
this
|
|
561
562
|
)), this.scheduleGc();
|
|
562
563
|
};
|
|
563
|
-
return
|
|
564
|
+
return f(this, F, At({
|
|
564
565
|
initialPromise: s == null ? void 0 : s.initialPromise,
|
|
565
|
-
fn:
|
|
566
|
+
fn: o.fetchFn,
|
|
566
567
|
abort: r.abort.bind(r),
|
|
567
568
|
onSuccess: (c) => {
|
|
568
|
-
var p,
|
|
569
|
+
var p, d, E, h;
|
|
569
570
|
if (c === void 0) {
|
|
570
571
|
process.env.NODE_ENV !== "production" && console.error(
|
|
571
572
|
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
572
|
-
),
|
|
573
|
+
), u(new Error(`${this.queryHash} data is undefined`));
|
|
573
574
|
return;
|
|
574
575
|
}
|
|
575
576
|
try {
|
|
576
577
|
this.setData(c);
|
|
577
578
|
} catch (v) {
|
|
578
|
-
|
|
579
|
+
u(v);
|
|
579
580
|
return;
|
|
580
581
|
}
|
|
581
|
-
(
|
|
582
|
-
|
|
582
|
+
(d = (p = n(this, D).config).onSuccess) == null || d.call(p, c, this), (h = (E = n(this, D).config).onSettled) == null || h.call(
|
|
583
|
+
E,
|
|
583
584
|
c,
|
|
584
585
|
this.state.error,
|
|
585
586
|
this
|
|
586
587
|
), this.scheduleGc();
|
|
587
588
|
},
|
|
588
|
-
onError:
|
|
589
|
+
onError: u,
|
|
589
590
|
onFail: (c, p) => {
|
|
590
|
-
w(this, A,
|
|
591
|
+
w(this, A, U).call(this, { type: "failed", failureCount: c, error: p });
|
|
591
592
|
},
|
|
592
593
|
onPause: () => {
|
|
593
|
-
w(this, A,
|
|
594
|
+
w(this, A, U).call(this, { type: "pause" });
|
|
594
595
|
},
|
|
595
596
|
onContinue: () => {
|
|
596
|
-
w(this, A,
|
|
597
|
+
w(this, A, U).call(this, { type: "continue" });
|
|
597
598
|
},
|
|
598
|
-
retry:
|
|
599
|
-
retryDelay:
|
|
600
|
-
networkMode:
|
|
599
|
+
retry: o.options.retry,
|
|
600
|
+
retryDelay: o.options.retryDelay,
|
|
601
|
+
networkMode: o.options.networkMode,
|
|
601
602
|
canRun: () => !0
|
|
602
|
-
})), n(this,
|
|
603
|
+
})), n(this, F).start();
|
|
603
604
|
}
|
|
604
|
-
},
|
|
605
|
+
}, te = new WeakMap(), se = new WeakMap(), D = new WeakMap(), B = new WeakMap(), F = new WeakMap(), he = new WeakMap(), $ = new WeakMap(), A = new WeakSet(), U = function(e) {
|
|
605
606
|
const s = (r) => {
|
|
606
607
|
switch (e.type) {
|
|
607
608
|
case "failed":
|
|
@@ -643,7 +644,7 @@ var Me = xt(), K, nt, kt = (nt = class {
|
|
|
643
644
|
};
|
|
644
645
|
case "error":
|
|
645
646
|
const i = e.error;
|
|
646
|
-
return ge(i) && i.revert && n(this,
|
|
647
|
+
return ge(i) && i.revert && n(this, se) ? { ...n(this, se), fetchStatus: "idle" } : {
|
|
647
648
|
...r,
|
|
648
649
|
error: i,
|
|
649
650
|
errorUpdateCount: r.errorUpdateCount + 1,
|
|
@@ -665,7 +666,7 @@ var Me = xt(), K, nt, kt = (nt = class {
|
|
|
665
666
|
};
|
|
666
667
|
}
|
|
667
668
|
};
|
|
668
|
-
this.state = s(this.state),
|
|
669
|
+
this.state = s(this.state), Le.batch(() => {
|
|
669
670
|
this.observers.forEach((r) => {
|
|
670
671
|
r.onQueryUpdate();
|
|
671
672
|
}), n(this, D).notify({ query: this, type: "updated", action: e });
|
|
@@ -699,28 +700,28 @@ function Ut(t) {
|
|
|
699
700
|
fetchStatus: "idle"
|
|
700
701
|
};
|
|
701
702
|
}
|
|
702
|
-
var
|
|
703
|
+
var P, m, le, I, G, re, L, M, de, ne, ie, z, V, _, ae, S, ue, Pe, Te, De, je, Ae, ke, xe, yt, at, ft = (at = class extends Qe {
|
|
703
704
|
constructor(e, s) {
|
|
704
705
|
super();
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
706
|
+
b(this, S);
|
|
707
|
+
b(this, P);
|
|
708
|
+
b(this, m);
|
|
709
|
+
b(this, le);
|
|
710
|
+
b(this, I);
|
|
711
|
+
b(this, G);
|
|
712
|
+
b(this, re);
|
|
713
|
+
b(this, L);
|
|
714
|
+
b(this, M);
|
|
715
|
+
b(this, de);
|
|
716
|
+
b(this, ne);
|
|
716
717
|
// This property keeps track of the last query with defined data.
|
|
717
718
|
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
this.options = s,
|
|
719
|
+
b(this, ie);
|
|
720
|
+
b(this, z);
|
|
721
|
+
b(this, V);
|
|
722
|
+
b(this, _);
|
|
723
|
+
b(this, ae, /* @__PURE__ */ new Set());
|
|
724
|
+
this.options = s, f(this, P, e), f(this, M, null), f(this, L, Ie()), this.options.experimental_prefetchInRender || n(this, L).reject(
|
|
724
725
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
725
726
|
), this.bindMethods(), this.setOptions(s);
|
|
726
727
|
}
|
|
@@ -728,55 +729,55 @@ var T, b, le, P, G, ne, N, U, de, ie, ae, z, J, _, oe, S, ue, Pe, Te, De, je, Ae
|
|
|
728
729
|
this.refetch = this.refetch.bind(this);
|
|
729
730
|
}
|
|
730
731
|
onSubscribe() {
|
|
731
|
-
this.listeners.size === 1 && (n(this,
|
|
732
|
+
this.listeners.size === 1 && (n(this, m).addObserver(this), Ze(n(this, m), this.options) ? w(this, S, ue).call(this) : this.updateResult(), w(this, S, je).call(this));
|
|
732
733
|
}
|
|
733
734
|
onUnsubscribe() {
|
|
734
735
|
this.hasListeners() || this.destroy();
|
|
735
736
|
}
|
|
736
737
|
shouldFetchOnReconnect() {
|
|
737
|
-
return
|
|
738
|
-
n(this,
|
|
738
|
+
return qe(
|
|
739
|
+
n(this, m),
|
|
739
740
|
this.options,
|
|
740
741
|
this.options.refetchOnReconnect
|
|
741
742
|
);
|
|
742
743
|
}
|
|
743
744
|
shouldFetchOnWindowFocus() {
|
|
744
|
-
return
|
|
745
|
-
n(this,
|
|
745
|
+
return qe(
|
|
746
|
+
n(this, m),
|
|
746
747
|
this.options,
|
|
747
748
|
this.options.refetchOnWindowFocus
|
|
748
749
|
);
|
|
749
750
|
}
|
|
750
751
|
destroy() {
|
|
751
|
-
this.listeners = /* @__PURE__ */ new Set(), w(this, S, Ae).call(this), w(this, S,
|
|
752
|
+
this.listeners = /* @__PURE__ */ new Set(), w(this, S, Ae).call(this), w(this, S, ke).call(this), n(this, m).removeObserver(this);
|
|
752
753
|
}
|
|
753
|
-
setOptions(e
|
|
754
|
-
const
|
|
755
|
-
if (this.options = n(this,
|
|
754
|
+
setOptions(e) {
|
|
755
|
+
const s = this.options, r = n(this, m);
|
|
756
|
+
if (this.options = n(this, P).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof k(this.options.enabled, n(this, m)) != "boolean")
|
|
756
757
|
throw new Error(
|
|
757
758
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
758
759
|
);
|
|
759
|
-
w(this, S,
|
|
760
|
+
w(this, S, xe).call(this), n(this, m).setOptions(this.options), s._defaulted && !Ce(this.options, s) && n(this, P).getQueryCache().notify({
|
|
760
761
|
type: "observerOptionsUpdated",
|
|
761
|
-
query: n(this,
|
|
762
|
+
query: n(this, m),
|
|
762
763
|
observer: this
|
|
763
764
|
});
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
n(this,
|
|
767
|
-
|
|
765
|
+
const i = this.hasListeners();
|
|
766
|
+
i && We(
|
|
767
|
+
n(this, m),
|
|
768
|
+
r,
|
|
768
769
|
this.options,
|
|
769
|
-
|
|
770
|
-
) && w(this, S, ue).call(this), this.updateResult(
|
|
771
|
-
const
|
|
772
|
-
|
|
770
|
+
s
|
|
771
|
+
) && w(this, S, ue).call(this), this.updateResult(), i && (n(this, m) !== r || k(this.options.enabled, n(this, m)) !== k(s.enabled, n(this, m)) || pe(this.options.staleTime, n(this, m)) !== pe(s.staleTime, n(this, m))) && w(this, S, Pe).call(this);
|
|
772
|
+
const a = w(this, S, Te).call(this);
|
|
773
|
+
i && (n(this, m) !== r || k(this.options.enabled, n(this, m)) !== k(s.enabled, n(this, m)) || a !== n(this, _)) && w(this, S, De).call(this, a);
|
|
773
774
|
}
|
|
774
775
|
getOptimisticResult(e) {
|
|
775
|
-
const s = n(this,
|
|
776
|
-
return
|
|
776
|
+
const s = n(this, P).getQueryCache().build(n(this, P), e), r = this.createResult(s, e);
|
|
777
|
+
return Nt(this, r) && (f(this, I, r), f(this, re, this.options), f(this, G, n(this, m).state)), r;
|
|
777
778
|
}
|
|
778
779
|
getCurrentResult() {
|
|
779
|
-
return n(this,
|
|
780
|
+
return n(this, I);
|
|
780
781
|
}
|
|
781
782
|
trackResult(e, s) {
|
|
782
783
|
const r = {};
|
|
@@ -789,10 +790,10 @@ var T, b, le, P, G, ne, N, U, de, ie, ae, z, J, _, oe, S, ue, Pe, Te, De, je, Ae
|
|
|
789
790
|
}), r;
|
|
790
791
|
}
|
|
791
792
|
trackProp(e) {
|
|
792
|
-
n(this,
|
|
793
|
+
n(this, ae).add(e);
|
|
793
794
|
}
|
|
794
795
|
getCurrentQuery() {
|
|
795
|
-
return n(this,
|
|
796
|
+
return n(this, m);
|
|
796
797
|
}
|
|
797
798
|
refetch({ ...e } = {}) {
|
|
798
799
|
return this.fetch({
|
|
@@ -800,197 +801,189 @@ var T, b, le, P, G, ne, N, U, de, ie, ae, z, J, _, oe, S, ue, Pe, Te, De, je, Ae
|
|
|
800
801
|
});
|
|
801
802
|
}
|
|
802
803
|
fetchOptimistic(e) {
|
|
803
|
-
const s = n(this,
|
|
804
|
+
const s = n(this, P).defaultQueryOptions(e), r = n(this, P).getQueryCache().build(n(this, P), s);
|
|
804
805
|
return r.fetch().then(() => this.createResult(r, s));
|
|
805
806
|
}
|
|
806
807
|
fetch(e) {
|
|
807
808
|
return w(this, S, ue).call(this, {
|
|
808
809
|
...e,
|
|
809
810
|
cancelRefetch: e.cancelRefetch ?? !0
|
|
810
|
-
}).then(() => (this.updateResult(), n(this,
|
|
811
|
+
}).then(() => (this.updateResult(), n(this, I)));
|
|
811
812
|
}
|
|
812
813
|
createResult(e, s) {
|
|
813
814
|
var Be;
|
|
814
|
-
const r = n(this,
|
|
815
|
-
let c = { ...
|
|
815
|
+
const r = n(this, m), i = this.options, a = n(this, I), o = n(this, G), u = n(this, re), y = e !== r ? e.state : n(this, le), { state: g } = e;
|
|
816
|
+
let c = { ...g }, p = !1, d;
|
|
816
817
|
if (s._optimisticResults) {
|
|
817
|
-
const
|
|
818
|
-
(
|
|
818
|
+
const T = this.hasListeners(), fe = !T && Ze(e, s), W = T && We(e, r, s, i);
|
|
819
|
+
(fe || W) && (c = {
|
|
819
820
|
...c,
|
|
820
|
-
...dt(
|
|
821
|
+
...dt(g.data, e.options)
|
|
821
822
|
}), s._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
|
|
822
823
|
}
|
|
823
|
-
let { error:
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
}
|
|
833
|
-
else
|
|
834
|
-
y = c.data;
|
|
835
|
-
if (s.placeholderData !== void 0 && y === void 0 && v === "pending") {
|
|
836
|
-
let F;
|
|
837
|
-
if (a != null && a.isPlaceholderData && s.placeholderData === (o == null ? void 0 : o.placeholderData))
|
|
838
|
-
F = a.data;
|
|
839
|
-
else if (F = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
840
|
-
(Be = n(this, ae)) == null ? void 0 : Be.state.data,
|
|
841
|
-
n(this, ae)
|
|
842
|
-
) : s.placeholderData, s.select && F !== void 0)
|
|
843
|
-
try {
|
|
844
|
-
F = s.select(F), d(this, U, null);
|
|
845
|
-
} catch (W) {
|
|
846
|
-
d(this, U, W);
|
|
847
|
-
}
|
|
848
|
-
F !== void 0 && (v = "success", y = Ie(
|
|
824
|
+
let { error: E, errorUpdatedAt: h, status: v } = c;
|
|
825
|
+
d = c.data;
|
|
826
|
+
let C = !1;
|
|
827
|
+
if (s.placeholderData !== void 0 && d === void 0 && v === "pending") {
|
|
828
|
+
let T;
|
|
829
|
+
a != null && a.isPlaceholderData && s.placeholderData === (u == null ? void 0 : u.placeholderData) ? (T = a.data, C = !0) : T = typeof s.placeholderData == "function" ? s.placeholderData(
|
|
830
|
+
(Be = n(this, ie)) == null ? void 0 : Be.state.data,
|
|
831
|
+
n(this, ie)
|
|
832
|
+
) : s.placeholderData, T !== void 0 && (v = "success", d = Fe(
|
|
849
833
|
a == null ? void 0 : a.data,
|
|
850
|
-
|
|
834
|
+
T,
|
|
851
835
|
s
|
|
852
836
|
), p = !0);
|
|
853
837
|
}
|
|
854
|
-
|
|
855
|
-
|
|
838
|
+
if (s.select && d !== void 0 && !C)
|
|
839
|
+
if (a && d === (o == null ? void 0 : o.data) && s.select === n(this, de))
|
|
840
|
+
d = n(this, ne);
|
|
841
|
+
else
|
|
842
|
+
try {
|
|
843
|
+
f(this, de, s.select), d = s.select(d), d = Fe(a == null ? void 0 : a.data, d, s), f(this, ne, d), f(this, M, null);
|
|
844
|
+
} catch (T) {
|
|
845
|
+
f(this, M, T);
|
|
846
|
+
}
|
|
847
|
+
n(this, M) && (E = n(this, M), d = n(this, ne), h = Date.now(), v = "error");
|
|
848
|
+
const R = c.fetchStatus === "fetching", O = v === "pending", q = v === "error", Z = O && R, oe = d !== void 0, x = {
|
|
856
849
|
status: v,
|
|
857
850
|
fetchStatus: c.fetchStatus,
|
|
858
|
-
isPending:
|
|
851
|
+
isPending: O,
|
|
859
852
|
isSuccess: v === "success",
|
|
860
|
-
isError:
|
|
861
|
-
isInitialLoading:
|
|
862
|
-
isLoading:
|
|
863
|
-
data:
|
|
853
|
+
isError: q,
|
|
854
|
+
isInitialLoading: Z,
|
|
855
|
+
isLoading: Z,
|
|
856
|
+
data: d,
|
|
864
857
|
dataUpdatedAt: c.dataUpdatedAt,
|
|
865
|
-
error:
|
|
858
|
+
error: E,
|
|
866
859
|
errorUpdatedAt: h,
|
|
867
860
|
failureCount: c.fetchFailureCount,
|
|
868
861
|
failureReason: c.fetchFailureReason,
|
|
869
862
|
errorUpdateCount: c.errorUpdateCount,
|
|
870
863
|
isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
|
|
871
|
-
isFetchedAfterMount: c.dataUpdateCount >
|
|
872
|
-
isFetching:
|
|
873
|
-
isRefetching:
|
|
874
|
-
isLoadingError:
|
|
864
|
+
isFetchedAfterMount: c.dataUpdateCount > y.dataUpdateCount || c.errorUpdateCount > y.errorUpdateCount,
|
|
865
|
+
isFetching: R,
|
|
866
|
+
isRefetching: R && !O,
|
|
867
|
+
isLoadingError: q && !oe,
|
|
875
868
|
isPaused: c.fetchStatus === "paused",
|
|
876
869
|
isPlaceholderData: p,
|
|
877
|
-
isRefetchError:
|
|
878
|
-
isStale:
|
|
870
|
+
isRefetchError: q && oe,
|
|
871
|
+
isStale: Me(e, s),
|
|
879
872
|
refetch: this.refetch,
|
|
880
|
-
promise: n(this,
|
|
873
|
+
promise: n(this, L)
|
|
881
874
|
};
|
|
882
875
|
if (this.options.experimental_prefetchInRender) {
|
|
883
|
-
const
|
|
884
|
-
|
|
885
|
-
},
|
|
886
|
-
const
|
|
887
|
-
|
|
888
|
-
},
|
|
889
|
-
switch (
|
|
876
|
+
const T = (ye) => {
|
|
877
|
+
x.status === "error" ? ye.reject(x.error) : x.data !== void 0 && ye.resolve(x.data);
|
|
878
|
+
}, fe = () => {
|
|
879
|
+
const ye = f(this, L, x.promise = Ie());
|
|
880
|
+
T(ye);
|
|
881
|
+
}, W = n(this, L);
|
|
882
|
+
switch (W.status) {
|
|
890
883
|
case "pending":
|
|
891
|
-
e.queryHash === r.queryHash &&
|
|
884
|
+
e.queryHash === r.queryHash && T(W);
|
|
892
885
|
break;
|
|
893
886
|
case "fulfilled":
|
|
894
|
-
(
|
|
887
|
+
(x.status === "error" || x.data !== W.value) && fe();
|
|
895
888
|
break;
|
|
896
889
|
case "rejected":
|
|
897
|
-
(
|
|
890
|
+
(x.status !== "error" || x.error !== W.reason) && fe();
|
|
898
891
|
break;
|
|
899
892
|
}
|
|
900
893
|
}
|
|
901
|
-
return
|
|
894
|
+
return x;
|
|
902
895
|
}
|
|
903
|
-
updateResult(
|
|
904
|
-
const
|
|
905
|
-
if (
|
|
896
|
+
updateResult() {
|
|
897
|
+
const e = n(this, I), s = this.createResult(n(this, m), this.options);
|
|
898
|
+
if (f(this, G, n(this, m).state), f(this, re, this.options), n(this, G).data !== void 0 && f(this, ie, n(this, m)), Ce(s, e))
|
|
906
899
|
return;
|
|
907
|
-
|
|
908
|
-
const
|
|
909
|
-
if (!
|
|
900
|
+
f(this, I, s);
|
|
901
|
+
const r = () => {
|
|
902
|
+
if (!e)
|
|
910
903
|
return !0;
|
|
911
|
-
const { notifyOnChangeProps:
|
|
912
|
-
if (
|
|
904
|
+
const { notifyOnChangeProps: i } = this.options, a = typeof i == "function" ? i() : i;
|
|
905
|
+
if (a === "all" || !a && !n(this, ae).size)
|
|
913
906
|
return !0;
|
|
914
|
-
const
|
|
915
|
-
|
|
907
|
+
const o = new Set(
|
|
908
|
+
a ?? n(this, ae)
|
|
916
909
|
);
|
|
917
|
-
return this.options.throwOnError &&
|
|
918
|
-
const
|
|
919
|
-
return n(this,
|
|
910
|
+
return this.options.throwOnError && o.add("error"), Object.keys(n(this, I)).some((u) => {
|
|
911
|
+
const l = u;
|
|
912
|
+
return n(this, I)[l] !== e[l] && o.has(l);
|
|
920
913
|
});
|
|
921
914
|
};
|
|
922
|
-
|
|
915
|
+
w(this, S, yt).call(this, { listeners: r() });
|
|
923
916
|
}
|
|
924
917
|
onQueryUpdate() {
|
|
925
918
|
this.updateResult(), this.hasListeners() && w(this, S, je).call(this);
|
|
926
919
|
}
|
|
927
|
-
},
|
|
928
|
-
w(this, S,
|
|
929
|
-
let s = n(this,
|
|
920
|
+
}, P = new WeakMap(), m = new WeakMap(), le = new WeakMap(), I = new WeakMap(), G = new WeakMap(), re = new WeakMap(), L = new WeakMap(), M = new WeakMap(), de = new WeakMap(), ne = new WeakMap(), ie = new WeakMap(), z = new WeakMap(), V = new WeakMap(), _ = new WeakMap(), ae = new WeakMap(), S = new WeakSet(), ue = function(e) {
|
|
921
|
+
w(this, S, xe).call(this);
|
|
922
|
+
let s = n(this, m).fetch(
|
|
930
923
|
this.options,
|
|
931
924
|
e
|
|
932
925
|
);
|
|
933
926
|
return e != null && e.throwOnError || (s = s.catch(Se)), s;
|
|
934
927
|
}, Pe = function() {
|
|
935
928
|
w(this, S, Ae).call(this);
|
|
936
|
-
const e =
|
|
929
|
+
const e = pe(
|
|
937
930
|
this.options.staleTime,
|
|
938
|
-
n(this,
|
|
931
|
+
n(this, m)
|
|
939
932
|
);
|
|
940
|
-
if (
|
|
933
|
+
if (J || n(this, I).isStale || !we(e))
|
|
941
934
|
return;
|
|
942
|
-
const r = ot(n(this,
|
|
943
|
-
|
|
944
|
-
n(this,
|
|
935
|
+
const r = ot(n(this, I).dataUpdatedAt, e) + 1;
|
|
936
|
+
f(this, z, setTimeout(() => {
|
|
937
|
+
n(this, I).isStale || this.updateResult();
|
|
945
938
|
}, r));
|
|
946
939
|
}, Te = function() {
|
|
947
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(n(this,
|
|
940
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(n(this, m)) : this.options.refetchInterval) ?? !1;
|
|
948
941
|
}, De = function(e) {
|
|
949
|
-
w(this, S,
|
|
942
|
+
w(this, S, ke).call(this), f(this, _, e), !(J || k(this.options.enabled, n(this, m)) === !1 || !we(n(this, _)) || n(this, _) === 0) && f(this, V, setInterval(() => {
|
|
950
943
|
(this.options.refetchIntervalInBackground || ut.isFocused()) && w(this, S, ue).call(this);
|
|
951
944
|
}, n(this, _)));
|
|
952
945
|
}, je = function() {
|
|
953
946
|
w(this, S, Pe).call(this), w(this, S, De).call(this, w(this, S, Te).call(this));
|
|
954
947
|
}, Ae = function() {
|
|
955
|
-
n(this, z) && (clearTimeout(n(this, z)),
|
|
956
|
-
}, xe = function() {
|
|
957
|
-
n(this, J) && (clearInterval(n(this, J)), d(this, J, void 0));
|
|
948
|
+
n(this, z) && (clearTimeout(n(this, z)), f(this, z, void 0));
|
|
958
949
|
}, ke = function() {
|
|
959
|
-
|
|
960
|
-
|
|
950
|
+
n(this, V) && (clearInterval(n(this, V)), f(this, V, void 0));
|
|
951
|
+
}, xe = function() {
|
|
952
|
+
const e = n(this, P).getQueryCache().build(n(this, P), this.options);
|
|
953
|
+
if (e === n(this, m))
|
|
961
954
|
return;
|
|
962
|
-
const s = n(this,
|
|
963
|
-
|
|
955
|
+
const s = n(this, m);
|
|
956
|
+
f(this, m, e), f(this, le, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
|
|
964
957
|
}, yt = function(e) {
|
|
965
|
-
|
|
958
|
+
Le.batch(() => {
|
|
966
959
|
e.listeners && this.listeners.forEach((s) => {
|
|
967
|
-
s(n(this,
|
|
968
|
-
}), n(this,
|
|
969
|
-
query: n(this,
|
|
960
|
+
s(n(this, I));
|
|
961
|
+
}), n(this, P).getQueryCache().notify({
|
|
962
|
+
query: n(this, m),
|
|
970
963
|
type: "observerResultsUpdated"
|
|
971
964
|
});
|
|
972
965
|
});
|
|
973
966
|
}, at);
|
|
974
967
|
function Qt(t, e) {
|
|
975
|
-
return
|
|
968
|
+
return k(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
|
|
976
969
|
}
|
|
977
970
|
function Ze(t, e) {
|
|
978
|
-
return Qt(t, e) || t.state.data !== void 0 &&
|
|
971
|
+
return Qt(t, e) || t.state.data !== void 0 && qe(t, e, e.refetchOnMount);
|
|
979
972
|
}
|
|
980
|
-
function
|
|
981
|
-
if (
|
|
973
|
+
function qe(t, e, s) {
|
|
974
|
+
if (k(e.enabled, t) !== !1) {
|
|
982
975
|
const r = typeof s == "function" ? s(t) : s;
|
|
983
|
-
return r === "always" || r !== !1 &&
|
|
976
|
+
return r === "always" || r !== !1 && Me(t, e);
|
|
984
977
|
}
|
|
985
978
|
return !1;
|
|
986
979
|
}
|
|
987
980
|
function We(t, e, s, r) {
|
|
988
|
-
return (t !== e ||
|
|
981
|
+
return (t !== e || k(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Me(t, s);
|
|
989
982
|
}
|
|
990
|
-
function
|
|
991
|
-
return
|
|
983
|
+
function Me(t, e) {
|
|
984
|
+
return k(e.enabled, t) !== !1 && t.isStaleByTime(pe(e.staleTime, t));
|
|
992
985
|
}
|
|
993
|
-
function
|
|
986
|
+
function Nt(t, e) {
|
|
994
987
|
return !Ce(t.getCurrentResult(), e);
|
|
995
988
|
}
|
|
996
989
|
var pt = j.createContext(
|
|
@@ -1002,13 +995,13 @@ var pt = j.createContext(
|
|
|
1002
995
|
if (!e)
|
|
1003
996
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1004
997
|
return e;
|
|
1005
|
-
},
|
|
998
|
+
}, Fs = ({
|
|
1006
999
|
client: t,
|
|
1007
1000
|
children: e
|
|
1008
1001
|
}) => (j.useEffect(() => (t.mount(), () => {
|
|
1009
1002
|
t.unmount();
|
|
1010
|
-
}), [t]), /* @__PURE__ */ Ot.jsx(pt.Provider, { value: t, children: e })),
|
|
1011
|
-
|
|
1003
|
+
}), [t]), /* @__PURE__ */ Ot.jsx(pt.Provider, { value: t, children: e })), mt = j.createContext(!1), Lt = () => j.useContext(mt);
|
|
1004
|
+
mt.Provider;
|
|
1012
1005
|
function Mt() {
|
|
1013
1006
|
let t = !1;
|
|
1014
1007
|
return {
|
|
@@ -1021,128 +1014,130 @@ function Mt() {
|
|
|
1021
1014
|
isReset: () => t
|
|
1022
1015
|
};
|
|
1023
1016
|
}
|
|
1024
|
-
var
|
|
1025
|
-
function
|
|
1017
|
+
var _t = j.createContext(Mt()), Ht = () => j.useContext(_t);
|
|
1018
|
+
function Kt(t, e) {
|
|
1026
1019
|
return typeof t == "function" ? t(...e) : !!t;
|
|
1027
1020
|
}
|
|
1028
1021
|
function Ye() {
|
|
1029
1022
|
}
|
|
1030
|
-
var
|
|
1023
|
+
var Bt = (t, e) => {
|
|
1031
1024
|
(t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
|
|
1032
|
-
},
|
|
1025
|
+
}, $t = (t) => {
|
|
1033
1026
|
j.useEffect(() => {
|
|
1034
1027
|
t.clearReset();
|
|
1035
1028
|
}, [t]);
|
|
1036
|
-
},
|
|
1029
|
+
}, Gt = ({
|
|
1037
1030
|
result: t,
|
|
1038
1031
|
errorResetBoundary: e,
|
|
1039
1032
|
throwOnError: s,
|
|
1040
1033
|
query: r,
|
|
1041
1034
|
suspense: i
|
|
1042
|
-
}) => t.isError && !e.isReset() && !t.isFetching && r && (i && t.data === void 0 ||
|
|
1035
|
+
}) => t.isError && !e.isReset() && !t.isFetching && r && (i && t.data === void 0 || Kt(s, [t.error, r])), zt = (t, e) => e.state.data === void 0, Vt = (t) => {
|
|
1043
1036
|
const e = t.staleTime;
|
|
1044
1037
|
t.suspense && (t.staleTime = typeof e == "function" ? (...s) => Math.max(e(...s), 1e3) : Math.max(e ?? 1e3, 1e3), typeof t.gcTime == "number" && (t.gcTime = Math.max(t.gcTime, 1e3)));
|
|
1045
|
-
}, Jt = (t, e) => t.isLoading && t.isFetching && !e,
|
|
1038
|
+
}, Jt = (t, e) => t.isLoading && t.isFetching && !e, Zt = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, Xe = (t, e, s) => e.fetchOptimistic(t).catch(() => {
|
|
1046
1039
|
s.clearReset();
|
|
1047
1040
|
});
|
|
1048
|
-
function
|
|
1049
|
-
var c, p,
|
|
1041
|
+
function bt(t, e, s) {
|
|
1042
|
+
var c, p, d, E, h;
|
|
1050
1043
|
if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
|
|
1051
1044
|
throw new Error(
|
|
1052
1045
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
1053
1046
|
);
|
|
1054
|
-
const r = vt(s), i = Lt(), a =
|
|
1047
|
+
const r = vt(s), i = Lt(), a = Ht(), o = r.defaultQueryOptions(t);
|
|
1055
1048
|
(p = (c = r.getDefaultOptions().queries) == null ? void 0 : c._experimental_beforeQuery) == null || p.call(
|
|
1056
1049
|
c,
|
|
1057
|
-
|
|
1058
|
-
),
|
|
1059
|
-
|
|
1050
|
+
o
|
|
1051
|
+
), process.env.NODE_ENV !== "production" && (o.queryFn || console.error(
|
|
1052
|
+
`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
1053
|
+
)), o._optimisticResults = i ? "isRestoring" : "optimistic", Vt(o), Bt(o, a), $t(a);
|
|
1054
|
+
const u = !r.getQueryCache().get(o.queryHash), [l] = j.useState(
|
|
1060
1055
|
() => new e(
|
|
1061
1056
|
r,
|
|
1062
|
-
|
|
1057
|
+
o
|
|
1063
1058
|
)
|
|
1064
|
-
),
|
|
1059
|
+
), y = l.getOptimisticResult(o), g = !i && t.subscribed !== !1;
|
|
1065
1060
|
if (j.useSyncExternalStore(
|
|
1066
1061
|
j.useCallback(
|
|
1067
1062
|
(v) => {
|
|
1068
|
-
const
|
|
1069
|
-
return l.updateResult(),
|
|
1063
|
+
const C = g ? l.subscribe(Le.batchCalls(v)) : Ye;
|
|
1064
|
+
return l.updateResult(), C;
|
|
1070
1065
|
},
|
|
1071
|
-
[l,
|
|
1066
|
+
[l, g]
|
|
1072
1067
|
),
|
|
1073
1068
|
() => l.getCurrentResult(),
|
|
1074
1069
|
() => l.getCurrentResult()
|
|
1075
1070
|
), j.useEffect(() => {
|
|
1076
|
-
l.setOptions(
|
|
1077
|
-
}, [
|
|
1078
|
-
throw Xe(
|
|
1079
|
-
if (
|
|
1080
|
-
result:
|
|
1071
|
+
l.setOptions(o);
|
|
1072
|
+
}, [o, l]), Zt(o, y))
|
|
1073
|
+
throw Xe(o, l, a);
|
|
1074
|
+
if (Gt({
|
|
1075
|
+
result: y,
|
|
1081
1076
|
errorResetBoundary: a,
|
|
1082
|
-
throwOnError:
|
|
1083
|
-
query: r.getQueryCache().get(
|
|
1084
|
-
suspense:
|
|
1077
|
+
throwOnError: o.throwOnError,
|
|
1078
|
+
query: r.getQueryCache().get(o.queryHash),
|
|
1079
|
+
suspense: o.suspense
|
|
1085
1080
|
}))
|
|
1086
|
-
throw
|
|
1087
|
-
if ((
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
),
|
|
1092
|
-
const v =
|
|
1081
|
+
throw y.error;
|
|
1082
|
+
if ((E = (d = r.getDefaultOptions().queries) == null ? void 0 : d._experimental_afterQuery) == null || E.call(
|
|
1083
|
+
d,
|
|
1084
|
+
o,
|
|
1085
|
+
y
|
|
1086
|
+
), o.experimental_prefetchInRender && !J && Jt(y, i)) {
|
|
1087
|
+
const v = u ? (
|
|
1093
1088
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1094
|
-
Xe(
|
|
1089
|
+
Xe(o, l, a)
|
|
1095
1090
|
) : (
|
|
1096
1091
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1097
|
-
(h = r.getQueryCache().get(
|
|
1092
|
+
(h = r.getQueryCache().get(o.queryHash)) == null ? void 0 : h.promise
|
|
1098
1093
|
);
|
|
1099
1094
|
v == null || v.catch(Ye).finally(() => {
|
|
1100
1095
|
l.updateResult();
|
|
1101
1096
|
});
|
|
1102
1097
|
}
|
|
1103
|
-
return
|
|
1104
|
-
}
|
|
1105
|
-
function Zt(t, e) {
|
|
1106
|
-
return mt(t, ft, e);
|
|
1098
|
+
return o.notifyOnChangeProps ? y : l.trackResult(y);
|
|
1107
1099
|
}
|
|
1108
1100
|
function Wt(t, e) {
|
|
1109
|
-
return
|
|
1101
|
+
return bt(t, ft, e);
|
|
1102
|
+
}
|
|
1103
|
+
function Yt(t, e) {
|
|
1104
|
+
return process.env.NODE_ENV !== "production" && t.queryFn === ve && console.error("skipToken is not allowed for useSuspenseQuery"), bt(
|
|
1110
1105
|
{
|
|
1111
1106
|
...t,
|
|
1112
1107
|
enabled: !0,
|
|
1113
1108
|
suspense: !0,
|
|
1114
|
-
throwOnError:
|
|
1109
|
+
throwOnError: zt,
|
|
1115
1110
|
placeholderData: void 0
|
|
1116
1111
|
},
|
|
1117
1112
|
ft,
|
|
1118
1113
|
e
|
|
1119
1114
|
);
|
|
1120
1115
|
}
|
|
1121
|
-
const
|
|
1116
|
+
const Xt = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, es = (t) => t.filter(
|
|
1122
1117
|
(e) => e != null && e !== !1 && (typeof e == "string" || typeof e == "number")
|
|
1123
|
-
).map((e) => `${e}`).filter((e) => e),
|
|
1124
|
-
const e = t.join("/"), [, s = "", r = ""] = e.match(
|
|
1118
|
+
).map((e) => `${e}`).filter((e) => e), ts = (t) => {
|
|
1119
|
+
const e = t.join("/"), [, s = "", r = ""] = e.match(Xt) ?? [];
|
|
1125
1120
|
return {
|
|
1126
1121
|
prefix: s,
|
|
1127
1122
|
pathname: r.split("/").filter((i) => i !== "")
|
|
1128
1123
|
};
|
|
1129
|
-
},
|
|
1124
|
+
}, ss = (t) => {
|
|
1130
1125
|
const { prefix: e, pathname: s } = t;
|
|
1131
1126
|
let r = e;
|
|
1132
1127
|
return s.length > 0 ? (r ? r += "/" : r = "/", r += s.join("/")) : r || (r = "/"), r;
|
|
1133
1128
|
}, et = (...t) => {
|
|
1134
|
-
const e =
|
|
1135
|
-
return
|
|
1129
|
+
const e = es(t), s = ts(e);
|
|
1130
|
+
return ss(s);
|
|
1136
1131
|
}, gt = Object.freeze({
|
|
1137
1132
|
API_IDENTITIES: ["api-identities"]
|
|
1138
|
-
}),
|
|
1133
|
+
}), Is = () => {
|
|
1139
1134
|
const t = vt();
|
|
1140
1135
|
return {
|
|
1141
1136
|
invalidateCache: async (e) => {
|
|
1142
1137
|
await t.invalidateQueries({ queryKey: gt[e] });
|
|
1143
1138
|
}
|
|
1144
1139
|
};
|
|
1145
|
-
},
|
|
1140
|
+
}, rs = "no-dehydrate", ce = (...t) => {
|
|
1146
1141
|
const e = t.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
|
|
1147
1142
|
return e ? `/${e}` : "/";
|
|
1148
1143
|
}, _e = (t, e) => {
|
|
@@ -1161,74 +1156,74 @@ const Yt = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, Xt = (t) => t.filter(
|
|
|
1161
1156
|
]);
|
|
1162
1157
|
if (a !== void 0) return a;
|
|
1163
1158
|
}
|
|
1164
|
-
},
|
|
1165
|
-
const t =
|
|
1159
|
+
}, Ps = () => {
|
|
1160
|
+
const t = me(), s = St().sidebar;
|
|
1166
1161
|
return _e(s, (r) => {
|
|
1167
1162
|
if (r.type === "doc" && ce(r.id) === t.pathname)
|
|
1168
1163
|
return r;
|
|
1169
1164
|
});
|
|
1170
|
-
},
|
|
1171
|
-
const e =
|
|
1165
|
+
}, Ts = (t) => {
|
|
1166
|
+
const e = me();
|
|
1172
1167
|
return He(t, (s) => {
|
|
1173
1168
|
if (s.type === "category" && s.link && ce(s.link.id) === e.pathname || s.type === "doc" && ce(s.id) === e.pathname)
|
|
1174
1169
|
return !0;
|
|
1175
1170
|
});
|
|
1176
|
-
},
|
|
1177
|
-
const t =
|
|
1171
|
+
}, Ds = () => {
|
|
1172
|
+
const t = me().pathname, s = St().sidebar;
|
|
1178
1173
|
let r, i, a = !1;
|
|
1179
|
-
return _e(s, (
|
|
1180
|
-
const
|
|
1181
|
-
if (
|
|
1174
|
+
return _e(s, (o) => {
|
|
1175
|
+
const u = o.type === "doc" ? ce(o.id) : o.type === "category" && o.link ? ce(o.link.id) : void 0;
|
|
1176
|
+
if (u) {
|
|
1182
1177
|
if (a)
|
|
1183
|
-
return i = { label:
|
|
1184
|
-
t ===
|
|
1178
|
+
return i = { label: o.label, id: u }, !0;
|
|
1179
|
+
t === u ? a = !0 : r = { label: o.label, id: u };
|
|
1185
1180
|
}
|
|
1186
1181
|
}), { prev: r, next: i };
|
|
1187
|
-
},
|
|
1182
|
+
}, ns = Et(
|
|
1188
1183
|
void 0
|
|
1189
1184
|
), Ke = () => {
|
|
1190
|
-
const t = Ct(
|
|
1185
|
+
const t = Ct(ns);
|
|
1191
1186
|
if (!t)
|
|
1192
1187
|
throw new Error("useZudoku must be used within a ZudokuProvider.");
|
|
1193
1188
|
return t;
|
|
1194
|
-
},
|
|
1189
|
+
}, js = () => {
|
|
1195
1190
|
const { getApiIdentities: t } = Ke();
|
|
1196
|
-
return
|
|
1191
|
+
return Wt({
|
|
1197
1192
|
queryFn: t,
|
|
1198
1193
|
queryKey: gt.API_IDENTITIES
|
|
1199
1194
|
});
|
|
1200
1195
|
}, St = () => {
|
|
1201
1196
|
var c;
|
|
1202
|
-
const { getPluginSidebar: t, sidebars: e, topNavigation: s, options: r } = Ke(), i =
|
|
1197
|
+
const { getPluginSidebar: t, sidebars: e, topNavigation: s, options: r } = Ke(), i = me(), a = fs(), o = (c = r.protectedRoutes) == null ? void 0 : c.some(
|
|
1203
1198
|
(p) => ze(p, i.pathname)
|
|
1204
1199
|
);
|
|
1205
|
-
let
|
|
1206
|
-
if ((
|
|
1207
|
-
return
|
|
1200
|
+
let u = Object.entries(e).find(([, p]) => _e(p, (d) => {
|
|
1201
|
+
if ((d.type === "doc" ? et(d.id) : d.type === "category" && d.link ? et(d.link.id) : void 0) === i.pathname)
|
|
1202
|
+
return d;
|
|
1208
1203
|
}));
|
|
1209
|
-
const l = s.find((p) => p.id === (
|
|
1210
|
-
l && !
|
|
1211
|
-
const { data:
|
|
1204
|
+
const l = s.find((p) => p.id === (u == null ? void 0 : u[0])) ?? s.find((p) => ze(p.id, i.pathname));
|
|
1205
|
+
l && !u && l.id in e && (u = ["", e[l.id]]);
|
|
1206
|
+
const { data: y } = Yt({
|
|
1212
1207
|
queryFn: () => t(i.pathname),
|
|
1213
1208
|
// We just want to suspend here and don't store in SSR dehydrated state
|
|
1214
|
-
queryKey: ["plugin-sidebar",
|
|
1209
|
+
queryKey: ["plugin-sidebar", rs, i.pathname]
|
|
1215
1210
|
});
|
|
1216
1211
|
return {
|
|
1217
|
-
sidebar: a.isAuthEnabled && !a.isAuthenticated &&
|
|
1212
|
+
sidebar: a.isAuthEnabled && !a.isAuthenticated && o ? [] : [...u ? u[1] : [], ...y],
|
|
1218
1213
|
topNavItem: l
|
|
1219
1214
|
};
|
|
1220
1215
|
}, tt = (t) => {
|
|
1221
1216
|
let e;
|
|
1222
|
-
const s = /* @__PURE__ */ new Set(), r = (
|
|
1223
|
-
const c = typeof
|
|
1217
|
+
const s = /* @__PURE__ */ new Set(), r = (y, g) => {
|
|
1218
|
+
const c = typeof y == "function" ? y(e) : y;
|
|
1224
1219
|
if (!Object.is(c, e)) {
|
|
1225
1220
|
const p = e;
|
|
1226
|
-
e =
|
|
1221
|
+
e = g ?? (typeof c != "object" || c === null) ? c : Object.assign({}, e, c), s.forEach((d) => d(e, p));
|
|
1227
1222
|
}
|
|
1228
|
-
}, i = () => e,
|
|
1229
|
-
return
|
|
1230
|
-
},
|
|
1231
|
-
function
|
|
1223
|
+
}, i = () => e, u = { setState: r, getState: i, getInitialState: () => l, subscribe: (y) => (s.add(y), () => s.delete(y)) }, l = e = t(r, i, u);
|
|
1224
|
+
return u;
|
|
1225
|
+
}, is = (t) => t ? tt(t) : tt, as = (t) => t;
|
|
1226
|
+
function os(t, e = as) {
|
|
1232
1227
|
const s = Ge.useSyncExternalStore(
|
|
1233
1228
|
t.subscribe,
|
|
1234
1229
|
() => e(t.getState()),
|
|
@@ -1236,10 +1231,10 @@ function as(t, e = is) {
|
|
|
1236
1231
|
);
|
|
1237
1232
|
return Ge.useDebugValue(s), s;
|
|
1238
1233
|
}
|
|
1239
|
-
const
|
|
1240
|
-
const e =
|
|
1234
|
+
const us = (t) => {
|
|
1235
|
+
const e = is(t), s = (r) => os(e, r);
|
|
1241
1236
|
return Object.assign(s, e), s;
|
|
1242
|
-
},
|
|
1237
|
+
}, cs = (t) => us;
|
|
1243
1238
|
function wt(t, e) {
|
|
1244
1239
|
let s;
|
|
1245
1240
|
try {
|
|
@@ -1250,8 +1245,8 @@ function wt(t, e) {
|
|
|
1250
1245
|
return {
|
|
1251
1246
|
getItem: (i) => {
|
|
1252
1247
|
var a;
|
|
1253
|
-
const
|
|
1254
|
-
return
|
|
1248
|
+
const o = (l) => l === null ? null : JSON.parse(l, void 0), u = (a = s.getItem(i)) != null ? a : null;
|
|
1249
|
+
return u instanceof Promise ? u.then(o) : o(u);
|
|
1255
1250
|
},
|
|
1256
1251
|
setItem: (i, a) => s.setItem(
|
|
1257
1252
|
i,
|
|
@@ -1260,12 +1255,12 @@ function wt(t, e) {
|
|
|
1260
1255
|
removeItem: (i) => s.removeItem(i)
|
|
1261
1256
|
};
|
|
1262
1257
|
}
|
|
1263
|
-
const
|
|
1258
|
+
const Ue = (t) => (e) => {
|
|
1264
1259
|
try {
|
|
1265
1260
|
const s = t(e);
|
|
1266
1261
|
return s instanceof Promise ? s : {
|
|
1267
1262
|
then(r) {
|
|
1268
|
-
return
|
|
1263
|
+
return Ue(r)(s);
|
|
1269
1264
|
},
|
|
1270
1265
|
catch(r) {
|
|
1271
1266
|
return this;
|
|
@@ -1277,11 +1272,11 @@ const Qe = (t) => (e) => {
|
|
|
1277
1272
|
return this;
|
|
1278
1273
|
},
|
|
1279
1274
|
catch(r) {
|
|
1280
|
-
return
|
|
1275
|
+
return Ue(r)(s);
|
|
1281
1276
|
}
|
|
1282
1277
|
};
|
|
1283
1278
|
}
|
|
1284
|
-
},
|
|
1279
|
+
}, hs = (t, e) => (s, r, i) => {
|
|
1285
1280
|
let a = {
|
|
1286
1281
|
storage: wt(() => localStorage),
|
|
1287
1282
|
partialize: (h) => h,
|
|
@@ -1291,10 +1286,10 @@ const Qe = (t) => (e) => {
|
|
|
1291
1286
|
...h
|
|
1292
1287
|
}),
|
|
1293
1288
|
...e
|
|
1294
|
-
},
|
|
1295
|
-
const
|
|
1296
|
-
let
|
|
1297
|
-
if (!
|
|
1289
|
+
}, o = !1;
|
|
1290
|
+
const u = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
|
|
1291
|
+
let y = a.storage;
|
|
1292
|
+
if (!y)
|
|
1298
1293
|
return t(
|
|
1299
1294
|
(...h) => {
|
|
1300
1295
|
console.warn(
|
|
@@ -1304,34 +1299,34 @@ const Qe = (t) => (e) => {
|
|
|
1304
1299
|
r,
|
|
1305
1300
|
i
|
|
1306
1301
|
);
|
|
1307
|
-
const
|
|
1302
|
+
const g = () => {
|
|
1308
1303
|
const h = a.partialize({ ...r() });
|
|
1309
|
-
return
|
|
1304
|
+
return y.setItem(a.name, {
|
|
1310
1305
|
state: h,
|
|
1311
1306
|
version: a.version
|
|
1312
1307
|
});
|
|
1313
1308
|
}, c = i.setState;
|
|
1314
1309
|
i.setState = (h, v) => {
|
|
1315
|
-
c(h, v),
|
|
1310
|
+
c(h, v), g();
|
|
1316
1311
|
};
|
|
1317
1312
|
const p = t(
|
|
1318
1313
|
(...h) => {
|
|
1319
|
-
s(...h),
|
|
1314
|
+
s(...h), g();
|
|
1320
1315
|
},
|
|
1321
1316
|
r,
|
|
1322
1317
|
i
|
|
1323
1318
|
);
|
|
1324
1319
|
i.getInitialState = () => p;
|
|
1325
|
-
let
|
|
1326
|
-
const
|
|
1320
|
+
let d;
|
|
1321
|
+
const E = () => {
|
|
1327
1322
|
var h, v;
|
|
1328
|
-
if (!
|
|
1329
|
-
|
|
1323
|
+
if (!y) return;
|
|
1324
|
+
o = !1, u.forEach((R) => {
|
|
1330
1325
|
var O;
|
|
1331
1326
|
return R((O = r()) != null ? O : p);
|
|
1332
1327
|
});
|
|
1333
|
-
const
|
|
1334
|
-
return
|
|
1328
|
+
const C = ((v = a.onRehydrateStorage) == null ? void 0 : v.call(a, (h = r()) != null ? h : p)) || void 0;
|
|
1329
|
+
return Ue(y.getItem.bind(y))(a.name).then((R) => {
|
|
1335
1330
|
if (R)
|
|
1336
1331
|
if (typeof R.version == "number" && R.version !== a.version) {
|
|
1337
1332
|
if (a.migrate) {
|
|
@@ -1350,15 +1345,15 @@ const Qe = (t) => (e) => {
|
|
|
1350
1345
|
}).then((R) => {
|
|
1351
1346
|
var O;
|
|
1352
1347
|
const [q, Z] = R;
|
|
1353
|
-
if (
|
|
1348
|
+
if (d = a.merge(
|
|
1354
1349
|
Z,
|
|
1355
1350
|
(O = r()) != null ? O : p
|
|
1356
|
-
), s(
|
|
1357
|
-
return
|
|
1351
|
+
), s(d, !0), q)
|
|
1352
|
+
return g();
|
|
1358
1353
|
}).then(() => {
|
|
1359
|
-
|
|
1354
|
+
C == null || C(d, void 0), d = r(), o = !0, l.forEach((R) => R(d));
|
|
1360
1355
|
}).catch((R) => {
|
|
1361
|
-
|
|
1356
|
+
C == null || C(void 0, R);
|
|
1362
1357
|
});
|
|
1363
1358
|
};
|
|
1364
1359
|
return i.persist = {
|
|
@@ -1366,30 +1361,30 @@ const Qe = (t) => (e) => {
|
|
|
1366
1361
|
a = {
|
|
1367
1362
|
...a,
|
|
1368
1363
|
...h
|
|
1369
|
-
}, h.storage && (
|
|
1364
|
+
}, h.storage && (y = h.storage);
|
|
1370
1365
|
},
|
|
1371
1366
|
clearStorage: () => {
|
|
1372
|
-
|
|
1367
|
+
y == null || y.removeItem(a.name);
|
|
1373
1368
|
},
|
|
1374
1369
|
getOptions: () => a,
|
|
1375
|
-
rehydrate: () =>
|
|
1376
|
-
hasHydrated: () =>
|
|
1377
|
-
onHydrate: (h) => (
|
|
1378
|
-
|
|
1370
|
+
rehydrate: () => E(),
|
|
1371
|
+
hasHydrated: () => o,
|
|
1372
|
+
onHydrate: (h) => (u.add(h), () => {
|
|
1373
|
+
u.delete(h);
|
|
1379
1374
|
}),
|
|
1380
1375
|
onFinishHydration: (h) => (l.add(h), () => {
|
|
1381
1376
|
l.delete(h);
|
|
1382
1377
|
})
|
|
1383
|
-
}, a.skipHydration ||
|
|
1384
|
-
},
|
|
1378
|
+
}, a.skipHydration || E(), d || p;
|
|
1379
|
+
}, ls = hs, ds = (t) => {
|
|
1385
1380
|
const e = (s) => {
|
|
1386
1381
|
s.key === t.persist.getOptions().name && s.newValue && t.persist.rehydrate();
|
|
1387
1382
|
};
|
|
1388
1383
|
return window.addEventListener("storage", e), () => {
|
|
1389
1384
|
window.removeEventListener("storage", e);
|
|
1390
1385
|
};
|
|
1391
|
-
}, Rt =
|
|
1392
|
-
|
|
1386
|
+
}, Rt = cs()(
|
|
1387
|
+
ls(
|
|
1393
1388
|
(t) => ({
|
|
1394
1389
|
isAuthenticated: !1,
|
|
1395
1390
|
isPending: !0,
|
|
@@ -1407,8 +1402,8 @@ const Qe = (t) => (e) => {
|
|
|
1407
1402
|
}
|
|
1408
1403
|
)
|
|
1409
1404
|
);
|
|
1410
|
-
typeof window < "u" &&
|
|
1411
|
-
const
|
|
1405
|
+
typeof window < "u" && ds(Rt);
|
|
1406
|
+
const fs = () => {
|
|
1412
1407
|
const { authentication: t } = Ke(), e = Rt(), s = typeof t < "u";
|
|
1413
1408
|
return {
|
|
1414
1409
|
isAuthEnabled: s,
|
|
@@ -1435,49 +1430,49 @@ const ds = () => {
|
|
|
1435
1430
|
};
|
|
1436
1431
|
};
|
|
1437
1432
|
export {
|
|
1438
|
-
|
|
1439
|
-
|
|
1433
|
+
Cs as A,
|
|
1434
|
+
Es as B,
|
|
1440
1435
|
ut as C,
|
|
1441
1436
|
ct as D,
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1437
|
+
pe as E,
|
|
1438
|
+
gs as F,
|
|
1439
|
+
Ne as G,
|
|
1440
|
+
ve as H,
|
|
1441
|
+
Fs as I,
|
|
1447
1442
|
St as J,
|
|
1448
1443
|
_e as K,
|
|
1449
|
-
|
|
1444
|
+
Is as L,
|
|
1450
1445
|
gt as M,
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1446
|
+
Ts as N,
|
|
1447
|
+
Os as Q,
|
|
1448
|
+
qt as R,
|
|
1449
|
+
Qe as S,
|
|
1450
|
+
ns as Z,
|
|
1451
|
+
Ps as a,
|
|
1452
|
+
Ds as b,
|
|
1458
1453
|
At as c,
|
|
1459
|
-
|
|
1454
|
+
Yt as d,
|
|
1460
1455
|
Ke as e,
|
|
1461
1456
|
et as f,
|
|
1462
1457
|
vt as g,
|
|
1463
1458
|
Re as h,
|
|
1464
1459
|
Ye as i,
|
|
1465
1460
|
ce as j,
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1461
|
+
Kt as k,
|
|
1462
|
+
fs as l,
|
|
1463
|
+
Wt as m,
|
|
1464
|
+
Le as n,
|
|
1465
|
+
Rs as o,
|
|
1466
|
+
cs as p,
|
|
1467
|
+
ls as q,
|
|
1473
1468
|
wt as r,
|
|
1474
1469
|
Ce as s,
|
|
1475
|
-
|
|
1470
|
+
js as t,
|
|
1476
1471
|
Rt as u,
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1472
|
+
Ft as v,
|
|
1473
|
+
Ss as w,
|
|
1474
|
+
ws as x,
|
|
1480
1475
|
Se as y,
|
|
1481
1476
|
Pt as z
|
|
1482
1477
|
};
|
|
1483
|
-
//# sourceMappingURL=hook-
|
|
1478
|
+
//# sourceMappingURL=hook-pPrHCB6G.js.map
|