zudoku 0.0.0-feat-openapi-docs-redesign.dab3fc6a → 0.0.0-feat-navigation-at-property.z8cd07fa5

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 (656) hide show
  1. package/dist/app/main.d.ts +6 -6
  2. package/dist/app/main.js +1 -1
  3. package/dist/app/main.js.map +1 -1
  4. package/dist/app/sentry.js +1 -1
  5. package/dist/cli/common/version-check.js +12 -3
  6. package/dist/cli/common/version-check.js.map +1 -1
  7. package/dist/config/create-plugin.d.ts +2 -0
  8. package/dist/config/create-plugin.js +55 -0
  9. package/dist/config/create-plugin.js.map +1 -0
  10. package/dist/config/loader.js +3 -1
  11. package/dist/config/loader.js.map +1 -1
  12. package/dist/config/validators/BuildSchema.js +18 -3
  13. package/dist/config/validators/BuildSchema.js.map +1 -1
  14. package/dist/config/validators/InputNavigationSchema.d.ts +133 -45
  15. package/dist/config/validators/InputNavigationSchema.js +30 -0
  16. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  17. package/dist/config/validators/NavigationSchema.d.ts +18 -4
  18. package/dist/config/validators/NavigationSchema.js +15 -5
  19. package/dist/config/validators/NavigationSchema.js.map +1 -1
  20. package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
  21. package/dist/config/validators/validate.d.ts +104 -14
  22. package/dist/config/validators/validate.js +15 -4
  23. package/dist/config/validators/validate.js.map +1 -1
  24. package/dist/config/validators/validate.test.js +43 -0
  25. package/dist/config/validators/validate.test.js.map +1 -1
  26. package/dist/flat-config.d.ts +68 -32
  27. package/dist/index.d.ts +4 -2
  28. package/dist/index.js +3 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/lib/auth/issuer.js +1 -1
  31. package/dist/lib/auth/issuer.js.map +1 -1
  32. package/dist/lib/authentication/authentication.d.ts +3 -2
  33. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  34. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  35. package/dist/lib/authentication/components/SignIn.js +4 -2
  36. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  37. package/dist/lib/authentication/components/SignUp.js +4 -2
  38. package/dist/lib/authentication/components/SignUp.js.map +1 -1
  39. package/dist/lib/authentication/hook.d.ts +2 -0
  40. package/dist/lib/authentication/hook.js +10 -0
  41. package/dist/lib/authentication/hook.js.map +1 -1
  42. package/dist/lib/authentication/providers/auth0.js +17 -8
  43. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  44. package/dist/lib/authentication/providers/clerk.js +0 -22
  45. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  46. package/dist/lib/authentication/providers/firebase.js +67 -9
  47. package/dist/lib/authentication/providers/firebase.js.map +1 -1
  48. package/dist/lib/authentication/providers/supabase.js +6 -15
  49. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  50. package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
  51. package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
  52. package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
  53. package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +7 -2
  54. package/dist/lib/authentication/ui/ZudokuAuthUi.js +48 -12
  55. package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -1
  56. package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
  57. package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
  58. package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
  59. package/dist/lib/components/Bootstrap.js +1 -2
  60. package/dist/lib/components/Bootstrap.js.map +1 -1
  61. package/dist/lib/components/Heading.d.ts +1 -1
  62. package/dist/lib/components/Mermaid.d.ts +7 -0
  63. package/dist/lib/components/Mermaid.js +42 -0
  64. package/dist/lib/components/Mermaid.js.map +1 -0
  65. package/dist/lib/components/MobileTopNavigation.js +3 -2
  66. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  67. package/dist/lib/components/PagefindSearchMeta.d.ts +8 -0
  68. package/dist/lib/components/PagefindSearchMeta.js +7 -0
  69. package/dist/lib/components/PagefindSearchMeta.js.map +1 -0
  70. package/dist/lib/components/Pagination.js +2 -2
  71. package/dist/lib/components/Pagination.js.map +1 -1
  72. package/dist/lib/components/Slot.test.js +1 -1
  73. package/dist/lib/components/Slot.test.js.map +1 -1
  74. package/dist/lib/components/TopNavigation.d.ts +7 -1
  75. package/dist/lib/components/TopNavigation.js +8 -3
  76. package/dist/lib/components/TopNavigation.js.map +1 -1
  77. package/dist/lib/components/Zudoku.d.ts +4 -1
  78. package/dist/lib/components/Zudoku.js +5 -11
  79. package/dist/lib/components/Zudoku.js.map +1 -1
  80. package/dist/lib/components/context/ZudokuContext.d.ts +9 -4
  81. package/dist/lib/components/context/ZudokuContext.js +26 -8
  82. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  83. package/dist/lib/components/context/ZudokuProvider.js +1 -1
  84. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  85. package/dist/lib/components/context/ZudokuReactContext.d.ts +11 -0
  86. package/dist/lib/components/context/ZudokuReactContext.js +4 -0
  87. package/dist/lib/components/context/ZudokuReactContext.js.map +1 -0
  88. package/dist/lib/components/index.d.ts +18 -69
  89. package/dist/lib/components/index.js +19 -32
  90. package/dist/lib/components/index.js.map +1 -1
  91. package/dist/lib/components/navigation/Navigation.js +4 -3
  92. package/dist/lib/components/navigation/Navigation.js.map +1 -1
  93. package/dist/lib/components/navigation/NavigationCategory.js +8 -0
  94. package/dist/lib/components/navigation/NavigationCategory.js.map +1 -1
  95. package/dist/lib/components/navigation/NavigationFilterContext.d.ts +8 -0
  96. package/dist/lib/components/navigation/NavigationFilterContext.js +12 -0
  97. package/dist/lib/components/navigation/NavigationFilterContext.js.map +1 -0
  98. package/dist/lib/components/navigation/NavigationFilterInput.d.ts +3 -0
  99. package/dist/lib/components/navigation/NavigationFilterInput.js +9 -0
  100. package/dist/lib/components/navigation/NavigationFilterInput.js.map +1 -0
  101. package/dist/lib/components/navigation/NavigationItem.js +13 -3
  102. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  103. package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
  104. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
  105. package/dist/lib/components/navigation/utils.d.ts +6 -1
  106. package/dist/lib/components/navigation/utils.js +26 -2
  107. package/dist/lib/components/navigation/utils.js.map +1 -1
  108. package/dist/lib/core/RouteGuard.js +12 -7
  109. package/dist/lib/core/RouteGuard.js.map +1 -1
  110. package/dist/lib/core/ZudokuContext.d.ts +2 -1
  111. package/dist/lib/core/ZudokuContext.js +3 -1
  112. package/dist/lib/core/ZudokuContext.js.map +1 -1
  113. package/dist/lib/core/__internal.d.ts +1 -0
  114. package/dist/lib/core/__internal.js +2 -0
  115. package/dist/lib/core/__internal.js.map +1 -1
  116. package/dist/lib/core/plugins.d.ts +18 -4
  117. package/dist/lib/core/plugins.js +1 -0
  118. package/dist/lib/core/plugins.js.map +1 -1
  119. package/dist/lib/core/react-query.d.ts +1 -0
  120. package/dist/lib/core/react-query.js +2 -0
  121. package/dist/lib/core/react-query.js.map +1 -0
  122. package/dist/lib/core/transform-config.d.ts +4 -0
  123. package/dist/lib/core/transform-config.js +42 -0
  124. package/dist/lib/core/transform-config.js.map +1 -0
  125. package/dist/lib/core/transform-config.test.d.ts +1 -0
  126. package/dist/lib/core/transform-config.test.js +83 -0
  127. package/dist/lib/core/transform-config.test.js.map +1 -0
  128. package/dist/lib/errors/ErrorAlert.js +1 -2
  129. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  130. package/dist/lib/errors/ErrorMessage.d.ts +3 -0
  131. package/dist/lib/errors/ErrorMessage.js +16 -0
  132. package/dist/lib/errors/ErrorMessage.js.map +1 -0
  133. package/dist/lib/hooks/index.d.ts +7 -28
  134. package/dist/lib/hooks/index.js +7 -15
  135. package/dist/lib/hooks/index.js.map +1 -1
  136. package/dist/lib/hooks/useEvent.test.js +1 -1
  137. package/dist/lib/hooks/useEvent.test.js.map +1 -1
  138. package/dist/lib/navigation/pathMatcher.d.ts +8 -0
  139. package/dist/lib/navigation/pathMatcher.js +62 -0
  140. package/dist/lib/navigation/pathMatcher.js.map +1 -0
  141. package/dist/lib/navigation/pathMatcher.test.d.ts +1 -0
  142. package/dist/lib/navigation/pathMatcher.test.js +115 -0
  143. package/dist/lib/navigation/pathMatcher.test.js.map +1 -0
  144. package/dist/lib/navigation/positionItems.d.ts +10 -0
  145. package/dist/lib/navigation/positionItems.js +54 -0
  146. package/dist/lib/navigation/positionItems.js.map +1 -0
  147. package/dist/lib/navigation/positionItems.test.d.ts +1 -0
  148. package/dist/lib/navigation/positionItems.test.js +229 -0
  149. package/dist/lib/navigation/positionItems.test.js.map +1 -0
  150. package/dist/lib/oas/graphql/circular.d.ts +2 -0
  151. package/dist/lib/oas/graphql/circular.js +21 -16
  152. package/dist/lib/oas/graphql/circular.js.map +1 -1
  153. package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
  154. package/dist/lib/oas/graphql/circular.test.js +183 -0
  155. package/dist/lib/oas/graphql/circular.test.js.map +1 -0
  156. package/dist/lib/oas/graphql/index.js +7 -3
  157. package/dist/lib/oas/graphql/index.js.map +1 -1
  158. package/dist/lib/oas/parser/index.d.ts +1 -0
  159. package/dist/lib/oas/parser/index.js +14 -5
  160. package/dist/lib/oas/parser/index.js.map +1 -1
  161. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
  162. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  163. package/dist/lib/plugins/api-keys/index.d.ts +11 -4
  164. package/dist/lib/plugins/api-keys/index.js +36 -22
  165. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  166. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
  167. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
  168. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
  169. package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
  170. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
  171. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
  172. package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
  173. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
  174. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
  175. package/dist/lib/plugins/openapi/DownloadSchemaButton.d.ts +3 -0
  176. package/dist/lib/plugins/openapi/DownloadSchemaButton.js +47 -0
  177. package/dist/lib/plugins/openapi/DownloadSchemaButton.js.map +1 -0
  178. package/dist/lib/plugins/openapi/Endpoint.js +3 -6
  179. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  180. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +1 -1
  181. package/dist/lib/plugins/openapi/OasProvider.js +26 -13
  182. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
  183. package/dist/lib/plugins/openapi/OperationList.js +20 -10
  184. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  185. package/dist/lib/plugins/openapi/OperationListItem.js +2 -2
  186. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  187. package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
  188. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
  189. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  190. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  191. package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +2 -1
  192. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +4 -3
  193. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  194. package/dist/lib/plugins/openapi/SchemaList.js +2 -1
  195. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
  196. package/dist/lib/plugins/openapi/Sidecar.js +12 -3
  197. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  198. package/dist/lib/plugins/openapi/index.js +11 -5
  199. package/dist/lib/plugins/openapi/index.js.map +1 -1
  200. package/dist/lib/plugins/openapi/interfaces.d.ts +19 -13
  201. package/dist/lib/plugins/openapi/playground/Playground.js +8 -4
  202. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  203. package/dist/lib/plugins/openapi/playground/fileUtils.d.ts +1 -0
  204. package/dist/lib/plugins/openapi/playground/fileUtils.js +3 -0
  205. package/dist/lib/plugins/openapi/playground/fileUtils.js.map +1 -1
  206. package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.d.ts +6 -0
  207. package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js +20 -0
  208. package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js.map +1 -0
  209. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +7 -2
  210. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  211. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
  212. package/dist/lib/plugins/openapi/schema/SchemaView.js +16 -7
  213. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  214. package/dist/lib/plugins/openapi/schema/utils.d.ts +2 -2
  215. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  216. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  217. package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
  218. package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
  219. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +9 -1
  220. package/dist/lib/plugins/openapi/util/getRoutes.js +30 -2
  221. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  222. package/dist/lib/plugins/search-pagefind/IndexingDialog.d.ts +3 -0
  223. package/dist/lib/plugins/search-pagefind/IndexingDialog.js +64 -0
  224. package/dist/lib/plugins/search-pagefind/IndexingDialog.js.map +1 -0
  225. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +22 -5
  226. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  227. package/dist/lib/plugins/search-pagefind/ResultList.js +5 -4
  228. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  229. package/dist/lib/shiki.d.ts +1 -1
  230. package/dist/lib/shiki.js +18 -12
  231. package/dist/lib/shiki.js.map +1 -1
  232. package/dist/lib/ui/Alert.d.ts +3 -2
  233. package/dist/lib/ui/Alert.js +9 -5
  234. package/dist/lib/ui/Alert.js.map +1 -1
  235. package/dist/lib/ui/Button.d.ts +2 -2
  236. package/dist/lib/ui/Button.js +10 -9
  237. package/dist/lib/ui/Button.js.map +1 -1
  238. package/dist/lib/ui/ButtonGroup.d.ts +11 -0
  239. package/dist/lib/ui/ButtonGroup.js +28 -0
  240. package/dist/lib/ui/ButtonGroup.js.map +1 -0
  241. package/dist/lib/ui/Command.d.ts +3 -3
  242. package/dist/lib/ui/Command.js +2 -2
  243. package/dist/lib/ui/Command.js.map +1 -1
  244. package/dist/lib/ui/DropdownMenu.d.ts +21 -23
  245. package/dist/lib/ui/DropdownMenu.js +47 -32
  246. package/dist/lib/ui/DropdownMenu.js.map +1 -1
  247. package/dist/lib/ui/InputGroup.d.ts +16 -0
  248. package/dist/lib/ui/InputGroup.js +65 -0
  249. package/dist/lib/ui/InputGroup.js.map +1 -0
  250. package/dist/lib/ui/Kbd.d.ts +3 -0
  251. package/dist/lib/ui/Kbd.js +10 -0
  252. package/dist/lib/ui/Kbd.js.map +1 -0
  253. package/dist/lib/ui/Secret.js +2 -2
  254. package/dist/lib/ui/Secret.js.map +1 -1
  255. package/dist/lib/util/MdxComponents.d.ts +1 -0
  256. package/dist/lib/util/MdxComponents.js +2 -0
  257. package/dist/lib/util/MdxComponents.js.map +1 -1
  258. package/dist/lib/util/flattenAllOf.d.ts +0 -2
  259. package/dist/lib/util/flattenAllOf.js +0 -23
  260. package/dist/lib/util/flattenAllOf.js.map +1 -1
  261. package/dist/lib/util/flattenAllOf.test.js +69 -13
  262. package/dist/lib/util/flattenAllOf.test.js.map +1 -1
  263. package/dist/lib/util/flattenAllOfProcessor.d.ts +2 -0
  264. package/dist/lib/util/flattenAllOfProcessor.js +48 -0
  265. package/dist/lib/util/flattenAllOfProcessor.js.map +1 -0
  266. package/dist/lib/util/invariant.d.ts +1 -1
  267. package/dist/lib/util/invariant.js +2 -2
  268. package/dist/lib/util/invariant.js.map +1 -1
  269. package/dist/lib/util/readFrontmatter.d.ts +6 -0
  270. package/dist/lib/util/readFrontmatter.js +13 -0
  271. package/dist/lib/util/readFrontmatter.js.map +1 -0
  272. package/dist/vite/api/SchemaManager.d.ts +17 -1
  273. package/dist/vite/api/SchemaManager.js +52 -11
  274. package/dist/vite/api/SchemaManager.js.map +1 -1
  275. package/dist/vite/api/SchemaManager.test.js +111 -0
  276. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  277. package/dist/vite/build.js +91 -73
  278. package/dist/vite/build.js.map +1 -1
  279. package/dist/vite/config.js +16 -1
  280. package/dist/vite/config.js.map +1 -1
  281. package/dist/vite/dev-server.js +25 -0
  282. package/dist/vite/dev-server.js.map +1 -1
  283. package/dist/vite/error-handler.js +1 -5
  284. package/dist/vite/error-handler.js.map +1 -1
  285. package/dist/vite/mdx/remark-inject-filepath.js +5 -1
  286. package/dist/vite/mdx/remark-inject-filepath.js.map +1 -1
  287. package/dist/vite/mdx/remark-last-modified.js +57 -3
  288. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  289. package/dist/vite/mdx/remark-link-rewrite.js +4 -3
  290. package/dist/vite/mdx/remark-link-rewrite.js.map +1 -1
  291. package/dist/vite/pagefind-dev-index.d.ts +16 -0
  292. package/dist/vite/pagefind-dev-index.js +68 -0
  293. package/dist/vite/pagefind-dev-index.js.map +1 -0
  294. package/dist/vite/plugin-api-keys.js +5 -1
  295. package/dist/vite/plugin-api-keys.js.map +1 -1
  296. package/dist/vite/plugin-api.js +44 -4
  297. package/dist/vite/plugin-api.js.map +1 -1
  298. package/dist/vite/plugin-config.js +16 -4
  299. package/dist/vite/plugin-config.js.map +1 -1
  300. package/dist/vite/plugin-docs.js +9 -7
  301. package/dist/vite/plugin-docs.js.map +1 -1
  302. package/dist/vite/plugin-frontmatter.js +3 -5
  303. package/dist/vite/plugin-frontmatter.js.map +1 -1
  304. package/dist/vite/plugin-markdown-export.js +8 -7
  305. package/dist/vite/plugin-markdown-export.js.map +1 -1
  306. package/dist/vite/plugin-theme.js +2 -1
  307. package/dist/vite/plugin-theme.js.map +1 -1
  308. package/dist/vite/prerender/prerender.js +4 -20
  309. package/dist/vite/prerender/prerender.js.map +1 -1
  310. package/dist/vite/prerender/utils.d.ts +2 -0
  311. package/dist/vite/prerender/utils.js +30 -0
  312. package/dist/vite/prerender/utils.js.map +1 -0
  313. package/dist/vite/prerender/worker.js +6 -1
  314. package/dist/vite/prerender/worker.js.map +1 -1
  315. package/dist/vite/zuplo.d.ts +13 -0
  316. package/dist/vite/zuplo.js +15 -0
  317. package/dist/vite/zuplo.js.map +1 -0
  318. package/lib/ActionButton-B0CXL1Lq.js +25 -0
  319. package/lib/ActionButton-B0CXL1Lq.js.map +1 -0
  320. package/lib/Button-GUVe7pmt.js +54 -0
  321. package/lib/Button-GUVe7pmt.js.map +1 -0
  322. package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
  323. package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
  324. package/lib/ClaudeLogo-DoZ7fHHk.js +73 -0
  325. package/lib/ClaudeLogo-DoZ7fHHk.js.map +1 -0
  326. package/lib/{Command-CUcrW3qs.js → Command-N6VujV30.js} +26 -26
  327. package/lib/Command-N6VujV30.js.map +1 -0
  328. package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
  329. package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
  330. package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
  331. package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
  332. package/lib/DropdownMenu-DN0jNrjj.js +104 -0
  333. package/lib/DropdownMenu-DN0jNrjj.js.map +1 -0
  334. package/lib/Frame-DKlOmSkU.js +205 -0
  335. package/lib/Frame-DKlOmSkU.js.map +1 -0
  336. package/lib/HydrationBoundary-CJu4vUlG.js +601 -0
  337. package/lib/HydrationBoundary-CJu4vUlG.js.map +1 -0
  338. package/lib/IndexingDialog-D0YdGfbn.js +100 -0
  339. package/lib/IndexingDialog-D0YdGfbn.js.map +1 -0
  340. package/lib/Input-Cx-GeKoF.js +22 -0
  341. package/lib/Input-Cx-GeKoF.js.map +1 -0
  342. package/lib/MdxPage-Bc_5OsQ5.js +210 -0
  343. package/lib/MdxPage-Bc_5OsQ5.js.map +1 -0
  344. package/lib/Mermaid-Chx5BPHn.js +104 -0
  345. package/lib/Mermaid-Chx5BPHn.js.map +1 -0
  346. package/lib/{OAuthErrorPage-DnKnq4xK.js → OAuthErrorPage-D-VcZ5cO.js} +26 -23
  347. package/lib/OAuthErrorPage-D-VcZ5cO.js.map +1 -0
  348. package/lib/OasProvider-CZqLHoRo.js +48 -0
  349. package/lib/OasProvider-CZqLHoRo.js.map +1 -0
  350. package/lib/{OperationList-D8EDc9v7.js → OperationList-BmV1XvEY.js} +2136 -2002
  351. package/lib/OperationList-BmV1XvEY.js.map +1 -0
  352. package/lib/RouteGuard-Dns7HD7C.js +77 -0
  353. package/lib/RouteGuard-Dns7HD7C.js.map +1 -0
  354. package/lib/{SchemaList-E6lF7dID.js → SchemaList-D23IyrX5.js} +28 -27
  355. package/lib/SchemaList-D23IyrX5.js.map +1 -0
  356. package/lib/SchemaView-DVbiGPo3.js +438 -0
  357. package/lib/SchemaView-DVbiGPo3.js.map +1 -0
  358. package/lib/Secret-CyhXSA8i.js +263 -0
  359. package/lib/Secret-CyhXSA8i.js.map +1 -0
  360. package/lib/SignUp-DfEe1w5X.js +55 -0
  361. package/lib/SignUp-DfEe1w5X.js.map +1 -0
  362. package/lib/{SyntaxHighlight-C19vH0V_.js → SyntaxHighlight-N2RffYNz.js} +1469 -1411
  363. package/lib/SyntaxHighlight-N2RffYNz.js.map +1 -0
  364. package/lib/{Toc-DbWS75JZ.js → Toc-Cpo_HSYx.js} +3 -3
  365. package/lib/{Toc-DbWS75JZ.js.map → Toc-Cpo_HSYx.js.map} +1 -1
  366. package/lib/{ErrorAlert-_1Zmhr68.js → Zudoku-GbutmWzP.js} +5663 -4482
  367. package/lib/Zudoku-GbutmWzP.js.map +1 -0
  368. package/lib/ZudokuContext-LPkD2SQs.js +250 -0
  369. package/lib/ZudokuContext-LPkD2SQs.js.map +1 -0
  370. package/lib/ZudokuReactContext-DGJAP1sN.js +222 -0
  371. package/lib/ZudokuReactContext-DGJAP1sN.js.map +1 -0
  372. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  373. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  374. package/lib/{circular-BoYo7au5.js → circular-DfSpMuY7.js} +6429 -6019
  375. package/lib/circular-DfSpMuY7.js.map +1 -0
  376. package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
  377. package/lib/cn-5-Gd1Dss.js.map +1 -0
  378. package/lib/{createServer-B_BZ7xX8.js → createServer-4kaAMuIM.js} +2790 -2737
  379. package/lib/createServer-4kaAMuIM.js.map +1 -0
  380. package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
  381. package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
  382. package/lib/{errors-CD873hrG.js → errors-CtZTDEB6.js} +3 -3
  383. package/lib/{errors-CD873hrG.js.map → errors-CtZTDEB6.js.map} +1 -1
  384. package/lib/firebase-D286uF4e.js +7615 -0
  385. package/lib/firebase-D286uF4e.js.map +1 -0
  386. package/lib/hook-DyEn6D2Q.js +53 -0
  387. package/lib/hook-DyEn6D2Q.js.map +1 -0
  388. package/lib/{index-HNVs5cgX.js → index-B7bvsQHg.js} +853 -802
  389. package/lib/index-B7bvsQHg.js.map +1 -0
  390. package/lib/{index-BK0jKRrX.js → index-CVumYRba.js} +2 -2
  391. package/lib/{index-BK0jKRrX.js.map → index-CVumYRba.js.map} +1 -1
  392. package/lib/index-CrcNWbel.js.map +1 -1
  393. package/lib/index-DAWHN3cH.js +86 -0
  394. package/lib/index-DAWHN3cH.js.map +1 -0
  395. package/lib/index.esm-BYObtETB.js.map +1 -1
  396. package/lib/index.esm-BkpWrvLZ.js +34 -0
  397. package/lib/index.esm-BkpWrvLZ.js.map +1 -0
  398. package/lib/{index.esm-BnYHxCYC.js → index.esm-Ca5zvoff.js} +2 -2
  399. package/lib/{index.esm-BnYHxCYC.js.map → index.esm-Ca5zvoff.js.map} +1 -1
  400. package/lib/{invariant-Bm-FVUQE.js → invariant-B_t_F2s_.js} +4 -4
  401. package/lib/invariant-B_t_F2s_.js.map +1 -0
  402. package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
  403. package/lib/{mutation-BSU0xu4m.js → mutation-B7eFBLZY.js} +70 -44
  404. package/lib/mutation-B7eFBLZY.js.map +1 -0
  405. package/lib/ui/Accordion.js +1 -1
  406. package/lib/ui/ActionButton.js +2 -2
  407. package/lib/ui/Alert.js +32 -20
  408. package/lib/ui/Alert.js.map +1 -1
  409. package/lib/ui/AlertDialog.js +1 -1
  410. package/lib/ui/Badge.js +1 -1
  411. package/lib/ui/Breadcrumb.js +1 -1
  412. package/lib/ui/Button.js +27 -25
  413. package/lib/ui/Button.js.map +1 -1
  414. package/lib/ui/ButtonGroup.js +77 -0
  415. package/lib/ui/ButtonGroup.js.map +1 -0
  416. package/lib/ui/Callout.js +1 -1
  417. package/lib/ui/Card.js +1 -1
  418. package/lib/ui/Carousel.js +1 -1
  419. package/lib/ui/Carousel.js.map +1 -1
  420. package/lib/ui/Checkbox.js +1 -1
  421. package/lib/ui/CodeBlock.js +1 -1
  422. package/lib/ui/Command.js +5 -5
  423. package/lib/ui/Command.js.map +1 -1
  424. package/lib/ui/Dialog.js +1 -1
  425. package/lib/ui/Drawer.js +3 -3
  426. package/lib/ui/DropdownMenu.js +227 -140
  427. package/lib/ui/DropdownMenu.js.map +1 -1
  428. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  429. package/lib/ui/Form.js +1 -1
  430. package/lib/ui/Frame.js +1 -1
  431. package/lib/ui/HoverCard.js +1 -1
  432. package/lib/ui/Input.js +1 -1
  433. package/lib/ui/InputGroup.js +155 -0
  434. package/lib/ui/InputGroup.js.map +1 -0
  435. package/lib/ui/Item.js +1 -1
  436. package/lib/ui/Kbd.js +32 -0
  437. package/lib/ui/Kbd.js.map +1 -0
  438. package/lib/ui/Label.js +1 -1
  439. package/lib/ui/NativeSelect.js +1 -1
  440. package/lib/ui/Pagination.js +1 -1
  441. package/lib/ui/Popover.js +1 -1
  442. package/lib/ui/Progress.js +1 -1
  443. package/lib/ui/RadioGroup.js +1 -1
  444. package/lib/ui/ScrollArea.js +1 -1
  445. package/lib/ui/Secret.js +3 -3
  446. package/lib/ui/Secret.js.map +1 -1
  447. package/lib/ui/Separator.js +1 -1
  448. package/lib/ui/Skeleton.js +1 -1
  449. package/lib/ui/Slider.js +1 -1
  450. package/lib/ui/Switch.js +1 -1
  451. package/lib/ui/SyntaxHighlight.js +3 -3
  452. package/lib/ui/Tabs.js +1 -1
  453. package/lib/ui/Textarea.js +1 -1
  454. package/lib/ui/Toggle.js +1 -1
  455. package/lib/ui/ToggleGroup.js +1 -1
  456. package/lib/ui/Value.js +1 -1
  457. package/lib/ui/util.js +1 -1
  458. package/lib/useExposedProps-CzTDfXfq.js +30 -0
  459. package/lib/useExposedProps-CzTDfXfq.js.map +1 -0
  460. package/lib/useMutation-CErliDZ9.js +119 -0
  461. package/lib/useMutation-CErliDZ9.js.map +1 -0
  462. package/lib/useQuery-ht7aWJ3S.js +1212 -0
  463. package/lib/useQuery-ht7aWJ3S.js.map +1 -0
  464. package/lib/useSuspenseQuery-DQH4Bmc2.js +18 -0
  465. package/lib/useSuspenseQuery-DQH4Bmc2.js.map +1 -0
  466. package/lib/zudoku.__internal.js +1540 -1553
  467. package/lib/zudoku.__internal.js.map +1 -1
  468. package/lib/zudoku.auth-auth0.js +19 -18
  469. package/lib/zudoku.auth-auth0.js.map +1 -1
  470. package/lib/zudoku.auth-azureb2c.js +14 -13
  471. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  472. package/lib/zudoku.auth-clerk.js +52 -75
  473. package/lib/zudoku.auth-clerk.js.map +1 -1
  474. package/lib/zudoku.auth-firebase.js +10 -0
  475. package/lib/zudoku.auth-firebase.js.map +1 -0
  476. package/lib/zudoku.auth-openid.js +8 -7
  477. package/lib/zudoku.auth-openid.js.map +1 -1
  478. package/lib/zudoku.auth-supabase.js +31 -40
  479. package/lib/zudoku.auth-supabase.js.map +1 -1
  480. package/lib/zudoku.components.js +29 -25
  481. package/lib/zudoku.components.js.map +1 -1
  482. package/lib/zudoku.hooks.js +20 -20
  483. package/lib/zudoku.hooks.js.map +1 -1
  484. package/lib/zudoku.mermaid.js +11 -0
  485. package/lib/zudoku.mermaid.js.map +1 -0
  486. package/lib/zudoku.plugin-api-catalog.js +42 -37
  487. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  488. package/lib/zudoku.plugin-api-keys.js +617 -550
  489. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  490. package/lib/zudoku.plugin-custom-pages.js +1 -1
  491. package/lib/zudoku.plugin-markdown.js +1 -1
  492. package/lib/zudoku.plugin-openapi.js +3 -3
  493. package/lib/zudoku.plugin-redirect.js +1 -1
  494. package/lib/zudoku.plugin-search-pagefind.js +186 -226
  495. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  496. package/lib/zudoku.plugins.js +9 -8
  497. package/lib/zudoku.plugins.js.map +1 -1
  498. package/lib/zudoku.react-query.js +441 -0
  499. package/lib/zudoku.react-query.js.map +1 -0
  500. package/lib/zudoku.router.js +1130 -1404
  501. package/lib/zudoku.router.js.map +1 -1
  502. package/package.json +63 -37
  503. package/src/app/defaultTheme.css +4 -0
  504. package/src/app/main.css +2 -0
  505. package/src/app/main.tsx +1 -1
  506. package/src/app/sentry.ts +1 -1
  507. package/src/lib/auth/issuer.ts +1 -1
  508. package/src/lib/authentication/authentication.ts +8 -2
  509. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  510. package/src/lib/authentication/components/SignIn.tsx +5 -2
  511. package/src/lib/authentication/components/SignUp.tsx +5 -2
  512. package/src/lib/authentication/hook.ts +16 -0
  513. package/src/lib/authentication/providers/auth0.tsx +21 -10
  514. package/src/lib/authentication/providers/clerk.tsx +0 -26
  515. package/src/lib/authentication/providers/firebase.tsx +98 -6
  516. package/src/lib/authentication/providers/supabase.tsx +6 -15
  517. package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
  518. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +181 -39
  519. package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
  520. package/src/lib/components/Bootstrap.tsx +1 -4
  521. package/src/lib/components/Mermaid.tsx +68 -0
  522. package/src/lib/components/MobileTopNavigation.tsx +16 -9
  523. package/src/lib/components/PagefindSearchMeta.tsx +14 -0
  524. package/src/lib/components/Pagination.tsx +4 -5
  525. package/src/lib/components/Slot.test.tsx +1 -1
  526. package/src/lib/components/TopNavigation.tsx +26 -8
  527. package/src/lib/components/Zudoku.tsx +22 -21
  528. package/src/lib/components/context/ZudokuContext.ts +33 -12
  529. package/src/lib/components/context/ZudokuProvider.tsx +1 -1
  530. package/src/lib/components/context/ZudokuReactContext.tsx +17 -0
  531. package/src/lib/components/index.ts +19 -35
  532. package/src/lib/components/navigation/Navigation.tsx +4 -3
  533. package/src/lib/components/navigation/NavigationCategory.tsx +9 -0
  534. package/src/lib/components/navigation/NavigationFilterContext.tsx +28 -0
  535. package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -0
  536. package/src/lib/components/navigation/NavigationItem.tsx +26 -4
  537. package/src/lib/components/navigation/NavigationWrapper.tsx +1 -1
  538. package/src/lib/components/navigation/utils.ts +44 -2
  539. package/src/lib/core/RouteGuard.tsx +30 -24
  540. package/src/lib/core/ZudokuContext.ts +7 -1
  541. package/src/lib/core/__internal.tsx +2 -0
  542. package/src/lib/core/plugins.ts +27 -3
  543. package/src/lib/core/react-query.ts +1 -0
  544. package/src/lib/core/transform-config.test.tsx +99 -0
  545. package/src/lib/core/transform-config.ts +67 -0
  546. package/src/lib/errors/ErrorAlert.tsx +1 -6
  547. package/src/lib/errors/ErrorMessage.tsx +38 -0
  548. package/src/lib/hooks/index.ts +7 -16
  549. package/src/lib/hooks/useEvent.test.tsx +1 -1
  550. package/src/lib/navigation/pathMatcher.test.ts +136 -0
  551. package/src/lib/navigation/pathMatcher.ts +93 -0
  552. package/src/lib/navigation/positionItems.test.ts +265 -0
  553. package/src/lib/navigation/positionItems.ts +111 -0
  554. package/src/lib/oas/graphql/circular.test.ts +221 -0
  555. package/src/lib/oas/graphql/circular.ts +31 -18
  556. package/src/lib/oas/graphql/index.ts +7 -3
  557. package/src/lib/oas/parser/index.ts +19 -6
  558. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
  559. package/src/lib/plugins/api-keys/index.tsx +76 -32
  560. package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
  561. package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -0
  562. package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
  563. package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +115 -0
  564. package/src/lib/plugins/openapi/Endpoint.tsx +20 -27
  565. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +1 -1
  566. package/src/lib/plugins/openapi/OasProvider.tsx +38 -17
  567. package/src/lib/plugins/openapi/OperationList.tsx +48 -28
  568. package/src/lib/plugins/openapi/OperationListItem.tsx +5 -5
  569. package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
  570. package/src/lib/plugins/openapi/ParameterList.tsx +2 -2
  571. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +37 -15
  572. package/src/lib/plugins/openapi/SchemaList.tsx +4 -0
  573. package/src/lib/plugins/openapi/Sidecar.tsx +20 -3
  574. package/src/lib/plugins/openapi/index.tsx +16 -7
  575. package/src/lib/plugins/openapi/interfaces.ts +21 -7
  576. package/src/lib/plugins/openapi/playground/Playground.tsx +8 -4
  577. package/src/lib/plugins/openapi/playground/fileUtils.ts +4 -0
  578. package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -0
  579. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +33 -17
  580. package/src/lib/plugins/openapi/schema/SchemaView.tsx +56 -43
  581. package/src/lib/plugins/openapi/schema/utils.ts +20 -6
  582. package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
  583. package/src/lib/plugins/openapi/util/getRoutes.tsx +38 -3
  584. package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +163 -0
  585. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +61 -22
  586. package/src/lib/plugins/search-pagefind/ResultList.tsx +8 -3
  587. package/src/lib/shiki.ts +21 -12
  588. package/src/lib/ui/Alert.tsx +17 -5
  589. package/src/lib/ui/Button.tsx +11 -10
  590. package/src/lib/ui/ButtonGroup.tsx +82 -0
  591. package/src/lib/ui/Command.tsx +3 -3
  592. package/src/lib/ui/DropdownMenu.tsx +226 -170
  593. package/src/lib/ui/InputGroup.tsx +168 -0
  594. package/src/lib/ui/Kbd.tsx +28 -0
  595. package/src/lib/ui/Secret.tsx +2 -2
  596. package/src/lib/util/MdxComponents.tsx +2 -0
  597. package/src/lib/util/flattenAllOf.test.ts +73 -20
  598. package/src/lib/util/flattenAllOf.ts +0 -36
  599. package/src/lib/util/flattenAllOfProcessor.ts +58 -0
  600. package/src/lib/util/invariant.ts +2 -1
  601. package/src/lib/util/readFrontmatter.ts +14 -0
  602. package/src/shiki/langs/c3.js +1 -0
  603. package/src/shiki/langs/gn.js +1 -0
  604. package/src/shiki/langs/markdown-nix.js +1 -0
  605. package/src/shiki/langs/moonbit.js +1 -0
  606. package/src/shiki/langs/openscad.js +1 -0
  607. package/src/zuplo/enrich-with-zuplo-mcp.ts +168 -0
  608. package/src/zuplo/enrich-with-zuplo.ts +254 -0
  609. package/src/zuplo/policy-types.ts +46 -0
  610. package/src/zuplo/with-zuplo-processors.ts +35 -0
  611. package/src/zuplo/with-zuplo.ts +14 -0
  612. package/dist/vite/create-pagefind-index.d.ts +0 -4
  613. package/dist/vite/create-pagefind-index.js +0 -12
  614. package/dist/vite/create-pagefind-index.js.map +0 -1
  615. package/lib/Button-B3ucvvQw.js +0 -52
  616. package/lib/Button-B3ucvvQw.js.map +0 -1
  617. package/lib/Command-CUcrW3qs.js.map +0 -1
  618. package/lib/DropdownMenu-BZ2NKQ3K.js +0 -126
  619. package/lib/DropdownMenu-BZ2NKQ3K.js.map +0 -1
  620. package/lib/ErrorAlert-_1Zmhr68.js.map +0 -1
  621. package/lib/MdxPage-B2t1EShN.js +0 -240
  622. package/lib/MdxPage-B2t1EShN.js.map +0 -1
  623. package/lib/OAuthErrorPage-DnKnq4xK.js.map +0 -1
  624. package/lib/OasProvider-BhuIkD4Z.js +0 -36
  625. package/lib/OasProvider-BhuIkD4Z.js.map +0 -1
  626. package/lib/OperationList-D8EDc9v7.js.map +0 -1
  627. package/lib/Pagination-hk-llhpw.js +0 -37
  628. package/lib/Pagination-hk-llhpw.js.map +0 -1
  629. package/lib/RouteGuard-Brz95MSt.js +0 -77
  630. package/lib/RouteGuard-Brz95MSt.js.map +0 -1
  631. package/lib/RouterError-CMaIfdjb.js +0 -42
  632. package/lib/RouterError-CMaIfdjb.js.map +0 -1
  633. package/lib/SchemaList-E6lF7dID.js.map +0 -1
  634. package/lib/SchemaView-CIv-OXgv.js +0 -572
  635. package/lib/SchemaView-CIv-OXgv.js.map +0 -1
  636. package/lib/Select-DFRCS31-.js +0 -399
  637. package/lib/Select-DFRCS31-.js.map +0 -1
  638. package/lib/SignUp-sGYAsj2K.js +0 -50
  639. package/lib/SignUp-sGYAsj2K.js.map +0 -1
  640. package/lib/SyntaxHighlight-C19vH0V_.js.map +0 -1
  641. package/lib/ZudokuContext-BUZ5hkWB.js +0 -1508
  642. package/lib/ZudokuContext-BUZ5hkWB.js.map +0 -1
  643. package/lib/chunk-PVWAREVJ-BMhpCH5D.js +0 -7965
  644. package/lib/chunk-PVWAREVJ-BMhpCH5D.js.map +0 -1
  645. package/lib/circular-BoYo7au5.js.map +0 -1
  646. package/lib/cn-dYga0KKN.js.map +0 -1
  647. package/lib/createServer-B_BZ7xX8.js.map +0 -1
  648. package/lib/hook-CMeoxziF.js +0 -40
  649. package/lib/hook-CMeoxziF.js.map +0 -1
  650. package/lib/index-HNVs5cgX.js.map +0 -1
  651. package/lib/index-pMMX55GH.js +0 -1059
  652. package/lib/index-pMMX55GH.js.map +0 -1
  653. package/lib/invariant-Bm-FVUQE.js.map +0 -1
  654. package/lib/mutation-BSU0xu4m.js.map +0 -1
  655. package/lib/useExposedProps-U3pmsHaG.js +0 -113
  656. package/lib/useExposedProps-U3pmsHaG.js.map +0 -1
@@ -0,0 +1,1212 @@
1
+ import * as p from "react";
2
+ import { j as tt } from "./jsx-runtime-BzflLqGi.js";
3
+ var H = class {
4
+ constructor() {
5
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
6
+ }
7
+ subscribe(t) {
8
+ return this.listeners.add(t), this.onSubscribe(), () => {
9
+ this.listeners.delete(t), this.onUnsubscribe();
10
+ };
11
+ }
12
+ hasListeners() {
13
+ return this.listeners.size > 0;
14
+ }
15
+ onSubscribe() {
16
+ }
17
+ onUnsubscribe() {
18
+ }
19
+ }, ht = {
20
+ // We need the wrapper function syntax below instead of direct references to
21
+ // global setTimeout etc.
22
+ //
23
+ // BAD: `setTimeout: setTimeout`
24
+ // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
25
+ //
26
+ // If we use direct references here, then anything that wants to spy on or
27
+ // replace the global setTimeout (like tests) won't work since we'll already
28
+ // have a hard reference to the original implementation at the time when this
29
+ // file was imported.
30
+ setTimeout: (t, e) => setTimeout(t, e),
31
+ clearTimeout: (t) => clearTimeout(t),
32
+ setInterval: (t, e) => setInterval(t, e),
33
+ clearInterval: (t) => clearInterval(t)
34
+ }, lt = class {
35
+ // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
36
+ // type at app boot; and if we leave that type, then any new timer provider
37
+ // would need to support ReturnType<typeof setTimeout>, which is infeasible.
38
+ //
39
+ // We settle for type safety for the TimeoutProvider type, and accept that
40
+ // this class is unsafe internally to allow for extension.
41
+ #e = ht;
42
+ #t = !1;
43
+ setTimeoutProvider(t) {
44
+ process.env.NODE_ENV !== "production" && this.#t && t !== this.#e && console.error(
45
+ "[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",
46
+ { previous: this.#e, provider: t }
47
+ ), this.#e = t, process.env.NODE_ENV !== "production" && (this.#t = !1);
48
+ }
49
+ setTimeout(t, e) {
50
+ return process.env.NODE_ENV !== "production" && (this.#t = !0), this.#e.setTimeout(t, e);
51
+ }
52
+ clearTimeout(t) {
53
+ this.#e.clearTimeout(t);
54
+ }
55
+ setInterval(t, e) {
56
+ return process.env.NODE_ENV !== "production" && (this.#t = !0), this.#e.setInterval(t, e);
57
+ }
58
+ clearInterval(t) {
59
+ this.#e.clearInterval(t);
60
+ }
61
+ }, w = new lt();
62
+ function ft(t) {
63
+ setTimeout(t, 0);
64
+ }
65
+ var E = typeof window > "u" || "Deno" in globalThis;
66
+ function C() {
67
+ }
68
+ function _t(t, e) {
69
+ return typeof t == "function" ? t(e) : t;
70
+ }
71
+ function Q(t) {
72
+ return typeof t == "number" && t >= 0 && t !== 1 / 0;
73
+ }
74
+ function et(t, e) {
75
+ return Math.max(t + (e || 0) - Date.now(), 0);
76
+ }
77
+ function I(t, e) {
78
+ return typeof t == "function" ? t(e) : t;
79
+ }
80
+ function v(t, e) {
81
+ return typeof t == "function" ? t(e) : t;
82
+ }
83
+ function Lt(t, e) {
84
+ const {
85
+ type: s = "all",
86
+ exact: r,
87
+ fetchStatus: n,
88
+ predicate: u,
89
+ queryKey: a,
90
+ stale: i
91
+ } = t;
92
+ if (a) {
93
+ if (r) {
94
+ if (e.queryHash !== dt(a, e.options))
95
+ return !1;
96
+ } else if (!V(e.queryKey, a))
97
+ return !1;
98
+ }
99
+ if (s !== "all") {
100
+ const o = e.isActive();
101
+ if (s === "active" && !o || s === "inactive" && o)
102
+ return !1;
103
+ }
104
+ return !(typeof i == "boolean" && e.isStale() !== i || n && n !== e.state.fetchStatus || u && !u(e));
105
+ }
106
+ function Kt(t, e) {
107
+ const { exact: s, status: r, predicate: n, mutationKey: u } = t;
108
+ if (u) {
109
+ if (!e.options.mutationKey)
110
+ return !1;
111
+ if (s) {
112
+ if (j(e.options.mutationKey) !== j(u))
113
+ return !1;
114
+ } else if (!V(e.options.mutationKey, u))
115
+ return !1;
116
+ }
117
+ return !(r && e.state.status !== r || n && !n(e));
118
+ }
119
+ function dt(t, e) {
120
+ return (e?.queryKeyHashFn || j)(t);
121
+ }
122
+ function j(t) {
123
+ return JSON.stringify(
124
+ t,
125
+ (e, s) => A(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
126
+ );
127
+ }
128
+ function V(t, e) {
129
+ return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => V(t[s], e[s])) : !1;
130
+ }
131
+ var pt = Object.prototype.hasOwnProperty;
132
+ function q(t, e) {
133
+ if (t === e)
134
+ return t;
135
+ const s = z(t) && z(e);
136
+ if (!s && !(A(t) && A(e))) return e;
137
+ const n = (s ? t : Object.keys(t)).length, u = s ? e : Object.keys(e), a = u.length, i = s ? new Array(a) : {};
138
+ let o = 0;
139
+ for (let l = 0; l < a; l++) {
140
+ const c = s ? l : u[l], d = t[c], h = e[c];
141
+ if (d === h) {
142
+ i[c] = d, (s ? l < n : pt.call(t, c)) && o++;
143
+ continue;
144
+ }
145
+ if (d === null || h === null || typeof d != "object" || typeof h != "object") {
146
+ i[c] = h;
147
+ continue;
148
+ }
149
+ const R = q(d, h);
150
+ i[c] = R, R === d && o++;
151
+ }
152
+ return n === a && o === n ? t : i;
153
+ }
154
+ function N(t, e) {
155
+ if (!e || Object.keys(t).length !== Object.keys(e).length)
156
+ return !1;
157
+ for (const s in t)
158
+ if (t[s] !== e[s])
159
+ return !1;
160
+ return !0;
161
+ }
162
+ function z(t) {
163
+ return Array.isArray(t) && t.length === Object.keys(t).length;
164
+ }
165
+ function A(t) {
166
+ if (!$(t))
167
+ return !1;
168
+ const e = t.constructor;
169
+ if (e === void 0)
170
+ return !0;
171
+ const s = e.prototype;
172
+ return !(!$(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
173
+ }
174
+ function $(t) {
175
+ return Object.prototype.toString.call(t) === "[object Object]";
176
+ }
177
+ function yt(t) {
178
+ return new Promise((e) => {
179
+ w.setTimeout(e, t);
180
+ });
181
+ }
182
+ function k(t, e, s) {
183
+ if (typeof s.structuralSharing == "function")
184
+ return s.structuralSharing(t, e);
185
+ if (s.structuralSharing !== !1) {
186
+ if (process.env.NODE_ENV !== "production")
187
+ try {
188
+ return q(t, e);
189
+ } catch (r) {
190
+ throw console.error(
191
+ `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}`
192
+ ), r;
193
+ }
194
+ return q(t, e);
195
+ }
196
+ return e;
197
+ }
198
+ function Ht(t) {
199
+ return t;
200
+ }
201
+ function Vt(t, e, s = 0) {
202
+ const r = [...t, e];
203
+ return s && r.length > s ? r.slice(1) : r;
204
+ }
205
+ function Bt(t, e, s = 0) {
206
+ const r = [e, ...t];
207
+ return s && r.length > s ? r.slice(0, -1) : r;
208
+ }
209
+ var _ = Symbol();
210
+ function vt(t, e) {
211
+ return process.env.NODE_ENV !== "production" && t.queryFn === _ && console.error(
212
+ `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`
213
+ ), !t.queryFn && e?.initialPromise ? () => e.initialPromise : !t.queryFn || t.queryFn === _ ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
214
+ }
215
+ function mt(t, e) {
216
+ return typeof t == "function" ? t(...e) : !!t;
217
+ }
218
+ var bt = class extends H {
219
+ #e;
220
+ #t;
221
+ #s;
222
+ constructor() {
223
+ super(), this.#s = (t) => {
224
+ if (!E && window.addEventListener) {
225
+ const e = () => t();
226
+ return window.addEventListener("visibilitychange", e, !1), () => {
227
+ window.removeEventListener("visibilitychange", e);
228
+ };
229
+ }
230
+ };
231
+ }
232
+ onSubscribe() {
233
+ this.#t || this.setEventListener(this.#s);
234
+ }
235
+ onUnsubscribe() {
236
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
237
+ }
238
+ setEventListener(t) {
239
+ this.#s = t, this.#t?.(), this.#t = t((e) => {
240
+ typeof e == "boolean" ? this.setFocused(e) : this.onFocus();
241
+ });
242
+ }
243
+ setFocused(t) {
244
+ this.#e !== t && (this.#e = t, this.onFocus());
245
+ }
246
+ onFocus() {
247
+ const t = this.isFocused();
248
+ this.listeners.forEach((e) => {
249
+ e(t);
250
+ });
251
+ }
252
+ isFocused() {
253
+ return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
254
+ }
255
+ }, st = new bt();
256
+ function L() {
257
+ let t, e;
258
+ const s = new Promise((n, u) => {
259
+ t = n, e = u;
260
+ });
261
+ s.status = "pending", s.catch(() => {
262
+ });
263
+ function r(n) {
264
+ Object.assign(s, n), delete s.resolve, delete s.reject;
265
+ }
266
+ return s.resolve = (n) => {
267
+ r({
268
+ status: "fulfilled",
269
+ value: n
270
+ }), t(n);
271
+ }, s.reject = (n) => {
272
+ r({
273
+ status: "rejected",
274
+ reason: n
275
+ }), e(n);
276
+ }, s;
277
+ }
278
+ function Gt(t) {
279
+ let e;
280
+ if (t.then((s) => (e = s, s), C)?.catch(C), e !== void 0)
281
+ return { data: e };
282
+ }
283
+ var gt = ft;
284
+ function St() {
285
+ let t = [], e = 0, s = (i) => {
286
+ i();
287
+ }, r = (i) => {
288
+ i();
289
+ }, n = gt;
290
+ const u = (i) => {
291
+ e ? t.push(i) : n(() => {
292
+ s(i);
293
+ });
294
+ }, a = () => {
295
+ const i = t;
296
+ t = [], i.length && n(() => {
297
+ r(() => {
298
+ i.forEach((o) => {
299
+ s(o);
300
+ });
301
+ });
302
+ });
303
+ };
304
+ return {
305
+ batch: (i) => {
306
+ let o;
307
+ e++;
308
+ try {
309
+ o = i();
310
+ } finally {
311
+ e--, e || a();
312
+ }
313
+ return o;
314
+ },
315
+ /**
316
+ * All calls to the wrapped function will be batched.
317
+ */
318
+ batchCalls: (i) => (...o) => {
319
+ u(() => {
320
+ i(...o);
321
+ });
322
+ },
323
+ schedule: u,
324
+ /**
325
+ * Use this method to set a custom notify function.
326
+ * This can be used to for example wrap notifications with `React.act` while running tests.
327
+ */
328
+ setNotifyFunction: (i) => {
329
+ s = i;
330
+ },
331
+ /**
332
+ * Use this method to set a custom function to batch notifications together into a single tick.
333
+ * By default React Query will use the batch function provided by ReactDOM or React Native.
334
+ */
335
+ setBatchNotifyFunction: (i) => {
336
+ r = i;
337
+ },
338
+ setScheduler: (i) => {
339
+ n = i;
340
+ }
341
+ };
342
+ }
343
+ var B = St(), Rt = class extends H {
344
+ #e = !0;
345
+ #t;
346
+ #s;
347
+ constructor() {
348
+ super(), this.#s = (t) => {
349
+ if (!E && window.addEventListener) {
350
+ const e = () => t(!0), s = () => t(!1);
351
+ return window.addEventListener("online", e, !1), window.addEventListener("offline", s, !1), () => {
352
+ window.removeEventListener("online", e), window.removeEventListener("offline", s);
353
+ };
354
+ }
355
+ };
356
+ }
357
+ onSubscribe() {
358
+ this.#t || this.setEventListener(this.#s);
359
+ }
360
+ onUnsubscribe() {
361
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
362
+ }
363
+ setEventListener(t) {
364
+ this.#s = t, this.#t?.(), this.#t = t(this.setOnline.bind(this));
365
+ }
366
+ setOnline(t) {
367
+ this.#e !== t && (this.#e = t, this.listeners.forEach((s) => {
368
+ s(t);
369
+ }));
370
+ }
371
+ isOnline() {
372
+ return this.#e;
373
+ }
374
+ }, rt = new Rt();
375
+ function Ot(t) {
376
+ return Math.min(1e3 * 2 ** t, 3e4);
377
+ }
378
+ function it(t) {
379
+ return (t ?? "online") === "online" ? rt.isOnline() : !0;
380
+ }
381
+ var U = class extends Error {
382
+ constructor(t) {
383
+ super("CancelledError"), this.revert = t?.revert, this.silent = t?.silent;
384
+ }
385
+ };
386
+ function zt(t) {
387
+ return t instanceof U;
388
+ }
389
+ function wt(t) {
390
+ let e = !1, s = 0, r;
391
+ const n = L(), u = () => n.status !== "pending", a = (f) => {
392
+ if (!u()) {
393
+ const g = new U(f);
394
+ h(g), t.onCancel?.(g);
395
+ }
396
+ }, i = () => {
397
+ e = !0;
398
+ }, o = () => {
399
+ e = !1;
400
+ }, l = () => st.isFocused() && (t.networkMode === "always" || rt.isOnline()) && t.canRun(), c = () => it(t.networkMode) && t.canRun(), d = (f) => {
401
+ u() || (r?.(), n.resolve(f));
402
+ }, h = (f) => {
403
+ u() || (r?.(), n.reject(f));
404
+ }, R = () => new Promise((f) => {
405
+ r = (g) => {
406
+ (u() || l()) && f(g);
407
+ }, t.onPause?.();
408
+ }).then(() => {
409
+ r = void 0, u() || t.onContinue?.();
410
+ }), F = () => {
411
+ if (u())
412
+ return;
413
+ let f;
414
+ const g = s === 0 ? t.initialPromise : void 0;
415
+ try {
416
+ f = g ?? t.fn();
417
+ } catch (m) {
418
+ f = Promise.reject(m);
419
+ }
420
+ Promise.resolve(f).then(d).catch((m) => {
421
+ if (u())
422
+ return;
423
+ const S = t.retry ?? (E ? 0 : 3), O = t.retryDelay ?? Ot, P = typeof O == "function" ? O(s, m) : O, D = S === !0 || typeof S == "number" && s < S || typeof S == "function" && S(s, m);
424
+ if (e || !D) {
425
+ h(m);
426
+ return;
427
+ }
428
+ s++, t.onFail?.(s, m), yt(P).then(() => l() ? void 0 : R()).then(() => {
429
+ e ? h(m) : F();
430
+ });
431
+ });
432
+ };
433
+ return {
434
+ promise: n,
435
+ status: () => n.status,
436
+ cancel: a,
437
+ continue: () => (r?.(), n),
438
+ cancelRetry: i,
439
+ continueRetry: o,
440
+ canStart: c,
441
+ start: () => (c() ? F() : R().then(F), n)
442
+ };
443
+ }
444
+ var Et = class {
445
+ #e;
446
+ destroy() {
447
+ this.clearGcTimeout();
448
+ }
449
+ scheduleGc() {
450
+ this.clearGcTimeout(), Q(this.gcTime) && (this.#e = w.setTimeout(() => {
451
+ this.optionalRemove();
452
+ }, this.gcTime));
453
+ }
454
+ updateGcTime(t) {
455
+ this.gcTime = Math.max(
456
+ this.gcTime || 0,
457
+ t ?? (E ? 1 / 0 : 300 * 1e3)
458
+ );
459
+ }
460
+ clearGcTimeout() {
461
+ this.#e && (w.clearTimeout(this.#e), this.#e = void 0);
462
+ }
463
+ }, $t = class extends Et {
464
+ #e;
465
+ #t;
466
+ #s;
467
+ #i;
468
+ #r;
469
+ #o;
470
+ #a;
471
+ constructor(t) {
472
+ super(), this.#a = !1, this.#o = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.#i = t.client, this.#s = this.#i.getQueryCache(), this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.#e = W(this.options), this.state = t.state ?? this.#e, this.scheduleGc();
473
+ }
474
+ get meta() {
475
+ return this.options.meta;
476
+ }
477
+ get promise() {
478
+ return this.#r?.promise;
479
+ }
480
+ setOptions(t) {
481
+ if (this.options = { ...this.#o, ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
482
+ const e = W(this.options);
483
+ e.data !== void 0 && (this.setState(
484
+ J(e.data, e.dataUpdatedAt)
485
+ ), this.#e = e);
486
+ }
487
+ }
488
+ optionalRemove() {
489
+ !this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
490
+ }
491
+ setData(t, e) {
492
+ const s = k(this.state.data, t, this.options);
493
+ return this.#n({
494
+ data: s,
495
+ type: "success",
496
+ dataUpdatedAt: e?.updatedAt,
497
+ manual: e?.manual
498
+ }), s;
499
+ }
500
+ setState(t, e) {
501
+ this.#n({ type: "setState", state: t, setStateOptions: e });
502
+ }
503
+ cancel(t) {
504
+ const e = this.#r?.promise;
505
+ return this.#r?.cancel(t), e ? e.then(C).catch(C) : Promise.resolve();
506
+ }
507
+ destroy() {
508
+ super.destroy(), this.cancel({ silent: !0 });
509
+ }
510
+ reset() {
511
+ this.destroy(), this.setState(this.#e);
512
+ }
513
+ isActive() {
514
+ return this.observers.some(
515
+ (t) => v(t.options.enabled, this) !== !1
516
+ );
517
+ }
518
+ isDisabled() {
519
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === _ || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
520
+ }
521
+ isStatic() {
522
+ return this.getObserversCount() > 0 ? this.observers.some(
523
+ (t) => I(t.options.staleTime, this) === "static"
524
+ ) : !1;
525
+ }
526
+ isStale() {
527
+ return this.getObserversCount() > 0 ? this.observers.some(
528
+ (t) => t.getCurrentResult().isStale
529
+ ) : this.state.data === void 0 || this.state.isInvalidated;
530
+ }
531
+ isStaleByTime(t = 0) {
532
+ return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !et(this.state.dataUpdatedAt, t);
533
+ }
534
+ onFocus() {
535
+ this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
536
+ }
537
+ onOnline() {
538
+ this.observers.find((e) => e.shouldFetchOnReconnect())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
539
+ }
540
+ addObserver(t) {
541
+ this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), this.#s.notify({ type: "observerAdded", query: this, observer: t }));
542
+ }
543
+ removeObserver(t) {
544
+ this.observers.includes(t) && (this.observers = this.observers.filter((e) => e !== t), this.observers.length || (this.#r && (this.#a ? this.#r.cancel({ revert: !0 }) : this.#r.cancelRetry()), this.scheduleGc()), this.#s.notify({ type: "observerRemoved", query: this, observer: t }));
545
+ }
546
+ getObserversCount() {
547
+ return this.observers.length;
548
+ }
549
+ invalidate() {
550
+ this.state.isInvalidated || this.#n({ type: "invalidate" });
551
+ }
552
+ async fetch(t, e) {
553
+ if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely
554
+ // re-start the fetch; there is a chance that the query is still in a
555
+ // pending state when that happens
556
+ this.#r?.status() !== "rejected") {
557
+ if (this.state.data !== void 0 && e?.cancelRefetch)
558
+ this.cancel({ silent: !0 });
559
+ else if (this.#r)
560
+ return this.#r.continueRetry(), this.#r.promise;
561
+ }
562
+ if (t && this.setOptions(t), !this.options.queryFn) {
563
+ const i = this.observers.find((o) => o.options.queryFn);
564
+ i && this.setOptions(i.options);
565
+ }
566
+ process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
567
+ "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']"
568
+ ));
569
+ const s = new AbortController(), r = (i) => {
570
+ Object.defineProperty(i, "signal", {
571
+ enumerable: !0,
572
+ get: () => (this.#a = !0, s.signal)
573
+ });
574
+ }, n = () => {
575
+ const i = vt(this.options, e), l = (() => {
576
+ const c = {
577
+ client: this.#i,
578
+ queryKey: this.queryKey,
579
+ meta: this.meta
580
+ };
581
+ return r(c), c;
582
+ })();
583
+ return this.#a = !1, this.options.persister ? this.options.persister(
584
+ i,
585
+ l,
586
+ this
587
+ ) : i(l);
588
+ }, a = (() => {
589
+ const i = {
590
+ fetchOptions: e,
591
+ options: this.options,
592
+ queryKey: this.queryKey,
593
+ client: this.#i,
594
+ state: this.state,
595
+ fetchFn: n
596
+ };
597
+ return r(i), i;
598
+ })();
599
+ this.options.behavior?.onFetch(a, this), this.#t = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== a.fetchOptions?.meta) && this.#n({ type: "fetch", meta: a.fetchOptions?.meta }), this.#r = wt({
600
+ initialPromise: e?.initialPromise,
601
+ fn: a.fetchFn,
602
+ onCancel: (i) => {
603
+ i instanceof U && i.revert && this.setState({
604
+ ...this.#t,
605
+ fetchStatus: "idle"
606
+ }), s.abort();
607
+ },
608
+ onFail: (i, o) => {
609
+ this.#n({ type: "failed", failureCount: i, error: o });
610
+ },
611
+ onPause: () => {
612
+ this.#n({ type: "pause" });
613
+ },
614
+ onContinue: () => {
615
+ this.#n({ type: "continue" });
616
+ },
617
+ retry: a.options.retry,
618
+ retryDelay: a.options.retryDelay,
619
+ networkMode: a.options.networkMode,
620
+ canRun: () => !0
621
+ });
622
+ try {
623
+ const i = await this.#r.start();
624
+ if (i === void 0)
625
+ throw process.env.NODE_ENV !== "production" && console.error(
626
+ `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
627
+ ), new Error(`${this.queryHash} data is undefined`);
628
+ return this.setData(i), this.#s.config.onSuccess?.(i, this), this.#s.config.onSettled?.(
629
+ i,
630
+ this.state.error,
631
+ this
632
+ ), i;
633
+ } catch (i) {
634
+ if (i instanceof U) {
635
+ if (i.silent)
636
+ return this.#r.promise;
637
+ if (i.revert) {
638
+ if (this.state.data === void 0)
639
+ throw i;
640
+ return this.state.data;
641
+ }
642
+ }
643
+ throw this.#n({
644
+ type: "error",
645
+ error: i
646
+ }), this.#s.config.onError?.(
647
+ i,
648
+ this
649
+ ), this.#s.config.onSettled?.(
650
+ this.state.data,
651
+ i,
652
+ this
653
+ ), i;
654
+ } finally {
655
+ this.scheduleGc();
656
+ }
657
+ }
658
+ #n(t) {
659
+ const e = (s) => {
660
+ switch (t.type) {
661
+ case "failed":
662
+ return {
663
+ ...s,
664
+ fetchFailureCount: t.failureCount,
665
+ fetchFailureReason: t.error
666
+ };
667
+ case "pause":
668
+ return {
669
+ ...s,
670
+ fetchStatus: "paused"
671
+ };
672
+ case "continue":
673
+ return {
674
+ ...s,
675
+ fetchStatus: "fetching"
676
+ };
677
+ case "fetch":
678
+ return {
679
+ ...s,
680
+ ...nt(s.data, this.options),
681
+ fetchMeta: t.meta ?? null
682
+ };
683
+ case "success":
684
+ const r = {
685
+ ...s,
686
+ ...J(t.data, t.dataUpdatedAt),
687
+ dataUpdateCount: s.dataUpdateCount + 1,
688
+ ...!t.manual && {
689
+ fetchStatus: "idle",
690
+ fetchFailureCount: 0,
691
+ fetchFailureReason: null
692
+ }
693
+ };
694
+ return this.#t = t.manual ? r : void 0, r;
695
+ case "error":
696
+ const n = t.error;
697
+ return {
698
+ ...s,
699
+ error: n,
700
+ errorUpdateCount: s.errorUpdateCount + 1,
701
+ errorUpdatedAt: Date.now(),
702
+ fetchFailureCount: s.fetchFailureCount + 1,
703
+ fetchFailureReason: n,
704
+ fetchStatus: "idle",
705
+ status: "error"
706
+ };
707
+ case "invalidate":
708
+ return {
709
+ ...s,
710
+ isInvalidated: !0
711
+ };
712
+ case "setState":
713
+ return {
714
+ ...s,
715
+ ...t.state
716
+ };
717
+ }
718
+ };
719
+ this.state = e(this.state), B.batch(() => {
720
+ this.observers.forEach((s) => {
721
+ s.onQueryUpdate();
722
+ }), this.#s.notify({ query: this, type: "updated", action: t });
723
+ });
724
+ }
725
+ };
726
+ function nt(t, e) {
727
+ return {
728
+ fetchFailureCount: 0,
729
+ fetchFailureReason: null,
730
+ fetchStatus: it(e.networkMode) ? "fetching" : "paused",
731
+ ...t === void 0 && {
732
+ error: null,
733
+ status: "pending"
734
+ }
735
+ };
736
+ }
737
+ function J(t, e) {
738
+ return {
739
+ data: t,
740
+ dataUpdatedAt: e ?? Date.now(),
741
+ error: null,
742
+ isInvalidated: !1,
743
+ status: "success"
744
+ };
745
+ }
746
+ function W(t) {
747
+ 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;
748
+ return {
749
+ data: e,
750
+ dataUpdateCount: 0,
751
+ dataUpdatedAt: s ? r ?? Date.now() : 0,
752
+ error: null,
753
+ errorUpdateCount: 0,
754
+ errorUpdatedAt: 0,
755
+ fetchFailureCount: 0,
756
+ fetchFailureReason: null,
757
+ fetchMeta: null,
758
+ isInvalidated: !1,
759
+ status: s ? "success" : "pending",
760
+ fetchStatus: "idle"
761
+ };
762
+ }
763
+ var Ct = class extends H {
764
+ constructor(t, e) {
765
+ super(), this.options = e, this.#e = t, this.#n = null, this.#a = L(), this.bindMethods(), this.setOptions(e);
766
+ }
767
+ #e;
768
+ #t = void 0;
769
+ #s = void 0;
770
+ #i = void 0;
771
+ #r;
772
+ #o;
773
+ #a;
774
+ #n;
775
+ #y;
776
+ #f;
777
+ // This property keeps track of the last query with defined data.
778
+ // It will be used to pass the previous data and query to the placeholder function between renders.
779
+ #d;
780
+ #c;
781
+ #h;
782
+ #u;
783
+ #p = /* @__PURE__ */ new Set();
784
+ bindMethods() {
785
+ this.refetch = this.refetch.bind(this);
786
+ }
787
+ onSubscribe() {
788
+ this.listeners.size === 1 && (this.#t.addObserver(this), Z(this.#t, this.options) ? this.#l() : this.updateResult(), this.#g());
789
+ }
790
+ onUnsubscribe() {
791
+ this.hasListeners() || this.destroy();
792
+ }
793
+ shouldFetchOnReconnect() {
794
+ return K(
795
+ this.#t,
796
+ this.options,
797
+ this.options.refetchOnReconnect
798
+ );
799
+ }
800
+ shouldFetchOnWindowFocus() {
801
+ return K(
802
+ this.#t,
803
+ this.options,
804
+ this.options.refetchOnWindowFocus
805
+ );
806
+ }
807
+ destroy() {
808
+ this.listeners = /* @__PURE__ */ new Set(), this.#S(), this.#R(), this.#t.removeObserver(this);
809
+ }
810
+ setOptions(t) {
811
+ const e = this.options, s = this.#t;
812
+ if (this.options = this.#e.defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof v(this.options.enabled, this.#t) != "boolean")
813
+ throw new Error(
814
+ "Expected enabled to be a boolean or a callback that returns a boolean"
815
+ );
816
+ this.#O(), this.#t.setOptions(this.options), e._defaulted && !N(this.options, e) && this.#e.getQueryCache().notify({
817
+ type: "observerOptionsUpdated",
818
+ query: this.#t,
819
+ observer: this
820
+ });
821
+ const r = this.hasListeners();
822
+ r && X(
823
+ this.#t,
824
+ s,
825
+ this.options,
826
+ e
827
+ ) && this.#l(), this.updateResult(), r && (this.#t !== s || v(this.options.enabled, this.#t) !== v(e.enabled, this.#t) || I(this.options.staleTime, this.#t) !== I(e.staleTime, this.#t)) && this.#v();
828
+ const n = this.#m();
829
+ r && (this.#t !== s || v(this.options.enabled, this.#t) !== v(e.enabled, this.#t) || n !== this.#u) && this.#b(n);
830
+ }
831
+ getOptimisticResult(t) {
832
+ const e = this.#e.getQueryCache().build(this.#e, t), s = this.createResult(e, t);
833
+ return Tt(this, s) && (this.#i = s, this.#o = this.options, this.#r = this.#t.state), s;
834
+ }
835
+ getCurrentResult() {
836
+ return this.#i;
837
+ }
838
+ trackResult(t, e) {
839
+ return new Proxy(t, {
840
+ get: (s, r) => (this.trackProp(r), e?.(r), r === "promise" && (this.trackProp("data"), !this.options.experimental_prefetchInRender && this.#a.status === "pending" && this.#a.reject(
841
+ new Error(
842
+ "experimental_prefetchInRender feature flag is not enabled"
843
+ )
844
+ )), Reflect.get(s, r))
845
+ });
846
+ }
847
+ trackProp(t) {
848
+ this.#p.add(t);
849
+ }
850
+ getCurrentQuery() {
851
+ return this.#t;
852
+ }
853
+ refetch({ ...t } = {}) {
854
+ return this.fetch({
855
+ ...t
856
+ });
857
+ }
858
+ fetchOptimistic(t) {
859
+ const e = this.#e.defaultQueryOptions(t), s = this.#e.getQueryCache().build(this.#e, e);
860
+ return s.fetch().then(() => this.createResult(s, e));
861
+ }
862
+ fetch(t) {
863
+ return this.#l({
864
+ ...t,
865
+ cancelRefetch: t.cancelRefetch ?? !0
866
+ }).then(() => (this.updateResult(), this.#i));
867
+ }
868
+ #l(t) {
869
+ this.#O();
870
+ let e = this.#t.fetch(
871
+ this.options,
872
+ t
873
+ );
874
+ return t?.throwOnError || (e = e.catch(C)), e;
875
+ }
876
+ #v() {
877
+ this.#S();
878
+ const t = I(
879
+ this.options.staleTime,
880
+ this.#t
881
+ );
882
+ if (E || this.#i.isStale || !Q(t))
883
+ return;
884
+ const s = et(this.#i.dataUpdatedAt, t) + 1;
885
+ this.#c = w.setTimeout(() => {
886
+ this.#i.isStale || this.updateResult();
887
+ }, s);
888
+ }
889
+ #m() {
890
+ return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
891
+ }
892
+ #b(t) {
893
+ this.#R(), this.#u = t, !(E || v(this.options.enabled, this.#t) === !1 || !Q(this.#u) || this.#u === 0) && (this.#h = w.setInterval(() => {
894
+ (this.options.refetchIntervalInBackground || st.isFocused()) && this.#l();
895
+ }, this.#u));
896
+ }
897
+ #g() {
898
+ this.#v(), this.#b(this.#m());
899
+ }
900
+ #S() {
901
+ this.#c && (w.clearTimeout(this.#c), this.#c = void 0);
902
+ }
903
+ #R() {
904
+ this.#h && (w.clearInterval(this.#h), this.#h = void 0);
905
+ }
906
+ createResult(t, e) {
907
+ const s = this.#t, r = this.options, n = this.#i, u = this.#r, a = this.#o, o = t !== s ? t.state : this.#s, { state: l } = t;
908
+ let c = { ...l }, d = !1, h;
909
+ if (e._optimisticResults) {
910
+ const y = this.hasListeners(), M = !y && Z(t, e), T = y && X(t, s, e, r);
911
+ (M || T) && (c = {
912
+ ...c,
913
+ ...nt(l.data, t.options)
914
+ }), e._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
915
+ }
916
+ let { error: R, errorUpdatedAt: F, status: f } = c;
917
+ h = c.data;
918
+ let g = !1;
919
+ if (e.placeholderData !== void 0 && h === void 0 && f === "pending") {
920
+ let y;
921
+ n?.isPlaceholderData && e.placeholderData === a?.placeholderData ? (y = n.data, g = !0) : y = typeof e.placeholderData == "function" ? e.placeholderData(
922
+ this.#d?.state.data,
923
+ this.#d
924
+ ) : e.placeholderData, y !== void 0 && (f = "success", h = k(
925
+ n?.data,
926
+ y,
927
+ e
928
+ ), d = !0);
929
+ }
930
+ if (e.select && h !== void 0 && !g)
931
+ if (n && h === u?.data && e.select === this.#y)
932
+ h = this.#f;
933
+ else
934
+ try {
935
+ this.#y = e.select, h = e.select(h), h = k(n?.data, h, e), this.#f = h, this.#n = null;
936
+ } catch (y) {
937
+ this.#n = y;
938
+ }
939
+ this.#n && (R = this.#n, h = this.#f, F = Date.now(), f = "error");
940
+ const m = c.fetchStatus === "fetching", S = f === "pending", O = f === "error", P = S && m, D = h !== void 0, b = {
941
+ status: f,
942
+ fetchStatus: c.fetchStatus,
943
+ isPending: S,
944
+ isSuccess: f === "success",
945
+ isError: O,
946
+ isInitialLoading: P,
947
+ isLoading: P,
948
+ data: h,
949
+ dataUpdatedAt: c.dataUpdatedAt,
950
+ error: R,
951
+ errorUpdatedAt: F,
952
+ failureCount: c.fetchFailureCount,
953
+ failureReason: c.fetchFailureReason,
954
+ errorUpdateCount: c.errorUpdateCount,
955
+ isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
956
+ isFetchedAfterMount: c.dataUpdateCount > o.dataUpdateCount || c.errorUpdateCount > o.errorUpdateCount,
957
+ isFetching: m,
958
+ isRefetching: m && !S,
959
+ isLoadingError: O && !D,
960
+ isPaused: c.fetchStatus === "paused",
961
+ isPlaceholderData: d,
962
+ isRefetchError: O && D,
963
+ isStale: G(t, e),
964
+ refetch: this.refetch,
965
+ promise: this.#a,
966
+ isEnabled: v(e.enabled, t) !== !1
967
+ };
968
+ if (this.options.experimental_prefetchInRender) {
969
+ const y = (x) => {
970
+ b.status === "error" ? x.reject(b.error) : b.data !== void 0 && x.resolve(b.data);
971
+ }, M = () => {
972
+ const x = this.#a = b.promise = L();
973
+ y(x);
974
+ }, T = this.#a;
975
+ switch (T.status) {
976
+ case "pending":
977
+ t.queryHash === s.queryHash && y(T);
978
+ break;
979
+ case "fulfilled":
980
+ (b.status === "error" || b.data !== T.value) && M();
981
+ break;
982
+ case "rejected":
983
+ (b.status !== "error" || b.error !== T.reason) && M();
984
+ break;
985
+ }
986
+ }
987
+ return b;
988
+ }
989
+ updateResult() {
990
+ const t = this.#i, e = this.createResult(this.#t, this.options);
991
+ if (this.#r = this.#t.state, this.#o = this.options, this.#r.data !== void 0 && (this.#d = this.#t), N(e, t))
992
+ return;
993
+ this.#i = e;
994
+ const s = () => {
995
+ if (!t)
996
+ return !0;
997
+ const { notifyOnChangeProps: r } = this.options, n = typeof r == "function" ? r() : r;
998
+ if (n === "all" || !n && !this.#p.size)
999
+ return !0;
1000
+ const u = new Set(
1001
+ n ?? this.#p
1002
+ );
1003
+ return this.options.throwOnError && u.add("error"), Object.keys(this.#i).some((a) => {
1004
+ const i = a;
1005
+ return this.#i[i] !== t[i] && u.has(i);
1006
+ });
1007
+ };
1008
+ this.#w({ listeners: s() });
1009
+ }
1010
+ #O() {
1011
+ const t = this.#e.getQueryCache().build(this.#e, this.options);
1012
+ if (t === this.#t)
1013
+ return;
1014
+ const e = this.#t;
1015
+ this.#t = t, this.#s = t.state, this.hasListeners() && (e?.removeObserver(this), t.addObserver(this));
1016
+ }
1017
+ onQueryUpdate() {
1018
+ this.updateResult(), this.hasListeners() && this.#g();
1019
+ }
1020
+ #w(t) {
1021
+ B.batch(() => {
1022
+ t.listeners && this.listeners.forEach((e) => {
1023
+ e(this.#i);
1024
+ }), this.#e.getQueryCache().notify({
1025
+ query: this.#t,
1026
+ type: "observerResultsUpdated"
1027
+ });
1028
+ });
1029
+ }
1030
+ };
1031
+ function Ft(t, e) {
1032
+ return v(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
1033
+ }
1034
+ function Z(t, e) {
1035
+ return Ft(t, e) || t.state.data !== void 0 && K(t, e, e.refetchOnMount);
1036
+ }
1037
+ function K(t, e, s) {
1038
+ if (v(e.enabled, t) !== !1 && I(e.staleTime, t) !== "static") {
1039
+ const r = typeof s == "function" ? s(t) : s;
1040
+ return r === "always" || r !== !1 && G(t, e);
1041
+ }
1042
+ return !1;
1043
+ }
1044
+ function X(t, e, s, r) {
1045
+ return (t !== e || v(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && G(t, s);
1046
+ }
1047
+ function G(t, e) {
1048
+ return v(e.enabled, t) !== !1 && t.isStaleByTime(I(e.staleTime, t));
1049
+ }
1050
+ function Tt(t, e) {
1051
+ return !N(t.getCurrentResult(), e);
1052
+ }
1053
+ var at = p.createContext(
1054
+ void 0
1055
+ ), It = (t) => {
1056
+ const e = p.useContext(at);
1057
+ if (t)
1058
+ return t;
1059
+ if (!e)
1060
+ throw new Error("No QueryClient set, use QueryClientProvider to set one");
1061
+ return e;
1062
+ }, Jt = ({
1063
+ client: t,
1064
+ children: e
1065
+ }) => (p.useEffect(() => (t.mount(), () => {
1066
+ t.unmount();
1067
+ }), [t]), /* @__PURE__ */ tt.jsx(at.Provider, { value: t, children: e })), ot = p.createContext(!1), Pt = () => p.useContext(ot), Wt = ot.Provider;
1068
+ function ut() {
1069
+ let t = !1;
1070
+ return {
1071
+ clearReset: () => {
1072
+ t = !1;
1073
+ },
1074
+ reset: () => {
1075
+ t = !0;
1076
+ },
1077
+ isReset: () => t
1078
+ };
1079
+ }
1080
+ var ct = p.createContext(ut()), Dt = () => p.useContext(ct), Zt = ({
1081
+ children: t
1082
+ }) => {
1083
+ const [e] = p.useState(() => ut());
1084
+ return /* @__PURE__ */ tt.jsx(ct.Provider, { value: e, children: typeof t == "function" ? t(e) : t });
1085
+ }, Mt = (t, e) => {
1086
+ (t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
1087
+ }, xt = (t) => {
1088
+ p.useEffect(() => {
1089
+ t.clearReset();
1090
+ }, [t]);
1091
+ }, Ut = ({
1092
+ result: t,
1093
+ errorResetBoundary: e,
1094
+ throwOnError: s,
1095
+ query: r,
1096
+ suspense: n
1097
+ }) => t.isError && !e.isReset() && !t.isFetching && r && (n && t.data === void 0 || mt(s, [t.error, r])), Xt = (t, e) => e.state.data === void 0, Qt = (t) => {
1098
+ if (t.suspense) {
1099
+ const s = (n) => n === "static" ? n : Math.max(n ?? 1e3, 1e3), r = t.staleTime;
1100
+ t.staleTime = typeof r == "function" ? (...n) => s(r(...n)) : s(r), typeof t.gcTime == "number" && (t.gcTime = Math.max(
1101
+ t.gcTime,
1102
+ 1e3
1103
+ ));
1104
+ }
1105
+ }, jt = (t, e) => t.isLoading && t.isFetching && !e, qt = (t, e) => t?.suspense && e.isPending, Y = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1106
+ s.clearReset();
1107
+ });
1108
+ function Nt(t, e, s) {
1109
+ if (process.env.NODE_ENV !== "production" && (typeof t != "object" || Array.isArray(t)))
1110
+ throw new Error(
1111
+ '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'
1112
+ );
1113
+ const r = Pt(), n = Dt(), u = It(s), a = u.defaultQueryOptions(t);
1114
+ u.getDefaultOptions().queries?._experimental_beforeQuery?.(
1115
+ a
1116
+ ), process.env.NODE_ENV !== "production" && (a.queryFn || console.error(
1117
+ `[${a.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`
1118
+ )), a._optimisticResults = r ? "isRestoring" : "optimistic", Qt(a), Mt(a, n), xt(n);
1119
+ const i = !u.getQueryCache().get(a.queryHash), [o] = p.useState(
1120
+ () => new e(
1121
+ u,
1122
+ a
1123
+ )
1124
+ ), l = o.getOptimisticResult(a), c = !r && t.subscribed !== !1;
1125
+ if (p.useSyncExternalStore(
1126
+ p.useCallback(
1127
+ (d) => {
1128
+ const h = c ? o.subscribe(B.batchCalls(d)) : C;
1129
+ return o.updateResult(), h;
1130
+ },
1131
+ [o, c]
1132
+ ),
1133
+ () => o.getCurrentResult(),
1134
+ () => o.getCurrentResult()
1135
+ ), p.useEffect(() => {
1136
+ o.setOptions(a);
1137
+ }, [a, o]), qt(a, l))
1138
+ throw Y(a, o, n);
1139
+ if (Ut({
1140
+ result: l,
1141
+ errorResetBoundary: n,
1142
+ throwOnError: a.throwOnError,
1143
+ query: u.getQueryCache().get(a.queryHash),
1144
+ suspense: a.suspense
1145
+ }))
1146
+ throw l.error;
1147
+ return u.getDefaultOptions().queries?._experimental_afterQuery?.(
1148
+ a,
1149
+ l
1150
+ ), a.experimental_prefetchInRender && !E && jt(l, r) && (i ? (
1151
+ // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1152
+ Y(a, o, n)
1153
+ ) : (
1154
+ // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1155
+ u.getQueryCache().get(a.queryHash)?.promise
1156
+ ))?.catch(C).finally(() => {
1157
+ o.updateResult();
1158
+ }), a.notifyOnChangeProps ? l : o.trackResult(l);
1159
+ }
1160
+ function Yt(t, e) {
1161
+ return Nt(t, Ct, e);
1162
+ }
1163
+ export {
1164
+ Pt as A,
1165
+ Dt as B,
1166
+ Qt as C,
1167
+ Mt as D,
1168
+ xt as E,
1169
+ qt as F,
1170
+ Y as G,
1171
+ jt as H,
1172
+ Ut as I,
1173
+ Wt as J,
1174
+ at as K,
1175
+ Jt as L,
1176
+ Zt as M,
1177
+ U as N,
1178
+ gt as O,
1179
+ zt as P,
1180
+ Ct as Q,
1181
+ Et as R,
1182
+ H as S,
1183
+ E as T,
1184
+ w as U,
1185
+ N as a,
1186
+ It as b,
1187
+ wt as c,
1188
+ Xt as d,
1189
+ C as e,
1190
+ mt as f,
1191
+ Yt as g,
1192
+ j as h,
1193
+ vt as i,
1194
+ Bt as j,
1195
+ Ht as k,
1196
+ Vt as l,
1197
+ Kt as m,
1198
+ B as n,
1199
+ dt as o,
1200
+ $t as p,
1201
+ Lt as q,
1202
+ st as r,
1203
+ _ as s,
1204
+ Gt as t,
1205
+ Nt as u,
1206
+ rt as v,
1207
+ I as w,
1208
+ _t as x,
1209
+ V as y,
1210
+ q as z
1211
+ };
1212
+ //# sourceMappingURL=useQuery-ht7aWJ3S.js.map