zudoku 0.37.1 → 0.39.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.
Files changed (260) hide show
  1. package/dist/app/main.js +2 -0
  2. package/dist/app/main.js.map +1 -1
  3. package/dist/app/tailwind.js +14 -0
  4. package/dist/app/tailwind.js.map +1 -1
  5. package/dist/config/validators/common.d.ts +287 -18
  6. package/dist/config/validators/common.js +2 -0
  7. package/dist/config/validators/common.js.map +1 -1
  8. package/dist/config/validators/validate.d.ts +107 -7
  9. package/dist/lib/authentication/authentication.d.ts +1 -0
  10. package/dist/lib/authentication/providers/clerk.js +19 -0
  11. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  12. package/dist/lib/authentication/providers/openid.d.ts +1 -0
  13. package/dist/lib/authentication/providers/openid.js +5 -0
  14. package/dist/lib/authentication/providers/openid.js.map +1 -1
  15. package/dist/lib/authentication/providers/supabase.js +5 -0
  16. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  17. package/dist/lib/authentication/state.d.ts +0 -26
  18. package/dist/lib/authentication/state.js +1 -16
  19. package/dist/lib/authentication/state.js.map +1 -1
  20. package/dist/lib/components/Heading.d.ts +1 -1
  21. package/dist/lib/components/Layout.js +5 -10
  22. package/dist/lib/components/Layout.js.map +1 -1
  23. package/dist/lib/components/Main.js +3 -1
  24. package/dist/lib/components/Main.js.map +1 -1
  25. package/dist/lib/components/Pagination.d.ts +10 -0
  26. package/dist/lib/components/Pagination.js +10 -0
  27. package/dist/lib/components/Pagination.js.map +1 -0
  28. package/dist/lib/components/TopNavigation.js +18 -2
  29. package/dist/lib/components/TopNavigation.js.map +1 -1
  30. package/dist/lib/components/navigation/SidebarItem.d.ts +1 -0
  31. package/dist/lib/components/navigation/SidebarItem.js +7 -3
  32. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  33. package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
  34. package/dist/lib/components/navigation/Toc.js.map +1 -0
  35. package/dist/lib/core/ZudokuContext.d.ts +7 -0
  36. package/dist/lib/core/ZudokuContext.js +8 -3
  37. package/dist/lib/core/ZudokuContext.js.map +1 -1
  38. package/dist/lib/core/plugins.d.ts +1 -1
  39. package/dist/lib/oas/graphql/index.d.ts +2 -1
  40. package/dist/lib/oas/graphql/index.js +74 -14
  41. package/dist/lib/oas/graphql/index.js.map +1 -1
  42. package/dist/lib/oas/parser/dereference/index.js +2 -0
  43. package/dist/lib/oas/parser/dereference/index.js.map +1 -1
  44. package/dist/lib/oas/parser/index.d.ts +5 -3
  45. package/dist/lib/oas/parser/index.js +0 -22
  46. package/dist/lib/oas/parser/index.js.map +1 -1
  47. package/dist/lib/plugins/api-catalog/index.js +19 -17
  48. package/dist/lib/plugins/api-catalog/index.js.map +1 -1
  49. package/dist/lib/plugins/markdown/MdxPage.js +3 -9
  50. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  51. package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
  52. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  53. package/dist/lib/plugins/openapi/Endpoint.js +1 -1
  54. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  55. package/dist/lib/plugins/openapi/OperationList.d.ts +1 -1
  56. package/dist/lib/plugins/openapi/OperationList.js +29 -9
  57. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  58. package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
  59. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  60. package/dist/lib/plugins/openapi/ParameterListItem.js +2 -1
  61. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  62. package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
  63. package/dist/lib/plugins/openapi/SchemaList.js +52 -0
  64. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
  65. package/dist/lib/plugins/openapi/Sidecar.js +29 -5
  66. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  67. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
  68. package/dist/lib/plugins/openapi/client/GraphQLClient.js +1 -1
  69. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
  70. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
  71. package/dist/lib/plugins/openapi/client/useCreateQuery.js +5 -5
  72. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
  73. package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
  74. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
  75. package/dist/lib/plugins/openapi/graphql/gql.d.ts +6 -2
  76. package/dist/lib/plugins/openapi/graphql/gql.js +3 -2
  77. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  78. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +67 -11
  79. package/dist/lib/plugins/openapi/graphql/graphql.js +34 -5
  80. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  81. package/dist/lib/plugins/openapi/index.js +12 -0
  82. package/dist/lib/plugins/openapi/index.js.map +1 -1
  83. package/dist/lib/plugins/openapi/interfaces.d.ts +26 -0
  84. package/dist/lib/plugins/openapi/playground/Playground.js +1 -1
  85. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  86. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +2 -2
  87. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  88. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.d.ts +1 -2
  89. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js +2 -2
  90. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js.map +1 -1
  91. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.d.ts +0 -1
  92. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js +1 -1
  93. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js.map +1 -1
  94. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.d.ts +4 -0
  95. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +12 -0
  96. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -0
  97. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.d.ts +2 -4
  98. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +12 -9
  99. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  100. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -2
  101. package/dist/lib/plugins/openapi/schema/SchemaView.js +30 -52
  102. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  103. package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
  104. package/dist/lib/plugins/openapi/schema/utils.js +3 -1
  105. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  106. package/dist/lib/plugins/openapi/state.d.ts +25 -0
  107. package/dist/lib/plugins/openapi/state.js +18 -0
  108. package/dist/lib/plugins/openapi/state.js.map +1 -0
  109. package/dist/lib/plugins/openapi/util/getRoutes.js +9 -3
  110. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  111. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +13 -4
  112. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  113. package/dist/lib/plugins/search-pagefind/ResultList.js +19 -12
  114. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  115. package/dist/lib/plugins/search-pagefind/get-results.d.ts +8 -1
  116. package/dist/lib/plugins/search-pagefind/get-results.js +9 -4
  117. package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -1
  118. package/dist/lib/util/traverse.d.ts +2 -8
  119. package/dist/lib/util/traverse.js.map +1 -1
  120. package/dist/lib/util/types.d.ts +7 -0
  121. package/dist/lib/util/types.js +2 -0
  122. package/dist/lib/util/types.js.map +1 -0
  123. package/dist/lib/util/useOnScreen.d.ts +3 -2
  124. package/dist/lib/util/useOnScreen.js +3 -3
  125. package/dist/lib/util/useOnScreen.js.map +1 -1
  126. package/dist/lib/util/useScrollToAnchor.js +18 -12
  127. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  128. package/dist/vite/api/schema-codegen.js +2 -2
  129. package/dist/vite/api/schema-codegen.js.map +1 -1
  130. package/dist/vite/api/schema-codegen.test.js +5 -0
  131. package/dist/vite/api/schema-codegen.test.js.map +1 -1
  132. package/dist/vite/plugin-api.js +12 -8
  133. package/dist/vite/plugin-api.js.map +1 -1
  134. package/lib/{AuthenticationPlugin-Cij2tPWa.js → AuthenticationPlugin-foqdvvkf.js} +3 -3
  135. package/lib/{AuthenticationPlugin-Cij2tPWa.js.map → AuthenticationPlugin-foqdvvkf.js.map} +1 -1
  136. package/lib/{Callout-B2vsR09t.js → Callout-D5frCCJ0.js} +2 -2
  137. package/lib/{Callout-B2vsR09t.js.map → Callout-D5frCCJ0.js.map} +1 -1
  138. package/lib/{Dialog-sbgekbjb.js → Dialog-Dv6WG8RN.js} +5 -5
  139. package/lib/{Dialog-sbgekbjb.js.map → Dialog-Dv6WG8RN.js.map} +1 -1
  140. package/lib/{Markdown-DT5Rrq8_.js → Markdown-aF5FdsNi.js} +1945 -1937
  141. package/lib/{Markdown-DT5Rrq8_.js.map → Markdown-aF5FdsNi.js.map} +1 -1
  142. package/lib/MdxPage-ZW1StNhp.js +83 -0
  143. package/lib/MdxPage-ZW1StNhp.js.map +1 -0
  144. package/lib/{OasProvider-DdEBf2qS.js → OasProvider-Cld9RAMQ.js} +4 -4
  145. package/lib/{OasProvider-DdEBf2qS.js.map → OasProvider-Cld9RAMQ.js.map} +1 -1
  146. package/lib/OperationList-D-OfzJm6.js +5065 -0
  147. package/lib/OperationList-D-OfzJm6.js.map +1 -0
  148. package/lib/Pagination-CYB3nVYx.js +46 -0
  149. package/lib/Pagination-CYB3nVYx.js.map +1 -0
  150. package/lib/SchemaList-Ci1WxRh0.js +148 -0
  151. package/lib/SchemaList-Ci1WxRh0.js.map +1 -0
  152. package/lib/SchemaView-Brn-YxHY.js +345 -0
  153. package/lib/SchemaView-Brn-YxHY.js.map +1 -0
  154. package/lib/{Select-z1Lwl0-J.js → Select-DVFRKf1R.js} +8 -8
  155. package/lib/{Select-z1Lwl0-J.js.map → Select-DVFRKf1R.js.map} +1 -1
  156. package/lib/{SlotletProvider-D8OBnr77.js → SlotletProvider-DXvc0aY6.js} +4 -4
  157. package/lib/{SlotletProvider-D8OBnr77.js.map → SlotletProvider-DXvc0aY6.js.map} +1 -1
  158. package/lib/Toc-YBsgI72s.js +92 -0
  159. package/lib/Toc-YBsgI72s.js.map +1 -0
  160. package/lib/{chunk-HA7DTUK3-ZGg2W6yV.js → chunk-HA7DTUK3-C4gP41vD.js} +5 -5
  161. package/lib/{chunk-HA7DTUK3-ZGg2W6yV.js.map → chunk-HA7DTUK3-C4gP41vD.js.map} +1 -1
  162. package/lib/{createServer-DjgKDpGV.js → createServer-mMau3eV_.js} +1732 -1664
  163. package/lib/{createServer-DjgKDpGV.js.map → createServer-mMau3eV_.js.map} +1 -1
  164. package/lib/hook-CqpVYDqN.js +1483 -0
  165. package/lib/hook-CqpVYDqN.js.map +1 -0
  166. package/lib/index-Bt7MKhZq.js +2514 -0
  167. package/lib/index-Bt7MKhZq.js.map +1 -0
  168. package/lib/{index-DdQSV2RF.js → index-CjPMxpOV.js} +809 -750
  169. package/lib/index-CjPMxpOV.js.map +1 -0
  170. package/lib/{mutation-_Z5C2wFZ.js → mutation-8LjrN7uz.js} +2 -2
  171. package/lib/{mutation-_Z5C2wFZ.js.map → mutation-8LjrN7uz.js.map} +1 -1
  172. package/lib/post-processors/traverse.js.map +1 -1
  173. package/lib/ui/Command.js +1 -1
  174. package/lib/{useExposedProps-BslIn-FE.js → useExposedProps-B9qXJedG.js} +2 -2
  175. package/lib/{useExposedProps-BslIn-FE.js.map → useExposedProps-B9qXJedG.js.map} +1 -1
  176. package/lib/zudoku.auth-auth0.js +1 -1
  177. package/lib/zudoku.auth-clerk.js +59 -41
  178. package/lib/zudoku.auth-clerk.js.map +1 -1
  179. package/lib/zudoku.auth-openid.js +76 -73
  180. package/lib/zudoku.auth-openid.js.map +1 -1
  181. package/lib/zudoku.components.js +31 -1440
  182. package/lib/zudoku.components.js.map +1 -1
  183. package/lib/zudoku.hooks.js +1 -1
  184. package/lib/zudoku.plugin-api-catalog.js +81 -79
  185. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  186. package/lib/zudoku.plugin-api-keys.js +15 -16
  187. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  188. package/lib/zudoku.plugin-custom-pages.js +2 -2
  189. package/lib/zudoku.plugin-markdown.js +1 -1
  190. package/lib/zudoku.plugin-openapi.js +5 -6
  191. package/lib/zudoku.plugin-openapi.js.map +1 -1
  192. package/lib/zudoku.plugin-redirect.js +1 -1
  193. package/lib/zudoku.plugin-search-pagefind.js +133 -98
  194. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  195. package/lib/zudoku.plugins.js.map +1 -1
  196. package/package.json +4 -3
  197. package/src/app/main.tsx +2 -0
  198. package/src/app/tailwind.ts +14 -0
  199. package/src/lib/authentication/authentication.ts +2 -0
  200. package/src/lib/authentication/providers/clerk.tsx +20 -0
  201. package/src/lib/authentication/providers/openid.tsx +6 -0
  202. package/src/lib/authentication/providers/supabase.tsx +6 -0
  203. package/src/lib/authentication/state.ts +1 -35
  204. package/src/lib/components/Layout.tsx +17 -17
  205. package/src/lib/components/Main.tsx +3 -1
  206. package/src/lib/components/Pagination.tsx +47 -0
  207. package/src/lib/components/TopNavigation.tsx +29 -2
  208. package/src/lib/components/navigation/SidebarItem.tsx +10 -4
  209. package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
  210. package/src/lib/core/ZudokuContext.ts +13 -6
  211. package/src/lib/core/plugins.ts +1 -1
  212. package/src/lib/oas/graphql/index.ts +118 -45
  213. package/src/lib/oas/parser/dereference/index.ts +2 -0
  214. package/src/lib/oas/parser/index.ts +7 -29
  215. package/src/lib/plugins/api-catalog/index.tsx +40 -35
  216. package/src/lib/plugins/markdown/MdxPage.tsx +6 -43
  217. package/src/lib/plugins/openapi/ColorizedParam.tsx +1 -1
  218. package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
  219. package/src/lib/plugins/openapi/OperationList.tsx +37 -16
  220. package/src/lib/plugins/openapi/OperationListItem.tsx +7 -2
  221. package/src/lib/plugins/openapi/ParameterListItem.tsx +2 -0
  222. package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
  223. package/src/lib/plugins/openapi/Sidecar.tsx +36 -7
  224. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +1 -1
  225. package/src/lib/plugins/openapi/client/useCreateQuery.ts +12 -5
  226. package/src/lib/plugins/openapi/components/EnumValues.tsx +1 -1
  227. package/src/lib/plugins/openapi/graphql/gql.ts +15 -6
  228. package/src/lib/plugins/openapi/graphql/graphql.ts +104 -15
  229. package/src/lib/plugins/openapi/index.tsx +13 -0
  230. package/src/lib/plugins/openapi/interfaces.ts +29 -0
  231. package/src/lib/plugins/openapi/playground/Playground.tsx +1 -1
  232. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +2 -1
  233. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.tsx +1 -8
  234. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.tsx +1 -2
  235. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +36 -0
  236. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +20 -21
  237. package/src/lib/plugins/openapi/schema/SchemaView.tsx +69 -141
  238. package/src/lib/plugins/openapi/schema/utils.ts +7 -1
  239. package/src/lib/plugins/openapi/state.ts +36 -0
  240. package/src/lib/plugins/openapi/util/getRoutes.tsx +9 -6
  241. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +26 -4
  242. package/src/lib/plugins/search-pagefind/ResultList.tsx +59 -47
  243. package/src/lib/plugins/search-pagefind/get-results.tsx +31 -10
  244. package/src/lib/util/traverse.ts +2 -6
  245. package/src/lib/util/types.ts +7 -0
  246. package/src/lib/util/useOnScreen.ts +6 -4
  247. package/src/lib/util/useScrollToAnchor.ts +20 -12
  248. package/dist/lib/plugins/markdown/Toc.js.map +0 -1
  249. package/lib/MdxPage-D2rD1vC4.js +0 -200
  250. package/lib/MdxPage-D2rD1vC4.js.map +0 -1
  251. package/lib/OperationList-DT4-gm_S.js +0 -5363
  252. package/lib/OperationList-DT4-gm_S.js.map +0 -1
  253. package/lib/hook-DzQC8PzJ.js +0 -355
  254. package/lib/hook-DzQC8PzJ.js.map +0 -1
  255. package/lib/index-DdQSV2RF.js.map +0 -1
  256. package/lib/index.esm-CltAN0Tf.js +0 -711
  257. package/lib/index.esm-CltAN0Tf.js.map +0 -1
  258. package/lib/joinUrl-BjDooT-T.js +0 -1154
  259. package/lib/joinUrl-BjDooT-T.js.map +0 -1
  260. /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
@@ -0,0 +1,1483 @@
1
+ var $e = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var me = (t, e, s) => e.has(t) || $e("Cannot " + s);
5
+ var n = (t, e, s) => (me(t, e, "read from private field"), s ? s.call(t) : e.get(t)), g = (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), d = (t, e, s, r) => (me(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s), w = (t, e, s) => (me(t, e, "access private method"), s);
6
+ import * as j from "react";
7
+ import Ge, { createContext as Et, useContext as Ct } from "react";
8
+ import { j as Ot } from "./jsx-runtime-CYK1ROHF.js";
9
+ import { u as ve, m as ze } from "./chunk-HA7DTUK3-C4gP41vD.js";
10
+ var qe = class {
11
+ constructor() {
12
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
13
+ }
14
+ subscribe(t) {
15
+ return this.listeners.add(t), this.onSubscribe(), () => {
16
+ this.listeners.delete(t), this.onUnsubscribe();
17
+ };
18
+ }
19
+ hasListeners() {
20
+ return this.listeners.size > 0;
21
+ }
22
+ onSubscribe() {
23
+ }
24
+ onUnsubscribe() {
25
+ }
26
+ }, V = typeof window > "u" || "Deno" in globalThis;
27
+ function Se() {
28
+ }
29
+ function bs(t, e) {
30
+ return typeof t == "function" ? t(e) : t;
31
+ }
32
+ function we(t) {
33
+ return typeof t == "number" && t >= 0 && t !== 1 / 0;
34
+ }
35
+ function ot(t, e) {
36
+ return Math.max(t + (e || 0) - Date.now(), 0);
37
+ }
38
+ function ye(t, e) {
39
+ return typeof t == "function" ? t(e) : t;
40
+ }
41
+ function x(t, e) {
42
+ return typeof t == "function" ? t(e) : t;
43
+ }
44
+ function ms(t, e) {
45
+ const {
46
+ type: s = "all",
47
+ exact: r,
48
+ fetchStatus: i,
49
+ predicate: a,
50
+ queryKey: u,
51
+ stale: o
52
+ } = t;
53
+ if (u) {
54
+ if (r) {
55
+ if (e.queryHash !== It(u, e.options))
56
+ return !1;
57
+ } else if (!Le(e.queryKey, u))
58
+ return !1;
59
+ }
60
+ if (s !== "all") {
61
+ const l = e.isActive();
62
+ if (s === "active" && !l || s === "inactive" && l)
63
+ return !1;
64
+ }
65
+ return !(typeof o == "boolean" && e.isStale() !== o || i && i !== e.state.fetchStatus || a && !a(e));
66
+ }
67
+ function gs(t, e) {
68
+ const { exact: s, status: r, predicate: i, mutationKey: a } = t;
69
+ if (a) {
70
+ if (!e.options.mutationKey)
71
+ return !1;
72
+ if (s) {
73
+ if (Re(e.options.mutationKey) !== Re(a))
74
+ return !1;
75
+ } else if (!Le(e.options.mutationKey, a))
76
+ return !1;
77
+ }
78
+ return !(r && e.state.status !== r || i && !i(e));
79
+ }
80
+ function It(t, e) {
81
+ return ((e == null ? void 0 : e.queryKeyHashFn) || Re)(t);
82
+ }
83
+ function Re(t) {
84
+ return JSON.stringify(
85
+ t,
86
+ (e, s) => Oe(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
87
+ );
88
+ }
89
+ function Le(t, e) {
90
+ return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some((s) => !Le(t[s], e[s])) : !1;
91
+ }
92
+ function Ee(t, e) {
93
+ if (t === e)
94
+ return t;
95
+ const s = Je(t) && Je(e);
96
+ if (s || Oe(t) && Oe(e)) {
97
+ const r = s ? t : Object.keys(t), i = r.length, a = s ? e : Object.keys(e), u = a.length, o = s ? [] : {};
98
+ let l = 0;
99
+ for (let f = 0; f < u; f++) {
100
+ const m = s ? f : a[f];
101
+ (!s && r.includes(m) || s) && t[m] === void 0 && e[m] === void 0 ? (o[m] = void 0, l++) : (o[m] = Ee(t[m], e[m]), o[m] === t[m] && t[m] !== void 0 && l++);
102
+ }
103
+ return i === u && l === i ? t : o;
104
+ }
105
+ return e;
106
+ }
107
+ function Ce(t, e) {
108
+ if (!e || Object.keys(t).length !== Object.keys(e).length)
109
+ return !1;
110
+ for (const s in t)
111
+ if (t[s] !== e[s])
112
+ return !1;
113
+ return !0;
114
+ }
115
+ function Je(t) {
116
+ return Array.isArray(t) && t.length === Object.keys(t).length;
117
+ }
118
+ function Oe(t) {
119
+ if (!Ve(t))
120
+ return !1;
121
+ const e = t.constructor;
122
+ if (e === void 0)
123
+ return !0;
124
+ const s = e.prototype;
125
+ return !(!Ve(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
126
+ }
127
+ function Ve(t) {
128
+ return Object.prototype.toString.call(t) === "[object Object]";
129
+ }
130
+ function Ft(t) {
131
+ return new Promise((e) => {
132
+ setTimeout(e, t);
133
+ });
134
+ }
135
+ function Ie(t, e, s) {
136
+ if (typeof s.structuralSharing == "function")
137
+ return s.structuralSharing(t, e);
138
+ if (s.structuralSharing !== !1) {
139
+ if (process.env.NODE_ENV !== "production")
140
+ try {
141
+ return Ee(t, e);
142
+ } catch (r) {
143
+ console.error(
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
+ );
146
+ }
147
+ return Ee(t, e);
148
+ }
149
+ return e;
150
+ }
151
+ function Ss(t) {
152
+ return t;
153
+ }
154
+ function ws(t, e, s = 0) {
155
+ const r = [...t, e];
156
+ return s && r.length > s ? r.slice(1) : r;
157
+ }
158
+ function Rs(t, e, s = 0) {
159
+ const r = [e, ...t];
160
+ return s && r.length > s ? r.slice(0, -1) : r;
161
+ }
162
+ var pe = Symbol();
163
+ function Pt(t, e) {
164
+ return process.env.NODE_ENV !== "production" && t.queryFn === pe && console.error(
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 === pe ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
167
+ }
168
+ var H, L, X, st, Tt = (st = class extends qe {
169
+ constructor() {
170
+ super();
171
+ g(this, H);
172
+ g(this, L);
173
+ g(this, X);
174
+ d(this, X, (e) => {
175
+ if (!V && window.addEventListener) {
176
+ const s = () => e();
177
+ return window.addEventListener("visibilitychange", s, !1), () => {
178
+ window.removeEventListener("visibilitychange", s);
179
+ };
180
+ }
181
+ });
182
+ }
183
+ onSubscribe() {
184
+ n(this, L) || this.setEventListener(n(this, X));
185
+ }
186
+ onUnsubscribe() {
187
+ var e;
188
+ this.hasListeners() || ((e = n(this, L)) == null || e.call(this), d(this, L, void 0));
189
+ }
190
+ setEventListener(e) {
191
+ var s;
192
+ d(this, X, e), (s = n(this, L)) == null || s.call(this), d(this, L, e((r) => {
193
+ typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
194
+ }));
195
+ }
196
+ setFocused(e) {
197
+ n(this, H) !== e && (d(this, H, e), this.onFocus());
198
+ }
199
+ onFocus() {
200
+ const e = this.isFocused();
201
+ this.listeners.forEach((s) => {
202
+ s(e);
203
+ });
204
+ }
205
+ isFocused() {
206
+ var e;
207
+ return typeof n(this, H) == "boolean" ? n(this, H) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden";
208
+ }
209
+ }, H = new WeakMap(), L = new WeakMap(), X = new WeakMap(), st), ut = new Tt(), ee, M, te, rt, Dt = (rt = class extends qe {
210
+ constructor() {
211
+ super();
212
+ g(this, ee, !0);
213
+ g(this, M);
214
+ g(this, te);
215
+ d(this, te, (e) => {
216
+ if (!V && window.addEventListener) {
217
+ const s = () => e(!0), r = () => e(!1);
218
+ return window.addEventListener("online", s, !1), window.addEventListener("offline", r, !1), () => {
219
+ window.removeEventListener("online", s), window.removeEventListener("offline", r);
220
+ };
221
+ }
222
+ });
223
+ }
224
+ onSubscribe() {
225
+ n(this, M) || this.setEventListener(n(this, te));
226
+ }
227
+ onUnsubscribe() {
228
+ var e;
229
+ this.hasListeners() || ((e = n(this, M)) == null || e.call(this), d(this, M, void 0));
230
+ }
231
+ setEventListener(e) {
232
+ var s;
233
+ d(this, te, e), (s = n(this, M)) == null || s.call(this), d(this, M, e(this.setOnline.bind(this)));
234
+ }
235
+ setOnline(e) {
236
+ n(this, ee) !== e && (d(this, ee, e), this.listeners.forEach((r) => {
237
+ r(e);
238
+ }));
239
+ }
240
+ isOnline() {
241
+ return n(this, ee);
242
+ }
243
+ }, ee = new WeakMap(), M = new WeakMap(), te = new WeakMap(), rt), ct = new Dt();
244
+ function Fe() {
245
+ let t, e;
246
+ const s = new Promise((i, a) => {
247
+ t = i, e = a;
248
+ });
249
+ s.status = "pending", s.catch(() => {
250
+ });
251
+ function r(i) {
252
+ Object.assign(s, i), delete s.resolve, delete s.reject;
253
+ }
254
+ return s.resolve = (i) => {
255
+ r({
256
+ status: "fulfilled",
257
+ value: i
258
+ }), t(i);
259
+ }, s.reject = (i) => {
260
+ r({
261
+ status: "rejected",
262
+ reason: i
263
+ }), e(i);
264
+ }, s;
265
+ }
266
+ function jt(t) {
267
+ return Math.min(1e3 * 2 ** t, 3e4);
268
+ }
269
+ function ht(t) {
270
+ return (t ?? "online") === "online" ? ct.isOnline() : !0;
271
+ }
272
+ var lt = class extends Error {
273
+ constructor(t) {
274
+ super("CancelledError"), this.revert = t == null ? void 0 : t.revert, this.silent = t == null ? void 0 : t.silent;
275
+ }
276
+ };
277
+ function ge(t) {
278
+ return t instanceof lt;
279
+ }
280
+ function At(t) {
281
+ let e = !1, s = 0, r = !1, i;
282
+ const a = Fe(), u = (h) => {
283
+ var v;
284
+ r || (p(new lt(h)), (v = t.abort) == null || v.call(t));
285
+ }, o = () => {
286
+ e = !0;
287
+ }, l = () => {
288
+ e = !1;
289
+ }, f = () => ut.isFocused() && (t.networkMode === "always" || ct.isOnline()) && t.canRun(), m = () => ht(t.networkMode) && t.canRun(), c = (h) => {
290
+ var v;
291
+ r || (r = !0, (v = t.onSuccess) == null || v.call(t, h), i == null || i(), a.resolve(h));
292
+ }, p = (h) => {
293
+ var v;
294
+ r || (r = !0, (v = t.onError) == null || v.call(t, h), i == null || i(), a.reject(h));
295
+ }, y = () => new Promise((h) => {
296
+ var v;
297
+ i = (E) => {
298
+ (r || f()) && h(E);
299
+ }, (v = t.onPause) == null || v.call(t);
300
+ }).then(() => {
301
+ var h;
302
+ i = void 0, r || (h = t.onContinue) == null || h.call(t);
303
+ }), C = () => {
304
+ if (r)
305
+ return;
306
+ let h;
307
+ const v = s === 0 ? t.initialPromise : void 0;
308
+ try {
309
+ h = v ?? t.fn();
310
+ } catch (E) {
311
+ h = Promise.reject(E);
312
+ }
313
+ Promise.resolve(h).then(c).catch((E) => {
314
+ var be;
315
+ if (r)
316
+ return;
317
+ const R = t.retry ?? (V ? 0 : 3), O = t.retryDelay ?? jt, q = typeof O == "function" ? O(s, E) : O, Z = R === !0 || typeof R == "number" && s < R || typeof R == "function" && R(s, E);
318
+ if (e || !Z) {
319
+ p(E);
320
+ return;
321
+ }
322
+ s++, (be = t.onFail) == null || be.call(t, s, E), Ft(q).then(() => f() ? void 0 : y()).then(() => {
323
+ e ? p(E) : C();
324
+ });
325
+ });
326
+ };
327
+ return {
328
+ promise: a,
329
+ cancel: u,
330
+ continue: () => (i == null || i(), a),
331
+ cancelRetry: o,
332
+ continueRetry: l,
333
+ canStart: m,
334
+ start: () => (m() ? C() : y().then(C), a)
335
+ };
336
+ }
337
+ function xt() {
338
+ let t = [], e = 0, s = (o) => {
339
+ o();
340
+ }, r = (o) => {
341
+ o();
342
+ }, i = (o) => setTimeout(o, 0);
343
+ const a = (o) => {
344
+ e ? t.push(o) : i(() => {
345
+ s(o);
346
+ });
347
+ }, u = () => {
348
+ const o = t;
349
+ t = [], o.length && i(() => {
350
+ r(() => {
351
+ o.forEach((l) => {
352
+ s(l);
353
+ });
354
+ });
355
+ });
356
+ };
357
+ return {
358
+ batch: (o) => {
359
+ let l;
360
+ e++;
361
+ try {
362
+ l = o();
363
+ } finally {
364
+ e--, e || u();
365
+ }
366
+ return l;
367
+ },
368
+ /**
369
+ * All calls to the wrapped function will be batched.
370
+ */
371
+ batchCalls: (o) => (...l) => {
372
+ a(() => {
373
+ o(...l);
374
+ });
375
+ },
376
+ schedule: a,
377
+ /**
378
+ * Use this method to set a custom notify function.
379
+ * This can be used to for example wrap notifications with `React.act` while running tests.
380
+ */
381
+ setNotifyFunction: (o) => {
382
+ s = o;
383
+ },
384
+ /**
385
+ * Use this method to set a custom function to batch notifications together into a single tick.
386
+ * By default React Query will use the batch function provided by ReactDOM or React Native.
387
+ */
388
+ setBatchNotifyFunction: (o) => {
389
+ r = o;
390
+ },
391
+ setScheduler: (o) => {
392
+ i = o;
393
+ }
394
+ };
395
+ }
396
+ var Me = xt(), K, nt, kt = (nt = class {
397
+ constructor() {
398
+ g(this, K);
399
+ }
400
+ destroy() {
401
+ this.clearGcTimeout();
402
+ }
403
+ scheduleGc() {
404
+ this.clearGcTimeout(), we(this.gcTime) && d(this, K, setTimeout(() => {
405
+ this.optionalRemove();
406
+ }, this.gcTime));
407
+ }
408
+ updateGcTime(t) {
409
+ this.gcTime = Math.max(
410
+ this.gcTime || 0,
411
+ t ?? (V ? 1 / 0 : 5 * 60 * 1e3)
412
+ );
413
+ }
414
+ clearGcTimeout() {
415
+ n(this, K) && (clearTimeout(n(this, K)), d(this, K, void 0));
416
+ }
417
+ }, K = new WeakMap(), nt), se, re, D, B, I, he, $, A, Q, it, Es = (it = class extends kt {
418
+ constructor(e) {
419
+ super();
420
+ g(this, A);
421
+ g(this, se);
422
+ g(this, re);
423
+ g(this, D);
424
+ g(this, B);
425
+ g(this, I);
426
+ g(this, he);
427
+ g(this, $);
428
+ d(this, $, !1), d(this, he, e.defaultOptions), this.setOptions(e.options), this.observers = [], d(this, B, e.client), d(this, D, n(this, B).getQueryCache()), this.queryKey = e.queryKey, this.queryHash = e.queryHash, d(this, se, Ut(this.options)), this.state = e.state ?? n(this, se), this.scheduleGc();
429
+ }
430
+ get meta() {
431
+ return this.options.meta;
432
+ }
433
+ get promise() {
434
+ var e;
435
+ return (e = n(this, I)) == null ? void 0 : e.promise;
436
+ }
437
+ setOptions(e) {
438
+ this.options = { ...n(this, he), ...e }, this.updateGcTime(this.options.gcTime);
439
+ }
440
+ optionalRemove() {
441
+ !this.observers.length && this.state.fetchStatus === "idle" && n(this, D).remove(this);
442
+ }
443
+ setData(e, s) {
444
+ const r = Ie(this.state.data, e, this.options);
445
+ return w(this, A, Q).call(this, {
446
+ data: r,
447
+ type: "success",
448
+ dataUpdatedAt: s == null ? void 0 : s.updatedAt,
449
+ manual: s == null ? void 0 : s.manual
450
+ }), r;
451
+ }
452
+ setState(e, s) {
453
+ w(this, A, Q).call(this, { type: "setState", state: e, setStateOptions: s });
454
+ }
455
+ cancel(e) {
456
+ var r, i;
457
+ const s = (r = n(this, I)) == null ? void 0 : r.promise;
458
+ return (i = n(this, I)) == null || i.cancel(e), s ? s.then(Se).catch(Se) : Promise.resolve();
459
+ }
460
+ destroy() {
461
+ super.destroy(), this.cancel({ silent: !0 });
462
+ }
463
+ reset() {
464
+ this.destroy(), this.setState(n(this, se));
465
+ }
466
+ isActive() {
467
+ return this.observers.some(
468
+ (e) => x(e.options.enabled, this) !== !1
469
+ );
470
+ }
471
+ isDisabled() {
472
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === pe || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
473
+ }
474
+ isStale() {
475
+ return this.state.isInvalidated ? !0 : this.getObserversCount() > 0 ? this.observers.some(
476
+ (e) => e.getCurrentResult().isStale
477
+ ) : this.state.data === void 0;
478
+ }
479
+ isStaleByTime(e = 0) {
480
+ return this.state.isInvalidated || this.state.data === void 0 || !ot(this.state.dataUpdatedAt, e);
481
+ }
482
+ onFocus() {
483
+ var s;
484
+ const e = this.observers.find((r) => r.shouldFetchOnWindowFocus());
485
+ e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, I)) == null || s.continue();
486
+ }
487
+ onOnline() {
488
+ var s;
489
+ const e = this.observers.find((r) => r.shouldFetchOnReconnect());
490
+ e == null || e.refetch({ cancelRefetch: !1 }), (s = n(this, I)) == null || s.continue();
491
+ }
492
+ addObserver(e) {
493
+ this.observers.includes(e) || (this.observers.push(e), this.clearGcTimeout(), n(this, D).notify({ type: "observerAdded", query: this, observer: e }));
494
+ }
495
+ removeObserver(e) {
496
+ this.observers.includes(e) && (this.observers = this.observers.filter((s) => s !== e), this.observers.length || (n(this, I) && (n(this, $) ? n(this, I).cancel({ revert: !0 }) : n(this, I).cancelRetry()), this.scheduleGc()), n(this, D).notify({ type: "observerRemoved", query: this, observer: e }));
497
+ }
498
+ getObserversCount() {
499
+ return this.observers.length;
500
+ }
501
+ invalidate() {
502
+ this.state.isInvalidated || w(this, A, Q).call(this, { type: "invalidate" });
503
+ }
504
+ fetch(e, s) {
505
+ var l, f, m;
506
+ if (this.state.fetchStatus !== "idle") {
507
+ if (this.state.data !== void 0 && (s != null && s.cancelRefetch))
508
+ this.cancel({ silent: !0 });
509
+ else if (n(this, I))
510
+ return n(this, I).continueRetry(), n(this, I).promise;
511
+ }
512
+ if (e && this.setOptions(e), !this.options.queryFn) {
513
+ const c = this.observers.find((p) => p.options.queryFn);
514
+ c && this.setOptions(c.options);
515
+ }
516
+ process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
517
+ "As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
518
+ ));
519
+ const r = new AbortController(), i = (c) => {
520
+ Object.defineProperty(c, "signal", {
521
+ enumerable: !0,
522
+ get: () => (d(this, $, !0), r.signal)
523
+ });
524
+ }, a = () => {
525
+ const c = Pt(this.options, s), p = {
526
+ client: n(this, B),
527
+ queryKey: this.queryKey,
528
+ meta: this.meta
529
+ };
530
+ return i(p), d(this, $, !1), this.options.persister ? this.options.persister(
531
+ c,
532
+ p,
533
+ this
534
+ ) : c(p);
535
+ }, u = {
536
+ fetchOptions: s,
537
+ options: this.options,
538
+ queryKey: this.queryKey,
539
+ client: n(this, B),
540
+ state: this.state,
541
+ fetchFn: a
542
+ };
543
+ i(u), (l = this.options.behavior) == null || l.onFetch(
544
+ u,
545
+ this
546
+ ), d(this, re, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((f = u.fetchOptions) == null ? void 0 : f.meta)) && w(this, A, Q).call(this, { type: "fetch", meta: (m = u.fetchOptions) == null ? void 0 : m.meta });
547
+ const o = (c) => {
548
+ var p, y, C, h;
549
+ ge(c) && c.silent || w(this, A, Q).call(this, {
550
+ type: "error",
551
+ error: c
552
+ }), ge(c) || ((y = (p = n(this, D).config).onError) == null || y.call(
553
+ p,
554
+ c,
555
+ this
556
+ ), (h = (C = n(this, D).config).onSettled) == null || h.call(
557
+ C,
558
+ this.state.data,
559
+ c,
560
+ this
561
+ )), this.scheduleGc();
562
+ };
563
+ return d(this, I, At({
564
+ initialPromise: s == null ? void 0 : s.initialPromise,
565
+ fn: u.fetchFn,
566
+ abort: r.abort.bind(r),
567
+ onSuccess: (c) => {
568
+ var p, y, C, h;
569
+ if (c === void 0) {
570
+ process.env.NODE_ENV !== "production" && console.error(
571
+ `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
+ ), o(new Error(`${this.queryHash} data is undefined`));
573
+ return;
574
+ }
575
+ try {
576
+ this.setData(c);
577
+ } catch (v) {
578
+ o(v);
579
+ return;
580
+ }
581
+ (y = (p = n(this, D).config).onSuccess) == null || y.call(p, c, this), (h = (C = n(this, D).config).onSettled) == null || h.call(
582
+ C,
583
+ c,
584
+ this.state.error,
585
+ this
586
+ ), this.scheduleGc();
587
+ },
588
+ onError: o,
589
+ onFail: (c, p) => {
590
+ w(this, A, Q).call(this, { type: "failed", failureCount: c, error: p });
591
+ },
592
+ onPause: () => {
593
+ w(this, A, Q).call(this, { type: "pause" });
594
+ },
595
+ onContinue: () => {
596
+ w(this, A, Q).call(this, { type: "continue" });
597
+ },
598
+ retry: u.options.retry,
599
+ retryDelay: u.options.retryDelay,
600
+ networkMode: u.options.networkMode,
601
+ canRun: () => !0
602
+ })), n(this, I).start();
603
+ }
604
+ }, se = new WeakMap(), re = new WeakMap(), D = new WeakMap(), B = new WeakMap(), I = new WeakMap(), he = new WeakMap(), $ = new WeakMap(), A = new WeakSet(), Q = function(e) {
605
+ const s = (r) => {
606
+ switch (e.type) {
607
+ case "failed":
608
+ return {
609
+ ...r,
610
+ fetchFailureCount: e.failureCount,
611
+ fetchFailureReason: e.error
612
+ };
613
+ case "pause":
614
+ return {
615
+ ...r,
616
+ fetchStatus: "paused"
617
+ };
618
+ case "continue":
619
+ return {
620
+ ...r,
621
+ fetchStatus: "fetching"
622
+ };
623
+ case "fetch":
624
+ return {
625
+ ...r,
626
+ ...dt(r.data, this.options),
627
+ fetchMeta: e.meta ?? null
628
+ };
629
+ case "success":
630
+ return {
631
+ ...r,
632
+ data: e.data,
633
+ dataUpdateCount: r.dataUpdateCount + 1,
634
+ dataUpdatedAt: e.dataUpdatedAt ?? Date.now(),
635
+ error: null,
636
+ isInvalidated: !1,
637
+ status: "success",
638
+ ...!e.manual && {
639
+ fetchStatus: "idle",
640
+ fetchFailureCount: 0,
641
+ fetchFailureReason: null
642
+ }
643
+ };
644
+ case "error":
645
+ const i = e.error;
646
+ return ge(i) && i.revert && n(this, re) ? { ...n(this, re), fetchStatus: "idle" } : {
647
+ ...r,
648
+ error: i,
649
+ errorUpdateCount: r.errorUpdateCount + 1,
650
+ errorUpdatedAt: Date.now(),
651
+ fetchFailureCount: r.fetchFailureCount + 1,
652
+ fetchFailureReason: i,
653
+ fetchStatus: "idle",
654
+ status: "error"
655
+ };
656
+ case "invalidate":
657
+ return {
658
+ ...r,
659
+ isInvalidated: !0
660
+ };
661
+ case "setState":
662
+ return {
663
+ ...r,
664
+ ...e.state
665
+ };
666
+ }
667
+ };
668
+ this.state = s(this.state), Me.batch(() => {
669
+ this.observers.forEach((r) => {
670
+ r.onQueryUpdate();
671
+ }), n(this, D).notify({ query: this, type: "updated", action: e });
672
+ });
673
+ }, it);
674
+ function dt(t, e) {
675
+ return {
676
+ fetchFailureCount: 0,
677
+ fetchFailureReason: null,
678
+ fetchStatus: ht(e.networkMode) ? "fetching" : "paused",
679
+ ...t === void 0 && {
680
+ error: null,
681
+ status: "pending"
682
+ }
683
+ };
684
+ }
685
+ function Ut(t) {
686
+ const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, r = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
687
+ return {
688
+ data: e,
689
+ dataUpdateCount: 0,
690
+ dataUpdatedAt: s ? r ?? Date.now() : 0,
691
+ error: null,
692
+ errorUpdateCount: 0,
693
+ errorUpdatedAt: 0,
694
+ fetchFailureCount: 0,
695
+ fetchFailureReason: null,
696
+ fetchMeta: null,
697
+ isInvalidated: !1,
698
+ status: s ? "success" : "pending",
699
+ fetchStatus: "idle"
700
+ };
701
+ }
702
+ var T, b, le, P, G, ne, N, U, de, ie, ae, z, J, _, oe, S, ue, Pe, Te, De, je, Ae, xe, ke, yt, at, ft = (at = class extends qe {
703
+ constructor(e, s) {
704
+ super();
705
+ g(this, S);
706
+ g(this, T);
707
+ g(this, b);
708
+ g(this, le);
709
+ g(this, P);
710
+ g(this, G);
711
+ g(this, ne);
712
+ g(this, N);
713
+ g(this, U);
714
+ g(this, de);
715
+ g(this, ie);
716
+ // This property keeps track of the last query with defined data.
717
+ // It will be used to pass the previous data and query to the placeholder function between renders.
718
+ g(this, ae);
719
+ g(this, z);
720
+ g(this, J);
721
+ g(this, _);
722
+ g(this, oe, /* @__PURE__ */ new Set());
723
+ this.options = s, d(this, T, e), d(this, U, null), d(this, N, Fe()), this.options.experimental_prefetchInRender || n(this, N).reject(
724
+ new Error("experimental_prefetchInRender feature flag is not enabled")
725
+ ), this.bindMethods(), this.setOptions(s);
726
+ }
727
+ bindMethods() {
728
+ this.refetch = this.refetch.bind(this);
729
+ }
730
+ onSubscribe() {
731
+ this.listeners.size === 1 && (n(this, b).addObserver(this), Ze(n(this, b), this.options) ? w(this, S, ue).call(this) : this.updateResult(), w(this, S, je).call(this));
732
+ }
733
+ onUnsubscribe() {
734
+ this.hasListeners() || this.destroy();
735
+ }
736
+ shouldFetchOnReconnect() {
737
+ return Ue(
738
+ n(this, b),
739
+ this.options,
740
+ this.options.refetchOnReconnect
741
+ );
742
+ }
743
+ shouldFetchOnWindowFocus() {
744
+ return Ue(
745
+ n(this, b),
746
+ this.options,
747
+ this.options.refetchOnWindowFocus
748
+ );
749
+ }
750
+ destroy() {
751
+ this.listeners = /* @__PURE__ */ new Set(), w(this, S, Ae).call(this), w(this, S, xe).call(this), n(this, b).removeObserver(this);
752
+ }
753
+ setOptions(e, s) {
754
+ const r = this.options, i = n(this, b);
755
+ if (this.options = n(this, T).defaultQueryOptions(e), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof x(this.options.enabled, n(this, b)) != "boolean")
756
+ throw new Error(
757
+ "Expected enabled to be a boolean or a callback that returns a boolean"
758
+ );
759
+ w(this, S, ke).call(this), n(this, b).setOptions(this.options), r._defaulted && !Ce(this.options, r) && n(this, T).getQueryCache().notify({
760
+ type: "observerOptionsUpdated",
761
+ query: n(this, b),
762
+ observer: this
763
+ });
764
+ const a = this.hasListeners();
765
+ a && We(
766
+ n(this, b),
767
+ i,
768
+ this.options,
769
+ r
770
+ ) && w(this, S, ue).call(this), this.updateResult(s), a && (n(this, b) !== i || x(this.options.enabled, n(this, b)) !== x(r.enabled, n(this, b)) || ye(this.options.staleTime, n(this, b)) !== ye(r.staleTime, n(this, b))) && w(this, S, Pe).call(this);
771
+ const u = w(this, S, Te).call(this);
772
+ a && (n(this, b) !== i || x(this.options.enabled, n(this, b)) !== x(r.enabled, n(this, b)) || u !== n(this, _)) && w(this, S, De).call(this, u);
773
+ }
774
+ getOptimisticResult(e) {
775
+ const s = n(this, T).getQueryCache().build(n(this, T), e), r = this.createResult(s, e);
776
+ return qt(this, r) && (d(this, P, r), d(this, ne, this.options), d(this, G, n(this, b).state)), r;
777
+ }
778
+ getCurrentResult() {
779
+ return n(this, P);
780
+ }
781
+ trackResult(e, s) {
782
+ const r = {};
783
+ return Object.keys(e).forEach((i) => {
784
+ Object.defineProperty(r, i, {
785
+ configurable: !1,
786
+ enumerable: !0,
787
+ get: () => (this.trackProp(i), s == null || s(i), e[i])
788
+ });
789
+ }), r;
790
+ }
791
+ trackProp(e) {
792
+ n(this, oe).add(e);
793
+ }
794
+ getCurrentQuery() {
795
+ return n(this, b);
796
+ }
797
+ refetch({ ...e } = {}) {
798
+ return this.fetch({
799
+ ...e
800
+ });
801
+ }
802
+ fetchOptimistic(e) {
803
+ const s = n(this, T).defaultQueryOptions(e), r = n(this, T).getQueryCache().build(n(this, T), s);
804
+ return r.fetch().then(() => this.createResult(r, s));
805
+ }
806
+ fetch(e) {
807
+ return w(this, S, ue).call(this, {
808
+ ...e,
809
+ cancelRefetch: e.cancelRefetch ?? !0
810
+ }).then(() => (this.updateResult(), n(this, P)));
811
+ }
812
+ createResult(e, s) {
813
+ var Be;
814
+ const r = n(this, b), i = this.options, a = n(this, P), u = n(this, G), o = n(this, ne), f = e !== r ? e.state : n(this, le), { state: m } = e;
815
+ let c = { ...m }, p = !1, y;
816
+ if (s._optimisticResults) {
817
+ const F = this.hasListeners(), W = !F && Ze(e, s), Y = F && We(e, r, s, i);
818
+ (W || Y) && (c = {
819
+ ...c,
820
+ ...dt(m.data, e.options)
821
+ }), s._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
822
+ }
823
+ let { error: C, errorUpdatedAt: h, status: v } = c;
824
+ if (s.select && c.data !== void 0)
825
+ if (a && c.data === (u == null ? void 0 : u.data) && s.select === n(this, de))
826
+ y = n(this, ie);
827
+ else
828
+ try {
829
+ d(this, de, s.select), y = s.select(c.data), y = Ie(a == null ? void 0 : a.data, y, s), d(this, ie, y), d(this, U, null);
830
+ } catch (F) {
831
+ d(this, U, F);
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(
849
+ a == null ? void 0 : a.data,
850
+ F,
851
+ s
852
+ ), p = !0);
853
+ }
854
+ n(this, U) && (C = n(this, U), y = n(this, ie), h = Date.now(), v = "error");
855
+ const E = c.fetchStatus === "fetching", R = v === "pending", O = v === "error", q = R && E, Z = y !== void 0, k = {
856
+ status: v,
857
+ fetchStatus: c.fetchStatus,
858
+ isPending: R,
859
+ isSuccess: v === "success",
860
+ isError: O,
861
+ isInitialLoading: q,
862
+ isLoading: q,
863
+ data: y,
864
+ dataUpdatedAt: c.dataUpdatedAt,
865
+ error: C,
866
+ errorUpdatedAt: h,
867
+ failureCount: c.fetchFailureCount,
868
+ failureReason: c.fetchFailureReason,
869
+ errorUpdateCount: c.errorUpdateCount,
870
+ isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
871
+ isFetchedAfterMount: c.dataUpdateCount > f.dataUpdateCount || c.errorUpdateCount > f.errorUpdateCount,
872
+ isFetching: E,
873
+ isRefetching: E && !R,
874
+ isLoadingError: O && !Z,
875
+ isPaused: c.fetchStatus === "paused",
876
+ isPlaceholderData: p,
877
+ isRefetchError: O && Z,
878
+ isStale: Ne(e, s),
879
+ refetch: this.refetch,
880
+ promise: n(this, N)
881
+ };
882
+ if (this.options.experimental_prefetchInRender) {
883
+ const F = (fe) => {
884
+ k.status === "error" ? fe.reject(k.error) : k.data !== void 0 && fe.resolve(k.data);
885
+ }, W = () => {
886
+ const fe = d(this, N, k.promise = Fe());
887
+ F(fe);
888
+ }, Y = n(this, N);
889
+ switch (Y.status) {
890
+ case "pending":
891
+ e.queryHash === r.queryHash && F(Y);
892
+ break;
893
+ case "fulfilled":
894
+ (k.status === "error" || k.data !== Y.value) && W();
895
+ break;
896
+ case "rejected":
897
+ (k.status !== "error" || k.error !== Y.reason) && W();
898
+ break;
899
+ }
900
+ }
901
+ return k;
902
+ }
903
+ updateResult(e) {
904
+ const s = n(this, P), r = this.createResult(n(this, b), this.options);
905
+ if (d(this, G, n(this, b).state), d(this, ne, this.options), n(this, G).data !== void 0 && d(this, ae, n(this, b)), Ce(r, s))
906
+ return;
907
+ d(this, P, r);
908
+ const i = {}, a = () => {
909
+ if (!s)
910
+ return !0;
911
+ const { notifyOnChangeProps: u } = this.options, o = typeof u == "function" ? u() : u;
912
+ if (o === "all" || !o && !n(this, oe).size)
913
+ return !0;
914
+ const l = new Set(
915
+ o ?? n(this, oe)
916
+ );
917
+ return this.options.throwOnError && l.add("error"), Object.keys(n(this, P)).some((f) => {
918
+ const m = f;
919
+ return n(this, P)[m] !== s[m] && l.has(m);
920
+ });
921
+ };
922
+ (e == null ? void 0 : e.listeners) !== !1 && a() && (i.listeners = !0), w(this, S, yt).call(this, { ...i, ...e });
923
+ }
924
+ onQueryUpdate() {
925
+ this.updateResult(), this.hasListeners() && w(this, S, je).call(this);
926
+ }
927
+ }, T = new WeakMap(), b = new WeakMap(), le = new WeakMap(), P = new WeakMap(), G = new WeakMap(), ne = new WeakMap(), N = new WeakMap(), U = new WeakMap(), de = new WeakMap(), ie = new WeakMap(), ae = new WeakMap(), z = new WeakMap(), J = new WeakMap(), _ = new WeakMap(), oe = new WeakMap(), S = new WeakSet(), ue = function(e) {
928
+ w(this, S, ke).call(this);
929
+ let s = n(this, b).fetch(
930
+ this.options,
931
+ e
932
+ );
933
+ return e != null && e.throwOnError || (s = s.catch(Se)), s;
934
+ }, Pe = function() {
935
+ w(this, S, Ae).call(this);
936
+ const e = ye(
937
+ this.options.staleTime,
938
+ n(this, b)
939
+ );
940
+ if (V || n(this, P).isStale || !we(e))
941
+ return;
942
+ const r = ot(n(this, P).dataUpdatedAt, e) + 1;
943
+ d(this, z, setTimeout(() => {
944
+ n(this, P).isStale || this.updateResult();
945
+ }, r));
946
+ }, Te = function() {
947
+ return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(n(this, b)) : this.options.refetchInterval) ?? !1;
948
+ }, De = function(e) {
949
+ w(this, S, xe).call(this), d(this, _, e), !(V || x(this.options.enabled, n(this, b)) === !1 || !we(n(this, _)) || n(this, _) === 0) && d(this, J, setInterval(() => {
950
+ (this.options.refetchIntervalInBackground || ut.isFocused()) && w(this, S, ue).call(this);
951
+ }, n(this, _)));
952
+ }, je = function() {
953
+ w(this, S, Pe).call(this), w(this, S, De).call(this, w(this, S, Te).call(this));
954
+ }, Ae = function() {
955
+ n(this, z) && (clearTimeout(n(this, z)), d(this, z, void 0));
956
+ }, xe = function() {
957
+ n(this, J) && (clearInterval(n(this, J)), d(this, J, void 0));
958
+ }, ke = function() {
959
+ const e = n(this, T).getQueryCache().build(n(this, T), this.options);
960
+ if (e === n(this, b))
961
+ return;
962
+ const s = n(this, b);
963
+ d(this, b, e), d(this, le, e.state), this.hasListeners() && (s == null || s.removeObserver(this), e.addObserver(this));
964
+ }, yt = function(e) {
965
+ Me.batch(() => {
966
+ e.listeners && this.listeners.forEach((s) => {
967
+ s(n(this, P));
968
+ }), n(this, T).getQueryCache().notify({
969
+ query: n(this, b),
970
+ type: "observerResultsUpdated"
971
+ });
972
+ });
973
+ }, at);
974
+ function Qt(t, e) {
975
+ return x(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
976
+ }
977
+ function Ze(t, e) {
978
+ return Qt(t, e) || t.state.data !== void 0 && Ue(t, e, e.refetchOnMount);
979
+ }
980
+ function Ue(t, e, s) {
981
+ if (x(e.enabled, t) !== !1) {
982
+ const r = typeof s == "function" ? s(t) : s;
983
+ return r === "always" || r !== !1 && Ne(t, e);
984
+ }
985
+ return !1;
986
+ }
987
+ function We(t, e, s, r) {
988
+ return (t !== e || x(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && Ne(t, s);
989
+ }
990
+ function Ne(t, e) {
991
+ return x(e.enabled, t) !== !1 && t.isStaleByTime(ye(e.staleTime, t));
992
+ }
993
+ function qt(t, e) {
994
+ return !Ce(t.getCurrentResult(), e);
995
+ }
996
+ var pt = j.createContext(
997
+ void 0
998
+ ), vt = (t) => {
999
+ const e = j.useContext(pt);
1000
+ if (t)
1001
+ return t;
1002
+ if (!e)
1003
+ throw new Error("No QueryClient set, use QueryClientProvider to set one");
1004
+ return e;
1005
+ }, Cs = ({
1006
+ client: t,
1007
+ children: e
1008
+ }) => (j.useEffect(() => (t.mount(), () => {
1009
+ t.unmount();
1010
+ }), [t]), /* @__PURE__ */ Ot.jsx(pt.Provider, { value: t, children: e })), bt = j.createContext(!1), Lt = () => j.useContext(bt);
1011
+ bt.Provider;
1012
+ function Mt() {
1013
+ let t = !1;
1014
+ return {
1015
+ clearReset: () => {
1016
+ t = !1;
1017
+ },
1018
+ reset: () => {
1019
+ t = !0;
1020
+ },
1021
+ isReset: () => t
1022
+ };
1023
+ }
1024
+ var Nt = j.createContext(Mt()), _t = () => j.useContext(Nt);
1025
+ function Ht(t, e) {
1026
+ return typeof t == "function" ? t(...e) : !!t;
1027
+ }
1028
+ function Ye() {
1029
+ }
1030
+ var Kt = (t, e) => {
1031
+ (t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
1032
+ }, Bt = (t) => {
1033
+ j.useEffect(() => {
1034
+ t.clearReset();
1035
+ }, [t]);
1036
+ }, $t = ({
1037
+ result: t,
1038
+ errorResetBoundary: e,
1039
+ throwOnError: s,
1040
+ query: r,
1041
+ suspense: i
1042
+ }) => t.isError && !e.isReset() && !t.isFetching && r && (i && t.data === void 0 || Ht(s, [t.error, r])), Gt = (t, e) => e.state.data === void 0, zt = (t) => {
1043
+ const e = t.staleTime;
1044
+ 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, Vt = (t, e) => (t == null ? void 0 : t.suspense) && e.isPending, Xe = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1046
+ s.clearReset();
1047
+ });
1048
+ function mt(t, e, s) {
1049
+ var c, p, y, C, h;
1050
+ if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
1051
+ throw new Error(
1052
+ '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
+ );
1054
+ const r = vt(s), i = Lt(), a = _t(), u = r.defaultQueryOptions(t);
1055
+ (p = (c = r.getDefaultOptions().queries) == null ? void 0 : c._experimental_beforeQuery) == null || p.call(
1056
+ c,
1057
+ u
1058
+ ), u._optimisticResults = i ? "isRestoring" : "optimistic", zt(u), Kt(u, a), Bt(a);
1059
+ const o = !r.getQueryCache().get(u.queryHash), [l] = j.useState(
1060
+ () => new e(
1061
+ r,
1062
+ u
1063
+ )
1064
+ ), f = l.getOptimisticResult(u), m = !i && t.subscribed !== !1;
1065
+ if (j.useSyncExternalStore(
1066
+ j.useCallback(
1067
+ (v) => {
1068
+ const E = m ? l.subscribe(Me.batchCalls(v)) : Ye;
1069
+ return l.updateResult(), E;
1070
+ },
1071
+ [l, m]
1072
+ ),
1073
+ () => l.getCurrentResult(),
1074
+ () => l.getCurrentResult()
1075
+ ), j.useEffect(() => {
1076
+ l.setOptions(u, { listeners: !1 });
1077
+ }, [u, l]), Vt(u, f))
1078
+ throw Xe(u, l, a);
1079
+ if ($t({
1080
+ result: f,
1081
+ errorResetBoundary: a,
1082
+ throwOnError: u.throwOnError,
1083
+ query: r.getQueryCache().get(u.queryHash),
1084
+ suspense: u.suspense
1085
+ }))
1086
+ throw f.error;
1087
+ if ((C = (y = r.getDefaultOptions().queries) == null ? void 0 : y._experimental_afterQuery) == null || C.call(
1088
+ y,
1089
+ u,
1090
+ f
1091
+ ), u.experimental_prefetchInRender && !V && Jt(f, i)) {
1092
+ const v = o ? (
1093
+ // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1094
+ Xe(u, l, a)
1095
+ ) : (
1096
+ // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1097
+ (h = r.getQueryCache().get(u.queryHash)) == null ? void 0 : h.promise
1098
+ );
1099
+ v == null || v.catch(Ye).finally(() => {
1100
+ l.updateResult();
1101
+ });
1102
+ }
1103
+ return u.notifyOnChangeProps ? f : l.trackResult(f);
1104
+ }
1105
+ function Zt(t, e) {
1106
+ return mt(t, ft, e);
1107
+ }
1108
+ function Wt(t, e) {
1109
+ return process.env.NODE_ENV !== "production" && t.queryFn === pe && console.error("skipToken is not allowed for useSuspenseQuery"), mt(
1110
+ {
1111
+ ...t,
1112
+ enabled: !0,
1113
+ suspense: !0,
1114
+ throwOnError: Gt,
1115
+ placeholderData: void 0
1116
+ },
1117
+ ft,
1118
+ e
1119
+ );
1120
+ }
1121
+ const Yt = /^(\w+:\/\/[^/?]+)?([^?]*)(\?.*)?$/, Xt = (t) => t.filter(
1122
+ (e) => e != null && e !== !1 && (typeof e == "string" || typeof e == "number")
1123
+ ).map((e) => `${e}`).filter((e) => e), es = (t) => {
1124
+ const e = t.join("/"), [, s = "", r = ""] = e.match(Yt) ?? [];
1125
+ return {
1126
+ prefix: s,
1127
+ pathname: r.split("/").filter((i) => i !== "")
1128
+ };
1129
+ }, ts = (t) => {
1130
+ const { prefix: e, pathname: s } = t;
1131
+ let r = e;
1132
+ return s.length > 0 ? (r ? r += "/" : r = "/", r += s.join("/")) : r || (r = "/"), r;
1133
+ }, et = (...t) => {
1134
+ const e = Xt(t), s = es(e);
1135
+ return ts(s);
1136
+ }, gt = Object.freeze({
1137
+ API_IDENTITIES: ["api-identities"]
1138
+ }), Os = () => {
1139
+ const t = vt();
1140
+ return {
1141
+ invalidateCache: async (e) => {
1142
+ await t.invalidateQueries({ queryKey: gt[e] });
1143
+ }
1144
+ };
1145
+ }, ss = "no-dehydrate", ce = (...t) => {
1146
+ const e = t.filter((s) => !!s).map((s) => s.replace(/(^\/+|\/+$)/g, "")).join("/").replace(/(^\/+|\/+$)/g, "");
1147
+ return e ? `/${e}` : "/";
1148
+ }, _e = (t, e) => {
1149
+ for (const s of t) {
1150
+ const r = He(s, e);
1151
+ if (r !== void 0) return r;
1152
+ }
1153
+ }, He = (t, e, s = []) => {
1154
+ const r = e(t, s);
1155
+ if (r !== void 0) return r;
1156
+ if (t.type === "category")
1157
+ for (const i of t.items) {
1158
+ const a = He(i, e, [
1159
+ ...s,
1160
+ t
1161
+ ]);
1162
+ if (a !== void 0) return a;
1163
+ }
1164
+ }, Is = () => {
1165
+ const t = ve(), s = St().sidebar;
1166
+ return _e(s, (r) => {
1167
+ if (r.type === "doc" && ce(r.id) === t.pathname)
1168
+ return r;
1169
+ });
1170
+ }, Fs = (t) => {
1171
+ const e = ve();
1172
+ return He(t, (s) => {
1173
+ if (s.type === "category" && s.link && ce(s.link.id) === e.pathname || s.type === "doc" && ce(s.id) === e.pathname)
1174
+ return !0;
1175
+ });
1176
+ }, Ps = () => {
1177
+ const t = ve().pathname, s = St().sidebar;
1178
+ let r, i, a = !1;
1179
+ return _e(s, (u) => {
1180
+ const o = u.type === "doc" ? ce(u.id) : u.type === "category" && u.link ? ce(u.link.id) : void 0;
1181
+ if (o) {
1182
+ if (a)
1183
+ return i = { label: u.label, id: o }, !0;
1184
+ t === o ? a = !0 : r = { label: u.label, id: o };
1185
+ }
1186
+ }), { prev: r, next: i };
1187
+ }, rs = Et(
1188
+ void 0
1189
+ ), Ke = () => {
1190
+ const t = Ct(rs);
1191
+ if (!t)
1192
+ throw new Error("useZudoku must be used within a ZudokuProvider.");
1193
+ return t;
1194
+ }, Ts = () => {
1195
+ const { getApiIdentities: t } = Ke();
1196
+ return Zt({
1197
+ queryFn: t,
1198
+ queryKey: gt.API_IDENTITIES
1199
+ });
1200
+ }, St = () => {
1201
+ var c;
1202
+ const { getPluginSidebar: t, sidebars: e, topNavigation: s, options: r } = Ke(), i = ve(), a = ds(), u = (c = r.protectedRoutes) == null ? void 0 : c.some(
1203
+ (p) => ze(p, i.pathname)
1204
+ );
1205
+ let o = Object.entries(e).find(([, p]) => _e(p, (y) => {
1206
+ if ((y.type === "doc" ? et(y.id) : y.type === "category" && y.link ? et(y.link.id) : void 0) === i.pathname)
1207
+ return y;
1208
+ }));
1209
+ const l = s.find((p) => p.id === (o == null ? void 0 : o[0])) ?? s.find((p) => ze(p.id, i.pathname));
1210
+ l && !o && l.id in e && (o = ["", e[l.id]]);
1211
+ const { data: f } = Wt({
1212
+ queryFn: () => t(i.pathname),
1213
+ // We just want to suspend here and don't store in SSR dehydrated state
1214
+ queryKey: ["plugin-sidebar", ss, i.pathname]
1215
+ });
1216
+ return {
1217
+ sidebar: a.isAuthEnabled && !a.isAuthenticated && u ? [] : [...o ? o[1] : [], ...f],
1218
+ topNavItem: l
1219
+ };
1220
+ }, tt = (t) => {
1221
+ let e;
1222
+ const s = /* @__PURE__ */ new Set(), r = (f, m) => {
1223
+ const c = typeof f == "function" ? f(e) : f;
1224
+ if (!Object.is(c, e)) {
1225
+ const p = e;
1226
+ e = m ?? (typeof c != "object" || c === null) ? c : Object.assign({}, e, c), s.forEach((y) => y(e, p));
1227
+ }
1228
+ }, i = () => e, o = { setState: r, getState: i, getInitialState: () => l, subscribe: (f) => (s.add(f), () => s.delete(f)) }, l = e = t(r, i, o);
1229
+ return o;
1230
+ }, ns = (t) => t ? tt(t) : tt, is = (t) => t;
1231
+ function as(t, e = is) {
1232
+ const s = Ge.useSyncExternalStore(
1233
+ t.subscribe,
1234
+ () => e(t.getState()),
1235
+ () => e(t.getInitialState())
1236
+ );
1237
+ return Ge.useDebugValue(s), s;
1238
+ }
1239
+ const os = (t) => {
1240
+ const e = ns(t), s = (r) => as(e, r);
1241
+ return Object.assign(s, e), s;
1242
+ }, us = (t) => os;
1243
+ function wt(t, e) {
1244
+ let s;
1245
+ try {
1246
+ s = t();
1247
+ } catch {
1248
+ return;
1249
+ }
1250
+ return {
1251
+ getItem: (i) => {
1252
+ var a;
1253
+ const u = (l) => l === null ? null : JSON.parse(l, void 0), o = (a = s.getItem(i)) != null ? a : null;
1254
+ return o instanceof Promise ? o.then(u) : u(o);
1255
+ },
1256
+ setItem: (i, a) => s.setItem(
1257
+ i,
1258
+ JSON.stringify(a, void 0)
1259
+ ),
1260
+ removeItem: (i) => s.removeItem(i)
1261
+ };
1262
+ }
1263
+ const Qe = (t) => (e) => {
1264
+ try {
1265
+ const s = t(e);
1266
+ return s instanceof Promise ? s : {
1267
+ then(r) {
1268
+ return Qe(r)(s);
1269
+ },
1270
+ catch(r) {
1271
+ return this;
1272
+ }
1273
+ };
1274
+ } catch (s) {
1275
+ return {
1276
+ then(r) {
1277
+ return this;
1278
+ },
1279
+ catch(r) {
1280
+ return Qe(r)(s);
1281
+ }
1282
+ };
1283
+ }
1284
+ }, cs = (t, e) => (s, r, i) => {
1285
+ let a = {
1286
+ storage: wt(() => localStorage),
1287
+ partialize: (h) => h,
1288
+ version: 0,
1289
+ merge: (h, v) => ({
1290
+ ...v,
1291
+ ...h
1292
+ }),
1293
+ ...e
1294
+ }, u = !1;
1295
+ const o = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
1296
+ let f = a.storage;
1297
+ if (!f)
1298
+ return t(
1299
+ (...h) => {
1300
+ console.warn(
1301
+ `[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`
1302
+ ), s(...h);
1303
+ },
1304
+ r,
1305
+ i
1306
+ );
1307
+ const m = () => {
1308
+ const h = a.partialize({ ...r() });
1309
+ return f.setItem(a.name, {
1310
+ state: h,
1311
+ version: a.version
1312
+ });
1313
+ }, c = i.setState;
1314
+ i.setState = (h, v) => {
1315
+ c(h, v), m();
1316
+ };
1317
+ const p = t(
1318
+ (...h) => {
1319
+ s(...h), m();
1320
+ },
1321
+ r,
1322
+ i
1323
+ );
1324
+ i.getInitialState = () => p;
1325
+ let y;
1326
+ const C = () => {
1327
+ var h, v;
1328
+ if (!f) return;
1329
+ u = !1, o.forEach((R) => {
1330
+ var O;
1331
+ return R((O = r()) != null ? O : p);
1332
+ });
1333
+ const E = ((v = a.onRehydrateStorage) == null ? void 0 : v.call(a, (h = r()) != null ? h : p)) || void 0;
1334
+ return Qe(f.getItem.bind(f))(a.name).then((R) => {
1335
+ if (R)
1336
+ if (typeof R.version == "number" && R.version !== a.version) {
1337
+ if (a.migrate) {
1338
+ const O = a.migrate(
1339
+ R.state,
1340
+ R.version
1341
+ );
1342
+ return O instanceof Promise ? O.then((q) => [!0, q]) : [!0, O];
1343
+ }
1344
+ console.error(
1345
+ "State loaded from storage couldn't be migrated since no migrate function was provided"
1346
+ );
1347
+ } else
1348
+ return [!1, R.state];
1349
+ return [!1, void 0];
1350
+ }).then((R) => {
1351
+ var O;
1352
+ const [q, Z] = R;
1353
+ if (y = a.merge(
1354
+ Z,
1355
+ (O = r()) != null ? O : p
1356
+ ), s(y, !0), q)
1357
+ return m();
1358
+ }).then(() => {
1359
+ E == null || E(y, void 0), y = r(), u = !0, l.forEach((R) => R(y));
1360
+ }).catch((R) => {
1361
+ E == null || E(void 0, R);
1362
+ });
1363
+ };
1364
+ return i.persist = {
1365
+ setOptions: (h) => {
1366
+ a = {
1367
+ ...a,
1368
+ ...h
1369
+ }, h.storage && (f = h.storage);
1370
+ },
1371
+ clearStorage: () => {
1372
+ f == null || f.removeItem(a.name);
1373
+ },
1374
+ getOptions: () => a,
1375
+ rehydrate: () => C(),
1376
+ hasHydrated: () => u,
1377
+ onHydrate: (h) => (o.add(h), () => {
1378
+ o.delete(h);
1379
+ }),
1380
+ onFinishHydration: (h) => (l.add(h), () => {
1381
+ l.delete(h);
1382
+ })
1383
+ }, a.skipHydration || C(), y || p;
1384
+ }, hs = cs, ls = (t) => {
1385
+ const e = (s) => {
1386
+ s.key === t.persist.getOptions().name && s.newValue && t.persist.rehydrate();
1387
+ };
1388
+ return window.addEventListener("storage", e), () => {
1389
+ window.removeEventListener("storage", e);
1390
+ };
1391
+ }, Rt = us()(
1392
+ hs(
1393
+ (t) => ({
1394
+ isAuthenticated: !1,
1395
+ isPending: !0,
1396
+ profile: null,
1397
+ providerData: null
1398
+ }),
1399
+ {
1400
+ merge: (t, e) => ({
1401
+ ...e,
1402
+ isPending: !1,
1403
+ ...typeof t == "object" ? t : {}
1404
+ }),
1405
+ name: "auth-state",
1406
+ storage: wt(() => localStorage)
1407
+ }
1408
+ )
1409
+ );
1410
+ typeof window < "u" && ls(Rt);
1411
+ const ds = () => {
1412
+ const { authentication: t } = Ke(), e = Rt(), s = typeof t < "u";
1413
+ return {
1414
+ isAuthEnabled: s,
1415
+ ...e,
1416
+ login: async () => {
1417
+ if (!s)
1418
+ throw new Error("Authentication is not enabled.");
1419
+ await t.signIn({
1420
+ redirectTo: window.location.href
1421
+ });
1422
+ },
1423
+ logout: async () => {
1424
+ if (!s)
1425
+ throw new Error("Authentication is not enabled.");
1426
+ await t.signOut(), window.location.href = "/";
1427
+ },
1428
+ signup: async () => {
1429
+ if (!s)
1430
+ throw new Error("Authentication is not enabled.");
1431
+ await t.signUp({
1432
+ redirectTo: window.location.href
1433
+ });
1434
+ }
1435
+ };
1436
+ };
1437
+ export {
1438
+ Rs as A,
1439
+ ws as B,
1440
+ ut as C,
1441
+ ct as D,
1442
+ ye as E,
1443
+ bs as F,
1444
+ Le as G,
1445
+ pe as H,
1446
+ Cs as I,
1447
+ St as J,
1448
+ _e as K,
1449
+ Os as L,
1450
+ gt as M,
1451
+ Fs as N,
1452
+ Es as Q,
1453
+ kt as R,
1454
+ qe as S,
1455
+ rs as Z,
1456
+ Is as a,
1457
+ Ps as b,
1458
+ At as c,
1459
+ Wt as d,
1460
+ Ke as e,
1461
+ et as f,
1462
+ vt as g,
1463
+ Re as h,
1464
+ Ye as i,
1465
+ ce as j,
1466
+ Ht as k,
1467
+ ds as l,
1468
+ Zt as m,
1469
+ Me as n,
1470
+ Ss as o,
1471
+ us as p,
1472
+ hs as q,
1473
+ wt as r,
1474
+ Ce as s,
1475
+ Ts as t,
1476
+ Rt as u,
1477
+ It as v,
1478
+ ms as w,
1479
+ gs as x,
1480
+ Se as y,
1481
+ Pt as z
1482
+ };
1483
+ //# sourceMappingURL=hook-CqpVYDqN.js.map