@wix/form-elements 0.0.0-stage → 1.53.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 (237) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +118 -2
  3. package/dist/component/appointment-rac-Qa4fzPC_.js +1005 -0
  4. package/dist/component/bookings-address-rac-D9M-ozbl.js +6 -0
  5. package/dist/component/bookings-email-rac-BsQBkcmz.js +6 -0
  6. package/dist/component/bookings-first-name-rac-B3Ttwrj1.js +6 -0
  7. package/dist/component/bookings-header-rac-D1SGpqGf.js +8 -0
  8. package/dist/component/bookings-last-name-rac-B9O--4tU.js +6 -0
  9. package/dist/component/bookings-login-bar-rac-CHzNCOWx.js +74 -0
  10. package/dist/component/bookings-phone-rac-DhCGxcEU.js +6 -0
  11. package/dist/component/bookings-rich-text-rac-CftLqeZI.js +8 -0
  12. package/dist/component/calling-country-codes-PyWuOTmF.js +243 -0
  13. package/dist/component/checkbox-field-rac-B4NsTbRK.js +625 -0
  14. package/dist/component/checkbox-group-field-headless-qntvm5XF.js +204 -0
  15. package/dist/component/checkbox-group-field-rac-DwHc_GX9.js +33 -0
  16. package/dist/component/checkbox-group-rac-C1L8G1Y6.js +6 -0
  17. package/dist/component/checkbox-rac-DfbwQtOy.js +6 -0
  18. package/dist/component/chevron-down-icon-CcpVm6B-.js +15 -0
  19. package/dist/component/contacts-address-rac-Bstl5CRy.js +6 -0
  20. package/dist/component/contacts-birthdate-rac-DA4ijdaj.js +6 -0
  21. package/dist/component/contacts-company-rac-m0NA2GWU.js +6 -0
  22. package/dist/component/contacts-email-rac-DPVSYPew.js +6 -0
  23. package/dist/component/contacts-first-name-rac-C-JRqRzG.js +6 -0
  24. package/dist/component/contacts-last-name-rac-COBf-dyW.js +6 -0
  25. package/dist/component/contacts-phone-rac-Cw70dW7b.js +6 -0
  26. package/dist/component/contacts-position-rac-CMz19BR-.js +6 -0
  27. package/dist/component/contacts-subscribe-rac-KpLlwquo.js +13 -0
  28. package/dist/component/contacts-tax-id-rac-_uTLfEkF.js +6 -0
  29. package/dist/component/custom-focus-class-_483Pkwp.js +4 -0
  30. package/dist/component/data-hooks-Dkw1pbRj.js +6 -0
  31. package/dist/component/date-availability-DPHhHaFW.js +49 -0
  32. package/dist/component/date-input-field-rac-BrdGNXKw.js +286 -0
  33. package/dist/component/date-input-rac-D93biRsl.js +6 -0
  34. package/dist/component/date-picker-field-rac-ByhJ3Koo.js +304 -0
  35. package/dist/component/date-picker-rac-CuwcuCmJ.js +6 -0
  36. package/dist/component/date-time-input-field-rac-DY1u3LS6.js +421 -0
  37. package/dist/component/date-time-input-rac-BuGAMm_l.js +6 -0
  38. package/dist/component/default-limits-D7qVv_Hv.js +6 -0
  39. package/dist/component/dext-checkbox-group-rac-C3jCmtB7.js +18 -0
  40. package/dist/component/dext-checkbox-rac-dOvFH4gX.js +6 -0
  41. package/dist/component/dext-date-picker-rac-Bq6xFRoL.js +6 -0
  42. package/dist/component/dext-date-time-input-rac-9BE7wXiZ.js +6 -0
  43. package/dist/component/dext-dropdown-rac-j2ACAxk6.js +6 -0
  44. package/dist/component/dext-email-rac-CLoZGIl3.js +6 -0
  45. package/dist/component/dext-number-input-rac-D8IxqGdJ.js +6 -0
  46. package/dist/component/dext-phone-rac-B2Y-Ou4W.js +6 -0
  47. package/dist/component/dext-radio-group-rac-C88xnXTc.js +18 -0
  48. package/dist/component/dext-rating-input-rac-BArLS_bA.js +6 -0
  49. package/dist/component/dext-tags-rac-B9tKb852.js +18 -0
  50. package/dist/component/dext-text-area-rac-cBh24v0g.js +6 -0
  51. package/dist/component/dext-text-input-rac-B75yIKQa.js +6 -0
  52. package/dist/component/dext-url-input-rac-Da6T681p.js +6 -0
  53. package/dist/component/donation-rac-A0HtRtbH.js +305 -0
  54. package/dist/component/dropdown-field-headless-CYpFgZ3H.js +84 -0
  55. package/dist/component/dropdown-field-rac-B5emHw3_.js +32 -0
  56. package/dist/component/dropdown-rac-CRj3gKMe.js +6 -0
  57. package/dist/component/ecom-address-rac-ClBWgRGU.js +6 -0
  58. package/dist/component/ecom-subscription-checkbox-rac-DLvoidqP.js +49 -0
  59. package/dist/component/email-input-field-rac-Dq1HVu3Y.js +507 -0
  60. package/dist/component/error-icon-hZxQ6DEy.js +15 -0
  61. package/dist/component/events-repeater-rac-BwbNXM88.js +247 -0
  62. package/dist/component/events-rsvp-rac-BzVK7JNO.js +38 -0
  63. package/dist/component/field-error-headless-D40GACk4.js +34 -0
  64. package/dist/component/field-label-headless-Beq2Tn6V.js +52 -0
  65. package/dist/component/field-rac.module-DXfwku6m.js +21 -0
  66. package/dist/component/fieldset-headless-CD3fds9J.js +54 -0
  67. package/dist/component/file-upload-rac-BHqXPy1r.js +484 -0
  68. package/dist/component/find-child-C60k4CxG.js +11 -0
  69. package/dist/component/fixed-payment-rac-CSmY8yrQ.js +62 -0
  70. package/dist/component/form-Dn-MrArr.js +8890 -0
  71. package/dist/component/form-element-classes-Bi-nNM8q.js +55 -0
  72. package/dist/component/form.css +1 -0
  73. package/dist/component/form.js +9 -0
  74. package/dist/component/format-currency-BwShJ9vM.js +44 -0
  75. package/dist/component/get-first-day-of-the-week-DvnsxYhQ.js +118 -0
  76. package/dist/component/header-field-rac-DlUZ8kEf.js +25 -0
  77. package/dist/component/header-rac-CKAFxlLV.js +6 -0
  78. package/dist/component/headless-styles-CmcyA_pi.js +20 -0
  79. package/dist/component/helpers-HmkkXrh2.js +12 -0
  80. package/dist/component/image-choice-rac-DHtMOk8B.js +141 -0
  81. package/dist/component/index-0TWILUAM.js +64 -0
  82. package/dist/component/index-DS4A9cSk.js +2290 -0
  83. package/dist/component/isObject-BAwJJxQ3.js +34 -0
  84. package/dist/component/messages_ar-BZXnU2Gj.js +3517 -0
  85. package/dist/component/messages_ar-L1BYLZbF.js +20 -0
  86. package/dist/component/messages_ar-PAHg01OB.js +299 -0
  87. package/dist/component/messages_bg-CO56qlOt.js +299 -0
  88. package/dist/component/messages_bg-CQcGl0Yi.js +20 -0
  89. package/dist/component/messages_bg-DgbMwIbv.js +3515 -0
  90. package/dist/component/messages_ca-BAHE5nuo.js +3515 -0
  91. package/dist/component/messages_ca-BRoHmzRw.js +20 -0
  92. package/dist/component/messages_ca-Bl6rZi_O.js +299 -0
  93. package/dist/component/messages_cs-BADd3t_h.js +3515 -0
  94. package/dist/component/messages_cs-CDyWDExk.js +298 -0
  95. package/dist/component/messages_cs-wn5UmrBw.js +20 -0
  96. package/dist/component/messages_da-BPnmb9Qb.js +20 -0
  97. package/dist/component/messages_da-BvVUWnBz.js +3515 -0
  98. package/dist/component/messages_da-DHlpaT4q.js +298 -0
  99. package/dist/component/messages_de-2czOmM8X.js +3515 -0
  100. package/dist/component/messages_de-BKgzIF1d.js +298 -0
  101. package/dist/component/messages_de-Bwx84N0O.js +20 -0
  102. package/dist/component/messages_el-BnuYMjcf.js +299 -0
  103. package/dist/component/messages_el-_D2RUBSU.js +20 -0
  104. package/dist/component/messages_el-qCyH12Uq.js +3515 -0
  105. package/dist/component/messages_en-BWaixPd6.js +3518 -0
  106. package/dist/component/messages_en-CBBcgtxs.js +296 -0
  107. package/dist/component/messages_en-DvSLxqKp.js +20 -0
  108. package/dist/component/messages_es-Cq6i2xci.js +3515 -0
  109. package/dist/component/messages_es-DlGCLaYi.js +298 -0
  110. package/dist/component/messages_es-rCKXnGf0.js +20 -0
  111. package/dist/component/messages_fi-B-ciZGqD.js +3515 -0
  112. package/dist/component/messages_fi-DzKva_Wq.js +299 -0
  113. package/dist/component/messages_fi-PCCXPo0O.js +20 -0
  114. package/dist/component/messages_fr-2im0dcYp.js +3515 -0
  115. package/dist/component/messages_fr-DMFilq1G.js +298 -0
  116. package/dist/component/messages_fr-DQa1dT9u.js +20 -0
  117. package/dist/component/messages_he-Bb1qTc2Y.js +299 -0
  118. package/dist/component/messages_he-BfIkDo1h.js +3515 -0
  119. package/dist/component/messages_he-DwIysfDp.js +20 -0
  120. package/dist/component/messages_hi-Bty6ytCh.js +3515 -0
  121. package/dist/component/messages_hi-C-6UHGbM.js +298 -0
  122. package/dist/component/messages_hi-DF1w6b6B.js +20 -0
  123. package/dist/component/messages_hr-BXzIzU3d.js +20 -0
  124. package/dist/component/messages_hr-CiU1ZVrx.js +3515 -0
  125. package/dist/component/messages_hr-tRSM9lmc.js +299 -0
  126. package/dist/component/messages_hu-ChzHFUtB.js +3515 -0
  127. package/dist/component/messages_hu-D86Taf9R.js +299 -0
  128. package/dist/component/messages_hu-Z9XpByCO.js +20 -0
  129. package/dist/component/messages_id-3952ilBE.js +20 -0
  130. package/dist/component/messages_id-CPuhTUYV.js +298 -0
  131. package/dist/component/messages_id-Ddr3ijST.js +3515 -0
  132. package/dist/component/messages_it-B-A1X4BZ.js +298 -0
  133. package/dist/component/messages_it-DnUTUabT.js +20 -0
  134. package/dist/component/messages_it-eY6GnuZC.js +3515 -0
  135. package/dist/component/messages_ja-B3PxHv2c.js +3515 -0
  136. package/dist/component/messages_ja-Ced6ZBxD.js +298 -0
  137. package/dist/component/messages_ja-Cg7CqBUL.js +20 -0
  138. package/dist/component/messages_ko-DBCjHG4c.js +3515 -0
  139. package/dist/component/messages_ko-PKIrqwPk.js +298 -0
  140. package/dist/component/messages_ko-zvhtZMGA.js +20 -0
  141. package/dist/component/messages_lt-DV3hdFsp.js +3515 -0
  142. package/dist/component/messages_lt-DywusvNm.js +20 -0
  143. package/dist/component/messages_lt-zxcCPHno.js +299 -0
  144. package/dist/component/messages_lv-BEowUv-S.js +299 -0
  145. package/dist/component/messages_lv-DggJE2f9.js +20 -0
  146. package/dist/component/messages_lv-hIonzpTs.js +3515 -0
  147. package/dist/component/messages_ms-Ca0m7bf7.js +20 -0
  148. package/dist/component/messages_ms-Cvypo0vi.js +299 -0
  149. package/dist/component/messages_ms-DoMzA8a3.js +3515 -0
  150. package/dist/component/messages_nl-CEmANR_r.js +3515 -0
  151. package/dist/component/messages_nl-CZR4TvNo.js +298 -0
  152. package/dist/component/messages_nl-DgVYmdO9.js +20 -0
  153. package/dist/component/messages_no-B2BBaGBH.js +298 -0
  154. package/dist/component/messages_no-DJfJSlDm.js +3515 -0
  155. package/dist/component/messages_no-hPkfRJQ9.js +20 -0
  156. package/dist/component/messages_pl-Bzph-WyD.js +20 -0
  157. package/dist/component/messages_pl-ChJVH7RO.js +3515 -0
  158. package/dist/component/messages_pl-rCMsbMbN.js +298 -0
  159. package/dist/component/messages_pt-Bv63V1uB.js +3515 -0
  160. package/dist/component/messages_pt-CBgCNF3T.js +20 -0
  161. package/dist/component/messages_pt-Cx0FF6uF.js +298 -0
  162. package/dist/component/messages_ro-BvLoD_wE.js +299 -0
  163. package/dist/component/messages_ro-CMzcu-9b.js +20 -0
  164. package/dist/component/messages_ro-PVRK7Gx4.js +3515 -0
  165. package/dist/component/messages_ru-8BI6MYA0.js +3515 -0
  166. package/dist/component/messages_ru-BhRKVmVC.js +298 -0
  167. package/dist/component/messages_ru-C_BaQo57.js +20 -0
  168. package/dist/component/messages_sk-Bgi_3583.js +3515 -0
  169. package/dist/component/messages_sk-CrsC7rOj.js +20 -0
  170. package/dist/component/messages_sk-CtF-ei23.js +299 -0
  171. package/dist/component/messages_sl-B5t-KKi8.js +299 -0
  172. package/dist/component/messages_sl-BFdYWVHd.js +3515 -0
  173. package/dist/component/messages_sl-NqfmyUP1.js +20 -0
  174. package/dist/component/messages_sv-Bd1CcY6G.js +3515 -0
  175. package/dist/component/messages_sv-DPRT-DpN.js +20 -0
  176. package/dist/component/messages_sv-bQwbNmjr.js +298 -0
  177. package/dist/component/messages_th-BauH9qdo.js +20 -0
  178. package/dist/component/messages_th-C_dL_PCq.js +298 -0
  179. package/dist/component/messages_th-DEWm01uD.js +3515 -0
  180. package/dist/component/messages_tl-CouXLNcW.js +299 -0
  181. package/dist/component/messages_tl-D2t9Y_ZC.js +3515 -0
  182. package/dist/component/messages_tl-UDZY8Wuk.js +20 -0
  183. package/dist/component/messages_tr-2-OHesob.js +3515 -0
  184. package/dist/component/messages_tr-CpsxYTDb.js +20 -0
  185. package/dist/component/messages_tr-DHXnlj_j.js +298 -0
  186. package/dist/component/messages_uk-CPK4y5lH.js +298 -0
  187. package/dist/component/messages_uk-DIuQ2HoD.js +3515 -0
  188. package/dist/component/messages_uk-gPkmA_ar.js +20 -0
  189. package/dist/component/messages_vi-CgxB4Ey0.js +20 -0
  190. package/dist/component/messages_vi-DZeFWgwp.js +3515 -0
  191. package/dist/component/messages_vi-Det8i7_V.js +298 -0
  192. package/dist/component/messages_zh-D53_A4N9.js +298 -0
  193. package/dist/component/messages_zh-O552w5dp.js +20 -0
  194. package/dist/component/messages_zh-nG7LNxIt.js +3515 -0
  195. package/dist/component/multiline-address-field-rac-C0PUrp9n.js +1574 -0
  196. package/dist/component/multiline-address-rac-BuIrCxJO.js +6 -0
  197. package/dist/component/non-modal-popover-DtIMXHbe.js +63 -0
  198. package/dist/component/number-input-field-rac-DY3hBv5k.js +89 -0
  199. package/dist/component/number-input-rac-LU2RRhXv.js +6 -0
  200. package/dist/component/numeric-input-utils-CuBMi4-a.js +45 -0
  201. package/dist/component/options-layout-constants-DEfIEJWD.js +6 -0
  202. package/dist/component/options-rac.module-KM-VT_KY.js +7 -0
  203. package/dist/component/password-rac-CKUa-xXB.js +142 -0
  204. package/dist/component/payment-field-utils-DobiK5Xh.js +12 -0
  205. package/dist/component/payment-input-rac-4-nB0Dtf.js +137 -0
  206. package/dist/component/phone-input-field-rac-D-WSiybW.js +473 -0
  207. package/dist/component/phone-rac-CHpAV4y9.js +6 -0
  208. package/dist/component/product-list-rac-43aeb4bH.js +263 -0
  209. package/dist/component/quiz-radio-group-rac-CIp82PU6.js +13 -0
  210. package/dist/component/radio-group-field-rac-Ctu5L43b.js +40 -0
  211. package/dist/component/radio-group-field-rac.module-xWCK2zEh.js +124 -0
  212. package/dist/component/radio-group-rac-C2z9k9zW.js +6 -0
  213. package/dist/component/rating-input-field-rac-FGf61_-a.js +130 -0
  214. package/dist/component/rating-input-rac-B4_5V8X4.js +6 -0
  215. package/dist/component/rich-content-rac.module-DuFIPLXP.js +49 -0
  216. package/dist/component/rich-text-field-rac-B1PbdTgi.js +22 -0
  217. package/dist/component/rich-text-rac-D1PDXRg5.js +6 -0
  218. package/dist/component/ricos-viewer-chunk-B4rfbgjA.js +5 -0
  219. package/dist/component/service-dropdown-rac-DIFcHwYR.js +142 -0
  220. package/dist/component/services-multi-choice-rac-BVgZsVc2.js +76 -0
  221. package/dist/component/signature-rac-DoznfA7u.js +795 -0
  222. package/dist/component/submit-button-rac-DQFhhUWx.js +115 -0
  223. package/dist/component/tags-field-rac-F3yYmtiN.js +201 -0
  224. package/dist/component/tags-rac-BkJ8931D.js +6 -0
  225. package/dist/component/text-area-field-rac-BQXCdqvK.js +69 -0
  226. package/dist/component/text-area-rac-CI4idsCI.js +6 -0
  227. package/dist/component/text-input-field-rac-Di3rvMr8.js +24 -0
  228. package/dist/component/text-input-headless-BFldUMDr.js +44 -0
  229. package/dist/component/text-input-rac-v2DSKy7B.js +6 -0
  230. package/dist/component/time-input-rac-CcbyfeiV.js +152 -0
  231. package/dist/component/url-input-field-rac-CcMmHuDT.js +71 -0
  232. package/dist/component/url-input-rac-DtbctKi2.js +6 -0
  233. package/dist/component/use-invoke-callback-UH73A_J3.js +15 -0
  234. package/dist/component/use-service-options-base-Cr8hJp01.js +48 -0
  235. package/dist/component/use-synced-display-value-DcAxdn3M.js +19 -0
  236. package/dist/form.d.ts +6930 -0
  237. package/package.json +164 -3
@@ -0,0 +1,2290 @@
1
+ import { d as R, V as _, O as de, s as O, g as Ge, B as Be, N as qe, I as He, l as A, P as Ee, u as re, S as Fe, b as B, m as M, a2 as Te, o as je, n as he, p as q } from "./form-Dn-MrArr.js";
2
+ import { Z as Mn } from "./form-Dn-MrArr.js";
3
+ import Xe from "ajv";
4
+ import ke from "ajv-errors";
5
+ import We from "ajv-formats";
6
+ import Ke from "fast-deep-equal";
7
+ import { parsePhoneNumber as ze, parsePhoneNumberWithError as Ve, ParseError as Ze } from "libphonenumber-js/max";
8
+ import Je from "libphonenumber-js/metadata.max.json";
9
+ import { p as Qe, i as et } from "./date-availability-DPHhHaFW.js";
10
+ import { a as Sn } from "./date-availability-DPHhHaFW.js";
11
+ import { C as tt } from "./calling-country-codes-PyWuOTmF.js";
12
+ function rt(e) {
13
+ var t, r;
14
+ return ((r = (t = String(e).split(".")) == null ? void 0 : t[1]) == null ? void 0 : r.length) || 0;
15
+ }
16
+ function Le(e) {
17
+ if (!e)
18
+ return {};
19
+ const t = e.split("-");
20
+ if (t.length === 3) {
21
+ const [r, n, s] = t;
22
+ return {
23
+ YEAR: r || void 0,
24
+ MONTH: n || void 0,
25
+ DAY: s || void 0
26
+ };
27
+ }
28
+ return {};
29
+ }
30
+ function nt(e) {
31
+ if (!e)
32
+ return [
33
+ "",
34
+ ""
35
+ ];
36
+ const t = e.indexOf("T") > -1 ? "T" : " ", [r, n] = e.split(t);
37
+ return [
38
+ r || "",
39
+ n || ""
40
+ ];
41
+ }
42
+ function st(e) {
43
+ if (!e)
44
+ return !1;
45
+ const [t, r] = e.split(":");
46
+ return !!t && !!r;
47
+ }
48
+ var S = /* @__PURE__ */ (function(e) {
49
+ return e.YEAR_MONTH = "year-month", e.YEAR_DAY = "year-day", e.MONTH_DAY = "month-day", e.YEAR = "year", e.MONTH = "month", e.DAY = "day", e;
50
+ })({}), v = /* @__PURE__ */ (function(e) {
51
+ return e.YEAR_MONTH_TIME = "year-month-time", e.YEAR_DAY_TIME = "year-day-time", e.MONTH_DAY_TIME = "month-day-time", e.YEAR_TIME = "year-time", e.MONTH_TIME = "month-time", e.DAY_TIME = "day-time", e.TIME = "time", e;
52
+ })({});
53
+ function ve(e) {
54
+ return e.params && "format" in e.params ? e.params.format : void 0;
55
+ }
56
+ function it(e, t, r) {
57
+ return t && (ot(t) ?? ut(e, t) ?? at(e, t) ?? ct(e, t) ?? Ue(e, t, r == null ? void 0 : r.value) ?? mt(e, t, r == null ? void 0 : r.value) ?? t);
58
+ }
59
+ function ot(e) {
60
+ if (!(!e || e.errorType !== R.PATTERN_ERROR))
61
+ return {
62
+ ...e,
63
+ errorType: R.INVALID_VALUE_FOR_PATTERN_ERROR
64
+ };
65
+ }
66
+ function ut(e, t) {
67
+ var o, a;
68
+ if (!t || !(t.errorType === R.MIN_LENGTH_ERROR || t.errorType === R.MAX_LENGTH_ERROR))
69
+ return;
70
+ const n = (o = e == null ? void 0 : e.string) == null ? void 0 : o.minLength, s = (a = e == null ? void 0 : e.string) == null ? void 0 : a.maxLength, i = n && s;
71
+ if (i && n === s)
72
+ return {
73
+ ...t,
74
+ errorType: R.EXACT_CHARACTER_LENGTH_ERROR,
75
+ errorMessage: `must have exactly ${n} characters`
76
+ };
77
+ if (i && n !== s)
78
+ return {
79
+ ...t,
80
+ errorType: R.CHARACTER_LENGTH_RANGE_ERROR,
81
+ errorMessage: `must have between ${n} and ${s} characters`,
82
+ params: {
83
+ minLimit: n,
84
+ maxLimit: s
85
+ }
86
+ };
87
+ }
88
+ function at(e, t) {
89
+ var o, a;
90
+ if (!t || !(t.errorType === R.MIN_ITEMS_ERROR || t.errorType === R.MAX_ITEMS_ERROR))
91
+ return;
92
+ const n = (o = e == null ? void 0 : e.array) == null ? void 0 : o.minItems, s = (a = e == null ? void 0 : e.array) == null ? void 0 : a.maxItems;
93
+ if (n && s && n === s)
94
+ return {
95
+ ...t,
96
+ errorType: R.EXACT_ITEMS_NUMBER_ERROR,
97
+ errorMessage: `must choose ${n} options`
98
+ };
99
+ }
100
+ function ct(e, t) {
101
+ var s, i, o, a, u, f, l;
102
+ if (!t)
103
+ return;
104
+ const r = t.errorType === R.MIN_VALUE_ERROR || t.errorType === R.MAX_VALUE_ERROR, n = t.errorType === R.MULTIPLE_OF_VALUE_ERROR;
105
+ if (r) {
106
+ const { minPrice: p, maxPrice: c } = ((a = (o = (i = (s = e == null ? void 0 : e.predefined) == null ? void 0 : s.paymentOptions) == null ? void 0 : i.products) == null ? void 0 : o[0]) == null ? void 0 : a.dynamicPriceOptions) ?? {}, E = ((u = e == null ? void 0 : e.number) == null ? void 0 : u.minimum) ?? p, d = ((f = e == null ? void 0 : e.number) == null ? void 0 : f.maximum) ?? c;
107
+ if (E !== void 0 && d !== void 0 && E !== d)
108
+ return {
109
+ ...t,
110
+ errorType: R.VALUE_RANGE_ERROR,
111
+ errorMessage: `must be from ${E} to ${d}`,
112
+ params: {
113
+ minLimit: E,
114
+ maxLimit: d
115
+ }
116
+ };
117
+ }
118
+ if (n) {
119
+ const p = (l = e == null ? void 0 : e.number) == null ? void 0 : l.multipleOf;
120
+ if (p) {
121
+ const c = rt(p);
122
+ return {
123
+ ...t,
124
+ errorType: R.DECIMAL_POINT_ERROR,
125
+ errorMessage: `must have ${c} number(s) after the decimal point`,
126
+ params: {
127
+ number: c
128
+ }
129
+ };
130
+ }
131
+ }
132
+ }
133
+ function Ue(e, t, r) {
134
+ const n = (t == null ? void 0 : t.errorType) === R.FORMAT_ERROR;
135
+ if (!t || !n)
136
+ return;
137
+ const s = ve(t);
138
+ if (s !== "date" && s !== "date-time")
139
+ return;
140
+ const { YEAR: i, MONTH: o, DAY: a } = Le(r), u = (i == null ? void 0 : i.length) === 4;
141
+ if (!u && !o && !a)
142
+ return;
143
+ const f = (l) => ({
144
+ ...t,
145
+ errorType: R.INCOMPLETE_DATE_ERROR,
146
+ params: {
147
+ suffix: l
148
+ }
149
+ });
150
+ return !u && !o ? f(S.YEAR_MONTH) : !u && !a ? f(S.YEAR_DAY) : !o && !a ? f(S.MONTH_DAY) : u ? o ? a ? void 0 : f(S.DAY) : f(S.MONTH) : f(S.YEAR);
151
+ }
152
+ function mt(e, t, r) {
153
+ const n = (t == null ? void 0 : t.errorType) === R.FORMAT_ERROR;
154
+ if (!t || !n || ve(t) !== "date-time")
155
+ return;
156
+ const [i, o] = nt(r), a = Ue(e, t, i), { YEAR: u, MONTH: f, DAY: l } = Le(i);
157
+ if (!st(o)) {
158
+ const c = (d) => ({
159
+ ...t,
160
+ errorType: R.INCOMPLETE_DATE_ERROR,
161
+ params: {
162
+ suffix: d
163
+ }
164
+ });
165
+ if (((d) => (d == null ? void 0 : d.errorType) === R.INCOMPLETE_DATE_ERROR)(a))
166
+ switch (a.params.suffix) {
167
+ case S.YEAR_MONTH:
168
+ return c(v.YEAR_MONTH_TIME);
169
+ case S.YEAR_DAY:
170
+ return c(v.YEAR_DAY_TIME);
171
+ case S.MONTH_DAY:
172
+ return c(v.MONTH_DAY_TIME);
173
+ case S.YEAR:
174
+ return c(v.YEAR_TIME);
175
+ case S.MONTH:
176
+ return c(v.MONTH_TIME);
177
+ case S.DAY:
178
+ return c(v.DAY_TIME);
179
+ }
180
+ if (u || f || l)
181
+ return c(v.TIME);
182
+ }
183
+ return a;
184
+ }
185
+ function ie(e) {
186
+ return Array.isArray(e) ? e.map((t) => ie(t)) : ft(e) ? Object.keys(e).filter((t) => {
187
+ const r = e[t];
188
+ return !(r == null || r === "" || Array.isArray(r) && r.length === 0);
189
+ }).reduce((t, r) => ({
190
+ ...t,
191
+ [r]: ie(e[r])
192
+ }), {}) : e;
193
+ }
194
+ function ft(e) {
195
+ return typeof e == "object" && !Array.isArray(e) && e !== null;
196
+ }
197
+ const dt = (e, t) => {
198
+ const r = {
199
+ ...e
200
+ };
201
+ for (const n of t.fields ?? [])
202
+ pt(n, r) && (r[n.target] = {});
203
+ return r;
204
+ }, pt = (e, t) => {
205
+ var s, i;
206
+ if (!e.target || lt(e))
207
+ return !1;
208
+ const r = t[e.target];
209
+ return !(r == null || r === "") || !Et(e) ? !1 : Object.values(((i = (s = e.validation) == null ? void 0 : s.object) == null ? void 0 : i.properties) ?? {}).some((o) => o == null ? void 0 : o.required);
210
+ }, lt = (e) => {
211
+ var t, r;
212
+ return !!e.nestedFormId || ((r = (t = e.validation) == null ? void 0 : t.predefined) == null ? void 0 : r.format) === _.MULTILINE_ADDRESS;
213
+ }, Et = (e) => {
214
+ var t;
215
+ return !!((t = e.validation) != null && t.required) && !e.hidden && !e.readOnly;
216
+ };
217
+ var H = { exports: {} }, X = { exports: {} }, Re;
218
+ function Tt() {
219
+ return Re || (Re = 1, (function(e, t) {
220
+ Object.defineProperty(t, "__esModule", { value: !0 });
221
+ const r = Ke, n = ["number", "integer", "string", "boolean", "null"];
222
+ function s() {
223
+ return {
224
+ keyword: "uniqueItemProperties",
225
+ type: "array",
226
+ schemaType: "array",
227
+ compile(o, a) {
228
+ const u = i(o, a);
229
+ return (f) => {
230
+ if (f.length <= 1)
231
+ return !0;
232
+ for (let l = 0; l < o.length; l++) {
233
+ const p = o[l];
234
+ if (u[l]) {
235
+ const c = {};
236
+ for (const E of f) {
237
+ if (!E || typeof E != "object")
238
+ continue;
239
+ let d = E[p];
240
+ if (!(d && typeof d == "object")) {
241
+ if (typeof d == "string" && (d = '"' + d), c[d])
242
+ return !1;
243
+ c[d] = !0;
244
+ }
245
+ }
246
+ } else
247
+ for (let c = f.length; c--; ) {
248
+ const E = f[c];
249
+ if (!(!E || typeof E != "object"))
250
+ for (let d = c; d--; ) {
251
+ const m = f[d];
252
+ if (m && typeof m == "object" && r(E[p], m[p]))
253
+ return !1;
254
+ }
255
+ }
256
+ }
257
+ return !0;
258
+ };
259
+ },
260
+ metaSchema: {
261
+ type: "array",
262
+ items: { type: "string" }
263
+ }
264
+ };
265
+ }
266
+ t.default = s;
267
+ function i(o, a) {
268
+ return o.map((u) => {
269
+ var f, l, p;
270
+ const c = (p = (l = (f = a.items) === null || f === void 0 ? void 0 : f.properties) === null || l === void 0 ? void 0 : l[u]) === null || p === void 0 ? void 0 : p.type;
271
+ return Array.isArray(c) ? !c.includes("object") && !c.includes("array") : n.includes(c);
272
+ });
273
+ }
274
+ e.exports = s;
275
+ })(X, X.exports)), X.exports;
276
+ }
277
+ var Ie = H.exports, Ae;
278
+ function ht() {
279
+ return Ae || (Ae = 1, (function(e, t) {
280
+ var r = Ie && Ie.__importDefault || function(i) {
281
+ return i && i.__esModule ? i : { default: i };
282
+ };
283
+ Object.defineProperty(t, "__esModule", { value: !0 });
284
+ const n = r(Tt()), s = (i) => i.addKeyword((0, n.default)());
285
+ t.default = s, e.exports = s;
286
+ })(H, H.exports)), H.exports;
287
+ }
288
+ var Rt = ht();
289
+ const It = /* @__PURE__ */ de(Rt);
290
+ function h(e, t, r) {
291
+ if (typeof w(e) < "u")
292
+ return e;
293
+ throw new Error(`Property is required in ${JSON.stringify(t)}, property: ${r}`);
294
+ }
295
+ function w(e) {
296
+ return e ?? void 0;
297
+ }
298
+ function j(e) {
299
+ return w(e) !== void 0;
300
+ }
301
+ function At(e) {
302
+ return e !== null;
303
+ }
304
+ const Nt = [
305
+ "ADP",
306
+ "AED",
307
+ "AFA",
308
+ "AFN",
309
+ "ALL",
310
+ "AMD",
311
+ "ANG",
312
+ "AOA",
313
+ "ARS",
314
+ "ATS",
315
+ "AUD",
316
+ "AWG",
317
+ "AYM",
318
+ "AZM",
319
+ "AZN",
320
+ "BAM",
321
+ "BBD",
322
+ "BDT",
323
+ "BEF",
324
+ "BGL",
325
+ "BGN",
326
+ "BHD",
327
+ "BIF",
328
+ "BMD",
329
+ "BND",
330
+ "BOB",
331
+ "BOV",
332
+ "BRL",
333
+ "BSD",
334
+ "BTN",
335
+ "BWP",
336
+ "BYB",
337
+ "BYN",
338
+ "BYR",
339
+ "BZD",
340
+ "CAD",
341
+ "CDF",
342
+ "CHE",
343
+ "CHF",
344
+ "CHW",
345
+ "CLF",
346
+ "CLP",
347
+ "CNY",
348
+ "COP",
349
+ "COU",
350
+ "CRC",
351
+ "CSD",
352
+ "CUC",
353
+ "CUP",
354
+ "CVE",
355
+ "CYP",
356
+ "CZK",
357
+ "DEM",
358
+ "DJF",
359
+ "DKK",
360
+ "DOP",
361
+ "DZD",
362
+ "EEK",
363
+ "EGP",
364
+ "ERN",
365
+ "ESP",
366
+ "ETB",
367
+ "EUR",
368
+ "FIM",
369
+ "FJD",
370
+ "FKP",
371
+ "FRF",
372
+ "GBP",
373
+ "GEL",
374
+ "GHC",
375
+ "GHS",
376
+ "GIP",
377
+ "GMD",
378
+ "GNF",
379
+ "GRD",
380
+ "GTQ",
381
+ "GWP",
382
+ "GYD",
383
+ "HKD",
384
+ "HNL",
385
+ "HRK",
386
+ "HTG",
387
+ "HUF",
388
+ "IDR",
389
+ "IEP",
390
+ "ILS",
391
+ "INR",
392
+ "IQD",
393
+ "IRR",
394
+ "ISK",
395
+ "ITL",
396
+ "JMD",
397
+ "JOD",
398
+ "JPY",
399
+ "KES",
400
+ "KGS",
401
+ "KHR",
402
+ "KMF",
403
+ "KPW",
404
+ "KRW",
405
+ "KWD",
406
+ "KYD",
407
+ "KZT",
408
+ "LAK",
409
+ "LBP",
410
+ "LKR",
411
+ "LRD",
412
+ "LSL",
413
+ "LTL",
414
+ "LUF",
415
+ "LVL",
416
+ "LYD",
417
+ "MAD",
418
+ "MDL",
419
+ "MGA",
420
+ "MGF",
421
+ "MKD",
422
+ "MMK",
423
+ "MNT",
424
+ "MOP",
425
+ "MRO",
426
+ "MRU",
427
+ "MTL",
428
+ "MUR",
429
+ "MVR",
430
+ "MWK",
431
+ "MXN",
432
+ "MXV",
433
+ "MYR",
434
+ "MZM",
435
+ "MZN",
436
+ "NAD",
437
+ "NGN",
438
+ "NIO",
439
+ "NLG",
440
+ "NOK",
441
+ "NPR",
442
+ "NZD",
443
+ "OMR",
444
+ "PAB",
445
+ "PEN",
446
+ "PGK",
447
+ "PHP",
448
+ "PKR",
449
+ "PLN",
450
+ "PTE",
451
+ "PYG",
452
+ "QAR",
453
+ "ROL",
454
+ "RON",
455
+ "RSD",
456
+ "RUB",
457
+ "RUR",
458
+ "RWF",
459
+ "SAR",
460
+ "SBD",
461
+ "SCR",
462
+ "SDD",
463
+ "SDG",
464
+ "SEK",
465
+ "SGD",
466
+ "SHP",
467
+ "SIT",
468
+ "SKK",
469
+ "SLL",
470
+ "SOS",
471
+ "SRD",
472
+ "SRG",
473
+ "SSP",
474
+ "STD",
475
+ "STN",
476
+ "SVC",
477
+ "SYP",
478
+ "SZL",
479
+ "THB",
480
+ "TJS",
481
+ "TMM",
482
+ "TMT",
483
+ "TND",
484
+ "TOP",
485
+ "TPE",
486
+ "TRL",
487
+ "TRY",
488
+ "TTD",
489
+ "TWD",
490
+ "TZS",
491
+ "UAH",
492
+ "UGX",
493
+ "USD",
494
+ "USN",
495
+ "USS",
496
+ "UYI",
497
+ "UYU",
498
+ "UZS",
499
+ "VEB",
500
+ "VEF",
501
+ "VES",
502
+ "VND",
503
+ "VUV",
504
+ "WST",
505
+ "XAF",
506
+ "XAG",
507
+ "XAU",
508
+ "XBA",
509
+ "XBB",
510
+ "XBC",
511
+ "XBD",
512
+ "XCD",
513
+ "XDR",
514
+ "XFO",
515
+ "XFU",
516
+ "XOF",
517
+ "XPD",
518
+ "XPF",
519
+ "XPT",
520
+ "XSU",
521
+ "XTS",
522
+ "XUA",
523
+ "XXX",
524
+ "YER",
525
+ "YUM",
526
+ "ZAR",
527
+ "ZMK",
528
+ "ZMW",
529
+ "ZWD",
530
+ "ZWL",
531
+ "ZWN",
532
+ "ZWR"
533
+ ], yt = new Set(Nt.map((e) => e.toLowerCase()));
534
+ function gt(e) {
535
+ return yt.has(e.toLowerCase());
536
+ }
537
+ const oe = "¡-퟿-￿-a-zA-Z", $e = "0-9", U = `${oe}${$e}`, Ne = "!#$%&'*+/=?^_`{|}~-", Ot = `[${U}${Ne}]+(?:\\.[${U}${Ne}]+)*`, _t = "(?:[-\b\v\f-!#-[]-]|\\[- \v\f-])*", Dt = `(?:${Ot}|${_t})`, Mt = `(?:[${U}](?:[${U}-]*[${U}])?\\.)+(?:(?:[${$e}]+[${oe}][${U}]*)|(?:[${oe}][${U}]{1,}))`, Pt = "^" + Dt + "@" + Mt + "$", St = [
538
+ "aa",
539
+ "ab",
540
+ "ae",
541
+ "af",
542
+ "ak",
543
+ "am",
544
+ "an",
545
+ "ar",
546
+ "as",
547
+ "av",
548
+ "ay",
549
+ "az",
550
+ "ba",
551
+ "be",
552
+ "bg",
553
+ "bh",
554
+ "bi",
555
+ "bm",
556
+ "bn",
557
+ "bo",
558
+ "br",
559
+ "bs",
560
+ "ca",
561
+ "ce",
562
+ "ch",
563
+ "co",
564
+ "cr",
565
+ "cs",
566
+ "cu",
567
+ "cv",
568
+ "cy",
569
+ "da",
570
+ "de",
571
+ "dv",
572
+ "dz",
573
+ "ee",
574
+ "el",
575
+ "en",
576
+ "eo",
577
+ "es",
578
+ "et",
579
+ "eu",
580
+ "fa",
581
+ "ff",
582
+ "fi",
583
+ "fj",
584
+ "fo",
585
+ "fr",
586
+ "fy",
587
+ "ga",
588
+ "gd",
589
+ "gl",
590
+ "gn",
591
+ "gu",
592
+ "gv",
593
+ "ha",
594
+ "he",
595
+ "hi",
596
+ "ho",
597
+ "hr",
598
+ "ht",
599
+ "hu",
600
+ "hy",
601
+ "hz",
602
+ "ia",
603
+ "id",
604
+ "ie",
605
+ "ig",
606
+ "ii",
607
+ "ik",
608
+ "in",
609
+ "io",
610
+ "is",
611
+ "it",
612
+ "iu",
613
+ "iw",
614
+ "ja",
615
+ "ji",
616
+ "jv",
617
+ "ka",
618
+ "kg",
619
+ "ki",
620
+ "kj",
621
+ "kk",
622
+ "kl",
623
+ "km",
624
+ "kn",
625
+ "ko",
626
+ "kr",
627
+ "ks",
628
+ "ku",
629
+ "kv",
630
+ "kw",
631
+ "ky",
632
+ "la",
633
+ "lb",
634
+ "lg",
635
+ "li",
636
+ "ln",
637
+ "lo",
638
+ "lt",
639
+ "lu",
640
+ "lv",
641
+ "mg",
642
+ "mh",
643
+ "mi",
644
+ "mk",
645
+ "ml",
646
+ "mn",
647
+ "mo",
648
+ "mr",
649
+ "ms",
650
+ "mt",
651
+ "my",
652
+ "na",
653
+ "nb",
654
+ "nd",
655
+ "ne",
656
+ "ng",
657
+ "nl",
658
+ "nn",
659
+ "no",
660
+ "nr",
661
+ "nv",
662
+ "ny",
663
+ "oc",
664
+ "oj",
665
+ "om",
666
+ "or",
667
+ "os",
668
+ "pa",
669
+ "pi",
670
+ "pl",
671
+ "ps",
672
+ "pt",
673
+ "qu",
674
+ "rm",
675
+ "rn",
676
+ "ro",
677
+ "ru",
678
+ "rw",
679
+ "sa",
680
+ "sc",
681
+ "sd",
682
+ "se",
683
+ "sg",
684
+ "si",
685
+ "sk",
686
+ "sl",
687
+ "sm",
688
+ "sn",
689
+ "so",
690
+ "sq",
691
+ "sr",
692
+ "ss",
693
+ "st",
694
+ "su",
695
+ "sv",
696
+ "sw",
697
+ "ta",
698
+ "te",
699
+ "tg",
700
+ "th",
701
+ "ti",
702
+ "tk",
703
+ "tl",
704
+ "tn",
705
+ "to",
706
+ "tr",
707
+ "ts",
708
+ "tt",
709
+ "tw",
710
+ "ty",
711
+ "ug",
712
+ "uk",
713
+ "ur",
714
+ "uz",
715
+ "ve",
716
+ "vi",
717
+ "vo",
718
+ "wa",
719
+ "wo",
720
+ "xh",
721
+ "yi",
722
+ "yo",
723
+ "za",
724
+ "zh",
725
+ "zu"
726
+ ], bt = new Set(St);
727
+ function Ct(e) {
728
+ return bt.has(e);
729
+ }
730
+ function Ft(e) {
731
+ try {
732
+ return !Intl || !Intl.DateTimeFormat().resolvedOptions().timeZone ? !1 : (Intl.DateTimeFormat(void 0, {
733
+ timeZone: e
734
+ }), !0);
735
+ } catch {
736
+ return !1;
737
+ }
738
+ }
739
+ const Lt = "^\\+[1-9]\\d{1,14}$";
740
+ function vt(e, t) {
741
+ const r = {
742
+ ...ye,
743
+ phone: t ? Lt : ye.phone
744
+ };
745
+ for (const [n, s] of Object.entries(r))
746
+ e.addFormat(n, s);
747
+ }
748
+ const ye = {
749
+ phone: "^[\\d \\u00A0()+\\-.]+$",
750
+ email: Pt,
751
+ "color-hex": /^#(?:[0-9A-F]{3,4}|[0-9A-F]{6}|[0-9A-F]{8})$/i,
752
+ currency: gt,
753
+ language: Ct,
754
+ "time-zone": Ft
755
+ };
756
+ function Ut(e, t, r) {
757
+ e.addKeyword({
758
+ keyword: "dateAvailability",
759
+ type: "string",
760
+ errors: !0,
761
+ compile(n) {
762
+ return Ht(n);
763
+ }
764
+ }), t && (e.addKeyword({
765
+ keyword: "phone",
766
+ type: "string",
767
+ errors: !0,
768
+ compile: () => $t(r)
769
+ }), e.addKeyword({
770
+ keyword: "allowedCountryCodes",
771
+ type: "string",
772
+ errors: !0,
773
+ compile(n) {
774
+ return wt(n);
775
+ }
776
+ }));
777
+ }
778
+ function $t(e) {
779
+ const t = (r) => {
780
+ if (typeof r != "string")
781
+ return !0;
782
+ const n = [], s = xt(r, e);
783
+ return s ? (n.push({
784
+ keyword: s.keyword,
785
+ params: {
786
+ format: "phone"
787
+ },
788
+ message: s.message
789
+ }), t.errors = n, !1) : !0;
790
+ };
791
+ return t;
792
+ }
793
+ function xt(e, t) {
794
+ try {
795
+ const r = Ve(e);
796
+ return (t ? r.isPossible() : r.isValid()) ? void 0 : {
797
+ keyword: "format",
798
+ message: "Phone number for the country code provided is invalid"
799
+ };
800
+ } catch (r) {
801
+ return r instanceof Ze ? Yt(r, e) : {
802
+ keyword: "format",
803
+ message: "Phone number could not be parsed"
804
+ };
805
+ }
806
+ }
807
+ function wt(e) {
808
+ const t = (r) => {
809
+ if (typeof r != "string")
810
+ return !0;
811
+ const n = [];
812
+ try {
813
+ const s = ze(r), i = s == null ? void 0 : s.country;
814
+ if ((!i || !e.includes(i)) && e.length > 0)
815
+ return n.push({
816
+ keyword: "allowedCountryCodes",
817
+ params: {
818
+ allowedCountryCodes: e,
819
+ format: "phone"
820
+ },
821
+ message: "Phone number's country code must correspond to one from allowed countries"
822
+ }), t.errors = n, !1;
823
+ } catch {
824
+ return !0;
825
+ }
826
+ return !0;
827
+ };
828
+ return t;
829
+ }
830
+ function Yt(e, t) {
831
+ switch (e.message) {
832
+ case "INVALID_COUNTRY":
833
+ return {
834
+ keyword: "countryCode",
835
+ message: "Phone number has incorrect country code"
836
+ };
837
+ case "NOT_A_NUMBER":
838
+ return {
839
+ keyword: "format",
840
+ message: "Text provided is not a phone number"
841
+ };
842
+ case "TOO_SHORT":
843
+ return Gt(t);
844
+ case "TOO_LONG":
845
+ return {
846
+ keyword: "format",
847
+ message: "Phone number is too long"
848
+ };
849
+ case "INVALID_LENGTH":
850
+ default:
851
+ return {
852
+ keyword: "format",
853
+ message: "Phone number could not be parsed"
854
+ };
855
+ }
856
+ }
857
+ function Gt(e) {
858
+ const t = Bt(e);
859
+ return t ? qt(t, e) ? {
860
+ keyword: "format",
861
+ message: "Phone number is missing"
862
+ } : {
863
+ keyword: "format",
864
+ message: "Phone number is too short"
865
+ } : {
866
+ keyword: "countryCode",
867
+ message: "Phone number has incorrect country code"
868
+ };
869
+ }
870
+ function Bt(e) {
871
+ var r;
872
+ const t = e.trim().replace(/^\+/, "");
873
+ for (let n = 4; n > 0; n--) {
874
+ const s = t.substring(0, n);
875
+ if ((r = Je.country_calling_codes[s]) == null ? void 0 : r[0])
876
+ return s;
877
+ }
878
+ }
879
+ function qt(e, t) {
880
+ return t.replace(/^\+/, "") === e;
881
+ }
882
+ function Ht(e) {
883
+ const t = (r) => {
884
+ if (typeof r != "string")
885
+ return !0;
886
+ const n = Qe(r);
887
+ return n ? et(n, e) ? !0 : (t.errors = [
888
+ {
889
+ keyword: "dateAvailability",
890
+ message: "Date is not available"
891
+ }
892
+ ], !1) : !0;
893
+ };
894
+ return t;
895
+ }
896
+ function jt(e, t, r) {
897
+ return function(s) {
898
+ const i = new Xe({
899
+ allErrors: !0,
900
+ multipleOfPrecision: 8
901
+ });
902
+ return We(i), vt(i, t), Ut(i, t, r), ke(i), It(i), s.forEach((o) => {
903
+ if (!i.getSchema(h(o.id, o, "id"))) {
904
+ const u = e(o);
905
+ u && i.addSchema(u);
906
+ }
907
+ }), i;
908
+ };
909
+ }
910
+ var y = /* @__PURE__ */ (function(e) {
911
+ return e.OBJECT = "object", e.STRING = "string", e.NUMBER = "number", e.INTEGER = "integer", e.BOOLEAN = "boolean", e.ARRAY = "array", e;
912
+ })({});
913
+ function Xt(e, t) {
914
+ return function(c) {
915
+ const E = c.fields || [], d = c.deletedFields || [], m = E.filter(o), T = d.filter(o), g = r(m, T), N = t === O.UNRESTRICTED_UPDATE ? [] : m.filter((I) => !u(I)).filter(i).map((I) => h(I.target, I, "target"));
916
+ return {
917
+ $id: h(c.id, c, "id"),
918
+ type: y.OBJECT,
919
+ properties: g,
920
+ additionalProperties: !1,
921
+ required: N
922
+ };
923
+ };
924
+ function r(p, c) {
925
+ return [
926
+ ...p,
927
+ ...c
928
+ ].reduce((E, d) => {
929
+ const m = a(d);
930
+ return m && (E[h(d.target, d, "target")] = m), E;
931
+ }, {});
932
+ }
933
+ function n(p) {
934
+ return p.hidden;
935
+ }
936
+ function s(p) {
937
+ return p.readOnly;
938
+ }
939
+ function i(p) {
940
+ return ((p == null ? void 0 : p.validation) || {
941
+ required: !1
942
+ }).required;
943
+ }
944
+ function o(p) {
945
+ return !!Object.keys(p.validation ?? {}).length || i(p);
946
+ }
947
+ function a(p) {
948
+ const c = {
949
+ $id: h(p.id, p, "id"),
950
+ ...l(p) ? {
951
+ $ref: p.target
952
+ } : e(p.validation, w(p.target), t)
953
+ };
954
+ return u(p) ? f(c) : c;
955
+ }
956
+ function u(p) {
957
+ return n(p) || s(p);
958
+ }
959
+ function f(p) {
960
+ return Array.isArray(p.required) ? {
961
+ ...p,
962
+ required: []
963
+ } : p;
964
+ }
965
+ function l(p) {
966
+ var c, E;
967
+ return !!p.nestedFormId || ((E = (c = p.validation) == null ? void 0 : c.predefined) == null ? void 0 : E.format) === _.MULTILINE_ADDRESS;
968
+ }
969
+ }
970
+ function kt(e, t) {
971
+ return function(l) {
972
+ const p = l.formFields || [], c = l.deletedFormFields || [], E = p.filter(a), d = c.filter(a), m = n(E, d);
973
+ return {
974
+ $id: h(l.id, l, "id"),
975
+ type: y.OBJECT,
976
+ properties: m,
977
+ additionalProperties: !1,
978
+ required: r(E)
979
+ };
980
+ };
981
+ function r(f) {
982
+ return t === O.UNRESTRICTED_UPDATE ? [] : f.filter((l) => !s(l)).filter((l) => !i(l)).map((l) => l.inputOptions).filter(o).map((l) => h(l.target, l, "target"));
983
+ }
984
+ function n(f, l) {
985
+ return [
986
+ ...f,
987
+ ...l
988
+ ].reduce((p, c) => {
989
+ const E = h(c.inputOptions, c, "inputOptions"), d = u(h(c.id, c, "id"), E);
990
+ return d && (p[h(E.target, c, "target")] = d), p;
991
+ }, {});
992
+ }
993
+ function s(f) {
994
+ return f.hidden;
995
+ }
996
+ function i(f) {
997
+ var l;
998
+ return (l = f.inputOptions) == null ? void 0 : l.readOnly;
999
+ }
1000
+ function o(f) {
1001
+ return f.required ?? !1;
1002
+ }
1003
+ function a(f) {
1004
+ return f.fieldType === Ge.INPUT;
1005
+ }
1006
+ function u(f, l) {
1007
+ return {
1008
+ $id: f,
1009
+ ...e(l, t)
1010
+ };
1011
+ }
1012
+ }
1013
+ function G(e, t, r = {}) {
1014
+ return e.reduce((n, s) => {
1015
+ const i = t[s], o = r[s] ? r[s](i) : i;
1016
+ return typeof w(o) < "u" && !Kt(s, o) && (n[s] = o), n;
1017
+ }, {});
1018
+ }
1019
+ function Wt(e, t) {
1020
+ if (t.validationMessages) {
1021
+ const r = t.validationMessages;
1022
+ return {
1023
+ errorMessage: e.reduce((s, i) => {
1024
+ const o = r[i];
1025
+ return o && (s[i] = o), s;
1026
+ }, {})
1027
+ };
1028
+ }
1029
+ return {};
1030
+ }
1031
+ function Kt(e, t) {
1032
+ return e === "enum" && Array.isArray(t) && !t.length;
1033
+ }
1034
+ function J(e, t) {
1035
+ return {
1036
+ type: y.BOOLEAN,
1037
+ ...zt(e, t)
1038
+ };
1039
+ }
1040
+ function zt(e, t) {
1041
+ return t !== O.UNRESTRICTED_UPDATE ? {
1042
+ ...G(Be, e)
1043
+ } : {};
1044
+ }
1045
+ function Q(e, t) {
1046
+ return {
1047
+ type: y.NUMBER,
1048
+ maximum: Number.MAX_SAFE_INTEGER,
1049
+ minimum: Number.MIN_SAFE_INTEGER,
1050
+ ...Vt(e, t)
1051
+ };
1052
+ }
1053
+ function Vt(e, t) {
1054
+ return t !== O.UNRESTRICTED_UPDATE ? {
1055
+ ...G(qe, e, {
1056
+ maximum: (r) => Math.min(r ?? Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER),
1057
+ minimum: (r) => Math.max(r ?? Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER),
1058
+ multipleOf: (r) => r <= 0 ? 1 : r
1059
+ })
1060
+ } : {};
1061
+ }
1062
+ const Zt = [
1063
+ "minItems",
1064
+ "maxItems"
1065
+ ], ue = 100;
1066
+ function ge(e, t) {
1067
+ const n = Qt(t, (e || {}).items);
1068
+ return {
1069
+ type: y.ARRAY,
1070
+ maxItems: ue,
1071
+ ...Jt(e, t),
1072
+ ...n && {
1073
+ items: n
1074
+ }
1075
+ };
1076
+ }
1077
+ function Jt(e, t) {
1078
+ return t !== O.UNRESTRICTED_UPDATE ? {
1079
+ ...xe(e)
1080
+ } : {};
1081
+ }
1082
+ function xe(e) {
1083
+ return G(Zt, e, {
1084
+ maxItems: (t) => Math.min(t ?? ue, ue)
1085
+ });
1086
+ }
1087
+ function Qt(e, t) {
1088
+ if (t)
1089
+ return Y(t, void 0, e);
1090
+ throw Error("Required to specify items type for array");
1091
+ }
1092
+ function er(e, t) {
1093
+ return {
1094
+ type: y.INTEGER,
1095
+ maximum: Number.MAX_SAFE_INTEGER,
1096
+ minimum: Number.MIN_SAFE_INTEGER,
1097
+ ...tr(e, t)
1098
+ };
1099
+ }
1100
+ function tr(e, t) {
1101
+ return t !== O.UNRESTRICTED_UPDATE ? {
1102
+ ...G(He, e, {
1103
+ maximum: (r) => Math.min(r ?? Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER),
1104
+ minimum: (r) => Math.max(r ?? Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER)
1105
+ })
1106
+ } : {};
1107
+ }
1108
+ function K(e, t, r = O.UNKNOWN) {
1109
+ const { format: n } = t;
1110
+ switch (n) {
1111
+ case _.WIX_FILE:
1112
+ return Y(Oe[_.WIX_FILE], r);
1113
+ case _.SCHEDULING:
1114
+ return Y(Oe[_.SCHEDULING], r);
1115
+ case _.PAYMENT:
1116
+ return nr(t.paymentOptions, r);
1117
+ case _.OBJECT_ARRAY:
1118
+ return rr(h(e, {}, "target"), t.objectArrayOptions ?? {}, r);
1119
+ case _.MULTILINE_ADDRESS:
1120
+ throw new Error("Multiline address field is handled as referenced field");
1121
+ default:
1122
+ throw new Error(`Unknown predefined validation type ${n}`);
1123
+ }
1124
+ }
1125
+ function rr(e, t, r) {
1126
+ return {
1127
+ type: y.ARRAY,
1128
+ ...t.maxItems && r !== O.UNRESTRICTED_UPDATE && {
1129
+ maxItems: t.maxItems
1130
+ },
1131
+ ...t.minItems && r !== O.UNRESTRICTED_UPDATE && {
1132
+ minItems: t.minItems
1133
+ },
1134
+ items: {
1135
+ $ref: e
1136
+ }
1137
+ };
1138
+ }
1139
+ function nr(e, t) {
1140
+ if (t === O.UNRESTRICTED_UPDATE)
1141
+ return {
1142
+ type: y.ARRAY,
1143
+ items: {
1144
+ type: y.OBJECT,
1145
+ properties: {
1146
+ productId: {
1147
+ type: y.STRING
1148
+ },
1149
+ price: {
1150
+ type: [
1151
+ y.STRING,
1152
+ y.NUMBER
1153
+ ]
1154
+ },
1155
+ quantity: {
1156
+ type: y.INTEGER
1157
+ },
1158
+ name: {
1159
+ type: y.STRING
1160
+ }
1161
+ },
1162
+ uniqueItemProperties: [
1163
+ "productId"
1164
+ ],
1165
+ required: [
1166
+ "productId",
1167
+ "price",
1168
+ "quantity"
1169
+ ]
1170
+ }
1171
+ };
1172
+ const r = e.products || [], { minItems: n, maxItems: s } = e, i = r.map((o) => {
1173
+ const { minimum: a, maximum: u } = o.quantityLimit || {};
1174
+ return Y({
1175
+ object: {
1176
+ properties: {
1177
+ productId: {
1178
+ string: {
1179
+ enum: [
1180
+ h(o.id, o, "id")
1181
+ ]
1182
+ },
1183
+ required: !0
1184
+ },
1185
+ price: {
1186
+ ...sr(o),
1187
+ required: !0
1188
+ },
1189
+ quantity: {
1190
+ integer: {
1191
+ minimum: a ?? 1,
1192
+ maximum: u ?? 1e5
1193
+ },
1194
+ required: !0
1195
+ },
1196
+ name: {
1197
+ string: {
1198
+ maxLength: 400
1199
+ }
1200
+ }
1201
+ }
1202
+ }
1203
+ }, t);
1204
+ });
1205
+ return {
1206
+ type: y.ARRAY,
1207
+ items: {
1208
+ type: y.OBJECT,
1209
+ anyOf: i
1210
+ },
1211
+ ...xe({
1212
+ minItems: n,
1213
+ maxItems: s
1214
+ }),
1215
+ uniqueItemProperties: [
1216
+ "productId"
1217
+ ],
1218
+ errorMessage: {
1219
+ uniqueItemProperties: "productId should appear in array at most once"
1220
+ }
1221
+ };
1222
+ }
1223
+ function sr(e) {
1224
+ const { priceType: t } = e;
1225
+ switch (t) {
1226
+ case Ee.FIXED_PRICE: {
1227
+ const r = h(e.fixedPriceOptions, e, "fixedPriceOptions");
1228
+ return {
1229
+ string: {
1230
+ enum: [
1231
+ h(r.price, r, "price")
1232
+ ]
1233
+ }
1234
+ };
1235
+ }
1236
+ case Ee.DYNAMIC_PRICE: {
1237
+ const r = h(e.dynamicPriceOptions, e, "dynamicPriceOptions"), n = h(r.minPrice, r, "minPrice"), { maxPrice: s } = r;
1238
+ return {
1239
+ number: {
1240
+ minimum: parseFloat(n),
1241
+ ...s && {
1242
+ maximum: parseFloat(s)
1243
+ },
1244
+ multipleOf: 0.01
1245
+ }
1246
+ };
1247
+ }
1248
+ default:
1249
+ throw new Error(`Unknown price type ${t}`);
1250
+ }
1251
+ }
1252
+ const Oe = {
1253
+ [_.WIX_FILE]: {
1254
+ array: {
1255
+ maxItems: 30,
1256
+ minItems: 1,
1257
+ items: {
1258
+ object: {
1259
+ properties: {
1260
+ fileId: {
1261
+ string: {
1262
+ maxLength: 100
1263
+ },
1264
+ required: !0
1265
+ },
1266
+ displayName: {
1267
+ string: {
1268
+ maxLength: 300
1269
+ },
1270
+ required: !0
1271
+ },
1272
+ url: {
1273
+ string: {
1274
+ minLength: 1,
1275
+ maxLength: 300
1276
+ },
1277
+ required: !1
1278
+ },
1279
+ fileType: {
1280
+ string: {
1281
+ maxLength: 100
1282
+ },
1283
+ required: !0
1284
+ },
1285
+ imported: {
1286
+ boolean: {},
1287
+ required: !1
1288
+ }
1289
+ }
1290
+ }
1291
+ }
1292
+ }
1293
+ },
1294
+ [_.SCHEDULING]: {
1295
+ object: {
1296
+ properties: {
1297
+ startDate: {
1298
+ string: {
1299
+ format: A.DATE_TIME
1300
+ },
1301
+ required: !0
1302
+ },
1303
+ endDate: {
1304
+ string: {
1305
+ format: A.DATE_TIME
1306
+ },
1307
+ required: !0
1308
+ },
1309
+ timeZone: {
1310
+ string: {
1311
+ format: "TIME_ZONE",
1312
+ maxLength: 50
1313
+ },
1314
+ required: !0
1315
+ }
1316
+ }
1317
+ }
1318
+ }
1319
+ };
1320
+ var z = { exports: {} }, ir = z.exports, _e;
1321
+ function or() {
1322
+ return _e || (_e = 1, (function(e, t) {
1323
+ (function(r, n) {
1324
+ e.exports = n();
1325
+ })(ir, (function() {
1326
+ var r = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, n = {};
1327
+ return function(s, i, o) {
1328
+ var a, u = function(c, E, d) {
1329
+ d === void 0 && (d = {});
1330
+ var m = new Date(c), T = (function(g, N) {
1331
+ N === void 0 && (N = {});
1332
+ var I = N.timeZoneName || "short", P = g + "|" + I, D = n[P];
1333
+ return D || (D = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: g, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: I }), n[P] = D), D;
1334
+ })(E, d);
1335
+ return T.formatToParts(m);
1336
+ }, f = function(c, E) {
1337
+ for (var d = u(c, E), m = [], T = 0; T < d.length; T += 1) {
1338
+ var g = d[T], N = g.type, I = g.value, P = r[N];
1339
+ P >= 0 && (m[P] = parseInt(I, 10));
1340
+ }
1341
+ var D = m[3], F = D === 24 ? 0 : D, b = m[0] + "-" + m[1] + "-" + m[2] + " " + F + ":" + m[4] + ":" + m[5] + ":000", L = +c;
1342
+ return (o.utc(b).valueOf() - (L -= L % 1e3)) / 6e4;
1343
+ }, l = i.prototype;
1344
+ l.tz = function(c, E) {
1345
+ c === void 0 && (c = a);
1346
+ var d, m = this.utcOffset(), T = this.toDate(), g = T.toLocaleString("en-US", { timeZone: c }), N = Math.round((T - new Date(g)) / 1e3 / 60), I = 15 * -Math.round(T.getTimezoneOffset() / 15) - N;
1347
+ if (!Number(I)) d = this.utcOffset(0, E);
1348
+ else if (d = o(g, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(I, !0), E) {
1349
+ var P = d.utcOffset();
1350
+ d = d.add(m - P, "minute");
1351
+ }
1352
+ return d.$x.$timezone = c, d;
1353
+ }, l.offsetName = function(c) {
1354
+ var E = this.$x.$timezone || o.tz.guess(), d = u(this.valueOf(), E, { timeZoneName: c }).find((function(m) {
1355
+ return m.type.toLowerCase() === "timezonename";
1356
+ }));
1357
+ return d && d.value;
1358
+ };
1359
+ var p = l.startOf;
1360
+ l.startOf = function(c, E) {
1361
+ if (!this.$x || !this.$x.$timezone) return p.call(this, c, E);
1362
+ var d = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
1363
+ return p.call(d, c, E).tz(this.$x.$timezone, !0);
1364
+ }, o.tz = function(c, E, d) {
1365
+ var m = d && E, T = d || E || a, g = f(+o(), T);
1366
+ if (typeof c != "string") return o(c).tz(T);
1367
+ var N = (function(F, b, L) {
1368
+ var C = F - 60 * b * 1e3, $ = f(C, L);
1369
+ if (b === $) return [C, b];
1370
+ var se = f(C -= 60 * ($ - b) * 1e3, L);
1371
+ return $ === se ? [C, $] : [F - 60 * Math.min($, se) * 1e3, Math.max($, se)];
1372
+ })(o.utc(c, m).valueOf(), g, T), I = N[0], P = N[1], D = o(I).utcOffset(P);
1373
+ return D.$x.$timezone = T, D;
1374
+ }, o.tz.guess = function() {
1375
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
1376
+ }, o.tz.setDefault = function(c) {
1377
+ a = c;
1378
+ };
1379
+ };
1380
+ }));
1381
+ })(z)), z.exports;
1382
+ }
1383
+ var ur = or();
1384
+ const ar = /* @__PURE__ */ de(ur);
1385
+ var V = { exports: {} }, cr = V.exports, De;
1386
+ function mr() {
1387
+ return De || (De = 1, (function(e, t) {
1388
+ (function(r, n) {
1389
+ e.exports = n();
1390
+ })(cr, (function() {
1391
+ var r = "minute", n = /[+-]\d\d(?::?\d\d)?/g, s = /([+-]|\d\d)/g;
1392
+ return function(i, o, a) {
1393
+ var u = o.prototype;
1394
+ a.utc = function(m) {
1395
+ var T = { date: m, utc: !0, args: arguments };
1396
+ return new o(T);
1397
+ }, u.utc = function(m) {
1398
+ var T = a(this.toDate(), { locale: this.$L, utc: !0 });
1399
+ return m ? T.add(this.utcOffset(), r) : T;
1400
+ }, u.local = function() {
1401
+ return a(this.toDate(), { locale: this.$L, utc: !1 });
1402
+ };
1403
+ var f = u.parse;
1404
+ u.parse = function(m) {
1405
+ m.utc && (this.$u = !0), this.$utils().u(m.$offset) || (this.$offset = m.$offset), f.call(this, m);
1406
+ };
1407
+ var l = u.init;
1408
+ u.init = function() {
1409
+ if (this.$u) {
1410
+ var m = this.$d;
1411
+ this.$y = m.getUTCFullYear(), this.$M = m.getUTCMonth(), this.$D = m.getUTCDate(), this.$W = m.getUTCDay(), this.$H = m.getUTCHours(), this.$m = m.getUTCMinutes(), this.$s = m.getUTCSeconds(), this.$ms = m.getUTCMilliseconds();
1412
+ } else l.call(this);
1413
+ };
1414
+ var p = u.utcOffset;
1415
+ u.utcOffset = function(m, T) {
1416
+ var g = this.$utils().u;
1417
+ if (g(m)) return this.$u ? 0 : g(this.$offset) ? p.call(this) : this.$offset;
1418
+ if (typeof m == "string" && (m = (function(D) {
1419
+ D === void 0 && (D = "");
1420
+ var F = D.match(n);
1421
+ if (!F) return null;
1422
+ var b = ("" + F[0]).match(s) || ["-", 0, 0], L = b[0], C = 60 * +b[1] + +b[2];
1423
+ return C === 0 ? 0 : L === "+" ? C : -C;
1424
+ })(m), m === null)) return this;
1425
+ var N = Math.abs(m) <= 16 ? 60 * m : m;
1426
+ if (N === 0) return this.utc(T);
1427
+ var I = this.clone();
1428
+ if (T) return I.$offset = N, I.$u = !1, I;
1429
+ var P = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
1430
+ return (I = this.local().add(N + P, r)).$offset = N, I.$x.$localOffset = P, I;
1431
+ };
1432
+ var c = u.format;
1433
+ u.format = function(m) {
1434
+ var T = m || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
1435
+ return c.call(this, T);
1436
+ }, u.valueOf = function() {
1437
+ var m = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
1438
+ return this.$d.valueOf() - 6e4 * m;
1439
+ }, u.isUTC = function() {
1440
+ return !!this.$u;
1441
+ }, u.toISOString = function() {
1442
+ return this.toDate().toISOString();
1443
+ }, u.toString = function() {
1444
+ return this.toDate().toUTCString();
1445
+ };
1446
+ var E = u.toDate;
1447
+ u.toDate = function(m) {
1448
+ return m === "s" && this.$offset ? a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : E.call(this);
1449
+ };
1450
+ var d = u.diff;
1451
+ u.diff = function(m, T, g) {
1452
+ if (m && this.$u === m.$u) return d.call(this, m, T, g);
1453
+ var N = this.local(), I = a(m).local();
1454
+ return d.call(N, I, T, g);
1455
+ };
1456
+ };
1457
+ }));
1458
+ })(V)), V.exports;
1459
+ }
1460
+ var fr = mr();
1461
+ const dr = /* @__PURE__ */ de(fr);
1462
+ re.extend(dr);
1463
+ re.extend(ar);
1464
+ const pr = re.utc, we = /^\$now(?:([+-])(\d{1,2})([yMdmh]))?$/, lr = /^\d{4}-\d{2}-\d{2}$/, Er = /^\d{2}:\d{2}:\d{2}(\.\d+)?$/, Tr = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?$/;
1465
+ function hr(e, t, r = () => /* @__PURE__ */ new Date(), n) {
1466
+ var i;
1467
+ const s = {
1468
+ formatMinimum: ae(e, r, w(t == null ? void 0 : t.minimum)),
1469
+ formatMaximum: ae(e, r, w(t == null ? void 0 : t.maximum))
1470
+ };
1471
+ return e === "PHONE" ? {
1472
+ ...s,
1473
+ phone: !0,
1474
+ allowedCountryCodes: (i = n == null ? void 0 : n.allowedCountryCodes) != null && i.length ? n.allowedCountryCodes : Object.keys(tt)
1475
+ } : s;
1476
+ }
1477
+ function ae(e, t, r, n) {
1478
+ if (!r || Ir(r))
1479
+ return r;
1480
+ if (Rr(r)) {
1481
+ const s = n ? re(t().toISOString()).tz(n) : pr(t().toISOString()), i = Ar(r, s);
1482
+ return i ? e === A.DATE_TIME || e === A.DATE_OPTIONAL_TIME || !n ? i.utc().format(Me(e)) : i.format(Me(e)) : void 0;
1483
+ }
1484
+ }
1485
+ function Rr(e) {
1486
+ return we.test(e);
1487
+ }
1488
+ function Ir(e) {
1489
+ return lr.test(e) || Er.test(e) || Tr.test(e);
1490
+ }
1491
+ function Ar(e, t) {
1492
+ if (e === "$now")
1493
+ return t;
1494
+ try {
1495
+ const [, r, n, s] = e.match(we) ?? [], i = Nr(n), o = gr(s);
1496
+ return i && o ? yr(t, r)(i, o) : void 0;
1497
+ } catch (r) {
1498
+ console.error(`Failed to parse format ${e}`, r);
1499
+ return;
1500
+ }
1501
+ }
1502
+ function Nr(e) {
1503
+ const t = parseInt(e, 10);
1504
+ return isNaN(t) ? void 0 : t;
1505
+ }
1506
+ function yr(e, t) {
1507
+ switch (t) {
1508
+ case "+":
1509
+ return e.add.bind(e);
1510
+ case "-":
1511
+ return e.subtract.bind(e);
1512
+ default:
1513
+ return () => e;
1514
+ }
1515
+ }
1516
+ function gr(e) {
1517
+ if ([
1518
+ "d",
1519
+ "M",
1520
+ "y",
1521
+ "h",
1522
+ "m"
1523
+ ].includes(e))
1524
+ return e;
1525
+ }
1526
+ function Me(e) {
1527
+ switch (e) {
1528
+ case A.DATE:
1529
+ return "YYYY-MM-DD";
1530
+ case A.TIME:
1531
+ return "HH:mm:ss";
1532
+ case A.DATE_TIME:
1533
+ case A.DATE_OPTIONAL_TIME:
1534
+ return "YYYY-MM-DDTHH:mm:ss[Z]";
1535
+ default:
1536
+ return;
1537
+ }
1538
+ }
1539
+ const ce = 2e4;
1540
+ function ee(e, t) {
1541
+ const r = Or(e) ? Wt(Fe, e) : {};
1542
+ return {
1543
+ type: y.STRING,
1544
+ maxLength: ce,
1545
+ ...r,
1546
+ ...Dr(e),
1547
+ ..._r(e, t)
1548
+ };
1549
+ }
1550
+ function Or(e) {
1551
+ return "validationMessages" in e;
1552
+ }
1553
+ function _r(e, t) {
1554
+ const r = Sr(e), n = r ? {
1555
+ dateAvailability: r
1556
+ } : {};
1557
+ return t !== O.UNRESTRICTED_UPDATE ? {
1558
+ ...G(Fe.filter((s) => s !== "format"), e, {
1559
+ maxLength: (s) => Math.min(s ?? ce, ce)
1560
+ }),
1561
+ ...hr(e.format, Pr(e), void 0, e.phoneOptions),
1562
+ ...n
1563
+ } : n;
1564
+ }
1565
+ function Dr(e) {
1566
+ const t = e.format && Mr[h(e.format, e, "format")];
1567
+ return t ? t.length === 1 ? {
1568
+ format: t[0]
1569
+ } : {
1570
+ oneOf: t.map((r) => ({
1571
+ format: r
1572
+ }))
1573
+ } : {};
1574
+ }
1575
+ const Mr = {
1576
+ [A.DATE]: [
1577
+ "date"
1578
+ ],
1579
+ [A.TIME]: [
1580
+ "time"
1581
+ ],
1582
+ [A.DATE_TIME]: [
1583
+ "date-time"
1584
+ ],
1585
+ [A.EMAIL]: [
1586
+ "email"
1587
+ ],
1588
+ [A.URL]: [
1589
+ "url"
1590
+ ],
1591
+ [A.UUID]: [
1592
+ "uuid"
1593
+ ],
1594
+ [A.PHONE]: [
1595
+ "phone"
1596
+ ],
1597
+ [A.URI]: [
1598
+ "uri"
1599
+ ],
1600
+ [A.HOSTNAME]: [
1601
+ "hostname"
1602
+ ],
1603
+ [A.COLOR_HEX]: [
1604
+ "color-hex"
1605
+ ],
1606
+ [A.CURRENCY]: [
1607
+ "currency"
1608
+ ],
1609
+ [A.LANGUAGE]: [
1610
+ "language"
1611
+ ],
1612
+ [A.DATE_OPTIONAL_TIME]: [
1613
+ "date-time",
1614
+ "date"
1615
+ ],
1616
+ TIME_ZONE: [
1617
+ "time-zone"
1618
+ ]
1619
+ };
1620
+ function Pr(e) {
1621
+ if ("dateOptions" in e)
1622
+ return e.dateOptions;
1623
+ if ("dateTimeOptions" in e)
1624
+ return e.dateTimeOptions;
1625
+ if ("timeOptions" in e)
1626
+ return e.timeOptions;
1627
+ if ("dateOptionalTimeOptions" in e)
1628
+ return e.dateOptionalTimeOptions;
1629
+ }
1630
+ function Sr(e) {
1631
+ const t = "dateOptions" in e ? e.dateOptions : void 0;
1632
+ return t == null ? void 0 : t.availability;
1633
+ }
1634
+ function Y(e, t = void 0, r = O.UNKNOWN) {
1635
+ if (e != null && e.string)
1636
+ return ee(e.string, r);
1637
+ if (e != null && e.stringOptions)
1638
+ return ee(e == null ? void 0 : e.stringOptions, r);
1639
+ if (e != null && e.number)
1640
+ return Q(e.number, r);
1641
+ if (e != null && e.numberOptions)
1642
+ return Q(e.numberOptions, r);
1643
+ if (e != null && e.integer)
1644
+ return er(e.integer, r);
1645
+ if (e != null && e.boolean)
1646
+ return J(e == null ? void 0 : e.boolean, r);
1647
+ if (e != null && e.booleanOptions)
1648
+ return J(e == null ? void 0 : e.booleanOptions, r);
1649
+ if (e != null && e.array)
1650
+ return ge(e.array, r);
1651
+ if (e != null && e.arrayOptions)
1652
+ return ge(e.arrayOptions, r);
1653
+ if (e != null && e.object)
1654
+ return te(e.object, r);
1655
+ if (e != null && e.objectOptions)
1656
+ return te(e.objectOptions, r);
1657
+ if (e != null && e.predefined)
1658
+ return K(t, e.predefined, r);
1659
+ }
1660
+ function te(e, t) {
1661
+ const r = Lr(t, e.properties);
1662
+ return {
1663
+ type: y.OBJECT,
1664
+ additionalProperties: !1,
1665
+ properties: r,
1666
+ ...br(e, t)
1667
+ };
1668
+ }
1669
+ function br(e, t) {
1670
+ return t !== O.UNRESTRICTED_UPDATE ? {
1671
+ required: Cr(e.properties)
1672
+ } : {
1673
+ required: []
1674
+ };
1675
+ }
1676
+ function Cr(e = {}) {
1677
+ return Object.keys(e).reduce((r, n) => {
1678
+ const s = e[n];
1679
+ return Fr(s) && r.push(n), r;
1680
+ }, []);
1681
+ }
1682
+ function Fr(e) {
1683
+ return (e || {
1684
+ required: !1
1685
+ }).required;
1686
+ }
1687
+ function Lr(e, t) {
1688
+ return t ? Object.keys(t).reduce((n, s) => {
1689
+ const i = t[s], o = Y(i, void 0, e);
1690
+ return o && (n[s] = o), n;
1691
+ }, {}) : {};
1692
+ }
1693
+ const vr = [
1694
+ "minItems",
1695
+ "maxItems"
1696
+ ], Pe = 100;
1697
+ function Ur(e, t) {
1698
+ var o, a;
1699
+ const r = h(e.arrayOptions, e, "arrayOptions"), n = me(j((o = r.checkboxGroupOptions) == null ? void 0 : o.customOption), (a = r.checkboxGroupOptions) == null ? void 0 : a.options), s = h(r.validation, r, "validation"), i = $r(t, s.items, n);
1700
+ return {
1701
+ type: y.ARRAY,
1702
+ ...G(vr, s, {
1703
+ maxItems: (u) => Math.min(u ?? Pe, Pe)
1704
+ }),
1705
+ ...i && {
1706
+ items: i
1707
+ }
1708
+ };
1709
+ }
1710
+ function $r(e, t, r = []) {
1711
+ switch ((t == null ? void 0 : t.itemType) ?? B.UNKNOWN_ITEM_TYPE) {
1712
+ case B.STRING:
1713
+ return ee(Z((t == null ? void 0 : t.stringOptions) ?? {}, r), e);
1714
+ case B.NUMBER:
1715
+ return Q(Z((t == null ? void 0 : t.numberOptions) ?? {}, r), e);
1716
+ case B.BOOLEAN:
1717
+ return J(Z((t == null ? void 0 : t.booleanOptions) ?? {}, r), e);
1718
+ case B.OBJECT:
1719
+ return te((t == null ? void 0 : t.objectOptions) ?? {}, e);
1720
+ default:
1721
+ throw Error("Required to specify items type for array");
1722
+ }
1723
+ }
1724
+ function me(e, t) {
1725
+ if (!(e || !j(t)))
1726
+ return t.map((r) => r.value).filter(j);
1727
+ }
1728
+ function Z(e, t) {
1729
+ var r;
1730
+ return (r = e.enum) != null && r.length ? e : {
1731
+ ...e,
1732
+ enum: t
1733
+ };
1734
+ }
1735
+ function xr(e, t) {
1736
+ var i, o, a, u;
1737
+ const r = h(e.stringOptions, e, "stringOptions"), n = h(r.validation, r, "validation"), s = me(j((i = r.radioGroupOptions) == null ? void 0 : i.customOption), (o = r.radioGroupOptions) == null ? void 0 : o.options) || me(j((a = r.dropdownOptions) == null ? void 0 : a.customOption), (u = r.dropdownOptions) == null ? void 0 : u.options);
1738
+ return ee(Z(n, s), t);
1739
+ }
1740
+ function wr(e, t) {
1741
+ var r, n, s, i;
1742
+ switch (e.inputType) {
1743
+ case M.STRING:
1744
+ return xr(e, t);
1745
+ case M.ARRAY:
1746
+ return Ur(e, t);
1747
+ case M.NUMBER: {
1748
+ const o = h((r = e.numberOptions) == null ? void 0 : r.validation, e, "numberOptions.validation");
1749
+ return Q(o, t);
1750
+ }
1751
+ case M.BOOLEAN: {
1752
+ const o = h((n = e.booleanOptions) == null ? void 0 : n.validation, e, "booleanOptions.validation");
1753
+ return J(o, t);
1754
+ }
1755
+ case M.OBJECT: {
1756
+ const o = h((s = e.objectOptions) == null ? void 0 : s.validation, e, "objectOptions.validation");
1757
+ return te(o, t);
1758
+ }
1759
+ case M.WIX_FILE:
1760
+ return K(e.target, {
1761
+ format: _.WIX_FILE
1762
+ }, t);
1763
+ case M.SCHEDULING:
1764
+ return K(e.target, {
1765
+ format: _.SCHEDULING
1766
+ }, t);
1767
+ case M.PAYMENT:
1768
+ return K(e.target, {
1769
+ paymentOptions: (i = e.paymentOptions) == null ? void 0 : i.validation,
1770
+ format: _.PAYMENT
1771
+ }, t);
1772
+ default:
1773
+ return;
1774
+ }
1775
+ }
1776
+ function x(e, t, r) {
1777
+ return t in e ? Object.defineProperty(e, t, {
1778
+ value: r,
1779
+ enumerable: !0,
1780
+ configurable: !0,
1781
+ writable: !0
1782
+ }) : e[t] = r, e;
1783
+ }
1784
+ class Nn {
1785
+ validateFields(t, r, n) {
1786
+ const s = [
1787
+ n ?? []
1788
+ ].flat(), { ajv: i, submission: o, currentlyValidatableForm: a } = this.prepareValidation(t, r), u = ie(o);
1789
+ return s.length ? {
1790
+ errors: this.validateSubmissionWithFieldMask(i, t, u, s),
1791
+ currentlyValidatableForm: a
1792
+ } : {
1793
+ errors: this.validateWholeSubmission(i, a.id, u),
1794
+ currentlyValidatableForm: a
1795
+ };
1796
+ }
1797
+ validate(t, r, n) {
1798
+ const s = [
1799
+ n ?? []
1800
+ ].flat(), { errors: i, currentlyValidatableForm: o } = this.validateFields(t, r, s);
1801
+ if (i.length > 0)
1802
+ return {
1803
+ errors: i
1804
+ };
1805
+ if (!s.length) {
1806
+ const a = this.validateCanUpdateFormNotDisabled(o);
1807
+ if (a.errors)
1808
+ return a;
1809
+ }
1810
+ return {
1811
+ errors: []
1812
+ };
1813
+ }
1814
+ prepareValidation(t, r) {
1815
+ const n = this.formSchemas.find((o) => o.id === t);
1816
+ if (!n)
1817
+ throw new Error(`Missing form ${t} for validation`);
1818
+ let s = this.submissionValueProvider ? this.submissionValueProvider(r, n) : r;
1819
+ return this.validationMode !== O.UNRESTRICTED_UPDATE && (s = dt(s, n)), {
1820
+ ajv: this.initAJvWithSchemas(n, s),
1821
+ submission: s,
1822
+ currentlyValidatableForm: n
1823
+ };
1824
+ }
1825
+ getAddressForms(t, r) {
1826
+ return [
1827
+ ...t.fields ?? [],
1828
+ ...t.deletedFields ?? []
1829
+ ].filter((s) => {
1830
+ var i, o;
1831
+ return ((o = (i = s.validation) == null ? void 0 : i.predefined) == null ? void 0 : o.format) === _.MULTILINE_ADDRESS;
1832
+ }).reduce((s, i) => {
1833
+ const o = r[i.target], a = this.addressFormProvider(i, o);
1834
+ return a && s.push({
1835
+ ...a,
1836
+ id: i.target
1837
+ }), s;
1838
+ }, []);
1839
+ }
1840
+ getObjectArrayForms(t) {
1841
+ return [
1842
+ ...t.fields ?? [],
1843
+ ...t.deletedFields ?? []
1844
+ ].filter((n) => {
1845
+ var s, i;
1846
+ return ((i = (s = n.validation) == null ? void 0 : s.predefined) == null ? void 0 : i.format) === _.OBJECT_ARRAY;
1847
+ }).map((n) => {
1848
+ var s;
1849
+ return {
1850
+ id: n.target,
1851
+ fields: ((s = n.view) == null ? void 0 : s.fields) ?? []
1852
+ };
1853
+ });
1854
+ }
1855
+ validateCanUpdateFormNotDisabled(t) {
1856
+ return this.validationMode !== O.UNRESTRICTED_UPDATE && this.isFormDisabled(t) ? {
1857
+ errors: [
1858
+ {
1859
+ errorPath: "form.properties.disabled",
1860
+ errorType: R.DISABLED_FORM_ERROR,
1861
+ errorMessage: "Form is disabled and not accepting submissions"
1862
+ }
1863
+ ]
1864
+ } : {};
1865
+ }
1866
+ validateWholeSubmission(t, r, n) {
1867
+ const s = t.getSchema(`${r}`);
1868
+ if (!s)
1869
+ throw new Error(`Missing precompiled schema for form ${r}`);
1870
+ s(n);
1871
+ const i = Te(s.errors);
1872
+ return this.deriveErrors(r, i, n);
1873
+ }
1874
+ // eslint-disable-next-line max-params
1875
+ validateSubmissionWithFieldMask(t, r, n, s) {
1876
+ const i = s.reduce((o, a) => {
1877
+ const u = t.getSchema(`${r}#/properties/${a}`);
1878
+ return u ? (u(n[a]) || o.push(...Te(u.errors, a)), o) : (o.push({
1879
+ errorPath: `${a}`,
1880
+ errorType: R.UNKNOWN_VALUE_ERROR,
1881
+ errorMessage: `${a} property not expected in schema`
1882
+ }), o);
1883
+ }, []);
1884
+ return this.deriveErrors(r, i, n);
1885
+ }
1886
+ deriveErrors(t, r, n) {
1887
+ return r.map((s) => {
1888
+ const i = this.getFieldValidation(t, s.errorPath), o = this.getFieldValue(n, s.errorPath);
1889
+ return it(i, s, {
1890
+ value: o
1891
+ });
1892
+ }).filter((s) => s !== void 0);
1893
+ }
1894
+ getFieldValidation(t, r) {
1895
+ const n = this.formSchemas.find((u) => u.id === t);
1896
+ if (!n)
1897
+ return;
1898
+ const i = r.split("/")[0], o = [
1899
+ ...n.formFields ?? [],
1900
+ ...n.deletedFormFields ?? []
1901
+ ].find((u) => {
1902
+ var l;
1903
+ return u.id === i || ((l = u.inputOptions) == null ? void 0 : l.target) === i;
1904
+ }), a = [
1905
+ ...n.fields ?? [],
1906
+ ...n.deletedFields ?? []
1907
+ ].find((u) => u.id === i || u.target === i);
1908
+ return o ? this.getPlatformisedFieldValidation(o) : a ? this.getLegacyFieldValidation(a) : void 0;
1909
+ }
1910
+ getLegacyFieldValidation(t) {
1911
+ return t.validation;
1912
+ }
1913
+ getPlatformisedFieldValidation(t) {
1914
+ var s, i, o;
1915
+ const r = t.inputOptions;
1916
+ if (!r)
1917
+ return;
1918
+ const n = {};
1919
+ if ((s = r.numberOptions) != null && s.validation && (n.number = r.numberOptions.validation), (i = r.stringOptions) != null && i.validation && (n.string = r.stringOptions.validation), (o = r.arrayOptions) != null && o.validation && (n.array = r.arrayOptions.validation), Object.keys(n).length > 0)
1920
+ return n;
1921
+ }
1922
+ getFieldValue(t, r) {
1923
+ const n = r.split("/");
1924
+ let s = t;
1925
+ for (const i of n) {
1926
+ if (!s || typeof s != "object")
1927
+ return;
1928
+ s = s[i];
1929
+ }
1930
+ return typeof s == "string" ? s : void 0;
1931
+ }
1932
+ isFormDisabled(t) {
1933
+ var n, s;
1934
+ const r = ((n = t == null ? void 0 : t.limitationRule) == null ? void 0 : n.dateTimeDeadline) && new Date(t.limitationRule.dateTimeDeadline).getTime() <= (/* @__PURE__ */ new Date()).getTime();
1935
+ return !!((s = t == null ? void 0 : t.properties) != null && s.disabled || r);
1936
+ }
1937
+ getFormSchemaMapper() {
1938
+ return this.platformisedFieldBasedValidation ? kt(wr, this.validationMode ?? O.UNKNOWN) : Xt(Y, this.validationMode ?? O.UNKNOWN);
1939
+ }
1940
+ initAJvWithSchemas(t, r) {
1941
+ const n = this.getFormSchemaMapper(), s = jt(n, this.validationMode !== O.UNRESTRICTED_UPDATE, this.lenientPhoneValidation), i = this.formSchemas.flatMap((u) => (u.nestedForms || []).flatMap(({ targets: f, form: l }) => (f || []).map((p) => ({
1942
+ ...l,
1943
+ id: p
1944
+ })))), o = this.getAddressForms(t, r), a = this.getObjectArrayForms(t);
1945
+ return s([
1946
+ ...this.formSchemas,
1947
+ ...i,
1948
+ ...o,
1949
+ ...a
1950
+ ]);
1951
+ }
1952
+ // eslint-disable-next-line max-params
1953
+ constructor(t, r, n = !1, s = () => {
1954
+ }, i, o = !1) {
1955
+ if (x(this, "formSchemas", void 0), x(this, "validationMode", void 0), x(this, "platformisedFieldBasedValidation", void 0), x(this, "addressFormProvider", void 0), x(this, "submissionValueProvider", void 0), x(this, "lenientPhoneValidation", void 0), this.formSchemas = t, this.validationMode = r, this.platformisedFieldBasedValidation = n, this.addressFormProvider = s, this.submissionValueProvider = i, this.lenientPhoneValidation = o, !this.formSchemas.length)
1956
+ throw new Error("At least one form schema is required for validation");
1957
+ }
1958
+ }
1959
+ function Yr(e) {
1960
+ return e.validation && h(e.target, e, "target"), !!e.validation;
1961
+ }
1962
+ function Se(e) {
1963
+ return !!e.target;
1964
+ }
1965
+ function yn(e, t) {
1966
+ return {
1967
+ errors: Gr(e, t)
1968
+ };
1969
+ }
1970
+ function Gr(e, t) {
1971
+ var s;
1972
+ (s = e.fields) == null || s.forEach(Yr);
1973
+ const r = (e.fields ?? []).filter(Se), n = [
1974
+ ...t.fields ?? [],
1975
+ ...t.deletedFields ?? []
1976
+ ].filter(Se).reduce((i, o) => (i[h(o.target, o, "target")] = o, i), {});
1977
+ return r.map((i) => Br(i, n[h(i.target, i, "target")])).filter(At);
1978
+ }
1979
+ function Br(e, t) {
1980
+ if (!t)
1981
+ return null;
1982
+ const [r] = Object.entries(e.validation ?? {}), [n] = Object.entries(t.validation ?? {}), s = pe(r, n);
1983
+ return s ? {
1984
+ errorPath: h(e.target, e, "target"),
1985
+ errorType: R.FIELDS_COMPATIBILITY_ERROR,
1986
+ errorMessage: s.errorMessage,
1987
+ params: s.params
1988
+ } : null;
1989
+ }
1990
+ function pe(e, t) {
1991
+ if (!t)
1992
+ return null;
1993
+ if (!e)
1994
+ return {
1995
+ errorMessage: "Field requires validation property"
1996
+ };
1997
+ const [r, n] = e, [s, i] = t;
1998
+ if (r !== s)
1999
+ return {
2000
+ errorMessage: "Incompatible field type",
2001
+ params: {
2002
+ current: r,
2003
+ previous: s
2004
+ }
2005
+ };
2006
+ switch (r) {
2007
+ case "string":
2008
+ return qr(n, i);
2009
+ case "array":
2010
+ return Hr(n, i);
2011
+ case "object":
2012
+ return jr(n, i);
2013
+ default:
2014
+ return null;
2015
+ }
2016
+ }
2017
+ function qr(e, t) {
2018
+ const r = e.format ?? A.UNDEFINED, n = t.format ?? A.UNDEFINED;
2019
+ return r !== n ? {
2020
+ errorMessage: "Incompatible string format",
2021
+ params: {
2022
+ current: r,
2023
+ previous: n
2024
+ }
2025
+ } : null;
2026
+ }
2027
+ function Hr(e, t) {
2028
+ const [r] = Object.entries(e.items ?? {}), [n] = Object.entries(t.items ?? {});
2029
+ return pe(r, n);
2030
+ }
2031
+ function jr(e, t) {
2032
+ const r = Object.keys(e.properties ?? {}).slice().sort(), n = Object.keys(t.properties ?? {}).slice().sort();
2033
+ if (n.every((s, i) => s === r[i])) {
2034
+ const s = n.reduce((i, o) => {
2035
+ const [a] = Object.entries((e.properties ?? {})[o]), [u] = Object.entries((t.properties ?? {})[o]), f = pe(a, u);
2036
+ return f && (i[o] = f), i;
2037
+ }, {});
2038
+ return Object.keys(s).length ? {
2039
+ errorMessage: "Object has incompatible properties",
2040
+ params: s
2041
+ } : null;
2042
+ }
2043
+ return {
2044
+ errorMessage: "Object has mismatching properties",
2045
+ params: {
2046
+ current: r,
2047
+ previous: n
2048
+ }
2049
+ };
2050
+ }
2051
+ var be;
2052
+ (function(e) {
2053
+ e.NOT_ASCEND = "NOT_ASCEND", e.FREE = "FREE", e.BASIC = "BASIC", e.PROFESSIONAL = "PROFESSIONAL", e.UNLIMITED = "UNLIMITED";
2054
+ })(be || (be = {}));
2055
+ var fe;
2056
+ (function(e) {
2057
+ e.UNKNOWN_FEATURE = "UNKNOWN_FEATURE", e.FILE_UPLOAD_FIELD = "FILE_UPLOAD_FIELD", e.ACCEPT_PAYMENTS = "ACCEPT_PAYMENTS", e.REMOVE_WIX_BRANDING = "REMOVE_WIX_BRANDING", e.SIGNATURE_FIELD = "SIGNATURE_FIELD", e.FILE_DOWNLOAD = "FILE_DOWNLOAD";
2058
+ })(fe || (fe = {}));
2059
+ const Xr = "FILE_UPLOAD";
2060
+ function gn(e, t, r) {
2061
+ var s, i, o, a;
2062
+ const n = [
2063
+ Wr({
2064
+ limit: W((s = e.fieldsLimit) == null ? void 0 : s.limit)
2065
+ }),
2066
+ Kr({
2067
+ limit: W((i = e.stepsLimit) == null ? void 0 : i.limit)
2068
+ }),
2069
+ zr({
2070
+ limit: W((o = e.rulesLimit) == null ? void 0 : o.limit)
2071
+ }),
2072
+ Vr({
2073
+ featureRestricted: Zr(on(e.features))
2074
+ })
2075
+ ];
2076
+ if (nn(r)) {
2077
+ const u = k(r.currentForm), f = k(t);
2078
+ return {
2079
+ errors: Ce(n, f, u)
2080
+ };
2081
+ }
2082
+ if (sn(r)) {
2083
+ const u = k(), f = k(t);
2084
+ return {
2085
+ errors: Ce([
2086
+ ...n,
2087
+ kr(W((a = e.formsLimit) == null ? void 0 : a.limit), h(r.existingFormsCount, r, "existingFormsCount"))
2088
+ ], f, u)
2089
+ };
2090
+ }
2091
+ throw new Error("Unknown validation action");
2092
+ }
2093
+ function Ce(e, t, r) {
2094
+ return e.map((n) => n(t, r)).filter(Boolean).map((n) => n);
2095
+ }
2096
+ const kr = (e, t) => () => ne(e, t, t + 1) ? Jr(e) : null, Wr = ({ limit: e }) => (t, r) => ne(e, r.inputFieldsCount, t.inputFieldsCount) || le(e, r.inputFieldsCount, t.inputFieldIds, r.inputFieldIds) ? Qr(e) : null, Kr = ({ limit: e }) => (t, r) => ne(e, r.stepsCount, t.stepsCount) || le(e, r.stepsCount, t.stepsIds, r.stepsIds) ? en(e) : null, zr = ({ limit: e }) => (t, r) => ne(e, r.rulesCount, t.rulesCount) || le(e, r.rulesCount, t.rulesIds, r.rulesIds) ? tn(e) : null, Vr = ({ featureRestricted: e }) => (t, r) => Ye(t.fileUploadFieldIds, r.fileUploadFieldIds).length && e(fe.FILE_UPLOAD_FIELD) ? rn() : null;
2097
+ function Ye(e, t) {
2098
+ const r = new Set(t);
2099
+ return e.filter((n) => !r.has(n));
2100
+ }
2101
+ function ne(e, t, r) {
2102
+ return r > Math.max(e, t);
2103
+ }
2104
+ function le(e, t, r, n) {
2105
+ return t > e && Ye(r, n).length && r.length > e;
2106
+ }
2107
+ const Zr = (e) => (t) => !e.some((r) => r === t);
2108
+ function Jr(e) {
2109
+ return {
2110
+ errorPath: "form",
2111
+ errorType: R.FORMS_COUNT_RESTRICTIONS_ERROR,
2112
+ errorMessage: `Form count reached its limit of ${e}`,
2113
+ params: {
2114
+ limit: e
2115
+ }
2116
+ };
2117
+ }
2118
+ function Qr(e) {
2119
+ return {
2120
+ errorPath: "form",
2121
+ errorType: R.FIELDS_COUNT_RESTRICTIONS_ERROR,
2122
+ errorMessage: `Field count reached its limit of ${e}`,
2123
+ params: {
2124
+ limit: e
2125
+ }
2126
+ };
2127
+ }
2128
+ function en(e) {
2129
+ return {
2130
+ errorPath: "form",
2131
+ errorType: R.STEPS_COUNT_RESTRICTIONS_ERROR,
2132
+ errorMessage: `Steps count reached its limit of ${e}`,
2133
+ params: {
2134
+ limit: e
2135
+ }
2136
+ };
2137
+ }
2138
+ function tn(e) {
2139
+ return {
2140
+ errorPath: "form",
2141
+ errorType: R.RULES_COUNT_RESTRICTIONS_ERROR,
2142
+ errorMessage: `Rules count reached its limit of ${e}`,
2143
+ params: {
2144
+ limit: e
2145
+ }
2146
+ };
2147
+ }
2148
+ function rn() {
2149
+ return {
2150
+ errorPath: "form",
2151
+ errorType: R.FILE_UPLOAD_RESTRICTIONS_ERROR,
2152
+ errorMessage: "File upload field is not enabled for the given site"
2153
+ };
2154
+ }
2155
+ function k(e) {
2156
+ const t = e ?? {}, r = (t.fields ?? []).filter((n) => !!n.target);
2157
+ return {
2158
+ inputFieldsCount: r.length,
2159
+ stepsCount: (t.steps ?? []).length,
2160
+ rulesCount: (t.rules ?? []).length,
2161
+ inputFieldIds: r.map((n) => n.id),
2162
+ stepsIds: (t.steps ?? []).map((n) => n.id),
2163
+ rulesIds: (t.rules ?? []).map((n) => n.id),
2164
+ fileUploadFieldIds: (t.fields ?? []).filter((n) => (n.view ?? {}).fieldType === Xr).map((n) => n.id)
2165
+ };
2166
+ }
2167
+ function nn(e) {
2168
+ return "currentForm" in e;
2169
+ }
2170
+ function sn(e) {
2171
+ return "existingFormsCount" in e;
2172
+ }
2173
+ function W(e) {
2174
+ return e ?? Number.MAX_SAFE_INTEGER;
2175
+ }
2176
+ function on(e) {
2177
+ return e ?? [];
2178
+ }
2179
+ function un(e) {
2180
+ switch (e == null ? void 0 : e.inputType) {
2181
+ case M.STRING:
2182
+ return an(e.stringOptions) ?? void 0;
2183
+ case M.NUMBER:
2184
+ return cn(e.numberOptions) ?? void 0;
2185
+ case M.PAYMENT:
2186
+ return mn(e.paymentOptions) ?? void 0;
2187
+ default:
2188
+ return;
2189
+ }
2190
+ }
2191
+ function an(e) {
2192
+ var t, r, n, s, i;
2193
+ switch (e == null ? void 0 : e.componentType) {
2194
+ case q.DATE_TIME:
2195
+ return (t = e == null ? void 0 : e.dateTimeOptions) == null ? void 0 : t.default;
2196
+ case q.DATE_INPUT:
2197
+ return (r = e == null ? void 0 : e.dateInputOptions) == null ? void 0 : r.default;
2198
+ case q.DATE_PICKER:
2199
+ return (n = e == null ? void 0 : e.datePickerOptions) == null ? void 0 : n.default;
2200
+ case q.TEXT_INPUT:
2201
+ return (s = e == null ? void 0 : e.textInputOptions) == null ? void 0 : s.default;
2202
+ case q.TIME_INPUT:
2203
+ return (i = e == null ? void 0 : e.timeInputOptions) == null ? void 0 : i.default;
2204
+ default:
2205
+ return;
2206
+ }
2207
+ }
2208
+ function cn(e) {
2209
+ var t, r;
2210
+ switch (e == null ? void 0 : e.componentType) {
2211
+ case he.NUMBER_INPUT:
2212
+ return (t = e == null ? void 0 : e.numberInputOptions) == null ? void 0 : t.default;
2213
+ case he.RATING_INPUT:
2214
+ return (r = e == null ? void 0 : e.ratingInputOptions) == null ? void 0 : r.defaultValue;
2215
+ default:
2216
+ return;
2217
+ }
2218
+ }
2219
+ function mn(e) {
2220
+ var t;
2221
+ switch (e == null ? void 0 : e.componentType) {
2222
+ case je.PAYMENT_INPUT:
2223
+ return (t = e == null ? void 0 : e.paymentInputOptions) == null ? void 0 : t.default;
2224
+ default:
2225
+ return;
2226
+ }
2227
+ }
2228
+ function fn(e, t, r) {
2229
+ return t in e ? Object.defineProperty(e, t, {
2230
+ value: r,
2231
+ enumerable: !0,
2232
+ configurable: !0,
2233
+ writable: !0
2234
+ }) : e[t] = r, e;
2235
+ }
2236
+ class On {
2237
+ validate(t, r) {
2238
+ var s;
2239
+ const n = ((s = t.formFields) == null ? void 0 : s.reduce((i, { inputOptions: o }) => {
2240
+ const a = un(o), u = o == null ? void 0 : o.target;
2241
+ return a && u && (i[u] = this.buildSubmissionValue(a, o, r)), i;
2242
+ }, {})) || {};
2243
+ if (Object.keys(n).length) {
2244
+ const { errors: i } = this.submissionValidator.validateFields(t.id, n);
2245
+ return {
2246
+ errors: i
2247
+ };
2248
+ }
2249
+ return {
2250
+ errors: []
2251
+ };
2252
+ }
2253
+ buildSubmissionValue(t, r, n) {
2254
+ var s, i, o, a, u;
2255
+ switch (r.inputType) {
2256
+ case M.PAYMENT:
2257
+ return (o = (i = (s = r.paymentOptions) == null ? void 0 : s.validation) == null ? void 0 : i.products) == null ? void 0 : o.map((f) => ({
2258
+ productId: f.id,
2259
+ price: t,
2260
+ quantity: 1
2261
+ }));
2262
+ case M.STRING: {
2263
+ const f = (u = (a = r.stringOptions) == null ? void 0 : a.validation) == null ? void 0 : u.format;
2264
+ return !f || typeof t != "string" ? t : ae(f, () => /* @__PURE__ */ new Date(), t, n) ?? t;
2265
+ }
2266
+ default:
2267
+ return t;
2268
+ }
2269
+ }
2270
+ constructor(t) {
2271
+ fn(this, "submissionValidator", void 0), this.submissionValidator = t;
2272
+ }
2273
+ }
2274
+ export {
2275
+ tt as CALLING_COUNTRY_CODES,
2276
+ S as DateFieldErrorSuffix,
2277
+ v as DateTimeFieldErrorSuffix,
2278
+ R as ErrorTypes,
2279
+ Xr as FILE_UPLOAD_FIELD_TYPE,
2280
+ On as FormSchemaValidator,
2281
+ Nn as FormValidator,
2282
+ O as ValidationMode,
2283
+ yn as compareSchemaBackwardCompatibility,
2284
+ un as getDefaultValue,
2285
+ Mn as groupErrorsByTarget,
2286
+ et as isDateAvailable,
2287
+ Qe as parseDateInput,
2288
+ Sn as parseLocalDate,
2289
+ gn as validatePremiumRestrictions
2290
+ };