@verbb/formie-browser 1.0.5 → 1.0.7
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.
- package/CHANGELOG.md +25 -0
- package/dist/chunks/{address-finder-yXU5yMjG.js → address-finder-k7_BXaRe.js} +1 -1
- package/dist/chunks/{api-DMK8NSUI.js → api-BUb6P-xu.js} +57 -51
- package/dist/chunks/{api-CmwLRq_n.js → api-DztsCJ4r.js} +178 -170
- package/dist/chunks/{bpoint-DSjqRv63.js → bpoint-2qDxlKD9.js} +1 -1
- package/dist/chunks/{calculations-CgVJcQ2P.js → calculations-CeDgB9jt.js} +13 -13
- package/dist/chunks/{captcha-eu-CWJb64_j.js → captcha-eu-CGm8Lbrj.js} +2 -2
- package/dist/chunks/{conditions-CZ3FU5QO.js → conditions-B6_nzpeE.js} +97 -85
- package/dist/chunks/dist-BQ4a9hmy.js +2659 -0
- package/dist/chunks/{eway-D3ctTbEk.js → eway-CImXrB4g.js} +2 -2
- package/dist/chunks/{friendly-captcha-v1-ByXzENYZ.js → friendly-captcha-v1-C_2reOXr.js} +1 -1
- package/dist/chunks/{friendly-captcha-v2-BPdlmhQu.js → friendly-captcha-v2-CLSAbkqx.js} +1 -1
- package/dist/chunks/{go-cardless-BwASSYSK.js → go-cardless-Bz7HHtH0.js} +1 -1
- package/dist/chunks/{google-address-OhKilPWE.js → google-address-BH3Zhi06.js} +1 -1
- package/dist/chunks/{hcaptcha-CdCd9oEi.js → hcaptcha-CGLAmgjO.js} +2 -2
- package/dist/chunks/{loqate-Cp2zvwpE.js → loqate-CJPzBmSm.js} +1 -1
- package/dist/chunks/{mollie-COG-ko2D.js → mollie-BtnB3KGh.js} +1 -1
- package/dist/chunks/{moneris-CMH8PlRc.js → moneris-Bd4vUk8b.js} +1 -1
- package/dist/chunks/{opayo-D2jsR5vh.js → opayo-B-eRIXo-.js} +4 -4
- package/dist/chunks/{paddle-DxF88RfC.js → paddle-BUFeEU4d.js} +2 -2
- package/dist/chunks/{paypal-b5pnwrA2.js → paypal-8Euw7Hrn.js} +2 -2
- package/dist/chunks/{payway-BJYu9DIR.js → payway-dV0SzJxy.js} +2 -2
- package/dist/chunks/{recaptcha-enterprise-BSwi8IVX.js → recaptcha-enterprise-XPId5-bS.js} +19 -20
- package/dist/chunks/{recaptcha-shared-B4zAescW.js → recaptcha-shared-CLYJvojk.js} +15 -3
- package/dist/chunks/{recaptcha-v2-checkbox-CnDQmsKa.js → recaptcha-v2-checkbox-Cy-0PEPc.js} +2 -2
- package/dist/chunks/{recaptcha-v2-invisible-Cz5uIlp-.js → recaptcha-v2-invisible-BwRH540O.js} +2 -2
- package/dist/chunks/recaptcha-v3-No4Ykrhk.js +28 -0
- package/dist/chunks/rich-text-D0sb8bmX.js +349 -0
- package/dist/chunks/scripts-CbQ7agX3.js +30 -0
- package/dist/chunks/{signature-CpgqHCEx.js → signature-xz4QO7CR.js} +107 -34
- package/dist/chunks/{snaptcha-vz1RnZ15.js → snaptcha-DKx98oon.js} +1 -1
- package/dist/chunks/{square-BP8RWAKB.js → square-reyJukb7.js} +2 -2
- package/dist/chunks/{stripe-MihN63uC.js → stripe-BC-2PBvY.js} +2 -2
- package/dist/chunks/{text-limit-B09elPDB.js → text-limit-DbgEFHLO.js} +1 -1
- package/dist/chunks/{turnstile-D_Pi1CKM.js → turnstile-DJakPzQD.js} +3 -3
- package/dist/chunks/upload-manager-BpqWSHmU.js +2558 -0
- package/dist/css/theme/_buttons.css +16 -0
- package/dist/css/theme/_tokens.css +2 -0
- package/dist/css/theme/fields/_signature.css +19 -0
- package/dist/css/theme/fields/_upload-manager.css +279 -0
- package/dist/index.js +629 -578
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/error-aria-live.d.ts +6 -0
- package/dist/js/core/error-aria-live.d.ts.map +1 -0
- package/dist/js/core/submit-result-state.d.ts.map +1 -1
- package/dist/js/core/submit-result-ui.d.ts.map +1 -1
- package/dist/js/modules/captchas/factories.d.ts.map +1 -1
- package/dist/js/modules/captchas/host.d.ts +1 -0
- package/dist/js/modules/captchas/host.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-shared.d.ts +1 -0
- package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
- package/dist/js/modules/captchas/turnstile.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
- package/dist/js/modules/fields/index.d.ts.map +1 -1
- package/dist/js/modules/fields/signature.d.ts.map +1 -1
- package/dist/js/modules/fields/upload-manager.d.ts +3 -0
- package/dist/js/modules/fields/upload-manager.d.ts.map +1 -0
- package/dist/js/utils/form-started-at.d.ts +2 -0
- package/dist/js/utils/form-started-at.d.ts.map +1 -0
- package/dist/js/utils/scripts.d.ts.map +1 -1
- package/dist/js/utils/unload-warning.d.ts.map +1 -1
- package/dist/js/validation/enter-key-guard.d.ts +2 -0
- package/dist/js/validation/enter-key-guard.d.ts.map +1 -0
- package/dist/js/validation/types.d.ts +1 -0
- package/dist/js/validation/types.d.ts.map +1 -1
- package/dist/js/validation/validator.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/css/theme/_buttons.css +16 -0
- package/src/css/theme/_tokens.css +2 -0
- package/src/css/theme/fields/_signature.css +19 -0
- package/src/css/theme/fields/_upload-manager.css +279 -0
- package/src/js/core/create-formie-client.ts +7 -0
- package/src/js/core/error-aria-live.ts +45 -0
- package/src/js/core/submit-result-state.ts +4 -0
- package/src/js/core/submit-result-ui.ts +8 -4
- package/src/js/modules/captchas/factories.ts +4 -0
- package/src/js/modules/captchas/host.ts +14 -2
- package/src/js/modules/captchas/recaptcha-enterprise.ts +14 -11
- package/src/js/modules/captchas/recaptcha-shared.ts +14 -0
- package/src/js/modules/captchas/recaptcha-v3.ts +7 -4
- package/src/js/modules/captchas/turnstile.ts +9 -3
- package/src/js/modules/fields/conditions/effects.ts +42 -0
- package/src/js/modules/fields/index.ts +1 -0
- package/src/js/modules/fields/signature.ts +199 -15
- package/src/js/modules/fields/upload-manager.ts +1277 -0
- package/src/js/utils/form-started-at.ts +25 -0
- package/src/js/utils/scripts.ts +16 -0
- package/src/js/utils/unload-warning.ts +1 -0
- package/src/js/validation/enter-key-guard.ts +63 -0
- package/src/js/validation/types.ts +1 -0
- package/src/js/validation/validator.ts +14 -5
- package/src/vendor.d.ts +1 -1
- package/dist/chunks/dist-BF5GU3_9.js +0 -2674
- package/dist/chunks/recaptcha-v3-BtbbP111.js +0 -27
- package/dist/chunks/rich-text-Cv8ADyk-.js +0 -349
- package/dist/chunks/scripts-6CYSUGKQ.js +0 -24
|
@@ -1,85 +1,93 @@
|
|
|
1
|
-
import { a as e,
|
|
2
|
-
import { t as
|
|
3
|
-
import { i
|
|
4
|
-
import { i as
|
|
5
|
-
import { n as
|
|
6
|
-
import { r as
|
|
7
|
-
import { n as
|
|
1
|
+
import { a as e, d as t, u as n } from "./event-names-BCI2FLD8.js";
|
|
2
|
+
import { t as r } from "./debug-BV0DvdHx.js";
|
|
3
|
+
import { i, r as a, t as o } from "./theme-classes-Tv7q7ToE.js";
|
|
4
|
+
import { i as s } from "./i18n-BY1ds1BL.js";
|
|
5
|
+
import { n as c, t as l } from "./async-nPFRNQ06.js";
|
|
6
|
+
import { r as u, t as d } from "./field-references.keys-58ZSTrCW.js";
|
|
7
|
+
import { n as f, r as p } from "./field-references.resolver-CHwn0G0L.js";
|
|
8
|
+
//#region src/js/core/dom-events.ts
|
|
9
|
+
function m(e, n, r) {
|
|
10
|
+
e.dispatchEvent(new CustomEvent(t(n), {
|
|
11
|
+
bubbles: !0,
|
|
12
|
+
detail: r
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
8
16
|
//#region src/js/core/page-client-event.ts
|
|
9
|
-
var
|
|
10
|
-
function
|
|
17
|
+
var h = r("general", "page-client-event"), g = "data-formie-client-event";
|
|
18
|
+
function ee(e) {
|
|
11
19
|
return typeof window < "u" && window.CSS?.escape ? window.CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
12
20
|
}
|
|
13
|
-
function
|
|
21
|
+
function te(e) {
|
|
14
22
|
return e.querySelector("input[name=\"pageId\"]")?.value?.trim() || e.querySelector("[data-formie-page]:not([data-formie-page-hidden])")?.getAttribute("data-formie-page-id")?.trim() || e.querySelector("[data-formie-page]")?.getAttribute("data-formie-page-id")?.trim() || null;
|
|
15
23
|
}
|
|
16
|
-
function
|
|
24
|
+
function _(e) {
|
|
17
25
|
if (!e?.trim()) return null;
|
|
18
26
|
try {
|
|
19
27
|
let t = JSON.parse(e);
|
|
20
28
|
return t && typeof t == "object" ? t : null;
|
|
21
29
|
} catch {
|
|
22
|
-
return
|
|
30
|
+
return h.warn("Invalid data-formie-client-event JSON.", { rawPreview: e.slice(0, 80) }), null;
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
|
-
function
|
|
33
|
+
function ne(e) {
|
|
26
34
|
let t = {};
|
|
27
35
|
return e.forEach((e) => {
|
|
28
36
|
let n = typeof e.label == "string" ? e.label.trim() : "";
|
|
29
37
|
n && (t[n] = typeof e.value == "string" ? e.value : "");
|
|
30
38
|
}), t;
|
|
31
39
|
}
|
|
32
|
-
function
|
|
40
|
+
function v(e, t) {
|
|
33
41
|
if (t !== "submit") return;
|
|
34
|
-
let n =
|
|
42
|
+
let n = te(e);
|
|
35
43
|
if (!n) {
|
|
36
|
-
|
|
44
|
+
h.log("No submitted page id; skipping client event.");
|
|
37
45
|
return;
|
|
38
46
|
}
|
|
39
|
-
let r = e.querySelector(`[data-formie-page][data-formie-page-id="${
|
|
47
|
+
let r = e.querySelector(`[data-formie-page][data-formie-page-id="${ee(n)}"]`);
|
|
40
48
|
if (!r) {
|
|
41
|
-
|
|
49
|
+
h.log("No page section for id; skipping client event.", { pageId: n });
|
|
42
50
|
return;
|
|
43
51
|
}
|
|
44
|
-
let i = r.getAttribute(
|
|
52
|
+
let i = r.getAttribute(g);
|
|
45
53
|
if (i === null) return;
|
|
46
|
-
let a =
|
|
54
|
+
let a = _(i);
|
|
47
55
|
if (!a || !Array.isArray(a.fields)) return;
|
|
48
|
-
let o =
|
|
56
|
+
let o = ne(a.fields), s = window;
|
|
49
57
|
s.dataLayer = s.dataLayer || [], s.dataLayer.push(o), e.dispatchEvent(new CustomEvent("formie:client-event", {
|
|
50
58
|
bubbles: !0,
|
|
51
59
|
detail: { payload: o }
|
|
52
|
-
})),
|
|
60
|
+
})), h.log("Dispatched page client event.", {
|
|
53
61
|
pageId: n,
|
|
54
62
|
keys: Object.keys(o)
|
|
55
63
|
});
|
|
56
64
|
}
|
|
57
65
|
//#endregion
|
|
58
66
|
//#region src/js/core/page-tab-errors.ts
|
|
59
|
-
function
|
|
60
|
-
if (
|
|
67
|
+
function re(e, t) {
|
|
68
|
+
if (i(e, e, "tabError", t), t) {
|
|
61
69
|
e.setAttribute("data-formie-tab-error", "true");
|
|
62
70
|
return;
|
|
63
71
|
}
|
|
64
72
|
e.removeAttribute("data-formie-tab-error");
|
|
65
73
|
}
|
|
66
|
-
function
|
|
74
|
+
function y(e) {
|
|
67
75
|
let t = /* @__PURE__ */ new Set();
|
|
68
76
|
e.querySelectorAll("[data-formie-page]").forEach((e) => {
|
|
69
77
|
let n = e, r = n.getAttribute("data-formie-page-id");
|
|
70
78
|
r && n.querySelector("[data-formie-field-has-error]") && t.add(r);
|
|
71
79
|
}), e.querySelectorAll("[data-formie-tab]").forEach((e) => {
|
|
72
80
|
let n = e, r = n.getAttribute("data-formie-page-id");
|
|
73
|
-
|
|
81
|
+
re(n, !!r && t.has(r));
|
|
74
82
|
});
|
|
75
83
|
}
|
|
76
84
|
//#endregion
|
|
77
85
|
//#region src/js/validation/scope.ts
|
|
78
|
-
function
|
|
86
|
+
function b(e) {
|
|
79
87
|
return Array.from(e.querySelectorAll("[data-formie-page]"));
|
|
80
88
|
}
|
|
81
|
-
function
|
|
82
|
-
let t =
|
|
89
|
+
function x(e) {
|
|
90
|
+
let t = b(e);
|
|
83
91
|
if (!t.length) return {
|
|
84
92
|
scope: e,
|
|
85
93
|
final: !0
|
|
@@ -92,35 +100,35 @@ function b(e) {
|
|
|
92
100
|
}
|
|
93
101
|
//#endregion
|
|
94
102
|
//#region src/js/validation/submit-readiness.ts
|
|
95
|
-
var
|
|
96
|
-
function
|
|
103
|
+
var S = "data-formie-submit-validation-disabled", C = "data-formie-preserve-disabled", ie = "data-formie-submit-ready";
|
|
104
|
+
function w(e) {
|
|
97
105
|
return e.dataset.formieDisableSubmitUntilValid === "true";
|
|
98
106
|
}
|
|
99
|
-
function
|
|
107
|
+
function ae(e) {
|
|
100
108
|
return Array.from(e.querySelectorAll("button[data-formie-action=\"submit\"]")).filter((e) => e instanceof HTMLButtonElement);
|
|
101
109
|
}
|
|
102
|
-
function
|
|
110
|
+
function oe(e) {
|
|
103
111
|
return !e.hasAttribute("data-formie-conditionally-hidden") && !e.closest("[data-formie-conditionally-hidden]");
|
|
104
112
|
}
|
|
105
|
-
function
|
|
106
|
-
if (!
|
|
107
|
-
let { scope: n, final: r } =
|
|
108
|
-
e.setAttribute(
|
|
109
|
-
if (
|
|
113
|
+
function T(e, t) {
|
|
114
|
+
if (!w(e) || e.getAttribute("data-formie-loading") === "true") return;
|
|
115
|
+
let { scope: n, final: r } = x(e), i = t.isValid(n, { includeHiddenPages: r });
|
|
116
|
+
e.setAttribute(ie, i ? "true" : "false"), ae(e).forEach((e) => {
|
|
117
|
+
if (oe(e)) {
|
|
110
118
|
if (i) {
|
|
111
|
-
if (!e.hasAttribute(
|
|
112
|
-
e.hasAttribute(
|
|
119
|
+
if (!e.hasAttribute(S)) return;
|
|
120
|
+
e.hasAttribute(C) ? (e.disabled = !0, e.removeAttribute(C)) : e.disabled = !1, e.removeAttribute(S);
|
|
113
121
|
return;
|
|
114
122
|
}
|
|
115
|
-
e.hasAttribute(
|
|
123
|
+
e.hasAttribute(S) || (e.disabled && e.setAttribute(C, "true"), e.setAttribute(S, "true")), e.disabled = !0;
|
|
116
124
|
}
|
|
117
125
|
});
|
|
118
126
|
}
|
|
119
|
-
function
|
|
120
|
-
if (!
|
|
127
|
+
function se(e, t, n) {
|
|
128
|
+
if (!w(e)) return () => {};
|
|
121
129
|
let r = !1, i = () => {
|
|
122
130
|
r || (r = !0, queueMicrotask(() => {
|
|
123
|
-
r = !1,
|
|
131
|
+
r = !1, T(e, t);
|
|
124
132
|
}));
|
|
125
133
|
};
|
|
126
134
|
i();
|
|
@@ -163,18 +171,18 @@ function oe(e, t, n) {
|
|
|
163
171
|
}
|
|
164
172
|
//#endregion
|
|
165
173
|
//#region src/js/core/submit-result-state.ts
|
|
166
|
-
var
|
|
167
|
-
function
|
|
174
|
+
var ce = "STALE_SUBMISSION_STATE", E = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), O = r("general", "submit-result");
|
|
175
|
+
function k(e, t, n) {
|
|
168
176
|
let r = e.querySelector(`input[name="${t}"]`);
|
|
169
177
|
r || (r = document.createElement("input"), r.type = "hidden", r.name = t, e.appendChild(r)), r.value = n;
|
|
170
178
|
}
|
|
171
|
-
function
|
|
179
|
+
function A(e, t) {
|
|
172
180
|
e.setAttribute("data-formie-internal-navigation", t);
|
|
173
181
|
}
|
|
174
|
-
function
|
|
182
|
+
function j(e, t) {
|
|
175
183
|
e.querySelector(`input[name="${t}"]`)?.remove();
|
|
176
184
|
}
|
|
177
|
-
function
|
|
185
|
+
function le(e, t) {
|
|
178
186
|
try {
|
|
179
187
|
let n = new URL(e, window.location.href);
|
|
180
188
|
return n.searchParams.delete(t), n.toString();
|
|
@@ -182,31 +190,31 @@ function ce(e, t) {
|
|
|
182
190
|
return e;
|
|
183
191
|
}
|
|
184
192
|
}
|
|
185
|
-
function
|
|
193
|
+
function ue(e) {
|
|
186
194
|
try {
|
|
187
195
|
return new URL(e, window.location.href).origin === window.location.origin;
|
|
188
196
|
} catch {
|
|
189
197
|
return !1;
|
|
190
198
|
}
|
|
191
199
|
}
|
|
192
|
-
function
|
|
200
|
+
function M(e) {
|
|
193
201
|
return Array.from(e.querySelectorAll("[data-formie-page]"));
|
|
194
202
|
}
|
|
195
|
-
function
|
|
203
|
+
function de(e) {
|
|
196
204
|
return Array.from(e.querySelectorAll("[data-formie-tab]"));
|
|
197
205
|
}
|
|
198
|
-
function
|
|
206
|
+
function fe(e, t, n) {
|
|
199
207
|
return t < 0 || n < 1 ? 0 : (e.dataset.formieProgressCalculation === "page-position" ? "page-position" : "completion") == "page-position" ? Math.round((t + 1) / n * 100) : Math.round(t / n * 100);
|
|
200
208
|
}
|
|
201
|
-
function
|
|
209
|
+
function pe(e) {
|
|
202
210
|
return e <= 0 ? "start" : e >= 100 ? "end" : "middle";
|
|
203
211
|
}
|
|
204
|
-
function
|
|
212
|
+
function me(e) {
|
|
205
213
|
return (e.dataset.formieSubmitAction || "").trim();
|
|
206
214
|
}
|
|
207
215
|
function N(e, t) {
|
|
208
216
|
let n = t.meta?.effectiveSubmitAction;
|
|
209
|
-
return typeof n == "string" && n.trim() !== "" ? n.trim() :
|
|
217
|
+
return typeof n == "string" && n.trim() !== "" ? n.trim() : me(e);
|
|
210
218
|
}
|
|
211
219
|
function P(e) {
|
|
212
220
|
let t = e.dataset.formieSubmitActionFormHide;
|
|
@@ -228,31 +236,31 @@ function F(e, t) {
|
|
|
228
236
|
});
|
|
229
237
|
}
|
|
230
238
|
function I(e) {
|
|
231
|
-
let t =
|
|
232
|
-
typeof t == "number" && (window.clearTimeout(t),
|
|
239
|
+
let t = E.get(e);
|
|
240
|
+
typeof t == "number" && (window.clearTimeout(t), E.delete(e));
|
|
233
241
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
242
|
+
function he(e, t) {
|
|
243
|
+
D.has(e) || D.set(e, e.innerHTML), e.textContent = t;
|
|
236
244
|
}
|
|
237
245
|
function L(e) {
|
|
238
|
-
let t =
|
|
239
|
-
t !== void 0 && (e.innerHTML = t,
|
|
246
|
+
let t = D.get(e);
|
|
247
|
+
t !== void 0 && (e.innerHTML = t, D.delete(e));
|
|
240
248
|
}
|
|
241
|
-
function
|
|
249
|
+
function R(e, t) {
|
|
242
250
|
let n = e.querySelector("[data-formie-progress-bar]"), r = e.querySelector("[data-formie-progress-value]");
|
|
243
|
-
n && (n.style.width = `${t}%`, n.setAttribute("aria-valuenow", `${t}`), n.setAttribute("data-formie-progress-state",
|
|
251
|
+
n && (n.style.width = `${t}%`, n.setAttribute("aria-valuenow", `${t}`), n.setAttribute("data-formie-progress-state", pe(t)), r && (r.textContent = `${t}%`, r.setAttribute("data-formie-progress-value", `${t}`)));
|
|
244
252
|
}
|
|
245
|
-
function
|
|
253
|
+
function ge(e, t) {
|
|
246
254
|
if (!t) return;
|
|
247
255
|
let n = (e.dataset.formieLoadingIndicator || "").trim();
|
|
248
256
|
if (n) {
|
|
249
257
|
if (t.setAttribute("data-formie-loading-indicator", n), n === "spinner") {
|
|
250
|
-
|
|
258
|
+
i(t, e, "loading", !0), L(t), t.removeAttribute("data-formie-loading-text");
|
|
251
259
|
return;
|
|
252
260
|
}
|
|
253
261
|
if (n === "text") {
|
|
254
262
|
let n = (e.dataset.formieLoadingIndicatorText || "").trim(), r = t.textContent?.trim() || "", i = n || r;
|
|
255
|
-
t.setAttribute("data-formie-loading-text", i),
|
|
263
|
+
t.setAttribute("data-formie-loading-text", i), he(t, i);
|
|
256
264
|
return;
|
|
257
265
|
}
|
|
258
266
|
L(t), t.removeAttribute("data-formie-loading-text");
|
|
@@ -261,55 +269,55 @@ function R(e, t) {
|
|
|
261
269
|
function z(e) {
|
|
262
270
|
return Array.from(e.querySelectorAll("[data-formie-action]"));
|
|
263
271
|
}
|
|
264
|
-
function
|
|
272
|
+
function B(e, t) {
|
|
265
273
|
e.getAttribute("data-formie-loading") !== "true" && (e.setAttribute("data-formie-loading", "true"), z(e).forEach((e) => {
|
|
266
274
|
"disabled" in e && (e.disabled ? e.setAttribute("data-formie-was-disabled", "true") : e.removeAttribute("data-formie-was-disabled"), e.disabled = !0);
|
|
267
|
-
}), t && (t.setAttribute("data-formie-loading", "true"),
|
|
275
|
+
}), t && (t.setAttribute("data-formie-loading", "true"), ge(e, t)));
|
|
268
276
|
}
|
|
269
|
-
function
|
|
277
|
+
function V(e) {
|
|
270
278
|
if (e.removeAttribute("data-formie-loading"), z(e).forEach((t) => {
|
|
271
279
|
if ("disabled" in t) {
|
|
272
280
|
let e = t;
|
|
273
281
|
e.disabled = e.getAttribute("data-formie-was-disabled") === "true";
|
|
274
282
|
}
|
|
275
|
-
L(t), t.removeAttribute("data-formie-was-disabled"), t.removeAttribute("data-formie-loading"),
|
|
283
|
+
L(t), t.removeAttribute("data-formie-was-disabled"), t.removeAttribute("data-formie-loading"), i(t, e, "loading", !1), t.removeAttribute("data-formie-loading-indicator"), t.removeAttribute("data-formie-loading-text");
|
|
276
284
|
}), e.dataset.formieDisableSubmitUntilValid === "true") {
|
|
277
285
|
let t = e;
|
|
278
|
-
t.formieValidation &&
|
|
286
|
+
t.formieValidation && T(e, t.formieValidation);
|
|
279
287
|
}
|
|
280
288
|
}
|
|
281
|
-
function
|
|
282
|
-
let n =
|
|
289
|
+
function H(e, t) {
|
|
290
|
+
let n = M(e), r = de(e), s = n.findIndex((e) => e.getAttribute("data-formie-page-id") === t);
|
|
283
291
|
if (n.forEach((n) => {
|
|
284
|
-
n.getAttribute("data-formie-page-id") === t ? (n.removeAttribute("data-formie-page-hidden"),
|
|
285
|
-
}),
|
|
286
|
-
let a = n.getAttribute("data-formie-page-id") === t, o = s > -1 &&
|
|
287
|
-
|
|
288
|
-
}), s > -1 && n.length > 0 &&
|
|
292
|
+
n.getAttribute("data-formie-page-id") === t ? (n.removeAttribute("data-formie-page-hidden"), a(n, e, "pageHidden")) : (n.setAttribute("data-formie-page-hidden", "true"), o(n, e, "pageHidden"));
|
|
293
|
+
}), r.forEach((n, r) => {
|
|
294
|
+
let a = n.getAttribute("data-formie-page-id") === t, o = s > -1 && r < s;
|
|
295
|
+
i(n, e, "tabCurrent", a), i(n, e, "tabComplete", o), a ? n.setAttribute("aria-current", "page") : n.removeAttribute("aria-current"), o ? n.setAttribute("data-formie-tab-complete", "true") : n.removeAttribute("data-formie-tab-complete");
|
|
296
|
+
}), s > -1 && n.length > 0 && R(e, fe(e, s, n.length)), k(e, "pageId", t), y(e), e.dataset.formieDisableSubmitUntilValid === "true") {
|
|
289
297
|
let t = e;
|
|
290
|
-
t.formieValidation &&
|
|
298
|
+
t.formieValidation && T(e, t.formieValidation);
|
|
291
299
|
}
|
|
292
300
|
}
|
|
293
|
-
function
|
|
301
|
+
function _e(e, t) {
|
|
294
302
|
let n = t.meta?.submissionUid;
|
|
295
|
-
typeof n == "string" && n.trim() !== "" &&
|
|
303
|
+
typeof n == "string" && n.trim() !== "" && k(e, "submissionUid", n);
|
|
296
304
|
let r = (t.meta?.session)?.continuation?.continuationToken;
|
|
297
|
-
typeof r == "string" && r.trim() !== "" ?
|
|
305
|
+
typeof r == "string" && r.trim() !== "" ? k(e, "continuationToken", r) : j(e, "continuationToken");
|
|
298
306
|
}
|
|
299
|
-
function
|
|
307
|
+
function ve(e) {
|
|
300
308
|
let t = e.getAttribute("action");
|
|
301
|
-
t && e.setAttribute("action",
|
|
309
|
+
t && e.setAttribute("action", le(t, "resumeToken"));
|
|
302
310
|
try {
|
|
303
311
|
let e = new URL(window.location.href);
|
|
304
312
|
if (!e.searchParams.has("resumeToken")) return;
|
|
305
313
|
e.searchParams.delete("resumeToken"), window.history.replaceState({}, document.title, `${e.pathname}${e.search}${e.hash}`);
|
|
306
314
|
} catch {}
|
|
307
315
|
}
|
|
308
|
-
function
|
|
316
|
+
function ye(e, t) {
|
|
309
317
|
let n = t.meta?.resumeUrl;
|
|
310
318
|
if (typeof n != "string" || n.trim() === "") return;
|
|
311
319
|
let r = n.trim();
|
|
312
|
-
if (
|
|
320
|
+
if (ue(r)) {
|
|
313
321
|
e.getAttribute("action") && e.setAttribute("action", r);
|
|
314
322
|
try {
|
|
315
323
|
let e = new URL(r, window.location.href);
|
|
@@ -317,89 +325,89 @@ function ve(e, t) {
|
|
|
317
325
|
} catch {}
|
|
318
326
|
}
|
|
319
327
|
}
|
|
320
|
-
function
|
|
321
|
-
let r = t.formieValidation, i =
|
|
322
|
-
if (I(t), t.reset(), n.preserveHiddenState || F(t, !1),
|
|
323
|
-
|
|
328
|
+
function U(t, n = {}) {
|
|
329
|
+
let r = t.formieValidation, i = M(t)[0]?.getAttribute("data-formie-page-id");
|
|
330
|
+
if (I(t), t.reset(), n.preserveHiddenState || F(t, !1), j(t, "submissionId"), j(t, "submissionUid"), j(t, "continuationToken"), j(t, "pageId"), ve(t), r?.resetLiveState(), i) {
|
|
331
|
+
H(t, i), t.dispatchEvent(new CustomEvent(e("reset"), { bubbles: !0 }));
|
|
324
332
|
return;
|
|
325
333
|
}
|
|
326
|
-
|
|
334
|
+
y(t), t.dispatchEvent(new CustomEvent(e("reset"), { bubbles: !0 }));
|
|
327
335
|
}
|
|
328
|
-
function
|
|
329
|
-
return e.code ===
|
|
336
|
+
function be(e) {
|
|
337
|
+
return e.code === ce || e.meta?.resetState === !0;
|
|
330
338
|
}
|
|
331
|
-
function
|
|
332
|
-
let r =
|
|
339
|
+
function xe(e, t) {
|
|
340
|
+
let r = t.submitData, i = /* @__PURE__ */ new Set(), a = !1;
|
|
333
341
|
if (Array.isArray(r) && r.length > 0) {
|
|
334
|
-
let
|
|
335
|
-
for (let r of
|
|
336
|
-
let
|
|
337
|
-
i.add(
|
|
342
|
+
let t = r.filter((e) => typeof e == "object" && !!e && "event" in e && typeof e.event == "string");
|
|
343
|
+
for (let r of t) {
|
|
344
|
+
let t = n(r.event);
|
|
345
|
+
i.add(t), O.log("Dispatching submitData event.", { eventName: t }), t.startsWith("formie:payment:") && (a = !0), e.dispatchEvent(new CustomEvent(t, {
|
|
338
346
|
bubbles: !0,
|
|
339
347
|
detail: { data: r.data }
|
|
340
348
|
}));
|
|
341
349
|
}
|
|
342
350
|
}
|
|
343
|
-
let o =
|
|
351
|
+
let o = t.meta || {}, s = (o.paymentAction && typeof o.paymentAction == "object" ? o.paymentAction : null) || (o.paymentDecision && typeof o.paymentDecision == "object" ? o.paymentDecision.action : null), c = s ? String(s.event || "") : "", l = s ? s.payload : void 0, u = n(c);
|
|
344
352
|
return u && !i.has(u) && (u.startsWith("formie:payment:") && (a = !0), e.dispatchEvent(new CustomEvent(u, {
|
|
345
353
|
bubbles: !0,
|
|
346
354
|
detail: { data: l }
|
|
347
|
-
})),
|
|
355
|
+
})), O.log("Dispatching fallback payment action event.", { eventName: u })), { hasPaymentFollowUpEvent: a };
|
|
348
356
|
}
|
|
349
|
-
function
|
|
350
|
-
if (
|
|
357
|
+
function Se(e, t, n) {
|
|
358
|
+
if (O.log("Applying submit result state.", {
|
|
351
359
|
ok: t.ok,
|
|
352
360
|
action: n,
|
|
353
361
|
code: t.code,
|
|
354
362
|
hasRedirect: !!t.redirect?.url,
|
|
355
363
|
hasSubmitData: Array.isArray(t.submitData) && t.submitData.length > 0
|
|
356
|
-
}),
|
|
357
|
-
|
|
364
|
+
}), be(t)) {
|
|
365
|
+
U(e), O.log("Resetting state due to stale/reset marker.");
|
|
358
366
|
return;
|
|
359
367
|
}
|
|
360
|
-
let r =
|
|
368
|
+
let r = xe(e, t);
|
|
361
369
|
if (!t.ok && t.redirect?.url && !r.hasPaymentFollowUpEvent) {
|
|
362
|
-
|
|
370
|
+
O.log("Applying redirect fallback for failed result.", {
|
|
363
371
|
url: t.redirect.url,
|
|
364
372
|
target: t.redirect.target
|
|
365
|
-
}), I(e), t.redirect.target === "new-tab" ? window.open(t.redirect.url, "_blank") : (
|
|
373
|
+
}), I(e), t.redirect.target === "new-tab" ? window.open(t.redirect.url, "_blank") : (A(e, "redirect"), window.location.href = t.redirect.url);
|
|
366
374
|
return;
|
|
367
375
|
}
|
|
368
|
-
if (
|
|
369
|
-
|
|
376
|
+
if (_e(e, t), !t.ok) {
|
|
377
|
+
O.log("Non-redirect failure; keeping current form state."), I(e);
|
|
370
378
|
return;
|
|
371
379
|
}
|
|
372
|
-
if (
|
|
373
|
-
I(e), e.formieValidation?.resetLiveState(),
|
|
380
|
+
if (v(e, n), t.nextPage?.id) {
|
|
381
|
+
I(e), e.formieValidation?.resetLiveState(), H(e, t.nextPage.id), m(e, "formie:page:navigate:after", { pageId: t.nextPage.id }), O.log("Advanced to next page.", { nextPageId: t.nextPage.id });
|
|
374
382
|
return;
|
|
375
383
|
}
|
|
376
384
|
if (n === "save") {
|
|
377
|
-
I(e),
|
|
385
|
+
I(e), ye(e, t), O.log("Applied save/resume token state.");
|
|
378
386
|
return;
|
|
379
387
|
}
|
|
380
388
|
if (n === "submit" && !t.redirect?.url) {
|
|
381
389
|
let n = N(e, t), r = n === "message" && P(e);
|
|
382
390
|
if (n === "reload") {
|
|
383
|
-
I(e),
|
|
391
|
+
I(e), A(e, "reload"), window.location.reload();
|
|
384
392
|
return;
|
|
385
393
|
}
|
|
386
394
|
if (n === "reset") {
|
|
387
|
-
|
|
395
|
+
U(e);
|
|
388
396
|
return;
|
|
389
397
|
}
|
|
390
|
-
I(e),
|
|
398
|
+
I(e), U(e, { preserveHiddenState: r });
|
|
391
399
|
return;
|
|
392
400
|
}
|
|
393
401
|
if (n === "submit" && t.redirect?.url && t.redirect.target === "new-tab") {
|
|
394
402
|
let n = N(e, t) === "message" && P(e);
|
|
395
|
-
I(e),
|
|
403
|
+
I(e), U(e, { preserveHiddenState: n });
|
|
396
404
|
return;
|
|
397
405
|
}
|
|
398
406
|
I(e);
|
|
399
407
|
}
|
|
400
408
|
//#endregion
|
|
401
409
|
//#region src/js/modules/payments/constants.ts
|
|
402
|
-
var
|
|
410
|
+
var Ce = 2500, we = {
|
|
403
411
|
bpoint: ["bpointToken"],
|
|
404
412
|
stripe: ["stripePaymentIntentId"],
|
|
405
413
|
paypal: ["paypalOrderId", "paypalAuthId"],
|
|
@@ -414,18 +422,18 @@ var Se = 2500, Ce = {
|
|
|
414
422
|
};
|
|
415
423
|
//#endregion
|
|
416
424
|
//#region src/js/utils/fields.ts
|
|
417
|
-
function
|
|
425
|
+
function Te(e) {
|
|
418
426
|
return e.replace("{field:", "").replace("{", "").replace("}", "").replace("]", "").split("[").join("][");
|
|
419
427
|
}
|
|
420
|
-
function
|
|
421
|
-
return `fields[${
|
|
428
|
+
function Ee(e) {
|
|
429
|
+
return `fields[${Te(e)}]`;
|
|
422
430
|
}
|
|
423
|
-
function
|
|
424
|
-
let n =
|
|
431
|
+
function De(e, t) {
|
|
432
|
+
let n = Ee(t), r = Array.from(e.querySelectorAll(`[name="${n}"]`)), i = Array.from(e.querySelectorAll(`[name="${n}[]"]`));
|
|
425
433
|
return (i.length ? i : r).filter((e) => e instanceof HTMLElement);
|
|
426
434
|
}
|
|
427
435
|
function W(e, t) {
|
|
428
|
-
let n =
|
|
436
|
+
let n = De(e, t);
|
|
429
437
|
for (let e of n) {
|
|
430
438
|
let t = e.closest("[data-formie-field-handle]")?.querySelector("[data-formie-field-label]")?.childNodes[0]?.textContent?.trim();
|
|
431
439
|
if (t) return t;
|
|
@@ -457,7 +465,7 @@ async function J(e, t, n) {
|
|
|
457
465
|
if (r.ok) return r;
|
|
458
466
|
let i = Date.now() + Math.max(n, 0);
|
|
459
467
|
for (; Date.now() < i;) {
|
|
460
|
-
await
|
|
468
|
+
await c(120);
|
|
461
469
|
let n = q(e, t);
|
|
462
470
|
if (n.ok) return n;
|
|
463
471
|
}
|
|
@@ -465,22 +473,22 @@ async function J(e, t, n) {
|
|
|
465
473
|
}
|
|
466
474
|
//#endregion
|
|
467
475
|
//#region src/js/modules/payments/host.ts
|
|
468
|
-
var
|
|
476
|
+
var Oe = new Set([
|
|
469
477
|
"handle",
|
|
470
478
|
"requiredInputSuffixes",
|
|
471
479
|
"waitForValueMs",
|
|
472
480
|
"errorMessage"
|
|
473
481
|
]), Y = "[data-payment-success]", X = "[data-payment-error]";
|
|
474
|
-
function
|
|
482
|
+
function ke(e, t) {
|
|
475
483
|
return (typeof t.handle == "string" && t.handle.trim() !== "" ? t.handle.trim() : "") || e;
|
|
476
484
|
}
|
|
477
|
-
function
|
|
478
|
-
let r = t || {}, i = Object.entries(r).reduce((e, [t, n]) => (
|
|
485
|
+
function Ae(e, t, n) {
|
|
486
|
+
let r = t || {}, i = Object.entries(r).reduce((e, [t, n]) => (Oe.has(t) || (e[t] = n), e), {}), a = Array.isArray(r.requiredInputSuffixes) ? r.requiredInputSuffixes.map(String).filter(Boolean) : n.defaultRequiredInputSuffixes || [], o = Number(r.waitForValueMs ?? n.defaultWaitForValueMs ?? 2500), s = typeof r.errorMessage == "string" && r.errorMessage.trim() !== "" ? r.errorMessage.trim() : "Payment authorization is incomplete.";
|
|
479
487
|
return {
|
|
480
|
-
handle:
|
|
488
|
+
handle: ke(e, r),
|
|
481
489
|
transport: {
|
|
482
490
|
requiredInputSuffixes: a,
|
|
483
|
-
waitForValueMs: Number.isFinite(o) ? o :
|
|
491
|
+
waitForValueMs: Number.isFinite(o) ? o : Ce,
|
|
484
492
|
errorMessage: s
|
|
485
493
|
},
|
|
486
494
|
provider: i
|
|
@@ -491,9 +499,9 @@ function Z(e, t, n) {
|
|
|
491
499
|
e.removeEventListener(t, n);
|
|
492
500
|
};
|
|
493
501
|
}
|
|
494
|
-
function
|
|
495
|
-
let n = e.target, r = e.form, i = e.root,
|
|
496
|
-
let t =
|
|
502
|
+
function je(e, t) {
|
|
503
|
+
let n = e.target, r = e.form, i = e.root, a = r || i, c = t.transport.requiredInputSuffixes, m = () => p(r || i), h = (e) => {
|
|
504
|
+
let t = f(e, m()).value;
|
|
497
505
|
return Array.isArray(t) ? t[0] || "" : String(t || "");
|
|
498
506
|
};
|
|
499
507
|
return {
|
|
@@ -503,100 +511,100 @@ function ke(e, t) {
|
|
|
503
511
|
updateInputs: (e, t) => {
|
|
504
512
|
let r = Array.isArray(e) ? e : [e];
|
|
505
513
|
for (let e of r) {
|
|
506
|
-
let r = K(
|
|
514
|
+
let r = K(a, e) ?? n.querySelector(`input[name*="${e}"]`);
|
|
507
515
|
r && (r.value = t);
|
|
508
516
|
}
|
|
509
517
|
},
|
|
510
518
|
addError: (e) => {
|
|
511
|
-
let t = n.querySelector("[data-formie-field-type] > div, [data-field-type] > div") || n,
|
|
512
|
-
|
|
519
|
+
let t = n.querySelector("[data-formie-field-type] > div, [data-field-type] > div") || n, a = t.querySelector(X);
|
|
520
|
+
a && a.remove();
|
|
513
521
|
let s = document.createElement("div");
|
|
514
|
-
s.setAttribute("data-payment-error", ""), s.textContent = e,
|
|
522
|
+
s.setAttribute("data-payment-error", ""), s.textContent = e, o(s, r || i, "fieldError"), t.appendChild(s);
|
|
515
523
|
},
|
|
516
524
|
removeError: () => {
|
|
517
525
|
n.querySelector(X)?.remove();
|
|
518
526
|
},
|
|
519
527
|
addSuccess: (e) => {
|
|
520
|
-
let t = n.querySelector("[data-formie-field-type] > div, [data-field-type] > div") || n,
|
|
521
|
-
|
|
528
|
+
let t = n.querySelector("[data-formie-field-type] > div, [data-field-type] > div") || n, a = t.querySelector(Y);
|
|
529
|
+
a && a.remove();
|
|
522
530
|
let s = document.createElement("div");
|
|
523
|
-
s.setAttribute("data-payment-success", ""), s.textContent = e,
|
|
531
|
+
s.setAttribute("data-payment-success", ""), s.textContent = e, o(s, r || i, "successMessage"), t.appendChild(s);
|
|
524
532
|
},
|
|
525
533
|
removeSuccess: () => {
|
|
526
534
|
n.querySelector(Y)?.remove();
|
|
527
535
|
},
|
|
528
|
-
hasToken: () => q(
|
|
529
|
-
waitForToken: (e = t.transport.waitForValueMs) => J(
|
|
536
|
+
hasToken: () => q(a, c).ok,
|
|
537
|
+
waitForToken: (e = t.transport.waitForValueMs) => J(a, c, e).then((e) => e.ok),
|
|
530
538
|
getFieldValue: (e, t = "string") => {
|
|
531
539
|
let n = h(e);
|
|
532
540
|
return t === "float" || t === "int" || t === "number" ? G(n) : n;
|
|
533
541
|
},
|
|
534
542
|
resolveAmount: (e) => {
|
|
535
|
-
let t = r || i, n = String(e.type || "").toLowerCase() === "dynamic" && typeof e.variable == "string" && e.variable.trim() !== "", a = e.value ?? (n ? e.variable : e.fixed),
|
|
543
|
+
let t = r || i, n = String(e.type || "").toLowerCase() === "dynamic" && typeof e.variable == "string" && e.variable.trim() !== "", a = e.value ?? (n ? e.variable : e.fixed), o = String(a ?? "").trim(), c = typeof a == "number" ? a : G(o);
|
|
536
544
|
if (Number.isFinite(c) && c > 0) return {
|
|
537
545
|
ok: !0,
|
|
538
546
|
value: c
|
|
539
547
|
};
|
|
540
|
-
if (
|
|
541
|
-
let e = h(
|
|
548
|
+
if (o !== "") {
|
|
549
|
+
let e = h(o), n = G(e);
|
|
542
550
|
if (Number.isFinite(n) && n > 0) return {
|
|
543
551
|
ok: !0,
|
|
544
552
|
value: n
|
|
545
553
|
};
|
|
546
|
-
let r = W(t,
|
|
554
|
+
let r = W(t, o);
|
|
547
555
|
if (!e) return {
|
|
548
556
|
ok: !1,
|
|
549
|
-
error: r ?
|
|
557
|
+
error: r ? s("Provide a value for \"{label}\" to proceed.", { label: r }) : s("Provide a payment amount to proceed.")
|
|
550
558
|
};
|
|
551
559
|
}
|
|
552
560
|
return {
|
|
553
561
|
ok: !1,
|
|
554
|
-
error:
|
|
562
|
+
error: s("Payment amount must be greater than 0.")
|
|
555
563
|
};
|
|
556
564
|
},
|
|
557
565
|
resolveCurrency: (e) => {
|
|
558
|
-
let t = r || i, n = String(e.type || "").toLowerCase() === "dynamic" && typeof e.variable == "string" && e.variable.trim() !== "", a = e.value ?? (n ? e.variable : e.fixed ?? e.defaultCurrency ?? ""),
|
|
566
|
+
let t = r || i, n = String(e.type || "").toLowerCase() === "dynamic" && typeof e.variable == "string" && e.variable.trim() !== "", a = e.value ?? (n ? e.variable : e.fixed ?? e.defaultCurrency ?? ""), o = String(a ?? "").trim(), c = o.toUpperCase();
|
|
559
567
|
if (/^[A-Z]{3}$/.test(c) && !n) return {
|
|
560
568
|
ok: !0,
|
|
561
569
|
value: c
|
|
562
570
|
};
|
|
563
|
-
if (
|
|
564
|
-
let e = String(h(
|
|
571
|
+
if (o !== "") {
|
|
572
|
+
let e = String(h(o) || "").trim(), n = e.toUpperCase();
|
|
565
573
|
if (/^[A-Z]{3}$/.test(n)) return {
|
|
566
574
|
ok: !0,
|
|
567
575
|
value: n
|
|
568
576
|
};
|
|
569
|
-
let r = W(t,
|
|
577
|
+
let r = W(t, o);
|
|
570
578
|
if (!e) return {
|
|
571
579
|
ok: !1,
|
|
572
|
-
error: r ?
|
|
580
|
+
error: r ? s("Provide a value for \"{label}\" to proceed.", { label: r }) : s("Provide a payment currency to proceed.")
|
|
573
581
|
};
|
|
574
582
|
}
|
|
575
583
|
return {
|
|
576
584
|
ok: !1,
|
|
577
|
-
error:
|
|
585
|
+
error: s("Payment currency must be a valid 3-letter code.")
|
|
578
586
|
};
|
|
579
587
|
},
|
|
580
588
|
watchFieldValueChanges: (e, t, n = 600) => {
|
|
581
589
|
let a = r || i, o = e.map((e) => String(e || "").trim()).filter(Boolean);
|
|
582
590
|
if (o.length === 0) return () => {};
|
|
583
|
-
let s = m(),
|
|
591
|
+
let s = m(), c = /* @__PURE__ */ new Set();
|
|
584
592
|
o.forEach((e) => {
|
|
585
|
-
let t =
|
|
593
|
+
let t = u(e), n = s.get(t);
|
|
586
594
|
if (n?.names?.length) {
|
|
587
595
|
n.names.forEach((e) => {
|
|
588
|
-
|
|
596
|
+
c.add(e);
|
|
589
597
|
});
|
|
590
598
|
return;
|
|
591
599
|
}
|
|
592
|
-
let r =
|
|
593
|
-
r && (
|
|
600
|
+
let r = d(t);
|
|
601
|
+
r && (c.add(r), c.add(`${r}[]`));
|
|
594
602
|
});
|
|
595
|
-
let f =
|
|
603
|
+
let f = l(() => {
|
|
596
604
|
t();
|
|
597
605
|
}, n), p = (e) => {
|
|
598
606
|
let t = e.target?.name || "";
|
|
599
|
-
!t || !
|
|
607
|
+
!t || !c.has(t) || f();
|
|
600
608
|
};
|
|
601
609
|
return a.addEventListener("input", p), a.addEventListener("change", p), () => {
|
|
602
610
|
a.removeEventListener("input", p), a.removeEventListener("change", p);
|
|
@@ -606,7 +614,7 @@ function ke(e, t) {
|
|
|
606
614
|
r && r.setAttribute("data-formie-internal-resubmit", "true"), r && typeof r.requestSubmit == "function" ? r.requestSubmit() : r && r.submit();
|
|
607
615
|
},
|
|
608
616
|
releaseSubmitLoading: () => {
|
|
609
|
-
r && (r.removeAttribute("data-formie-internal-resubmit"),
|
|
617
|
+
r && (r.removeAttribute("data-formie-internal-resubmit"), V(r));
|
|
610
618
|
},
|
|
611
619
|
getBillingData: (e) => {
|
|
612
620
|
let t = {};
|
|
@@ -633,13 +641,13 @@ function ke(e, t) {
|
|
|
633
641
|
}
|
|
634
642
|
//#endregion
|
|
635
643
|
//#region src/js/modules/payments/factories.ts
|
|
636
|
-
var Q =
|
|
644
|
+
var Q = r("payments");
|
|
637
645
|
function $(e) {
|
|
638
646
|
let t = e;
|
|
639
647
|
return !t.closest("[data-formie-page-hidden]") && !t.closest("[hidden]");
|
|
640
648
|
}
|
|
641
|
-
function
|
|
642
|
-
let t = e.defaultRequiredInputSuffixes ??
|
|
649
|
+
function Me(e) {
|
|
650
|
+
let t = e.defaultRequiredInputSuffixes ?? we[e.id] ?? [];
|
|
643
651
|
return {
|
|
644
652
|
id: e.id,
|
|
645
653
|
kind: "payment",
|
|
@@ -654,7 +662,7 @@ function Ae(e) {
|
|
|
654
662
|
await a.destroy();
|
|
655
663
|
} catch {}
|
|
656
664
|
}
|
|
657
|
-
let o =
|
|
665
|
+
let o = Ae(e.id, n.options || {}, { defaultRequiredInputSuffixes: t }), s = je(n, o), c = {
|
|
658
666
|
...n,
|
|
659
667
|
options: o,
|
|
660
668
|
services: s
|
|
@@ -775,6 +783,6 @@ function Ae(e) {
|
|
|
775
783
|
}
|
|
776
784
|
//#endregion
|
|
777
785
|
//#region src/js/modules/payments/api.ts
|
|
778
|
-
var
|
|
786
|
+
var Ne = Me;
|
|
779
787
|
//#endregion
|
|
780
|
-
export { F as a,
|
|
788
|
+
export { F as a, b as c, v as d, m as f, V as i, x as l, H as n, B as o, Se as r, se as s, Ne as t, y as u };
|