@odus/checkout 1.7.10 → 1.8.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.
Files changed (45) hide show
  1. package/dist/checkout.es.js +168 -146
  2. package/dist/components/checkout/card-elements/CardCvvElement.d.ts.map +1 -1
  3. package/dist/components/checkout/card-elements/CardNumberElement.d.ts.map +1 -1
  4. package/dist/components/checkout/form/AddressSection.d.ts +10 -0
  5. package/dist/components/checkout/form/AddressSection.d.ts.map +1 -1
  6. package/dist/components/checkout/form/CardSection.d.ts +14 -1
  7. package/dist/components/checkout/form/CardSection.d.ts.map +1 -1
  8. package/dist/components/checkout/form/CardholderSection.d.ts.map +1 -1
  9. package/dist/components/checkout/form/FormComponentManager.d.ts +1 -0
  10. package/dist/components/checkout/form/FormComponentManager.d.ts.map +1 -1
  11. package/dist/components/checkout/form/PaymentMethods.d.ts.map +1 -1
  12. package/dist/components/common/HelperText.d.ts +2 -0
  13. package/dist/components/common/HelperText.d.ts.map +1 -1
  14. package/dist/components/common/Input.d.ts +14 -2
  15. package/dist/components/common/Input.d.ts.map +1 -1
  16. package/dist/components/common/Select.d.ts +7 -0
  17. package/dist/components/common/Select.d.ts.map +1 -1
  18. package/dist/elements/ApplePayElement.d.ts.map +1 -1
  19. package/dist/elements/OdusElements.d.ts +3 -0
  20. package/dist/elements/OdusElements.d.ts.map +1 -1
  21. package/dist/elements/card/VgsCardAdapter.d.ts +6 -0
  22. package/dist/elements/card/VgsCardAdapter.d.ts.map +1 -1
  23. package/dist/elements.es.js +291 -236
  24. package/dist/index.css +1 -1
  25. package/dist/locales/cs.json.d.ts +1 -1
  26. package/dist/locales/de.json.d.ts +1 -1
  27. package/dist/locales/en.json.d.ts +1 -1
  28. package/dist/locales/es.json.d.ts +1 -1
  29. package/dist/locales/fr.json.d.ts +1 -1
  30. package/dist/locales/it.json.d.ts +1 -1
  31. package/dist/locales/nl.json.d.ts +1 -1
  32. package/dist/locales/pl.json.d.ts +1 -1
  33. package/dist/locales/pt.json.d.ts +1 -1
  34. package/dist/locales/sk.json.d.ts +1 -1
  35. package/dist/locales/tr.json.d.ts +1 -1
  36. package/dist/phone.js +29 -29
  37. package/dist/services/checkout/Checkout.service.d.ts.map +1 -1
  38. package/dist/services/telemetry/Telemetry.service.d.ts +2 -0
  39. package/dist/services/telemetry/Telemetry.service.d.ts.map +1 -1
  40. package/dist/shared.js +853 -827
  41. package/dist/utils/country/isCountryAllowed.util.d.ts +17 -0
  42. package/dist/utils/country/isCountryAllowed.util.d.ts.map +1 -0
  43. package/dist/utils/helpers/vgsFieldMetrics.util.d.ts +9 -0
  44. package/dist/utils/helpers/vgsFieldMetrics.util.d.ts.map +1 -0
  45. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { B as e, C as t, F as n, J as r, L as i, P as a, R as o, S as s, a as c, b as l, c as u, h as d, i as f, l as p, m, n as h, o as g, r as _, t as v, u as y, w as b, y as x, z as ee } from "./shared.js";
1
+ import { B as e, C as t, D as n, E as r, G as i, H as a, J as o, K as s, L as c, R as ee, S as l, T as u, U as d, V as f, W as p, X as m, Y as h, Z as g, a as te, d as _, g as ne, h as v, i as re, l as y, n as ie, o as ae, r as oe, s as b, t as x, u as S } from "./shared.js";
2
2
  //#region libs/checkout/src/assets/styles/helperText.css?inline
3
- var S = ".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}.form-helper-text-hint{color:var(--odus-color-muted,#6b7280);font-weight:400}", C = ".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}", w = ".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)}", T = ":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}", E = class {
3
+ var C = ".form-helper-text-anchor{height:var(--odus-helper-text-space,4px);z-index:3;position:relative}.form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inherit);font-size:12px;font-weight:500;line-height:var(--odus-helper-text-line-height,14px);background:var(--odus-color-background,#fff);pointer-events:none;transition:opacity .2s ease-in-out;display:block;position:absolute;top:2px;left:0;right:0}.form-helper-text-hidden{opacity:0;visibility:hidden}.form-helper-text-hint{color:var(--odus-color-muted,#6b7280);font-weight:400}", w = ".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}", T = ".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)}", E = ":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}", D = class {
4
4
  shadowRoot = null;
5
5
  host = null;
6
6
  options = {};
@@ -64,17 +64,17 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
64
64
  this.options.callbacks?.[e]?.(t);
65
65
  }
66
66
  getCss() {
67
- return T;
67
+ return E;
68
68
  }
69
- }, D = class extends E {
69
+ }, O = class extends D {
70
70
  _value = "";
71
71
  _error = null;
72
72
  _input = null;
73
73
  render() {
74
74
  if (!this.shadowRoot) return;
75
75
  this._input?.getElement().remove();
76
- let { t: e } = t();
77
- this._input = new y({
76
+ let { t: e } = r();
77
+ this._input = new _({
78
78
  name: "billingAddress.city",
79
79
  label: this.options.label ?? e("address.townCity"),
80
80
  error: !1,
@@ -85,15 +85,15 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
85
85
  this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
86
86
  }
87
87
  }), this._input.addEventListener("blur", () => {
88
- let { t: e } = t();
88
+ let { t: e } = r();
89
89
  this._error = this._value.trim() ? null : e("validation.townCityRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
90
90
  }), this.shadowRoot.appendChild(this._input.getElement());
91
91
  }
92
92
  getCss() {
93
93
  return super.getCss() + [
94
- C,
95
94
  w,
96
- S
95
+ T,
96
+ C
97
97
  ].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
98
98
  }
99
99
  getValue() {
@@ -105,7 +105,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
105
105
  getError() {
106
106
  return this._error;
107
107
  }
108
- }, O = ".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}", k = class extends E {
108
+ }, k = ".input-wrapper{box-sizing:border-box;flex-direction:column;align-items:stretch;width:100%;min-width:0;display:flex}.input-wrapper *{box-sizing:border-box}.form-select{opacity:1;letter-spacing:.02em;padding:var(--odus-input-padding,8px 12px);z-index:0;box-sizing:border-box;cursor:pointer;appearance:none;background:#fff url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2 3.5L5 6.5L8 3.5' stroke='%23717173' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") right 12px center no-repeat;border:none;outline:none;flex:1;width:100%;min-height:0;padding-right:32px;font-weight:400;line-height:1.5;transition:box-shadow .1s ease-in,border-radius .2s ease-in;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d}.form-select-error{box-shadow:0 0 0 1px var(--odus-color-error,#dc2727), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d}.form-select-placeholder{color:#d4d4d5}.form-select option[disabled]{color:#717173;opacity:.5}.form-select:focus{z-index:2;position:relative;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}", A = class extends D {
109
109
  _value = "";
110
110
  _error = null;
111
111
  _select = null;
@@ -116,28 +116,28 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
116
116
  render() {
117
117
  if (!this.shadowRoot) return;
118
118
  this._select?.getElement().remove(), this.options.initialValue && !this._value && (this._value = String(this.options.initialValue), this.emit("change", this._value));
119
- let { t: e, locale: n } = t();
120
- this._select = new p({
119
+ let { t: e, locale: t } = r();
120
+ this._select = new S({
121
121
  name: "billingAddress.country",
122
122
  label: this.options.label ?? e("address.chooseCountry"),
123
123
  error: !1,
124
124
  placeholder: this.options.placeholder ?? e("address.chooseCountry"),
125
125
  value: this._value,
126
- options: d(this._allowedCountries, n),
126
+ options: ne(this._allowedCountries, t),
127
127
  autocomplete: "country",
128
128
  onChange: (e) => {
129
129
  this._value = e.target.value, this._error = null, this.emit("change", this._value);
130
130
  }
131
131
  }), this._select.addEventListener("blur", () => {
132
- let { t: e } = t();
132
+ let { t: e } = r();
133
133
  this._error = this._value ? null : e("validation.countryRequired"), this._select?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
134
134
  }), this.shadowRoot.appendChild(this._select.getElement());
135
135
  }
136
136
  getCss() {
137
137
  return super.getCss() + [
138
- w,
139
- S,
140
- O
138
+ T,
139
+ C,
140
+ k
141
141
  ].join("\n") + "\n :host { display: block; }\n .form-select {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background-color: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-select:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-select-error {\n color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
142
142
  }
143
143
  getValue() {
@@ -149,15 +149,15 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
149
149
  getError() {
150
150
  return this._error;
151
151
  }
152
- }, A = class extends E {
152
+ }, j = class extends D {
153
153
  _value = "";
154
154
  _error = null;
155
155
  _input = null;
156
156
  render() {
157
157
  if (!this.shadowRoot) return;
158
158
  this._input?.getElement().remove();
159
- let { t: e } = t();
160
- this._input = new y({
159
+ let { t: e } = r();
160
+ this._input = new _({
161
161
  name: "billingAddress.firstName",
162
162
  label: this.options.label ?? e("address.firstName"),
163
163
  error: !1,
@@ -168,15 +168,15 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
168
168
  this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
169
169
  }
170
170
  }), this._input.addEventListener("blur", () => {
171
- let { t: e } = t();
171
+ let { t: e } = r();
172
172
  this._error = this._value.trim() ? null : e("validation.firstNameRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
173
173
  }), this.shadowRoot.appendChild(this._input.getElement());
174
174
  }
175
175
  getCss() {
176
176
  return super.getCss() + [
177
- C,
178
177
  w,
179
- S
178
+ T,
179
+ C
180
180
  ].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
181
181
  }
182
182
  getValue() {
@@ -188,15 +188,15 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
188
188
  getError() {
189
189
  return this._error;
190
190
  }
191
- }, j = class extends E {
191
+ }, M = class extends D {
192
192
  _value = "";
193
193
  _error = null;
194
194
  _input = null;
195
195
  render() {
196
196
  if (!this.shadowRoot) return;
197
197
  this._input?.getElement().remove();
198
- let { t: e } = t();
199
- this._input = new y({
198
+ let { t: e } = r();
199
+ this._input = new _({
200
200
  name: "billingAddress.lastName",
201
201
  label: this.options.label ?? e("address.lastName"),
202
202
  error: !1,
@@ -207,15 +207,15 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
207
207
  this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
208
208
  }
209
209
  }), this._input.addEventListener("blur", () => {
210
- let { t: e } = t();
210
+ let { t: e } = r();
211
211
  this._error = this._value.trim() ? null : e("validation.lastNameRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
212
212
  }), this.shadowRoot.appendChild(this._input.getElement());
213
213
  }
214
214
  getCss() {
215
215
  return super.getCss() + [
216
- C,
217
216
  w,
218
- S
217
+ T,
218
+ C
219
219
  ].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
220
220
  }
221
221
  getValue() {
@@ -227,33 +227,33 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
227
227
  getError() {
228
228
  return this._error;
229
229
  }
230
- }, M = /* @__PURE__ */ new Set(["US", "CA"]), N = class extends E {
230
+ }, N = /* @__PURE__ */ new Set(["US", "CA"]), P = class extends D {
231
231
  _value = "";
232
232
  _country = "";
233
233
  _input = null;
234
234
  _select = null;
235
235
  setCountry(e) {
236
- let n = this._country;
236
+ let t = this._country;
237
237
  if (this._country = e, !this.shadowRoot) return;
238
- let r = M.has(n), i = M.has(e);
239
- if (r && i && n !== e) {
240
- let { t: n } = t(), r = e, i = n(r === "US" ? "address.chooseState" : "address.chooseProvince");
241
- this._select?.setOptions(m(r), this.options.placeholder ?? i), this._value = "", this.emit("change", this._value);
238
+ let n = N.has(t), i = N.has(e);
239
+ if (n && i && t !== e) {
240
+ let { t } = r(), n = e, i = t(n === "US" ? "address.chooseState" : "address.chooseProvince");
241
+ this._select?.setOptions(v(n), this.options.placeholder ?? i), this._value = "", this.emit("change", this._value);
242
242
  return;
243
243
  }
244
- r !== i && (this._value = "", this.render(), this.emit("change", this._value));
244
+ n !== i && (this._value = "", this.render(), this.emit("change", this._value));
245
245
  }
246
246
  render() {
247
247
  if (this.shadowRoot) {
248
- if (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null, M.has(this._country)) {
248
+ if (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null, N.has(this._country)) {
249
249
  let e = this._country;
250
250
  this._renderSelect(e);
251
251
  } else this._renderInput();
252
252
  }
253
253
  }
254
254
  _renderInput() {
255
- let { t: e } = t();
256
- this._input = new y({
255
+ let { t: e } = r();
256
+ this._input = new _({
257
257
  name: "billingAddress.state",
258
258
  label: this.options.label ?? e("address.state"),
259
259
  error: !1,
@@ -269,14 +269,14 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
269
269
  }), this.shadowRoot.appendChild(this._input.getElement());
270
270
  }
271
271
  _renderSelect(e) {
272
- let { t: n } = t(), r = m(e), i = n(e === "US" ? "address.chooseState" : "address.chooseProvince");
273
- this._select = new p({
272
+ let { t } = r(), n = v(e), i = t(e === "US" ? "address.chooseState" : "address.chooseProvince");
273
+ this._select = new S({
274
274
  name: "billingAddress.state",
275
- label: this.options.label ?? n("address.state"),
275
+ label: this.options.label ?? t("address.state"),
276
276
  error: !1,
277
277
  placeholder: this.options.placeholder ?? i,
278
278
  value: this._value,
279
- options: r,
279
+ options: n,
280
280
  autocomplete: "address-level1",
281
281
  onChange: (e) => {
282
282
  this._value = e.target.value, this._select?.setError(!1), this.emit("change", this._value);
@@ -288,10 +288,10 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
288
288
  }
289
289
  getCss() {
290
290
  return super.getCss() + [
291
- C,
292
291
  w,
293
- S,
294
- O
292
+ T,
293
+ C,
294
+ k
295
295
  ].join("\n") + "\n :host { display: block; }\n .form-input,\n .form-select {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background-color: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus,\n .form-select:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error,\n .form-select-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
296
296
  }
297
297
  getValue() {
@@ -302,18 +302,18 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
302
302
  }
303
303
  getError() {
304
304
  if (this.getIsValid()) return null;
305
- let { t: e } = t();
305
+ let { t: e } = r();
306
306
  return e("validation.stateRequired");
307
307
  }
308
- }, P = class extends E {
308
+ }, F = class extends D {
309
309
  _value = "";
310
310
  _error = null;
311
311
  _input = null;
312
312
  render() {
313
313
  if (!this.shadowRoot) return;
314
314
  this._input?.getElement().remove();
315
- let { t: e } = t();
316
- this._input = new y({
315
+ let { t: e } = r();
316
+ this._input = new _({
317
317
  name: "billingAddress.street",
318
318
  label: this.options.label ?? e("address.addressLine1"),
319
319
  error: !1,
@@ -329,15 +329,15 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
329
329
  this.emit("change", this._value);
330
330
  }
331
331
  }), this._input.addEventListener("blur", () => {
332
- let { t: e } = t();
332
+ let { t: e } = r();
333
333
  this._error = this._value.trim() ? null : e("validation.addressLine1Required"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
334
334
  }), this.shadowRoot.appendChild(this._input.getElement());
335
335
  }
336
336
  getCss() {
337
337
  return super.getCss() + [
338
- C,
339
338
  w,
340
- S
339
+ T,
340
+ C
341
341
  ].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
342
342
  }
343
343
  getValue() {
@@ -349,15 +349,15 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
349
349
  getError() {
350
350
  return this._error;
351
351
  }
352
- }, F = class extends E {
352
+ }, I = class extends D {
353
353
  _value = "";
354
354
  _error = null;
355
355
  _input = null;
356
356
  render() {
357
357
  if (!this.shadowRoot) return;
358
358
  this._input?.getElement().remove();
359
- let { t: e } = t();
360
- this._input = new y({
359
+ let { t: e } = r();
360
+ this._input = new _({
361
361
  name: "billingAddress.zipCode",
362
362
  label: this.options.label ?? e("address.postalCode"),
363
363
  error: !1,
@@ -368,15 +368,15 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
368
368
  this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
369
369
  }
370
370
  }), this._input.addEventListener("blur", () => {
371
- let { t: e } = t();
371
+ let { t: e } = r();
372
372
  this._error = this._value.trim() ? null : e("validation.postalCodeRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
373
373
  }), this.shadowRoot.appendChild(this._input.getElement());
374
374
  }
375
375
  getCss() {
376
376
  return super.getCss() + [
377
- C,
378
377
  w,
379
- S
378
+ T,
379
+ C
380
380
  ].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
381
381
  }
382
382
  getValue() {
@@ -388,7 +388,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
388
388
  getError() {
389
389
  return this._error;
390
390
  }
391
- }, te = "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)}", I = {
391
+ }, L = "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)}", R = {
392
392
  name: "odus-elements",
393
393
  styles: {
394
394
  fontSize: 14,
@@ -412,7 +412,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
412
412
  }
413
413
  },
414
414
  additionalPaymentMethods: {}
415
- }, L = class extends E {
415
+ }, z = class extends D {
416
416
  _paymentContext = null;
417
417
  _applePayData = null;
418
418
  _authorized = !1;
@@ -431,16 +431,16 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
431
431
  return;
432
432
  }
433
433
  let { paymentId: e, checkoutKey: t, environment: n, checkoutDetails: r, displayName: i, countries: a, requiredBillingContactFields: o, requiredShippingContactFields: s, onAuthorize: c } = this._paymentContext;
434
- if (a?.length && r?.countryCode && !a.map((e) => e.toUpperCase()).includes(r.countryCode.toUpperCase())) {
434
+ if (!te(a, r?.countryCode)) {
435
435
  this._setAvailability(!1);
436
436
  return;
437
437
  }
438
- if (!f()) {
438
+ if (!re()) {
439
439
  this._setAvailability(!1);
440
440
  return;
441
441
  }
442
- this._button = new _({
443
- checkoutProfile: I,
442
+ this._button = new oe({
443
+ checkoutProfile: R,
444
444
  paymentId: e,
445
445
  checkoutKey: t,
446
446
  environment: n,
@@ -457,7 +457,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
457
457
  this._isAvailable = e, this.host && (e ? this.host.style.removeProperty("display") : this.host.style.display = "none");
458
458
  }
459
459
  getCss() {
460
- return super.getCss() + te + "\n :host { display: block; }\n apple-pay-button {\n width: 100%;\n height: var(--odus-button-height, 48px);\n border-radius: var(--odus-button-border-radius, 6px);\n }\n ";
460
+ return super.getCss() + L + "\n :host { display: block; }\n apple-pay-button {\n width: 100%;\n height: var(--odus-button-height, 48px);\n border-radius: var(--odus-button-border-radius, 6px);\n }\n ";
461
461
  }
462
462
  getValue() {
463
463
  return this._applePayData;
@@ -468,7 +468,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
468
468
  getError() {
469
469
  return null;
470
470
  }
471
- }, R = ".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}", z = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvWpIQFjQQCPpaIlJKpegirp5kLkzLB1AxHmnLk73D3TJbAGqr1QmlsWDBtMPMRpdzzUM7ZwX3kzhIuATV4Pe7RKp3nZlVmcrT0YCQXBrTwqZNh775z58GP2kZs+gVfNqBampJPzSB/hB62KkByhECn6grrRjiAVwJyZVEvs/2vrxaEpO+aE16emtX12RgI5JdzdOiNyZEQteU6zRBRJEocPWVxExaOpVVVJ5+UnW0LcalzA+lRGRTrQJ5JguAPiAOzRPTK/lYFFpCAl/F8wtoAVG1c8zO2NcQ0Pko+fmeidRFxJ/did2btV+9Mkze3mBphwFmvnxa35LF+Cs/XJHDwIDAQAB", B = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8gGPMwBRPuVyJReZGIkWH/+Bf5pnpDN1bSR2cLYLXVT8CaSnTw74qeboSnktgYCi1D9R3Bj2fYzTIwGGZb8KinLdxwbqZmHwrE9cFhCaHbG/E0PbqQGhXP2vbniZTT4M0i0Cbi7ES3Bw5zqNbIZZnX041QEpxLvIyWPKZCX+fBogNMhWfCF779aclChjHkwZMsufThVWE9xklWGxXiytx5aL4I5JPxq0I7cAkZGGs4aF/GxWwPaq7R3wPikJQ0YHnCMfcURzl2Hnw/inqyMy+JB6djTq2/BdzMAhWTh3cDWq9Xu+gEkb/QCd0n1yYIdKuDISlk/AfHdWe34IvzhVyQIDAQAB", V = {
471
+ }, B = ".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}", V = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvWpIQFjQQCPpaIlJKpegirp5kLkzLB1AxHmnLk73D3TJbAGqr1QmlsWDBtMPMRpdzzUM7ZwX3kzhIuATV4Pe7RKp3nZlVmcrT0YCQXBrTwqZNh775z58GP2kZs+gVfNqBampJPzSB/hB62KkByhECn6grrRjiAVwJyZVEvs/2vrxaEpO+aE16emtX12RgI5JdzdOiNyZEQteU6zRBRJEocPWVxExaOpVVVJ5+UnW0LcalzA+lRGRTrQJ5JguAPiAOzRPTK/lYFFpCAl/F8wtoAVG1c8zO2NcQ0Pko+fmeidRFxJ/did2btV+9Mkze3mBphwFmvnxa35LF+Cs/XJHDwIDAQAB", H = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8gGPMwBRPuVyJReZGIkWH/+Bf5pnpDN1bSR2cLYLXVT8CaSnTw74qeboSnktgYCi1D9R3Bj2fYzTIwGGZb8KinLdxwbqZmHwrE9cFhCaHbG/E0PbqQGhXP2vbniZTT4M0i0Cbi7ES3Bw5zqNbIZZnX041QEpxLvIyWPKZCX+fBogNMhWfCF779aclChjHkwZMsufThVWE9xklWGxXiytx5aL4I5JPxq0I7cAkZGGs4aF/GxWwPaq7R3wPikJQ0YHnCMfcURzl2Hnw/inqyMy+JB6djTq2/BdzMAhWTh3cDWq9Xu+gEkb/QCd0n1yYIdKuDISlk/AfHdWe34IvzhVyQIDAQAB", U = {
472
472
  name: "odus-elements",
473
473
  styles: {
474
474
  fontSize: 14,
@@ -492,51 +492,51 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
492
492
  }
493
493
  },
494
494
  additionalPaymentMethods: {}
495
- }, H = class {
495
+ }, W = class {
496
496
  _cardNumber = "";
497
497
  _cardExpiry = "";
498
498
  _cardCvv = "";
499
499
  _section = null;
500
- _focusManager = new x();
500
+ _focusManager = new l();
501
501
  _touchedFields = /* @__PURE__ */ new Set();
502
502
  _focusHandlers = [];
503
503
  get section() {
504
504
  return this._section;
505
505
  }
506
- renderSection(e, r, i) {
506
+ renderSection(e, t, n) {
507
507
  this._section?.getElement().remove();
508
- let { t: o } = t();
509
- this._section = new g({
510
- checkoutProfile: V,
508
+ let { t: i } = r();
509
+ this._section = new b({
510
+ checkoutProfile: U,
511
511
  cardNumber: this._cardNumber,
512
512
  cardNumberTouched: !1,
513
513
  cardCvv: this._cardCvv,
514
514
  cardCvvTouched: !1,
515
515
  cardExpiry: this._cardExpiry,
516
516
  cardExpiryTouched: !1,
517
- translationFunc: o,
517
+ translationFunc: i,
518
518
  onChange: (e) => {
519
- let t = e.target;
520
- if (t.name === "cardNumber") this._cardNumber = t.value;
521
- else if (t.name === "cardExpiry") {
522
- let e = n.cardExpiry(t.value);
519
+ let n = e.target;
520
+ if (n.name === "cardNumber") this._cardNumber = n.value;
521
+ else if (n.name === "cardExpiry") {
522
+ let e = ee.cardExpiry(n.value);
523
523
  this._cardExpiry = e, this._section?.updateCardExpiry(e);
524
- } else t.name === "cardCvv" && (this._cardCvv = t.value);
525
- this._touchedFields.add(t.name), this._updateFocusManagerState(), r(this.getValue());
524
+ } else n.name === "cardCvv" && (this._cardCvv = n.value);
525
+ this._touchedFields.add(n.name), this._updateFocusManagerState(), t(this.getValue());
526
526
  },
527
527
  onBlur: (e) => {
528
- let t = e.target, n = t.name ?? "cardExpiry", r = a();
529
- if (this._touchedFields.add(n), t.name === "cardNumber") {
530
- let e = r.cardNumber(this._cardNumber);
528
+ let t = e.target, r = t.name ?? "cardExpiry", i = c();
529
+ if (this._touchedFields.add(r), t.name === "cardNumber") {
530
+ let e = i.cardNumber(this._cardNumber);
531
531
  this._section?.updateCardNumber(this._cardNumber, e, !0);
532
532
  } else if (t.name === "cardCvv") {
533
- let e = r.cardCvv(this._cardCvv, this._cardNumber);
533
+ let e = i.cardCvv(this._cardCvv, this._cardNumber);
534
534
  this._section?.updateCardCvv(this._cardCvv, e, !0);
535
535
  } else {
536
- let e = r.cardExpiry(this._cardExpiry);
536
+ let e = i.cardExpiry(this._cardExpiry);
537
537
  this._section?.updateCardExpiry(this._cardExpiry, e, !0);
538
538
  }
539
- this._updateFocusManagerState(), i(this.getValue());
539
+ this._updateFocusManagerState(), n(this.getValue());
540
540
  }
541
541
  }), e.appendChild(this._section.getElement()), this._registerFocusFields();
542
542
  }
@@ -547,23 +547,23 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
547
547
  cvv: this._cardCvv
548
548
  };
549
549
  }
550
- async getPayload(t) {
551
- let n = t === "live" ? B : z, r = new e();
552
- r.setPublicKey(n);
553
- let i = this._cardNumber.replace(/\s+/g, ""), a = this._cardExpiry.replace(/\s+/g, "").split("/"), o = a[0] ?? "", s = a[1] ?? "";
554
- return s.length === 2 && (s = `20${s}`), {
555
- encryptedCardNumber: r.encrypt(i),
556
- encryptedCvv: r.encrypt(this._cardCvv),
557
- expMonth: o,
558
- expYear: s
550
+ async getPayload(e) {
551
+ let t = e === "live" ? H : V, n = new d();
552
+ n.setPublicKey(t);
553
+ let r = this._cardNumber.replace(/\s+/g, ""), i = this._cardExpiry.replace(/\s+/g, "").split("/"), a = i[0] ?? "", o = i[1] ?? "";
554
+ return o.length === 2 && (o = `20${o}`), {
555
+ encryptedCardNumber: n.encrypt(r),
556
+ encryptedCvv: n.encrypt(this._cardCvv),
557
+ expMonth: a,
558
+ expYear: o
559
559
  };
560
560
  }
561
561
  isValid() {
562
- let e = a(), t = this._cardCvv.length >= 3;
562
+ let e = c(), t = this._cardCvv.length >= 3;
563
563
  return !e.cardNumber(this._cardNumber) && !e.cardExpiry(this._cardExpiry) && t;
564
564
  }
565
565
  getError() {
566
- let e = a();
566
+ let e = c();
567
567
  return e.cardNumber(this._cardNumber) ?? e.cardExpiry(this._cardExpiry) ?? null;
568
568
  }
569
569
  destroy() {
@@ -589,19 +589,19 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
589
589
  this._focusHandlers = [];
590
590
  }
591
591
  _updateFocusManagerState() {
592
- let e = a(), t = {
592
+ let e = c(), t = {
593
593
  cardNumber: this._cardNumber,
594
594
  cardExpiry: this._cardExpiry,
595
595
  cardCvv: this._cardCvv,
596
596
  name: "",
597
597
  email: ""
598
- }, n = {}, r = e.cardNumber(this._cardNumber), i = e.cardExpiry(this._cardExpiry), o = e.cardCvv(this._cardCvv, this._cardNumber);
599
- r && (n.cardNumber = r), i && (n.cardExpiry = i), o && (n.cardCvv = o);
600
- let s = {};
601
- for (let e of this._touchedFields) s[e] = !0;
602
- this._focusManager.handleStateUpdate(t, n, s);
598
+ }, n = {}, r = e.cardNumber(this._cardNumber), i = e.cardExpiry(this._cardExpiry), a = e.cardCvv(this._cardCvv, this._cardNumber);
599
+ r && (n.cardNumber = r), i && (n.cardExpiry = i), a && (n.cardCvv = a);
600
+ let o = {};
601
+ for (let e of this._touchedFields) o[e] = !0;
602
+ this._focusManager.handleStateUpdate(t, n, o);
603
603
  }
604
- }, U = {
604
+ }, G = {
605
605
  "--odus-font-family": "system-ui, sans-serif",
606
606
  "--odus-font-size": "16px",
607
607
  "--odus-color-error": "#dc2727",
@@ -624,7 +624,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
624
624
  "--odus-card-gap": "12px",
625
625
  "--odus-button-height": "48px",
626
626
  "--odus-button-border-radius": "var(--odus-border-radius)"
627
- }["--odus-font-size"], W = class {
627
+ }["--odus-font-size"], K = class {
628
628
  _vgsService;
629
629
  _vgsJwt;
630
630
  _vgsState = {};
@@ -634,28 +634,33 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
634
634
  _environment = "test";
635
635
  _section = null;
636
636
  _initGeneration = 0;
637
- constructor(e, t) {
638
- this._vgsJwt = e, this._environment = t, this._vgsService = new i();
637
+ constructor(t, n) {
638
+ this._vgsJwt = t, this._environment = n, this._vgsService = new e();
639
639
  }
640
640
  get section() {
641
641
  return this._section;
642
642
  }
643
- renderSection(e, n) {
643
+ renderSection(e, t) {
644
644
  this._section?.getElement().remove();
645
- let { t: r } = t();
646
- this._section = new g({
647
- checkoutProfile: V,
645
+ let { t: n } = r();
646
+ this._section = new b({
647
+ checkoutProfile: U,
648
648
  cardNumber: "",
649
649
  cardNumberTouched: !1,
650
650
  cardCvv: "",
651
651
  cardCvvTouched: !1,
652
652
  cardExpiry: "",
653
653
  cardExpiryTouched: !1,
654
- translationFunc: r,
654
+ translationFunc: n,
655
655
  onChange: () => {},
656
656
  onBlur: () => {},
657
657
  vgsService: this._vgsService
658
- }), e.appendChild(this._section.getElement()), this._onChangeEmit = n;
658
+ }), this._applySkeletonMetrics(), e.appendChild(this._section.getElement()), this._onChangeEmit = t;
659
+ }
660
+ _applySkeletonMetrics() {
661
+ if (!this._section) return;
662
+ let e = this._buildProfileFromTheme(this._currentTheme);
663
+ this._section.updateVgsWrapperStyles(this._currentTheme["--odus-border-color"] ?? "#e0e0e0", e.styles.borderRadius), this._section.setVgsFieldMetrics(this._currentTheme["--odus-input-padding"] ?? "8px 12px", e.styles.fontSize);
659
664
  }
660
665
  _onChangeEmit = null;
661
666
  initVgs() {
@@ -678,79 +683,75 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
678
683
  return this._vgsFieldsValid;
679
684
  }
680
685
  getError() {
681
- let { t: e } = t();
686
+ let { t: e } = r();
682
687
  for (let [t, n] of Object.entries(this._vgsState)) {
683
688
  if (!n?.isTouched || n.isFocused || n.isValid) continue;
684
689
  let r = n.errors?.[0];
685
690
  if (!r) continue;
686
- let i = u(t, r.code);
691
+ let i = y(t, r.code);
687
692
  if (i) return e(i);
688
693
  }
689
694
  return null;
690
695
  }
691
696
  applyTheme(e) {
692
- if (this._currentTheme = {
697
+ this._currentTheme = {
693
698
  ...this._currentTheme,
694
699
  ...e
695
- }, !this._section) return;
696
- let t = this._buildProfileFromTheme(this._currentTheme), n = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
697
- this._section.updateVgsWrapperStyles(n, t.styles.borderRadius), this._reinitWithTheme();
700
+ }, this._section && (this._applySkeletonMetrics(), this._reinitWithTheme());
698
701
  }
699
702
  resetTheme(e) {
700
703
  for (let t of e) delete this._currentTheme[t];
701
- if (!this._section) return;
702
- let t = this._buildProfileFromTheme(this._currentTheme), n = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
703
- this._section.updateVgsWrapperStyles(n, t.styles.borderRadius), this._reinitWithTheme();
704
+ this._section && (this._applySkeletonMetrics(), this._reinitWithTheme());
704
705
  }
705
706
  destroy() {
706
707
  this._vgsReinitTimer &&= (clearTimeout(this._vgsReinitTimer), null), this._vgsService.destroy(), this._section = null;
707
708
  }
708
709
  _reinitWithTheme() {
709
710
  this._vgsReinitTimer && clearTimeout(this._vgsReinitTimer), this._vgsReinitTimer = setTimeout(() => {
710
- this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new i(), this._section?.setVgsService(this._vgsService), this.initVgs();
711
+ this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new e(), this._section?.setVgsService(this._vgsService), this.initVgs();
711
712
  }, 300);
712
713
  }
713
714
  _buildProfileFromTheme(e) {
714
- let t = e["--odus-input-font-size"] ?? e["--odus-font-size"] ?? U, n = e["--odus-font-family"] ?? V.styles.fontFamily, r = e["--odus-color-text"] ?? V.styles.textColor, i = e["--odus-border-radius"] ?? `${V.styles.borderRadius}px`;
715
+ let t = e["--odus-input-font-size"] ?? e["--odus-font-size"] ?? G, n = e["--odus-font-family"] ?? U.styles.fontFamily, r = e["--odus-color-text"] ?? U.styles.textColor, i = e["--odus-border-radius"] ?? `${U.styles.borderRadius}px`;
715
716
  return {
716
- ...V,
717
+ ...U,
717
718
  styles: {
718
- ...V.styles,
719
- fontSize: parseInt(t, 10) || parseInt(U, 10),
719
+ ...U.styles,
720
+ fontSize: parseInt(t, 10) || parseInt(G, 10),
720
721
  fontFamily: n,
721
722
  textColor: r,
722
- borderRadius: parseInt(i, 10) || V.styles.borderRadius
723
+ borderRadius: parseInt(i, 10) || U.styles.borderRadius
723
724
  }
724
725
  };
725
726
  }
726
727
  async _mountFields(e) {
727
728
  if (!this._section) return;
728
- let n = this._buildProfileFromTheme(this._currentTheme), r = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
729
- this._section.updateVgsWrapperStyles(r, n.styles.borderRadius);
730
- let i = this._section.getVgsContainerIds();
731
- for (let e of Object.values(i)) {
729
+ let n = this._buildProfileFromTheme(this._currentTheme), i = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
730
+ this._applySkeletonMetrics();
731
+ let a = this._section.getVgsContainerIds();
732
+ for (let e of Object.values(a)) {
732
733
  if (!e) continue;
733
734
  let t = document.getElementById(e);
734
735
  t && t.querySelectorAll("iframe").forEach((e) => e.remove());
735
736
  }
736
- let a = await l(n.styles.fontFamily);
737
+ let o = await t(n.styles.fontFamily);
737
738
  if (e !== this._initGeneration) return;
738
- let o = this._section.buildVgsFieldCss(n, a, {
739
- borderColor: r,
739
+ let s = this._section.buildVgsFieldCss(n, o, {
740
+ borderColor: i,
740
741
  backgroundColor: this._currentTheme["--odus-color-background"],
741
742
  placeholderColor: this._currentTheme["--odus-input-placeholder-color"],
742
743
  placeholderOpacity: this._currentTheme["--odus-input-placeholder-opacity"],
743
744
  padding: this._currentTheme["--odus-input-padding"]
744
- }), { t: s } = t();
745
+ }), { t: c } = r();
745
746
  this._vgsService.mountCardFields({
746
- cardNumber: i.cardNumber ? `#${i.cardNumber}` : void 0,
747
- cardExpiry: i.cardExpiry ? `#${i.cardExpiry}` : void 0,
748
- cardCvv: i.cardCvv ? `#${i.cardCvv}` : void 0
749
- }, o, {
747
+ cardNumber: a.cardNumber ? `#${a.cardNumber}` : void 0,
748
+ cardExpiry: a.cardExpiry ? `#${a.cardExpiry}` : void 0,
749
+ cardCvv: a.cardCvv ? `#${a.cardCvv}` : void 0
750
+ }, s, {
750
751
  cardNumber: "1234 5678 9012 3456",
751
- cardExpiry: s("cardExpiry"),
752
+ cardExpiry: c("cardExpiry"),
752
753
  cardCvv: "CVV",
753
- cardholderName: s("cardholderName")
754
+ cardholderName: c("cardholderName")
754
755
  }, (e) => {
755
756
  this._section?.updateVgsCardBrand(e);
756
757
  }), this._vgsService.waitForFieldsReady().then(() => {
@@ -759,8 +760,8 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
759
760
  }
760
761
  _handleStateChange(e) {
761
762
  this._vgsState = e, this._vgsFieldsValid = Object.values(e).every((e) => e?.isValid === !0);
762
- let { t: n } = t(), r = this._deriveFieldErrors(n);
763
- this._section?.handleVgsStateChange(e, r), this._onChangeEmit?.();
763
+ let { t } = r(), n = this._deriveFieldErrors(t);
764
+ this._section?.handleVgsStateChange(e, n), this._onChangeEmit?.();
764
765
  }
765
766
  _deriveFieldErrors(e) {
766
767
  let t = {};
@@ -768,16 +769,16 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
768
769
  if (!r?.isTouched || r.isFocused || r.isValid) continue;
769
770
  let i = r.errors?.[0];
770
771
  if (!i) continue;
771
- let a = u(n, i.code);
772
+ let a = y(n, i.code);
772
773
  a && (t[n] = e(a));
773
774
  }
774
775
  return t;
775
776
  }
776
- }, G = class extends E {
777
+ }, q = class extends D {
777
778
  _environment = "test";
778
779
  _isVgsMode = !1;
779
780
  _mountContainer = null;
780
- _nativeAdapter = new H();
781
+ _nativeAdapter = new W();
781
782
  _vgsAdapter = null;
782
783
  get isVgsMode() {
783
784
  return this._isVgsMode;
@@ -786,7 +787,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
786
787
  this._environment = e;
787
788
  }
788
789
  setVgsJwt(e) {
789
- this._isVgsMode = !0, this._vgsAdapter = new W(e, this._environment), this.isMounted && this._mountContainer && (this.unmount(), this.mount(this._mountContainer));
790
+ this._isVgsMode = !0, this._vgsAdapter = new K(e, this._environment), this.isMounted && this._mountContainer && (this.unmount(), this.mount(this._mountContainer));
790
791
  }
791
792
  mount(e) {
792
793
  this.isMounted && this.unmount();
@@ -827,10 +828,10 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
827
828
  }
828
829
  getCss() {
829
830
  return super.getCss() + [
830
- C,
831
831
  w,
832
- S,
833
- R
832
+ T,
833
+ C,
834
+ B
834
835
  ].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 ";
835
836
  }
836
837
  getValue() {
@@ -853,15 +854,15 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
853
854
  getError() {
854
855
  return this._isVgsMode ? this._vgsAdapter?.getError() ?? null : this._nativeAdapter.getError();
855
856
  }
856
- }, K = class extends E {
857
+ }, J = class extends D {
857
858
  _value = "";
858
859
  _error = null;
859
860
  _input = null;
860
861
  render() {
861
862
  if (!this.shadowRoot) return;
862
863
  this._input?.getElement().remove();
863
- let { t: e } = t();
864
- this._input = new y({
864
+ let { t: e } = r();
865
+ this._input = new _({
865
866
  name: "billingAddress.cardholderName",
866
867
  label: this.options.label ?? e("cardholderNameLabel"),
867
868
  error: !1,
@@ -873,15 +874,15 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
873
874
  t !== n && this._input?.setValue(n), this._value = n, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
874
875
  }
875
876
  }), this._input.addEventListener("blur", () => {
876
- let { t: e } = t();
877
+ let { t: e } = r();
877
878
  this._error = this._value.trim() ? null : e("validation.nameRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
878
879
  }), this.shadowRoot.appendChild(this._input.getElement());
879
880
  }
880
881
  getCss() {
881
882
  return super.getCss() + [
882
- C,
883
883
  w,
884
- S
884
+ T,
885
+ C
885
886
  ].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 ";
886
887
  }
887
888
  getValue() {
@@ -893,7 +894,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
893
894
  getError() {
894
895
  return this._error;
895
896
  }
896
- }, q = {
897
+ }, se = {
897
898
  name: "odus-elements",
898
899
  styles: {
899
900
  fontSize: 14,
@@ -917,7 +918,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
917
918
  }
918
919
  },
919
920
  additionalPaymentMethods: {}
920
- }, J = class extends E {
921
+ }, Y = class extends D {
921
922
  _email = "";
922
923
  _error = null;
923
924
  _suggestion = null;
@@ -925,11 +926,11 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
925
926
  render() {
926
927
  if (!this.shadowRoot) return;
927
928
  this._field?.getElement().remove(), this.options.initialValue && !this._email && (this._email = String(this.options.initialValue));
928
- let { t: e } = t();
929
- this._field = new c({
929
+ let { t: e } = r();
930
+ this._field = new ae({
930
931
  value: this._email,
931
932
  error: !1,
932
- checkoutProfile: q,
933
+ checkoutProfile: se,
933
934
  translationFunc: e,
934
935
  label: this.options.label,
935
936
  placeholder: this.options.placeholder,
@@ -938,23 +939,23 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
938
939
  this._email = t.value ?? this._field?.getValue() ?? "", this._error = null, this._suggestion = null, this._field?.setError(!1), this._field?.setSuggestion(null), this.emit("change", this._email);
939
940
  },
940
941
  onBlur: () => {
941
- let e = a();
942
+ let e = c();
942
943
  this._error = e.email(this._email) ?? null, this._suggestion = e.emailSuggestion(this._email) ?? null, this._field?.setError(!!this._error, this._error ?? void 0), this._field?.setSuggestion(this._suggestion), this.emit("blur", this._email);
943
944
  }
944
945
  }), this.shadowRoot.appendChild(this._field.getElement());
945
946
  }
946
947
  getCss() {
947
948
  return super.getCss() + [
948
- C,
949
949
  w,
950
- S
950
+ T,
951
+ C
951
952
  ].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text-hint {\n color: var(--odus-color-muted, #6b7280) !important;\n }\n ";
952
953
  }
953
954
  getValue() {
954
955
  return this._email;
955
956
  }
956
957
  getIsValid() {
957
- return !a().email(this._email);
958
+ return !c().email(this._email);
958
959
  }
959
960
  getError() {
960
961
  return this._error;
@@ -962,24 +963,24 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
962
963
  get suggestion() {
963
964
  return this._suggestion;
964
965
  }
965
- }, Y = "@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}", X = class extends E {
966
+ }, ce = "@keyframes slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.error-alert{background-color:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:16px;animation:.3s ease-out slideIn;box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f}.error-alert-content{align-items:flex-start;gap:12px;display:flex}.error-alert-icon-container{color:#dc2626;background-color:#fee2e2;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;display:flex}.error-alert-icon{color:#dc2626}.error-alert-text-container{flex:1;min-width:0}.error-alert-title{color:#991b1b;margin:0 0 4px;font-size:14px;font-weight:600;line-height:1.4}.error-alert-message{font-family:var(--odus-font-family,inherit);color:#7f1d1d;word-break:break-word;margin:0;font-size:14px;line-height:1.5}", X = class extends D {
966
967
  _alert = null;
967
968
  _message = null;
968
969
  render() {
969
- this.shadowRoot && (this._alert?.getElement().remove(), this._alert = null, this._message && (this._alert = new v({ message: this._message }), this.shadowRoot.appendChild(this._alert.getElement())));
970
+ this.shadowRoot && (this._alert?.getElement().remove(), this._alert = null, this._message && (this._alert = new x({ message: this._message }), this.shadowRoot.appendChild(this._alert.getElement())));
970
971
  }
971
972
  setError(e) {
972
973
  if (this._message = e, !this.shadowRoot) {
973
974
  this.emit("error", e);
974
975
  return;
975
976
  }
976
- this._alert ? this._alert.setMessage(e) : (this._alert = new v({ message: e }), this.shadowRoot.appendChild(this._alert.getElement())), this.emit("error", e);
977
+ this._alert ? this._alert.setMessage(e) : (this._alert = new x({ message: e }), this.shadowRoot.appendChild(this._alert.getElement())), this.emit("error", e);
977
978
  }
978
979
  clearError() {
979
980
  this._message = null, this._alert?.getElement().remove(), this._alert = null;
980
981
  }
981
982
  getCss() {
982
- return super.getCss() + Y + "\n :host { display: block; }\n .error-alert-icon,\n .error-alert-icon-container {\n color: var(--odus-color-error, #e53e3e) !important;\n }\n .error-alert-message {\n color: var(--odus-color-text, #1a1a1a) !important;\n }\n ";
983
+ return super.getCss() + ce + "\n :host { display: block; }\n .error-alert-icon,\n .error-alert-icon-container {\n color: var(--odus-color-error, #e53e3e) !important;\n }\n .error-alert-message {\n color: var(--odus-color-text, #1a1a1a) !important;\n }\n ";
983
984
  }
984
985
  getValue() {
985
986
  return null;
@@ -990,7 +991,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
990
991
  getError() {
991
992
  return this._message;
992
993
  }
993
- }, Z = ".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}", ne = {
994
+ }, Z = ".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}", le = {
994
995
  name: "odus-elements",
995
996
  styles: {
996
997
  fontSize: 14,
@@ -1014,7 +1015,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1014
1015
  }
1015
1016
  },
1016
1017
  additionalPaymentMethods: {}
1017
- }, Q = class extends E {
1018
+ }, Q = class extends D {
1018
1019
  _paymentContext = null;
1019
1020
  _button = null;
1020
1021
  setPaymentContext(e) {
@@ -1023,8 +1024,8 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1023
1024
  render() {
1024
1025
  if (!this.shadowRoot || (this._button?.getElement().remove(), this._button = null, !this._paymentContext)) return;
1025
1026
  let { onAuthorize: e } = this._paymentContext;
1026
- this._button = new h({
1027
- checkoutProfile: ne,
1027
+ this._button = new ie({
1028
+ checkoutProfile: le,
1028
1029
  onSubmit: async () => {
1029
1030
  this._button?.setSubmitting(!0);
1030
1031
  try {
@@ -1047,7 +1048,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1047
1048
  getError() {
1048
1049
  return null;
1049
1050
  }
1050
- }, re = ".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}", ie = {
1051
+ }, ue = ".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}", de = {
1051
1052
  name: "odus-elements",
1052
1053
  styles: {
1053
1054
  fontSize: 14,
@@ -1071,7 +1072,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1071
1072
  }
1072
1073
  },
1073
1074
  additionalPaymentMethods: {}
1074
- }, $ = class extends E {
1075
+ }, $ = class extends D {
1075
1076
  _phone = "";
1076
1077
  _error = null;
1077
1078
  _field = null;
@@ -1080,14 +1081,14 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1080
1081
  if (!this.shadowRoot) return;
1081
1082
  this._field?.destroy(), this._field?.getElement().remove(), this._field = null, this.options.initialValue && !this._phone && (this._phone = String(this.options.initialValue));
1082
1083
  let e = ++this._renderGeneration;
1083
- ee().then(({ PhoneNumberField: n }) => {
1084
+ a().then(({ PhoneNumberField: t }) => {
1084
1085
  if (!this.shadowRoot || this._renderGeneration !== e) return;
1085
- let { t: r, locale: i } = t();
1086
- this._field = new n({
1086
+ let { t: n, locale: i } = r();
1087
+ this._field = new t({
1087
1088
  value: this._phone,
1088
1089
  error: !1,
1089
- checkoutProfile: ie,
1090
- translationFunc: r,
1090
+ checkoutProfile: de,
1091
+ translationFunc: n,
1091
1092
  locale: i,
1092
1093
  label: this.options.label,
1093
1094
  placeholder: this.options.placeholder,
@@ -1097,7 +1098,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1097
1098
  },
1098
1099
  onBlur: () => {
1099
1100
  this._phone = this._field?.getValue() ?? "";
1100
- let e = a(), t = this._field?.getCountry();
1101
+ let e = c(), t = this._field?.getCountry();
1101
1102
  this._error = e.phoneNumber(this._phone, t) ?? null, this._field?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._phone);
1102
1103
  }
1103
1104
  }), this.shadowRoot.appendChild(this._field.getElement());
@@ -1105,29 +1106,31 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1105
1106
  }
1106
1107
  getCss() {
1107
1108
  return super.getCss() + [
1108
- C,
1109
1109
  w,
1110
- S,
1111
- re
1110
+ T,
1111
+ C,
1112
+ ue
1112
1113
  ].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 ";
1113
1114
  }
1114
1115
  getValue() {
1115
1116
  return this._phone;
1116
1117
  }
1117
1118
  getIsValid() {
1118
- let e = a(), t = this._field?.getCountry();
1119
+ let e = c(), t = this._field?.getCountry();
1119
1120
  return !e.phoneNumber(this._phone, t);
1120
1121
  }
1121
1122
  getError() {
1122
1123
  return this._error;
1123
1124
  }
1124
- }, ae = class {
1125
+ }, fe = class {
1125
1126
  _config;
1126
1127
  _apiService;
1127
1128
  _changeListeners = [];
1128
1129
  _callbacks;
1129
1130
  _paymentState = {};
1130
1131
  _fontCleanup;
1132
+ _sessionId;
1133
+ _mountedReported = !1;
1131
1134
  _card;
1132
1135
  _email;
1133
1136
  _phone;
@@ -1144,18 +1147,22 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1144
1147
  _error;
1145
1148
  elements;
1146
1149
  constructor(e) {
1147
- this._config = e, this._callbacks = { ...e.callbacks }, e.locale && b.setLocale(e.locale), this._apiService = new o(e.apiKey, e.environment);
1150
+ this._config = e, this._callbacks = { ...e.callbacks }, this._sessionId = crypto.randomUUID(), p({
1151
+ environment: e.environment,
1152
+ sessionId: this._sessionId,
1153
+ integration: "elements"
1154
+ }), s(h.CHECKOUT_INITIALIZED, { environment: e.environment }), e.locale && n.setLocale(e.locale), this._apiService = new f(e.apiKey, e.environment);
1148
1155
  let t = {};
1149
1156
  Object.defineProperty(t, "email", {
1150
- get: () => (this._email || (this._email = new J(), this._trackElement(this._email)), this._email),
1157
+ get: () => (this._email || (this._email = new Y(), this._trackElement(this._email)), this._email),
1151
1158
  enumerable: !0
1152
1159
  }), Object.defineProperty(t, "phone", {
1153
1160
  get: () => (this._phone || (this._phone = new $(), this._trackElement(this._phone)), this._phone),
1154
1161
  enumerable: !0
1155
1162
  });
1156
- let n = {};
1157
- Object.defineProperty(n, "applePay", {
1158
- get: () => (this._applePay || (this._applePay = new L(), this._trackElement(this._applePay), this._paymentState.paymentId && this._paymentState.checkoutKey && this._applePay.setPaymentContext({
1163
+ let r = {};
1164
+ Object.defineProperty(r, "applePay", {
1165
+ get: () => (this._applePay || (this._applePay = new z(), this._trackElement(this._applePay), this._paymentState.paymentId && this._paymentState.checkoutKey && this._applePay.setPaymentContext({
1159
1166
  paymentId: this._paymentState.paymentId,
1160
1167
  checkoutKey: this._paymentState.checkoutKey,
1161
1168
  environment: this._config.environment,
@@ -1167,7 +1174,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1167
1174
  })
1168
1175
  })), this._applePay),
1169
1176
  enumerable: !0
1170
- }), Object.defineProperty(n, "payPal", {
1177
+ }), Object.defineProperty(r, "payPal", {
1171
1178
  get: () => (this._paypal || (this._paypal = new Q(), this._trackElement(this._paypal), this._paymentState.paymentId && this._paymentState.checkoutKey && this._paypal.setPaymentContext({
1172
1179
  paymentId: this._paymentState.paymentId,
1173
1180
  checkoutKey: this._paymentState.checkoutKey,
@@ -1175,62 +1182,74 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1175
1182
  })), this._paypal),
1176
1183
  enumerable: !0
1177
1184
  });
1178
- let r = {};
1179
- Object.defineProperty(r, "street", {
1180
- get: () => (this._addressStreet || (this._addressStreet = new P(), this._trackElement(this._addressStreet)), this._addressStreet),
1185
+ let i = {};
1186
+ Object.defineProperty(i, "street", {
1187
+ get: () => (this._addressStreet || (this._addressStreet = new F(), this._trackElement(this._addressStreet)), this._addressStreet),
1181
1188
  enumerable: !0
1182
- }), Object.defineProperty(r, "firstName", {
1183
- get: () => (this._addressFirstName || (this._addressFirstName = new A(), this._trackElement(this._addressFirstName)), this._addressFirstName),
1189
+ }), Object.defineProperty(i, "firstName", {
1190
+ get: () => (this._addressFirstName || (this._addressFirstName = new j(), this._trackElement(this._addressFirstName)), this._addressFirstName),
1184
1191
  enumerable: !0
1185
- }), Object.defineProperty(r, "lastName", {
1186
- get: () => (this._addressLastName || (this._addressLastName = new j(), this._trackElement(this._addressLastName)), this._addressLastName),
1192
+ }), Object.defineProperty(i, "lastName", {
1193
+ get: () => (this._addressLastName || (this._addressLastName = new M(), this._trackElement(this._addressLastName)), this._addressLastName),
1187
1194
  enumerable: !0
1188
- }), Object.defineProperty(r, "city", {
1189
- get: () => (this._addressCity || (this._addressCity = new D(), this._trackElement(this._addressCity)), this._addressCity),
1195
+ }), Object.defineProperty(i, "city", {
1196
+ get: () => (this._addressCity || (this._addressCity = new O(), this._trackElement(this._addressCity)), this._addressCity),
1190
1197
  enumerable: !0
1191
- }), Object.defineProperty(r, "state", {
1192
- get: () => (this._addressState || (this._addressState = new N(), this._trackElement(this._addressState), this._addressCountry?.value && this._addressState.setCountry(this._addressCountry.value)), this._addressState),
1198
+ }), Object.defineProperty(i, "state", {
1199
+ get: () => (this._addressState || (this._addressState = new P(), this._trackElement(this._addressState), this._addressCountry?.value && this._addressState.setCountry(this._addressCountry.value)), this._addressState),
1193
1200
  enumerable: !0
1194
- }), Object.defineProperty(r, "zipCode", {
1195
- get: () => (this._addressZipCode || (this._addressZipCode = new F(), this._trackElement(this._addressZipCode)), this._addressZipCode),
1201
+ }), Object.defineProperty(i, "zipCode", {
1202
+ get: () => (this._addressZipCode || (this._addressZipCode = new I(), this._trackElement(this._addressZipCode)), this._addressZipCode),
1196
1203
  enumerable: !0
1197
- }), Object.defineProperty(r, "country", {
1198
- get: () => (this._addressCountry || (this._addressCountry = new k(), this._trackElement(this._addressCountry), this._addressCountry.on("change", (e) => {
1204
+ }), Object.defineProperty(i, "country", {
1205
+ get: () => (this._addressCountry || (this._addressCountry = new A(), this._trackElement(this._addressCountry), this._addressCountry.on("change", (e) => {
1199
1206
  this._addressState?.setCountry(e);
1200
1207
  })), this._addressCountry),
1201
1208
  enumerable: !0
1202
1209
  });
1203
- let i = {
1210
+ let a = {
1204
1211
  contact: t,
1205
- express: n
1212
+ express: r
1206
1213
  };
1207
- Object.defineProperty(i, "card", {
1208
- get: () => (this._card || (this._card = new G(), this._card.setEnvironment(this._config.environment), this._trackElement(this._card), this._paymentState.vgsJwt && this._card.setVgsJwt(this._paymentState.vgsJwt)), this._card),
1214
+ Object.defineProperty(a, "card", {
1215
+ get: () => (this._card || (this._card = new q(), this._card.setEnvironment(this._config.environment), this._trackElement(this._card), this._paymentState.vgsJwt && this._card.setVgsJwt(this._paymentState.vgsJwt)), this._card),
1209
1216
  enumerable: !0
1210
- }), Object.defineProperty(i, "cardholderName", {
1211
- get: () => (this._cardholderName || (this._cardholderName = new K(), this._trackElement(this._cardholderName)), this._cardholderName),
1217
+ }), Object.defineProperty(a, "cardholderName", {
1218
+ get: () => (this._cardholderName || (this._cardholderName = new J(), this._trackElement(this._cardholderName)), this._cardholderName),
1212
1219
  enumerable: !0
1213
- }), Object.defineProperty(i, "address", {
1214
- get: () => r,
1220
+ }), Object.defineProperty(a, "address", {
1221
+ get: () => i,
1215
1222
  enumerable: !0
1216
- }), Object.defineProperty(i, "error", {
1223
+ }), Object.defineProperty(a, "error", {
1217
1224
  get: () => (this._error || (this._error = new X(), this._trackElement(this._error)), this._error),
1218
1225
  enumerable: !0
1219
- }), this.elements = i;
1226
+ }), this.elements = a;
1220
1227
  }
1221
1228
  async associatePayment(e, t) {
1222
1229
  if (!e || !t) throw Error("paymentId and checkoutKey are required");
1223
1230
  this._paymentState.paymentId = e, this._paymentState.checkoutKey = t;
1224
- let n = await r({
1225
- id: e,
1226
- checkoutKey: t,
1227
- environment: this._config.environment
1228
- });
1231
+ let n;
1232
+ try {
1233
+ n = await g({
1234
+ id: e,
1235
+ checkoutKey: t,
1236
+ environment: this._config.environment
1237
+ });
1238
+ } catch (t) {
1239
+ throw s(h.PAYMENT_ASSOCIATION_FAILED, {
1240
+ payment_id: e,
1241
+ error_message: t instanceof Error ? t.message : "Unknown error"
1242
+ }), i(t instanceof Error ? t : Error("Failed to associate payment"), { payment_id: e }), t;
1243
+ }
1229
1244
  this._paymentState.checkoutDetails = {
1230
1245
  amount: n.amount,
1231
1246
  currency: n.currency,
1232
1247
  countryCode: n.countryCode
1233
- }, n.vgsJwt && (this._paymentState.vgsJwt = n.vgsJwt, this._card?.setVgsJwt(n.vgsJwt)), this._card?.setEnvironment(this._config.environment), this._applePay?.setPaymentContext({
1248
+ }, s(h.PAYMENT_ASSOCIATED, {
1249
+ payment_id: e,
1250
+ currency: n.currency,
1251
+ country_code: n.countryCode
1252
+ }), n.vgsJwt && (this._paymentState.vgsJwt = n.vgsJwt, this._card?.setVgsJwt(n.vgsJwt)), this._card?.setEnvironment(this._config.environment), this._applePay?.setPaymentContext({
1234
1253
  paymentId: e,
1235
1254
  checkoutKey: t,
1236
1255
  environment: this._config.environment,
@@ -1247,8 +1266,8 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1247
1266
  });
1248
1267
  }
1249
1268
  validate() {
1250
- let e = {}, { t: n } = t();
1251
- return this._card?.isMounted && !this._card.isValid && (e.card = this._card.error ?? n("validation.cardNumberInvalid")), this._email?.isMounted && !this._email.isValid && (e.email = this._email.error ?? n("validation.emailInvalid")), this._phone?.isMounted && !this._phone.isValid && (e.phone = this._phone.error ?? n("validation.phoneNumberInvalid")), this._addressStreet?.isMounted && !this._addressStreet.isValid && (e["address.street"] = this._addressStreet.error ?? n("validation.addressLine1Required")), this._addressCity?.isMounted && !this._addressCity.isValid && (e["address.city"] = this._addressCity.error ?? n("validation.townCityRequired")), this._addressCountry?.isMounted && !this._addressCountry.isValid && (e["address.country"] = this._addressCountry.error ?? n("validation.countryRequired")), this._addressFirstName?.isMounted && !this._addressFirstName.isValid && (e["address.firstName"] = this._addressFirstName.error ?? n("validation.firstNameRequired")), this._addressLastName?.isMounted && !this._addressLastName.isValid && (e["address.lastName"] = this._addressLastName.error ?? n("validation.lastNameRequired")), this._cardholderName?.isMounted && !this._cardholderName.isValid && (e.cardholderName = this._cardholderName.error ?? n("validation.nameRequired")), this._addressState?.isMounted && !this._addressState.isValid && (e["address.state"] = this._addressState.error ?? n("validation.stateRequired")), this._addressZipCode?.isMounted && !this._addressZipCode.isValid && (e["address.zipCode"] = this._addressZipCode.error ?? n("validation.postalCodeRequired")), this._applePay?.isMounted && !this._applePay.isValid && (e.applePay = "Apple Pay authorization required"), this._paypal?.isMounted && !this._paypal.isValid && (e.paypal = "PayPal authorization required"), {
1269
+ let e = {}, { t } = r();
1270
+ return this._card?.isMounted && !this._card.isValid && (e.card = this._card.error ?? t("validation.cardNumberInvalid")), this._email?.isMounted && !this._email.isValid && (e.email = this._email.error ?? t("validation.emailInvalid")), this._phone?.isMounted && !this._phone.isValid && (e.phone = this._phone.error ?? t("validation.phoneNumberInvalid")), this._addressStreet?.isMounted && !this._addressStreet.isValid && (e["address.street"] = this._addressStreet.error ?? t("validation.addressLine1Required")), this._addressCity?.isMounted && !this._addressCity.isValid && (e["address.city"] = this._addressCity.error ?? t("validation.townCityRequired")), this._addressCountry?.isMounted && !this._addressCountry.isValid && (e["address.country"] = this._addressCountry.error ?? t("validation.countryRequired")), this._addressFirstName?.isMounted && !this._addressFirstName.isValid && (e["address.firstName"] = this._addressFirstName.error ?? t("validation.firstNameRequired")), this._addressLastName?.isMounted && !this._addressLastName.isValid && (e["address.lastName"] = this._addressLastName.error ?? t("validation.lastNameRequired")), this._cardholderName?.isMounted && !this._cardholderName.isValid && (e.cardholderName = this._cardholderName.error ?? t("validation.nameRequired")), this._addressState?.isMounted && !this._addressState.isValid && (e["address.state"] = this._addressState.error ?? t("validation.stateRequired")), this._addressZipCode?.isMounted && !this._addressZipCode.isValid && (e["address.zipCode"] = this._addressZipCode.error ?? t("validation.postalCodeRequired")), this._applePay?.isMounted && !this._applePay.isValid && (e.applePay = "Apple Pay authorization required"), this._paypal?.isMounted && !this._paypal.isValid && (e.paypal = "PayPal authorization required"), {
1252
1271
  valid: Object.keys(e).length === 0,
1253
1272
  errors: e
1254
1273
  };
@@ -1314,7 +1333,7 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1314
1333
  let t = e["--odus-font-family"];
1315
1334
  if (t) {
1316
1335
  this._fontCleanup?.();
1317
- let { cleanup: e } = s({ fontFamily: t });
1336
+ let { cleanup: e } = u({ fontFamily: t });
1318
1337
  this._fontCleanup = e;
1319
1338
  }
1320
1339
  for (let t of this._allElements()) t.setTheme(e);
@@ -1336,7 +1355,9 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1336
1355
  Object.assign(this._callbacks, e);
1337
1356
  }
1338
1357
  _trackElement(e) {
1339
- e.on("change", () => {
1358
+ e.on("ready", () => {
1359
+ this._mountedReported || (this._mountedReported = !0, s(h.CHECKOUT_MOUNTED, { container_id: "elements" }));
1360
+ }), e.on("change", () => {
1340
1361
  for (let e of this._changeListeners) e();
1341
1362
  });
1342
1363
  }
@@ -1360,37 +1381,71 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1360
1381
  }
1361
1382
  async _executeAuthorization({ formData: e, applePayData: t, customCustomerData: n }) {
1362
1383
  this._emitLoadingState(!0);
1384
+ let r = this._paymentState.paymentId, i = this._getPaymentMethod(e, t);
1385
+ s(h.PAYMENT_SUBMIT_STARTED, {
1386
+ payment_id: r,
1387
+ payment_method: i
1388
+ });
1389
+ let a = performance.now();
1363
1390
  try {
1364
- let r = await this._apiService.authorizePayment({
1365
- paymentId: this._paymentState.paymentId,
1391
+ let c = await this._apiService.authorizePayment({
1392
+ paymentId: r,
1366
1393
  checkoutKey: this._paymentState.checkoutKey,
1367
1394
  formData: e,
1368
1395
  returnUrl: this._config.returnUrl,
1369
1396
  applePayData: t,
1370
1397
  customCustomerData: n
1371
1398
  });
1372
- this._handlePaymentResponse(r);
1399
+ o(m.PAYMENT_AUTHORIZATION_TIME, performance.now() - a, "ms", {
1400
+ payment_id: r,
1401
+ payment_method: i,
1402
+ status: "success"
1403
+ }), s(h.PAYMENT_SUBMIT_SUCCESS, {
1404
+ payment_id: r,
1405
+ payment_method: i
1406
+ }), this._handlePaymentResponse(c);
1373
1407
  } catch (e) {
1374
- this._handleAuthorizationError(e);
1408
+ o(m.PAYMENT_AUTHORIZATION_TIME, performance.now() - a, "ms", {
1409
+ payment_id: r,
1410
+ payment_method: i,
1411
+ status: "failed"
1412
+ }), s(h.PAYMENT_SUBMIT_FAILED, {
1413
+ payment_id: r,
1414
+ payment_method: i,
1415
+ error_message: e.details?.message ?? "Unknown error"
1416
+ }), this._handleAuthorizationError(e);
1375
1417
  } finally {
1376
1418
  this._emitLoadingState(!1);
1377
1419
  }
1378
1420
  }
1421
+ _getPaymentMethod(e, t) {
1422
+ return t ? "apple_pay" : e === null ? "paypal" : "card";
1423
+ }
1379
1424
  _emitLoadingState(e) {
1380
1425
  try {
1381
1426
  this._callbacks.onLoadingStateChange?.(e);
1382
1427
  } catch {}
1383
1428
  }
1384
1429
  _handlePaymentResponse(e) {
1430
+ let t = this._paymentState.paymentId ?? "";
1385
1431
  if (e.latestTransaction.status === "authorized") {
1386
- this._callbacks.onPaymentSucceeded?.(e.latestTransaction.status);
1432
+ s(h.PAYMENT_AUTHORIZED, {
1433
+ payment_id: t,
1434
+ status: e.latestTransaction.status
1435
+ }), this._callbacks.onPaymentSucceeded?.(e.latestTransaction.status);
1387
1436
  return;
1388
1437
  }
1389
1438
  if (e.latestTransaction.status === "failed") {
1390
- this._callbacks.onPaymentFailed?.(e.latestTransaction.status);
1439
+ s(h.PAYMENT_FAILED, {
1440
+ payment_id: t,
1441
+ status: e.latestTransaction.status
1442
+ }), this._callbacks.onPaymentFailed?.(e.latestTransaction.status);
1391
1443
  return;
1392
1444
  }
1393
- e.status === "requires_action" && this._callbacks.onActionRequired?.(e.action.redirectUrl);
1445
+ e.status === "requires_action" && (s(h.PAYMENT_ACTION_REQUIRED, {
1446
+ payment_id: t,
1447
+ status: e.status
1448
+ }), this._callbacks.onActionRequired?.(e.action.redirectUrl));
1394
1449
  }
1395
1450
  _handleAuthorizationError(e) {
1396
1451
  let t = e.details?.message ?? "Payment failed";
@@ -1398,4 +1453,4 @@ var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
1398
1453
  }
1399
1454
  };
1400
1455
  //#endregion
1401
- export { D as AddressCityElement, k as AddressCountryElement, A as AddressFirstNameElement, j as AddressLastNameElement, N as AddressStateElement, P as AddressStreetElement, F as AddressZipCodeElement, L as ApplePayElement, E as BaseElement, G as CardElement, K as CardholderElement, J as EmailElement, X as ErrorElement, ae as OdusElements, Q as PayPalElement, $ as PhoneElement };
1456
+ export { O as AddressCityElement, A as AddressCountryElement, j as AddressFirstNameElement, M as AddressLastNameElement, P as AddressStateElement, F as AddressStreetElement, I as AddressZipCodeElement, z as ApplePayElement, D as BaseElement, q as CardElement, J as CardholderElement, Y as EmailElement, X as ErrorElement, fe as OdusElements, Q as PayPalElement, $ as PhoneElement };