xactsize-webcomponents 1.0.46 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- const Yt = (i, t, e) => {
1
+ const qt = (i, t, e) => {
2
2
  const s = i[t];
3
- return s ? typeof s == "function" ? s() : Promise.resolve(s) : new Promise((o, n) => {
3
+ return s ? typeof s == "function" ? s() : Promise.resolve(s) : new Promise((o, r) => {
4
4
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
5
- n.bind(
5
+ r.bind(
6
6
  null,
7
7
  new Error(
8
8
  "Unknown variable dynamic import: " + t + (t.split("/").length !== e ? ". Note that variables only represent file names one level deep." : "")
@@ -16,7 +16,7 @@ const Yt = (i, t, e) => {
16
16
  * Copyright 2019 Google LLC
17
17
  * SPDX-License-Identifier: BSD-3-Clause
18
18
  */
19
- const X = globalThis, yt = X.ShadowRoot && (X.ShadyCSS === void 0 || X.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, _t = Symbol(), bt = /* @__PURE__ */ new WeakMap();
19
+ const J = globalThis, yt = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, _t = Symbol(), Et = /* @__PURE__ */ new WeakMap();
20
20
  let Pt = class {
21
21
  constructor(t, e, s) {
22
22
  if (this._$cssResult$ = !0, s !== _t) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
@@ -27,7 +27,7 @@ let Pt = class {
27
27
  const e = this.t;
28
28
  if (yt && t === void 0) {
29
29
  const s = e !== void 0 && e.length === 1;
30
- s && (t = bt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && bt.set(e, t));
30
+ s && (t = Et.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Et.set(e, t));
31
31
  }
32
32
  return t;
33
33
  }
@@ -35,30 +35,30 @@ let Pt = class {
35
35
  return this.cssText;
36
36
  }
37
37
  };
38
- const Kt = (i) => new Pt(typeof i == "string" ? i : i + "", void 0, _t), P = (i, ...t) => {
39
- const e = i.length === 1 ? i[0] : t.reduce((s, o, n) => s + ((r) => {
40
- if (r._$cssResult$ === !0) return r.cssText;
41
- if (typeof r == "number") return r;
42
- throw Error("Value passed to 'css' function must be a 'css' function result: " + r + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
43
- })(o) + i[n + 1], i[0]);
38
+ const Yt = (i) => new Pt(typeof i == "string" ? i : i + "", void 0, _t), N = (i, ...t) => {
39
+ const e = i.length === 1 ? i[0] : t.reduce((s, o, r) => s + ((n) => {
40
+ if (n._$cssResult$ === !0) return n.cssText;
41
+ if (typeof n == "number") return n;
42
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
43
+ })(o) + i[r + 1], i[0]);
44
44
  return new Pt(e, i, _t);
45
45
  }, Qt = (i, t) => {
46
46
  if (yt) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
47
47
  else for (const e of t) {
48
- const s = document.createElement("style"), o = X.litNonce;
48
+ const s = document.createElement("style"), o = J.litNonce;
49
49
  o !== void 0 && s.setAttribute("nonce", o), s.textContent = e.cssText, i.appendChild(s);
50
50
  }
51
- }, wt = yt ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
51
+ }, bt = yt ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
52
52
  let e = "";
53
53
  for (const s of t.cssRules) e += s.cssText;
54
- return Kt(e);
54
+ return Yt(e);
55
55
  })(i) : i;
56
56
  /**
57
57
  * @license
58
58
  * Copyright 2017 Google LLC
59
59
  * SPDX-License-Identifier: BSD-3-Clause
60
60
  */
61
- const { is: Xt, defineProperty: Jt, getOwnPropertyDescriptor: te, getOwnPropertyNames: ee, getOwnPropertySymbols: ie, getPrototypeOf: se } = Object, $ = globalThis, Et = $.trustedTypes, oe = Et ? Et.emptyScript : "", rt = $.reactiveElementPolyfillSupport, z = (i, t) => i, J = { toAttribute(i, t) {
61
+ const { is: Xt, defineProperty: Jt, getOwnPropertyDescriptor: te, getOwnPropertyNames: ee, getOwnPropertySymbols: ie, getPrototypeOf: se } = Object, $ = globalThis, wt = $.trustedTypes, oe = wt ? wt.emptyScript : "", rt = $.reactiveElementPolyfillSupport, z = (i, t) => i, tt = { toAttribute(i, t) {
62
62
  switch (t) {
63
63
  case Boolean:
64
64
  i = i ? oe : null;
@@ -86,9 +86,9 @@ const { is: Xt, defineProperty: Jt, getOwnPropertyDescriptor: te, getOwnProperty
86
86
  }
87
87
  }
88
88
  return e;
89
- } }, xt = (i, t) => !Xt(i, t), At = { attribute: !0, type: String, converter: J, reflect: !1, useDefault: !1, hasChanged: xt };
89
+ } }, xt = (i, t) => !Xt(i, t), At = { attribute: !0, type: String, converter: tt, reflect: !1, useDefault: !1, hasChanged: xt };
90
90
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), $.litPropertyMetadata ?? ($.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
91
- let I = class extends HTMLElement {
91
+ let D = class extends HTMLElement {
92
92
  static addInitializer(t) {
93
93
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
94
94
  }
@@ -102,14 +102,14 @@ let I = class extends HTMLElement {
102
102
  }
103
103
  }
104
104
  static getPropertyDescriptor(t, e, s) {
105
- const { get: o, set: n } = te(this.prototype, t) ?? { get() {
105
+ const { get: o, set: r } = te(this.prototype, t) ?? { get() {
106
106
  return this[e];
107
- }, set(r) {
108
- this[e] = r;
107
+ }, set(n) {
108
+ this[e] = n;
109
109
  } };
110
- return { get: o, set(r) {
110
+ return { get: o, set(n) {
111
111
  const l = o == null ? void 0 : o.call(this);
112
- n == null || n.call(this, r), this.requestUpdate(t, l, s);
112
+ r == null || r.call(this, n), this.requestUpdate(t, l, s);
113
113
  }, configurable: !0, enumerable: !0 };
114
114
  }
115
115
  static getPropertyOptions(t) {
@@ -142,8 +142,8 @@ let I = class extends HTMLElement {
142
142
  const e = [];
143
143
  if (Array.isArray(t)) {
144
144
  const s = new Set(t.flat(1 / 0).reverse());
145
- for (const o of s) e.unshift(wt(o));
146
- } else t !== void 0 && e.push(wt(t));
145
+ for (const o of s) e.unshift(bt(o));
146
+ } else t !== void 0 && e.push(bt(t));
147
147
  return e;
148
148
  }
149
149
  static _$Eu(t, e) {
@@ -194,32 +194,32 @@ let I = class extends HTMLElement {
194
194
  this._$AK(t, s);
195
195
  }
196
196
  _$ET(t, e) {
197
- var n;
197
+ var r;
198
198
  const s = this.constructor.elementProperties.get(t), o = this.constructor._$Eu(t, s);
199
199
  if (o !== void 0 && s.reflect === !0) {
200
- const r = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : J).toAttribute(e, s.type);
201
- this._$Em = t, r == null ? this.removeAttribute(o) : this.setAttribute(o, r), this._$Em = null;
200
+ const n = (((r = s.converter) == null ? void 0 : r.toAttribute) !== void 0 ? s.converter : tt).toAttribute(e, s.type);
201
+ this._$Em = t, n == null ? this.removeAttribute(o) : this.setAttribute(o, n), this._$Em = null;
202
202
  }
203
203
  }
204
204
  _$AK(t, e) {
205
- var n, r;
205
+ var r, n;
206
206
  const s = this.constructor, o = s._$Eh.get(t);
207
207
  if (o !== void 0 && this._$Em !== o) {
208
- const l = s.getPropertyOptions(o), h = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((n = l.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? l.converter : J;
209
- this._$Em = o, this[o] = h.fromAttribute(e, l.type) ?? ((r = this._$Ej) == null ? void 0 : r.get(o)) ?? null, this._$Em = null;
208
+ const l = s.getPropertyOptions(o), h = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((r = l.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? l.converter : tt;
209
+ this._$Em = o, this[o] = h.fromAttribute(e, l.type) ?? ((n = this._$Ej) == null ? void 0 : n.get(o)) ?? null, this._$Em = null;
210
210
  }
211
211
  }
212
212
  requestUpdate(t, e, s) {
213
213
  var o;
214
214
  if (t !== void 0) {
215
- const n = this.constructor, r = this[t];
216
- if (s ?? (s = n.getPropertyOptions(t)), !((s.hasChanged ?? xt)(r, e) || s.useDefault && s.reflect && r === ((o = this._$Ej) == null ? void 0 : o.get(t)) && !this.hasAttribute(n._$Eu(t, s)))) return;
215
+ const r = this.constructor, n = this[t];
216
+ if (s ?? (s = r.getPropertyOptions(t)), !((s.hasChanged ?? xt)(n, e) || s.useDefault && s.reflect && n === ((o = this._$Ej) == null ? void 0 : o.get(t)) && !this.hasAttribute(r._$Eu(t, s)))) return;
217
217
  this.C(t, e, s);
218
218
  }
219
219
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
220
220
  }
221
- C(t, e, { useDefault: s, reflect: o, wrapped: n }, r) {
222
- s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, r ?? e ?? this[t]), n !== !0 || r !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), o === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
221
+ C(t, e, { useDefault: s, reflect: o, wrapped: r }, n) {
222
+ s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), r !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), o === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
223
223
  }
224
224
  async _$EP() {
225
225
  this.isUpdatePending = !0;
@@ -239,21 +239,21 @@ let I = class extends HTMLElement {
239
239
  if (!this.isUpdatePending) return;
240
240
  if (!this.hasUpdated) {
241
241
  if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
242
- for (const [n, r] of this._$Ep) this[n] = r;
242
+ for (const [r, n] of this._$Ep) this[r] = n;
243
243
  this._$Ep = void 0;
244
244
  }
245
245
  const o = this.constructor.elementProperties;
246
- if (o.size > 0) for (const [n, r] of o) {
247
- const { wrapped: l } = r, h = this[n];
248
- l !== !0 || this._$AL.has(n) || h === void 0 || this.C(n, void 0, r, h);
246
+ if (o.size > 0) for (const [r, n] of o) {
247
+ const { wrapped: l } = n, h = this[r];
248
+ l !== !0 || this._$AL.has(r) || h === void 0 || this.C(r, void 0, n, h);
249
249
  }
250
250
  }
251
251
  let t = !1;
252
252
  const e = this._$AL;
253
253
  try {
254
254
  t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((o) => {
255
- var n;
256
- return (n = o.hostUpdate) == null ? void 0 : n.call(o);
255
+ var r;
256
+ return (r = o.hostUpdate) == null ? void 0 : r.call(o);
257
257
  }), this.update(e)) : this._$EM();
258
258
  } catch (o) {
259
259
  throw t = !1, this._$EM(), o;
@@ -289,74 +289,74 @@ let I = class extends HTMLElement {
289
289
  firstUpdated(t) {
290
290
  }
291
291
  };
292
- I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[z("elementProperties")] = /* @__PURE__ */ new Map(), I[z("finalized")] = /* @__PURE__ */ new Map(), rt == null || rt({ ReactiveElement: I }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.1.0");
292
+ D.elementStyles = [], D.shadowRootOptions = { mode: "open" }, D[z("elementProperties")] = /* @__PURE__ */ new Map(), D[z("finalized")] = /* @__PURE__ */ new Map(), rt == null || rt({ ReactiveElement: D }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.1.0");
293
293
  /**
294
294
  * @license
295
295
  * Copyright 2017 Google LLC
296
296
  * SPDX-License-Identifier: BSD-3-Clause
297
297
  */
298
- const N = globalThis, tt = N.trustedTypes, $t = tt ? tt.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, Vt = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, Ft = "?" + A, ne = `<${Ft}>`, R = document, B = () => R.createComment(""), Z = (i) => i === null || typeof i != "object" && typeof i != "function", Ct = Array.isArray, re = (i) => Ct(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", at = `[
299
- \f\r]`, F = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Mt = /-->/g, St = />/g, M = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
300
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Lt = /'/g, kt = /"/g, zt = /^(?:script|style|textarea|title)$/i, ae = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), g = ae(1), T = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), Rt = /* @__PURE__ */ new WeakMap(), L = R.createTreeWalker(R, 129);
301
- function Nt(i, t) {
298
+ const B = globalThis, et = B.trustedTypes, St = et ? et.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, Nt = "$lit$", S = `lit$${Math.random().toFixed(9).slice(2)}$`, Vt = "?" + S, ne = `<${Vt}>`, T = document, Z = () => T.createComment(""), j = (i) => i === null || typeof i != "object" && typeof i != "function", Ct = Array.isArray, re = (i) => Ct(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", at = `[
299
+ \f\r]`, F = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, $t = /-->/g, Mt = />/g, M = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
300
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Lt = /'/g, kt = /"/g, Ft = /^(?:script|style|textarea|title)$/i, ae = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), g = ae(1), O = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), Rt = /* @__PURE__ */ new WeakMap(), k = T.createTreeWalker(T, 129);
301
+ function zt(i, t) {
302
302
  if (!Ct(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
303
- return $t !== void 0 ? $t.createHTML(t) : t;
303
+ return St !== void 0 ? St.createHTML(t) : t;
304
304
  }
305
305
  const le = (i, t) => {
306
306
  const e = i.length - 1, s = [];
307
- let o, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", r = F;
307
+ let o, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = F;
308
308
  for (let l = 0; l < e; l++) {
309
309
  const h = i[l];
310
310
  let u, f, m = -1, b = 0;
311
- for (; b < h.length && (r.lastIndex = b, f = r.exec(h), f !== null); ) b = r.lastIndex, r === F ? f[1] === "!--" ? r = Mt : f[1] !== void 0 ? r = St : f[2] !== void 0 ? (zt.test(f[2]) && (o = RegExp("</" + f[2], "g")), r = M) : f[3] !== void 0 && (r = M) : r === M ? f[0] === ">" ? (r = o ?? F, m = -1) : f[1] === void 0 ? m = -2 : (m = r.lastIndex - f[2].length, u = f[1], r = f[3] === void 0 ? M : f[3] === '"' ? kt : Lt) : r === kt || r === Lt ? r = M : r === Mt || r === St ? r = F : (r = M, o = void 0);
312
- const E = r === M && i[l + 1].startsWith("/>") ? " " : "";
313
- n += r === F ? h + ne : m >= 0 ? (s.push(u), h.slice(0, m) + Vt + h.slice(m) + A + E) : h + A + (m === -2 ? l : E);
311
+ for (; b < h.length && (n.lastIndex = b, f = n.exec(h), f !== null); ) b = n.lastIndex, n === F ? f[1] === "!--" ? n = $t : f[1] !== void 0 ? n = Mt : f[2] !== void 0 ? (Ft.test(f[2]) && (o = RegExp("</" + f[2], "g")), n = M) : f[3] !== void 0 && (n = M) : n === M ? f[0] === ">" ? (n = o ?? F, m = -1) : f[1] === void 0 ? m = -2 : (m = n.lastIndex - f[2].length, u = f[1], n = f[3] === void 0 ? M : f[3] === '"' ? kt : Lt) : n === kt || n === Lt ? n = M : n === $t || n === Mt ? n = F : (n = M, o = void 0);
312
+ const A = n === M && i[l + 1].startsWith("/>") ? " " : "";
313
+ r += n === F ? h + ne : m >= 0 ? (s.push(u), h.slice(0, m) + Nt + h.slice(m) + S + A) : h + S + (m === -2 ? l : A);
314
314
  }
315
- return [Nt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
315
+ return [zt(i, r + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
316
316
  };
317
- class j {
317
+ class G {
318
318
  constructor({ strings: t, _$litType$: e }, s) {
319
319
  let o;
320
320
  this.parts = [];
321
- let n = 0, r = 0;
321
+ let r = 0, n = 0;
322
322
  const l = t.length - 1, h = this.parts, [u, f] = le(t, e);
323
- if (this.el = j.createElement(u, s), L.currentNode = this.el.content, e === 2 || e === 3) {
323
+ if (this.el = G.createElement(u, s), k.currentNode = this.el.content, e === 2 || e === 3) {
324
324
  const m = this.el.content.firstChild;
325
325
  m.replaceWith(...m.childNodes);
326
326
  }
327
- for (; (o = L.nextNode()) !== null && h.length < l; ) {
327
+ for (; (o = k.nextNode()) !== null && h.length < l; ) {
328
328
  if (o.nodeType === 1) {
329
- if (o.hasAttributes()) for (const m of o.getAttributeNames()) if (m.endsWith(Vt)) {
330
- const b = f[r++], E = o.getAttribute(m).split(A), K = /([.?@])?(.*)/.exec(b);
331
- h.push({ type: 1, index: n, name: K[2], strings: E, ctor: K[1] === "." ? ce : K[1] === "?" ? de : K[1] === "@" ? pe : ot }), o.removeAttribute(m);
332
- } else m.startsWith(A) && (h.push({ type: 6, index: n }), o.removeAttribute(m));
333
- if (zt.test(o.tagName)) {
334
- const m = o.textContent.split(A), b = m.length - 1;
329
+ if (o.hasAttributes()) for (const m of o.getAttributeNames()) if (m.endsWith(Nt)) {
330
+ const b = f[n++], A = o.getAttribute(m).split(S), Q = /([.?@])?(.*)/.exec(b);
331
+ h.push({ type: 1, index: r, name: Q[2], strings: A, ctor: Q[1] === "." ? ce : Q[1] === "?" ? de : Q[1] === "@" ? pe : ot }), o.removeAttribute(m);
332
+ } else m.startsWith(S) && (h.push({ type: 6, index: r }), o.removeAttribute(m));
333
+ if (Ft.test(o.tagName)) {
334
+ const m = o.textContent.split(S), b = m.length - 1;
335
335
  if (b > 0) {
336
- o.textContent = tt ? tt.emptyScript : "";
337
- for (let E = 0; E < b; E++) o.append(m[E], B()), L.nextNode(), h.push({ type: 2, index: ++n });
338
- o.append(m[b], B());
336
+ o.textContent = et ? et.emptyScript : "";
337
+ for (let A = 0; A < b; A++) o.append(m[A], Z()), k.nextNode(), h.push({ type: 2, index: ++r });
338
+ o.append(m[b], Z());
339
339
  }
340
340
  }
341
- } else if (o.nodeType === 8) if (o.data === Ft) h.push({ type: 2, index: n });
341
+ } else if (o.nodeType === 8) if (o.data === Vt) h.push({ type: 2, index: r });
342
342
  else {
343
343
  let m = -1;
344
- for (; (m = o.data.indexOf(A, m + 1)) !== -1; ) h.push({ type: 7, index: n }), m += A.length - 1;
344
+ for (; (m = o.data.indexOf(S, m + 1)) !== -1; ) h.push({ type: 7, index: r }), m += S.length - 1;
345
345
  }
346
- n++;
346
+ r++;
347
347
  }
348
348
  }
349
349
  static createElement(t, e) {
350
- const s = R.createElement("template");
350
+ const s = T.createElement("template");
351
351
  return s.innerHTML = t, s;
352
352
  }
353
353
  }
354
- function H(i, t, e = i, s) {
355
- var r, l;
356
- if (t === T) return t;
357
- let o = s !== void 0 ? (r = e._$Co) == null ? void 0 : r[s] : e._$Cl;
358
- const n = Z(t) ? void 0 : t._$litDirective$;
359
- return (o == null ? void 0 : o.constructor) !== n && ((l = o == null ? void 0 : o._$AO) == null || l.call(o, !1), n === void 0 ? o = void 0 : (o = new n(i), o._$AT(i, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = o : e._$Cl = o), o !== void 0 && (t = H(i, o._$AS(i, t.values), o, s)), t;
354
+ function U(i, t, e = i, s) {
355
+ var n, l;
356
+ if (t === O) return t;
357
+ let o = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl;
358
+ const r = j(t) ? void 0 : t._$litDirective$;
359
+ return (o == null ? void 0 : o.constructor) !== r && ((l = o == null ? void 0 : o._$AO) == null || l.call(o, !1), r === void 0 ? o = void 0 : (o = new r(i), o._$AT(i, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = o : e._$Cl = o), o !== void 0 && (t = U(i, o._$AS(i, t.values), o, s)), t;
360
360
  }
361
361
  class he {
362
362
  constructor(t, e) {
@@ -369,17 +369,17 @@ class he {
369
369
  return this._$AM._$AU;
370
370
  }
371
371
  u(t) {
372
- const { el: { content: e }, parts: s } = this._$AD, o = ((t == null ? void 0 : t.creationScope) ?? R).importNode(e, !0);
373
- L.currentNode = o;
374
- let n = L.nextNode(), r = 0, l = 0, h = s[0];
372
+ const { el: { content: e }, parts: s } = this._$AD, o = ((t == null ? void 0 : t.creationScope) ?? T).importNode(e, !0);
373
+ k.currentNode = o;
374
+ let r = k.nextNode(), n = 0, l = 0, h = s[0];
375
375
  for (; h !== void 0; ) {
376
- if (r === h.index) {
376
+ if (n === h.index) {
377
377
  let u;
378
- h.type === 2 ? u = new W(n, n.nextSibling, this, t) : h.type === 1 ? u = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (u = new ue(n, this, t)), this._$AV.push(u), h = s[++l];
378
+ h.type === 2 ? u = new W(r, r.nextSibling, this, t) : h.type === 1 ? u = new h.ctor(r, h.name, h.strings, this, t) : h.type === 6 && (u = new ue(r, this, t)), this._$AV.push(u), h = s[++l];
379
379
  }
380
- r !== (h == null ? void 0 : h.index) && (n = L.nextNode(), r++);
380
+ n !== (h == null ? void 0 : h.index) && (r = k.nextNode(), n++);
381
381
  }
382
- return L.currentNode = R, o;
382
+ return k.currentNode = T, o;
383
383
  }
384
384
  p(t) {
385
385
  let e = 0;
@@ -406,7 +406,7 @@ class W {
406
406
  return this._$AB;
407
407
  }
408
408
  _$AI(t, e = this) {
409
- t = H(this, t, e), Z(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== T && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : re(t) ? this.k(t) : this._(t);
409
+ t = U(this, t, e), j(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== O && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : re(t) ? this.k(t) : this._(t);
410
410
  }
411
411
  O(t) {
412
412
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -415,26 +415,26 @@ class W {
415
415
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
416
416
  }
417
417
  _(t) {
418
- this._$AH !== y && Z(this._$AH) ? this._$AA.nextSibling.data = t : this.T(R.createTextNode(t)), this._$AH = t;
418
+ this._$AH !== y && j(this._$AH) ? this._$AA.nextSibling.data = t : this.T(T.createTextNode(t)), this._$AH = t;
419
419
  }
420
420
  $(t) {
421
- var n;
422
- const { values: e, _$litType$: s } = t, o = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = j.createElement(Nt(s.h, s.h[0]), this.options)), s);
423
- if (((n = this._$AH) == null ? void 0 : n._$AD) === o) this._$AH.p(e);
421
+ var r;
422
+ const { values: e, _$litType$: s } = t, o = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = G.createElement(zt(s.h, s.h[0]), this.options)), s);
423
+ if (((r = this._$AH) == null ? void 0 : r._$AD) === o) this._$AH.p(e);
424
424
  else {
425
- const r = new he(o, this), l = r.u(this.options);
426
- r.p(e), this.T(l), this._$AH = r;
425
+ const n = new he(o, this), l = n.u(this.options);
426
+ n.p(e), this.T(l), this._$AH = n;
427
427
  }
428
428
  }
429
429
  _$AC(t) {
430
430
  let e = Rt.get(t.strings);
431
- return e === void 0 && Rt.set(t.strings, e = new j(t)), e;
431
+ return e === void 0 && Rt.set(t.strings, e = new G(t)), e;
432
432
  }
433
433
  k(t) {
434
434
  Ct(this._$AH) || (this._$AH = [], this._$AR());
435
435
  const e = this._$AH;
436
436
  let s, o = 0;
437
- for (const n of t) o === e.length ? e.push(s = new W(this.O(B()), this.O(B()), this, this.options)) : s = e[o], s._$AI(n), o++;
437
+ for (const r of t) o === e.length ? e.push(s = new W(this.O(Z()), this.O(Z()), this, this.options)) : s = e[o], s._$AI(r), o++;
438
438
  o < e.length && (this._$AR(s && s._$AB.nextSibling, o), e.length = o);
439
439
  }
440
440
  _$AR(t = this._$AA.nextSibling, e) {
@@ -456,19 +456,19 @@ class ot {
456
456
  get _$AU() {
457
457
  return this._$AM._$AU;
458
458
  }
459
- constructor(t, e, s, o, n) {
460
- this.type = 1, this._$AH = y, this._$AN = void 0, this.element = t, this.name = e, this._$AM = o, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = y;
459
+ constructor(t, e, s, o, r) {
460
+ this.type = 1, this._$AH = y, this._$AN = void 0, this.element = t, this.name = e, this._$AM = o, this.options = r, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = y;
461
461
  }
462
462
  _$AI(t, e = this, s, o) {
463
- const n = this.strings;
464
- let r = !1;
465
- if (n === void 0) t = H(this, t, e, 0), r = !Z(t) || t !== this._$AH && t !== T, r && (this._$AH = t);
463
+ const r = this.strings;
464
+ let n = !1;
465
+ if (r === void 0) t = U(this, t, e, 0), n = !j(t) || t !== this._$AH && t !== O, n && (this._$AH = t);
466
466
  else {
467
467
  const l = t;
468
468
  let h, u;
469
- for (t = n[0], h = 0; h < n.length - 1; h++) u = H(this, l[s + h], e, h), u === T && (u = this._$AH[h]), r || (r = !Z(u) || u !== this._$AH[h]), u === y ? t = y : t !== y && (t += (u ?? "") + n[h + 1]), this._$AH[h] = u;
469
+ for (t = r[0], h = 0; h < r.length - 1; h++) u = U(this, l[s + h], e, h), u === O && (u = this._$AH[h]), n || (n = !j(u) || u !== this._$AH[h]), u === y ? t = y : t !== y && (t += (u ?? "") + r[h + 1]), this._$AH[h] = u;
470
470
  }
471
- r && !o && this.j(t);
471
+ n && !o && this.j(t);
472
472
  }
473
473
  j(t) {
474
474
  t === y ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
@@ -491,13 +491,13 @@ class de extends ot {
491
491
  }
492
492
  }
493
493
  class pe extends ot {
494
- constructor(t, e, s, o, n) {
495
- super(t, e, s, o, n), this.type = 5;
494
+ constructor(t, e, s, o, r) {
495
+ super(t, e, s, o, r), this.type = 5;
496
496
  }
497
497
  _$AI(t, e = this) {
498
- if ((t = H(this, t, e, 0) ?? y) === T) return;
499
- const s = this._$AH, o = t === y && s !== y || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== y && (s === y || o);
500
- o && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
498
+ if ((t = U(this, t, e, 0) ?? y) === O) return;
499
+ const s = this._$AH, o = t === y && s !== y || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== y && (s === y || o);
500
+ o && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
501
501
  }
502
502
  handleEvent(t) {
503
503
  var e;
@@ -512,17 +512,17 @@ class ue {
512
512
  return this._$AM._$AU;
513
513
  }
514
514
  _$AI(t) {
515
- H(this, t);
515
+ U(this, t);
516
516
  }
517
517
  }
518
- const lt = N.litHtmlPolyfillSupport;
519
- lt == null || lt(j, W), (N.litHtmlVersions ?? (N.litHtmlVersions = [])).push("3.3.0");
518
+ const lt = B.litHtmlPolyfillSupport;
519
+ lt == null || lt(G, W), (B.litHtmlVersions ?? (B.litHtmlVersions = [])).push("3.3.0");
520
520
  const fe = (i, t, e) => {
521
521
  const s = (e == null ? void 0 : e.renderBefore) ?? t;
522
522
  let o = s._$litPart$;
523
523
  if (o === void 0) {
524
- const n = (e == null ? void 0 : e.renderBefore) ?? null;
525
- s._$litPart$ = o = new W(t.insertBefore(B(), n), n, void 0, e ?? {});
524
+ const r = (e == null ? void 0 : e.renderBefore) ?? null;
525
+ s._$litPart$ = o = new W(t.insertBefore(Z(), r), r, void 0, e ?? {});
526
526
  }
527
527
  return o._$AI(i), o;
528
528
  };
@@ -531,8 +531,8 @@ const fe = (i, t, e) => {
531
531
  * Copyright 2017 Google LLC
532
532
  * SPDX-License-Identifier: BSD-3-Clause
533
533
  */
534
- const k = globalThis;
535
- let C = class extends I {
534
+ const R = globalThis;
535
+ let v = class extends D {
536
536
  constructor() {
537
537
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
538
538
  }
@@ -554,14 +554,14 @@ let C = class extends I {
554
554
  super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
555
555
  }
556
556
  render() {
557
- return T;
557
+ return O;
558
558
  }
559
559
  };
560
560
  var Ut;
561
- C._$litElement$ = !0, C.finalized = !0, (Ut = k.litElementHydrateSupport) == null || Ut.call(k, { LitElement: C });
562
- const ht = k.litElementPolyfillSupport;
563
- ht == null || ht({ LitElement: C });
564
- (k.litElementVersions ?? (k.litElementVersions = [])).push("4.2.0");
561
+ v._$litElement$ = !0, v.finalized = !0, (Ut = R.litElementHydrateSupport) == null || Ut.call(R, { LitElement: v });
562
+ const ht = R.litElementPolyfillSupport;
563
+ ht == null || ht({ LitElement: v });
564
+ (R.litElementVersions ?? (R.litElementVersions = [])).push("4.2.0");
565
565
  /**
566
566
  * @license
567
567
  * Copyright 2017 Google LLC
@@ -577,31 +577,31 @@ const V = (i) => (t, e) => {
577
577
  * Copyright 2017 Google LLC
578
578
  * SPDX-License-Identifier: BSD-3-Clause
579
579
  */
580
- const me = { attribute: !0, type: String, converter: J, reflect: !1, hasChanged: xt }, ge = (i = me, t, e) => {
580
+ const me = { attribute: !0, type: String, converter: tt, reflect: !1, hasChanged: xt }, ge = (i = me, t, e) => {
581
581
  const { kind: s, metadata: o } = e;
582
- let n = globalThis.litPropertyMetadata.get(o);
583
- if (n === void 0 && globalThis.litPropertyMetadata.set(o, n = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), n.set(e.name, i), s === "accessor") {
584
- const { name: r } = e;
582
+ let r = globalThis.litPropertyMetadata.get(o);
583
+ if (r === void 0 && globalThis.litPropertyMetadata.set(o, r = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), r.set(e.name, i), s === "accessor") {
584
+ const { name: n } = e;
585
585
  return { set(l) {
586
586
  const h = t.get.call(this);
587
- t.set.call(this, l), this.requestUpdate(r, h, i);
587
+ t.set.call(this, l), this.requestUpdate(n, h, i);
588
588
  }, init(l) {
589
- return l !== void 0 && this.C(r, void 0, i, l), l;
589
+ return l !== void 0 && this.C(n, void 0, i, l), l;
590
590
  } };
591
591
  }
592
592
  if (s === "setter") {
593
- const { name: r } = e;
593
+ const { name: n } = e;
594
594
  return function(l) {
595
- const h = this[r];
596
- t.call(this, l), this.requestUpdate(r, h, i);
595
+ const h = this[n];
596
+ t.call(this, l), this.requestUpdate(n, h, i);
597
597
  };
598
598
  }
599
599
  throw Error("Unsupported decorator location: " + s);
600
600
  };
601
601
  function d(i) {
602
- return (t, e) => typeof e == "object" ? ge(i, t, e) : ((s, o, n) => {
603
- const r = o.hasOwnProperty(n);
604
- return o.constructor.createProperty(n, s), r ? Object.getOwnPropertyDescriptor(o, n) : void 0;
602
+ return (t, e) => typeof e == "object" ? ge(i, t, e) : ((s, o, r) => {
603
+ const n = o.hasOwnProperty(r);
604
+ return o.constructor.createProperty(r, s), n ? Object.getOwnPropertyDescriptor(o, r) : void 0;
605
605
  })(i, t, e);
606
606
  }
607
607
  /**
@@ -663,13 +663,13 @@ class ve {
663
663
  window.removeEventListener(pt, this.__litLocalizeEventHandler);
664
664
  }
665
665
  }
666
- const be = (i) => i.addController(new ve(i)), we = be;
666
+ const Ee = (i) => i.addController(new ve(i)), be = Ee;
667
667
  /**
668
668
  * @license
669
669
  * Copyright 2021 Google LLC
670
670
  * SPDX-License-Identifier: BSD-3-Clause
671
671
  */
672
- const q = () => (i, t) => (i.addInitializer(we), i);
672
+ const q = () => (i, t) => (i.addInitializer(be), i);
673
673
  /**
674
674
  * @license
675
675
  * Copyright 2020 Google LLC
@@ -696,20 +696,20 @@ class jt {
696
696
  const w = [];
697
697
  for (let i = 0; i < 256; i++)
698
698
  w[i] = (i >> 4 & 15).toString(16) + (i & 15).toString(16);
699
- function Ee(i) {
700
- let t = 0, e = 8997, s = 0, o = 33826, n = 0, r = 40164, l = 0, h = 52210;
699
+ function we(i) {
700
+ let t = 0, e = 8997, s = 0, o = 33826, r = 0, n = 40164, l = 0, h = 52210;
701
701
  for (let u = 0; u < i.length; u++)
702
- e ^= i.charCodeAt(u), t = e * 435, s = o * 435, n = r * 435, l = h * 435, n += e << 8, l += o << 8, s += t >>> 16, e = t & 65535, n += s >>> 16, o = s & 65535, h = l + (n >>> 16) & 65535, r = n & 65535;
703
- return w[h >> 8] + w[h & 255] + w[r >> 8] + w[r & 255] + w[o >> 8] + w[o & 255] + w[e >> 8] + w[e & 255];
702
+ e ^= i.charCodeAt(u), t = e * 435, s = o * 435, r = n * 435, l = h * 435, r += e << 8, l += o << 8, s += t >>> 16, e = t & 65535, r += s >>> 16, o = s & 65535, h = l + (r >>> 16) & 65535, n = r & 65535;
703
+ return w[h >> 8] + w[h & 255] + w[n >> 8] + w[n & 255] + w[o >> 8] + w[o & 255] + w[e >> 8] + w[e & 255];
704
704
  }
705
705
  /**
706
706
  * @license
707
707
  * Copyright 2020 Google LLC
708
708
  * SPDX-License-Identifier: BSD-3-Clause
709
709
  */
710
- const Ae = "", $e = "h", Me = "s";
711
- function Se(i, t) {
712
- return (t ? $e : Me) + Ee(typeof i == "string" ? i : i.join(Ae));
710
+ const Ae = "", Se = "h", $e = "s";
711
+ function Me(i, t) {
712
+ return (t ? Se : $e) + we(typeof i == "string" ? i : i.join(Ae));
713
713
  }
714
714
  /**
715
715
  * @license
@@ -732,10 +732,10 @@ function Le(i, t, e) {
732
732
  o.values
733
733
  );
734
734
  {
735
- let n = Ot.get(o);
736
- return n === void 0 && (n = o.values, Ot.set(o, n)), {
735
+ let r = Ot.get(o);
736
+ return r === void 0 && (r = o.values, Ot.set(o, r)), {
737
737
  ...o,
738
- values: n.map((r) => t.values[r])
738
+ values: r.map((n) => t.values[n])
739
739
  };
740
740
  }
741
741
  }
@@ -745,7 +745,7 @@ function Le(i, t, e) {
745
745
  function ke(i) {
746
746
  const t = typeof i == "string" ? i : i.strings;
747
747
  let e = It.get(t);
748
- return e === void 0 && (e = Se(t, typeof i != "string" && !("strTag" in i)), It.set(t, e)), e;
748
+ return e === void 0 && (e = Me(t, typeof i != "string" && !("strTag" in i)), It.set(t, e)), e;
749
749
  }
750
750
  /**
751
751
  * @license
@@ -755,33 +755,33 @@ function ke(i) {
755
755
  function ct(i) {
756
756
  window.dispatchEvent(new CustomEvent(pt, { detail: i }));
757
757
  }
758
- let et = "", dt, Gt, it, ut, Wt, S = new jt();
759
- S.resolve();
760
- let Q = 0;
761
- const Re = (i) => (Ce((t, e) => Le(Wt, t, e)), et = Gt = i.sourceLocale, it = new Set(i.targetLocales), it.add(i.sourceLocale), ut = i.loadLocale, { getLocale: Te, setLocale: Oe }), Te = () => et, Oe = (i) => {
762
- if (i === (dt ?? et))
763
- return S.promise;
764
- if (!it || !ut)
758
+ let it = "", dt, Gt, st, ut, Kt, L = new jt();
759
+ L.resolve();
760
+ let X = 0;
761
+ const Re = (i) => (Ce((t, e) => Le(Kt, t, e)), it = Gt = i.sourceLocale, st = new Set(i.targetLocales), st.add(i.sourceLocale), ut = i.loadLocale, { getLocale: Te, setLocale: Oe }), Te = () => it, Oe = (i) => {
762
+ if (i === (dt ?? it))
763
+ return L.promise;
764
+ if (!st || !ut)
765
765
  throw new Error("Internal error");
766
- if (!it.has(i))
766
+ if (!st.has(i))
767
767
  throw new Error("Invalid locale code");
768
- Q++;
769
- const t = Q;
770
- return dt = i, S.settled && (S = new jt()), ct({ status: "loading", loadingLocale: i }), (i === Gt ? (
768
+ X++;
769
+ const t = X;
770
+ return dt = i, L.settled && (L = new jt()), ct({ status: "loading", loadingLocale: i }), (i === Gt ? (
771
771
  // We could switch to the source locale synchronously, but we prefer to
772
772
  // queue it on a microtask so that switching locales is consistently
773
773
  // asynchronous.
774
774
  Promise.resolve({ templates: void 0 })
775
775
  ) : ut(i)).then((s) => {
776
- Q === t && (et = i, dt = void 0, Wt = s.templates, ct({ status: "ready", readyLocale: i }), S.resolve());
776
+ X === t && (it = i, dt = void 0, Kt = s.templates, ct({ status: "ready", readyLocale: i }), L.resolve());
777
777
  }, (s) => {
778
- Q === t && (ct({
778
+ X === t && (ct({
779
779
  status: "error",
780
780
  errorLocale: i,
781
781
  errorMessage: s.toString()
782
- }), S.reject(s));
783
- }), S.promise;
784
- }, qt = "en", Ie = [
782
+ }), L.reject(s));
783
+ }), L.promise;
784
+ }, Wt = "en", Ie = [
785
785
  "es-MX",
786
786
  "pt-BR"
787
787
  ];
@@ -823,25 +823,25 @@ const Pe = He(class extends Ue {
823
823
  update(i, [t]) {
824
824
  var s, o;
825
825
  if (this.st === void 0) {
826
- this.st = /* @__PURE__ */ new Set(), i.strings !== void 0 && (this.nt = new Set(i.strings.join(" ").split(/\s/).filter((n) => n !== "")));
827
- for (const n in t) t[n] && !((s = this.nt) != null && s.has(n)) && this.st.add(n);
826
+ this.st = /* @__PURE__ */ new Set(), i.strings !== void 0 && (this.nt = new Set(i.strings.join(" ").split(/\s/).filter((r) => r !== "")));
827
+ for (const r in t) t[r] && !((s = this.nt) != null && s.has(r)) && this.st.add(r);
828
828
  return this.render(t);
829
829
  }
830
830
  const e = i.element.classList;
831
- for (const n of this.st) n in t || (e.remove(n), this.st.delete(n));
832
- for (const n in t) {
833
- const r = !!t[n];
834
- r === this.st.has(n) || (o = this.nt) != null && o.has(n) || (r ? (e.add(n), this.st.add(n)) : (e.remove(n), this.st.delete(n)));
831
+ for (const r of this.st) r in t || (e.remove(r), this.st.delete(r));
832
+ for (const r in t) {
833
+ const n = !!t[r];
834
+ n === this.st.has(r) || (o = this.nt) != null && o.has(r) || (n ? (e.add(r), this.st.add(r)) : (e.remove(r), this.st.delete(r)));
835
835
  }
836
- return T;
836
+ return O;
837
837
  }
838
838
  });
839
- var Ve = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, Y = (i, t, e, s) => {
840
- for (var o = s > 1 ? void 0 : s ? Fe(t, e) : t, n = i.length - 1, r; n >= 0; n--)
841
- (r = i[n]) && (o = (s ? r(t, e, o) : r(o)) || o);
842
- return s && o && Ve(t, e, o), o;
839
+ var Ne = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, Y = (i, t, e, s) => {
840
+ for (var o = s > 1 ? void 0 : s ? Ve(t, e) : t, r = i.length - 1, n; r >= 0; r--)
841
+ (n = i[r]) && (o = (s ? n(t, e, o) : n(o)) || o);
842
+ return s && o && Ne(t, e, o), o;
843
843
  };
844
- let O = class extends C {
844
+ let I = class extends v {
845
845
  constructor() {
846
846
  super(...arguments), this.type = "button", this.label = "", this.disabled = !1, this.variant = "contained";
847
847
  }
@@ -860,7 +860,7 @@ let O = class extends C {
860
860
  `;
861
861
  }
862
862
  };
863
- O.styles = P`
863
+ I.styles = N`
864
864
  :host {
865
865
  display: block;
866
866
  width: 100%;
@@ -943,25 +943,25 @@ O.styles = P`
943
943
  `;
944
944
  Y([
945
945
  d({ type: String })
946
- ], O.prototype, "type", 2);
946
+ ], I.prototype, "type", 2);
947
947
  Y([
948
948
  d({ type: String })
949
- ], O.prototype, "label", 2);
949
+ ], I.prototype, "label", 2);
950
950
  Y([
951
951
  d({ type: Boolean })
952
- ], O.prototype, "disabled", 2);
952
+ ], I.prototype, "disabled", 2);
953
953
  Y([
954
954
  d({ type: String })
955
- ], O.prototype, "variant", 2);
956
- O = Y([
955
+ ], I.prototype, "variant", 2);
956
+ I = Y([
957
957
  V("xact-button")
958
- ], O);
959
- var ze = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, nt = (i, t, e, s) => {
960
- for (var o = s > 1 ? void 0 : s ? Ne(t, e) : t, n = i.length - 1, r; n >= 0; n--)
961
- (r = i[n]) && (o = (s ? r(t, e, o) : r(o)) || o);
962
- return s && o && ze(t, e, o), o;
958
+ ], I);
959
+ var Fe = Object.defineProperty, ze = Object.getOwnPropertyDescriptor, nt = (i, t, e, s) => {
960
+ for (var o = s > 1 ? void 0 : s ? ze(t, e) : t, r = i.length - 1, n; r >= 0; r--)
961
+ (n = i[r]) && (o = (s ? n(t, e, o) : n(o)) || o);
962
+ return s && o && Fe(t, e, o), o;
963
963
  };
964
- let U = class extends C {
964
+ let P = class extends v {
965
965
  constructor() {
966
966
  super(...arguments), this.height = 0, this.brandName = "", this.handleStart = () => {
967
967
  var t;
@@ -1033,7 +1033,7 @@ let U = class extends C {
1033
1033
  `;
1034
1034
  }
1035
1035
  };
1036
- U.styles = P`
1036
+ P.styles = N`
1037
1037
  :host {
1038
1038
  display: block;
1039
1039
  font-family: 'Inter', 'Helvetica', Arial, sans-serif;
@@ -1211,23 +1211,23 @@ U.styles = P`
1211
1211
  `;
1212
1212
  nt([
1213
1213
  d({ type: Number })
1214
- ], U.prototype, "height", 2);
1214
+ ], P.prototype, "height", 2);
1215
1215
  nt([
1216
1216
  d({ type: String })
1217
- ], U.prototype, "brandName", 2);
1217
+ ], P.prototype, "brandName", 2);
1218
1218
  nt([
1219
1219
  d({ type: Function })
1220
- ], U.prototype, "onStartMeasurement", 2);
1221
- U = nt([
1220
+ ], P.prototype, "onStartMeasurement", 2);
1221
+ P = nt([
1222
1222
  V("xact-step-one"),
1223
1223
  q()
1224
- ], U);
1224
+ ], P);
1225
1225
  var Be = Object.getOwnPropertyDescriptor, Ze = (i, t, e, s) => {
1226
- for (var o = s > 1 ? void 0 : s ? Be(t, e) : t, n = i.length - 1, r; n >= 0; n--)
1227
- (r = i[n]) && (o = r(o) || o);
1226
+ for (var o = s > 1 ? void 0 : s ? Be(t, e) : t, r = i.length - 1, n; r >= 0; r--)
1227
+ (n = i[r]) && (o = n(o) || o);
1228
1228
  return o;
1229
1229
  };
1230
- let ft = class extends C {
1230
+ let ft = class extends v {
1231
1231
  render() {
1232
1232
  return g`
1233
1233
  <footer class="modal-footer">
@@ -1275,7 +1275,7 @@ let ft = class extends C {
1275
1275
  `;
1276
1276
  }
1277
1277
  };
1278
- ft.styles = P`
1278
+ ft.styles = N`
1279
1279
  .modal-footer {
1280
1280
  text-align: center;
1281
1281
  font-size: 12px;
@@ -1316,12 +1316,12 @@ ft = Ze([
1316
1316
  V("xact-footer"),
1317
1317
  q()
1318
1318
  ], ft);
1319
- var je = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, v = (i, t, e, s) => {
1320
- for (var o = s > 1 ? void 0 : s ? Ge(t, e) : t, n = i.length - 1, r; n >= 0; n--)
1321
- (r = i[n]) && (o = (s ? r(t, e, o) : r(o)) || o);
1319
+ var je = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, E = (i, t, e, s) => {
1320
+ for (var o = s > 1 ? void 0 : s ? Ge(t, e) : t, r = i.length - 1, n; r >= 0; r--)
1321
+ (n = i[r]) && (o = (s ? n(t, e, o) : n(o)) || o);
1322
1322
  return s && o && je(t, e, o), o;
1323
1323
  };
1324
- let x = class extends C {
1324
+ let x = class extends v {
1325
1325
  constructor() {
1326
1326
  super(...arguments), this.productName = "", this.recommendedSize = "", this.productSku = "", this.garmentUrl = "", this.generatedImageUrl = "", this.isVtonFetching = !1, this.vtonError = !1;
1327
1327
  }
@@ -1444,7 +1444,7 @@ let x = class extends C {
1444
1444
  `;
1445
1445
  }
1446
1446
  };
1447
- x.styles = P`
1447
+ x.styles = N`
1448
1448
  :host {
1449
1449
  display: flex;
1450
1450
  flex-direction: column;
@@ -1527,43 +1527,43 @@ x.styles = P`
1527
1527
  }
1528
1528
  }
1529
1529
  `;
1530
- v([
1530
+ E([
1531
1531
  d({ type: String })
1532
1532
  ], x.prototype, "productName", 2);
1533
- v([
1533
+ E([
1534
1534
  d({ type: String })
1535
1535
  ], x.prototype, "recommendedSize", 2);
1536
- v([
1536
+ E([
1537
1537
  d({ type: String })
1538
1538
  ], x.prototype, "productSku", 2);
1539
- v([
1539
+ E([
1540
1540
  d({ type: String })
1541
1541
  ], x.prototype, "garmentUrl", 2);
1542
- v([
1542
+ E([
1543
1543
  d({ type: String })
1544
1544
  ], x.prototype, "generatedImageUrl", 2);
1545
- v([
1545
+ E([
1546
1546
  d({ type: Boolean })
1547
1547
  ], x.prototype, "isVtonFetching", 2);
1548
- v([
1548
+ E([
1549
1549
  d({ type: Boolean })
1550
1550
  ], x.prototype, "vtonError", 2);
1551
- v([
1551
+ E([
1552
1552
  d({ type: Function })
1553
1553
  ], x.prototype, "onAccept", 2);
1554
- v([
1554
+ E([
1555
1555
  d({ type: Function })
1556
1556
  ], x.prototype, "onRetry", 2);
1557
- x = v([
1557
+ x = E([
1558
1558
  V("xact-step-result"),
1559
1559
  q()
1560
1560
  ], x);
1561
- var We = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, vt = (i, t, e, s) => {
1562
- for (var o = s > 1 ? void 0 : s ? qe(t, e) : t, n = i.length - 1, r; n >= 0; n--)
1563
- (r = i[n]) && (o = (s ? r(t, e, o) : r(o)) || o);
1564
- return s && o && We(t, e, o), o;
1561
+ var Ke = Object.defineProperty, We = Object.getOwnPropertyDescriptor, vt = (i, t, e, s) => {
1562
+ for (var o = s > 1 ? void 0 : s ? We(t, e) : t, r = i.length - 1, n; r >= 0; r--)
1563
+ (n = i[r]) && (o = (s ? n(t, e, o) : n(o)) || o);
1564
+ return s && o && Ke(t, e, o), o;
1565
1565
  };
1566
- let G = class extends C {
1566
+ let K = class extends v {
1567
1567
  constructor() {
1568
1568
  super(...arguments), this.height = 0;
1569
1569
  }
@@ -1722,7 +1722,7 @@ let G = class extends C {
1722
1722
  `;
1723
1723
  }
1724
1724
  };
1725
- G.styles = P`
1725
+ K.styles = N`
1726
1726
  :host {
1727
1727
  display: flex;
1728
1728
  justify-content: center;
@@ -1916,15 +1916,15 @@ G.styles = P`
1916
1916
  `;
1917
1917
  vt([
1918
1918
  d({ type: Number })
1919
- ], G.prototype, "height", 2);
1919
+ ], K.prototype, "height", 2);
1920
1920
  vt([
1921
1921
  d({ type: Function })
1922
- ], G.prototype, "onStep2advancement", 2);
1923
- G = vt([
1922
+ ], K.prototype, "onStep2advancement", 2);
1923
+ K = vt([
1924
1924
  V("xact-step-informs"),
1925
1925
  q()
1926
- ], G);
1927
- const Dt = "data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%200%2022%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200L0%2013.3362V0H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.339L0%2026.6724V13.3362H21.517V13.339Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.6755L0%2040.0089V26.6726H21.517V26.6755Z'%20fill='%231C28BA'/%3e%3c/svg%3e", Ye = "data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.00878906L0%2013.345V0.00878906H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.3478L0%2026.6812V13.345H21.517V13.3478Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2026.6843L0%2040.0176V26.6814H21.517V26.6843Z'%20fill='white'/%3e%3c/svg%3e", Ke = "data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.0204381L0%2013.3538V0.0175781H21.517V0.0204381Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2013.3538L0%2026.69V13.3538H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.693L0%2040.0264V26.6902H21.517V26.693Z'%20fill='white'/%3e%3c/svg%3e", D = class D {
1926
+ ], K);
1927
+ const Dt = "data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%200%2022%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200L0%2013.3362V0H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.339L0%2026.6724V13.3362H21.517V13.339Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.6755L0%2040.0089V26.6726H21.517V26.6755Z'%20fill='%231C28BA'/%3e%3c/svg%3e", qe = "data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.00878906L0%2013.345V0.00878906H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.3478L0%2026.6812V13.345H21.517V13.3478Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2026.6843L0%2040.0176V26.6814H21.517V26.6843Z'%20fill='white'/%3e%3c/svg%3e", Ye = "data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.0204381L0%2013.3538V0.0175781H21.517V0.0204381Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2013.3538L0%2026.69V13.3538H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.693L0%2040.0264V26.6902H21.517V26.693Z'%20fill='white'/%3e%3c/svg%3e", H = class H {
1928
1928
  constructor() {
1929
1929
  this.audioContext = null, this.playbackCtx = null, this.stream = null, this.processor = null, this.source = null, this.audioPlaybackQueue = [], this.isPlaying = !1, this.isUserSpeaking = !1, this.speechTimeout = null;
1930
1930
  }
@@ -1940,11 +1940,11 @@ const Dt = "data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%20
1940
1940
  let o = 0;
1941
1941
  for (let l = 0; l < s.length; l++)
1942
1942
  o += s[l] * s[l];
1943
- Math.sqrt(o / s.length) > D.SPEECH_THRESHOLD && (this.isUserSpeaking = !0, this.speechTimeout && clearTimeout(this.speechTimeout), this.speechTimeout = window.setTimeout(() => {
1943
+ Math.sqrt(o / s.length) > H.SPEECH_THRESHOLD && (this.isUserSpeaking = !0, this.speechTimeout && clearTimeout(this.speechTimeout), this.speechTimeout = window.setTimeout(() => {
1944
1944
  this.isUserSpeaking = !1;
1945
- }, D.SPEECH_HOLD_TIME));
1946
- const r = this.float32ToInt16(s);
1947
- t(r.buffer);
1945
+ }, H.SPEECH_HOLD_TIME));
1946
+ const n = this.float32ToInt16(s);
1947
+ t(n.buffer);
1948
1948
  }, this.source.connect(this.processor), this.processor.connect(this.audioContext.destination);
1949
1949
  } catch (e) {
1950
1950
  console.error("Microphone access denied or error:", e);
@@ -1970,14 +1970,14 @@ const Dt = "data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%20
1970
1970
  const t = this.audioPlaybackQueue.shift();
1971
1971
  this.isPlaying = !0;
1972
1972
  const e = new Int16Array(t), s = new Float32Array(e.length);
1973
- for (let r = 0; r < e.length; r++)
1974
- s[r] = e[r] / 32767;
1973
+ for (let n = 0; n < e.length; n++)
1974
+ s[n] = e[n] / 32767;
1975
1975
  const o = this.playbackCtx.createBuffer(1, s.length, 24e3);
1976
1976
  o.copyToChannel(s, 0);
1977
- const n = this.playbackCtx.createBufferSource();
1978
- n.buffer = o, n.connect(this.playbackCtx.destination), n.onended = () => {
1977
+ const r = this.playbackCtx.createBufferSource();
1978
+ r.buffer = o, r.connect(this.playbackCtx.destination), r.onended = () => {
1979
1979
  this.isPlaying = !1, this.audioPlaybackQueue.length === 0 && this.onQueueDrained && this.onQueueDrained(), this.playNextChunk();
1980
- }, n.start();
1980
+ }, r.start();
1981
1981
  }
1982
1982
  clearPlaybackQueue() {
1983
1983
  this.audioPlaybackQueue = [];
@@ -1986,9 +1986,9 @@ const Dt = "data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%20
1986
1986
  this.clearPlaybackQueue(), this.processor && this.source && (this.processor.disconnect(), this.source.disconnect()), this.stream && (this.stream.getTracks().forEach((t) => t.stop()), this.stream = null), this.audioContext && (this.audioContext.close(), this.audioContext = null), this.playbackCtx && (this.playbackCtx.close(), this.playbackCtx = null);
1987
1987
  }
1988
1988
  };
1989
- D.SPEECH_THRESHOLD = 0.02, D.SPEECH_HOLD_TIME = 1500;
1990
- let mt = D;
1991
- const st = class st {
1989
+ H.SPEECH_THRESHOLD = 0.02, H.SPEECH_HOLD_TIME = 1500;
1990
+ let mt = H;
1991
+ const C = class C {
1992
1992
  constructor(t, e, s = "en") {
1993
1993
  this.ws = null, this.introSent = !1, this.introComplete = !1, this.lastCvError = "", this.lastCvErrorTime = 0, this.measurementComplete = !1, this.isDisconnected = !1, this.apiUrl = t, this.apiKey = e, this.localeCode = s, this.audioManager = new mt();
1994
1994
  }
@@ -2023,20 +2023,28 @@ const st = class st {
2023
2023
  );
2024
2024
  return;
2025
2025
  }
2026
- const s = "wss://conversational-ai-service-923169850574.southamerica-east1.run.app", o = crypto.randomUUID(), n = `${s}/ws/chat/${o}/${e.ticket_id}`;
2027
- this.ws = new WebSocket(n), this.ws.binaryType = "arraybuffer", this.ws.onopen = () => {
2028
- console.log("AI session connected."), !this.introSent && this.ws && this.ws.readyState === WebSocket.OPEN && (this.introSent = !0, this.ws.send(
2029
- JSON.stringify({
2030
- cv_alert: `Measurement process started! The user speaks ${this.localeCode}.`
2031
- })
2032
- ));
2033
- }, this.ws.onmessage = (r) => {
2034
- if (r.data instanceof ArrayBuffer) {
2035
- this.audioManager.queueAudio(r.data);
2026
+ const s = "wss://conversational-ai-service-923169850574.southamerica-east1.run.app", o = crypto.randomUUID(), r = `${s}/ws/chat/${o}/${e.ticket_id}`;
2027
+ this.ws = new WebSocket(r), this.ws.binaryType = "arraybuffer", this.ws.onopen = () => {
2028
+ if (console.log("AI session connected."), !this.introSent && this.ws && this.ws.readyState === WebSocket.OPEN) {
2029
+ this.introSent = !0;
2030
+ const n = this.getStoredUserName();
2031
+ n && (this.ws.send(
2032
+ JSON.stringify({
2033
+ system_alert: `The user's name is ${n}. Do not ask for their name.`
2034
+ })
2035
+ ), console.log("Sent existing user name to AI:", n)), this.ws.send(
2036
+ JSON.stringify({
2037
+ cv_alert: `Measurement process started! The user speaks ${this.localeCode}.`
2038
+ })
2039
+ );
2040
+ }
2041
+ }, this.ws.onmessage = (n) => {
2042
+ if (n.data instanceof ArrayBuffer) {
2043
+ this.audioManager.queueAudio(n.data);
2036
2044
  return;
2037
2045
  }
2038
2046
  try {
2039
- const l = JSON.parse(r.data);
2047
+ const l = JSON.parse(n.data);
2040
2048
  switch (l.type) {
2041
2049
  case "user":
2042
2050
  break;
@@ -2051,14 +2059,17 @@ const st = class st {
2051
2059
  case "turn_complete":
2052
2060
  this.handleTurnComplete();
2053
2061
  break;
2062
+ case "extract_user_name":
2063
+ this.handleNameExtracted(l.name);
2064
+ break;
2054
2065
  }
2055
2066
  } catch (l) {
2056
2067
  console.error("Error parsing WS message:", l);
2057
2068
  }
2058
- }, this.ws.onclose = (r) => {
2059
- r.code === 4003 && console.error("Ticket was invalid or expired"), console.log("AI session disconnected.");
2060
- }, this.ws.onerror = (r) => {
2061
- console.error("AI Session WebSocket Error:", r);
2069
+ }, this.ws.onclose = (n) => {
2070
+ n.code === 4003 && console.error("Ticket was invalid or expired"), console.log("AI session disconnected.");
2071
+ }, this.ws.onerror = (n) => {
2072
+ console.error("AI Session WebSocket Error:", n);
2062
2073
  };
2063
2074
  } catch (t) {
2064
2075
  console.error("Failed to connect to AI session:", t);
@@ -2087,7 +2098,7 @@ const st = class st {
2087
2098
  }
2088
2099
  forwardCvError(t) {
2089
2100
  if (!this.introComplete || this.measurementComplete || this.audioManager.isUserSpeaking) return;
2090
- const e = Date.now(), s = t === this.lastCvError, o = e - this.lastCvErrorTime < st.CV_ERROR_THROTTLE_MS;
2101
+ const e = Date.now(), s = t === this.lastCvError, o = e - this.lastCvErrorTime < C.CV_ERROR_THROTTLE_MS;
2091
2102
  s && o || (this.lastCvError = t, this.lastCvErrorTime = e, this.ws && this.ws.readyState === WebSocket.OPEN && this.ws.send(JSON.stringify({ cv_alert: t })));
2092
2103
  }
2093
2104
  notifySuccess(t, e = "") {
@@ -2097,33 +2108,58 @@ const st = class st {
2097
2108
  })
2098
2109
  );
2099
2110
  }
2111
+ handleNameExtracted(t) {
2112
+ if (t) {
2113
+ console.log("AI extracted user name:", t), this.setUserNameCookie(t);
2114
+ try {
2115
+ localStorage.setItem(C.USER_NAME_STORAGE_KEY, t);
2116
+ } catch {
2117
+ }
2118
+ this.onNameExtracted && this.onNameExtracted(t);
2119
+ }
2120
+ }
2121
+ getStoredUserName() {
2122
+ try {
2123
+ const e = localStorage.getItem(
2124
+ C.USER_NAME_STORAGE_KEY
2125
+ );
2126
+ if (e) return e;
2127
+ } catch {
2128
+ }
2129
+ const t = document.cookie.split("; ").find((e) => e.startsWith(C.USER_NAME_COOKIE + "="));
2130
+ return t ? decodeURIComponent(t.split("=")[1]) : null;
2131
+ }
2132
+ setUserNameCookie(t) {
2133
+ const s = /* @__PURE__ */ new Date();
2134
+ s.setTime(s.getTime() + 30 * 24 * 60 * 60 * 1e3), document.cookie = `${C.USER_NAME_COOKIE}=${encodeURIComponent(t)};expires=${s.toUTCString()};path=/`;
2135
+ }
2100
2136
  disconnect() {
2101
2137
  this.isDisconnected = !0, this.audioManager.stopAll(), this.ws && (this.ws.close(1e3, "Measurement complete"), this.ws = null);
2102
2138
  }
2103
2139
  };
2104
- st.CV_ERROR_THROTTLE_MS = 6e3;
2105
- let gt = st;
2140
+ C.CV_ERROR_THROTTLE_MS = 6e3, C.USER_NAME_COOKIE = "xactsize_userName", C.USER_NAME_STORAGE_KEY = "xactsize_userName";
2141
+ let gt = C;
2106
2142
  var Qe = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, p = (i, t, e, s) => {
2107
- for (var o = s > 1 ? void 0 : s ? Xe(t, e) : t, n = i.length - 1, r; n >= 0; n--)
2108
- (r = i[n]) && (o = (s ? r(t, e, o) : r(o)) || o);
2143
+ for (var o = s > 1 ? void 0 : s ? Xe(t, e) : t, r = i.length - 1, n; r >= 0; r--)
2144
+ (n = i[r]) && (o = (s ? n(t, e, o) : n(o)) || o);
2109
2145
  return s && o && Qe(t, e, o), o;
2110
2146
  };
2111
2147
  const { getLocale: ii, setLocale: Ht } = Re({
2112
- sourceLocale: qt,
2148
+ sourceLocale: Wt,
2113
2149
  targetLocales: Ie,
2114
- loadLocale: (i) => Yt(/* @__PURE__ */ Object.assign({ "./generated/locales/es-MX.ts": () => import("./es-MX-Bgbw_iNw.mjs"), "./generated/locales/pt-BR.ts": () => import("./pt-BR-s0pF3Tuk.mjs") }), `./generated/locales/${i}.ts`, 4)
2150
+ loadLocale: (i) => qt(/* @__PURE__ */ Object.assign({ "./generated/locales/es-MX.ts": () => import("./es-MX-CdrQCtwz.mjs"), "./generated/locales/pt-BR.ts": () => import("./pt-BR-BepVa4r8.mjs") }), `./generated/locales/${i}.ts`, 4)
2115
2151
  });
2116
- let c = class extends C {
2152
+ let c = class extends v {
2117
2153
  constructor() {
2118
2154
  super(...arguments), this.spinnerFrame = 0, this.apiKey = "", this.tenantId = "1", this.productSku = "123456", this.baseUrl = "https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app", this.apiUrl = this.baseUrl + "/api/measurer/measure/body", this.vtonUrl = this.baseUrl + "/api/VirtualTryOn/generate", this.garmentUrl = "", this.vton = !1, this.brandName = void 0, this.buttonText = "", this._culture = "pt-BR", this.measurerKey = "", this._isLocaleLoading = !1, this.showModal = !1, this.step = 1, this.height = 0, this.recommendedSize = "", this.measurements = {}, this.errorMessage = "", this.instructionMessage = a(
2119
2155
  "Position yourself in front of the camera"
2120
- ), this.shouldStartMeasurement = !1, this.isLoading = !1, this.isFetching = !1, this.generatedImageUrl = "", this.isVtonFetching = !1, this.vtonError = !1, this.videoElement = null, this.stream = null, this.poolingTimeout = null, this.instructionMessageTimeout = null, this.aiSession = null, this.cameras = [], this.currentCameraId = null, this.snowflakesCache = null;
2156
+ ), this.shouldStartMeasurement = !1, this.isLoading = !1, this.isFetching = !1, this.generatedImageUrl = "", this.isVtonFetching = !1, this.vtonError = !1, this.videoElement = null, this.stream = null, this.poolingTimeout = null, this.instructionMessageTimeout = null, this.aiSession = null, this.sessionActive = !1, this.cameras = [], this.currentCameraId = null, this.snowflakesCache = null;
2121
2157
  }
2122
2158
  firstUpdated() {
2123
2159
  this.startSpinnerAnimation();
2124
2160
  }
2125
2161
  startSpinnerAnimation() {
2126
- const i = [Ke, Ye, Dt];
2162
+ const i = [Ye, qe, Dt];
2127
2163
  this.spinnerInterval = setInterval(() => {
2128
2164
  var e;
2129
2165
  const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(
@@ -2143,7 +2179,7 @@ let c = class extends C {
2143
2179
  try {
2144
2180
  this._isLocaleLoading = !0, this.requestUpdate(), await Ht(i);
2145
2181
  } catch (t) {
2146
- console.error("Failed to load locale", i, t), await Ht(qt);
2182
+ console.error("Failed to load locale", i, t), await Ht(Wt);
2147
2183
  } finally {
2148
2184
  this._isLocaleLoading = !1, this.requestUpdate();
2149
2185
  }
@@ -2269,22 +2305,46 @@ let c = class extends C {
2269
2305
  const t = this.errorMap[i];
2270
2306
  return t || (console.info("Error code is missing", i), a("An unexpected error occurred"));
2271
2307
  }
2308
+ trackAnalytics(i, t = {}) {
2309
+ if (!(!this.baseUrl || !this.tenantId))
2310
+ try {
2311
+ const e = {
2312
+ tenantId: this.tenantId,
2313
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2314
+ ...t
2315
+ };
2316
+ fetch(`${this.baseUrl}/api/analytics${i}`, {
2317
+ method: "POST",
2318
+ headers: {
2319
+ "Content-Type": "application/json",
2320
+ ...this.apiKey ? { "X-API-Key": this.apiKey } : {}
2321
+ },
2322
+ body: JSON.stringify(e),
2323
+ keepalive: !0
2324
+ }).catch((s) => console.error("Analytics fetch error:", s));
2325
+ } catch (e) {
2326
+ console.error("Analytics error:", e);
2327
+ }
2328
+ }
2272
2329
  connectedCallback() {
2273
2330
  super.connectedCallback(), console.log("New code loaded Jan 27 11:57am"), document.addEventListener("keydown", this.handleEscKey.bind(this)), this.snowflakesCache = this.generateSnowflakes();
2274
2331
  }
2275
2332
  disconnectedCallback() {
2276
2333
  var i;
2277
- super.disconnectedCallback(), document.removeEventListener("keydown", this.handleEscKey.bind(this)), this.stopPolling(), clearInterval(this.spinnerInterval), (i = this.aiSession) == null || i.disconnect();
2334
+ super.disconnectedCallback(), document.removeEventListener("keydown", this.handleEscKey.bind(this)), this.stopPolling(), clearInterval(this.spinnerInterval), (i = this.aiSession) == null || i.disconnect(), this.sessionActive && (this.trackAnalytics("/session-ended"), this.sessionActive = !1);
2278
2335
  }
2279
2336
  handleEscKey(i) {
2280
2337
  i.key === "Escape" && this.showModal && this.closeModal();
2281
2338
  }
2282
2339
  openModal() {
2283
- this.showModal = !0, this.step = 1, this.height = 0, this.instructionMessage = a("Position yourself in front of the camera");
2340
+ this.trackAnalytics("/click"), this.showModal = !0, this.step = 1, this.height = 0, this.instructionMessage = a("Position yourself in front of the camera");
2284
2341
  }
2285
2342
  closeModal() {
2286
2343
  var i;
2287
- this.showModal = !1, this.onMeasurementCanceled && typeof this.onMeasurementCanceled == "function" && this.onMeasurementCanceled(), this.stopPolling(), (i = this.aiSession) == null || i.disconnect(), this.dispatchEvent(new CustomEvent("measurementCanceled", { detail: {} }));
2344
+ this.step === 4 && this.trackAnalytics("/measurement-declined", {
2345
+ sku: this.productSku,
2346
+ measurementData: JSON.stringify(this.measurements)
2347
+ }), this.showModal = !1, this.onMeasurementCanceled && typeof this.onMeasurementCanceled == "function" && this.onMeasurementCanceled(), this.stopPolling(), (i = this.aiSession) == null || i.disconnect(), this.dispatchEvent(new CustomEvent("measurementCanceled", { detail: {} })), this.sessionActive && (this.trackAnalytics("/session-ended"), this.sessionActive = !1);
2288
2348
  }
2289
2349
  handleDialogClose() {
2290
2350
  this.showModal && this.closeModal();
@@ -2297,7 +2357,7 @@ let c = class extends C {
2297
2357
  this.step = 3, this.errorMessage = "";
2298
2358
  }
2299
2359
  async startMeasurement() {
2300
- this.step = 3, this.errorMessage = "", this.shouldStartMeasurement = !0;
2360
+ this.step = 3, this.errorMessage = "", this.shouldStartMeasurement = !0, this.sessionActive = !0, this.trackAnalytics("/session-started");
2301
2361
  }
2302
2362
  updated(i) {
2303
2363
  var t;
@@ -2365,10 +2425,10 @@ let c = class extends C {
2365
2425
  s.width = this.videoElement.videoWidth, s.height = this.videoElement.videoHeight;
2366
2426
  const o = s.getContext("2d");
2367
2427
  o == null || o.drawImage(this.videoElement, 0, 0, s.width, s.height);
2368
- const n = await new Promise(
2428
+ const r = await new Promise(
2369
2429
  (u) => s.toBlob((f) => u(f), "image/jpeg")
2370
- ), r = new File([n], "frame.jpg", { type: "image/jpeg" }), l = new FormData();
2371
- l.append("image", r), l.append("height", this.height.toString()), l.append("productSku", this.productSku), this.measurerKey && l.append("measurerKey", this.measurerKey);
2430
+ ), n = new File([r], "frame.jpg", { type: "image/jpeg" }), l = new FormData();
2431
+ l.append("image", n), l.append("height", this.height.toString()), l.append("productSku", this.productSku), this.measurerKey && l.append("measurerKey", this.measurerKey);
2372
2432
  try {
2373
2433
  this.isFetching = !0, this.isLoading = !0, this.poolingTimeout && clearTimeout(this.poolingTimeout), this.instructionMessageTimeout && clearTimeout(this.instructionMessageTimeout);
2374
2434
  const f = await (await fetch(this.apiUrl, {
@@ -2382,7 +2442,7 @@ let c = class extends C {
2382
2442
  }
2383
2443
  })).json();
2384
2444
  if (this.isFetching = !1, this.isLoading = !1, f.success && f.chosenSize) {
2385
- this.generateVtonImage(r), t.push(f);
2445
+ this.generateVtonImage(n), t.push(f);
2386
2446
  const m = t.length;
2387
2447
  this.instructionMessage = a(
2388
2448
  _e`Scanning... ${m}/${3}`
@@ -2423,33 +2483,33 @@ let c = class extends C {
2423
2483
  }
2424
2484
  // New helper to average measurements and vote on size
2425
2485
  processFinalResults(i) {
2426
- console.group("Scan Debug Report"), console.log(`✅ Collected ${i.length} successful scans.`), i.forEach((r, l) => {
2486
+ console.group("Scan Debug Report"), console.log(`✅ Collected ${i.length} successful scans.`), i.forEach((n, l) => {
2427
2487
  console.log(
2428
- `Scan #${l + 1}: Size [${r.chosenSize}] | Chest: ${r.measurements.chest} | Waist: ${r.measurements.waist}`
2488
+ `Scan #${l + 1}: Size [${n.chosenSize}] | Chest: ${n.measurements.chest} | Waist: ${n.measurements.waist}`
2429
2489
  );
2430
2490
  });
2431
2491
  const t = {};
2432
- Object.keys(i[0].measurements || {}).forEach((r) => {
2492
+ Object.keys(i[0].measurements || {}).forEach((n) => {
2433
2493
  let l = 0, h = 0;
2434
2494
  i.forEach((u) => {
2435
- const f = u.measurements[r];
2495
+ const f = u.measurements[n];
2436
2496
  typeof f == "number" && (l += f, h++);
2437
- }), t[r] = h > 0 ? Math.round(l / h * 100) / 100 : 0;
2497
+ }), t[n] = h > 0 ? Math.round(l / h * 100) / 100 : 0;
2438
2498
  }), console.log("📏 Final Averaged Measurements:", t);
2439
2499
  const s = {};
2440
- i.forEach((r) => {
2441
- const l = r.chosenSize;
2500
+ i.forEach((n) => {
2501
+ const l = n.chosenSize;
2442
2502
  l && (s[l] = (s[l] || 0) + 1);
2443
2503
  }), console.log("🗳️ Voting Results:", s);
2444
- let o = "", n = 0;
2445
- for (const [r, l] of Object.entries(s))
2446
- l > n && (n = l, o = r);
2447
- if (console.log(`🏆 WINNER: ${o}`), console.groupEnd(), this.measurements = t, this.recommendedSize = o, this.instructionMessage = a("Measurement successful!"), this.aiSession) {
2504
+ let o = "", r = 0;
2505
+ for (const [n, l] of Object.entries(s))
2506
+ l > r && (r = l, o = n);
2507
+ if (console.log(`🏆 WINNER: ${o}`), console.groupEnd(), this.measurements = t, this.recommendedSize = o, this.instructionMessage = a("Measurement successful!"), this.trackAnalytics("/session-completed"), this.sessionActive && (this.trackAnalytics("/session-ended"), this.sessionActive = !1), this.aiSession) {
2448
2508
  this.aiSession.onTurnComplete = () => {
2449
2509
  this.aiSession = null;
2450
2510
  };
2451
- let r = "";
2452
- this.vton && (this.isVtonFetching ? r = "An image of the user wearing the garment is currently being generated. TELL USER THEIR IMAGE IS GENERATING." : this.generatedImageUrl && (r = "The image has successfully generated. TELL USER: 'Here is your image in the garment'.")), this.aiSession.notifySuccess(o, r);
2511
+ let n = "";
2512
+ this.vton && (this.isVtonFetching ? n = "An image of the user wearing the garment is currently being generated. TELL USER THEIR IMAGE IS GENERATING." : this.generatedImageUrl && (n = "The image has successfully generated. TELL USER: 'Here is your image in the garment'.")), this.aiSession.notifySuccess(o, n);
2453
2513
  }
2454
2514
  }
2455
2515
  stopPolling() {
@@ -2457,7 +2517,10 @@ let c = class extends C {
2457
2517
  }
2458
2518
  acceptMeasurement() {
2459
2519
  var i;
2460
- this.dispatchEvent(
2520
+ this.trackAnalytics("/measurement-accepted", {
2521
+ sku: this.productSku,
2522
+ measurementData: JSON.stringify(this.measurements)
2523
+ }), this.dispatchEvent(
2461
2524
  new CustomEvent("measurementAccepted", {
2462
2525
  detail: { size: this.recommendedSize }
2463
2526
  })
@@ -2465,7 +2528,10 @@ let c = class extends C {
2465
2528
  }
2466
2529
  resetMeasurement() {
2467
2530
  var i;
2468
- this.step = 1, this.height = 0, this.recommendedSize = "", this.measurements = {}, this.generatedImageUrl = "", this.isVtonFetching = !1, this.vtonError = !1, this.stopPolling(), (i = this.aiSession) == null || i.disconnect(), this.aiSession = null;
2531
+ this.step === 4 && this.trackAnalytics("/measurement-declined", {
2532
+ sku: this.productSku,
2533
+ measurementData: JSON.stringify(this.measurements)
2534
+ }), this.step = 1, this.height = 0, this.recommendedSize = "", this.measurements = {}, this.generatedImageUrl = "", this.isVtonFetching = !1, this.vtonError = !1, this.stopPolling(), (i = this.aiSession) == null || i.disconnect(), this.aiSession = null;
2469
2535
  }
2470
2536
  stopMeasurement() {
2471
2537
  this.resetMeasurement(), this.showModal = !1;
@@ -2473,13 +2539,13 @@ let c = class extends C {
2473
2539
  generateSnowflakes() {
2474
2540
  const i = [];
2475
2541
  for (let e = 0; e < 80; e++) {
2476
- const s = Math.random() * 100, o = 8 + Math.random() * 17, n = -Math.random() * 30;
2542
+ const s = Math.random() * 100, o = 8 + Math.random() * 17, r = -Math.random() * 30;
2477
2543
  i.push(
2478
2544
  g`<span
2479
2545
  class="snowflake"
2480
2546
  style="left:${s}%; animation-duration:${o.toFixed(
2481
2547
  2
2482
- )}s; animation-delay:${n.toFixed(2)}s;"
2548
+ )}s; animation-delay:${r.toFixed(2)}s;"
2483
2549
  ></span>`
2484
2550
  );
2485
2551
  }
@@ -2498,7 +2564,11 @@ let c = class extends C {
2498
2564
  ></xact-button>
2499
2565
 
2500
2566
  ${this.showModal ? g`
2501
- <dialog class="modal" id="measurer-dialog" @close=${this.handleDialogClose}>
2567
+ <dialog
2568
+ class="modal"
2569
+ id="measurer-dialog"
2570
+ @close=${this.handleDialogClose}
2571
+ >
2502
2572
  <div class="modal-content">
2503
2573
  <div
2504
2574
  style="display: flex; justify-content: space-between"
@@ -2612,7 +2682,7 @@ let c = class extends C {
2612
2682
  `;
2613
2683
  }
2614
2684
  };
2615
- c.styles = P`
2685
+ c.styles = N`
2616
2686
  :host {
2617
2687
  display: block;
2618
2688
  font-family: Arial, sans-serif;