zudoku 0.62.0 → 0.63.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 (392) hide show
  1. package/dist/app/entry.server.js +14 -1
  2. package/dist/app/entry.server.js.map +1 -1
  3. package/dist/cli/cli.d.ts +9 -0
  4. package/dist/cli/cli.js +4 -10
  5. package/dist/cli/cli.js.map +1 -1
  6. package/dist/cli/common/version-check.d.ts +2 -0
  7. package/dist/cli/common/version-check.js +58 -0
  8. package/dist/cli/common/version-check.js.map +1 -0
  9. package/dist/config/config.d.ts +3 -0
  10. package/dist/config/validators/InputNavigationSchema.d.ts +64 -4
  11. package/dist/config/validators/icon-types.d.ts +1 -1
  12. package/dist/config/validators/icon-types.js +15 -0
  13. package/dist/config/validators/icon-types.js.map +1 -1
  14. package/dist/config/validators/validate.d.ts +29 -9
  15. package/dist/config/validators/validate.js +22 -0
  16. package/dist/config/validators/validate.js.map +1 -1
  17. package/dist/flat-config.d.ts +21 -2
  18. package/dist/lib/assets/language-icons/c.d.ts +3 -0
  19. package/dist/lib/assets/language-icons/c.js +4 -0
  20. package/dist/lib/assets/language-icons/c.js.map +1 -0
  21. package/dist/lib/assets/language-icons/commonlisp.d.ts +3 -0
  22. package/dist/lib/assets/language-icons/commonlisp.js +4 -0
  23. package/dist/lib/assets/language-icons/commonlisp.js.map +1 -0
  24. package/dist/lib/assets/language-icons/cpp.d.ts +3 -0
  25. package/dist/lib/assets/language-icons/cpp.js +4 -0
  26. package/dist/lib/assets/language-icons/cpp.js.map +1 -0
  27. package/dist/lib/assets/language-icons/dart.d.ts +3 -0
  28. package/dist/lib/assets/language-icons/dart.js +4 -0
  29. package/dist/lib/assets/language-icons/dart.js.map +1 -0
  30. package/dist/lib/assets/language-icons/elixir.d.ts +3 -0
  31. package/dist/lib/assets/language-icons/elixir.js +4 -0
  32. package/dist/lib/assets/language-icons/elixir.js.map +1 -0
  33. package/dist/lib/assets/language-icons/ocaml.d.ts +3 -0
  34. package/dist/lib/assets/language-icons/ocaml.js +4 -0
  35. package/dist/lib/assets/language-icons/ocaml.js.map +1 -0
  36. package/dist/lib/assets/language-icons/powershell.d.ts +3 -0
  37. package/dist/lib/assets/language-icons/powershell.js +4 -0
  38. package/dist/lib/assets/language-icons/powershell.js.map +1 -0
  39. package/dist/lib/assets/language-icons/scala.d.ts +3 -0
  40. package/dist/lib/assets/language-icons/scala.js +4 -0
  41. package/dist/lib/assets/language-icons/scala.js.map +1 -0
  42. package/dist/lib/assets/language-icons/zig.d.ts +3 -0
  43. package/dist/lib/assets/language-icons/zig.js +4 -0
  44. package/dist/lib/assets/language-icons/zig.js.map +1 -0
  45. package/dist/lib/authentication/authentication.d.ts +3 -0
  46. package/dist/lib/authentication/providers/auth0.js +7 -3
  47. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  48. package/dist/lib/components/Heading.js +1 -5
  49. package/dist/lib/components/Heading.js.map +1 -1
  50. package/dist/lib/components/LanguageIcon.js +45 -0
  51. package/dist/lib/components/LanguageIcon.js.map +1 -1
  52. package/dist/lib/components/Main.js +1 -1
  53. package/dist/lib/components/Main.js.map +1 -1
  54. package/dist/lib/components/cache.d.ts +3 -1
  55. package/dist/lib/components/cache.js +3 -5
  56. package/dist/lib/components/cache.js.map +1 -1
  57. package/dist/lib/components/context/ZudokuContext.js +10 -2
  58. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  59. package/dist/lib/components/index.d.ts +1 -2
  60. package/dist/lib/core/ZudokuContext.d.ts +1 -0
  61. package/dist/lib/core/ZudokuContext.js +2 -0
  62. package/dist/lib/core/ZudokuContext.js.map +1 -1
  63. package/dist/lib/hooks/index.d.ts +1 -1
  64. package/dist/lib/oas/graphql/index.js +17 -0
  65. package/dist/lib/oas/graphql/index.js.map +1 -1
  66. package/dist/lib/plugins/markdown/MdxPage.d.ts +2 -1
  67. package/dist/lib/plugins/markdown/MdxPage.js +28 -4
  68. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  69. package/dist/lib/plugins/markdown/assets/ChatGPTLogo.d.ts +2 -0
  70. package/dist/lib/plugins/markdown/assets/ChatGPTLogo.js +3 -0
  71. package/dist/lib/plugins/markdown/assets/ChatGPTLogo.js.map +1 -0
  72. package/dist/lib/plugins/markdown/assets/ClaudeLogo.d.ts +2 -0
  73. package/dist/lib/plugins/markdown/assets/ClaudeLogo.js +3 -0
  74. package/dist/lib/plugins/markdown/assets/ClaudeLogo.js.map +1 -0
  75. package/dist/lib/plugins/markdown/index.d.ts +3 -1
  76. package/dist/lib/plugins/markdown/index.js +1 -1
  77. package/dist/lib/plugins/markdown/index.js.map +1 -1
  78. package/dist/lib/plugins/openapi/OperationList.js +7 -2
  79. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  80. package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -2
  81. package/dist/lib/plugins/openapi/OperationListItem.js +6 -3
  82. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  83. package/dist/lib/plugins/openapi/Sidecar.d.ts +2 -1
  84. package/dist/lib/plugins/openapi/Sidecar.js +6 -9
  85. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  86. package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  87. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  88. package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
  89. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  90. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +8 -2
  91. package/dist/lib/plugins/openapi/graphql/graphql.js +8 -0
  92. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  93. package/dist/lib/plugins/openapi/index.js +5 -10
  94. package/dist/lib/plugins/openapi/index.js.map +1 -1
  95. package/dist/lib/plugins/openapi/playground/Playground.js +1 -1
  96. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  97. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  98. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  99. package/dist/lib/shiki.js +9 -0
  100. package/dist/lib/shiki.js.map +1 -1
  101. package/dist/lib/ui/Carousel.js.map +1 -1
  102. package/dist/lib/ui/Dialog.d.ts +12 -18
  103. package/dist/lib/ui/Dialog.js +30 -17
  104. package/dist/lib/ui/Dialog.js.map +1 -1
  105. package/dist/lib/util/pastellize.js +4 -4
  106. package/dist/lib/util/pastellize.js.map +1 -1
  107. package/dist/vite/api/SchemaManager.js.map +1 -1
  108. package/dist/vite/llms.d.ts +12 -0
  109. package/dist/vite/llms.js +66 -0
  110. package/dist/vite/llms.js.map +1 -0
  111. package/dist/vite/plugin-docs.d.ts +9 -0
  112. package/dist/vite/plugin-docs.js +68 -49
  113. package/dist/vite/plugin-docs.js.map +1 -1
  114. package/dist/vite/plugin-markdown-export.d.ts +21 -0
  115. package/dist/vite/plugin-markdown-export.js +141 -0
  116. package/dist/vite/plugin-markdown-export.js.map +1 -0
  117. package/dist/vite/plugin-navigation.js +4 -0
  118. package/dist/vite/plugin-navigation.js.map +1 -1
  119. package/dist/vite/plugin.js +2 -0
  120. package/dist/vite/plugin.js.map +1 -1
  121. package/dist/vite/prerender/prerender.js +30 -0
  122. package/dist/vite/prerender/prerender.js.map +1 -1
  123. package/lib/{Button-DTDRi4CT.js → Button-DmS4u8Lj.js} +2 -2
  124. package/lib/{Button-DTDRi4CT.js.map → Button-DmS4u8Lj.js.map} +1 -1
  125. package/lib/{Card-hTy9PAnh.js → Card-KFniaZn5.js} +2 -2
  126. package/lib/{Card-hTy9PAnh.js.map → Card-KFniaZn5.js.map} +1 -1
  127. package/lib/{CategoryHeading-BGCNu3VK.js → CategoryHeading-DhmodDcq.js} +2 -2
  128. package/lib/{CategoryHeading-BGCNu3VK.js.map → CategoryHeading-DhmodDcq.js.map} +1 -1
  129. package/lib/CodeBlock-CanTUJLl.js +221 -0
  130. package/lib/CodeBlock-CanTUJLl.js.map +1 -0
  131. package/lib/{Command-TEBTONf1.js → Command-CUcrW3qs.js} +3 -3
  132. package/lib/{Command-TEBTONf1.js.map → Command-CUcrW3qs.js.map} +1 -1
  133. package/lib/Dialog-BQciPiHN.js +144 -0
  134. package/lib/Dialog-BQciPiHN.js.map +1 -0
  135. package/lib/{Drawer-DM9wJUC6.js → Drawer-Ci7XwhqT.js} +2 -2
  136. package/lib/Drawer-Ci7XwhqT.js.map +1 -0
  137. package/lib/DropdownMenu-BZ2NKQ3K.js +126 -0
  138. package/lib/DropdownMenu-BZ2NKQ3K.js.map +1 -0
  139. package/lib/{ErrorAlert-xpVkFS_n.js → ErrorAlert-VBJ8aHH7.js} +100 -103
  140. package/lib/ErrorAlert-VBJ8aHH7.js.map +1 -0
  141. package/lib/MdxPage-1xaNI6q_.js +240 -0
  142. package/lib/MdxPage-1xaNI6q_.js.map +1 -0
  143. package/lib/{OAuthErrorPage-DCjFngGS.js → OAuthErrorPage-Du_4sFER.js} +7 -7
  144. package/lib/{OAuthErrorPage-DCjFngGS.js.map → OAuthErrorPage-Du_4sFER.js.map} +1 -1
  145. package/lib/{OasProvider-B6Co-6Vj.js → OasProvider-0xiB5cKH.js} +3 -3
  146. package/lib/{OasProvider-B6Co-6Vj.js.map → OasProvider-0xiB5cKH.js.map} +1 -1
  147. package/lib/{OperationList-uu04Ezta.js → OperationList-BzWKTkNq.js} +1328 -1319
  148. package/lib/OperationList-BzWKTkNq.js.map +1 -0
  149. package/lib/{Pagination-Cdi_qiXc.js → Pagination-DOcPyfy_.js} +3 -3
  150. package/lib/{Pagination-Cdi_qiXc.js.map → Pagination-DOcPyfy_.js.map} +1 -1
  151. package/lib/{RouteGuard-dji1UEYe.js → RouteGuard-Bg0Lu0OU.js} +5 -5
  152. package/lib/{RouteGuard-dji1UEYe.js.map → RouteGuard-Bg0Lu0OU.js.map} +1 -1
  153. package/lib/{RouterError-D1I15Qyy.js → RouterError-fm21cqlj.js} +4 -4
  154. package/lib/{RouterError-D1I15Qyy.js.map → RouterError-fm21cqlj.js.map} +1 -1
  155. package/lib/{SchemaList-BExl5RED.js → SchemaList-Dea2Skqv.js} +10 -10
  156. package/lib/{SchemaList-BExl5RED.js.map → SchemaList-Dea2Skqv.js.map} +1 -1
  157. package/lib/{SchemaView-BYH_AirG.js → SchemaView-H9glU5P7.js} +5 -5
  158. package/lib/{SchemaView-BYH_AirG.js.map → SchemaView-H9glU5P7.js.map} +1 -1
  159. package/lib/{Select-CegS9OKH.js → Select-CPoGZU_V.js} +4 -4
  160. package/lib/{Select-CegS9OKH.js.map → Select-CPoGZU_V.js.map} +1 -1
  161. package/lib/{SignUp-C-YP_Rxi.js → SignUp-DUZ4yUmQ.js} +9 -9
  162. package/lib/{SignUp-C-YP_Rxi.js.map → SignUp-DUZ4yUmQ.js.map} +1 -1
  163. package/lib/{Spinner-Cf6E803I.js → Spinner-CI6bRyZw.js} +2 -2
  164. package/lib/{Spinner-Cf6E803I.js.map → Spinner-CI6bRyZw.js.map} +1 -1
  165. package/lib/{SyntaxHighlight-CPF64UHi.js → SyntaxHighlight-B0laqAqK.js} +6 -6
  166. package/lib/{SyntaxHighlight-CPF64UHi.js.map → SyntaxHighlight-B0laqAqK.js.map} +1 -1
  167. package/lib/{Toc-Cf5UojVb.js → Toc-KzXCRqrX.js} +3 -3
  168. package/lib/{Toc-Cf5UojVb.js.map → Toc-KzXCRqrX.js.map} +1 -1
  169. package/lib/ZudokuContext-BXTZApgy.js +1506 -0
  170. package/lib/ZudokuContext-BXTZApgy.js.map +1 -0
  171. package/lib/c-B-NUhs61.js +46 -0
  172. package/lib/c-B-NUhs61.js.map +1 -0
  173. package/lib/chunk-PVWAREVJ-BO6B-RAk.js.map +1 -1
  174. package/lib/{circular-06Yrxzsw.js → circular-OGtD_zFg.js} +30 -30
  175. package/lib/{circular-06Yrxzsw.js.map → circular-OGtD_zFg.js.map} +1 -1
  176. package/lib/commonlisp-De080z23.js +28 -0
  177. package/lib/commonlisp-De080z23.js.map +1 -0
  178. package/lib/cpp-79Paht7T.js +53 -0
  179. package/lib/cpp-79Paht7T.js.map +1 -0
  180. package/lib/{createServer-BA0aitmR.js → createServer-DyUc5BPr.js} +1120 -1083
  181. package/lib/createServer-DyUc5BPr.js.map +1 -0
  182. package/lib/{csharp-rrJEDRrV.js → csharp-D8MIL50B.js} +2 -2
  183. package/lib/{csharp-rrJEDRrV.js.map → csharp-D8MIL50B.js.map} +1 -1
  184. package/lib/{css-Dpk9bCql.js → css-Bt6hr1td.js} +2 -2
  185. package/lib/{css-Dpk9bCql.js.map → css-Bt6hr1td.js.map} +1 -1
  186. package/lib/dart-B0vy1jWB.js +60 -0
  187. package/lib/dart-B0vy1jWB.js.map +1 -0
  188. package/lib/elixir-Ds8r0sF8.js +25 -0
  189. package/lib/elixir-Ds8r0sF8.js.map +1 -0
  190. package/lib/{errors-ouIp07AW.js → errors-7_i0Oyw4.js} +3 -3
  191. package/lib/{errors-ouIp07AW.js.map → errors-7_i0Oyw4.js.map} +1 -1
  192. package/lib/{go-D8SJIQ0Z.js → go-D2VsmIOS.js} +2 -2
  193. package/lib/{go-D8SJIQ0Z.js.map → go-D2VsmIOS.js.map} +1 -1
  194. package/lib/{graphql-aeVKJNa2.js → graphql-BtA6M4m5.js} +2 -2
  195. package/lib/{graphql-aeVKJNa2.js.map → graphql-BtA6M4m5.js.map} +1 -1
  196. package/lib/hook-CAebs2rv.js +31 -0
  197. package/lib/hook-CAebs2rv.js.map +1 -0
  198. package/lib/{html-D_7om-nA.js → html-MGnI2uzP.js} +2 -2
  199. package/lib/{html-D_7om-nA.js.map → html-MGnI2uzP.js.map} +1 -1
  200. package/lib/{index-DhL3LhWV.js → index-C5L4favO.js} +166 -50
  201. package/lib/index-C5L4favO.js.map +1 -0
  202. package/lib/{index-CVfG8Pb4.js → index-CLJGtw_S.js} +157 -156
  203. package/lib/index-CLJGtw_S.js.map +1 -0
  204. package/lib/index-CrcNWbel.js.map +1 -1
  205. package/lib/{index-BRQDtecD.js → index-PdgTSEkk.js} +779 -896
  206. package/lib/index-PdgTSEkk.js.map +1 -0
  207. package/lib/index.esm-BYObtETB.js +1294 -0
  208. package/lib/index.esm-BYObtETB.js.map +1 -0
  209. package/lib/index.esm-BnYHxCYC.js.map +1 -1
  210. package/lib/{java-DUh-EL8n.js → java-CVLzHfb1.js} +2 -2
  211. package/lib/{java-DUh-EL8n.js.map → java-CVLzHfb1.js.map} +1 -1
  212. package/lib/{javascript-CrY8dcGu.js → javascript-CcmIpL4G.js} +2 -2
  213. package/lib/{javascript-CrY8dcGu.js.map → javascript-CcmIpL4G.js.map} +1 -1
  214. package/lib/{json-DLK2_sdf.js → json-4AyP4uiY.js} +2 -2
  215. package/lib/{json-DLK2_sdf.js.map → json-4AyP4uiY.js.map} +1 -1
  216. package/lib/{jsx-runtime-DywqP_6a.js → jsx-runtime-BzflLqGi.js} +109 -111
  217. package/lib/jsx-runtime-BzflLqGi.js.map +1 -0
  218. package/lib/{kotlin-rJMOGl7D.js → kotlin-v2plddBQ.js} +2 -2
  219. package/lib/{kotlin-rJMOGl7D.js.map → kotlin-v2plddBQ.js.map} +1 -1
  220. package/lib/{markdown-BD9bIU5J.js → markdown-DYGWCmGQ.js} +2 -2
  221. package/lib/{markdown-BD9bIU5J.js.map → markdown-DYGWCmGQ.js.map} +1 -1
  222. package/lib/{mdx-G25UCvf3.js → mdx-CHwYvXd4.js} +2 -2
  223. package/lib/{mdx-G25UCvf3.js.map → mdx-CHwYvXd4.js.map} +1 -1
  224. package/lib/{mutation-De-1gXxl.js → mutation-CdGPxHNX.js} +2 -2
  225. package/lib/{mutation-De-1gXxl.js.map → mutation-CdGPxHNX.js.map} +1 -1
  226. package/lib/{objectivec-DDpj0aWX.js → objectivec-HZY8shkd.js} +2 -2
  227. package/lib/{objectivec-DDpj0aWX.js.map → objectivec-HZY8shkd.js.map} +1 -1
  228. package/lib/ocaml-DqsdDdwb.js +52 -0
  229. package/lib/ocaml-DqsdDdwb.js.map +1 -0
  230. package/lib/{php-BeG18bSy.js → php-rQXzo7K_.js} +2 -2
  231. package/lib/{php-BeG18bSy.js.map → php-rQXzo7K_.js.map} +1 -1
  232. package/lib/powershell-CQje9pm1.js +39 -0
  233. package/lib/powershell-CQje9pm1.js.map +1 -0
  234. package/lib/{python-BaF2byD-.js → python-QIQAE5Ei.js} +2 -2
  235. package/lib/{python-BaF2byD-.js.map → python-QIQAE5Ei.js.map} +1 -1
  236. package/lib/{react-CQvDN20M.js → react-DHpVpxRv.js} +2 -2
  237. package/lib/{react-CQvDN20M.js.map → react-DHpVpxRv.js.map} +1 -1
  238. package/lib/{ruby-CmxRVHMR.js → ruby-B2dU8Ny5.js} +2 -2
  239. package/lib/{ruby-CmxRVHMR.js.map → ruby-B2dU8Ny5.js.map} +1 -1
  240. package/lib/{rust-IfSC62c5.js → rust-DYnLHAi2.js} +2 -2
  241. package/lib/{rust-IfSC62c5.js.map → rust-DYnLHAi2.js.map} +1 -1
  242. package/lib/scala-CeKInBR8.js +25 -0
  243. package/lib/scala-CeKInBR8.js.map +1 -0
  244. package/lib/{shell-BFu0M6m4.js → shell-HUv9oVtp.js} +2 -2
  245. package/lib/{shell-BFu0M6m4.js.map → shell-HUv9oVtp.js.map} +1 -1
  246. package/lib/{swift-DckbsN4v.js → swift-B4z6ig1Z.js} +2 -2
  247. package/lib/{swift-DckbsN4v.js.map → swift-B4z6ig1Z.js.map} +1 -1
  248. package/lib/{toml-BJsCc8TC.js → toml-Co9mpdct.js} +2 -2
  249. package/lib/{toml-BJsCc8TC.js.map → toml-Co9mpdct.js.map} +1 -1
  250. package/lib/{typescript-7qOVMjOC.js → typescript-C26xdBDC.js} +2 -2
  251. package/lib/{typescript-7qOVMjOC.js.map → typescript-C26xdBDC.js.map} +1 -1
  252. package/lib/ui/Accordion.js +1 -1
  253. package/lib/ui/ActionButton.js +3 -3
  254. package/lib/ui/Alert.js +1 -1
  255. package/lib/ui/AlertDialog.js +1 -1
  256. package/lib/ui/Badge.js +1 -1
  257. package/lib/ui/Breadcrumb.js +1 -1
  258. package/lib/ui/Button.js +1 -1
  259. package/lib/ui/Callout.js +1 -1
  260. package/lib/ui/Card.js +1 -1
  261. package/lib/ui/Carousel.js +1 -1
  262. package/lib/ui/Carousel.js.map +1 -1
  263. package/lib/ui/Checkbox.js +1 -1
  264. package/lib/ui/CodeBlock.js +2 -2
  265. package/lib/ui/Command.js +2 -2
  266. package/lib/ui/Dialog.js +135 -105
  267. package/lib/ui/Dialog.js.map +1 -1
  268. package/lib/ui/Drawer.js +2 -2
  269. package/lib/ui/DropdownMenu.js +1 -1
  270. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  271. package/lib/ui/Form.js +2 -2
  272. package/lib/ui/HoverCard.js +1 -1
  273. package/lib/ui/Input.js +1 -1
  274. package/lib/ui/Label.js +1 -1
  275. package/lib/ui/Pagination.js +1 -1
  276. package/lib/ui/Popover.js +1 -1
  277. package/lib/ui/Progress.js +1 -1
  278. package/lib/ui/RadioGroup.js +1 -1
  279. package/lib/ui/ReactComponentDoc.js +1 -1
  280. package/lib/ui/ScrollArea.js +1 -1
  281. package/lib/ui/Secret.js +1 -1
  282. package/lib/ui/Select.js +1 -1
  283. package/lib/ui/Skeleton.js +1 -1
  284. package/lib/ui/Slider.js +1 -1
  285. package/lib/ui/Stepper.js +1 -1
  286. package/lib/ui/Switch.js +1 -1
  287. package/lib/ui/SyntaxHighlight.js +4 -4
  288. package/lib/ui/Tabs.js +1 -1
  289. package/lib/ui/Textarea.js +1 -1
  290. package/lib/ui/Toggle.js +1 -1
  291. package/lib/ui/ToggleGroup.js +1 -1
  292. package/lib/ui/Tooltip.js +1 -1
  293. package/lib/ui/Value.js +1 -1
  294. package/lib/{useExposedProps-B8NHdNRq.js → useExposedProps-Cd7Yg_uG.js} +3 -3
  295. package/lib/useExposedProps-Cd7Yg_uG.js.map +1 -0
  296. package/lib/{xml-DAaTIkBX.js → xml-BQOOC04j.js} +2 -2
  297. package/lib/{xml-DAaTIkBX.js.map → xml-BQOOC04j.js.map} +1 -1
  298. package/lib/{yaml-DUi-dbfu.js → yaml-BGsJItKv.js} +2 -2
  299. package/lib/{yaml-DUi-dbfu.js.map → yaml-BGsJItKv.js.map} +1 -1
  300. package/lib/zig-CUV2sTct.js +35 -0
  301. package/lib/zig-CUV2sTct.js.map +1 -0
  302. package/lib/zudoku.__internal.js +1040 -937
  303. package/lib/zudoku.__internal.js.map +1 -1
  304. package/lib/zudoku.auth-auth0.js +22 -21
  305. package/lib/zudoku.auth-auth0.js.map +1 -1
  306. package/lib/zudoku.auth-azureb2c.js +14 -15
  307. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  308. package/lib/zudoku.auth-clerk.js +3 -3
  309. package/lib/zudoku.auth-openid.js +57 -58
  310. package/lib/zudoku.auth-openid.js.map +1 -1
  311. package/lib/zudoku.auth-supabase.js +2 -2
  312. package/lib/zudoku.components.js +6 -6
  313. package/lib/zudoku.hooks.js +6 -6
  314. package/lib/zudoku.hooks.js.map +1 -1
  315. package/lib/zudoku.icons.js +1 -1
  316. package/lib/zudoku.plugin-api-catalog.js +27 -28
  317. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  318. package/lib/zudoku.plugin-api-keys.js +89 -89
  319. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  320. package/lib/zudoku.plugin-custom-pages.js +1 -1
  321. package/lib/zudoku.plugin-markdown.js +10 -9
  322. package/lib/zudoku.plugin-markdown.js.map +1 -1
  323. package/lib/zudoku.plugin-openapi.js +6 -7
  324. package/lib/zudoku.plugin-openapi.js.map +1 -1
  325. package/lib/zudoku.plugin-search-inkeep.js +1 -1
  326. package/lib/zudoku.plugin-search-pagefind.js +27 -28
  327. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  328. package/lib/zudoku.router.js +1 -1
  329. package/lib/zudoku.router.js.map +1 -1
  330. package/package.json +40 -40
  331. package/src/app/entry.server.tsx +16 -6
  332. package/src/app/main.css +42 -0
  333. package/src/lib/assets/language-icons/c.tsx +31 -0
  334. package/src/lib/assets/language-icons/commonlisp.tsx +22 -0
  335. package/src/lib/assets/language-icons/cpp.tsx +35 -0
  336. package/src/lib/assets/language-icons/dart.tsx +39 -0
  337. package/src/lib/assets/language-icons/elixir.tsx +19 -0
  338. package/src/lib/assets/language-icons/ocaml.tsx +34 -0
  339. package/src/lib/assets/language-icons/powershell.tsx +27 -0
  340. package/src/lib/assets/language-icons/scala.tsx +19 -0
  341. package/src/lib/assets/language-icons/zig.tsx +32 -0
  342. package/src/lib/authentication/authentication.ts +3 -1
  343. package/src/lib/authentication/providers/auth0.tsx +7 -3
  344. package/src/lib/components/Heading.tsx +2 -6
  345. package/src/lib/components/LanguageIcon.tsx +45 -0
  346. package/src/lib/components/Main.tsx +1 -1
  347. package/src/lib/components/cache.ts +9 -5
  348. package/src/lib/components/context/ZudokuContext.ts +11 -2
  349. package/src/lib/core/ZudokuContext.ts +3 -0
  350. package/src/lib/oas/graphql/index.ts +19 -0
  351. package/src/lib/plugins/markdown/MdxPage.tsx +125 -8
  352. package/src/lib/plugins/markdown/assets/ChatGPTLogo.tsx +11 -0
  353. package/src/lib/plugins/markdown/assets/ClaudeLogo.tsx +19 -0
  354. package/src/lib/plugins/markdown/index.tsx +5 -7
  355. package/src/lib/plugins/openapi/OperationList.tsx +9 -2
  356. package/src/lib/plugins/openapi/OperationListItem.tsx +10 -5
  357. package/src/lib/plugins/openapi/Sidecar.tsx +8 -8
  358. package/src/lib/plugins/openapi/graphql/fragment-masking.ts +1 -0
  359. package/src/lib/plugins/openapi/graphql/gql.ts +4 -3
  360. package/src/lib/plugins/openapi/graphql/graphql.ts +20 -3
  361. package/src/lib/plugins/openapi/index.tsx +10 -30
  362. package/src/lib/plugins/openapi/playground/Playground.tsx +1 -1
  363. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  364. package/src/lib/shiki.ts +9 -0
  365. package/src/lib/ui/Carousel.tsx +0 -1
  366. package/src/lib/ui/Dialog.tsx +112 -106
  367. package/src/lib/util/pastellize.ts +4 -4
  368. package/src/shiki/langs/hurl.js +1 -0
  369. package/src/shiki/langs/kdl.js +1 -0
  370. package/src/shiki/langs/pkl.js +1 -0
  371. package/src/shiki/langs/rosmsg.js +1 -0
  372. package/lib/CodeBlock-i0BM_QFf.js +0 -176
  373. package/lib/CodeBlock-i0BM_QFf.js.map +0 -1
  374. package/lib/Dialog-VIMic7xI.js +0 -114
  375. package/lib/Dialog-VIMic7xI.js.map +0 -1
  376. package/lib/Drawer-DM9wJUC6.js.map +0 -1
  377. package/lib/ErrorAlert-xpVkFS_n.js.map +0 -1
  378. package/lib/MdxPage-Ud1w_GV-.js +0 -111
  379. package/lib/MdxPage-Ud1w_GV-.js.map +0 -1
  380. package/lib/OperationList-uu04Ezta.js.map +0 -1
  381. package/lib/ZudokuContext-BcqSiygJ.js +0 -1294
  382. package/lib/ZudokuContext-BcqSiygJ.js.map +0 -1
  383. package/lib/createServer-BA0aitmR.js.map +0 -1
  384. package/lib/hook-BkLXq8pm.js +0 -243
  385. package/lib/hook-BkLXq8pm.js.map +0 -1
  386. package/lib/index-BRQDtecD.js.map +0 -1
  387. package/lib/index-CVfG8Pb4.js.map +0 -1
  388. package/lib/index-DhL3LhWV.js.map +0 -1
  389. package/lib/index.esm-DpgNxKa2.js +0 -1267
  390. package/lib/index.esm-DpgNxKa2.js.map +0 -1
  391. package/lib/jsx-runtime-DywqP_6a.js.map +0 -1
  392. package/lib/useExposedProps-B8NHdNRq.js.map +0 -1
@@ -0,0 +1,1294 @@
1
+ import m from "react";
2
+ var he = (t) => t.type === "checkbox", le = (t) => t instanceof Date, j = (t) => t == null;
3
+ const gt = (t) => typeof t == "object";
4
+ var I = (t) => !j(t) && !Array.isArray(t) && gt(t) && !le(t), ht = (t) => I(t) && t.target ? he(t.target) ? t.target.checked : t.target.value : t, Lt = (t) => t.substring(0, t.search(/\.\d+(\.|$)/)) || t, mt = (t, r) => t.has(Lt(r)), Nt = (t) => {
5
+ const r = t.constructor && t.constructor.prototype;
6
+ return I(r) && r.hasOwnProperty("isPrototypeOf");
7
+ }, je = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
8
+ function T(t) {
9
+ let r;
10
+ const e = Array.isArray(t), s = typeof FileList < "u" ? t instanceof FileList : !1;
11
+ if (t instanceof Date)
12
+ r = new Date(t);
13
+ else if (!(je && (t instanceof Blob || s)) && (e || I(t)))
14
+ if (r = e ? [] : Object.create(Object.getPrototypeOf(t)), !e && !Nt(t))
15
+ r = t;
16
+ else
17
+ for (const l in t)
18
+ t.hasOwnProperty(l) && (r[l] = T(t[l]));
19
+ else
20
+ return t;
21
+ return r;
22
+ }
23
+ var Ae = (t) => /^\w*$/.test(t), U = (t) => t === void 0, xe = (t) => Array.isArray(t) ? t.filter(Boolean) : [], Ke = (t) => xe(t.replace(/["|']|\]/g, "").split(/\.|\[/)), f = (t, r, e) => {
24
+ if (!r || !I(t))
25
+ return e;
26
+ const s = (Ae(r) ? [r] : Ke(r)).reduce((l, n) => j(l) ? l : l[n], t);
27
+ return U(s) || s === t ? U(t[r]) ? e : t[r] : s;
28
+ }, G = (t) => typeof t == "boolean", R = (t, r, e) => {
29
+ let s = -1;
30
+ const l = Ae(r) ? [r] : Ke(r), n = l.length, d = n - 1;
31
+ for (; ++s < n; ) {
32
+ const c = l[s];
33
+ let w = e;
34
+ if (s !== d) {
35
+ const x = t[c];
36
+ w = I(x) || Array.isArray(x) ? x : isNaN(+l[s + 1]) ? {} : [];
37
+ }
38
+ if (c === "__proto__" || c === "constructor" || c === "prototype")
39
+ return;
40
+ t[c] = w, t = t[c];
41
+ }
42
+ };
43
+ const be = {
44
+ BLUR: "blur",
45
+ FOCUS_OUT: "focusout",
46
+ CHANGE: "change"
47
+ }, Z = {
48
+ onBlur: "onBlur",
49
+ onChange: "onChange",
50
+ onSubmit: "onSubmit",
51
+ onTouched: "onTouched",
52
+ all: "all"
53
+ }, ie = {
54
+ max: "max",
55
+ min: "min",
56
+ maxLength: "maxLength",
57
+ minLength: "minLength",
58
+ pattern: "pattern",
59
+ required: "required",
60
+ validate: "validate"
61
+ }, ze = m.createContext(null);
62
+ ze.displayName = "HookFormContext";
63
+ const pe = () => m.useContext(ze), ir = (t) => {
64
+ const { children: r, ...e } = t;
65
+ return m.createElement(ze.Provider, { value: e }, r);
66
+ };
67
+ var vt = (t, r, e, s = !0) => {
68
+ const l = {
69
+ defaultValues: r._defaultValues
70
+ };
71
+ for (const n in t)
72
+ Object.defineProperty(l, n, {
73
+ get: () => {
74
+ const d = n;
75
+ return r._proxyFormState[d] !== Z.all && (r._proxyFormState[d] = !s || Z.all), e && (e[d] = !0), t[d];
76
+ }
77
+ });
78
+ return l;
79
+ };
80
+ const we = typeof window < "u" ? m.useLayoutEffect : m.useEffect;
81
+ function It(t) {
82
+ const r = pe(), { control: e = r.control, disabled: s, name: l, exact: n } = t || {}, [d, c] = m.useState(e._formState), w = m.useRef({
83
+ isDirty: !1,
84
+ isLoading: !1,
85
+ dirtyFields: !1,
86
+ touchedFields: !1,
87
+ validatingFields: !1,
88
+ isValidating: !1,
89
+ isValid: !1,
90
+ errors: !1
91
+ });
92
+ return we(() => e._subscribe({
93
+ name: l,
94
+ formState: w.current,
95
+ exact: n,
96
+ callback: (x) => {
97
+ !s && c({
98
+ ...e._formState,
99
+ ...x
100
+ });
101
+ }
102
+ }), [l, s, n]), m.useEffect(() => {
103
+ w.current.isValid && e._setValid(!0);
104
+ }, [e]), m.useMemo(() => vt(d, e, w.current, !1), [d, e]);
105
+ }
106
+ var Y = (t) => typeof t == "string", Pe = (t, r, e, s, l) => Y(t) ? (s && r.watch.add(t), f(e, t, l)) : Array.isArray(t) ? t.map((n) => (s && r.watch.add(n), f(e, n))) : (s && (r.watchAll = !0), e), We = (t) => j(t) || !gt(t);
107
+ function ee(t, r, e = /* @__PURE__ */ new WeakSet()) {
108
+ if (We(t) || We(r))
109
+ return t === r;
110
+ if (le(t) && le(r))
111
+ return t.getTime() === r.getTime();
112
+ const s = Object.keys(t), l = Object.keys(r);
113
+ if (s.length !== l.length)
114
+ return !1;
115
+ if (e.has(t) || e.has(r))
116
+ return !0;
117
+ e.add(t), e.add(r);
118
+ for (const n of s) {
119
+ const d = t[n];
120
+ if (!l.includes(n))
121
+ return !1;
122
+ if (n !== "ref") {
123
+ const c = r[n];
124
+ if (le(d) && le(c) || I(d) && I(c) || Array.isArray(d) && Array.isArray(c) ? !ee(d, c, e) : d !== c)
125
+ return !1;
126
+ }
127
+ }
128
+ return !0;
129
+ }
130
+ function Bt(t) {
131
+ const r = pe(), { control: e = r.control, name: s, defaultValue: l, disabled: n, exact: d, compute: c } = t || {}, w = m.useRef(l), x = m.useRef(c), A = m.useRef(void 0), b = m.useRef(e), F = m.useRef(s);
132
+ x.current = c;
133
+ const [J, P] = m.useState(() => {
134
+ const g = e._getWatch(s, w.current);
135
+ return x.current ? x.current(g) : g;
136
+ }), O = m.useCallback((g) => {
137
+ const y = Pe(s, e._names, g || e._formValues, !1, w.current);
138
+ return x.current ? x.current(y) : y;
139
+ }, [e._formValues, e._names, s]), B = m.useCallback((g) => {
140
+ if (!n) {
141
+ const y = Pe(s, e._names, g || e._formValues, !1, w.current);
142
+ if (x.current) {
143
+ const V = x.current(y);
144
+ ee(V, A.current) || (P(V), A.current = V);
145
+ } else
146
+ P(y);
147
+ }
148
+ }, [e._formValues, e._names, n, s]);
149
+ we(() => ((b.current !== e || !ee(F.current, s)) && (b.current = e, F.current = s, B()), e._subscribe({
150
+ name: s,
151
+ formState: {
152
+ values: !0
153
+ },
154
+ exact: d,
155
+ callback: (g) => {
156
+ B(g.values);
157
+ }
158
+ })), [e, d, s, B]), m.useEffect(() => e._removeUnmounted());
159
+ const Q = b.current !== e, p = F.current, E = m.useMemo(() => {
160
+ if (n)
161
+ return null;
162
+ const g = !Q && !ee(p, s);
163
+ return Q || g ? O() : null;
164
+ }, [n, Q, s, p, O]);
165
+ return E !== null ? E : J;
166
+ }
167
+ function Pt(t) {
168
+ const r = pe(), { name: e, disabled: s, control: l = r.control, shouldUnregister: n, defaultValue: d } = t, c = mt(l._names.array, e), w = m.useMemo(() => f(l._formValues, e, f(l._defaultValues, e, d)), [l, e, d]), x = Bt({
169
+ control: l,
170
+ name: e,
171
+ defaultValue: w,
172
+ exact: !0
173
+ }), A = It({
174
+ control: l,
175
+ name: e,
176
+ exact: !0
177
+ }), b = m.useRef(t), F = m.useRef(void 0), J = m.useRef(l.register(e, {
178
+ ...t.rules,
179
+ value: x,
180
+ ...G(t.disabled) ? { disabled: t.disabled } : {}
181
+ }));
182
+ b.current = t;
183
+ const P = m.useMemo(() => Object.defineProperties({}, {
184
+ invalid: {
185
+ enumerable: !0,
186
+ get: () => !!f(A.errors, e)
187
+ },
188
+ isDirty: {
189
+ enumerable: !0,
190
+ get: () => !!f(A.dirtyFields, e)
191
+ },
192
+ isTouched: {
193
+ enumerable: !0,
194
+ get: () => !!f(A.touchedFields, e)
195
+ },
196
+ isValidating: {
197
+ enumerable: !0,
198
+ get: () => !!f(A.validatingFields, e)
199
+ },
200
+ error: {
201
+ enumerable: !0,
202
+ get: () => f(A.errors, e)
203
+ }
204
+ }), [A, e]), O = m.useCallback((E) => J.current.onChange({
205
+ target: {
206
+ value: ht(E),
207
+ name: e
208
+ },
209
+ type: be.CHANGE
210
+ }), [e]), B = m.useCallback(() => J.current.onBlur({
211
+ target: {
212
+ value: f(l._formValues, e),
213
+ name: e
214
+ },
215
+ type: be.BLUR
216
+ }), [e, l._formValues]), Q = m.useCallback((E) => {
217
+ const g = f(l._fields, e);
218
+ g && E && (g._f.ref = {
219
+ focus: () => E.focus && E.focus(),
220
+ select: () => E.select && E.select(),
221
+ setCustomValidity: (y) => E.setCustomValidity(y),
222
+ reportValidity: () => E.reportValidity()
223
+ });
224
+ }, [l._fields, e]), p = m.useMemo(() => ({
225
+ name: e,
226
+ value: x,
227
+ ...G(s) || A.disabled ? { disabled: A.disabled || s } : {},
228
+ onChange: O,
229
+ onBlur: B,
230
+ ref: Q
231
+ }), [e, s, A.disabled, O, B, Q, x]);
232
+ return m.useEffect(() => {
233
+ const E = l._options.shouldUnregister || n, g = F.current;
234
+ g && g !== e && !c && l.unregister(g), l.register(e, {
235
+ ...b.current.rules,
236
+ ...G(b.current.disabled) ? { disabled: b.current.disabled } : {}
237
+ });
238
+ const y = (V, S) => {
239
+ const z = f(l._fields, V);
240
+ z && z._f && (z._f.mount = S);
241
+ };
242
+ if (y(e, !0), E) {
243
+ const V = T(f(l._options.defaultValues, e, b.current.defaultValue));
244
+ R(l._defaultValues, e, V), U(f(l._formValues, e)) && R(l._formValues, e, V);
245
+ }
246
+ return !c && l.register(e), F.current = e, () => {
247
+ (c ? E && !l._state.action : E) ? l.unregister(e) : y(e, !1);
248
+ };
249
+ }, [e, l, c, n]), m.useEffect(() => {
250
+ l._setDisabledField({
251
+ disabled: s,
252
+ name: e
253
+ });
254
+ }, [s, e, l]), m.useMemo(() => ({
255
+ field: p,
256
+ formState: A,
257
+ fieldState: P
258
+ }), [p, A, P]);
259
+ }
260
+ const ar = (t) => t.render(Pt(t));
261
+ var Wt = (t, r, e, s, l) => r ? {
262
+ ...e[t],
263
+ types: {
264
+ ...e[t] && e[t].types ? e[t].types : {},
265
+ [s]: l || !0
266
+ }
267
+ } : {}, K = (t) => Array.isArray(t) ? t : [t], nt = () => {
268
+ let t = [];
269
+ return {
270
+ get observers() {
271
+ return t;
272
+ },
273
+ next: (l) => {
274
+ for (const n of t)
275
+ n.next && n.next(l);
276
+ },
277
+ subscribe: (l) => (t.push(l), {
278
+ unsubscribe: () => {
279
+ t = t.filter((n) => n !== l);
280
+ }
281
+ }),
282
+ unsubscribe: () => {
283
+ t = [];
284
+ }
285
+ };
286
+ };
287
+ function bt(t, r) {
288
+ const e = {};
289
+ for (const s in t)
290
+ if (t.hasOwnProperty(s)) {
291
+ const l = t[s], n = r[s];
292
+ if (l && I(l) && n) {
293
+ const d = bt(l, n);
294
+ I(d) && (e[s] = d);
295
+ } else t[s] && (e[s] = n);
296
+ }
297
+ return e;
298
+ }
299
+ var W = (t) => I(t) && !Object.keys(t).length, Ge = (t) => t.type === "file", te = (t) => typeof t == "function", Ve = (t) => {
300
+ if (!je)
301
+ return !1;
302
+ const r = t ? t.ownerDocument : 0;
303
+ return t instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
304
+ }, Vt = (t) => t.type === "select-multiple", Ye = (t) => t.type === "radio", qt = (t) => Ye(t) || he(t), Re = (t) => Ve(t) && t.isConnected;
305
+ function Ht(t, r) {
306
+ const e = r.slice(0, -1).length;
307
+ let s = 0;
308
+ for (; s < e; )
309
+ t = U(t) ? s++ : t[r[s++]];
310
+ return t;
311
+ }
312
+ function $t(t) {
313
+ for (const r in t)
314
+ if (t.hasOwnProperty(r) && !U(t[r]))
315
+ return !1;
316
+ return !0;
317
+ }
318
+ function N(t, r) {
319
+ const e = Array.isArray(r) ? r : Ae(r) ? [r] : Ke(r), s = e.length === 1 ? t : Ht(t, e), l = e.length - 1, n = e[l];
320
+ return s && delete s[n], l !== 0 && (I(s) && W(s) || Array.isArray(s) && $t(s)) && N(t, e.slice(0, -1)), t;
321
+ }
322
+ var jt = (t) => {
323
+ for (const r in t)
324
+ if (te(t[r]))
325
+ return !0;
326
+ return !1;
327
+ };
328
+ function Ft(t) {
329
+ return Array.isArray(t) || I(t) && !jt(t);
330
+ }
331
+ function qe(t, r = {}) {
332
+ for (const e in t)
333
+ Ft(t[e]) ? (r[e] = Array.isArray(t[e]) ? [] : {}, qe(t[e], r[e])) : U(t[e]) || (r[e] = !0);
334
+ return r;
335
+ }
336
+ function de(t, r, e) {
337
+ e || (e = qe(r));
338
+ for (const s in t)
339
+ Ft(t[s]) ? U(r) || We(e[s]) ? e[s] = qe(t[s], Array.isArray(t[s]) ? [] : {}) : de(t[s], j(r) ? {} : r[s], e[s]) : e[s] = !ee(t[s], r[s]);
340
+ return e;
341
+ }
342
+ const ut = {
343
+ value: !1,
344
+ isValid: !1
345
+ }, lt = { value: !0, isValid: !0 };
346
+ var At = (t) => {
347
+ if (Array.isArray(t)) {
348
+ if (t.length > 1) {
349
+ const r = t.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
350
+ return { value: r, isValid: !!r.length };
351
+ }
352
+ return t[0].checked && !t[0].disabled ? (
353
+ // @ts-expect-error expected to work in the browser
354
+ t[0].attributes && !U(t[0].attributes.value) ? U(t[0].value) || t[0].value === "" ? lt : { value: t[0].value, isValid: !0 } : lt
355
+ ) : ut;
356
+ }
357
+ return ut;
358
+ }, xt = (t, { valueAsNumber: r, valueAsDate: e, setValueAs: s }) => U(t) ? t : r ? t === "" ? NaN : t && +t : e && Y(t) ? new Date(t) : s ? s(t) : t;
359
+ const ot = {
360
+ isValid: !1,
361
+ value: null
362
+ };
363
+ var pt = (t) => Array.isArray(t) ? t.reduce((r, e) => e && e.checked && !e.disabled ? {
364
+ isValid: !0,
365
+ value: e.value
366
+ } : r, ot) : ot;
367
+ function ct(t) {
368
+ const r = t.ref;
369
+ return Ge(r) ? r.files : Ye(r) ? pt(t.refs).value : Vt(r) ? [...r.selectedOptions].map(({ value: e }) => e) : he(r) ? At(t.refs).value : xt(U(r.value) ? t.ref.value : r.value, t);
370
+ }
371
+ var Kt = (t, r, e, s) => {
372
+ const l = {};
373
+ for (const n of t) {
374
+ const d = f(r, n);
375
+ d && R(l, n, d._f);
376
+ }
377
+ return {
378
+ criteriaMode: e,
379
+ names: [...t],
380
+ fields: l,
381
+ shouldUseNativeValidation: s
382
+ };
383
+ }, Fe = (t) => t instanceof RegExp, ge = (t) => U(t) ? t : Fe(t) ? t.source : I(t) ? Fe(t.value) ? t.value.source : t.value : t, fe = (t) => ({
384
+ isOnSubmit: !t || t === Z.onSubmit,
385
+ isOnBlur: t === Z.onBlur,
386
+ isOnChange: t === Z.onChange,
387
+ isOnAll: t === Z.all,
388
+ isOnTouch: t === Z.onTouched
389
+ });
390
+ const dt = "AsyncFunction";
391
+ var zt = (t) => !!t && !!t.validate && !!(te(t.validate) && t.validate.constructor.name === dt || I(t.validate) && Object.values(t.validate).find((r) => r.constructor.name === dt)), Gt = (t) => t.mount && (t.required || t.min || t.max || t.maxLength || t.minLength || t.pattern || t.validate), He = (t, r, e) => !e && (r.watchAll || r.watch.has(t) || [...r.watch].some((s) => t.startsWith(s) && /^\.\w+/.test(t.slice(s.length))));
392
+ const ye = (t, r, e, s) => {
393
+ for (const l of e || Object.keys(t)) {
394
+ const n = f(t, l);
395
+ if (n) {
396
+ const { _f: d, ...c } = n;
397
+ if (d) {
398
+ if (d.refs && d.refs[0] && r(d.refs[0], l) && !s)
399
+ return !0;
400
+ if (d.ref && r(d.ref, d.name) && !s)
401
+ return !0;
402
+ if (ye(c, r))
403
+ break;
404
+ } else if (I(c) && ye(c, r))
405
+ break;
406
+ }
407
+ }
408
+ };
409
+ function ft(t, r, e) {
410
+ const s = f(t, e);
411
+ if (s || Ae(e))
412
+ return {
413
+ error: s,
414
+ name: e
415
+ };
416
+ const l = e.split(".");
417
+ for (; l.length; ) {
418
+ const n = l.join("."), d = f(r, n), c = f(t, n);
419
+ if (d && !Array.isArray(d) && e !== n)
420
+ return { name: e };
421
+ if (c && c.type)
422
+ return {
423
+ name: n,
424
+ error: c
425
+ };
426
+ if (c && c.root && c.root.type)
427
+ return {
428
+ name: `${n}.root`,
429
+ error: c.root
430
+ };
431
+ l.pop();
432
+ }
433
+ return {
434
+ name: e
435
+ };
436
+ }
437
+ var Yt = (t, r, e, s) => {
438
+ e(t);
439
+ const { name: l, ...n } = t;
440
+ return W(n) || Object.keys(n).length >= Object.keys(r).length || Object.keys(n).find((d) => r[d] === (!s || Z.all));
441
+ }, Jt = (t, r, e) => !t || !r || t === r || K(t).some((s) => s && (e ? s === r : s.startsWith(r) || r.startsWith(s))), Qt = (t, r, e, s, l) => l.isOnAll ? !1 : !e && l.isOnTouch ? !(r || t) : (e ? s.isOnBlur : l.isOnBlur) ? !t : (e ? s.isOnChange : l.isOnChange) ? t : !0, Xt = (t, r) => !xe(f(t, r)).length && N(t, r), wt = (t, r, e) => {
442
+ const s = K(f(t, e));
443
+ return R(s, "root", r[e]), R(t, e, s), t;
444
+ };
445
+ function yt(t, r, e = "validate") {
446
+ if (Y(t) || Array.isArray(t) && t.every(Y) || G(t) && !t)
447
+ return {
448
+ type: e,
449
+ message: Y(t) ? t : "",
450
+ ref: r
451
+ };
452
+ }
453
+ var ce = (t) => I(t) && !Fe(t) ? t : {
454
+ value: t,
455
+ message: ""
456
+ }, $e = async (t, r, e, s, l, n) => {
457
+ const { ref: d, refs: c, required: w, maxLength: x, minLength: A, min: b, max: F, pattern: J, validate: P, name: O, valueAsNumber: B, mount: Q } = t._f, p = f(e, O);
458
+ if (!Q || r.has(O))
459
+ return {};
460
+ const E = c ? c[0] : d, g = (k) => {
461
+ l && E.reportValidity && (E.setCustomValidity(G(k) ? "" : k || ""), E.reportValidity());
462
+ }, y = {}, V = Ye(d), S = he(d), z = V || S, H = (B || Ge(d)) && U(d.value) && U(p) || Ve(d) && d.value === "" || p === "" || Array.isArray(p) && !p.length, ue = Wt.bind(null, O, s, y), re = (k, C, L, q = ie.maxLength, $ = ie.minLength) => {
463
+ const se = k ? C : L;
464
+ y[O] = {
465
+ type: k ? q : $,
466
+ message: se,
467
+ ref: d,
468
+ ...ue(k ? q : $, se)
469
+ };
470
+ };
471
+ if (n ? !Array.isArray(p) || !p.length : w && (!z && (H || j(p)) || G(p) && !p || S && !At(c).isValid || V && !pt(c).isValid)) {
472
+ const { value: k, message: C } = Y(w) ? { value: !!w, message: w } : ce(w);
473
+ if (k && (y[O] = {
474
+ type: ie.required,
475
+ message: C,
476
+ ref: E,
477
+ ...ue(ie.required, C)
478
+ }, !s))
479
+ return g(C), y;
480
+ }
481
+ if (!H && (!j(b) || !j(F))) {
482
+ let k, C;
483
+ const L = ce(F), q = ce(b);
484
+ if (!j(p) && !isNaN(p)) {
485
+ const $ = d.valueAsNumber || p && +p;
486
+ j(L.value) || (k = $ > L.value), j(q.value) || (C = $ < q.value);
487
+ } else {
488
+ const $ = d.valueAsDate || new Date(p), se = (me) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + me), _e = d.type == "time", oe = d.type == "week";
489
+ Y(L.value) && p && (k = _e ? se(p) > se(L.value) : oe ? p > L.value : $ > new Date(L.value)), Y(q.value) && p && (C = _e ? se(p) < se(q.value) : oe ? p < q.value : $ < new Date(q.value));
490
+ }
491
+ if ((k || C) && (re(!!k, L.message, q.message, ie.max, ie.min), !s))
492
+ return g(y[O].message), y;
493
+ }
494
+ if ((x || A) && !H && (Y(p) || n && Array.isArray(p))) {
495
+ const k = ce(x), C = ce(A), L = !j(k.value) && p.length > +k.value, q = !j(C.value) && p.length < +C.value;
496
+ if ((L || q) && (re(L, k.message, C.message), !s))
497
+ return g(y[O].message), y;
498
+ }
499
+ if (J && !H && Y(p)) {
500
+ const { value: k, message: C } = ce(J);
501
+ if (Fe(k) && !p.match(k) && (y[O] = {
502
+ type: ie.pattern,
503
+ message: C,
504
+ ref: d,
505
+ ...ue(ie.pattern, C)
506
+ }, !s))
507
+ return g(C), y;
508
+ }
509
+ if (P) {
510
+ if (te(P)) {
511
+ const k = await P(p, e), C = yt(k, E);
512
+ if (C && (y[O] = {
513
+ ...C,
514
+ ...ue(ie.validate, C.message)
515
+ }, !s))
516
+ return g(C.message), y;
517
+ } else if (I(P)) {
518
+ let k = {};
519
+ for (const C in P) {
520
+ if (!W(k) && !s)
521
+ break;
522
+ const L = yt(await P[C](p, e), E, C);
523
+ L && (k = {
524
+ ...L,
525
+ ...ue(C, L.message)
526
+ }, g(L.message), s && (y[O] = k));
527
+ }
528
+ if (!W(k) && (y[O] = {
529
+ ref: E,
530
+ ...k
531
+ }, !s))
532
+ return y;
533
+ }
534
+ }
535
+ return g(!0), y;
536
+ };
537
+ const Zt = {
538
+ mode: Z.onSubmit,
539
+ reValidateMode: Z.onChange,
540
+ shouldFocusError: !0
541
+ };
542
+ function er(t = {}) {
543
+ let r = {
544
+ ...Zt,
545
+ ...t
546
+ }, e = {
547
+ submitCount: 0,
548
+ isDirty: !1,
549
+ isReady: !1,
550
+ isLoading: te(r.defaultValues),
551
+ isValidating: !1,
552
+ isSubmitted: !1,
553
+ isSubmitting: !1,
554
+ isSubmitSuccessful: !1,
555
+ isValid: !1,
556
+ touchedFields: {},
557
+ dirtyFields: {},
558
+ validatingFields: {},
559
+ errors: r.errors || {},
560
+ disabled: r.disabled || !1
561
+ }, s = {}, l = I(r.defaultValues) || I(r.values) ? T(r.defaultValues || r.values) || {} : {}, n = r.shouldUnregister ? {} : T(l), d = {
562
+ action: !1,
563
+ mount: !1,
564
+ watch: !1
565
+ }, c = {
566
+ mount: /* @__PURE__ */ new Set(),
567
+ disabled: /* @__PURE__ */ new Set(),
568
+ unMount: /* @__PURE__ */ new Set(),
569
+ array: /* @__PURE__ */ new Set(),
570
+ watch: /* @__PURE__ */ new Set()
571
+ }, w, x = 0;
572
+ const A = {
573
+ isDirty: !1,
574
+ dirtyFields: !1,
575
+ validatingFields: !1,
576
+ touchedFields: !1,
577
+ isValidating: !1,
578
+ isValid: !1,
579
+ errors: !1
580
+ };
581
+ let b = {
582
+ ...A
583
+ };
584
+ const F = {
585
+ array: nt(),
586
+ state: nt()
587
+ }, J = r.criteriaMode === Z.all, P = (i) => (a) => {
588
+ clearTimeout(x), x = setTimeout(i, a);
589
+ }, O = async (i) => {
590
+ if (!r.disabled && (A.isValid || b.isValid || i)) {
591
+ const a = r.resolver ? W((await S()).errors) : await H(s, !0);
592
+ a !== e.isValid && F.state.next({
593
+ isValid: a
594
+ });
595
+ }
596
+ }, B = (i, a) => {
597
+ !r.disabled && (A.isValidating || A.validatingFields || b.isValidating || b.validatingFields) && ((i || Array.from(c.mount)).forEach((u) => {
598
+ u && (a ? R(e.validatingFields, u, a) : N(e.validatingFields, u));
599
+ }), F.state.next({
600
+ validatingFields: e.validatingFields,
601
+ isValidating: !W(e.validatingFields)
602
+ }));
603
+ }, Q = (i, a = [], u, h, _ = !0, o = !0) => {
604
+ if (h && u && !r.disabled) {
605
+ if (d.action = !0, o && Array.isArray(f(s, i))) {
606
+ const v = u(f(s, i), h.argA, h.argB);
607
+ _ && R(s, i, v);
608
+ }
609
+ if (o && Array.isArray(f(e.errors, i))) {
610
+ const v = u(f(e.errors, i), h.argA, h.argB);
611
+ _ && R(e.errors, i, v), Xt(e.errors, i);
612
+ }
613
+ if ((A.touchedFields || b.touchedFields) && o && Array.isArray(f(e.touchedFields, i))) {
614
+ const v = u(f(e.touchedFields, i), h.argA, h.argB);
615
+ _ && R(e.touchedFields, i, v);
616
+ }
617
+ (A.dirtyFields || b.dirtyFields) && (e.dirtyFields = de(l, n)), F.state.next({
618
+ name: i,
619
+ isDirty: re(i, a),
620
+ dirtyFields: e.dirtyFields,
621
+ errors: e.errors,
622
+ isValid: e.isValid
623
+ });
624
+ } else
625
+ R(n, i, a);
626
+ }, p = (i, a) => {
627
+ R(e.errors, i, a), F.state.next({
628
+ errors: e.errors
629
+ });
630
+ }, E = (i) => {
631
+ e.errors = i, F.state.next({
632
+ errors: e.errors,
633
+ isValid: !1
634
+ });
635
+ }, g = (i, a, u, h) => {
636
+ const _ = f(s, i);
637
+ if (_) {
638
+ const o = f(n, i, U(u) ? f(l, i) : u);
639
+ U(o) || h && h.defaultChecked || a ? R(n, i, a ? o : ct(_._f)) : L(i, o), d.mount && O();
640
+ }
641
+ }, y = (i, a, u, h, _) => {
642
+ let o = !1, v = !1;
643
+ const D = {
644
+ name: i
645
+ };
646
+ if (!r.disabled) {
647
+ if (!u || h) {
648
+ (A.isDirty || b.isDirty) && (v = e.isDirty, e.isDirty = D.isDirty = re(), o = v !== D.isDirty);
649
+ const M = ee(f(l, i), a);
650
+ v = !!f(e.dirtyFields, i), M ? N(e.dirtyFields, i) : R(e.dirtyFields, i, !0), D.dirtyFields = e.dirtyFields, o = o || (A.dirtyFields || b.dirtyFields) && v !== !M;
651
+ }
652
+ if (u) {
653
+ const M = f(e.touchedFields, i);
654
+ M || (R(e.touchedFields, i, u), D.touchedFields = e.touchedFields, o = o || (A.touchedFields || b.touchedFields) && M !== u);
655
+ }
656
+ o && _ && F.state.next(D);
657
+ }
658
+ return o ? D : {};
659
+ }, V = (i, a, u, h) => {
660
+ const _ = f(e.errors, i), o = (A.isValid || b.isValid) && G(a) && e.isValid !== a;
661
+ if (r.delayError && u ? (w = P(() => p(i, u)), w(r.delayError)) : (clearTimeout(x), w = null, u ? R(e.errors, i, u) : N(e.errors, i)), (u ? !ee(_, u) : _) || !W(h) || o) {
662
+ const v = {
663
+ ...h,
664
+ ...o && G(a) ? { isValid: a } : {},
665
+ errors: e.errors,
666
+ name: i
667
+ };
668
+ e = {
669
+ ...e,
670
+ ...v
671
+ }, F.state.next(v);
672
+ }
673
+ }, S = async (i) => {
674
+ B(i, !0);
675
+ const a = await r.resolver(n, r.context, Kt(i || c.mount, s, r.criteriaMode, r.shouldUseNativeValidation));
676
+ return B(i), a;
677
+ }, z = async (i) => {
678
+ const { errors: a } = await S(i);
679
+ if (i)
680
+ for (const u of i) {
681
+ const h = f(a, u);
682
+ h ? R(e.errors, u, h) : N(e.errors, u);
683
+ }
684
+ else
685
+ e.errors = a;
686
+ return a;
687
+ }, H = async (i, a, u = {
688
+ valid: !0
689
+ }) => {
690
+ for (const h in i) {
691
+ const _ = i[h];
692
+ if (_) {
693
+ const { _f: o, ...v } = _;
694
+ if (o) {
695
+ const D = c.array.has(o.name), M = _._f && zt(_._f);
696
+ M && A.validatingFields && B([o.name], !0);
697
+ const X = await $e(_, c.disabled, n, J, r.shouldUseNativeValidation && !a, D);
698
+ if (M && A.validatingFields && B([o.name]), X[o.name] && (u.valid = !1, a))
699
+ break;
700
+ !a && (f(X, o.name) ? D ? wt(e.errors, X, o.name) : R(e.errors, o.name, X[o.name]) : N(e.errors, o.name));
701
+ }
702
+ !W(v) && await H(v, a, u);
703
+ }
704
+ }
705
+ return u.valid;
706
+ }, ue = () => {
707
+ for (const i of c.unMount) {
708
+ const a = f(s, i);
709
+ a && (a._f.refs ? a._f.refs.every((u) => !Re(u)) : !Re(a._f.ref)) && ke(i);
710
+ }
711
+ c.unMount = /* @__PURE__ */ new Set();
712
+ }, re = (i, a) => !r.disabled && (i && a && R(n, i, a), !ee(me(), l)), k = (i, a, u) => Pe(i, c, {
713
+ ...d.mount ? n : U(a) ? l : Y(i) ? { [i]: a } : a
714
+ }, u, a), C = (i) => xe(f(d.mount ? n : l, i, r.shouldUnregister ? f(l, i, []) : [])), L = (i, a, u = {}) => {
715
+ const h = f(s, i);
716
+ let _ = a;
717
+ if (h) {
718
+ const o = h._f;
719
+ o && (!o.disabled && R(n, i, xt(a, o)), _ = Ve(o.ref) && j(a) ? "" : a, Vt(o.ref) ? [...o.ref.options].forEach((v) => v.selected = _.includes(v.value)) : o.refs ? he(o.ref) ? o.refs.forEach((v) => {
720
+ (!v.defaultChecked || !v.disabled) && (Array.isArray(_) ? v.checked = !!_.find((D) => D === v.value) : v.checked = _ === v.value || !!_);
721
+ }) : o.refs.forEach((v) => v.checked = v.value === _) : Ge(o.ref) ? o.ref.value = "" : (o.ref.value = _, o.ref.type || F.state.next({
722
+ name: i,
723
+ values: T(n)
724
+ })));
725
+ }
726
+ (u.shouldDirty || u.shouldTouch) && y(i, _, u.shouldTouch, u.shouldDirty, !0), u.shouldValidate && oe(i);
727
+ }, q = (i, a, u) => {
728
+ for (const h in a) {
729
+ if (!a.hasOwnProperty(h))
730
+ return;
731
+ const _ = a[h], o = i + "." + h, v = f(s, o);
732
+ (c.array.has(i) || I(_) || v && !v._f) && !le(_) ? q(o, _, u) : L(o, _, u);
733
+ }
734
+ }, $ = (i, a, u = {}) => {
735
+ const h = f(s, i), _ = c.array.has(i), o = T(a);
736
+ R(n, i, o), _ ? (F.array.next({
737
+ name: i,
738
+ values: T(n)
739
+ }), (A.isDirty || A.dirtyFields || b.isDirty || b.dirtyFields) && u.shouldDirty && F.state.next({
740
+ name: i,
741
+ dirtyFields: de(l, n),
742
+ isDirty: re(i, o)
743
+ })) : h && !h._f && !j(o) ? q(i, o, u) : L(i, o, u), He(i, c) && F.state.next({ ...e, name: i }), F.state.next({
744
+ name: d.mount ? i : void 0,
745
+ values: T(n)
746
+ });
747
+ }, se = async (i) => {
748
+ d.mount = !0;
749
+ const a = i.target;
750
+ let u = a.name, h = !0;
751
+ const _ = f(s, u), o = (M) => {
752
+ h = Number.isNaN(M) || le(M) && isNaN(M.getTime()) || ee(M, f(n, u, M));
753
+ }, v = fe(r.mode), D = fe(r.reValidateMode);
754
+ if (_) {
755
+ let M, X;
756
+ const ve = a.type ? ct(_._f) : ht(i), ae = i.type === be.BLUR || i.type === be.FOCUS_OUT, Mt = !Gt(_._f) && !r.resolver && !f(e.errors, u) && !_._f.deps || Qt(ae, f(e.touchedFields, u), e.isSubmitted, D, v), Ee = He(u, c, ae);
757
+ R(n, u, ve), ae ? (!a || !a.readOnly) && (_._f.onBlur && _._f.onBlur(i), w && w(0)) : _._f.onChange && _._f.onChange(i);
758
+ const Ce = y(u, ve, ae), Ut = !W(Ce) || Ee;
759
+ if (!ae && F.state.next({
760
+ name: u,
761
+ type: i.type,
762
+ values: T(n)
763
+ }), Mt)
764
+ return (A.isValid || b.isValid) && (r.mode === "onBlur" ? ae && O() : ae || O()), Ut && F.state.next({ name: u, ...Ee ? {} : Ce });
765
+ if (!ae && Ee && F.state.next({ ...e }), r.resolver) {
766
+ const { errors: it } = await S([u]);
767
+ if (o(ve), h) {
768
+ const Tt = ft(e.errors, s, u), at = ft(it, s, Tt.name || u);
769
+ M = at.error, u = at.name, X = W(it);
770
+ }
771
+ } else
772
+ B([u], !0), M = (await $e(_, c.disabled, n, J, r.shouldUseNativeValidation))[u], B([u]), o(ve), h && (M ? X = !1 : (A.isValid || b.isValid) && (X = await H(s, !0)));
773
+ h && (_._f.deps && (!Array.isArray(_._f.deps) || _._f.deps.length > 0) && oe(_._f.deps), V(u, X, M, Ce));
774
+ }
775
+ }, _e = (i, a) => {
776
+ if (f(e.errors, a) && i.focus)
777
+ return i.focus(), 1;
778
+ }, oe = async (i, a = {}) => {
779
+ let u, h;
780
+ const _ = K(i);
781
+ if (r.resolver) {
782
+ const o = await z(U(i) ? i : _);
783
+ u = W(o), h = i ? !_.some((v) => f(o, v)) : u;
784
+ } else i ? (h = (await Promise.all(_.map(async (o) => {
785
+ const v = f(s, o);
786
+ return await H(v && v._f ? { [o]: v } : v);
787
+ }))).every(Boolean), !(!h && !e.isValid) && O()) : h = u = await H(s);
788
+ return F.state.next({
789
+ ...!Y(i) || (A.isValid || b.isValid) && u !== e.isValid ? {} : { name: i },
790
+ ...r.resolver || !i ? { isValid: u } : {},
791
+ errors: e.errors
792
+ }), a.shouldFocus && !h && ye(s, _e, i ? _ : c.mount), h;
793
+ }, me = (i, a) => {
794
+ let u = {
795
+ ...d.mount ? n : l
796
+ };
797
+ return a && (u = bt(a.dirtyFields ? e.dirtyFields : e.touchedFields, u)), U(i) ? u : Y(i) ? f(u, i) : i.map((h) => f(u, h));
798
+ }, Je = (i, a) => ({
799
+ invalid: !!f((a || e).errors, i),
800
+ isDirty: !!f((a || e).dirtyFields, i),
801
+ error: f((a || e).errors, i),
802
+ isValidating: !!f(e.validatingFields, i),
803
+ isTouched: !!f((a || e).touchedFields, i)
804
+ }), kt = (i) => {
805
+ i && K(i).forEach((a) => N(e.errors, a)), F.state.next({
806
+ errors: i ? e.errors : {}
807
+ });
808
+ }, Qe = (i, a, u) => {
809
+ const h = (f(s, i, { _f: {} })._f || {}).ref, _ = f(e.errors, i) || {}, { ref: o, message: v, type: D, ...M } = _;
810
+ R(e.errors, i, {
811
+ ...M,
812
+ ...a,
813
+ ref: h
814
+ }), F.state.next({
815
+ name: i,
816
+ errors: e.errors,
817
+ isValid: !1
818
+ }), u && u.shouldFocus && h && h.focus && h.focus();
819
+ }, St = (i, a) => te(i) ? F.state.subscribe({
820
+ next: (u) => "values" in u && i(k(void 0, a), u)
821
+ }) : k(i, a, !0), Xe = (i) => F.state.subscribe({
822
+ next: (a) => {
823
+ Jt(i.name, a.name, i.exact) && Yt(a, i.formState || A, Ot, i.reRenderRoot) && i.callback({
824
+ values: { ...n },
825
+ ...e,
826
+ ...a,
827
+ defaultValues: l
828
+ });
829
+ }
830
+ }).unsubscribe, Dt = (i) => (d.mount = !0, b = {
831
+ ...b,
832
+ ...i.formState
833
+ }, Xe({
834
+ ...i,
835
+ formState: b
836
+ })), ke = (i, a = {}) => {
837
+ for (const u of i ? K(i) : c.mount)
838
+ c.mount.delete(u), c.array.delete(u), a.keepValue || (N(s, u), N(n, u)), !a.keepError && N(e.errors, u), !a.keepDirty && N(e.dirtyFields, u), !a.keepTouched && N(e.touchedFields, u), !a.keepIsValidating && N(e.validatingFields, u), !r.shouldUnregister && !a.keepDefaultValue && N(l, u);
839
+ F.state.next({
840
+ values: T(n)
841
+ }), F.state.next({
842
+ ...e,
843
+ ...a.keepDirty ? { isDirty: re() } : {}
844
+ }), !a.keepIsValid && O();
845
+ }, Ze = ({ disabled: i, name: a }) => {
846
+ (G(i) && d.mount || i || c.disabled.has(a)) && (i ? c.disabled.add(a) : c.disabled.delete(a));
847
+ }, Se = (i, a = {}) => {
848
+ let u = f(s, i);
849
+ const h = G(a.disabled) || G(r.disabled);
850
+ return R(s, i, {
851
+ ...u || {},
852
+ _f: {
853
+ ...u && u._f ? u._f : { ref: { name: i } },
854
+ name: i,
855
+ mount: !0,
856
+ ...a
857
+ }
858
+ }), c.mount.add(i), u ? Ze({
859
+ disabled: G(a.disabled) ? a.disabled : r.disabled,
860
+ name: i
861
+ }) : g(i, !0, a.value), {
862
+ ...h ? { disabled: a.disabled || r.disabled } : {},
863
+ ...r.progressive ? {
864
+ required: !!a.required,
865
+ min: ge(a.min),
866
+ max: ge(a.max),
867
+ minLength: ge(a.minLength),
868
+ maxLength: ge(a.maxLength),
869
+ pattern: ge(a.pattern)
870
+ } : {},
871
+ name: i,
872
+ onChange: se,
873
+ onBlur: se,
874
+ ref: (_) => {
875
+ if (_) {
876
+ Se(i, a), u = f(s, i);
877
+ const o = U(_.value) && _.querySelectorAll && _.querySelectorAll("input,select,textarea")[0] || _, v = qt(o), D = u._f.refs || [];
878
+ if (v ? D.find((M) => M === o) : o === u._f.ref)
879
+ return;
880
+ R(s, i, {
881
+ _f: {
882
+ ...u._f,
883
+ ...v ? {
884
+ refs: [
885
+ ...D.filter(Re),
886
+ o,
887
+ ...Array.isArray(f(l, i)) ? [{}] : []
888
+ ],
889
+ ref: { type: o.type, name: i }
890
+ } : { ref: o }
891
+ }
892
+ }), g(i, !1, void 0, o);
893
+ } else
894
+ u = f(s, i, {}), u._f && (u._f.mount = !1), (r.shouldUnregister || a.shouldUnregister) && !(mt(c.array, i) && d.action) && c.unMount.add(i);
895
+ }
896
+ };
897
+ }, De = () => r.shouldFocusError && ye(s, _e, c.mount), Et = (i) => {
898
+ G(i) && (F.state.next({ disabled: i }), ye(s, (a, u) => {
899
+ const h = f(s, u);
900
+ h && (a.disabled = h._f.disabled || i, Array.isArray(h._f.refs) && h._f.refs.forEach((_) => {
901
+ _.disabled = h._f.disabled || i;
902
+ }));
903
+ }, 0, !1));
904
+ }, et = (i, a) => async (u) => {
905
+ let h;
906
+ u && (u.preventDefault && u.preventDefault(), u.persist && u.persist());
907
+ let _ = T(n);
908
+ if (F.state.next({
909
+ isSubmitting: !0
910
+ }), r.resolver) {
911
+ const { errors: o, values: v } = await S();
912
+ e.errors = o, _ = T(v);
913
+ } else
914
+ await H(s);
915
+ if (c.disabled.size)
916
+ for (const o of c.disabled)
917
+ N(_, o);
918
+ if (N(e.errors, "root"), W(e.errors)) {
919
+ F.state.next({
920
+ errors: {}
921
+ });
922
+ try {
923
+ await i(_, u);
924
+ } catch (o) {
925
+ h = o;
926
+ }
927
+ } else
928
+ a && await a({ ...e.errors }, u), De(), setTimeout(De);
929
+ if (F.state.next({
930
+ isSubmitted: !0,
931
+ isSubmitting: !1,
932
+ isSubmitSuccessful: W(e.errors) && !h,
933
+ submitCount: e.submitCount + 1,
934
+ errors: e.errors
935
+ }), h)
936
+ throw h;
937
+ }, Ct = (i, a = {}) => {
938
+ f(s, i) && (U(a.defaultValue) ? $(i, T(f(l, i))) : ($(i, a.defaultValue), R(l, i, T(a.defaultValue))), a.keepTouched || N(e.touchedFields, i), a.keepDirty || (N(e.dirtyFields, i), e.isDirty = a.defaultValue ? re(i, T(f(l, i))) : re()), a.keepError || (N(e.errors, i), A.isValid && O()), F.state.next({ ...e }));
939
+ }, tt = (i, a = {}) => {
940
+ const u = i ? T(i) : l, h = T(u), _ = W(i), o = _ ? l : h;
941
+ if (a.keepDefaultValues || (l = u), !a.keepValues) {
942
+ if (a.keepDirtyValues) {
943
+ const v = /* @__PURE__ */ new Set([
944
+ ...c.mount,
945
+ ...Object.keys(de(l, n))
946
+ ]);
947
+ for (const D of Array.from(v))
948
+ f(e.dirtyFields, D) ? R(o, D, f(n, D)) : $(D, f(o, D));
949
+ } else {
950
+ if (je && U(i))
951
+ for (const v of c.mount) {
952
+ const D = f(s, v);
953
+ if (D && D._f) {
954
+ const M = Array.isArray(D._f.refs) ? D._f.refs[0] : D._f.ref;
955
+ if (Ve(M)) {
956
+ const X = M.closest("form");
957
+ if (X) {
958
+ X.reset();
959
+ break;
960
+ }
961
+ }
962
+ }
963
+ }
964
+ if (a.keepFieldsRef)
965
+ for (const v of c.mount)
966
+ $(v, f(o, v));
967
+ else
968
+ s = {};
969
+ }
970
+ n = r.shouldUnregister ? a.keepDefaultValues ? T(l) : {} : T(o), F.array.next({
971
+ values: { ...o }
972
+ }), F.state.next({
973
+ values: { ...o }
974
+ });
975
+ }
976
+ c = {
977
+ mount: a.keepDirtyValues ? c.mount : /* @__PURE__ */ new Set(),
978
+ unMount: /* @__PURE__ */ new Set(),
979
+ array: /* @__PURE__ */ new Set(),
980
+ disabled: /* @__PURE__ */ new Set(),
981
+ watch: /* @__PURE__ */ new Set(),
982
+ watchAll: !1,
983
+ focus: ""
984
+ }, d.mount = !A.isValid || !!a.keepIsValid || !!a.keepDirtyValues || !r.shouldUnregister && !W(o), d.watch = !!r.shouldUnregister, F.state.next({
985
+ submitCount: a.keepSubmitCount ? e.submitCount : 0,
986
+ isDirty: _ ? !1 : a.keepDirty ? e.isDirty : !!(a.keepDefaultValues && !ee(i, l)),
987
+ isSubmitted: a.keepIsSubmitted ? e.isSubmitted : !1,
988
+ dirtyFields: _ ? {} : a.keepDirtyValues ? a.keepDefaultValues && n ? de(l, n) : e.dirtyFields : a.keepDefaultValues && i ? de(l, i) : a.keepDirty ? e.dirtyFields : {},
989
+ touchedFields: a.keepTouched ? e.touchedFields : {},
990
+ errors: a.keepErrors ? e.errors : {},
991
+ isSubmitSuccessful: a.keepIsSubmitSuccessful ? e.isSubmitSuccessful : !1,
992
+ isSubmitting: !1,
993
+ defaultValues: l
994
+ });
995
+ }, rt = (i, a) => tt(te(i) ? i(n) : i, a), Rt = (i, a = {}) => {
996
+ const u = f(s, i), h = u && u._f;
997
+ if (h) {
998
+ const _ = h.refs ? h.refs[0] : h.ref;
999
+ _.focus && (_.focus(), a.shouldSelect && te(_.select) && _.select());
1000
+ }
1001
+ }, Ot = (i) => {
1002
+ e = {
1003
+ ...e,
1004
+ ...i
1005
+ };
1006
+ }, st = {
1007
+ control: {
1008
+ register: Se,
1009
+ unregister: ke,
1010
+ getFieldState: Je,
1011
+ handleSubmit: et,
1012
+ setError: Qe,
1013
+ _subscribe: Xe,
1014
+ _runSchema: S,
1015
+ _focusError: De,
1016
+ _getWatch: k,
1017
+ _getDirty: re,
1018
+ _setValid: O,
1019
+ _setFieldArray: Q,
1020
+ _setDisabledField: Ze,
1021
+ _setErrors: E,
1022
+ _getFieldArray: C,
1023
+ _reset: tt,
1024
+ _resetDefaultValues: () => te(r.defaultValues) && r.defaultValues().then((i) => {
1025
+ rt(i, r.resetOptions), F.state.next({
1026
+ isLoading: !1
1027
+ });
1028
+ }),
1029
+ _removeUnmounted: ue,
1030
+ _disableForm: Et,
1031
+ _subjects: F,
1032
+ _proxyFormState: A,
1033
+ get _fields() {
1034
+ return s;
1035
+ },
1036
+ get _formValues() {
1037
+ return n;
1038
+ },
1039
+ get _state() {
1040
+ return d;
1041
+ },
1042
+ set _state(i) {
1043
+ d = i;
1044
+ },
1045
+ get _defaultValues() {
1046
+ return l;
1047
+ },
1048
+ get _names() {
1049
+ return c;
1050
+ },
1051
+ set _names(i) {
1052
+ c = i;
1053
+ },
1054
+ get _formState() {
1055
+ return e;
1056
+ },
1057
+ get _options() {
1058
+ return r;
1059
+ },
1060
+ set _options(i) {
1061
+ r = {
1062
+ ...r,
1063
+ ...i
1064
+ };
1065
+ }
1066
+ },
1067
+ subscribe: Dt,
1068
+ trigger: oe,
1069
+ register: Se,
1070
+ handleSubmit: et,
1071
+ watch: St,
1072
+ setValue: $,
1073
+ getValues: me,
1074
+ reset: rt,
1075
+ resetField: Ct,
1076
+ clearErrors: kt,
1077
+ unregister: ke,
1078
+ setError: Qe,
1079
+ setFocus: Rt,
1080
+ getFieldState: Je
1081
+ };
1082
+ return {
1083
+ ...st,
1084
+ formControl: st
1085
+ };
1086
+ }
1087
+ var ne = () => {
1088
+ if (typeof crypto < "u" && crypto.randomUUID)
1089
+ return crypto.randomUUID();
1090
+ const t = typeof performance > "u" ? Date.now() : performance.now() * 1e3;
1091
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r) => {
1092
+ const e = (Math.random() * 16 + t) % 16 | 0;
1093
+ return (r == "x" ? e : e & 3 | 8).toString(16);
1094
+ });
1095
+ }, Oe = (t, r, e = {}) => e.shouldFocus || U(e.shouldFocus) ? e.focusName || `${t}.${U(e.focusIndex) ? r : e.focusIndex}.` : "", Me = (t, r) => [
1096
+ ...t,
1097
+ ...K(r)
1098
+ ], Ue = (t) => Array.isArray(t) ? t.map(() => {
1099
+ }) : void 0;
1100
+ function Te(t, r, e) {
1101
+ return [
1102
+ ...t.slice(0, r),
1103
+ ...K(e),
1104
+ ...t.slice(r)
1105
+ ];
1106
+ }
1107
+ var Le = (t, r, e) => Array.isArray(t) ? (U(t[e]) && (t[e] = void 0), t.splice(e, 0, t.splice(r, 1)[0]), t) : [], Ne = (t, r) => [
1108
+ ...K(r),
1109
+ ...K(t)
1110
+ ];
1111
+ function tr(t, r) {
1112
+ let e = 0;
1113
+ const s = [...t];
1114
+ for (const l of r)
1115
+ s.splice(l - e, 1), e++;
1116
+ return xe(s).length ? s : [];
1117
+ }
1118
+ var Ie = (t, r) => U(r) ? [] : tr(t, K(r).sort((e, s) => e - s)), Be = (t, r, e) => {
1119
+ [t[r], t[e]] = [t[e], t[r]];
1120
+ }, _t = (t, r, e) => (t[r] = e, t);
1121
+ function nr(t) {
1122
+ const r = pe(), { control: e = r.control, name: s, keyName: l = "id", shouldUnregister: n, rules: d } = t, [c, w] = m.useState(e._getFieldArray(s)), x = m.useRef(e._getFieldArray(s).map(ne)), A = m.useRef(!1);
1123
+ e._names.array.add(s), m.useMemo(() => d && c.length >= 0 && e.register(s, d), [e, s, c.length, d]), we(() => e._subjects.array.subscribe({
1124
+ next: ({ values: g, name: y }) => {
1125
+ if (y === s || !y) {
1126
+ const V = f(g, s);
1127
+ Array.isArray(V) && (w(V), x.current = V.map(ne));
1128
+ }
1129
+ }
1130
+ }).unsubscribe, [e, s]);
1131
+ const b = m.useCallback((g) => {
1132
+ A.current = !0, e._setFieldArray(s, g);
1133
+ }, [e, s]), F = (g, y) => {
1134
+ const V = K(T(g)), S = Me(e._getFieldArray(s), V);
1135
+ e._names.focus = Oe(s, S.length - 1, y), x.current = Me(x.current, V.map(ne)), b(S), w(S), e._setFieldArray(s, S, Me, {
1136
+ argA: Ue(g)
1137
+ });
1138
+ }, J = (g, y) => {
1139
+ const V = K(T(g)), S = Ne(e._getFieldArray(s), V);
1140
+ e._names.focus = Oe(s, 0, y), x.current = Ne(x.current, V.map(ne)), b(S), w(S), e._setFieldArray(s, S, Ne, {
1141
+ argA: Ue(g)
1142
+ });
1143
+ }, P = (g) => {
1144
+ const y = Ie(e._getFieldArray(s), g);
1145
+ x.current = Ie(x.current, g), b(y), w(y), !Array.isArray(f(e._fields, s)) && R(e._fields, s, void 0), e._setFieldArray(s, y, Ie, {
1146
+ argA: g
1147
+ });
1148
+ }, O = (g, y, V) => {
1149
+ const S = K(T(y)), z = Te(e._getFieldArray(s), g, S);
1150
+ e._names.focus = Oe(s, g, V), x.current = Te(x.current, g, S.map(ne)), b(z), w(z), e._setFieldArray(s, z, Te, {
1151
+ argA: g,
1152
+ argB: Ue(y)
1153
+ });
1154
+ }, B = (g, y) => {
1155
+ const V = e._getFieldArray(s);
1156
+ Be(V, g, y), Be(x.current, g, y), b(V), w(V), e._setFieldArray(s, V, Be, {
1157
+ argA: g,
1158
+ argB: y
1159
+ }, !1);
1160
+ }, Q = (g, y) => {
1161
+ const V = e._getFieldArray(s);
1162
+ Le(V, g, y), Le(x.current, g, y), b(V), w(V), e._setFieldArray(s, V, Le, {
1163
+ argA: g,
1164
+ argB: y
1165
+ }, !1);
1166
+ }, p = (g, y) => {
1167
+ const V = T(y), S = _t(e._getFieldArray(s), g, V);
1168
+ x.current = [...S].map((z, H) => !z || H === g ? ne() : x.current[H]), b(S), w([...S]), e._setFieldArray(s, S, _t, {
1169
+ argA: g,
1170
+ argB: V
1171
+ }, !0, !1);
1172
+ }, E = (g) => {
1173
+ const y = K(T(g));
1174
+ x.current = y.map(ne), b([...y]), w([...y]), e._setFieldArray(s, [...y], (V) => V, {}, !0, !1);
1175
+ };
1176
+ return m.useEffect(() => {
1177
+ if (e._state.action = !1, He(s, e._names) && e._subjects.state.next({
1178
+ ...e._formState
1179
+ }), A.current && (!fe(e._options.mode).isOnSubmit || e._formState.isSubmitted) && !fe(e._options.reValidateMode).isOnSubmit)
1180
+ if (e._options.resolver)
1181
+ e._runSchema([s]).then((g) => {
1182
+ const y = f(g.errors, s), V = f(e._formState.errors, s);
1183
+ (V ? !y && V.type || y && (V.type !== y.type || V.message !== y.message) : y && y.type) && (y ? R(e._formState.errors, s, y) : N(e._formState.errors, s), e._subjects.state.next({
1184
+ errors: e._formState.errors
1185
+ }));
1186
+ });
1187
+ else {
1188
+ const g = f(e._fields, s);
1189
+ g && g._f && !(fe(e._options.reValidateMode).isOnSubmit && fe(e._options.mode).isOnSubmit) && $e(g, e._names.disabled, e._formValues, e._options.criteriaMode === Z.all, e._options.shouldUseNativeValidation, !0).then((y) => !W(y) && e._subjects.state.next({
1190
+ errors: wt(e._formState.errors, y, s)
1191
+ }));
1192
+ }
1193
+ e._subjects.state.next({
1194
+ name: s,
1195
+ values: T(e._formValues)
1196
+ }), e._names.focus && ye(e._fields, (g, y) => {
1197
+ if (e._names.focus && y.startsWith(e._names.focus) && g.focus)
1198
+ return g.focus(), 1;
1199
+ }), e._names.focus = "", e._setValid(), A.current = !1;
1200
+ }, [c, s, e]), m.useEffect(() => (!f(e._formValues, s) && e._setFieldArray(s), () => {
1201
+ const g = (y, V) => {
1202
+ const S = f(e._fields, y);
1203
+ S && S._f && (S._f.mount = V);
1204
+ };
1205
+ e._options.shouldUnregister || n ? e.unregister(s) : g(s, !1);
1206
+ }), [s, e, l, n]), {
1207
+ swap: m.useCallback(B, [b, s, e]),
1208
+ move: m.useCallback(Q, [b, s, e]),
1209
+ prepend: m.useCallback(J, [b, s, e]),
1210
+ append: m.useCallback(F, [b, s, e]),
1211
+ remove: m.useCallback(P, [b, s, e]),
1212
+ insert: m.useCallback(O, [b, s, e]),
1213
+ update: m.useCallback(p, [b, s, e]),
1214
+ replace: m.useCallback(E, [b, s, e]),
1215
+ fields: m.useMemo(() => c.map((g, y) => ({
1216
+ ...g,
1217
+ [l]: x.current[y] || ne()
1218
+ })), [c, l])
1219
+ };
1220
+ }
1221
+ function ur(t = {}) {
1222
+ const r = m.useRef(void 0), e = m.useRef(void 0), [s, l] = m.useState({
1223
+ isDirty: !1,
1224
+ isValidating: !1,
1225
+ isLoading: te(t.defaultValues),
1226
+ isSubmitted: !1,
1227
+ isSubmitting: !1,
1228
+ isSubmitSuccessful: !1,
1229
+ isValid: !1,
1230
+ submitCount: 0,
1231
+ dirtyFields: {},
1232
+ touchedFields: {},
1233
+ validatingFields: {},
1234
+ errors: t.errors || {},
1235
+ disabled: t.disabled || !1,
1236
+ isReady: !1,
1237
+ defaultValues: te(t.defaultValues) ? void 0 : t.defaultValues
1238
+ });
1239
+ if (!r.current)
1240
+ if (t.formControl)
1241
+ r.current = {
1242
+ ...t.formControl,
1243
+ formState: s
1244
+ }, t.defaultValues && !te(t.defaultValues) && t.formControl.reset(t.defaultValues, t.resetOptions);
1245
+ else {
1246
+ const { formControl: d, ...c } = er(t);
1247
+ r.current = {
1248
+ ...c,
1249
+ formState: s
1250
+ };
1251
+ }
1252
+ const n = r.current.control;
1253
+ return n._options = t, we(() => {
1254
+ const d = n._subscribe({
1255
+ formState: n._proxyFormState,
1256
+ callback: () => l({ ...n._formState }),
1257
+ reRenderRoot: !0
1258
+ });
1259
+ return l((c) => ({
1260
+ ...c,
1261
+ isReady: !0
1262
+ })), n._formState.isReady = !0, d;
1263
+ }, [n]), m.useEffect(() => n._disableForm(t.disabled), [n, t.disabled]), m.useEffect(() => {
1264
+ t.mode && (n._options.mode = t.mode), t.reValidateMode && (n._options.reValidateMode = t.reValidateMode);
1265
+ }, [n, t.mode, t.reValidateMode]), m.useEffect(() => {
1266
+ t.errors && (n._setErrors(t.errors), n._focusError());
1267
+ }, [n, t.errors]), m.useEffect(() => {
1268
+ t.shouldUnregister && n._subjects.state.next({
1269
+ values: n._getWatch()
1270
+ });
1271
+ }, [n, t.shouldUnregister]), m.useEffect(() => {
1272
+ if (n._proxyFormState.isDirty) {
1273
+ const d = n._getDirty();
1274
+ d !== s.isDirty && n._subjects.state.next({
1275
+ isDirty: d
1276
+ });
1277
+ }
1278
+ }, [n, s.isDirty]), m.useEffect(() => {
1279
+ t.values && !ee(t.values, e.current) ? (n._reset(t.values, {
1280
+ keepFieldsRef: !0,
1281
+ ...n._options.resetOptions
1282
+ }), e.current = t.values, l((d) => ({ ...d }))) : n._resetDefaultValues();
1283
+ }, [n, t.values]), m.useEffect(() => {
1284
+ n._state.mount || (n._setValid(), n._state.mount = !0), n._state.watch && (n._state.watch = !1, n._subjects.state.next({ ...n._formState })), n._removeUnmounted();
1285
+ }), r.current.formState = vt(s, n), r.current;
1286
+ }
1287
+ export {
1288
+ ar as C,
1289
+ ir as F,
1290
+ ur as a,
1291
+ nr as b,
1292
+ pe as u
1293
+ };
1294
+ //# sourceMappingURL=index.esm-BYObtETB.js.map