zudoku 0.45.1 → 0.46.1

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