@odus/checkout 1.8.1 → 1.9.0
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 +17 -7
- package/dist/elements/CardElement.d.ts +1 -0
- package/dist/elements/CardElement.d.ts.map +1 -1
- package/dist/elements/card/VgsCardAdapter.d.ts.map +1 -1
- package/dist/elements.es.js +107 -97
- package/dist/services/checkout/Checkout.service.d.ts.map +1 -1
- package/dist/shared.js +2 -1
- package/dist/types/telemetry/TelemetryEvents.type.d.ts +5 -0
- package/dist/types/telemetry/TelemetryEvents.type.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/checkout.es.js
CHANGED
|
@@ -1513,13 +1513,23 @@ var Z = (e) => ({
|
|
|
1513
1513
|
};
|
|
1514
1514
|
}
|
|
1515
1515
|
mount(e) {
|
|
1516
|
-
let t
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1516
|
+
let t;
|
|
1517
|
+
try {
|
|
1518
|
+
let n = document.querySelector(e);
|
|
1519
|
+
if (!n) throw Error(`Container ${e} not found`);
|
|
1520
|
+
return t = document.createElement("div"), n.appendChild(t), this.stateManager.updateState({
|
|
1521
|
+
form: t,
|
|
1522
|
+
mounted: !0
|
|
1523
|
+
}), this.formManager.mount(t), l(y.CHECKOUT_MOUNTED, { container_id: e }), this;
|
|
1524
|
+
} catch (n) {
|
|
1525
|
+
throw t?.remove(), this.stateManager.updateState({
|
|
1526
|
+
form: null,
|
|
1527
|
+
mounted: !1
|
|
1528
|
+
}), l(y.CHECKOUT_MOUNT_FAILED, {
|
|
1529
|
+
container_id: e,
|
|
1530
|
+
error_message: n instanceof Error ? n.message : "Unknown error"
|
|
1531
|
+
}), a(n instanceof Error ? n : /* @__PURE__ */ Error("Failed to mount checkout"), { container_id: e }), n;
|
|
1532
|
+
}
|
|
1523
1533
|
}
|
|
1524
1534
|
unmount() {
|
|
1525
1535
|
let { mounted: e } = this.stateManager.getState();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardElement.d.ts","sourceRoot":"","sources":["../../src/elements/CardElement.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC;AAElD,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,eAAe,CAAqC;IAC5D,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,WAAW,CAA+B;
|
|
1
|
+
{"version":3,"file":"CardElement.d.ts","sourceRoot":"","sources":["../../src/elements/CardElement.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC;AAElD,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,eAAe,CAAqC;IAC5D,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,OAAO,CAAuB;IAEtC,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAItC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAkBnB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAqCzC,OAAO,IAAI,IAAI;IAUxB,SAAS,CAAC,MAAM,IAAI,IAAI;IAgBjB,KAAK,IAAI,IAAI;IAOb,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,IAAI;IAO9D,OAAO,IAAI,IAAI;IAQf,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAQ7C,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;cAQrC,MAAM,IAAI,MAAM;IAmDnC,SAAS,CAAC,QAAQ,IAAI;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAO/D,UAAU,IAAI,OAAO,CAAC,cAAc,GAAG,iBAAiB,CAAC;IAU/D,SAAS,CAAC,UAAU,IAAI,OAAO;IAO/B,SAAS,CAAC,QAAQ,IAAI,MAAM,GAAG,IAAI;CAMpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VgsCardAdapter.d.ts","sourceRoot":"","sources":["../../../src/elements/card/VgsCardAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAQzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAO5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"VgsCardAdapter.d.ts","sourceRoot":"","sources":["../../../src/elements/card/VgsCardAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAQzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAO5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAqBhE,qBAAa,cAAc;IACzB,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,eAAe,CAA8C;IACrE,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,eAAe,CAAK;gBAEhB,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;IAMjD,IAAI,OAAO,uBAEV;IAED,aAAa,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,IAAI,GAAG,IAAI;IA2BxE;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAc7B,OAAO,CAAC,aAAa,CAA6B;IAElD,OAAO,IAAI,IAAI;IAWT,UAAU,IAAI,OAAO,CAAC,cAAc,CAAC;IAc3C,OAAO;IAIP,QAAQ,IAAI,MAAM,GAAG,IAAI;IAiBzB,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAgB/C,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAehC,OAAO,IAAI,IAAI;IASf,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,sBAAsB;YA4BhB,YAAY;IAyD1B,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,kBAAkB;CAkB3B"}
|
package/dist/elements.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as e, C as t, D as n, E as r, G as i, H as a, J as o, K as s, L as c, R as
|
|
1
|
+
import { B as e, C as t, D as n, E as r, G as i, H as a, J as o, K as s, L as c, R as l, S as u, T as ee, U as d, V as f, W as p, X as m, Y as h, Z as g, a as te, d as _, g as ne, h as v, i as re, l as y, n as ie, o as b, r as ae, s as x, t as S, u as C } from "./shared.js";
|
|
2
2
|
//#region libs/checkout/src/assets/styles/helperText.css?inline
|
|
3
|
-
var
|
|
3
|
+
var w = ".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}", T = ".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}", E = ".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)}", D = ":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}", O = class {
|
|
4
4
|
shadowRoot = null;
|
|
5
5
|
host = null;
|
|
6
6
|
options = {};
|
|
@@ -64,9 +64,9 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
64
64
|
this.options.callbacks?.[e]?.(t);
|
|
65
65
|
}
|
|
66
66
|
getCss() {
|
|
67
|
-
return
|
|
67
|
+
return D;
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, k = class extends O {
|
|
70
70
|
_value = "";
|
|
71
71
|
_error = null;
|
|
72
72
|
_input = null;
|
|
@@ -91,9 +91,9 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
91
91
|
}
|
|
92
92
|
getCss() {
|
|
93
93
|
return super.getCss() + [
|
|
94
|
-
w,
|
|
95
94
|
T,
|
|
96
|
-
|
|
95
|
+
E,
|
|
96
|
+
w
|
|
97
97
|
].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 ";
|
|
98
98
|
}
|
|
99
99
|
getValue() {
|
|
@@ -105,7 +105,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
105
105
|
getError() {
|
|
106
106
|
return this._error;
|
|
107
107
|
}
|
|
108
|
-
},
|
|
108
|
+
}, A = ".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}", j = class extends O {
|
|
109
109
|
_value = "";
|
|
110
110
|
_error = null;
|
|
111
111
|
_select = null;
|
|
@@ -117,7 +117,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
117
117
|
if (!this.shadowRoot) return;
|
|
118
118
|
this._select?.getElement().remove(), this.options.initialValue && !this._value && (this._value = String(this.options.initialValue), this.emit("change", this._value));
|
|
119
119
|
let { t: e, locale: t } = r();
|
|
120
|
-
this._select = new
|
|
120
|
+
this._select = new C({
|
|
121
121
|
name: "billingAddress.country",
|
|
122
122
|
label: this.options.label ?? e("address.chooseCountry"),
|
|
123
123
|
error: !1,
|
|
@@ -135,9 +135,9 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
135
135
|
}
|
|
136
136
|
getCss() {
|
|
137
137
|
return super.getCss() + [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
E,
|
|
139
|
+
w,
|
|
140
|
+
A
|
|
141
141
|
].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 ";
|
|
142
142
|
}
|
|
143
143
|
getValue() {
|
|
@@ -149,7 +149,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
149
149
|
getError() {
|
|
150
150
|
return this._error;
|
|
151
151
|
}
|
|
152
|
-
},
|
|
152
|
+
}, M = class extends O {
|
|
153
153
|
_value = "";
|
|
154
154
|
_error = null;
|
|
155
155
|
_input = null;
|
|
@@ -174,9 +174,9 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
174
174
|
}
|
|
175
175
|
getCss() {
|
|
176
176
|
return super.getCss() + [
|
|
177
|
-
w,
|
|
178
177
|
T,
|
|
179
|
-
|
|
178
|
+
E,
|
|
179
|
+
w
|
|
180
180
|
].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 ";
|
|
181
181
|
}
|
|
182
182
|
getValue() {
|
|
@@ -188,7 +188,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
188
188
|
getError() {
|
|
189
189
|
return this._error;
|
|
190
190
|
}
|
|
191
|
-
},
|
|
191
|
+
}, N = class extends O {
|
|
192
192
|
_value = "";
|
|
193
193
|
_error = null;
|
|
194
194
|
_input = null;
|
|
@@ -213,9 +213,9 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
213
213
|
}
|
|
214
214
|
getCss() {
|
|
215
215
|
return super.getCss() + [
|
|
216
|
-
w,
|
|
217
216
|
T,
|
|
218
|
-
|
|
217
|
+
E,
|
|
218
|
+
w
|
|
219
219
|
].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 ";
|
|
220
220
|
}
|
|
221
221
|
getValue() {
|
|
@@ -227,7 +227,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
227
227
|
getError() {
|
|
228
228
|
return this._error;
|
|
229
229
|
}
|
|
230
|
-
},
|
|
230
|
+
}, P = /* @__PURE__ */ new Set(["US", "CA"]), F = class extends O {
|
|
231
231
|
_value = "";
|
|
232
232
|
_country = "";
|
|
233
233
|
_input = null;
|
|
@@ -235,7 +235,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
235
235
|
setCountry(e) {
|
|
236
236
|
let t = this._country;
|
|
237
237
|
if (this._country = e, !this.shadowRoot) return;
|
|
238
|
-
let n =
|
|
238
|
+
let n = P.has(t), i = P.has(e);
|
|
239
239
|
if (n && i && t !== e) {
|
|
240
240
|
let { t } = r(), n = e, i = t(n === "US" ? "address.chooseState" : "address.chooseProvince");
|
|
241
241
|
this._select?.setOptions(v(n), this.options.placeholder ?? i), this._value = "", this.emit("change", this._value);
|
|
@@ -245,7 +245,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
245
245
|
}
|
|
246
246
|
render() {
|
|
247
247
|
if (this.shadowRoot) {
|
|
248
|
-
if (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null,
|
|
248
|
+
if (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null, P.has(this._country)) {
|
|
249
249
|
let e = this._country;
|
|
250
250
|
this._renderSelect(e);
|
|
251
251
|
} else this._renderInput();
|
|
@@ -270,7 +270,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
270
270
|
}
|
|
271
271
|
_renderSelect(e) {
|
|
272
272
|
let { t } = r(), n = v(e), i = t(e === "US" ? "address.chooseState" : "address.chooseProvince");
|
|
273
|
-
this._select = new
|
|
273
|
+
this._select = new C({
|
|
274
274
|
name: "billingAddress.state",
|
|
275
275
|
label: this.options.label ?? t("address.state"),
|
|
276
276
|
error: !1,
|
|
@@ -288,10 +288,10 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
288
288
|
}
|
|
289
289
|
getCss() {
|
|
290
290
|
return super.getCss() + [
|
|
291
|
-
w,
|
|
292
291
|
T,
|
|
293
|
-
|
|
294
|
-
|
|
292
|
+
E,
|
|
293
|
+
w,
|
|
294
|
+
A
|
|
295
295
|
].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 ";
|
|
296
296
|
}
|
|
297
297
|
getValue() {
|
|
@@ -305,7 +305,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
305
305
|
let { t: e } = r();
|
|
306
306
|
return e("validation.stateRequired");
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, I = class extends O {
|
|
309
309
|
_value = "";
|
|
310
310
|
_error = null;
|
|
311
311
|
_input = null;
|
|
@@ -335,9 +335,9 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
335
335
|
}
|
|
336
336
|
getCss() {
|
|
337
337
|
return super.getCss() + [
|
|
338
|
-
w,
|
|
339
338
|
T,
|
|
340
|
-
|
|
339
|
+
E,
|
|
340
|
+
w
|
|
341
341
|
].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 ";
|
|
342
342
|
}
|
|
343
343
|
getValue() {
|
|
@@ -349,7 +349,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
349
349
|
getError() {
|
|
350
350
|
return this._error;
|
|
351
351
|
}
|
|
352
|
-
},
|
|
352
|
+
}, L = class extends O {
|
|
353
353
|
_value = "";
|
|
354
354
|
_error = null;
|
|
355
355
|
_input = null;
|
|
@@ -374,9 +374,9 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
374
374
|
}
|
|
375
375
|
getCss() {
|
|
376
376
|
return super.getCss() + [
|
|
377
|
-
w,
|
|
378
377
|
T,
|
|
379
|
-
|
|
378
|
+
E,
|
|
379
|
+
w
|
|
380
380
|
].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 ";
|
|
381
381
|
}
|
|
382
382
|
getValue() {
|
|
@@ -388,7 +388,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
388
388
|
getError() {
|
|
389
389
|
return this._error;
|
|
390
390
|
}
|
|
391
|
-
},
|
|
391
|
+
}, R = "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)}", z = {
|
|
392
392
|
name: "odus-elements",
|
|
393
393
|
styles: {
|
|
394
394
|
fontSize: 14,
|
|
@@ -412,7 +412,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
412
412
|
}
|
|
413
413
|
},
|
|
414
414
|
additionalPaymentMethods: {}
|
|
415
|
-
},
|
|
415
|
+
}, B = class extends O {
|
|
416
416
|
_paymentContext = null;
|
|
417
417
|
_applePayData = null;
|
|
418
418
|
_authorized = !1;
|
|
@@ -439,8 +439,8 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
439
439
|
this._setAvailability(!1);
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
442
|
-
this._button = new
|
|
443
|
-
checkoutProfile:
|
|
442
|
+
this._button = new ae({
|
|
443
|
+
checkoutProfile: z,
|
|
444
444
|
paymentId: e,
|
|
445
445
|
checkoutKey: t,
|
|
446
446
|
environment: n,
|
|
@@ -457,7 +457,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
457
457
|
this._isAvailable = e, this.host && (e ? this.host.style.removeProperty("display") : this.host.style.display = "none");
|
|
458
458
|
}
|
|
459
459
|
getCss() {
|
|
460
|
-
return super.getCss() +
|
|
460
|
+
return super.getCss() + R + "\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 ";
|
|
461
461
|
}
|
|
462
462
|
getValue() {
|
|
463
463
|
return this._applePayData;
|
|
@@ -468,7 +468,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
468
468
|
getError() {
|
|
469
469
|
return null;
|
|
470
470
|
}
|
|
471
|
-
},
|
|
471
|
+
}, V = ".card-element{border-radius:inherit;box-sizing:border-box;background:#fff;border:none;height:38.5px;padding:0;transition:box-shadow .1s ease-in;position:relative;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d}.card-element iframe{width:100%;min-width:0;display:block}.card-element-focus{box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}.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}", H = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvWpIQFjQQCPpaIlJKpegirp5kLkzLB1AxHmnLk73D3TJbAGqr1QmlsWDBtMPMRpdzzUM7ZwX3kzhIuATV4Pe7RKp3nZlVmcrT0YCQXBrTwqZNh775z58GP2kZs+gVfNqBampJPzSB/hB62KkByhECn6grrRjiAVwJyZVEvs/2vrxaEpO+aE16emtX12RgI5JdzdOiNyZEQteU6zRBRJEocPWVxExaOpVVVJ5+UnW0LcalzA+lRGRTrQJ5JguAPiAOzRPTK/lYFFpCAl/F8wtoAVG1c8zO2NcQ0Pko+fmeidRFxJ/did2btV+9Mkze3mBphwFmvnxa35LF+Cs/XJHDwIDAQAB", U = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8gGPMwBRPuVyJReZGIkWH/+Bf5pnpDN1bSR2cLYLXVT8CaSnTw74qeboSnktgYCi1D9R3Bj2fYzTIwGGZb8KinLdxwbqZmHwrE9cFhCaHbG/E0PbqQGhXP2vbniZTT4M0i0Cbi7ES3Bw5zqNbIZZnX041QEpxLvIyWPKZCX+fBogNMhWfCF779aclChjHkwZMsufThVWE9xklWGxXiytx5aL4I5JPxq0I7cAkZGGs4aF/GxWwPaq7R3wPikJQ0YHnCMfcURzl2Hnw/inqyMy+JB6djTq2/BdzMAhWTh3cDWq9Xu+gEkb/QCd0n1yYIdKuDISlk/AfHdWe34IvzhVyQIDAQAB", W = {
|
|
472
472
|
name: "odus-elements",
|
|
473
473
|
styles: {
|
|
474
474
|
fontSize: 14,
|
|
@@ -492,12 +492,12 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
492
492
|
}
|
|
493
493
|
},
|
|
494
494
|
additionalPaymentMethods: {}
|
|
495
|
-
},
|
|
495
|
+
}, G = class {
|
|
496
496
|
_cardNumber = "";
|
|
497
497
|
_cardExpiry = "";
|
|
498
498
|
_cardCvv = "";
|
|
499
499
|
_section = null;
|
|
500
|
-
_focusManager = new
|
|
500
|
+
_focusManager = new u();
|
|
501
501
|
_touchedFields = /* @__PURE__ */ new Set();
|
|
502
502
|
_focusHandlers = [];
|
|
503
503
|
get section() {
|
|
@@ -506,8 +506,8 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
506
506
|
renderSection(e, t, n) {
|
|
507
507
|
this._section?.getElement().remove();
|
|
508
508
|
let { t: i } = r();
|
|
509
|
-
this._section = new
|
|
510
|
-
checkoutProfile:
|
|
509
|
+
this._section = new x({
|
|
510
|
+
checkoutProfile: W,
|
|
511
511
|
cardNumber: this._cardNumber,
|
|
512
512
|
cardNumberTouched: !1,
|
|
513
513
|
cardCvv: this._cardCvv,
|
|
@@ -519,7 +519,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
519
519
|
let n = e.target;
|
|
520
520
|
if (n.name === "cardNumber") this._cardNumber = n.value;
|
|
521
521
|
else if (n.name === "cardExpiry") {
|
|
522
|
-
let e =
|
|
522
|
+
let e = l.cardExpiry(n.value);
|
|
523
523
|
this._cardExpiry = e, this._section?.updateCardExpiry(e);
|
|
524
524
|
} else n.name === "cardCvv" && (this._cardCvv = n.value);
|
|
525
525
|
this._touchedFields.add(n.name), this._updateFocusManagerState(), t(this.getValue());
|
|
@@ -548,7 +548,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
548
548
|
};
|
|
549
549
|
}
|
|
550
550
|
async getPayload(e) {
|
|
551
|
-
let t = e === "live" ?
|
|
551
|
+
let t = e === "live" ? U : H, n = new d();
|
|
552
552
|
n.setPublicKey(t);
|
|
553
553
|
let r = this._cardNumber.replace(/\s+/g, ""), i = this._cardExpiry.replace(/\s+/g, "").split("/"), a = i[0] ?? "", o = i[1] ?? "";
|
|
554
554
|
return o.length === 2 && (o = `20${o}`), {
|
|
@@ -601,7 +601,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
601
601
|
for (let e of this._touchedFields) o[e] = !0;
|
|
602
602
|
this._focusManager.handleStateUpdate(t, n, o);
|
|
603
603
|
}
|
|
604
|
-
},
|
|
604
|
+
}, K = {
|
|
605
605
|
"--odus-font-family": "system-ui, sans-serif",
|
|
606
606
|
"--odus-font-size": "16px",
|
|
607
607
|
"--odus-color-error": "#dc2727",
|
|
@@ -624,7 +624,12 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
624
624
|
"--odus-card-gap": "12px",
|
|
625
625
|
"--odus-button-height": "48px",
|
|
626
626
|
"--odus-button-border-radius": "var(--odus-border-radius)"
|
|
627
|
-
}["--odus-font-size"]
|
|
627
|
+
}["--odus-font-size"];
|
|
628
|
+
function q(e, t) {
|
|
629
|
+
let n = Object.keys(e);
|
|
630
|
+
return n.length === Object.keys(t).length && n.every((n) => e[n] === t[n]);
|
|
631
|
+
}
|
|
632
|
+
var oe = class {
|
|
628
633
|
_vgsService;
|
|
629
634
|
_vgsJwt;
|
|
630
635
|
_vgsState = {};
|
|
@@ -643,8 +648,8 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
643
648
|
renderSection(e, t) {
|
|
644
649
|
this._section?.getElement().remove();
|
|
645
650
|
let { t: n } = r();
|
|
646
|
-
this._section = new
|
|
647
|
-
checkoutProfile:
|
|
651
|
+
this._section = new x({
|
|
652
|
+
checkoutProfile: W,
|
|
648
653
|
cardNumber: "",
|
|
649
654
|
cardNumberTouched: !1,
|
|
650
655
|
cardCvv: "",
|
|
@@ -694,14 +699,18 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
694
699
|
return null;
|
|
695
700
|
}
|
|
696
701
|
applyTheme(e) {
|
|
697
|
-
|
|
702
|
+
let t = {
|
|
698
703
|
...this._currentTheme,
|
|
699
704
|
...e
|
|
700
|
-
}
|
|
705
|
+
};
|
|
706
|
+
q(this._currentTheme, t) || (this._currentTheme = t, this._section && (this._applySkeletonMetrics(), this._reinitWithTheme()));
|
|
701
707
|
}
|
|
702
708
|
resetTheme(e) {
|
|
703
|
-
|
|
704
|
-
|
|
709
|
+
let t = e.filter((e) => e in this._currentTheme);
|
|
710
|
+
if (t.length !== 0) {
|
|
711
|
+
for (let e of t) delete this._currentTheme[e];
|
|
712
|
+
this._section && (this._applySkeletonMetrics(), this._reinitWithTheme());
|
|
713
|
+
}
|
|
705
714
|
}
|
|
706
715
|
destroy() {
|
|
707
716
|
this._vgsReinitTimer &&= (clearTimeout(this._vgsReinitTimer), null), this._vgsService.destroy(), this._section = null;
|
|
@@ -712,15 +721,15 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
712
721
|
}, 300);
|
|
713
722
|
}
|
|
714
723
|
_buildProfileFromTheme(e) {
|
|
715
|
-
let t = e["--odus-input-font-size"] ?? e["--odus-font-size"] ??
|
|
724
|
+
let t = e["--odus-input-font-size"] ?? e["--odus-font-size"] ?? K, n = e["--odus-font-family"] ?? W.styles.fontFamily, r = e["--odus-color-text"] ?? W.styles.textColor, i = e["--odus-border-radius"] ?? `${W.styles.borderRadius}px`;
|
|
716
725
|
return {
|
|
717
|
-
...
|
|
726
|
+
...W,
|
|
718
727
|
styles: {
|
|
719
|
-
...
|
|
720
|
-
fontSize: parseInt(t, 10) || parseInt(
|
|
728
|
+
...W.styles,
|
|
729
|
+
fontSize: parseInt(t, 10) || parseInt(K, 10),
|
|
721
730
|
fontFamily: n,
|
|
722
731
|
textColor: r,
|
|
723
|
-
borderRadius: parseInt(i, 10) ||
|
|
732
|
+
borderRadius: parseInt(i, 10) || W.styles.borderRadius
|
|
724
733
|
}
|
|
725
734
|
};
|
|
726
735
|
}
|
|
@@ -774,12 +783,13 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
774
783
|
}
|
|
775
784
|
return t;
|
|
776
785
|
}
|
|
777
|
-
},
|
|
786
|
+
}, J = class extends O {
|
|
778
787
|
_environment = "test";
|
|
779
788
|
_isVgsMode = !1;
|
|
780
789
|
_mountContainer = null;
|
|
781
|
-
_nativeAdapter = new
|
|
790
|
+
_nativeAdapter = new G();
|
|
782
791
|
_vgsAdapter = null;
|
|
792
|
+
_vgsJwt = null;
|
|
783
793
|
get isVgsMode() {
|
|
784
794
|
return this._isVgsMode;
|
|
785
795
|
}
|
|
@@ -787,7 +797,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
787
797
|
this._environment = e;
|
|
788
798
|
}
|
|
789
799
|
setVgsJwt(e) {
|
|
790
|
-
this._isVgsMode = !0, this._vgsAdapter = new
|
|
800
|
+
this._vgsAdapter && this._vgsJwt === e || (this._isVgsMode = !0, this._vgsJwt = e, this._vgsAdapter?.destroy(), this._vgsAdapter = new oe(e, this._environment), this.isMounted && this._mountContainer && (this.unmount(), this.mount(this._mountContainer)));
|
|
791
801
|
}
|
|
792
802
|
mount(e) {
|
|
793
803
|
this.isMounted && this.unmount();
|
|
@@ -818,7 +828,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
818
828
|
(this._isVgsMode ? this._vgsAdapter?.section : this._nativeAdapter.section)?.focusField(e);
|
|
819
829
|
}
|
|
820
830
|
destroy() {
|
|
821
|
-
this._nativeAdapter.destroy(), this._vgsAdapter?.destroy(), this._vgsAdapter = null, super.destroy();
|
|
831
|
+
this._nativeAdapter.destroy(), this._vgsAdapter?.destroy(), this._vgsAdapter = null, this._vgsJwt = null, super.destroy();
|
|
822
832
|
}
|
|
823
833
|
setTheme(e) {
|
|
824
834
|
super.setTheme(e), !(!this._isVgsMode || !this._vgsAdapter) && this._vgsAdapter.applyTheme(e);
|
|
@@ -828,10 +838,10 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
828
838
|
}
|
|
829
839
|
getCss() {
|
|
830
840
|
return super.getCss() + [
|
|
831
|
-
w,
|
|
832
841
|
T,
|
|
833
|
-
|
|
834
|
-
|
|
842
|
+
E,
|
|
843
|
+
w,
|
|
844
|
+
V
|
|
835
845
|
].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 ";
|
|
836
846
|
}
|
|
837
847
|
getValue() {
|
|
@@ -854,7 +864,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
854
864
|
getError() {
|
|
855
865
|
return this._isVgsMode ? this._vgsAdapter?.getError() ?? null : this._nativeAdapter.getError();
|
|
856
866
|
}
|
|
857
|
-
},
|
|
867
|
+
}, Y = class extends O {
|
|
858
868
|
_value = "";
|
|
859
869
|
_error = null;
|
|
860
870
|
_input = null;
|
|
@@ -880,9 +890,9 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
880
890
|
}
|
|
881
891
|
getCss() {
|
|
882
892
|
return super.getCss() + [
|
|
883
|
-
w,
|
|
884
893
|
T,
|
|
885
|
-
|
|
894
|
+
E,
|
|
895
|
+
w
|
|
886
896
|
].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 ";
|
|
887
897
|
}
|
|
888
898
|
getValue() {
|
|
@@ -918,7 +928,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
918
928
|
}
|
|
919
929
|
},
|
|
920
930
|
additionalPaymentMethods: {}
|
|
921
|
-
},
|
|
931
|
+
}, X = class extends O {
|
|
922
932
|
_email = "";
|
|
923
933
|
_error = null;
|
|
924
934
|
_suggestion = null;
|
|
@@ -927,7 +937,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
927
937
|
if (!this.shadowRoot) return;
|
|
928
938
|
this._field?.getElement().remove(), this.options.initialValue && !this._email && (this._email = String(this.options.initialValue));
|
|
929
939
|
let { t: e } = r();
|
|
930
|
-
this._field = new
|
|
940
|
+
this._field = new b({
|
|
931
941
|
value: this._email,
|
|
932
942
|
error: !1,
|
|
933
943
|
checkoutProfile: se,
|
|
@@ -946,9 +956,9 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
946
956
|
}
|
|
947
957
|
getCss() {
|
|
948
958
|
return super.getCss() + [
|
|
949
|
-
w,
|
|
950
959
|
T,
|
|
951
|
-
|
|
960
|
+
E,
|
|
961
|
+
w
|
|
952
962
|
].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 ";
|
|
953
963
|
}
|
|
954
964
|
getValue() {
|
|
@@ -963,18 +973,18 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
963
973
|
get suggestion() {
|
|
964
974
|
return this._suggestion;
|
|
965
975
|
}
|
|
966
|
-
}, ce = "@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}",
|
|
976
|
+
}, ce = "@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 O {
|
|
967
977
|
_alert = null;
|
|
968
978
|
_message = null;
|
|
969
979
|
render() {
|
|
970
|
-
this.shadowRoot && (this._alert?.getElement().remove(), this._alert = null, this._message && (this._alert = new
|
|
980
|
+
this.shadowRoot && (this._alert?.getElement().remove(), this._alert = null, this._message && (this._alert = new S({ message: this._message }), this.shadowRoot.appendChild(this._alert.getElement())));
|
|
971
981
|
}
|
|
972
982
|
setError(e) {
|
|
973
983
|
if (this._message = e, !this.shadowRoot) {
|
|
974
984
|
this.emit("error", e);
|
|
975
985
|
return;
|
|
976
986
|
}
|
|
977
|
-
this._alert ? this._alert.setMessage(e) : (this._alert = new
|
|
987
|
+
this._alert ? this._alert.setMessage(e) : (this._alert = new S({ message: e }), this.shadowRoot.appendChild(this._alert.getElement())), this.emit("error", e);
|
|
978
988
|
}
|
|
979
989
|
clearError() {
|
|
980
990
|
this._message = null, this._alert?.getElement().remove(), this._alert = null;
|
|
@@ -991,7 +1001,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
991
1001
|
getError() {
|
|
992
1002
|
return this._message;
|
|
993
1003
|
}
|
|
994
|
-
},
|
|
1004
|
+
}, le = ".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}", ue = {
|
|
995
1005
|
name: "odus-elements",
|
|
996
1006
|
styles: {
|
|
997
1007
|
fontSize: 14,
|
|
@@ -1015,7 +1025,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1015
1025
|
}
|
|
1016
1026
|
},
|
|
1017
1027
|
additionalPaymentMethods: {}
|
|
1018
|
-
}, Q = class extends
|
|
1028
|
+
}, Q = class extends O {
|
|
1019
1029
|
_paymentContext = null;
|
|
1020
1030
|
_button = null;
|
|
1021
1031
|
setPaymentContext(e) {
|
|
@@ -1025,7 +1035,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1025
1035
|
if (!this.shadowRoot || (this._button?.getElement().remove(), this._button = null, !this._paymentContext)) return;
|
|
1026
1036
|
let { onAuthorize: e } = this._paymentContext;
|
|
1027
1037
|
this._button = new ie({
|
|
1028
|
-
checkoutProfile:
|
|
1038
|
+
checkoutProfile: ue,
|
|
1029
1039
|
onSubmit: async () => {
|
|
1030
1040
|
this._button?.setSubmitting(!0);
|
|
1031
1041
|
try {
|
|
@@ -1037,7 +1047,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1037
1047
|
}), this.shadowRoot.appendChild(this._button.getElement());
|
|
1038
1048
|
}
|
|
1039
1049
|
getCss() {
|
|
1040
|
-
return super.getCss() +
|
|
1050
|
+
return super.getCss() + le + "\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 ";
|
|
1041
1051
|
}
|
|
1042
1052
|
getValue() {
|
|
1043
1053
|
return null;
|
|
@@ -1048,7 +1058,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1048
1058
|
getError() {
|
|
1049
1059
|
return null;
|
|
1050
1060
|
}
|
|
1051
|
-
},
|
|
1061
|
+
}, de = ".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}", fe = {
|
|
1052
1062
|
name: "odus-elements",
|
|
1053
1063
|
styles: {
|
|
1054
1064
|
fontSize: 14,
|
|
@@ -1072,7 +1082,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1072
1082
|
}
|
|
1073
1083
|
},
|
|
1074
1084
|
additionalPaymentMethods: {}
|
|
1075
|
-
}, $ = class extends
|
|
1085
|
+
}, $ = class extends O {
|
|
1076
1086
|
_phone = "";
|
|
1077
1087
|
_error = null;
|
|
1078
1088
|
_field = null;
|
|
@@ -1087,7 +1097,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1087
1097
|
this._field = new t({
|
|
1088
1098
|
value: this._phone,
|
|
1089
1099
|
error: !1,
|
|
1090
|
-
checkoutProfile:
|
|
1100
|
+
checkoutProfile: fe,
|
|
1091
1101
|
translationFunc: n,
|
|
1092
1102
|
locale: i,
|
|
1093
1103
|
label: this.options.label,
|
|
@@ -1106,10 +1116,10 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1106
1116
|
}
|
|
1107
1117
|
getCss() {
|
|
1108
1118
|
return super.getCss() + [
|
|
1109
|
-
w,
|
|
1110
1119
|
T,
|
|
1111
|
-
|
|
1112
|
-
|
|
1120
|
+
E,
|
|
1121
|
+
w,
|
|
1122
|
+
de
|
|
1113
1123
|
].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 ";
|
|
1114
1124
|
}
|
|
1115
1125
|
getValue() {
|
|
@@ -1122,7 +1132,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1122
1132
|
getError() {
|
|
1123
1133
|
return this._error;
|
|
1124
1134
|
}
|
|
1125
|
-
},
|
|
1135
|
+
}, pe = class {
|
|
1126
1136
|
_config;
|
|
1127
1137
|
_apiService;
|
|
1128
1138
|
_changeListeners = [];
|
|
@@ -1154,7 +1164,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1154
1164
|
}), s(h.CHECKOUT_INITIALIZED, { environment: e.environment }), e.locale && n.setLocale(e.locale), this._apiService = new f(e.apiKey, e.environment);
|
|
1155
1165
|
let t = {};
|
|
1156
1166
|
Object.defineProperty(t, "email", {
|
|
1157
|
-
get: () => (this._email || (this._email = new
|
|
1167
|
+
get: () => (this._email || (this._email = new X(), this._trackElement(this._email)), this._email),
|
|
1158
1168
|
enumerable: !0
|
|
1159
1169
|
}), Object.defineProperty(t, "phone", {
|
|
1160
1170
|
get: () => (this._phone || (this._phone = new $(), this._trackElement(this._phone)), this._phone),
|
|
@@ -1162,7 +1172,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1162
1172
|
});
|
|
1163
1173
|
let r = {};
|
|
1164
1174
|
Object.defineProperty(r, "applePay", {
|
|
1165
|
-
get: () => (this._applePay || (this._applePay = new
|
|
1175
|
+
get: () => (this._applePay || (this._applePay = new B(), this._trackElement(this._applePay), this._paymentState.paymentId && this._paymentState.checkoutKey && this._applePay.setPaymentContext({
|
|
1166
1176
|
paymentId: this._paymentState.paymentId,
|
|
1167
1177
|
checkoutKey: this._paymentState.checkoutKey,
|
|
1168
1178
|
environment: this._config.environment,
|
|
@@ -1184,25 +1194,25 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1184
1194
|
});
|
|
1185
1195
|
let i = {};
|
|
1186
1196
|
Object.defineProperty(i, "street", {
|
|
1187
|
-
get: () => (this._addressStreet || (this._addressStreet = new
|
|
1197
|
+
get: () => (this._addressStreet || (this._addressStreet = new I(), this._trackElement(this._addressStreet)), this._addressStreet),
|
|
1188
1198
|
enumerable: !0
|
|
1189
1199
|
}), Object.defineProperty(i, "firstName", {
|
|
1190
|
-
get: () => (this._addressFirstName || (this._addressFirstName = new
|
|
1200
|
+
get: () => (this._addressFirstName || (this._addressFirstName = new M(), this._trackElement(this._addressFirstName)), this._addressFirstName),
|
|
1191
1201
|
enumerable: !0
|
|
1192
1202
|
}), Object.defineProperty(i, "lastName", {
|
|
1193
|
-
get: () => (this._addressLastName || (this._addressLastName = new
|
|
1203
|
+
get: () => (this._addressLastName || (this._addressLastName = new N(), this._trackElement(this._addressLastName)), this._addressLastName),
|
|
1194
1204
|
enumerable: !0
|
|
1195
1205
|
}), Object.defineProperty(i, "city", {
|
|
1196
|
-
get: () => (this._addressCity || (this._addressCity = new
|
|
1206
|
+
get: () => (this._addressCity || (this._addressCity = new k(), this._trackElement(this._addressCity)), this._addressCity),
|
|
1197
1207
|
enumerable: !0
|
|
1198
1208
|
}), Object.defineProperty(i, "state", {
|
|
1199
|
-
get: () => (this._addressState || (this._addressState = new
|
|
1209
|
+
get: () => (this._addressState || (this._addressState = new F(), this._trackElement(this._addressState), this._addressCountry?.value && this._addressState.setCountry(this._addressCountry.value)), this._addressState),
|
|
1200
1210
|
enumerable: !0
|
|
1201
1211
|
}), Object.defineProperty(i, "zipCode", {
|
|
1202
|
-
get: () => (this._addressZipCode || (this._addressZipCode = new
|
|
1212
|
+
get: () => (this._addressZipCode || (this._addressZipCode = new L(), this._trackElement(this._addressZipCode)), this._addressZipCode),
|
|
1203
1213
|
enumerable: !0
|
|
1204
1214
|
}), Object.defineProperty(i, "country", {
|
|
1205
|
-
get: () => (this._addressCountry || (this._addressCountry = new
|
|
1215
|
+
get: () => (this._addressCountry || (this._addressCountry = new j(), this._trackElement(this._addressCountry), this._addressCountry.on("change", (e) => {
|
|
1206
1216
|
this._addressState?.setCountry(e);
|
|
1207
1217
|
})), this._addressCountry),
|
|
1208
1218
|
enumerable: !0
|
|
@@ -1212,16 +1222,16 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1212
1222
|
express: r
|
|
1213
1223
|
};
|
|
1214
1224
|
Object.defineProperty(a, "card", {
|
|
1215
|
-
get: () => (this._card || (this._card = new
|
|
1225
|
+
get: () => (this._card || (this._card = new J(), this._card.setEnvironment(this._config.environment), this._trackElement(this._card), this._paymentState.vgsJwt && this._card.setVgsJwt(this._paymentState.vgsJwt)), this._card),
|
|
1216
1226
|
enumerable: !0
|
|
1217
1227
|
}), Object.defineProperty(a, "cardholderName", {
|
|
1218
|
-
get: () => (this._cardholderName || (this._cardholderName = new
|
|
1228
|
+
get: () => (this._cardholderName || (this._cardholderName = new Y(), this._trackElement(this._cardholderName)), this._cardholderName),
|
|
1219
1229
|
enumerable: !0
|
|
1220
1230
|
}), Object.defineProperty(a, "address", {
|
|
1221
1231
|
get: () => i,
|
|
1222
1232
|
enumerable: !0
|
|
1223
1233
|
}), Object.defineProperty(a, "error", {
|
|
1224
|
-
get: () => (this._error || (this._error = new
|
|
1234
|
+
get: () => (this._error || (this._error = new Z(), this._trackElement(this._error)), this._error),
|
|
1225
1235
|
enumerable: !0
|
|
1226
1236
|
}), this.elements = a;
|
|
1227
1237
|
}
|
|
@@ -1333,7 +1343,7 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1333
1343
|
let t = e["--odus-font-family"];
|
|
1334
1344
|
if (t) {
|
|
1335
1345
|
this._fontCleanup?.();
|
|
1336
|
-
let { cleanup: e } =
|
|
1346
|
+
let { cleanup: e } = ee({ fontFamily: t });
|
|
1337
1347
|
this._fontCleanup = e;
|
|
1338
1348
|
}
|
|
1339
1349
|
for (let t of this._allElements()) t.setTheme(e);
|
|
@@ -1453,4 +1463,4 @@ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
1453
1463
|
}
|
|
1454
1464
|
};
|
|
1455
1465
|
//#endregion
|
|
1456
|
-
export {
|
|
1466
|
+
export { k as AddressCityElement, j as AddressCountryElement, M as AddressFirstNameElement, N as AddressLastNameElement, F as AddressStateElement, I as AddressStreetElement, L as AddressZipCodeElement, B as ApplePayElement, O as BaseElement, J as CardElement, Y as CardholderElement, X as EmailElement, Z as ErrorElement, pe as OdusElements, Q as PayPalElement, $ as PhoneElement };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkout.service.d.ts","sourceRoot":"","sources":["../../../src/services/checkout/Checkout.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACf,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAgC7D,cAAM,QAAQ;IACZ,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,EAAE,cAAc;IAyClC,OAAO,CAAC,cAAc;IA4Bf,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"Checkout.service.d.ts","sourceRoot":"","sources":["../../../src/services/checkout/Checkout.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACf,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAgC7D,cAAM,QAAQ;IACZ,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,EAAE,cAAc;IAyClC,OAAO,CAAC,cAAc;IA4Bf,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAmDhC,OAAO,IAAI,IAAI;YAwBR,YAAY;IAwE1B,OAAO,CAAC,qBAAqB;IAmC7B,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,gBAAgB;IASjB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IASnC,UAAU,IAAI,IAAI;IASlB,MAAM,CAAC,KAAK,EAAE;QAAE,UAAU,CAAC,EAAE,UAAU,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAmB3D,gBAAgB,CAC3B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAuFT,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI;CAGjE;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/shared.js
CHANGED
|
@@ -12,6 +12,7 @@ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
12
12
|
}, r = {
|
|
13
13
|
CHECKOUT_INITIALIZED: "checkout.initialized",
|
|
14
14
|
CHECKOUT_MOUNTED: "checkout.mounted",
|
|
15
|
+
CHECKOUT_MOUNT_FAILED: "checkout.mount.failed",
|
|
15
16
|
CHECKOUT_UNMOUNTED: "checkout.unmounted",
|
|
16
17
|
PAYMENT_ASSOCIATED: "payment.associated",
|
|
17
18
|
PAYMENT_ASSOCIATION_FAILED: "payment.association.failed",
|
|
@@ -333,7 +334,7 @@ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
333
334
|
url: t,
|
|
334
335
|
app: {
|
|
335
336
|
name: "odus-checkout",
|
|
336
|
-
version: "1.
|
|
337
|
+
version: "1.9.0",
|
|
337
338
|
environment: e.environment === "test" ? "sandbox" : "production"
|
|
338
339
|
},
|
|
339
340
|
isolate: !0,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const CheckoutEvents: {
|
|
2
2
|
readonly CHECKOUT_INITIALIZED: "checkout.initialized";
|
|
3
3
|
readonly CHECKOUT_MOUNTED: "checkout.mounted";
|
|
4
|
+
readonly CHECKOUT_MOUNT_FAILED: "checkout.mount.failed";
|
|
4
5
|
readonly CHECKOUT_UNMOUNTED: "checkout.unmounted";
|
|
5
6
|
readonly PAYMENT_ASSOCIATED: "payment.associated";
|
|
6
7
|
readonly PAYMENT_ASSOCIATION_FAILED: "payment.association.failed";
|
|
@@ -31,6 +32,10 @@ export type CheckoutInitializedAttributes = {
|
|
|
31
32
|
export type CheckoutMountedAttributes = {
|
|
32
33
|
container_id: string;
|
|
33
34
|
};
|
|
35
|
+
export type CheckoutMountFailedAttributes = {
|
|
36
|
+
container_id: string;
|
|
37
|
+
error_message: string;
|
|
38
|
+
};
|
|
34
39
|
export type PaymentAssociatedAttributes = {
|
|
35
40
|
payment_id: string;
|
|
36
41
|
currency: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TelemetryEvents.type.d.ts","sourceRoot":"","sources":["../../../src/types/telemetry/TelemetryEvents.type.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"TelemetryEvents.type.d.ts","sourceRoot":"","sources":["../../../src/types/telemetry/TelemetryEvents.type.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;CA6BjB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAMvD,eAAO,MAAM,oBAAoB;;;;;;CAMvB,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAMnE,MAAM,MAAM,6BAA6B,GAAG;IAC1C,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odus/checkout",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"displayName": "Odus Checkout SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"odus",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
"outputs": [
|
|
56
|
-
"{projectRoot}/coverage"
|
|
56
|
+
"{projectRoot}/test-output/vitest/coverage"
|
|
57
57
|
],
|
|
58
58
|
"executor": "@nx/vitest:test",
|
|
59
|
+
"// options": "Do not add a `reportsDirectory` option here: the executor would override the one in vitest.config.ts, so a direct vitest run and an Nx run would write two different directories and an Nx cache replay would delete a directory a live run is using — see #4387.",
|
|
59
60
|
"options": {
|
|
60
61
|
"passWithNoTests": false,
|
|
61
|
-
"
|
|
62
|
-
"config": "{projectRoot}/vitest.config.ts"
|
|
62
|
+
"configFile": "{projectRoot}/vitest.config.ts"
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"build": {
|