@odus/checkout 1.5.0 → 1.5.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.es.js +62 -45
- package/dist/index.css +1 -1
- package/dist/package.json +1 -1
- package/dist/shared.js +1 -1
- package/package.json +1 -1
package/dist/elements.es.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { C as e, I as t, L as n, N as r, P as i, R as a, S as o, a as s, c, i as l, l as u, m as d, n as f, p, q as m, r as h, s as g, t as _, v, x as ee, y, z as b } from "./shared.js";
|
|
2
2
|
//#region libs/checkout/src/assets/styles/helperText.css?inline
|
|
3
|
-
var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inherit);max-height:100px;margin-top:4px;font-size:12px;font-weight:500;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out;display:block;overflow:hidden}.form-helper-text-hidden{opacity:0;max-height:0;margin-top:0;overflow:hidden}", S = ".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{color
|
|
3
|
+
var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inherit);max-height:100px;margin-top:4px;font-size:12px;font-weight:500;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out;display:block;overflow:hidden}.form-helper-text-hidden{opacity:0;max-height:0;margin-top:0;overflow:hidden}", S = ".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}", C = ".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)}", w = ":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}", T = class {
|
|
4
4
|
shadowRoot = null;
|
|
5
5
|
host = null;
|
|
6
6
|
options = {};
|
|
7
|
+
_appliedTheme = {};
|
|
7
8
|
listeners = /* @__PURE__ */ new Map();
|
|
8
9
|
get isMounted() {
|
|
9
10
|
return this.host !== null;
|
|
@@ -14,7 +15,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
14
15
|
if (!t) throw Error(`[BaseElement] mount target not found: ${String(e)}`);
|
|
15
16
|
this.host = document.createElement("div"), this.shadowRoot = this.host.attachShadow({ mode: "open" });
|
|
16
17
|
let n = document.createElement("style");
|
|
17
|
-
n.textContent = this.getCss(), this.shadowRoot.appendChild(n), t.appendChild(this.host), this.render(), this.emit("ready");
|
|
18
|
+
n.textContent = this.getCss(), this.shadowRoot.appendChild(n), t.appendChild(this.host), this.reapplyTheme(), this.render(), this.emit("ready");
|
|
18
19
|
}
|
|
19
20
|
unmount() {
|
|
20
21
|
this.host?.parentElement?.removeChild(this.host), this.host = null, this.shadowRoot = null;
|
|
@@ -36,11 +37,18 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
setTheme(e) {
|
|
39
|
-
if (this.
|
|
40
|
+
if (this._appliedTheme = {
|
|
41
|
+
...this._appliedTheme,
|
|
42
|
+
...e
|
|
43
|
+
}, this.host) for (let [t, n] of Object.entries(e)) this.host.style.setProperty(t, n);
|
|
40
44
|
}
|
|
41
45
|
resetTheme(e) {
|
|
46
|
+
for (let t of Object.keys(e)) delete this._appliedTheme[t];
|
|
42
47
|
if (this.host) for (let t of Object.keys(e)) this.host.style.removeProperty(t);
|
|
43
48
|
}
|
|
49
|
+
reapplyTheme() {
|
|
50
|
+
if (this.host) for (let [e, t] of Object.entries(this._appliedTheme)) this.host.style.setProperty(e, t);
|
|
51
|
+
}
|
|
44
52
|
get value() {
|
|
45
53
|
return this.getValue();
|
|
46
54
|
}
|
|
@@ -74,7 +82,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
74
82
|
value: this._value,
|
|
75
83
|
autocomplete: "address-level2",
|
|
76
84
|
onChange: (e) => {
|
|
77
|
-
this._value = e.target.value, this._error = null, this.emit("change", this._value);
|
|
85
|
+
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
78
86
|
}
|
|
79
87
|
}), this._input.addEventListener("blur", () => {
|
|
80
88
|
let { t: e } = o();
|
|
@@ -86,7 +94,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
86
94
|
S,
|
|
87
95
|
C,
|
|
88
96
|
x
|
|
89
|
-
].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
|
|
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 ";
|
|
90
98
|
}
|
|
91
99
|
getValue() {
|
|
92
100
|
return this._value;
|
|
@@ -97,7 +105,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
97
105
|
getError() {
|
|
98
106
|
return this._error;
|
|
99
107
|
}
|
|
100
|
-
}, D = ".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{color
|
|
108
|
+
}, D = ".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}", O = class extends T {
|
|
101
109
|
_value = "";
|
|
102
110
|
_error = null;
|
|
103
111
|
_select = null;
|
|
@@ -107,7 +115,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
107
115
|
}
|
|
108
116
|
render() {
|
|
109
117
|
if (!this.shadowRoot) return;
|
|
110
|
-
this._select?.getElement().remove(), this.options.initialValue && !this._value && (this._value = String(this.options.initialValue));
|
|
118
|
+
this._select?.getElement().remove(), this.options.initialValue && !this._value && (this._value = String(this.options.initialValue), this.emit("change", this._value));
|
|
111
119
|
let { t: e, locale: t } = o();
|
|
112
120
|
this._select = new c({
|
|
113
121
|
name: "billingAddress.country",
|
|
@@ -157,7 +165,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
157
165
|
value: this._value,
|
|
158
166
|
autocomplete: "given-name",
|
|
159
167
|
onChange: (e) => {
|
|
160
|
-
this._value = e.target.value, this._error = null, this.emit("change", this._value);
|
|
168
|
+
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
161
169
|
}
|
|
162
170
|
}), this._input.addEventListener("blur", () => {
|
|
163
171
|
let { t: e } = o();
|
|
@@ -169,7 +177,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
169
177
|
S,
|
|
170
178
|
C,
|
|
171
179
|
x
|
|
172
|
-
].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
|
|
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 ";
|
|
173
181
|
}
|
|
174
182
|
getValue() {
|
|
175
183
|
return this._value;
|
|
@@ -196,7 +204,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
196
204
|
value: this._value,
|
|
197
205
|
autocomplete: "family-name",
|
|
198
206
|
onChange: (e) => {
|
|
199
|
-
this._value = e.target.value, this._error = null, this.emit("change", this._value);
|
|
207
|
+
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
200
208
|
}
|
|
201
209
|
}), this._input.addEventListener("blur", () => {
|
|
202
210
|
let { t: e } = o();
|
|
@@ -208,7 +216,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
208
216
|
S,
|
|
209
217
|
C,
|
|
210
218
|
x
|
|
211
|
-
].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
|
|
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 ";
|
|
212
220
|
}
|
|
213
221
|
getValue() {
|
|
214
222
|
return this._value;
|
|
@@ -280,7 +288,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
280
288
|
C,
|
|
281
289
|
x,
|
|
282
290
|
D
|
|
283
|
-
].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: 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
|
|
291
|
+
].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 ";
|
|
284
292
|
}
|
|
285
293
|
getValue() {
|
|
286
294
|
return this._value;
|
|
@@ -324,7 +332,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
324
332
|
S,
|
|
325
333
|
C,
|
|
326
334
|
x
|
|
327
|
-
].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
|
|
335
|
+
].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 ";
|
|
328
336
|
}
|
|
329
337
|
getValue() {
|
|
330
338
|
return this._value;
|
|
@@ -351,7 +359,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
351
359
|
value: this._value,
|
|
352
360
|
autocomplete: "postal-code",
|
|
353
361
|
onChange: (e) => {
|
|
354
|
-
this._value = e.target.value, this._error = null, this.emit("change", this._value);
|
|
362
|
+
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
355
363
|
}
|
|
356
364
|
}), this._input.addEventListener("blur", () => {
|
|
357
365
|
let { t: e } = o();
|
|
@@ -363,7 +371,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
363
371
|
S,
|
|
364
372
|
C,
|
|
365
373
|
x
|
|
366
|
-
].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
|
|
374
|
+
].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 ";
|
|
367
375
|
}
|
|
368
376
|
getValue() {
|
|
369
377
|
return this._value;
|
|
@@ -577,6 +585,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
577
585
|
_currentTheme = {};
|
|
578
586
|
_environment = "test";
|
|
579
587
|
_section = null;
|
|
588
|
+
_initGeneration = 0;
|
|
580
589
|
constructor(e, n) {
|
|
581
590
|
this._vgsJwt = e, this._environment = n, this._vgsService = new t();
|
|
582
591
|
}
|
|
@@ -602,8 +611,9 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
602
611
|
}
|
|
603
612
|
_onChangeEmit = null;
|
|
604
613
|
initVgs() {
|
|
605
|
-
|
|
606
|
-
|
|
614
|
+
let e = ++this._initGeneration;
|
|
615
|
+
this._vgsService.init(this._environment).then((t) => {
|
|
616
|
+
e === this._initGeneration && (this._vgsService.createForm(t, (e) => this._handleStateChange(e)), this._mountFields(e));
|
|
607
617
|
});
|
|
608
618
|
}
|
|
609
619
|
async getPayload() {
|
|
@@ -638,6 +648,12 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
638
648
|
let t = this._buildProfileFromTheme(this._currentTheme), n = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
|
|
639
649
|
this._section.updateVgsWrapperStyles(n, t.styles.borderRadius), this._reinitWithTheme();
|
|
640
650
|
}
|
|
651
|
+
resetTheme(e) {
|
|
652
|
+
for (let t of e) delete this._currentTheme[t];
|
|
653
|
+
if (!this._section) return;
|
|
654
|
+
let t = this._buildProfileFromTheme(this._currentTheme), n = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
|
|
655
|
+
this._section.updateVgsWrapperStyles(n, t.styles.borderRadius), this._reinitWithTheme();
|
|
656
|
+
}
|
|
641
657
|
destroy() {
|
|
642
658
|
this._vgsReinitTimer &&= (clearTimeout(this._vgsReinitTimer), null), this._vgsService.destroy(), this._section = null;
|
|
643
659
|
}
|
|
@@ -659,32 +675,34 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
659
675
|
}
|
|
660
676
|
};
|
|
661
677
|
}
|
|
662
|
-
async _mountFields() {
|
|
678
|
+
async _mountFields(e) {
|
|
663
679
|
if (!this._section) return;
|
|
664
|
-
let
|
|
665
|
-
this._section.updateVgsWrapperStyles(
|
|
666
|
-
let
|
|
667
|
-
for (let e of Object.values(
|
|
680
|
+
let t = Object.keys(this._currentTheme).length > 0 ? this._buildProfileFromTheme(this._currentTheme) : V, n = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
|
|
681
|
+
this._section.updateVgsWrapperStyles(n, t.styles.borderRadius);
|
|
682
|
+
let r = this._section.getVgsContainerIds();
|
|
683
|
+
for (let e of Object.values(r)) {
|
|
668
684
|
if (!e) continue;
|
|
669
685
|
let t = document.getElementById(e);
|
|
670
686
|
t && t.querySelectorAll("iframe").forEach((e) => e.remove());
|
|
671
687
|
}
|
|
672
|
-
let
|
|
673
|
-
|
|
688
|
+
let i = await y(t.styles.fontFamily);
|
|
689
|
+
if (e !== this._initGeneration) return;
|
|
690
|
+
let a = this._section.buildVgsFieldCss(t, i, {
|
|
691
|
+
borderColor: n,
|
|
674
692
|
backgroundColor: this._currentTheme["--odus-color-background"],
|
|
675
693
|
placeholderColor: this._currentTheme["--odus-input-placeholder-color"],
|
|
676
694
|
placeholderOpacity: this._currentTheme["--odus-input-placeholder-opacity"],
|
|
677
695
|
padding: this._currentTheme["--odus-input-padding"]
|
|
678
|
-
}), { t:
|
|
696
|
+
}), { t: s } = o();
|
|
679
697
|
this._vgsService.mountCardFields({
|
|
680
|
-
cardNumber:
|
|
681
|
-
cardExpiry:
|
|
682
|
-
cardCvv:
|
|
683
|
-
},
|
|
698
|
+
cardNumber: r.cardNumber ? `#${r.cardNumber}` : void 0,
|
|
699
|
+
cardExpiry: r.cardExpiry ? `#${r.cardExpiry}` : void 0,
|
|
700
|
+
cardCvv: r.cardCvv ? `#${r.cardCvv}` : void 0
|
|
701
|
+
}, a, {
|
|
684
702
|
cardNumber: "1234 5678 9012 3456",
|
|
685
|
-
cardExpiry:
|
|
703
|
+
cardExpiry: s("cardExpiry"),
|
|
686
704
|
cardCvv: "CVV",
|
|
687
|
-
cardholderName:
|
|
705
|
+
cardholderName: s("cardholderName")
|
|
688
706
|
}, (e) => {
|
|
689
707
|
this._section?.updateVgsCardBrand(e);
|
|
690
708
|
}), this._vgsService.waitForFieldsReady().then(() => {
|
|
@@ -729,7 +747,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
729
747
|
if (this._mountContainer = e, this._isVgsMode) {
|
|
730
748
|
this.host = document.createElement("div");
|
|
731
749
|
let e = document.createElement("style");
|
|
732
|
-
e.textContent = this.getCss(), this.host.appendChild(e), t.appendChild(this.host), this.render(), this._vgsAdapter?.initVgs(), this.emit("ready");
|
|
750
|
+
e.textContent = this.getCss(), this.host.appendChild(e), t.appendChild(this.host), this.reapplyTheme(), Object.keys(this._appliedTheme).length > 0 && this._vgsAdapter?.applyTheme(this._appliedTheme), this.render(), this._vgsAdapter?.initVgs(), this.emit("ready");
|
|
733
751
|
} else super.mount(e);
|
|
734
752
|
}
|
|
735
753
|
unmount() {
|
|
@@ -756,13 +774,16 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
756
774
|
setTheme(e) {
|
|
757
775
|
super.setTheme(e), !(!this._isVgsMode || !this._vgsAdapter) && this._vgsAdapter.applyTheme(e);
|
|
758
776
|
}
|
|
777
|
+
resetTheme(e) {
|
|
778
|
+
super.resetTheme(e), !(!this._isVgsMode || !this._vgsAdapter) && this._vgsAdapter.resetTheme(Object.keys(e));
|
|
779
|
+
}
|
|
759
780
|
getCss() {
|
|
760
781
|
return super.getCss() + [
|
|
761
782
|
S,
|
|
762
783
|
C,
|
|
763
784
|
x,
|
|
764
785
|
R
|
|
765
|
-
].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
|
|
786
|
+
].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 ";
|
|
766
787
|
}
|
|
767
788
|
getValue() {
|
|
768
789
|
return this._isVgsMode ? {
|
|
@@ -801,7 +822,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
801
822
|
autocomplete: "cc-name",
|
|
802
823
|
onChange: (e) => {
|
|
803
824
|
let t = e.target.value, n = t.replace(/[^a-zA-Z\s\-'.]/g, "");
|
|
804
|
-
t !== n && this._input?.setValue(n), this._value = n, this._error = null, this.emit("change", this._value);
|
|
825
|
+
t !== n && this._input?.setValue(n), this._value = n, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
805
826
|
}
|
|
806
827
|
}), this._input.addEventListener("blur", () => {
|
|
807
828
|
let { t: e } = o();
|
|
@@ -813,7 +834,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
813
834
|
S,
|
|
814
835
|
C,
|
|
815
836
|
x
|
|
816
|
-
].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
|
|
837
|
+
].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 ";
|
|
817
838
|
}
|
|
818
839
|
getValue() {
|
|
819
840
|
return this._value;
|
|
@@ -863,7 +884,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
863
884
|
translationFunc: e,
|
|
864
885
|
onChange: (e) => {
|
|
865
886
|
let t = e.target;
|
|
866
|
-
this._email = t.value ?? this._field?.getValue() ?? "", this._error = null, this.emit("change", this._email);
|
|
887
|
+
this._email = t.value ?? this._field?.getValue() ?? "", this._error = null, this._field?.setError(!1), this.emit("change", this._email);
|
|
867
888
|
},
|
|
868
889
|
onBlur: () => {
|
|
869
890
|
let e = r();
|
|
@@ -876,7 +897,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
876
897
|
S,
|
|
877
898
|
C,
|
|
878
899
|
x
|
|
879
|
-
].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
|
|
900
|
+
].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 ";
|
|
880
901
|
}
|
|
881
902
|
getValue() {
|
|
882
903
|
return this._email;
|
|
@@ -1015,7 +1036,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1015
1036
|
translationFunc: n,
|
|
1016
1037
|
locale: i,
|
|
1017
1038
|
onChange: () => {
|
|
1018
|
-
this._phone = this._field?.getValue() ?? "", this._error = null, this.emit("change", this._phone);
|
|
1039
|
+
this._phone = this._field?.getValue() ?? "", this._error = null, this._field?.setError(!1), this.emit("change", this._phone);
|
|
1019
1040
|
},
|
|
1020
1041
|
onBlur: () => {
|
|
1021
1042
|
this._phone = this._field?.getValue() ?? "";
|
|
@@ -1031,7 +1052,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1031
1052
|
C,
|
|
1032
1053
|
x,
|
|
1033
1054
|
te
|
|
1034
|
-
].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
|
|
1055
|
+
].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 ";
|
|
1035
1056
|
}
|
|
1036
1057
|
getValue() {
|
|
1037
1058
|
return this._phone;
|
|
@@ -1111,7 +1132,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1111
1132
|
get: () => (this._addressCity || (this._addressCity = new E(), this._trackElement(this._addressCity)), this._addressCity),
|
|
1112
1133
|
enumerable: !0
|
|
1113
1134
|
}), Object.defineProperty(a, "state", {
|
|
1114
|
-
get: () => (this._addressState || (this._addressState = new M(), this._trackElement(this._addressState)), this._addressState),
|
|
1135
|
+
get: () => (this._addressState || (this._addressState = new M(), this._trackElement(this._addressState), this._addressCountry?.value && this._addressState.setCountry(this._addressCountry.value)), this._addressState),
|
|
1115
1136
|
enumerable: !0
|
|
1116
1137
|
}), Object.defineProperty(a, "zipCode", {
|
|
1117
1138
|
get: () => (this._addressZipCode || (this._addressZipCode = new P(), this._trackElement(this._addressZipCode)), this._addressZipCode),
|
|
@@ -1176,7 +1197,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1176
1197
|
};
|
|
1177
1198
|
}
|
|
1178
1199
|
async _getPayload() {
|
|
1179
|
-
if (this._applePay?.isMounted && this._applePay.isValid
|
|
1200
|
+
if (this._applePay?.isMounted && this._applePay.isValid) return null;
|
|
1180
1201
|
let e = this._email?.isMounted ? this._email.value : "", t = this._phone?.isMounted ? this._phone.value : void 0, n = this._addressStreet?.isMounted || this._addressCity?.isMounted || this._addressCountry?.isMounted || this._addressFirstName?.isMounted || this._addressLastName?.isMounted || this._cardholderName?.isMounted || this._addressState?.isMounted || this._addressZipCode?.isMounted ? {
|
|
1181
1202
|
street: this._addressStreet?.isMounted ? this._addressStreet.value : "",
|
|
1182
1203
|
city: this._addressCity?.isMounted ? this._addressCity.value : "",
|
|
@@ -1225,10 +1246,6 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1225
1246
|
});
|
|
1226
1247
|
return;
|
|
1227
1248
|
}
|
|
1228
|
-
if (this._paypal?.isMounted) {
|
|
1229
|
-
await this._executeAuthorization({ formData: null });
|
|
1230
|
-
return;
|
|
1231
|
-
}
|
|
1232
1249
|
let t = await this._getPayload();
|
|
1233
1250
|
await this._executeAuthorization({
|
|
1234
1251
|
formData: t,
|
package/dist/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.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{color:#dc2727}.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}.form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inherit);max-height:100px;margin-top:4px;font-size:12px;font-weight:500;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out;display:block;overflow:hidden}.form-helper-text-hidden{opacity:0;max-height:0;margin-top:0;overflow:hidden}.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)}.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{color:#dc2727}.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}.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}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)}.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}@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}.form-container{text-align:left;flex-direction:column;gap:16px;max-width:100%;min-height:340px;padding:4px;display:flex;position:relative}.form-container>*{font-family:inherit}.card-details{display:flex}.card-details>*{flex:1;min-width:0}.error-messages-container>*{display:none}.error-messages-container>:first-child{display:block}.address-section{flex-direction:column;gap:6px;display:flex}.address-section-title{margin:0;padding:0;font-size:14px;font-weight:600}.address-same-as-billing{cursor:pointer;align-items:center;gap:4px;display:flex}.address-same-as-billing input[type=checkbox]{opacity:0;pointer-events:none;width:0;height:0;position:absolute}.address-same-as-billing .checkbox-icon{cursor:pointer;flex-shrink:0;width:24px;height:24px}.address-same-as-billing .checkbox-icon .checkbox-checked{display:none}.address-same-as-billing .checkbox-icon .checkbox-unchecked,.address-same-as-billing input[type=checkbox]:checked+.checkbox-icon .checkbox-checked{display:block}.address-same-as-billing input[type=checkbox]:checked+.checkbox-icon .checkbox-unchecked{display:none}.address-same-as-billing label{cursor:pointer;font-size:14px}.address-fields{flex-direction:column;gap:0;transition:opacity .2s;display:flex}.address-fields--ungrouped{gap:16px}.address-row{gap:0;display:flex}.address-row-single{width:100%}.address-row-single>*{flex:1}.address-row-double{width:100%}.address-row-double>*{flex:1;min-width:0}.payment-methods{flex-direction:column;gap:12px;display:flex}.skeleton-container{text-align:left;flex-direction:column;gap:12px;width:100%;max-width:100%;height:49px;padding:4px;display:flex;position:relative;inset:0}.skeleton{background:linear-gradient(90deg,#f7f7f7 25%,#fdfdfd 50%,#f7f7f7 75%) 0 0/200% 100%;border-radius:8px;animation:1.5s ease-in-out infinite shimmer;position:relative;overflow:hidden}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.skeleton-field{flex-direction:column;gap:8px;display:flex}.skeleton-label{border-radius:4px;width:80px;height:16px}.skeleton-input,.skeleton-payment-method{border-radius:8px;width:100%;height:35px}.skeleton-card-row{gap:12px;display:flex}.skeleton-card-row .skeleton-field{flex:1}.skeleton-submit-button{border-radius:8px;width:100%;height:35px}.skeleton-separator-text{border-radius:4px;width:100px;height:14px}.payment-separator_container{justify-content:space-between;align-items:center;gap:16px;width:100%;display:flex}.payment-separator{justify-content:space-between;align-items:center;width:100%;margin:0 0 -8px;display:flex}.payment-separator__line{background:#9f9f9f;flex-grow:1;height:1.3px}.payment-separator__text{color:#0d0d0d;margin:0;padding:0 16px;font-size:14px;font-weight:400}.button{text-align:center;cursor:pointer;white-space:nowrap;border:none;outline:none;justify-content:center;align-items:center;width:100%;height:min-content;padding:8px 16px;font-size:14px;font-weight:700;line-height:1.5;transition:all .2s;display:inline-flex;position:relative}.disabled{pointer-events:none}.valid{outline:none;transition:all .3s;overflow:hidden}.valid:before{content:"";background:linear-gradient(90deg,#0000,#fff6,#0000);width:100%;height:100%;transition:left .5s;animation:6s infinite glowSlide;position:absolute;top:0;left:-100%}@keyframes glowSlide{0%{left:-100%}50%{left:100%}to{left:100%}}.valid:after{content:"";background:linear-gradient(90deg,#0000 0%,#ffffff1a 25%,#ffffff4d 50%,#ffffff1a 75%,#0000 100%);width:100%;height:100%;animation:7s infinite smoothGlow;position:absolute;top:0;left:0;transform:translate(-100%)}@keyframes smoothGlow{0%{transform:translate(-100%)}to{transform:translate(100%)}}.blur-bg{-webkit-backdrop-filter:blur(3.5px);backdrop-filter:blur(3.5px);z-index:9999;background:0 0;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;inset:0}.loader{background:conic-gradient(from 270deg,#134e4a 0deg,#0f766e 90deg,#0d9488 180deg,#5eaba3 240deg,#0d948833 300deg,#0000 330deg);border-radius:50%;width:64px;height:64px;animation:1s linear infinite spin;position:relative}.loader:before{content:"";background:#fff;border-radius:50%;position:absolute;inset:6px}@keyframes spin{to{transform:rotate(360deg)}}.title{color:#4f4f4f;margin-top:20px;font-size:18px;animation:1s ease-in-out fadeIn}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.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}
|
|
1
|
+
.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}.form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inherit);max-height:100px;margin-top:4px;font-size:12px;font-weight:500;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out;display:block;overflow:hidden}.form-helper-text-hidden{opacity:0;max-height:0;margin-top:0;overflow:hidden}.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)}.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}.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}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)}.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}@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}.form-container{text-align:left;flex-direction:column;gap:16px;max-width:100%;min-height:340px;padding:4px;display:flex;position:relative}.form-container>*{font-family:inherit}.card-details{display:flex}.card-details>*{flex:1;min-width:0}.error-messages-container>*{display:none}.error-messages-container>:first-child{display:block}.address-section{flex-direction:column;gap:6px;display:flex}.address-section-title{margin:0;padding:0;font-size:14px;font-weight:600}.address-same-as-billing{cursor:pointer;align-items:center;gap:4px;display:flex}.address-same-as-billing input[type=checkbox]{opacity:0;pointer-events:none;width:0;height:0;position:absolute}.address-same-as-billing .checkbox-icon{cursor:pointer;flex-shrink:0;width:24px;height:24px}.address-same-as-billing .checkbox-icon .checkbox-checked{display:none}.address-same-as-billing .checkbox-icon .checkbox-unchecked,.address-same-as-billing input[type=checkbox]:checked+.checkbox-icon .checkbox-checked{display:block}.address-same-as-billing input[type=checkbox]:checked+.checkbox-icon .checkbox-unchecked{display:none}.address-same-as-billing label{cursor:pointer;font-size:14px}.address-fields{flex-direction:column;gap:0;transition:opacity .2s;display:flex}.address-fields--ungrouped{gap:16px}.address-row{gap:0;display:flex}.address-row-single{width:100%}.address-row-single>*{flex:1}.address-row-double{width:100%}.address-row-double>*{flex:1;min-width:0}.payment-methods{flex-direction:column;gap:12px;display:flex}.skeleton-container{text-align:left;flex-direction:column;gap:12px;width:100%;max-width:100%;height:49px;padding:4px;display:flex;position:relative;inset:0}.skeleton{background:linear-gradient(90deg,#f7f7f7 25%,#fdfdfd 50%,#f7f7f7 75%) 0 0/200% 100%;border-radius:8px;animation:1.5s ease-in-out infinite shimmer;position:relative;overflow:hidden}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.skeleton-field{flex-direction:column;gap:8px;display:flex}.skeleton-label{border-radius:4px;width:80px;height:16px}.skeleton-input,.skeleton-payment-method{border-radius:8px;width:100%;height:35px}.skeleton-card-row{gap:12px;display:flex}.skeleton-card-row .skeleton-field{flex:1}.skeleton-submit-button{border-radius:8px;width:100%;height:35px}.skeleton-separator-text{border-radius:4px;width:100px;height:14px}.payment-separator_container{justify-content:space-between;align-items:center;gap:16px;width:100%;display:flex}.payment-separator{justify-content:space-between;align-items:center;width:100%;margin:0 0 -8px;display:flex}.payment-separator__line{background:#9f9f9f;flex-grow:1;height:1.3px}.payment-separator__text{color:#0d0d0d;margin:0;padding:0 16px;font-size:14px;font-weight:400}.button{text-align:center;cursor:pointer;white-space:nowrap;border:none;outline:none;justify-content:center;align-items:center;width:100%;height:min-content;padding:8px 16px;font-size:14px;font-weight:700;line-height:1.5;transition:all .2s;display:inline-flex;position:relative}.disabled{pointer-events:none}.valid{outline:none;transition:all .3s;overflow:hidden}.valid:before{content:"";background:linear-gradient(90deg,#0000,#fff6,#0000);width:100%;height:100%;transition:left .5s;animation:6s infinite glowSlide;position:absolute;top:0;left:-100%}@keyframes glowSlide{0%{left:-100%}50%{left:100%}to{left:100%}}.valid:after{content:"";background:linear-gradient(90deg,#0000 0%,#ffffff1a 25%,#ffffff4d 50%,#ffffff1a 75%,#0000 100%);width:100%;height:100%;animation:7s infinite smoothGlow;position:absolute;top:0;left:0;transform:translate(-100%)}@keyframes smoothGlow{0%{transform:translate(-100%)}to{transform:translate(100%)}}.blur-bg{-webkit-backdrop-filter:blur(3.5px);backdrop-filter:blur(3.5px);z-index:9999;background:0 0;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;inset:0}.loader{background:conic-gradient(from 270deg,#134e4a 0deg,#0f766e 90deg,#0d9488 180deg,#5eaba3 240deg,#0d948833 300deg,#0000 330deg);border-radius:50%;width:64px;height:64px;animation:1s linear infinite spin;position:relative}.loader:before{content:"";background:#fff;border-radius:50%;position:absolute;inset:6px}@keyframes spin{to{transform:rotate(360deg)}}.title{color:#4f4f4f;margin-top:20px;font-size:18px;animation:1s ease-in-out fadeIn}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.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}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/package.json
CHANGED
package/dist/shared.js
CHANGED
|
@@ -328,7 +328,7 @@ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
328
328
|
url: ve(e.environment),
|
|
329
329
|
app: {
|
|
330
330
|
name: "odus-checkout",
|
|
331
|
-
version: "1.5.
|
|
331
|
+
version: "1.5.1",
|
|
332
332
|
environment: e.environment === "test" ? "sandbox" : "production"
|
|
333
333
|
},
|
|
334
334
|
isolate: !0,
|