zudoku 0.0.0-f3d517c → 0.0.0-f40ea27

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 (570) hide show
  1. package/dist/app/ZuploBuildConfig.d.ts +11 -121
  2. package/dist/app/ZuploBuildConfig.js +8 -8
  3. package/dist/app/ZuploBuildConfig.js.map +1 -1
  4. package/dist/app/demo.js +6 -5
  5. package/dist/app/demo.js.map +1 -1
  6. package/dist/app/entry.client.d.ts +0 -2
  7. package/dist/app/entry.client.js +0 -2
  8. package/dist/app/entry.client.js.map +1 -1
  9. package/dist/app/entry.server.d.ts +0 -2
  10. package/dist/app/entry.server.js +0 -2
  11. package/dist/app/entry.server.js.map +1 -1
  12. package/dist/app/env.d.ts +7 -7
  13. package/dist/app/env.js +8 -0
  14. package/dist/app/env.js.map +1 -1
  15. package/dist/app/main.d.ts +1 -0
  16. package/dist/app/main.js +12 -11
  17. package/dist/app/main.js.map +1 -1
  18. package/dist/app/standalone.js +7 -6
  19. package/dist/app/standalone.js.map +1 -1
  20. package/dist/config/loader.js +2 -3
  21. package/dist/config/loader.js.map +1 -1
  22. package/dist/config/validators/BuildSchema.d.ts +20 -44
  23. package/dist/config/validators/BuildSchema.js +3 -14
  24. package/dist/config/validators/BuildSchema.js.map +1 -1
  25. package/dist/config/validators/InputNavigationSchema.d.ts +7369 -0
  26. package/dist/config/validators/InputNavigationSchema.js +74 -0
  27. package/dist/config/validators/InputNavigationSchema.js.map +1 -0
  28. package/dist/config/validators/InputNavigationSchema.test-d.d.ts +1 -0
  29. package/dist/config/validators/InputNavigationSchema.test-d.js +146 -0
  30. package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -0
  31. package/dist/config/validators/NavigationSchema.d.ts +44 -0
  32. package/dist/config/validators/NavigationSchema.js +95 -0
  33. package/dist/config/validators/NavigationSchema.js.map +1 -0
  34. package/dist/config/validators/icon-types.d.ts +2 -1
  35. package/dist/config/validators/icon-types.js +1813 -1
  36. package/dist/config/validators/icon-types.js.map +1 -1
  37. package/dist/config/validators/validate.d.ts +471 -5556
  38. package/dist/config/validators/validate.js +80 -69
  39. package/dist/config/validators/validate.js.map +1 -1
  40. package/dist/config/validators/validate.test.js +0 -2
  41. package/dist/config/validators/validate.test.js.map +1 -1
  42. package/dist/flat-config.d.ts +325 -0
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/lib/auth/issuer.js +4 -1
  46. package/dist/lib/auth/issuer.js.map +1 -1
  47. package/dist/lib/auth/issuer.test.js +14 -1
  48. package/dist/lib/auth/issuer.test.js.map +1 -1
  49. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  50. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  51. package/dist/lib/components/Autocomplete.js +2 -2
  52. package/dist/lib/components/Autocomplete.js.map +1 -1
  53. package/dist/lib/components/Banner.js +1 -1
  54. package/dist/lib/components/Banner.js.map +1 -1
  55. package/dist/lib/components/BuildCheck.js +1 -1
  56. package/dist/lib/components/BuildCheck.js.map +1 -1
  57. package/dist/lib/components/ErrorPage.js +2 -2
  58. package/dist/lib/components/ErrorPage.js.map +1 -1
  59. package/dist/lib/components/Footer.js +1 -1
  60. package/dist/lib/components/Footer.js.map +1 -1
  61. package/dist/lib/components/Framed.d.ts +7 -0
  62. package/dist/lib/components/Framed.js +26 -0
  63. package/dist/lib/components/Framed.js.map +1 -0
  64. package/dist/lib/components/Header.js +19 -18
  65. package/dist/lib/components/Header.js.map +1 -1
  66. package/dist/lib/components/Heading.d.ts +6 -2
  67. package/dist/lib/components/Heading.js +2 -2
  68. package/dist/lib/components/Heading.js.map +1 -1
  69. package/dist/lib/components/Main.js +4 -4
  70. package/dist/lib/components/Main.js.map +1 -1
  71. package/dist/lib/components/Markdown.d.ts +0 -1
  72. package/dist/lib/components/Markdown.js +2 -3
  73. package/dist/lib/components/Markdown.js.map +1 -1
  74. package/dist/lib/components/MobileTopNavigation.js +6 -5
  75. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  76. package/dist/lib/components/NotFoundPage.js +2 -2
  77. package/dist/lib/components/NotFoundPage.js.map +1 -1
  78. package/dist/lib/components/PageProgress.d.ts +1 -0
  79. package/dist/lib/components/PageProgress.js +20 -0
  80. package/dist/lib/components/PageProgress.js.map +1 -0
  81. package/dist/lib/components/Pagination.js +1 -1
  82. package/dist/lib/components/Pagination.js.map +1 -1
  83. package/dist/lib/components/TopNavigation.d.ts +2 -3
  84. package/dist/lib/components/TopNavigation.js +45 -44
  85. package/dist/lib/components/TopNavigation.js.map +1 -1
  86. package/dist/lib/components/Typography.d.ts +5 -0
  87. package/dist/lib/components/Typography.js +8 -0
  88. package/dist/lib/components/Typography.js.map +1 -0
  89. package/dist/lib/components/context/ZudokuContext.d.ts +3 -7
  90. package/dist/lib/components/context/ZudokuContext.js +44 -26
  91. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  92. package/dist/lib/components/index.d.ts +4 -0
  93. package/dist/lib/components/index.js +2 -0
  94. package/dist/lib/components/index.js.map +1 -1
  95. package/dist/lib/components/navigation/Navigation.d.ts +5 -0
  96. package/dist/lib/components/navigation/Navigation.js +12 -0
  97. package/dist/lib/components/navigation/Navigation.js.map +1 -0
  98. package/dist/lib/components/navigation/{SidebarBadge.d.ts → NavigationBadge.d.ts} +1 -1
  99. package/dist/lib/components/navigation/{SidebarBadge.js → NavigationBadge.js} +2 -2
  100. package/dist/lib/components/navigation/NavigationBadge.js.map +1 -0
  101. package/dist/lib/components/navigation/NavigationCategory.d.ts +5 -0
  102. package/dist/lib/components/navigation/{SidebarCategory.js → NavigationCategory.js} +14 -12
  103. package/dist/lib/components/navigation/NavigationCategory.js.map +1 -0
  104. package/dist/lib/components/navigation/NavigationItem.d.ts +6 -0
  105. package/dist/lib/components/navigation/NavigationItem.js +47 -0
  106. package/dist/lib/components/navigation/NavigationItem.js.map +1 -0
  107. package/dist/lib/components/navigation/{SidebarWrapper.d.ts → NavigationWrapper.d.ts} +1 -1
  108. package/dist/lib/components/navigation/{SidebarWrapper.js → NavigationWrapper.js} +4 -4
  109. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -0
  110. package/dist/lib/components/navigation/utils.d.ts +7 -9
  111. package/dist/lib/components/navigation/utils.js +17 -17
  112. package/dist/lib/components/navigation/utils.js.map +1 -1
  113. package/dist/lib/core/ZudokuContext.d.ts +10 -12
  114. package/dist/lib/core/ZudokuContext.js +7 -9
  115. package/dist/lib/core/ZudokuContext.js.map +1 -1
  116. package/dist/lib/core/plugins.d.ts +2 -2
  117. package/dist/lib/errors/ErrorAlert.js +2 -3
  118. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  119. package/dist/lib/hooks/useEvent.test.js +5 -3
  120. package/dist/lib/hooks/useEvent.test.js.map +1 -1
  121. package/dist/lib/hooks/useHotkey.d.ts +4 -0
  122. package/dist/lib/hooks/useHotkey.js +58 -0
  123. package/dist/lib/hooks/useHotkey.js.map +1 -0
  124. package/dist/lib/plugins/api-catalog/Catalog.d.ts +1 -1
  125. package/dist/lib/plugins/api-catalog/index.d.ts +6 -6
  126. package/dist/lib/plugins/api-catalog/index.js +10 -10
  127. package/dist/lib/plugins/api-catalog/index.js.map +1 -1
  128. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +12 -15
  129. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  130. package/dist/lib/plugins/api-keys/index.js +24 -5
  131. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  132. package/dist/lib/plugins/custom-pages/index.d.ts +4 -6
  133. package/dist/lib/plugins/custom-pages/index.js +15 -10
  134. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  135. package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -2
  136. package/dist/lib/plugins/markdown/MdxPage.js +28 -9
  137. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  138. package/dist/lib/plugins/markdown/index.d.ts +10 -2
  139. package/dist/lib/plugins/markdown/index.js +9 -26
  140. package/dist/lib/plugins/markdown/index.js.map +1 -1
  141. package/dist/lib/plugins/openapi/OperationList.js +2 -3
  142. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  143. package/dist/lib/plugins/openapi/OperationListItem.js +2 -2
  144. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  145. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  146. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  147. package/dist/lib/plugins/openapi/SchemaList.js +2 -3
  148. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
  149. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  150. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  151. package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
  152. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  153. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  154. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  155. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  156. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +3 -3
  157. package/dist/lib/plugins/openapi/graphql/graphql.js +2 -2
  158. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  159. package/dist/lib/plugins/openapi/index.d.ts +3 -3
  160. package/dist/lib/plugins/openapi/index.js +9 -9
  161. package/dist/lib/plugins/openapi/index.js.map +1 -1
  162. package/dist/lib/plugins/openapi/interfaces.d.ts +3 -3
  163. package/dist/lib/plugins/openapi/playground/BodyPanel.d.ts +2 -2
  164. package/dist/lib/plugins/openapi/playground/BodyPanel.js +16 -12
  165. package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
  166. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.d.ts +8 -0
  167. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +11 -0
  168. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -0
  169. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +2 -2
  170. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  171. package/dist/lib/plugins/openapi/playground/Headers.d.ts +3 -2
  172. package/dist/lib/plugins/openapi/playground/Headers.js +52 -30
  173. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  174. package/dist/lib/plugins/openapi/playground/IdentityDialog.js +2 -1
  175. package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -1
  176. package/dist/lib/plugins/openapi/playground/IdentitySelector.js +1 -2
  177. package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -1
  178. package/dist/lib/plugins/openapi/playground/InlineInput.js +1 -1
  179. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +1 -1
  180. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +2 -2
  181. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
  182. package/dist/lib/plugins/openapi/playground/PathParams.js +1 -2
  183. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  184. package/dist/lib/plugins/openapi/playground/Playground.js +47 -34
  185. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  186. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  187. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  188. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +2 -2
  189. package/dist/lib/plugins/openapi/playground/QueryParams.js +38 -23
  190. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  191. package/dist/lib/plugins/openapi/playground/Spinner.d.ts +2 -0
  192. package/dist/lib/plugins/openapi/playground/Spinner.js +63 -0
  193. package/dist/lib/plugins/openapi/playground/Spinner.js.map +1 -0
  194. package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.d.ts +3 -0
  195. package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.js +13 -0
  196. package/dist/lib/plugins/openapi/playground/request-panel/UrlPath.js.map +1 -0
  197. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.d.ts +1 -0
  198. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +12 -0
  199. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -0
  200. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.d.ts +12 -0
  201. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.js +11 -0
  202. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.js.map +1 -0
  203. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.d.ts +8 -0
  204. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js +69 -0
  205. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js.map +1 -0
  206. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.d.ts +7 -4
  207. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +25 -32
  208. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  209. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +4 -2
  210. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +8 -10
  211. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  212. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +3 -3
  213. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
  214. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +2 -3
  215. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  216. package/dist/lib/plugins/openapi/schema/SchemaView.js +5 -5
  217. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  218. package/dist/lib/plugins/openapi/schema/utils.js +3 -2
  219. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  220. package/dist/lib/plugins/openapi/util/createNavigationCategory.d.ts +9 -0
  221. package/dist/lib/plugins/openapi/util/{createSidebarCategory.js → createNavigationCategory.js} +5 -4
  222. package/dist/lib/plugins/openapi/util/createNavigationCategory.js.map +1 -0
  223. package/dist/lib/plugins/openapi/util/getRoutes.js +2 -2
  224. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  225. package/dist/lib/plugins/openapi/util/methodColorMap.d.ts +1 -1
  226. package/dist/lib/ui/Alert.d.ts +5 -4
  227. package/dist/lib/ui/Alert.js +12 -10
  228. package/dist/lib/ui/Alert.js.map +1 -1
  229. package/dist/lib/ui/CodeBlock.d.ts +1 -2
  230. package/dist/lib/ui/CodeBlock.js +10 -11
  231. package/dist/lib/ui/CodeBlock.js.map +1 -1
  232. package/dist/lib/ui/Dialog.js +1 -1
  233. package/dist/lib/ui/Dialog.js.map +1 -1
  234. package/dist/lib/ui/EmbeddedCodeBlock.d.ts +15 -0
  235. package/dist/lib/ui/EmbeddedCodeBlock.js +18 -0
  236. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -0
  237. package/dist/lib/ui/Select.js +1 -1
  238. package/dist/lib/ui/SyntaxHighlight.d.ts +3 -1
  239. package/dist/lib/ui/SyntaxHighlight.js +3 -2
  240. package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
  241. package/dist/lib/util/MdxComponents.d.ts +9 -1
  242. package/dist/lib/util/MdxComponents.js +4 -2
  243. package/dist/lib/util/MdxComponents.js.map +1 -1
  244. package/dist/lib/util/os.d.ts +2 -0
  245. package/dist/lib/util/os.js +21 -0
  246. package/dist/lib/util/os.js.map +1 -0
  247. package/dist/lib/util/useCopyToClipboard.d.ts +1 -0
  248. package/dist/lib/util/useCopyToClipboard.js +11 -0
  249. package/dist/lib/util/useCopyToClipboard.js.map +1 -0
  250. package/dist/lib/util/useScrollToAnchor.js +3 -3
  251. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  252. package/dist/vite/api/SchemaManager.d.ts +4 -4
  253. package/dist/vite/api/SchemaManager.js +25 -21
  254. package/dist/vite/api/SchemaManager.js.map +1 -1
  255. package/dist/vite/api/SchemaManager.test.js +4 -4
  256. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  257. package/dist/vite/api/schema-codegen.js +42 -11
  258. package/dist/vite/api/schema-codegen.js.map +1 -1
  259. package/dist/vite/api/schema-codegen.test.js +82 -0
  260. package/dist/vite/api/schema-codegen.test.js.map +1 -1
  261. package/dist/vite/build.js +1 -1
  262. package/dist/vite/config.js +12 -2
  263. package/dist/vite/config.js.map +1 -1
  264. package/dist/vite/css/plugin.js +11 -0
  265. package/dist/vite/css/plugin.js.map +1 -1
  266. package/dist/vite/dev-server.js +1 -1
  267. package/dist/vite/mdx/remark-last-modified.d.ts +3 -0
  268. package/dist/vite/mdx/remark-last-modified.js +56 -0
  269. package/dist/vite/mdx/remark-last-modified.js.map +1 -0
  270. package/dist/vite/mdx/utils.d.ts +2 -0
  271. package/dist/vite/mdx/utils.js +31 -0
  272. package/dist/vite/mdx/utils.js.map +1 -0
  273. package/dist/vite/plugin-api.js +8 -8
  274. package/dist/vite/plugin-api.js.map +1 -1
  275. package/dist/vite/plugin-config-reload.js +2 -0
  276. package/dist/vite/plugin-config-reload.js.map +1 -1
  277. package/dist/vite/plugin-custom-pages.js +2 -2
  278. package/dist/vite/plugin-custom-pages.js.map +1 -1
  279. package/dist/vite/plugin-docs.js +61 -59
  280. package/dist/vite/plugin-docs.js.map +1 -1
  281. package/dist/vite/plugin-frontmatter.js +6 -2
  282. package/dist/vite/plugin-frontmatter.js.map +1 -1
  283. package/dist/vite/plugin-mdx.js +15 -35
  284. package/dist/vite/plugin-mdx.js.map +1 -1
  285. package/dist/vite/{plugin-sidebar.d.ts → plugin-navigation.d.ts} +1 -1
  286. package/dist/vite/{plugin-sidebar.js → plugin-navigation.js} +20 -19
  287. package/dist/vite/plugin-navigation.js.map +1 -0
  288. package/dist/vite/plugin-theme.d.ts +8 -0
  289. package/dist/vite/plugin-theme.js +235 -0
  290. package/dist/vite/plugin-theme.js.map +1 -0
  291. package/dist/vite/plugin-theme.test.d.ts +1 -0
  292. package/dist/vite/plugin-theme.test.js +291 -0
  293. package/dist/vite/plugin-theme.test.js.map +1 -0
  294. package/dist/vite/plugin.js +4 -6
  295. package/dist/vite/plugin.js.map +1 -1
  296. package/dist/vite/shadcn-registry.d.ts +45 -0
  297. package/dist/vite/shadcn-registry.js +29 -0
  298. package/dist/vite/shadcn-registry.js.map +1 -0
  299. package/lib/Alert-CT_ViLrJ.js +161 -0
  300. package/lib/Alert-CT_ViLrJ.js.map +1 -0
  301. package/lib/CodeBlock-DAKxs_Tu.js +85 -0
  302. package/lib/CodeBlock-DAKxs_Tu.js.map +1 -0
  303. package/lib/Command-xsbs2uhf.js +140 -0
  304. package/lib/Command-xsbs2uhf.js.map +1 -0
  305. package/lib/{Dialog-BxpuVLh9.js → Dialog-CiIdyz6a.js} +5 -5
  306. package/lib/Dialog-CiIdyz6a.js.map +1 -0
  307. package/lib/Drawer-BzkOKwgC.js.map +1 -1
  308. package/lib/MdxPage-swXPJ0gf.js +110 -0
  309. package/lib/MdxPage-swXPJ0gf.js.map +1 -0
  310. package/lib/OasProvider-CDAM3TB1.js +35 -0
  311. package/lib/OasProvider-CDAM3TB1.js.map +1 -0
  312. package/lib/{OperationList-BISd29LY.js → OperationList-C9Hb9ql8.js} +582 -569
  313. package/lib/OperationList-C9Hb9ql8.js.map +1 -0
  314. package/lib/Pagination-VGlgeCmS.js +36 -0
  315. package/lib/Pagination-VGlgeCmS.js.map +1 -0
  316. package/lib/RouteGuard-CbKd7_9h.js +737 -0
  317. package/lib/RouteGuard-CbKd7_9h.js.map +1 -0
  318. package/lib/{SchemaList-BqnRo5ov.js → SchemaList-BAbh1BXO.js} +32 -43
  319. package/lib/SchemaList-BAbh1BXO.js.map +1 -0
  320. package/lib/{SchemaView-CtYJpxQI.js → SchemaView-C2Io712T.js} +95 -104
  321. package/lib/SchemaView-C2Io712T.js.map +1 -0
  322. package/lib/{SignUp-CrjeBbqN.js → SignUp-5RUdVhnq.js} +13 -13
  323. package/lib/{SignUp-CrjeBbqN.js.map → SignUp-5RUdVhnq.js.map} +1 -1
  324. package/lib/{Markdown-BUE2ViaD.js → Slot-DwZlQ-vX.js} +3320 -2937
  325. package/lib/Slot-DwZlQ-vX.js.map +1 -0
  326. package/lib/{SyntaxHighlight-DtvR7RLF.js → SyntaxHighlight-CrjhGEwT.js} +717 -716
  327. package/lib/{SyntaxHighlight-DtvR7RLF.js.map → SyntaxHighlight-CrjhGEwT.js.map} +1 -1
  328. package/lib/{Toc-ClJBmdtI.js → Toc-WCmwFkX-.js} +2 -2
  329. package/lib/{Toc-ClJBmdtI.js.map → Toc-WCmwFkX-.js.map} +1 -1
  330. package/lib/{chunk-DQRVZFIR-BblmKnHy.js → chunk-DQRVZFIR-DHK7_Ilc.js} +7 -7
  331. package/lib/{chunk-DQRVZFIR-BblmKnHy.js.map → chunk-DQRVZFIR-DHK7_Ilc.js.map} +1 -1
  332. package/lib/{circular-pOdgLzpG.js → circular-B42RaanD.js} +2 -2
  333. package/lib/{circular-pOdgLzpG.js.map → circular-B42RaanD.js.map} +1 -1
  334. package/lib/clerk-BDZ31hjU.js +25190 -0
  335. package/lib/clerk-BDZ31hjU.js.map +1 -0
  336. package/lib/{createServer-qAtUf99r.js → createServer-BKFsRuuk.js} +6 -6
  337. package/lib/{createServer-qAtUf99r.js.map → createServer-BKFsRuuk.js.map} +1 -1
  338. package/lib/{errors-Bpodza84.js → errors-CF2X_x5o.js} +12 -12
  339. package/lib/{errors-Bpodza84.js.map → errors-CF2X_x5o.js.map} +1 -1
  340. package/lib/hook-Bd0yS8M0.js +1503 -0
  341. package/lib/hook-Bd0yS8M0.js.map +1 -0
  342. package/lib/index-B6Re5_cx.js +3469 -0
  343. package/lib/index-B6Re5_cx.js.map +1 -0
  344. package/lib/index-CLy1XyH0.js +3919 -0
  345. package/lib/index-CLy1XyH0.js.map +1 -0
  346. package/lib/{index-BvvmIczU.js → index-CcV90rin.js} +2 -2
  347. package/lib/{index-BvvmIczU.js.map → index-CcV90rin.js.map} +1 -1
  348. package/lib/index-ClhS5TxS.js +107 -0
  349. package/lib/index-ClhS5TxS.js.map +1 -0
  350. package/lib/index-CrcNWbel.js.map +1 -1
  351. package/lib/{index-zddirpDj.js → index-DmNq2fbN.js} +226 -221
  352. package/lib/index-DmNq2fbN.js.map +1 -0
  353. package/lib/ui/Alert.js +54 -38
  354. package/lib/ui/Alert.js.map +1 -1
  355. package/lib/ui/CodeBlock.js +6 -81
  356. package/lib/ui/CodeBlock.js.map +1 -1
  357. package/lib/ui/Command.js +1 -1
  358. package/lib/ui/Dialog.js +23 -23
  359. package/lib/ui/Dialog.js.map +1 -1
  360. package/lib/ui/EmbeddedCodeBlock.js +80 -0
  361. package/lib/ui/EmbeddedCodeBlock.js.map +1 -0
  362. package/lib/ui/Select.js +1 -1
  363. package/lib/ui/Select.js.map +1 -1
  364. package/lib/ui/SyntaxHighlight.js +5 -4
  365. package/lib/ui/SyntaxHighlight.js.map +1 -1
  366. package/lib/{useExposedProps-BZQkZneR.js → useExposedProps-BIYjecPD.js} +2 -2
  367. package/lib/{useExposedProps-BZQkZneR.js.map → useExposedProps-BIYjecPD.js.map} +1 -1
  368. package/lib/zudoku.auth-auth0.js +1 -1
  369. package/lib/zudoku.auth-azureb2c.js +2 -2
  370. package/lib/zudoku.auth-clerk.js +3 -3
  371. package/lib/zudoku.auth-openid.js +2 -2
  372. package/lib/zudoku.components.js +33 -4201
  373. package/lib/zudoku.components.js.map +1 -1
  374. package/lib/zudoku.hooks.js +10 -11
  375. package/lib/zudoku.hooks.js.map +1 -1
  376. package/lib/zudoku.plugin-api-catalog.js +47 -47
  377. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  378. package/lib/zudoku.plugin-api-keys.js +292 -268
  379. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  380. package/lib/zudoku.plugin-custom-pages.js +12 -18
  381. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  382. package/lib/zudoku.plugin-markdown.js +19 -69
  383. package/lib/zudoku.plugin-markdown.js.map +1 -1
  384. package/lib/zudoku.plugin-openapi.js +6 -6
  385. package/lib/zudoku.plugin-redirect.js +1 -1
  386. package/lib/zudoku.plugin-search-pagefind.js +201 -111
  387. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  388. package/lib/zudoku.plugins.js.map +1 -1
  389. package/package.json +23 -19
  390. package/src/app/ZuploBuildConfig.ts +8 -8
  391. package/src/app/defaultTheme.css +68 -49
  392. package/src/app/demo.tsx +6 -5
  393. package/src/app/entry.client.tsx +0 -2
  394. package/src/app/entry.server.tsx +0 -2
  395. package/src/app/env.ts +8 -0
  396. package/src/app/main.css +10 -53
  397. package/src/app/main.tsx +13 -11
  398. package/src/app/standalone.tsx +7 -6
  399. package/src/lib/auth/issuer.test.ts +17 -1
  400. package/src/lib/auth/issuer.ts +4 -1
  401. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  402. package/src/lib/components/Autocomplete.tsx +2 -1
  403. package/src/lib/components/Banner.tsx +1 -1
  404. package/src/lib/components/BuildCheck.tsx +1 -1
  405. package/src/lib/components/ErrorPage.tsx +3 -3
  406. package/src/lib/components/Footer.tsx +1 -1
  407. package/src/lib/components/Framed.tsx +51 -0
  408. package/src/lib/components/Header.tsx +20 -20
  409. package/src/lib/components/Heading.tsx +7 -3
  410. package/src/lib/components/Main.tsx +9 -9
  411. package/src/lib/components/Markdown.tsx +3 -5
  412. package/src/lib/components/MobileTopNavigation.tsx +18 -13
  413. package/src/lib/components/NotFoundPage.tsx +3 -3
  414. package/src/lib/components/PageProgress.tsx +28 -0
  415. package/src/lib/components/Pagination.tsx +4 -4
  416. package/src/lib/components/TopNavigation.tsx +57 -66
  417. package/src/lib/components/Typography.tsx +14 -0
  418. package/src/lib/components/context/ZudokuContext.ts +50 -32
  419. package/src/lib/components/index.ts +2 -0
  420. package/src/lib/components/navigation/{Sidebar.tsx → Navigation.tsx} +18 -16
  421. package/src/lib/components/navigation/{SidebarBadge.tsx → NavigationBadge.tsx} +1 -1
  422. package/src/lib/components/navigation/{SidebarCategory.tsx → NavigationCategory.tsx} +16 -14
  423. package/src/lib/components/navigation/{SidebarItem.tsx → NavigationItem.tsx} +23 -17
  424. package/src/lib/components/navigation/{SidebarWrapper.tsx → NavigationWrapper.tsx} +3 -3
  425. package/src/lib/components/navigation/utils.ts +27 -28
  426. package/src/lib/core/ZudokuContext.ts +14 -20
  427. package/src/lib/core/plugins.ts +2 -2
  428. package/src/lib/errors/ErrorAlert.tsx +3 -9
  429. package/src/lib/hooks/useEvent.test.tsx +7 -5
  430. package/src/lib/hooks/useHotkey.ts +70 -0
  431. package/src/lib/plugins/api-catalog/Catalog.tsx +1 -1
  432. package/src/lib/plugins/api-catalog/index.tsx +19 -19
  433. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +41 -22
  434. package/src/lib/plugins/api-keys/index.tsx +27 -7
  435. package/src/lib/plugins/custom-pages/index.tsx +21 -16
  436. package/src/lib/plugins/markdown/MdxPage.tsx +72 -18
  437. package/src/lib/plugins/markdown/index.tsx +28 -41
  438. package/src/lib/plugins/openapi/OperationList.tsx +8 -18
  439. package/src/lib/plugins/openapi/OperationListItem.tsx +3 -3
  440. package/src/lib/plugins/openapi/ParameterListItem.tsx +6 -0
  441. package/src/lib/plugins/openapi/SchemaList.tsx +5 -11
  442. package/src/lib/plugins/openapi/Sidecar.tsx +1 -0
  443. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -0
  444. package/src/lib/plugins/openapi/graphql/gql.ts +5 -5
  445. package/src/lib/plugins/openapi/graphql/graphql.ts +6 -6
  446. package/src/lib/plugins/openapi/index.tsx +11 -11
  447. package/src/lib/plugins/openapi/interfaces.ts +3 -3
  448. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +40 -31
  449. package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +47 -0
  450. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +7 -3
  451. package/src/lib/plugins/openapi/playground/Headers.tsx +187 -89
  452. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +3 -2
  453. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +7 -12
  454. package/src/lib/plugins/openapi/playground/InlineInput.tsx +1 -1
  455. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +2 -2
  456. package/src/lib/plugins/openapi/playground/PathParams.tsx +4 -5
  457. package/src/lib/plugins/openapi/playground/Playground.tsx +174 -125
  458. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  459. package/src/lib/plugins/openapi/playground/QueryParams.tsx +104 -58
  460. package/src/lib/plugins/openapi/playground/Spinner.tsx +87 -0
  461. package/src/lib/plugins/openapi/playground/request-panel/UrlPath.tsx +31 -0
  462. package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +25 -0
  463. package/src/lib/plugins/openapi/playground/result-panel/Highlight.tsx +26 -0
  464. package/src/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.tsx +115 -0
  465. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +103 -97
  466. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +68 -92
  467. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +3 -3
  468. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +2 -3
  469. package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -11
  470. package/src/lib/plugins/openapi/schema/utils.ts +3 -2
  471. package/src/lib/plugins/openapi/util/{createSidebarCategory.tsx → createNavigationCategory.tsx} +6 -5
  472. package/src/lib/plugins/openapi/util/getRoutes.tsx +2 -2
  473. package/src/lib/plugins/openapi/util/methodColorMap.tsx +1 -1
  474. package/src/lib/ui/Alert.tsx +44 -38
  475. package/src/lib/ui/CodeBlock.tsx +40 -55
  476. package/src/lib/ui/Dialog.tsx +2 -2
  477. package/src/lib/ui/EmbeddedCodeBlock.tsx +94 -0
  478. package/src/lib/ui/Select.tsx +1 -1
  479. package/src/lib/ui/SyntaxHighlight.tsx +11 -3
  480. package/src/lib/util/MdxComponents.tsx +13 -2
  481. package/src/lib/util/os.ts +18 -0
  482. package/src/lib/util/useCopyToClipboard.ts +17 -0
  483. package/src/lib/util/useScrollToAnchor.ts +3 -3
  484. package/dist/config/validators/InputSidebarSchema.d.ts +0 -220
  485. package/dist/config/validators/InputSidebarSchema.js +0 -63
  486. package/dist/config/validators/InputSidebarSchema.js.map +0 -1
  487. package/dist/config/validators/SidebarSchema.d.ts +0 -46
  488. package/dist/config/validators/SidebarSchema.js +0 -118
  489. package/dist/config/validators/SidebarSchema.js.map +0 -1
  490. package/dist/lib/components/navigation/Sidebar.d.ts +0 -5
  491. package/dist/lib/components/navigation/Sidebar.js +0 -10
  492. package/dist/lib/components/navigation/Sidebar.js.map +0 -1
  493. package/dist/lib/components/navigation/SidebarBadge.js.map +0 -1
  494. package/dist/lib/components/navigation/SidebarCategory.d.ts +0 -5
  495. package/dist/lib/components/navigation/SidebarCategory.js.map +0 -1
  496. package/dist/lib/components/navigation/SidebarItem.d.ts +0 -6
  497. package/dist/lib/components/navigation/SidebarItem.js +0 -44
  498. package/dist/lib/components/navigation/SidebarItem.js.map +0 -1
  499. package/dist/lib/components/navigation/SidebarWrapper.js.map +0 -1
  500. package/dist/lib/plugins/custom-pages/CustomPage.d.ts +0 -2
  501. package/dist/lib/plugins/custom-pages/CustomPage.js +0 -11
  502. package/dist/lib/plugins/custom-pages/CustomPage.js.map +0 -1
  503. package/dist/lib/plugins/markdown/resolver.d.ts +0 -32
  504. package/dist/lib/plugins/markdown/resolver.js +0 -46
  505. package/dist/lib/plugins/markdown/resolver.js.map +0 -1
  506. package/dist/lib/plugins/openapi/playground/UrlDisplay.d.ts +0 -4
  507. package/dist/lib/plugins/openapi/playground/UrlDisplay.js +0 -22
  508. package/dist/lib/plugins/openapi/playground/UrlDisplay.js.map +0 -1
  509. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.d.ts +0 -7
  510. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +0 -11
  511. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +0 -1
  512. package/dist/lib/plugins/openapi/util/createSidebarCategory.d.ts +0 -9
  513. package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +0 -1
  514. package/dist/vite/plugin-configure-tailwind.d.ts +0 -2
  515. package/dist/vite/plugin-configure-tailwind.js +0 -38
  516. package/dist/vite/plugin-configure-tailwind.js.map +0 -1
  517. package/dist/vite/plugin-sidebar.js.map +0 -1
  518. package/dist/vite/plugin-theme-css.d.ts +0 -5
  519. package/dist/vite/plugin-theme-css.js +0 -77
  520. package/dist/vite/plugin-theme-css.js.map +0 -1
  521. package/lib/Callout-CoVxYafP.js +0 -231
  522. package/lib/Callout-CoVxYafP.js.map +0 -1
  523. package/lib/CategoryHeading-Cu2RwgjC.js +0 -10
  524. package/lib/CategoryHeading-Cu2RwgjC.js.map +0 -1
  525. package/lib/Dialog-BxpuVLh9.js.map +0 -1
  526. package/lib/Markdown-BUE2ViaD.js.map +0 -1
  527. package/lib/MdxPage-By4UkRkI.js +0 -84
  528. package/lib/MdxPage-By4UkRkI.js.map +0 -1
  529. package/lib/OasProvider-C6_Kx5O7.js +0 -33
  530. package/lib/OasProvider-C6_Kx5O7.js.map +0 -1
  531. package/lib/OperationList-BISd29LY.js.map +0 -1
  532. package/lib/Pagination-CCxhL836.js +0 -36
  533. package/lib/Pagination-CCxhL836.js.map +0 -1
  534. package/lib/RouteGuard-CgmsSw7T.js +0 -55
  535. package/lib/RouteGuard-CgmsSw7T.js.map +0 -1
  536. package/lib/SchemaList-BqnRo5ov.js.map +0 -1
  537. package/lib/SchemaView-CtYJpxQI.js.map +0 -1
  538. package/lib/Slot-DANV2b7_.js +0 -160
  539. package/lib/Slot-DANV2b7_.js.map +0 -1
  540. package/lib/clerk-yAKDC3Qz.js +0 -24812
  541. package/lib/clerk-yAKDC3Qz.js.map +0 -1
  542. package/lib/hook-wIlTGE-2.js +0 -1486
  543. package/lib/hook-wIlTGE-2.js.map +0 -1
  544. package/lib/index--oeBayMa.js +0 -86
  545. package/lib/index--oeBayMa.js.map +0 -1
  546. package/lib/index-Bn6Lc9tq.js +0 -9
  547. package/lib/index-Bn6Lc9tq.js.map +0 -1
  548. package/lib/index-QzXzw_ra.js +0 -24
  549. package/lib/index-QzXzw_ra.js.map +0 -1
  550. package/lib/index-RFzRn4fM.js +0 -3226
  551. package/lib/index-RFzRn4fM.js.map +0 -1
  552. package/lib/index-zddirpDj.js.map +0 -1
  553. package/lib/index.esm-BFcSKCe-.js +0 -683
  554. package/lib/index.esm-BFcSKCe-.js.map +0 -1
  555. package/lib/joinPath-B7kNnUX4.js +0 -8
  556. package/lib/joinPath-B7kNnUX4.js.map +0 -1
  557. package/lib/mutation-C-kdA_1r.js +0 -196
  558. package/lib/mutation-C-kdA_1r.js.map +0 -1
  559. package/lib/objectEntries-yMIkr2mI.js +0 -5
  560. package/lib/objectEntries-yMIkr2mI.js.map +0 -1
  561. package/lib/react-nprogress.esm-C2MPXjiJ.js +0 -389
  562. package/lib/react-nprogress.esm-C2MPXjiJ.js.map +0 -1
  563. package/lib/useLatest-hmRS46UF.js +0 -11
  564. package/lib/useLatest-hmRS46UF.js.map +0 -1
  565. package/lib/useMutation-3Ph3x6En.js +0 -97
  566. package/lib/useMutation-3Ph3x6En.js.map +0 -1
  567. package/src/lib/plugins/custom-pages/CustomPage.tsx +0 -18
  568. package/src/lib/plugins/markdown/resolver.ts +0 -59
  569. package/src/lib/plugins/openapi/playground/UrlDisplay.tsx +0 -32
  570. package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +0 -73
@@ -1,4204 +1,36 @@
1
- import { a as ft, H as Se } from "./index.esm-BFcSKCe-.js";
2
- import { z as mt, J as Wt } from "./index--oeBayMa.js";
3
- import { R as Kt, S as Yt, u as fe, f as me, g as Gt, L as Oe, O as pt } from "./chunk-DQRVZFIR-BblmKnHy.js";
4
- import { S as gt, r as yt, Q as Jt, n as O, t as Me, v as Ze, w as Z, x as Xt, y as es, z as ts, A as ss, B as De, D as $e, E as rs, h as ze, F as qe, G as as, e as vt, H as xt, l as ns, k as P, i as ee, I as _t, J as bt, K as is, j as H, u as os, d as ds, N as cs, Z as ls, m as us, C as hs } from "./hook-wIlTGE-2.js";
5
- import { B as kt, R as fs } from "./RouteGuard-CgmsSw7T.js";
6
- import { E as wt, S as T, a as ms, R as ps } from "./Slot-DANV2b7_.js";
7
- import { j as i } from "./jsx-runtime-C5mzlN2N.js";
8
- import { Button as jt } from "./ui/Button.js";
9
- import { Callout as gs } from "./ui/Callout.js";
10
- import { M as ys } from "./mutation-C-kdA_1r.js";
11
- import * as D from "react";
12
- import { createContext as Te, StrictMode as Nt, useRef as Ae, useEffect as V, useState as J, useCallback as vs, Suspense as Ee, memo as Ct, Component as xs, createElement as Le, useMemo as ge, useContext as _s } from "react";
13
- import * as bs from "react-dom";
14
- import { CircleFadingArrowUpIcon as ks, LoaderCircleIcon as ws, ExternalLink as js, CircleXIcon as Ns, ChevronRightIcon as Cs, SearchIcon as Ss, SunIcon as Os, MoonIcon as Ts, MenuIcon as As, PanelLeftIcon as Es } from "lucide-react";
15
- import { C as pe } from "./ClientOnly-E7hGysn1.js";
16
- import { c as C } from "./cn-wvCW-ho6.js";
17
- import { A as Ps, s as Rs, a as Be, b as Is, H as Ms, P as Zs, c as Ds, V as $s, M as zs } from "./Markdown-BUE2ViaD.js";
18
- import { S as St } from "./Spinner-mNLZ6awP.js";
19
- import { C as qs } from "./CategoryHeading-Cu2RwgjC.js";
20
- import { isSearchPlugin as Ls, isProfileMenuPlugin as Bs, isNavigationPlugin as Fe, isAuthenticationPlugin as Fs, isEventConsumerPlugin as Qs, needsInitialization as Vs, isApiIdentityPlugin as Us, isMdxProviderPlugin as Hs, hasHead as Ws } from "./zudoku.plugins.js";
21
- import { j as Ks } from "./joinPath-B7kNnUX4.js";
22
- import { o as Ys } from "./objectEntries-yMIkr2mI.js";
23
- import { B as _e } from "./Button-BE9IVkWV.js";
24
- import { DropdownMenu as Gs, DropdownMenuTrigger as Js, DropdownMenuContent as Xs, DropdownMenuLabel as er, DropdownMenuSeparator as ye, DropdownMenuSub as tr, DropdownMenuSubTrigger as sr, DropdownMenuPortal as rr, DropdownMenuSubContent as ar, DropdownMenuItem as nr } from "./ui/DropdownMenu.js";
25
- import { VisuallyHidden as Ot } from "@radix-ui/react-visually-hidden";
26
- import { D as ir, a as or, b as Tt, c as At, d as I } from "./Drawer-BzkOKwgC.js";
27
- import { u as dr } from "./react-nprogress.esm-C2MPXjiJ.js";
28
- import { a as cr } from "./index-DI5SPFK9.js";
29
- import { M as lr, u as ur } from "./index-QzXzw_ra.js";
30
- var hr = class extends gt {
31
- constructor(t = {}) {
32
- super(), this.config = t, this.#e = /* @__PURE__ */ new Map();
33
- }
34
- #e;
35
- build(t, e, s) {
36
- const r = e.queryKey, a = e.queryHash ?? yt(r, e);
37
- let n = this.get(a);
38
- return n || (n = new Jt({
39
- client: t,
40
- queryKey: r,
41
- queryHash: a,
42
- options: t.defaultQueryOptions(e),
43
- state: s,
44
- defaultOptions: t.getQueryDefaults(r)
45
- }), this.add(n)), n;
46
- }
47
- add(t) {
48
- this.#e.has(t.queryHash) || (this.#e.set(t.queryHash, t), this.notify({
49
- type: "added",
50
- query: t
51
- }));
52
- }
53
- remove(t) {
54
- const e = this.#e.get(t.queryHash);
55
- e && (t.destroy(), e === t && this.#e.delete(t.queryHash), this.notify({ type: "removed", query: t }));
56
- }
57
- clear() {
58
- O.batch(() => {
59
- this.getAll().forEach((t) => {
60
- this.remove(t);
61
- });
62
- });
63
- }
64
- get(t) {
65
- return this.#e.get(t);
66
- }
67
- getAll() {
68
- return [...this.#e.values()];
69
- }
70
- find(t) {
71
- const e = { exact: !0, ...t };
72
- return this.getAll().find(
73
- (s) => Me(e, s)
74
- );
75
- }
76
- findAll(t = {}) {
77
- const e = this.getAll();
78
- return Object.keys(t).length > 0 ? e.filter((s) => Me(t, s)) : e;
79
- }
80
- notify(t) {
81
- O.batch(() => {
82
- this.listeners.forEach((e) => {
83
- e(t);
84
- });
85
- });
86
- }
87
- onFocus() {
88
- O.batch(() => {
89
- this.getAll().forEach((t) => {
90
- t.onFocus();
91
- });
92
- });
93
- }
94
- onOnline() {
95
- O.batch(() => {
96
- this.getAll().forEach((t) => {
97
- t.onOnline();
98
- });
99
- });
100
- }
101
- }, fr = class extends gt {
102
- constructor(t = {}) {
103
- super(), this.config = t, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#s = 0;
104
- }
105
- #e;
106
- #t;
107
- #s;
108
- build(t, e, s) {
109
- const r = new ys({
110
- mutationCache: this,
111
- mutationId: ++this.#s,
112
- options: t.defaultMutationOptions(e),
113
- state: s
114
- });
115
- return this.add(r), r;
116
- }
117
- add(t) {
118
- this.#e.add(t);
119
- const e = ne(t);
120
- if (typeof e == "string") {
121
- const s = this.#t.get(e);
122
- s ? s.push(t) : this.#t.set(e, [t]);
123
- }
124
- this.notify({ type: "added", mutation: t });
125
- }
126
- remove(t) {
127
- if (this.#e.delete(t)) {
128
- const e = ne(t);
129
- if (typeof e == "string") {
130
- const s = this.#t.get(e);
131
- if (s)
132
- if (s.length > 1) {
133
- const r = s.indexOf(t);
134
- r !== -1 && s.splice(r, 1);
135
- } else s[0] === t && this.#t.delete(e);
136
- }
137
- }
138
- this.notify({ type: "removed", mutation: t });
139
- }
140
- canRun(t) {
141
- const e = ne(t);
142
- if (typeof e == "string") {
143
- const r = this.#t.get(e)?.find(
144
- (a) => a.state.status === "pending"
145
- );
146
- return !r || r === t;
147
- } else
148
- return !0;
149
- }
150
- runNext(t) {
151
- const e = ne(t);
152
- return typeof e == "string" ? this.#t.get(e)?.find((r) => r !== t && r.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
153
- }
154
- clear() {
155
- O.batch(() => {
156
- this.#e.forEach((t) => {
157
- this.notify({ type: "removed", mutation: t });
158
- }), this.#e.clear(), this.#t.clear();
159
- });
160
- }
161
- getAll() {
162
- return Array.from(this.#e);
163
- }
164
- find(t) {
165
- const e = { exact: !0, ...t };
166
- return this.getAll().find(
167
- (s) => Ze(e, s)
168
- );
169
- }
170
- findAll(t = {}) {
171
- return this.getAll().filter((e) => Ze(t, e));
172
- }
173
- notify(t) {
174
- O.batch(() => {
175
- this.listeners.forEach((e) => {
176
- e(t);
177
- });
178
- });
179
- }
180
- resumePausedMutations() {
181
- const t = this.getAll().filter((e) => e.state.isPaused);
182
- return O.batch(
183
- () => Promise.all(
184
- t.map((e) => e.continue().catch(Z))
185
- )
186
- );
187
- }
188
- };
189
- function ne(t) {
190
- return t.options.scope?.id;
191
- }
192
- function Qe(t) {
193
- return {
194
- onFetch: (e, s) => {
195
- const r = e.options, a = e.fetchOptions?.meta?.fetchMore?.direction, n = e.state.data?.pages || [], o = e.state.data?.pageParams || [];
196
- let d = { pages: [], pageParams: [] }, u = 0;
197
- const l = async () => {
198
- let g = !1;
199
- const j = (N) => {
200
- Object.defineProperty(N, "signal", {
201
- enumerable: !0,
202
- get: () => (e.signal.aborted ? g = !0 : e.signal.addEventListener("abort", () => {
203
- g = !0;
204
- }), e.signal)
205
- });
206
- }, k = Xt(e.options, e.fetchOptions), p = async (N, S, M) => {
207
- if (g)
208
- return Promise.reject();
209
- if (S == null && N.pages.length)
210
- return Promise.resolve(N);
211
- const ae = {
212
- client: e.client,
213
- queryKey: e.queryKey,
214
- pageParam: S,
215
- direction: M ? "backward" : "forward",
216
- meta: e.options.meta
217
- };
218
- j(ae);
219
- const Ht = await k(
220
- ae
221
- ), { maxPages: Re } = e.options, Ie = M ? es : ts;
222
- return {
223
- pages: Ie(N.pages, Ht, Re),
224
- pageParams: Ie(N.pageParams, S, Re)
225
- };
226
- };
227
- if (a && n.length) {
228
- const N = a === "backward", S = N ? mr : Ve, M = {
229
- pages: n,
230
- pageParams: o
231
- }, ae = S(r, M);
232
- d = await p(M, ae, N);
233
- } else {
234
- const N = t ?? n.length;
235
- do {
236
- const S = u === 0 ? o[0] ?? r.initialPageParam : Ve(r, d);
237
- if (u > 0 && S == null)
238
- break;
239
- d = await p(d, S), u++;
240
- } while (u < N);
241
- }
242
- return d;
243
- };
244
- e.options.persister ? e.fetchFn = () => e.options.persister?.(
245
- l,
246
- {
247
- client: e.client,
248
- queryKey: e.queryKey,
249
- meta: e.options.meta,
250
- signal: e.signal
251
- },
252
- s
253
- ) : e.fetchFn = l;
254
- }
255
- };
256
- }
257
- function Ve(t, { pages: e, pageParams: s }) {
258
- const r = e.length - 1;
259
- return e.length > 0 ? t.getNextPageParam(
260
- e[r],
261
- e,
262
- s[r],
263
- s
264
- ) : void 0;
265
- }
266
- function mr(t, { pages: e, pageParams: s }) {
267
- return e.length > 0 ? t.getPreviousPageParam?.(e[0], e, s[0], s) : void 0;
268
- }
269
- var pr = class {
270
- #e;
271
- #t;
272
- #s;
273
- #a;
274
- #n;
275
- #r;
276
- #i;
277
- #o;
278
- constructor(t = {}) {
279
- this.#e = t.queryCache || new hr(), this.#t = t.mutationCache || new fr(), this.#s = t.defaultOptions || {}, this.#a = /* @__PURE__ */ new Map(), this.#n = /* @__PURE__ */ new Map(), this.#r = 0;
280
- }
281
- mount() {
282
- this.#r++, this.#r === 1 && (this.#i = ss.subscribe(async (t) => {
283
- t && (await this.resumePausedMutations(), this.#e.onFocus());
284
- }), this.#o = De.subscribe(async (t) => {
285
- t && (await this.resumePausedMutations(), this.#e.onOnline());
286
- }));
287
- }
288
- unmount() {
289
- this.#r--, this.#r === 0 && (this.#i?.(), this.#i = void 0, this.#o?.(), this.#o = void 0);
290
- }
291
- isFetching(t) {
292
- return this.#e.findAll({ ...t, fetchStatus: "fetching" }).length;
293
- }
294
- isMutating(t) {
295
- return this.#t.findAll({ ...t, status: "pending" }).length;
296
- }
297
- /**
298
- * Imperative (non-reactive) way to retrieve data for a QueryKey.
299
- * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
300
- *
301
- * Hint: Do not use this function inside a component, because it won't receive updates.
302
- * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
303
- */
304
- getQueryData(t) {
305
- const e = this.defaultQueryOptions({ queryKey: t });
306
- return this.#e.get(e.queryHash)?.state.data;
307
- }
308
- ensureQueryData(t) {
309
- const e = this.defaultQueryOptions(t), s = this.#e.build(this, e), r = s.state.data;
310
- return r === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && s.isStaleByTime($e(e.staleTime, s)) && this.prefetchQuery(e), Promise.resolve(r));
311
- }
312
- getQueriesData(t) {
313
- return this.#e.findAll(t).map(({ queryKey: e, state: s }) => {
314
- const r = s.data;
315
- return [e, r];
316
- });
317
- }
318
- setQueryData(t, e, s) {
319
- const r = this.defaultQueryOptions({ queryKey: t }), n = this.#e.get(
320
- r.queryHash
321
- )?.state.data, o = rs(e, n);
322
- if (o !== void 0)
323
- return this.#e.build(this, r).setData(o, { ...s, manual: !0 });
324
- }
325
- setQueriesData(t, e, s) {
326
- return O.batch(
327
- () => this.#e.findAll(t).map(({ queryKey: r }) => [
328
- r,
329
- this.setQueryData(r, e, s)
330
- ])
331
- );
332
- }
333
- getQueryState(t) {
334
- const e = this.defaultQueryOptions({ queryKey: t });
335
- return this.#e.get(
336
- e.queryHash
337
- )?.state;
338
- }
339
- removeQueries(t) {
340
- const e = this.#e;
341
- O.batch(() => {
342
- e.findAll(t).forEach((s) => {
343
- e.remove(s);
344
- });
345
- });
346
- }
347
- resetQueries(t, e) {
348
- const s = this.#e;
349
- return O.batch(() => (s.findAll(t).forEach((r) => {
350
- r.reset();
351
- }), this.refetchQueries(
352
- {
353
- type: "active",
354
- ...t
355
- },
356
- e
357
- )));
358
- }
359
- cancelQueries(t, e = {}) {
360
- const s = { revert: !0, ...e }, r = O.batch(
361
- () => this.#e.findAll(t).map((a) => a.cancel(s))
362
- );
363
- return Promise.all(r).then(Z).catch(Z);
364
- }
365
- invalidateQueries(t, e = {}) {
366
- return O.batch(() => (this.#e.findAll(t).forEach((s) => {
367
- s.invalidate();
368
- }), t?.refetchType === "none" ? Promise.resolve() : this.refetchQueries(
369
- {
370
- ...t,
371
- type: t?.refetchType ?? t?.type ?? "active"
372
- },
373
- e
374
- )));
375
- }
376
- refetchQueries(t, e = {}) {
377
- const s = {
378
- ...e,
379
- cancelRefetch: e.cancelRefetch ?? !0
380
- }, r = O.batch(
381
- () => this.#e.findAll(t).filter((a) => !a.isDisabled()).map((a) => {
382
- let n = a.fetch(void 0, s);
383
- return s.throwOnError || (n = n.catch(Z)), a.state.fetchStatus === "paused" ? Promise.resolve() : n;
384
- })
385
- );
386
- return Promise.all(r).then(Z);
387
- }
388
- fetchQuery(t) {
389
- const e = this.defaultQueryOptions(t);
390
- e.retry === void 0 && (e.retry = !1);
391
- const s = this.#e.build(this, e);
392
- return s.isStaleByTime(
393
- $e(e.staleTime, s)
394
- ) ? s.fetch(e) : Promise.resolve(s.state.data);
395
- }
396
- prefetchQuery(t) {
397
- return this.fetchQuery(t).then(Z).catch(Z);
398
- }
399
- fetchInfiniteQuery(t) {
400
- return t.behavior = Qe(t.pages), this.fetchQuery(t);
401
- }
402
- prefetchInfiniteQuery(t) {
403
- return this.fetchInfiniteQuery(t).then(Z).catch(Z);
404
- }
405
- ensureInfiniteQueryData(t) {
406
- return t.behavior = Qe(t.pages), this.ensureQueryData(t);
407
- }
408
- resumePausedMutations() {
409
- return De.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
410
- }
411
- getQueryCache() {
412
- return this.#e;
413
- }
414
- getMutationCache() {
415
- return this.#t;
416
- }
417
- getDefaultOptions() {
418
- return this.#s;
419
- }
420
- setDefaultOptions(t) {
421
- this.#s = t;
422
- }
423
- setQueryDefaults(t, e) {
424
- this.#a.set(ze(t), {
425
- queryKey: t,
426
- defaultOptions: e
427
- });
428
- }
429
- getQueryDefaults(t) {
430
- const e = [...this.#a.values()], s = {};
431
- return e.forEach((r) => {
432
- qe(t, r.queryKey) && Object.assign(s, r.defaultOptions);
433
- }), s;
434
- }
435
- setMutationDefaults(t, e) {
436
- this.#n.set(ze(t), {
437
- mutationKey: t,
438
- defaultOptions: e
439
- });
440
- }
441
- getMutationDefaults(t) {
442
- const e = [...this.#n.values()], s = {};
443
- return e.forEach((r) => {
444
- qe(t, r.mutationKey) && Object.assign(s, r.defaultOptions);
445
- }), s;
446
- }
447
- defaultQueryOptions(t) {
448
- if (t._defaulted)
449
- return t;
450
- const e = {
451
- ...this.#s.queries,
452
- ...this.getQueryDefaults(t.queryKey),
453
- ...t,
454
- _defaulted: !0
455
- };
456
- return e.queryHash || (e.queryHash = yt(
457
- e.queryKey,
458
- e
459
- )), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn === as && (e.enabled = !1), e;
460
- }
461
- defaultMutationOptions(t) {
462
- return t?._defaulted ? t : {
463
- ...this.#s.mutations,
464
- ...t?.mutationKey && this.getMutationDefaults(t.mutationKey),
465
- ...t,
466
- _defaulted: !0
467
- };
468
- }
469
- clear() {
470
- this.#e.clear(), this.#t.clear();
471
- }
472
- };
473
- function gr(t) {
474
- return t;
475
- }
476
- function Ue(t, e, s) {
477
- if (typeof e != "object" || e === null)
478
- return;
479
- const r = t.getMutationCache(), a = t.getQueryCache(), n = s?.defaultOptions?.deserializeData ?? t.getDefaultOptions().hydrate?.deserializeData ?? gr, o = e.mutations || [], d = e.queries || [];
480
- o.forEach(({ state: u, ...l }) => {
481
- r.build(
482
- t,
483
- {
484
- ...t.getDefaultOptions().hydrate?.mutations,
485
- ...s?.defaultOptions?.mutations,
486
- ...l
487
- },
488
- u
489
- );
490
- }), d.forEach(({ queryKey: u, state: l, queryHash: g, meta: j, promise: k }) => {
491
- let p = a.get(g);
492
- const N = l.data === void 0 ? l.data : n(l.data);
493
- if (p) {
494
- if (p.state.dataUpdatedAt < l.dataUpdatedAt) {
495
- const { fetchStatus: S, ...M } = l;
496
- p.setState({
497
- ...M,
498
- data: N
499
- });
500
- }
501
- } else
502
- p = a.build(
503
- t,
504
- {
505
- ...t.getDefaultOptions().hydrate?.queries,
506
- ...s?.defaultOptions?.queries,
507
- queryKey: u,
508
- queryHash: g,
509
- meta: j
510
- },
511
- // Reset fetch status to idle to avoid
512
- // query being stuck in fetching state upon hydration
513
- {
514
- ...l,
515
- data: N,
516
- fetchStatus: "idle"
517
- }
518
- );
519
- if (k) {
520
- const S = Promise.resolve(k).then(n);
521
- p.fetch(void 0, { initialPromise: S });
522
- }
523
- });
524
- }
525
- var He = (t, e) => typeof t == "object" && t !== null && e in t, yr = ({
526
- children: t,
527
- options: e = {},
528
- state: s,
529
- queryClient: r
530
- }) => {
531
- const a = vt(r), [n, o] = D.useState(), d = D.useRef(e);
532
- return d.current = e, D.useMemo(() => {
533
- if (s) {
534
- if (typeof s != "object")
535
- return;
536
- const u = a.getQueryCache(), l = s.queries || [], g = [], j = [];
537
- for (const k of l) {
538
- const p = u.get(k.queryHash);
539
- if (!p)
540
- g.push(k);
541
- else {
542
- const N = k.state.dataUpdatedAt > p.state.dataUpdatedAt || // RSC special serialized then-able chunks
543
- He(k.promise, "status") && He(p.promise, "status") && k.promise.status !== p.promise.status, S = n?.find(
544
- (M) => M.queryHash === k.queryHash
545
- );
546
- N && (!S || k.state.dataUpdatedAt > S.state.dataUpdatedAt) && j.push(k);
547
- }
548
- }
549
- g.length > 0 && Ue(a, { queries: g }, d.current), j.length > 0 && o(
550
- (k) => k ? [...k, ...j] : j
551
- );
552
- }
553
- }, [a, n, s]), D.useEffect(() => {
554
- n && (Ue(a, { queries: n }, d.current), o(void 0));
555
- }, [a, n]), t;
556
- };
557
- function vr({ error: t }) {
558
- return /* @__PURE__ */ i.jsx(wt, { error: t });
559
- }
560
- /**
561
- * react-router v7.6.1
562
- *
563
- * Copyright (c) Remix Software Inc.
564
- *
565
- * This source code is licensed under the MIT license found in the
566
- * LICENSE.md file in the root directory of this source tree.
567
- *
568
- * @license MIT
569
- */
570
- function xr(t) {
571
- return /* @__PURE__ */ D.createElement(Kt, { flushSync: bs.flushSync, ...t });
572
- }
573
- const be = Te({ stagger: !1 }), _r = new pr({
574
- defaultOptions: {
575
- queries: {
576
- staleTime: 1e3 * 60 * 5
577
- }
578
- }
579
- }), br = ({
580
- router: t,
581
- hydrate: e = !1
582
- }) => /* @__PURE__ */ i.jsx(Nt, { children: /* @__PURE__ */ i.jsx(xt, { client: _r, children: /* @__PURE__ */ i.jsx(yr, { state: e ? window.DATA : void 0, children: /* @__PURE__ */ i.jsx(kt, { value: !1, children: /* @__PURE__ */ i.jsx(ft, { children: /* @__PURE__ */ i.jsx(be.Provider, { value: { stagger: !e }, children: /* @__PURE__ */ i.jsx(xr, { router: t }) }) }) }) }) }) }), kr = ({
583
- router: t,
584
- context: e,
585
- queryClient: s,
586
- helmetContext: r,
587
- bypassProtection: a = !1
588
- }) => /* @__PURE__ */ i.jsx(Nt, { children: /* @__PURE__ */ i.jsx(xt, { client: s, children: /* @__PURE__ */ i.jsx(ft, { context: r, children: /* @__PURE__ */ i.jsx(kt, { value: a, children: /* @__PURE__ */ i.jsx(Yt, { router: t, context: e }) }) }) }) });
589
- var b;
590
- (function(t) {
591
- t.assertEqual = (a) => {
592
- };
593
- function e(a) {
594
- }
595
- t.assertIs = e;
596
- function s(a) {
597
- throw new Error();
598
- }
599
- t.assertNever = s, t.arrayToEnum = (a) => {
600
- const n = {};
601
- for (const o of a)
602
- n[o] = o;
603
- return n;
604
- }, t.getValidEnumValues = (a) => {
605
- const n = t.objectKeys(a).filter((d) => typeof a[a[d]] != "number"), o = {};
606
- for (const d of n)
607
- o[d] = a[d];
608
- return t.objectValues(o);
609
- }, t.objectValues = (a) => t.objectKeys(a).map(function(n) {
610
- return a[n];
611
- }), t.objectKeys = typeof Object.keys == "function" ? (a) => Object.keys(a) : (a) => {
612
- const n = [];
613
- for (const o in a)
614
- Object.prototype.hasOwnProperty.call(a, o) && n.push(o);
615
- return n;
616
- }, t.find = (a, n) => {
617
- for (const o of a)
618
- if (n(o))
619
- return o;
620
- }, t.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && Number.isFinite(a) && Math.floor(a) === a;
621
- function r(a, n = " | ") {
622
- return a.map((o) => typeof o == "string" ? `'${o}'` : o).join(n);
623
- }
624
- t.joinValues = r, t.jsonStringifyReplacer = (a, n) => typeof n == "bigint" ? n.toString() : n;
625
- })(b || (b = {}));
626
- var We;
627
- (function(t) {
628
- t.mergeShapes = (e, s) => ({
629
- ...e,
630
- ...s
631
- // second overwrites first
632
- });
633
- })(We || (We = {}));
634
- const f = b.arrayToEnum([
635
- "string",
636
- "nan",
637
- "number",
638
- "integer",
639
- "float",
640
- "boolean",
641
- "date",
642
- "bigint",
643
- "symbol",
644
- "function",
645
- "undefined",
646
- "null",
647
- "array",
648
- "object",
649
- "unknown",
650
- "promise",
651
- "void",
652
- "never",
653
- "map",
654
- "set"
655
- ]), z = (t) => {
656
- switch (typeof t) {
657
- case "undefined":
658
- return f.undefined;
659
- case "string":
660
- return f.string;
661
- case "number":
662
- return Number.isNaN(t) ? f.nan : f.number;
663
- case "boolean":
664
- return f.boolean;
665
- case "function":
666
- return f.function;
667
- case "bigint":
668
- return f.bigint;
669
- case "symbol":
670
- return f.symbol;
671
- case "object":
672
- return Array.isArray(t) ? f.array : t === null ? f.null : t.then && typeof t.then == "function" && t.catch && typeof t.catch == "function" ? f.promise : typeof Map < "u" && t instanceof Map ? f.map : typeof Set < "u" && t instanceof Set ? f.set : typeof Date < "u" && t instanceof Date ? f.date : f.object;
673
- default:
674
- return f.unknown;
675
- }
676
- }, c = b.arrayToEnum([
677
- "invalid_type",
678
- "invalid_literal",
679
- "custom",
680
- "invalid_union",
681
- "invalid_union_discriminator",
682
- "invalid_enum_value",
683
- "unrecognized_keys",
684
- "invalid_arguments",
685
- "invalid_return_type",
686
- "invalid_date",
687
- "invalid_string",
688
- "too_small",
689
- "too_big",
690
- "invalid_intersection_types",
691
- "not_multiple_of",
692
- "not_finite"
693
- ]);
694
- class $ extends Error {
695
- get errors() {
696
- return this.issues;
697
- }
698
- constructor(e) {
699
- super(), this.issues = [], this.addIssue = (r) => {
700
- this.issues = [...this.issues, r];
701
- }, this.addIssues = (r = []) => {
702
- this.issues = [...this.issues, ...r];
703
- };
704
- const s = new.target.prototype;
705
- Object.setPrototypeOf ? Object.setPrototypeOf(this, s) : this.__proto__ = s, this.name = "ZodError", this.issues = e;
706
- }
707
- format(e) {
708
- const s = e || function(n) {
709
- return n.message;
710
- }, r = { _errors: [] }, a = (n) => {
711
- for (const o of n.issues)
712
- if (o.code === "invalid_union")
713
- o.unionErrors.map(a);
714
- else if (o.code === "invalid_return_type")
715
- a(o.returnTypeError);
716
- else if (o.code === "invalid_arguments")
717
- a(o.argumentsError);
718
- else if (o.path.length === 0)
719
- r._errors.push(s(o));
720
- else {
721
- let d = r, u = 0;
722
- for (; u < o.path.length; ) {
723
- const l = o.path[u];
724
- u === o.path.length - 1 ? (d[l] = d[l] || { _errors: [] }, d[l]._errors.push(s(o))) : d[l] = d[l] || { _errors: [] }, d = d[l], u++;
725
- }
726
- }
727
- };
728
- return a(this), r;
729
- }
730
- static assert(e) {
731
- if (!(e instanceof $))
732
- throw new Error(`Not a ZodError: ${e}`);
733
- }
734
- toString() {
735
- return this.message;
736
- }
737
- get message() {
738
- return JSON.stringify(this.issues, b.jsonStringifyReplacer, 2);
739
- }
740
- get isEmpty() {
741
- return this.issues.length === 0;
742
- }
743
- flatten(e = (s) => s.message) {
744
- const s = {}, r = [];
745
- for (const a of this.issues)
746
- a.path.length > 0 ? (s[a.path[0]] = s[a.path[0]] || [], s[a.path[0]].push(e(a))) : r.push(e(a));
747
- return { formErrors: r, fieldErrors: s };
748
- }
749
- get formErrors() {
750
- return this.flatten();
751
- }
752
- }
753
- $.create = (t) => new $(t);
754
- const ke = (t, e) => {
755
- let s;
756
- switch (t.code) {
757
- case c.invalid_type:
758
- t.received === f.undefined ? s = "Required" : s = `Expected ${t.expected}, received ${t.received}`;
759
- break;
760
- case c.invalid_literal:
761
- s = `Invalid literal value, expected ${JSON.stringify(t.expected, b.jsonStringifyReplacer)}`;
762
- break;
763
- case c.unrecognized_keys:
764
- s = `Unrecognized key(s) in object: ${b.joinValues(t.keys, ", ")}`;
765
- break;
766
- case c.invalid_union:
767
- s = "Invalid input";
768
- break;
769
- case c.invalid_union_discriminator:
770
- s = `Invalid discriminator value. Expected ${b.joinValues(t.options)}`;
771
- break;
772
- case c.invalid_enum_value:
773
- s = `Invalid enum value. Expected ${b.joinValues(t.options)}, received '${t.received}'`;
774
- break;
775
- case c.invalid_arguments:
776
- s = "Invalid function arguments";
777
- break;
778
- case c.invalid_return_type:
779
- s = "Invalid function return type";
780
- break;
781
- case c.invalid_date:
782
- s = "Invalid date";
783
- break;
784
- case c.invalid_string:
785
- typeof t.validation == "object" ? "includes" in t.validation ? (s = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (s = `${s} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? s = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? s = `Invalid input: must end with "${t.validation.endsWith}"` : b.assertNever(t.validation) : t.validation !== "regex" ? s = `Invalid ${t.validation}` : s = "Invalid";
786
- break;
787
- case c.too_small:
788
- t.type === "array" ? s = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? s = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? s = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? s = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : s = "Invalid input";
789
- break;
790
- case c.too_big:
791
- t.type === "array" ? s = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "less than"} ${t.maximum} element(s)` : t.type === "string" ? s = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "under"} ${t.maximum} character(s)` : t.type === "number" ? s = `Number must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "bigint" ? s = `BigInt must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "date" ? s = `Date must be ${t.exact ? "exactly" : t.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(t.maximum))}` : s = "Invalid input";
792
- break;
793
- case c.custom:
794
- s = "Invalid input";
795
- break;
796
- case c.invalid_intersection_types:
797
- s = "Intersection results could not be merged";
798
- break;
799
- case c.not_multiple_of:
800
- s = `Number must be a multiple of ${t.multipleOf}`;
801
- break;
802
- case c.not_finite:
803
- s = "Number must be finite";
804
- break;
805
- default:
806
- s = e.defaultError, b.assertNever(t);
807
- }
808
- return { message: s };
809
- };
810
- let wr = ke;
811
- function jr() {
812
- return wr;
813
- }
814
- const Nr = (t) => {
815
- const { data: e, path: s, errorMaps: r, issueData: a } = t, n = [...s, ...a.path || []], o = {
816
- ...a,
817
- path: n
818
- };
819
- if (a.message !== void 0)
820
- return {
821
- ...a,
822
- path: n,
823
- message: a.message
824
- };
825
- let d = "";
826
- const u = r.filter((l) => !!l).slice().reverse();
827
- for (const l of u)
828
- d = l(o, { data: e, defaultError: d }).message;
829
- return {
830
- ...a,
831
- path: n,
832
- message: d
833
- };
834
- };
835
- function h(t, e) {
836
- const s = jr(), r = Nr({
837
- issueData: e,
838
- data: t.data,
839
- path: t.path,
840
- errorMaps: [
841
- t.common.contextualErrorMap,
842
- // contextual error map is first priority
843
- t.schemaErrorMap,
844
- // then schema-bound map if available
845
- s,
846
- // then global override map
847
- s === ke ? void 0 : ke
848
- // then global default map
849
- ].filter((a) => !!a)
850
- });
851
- t.common.issues.push(r);
852
- }
853
- class A {
854
- constructor() {
855
- this.value = "valid";
856
- }
857
- dirty() {
858
- this.value === "valid" && (this.value = "dirty");
859
- }
860
- abort() {
861
- this.value !== "aborted" && (this.value = "aborted");
862
- }
863
- static mergeArray(e, s) {
864
- const r = [];
865
- for (const a of s) {
866
- if (a.status === "aborted")
867
- return y;
868
- a.status === "dirty" && e.dirty(), r.push(a.value);
869
- }
870
- return { status: e.value, value: r };
871
- }
872
- static async mergeObjectAsync(e, s) {
873
- const r = [];
874
- for (const a of s) {
875
- const n = await a.key, o = await a.value;
876
- r.push({
877
- key: n,
878
- value: o
879
- });
880
- }
881
- return A.mergeObjectSync(e, r);
882
- }
883
- static mergeObjectSync(e, s) {
884
- const r = {};
885
- for (const a of s) {
886
- const { key: n, value: o } = a;
887
- if (n.status === "aborted" || o.status === "aborted")
888
- return y;
889
- n.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), n.value !== "__proto__" && (typeof o.value < "u" || a.alwaysSet) && (r[n.value] = o.value);
890
- }
891
- return { status: e.value, value: r };
892
- }
893
- }
894
- const y = Object.freeze({
895
- status: "aborted"
896
- }), X = (t) => ({ status: "dirty", value: t }), E = (t) => ({ status: "valid", value: t }), Ke = (t) => t.status === "aborted", Ye = (t) => t.status === "dirty", W = (t) => t.status === "valid", de = (t) => typeof Promise < "u" && t instanceof Promise;
897
- var m;
898
- (function(t) {
899
- t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
900
- })(m || (m = {}));
901
- class B {
902
- constructor(e, s, r, a) {
903
- this._cachedPath = [], this.parent = e, this.data = s, this._path = r, this._key = a;
904
- }
905
- get path() {
906
- return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
907
- }
908
- }
909
- const Ge = (t, e) => {
910
- if (W(e))
911
- return { success: !0, data: e.value };
912
- if (!t.common.issues.length)
913
- throw new Error("Validation failed but no issues detected.");
914
- return {
915
- success: !1,
916
- get error() {
917
- if (this._error)
918
- return this._error;
919
- const s = new $(t.common.issues);
920
- return this._error = s, this._error;
921
- }
922
- };
923
- };
924
- function x(t) {
925
- if (!t)
926
- return {};
927
- const { errorMap: e, invalid_type_error: s, required_error: r, description: a } = t;
928
- if (e && (s || r))
929
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
930
- return e ? { errorMap: e, description: a } : { errorMap: (o, d) => {
931
- const { message: u } = t;
932
- return o.code === "invalid_enum_value" ? { message: u ?? d.defaultError } : typeof d.data > "u" ? { message: u ?? r ?? d.defaultError } : o.code !== "invalid_type" ? { message: d.defaultError } : { message: u ?? s ?? d.defaultError };
933
- }, description: a };
934
- }
935
- class _ {
936
- get description() {
937
- return this._def.description;
938
- }
939
- _getType(e) {
940
- return z(e.data);
941
- }
942
- _getOrReturnCtx(e, s) {
943
- return s || {
944
- common: e.parent.common,
945
- data: e.data,
946
- parsedType: z(e.data),
947
- schemaErrorMap: this._def.errorMap,
948
- path: e.path,
949
- parent: e.parent
950
- };
951
- }
952
- _processInputParams(e) {
953
- return {
954
- status: new A(),
955
- ctx: {
956
- common: e.parent.common,
957
- data: e.data,
958
- parsedType: z(e.data),
959
- schemaErrorMap: this._def.errorMap,
960
- path: e.path,
961
- parent: e.parent
962
- }
963
- };
964
- }
965
- _parseSync(e) {
966
- const s = this._parse(e);
967
- if (de(s))
968
- throw new Error("Synchronous parse encountered promise.");
969
- return s;
970
- }
971
- _parseAsync(e) {
972
- const s = this._parse(e);
973
- return Promise.resolve(s);
974
- }
975
- parse(e, s) {
976
- const r = this.safeParse(e, s);
977
- if (r.success)
978
- return r.data;
979
- throw r.error;
980
- }
981
- safeParse(e, s) {
982
- const r = {
983
- common: {
984
- issues: [],
985
- async: s?.async ?? !1,
986
- contextualErrorMap: s?.errorMap
987
- },
988
- path: s?.path || [],
989
- schemaErrorMap: this._def.errorMap,
990
- parent: null,
991
- data: e,
992
- parsedType: z(e)
993
- }, a = this._parseSync({ data: e, path: r.path, parent: r });
994
- return Ge(r, a);
995
- }
996
- "~validate"(e) {
997
- const s = {
998
- common: {
999
- issues: [],
1000
- async: !!this["~standard"].async
1001
- },
1002
- path: [],
1003
- schemaErrorMap: this._def.errorMap,
1004
- parent: null,
1005
- data: e,
1006
- parsedType: z(e)
1007
- };
1008
- if (!this["~standard"].async)
1009
- try {
1010
- const r = this._parseSync({ data: e, path: [], parent: s });
1011
- return W(r) ? {
1012
- value: r.value
1013
- } : {
1014
- issues: s.common.issues
1015
- };
1016
- } catch (r) {
1017
- r?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), s.common = {
1018
- issues: [],
1019
- async: !0
1020
- };
1021
- }
1022
- return this._parseAsync({ data: e, path: [], parent: s }).then((r) => W(r) ? {
1023
- value: r.value
1024
- } : {
1025
- issues: s.common.issues
1026
- });
1027
- }
1028
- async parseAsync(e, s) {
1029
- const r = await this.safeParseAsync(e, s);
1030
- if (r.success)
1031
- return r.data;
1032
- throw r.error;
1033
- }
1034
- async safeParseAsync(e, s) {
1035
- const r = {
1036
- common: {
1037
- issues: [],
1038
- contextualErrorMap: s?.errorMap,
1039
- async: !0
1040
- },
1041
- path: s?.path || [],
1042
- schemaErrorMap: this._def.errorMap,
1043
- parent: null,
1044
- data: e,
1045
- parsedType: z(e)
1046
- }, a = this._parse({ data: e, path: r.path, parent: r }), n = await (de(a) ? a : Promise.resolve(a));
1047
- return Ge(r, n);
1048
- }
1049
- refine(e, s) {
1050
- const r = (a) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(a) : s;
1051
- return this._refinement((a, n) => {
1052
- const o = e(a), d = () => n.addIssue({
1053
- code: c.custom,
1054
- ...r(a)
1055
- });
1056
- return typeof Promise < "u" && o instanceof Promise ? o.then((u) => u ? !0 : (d(), !1)) : o ? !0 : (d(), !1);
1057
- });
1058
- }
1059
- refinement(e, s) {
1060
- return this._refinement((r, a) => e(r) ? !0 : (a.addIssue(typeof s == "function" ? s(r, a) : s), !1));
1061
- }
1062
- _refinement(e) {
1063
- return new Y({
1064
- schema: this,
1065
- typeName: v.ZodEffects,
1066
- effect: { type: "refinement", refinement: e }
1067
- });
1068
- }
1069
- superRefine(e) {
1070
- return this._refinement(e);
1071
- }
1072
- constructor(e) {
1073
- this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
1074
- version: 1,
1075
- vendor: "zod",
1076
- validate: (s) => this["~validate"](s)
1077
- };
1078
- }
1079
- optional() {
1080
- return L.create(this, this._def);
1081
- }
1082
- nullable() {
1083
- return G.create(this, this._def);
1084
- }
1085
- nullish() {
1086
- return this.nullable().optional();
1087
- }
1088
- array() {
1089
- return R.create(this);
1090
- }
1091
- promise() {
1092
- return he.create(this, this._def);
1093
- }
1094
- or(e) {
1095
- return le.create([this, e], this._def);
1096
- }
1097
- and(e) {
1098
- return ue.create(this, e, this._def);
1099
- }
1100
- transform(e) {
1101
- return new Y({
1102
- ...x(this._def),
1103
- schema: this,
1104
- typeName: v.ZodEffects,
1105
- effect: { type: "transform", transform: e }
1106
- });
1107
- }
1108
- default(e) {
1109
- const s = typeof e == "function" ? e : () => e;
1110
- return new je({
1111
- ...x(this._def),
1112
- innerType: this,
1113
- defaultValue: s,
1114
- typeName: v.ZodDefault
1115
- });
1116
- }
1117
- brand() {
1118
- return new Wr({
1119
- typeName: v.ZodBranded,
1120
- type: this,
1121
- ...x(this._def)
1122
- });
1123
- }
1124
- catch(e) {
1125
- const s = typeof e == "function" ? e : () => e;
1126
- return new Ne({
1127
- ...x(this._def),
1128
- innerType: this,
1129
- catchValue: s,
1130
- typeName: v.ZodCatch
1131
- });
1132
- }
1133
- describe(e) {
1134
- const s = this.constructor;
1135
- return new s({
1136
- ...this._def,
1137
- description: e
1138
- });
1139
- }
1140
- pipe(e) {
1141
- return Pe.create(this, e);
1142
- }
1143
- readonly() {
1144
- return Ce.create(this);
1145
- }
1146
- isOptional() {
1147
- return this.safeParse(void 0).success;
1148
- }
1149
- isNullable() {
1150
- return this.safeParse(null).success;
1151
- }
1152
- }
1153
- const Cr = /^c[^\s-]{8,}$/i, Sr = /^[0-9a-z]+$/, Or = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Tr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ar = /^[a-z0-9_-]{21}$/i, Er = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Pr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Rr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ir = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1154
- let ve;
1155
- const Mr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Zr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Dr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, $r = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, zr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, qr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Et = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Lr = new RegExp(`^${Et}$`);
1156
- function Pt(t) {
1157
- let e = "[0-5]\\d";
1158
- t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
1159
- const s = t.precision ? "+" : "?";
1160
- return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`;
1161
- }
1162
- function Br(t) {
1163
- return new RegExp(`^${Pt(t)}$`);
1164
- }
1165
- function Fr(t) {
1166
- let e = `${Et}T${Pt(t)}`;
1167
- const s = [];
1168
- return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
1169
- }
1170
- function Qr(t, e) {
1171
- return !!((e === "v4" || !e) && Mr.test(t) || (e === "v6" || !e) && Dr.test(t));
1172
- }
1173
- function Vr(t, e) {
1174
- if (!Er.test(t))
1175
- return !1;
1176
- try {
1177
- const [s] = t.split("."), r = s.replace(/-/g, "+").replace(/_/g, "/").padEnd(s.length + (4 - s.length % 4) % 4, "="), a = JSON.parse(atob(r));
1178
- return !(typeof a != "object" || a === null || "typ" in a && a?.typ !== "JWT" || !a.alg || e && a.alg !== e);
1179
- } catch {
1180
- return !1;
1181
- }
1182
- }
1183
- function Ur(t, e) {
1184
- return !!((e === "v4" || !e) && Zr.test(t) || (e === "v6" || !e) && $r.test(t));
1185
- }
1186
- class q extends _ {
1187
- _parse(e) {
1188
- if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
1189
- const n = this._getOrReturnCtx(e);
1190
- return h(n, {
1191
- code: c.invalid_type,
1192
- expected: f.string,
1193
- received: n.parsedType
1194
- }), y;
1195
- }
1196
- const r = new A();
1197
- let a;
1198
- for (const n of this._def.checks)
1199
- if (n.kind === "min")
1200
- e.data.length < n.value && (a = this._getOrReturnCtx(e, a), h(a, {
1201
- code: c.too_small,
1202
- minimum: n.value,
1203
- type: "string",
1204
- inclusive: !0,
1205
- exact: !1,
1206
- message: n.message
1207
- }), r.dirty());
1208
- else if (n.kind === "max")
1209
- e.data.length > n.value && (a = this._getOrReturnCtx(e, a), h(a, {
1210
- code: c.too_big,
1211
- maximum: n.value,
1212
- type: "string",
1213
- inclusive: !0,
1214
- exact: !1,
1215
- message: n.message
1216
- }), r.dirty());
1217
- else if (n.kind === "length") {
1218
- const o = e.data.length > n.value, d = e.data.length < n.value;
1219
- (o || d) && (a = this._getOrReturnCtx(e, a), o ? h(a, {
1220
- code: c.too_big,
1221
- maximum: n.value,
1222
- type: "string",
1223
- inclusive: !0,
1224
- exact: !0,
1225
- message: n.message
1226
- }) : d && h(a, {
1227
- code: c.too_small,
1228
- minimum: n.value,
1229
- type: "string",
1230
- inclusive: !0,
1231
- exact: !0,
1232
- message: n.message
1233
- }), r.dirty());
1234
- } else if (n.kind === "email")
1235
- Rr.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1236
- validation: "email",
1237
- code: c.invalid_string,
1238
- message: n.message
1239
- }), r.dirty());
1240
- else if (n.kind === "emoji")
1241
- ve || (ve = new RegExp(Ir, "u")), ve.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1242
- validation: "emoji",
1243
- code: c.invalid_string,
1244
- message: n.message
1245
- }), r.dirty());
1246
- else if (n.kind === "uuid")
1247
- Tr.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1248
- validation: "uuid",
1249
- code: c.invalid_string,
1250
- message: n.message
1251
- }), r.dirty());
1252
- else if (n.kind === "nanoid")
1253
- Ar.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1254
- validation: "nanoid",
1255
- code: c.invalid_string,
1256
- message: n.message
1257
- }), r.dirty());
1258
- else if (n.kind === "cuid")
1259
- Cr.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1260
- validation: "cuid",
1261
- code: c.invalid_string,
1262
- message: n.message
1263
- }), r.dirty());
1264
- else if (n.kind === "cuid2")
1265
- Sr.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1266
- validation: "cuid2",
1267
- code: c.invalid_string,
1268
- message: n.message
1269
- }), r.dirty());
1270
- else if (n.kind === "ulid")
1271
- Or.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1272
- validation: "ulid",
1273
- code: c.invalid_string,
1274
- message: n.message
1275
- }), r.dirty());
1276
- else if (n.kind === "url")
1277
- try {
1278
- new URL(e.data);
1279
- } catch {
1280
- a = this._getOrReturnCtx(e, a), h(a, {
1281
- validation: "url",
1282
- code: c.invalid_string,
1283
- message: n.message
1284
- }), r.dirty();
1285
- }
1286
- else n.kind === "regex" ? (n.regex.lastIndex = 0, n.regex.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1287
- validation: "regex",
1288
- code: c.invalid_string,
1289
- message: n.message
1290
- }), r.dirty())) : n.kind === "trim" ? e.data = e.data.trim() : n.kind === "includes" ? e.data.includes(n.value, n.position) || (a = this._getOrReturnCtx(e, a), h(a, {
1291
- code: c.invalid_string,
1292
- validation: { includes: n.value, position: n.position },
1293
- message: n.message
1294
- }), r.dirty()) : n.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : n.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : n.kind === "startsWith" ? e.data.startsWith(n.value) || (a = this._getOrReturnCtx(e, a), h(a, {
1295
- code: c.invalid_string,
1296
- validation: { startsWith: n.value },
1297
- message: n.message
1298
- }), r.dirty()) : n.kind === "endsWith" ? e.data.endsWith(n.value) || (a = this._getOrReturnCtx(e, a), h(a, {
1299
- code: c.invalid_string,
1300
- validation: { endsWith: n.value },
1301
- message: n.message
1302
- }), r.dirty()) : n.kind === "datetime" ? Fr(n).test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1303
- code: c.invalid_string,
1304
- validation: "datetime",
1305
- message: n.message
1306
- }), r.dirty()) : n.kind === "date" ? Lr.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1307
- code: c.invalid_string,
1308
- validation: "date",
1309
- message: n.message
1310
- }), r.dirty()) : n.kind === "time" ? Br(n).test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1311
- code: c.invalid_string,
1312
- validation: "time",
1313
- message: n.message
1314
- }), r.dirty()) : n.kind === "duration" ? Pr.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1315
- validation: "duration",
1316
- code: c.invalid_string,
1317
- message: n.message
1318
- }), r.dirty()) : n.kind === "ip" ? Qr(e.data, n.version) || (a = this._getOrReturnCtx(e, a), h(a, {
1319
- validation: "ip",
1320
- code: c.invalid_string,
1321
- message: n.message
1322
- }), r.dirty()) : n.kind === "jwt" ? Vr(e.data, n.alg) || (a = this._getOrReturnCtx(e, a), h(a, {
1323
- validation: "jwt",
1324
- code: c.invalid_string,
1325
- message: n.message
1326
- }), r.dirty()) : n.kind === "cidr" ? Ur(e.data, n.version) || (a = this._getOrReturnCtx(e, a), h(a, {
1327
- validation: "cidr",
1328
- code: c.invalid_string,
1329
- message: n.message
1330
- }), r.dirty()) : n.kind === "base64" ? zr.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1331
- validation: "base64",
1332
- code: c.invalid_string,
1333
- message: n.message
1334
- }), r.dirty()) : n.kind === "base64url" ? qr.test(e.data) || (a = this._getOrReturnCtx(e, a), h(a, {
1335
- validation: "base64url",
1336
- code: c.invalid_string,
1337
- message: n.message
1338
- }), r.dirty()) : b.assertNever(n);
1339
- return { status: r.value, value: e.data };
1340
- }
1341
- _regex(e, s, r) {
1342
- return this.refinement((a) => e.test(a), {
1343
- validation: s,
1344
- code: c.invalid_string,
1345
- ...m.errToObj(r)
1346
- });
1347
- }
1348
- _addCheck(e) {
1349
- return new q({
1350
- ...this._def,
1351
- checks: [...this._def.checks, e]
1352
- });
1353
- }
1354
- email(e) {
1355
- return this._addCheck({ kind: "email", ...m.errToObj(e) });
1356
- }
1357
- url(e) {
1358
- return this._addCheck({ kind: "url", ...m.errToObj(e) });
1359
- }
1360
- emoji(e) {
1361
- return this._addCheck({ kind: "emoji", ...m.errToObj(e) });
1362
- }
1363
- uuid(e) {
1364
- return this._addCheck({ kind: "uuid", ...m.errToObj(e) });
1365
- }
1366
- nanoid(e) {
1367
- return this._addCheck({ kind: "nanoid", ...m.errToObj(e) });
1368
- }
1369
- cuid(e) {
1370
- return this._addCheck({ kind: "cuid", ...m.errToObj(e) });
1371
- }
1372
- cuid2(e) {
1373
- return this._addCheck({ kind: "cuid2", ...m.errToObj(e) });
1374
- }
1375
- ulid(e) {
1376
- return this._addCheck({ kind: "ulid", ...m.errToObj(e) });
1377
- }
1378
- base64(e) {
1379
- return this._addCheck({ kind: "base64", ...m.errToObj(e) });
1380
- }
1381
- base64url(e) {
1382
- return this._addCheck({
1383
- kind: "base64url",
1384
- ...m.errToObj(e)
1385
- });
1386
- }
1387
- jwt(e) {
1388
- return this._addCheck({ kind: "jwt", ...m.errToObj(e) });
1389
- }
1390
- ip(e) {
1391
- return this._addCheck({ kind: "ip", ...m.errToObj(e) });
1392
- }
1393
- cidr(e) {
1394
- return this._addCheck({ kind: "cidr", ...m.errToObj(e) });
1395
- }
1396
- datetime(e) {
1397
- return typeof e == "string" ? this._addCheck({
1398
- kind: "datetime",
1399
- precision: null,
1400
- offset: !1,
1401
- local: !1,
1402
- message: e
1403
- }) : this._addCheck({
1404
- kind: "datetime",
1405
- precision: typeof e?.precision > "u" ? null : e?.precision,
1406
- offset: e?.offset ?? !1,
1407
- local: e?.local ?? !1,
1408
- ...m.errToObj(e?.message)
1409
- });
1410
- }
1411
- date(e) {
1412
- return this._addCheck({ kind: "date", message: e });
1413
- }
1414
- time(e) {
1415
- return typeof e == "string" ? this._addCheck({
1416
- kind: "time",
1417
- precision: null,
1418
- message: e
1419
- }) : this._addCheck({
1420
- kind: "time",
1421
- precision: typeof e?.precision > "u" ? null : e?.precision,
1422
- ...m.errToObj(e?.message)
1423
- });
1424
- }
1425
- duration(e) {
1426
- return this._addCheck({ kind: "duration", ...m.errToObj(e) });
1427
- }
1428
- regex(e, s) {
1429
- return this._addCheck({
1430
- kind: "regex",
1431
- regex: e,
1432
- ...m.errToObj(s)
1433
- });
1434
- }
1435
- includes(e, s) {
1436
- return this._addCheck({
1437
- kind: "includes",
1438
- value: e,
1439
- position: s?.position,
1440
- ...m.errToObj(s?.message)
1441
- });
1442
- }
1443
- startsWith(e, s) {
1444
- return this._addCheck({
1445
- kind: "startsWith",
1446
- value: e,
1447
- ...m.errToObj(s)
1448
- });
1449
- }
1450
- endsWith(e, s) {
1451
- return this._addCheck({
1452
- kind: "endsWith",
1453
- value: e,
1454
- ...m.errToObj(s)
1455
- });
1456
- }
1457
- min(e, s) {
1458
- return this._addCheck({
1459
- kind: "min",
1460
- value: e,
1461
- ...m.errToObj(s)
1462
- });
1463
- }
1464
- max(e, s) {
1465
- return this._addCheck({
1466
- kind: "max",
1467
- value: e,
1468
- ...m.errToObj(s)
1469
- });
1470
- }
1471
- length(e, s) {
1472
- return this._addCheck({
1473
- kind: "length",
1474
- value: e,
1475
- ...m.errToObj(s)
1476
- });
1477
- }
1478
- /**
1479
- * Equivalent to `.min(1)`
1480
- */
1481
- nonempty(e) {
1482
- return this.min(1, m.errToObj(e));
1483
- }
1484
- trim() {
1485
- return new q({
1486
- ...this._def,
1487
- checks: [...this._def.checks, { kind: "trim" }]
1488
- });
1489
- }
1490
- toLowerCase() {
1491
- return new q({
1492
- ...this._def,
1493
- checks: [...this._def.checks, { kind: "toLowerCase" }]
1494
- });
1495
- }
1496
- toUpperCase() {
1497
- return new q({
1498
- ...this._def,
1499
- checks: [...this._def.checks, { kind: "toUpperCase" }]
1500
- });
1501
- }
1502
- get isDatetime() {
1503
- return !!this._def.checks.find((e) => e.kind === "datetime");
1504
- }
1505
- get isDate() {
1506
- return !!this._def.checks.find((e) => e.kind === "date");
1507
- }
1508
- get isTime() {
1509
- return !!this._def.checks.find((e) => e.kind === "time");
1510
- }
1511
- get isDuration() {
1512
- return !!this._def.checks.find((e) => e.kind === "duration");
1513
- }
1514
- get isEmail() {
1515
- return !!this._def.checks.find((e) => e.kind === "email");
1516
- }
1517
- get isURL() {
1518
- return !!this._def.checks.find((e) => e.kind === "url");
1519
- }
1520
- get isEmoji() {
1521
- return !!this._def.checks.find((e) => e.kind === "emoji");
1522
- }
1523
- get isUUID() {
1524
- return !!this._def.checks.find((e) => e.kind === "uuid");
1525
- }
1526
- get isNANOID() {
1527
- return !!this._def.checks.find((e) => e.kind === "nanoid");
1528
- }
1529
- get isCUID() {
1530
- return !!this._def.checks.find((e) => e.kind === "cuid");
1531
- }
1532
- get isCUID2() {
1533
- return !!this._def.checks.find((e) => e.kind === "cuid2");
1534
- }
1535
- get isULID() {
1536
- return !!this._def.checks.find((e) => e.kind === "ulid");
1537
- }
1538
- get isIP() {
1539
- return !!this._def.checks.find((e) => e.kind === "ip");
1540
- }
1541
- get isCIDR() {
1542
- return !!this._def.checks.find((e) => e.kind === "cidr");
1543
- }
1544
- get isBase64() {
1545
- return !!this._def.checks.find((e) => e.kind === "base64");
1546
- }
1547
- get isBase64url() {
1548
- return !!this._def.checks.find((e) => e.kind === "base64url");
1549
- }
1550
- get minLength() {
1551
- let e = null;
1552
- for (const s of this._def.checks)
1553
- s.kind === "min" && (e === null || s.value > e) && (e = s.value);
1554
- return e;
1555
- }
1556
- get maxLength() {
1557
- let e = null;
1558
- for (const s of this._def.checks)
1559
- s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1560
- return e;
1561
- }
1562
- }
1563
- q.create = (t) => new q({
1564
- checks: [],
1565
- typeName: v.ZodString,
1566
- coerce: t?.coerce ?? !1,
1567
- ...x(t)
1568
- });
1569
- function Hr(t, e) {
1570
- const s = (t.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, a = s > r ? s : r, n = Number.parseInt(t.toFixed(a).replace(".", "")), o = Number.parseInt(e.toFixed(a).replace(".", ""));
1571
- return n % o / 10 ** a;
1572
- }
1573
- class te extends _ {
1574
- constructor() {
1575
- super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1576
- }
1577
- _parse(e) {
1578
- if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
1579
- const n = this._getOrReturnCtx(e);
1580
- return h(n, {
1581
- code: c.invalid_type,
1582
- expected: f.number,
1583
- received: n.parsedType
1584
- }), y;
1585
- }
1586
- let r;
1587
- const a = new A();
1588
- for (const n of this._def.checks)
1589
- n.kind === "int" ? b.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1590
- code: c.invalid_type,
1591
- expected: "integer",
1592
- received: "float",
1593
- message: n.message
1594
- }), a.dirty()) : n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), h(r, {
1595
- code: c.too_small,
1596
- minimum: n.value,
1597
- type: "number",
1598
- inclusive: n.inclusive,
1599
- exact: !1,
1600
- message: n.message
1601
- }), a.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), h(r, {
1602
- code: c.too_big,
1603
- maximum: n.value,
1604
- type: "number",
1605
- inclusive: n.inclusive,
1606
- exact: !1,
1607
- message: n.message
1608
- }), a.dirty()) : n.kind === "multipleOf" ? Hr(e.data, n.value) !== 0 && (r = this._getOrReturnCtx(e, r), h(r, {
1609
- code: c.not_multiple_of,
1610
- multipleOf: n.value,
1611
- message: n.message
1612
- }), a.dirty()) : n.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r), h(r, {
1613
- code: c.not_finite,
1614
- message: n.message
1615
- }), a.dirty()) : b.assertNever(n);
1616
- return { status: a.value, value: e.data };
1617
- }
1618
- gte(e, s) {
1619
- return this.setLimit("min", e, !0, m.toString(s));
1620
- }
1621
- gt(e, s) {
1622
- return this.setLimit("min", e, !1, m.toString(s));
1623
- }
1624
- lte(e, s) {
1625
- return this.setLimit("max", e, !0, m.toString(s));
1626
- }
1627
- lt(e, s) {
1628
- return this.setLimit("max", e, !1, m.toString(s));
1629
- }
1630
- setLimit(e, s, r, a) {
1631
- return new te({
1632
- ...this._def,
1633
- checks: [
1634
- ...this._def.checks,
1635
- {
1636
- kind: e,
1637
- value: s,
1638
- inclusive: r,
1639
- message: m.toString(a)
1640
- }
1641
- ]
1642
- });
1643
- }
1644
- _addCheck(e) {
1645
- return new te({
1646
- ...this._def,
1647
- checks: [...this._def.checks, e]
1648
- });
1649
- }
1650
- int(e) {
1651
- return this._addCheck({
1652
- kind: "int",
1653
- message: m.toString(e)
1654
- });
1655
- }
1656
- positive(e) {
1657
- return this._addCheck({
1658
- kind: "min",
1659
- value: 0,
1660
- inclusive: !1,
1661
- message: m.toString(e)
1662
- });
1663
- }
1664
- negative(e) {
1665
- return this._addCheck({
1666
- kind: "max",
1667
- value: 0,
1668
- inclusive: !1,
1669
- message: m.toString(e)
1670
- });
1671
- }
1672
- nonpositive(e) {
1673
- return this._addCheck({
1674
- kind: "max",
1675
- value: 0,
1676
- inclusive: !0,
1677
- message: m.toString(e)
1678
- });
1679
- }
1680
- nonnegative(e) {
1681
- return this._addCheck({
1682
- kind: "min",
1683
- value: 0,
1684
- inclusive: !0,
1685
- message: m.toString(e)
1686
- });
1687
- }
1688
- multipleOf(e, s) {
1689
- return this._addCheck({
1690
- kind: "multipleOf",
1691
- value: e,
1692
- message: m.toString(s)
1693
- });
1694
- }
1695
- finite(e) {
1696
- return this._addCheck({
1697
- kind: "finite",
1698
- message: m.toString(e)
1699
- });
1700
- }
1701
- safe(e) {
1702
- return this._addCheck({
1703
- kind: "min",
1704
- inclusive: !0,
1705
- value: Number.MIN_SAFE_INTEGER,
1706
- message: m.toString(e)
1707
- })._addCheck({
1708
- kind: "max",
1709
- inclusive: !0,
1710
- value: Number.MAX_SAFE_INTEGER,
1711
- message: m.toString(e)
1712
- });
1713
- }
1714
- get minValue() {
1715
- let e = null;
1716
- for (const s of this._def.checks)
1717
- s.kind === "min" && (e === null || s.value > e) && (e = s.value);
1718
- return e;
1719
- }
1720
- get maxValue() {
1721
- let e = null;
1722
- for (const s of this._def.checks)
1723
- s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1724
- return e;
1725
- }
1726
- get isInt() {
1727
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && b.isInteger(e.value));
1728
- }
1729
- get isFinite() {
1730
- let e = null, s = null;
1731
- for (const r of this._def.checks) {
1732
- if (r.kind === "finite" || r.kind === "int" || r.kind === "multipleOf")
1733
- return !0;
1734
- r.kind === "min" ? (s === null || r.value > s) && (s = r.value) : r.kind === "max" && (e === null || r.value < e) && (e = r.value);
1735
- }
1736
- return Number.isFinite(s) && Number.isFinite(e);
1737
- }
1738
- }
1739
- te.create = (t) => new te({
1740
- checks: [],
1741
- typeName: v.ZodNumber,
1742
- coerce: t?.coerce || !1,
1743
- ...x(t)
1744
- });
1745
- class se extends _ {
1746
- constructor() {
1747
- super(...arguments), this.min = this.gte, this.max = this.lte;
1748
- }
1749
- _parse(e) {
1750
- if (this._def.coerce)
1751
- try {
1752
- e.data = BigInt(e.data);
1753
- } catch {
1754
- return this._getInvalidInput(e);
1755
- }
1756
- if (this._getType(e) !== f.bigint)
1757
- return this._getInvalidInput(e);
1758
- let r;
1759
- const a = new A();
1760
- for (const n of this._def.checks)
1761
- n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (r = this._getOrReturnCtx(e, r), h(r, {
1762
- code: c.too_small,
1763
- type: "bigint",
1764
- minimum: n.value,
1765
- inclusive: n.inclusive,
1766
- message: n.message
1767
- }), a.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (r = this._getOrReturnCtx(e, r), h(r, {
1768
- code: c.too_big,
1769
- type: "bigint",
1770
- maximum: n.value,
1771
- inclusive: n.inclusive,
1772
- message: n.message
1773
- }), a.dirty()) : n.kind === "multipleOf" ? e.data % n.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r), h(r, {
1774
- code: c.not_multiple_of,
1775
- multipleOf: n.value,
1776
- message: n.message
1777
- }), a.dirty()) : b.assertNever(n);
1778
- return { status: a.value, value: e.data };
1779
- }
1780
- _getInvalidInput(e) {
1781
- const s = this._getOrReturnCtx(e);
1782
- return h(s, {
1783
- code: c.invalid_type,
1784
- expected: f.bigint,
1785
- received: s.parsedType
1786
- }), y;
1787
- }
1788
- gte(e, s) {
1789
- return this.setLimit("min", e, !0, m.toString(s));
1790
- }
1791
- gt(e, s) {
1792
- return this.setLimit("min", e, !1, m.toString(s));
1793
- }
1794
- lte(e, s) {
1795
- return this.setLimit("max", e, !0, m.toString(s));
1796
- }
1797
- lt(e, s) {
1798
- return this.setLimit("max", e, !1, m.toString(s));
1799
- }
1800
- setLimit(e, s, r, a) {
1801
- return new se({
1802
- ...this._def,
1803
- checks: [
1804
- ...this._def.checks,
1805
- {
1806
- kind: e,
1807
- value: s,
1808
- inclusive: r,
1809
- message: m.toString(a)
1810
- }
1811
- ]
1812
- });
1813
- }
1814
- _addCheck(e) {
1815
- return new se({
1816
- ...this._def,
1817
- checks: [...this._def.checks, e]
1818
- });
1819
- }
1820
- positive(e) {
1821
- return this._addCheck({
1822
- kind: "min",
1823
- value: BigInt(0),
1824
- inclusive: !1,
1825
- message: m.toString(e)
1826
- });
1827
- }
1828
- negative(e) {
1829
- return this._addCheck({
1830
- kind: "max",
1831
- value: BigInt(0),
1832
- inclusive: !1,
1833
- message: m.toString(e)
1834
- });
1835
- }
1836
- nonpositive(e) {
1837
- return this._addCheck({
1838
- kind: "max",
1839
- value: BigInt(0),
1840
- inclusive: !0,
1841
- message: m.toString(e)
1842
- });
1843
- }
1844
- nonnegative(e) {
1845
- return this._addCheck({
1846
- kind: "min",
1847
- value: BigInt(0),
1848
- inclusive: !0,
1849
- message: m.toString(e)
1850
- });
1851
- }
1852
- multipleOf(e, s) {
1853
- return this._addCheck({
1854
- kind: "multipleOf",
1855
- value: e,
1856
- message: m.toString(s)
1857
- });
1858
- }
1859
- get minValue() {
1860
- let e = null;
1861
- for (const s of this._def.checks)
1862
- s.kind === "min" && (e === null || s.value > e) && (e = s.value);
1863
- return e;
1864
- }
1865
- get maxValue() {
1866
- let e = null;
1867
- for (const s of this._def.checks)
1868
- s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1869
- return e;
1870
- }
1871
- }
1872
- se.create = (t) => new se({
1873
- checks: [],
1874
- typeName: v.ZodBigInt,
1875
- coerce: t?.coerce ?? !1,
1876
- ...x(t)
1877
- });
1878
- class Je extends _ {
1879
- _parse(e) {
1880
- if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1881
- const r = this._getOrReturnCtx(e);
1882
- return h(r, {
1883
- code: c.invalid_type,
1884
- expected: f.boolean,
1885
- received: r.parsedType
1886
- }), y;
1887
- }
1888
- return E(e.data);
1889
- }
1890
- }
1891
- Je.create = (t) => new Je({
1892
- typeName: v.ZodBoolean,
1893
- coerce: t?.coerce || !1,
1894
- ...x(t)
1895
- });
1896
- class ce extends _ {
1897
- _parse(e) {
1898
- if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1899
- const n = this._getOrReturnCtx(e);
1900
- return h(n, {
1901
- code: c.invalid_type,
1902
- expected: f.date,
1903
- received: n.parsedType
1904
- }), y;
1905
- }
1906
- if (Number.isNaN(e.data.getTime())) {
1907
- const n = this._getOrReturnCtx(e);
1908
- return h(n, {
1909
- code: c.invalid_date
1910
- }), y;
1911
- }
1912
- const r = new A();
1913
- let a;
1914
- for (const n of this._def.checks)
1915
- n.kind === "min" ? e.data.getTime() < n.value && (a = this._getOrReturnCtx(e, a), h(a, {
1916
- code: c.too_small,
1917
- message: n.message,
1918
- inclusive: !0,
1919
- exact: !1,
1920
- minimum: n.value,
1921
- type: "date"
1922
- }), r.dirty()) : n.kind === "max" ? e.data.getTime() > n.value && (a = this._getOrReturnCtx(e, a), h(a, {
1923
- code: c.too_big,
1924
- message: n.message,
1925
- inclusive: !0,
1926
- exact: !1,
1927
- maximum: n.value,
1928
- type: "date"
1929
- }), r.dirty()) : b.assertNever(n);
1930
- return {
1931
- status: r.value,
1932
- value: new Date(e.data.getTime())
1933
- };
1934
- }
1935
- _addCheck(e) {
1936
- return new ce({
1937
- ...this._def,
1938
- checks: [...this._def.checks, e]
1939
- });
1940
- }
1941
- min(e, s) {
1942
- return this._addCheck({
1943
- kind: "min",
1944
- value: e.getTime(),
1945
- message: m.toString(s)
1946
- });
1947
- }
1948
- max(e, s) {
1949
- return this._addCheck({
1950
- kind: "max",
1951
- value: e.getTime(),
1952
- message: m.toString(s)
1953
- });
1954
- }
1955
- get minDate() {
1956
- let e = null;
1957
- for (const s of this._def.checks)
1958
- s.kind === "min" && (e === null || s.value > e) && (e = s.value);
1959
- return e != null ? new Date(e) : null;
1960
- }
1961
- get maxDate() {
1962
- let e = null;
1963
- for (const s of this._def.checks)
1964
- s.kind === "max" && (e === null || s.value < e) && (e = s.value);
1965
- return e != null ? new Date(e) : null;
1966
- }
1967
- }
1968
- ce.create = (t) => new ce({
1969
- checks: [],
1970
- coerce: t?.coerce || !1,
1971
- typeName: v.ZodDate,
1972
- ...x(t)
1973
- });
1974
- class Xe extends _ {
1975
- _parse(e) {
1976
- if (this._getType(e) !== f.symbol) {
1977
- const r = this._getOrReturnCtx(e);
1978
- return h(r, {
1979
- code: c.invalid_type,
1980
- expected: f.symbol,
1981
- received: r.parsedType
1982
- }), y;
1983
- }
1984
- return E(e.data);
1985
- }
1986
- }
1987
- Xe.create = (t) => new Xe({
1988
- typeName: v.ZodSymbol,
1989
- ...x(t)
1990
- });
1991
- class et extends _ {
1992
- _parse(e) {
1993
- if (this._getType(e) !== f.undefined) {
1994
- const r = this._getOrReturnCtx(e);
1995
- return h(r, {
1996
- code: c.invalid_type,
1997
- expected: f.undefined,
1998
- received: r.parsedType
1999
- }), y;
2000
- }
2001
- return E(e.data);
2002
- }
2003
- }
2004
- et.create = (t) => new et({
2005
- typeName: v.ZodUndefined,
2006
- ...x(t)
2007
- });
2008
- class tt extends _ {
2009
- _parse(e) {
2010
- if (this._getType(e) !== f.null) {
2011
- const r = this._getOrReturnCtx(e);
2012
- return h(r, {
2013
- code: c.invalid_type,
2014
- expected: f.null,
2015
- received: r.parsedType
2016
- }), y;
2017
- }
2018
- return E(e.data);
2019
- }
2020
- }
2021
- tt.create = (t) => new tt({
2022
- typeName: v.ZodNull,
2023
- ...x(t)
2024
- });
2025
- class st extends _ {
2026
- constructor() {
2027
- super(...arguments), this._any = !0;
2028
- }
2029
- _parse(e) {
2030
- return E(e.data);
2031
- }
2032
- }
2033
- st.create = (t) => new st({
2034
- typeName: v.ZodAny,
2035
- ...x(t)
2036
- });
2037
- class rt extends _ {
2038
- constructor() {
2039
- super(...arguments), this._unknown = !0;
2040
- }
2041
- _parse(e) {
2042
- return E(e.data);
2043
- }
2044
- }
2045
- rt.create = (t) => new rt({
2046
- typeName: v.ZodUnknown,
2047
- ...x(t)
2048
- });
2049
- class F extends _ {
2050
- _parse(e) {
2051
- const s = this._getOrReturnCtx(e);
2052
- return h(s, {
2053
- code: c.invalid_type,
2054
- expected: f.never,
2055
- received: s.parsedType
2056
- }), y;
2057
- }
2058
- }
2059
- F.create = (t) => new F({
2060
- typeName: v.ZodNever,
2061
- ...x(t)
2062
- });
2063
- class at extends _ {
2064
- _parse(e) {
2065
- if (this._getType(e) !== f.undefined) {
2066
- const r = this._getOrReturnCtx(e);
2067
- return h(r, {
2068
- code: c.invalid_type,
2069
- expected: f.void,
2070
- received: r.parsedType
2071
- }), y;
2072
- }
2073
- return E(e.data);
2074
- }
2075
- }
2076
- at.create = (t) => new at({
2077
- typeName: v.ZodVoid,
2078
- ...x(t)
2079
- });
2080
- class R extends _ {
2081
- _parse(e) {
2082
- const { ctx: s, status: r } = this._processInputParams(e), a = this._def;
2083
- if (s.parsedType !== f.array)
2084
- return h(s, {
2085
- code: c.invalid_type,
2086
- expected: f.array,
2087
- received: s.parsedType
2088
- }), y;
2089
- if (a.exactLength !== null) {
2090
- const o = s.data.length > a.exactLength.value, d = s.data.length < a.exactLength.value;
2091
- (o || d) && (h(s, {
2092
- code: o ? c.too_big : c.too_small,
2093
- minimum: d ? a.exactLength.value : void 0,
2094
- maximum: o ? a.exactLength.value : void 0,
2095
- type: "array",
2096
- inclusive: !0,
2097
- exact: !0,
2098
- message: a.exactLength.message
2099
- }), r.dirty());
2100
- }
2101
- if (a.minLength !== null && s.data.length < a.minLength.value && (h(s, {
2102
- code: c.too_small,
2103
- minimum: a.minLength.value,
2104
- type: "array",
2105
- inclusive: !0,
2106
- exact: !1,
2107
- message: a.minLength.message
2108
- }), r.dirty()), a.maxLength !== null && s.data.length > a.maxLength.value && (h(s, {
2109
- code: c.too_big,
2110
- maximum: a.maxLength.value,
2111
- type: "array",
2112
- inclusive: !0,
2113
- exact: !1,
2114
- message: a.maxLength.message
2115
- }), r.dirty()), s.common.async)
2116
- return Promise.all([...s.data].map((o, d) => a.type._parseAsync(new B(s, o, s.path, d)))).then((o) => A.mergeArray(r, o));
2117
- const n = [...s.data].map((o, d) => a.type._parseSync(new B(s, o, s.path, d)));
2118
- return A.mergeArray(r, n);
2119
- }
2120
- get element() {
2121
- return this._def.type;
2122
- }
2123
- min(e, s) {
2124
- return new R({
2125
- ...this._def,
2126
- minLength: { value: e, message: m.toString(s) }
2127
- });
2128
- }
2129
- max(e, s) {
2130
- return new R({
2131
- ...this._def,
2132
- maxLength: { value: e, message: m.toString(s) }
2133
- });
2134
- }
2135
- length(e, s) {
2136
- return new R({
2137
- ...this._def,
2138
- exactLength: { value: e, message: m.toString(s) }
2139
- });
2140
- }
2141
- nonempty(e) {
2142
- return this.min(1, e);
2143
- }
2144
- }
2145
- R.create = (t, e) => new R({
2146
- type: t,
2147
- minLength: null,
2148
- maxLength: null,
2149
- exactLength: null,
2150
- typeName: v.ZodArray,
2151
- ...x(e)
2152
- });
2153
- function U(t) {
2154
- if (t instanceof w) {
2155
- const e = {};
2156
- for (const s in t.shape) {
2157
- const r = t.shape[s];
2158
- e[s] = L.create(U(r));
2159
- }
2160
- return new w({
2161
- ...t._def,
2162
- shape: () => e
2163
- });
2164
- } else return t instanceof R ? new R({
2165
- ...t._def,
2166
- type: U(t.element)
2167
- }) : t instanceof L ? L.create(U(t.unwrap())) : t instanceof G ? G.create(U(t.unwrap())) : t instanceof Q ? Q.create(t.items.map((e) => U(e))) : t;
2168
- }
2169
- class w extends _ {
2170
- constructor() {
2171
- super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
2172
- }
2173
- _getCached() {
2174
- if (this._cached !== null)
2175
- return this._cached;
2176
- const e = this._def.shape(), s = b.objectKeys(e);
2177
- return this._cached = { shape: e, keys: s }, this._cached;
2178
- }
2179
- _parse(e) {
2180
- if (this._getType(e) !== f.object) {
2181
- const l = this._getOrReturnCtx(e);
2182
- return h(l, {
2183
- code: c.invalid_type,
2184
- expected: f.object,
2185
- received: l.parsedType
2186
- }), y;
2187
- }
2188
- const { status: r, ctx: a } = this._processInputParams(e), { shape: n, keys: o } = this._getCached(), d = [];
2189
- if (!(this._def.catchall instanceof F && this._def.unknownKeys === "strip"))
2190
- for (const l in a.data)
2191
- o.includes(l) || d.push(l);
2192
- const u = [];
2193
- for (const l of o) {
2194
- const g = n[l], j = a.data[l];
2195
- u.push({
2196
- key: { status: "valid", value: l },
2197
- value: g._parse(new B(a, j, a.path, l)),
2198
- alwaysSet: l in a.data
2199
- });
2200
- }
2201
- if (this._def.catchall instanceof F) {
2202
- const l = this._def.unknownKeys;
2203
- if (l === "passthrough")
2204
- for (const g of d)
2205
- u.push({
2206
- key: { status: "valid", value: g },
2207
- value: { status: "valid", value: a.data[g] }
2208
- });
2209
- else if (l === "strict")
2210
- d.length > 0 && (h(a, {
2211
- code: c.unrecognized_keys,
2212
- keys: d
2213
- }), r.dirty());
2214
- else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
2215
- } else {
2216
- const l = this._def.catchall;
2217
- for (const g of d) {
2218
- const j = a.data[g];
2219
- u.push({
2220
- key: { status: "valid", value: g },
2221
- value: l._parse(
2222
- new B(a, j, a.path, g)
2223
- //, ctx.child(key), value, getParsedType(value)
2224
- ),
2225
- alwaysSet: g in a.data
2226
- });
2227
- }
2228
- }
2229
- return a.common.async ? Promise.resolve().then(async () => {
2230
- const l = [];
2231
- for (const g of u) {
2232
- const j = await g.key, k = await g.value;
2233
- l.push({
2234
- key: j,
2235
- value: k,
2236
- alwaysSet: g.alwaysSet
2237
- });
2238
- }
2239
- return l;
2240
- }).then((l) => A.mergeObjectSync(r, l)) : A.mergeObjectSync(r, u);
2241
- }
2242
- get shape() {
2243
- return this._def.shape();
2244
- }
2245
- strict(e) {
2246
- return m.errToObj, new w({
2247
- ...this._def,
2248
- unknownKeys: "strict",
2249
- ...e !== void 0 ? {
2250
- errorMap: (s, r) => {
2251
- const a = this._def.errorMap?.(s, r).message ?? r.defaultError;
2252
- return s.code === "unrecognized_keys" ? {
2253
- message: m.errToObj(e).message ?? a
2254
- } : {
2255
- message: a
2256
- };
2257
- }
2258
- } : {}
2259
- });
2260
- }
2261
- strip() {
2262
- return new w({
2263
- ...this._def,
2264
- unknownKeys: "strip"
2265
- });
2266
- }
2267
- passthrough() {
2268
- return new w({
2269
- ...this._def,
2270
- unknownKeys: "passthrough"
2271
- });
2272
- }
2273
- // const AugmentFactory =
2274
- // <Def extends ZodObjectDef>(def: Def) =>
2275
- // <Augmentation extends ZodRawShape>(
2276
- // augmentation: Augmentation
2277
- // ): ZodObject<
2278
- // extendShape<ReturnType<Def["shape"]>, Augmentation>,
2279
- // Def["unknownKeys"],
2280
- // Def["catchall"]
2281
- // > => {
2282
- // return new ZodObject({
2283
- // ...def,
2284
- // shape: () => ({
2285
- // ...def.shape(),
2286
- // ...augmentation,
2287
- // }),
2288
- // }) as any;
2289
- // };
2290
- extend(e) {
2291
- return new w({
2292
- ...this._def,
2293
- shape: () => ({
2294
- ...this._def.shape(),
2295
- ...e
2296
- })
2297
- });
2298
- }
2299
- /**
2300
- * Prior to zod@1.0.12 there was a bug in the
2301
- * inferred type of merged objects. Please
2302
- * upgrade if you are experiencing issues.
2303
- */
2304
- merge(e) {
2305
- return new w({
2306
- unknownKeys: e._def.unknownKeys,
2307
- catchall: e._def.catchall,
2308
- shape: () => ({
2309
- ...this._def.shape(),
2310
- ...e._def.shape()
2311
- }),
2312
- typeName: v.ZodObject
2313
- });
2314
- }
2315
- // merge<
2316
- // Incoming extends AnyZodObject,
2317
- // Augmentation extends Incoming["shape"],
2318
- // NewOutput extends {
2319
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
2320
- // ? Augmentation[k]["_output"]
2321
- // : k extends keyof Output
2322
- // ? Output[k]
2323
- // : never;
2324
- // },
2325
- // NewInput extends {
2326
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
2327
- // ? Augmentation[k]["_input"]
2328
- // : k extends keyof Input
2329
- // ? Input[k]
2330
- // : never;
2331
- // }
2332
- // >(
2333
- // merging: Incoming
2334
- // ): ZodObject<
2335
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2336
- // Incoming["_def"]["unknownKeys"],
2337
- // Incoming["_def"]["catchall"],
2338
- // NewOutput,
2339
- // NewInput
2340
- // > {
2341
- // const merged: any = new ZodObject({
2342
- // unknownKeys: merging._def.unknownKeys,
2343
- // catchall: merging._def.catchall,
2344
- // shape: () =>
2345
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2346
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2347
- // }) as any;
2348
- // return merged;
2349
- // }
2350
- setKey(e, s) {
2351
- return this.augment({ [e]: s });
2352
- }
2353
- // merge<Incoming extends AnyZodObject>(
2354
- // merging: Incoming
2355
- // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
2356
- // ZodObject<
2357
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2358
- // Incoming["_def"]["unknownKeys"],
2359
- // Incoming["_def"]["catchall"]
2360
- // > {
2361
- // // const mergedShape = objectUtil.mergeShapes(
2362
- // // this._def.shape(),
2363
- // // merging._def.shape()
2364
- // // );
2365
- // const merged: any = new ZodObject({
2366
- // unknownKeys: merging._def.unknownKeys,
2367
- // catchall: merging._def.catchall,
2368
- // shape: () =>
2369
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2370
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2371
- // }) as any;
2372
- // return merged;
2373
- // }
2374
- catchall(e) {
2375
- return new w({
2376
- ...this._def,
2377
- catchall: e
2378
- });
2379
- }
2380
- pick(e) {
2381
- const s = {};
2382
- for (const r of b.objectKeys(e))
2383
- e[r] && this.shape[r] && (s[r] = this.shape[r]);
2384
- return new w({
2385
- ...this._def,
2386
- shape: () => s
2387
- });
2388
- }
2389
- omit(e) {
2390
- const s = {};
2391
- for (const r of b.objectKeys(this.shape))
2392
- e[r] || (s[r] = this.shape[r]);
2393
- return new w({
2394
- ...this._def,
2395
- shape: () => s
2396
- });
2397
- }
2398
- /**
2399
- * @deprecated
2400
- */
2401
- deepPartial() {
2402
- return U(this);
2403
- }
2404
- partial(e) {
2405
- const s = {};
2406
- for (const r of b.objectKeys(this.shape)) {
2407
- const a = this.shape[r];
2408
- e && !e[r] ? s[r] = a : s[r] = a.optional();
2409
- }
2410
- return new w({
2411
- ...this._def,
2412
- shape: () => s
2413
- });
2414
- }
2415
- required(e) {
2416
- const s = {};
2417
- for (const r of b.objectKeys(this.shape))
2418
- if (e && !e[r])
2419
- s[r] = this.shape[r];
2420
- else {
2421
- let n = this.shape[r];
2422
- for (; n instanceof L; )
2423
- n = n._def.innerType;
2424
- s[r] = n;
2425
- }
2426
- return new w({
2427
- ...this._def,
2428
- shape: () => s
2429
- });
2430
- }
2431
- keyof() {
2432
- return Rt(b.objectKeys(this.shape));
2433
- }
2434
- }
2435
- w.create = (t, e) => new w({
2436
- shape: () => t,
2437
- unknownKeys: "strip",
2438
- catchall: F.create(),
2439
- typeName: v.ZodObject,
2440
- ...x(e)
2441
- });
2442
- w.strictCreate = (t, e) => new w({
2443
- shape: () => t,
2444
- unknownKeys: "strict",
2445
- catchall: F.create(),
2446
- typeName: v.ZodObject,
2447
- ...x(e)
2448
- });
2449
- w.lazycreate = (t, e) => new w({
2450
- shape: t,
2451
- unknownKeys: "strip",
2452
- catchall: F.create(),
2453
- typeName: v.ZodObject,
2454
- ...x(e)
2455
- });
2456
- class le extends _ {
2457
- _parse(e) {
2458
- const { ctx: s } = this._processInputParams(e), r = this._def.options;
2459
- function a(n) {
2460
- for (const d of n)
2461
- if (d.result.status === "valid")
2462
- return d.result;
2463
- for (const d of n)
2464
- if (d.result.status === "dirty")
2465
- return s.common.issues.push(...d.ctx.common.issues), d.result;
2466
- const o = n.map((d) => new $(d.ctx.common.issues));
2467
- return h(s, {
2468
- code: c.invalid_union,
2469
- unionErrors: o
2470
- }), y;
2471
- }
2472
- if (s.common.async)
2473
- return Promise.all(r.map(async (n) => {
2474
- const o = {
2475
- ...s,
2476
- common: {
2477
- ...s.common,
2478
- issues: []
2479
- },
2480
- parent: null
2481
- };
2482
- return {
2483
- result: await n._parseAsync({
2484
- data: s.data,
2485
- path: s.path,
2486
- parent: o
2487
- }),
2488
- ctx: o
2489
- };
2490
- })).then(a);
2491
- {
2492
- let n;
2493
- const o = [];
2494
- for (const u of r) {
2495
- const l = {
2496
- ...s,
2497
- common: {
2498
- ...s.common,
2499
- issues: []
2500
- },
2501
- parent: null
2502
- }, g = u._parseSync({
2503
- data: s.data,
2504
- path: s.path,
2505
- parent: l
2506
- });
2507
- if (g.status === "valid")
2508
- return g;
2509
- g.status === "dirty" && !n && (n = { result: g, ctx: l }), l.common.issues.length && o.push(l.common.issues);
2510
- }
2511
- if (n)
2512
- return s.common.issues.push(...n.ctx.common.issues), n.result;
2513
- const d = o.map((u) => new $(u));
2514
- return h(s, {
2515
- code: c.invalid_union,
2516
- unionErrors: d
2517
- }), y;
2518
- }
2519
- }
2520
- get options() {
2521
- return this._def.options;
2522
- }
2523
- }
2524
- le.create = (t, e) => new le({
2525
- options: t,
2526
- typeName: v.ZodUnion,
2527
- ...x(e)
2528
- });
2529
- function we(t, e) {
2530
- const s = z(t), r = z(e);
2531
- if (t === e)
2532
- return { valid: !0, data: t };
2533
- if (s === f.object && r === f.object) {
2534
- const a = b.objectKeys(e), n = b.objectKeys(t).filter((d) => a.indexOf(d) !== -1), o = { ...t, ...e };
2535
- for (const d of n) {
2536
- const u = we(t[d], e[d]);
2537
- if (!u.valid)
2538
- return { valid: !1 };
2539
- o[d] = u.data;
2540
- }
2541
- return { valid: !0, data: o };
2542
- } else if (s === f.array && r === f.array) {
2543
- if (t.length !== e.length)
2544
- return { valid: !1 };
2545
- const a = [];
2546
- for (let n = 0; n < t.length; n++) {
2547
- const o = t[n], d = e[n], u = we(o, d);
2548
- if (!u.valid)
2549
- return { valid: !1 };
2550
- a.push(u.data);
2551
- }
2552
- return { valid: !0, data: a };
2553
- } else return s === f.date && r === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
2554
- }
2555
- class ue extends _ {
2556
- _parse(e) {
2557
- const { status: s, ctx: r } = this._processInputParams(e), a = (n, o) => {
2558
- if (Ke(n) || Ke(o))
2559
- return y;
2560
- const d = we(n.value, o.value);
2561
- return d.valid ? ((Ye(n) || Ye(o)) && s.dirty(), { status: s.value, value: d.data }) : (h(r, {
2562
- code: c.invalid_intersection_types
2563
- }), y);
2564
- };
2565
- return r.common.async ? Promise.all([
2566
- this._def.left._parseAsync({
2567
- data: r.data,
2568
- path: r.path,
2569
- parent: r
2570
- }),
2571
- this._def.right._parseAsync({
2572
- data: r.data,
2573
- path: r.path,
2574
- parent: r
2575
- })
2576
- ]).then(([n, o]) => a(n, o)) : a(this._def.left._parseSync({
2577
- data: r.data,
2578
- path: r.path,
2579
- parent: r
2580
- }), this._def.right._parseSync({
2581
- data: r.data,
2582
- path: r.path,
2583
- parent: r
2584
- }));
2585
- }
2586
- }
2587
- ue.create = (t, e, s) => new ue({
2588
- left: t,
2589
- right: e,
2590
- typeName: v.ZodIntersection,
2591
- ...x(s)
2592
- });
2593
- class Q extends _ {
2594
- _parse(e) {
2595
- const { status: s, ctx: r } = this._processInputParams(e);
2596
- if (r.parsedType !== f.array)
2597
- return h(r, {
2598
- code: c.invalid_type,
2599
- expected: f.array,
2600
- received: r.parsedType
2601
- }), y;
2602
- if (r.data.length < this._def.items.length)
2603
- return h(r, {
2604
- code: c.too_small,
2605
- minimum: this._def.items.length,
2606
- inclusive: !0,
2607
- exact: !1,
2608
- type: "array"
2609
- }), y;
2610
- !this._def.rest && r.data.length > this._def.items.length && (h(r, {
2611
- code: c.too_big,
2612
- maximum: this._def.items.length,
2613
- inclusive: !0,
2614
- exact: !1,
2615
- type: "array"
2616
- }), s.dirty());
2617
- const n = [...r.data].map((o, d) => {
2618
- const u = this._def.items[d] || this._def.rest;
2619
- return u ? u._parse(new B(r, o, r.path, d)) : null;
2620
- }).filter((o) => !!o);
2621
- return r.common.async ? Promise.all(n).then((o) => A.mergeArray(s, o)) : A.mergeArray(s, n);
2622
- }
2623
- get items() {
2624
- return this._def.items;
2625
- }
2626
- rest(e) {
2627
- return new Q({
2628
- ...this._def,
2629
- rest: e
2630
- });
2631
- }
2632
- }
2633
- Q.create = (t, e) => {
2634
- if (!Array.isArray(t))
2635
- throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2636
- return new Q({
2637
- items: t,
2638
- typeName: v.ZodTuple,
2639
- rest: null,
2640
- ...x(e)
2641
- });
2642
- };
2643
- class nt extends _ {
2644
- get keySchema() {
2645
- return this._def.keyType;
2646
- }
2647
- get valueSchema() {
2648
- return this._def.valueType;
2649
- }
2650
- _parse(e) {
2651
- const { status: s, ctx: r } = this._processInputParams(e);
2652
- if (r.parsedType !== f.map)
2653
- return h(r, {
2654
- code: c.invalid_type,
2655
- expected: f.map,
2656
- received: r.parsedType
2657
- }), y;
2658
- const a = this._def.keyType, n = this._def.valueType, o = [...r.data.entries()].map(([d, u], l) => ({
2659
- key: a._parse(new B(r, d, r.path, [l, "key"])),
2660
- value: n._parse(new B(r, u, r.path, [l, "value"]))
2661
- }));
2662
- if (r.common.async) {
2663
- const d = /* @__PURE__ */ new Map();
2664
- return Promise.resolve().then(async () => {
2665
- for (const u of o) {
2666
- const l = await u.key, g = await u.value;
2667
- if (l.status === "aborted" || g.status === "aborted")
2668
- return y;
2669
- (l.status === "dirty" || g.status === "dirty") && s.dirty(), d.set(l.value, g.value);
2670
- }
2671
- return { status: s.value, value: d };
2672
- });
2673
- } else {
2674
- const d = /* @__PURE__ */ new Map();
2675
- for (const u of o) {
2676
- const l = u.key, g = u.value;
2677
- if (l.status === "aborted" || g.status === "aborted")
2678
- return y;
2679
- (l.status === "dirty" || g.status === "dirty") && s.dirty(), d.set(l.value, g.value);
2680
- }
2681
- return { status: s.value, value: d };
2682
- }
2683
- }
2684
- }
2685
- nt.create = (t, e, s) => new nt({
2686
- valueType: e,
2687
- keyType: t,
2688
- typeName: v.ZodMap,
2689
- ...x(s)
2690
- });
2691
- class re extends _ {
2692
- _parse(e) {
2693
- const { status: s, ctx: r } = this._processInputParams(e);
2694
- if (r.parsedType !== f.set)
2695
- return h(r, {
2696
- code: c.invalid_type,
2697
- expected: f.set,
2698
- received: r.parsedType
2699
- }), y;
2700
- const a = this._def;
2701
- a.minSize !== null && r.data.size < a.minSize.value && (h(r, {
2702
- code: c.too_small,
2703
- minimum: a.minSize.value,
2704
- type: "set",
2705
- inclusive: !0,
2706
- exact: !1,
2707
- message: a.minSize.message
2708
- }), s.dirty()), a.maxSize !== null && r.data.size > a.maxSize.value && (h(r, {
2709
- code: c.too_big,
2710
- maximum: a.maxSize.value,
2711
- type: "set",
2712
- inclusive: !0,
2713
- exact: !1,
2714
- message: a.maxSize.message
2715
- }), s.dirty());
2716
- const n = this._def.valueType;
2717
- function o(u) {
2718
- const l = /* @__PURE__ */ new Set();
2719
- for (const g of u) {
2720
- if (g.status === "aborted")
2721
- return y;
2722
- g.status === "dirty" && s.dirty(), l.add(g.value);
2723
- }
2724
- return { status: s.value, value: l };
2725
- }
2726
- const d = [...r.data.values()].map((u, l) => n._parse(new B(r, u, r.path, l)));
2727
- return r.common.async ? Promise.all(d).then((u) => o(u)) : o(d);
2728
- }
2729
- min(e, s) {
2730
- return new re({
2731
- ...this._def,
2732
- minSize: { value: e, message: m.toString(s) }
2733
- });
2734
- }
2735
- max(e, s) {
2736
- return new re({
2737
- ...this._def,
2738
- maxSize: { value: e, message: m.toString(s) }
2739
- });
2740
- }
2741
- size(e, s) {
2742
- return this.min(e, s).max(e, s);
2743
- }
2744
- nonempty(e) {
2745
- return this.min(1, e);
2746
- }
2747
- }
2748
- re.create = (t, e) => new re({
2749
- valueType: t,
2750
- minSize: null,
2751
- maxSize: null,
2752
- typeName: v.ZodSet,
2753
- ...x(e)
2754
- });
2755
- class it extends _ {
2756
- get schema() {
2757
- return this._def.getter();
2758
- }
2759
- _parse(e) {
2760
- const { ctx: s } = this._processInputParams(e);
2761
- return this._def.getter()._parse({ data: s.data, path: s.path, parent: s });
2762
- }
2763
- }
2764
- it.create = (t, e) => new it({
2765
- getter: t,
2766
- typeName: v.ZodLazy,
2767
- ...x(e)
2768
- });
2769
- class ot extends _ {
2770
- _parse(e) {
2771
- if (e.data !== this._def.value) {
2772
- const s = this._getOrReturnCtx(e);
2773
- return h(s, {
2774
- received: s.data,
2775
- code: c.invalid_literal,
2776
- expected: this._def.value
2777
- }), y;
2778
- }
2779
- return { status: "valid", value: e.data };
2780
- }
2781
- get value() {
2782
- return this._def.value;
2783
- }
2784
- }
2785
- ot.create = (t, e) => new ot({
2786
- value: t,
2787
- typeName: v.ZodLiteral,
2788
- ...x(e)
2789
- });
2790
- function Rt(t, e) {
2791
- return new K({
2792
- values: t,
2793
- typeName: v.ZodEnum,
2794
- ...x(e)
2795
- });
2796
- }
2797
- class K extends _ {
2798
- _parse(e) {
2799
- if (typeof e.data != "string") {
2800
- const s = this._getOrReturnCtx(e), r = this._def.values;
2801
- return h(s, {
2802
- expected: b.joinValues(r),
2803
- received: s.parsedType,
2804
- code: c.invalid_type
2805
- }), y;
2806
- }
2807
- if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
2808
- const s = this._getOrReturnCtx(e), r = this._def.values;
2809
- return h(s, {
2810
- received: s.data,
2811
- code: c.invalid_enum_value,
2812
- options: r
2813
- }), y;
2814
- }
2815
- return E(e.data);
2816
- }
2817
- get options() {
2818
- return this._def.values;
2819
- }
2820
- get enum() {
2821
- const e = {};
2822
- for (const s of this._def.values)
2823
- e[s] = s;
2824
- return e;
2825
- }
2826
- get Values() {
2827
- const e = {};
2828
- for (const s of this._def.values)
2829
- e[s] = s;
2830
- return e;
2831
- }
2832
- get Enum() {
2833
- const e = {};
2834
- for (const s of this._def.values)
2835
- e[s] = s;
2836
- return e;
2837
- }
2838
- extract(e, s = this._def) {
2839
- return K.create(e, {
2840
- ...this._def,
2841
- ...s
2842
- });
2843
- }
2844
- exclude(e, s = this._def) {
2845
- return K.create(this.options.filter((r) => !e.includes(r)), {
2846
- ...this._def,
2847
- ...s
2848
- });
2849
- }
2850
- }
2851
- K.create = Rt;
2852
- class dt extends _ {
2853
- _parse(e) {
2854
- const s = b.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
2855
- if (r.parsedType !== f.string && r.parsedType !== f.number) {
2856
- const a = b.objectValues(s);
2857
- return h(r, {
2858
- expected: b.joinValues(a),
2859
- received: r.parsedType,
2860
- code: c.invalid_type
2861
- }), y;
2862
- }
2863
- if (this._cache || (this._cache = new Set(b.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2864
- const a = b.objectValues(s);
2865
- return h(r, {
2866
- received: r.data,
2867
- code: c.invalid_enum_value,
2868
- options: a
2869
- }), y;
2870
- }
2871
- return E(e.data);
2872
- }
2873
- get enum() {
2874
- return this._def.values;
2875
- }
2876
- }
2877
- dt.create = (t, e) => new dt({
2878
- values: t,
2879
- typeName: v.ZodNativeEnum,
2880
- ...x(e)
2881
- });
2882
- class he extends _ {
2883
- unwrap() {
2884
- return this._def.type;
2885
- }
2886
- _parse(e) {
2887
- const { ctx: s } = this._processInputParams(e);
2888
- if (s.parsedType !== f.promise && s.common.async === !1)
2889
- return h(s, {
2890
- code: c.invalid_type,
2891
- expected: f.promise,
2892
- received: s.parsedType
2893
- }), y;
2894
- const r = s.parsedType === f.promise ? s.data : Promise.resolve(s.data);
2895
- return E(r.then((a) => this._def.type.parseAsync(a, {
2896
- path: s.path,
2897
- errorMap: s.common.contextualErrorMap
2898
- })));
2899
- }
2900
- }
2901
- he.create = (t, e) => new he({
2902
- type: t,
2903
- typeName: v.ZodPromise,
2904
- ...x(e)
2905
- });
2906
- class Y extends _ {
2907
- innerType() {
2908
- return this._def.schema;
2909
- }
2910
- sourceType() {
2911
- return this._def.schema._def.typeName === v.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2912
- }
2913
- _parse(e) {
2914
- const { status: s, ctx: r } = this._processInputParams(e), a = this._def.effect || null, n = {
2915
- addIssue: (o) => {
2916
- h(r, o), o.fatal ? s.abort() : s.dirty();
2917
- },
2918
- get path() {
2919
- return r.path;
2920
- }
2921
- };
2922
- if (n.addIssue = n.addIssue.bind(n), a.type === "preprocess") {
2923
- const o = a.transform(r.data, n);
2924
- if (r.common.async)
2925
- return Promise.resolve(o).then(async (d) => {
2926
- if (s.value === "aborted")
2927
- return y;
2928
- const u = await this._def.schema._parseAsync({
2929
- data: d,
2930
- path: r.path,
2931
- parent: r
2932
- });
2933
- return u.status === "aborted" ? y : u.status === "dirty" || s.value === "dirty" ? X(u.value) : u;
2934
- });
2935
- {
2936
- if (s.value === "aborted")
2937
- return y;
2938
- const d = this._def.schema._parseSync({
2939
- data: o,
2940
- path: r.path,
2941
- parent: r
2942
- });
2943
- return d.status === "aborted" ? y : d.status === "dirty" || s.value === "dirty" ? X(d.value) : d;
2944
- }
2945
- }
2946
- if (a.type === "refinement") {
2947
- const o = (d) => {
2948
- const u = a.refinement(d, n);
2949
- if (r.common.async)
2950
- return Promise.resolve(u);
2951
- if (u instanceof Promise)
2952
- throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2953
- return d;
2954
- };
2955
- if (r.common.async === !1) {
2956
- const d = this._def.schema._parseSync({
2957
- data: r.data,
2958
- path: r.path,
2959
- parent: r
2960
- });
2961
- return d.status === "aborted" ? y : (d.status === "dirty" && s.dirty(), o(d.value), { status: s.value, value: d.value });
2962
- } else
2963
- return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((d) => d.status === "aborted" ? y : (d.status === "dirty" && s.dirty(), o(d.value).then(() => ({ status: s.value, value: d.value }))));
2964
- }
2965
- if (a.type === "transform")
2966
- if (r.common.async === !1) {
2967
- const o = this._def.schema._parseSync({
2968
- data: r.data,
2969
- path: r.path,
2970
- parent: r
2971
- });
2972
- if (!W(o))
2973
- return y;
2974
- const d = a.transform(o.value, n);
2975
- if (d instanceof Promise)
2976
- throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2977
- return { status: s.value, value: d };
2978
- } else
2979
- return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => W(o) ? Promise.resolve(a.transform(o.value, n)).then((d) => ({
2980
- status: s.value,
2981
- value: d
2982
- })) : y);
2983
- b.assertNever(a);
2984
- }
2985
- }
2986
- Y.create = (t, e, s) => new Y({
2987
- schema: t,
2988
- typeName: v.ZodEffects,
2989
- effect: e,
2990
- ...x(s)
2991
- });
2992
- Y.createWithPreprocess = (t, e, s) => new Y({
2993
- schema: e,
2994
- effect: { type: "preprocess", transform: t },
2995
- typeName: v.ZodEffects,
2996
- ...x(s)
2997
- });
2998
- class L extends _ {
2999
- _parse(e) {
3000
- return this._getType(e) === f.undefined ? E(void 0) : this._def.innerType._parse(e);
3001
- }
3002
- unwrap() {
3003
- return this._def.innerType;
3004
- }
3005
- }
3006
- L.create = (t, e) => new L({
3007
- innerType: t,
3008
- typeName: v.ZodOptional,
3009
- ...x(e)
3010
- });
3011
- class G extends _ {
3012
- _parse(e) {
3013
- return this._getType(e) === f.null ? E(null) : this._def.innerType._parse(e);
3014
- }
3015
- unwrap() {
3016
- return this._def.innerType;
3017
- }
3018
- }
3019
- G.create = (t, e) => new G({
3020
- innerType: t,
3021
- typeName: v.ZodNullable,
3022
- ...x(e)
3023
- });
3024
- class je extends _ {
3025
- _parse(e) {
3026
- const { ctx: s } = this._processInputParams(e);
3027
- let r = s.data;
3028
- return s.parsedType === f.undefined && (r = this._def.defaultValue()), this._def.innerType._parse({
3029
- data: r,
3030
- path: s.path,
3031
- parent: s
3032
- });
3033
- }
3034
- removeDefault() {
3035
- return this._def.innerType;
3036
- }
3037
- }
3038
- je.create = (t, e) => new je({
3039
- innerType: t,
3040
- typeName: v.ZodDefault,
3041
- defaultValue: typeof e.default == "function" ? e.default : () => e.default,
3042
- ...x(e)
3043
- });
3044
- class Ne extends _ {
3045
- _parse(e) {
3046
- const { ctx: s } = this._processInputParams(e), r = {
3047
- ...s,
3048
- common: {
3049
- ...s.common,
3050
- issues: []
3051
- }
3052
- }, a = this._def.innerType._parse({
3053
- data: r.data,
3054
- path: r.path,
3055
- parent: {
3056
- ...r
3057
- }
3058
- });
3059
- return de(a) ? a.then((n) => ({
3060
- status: "valid",
3061
- value: n.status === "valid" ? n.value : this._def.catchValue({
3062
- get error() {
3063
- return new $(r.common.issues);
3064
- },
3065
- input: r.data
3066
- })
3067
- })) : {
3068
- status: "valid",
3069
- value: a.status === "valid" ? a.value : this._def.catchValue({
3070
- get error() {
3071
- return new $(r.common.issues);
3072
- },
3073
- input: r.data
3074
- })
3075
- };
3076
- }
3077
- removeCatch() {
3078
- return this._def.innerType;
3079
- }
3080
- }
3081
- Ne.create = (t, e) => new Ne({
3082
- innerType: t,
3083
- typeName: v.ZodCatch,
3084
- catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
3085
- ...x(e)
3086
- });
3087
- class ct extends _ {
3088
- _parse(e) {
3089
- if (this._getType(e) !== f.nan) {
3090
- const r = this._getOrReturnCtx(e);
3091
- return h(r, {
3092
- code: c.invalid_type,
3093
- expected: f.nan,
3094
- received: r.parsedType
3095
- }), y;
3096
- }
3097
- return { status: "valid", value: e.data };
3098
- }
3099
- }
3100
- ct.create = (t) => new ct({
3101
- typeName: v.ZodNaN,
3102
- ...x(t)
3103
- });
3104
- class Wr extends _ {
3105
- _parse(e) {
3106
- const { ctx: s } = this._processInputParams(e), r = s.data;
3107
- return this._def.type._parse({
3108
- data: r,
3109
- path: s.path,
3110
- parent: s
3111
- });
3112
- }
3113
- unwrap() {
3114
- return this._def.type;
3115
- }
3116
- }
3117
- class Pe extends _ {
3118
- _parse(e) {
3119
- const { status: s, ctx: r } = this._processInputParams(e);
3120
- if (r.common.async)
3121
- return (async () => {
3122
- const n = await this._def.in._parseAsync({
3123
- data: r.data,
3124
- path: r.path,
3125
- parent: r
3126
- });
3127
- return n.status === "aborted" ? y : n.status === "dirty" ? (s.dirty(), X(n.value)) : this._def.out._parseAsync({
3128
- data: n.value,
3129
- path: r.path,
3130
- parent: r
3131
- });
3132
- })();
3133
- {
3134
- const a = this._def.in._parseSync({
3135
- data: r.data,
3136
- path: r.path,
3137
- parent: r
3138
- });
3139
- return a.status === "aborted" ? y : a.status === "dirty" ? (s.dirty(), {
3140
- status: "dirty",
3141
- value: a.value
3142
- }) : this._def.out._parseSync({
3143
- data: a.value,
3144
- path: r.path,
3145
- parent: r
3146
- });
3147
- }
3148
- }
3149
- static create(e, s) {
3150
- return new Pe({
3151
- in: e,
3152
- out: s,
3153
- typeName: v.ZodPipeline
3154
- });
3155
- }
3156
- }
3157
- class Ce extends _ {
3158
- _parse(e) {
3159
- const s = this._def.innerType._parse(e), r = (a) => (W(a) && (a.value = Object.freeze(a.value)), a);
3160
- return de(s) ? s.then((a) => r(a)) : r(s);
3161
- }
3162
- unwrap() {
3163
- return this._def.innerType;
3164
- }
3165
- }
3166
- Ce.create = (t, e) => new Ce({
3167
- innerType: t,
3168
- typeName: v.ZodReadonly,
3169
- ...x(e)
3170
- });
3171
- var v;
3172
- (function(t) {
3173
- t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
3174
- })(v || (v = {}));
3175
- const lt = q.create;
3176
- F.create;
3177
- R.create;
3178
- const Kr = w.create;
3179
- le.create;
3180
- ue.create;
3181
- Q.create;
3182
- const Yr = K.create;
3183
- he.create;
3184
- L.create;
3185
- G.create;
3186
- const Gr = Kr({
3187
- buildId: lt(),
3188
- timestamp: lt(),
3189
- status: Yr(["in-progress", "success", "failed"])
3190
- }), Jr = ({
3191
- buildId: t,
3192
- endpoint: e = "/__zuplo/docs"
3193
- }) => {
3194
- const s = ns({
3195
- queryKey: ["zuplo-build-check", t, e],
3196
- refetchInterval: 3e3,
3197
- enabled: typeof t < "u" && !1,
3198
- retry: !1,
3199
- queryFn: () => fetch(e, { signal: AbortSignal.timeout(2e3) }).then((a) => {
3200
- if (!a.ok) throw new Error("Failed to fetch build status");
3201
- return a.json();
3202
- }).then((a) => Gr.parse(a))
3203
- });
3204
- if (s.isError || !s.data || s.data.buildId === t)
3205
- return null;
3206
- const r = s.data.status === "success";
3207
- return /* @__PURE__ */ i.jsxs("div", { className: "fixed flex flex-col gap-3 p-4 rounded-xl w-96 border z-20 bg-background left-0 right-0 top-4 mx-auto shadow-lg", children: [
3208
- r ? /* @__PURE__ */ i.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
3209
- /* @__PURE__ */ i.jsx(ks, { size: 16 }),
3210
- /* @__PURE__ */ i.jsx("span", { className: "text-sm", children: "New version available" })
3211
- ] }) : /* @__PURE__ */ i.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
3212
- /* @__PURE__ */ i.jsx(ws, { size: 16, className: "animate-spin" }),
3213
- /* @__PURE__ */ i.jsx("span", { className: "text-sm", children: "Building new version..." })
3214
- ] }),
3215
- /* @__PURE__ */ i.jsx("span", { className: "text-xs", children: r ? "To see the new version, reload the page now." : "A new version of the developer portal will be available soon." }),
3216
- /* @__PURE__ */ i.jsx(
3217
- jt,
3218
- {
3219
- variant: "outline",
3220
- size: "sm",
3221
- className: "w-full",
3222
- onClick: () => {
3223
- window.location.reload();
3224
- },
3225
- children: "Reload"
3226
- }
3227
- )
3228
- ] });
3229
- }, Xr = () => {
3230
- const t = fe(), e = Ae(t.pathname);
3231
- V(() => {
3232
- const s = e.current !== t.pathname, r = t.hash !== "";
3233
- s && !r && window.scrollTo(0, 0), e.current = t.pathname;
3234
- }, [t.pathname, t.hash]);
3235
- }, ea = ({
3236
- icon: t
3237
- }) => typeof t == "string" ? /* @__PURE__ */ i.jsx(
3238
- "img",
3239
- {
3240
- src: `https://cdn.simpleicons.org/${t}/000000/ffffff`,
3241
- className: "size-5",
3242
- alt: t
3243
- }
3244
- ) : t, ta = (t) => /^https?:/.test(t), sa = () => {
3245
- const { page: t } = Ea(), e = t?.footer;
3246
- return e ? /* @__PURE__ */ i.jsx("footer", { className: "border-t bg-background", children: /* @__PURE__ */ i.jsxs("div", { className: "mx-auto max-w-screen-2xl px-4 lg:px-8 py-8 pt-20", children: [
3247
- /* @__PURE__ */ i.jsxs(
3248
- "div",
3249
- {
3250
- className: C("flex flex-row gap-8", {
3251
- "justify-center": !e.position || e.position === "center",
3252
- "justify-start": e.position === "start",
3253
- "justify-end": e.position === "end"
3254
- }),
3255
- children: [
3256
- /* @__PURE__ */ i.jsx(T.Target, { name: "footer-before" }),
3257
- e.columns && /* @__PURE__ */ i.jsx(
3258
- "div",
3259
- {
3260
- className: "w-full md:max-w-screen-md grid grid-cols-[1fr_1fr] gap-8 md:grid-cols-[repeat(var(--columns),minmax(0,1fr))]",
3261
- style: { "--columns": e.columns.length },
3262
- children: e.columns.map((s) => /* @__PURE__ */ i.jsxs(
3263
- "div",
3264
- {
3265
- className: C({
3266
- "justify-self-center": !s.position || s.position === "center",
3267
- "justify-self-start": s.position === "start",
3268
- "justify-self-end": s.position === "end"
3269
- }),
3270
- children: [
3271
- /* @__PURE__ */ i.jsx("span", { className: "text-sm font-semibold", children: s.title }),
3272
- /* @__PURE__ */ i.jsx("ul", { className: "mt-4 space-y-2", children: s.links.map((r) => {
3273
- const a = "flex flex-row gap-1 items-center text-sm text-muted-foreground hover:text-accent-foreground";
3274
- return /* @__PURE__ */ i.jsx("li", { children: ta(r.href) ? /* @__PURE__ */ i.jsxs(
3275
- "a",
3276
- {
3277
- href: r.href,
3278
- target: "_blank",
3279
- rel: "noopener noreferrer",
3280
- className: a,
3281
- children: [
3282
- /* @__PURE__ */ i.jsx("span", { children: r.label }),
3283
- /* @__PURE__ */ i.jsx(js, { size: 12 })
3284
- ]
3285
- }
3286
- ) : /* @__PURE__ */ i.jsx(Ps, { to: r.href, className: a, children: /* @__PURE__ */ i.jsx("span", { children: r.label }) }) }, r.href + r.label);
3287
- }) })
3288
- ]
3289
- },
3290
- s.title
3291
- ))
3292
- }
3293
- ),
3294
- /* @__PURE__ */ i.jsx(T.Target, { name: "footer-after" })
3295
- ]
3296
- }
3297
- ),
3298
- /* @__PURE__ */ i.jsxs(
3299
- "div",
3300
- {
3301
- className: C(
3302
- "flex items-center justify-between",
3303
- e.columns && "border-t mt-8 pt-8"
3304
- ),
3305
- children: [
3306
- e.logo && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
3307
- /* @__PURE__ */ i.jsx(
3308
- "img",
3309
- {
3310
- src: e.logo.src.light,
3311
- alt: e.logo.alt,
3312
- className: "w-8 dark:hidden",
3313
- style: { width: e.logo.width }
3314
- }
3315
- ),
3316
- /* @__PURE__ */ i.jsx(
3317
- "img",
3318
- {
3319
- src: e.logo.src.dark,
3320
- alt: e.logo.alt,
3321
- className: "w-8 hidden dark:block",
3322
- style: { width: e.logo.width }
3323
- }
3324
- )
3325
- ] }),
3326
- e.copyright && /* @__PURE__ */ i.jsx("p", { className: "text-sm text-muted-foreground", children: e.copyright }),
3327
- /* @__PURE__ */ i.jsx("div", { className: "flex items-center gap-2", children: e.social?.map((s) => /* @__PURE__ */ i.jsxs(
3328
- "a",
3329
- {
3330
- href: s.href,
3331
- target: "_blank",
3332
- rel: "noopener noreferrer",
3333
- className: "w-auto gap-2 flex text-muted-foreground hover:text-accent-foreground",
3334
- children: [
3335
- /* @__PURE__ */ i.jsx(ea, { icon: s.icon }),
3336
- s.label
3337
- ]
3338
- },
3339
- s.href
3340
- )) })
3341
- ]
3342
- }
3343
- )
3344
- ] }) }) : null;
3345
- };
3346
- function ra({
3347
- className: t,
3348
- ...e
3349
- }) {
3350
- return /* @__PURE__ */ i.jsx(
3351
- "div",
3352
- {
3353
- className: C("animate-pulse rounded-md bg-muted", t),
3354
- ...e
3355
- }
3356
- );
3357
- }
3358
- const ut = {
3359
- info: "bg-blue-500",
3360
- note: "bg-gray-500",
3361
- tip: "bg-green-600",
3362
- caution: "bg-orange-500",
3363
- danger: "bg-rose-500"
3364
- }, aa = () => {
3365
- const { page: t } = P(), [e, s] = J(!0);
3366
- if (!t?.banner || !e)
3367
- return /* @__PURE__ */ i.jsx("style", { children: ":root { --banner-height: 0px; }" });
3368
- const r = t.banner.color && t.banner.color in ut ? ut[t.banner.color] : t.banner.color ? void 0 : "bg-primary", a = r ? {} : { backgroundColor: t.banner.color };
3369
- return /* @__PURE__ */ i.jsxs(
3370
- "div",
3371
- {
3372
- className: C(
3373
- "relative text-primary-foreground text-sm font-medium px-4 py-2 flex gap-2 items-center lg:h-(--banner-height)",
3374
- r
3375
- ),
3376
- "data-pagefind-ignore": "all",
3377
- style: a,
3378
- children: [
3379
- /* @__PURE__ */ i.jsx("div", { className: "w-full", children: t.banner.message }),
3380
- t.banner.dismissible && /* @__PURE__ */ i.jsx(
3381
- "button",
3382
- {
3383
- type: "button",
3384
- className: "md:absolute md:end-4 -m-1.5 p-1.5 hover:bg-accent-foreground/10 rounded-md",
3385
- onClick: () => s(!1),
3386
- children: /* @__PURE__ */ i.jsx(Ns, { size: 16 })
3387
- }
3388
- )
3389
- ]
3390
- }
3391
- );
3392
- }, It = (t) => /* @__PURE__ */ i.jsxs(
3393
- "svg",
3394
- {
3395
- xmlns: "http://www.w3.org/2000/svg",
3396
- viewBox: "0 0 132 100",
3397
- fill: "none",
3398
- ...t,
3399
- children: [
3400
- /* @__PURE__ */ i.jsx(
3401
- "path",
3402
- {
3403
- fill: "currentColor",
3404
- fillRule: "evenodd",
3405
- d: "M80.092 2.963A4.66 4.66 0 0 1 84.449 0h34.049c6.325 0 10.835 6.135 8.948 12.172L116.653 46.71a4.688 4.688 0 0 1-4.474 3.29H75c-5.178 0-7.813 4.687-9.375 9.374-1.288 3.864-11.07 28.963-14.467 37.662A4.66 4.66 0 0 1 46.801 100H12.75c-6.324 0-10.834-6.134-8.947-12.171l10.793-34.54A4.688 4.688 0 0 1 19.071 50H56.25c5.178 0 7.813-4.687 9.375-9.375 1.288-3.864 11.07-28.962 14.467-37.662Z",
3406
- clipRule: "evenodd"
3407
- }
3408
- ),
3409
- /* @__PURE__ */ i.jsx(
3410
- "path",
3411
- {
3412
- fill: "currentColor",
3413
- d: "M83.54 57.813a7.813 7.813 0 0 0-7.316 5.07L63.888 95.777c-.766 2.043.744 4.222 2.926 4.222h36.828c5.211 0 9.875-3.232 11.704-8.11l8.821-23.522c1.915-5.107-1.861-10.555-7.315-10.555H83.539ZM29.17 0a12.5 12.5 0 0 0-11.704 8.111l-8.82 23.521c-1.915 5.107 1.86 10.556 7.315 10.556h33.312a7.813 7.813 0 0 0 7.316-5.07L68.924 4.223C69.691 2.18 68.18 0 65.998 0H29.17Z"
3414
- }
3415
- )
3416
- ]
3417
- }
3418
- );
3419
- It.displayName = "ZudokuLogo";
3420
- const Mt = ({ className: t }) => /* @__PURE__ */ i.jsxs(
3421
- "a",
3422
- {
3423
- href: "https://zudoku.dev",
3424
- target: "_blank",
3425
- rel: "noopener noreferrer",
3426
- className: C(
3427
- "flex justify-between items-center w-full border border-transparent hover:border-border rounded-full hover:shadow-xs h-7 px-3 text-nowrap hover:bg-muted/80 transition-all",
3428
- t
3429
- ),
3430
- children: [
3431
- /* @__PURE__ */ i.jsxs("div", { className: "opacity-70 hover:opacity-100 transition-opacity gap-1.5 text-[11px] font-medium rounded-full h-7 flex items-center text-nowrap", children: [
3432
- /* @__PURE__ */ i.jsx(It, { className: "w-3.5 h-3.5 dark:fill-white" }),
3433
- "powered by ",
3434
- "Zudoku"
3435
- ] }),
3436
- /* @__PURE__ */ i.jsx("div", { className: "text-xs font-medium opacity-70 hover:text-foreground transition-colors cursor-pointer", children: /* @__PURE__ */ i.jsx(
3437
- Cs,
3438
- {
3439
- size: 12,
3440
- absoluteStrokeWidth: !0,
3441
- strokeWidth: 1.5,
3442
- className: "rtl:rotate-180"
3443
- }
3444
- ) })
3445
- ]
3446
- }
3447
- );
3448
- function na() {
3449
- const t = navigator.userAgent.toLowerCase();
3450
- if (t.includes("win")) return "Windows";
3451
- if (t.includes("mac")) return "macOS";
3452
- if (t.includes("linux")) return "Linux";
3453
- }
3454
- const Zt = ({ className: t }) => {
3455
- const e = P(), [s, r] = J(!1), a = vs(() => r(!1), []);
3456
- V(() => {
3457
- if (s)
3458
- return;
3459
- function o(d) {
3460
- d.key === "k" && (d.metaKey || d.ctrlKey) && (d.preventDefault(), r(!0));
3461
- }
3462
- return window.addEventListener("keydown", o), () => {
3463
- window.removeEventListener("keydown", o);
3464
- };
3465
- }, [s, r]);
3466
- const n = e.plugins.find(Ls);
3467
- return n ? /* @__PURE__ */ i.jsxs("div", { className: t, children: [
3468
- /* @__PURE__ */ i.jsxs(
3469
- "button",
3470
- {
3471
- type: "button",
3472
- onClick: () => r(!0),
3473
- className: "flex items-center border border-input hover:bg-accent hover:text-accent-foreground p-4 relative h-8 justify-start rounded-lg bg-background text-sm text-muted-foreground shadow-none w-full sm:w-72",
3474
- children: [
3475
- /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-2 grow", children: [
3476
- /* @__PURE__ */ i.jsx(Ss, { size: 14 }),
3477
- "Search"
3478
- ] }),
3479
- /* @__PURE__ */ i.jsx(pe, { children: /* @__PURE__ */ i.jsx(ia, {}) })
3480
- ]
3481
- }
3482
- ),
3483
- /* @__PURE__ */ i.jsx(Ee, { fallback: null, children: n.renderSearch({
3484
- isOpen: s,
3485
- onClose: a
3486
- }) })
3487
- ] }) : null;
3488
- }, ia = () => {
3489
- const t = na();
3490
- return /* @__PURE__ */ i.jsxs("kbd", { className: "absolute end-1.5 hidden h-5 select-none items-center gap-1 rounded-sm border bg-muted px-1.5 font-mono text-[11px] font-medium opacity-100 sm:flex", children: [
3491
- t === "macOS" ? "⌘" : "Ctrl",
3492
- "+K"
3493
- ] });
3494
- }, Dt = () => {
3495
- const { resolvedTheme: t, setTheme: e } = mt();
3496
- return /* @__PURE__ */ i.jsx(pe, { fallback: /* @__PURE__ */ i.jsx(_e, { variant: "ghost", size: "icon" }), children: /* @__PURE__ */ i.jsxs(
3497
- "button",
3498
- {
3499
- type: "button",
3500
- className: "flex rounded-full border p-0.5 gap-0.5 group",
3501
- onClick: () => e(t === "dark" ? "light" : "dark"),
3502
- "aria-label": t === "dark" ? "Switch to light mode" : "Switch to dark mode",
3503
- children: [
3504
- /* @__PURE__ */ i.jsx(
3505
- "div",
3506
- {
3507
- className: C(
3508
- "border border-transparent rounded-full p-0.5 [&>svg>circle]:transition-colors [&>svg>path]:transition-transform transition-all [&>svg>path]:duration-200 [&>svg>circle]:duration-500 [&>svg>circle]:fill-transparent",
3509
- t === "light" && "border-border bg-muted",
3510
- t === "dark" && "group-hover:[&>svg>path]:scale-110 group-hover:[&>svg>path]:-translate-x-[1px] group-hover:[&>svg>path]:-translate-y-[1px] group-hover:rotate-[15deg] "
3511
- ),
3512
- children: /* @__PURE__ */ i.jsx(Os, { size: 16 })
3513
- }
3514
- ),
3515
- /* @__PURE__ */ i.jsx(
3516
- "div",
3517
- {
3518
- className: C(
3519
- "border border-transparent rounded-full p-0.5 transition-transform transform-gpu duration-500",
3520
- t === "dark" && "border-border bg-muted [&>svg>path]:fill-white [&>svg>path]:stroke-transparent",
3521
- t === "light" && "group-hover:rotate-[-10deg] [&>svg>path]:stroke-currentColor"
3522
- ),
3523
- children: /* @__PURE__ */ i.jsx(Ts, { size: 16 })
3524
- }
3525
- )
3526
- ]
3527
- }
3528
- ) });
3529
- }, $t = () => {
3530
- const e = me().state === "loading", [s, r] = J(!1);
3531
- V(() => {
3532
- const o = setTimeout(() => r(e), 100);
3533
- return () => clearTimeout(o);
3534
- }, [e]);
3535
- const { isFinished: a, progress: n } = dr({ isAnimating: s });
3536
- return /* @__PURE__ */ i.jsx(
3537
- "div",
3538
- {
3539
- className: "absolute w-0 left-0 right-0 bottom-[-1px] h-[2px] bg-primary transition-all duration-300 ease-in-out",
3540
- style: {
3541
- opacity: a ? 0 : 1,
3542
- width: a ? 0 : `${n * 100}%`
3543
- }
3544
- }
3545
- );
3546
- }, oa = () => {
3547
- const { topNavigation: t } = P(), { isAuthenticated: e } = ee(), s = t.filter(_t(e));
3548
- return s.length === 0 ? /* @__PURE__ */ i.jsx("style", { children: ":root { --top-nav-height: 0px; }" }) : /* @__PURE__ */ i.jsxs(Ee, { children: [
3549
- /* @__PURE__ */ i.jsxs("div", { className: "items-center justify-between px-8 h-(--top-nav-height) hidden lg:flex text-sm relative", children: [
3550
- /* @__PURE__ */ i.jsx("nav", { className: "text-sm", children: /* @__PURE__ */ i.jsx("ul", { className: "flex flex-row items-center gap-8", children: s.map((r) => /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx(zt, { ...r }) }, r.id)) }) }),
3551
- /* @__PURE__ */ i.jsx(T.Target, { name: "top-navigation-side" })
3552
- ] }),
3553
- /* @__PURE__ */ i.jsx($t, {})
3554
- ] });
3555
- }, zt = ({
3556
- id: t,
3557
- label: e,
3558
- default: s
3559
- }) => {
3560
- const { sidebars: r } = P(), a = r[t], n = bt(), o = !!me().location, d = n.topNavItem?.id === t && !o, u = s ?? (a ? is(a, (l) => {
3561
- if (l.type === "doc") return H(l.id);
3562
- }) : H(t)) ?? H(t);
3563
- return (
3564
- // We don't use isActive here because it has to be inside the sidebar,
3565
- // the top nav id doesn't necessarily start with the sidebar id
3566
- /* @__PURE__ */ i.jsx(
3567
- Gt,
3568
- {
3569
- className: ({ isPending: l }) => cr(
3570
- "block lg:py-3.5 font-medium -mb-px",
3571
- d || l ? "border-primary text-foreground" : "border-transparent text-foreground/75 hover:text-foreground hover:border-accent-foreground/25"
3572
- ),
3573
- to: u,
3574
- children: e
3575
- }
3576
- )
3577
- );
3578
- }, da = () => {
3579
- const { topNavigation: t, options: e } = P(), { isAuthenticated: s } = ee(), [r, a] = J(!1);
3580
- return /* @__PURE__ */ i.jsxs(
3581
- ir,
3582
- {
3583
- direction: e.page?.dir === "rtl" ? "left" : "right",
3584
- open: r,
3585
- onOpenChange: (n) => a(n),
3586
- children: [
3587
- /* @__PURE__ */ i.jsxs("div", { className: "flex lg:hidden justify-self-end", children: [
3588
- /* @__PURE__ */ i.jsx(or, { className: "lg:hidden", children: /* @__PURE__ */ i.jsx(As, { size: 22 }) }),
3589
- /* @__PURE__ */ i.jsx($t, {})
3590
- ] }),
3591
- /* @__PURE__ */ i.jsx(
3592
- Tt,
3593
- {
3594
- className: "lg:hidden h-[100dvh] end-0 start-auto w-[320px] rounded-none",
3595
- "aria-describedby": void 0,
3596
- children: /* @__PURE__ */ i.jsxs("div", { className: "p-4 overflow-y-auto overscroll-none h-full flex flex-col justify-between", children: [
3597
- /* @__PURE__ */ i.jsxs("div", { children: [
3598
- /* @__PURE__ */ i.jsx(Ot, { children: /* @__PURE__ */ i.jsx(At, { children: "Navigation" }) }),
3599
- /* @__PURE__ */ i.jsx(Zt, { className: "flex p-4" }),
3600
- /* @__PURE__ */ i.jsxs("ul", { className: "flex flex-col items-center gap-4 p-4", children: [
3601
- /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx(Dt, {}) }),
3602
- t.filter(_t(s)).map((n) => /* @__PURE__ */ i.jsx("li", { children: /* @__PURE__ */ i.jsx("button", { type: "button", onClick: () => a(!1), children: /* @__PURE__ */ i.jsx(zt, { ...n }) }) }, n.label))
3603
- ] })
3604
- ] }),
3605
- e.page?.showPoweredBy !== !1 && /* @__PURE__ */ i.jsx(Mt, { className: "grow-0 justify-center gap-1" })
3606
- ] })
3607
- }
3608
- )
3609
- ]
3610
- }
3611
- );
3612
- }, oe = ({ item: t }) => t.children ? /* @__PURE__ */ i.jsxs(tr, { children: [
3613
- /* @__PURE__ */ i.jsx(sr, { children: t.label }),
3614
- /* @__PURE__ */ i.jsx(rr, { children: /* @__PURE__ */ i.jsx(ar, { children: t.children.map((e, s) => (
3615
- // eslint-disable-next-line react/no-array-index-key
3616
- /* @__PURE__ */ i.jsx(oe, { item: e }, s)
3617
- )) }) })
3618
- ] }, t.label) : /* @__PURE__ */ i.jsx(Oe, { to: t.path ?? "", children: /* @__PURE__ */ i.jsxs(nr, { className: "flex gap-2", children: [
3619
- t.icon && /* @__PURE__ */ i.jsx(t.icon, { size: 16, strokeWidth: 1, absoluteStrokeWidth: !0 }),
3620
- t.label
3621
- ] }, t.label) }), qt = Ct(function() {
3622
- const e = ee(), { isAuthenticated: s, profile: r, isAuthEnabled: a } = ee(), n = P(), { page: o, plugins: d, options: u } = n, l = d.filter((p) => Bs(p)).flatMap((p) => p.getProfileMenuItems(n)).sort((p) => p.weight ?? 0), g = o?.logo ? /https?:\/\//.test(o.logo.src.light) ? o.logo.src.light : H(u.basePath, o.logo.src.light) : void 0, j = o?.logo ? /https?:\/\//.test(o.logo.src.dark) ? o.logo.src.dark : H(u.basePath, o.logo.src.dark) : void 0, k = "inset-shadow-[0_-1px_0_0_var(--border)]";
3623
- return /* @__PURE__ */ i.jsxs("header", { className: "sticky lg:top-0 z-10 bg-background/80 backdrop-blur w-full", children: [
3624
- /* @__PURE__ */ i.jsx(aa, {}),
3625
- /* @__PURE__ */ i.jsx("div", { className: k, children: /* @__PURE__ */ i.jsxs("div", { className: "max-w-screen-2xl mx-auto flex relative items-center justify-between h-(--top-header-height) px-4 lg:px-8 border-transparent", children: [
3626
- /* @__PURE__ */ i.jsx("div", { className: "flex", children: /* @__PURE__ */ i.jsx(Oe, { to: "/", children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-3.5", children: [
3627
- o?.logo && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
3628
- /* @__PURE__ */ i.jsx(
3629
- "img",
3630
- {
3631
- src: g,
3632
- alt: o.logo.alt ?? o.pageTitle,
3633
- style: { width: o.logo.width },
3634
- className: "max-h-(--top-header-height) dark:hidden",
3635
- loading: "lazy"
3636
- }
3637
- ),
3638
- /* @__PURE__ */ i.jsx(
3639
- "img",
3640
- {
3641
- src: j,
3642
- alt: o.logo.alt ?? o.pageTitle,
3643
- style: { width: o.logo.width },
3644
- className: "max-h-(--top-header-height) hidden dark:block",
3645
- loading: "lazy"
3646
- }
3647
- )
3648
- ] }),
3649
- /* @__PURE__ */ i.jsx("span", { className: "font-semibold text-2xl", children: o?.pageTitle })
3650
- ] }) }) }),
3651
- /* @__PURE__ */ i.jsx("div", { className: "absolute inset-x-0 justify-center items-center hidden lg:flex w-full pointer-events-none", children: /* @__PURE__ */ i.jsx(Zt, { className: "pointer-events-auto" }) }),
3652
- /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-8", children: [
3653
- /* @__PURE__ */ i.jsx(da, {}),
3654
- /* @__PURE__ */ i.jsxs("div", { className: "hidden lg:flex items-center justify-self-end text-sm gap-2", children: [
3655
- /* @__PURE__ */ i.jsx(T.Target, { name: "head-navigation-start" }),
3656
- a && /* @__PURE__ */ i.jsx(
3657
- pe,
3658
- {
3659
- fallback: /* @__PURE__ */ i.jsx(ra, { className: "rounded-sm h-5 w-24 mr-4" }),
3660
- children: s ? Object.values(l).length > 0 && /* @__PURE__ */ i.jsxs(Gs, { modal: !1, children: [
3661
- /* @__PURE__ */ i.jsx(Js, { asChild: !0, children: /* @__PURE__ */ i.jsx(_e, { variant: "ghost", children: r?.name ?? "My Account" }) }),
3662
- /* @__PURE__ */ i.jsxs(Xs, { className: "w-56", children: [
3663
- /* @__PURE__ */ i.jsxs(er, { children: [
3664
- r?.name ? `${r.name}` : "My Account",
3665
- r?.email && /* @__PURE__ */ i.jsx("div", { className: "font-normal text-muted-foreground", children: r.email })
3666
- ] }),
3667
- l.filter((p) => p.category === "top").length > 0 && /* @__PURE__ */ i.jsx(ye, {}),
3668
- l.filter((p) => p.category === "top").map((p) => /* @__PURE__ */ i.jsx(oe, { item: p }, p.label)),
3669
- l.filter(
3670
- (p) => !p.category || p.category === "middle"
3671
- ).length > 0 && /* @__PURE__ */ i.jsx(ye, {}),
3672
- l.filter(
3673
- (p) => !p.category || p.category === "middle"
3674
- ).map((p) => /* @__PURE__ */ i.jsx(oe, { item: p }, p.label)),
3675
- l.filter((p) => p.category === "bottom").length > 0 && /* @__PURE__ */ i.jsx(ye, {}),
3676
- l.filter((p) => p.category === "bottom").map((p) => /* @__PURE__ */ i.jsx(oe, { item: p }, p.label))
3677
- ] })
3678
- ] }) : /* @__PURE__ */ i.jsx(_e, { variant: "ghost", onClick: () => e.login(), children: "Login" })
3679
- }
3680
- ),
3681
- /* @__PURE__ */ i.jsx(T.Target, { name: "head-navigation-end" }),
3682
- /* @__PURE__ */ i.jsx(Dt, {})
3683
- ] })
3684
- ] })
3685
- ] }) }),
3686
- /* @__PURE__ */ i.jsx("div", { className: C("hidden lg:block", k), children: /* @__PURE__ */ i.jsxs("div", { className: "max-w-screen-2xl mx-auto border-transparent", children: [
3687
- /* @__PURE__ */ i.jsx(T.Target, { name: "top-navigation-before" }),
3688
- /* @__PURE__ */ i.jsx(oa, {}),
3689
- /* @__PURE__ */ i.jsx(T.Target, { name: "top-navigation-after" })
3690
- ] }) })
3691
- ] });
3692
- }), Lt = ({
3693
- shouldScaleBackground: t = !0,
3694
- ...e
3695
- }) => /* @__PURE__ */ i.jsx(
3696
- I.Root,
3697
- {
3698
- shouldScaleBackground: t,
3699
- ...e
3700
- }
3701
- );
3702
- Lt.displayName = "Drawer";
3703
- const ca = I.Trigger, la = I.Portal, Bt = D.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ i.jsx(
3704
- I.Overlay,
3705
- {
3706
- ref: s,
3707
- className: C("fixed inset-0 z-50 bg-black/80", t),
3708
- ...e
3709
- }
3710
- ));
3711
- Bt.displayName = I.Overlay.displayName;
3712
- const ua = D.forwardRef(
3713
- ({ className: t, children: e, hideBar: s = !0, ...r }, a) => /* @__PURE__ */ i.jsxs(la, { children: [
3714
- /* @__PURE__ */ i.jsx(Bt, {}),
3715
- /* @__PURE__ */ i.jsxs(
3716
- I.Content,
3717
- {
3718
- ref: a,
3719
- className: C(
3720
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
3721
- t
3722
- ),
3723
- ...r,
3724
- children: [
3725
- !s && /* @__PURE__ */ i.jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
3726
- e
3727
- ]
3728
- }
3729
- )
3730
- ] })
3731
- );
3732
- ua.displayName = "DrawerContent";
3733
- const ha = D.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ i.jsx(
3734
- I.Title,
3735
- {
3736
- ref: s,
3737
- className: C(
3738
- "text-lg font-semibold leading-none tracking-tight",
3739
- t
3740
- ),
3741
- ...e
3742
- }
3743
- ));
3744
- ha.displayName = I.Title.displayName;
3745
- const fa = D.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ i.jsx(
3746
- I.Description,
3747
- {
3748
- ref: s,
3749
- className: C("text-sm text-muted-foreground", t),
3750
- ...e
3751
- }
3752
- ));
3753
- fa.displayName = I.Description.displayName;
3754
- const Ft = ({
3755
- children: t,
3756
- className: e
3757
- }) => {
3758
- const { options: s } = P(), r = Ae(null);
3759
- return V(() => {
3760
- const a = r.current?.querySelector('[aria-current="page"]');
3761
- Rs(a ?? null);
3762
- }, []), /* @__PURE__ */ i.jsxs("div", { className: "grid sticky top-(--header-height) lg:h-[calc(100vh-var(--header-height))] grid-rows-[1fr_min-content] border-r", children: [
3763
- /* @__PURE__ */ i.jsx(
3764
- "nav",
3765
- {
3766
- ref: r,
3767
- className: C(
3768
- "hidden max-w-[calc(var(--side-nav-width)+var(--padding-nav-item))] lg:flex scrollbar flex-col overflow-y-auto shrink-0 text-sm pe-3 ps-4 lg:ps-8",
3769
- "-mx-(--padding-nav-item) pb-[8vh] pt-(--padding-content-top) scroll-pt-2 gap-1",
3770
- // Revert the padding/margin on the first child
3771
- "-mt-2.5",
3772
- e
3773
- ),
3774
- style: {
3775
- maskImage: "linear-gradient(180deg, transparent 1%, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 90%, transparent 99%)"
3776
- },
3777
- children: t
3778
- }
3779
- ),
3780
- /* @__PURE__ */ i.jsx("div", { className: "bg-background border-t p-2 mx-5 gap-2 items-center mt-2 drop-shadow-[0_-3px_1px_rgba(0,0,0,0.015)] hidden lg:[&:has(>_:nth-child(1):last-child)]:flex", children: s.page?.showPoweredBy !== !1 && /* @__PURE__ */ i.jsx(Mt, {}) })
3781
- ] });
3782
- };
3783
- Ft.displayName = "SidebarWrapper";
3784
- const ma = ({
3785
- onRequestClose: t,
3786
- sidebar: e
3787
- }) => /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
3788
- /* @__PURE__ */ i.jsxs(Ft, { children: [
3789
- /* @__PURE__ */ i.jsx(T.Target, { name: "navigation-before" }),
3790
- e.map((s) => /* @__PURE__ */ i.jsx(
3791
- Be,
3792
- {
3793
- item: s
3794
- },
3795
- ("id" in s ? s.id : "") + ("href" in s ? s.href : "") + s.label
3796
- )),
3797
- /* @__PURE__ */ i.jsx(T.Target, { name: "navigation-after" })
3798
- ] }),
3799
- /* @__PURE__ */ i.jsx(
3800
- Tt,
3801
- {
3802
- className: "lg:hidden h-[100dvh] start-0 w-[320px] rounded-none",
3803
- "aria-describedby": void 0,
3804
- children: /* @__PURE__ */ i.jsxs("div", { className: "p-4 overflow-y-auto overscroll-none", children: [
3805
- /* @__PURE__ */ i.jsx(Ot, { children: /* @__PURE__ */ i.jsx(At, { children: "Sidebar" }) }),
3806
- e.map((s) => /* @__PURE__ */ i.jsx(
3807
- Be,
3808
- {
3809
- item: s,
3810
- onRequestClose: t
3811
- },
3812
- s.label
3813
- ))
3814
- ] })
3815
- }
3816
- )
3817
- ] }), pa = ({ children: t }) => {
3818
- const [e, s] = J(!1), { sidebar: r } = bt(), a = r.length > 0, n = me().state === "loading", { options: o } = P();
3819
- return /* @__PURE__ */ i.jsxs(
3820
- Lt,
3821
- {
3822
- direction: o.page?.dir === "rtl" ? "right" : "left",
3823
- open: e,
3824
- onOpenChange: (d) => s(d),
3825
- children: [
3826
- a && /* @__PURE__ */ i.jsx(
3827
- ma,
3828
- {
3829
- onRequestClose: () => s(!1),
3830
- sidebar: r
3831
- }
3832
- ),
3833
- a && /* @__PURE__ */ i.jsx("div", { className: "lg:hidden -mx-4 px-4 py-2 sticky bg-background/80 backdrop-blur-xs z-10 top-0 start-0 end-0 border-b", children: /* @__PURE__ */ i.jsxs(ca, { className: "flex items-center gap-2 px-4", children: [
3834
- /* @__PURE__ */ i.jsx(Es, { size: 16, strokeWidth: 1.5 }),
3835
- /* @__PURE__ */ i.jsx("span", { className: "text-sm", children: "Menu" })
3836
- ] }) }),
3837
- /* @__PURE__ */ i.jsxs(
3838
- "main",
3839
- {
3840
- "data-pagefind-body": !0,
3841
- className: C(
3842
- "px-4 lg:pe-8 lg:px-8",
3843
- !a && "col-span-full",
3844
- n && "animate-pulse"
3845
- ),
3846
- children: [
3847
- /* @__PURE__ */ i.jsx(T.Target, { name: "content-before" }),
3848
- t,
3849
- /* @__PURE__ */ i.jsx(T.Target, { name: "content-after" })
3850
- ]
3851
- }
3852
- )
3853
- ]
3854
- }
3855
- );
3856
- }, ga = () => /* @__PURE__ */ i.jsx("main", { className: "col-span-full row-span-full grid place-items-center", children: /* @__PURE__ */ i.jsx(St, {}) }), ya = ({ children: t }) => {
3857
- const { meta: e, authentication: s, options: r } = P(), a = fe();
3858
- return Is(), Xr(), V(() => {
3859
- s?.onPageLoad?.();
3860
- }, [s]), /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
3861
- /* @__PURE__ */ i.jsxs(Se, { titleTemplate: e?.title, children: [
3862
- r.canonicalUrlOrigin && /* @__PURE__ */ i.jsx(
3863
- "link",
3864
- {
3865
- rel: "canonical",
3866
- href: H(
3867
- r.canonicalUrlOrigin,
3868
- r.basePath,
3869
- a.pathname
3870
- )
3871
- }
3872
- ),
3873
- e?.description && /* @__PURE__ */ i.jsx("meta", { name: "description", content: e.description }),
3874
- e?.favicon && /* @__PURE__ */ i.jsx("link", { rel: "icon", href: e.favicon })
3875
- ] }),
3876
- /* @__PURE__ */ i.jsx(T.Target, { name: "layout-before-head" }),
3877
- /* @__PURE__ */ i.jsx(qt, {}),
3878
- /* @__PURE__ */ i.jsx(T.Target, { name: "layout-after-head" }),
3879
- /* @__PURE__ */ i.jsx(
3880
- "div",
3881
- {
3882
- className: C(
3883
- "grid max-w-screen-2xl w-full lg:mx-auto",
3884
- "[&:has(>:only-child)]:grid-rows-1 grid-rows-[0_min-content_1fr] lg:grid-rows-[min-content_1fr]",
3885
- "grid-cols-1 lg:grid-cols-[var(--side-nav-width)_1fr]"
3886
- ),
3887
- children: /* @__PURE__ */ i.jsx(Ee, { fallback: /* @__PURE__ */ i.jsx(ga, {}), children: /* @__PURE__ */ i.jsx(pa, { children: t ?? /* @__PURE__ */ i.jsx(pt, {}) }) })
3888
- }
3889
- ),
3890
- /* @__PURE__ */ i.jsx(sa, {})
3891
- ] });
3892
- }, va = ({
3893
- title: t = "An error occurred",
3894
- message: e,
3895
- category: s
3896
- }) => /* @__PURE__ */ i.jsxs("div", { className: Zs + " h-full pt-(--padding-content-top)", children: [
3897
- s && /* @__PURE__ */ i.jsx(qs, { children: s }),
3898
- t && /* @__PURE__ */ i.jsx(Ms, { level: 1, className: "flex gap-3.5 items-center", children: t }),
3899
- /* @__PURE__ */ i.jsx("p", { children: e })
3900
- ] }), xa = (t) => {
3901
- switch (t) {
3902
- case 400:
3903
- return {
3904
- title: "Bad Request",
3905
- message: "The request could not be understood by the server due to malformed syntax."
3906
- };
3907
- case 403:
3908
- return {
3909
- title: "Forbidden",
3910
- message: "You don't have permission to access this resource."
3911
- };
3912
- case 404:
3913
- return {
3914
- title: "Not Found",
3915
- message: "The requested resource could not be found."
3916
- };
3917
- case 405:
3918
- return {
3919
- title: "Method Not Allowed",
3920
- message: "The request method is not supported for the requested resource."
3921
- };
3922
- case 414:
3923
- return {
3924
- title: "Request URI Too Large",
3925
- message: "The request URI is too large."
3926
- };
3927
- case 416:
3928
- return {
3929
- title: "Range Not Satisfiable",
3930
- message: "The server cannot satisfy the request range."
3931
- };
3932
- case 500:
3933
- return {
3934
- title: "Internal Server Error",
3935
- message: "An unexpected error occurred while processing your request."
3936
- };
3937
- case 501:
3938
- return {
3939
- title: "Not Implemented",
3940
- message: "The server does not support the functionality required to fulfill the request."
3941
- };
3942
- case 502:
3943
- return {
3944
- title: "Bad Gateway",
3945
- message: "The server received an invalid response from the upstream server."
3946
- };
3947
- case 503:
3948
- return {
3949
- title: "Service Unavailable",
3950
- message: "The server is temporarily unable to handle the request."
3951
- };
3952
- case 504:
3953
- return {
3954
- title: "Gateway Timeout",
3955
- message: "The server did not receive a timely response from the upstream server."
3956
- };
3957
- default:
3958
- return {
3959
- title: "An error occurred",
3960
- message: "Something went wrong while processing your request."
3961
- };
3962
- }
3963
- }, _a = ({ statusCode: t, message: e }) => {
3964
- const s = xa(t);
3965
- return /* @__PURE__ */ i.jsx(
3966
- va,
3967
- {
3968
- title: s.title,
3969
- message: e ?? s.message,
3970
- category: t
3971
- }
3972
- );
3973
- }, ba = Te(null), xe = {
3974
- didCatch: !1,
3975
- error: null
3976
- };
3977
- class ka extends xs {
3978
- constructor(e) {
3979
- super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = xe;
3980
- }
3981
- static getDerivedStateFromError(e) {
3982
- return {
3983
- didCatch: !0,
3984
- error: e
3985
- };
3986
- }
3987
- resetErrorBoundary() {
3988
- const {
3989
- error: e
3990
- } = this.state;
3991
- if (e !== null) {
3992
- for (var s, r, a = arguments.length, n = new Array(a), o = 0; o < a; o++)
3993
- n[o] = arguments[o];
3994
- (s = (r = this.props).onReset) === null || s === void 0 || s.call(r, {
3995
- args: n,
3996
- reason: "imperative-api"
3997
- }), this.setState(xe);
3998
- }
3999
- }
4000
- componentDidCatch(e, s) {
4001
- var r, a;
4002
- (r = (a = this.props).onError) === null || r === void 0 || r.call(a, e, s);
4003
- }
4004
- componentDidUpdate(e, s) {
4005
- const {
4006
- didCatch: r
4007
- } = this.state, {
4008
- resetKeys: a
4009
- } = this.props;
4010
- if (r && s.error !== null && wa(e.resetKeys, a)) {
4011
- var n, o;
4012
- (n = (o = this.props).onReset) === null || n === void 0 || n.call(o, {
4013
- next: a,
4014
- prev: e.resetKeys,
4015
- reason: "keys"
4016
- }), this.setState(xe);
4017
- }
4018
- }
4019
- render() {
4020
- const {
4021
- children: e,
4022
- fallbackRender: s,
4023
- FallbackComponent: r,
4024
- fallback: a
4025
- } = this.props, {
4026
- didCatch: n,
4027
- error: o
4028
- } = this.state;
4029
- let d = e;
4030
- if (n) {
4031
- const u = {
4032
- error: o,
4033
- resetErrorBoundary: this.resetErrorBoundary
4034
- };
4035
- if (typeof s == "function")
4036
- d = s(u);
4037
- else if (r)
4038
- d = Le(r, u);
4039
- else if (a !== void 0)
4040
- d = a;
4041
- else
4042
- throw o;
4043
- }
4044
- return Le(ba.Provider, {
4045
- value: {
4046
- didCatch: n,
4047
- error: o,
4048
- resetErrorBoundary: this.resetErrorBoundary
4049
- }
4050
- }, d);
4051
- }
4052
- }
4053
- function wa() {
4054
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
4055
- return t.length !== e.length || t.some((s, r) => !Object.is(s, e[r]));
4056
- }
4057
- let ja = () => ({
4058
- emit(t, ...e) {
4059
- for (let s = this.events[t] || [], r = 0, a = s.length; r < a; r++)
4060
- s[r](...e);
4061
- },
4062
- events: {},
4063
- on(t, e) {
4064
- return (this.events[t] ||= []).push(e), () => {
4065
- this.events[t] = this.events[t]?.filter((s) => e !== s);
4066
- };
4067
- }
4068
- });
4069
- class Na {
4070
- plugins;
4071
- sidebars;
4072
- topNavigation;
4073
- meta;
4074
- page;
4075
- authentication;
4076
- queryClient;
4077
- options;
4078
- navigationPlugins;
4079
- emitter = ja();
4080
- constructor(e, s) {
4081
- const r = (e.protectedRoutes ?? []).concat(
4082
- e.plugins?.flatMap(
4083
- (a) => Fe(a) ? a.getProtectedRoutes?.() ?? [] : []
4084
- ) ?? []
4085
- );
4086
- this.queryClient = s, this.options = { ...e, protectedRoutes: r }, this.plugins = e.plugins ?? [], this.topNavigation = e.topNavigation ?? [], this.sidebars = e.sidebars ?? {}, this.navigationPlugins = this.plugins.filter(Fe), this.authentication = this.plugins.find(Fs), this.meta = e.metadata, this.page = e.page, this.plugins.forEach((a) => {
4087
- Qs(a) && Ys(a.events).forEach(([n, o]) => {
4088
- this.emitter.on(n, o);
4089
- });
4090
- }), os.subscribe((a, n) => {
4091
- this.emitEvent("auth", {
4092
- prev: n,
4093
- next: a
4094
- });
4095
- });
4096
- }
4097
- initialize = async () => {
4098
- await Promise.all(
4099
- this.plugins.filter(Vs).map((e) => e.initialize?.(this))
4100
- );
4101
- };
4102
- getApiIdentities = async () => (await Promise.all(
4103
- this.plugins.filter(Us).map((s) => s.getIdentities(this))
4104
- )).flat();
4105
- addEventListener(e, s) {
4106
- return this.emitter.on(e, s);
4107
- }
4108
- emitEvent = (e, ...s) => this.emitter.emit(e, ...s);
4109
- getPluginSidebar = async (e) => (await Promise.all(
4110
- this.navigationPlugins.map(
4111
- (r) => r.getSidebar?.(Ks(e), this)
4112
- )
4113
- )).flatMap((r) => r ?? []);
4114
- signRequest = async (e) => {
4115
- if (!this.authentication)
4116
- throw new Error("No authentication provider configured");
4117
- return await this.authentication.signRequest(e);
4118
- };
4119
- }
4120
- function Ca({ error: t, resetErrorBoundary: e }) {
4121
- return /* @__PURE__ */ i.jsx(wt, { error: t });
4122
- }
4123
- const ie = globalThis;
4124
- (!ie.requestIdleCallback || !ie.cancelIdleCallback) && (ie.requestIdleCallback = (t) => setTimeout(t, 1), ie.cancelIdleCallback = clearTimeout);
4125
- const Qt = {
4126
- Header: qt
4127
- }, Sa = Te(Qt), Oa = Sa.Provider, Ta = () => {
4128
- const t = fe(), e = P(), s = Ae(void 0);
4129
- return V(() => {
4130
- e.emitEvent("location", {
4131
- from: s.current,
4132
- to: t
4133
- }), s.current = t;
4134
- }, [e, t]), null;
4135
- }, Aa = ({
4136
- children: t,
4137
- context: e
4138
- }) => (ds({
4139
- queryFn: async () => (await e.initialize(), !0),
4140
- queryKey: ["zudoku-initialize", cs]
4141
- }), /* @__PURE__ */ i.jsx(ls.Provider, { value: e, children: t }));
4142
- let ht;
4143
- const Vt = Ct(
4144
- ({ children: t, ...e }) => {
4145
- const s = ge(
4146
- () => ({ ...Qt, ...e.overrides }),
4147
- [e.overrides]
4148
- ), r = fe(), a = ge(() => ({
4149
- ...(e.plugins ?? []).filter(Hs).flatMap(
4150
- (p) => p.getMdxComponents ? [p.getMdxComponents()] : []
4151
- ).reduce(
4152
- (p, N) => ({ ...p, ...N }),
4153
- {}
4154
- ),
4155
- ...Ds,
4156
- ...e.mdx?.components
4157
- }), [e.mdx?.components, e.plugins]), { stagger: n } = _s(be), [o, d] = J(!1), u = ge(
4158
- () => o ? { stagger: !0 } : { stagger: n },
4159
- [n, o]
4160
- ), l = me(), g = vt();
4161
- V(() => {
4162
- o || d(!0);
4163
- }, [o, l.location]), ht ??= new Na(e, g);
4164
- const j = e.plugins?.flatMap(
4165
- (k) => Ws(k) ? k.getHead?.({ location: r }) ?? [] : []
4166
- ).map((k, p) => /* @__PURE__ */ i.jsx(Se, { children: k }, p));
4167
- return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
4168
- j,
4169
- /* @__PURE__ */ i.jsx(be.Provider, { value: u, children: /* @__PURE__ */ i.jsxs(Aa, { context: ht, children: [
4170
- /* @__PURE__ */ i.jsx(Ta, {}),
4171
- /* @__PURE__ */ i.jsx(ms, { slots: e.slots ?? e.UNSAFE_slotlets, children: /* @__PURE__ */ i.jsx(lr, { components: a, children: /* @__PURE__ */ i.jsx(Wt, { attribute: "class", disableTransitionOnChange: !0, children: /* @__PURE__ */ i.jsx(Oa, { value: s, children: /* @__PURE__ */ i.jsx($s, { children: t ?? /* @__PURE__ */ i.jsx(pt, {}) }) }) }) }) })
4172
- ] }) })
4173
- ] });
4174
- }
4175
- );
4176
- Vt.displayName = "ZudokoInner";
4177
- const Ut = (t) => /* @__PURE__ */ i.jsx(ka, { FallbackComponent: Ca, children: /* @__PURE__ */ i.jsx(Vt, { ...t }) });
4178
- Ut.displayName = "Zudoku";
4179
- const nn = ya, on = ps, dn = vr, cn = br, ln = kr, un = fs, hn = Se, fn = _a, mn = gs, pn = zs, gn = St, yn = pe, vn = jt, xn = Oe, _n = Jr, bn = Ut, kn = ur, Ea = P, wn = ee, jn = us, Nn = hs, Cn = mt;
1
+ import "./RouteGuard-CbKd7_9h.js";
2
+ import "./index-ClhS5TxS.js";
3
+ import "./chunk-DQRVZFIR-DHK7_Ilc.js";
4
+ import "./hook-Bd0yS8M0.js";
5
+ import "./Slot-DwZlQ-vX.js";
6
+ import { e as C, f as d, j as h, B as k, m as l, C as S, i as B, H as c, c as y, L as E, M as g, g as H, R as L, d as M, S as R, h as T, T as Z, Z as f, b as A, l as b, k as j, n as v, u as w } from "./index-CLy1XyH0.js";
7
+ import "./ui/Button.js";
8
+ import "./ui/Callout.js";
9
+ import "./ClientOnly-E7hGysn1.js";
10
+ import "./Spinner-mNLZ6awP.js";
4180
11
  export {
4181
- cn as Bootstrap,
4182
- ln as BootstrapStatic,
4183
- _n as BuildCheck,
4184
- vn as Button,
4185
- Nn as CACHE_KEYS,
4186
- mn as Callout,
4187
- yn as ClientOnly,
4188
- hn as Head,
4189
- nn as Layout,
4190
- xn as Link,
4191
- pn as Markdown,
4192
- un as RouteGuard,
4193
- on as RouterError,
4194
- dn as ServerError,
4195
- gn as Spinner,
4196
- fn as StatusPage,
4197
- bn as Zudoku,
4198
- wn as useAuth,
4199
- jn as useCache,
4200
- kn as useMDXComponents,
4201
- Cn as useTheme,
4202
- Ea as useZudoku
12
+ C as Bootstrap,
13
+ d as BootstrapStatic,
14
+ h as BuildCheck,
15
+ k as Button,
16
+ l as CACHE_KEYS,
17
+ S as Callout,
18
+ B as ClientOnly,
19
+ c as Head,
20
+ y as Layout,
21
+ E as Link,
22
+ g as Markdown,
23
+ H as RouteGuard,
24
+ L as RouterError,
25
+ M as ServerError,
26
+ R as Spinner,
27
+ T as StatusPage,
28
+ Z as Typography,
29
+ f as Zudoku,
30
+ A as useAuth,
31
+ b as useCache,
32
+ j as useMDXComponents,
33
+ v as useTheme,
34
+ w as useZudoku
4203
35
  };
4204
36
  //# sourceMappingURL=zudoku.components.js.map