@odus/checkout 1.5.0 → 1.5.2

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.
@@ -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:#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}", 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 {
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.host) for (let [t, n] of Object.entries(e)) this.host.style.setProperty(t, n);
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 color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\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:#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}", O = class extends T {
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 color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\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 color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\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;
@@ -230,10 +238,10 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
230
238
  let n = j.has(t), r = j.has(e);
231
239
  if (n && r && t !== e) {
232
240
  let { t } = o(), n = e, r = t(n === "US" ? "address.chooseState" : "address.chooseProvince");
233
- this._select?.setOptions(p(n), r), this._value = "";
241
+ this._select?.setOptions(p(n), r), this._value = "", this.emit("change", this._value);
234
242
  return;
235
243
  }
236
- n !== r && (this._value = "", this.render());
244
+ n !== r && (this._value = "", this.render(), this.emit("change", this._value));
237
245
  }
238
246
  render() {
239
247
  if (this.shadowRoot) if (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null, j.has(this._country)) {
@@ -251,10 +259,11 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
251
259
  value: this._value,
252
260
  autocomplete: "address-level1",
253
261
  onChange: (e) => {
254
- this._value = e.target.value, this.emit("change", this._value);
262
+ this._value = e.target.value, this._input?.setError(!1), this.emit("change", this._value);
255
263
  }
256
264
  }), this._input.addEventListener("blur", () => {
257
- this.emit("blur", this._value);
265
+ let e = this.getIsValid();
266
+ this._input?.setError(!e, this.getError() ?? void 0), this.emit("blur", this._value);
258
267
  }), this.shadowRoot.appendChild(this._input.getElement());
259
268
  }
260
269
  _renderSelect(e) {
@@ -268,10 +277,11 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
268
277
  options: n,
269
278
  autocomplete: "address-level1",
270
279
  onChange: (e) => {
271
- this._value = e.target.value, this.emit("change", this._value);
280
+ this._value = e.target.value, this._select?.setError(!1), this.emit("change", this._value);
272
281
  }
273
282
  }), this._select.addEventListener("blur", () => {
274
- this.emit("blur", this._value);
283
+ let e = this.getIsValid();
284
+ this._select?.setError(!e, this.getError() ?? void 0), this.emit("blur", this._value);
275
285
  }), this.shadowRoot.appendChild(this._select.getElement());
276
286
  }
277
287
  getCss() {
@@ -280,16 +290,18 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
280
290
  C,
281
291
  x,
282
292
  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 color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
293
+ ].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
294
  }
285
295
  getValue() {
286
296
  return this._value;
287
297
  }
288
298
  getIsValid() {
289
- return !0;
299
+ return this._select ? this._value.trim().length > 0 : !0;
290
300
  }
291
301
  getError() {
292
- return null;
302
+ if (this.getIsValid()) return null;
303
+ let { t: e } = o();
304
+ return e("validation.stateRequired");
293
305
  }
294
306
  }, N = class extends T {
295
307
  _value = "";
@@ -324,7 +336,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
324
336
  S,
325
337
  C,
326
338
  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 color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
339
+ ].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
340
  }
329
341
  getValue() {
330
342
  return this._value;
@@ -351,7 +363,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
351
363
  value: this._value,
352
364
  autocomplete: "postal-code",
353
365
  onChange: (e) => {
354
- this._value = e.target.value, this._error = null, this.emit("change", this._value);
366
+ this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
355
367
  }
356
368
  }), this._input.addEventListener("blur", () => {
357
369
  let { t: e } = o();
@@ -363,7 +375,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
363
375
  S,
364
376
  C,
365
377
  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 color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
378
+ ].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
379
  }
368
380
  getValue() {
369
381
  return this._value;
@@ -577,6 +589,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
577
589
  _currentTheme = {};
578
590
  _environment = "test";
579
591
  _section = null;
592
+ _initGeneration = 0;
580
593
  constructor(e, n) {
581
594
  this._vgsJwt = e, this._environment = n, this._vgsService = new t();
582
595
  }
@@ -602,8 +615,9 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
602
615
  }
603
616
  _onChangeEmit = null;
604
617
  initVgs() {
605
- this._vgsService.init(this._environment).then((e) => {
606
- this._vgsService.createForm(e, (e) => this._handleStateChange(e)), this._mountFields();
618
+ let e = ++this._initGeneration;
619
+ this._vgsService.init(this._environment).then((t) => {
620
+ e === this._initGeneration && (this._vgsService.createForm(t, (e) => this._handleStateChange(e)), this._mountFields(e));
607
621
  });
608
622
  }
609
623
  async getPayload() {
@@ -638,12 +652,18 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
638
652
  let t = this._buildProfileFromTheme(this._currentTheme), n = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
639
653
  this._section.updateVgsWrapperStyles(n, t.styles.borderRadius), this._reinitWithTheme();
640
654
  }
655
+ resetTheme(e) {
656
+ for (let t of e) delete this._currentTheme[t];
657
+ if (!this._section) return;
658
+ let t = this._buildProfileFromTheme(this._currentTheme), n = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
659
+ this._section.updateVgsWrapperStyles(n, t.styles.borderRadius), this._reinitWithTheme();
660
+ }
641
661
  destroy() {
642
662
  this._vgsReinitTimer &&= (clearTimeout(this._vgsReinitTimer), null), this._vgsService.destroy(), this._section = null;
643
663
  }
644
664
  _reinitWithTheme() {
645
665
  this._vgsReinitTimer && clearTimeout(this._vgsReinitTimer), this._vgsReinitTimer = setTimeout(() => {
646
- this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new t(), this.initVgs();
666
+ this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new t(), this._section?.setVgsService(this._vgsService), this.initVgs();
647
667
  }, 300);
648
668
  }
649
669
  _buildProfileFromTheme(e) {
@@ -659,32 +679,34 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
659
679
  }
660
680
  };
661
681
  }
662
- async _mountFields() {
682
+ async _mountFields(e) {
663
683
  if (!this._section) return;
664
- let e = Object.keys(this._currentTheme).length > 0 ? this._buildProfileFromTheme(this._currentTheme) : V, t = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
665
- this._section.updateVgsWrapperStyles(t, e.styles.borderRadius);
666
- let n = this._section.getVgsContainerIds();
667
- for (let e of Object.values(n)) {
684
+ let t = Object.keys(this._currentTheme).length > 0 ? this._buildProfileFromTheme(this._currentTheme) : V, n = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
685
+ this._section.updateVgsWrapperStyles(n, t.styles.borderRadius);
686
+ let r = this._section.getVgsContainerIds();
687
+ for (let e of Object.values(r)) {
668
688
  if (!e) continue;
669
689
  let t = document.getElementById(e);
670
690
  t && t.querySelectorAll("iframe").forEach((e) => e.remove());
671
691
  }
672
- let r = await y(e.styles.fontFamily), i = this._section.buildVgsFieldCss(e, r, {
673
- borderColor: t,
692
+ let i = await y(t.styles.fontFamily);
693
+ if (e !== this._initGeneration) return;
694
+ let a = this._section.buildVgsFieldCss(t, i, {
695
+ borderColor: n,
674
696
  backgroundColor: this._currentTheme["--odus-color-background"],
675
697
  placeholderColor: this._currentTheme["--odus-input-placeholder-color"],
676
698
  placeholderOpacity: this._currentTheme["--odus-input-placeholder-opacity"],
677
699
  padding: this._currentTheme["--odus-input-padding"]
678
- }), { t: a } = o();
700
+ }), { t: s } = o();
679
701
  this._vgsService.mountCardFields({
680
- cardNumber: n.cardNumber ? `#${n.cardNumber}` : void 0,
681
- cardExpiry: n.cardExpiry ? `#${n.cardExpiry}` : void 0,
682
- cardCvv: n.cardCvv ? `#${n.cardCvv}` : void 0
683
- }, i, {
702
+ cardNumber: r.cardNumber ? `#${r.cardNumber}` : void 0,
703
+ cardExpiry: r.cardExpiry ? `#${r.cardExpiry}` : void 0,
704
+ cardCvv: r.cardCvv ? `#${r.cardCvv}` : void 0
705
+ }, a, {
684
706
  cardNumber: "1234 5678 9012 3456",
685
- cardExpiry: a("cardExpiry"),
707
+ cardExpiry: s("cardExpiry"),
686
708
  cardCvv: "CVV",
687
- cardholderName: a("cardholderName")
709
+ cardholderName: s("cardholderName")
688
710
  }, (e) => {
689
711
  this._section?.updateVgsCardBrand(e);
690
712
  }), this._vgsService.waitForFieldsReady().then(() => {
@@ -729,7 +751,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
729
751
  if (this._mountContainer = e, this._isVgsMode) {
730
752
  this.host = document.createElement("div");
731
753
  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");
754
+ 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
755
  } else super.mount(e);
734
756
  }
735
757
  unmount() {
@@ -756,13 +778,16 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
756
778
  setTheme(e) {
757
779
  super.setTheme(e), !(!this._isVgsMode || !this._vgsAdapter) && this._vgsAdapter.applyTheme(e);
758
780
  }
781
+ resetTheme(e) {
782
+ super.resetTheme(e), !(!this._isVgsMode || !this._vgsAdapter) && this._vgsAdapter.resetTheme(Object.keys(e));
783
+ }
759
784
  getCss() {
760
785
  return super.getCss() + [
761
786
  S,
762
787
  C,
763
788
  x,
764
789
  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 color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
790
+ ].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
791
  }
767
792
  getValue() {
768
793
  return this._isVgsMode ? {
@@ -801,7 +826,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
801
826
  autocomplete: "cc-name",
802
827
  onChange: (e) => {
803
828
  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);
829
+ t !== n && this._input?.setValue(n), this._value = n, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
805
830
  }
806
831
  }), this._input.addEventListener("blur", () => {
807
832
  let { t: e } = o();
@@ -813,7 +838,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
813
838
  S,
814
839
  C,
815
840
  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 color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
841
+ ].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
842
  }
818
843
  getValue() {
819
844
  return this._value;
@@ -863,7 +888,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
863
888
  translationFunc: e,
864
889
  onChange: (e) => {
865
890
  let t = e.target;
866
- this._email = t.value ?? this._field?.getValue() ?? "", this._error = null, this.emit("change", this._email);
891
+ this._email = t.value ?? this._field?.getValue() ?? "", this._error = null, this._field?.setError(!1), this.emit("change", this._email);
867
892
  },
868
893
  onBlur: () => {
869
894
  let e = r();
@@ -876,7 +901,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
876
901
  S,
877
902
  C,
878
903
  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 color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
904
+ ].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
905
  }
881
906
  getValue() {
882
907
  return this._email;
@@ -1015,7 +1040,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1015
1040
  translationFunc: n,
1016
1041
  locale: i,
1017
1042
  onChange: () => {
1018
- this._phone = this._field?.getValue() ?? "", this._error = null, this.emit("change", this._phone);
1043
+ this._phone = this._field?.getValue() ?? "", this._error = null, this._field?.setError(!1), this.emit("change", this._phone);
1019
1044
  },
1020
1045
  onBlur: () => {
1021
1046
  this._phone = this._field?.getValue() ?? "";
@@ -1031,7 +1056,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1031
1056
  C,
1032
1057
  x,
1033
1058
  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 color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
1059
+ ].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
1060
  }
1036
1061
  getValue() {
1037
1062
  return this._phone;
@@ -1111,7 +1136,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1111
1136
  get: () => (this._addressCity || (this._addressCity = new E(), this._trackElement(this._addressCity)), this._addressCity),
1112
1137
  enumerable: !0
1113
1138
  }), Object.defineProperty(a, "state", {
1114
- get: () => (this._addressState || (this._addressState = new M(), this._trackElement(this._addressState)), this._addressState),
1139
+ get: () => (this._addressState || (this._addressState = new M(), this._trackElement(this._addressState), this._addressCountry?.value && this._addressState.setCountry(this._addressCountry.value)), this._addressState),
1115
1140
  enumerable: !0
1116
1141
  }), Object.defineProperty(a, "zipCode", {
1117
1142
  get: () => (this._addressZipCode || (this._addressZipCode = new P(), this._trackElement(this._addressZipCode)), this._addressZipCode),
@@ -1176,7 +1201,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1176
1201
  };
1177
1202
  }
1178
1203
  async _getPayload() {
1179
- if (this._applePay?.isMounted && this._applePay.isValid || this._paypal?.isMounted) return null;
1204
+ if (this._applePay?.isMounted && this._applePay.isValid) return null;
1180
1205
  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
1206
  street: this._addressStreet?.isMounted ? this._addressStreet.value : "",
1182
1207
  city: this._addressCity?.isMounted ? this._addressCity.value : "",
@@ -1225,10 +1250,6 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1225
1250
  });
1226
1251
  return;
1227
1252
  }
1228
- if (this._paypal?.isMounted) {
1229
- await this._executeAuthorization({ formData: null });
1230
- return;
1231
- }
1232
1253
  let t = await this._getPayload();
1233
1254
  await this._executeAuthorization({
1234
1255
  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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odus/checkout",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "displayName": "Odus Checkout SDK",
5
5
  "keywords": [
6
6
  "odus",
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.0",
331
+ version: "1.5.2",
332
332
  environment: e.environment === "test" ? "sandbox" : "production"
333
333
  },
334
334
  isolate: !0,
@@ -5140,7 +5140,7 @@ var wa = (e) => {
5140
5140
  addressLine1: "Address Line 1",
5141
5141
  firstName: "First Name",
5142
5142
  lastName: "Last Name",
5143
- state: "State / Region",
5143
+ state: "State/Region",
5144
5144
  city: "City",
5145
5145
  townCity: "Town/City",
5146
5146
  zipCode: "Zip Code",
@@ -6816,6 +6816,9 @@ var po = (e) => e.replace(/([A-Z])/g, " $1").trim(), mo = Object.fromEntries(Obj
6816
6816
  _focusVgsField(e) {
6817
6817
  this._vgsService?.focusField(e);
6818
6818
  }
6819
+ setVgsService(e) {
6820
+ this._vgsService = e;
6821
+ }
6819
6822
  setOnVgsAutoFocus(e) {
6820
6823
  this._onVgsAutoFocus = e;
6821
6824
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odus/checkout",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "displayName": "Odus Checkout SDK",
5
5
  "keywords": [
6
6
  "odus",