fullstacked 0.12.1-1330 → 0.12.1-1355

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 (277) hide show
  1. package/fullstacked_modules/{ai/index.js → @fullstacked/ai-agent/ai-agent.js} +4868 -8601
  2. package/fullstacked_modules/@fullstacked/ai-agent/index.ts +5 -3
  3. package/fullstacked_modules/@fullstacked/ai-agent/package.json +26 -23
  4. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/anthropic.ts +11 -7
  5. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/deepseek.ts +11 -7
  6. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/google.ts +11 -7
  7. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/index.ts +10 -12
  8. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/interface.ts +10 -6
  9. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/mistral.ts +11 -7
  10. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/ollama.ts +19 -14
  11. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/openai.ts +11 -7
  12. package/fullstacked_modules/@fullstacked/ai-agent/src/providers/xai.ts +11 -7
  13. package/fullstacked_modules/@fullstacked/ui/index.js +664 -0
  14. package/fullstacked_modules/auto_update/index.ts +66 -0
  15. package/fullstacked_modules/bridge/index.ts +2 -57
  16. package/fullstacked_modules/{esbuild/esbuild.ts → build/build.ts} +31 -28
  17. package/fullstacked_modules/build/index.ts +3 -0
  18. package/fullstacked_modules/build/sass.ts +55 -0
  19. package/fullstacked_modules/components/snackbar.css +54 -1
  20. package/fullstacked_modules/components/snackbar.scss +52 -0
  21. package/fullstacked_modules/sass/index.js +6445 -6464
  22. package/fullstacked_modules/zod/index.cjs +33 -0
  23. package/fullstacked_modules/zod/index.js +4 -0
  24. package/fullstacked_modules/zod/v3/ZodError.cjs +138 -0
  25. package/fullstacked_modules/zod/v3/ZodError.js +133 -0
  26. package/fullstacked_modules/zod/v3/errors.cjs +17 -0
  27. package/fullstacked_modules/zod/v3/errors.js +9 -0
  28. package/fullstacked_modules/zod/v3/external.cjs +22 -0
  29. package/fullstacked_modules/zod/v3/external.js +6 -0
  30. package/fullstacked_modules/zod/v3/helpers/enumUtil.cjs +2 -0
  31. package/fullstacked_modules/zod/v3/helpers/enumUtil.js +1 -0
  32. package/fullstacked_modules/zod/v3/helpers/errorUtil.cjs +9 -0
  33. package/fullstacked_modules/zod/v3/helpers/errorUtil.js +6 -0
  34. package/fullstacked_modules/zod/v3/helpers/parseUtil.cjs +124 -0
  35. package/fullstacked_modules/zod/v3/helpers/parseUtil.js +109 -0
  36. package/fullstacked_modules/zod/v3/helpers/partialUtil.cjs +2 -0
  37. package/fullstacked_modules/zod/v3/helpers/partialUtil.js +1 -0
  38. package/fullstacked_modules/zod/v3/helpers/typeAliases.cjs +2 -0
  39. package/fullstacked_modules/zod/v3/helpers/typeAliases.js +1 -0
  40. package/fullstacked_modules/zod/v3/helpers/util.cjs +137 -0
  41. package/fullstacked_modules/zod/v3/helpers/util.js +133 -0
  42. package/fullstacked_modules/zod/v3/index.cjs +33 -0
  43. package/fullstacked_modules/zod/v3/index.js +4 -0
  44. package/fullstacked_modules/zod/v3/locales/en.cjs +111 -0
  45. package/fullstacked_modules/zod/v3/locales/en.js +109 -0
  46. package/fullstacked_modules/zod/v3/standard-schema.cjs +2 -0
  47. package/fullstacked_modules/zod/v3/standard-schema.js +1 -0
  48. package/fullstacked_modules/zod/v3/types.cjs +3775 -0
  49. package/fullstacked_modules/zod/v3/types.js +3693 -0
  50. package/fullstacked_modules/zod/v4/classic/checks.cjs +32 -0
  51. package/fullstacked_modules/zod/v4/classic/checks.js +1 -0
  52. package/fullstacked_modules/zod/v4/classic/coerce.cjs +47 -0
  53. package/fullstacked_modules/zod/v4/classic/coerce.js +17 -0
  54. package/fullstacked_modules/zod/v4/classic/compat.cjs +57 -0
  55. package/fullstacked_modules/zod/v4/classic/compat.js +27 -0
  56. package/fullstacked_modules/zod/v4/classic/errors.cjs +67 -0
  57. package/fullstacked_modules/zod/v4/classic/errors.js +41 -0
  58. package/fullstacked_modules/zod/v4/classic/external.cjs +70 -0
  59. package/fullstacked_modules/zod/v4/classic/external.js +18 -0
  60. package/fullstacked_modules/zod/v4/classic/index.cjs +33 -0
  61. package/fullstacked_modules/zod/v4/classic/index.js +4 -0
  62. package/fullstacked_modules/zod/v4/classic/iso.cjs +60 -0
  63. package/fullstacked_modules/zod/v4/classic/iso.js +30 -0
  64. package/fullstacked_modules/zod/v4/classic/parse.cjs +32 -0
  65. package/fullstacked_modules/zod/v4/classic/parse.js +6 -0
  66. package/fullstacked_modules/zod/v4/classic/schemas.cjs +1109 -0
  67. package/fullstacked_modules/zod/v4/classic/schemas.js +1006 -0
  68. package/fullstacked_modules/zod/v4/core/api.cjs +1039 -0
  69. package/fullstacked_modules/zod/v4/core/api.js +906 -0
  70. package/fullstacked_modules/zod/v4/core/checks.cjs +591 -0
  71. package/fullstacked_modules/zod/v4/core/checks.js +565 -0
  72. package/fullstacked_modules/zod/v4/core/core.cjs +67 -0
  73. package/fullstacked_modules/zod/v4/core/core.js +61 -0
  74. package/fullstacked_modules/zod/v4/core/doc.cjs +39 -0
  75. package/fullstacked_modules/zod/v4/core/doc.js +35 -0
  76. package/fullstacked_modules/zod/v4/core/errors.cjs +226 -0
  77. package/fullstacked_modules/zod/v4/core/errors.js +195 -0
  78. package/fullstacked_modules/zod/v4/core/function.cjs +102 -0
  79. package/fullstacked_modules/zod/v4/core/function.js +75 -0
  80. package/fullstacked_modules/zod/v4/core/index.cjs +44 -0
  81. package/fullstacked_modules/zod/v4/core/index.js +15 -0
  82. package/fullstacked_modules/zod/v4/core/json-schema.cjs +2 -0
  83. package/fullstacked_modules/zod/v4/core/json-schema.js +1 -0
  84. package/fullstacked_modules/zod/v4/core/parse.cjs +87 -0
  85. package/fullstacked_modules/zod/v4/core/parse.js +57 -0
  86. package/fullstacked_modules/zod/v4/core/regexes.cjs +103 -0
  87. package/fullstacked_modules/zod/v4/core/regexes.js +95 -0
  88. package/fullstacked_modules/zod/v4/core/registries.cjs +56 -0
  89. package/fullstacked_modules/zod/v4/core/registries.js +51 -0
  90. package/fullstacked_modules/zod/v4/core/schemas.cjs +1748 -0
  91. package/fullstacked_modules/zod/v4/core/schemas.js +1717 -0
  92. package/fullstacked_modules/zod/v4/core/standard-schema.cjs +2 -0
  93. package/fullstacked_modules/zod/v4/core/standard-schema.js +1 -0
  94. package/fullstacked_modules/zod/v4/core/to-json-schema.cjs +854 -0
  95. package/fullstacked_modules/zod/v4/core/to-json-schema.js +849 -0
  96. package/fullstacked_modules/zod/v4/core/util.cjs +539 -0
  97. package/fullstacked_modules/zod/v4/core/util.js +493 -0
  98. package/fullstacked_modules/zod/v4/core/versions.cjs +8 -0
  99. package/fullstacked_modules/zod/v4/core/versions.js +5 -0
  100. package/fullstacked_modules/zod/v4/index.cjs +22 -0
  101. package/fullstacked_modules/zod/v4/index.js +3 -0
  102. package/fullstacked_modules/zod/v4/locales/ar.cjs +142 -0
  103. package/fullstacked_modules/zod/v4/locales/ar.js +116 -0
  104. package/fullstacked_modules/zod/v4/locales/az.cjs +141 -0
  105. package/fullstacked_modules/zod/v4/locales/az.js +115 -0
  106. package/fullstacked_modules/zod/v4/locales/be.cjs +190 -0
  107. package/fullstacked_modules/zod/v4/locales/be.js +164 -0
  108. package/fullstacked_modules/zod/v4/locales/ca.cjs +144 -0
  109. package/fullstacked_modules/zod/v4/locales/ca.js +118 -0
  110. package/fullstacked_modules/zod/v4/locales/cs.cjs +161 -0
  111. package/fullstacked_modules/zod/v4/locales/cs.js +135 -0
  112. package/fullstacked_modules/zod/v4/locales/de.cjs +142 -0
  113. package/fullstacked_modules/zod/v4/locales/de.js +116 -0
  114. package/fullstacked_modules/zod/v4/locales/en.cjs +145 -0
  115. package/fullstacked_modules/zod/v4/locales/en.js +117 -0
  116. package/fullstacked_modules/zod/v4/locales/eo.cjs +144 -0
  117. package/fullstacked_modules/zod/v4/locales/eo.js +116 -0
  118. package/fullstacked_modules/zod/v4/locales/es.cjs +143 -0
  119. package/fullstacked_modules/zod/v4/locales/es.js +117 -0
  120. package/fullstacked_modules/zod/v4/locales/fa.cjs +148 -0
  121. package/fullstacked_modules/zod/v4/locales/fa.js +122 -0
  122. package/fullstacked_modules/zod/v4/locales/fi.cjs +148 -0
  123. package/fullstacked_modules/zod/v4/locales/fi.js +122 -0
  124. package/fullstacked_modules/zod/v4/locales/fr-CA.cjs +143 -0
  125. package/fullstacked_modules/zod/v4/locales/fr-CA.js +117 -0
  126. package/fullstacked_modules/zod/v4/locales/fr.cjs +142 -0
  127. package/fullstacked_modules/zod/v4/locales/fr.js +116 -0
  128. package/fullstacked_modules/zod/v4/locales/he.cjs +143 -0
  129. package/fullstacked_modules/zod/v4/locales/he.js +117 -0
  130. package/fullstacked_modules/zod/v4/locales/hu.cjs +143 -0
  131. package/fullstacked_modules/zod/v4/locales/hu.js +117 -0
  132. package/fullstacked_modules/zod/v4/locales/id.cjs +142 -0
  133. package/fullstacked_modules/zod/v4/locales/id.js +116 -0
  134. package/fullstacked_modules/zod/v4/locales/index.cjs +84 -0
  135. package/fullstacked_modules/zod/v4/locales/index.js +39 -0
  136. package/fullstacked_modules/zod/v4/locales/it.cjs +143 -0
  137. package/fullstacked_modules/zod/v4/locales/it.js +117 -0
  138. package/fullstacked_modules/zod/v4/locales/ja.cjs +141 -0
  139. package/fullstacked_modules/zod/v4/locales/ja.js +115 -0
  140. package/fullstacked_modules/zod/v4/locales/kh.cjs +143 -0
  141. package/fullstacked_modules/zod/v4/locales/kh.js +117 -0
  142. package/fullstacked_modules/zod/v4/locales/ko.cjs +147 -0
  143. package/fullstacked_modules/zod/v4/locales/ko.js +121 -0
  144. package/fullstacked_modules/zod/v4/locales/mk.cjs +144 -0
  145. package/fullstacked_modules/zod/v4/locales/mk.js +118 -0
  146. package/fullstacked_modules/zod/v4/locales/ms.cjs +142 -0
  147. package/fullstacked_modules/zod/v4/locales/ms.js +116 -0
  148. package/fullstacked_modules/zod/v4/locales/nl.cjs +143 -0
  149. package/fullstacked_modules/zod/v4/locales/nl.js +117 -0
  150. package/fullstacked_modules/zod/v4/locales/no.cjs +142 -0
  151. package/fullstacked_modules/zod/v4/locales/no.js +116 -0
  152. package/fullstacked_modules/zod/v4/locales/ota.cjs +143 -0
  153. package/fullstacked_modules/zod/v4/locales/ota.js +117 -0
  154. package/fullstacked_modules/zod/v4/locales/pl.cjs +143 -0
  155. package/fullstacked_modules/zod/v4/locales/pl.js +117 -0
  156. package/fullstacked_modules/zod/v4/locales/ps.cjs +148 -0
  157. package/fullstacked_modules/zod/v4/locales/ps.js +122 -0
  158. package/fullstacked_modules/zod/v4/locales/pt.cjs +142 -0
  159. package/fullstacked_modules/zod/v4/locales/pt.js +116 -0
  160. package/fullstacked_modules/zod/v4/locales/ru.cjs +190 -0
  161. package/fullstacked_modules/zod/v4/locales/ru.js +164 -0
  162. package/fullstacked_modules/zod/v4/locales/sl.cjs +143 -0
  163. package/fullstacked_modules/zod/v4/locales/sl.js +117 -0
  164. package/fullstacked_modules/zod/v4/locales/sv.cjs +144 -0
  165. package/fullstacked_modules/zod/v4/locales/sv.js +118 -0
  166. package/fullstacked_modules/zod/v4/locales/ta.cjs +143 -0
  167. package/fullstacked_modules/zod/v4/locales/ta.js +117 -0
  168. package/fullstacked_modules/zod/v4/locales/th.cjs +143 -0
  169. package/fullstacked_modules/zod/v4/locales/th.js +117 -0
  170. package/fullstacked_modules/zod/v4/locales/tr.cjs +143 -0
  171. package/fullstacked_modules/zod/v4/locales/tr.js +115 -0
  172. package/fullstacked_modules/zod/v4/locales/ua.cjs +143 -0
  173. package/fullstacked_modules/zod/v4/locales/ua.js +117 -0
  174. package/fullstacked_modules/zod/v4/locales/ur.cjs +143 -0
  175. package/fullstacked_modules/zod/v4/locales/ur.js +117 -0
  176. package/fullstacked_modules/zod/v4/locales/vi.cjs +142 -0
  177. package/fullstacked_modules/zod/v4/locales/vi.js +116 -0
  178. package/fullstacked_modules/zod/v4/locales/zh-CN.cjs +142 -0
  179. package/fullstacked_modules/zod/v4/locales/zh-CN.js +116 -0
  180. package/fullstacked_modules/zod/v4/locales/zh-TW.cjs +143 -0
  181. package/fullstacked_modules/zod/v4/locales/zh-TW.js +117 -0
  182. package/fullstacked_modules/zod/v4/mini/checks.cjs +34 -0
  183. package/fullstacked_modules/zod/v4/mini/checks.js +1 -0
  184. package/fullstacked_modules/zod/v4/mini/coerce.cjs +47 -0
  185. package/fullstacked_modules/zod/v4/mini/coerce.js +17 -0
  186. package/fullstacked_modules/zod/v4/mini/external.cjs +62 -0
  187. package/fullstacked_modules/zod/v4/mini/external.js +13 -0
  188. package/fullstacked_modules/zod/v4/mini/index.cjs +32 -0
  189. package/fullstacked_modules/zod/v4/mini/index.js +3 -0
  190. package/fullstacked_modules/zod/v4/mini/iso.cjs +60 -0
  191. package/fullstacked_modules/zod/v4/mini/iso.js +30 -0
  192. package/fullstacked_modules/zod/v4/mini/parse.cjs +8 -0
  193. package/fullstacked_modules/zod/v4/mini/parse.js +1 -0
  194. package/fullstacked_modules/zod/v4/mini/schemas.cjs +839 -0
  195. package/fullstacked_modules/zod/v4/mini/schemas.js +732 -0
  196. package/fullstacked_modules/zod/v4-mini/index.cjs +17 -0
  197. package/fullstacked_modules/zod/v4-mini/index.js +1 -0
  198. package/index.js +121 -186
  199. package/package.json +4 -4
  200. package/fullstacked_modules/@fullstacked/ui/README.md +0 -3
  201. package/fullstacked_modules/@fullstacked/ui/components/button-group/button-group.scss +0 -28
  202. package/fullstacked_modules/@fullstacked/ui/components/button-group/index.ts +0 -8
  203. package/fullstacked_modules/@fullstacked/ui/components/dialog/dialog.scss +0 -39
  204. package/fullstacked_modules/@fullstacked/ui/components/dialog/index.ts +0 -17
  205. package/fullstacked_modules/@fullstacked/ui/components/list-item/index.ts +0 -37
  206. package/fullstacked_modules/@fullstacked/ui/components/list-item/list-item.scss +0 -19
  207. package/fullstacked_modules/@fullstacked/ui/components/loader/index.ts +0 -14
  208. package/fullstacked_modules/@fullstacked/ui/components/loader/loader.scss +0 -25
  209. package/fullstacked_modules/@fullstacked/ui/components/message/index.ts +0 -26
  210. package/fullstacked_modules/@fullstacked/ui/components/message/message.scss +0 -20
  211. package/fullstacked_modules/@fullstacked/ui/components/popover/index.ts +0 -114
  212. package/fullstacked_modules/@fullstacked/ui/components/popover/popover.scss +0 -44
  213. package/fullstacked_modules/@fullstacked/ui/globals.scss +0 -66
  214. package/fullstacked_modules/@fullstacked/ui/icons/Archive.svg +0 -3
  215. package/fullstacked_modules/@fullstacked/ui/icons/Arrow 2.svg +0 -3
  216. package/fullstacked_modules/@fullstacked/ui/icons/Arrow Corner.svg +0 -3
  217. package/fullstacked_modules/@fullstacked/ui/icons/Arrow.svg +0 -3
  218. package/fullstacked_modules/@fullstacked/ui/icons/Caret.svg +0 -3
  219. package/fullstacked_modules/@fullstacked/ui/icons/Check.svg +0 -3
  220. package/fullstacked_modules/@fullstacked/ui/icons/Clipboard.svg +0 -12
  221. package/fullstacked_modules/@fullstacked/ui/icons/Clock.svg +0 -12
  222. package/fullstacked_modules/@fullstacked/ui/icons/Close.svg +0 -10
  223. package/fullstacked_modules/@fullstacked/ui/icons/Copy.svg +0 -3
  224. package/fullstacked_modules/@fullstacked/ui/icons/Directory Add.svg +0 -3
  225. package/fullstacked_modules/@fullstacked/ui/icons/Edit.svg +0 -3
  226. package/fullstacked_modules/@fullstacked/ui/icons/Export.svg +0 -3
  227. package/fullstacked_modules/@fullstacked/ui/icons/External Link.svg +0 -3
  228. package/fullstacked_modules/@fullstacked/ui/icons/File Add.svg +0 -3
  229. package/fullstacked_modules/@fullstacked/ui/icons/File.svg +0 -3
  230. package/fullstacked_modules/@fullstacked/ui/icons/Git Branch.svg +0 -3
  231. package/fullstacked_modules/@fullstacked/ui/icons/Git.svg +0 -3
  232. package/fullstacked_modules/@fullstacked/ui/icons/Glitter.svg +0 -3
  233. package/fullstacked_modules/@fullstacked/ui/icons/Info.svg +0 -3
  234. package/fullstacked_modules/@fullstacked/ui/icons/Link.svg +0 -10
  235. package/fullstacked_modules/@fullstacked/ui/icons/Loader.svg +0 -4
  236. package/fullstacked_modules/@fullstacked/ui/icons/Lock.svg +0 -3
  237. package/fullstacked_modules/@fullstacked/ui/icons/Options.svg +0 -3
  238. package/fullstacked_modules/@fullstacked/ui/icons/Package.svg +0 -3
  239. package/fullstacked_modules/@fullstacked/ui/icons/Peers.svg +0 -3
  240. package/fullstacked_modules/@fullstacked/ui/icons/Play.svg +0 -3
  241. package/fullstacked_modules/@fullstacked/ui/icons/Plus.svg +0 -3
  242. package/fullstacked_modules/@fullstacked/ui/icons/Revert.svg +0 -3
  243. package/fullstacked_modules/@fullstacked/ui/icons/Settings.svg +0 -3
  244. package/fullstacked_modules/@fullstacked/ui/icons/Side Panel.svg +0 -3
  245. package/fullstacked_modules/@fullstacked/ui/icons/Terminal.svg +0 -3
  246. package/fullstacked_modules/@fullstacked/ui/icons/Trash.svg +0 -3
  247. package/fullstacked_modules/@fullstacked/ui/icons/TypeScript.svg +0 -3
  248. package/fullstacked_modules/@fullstacked/ui/icons/Upload.svg +0 -3
  249. package/fullstacked_modules/@fullstacked/ui/icons/User.svg +0 -3
  250. package/fullstacked_modules/@fullstacked/ui/icons/Warning.svg +0 -3
  251. package/fullstacked_modules/@fullstacked/ui/inputs/checkbox/index.ts +0 -28
  252. package/fullstacked_modules/@fullstacked/ui/inputs/file/index.ts +0 -48
  253. package/fullstacked_modules/@fullstacked/ui/inputs/inputs.scss +0 -224
  254. package/fullstacked_modules/@fullstacked/ui/inputs/observer.ts +0 -36
  255. package/fullstacked_modules/@fullstacked/ui/inputs/predictive/index.ts +0 -195
  256. package/fullstacked_modules/@fullstacked/ui/inputs/radio/index.ts +0 -28
  257. package/fullstacked_modules/@fullstacked/ui/inputs/select/index.ts +0 -125
  258. package/fullstacked_modules/@fullstacked/ui/inputs/switch/index.ts +0 -37
  259. package/fullstacked_modules/@fullstacked/ui/inputs/text/index.ts +0 -53
  260. package/fullstacked_modules/@fullstacked/ui/package.json +0 -8
  261. package/fullstacked_modules/@fullstacked/ui/primitives/badge/badge.scss +0 -35
  262. package/fullstacked_modules/@fullstacked/ui/primitives/badge/index.ts +0 -23
  263. package/fullstacked_modules/@fullstacked/ui/primitives/button/button.scss +0 -97
  264. package/fullstacked_modules/@fullstacked/ui/primitives/button/index.ts +0 -41
  265. package/fullstacked_modules/@fullstacked/ui/primitives/icon/icon.scss +0 -13
  266. package/fullstacked_modules/@fullstacked/ui/primitives/icon/index.ts +0 -30
  267. package/fullstacked_modules/@fullstacked/ui/ui.scss +0 -15
  268. package/fullstacked_modules/@fullstacked/ui/ui.ts +0 -18
  269. package/fullstacked_modules/@fullstacked/ui/values/breakpoints.scss +0 -7
  270. package/fullstacked_modules/@fullstacked/ui/values/colors.scss +0 -26
  271. package/fullstacked_modules/@fullstacked/ui/values/spacing.scss +0 -10
  272. package/fullstacked_modules/@fullstacked/ui/values/typography.scss +0 -23
  273. package/fullstacked_modules/esbuild/index.d.ts +0 -0
  274. package/fullstacked_modules/esbuild/index.ts +0 -3
  275. package/fullstacked_modules/esbuild/sass.ts +0 -100
  276. package/fullstacked_modules/sass/index.d.ts +0 -0
  277. /package/fullstacked_modules/{@fullstacked → build}/index.d.ts +0 -0
@@ -0,0 +1,1109 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.ZodTransform = exports.ZodFile = exports.ZodLiteral = exports.ZodEnum = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodDate = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodBigIntFormat = exports.ZodBigInt = exports.ZodBoolean = exports.ZodNumberFormat = exports.ZodNumber = exports.ZodCustomStringFormat = exports.ZodJWT = exports.ZodE164 = exports.ZodBase64URL = exports.ZodBase64 = exports.ZodCIDRv6 = exports.ZodCIDRv4 = exports.ZodIPv6 = exports.ZodIPv4 = exports.ZodKSUID = exports.ZodXID = exports.ZodULID = exports.ZodCUID2 = exports.ZodCUID = exports.ZodNanoID = exports.ZodEmoji = exports.ZodURL = exports.ZodUUID = exports.ZodGUID = exports.ZodEmail = exports.ZodStringFormat = exports.ZodString = exports._ZodString = exports.ZodType = void 0;
27
+ exports.stringbool = exports.ZodCustom = exports.ZodPromise = exports.ZodLazy = exports.ZodTemplateLiteral = exports.ZodReadonly = exports.ZodPipe = exports.ZodNaN = exports.ZodCatch = exports.ZodSuccess = exports.ZodNonOptional = exports.ZodPrefault = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = void 0;
28
+ exports.string = string;
29
+ exports.email = email;
30
+ exports.guid = guid;
31
+ exports.uuid = uuid;
32
+ exports.uuidv4 = uuidv4;
33
+ exports.uuidv6 = uuidv6;
34
+ exports.uuidv7 = uuidv7;
35
+ exports.url = url;
36
+ exports.emoji = emoji;
37
+ exports.nanoid = nanoid;
38
+ exports.cuid = cuid;
39
+ exports.cuid2 = cuid2;
40
+ exports.ulid = ulid;
41
+ exports.xid = xid;
42
+ exports.ksuid = ksuid;
43
+ exports.ipv4 = ipv4;
44
+ exports.ipv6 = ipv6;
45
+ exports.cidrv4 = cidrv4;
46
+ exports.cidrv6 = cidrv6;
47
+ exports.base64 = base64;
48
+ exports.base64url = base64url;
49
+ exports.e164 = e164;
50
+ exports.jwt = jwt;
51
+ exports.stringFormat = stringFormat;
52
+ exports.number = number;
53
+ exports.int = int;
54
+ exports.float32 = float32;
55
+ exports.float64 = float64;
56
+ exports.int32 = int32;
57
+ exports.uint32 = uint32;
58
+ exports.boolean = boolean;
59
+ exports.bigint = bigint;
60
+ exports.int64 = int64;
61
+ exports.uint64 = uint64;
62
+ exports.symbol = symbol;
63
+ exports.undefined = _undefined;
64
+ exports.null = _null;
65
+ exports.any = any;
66
+ exports.unknown = unknown;
67
+ exports.never = never;
68
+ exports.void = _void;
69
+ exports.date = date;
70
+ exports.array = array;
71
+ exports.keyof = keyof;
72
+ exports.object = object;
73
+ exports.strictObject = strictObject;
74
+ exports.looseObject = looseObject;
75
+ exports.union = union;
76
+ exports.discriminatedUnion = discriminatedUnion;
77
+ exports.intersection = intersection;
78
+ exports.tuple = tuple;
79
+ exports.record = record;
80
+ exports.partialRecord = partialRecord;
81
+ exports.map = map;
82
+ exports.set = set;
83
+ exports.enum = _enum;
84
+ exports.nativeEnum = nativeEnum;
85
+ exports.literal = literal;
86
+ exports.file = file;
87
+ exports.transform = transform;
88
+ exports.optional = optional;
89
+ exports.nullable = nullable;
90
+ exports.nullish = nullish;
91
+ exports._default = _default;
92
+ exports.prefault = prefault;
93
+ exports.nonoptional = nonoptional;
94
+ exports.success = success;
95
+ exports.catch = _catch;
96
+ exports.nan = nan;
97
+ exports.pipe = pipe;
98
+ exports.readonly = readonly;
99
+ exports.templateLiteral = templateLiteral;
100
+ exports.lazy = lazy;
101
+ exports.promise = promise;
102
+ exports.check = check;
103
+ exports.custom = custom;
104
+ exports.refine = refine;
105
+ exports.superRefine = superRefine;
106
+ exports.instanceof = _instanceof;
107
+ exports.json = json;
108
+ exports.preprocess = preprocess;
109
+ const core = __importStar(require("../core/index.cjs"));
110
+ const index_js_1 = require("../core/index.cjs");
111
+ const checks = __importStar(require("./checks.cjs"));
112
+ const iso = __importStar(require("./iso.cjs"));
113
+ const parse = __importStar(require("./parse.cjs"));
114
+ exports.ZodType = core.$constructor("ZodType", (inst, def) => {
115
+ core.$ZodType.init(inst, def);
116
+ inst.def = def;
117
+ Object.defineProperty(inst, "_def", { value: def });
118
+ // base methods
119
+ inst.check = (...checks) => {
120
+ return inst.clone({
121
+ ...def,
122
+ checks: [
123
+ ...(def.checks ?? []),
124
+ ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
125
+ ],
126
+ }
127
+ // { parent: true }
128
+ );
129
+ };
130
+ inst.clone = (def, params) => core.clone(inst, def, params);
131
+ inst.brand = () => inst;
132
+ inst.register = ((reg, meta) => {
133
+ reg.add(inst, meta);
134
+ return inst;
135
+ });
136
+ // parsing
137
+ inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
138
+ inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
139
+ inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
140
+ inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
141
+ inst.spa = inst.safeParseAsync;
142
+ // refinements
143
+ inst.refine = (check, params) => inst.check(refine(check, params));
144
+ inst.superRefine = (refinement) => inst.check(superRefine(refinement));
145
+ inst.overwrite = (fn) => inst.check(checks.overwrite(fn));
146
+ // wrappers
147
+ inst.optional = () => optional(inst);
148
+ inst.nullable = () => nullable(inst);
149
+ inst.nullish = () => optional(nullable(inst));
150
+ inst.nonoptional = (params) => nonoptional(inst, params);
151
+ inst.array = () => array(inst);
152
+ inst.or = (arg) => union([inst, arg]);
153
+ inst.and = (arg) => intersection(inst, arg);
154
+ inst.transform = (tx) => pipe(inst, transform(tx));
155
+ inst.default = (def) => _default(inst, def);
156
+ inst.prefault = (def) => prefault(inst, def);
157
+ // inst.coalesce = (def, params) => coalesce(inst, def, params);
158
+ inst.catch = (params) => _catch(inst, params);
159
+ inst.pipe = (target) => pipe(inst, target);
160
+ inst.readonly = () => readonly(inst);
161
+ // meta
162
+ inst.describe = (description) => {
163
+ const cl = inst.clone();
164
+ core.globalRegistry.add(cl, { description });
165
+ return cl;
166
+ };
167
+ Object.defineProperty(inst, "description", {
168
+ get() {
169
+ return core.globalRegistry.get(inst)?.description;
170
+ },
171
+ configurable: true,
172
+ });
173
+ inst.meta = (...args) => {
174
+ if (args.length === 0) {
175
+ return core.globalRegistry.get(inst);
176
+ }
177
+ const cl = inst.clone();
178
+ core.globalRegistry.add(cl, args[0]);
179
+ return cl;
180
+ };
181
+ // helpers
182
+ inst.isOptional = () => inst.safeParse(undefined).success;
183
+ inst.isNullable = () => inst.safeParse(null).success;
184
+ return inst;
185
+ });
186
+ /** @internal */
187
+ exports._ZodString = core.$constructor("_ZodString", (inst, def) => {
188
+ core.$ZodString.init(inst, def);
189
+ exports.ZodType.init(inst, def);
190
+ const bag = inst._zod.bag;
191
+ inst.format = bag.format ?? null;
192
+ inst.minLength = bag.minimum ?? null;
193
+ inst.maxLength = bag.maximum ?? null;
194
+ // validations
195
+ inst.regex = (...args) => inst.check(checks.regex(...args));
196
+ inst.includes = (...args) => inst.check(checks.includes(...args));
197
+ inst.startsWith = (...args) => inst.check(checks.startsWith(...args));
198
+ inst.endsWith = (...args) => inst.check(checks.endsWith(...args));
199
+ inst.min = (...args) => inst.check(checks.minLength(...args));
200
+ inst.max = (...args) => inst.check(checks.maxLength(...args));
201
+ inst.length = (...args) => inst.check(checks.length(...args));
202
+ inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));
203
+ inst.lowercase = (params) => inst.check(checks.lowercase(params));
204
+ inst.uppercase = (params) => inst.check(checks.uppercase(params));
205
+ // transforms
206
+ inst.trim = () => inst.check(checks.trim());
207
+ inst.normalize = (...args) => inst.check(checks.normalize(...args));
208
+ inst.toLowerCase = () => inst.check(checks.toLowerCase());
209
+ inst.toUpperCase = () => inst.check(checks.toUpperCase());
210
+ });
211
+ exports.ZodString = core.$constructor("ZodString", (inst, def) => {
212
+ core.$ZodString.init(inst, def);
213
+ exports._ZodString.init(inst, def);
214
+ inst.email = (params) => inst.check(core._email(exports.ZodEmail, params));
215
+ inst.url = (params) => inst.check(core._url(exports.ZodURL, params));
216
+ inst.jwt = (params) => inst.check(core._jwt(exports.ZodJWT, params));
217
+ inst.emoji = (params) => inst.check(core._emoji(exports.ZodEmoji, params));
218
+ inst.guid = (params) => inst.check(core._guid(exports.ZodGUID, params));
219
+ inst.uuid = (params) => inst.check(core._uuid(exports.ZodUUID, params));
220
+ inst.uuidv4 = (params) => inst.check(core._uuidv4(exports.ZodUUID, params));
221
+ inst.uuidv6 = (params) => inst.check(core._uuidv6(exports.ZodUUID, params));
222
+ inst.uuidv7 = (params) => inst.check(core._uuidv7(exports.ZodUUID, params));
223
+ inst.nanoid = (params) => inst.check(core._nanoid(exports.ZodNanoID, params));
224
+ inst.guid = (params) => inst.check(core._guid(exports.ZodGUID, params));
225
+ inst.cuid = (params) => inst.check(core._cuid(exports.ZodCUID, params));
226
+ inst.cuid2 = (params) => inst.check(core._cuid2(exports.ZodCUID2, params));
227
+ inst.ulid = (params) => inst.check(core._ulid(exports.ZodULID, params));
228
+ inst.base64 = (params) => inst.check(core._base64(exports.ZodBase64, params));
229
+ inst.base64url = (params) => inst.check(core._base64url(exports.ZodBase64URL, params));
230
+ inst.xid = (params) => inst.check(core._xid(exports.ZodXID, params));
231
+ inst.ksuid = (params) => inst.check(core._ksuid(exports.ZodKSUID, params));
232
+ inst.ipv4 = (params) => inst.check(core._ipv4(exports.ZodIPv4, params));
233
+ inst.ipv6 = (params) => inst.check(core._ipv6(exports.ZodIPv6, params));
234
+ inst.cidrv4 = (params) => inst.check(core._cidrv4(exports.ZodCIDRv4, params));
235
+ inst.cidrv6 = (params) => inst.check(core._cidrv6(exports.ZodCIDRv6, params));
236
+ inst.e164 = (params) => inst.check(core._e164(exports.ZodE164, params));
237
+ // iso
238
+ inst.datetime = (params) => inst.check(iso.datetime(params));
239
+ inst.date = (params) => inst.check(iso.date(params));
240
+ inst.time = (params) => inst.check(iso.time(params));
241
+ inst.duration = (params) => inst.check(iso.duration(params));
242
+ });
243
+ function string(params) {
244
+ return core._string(exports.ZodString, params);
245
+ }
246
+ exports.ZodStringFormat = core.$constructor("ZodStringFormat", (inst, def) => {
247
+ core.$ZodStringFormat.init(inst, def);
248
+ exports._ZodString.init(inst, def);
249
+ });
250
+ exports.ZodEmail = core.$constructor("ZodEmail", (inst, def) => {
251
+ // ZodStringFormat.init(inst, def);
252
+ core.$ZodEmail.init(inst, def);
253
+ exports.ZodStringFormat.init(inst, def);
254
+ });
255
+ function email(params) {
256
+ return core._email(exports.ZodEmail, params);
257
+ }
258
+ exports.ZodGUID = core.$constructor("ZodGUID", (inst, def) => {
259
+ // ZodStringFormat.init(inst, def);
260
+ core.$ZodGUID.init(inst, def);
261
+ exports.ZodStringFormat.init(inst, def);
262
+ });
263
+ function guid(params) {
264
+ return core._guid(exports.ZodGUID, params);
265
+ }
266
+ exports.ZodUUID = core.$constructor("ZodUUID", (inst, def) => {
267
+ // ZodStringFormat.init(inst, def);
268
+ core.$ZodUUID.init(inst, def);
269
+ exports.ZodStringFormat.init(inst, def);
270
+ });
271
+ function uuid(params) {
272
+ return core._uuid(exports.ZodUUID, params);
273
+ }
274
+ function uuidv4(params) {
275
+ return core._uuidv4(exports.ZodUUID, params);
276
+ }
277
+ // ZodUUIDv6
278
+ function uuidv6(params) {
279
+ return core._uuidv6(exports.ZodUUID, params);
280
+ }
281
+ // ZodUUIDv7
282
+ function uuidv7(params) {
283
+ return core._uuidv7(exports.ZodUUID, params);
284
+ }
285
+ exports.ZodURL = core.$constructor("ZodURL", (inst, def) => {
286
+ // ZodStringFormat.init(inst, def);
287
+ core.$ZodURL.init(inst, def);
288
+ exports.ZodStringFormat.init(inst, def);
289
+ });
290
+ function url(params) {
291
+ return core._url(exports.ZodURL, params);
292
+ }
293
+ exports.ZodEmoji = core.$constructor("ZodEmoji", (inst, def) => {
294
+ // ZodStringFormat.init(inst, def);
295
+ core.$ZodEmoji.init(inst, def);
296
+ exports.ZodStringFormat.init(inst, def);
297
+ });
298
+ function emoji(params) {
299
+ return core._emoji(exports.ZodEmoji, params);
300
+ }
301
+ exports.ZodNanoID = core.$constructor("ZodNanoID", (inst, def) => {
302
+ // ZodStringFormat.init(inst, def);
303
+ core.$ZodNanoID.init(inst, def);
304
+ exports.ZodStringFormat.init(inst, def);
305
+ });
306
+ function nanoid(params) {
307
+ return core._nanoid(exports.ZodNanoID, params);
308
+ }
309
+ exports.ZodCUID = core.$constructor("ZodCUID", (inst, def) => {
310
+ // ZodStringFormat.init(inst, def);
311
+ core.$ZodCUID.init(inst, def);
312
+ exports.ZodStringFormat.init(inst, def);
313
+ });
314
+ function cuid(params) {
315
+ return core._cuid(exports.ZodCUID, params);
316
+ }
317
+ exports.ZodCUID2 = core.$constructor("ZodCUID2", (inst, def) => {
318
+ // ZodStringFormat.init(inst, def);
319
+ core.$ZodCUID2.init(inst, def);
320
+ exports.ZodStringFormat.init(inst, def);
321
+ });
322
+ function cuid2(params) {
323
+ return core._cuid2(exports.ZodCUID2, params);
324
+ }
325
+ exports.ZodULID = core.$constructor("ZodULID", (inst, def) => {
326
+ // ZodStringFormat.init(inst, def);
327
+ core.$ZodULID.init(inst, def);
328
+ exports.ZodStringFormat.init(inst, def);
329
+ });
330
+ function ulid(params) {
331
+ return core._ulid(exports.ZodULID, params);
332
+ }
333
+ exports.ZodXID = core.$constructor("ZodXID", (inst, def) => {
334
+ // ZodStringFormat.init(inst, def);
335
+ core.$ZodXID.init(inst, def);
336
+ exports.ZodStringFormat.init(inst, def);
337
+ });
338
+ function xid(params) {
339
+ return core._xid(exports.ZodXID, params);
340
+ }
341
+ exports.ZodKSUID = core.$constructor("ZodKSUID", (inst, def) => {
342
+ // ZodStringFormat.init(inst, def);
343
+ core.$ZodKSUID.init(inst, def);
344
+ exports.ZodStringFormat.init(inst, def);
345
+ });
346
+ function ksuid(params) {
347
+ return core._ksuid(exports.ZodKSUID, params);
348
+ }
349
+ exports.ZodIPv4 = core.$constructor("ZodIPv4", (inst, def) => {
350
+ // ZodStringFormat.init(inst, def);
351
+ core.$ZodIPv4.init(inst, def);
352
+ exports.ZodStringFormat.init(inst, def);
353
+ });
354
+ function ipv4(params) {
355
+ return core._ipv4(exports.ZodIPv4, params);
356
+ }
357
+ exports.ZodIPv6 = core.$constructor("ZodIPv6", (inst, def) => {
358
+ // ZodStringFormat.init(inst, def);
359
+ core.$ZodIPv6.init(inst, def);
360
+ exports.ZodStringFormat.init(inst, def);
361
+ });
362
+ function ipv6(params) {
363
+ return core._ipv6(exports.ZodIPv6, params);
364
+ }
365
+ exports.ZodCIDRv4 = core.$constructor("ZodCIDRv4", (inst, def) => {
366
+ core.$ZodCIDRv4.init(inst, def);
367
+ exports.ZodStringFormat.init(inst, def);
368
+ });
369
+ function cidrv4(params) {
370
+ return core._cidrv4(exports.ZodCIDRv4, params);
371
+ }
372
+ exports.ZodCIDRv6 = core.$constructor("ZodCIDRv6", (inst, def) => {
373
+ core.$ZodCIDRv6.init(inst, def);
374
+ exports.ZodStringFormat.init(inst, def);
375
+ });
376
+ function cidrv6(params) {
377
+ return core._cidrv6(exports.ZodCIDRv6, params);
378
+ }
379
+ exports.ZodBase64 = core.$constructor("ZodBase64", (inst, def) => {
380
+ // ZodStringFormat.init(inst, def);
381
+ core.$ZodBase64.init(inst, def);
382
+ exports.ZodStringFormat.init(inst, def);
383
+ });
384
+ function base64(params) {
385
+ return core._base64(exports.ZodBase64, params);
386
+ }
387
+ exports.ZodBase64URL = core.$constructor("ZodBase64URL", (inst, def) => {
388
+ // ZodStringFormat.init(inst, def);
389
+ core.$ZodBase64URL.init(inst, def);
390
+ exports.ZodStringFormat.init(inst, def);
391
+ });
392
+ function base64url(params) {
393
+ return core._base64url(exports.ZodBase64URL, params);
394
+ }
395
+ exports.ZodE164 = core.$constructor("ZodE164", (inst, def) => {
396
+ // ZodStringFormat.init(inst, def);
397
+ core.$ZodE164.init(inst, def);
398
+ exports.ZodStringFormat.init(inst, def);
399
+ });
400
+ function e164(params) {
401
+ return core._e164(exports.ZodE164, params);
402
+ }
403
+ exports.ZodJWT = core.$constructor("ZodJWT", (inst, def) => {
404
+ // ZodStringFormat.init(inst, def);
405
+ core.$ZodJWT.init(inst, def);
406
+ exports.ZodStringFormat.init(inst, def);
407
+ });
408
+ function jwt(params) {
409
+ return core._jwt(exports.ZodJWT, params);
410
+ }
411
+ exports.ZodCustomStringFormat = core.$constructor("ZodCustomStringFormat", (inst, def) => {
412
+ // ZodStringFormat.init(inst, def);
413
+ core.$ZodCustomStringFormat.init(inst, def);
414
+ exports.ZodStringFormat.init(inst, def);
415
+ });
416
+ function stringFormat(format, fnOrRegex, _params = {}) {
417
+ return core._stringFormat(exports.ZodCustomStringFormat, format, fnOrRegex, _params);
418
+ }
419
+ exports.ZodNumber = core.$constructor("ZodNumber", (inst, def) => {
420
+ core.$ZodNumber.init(inst, def);
421
+ exports.ZodType.init(inst, def);
422
+ inst.gt = (value, params) => inst.check(checks.gt(value, params));
423
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
424
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
425
+ inst.lt = (value, params) => inst.check(checks.lt(value, params));
426
+ inst.lte = (value, params) => inst.check(checks.lte(value, params));
427
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
428
+ inst.int = (params) => inst.check(int(params));
429
+ inst.safe = (params) => inst.check(int(params));
430
+ inst.positive = (params) => inst.check(checks.gt(0, params));
431
+ inst.nonnegative = (params) => inst.check(checks.gte(0, params));
432
+ inst.negative = (params) => inst.check(checks.lt(0, params));
433
+ inst.nonpositive = (params) => inst.check(checks.lte(0, params));
434
+ inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
435
+ inst.step = (value, params) => inst.check(checks.multipleOf(value, params));
436
+ // inst.finite = (params) => inst.check(core.finite(params));
437
+ inst.finite = () => inst;
438
+ const bag = inst._zod.bag;
439
+ inst.minValue =
440
+ Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
441
+ inst.maxValue =
442
+ Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
443
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
444
+ inst.isFinite = true;
445
+ inst.format = bag.format ?? null;
446
+ });
447
+ function number(params) {
448
+ return core._number(exports.ZodNumber, params);
449
+ }
450
+ exports.ZodNumberFormat = core.$constructor("ZodNumberFormat", (inst, def) => {
451
+ core.$ZodNumberFormat.init(inst, def);
452
+ exports.ZodNumber.init(inst, def);
453
+ });
454
+ function int(params) {
455
+ return core._int(exports.ZodNumberFormat, params);
456
+ }
457
+ function float32(params) {
458
+ return core._float32(exports.ZodNumberFormat, params);
459
+ }
460
+ function float64(params) {
461
+ return core._float64(exports.ZodNumberFormat, params);
462
+ }
463
+ function int32(params) {
464
+ return core._int32(exports.ZodNumberFormat, params);
465
+ }
466
+ function uint32(params) {
467
+ return core._uint32(exports.ZodNumberFormat, params);
468
+ }
469
+ exports.ZodBoolean = core.$constructor("ZodBoolean", (inst, def) => {
470
+ core.$ZodBoolean.init(inst, def);
471
+ exports.ZodType.init(inst, def);
472
+ });
473
+ function boolean(params) {
474
+ return core._boolean(exports.ZodBoolean, params);
475
+ }
476
+ exports.ZodBigInt = core.$constructor("ZodBigInt", (inst, def) => {
477
+ core.$ZodBigInt.init(inst, def);
478
+ exports.ZodType.init(inst, def);
479
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
480
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
481
+ inst.gt = (value, params) => inst.check(checks.gt(value, params));
482
+ inst.gte = (value, params) => inst.check(checks.gte(value, params));
483
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
484
+ inst.lt = (value, params) => inst.check(checks.lt(value, params));
485
+ inst.lte = (value, params) => inst.check(checks.lte(value, params));
486
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
487
+ inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));
488
+ inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));
489
+ inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));
490
+ inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));
491
+ inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
492
+ const bag = inst._zod.bag;
493
+ inst.minValue = bag.minimum ?? null;
494
+ inst.maxValue = bag.maximum ?? null;
495
+ inst.format = bag.format ?? null;
496
+ });
497
+ function bigint(params) {
498
+ return core._bigint(exports.ZodBigInt, params);
499
+ }
500
+ exports.ZodBigIntFormat = core.$constructor("ZodBigIntFormat", (inst, def) => {
501
+ core.$ZodBigIntFormat.init(inst, def);
502
+ exports.ZodBigInt.init(inst, def);
503
+ });
504
+ // int64
505
+ function int64(params) {
506
+ return core._int64(exports.ZodBigIntFormat, params);
507
+ }
508
+ // uint64
509
+ function uint64(params) {
510
+ return core._uint64(exports.ZodBigIntFormat, params);
511
+ }
512
+ exports.ZodSymbol = core.$constructor("ZodSymbol", (inst, def) => {
513
+ core.$ZodSymbol.init(inst, def);
514
+ exports.ZodType.init(inst, def);
515
+ });
516
+ function symbol(params) {
517
+ return core._symbol(exports.ZodSymbol, params);
518
+ }
519
+ exports.ZodUndefined = core.$constructor("ZodUndefined", (inst, def) => {
520
+ core.$ZodUndefined.init(inst, def);
521
+ exports.ZodType.init(inst, def);
522
+ });
523
+ function _undefined(params) {
524
+ return core._undefined(exports.ZodUndefined, params);
525
+ }
526
+ exports.ZodNull = core.$constructor("ZodNull", (inst, def) => {
527
+ core.$ZodNull.init(inst, def);
528
+ exports.ZodType.init(inst, def);
529
+ });
530
+ function _null(params) {
531
+ return core._null(exports.ZodNull, params);
532
+ }
533
+ exports.ZodAny = core.$constructor("ZodAny", (inst, def) => {
534
+ core.$ZodAny.init(inst, def);
535
+ exports.ZodType.init(inst, def);
536
+ });
537
+ function any() {
538
+ return core._any(exports.ZodAny);
539
+ }
540
+ exports.ZodUnknown = core.$constructor("ZodUnknown", (inst, def) => {
541
+ core.$ZodUnknown.init(inst, def);
542
+ exports.ZodType.init(inst, def);
543
+ });
544
+ function unknown() {
545
+ return core._unknown(exports.ZodUnknown);
546
+ }
547
+ exports.ZodNever = core.$constructor("ZodNever", (inst, def) => {
548
+ core.$ZodNever.init(inst, def);
549
+ exports.ZodType.init(inst, def);
550
+ });
551
+ function never(params) {
552
+ return core._never(exports.ZodNever, params);
553
+ }
554
+ exports.ZodVoid = core.$constructor("ZodVoid", (inst, def) => {
555
+ core.$ZodVoid.init(inst, def);
556
+ exports.ZodType.init(inst, def);
557
+ });
558
+ function _void(params) {
559
+ return core._void(exports.ZodVoid, params);
560
+ }
561
+ exports.ZodDate = core.$constructor("ZodDate", (inst, def) => {
562
+ core.$ZodDate.init(inst, def);
563
+ exports.ZodType.init(inst, def);
564
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
565
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
566
+ const c = inst._zod.bag;
567
+ inst.minDate = c.minimum ? new Date(c.minimum) : null;
568
+ inst.maxDate = c.maximum ? new Date(c.maximum) : null;
569
+ });
570
+ function date(params) {
571
+ return core._date(exports.ZodDate, params);
572
+ }
573
+ exports.ZodArray = core.$constructor("ZodArray", (inst, def) => {
574
+ core.$ZodArray.init(inst, def);
575
+ exports.ZodType.init(inst, def);
576
+ inst.element = def.element;
577
+ inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));
578
+ inst.nonempty = (params) => inst.check(checks.minLength(1, params));
579
+ inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));
580
+ inst.length = (len, params) => inst.check(checks.length(len, params));
581
+ inst.unwrap = () => inst.element;
582
+ });
583
+ function array(element, params) {
584
+ return core._array(exports.ZodArray, element, params);
585
+ }
586
+ // .keyof
587
+ function keyof(schema) {
588
+ const shape = schema._zod.def.shape;
589
+ return literal(Object.keys(shape));
590
+ }
591
+ exports.ZodObject = core.$constructor("ZodObject", (inst, def) => {
592
+ core.$ZodObject.init(inst, def);
593
+ exports.ZodType.init(inst, def);
594
+ index_js_1.util.defineLazy(inst, "shape", () => def.shape);
595
+ inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
596
+ inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall: catchall });
597
+ inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
598
+ // inst.nonstrict = () => inst.clone({ ...inst._zod.def, catchall: api.unknown() });
599
+ inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
600
+ inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
601
+ inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });
602
+ inst.extend = (incoming) => {
603
+ return index_js_1.util.extend(inst, incoming);
604
+ };
605
+ inst.merge = (other) => index_js_1.util.merge(inst, other);
606
+ inst.pick = (mask) => index_js_1.util.pick(inst, mask);
607
+ inst.omit = (mask) => index_js_1.util.omit(inst, mask);
608
+ inst.partial = (...args) => index_js_1.util.partial(exports.ZodOptional, inst, args[0]);
609
+ inst.required = (...args) => index_js_1.util.required(exports.ZodNonOptional, inst, args[0]);
610
+ });
611
+ function object(shape, params) {
612
+ const def = {
613
+ type: "object",
614
+ get shape() {
615
+ index_js_1.util.assignProp(this, "shape", { ...shape });
616
+ return this.shape;
617
+ },
618
+ ...index_js_1.util.normalizeParams(params),
619
+ };
620
+ return new exports.ZodObject(def);
621
+ }
622
+ // strictObject
623
+ function strictObject(shape, params) {
624
+ return new exports.ZodObject({
625
+ type: "object",
626
+ get shape() {
627
+ index_js_1.util.assignProp(this, "shape", { ...shape });
628
+ return this.shape;
629
+ },
630
+ catchall: never(),
631
+ ...index_js_1.util.normalizeParams(params),
632
+ });
633
+ }
634
+ // looseObject
635
+ function looseObject(shape, params) {
636
+ return new exports.ZodObject({
637
+ type: "object",
638
+ get shape() {
639
+ index_js_1.util.assignProp(this, "shape", { ...shape });
640
+ return this.shape;
641
+ },
642
+ catchall: unknown(),
643
+ ...index_js_1.util.normalizeParams(params),
644
+ });
645
+ }
646
+ exports.ZodUnion = core.$constructor("ZodUnion", (inst, def) => {
647
+ core.$ZodUnion.init(inst, def);
648
+ exports.ZodType.init(inst, def);
649
+ inst.options = def.options;
650
+ });
651
+ function union(options, params) {
652
+ return new exports.ZodUnion({
653
+ type: "union",
654
+ options: options,
655
+ ...index_js_1.util.normalizeParams(params),
656
+ });
657
+ }
658
+ exports.ZodDiscriminatedUnion = core.$constructor("ZodDiscriminatedUnion", (inst, def) => {
659
+ exports.ZodUnion.init(inst, def);
660
+ core.$ZodDiscriminatedUnion.init(inst, def);
661
+ });
662
+ function discriminatedUnion(discriminator, options, params) {
663
+ // const [options, params] = args;
664
+ return new exports.ZodDiscriminatedUnion({
665
+ type: "union",
666
+ options,
667
+ discriminator,
668
+ ...index_js_1.util.normalizeParams(params),
669
+ });
670
+ }
671
+ exports.ZodIntersection = core.$constructor("ZodIntersection", (inst, def) => {
672
+ core.$ZodIntersection.init(inst, def);
673
+ exports.ZodType.init(inst, def);
674
+ });
675
+ function intersection(left, right) {
676
+ return new exports.ZodIntersection({
677
+ type: "intersection",
678
+ left: left,
679
+ right: right,
680
+ });
681
+ }
682
+ exports.ZodTuple = core.$constructor("ZodTuple", (inst, def) => {
683
+ core.$ZodTuple.init(inst, def);
684
+ exports.ZodType.init(inst, def);
685
+ inst.rest = (rest) => inst.clone({
686
+ ...inst._zod.def,
687
+ rest: rest,
688
+ });
689
+ });
690
+ function tuple(items, _paramsOrRest, _params) {
691
+ const hasRest = _paramsOrRest instanceof core.$ZodType;
692
+ const params = hasRest ? _params : _paramsOrRest;
693
+ const rest = hasRest ? _paramsOrRest : null;
694
+ return new exports.ZodTuple({
695
+ type: "tuple",
696
+ items: items,
697
+ rest,
698
+ ...index_js_1.util.normalizeParams(params),
699
+ });
700
+ }
701
+ exports.ZodRecord = core.$constructor("ZodRecord", (inst, def) => {
702
+ core.$ZodRecord.init(inst, def);
703
+ exports.ZodType.init(inst, def);
704
+ inst.keyType = def.keyType;
705
+ inst.valueType = def.valueType;
706
+ });
707
+ function record(keyType, valueType, params) {
708
+ return new exports.ZodRecord({
709
+ type: "record",
710
+ keyType,
711
+ valueType: valueType,
712
+ ...index_js_1.util.normalizeParams(params),
713
+ });
714
+ }
715
+ // type alksjf = core.output<core.$ZodRecordKey>;
716
+ function partialRecord(keyType, valueType, params) {
717
+ return new exports.ZodRecord({
718
+ type: "record",
719
+ keyType: union([keyType, never()]),
720
+ valueType: valueType,
721
+ ...index_js_1.util.normalizeParams(params),
722
+ });
723
+ }
724
+ exports.ZodMap = core.$constructor("ZodMap", (inst, def) => {
725
+ core.$ZodMap.init(inst, def);
726
+ exports.ZodType.init(inst, def);
727
+ inst.keyType = def.keyType;
728
+ inst.valueType = def.valueType;
729
+ });
730
+ function map(keyType, valueType, params) {
731
+ return new exports.ZodMap({
732
+ type: "map",
733
+ keyType: keyType,
734
+ valueType: valueType,
735
+ ...index_js_1.util.normalizeParams(params),
736
+ });
737
+ }
738
+ exports.ZodSet = core.$constructor("ZodSet", (inst, def) => {
739
+ core.$ZodSet.init(inst, def);
740
+ exports.ZodType.init(inst, def);
741
+ inst.min = (...args) => inst.check(core._minSize(...args));
742
+ inst.nonempty = (params) => inst.check(core._minSize(1, params));
743
+ inst.max = (...args) => inst.check(core._maxSize(...args));
744
+ inst.size = (...args) => inst.check(core._size(...args));
745
+ });
746
+ function set(valueType, params) {
747
+ return new exports.ZodSet({
748
+ type: "set",
749
+ valueType: valueType,
750
+ ...index_js_1.util.normalizeParams(params),
751
+ });
752
+ }
753
+ exports.ZodEnum = core.$constructor("ZodEnum", (inst, def) => {
754
+ core.$ZodEnum.init(inst, def);
755
+ exports.ZodType.init(inst, def);
756
+ inst.enum = def.entries;
757
+ inst.options = Object.values(def.entries);
758
+ const keys = new Set(Object.keys(def.entries));
759
+ inst.extract = (values, params) => {
760
+ const newEntries = {};
761
+ for (const value of values) {
762
+ if (keys.has(value)) {
763
+ newEntries[value] = def.entries[value];
764
+ }
765
+ else
766
+ throw new Error(`Key ${value} not found in enum`);
767
+ }
768
+ return new exports.ZodEnum({
769
+ ...def,
770
+ checks: [],
771
+ ...index_js_1.util.normalizeParams(params),
772
+ entries: newEntries,
773
+ });
774
+ };
775
+ inst.exclude = (values, params) => {
776
+ const newEntries = { ...def.entries };
777
+ for (const value of values) {
778
+ if (keys.has(value)) {
779
+ delete newEntries[value];
780
+ }
781
+ else
782
+ throw new Error(`Key ${value} not found in enum`);
783
+ }
784
+ return new exports.ZodEnum({
785
+ ...def,
786
+ checks: [],
787
+ ...index_js_1.util.normalizeParams(params),
788
+ entries: newEntries,
789
+ });
790
+ };
791
+ });
792
+ function _enum(values, params) {
793
+ const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
794
+ return new exports.ZodEnum({
795
+ type: "enum",
796
+ entries,
797
+ ...index_js_1.util.normalizeParams(params),
798
+ });
799
+ }
800
+ /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
801
+ *
802
+ * ```ts
803
+ * enum Colors { red, green, blue }
804
+ * z.enum(Colors);
805
+ * ```
806
+ */
807
+ function nativeEnum(entries, params) {
808
+ return new exports.ZodEnum({
809
+ type: "enum",
810
+ entries,
811
+ ...index_js_1.util.normalizeParams(params),
812
+ });
813
+ }
814
+ exports.ZodLiteral = core.$constructor("ZodLiteral", (inst, def) => {
815
+ core.$ZodLiteral.init(inst, def);
816
+ exports.ZodType.init(inst, def);
817
+ inst.values = new Set(def.values);
818
+ Object.defineProperty(inst, "value", {
819
+ get() {
820
+ if (def.values.length > 1) {
821
+ throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
822
+ }
823
+ return def.values[0];
824
+ },
825
+ });
826
+ });
827
+ function literal(value, params) {
828
+ return new exports.ZodLiteral({
829
+ type: "literal",
830
+ values: Array.isArray(value) ? value : [value],
831
+ ...index_js_1.util.normalizeParams(params),
832
+ });
833
+ }
834
+ exports.ZodFile = core.$constructor("ZodFile", (inst, def) => {
835
+ core.$ZodFile.init(inst, def);
836
+ exports.ZodType.init(inst, def);
837
+ inst.min = (size, params) => inst.check(core._minSize(size, params));
838
+ inst.max = (size, params) => inst.check(core._maxSize(size, params));
839
+ inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));
840
+ });
841
+ function file(params) {
842
+ return core._file(exports.ZodFile, params);
843
+ }
844
+ exports.ZodTransform = core.$constructor("ZodTransform", (inst, def) => {
845
+ core.$ZodTransform.init(inst, def);
846
+ exports.ZodType.init(inst, def);
847
+ inst._zod.parse = (payload, _ctx) => {
848
+ payload.addIssue = (issue) => {
849
+ if (typeof issue === "string") {
850
+ payload.issues.push(index_js_1.util.issue(issue, payload.value, def));
851
+ }
852
+ else {
853
+ // for Zod 3 backwards compatibility
854
+ const _issue = issue;
855
+ if (_issue.fatal)
856
+ _issue.continue = false;
857
+ _issue.code ?? (_issue.code = "custom");
858
+ _issue.input ?? (_issue.input = payload.value);
859
+ _issue.inst ?? (_issue.inst = inst);
860
+ _issue.continue ?? (_issue.continue = true);
861
+ payload.issues.push(index_js_1.util.issue(_issue));
862
+ }
863
+ };
864
+ const output = def.transform(payload.value, payload);
865
+ if (output instanceof Promise) {
866
+ return output.then((output) => {
867
+ payload.value = output;
868
+ return payload;
869
+ });
870
+ }
871
+ payload.value = output;
872
+ return payload;
873
+ };
874
+ });
875
+ function transform(fn) {
876
+ return new exports.ZodTransform({
877
+ type: "transform",
878
+ transform: fn,
879
+ });
880
+ }
881
+ exports.ZodOptional = core.$constructor("ZodOptional", (inst, def) => {
882
+ core.$ZodOptional.init(inst, def);
883
+ exports.ZodType.init(inst, def);
884
+ inst.unwrap = () => inst._zod.def.innerType;
885
+ });
886
+ function optional(innerType) {
887
+ return new exports.ZodOptional({
888
+ type: "optional",
889
+ innerType: innerType,
890
+ });
891
+ }
892
+ exports.ZodNullable = core.$constructor("ZodNullable", (inst, def) => {
893
+ core.$ZodNullable.init(inst, def);
894
+ exports.ZodType.init(inst, def);
895
+ inst.unwrap = () => inst._zod.def.innerType;
896
+ });
897
+ function nullable(innerType) {
898
+ return new exports.ZodNullable({
899
+ type: "nullable",
900
+ innerType: innerType,
901
+ });
902
+ }
903
+ // nullish
904
+ function nullish(innerType) {
905
+ return optional(nullable(innerType));
906
+ }
907
+ exports.ZodDefault = core.$constructor("ZodDefault", (inst, def) => {
908
+ core.$ZodDefault.init(inst, def);
909
+ exports.ZodType.init(inst, def);
910
+ inst.unwrap = () => inst._zod.def.innerType;
911
+ inst.removeDefault = inst.unwrap;
912
+ });
913
+ function _default(innerType, defaultValue) {
914
+ return new exports.ZodDefault({
915
+ type: "default",
916
+ innerType: innerType,
917
+ get defaultValue() {
918
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
919
+ },
920
+ });
921
+ }
922
+ exports.ZodPrefault = core.$constructor("ZodPrefault", (inst, def) => {
923
+ core.$ZodPrefault.init(inst, def);
924
+ exports.ZodType.init(inst, def);
925
+ inst.unwrap = () => inst._zod.def.innerType;
926
+ });
927
+ function prefault(innerType, defaultValue) {
928
+ return new exports.ZodPrefault({
929
+ type: "prefault",
930
+ innerType: innerType,
931
+ get defaultValue() {
932
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
933
+ },
934
+ });
935
+ }
936
+ exports.ZodNonOptional = core.$constructor("ZodNonOptional", (inst, def) => {
937
+ core.$ZodNonOptional.init(inst, def);
938
+ exports.ZodType.init(inst, def);
939
+ inst.unwrap = () => inst._zod.def.innerType;
940
+ });
941
+ function nonoptional(innerType, params) {
942
+ return new exports.ZodNonOptional({
943
+ type: "nonoptional",
944
+ innerType: innerType,
945
+ ...index_js_1.util.normalizeParams(params),
946
+ });
947
+ }
948
+ exports.ZodSuccess = core.$constructor("ZodSuccess", (inst, def) => {
949
+ core.$ZodSuccess.init(inst, def);
950
+ exports.ZodType.init(inst, def);
951
+ inst.unwrap = () => inst._zod.def.innerType;
952
+ });
953
+ function success(innerType) {
954
+ return new exports.ZodSuccess({
955
+ type: "success",
956
+ innerType: innerType,
957
+ });
958
+ }
959
+ exports.ZodCatch = core.$constructor("ZodCatch", (inst, def) => {
960
+ core.$ZodCatch.init(inst, def);
961
+ exports.ZodType.init(inst, def);
962
+ inst.unwrap = () => inst._zod.def.innerType;
963
+ inst.removeCatch = inst.unwrap;
964
+ });
965
+ function _catch(innerType, catchValue) {
966
+ return new exports.ZodCatch({
967
+ type: "catch",
968
+ innerType: innerType,
969
+ catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue),
970
+ });
971
+ }
972
+ exports.ZodNaN = core.$constructor("ZodNaN", (inst, def) => {
973
+ core.$ZodNaN.init(inst, def);
974
+ exports.ZodType.init(inst, def);
975
+ });
976
+ function nan(params) {
977
+ return core._nan(exports.ZodNaN, params);
978
+ }
979
+ exports.ZodPipe = core.$constructor("ZodPipe", (inst, def) => {
980
+ core.$ZodPipe.init(inst, def);
981
+ exports.ZodType.init(inst, def);
982
+ inst.in = def.in;
983
+ inst.out = def.out;
984
+ });
985
+ function pipe(in_, out) {
986
+ return new exports.ZodPipe({
987
+ type: "pipe",
988
+ in: in_,
989
+ out: out,
990
+ // ...util.normalizeParams(params),
991
+ });
992
+ }
993
+ exports.ZodReadonly = core.$constructor("ZodReadonly", (inst, def) => {
994
+ core.$ZodReadonly.init(inst, def);
995
+ exports.ZodType.init(inst, def);
996
+ });
997
+ function readonly(innerType) {
998
+ return new exports.ZodReadonly({
999
+ type: "readonly",
1000
+ innerType: innerType,
1001
+ });
1002
+ }
1003
+ exports.ZodTemplateLiteral = core.$constructor("ZodTemplateLiteral", (inst, def) => {
1004
+ core.$ZodTemplateLiteral.init(inst, def);
1005
+ exports.ZodType.init(inst, def);
1006
+ });
1007
+ function templateLiteral(parts, params) {
1008
+ return new exports.ZodTemplateLiteral({
1009
+ type: "template_literal",
1010
+ parts,
1011
+ ...index_js_1.util.normalizeParams(params),
1012
+ });
1013
+ }
1014
+ exports.ZodLazy = core.$constructor("ZodLazy", (inst, def) => {
1015
+ core.$ZodLazy.init(inst, def);
1016
+ exports.ZodType.init(inst, def);
1017
+ inst.unwrap = () => inst._zod.def.getter();
1018
+ });
1019
+ function lazy(getter) {
1020
+ return new exports.ZodLazy({
1021
+ type: "lazy",
1022
+ getter: getter,
1023
+ });
1024
+ }
1025
+ exports.ZodPromise = core.$constructor("ZodPromise", (inst, def) => {
1026
+ core.$ZodPromise.init(inst, def);
1027
+ exports.ZodType.init(inst, def);
1028
+ inst.unwrap = () => inst._zod.def.innerType;
1029
+ });
1030
+ function promise(innerType) {
1031
+ return new exports.ZodPromise({
1032
+ type: "promise",
1033
+ innerType: innerType,
1034
+ });
1035
+ }
1036
+ exports.ZodCustom = core.$constructor("ZodCustom", (inst, def) => {
1037
+ core.$ZodCustom.init(inst, def);
1038
+ exports.ZodType.init(inst, def);
1039
+ });
1040
+ // custom checks
1041
+ function check(fn) {
1042
+ const ch = new core.$ZodCheck({
1043
+ check: "custom",
1044
+ // ...util.normalizeParams(params),
1045
+ });
1046
+ ch._zod.check = fn;
1047
+ return ch;
1048
+ }
1049
+ function custom(fn, _params) {
1050
+ return core._custom(exports.ZodCustom, fn ?? (() => true), _params);
1051
+ }
1052
+ function refine(fn, _params = {}) {
1053
+ return core._refine(exports.ZodCustom, fn, _params);
1054
+ }
1055
+ // superRefine
1056
+ function superRefine(fn) {
1057
+ const ch = check((payload) => {
1058
+ payload.addIssue = (issue) => {
1059
+ if (typeof issue === "string") {
1060
+ payload.issues.push(index_js_1.util.issue(issue, payload.value, ch._zod.def));
1061
+ }
1062
+ else {
1063
+ // for Zod 3 backwards compatibility
1064
+ const _issue = issue;
1065
+ if (_issue.fatal)
1066
+ _issue.continue = false;
1067
+ _issue.code ?? (_issue.code = "custom");
1068
+ _issue.input ?? (_issue.input = payload.value);
1069
+ _issue.inst ?? (_issue.inst = ch);
1070
+ _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
1071
+ payload.issues.push(index_js_1.util.issue(_issue));
1072
+ }
1073
+ };
1074
+ return fn(payload.value, payload);
1075
+ });
1076
+ return ch;
1077
+ }
1078
+ function _instanceof(cls, params = {
1079
+ error: `Input not instance of ${cls.name}`,
1080
+ }) {
1081
+ const inst = new exports.ZodCustom({
1082
+ type: "custom",
1083
+ check: "custom",
1084
+ fn: (data) => data instanceof cls,
1085
+ abort: true,
1086
+ ...index_js_1.util.normalizeParams(params),
1087
+ });
1088
+ inst._zod.bag.Class = cls;
1089
+ return inst;
1090
+ }
1091
+ // stringbool
1092
+ const stringbool = (...args) => core._stringbool({
1093
+ Pipe: exports.ZodPipe,
1094
+ Boolean: exports.ZodBoolean,
1095
+ String: exports.ZodString,
1096
+ Transform: exports.ZodTransform,
1097
+ }, ...args);
1098
+ exports.stringbool = stringbool;
1099
+ function json(params) {
1100
+ const jsonSchema = lazy(() => {
1101
+ return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
1102
+ });
1103
+ return jsonSchema;
1104
+ }
1105
+ // preprocess
1106
+ // /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
1107
+ function preprocess(fn, schema) {
1108
+ return pipe(transform(fn), schema);
1109
+ }