zudoku 0.0.0-f0602bf → 0.0.0-f0b4321

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