@odus/checkout 1.14.3 → 1.14.4
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/dist/checkout.es.js +180 -174
- package/dist/components/checkout/form/Form.d.ts +3 -0
- package/dist/components/checkout/form/Form.d.ts.map +1 -1
- package/dist/components/checkout/form/FormComponentManager.d.ts +11 -2
- package/dist/components/checkout/form/FormComponentManager.d.ts.map +1 -1
- package/dist/components/checkout/form/FormStateCoordinator.d.ts +3 -0
- package/dist/components/checkout/form/FormStateCoordinator.d.ts.map +1 -1
- package/dist/components/checkout/form/PaymentMethods.d.ts +2 -1
- package/dist/components/checkout/form/PaymentMethods.d.ts.map +1 -1
- package/dist/components/payment-methods/applePay/ApplePayButton.d.ts +9 -1
- package/dist/components/payment-methods/applePay/ApplePayButton.d.ts.map +1 -1
- package/dist/core/vgs/VGSCollectService.d.ts.map +1 -1
- package/dist/core/vgs/vgs.constants.d.ts +18 -0
- package/dist/core/vgs/vgs.constants.d.ts.map +1 -1
- package/dist/elements/ApplePayElement.d.ts +3 -1
- package/dist/elements/ApplePayElement.d.ts.map +1 -1
- package/dist/elements/OdusElements.d.ts +6 -2
- package/dist/elements/OdusElements.d.ts.map +1 -1
- package/dist/elements/PhoneElement.d.ts +13 -0
- package/dist/elements/PhoneElement.d.ts.map +1 -1
- package/dist/elements.es.js +204 -167
- package/dist/services/telemetry/CheckoutReadiness.service.d.ts +4 -2
- package/dist/services/telemetry/CheckoutReadiness.service.d.ts.map +1 -1
- package/dist/shared.js +751 -690
- package/dist/types/telemetry/TelemetryEvents.type.d.ts +9 -1
- package/dist/types/telemetry/TelemetryEvents.type.d.ts.map +1 -1
- package/dist/utils/helpers/errorClass.util.d.ts +10 -0
- package/dist/utils/helpers/errorClass.util.d.ts.map +1 -0
- package/dist/utils/helpers/stageFailure.util.d.ts +7 -1
- package/dist/utils/helpers/stageFailure.util.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/elements.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as e, C as t, F as n, G as r, H as i, I as a, J as o, K as s, L as c, Q as l, R as u, S as ee, T as te, U as ne, W as re, X as d, Y as
|
|
1
|
+
import { $ as e, C as t, F as n, G as r, H as i, I as a, J as o, K as s, L as c, Q as l, R as u, S as ee, T as te, U as ne, W as re, X as d, Y as ie, _t as ae, a as oe, at as f, c as se, d as p, dt as m, et as ce, f as h, ft as g, g as le, gt as _, ht as v, i as ue, lt as y, mt as b, n as de, nt as x, o as fe, ot as pe, pt as S, q as me, r as he, rt as C, s as ge, st as w, t as T, tt as _e, u as E, v as ve, vt as D, w as O, x as ye, y as be, z as k } from "./shared.js";
|
|
2
2
|
//#region libs/checkout/src/assets/styles/helperText.css?inline
|
|
3
|
-
var
|
|
3
|
+
var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-index:3;position:relative}.form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inherit);font-size:12px;font-weight:500;line-height:var(--odus-helper-text-line-height,14px);background:var(--odus-color-background,#fff);pointer-events:none;transition:opacity .2s ease-in-out;display:block;position:absolute;top:2px;left:0;right:0}.form-helper-text-hidden{opacity:0;visibility:hidden}.form-helper-text-hint{color:var(--odus-color-muted,#6b7280);font-weight:400}", j = ".input-wrapper{box-sizing:border-box;flex-direction:column;align-items:stretch;width:100%;min-width:0;display:flex}.input-wrapper *{box-sizing:border-box}.form-input{opacity:1;font-size:var(--odus-input-font-size,16px);font-weight:var(--odus-input-font-weight,400);letter-spacing:var(--odus-input-letter-spacing,.02em);box-shadow:0 0 0 1px var(--odus-border-color,#e0e0e0), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d;background:var(--odus-color-background,#fff);padding:var(--odus-input-padding,8px 12px);line-height:var(--odus-input-line-height,1.5);z-index:0;box-sizing:border-box;border:none;outline:none;flex:1;width:100%;min-height:0;transition:box-shadow .1s ease-in,border-radius .2s ease-in}.form-input[name=cardNumber]{padding-right:100px}.form-input-error{box-shadow:0 0 0 1px var(--odus-color-error,#dc2727), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d}.form-input::placeholder{color:var(--odus-input-placeholder-color,#717173);opacity:var(--odus-input-placeholder-opacity,.3)}.form-input:focus{z-index:2;position:relative;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}", M = ".input-label{font-family:var(--odus-font-family,inherit);font-size:var(--odus-label-font-size,14px);font-weight:var(--odus-label-font-weight,400);color:var(--odus-label-color,var(--odus-color-text,#1a1a1a));letter-spacing:var(--odus-label-letter-spacing,normal);line-height:var(--odus-label-line-height,1.4);margin-bottom:var(--odus-label-margin-bottom,6px)}", N = ":host{--odus-font-family:system-ui, sans-serif;--odus-font-size:16px;--odus-color-error:#dc2727;--odus-color-text:#1a1a1a;--odus-color-background:#fff;--odus-border-color:#e0e0e0;--odus-border-radius:6px;--odus-spacing-sm:8px;--odus-spacing-md:16px;--odus-spacing-lg:24px;--odus-input-height:44px;--odus-input-padding:8px 12px;--odus-input-font-size:var(--odus-font-size);--odus-input-font-weight:400;--odus-input-letter-spacing:.02em;--odus-input-line-height:1.5;--odus-input-placeholder-color:#717173;--odus-input-placeholder-opacity:.3;--odus-input-focus-shadow:0 0 0 1px #3297d3b3, 0 1px 1px 0 #00000012, 0 0 0 4px #3297d34d;--odus-label-font-size:14px;--odus-label-font-weight:400;--odus-label-color:var(--odus-color-text);--odus-label-letter-spacing:normal;--odus-label-line-height:1.4;--odus-label-margin-bottom:6px;--odus-card-gap:12px;--odus-button-height:48px;--odus-button-border-radius:var(--odus-border-radius)}.form-input{opacity:1;font-weight:var(--odus-input-font-weight,400);letter-spacing:var(--odus-input-letter-spacing,.02em);box-shadow:0 0 0 1px var(--odus-border-color,#e0e0e0), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d;background:var(--odus-color-background,#fff);padding:var(--odus-input-padding,8px 12px);line-height:var(--odus-input-line-height,1.5);z-index:0;box-sizing:border-box;border:none;outline:none;flex:1;width:100%;min-height:0;transition:box-shadow .1s ease-in,border-radius .2s ease-in}.form-input::placeholder{color:var(--odus-input-placeholder-color,#717173);opacity:var(--odus-input-placeholder-opacity,.3)}.form-input:focus{box-shadow:var(--odus-input-focus-shadow,0 0 0 1px #3297d3b3, 0 1px 1px 0 #00000012, 0 0 0 4px #3297d34d);z-index:2;position:relative}.input-label{font-family:var(--odus-font-family,inherit)!important;font-size:var(--odus-label-font-size,14px)!important;font-weight:var(--odus-label-font-weight,400)!important;color:var(--odus-label-color,var(--odus-color-text,#1a1a1a))!important;letter-spacing:var(--odus-label-letter-spacing,normal)!important;line-height:var(--odus-label-line-height,1.4)!important;margin-bottom:var(--odus-label-margin-bottom,6px)!important}.form-helper-text{font-family:var(--odus-font-family,inherit)!important}", P = (e) => typeof e == "string" ? e : e instanceof HTMLElement ? e.id ? `#${e.id}` : e.tagName.toLowerCase() : String(e), F = class {
|
|
4
4
|
shadowRoot = null;
|
|
5
5
|
host = null;
|
|
6
6
|
options = {};
|
|
@@ -24,9 +24,9 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
24
24
|
t = !0, this.mountTarget = e, this.attach(n);
|
|
25
25
|
} catch (n) {
|
|
26
26
|
throw this.unmount(), C(g.CHECKOUT_MOUNT_FAILED, {
|
|
27
|
-
container_id:
|
|
27
|
+
container_id: P(e),
|
|
28
28
|
error_message: n instanceof Error ? n.message : "Unknown error"
|
|
29
|
-
}),
|
|
29
|
+
}), x(n instanceof Error ? n : /* @__PURE__ */ Error("Failed to mount element"), { container_id: P(e) }), this._mountFailureListener?.(t ? S.MOUNT_FAILED : S.CONTAINER_NOT_FOUND), n;
|
|
30
30
|
}
|
|
31
31
|
this.emit("ready");
|
|
32
32
|
}
|
|
@@ -82,17 +82,17 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
82
82
|
this.options.callbacks?.[e]?.(t);
|
|
83
83
|
}
|
|
84
84
|
getCss() {
|
|
85
|
-
return
|
|
85
|
+
return N;
|
|
86
86
|
}
|
|
87
|
-
},
|
|
87
|
+
}, I = class extends F {
|
|
88
88
|
_value = "";
|
|
89
89
|
_error = null;
|
|
90
90
|
_input = null;
|
|
91
91
|
render() {
|
|
92
92
|
if (!this.shadowRoot) return;
|
|
93
93
|
this._input?.getElement().remove();
|
|
94
|
-
let { t: e } =
|
|
95
|
-
this._input = new
|
|
94
|
+
let { t: e } = O();
|
|
95
|
+
this._input = new h({
|
|
96
96
|
name: "billingAddress.city",
|
|
97
97
|
label: this.options.label ?? e("address.townCity"),
|
|
98
98
|
error: !1,
|
|
@@ -103,15 +103,15 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
103
103
|
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
104
104
|
}
|
|
105
105
|
}), this._input.addEventListener("blur", () => {
|
|
106
|
-
let { t: e } =
|
|
106
|
+
let { t: e } = O();
|
|
107
107
|
this._error = this._value.trim() ? null : e("validation.townCityRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
108
108
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
109
109
|
}
|
|
110
110
|
getCss() {
|
|
111
111
|
return super.getCss() + [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
j,
|
|
113
|
+
M,
|
|
114
|
+
A
|
|
115
115
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
116
116
|
}
|
|
117
117
|
getValue() {
|
|
@@ -123,7 +123,7 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
123
123
|
getError() {
|
|
124
124
|
return this._error;
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, L = ".input-wrapper{box-sizing:border-box;flex-direction:column;align-items:stretch;width:100%;min-width:0;display:flex}.input-wrapper *{box-sizing:border-box}.form-select{opacity:1;letter-spacing:.02em;padding:var(--odus-input-padding,8px 12px);z-index:0;box-sizing:border-box;cursor:pointer;appearance:none;background:#fff url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2 3.5L5 6.5L8 3.5' stroke='%23717173' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") right 12px center no-repeat;border:none;outline:none;flex:1;width:100%;min-height:0;padding-right:32px;font-weight:400;line-height:1.5;transition:box-shadow .1s ease-in,border-radius .2s ease-in;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d}.form-select-error{box-shadow:0 0 0 1px var(--odus-color-error,#dc2727), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d}.form-select-placeholder{color:#d4d4d5}.form-select option[disabled]{color:#717173;opacity:.5}.form-select:focus{z-index:2;position:relative;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}", R = class extends F {
|
|
127
127
|
_value = "";
|
|
128
128
|
_error = null;
|
|
129
129
|
_select = null;
|
|
@@ -134,28 +134,28 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
134
134
|
render() {
|
|
135
135
|
if (!this.shadowRoot) return;
|
|
136
136
|
this._select?.getElement().remove(), this.options.initialValue && !this._value && (this._value = String(this.options.initialValue), this.emit("change", this._value));
|
|
137
|
-
let { t: e, locale: t } =
|
|
138
|
-
this._select = new
|
|
137
|
+
let { t: e, locale: t } = O();
|
|
138
|
+
this._select = new p({
|
|
139
139
|
name: "billingAddress.country",
|
|
140
140
|
label: this.options.label ?? e("address.chooseCountry"),
|
|
141
141
|
error: !1,
|
|
142
142
|
placeholder: this.options.placeholder ?? e("address.chooseCountry"),
|
|
143
143
|
value: this._value,
|
|
144
|
-
options:
|
|
144
|
+
options: le(this._allowedCountries, t),
|
|
145
145
|
autocomplete: "country",
|
|
146
146
|
onChange: (e) => {
|
|
147
147
|
this._value = e.target.value, this._error = null, this.emit("change", this._value);
|
|
148
148
|
}
|
|
149
149
|
}), this._select.addEventListener("blur", () => {
|
|
150
|
-
let { t: e } =
|
|
150
|
+
let { t: e } = O();
|
|
151
151
|
this._error = this._value ? null : e("validation.countryRequired"), this._select?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
152
152
|
}), this.shadowRoot.appendChild(this._select.getElement());
|
|
153
153
|
}
|
|
154
154
|
getCss() {
|
|
155
155
|
return super.getCss() + [
|
|
156
|
-
P,
|
|
157
156
|
M,
|
|
158
|
-
|
|
157
|
+
A,
|
|
158
|
+
L
|
|
159
159
|
].join("\n") + "\n :host { display: block; }\n .form-select {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background-color: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-select:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-select-error {\n color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
160
160
|
}
|
|
161
161
|
getValue() {
|
|
@@ -167,15 +167,15 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
167
167
|
getError() {
|
|
168
168
|
return this._error;
|
|
169
169
|
}
|
|
170
|
-
},
|
|
170
|
+
}, z = class extends F {
|
|
171
171
|
_value = "";
|
|
172
172
|
_error = null;
|
|
173
173
|
_input = null;
|
|
174
174
|
render() {
|
|
175
175
|
if (!this.shadowRoot) return;
|
|
176
176
|
this._input?.getElement().remove();
|
|
177
|
-
let { t: e } =
|
|
178
|
-
this._input = new
|
|
177
|
+
let { t: e } = O();
|
|
178
|
+
this._input = new h({
|
|
179
179
|
name: "billingAddress.firstName",
|
|
180
180
|
label: this.options.label ?? e("address.firstName"),
|
|
181
181
|
error: !1,
|
|
@@ -186,15 +186,15 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
186
186
|
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
187
187
|
}
|
|
188
188
|
}), this._input.addEventListener("blur", () => {
|
|
189
|
-
let { t: e } =
|
|
189
|
+
let { t: e } = O();
|
|
190
190
|
this._error = this._value.trim() ? null : e("validation.firstNameRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
191
191
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
192
192
|
}
|
|
193
193
|
getCss() {
|
|
194
194
|
return super.getCss() + [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
j,
|
|
196
|
+
M,
|
|
197
|
+
A
|
|
198
198
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
199
199
|
}
|
|
200
200
|
getValue() {
|
|
@@ -206,15 +206,15 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
206
206
|
getError() {
|
|
207
207
|
return this._error;
|
|
208
208
|
}
|
|
209
|
-
},
|
|
209
|
+
}, B = class extends F {
|
|
210
210
|
_value = "";
|
|
211
211
|
_error = null;
|
|
212
212
|
_input = null;
|
|
213
213
|
render() {
|
|
214
214
|
if (!this.shadowRoot) return;
|
|
215
215
|
this._input?.getElement().remove();
|
|
216
|
-
let { t: e } =
|
|
217
|
-
this._input = new
|
|
216
|
+
let { t: e } = O();
|
|
217
|
+
this._input = new h({
|
|
218
218
|
name: "billingAddress.lastName",
|
|
219
219
|
label: this.options.label ?? e("address.lastName"),
|
|
220
220
|
error: !1,
|
|
@@ -225,15 +225,15 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
225
225
|
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
226
226
|
}
|
|
227
227
|
}), this._input.addEventListener("blur", () => {
|
|
228
|
-
let { t: e } =
|
|
228
|
+
let { t: e } = O();
|
|
229
229
|
this._error = this._value.trim() ? null : e("validation.lastNameRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
230
230
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
231
231
|
}
|
|
232
232
|
getCss() {
|
|
233
233
|
return super.getCss() + [
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
j,
|
|
235
|
+
M,
|
|
236
|
+
A
|
|
237
237
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
238
238
|
}
|
|
239
239
|
getValue() {
|
|
@@ -245,7 +245,7 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
245
245
|
getError() {
|
|
246
246
|
return this._error;
|
|
247
247
|
}
|
|
248
|
-
},
|
|
248
|
+
}, V = class extends F {
|
|
249
249
|
_value = "";
|
|
250
250
|
_country = "";
|
|
251
251
|
_input = null;
|
|
@@ -255,18 +255,18 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
255
255
|
if (this._country = e, !this.shadowRoot) return;
|
|
256
256
|
let n = u(t), r = u(e);
|
|
257
257
|
if (n && r && t !== e) {
|
|
258
|
-
let { t } =
|
|
258
|
+
let { t } = O(), n = k(e), r = t(c(n));
|
|
259
259
|
this._select?.setOptions(a(n), this.options.placeholder ?? r), this._select?.setValue(""), this._value = "", this.emit("change", this._value);
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
262
|
n !== r && (this._value = "", this.render(), this.emit("change", this._value));
|
|
263
263
|
}
|
|
264
264
|
render() {
|
|
265
|
-
this.shadowRoot && (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null, u(this._country) ? this._renderSelect(
|
|
265
|
+
this.shadowRoot && (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null, u(this._country) ? this._renderSelect(k(this._country)) : this._renderInput());
|
|
266
266
|
}
|
|
267
267
|
_renderInput() {
|
|
268
|
-
let { t: e } =
|
|
269
|
-
this._input = new
|
|
268
|
+
let { t: e } = O();
|
|
269
|
+
this._input = new h({
|
|
270
270
|
name: "billingAddress.state",
|
|
271
271
|
label: this.options.label ?? e("address.state"),
|
|
272
272
|
error: !1,
|
|
@@ -282,8 +282,8 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
282
282
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
283
283
|
}
|
|
284
284
|
_renderSelect(e) {
|
|
285
|
-
let { t } =
|
|
286
|
-
this._select = new
|
|
285
|
+
let { t } = O(), n = a(e), r = t(c(e));
|
|
286
|
+
this._select = new p({
|
|
287
287
|
name: "billingAddress.state",
|
|
288
288
|
label: this.options.label ?? t("address.state"),
|
|
289
289
|
error: !1,
|
|
@@ -301,10 +301,10 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
301
301
|
}
|
|
302
302
|
getCss() {
|
|
303
303
|
return super.getCss() + [
|
|
304
|
-
|
|
305
|
-
P,
|
|
304
|
+
j,
|
|
306
305
|
M,
|
|
307
|
-
|
|
306
|
+
A,
|
|
307
|
+
L
|
|
308
308
|
].join("\n") + "\n :host { display: block; }\n .form-input,\n .form-select {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background-color: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus,\n .form-select:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error,\n .form-select-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
309
309
|
}
|
|
310
310
|
getValue() {
|
|
@@ -315,18 +315,18 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
315
315
|
}
|
|
316
316
|
getError() {
|
|
317
317
|
if (this.getIsValid()) return null;
|
|
318
|
-
let { t: e } =
|
|
318
|
+
let { t: e } = O();
|
|
319
319
|
return e("validation.stateRequired");
|
|
320
320
|
}
|
|
321
|
-
},
|
|
321
|
+
}, H = class extends F {
|
|
322
322
|
_value = "";
|
|
323
323
|
_error = null;
|
|
324
324
|
_input = null;
|
|
325
325
|
render() {
|
|
326
326
|
if (!this.shadowRoot) return;
|
|
327
327
|
this._input?.getElement().remove();
|
|
328
|
-
let { t: e } =
|
|
329
|
-
this._input = new
|
|
328
|
+
let { t: e } = O();
|
|
329
|
+
this._input = new h({
|
|
330
330
|
name: "billingAddress.street",
|
|
331
331
|
label: this.options.label ?? e("address.addressLine1"),
|
|
332
332
|
error: !1,
|
|
@@ -342,15 +342,15 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
342
342
|
this.emit("change", this._value);
|
|
343
343
|
}
|
|
344
344
|
}), this._input.addEventListener("blur", () => {
|
|
345
|
-
let { t: e } =
|
|
345
|
+
let { t: e } = O();
|
|
346
346
|
this._error = this._value.trim() ? null : e("validation.addressLine1Required"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
347
347
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
348
348
|
}
|
|
349
349
|
getCss() {
|
|
350
350
|
return super.getCss() + [
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
351
|
+
j,
|
|
352
|
+
M,
|
|
353
|
+
A
|
|
354
354
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
355
355
|
}
|
|
356
356
|
getValue() {
|
|
@@ -362,15 +362,15 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
362
362
|
getError() {
|
|
363
363
|
return this._error;
|
|
364
364
|
}
|
|
365
|
-
},
|
|
365
|
+
}, U = class extends F {
|
|
366
366
|
_value = "";
|
|
367
367
|
_error = null;
|
|
368
368
|
_input = null;
|
|
369
369
|
render() {
|
|
370
370
|
if (!this.shadowRoot) return;
|
|
371
371
|
this._input?.getElement().remove();
|
|
372
|
-
let { t: e } =
|
|
373
|
-
this._input = new
|
|
372
|
+
let { t: e } = O();
|
|
373
|
+
this._input = new h({
|
|
374
374
|
name: "billingAddress.zipCode",
|
|
375
375
|
label: this.options.label ?? e("address.postalCode"),
|
|
376
376
|
error: !1,
|
|
@@ -381,15 +381,15 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
381
381
|
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
382
382
|
}
|
|
383
383
|
}), this._input.addEventListener("blur", () => {
|
|
384
|
-
let { t: e } =
|
|
384
|
+
let { t: e } = O();
|
|
385
385
|
this._error = this._value.trim() ? null : e("validation.postalCodeRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
386
386
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
387
387
|
}
|
|
388
388
|
getCss() {
|
|
389
389
|
return super.getCss() + [
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
390
|
+
j,
|
|
391
|
+
M,
|
|
392
|
+
A
|
|
393
393
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
394
394
|
}
|
|
395
395
|
getValue() {
|
|
@@ -401,7 +401,7 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
401
401
|
getError() {
|
|
402
402
|
return this._error;
|
|
403
403
|
}
|
|
404
|
-
},
|
|
404
|
+
}, xe = "apple-pay-button{appearance:-apple-pay-button;-apple-pay-button-type:plain;-apple-pay-button-style:black;cursor:pointer;box-sizing:border-box;border-radius:4px;width:100%;height:40px;min-height:40px;display:inline-block}apple-pay-button:hover{filter:brightness(.9)}", Se = {
|
|
405
405
|
name: "odus-elements",
|
|
406
406
|
styles: {
|
|
407
407
|
fontSize: 14,
|
|
@@ -425,7 +425,7 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
425
425
|
}
|
|
426
426
|
},
|
|
427
427
|
additionalPaymentMethods: {}
|
|
428
|
-
},
|
|
428
|
+
}, W = class extends F {
|
|
429
429
|
_paymentContext = null;
|
|
430
430
|
_applePayData = null;
|
|
431
431
|
_authorized = !1;
|
|
@@ -443,17 +443,17 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
443
443
|
this._setAvailability(!1);
|
|
444
444
|
return;
|
|
445
445
|
}
|
|
446
|
-
let { paymentId: e, checkoutKey: t, environment: n, checkoutDetails: r, displayName: i, countries: a, requiredBillingContactFields: o, requiredShippingContactFields: s, onAuthorize: c, onStartFailed: l } = this._paymentContext;
|
|
447
|
-
if (!
|
|
446
|
+
let { paymentId: e, checkoutKey: t, environment: n, checkoutDetails: r, displayName: i, countries: a, requiredBillingContactFields: o, requiredShippingContactFields: s, onAuthorize: c, onStartFailed: l, onPaymentDataFailed: u } = this._paymentContext;
|
|
447
|
+
if (!oe(a, r?.countryCode)) {
|
|
448
448
|
this._setAvailability(!1);
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
|
-
if (!
|
|
451
|
+
if (!ue()) {
|
|
452
452
|
this._setAvailability(!1);
|
|
453
453
|
return;
|
|
454
454
|
}
|
|
455
|
-
this._button = new
|
|
456
|
-
checkoutProfile:
|
|
455
|
+
this._button = new he({
|
|
456
|
+
checkoutProfile: Se,
|
|
457
457
|
paymentId: e,
|
|
458
458
|
checkoutKey: t,
|
|
459
459
|
environment: n,
|
|
@@ -462,6 +462,7 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
462
462
|
requiredBillingContactFields: o,
|
|
463
463
|
requiredShippingContactFields: s,
|
|
464
464
|
onStartFailed: l,
|
|
465
|
+
onPaymentDataFailed: u,
|
|
465
466
|
onSubmit: async ({ applePayData: e }) => {
|
|
466
467
|
if (!e) return !1;
|
|
467
468
|
this._applePayData = e, this._authorized = !0, this.emit("change", e);
|
|
@@ -474,7 +475,7 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
474
475
|
this._isAvailable = e, this.host && (e ? this.host.style.removeProperty("display") : this.host.style.display = "none");
|
|
475
476
|
}
|
|
476
477
|
getCss() {
|
|
477
|
-
return super.getCss() +
|
|
478
|
+
return super.getCss() + xe + "\n :host { display: block; }\n apple-pay-button {\n width: 100%;\n height: var(--odus-button-height, 48px);\n border-radius: var(--odus-button-border-radius, 6px);\n }\n ";
|
|
478
479
|
}
|
|
479
480
|
getValue() {
|
|
480
481
|
return this._applePayData;
|
|
@@ -485,7 +486,7 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
485
486
|
getError() {
|
|
486
487
|
return null;
|
|
487
488
|
}
|
|
488
|
-
},
|
|
489
|
+
}, G = ".card-icon{opacity:1;width:18px;transition:opacity .6s ease-in}.card-icon img{max-width:100%;height:auto;display:block}.cards-position{z-index:10;pointer-events:none;align-items:center;gap:8px;display:flex;position:absolute;top:50%;right:12px;transform:translateY(-50%)}.loading{position:relative}.loading:after{content:\"\";border-radius:inherit;background-color:#fff;width:100%;height:100%;position:absolute;inset:0}@media only screen and (min-width:600px){.card-icon{width:20px}}.vgs-card-group iframe,.vgs-wrap iframe{width:100%;min-width:0;display:block}.fake-ph{color:#717173;opacity:.3;font-size:var(--odus-input-font-size,16px);letter-spacing:.02em;font-weight:400;line-height:1.5;font-family:var(--odus-font-family,inherit);pointer-events:none;-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:0;background:#fff;align-items:center;padding:8px 12px;display:flex;position:absolute;inset:0}@keyframes vgs-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.vgs-field-skeleton{pointer-events:none;z-index:11;border-radius:inherit;background:linear-gradient(90deg,#f7f7f7 25%,#fdfdfd 50%,#f7f7f7 75%) 0 0/200% 100%;animation:1.5s ease-in-out infinite vgs-shimmer;position:absolute;inset:0}.card-unavailable-message{color:var(--odus-color-error,#dc2727);background:color-mix(in srgb, var(--odus-color-error,#dc2727) 6%, transparent);box-shadow:0 0 0 1px var(--odus-color-error,#dc2727);box-sizing:border-box;padding:12px;line-height:1.4}.card-pending{width:100%;position:relative;overflow:hidden}", K = {
|
|
489
490
|
name: "odus-elements",
|
|
490
491
|
styles: {
|
|
491
492
|
fontSize: 14,
|
|
@@ -533,11 +534,11 @@ var M = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
533
534
|
"--odus-button-height": "48px",
|
|
534
535
|
"--odus-button-border-radius": "var(--odus-border-radius)"
|
|
535
536
|
}["--odus-font-size"];
|
|
536
|
-
function
|
|
537
|
+
function Ce(e, t) {
|
|
537
538
|
let n = Object.keys(e);
|
|
538
539
|
return n.length === Object.keys(t).length && n.every((n) => e[n] === t[n]);
|
|
539
540
|
}
|
|
540
|
-
var
|
|
541
|
+
var we = class {
|
|
541
542
|
_vgsService;
|
|
542
543
|
_vgsJwt;
|
|
543
544
|
_vgsState = {};
|
|
@@ -558,8 +559,8 @@ var Ce = class {
|
|
|
558
559
|
}
|
|
559
560
|
renderSection(e, t) {
|
|
560
561
|
this._section?.getElement().remove();
|
|
561
|
-
let { t: n } =
|
|
562
|
-
this._section = new
|
|
562
|
+
let { t: n } = O();
|
|
563
|
+
this._section = new se({
|
|
563
564
|
checkoutProfile: K,
|
|
564
565
|
translationFunc: n,
|
|
565
566
|
vgsService: this._vgsService
|
|
@@ -572,7 +573,7 @@ var Ce = class {
|
|
|
572
573
|
}
|
|
573
574
|
_onChangeEmit = null;
|
|
574
575
|
initVgs() {
|
|
575
|
-
let e = ++this._initGeneration, t = { ...this._currentTheme }, n =
|
|
576
|
+
let e = ++this._initGeneration, t = { ...this._currentTheme }, n = ye(this._buildProfileFromTheme(t).styles.fontFamily);
|
|
576
577
|
this._vgsService.init(this._environment).then((r) => {
|
|
577
578
|
e === this._initGeneration && (this._vgsService.createForm(r, (e) => this._handleStateChange(e)), this._mountFields(e, t, n).catch((t) => {
|
|
578
579
|
e === this._initGeneration && (console.error("Failed to mount VGS card fields:", t), this._onFieldsNotReady?.());
|
|
@@ -582,7 +583,7 @@ var Ce = class {
|
|
|
582
583
|
});
|
|
583
584
|
}
|
|
584
585
|
async getPayload() {
|
|
585
|
-
if (!this._vgsJwt) throw l(/* @__PURE__ */ Error("VGS not initialized"),
|
|
586
|
+
if (!this._vgsJwt) throw l(/* @__PURE__ */ Error("VGS not initialized"), D.NOT_INITIALIZED);
|
|
586
587
|
let e = await this._vgsService.createCard(this._vgsJwt);
|
|
587
588
|
return {
|
|
588
589
|
cardId: e.cardId,
|
|
@@ -595,12 +596,12 @@ var Ce = class {
|
|
|
595
596
|
return this._vgsFieldsValid;
|
|
596
597
|
}
|
|
597
598
|
getError() {
|
|
598
|
-
let { t: e } =
|
|
599
|
+
let { t: e } = O();
|
|
599
600
|
for (let [t, n] of Object.entries(this._vgsState)) {
|
|
600
601
|
if (!n?.isTouched || n.isFocused || n.isValid) continue;
|
|
601
602
|
let r = n.errors?.[0];
|
|
602
603
|
if (!r) continue;
|
|
603
|
-
let i =
|
|
604
|
+
let i = E(t, r.code);
|
|
604
605
|
if (i) return e(i);
|
|
605
606
|
}
|
|
606
607
|
return null;
|
|
@@ -610,7 +611,7 @@ var Ce = class {
|
|
|
610
611
|
...this._currentTheme,
|
|
611
612
|
...e
|
|
612
613
|
};
|
|
613
|
-
|
|
614
|
+
Ce(this._currentTheme, t) || (this._currentTheme = t, this._section && (this._applySkeletonMetrics(), this._reinitWithTheme()));
|
|
614
615
|
}
|
|
615
616
|
resetTheme(e) {
|
|
616
617
|
let t = e.filter((e) => e in this._currentTheme);
|
|
@@ -658,7 +659,7 @@ var Ce = class {
|
|
|
658
659
|
placeholderColor: t["--odus-input-placeholder-color"],
|
|
659
660
|
placeholderOpacity: t["--odus-input-placeholder-opacity"],
|
|
660
661
|
padding: t["--odus-input-padding"]
|
|
661
|
-
}), { t: c } =
|
|
662
|
+
}), { t: c } = O();
|
|
662
663
|
this._vgsService.mountCardFields({
|
|
663
664
|
cardNumber: a.cardNumber ? `#${a.cardNumber}` : void 0,
|
|
664
665
|
cardExpiry: a.cardExpiry ? `#${a.cardExpiry}` : void 0,
|
|
@@ -678,7 +679,7 @@ var Ce = class {
|
|
|
678
679
|
}
|
|
679
680
|
_handleStateChange(e) {
|
|
680
681
|
this._vgsState = e, this._vgsFieldsValid = Object.values(e).every((e) => e?.isValid === !0);
|
|
681
|
-
let { t } =
|
|
682
|
+
let { t } = O(), n = this._deriveFieldErrors(t);
|
|
682
683
|
this._section?.handleVgsStateChange(e, n), this._onChangeEmit?.();
|
|
683
684
|
}
|
|
684
685
|
_deriveFieldErrors(e) {
|
|
@@ -687,19 +688,19 @@ var Ce = class {
|
|
|
687
688
|
if (!r?.isTouched || r.isFocused || r.isValid) continue;
|
|
688
689
|
let i = r.errors?.[0];
|
|
689
690
|
if (!i) continue;
|
|
690
|
-
let a =
|
|
691
|
+
let a = E(n, i.code);
|
|
691
692
|
a && (t[n] = e(a));
|
|
692
693
|
}
|
|
693
694
|
return t;
|
|
694
695
|
}
|
|
695
|
-
},
|
|
696
|
+
}, Te = "Card capture is unavailable: no tokenization session", J = class extends F {
|
|
696
697
|
elementName = "CardElement";
|
|
697
698
|
_environment = "test";
|
|
698
699
|
_captureState = "pending";
|
|
699
700
|
_vgsAdapter = null;
|
|
700
701
|
_vgsJwt = null;
|
|
701
702
|
_reportedUnavailable = !1;
|
|
702
|
-
_unavailableReason =
|
|
703
|
+
_unavailableReason = m.NO_TOKENIZATION_SESSION;
|
|
703
704
|
_loadOutcomeListener = null;
|
|
704
705
|
get isVgsMode() {
|
|
705
706
|
return this._captureState === "vgs";
|
|
@@ -716,12 +717,12 @@ var Ce = class {
|
|
|
716
717
|
setVgsJwt(e) {
|
|
717
718
|
if (this._vgsAdapter && this._vgsJwt === e) return;
|
|
718
719
|
this._captureState = "vgs", this._reportedUnavailable = !1, this._vgsJwt = e, this._vgsAdapter?.destroy();
|
|
719
|
-
let t = new
|
|
720
|
+
let t = new we(e, this._environment, {
|
|
720
721
|
onInitFailure: () => {
|
|
721
|
-
this._vgsAdapter === t && this.isMounted && this.markCaptureUnavailable(
|
|
722
|
+
this._vgsAdapter === t && this.isMounted && this.markCaptureUnavailable(m.INIT_FAILED);
|
|
722
723
|
},
|
|
723
724
|
onFieldsNotReady: () => {
|
|
724
|
-
this._vgsAdapter === t && this.isMounted && this.markCaptureUnavailable(
|
|
725
|
+
this._vgsAdapter === t && this.isMounted && this.markCaptureUnavailable(m.FIELDS_NOT_READY);
|
|
725
726
|
},
|
|
726
727
|
onFieldsReady: () => {
|
|
727
728
|
this._vgsAdapter === t && this.isMounted && this._loadOutcomeListener?.({ status: "ready" });
|
|
@@ -729,7 +730,7 @@ var Ce = class {
|
|
|
729
730
|
});
|
|
730
731
|
this._vgsAdapter = t, this.isMounted && this.mountTarget && (this.unmount(), this.mount(this.mountTarget));
|
|
731
732
|
}
|
|
732
|
-
markCaptureUnavailable(e =
|
|
733
|
+
markCaptureUnavailable(e = m.NO_TOKENIZATION_SESSION) {
|
|
733
734
|
if (this._captureState === "unavailable") return;
|
|
734
735
|
let t = this.mountTarget, n = this.isMounted && t !== null;
|
|
735
736
|
this.isMounted && this.unmount(), this._unavailableReason = e, this._captureState = "unavailable", this._vgsAdapter?.destroy(), this._vgsAdapter = null, this._vgsJwt = null, n && t && this.mount(t);
|
|
@@ -775,7 +776,7 @@ var Ce = class {
|
|
|
775
776
|
this.clearBody();
|
|
776
777
|
let e = document.createElement("div");
|
|
777
778
|
e.className = "card-pending";
|
|
778
|
-
let t =
|
|
779
|
+
let t = be(ve, K.styles.fontSize);
|
|
779
780
|
e.style.height = `calc((${t}) * 2 - 1px)`, e.style.borderRadius = `var(--odus-border-radius, ${K.styles.borderRadius}px)`;
|
|
780
781
|
let n = document.createElement("div");
|
|
781
782
|
n.className = "vgs-field-skeleton", e.appendChild(n), this.shadowRoot.appendChild(e);
|
|
@@ -783,7 +784,7 @@ var Ce = class {
|
|
|
783
784
|
renderUnavailableNotice() {
|
|
784
785
|
if (!this.shadowRoot) return;
|
|
785
786
|
this.clearBody();
|
|
786
|
-
let { t: e } =
|
|
787
|
+
let { t: e } = O(), t = new ge({
|
|
787
788
|
checkoutProfile: K,
|
|
788
789
|
translationFunc: e
|
|
789
790
|
});
|
|
@@ -809,10 +810,10 @@ var Ce = class {
|
|
|
809
810
|
}
|
|
810
811
|
getCss() {
|
|
811
812
|
return super.getCss() + [
|
|
812
|
-
|
|
813
|
-
P,
|
|
813
|
+
j,
|
|
814
814
|
M,
|
|
815
|
-
|
|
815
|
+
A,
|
|
816
|
+
G
|
|
816
817
|
].join("\n") + "\n :host { display: block; }\n .card-grid {\n display: flex;\n flex-direction: column;\n gap: var(--odus-card-gap, 12px);\n }\n .card-details {\n display: flex;\n gap: var(--odus-card-gap, 12px);\n }\n .form-input,\n .form-select {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus,\n .form-select:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error,\n .form-select-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
817
818
|
}
|
|
818
819
|
getValue() {
|
|
@@ -823,24 +824,24 @@ var Ce = class {
|
|
|
823
824
|
};
|
|
824
825
|
}
|
|
825
826
|
async getPayload() {
|
|
826
|
-
if (this._captureState !== "vgs" || !this._vgsAdapter) throw Error(
|
|
827
|
+
if (this._captureState !== "vgs" || !this._vgsAdapter) throw Error(Te);
|
|
827
828
|
return this._vgsAdapter.getPayload();
|
|
828
829
|
}
|
|
829
830
|
getIsValid() {
|
|
830
831
|
return this._captureState === "unsupported" ? !0 : this._vgsAdapter?.isValid() ?? !1;
|
|
831
832
|
}
|
|
832
833
|
getError() {
|
|
833
|
-
return this._captureState === "unavailable" ?
|
|
834
|
+
return this._captureState === "unavailable" ? O().t("cardUnavailable") : this._vgsAdapter?.getError() ?? null;
|
|
834
835
|
}
|
|
835
|
-
}, Y = class extends
|
|
836
|
+
}, Y = class extends F {
|
|
836
837
|
_value = "";
|
|
837
838
|
_error = null;
|
|
838
839
|
_input = null;
|
|
839
840
|
render() {
|
|
840
841
|
if (!this.shadowRoot) return;
|
|
841
842
|
this._input?.getElement().remove();
|
|
842
|
-
let { t: e } =
|
|
843
|
-
this._input = new
|
|
843
|
+
let { t: e } = O();
|
|
844
|
+
this._input = new h({
|
|
844
845
|
name: "billingAddress.cardholderName",
|
|
845
846
|
label: this.options.label ?? e("cardholderNameLabel"),
|
|
846
847
|
error: !1,
|
|
@@ -852,15 +853,15 @@ var Ce = class {
|
|
|
852
853
|
t !== n && this._input?.setValue(n), this._value = n, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
853
854
|
}
|
|
854
855
|
}), this._input.addEventListener("blur", () => {
|
|
855
|
-
let { t: e } =
|
|
856
|
+
let { t: e } = O();
|
|
856
857
|
this._error = this._value.trim() ? null : e("validation.nameRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
857
858
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
858
859
|
}
|
|
859
860
|
getCss() {
|
|
860
861
|
return super.getCss() + [
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
862
|
+
j,
|
|
863
|
+
M,
|
|
864
|
+
A
|
|
864
865
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
865
866
|
}
|
|
866
867
|
getValue() {
|
|
@@ -872,7 +873,7 @@ var Ce = class {
|
|
|
872
873
|
getError() {
|
|
873
874
|
return this._error;
|
|
874
875
|
}
|
|
875
|
-
},
|
|
876
|
+
}, Ee = {
|
|
876
877
|
name: "odus-elements",
|
|
877
878
|
styles: {
|
|
878
879
|
fontSize: 14,
|
|
@@ -896,7 +897,7 @@ var Ce = class {
|
|
|
896
897
|
}
|
|
897
898
|
},
|
|
898
899
|
additionalPaymentMethods: {}
|
|
899
|
-
}, X = class extends
|
|
900
|
+
}, X = class extends F {
|
|
900
901
|
_email = "";
|
|
901
902
|
_error = null;
|
|
902
903
|
_suggestion = null;
|
|
@@ -904,11 +905,11 @@ var Ce = class {
|
|
|
904
905
|
render() {
|
|
905
906
|
if (!this.shadowRoot) return;
|
|
906
907
|
this._field?.getElement().remove(), this.options.initialValue && !this._email && (this._email = String(this.options.initialValue));
|
|
907
|
-
let { t: e } =
|
|
908
|
-
this._field = new
|
|
908
|
+
let { t: e } = O();
|
|
909
|
+
this._field = new fe({
|
|
909
910
|
value: this._email,
|
|
910
911
|
error: !1,
|
|
911
|
-
checkoutProfile:
|
|
912
|
+
checkoutProfile: Ee,
|
|
912
913
|
translationFunc: e,
|
|
913
914
|
label: this.options.label,
|
|
914
915
|
placeholder: this.options.placeholder,
|
|
@@ -924,9 +925,9 @@ var Ce = class {
|
|
|
924
925
|
}
|
|
925
926
|
getCss() {
|
|
926
927
|
return super.getCss() + [
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
928
|
+
j,
|
|
929
|
+
M,
|
|
930
|
+
A
|
|
930
931
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text-hint {\n color: var(--odus-color-muted, #6b7280) !important;\n }\n ";
|
|
931
932
|
}
|
|
932
933
|
getValue() {
|
|
@@ -941,24 +942,24 @@ var Ce = class {
|
|
|
941
942
|
get suggestion() {
|
|
942
943
|
return this._suggestion;
|
|
943
944
|
}
|
|
944
|
-
},
|
|
945
|
+
}, De = "@keyframes slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.error-alert{background-color:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:16px;animation:.3s ease-out slideIn;box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f}.error-alert-content{align-items:flex-start;gap:12px;display:flex}.error-alert-icon-container{color:#dc2626;background-color:#fee2e2;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;display:flex}.error-alert-icon{color:#dc2626}.error-alert-text-container{flex:1;min-width:0}.error-alert-title{color:#991b1b;margin:0 0 4px;font-size:14px;font-weight:600;line-height:1.4}.error-alert-message{font-family:var(--odus-font-family,inherit);color:#7f1d1d;word-break:break-word;margin:0;font-size:14px;line-height:1.5}", Z = class extends F {
|
|
945
946
|
_alert = null;
|
|
946
947
|
_message = null;
|
|
947
948
|
render() {
|
|
948
|
-
this.shadowRoot && (this._alert?.getElement().remove(), this._alert = null, this._message && (this._alert = new
|
|
949
|
+
this.shadowRoot && (this._alert?.getElement().remove(), this._alert = null, this._message && (this._alert = new T({ message: this._message }), this.shadowRoot.appendChild(this._alert.getElement())));
|
|
949
950
|
}
|
|
950
951
|
setError(e) {
|
|
951
952
|
if (this._message = e, !this.shadowRoot) {
|
|
952
953
|
this.emit("error", e);
|
|
953
954
|
return;
|
|
954
955
|
}
|
|
955
|
-
this._alert ? this._alert.setMessage(e) : (this._alert = new
|
|
956
|
+
this._alert ? this._alert.setMessage(e) : (this._alert = new T({ message: e }), this.shadowRoot.appendChild(this._alert.getElement())), this.emit("error", e);
|
|
956
957
|
}
|
|
957
958
|
clearError() {
|
|
958
959
|
this._message = null, this._alert?.getElement().remove(), this._alert = null;
|
|
959
960
|
}
|
|
960
961
|
getCss() {
|
|
961
|
-
return super.getCss() +
|
|
962
|
+
return super.getCss() + De + "\n :host { display: block; }\n .error-alert-icon,\n .error-alert-icon-container {\n color: var(--odus-color-error, #e53e3e) !important;\n }\n .error-alert-message {\n color: var(--odus-color-text, #1a1a1a) !important;\n }\n ";
|
|
962
963
|
}
|
|
963
964
|
getValue() {
|
|
964
965
|
return null;
|
|
@@ -969,7 +970,7 @@ var Ce = class {
|
|
|
969
970
|
getError() {
|
|
970
971
|
return this._message;
|
|
971
972
|
}
|
|
972
|
-
},
|
|
973
|
+
}, Oe = ".paypal{color:#253b80;text-transform:none;cursor:pointer;background-color:#ffc439;border-radius:4px;padding:8px 16px;font-weight:700;box-shadow:0 2px 4px #0000001a}.paypal:hover{filter:brightness(.95);background-color:#ffc439}.paypal-icon-container{justify-content:center;align-items:center;display:flex}.paypal-icon-container img{width:69px;height:22px}", ke = {
|
|
973
974
|
name: "odus-elements",
|
|
974
975
|
styles: {
|
|
975
976
|
fontSize: 14,
|
|
@@ -993,7 +994,7 @@ var Ce = class {
|
|
|
993
994
|
}
|
|
994
995
|
},
|
|
995
996
|
additionalPaymentMethods: {}
|
|
996
|
-
}, Q = class extends
|
|
997
|
+
}, Q = class extends F {
|
|
997
998
|
_paymentContext = null;
|
|
998
999
|
_button = null;
|
|
999
1000
|
setPaymentContext(e) {
|
|
@@ -1002,8 +1003,8 @@ var Ce = class {
|
|
|
1002
1003
|
render() {
|
|
1003
1004
|
if (!this.shadowRoot || (this._button?.getElement().remove(), this._button = null, !this._paymentContext)) return;
|
|
1004
1005
|
let { onAuthorize: e } = this._paymentContext;
|
|
1005
|
-
this._button = new
|
|
1006
|
-
checkoutProfile:
|
|
1006
|
+
this._button = new de({
|
|
1007
|
+
checkoutProfile: ke,
|
|
1007
1008
|
onSubmit: async () => {
|
|
1008
1009
|
this._button?.setSubmitting(!0);
|
|
1009
1010
|
try {
|
|
@@ -1015,7 +1016,7 @@ var Ce = class {
|
|
|
1015
1016
|
}), this.shadowRoot.appendChild(this._button.getElement());
|
|
1016
1017
|
}
|
|
1017
1018
|
getCss() {
|
|
1018
|
-
return super.getCss() +
|
|
1019
|
+
return super.getCss() + Oe + "\n :host { display: block; }\n .paypal {\n width: 100%;\n box-sizing: border-box;\n border-radius: var(--odus-button-border-radius, 6px);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n ";
|
|
1019
1020
|
}
|
|
1020
1021
|
getValue() {
|
|
1021
1022
|
return null;
|
|
@@ -1026,7 +1027,7 @@ var Ce = class {
|
|
|
1026
1027
|
getError() {
|
|
1027
1028
|
return null;
|
|
1028
1029
|
}
|
|
1029
|
-
},
|
|
1030
|
+
}, Ae = ".country-dial-code-dropdown{display:inline-block;position:relative}.country-dial-code-trigger{padding:var(--odus-input-padding,8px 12px);cursor:pointer;letter-spacing:.02em;font-weight:400;line-height:var(--odus-input-line-height,1.5);white-space:nowrap;box-sizing:border-box;background:#fff;border:none;border-right:1px solid #e0e0e0;align-items:center;gap:6px;padding-right:8px;transition:all .1s ease-in;display:flex}.country-dial-code-trigger:hover{background:#f5f5f5}.country-dial-code-trigger:focus{outline:none}.country-dial-code-trigger .country-flag{font-size:14px;line-height:1}.country-dial-code-trigger .country-chevron{color:#717173;flex-shrink:0;transition:transform .15s}.country-dial-code-trigger[aria-expanded=true] .country-chevron{transform:rotate(180deg)}.country-dial-code-panel{z-index:10000;background:#fff;border-radius:8px;flex-direction:column;width:280px;max-height:360px;display:flex;position:fixed;top:0;left:0;overflow:hidden;box-shadow:0 0 0 1px #0000000d,0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.country-dial-code-panel.hidden{display:none}.country-search-wrapper{border-bottom:1px solid #e0e0e0;flex-shrink:0;padding:12px}.country-search{width:100%;font-size:inherit;box-sizing:border-box;border:1px solid #e0e0e0;border-radius:6px;outline:none;padding:6px 12px;font-family:inherit;transition:all .1s ease-in}.country-search:focus{border-color:#3297d3b3;box-shadow:0 0 0 3px #3297d31a}.country-search::placeholder{color:#717173;opacity:.6}.countries-list{flex:1;min-height:0;overflow-y:auto}.countries-list::-webkit-scrollbar{width:8px}.countries-list::-webkit-scrollbar-track{background:#f5f5f5}.countries-list::-webkit-scrollbar-thumb{background:#d0d0d0;border-radius:4px}.countries-list::-webkit-scrollbar-thumb:hover{background:#b0b0b0}.country-group-header{color:#717173;text-transform:uppercase;letter-spacing:.05em;z-index:1;background:#fafafa;padding:8px 16px 4px;font-size:12px;font-weight:600;position:sticky;top:0}.country-item{cursor:pointer;text-align:left;width:100%;color:inherit;background:#fff;border:none;align-items:center;gap:12px;padding:10px 16px;font-family:inherit;font-size:14px;transition:background .1s;display:flex}.country-item:hover{background:#f5f5f5}.country-item.selected{color:#3297d3;background:#3297d314}.country-item:focus{background:#f0f0f0;outline:none}.country-item .country-flag{flex-shrink:0;font-size:20px;line-height:1}.country-item .country-name{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.country-item .country-dial-code{color:#717173;flex-shrink:0;font-size:.95em}.country-item.selected .country-dial-code{color:#3297d3cc}.no-results{text-align:center;color:#717173;padding:24px 16px;font-size:14px}.phone-number-field-wrapper{width:100%;display:flex}.phone-number-field-container{border-radius:inherit;background:#fff;align-items:center;width:100%;transition:box-shadow .1s ease-in,border-radius .2s ease-in;display:flex;position:relative;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d}.phone-number-field-container.focused{z-index:2;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}.phone-number-field-container.error{box-shadow:0 0 0 1px #dc2727,0 2px 4px #dc27271a}.phone-number-field-container.error.focused{box-shadow:0 0 0 1px #dc2727,0 1px 1px #00000012,0 0 0 4px #dc272733}.phone-number-field-container .country-select-wrapper{padding:var(--odus-input-padding,8px 12px);border-top-left-radius:var(--phone-border-radius,0px);border-bottom-left-radius:var(--phone-border-radius,0px);white-space:nowrap;background:0 0;flex-shrink:0;align-items:center;gap:4px;padding-right:6px;display:flex;position:relative}.phone-number-field-container .country-select-wrapper .country-flag{pointer-events:none;font-size:14px;line-height:1}.phone-number-field-container .country-select-wrapper .country-chevron{color:#717173;pointer-events:none;flex-shrink:0;align-items:center;display:flex}.phone-number-field-container .country-select-wrapper .country-select{cursor:pointer;opacity:0;background:0 0;border:none;outline:none;width:100%;height:100%;position:absolute;inset:0}.phone-number-field-container .phone-input-wrapper{flex:1;min-width:0}.phone-number-field-container .phone-input-wrapper .form-input{box-shadow:none;border-radius:0;border-top-right-radius:var(--phone-border-radius,0px);border-bottom-right-radius:var(--phone-border-radius,0px);padding:var(--odus-input-padding,8px 2px);border:none}.phone-number-field-container .phone-input-wrapper .form-input:focus{box-shadow:none;z-index:auto}", je = {
|
|
1030
1031
|
name: "odus-elements",
|
|
1031
1032
|
styles: {
|
|
1032
1033
|
fontSize: 14,
|
|
@@ -1050,22 +1051,29 @@ var Ce = class {
|
|
|
1050
1051
|
}
|
|
1051
1052
|
},
|
|
1052
1053
|
additionalPaymentMethods: {}
|
|
1053
|
-
}, $ = class extends
|
|
1054
|
+
}, $ = class extends F {
|
|
1054
1055
|
_phone = "";
|
|
1055
1056
|
_error = null;
|
|
1056
1057
|
_field = null;
|
|
1057
1058
|
_renderGeneration = 0;
|
|
1059
|
+
_loadOutcomeListener = null;
|
|
1060
|
+
get isDrawn() {
|
|
1061
|
+
return this._field !== null;
|
|
1062
|
+
}
|
|
1063
|
+
setLoadOutcomeListener(e) {
|
|
1064
|
+
this._loadOutcomeListener = e;
|
|
1065
|
+
}
|
|
1058
1066
|
render() {
|
|
1059
1067
|
if (!this.shadowRoot) return;
|
|
1060
1068
|
this._field?.destroy(), this._field?.getElement().remove(), this._field = null, this.options.initialValue && !this._phone && (this._phone = String(this.options.initialValue));
|
|
1061
1069
|
let e = ++this._renderGeneration;
|
|
1062
1070
|
i().then(({ PhoneNumberField: t }) => {
|
|
1063
1071
|
if (!this.shadowRoot || this._renderGeneration !== e) return;
|
|
1064
|
-
let { t: r, locale: i } =
|
|
1072
|
+
let { t: r, locale: i } = O();
|
|
1065
1073
|
this._field = new t({
|
|
1066
1074
|
value: this._phone,
|
|
1067
1075
|
error: !1,
|
|
1068
|
-
checkoutProfile:
|
|
1076
|
+
checkoutProfile: je,
|
|
1069
1077
|
translationFunc: r,
|
|
1070
1078
|
locale: i,
|
|
1071
1079
|
label: this.options.label,
|
|
@@ -1079,17 +1087,24 @@ var Ce = class {
|
|
|
1079
1087
|
let e = n(), t = this._field?.getCountry();
|
|
1080
1088
|
this._error = e.phoneNumber(this._phone, t) ?? null, this._field?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._phone);
|
|
1081
1089
|
}
|
|
1082
|
-
}), this.shadowRoot.appendChild(this._field.getElement());
|
|
1090
|
+
}), this.shadowRoot.appendChild(this._field.getElement()), this._loadOutcomeListener?.({ status: "ready" });
|
|
1083
1091
|
}).catch((t) => {
|
|
1084
|
-
this.shadowRoot && this._renderGeneration === e && console.error("Error creating phone number field:", t)
|
|
1092
|
+
this.shadowRoot && this._renderGeneration === e && (console.error("Error creating phone number field:", t), this._loadOutcomeListener?.({
|
|
1093
|
+
status: "failed",
|
|
1094
|
+
reason: S.FORM_RENDER_FAILED,
|
|
1095
|
+
attributes: {
|
|
1096
|
+
form_part: "phone_number",
|
|
1097
|
+
error_class: ce(t)
|
|
1098
|
+
}
|
|
1099
|
+
}));
|
|
1085
1100
|
});
|
|
1086
1101
|
}
|
|
1087
1102
|
getCss() {
|
|
1088
1103
|
return super.getCss() + [
|
|
1089
|
-
|
|
1090
|
-
P,
|
|
1104
|
+
j,
|
|
1091
1105
|
M,
|
|
1092
|
-
|
|
1106
|
+
A,
|
|
1107
|
+
Ae
|
|
1093
1108
|
].join("\n") + "\n :host { display: block; }\n .form-input,\n .country-select-wrapper {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: 0 !important;\n box-shadow: none !important;\n }\n .phone-number-field-container {\n min-height: calc(var(--odus-input-font-size, 16px) * 1.5 + 16px);\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n overflow: hidden;\n }\n .phone-number-field-container:focus-within {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n }\n .phone-number-field-container.error {\n box-shadow: 0 0 0 1px var(--odus-color-error, #dc2727) !important;\n }\n .form-input:focus {\n box-shadow: none !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
1094
1109
|
}
|
|
1095
1110
|
getValue() {
|
|
@@ -1102,7 +1117,10 @@ var Ce = class {
|
|
|
1102
1117
|
getError() {
|
|
1103
1118
|
return this._error;
|
|
1104
1119
|
}
|
|
1105
|
-
|
|
1120
|
+
destroy() {
|
|
1121
|
+
this._loadOutcomeListener = null, super.destroy();
|
|
1122
|
+
}
|
|
1123
|
+
}, Me = "Payment failed", Ne = "We couldn't securely process your card details. Please check your card information and try again.", Pe = "No payment details were entered. Please add your card and try again.", Fe = "This payment is no longer available. Please reload the page and try again.", Ie = class {
|
|
1106
1124
|
_config;
|
|
1107
1125
|
_apiService;
|
|
1108
1126
|
_changeListeners = [];
|
|
@@ -1113,6 +1131,7 @@ var Ce = class {
|
|
|
1113
1131
|
_sessionId;
|
|
1114
1132
|
_mountedReported = !1;
|
|
1115
1133
|
_readiness = new re();
|
|
1134
|
+
_cardFieldsReady = !1;
|
|
1116
1135
|
_card;
|
|
1117
1136
|
_email;
|
|
1118
1137
|
_phone;
|
|
@@ -1129,7 +1148,7 @@ var Ce = class {
|
|
|
1129
1148
|
_error;
|
|
1130
1149
|
elements;
|
|
1131
1150
|
constructor(e) {
|
|
1132
|
-
this._config = e, this._callbacks = { ...e.callbacks }, this._sessionId = crypto.randomUUID(), r(),
|
|
1151
|
+
this._config = e, this._callbacks = { ...e.callbacks }, this._sessionId = crypto.randomUUID(), r(), _e({
|
|
1133
1152
|
environment: e.environment,
|
|
1134
1153
|
sessionId: this._sessionId,
|
|
1135
1154
|
integration: "elements"
|
|
@@ -1139,12 +1158,21 @@ var Ce = class {
|
|
|
1139
1158
|
get: () => (this._email || (this._email = new X(), this._trackElement(this._email)), this._email),
|
|
1140
1159
|
enumerable: !0
|
|
1141
1160
|
}), Object.defineProperty(n, "phone", {
|
|
1142
|
-
get: () => (this._phone || (this._phone = new $(), this._trackElement(this._phone)
|
|
1161
|
+
get: () => (this._phone || (this._phone = new $(), this._trackElement(this._phone), this._phone.setLoadOutcomeListener((e) => {
|
|
1162
|
+
if (e.status === "ready") {
|
|
1163
|
+
this._settleLoad();
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
this._readiness.fail({
|
|
1167
|
+
reason: e.reason,
|
|
1168
|
+
attributes: e.attributes
|
|
1169
|
+
});
|
|
1170
|
+
})), this._phone),
|
|
1143
1171
|
enumerable: !0
|
|
1144
1172
|
});
|
|
1145
1173
|
let i = {};
|
|
1146
1174
|
Object.defineProperty(i, "applePay", {
|
|
1147
|
-
get: () => (this._applePay || (this._applePay = new
|
|
1175
|
+
get: () => (this._applePay || (this._applePay = new W(), this._trackElement(this._applePay), this._paymentState.paymentId && this._paymentState.checkoutKey && this._applePay.setPaymentContext({
|
|
1148
1176
|
paymentId: this._paymentState.paymentId,
|
|
1149
1177
|
checkoutKey: this._paymentState.checkoutKey,
|
|
1150
1178
|
environment: this._config.environment,
|
|
@@ -1154,7 +1182,8 @@ var Ce = class {
|
|
|
1154
1182
|
formData: null,
|
|
1155
1183
|
applePayData: e
|
|
1156
1184
|
}),
|
|
1157
|
-
onStartFailed: this._onApplePayStartFailed
|
|
1185
|
+
onStartFailed: this._onApplePayStartFailed,
|
|
1186
|
+
onPaymentDataFailed: this._onApplePayPaymentDataFailed
|
|
1158
1187
|
})), this._applePay),
|
|
1159
1188
|
enumerable: !0
|
|
1160
1189
|
}), Object.defineProperty(i, "payPal", {
|
|
@@ -1169,25 +1198,25 @@ var Ce = class {
|
|
|
1169
1198
|
});
|
|
1170
1199
|
let a = {};
|
|
1171
1200
|
Object.defineProperty(a, "street", {
|
|
1172
|
-
get: () => (this._addressStreet || (this._addressStreet = new
|
|
1201
|
+
get: () => (this._addressStreet || (this._addressStreet = new H(), this._trackElement(this._addressStreet)), this._addressStreet),
|
|
1173
1202
|
enumerable: !0
|
|
1174
1203
|
}), Object.defineProperty(a, "firstName", {
|
|
1175
|
-
get: () => (this._addressFirstName || (this._addressFirstName = new
|
|
1204
|
+
get: () => (this._addressFirstName || (this._addressFirstName = new z(), this._trackElement(this._addressFirstName)), this._addressFirstName),
|
|
1176
1205
|
enumerable: !0
|
|
1177
1206
|
}), Object.defineProperty(a, "lastName", {
|
|
1178
|
-
get: () => (this._addressLastName || (this._addressLastName = new
|
|
1207
|
+
get: () => (this._addressLastName || (this._addressLastName = new B(), this._trackElement(this._addressLastName)), this._addressLastName),
|
|
1179
1208
|
enumerable: !0
|
|
1180
1209
|
}), Object.defineProperty(a, "city", {
|
|
1181
|
-
get: () => (this._addressCity || (this._addressCity = new
|
|
1210
|
+
get: () => (this._addressCity || (this._addressCity = new I(), this._trackElement(this._addressCity)), this._addressCity),
|
|
1182
1211
|
enumerable: !0
|
|
1183
1212
|
}), Object.defineProperty(a, "state", {
|
|
1184
|
-
get: () => (this._addressState || (this._addressState = new
|
|
1213
|
+
get: () => (this._addressState || (this._addressState = new V(), this._trackElement(this._addressState), this._addressCountry?.value && this._addressState.setCountry(this._addressCountry.value)), this._addressState),
|
|
1185
1214
|
enumerable: !0
|
|
1186
1215
|
}), Object.defineProperty(a, "zipCode", {
|
|
1187
|
-
get: () => (this._addressZipCode || (this._addressZipCode = new
|
|
1216
|
+
get: () => (this._addressZipCode || (this._addressZipCode = new U(), this._trackElement(this._addressZipCode)), this._addressZipCode),
|
|
1188
1217
|
enumerable: !0
|
|
1189
1218
|
}), Object.defineProperty(a, "country", {
|
|
1190
|
-
get: () => (this._addressCountry || (this._addressCountry = new
|
|
1219
|
+
get: () => (this._addressCountry || (this._addressCountry = new R(), this._trackElement(this._addressCountry), this._addressCountry.on("change", (e) => {
|
|
1191
1220
|
this._addressState?.setCountry(e);
|
|
1192
1221
|
})), this._addressCountry),
|
|
1193
1222
|
enumerable: !0
|
|
@@ -1197,8 +1226,14 @@ var Ce = class {
|
|
|
1197
1226
|
express: i
|
|
1198
1227
|
};
|
|
1199
1228
|
Object.defineProperty(o, "card", {
|
|
1200
|
-
get: () => (this._card || (this._card = new J(), this._card.setEnvironment(this._config.environment), this.
|
|
1201
|
-
this.
|
|
1229
|
+
get: () => (this._card || (this._card = new J(), this._card.setEnvironment(this._config.environment), this._card.on("ready", () => {
|
|
1230
|
+
this._cardFieldsReady = !1;
|
|
1231
|
+
}), this._trackElement(this._card), this._card.setLoadOutcomeListener((e) => {
|
|
1232
|
+
if (this._readiness.markMounted(), e.status === "ready") {
|
|
1233
|
+
this._cardFieldsReady = !0, this._settleLoad();
|
|
1234
|
+
return;
|
|
1235
|
+
}
|
|
1236
|
+
this._readiness.settle(e);
|
|
1202
1237
|
}), this._paymentState.vgsJwt ? this._card.setVgsJwt(this._paymentState.vgsJwt) : this._paymentState.cardCapture === "unavailable" ? this._card.markCaptureUnavailable() : this._paymentState.cardCapture === "unsupported" && this._card.resetCardCapture()), this._card),
|
|
1203
1238
|
enumerable: !0
|
|
1204
1239
|
}), Object.defineProperty(o, "cardholderName", {
|
|
@@ -1215,10 +1250,10 @@ var Ce = class {
|
|
|
1215
1250
|
async associatePayment(e, t) {
|
|
1216
1251
|
if (!e || !t) throw Error("paymentId and checkoutKey are required");
|
|
1217
1252
|
let n = ++this._associationSequence;
|
|
1218
|
-
this._readiness.start(e),
|
|
1253
|
+
this._readiness.start(e), me(this._config.environment);
|
|
1219
1254
|
let r;
|
|
1220
1255
|
try {
|
|
1221
|
-
r = await
|
|
1256
|
+
r = await pe({
|
|
1222
1257
|
id: e,
|
|
1223
1258
|
checkoutKey: t,
|
|
1224
1259
|
environment: this._config.environment
|
|
@@ -1226,15 +1261,15 @@ var Ce = class {
|
|
|
1226
1261
|
} catch (t) {
|
|
1227
1262
|
if (n === this._associationSequence) {
|
|
1228
1263
|
this._paymentState = {};
|
|
1229
|
-
let { ours: e, ...n } =
|
|
1264
|
+
let { ours: e, ...n } = ie(t, _.CHECKOUT_DETAILS);
|
|
1230
1265
|
e ? this._readiness.fail(n) : this._readiness.exclude(n);
|
|
1231
1266
|
}
|
|
1232
1267
|
throw C(g.PAYMENT_ASSOCIATION_FAILED, {
|
|
1233
1268
|
payment_id: e,
|
|
1234
1269
|
error_message: t instanceof Error ? t.message : "Unknown error",
|
|
1235
|
-
stage:
|
|
1270
|
+
stage: _.CHECKOUT_DETAILS,
|
|
1236
1271
|
...w(t)
|
|
1237
|
-
}),
|
|
1272
|
+
}), x(t instanceof Error ? t : Error("Failed to associate payment"), { payment_id: e }), t;
|
|
1238
1273
|
}
|
|
1239
1274
|
n === this._associationSequence && (this._paymentState = {
|
|
1240
1275
|
paymentId: e,
|
|
@@ -1258,7 +1293,8 @@ var Ce = class {
|
|
|
1258
1293
|
formData: null,
|
|
1259
1294
|
applePayData: e
|
|
1260
1295
|
}),
|
|
1261
|
-
onStartFailed: this._onApplePayStartFailed
|
|
1296
|
+
onStartFailed: this._onApplePayStartFailed,
|
|
1297
|
+
onPaymentDataFailed: this._onApplePayPaymentDataFailed
|
|
1262
1298
|
}), this._paypal?.setPaymentContext({
|
|
1263
1299
|
paymentId: e,
|
|
1264
1300
|
checkoutKey: t,
|
|
@@ -1268,7 +1304,7 @@ var Ce = class {
|
|
|
1268
1304
|
}), this._settleLoad());
|
|
1269
1305
|
}
|
|
1270
1306
|
validate() {
|
|
1271
|
-
let e = {}, { t } =
|
|
1307
|
+
let e = {}, { t } = O();
|
|
1272
1308
|
return this._card?.isMounted && !this._card.isValid && (e.card = this._card.error ?? t("validation.cardNumberInvalid")), this._email?.isMounted && !this._email.isValid && (e.email = this._email.error ?? t("validation.emailInvalid")), this._phone?.isMounted && !this._phone.isValid && (e.phone = this._phone.error ?? t("validation.phoneNumberInvalid")), this._addressStreet?.isMounted && !this._addressStreet.isValid && (e["address.street"] = this._addressStreet.error ?? t("validation.addressLine1Required")), this._addressCity?.isMounted && !this._addressCity.isValid && (e["address.city"] = this._addressCity.error ?? t("validation.townCityRequired")), this._addressCountry?.isMounted && !this._addressCountry.isValid && (e["address.country"] = this._addressCountry.error ?? t("validation.countryRequired")), this._addressFirstName?.isMounted && !this._addressFirstName.isValid && (e["address.firstName"] = this._addressFirstName.error ?? t("validation.firstNameRequired")), this._addressLastName?.isMounted && !this._addressLastName.isValid && (e["address.lastName"] = this._addressLastName.error ?? t("validation.lastNameRequired")), this._cardholderName?.isMounted && !this._cardholderName.isValid && (e.cardholderName = this._cardholderName.error ?? t("validation.nameRequired")), this._addressState?.isMounted && !this._addressState.isValid && (e["address.state"] = this._addressState.error ?? t("validation.stateRequired")), this._addressZipCode?.isMounted && !this._addressZipCode.isValid && (e["address.zipCode"] = this._addressZipCode.error ?? t("validation.postalCodeRequired")), this._applePay?.isMounted && !this._applePay.isValid && (e.applePay = "Apple Pay authorization required"), this._paypal?.isMounted && !this._paypal.isValid && (e.paypal = "PayPal authorization required"), {
|
|
1273
1309
|
valid: Object.keys(e).length === 0,
|
|
1274
1310
|
errors: e
|
|
@@ -1287,20 +1323,20 @@ var Ce = class {
|
|
|
1287
1323
|
if (!this._card?.isMounted || this._card.captureState === "unsupported") return {
|
|
1288
1324
|
ok: !1,
|
|
1289
1325
|
error: {
|
|
1290
|
-
message:
|
|
1326
|
+
message: Pe,
|
|
1291
1327
|
status: 0,
|
|
1292
1328
|
statusText: "No Payment Method",
|
|
1293
|
-
failureClass:
|
|
1329
|
+
failureClass: v.NOT_SENT
|
|
1294
1330
|
}
|
|
1295
1331
|
};
|
|
1296
|
-
if (!this._card.isVgsMode) return C(g.CARD_CAPTURE_UNAVAILABLE, { reason:
|
|
1332
|
+
if (!this._card.isVgsMode) return C(g.CARD_CAPTURE_UNAVAILABLE, { reason: m.NO_TOKENIZATION_SESSION }), {
|
|
1297
1333
|
ok: !1,
|
|
1298
1334
|
error: l({
|
|
1299
|
-
message:
|
|
1335
|
+
message: O().t("cardUnavailable"),
|
|
1300
1336
|
status: 0,
|
|
1301
1337
|
statusText: "Card Capture Unavailable",
|
|
1302
|
-
failureClass:
|
|
1303
|
-
},
|
|
1338
|
+
failureClass: v.NOT_SENT
|
|
1339
|
+
}, D.CAPTURE_UNAVAILABLE)
|
|
1304
1340
|
};
|
|
1305
1341
|
try {
|
|
1306
1342
|
let e = await this._card.getPayload();
|
|
@@ -1318,11 +1354,11 @@ var Ce = class {
|
|
|
1318
1354
|
return {
|
|
1319
1355
|
ok: !1,
|
|
1320
1356
|
error: l({
|
|
1321
|
-
message:
|
|
1357
|
+
message: Ne,
|
|
1322
1358
|
status: 0,
|
|
1323
1359
|
statusText: "Card Tokenization Failed",
|
|
1324
|
-
failureClass:
|
|
1325
|
-
}, e(t) ??
|
|
1360
|
+
failureClass: v.NOT_SENT
|
|
1361
|
+
}, e(t) ?? D.SDK_ERROR)
|
|
1326
1362
|
};
|
|
1327
1363
|
}
|
|
1328
1364
|
}
|
|
@@ -1372,9 +1408,10 @@ var Ce = class {
|
|
|
1372
1408
|
Object.assign(this._callbacks, e);
|
|
1373
1409
|
}
|
|
1374
1410
|
_onApplePayStartFailed = (e) => this._readiness.reportSubmit(o(e));
|
|
1411
|
+
_onApplePayPaymentDataFailed = (e) => this._readiness.reportSubmit(e);
|
|
1375
1412
|
_trackElement(e) {
|
|
1376
1413
|
e.setMountFailureListener((e) => {
|
|
1377
|
-
e ===
|
|
1414
|
+
e === S.MOUNT_FAILED ? this._readiness.fail({ reason: e }) : this._readiness.exclude({ reason: e });
|
|
1378
1415
|
}), e.on("ready", () => {
|
|
1379
1416
|
this._mountedReported || (this._mountedReported = !0, C(g.CHECKOUT_MOUNTED, { container_id: "elements" })), this._readiness.markMounted(), this._settleLoad();
|
|
1380
1417
|
}), e.on("change", () => {
|
|
@@ -1382,7 +1419,7 @@ var Ce = class {
|
|
|
1382
1419
|
});
|
|
1383
1420
|
}
|
|
1384
1421
|
_settleLoad() {
|
|
1385
|
-
this._allElements().some((e) => e.isMounted && (e !== this._card || this._card.captureState !== "unsupported")) && (this._paymentState.cardCapture
|
|
1422
|
+
this._allElements().some((e) => e.isMounted && (e !== this._card || this._card.captureState !== "unsupported")) && (this._paymentState.cardCapture === "unsupported" || !this._card?.isMounted || this._cardFieldsReady) && (!this._phone?.isMounted || this._phone.isDrawn) && this._readiness.ready();
|
|
1386
1423
|
}
|
|
1387
1424
|
_allElements() {
|
|
1388
1425
|
return [
|
|
@@ -1405,10 +1442,10 @@ var Ce = class {
|
|
|
1405
1442
|
async _executeAuthorization({ formData: e, applePayData: t, customCustomerData: n }) {
|
|
1406
1443
|
let { paymentId: r, checkoutKey: i } = this._paymentState, a = this._getPaymentMethod(e, t);
|
|
1407
1444
|
if (!r || !i) return this._reportSubmitFailure({
|
|
1408
|
-
message:
|
|
1445
|
+
message: Fe,
|
|
1409
1446
|
status: 0,
|
|
1410
1447
|
statusText: "No Associated Payment",
|
|
1411
|
-
failureClass:
|
|
1448
|
+
failureClass: v.NOT_SENT
|
|
1412
1449
|
}, a), !1;
|
|
1413
1450
|
this._emitLoadingState(!0), C(g.PAYMENT_SUBMIT_STARTED, {
|
|
1414
1451
|
payment_id: r,
|
|
@@ -1425,9 +1462,9 @@ var Ce = class {
|
|
|
1425
1462
|
customCustomerData: n
|
|
1426
1463
|
});
|
|
1427
1464
|
return this._readiness.reportSubmit({
|
|
1428
|
-
outcome:
|
|
1465
|
+
outcome: ae.SUCCEEDED,
|
|
1429
1466
|
paymentMethod: a
|
|
1430
|
-
}),
|
|
1467
|
+
}), f(b.PAYMENT_AUTHORIZATION_TIME, performance.now() - o, "ms", {
|
|
1431
1468
|
payment_id: r,
|
|
1432
1469
|
payment_method: a,
|
|
1433
1470
|
status: "success"
|
|
@@ -1436,7 +1473,7 @@ var Ce = class {
|
|
|
1436
1473
|
payment_method: a
|
|
1437
1474
|
}), this._handlePaymentResponse(s);
|
|
1438
1475
|
} catch (e) {
|
|
1439
|
-
return
|
|
1476
|
+
return f(b.PAYMENT_AUTHORIZATION_TIME, performance.now() - o, "ms", {
|
|
1440
1477
|
payment_id: r,
|
|
1441
1478
|
payment_method: a,
|
|
1442
1479
|
status: "failed"
|
|
@@ -1463,13 +1500,13 @@ var Ce = class {
|
|
|
1463
1500
|
return e.latestTransaction.status === "authorized" ? (C(g.PAYMENT_AUTHORIZED, {
|
|
1464
1501
|
payment_id: t,
|
|
1465
1502
|
status: e.latestTransaction.status
|
|
1466
|
-
}),
|
|
1503
|
+
}), y(() => this._callbacks.onPaymentSucceeded?.(e.latestTransaction.status)), !0) : e.latestTransaction.status === "failed" ? (C(g.PAYMENT_FAILED, {
|
|
1467
1504
|
payment_id: t,
|
|
1468
1505
|
status: e.latestTransaction.status
|
|
1469
|
-
}),
|
|
1506
|
+
}), y(() => this._callbacks.onPaymentFailed?.(e.latestTransaction.status)), !1) : e.status === "requires_action" && (C(g.PAYMENT_ACTION_REQUIRED, {
|
|
1470
1507
|
payment_id: t,
|
|
1471
1508
|
status: e.status
|
|
1472
|
-
}),
|
|
1509
|
+
}), y(() => this._callbacks.onActionRequired?.(e.action.redirectUrl)), !0);
|
|
1473
1510
|
}
|
|
1474
1511
|
_reportSubmitFailure(e, t) {
|
|
1475
1512
|
let n = {
|
|
@@ -1483,7 +1520,7 @@ var Ce = class {
|
|
|
1483
1520
|
}), this._readiness.reportSubmit(d(e, t)), this._handleAuthorizationError(e);
|
|
1484
1521
|
}
|
|
1485
1522
|
_handleAuthorizationError(e) {
|
|
1486
|
-
let t = this._readErrorMessage(e,
|
|
1523
|
+
let t = this._readErrorMessage(e, Me);
|
|
1487
1524
|
this._callbacks.onPaymentFailed?.(t), this._error?.isMounted && this._error.setError(t);
|
|
1488
1525
|
}
|
|
1489
1526
|
_readErrorMessage(e, t) {
|
|
@@ -1492,4 +1529,4 @@ var Ce = class {
|
|
|
1492
1529
|
}
|
|
1493
1530
|
};
|
|
1494
1531
|
//#endregion
|
|
1495
|
-
export {
|
|
1532
|
+
export { I as AddressCityElement, R as AddressCountryElement, z as AddressFirstNameElement, B as AddressLastNameElement, V as AddressStateElement, H as AddressStreetElement, U as AddressZipCodeElement, W as ApplePayElement, F as BaseElement, J as CardElement, Y as CardholderElement, X as EmailElement, Z as ErrorElement, Ie as OdusElements, Q as PayPalElement, $ as PhoneElement };
|