@odus/checkout 1.11.0 → 1.11.1
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 +1 -1
- package/dist/elements.es.js +5 -5
- package/dist/phone.js +3 -3
- package/dist/shared.js +9 -9
- package/package.json +1 -1
package/dist/checkout.es.js
CHANGED
|
@@ -1493,7 +1493,7 @@ var Z = (e) => ({
|
|
|
1493
1493
|
this.unmount(), this.container = e, this.renderForm();
|
|
1494
1494
|
}
|
|
1495
1495
|
update(e) {
|
|
1496
|
-
if (
|
|
1496
|
+
if (this.container && this.form) {
|
|
1497
1497
|
if (e.appearance || e.locale) {
|
|
1498
1498
|
this.form.updateAppearance({
|
|
1499
1499
|
appearance: e.appearance,
|
package/dist/elements.es.js
CHANGED
|
@@ -694,10 +694,10 @@ var q = class {
|
|
|
694
694
|
this._captureState = "vgs", this._reportedUnavailable = !1, this._vgsJwt = e, this._vgsAdapter?.destroy();
|
|
695
695
|
let t = new q(e, this._environment, {
|
|
696
696
|
onInitFailure: () => {
|
|
697
|
-
this._vgsAdapter
|
|
697
|
+
this._vgsAdapter === t && this.isMounted && this.markCaptureUnavailable(p.INIT_FAILED);
|
|
698
698
|
},
|
|
699
699
|
onFieldsNotReady: () => {
|
|
700
|
-
this._vgsAdapter
|
|
700
|
+
this._vgsAdapter === t && this.isMounted && this.markCaptureUnavailable(p.FIELDS_NOT_READY);
|
|
701
701
|
}
|
|
702
702
|
});
|
|
703
703
|
this._vgsAdapter = t, this.isMounted && this._mountContainer && (this.unmount(), this.mount(this._mountContainer));
|
|
@@ -773,10 +773,10 @@ var q = class {
|
|
|
773
773
|
this._vgsAdapter?.destroy(), this._vgsAdapter = null, this._vgsJwt = null, this._captureState = "pending", this._reportedUnavailable = !1, super.destroy();
|
|
774
774
|
}
|
|
775
775
|
setTheme(e) {
|
|
776
|
-
super.setTheme(e),
|
|
776
|
+
super.setTheme(e), this._captureState === "vgs" && this._vgsAdapter && this._vgsAdapter.applyTheme(e);
|
|
777
777
|
}
|
|
778
778
|
resetTheme(e) {
|
|
779
|
-
super.resetTheme(e),
|
|
779
|
+
super.resetTheme(e), this._captureState === "vgs" && this._vgsAdapter && this._vgsAdapter.resetTheme(Object.keys(e));
|
|
780
780
|
}
|
|
781
781
|
getCss() {
|
|
782
782
|
return super.getCss() + [
|
|
@@ -1052,7 +1052,7 @@ var q = class {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
}), this.shadowRoot.appendChild(this._field.getElement());
|
|
1054
1054
|
}).catch((t) => {
|
|
1055
|
-
|
|
1055
|
+
this.shadowRoot && this._renderGeneration === e && console.error("Error creating phone number field:", t);
|
|
1056
1056
|
});
|
|
1057
1057
|
}
|
|
1058
1058
|
getCss() {
|
package/dist/phone.js
CHANGED
|
@@ -7881,7 +7881,7 @@ var ne = "1.2.0", re = "1.7.35", ie = " ext. ", y = /*#__PURE__*/ function() {
|
|
|
7881
7881
|
{
|
|
7882
7882
|
key: "usesNationalPrefix",
|
|
7883
7883
|
value: function() {
|
|
7884
|
-
return
|
|
7884
|
+
return !(!this.nationalPrefixFormattingRule() || se.test(this.nationalPrefixFormattingRule()));
|
|
7885
7885
|
}
|
|
7886
7886
|
},
|
|
7887
7887
|
{
|
|
@@ -8072,7 +8072,7 @@ var Te = [
|
|
|
8072
8072
|
"VOICEMAIL"
|
|
8073
8073
|
];
|
|
8074
8074
|
function S(e, t, n) {
|
|
8075
|
-
if (t ||= {},
|
|
8075
|
+
if (t ||= {}, e.country || e.countryCallingCode) {
|
|
8076
8076
|
var r = new y(n);
|
|
8077
8077
|
r.selectNumberingPlan(e.country || e.countryCallingCode);
|
|
8078
8078
|
var i = t.v2 ? e.nationalNumber : e.phone;
|
|
@@ -10374,7 +10374,7 @@ var _i = /*#__PURE__*/ function() {
|
|
|
10374
10374
|
var e = this.state, t = e.nationalSignificantNumber, n = e.carrierCode, r = e.callingCode;
|
|
10375
10375
|
if (t) {
|
|
10376
10376
|
var i = this._getCountry();
|
|
10377
|
-
if (
|
|
10377
|
+
if (i || r) {
|
|
10378
10378
|
if (i && i === this.defaultCountry) {
|
|
10379
10379
|
var a = vi(this.metadata.numberingPlan.callingCode(), t, this.metadata);
|
|
10380
10380
|
a && (i = a);
|
package/dist/shared.js
CHANGED
|
@@ -74,7 +74,7 @@ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
74
74
|
r.rel = "preconnect", r.href = t.origin, t.crossOrigin && r.setAttribute("crossorigin", c), document.head.appendChild(r);
|
|
75
75
|
}
|
|
76
76
|
}, p = () => {
|
|
77
|
-
typeof document
|
|
77
|
+
typeof document < "u" && queueMicrotask(f);
|
|
78
78
|
}, m = /^\s*at (?:(.+?) ?\()?((?:file|https?|chrome-extension|webpack-internal):\/\/.+?):(\d+):(\d+)\)?\s*$/, h = /^([^@]+)@((?:file|https?|chrome-extension|webpack-internal):\/\/[^\s:]+):(\d+):(\d+)$/, g = /^(?:([^@]+)@)?((?:file|https?):\/\/[^\s:]+):(\d+):(\d+)$/, _ = (e) => {
|
|
79
79
|
if (!e) return [];
|
|
80
80
|
let t = [], n = e.split("\n");
|
|
@@ -208,7 +208,7 @@ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
208
208
|
document.visibilityState === "hidden" && t();
|
|
209
209
|
}, ae = t, document.addEventListener("visibilitychange", ie), window.addEventListener("pagehide", ae);
|
|
210
210
|
}, de = () => (/* @__PURE__ */ new Date()).toISOString(), fe = null, pe = null, me = (e) => {
|
|
211
|
-
typeof window
|
|
211
|
+
typeof window < "u" && (fe = (t) => {
|
|
212
212
|
let n = t.error instanceof Error ? t.error : Error(t.message);
|
|
213
213
|
P({
|
|
214
214
|
type: "exception",
|
|
@@ -249,7 +249,7 @@ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
249
249
|
}, ve = (e) => {
|
|
250
250
|
e.sessionTracking?.enabled && O({ id: _e(e.sessionTracking.session?.id) });
|
|
251
251
|
}, ye = () => (/* @__PURE__ */ new Date()).toISOString(), be = (e, t) => {
|
|
252
|
-
typeof PerformanceObserver
|
|
252
|
+
typeof PerformanceObserver < "u" && PerformanceObserver.supportedEntryTypes?.includes(e) && new PerformanceObserver((e) => {
|
|
253
253
|
for (let n of e.getEntries()) t(n);
|
|
254
254
|
}).observe({
|
|
255
255
|
type: e,
|
|
@@ -376,7 +376,7 @@ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
376
376
|
url: t,
|
|
377
377
|
app: {
|
|
378
378
|
name: "odus-checkout",
|
|
379
|
-
version: "1.11.
|
|
379
|
+
version: "1.11.1",
|
|
380
380
|
environment: e.environment === "test" ? "sandbox" : "production"
|
|
381
381
|
},
|
|
382
382
|
isolate: !0,
|
|
@@ -944,7 +944,7 @@ var Ke = {
|
|
|
944
944
|
if (!t.trim()) return e("validation.townCityRequired");
|
|
945
945
|
},
|
|
946
946
|
state: (t, n) => {
|
|
947
|
-
if (!
|
|
947
|
+
if ((!n || Je(n)) && !t.trim()) return e("validation.stateRequired");
|
|
948
948
|
},
|
|
949
949
|
zipCode: (t) => {
|
|
950
950
|
if (!t.trim()) return e("validation.postalCodeRequired");
|
|
@@ -3666,7 +3666,7 @@ var ui = "https://js.verygoodvault.com", di = "https://js3.verygoodvault.com", f
|
|
|
3666
3666
|
Ci(e), vi(e), Ti({ type: hi.LOADED_FROM_PACKAGE });
|
|
3667
3667
|
}, Ti = function(e) {
|
|
3668
3668
|
var t = yi(), n = t.vaultId, r = t.environment, i = t.version;
|
|
3669
|
-
if (
|
|
3669
|
+
if (t.logLevel !== "none" && typeof window < "u" && typeof window.btoa == "function" && typeof fetch == "function") {
|
|
3670
3670
|
var a = "", o = {
|
|
3671
3671
|
env: r,
|
|
3672
3672
|
tnt: n,
|
|
@@ -4749,7 +4749,7 @@ var $i = (e) => e.replace(/([A-Z])/g, " $1").trim(), ea = Object.fromEntries(Obj
|
|
|
4749
4749
|
u.setAttribute("buttonstyle", "black"), u.setAttribute("type", "plain"), u.setAttribute("locale", "en"), u.style.setProperty("--apple-pay-button-height", "40px"), u.style.setProperty("--apple-pay-button-border-radius", "4px"), u.style.setProperty("--apple-pay-button-padding", "0px 0px"), u.style.setProperty("--apple-pay-button-box-sizing", "border-box"), u.style.cursor = n ? "pointer" : "default", u.style.opacity = "1", ba() || (u.style.display = "none"), n && this.getElement().addEventListener("click", () => this.handleApplePayClick());
|
|
4750
4750
|
}
|
|
4751
4751
|
async handleApplePayClick() {
|
|
4752
|
-
if (
|
|
4752
|
+
if (this.onSubmit && !this.isSubmitting) {
|
|
4753
4753
|
this.isSubmitting = !0, this.getElement().style.opacity = "0.7", this.getElement().style.pointerEvents = "none";
|
|
4754
4754
|
try {
|
|
4755
4755
|
await this.initializeApplePaySession();
|
|
@@ -4800,7 +4800,7 @@ var $i = (e) => e.replace(/([A-Z])/g, " $1").trim(), ea = Object.fromEntries(Obj
|
|
|
4800
4800
|
return;
|
|
4801
4801
|
}
|
|
4802
4802
|
let { payment: t } = e, n = btoa(JSON.stringify(t.token.paymentData)), r = t.token.paymentMethod.displayName || "", a = t.shippingContact?.emailAddress || "", o = `${t.shippingContact?.givenName || ""} ${t.shippingContact?.familyName || ""}`.trim(), s = t.shippingContact?.phoneNumber || "", c = (e) => {
|
|
4803
|
-
if (e &&
|
|
4803
|
+
if (e && (e.addressLines?.[0] || e.locality || e.postalCode)) return {
|
|
4804
4804
|
firstName: e.givenName || "",
|
|
4805
4805
|
lastName: e.familyName || "",
|
|
4806
4806
|
street: e.addressLines?.join(", ") || "",
|
|
@@ -4851,7 +4851,7 @@ var $i = (e) => e.replace(/([A-Z])/g, " $1").trim(), ea = Object.fromEntries(Obj
|
|
|
4851
4851
|
i.src = Sa, i.style.width = "69px", i.style.height = "22px", i.style.maxWidth = "100%", i.style.display = "block", i.style.height = "auto", r.appendChild(i), this.getElement().appendChild(r), n && this.getElement().addEventListener("click", () => this.handleSubmit());
|
|
4852
4852
|
}
|
|
4853
4853
|
async handleSubmit() {
|
|
4854
|
-
if (
|
|
4854
|
+
if (this.onSubmit && !this.isSubmitting) {
|
|
4855
4855
|
this.isSubmitting = !0, this.getElement().style.opacity = "0.7";
|
|
4856
4856
|
try {
|
|
4857
4857
|
await this.onSubmit({ formData: this.formData });
|