@windrun-huaiin/third-ui 7.6.1 → 10.0.0

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 (577) hide show
  1. package/dist/_virtual/advancedFormat.js +1 -1
  2. package/dist/_virtual/advancedFormat.mjs +1 -1
  3. package/dist/_virtual/customParseFormat.js +1 -1
  4. package/dist/_virtual/customParseFormat.mjs +1 -1
  5. package/dist/_virtual/dayjs.min.js +1 -1
  6. package/dist/_virtual/dayjs.min.mjs +1 -1
  7. package/dist/_virtual/isoWeek.js +1 -1
  8. package/dist/_virtual/isoWeek.mjs +1 -1
  9. package/dist/clerk/clerk-organization.js +1 -1
  10. package/dist/clerk/clerk-organization.mjs +1 -1
  11. package/dist/clerk/{clerk-page-generator-client.js → clerk-page-context-generator.js} +2 -2
  12. package/dist/clerk/{clerk-page-generator-client.mjs → clerk-page-context-generator.mjs} +2 -2
  13. package/dist/clerk/clerk-page-generator.js +3 -3
  14. package/dist/clerk/clerk-page-generator.mjs +3 -3
  15. package/dist/clerk/clerk-user-client.js +4 -3
  16. package/dist/clerk/clerk-user-client.mjs +4 -3
  17. package/dist/clerk/clerk-user.js +1 -1
  18. package/dist/clerk/clerk-user.mjs +1 -1
  19. package/dist/clerk/fingerprint/fingerprint-client.js +1 -1
  20. package/dist/clerk/fingerprint/fingerprint-client.mjs +1 -1
  21. package/dist/clerk/fingerprint/fingerprint-provider.js +147 -56
  22. package/dist/clerk/fingerprint/fingerprint-provider.mjs +148 -57
  23. package/dist/clerk/fingerprint/fingerprint-server.d.ts +16 -0
  24. package/dist/clerk/fingerprint/fingerprint-server.js +18 -0
  25. package/dist/clerk/fingerprint/fingerprint-server.mjs +18 -1
  26. package/dist/clerk/fingerprint/server.js +1 -0
  27. package/dist/clerk/fingerprint/server.mjs +1 -1
  28. package/dist/clerk/fingerprint/types.d.ts +13 -2
  29. package/dist/clerk/fingerprint/use-fingerprint.js +1 -1
  30. package/dist/clerk/fingerprint/use-fingerprint.mjs +1 -1
  31. package/dist/clerk/index.d.ts +2 -1
  32. package/dist/clerk/index.js +5 -3
  33. package/dist/clerk/index.mjs +2 -1
  34. package/dist/clerk/signin-with-fingerprint-client.js +4 -11
  35. package/dist/clerk/signin-with-fingerprint-client.mjs +4 -11
  36. package/dist/clerk/signup-button-with-fingerprint-client.d.ts +6 -0
  37. package/dist/clerk/signup-button-with-fingerprint-client.js +56 -0
  38. package/dist/clerk/signup-button-with-fingerprint-client.mjs +54 -0
  39. package/dist/clerk/signup-with-fingerprint-client.js +4 -11
  40. package/dist/clerk/signup-with-fingerprint-client.mjs +4 -11
  41. package/dist/fuma/base/custom-header.d.ts +38 -0
  42. package/dist/fuma/base/custom-header.js +163 -0
  43. package/dist/fuma/base/custom-header.mjs +161 -0
  44. package/dist/fuma/base/custom-home-layout.d.ts +68 -0
  45. package/dist/fuma/base/custom-home-layout.js +48 -0
  46. package/dist/fuma/base/custom-home-layout.mjs +46 -0
  47. package/dist/fuma/base/index.d.ts +2 -0
  48. package/dist/fuma/base/index.js +9 -0
  49. package/dist/fuma/base/index.mjs +2 -0
  50. package/dist/fuma/fuma-banner-suit.d.ts +2 -1
  51. package/dist/fuma/fuma-banner-suit.js +9 -3
  52. package/dist/fuma/fuma-banner-suit.mjs +9 -3
  53. package/dist/fuma/fuma-page-genarator.d.ts +4 -1
  54. package/dist/fuma/fuma-page-genarator.js +15 -6
  55. package/dist/fuma/fuma-page-genarator.mjs +15 -6
  56. package/dist/fuma/fuma-translate-util.d.ts +2 -0
  57. package/dist/fuma/fuma-translate-util.js +40 -0
  58. package/dist/fuma/fuma-translate-util.mjs +38 -0
  59. package/dist/fuma/llm-copy-handler.js +9 -8
  60. package/dist/fuma/llm-copy-handler.mjs +9 -8
  61. package/dist/fuma/mdx/banner.d.ts +7 -1
  62. package/dist/fuma/mdx/banner.js +15 -15
  63. package/dist/fuma/mdx/banner.mjs +15 -15
  64. package/dist/fuma/mdx/fuma-github-info.js +1 -1
  65. package/dist/fuma/mdx/fuma-github-info.mjs +1 -1
  66. package/dist/fuma/mdx/gradient-button.js +29 -18
  67. package/dist/fuma/mdx/gradient-button.mjs +29 -18
  68. package/dist/fuma/mdx/image-zoom.js +2 -2
  69. package/dist/fuma/mdx/image-zoom.mjs +2 -2
  70. package/dist/fuma/mdx/mermaid.js +3 -3
  71. package/dist/fuma/mdx/mermaid.mjs +3 -3
  72. package/dist/fuma/mdx/toc-base.js +9 -4
  73. package/dist/fuma/mdx/toc-base.mjs +9 -4
  74. package/dist/fuma/mdx/zia-card.js +3 -3
  75. package/dist/fuma/mdx/zia-card.mjs +3 -3
  76. package/dist/fuma/mdx/zia-file.js +1 -1
  77. package/dist/fuma/mdx/zia-file.mjs +1 -1
  78. package/dist/fuma/server.d.ts +1 -0
  79. package/dist/fuma/server.js +2 -0
  80. package/dist/fuma/server.mjs +1 -0
  81. package/dist/fuma/site-x.js +1 -1
  82. package/dist/fuma/site-x.mjs +1 -1
  83. package/dist/lib/fuma-schema-check-util.d.ts +4 -57
  84. package/dist/lib/fuma-schema-check-util.js +10 -31
  85. package/dist/lib/fuma-schema-check-util.mjs +11 -29
  86. package/dist/lib/server.d.ts +0 -1
  87. package/dist/lib/server.js +0 -5
  88. package/dist/lib/server.mjs +1 -2
  89. package/dist/main/ai-prompt-textarea.js +1 -1
  90. package/dist/main/ai-prompt-textarea.mjs +1 -1
  91. package/dist/main/credit/credit-nav-button.d.ts +21 -0
  92. package/dist/main/credit/credit-nav-button.js +117 -0
  93. package/dist/main/credit/credit-nav-button.mjs +114 -0
  94. package/dist/main/credit/credit-overview-client.d.ts +26 -0
  95. package/dist/main/credit/credit-overview-client.js +269 -0
  96. package/dist/main/credit/credit-overview-client.mjs +267 -0
  97. package/dist/main/credit/credit-overview.d.ts +8 -0
  98. package/dist/main/credit/credit-overview.js +34 -0
  99. package/dist/main/credit/credit-overview.mjs +32 -0
  100. package/dist/main/credit/types.d.ts +68 -0
  101. package/dist/main/cta.js +3 -2
  102. package/dist/main/cta.mjs +3 -2
  103. package/dist/main/faq.js +5 -4
  104. package/dist/main/faq.mjs +5 -4
  105. package/dist/main/features.js +3 -2
  106. package/dist/main/features.mjs +3 -2
  107. package/dist/main/footer.js +2 -2
  108. package/dist/main/footer.mjs +2 -2
  109. package/dist/main/gallery/gallery-desktop-grid.d.ts +6 -0
  110. package/dist/main/gallery/gallery-desktop-grid.js +10 -0
  111. package/dist/main/gallery/gallery-desktop-grid.mjs +8 -0
  112. package/dist/main/gallery/gallery-interactive.d.ts +4 -0
  113. package/dist/main/gallery/gallery-interactive.js +128 -0
  114. package/dist/main/gallery/gallery-interactive.mjs +126 -0
  115. package/dist/main/gallery/gallery-mobile-swiper.d.ts +6 -0
  116. package/dist/main/gallery/gallery-mobile-swiper.js +13 -0
  117. package/dist/main/gallery/gallery-mobile-swiper.mjs +11 -0
  118. package/dist/main/gallery/gallery-server.d.ts +2 -0
  119. package/dist/main/gallery/gallery-server.js +44 -0
  120. package/dist/main/gallery/gallery-server.mjs +42 -0
  121. package/dist/main/gallery/gallery-types.d.ts +19 -0
  122. package/dist/main/gallery-interactive.js +1 -1
  123. package/dist/main/gallery-interactive.mjs +1 -1
  124. package/dist/main/gallery.js +6 -5
  125. package/dist/main/gallery.mjs +6 -5
  126. package/dist/main/go-to-top.js +1 -1
  127. package/dist/main/go-to-top.mjs +1 -1
  128. package/dist/main/index.d.ts +3 -1
  129. package/dist/main/index.js +5 -1
  130. package/dist/main/index.mjs +3 -1
  131. package/dist/main/money-price/customer-portal.d.ts +7 -0
  132. package/dist/main/money-price/customer-portal.js +54 -0
  133. package/dist/main/money-price/customer-portal.mjs +52 -0
  134. package/dist/main/money-price/money-price-button.d.ts +1 -1
  135. package/dist/main/money-price/money-price-button.js +162 -42
  136. package/dist/main/money-price/money-price-button.mjs +162 -42
  137. package/dist/main/money-price/money-price-config-util.d.ts +50 -2
  138. package/dist/main/money-price/money-price-config-util.js +177 -4
  139. package/dist/main/money-price/money-price-config-util.mjs +175 -4
  140. package/dist/main/money-price/money-price-data.d.ts +8 -0
  141. package/dist/main/money-price/money-price-data.js +28 -0
  142. package/dist/main/money-price/money-price-data.mjs +26 -0
  143. package/dist/main/money-price/money-price-interactive.d.ts +1 -1
  144. package/dist/main/money-price/money-price-interactive.js +251 -288
  145. package/dist/main/money-price/money-price-interactive.mjs +253 -290
  146. package/dist/main/money-price/money-price-types.d.ts +69 -20
  147. package/dist/main/money-price/money-price.d.ts +1 -1
  148. package/dist/main/money-price/money-price.js +9 -62
  149. package/dist/main/money-price/money-price.mjs +10 -63
  150. package/dist/main/price-plan.js +6 -6
  151. package/dist/main/price-plan.mjs +6 -6
  152. package/dist/main/section-layout.d.ts +1 -0
  153. package/dist/main/section-layout.js +7 -0
  154. package/dist/main/section-layout.mjs +5 -0
  155. package/dist/main/seo-content.js +3 -2
  156. package/dist/main/seo-content.mjs +3 -2
  157. package/dist/main/server.d.ts +6 -3
  158. package/dist/main/server.js +9 -4
  159. package/dist/main/server.mjs +4 -2
  160. package/dist/main/tips.js +3 -2
  161. package/dist/main/tips.mjs +3 -2
  162. package/dist/main/usage.js +4 -3
  163. package/dist/main/usage.mjs +4 -3
  164. package/dist/main/x-button.js +6 -6
  165. package/dist/main/x-button.mjs +6 -6
  166. package/dist/node_modules/.pnpm/@fingerprintjs_fingerprintjs@4.6.2/node_modules/@fingerprintjs/fingerprintjs/dist/fp.esm.js +1 -1
  167. package/dist/node_modules/.pnpm/@fingerprintjs_fingerprintjs@4.6.2/node_modules/@fingerprintjs/fingerprintjs/dist/fp.esm.mjs +1 -1
  168. package/dist/node_modules/.pnpm/{@iconify_utils@2.3.0 → @iconify_utils@3.0.2}/node_modules/@iconify/utils/lib/customisations/defaults.js +7 -6
  169. package/dist/node_modules/.pnpm/{@iconify_utils@2.3.0 → @iconify_utils@3.0.2}/node_modules/@iconify/utils/lib/customisations/defaults.mjs +7 -6
  170. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon/defaults.js +39 -0
  171. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon/defaults.mjs +34 -0
  172. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon/merge.js +20 -0
  173. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon/merge.mjs +18 -0
  174. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon/name.js +60 -0
  175. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon/name.mjs +57 -0
  176. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon/transformations.js +15 -0
  177. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon/transformations.mjs +13 -0
  178. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon-set/get-icon.js +30 -0
  179. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs +27 -0
  180. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon-set/tree.js +26 -0
  181. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/icon-set/tree.mjs +24 -0
  182. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/svg/build.js +118 -0
  183. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/svg/build.mjs +115 -0
  184. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/svg/defs.js +36 -0
  185. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/svg/defs.mjs +32 -0
  186. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/svg/html.js +12 -0
  187. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/svg/html.mjs +10 -0
  188. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/svg/id.js +48 -0
  189. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/svg/id.mjs +46 -0
  190. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/svg/size.js +30 -0
  191. package/dist/node_modules/.pnpm/@iconify_utils@3.0.2/node_modules/@iconify/utils/lib/svg/size.mjs +28 -0
  192. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/architecture-U656AL7Q.js +9 -0
  193. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/architecture-O4VJ6CD3.mjs → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/architecture-U656AL7Q.mjs} +2 -2
  194. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-KMC2YHZD.js → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-76Q3JFCE.js} +8 -8
  195. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-KMC2YHZD.mjs → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-76Q3JFCE.mjs} +1 -1
  196. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-4KMFLZZN.js → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FPAJGGOC.js} +1 -1
  197. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-4KMFLZZN.mjs → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FPAJGGOC.mjs} +1 -1
  198. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-XRWGC2XP.js → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FWNWRKHM.js} +13 -13
  199. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-XRWGC2XP.mjs → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FWNWRKHM.mjs} +1 -1
  200. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-T44TD3VJ.js → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-LBM3YZW2.js} +8 -8
  201. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-T44TD3VJ.mjs → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-LBM3YZW2.mjs} +1 -1
  202. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-WFRQ32O7.js → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-LHMN2FUI.js} +8 -8
  203. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-WFRQ32O7.mjs → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-LHMN2FUI.mjs} +1 -1
  204. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-JEIROHC2.js → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-O7ZBX7Z2.js} +10 -10
  205. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-JEIROHC2.mjs → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-O7ZBX7Z2.mjs} +1 -1
  206. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-BN7GFLIU.js → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-S6J4BHB3.js} +8 -8
  207. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-BN7GFLIU.mjs → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-S6J4BHB3.mjs} +1 -1
  208. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-WFWHJNB7.js → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-T53DSG4Q.js} +10 -10
  209. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-WFWHJNB7.mjs → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-T53DSG4Q.mjs} +1 -1
  210. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/gitGraph-F6HP7TQM.js +9 -0
  211. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/gitGraph-ZV4HHKMB.mjs → @mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/gitGraph-F6HP7TQM.mjs} +2 -2
  212. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-NVLQJR56.js +9 -0
  213. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-NVLQJR56.mjs +2 -0
  214. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-BFZMPI3H.js +9 -0
  215. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-BFZMPI3H.mjs +2 -0
  216. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-7BOR55EZ.js +9 -0
  217. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-7BOR55EZ.mjs +2 -0
  218. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-NHE76QYJ.js +9 -0
  219. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-NHE76QYJ.mjs +2 -0
  220. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-KMMF4GRG.js +9 -0
  221. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-KMMF4GRG.mjs +2 -0
  222. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.3/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +129 -0
  223. package/dist/node_modules/.pnpm/{@mermaid-js_parser@0.6.2 → @mermaid-js_parser@0.6.3}/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.mjs +16 -16
  224. package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +0 -3
  225. package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/cross-count.mjs +0 -3
  226. package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/position/bk.js +24 -4
  227. package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/position/bk.mjs +24 -4
  228. package/dist/node_modules/.pnpm/{dompurify@3.2.6 → dompurify@3.3.0}/node_modules/dompurify/dist/purify.es.js +59 -25
  229. package/dist/node_modules/.pnpm/{dompurify@3.2.6 → dompurify@3.3.0}/node_modules/dompurify/dist/purify.es.mjs +59 -25
  230. package/dist/node_modules/.pnpm/{katex@0.16.22 → katex@0.16.25}/node_modules/katex/dist/katex.js +26 -34
  231. package/dist/node_modules/.pnpm/{katex@0.16.22 → katex@0.16.25}/node_modules/katex/dist/katex.mjs +26 -34
  232. package/dist/node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.js +84 -0
  233. package/dist/node_modules/.pnpm/marked@16.4.2/node_modules/marked/lib/marked.esm.mjs +74 -0
  234. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-SUXI7LT5.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-VXUJARFQ.js} +373 -351
  235. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-SUXI7LT5.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-VXUJARFQ.mjs} +320 -298
  236. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-6J76NXCF.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-VD42YOAC.js} +393 -380
  237. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-6J76NXCF.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-VD42YOAC.mjs} +162 -149
  238. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-6F6E4RAY.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.js} +126 -125
  239. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-6F6E4RAY.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.mjs} +10 -9
  240. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-353BL4L5.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.js} +2 -2
  241. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-353BL4L5.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs} +1 -1
  242. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-BFAMUDN2.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js} +2 -2
  243. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-BFAMUDN2.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.mjs} +1 -1
  244. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-RKKUNAVE.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-6MN3ZHY7.js} +15 -15
  245. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-RKKUNAVE.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-6MN3ZHY7.mjs} +15 -15
  246. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3XYRH5AP.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.js} +142 -203
  247. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3XYRH5AP.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.mjs} +27 -85
  248. package/dist/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-AGHRB4JF.js +81 -0
  249. package/dist/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-AGHRB4JF.mjs +76 -0
  250. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-UWXLY5YG.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ATLVNIR6.js} +30 -11
  251. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-UWXLY5YG.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ATLVNIR6.mjs} +22 -3
  252. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-SZ463SBG.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-B4BG7PRW.js} +207 -205
  253. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-SZ463SBG.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-B4BG7PRW.mjs} +132 -130
  254. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-AC5SNWB5.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-CVBHYZKI.js} +2 -2
  255. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-AC5SNWB5.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-CVBHYZKI.mjs} +1 -1
  256. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OW32GOEJ.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-DI55MBZ5.js} +98 -97
  257. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-OW32GOEJ.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-DI55MBZ5.mjs} +10 -9
  258. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-P3VETL53.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-EXTU4WIE.js} +4 -3
  259. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-P3VETL53.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-EXTU4WIE.mjs} +2 -1
  260. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-E2GYISFI.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-FMBD7UC4.js} +2 -2
  261. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-E2GYISFI.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-FMBD7UC4.mjs} +1 -1
  262. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-MXNHSMXR.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HN2XXSSU.js} +17 -9
  263. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-MXNHSMXR.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HN2XXSSU.mjs} +11 -5
  264. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QESNASVV.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JA3XYJ7Z.js} +51 -50
  265. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QESNASVV.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JA3XYJ7Z.mjs} +23 -22
  266. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JW4RIYDF.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JZLCHNYA.js} +731 -440
  267. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JW4RIYDF.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JZLCHNYA.mjs} +404 -113
  268. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-L5ZGVLVO.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-MI3HLSF2.js} +139 -139
  269. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-L5ZGVLVO.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-MI3HLSF2.mjs} +5 -5
  270. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-IWUHOULB.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-N4CR4FBY.js} +29 -22
  271. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-IWUHOULB.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-N4CR4FBY.mjs} +13 -6
  272. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-SKB7J2MH.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QN33PNHL.js} +7 -6
  273. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-SKB7J2MH.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QN33PNHL.mjs} +2 -1
  274. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-M6DAPIYF.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QXUST7PY.js} +211 -85
  275. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-M6DAPIYF.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QXUST7PY.mjs} +142 -16
  276. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-AACKK3MU.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QZHKN3VN.js} +2 -2
  277. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-AACKK3MU.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QZHKN3VN.mjs} +1 -1
  278. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55PJQP7W.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.js} +61 -49
  279. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55PJQP7W.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.mjs} +13 -1
  280. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-67H74DCK.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.js} +10 -9
  281. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-67H74DCK.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.mjs} +2 -1
  282. package/dist/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-2ON5EDUG.js +31 -0
  283. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-M3E45YP4.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-2ON5EDUG.mjs} +9 -8
  284. package/dist/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-WZHVMYZB.js +31 -0
  285. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-YAWTLIQI.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-WZHVMYZB.mjs} +9 -8
  286. package/dist/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +302 -0
  287. package/dist/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.mjs +300 -0
  288. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/dagre-JOIXM2OF.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/dagre-6UL2VRFP.js} +123 -122
  289. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/dagre-JOIXM2OF.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/dagre-6UL2VRFP.mjs} +12 -11
  290. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-VMROVX33.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/diagram-PSM6KHXK.js} +46 -45
  291. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-VMROVX33.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/diagram-PSM6KHXK.mjs} +8 -7
  292. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-ZTM2IBQH.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/diagram-QEK2KX5R.js} +45 -44
  293. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-ZTM2IBQH.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/diagram-QEK2KX5R.mjs} +6 -5
  294. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-5UYTHUR4.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/diagram-S2PKOQOG.js} +68 -57
  295. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-5UYTHUR4.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/diagram-S2PKOQOG.mjs} +56 -45
  296. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-3M52JZNH.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-Q2GNP2WA.js} +70 -69
  297. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-3M52JZNH.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-Q2GNP2WA.mjs} +14 -13
  298. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-KYDEHFYC.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-NV44I4VS.js} +97 -93
  299. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-KYDEHFYC.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-NV44I4VS.mjs} +20 -16
  300. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-EK5VF46D.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.js} +134 -125
  301. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-EK5VF46D.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.mjs} +27 -18
  302. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-GW3U2K7C.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-NY62KEGX.js} +116 -115
  303. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-GW3U2K7C.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-NY62KEGX.mjs} +6 -5
  304. package/dist/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-ER5ION4S.js +42 -0
  305. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-LHK5PUON.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-ER5ION4S.mjs} +5 -4
  306. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-EWQZEKCU.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-XKPGCS4Q.js} +100 -99
  307. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-EWQZEKCU.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-XKPGCS4Q.mjs} +10 -9
  308. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/kanban-definition-ZSS6B67P.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/kanban-definition-3W4ZIXB7.js} +79 -78
  309. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/kanban-definition-ZSS6B67P.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/kanban-definition-3W4ZIXB7.mjs} +12 -11
  310. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-6CBA2TL7.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-VGOIOE7T.js} +277 -379
  311. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-6CBA2TL7.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-VGOIOE7T.mjs} +234 -336
  312. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-NIOCPIFQ.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ADFJNKIX.js} +58 -56
  313. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-NIOCPIFQ.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ADFJNKIX.mjs} +30 -28
  314. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-2OG54O6I.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-AYHSOK5B.js} +96 -95
  315. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-2OG54O6I.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-AYHSOK5B.mjs} +6 -5
  316. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/requirementDiagram-QOLK2EJ7.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/requirementDiagram-UZGBJVZJ.js} +64 -63
  317. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/requirementDiagram-QOLK2EJ7.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/requirementDiagram-UZGBJVZJ.mjs} +14 -13
  318. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-4UZDY2LN.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-TZEHDZUN.js} +73 -69
  319. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-4UZDY2LN.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-TZEHDZUN.mjs} +17 -13
  320. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-SKLFT4DO.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.js} +839 -376
  321. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-SKLFT4DO.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.mjs} +591 -128
  322. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-MI5ZYTHO.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-FKZM4ZOC.js} +94 -93
  323. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-MI5ZYTHO.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-FKZM4ZOC.mjs} +12 -11
  324. package/dist/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-4FDKWEC3.js +31 -0
  325. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-5AN5P6BG.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-4FDKWEC3.mjs} +9 -8
  326. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-MYPXXCX6.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-IT6M3QCI.js} +93 -92
  327. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-MYPXXCX6.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-IT6M3QCI.mjs} +8 -7
  328. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/xychartDiagram-H2YORKM3.js → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/xychartDiagram-PRI3JC2R.js} +136 -133
  329. package/dist/node_modules/.pnpm/{mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/xychartDiagram-H2YORKM3.mjs → mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/xychartDiagram-PRI3JC2R.mjs} +43 -40
  330. package/dist/node_modules/.pnpm/{mermaid@11.9.0 → mermaid@11.12.1}/node_modules/mermaid/dist/mermaid.core.js +226 -225
  331. package/dist/node_modules/.pnpm/{mermaid@11.9.0 → mermaid@11.12.1}/node_modules/mermaid/dist/mermaid.core.mjs +43 -42
  332. package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.3.0_react-dom@19.1.0_react@19.1.0__react@19.1.0 → react-medium-image-zoom@5.4.0_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/react-medium-image-zoom/dist/index.js +16 -12
  333. package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.3.0_react-dom@19.1.0_react@19.1.0__react@19.1.0 → react-medium-image-zoom@5.4.0_react-dom@19.2.0_react@19.2.0__react@19.2.0}/node_modules/react-medium-image-zoom/dist/index.mjs +16 -12
  334. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/pagination.js +461 -0
  335. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/pagination.mjs +459 -0
  336. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/classes-to-selector.js +8 -0
  337. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/classes-to-selector.mjs +6 -0
  338. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/create-element-if-not-defined.js +23 -0
  339. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/create-element-if-not-defined.mjs +21 -0
  340. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/ssr-window.esm.js +143 -0
  341. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/ssr-window.esm.mjs +140 -0
  342. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/swiper-core.js +3874 -0
  343. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/swiper-core.mjs +3871 -0
  344. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/update-on-virtual-data.js +129 -0
  345. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/update-on-virtual-data.mjs +124 -0
  346. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/update-swiper.js +226 -0
  347. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/update-swiper.mjs +216 -0
  348. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/utils.js +310 -0
  349. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/shared/utils.mjs +288 -0
  350. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/swiper-react.js +390 -0
  351. package/dist/node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/swiper-react.mjs +387 -0
  352. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/native.js +6 -0
  353. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/native.mjs +4 -0
  354. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/rng.js +15 -0
  355. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/rng.mjs +13 -0
  356. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/stringify.js +30 -0
  357. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/stringify.mjs +28 -0
  358. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/v4.js +21 -0
  359. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/v4.mjs +19 -0
  360. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/errors.js +52 -0
  361. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/errors.mjs +50 -0
  362. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/iso.js +44 -0
  363. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/iso.mjs +35 -0
  364. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/parse.js +31 -0
  365. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/parse.mjs +18 -0
  366. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/schemas.js +492 -0
  367. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/classic/schemas.mjs +439 -0
  368. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/api.js +434 -0
  369. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/api.mjs +388 -0
  370. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/checks.js +245 -0
  371. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/checks.mjs +232 -0
  372. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/core.js +68 -0
  373. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/core.mjs +62 -0
  374. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/errors.js +80 -0
  375. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/errors.mjs +75 -0
  376. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/parse.js +101 -0
  377. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/parse.mjs +86 -0
  378. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/regexes.js +102 -0
  379. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/regexes.mjs +76 -0
  380. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/registries.js +56 -0
  381. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/registries.mjs +52 -0
  382. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.js +952 -0
  383. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.mjs +909 -0
  384. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/util.js +182 -0
  385. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/util.mjs +163 -0
  386. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/versions.js +9 -0
  387. package/dist/node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/versions.mjs +7 -0
  388. package/package.json +27 -21
  389. package/src/clerk/{clerk-page-generator-client.tsx → clerk-page-context-generator.tsx} +2 -2
  390. package/src/clerk/clerk-page-generator.tsx +3 -3
  391. package/src/clerk/clerk-user-client.tsx +7 -12
  392. package/src/clerk/fingerprint/fingerprint-provider.tsx +311 -112
  393. package/src/clerk/fingerprint/fingerprint-server.ts +33 -5
  394. package/src/clerk/fingerprint/types.ts +16 -2
  395. package/src/clerk/fingerprint/use-fingerprint.ts +1 -1
  396. package/src/clerk/index.ts +2 -1
  397. package/src/clerk/signin-with-fingerprint-client.tsx +3 -11
  398. package/src/clerk/signup-button-with-fingerprint-client.tsx +87 -0
  399. package/src/clerk/signup-with-fingerprint-client.tsx +3 -11
  400. package/src/fuma/base/custom-header.tsx +574 -0
  401. package/src/fuma/base/custom-home-layout.tsx +146 -0
  402. package/src/fuma/base/index.ts +2 -0
  403. package/src/fuma/fuma-banner-suit.tsx +22 -5
  404. package/src/fuma/fuma-page-genarator.tsx +29 -9
  405. package/src/fuma/fuma-translate-util.ts +44 -0
  406. package/src/fuma/llm-copy-handler.ts +8 -7
  407. package/src/fuma/mdx/airtical-card.tsx +1 -1
  408. package/src/fuma/mdx/banner.tsx +25 -7
  409. package/src/fuma/mdx/gradient-button.tsx +43 -26
  410. package/src/fuma/mdx/mermaid.tsx +2 -2
  411. package/src/fuma/mdx/toc-base.tsx +9 -4
  412. package/src/fuma/mdx/zia-card.tsx +6 -6
  413. package/src/fuma/server.ts +1 -0
  414. package/src/lib/fuma-schema-check-util.ts +11 -40
  415. package/src/lib/server.ts +0 -1
  416. package/src/main/ai-prompt-textarea.tsx +1 -1
  417. package/src/main/credit/credit-nav-button.tsx +283 -0
  418. package/src/main/credit/credit-overview-client.tsx +552 -0
  419. package/src/main/credit/credit-overview.tsx +53 -0
  420. package/src/main/credit/types.ts +89 -0
  421. package/src/main/cta.tsx +9 -8
  422. package/src/main/faq.tsx +4 -3
  423. package/src/main/features.tsx +3 -3
  424. package/src/main/footer.tsx +1 -1
  425. package/src/main/gallery/gallery-desktop-grid.tsx +41 -0
  426. package/src/main/gallery/gallery-interactive.tsx +153 -0
  427. package/src/main/gallery/gallery-mobile-swiper.tsx +65 -0
  428. package/src/main/gallery/gallery-server.tsx +46 -0
  429. package/src/main/gallery/gallery-types.ts +22 -0
  430. package/src/main/go-to-top.tsx +1 -1
  431. package/src/main/index.ts +5 -3
  432. package/src/main/money-price/customer-portal.ts +63 -0
  433. package/src/main/money-price/money-price-button.tsx +211 -56
  434. package/src/main/money-price/money-price-config-util.ts +222 -5
  435. package/src/main/money-price/money-price-data.ts +49 -0
  436. package/src/main/money-price/money-price-interactive.tsx +479 -356
  437. package/src/main/money-price/money-price-types.ts +76 -22
  438. package/src/main/money-price/money-price.tsx +28 -267
  439. package/src/main/price-plan.tsx +3 -3
  440. package/src/main/section-layout.ts +5 -0
  441. package/src/main/seo-content.tsx +2 -2
  442. package/src/main/server.ts +15 -4
  443. package/src/main/tips.tsx +2 -2
  444. package/src/main/usage.tsx +4 -4
  445. package/src/main/x-button.tsx +13 -13
  446. package/src/styles/fuma.css +38 -13
  447. package/src/styles/third-ui.css +37 -2
  448. package/dist/lib/fuma-search-util.d.ts +0 -2
  449. package/dist/lib/fuma-search-util.js +0 -8
  450. package/dist/lib/fuma-search-util.mjs +0 -6
  451. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon/defaults.js +0 -29
  452. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon/defaults.mjs +0 -24
  453. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon/merge.js +0 -22
  454. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon/merge.mjs +0 -20
  455. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon/name.js +0 -55
  456. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon/name.mjs +0 -52
  457. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon/transformations.js +0 -18
  458. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon/transformations.mjs +0 -16
  459. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon-set/get-icon.js +0 -29
  460. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs +0 -26
  461. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon-set/tree.js +0 -25
  462. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/icon-set/tree.mjs +0 -23
  463. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/svg/build.js +0 -122
  464. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/svg/build.mjs +0 -119
  465. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/svg/defs.js +0 -34
  466. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/svg/defs.mjs +0 -30
  467. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/svg/html.js +0 -11
  468. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/svg/html.mjs +0 -9
  469. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/svg/id.js +0 -30
  470. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/svg/id.mjs +0 -28
  471. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/svg/size.js +0 -42
  472. package/dist/node_modules/.pnpm/@iconify_utils@2.3.0/node_modules/@iconify/utils/lib/svg/size.mjs +0 -40
  473. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/architecture-O4VJ6CD3.js +0 -9
  474. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/gitGraph-ZV4HHKMB.js +0 -9
  475. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-63CPKGFF.js +0 -9
  476. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-63CPKGFF.mjs +0 -2
  477. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-HUATNLJX.js +0 -9
  478. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-HUATNLJX.mjs +0 -2
  479. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-WTHONI2E.js +0 -9
  480. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-WTHONI2E.mjs +0 -2
  481. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-NJJJXTRR.js +0 -9
  482. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-NJJJXTRR.mjs +0 -2
  483. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-75Q7IDZK.js +0 -9
  484. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-75Q7IDZK.mjs +0 -2
  485. package/dist/node_modules/.pnpm/@mermaid-js_parser@0.6.2/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +0 -129
  486. package/dist/node_modules/.pnpm/marked@16.1.2/node_modules/marked/lib/marked.esm.js +0 -83
  487. package/dist/node_modules/.pnpm/marked@16.1.2/node_modules/marked/lib/marked.esm.mjs +0 -73
  488. package/dist/node_modules/.pnpm/mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-M3E45YP4.js +0 -30
  489. package/dist/node_modules/.pnpm/mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-YAWTLIQI.js +0 -30
  490. package/dist/node_modules/.pnpm/mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-LHK5PUON.js +0 -41
  491. package/dist/node_modules/.pnpm/mermaid@11.9.0/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-5AN5P6BG.js +0 -30
  492. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +0 -135
  493. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.mjs +0 -132
  494. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +0 -11
  495. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.mjs +0 -8
  496. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +0 -8
  497. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.mjs +0 -8
  498. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +0 -122
  499. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.mjs +0 -111
  500. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +0 -138
  501. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.mjs +0 -135
  502. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +0 -113
  503. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.mjs +0 -111
  504. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +0 -3339
  505. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.mjs +0 -3297
  506. package/src/lib/fuma-search-util.ts +0 -6
  507. package/src/main/gallery-interactive.tsx +0 -171
  508. package/src/main/gallery.tsx +0 -98
  509. /package/dist/clerk/{clerk-page-generator-client.d.ts → clerk-page-context-generator.d.ts} +0 -0
  510. /package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.2 → @rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3}/node_modules/tslib/tslib.es6.js +0 -0
  511. /package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.2 → @rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3}/node_modules/tslib/tslib.es6.mjs +0 -0
  512. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/acyclic.js +0 -0
  513. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/acyclic.mjs +0 -0
  514. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/add-border-segments.js +0 -0
  515. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/add-border-segments.mjs +0 -0
  516. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/coordinate-system.js +0 -0
  517. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/coordinate-system.mjs +0 -0
  518. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/data/list.js +0 -0
  519. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/data/list.mjs +0 -0
  520. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +0 -0
  521. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/greedy-fas.mjs +0 -0
  522. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/layout.js +0 -0
  523. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/layout.mjs +0 -0
  524. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +0 -0
  525. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/nesting-graph.mjs +0 -0
  526. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/normalize.js +0 -0
  527. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/normalize.mjs +0 -0
  528. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.js +0 -0
  529. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.mjs +0 -0
  530. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/barycenter.js +0 -0
  531. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/barycenter.mjs +0 -0
  532. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.js +0 -0
  533. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.mjs +0 -0
  534. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/index.js +0 -0
  535. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/index.mjs +0 -0
  536. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/init-order.js +0 -0
  537. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/init-order.mjs +0 -0
  538. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +0 -0
  539. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.mjs +0 -0
  540. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +0 -0
  541. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.mjs +0 -0
  542. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/sort.js +0 -0
  543. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/order/sort.mjs +0 -0
  544. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.js +0 -0
  545. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.mjs +0 -0
  546. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/position/index.js +0 -0
  547. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/position/index.mjs +0 -0
  548. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.js +0 -0
  549. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.mjs +0 -0
  550. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/rank/index.js +0 -0
  551. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/rank/index.mjs +0 -0
  552. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +0 -0
  553. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.mjs +0 -0
  554. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/rank/util.js +0 -0
  555. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/rank/util.mjs +0 -0
  556. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/util.js +0 -0
  557. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/dagre/util.mjs +0 -0
  558. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/alg/dfs.js +0 -0
  559. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/alg/dfs.mjs +0 -0
  560. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/alg/postorder.js +0 -0
  561. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/alg/postorder.mjs +0 -0
  562. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/alg/preorder.js +0 -0
  563. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/alg/preorder.mjs +0 -0
  564. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/alg/topsort.js +0 -0
  565. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/alg/topsort.mjs +0 -0
  566. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/graph.js +0 -0
  567. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/graph.mjs +0 -0
  568. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/json.js +0 -0
  569. /package/dist/node_modules/.pnpm/{dagre-d3-es@7.0.11 → dagre-d3-es@7.0.13}/node_modules/dagre-d3-es/src/graphlib/json.mjs +0 -0
  570. /package/dist/node_modules/.pnpm/{dayjs@1.11.13 → dayjs@1.11.19}/node_modules/dayjs/dayjs.min.js +0 -0
  571. /package/dist/node_modules/.pnpm/{dayjs@1.11.13 → dayjs@1.11.19}/node_modules/dayjs/dayjs.min.mjs +0 -0
  572. /package/dist/node_modules/.pnpm/{dayjs@1.11.13 → dayjs@1.11.19}/node_modules/dayjs/plugin/advancedFormat.js +0 -0
  573. /package/dist/node_modules/.pnpm/{dayjs@1.11.13 → dayjs@1.11.19}/node_modules/dayjs/plugin/advancedFormat.mjs +0 -0
  574. /package/dist/node_modules/.pnpm/{dayjs@1.11.13 → dayjs@1.11.19}/node_modules/dayjs/plugin/customParseFormat.js +0 -0
  575. /package/dist/node_modules/.pnpm/{dayjs@1.11.13 → dayjs@1.11.19}/node_modules/dayjs/plugin/customParseFormat.mjs +0 -0
  576. /package/dist/node_modules/.pnpm/{dayjs@1.11.13 → dayjs@1.11.19}/node_modules/dayjs/plugin/isoWeek.js +0 -0
  577. /package/dist/node_modules/.pnpm/{dayjs@1.11.13 → dayjs@1.11.19}/node_modules/dayjs/plugin/isoWeek.mjs +0 -0
@@ -1,3297 +0,0 @@
1
- import { ZodIssueCode, ZodError } from './ZodError.mjs';
2
- import { errorUtil } from './helpers/errorUtil.mjs';
3
- import { addIssueToContext, INVALID, ParseStatus, DIRTY, isValid, isAsync, OK, isAborted, isDirty } from './helpers/parseUtil.mjs';
4
- import { ZodParsedType, util, getParsedType } from './helpers/util.mjs';
5
-
6
- class ParseInputLazyPath {
7
- constructor(parent, value, path, key) {
8
- this._cachedPath = [];
9
- this.parent = parent;
10
- this.data = value;
11
- this._path = path;
12
- this._key = key;
13
- }
14
- get path() {
15
- if (!this._cachedPath.length) {
16
- if (Array.isArray(this._key)) {
17
- this._cachedPath.push(...this._path, ...this._key);
18
- }
19
- else {
20
- this._cachedPath.push(...this._path, this._key);
21
- }
22
- }
23
- return this._cachedPath;
24
- }
25
- }
26
- const handleResult = (ctx, result) => {
27
- if (isValid(result)) {
28
- return { success: true, data: result.value };
29
- }
30
- else {
31
- if (!ctx.common.issues.length) {
32
- throw new Error("Validation failed but no issues detected.");
33
- }
34
- return {
35
- success: false,
36
- get error() {
37
- if (this._error)
38
- return this._error;
39
- const error = new ZodError(ctx.common.issues);
40
- this._error = error;
41
- return this._error;
42
- },
43
- };
44
- }
45
- };
46
- function processCreateParams(params) {
47
- if (!params)
48
- return {};
49
- const { errorMap, invalid_type_error, required_error, description } = params;
50
- if (errorMap && (invalid_type_error || required_error)) {
51
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
52
- }
53
- if (errorMap)
54
- return { errorMap: errorMap, description };
55
- const customMap = (iss, ctx) => {
56
- const { message } = params;
57
- if (iss.code === "invalid_enum_value") {
58
- return { message: message ?? ctx.defaultError };
59
- }
60
- if (typeof ctx.data === "undefined") {
61
- return { message: message ?? required_error ?? ctx.defaultError };
62
- }
63
- if (iss.code !== "invalid_type")
64
- return { message: ctx.defaultError };
65
- return { message: message ?? invalid_type_error ?? ctx.defaultError };
66
- };
67
- return { errorMap: customMap, description };
68
- }
69
- class ZodType {
70
- get description() {
71
- return this._def.description;
72
- }
73
- _getType(input) {
74
- return getParsedType(input.data);
75
- }
76
- _getOrReturnCtx(input, ctx) {
77
- return (ctx || {
78
- common: input.parent.common,
79
- data: input.data,
80
- parsedType: getParsedType(input.data),
81
- schemaErrorMap: this._def.errorMap,
82
- path: input.path,
83
- parent: input.parent,
84
- });
85
- }
86
- _processInputParams(input) {
87
- return {
88
- status: new ParseStatus(),
89
- ctx: {
90
- common: input.parent.common,
91
- data: input.data,
92
- parsedType: getParsedType(input.data),
93
- schemaErrorMap: this._def.errorMap,
94
- path: input.path,
95
- parent: input.parent,
96
- },
97
- };
98
- }
99
- _parseSync(input) {
100
- const result = this._parse(input);
101
- if (isAsync(result)) {
102
- throw new Error("Synchronous parse encountered promise.");
103
- }
104
- return result;
105
- }
106
- _parseAsync(input) {
107
- const result = this._parse(input);
108
- return Promise.resolve(result);
109
- }
110
- parse(data, params) {
111
- const result = this.safeParse(data, params);
112
- if (result.success)
113
- return result.data;
114
- throw result.error;
115
- }
116
- safeParse(data, params) {
117
- const ctx = {
118
- common: {
119
- issues: [],
120
- async: params?.async ?? false,
121
- contextualErrorMap: params?.errorMap,
122
- },
123
- path: params?.path || [],
124
- schemaErrorMap: this._def.errorMap,
125
- parent: null,
126
- data,
127
- parsedType: getParsedType(data),
128
- };
129
- const result = this._parseSync({ data, path: ctx.path, parent: ctx });
130
- return handleResult(ctx, result);
131
- }
132
- "~validate"(data) {
133
- const ctx = {
134
- common: {
135
- issues: [],
136
- async: !!this["~standard"].async,
137
- },
138
- path: [],
139
- schemaErrorMap: this._def.errorMap,
140
- parent: null,
141
- data,
142
- parsedType: getParsedType(data),
143
- };
144
- if (!this["~standard"].async) {
145
- try {
146
- const result = this._parseSync({ data, path: [], parent: ctx });
147
- return isValid(result)
148
- ? {
149
- value: result.value,
150
- }
151
- : {
152
- issues: ctx.common.issues,
153
- };
154
- }
155
- catch (err) {
156
- if (err?.message?.toLowerCase()?.includes("encountered")) {
157
- this["~standard"].async = true;
158
- }
159
- ctx.common = {
160
- issues: [],
161
- async: true,
162
- };
163
- }
164
- }
165
- return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)
166
- ? {
167
- value: result.value,
168
- }
169
- : {
170
- issues: ctx.common.issues,
171
- });
172
- }
173
- async parseAsync(data, params) {
174
- const result = await this.safeParseAsync(data, params);
175
- if (result.success)
176
- return result.data;
177
- throw result.error;
178
- }
179
- async safeParseAsync(data, params) {
180
- const ctx = {
181
- common: {
182
- issues: [],
183
- contextualErrorMap: params?.errorMap,
184
- async: true,
185
- },
186
- path: params?.path || [],
187
- schemaErrorMap: this._def.errorMap,
188
- parent: null,
189
- data,
190
- parsedType: getParsedType(data),
191
- };
192
- const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
193
- const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
194
- return handleResult(ctx, result);
195
- }
196
- refine(check, message) {
197
- const getIssueProperties = (val) => {
198
- if (typeof message === "string" || typeof message === "undefined") {
199
- return { message };
200
- }
201
- else if (typeof message === "function") {
202
- return message(val);
203
- }
204
- else {
205
- return message;
206
- }
207
- };
208
- return this._refinement((val, ctx) => {
209
- const result = check(val);
210
- const setError = () => ctx.addIssue({
211
- code: ZodIssueCode.custom,
212
- ...getIssueProperties(val),
213
- });
214
- if (typeof Promise !== "undefined" && result instanceof Promise) {
215
- return result.then((data) => {
216
- if (!data) {
217
- setError();
218
- return false;
219
- }
220
- else {
221
- return true;
222
- }
223
- });
224
- }
225
- if (!result) {
226
- setError();
227
- return false;
228
- }
229
- else {
230
- return true;
231
- }
232
- });
233
- }
234
- refinement(check, refinementData) {
235
- return this._refinement((val, ctx) => {
236
- if (!check(val)) {
237
- ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
238
- return false;
239
- }
240
- else {
241
- return true;
242
- }
243
- });
244
- }
245
- _refinement(refinement) {
246
- return new ZodEffects({
247
- schema: this,
248
- typeName: ZodFirstPartyTypeKind.ZodEffects,
249
- effect: { type: "refinement", refinement },
250
- });
251
- }
252
- superRefine(refinement) {
253
- return this._refinement(refinement);
254
- }
255
- constructor(def) {
256
- /** Alias of safeParseAsync */
257
- this.spa = this.safeParseAsync;
258
- this._def = def;
259
- this.parse = this.parse.bind(this);
260
- this.safeParse = this.safeParse.bind(this);
261
- this.parseAsync = this.parseAsync.bind(this);
262
- this.safeParseAsync = this.safeParseAsync.bind(this);
263
- this.spa = this.spa.bind(this);
264
- this.refine = this.refine.bind(this);
265
- this.refinement = this.refinement.bind(this);
266
- this.superRefine = this.superRefine.bind(this);
267
- this.optional = this.optional.bind(this);
268
- this.nullable = this.nullable.bind(this);
269
- this.nullish = this.nullish.bind(this);
270
- this.array = this.array.bind(this);
271
- this.promise = this.promise.bind(this);
272
- this.or = this.or.bind(this);
273
- this.and = this.and.bind(this);
274
- this.transform = this.transform.bind(this);
275
- this.brand = this.brand.bind(this);
276
- this.default = this.default.bind(this);
277
- this.catch = this.catch.bind(this);
278
- this.describe = this.describe.bind(this);
279
- this.pipe = this.pipe.bind(this);
280
- this.readonly = this.readonly.bind(this);
281
- this.isNullable = this.isNullable.bind(this);
282
- this.isOptional = this.isOptional.bind(this);
283
- this["~standard"] = {
284
- version: 1,
285
- vendor: "zod",
286
- validate: (data) => this["~validate"](data),
287
- };
288
- }
289
- optional() {
290
- return ZodOptional.create(this, this._def);
291
- }
292
- nullable() {
293
- return ZodNullable.create(this, this._def);
294
- }
295
- nullish() {
296
- return this.nullable().optional();
297
- }
298
- array() {
299
- return ZodArray.create(this);
300
- }
301
- promise() {
302
- return ZodPromise.create(this, this._def);
303
- }
304
- or(option) {
305
- return ZodUnion.create([this, option], this._def);
306
- }
307
- and(incoming) {
308
- return ZodIntersection.create(this, incoming, this._def);
309
- }
310
- transform(transform) {
311
- return new ZodEffects({
312
- ...processCreateParams(this._def),
313
- schema: this,
314
- typeName: ZodFirstPartyTypeKind.ZodEffects,
315
- effect: { type: "transform", transform },
316
- });
317
- }
318
- default(def) {
319
- const defaultValueFunc = typeof def === "function" ? def : () => def;
320
- return new ZodDefault({
321
- ...processCreateParams(this._def),
322
- innerType: this,
323
- defaultValue: defaultValueFunc,
324
- typeName: ZodFirstPartyTypeKind.ZodDefault,
325
- });
326
- }
327
- brand() {
328
- return new ZodBranded({
329
- typeName: ZodFirstPartyTypeKind.ZodBranded,
330
- type: this,
331
- ...processCreateParams(this._def),
332
- });
333
- }
334
- catch(def) {
335
- const catchValueFunc = typeof def === "function" ? def : () => def;
336
- return new ZodCatch({
337
- ...processCreateParams(this._def),
338
- innerType: this,
339
- catchValue: catchValueFunc,
340
- typeName: ZodFirstPartyTypeKind.ZodCatch,
341
- });
342
- }
343
- describe(description) {
344
- const This = this.constructor;
345
- return new This({
346
- ...this._def,
347
- description,
348
- });
349
- }
350
- pipe(target) {
351
- return ZodPipeline.create(this, target);
352
- }
353
- readonly() {
354
- return ZodReadonly.create(this);
355
- }
356
- isOptional() {
357
- return this.safeParse(undefined).success;
358
- }
359
- isNullable() {
360
- return this.safeParse(null).success;
361
- }
362
- }
363
- const cuidRegex = /^c[^\s-]{8,}$/i;
364
- const cuid2Regex = /^[0-9a-z]+$/;
365
- const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
366
- // const uuidRegex =
367
- // /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
368
- const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
369
- const nanoidRegex = /^[a-z0-9_-]{21}$/i;
370
- const jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
371
- const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
372
- // from https://stackoverflow.com/a/46181/1550155
373
- // old version: too slow, didn't support unicode
374
- // const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
375
- //old email regex
376
- // const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i;
377
- // eslint-disable-next-line
378
- // const emailRegex =
379
- // /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/;
380
- // const emailRegex =
381
- // /^[a-zA-Z0-9\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
382
- // const emailRegex =
383
- // /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
384
- const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
385
- // const emailRegex =
386
- // /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i;
387
- // from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
388
- const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
389
- let emojiRegex;
390
- // faster, simpler, safer
391
- const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
392
- const ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
393
- // const ipv6Regex =
394
- // /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
395
- const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
396
- const ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
397
- // https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
398
- const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
399
- // https://base64.guru/standards/base64url
400
- const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
401
- // simple
402
- // const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`;
403
- // no leap year validation
404
- // const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`;
405
- // with leap year validation
406
- const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
407
- const dateRegex = new RegExp(`^${dateRegexSource}$`);
408
- function timeRegexSource(args) {
409
- let secondsRegexSource = `[0-5]\\d`;
410
- if (args.precision) {
411
- secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
412
- }
413
- else if (args.precision == null) {
414
- secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
415
- }
416
- const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
417
- return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
418
- }
419
- function timeRegex(args) {
420
- return new RegExp(`^${timeRegexSource(args)}$`);
421
- }
422
- // Adapted from https://stackoverflow.com/a/3143231
423
- function datetimeRegex(args) {
424
- let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
425
- const opts = [];
426
- opts.push(args.local ? `Z?` : `Z`);
427
- if (args.offset)
428
- opts.push(`([+-]\\d{2}:?\\d{2})`);
429
- regex = `${regex}(${opts.join("|")})`;
430
- return new RegExp(`^${regex}$`);
431
- }
432
- function isValidIP(ip, version) {
433
- if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
434
- return true;
435
- }
436
- if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
437
- return true;
438
- }
439
- return false;
440
- }
441
- function isValidJWT(jwt, alg) {
442
- if (!jwtRegex.test(jwt))
443
- return false;
444
- try {
445
- const [header] = jwt.split(".");
446
- if (!header)
447
- return false;
448
- // Convert base64url to base64
449
- const base64 = header
450
- .replace(/-/g, "+")
451
- .replace(/_/g, "/")
452
- .padEnd(header.length + ((4 - (header.length % 4)) % 4), "=");
453
- const decoded = JSON.parse(atob(base64));
454
- if (typeof decoded !== "object" || decoded === null)
455
- return false;
456
- if ("typ" in decoded && decoded?.typ !== "JWT")
457
- return false;
458
- if (!decoded.alg)
459
- return false;
460
- if (alg && decoded.alg !== alg)
461
- return false;
462
- return true;
463
- }
464
- catch {
465
- return false;
466
- }
467
- }
468
- function isValidCidr(ip, version) {
469
- if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
470
- return true;
471
- }
472
- if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
473
- return true;
474
- }
475
- return false;
476
- }
477
- class ZodString extends ZodType {
478
- _parse(input) {
479
- if (this._def.coerce) {
480
- input.data = String(input.data);
481
- }
482
- const parsedType = this._getType(input);
483
- if (parsedType !== ZodParsedType.string) {
484
- const ctx = this._getOrReturnCtx(input);
485
- addIssueToContext(ctx, {
486
- code: ZodIssueCode.invalid_type,
487
- expected: ZodParsedType.string,
488
- received: ctx.parsedType,
489
- });
490
- return INVALID;
491
- }
492
- const status = new ParseStatus();
493
- let ctx = undefined;
494
- for (const check of this._def.checks) {
495
- if (check.kind === "min") {
496
- if (input.data.length < check.value) {
497
- ctx = this._getOrReturnCtx(input, ctx);
498
- addIssueToContext(ctx, {
499
- code: ZodIssueCode.too_small,
500
- minimum: check.value,
501
- type: "string",
502
- inclusive: true,
503
- exact: false,
504
- message: check.message,
505
- });
506
- status.dirty();
507
- }
508
- }
509
- else if (check.kind === "max") {
510
- if (input.data.length > check.value) {
511
- ctx = this._getOrReturnCtx(input, ctx);
512
- addIssueToContext(ctx, {
513
- code: ZodIssueCode.too_big,
514
- maximum: check.value,
515
- type: "string",
516
- inclusive: true,
517
- exact: false,
518
- message: check.message,
519
- });
520
- status.dirty();
521
- }
522
- }
523
- else if (check.kind === "length") {
524
- const tooBig = input.data.length > check.value;
525
- const tooSmall = input.data.length < check.value;
526
- if (tooBig || tooSmall) {
527
- ctx = this._getOrReturnCtx(input, ctx);
528
- if (tooBig) {
529
- addIssueToContext(ctx, {
530
- code: ZodIssueCode.too_big,
531
- maximum: check.value,
532
- type: "string",
533
- inclusive: true,
534
- exact: true,
535
- message: check.message,
536
- });
537
- }
538
- else if (tooSmall) {
539
- addIssueToContext(ctx, {
540
- code: ZodIssueCode.too_small,
541
- minimum: check.value,
542
- type: "string",
543
- inclusive: true,
544
- exact: true,
545
- message: check.message,
546
- });
547
- }
548
- status.dirty();
549
- }
550
- }
551
- else if (check.kind === "email") {
552
- if (!emailRegex.test(input.data)) {
553
- ctx = this._getOrReturnCtx(input, ctx);
554
- addIssueToContext(ctx, {
555
- validation: "email",
556
- code: ZodIssueCode.invalid_string,
557
- message: check.message,
558
- });
559
- status.dirty();
560
- }
561
- }
562
- else if (check.kind === "emoji") {
563
- if (!emojiRegex) {
564
- emojiRegex = new RegExp(_emojiRegex, "u");
565
- }
566
- if (!emojiRegex.test(input.data)) {
567
- ctx = this._getOrReturnCtx(input, ctx);
568
- addIssueToContext(ctx, {
569
- validation: "emoji",
570
- code: ZodIssueCode.invalid_string,
571
- message: check.message,
572
- });
573
- status.dirty();
574
- }
575
- }
576
- else if (check.kind === "uuid") {
577
- if (!uuidRegex.test(input.data)) {
578
- ctx = this._getOrReturnCtx(input, ctx);
579
- addIssueToContext(ctx, {
580
- validation: "uuid",
581
- code: ZodIssueCode.invalid_string,
582
- message: check.message,
583
- });
584
- status.dirty();
585
- }
586
- }
587
- else if (check.kind === "nanoid") {
588
- if (!nanoidRegex.test(input.data)) {
589
- ctx = this._getOrReturnCtx(input, ctx);
590
- addIssueToContext(ctx, {
591
- validation: "nanoid",
592
- code: ZodIssueCode.invalid_string,
593
- message: check.message,
594
- });
595
- status.dirty();
596
- }
597
- }
598
- else if (check.kind === "cuid") {
599
- if (!cuidRegex.test(input.data)) {
600
- ctx = this._getOrReturnCtx(input, ctx);
601
- addIssueToContext(ctx, {
602
- validation: "cuid",
603
- code: ZodIssueCode.invalid_string,
604
- message: check.message,
605
- });
606
- status.dirty();
607
- }
608
- }
609
- else if (check.kind === "cuid2") {
610
- if (!cuid2Regex.test(input.data)) {
611
- ctx = this._getOrReturnCtx(input, ctx);
612
- addIssueToContext(ctx, {
613
- validation: "cuid2",
614
- code: ZodIssueCode.invalid_string,
615
- message: check.message,
616
- });
617
- status.dirty();
618
- }
619
- }
620
- else if (check.kind === "ulid") {
621
- if (!ulidRegex.test(input.data)) {
622
- ctx = this._getOrReturnCtx(input, ctx);
623
- addIssueToContext(ctx, {
624
- validation: "ulid",
625
- code: ZodIssueCode.invalid_string,
626
- message: check.message,
627
- });
628
- status.dirty();
629
- }
630
- }
631
- else if (check.kind === "url") {
632
- try {
633
- new URL(input.data);
634
- }
635
- catch {
636
- ctx = this._getOrReturnCtx(input, ctx);
637
- addIssueToContext(ctx, {
638
- validation: "url",
639
- code: ZodIssueCode.invalid_string,
640
- message: check.message,
641
- });
642
- status.dirty();
643
- }
644
- }
645
- else if (check.kind === "regex") {
646
- check.regex.lastIndex = 0;
647
- const testResult = check.regex.test(input.data);
648
- if (!testResult) {
649
- ctx = this._getOrReturnCtx(input, ctx);
650
- addIssueToContext(ctx, {
651
- validation: "regex",
652
- code: ZodIssueCode.invalid_string,
653
- message: check.message,
654
- });
655
- status.dirty();
656
- }
657
- }
658
- else if (check.kind === "trim") {
659
- input.data = input.data.trim();
660
- }
661
- else if (check.kind === "includes") {
662
- if (!input.data.includes(check.value, check.position)) {
663
- ctx = this._getOrReturnCtx(input, ctx);
664
- addIssueToContext(ctx, {
665
- code: ZodIssueCode.invalid_string,
666
- validation: { includes: check.value, position: check.position },
667
- message: check.message,
668
- });
669
- status.dirty();
670
- }
671
- }
672
- else if (check.kind === "toLowerCase") {
673
- input.data = input.data.toLowerCase();
674
- }
675
- else if (check.kind === "toUpperCase") {
676
- input.data = input.data.toUpperCase();
677
- }
678
- else if (check.kind === "startsWith") {
679
- if (!input.data.startsWith(check.value)) {
680
- ctx = this._getOrReturnCtx(input, ctx);
681
- addIssueToContext(ctx, {
682
- code: ZodIssueCode.invalid_string,
683
- validation: { startsWith: check.value },
684
- message: check.message,
685
- });
686
- status.dirty();
687
- }
688
- }
689
- else if (check.kind === "endsWith") {
690
- if (!input.data.endsWith(check.value)) {
691
- ctx = this._getOrReturnCtx(input, ctx);
692
- addIssueToContext(ctx, {
693
- code: ZodIssueCode.invalid_string,
694
- validation: { endsWith: check.value },
695
- message: check.message,
696
- });
697
- status.dirty();
698
- }
699
- }
700
- else if (check.kind === "datetime") {
701
- const regex = datetimeRegex(check);
702
- if (!regex.test(input.data)) {
703
- ctx = this._getOrReturnCtx(input, ctx);
704
- addIssueToContext(ctx, {
705
- code: ZodIssueCode.invalid_string,
706
- validation: "datetime",
707
- message: check.message,
708
- });
709
- status.dirty();
710
- }
711
- }
712
- else if (check.kind === "date") {
713
- const regex = dateRegex;
714
- if (!regex.test(input.data)) {
715
- ctx = this._getOrReturnCtx(input, ctx);
716
- addIssueToContext(ctx, {
717
- code: ZodIssueCode.invalid_string,
718
- validation: "date",
719
- message: check.message,
720
- });
721
- status.dirty();
722
- }
723
- }
724
- else if (check.kind === "time") {
725
- const regex = timeRegex(check);
726
- if (!regex.test(input.data)) {
727
- ctx = this._getOrReturnCtx(input, ctx);
728
- addIssueToContext(ctx, {
729
- code: ZodIssueCode.invalid_string,
730
- validation: "time",
731
- message: check.message,
732
- });
733
- status.dirty();
734
- }
735
- }
736
- else if (check.kind === "duration") {
737
- if (!durationRegex.test(input.data)) {
738
- ctx = this._getOrReturnCtx(input, ctx);
739
- addIssueToContext(ctx, {
740
- validation: "duration",
741
- code: ZodIssueCode.invalid_string,
742
- message: check.message,
743
- });
744
- status.dirty();
745
- }
746
- }
747
- else if (check.kind === "ip") {
748
- if (!isValidIP(input.data, check.version)) {
749
- ctx = this._getOrReturnCtx(input, ctx);
750
- addIssueToContext(ctx, {
751
- validation: "ip",
752
- code: ZodIssueCode.invalid_string,
753
- message: check.message,
754
- });
755
- status.dirty();
756
- }
757
- }
758
- else if (check.kind === "jwt") {
759
- if (!isValidJWT(input.data, check.alg)) {
760
- ctx = this._getOrReturnCtx(input, ctx);
761
- addIssueToContext(ctx, {
762
- validation: "jwt",
763
- code: ZodIssueCode.invalid_string,
764
- message: check.message,
765
- });
766
- status.dirty();
767
- }
768
- }
769
- else if (check.kind === "cidr") {
770
- if (!isValidCidr(input.data, check.version)) {
771
- ctx = this._getOrReturnCtx(input, ctx);
772
- addIssueToContext(ctx, {
773
- validation: "cidr",
774
- code: ZodIssueCode.invalid_string,
775
- message: check.message,
776
- });
777
- status.dirty();
778
- }
779
- }
780
- else if (check.kind === "base64") {
781
- if (!base64Regex.test(input.data)) {
782
- ctx = this._getOrReturnCtx(input, ctx);
783
- addIssueToContext(ctx, {
784
- validation: "base64",
785
- code: ZodIssueCode.invalid_string,
786
- message: check.message,
787
- });
788
- status.dirty();
789
- }
790
- }
791
- else if (check.kind === "base64url") {
792
- if (!base64urlRegex.test(input.data)) {
793
- ctx = this._getOrReturnCtx(input, ctx);
794
- addIssueToContext(ctx, {
795
- validation: "base64url",
796
- code: ZodIssueCode.invalid_string,
797
- message: check.message,
798
- });
799
- status.dirty();
800
- }
801
- }
802
- else {
803
- util.assertNever(check);
804
- }
805
- }
806
- return { status: status.value, value: input.data };
807
- }
808
- _regex(regex, validation, message) {
809
- return this.refinement((data) => regex.test(data), {
810
- validation,
811
- code: ZodIssueCode.invalid_string,
812
- ...errorUtil.errToObj(message),
813
- });
814
- }
815
- _addCheck(check) {
816
- return new ZodString({
817
- ...this._def,
818
- checks: [...this._def.checks, check],
819
- });
820
- }
821
- email(message) {
822
- return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) });
823
- }
824
- url(message) {
825
- return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
826
- }
827
- emoji(message) {
828
- return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
829
- }
830
- uuid(message) {
831
- return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
832
- }
833
- nanoid(message) {
834
- return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
835
- }
836
- cuid(message) {
837
- return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
838
- }
839
- cuid2(message) {
840
- return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
841
- }
842
- ulid(message) {
843
- return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
844
- }
845
- base64(message) {
846
- return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
847
- }
848
- base64url(message) {
849
- // base64url encoding is a modification of base64 that can safely be used in URLs and filenames
850
- return this._addCheck({
851
- kind: "base64url",
852
- ...errorUtil.errToObj(message),
853
- });
854
- }
855
- jwt(options) {
856
- return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
857
- }
858
- ip(options) {
859
- return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
860
- }
861
- cidr(options) {
862
- return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
863
- }
864
- datetime(options) {
865
- if (typeof options === "string") {
866
- return this._addCheck({
867
- kind: "datetime",
868
- precision: null,
869
- offset: false,
870
- local: false,
871
- message: options,
872
- });
873
- }
874
- return this._addCheck({
875
- kind: "datetime",
876
- precision: typeof options?.precision === "undefined" ? null : options?.precision,
877
- offset: options?.offset ?? false,
878
- local: options?.local ?? false,
879
- ...errorUtil.errToObj(options?.message),
880
- });
881
- }
882
- date(message) {
883
- return this._addCheck({ kind: "date", message });
884
- }
885
- time(options) {
886
- if (typeof options === "string") {
887
- return this._addCheck({
888
- kind: "time",
889
- precision: null,
890
- message: options,
891
- });
892
- }
893
- return this._addCheck({
894
- kind: "time",
895
- precision: typeof options?.precision === "undefined" ? null : options?.precision,
896
- ...errorUtil.errToObj(options?.message),
897
- });
898
- }
899
- duration(message) {
900
- return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
901
- }
902
- regex(regex, message) {
903
- return this._addCheck({
904
- kind: "regex",
905
- regex: regex,
906
- ...errorUtil.errToObj(message),
907
- });
908
- }
909
- includes(value, options) {
910
- return this._addCheck({
911
- kind: "includes",
912
- value: value,
913
- position: options?.position,
914
- ...errorUtil.errToObj(options?.message),
915
- });
916
- }
917
- startsWith(value, message) {
918
- return this._addCheck({
919
- kind: "startsWith",
920
- value: value,
921
- ...errorUtil.errToObj(message),
922
- });
923
- }
924
- endsWith(value, message) {
925
- return this._addCheck({
926
- kind: "endsWith",
927
- value: value,
928
- ...errorUtil.errToObj(message),
929
- });
930
- }
931
- min(minLength, message) {
932
- return this._addCheck({
933
- kind: "min",
934
- value: minLength,
935
- ...errorUtil.errToObj(message),
936
- });
937
- }
938
- max(maxLength, message) {
939
- return this._addCheck({
940
- kind: "max",
941
- value: maxLength,
942
- ...errorUtil.errToObj(message),
943
- });
944
- }
945
- length(len, message) {
946
- return this._addCheck({
947
- kind: "length",
948
- value: len,
949
- ...errorUtil.errToObj(message),
950
- });
951
- }
952
- /**
953
- * Equivalent to `.min(1)`
954
- */
955
- nonempty(message) {
956
- return this.min(1, errorUtil.errToObj(message));
957
- }
958
- trim() {
959
- return new ZodString({
960
- ...this._def,
961
- checks: [...this._def.checks, { kind: "trim" }],
962
- });
963
- }
964
- toLowerCase() {
965
- return new ZodString({
966
- ...this._def,
967
- checks: [...this._def.checks, { kind: "toLowerCase" }],
968
- });
969
- }
970
- toUpperCase() {
971
- return new ZodString({
972
- ...this._def,
973
- checks: [...this._def.checks, { kind: "toUpperCase" }],
974
- });
975
- }
976
- get isDatetime() {
977
- return !!this._def.checks.find((ch) => ch.kind === "datetime");
978
- }
979
- get isDate() {
980
- return !!this._def.checks.find((ch) => ch.kind === "date");
981
- }
982
- get isTime() {
983
- return !!this._def.checks.find((ch) => ch.kind === "time");
984
- }
985
- get isDuration() {
986
- return !!this._def.checks.find((ch) => ch.kind === "duration");
987
- }
988
- get isEmail() {
989
- return !!this._def.checks.find((ch) => ch.kind === "email");
990
- }
991
- get isURL() {
992
- return !!this._def.checks.find((ch) => ch.kind === "url");
993
- }
994
- get isEmoji() {
995
- return !!this._def.checks.find((ch) => ch.kind === "emoji");
996
- }
997
- get isUUID() {
998
- return !!this._def.checks.find((ch) => ch.kind === "uuid");
999
- }
1000
- get isNANOID() {
1001
- return !!this._def.checks.find((ch) => ch.kind === "nanoid");
1002
- }
1003
- get isCUID() {
1004
- return !!this._def.checks.find((ch) => ch.kind === "cuid");
1005
- }
1006
- get isCUID2() {
1007
- return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1008
- }
1009
- get isULID() {
1010
- return !!this._def.checks.find((ch) => ch.kind === "ulid");
1011
- }
1012
- get isIP() {
1013
- return !!this._def.checks.find((ch) => ch.kind === "ip");
1014
- }
1015
- get isCIDR() {
1016
- return !!this._def.checks.find((ch) => ch.kind === "cidr");
1017
- }
1018
- get isBase64() {
1019
- return !!this._def.checks.find((ch) => ch.kind === "base64");
1020
- }
1021
- get isBase64url() {
1022
- // base64url encoding is a modification of base64 that can safely be used in URLs and filenames
1023
- return !!this._def.checks.find((ch) => ch.kind === "base64url");
1024
- }
1025
- get minLength() {
1026
- let min = null;
1027
- for (const ch of this._def.checks) {
1028
- if (ch.kind === "min") {
1029
- if (min === null || ch.value > min)
1030
- min = ch.value;
1031
- }
1032
- }
1033
- return min;
1034
- }
1035
- get maxLength() {
1036
- let max = null;
1037
- for (const ch of this._def.checks) {
1038
- if (ch.kind === "max") {
1039
- if (max === null || ch.value < max)
1040
- max = ch.value;
1041
- }
1042
- }
1043
- return max;
1044
- }
1045
- }
1046
- ZodString.create = (params) => {
1047
- return new ZodString({
1048
- checks: [],
1049
- typeName: ZodFirstPartyTypeKind.ZodString,
1050
- coerce: params?.coerce ?? false,
1051
- ...processCreateParams(params),
1052
- });
1053
- };
1054
- // https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034
1055
- function floatSafeRemainder(val, step) {
1056
- const valDecCount = (val.toString().split(".")[1] || "").length;
1057
- const stepDecCount = (step.toString().split(".")[1] || "").length;
1058
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
1059
- const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
1060
- const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
1061
- return (valInt % stepInt) / 10 ** decCount;
1062
- }
1063
- class ZodNumber extends ZodType {
1064
- constructor() {
1065
- super(...arguments);
1066
- this.min = this.gte;
1067
- this.max = this.lte;
1068
- this.step = this.multipleOf;
1069
- }
1070
- _parse(input) {
1071
- if (this._def.coerce) {
1072
- input.data = Number(input.data);
1073
- }
1074
- const parsedType = this._getType(input);
1075
- if (parsedType !== ZodParsedType.number) {
1076
- const ctx = this._getOrReturnCtx(input);
1077
- addIssueToContext(ctx, {
1078
- code: ZodIssueCode.invalid_type,
1079
- expected: ZodParsedType.number,
1080
- received: ctx.parsedType,
1081
- });
1082
- return INVALID;
1083
- }
1084
- let ctx = undefined;
1085
- const status = new ParseStatus();
1086
- for (const check of this._def.checks) {
1087
- if (check.kind === "int") {
1088
- if (!util.isInteger(input.data)) {
1089
- ctx = this._getOrReturnCtx(input, ctx);
1090
- addIssueToContext(ctx, {
1091
- code: ZodIssueCode.invalid_type,
1092
- expected: "integer",
1093
- received: "float",
1094
- message: check.message,
1095
- });
1096
- status.dirty();
1097
- }
1098
- }
1099
- else if (check.kind === "min") {
1100
- const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1101
- if (tooSmall) {
1102
- ctx = this._getOrReturnCtx(input, ctx);
1103
- addIssueToContext(ctx, {
1104
- code: ZodIssueCode.too_small,
1105
- minimum: check.value,
1106
- type: "number",
1107
- inclusive: check.inclusive,
1108
- exact: false,
1109
- message: check.message,
1110
- });
1111
- status.dirty();
1112
- }
1113
- }
1114
- else if (check.kind === "max") {
1115
- const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1116
- if (tooBig) {
1117
- ctx = this._getOrReturnCtx(input, ctx);
1118
- addIssueToContext(ctx, {
1119
- code: ZodIssueCode.too_big,
1120
- maximum: check.value,
1121
- type: "number",
1122
- inclusive: check.inclusive,
1123
- exact: false,
1124
- message: check.message,
1125
- });
1126
- status.dirty();
1127
- }
1128
- }
1129
- else if (check.kind === "multipleOf") {
1130
- if (floatSafeRemainder(input.data, check.value) !== 0) {
1131
- ctx = this._getOrReturnCtx(input, ctx);
1132
- addIssueToContext(ctx, {
1133
- code: ZodIssueCode.not_multiple_of,
1134
- multipleOf: check.value,
1135
- message: check.message,
1136
- });
1137
- status.dirty();
1138
- }
1139
- }
1140
- else if (check.kind === "finite") {
1141
- if (!Number.isFinite(input.data)) {
1142
- ctx = this._getOrReturnCtx(input, ctx);
1143
- addIssueToContext(ctx, {
1144
- code: ZodIssueCode.not_finite,
1145
- message: check.message,
1146
- });
1147
- status.dirty();
1148
- }
1149
- }
1150
- else {
1151
- util.assertNever(check);
1152
- }
1153
- }
1154
- return { status: status.value, value: input.data };
1155
- }
1156
- gte(value, message) {
1157
- return this.setLimit("min", value, true, errorUtil.toString(message));
1158
- }
1159
- gt(value, message) {
1160
- return this.setLimit("min", value, false, errorUtil.toString(message));
1161
- }
1162
- lte(value, message) {
1163
- return this.setLimit("max", value, true, errorUtil.toString(message));
1164
- }
1165
- lt(value, message) {
1166
- return this.setLimit("max", value, false, errorUtil.toString(message));
1167
- }
1168
- setLimit(kind, value, inclusive, message) {
1169
- return new ZodNumber({
1170
- ...this._def,
1171
- checks: [
1172
- ...this._def.checks,
1173
- {
1174
- kind,
1175
- value,
1176
- inclusive,
1177
- message: errorUtil.toString(message),
1178
- },
1179
- ],
1180
- });
1181
- }
1182
- _addCheck(check) {
1183
- return new ZodNumber({
1184
- ...this._def,
1185
- checks: [...this._def.checks, check],
1186
- });
1187
- }
1188
- int(message) {
1189
- return this._addCheck({
1190
- kind: "int",
1191
- message: errorUtil.toString(message),
1192
- });
1193
- }
1194
- positive(message) {
1195
- return this._addCheck({
1196
- kind: "min",
1197
- value: 0,
1198
- inclusive: false,
1199
- message: errorUtil.toString(message),
1200
- });
1201
- }
1202
- negative(message) {
1203
- return this._addCheck({
1204
- kind: "max",
1205
- value: 0,
1206
- inclusive: false,
1207
- message: errorUtil.toString(message),
1208
- });
1209
- }
1210
- nonpositive(message) {
1211
- return this._addCheck({
1212
- kind: "max",
1213
- value: 0,
1214
- inclusive: true,
1215
- message: errorUtil.toString(message),
1216
- });
1217
- }
1218
- nonnegative(message) {
1219
- return this._addCheck({
1220
- kind: "min",
1221
- value: 0,
1222
- inclusive: true,
1223
- message: errorUtil.toString(message),
1224
- });
1225
- }
1226
- multipleOf(value, message) {
1227
- return this._addCheck({
1228
- kind: "multipleOf",
1229
- value: value,
1230
- message: errorUtil.toString(message),
1231
- });
1232
- }
1233
- finite(message) {
1234
- return this._addCheck({
1235
- kind: "finite",
1236
- message: errorUtil.toString(message),
1237
- });
1238
- }
1239
- safe(message) {
1240
- return this._addCheck({
1241
- kind: "min",
1242
- inclusive: true,
1243
- value: Number.MIN_SAFE_INTEGER,
1244
- message: errorUtil.toString(message),
1245
- })._addCheck({
1246
- kind: "max",
1247
- inclusive: true,
1248
- value: Number.MAX_SAFE_INTEGER,
1249
- message: errorUtil.toString(message),
1250
- });
1251
- }
1252
- get minValue() {
1253
- let min = null;
1254
- for (const ch of this._def.checks) {
1255
- if (ch.kind === "min") {
1256
- if (min === null || ch.value > min)
1257
- min = ch.value;
1258
- }
1259
- }
1260
- return min;
1261
- }
1262
- get maxValue() {
1263
- let max = null;
1264
- for (const ch of this._def.checks) {
1265
- if (ch.kind === "max") {
1266
- if (max === null || ch.value < max)
1267
- max = ch.value;
1268
- }
1269
- }
1270
- return max;
1271
- }
1272
- get isInt() {
1273
- return !!this._def.checks.find((ch) => ch.kind === "int" || (ch.kind === "multipleOf" && util.isInteger(ch.value)));
1274
- }
1275
- get isFinite() {
1276
- let max = null;
1277
- let min = null;
1278
- for (const ch of this._def.checks) {
1279
- if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1280
- return true;
1281
- }
1282
- else if (ch.kind === "min") {
1283
- if (min === null || ch.value > min)
1284
- min = ch.value;
1285
- }
1286
- else if (ch.kind === "max") {
1287
- if (max === null || ch.value < max)
1288
- max = ch.value;
1289
- }
1290
- }
1291
- return Number.isFinite(min) && Number.isFinite(max);
1292
- }
1293
- }
1294
- ZodNumber.create = (params) => {
1295
- return new ZodNumber({
1296
- checks: [],
1297
- typeName: ZodFirstPartyTypeKind.ZodNumber,
1298
- coerce: params?.coerce || false,
1299
- ...processCreateParams(params),
1300
- });
1301
- };
1302
- class ZodBigInt extends ZodType {
1303
- constructor() {
1304
- super(...arguments);
1305
- this.min = this.gte;
1306
- this.max = this.lte;
1307
- }
1308
- _parse(input) {
1309
- if (this._def.coerce) {
1310
- try {
1311
- input.data = BigInt(input.data);
1312
- }
1313
- catch {
1314
- return this._getInvalidInput(input);
1315
- }
1316
- }
1317
- const parsedType = this._getType(input);
1318
- if (parsedType !== ZodParsedType.bigint) {
1319
- return this._getInvalidInput(input);
1320
- }
1321
- let ctx = undefined;
1322
- const status = new ParseStatus();
1323
- for (const check of this._def.checks) {
1324
- if (check.kind === "min") {
1325
- const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1326
- if (tooSmall) {
1327
- ctx = this._getOrReturnCtx(input, ctx);
1328
- addIssueToContext(ctx, {
1329
- code: ZodIssueCode.too_small,
1330
- type: "bigint",
1331
- minimum: check.value,
1332
- inclusive: check.inclusive,
1333
- message: check.message,
1334
- });
1335
- status.dirty();
1336
- }
1337
- }
1338
- else if (check.kind === "max") {
1339
- const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1340
- if (tooBig) {
1341
- ctx = this._getOrReturnCtx(input, ctx);
1342
- addIssueToContext(ctx, {
1343
- code: ZodIssueCode.too_big,
1344
- type: "bigint",
1345
- maximum: check.value,
1346
- inclusive: check.inclusive,
1347
- message: check.message,
1348
- });
1349
- status.dirty();
1350
- }
1351
- }
1352
- else if (check.kind === "multipleOf") {
1353
- if (input.data % check.value !== BigInt(0)) {
1354
- ctx = this._getOrReturnCtx(input, ctx);
1355
- addIssueToContext(ctx, {
1356
- code: ZodIssueCode.not_multiple_of,
1357
- multipleOf: check.value,
1358
- message: check.message,
1359
- });
1360
- status.dirty();
1361
- }
1362
- }
1363
- else {
1364
- util.assertNever(check);
1365
- }
1366
- }
1367
- return { status: status.value, value: input.data };
1368
- }
1369
- _getInvalidInput(input) {
1370
- const ctx = this._getOrReturnCtx(input);
1371
- addIssueToContext(ctx, {
1372
- code: ZodIssueCode.invalid_type,
1373
- expected: ZodParsedType.bigint,
1374
- received: ctx.parsedType,
1375
- });
1376
- return INVALID;
1377
- }
1378
- gte(value, message) {
1379
- return this.setLimit("min", value, true, errorUtil.toString(message));
1380
- }
1381
- gt(value, message) {
1382
- return this.setLimit("min", value, false, errorUtil.toString(message));
1383
- }
1384
- lte(value, message) {
1385
- return this.setLimit("max", value, true, errorUtil.toString(message));
1386
- }
1387
- lt(value, message) {
1388
- return this.setLimit("max", value, false, errorUtil.toString(message));
1389
- }
1390
- setLimit(kind, value, inclusive, message) {
1391
- return new ZodBigInt({
1392
- ...this._def,
1393
- checks: [
1394
- ...this._def.checks,
1395
- {
1396
- kind,
1397
- value,
1398
- inclusive,
1399
- message: errorUtil.toString(message),
1400
- },
1401
- ],
1402
- });
1403
- }
1404
- _addCheck(check) {
1405
- return new ZodBigInt({
1406
- ...this._def,
1407
- checks: [...this._def.checks, check],
1408
- });
1409
- }
1410
- positive(message) {
1411
- return this._addCheck({
1412
- kind: "min",
1413
- value: BigInt(0),
1414
- inclusive: false,
1415
- message: errorUtil.toString(message),
1416
- });
1417
- }
1418
- negative(message) {
1419
- return this._addCheck({
1420
- kind: "max",
1421
- value: BigInt(0),
1422
- inclusive: false,
1423
- message: errorUtil.toString(message),
1424
- });
1425
- }
1426
- nonpositive(message) {
1427
- return this._addCheck({
1428
- kind: "max",
1429
- value: BigInt(0),
1430
- inclusive: true,
1431
- message: errorUtil.toString(message),
1432
- });
1433
- }
1434
- nonnegative(message) {
1435
- return this._addCheck({
1436
- kind: "min",
1437
- value: BigInt(0),
1438
- inclusive: true,
1439
- message: errorUtil.toString(message),
1440
- });
1441
- }
1442
- multipleOf(value, message) {
1443
- return this._addCheck({
1444
- kind: "multipleOf",
1445
- value,
1446
- message: errorUtil.toString(message),
1447
- });
1448
- }
1449
- get minValue() {
1450
- let min = null;
1451
- for (const ch of this._def.checks) {
1452
- if (ch.kind === "min") {
1453
- if (min === null || ch.value > min)
1454
- min = ch.value;
1455
- }
1456
- }
1457
- return min;
1458
- }
1459
- get maxValue() {
1460
- let max = null;
1461
- for (const ch of this._def.checks) {
1462
- if (ch.kind === "max") {
1463
- if (max === null || ch.value < max)
1464
- max = ch.value;
1465
- }
1466
- }
1467
- return max;
1468
- }
1469
- }
1470
- ZodBigInt.create = (params) => {
1471
- return new ZodBigInt({
1472
- checks: [],
1473
- typeName: ZodFirstPartyTypeKind.ZodBigInt,
1474
- coerce: params?.coerce ?? false,
1475
- ...processCreateParams(params),
1476
- });
1477
- };
1478
- class ZodBoolean extends ZodType {
1479
- _parse(input) {
1480
- if (this._def.coerce) {
1481
- input.data = Boolean(input.data);
1482
- }
1483
- const parsedType = this._getType(input);
1484
- if (parsedType !== ZodParsedType.boolean) {
1485
- const ctx = this._getOrReturnCtx(input);
1486
- addIssueToContext(ctx, {
1487
- code: ZodIssueCode.invalid_type,
1488
- expected: ZodParsedType.boolean,
1489
- received: ctx.parsedType,
1490
- });
1491
- return INVALID;
1492
- }
1493
- return OK(input.data);
1494
- }
1495
- }
1496
- ZodBoolean.create = (params) => {
1497
- return new ZodBoolean({
1498
- typeName: ZodFirstPartyTypeKind.ZodBoolean,
1499
- coerce: params?.coerce || false,
1500
- ...processCreateParams(params),
1501
- });
1502
- };
1503
- class ZodDate extends ZodType {
1504
- _parse(input) {
1505
- if (this._def.coerce) {
1506
- input.data = new Date(input.data);
1507
- }
1508
- const parsedType = this._getType(input);
1509
- if (parsedType !== ZodParsedType.date) {
1510
- const ctx = this._getOrReturnCtx(input);
1511
- addIssueToContext(ctx, {
1512
- code: ZodIssueCode.invalid_type,
1513
- expected: ZodParsedType.date,
1514
- received: ctx.parsedType,
1515
- });
1516
- return INVALID;
1517
- }
1518
- if (Number.isNaN(input.data.getTime())) {
1519
- const ctx = this._getOrReturnCtx(input);
1520
- addIssueToContext(ctx, {
1521
- code: ZodIssueCode.invalid_date,
1522
- });
1523
- return INVALID;
1524
- }
1525
- const status = new ParseStatus();
1526
- let ctx = undefined;
1527
- for (const check of this._def.checks) {
1528
- if (check.kind === "min") {
1529
- if (input.data.getTime() < check.value) {
1530
- ctx = this._getOrReturnCtx(input, ctx);
1531
- addIssueToContext(ctx, {
1532
- code: ZodIssueCode.too_small,
1533
- message: check.message,
1534
- inclusive: true,
1535
- exact: false,
1536
- minimum: check.value,
1537
- type: "date",
1538
- });
1539
- status.dirty();
1540
- }
1541
- }
1542
- else if (check.kind === "max") {
1543
- if (input.data.getTime() > check.value) {
1544
- ctx = this._getOrReturnCtx(input, ctx);
1545
- addIssueToContext(ctx, {
1546
- code: ZodIssueCode.too_big,
1547
- message: check.message,
1548
- inclusive: true,
1549
- exact: false,
1550
- maximum: check.value,
1551
- type: "date",
1552
- });
1553
- status.dirty();
1554
- }
1555
- }
1556
- else {
1557
- util.assertNever(check);
1558
- }
1559
- }
1560
- return {
1561
- status: status.value,
1562
- value: new Date(input.data.getTime()),
1563
- };
1564
- }
1565
- _addCheck(check) {
1566
- return new ZodDate({
1567
- ...this._def,
1568
- checks: [...this._def.checks, check],
1569
- });
1570
- }
1571
- min(minDate, message) {
1572
- return this._addCheck({
1573
- kind: "min",
1574
- value: minDate.getTime(),
1575
- message: errorUtil.toString(message),
1576
- });
1577
- }
1578
- max(maxDate, message) {
1579
- return this._addCheck({
1580
- kind: "max",
1581
- value: maxDate.getTime(),
1582
- message: errorUtil.toString(message),
1583
- });
1584
- }
1585
- get minDate() {
1586
- let min = null;
1587
- for (const ch of this._def.checks) {
1588
- if (ch.kind === "min") {
1589
- if (min === null || ch.value > min)
1590
- min = ch.value;
1591
- }
1592
- }
1593
- return min != null ? new Date(min) : null;
1594
- }
1595
- get maxDate() {
1596
- let max = null;
1597
- for (const ch of this._def.checks) {
1598
- if (ch.kind === "max") {
1599
- if (max === null || ch.value < max)
1600
- max = ch.value;
1601
- }
1602
- }
1603
- return max != null ? new Date(max) : null;
1604
- }
1605
- }
1606
- ZodDate.create = (params) => {
1607
- return new ZodDate({
1608
- checks: [],
1609
- coerce: params?.coerce || false,
1610
- typeName: ZodFirstPartyTypeKind.ZodDate,
1611
- ...processCreateParams(params),
1612
- });
1613
- };
1614
- class ZodSymbol extends ZodType {
1615
- _parse(input) {
1616
- const parsedType = this._getType(input);
1617
- if (parsedType !== ZodParsedType.symbol) {
1618
- const ctx = this._getOrReturnCtx(input);
1619
- addIssueToContext(ctx, {
1620
- code: ZodIssueCode.invalid_type,
1621
- expected: ZodParsedType.symbol,
1622
- received: ctx.parsedType,
1623
- });
1624
- return INVALID;
1625
- }
1626
- return OK(input.data);
1627
- }
1628
- }
1629
- ZodSymbol.create = (params) => {
1630
- return new ZodSymbol({
1631
- typeName: ZodFirstPartyTypeKind.ZodSymbol,
1632
- ...processCreateParams(params),
1633
- });
1634
- };
1635
- class ZodUndefined extends ZodType {
1636
- _parse(input) {
1637
- const parsedType = this._getType(input);
1638
- if (parsedType !== ZodParsedType.undefined) {
1639
- const ctx = this._getOrReturnCtx(input);
1640
- addIssueToContext(ctx, {
1641
- code: ZodIssueCode.invalid_type,
1642
- expected: ZodParsedType.undefined,
1643
- received: ctx.parsedType,
1644
- });
1645
- return INVALID;
1646
- }
1647
- return OK(input.data);
1648
- }
1649
- }
1650
- ZodUndefined.create = (params) => {
1651
- return new ZodUndefined({
1652
- typeName: ZodFirstPartyTypeKind.ZodUndefined,
1653
- ...processCreateParams(params),
1654
- });
1655
- };
1656
- class ZodNull extends ZodType {
1657
- _parse(input) {
1658
- const parsedType = this._getType(input);
1659
- if (parsedType !== ZodParsedType.null) {
1660
- const ctx = this._getOrReturnCtx(input);
1661
- addIssueToContext(ctx, {
1662
- code: ZodIssueCode.invalid_type,
1663
- expected: ZodParsedType.null,
1664
- received: ctx.parsedType,
1665
- });
1666
- return INVALID;
1667
- }
1668
- return OK(input.data);
1669
- }
1670
- }
1671
- ZodNull.create = (params) => {
1672
- return new ZodNull({
1673
- typeName: ZodFirstPartyTypeKind.ZodNull,
1674
- ...processCreateParams(params),
1675
- });
1676
- };
1677
- class ZodAny extends ZodType {
1678
- constructor() {
1679
- super(...arguments);
1680
- // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.
1681
- this._any = true;
1682
- }
1683
- _parse(input) {
1684
- return OK(input.data);
1685
- }
1686
- }
1687
- ZodAny.create = (params) => {
1688
- return new ZodAny({
1689
- typeName: ZodFirstPartyTypeKind.ZodAny,
1690
- ...processCreateParams(params),
1691
- });
1692
- };
1693
- class ZodUnknown extends ZodType {
1694
- constructor() {
1695
- super(...arguments);
1696
- // required
1697
- this._unknown = true;
1698
- }
1699
- _parse(input) {
1700
- return OK(input.data);
1701
- }
1702
- }
1703
- ZodUnknown.create = (params) => {
1704
- return new ZodUnknown({
1705
- typeName: ZodFirstPartyTypeKind.ZodUnknown,
1706
- ...processCreateParams(params),
1707
- });
1708
- };
1709
- class ZodNever extends ZodType {
1710
- _parse(input) {
1711
- const ctx = this._getOrReturnCtx(input);
1712
- addIssueToContext(ctx, {
1713
- code: ZodIssueCode.invalid_type,
1714
- expected: ZodParsedType.never,
1715
- received: ctx.parsedType,
1716
- });
1717
- return INVALID;
1718
- }
1719
- }
1720
- ZodNever.create = (params) => {
1721
- return new ZodNever({
1722
- typeName: ZodFirstPartyTypeKind.ZodNever,
1723
- ...processCreateParams(params),
1724
- });
1725
- };
1726
- class ZodVoid extends ZodType {
1727
- _parse(input) {
1728
- const parsedType = this._getType(input);
1729
- if (parsedType !== ZodParsedType.undefined) {
1730
- const ctx = this._getOrReturnCtx(input);
1731
- addIssueToContext(ctx, {
1732
- code: ZodIssueCode.invalid_type,
1733
- expected: ZodParsedType.void,
1734
- received: ctx.parsedType,
1735
- });
1736
- return INVALID;
1737
- }
1738
- return OK(input.data);
1739
- }
1740
- }
1741
- ZodVoid.create = (params) => {
1742
- return new ZodVoid({
1743
- typeName: ZodFirstPartyTypeKind.ZodVoid,
1744
- ...processCreateParams(params),
1745
- });
1746
- };
1747
- class ZodArray extends ZodType {
1748
- _parse(input) {
1749
- const { ctx, status } = this._processInputParams(input);
1750
- const def = this._def;
1751
- if (ctx.parsedType !== ZodParsedType.array) {
1752
- addIssueToContext(ctx, {
1753
- code: ZodIssueCode.invalid_type,
1754
- expected: ZodParsedType.array,
1755
- received: ctx.parsedType,
1756
- });
1757
- return INVALID;
1758
- }
1759
- if (def.exactLength !== null) {
1760
- const tooBig = ctx.data.length > def.exactLength.value;
1761
- const tooSmall = ctx.data.length < def.exactLength.value;
1762
- if (tooBig || tooSmall) {
1763
- addIssueToContext(ctx, {
1764
- code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
1765
- minimum: (tooSmall ? def.exactLength.value : undefined),
1766
- maximum: (tooBig ? def.exactLength.value : undefined),
1767
- type: "array",
1768
- inclusive: true,
1769
- exact: true,
1770
- message: def.exactLength.message,
1771
- });
1772
- status.dirty();
1773
- }
1774
- }
1775
- if (def.minLength !== null) {
1776
- if (ctx.data.length < def.minLength.value) {
1777
- addIssueToContext(ctx, {
1778
- code: ZodIssueCode.too_small,
1779
- minimum: def.minLength.value,
1780
- type: "array",
1781
- inclusive: true,
1782
- exact: false,
1783
- message: def.minLength.message,
1784
- });
1785
- status.dirty();
1786
- }
1787
- }
1788
- if (def.maxLength !== null) {
1789
- if (ctx.data.length > def.maxLength.value) {
1790
- addIssueToContext(ctx, {
1791
- code: ZodIssueCode.too_big,
1792
- maximum: def.maxLength.value,
1793
- type: "array",
1794
- inclusive: true,
1795
- exact: false,
1796
- message: def.maxLength.message,
1797
- });
1798
- status.dirty();
1799
- }
1800
- }
1801
- if (ctx.common.async) {
1802
- return Promise.all([...ctx.data].map((item, i) => {
1803
- return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1804
- })).then((result) => {
1805
- return ParseStatus.mergeArray(status, result);
1806
- });
1807
- }
1808
- const result = [...ctx.data].map((item, i) => {
1809
- return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1810
- });
1811
- return ParseStatus.mergeArray(status, result);
1812
- }
1813
- get element() {
1814
- return this._def.type;
1815
- }
1816
- min(minLength, message) {
1817
- return new ZodArray({
1818
- ...this._def,
1819
- minLength: { value: minLength, message: errorUtil.toString(message) },
1820
- });
1821
- }
1822
- max(maxLength, message) {
1823
- return new ZodArray({
1824
- ...this._def,
1825
- maxLength: { value: maxLength, message: errorUtil.toString(message) },
1826
- });
1827
- }
1828
- length(len, message) {
1829
- return new ZodArray({
1830
- ...this._def,
1831
- exactLength: { value: len, message: errorUtil.toString(message) },
1832
- });
1833
- }
1834
- nonempty(message) {
1835
- return this.min(1, message);
1836
- }
1837
- }
1838
- ZodArray.create = (schema, params) => {
1839
- return new ZodArray({
1840
- type: schema,
1841
- minLength: null,
1842
- maxLength: null,
1843
- exactLength: null,
1844
- typeName: ZodFirstPartyTypeKind.ZodArray,
1845
- ...processCreateParams(params),
1846
- });
1847
- };
1848
- function deepPartialify(schema) {
1849
- if (schema instanceof ZodObject) {
1850
- const newShape = {};
1851
- for (const key in schema.shape) {
1852
- const fieldSchema = schema.shape[key];
1853
- newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
1854
- }
1855
- return new ZodObject({
1856
- ...schema._def,
1857
- shape: () => newShape,
1858
- });
1859
- }
1860
- else if (schema instanceof ZodArray) {
1861
- return new ZodArray({
1862
- ...schema._def,
1863
- type: deepPartialify(schema.element),
1864
- });
1865
- }
1866
- else if (schema instanceof ZodOptional) {
1867
- return ZodOptional.create(deepPartialify(schema.unwrap()));
1868
- }
1869
- else if (schema instanceof ZodNullable) {
1870
- return ZodNullable.create(deepPartialify(schema.unwrap()));
1871
- }
1872
- else if (schema instanceof ZodTuple) {
1873
- return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
1874
- }
1875
- else {
1876
- return schema;
1877
- }
1878
- }
1879
- class ZodObject extends ZodType {
1880
- constructor() {
1881
- super(...arguments);
1882
- this._cached = null;
1883
- /**
1884
- * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
1885
- * If you want to pass through unknown properties, use `.passthrough()` instead.
1886
- */
1887
- this.nonstrict = this.passthrough;
1888
- // extend<
1889
- // Augmentation extends ZodRawShape,
1890
- // NewOutput extends util.flatten<{
1891
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
1892
- // ? Augmentation[k]["_output"]
1893
- // : k extends keyof Output
1894
- // ? Output[k]
1895
- // : never;
1896
- // }>,
1897
- // NewInput extends util.flatten<{
1898
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
1899
- // ? Augmentation[k]["_input"]
1900
- // : k extends keyof Input
1901
- // ? Input[k]
1902
- // : never;
1903
- // }>
1904
- // >(
1905
- // augmentation: Augmentation
1906
- // ): ZodObject<
1907
- // extendShape<T, Augmentation>,
1908
- // UnknownKeys,
1909
- // Catchall,
1910
- // NewOutput,
1911
- // NewInput
1912
- // > {
1913
- // return new ZodObject({
1914
- // ...this._def,
1915
- // shape: () => ({
1916
- // ...this._def.shape(),
1917
- // ...augmentation,
1918
- // }),
1919
- // }) as any;
1920
- // }
1921
- /**
1922
- * @deprecated Use `.extend` instead
1923
- * */
1924
- this.augment = this.extend;
1925
- }
1926
- _getCached() {
1927
- if (this._cached !== null)
1928
- return this._cached;
1929
- const shape = this._def.shape();
1930
- const keys = util.objectKeys(shape);
1931
- this._cached = { shape, keys };
1932
- return this._cached;
1933
- }
1934
- _parse(input) {
1935
- const parsedType = this._getType(input);
1936
- if (parsedType !== ZodParsedType.object) {
1937
- const ctx = this._getOrReturnCtx(input);
1938
- addIssueToContext(ctx, {
1939
- code: ZodIssueCode.invalid_type,
1940
- expected: ZodParsedType.object,
1941
- received: ctx.parsedType,
1942
- });
1943
- return INVALID;
1944
- }
1945
- const { status, ctx } = this._processInputParams(input);
1946
- const { shape, keys: shapeKeys } = this._getCached();
1947
- const extraKeys = [];
1948
- if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
1949
- for (const key in ctx.data) {
1950
- if (!shapeKeys.includes(key)) {
1951
- extraKeys.push(key);
1952
- }
1953
- }
1954
- }
1955
- const pairs = [];
1956
- for (const key of shapeKeys) {
1957
- const keyValidator = shape[key];
1958
- const value = ctx.data[key];
1959
- pairs.push({
1960
- key: { status: "valid", value: key },
1961
- value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
1962
- alwaysSet: key in ctx.data,
1963
- });
1964
- }
1965
- if (this._def.catchall instanceof ZodNever) {
1966
- const unknownKeys = this._def.unknownKeys;
1967
- if (unknownKeys === "passthrough") {
1968
- for (const key of extraKeys) {
1969
- pairs.push({
1970
- key: { status: "valid", value: key },
1971
- value: { status: "valid", value: ctx.data[key] },
1972
- });
1973
- }
1974
- }
1975
- else if (unknownKeys === "strict") {
1976
- if (extraKeys.length > 0) {
1977
- addIssueToContext(ctx, {
1978
- code: ZodIssueCode.unrecognized_keys,
1979
- keys: extraKeys,
1980
- });
1981
- status.dirty();
1982
- }
1983
- }
1984
- else if (unknownKeys === "strip") ;
1985
- else {
1986
- throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
1987
- }
1988
- }
1989
- else {
1990
- // run catchall validation
1991
- const catchall = this._def.catchall;
1992
- for (const key of extraKeys) {
1993
- const value = ctx.data[key];
1994
- pairs.push({
1995
- key: { status: "valid", value: key },
1996
- value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)
1997
- ),
1998
- alwaysSet: key in ctx.data,
1999
- });
2000
- }
2001
- }
2002
- if (ctx.common.async) {
2003
- return Promise.resolve()
2004
- .then(async () => {
2005
- const syncPairs = [];
2006
- for (const pair of pairs) {
2007
- const key = await pair.key;
2008
- const value = await pair.value;
2009
- syncPairs.push({
2010
- key,
2011
- value,
2012
- alwaysSet: pair.alwaysSet,
2013
- });
2014
- }
2015
- return syncPairs;
2016
- })
2017
- .then((syncPairs) => {
2018
- return ParseStatus.mergeObjectSync(status, syncPairs);
2019
- });
2020
- }
2021
- else {
2022
- return ParseStatus.mergeObjectSync(status, pairs);
2023
- }
2024
- }
2025
- get shape() {
2026
- return this._def.shape();
2027
- }
2028
- strict(message) {
2029
- errorUtil.errToObj;
2030
- return new ZodObject({
2031
- ...this._def,
2032
- unknownKeys: "strict",
2033
- ...(message !== undefined
2034
- ? {
2035
- errorMap: (issue, ctx) => {
2036
- const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
2037
- if (issue.code === "unrecognized_keys")
2038
- return {
2039
- message: errorUtil.errToObj(message).message ?? defaultError,
2040
- };
2041
- return {
2042
- message: defaultError,
2043
- };
2044
- },
2045
- }
2046
- : {}),
2047
- });
2048
- }
2049
- strip() {
2050
- return new ZodObject({
2051
- ...this._def,
2052
- unknownKeys: "strip",
2053
- });
2054
- }
2055
- passthrough() {
2056
- return new ZodObject({
2057
- ...this._def,
2058
- unknownKeys: "passthrough",
2059
- });
2060
- }
2061
- // const AugmentFactory =
2062
- // <Def extends ZodObjectDef>(def: Def) =>
2063
- // <Augmentation extends ZodRawShape>(
2064
- // augmentation: Augmentation
2065
- // ): ZodObject<
2066
- // extendShape<ReturnType<Def["shape"]>, Augmentation>,
2067
- // Def["unknownKeys"],
2068
- // Def["catchall"]
2069
- // > => {
2070
- // return new ZodObject({
2071
- // ...def,
2072
- // shape: () => ({
2073
- // ...def.shape(),
2074
- // ...augmentation,
2075
- // }),
2076
- // }) as any;
2077
- // };
2078
- extend(augmentation) {
2079
- return new ZodObject({
2080
- ...this._def,
2081
- shape: () => ({
2082
- ...this._def.shape(),
2083
- ...augmentation,
2084
- }),
2085
- });
2086
- }
2087
- /**
2088
- * Prior to zod@1.0.12 there was a bug in the
2089
- * inferred type of merged objects. Please
2090
- * upgrade if you are experiencing issues.
2091
- */
2092
- merge(merging) {
2093
- const merged = new ZodObject({
2094
- unknownKeys: merging._def.unknownKeys,
2095
- catchall: merging._def.catchall,
2096
- shape: () => ({
2097
- ...this._def.shape(),
2098
- ...merging._def.shape(),
2099
- }),
2100
- typeName: ZodFirstPartyTypeKind.ZodObject,
2101
- });
2102
- return merged;
2103
- }
2104
- // merge<
2105
- // Incoming extends AnyZodObject,
2106
- // Augmentation extends Incoming["shape"],
2107
- // NewOutput extends {
2108
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
2109
- // ? Augmentation[k]["_output"]
2110
- // : k extends keyof Output
2111
- // ? Output[k]
2112
- // : never;
2113
- // },
2114
- // NewInput extends {
2115
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
2116
- // ? Augmentation[k]["_input"]
2117
- // : k extends keyof Input
2118
- // ? Input[k]
2119
- // : never;
2120
- // }
2121
- // >(
2122
- // merging: Incoming
2123
- // ): ZodObject<
2124
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2125
- // Incoming["_def"]["unknownKeys"],
2126
- // Incoming["_def"]["catchall"],
2127
- // NewOutput,
2128
- // NewInput
2129
- // > {
2130
- // const merged: any = new ZodObject({
2131
- // unknownKeys: merging._def.unknownKeys,
2132
- // catchall: merging._def.catchall,
2133
- // shape: () =>
2134
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2135
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2136
- // }) as any;
2137
- // return merged;
2138
- // }
2139
- setKey(key, schema) {
2140
- return this.augment({ [key]: schema });
2141
- }
2142
- // merge<Incoming extends AnyZodObject>(
2143
- // merging: Incoming
2144
- // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
2145
- // ZodObject<
2146
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2147
- // Incoming["_def"]["unknownKeys"],
2148
- // Incoming["_def"]["catchall"]
2149
- // > {
2150
- // // const mergedShape = objectUtil.mergeShapes(
2151
- // // this._def.shape(),
2152
- // // merging._def.shape()
2153
- // // );
2154
- // const merged: any = new ZodObject({
2155
- // unknownKeys: merging._def.unknownKeys,
2156
- // catchall: merging._def.catchall,
2157
- // shape: () =>
2158
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2159
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2160
- // }) as any;
2161
- // return merged;
2162
- // }
2163
- catchall(index) {
2164
- return new ZodObject({
2165
- ...this._def,
2166
- catchall: index,
2167
- });
2168
- }
2169
- pick(mask) {
2170
- const shape = {};
2171
- for (const key of util.objectKeys(mask)) {
2172
- if (mask[key] && this.shape[key]) {
2173
- shape[key] = this.shape[key];
2174
- }
2175
- }
2176
- return new ZodObject({
2177
- ...this._def,
2178
- shape: () => shape,
2179
- });
2180
- }
2181
- omit(mask) {
2182
- const shape = {};
2183
- for (const key of util.objectKeys(this.shape)) {
2184
- if (!mask[key]) {
2185
- shape[key] = this.shape[key];
2186
- }
2187
- }
2188
- return new ZodObject({
2189
- ...this._def,
2190
- shape: () => shape,
2191
- });
2192
- }
2193
- /**
2194
- * @deprecated
2195
- */
2196
- deepPartial() {
2197
- return deepPartialify(this);
2198
- }
2199
- partial(mask) {
2200
- const newShape = {};
2201
- for (const key of util.objectKeys(this.shape)) {
2202
- const fieldSchema = this.shape[key];
2203
- if (mask && !mask[key]) {
2204
- newShape[key] = fieldSchema;
2205
- }
2206
- else {
2207
- newShape[key] = fieldSchema.optional();
2208
- }
2209
- }
2210
- return new ZodObject({
2211
- ...this._def,
2212
- shape: () => newShape,
2213
- });
2214
- }
2215
- required(mask) {
2216
- const newShape = {};
2217
- for (const key of util.objectKeys(this.shape)) {
2218
- if (mask && !mask[key]) {
2219
- newShape[key] = this.shape[key];
2220
- }
2221
- else {
2222
- const fieldSchema = this.shape[key];
2223
- let newField = fieldSchema;
2224
- while (newField instanceof ZodOptional) {
2225
- newField = newField._def.innerType;
2226
- }
2227
- newShape[key] = newField;
2228
- }
2229
- }
2230
- return new ZodObject({
2231
- ...this._def,
2232
- shape: () => newShape,
2233
- });
2234
- }
2235
- keyof() {
2236
- return createZodEnum(util.objectKeys(this.shape));
2237
- }
2238
- }
2239
- ZodObject.create = (shape, params) => {
2240
- return new ZodObject({
2241
- shape: () => shape,
2242
- unknownKeys: "strip",
2243
- catchall: ZodNever.create(),
2244
- typeName: ZodFirstPartyTypeKind.ZodObject,
2245
- ...processCreateParams(params),
2246
- });
2247
- };
2248
- ZodObject.strictCreate = (shape, params) => {
2249
- return new ZodObject({
2250
- shape: () => shape,
2251
- unknownKeys: "strict",
2252
- catchall: ZodNever.create(),
2253
- typeName: ZodFirstPartyTypeKind.ZodObject,
2254
- ...processCreateParams(params),
2255
- });
2256
- };
2257
- ZodObject.lazycreate = (shape, params) => {
2258
- return new ZodObject({
2259
- shape,
2260
- unknownKeys: "strip",
2261
- catchall: ZodNever.create(),
2262
- typeName: ZodFirstPartyTypeKind.ZodObject,
2263
- ...processCreateParams(params),
2264
- });
2265
- };
2266
- class ZodUnion extends ZodType {
2267
- _parse(input) {
2268
- const { ctx } = this._processInputParams(input);
2269
- const options = this._def.options;
2270
- function handleResults(results) {
2271
- // return first issue-free validation if it exists
2272
- for (const result of results) {
2273
- if (result.result.status === "valid") {
2274
- return result.result;
2275
- }
2276
- }
2277
- for (const result of results) {
2278
- if (result.result.status === "dirty") {
2279
- // add issues from dirty option
2280
- ctx.common.issues.push(...result.ctx.common.issues);
2281
- return result.result;
2282
- }
2283
- }
2284
- // return invalid
2285
- const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
2286
- addIssueToContext(ctx, {
2287
- code: ZodIssueCode.invalid_union,
2288
- unionErrors,
2289
- });
2290
- return INVALID;
2291
- }
2292
- if (ctx.common.async) {
2293
- return Promise.all(options.map(async (option) => {
2294
- const childCtx = {
2295
- ...ctx,
2296
- common: {
2297
- ...ctx.common,
2298
- issues: [],
2299
- },
2300
- parent: null,
2301
- };
2302
- return {
2303
- result: await option._parseAsync({
2304
- data: ctx.data,
2305
- path: ctx.path,
2306
- parent: childCtx,
2307
- }),
2308
- ctx: childCtx,
2309
- };
2310
- })).then(handleResults);
2311
- }
2312
- else {
2313
- let dirty = undefined;
2314
- const issues = [];
2315
- for (const option of options) {
2316
- const childCtx = {
2317
- ...ctx,
2318
- common: {
2319
- ...ctx.common,
2320
- issues: [],
2321
- },
2322
- parent: null,
2323
- };
2324
- const result = option._parseSync({
2325
- data: ctx.data,
2326
- path: ctx.path,
2327
- parent: childCtx,
2328
- });
2329
- if (result.status === "valid") {
2330
- return result;
2331
- }
2332
- else if (result.status === "dirty" && !dirty) {
2333
- dirty = { result, ctx: childCtx };
2334
- }
2335
- if (childCtx.common.issues.length) {
2336
- issues.push(childCtx.common.issues);
2337
- }
2338
- }
2339
- if (dirty) {
2340
- ctx.common.issues.push(...dirty.ctx.common.issues);
2341
- return dirty.result;
2342
- }
2343
- const unionErrors = issues.map((issues) => new ZodError(issues));
2344
- addIssueToContext(ctx, {
2345
- code: ZodIssueCode.invalid_union,
2346
- unionErrors,
2347
- });
2348
- return INVALID;
2349
- }
2350
- }
2351
- get options() {
2352
- return this._def.options;
2353
- }
2354
- }
2355
- ZodUnion.create = (types, params) => {
2356
- return new ZodUnion({
2357
- options: types,
2358
- typeName: ZodFirstPartyTypeKind.ZodUnion,
2359
- ...processCreateParams(params),
2360
- });
2361
- };
2362
- function mergeValues(a, b) {
2363
- const aType = getParsedType(a);
2364
- const bType = getParsedType(b);
2365
- if (a === b) {
2366
- return { valid: true, data: a };
2367
- }
2368
- else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
2369
- const bKeys = util.objectKeys(b);
2370
- const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
2371
- const newObj = { ...a, ...b };
2372
- for (const key of sharedKeys) {
2373
- const sharedValue = mergeValues(a[key], b[key]);
2374
- if (!sharedValue.valid) {
2375
- return { valid: false };
2376
- }
2377
- newObj[key] = sharedValue.data;
2378
- }
2379
- return { valid: true, data: newObj };
2380
- }
2381
- else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
2382
- if (a.length !== b.length) {
2383
- return { valid: false };
2384
- }
2385
- const newArray = [];
2386
- for (let index = 0; index < a.length; index++) {
2387
- const itemA = a[index];
2388
- const itemB = b[index];
2389
- const sharedValue = mergeValues(itemA, itemB);
2390
- if (!sharedValue.valid) {
2391
- return { valid: false };
2392
- }
2393
- newArray.push(sharedValue.data);
2394
- }
2395
- return { valid: true, data: newArray };
2396
- }
2397
- else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
2398
- return { valid: true, data: a };
2399
- }
2400
- else {
2401
- return { valid: false };
2402
- }
2403
- }
2404
- class ZodIntersection extends ZodType {
2405
- _parse(input) {
2406
- const { status, ctx } = this._processInputParams(input);
2407
- const handleParsed = (parsedLeft, parsedRight) => {
2408
- if (isAborted(parsedLeft) || isAborted(parsedRight)) {
2409
- return INVALID;
2410
- }
2411
- const merged = mergeValues(parsedLeft.value, parsedRight.value);
2412
- if (!merged.valid) {
2413
- addIssueToContext(ctx, {
2414
- code: ZodIssueCode.invalid_intersection_types,
2415
- });
2416
- return INVALID;
2417
- }
2418
- if (isDirty(parsedLeft) || isDirty(parsedRight)) {
2419
- status.dirty();
2420
- }
2421
- return { status: status.value, value: merged.data };
2422
- };
2423
- if (ctx.common.async) {
2424
- return Promise.all([
2425
- this._def.left._parseAsync({
2426
- data: ctx.data,
2427
- path: ctx.path,
2428
- parent: ctx,
2429
- }),
2430
- this._def.right._parseAsync({
2431
- data: ctx.data,
2432
- path: ctx.path,
2433
- parent: ctx,
2434
- }),
2435
- ]).then(([left, right]) => handleParsed(left, right));
2436
- }
2437
- else {
2438
- return handleParsed(this._def.left._parseSync({
2439
- data: ctx.data,
2440
- path: ctx.path,
2441
- parent: ctx,
2442
- }), this._def.right._parseSync({
2443
- data: ctx.data,
2444
- path: ctx.path,
2445
- parent: ctx,
2446
- }));
2447
- }
2448
- }
2449
- }
2450
- ZodIntersection.create = (left, right, params) => {
2451
- return new ZodIntersection({
2452
- left: left,
2453
- right: right,
2454
- typeName: ZodFirstPartyTypeKind.ZodIntersection,
2455
- ...processCreateParams(params),
2456
- });
2457
- };
2458
- // type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
2459
- class ZodTuple extends ZodType {
2460
- _parse(input) {
2461
- const { status, ctx } = this._processInputParams(input);
2462
- if (ctx.parsedType !== ZodParsedType.array) {
2463
- addIssueToContext(ctx, {
2464
- code: ZodIssueCode.invalid_type,
2465
- expected: ZodParsedType.array,
2466
- received: ctx.parsedType,
2467
- });
2468
- return INVALID;
2469
- }
2470
- if (ctx.data.length < this._def.items.length) {
2471
- addIssueToContext(ctx, {
2472
- code: ZodIssueCode.too_small,
2473
- minimum: this._def.items.length,
2474
- inclusive: true,
2475
- exact: false,
2476
- type: "array",
2477
- });
2478
- return INVALID;
2479
- }
2480
- const rest = this._def.rest;
2481
- if (!rest && ctx.data.length > this._def.items.length) {
2482
- addIssueToContext(ctx, {
2483
- code: ZodIssueCode.too_big,
2484
- maximum: this._def.items.length,
2485
- inclusive: true,
2486
- exact: false,
2487
- type: "array",
2488
- });
2489
- status.dirty();
2490
- }
2491
- const items = [...ctx.data]
2492
- .map((item, itemIndex) => {
2493
- const schema = this._def.items[itemIndex] || this._def.rest;
2494
- if (!schema)
2495
- return null;
2496
- return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
2497
- })
2498
- .filter((x) => !!x); // filter nulls
2499
- if (ctx.common.async) {
2500
- return Promise.all(items).then((results) => {
2501
- return ParseStatus.mergeArray(status, results);
2502
- });
2503
- }
2504
- else {
2505
- return ParseStatus.mergeArray(status, items);
2506
- }
2507
- }
2508
- get items() {
2509
- return this._def.items;
2510
- }
2511
- rest(rest) {
2512
- return new ZodTuple({
2513
- ...this._def,
2514
- rest,
2515
- });
2516
- }
2517
- }
2518
- ZodTuple.create = (schemas, params) => {
2519
- if (!Array.isArray(schemas)) {
2520
- throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2521
- }
2522
- return new ZodTuple({
2523
- items: schemas,
2524
- typeName: ZodFirstPartyTypeKind.ZodTuple,
2525
- rest: null,
2526
- ...processCreateParams(params),
2527
- });
2528
- };
2529
- class ZodMap extends ZodType {
2530
- get keySchema() {
2531
- return this._def.keyType;
2532
- }
2533
- get valueSchema() {
2534
- return this._def.valueType;
2535
- }
2536
- _parse(input) {
2537
- const { status, ctx } = this._processInputParams(input);
2538
- if (ctx.parsedType !== ZodParsedType.map) {
2539
- addIssueToContext(ctx, {
2540
- code: ZodIssueCode.invalid_type,
2541
- expected: ZodParsedType.map,
2542
- received: ctx.parsedType,
2543
- });
2544
- return INVALID;
2545
- }
2546
- const keyType = this._def.keyType;
2547
- const valueType = this._def.valueType;
2548
- const pairs = [...ctx.data.entries()].map(([key, value], index) => {
2549
- return {
2550
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
2551
- value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])),
2552
- };
2553
- });
2554
- if (ctx.common.async) {
2555
- const finalMap = new Map();
2556
- return Promise.resolve().then(async () => {
2557
- for (const pair of pairs) {
2558
- const key = await pair.key;
2559
- const value = await pair.value;
2560
- if (key.status === "aborted" || value.status === "aborted") {
2561
- return INVALID;
2562
- }
2563
- if (key.status === "dirty" || value.status === "dirty") {
2564
- status.dirty();
2565
- }
2566
- finalMap.set(key.value, value.value);
2567
- }
2568
- return { status: status.value, value: finalMap };
2569
- });
2570
- }
2571
- else {
2572
- const finalMap = new Map();
2573
- for (const pair of pairs) {
2574
- const key = pair.key;
2575
- const value = pair.value;
2576
- if (key.status === "aborted" || value.status === "aborted") {
2577
- return INVALID;
2578
- }
2579
- if (key.status === "dirty" || value.status === "dirty") {
2580
- status.dirty();
2581
- }
2582
- finalMap.set(key.value, value.value);
2583
- }
2584
- return { status: status.value, value: finalMap };
2585
- }
2586
- }
2587
- }
2588
- ZodMap.create = (keyType, valueType, params) => {
2589
- return new ZodMap({
2590
- valueType,
2591
- keyType,
2592
- typeName: ZodFirstPartyTypeKind.ZodMap,
2593
- ...processCreateParams(params),
2594
- });
2595
- };
2596
- class ZodSet extends ZodType {
2597
- _parse(input) {
2598
- const { status, ctx } = this._processInputParams(input);
2599
- if (ctx.parsedType !== ZodParsedType.set) {
2600
- addIssueToContext(ctx, {
2601
- code: ZodIssueCode.invalid_type,
2602
- expected: ZodParsedType.set,
2603
- received: ctx.parsedType,
2604
- });
2605
- return INVALID;
2606
- }
2607
- const def = this._def;
2608
- if (def.minSize !== null) {
2609
- if (ctx.data.size < def.minSize.value) {
2610
- addIssueToContext(ctx, {
2611
- code: ZodIssueCode.too_small,
2612
- minimum: def.minSize.value,
2613
- type: "set",
2614
- inclusive: true,
2615
- exact: false,
2616
- message: def.minSize.message,
2617
- });
2618
- status.dirty();
2619
- }
2620
- }
2621
- if (def.maxSize !== null) {
2622
- if (ctx.data.size > def.maxSize.value) {
2623
- addIssueToContext(ctx, {
2624
- code: ZodIssueCode.too_big,
2625
- maximum: def.maxSize.value,
2626
- type: "set",
2627
- inclusive: true,
2628
- exact: false,
2629
- message: def.maxSize.message,
2630
- });
2631
- status.dirty();
2632
- }
2633
- }
2634
- const valueType = this._def.valueType;
2635
- function finalizeSet(elements) {
2636
- const parsedSet = new Set();
2637
- for (const element of elements) {
2638
- if (element.status === "aborted")
2639
- return INVALID;
2640
- if (element.status === "dirty")
2641
- status.dirty();
2642
- parsedSet.add(element.value);
2643
- }
2644
- return { status: status.value, value: parsedSet };
2645
- }
2646
- const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
2647
- if (ctx.common.async) {
2648
- return Promise.all(elements).then((elements) => finalizeSet(elements));
2649
- }
2650
- else {
2651
- return finalizeSet(elements);
2652
- }
2653
- }
2654
- min(minSize, message) {
2655
- return new ZodSet({
2656
- ...this._def,
2657
- minSize: { value: minSize, message: errorUtil.toString(message) },
2658
- });
2659
- }
2660
- max(maxSize, message) {
2661
- return new ZodSet({
2662
- ...this._def,
2663
- maxSize: { value: maxSize, message: errorUtil.toString(message) },
2664
- });
2665
- }
2666
- size(size, message) {
2667
- return this.min(size, message).max(size, message);
2668
- }
2669
- nonempty(message) {
2670
- return this.min(1, message);
2671
- }
2672
- }
2673
- ZodSet.create = (valueType, params) => {
2674
- return new ZodSet({
2675
- valueType,
2676
- minSize: null,
2677
- maxSize: null,
2678
- typeName: ZodFirstPartyTypeKind.ZodSet,
2679
- ...processCreateParams(params),
2680
- });
2681
- };
2682
- class ZodLazy extends ZodType {
2683
- get schema() {
2684
- return this._def.getter();
2685
- }
2686
- _parse(input) {
2687
- const { ctx } = this._processInputParams(input);
2688
- const lazySchema = this._def.getter();
2689
- return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
2690
- }
2691
- }
2692
- ZodLazy.create = (getter, params) => {
2693
- return new ZodLazy({
2694
- getter: getter,
2695
- typeName: ZodFirstPartyTypeKind.ZodLazy,
2696
- ...processCreateParams(params),
2697
- });
2698
- };
2699
- class ZodLiteral extends ZodType {
2700
- _parse(input) {
2701
- if (input.data !== this._def.value) {
2702
- const ctx = this._getOrReturnCtx(input);
2703
- addIssueToContext(ctx, {
2704
- received: ctx.data,
2705
- code: ZodIssueCode.invalid_literal,
2706
- expected: this._def.value,
2707
- });
2708
- return INVALID;
2709
- }
2710
- return { status: "valid", value: input.data };
2711
- }
2712
- get value() {
2713
- return this._def.value;
2714
- }
2715
- }
2716
- ZodLiteral.create = (value, params) => {
2717
- return new ZodLiteral({
2718
- value: value,
2719
- typeName: ZodFirstPartyTypeKind.ZodLiteral,
2720
- ...processCreateParams(params),
2721
- });
2722
- };
2723
- function createZodEnum(values, params) {
2724
- return new ZodEnum({
2725
- values,
2726
- typeName: ZodFirstPartyTypeKind.ZodEnum,
2727
- ...processCreateParams(params),
2728
- });
2729
- }
2730
- class ZodEnum extends ZodType {
2731
- _parse(input) {
2732
- if (typeof input.data !== "string") {
2733
- const ctx = this._getOrReturnCtx(input);
2734
- const expectedValues = this._def.values;
2735
- addIssueToContext(ctx, {
2736
- expected: util.joinValues(expectedValues),
2737
- received: ctx.parsedType,
2738
- code: ZodIssueCode.invalid_type,
2739
- });
2740
- return INVALID;
2741
- }
2742
- if (!this._cache) {
2743
- this._cache = new Set(this._def.values);
2744
- }
2745
- if (!this._cache.has(input.data)) {
2746
- const ctx = this._getOrReturnCtx(input);
2747
- const expectedValues = this._def.values;
2748
- addIssueToContext(ctx, {
2749
- received: ctx.data,
2750
- code: ZodIssueCode.invalid_enum_value,
2751
- options: expectedValues,
2752
- });
2753
- return INVALID;
2754
- }
2755
- return OK(input.data);
2756
- }
2757
- get options() {
2758
- return this._def.values;
2759
- }
2760
- get enum() {
2761
- const enumValues = {};
2762
- for (const val of this._def.values) {
2763
- enumValues[val] = val;
2764
- }
2765
- return enumValues;
2766
- }
2767
- get Values() {
2768
- const enumValues = {};
2769
- for (const val of this._def.values) {
2770
- enumValues[val] = val;
2771
- }
2772
- return enumValues;
2773
- }
2774
- get Enum() {
2775
- const enumValues = {};
2776
- for (const val of this._def.values) {
2777
- enumValues[val] = val;
2778
- }
2779
- return enumValues;
2780
- }
2781
- extract(values, newDef = this._def) {
2782
- return ZodEnum.create(values, {
2783
- ...this._def,
2784
- ...newDef,
2785
- });
2786
- }
2787
- exclude(values, newDef = this._def) {
2788
- return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
2789
- ...this._def,
2790
- ...newDef,
2791
- });
2792
- }
2793
- }
2794
- ZodEnum.create = createZodEnum;
2795
- class ZodNativeEnum extends ZodType {
2796
- _parse(input) {
2797
- const nativeEnumValues = util.getValidEnumValues(this._def.values);
2798
- const ctx = this._getOrReturnCtx(input);
2799
- if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {
2800
- const expectedValues = util.objectValues(nativeEnumValues);
2801
- addIssueToContext(ctx, {
2802
- expected: util.joinValues(expectedValues),
2803
- received: ctx.parsedType,
2804
- code: ZodIssueCode.invalid_type,
2805
- });
2806
- return INVALID;
2807
- }
2808
- if (!this._cache) {
2809
- this._cache = new Set(util.getValidEnumValues(this._def.values));
2810
- }
2811
- if (!this._cache.has(input.data)) {
2812
- const expectedValues = util.objectValues(nativeEnumValues);
2813
- addIssueToContext(ctx, {
2814
- received: ctx.data,
2815
- code: ZodIssueCode.invalid_enum_value,
2816
- options: expectedValues,
2817
- });
2818
- return INVALID;
2819
- }
2820
- return OK(input.data);
2821
- }
2822
- get enum() {
2823
- return this._def.values;
2824
- }
2825
- }
2826
- ZodNativeEnum.create = (values, params) => {
2827
- return new ZodNativeEnum({
2828
- values: values,
2829
- typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
2830
- ...processCreateParams(params),
2831
- });
2832
- };
2833
- class ZodPromise extends ZodType {
2834
- unwrap() {
2835
- return this._def.type;
2836
- }
2837
- _parse(input) {
2838
- const { ctx } = this._processInputParams(input);
2839
- if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
2840
- addIssueToContext(ctx, {
2841
- code: ZodIssueCode.invalid_type,
2842
- expected: ZodParsedType.promise,
2843
- received: ctx.parsedType,
2844
- });
2845
- return INVALID;
2846
- }
2847
- const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
2848
- return OK(promisified.then((data) => {
2849
- return this._def.type.parseAsync(data, {
2850
- path: ctx.path,
2851
- errorMap: ctx.common.contextualErrorMap,
2852
- });
2853
- }));
2854
- }
2855
- }
2856
- ZodPromise.create = (schema, params) => {
2857
- return new ZodPromise({
2858
- type: schema,
2859
- typeName: ZodFirstPartyTypeKind.ZodPromise,
2860
- ...processCreateParams(params),
2861
- });
2862
- };
2863
- class ZodEffects extends ZodType {
2864
- innerType() {
2865
- return this._def.schema;
2866
- }
2867
- sourceType() {
2868
- return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
2869
- ? this._def.schema.sourceType()
2870
- : this._def.schema;
2871
- }
2872
- _parse(input) {
2873
- const { status, ctx } = this._processInputParams(input);
2874
- const effect = this._def.effect || null;
2875
- const checkCtx = {
2876
- addIssue: (arg) => {
2877
- addIssueToContext(ctx, arg);
2878
- if (arg.fatal) {
2879
- status.abort();
2880
- }
2881
- else {
2882
- status.dirty();
2883
- }
2884
- },
2885
- get path() {
2886
- return ctx.path;
2887
- },
2888
- };
2889
- checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
2890
- if (effect.type === "preprocess") {
2891
- const processed = effect.transform(ctx.data, checkCtx);
2892
- if (ctx.common.async) {
2893
- return Promise.resolve(processed).then(async (processed) => {
2894
- if (status.value === "aborted")
2895
- return INVALID;
2896
- const result = await this._def.schema._parseAsync({
2897
- data: processed,
2898
- path: ctx.path,
2899
- parent: ctx,
2900
- });
2901
- if (result.status === "aborted")
2902
- return INVALID;
2903
- if (result.status === "dirty")
2904
- return DIRTY(result.value);
2905
- if (status.value === "dirty")
2906
- return DIRTY(result.value);
2907
- return result;
2908
- });
2909
- }
2910
- else {
2911
- if (status.value === "aborted")
2912
- return INVALID;
2913
- const result = this._def.schema._parseSync({
2914
- data: processed,
2915
- path: ctx.path,
2916
- parent: ctx,
2917
- });
2918
- if (result.status === "aborted")
2919
- return INVALID;
2920
- if (result.status === "dirty")
2921
- return DIRTY(result.value);
2922
- if (status.value === "dirty")
2923
- return DIRTY(result.value);
2924
- return result;
2925
- }
2926
- }
2927
- if (effect.type === "refinement") {
2928
- const executeRefinement = (acc) => {
2929
- const result = effect.refinement(acc, checkCtx);
2930
- if (ctx.common.async) {
2931
- return Promise.resolve(result);
2932
- }
2933
- if (result instanceof Promise) {
2934
- throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2935
- }
2936
- return acc;
2937
- };
2938
- if (ctx.common.async === false) {
2939
- const inner = this._def.schema._parseSync({
2940
- data: ctx.data,
2941
- path: ctx.path,
2942
- parent: ctx,
2943
- });
2944
- if (inner.status === "aborted")
2945
- return INVALID;
2946
- if (inner.status === "dirty")
2947
- status.dirty();
2948
- // return value is ignored
2949
- executeRefinement(inner.value);
2950
- return { status: status.value, value: inner.value };
2951
- }
2952
- else {
2953
- return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
2954
- if (inner.status === "aborted")
2955
- return INVALID;
2956
- if (inner.status === "dirty")
2957
- status.dirty();
2958
- return executeRefinement(inner.value).then(() => {
2959
- return { status: status.value, value: inner.value };
2960
- });
2961
- });
2962
- }
2963
- }
2964
- if (effect.type === "transform") {
2965
- if (ctx.common.async === false) {
2966
- const base = this._def.schema._parseSync({
2967
- data: ctx.data,
2968
- path: ctx.path,
2969
- parent: ctx,
2970
- });
2971
- if (!isValid(base))
2972
- return INVALID;
2973
- const result = effect.transform(base.value, checkCtx);
2974
- if (result instanceof Promise) {
2975
- throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
2976
- }
2977
- return { status: status.value, value: result };
2978
- }
2979
- else {
2980
- return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
2981
- if (!isValid(base))
2982
- return INVALID;
2983
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
2984
- status: status.value,
2985
- value: result,
2986
- }));
2987
- });
2988
- }
2989
- }
2990
- util.assertNever(effect);
2991
- }
2992
- }
2993
- ZodEffects.create = (schema, effect, params) => {
2994
- return new ZodEffects({
2995
- schema,
2996
- typeName: ZodFirstPartyTypeKind.ZodEffects,
2997
- effect,
2998
- ...processCreateParams(params),
2999
- });
3000
- };
3001
- ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
3002
- return new ZodEffects({
3003
- schema,
3004
- effect: { type: "preprocess", transform: preprocess },
3005
- typeName: ZodFirstPartyTypeKind.ZodEffects,
3006
- ...processCreateParams(params),
3007
- });
3008
- };
3009
- class ZodOptional extends ZodType {
3010
- _parse(input) {
3011
- const parsedType = this._getType(input);
3012
- if (parsedType === ZodParsedType.undefined) {
3013
- return OK(undefined);
3014
- }
3015
- return this._def.innerType._parse(input);
3016
- }
3017
- unwrap() {
3018
- return this._def.innerType;
3019
- }
3020
- }
3021
- ZodOptional.create = (type, params) => {
3022
- return new ZodOptional({
3023
- innerType: type,
3024
- typeName: ZodFirstPartyTypeKind.ZodOptional,
3025
- ...processCreateParams(params),
3026
- });
3027
- };
3028
- class ZodNullable extends ZodType {
3029
- _parse(input) {
3030
- const parsedType = this._getType(input);
3031
- if (parsedType === ZodParsedType.null) {
3032
- return OK(null);
3033
- }
3034
- return this._def.innerType._parse(input);
3035
- }
3036
- unwrap() {
3037
- return this._def.innerType;
3038
- }
3039
- }
3040
- ZodNullable.create = (type, params) => {
3041
- return new ZodNullable({
3042
- innerType: type,
3043
- typeName: ZodFirstPartyTypeKind.ZodNullable,
3044
- ...processCreateParams(params),
3045
- });
3046
- };
3047
- class ZodDefault extends ZodType {
3048
- _parse(input) {
3049
- const { ctx } = this._processInputParams(input);
3050
- let data = ctx.data;
3051
- if (ctx.parsedType === ZodParsedType.undefined) {
3052
- data = this._def.defaultValue();
3053
- }
3054
- return this._def.innerType._parse({
3055
- data,
3056
- path: ctx.path,
3057
- parent: ctx,
3058
- });
3059
- }
3060
- removeDefault() {
3061
- return this._def.innerType;
3062
- }
3063
- }
3064
- ZodDefault.create = (type, params) => {
3065
- return new ZodDefault({
3066
- innerType: type,
3067
- typeName: ZodFirstPartyTypeKind.ZodDefault,
3068
- defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3069
- ...processCreateParams(params),
3070
- });
3071
- };
3072
- class ZodCatch extends ZodType {
3073
- _parse(input) {
3074
- const { ctx } = this._processInputParams(input);
3075
- // newCtx is used to not collect issues from inner types in ctx
3076
- const newCtx = {
3077
- ...ctx,
3078
- common: {
3079
- ...ctx.common,
3080
- issues: [],
3081
- },
3082
- };
3083
- const result = this._def.innerType._parse({
3084
- data: newCtx.data,
3085
- path: newCtx.path,
3086
- parent: {
3087
- ...newCtx,
3088
- },
3089
- });
3090
- if (isAsync(result)) {
3091
- return result.then((result) => {
3092
- return {
3093
- status: "valid",
3094
- value: result.status === "valid"
3095
- ? result.value
3096
- : this._def.catchValue({
3097
- get error() {
3098
- return new ZodError(newCtx.common.issues);
3099
- },
3100
- input: newCtx.data,
3101
- }),
3102
- };
3103
- });
3104
- }
3105
- else {
3106
- return {
3107
- status: "valid",
3108
- value: result.status === "valid"
3109
- ? result.value
3110
- : this._def.catchValue({
3111
- get error() {
3112
- return new ZodError(newCtx.common.issues);
3113
- },
3114
- input: newCtx.data,
3115
- }),
3116
- };
3117
- }
3118
- }
3119
- removeCatch() {
3120
- return this._def.innerType;
3121
- }
3122
- }
3123
- ZodCatch.create = (type, params) => {
3124
- return new ZodCatch({
3125
- innerType: type,
3126
- typeName: ZodFirstPartyTypeKind.ZodCatch,
3127
- catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3128
- ...processCreateParams(params),
3129
- });
3130
- };
3131
- class ZodNaN extends ZodType {
3132
- _parse(input) {
3133
- const parsedType = this._getType(input);
3134
- if (parsedType !== ZodParsedType.nan) {
3135
- const ctx = this._getOrReturnCtx(input);
3136
- addIssueToContext(ctx, {
3137
- code: ZodIssueCode.invalid_type,
3138
- expected: ZodParsedType.nan,
3139
- received: ctx.parsedType,
3140
- });
3141
- return INVALID;
3142
- }
3143
- return { status: "valid", value: input.data };
3144
- }
3145
- }
3146
- ZodNaN.create = (params) => {
3147
- return new ZodNaN({
3148
- typeName: ZodFirstPartyTypeKind.ZodNaN,
3149
- ...processCreateParams(params),
3150
- });
3151
- };
3152
- class ZodBranded extends ZodType {
3153
- _parse(input) {
3154
- const { ctx } = this._processInputParams(input);
3155
- const data = ctx.data;
3156
- return this._def.type._parse({
3157
- data,
3158
- path: ctx.path,
3159
- parent: ctx,
3160
- });
3161
- }
3162
- unwrap() {
3163
- return this._def.type;
3164
- }
3165
- }
3166
- class ZodPipeline extends ZodType {
3167
- _parse(input) {
3168
- const { status, ctx } = this._processInputParams(input);
3169
- if (ctx.common.async) {
3170
- const handleAsync = async () => {
3171
- const inResult = await this._def.in._parseAsync({
3172
- data: ctx.data,
3173
- path: ctx.path,
3174
- parent: ctx,
3175
- });
3176
- if (inResult.status === "aborted")
3177
- return INVALID;
3178
- if (inResult.status === "dirty") {
3179
- status.dirty();
3180
- return DIRTY(inResult.value);
3181
- }
3182
- else {
3183
- return this._def.out._parseAsync({
3184
- data: inResult.value,
3185
- path: ctx.path,
3186
- parent: ctx,
3187
- });
3188
- }
3189
- };
3190
- return handleAsync();
3191
- }
3192
- else {
3193
- const inResult = this._def.in._parseSync({
3194
- data: ctx.data,
3195
- path: ctx.path,
3196
- parent: ctx,
3197
- });
3198
- if (inResult.status === "aborted")
3199
- return INVALID;
3200
- if (inResult.status === "dirty") {
3201
- status.dirty();
3202
- return {
3203
- status: "dirty",
3204
- value: inResult.value,
3205
- };
3206
- }
3207
- else {
3208
- return this._def.out._parseSync({
3209
- data: inResult.value,
3210
- path: ctx.path,
3211
- parent: ctx,
3212
- });
3213
- }
3214
- }
3215
- }
3216
- static create(a, b) {
3217
- return new ZodPipeline({
3218
- in: a,
3219
- out: b,
3220
- typeName: ZodFirstPartyTypeKind.ZodPipeline,
3221
- });
3222
- }
3223
- }
3224
- class ZodReadonly extends ZodType {
3225
- _parse(input) {
3226
- const result = this._def.innerType._parse(input);
3227
- const freeze = (data) => {
3228
- if (isValid(data)) {
3229
- data.value = Object.freeze(data.value);
3230
- }
3231
- return data;
3232
- };
3233
- return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
3234
- }
3235
- unwrap() {
3236
- return this._def.innerType;
3237
- }
3238
- }
3239
- ZodReadonly.create = (type, params) => {
3240
- return new ZodReadonly({
3241
- innerType: type,
3242
- typeName: ZodFirstPartyTypeKind.ZodReadonly,
3243
- ...processCreateParams(params),
3244
- });
3245
- };
3246
- var ZodFirstPartyTypeKind;
3247
- (function (ZodFirstPartyTypeKind) {
3248
- ZodFirstPartyTypeKind["ZodString"] = "ZodString";
3249
- ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
3250
- ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
3251
- ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
3252
- ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
3253
- ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
3254
- ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
3255
- ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
3256
- ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
3257
- ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
3258
- ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
3259
- ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
3260
- ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
3261
- ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
3262
- ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
3263
- ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
3264
- ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
3265
- ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
3266
- ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
3267
- ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
3268
- ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
3269
- ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
3270
- ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
3271
- ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
3272
- ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
3273
- ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
3274
- ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
3275
- ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
3276
- ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
3277
- ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
3278
- ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
3279
- ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
3280
- ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
3281
- ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
3282
- ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
3283
- ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
3284
- })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
3285
- const stringType = ZodString.create;
3286
- ZodNever.create;
3287
- const arrayType = ZodArray.create;
3288
- ZodUnion.create;
3289
- ZodIntersection.create;
3290
- ZodTuple.create;
3291
- ZodEnum.create;
3292
- ZodPromise.create;
3293
- ZodOptional.create;
3294
- ZodNullable.create;
3295
- const preprocessType = ZodEffects.createWithPreprocess;
3296
-
3297
- export { ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodEffects, ZodEnum, ZodFirstPartyTypeKind, ZodIntersection, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodPipeline, ZodPromise, ZodReadonly, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, arrayType as array, datetimeRegex, preprocessType as preprocess, stringType as string };