@verbb/formie-browser 1.0.3 → 1.0.5

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 (206) hide show
  1. package/CHANGELOG.md +65 -17
  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-CgVJcQ2P.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-CZ3FU5QO.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-BF5GU3_9.js +2674 -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-Cv8ADyk-.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-CpgqHCEx.js +463 -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-B09elPDB.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/utils-Vqp8i_RM.js +49401 -0
  70. package/dist/css/formie-theme.css +2 -0
  71. package/dist/css/theme/fields/_address-state.css +94 -0
  72. package/dist/css/theme/fields/_combobox.css +246 -0
  73. package/dist/css/theme/fields/_select.css +13 -0
  74. package/dist/index.js +2447 -39
  75. package/dist/js/core/create-formie-client.d.ts.map +1 -1
  76. package/dist/js/core/field-error-container.d.ts +4 -0
  77. package/dist/js/core/field-error-container.d.ts.map +1 -0
  78. package/dist/js/core/submit-result-state.d.ts.map +1 -1
  79. package/dist/js/core/submit-result-ui.d.ts.map +1 -1
  80. package/dist/js/core/validation-focus.d.ts +4 -0
  81. package/dist/js/core/validation-focus.d.ts.map +1 -0
  82. package/dist/js/modules/address/api.d.ts +1 -0
  83. package/dist/js/modules/address/api.d.ts.map +1 -1
  84. package/dist/js/modules/address/constants.d.ts +22 -1
  85. package/dist/js/modules/address/constants.d.ts.map +1 -1
  86. package/dist/js/modules/address/host.d.ts +2 -2
  87. package/dist/js/modules/address/host.d.ts.map +1 -1
  88. package/dist/js/modules/address/loqate.d.ts.map +1 -1
  89. package/dist/js/modules/fields/address-country.d.ts +3 -0
  90. package/dist/js/modules/fields/address-country.d.ts.map +1 -0
  91. package/dist/js/modules/fields/address-state.d.ts +3 -0
  92. package/dist/js/modules/fields/address-state.d.ts.map +1 -0
  93. package/dist/js/modules/fields/calculations.d.ts.map +1 -1
  94. package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -1
  95. package/dist/js/modules/fields/combobox.d.ts +17 -0
  96. package/dist/js/modules/fields/combobox.d.ts.map +1 -0
  97. package/dist/js/modules/fields/custom-google-maps.d.ts +64 -0
  98. package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -0
  99. package/dist/js/modules/fields/custom-link.d.ts +3 -0
  100. package/dist/js/modules/fields/custom-link.d.ts.map +1 -0
  101. package/dist/js/modules/fields/custom-maps.d.ts +3 -0
  102. package/dist/js/modules/fields/custom-maps.d.ts.map +1 -0
  103. package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
  104. package/dist/js/modules/fields/file-upload.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/text-limit.d.ts.map +1 -1
  108. package/dist/js/submit/pipeline.d.ts.map +1 -1
  109. package/dist/js/utils/country-from-ip.d.ts +7 -0
  110. package/dist/js/utils/country-from-ip.d.ts.map +1 -0
  111. package/dist/js/utils/field-references.d.ts +1 -0
  112. package/dist/js/utils/field-references.d.ts.map +1 -1
  113. package/dist/js/utils/field-references.row-scope.d.ts +11 -0
  114. package/dist/js/utils/field-references.row-scope.d.ts.map +1 -0
  115. package/dist/js/utils/i18n.d.ts.map +1 -1
  116. package/dist/js/validation/rules/email.d.ts.map +1 -1
  117. package/dist/js/validation/rules/number.d.ts.map +1 -1
  118. package/dist/js/validation/validator.d.ts.map +1 -1
  119. package/package.json +6 -3
  120. package/src/css/formie-theme.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/js/core/create-formie-client.ts +27 -0
  125. package/src/js/core/field-error-container.ts +39 -0
  126. package/src/js/core/submit-result-state.ts +12 -2
  127. package/src/js/core/submit-result-ui.ts +7 -13
  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/checkbox-radio.ts +21 -15
  137. package/src/js/modules/fields/combobox.ts +188 -0
  138. package/src/js/modules/fields/custom-google-maps.ts +416 -0
  139. package/src/js/modules/fields/custom-link.ts +95 -0
  140. package/src/js/modules/fields/custom-maps.ts +339 -0
  141. package/src/js/modules/fields/date-picker.ts +96 -3
  142. package/src/js/modules/fields/file-upload.ts +12 -9
  143. package/src/js/modules/fields/index.ts +6 -0
  144. package/src/js/modules/fields/phone-country.ts +6 -0
  145. package/src/js/modules/fields/text-limit.ts +87 -22
  146. package/src/js/submit/pipeline.ts +11 -1
  147. package/src/js/utils/country-from-ip.ts +54 -0
  148. package/src/js/utils/field-references.row-scope.ts +303 -0
  149. package/src/js/utils/field-references.ts +1 -0
  150. package/src/js/utils/i18n.ts +184 -5
  151. package/src/js/validation/rules/email.ts +3 -2
  152. package/src/js/validation/rules/match.ts +2 -2
  153. package/src/js/validation/rules/minmax.ts +4 -4
  154. package/src/js/validation/rules/number.ts +9 -5
  155. package/src/js/validation/rules/pattern.ts +4 -4
  156. package/src/js/validation/rules/required.ts +1 -1
  157. package/src/js/validation/rules/url.ts +1 -1
  158. package/src/js/validation/validator.ts +7 -7
  159. package/dist/chunks/address-finder-BjMuEiwF.js +0 -37
  160. package/dist/chunks/bpoint-KudsBCo2.js +0 -26
  161. package/dist/chunks/calculations-DlGSkQ3W.js +0 -147
  162. package/dist/chunks/captcha-eu-CterYFok.js +0 -34
  163. package/dist/chunks/checkbox-radio-CBvgk3hR.js +0 -136
  164. package/dist/chunks/conditions-DYy1-Hwt.js +0 -459
  165. package/dist/chunks/date-picker-BlD--zfe.js +0 -4994
  166. package/dist/chunks/eway-qwc-B5Us.js +0 -74
  167. package/dist/chunks/file-upload-CIgHrXfp.js +0 -316
  168. package/dist/chunks/friendly-captcha-v1-EDFac33c.js +0 -33
  169. package/dist/chunks/friendly-captcha-v2-BDpSvFGR.js +0 -38
  170. package/dist/chunks/go-cardless-DuDMVsnz.js +0 -24
  171. package/dist/chunks/google-address-Bmjp01pH.js +0 -181
  172. package/dist/chunks/hcaptcha-BTQ6An6g.js +0 -56
  173. package/dist/chunks/hidden-DbPdOxKb.js +0 -31
  174. package/dist/chunks/index-BEsfee-D.js +0 -1839
  175. package/dist/chunks/index-BP7Unm5Y.js +0 -863
  176. package/dist/chunks/index-BcqwpPNE.js +0 -4314
  177. package/dist/chunks/loqate-BdNGv93o.js +0 -55
  178. package/dist/chunks/mollie-DFOjTuGX.js +0 -24
  179. package/dist/chunks/moneris-BbFfl-EL.js +0 -101
  180. package/dist/chunks/opayo-CmgYa9ya.js +0 -122
  181. package/dist/chunks/paddle-BUi7w1_o.js +0 -60
  182. package/dist/chunks/paypal-A-ePfh6k.js +0 -100
  183. package/dist/chunks/payway-BqFCbhyo.js +0 -56
  184. package/dist/chunks/phone-country-DPMiqk4L.js +0 -3765
  185. package/dist/chunks/place-kit-CX7tamAg.js +0 -42
  186. package/dist/chunks/placekit-autocomplete.esm-LAwfbPZl.js +0 -1299
  187. package/dist/chunks/recaptcha-enterprise-DxF6cW95.js +0 -71
  188. package/dist/chunks/recaptcha-shared-DhGcbiaq.js +0 -15
  189. package/dist/chunks/recaptcha-v2-checkbox-R9EfbZ4k.js +0 -41
  190. package/dist/chunks/recaptcha-v2-invisible-DV9hswAp.js +0 -59
  191. package/dist/chunks/recaptcha-v3-V0xc-Edh.js +0 -28
  192. package/dist/chunks/repeater-DKUT6TGI.js +0 -124
  193. package/dist/chunks/rich-text-SH7KiaKH.js +0 -304
  194. package/dist/chunks/scripts-D9N2d5rN.js +0 -36
  195. package/dist/chunks/sdk-3SicTWby.js +0 -1559
  196. package/dist/chunks/shared-BmntPmnW.js +0 -80
  197. package/dist/chunks/signature-BA3tQsGT.js +0 -550
  198. package/dist/chunks/snaptcha-DV7p6J9k.js +0 -8
  199. package/dist/chunks/square-Bs-ndqYK.js +0 -46
  200. package/dist/chunks/stripe-DkZAHxtn.js +0 -202
  201. package/dist/chunks/styles-C3aqgtek.js +0 -21
  202. package/dist/chunks/summary-Dq2i9TQk.js +0 -126
  203. package/dist/chunks/table-Cu4WfVcw.js +0 -95
  204. package/dist/chunks/text-limit-2ycmB-Ae.js +0 -135
  205. package/dist/chunks/turnstile-CId90tRr.js +0 -59
  206. package/dist/chunks/utils-BntI3W4S.js +0 -6149
@@ -1,202 +0,0 @@
1
- import { u as I, v as C, x as E, y as g } from "./index-BcqwpPNE.js";
2
- import { e as P } from "./styles-C3aqgtek.js";
3
- import { l as A } from "./scripts-D9N2d5rN.js";
4
- const R = "@layer formie-theme{.formie-stripe-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--formie-space-2);min-height:12rem;width:100%;padding:var(--formie-space-4);border:var(--formie-border-width) solid var(--formie-color-border);border-radius:var(--formie-radius-sm);background:var(--formie-color-surface);color:var(--formie-color-text-muted);text-align:center;box-sizing:border-box}.formie-stripe-placeholder[hidden]{display:none}}";
5
- P("stripe", [R]);
6
- const L = "FORMIE_STRIPE_SCRIPT", U = C("stripe", "confirm"), F = "[data-formie-stripe-elements-placeholder]", w = /* @__PURE__ */ new Set([
7
- "BIF",
8
- "CLP",
9
- "DJF",
10
- "GNF",
11
- "JPY",
12
- "KMF",
13
- "KRW",
14
- "MGA",
15
- "PYG",
16
- "RWF",
17
- "UGX",
18
- "VND",
19
- "VUV",
20
- "XAF",
21
- "XOF",
22
- "XPF"
23
- ]);
24
- function M(r, e) {
25
- return w.has(e.toUpperCase()) ? Math.ceil(r) : Math.ceil(r * 100);
26
- }
27
- function b(r, e) {
28
- r && (g(r, e, "fieldErrors", "fieldError"), r.querySelectorAll("[data-payment-placeholder-error]").forEach((s) => {
29
- g(s, e, "fieldError");
30
- }));
31
- }
32
- function T(r, e, s = "Loading payment options...") {
33
- if (!r)
34
- return;
35
- b(r, e), r.removeAttribute("hidden"), r.innerHTML = "";
36
- const i = document.createElement("div");
37
- i.className = "formie-loading";
38
- const t = document.createElement("div");
39
- t.textContent = s, r.append(i, t);
40
- }
41
- function v(r, e, s) {
42
- if (!r)
43
- return;
44
- b(r, e), r.removeAttribute("hidden"), E(r, e, "fieldErrors"), r.innerHTML = "";
45
- const i = document.createElement("div");
46
- i.setAttribute("data-payment-placeholder-error", ""), i.textContent = s, E(i, e, "fieldError"), r.appendChild(i);
47
- }
48
- const k = I({
49
- id: "stripe",
50
- defaultRequiredInputSuffixes: ["stripePaymentIntentId"],
51
- load: async (r) => {
52
- const { provider: e } = r.options, s = e.publishableKey;
53
- return s?.trim() ? (await A("Stripe", {
54
- id: L,
55
- src: "https://js.stripe.com/v3"
56
- }))(s) : (console.error("[formie] Missing publishableKey for Stripe."), null);
57
- },
58
- mount: async (r) => {
59
- const { api: e, field: s, services: i, provider: t } = r, u = s.querySelector("[data-formie-stripe-elements]"), a = s.querySelector(F), d = s, c = i.form || i.root;
60
- if (!u || !e)
61
- return null;
62
- const l = t.initialPaymentInformation || {}, _ = [l.amount, l.currency].map((o) => String(o ?? "").trim()).filter((o, n) => (n === 0 ? t.amountType : t.currencyType) === "dynamic" && o !== ""), y = () => {
63
- const o = i.resolveAmount({ value: l.amount });
64
- if (!o.ok)
65
- return {
66
- ok: !1,
67
- error: "error" in o ? o.error : "Provide a payment amount to proceed."
68
- };
69
- const n = i.resolveCurrency({ value: l.currency });
70
- if (!n.ok)
71
- return {
72
- ok: !1,
73
- error: "error" in n ? n.error : "Provide a payment currency to proceed."
74
- };
75
- const m = n.value.toLowerCase(), p = t.amountType === "dynamic" ? M(o.value, m) : o.value;
76
- return {
77
- ok: !0,
78
- value: {
79
- ...l,
80
- capture_method: "automatic",
81
- mode: t.paymentType === "subscription" ? "subscription" : "payment",
82
- appearance: {},
83
- amount: p,
84
- currency: m
85
- }
86
- };
87
- }, S = () => {
88
- try {
89
- d.__formieStripeWidget?.paymentElement?.destroy?.();
90
- } catch {
91
- }
92
- d.__formieStripeWidget = null, d.__formieStripeElements = void 0, u.innerHTML = "";
93
- }, f = () => {
94
- const o = y();
95
- if (!o.ok) {
96
- S(), v(
97
- a,
98
- c,
99
- "error" in o ? o.error : "Unable to resolve payment details."
100
- );
101
- return;
102
- }
103
- try {
104
- if (d.__formieStripeWidget && d.__formieStripeElements) {
105
- d.__formieStripeElements.update(o.value), b(a, c), a?.setAttribute("hidden", "hidden");
106
- return;
107
- }
108
- T(a, c);
109
- const n = e.elements(o.value), m = n.create("payment", {});
110
- m.mount(u), m.on?.("loaderror", (p) => {
111
- const h = p?.error?.message || "Unable to load payment options.";
112
- S(), v(a, c, h);
113
- }), m.on?.("ready", () => {
114
- b(a, c), a?.setAttribute("hidden", "hidden");
115
- }), d.__formieStripeElements = n, d.__formieStripeInstance = e, d.__formieStripeWidget = { elements: n, paymentElement: m }, m.on || (b(a, c), a?.setAttribute("hidden", "hidden"));
116
- } catch (n) {
117
- S(), v(
118
- a,
119
- c,
120
- n instanceof Error ? n.message : "Unable to initialize Stripe payment element."
121
- );
122
- }
123
- };
124
- return d.__formieStripeEvaluateAndRender = f, d.__formieStripeDynamicUnbind?.(), _.length > 0 && (d.__formieStripeDynamicUnbind = i.watchFieldValueChanges(_, () => {
125
- f();
126
- }, 600)), f(), d.__formieStripeWidget || null;
127
- },
128
- unmount: async (r) => {
129
- r.widget?.paymentElement?.destroy();
130
- const e = r.field;
131
- e.__formieStripeWidget = null, e.__formieStripeElements = void 0, e.__formieStripeInstance = null, e.__formieStripeLastClientSecret = void 0, e.__formieStripeEvaluateAndRender = null, e.__formieStripeDynamicUnbind?.(), e.__formieStripeDynamicUnbind = null;
132
- },
133
- onBeforeAuthorize: async (r) => {
134
- const { widget: e, services: s, field: i } = r, t = i;
135
- let u = e;
136
- if (u?.elements || (t.__formieStripeEvaluateAndRender?.(), u = t.__formieStripeWidget || null), !u?.elements)
137
- return !1;
138
- const a = await u.elements.submit();
139
- return a?.error ? (s.addError(a.error.message), !1) : !0;
140
- },
141
- setup: async (r) => {
142
- const { services: e, options: s } = r, i = s.provider, t = r.target, u = async (d) => {
143
- try {
144
- const l = d.detail?.data;
145
- if (!l?.clientSecret || t.__formieStripeConfirming || t.__formieStripeLastClientSecret === l.clientSecret)
146
- return;
147
- const _ = t.__formieStripeElements;
148
- if (!_) {
149
- e.addError("Stripe elements not ready for 3DS.");
150
- return;
151
- }
152
- const y = t.__formieStripeInstance, S = i.publishableKey;
153
- if (!y || !S) {
154
- e.addError("Stripe is not initialized.");
155
- return;
156
- }
157
- t.__formieStripeConfirming = !0;
158
- const f = new URL(l.returnUrl || window.location.href);
159
- f.searchParams.set("origin", window.location.href);
160
- const n = await (l.type === "setup" ? y.confirmSetup : y.confirmPayment)({
161
- elements: _,
162
- clientSecret: l.clientSecret,
163
- redirect: "if_required",
164
- confirmParams: { return_url: f.toString() }
165
- });
166
- if (n?.error) {
167
- e.releaseSubmitLoading(), e.addError(n.error.message);
168
- return;
169
- }
170
- l.subscriptionId && e.updateInputs("stripeSubscriptionId", l.subscriptionId);
171
- const m = n && "paymentIntent" in n ? n.paymentIntent : null, p = n && "setupIntent" in n ? n.setupIntent : null;
172
- if (m?.id)
173
- e.updateInputs("stripePaymentIntentId", m.id);
174
- else if (p?.id)
175
- e.updateInputs("stripePaymentIntentId", p.id);
176
- else {
177
- e.releaseSubmitLoading(), e.addError("Stripe confirmation did not return an intent ID.");
178
- return;
179
- }
180
- t.__formieStripeLastClientSecret = l.clientSecret, e.triggerSubmit();
181
- } catch (c) {
182
- e.releaseSubmitLoading(), e.addError(c instanceof Error ? c.message : "Unable to confirm Stripe payment.");
183
- } finally {
184
- t.__formieStripeConfirming = !1;
185
- }
186
- };
187
- t.__formieStripeConfirmUnbind?.();
188
- const a = e.events.onForm(U, u);
189
- return t.__formieStripeConfirmUnbind = a, {
190
- destroy: () => {
191
- t.__formieStripeConfirmUnbind?.(), t.__formieStripeConfirmUnbind = null;
192
- }
193
- };
194
- },
195
- onAfterSubmit: async (r) => {
196
- const e = r.field;
197
- r.result?.ok && !r.result?.nextPage && (e.__formieStripeWidget?.paymentElement?.destroy?.(), e.__formieStripeWidget = null, e.__formieStripeElements = void 0, r.services.updateInputs(["stripePaymentIntentId", "stripeSubscriptionId"], ""), e.__formieStripeLastClientSecret = void 0);
198
- }
199
- });
200
- export {
201
- k as stripeModule
202
- };
@@ -1,21 +0,0 @@
1
- const t = /* @__PURE__ */ new Set();
2
- function l(n, r) {
3
- if (typeof document > "u")
4
- return;
5
- const e = `formie-module-style:${n}`;
6
- if (t.has(e) || document.querySelector(`style[data-formie-module-style="${n}"]`)) {
7
- t.add(e);
8
- return;
9
- }
10
- const d = r.filter((s) => typeof s == "string" && s.trim().length > 0).join(`
11
- `);
12
- if (!d) {
13
- t.add(e);
14
- return;
15
- }
16
- const o = document.createElement("style");
17
- o.setAttribute("data-formie-module-style", n), o.textContent = d, document.head.appendChild(o), t.add(e);
18
- }
19
- export {
20
- l as e
21
- };
@@ -1,126 +0,0 @@
1
- import { g as H, d as M } from "./shared-BmntPmnW.js";
2
- import { e as I } from "./styles-C3aqgtek.js";
3
- import { h as x, t as L, p as V, q as z } from "./index-BcqwpPNE.js";
4
- const N = '@layer formie-theme{.formie-summary-container{padding:var(--formie-summary-padding);border:var(--formie-border-width) solid var(--formie-color-border);border-radius:var(--formie-radius-sm)}.formie-summary-heading{color:var(--formie-color-heading)}.formie-summary-blocks{display:grid;gap:var(--formie-gap-summary)}.formie-summary-blocks[data-formie-loading=true]{position:relative;min-height:calc(var(--formie-loading-size) + var(--formie-space-4))}.formie-summary-blocks[data-formie-loading=true]>*{opacity:0;pointer-events:none}.formie-summary-blocks[data-formie-loading=true]:before{position:absolute;inset:0;content:"";display:block;background:var(--formie-color-bg);border-radius:inherit;z-index:1}.formie-summary-blocks[data-formie-loading=true]:after{position:absolute;top:50%;left:50%;width:var(--formie-loading-size);height:var(--formie-loading-size);content:"";display:block;border:var(--formie-loading-border-width) solid var(--formie-loading-color);border-top-color:transparent;border-right-color:transparent;border-radius:var(--formie-radius-full);transform:translate(-50%,-50%);z-index:2;animation:formie-loading-spin var(--formie-loading-speed) linear infinite}}', C = "[data-formie-summary-blocks]", q = "[data-formie-summary-container]", U = "formie/fields/get-summary-html", b = "summary", i = x("fields", "summary");
5
- I(b, [N]);
6
- function _() {
7
- const e = new URL(window.location.href);
8
- return e.hash = "", e.toString();
9
- }
10
- function w(e) {
11
- return {
12
- accessToken: e.querySelector("[data-formie-summary-token]")?.value?.trim() || null
13
- };
14
- }
15
- async function P(e, n, t) {
16
- if (!n.accessToken)
17
- throw new Error("Summary field requires an access token.");
18
- const m = new FormData(e);
19
- return m.set("action", U), m.set("accessToken", n.accessToken), z(_(), {
20
- method: "POST",
21
- body: m,
22
- signal: t,
23
- headers: {
24
- Accept: "text/html"
25
- }
26
- });
27
- }
28
- function B(e, n) {
29
- const t = e.closest("form");
30
- if (!(t instanceof HTMLFormElement))
31
- return i.warn("Missing form ancestor; skipping field."), () => {
32
- };
33
- let m = !1, a = !0, h = !1, l = 0, d = 0, u = null;
34
- const v = () => {
35
- const r = e.querySelector(C);
36
- return r instanceof HTMLElement ? r : null;
37
- }, F = () => {
38
- const r = e.querySelector(q);
39
- return r instanceof HTMLElement ? r : null;
40
- }, f = (r) => {
41
- const o = v();
42
- if (o) {
43
- if (r) {
44
- o.setAttribute("data-formie-loading", "true"), o.setAttribute("aria-busy", "true"), L(o, t, "loading", !0);
45
- return;
46
- }
47
- o.removeAttribute("data-formie-loading"), o.removeAttribute("aria-busy"), L(o, t, "loading", !1);
48
- }
49
- }, A = w(e);
50
- f(!!A.accessToken);
51
- const c = () => {
52
- !h || m && !a || (i.log("Queueing fetch."), R());
53
- }, R = V(async () => {
54
- const r = w(e);
55
- if (!v() || !r.accessToken) {
56
- i.warn("Missing state for fetch.", r), f(!1);
57
- return;
58
- }
59
- d += 1;
60
- const o = d, O = l;
61
- u?.abort(), u = new AbortController(), f(!0);
62
- try {
63
- const s = await P(t, r, u.signal);
64
- if (o !== d)
65
- return;
66
- const y = F(), S = document.createElement("template");
67
- S.innerHTML = s.trim();
68
- const T = S.content.querySelector(q);
69
- y && T instanceof HTMLElement ? y.replaceWith(T) : y && (y.innerHTML = s), m = !0, a = l !== O, i.log("Fetch complete.", {
70
- isDirty: a,
71
- dirtyVersion: l,
72
- requestVersion: o
73
- }), M(e, b, "fetch-summary", {
74
- summary: e,
75
- html: s
76
- });
77
- } catch (s) {
78
- if (s instanceof DOMException && s.name === "AbortError") {
79
- i.log("Fetch aborted.");
80
- return;
81
- }
82
- console.error("[formie] Failed to load summary field HTML.", s);
83
- } finally {
84
- o === d && (f(!1), u = null, a && c());
85
- }
86
- }, 300), D = (r) => {
87
- const o = r?.target;
88
- o instanceof Node && e.contains(o) || (a = !0, l += 1, i.log("Marked dirty.", { dirtyVersion: l }));
89
- }, g = (r) => {
90
- D(r), c();
91
- }, p = () => {
92
- a = !0, i.log("Submit result received; refreshing."), c();
93
- }, k = () => {
94
- a = !0, i.log("Page navigation received; refreshing."), c();
95
- }, E = new IntersectionObserver((r) => {
96
- h = !!r[0]?.isIntersecting, h && (i.log("Field became visible."), M(e, b, "field-visible", {
97
- summary: e
98
- }), c());
99
- }, {
100
- root: t,
101
- rootMargin: "50px"
102
- });
103
- return E.observe(e), t.addEventListener("input", g), t.addEventListener("change", g), n.addEventListener("formie:page:navigate:after", k), n.addEventListener("formie:submit:result", p), () => {
104
- u?.abort(), E.disconnect(), t.removeEventListener("input", g), t.removeEventListener("change", g), n.removeEventListener("formie:page:navigate:after", k), n.removeEventListener("formie:submit:result", p), i.log("Field destroyed.");
105
- };
106
- }
107
- const Y = {
108
- id: b,
109
- kind: "field",
110
- match: (e) => !!e.target.querySelector(C),
111
- setup: async (e) => {
112
- const n = H(e).map((t) => B(t, e.root));
113
- return i.log("Module setup.", { fieldCount: n.length }), await e.emit("formie:module:summary:init", {
114
- count: n.length
115
- }), {
116
- destroy: () => {
117
- n.forEach((t) => {
118
- t();
119
- }), i.log("Module destroy.", { fieldCount: n.length }), e.emit("formie:module:summary:destroy", {});
120
- }
121
- };
122
- }
123
- };
124
- export {
125
- Y as summaryModule
126
- };
@@ -1,95 +0,0 @@
1
- import { d as h, b as L, c as A } from "./shared-BmntPmnW.js";
2
- import { e as M } from "./styles-C3aqgtek.js";
3
- import { s as R } from "./index-BcqwpPNE.js";
4
- const S = '@layer formie-theme{.formie-table-wrapper{max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}.formie-table{width:var(--formie-table-width);margin-bottom:var(--formie-table-margin-bottom);border-collapse:var(--formie-table-border-collapse)}.formie-table th{text-align:var(--formie-table-th-text-align);font-size:var(--formie-table-th-font-size);font-weight:var(--formie-table-th-font-weight);color:var(--formie-table-th-color, var(--formie-gray-500))}.formie-table th,.formie-table td{padding:var(--formie-table-row-padding);vertical-align:top}.formie-table th:first-child,.formie-table td:first-child{padding-left:0}.formie-table th:last-child,.formie-table td:last-child{padding-right:0}.formie-table [data-col-remove]{width:calc(var(--formie-button-icon-button-size) + (var(--formie-table-row-padding) * 2));min-width:calc(var(--formie-button-icon-button-size) + (var(--formie-table-row-padding) * 2));white-space:nowrap;text-align:center;vertical-align:middle}.formie-table [data-formie-table-column-type=checkbox]{text-align:center;vertical-align:middle}.formie-table [data-formie-table-column-type=checkbox] .formie-checkbox-option{display:flex;align-items:center;justify-content:center;width:100%;min-height:var(--formie-check-size);margin:0}.formie-table [data-formie-table-column-type=checkbox] .formie-checkbox-option-label{display:block;width:var(--formie-check-size);min-width:var(--formie-check-size);height:var(--formie-check-size);margin:0 auto;padding-left:0;font-size:0;line-height:0}.formie-table [data-formie-table-column-type=checkbox] .formie-checkbox-option-label:before{position:static}.formie-table-color-input{min-width:4rem;padding:var(--formie-space-1)}.formie-table-multiline-input{min-height:calc(var(--formie-control-height) + var(--formie-space-2))}.formie-table-remove-button{display:inline-flex;vertical-align:middle}.formie-button.formie-table-add-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:auto;max-width:100%;justify-self:start;padding-left:var(--formie-table-add-button-padding-left)}.formie-button.formie-table-add-button:before{position:absolute;content:"";display:block;width:var(--formie-table-add-button-width);height:var(--formie-table-add-button-height);left:var(--formie-table-add-button-left);top:50%;transform:translateY(-50%);background-color:currentColor;-webkit-mask-image:var(--formie-table-add-button-icon-mask);mask-image:var(--formie-table-add-button-icon-mask);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:contain;mask-size:contain}}', b = "[data-formie-table-field-layout]", H = "[data-formie-table]", _ = "[data-formie-table-body]", g = "[data-formie-table-row]", x = "[data-formie-table-add]", O = "[data-formie-table-remove]", y = "data-formie-template-id", k = "data-formie-table-row-id", s = "table";
5
- M(s, [S]);
6
- function z(e, o) {
7
- return A(e, o);
8
- }
9
- function c(e) {
10
- return e.querySelectorAll(g).length;
11
- }
12
- function B(e) {
13
- return Array.from(e.querySelectorAll(g)).reduce((o, r) => {
14
- const i = parseInt(r.getAttribute(k) || "", 10);
15
- return Number.isNaN(i) ? o : Math.max(o, i + 1);
16
- }, 0);
17
- }
18
- function p(e, o) {
19
- if (!e)
20
- return;
21
- const r = parseInt(e.getAttribute("data-formie-max-rows") || "", 10);
22
- e.disabled = r > 0 && o >= r;
23
- }
24
- function C(e, o) {
25
- const r = e.querySelector(H), i = e.querySelector(_), t = e.querySelector(x);
26
- if (!(r instanceof HTMLElement) || !(i instanceof HTMLElement))
27
- return () => {
28
- };
29
- const u = /* @__PURE__ */ new Map();
30
- let v = B(e);
31
- const w = () => {
32
- e.querySelectorAll(O).forEach((a) => {
33
- if (!(a instanceof HTMLElement) || u.has(a))
34
- return;
35
- const n = (d) => {
36
- d.preventDefault();
37
- const l = a.closest(g);
38
- if (!(l instanceof HTMLElement))
39
- return;
40
- const f = parseInt((t instanceof HTMLButtonElement ? t.getAttribute("data-formie-min-rows") : "") || "", 10);
41
- f > 0 && c(e) <= f || (l.remove(), p(t instanceof HTMLButtonElement ? t : null, c(e)), h(e, s, "remove", {
42
- table: e,
43
- row: l
44
- }));
45
- };
46
- a.addEventListener("click", n), u.set(a, n);
47
- });
48
- }, T = async () => {
49
- if (o.static || !(t instanceof HTMLButtonElement) || !t.getAttribute("data-formie-table-add"))
50
- return;
51
- const n = t.getAttribute(y) || e.getAttribute(y), d = parseInt(t.getAttribute("data-formie-max-rows") || "", 10);
52
- if (d > 0 && c(e) >= d)
53
- return;
54
- const l = z(e, n);
55
- if (!l)
56
- return;
57
- const f = L(l).replaceAll("__ROW__", String(v++)), m = document.createElement("tr");
58
- m.setAttribute("data-formie-table-row", "true"), m.setAttribute(k, String(v - 1)), m.innerHTML = f, i.appendChild(m), await R(50), w(), p(t, c(e)), h(e, s, "append", {
59
- table: e,
60
- row: m
61
- });
62
- }, E = (a) => {
63
- a.preventDefault(), T();
64
- };
65
- return t instanceof HTMLButtonElement && !o.static && t.addEventListener("click", E), w(), p(t instanceof HTMLButtonElement ? t : null, c(e)), h(e, s, "init", {
66
- table: e
67
- }), () => {
68
- t instanceof HTMLButtonElement && t.removeEventListener("click", E), u.forEach((a, n) => {
69
- n.removeEventListener("click", a);
70
- });
71
- };
72
- }
73
- const N = {
74
- id: s,
75
- kind: "field",
76
- match: (e) => e.target instanceof HTMLElement && (e.target.matches(b) || !!e.target.querySelector(b)),
77
- setup: async (e) => {
78
- const o = e.options || {};
79
- if (!(e.target instanceof HTMLElement))
80
- return;
81
- const r = e.target.matches(b) ? [e.target] : Array.from(e.target.querySelectorAll(b)).filter((t) => t instanceof HTMLElement), i = r.map((t) => C(t, o));
82
- return await e.emit("formie:module:table:init", {
83
- count: r.length
84
- }), {
85
- destroy: () => {
86
- i.forEach((t) => {
87
- t();
88
- }), e.emit("formie:module:table:destroy", {});
89
- }
90
- };
91
- }
92
- };
93
- export {
94
- N as tableModule
95
- };
@@ -1,135 +0,0 @@
1
- import { z as u } from "./index-BEsfee-D.js";
2
- import { f as L, r as w, a as T } from "./shared-BmntPmnW.js";
3
- import { e as v } from "./styles-C3aqgtek.js";
4
- const C = "@layer formie-theme{.formie-limit-number{font-weight:var(--formie-font-weight-semibold);color:var(--formie-color-text)}.formie-limit-number-error{color:var(--formie-color-danger)}}", c = "input[data-formie-single-line-text-input], textarea[data-formie-multi-line-text-input]", E = [
5
- "textMinCharacterLimit",
6
- "textMaxCharacterLimit",
7
- "textMinWordLimit",
8
- "textMaxWordLimit"
9
- ], A = "text-limit", f = "data-formie-text-limit-allow-overtype", n = /* @__PURE__ */ new WeakMap();
10
- v("text-limit", [C]);
11
- function d(t) {
12
- return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement;
13
- }
14
- function m(t, i) {
15
- return parseInt(t.getAttribute(i) || "", 10) || 0;
16
- }
17
- function M(t) {
18
- return t.hasAttribute("data-formie-min-chars") || t.hasAttribute("data-formie-max-chars") || t.hasAttribute("data-formie-min-words") || t.hasAttribute("data-formie-max-words");
19
- }
20
- function y(t) {
21
- return t.hasAttribute("data-formie-max-chars") || t.hasAttribute("data-formie-max-words");
22
- }
23
- function h(t) {
24
- return t.hasAttribute(f);
25
- }
26
- function x(t) {
27
- return t.value === "";
28
- }
29
- function V(t) {
30
- w(t, A, (i) => {
31
- i.addValidator("textMinCharacterLimit", ({ input: e }) => {
32
- if (!d(e))
33
- return !0;
34
- const r = m(e, "data-formie-min-chars");
35
- return !r || x(e) ? !0 : u(e.value).graphemeCount >= r;
36
- }, ({ label: e, input: r, t: a }) => a("{attribute} must be no less than {min} characters.", {
37
- attribute: e,
38
- min: r.getAttribute("data-formie-min-chars") || ""
39
- })), i.addValidator("textMaxCharacterLimit", ({ input: e }) => {
40
- if (!d(e) || h(e))
41
- return !0;
42
- const r = m(e, "data-formie-max-chars");
43
- return !r || x(e) ? !0 : u(e.value).graphemeCount <= r;
44
- }, ({ label: e, input: r, t: a }) => a("{attribute} must be no greater than {max} characters.", {
45
- attribute: e,
46
- max: r.getAttribute("data-formie-max-chars") || ""
47
- })), i.addValidator("textMinWordLimit", ({ input: e }) => {
48
- if (!d(e))
49
- return !0;
50
- const r = m(e, "data-formie-min-words");
51
- return !r || e.value.trim() === "" ? !0 : u(e.value).wordCount >= r;
52
- }, ({ label: e, input: r, t: a }) => a("{attribute} must be no less than {min} words.", {
53
- attribute: e,
54
- min: r.getAttribute("data-formie-min-words") || ""
55
- })), i.addValidator("textMaxWordLimit", ({ input: e }) => {
56
- if (!d(e) || h(e))
57
- return !0;
58
- const r = m(e, "data-formie-max-words");
59
- return !r || e.value.trim() === "" ? !0 : u(e.value).wordCount <= r;
60
- }, ({ label: e, input: r, t: a }) => a("{attribute} must be no greater than {max} words.", {
61
- attribute: e,
62
- max: r.getAttribute("data-formie-max-words") || ""
63
- }));
64
- });
65
- }
66
- function I(t) {
67
- T(t, A, E);
68
- }
69
- function O(t) {
70
- if (n.has(t))
71
- return n.get(t) || null;
72
- const i = t.closest("[data-formie-field-handle]");
73
- if (!i)
74
- return n.set(t, null), null;
75
- const e = i.querySelector("[data-formie-limit-text]");
76
- if (e)
77
- return n.set(t, e), e;
78
- const r = i.querySelector("[data-formie-field-control]"), a = document.createElement("div");
79
- return a.className = "formie-field-limit formie-limit-text", a.setAttribute("data-formie-field-limit", "true"), a.setAttribute("data-formie-limit-text", "true"), r?.parentElement ? (r.insertAdjacentElement("afterend", a), n.set(t, a), a) : (i.appendChild(a), n.set(t, a), a);
80
- }
81
- function b(t, i, e) {
82
- const r = document.createElement("span");
83
- r.className = i < 0 ? "formie-limit-number formie-limit-number-error" : "formie-limit-number", r.textContent = String(i), t.replaceChildren(
84
- r,
85
- document.createTextNode(` ${Math.abs(i) === 1 ? e : `${e}s`} left`)
86
- );
87
- }
88
- function g(t) {
89
- const i = m(t, "data-formie-max-chars"), e = m(t, "data-formie-max-words"), r = O(t);
90
- if (!r)
91
- return;
92
- const a = u(t.value);
93
- if (i > 0) {
94
- const s = i - a.graphemeCount;
95
- b(r, s, "character");
96
- return;
97
- }
98
- if (e > 0) {
99
- const s = e - a.wordCount;
100
- b(r, s, "word");
101
- }
102
- }
103
- const _ = {
104
- id: "text-limit",
105
- kind: "field",
106
- match: (t) => !!t.target.querySelector(c),
107
- setup: async (t) => {
108
- const i = t.options || {}, e = L(t), r = Array.from((e || t.target).querySelectorAll(c)).filter((o) => (o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement) && M(o)), a = r.filter((o) => y(o));
109
- i.allowOvertype && r.forEach((o) => {
110
- o.setAttribute(f, "true");
111
- }), V(t.form);
112
- const s = a.map((o) => {
113
- const l = () => {
114
- g(o);
115
- };
116
- return o.addEventListener("input", l), o.addEventListener("change", l), g(o), () => {
117
- o.removeEventListener("input", l), o.removeEventListener("change", l);
118
- };
119
- });
120
- return await t.emit("formie:module:text-limit:init", {
121
- count: r.length
122
- }), {
123
- destroy: () => {
124
- s.forEach((o) => {
125
- o();
126
- }), i.allowOvertype && r.forEach((o) => {
127
- o.removeAttribute(f);
128
- }), I(t.form), t.emit("formie:module:text-limit:destroy", {});
129
- }
130
- };
131
- }
132
- };
133
- export {
134
- _ as textLimitModule
135
- };
@@ -1,59 +0,0 @@
1
- import { a as s, c as u, f as i, b as d, C as p } from "./index-BcqwpPNE.js";
2
- import { l as f } from "./scripts-D9N2d5rN.js";
3
- function m(e) {
4
- const r = e.appearance || "always";
5
- return (e.execution || (r === "execute" ? "execute" : "render")) === "execute" ? u : i;
6
- }
7
- async function _(e) {
8
- const { async: r, defer: t } = d(e.loadingMethod);
9
- return f("turnstile", {
10
- id: "FORMIE_TURNSTILE_SCRIPT",
11
- src: "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",
12
- async: r,
13
- defer: t,
14
- timeoutMs: p
15
- });
16
- }
17
- const A = s({
18
- id: "turnstile",
19
- defaultPlaceholderSelector: "[data-turnstile-placeholder]",
20
- defaultTokenFieldNames: ["cf-turnstile-response"],
21
- load: ({ options: e }) => _(e.provider),
22
- mount: ({ api: e, container: r, provider: t, services: a }) => {
23
- const l = t.appearance || "always", o = t.execution || (l === "execute" ? "execute" : "render");
24
- return e.render(r, {
25
- sitekey: t.siteKey || "",
26
- theme: t.theme || "auto",
27
- size: t.size || "normal",
28
- appearance: l,
29
- execution: o,
30
- callback: (n) => {
31
- typeof n == "string" && n.trim() !== "" && a.tokens.write(n.trim()), a.errors.clear();
32
- },
33
- "expired-callback": () => {
34
- a.tokens.clear(), a.errors.clear();
35
- },
36
- "timeout-callback": () => {
37
- a.tokens.clear(), a.errors.clear();
38
- },
39
- "error-callback": () => {
40
- a.tokens.clear();
41
- }
42
- });
43
- },
44
- screen: ({ api: e, widget: r, placeholder: t, services: a, provider: l, stageCtx: o }) => {
45
- if (!a.tokens.has())
46
- return e.execute(r), a.tokens.wait(m(l)).then((n) => {
47
- if (!n) {
48
- const c = a.errors.getDefaultMessage();
49
- a.errors.show(c, t), o.abort(c);
50
- }
51
- });
52
- },
53
- unmount: ({ api: e, widget: r, services: t }) => {
54
- e.reset(r), t.tokens.clear();
55
- }
56
- });
57
- export {
58
- A as turnstileModule
59
- };