@odus/checkout 1.14.9 → 1.16.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/elements/BaseElement.d.ts +3 -0
- package/dist/elements/BaseElement.d.ts.map +1 -1
- package/dist/elements/CardElement.d.ts.map +1 -1
- package/dist/elements.es.js +86 -70
- package/dist/loader/loadOdus.d.ts +63 -0
- package/dist/loader/loadOdus.d.ts.map +1 -0
- package/dist/loader.d.ts +3 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/phone.js +1 -1
- package/dist/services/telemetry/Telemetry.service.d.ts +8 -0
- package/dist/services/telemetry/Telemetry.service.d.ts.map +1 -1
- package/dist/shared.js +227 -222
- package/dist/utils/dom/adoptStyles.util.d.ts +24 -0
- package/dist/utils/dom/adoptStyles.util.d.ts.map +1 -0
- package/package.json +22 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AdoptedStyles } from '../utils/dom/adoptStyles.util';
|
|
1
2
|
import { CheckoutLoadFailureReason } from '../types/telemetry/TelemetryEvents.type';
|
|
2
3
|
import { ElementEvent, MountOptions } from './types';
|
|
3
4
|
export type { ElementEvent, MountOptions };
|
|
@@ -9,6 +10,8 @@ export declare abstract class BaseElement {
|
|
|
9
10
|
protected readonly elementName: string;
|
|
10
11
|
/** The last target that resolved to a container, kept for a remount. */
|
|
11
12
|
protected mountTarget: string | HTMLElement | null;
|
|
13
|
+
/** The element's stylesheet while it is mounted. */
|
|
14
|
+
protected styles: AdoptedStyles | null;
|
|
12
15
|
private _mountFailureListener;
|
|
13
16
|
private readonly listeners;
|
|
14
17
|
get isMounted(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseElement.d.ts","sourceRoot":"","sources":["../../src/elements/BaseElement.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,yBAAyB,EAE/B,MAAM,yCAAyC,CAAC;AAIjD,OAAO,KAAK,EAAE,YAAY,EAAE,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AQ,CAAC,QAAQ,IAAI,MAAM,GAAG,IAAI;CAC7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardElement.d.ts","sourceRoot":"","sources":["../../src/elements/CardElement.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAGL,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACzB,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"CardElement.d.ts","sourceRoot":"","sources":["../../src/elements/CardElement.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAGL,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACzB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,eAAO,MAAM,8BAA8B,yDACa,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,aAAa,CAAC;AAElB,qBAAa,WAAY,SAAQ,WAAW;IAC1C,mBAA4B,WAAW,iBAAiB;IACxD,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,aAAa,CAA+B;IACpD,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,kBAAkB,CAC8B;IACxD,OAAO,CAAC,oBAAoB,CAC6B;IAEzD,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,2EAA2E;IAC3E,IAAI,YAAY,IAAI,gBAAgB,CAEnC;IAED,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAItC;;;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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 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 =
|
|
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 = (e) => "adoptedStyleSheets" in e, xe = (e, t) => {
|
|
4
|
+
let n = (e.nodeType === Node.DOCUMENT_NODE ? e : e.ownerDocument)?.defaultView?.CSSStyleSheet;
|
|
5
|
+
if (!n) return null;
|
|
6
|
+
try {
|
|
7
|
+
let e = new n();
|
|
8
|
+
return e.replaceSync(t), e;
|
|
9
|
+
} catch {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
}, P = (e, t, n) => {
|
|
13
|
+
let r = e.getRootNode(), i = N(r) ? xe(r, t) : null;
|
|
14
|
+
if (i && N(r)) try {
|
|
15
|
+
return r.adoptedStyleSheets = [...r.adoptedStyleSheets, i], {
|
|
16
|
+
update: (e) => i.replaceSync(e),
|
|
17
|
+
remove: () => {
|
|
18
|
+
r.adoptedStyleSheets = r.adoptedStyleSheets.filter((e) => e !== i);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
} catch {}
|
|
22
|
+
let a = (n.ownerDocument ?? document).createElement("style");
|
|
23
|
+
return a.textContent = t, n.appendChild(a), {
|
|
24
|
+
update: (e) => {
|
|
25
|
+
a.textContent = e;
|
|
26
|
+
},
|
|
27
|
+
remove: () => a.remove()
|
|
28
|
+
};
|
|
29
|
+
}, Se = ":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}", F = (e) => typeof e == "string" ? e : e instanceof HTMLElement ? e.id ? `#${e.id}` : e.tagName.toLowerCase() : String(e), I = class {
|
|
4
30
|
shadowRoot = null;
|
|
5
31
|
host = null;
|
|
6
32
|
options = {};
|
|
7
33
|
_appliedTheme = {};
|
|
8
34
|
elementName = "BaseElement";
|
|
9
35
|
mountTarget = null;
|
|
36
|
+
styles = null;
|
|
10
37
|
_mountFailureListener = null;
|
|
11
38
|
listeners = /* @__PURE__ */ new Map();
|
|
12
39
|
get isMounted() {
|
|
@@ -24,19 +51,17 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
24
51
|
t = !0, this.mountTarget = e, this.attach(n);
|
|
25
52
|
} catch (n) {
|
|
26
53
|
throw this.unmount(), C(g.CHECKOUT_MOUNT_FAILED, {
|
|
27
|
-
container_id:
|
|
54
|
+
container_id: F(e),
|
|
28
55
|
error_message: n instanceof Error ? n.message : "Unknown error"
|
|
29
|
-
}), x(n instanceof Error ? n : /* @__PURE__ */ Error("Failed to mount element"), { container_id:
|
|
56
|
+
}), x(n instanceof Error ? n : /* @__PURE__ */ Error("Failed to mount element"), { container_id: F(e) }), this._mountFailureListener?.(t ? S.MOUNT_FAILED : S.CONTAINER_NOT_FOUND), n;
|
|
30
57
|
}
|
|
31
58
|
this.emit("ready");
|
|
32
59
|
}
|
|
33
60
|
attach(e) {
|
|
34
|
-
this.host = document.createElement("div"), this.shadowRoot = this.host.attachShadow({ mode: "open" });
|
|
35
|
-
let t = document.createElement("style");
|
|
36
|
-
t.textContent = this.getCss(), this.shadowRoot.appendChild(t), e.appendChild(this.host), this.reapplyTheme(), this.render();
|
|
61
|
+
this.host = (e.ownerDocument ?? document).createElement("div"), this.shadowRoot = this.host.attachShadow({ mode: "open" }), this.styles = P(this.shadowRoot, this.getCss(), this.shadowRoot), e.appendChild(this.host), this.reapplyTheme(), this.render();
|
|
37
62
|
}
|
|
38
63
|
unmount() {
|
|
39
|
-
this.host?.parentElement?.removeChild(this.host), this.host = null, this.shadowRoot = null;
|
|
64
|
+
this.styles?.remove(), this.styles = null, this.host?.parentElement?.removeChild(this.host), this.host = null, this.shadowRoot = null;
|
|
40
65
|
}
|
|
41
66
|
destroy() {
|
|
42
67
|
this.unmount(), this.listeners.clear();
|
|
@@ -46,13 +71,10 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
46
71
|
return n.push(t), this.listeners.set(e, n), this;
|
|
47
72
|
}
|
|
48
73
|
update(e) {
|
|
49
|
-
|
|
74
|
+
this.options = {
|
|
50
75
|
...this.options,
|
|
51
76
|
...e
|
|
52
|
-
}, this.shadowRoot)
|
|
53
|
-
let e = this.shadowRoot.querySelector("style");
|
|
54
|
-
e && (e.textContent = this.getCss()), this.render();
|
|
55
|
-
}
|
|
77
|
+
}, this.shadowRoot && (this.styles?.update(this.getCss()), this.render());
|
|
56
78
|
}
|
|
57
79
|
setTheme(e) {
|
|
58
80
|
if (this._appliedTheme = {
|
|
@@ -82,9 +104,9 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
82
104
|
this.options.callbacks?.[e]?.(t);
|
|
83
105
|
}
|
|
84
106
|
getCss() {
|
|
85
|
-
return
|
|
107
|
+
return Se;
|
|
86
108
|
}
|
|
87
|
-
},
|
|
109
|
+
}, L = class extends I {
|
|
88
110
|
_value = "";
|
|
89
111
|
_error = null;
|
|
90
112
|
_input = null;
|
|
@@ -123,7 +145,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
123
145
|
getError() {
|
|
124
146
|
return this._error;
|
|
125
147
|
}
|
|
126
|
-
},
|
|
148
|
+
}, R = ".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}", z = class extends I {
|
|
127
149
|
_value = "";
|
|
128
150
|
_error = null;
|
|
129
151
|
_select = null;
|
|
@@ -155,7 +177,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
155
177
|
return super.getCss() + [
|
|
156
178
|
M,
|
|
157
179
|
A,
|
|
158
|
-
|
|
180
|
+
R
|
|
159
181
|
].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
182
|
}
|
|
161
183
|
getValue() {
|
|
@@ -167,7 +189,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
167
189
|
getError() {
|
|
168
190
|
return this._error;
|
|
169
191
|
}
|
|
170
|
-
},
|
|
192
|
+
}, B = class extends I {
|
|
171
193
|
_value = "";
|
|
172
194
|
_error = null;
|
|
173
195
|
_input = null;
|
|
@@ -206,7 +228,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
206
228
|
getError() {
|
|
207
229
|
return this._error;
|
|
208
230
|
}
|
|
209
|
-
},
|
|
231
|
+
}, V = class extends I {
|
|
210
232
|
_value = "";
|
|
211
233
|
_error = null;
|
|
212
234
|
_input = null;
|
|
@@ -245,7 +267,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
245
267
|
getError() {
|
|
246
268
|
return this._error;
|
|
247
269
|
}
|
|
248
|
-
},
|
|
270
|
+
}, H = class extends I {
|
|
249
271
|
_value = "";
|
|
250
272
|
_country = "";
|
|
251
273
|
_input = null;
|
|
@@ -302,7 +324,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
302
324
|
j,
|
|
303
325
|
M,
|
|
304
326
|
A,
|
|
305
|
-
|
|
327
|
+
R
|
|
306
328
|
].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 ";
|
|
307
329
|
}
|
|
308
330
|
getValue() {
|
|
@@ -316,7 +338,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
316
338
|
let { t: e } = O();
|
|
317
339
|
return e("validation.stateRequired");
|
|
318
340
|
}
|
|
319
|
-
},
|
|
341
|
+
}, U = class extends I {
|
|
320
342
|
_value = "";
|
|
321
343
|
_error = null;
|
|
322
344
|
_input = null;
|
|
@@ -360,7 +382,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
360
382
|
getError() {
|
|
361
383
|
return this._error;
|
|
362
384
|
}
|
|
363
|
-
},
|
|
385
|
+
}, W = class extends I {
|
|
364
386
|
_value = "";
|
|
365
387
|
_error = null;
|
|
366
388
|
_input = null;
|
|
@@ -399,7 +421,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
399
421
|
getError() {
|
|
400
422
|
return this._error;
|
|
401
423
|
}
|
|
402
|
-
},
|
|
424
|
+
}, Ce = "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)}", we = {
|
|
403
425
|
name: "odus-elements",
|
|
404
426
|
styles: {
|
|
405
427
|
fontSize: 14,
|
|
@@ -423,7 +445,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
423
445
|
}
|
|
424
446
|
},
|
|
425
447
|
additionalPaymentMethods: {}
|
|
426
|
-
},
|
|
448
|
+
}, G = class extends I {
|
|
427
449
|
_paymentContext = null;
|
|
428
450
|
_applePayData = null;
|
|
429
451
|
_authorized = !1;
|
|
@@ -443,7 +465,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
443
465
|
}
|
|
444
466
|
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;
|
|
445
467
|
oe(a, r?.countryCode) && ue() ? (this._button = new he({
|
|
446
|
-
checkoutProfile:
|
|
468
|
+
checkoutProfile: we,
|
|
447
469
|
paymentId: e,
|
|
448
470
|
checkoutKey: t,
|
|
449
471
|
environment: n,
|
|
@@ -465,7 +487,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
465
487
|
this._isAvailable = e, this.host && (e ? this.host.style.removeProperty("display") : this.host.style.display = "none");
|
|
466
488
|
}
|
|
467
489
|
getCss() {
|
|
468
|
-
return super.getCss() +
|
|
490
|
+
return super.getCss() + Ce + "\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 ";
|
|
469
491
|
}
|
|
470
492
|
getValue() {
|
|
471
493
|
return this._applePayData;
|
|
@@ -476,7 +498,7 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
476
498
|
getError() {
|
|
477
499
|
return null;
|
|
478
500
|
}
|
|
479
|
-
},
|
|
501
|
+
}, Te = ".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 = {
|
|
480
502
|
name: "odus-elements",
|
|
481
503
|
styles: {
|
|
482
504
|
fontSize: 14,
|
|
@@ -524,11 +546,11 @@ var A = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-ind
|
|
|
524
546
|
"--odus-button-height": "48px",
|
|
525
547
|
"--odus-button-border-radius": "var(--odus-border-radius)"
|
|
526
548
|
}["--odus-font-size"];
|
|
527
|
-
function
|
|
549
|
+
function Ee(e, t) {
|
|
528
550
|
let n = Object.keys(e);
|
|
529
551
|
return n.length === Object.keys(t).length && n.every((n) => e[n] === t[n]);
|
|
530
552
|
}
|
|
531
|
-
var
|
|
553
|
+
var De = class {
|
|
532
554
|
_vgsService;
|
|
533
555
|
_vgsJwt;
|
|
534
556
|
_vgsState = {};
|
|
@@ -601,7 +623,7 @@ var we = class {
|
|
|
601
623
|
...this._currentTheme,
|
|
602
624
|
...e
|
|
603
625
|
};
|
|
604
|
-
|
|
626
|
+
Ee(this._currentTheme, t) || (this._currentTheme = t, this._section && (this._applySkeletonMetrics(), this._reinitWithTheme()));
|
|
605
627
|
}
|
|
606
628
|
resetTheme(e) {
|
|
607
629
|
let t = e.filter((e) => e in this._currentTheme);
|
|
@@ -683,7 +705,7 @@ var we = class {
|
|
|
683
705
|
}
|
|
684
706
|
return t;
|
|
685
707
|
}
|
|
686
|
-
},
|
|
708
|
+
}, Oe = "Card capture is unavailable: no tokenization session", J = class extends I {
|
|
687
709
|
elementName = "CardElement";
|
|
688
710
|
_environment = "test";
|
|
689
711
|
_captureState = "pending";
|
|
@@ -707,7 +729,7 @@ var we = class {
|
|
|
707
729
|
setVgsJwt(e) {
|
|
708
730
|
if (this._vgsAdapter && this._vgsJwt === e) return;
|
|
709
731
|
this._captureState = "vgs", this._reportedUnavailable = !1, this._vgsJwt = e, this._vgsAdapter?.destroy();
|
|
710
|
-
let t = new
|
|
732
|
+
let t = new De(e, this._environment, {
|
|
711
733
|
onInitFailure: () => {
|
|
712
734
|
this._vgsAdapter === t && this.isMounted && this.markCaptureUnavailable(m.INIT_FAILED);
|
|
713
735
|
},
|
|
@@ -731,16 +753,10 @@ var we = class {
|
|
|
731
753
|
this.isMounted && this.unmount(), this._captureState = "unsupported", this._reportedUnavailable = !1, this._vgsAdapter?.destroy(), this._vgsAdapter = null, this._vgsJwt = null, t && e && this.mount(e);
|
|
732
754
|
}
|
|
733
755
|
attach(e) {
|
|
734
|
-
|
|
735
|
-
super.attach(e);
|
|
736
|
-
return;
|
|
737
|
-
}
|
|
738
|
-
this.host = document.createElement("div");
|
|
739
|
-
let t = document.createElement("style");
|
|
740
|
-
t.textContent = this.getCss(), this.host.appendChild(t), e.appendChild(this.host), this.reapplyTheme(), Object.keys(this._appliedTheme).length > 0 && this._vgsAdapter?.applyTheme(this._appliedTheme), this.render(), this._vgsAdapter?.initVgs();
|
|
756
|
+
this._captureState === "vgs" ? (this.host = (e.ownerDocument ?? document).createElement("div"), e.appendChild(this.host), this.styles = P(this.host, this.getCss(), this.host), this.reapplyTheme(), Object.keys(this._appliedTheme).length > 0 && this._vgsAdapter?.applyTheme(this._appliedTheme), this.render(), this._vgsAdapter?.initVgs()) : super.attach(e);
|
|
741
757
|
}
|
|
742
758
|
unmount() {
|
|
743
|
-
this._captureState === "vgs" ? (this.host?.parentElement?.removeChild(this.host), this.host = null, this.shadowRoot = null) : super.unmount();
|
|
759
|
+
this._captureState === "vgs" ? (this.styles?.remove(), this.styles = null, this.host?.parentElement?.removeChild(this.host), this.host = null, this.shadowRoot = null) : super.unmount();
|
|
744
760
|
}
|
|
745
761
|
render() {
|
|
746
762
|
if (this._captureState === "vgs") {
|
|
@@ -793,7 +809,7 @@ var we = class {
|
|
|
793
809
|
j,
|
|
794
810
|
M,
|
|
795
811
|
A,
|
|
796
|
-
|
|
812
|
+
Te
|
|
797
813
|
].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 ";
|
|
798
814
|
}
|
|
799
815
|
getValue() {
|
|
@@ -804,7 +820,7 @@ var we = class {
|
|
|
804
820
|
};
|
|
805
821
|
}
|
|
806
822
|
async getPayload() {
|
|
807
|
-
if (this._captureState !== "vgs" || !this._vgsAdapter) throw Error(
|
|
823
|
+
if (this._captureState !== "vgs" || !this._vgsAdapter) throw Error(Oe);
|
|
808
824
|
return this._vgsAdapter.getPayload();
|
|
809
825
|
}
|
|
810
826
|
getIsValid() {
|
|
@@ -813,7 +829,7 @@ var we = class {
|
|
|
813
829
|
getError() {
|
|
814
830
|
return this._captureState === "unavailable" ? O().t("cardUnavailable") : this._vgsAdapter?.getError() ?? null;
|
|
815
831
|
}
|
|
816
|
-
}, Y = class extends
|
|
832
|
+
}, Y = class extends I {
|
|
817
833
|
_value = "";
|
|
818
834
|
_error = null;
|
|
819
835
|
_input = null;
|
|
@@ -853,7 +869,7 @@ var we = class {
|
|
|
853
869
|
getError() {
|
|
854
870
|
return this._error;
|
|
855
871
|
}
|
|
856
|
-
},
|
|
872
|
+
}, ke = {
|
|
857
873
|
name: "odus-elements",
|
|
858
874
|
styles: {
|
|
859
875
|
fontSize: 14,
|
|
@@ -877,7 +893,7 @@ var we = class {
|
|
|
877
893
|
}
|
|
878
894
|
},
|
|
879
895
|
additionalPaymentMethods: {}
|
|
880
|
-
}, X = class extends
|
|
896
|
+
}, X = class extends I {
|
|
881
897
|
_email = "";
|
|
882
898
|
_error = null;
|
|
883
899
|
_suggestion = null;
|
|
@@ -889,7 +905,7 @@ var we = class {
|
|
|
889
905
|
this._field = new fe({
|
|
890
906
|
value: this._email,
|
|
891
907
|
error: !1,
|
|
892
|
-
checkoutProfile:
|
|
908
|
+
checkoutProfile: ke,
|
|
893
909
|
translationFunc: e,
|
|
894
910
|
label: this.options.label,
|
|
895
911
|
placeholder: this.options.placeholder,
|
|
@@ -922,7 +938,7 @@ var we = class {
|
|
|
922
938
|
get suggestion() {
|
|
923
939
|
return this._suggestion;
|
|
924
940
|
}
|
|
925
|
-
},
|
|
941
|
+
}, Ae = "@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 I {
|
|
926
942
|
_alert = null;
|
|
927
943
|
_message = null;
|
|
928
944
|
render() {
|
|
@@ -935,7 +951,7 @@ var we = class {
|
|
|
935
951
|
this._message = null, this._alert?.getElement().remove(), this._alert = null;
|
|
936
952
|
}
|
|
937
953
|
getCss() {
|
|
938
|
-
return super.getCss() +
|
|
954
|
+
return super.getCss() + Ae + "\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 ";
|
|
939
955
|
}
|
|
940
956
|
getValue() {
|
|
941
957
|
return null;
|
|
@@ -946,7 +962,7 @@ var we = class {
|
|
|
946
962
|
getError() {
|
|
947
963
|
return this._message;
|
|
948
964
|
}
|
|
949
|
-
},
|
|
965
|
+
}, je = ".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}", Me = {
|
|
950
966
|
name: "odus-elements",
|
|
951
967
|
styles: {
|
|
952
968
|
fontSize: 14,
|
|
@@ -970,7 +986,7 @@ var we = class {
|
|
|
970
986
|
}
|
|
971
987
|
},
|
|
972
988
|
additionalPaymentMethods: {}
|
|
973
|
-
}, Q = class extends
|
|
989
|
+
}, Q = class extends I {
|
|
974
990
|
_paymentContext = null;
|
|
975
991
|
_button = null;
|
|
976
992
|
setPaymentContext(e) {
|
|
@@ -980,7 +996,7 @@ var we = class {
|
|
|
980
996
|
if (!this.shadowRoot || (this._button?.getElement().remove(), this._button = null, !this._paymentContext)) return;
|
|
981
997
|
let { onAuthorize: e } = this._paymentContext;
|
|
982
998
|
this._button = new de({
|
|
983
|
-
checkoutProfile:
|
|
999
|
+
checkoutProfile: Me,
|
|
984
1000
|
onSubmit: async () => {
|
|
985
1001
|
this._button?.setSubmitting(!0);
|
|
986
1002
|
try {
|
|
@@ -992,7 +1008,7 @@ var we = class {
|
|
|
992
1008
|
}), this.shadowRoot.appendChild(this._button.getElement());
|
|
993
1009
|
}
|
|
994
1010
|
getCss() {
|
|
995
|
-
return super.getCss() +
|
|
1011
|
+
return super.getCss() + je + "\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 ";
|
|
996
1012
|
}
|
|
997
1013
|
getValue() {
|
|
998
1014
|
return null;
|
|
@@ -1003,7 +1019,7 @@ var we = class {
|
|
|
1003
1019
|
getError() {
|
|
1004
1020
|
return null;
|
|
1005
1021
|
}
|
|
1006
|
-
},
|
|
1022
|
+
}, Ne = ".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}", Pe = {
|
|
1007
1023
|
name: "odus-elements",
|
|
1008
1024
|
styles: {
|
|
1009
1025
|
fontSize: 14,
|
|
@@ -1027,7 +1043,7 @@ var we = class {
|
|
|
1027
1043
|
}
|
|
1028
1044
|
},
|
|
1029
1045
|
additionalPaymentMethods: {}
|
|
1030
|
-
}, $ = class extends
|
|
1046
|
+
}, $ = class extends I {
|
|
1031
1047
|
_phone = "";
|
|
1032
1048
|
_error = null;
|
|
1033
1049
|
_field = null;
|
|
@@ -1049,7 +1065,7 @@ var we = class {
|
|
|
1049
1065
|
this._field = new t({
|
|
1050
1066
|
value: this._phone,
|
|
1051
1067
|
error: !1,
|
|
1052
|
-
checkoutProfile:
|
|
1068
|
+
checkoutProfile: Pe,
|
|
1053
1069
|
translationFunc: r,
|
|
1054
1070
|
locale: i,
|
|
1055
1071
|
label: this.options.label,
|
|
@@ -1080,7 +1096,7 @@ var we = class {
|
|
|
1080
1096
|
j,
|
|
1081
1097
|
M,
|
|
1082
1098
|
A,
|
|
1083
|
-
|
|
1099
|
+
Ne
|
|
1084
1100
|
].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 ";
|
|
1085
1101
|
}
|
|
1086
1102
|
getValue() {
|
|
@@ -1096,7 +1112,7 @@ var we = class {
|
|
|
1096
1112
|
destroy() {
|
|
1097
1113
|
this._loadOutcomeListener = null, super.destroy();
|
|
1098
1114
|
}
|
|
1099
|
-
},
|
|
1115
|
+
}, Fe = "Payment failed", Ie = "We couldn't securely process your card details. Please check your card information and try again.", Le = "No payment details were entered. Please add your card and try again.", Re = "This payment is no longer available. Please reload the page and try again.", ze = class {
|
|
1100
1116
|
_config;
|
|
1101
1117
|
_apiService;
|
|
1102
1118
|
_changeListeners = [];
|
|
@@ -1144,7 +1160,7 @@ var we = class {
|
|
|
1144
1160
|
});
|
|
1145
1161
|
let i = {};
|
|
1146
1162
|
Object.defineProperty(i, "applePay", {
|
|
1147
|
-
get: () => (this._applePay || (this._applePay = new
|
|
1163
|
+
get: () => (this._applePay || (this._applePay = new G(), this._trackElement(this._applePay), this._paymentState.paymentId && this._paymentState.checkoutKey && this._applePay.setPaymentContext({
|
|
1148
1164
|
paymentId: this._paymentState.paymentId,
|
|
1149
1165
|
checkoutKey: this._paymentState.checkoutKey,
|
|
1150
1166
|
environment: this._config.environment,
|
|
@@ -1170,25 +1186,25 @@ var we = class {
|
|
|
1170
1186
|
});
|
|
1171
1187
|
let a = {};
|
|
1172
1188
|
Object.defineProperty(a, "street", {
|
|
1173
|
-
get: () => (this._addressStreet || (this._addressStreet = new
|
|
1189
|
+
get: () => (this._addressStreet || (this._addressStreet = new U(), this._trackElement(this._addressStreet)), this._addressStreet),
|
|
1174
1190
|
enumerable: !0
|
|
1175
1191
|
}), Object.defineProperty(a, "firstName", {
|
|
1176
|
-
get: () => (this._addressFirstName || (this._addressFirstName = new
|
|
1192
|
+
get: () => (this._addressFirstName || (this._addressFirstName = new B(), this._trackElement(this._addressFirstName)), this._addressFirstName),
|
|
1177
1193
|
enumerable: !0
|
|
1178
1194
|
}), Object.defineProperty(a, "lastName", {
|
|
1179
|
-
get: () => (this._addressLastName || (this._addressLastName = new
|
|
1195
|
+
get: () => (this._addressLastName || (this._addressLastName = new V(), this._trackElement(this._addressLastName)), this._addressLastName),
|
|
1180
1196
|
enumerable: !0
|
|
1181
1197
|
}), Object.defineProperty(a, "city", {
|
|
1182
|
-
get: () => (this._addressCity || (this._addressCity = new
|
|
1198
|
+
get: () => (this._addressCity || (this._addressCity = new L(), this._trackElement(this._addressCity)), this._addressCity),
|
|
1183
1199
|
enumerable: !0
|
|
1184
1200
|
}), Object.defineProperty(a, "state", {
|
|
1185
|
-
get: () => (this._addressState || (this._addressState = new
|
|
1201
|
+
get: () => (this._addressState || (this._addressState = new H(), this._trackElement(this._addressState), this._addressCountry?.value && this._addressState.setCountry(this._addressCountry.value)), this._addressState),
|
|
1186
1202
|
enumerable: !0
|
|
1187
1203
|
}), Object.defineProperty(a, "zipCode", {
|
|
1188
|
-
get: () => (this._addressZipCode || (this._addressZipCode = new
|
|
1204
|
+
get: () => (this._addressZipCode || (this._addressZipCode = new W(), this._trackElement(this._addressZipCode)), this._addressZipCode),
|
|
1189
1205
|
enumerable: !0
|
|
1190
1206
|
}), Object.defineProperty(a, "country", {
|
|
1191
|
-
get: () => (this._addressCountry || (this._addressCountry = new
|
|
1207
|
+
get: () => (this._addressCountry || (this._addressCountry = new z(), this._trackElement(this._addressCountry), this._addressCountry.on("change", (e) => {
|
|
1192
1208
|
this._addressState?.setCountry(e);
|
|
1193
1209
|
})), this._addressCountry),
|
|
1194
1210
|
enumerable: !0
|
|
@@ -1291,7 +1307,7 @@ var we = class {
|
|
|
1291
1307
|
if (!this._card?.isMounted || this._card.captureState === "unsupported") return {
|
|
1292
1308
|
ok: !1,
|
|
1293
1309
|
error: {
|
|
1294
|
-
message:
|
|
1310
|
+
message: Le,
|
|
1295
1311
|
status: 0,
|
|
1296
1312
|
statusText: "No Payment Method",
|
|
1297
1313
|
failureClass: v.NOT_SENT
|
|
@@ -1322,7 +1338,7 @@ var we = class {
|
|
|
1322
1338
|
return {
|
|
1323
1339
|
ok: !1,
|
|
1324
1340
|
error: l({
|
|
1325
|
-
message:
|
|
1341
|
+
message: Ie,
|
|
1326
1342
|
status: 0,
|
|
1327
1343
|
statusText: "Card Tokenization Failed",
|
|
1328
1344
|
failureClass: v.NOT_SENT
|
|
@@ -1406,7 +1422,7 @@ var we = class {
|
|
|
1406
1422
|
async _executeAuthorization({ formData: e, applePayData: t, customCustomerData: n }) {
|
|
1407
1423
|
let { paymentId: r, checkoutKey: i } = this._paymentState, a = this._getPaymentMethod(e, t);
|
|
1408
1424
|
if (!r || !i) return this._reportSubmitFailure({
|
|
1409
|
-
message:
|
|
1425
|
+
message: Re,
|
|
1410
1426
|
status: 0,
|
|
1411
1427
|
statusText: "No Associated Payment",
|
|
1412
1428
|
failureClass: v.NOT_SENT
|
|
@@ -1484,7 +1500,7 @@ var we = class {
|
|
|
1484
1500
|
}), this._readiness.reportSubmit(d(e, t)), this._handleAuthorizationError(e);
|
|
1485
1501
|
}
|
|
1486
1502
|
_handleAuthorizationError(e) {
|
|
1487
|
-
let t = this._readErrorMessage(e,
|
|
1503
|
+
let t = this._readErrorMessage(e, Fe);
|
|
1488
1504
|
this._callbacks.onPaymentFailed?.(t), this._error?.isMounted && this._error.setError(t);
|
|
1489
1505
|
}
|
|
1490
1506
|
_readErrorMessage(e, t) {
|
|
@@ -1493,4 +1509,4 @@ var we = class {
|
|
|
1493
1509
|
}
|
|
1494
1510
|
};
|
|
1495
1511
|
//#endregion
|
|
1496
|
-
export {
|
|
1512
|
+
export { L as AddressCityElement, z as AddressCountryElement, B as AddressFirstNameElement, V as AddressLastNameElement, H as AddressStateElement, U as AddressStreetElement, W as AddressZipCodeElement, G as ApplePayElement, I as BaseElement, J as CardElement, Y as CardholderElement, X as EmailElement, Z as ErrorElement, ze as OdusElements, Q as PayPalElement, $ as PhoneElement };
|