@verbb/formie-browser 1.0.4 → 1.0.6

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 (197) hide show
  1. package/CHANGELOG.md +76 -22
  2. package/dist/chunks/address-country-Rx6GQTND.js +68 -0
  3. package/dist/chunks/address-finder-yXU5yMjG.js +30 -0
  4. package/dist/chunks/address-state-BQ0xGV9n.js +344 -0
  5. package/dist/chunks/api-CmwLRq_n.js +780 -0
  6. package/dist/chunks/api-DMK8NSUI.js +407 -0
  7. package/dist/chunks/api-sPqGbOww.js +125 -0
  8. package/dist/chunks/async-nPFRNQ06.js +25 -0
  9. package/dist/chunks/bpoint-DSjqRv63.js +24 -0
  10. package/dist/chunks/calculations-CeDgB9jt.js +299 -0
  11. package/dist/chunks/captcha-eu-CWJb64_j.js +31 -0
  12. package/dist/chunks/checkbox-radio-DQ0H67Tj.js +125 -0
  13. package/dist/chunks/chunk-3b4jIN3o.js +13 -0
  14. package/dist/chunks/combobox-D-2b42wn.js +1954 -0
  15. package/dist/chunks/conditions-DjZOtHfS.js +412 -0
  16. package/dist/chunks/constants-DVcJAvc5.js +38 -0
  17. package/dist/chunks/country-from-ip-BwxKaBuJ.js +26 -0
  18. package/dist/chunks/custom-google-maps-BsaSirEZ.js +194 -0
  19. package/dist/chunks/custom-link-CJ1-FjEM.js +46 -0
  20. package/dist/chunks/custom-maps-DYW_pBid.js +161 -0
  21. package/dist/chunks/date-picker-5CA_-zGb.js +5311 -0
  22. package/dist/chunks/debug-BV0DvdHx.js +41 -0
  23. package/dist/chunks/dist-BQ4a9hmy.js +2659 -0
  24. package/dist/chunks/event-names-BCI2FLD8.js +51 -0
  25. package/dist/chunks/eway-D3ctTbEk.js +70 -0
  26. package/dist/chunks/field-references.keys-58ZSTrCW.js +21 -0
  27. package/dist/chunks/field-references.resolver-CHwn0G0L.js +145 -0
  28. package/dist/chunks/file-upload-D49m8-DR.js +287 -0
  29. package/dist/chunks/friendly-captcha-v1-ByXzENYZ.js +31 -0
  30. package/dist/chunks/friendly-captcha-v2-BPdlmhQu.js +36 -0
  31. package/dist/chunks/friendly-challenge-8uPatWqk.js +832 -0
  32. package/dist/chunks/go-cardless-BwASSYSK.js +23 -0
  33. package/dist/chunks/google-address-OhKilPWE.js +161 -0
  34. package/dist/chunks/hcaptcha-CdCd9oEi.js +54 -0
  35. package/dist/chunks/hidden-D7_Ch-QN.js +26 -0
  36. package/dist/chunks/http-D-JExro7.js +27 -0
  37. package/dist/chunks/i18n-BY1ds1BL.js +121 -0
  38. package/dist/chunks/leaflet-src-j-lHNmhR.js +4585 -0
  39. package/dist/chunks/loqate-Cp2zvwpE.js +76 -0
  40. package/dist/chunks/mollie-COG-ko2D.js +23 -0
  41. package/dist/chunks/moneris-CMH8PlRc.js +117 -0
  42. package/dist/chunks/opayo-D2jsR5vh.js +113 -0
  43. package/dist/chunks/paddle-DxF88RfC.js +55 -0
  44. package/dist/chunks/paypal-b5pnwrA2.js +95 -0
  45. package/dist/chunks/payway-BJYu9DIR.js +55 -0
  46. package/dist/chunks/phone-country-D3ayr60L.js +2645 -0
  47. package/dist/chunks/place-kit-BGHklIZ-.js +48 -0
  48. package/dist/chunks/placekit-autocomplete.esm-DWVabQlq.js +1236 -0
  49. package/dist/chunks/recaptcha-enterprise-BSwi8IVX.js +65 -0
  50. package/dist/chunks/recaptcha-shared-B4zAescW.js +15 -0
  51. package/dist/chunks/recaptcha-v2-checkbox-CnDQmsKa.js +40 -0
  52. package/dist/chunks/recaptcha-v2-invisible-Cz5uIlp-.js +53 -0
  53. package/dist/chunks/recaptcha-v3-BtbbP111.js +27 -0
  54. package/dist/chunks/repeater-B5leVxZU.js +102 -0
  55. package/dist/chunks/rich-text-D0sb8bmX.js +349 -0
  56. package/dist/chunks/scripts-6CYSUGKQ.js +24 -0
  57. package/dist/chunks/sdk-BhHAYgga.js +1397 -0
  58. package/dist/chunks/shared-Bx9s0i0P.js +100 -0
  59. package/dist/chunks/signature-xz4QO7CR.js +536 -0
  60. package/dist/chunks/snaptcha-vz1RnZ15.js +8 -0
  61. package/dist/chunks/square-BP8RWAKB.js +40 -0
  62. package/dist/chunks/stripe-MihN63uC.js +184 -0
  63. package/dist/chunks/styles-BfoIZwJp.js +19 -0
  64. package/dist/chunks/summary-D3AjxpYN.js +114 -0
  65. package/dist/chunks/table-C-lkQN6I.js +78 -0
  66. package/dist/chunks/text-limit-DbgEFHLO.js +125 -0
  67. package/dist/chunks/theme-classes-Tv7q7ToE.js +44 -0
  68. package/dist/chunks/turnstile-D_Pi1CKM.js +58 -0
  69. package/dist/chunks/upload-manager-BpqWSHmU.js +2558 -0
  70. package/dist/chunks/utils-Vqp8i_RM.js +49401 -0
  71. package/dist/css/formie-theme.css +2 -0
  72. package/dist/css/theme/_buttons.css +16 -0
  73. package/dist/css/theme/_tokens.css +2 -0
  74. package/dist/css/theme/fields/_address-state.css +94 -0
  75. package/dist/css/theme/fields/_combobox.css +246 -0
  76. package/dist/css/theme/fields/_select.css +13 -0
  77. package/dist/css/theme/fields/_signature.css +19 -0
  78. package/dist/css/theme/fields/_upload-manager.css +279 -0
  79. package/dist/index.js +2448 -39
  80. package/dist/js/core/create-formie-client.d.ts.map +1 -1
  81. package/dist/js/core/submit-result-ui.d.ts.map +1 -1
  82. package/dist/js/core/validation-focus.d.ts +4 -0
  83. package/dist/js/core/validation-focus.d.ts.map +1 -0
  84. package/dist/js/modules/address/api.d.ts +1 -0
  85. package/dist/js/modules/address/api.d.ts.map +1 -1
  86. package/dist/js/modules/address/constants.d.ts +22 -1
  87. package/dist/js/modules/address/constants.d.ts.map +1 -1
  88. package/dist/js/modules/address/host.d.ts +2 -2
  89. package/dist/js/modules/address/host.d.ts.map +1 -1
  90. package/dist/js/modules/address/loqate.d.ts.map +1 -1
  91. package/dist/js/modules/fields/address-country.d.ts +3 -0
  92. package/dist/js/modules/fields/address-country.d.ts.map +1 -0
  93. package/dist/js/modules/fields/address-state.d.ts +3 -0
  94. package/dist/js/modules/fields/address-state.d.ts.map +1 -0
  95. package/dist/js/modules/fields/calculations.d.ts.map +1 -1
  96. package/dist/js/modules/fields/combobox.d.ts +17 -0
  97. package/dist/js/modules/fields/combobox.d.ts.map +1 -0
  98. package/dist/js/modules/fields/custom-google-maps.d.ts +64 -0
  99. package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -0
  100. package/dist/js/modules/fields/custom-link.d.ts +3 -0
  101. package/dist/js/modules/fields/custom-link.d.ts.map +1 -0
  102. package/dist/js/modules/fields/custom-maps.d.ts +3 -0
  103. package/dist/js/modules/fields/custom-maps.d.ts.map +1 -0
  104. package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
  105. package/dist/js/modules/fields/index.d.ts.map +1 -1
  106. package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
  107. package/dist/js/modules/fields/signature.d.ts.map +1 -1
  108. package/dist/js/modules/fields/upload-manager.d.ts +3 -0
  109. package/dist/js/modules/fields/upload-manager.d.ts.map +1 -0
  110. package/dist/js/submit/pipeline.d.ts.map +1 -1
  111. package/dist/js/utils/country-from-ip.d.ts +7 -0
  112. package/dist/js/utils/country-from-ip.d.ts.map +1 -0
  113. package/dist/js/utils/field-references.d.ts +1 -0
  114. package/dist/js/utils/field-references.d.ts.map +1 -1
  115. package/dist/js/utils/field-references.row-scope.d.ts +11 -0
  116. package/dist/js/utils/field-references.row-scope.d.ts.map +1 -0
  117. package/package.json +8 -3
  118. package/src/css/formie-theme.css +2 -0
  119. package/src/css/theme/_buttons.css +16 -0
  120. package/src/css/theme/_tokens.css +2 -0
  121. package/src/css/theme/fields/_address-state.css +94 -0
  122. package/src/css/theme/fields/_combobox.css +246 -0
  123. package/src/css/theme/fields/_select.css +13 -0
  124. package/src/css/theme/fields/_signature.css +19 -0
  125. package/src/css/theme/fields/_upload-manager.css +279 -0
  126. package/src/js/core/create-formie-client.ts +27 -0
  127. package/src/js/core/submit-result-ui.ts +4 -4
  128. package/src/js/core/validation-focus.ts +117 -0
  129. package/src/js/modules/address/api.ts +7 -0
  130. package/src/js/modules/address/constants.ts +82 -2
  131. package/src/js/modules/address/host.ts +16 -6
  132. package/src/js/modules/address/loqate.ts +3 -17
  133. package/src/js/modules/fields/address-country.ts +156 -0
  134. package/src/js/modules/fields/address-state.ts +946 -0
  135. package/src/js/modules/fields/calculations.ts +32 -0
  136. package/src/js/modules/fields/combobox.ts +188 -0
  137. package/src/js/modules/fields/custom-google-maps.ts +416 -0
  138. package/src/js/modules/fields/custom-link.ts +95 -0
  139. package/src/js/modules/fields/custom-maps.ts +339 -0
  140. package/src/js/modules/fields/date-picker.ts +96 -3
  141. package/src/js/modules/fields/index.ts +7 -0
  142. package/src/js/modules/fields/phone-country.ts +6 -0
  143. package/src/js/modules/fields/signature.ts +199 -15
  144. package/src/js/modules/fields/upload-manager.ts +1277 -0
  145. package/src/js/submit/pipeline.ts +11 -1
  146. package/src/js/utils/country-from-ip.ts +54 -0
  147. package/src/js/utils/field-references.row-scope.ts +303 -0
  148. package/src/js/utils/field-references.ts +1 -0
  149. package/src/vendor.d.ts +1 -1
  150. package/dist/chunks/address-finder-BU4roxT6.js +0 -37
  151. package/dist/chunks/bpoint-uNg5j6rt.js +0 -26
  152. package/dist/chunks/calculations-C9t6Zop9.js +0 -147
  153. package/dist/chunks/captcha-eu-BAPzHNts.js +0 -34
  154. package/dist/chunks/checkbox-radio-CHeLNVIK.js +0 -141
  155. package/dist/chunks/conditions-DKxVCsjD.js +0 -459
  156. package/dist/chunks/date-picker-B3iQ797Z.js +0 -4994
  157. package/dist/chunks/eway-DCielIML.js +0 -74
  158. package/dist/chunks/file-upload-DP2TOUYV.js +0 -316
  159. package/dist/chunks/friendly-captcha-v1-DdlcGiFY.js +0 -33
  160. package/dist/chunks/friendly-captcha-v2-76w-YnFm.js +0 -38
  161. package/dist/chunks/go-cardless-rwCkzbNK.js +0 -24
  162. package/dist/chunks/google-address-BD8IZ86V.js +0 -181
  163. package/dist/chunks/hcaptcha-BNNTL6uf.js +0 -56
  164. package/dist/chunks/hidden-CW6Rcf1N.js +0 -31
  165. package/dist/chunks/index-BEsfee-D.js +0 -1839
  166. package/dist/chunks/index-BP7Unm5Y.js +0 -863
  167. package/dist/chunks/index-D6npYxvr.js +0 -4423
  168. package/dist/chunks/loqate-B-ZNS65B.js +0 -55
  169. package/dist/chunks/mollie-BDAZ-1X4.js +0 -24
  170. package/dist/chunks/moneris-B1b0uEtY.js +0 -101
  171. package/dist/chunks/opayo-CC5hraHo.js +0 -122
  172. package/dist/chunks/paddle-B4GmrDsq.js +0 -60
  173. package/dist/chunks/paypal-BFS6XsIS.js +0 -100
  174. package/dist/chunks/payway-DekoJead.js +0 -56
  175. package/dist/chunks/phone-country-Cm5YUeXI.js +0 -3765
  176. package/dist/chunks/place-kit-DizZWV_e.js +0 -42
  177. package/dist/chunks/placekit-autocomplete.esm-LAwfbPZl.js +0 -1299
  178. package/dist/chunks/recaptcha-enterprise-BbOvO7JZ.js +0 -71
  179. package/dist/chunks/recaptcha-shared-Dwg1eVFS.js +0 -15
  180. package/dist/chunks/recaptcha-v2-checkbox-SY3ti5iQ.js +0 -41
  181. package/dist/chunks/recaptcha-v2-invisible-DSmQnn6c.js +0 -59
  182. package/dist/chunks/recaptcha-v3-DNh7YCnR.js +0 -28
  183. package/dist/chunks/repeater-DM0vuFNQ.js +0 -124
  184. package/dist/chunks/rich-text-C8aGYp70.js +0 -304
  185. package/dist/chunks/scripts-CKTFtxPO.js +0 -36
  186. package/dist/chunks/sdk-3SicTWby.js +0 -1559
  187. package/dist/chunks/shared--BU5CFoL.js +0 -80
  188. package/dist/chunks/signature-pFhZfH7d.js +0 -550
  189. package/dist/chunks/snaptcha-VuOUOaLj.js +0 -8
  190. package/dist/chunks/square-BR9pvToy.js +0 -46
  191. package/dist/chunks/stripe-OHUwoV9g.js +0 -202
  192. package/dist/chunks/styles-C3aqgtek.js +0 -21
  193. package/dist/chunks/summary-Da7Ktg3N.js +0 -126
  194. package/dist/chunks/table-C0PmR9bI.js +0 -95
  195. package/dist/chunks/text-limit-mLEwZDIa.js +0 -144
  196. package/dist/chunks/turnstile-9tM7q_LK.js +0 -59
  197. package/dist/chunks/utils-BntI3W4S.js +0 -6149
@@ -0,0 +1,299 @@
1
+ import { t as e } from "./debug-BV0DvdHx.js";
2
+ import { r as t, t as n } from "./field-references.keys-58ZSTrCW.js";
3
+ import { n as r, r as i } from "./field-references.resolver-CHwn0G0L.js";
4
+ import { r as a, t as o } from "./shared-Bx9s0i0P.js";
5
+ import { c as s, n as c, r as l, s as u, t as d } from "./dist-BQ4a9hmy.js";
6
+ //#region src/js/utils/field-references.row-scope.ts
7
+ var f = new Set([
8
+ "first",
9
+ "last",
10
+ "index",
11
+ "all",
12
+ "count",
13
+ "rows"
14
+ ]);
15
+ function p(e) {
16
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
17
+ }
18
+ function m(e, t) {
19
+ let n = String(e || "").trim().toLowerCase();
20
+ if (!n || t <= 0) return [];
21
+ if (n === "even") {
22
+ let e = [];
23
+ for (let n = 1; n <= t; n++) n % 2 == 0 && e.push(n - 1);
24
+ return e;
25
+ }
26
+ if (n === "odd") {
27
+ let e = [];
28
+ for (let n = 1; n <= t; n++) n % 2 == 1 && e.push(n - 1);
29
+ return e;
30
+ }
31
+ let r = n.match(/^every:(\d+)$/);
32
+ if (r) {
33
+ let e = Math.max(1, Number.parseInt(r[1] || "1", 10)), n = [];
34
+ for (let r = 1; r <= t; r += e) n.push(r - 1);
35
+ return n;
36
+ }
37
+ let i = [];
38
+ return n.split(/\s*,\s*/).forEach((e) => {
39
+ let n = e.trim();
40
+ if (!n) return;
41
+ let r = n.match(/^(\d+)\s*-\s*(\d+)$/);
42
+ if (r) {
43
+ let e = Number.parseInt(r[1] || "0", 10), n = Number.parseInt(r[2] || "0", 10);
44
+ e > n && ([e, n] = [n, e]);
45
+ for (let r = e; r <= n; r++) r >= 1 && r <= t && i.push(r - 1);
46
+ return;
47
+ }
48
+ let a = Number.parseInt(n, 10);
49
+ Number.isFinite(a) && a >= 1 && a <= t && i.push(a - 1);
50
+ }), [...new Set(i)].sort((e, t) => e - t);
51
+ }
52
+ function h(e) {
53
+ let n = t(e), r = n.split(".").filter(Boolean);
54
+ return r.length < 2 ? {
55
+ fieldKey: n,
56
+ columnKey: r[r.length - 1] || ""
57
+ } : r.length >= 3 && /^\d+$/.test(r[1] || "") ? {
58
+ fieldKey: r[0] || "",
59
+ columnKey: r.slice(2).join(".")
60
+ } : {
61
+ fieldKey: r[0] || "",
62
+ columnKey: r.slice(1).join(".")
63
+ };
64
+ }
65
+ function g(e, t, n) {
66
+ let r = RegExp(`^${p(e)}\\.(\\d+)\\.${p(t)}$`);
67
+ return [...n.keys()].filter((e) => r.test(e)).sort((e, t) => Number.parseInt(e.split(".")[1] || "0", 10) - Number.parseInt(t.split(".")[1] || "0", 10));
68
+ }
69
+ function _(e, t) {
70
+ return r(e, t).value;
71
+ }
72
+ function v(e, t, r) {
73
+ let i = /* @__PURE__ */ new Set(), { fieldKey: a, columnKey: o } = h(e), s = String(t.scope || "").trim().toLowerCase();
74
+ if (!a || !o || !f.has(s)) {
75
+ let t = n(e);
76
+ return t && (i.add(t), i.add(`${t}[]`)), i;
77
+ }
78
+ return g(a, o, r).forEach((e) => {
79
+ let t = r.get(e);
80
+ if (t?.names?.length) {
81
+ t.names.forEach((e) => {
82
+ i.add(e);
83
+ });
84
+ return;
85
+ }
86
+ let a = n(e);
87
+ a && (i.add(a), i.add(`${a}[]`));
88
+ }), i;
89
+ }
90
+ function y(e, t, n) {
91
+ let i = String(t.scope || "").trim().toLowerCase();
92
+ if (!i || !f.has(i)) return r(e, n);
93
+ let { fieldKey: a, columnKey: o } = h(e);
94
+ if (!a || !o) return r(e, n);
95
+ let s = g(a, o, n), c = s.map((e) => _(e, n));
96
+ if (i === "count") return {
97
+ key: `${a}.${o}`,
98
+ value: String(s.length),
99
+ found: !0
100
+ };
101
+ if (i === "first") return {
102
+ key: s[0] || `${a}.0.${o}`,
103
+ value: c[0] ?? "",
104
+ found: s.length > 0
105
+ };
106
+ if (i === "last") return {
107
+ key: s[s.length - 1] || `${a}.0.${o}`,
108
+ value: c[c.length - 1] ?? "",
109
+ found: s.length > 0
110
+ };
111
+ if (i === "index") return r(`${a}.${Number.parseInt(String(t.index ?? "0"), 10)}.${o}`, n);
112
+ if (i === "all") {
113
+ let e = c.flatMap((e) => Array.isArray(e) ? e : e === "" ? [] : [e]);
114
+ return {
115
+ key: `${a}.${o}`,
116
+ value: e,
117
+ found: e.length > 0
118
+ };
119
+ }
120
+ if (i === "rows") {
121
+ let e = m(String(t.rows || ""), s.length);
122
+ if (e.length === 0) return {
123
+ key: `${a}.${o}`,
124
+ value: "",
125
+ found: !1
126
+ };
127
+ if (e.length === 1) return {
128
+ key: s[e[0]] || `${a}.${e[0]}.${o}`,
129
+ value: c[e[0]] ?? "",
130
+ found: !0
131
+ };
132
+ let n = e.flatMap((e) => {
133
+ let t = c[e];
134
+ return Array.isArray(t) ? t : t === "" ? [] : [t];
135
+ });
136
+ return {
137
+ key: `${a}.${o}`,
138
+ value: n,
139
+ found: n.length > 0
140
+ };
141
+ }
142
+ return r(e, n);
143
+ }
144
+ //#endregion
145
+ //#region src/js/modules/fields/calculations.ts
146
+ var b = "input[data-formie-calculation-input]";
147
+ function x(e) {
148
+ let t = e;
149
+ return {
150
+ scope: t.scope,
151
+ index: t.index,
152
+ rows: t.rows,
153
+ fieldKind: t.fieldKind
154
+ };
155
+ }
156
+ var S = "calculations", C = e("fields", "calculations");
157
+ function w(e, t, n) {
158
+ let a = i(e), o = {};
159
+ return t.forEach(([e, t]) => {
160
+ let n = x(t);
161
+ if (String(n.scope || "").trim()) {
162
+ o[e] = c(t, y(t.sourceKey || "", n, a).value);
163
+ return;
164
+ }
165
+ o[e] = c(t, r(t.sourceKey || "", a).value);
166
+ }), d(o, n.formatting);
167
+ }
168
+ function T(e, r) {
169
+ let a = i(e), o = /* @__PURE__ */ new Set();
170
+ return r.forEach(([, e]) => {
171
+ let r = x(e);
172
+ if (String(r.scope || "").trim()) {
173
+ v(e.sourceKey || "", r, a).forEach((e) => {
174
+ o.add(e);
175
+ });
176
+ return;
177
+ }
178
+ let i = t(e.sourceKey || ""), s = a.get(i);
179
+ if (s?.names?.length) {
180
+ s.names.forEach((e) => {
181
+ o.add(e);
182
+ });
183
+ return;
184
+ }
185
+ let c = n(i);
186
+ c && (o.add(c), o.add(`${c}[]`));
187
+ }), o;
188
+ }
189
+ function E(e, t, n, r) {
190
+ let i = s(r), a = l(r), c = /* @__PURE__ */ new Map(), d = null, f = !1, p = !1, m = !1, h = () => {
191
+ c.forEach((e, t) => {
192
+ e.forEach((e, n) => {
193
+ t.removeEventListener(n, e);
194
+ });
195
+ }), c.clear();
196
+ }, g = (e) => {
197
+ !e || f || queueMicrotask(() => {
198
+ f || (n.dispatchEvent(new Event("input", { bubbles: !0 })), n.dispatchEvent(new Event("change", { bubbles: !0 })));
199
+ });
200
+ }, _ = (s = !1) => {
201
+ let c = w(e, a, r);
202
+ C.log("Evaluate requested.", {
203
+ fieldHandle: t.getAttribute("data-formie-field-handle") || null,
204
+ isInit: s
205
+ });
206
+ let l = {
207
+ calculations: n,
208
+ init: s,
209
+ formula: i,
210
+ variables: c
211
+ };
212
+ if (o(t, S, "before-evaluate", l), !l.formula) {
213
+ let e = n.value !== "";
214
+ n.value = "", g(e);
215
+ return;
216
+ }
217
+ try {
218
+ let e = u(l.formula, l.variables, r), i = {
219
+ calculations: n,
220
+ init: s,
221
+ formula: l.formula,
222
+ variables: l.variables,
223
+ result: e
224
+ };
225
+ o(t, S, "after-evaluate", i);
226
+ let a = typeof i.result == "string" || typeof i.result == "number" ? String(i.result) : "", c = n.value !== a;
227
+ n.value = a, C.log("Evaluate complete.", {
228
+ fieldHandle: t.getAttribute("data-formie-field-handle") || null,
229
+ valueChanged: c,
230
+ nextValue: a
231
+ }), g(c);
232
+ } catch (e) {
233
+ let r = n.value !== "";
234
+ console.error("[formie] Failed to evaluate calculation.", e), C.warn("Evaluate failed.", {
235
+ fieldHandle: t.getAttribute("data-formie-field-handle") || null,
236
+ error: e instanceof Error ? e.message : e
237
+ }), n.value = "", g(r);
238
+ }
239
+ }, v = (e = !1) => {
240
+ p || f || (p = !0, queueMicrotask(() => {
241
+ p = !1, _(e);
242
+ }));
243
+ }, y = () => {
244
+ h();
245
+ let n = T(e, a);
246
+ if (C.log("Binding variable watchers.", {
247
+ fieldHandle: t.getAttribute("data-formie-field-handle") || null,
248
+ watchCount: n.size
249
+ }), !n.size) return;
250
+ let r = (e) => {
251
+ let r = e.target?.name || "";
252
+ !r || !n.has(r) || (C.log("Source change detected.", {
253
+ fieldHandle: t.getAttribute("data-formie-field-handle") || null,
254
+ sourceName: r,
255
+ eventType: e.type
256
+ }), v(!1));
257
+ };
258
+ ["input", "change"].forEach((t) => {
259
+ e.addEventListener(t, r);
260
+ let n = c.get(e) || /* @__PURE__ */ new Map();
261
+ n.set(t, r), c.set(e, n);
262
+ });
263
+ }, b = () => {
264
+ m || f || (m = !0, queueMicrotask(() => {
265
+ m = !1, y(), v(!1);
266
+ }));
267
+ };
268
+ return y(), d = new MutationObserver(() => {
269
+ b();
270
+ }), d.observe(e, {
271
+ childList: !0,
272
+ subtree: !0
273
+ }), _(!0), () => {
274
+ f = !0, d?.disconnect(), h();
275
+ };
276
+ }
277
+ var D = {
278
+ id: S,
279
+ kind: "field",
280
+ match: (e) => !!e.target.querySelector(b),
281
+ setup: async (e) => {
282
+ let t = e.options || {}, n = a(e);
283
+ C.log("Module setup.", {
284
+ fieldCount: n.length,
285
+ formatting: t.formatting || null
286
+ });
287
+ let r = n.map((n) => {
288
+ let r = n.querySelector(b);
289
+ return r instanceof HTMLInputElement ? E(e.root, n, r, t) : () => {};
290
+ });
291
+ return await e.emit("formie:module:calculations:init", { count: r.length }), { destroy: () => {
292
+ C.log("Module destroy.", { fieldCount: r.length }), r.forEach((e) => {
293
+ e();
294
+ }), e.emit("formie:module:calculations:destroy", {});
295
+ } };
296
+ }
297
+ };
298
+ //#endregion
299
+ export { D as calculationsModule };
@@ -0,0 +1,31 @@
1
+ import { a as e, t } from "./api-DMK8NSUI.js";
2
+ import { r as n } from "./scripts-6CYSUGKQ.js";
3
+ //#region src/js/modules/captchas/captcha-eu.ts
4
+ async function r(t) {
5
+ return n("KROT", {
6
+ id: "FORMIE_CAPTCHA_EU_SCRIPT",
7
+ src: `${String(t.endPoint || "https://www.captcha.eu").trim().replace(/\/+$/, "")}/sdk.js`,
8
+ async: !0,
9
+ defer: !0,
10
+ timeoutMs: e
11
+ });
12
+ }
13
+ var i = t({
14
+ id: "captcha-eu",
15
+ defaultPlaceholderSelector: "[data-captcha-eu-placeholder]",
16
+ defaultTokenFieldNames: ["captcha-eu-token"],
17
+ load: ({ options: e }) => r(e.provider),
18
+ mount: ({ api: e, container: t, provider: n, services: r }) => (e.init(), e.setup(String(n.publicKey || "")), e.WidgetV2.render(t), e.on("CPT_OK", (e) => {
19
+ r.tokens.write(JSON.stringify(e.detail || {}), { container: t }), r.errors.clear();
20
+ }, t), e.on("CPT_EXPIRED", () => {
21
+ r.tokens.clear(), r.errors.clear();
22
+ }, t), t),
23
+ screen: async ({ placeholder: e, services: t, stageCtx: n }) => {
24
+ if (!await t.tokens.wait()) {
25
+ let r = t.errors.getDefaultMessage();
26
+ t.errors.show(r, e), n.abort(r);
27
+ }
28
+ }
29
+ });
30
+ //#endregion
31
+ export { i as captchaEuModule };
@@ -0,0 +1,125 @@
1
+ import { t as e } from "./debug-BV0DvdHx.js";
2
+ import { c as t, l as n, n as r, t as i } from "./shared-Bx9s0i0P.js";
3
+ //#region src/js/modules/fields/checkbox-radio.ts
4
+ var a = "[data-formie-checkboxes-field-layout], [data-formie-radio-field-layout]", o = "minmaxOptions", s = "data-formie-checkbox-radio-max-disabled", c = "checkbox-radio", l = "checkbox-radio", u = e("fields", "checkbox-radio");
5
+ function d(e) {
6
+ return e.hasAttribute("data-checkbox-toggle") || e.hasAttribute("data-formie-checkbox-toggle");
7
+ }
8
+ function f(e) {
9
+ let t = e(o);
10
+ if (!t || t === !0 || typeof t != "object") return {
11
+ min: null,
12
+ max: null
13
+ };
14
+ let n = t;
15
+ return {
16
+ min: typeof n.min == "number" ? n.min : null,
17
+ max: typeof n.max == "number" ? n.max : null
18
+ };
19
+ }
20
+ function p(e) {
21
+ return Array.from(e.querySelectorAll("input[type=\"checkbox\"]")).filter((e) => e instanceof HTMLInputElement && !d(e)).filter((e) => e.checked).length;
22
+ }
23
+ function m(e) {
24
+ n(e, l, (e) => {
25
+ e.addValidator(o, ({ field: e, getRule: t }) => {
26
+ if (!e || !t(o)) return !0;
27
+ let n = p(e), { min: r, max: i } = f(t);
28
+ return !(r !== null && n < r || i !== null && n > i);
29
+ }, ({ field: e, label: t, t: n, getRule: r }) => {
30
+ if (!e) return n("{label} has an invalid value.", { label: t });
31
+ let i = p(e), { min: a, max: o } = f(r);
32
+ return a !== null && i < a ? e.getAttribute("data-formie-validation-min-options-message") ?? n("{label} should contain at least {min, number} {min, plural, one{option} other{options}}.", {
33
+ label: t,
34
+ min: a
35
+ }) : o !== null && i > o ? e.getAttribute("data-formie-validation-max-options-message") ?? n("{label} should contain at most {max, number} {max, plural, one{option} other{options}}.", {
36
+ label: t,
37
+ max: o
38
+ }) : n("{label} has an invalid value.", { label: t });
39
+ });
40
+ });
41
+ }
42
+ function h(e) {
43
+ t(e, l, [o]);
44
+ }
45
+ function g(e) {
46
+ e.checked ? e.setAttribute("checked", "") : e.removeAttribute("checked");
47
+ }
48
+ function _(e) {
49
+ let t = Array.from(e.querySelectorAll("input[type=\"checkbox\"][required][data-formie-checkbox-input]")).filter((e) => e instanceof HTMLInputElement);
50
+ if (!t.length) return;
51
+ let n = t.some((e) => e.checked);
52
+ t.forEach((e) => {
53
+ if (n) {
54
+ e.removeAttribute("required"), e.setAttribute("aria-required", "false");
55
+ return;
56
+ }
57
+ e.setAttribute("required", "true"), e.setAttribute("aria-required", "true");
58
+ });
59
+ }
60
+ function v(e) {
61
+ let t = parseInt(e.closest("[data-formie-field-handle]")?.getAttribute("data-formie-max-options") || "", 10);
62
+ if (!(t > 0)) return;
63
+ let n = Array.from(e.querySelectorAll("input[type=\"checkbox\"]")).filter((e) => e instanceof HTMLInputElement && !d(e)), r = n.filter((e) => e.checked).length >= t;
64
+ n.forEach((e) => {
65
+ let t = r && !e.checked, n = e.hasAttribute(s);
66
+ if (t) {
67
+ e.disabled || (e.disabled = !0, e.setAttribute(s, "true"));
68
+ return;
69
+ }
70
+ n && (e.disabled = !1, e.removeAttribute(s));
71
+ });
72
+ }
73
+ function y(e, t) {
74
+ Array.from(e.querySelectorAll("input[type=\"checkbox\"]")).filter((e) => e instanceof HTMLInputElement && e !== t && !d(e)).forEach((e) => {
75
+ e.disabled && !e.checked || (e.checked = t.checked, g(e), e.dispatchEvent(new Event("change", { bubbles: !0 })), e.dispatchEvent(new Event("input", { bubbles: !0 })));
76
+ });
77
+ }
78
+ function b(e, t) {
79
+ if (!e.checked || !e.name) {
80
+ g(e);
81
+ return;
82
+ }
83
+ Array.from(t.querySelectorAll(`input[type="radio"][name="${r(e.name)}"]`)).filter((e) => e instanceof HTMLInputElement).forEach((e) => {
84
+ g(e);
85
+ });
86
+ }
87
+ function x(e) {
88
+ let t = Array.from(e.querySelectorAll("input[type=\"checkbox\"], input[type=\"radio\"]")).filter((e) => e instanceof HTMLInputElement);
89
+ if (!t.length) return u.log("No checkbox/radio inputs found for field."), () => {};
90
+ let n = t.map((t) => {
91
+ let n = t.type === "radio" ? "change" : "click", r = () => {
92
+ g(t), t.type === "checkbox" && d(t) && y(e, t), t.type === "radio" && b(t, e), _(e), v(e), u.log("Input interaction processed.", {
93
+ inputName: t.name,
94
+ inputType: t.type,
95
+ checked: t.checked
96
+ });
97
+ };
98
+ return t.addEventListener(n, r), g(t), () => {
99
+ t.removeEventListener(n, r);
100
+ };
101
+ });
102
+ return _(e), v(e), i(e, c, "init", { checkboxRadio: e }), () => {
103
+ n.forEach((e) => {
104
+ e();
105
+ });
106
+ };
107
+ }
108
+ var S = {
109
+ id: c,
110
+ kind: "field",
111
+ match: (e) => e.target instanceof HTMLElement && (e.target.matches(a) || !!e.target.querySelector(a)),
112
+ setup: async (e) => {
113
+ if (!(e.target instanceof HTMLElement)) return;
114
+ let t = e.target.matches(a) ? [e.target] : Array.from(e.target.querySelectorAll(a)).filter((e) => e instanceof HTMLElement);
115
+ m(e.form), u.log("Module setup.", { fieldCount: t.length });
116
+ let n = t.map((e) => x(e));
117
+ return await e.emit("formie:module:checkbox-radio:init", { count: t.length }), { destroy: () => {
118
+ n.forEach((e) => {
119
+ e();
120
+ }), h(e.form), u.log("Module destroy.", { fieldCount: t.length }), e.emit("formie:module:checkbox-radio:destroy", {});
121
+ } };
122
+ }
123
+ };
124
+ //#endregion
125
+ export { S as checkboxRadioModule };
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
3
+ if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
4
+ get: ((e) => i[e]).bind(null, d),
5
+ enumerable: !(s = n(i, d)) || s.enumerable
6
+ });
7
+ return e;
8
+ }, c = (n, r, a) => (a = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule ? t(a, "default", {
9
+ value: n,
10
+ enumerable: !0
11
+ }) : a, n));
12
+ //#endregion
13
+ export { c as n, o as t };