@gengage/assistant-fe 0.6.16 → 0.6.18

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 (56) hide show
  1. package/dist/{request-text-DThlE-Xd.js → account-config-gj7_mF6Q.js} +725 -312
  2. package/dist/agentic/events/comparison.d.ts +6 -0
  3. package/dist/agentic/events/context-products.d.ts +6 -0
  4. package/dist/agentic/index.d.ts +8 -0
  5. package/dist/agentic/index.js +251 -168
  6. package/dist/agentic/recipes/catalog-assistant-flow.d.ts +50 -0
  7. package/dist/agentic/recipes/input-text/actions.d.ts +15 -0
  8. package/dist/agentic/recipes/input-text/index.d.ts +4 -0
  9. package/dist/agentic/recipes/input-text/products.d.ts +4 -0
  10. package/dist/agentic/recipes/input-text/ranking.d.ts +14 -0
  11. package/dist/agentic/recipes/input-text/steps.d.ts +31 -0
  12. package/dist/agentic/util/account-config.d.ts +8 -0
  13. package/dist/agentic/util/privacy.d.ts +12 -0
  14. package/dist/agentic/widgets/endpoints.d.ts +12 -0
  15. package/dist/agentic/worker.d.ts +8 -0
  16. package/dist/agentic/worker.js +415 -106
  17. package/dist/agentic.iife.js +7 -5
  18. package/dist/{api-paths-C7Y4wTde.js → api-paths-CEDR4rld.js} +1 -1
  19. package/dist/chat/components/InlineLauncher.d.ts +15 -0
  20. package/dist/chat/index.d.ts +1 -1
  21. package/dist/chat-runtime.js +1 -1
  22. package/dist/{chat-BP-yXukW.js → chat-rvSffJXw.js} +1 -1
  23. package/dist/chat.iife.js +15 -12
  24. package/dist/chat.js +2 -2
  25. package/dist/{common-BR9JIIjb.js → common-BBgWfT-W.js} +3 -3
  26. package/dist/common.js +8 -8
  27. package/dist/{connection-warning-DyeP1AB2.js → connection-warning-B-doodzu.js} +1 -1
  28. package/dist/{fastIntent-C8jh7D1D.js → fastIntent-CloHPZQh.js} +2 -2
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +13 -13
  31. package/dist/{native-webview-U9HtGabb.js → native-webview-NWc9LrJh.js} +1 -1
  32. package/dist/native.iife.js +13 -10
  33. package/dist/native.js +1 -1
  34. package/dist/{overlay-ClYgI2Kl.js → overlay-COzFFq0-.js} +1 -1
  35. package/dist/overlay.js +2 -2
  36. package/dist/{qna-B3lMzHvS.js → qna-DUs97irI.js} +1 -1
  37. package/dist/qna-runtime.js +1 -1
  38. package/dist/qna.iife.js +1 -1
  39. package/dist/qna.js +2 -2
  40. package/dist/{runtime-LY1J9JFl.js → runtime-BGCNkU1H.js} +6 -6
  41. package/dist/{runtime-Bt2VV3L3.js → runtime-CbWCU424.js} +1082 -1042
  42. package/dist/{runtime-rjNaPWIi.js → runtime-Ctqq0V6G.js} +8 -8
  43. package/dist/{simbut-DV4oPMpH.js → simbut-Dh4cJysK.js} +3 -3
  44. package/dist/simbut.iife.js +1 -1
  45. package/dist/simbut.js +1 -1
  46. package/dist/{simrel-DaAhtabq.js → simrel-B-sjHbL5.js} +4 -4
  47. package/dist/simrel-runtime.js +1 -1
  48. package/dist/simrel.iife.js +2 -2
  49. package/dist/simrel.js +2 -2
  50. package/dist/{widget-base-DRaUfd-H.js → widget-base-CIJT5AiP.js} +2 -2
  51. package/package.json +1 -1
  52. /package/dist/{context-BBuSsXZ9.js → context-heG8hv5l.js} +0 -0
  53. /package/dist/{locale-CfqNifrU.js → locale-uQ5XZ2yS.js} +0 -0
  54. /package/dist/{price-formatter-CFsWT0lP.js → price-formatter-CHUmYq8I.js} +0 -0
  55. /package/dist/{request-response-cache-zsgz3Awp.js → request-response-cache-BxRsKGJ0.js} +0 -0
  56. /package/dist/{schemas-Cq2blsO_.js → schemas-BnYUhYSy.js} +0 -0
@@ -1,10 +1,10 @@
1
- import { c as Sa, d as Ea, h as Pa, p as La, r as Ta, s as Zt, t as Aa } from "./api-paths-C7Y4wTde.js";
2
- import { A as ke, C as Ia, D as Ma, E as Na, M as ce, N as he, O as Ba, S as xt, T as za, _ as Ra, a as we, b as Ha, d as Fa, f as Da, g as Oa, h as Ua, j as be, l as ja, m as $a, p as qa, u as Va, v as Ga, w as et, x as Wa } from "./context-BBuSsXZ9.js";
3
- import { i as ze, s as Xt, t as Ka } from "./widget-base-DRaUfd-H.js";
4
- import { d as ge, f as Ya, i as Za, n as Xa, p as Qa, r as Ja, t as yt, u as en } from "./fastIntent-C8jh7D1D.js";
5
- import { t as Ue } from "./locale-CfqNifrU.js";
6
- import { t as tn } from "./request-response-cache-zsgz3Awp.js";
7
- import { a as Qt, i as Jt, n as fe, r as ea, t as ae } from "./price-formatter-CFsWT0lP.js";
1
+ import { c as Sa, d as Ea, h as Pa, p as La, r as Ta, s as Zt, t as Aa } from "./api-paths-CEDR4rld.js";
2
+ import { A as ke, C as Ia, D as Ma, E as Na, M as ge, N as fe, O as Ba, S as xt, T as za, _ as Ra, a as we, b as Ha, d as Fa, f as Da, g as Ua, h as Oa, j as ve, l as ja, m as $a, p as qa, u as Va, v as Ga, w as et, x as Wa } from "./context-heG8hv5l.js";
3
+ import { i as ze, s as Xt, t as Ka } from "./widget-base-CIJT5AiP.js";
4
+ import { d as pe, f as Ya, i as Za, n as Xa, p as Qa, r as Ja, t as yt, u as en } from "./fastIntent-CloHPZQh.js";
5
+ import { t as Oe } from "./locale-uQ5XZ2yS.js";
6
+ import { t as tn } from "./request-response-cache-BxRsKGJ0.js";
7
+ import { a as Qt, i as Jt, n as be, r as ea, t as ae } from "./price-formatter-CHUmYq8I.js";
8
8
  function wt() {
9
9
  const t = Date.now(), e = new Uint8Array(16);
10
10
  crypto.getRandomValues(e), e[0] = t / 2 ** 40 & 255, e[1] = t / 2 ** 32 & 255, e[2] = t / 2 ** 24 & 255, e[3] = t / 2 ** 16 & 255, e[4] = t / 2 ** 8 & 255, e[5] = t & 255, e[6] = e[6] & 15 | 112, e[8] = e[8] & 63 | 128;
@@ -597,7 +597,7 @@ function wn(t) {
597
597
  const e = document.createElement("div");
598
598
  e.className = "gengage-chat-kvkk-banner gds-evidence-card gds-evidence-card-warning", e.dataset.gengagePart = "kvkk-banner", e.setAttribute("role", "alert");
599
599
  const a = document.createElement("div");
600
- a.className = "gengage-chat-kvkk-content", a.dataset.gengagePart = "kvkk-content", a.innerHTML = he(t.htmlContent), e.appendChild(a);
600
+ a.className = "gengage-chat-kvkk-content", a.dataset.gengagePart = "kvkk-content", a.innerHTML = fe(t.htmlContent), e.appendChild(a);
601
601
  const n = document.createElement("button");
602
602
  return n.className = "gengage-chat-kvkk-dismiss", n.dataset.gengagePart = "kvkk-dismiss", n.type = "button", n.setAttribute("aria-label", t.closeAriaLabel ?? "Close privacy notice"), n.textContent = "×", n.addEventListener("click", t.onDismiss), e.appendChild(n), e;
603
603
  }
@@ -863,42 +863,42 @@ var Bn = class {
863
863
  if (v.className = "gengage-chat-close gds-btn gds-btn-ghost gds-icon-btn", v.dataset.gengagePart = "chat-header-close", v.type = "button", v.setAttribute("aria-label", this.i18n.closeButton), v.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>', v.addEventListener("click", e.onClose), e.showHeaderFavorites) {
864
864
  const x = document.createElement("button");
865
865
  x.className = "gengage-chat-header-btn gengage-chat-header-btn--fav gds-btn gds-btn-ghost gds-icon-btn", x.dataset.gengagePart = "chat-header-favorites", x.type = "button", x.setAttribute("aria-label", this.i18n.favoritesAriaLabel), x.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>';
866
- const $ = document.createElement("span");
867
- $.className = "gengage-chat-header-fav-badge", $.dataset.gengagePart = "chat-header-favorites-badge", $.setAttribute("aria-hidden", "true"), $.style.display = "none", x.appendChild($), this._favBadgeEl = $, x.addEventListener("click", () => {
866
+ const C = document.createElement("span");
867
+ C.className = "gengage-chat-header-fav-badge", C.dataset.gengagePart = "chat-header-favorites-badge", C.setAttribute("aria-hidden", "true"), C.style.display = "none", x.appendChild(C), this._favBadgeEl = C, x.addEventListener("click", () => {
868
868
  e.onFavoritesClick?.();
869
869
  }), m.appendChild(x);
870
870
  }
871
871
  m.appendChild(v), r && i.insertBefore(r, i.firstChild), i.appendChild(m);
872
872
  {
873
- let $ = 0, re = 0, ie = !1;
874
- const oe = (J) => {
875
- if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || J.target.closest('button, a, input, [role="button"]')) return;
876
- const ee = J.changedTouches?.[0];
877
- ee && ($ = ee.clientY, re = 0, ie = !0, this.root.style.transition = "none");
878
- }, ue = (J) => {
879
- if (!ie) return;
880
- const ee = J.changedTouches?.[0];
881
- if (!ee) return;
882
- re = ee.clientY - $;
883
- const Z = (e.getMobileState?.() ?? "full") === "full" ? Math.max(0, re) : re;
884
- J.preventDefault(), this.root.style.transform = `translateY(${Z}px)`;
885
- }, ve = () => {
886
- if (!ie) return;
887
- ie = !1;
888
- const J = e.getMobileState?.() ?? "full";
889
- let ee;
890
- re > 72 ? ee = J === "full" ? "half" : "close" : re < -72 && J === "half" ? ee = "full" : ee = J, this.root.style.transition = "", ee === "close" ? (this.root.style.transform = "translateY(100%)", setTimeout(() => {
873
+ let C = 0, z = 0, Y = !1;
874
+ const ne = (V) => {
875
+ if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || V.target.closest('button, a, input, [role="button"]')) return;
876
+ const G = V.changedTouches?.[0];
877
+ G && (C = G.clientY, z = 0, Y = !0, this.root.style.transition = "none");
878
+ }, oe = (V) => {
879
+ if (!Y) return;
880
+ const G = V.changedTouches?.[0];
881
+ if (!G) return;
882
+ z = G.clientY - C;
883
+ const Q = (e.getMobileState?.() ?? "full") === "full" ? Math.max(0, z) : z;
884
+ V.preventDefault(), this.root.style.transform = `translateY(${Q}px)`;
885
+ }, le = () => {
886
+ if (!Y) return;
887
+ Y = !1;
888
+ const V = e.getMobileState?.() ?? "full";
889
+ let G;
890
+ z > 72 ? G = V === "full" ? "half" : "close" : z < -72 && V === "half" ? G = "full" : G = V, this.root.style.transition = "", G === "close" ? (this.root.style.transform = "translateY(100%)", setTimeout(() => {
891
891
  this.root.style.transform = "", e.onMobileSnap?.("close");
892
- }, 280)) : (this.root.style.transform = "", e.onMobileSnap?.(ee)), re = 0;
893
- }, F = () => {
894
- ie && (ie = !1, re = 0, this.root.style.transition = "", this.root.style.transform = "");
892
+ }, 280)) : (this.root.style.transform = "", e.onMobileSnap?.(G)), z = 0;
893
+ }, R = () => {
894
+ Y && (Y = !1, z = 0, this.root.style.transition = "", this.root.style.transform = "");
895
895
  };
896
- i.addEventListener("touchstart", oe, { passive: !0 }), i.addEventListener("touchmove", ue, { passive: !1 }), i.addEventListener("touchend", ve, { passive: !0 }), i.addEventListener("touchcancel", F, { passive: !0 }), this._cleanups.push(() => {
897
- i.removeEventListener("touchstart", oe), i.removeEventListener("touchmove", ue), i.removeEventListener("touchend", ve), i.removeEventListener("touchcancel", F);
896
+ i.addEventListener("touchstart", ne, { passive: !0 }), i.addEventListener("touchmove", oe, { passive: !1 }), i.addEventListener("touchend", le, { passive: !0 }), i.addEventListener("touchcancel", R, { passive: !0 }), this._cleanups.push(() => {
897
+ i.removeEventListener("touchstart", ne), i.removeEventListener("touchmove", oe), i.removeEventListener("touchend", le), i.removeEventListener("touchcancel", R);
898
898
  });
899
899
  }
900
- const b = document.createElement("div");
901
- b.className = "gengage-chat-body", b.dataset.gengagePart = "chat-body", this._panelEl = document.createElement("div"), this._panelEl.className = "gengage-chat-panel gds-panel", this._panelEl.dataset.gengagePart = "chat-panel", this._panelTopBar = new _n({
900
+ const f = document.createElement("div");
901
+ f.className = "gengage-chat-body", f.dataset.gengagePart = "chat-body", this._panelEl = document.createElement("div"), this._panelEl.className = "gengage-chat-panel gds-panel", this._panelEl.dataset.gengagePart = "chat-panel", this._panelTopBar = new _n({
902
902
  onBack: () => e.onPanelBack?.(),
903
903
  onForward: () => e.onPanelForward?.(),
904
904
  onClose: () => {
@@ -909,7 +909,7 @@ var Bn = class {
909
909
  closePanelAriaLabel: this.i18n.closePanelAriaLabel
910
910
  }), this._panelEl.appendChild(this._panelTopBar.getElement());
911
911
  const u = () => this._updateScrollAffordance();
912
- this._panelEl.addEventListener("scroll", u, { passive: !0 }), this._cleanups.push(() => this._panelEl.removeEventListener("scroll", u)), b.appendChild(this._panelEl), this._dividerEl = document.createElement("div"), this._dividerEl.className = "gengage-chat-panel-divider gengage-chat-panel-divider--hidden", this._dividerEl.dataset.gengagePart = "chat-panel-divider", this._dividerEl.setAttribute("role", "separator"), this._dividerEl.setAttribute("aria-label", this.i18n.togglePanelAriaLabel), this._dividerEl.setAttribute("title", this.i18n.togglePanelAriaLabel);
912
+ this._panelEl.addEventListener("scroll", u, { passive: !0 }), this._cleanups.push(() => this._panelEl.removeEventListener("scroll", u)), f.appendChild(this._panelEl), this._dividerEl = document.createElement("div"), this._dividerEl.className = "gengage-chat-panel-divider gengage-chat-panel-divider--hidden", this._dividerEl.dataset.gengagePart = "chat-panel-divider", this._dividerEl.setAttribute("role", "separator"), this._dividerEl.setAttribute("aria-label", this.i18n.togglePanelAriaLabel), this._dividerEl.setAttribute("title", this.i18n.togglePanelAriaLabel);
913
913
  const d = document.createElement("button");
914
914
  d.className = "gengage-chat-panel-divider-toggle gds-btn gds-btn-ghost", d.dataset.gengagePart = "chat-panel-divider-toggle", d.type = "button", d.setAttribute("aria-label", this.i18n.togglePanelAriaLabel), d.setAttribute("title", this.i18n.togglePanelAriaLabel), d.textContent = "»", d.addEventListener("click", () => {
915
915
  if (this._ignoreNextDividerClick) {
@@ -919,63 +919,63 @@ var Bn = class {
919
919
  this.togglePanel(), this._onPanelToggle?.();
920
920
  });
921
921
  let A = null, y = null;
922
- const w = 24, z = (x) => {
922
+ const w = 24, H = (x) => {
923
923
  if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768)) return;
924
- const $ = x.changedTouches?.[0];
925
- $ && (A = $.clientX, y = $.clientY);
924
+ const C = x.changedTouches?.[0];
925
+ C && (A = C.clientX, y = C.clientY);
926
926
  }, I = (x) => {
927
927
  if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || A === null || y === null) return;
928
- const $ = x.changedTouches?.[0];
929
- if (!$) return;
930
- const re = $.clientX - A, ie = $.clientY - y;
931
- if (A = null, y = null, Math.abs(ie) < w || Math.abs(ie) < Math.abs(re)) return;
932
- const oe = ie < 0;
933
- oe !== this._panelCollapsed && (this._ignoreNextDividerClick = !0, this.setPanelCollapsed(oe), this._onPanelToggle?.());
928
+ const C = x.changedTouches?.[0];
929
+ if (!C) return;
930
+ const z = C.clientX - A, Y = C.clientY - y;
931
+ if (A = null, y = null, Math.abs(Y) < w || Math.abs(Y) < Math.abs(z)) return;
932
+ const ne = Y < 0;
933
+ ne !== this._panelCollapsed && (this._ignoreNextDividerClick = !0, this.setPanelCollapsed(ne), this._onPanelToggle?.());
934
934
  };
935
- this._dividerEl.addEventListener("touchstart", z, { passive: !0 }), this._dividerEl.addEventListener("touchend", I, { passive: !0 }), this._cleanups.push(() => {
936
- this._dividerEl.removeEventListener("touchstart", z), this._dividerEl.removeEventListener("touchend", I);
937
- }), this._dividerEl.appendChild(d), b.appendChild(this._dividerEl);
935
+ this._dividerEl.addEventListener("touchstart", H, { passive: !0 }), this._dividerEl.addEventListener("touchend", I, { passive: !0 }), this._cleanups.push(() => {
936
+ this._dividerEl.removeEventListener("touchstart", H), this._dividerEl.removeEventListener("touchend", I);
937
+ }), this._dividerEl.appendChild(d), f.appendChild(this._dividerEl);
938
938
  const _ = document.createElement("div");
939
939
  _.className = "gengage-chat-conversation", _.dataset.gengagePart = "chat-conversation", this._conversationEl = _, _.appendChild(i);
940
940
  const S = document.createElement("div");
941
941
  S.className = "gengage-chat-offline-bar gds-evidence-card gds-evidence-card-warning", S.dataset.gengagePart = "chat-offline-bar", S.setAttribute("role", "status"), S.setAttribute("aria-live", "polite"), S.textContent = this.i18n.offlineMessage, typeof navigator < "u" && !navigator.onLine && S.classList.add("gengage-chat-offline-bar--visible"), _.appendChild(S);
942
- const H = () => S.classList.add("gengage-chat-offline-bar--visible"), W = () => S.classList.remove("gengage-chat-offline-bar--visible");
943
- window.addEventListener("offline", H), window.addEventListener("online", W), this._cleanups.push(() => {
944
- window.removeEventListener("offline", H), window.removeEventListener("online", W);
942
+ const F = () => S.classList.add("gengage-chat-offline-bar--visible"), W = () => S.classList.remove("gengage-chat-offline-bar--visible");
943
+ window.addEventListener("offline", F), window.addEventListener("online", W), this._cleanups.push(() => {
944
+ window.removeEventListener("offline", F), window.removeEventListener("online", W);
945
945
  }), this._kvkkSlot = document.createElement("div"), this._kvkkSlot.className = "gengage-chat-kvkk-slot", this._kvkkSlot.dataset.gengagePart = "chat-kvkk-slot", _.appendChild(this._kvkkSlot), this.messagesEl = document.createElement("div"), this.messagesEl.id = lt, this.messagesEl.className = "gengage-chat-messages", this.messagesEl.dataset.gengagePart = "chat-messages", this.messagesEl.setAttribute("role", "log"), this.messagesEl.setAttribute("aria-live", "polite"), this.messagesEl.setAttribute("aria-atomic", "false"), this.messagesEl.setAttribute("aria-label", this.i18n.chatMessagesAriaLabel), kt(this.messagesEl);
946
- const X = document.createElement("button");
947
- X.type = "button", X.className = "gengage-chat-former-messages-btn gds-chip", X.dataset.gengagePart = "chat-former-messages-button", X.textContent = this.i18n.showFormerMessagesButton, X.setAttribute("aria-label", this.i18n.showFormerMessagesButton), X.style.display = "none", X.addEventListener("click", () => {
946
+ const J = document.createElement("button");
947
+ J.type = "button", J.className = "gengage-chat-former-messages-btn gds-chip", J.dataset.gengagePart = "chat-former-messages-button", J.textContent = this.i18n.showFormerMessagesButton, J.setAttribute("aria-label", this.i18n.showFormerMessagesButton), J.style.display = "none", J.addEventListener("click", () => {
948
948
  this._options.presentation?.onReleasePresentationFocus?.();
949
- }), this.messagesEl.appendChild(X), this._formerMessagesBtn = X;
950
- const P = () => {
949
+ }), this.messagesEl.appendChild(J), this._formerMessagesBtn = J;
950
+ const L = () => {
951
951
  this._userInteractionUntil = Date.now() + 2e3;
952
952
  };
953
- let E = !1;
954
- const N = () => this._options.presentation, B = () => {
955
- E || (E = !0, requestAnimationFrame(() => {
956
- E = !1;
957
- const { scrollTop: x, scrollHeight: $, clientHeight: re } = this.messagesEl, ie = $ - x - re;
958
- this._userScrolledUp = ie > 10;
959
- const oe = this._presentationPinned ? ie < 96 : ie < 32, ue = Date.now(), ve = ue < this._programmaticScrollUntil, F = !oe && ue < this._userInteractionUntil, J = ve ? !1 : F;
960
- oe !== this._presentationPinned && (this._presentationPinned = oe, N()?.onPinnedToBottomChange?.(oe)), J !== this._presentationUserInteracting && (this._presentationUserInteracting = J, N()?.onUserInteractingChange?.(J));
953
+ let P = !1;
954
+ const B = () => this._options.presentation, N = () => {
955
+ P || (P = !0, requestAnimationFrame(() => {
956
+ P = !1;
957
+ const { scrollTop: x, scrollHeight: C, clientHeight: z } = this.messagesEl, Y = C - x - z;
958
+ this._userScrolledUp = Y > 10;
959
+ const ne = this._presentationPinned ? Y < 96 : Y < 32, oe = Date.now(), le = oe < this._programmaticScrollUntil, R = !ne && oe < this._userInteractionUntil, V = le ? !1 : R;
960
+ ne !== this._presentationPinned && (this._presentationPinned = ne, B()?.onPinnedToBottomChange?.(ne)), V !== this._presentationUserInteracting && (this._presentationUserInteracting = V, B()?.onUserInteractingChange?.(V));
961
961
  }));
962
962
  };
963
- this.messagesEl.addEventListener("scroll", B, { passive: !0 }), this._cleanups.push(() => {
964
- this.messagesEl.removeEventListener("scroll", B);
963
+ this.messagesEl.addEventListener("scroll", N, { passive: !0 }), this._cleanups.push(() => {
964
+ this.messagesEl.removeEventListener("scroll", N);
965
965
  });
966
966
  const k = (x) => {
967
- P(), x.deltaY < -6 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
967
+ L(), x.deltaY < -6 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
968
968
  };
969
969
  this.messagesEl.addEventListener("wheel", k, { passive: !0 }), this._cleanups.push(() => this.messagesEl.removeEventListener("wheel", k));
970
- const D = (x) => {
971
- P(), this._touchStartY = x.touches[0]?.clientY ?? null;
970
+ const U = (x) => {
971
+ L(), this._touchStartY = x.touches[0]?.clientY ?? null;
972
972
  }, q = (x) => {
973
- P();
974
- const $ = x.touches[0]?.clientY, re = this._touchStartY;
975
- typeof $ == "number" && typeof re == "number" && $ - re > 10 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
973
+ L();
974
+ const C = x.touches[0]?.clientY, z = this._touchStartY;
975
+ typeof C == "number" && typeof z == "number" && C - z > 10 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
976
976
  };
977
- this.messagesEl.addEventListener("touchstart", D, { passive: !0 }), this.messagesEl.addEventListener("touchmove", q, { passive: !0 }), this._cleanups.push(() => {
978
- this.messagesEl.removeEventListener("touchstart", D), this.messagesEl.removeEventListener("touchmove", q);
977
+ this.messagesEl.addEventListener("touchstart", U, { passive: !0 }), this.messagesEl.addEventListener("touchmove", q, { passive: !0 }), this._cleanups.push(() => {
978
+ this.messagesEl.removeEventListener("touchstart", U), this.messagesEl.removeEventListener("touchmove", q);
979
979
  }), _.appendChild(this.messagesEl), this._panelFloatingEl = document.createElement("div"), this._panelFloatingEl.className = "gengage-chat-panel-float", this._panelFloatingEl.dataset.gengagePart = "chat-panel-floating-layer", this._panelEl.appendChild(this._panelFloatingEl), this._resetPanelAiZoneElement(), this._pillsEl = document.createElement("div"), this._pillsEl.className = "gengage-chat-pills", this._pillsEl.dataset.gengagePart = "chat-suggestion-pills", this._pillsEl.setAttribute("role", "toolbar"), this._pillsEl.setAttribute("aria-label", this.i18n.suggestionsAriaLabel), this._pillsEl.style.display = "none";
980
980
  const K = document.createElement("div");
981
981
  K.className = "gengage-chat-pills-scroll", K.dataset.gengagePart = "chat-suggestion-pills-scroll", this._pillsEl.appendChild(K);
@@ -986,86 +986,86 @@ var Bn = class {
986
986
  behavior: "smooth"
987
987
  });
988
988
  }), this._pillsEl.appendChild(O);
989
- let te = !1;
990
- const Y = () => {
991
- te || (te = !0, requestAnimationFrame(() => {
992
- te = !1;
989
+ let ee = !1;
990
+ const X = () => {
991
+ ee || (ee = !0, requestAnimationFrame(() => {
992
+ ee = !1;
993
993
  const x = K.scrollLeft + K.clientWidth >= K.scrollWidth - 4;
994
994
  O.style.display = x ? "none" : "";
995
995
  }));
996
996
  };
997
- K.addEventListener("scroll", Y, { passive: !0 }), this._cleanups.push(() => {
998
- K.removeEventListener("scroll", Y);
997
+ K.addEventListener("scroll", X, { passive: !0 }), this._cleanups.push(() => {
998
+ K.removeEventListener("scroll", X);
999
999
  }), _.appendChild(this._pillsEl), this._inputChipsEl = document.createElement("div"), this._inputChipsEl.className = "gengage-chat-input-chips", this._inputChipsEl.dataset.gengagePart = "chat-input-chips", this._inputChipsEl.style.display = "none", _.appendChild(this._inputChipsEl);
1000
- const V = document.createElement("div");
1001
- V.className = "gengage-chat-input-area", V.dataset.gengagePart = "chat-input-area", this.inputEl = document.createElement("textarea"), this.inputEl.className = "gengage-chat-input", this.inputEl.dataset.gengagePart = "chat-input", this.inputEl.rows = 1, this.inputEl.placeholder = this.i18n.inputPlaceholder, this.inputEl.addEventListener("input", () => {
1000
+ const $ = document.createElement("div");
1001
+ $.className = "gengage-chat-input-area", $.dataset.gengagePart = "chat-input-area", this.inputEl = document.createElement("textarea"), this.inputEl.className = "gengage-chat-input", this.inputEl.dataset.gengagePart = "chat-input", this.inputEl.rows = 1, this.inputEl.placeholder = this.i18n.inputPlaceholder, this.inputEl.addEventListener("input", () => {
1002
1002
  this._resizeRafId !== null && cancelAnimationFrame(this._resizeRafId), this._resizeRafId = requestAnimationFrame(() => {
1003
1003
  this._resizeRafId = null, this.inputEl.style.height = "auto", this.inputEl.style.height = `${Math.min(this.inputEl.scrollHeight, 120)}px`;
1004
1004
  }), this._updateSendEnabled();
1005
1005
  }), this.inputEl.addEventListener("keydown", (x) => {
1006
1006
  x.key === "Enter" && !x.isComposing && ((this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || !x.shiftKey) && (x.preventDefault(), this._submit());
1007
1007
  }), this.inputEl.addEventListener("paste", (x) => {
1008
- const $ = x.clipboardData;
1009
- if (!$) return;
1010
- let re = null;
1011
- const ie = $.files?.[0];
1012
- if (ie && ie.type.startsWith("image/")) re = ie;
1013
- else if ($.items?.length) for (let oe = 0; oe < $.items.length; oe++) {
1014
- const ue = $.items[oe];
1015
- if (ue?.kind === "file" && ue.type.startsWith("image/")) {
1016
- const ve = ue.getAsFile();
1017
- if (ve) {
1018
- re = ve;
1008
+ const C = x.clipboardData;
1009
+ if (!C) return;
1010
+ let z = null;
1011
+ const Y = C.files?.[0];
1012
+ if (Y && Y.type.startsWith("image/")) z = Y;
1013
+ else if (C.items?.length) for (let ne = 0; ne < C.items.length; ne++) {
1014
+ const oe = C.items[ne];
1015
+ if (oe?.kind === "file" && oe.type.startsWith("image/")) {
1016
+ const le = oe.getAsFile();
1017
+ if (le) {
1018
+ z = le;
1019
1019
  break;
1020
1020
  }
1021
1021
  }
1022
1022
  }
1023
- re && (x.preventDefault(), this._routeAttachmentFile(re));
1023
+ z && (x.preventDefault(), this._routeAttachmentFile(z));
1024
1024
  }), this._fileInput = document.createElement("input"), this._fileInput.type = "file", this._fileInput.accept = "image/jpeg,image/png,image/webp", this._fileInput.style.display = "none", this._fileInput.addEventListener("change", () => {
1025
1025
  const x = this._fileInput.files?.[0];
1026
1026
  x && this._routeAttachmentFile(x), this._fileInput.value = "";
1027
1027
  });
1028
- const f = document.createElement("div");
1029
- f.className = "gengage-chat-attach-wrap", f.dataset.gengagePart = "chat-attach-wrap", this._attachWrapEl = f;
1030
- const C = document.createElement("button");
1031
- this._attachBtn = C, C.className = "gengage-chat-attach-btn gds-btn gds-btn-ghost", C.dataset.gengagePart = "chat-attach-button", C.type = "button", C.setAttribute("aria-label", this.i18n.attachImageButton), C.setAttribute("aria-haspopup", "menu"), C.setAttribute("aria-expanded", "false"), C.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>', C.addEventListener("click", (x) => {
1028
+ const b = document.createElement("div");
1029
+ b.className = "gengage-chat-attach-wrap", b.dataset.gengagePart = "chat-attach-wrap", this._attachWrapEl = b;
1030
+ const E = document.createElement("button");
1031
+ this._attachBtn = E, E.className = "gengage-chat-attach-btn gds-btn gds-btn-ghost", E.dataset.gengagePart = "chat-attach-button", E.type = "button", E.setAttribute("aria-label", this.i18n.attachImageButton), E.setAttribute("aria-haspopup", "menu"), E.setAttribute("aria-expanded", "false"), E.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>', E.addEventListener("click", (x) => {
1032
1032
  x.stopPropagation(), this._toggleAttachMenu();
1033
1033
  });
1034
- const L = document.createElement("div");
1035
- this._attachMenuEl = L, L.className = "gengage-chat-attach-menu gds-menu", L.dataset.gengagePart = "chat-attach-menu", L.setAttribute("role", "menu"), L.setAttribute("hidden", "");
1036
- const U = document.createElement("button");
1037
- U.type = "button", U.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", U.dataset.gengagePart = "chat-attach-menu-select-photo", U.setAttribute("role", "menuitem"), U.innerHTML = `<span class="gengage-chat-attach-menu-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg></span><span class="gengage-chat-attach-menu-label">${this.i18n.attachMenuSelectPhoto}</span>`, U.addEventListener("click", (x) => {
1034
+ const T = document.createElement("div");
1035
+ this._attachMenuEl = T, T.className = "gengage-chat-attach-menu gds-menu", T.dataset.gengagePart = "chat-attach-menu", T.setAttribute("role", "menu"), T.setAttribute("hidden", "");
1036
+ const j = document.createElement("button");
1037
+ j.type = "button", j.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", j.dataset.gengagePart = "chat-attach-menu-select-photo", j.setAttribute("role", "menuitem"), j.innerHTML = `<span class="gengage-chat-attach-menu-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg></span><span class="gengage-chat-attach-menu-label">${this.i18n.attachMenuSelectPhoto}</span>`, j.addEventListener("click", (x) => {
1038
1038
  x.stopPropagation(), this._closeAttachMenu(), this._fileInput.click();
1039
1039
  });
1040
1040
  const M = document.createElement("div");
1041
1041
  M.className = "gengage-chat-attach-menu-sep", M.dataset.gengagePart = "chat-attach-menu-separator", M.setAttribute("aria-hidden", "true");
1042
- const R = document.createElement("button");
1043
- R.type = "button", R.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", R.dataset.gengagePart = "chat-attach-menu-paste", R.setAttribute("role", "menuitem"), R.innerHTML = `<span class="gengage-chat-attach-menu-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H9a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1Z"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"/><path d="M16 4h2a2 2 0 0 1 2 2v4"/><path d="M21 14H11"/><path d="m15 10-4 4 4 4"/></svg></span><span class="gengage-chat-attach-menu-label">${this.i18n.attachMenuPaste}</span>`, R.addEventListener("click", (x) => {
1042
+ const D = document.createElement("button");
1043
+ D.type = "button", D.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", D.dataset.gengagePart = "chat-attach-menu-paste", D.setAttribute("role", "menuitem"), D.innerHTML = `<span class="gengage-chat-attach-menu-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H9a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1Z"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"/><path d="M16 4h2a2 2 0 0 1 2 2v4"/><path d="M21 14H11"/><path d="m15 10-4 4 4 4"/></svg></span><span class="gengage-chat-attach-menu-label">${this.i18n.attachMenuPaste}</span>`, D.addEventListener("click", (x) => {
1044
1044
  x.stopPropagation();
1045
- const $ = typeof navigator.clipboard?.read == "function" ? navigator.clipboard.read() : void 0;
1046
- this._pasteImageFromClipboardMenu($);
1047
- }), L.appendChild(U), L.appendChild(M), L.appendChild(R), f.appendChild(C), f.appendChild(L), this._previewStrip = document.createElement("div"), this._previewStrip.className = "gengage-chat-attachment-preview gengage-chat-attachment-preview--hidden gds-card-soft", this._previewStrip.dataset.gengagePart = "chat-attachment-preview";
1048
- const T = document.createElement("img");
1049
- T.className = "gengage-chat-attachment-preview-thumb", T.dataset.gengagePart = "chat-attachment-preview-thumb", T.alt = "", this._previewName = document.createElement("span"), this._previewName.className = "gengage-chat-attachment-name", this._previewName.dataset.gengagePart = "chat-attachment-preview-name";
1050
- const j = document.createElement("button");
1051
- j.className = "gengage-chat-attachment-remove gds-btn gds-btn-ghost", j.dataset.gengagePart = "chat-attachment-preview-remove", j.type = "button", j.setAttribute("aria-label", this.i18n.removeAttachmentButton), j.textContent = "×", j.addEventListener("click", () => this.clearAttachment()), this._previewStrip.appendChild(T), this._previewStrip.appendChild(this._previewName), this._previewStrip.appendChild(j), this.sendBtn = document.createElement("button"), this.sendBtn.className = "gengage-chat-send gds-btn gds-btn-primary", this.sendBtn.dataset.gengagePart = "chat-send", this.sendBtn.type = "button", this.sendBtn.disabled = !0, this.sendBtn.setAttribute("aria-label", this.i18n.sendButton), this.sendBtn.dataset.tooltip = this.i18n.sendButton, this._renderSendButtonIcon("send"), this.sendBtn.addEventListener("click", () => {
1045
+ const C = typeof navigator.clipboard?.read == "function" ? navigator.clipboard.read() : void 0;
1046
+ this._pasteImageFromClipboardMenu(C);
1047
+ }), T.appendChild(j), T.appendChild(M), T.appendChild(D), b.appendChild(E), b.appendChild(T), this._previewStrip = document.createElement("div"), this._previewStrip.className = "gengage-chat-attachment-preview gengage-chat-attachment-preview--hidden gds-card-soft", this._previewStrip.dataset.gengagePart = "chat-attachment-preview";
1048
+ const Z = document.createElement("img");
1049
+ Z.className = "gengage-chat-attachment-preview-thumb", Z.dataset.gengagePart = "chat-attachment-preview-thumb", Z.alt = "", this._previewName = document.createElement("span"), this._previewName.className = "gengage-chat-attachment-name", this._previewName.dataset.gengagePart = "chat-attachment-preview-name";
1050
+ const te = document.createElement("button");
1051
+ te.className = "gengage-chat-attachment-remove gds-btn gds-btn-ghost", te.dataset.gengagePart = "chat-attachment-preview-remove", te.type = "button", te.setAttribute("aria-label", this.i18n.removeAttachmentButton), te.textContent = "×", te.addEventListener("click", () => this.clearAttachment()), this._previewStrip.appendChild(Z), this._previewStrip.appendChild(this._previewName), this._previewStrip.appendChild(te), this.sendBtn = document.createElement("button"), this.sendBtn.className = "gengage-chat-send gds-btn gds-btn-primary", this.sendBtn.dataset.gengagePart = "chat-send", this.sendBtn.type = "button", this.sendBtn.disabled = !0, this.sendBtn.setAttribute("aria-label", this.i18n.sendButton), this.sendBtn.dataset.tooltip = this.i18n.sendButton, this._renderSendButtonIcon("send"), this.sendBtn.addEventListener("click", () => {
1052
1052
  if (this._sendStopHandler) {
1053
1053
  const x = this._sendStopHandler;
1054
1054
  this.hideStopButton(), x();
1055
1055
  return;
1056
1056
  }
1057
1057
  this._submit();
1058
- }), V.addEventListener("dragover", (x) => {
1059
- x.preventDefault(), V.classList.add("gengage-chat-input-area--dragover");
1060
- }), V.addEventListener("dragleave", () => {
1061
- V.classList.remove("gengage-chat-input-area--dragover");
1062
- }), V.addEventListener("drop", (x) => {
1063
- x.preventDefault(), V.classList.remove("gengage-chat-input-area--dragover");
1064
- const $ = x.dataTransfer?.files[0];
1065
- $ && this._routeAttachmentFile($);
1058
+ }), $.addEventListener("dragover", (x) => {
1059
+ x.preventDefault(), $.classList.add("gengage-chat-input-area--dragover");
1060
+ }), $.addEventListener("dragleave", () => {
1061
+ $.classList.remove("gengage-chat-input-area--dragover");
1062
+ }), $.addEventListener("drop", (x) => {
1063
+ x.preventDefault(), $.classList.remove("gengage-chat-input-area--dragover");
1064
+ const C = x.dataTransfer?.files[0];
1065
+ C && this._routeAttachmentFile(C);
1066
1066
  });
1067
- const G = document.createElement("div");
1068
- G.className = "gengage-chat-input-pill gds-input-shell", G.dataset.gengagePart = "chat-input-shell", G.appendChild(f), G.appendChild(this.inputEl), this._voiceEnabled && Za() && (this._micBtn = document.createElement("button"), this._micBtn.className = "gengage-chat-mic-btn gds-btn gds-btn-ghost", this._micBtn.dataset.gengagePart = "chat-mic-button", this._micBtn.type = "button", this._micBtn.setAttribute("aria-label", this.i18n.voiceButton), this._micBtn.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" y1="19" x2="12" y2="23"/><line x1="8" y1="23" x2="16" y2="23"/></svg>', this._micBtn.addEventListener("click", () => this._toggleVoice()), G.appendChild(this._micBtn), this._voiceInput = new Ja({
1067
+ const re = document.createElement("div");
1068
+ re.className = "gengage-chat-input-pill gds-input-shell", re.dataset.gengagePart = "chat-input-shell", re.appendChild(b), re.appendChild(this.inputEl), this._voiceEnabled && Za() && (this._micBtn = document.createElement("button"), this._micBtn.className = "gengage-chat-mic-btn gds-btn gds-btn-ghost", this._micBtn.dataset.gengagePart = "chat-mic-button", this._micBtn.type = "button", this._micBtn.setAttribute("aria-label", this.i18n.voiceButton), this._micBtn.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" y1="19" x2="12" y2="23"/><line x1="8" y1="23" x2="16" y2="23"/></svg>', this._micBtn.addEventListener("click", () => this._toggleVoice()), re.appendChild(this._micBtn), this._voiceInput = new Ja({
1069
1069
  onInterim: (x) => {
1070
1070
  this._resizeRafId !== null && (cancelAnimationFrame(this._resizeRafId), this._resizeRafId = null), this.inputEl.value = x, this.inputEl.style.height = "auto", this.inputEl.style.height = `${Math.min(this.inputEl.scrollHeight, 120)}px`;
1071
1071
  },
@@ -1078,16 +1078,16 @@ var Bn = class {
1078
1078
  onStateChange: (x) => {
1079
1079
  x === "listening" ? this._micBtn?.classList.add("gengage-chat-mic-btn--active") : this._micBtn?.classList.remove("gengage-chat-mic-btn--active");
1080
1080
  },
1081
- onError: (x, $) => {
1081
+ onError: (x, C) => {
1082
1082
  this._micBtn?.classList.remove("gengage-chat-mic-btn--active");
1083
1083
  }
1084
- }, { lang: this._voiceLang })), G.appendChild(this.sendBtn), V.appendChild(this._previewStrip), V.appendChild(this._fileInput), V.appendChild(G), _.appendChild(V), b.appendChild(_), this._comparisonDockSlotEl = document.createElement("div"), this._comparisonDockSlotEl.className = "gengage-chat-comparison-dock-slot", this._comparisonDockSlotEl.dataset.gengagePart = "comparison-dock-slot", b.appendChild(this._comparisonDockSlotEl), this.root.appendChild(b), this._setupHorizontalSwipe(_);
1085
- const Q = document.createElement("div");
1086
- Q.className = "gengage-chat-footer", Q.dataset.gengagePart = "chat-footer", Q.textContent = this.i18n.poweredBy, this.root.appendChild(Q);
1087
- const ne = (x) => {
1084
+ }, { lang: this._voiceLang })), re.appendChild(this.sendBtn), $.appendChild(this._previewStrip), $.appendChild(this._fileInput), $.appendChild(re), _.appendChild($), f.appendChild(_), this._comparisonDockSlotEl = document.createElement("div"), this._comparisonDockSlotEl.className = "gengage-chat-comparison-dock-slot", this._comparisonDockSlotEl.dataset.gengagePart = "comparison-dock-slot", f.appendChild(this._comparisonDockSlotEl), this.root.appendChild(f), this._setupHorizontalSwipe(_);
1085
+ const ie = document.createElement("div");
1086
+ ie.className = "gengage-chat-footer", ie.dataset.gengagePart = "chat-footer", ie.textContent = this.i18n.poweredBy, this.root.appendChild(ie);
1087
+ const ce = (x) => {
1088
1088
  x.key === "Escape" && e.onClose();
1089
1089
  };
1090
- this.root.addEventListener("keydown", ne), this._cleanups.push(() => this.root.removeEventListener("keydown", ne)), t.appendChild(this.root);
1090
+ this.root.addEventListener("keydown", ce), this._cleanups.push(() => this.root.removeEventListener("keydown", ce)), t.appendChild(this.root);
1091
1091
  }
1092
1092
  addMessage(t) {
1093
1093
  const e = this._options.renderMessageUISpec?.(t) ?? null;
@@ -1102,7 +1102,7 @@ var Bn = class {
1102
1102
  if (t.content) {
1103
1103
  const n = document.createElement("div");
1104
1104
  if (n.className = "gengage-chat-bubble-text", n.dataset.gengagePart = "chat-message-text", t.role === "assistant") {
1105
- if (t.renderHint === "photo_analysis" ? (a.classList.add("gengage-chat-bubble--photo-analysis"), this._renderPhotoAnalysisCard(n, t.photoAnalysis)) : n.innerHTML = he(t.content), this._onLinkClick) {
1105
+ if (t.renderHint === "photo_analysis" ? (a.classList.add("gengage-chat-bubble--photo-analysis"), this._renderPhotoAnalysisCard(n, t.photoAnalysis)) : n.innerHTML = fe(t.content), this._onLinkClick) {
1106
1106
  const r = n.querySelectorAll("a[href]");
1107
1107
  for (const i of r) i.addEventListener("click", (o) => {
1108
1108
  o.preventDefault();
@@ -1122,7 +1122,7 @@ var Bn = class {
1122
1122
  this.messagesEl.appendChild(a), this._presentationFocusThreadId && this._applyPresentationCollapsed(), this._scrollToBottom(t.role === "user");
1123
1123
  }
1124
1124
  removeMessageBubble(t) {
1125
- this._firstBotMessageIds.delete(t), this.messagesEl.querySelector(`[data-message-id="${ge(t)}"]`)?.remove(), this._presentationFocusThreadId && this._applyPresentationCollapsed();
1125
+ this._firstBotMessageIds.delete(t), this.messagesEl.querySelector(`[data-message-id="${pe(t)}"]`)?.remove(), this._presentationFocusThreadId && this._applyPresentationCollapsed();
1126
1126
  }
1127
1127
  showTypingIndicator(t, e = "auto") {
1128
1128
  this.removeTypingIndicator();
@@ -1445,50 +1445,50 @@ var Bn = class {
1445
1445
  const v = document.createElement("ul");
1446
1446
  v.className = "gengage-chat-comparison-skeleton-hl-list";
1447
1447
  for (let _ = 0; _ < 3; _++) {
1448
- const S = document.createElement("li"), H = document.createElement("div");
1449
- H.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-hl-line", _ === 1 && H.classList.add("gengage-chat-comparison-skeleton-hl-line--medium"), _ === 2 && H.classList.add("gengage-chat-comparison-skeleton-hl-line--short"), S.appendChild(H), v.appendChild(S);
1448
+ const S = document.createElement("li"), F = document.createElement("div");
1449
+ F.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-hl-line", _ === 1 && F.classList.add("gengage-chat-comparison-skeleton-hl-line--medium"), _ === 2 && F.classList.add("gengage-chat-comparison-skeleton-hl-line--short"), S.appendChild(F), v.appendChild(S);
1450
1450
  }
1451
1451
  h.appendChild(v), o.appendChild(h), i.appendChild(o);
1452
- const b = document.createElement("div");
1453
- b.className = "gengage-chat-comparison-key-differences";
1452
+ const f = document.createElement("div");
1453
+ f.className = "gengage-chat-comparison-key-differences";
1454
1454
  const u = document.createElement("div");
1455
- u.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-kd-heading", b.appendChild(u);
1455
+ u.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-kd-heading", f.appendChild(u);
1456
1456
  const d = document.createElement("div");
1457
1457
  d.className = "gengage-chat-comparison-key-differences-content";
1458
1458
  for (let _ = 0; _ < 4; _++) {
1459
1459
  const S = document.createElement("div");
1460
1460
  S.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-kd-line", d.appendChild(S);
1461
1461
  }
1462
- b.appendChild(d), i.appendChild(b);
1462
+ f.appendChild(d), i.appendChild(f);
1463
1463
  const A = document.createElement("div");
1464
1464
  A.className = "gengage-chat-comparison-special gengage-chat-comparison-special--skeleton";
1465
1465
  const y = document.createElement("div");
1466
1466
  y.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-special-line", A.appendChild(y), i.appendChild(A);
1467
1467
  const w = document.createElement("div");
1468
1468
  w.className = "gengage-chat-comparison-skeleton-table-wrap";
1469
- const z = document.createElement("div");
1470
- z.className = "gengage-chat-comparison-skeleton-table-head";
1469
+ const H = document.createElement("div");
1470
+ H.className = "gengage-chat-comparison-skeleton-table-head";
1471
1471
  const I = document.createElement("div");
1472
- I.className = "gengage-chat-comparison-skeleton-table-corner", z.appendChild(I);
1472
+ I.className = "gengage-chat-comparison-skeleton-table-corner", H.appendChild(I);
1473
1473
  for (let _ = 0; _ < 3; _++) {
1474
1474
  const S = document.createElement("div");
1475
1475
  S.className = "gengage-chat-comparison-skeleton-table-col";
1476
- const H = document.createElement("div");
1477
- H.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-img";
1476
+ const F = document.createElement("div");
1477
+ F.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-img";
1478
1478
  const W = document.createElement("div");
1479
1479
  W.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-name";
1480
- const X = document.createElement("div");
1481
- X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-price", S.appendChild(H), S.appendChild(W), S.appendChild(X), z.appendChild(S);
1480
+ const J = document.createElement("div");
1481
+ J.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-price", S.appendChild(F), S.appendChild(W), S.appendChild(J), H.appendChild(S);
1482
1482
  }
1483
- w.appendChild(z);
1483
+ w.appendChild(H);
1484
1484
  for (let _ = 0; _ < 3; _++) {
1485
1485
  const S = document.createElement("div");
1486
1486
  S.className = "gengage-chat-comparison-skeleton-table-row";
1487
- const H = document.createElement("div");
1488
- H.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-label", S.appendChild(H);
1487
+ const F = document.createElement("div");
1488
+ F.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-label", S.appendChild(F);
1489
1489
  for (let W = 0; W < 3; W++) {
1490
- const X = document.createElement("div");
1491
- X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-cell", S.appendChild(X);
1490
+ const J = document.createElement("div");
1491
+ J.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-cell", S.appendChild(J);
1492
1492
  }
1493
1493
  w.appendChild(S);
1494
1494
  }
@@ -1676,14 +1676,14 @@ var Bn = class {
1676
1676
  this._scrollToBottom(!1);
1677
1677
  }
1678
1678
  updateBotMessage(t, e, a, n) {
1679
- const r = this.messagesEl.querySelector(`[data-message-id="${ge(t)}"]`);
1679
+ const r = this.messagesEl.querySelector(`[data-message-id="${pe(t)}"]`);
1680
1680
  if (!r) return;
1681
1681
  let i = r.querySelector(".gengage-chat-bubble-text");
1682
- i || (i = document.createElement("div"), i.className = "gengage-chat-bubble-text", r.appendChild(i)), a === "photo_analysis" ? (r.classList.add("gengage-chat-bubble--photo-analysis"), this._renderPhotoAnalysisCard(i, n)) : (r.classList.remove("gengage-chat-bubble--photo-analysis"), i.innerHTML = he(e)), this._scrollToBottom(!1);
1682
+ i || (i = document.createElement("div"), i.className = "gengage-chat-bubble-text", r.appendChild(i)), a === "photo_analysis" ? (r.classList.add("gengage-chat-bubble--photo-analysis"), this._renderPhotoAnalysisCard(i, n)) : (r.classList.remove("gengage-chat-bubble--photo-analysis"), i.innerHTML = fe(e)), this._scrollToBottom(!1);
1683
1683
  }
1684
1684
  markFirstBotMessage(t) {
1685
1685
  this._firstBotMessageIds.add(t);
1686
- const e = this.messagesEl.querySelector(`[data-message-id="${ge(t)}"]`);
1686
+ const e = this.messagesEl.querySelector(`[data-message-id="${pe(t)}"]`);
1687
1687
  e && e.classList.add("gengage-chat-bubble--first");
1688
1688
  }
1689
1689
  scrollToLastThread() {
@@ -1698,7 +1698,7 @@ var Bn = class {
1698
1698
  return;
1699
1699
  }
1700
1700
  this._programmaticScrollUntil = Date.now() + 700;
1701
- const a = this.messagesEl.querySelector(`[data-thread-id="${ge(e)}"]`);
1701
+ const a = this.messagesEl.querySelector(`[data-thread-id="${pe(e)}"]`);
1702
1702
  a ? requestAnimationFrame(() => {
1703
1703
  a.scrollIntoView({
1704
1704
  block: "start",
@@ -1707,7 +1707,7 @@ var Bn = class {
1707
1707
  }) : this._scrollToBottom(!0);
1708
1708
  }
1709
1709
  scrollThreadIntoView(t, e = "smooth") {
1710
- const a = this.messagesEl.querySelectorAll(`[data-thread-id="${ge(t)}"]`), n = this.messagesEl.ownerDocument.defaultView?.HTMLElement;
1710
+ const a = this.messagesEl.querySelectorAll(`[data-thread-id="${pe(t)}"]`), n = this.messagesEl.ownerDocument.defaultView?.HTMLElement;
1711
1711
  if (!n) return !1;
1712
1712
  let r = null, i = null;
1713
1713
  for (let c = 0; c < a.length; c++) {
@@ -1825,7 +1825,7 @@ function ia(t) {
1825
1825
  function Rn(t) {
1826
1826
  return typeof t == "string" ? ia(t) : null;
1827
1827
  }
1828
- function de(t) {
1828
+ function he(t) {
1829
1829
  return t == null || typeof t != "object" || Array.isArray(t) ? null : t;
1830
1830
  }
1831
1831
  function Hn(...t) {
@@ -1835,7 +1835,7 @@ function Hn(...t) {
1835
1835
  }
1836
1836
  }
1837
1837
  function Fn(t) {
1838
- const e = de(t);
1838
+ const e = he(t);
1839
1839
  if (!e) return null;
1840
1840
  const a = Hn(e.assistant_mode, e.assistantMode);
1841
1841
  if (!a) return null;
@@ -1845,7 +1845,7 @@ function Fn(t) {
1845
1845
  function Dn(t) {
1846
1846
  return t === "beauty_consulting" ? "user_message" : "findSimilar";
1847
1847
  }
1848
- var On = class {
1848
+ var Un = class {
1849
1849
  constructor() {
1850
1850
  this._mode = "shopping", this._uiHints = null;
1851
1851
  }
@@ -1894,7 +1894,7 @@ var On = class {
1894
1894
  const a = Rn(e);
1895
1895
  a ? this._mode = a : ze("mode", "ignoring unrecognised assistant_mode from context", e);
1896
1896
  } else e === null && (this._mode = "shopping");
1897
- this._uiHints = de(t.ui_hints) ?? null;
1897
+ this._uiHints = he(t.ui_hints) ?? null;
1898
1898
  }
1899
1899
  reset() {
1900
1900
  const t = this._mode !== "shopping";
@@ -1907,7 +1907,7 @@ var On = class {
1907
1907
  return this._mode !== "shopping";
1908
1908
  }
1909
1909
  };
1910
- function Un() {
1910
+ function On() {
1911
1911
  return {
1912
1912
  streamIncludedBeautyPhotoStep: !1,
1913
1913
  pendingPhotoStepSkip: !1
@@ -1977,7 +1977,7 @@ function Wn(t, e, a) {
1977
1977
  }
1978
1978
  function Kn(t, e) {
1979
1979
  try {
1980
- return t.toLocaleUpperCase(Ue(e));
1980
+ return t.toLocaleUpperCase(Oe(e));
1981
1981
  } catch {
1982
1982
  return t.toLocaleUpperCase("tr");
1983
1983
  }
@@ -2021,14 +2021,14 @@ function Xn(t) {
2021
2021
  m.className = "gengage-chat-comparison-recommended-info";
2022
2022
  const v = document.createElement("div");
2023
2023
  v.className = "gengage-chat-comparison-recommended-title", v.textContent = e.name, m.appendChild(v);
2024
- const b = document.createElement("div");
2025
- if (b.className = "gengage-chat-comparison-recommended-meta", Yn(e.rating) && b.appendChild(Zn(e.rating)), Lt(e.price)) {
2024
+ const f = document.createElement("div");
2025
+ if (f.className = "gengage-chat-comparison-recommended-meta", Yn(e.rating) && f.appendChild(Zn(e.rating)), Lt(e.price)) {
2026
2026
  const d = document.createElement("div");
2027
- d.className = "gengage-chat-comparison-recommended-price", d.textContent = ae(e.price, t.pricing), b.appendChild(d);
2027
+ d.className = "gengage-chat-comparison-recommended-price", d.textContent = ae(e.price, t.pricing), f.appendChild(d);
2028
2028
  }
2029
- if (b.childElementCount > 0 && m.appendChild(b), t.recommendedText) {
2029
+ if (f.childElementCount > 0 && m.appendChild(f), t.recommendedText) {
2030
2030
  const d = document.createElement("p");
2031
- d.className = "gengage-chat-comparison-recommended-text", d.innerHTML = he(t.recommendedText), m.appendChild(d);
2031
+ d.className = "gengage-chat-comparison-recommended-text", d.innerHTML = fe(t.recommendedText), m.appendChild(d);
2032
2032
  }
2033
2033
  g.appendChild(m);
2034
2034
  const u = () => {
@@ -2046,8 +2046,8 @@ function Xn(t) {
2046
2046
  A.className = "gengage-chat-comparison-highlights-label", A.textContent = s?.highlightsLabel ?? "Key Highlights", d.appendChild(A);
2047
2047
  const y = document.createElement("ul");
2048
2048
  for (const w of r) {
2049
- const z = document.createElement("li");
2050
- z.textContent = w, y.appendChild(z);
2049
+ const H = document.createElement("li");
2050
+ H.textContent = w, y.appendChild(H);
2051
2051
  }
2052
2052
  d.appendChild(y), l.appendChild(d);
2053
2053
  }
@@ -2063,7 +2063,7 @@ function Xn(t) {
2063
2063
  const h = document.createElement("span");
2064
2064
  h.className = "gengage-chat-comparison-key-differences-summary-meta", h.textContent = s?.viewMoreLabel ?? "Show More", p.appendChild(g), p.appendChild(h), l.appendChild(p);
2065
2065
  const m = document.createElement("div");
2066
- m.className = "gengage-chat-comparison-key-differences-content", m.innerHTML = he(Qn(t.keyDifferencesHtml)), l.appendChild(m), c.appendChild(l);
2066
+ m.className = "gengage-chat-comparison-key-differences-content", m.innerHTML = fe(Qn(t.keyDifferencesHtml)), l.appendChild(m), c.appendChild(l);
2067
2067
  }
2068
2068
  if (i && i.length > 0) {
2069
2069
  const l = document.createElement("details");
@@ -2079,22 +2079,22 @@ function Xn(t) {
2079
2079
  l.className = "gengage-chat-comparison-table gds-comparison-table";
2080
2080
  const p = document.createElement("thead"), g = document.createElement("tr"), h = document.createElement("th");
2081
2081
  g.appendChild(h);
2082
- for (const b of a) {
2082
+ for (const f of a) {
2083
2083
  const u = document.createElement("th");
2084
- b.sku === e?.sku && (u.className = "gengage-chat-comparison-selected gds-comparison-table-winner-cell");
2084
+ f.sku === e?.sku && (u.className = "gengage-chat-comparison-selected gds-comparison-table-winner-cell");
2085
2085
  const d = document.createElement("div");
2086
- d.className = "gengage-chat-comparison-table-header-cell gengage-chat-comparison-table-header-cell--clickable gds-clickable", d.tabIndex = 0, d.setAttribute("role", "button"), d.setAttribute("aria-label", b.name), d.title = b.name;
2086
+ d.className = "gengage-chat-comparison-table-header-cell gengage-chat-comparison-table-header-cell--clickable gds-clickable", d.tabIndex = 0, d.setAttribute("role", "button"), d.setAttribute("aria-label", f.name), d.title = f.name;
2087
2087
  const A = () => {
2088
2088
  o({
2089
- sku: b.sku,
2090
- name: b.name
2089
+ sku: f.sku,
2090
+ name: f.name
2091
2091
  });
2092
2092
  };
2093
2093
  if (d.addEventListener("click", A), d.addEventListener("keydown", (w) => {
2094
2094
  w.key !== "Enter" && w.key !== " " || (w.preventDefault(), A());
2095
- }), b.imageUrl && ke(b.imageUrl)) {
2095
+ }), f.imageUrl && ke(f.imageUrl)) {
2096
2096
  const w = document.createElement("img");
2097
- w.src = b.imageUrl, w.alt = b.name, w.loading = "lazy", w.addEventListener("error", () => {
2097
+ w.src = f.imageUrl, w.alt = f.name, w.loading = "lazy", w.addEventListener("error", () => {
2098
2098
  w.style.display = "none";
2099
2099
  }, { once: !0 }), d.appendChild(w);
2100
2100
  } else {
@@ -2102,22 +2102,22 @@ function Xn(t) {
2102
2102
  w.className = "gengage-chat-comparison-table-header-img-placeholder", w.setAttribute("aria-hidden", "true"), d.appendChild(w);
2103
2103
  }
2104
2104
  const y = document.createElement("div");
2105
- if (y.className = "gengage-chat-comparison-table-product-name", y.textContent = b.name, d.appendChild(y), Lt(b.price)) {
2105
+ if (y.className = "gengage-chat-comparison-table-product-name", y.textContent = f.name, d.appendChild(y), Lt(f.price)) {
2106
2106
  const w = document.createElement("div");
2107
- w.className = "gengage-chat-comparison-table-price", w.textContent = ae(b.price, t.pricing), d.appendChild(w);
2107
+ w.className = "gengage-chat-comparison-table-price", w.textContent = ae(f.price, t.pricing), d.appendChild(w);
2108
2108
  }
2109
2109
  u.appendChild(d), g.appendChild(u);
2110
2110
  }
2111
2111
  p.appendChild(g), l.appendChild(p);
2112
2112
  const m = document.createElement("tbody");
2113
- for (const b of n) {
2113
+ for (const f of n) {
2114
2114
  const u = document.createElement("tr"), d = document.createElement("td");
2115
- d.className = "gengage-chat-comparison-label", d.textContent = Wn(b.label, s?.criteriaLabels, t.locale), u.appendChild(d);
2116
- for (let A = 0; A < b.values.length; A++) {
2115
+ d.className = "gengage-chat-comparison-label", d.textContent = Wn(f.label, s?.criteriaLabels, t.locale), u.appendChild(d);
2116
+ for (let A = 0; A < f.values.length; A++) {
2117
2117
  const y = document.createElement("td");
2118
2118
  a[A]?.sku === e?.sku && (y.className = "gengage-chat-comparison-selected gds-comparison-table-winner-cell");
2119
- const w = b.values[A] ?? "";
2120
- oa(w) ? y.innerHTML = he(w) : y.textContent = w, u.appendChild(y);
2119
+ const w = f.values[A] ?? "";
2120
+ oa(w) ? y.innerHTML = fe(w) : y.textContent = w, u.appendChild(y);
2121
2121
  }
2122
2122
  m.appendChild(u);
2123
2123
  }
@@ -2140,7 +2140,7 @@ function Qn(t) {
2140
2140
  return e.length <= 1 ? t : "<ul>" + e.map((a) => `<li>${a.trim()}</li>`).join("") + "</ul>";
2141
2141
  }
2142
2142
  function Jn(t, e) {
2143
- const a = he(e);
2143
+ const a = fe(e);
2144
2144
  if (!a) return;
2145
2145
  const n = document.createElement("template");
2146
2146
  n.innerHTML = a;
@@ -2148,7 +2148,7 @@ function Jn(t, e) {
2148
2148
  if (r.length > 0) {
2149
2149
  for (const o of r) {
2150
2150
  const s = document.createElement("li");
2151
- s.innerHTML = he(o.innerHTML), t.appendChild(s);
2151
+ s.innerHTML = fe(o.innerHTML), t.appendChild(s);
2152
2152
  }
2153
2153
  return;
2154
2154
  }
@@ -2195,16 +2195,16 @@ function sr(t, e) {
2195
2195
  a.className = "gengage-chat-review-highlights";
2196
2196
  const n = t.props?.reviews;
2197
2197
  if (!Array.isArray(n) || n.length === 0) {
2198
- const b = document.createElement("div");
2199
- return b.className = "gengage-chat-review-empty", b.textContent = e?.emptyReviewsMessage ?? "No review summary found.", a.appendChild(b), a;
2198
+ const f = document.createElement("div");
2199
+ return f.className = "gengage-chat-review-empty", f.textContent = e?.emptyReviewsMessage ?? "No review summary found.", a.appendChild(f), a;
2200
2200
  }
2201
- const r = n.filter((b) => b !== null && typeof b == "object"), i = /* @__PURE__ */ new Map();
2202
- for (const b of r) {
2203
- const u = ar(b.review_class), d = nr(b.review_text), A = tr(b.review_tag);
2201
+ const r = n.filter((f) => f !== null && typeof f == "object"), i = /* @__PURE__ */ new Map();
2202
+ for (const f of r) {
2203
+ const u = ar(f.review_class), d = nr(f.review_text), A = tr(f.review_tag);
2204
2204
  for (const y of A) {
2205
2205
  const w = y.toLocaleLowerCase();
2206
- let z = i.get(w);
2207
- if (z || (z = {
2206
+ let H = i.get(w);
2207
+ if (H || (H = {
2208
2208
  key: w,
2209
2209
  label: y,
2210
2210
  mentions: 0,
@@ -2212,19 +2212,19 @@ function sr(t, e) {
2212
2212
  negative: 0,
2213
2213
  neutral: 0,
2214
2214
  snippets: []
2215
- }, i.set(w, z)), z.mentions += 1, u === "positive" ? z.positive += 1 : u === "negative" ? z.negative += 1 : z.neutral += 1, d.length > 0 && z.snippets.length < er && !z.snippets.some((I) => I.text === d)) {
2215
+ }, i.set(w, H)), H.mentions += 1, u === "positive" ? H.positive += 1 : u === "negative" ? H.negative += 1 : H.neutral += 1, d.length > 0 && H.snippets.length < er && !H.snippets.some((I) => I.text === d)) {
2216
2216
  const I = {
2217
2217
  text: d,
2218
2218
  tone: u
2219
2219
  };
2220
- b.review_rating !== void 0 && String(b.review_rating).length > 0 && (I.rating = b.review_rating), z.snippets.push(I);
2220
+ f.review_rating !== void 0 && String(f.review_rating).length > 0 && (I.rating = f.review_rating), H.snippets.push(I);
2221
2221
  }
2222
2222
  }
2223
2223
  }
2224
- const o = Array.from(i.values()).sort((b, u) => u.mentions !== b.mentions ? u.mentions - b.mentions : b.label.localeCompare(u.label));
2224
+ const o = Array.from(i.values()).sort((f, u) => u.mentions !== f.mentions ? u.mentions - f.mentions : f.label.localeCompare(u.label));
2225
2225
  if (o.length === 0) {
2226
- const b = document.createElement("div");
2227
- return b.className = "gengage-chat-review-empty", b.textContent = e?.emptyReviewsMessage ?? "No review summary found.", a.appendChild(b), a;
2226
+ const f = document.createElement("div");
2227
+ return f.className = "gengage-chat-review-empty", f.textContent = e?.emptyReviewsMessage ?? "No review summary found.", a.appendChild(f), a;
2228
2228
  }
2229
2229
  const s = (e?.reviewFilterPositive ?? "positive").toLowerCase(), c = (e?.reviewFilterNegative ?? "negative").toLowerCase(), l = document.createElement("div");
2230
2230
  l.className = "gengage-chat-review-subjects-heading", l.textContent = e?.reviewSubjectsHeading ?? "Select to learn more", a.appendChild(l);
@@ -2236,27 +2236,27 @@ function sr(t, e) {
2236
2236
  const m = () => {
2237
2237
  for (; h.firstChild; ) h.removeChild(h.firstChild);
2238
2238
  if (!p) return;
2239
- const b = o.find((y) => y.key === p);
2240
- if (!b) return;
2239
+ const f = o.find((y) => y.key === p);
2240
+ if (!f) return;
2241
2241
  const u = document.createElement("div");
2242
2242
  u.className = "gengage-chat-review-detail-meta";
2243
2243
  const d = document.createElement("span");
2244
- if (d.className = "gengage-chat-review-detail-mentions", d.textContent = `${or(b.mentions, e?.reviewCustomersMentionSingular, e?.reviewCustomersMentionPlural)} "${b.label}"`, u.appendChild(d), b.positive > 0) {
2244
+ if (d.className = "gengage-chat-review-detail-mentions", d.textContent = `${or(f.mentions, e?.reviewCustomersMentionSingular, e?.reviewCustomersMentionPlural)} "${f.label}"`, u.appendChild(d), f.positive > 0) {
2245
2245
  const y = document.createElement("span");
2246
- y.className = "gengage-chat-review-detail-positive", y.textContent = `${b.positive} ${s}`, u.appendChild(y);
2246
+ y.className = "gengage-chat-review-detail-positive", y.textContent = `${f.positive} ${s}`, u.appendChild(y);
2247
2247
  }
2248
- if (b.negative > 0) {
2248
+ if (f.negative > 0) {
2249
2249
  const y = document.createElement("span");
2250
- y.className = "gengage-chat-review-detail-negative", y.textContent = `${b.negative} ${c}`, u.appendChild(y);
2250
+ y.className = "gengage-chat-review-detail-negative", y.textContent = `${f.negative} ${c}`, u.appendChild(y);
2251
2251
  }
2252
2252
  h.appendChild(u);
2253
2253
  const A = document.createElement("div");
2254
2254
  A.className = "gengage-chat-review-snippets";
2255
- for (const y of b.snippets) {
2255
+ for (const y of f.snippets) {
2256
2256
  const w = document.createElement("article");
2257
2257
  w.className = "gengage-chat-review-snippet", w.dataset.tone = y.tone;
2258
- const z = document.createElement("div");
2259
- if (z.className = "gengage-chat-review-snippet-text", z.textContent = `"${y.text}"`, w.appendChild(z), y.rating !== void 0 && String(y.rating).length > 0) {
2258
+ const H = document.createElement("div");
2259
+ if (H.className = "gengage-chat-review-snippet-text", H.textContent = `"${y.text}"`, w.appendChild(H), y.rating !== void 0 && String(y.rating).length > 0) {
2260
2260
  const I = document.createElement("div");
2261
2261
  I.className = "gengage-chat-review-snippet-rating", I.textContent = `★ ${String(y.rating)}`, w.appendChild(I);
2262
2262
  }
@@ -2264,21 +2264,21 @@ function sr(t, e) {
2264
2264
  }
2265
2265
  h.appendChild(A);
2266
2266
  }, v = () => {
2267
- for (const b of g.querySelectorAll(".gengage-chat-review-subject")) {
2268
- const u = b.dataset.subjectKey === p;
2269
- b.classList.toggle("gengage-chat-review-subject--active", u), b.classList.toggle("gds-chip-active", u), b.setAttribute("aria-pressed", String(u));
2267
+ for (const f of g.querySelectorAll(".gengage-chat-review-subject")) {
2268
+ const u = f.dataset.subjectKey === p;
2269
+ f.classList.toggle("gengage-chat-review-subject--active", u), f.classList.toggle("gds-chip-active", u), f.setAttribute("aria-pressed", String(u));
2270
2270
  }
2271
2271
  };
2272
- for (const b of o) {
2273
- const u = rr(b), d = document.createElement("button");
2274
- d.type = "button", d.className = "gengage-chat-review-subject gds-chip", d.dataset.subjectKey = b.key, d.dataset.tone = u;
2272
+ for (const f of o) {
2273
+ const u = rr(f), d = document.createElement("button");
2274
+ d.type = "button", d.className = "gengage-chat-review-subject gds-chip", d.dataset.subjectKey = f.key, d.dataset.tone = u;
2275
2275
  const A = document.createElement("span");
2276
2276
  A.className = "gengage-chat-review-subject-icon", A.appendChild(ir(u)), d.appendChild(A);
2277
2277
  const y = document.createElement("span");
2278
- y.className = "gengage-chat-review-subject-label", y.textContent = b.label, d.appendChild(y);
2278
+ y.className = "gengage-chat-review-subject-label", y.textContent = f.label, d.appendChild(y);
2279
2279
  const w = document.createElement("span");
2280
- w.className = "gengage-chat-review-subject-count", w.textContent = `(${b.mentions})`, d.appendChild(w), d.addEventListener("click", () => {
2281
- p = b.key, v(), m();
2280
+ w.className = "gengage-chat-review-subject-count", w.textContent = `(${f.mentions})`, d.appendChild(w), d.addEventListener("click", () => {
2281
+ p = f.key, v(), m();
2282
2282
  }), g.appendChild(d);
2283
2283
  }
2284
2284
  return a.appendChild(g), v(), m(), a.appendChild(h), a;
@@ -2329,7 +2329,7 @@ function Qe(t) {
2329
2329
  const i = document.createElement("div");
2330
2330
  i.className = "gengage-chat-campaign-price-badge__logo";
2331
2331
  const o = document.createElement("img");
2332
- o.alt = "", o.loading = "lazy", o.src = t.logoUrl, fe(o), i.appendChild(o), e.appendChild(i);
2332
+ o.alt = "", o.loading = "lazy", o.src = t.logoUrl, be(o), i.appendChild(o), e.appendChild(i);
2333
2333
  }
2334
2334
  const a = document.createElement("div");
2335
2335
  a.className = "gengage-chat-campaign-price-badge__body";
@@ -2377,7 +2377,7 @@ function pr(t, e, a, n, r) {
2377
2377
  const o = t.product, s = o.imageUrl;
2378
2378
  if (s && ke(s)) {
2379
2379
  const l = document.createElement("img");
2380
- l.className = "gengage-chat-ai-toppick-img", l.dataset.gengagePart = "ai-top-pick-image", ce(l, "src", s), l.loading = "lazy", l.alt = e, fe(l), i.appendChild(l);
2380
+ l.className = "gengage-chat-ai-toppick-img", l.dataset.gengagePart = "ai-top-pick-image", ge(l, "src", s), l.loading = "lazy", l.alt = e, be(l), i.appendChild(l);
2381
2381
  }
2382
2382
  const c = sa(t);
2383
2383
  if (c && !r?.skipOverlayActions) {
@@ -2386,8 +2386,8 @@ function pr(t, e, a, n, r) {
2386
2386
  const m = document.createElement("button");
2387
2387
  m.className = "gengage-chat-favorite-btn", m.type = "button", m.dataset.gengageFavoriteSku = c, m.setAttribute("aria-label", n.i18n?.addToFavoritesLabel ?? "Add to favorites");
2388
2388
  const v = n.favoritedSkus?.has(c) ?? !1;
2389
- v && m.classList.add("gengage-chat-favorite-btn--active"), m.innerHTML = `<svg width="14" height="14" viewBox="0 0 24 24" fill="${v ? "currentColor" : "none"}" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>`, m.addEventListener("click", (b) => {
2390
- b.stopPropagation(), m.classList.toggle("gengage-chat-favorite-btn--active"), m.querySelector("svg")?.setAttribute("fill", m.classList.contains("gengage-chat-favorite-btn--active") ? "currentColor" : "none"), n.onFavoriteToggle?.(c, o);
2389
+ v && m.classList.add("gengage-chat-favorite-btn--active"), m.innerHTML = `<svg width="14" height="14" viewBox="0 0 24 24" fill="${v ? "currentColor" : "none"}" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>`, m.addEventListener("click", (f) => {
2390
+ f.stopPropagation(), m.classList.toggle("gengage-chat-favorite-btn--active"), m.querySelector("svg")?.setAttribute("fill", m.classList.contains("gengage-chat-favorite-btn--active") ? "currentColor" : "none"), n.onFavoriteToggle?.(c, o);
2391
2391
  }), l.appendChild(m);
2392
2392
  }
2393
2393
  const p = n.i18n?.findSimilarLabel ?? "Find Similar", g = document.createElement("button");
@@ -2478,17 +2478,17 @@ function It(t, e, a, n) {
2478
2478
  })) : h && (r.classList.add("gds-clickable"), r.addEventListener("click", (_) => {
2479
2479
  _.target.closest(".gengage-chat-ai-toppick-cta") || _.target.closest(".gengage-chat-favorite-btn") || _.target.closest(".gengage-chat-find-similar-pill") || e.onAction(h);
2480
2480
  }));
2481
- const m = o.name || "Product image", v = !a && e.isMobile === !0 && !i, b = a ? At(t.role, e.i18n) ?? e.i18n?.roleWinner ?? "TOP MATCH" : At(t.role, e.i18n);
2482
- if (b && !v) {
2481
+ const m = o.name || "Product image", v = !a && e.isMobile === !0 && !i, f = a ? At(t.role, e.i18n) ?? e.i18n?.roleWinner ?? "TOP MATCH" : At(t.role, e.i18n);
2482
+ if (f && !v) {
2483
2483
  const _ = document.createElement("span");
2484
- _.className = "gengage-chat-ai-toppick-badge gds-badge", _.dataset.gengagePart = "ai-top-pick-role-badge", _.textContent = b, r.appendChild(_);
2484
+ _.className = "gengage-chat-ai-toppick-badge gds-badge", _.dataset.gengagePart = "ai-top-pick-role-badge", _.textContent = f, r.appendChild(_);
2485
2485
  }
2486
2486
  const u = document.createElement("div");
2487
2487
  u.className = "gengage-chat-ai-toppick-top-row", u.dataset.gengagePart = "ai-top-pick-top-row", pr(t, m, u, e, { skipOverlayActions: v });
2488
2488
  const d = document.createElement("div");
2489
- if (d.className = "gengage-chat-ai-toppick-body", d.dataset.gengagePart = "ai-top-pick-body", b && v) {
2489
+ if (d.className = "gengage-chat-ai-toppick-body", d.dataset.gengagePart = "ai-top-pick-body", f && v) {
2490
2490
  const _ = document.createElement("div");
2491
- _.className = "gengage-chat-ai-toppick-role-line", _.dataset.gengagePart = "ai-top-pick-role-line", _.textContent = b, d.appendChild(_);
2491
+ _.className = "gengage-chat-ai-toppick-role-line", _.dataset.gengagePart = "ai-top-pick-role-line", _.textContent = f, d.appendChild(_);
2492
2492
  }
2493
2493
  const A = o.name;
2494
2494
  if (A) {
@@ -2507,13 +2507,13 @@ function It(t, e, a, n) {
2507
2507
  }
2508
2508
  }
2509
2509
  w.childNodes.length > 0 && r.appendChild(w);
2510
- const z = !!(s && e.topPicksLoadingSku === s), I = (g || h) && !v;
2511
- if (z || g || h) {
2510
+ const H = !!(s && e.topPicksLoadingSku === s), I = (g || h) && !v;
2511
+ if (H || g || h) {
2512
2512
  const _ = document.createElement("div");
2513
- if (_.className = "gengage-chat-ai-toppick-spinner", _.dataset.gengagePart = "ai-top-pick-spinner", _.style.display = z ? "" : "none", r.appendChild(_), I) {
2513
+ if (_.className = "gengage-chat-ai-toppick-spinner", _.dataset.gengagePart = "ai-top-pick-spinner", _.style.display = H ? "" : "none", r.appendChild(_), I) {
2514
2514
  const S = document.createElement("button");
2515
- S.className = "gengage-chat-ai-toppick-cta gds-btn gds-btn-primary", S.dataset.gengagePart = "ai-top-pick-cta", S.type = "button", S.textContent = g ? e.i18n?.addToCartButton ?? "Add to Cart" : e.i18n?.viewDetails ?? "View Details", S.addEventListener("click", (H) => {
2516
- if (H.stopPropagation(), g) {
2515
+ S.className = "gengage-chat-ai-toppick-cta gds-btn gds-btn-primary", S.dataset.gengagePart = "ai-top-pick-cta", S.type = "button", S.textContent = g ? e.i18n?.addToCartButton ?? "Add to Cart" : e.i18n?.viewDetails ?? "View Details", S.addEventListener("click", (F) => {
2516
+ if (F.stopPropagation(), g) {
2517
2517
  e.onAction({
2518
2518
  title: e.i18n?.addToCartButton ?? "Add to Cart",
2519
2519
  type: "addToCart",
@@ -2766,7 +2766,7 @@ function Er(t) {
2766
2766
  const e = document.createElement("div");
2767
2767
  if (e.className = "gengage-chat-categories-group-selection", e.dataset.gengagePart = "categories-group-selection", t.image && ke(t.image)) {
2768
2768
  const n = document.createElement("img");
2769
- n.className = "gengage-chat-categories-group-selection-image", n.draggable = !1, n.src = t.image, n.alt = t.groupName, n.loading = "lazy", fe(n), e.appendChild(n);
2769
+ n.className = "gengage-chat-categories-group-selection-image", n.draggable = !1, n.src = t.image, n.alt = t.groupName, n.loading = "lazy", be(n), e.appendChild(n);
2770
2770
  }
2771
2771
  const a = document.createElement("div");
2772
2772
  return a.className = "gengage-chat-categories-group-selection-title", a.textContent = t.groupName, e.appendChild(a), e;
@@ -2795,10 +2795,10 @@ function Lr(t, e) {
2795
2795
  const g = a[p], h = `${r}-tab-${p}`, m = `${r}-panel-${p}`, v = document.createElement("button");
2796
2796
  if (v.className = "gengage-chat-categories-tab gds-tab", v.type = "button", v.dataset.gengagePart = "categories-tab", v.id = h, v.setAttribute("role", "tab"), v.setAttribute("aria-controls", m), v.setAttribute("aria-selected", String(p === 0)), v.tabIndex = p === 0 ? 0 : -1, p === 0 && v.classList.add("gengage-chat-categories-tab--active", "is-active"), g.image && ke(g.image)) {
2797
2797
  const y = document.createElement("img");
2798
- y.className = "gengage-chat-categories-tab-image", y.draggable = !1, y.src = g.image, y.alt = g.groupName, y.loading = "lazy", fe(y), v.appendChild(y);
2798
+ y.className = "gengage-chat-categories-tab-image", y.draggable = !1, y.src = g.image, y.alt = g.groupName, y.loading = "lazy", be(y), v.appendChild(y);
2799
2799
  }
2800
- const b = document.createElement("span");
2801
- b.className = "gengage-chat-categories-tab-text", b.textContent = g.groupName, v.appendChild(b), v.addEventListener("click", () => l(p)), v.addEventListener("keydown", (y) => {
2800
+ const f = document.createElement("span");
2801
+ f.className = "gengage-chat-categories-tab-text", f.textContent = g.groupName, v.appendChild(f), v.addEventListener("click", () => l(p)), v.addEventListener("keydown", (y) => {
2802
2802
  let w = -1;
2803
2803
  y.key === "ArrowRight" || y.key === "ArrowDown" ? w = (p + 1) % a.length : y.key === "ArrowLeft" || y.key === "ArrowUp" ? w = (p - 1 + a.length) % a.length : y.key === "Home" ? w = 0 : y.key === "End" && (w = a.length - 1), w >= 0 && (y.preventDefault(), l(w), s[w].focus());
2804
2804
  }), s.push(v), o.appendChild(v);
@@ -2833,7 +2833,7 @@ function Tr(t, e) {
2833
2833
  const a = document.createElement("div");
2834
2834
  if (a.className = "gengage-chat-product-card gds-card gds-product-card gds-card-interactive", a.dataset.gengagePart = "categories-product-card", t.imageUrl && ke(t.imageUrl)) {
2835
2835
  const i = document.createElement("img");
2836
- i.className = "gengage-chat-product-card-img", i.draggable = !1, i.src = t.imageUrl, i.alt = t.name, i.loading = "lazy", fe(i), a.appendChild(i);
2836
+ i.className = "gengage-chat-product-card-img", i.draggable = !1, i.src = t.imageUrl, i.alt = t.name, i.loading = "lazy", be(i), a.appendChild(i);
2837
2837
  }
2838
2838
  const n = document.createElement("div");
2839
2839
  n.className = "gengage-chat-product-card-body";
@@ -2897,27 +2897,27 @@ function Nr(t, e) {
2897
2897
  }
2898
2898
  };
2899
2899
  if (g.addEventListener("click", () => e.onAction(m)), n) {
2900
- const b = document.createElement("div");
2901
- b.className = "gengage-chat-panel-restore-card__eyebrow", b.textContent = n, g.appendChild(b);
2900
+ const f = document.createElement("div");
2901
+ f.className = "gengage-chat-panel-restore-card__eyebrow", f.textContent = n, g.appendChild(f);
2902
2902
  }
2903
2903
  if (p.length > 0) {
2904
- const b = document.createElement("div");
2905
- b.className = "gengage-chat-panel-restore-card__previews";
2904
+ const f = document.createElement("div");
2905
+ f.className = "gengage-chat-panel-restore-card__previews";
2906
2906
  for (const u of p) {
2907
2907
  const d = document.createElement("div");
2908
2908
  d.className = "gengage-chat-panel-restore-card__thumb";
2909
2909
  const A = u.imageUrl;
2910
- if (A && be(A)) {
2910
+ if (A && ve(A)) {
2911
2911
  const y = document.createElement("img");
2912
- y.loading = "lazy", y.alt = u.name || r, ce(y, "src", A), fe(y), d.appendChild(y);
2912
+ y.loading = "lazy", y.alt = u.name || r, ge(y, "src", A), be(y), d.appendChild(y);
2913
2913
  }
2914
- b.appendChild(d);
2914
+ f.appendChild(d);
2915
2915
  }
2916
- g.appendChild(b);
2916
+ g.appendChild(f);
2917
2917
  }
2918
2918
  if (i && r) {
2919
- const b = document.createElement("div");
2920
- b.className = "gengage-chat-panel-restore-card__title", b.textContent = r, b.title = r, g.appendChild(b);
2919
+ const f = document.createElement("div");
2920
+ f.className = "gengage-chat-panel-restore-card__title", f.textContent = r, f.title = r, g.appendChild(f);
2921
2921
  }
2922
2922
  const v = document.createElement("div");
2923
2923
  return v.className = "gengage-chat-panel-restore-card__cta", v.textContent = o, g.appendChild(v), g;
@@ -2929,11 +2929,11 @@ function Br(t, e) {
2929
2929
  d.target.closest("a") || e.onProductSelect?.(a);
2930
2930
  });
2931
2931
  const r = a.imageUrl;
2932
- if (r && be(r)) {
2932
+ if (r && ve(r)) {
2933
2933
  const d = document.createElement("div");
2934
2934
  d.className = "gengage-chat-product-summary__image", d.dataset.gengagePart = "product-summary-image";
2935
2935
  const A = document.createElement("img");
2936
- A.loading = "lazy", ce(A, "src", r), A.alt = a.name || "Product image", fe(A), d.appendChild(A), n.appendChild(d);
2936
+ A.loading = "lazy", ge(A, "src", r), A.alt = a.name || "Product image", be(A), d.appendChild(A), n.appendChild(d);
2937
2937
  }
2938
2938
  const i = document.createElement("div");
2939
2939
  i.className = "gengage-chat-product-summary__content", i.dataset.gengagePart = "product-summary-content";
@@ -2957,8 +2957,8 @@ function Br(t, e) {
2957
2957
  if (p) {
2958
2958
  const d = He(e, a), A = $e(e, a), y = !!(g && g !== p), w = document.createElement("div");
2959
2959
  w.className = "gengage-chat-product-summary__price", w.dataset.gengagePart = "product-summary-price";
2960
- const z = !!(d && y), I = Xe(e, a);
2961
- if (z) {
2960
+ const H = !!(d && y), I = Xe(e, a);
2961
+ if (H) {
2962
2962
  const _ = Qe({
2963
2963
  reasonText: d,
2964
2964
  salePriceFormatted: ae(p, e.pricing),
@@ -2968,8 +2968,8 @@ function Br(t, e) {
2968
2968
  w.classList.add("gengage-chat-product-summary__price--inline"), w.appendChild(_);
2969
2969
  const S = document.createElement("span");
2970
2970
  S.className = "gengage-chat-product-summary__price-sep", S.setAttribute("aria-hidden", "true");
2971
- const H = document.createElement("span");
2972
- H.className = "gengage-chat-product-summary__price-original", H.textContent = ae(g, e.pricing), w.appendChild(S), w.appendChild(H);
2971
+ const F = document.createElement("span");
2972
+ F.className = "gengage-chat-product-summary__price-original", F.textContent = ae(g, e.pricing), w.appendChild(S), w.appendChild(F);
2973
2973
  } else {
2974
2974
  const S = document.createElement("span");
2975
2975
  S.className = "gengage-chat-product-summary__price-original", S.textContent = ae(g, e.pricing), w.appendChild(S), w.appendChild(document.createTextNode(" ")), w.appendChild(_);
@@ -2982,8 +2982,8 @@ function Br(t, e) {
2982
2982
  _.className = "gengage-chat-product-summary__price-current", _.textContent = ae(p, e.pricing);
2983
2983
  const S = document.createElement("span");
2984
2984
  S.className = "gengage-chat-product-summary__price-sep", S.setAttribute("aria-hidden", "true");
2985
- const H = document.createElement("span");
2986
- H.className = "gengage-chat-product-summary__price-original", H.textContent = ae(g, e.pricing), w.appendChild(_), w.appendChild(S), w.appendChild(H);
2985
+ const F = document.createElement("span");
2986
+ F.className = "gengage-chat-product-summary__price-original", F.textContent = ae(g, e.pricing), w.appendChild(_), w.appendChild(S), w.appendChild(F);
2987
2987
  } else if (y) {
2988
2988
  const _ = document.createElement("span");
2989
2989
  _.className = "gengage-chat-product-summary__price-original", _.textContent = ae(g, e.pricing), w.appendChild(_), w.appendChild(document.createTextNode(" "));
@@ -3000,8 +3000,8 @@ function Br(t, e) {
3000
3000
  }
3001
3001
  }
3002
3002
  n.appendChild(i);
3003
- const h = a.url, m = a.sku, v = a.cartCode ?? a.cart_code, b = typeof v == "string" && v.trim() ? v.trim() : void 0, u = a.inStock;
3004
- if (m && b && u !== !1) {
3003
+ const h = a.url, m = a.sku, v = a.cartCode ?? a.cart_code, f = typeof v == "string" && v.trim() ? v.trim() : void 0, u = a.inStock;
3004
+ if (m && f && u !== !1) {
3005
3005
  const d = document.createElement("button");
3006
3006
  d.type = "button", d.className = "gengage-chat-product-summary__cta gds-chip gds-chip-active", d.dataset.gengagePart = "product-summary-cta", d.textContent = e.i18n?.addToCartButton ?? "Add to Cart", d.addEventListener("click", (A) => {
3007
3007
  A.stopPropagation(), e.onAction({
@@ -3009,14 +3009,14 @@ function Br(t, e) {
3009
3009
  type: "addToCart",
3010
3010
  payload: {
3011
3011
  sku: m,
3012
- cartCode: b,
3012
+ cartCode: f,
3013
3013
  quantity: 1
3014
3014
  }
3015
3015
  });
3016
3016
  }), n.appendChild(d);
3017
- } else if (h && be(h)) {
3017
+ } else if (h && ve(h)) {
3018
3018
  const d = document.createElement("a");
3019
- d.className = "gengage-chat-product-summary__cta gds-chip gds-chip-active", d.dataset.gengagePart = "product-summary-cta", ce(d, "href", h), ce(d, "target", "_blank"), ce(d, "rel", "noopener noreferrer"), d.textContent = e.i18n?.productCtaLabel ?? "View", n.appendChild(d);
3019
+ d.className = "gengage-chat-product-summary__cta gds-chip gds-chip-active", d.dataset.gengagePart = "product-summary-cta", ge(d, "href", h), ge(d, "target", "_blank"), ge(d, "rel", "noopener noreferrer"), d.textContent = e.i18n?.productCtaLabel ?? "View", n.appendChild(d);
3020
3020
  }
3021
3021
  return n;
3022
3022
  }
@@ -3190,7 +3190,7 @@ function dt(t, e) {
3190
3190
  if (!n) return a;
3191
3191
  const r = n.sku;
3192
3192
  r && (a.dataset.sku = r);
3193
- const i = t.props?.action, o = n.name, s = n.url, c = n.sku, l = s && be(s) ? s : void 0, p = () => i?.type !== "launchSingleProduct" || l === void 0 || c === void 0 || e.onProductClick === void 0 ? !1 : (e.onProductClick({
3193
+ const i = t.props?.action, o = n.name, s = n.url, c = n.sku, l = s && ve(s) ? s : void 0, p = () => i?.type !== "launchSingleProduct" || l === void 0 || c === void 0 || e.onProductClick === void 0 ? !1 : (e.onProductClick({
3194
3194
  sku: c,
3195
3195
  url: l,
3196
3196
  ...typeof o == "string" ? { name: o } : {}
@@ -3205,43 +3205,43 @@ function dt(t, e) {
3205
3205
  }
3206
3206
  }));
3207
3207
  const g = n.imageUrl;
3208
- if (g && be(g)) {
3208
+ if (g && ve(g)) {
3209
3209
  const k = document.createElement("div");
3210
3210
  k.className = "gengage-chat-product-card-img-wrapper";
3211
- const D = document.createElement("img");
3212
- D.className = "gengage-chat-product-card-img", D.loading = "lazy", ce(D, "src", g);
3211
+ const U = document.createElement("img");
3212
+ U.className = "gengage-chat-product-card-img", U.loading = "lazy", ge(U, "src", g);
3213
3213
  const q = n.name;
3214
- q && (D.alt = q), fe(D), k.appendChild(D);
3214
+ q && (U.alt = q), be(U), k.appendChild(U);
3215
3215
  const K = n.discountPercent;
3216
3216
  if (!e.hideProductDiscountBadge && typeof K == "number" && K > 0) {
3217
- const f = document.createElement("span");
3218
- f.className = "gengage-chat-product-card-discount-badge", f.textContent = `%${ea(K)}`, k.appendChild(f);
3217
+ const b = document.createElement("span");
3218
+ b.className = "gengage-chat-product-card-discount-badge", b.textContent = `%${ea(K)}`, k.appendChild(b);
3219
3219
  }
3220
3220
  const O = document.createElement("div");
3221
3221
  O.className = "gengage-chat-product-card-img-actions";
3222
- const te = n.sku;
3223
- if (te && e.onFavoriteToggle) {
3224
- const f = document.createElement("button");
3225
- f.className = "gengage-chat-favorite-btn", f.type = "button", f.dataset.gengageFavoriteSku = te, f.setAttribute("aria-label", e.i18n?.addToFavoritesLabel ?? "Add to favorites");
3226
- const C = e.favoritedSkus?.has(te) ?? !1;
3227
- C && f.classList.add("gengage-chat-favorite-btn--active"), f.innerHTML = `<svg width="14" height="14" viewBox="0 0 24 24" fill="${C ? "currentColor" : "none"}" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>`, f.addEventListener("click", (L) => {
3228
- L.stopPropagation(), f.classList.toggle("gengage-chat-favorite-btn--active");
3229
- const U = f.querySelector("svg");
3230
- U && U.setAttribute("fill", f.classList.contains("gengage-chat-favorite-btn--active") ? "currentColor" : "none"), e.onFavoriteToggle(te, n);
3231
- }), O.appendChild(f);
3232
- }
3233
- const Y = n.sku, V = e.i18n?.findSimilarLabel ?? "Find Similar";
3234
- if (Y) {
3235
- const f = document.createElement("button");
3236
- f.className = "gengage-chat-find-similar-pill", f.type = "button", f.setAttribute("aria-label", V), f.dataset.tooltip = V, f.innerHTML = '<span class="gengage-chat-find-similar-pill-icon" aria-hidden="true"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round"><circle cx="10.5" cy="10.5" r="6.5"/><path d="M16 16l5.5 5.5"/></svg></span>';
3237
- const C = document.createElement("span");
3238
- C.className = "gengage-chat-find-similar-pill-text", C.textContent = V, f.appendChild(C), f.addEventListener("click", (L) => {
3239
- L.stopPropagation(), e.onAction({
3240
- title: V,
3222
+ const ee = n.sku;
3223
+ if (ee && e.onFavoriteToggle) {
3224
+ const b = document.createElement("button");
3225
+ b.className = "gengage-chat-favorite-btn", b.type = "button", b.dataset.gengageFavoriteSku = ee, b.setAttribute("aria-label", e.i18n?.addToFavoritesLabel ?? "Add to favorites");
3226
+ const E = e.favoritedSkus?.has(ee) ?? !1;
3227
+ E && b.classList.add("gengage-chat-favorite-btn--active"), b.innerHTML = `<svg width="14" height="14" viewBox="0 0 24 24" fill="${E ? "currentColor" : "none"}" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>`, b.addEventListener("click", (T) => {
3228
+ T.stopPropagation(), b.classList.toggle("gengage-chat-favorite-btn--active");
3229
+ const j = b.querySelector("svg");
3230
+ j && j.setAttribute("fill", b.classList.contains("gengage-chat-favorite-btn--active") ? "currentColor" : "none"), e.onFavoriteToggle(ee, n);
3231
+ }), O.appendChild(b);
3232
+ }
3233
+ const X = n.sku, $ = e.i18n?.findSimilarLabel ?? "Find Similar";
3234
+ if (X) {
3235
+ const b = document.createElement("button");
3236
+ b.className = "gengage-chat-find-similar-pill", b.type = "button", b.setAttribute("aria-label", $), b.dataset.tooltip = $, b.innerHTML = '<span class="gengage-chat-find-similar-pill-icon" aria-hidden="true"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round"><circle cx="10.5" cy="10.5" r="6.5"/><path d="M16 16l5.5 5.5"/></svg></span>';
3237
+ const E = document.createElement("span");
3238
+ E.className = "gengage-chat-find-similar-pill-text", E.textContent = $, b.appendChild(E), b.addEventListener("click", (T) => {
3239
+ T.stopPropagation(), e.onAction({
3240
+ title: $,
3241
3241
  type: "findSimilar",
3242
- payload: { sku: Y }
3242
+ payload: { sku: X }
3243
3243
  });
3244
- }), O.appendChild(f);
3244
+ }), O.appendChild(b);
3245
3245
  }
3246
3246
  O.childElementCount > 0 && k.appendChild(O), a.appendChild(k);
3247
3247
  }
@@ -3252,11 +3252,11 @@ function dt(t, e) {
3252
3252
  const k = document.createElement("div");
3253
3253
  k.className = "gengage-chat-product-card-brand", k.textContent = m, h.appendChild(k);
3254
3254
  }
3255
- const v = n.rating, b = n.reviewCount, u = n.price, d = n.originalPrice, A = n.price_async, y = He(e, n), w = $e(e, n), z = !!(d && u && d !== u && parseFloat(u) > 0), I = !!(y && z), _ = !!(y && !I || z && w === "inline"), S = typeof v == "number" && Number.isFinite(v) && v > 0, H = document.createElement("div");
3256
- H.className = "gengage-chat-product-card-meta-row";
3255
+ const v = n.rating, f = n.reviewCount, u = n.price, d = n.originalPrice, A = n.price_async, y = He(e, n), w = $e(e, n), H = !!(d && u && d !== u && parseFloat(u) > 0), I = !!(y && H), _ = !!(y && !I || H && w === "inline"), S = typeof v == "number" && Number.isFinite(v) && v > 0, F = document.createElement("div");
3256
+ F.className = "gengage-chat-product-card-meta-row";
3257
3257
  const W = document.createElement("div");
3258
3258
  W.className = "gengage-chat-product-card-price gengage-chat-product-card-price-block";
3259
- const X = _ ? (() => {
3259
+ const J = _ ? (() => {
3260
3260
  const k = document.createElement("div");
3261
3261
  return k.className = "gengage-chat-product-card-price-stack", y && !I && k.appendChild(Ze(y)), k.appendChild(W), k;
3262
3262
  })() : W;
@@ -3266,59 +3266,59 @@ function dt(t, e) {
3266
3266
  k.parentElement && (u && parseFloat(u) > 0 ? Mt(W, e, n, u, n.originalPrice) : k.remove());
3267
3267
  }, 300);
3268
3268
  } else u && parseFloat(u) > 0 && Mt(W, e, n, u, d);
3269
- if ((W.childElementCount > 0 || A === !0) && H.appendChild(X), S) {
3269
+ if ((W.childElementCount > 0 || A === !0) && F.appendChild(J), S) {
3270
3270
  const k = document.createElement("div");
3271
3271
  k.className = "gengage-chat-product-card-rating gengage-chat-product-card-rating-compact";
3272
- const D = Jt(v), q = [`${D.toFixed(1)}`, "out of 5 stars"];
3273
- typeof b == "number" && Number.isFinite(b) && q.push(`(${b} reviews)`), k.setAttribute("aria-label", q.join(" "));
3272
+ const U = Jt(v), q = [`${U.toFixed(1)}`, "out of 5 stars"];
3273
+ typeof f == "number" && Number.isFinite(f) && q.push(`(${f} reviews)`), k.setAttribute("aria-label", q.join(" "));
3274
3274
  const K = document.createElement("span");
3275
3275
  K.className = "gengage-chat-product-card-rating-compact-star", K.setAttribute("aria-hidden", "true"), K.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M12 3.6l2.58 5.23 5.77.84-4.17 4.07.98 5.75L12 16.78l-5.16 2.71.99-5.75L3.66 9.67l5.76-.84L12 3.6z"/></svg>';
3276
3276
  const O = document.createElement("span");
3277
- O.className = "gengage-chat-product-card-rating-compact-value", O.textContent = D.toFixed(1), k.appendChild(K), k.appendChild(O), H.appendChild(k);
3277
+ O.className = "gengage-chat-product-card-rating-compact-value", O.textContent = U.toFixed(1), k.appendChild(K), k.appendChild(O), F.appendChild(k);
3278
3278
  }
3279
- if (H.childElementCount === 0 && (H.classList.add("gengage-chat-product-card-meta-row--empty"), H.setAttribute("aria-hidden", "true")), h.appendChild(H), o) {
3279
+ if (F.childElementCount === 0 && (F.classList.add("gengage-chat-product-card-meta-row--empty"), F.setAttribute("aria-hidden", "true")), h.appendChild(F), o) {
3280
3280
  const k = document.createElement("div");
3281
3281
  k.className = "gengage-chat-product-card-name", k.textContent = o, k.title = o, h.appendChild(k);
3282
3282
  }
3283
- const P = n.inStock;
3284
- if (e.hideStockStatus !== !0 && typeof P == "boolean") {
3283
+ const L = n.inStock;
3284
+ if (e.hideStockStatus !== !0 && typeof L == "boolean") {
3285
3285
  const k = document.createElement("div");
3286
- k.className = `gengage-chat-product-card-stock ${P ? "is-in-stock" : "is-out-of-stock"}`, k.textContent = P ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", h.appendChild(k);
3286
+ k.className = `gengage-chat-product-card-stock ${L ? "is-in-stock" : "is-out-of-stock"}`, k.textContent = L ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", h.appendChild(k);
3287
3287
  }
3288
3288
  a.appendChild(h);
3289
- const E = n.cartCode, N = !!(E && c && P !== !1), B = e.i18n?.productCtaLabel ?? "View";
3290
- if (N) {
3289
+ const P = n.cartCode, B = !!(P && c && L !== !1), N = e.i18n?.productCtaLabel ?? "View";
3290
+ if (B) {
3291
3291
  const k = document.createElement("div");
3292
3292
  k.className = "gengage-chat-product-card-buy-footer";
3293
- const D = document.createElement("button");
3294
- D.type = "button", D.className = "gengage-chat-product-card-buy-trigger", D.textContent = B, D.addEventListener("click", (q) => {
3293
+ const U = document.createElement("button");
3294
+ U.type = "button", U.className = "gengage-chat-product-card-buy-trigger", U.textContent = N, U.addEventListener("click", (q) => {
3295
3295
  q.stopPropagation(), e.onAction({
3296
- title: e.i18n?.addToCartButton ?? B,
3296
+ title: e.i18n?.addToCartButton ?? N,
3297
3297
  type: "addToCart",
3298
3298
  payload: {
3299
3299
  sku: c,
3300
- cartCode: E,
3300
+ cartCode: P,
3301
3301
  quantity: 1
3302
3302
  }
3303
3303
  });
3304
- }), k.appendChild(D), a.appendChild(k);
3304
+ }), k.appendChild(U), a.appendChild(k);
3305
3305
  } else if (i) {
3306
3306
  const k = document.createElement("button");
3307
- k.className = "gengage-chat-product-card-cta", k.type = "button", k.textContent = i.type === "launchSingleProduct" ? B : i.title || B, k.addEventListener("click", (D) => {
3307
+ k.className = "gengage-chat-product-card-cta", k.type = "button", k.textContent = i.type === "launchSingleProduct" ? N : i.title || N, k.addEventListener("click", (U) => {
3308
3308
  if (a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper")) {
3309
- D.stopPropagation();
3309
+ U.stopPropagation();
3310
3310
  return;
3311
3311
  }
3312
3312
  p() || e.onAction(i);
3313
3313
  }), a.appendChild(k);
3314
3314
  } else if (l) {
3315
3315
  const k = document.createElement("a");
3316
- k.className = "gengage-chat-product-card-cta", ce(k, "href", l), ce(k, "target", "_blank"), ce(k, "rel", "noopener noreferrer"), k.textContent = B, k.addEventListener("click", (D) => {
3316
+ k.className = "gengage-chat-product-card-cta", ge(k, "href", l), ge(k, "target", "_blank"), ge(k, "rel", "noopener noreferrer"), k.textContent = N, k.addEventListener("click", (U) => {
3317
3317
  if (a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper")) {
3318
- D.preventDefault(), D.stopPropagation();
3318
+ U.preventDefault(), U.stopPropagation();
3319
3319
  return;
3320
3320
  }
3321
- e.onProductClick && c && (D.preventDefault(), e.onProductClick({
3321
+ e.onProductClick && c && (U.preventDefault(), e.onProductClick({
3322
3322
  sku: c,
3323
3323
  url: l,
3324
3324
  ...o ? { name: o } : {}
@@ -3328,22 +3328,22 @@ function dt(t, e) {
3328
3328
  if (e.comparisonSelectMode && c && e.onToggleComparisonSku) {
3329
3329
  const k = document.createElement("div");
3330
3330
  k.className = "gengage-chat-comparison-select-wrapper";
3331
- const D = e.comparisonSelectedSkus?.includes(c) ?? !1;
3332
- D && k.classList.add("gengage-chat-comparison-select-wrapper--selected");
3331
+ const U = e.comparisonSelectedSkus?.includes(c) ?? !1;
3332
+ U && k.classList.add("gengage-chat-comparison-select-wrapper--selected");
3333
3333
  const q = n.name ?? c, K = e.i18n?.comparisonSelectCardHint ?? "Tap anywhere on the card to add or remove it from comparison.";
3334
3334
  k.setAttribute("role", "group"), k.setAttribute("aria-label", `${String(q)}. ${K}`);
3335
3335
  const O = document.createElement("button");
3336
- O.type = "button", O.className = "gengage-chat-comparison-checkbox", O.dataset.selected = D ? "true" : "false", O.setAttribute("aria-pressed", D ? "true" : "false");
3337
- const te = document.createElement("span");
3338
- te.className = "gengage-chat-comparison-checkbox-icon", te.innerHTML = D ? '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>' : '<span class="gengage-chat-comparison-checkbox-dot"></span>';
3339
- const Y = document.createElement("span");
3340
- Y.className = "gengage-chat-comparison-checkbox-label", Y.textContent = D ? e.i18n?.comparisonSelectedLabel ?? "Selected" : e.i18n?.comparisonSelectLabel ?? "Select to compare", O.appendChild(te), O.appendChild(Y), O.addEventListener("click", (f) => {
3341
- f.stopPropagation(), e.onToggleComparisonSku?.(c);
3336
+ O.type = "button", O.className = "gengage-chat-comparison-checkbox", O.dataset.selected = U ? "true" : "false", O.setAttribute("aria-pressed", U ? "true" : "false");
3337
+ const ee = document.createElement("span");
3338
+ ee.className = "gengage-chat-comparison-checkbox-icon", ee.innerHTML = U ? '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>' : '<span class="gengage-chat-comparison-checkbox-dot"></span>';
3339
+ const X = document.createElement("span");
3340
+ X.className = "gengage-chat-comparison-checkbox-label", X.textContent = U ? e.i18n?.comparisonSelectedLabel ?? "Selected" : e.i18n?.comparisonSelectLabel ?? "Select to compare", O.appendChild(ee), O.appendChild(X), O.addEventListener("click", (b) => {
3341
+ b.stopPropagation(), e.onToggleComparisonSku?.(c);
3342
3342
  });
3343
- const V = document.createElement("div");
3344
- return V.className = "gengage-chat-comparison-card-hint", V.setAttribute("aria-hidden", "true"), V.textContent = K, k.addEventListener("click", (f) => {
3345
- f.target.closest(".gengage-chat-comparison-checkbox") || (f.stopPropagation(), e.onToggleComparisonSku?.(c));
3346
- }), k.appendChild(O), k.appendChild(V), k.appendChild(a), k;
3343
+ const $ = document.createElement("div");
3344
+ return $.className = "gengage-chat-comparison-card-hint", $.setAttribute("aria-hidden", "true"), $.textContent = K, k.addEventListener("click", (b) => {
3345
+ b.target.closest(".gengage-chat-comparison-checkbox") || (b.stopPropagation(), e.onToggleComparisonSku?.(c));
3346
+ }), k.appendChild(O), k.appendChild($), k.appendChild(a), k;
3347
3347
  }
3348
3348
  return a;
3349
3349
  }
@@ -3353,11 +3353,11 @@ var da = /* @__PURE__ */ new Set([
3353
3353
  "renk",
3354
3354
  "renk kodu",
3355
3355
  "color code"
3356
- ]), Or = /* @__PURE__ */ new Set([
3356
+ ]), Ur = /* @__PURE__ */ new Set([
3357
3357
  "size",
3358
3358
  "beden",
3359
3359
  "boyut"
3360
- ]), Ur = /* @__PURE__ */ new Set([
3360
+ ]), Or = /* @__PURE__ */ new Set([
3361
3361
  "finish",
3362
3362
  "bitiş",
3363
3363
  "bitişi"
@@ -3389,7 +3389,7 @@ var da = /* @__PURE__ */ new Set([
3389
3389
  "OBJECT",
3390
3390
  "EMBED"
3391
3391
  ]);
3392
- function pe(t, ...e) {
3392
+ function me(t, ...e) {
3393
3393
  for (const a of e) {
3394
3394
  const n = t[a];
3395
3395
  if (typeof n == "string") {
@@ -3424,14 +3424,14 @@ function Gr(t) {
3424
3424
  return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim().length > 0) : [];
3425
3425
  }
3426
3426
  function Wr(t) {
3427
- const e = [...Gr(t.images), pe(t, "imageUrl", "image_url", "image")].filter((a) => !!a && be(a));
3427
+ const e = [...Gr(t.images), me(t, "imageUrl", "image_url", "image")].filter((a) => !!a && ve(a));
3428
3428
  return Array.from(new Set(e));
3429
3429
  }
3430
3430
  function Kr(t) {
3431
3431
  return typeof DOMParser < "u" ? (new DOMParser().parseFromString(t, "text/html").body.textContent ?? "").replace(/\s+/g, " ").trim() : t.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
3432
3432
  }
3433
3433
  function Yr(t) {
3434
- const e = pe(t, "description_html", "descriptionHtml");
3434
+ const e = me(t, "description_html", "descriptionHtml");
3435
3435
  if (e) {
3436
3436
  const n = Kr(e);
3437
3437
  if (n) return {
@@ -3439,13 +3439,13 @@ function Yr(t) {
3439
3439
  html: e
3440
3440
  };
3441
3441
  }
3442
- const a = pe(t, "description");
3442
+ const a = me(t, "description");
3443
3443
  return a ? { text: a } : void 0;
3444
3444
  }
3445
3445
  function We(t) {
3446
3446
  return Array.isArray(t) ? t.map((e) => {
3447
3447
  if (!e || typeof e != "object") return null;
3448
- const a = e, n = pe(a, "key", "name", "label", "title"), r = a.value, i = typeof r == "string" || typeof r == "number" || typeof r == "boolean" ? String(r).trim() : void 0;
3448
+ const a = e, n = me(a, "key", "name", "label", "title"), r = a.value, i = typeof r == "string" || typeof r == "number" || typeof r == "boolean" ? String(r).trim() : void 0;
3449
3449
  return !n || !i ? null : {
3450
3450
  key: n,
3451
3451
  value: i
@@ -3469,7 +3469,7 @@ function Zr(t) {
3469
3469
  return n.length > 0 ? n : void 0;
3470
3470
  }
3471
3471
  function Se(t, ...e) {
3472
- return pe(t, ...e);
3472
+ return me(t, ...e);
3473
3473
  }
3474
3474
  function Bt(t, ...e) {
3475
3475
  return Ge(t, ...e);
@@ -3483,7 +3483,7 @@ function ua(t) {
3483
3483
  }
3484
3484
  function Xr(t) {
3485
3485
  const e = ua(t)?.toLowerCase();
3486
- return !!(pe(t, "color", "colour", "color_hex", "hex", "swatch", "swatchColor") || e && da.has(e));
3486
+ return !!(me(t, "color", "colour", "color_hex", "hex", "swatch", "swatchColor") || e && da.has(e));
3487
3487
  }
3488
3488
  function zt(t) {
3489
3489
  if (!t) return;
@@ -3505,7 +3505,7 @@ function ei(t) {
3505
3505
  }
3506
3506
  function ti(t) {
3507
3507
  const e = t.trim().toLowerCase();
3508
- return da.has(e) || Or.has(e) || Ur.has(e);
3508
+ return da.has(e) || Ur.has(e) || Or.has(e);
3509
3509
  }
3510
3510
  function ai(t) {
3511
3511
  const e = t.trim().toLowerCase();
@@ -3522,7 +3522,7 @@ function ni(t) {
3522
3522
  function ri(t) {
3523
3523
  const e = ni(t);
3524
3524
  if (e) return e;
3525
- const a = pe(t, "sku"), n = qe(t, "inStock", "in_stock"), r = [], i = /* @__PURE__ */ new Set(), o = (c, l) => {
3525
+ const a = me(t, "sku"), n = qe(t, "inStock", "in_stock"), r = [], i = /* @__PURE__ */ new Set(), o = (c, l) => {
3526
3526
  if (!ti(c) || typeof l != "string" && typeof l != "number" && typeof l != "boolean") return;
3527
3527
  const p = String(l).trim();
3528
3528
  if (!p) return;
@@ -3547,195 +3547,195 @@ function oi(t, e) {
3547
3547
  a.className = "gengage-chat-product-details-panel";
3548
3548
  const n = t.props?.product ?? t.props;
3549
3549
  if (!n) return a;
3550
- const r = pe(n, "name"), i = pe(n, "brand"), o = pe(n, "sku"), s = pe(n, "cartCode", "cart_code"), c = pe(n, "price"), l = pe(n, "originalPrice", "price_original"), p = qe(n, "price_async"), g = He(e, n), h = $e(e, n), m = !!(l && c && l !== c), v = qe(n, "inStock", "in_stock"), b = Ge(n, "reviewCount", "review_count"), u = Ge(n, "rating"), d = Wr(n), A = pa(n).slice(0, 4);
3550
+ const r = me(n, "name"), i = me(n, "brand"), o = me(n, "sku"), s = me(n, "cartCode", "cart_code"), c = me(n, "price"), l = me(n, "originalPrice", "price_original"), p = qe(n, "price_async"), g = He(e, n), h = $e(e, n), m = !!(l && c && l !== c), v = qe(n, "inStock", "in_stock"), f = Ge(n, "reviewCount", "review_count"), u = Ge(n, "rating"), d = Wr(n), A = pa(n).slice(0, 4);
3551
3551
  if (d.length > 1) {
3552
- const P = document.createElement("div");
3553
- P.className = "gengage-chat-product-details-media gengage-chat-product-details-gallery gengage-chat-product-details-img-wrap";
3554
- const E = document.createElement("img");
3555
- E.className = "gengage-chat-product-details-img", ce(E, "src", d[0]), E.alt = r ?? "Product image", fe(E), P.appendChild(E);
3556
- const N = document.createElement("div");
3557
- N.className = "gengage-chat-product-gallery-thumbs";
3558
- const B = 6;
3559
- let k = null, D = 0;
3560
- const q = e.i18n, K = q?.galleryPrevAriaLabel ?? "Previous image", O = q?.galleryNextAriaLabel ?? "Next image", te = (M) => M === "prev" ? '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"/></svg>' : '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>', Y = document.createElement("button");
3561
- Y.type = "button", Y.className = "gengage-chat-product-gallery-nav gengage-chat-product-gallery-nav--prev gds-btn gds-btn-ghost gds-icon-btn", Y.setAttribute("aria-label", K), Y.innerHTML = te("prev");
3562
- const V = document.createElement("button");
3563
- V.type = "button", V.className = "gengage-chat-product-gallery-nav gengage-chat-product-gallery-nav--next gds-btn gds-btn-ghost gds-icon-btn", V.setAttribute("aria-label", O), V.innerHTML = te("next");
3564
- const f = () => {
3565
- Y.disabled = D <= 0, V.disabled = D >= d.length - 1;
3566
- }, C = (M) => {
3567
- if (M < 0 || M >= d.length || M === D) return;
3568
- const R = d[M];
3569
- if (!R) return;
3570
- ce(E, "src", R);
3571
- const T = N.querySelectorAll(".gengage-chat-product-gallery-thumb");
3572
- k && k.classList.remove("gengage-chat-product-gallery-thumb--active"), M < B && T[M] ? (T[M].classList.add("gengage-chat-product-gallery-thumb--active"), k = T[M]) : k = null, D = M, f();
3552
+ const L = document.createElement("div");
3553
+ L.className = "gengage-chat-product-details-media gengage-chat-product-details-gallery gengage-chat-product-details-img-wrap";
3554
+ const P = document.createElement("img");
3555
+ P.className = "gengage-chat-product-details-img", ge(P, "src", d[0]), P.alt = r ?? "Product image", be(P), L.appendChild(P);
3556
+ const B = document.createElement("div");
3557
+ B.className = "gengage-chat-product-gallery-thumbs";
3558
+ const N = 6;
3559
+ let k = null, U = 0;
3560
+ const q = e.i18n, K = q?.galleryPrevAriaLabel ?? "Previous image", O = q?.galleryNextAriaLabel ?? "Next image", ee = (M) => M === "prev" ? '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"/></svg>' : '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>', X = document.createElement("button");
3561
+ X.type = "button", X.className = "gengage-chat-product-gallery-nav gengage-chat-product-gallery-nav--prev gds-btn gds-btn-ghost gds-icon-btn", X.setAttribute("aria-label", K), X.innerHTML = ee("prev");
3562
+ const $ = document.createElement("button");
3563
+ $.type = "button", $.className = "gengage-chat-product-gallery-nav gengage-chat-product-gallery-nav--next gds-btn gds-btn-ghost gds-icon-btn", $.setAttribute("aria-label", O), $.innerHTML = ee("next");
3564
+ const b = () => {
3565
+ X.disabled = U <= 0, $.disabled = U >= d.length - 1;
3566
+ }, E = (M) => {
3567
+ if (M < 0 || M >= d.length || M === U) return;
3568
+ const D = d[M];
3569
+ if (!D) return;
3570
+ ge(P, "src", D);
3571
+ const Z = B.querySelectorAll(".gengage-chat-product-gallery-thumb");
3572
+ k && k.classList.remove("gengage-chat-product-gallery-thumb--active"), M < N && Z[M] ? (Z[M].classList.add("gengage-chat-product-gallery-thumb--active"), k = Z[M]) : k = null, U = M, b();
3573
3573
  };
3574
3574
  for (let M = 0; M < d.length; M++) {
3575
- const R = d[M];
3576
- if (M >= B) break;
3577
- const T = document.createElement("img");
3578
- T.className = "gengage-chat-product-gallery-thumb", M === 0 && (T.classList.add("gengage-chat-product-gallery-thumb--active"), k = T), ce(T, "src", R), T.alt = `${r ?? "Product"} ${M + 1}`, T.width = 48, T.height = 48, fe(T), T.addEventListener("click", () => {
3579
- C(M);
3580
- }), N.appendChild(T);
3581
- }
3582
- if (d.length > B) {
3575
+ const D = d[M];
3576
+ if (M >= N) break;
3577
+ const Z = document.createElement("img");
3578
+ Z.className = "gengage-chat-product-gallery-thumb", M === 0 && (Z.classList.add("gengage-chat-product-gallery-thumb--active"), k = Z), ge(Z, "src", D), Z.alt = `${r ?? "Product"} ${M + 1}`, Z.width = 48, Z.height = 48, be(Z), Z.addEventListener("click", () => {
3579
+ E(M);
3580
+ }), B.appendChild(Z);
3581
+ }
3582
+ if (d.length > N) {
3583
3583
  const M = document.createElement("span");
3584
- M.className = "gengage-chat-product-gallery-thumb-more", M.textContent = `+${d.length - B}`, N.appendChild(M);
3585
- }
3586
- Y.addEventListener("click", (M) => {
3587
- M.stopPropagation(), C(D - 1);
3588
- }), V.addEventListener("click", (M) => {
3589
- M.stopPropagation(), C(D + 1);
3590
- }), f();
3591
- let L = 0;
3592
- const U = 50;
3593
- E.addEventListener("touchstart", (M) => {
3594
- L = M.changedTouches[0].clientX;
3595
- }, { passive: !0 }), E.addEventListener("touchend", (M) => {
3596
- const R = M.changedTouches[0].clientX, T = L - R;
3597
- Math.abs(T) < U || C(T > 0 ? Math.min(D + 1, d.length - 1) : Math.max(D - 1, 0));
3598
- }), P.appendChild(Y), P.appendChild(V), P.appendChild(N), a.appendChild(P);
3584
+ M.className = "gengage-chat-product-gallery-thumb-more", M.textContent = `+${d.length - N}`, B.appendChild(M);
3585
+ }
3586
+ X.addEventListener("click", (M) => {
3587
+ M.stopPropagation(), E(U - 1);
3588
+ }), $.addEventListener("click", (M) => {
3589
+ M.stopPropagation(), E(U + 1);
3590
+ }), b();
3591
+ let T = 0;
3592
+ const j = 50;
3593
+ P.addEventListener("touchstart", (M) => {
3594
+ T = M.changedTouches[0].clientX;
3595
+ }, { passive: !0 }), P.addEventListener("touchend", (M) => {
3596
+ const D = M.changedTouches[0].clientX, Z = T - D;
3597
+ Math.abs(Z) < j || E(Z > 0 ? Math.min(U + 1, d.length - 1) : Math.max(U - 1, 0));
3598
+ }), L.appendChild(X), L.appendChild($), L.appendChild(B), a.appendChild(L);
3599
3599
  } else if (d.length === 1) {
3600
- const P = document.createElement("div");
3601
- P.className = "gengage-chat-product-details-media gengage-chat-product-details-img-wrap";
3602
- const E = document.createElement("img");
3603
- E.className = "gengage-chat-product-details-img", E.loading = "lazy", ce(E, "src", d[0]), fe(E), E.alt = r ?? "Product image", P.appendChild(E), a.appendChild(P);
3600
+ const L = document.createElement("div");
3601
+ L.className = "gengage-chat-product-details-media gengage-chat-product-details-img-wrap";
3602
+ const P = document.createElement("img");
3603
+ P.className = "gengage-chat-product-details-img", P.loading = "lazy", ge(P, "src", d[0]), be(P), P.alt = r ?? "Product image", L.appendChild(P), a.appendChild(L);
3604
3604
  }
3605
3605
  const y = document.createElement("div");
3606
3606
  if (y.className = "gengage-chat-product-details-content", i && (!r || !r.toLowerCase().startsWith(i.toLowerCase()))) {
3607
- const P = document.createElement("div");
3608
- P.className = "gengage-chat-product-details-brand", P.textContent = i, y.appendChild(P);
3607
+ const L = document.createElement("div");
3608
+ L.className = "gengage-chat-product-details-brand", L.textContent = i, y.appendChild(L);
3609
3609
  }
3610
3610
  if (r) {
3611
- const P = document.createElement("h3");
3612
- P.className = "gengage-chat-product-details-title", P.textContent = r, P.title = r, y.appendChild(P);
3611
+ const L = document.createElement("h3");
3612
+ L.className = "gengage-chat-product-details-title", L.textContent = r, L.title = r, y.appendChild(L);
3613
3613
  }
3614
3614
  if (e.hideUserReviews !== !0 && typeof u == "number" && Number.isFinite(u) && u > 0) {
3615
- const P = document.createElement(o ? "button" : "div");
3616
- P.className = "gengage-chat-product-details-rating", o && (P.type = "button", P.classList.add("gengage-chat-product-details-rating--clickable"), P.setAttribute("aria-label", e.i18n?.groundingReviewCta ?? "Read Reviews"), P.addEventListener("click", () => {
3615
+ const L = document.createElement(o ? "button" : "div");
3616
+ L.className = "gengage-chat-product-details-rating", o && (L.type = "button", L.classList.add("gengage-chat-product-details-rating--clickable"), L.setAttribute("aria-label", e.i18n?.groundingReviewCta ?? "Read Reviews"), L.addEventListener("click", () => {
3617
3617
  e.onAction({
3618
3618
  title: e.i18n?.customerReviewsTitle ?? "Customer Reviews",
3619
3619
  type: "reviewSummary",
3620
3620
  payload: { sku: o }
3621
3621
  });
3622
- })), P.appendChild(Qt(u));
3623
- const E = document.createElement("span");
3624
- if (E.className = "gengage-chat-product-details-rating-value", E.textContent = Jt(u).toFixed(1), P.appendChild(E), typeof b == "number" && Number.isFinite(b)) {
3625
- const N = document.createElement("span");
3626
- N.className = "gengage-chat-product-details-review-count", N.textContent = ` (${b})`, P.appendChild(N);
3622
+ })), L.appendChild(Qt(u));
3623
+ const P = document.createElement("span");
3624
+ if (P.className = "gengage-chat-product-details-rating-value", P.textContent = Jt(u).toFixed(1), L.appendChild(P), typeof f == "number" && Number.isFinite(f)) {
3625
+ const B = document.createElement("span");
3626
+ B.className = "gengage-chat-product-details-review-count", B.textContent = ` (${f})`, L.appendChild(B);
3627
3627
  }
3628
- y.appendChild(P);
3628
+ y.appendChild(L);
3629
3629
  }
3630
3630
  {
3631
- const P = !!(g && m);
3632
- let E = y;
3633
- if (g && !P) {
3634
- const B = document.createElement("div");
3635
- B.className = "gengage-chat-product-details-price-stack", B.appendChild(Ze(g)), y.appendChild(B), E = B;
3631
+ const L = !!(g && m);
3632
+ let P = y;
3633
+ if (g && !L) {
3634
+ const N = document.createElement("div");
3635
+ N.className = "gengage-chat-product-details-price-stack", N.appendChild(Ze(g)), y.appendChild(N), P = N;
3636
3636
  }
3637
- const N = document.createElement("div");
3638
- if (N.className = "gengage-chat-product-details-price", p === !0) {
3639
- const B = document.createElement("span");
3640
- B.className = "gengage-chat-price-skeleton", N.appendChild(B), E.appendChild(N), setTimeout(() => {
3641
- if (B.parentElement)
3642
- if (c && parseFloat(c) > 0) Nt(N, e, n, c, l, h, m);
3637
+ const B = document.createElement("div");
3638
+ if (B.className = "gengage-chat-product-details-price", p === !0) {
3639
+ const N = document.createElement("span");
3640
+ N.className = "gengage-chat-price-skeleton", B.appendChild(N), P.appendChild(B), setTimeout(() => {
3641
+ if (N.parentElement)
3642
+ if (c && parseFloat(c) > 0) Nt(B, e, n, c, l, h, m);
3643
3643
  else {
3644
- const k = N.parentElement;
3645
- N.remove(), k?.classList.contains("gengage-chat-product-details-price-stack") && k.remove();
3644
+ const k = B.parentElement;
3645
+ B.remove(), k?.classList.contains("gengage-chat-product-details-price-stack") && k.remove();
3646
3646
  }
3647
3647
  }, 300);
3648
3648
  } else if (c && parseFloat(c) > 0)
3649
- Nt(N, e, n, c, l, h, m), E.appendChild(N);
3649
+ Nt(B, e, n, c, l, h, m), P.appendChild(B);
3650
3650
  else if (g) {
3651
- const B = E;
3652
- B.classList.contains("gengage-chat-product-details-price-stack") && B.remove();
3651
+ const N = P;
3652
+ N.classList.contains("gengage-chat-product-details-price-stack") && N.remove();
3653
3653
  }
3654
3654
  }
3655
3655
  if (e.hideStockStatus !== !0 && typeof v == "boolean") {
3656
- const P = document.createElement("div");
3657
- P.className = `gengage-chat-product-details-stock ${v ? "is-in-stock" : "is-out-of-stock"}`, P.textContent = v ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", y.appendChild(P);
3656
+ const L = document.createElement("div");
3657
+ L.className = `gengage-chat-product-details-stock ${v ? "is-in-stock" : "is-out-of-stock"}`, L.textContent = v ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", y.appendChild(L);
3658
3658
  }
3659
3659
  const w = n.promotions;
3660
3660
  if (w && w.length > 0) {
3661
- const P = document.createElement("div");
3662
- P.className = "gengage-chat-product-details-promos";
3663
- for (const E of w.slice(0, 3)) {
3664
- if (!E || /%(0(\.0+)?)\s/.test(E)) continue;
3665
- const N = document.createElement("span");
3666
- N.className = "gengage-chat-product-details-promo-badge", N.textContent = E, N.title = E, P.appendChild(N);
3661
+ const L = document.createElement("div");
3662
+ L.className = "gengage-chat-product-details-promos";
3663
+ for (const P of w.slice(0, 3)) {
3664
+ if (!P || /%(0(\.0+)?)\s/.test(P)) continue;
3665
+ const B = document.createElement("span");
3666
+ B.className = "gengage-chat-product-details-promo-badge", B.textContent = P, B.title = P, L.appendChild(B);
3667
3667
  }
3668
- P.childElementCount > 0 && y.appendChild(P);
3668
+ L.childElementCount > 0 && y.appendChild(L);
3669
3669
  }
3670
3670
  if (A.length > 0) {
3671
- const P = document.createElement("dl");
3672
- P.className = "gengage-chat-product-details-facts";
3673
- for (const E of A) {
3674
- const N = document.createElement("div");
3675
- N.className = "gengage-chat-product-details-fact";
3676
- const B = document.createElement("dt");
3677
- B.textContent = E.key;
3671
+ const L = document.createElement("dl");
3672
+ L.className = "gengage-chat-product-details-facts";
3673
+ for (const P of A) {
3674
+ const B = document.createElement("div");
3675
+ B.className = "gengage-chat-product-details-fact";
3676
+ const N = document.createElement("dt");
3677
+ N.textContent = P.key;
3678
3678
  const k = document.createElement("dd");
3679
- k.textContent = E.value, N.appendChild(B), N.appendChild(k), P.appendChild(N);
3679
+ k.textContent = P.value, B.appendChild(N), B.appendChild(k), L.appendChild(B);
3680
3680
  }
3681
- y.appendChild(P);
3681
+ y.appendChild(L);
3682
3682
  }
3683
- const z = ri(n);
3684
- if (z.length > 0) {
3683
+ const H = ri(n);
3684
+ if (H.length > 0) {
3685
+ const L = document.createElement("div");
3686
+ L.className = "gengage-chat-product-variants";
3685
3687
  const P = document.createElement("div");
3686
- P.className = "gengage-chat-product-variants";
3687
- const E = document.createElement("div");
3688
- E.className = "gengage-chat-product-variants-label", E.textContent = ii(z, e), P.appendChild(E);
3689
- const N = document.createElement("div");
3690
- N.className = "gengage-chat-product-variants-list";
3691
- for (const B of z) {
3692
- const k = ha(B), D = Se(B, "sku");
3693
- if (!k && !D) continue;
3688
+ P.className = "gengage-chat-product-variants-label", P.textContent = ii(H, e), L.appendChild(P);
3689
+ const B = document.createElement("div");
3690
+ B.className = "gengage-chat-product-variants-list";
3691
+ for (const N of H) {
3692
+ const k = ha(N), U = Se(N, "sku");
3693
+ if (!k && !U) continue;
3694
3694
  const q = document.createElement("button");
3695
3695
  q.className = "gengage-chat-product-variant-btn gds-chip", q.type = "button";
3696
- const K = k ?? D ?? "";
3696
+ const K = k ?? U ?? "";
3697
3697
  q.title = K;
3698
- const O = qe(B, "in_stock", "inStock");
3699
- D && o && D === o ? (q.classList.add("gengage-chat-product-variant-btn--active"), q.setAttribute("aria-pressed", "true")) : q.setAttribute("aria-pressed", "false"), O === !1 && (q.classList.add("gengage-chat-product-variant-btn--out"), q.disabled = !0);
3700
- const te = Jr(B), Y = Qr(B);
3701
- if (te && be(te)) {
3702
- const C = document.createElement("img");
3703
- C.className = "gengage-chat-product-variant-swatch gengage-chat-product-variant-swatch--image", ce(C, "src", te), C.alt = "", C.setAttribute("aria-hidden", "true"), fe(C), q.appendChild(C);
3704
- } else if (Y) {
3705
- const C = document.createElement("span");
3706
- C.className = "gengage-chat-product-variant-swatch", C.setAttribute("aria-hidden", "true"), C.style.backgroundColor = Y, q.appendChild(C);
3698
+ const O = qe(N, "in_stock", "inStock");
3699
+ U && o && U === o ? (q.classList.add("gengage-chat-product-variant-btn--active"), q.setAttribute("aria-pressed", "true")) : q.setAttribute("aria-pressed", "false"), O === !1 && (q.classList.add("gengage-chat-product-variant-btn--out"), q.disabled = !0);
3700
+ const ee = Jr(N), X = Qr(N);
3701
+ if (ee && ve(ee)) {
3702
+ const E = document.createElement("img");
3703
+ E.className = "gengage-chat-product-variant-swatch gengage-chat-product-variant-swatch--image", ge(E, "src", ee), E.alt = "", E.setAttribute("aria-hidden", "true"), be(E), q.appendChild(E);
3704
+ } else if (X) {
3705
+ const E = document.createElement("span");
3706
+ E.className = "gengage-chat-product-variant-swatch", E.setAttribute("aria-hidden", "true"), E.style.backgroundColor = X, q.appendChild(E);
3707
3707
  }
3708
- const V = document.createElement("span");
3709
- V.className = "gengage-chat-product-variant-label", V.textContent = K, q.appendChild(V);
3710
- const f = ei(B);
3711
- if (f && String(f) !== String(c)) {
3712
- const C = document.createElement("span");
3713
- C.className = "gengage-chat-product-variant-price", C.textContent = ae(String(f), e.pricing), q.appendChild(C);
3708
+ const $ = document.createElement("span");
3709
+ $.className = "gengage-chat-product-variant-label", $.textContent = K, q.appendChild($);
3710
+ const b = ei(N);
3711
+ if (b && String(b) !== String(c)) {
3712
+ const E = document.createElement("span");
3713
+ E.className = "gengage-chat-product-variant-price", E.textContent = ae(String(b), e.pricing), q.appendChild(E);
3714
3714
  }
3715
- if (D && D !== o) {
3716
- const C = r ?? "", L = (typeof B.value == "string" ? B.value.trim() : "") || (typeof B.name == "string" ? B.name.trim() : "") || (typeof B.variant_name == "string" ? B.variant_name.trim() : "") || "", U = C.length > 0 ? L.length > 0 && L !== C ? `${C} (${L})` : C : K;
3715
+ if (U && U !== o) {
3716
+ const E = r ?? "", T = (typeof N.value == "string" ? N.value.trim() : "") || (typeof N.name == "string" ? N.name.trim() : "") || (typeof N.variant_name == "string" ? N.variant_name.trim() : "") || "", j = E.length > 0 ? T.length > 0 && T !== E ? `${E} (${T})` : E : K;
3717
3717
  q.addEventListener("click", () => {
3718
3718
  e.onAction({
3719
- title: U,
3719
+ title: j,
3720
3720
  type: "launchVariant",
3721
- payload: { sku: D }
3721
+ payload: { sku: U }
3722
3722
  });
3723
3723
  });
3724
3724
  }
3725
- N.appendChild(q);
3725
+ B.appendChild(q);
3726
3726
  }
3727
- N.childElementCount > 0 && (P.appendChild(N), y.appendChild(P));
3727
+ B.childElementCount > 0 && (L.appendChild(B), y.appendChild(L));
3728
3728
  }
3729
3729
  const I = document.createElement("div");
3730
3730
  I.className = "gengage-chat-product-details-actions";
3731
3731
  const _ = t.props?.action;
3732
3732
  if (_) {
3733
- const P = document.createElement("button");
3734
- P.className = "gengage-chat-product-details-cta gds-btn gds-btn-primary", P.type = "button", P.textContent = _.title || e.i18n?.productCtaLabel || "View", P.addEventListener("click", () => e.onAction(_)), I.appendChild(P);
3733
+ const L = document.createElement("button");
3734
+ L.className = "gengage-chat-product-details-cta gds-btn gds-btn-primary", L.type = "button", L.textContent = _.title || e.i18n?.productCtaLabel || "View", L.addEventListener("click", () => e.onAction(_)), I.appendChild(L);
3735
3735
  }
3736
3736
  if (s && o && v !== !1) {
3737
- const P = document.createElement("button");
3738
- P.className = "gengage-chat-product-details-atc gds-btn gds-btn-primary", P.type = "button", P.textContent = e.i18n?.addToCartButton ?? "Add to Cart", P.addEventListener("click", () => {
3737
+ const L = document.createElement("button");
3738
+ L.className = "gengage-chat-product-details-atc gds-btn gds-btn-primary", L.type = "button", L.textContent = e.i18n?.addToCartButton ?? "Add to Cart", L.addEventListener("click", () => {
3739
3739
  e.onAction({
3740
3740
  title: e.i18n?.addToCartButton ?? "Add to Cart",
3741
3741
  type: "addToCart",
@@ -3745,46 +3745,46 @@ function oi(t, e) {
3745
3745
  quantity: 1
3746
3746
  }
3747
3747
  });
3748
- }), I.appendChild(P);
3748
+ }), I.appendChild(L);
3749
3749
  }
3750
- const S = pe(n, "url");
3751
- if (!_ && S && be(S)) {
3752
- const P = document.createElement("a");
3753
- P.className = "gengage-chat-product-details-cta gds-btn gds-btn-secondary", ce(P, "href", S), ce(P, "target", "_blank"), ce(P, "rel", "noopener noreferrer"), P.textContent = e.i18n?.viewOnSiteLabel ?? e.i18n?.productCtaLabel ?? "View on Site", P.addEventListener("click", (E) => {
3754
- e.onProductClick && o && (E.preventDefault(), e.onProductClick({
3750
+ const S = me(n, "url");
3751
+ if (!_ && S && ve(S)) {
3752
+ const L = document.createElement("a");
3753
+ L.className = "gengage-chat-product-details-cta gds-btn gds-btn-secondary", ge(L, "href", S), ge(L, "target", "_blank"), ge(L, "rel", "noopener noreferrer"), L.textContent = e.i18n?.viewOnSiteLabel ?? e.i18n?.productCtaLabel ?? "View on Site", L.addEventListener("click", (P) => {
3754
+ e.onProductClick && o && (P.preventDefault(), e.onProductClick({
3755
3755
  sku: o,
3756
3756
  url: S,
3757
3757
  ...r ? { name: r } : {}
3758
3758
  }));
3759
- }), I.appendChild(P);
3759
+ }), I.appendChild(L);
3760
3760
  }
3761
- const H = S;
3762
- if (H && be(H)) {
3761
+ const F = S;
3762
+ if (F && ve(F)) {
3763
3763
  let k = function(q, K) {
3764
- const O = document.createElementNS(N, "circle");
3765
- O.setAttribute("cx", q), O.setAttribute("cy", K), O.setAttribute("r", "3"), B.appendChild(O);
3766
- }, D = function(q, K, O, te) {
3767
- const Y = document.createElementNS(N, "line");
3768
- Y.setAttribute("x1", q), Y.setAttribute("y1", K), Y.setAttribute("x2", O), Y.setAttribute("y2", te), B.appendChild(Y);
3764
+ const O = document.createElementNS(B, "circle");
3765
+ O.setAttribute("cx", q), O.setAttribute("cy", K), O.setAttribute("r", "3"), N.appendChild(O);
3766
+ }, U = function(q, K, O, ee) {
3767
+ const X = document.createElementNS(B, "line");
3768
+ X.setAttribute("x1", q), X.setAttribute("y1", K), X.setAttribute("x2", O), X.setAttribute("y2", ee), N.appendChild(X);
3769
3769
  };
3770
- const P = document.createElement("button");
3771
- P.className = "gengage-chat-product-details-share gds-btn gds-btn-ghost gds-icon-btn", P.type = "button";
3772
- const E = e.i18n?.shareButton ?? "Share";
3773
- P.title = E, P.setAttribute("aria-label", E);
3774
- const N = "http://www.w3.org/2000/svg", B = document.createElementNS(N, "svg");
3775
- B.setAttribute("width", "18"), B.setAttribute("height", "18"), B.setAttribute("viewBox", "0 0 24 24"), B.setAttribute("fill", "none"), B.setAttribute("stroke", "currentColor"), B.setAttribute("stroke-width", "2"), B.setAttribute("stroke-linecap", "round"), B.setAttribute("stroke-linejoin", "round"), k("18", "5"), k("6", "12"), k("18", "19"), D("8.59", "13.51", "15.42", "17.49"), D("15.41", "6.51", "8.59", "10.49"), P.appendChild(B), P.addEventListener("click", async () => {
3770
+ const L = document.createElement("button");
3771
+ L.className = "gengage-chat-product-details-share gds-btn gds-btn-ghost gds-icon-btn", L.type = "button";
3772
+ const P = e.i18n?.shareButton ?? "Share";
3773
+ L.title = P, L.setAttribute("aria-label", P);
3774
+ const B = "http://www.w3.org/2000/svg", N = document.createElementNS(B, "svg");
3775
+ N.setAttribute("width", "18"), N.setAttribute("height", "18"), N.setAttribute("viewBox", "0 0 24 24"), N.setAttribute("fill", "none"), N.setAttribute("stroke", "currentColor"), N.setAttribute("stroke-width", "2"), N.setAttribute("stroke-linecap", "round"), N.setAttribute("stroke-linejoin", "round"), k("18", "5"), k("6", "12"), k("18", "19"), U("8.59", "13.51", "15.42", "17.49"), U("15.41", "6.51", "8.59", "10.49"), L.appendChild(N), L.addEventListener("click", async () => {
3776
3776
  try {
3777
3777
  navigator.share ? await navigator.share({
3778
3778
  title: r ?? "",
3779
- url: H
3780
- }) : navigator.clipboard && (await navigator.clipboard.writeText(H), P.classList.add("gengage-chat-product-details-share--copied"), setTimeout(() => P.classList.remove("gengage-chat-product-details-share--copied"), 1500));
3779
+ url: F
3780
+ }) : navigator.clipboard && (await navigator.clipboard.writeText(F), L.classList.add("gengage-chat-product-details-share--copied"), setTimeout(() => L.classList.remove("gengage-chat-product-details-share--copied"), 1500));
3781
3781
  } catch {
3782
3782
  }
3783
- }), I.appendChild(P);
3783
+ }), I.appendChild(L);
3784
3784
  }
3785
3785
  I.childElementCount > 0 && y.appendChild(I), a.appendChild(y);
3786
- const W = Yr(n), X = Zr(n);
3787
- return (W || X) && a.appendChild(li(W, X, e)), a;
3786
+ const W = Yr(n), J = Zr(n);
3787
+ return (W || J) && a.appendChild(li(W, J, e)), a;
3788
3788
  }
3789
3789
  function pt(t) {
3790
3790
  if (t.nodeType === Node.TEXT_NODE) return document.createTextNode(t.textContent ?? "");
@@ -3947,81 +3947,81 @@ function ui(t, e, a, n) {
3947
3947
  },
3948
3948
  icon: "priceDesc"
3949
3949
  }
3950
- ], b = document.createElement("div");
3951
- b.className = "gengage-chat-product-sort-dropdown";
3950
+ ], f = document.createElement("div");
3951
+ f.className = "gengage-chat-product-sort-dropdown";
3952
3952
  const u = document.createElement("button");
3953
3953
  u.type = "button", u.className = "gengage-chat-product-sort-trigger gds-btn gds-btn-ghost", u.setAttribute("aria-haspopup", "listbox"), u.setAttribute("aria-expanded", "false");
3954
3954
  const d = n.i18n?.sortToolbarAriaLabel ?? "Sort products", A = document.createElement("span");
3955
3955
  A.className = "gengage-chat-product-sort-trigger-icon";
3956
3956
  const y = document.createElement("span");
3957
3957
  y.className = "gengage-chat-product-sort-trigger-label";
3958
- const w = (E) => {
3959
- const N = v.find((B) => Ht(B.sortState, E)) ?? v[0];
3960
- y.textContent = N.label, A.innerHTML = Rt(N.icon), b.dataset.sortIcon = N.icon, u.setAttribute("aria-label", `${d}: ${N.label}`), u.title = N.label;
3958
+ const w = (P) => {
3959
+ const B = v.find((N) => Ht(N.sortState, P)) ?? v[0];
3960
+ y.textContent = B.label, A.innerHTML = Rt(B.icon), f.dataset.sortIcon = B.icon, u.setAttribute("aria-label", `${d}: ${B.label}`), u.title = B.label;
3961
3961
  };
3962
3962
  w(m);
3963
- const z = document.createElement("span");
3964
- z.className = "gengage-chat-product-sort-trigger-chevron", z.innerHTML = gi(), u.appendChild(A), u.appendChild(y), u.appendChild(z);
3963
+ const H = document.createElement("span");
3964
+ H.className = "gengage-chat-product-sort-trigger-chevron", H.innerHTML = gi(), u.appendChild(A), u.appendChild(y), u.appendChild(H);
3965
3965
  const I = document.createElement("div");
3966
3966
  I.className = "gengage-chat-product-sort-menu gds-menu", I.hidden = !0, I.setAttribute("role", "listbox"), I.setAttribute("aria-label", d);
3967
3967
  const _ = h.ownerDocument;
3968
3968
  let S = null;
3969
- const H = () => {
3970
- I.hidden = !0, b.classList.remove("gengage-chat-product-sort-dropdown--open"), u.setAttribute("aria-expanded", "false"), S?.abort(), S = null;
3971
- }, W = (E) => {
3972
- b.classList.contains("gengage-chat-product-sort-dropdown--open") && (b.contains(E.target) || H());
3973
- }, X = (E) => {
3974
- E.key === "Escape" && (E.preventDefault(), H());
3975
- }, P = () => {
3976
- I.hidden = !1, b.classList.add("gengage-chat-product-sort-dropdown--open"), u.setAttribute("aria-expanded", "true"), S = new AbortController();
3977
- const { signal: E } = S;
3978
- _.addEventListener("click", W, { signal: E }), _.addEventListener("keydown", X, {
3969
+ const F = () => {
3970
+ I.hidden = !0, f.classList.remove("gengage-chat-product-sort-dropdown--open"), u.setAttribute("aria-expanded", "false"), S?.abort(), S = null;
3971
+ }, W = (P) => {
3972
+ f.classList.contains("gengage-chat-product-sort-dropdown--open") && (f.contains(P.target) || F());
3973
+ }, J = (P) => {
3974
+ P.key === "Escape" && (P.preventDefault(), F());
3975
+ }, L = () => {
3976
+ I.hidden = !1, f.classList.add("gengage-chat-product-sort-dropdown--open"), u.setAttribute("aria-expanded", "true"), S = new AbortController();
3977
+ const { signal: P } = S;
3978
+ _.addEventListener("click", W, { signal: P }), _.addEventListener("keydown", J, {
3979
3979
  capture: !0,
3980
- signal: E
3980
+ signal: P
3981
3981
  });
3982
3982
  };
3983
- u.addEventListener("click", (E) => {
3984
- E.stopPropagation(), b.classList.contains("gengage-chat-product-sort-dropdown--open") ? H() : P();
3983
+ u.addEventListener("click", (P) => {
3984
+ P.stopPropagation(), f.classList.contains("gengage-chat-product-sort-dropdown--open") ? F() : L();
3985
3985
  });
3986
- for (const E of v) {
3987
- const N = document.createElement("button");
3988
- N.type = "button", N.className = "gengage-chat-product-sort-option gds-menu-option", N.setAttribute("role", "option");
3989
- const B = Ht(m, E.sortState);
3990
- N.setAttribute("aria-selected", B ? "true" : "false"), B && N.classList.add("gengage-chat-product-sort-option--active", "gds-menu-option-active");
3991
- const k = E.sortState.type === "related" ? "related" : `price-${E.sortState.direction ?? ""}`;
3992
- N.dataset.sortKey = k;
3993
- const D = document.createElement("span");
3994
- D.className = "gengage-chat-product-sort-option-icon", D.innerHTML = Rt(E.icon);
3986
+ for (const P of v) {
3987
+ const B = document.createElement("button");
3988
+ B.type = "button", B.className = "gengage-chat-product-sort-option gds-menu-option", B.setAttribute("role", "option");
3989
+ const N = Ht(m, P.sortState);
3990
+ B.setAttribute("aria-selected", N ? "true" : "false"), N && B.classList.add("gengage-chat-product-sort-option--active", "gds-menu-option-active");
3991
+ const k = P.sortState.type === "related" ? "related" : `price-${P.sortState.direction ?? ""}`;
3992
+ B.dataset.sortKey = k;
3993
+ const U = document.createElement("span");
3994
+ U.className = "gengage-chat-product-sort-option-icon", U.innerHTML = Rt(P.icon);
3995
3995
  const q = document.createElement("span");
3996
- q.className = "gengage-chat-product-sort-option-label", q.textContent = E.label;
3996
+ q.className = "gengage-chat-product-sort-option-label", q.textContent = P.label;
3997
3997
  const K = document.createElement("span");
3998
- K.className = "gengage-chat-product-sort-option-check", K.innerHTML = di(), K.setAttribute("aria-hidden", "true"), B || K.classList.add("gengage-chat-product-sort-option-check--hidden"), N.appendChild(D), N.appendChild(q), N.appendChild(K), N.addEventListener("click", () => {
3999
- m = E.sortState, n.onSortChange?.(E.sortState), hi(c, s, e, E.sortState), I.querySelectorAll(".gengage-chat-product-sort-option").forEach((O) => {
4000
- const te = O, Y = te.dataset.sortKey === k;
4001
- te.classList.toggle("gengage-chat-product-sort-option--active", Y), te.classList.toggle("gds-menu-option-active", Y), te.setAttribute("aria-selected", Y ? "true" : "false"), te.querySelector(".gengage-chat-product-sort-option-check")?.classList.toggle("gengage-chat-product-sort-option-check--hidden", !Y);
4002
- }), w(E.sortState), H();
4003
- }), I.appendChild(N);
4004
- }
4005
- if (b.appendChild(u), b.appendChild(I), h.appendChild(b), n.onToggleComparisonSku) {
4006
- const E = document.createElement("button");
4007
- E.className = "gengage-chat-comparison-toggle-btn gds-btn gds-btn-ghost", E.type = "button", n.comparisonSelectMode && E.classList.add("gengage-chat-comparison-toggle-btn--active"), n.isStreaming && E.classList.add("gengage-chat-comparison-toggle-btn--hidden");
4008
- const N = document.createElement("span");
4009
- N.className = "gengage-chat-comparison-toggle-icon", N.innerHTML = pi();
3998
+ K.className = "gengage-chat-product-sort-option-check", K.innerHTML = di(), K.setAttribute("aria-hidden", "true"), N || K.classList.add("gengage-chat-product-sort-option-check--hidden"), B.appendChild(U), B.appendChild(q), B.appendChild(K), B.addEventListener("click", () => {
3999
+ m = P.sortState, n.onSortChange?.(P.sortState), hi(c, s, e, P.sortState), I.querySelectorAll(".gengage-chat-product-sort-option").forEach((O) => {
4000
+ const ee = O, X = ee.dataset.sortKey === k;
4001
+ ee.classList.toggle("gengage-chat-product-sort-option--active", X), ee.classList.toggle("gds-menu-option-active", X), ee.setAttribute("aria-selected", X ? "true" : "false"), ee.querySelector(".gengage-chat-product-sort-option-check")?.classList.toggle("gengage-chat-product-sort-option-check--hidden", !X);
4002
+ }), w(P.sortState), F();
4003
+ }), I.appendChild(B);
4004
+ }
4005
+ if (f.appendChild(u), f.appendChild(I), h.appendChild(f), n.onToggleComparisonSku) {
4006
+ const P = document.createElement("button");
4007
+ P.className = "gengage-chat-comparison-toggle-btn gds-btn gds-btn-ghost", P.type = "button", n.comparisonSelectMode && P.classList.add("gengage-chat-comparison-toggle-btn--active"), n.isStreaming && P.classList.add("gengage-chat-comparison-toggle-btn--hidden");
4010
4008
  const B = document.createElement("span");
4011
- B.className = "gengage-chat-comparison-toggle-label";
4009
+ B.className = "gengage-chat-comparison-toggle-icon", B.innerHTML = pi();
4010
+ const N = document.createElement("span");
4011
+ N.className = "gengage-chat-comparison-toggle-label";
4012
4012
  const k = n.i18n?.compareSelected ?? "Compare";
4013
- B.textContent = k, E.setAttribute("aria-label", k), E.title = k, E.appendChild(N), E.appendChild(B), E.addEventListener("click", () => {
4013
+ N.textContent = k, P.setAttribute("aria-label", k), P.title = k, P.appendChild(B), P.appendChild(N), P.addEventListener("click", () => {
4014
4014
  n.onToggleComparisonSku?.("");
4015
- }), h.appendChild(E);
4015
+ }), h.appendChild(P);
4016
4016
  }
4017
4017
  if (l) {
4018
4018
  h.classList.add("gengage-chat-product-sort-toolbar--inline");
4019
- const E = document.createElement("div");
4020
- E.className = "gengage-chat-product-grid-head";
4021
- const N = document.createElement("span");
4022
- N.className = "gengage-chat-product-grid-head-title", N.textContent = l, E.appendChild(N);
4023
- const B = document.createElement("div");
4024
- B.className = "gengage-chat-product-grid-head-actions", B.appendChild(h), E.appendChild(B), r.appendChild(E);
4019
+ const P = document.createElement("div");
4020
+ P.className = "gengage-chat-product-grid-head";
4021
+ const B = document.createElement("span");
4022
+ B.className = "gengage-chat-product-grid-head-title", B.textContent = l, P.appendChild(B);
4023
+ const N = document.createElement("div");
4024
+ N.className = "gengage-chat-product-grid-head-actions", N.appendChild(h), P.appendChild(N), r.appendChild(P);
4025
4025
  } else r.appendChild(h);
4026
4026
  } else if (l) {
4027
4027
  const h = document.createElement("div");
@@ -4078,12 +4078,12 @@ function fi(t, e) {
4078
4078
  highlights: s,
4079
4079
  specialCases: c,
4080
4080
  locale: e.locale,
4081
- onProductClick: ({ sku: v, name: b }) => {
4081
+ onProductClick: ({ sku: v, name: f }) => {
4082
4082
  const u = mi(v, r, i);
4083
4083
  e.onProductClick?.({
4084
4084
  sku: v,
4085
4085
  url: u,
4086
- ...b !== void 0 && b !== "" ? { name: b } : {}
4086
+ ...f !== void 0 && f !== "" ? { name: f } : {}
4087
4087
  });
4088
4088
  },
4089
4089
  pricing: e.pricing
@@ -4189,23 +4189,23 @@ function bt(t, e) {
4189
4189
  if (d.length === 0) return;
4190
4190
  const w = document.createElement("section");
4191
4191
  w.className = "gengage-chat-consulting-group";
4192
- const z = document.createElement("div");
4193
- z.className = "gengage-chat-consulting-group-header";
4192
+ const H = document.createElement("div");
4193
+ H.className = "gengage-chat-consulting-group-header";
4194
4194
  const I = document.createElement("h4");
4195
- if (I.className = "gengage-chat-consulting-group-label", I.textContent = `${u} (${d.length})`, z.appendChild(I), typeof y == "string" && y.trim().length > 0) {
4195
+ if (I.className = "gengage-chat-consulting-group-label", I.textContent = `${u} (${d.length})`, H.appendChild(I), typeof y == "string" && y.trim().length > 0) {
4196
4196
  const S = document.createElement("p");
4197
- S.className = "gengage-chat-consulting-group-reason", S.textContent = y, z.appendChild(S);
4197
+ S.className = "gengage-chat-consulting-group-reason", S.textContent = y, H.appendChild(S);
4198
4198
  }
4199
- w.appendChild(z);
4199
+ w.appendChild(H);
4200
4200
  const _ = document.createElement("div");
4201
4201
  _.className = "gengage-chat-product-grid gengage-chat-consulting-group-grid", A && _.classList.add("gengage-chat-consulting-group-grid--single-group"), _.style.setProperty("--consulting-group-columns", String(Math.max(1, Math.min(4, d.length))));
4202
4202
  for (const S of d) {
4203
- const H = dt({
4203
+ const F = dt({
4204
4204
  type: "ProductCard",
4205
4205
  props: { product: S }
4206
4206
  }, r ?? { onAction: () => {
4207
4207
  } });
4208
- _.appendChild(H);
4208
+ _.appendChild(F);
4209
4209
  }
4210
4210
  w.appendChild(_), n.appendChild(w);
4211
4211
  }, h = /* @__PURE__ */ new Set(), m = [];
@@ -4227,8 +4227,8 @@ function bt(t, e) {
4227
4227
  labelText: i.consultingOtherCompatibleProductsLabel,
4228
4228
  products: v
4229
4229
  });
4230
- const b = m.length === 1;
4231
- for (const u of m) g(u.labelText, u.products, b, u.reasonText);
4230
+ const f = m.length === 1;
4231
+ for (const u of m) g(u.labelText, u.products, f, u.reasonText);
4232
4232
  return;
4233
4233
  }
4234
4234
  for (const p of c) {
@@ -4246,9 +4246,9 @@ function ut(t, e, a, n) {
4246
4246
  let s = t.querySelector(".gengage-chat-consulting-style-media");
4247
4247
  s ? s.innerHTML = "" : (s = document.createElement("div"), s.className = "gengage-chat-consulting-style-media", t.appendChild(s));
4248
4248
  const c = vi(e.image_url);
4249
- if (c && be(c)) {
4249
+ if (c && ve(c)) {
4250
4250
  const p = document.createElement("img");
4251
- p.className = "gengage-chat-consulting-style-image", p.draggable = !1, ce(p, "src", c), p.alt = Ve(e, a + 1, n), p.loading = "lazy", fe(p), s.appendChild(p);
4251
+ p.className = "gengage-chat-consulting-style-image", p.draggable = !1, ge(p, "src", c), p.alt = Ve(e, a + 1, n), p.loading = "lazy", be(p), s.appendChild(p);
4252
4252
  }
4253
4253
  const l = document.createElement("span");
4254
4254
  if (l.className = "gengage-chat-consulting-style-caption", l.textContent = Ve(e, a + 1, n), s.appendChild(l), r === "loading" || r !== "ready") {
@@ -4679,10 +4679,10 @@ function Ti(t, e, a) {
4679
4679
  "Ürün ara",
4680
4680
  "Karşılaştır",
4681
4681
  "Soru sor"
4682
- ], placeholderInterval: v = 2e3, voiceLang: b = "tr-TR", showBorderAnimation: u = !0, sendAriaLabel: d = "Gönder", micAriaLabel: A = "Sesli giriş", cancelAriaLabel: y = "Ses kaydını durdur", openChatAriaLabel: w = "Chat'i aç" } = t;
4682
+ ], placeholderInterval: v = 2e3, voiceLang: f = "tr-TR", showBorderAnimation: u = !0, sendAriaLabel: d = "Gönder", micAriaLabel: A = "Sesli giriş", cancelAriaLabel: y = "Ses kaydını durdur", openChatAriaLabel: w = "Chat'i aç" } = t;
4683
4683
  if (!a.getElementById(Dt)) {
4684
- const F = document.createElement("style");
4685
- F.id = Dt, F.textContent = Pi({
4684
+ const R = document.createElement("style");
4685
+ R.id = Dt, R.textContent = Pi({
4686
4686
  primaryColor: n,
4687
4687
  backgroundColor: r,
4688
4688
  textColor: i,
@@ -4693,51 +4693,51 @@ function Ti(t, e, a) {
4693
4693
  height: p,
4694
4694
  maxWidth: g,
4695
4695
  fontFamily: h
4696
- }), a.appendChild(F);
4696
+ }), a.appendChild(R);
4697
4697
  }
4698
- const z = document.createElement("div");
4699
- z.className = "gengage-fl", z.dataset.gengagePart = "floating-launcher", z.innerHTML = Li();
4700
- const I = z.querySelector(".gengage-fl-input"), _ = z.querySelector(".gengage-fl-transcript"), S = z.querySelector(".gengage-fl-transcript-final"), H = z.querySelector(".gengage-fl-transcript-interim"), W = z.querySelector(".gengage-fl-btn-send"), X = z.querySelector(".gengage-fl-btn-mic"), P = z.querySelector(".gengage-fl-btn-open-chat"), E = z.querySelector(".gengage-fl-cancel"), N = z.querySelector(".gengage-fl-wave"), B = z.querySelector(".gengage-fl-ring");
4701
- I.placeholder = m[0] ?? "", W.setAttribute("aria-label", d), X.setAttribute("aria-label", A), E.setAttribute("aria-label", y), P.setAttribute("aria-label", w);
4702
- let k = !1, D = !1, q = "", K = !1, O = null, te = 0, Y = null, V = null, f = null, C = null, L = null, U = 0;
4698
+ const H = document.createElement("div");
4699
+ H.className = "gengage-fl", H.dataset.gengagePart = "floating-launcher", H.innerHTML = Li();
4700
+ const I = H.querySelector(".gengage-fl-input"), _ = H.querySelector(".gengage-fl-transcript"), S = H.querySelector(".gengage-fl-transcript-final"), F = H.querySelector(".gengage-fl-transcript-interim"), W = H.querySelector(".gengage-fl-btn-send"), J = H.querySelector(".gengage-fl-btn-mic"), L = H.querySelector(".gengage-fl-btn-open-chat"), P = H.querySelector(".gengage-fl-cancel"), B = H.querySelector(".gengage-fl-wave"), N = H.querySelector(".gengage-fl-ring");
4701
+ I.placeholder = m[0] ?? "", W.setAttribute("aria-label", d), J.setAttribute("aria-label", A), P.setAttribute("aria-label", y), L.setAttribute("aria-label", w);
4702
+ let k = !1, U = !1, q = "", K = !1, O = null, ee = 0, X = null, $ = null, b = null, E = null, T = null, j = 0;
4703
4703
  function M() {
4704
- const F = I.value.trim().length > 0;
4705
- if (X.classList.toggle("is-recording", k), k) {
4706
- W.style.display = "flex", X.style.display = "flex", E.style.display = "flex", P.style.display = "none";
4704
+ const R = I.value.trim().length > 0;
4705
+ if (J.classList.toggle("is-recording", k), k) {
4706
+ W.style.display = "flex", J.style.display = "flex", P.style.display = "flex", L.style.display = "none";
4707
4707
  return;
4708
4708
  }
4709
- W.style.display = F ? "flex" : "none", X.style.display = F ? "none" : "flex", E.style.display = "none", P.style.display = !F && K ? "flex" : "none";
4709
+ W.style.display = R ? "flex" : "none", J.style.display = R ? "none" : "flex", P.style.display = "none", L.style.display = !R && K ? "flex" : "none";
4710
4710
  }
4711
- function R() {
4712
- te = (te + 1) % m.length, I.placeholder = m[te] ?? "", Y = setTimeout(R, v);
4711
+ function D() {
4712
+ ee = (ee + 1) % m.length, I.placeholder = m[ee] ?? "", X = setTimeout(D, v);
4713
4713
  }
4714
- function T() {
4715
- Y !== null || m.length <= 1 || (Y = setTimeout(R, v));
4714
+ function Z() {
4715
+ X !== null || m.length <= 1 || (X = setTimeout(D, v));
4716
4716
  }
4717
- function j() {
4718
- Y !== null && (clearTimeout(Y), Y = null);
4717
+ function te() {
4718
+ X !== null && (clearTimeout(X), X = null);
4719
4719
  }
4720
- function G() {
4721
- k && (k = !1, ne(), D = !1, re(), u && oe(), q = "", I.style.display = "", _.style.display = "none", S.textContent = "", H.textContent = "");
4722
- const F = I.value.trim();
4723
- F && (e.onSend(F), K || (K = !0)), I.value = "", q = "", M();
4720
+ function re() {
4721
+ k && (k = !1, ce(), U = !1, z(), u && ne(), q = "", I.style.display = "", _.style.display = "none", S.textContent = "", F.textContent = "");
4722
+ const R = I.value.trim();
4723
+ R && (e.onSend(R), K || (K = !0)), I.value = "", q = "", M();
4724
4724
  }
4725
- function Q() {
4726
- const F = window, J = F.SpeechRecognition ?? F.webkitSpeechRecognition;
4727
- if (!J) {
4725
+ function ie() {
4726
+ const R = window, V = R.SpeechRecognition ?? R.webkitSpeechRecognition;
4727
+ if (!V) {
4728
4728
  console.warn("[FloatingLauncher] SpeechRecognition not supported.");
4729
4729
  return;
4730
4730
  }
4731
- O || (O = new J(), O.continuous = !0, O.interimResults = !0, O.lang = b), k = !0, D = !0, q = "", I.value = "", I.style.display = "none", _.style.display = "flex", S.textContent = "", H.textContent = "", M(), $(), u && ie(), O.onresult = (ee) => {
4731
+ O || (O = new V(), O.continuous = !0, O.interimResults = !0, O.lang = f), k = !0, U = !0, q = "", I.value = "", I.style.display = "none", _.style.display = "flex", S.textContent = "", F.textContent = "", M(), C(), u && Y(), O.onresult = (G) => {
4732
4732
  if (!k) return;
4733
- let Z = "", le = "";
4734
- for (let Pe = ee.resultIndex; Pe < ee.results.length; Pe++) {
4735
- const Ae = ee.results[Pe];
4733
+ let Q = "", de = "";
4734
+ for (let Pe = G.resultIndex; Pe < G.results.length; Pe++) {
4735
+ const Ae = G.results[Pe];
4736
4736
  if (!Ae) continue;
4737
4737
  const Fe = Ae[0]?.transcript ?? "";
4738
- Ae.isFinal ? le += Fe : Z += Fe;
4738
+ Ae.isFinal ? de += Fe : Q += Fe;
4739
4739
  }
4740
- q += le, S.textContent = q, H.textContent = Z, I.value = `${q} ${Z}`.trim(), M();
4740
+ q += de, S.textContent = q, F.textContent = Q, I.value = `${q} ${Q}`.trim(), M();
4741
4741
  }, O.onend = () => x(), O.onerror = () => x();
4742
4742
  try {
4743
4743
  O.start();
@@ -4745,83 +4745,83 @@ function Ti(t, e, a) {
4745
4745
  x();
4746
4746
  }
4747
4747
  }
4748
- function ne() {
4748
+ function ce() {
4749
4749
  try {
4750
4750
  O?.stop();
4751
4751
  } catch {
4752
4752
  }
4753
4753
  }
4754
4754
  function x() {
4755
- D && (D = !1, k = !1, re(), u && oe(), q.trim() && (I.value = q.trim()), I.style.display = "", _.style.display = "none", S.textContent = "", H.textContent = "", M());
4755
+ U && (U = !1, k = !1, z(), u && ne(), q.trim() && (I.value = q.trim()), I.style.display = "", _.style.display = "none", S.textContent = "", F.textContent = "", M());
4756
4756
  }
4757
- async function $() {
4758
- const F = ++U, J = Array.from(N.querySelectorAll("span"));
4757
+ async function C() {
4758
+ const R = ++j, V = Array.from(B.querySelectorAll("span"));
4759
4759
  try {
4760
- const ee = await navigator.mediaDevices.getUserMedia({ audio: !0 });
4761
- if (!k || F !== U) {
4762
- ee.getTracks().forEach((Ie) => Ie.stop());
4760
+ const G = await navigator.mediaDevices.getUserMedia({ audio: !0 });
4761
+ if (!k || R !== j) {
4762
+ G.getTracks().forEach((Ie) => Ie.stop());
4763
4763
  return;
4764
4764
  }
4765
- V = ee;
4766
- const Z = window, le = Z.AudioContext ?? Z.webkitAudioContext;
4767
- if (!le)
4768
- throw V = null, ee.getTracks().forEach((Ie) => Ie.stop()), new Error("AudioContext not supported");
4769
- const Pe = new le();
4770
- if (!k || F !== U) {
4771
- ee.getTracks().forEach((Ie) => Ie.stop()), Pe.close().catch(() => {
4765
+ $ = G;
4766
+ const Q = window, de = Q.AudioContext ?? Q.webkitAudioContext;
4767
+ if (!de)
4768
+ throw $ = null, G.getTracks().forEach((Ie) => Ie.stop()), new Error("AudioContext not supported");
4769
+ const Pe = new de();
4770
+ if (!k || R !== j) {
4771
+ G.getTracks().forEach((Ie) => Ie.stop()), Pe.close().catch(() => {
4772
4772
  });
4773
4773
  return;
4774
4774
  }
4775
- f = Pe, C = Pe.createAnalyser(), C.fftSize = 256, Pe.createMediaStreamSource(ee).connect(C);
4776
- const Ae = new Uint8Array(C.frequencyBinCount), Fe = () => {
4777
- if (!k || F !== U || !C) return;
4778
- C.getByteFrequencyData(Ae);
4779
- const Ie = Math.max(1, Math.floor(Ae.length / J.length));
4780
- J.forEach((ka, Ca) => {
4775
+ b = Pe, E = Pe.createAnalyser(), E.fftSize = 256, Pe.createMediaStreamSource(G).connect(E);
4776
+ const Ae = new Uint8Array(E.frequencyBinCount), Fe = () => {
4777
+ if (!k || R !== j || !E) return;
4778
+ E.getByteFrequencyData(Ae);
4779
+ const Ie = Math.max(1, Math.floor(Ae.length / V.length));
4780
+ V.forEach((ka, Ca) => {
4781
4781
  ka.style.height = `${4 + Math.round((Ae[Ca * Ie] ?? 0) / 255 * 8)}px`;
4782
- }), L = requestAnimationFrame(Fe);
4782
+ }), T = requestAnimationFrame(Fe);
4783
4783
  };
4784
4784
  Fe();
4785
4785
  } catch {
4786
- if (!k || F !== U) return;
4787
- L !== null && (cancelAnimationFrame(L), L = null), C && (C.disconnect(), C = null), f && (f.close().catch(() => {
4788
- }), f = null), V && (V.getTracks().forEach((ee) => ee.stop()), V = null), N.classList.add("is-css-animated");
4786
+ if (!k || R !== j) return;
4787
+ T !== null && (cancelAnimationFrame(T), T = null), E && (E.disconnect(), E = null), b && (b.close().catch(() => {
4788
+ }), b = null), $ && ($.getTracks().forEach((G) => G.stop()), $ = null), B.classList.add("is-css-animated");
4789
4789
  }
4790
4790
  }
4791
- function re() {
4792
- U += 1, N.classList.remove("is-css-animated"), L !== null && (cancelAnimationFrame(L), L = null), C && (C.disconnect(), C = null), f && (f.close().catch(() => {
4793
- }), f = null), V && (V.getTracks().forEach((F) => F.stop()), V = null), Array.from(N.querySelectorAll("span")).forEach((F) => {
4794
- F.style.height = "4px";
4791
+ function z() {
4792
+ j += 1, B.classList.remove("is-css-animated"), T !== null && (cancelAnimationFrame(T), T = null), E && (E.disconnect(), E = null), b && (b.close().catch(() => {
4793
+ }), b = null), $ && ($.getTracks().forEach((R) => R.stop()), $ = null), Array.from(B.querySelectorAll("span")).forEach((R) => {
4794
+ R.style.height = "4px";
4795
4795
  });
4796
4796
  }
4797
- function ie() {
4798
- B.classList.add("is-active");
4797
+ function Y() {
4798
+ N.classList.add("is-active");
4799
4799
  }
4800
+ function ne() {
4801
+ N.classList.remove("is-active");
4802
+ }
4803
+ W.addEventListener("click", re), J.addEventListener("click", (R) => {
4804
+ R.preventDefault(), R.stopPropagation(), k ? ce() : ie();
4805
+ }), P.addEventListener("click", () => {
4806
+ k && (k = !1, ce(), U = !1, z(), u && ne(), q = "", I.style.display = "", _.style.display = "none", S.textContent = "", F.textContent = "", M());
4807
+ }), L.addEventListener("click", (R) => {
4808
+ R.preventDefault(), R.stopPropagation(), e.onOpenChat();
4809
+ }), I.addEventListener("input", M), I.addEventListener("keydown", (R) => {
4810
+ R.key === "Enter" && re();
4811
+ }), M(), Z();
4800
4812
  function oe() {
4801
- B.classList.remove("is-active");
4802
- }
4803
- W.addEventListener("click", G), X.addEventListener("click", (F) => {
4804
- F.preventDefault(), F.stopPropagation(), k ? ne() : Q();
4805
- }), E.addEventListener("click", () => {
4806
- k && (k = !1, ne(), D = !1, re(), u && oe(), q = "", I.style.display = "", _.style.display = "none", S.textContent = "", H.textContent = "", M());
4807
- }), P.addEventListener("click", (F) => {
4808
- F.preventDefault(), F.stopPropagation(), e.onOpenChat();
4809
- }), I.addEventListener("input", M), I.addEventListener("keydown", (F) => {
4810
- F.key === "Enter" && G();
4811
- }), M(), T();
4812
- function ue() {
4813
4813
  K = !0, M();
4814
4814
  }
4815
- function ve() {
4816
- j(), re(), oe(), k && (k = !1, ne()), O && (O.onresult = null, O.onend = null, O.onerror = null, O = null);
4815
+ function le() {
4816
+ te(), z(), ne(), k && (k = !1, ce()), O && (O.onresult = null, O.onend = null, O.onerror = null, O = null);
4817
4817
  }
4818
4818
  return {
4819
- container: z,
4820
- showOpenChatButton: ue,
4821
- destroy: ve
4819
+ container: H,
4820
+ showOpenChatButton: oe,
4821
+ destroy: le
4822
4822
  };
4823
4823
  }
4824
- var Ai = "gengage-inline-launcher-style", Ot = "gengage-inline-launcher-hide-floating", me = "gengage-inline-launcher", Ii = "gengage-inline-launcher", xa = "data-gengage-inline-sibling", at = "data-gengage-inline-sibling-restore-index", Mi = '<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="M8.85 2.4c.23 0 .43.16.48.39l.9 3.77a3.8 3.8 0 0 0 2.8 2.8l3.77.9a.5.5 0 0 1 0 .98l-3.77.9a3.8 3.8 0 0 0-2.8 2.8l-.9 3.77a.5.5 0 0 1-.98 0l-.9-3.77a3.8 3.8 0 0 0-2.8-2.8l-3.77-.9a.5.5 0 0 1 0-.98l3.77-.9a3.8 3.8 0 0 0 2.8-2.8l.9-3.77c.05-.23.25-.39.48-.39Z" fill="currentColor"/><path d="M15.95 1.1c.12 0 .23.08.26.2l.32 1.34c.16.68.7 1.21 1.37 1.37l1.34.32a.27.27 0 0 1 0 .53l-1.34.32a1.87 1.87 0 0 0-1.37 1.37l-.32 1.34a.27.27 0 0 1-.53 0l-.32-1.34A1.87 1.87 0 0 0 14 5.18l-1.34-.32a.27.27 0 0 1 0-.53L14 4a1.87 1.87 0 0 0 1.37-1.37l.32-1.34c.03-.12.14-.2.26-.2Z" fill="currentColor" opacity=".72"/></svg>', se = {
4824
+ var Ai = "gengage-inline-launcher-style", Ut = "gengage-inline-launcher-hide-floating", ue = "gengage-inline-launcher", Ii = "gengage-inline-launcher", xa = "data-gengage-inline-sibling", at = "data-gengage-inline-sibling-restore-index", Mi = '<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="M8.85 2.4c.23 0 .43.16.48.39l.9 3.77a3.8 3.8 0 0 0 2.8 2.8l3.77.9a.5.5 0 0 1 0 .98l-3.77.9a3.8 3.8 0 0 0-2.8 2.8l-.9 3.77a.5.5 0 0 1-.98 0l-.9-3.77a3.8 3.8 0 0 0-2.8-2.8l-3.77-.9a.5.5 0 0 1 0-.98l3.77-.9a3.8 3.8 0 0 0 2.8-2.8l.9-3.77c.05-.23.25-.39.48-.39Z" fill="currentColor"/><path d="M15.95 1.1c.12 0 .23.08.26.2l.32 1.34c.16.68.7 1.21 1.37 1.37l1.34.32a.27.27 0 0 1 0 .53l-1.34.32a1.87 1.87 0 0 0-1.37 1.37l-.32 1.34a.27.27 0 0 1-.53 0l-.32-1.34A1.87 1.87 0 0 0 14 5.18l-1.34-.32a.27.27 0 0 1 0-.53L14 4a1.87 1.87 0 0 0 1.37-1.37l.32-1.34c.03-.12.14-.2.26-.2Z" fill="currentColor" opacity=".72"/></svg>', se = {
4825
4825
  rowGap: "14px",
4826
4826
  buttonHeight: "46px",
4827
4827
  buttonPadding: "0 14px 0 10px",
@@ -4841,7 +4841,8 @@ var Ai = "gengage-inline-launcher-style", Ot = "gengage-inline-launcher-hide-flo
4841
4841
  sparkSize: "14px",
4842
4842
  sparkIconSize: "12px",
4843
4843
  hideTitle: !1,
4844
- hideSpark: !0
4844
+ hideSpark: !0,
4845
+ hideLogo: !1
4845
4846
  }
4846
4847
  };
4847
4848
  function Ni(t) {
@@ -4866,12 +4867,13 @@ function Ni(t) {
4866
4867
  sparkSize: e?.sparkSize ?? se.mobile.sparkSize,
4867
4868
  sparkIconSize: e?.sparkIconSize ?? se.mobile.sparkIconSize,
4868
4869
  hideTitle: e?.hideTitle ?? se.mobile.hideTitle,
4869
- hideSpark: e?.hideSpark ?? se.mobile.hideSpark
4870
+ hideSpark: e?.hideSpark ?? se.mobile.hideSpark,
4871
+ hideLogo: e?.hideLogo ?? se.mobile.hideLogo
4870
4872
  }
4871
4873
  };
4872
4874
  }
4873
4875
  function Bi(t) {
4874
- const e = `.${t.rowClassName}`, a = `#${CSS.escape(t.buttonId)}`, n = `.${me}-icon`, r = `.${me}-copy`, i = `.${me}-title`, o = `.${me}-spark`, s = `@media (max-width: ${t.compactBelowWidth - 0.02}px)`, { sizes: c } = t, l = c.mobile.hideTitle ? "display:none;" : "display:flex;flex:0 1 auto;min-width:0;", p = c.mobile.hideSpark ? "display:none;" : "display:inline-flex;";
4876
+ const e = `.${t.rowClassName}`, a = `#${CSS.escape(t.buttonId)}`, n = `.${ue}-icon`, r = `.${ue}-copy`, i = `.${ue}-title`, o = `.${ue}-spark`, s = `@media (max-width: ${t.compactBelowWidth - 0.02}px)`, { sizes: c } = t, l = c.mobile.hideTitle ? "display:none;" : "display:flex;flex:0 1 auto;min-width:0;", p = c.mobile.hideSpark ? "display:none;" : "display:inline-flex;", g = c.mobile.hideLogo ? "display:none !important;width:0 !important;height:0 !important;flex:0 0 0 !important;overflow:hidden !important;" : "display:inline-flex;";
4875
4877
  return `
4876
4878
  ${e}{
4877
4879
  display:flex;
@@ -4923,7 +4925,7 @@ ${a}:focus-visible{
4923
4925
  outline:2px solid color-mix(in srgb, ${t.primaryColor} 34%, white);
4924
4926
  outline-offset:2px;
4925
4927
  }
4926
- ${a}.${me}--active{
4928
+ ${a}.${ue}--active{
4927
4929
  border-color:${t.primaryColor};
4928
4930
  background:linear-gradient(180deg,#fff7ef 0%,#ffe7d5 100%);
4929
4931
  box-shadow:0 16px 28px color-mix(in srgb, ${t.primaryColor} 24%, transparent);
@@ -4983,6 +4985,9 @@ ${s}{
4983
4985
  font-size:${c.mobile.fontSize};
4984
4986
  line-height:1.05;
4985
4987
  }
4988
+ ${a} ${n}{
4989
+ ${g}
4990
+ }
4986
4991
  ${a} ${o}{
4987
4992
  ${p}
4988
4993
  width:${c.mobile.sparkSize};
@@ -5000,120 +5005,155 @@ function zi(t) {
5000
5005
  return new Promise((e) => window.setTimeout(e, t));
5001
5006
  }
5002
5007
  function Ri(t, e, a) {
5003
- const { hostSelector: n, rowClassName: r = "gengage-inline-launcher-row", siblingSelector: i, siblingPlacement: o = "before", rowPlacement: s = "end", title: c = "Ask", iconUrl: l, primaryColor: p = "#6366f1", textColor: g = "#222222", fontFamily: h = "inherit", borderRadius: m = "3px", showSparkIcon: v = !0, desktopMinWidth: b = 0, enableOnMobile: u = !1, disabledPageTypes: d = ["pdp"], hideFloatingLauncher: A = !0, mountPollFrames: y = 90, debounceMs: w = 90, buttonId: z = Ii } = t, I = t.ariaLabel ?? c, _ = t.siblingRestoreParentSelector ?? n, S = u && b > 0 ? b : 576, H = Ni(t.size), W = `${Ai}-${z}`;
5004
- let X = !1, P = !1, E = null, N = null;
5005
- const B = () => {
5008
+ const { hostSelector: n, rowClassName: r = "gengage-inline-launcher-row", siblingSelector: i, siblingPlacement: o = "before", rowPlacement: s = "end", title: c = "Ask", iconUrl: l, primaryColor: p = "#6366f1", textColor: g = "#222222", fontFamily: h = "inherit", borderRadius: m = "3px", showSparkIcon: v = !0, desktopMinWidth: f = 0, enableOnMobile: u = !1, disabledPageTypes: d = ["pdp"], hideFloatingLauncher: A = !0, mountPollFrames: y = 90, debounceMs: w = 90, buttonId: H = Ii } = t, I = t.ariaLabel ?? c, _ = t.siblingRestoreParentSelector ?? n, S = u && f > 0 ? f : 576, F = Ni(t.size), W = `${Ai}-${H}`;
5009
+ let J = !1, L = !1, P = null, B = null, N = null;
5010
+ const k = () => {
5011
+ if (u && f > 0 && window.innerWidth < f && t.mobileHost && t.mobileHost) {
5012
+ const C = t.mobileHost;
5013
+ return {
5014
+ hostSelector: C.hostSelector,
5015
+ siblingSelector: C.siblingSelector ?? i,
5016
+ siblingRestoreParentSelector: C.siblingRestoreParentSelector ?? C.hostSelector,
5017
+ rowPlacement: C.rowPlacement ?? s,
5018
+ siblingPlacement: C.siblingPlacement ?? o
5019
+ };
5020
+ }
5021
+ return {
5022
+ hostSelector: n,
5023
+ siblingSelector: i,
5024
+ siblingRestoreParentSelector: _,
5025
+ rowPlacement: s,
5026
+ siblingPlacement: o
5027
+ };
5028
+ }, U = (C) => [
5029
+ C.hostSelector,
5030
+ C.siblingSelector ?? "",
5031
+ C.siblingRestoreParentSelector
5032
+ ].join("|"), q = () => {
5006
5033
  if (document.getElementById(W)) return;
5007
- const T = document.createElement("style");
5008
- T.id = W, T.textContent = Bi({
5034
+ const C = document.createElement("style");
5035
+ C.id = W, C.textContent = Bi({
5009
5036
  primaryColor: p,
5010
5037
  textColor: g,
5011
5038
  fontFamily: h,
5012
5039
  borderRadius: m,
5013
5040
  rowClassName: r,
5014
5041
  compactBelowWidth: S,
5015
- buttonId: z,
5016
- sizes: H
5017
- }), document.head.appendChild(T);
5018
- }, k = (T) => {
5042
+ buttonId: H,
5043
+ sizes: F
5044
+ }), document.head.appendChild(C);
5045
+ }, K = (C) => {
5019
5046
  if (!A || !a.shadowRoot) return;
5020
- const j = a.shadowRoot.getElementById(Ot);
5021
- if (!T) {
5022
- j?.remove();
5047
+ const z = a.shadowRoot.getElementById(Ut);
5048
+ if (!C) {
5049
+ z?.remove();
5023
5050
  return;
5024
5051
  }
5025
- if (j) return;
5026
- const G = document.createElement("style");
5027
- G.id = Ot, G.textContent = ".gengage-chat-launcher-container,.gengage-fl{display:none!important;}", a.shadowRoot.appendChild(G);
5028
- }, D = () => {
5029
- const T = document.querySelector(n);
5030
- return T instanceof HTMLElement ? T : null;
5031
- }, q = () => {
5032
- if (!i) return null;
5033
- const T = document.querySelector(i);
5034
- return T instanceof HTMLElement ? T : null;
5035
- }, K = () => {
5036
- const T = document.querySelector(_);
5037
- return T instanceof HTMLElement ? T : null;
5038
- }, O = (T) => {
5039
- if (T.hasAttribute(at)) return;
5040
- const j = T.parentElement;
5041
- if (!j) return;
5042
- const G = Array.from(j.children).indexOf(T);
5043
- G >= 0 && T.setAttribute(at, String(G));
5044
- }, te = () => {
5045
- const T = q(), j = K();
5046
- if (!T || !j || (O(T), T.parentElement === j)) return;
5047
- const G = T.getAttribute(at), Q = G ? Number.parseInt(G, 10) : 0, ne = Array.from(j.children).filter(($) => !($ instanceof HTMLElement && $.classList.contains(r))), x = Number.isFinite(Q) && Q >= 0 ? ne[Q] ?? null : null;
5048
- if (x) {
5049
- j.insertBefore(T, x);
5052
+ if (z) return;
5053
+ const Y = document.createElement("style");
5054
+ Y.id = Ut, Y.textContent = ".gengage-chat-launcher-container,.gengage-fl{display:none!important;}", a.shadowRoot.appendChild(Y);
5055
+ }, O = (C) => {
5056
+ const z = document.querySelector(C);
5057
+ return z instanceof HTMLElement ? z : null;
5058
+ }, ee = (C) => {
5059
+ if (!C) return null;
5060
+ const z = document.querySelector(C);
5061
+ return z instanceof HTMLElement ? z : null;
5062
+ }, X = (C) => {
5063
+ const z = document.querySelector(C);
5064
+ return z instanceof HTMLElement ? z : null;
5065
+ }, $ = (C) => {
5066
+ if (C.hasAttribute(at)) return;
5067
+ const z = C.parentElement;
5068
+ if (!z) return;
5069
+ const Y = Array.from(z.children).indexOf(C);
5070
+ Y >= 0 && C.setAttribute(at, String(Y));
5071
+ }, b = (C) => {
5072
+ const z = ee(C.siblingSelector), Y = X(C.siblingRestoreParentSelector);
5073
+ if (!z || !Y || ($(z), z.parentElement === Y)) return;
5074
+ const ne = z.getAttribute(at), oe = ne ? Number.parseInt(ne, 10) : 0, le = Array.from(Y.children).filter((V) => !(V instanceof HTMLElement && V.classList.contains(r))), R = Number.isFinite(oe) && oe >= 0 ? le[oe] ?? null : null;
5075
+ if (R) {
5076
+ Y.insertBefore(z, R);
5077
+ return;
5078
+ }
5079
+ Y.appendChild(z);
5080
+ }, E = (C) => {
5081
+ C.querySelector(`.${r}`)?.remove();
5082
+ }, T = () => {
5083
+ const C = document.createElement("span");
5084
+ C.className = `${ue}-icon`;
5085
+ const z = document.createElement("img");
5086
+ return z.src = l, z.alt = "", z.draggable = !1, C.appendChild(z), C;
5087
+ }, j = () => window.innerWidth < S, M = (C) => {
5088
+ if (!l) return;
5089
+ const z = C.querySelector(`.${ue}-icon`);
5090
+ if (j() && F.mobile.hideLogo) {
5091
+ z?.remove();
5050
5092
  return;
5051
5093
  }
5052
- j.appendChild(T);
5053
- }, Y = (T) => {
5054
- T.querySelector(`.${r}`)?.remove();
5055
- }, V = () => {
5056
- const T = document.createElement("button");
5057
- if (T.type = "button", T.id = z, T.className = me, T.setAttribute("aria-label", I), l) {
5058
- const Q = document.createElement("span");
5059
- Q.className = `${me}-icon`;
5060
- const ne = document.createElement("img");
5061
- ne.src = l, ne.alt = "", ne.draggable = !1, Q.appendChild(ne), T.appendChild(Q);
5062
- }
5063
- const j = document.createElement("span");
5064
- j.className = `${me}-copy`;
5065
- const G = document.createElement("span");
5066
- if (G.className = `${me}-title`, G.textContent = c, j.appendChild(G), T.appendChild(j), v) {
5067
- const Q = document.createElement("span");
5068
- Q.className = `${me}-spark`, Q.innerHTML = Mi, T.appendChild(Q);
5069
- }
5070
- return T.addEventListener("click", () => e.onClick()), T;
5071
- }, f = (T, j, G) => {
5072
- if (O(j), j.setAttribute(xa, "true"), o === "before") {
5073
- (j.parentElement !== T || j.nextElementSibling !== G) && T.insertBefore(j, G);
5094
+ z || C.insertBefore(T(), C.firstChild);
5095
+ }, D = () => {
5096
+ const C = document.createElement("button");
5097
+ C.type = "button", C.id = H, C.className = ue, C.setAttribute("aria-label", I), l && C.appendChild(T());
5098
+ const z = document.createElement("span");
5099
+ z.className = `${ue}-copy`;
5100
+ const Y = document.createElement("span");
5101
+ if (Y.className = `${ue}-title`, Y.textContent = c, z.appendChild(Y), C.appendChild(z), v) {
5102
+ const ne = document.createElement("span");
5103
+ ne.className = `${ue}-spark`, ne.innerHTML = Mi, C.appendChild(ne);
5104
+ }
5105
+ return C.addEventListener("click", () => e.onClick()), C;
5106
+ }, Z = (C, z, Y) => {
5107
+ if ($(z), z.setAttribute(xa, "true"), o === "before") {
5108
+ (z.parentElement !== C || z.nextElementSibling !== Y) && C.insertBefore(z, Y);
5074
5109
  return;
5075
5110
  }
5076
- (j.parentElement !== T || G.nextElementSibling !== j) && T.appendChild(j);
5077
- }, C = () => {
5078
- te();
5079
- const T = D();
5080
- T && Y(T), k(!1), X = !1;
5081
- }, L = (T) => !(T && d.includes(T) || b > 0 && window.innerWidth < b && !u), U = async (T) => {
5082
- const j = T ?? a.getPageType();
5083
- if (!L(j))
5084
- return C(), !1;
5085
- B();
5086
- for (let G = 0; G < y; G += 1) {
5087
- if (!L(j))
5088
- return C(), !1;
5089
- const Q = D(), ne = q();
5090
- if (Q && (!i || ne)) {
5091
- ne && O(ne), te();
5092
- let x = Q.querySelector(`.${r}`);
5093
- x instanceof HTMLElement || (x = document.createElement("div"), x.className = r, s === "start" ? Q.insertBefore(x, Q.firstChild) : Q.appendChild(x));
5094
- let $ = x.querySelector(`#${CSS.escape(z)}`);
5095
- return $ instanceof HTMLButtonElement ? N = $ : ($ = V(), N = $, x.appendChild($)), ne && f(x, ne, $), P ? $.classList.add(`${me}--active`) : $.classList.remove(`${me}--active`), k(!0), X = !0, !0;
5111
+ (z.parentElement !== C || Y.nextElementSibling !== z) && C.appendChild(z);
5112
+ }, te = () => {
5113
+ if (N) {
5114
+ b(N);
5115
+ const C = O(N.hostSelector);
5116
+ C && E(C), N = null;
5117
+ }
5118
+ K(!1), J = !1;
5119
+ }, re = (C) => !(C && d.includes(C) || f > 0 && window.innerWidth < f && !u), ie = async (C) => {
5120
+ const z = C ?? a.getPageType();
5121
+ if (!re(z))
5122
+ return te(), !1;
5123
+ q();
5124
+ const Y = k();
5125
+ N && U(N) !== U(Y) && te();
5126
+ for (let ne = 0; ne < y; ne += 1) {
5127
+ if (!re(z))
5128
+ return te(), !1;
5129
+ const oe = k(), le = O(oe.hostSelector), R = ee(oe.siblingSelector);
5130
+ if (le && (!oe.siblingSelector || R)) {
5131
+ N && U(N) !== U(oe) && te(), R && $(R);
5132
+ let V = le.querySelector(`.${r}`);
5133
+ V instanceof HTMLElement || (V = document.createElement("div"), V.className = r, oe.rowPlacement === "start" ? le.insertBefore(V, le.firstChild) : le.appendChild(V));
5134
+ let G = V.querySelector(`#${CSS.escape(H)}`);
5135
+ return G instanceof HTMLButtonElement ? B = G : (G = D(), B = G, V.appendChild(G)), R && Z(V, R, G), M(G), L ? G.classList.add(`${ue}--active`) : G.classList.remove(`${ue}--active`), K(!0), J = !0, N = oe, !0;
5096
5136
  }
5097
5137
  await zi(16);
5098
5138
  }
5099
- return C(), !1;
5100
- }, M = () => {
5101
- E !== null && window.clearTimeout(E), E = window.setTimeout(() => {
5102
- E = null, U();
5139
+ return te(), !1;
5140
+ }, ce = () => {
5141
+ P !== null && window.clearTimeout(P), P = window.setTimeout(() => {
5142
+ P = null, ie();
5103
5143
  }, w);
5104
- }, R = () => M();
5105
- return window.addEventListener("resize", R, { passive: !0 }), window.addEventListener("orientationchange", R), {
5144
+ }, x = () => ce();
5145
+ return window.addEventListener("resize", x, { passive: !0 }), window.addEventListener("orientationchange", x), {
5106
5146
  get isMounted() {
5107
- return X;
5147
+ return J;
5108
5148
  },
5109
- sync(T) {
5110
- return U(T);
5149
+ sync(C) {
5150
+ return ie(C);
5111
5151
  },
5112
- setActive(T) {
5113
- P = T, N?.classList.toggle(`${me}--active`, T);
5152
+ setActive(C) {
5153
+ L = C, B?.classList.toggle(`${ue}--active`, C);
5114
5154
  },
5115
5155
  destroy() {
5116
- E !== null && (window.clearTimeout(E), E = null), window.removeEventListener("resize", R), window.removeEventListener("orientationchange", R), C(), document.getElementById(W)?.remove(), N = null;
5156
+ P !== null && (window.clearTimeout(P), P = null), window.removeEventListener("resize", x), window.removeEventListener("orientationchange", x), te(), document.getElementById(W)?.remove(), B = null;
5117
5157
  }
5118
5158
  };
5119
5159
  }
@@ -5164,13 +5204,13 @@ var Di = /* @__PURE__ */ new Set([
5164
5204
  "DT",
5165
5205
  "DD"
5166
5206
  ]);
5167
- function Oi(t) {
5207
+ function Ui(t) {
5168
5208
  const e = [];
5169
5209
  let a = [];
5170
5210
  for (const n of t) n.nodeType === Node.ELEMENT_NODE && Di.has(n.tagName) ? (a.length > 0 && (e.push(a), a = []), e.push([n])) : a.push(n);
5171
5211
  return a.length > 0 && e.push(a), e;
5172
5212
  }
5173
- function Ui(t) {
5213
+ function Oi(t) {
5174
5214
  for (const e of t) for (const a of e) if (a.nodeType === Node.ELEMENT_NODE && (a.tagName === "TABLE" || a.querySelector?.("table"))) return !0;
5175
5215
  return !1;
5176
5216
  }
@@ -5180,8 +5220,8 @@ function ji() {
5180
5220
  function $i(t) {
5181
5221
  const { container: e, html: a, delayMs: n = 30, onTick: r, onComplete: i } = t, o = document.createElement("template");
5182
5222
  o.innerHTML = a;
5183
- const s = Oi(o.content.childNodes);
5184
- if (ji() || s.length <= 1 || Ui(s))
5223
+ const s = Ui(o.content.childNodes);
5224
+ if (ji() || s.length <= 1 || Oi(s))
5185
5225
  return e.innerHTML = a, i?.(), {
5186
5226
  complete() {
5187
5227
  },
@@ -5213,7 +5253,7 @@ function $i(t) {
5213
5253
  }
5214
5254
  };
5215
5255
  }
5216
- function Ut(t) {
5256
+ function Ot(t) {
5217
5257
  return t !== void 0 && /[\p{L}\p{N}_]/u.test(t);
5218
5258
  }
5219
5259
  function qi(t) {
@@ -5233,17 +5273,17 @@ function qi(t) {
5233
5273
  continue;
5234
5274
  }
5235
5275
  const h = g > 0 ? p[g - 1] : void 0, m = p[g + o.short_name.length];
5236
- if (Ut(h) || Ut(m)) {
5276
+ if (Ot(h) || Ot(m)) {
5237
5277
  c = s.nextNode();
5238
5278
  continue;
5239
5279
  }
5240
- const v = p.slice(0, g), b = p.slice(g, g + o.short_name.length), u = p.slice(g + o.short_name.length), d = c.parentNode;
5280
+ const v = p.slice(0, g), f = p.slice(g, g + o.short_name.length), u = p.slice(g + o.short_name.length), d = c.parentNode;
5241
5281
  if (!d) {
5242
5282
  c = s.nextNode();
5243
5283
  continue;
5244
5284
  }
5245
5285
  const A = document.createElement("a");
5246
- A.className = "gengage-product-mention", A.textContent = b, A.href = "#", A.addEventListener("click", (y) => {
5286
+ A.className = "gengage-product-mention", A.textContent = f, A.href = "#", A.addEventListener("click", (y) => {
5247
5287
  y.preventDefault(), n(o.sku);
5248
5288
  }), v && d.insertBefore(document.createTextNode(v), c), d.insertBefore(A, c), u && d.insertBefore(document.createTextNode(u), c), d.removeChild(c), l = !0;
5249
5289
  }
@@ -5526,7 +5566,7 @@ var eo = class {
5526
5566
  const a = this._snapshotRebuilders.get(t), n = this.snapshots.get(t);
5527
5567
  if (!a && !n) return !1;
5528
5568
  const r = this.deps.shadow(), i = this.deps.drawer();
5529
- this.activePanelMessageId && r?.querySelector(`[data-message-id="${ge(this.activePanelMessageId)}"]`)?.classList.remove("gengage-chat-bubble--active"), r?.querySelector(`[data-message-id="${ge(e)}"]`)?.classList.add("gengage-chat-bubble--active"), this.activePanelMessageId = e;
5569
+ this.activePanelMessageId && r?.querySelector(`[data-message-id="${pe(this.activePanelMessageId)}"]`)?.classList.remove("gengage-chat-bubble--active"), r?.querySelector(`[data-message-id="${pe(e)}"]`)?.classList.add("gengage-chat-bubble--active"), this.activePanelMessageId = e;
5530
5570
  const o = a ? a() : n.cloneNode(!0);
5531
5571
  i?.setPanelContent(o);
5532
5572
  const s = this.snapshotTypes.get(t);
@@ -5660,7 +5700,7 @@ function lo(t, e) {
5660
5700
  function rt(t) {
5661
5701
  return `${io}:${t}`;
5662
5702
  }
5663
- function Oe(t, e) {
5703
+ function Ue(t, e) {
5664
5704
  return `${oo}:${t}:${e}`;
5665
5705
  }
5666
5706
  function wa(t) {
@@ -5737,7 +5777,7 @@ var bo = class {
5737
5777
  return t ? t.map(mo).sort((e, a) => a.updatedAt.localeCompare(e.updatedAt)) : [];
5738
5778
  }
5739
5779
  loadSession(t) {
5740
- const e = Vt(this._storage?.getItem(Oe(this._scope, t)) ?? null);
5780
+ const e = Vt(this._storage?.getItem(Ue(this._scope, t)) ?? null);
5741
5781
  return !e || e.version !== qt ? null : fo(e);
5742
5782
  }
5743
5783
  saveSession(t) {
@@ -5785,14 +5825,14 @@ var bo = class {
5785
5825
  sourceSessionId: c.sourceSessionId
5786
5826
  }); l.length > so; ) {
5787
5827
  const p = l.pop();
5788
- p && this._storage.removeItem(Oe(this._scope, p.id));
5828
+ p && this._storage.removeItem(Ue(this._scope, p.id));
5789
5829
  }
5790
5830
  return this._commitRecord(c, l) ? c : null;
5791
5831
  }
5792
5832
  deleteSession(t) {
5793
5833
  if (!this._storage) return;
5794
5834
  const e = this.listSessions().filter((a) => a.id !== t);
5795
- this._storage.removeItem(Oe(this._scope, t));
5835
+ this._storage.removeItem(Ue(this._scope, t));
5796
5836
  try {
5797
5837
  this._storage.setItem(rt(this._scope), JSON.stringify(e));
5798
5838
  } catch {
@@ -5802,12 +5842,12 @@ var bo = class {
5802
5842
  if (!this._storage) return !1;
5803
5843
  const a = [...e];
5804
5844
  for (; a.length > 0; ) try {
5805
- return this._storage.setItem(Oe(this._scope, t.id), JSON.stringify(t)), this._storage.setItem(rt(this._scope), JSON.stringify(a)), !0;
5845
+ return this._storage.setItem(Ue(this._scope, t.id), JSON.stringify(t)), this._storage.setItem(rt(this._scope), JSON.stringify(a)), !0;
5806
5846
  } catch {
5807
5847
  const n = a.pop();
5808
5848
  if (!n) break;
5809
5849
  if (n.id !== t.id) {
5810
- this._storage.removeItem(Oe(this._scope, n.id));
5850
+ this._storage.removeItem(Ue(this._scope, n.id));
5811
5851
  continue;
5812
5852
  }
5813
5853
  break;
@@ -5885,7 +5925,7 @@ var bo = class {
5885
5925
  await e();
5886
5926
  } catch {
5887
5927
  }
5888
- a?.send("openURLInNewTab", { url: t }), be(t) && n(t);
5928
+ a?.send("openURLInNewTab", { url: t }), ve(t) && n(t);
5889
5929
  }
5890
5930
  async loadPayload(t, e) {
5891
5931
  if (!this._db) return null;
@@ -6095,7 +6135,7 @@ function Bo(t) {
6095
6135
  function zo(t) {
6096
6136
  if (!t.trim()) return !1;
6097
6137
  const e = document.createElement("template");
6098
- return e.innerHTML = he(t), (e.content.textContent ?? "").trim().length > 0;
6138
+ return e.innerHTML = fe(t), (e.content.textContent ?? "").trim().length > 0;
6099
6139
  }
6100
6140
  function Yt(t) {
6101
6141
  return t.length > 120 ? !1 : /^[a-zA-Z0-9#(),.\s%/\-]+$/.test(t);
@@ -6116,7 +6156,7 @@ var Ro = class Me extends Ka {
6116
6156
  if (!this._hostScrollLockActive || !this._hostScrollLockViewport || this._hostScrollPinning || this._isMobileViewport && window.visualViewport && window.visualViewport.height < window.innerHeight) return;
6117
6157
  const a = this._hostScrollLockViewport;
6118
6158
  window.scrollX === a.x && window.scrollY === a.y || (this._hostScrollPinning = !0, window.scrollTo(a.x, a.y), this._hostScrollPinning = !1);
6119
- }, this._messages = [], this._currentMessageId = 0, this._abortControllers = /* @__PURE__ */ new Set(), this._currentThreadId = null, this._lastThreadId = null, this._chatCreatedAt = "", this._lastBackendContext = null, this._productSort = { type: "related" }, this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._comparisonRefreshRafId = null, this._lastAppliedKeyboardInset = 0, this._syncVisualVh = null, this._viewedProductSkus = /* @__PURE__ */ new Set(), this._panelAiSpecByThread = /* @__PURE__ */ new Map(), this._choicePrompterEl = null, this._openState = "full", this._mobileBreakpoint = 768, this._isMobileViewport = !1, this._gaPrevMainPaneExpanded = !1, this._pdpLaunched = !1, this._plpLaunched = !1, this._homepageLaunched = !1, this._entryContextPrimed = !1, this._contextPrimingInFlight = !1, this._queuedUserMessages = [], this._productContextUnavailableSku = null, this._i18n = Re, this._extendedModeManager = null, this._activeTypewriter = null, this._activeTtsHandle = null, this._activeRequestThreadId = null, this._skuToProductItem = {}, this._conversationMode = null, this._initComplete = !1, this._pendingActions = [], this._bridgeContext = null, this._cartQuantity = null, this._threadsWithFirstBot = /* @__PURE__ */ new Set(), this._panel = null, this._localPanelHistory = [], this._currentPanelSource = null, this._currentInlineProductSummaryRecord = null, this._session = null, this._historyStorage = null, this._activeHistorySessionId = null, this._presentation = new vo(), this._presentationScrollTimerIds = /* @__PURE__ */ new Set(), this._eventCallbacks = /* @__PURE__ */ new Map(), this._pendingAddToCartKeys = /* @__PURE__ */ new Set(), this._lastSentAction = null, this._consecutiveErrorCount = 0, this._lastErrorMessage = "", this._launcherAnchorCleanup = null, this._modeController = new On(), this._syncLauncherAnchor = null;
6159
+ }, this._messages = [], this._currentMessageId = 0, this._abortControllers = /* @__PURE__ */ new Set(), this._currentThreadId = null, this._lastThreadId = null, this._chatCreatedAt = "", this._lastBackendContext = null, this._productSort = { type: "related" }, this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._comparisonRefreshRafId = null, this._lastAppliedKeyboardInset = 0, this._syncVisualVh = null, this._viewedProductSkus = /* @__PURE__ */ new Set(), this._panelAiSpecByThread = /* @__PURE__ */ new Map(), this._choicePrompterEl = null, this._openState = "full", this._mobileBreakpoint = 768, this._isMobileViewport = !1, this._gaPrevMainPaneExpanded = !1, this._pdpLaunched = !1, this._plpLaunched = !1, this._homepageLaunched = !1, this._entryContextPrimed = !1, this._contextPrimingInFlight = !1, this._queuedUserMessages = [], this._productContextUnavailableSku = null, this._i18n = Re, this._extendedModeManager = null, this._activeTypewriter = null, this._activeTtsHandle = null, this._activeRequestThreadId = null, this._skuToProductItem = {}, this._conversationMode = null, this._initComplete = !1, this._pendingActions = [], this._bridgeContext = null, this._cartQuantity = null, this._threadsWithFirstBot = /* @__PURE__ */ new Set(), this._panel = null, this._localPanelHistory = [], this._currentPanelSource = null, this._currentInlineProductSummaryRecord = null, this._session = null, this._historyStorage = null, this._activeHistorySessionId = null, this._presentation = new vo(), this._presentationScrollTimerIds = /* @__PURE__ */ new Set(), this._eventCallbacks = /* @__PURE__ */ new Map(), this._pendingAddToCartKeys = /* @__PURE__ */ new Set(), this._lastSentAction = null, this._consecutiveErrorCount = 0, this._lastErrorMessage = "", this._launcherAnchorCleanup = null, this._modeController = new Un(), this._syncLauncherAnchor = null;
6120
6160
  }
6121
6161
  static {
6122
6162
  this._MAX_COMPARISON_SELECTION = 5;
@@ -6151,7 +6191,7 @@ var Ro = class Me extends Ka {
6151
6191
  for (const [u, d] of Object.entries(e.theme)) u.startsWith("--") && typeof d == "string" && r(u, d);
6152
6192
  this._applyDiscountedPriceColorVar(e.productPriceUi?.discountedPriceColor);
6153
6193
  const i = document.createElement("div");
6154
- i.className = "gengage-chat-root", i.lang = Ue(e.locale), this._rootEl = i, this._shadow.appendChild(i);
6194
+ i.className = "gengage-chat-root", i.lang = Oe(e.locale), this._rootEl = i, this._shadow.appendChild(i);
6155
6195
  const o = e.variant ?? "floating";
6156
6196
  if (o === "inline" && i.classList.add("gengage-chat--inline"), o !== "inline") {
6157
6197
  const u = document.createElement("div");
@@ -6280,7 +6320,7 @@ var Ro = class Me extends Ka {
6280
6320
  if (!this._drawerVisible || !this._isMobileViewport) return;
6281
6321
  const A = this._drawer?.getElement();
6282
6322
  if (!A) return;
6283
- const y = window.visualViewport, w = Math.max(0, Math.round(window.innerHeight - (y.height + y.offsetTop))), z = w > 90, I = this._openState === "full" && z ? w : 0;
6323
+ const y = window.visualViewport, w = Math.max(0, Math.round(window.innerHeight - (y.height + y.offsetTop))), H = w > 90, I = this._openState === "full" && H ? w : 0;
6284
6324
  I !== this._lastAppliedKeyboardInset && (this._lastAppliedKeyboardInset = I, A.style.setProperty("--gengage-chat-keyboard-inset", `${I}px`)), this._openState === "full" && (A.style.setProperty("--gengage-chat-visual-vh", `${Math.round(y.height)}px`), A.style.setProperty("--gengage-chat-visual-top", `${Math.round(y.offsetTop)}px`));
6285
6325
  };
6286
6326
  this._syncVisualVh = () => {
@@ -6294,11 +6334,11 @@ var Ro = class Me extends Ka {
6294
6334
  });
6295
6335
  }
6296
6336
  o === "inline" && (this._drawerVisible = !0, this.isVisible = !0, this._applyOpenStateClasses(), this._presentation.setShown(!0), setTimeout(() => this._maybeAutoAnchorUnreadAssistant(), 60));
6297
- const b = {
6337
+ const f = {
6298
6338
  namespace: "chat",
6299
6339
  onMessage: (u) => this._handleBridgeMessage(u)
6300
6340
  };
6301
- e.allowedOrigins !== void 0 && (b.allowedOrigins = e.allowedOrigins), this._bridge = new an(b), this._lastSku = this.config.pageContext?.sku, this._lastPageType = this.config.pageContext?.pageType, this._lastSkuListKey = this.config.pageContext?.skuList?.slice(0, 48).join(","), this._initComplete = !0;
6341
+ e.allowedOrigins !== void 0 && (f.allowedOrigins = e.allowedOrigins), this._bridge = new an(f), this._lastSku = this.config.pageContext?.sku, this._lastPageType = this.config.pageContext?.pageType, this._lastSkuListKey = this.config.pageContext?.skuList?.slice(0, 48).join(","), this._initComplete = !0;
6302
6342
  for (const u of this._pendingActions) this._sendAction(u.action, u.options);
6303
6343
  this._pendingActions = [], this._pillLauncherApply && o === "floating" && (await this._pillLauncherApply(), this._pillLauncherApply = null), we("gengage:chat:ready", {}), Ga("chat"), e.onReady?.();
6304
6344
  }
@@ -6365,21 +6405,21 @@ var Ro = class Me extends Ka {
6365
6405
  const l = () => {
6366
6406
  const I = window.innerWidth <= r ? a.mobile : a.desktop;
6367
6407
  if (!I) return;
6368
- const _ = I.selector, S = !!_, H = (S ? document.querySelector(_) : null)?.getBoundingClientRect();
6408
+ const _ = I.selector, S = !!_, F = (S ? document.querySelector(_) : null)?.getBoundingClientRect();
6369
6409
  if (I.bottom !== void 0) {
6370
- const { offset: W, type: X } = I.bottom;
6410
+ const { offset: W, type: J } = I.bottom;
6371
6411
  if (!S) n.style.setProperty(s, `${Math.max(0, W)}px`);
6372
- else if (H) {
6373
- const P = X === "root" || W === 0 ? H.bottom : H.top, E = Math.max(0, window.innerHeight - P + W);
6374
- n.style.setProperty(s, `${E}px`);
6412
+ else if (F) {
6413
+ const L = J === "root" || W === 0 ? F.bottom : F.top, P = Math.max(0, window.innerHeight - L + W);
6414
+ n.style.setProperty(s, `${P}px`);
6375
6415
  }
6376
6416
  }
6377
6417
  if (I.right !== void 0) {
6378
- const { offset: W, type: X } = I.right;
6418
+ const { offset: W, type: J } = I.right;
6379
6419
  if (!S) n.style.setProperty(c, `${Math.max(0, W)}px`);
6380
- else if (H) {
6381
- const P = X === "root" || W === 0 ? H.right : H.left, E = Math.max(0, window.innerWidth - P + W);
6382
- n.style.setProperty(c, `${E}px`);
6420
+ else if (F) {
6421
+ const L = J === "root" || W === 0 ? F.right : F.left, P = Math.max(0, window.innerWidth - L + W);
6422
+ n.style.setProperty(c, `${P}px`);
6383
6423
  }
6384
6424
  }
6385
6425
  }, p = () => {
@@ -6393,7 +6433,7 @@ var Ro = class Me extends Ka {
6393
6433
  }, v = new ResizeObserver(() => {
6394
6434
  (!o() || g) && l();
6395
6435
  });
6396
- let b = null, u = null;
6436
+ let f = null, u = null;
6397
6437
  const d = () => {
6398
6438
  const I = i()?.selector;
6399
6439
  return !I || !!document.querySelector(I);
@@ -6405,7 +6445,7 @@ var Ro = class Me extends Ka {
6405
6445
  subtree: !0
6406
6446
  }));
6407
6447
  }, y = () => {
6408
- v.disconnect(), b?.disconnect(), b = null, g = !1;
6448
+ v.disconnect(), f?.disconnect(), f = null, g = !1;
6409
6449
  const I = i();
6410
6450
  if (!I) return;
6411
6451
  if (!I.selector) {
@@ -6413,25 +6453,25 @@ var Ro = class Me extends Ka {
6413
6453
  return;
6414
6454
  }
6415
6455
  const _ = document.querySelector(I.selector);
6416
- _ && (v.observe(_), o() ? (b = new IntersectionObserver((S) => {
6417
- for (const H of S) H.isIntersecting ? (g = !0, l()) : (g = !1, p(), A());
6418
- }, { threshold: 0 }), b.observe(_)) : l());
6456
+ _ && (v.observe(_), o() ? (f = new IntersectionObserver((S) => {
6457
+ for (const F of S) F.isIntersecting ? (g = !0, l()) : (g = !1, p(), A());
6458
+ }, { threshold: 0 }), f.observe(_)) : l());
6419
6459
  };
6420
6460
  y();
6421
6461
  let w = 0;
6422
- const z = () => {
6462
+ const H = () => {
6423
6463
  w || (w = requestAnimationFrame(() => {
6424
6464
  w = 0, g = !1, p(), u?.disconnect(), u = null, y(), A(), o() || l();
6425
6465
  }));
6426
6466
  };
6427
- window.addEventListener("resize", z, { passive: !0 }), window.addEventListener("scroll", m, { passive: !0 }), window.visualViewport?.addEventListener("scroll", m, { passive: !0 }), this._syncLauncherAnchor = () => {
6467
+ window.addEventListener("resize", H, { passive: !0 }), window.addEventListener("scroll", m, { passive: !0 }), window.visualViewport?.addEventListener("scroll", m, { passive: !0 }), this._syncLauncherAnchor = () => {
6428
6468
  g = !1, p(), u?.disconnect(), u = null, y(), A();
6429
6469
  }, o() ? A() : (l(), [
6430
6470
  100,
6431
6471
  400,
6432
6472
  1e3
6433
6473
  ].forEach((I) => window.setTimeout(l, I))), this._launcherAnchorCleanup = () => {
6434
- v.disconnect(), b?.disconnect(), u?.disconnect(), window.removeEventListener("resize", z), window.removeEventListener("scroll", m), window.visualViewport?.removeEventListener("scroll", m), w && cancelAnimationFrame(w), h && cancelAnimationFrame(h);
6474
+ v.disconnect(), f?.disconnect(), u?.disconnect(), window.removeEventListener("resize", H), window.removeEventListener("scroll", m), window.visualViewport?.removeEventListener("scroll", m), w && cancelAnimationFrame(w), h && cancelAnimationFrame(h);
6435
6475
  };
6436
6476
  }
6437
6477
  syncLauncherAnchor() {
@@ -6500,7 +6540,7 @@ var Ro = class Me extends Ka {
6500
6540
  if (a.role === "assistant" && !a.frontendOnly && (a.status === "streaming" || a.status === "done") && (a.content == null || a.content.length === 0)) {
6501
6541
  if (a.threadId) {
6502
6542
  const n = this._messages.some((r) => r.id !== a.id && r.threadId === a.threadId && r.frontendOnly) || this._panel?.snapshotTypes.has(a.id) === !0;
6503
- this._threadsWithFirstBot.delete(a.threadId), this._presentation.finalizeAssistantGroup(a.threadId), this._shadow?.querySelectorAll(`[data-thread-id="${ge(a.threadId)}"]:not([data-message-id])`).forEach((r) => r.remove()), this._panel && !n && (this._panel.threads = this._panel.threads.filter((r) => r !== a.threadId));
6543
+ this._threadsWithFirstBot.delete(a.threadId), this._presentation.finalizeAssistantGroup(a.threadId), this._shadow?.querySelectorAll(`[data-thread-id="${pe(a.threadId)}"]:not([data-message-id])`).forEach((r) => r.remove()), this._panel && !n && (this._panel.threads = this._panel.threads.filter((r) => r !== a.threadId));
6504
6544
  }
6505
6545
  this._drawer?.removeMessageBubble(a.id), this._panel?.snapshots.delete(a.id), this._panel?.snapshotTypes.delete(a.id);
6506
6546
  continue;
@@ -6889,7 +6929,7 @@ var Ro = class Me extends Ka {
6889
6929
  }
6890
6930
  if (this._maybeHandleDirectAddToCartCommand(e)) return;
6891
6931
  }
6892
- this._contextPrimingInFlight && (this._abortAllActiveRequests(), this._contextPrimingInFlight = !1, this._queuedUserMessages = []), this._ensureMobileFullSheetForPanel(), Ia(), this._messages.some((r) => r.role === "user") || Oa(), ze("chat", "sendMessage", {
6932
+ this._contextPrimingInFlight && (this._abortAllActiveRequests(), this._contextPrimingInFlight = !1, this._queuedUserMessages = []), this._ensureMobileFullSheetForPanel(), Ia(), this._messages.some((r) => r.role === "user") || Ua(), ze("chat", "sendMessage", {
6893
6933
  mode: this._assistantMode,
6894
6934
  hasAttachment: a !== void 0,
6895
6935
  textLength: e.length
@@ -6931,18 +6971,18 @@ var Ro = class Me extends Ka {
6931
6971
  return;
6932
6972
  }
6933
6973
  if (this._clearChoicePrompter(), a?.preservePanel || jt(), !a?.preservePanel && this._comparisonSelectMode && e.type !== "getComparisonTable" && (this._comparisonSelectMode = !1, this._comparisonSelectedSkus = []), a?.preservePanel || (this._localPanelHistory = []), this._currentThreadId && this._lastThreadId && this._lastThreadId > this._currentThreadId) {
6934
- const f = this._currentThreadId, C = this._messages.filter((L) => L.threadId !== void 0 && L.threadId > f);
6935
- this._messages = this._messages.filter((L) => !L.threadId || L.threadId <= f);
6936
- for (const L of C)
6937
- this._shadow?.querySelector(`[data-message-id="${ge(L.id)}"]`)?.remove(), this._panel?.deleteSnapshotForMessage(L.id);
6938
- this._panel?.pruneThreadsAfter(f), this._shadow?.querySelectorAll("[data-thread-id]")?.forEach((L) => {
6939
- L instanceof HTMLElement && L.dataset.threadId && L.dataset.threadId > f && L.remove();
6974
+ const b = this._currentThreadId, E = this._messages.filter((T) => T.threadId !== void 0 && T.threadId > b);
6975
+ this._messages = this._messages.filter((T) => !T.threadId || T.threadId <= b);
6976
+ for (const T of E)
6977
+ this._shadow?.querySelector(`[data-message-id="${pe(T.id)}"]`)?.remove(), this._panel?.deleteSnapshotForMessage(T.id);
6978
+ this._panel?.pruneThreadsAfter(b), this._shadow?.querySelectorAll("[data-thread-id]")?.forEach((T) => {
6979
+ T instanceof HTMLElement && T.dataset.threadId && T.dataset.threadId > b && T.remove();
6940
6980
  });
6941
6981
  }
6942
6982
  a?.preservePills || this._drawer?.setPills([]), this._drawer?.clearInputAreaChips();
6943
6983
  let n = !1;
6944
- const r = (f) => {
6945
- n !== f && (n = f, this._bridge?.send("isResponding", f));
6984
+ const r = (b) => {
6985
+ n !== b && (n = b, this._bridge?.send("isResponding", b));
6946
6986
  };
6947
6987
  r(!0);
6948
6988
  const i = wt();
@@ -6950,22 +6990,22 @@ var Ro = class Me extends Ka {
6950
6990
  const o = a?.preservePanel === !0, s = a?.silent === !0 && a?.isContextPrime === !0, c = s && e.type === "launchSingleProduct";
6951
6991
  let l;
6952
6992
  if (o || (this._activeRequestThreadId = i), !a?.silent && !o && this._drawer?.setPresentationFocus(i), !a?.silent) {
6953
- const f = typeof e.payload == "string" ? e.payload : typeof e.payload?.text == "string" ? e.payload.text : e.title, C = this._messages.length > 0 ? this._messages[this._messages.length - 1] : void 0;
6954
- if (!(C !== void 0 && C.role === "user" && C.content === f)) {
6955
- (!this._messages.some((U) => U.role === "user") || this._drawer?.isKvkkBannerVisible()) && (ot(this.config.accountId), this._drawer?.hideKvkkBanner());
6956
- const L = this._createMessage("user", f);
6957
- L.threadId = i, a?.attachment !== void 0 && (L.attachment = a.attachment), this._drawer?.addMessage(L), a?.attachment !== void 0 && this._modeController.isBeautyConsulting && this._drawer?.setBeautyPhotoStepCard({ visible: !1 }), this._messages.push(L), this._persistHistoryToLocalStorage();
6993
+ const b = typeof e.payload == "string" ? e.payload : typeof e.payload?.text == "string" ? e.payload.text : e.title, E = this._messages.length > 0 ? this._messages[this._messages.length - 1] : void 0;
6994
+ if (!(E !== void 0 && E.role === "user" && E.content === b)) {
6995
+ (!this._messages.some((j) => j.role === "user") || this._drawer?.isKvkkBannerVisible()) && (ot(this.config.accountId), this._drawer?.hideKvkkBanner());
6996
+ const T = this._createMessage("user", b);
6997
+ T.threadId = i, a?.attachment !== void 0 && (T.attachment = a.attachment), this._drawer?.addMessage(T), a?.attachment !== void 0 && this._modeController.isBeautyConsulting && this._drawer?.setBeautyPhotoStepCard({ visible: !1 }), this._messages.push(T), this._persistHistoryToLocalStorage();
6958
6998
  }
6959
6999
  }
6960
7000
  const p = !a?.silent && this._assistantMode === "shopping" && this._hasUnavailableProductContext() && (e.type === "user_message" || e.type === "inputText");
6961
7001
  let g = this._currentPanelSource, h = !1;
6962
7002
  const m = e.type === "user_message" || e.type === "inputText", v = () => {
6963
7003
  h || a?.preservePanel || (g = this._currentPanelSource, h = !0);
6964
- }, b = () => {
7004
+ }, f = () => {
6965
7005
  if (this._drawer?.isPanelLoading()) {
6966
7006
  if (!m && g) {
6967
- const f = this._buildRenderContext(), C = this._renderPanelFromSource(g, f);
6968
- this._drawer.setPanelContent(C), this._currentPanelSource = g;
7007
+ const b = this._buildRenderContext(), E = this._renderPanelFromSource(g, b);
7008
+ this._drawer.setPanelContent(E), this._currentPanelSource = g;
6969
7009
  } else
6970
7010
  this._drawer.clearPanel(), this._currentPanelSource = null;
6971
7011
  g = null;
@@ -6981,9 +7021,9 @@ var Ro = class Me extends Ka {
6981
7021
  ...this.config.injectorAdapter ? { injectorAdapter: this.config.injectorAdapter } : {}
6982
7022
  };
6983
7023
  a?.attachment !== void 0 && (A.attachment = a.attachment);
6984
- const y = this._getVisibleMessages().filter((f) => !f.frontendOnly && f !== d && (f.content || f.role === "assistant")).slice(-50).map((f) => ({
6985
- role: f.role === "user" ? "user" : "model",
6986
- content: f.content ?? ""
7024
+ const y = this._getVisibleMessages().filter((b) => !b.frontendOnly && b !== d && (b.content || b.role === "assistant")).slice(-50).map((b) => ({
7025
+ role: b.role === "user" ? "user" : "model",
7026
+ content: b.content ?? ""
6987
7027
  })), w = {
6988
7028
  outputLanguage: Ao(this.config.locale),
6989
7029
  parentUrl: window.location.href,
@@ -7002,7 +7042,7 @@ var Ro = class Me extends Ka {
7002
7042
  isMobile: this._isMobileViewport
7003
7043
  };
7004
7044
  this.config.isDemoWebsite === !0 && (w.openPdpSimilars = !0), this._modeController.isShopping || (w.assistantMode = this._modeController.mode), this.config.session?.viewId !== void 0 && (w.viewId = this.config.session.viewId);
7005
- const z = cn(e, {
7045
+ const H = cn(e, {
7006
7046
  pageContext: this.config.pageContext,
7007
7047
  backendContext: this._lastBackendContext,
7008
7048
  isMobile: this._isMobileViewport
@@ -7010,8 +7050,8 @@ var Ro = class Me extends Ka {
7010
7050
  account_id: this.config.accountId,
7011
7051
  session_id: this.config.session?.sessionId ?? "",
7012
7052
  correlation_id: this.config.session?.sessionId ?? "",
7013
- type: z.type,
7014
- locale: Ue(this.config.locale),
7053
+ type: H.type,
7054
+ locale: Oe(this.config.locale),
7015
7055
  meta: w,
7016
7056
  context: {
7017
7057
  ...this._lastBackendContext ?? {},
@@ -7019,100 +7059,100 @@ var Ro = class Me extends Ka {
7019
7059
  session_id: this.config.session?.sessionId ?? ""
7020
7060
  }
7021
7061
  };
7022
- this.config.session?.userId !== void 0 && (I.user_id = this.config.session.userId), this.config.session?.viewId !== void 0 && (I.view_id = this.config.session.viewId), z.payload !== void 0 && (I.payload = z.payload), !p && this.config.pageContext?.sku !== void 0 && (I.sku = this.config.pageContext.sku), !p && this.config.pageContext?.pageType !== void 0 && (I.page_type = this.config.pageContext.pageType);
7023
- let _ = !1, S = !1, H = !1, W = !1, X = !1, P = !1;
7024
- const E = Un();
7025
- let N = null, B = null;
7062
+ this.config.session?.userId !== void 0 && (I.user_id = this.config.session.userId), this.config.session?.viewId !== void 0 && (I.view_id = this.config.session.viewId), H.payload !== void 0 && (I.payload = H.payload), !p && this.config.pageContext?.sku !== void 0 && (I.sku = this.config.pageContext.sku), !p && this.config.pageContext?.pageType !== void 0 && (I.page_type = this.config.pageContext.pageType);
7063
+ let _ = !1, S = !1, F = !1, W = !1, J = !1, L = !1;
7064
+ const P = On();
7065
+ let B = null, N = null;
7026
7066
  const k = () => {
7027
7067
  if (this._drawer && !W) {
7028
- if (!H) {
7068
+ if (!F) {
7029
7069
  this._drawer.setPanelAiZoneState("hidden");
7030
7070
  return;
7031
7071
  }
7032
- X ? this._drawer.setPanelAiZoneState("hidden") : this._drawer.setPanelAiZoneState("analyzing", { analyzingLabel: this._i18n.aiAnalysisAnalyzingLabel });
7072
+ J ? this._drawer.setPanelAiZoneState("hidden") : this._drawer.setPanelAiZoneState("analyzing", { analyzingLabel: this._i18n.aiAnalysisAnalyzingLabel });
7033
7073
  }
7034
- }, D = (f) => {
7035
- if (!N || !this._drawer) return;
7036
- const C = this._buildRenderContext();
7037
- C.isStreaming = f;
7038
- const L = this._renderUISpec(N, C);
7039
- W = !0, this._drawer.setPanelAiZoneState("results", { resultEl: L }), N = null;
7040
- }, q = (f, C, L) => {
7041
- if (f === "ProductGrid" || f === "CategoriesContainer") {
7042
- H = !0, D(L), k();
7074
+ }, U = (b) => {
7075
+ if (!B || !this._drawer) return;
7076
+ const E = this._buildRenderContext();
7077
+ E.isStreaming = b;
7078
+ const T = this._renderUISpec(B, E);
7079
+ W = !0, this._drawer.setPanelAiZoneState("results", { resultEl: T }), B = null;
7080
+ }, q = (b, E, T) => {
7081
+ if (b === "ProductGrid" || b === "CategoriesContainer") {
7082
+ F = !0, U(T), k();
7043
7083
  return;
7044
7084
  }
7045
- C !== "appendSimilars" && C !== "append" && (H = !1, W = !1, N = null, this._drawer?.setPanelAiZoneState("hidden"));
7046
- }, K = (f) => (f === "ProductGrid" || f === "CategoriesContainer") && (H || W || N !== null), O = () => {
7047
- P || (P = !0, this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }));
7048
- }, te = (f, C, L) => {
7085
+ E !== "appendSimilars" && E !== "append" && (F = !1, W = !1, B = null, this._drawer?.setPanelAiZoneState("hidden"));
7086
+ }, K = (b) => (b === "ProductGrid" || b === "CategoriesContainer") && (F || W || B !== null), O = () => {
7087
+ L || (L = !0, this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }));
7088
+ }, ee = (b, E, T) => {
7049
7089
  if (!this._drawer || !this._panel) return;
7050
- const U = f.elements[f.root];
7051
- if (L === "ProductGrid" && U) {
7052
- const M = mt(U);
7090
+ const j = b.elements[b.root];
7091
+ if (T === "ProductGrid" && j) {
7092
+ const M = mt(j);
7053
7093
  if (M.isConsulting) {
7054
- const R = this._drawer.getPanelContentElement();
7055
- if (R && Ci(R, M, C)) {
7094
+ const D = this._drawer.getPanelContentElement();
7095
+ if (D && Ci(D, M, E)) {
7056
7096
  this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._drawer.setComparisonDockContent(null), this._currentPanelSource = {
7057
7097
  kind: "spec",
7058
- spec: f
7059
- }, this._panel.currentType = L, this._drawer.resyncPanelTopBarFromCurrentContent();
7098
+ spec: b
7099
+ }, this._panel.currentType = T, this._drawer.resyncPanelTopBarFromCurrentContent();
7060
7100
  return;
7061
7101
  }
7062
7102
  }
7063
7103
  }
7064
- this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._drawer.setComparisonDockContent(null), this._drawer.setPanelContent(this._renderUISpec(f, C), { preserveAiZone: K(L) }), this._currentPanelSource = {
7104
+ this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._drawer.setComparisonDockContent(null), this._drawer.setPanelContent(this._renderUISpec(b, E), { preserveAiZone: K(T) }), this._currentPanelSource = {
7065
7105
  kind: "spec",
7066
- spec: f
7067
- }, this._panel.currentType = L;
7068
- }, Y = (f, C, L, U) => {
7106
+ spec: b
7107
+ }, this._panel.currentType = T;
7108
+ }, X = (b, E, T, j) => {
7069
7109
  if (!this._panel) return;
7070
- f === "ProductDetailsPanel" && e.type === "launchSingleProduct" && this._clearUnavailableProductContext(), d.threadId && this._panel.threads[this._panel.threads.length - 1] !== d.threadId && this._panel.threads.push(d.threadId), this._isMobileViewport && f === "ProductGrid" && this._ensureMobilePanelOverlayVisible();
7071
- const M = this._panel.currentType ?? f, R = C?.props?.panelTitle;
7072
- this._panel.updateTopBar(M, R), this._panel.updateExtendedMode(f), this._isMobileViewport && c && this._drawer?.hideMobilePanel(), q(f, L, U);
7110
+ b === "ProductDetailsPanel" && e.type === "launchSingleProduct" && this._clearUnavailableProductContext(), d.threadId && this._panel.threads[this._panel.threads.length - 1] !== d.threadId && this._panel.threads.push(d.threadId), this._isMobileViewport && b === "ProductGrid" && this._ensureMobilePanelOverlayVisible();
7111
+ const M = this._panel.currentType ?? b, D = E?.props?.panelTitle;
7112
+ this._panel.updateTopBar(M, D), this._panel.updateExtendedMode(b), this._isMobileViewport && c && this._drawer?.hideMobilePanel(), q(b, T, j);
7073
7113
  };
7074
- let V = null;
7075
- if (V = pn(I, {
7076
- onTextChunk: (f, C, L) => {
7077
- if (!o && i !== this._activeRequestThreadId || (u += f, zo(u) && O(), L?.skuToProductItem && (this._skuToProductItem = {
7114
+ let $ = null;
7115
+ if ($ = pn(I, {
7116
+ onTextChunk: (b, E, T) => {
7117
+ if (!o && i !== this._activeRequestThreadId || (u += b, zo(u) && O(), T?.skuToProductItem && (this._skuToProductItem = {
7078
7118
  ...this._skuToProductItem,
7079
- ...L.skuToProductItem
7080
- }), L?.conversationMode && (this._conversationMode = L.conversationMode), L?.renderHint && (d.renderHint = L.renderHint), !this._drawer)) return;
7081
- let U = u;
7082
- if (L?.kvkk === !0 || vt(U)) {
7083
- if (C) {
7084
- const R = this.config.accountId;
7085
- if (!Wt(R)) {
7086
- const T = Lo(U);
7087
- T ? this._drawer?.showKvkkBanner(T, () => {
7088
- this._drawer?.hideKvkkBanner(), ot(R);
7089
- }) : ot(R);
7119
+ ...T.skuToProductItem
7120
+ }), T?.conversationMode && (this._conversationMode = T.conversationMode), T?.renderHint && (d.renderHint = T.renderHint), !this._drawer)) return;
7121
+ let j = u;
7122
+ if (T?.kvkk === !0 || vt(j)) {
7123
+ if (E) {
7124
+ const D = this.config.accountId;
7125
+ if (!Wt(D)) {
7126
+ const Z = Lo(j);
7127
+ Z ? this._drawer?.showKvkkBanner(Z, () => {
7128
+ this._drawer?.hideKvkkBanner(), ot(D);
7129
+ }) : ot(D);
7090
7130
  }
7091
7131
  }
7092
- U = Po(U);
7132
+ j = Po(j);
7093
7133
  }
7094
7134
  const M = this._shadow?.querySelector(`[data-message-id="${d.id}"] .gengage-chat-bubble-text`);
7095
- if (M ? M.innerHTML = he(U) : (d.content = U, d.role === "assistant" && d.threadId && !this._threadsWithFirstBot.has(d.threadId) && (this._threadsWithFirstBot.add(d.threadId), this._drawer.markFirstBotMessage(d.id)), this._drawer.addMessage(d)), C)
7096
- if (d.content = U, d.status = "done", xt(), $n(d))
7097
- this._drawer?.updateBotMessage(d.id, U, "photo_analysis", d.photoAnalysis), d.threadId && this._focusPresentationThread(d.threadId, "auto");
7135
+ if (M ? M.innerHTML = fe(j) : (d.content = j, d.role === "assistant" && d.threadId && !this._threadsWithFirstBot.has(d.threadId) && (this._threadsWithFirstBot.add(d.threadId), this._drawer.markFirstBotMessage(d.id)), this._drawer.addMessage(d)), E)
7136
+ if (d.content = j, d.status = "done", xt(), $n(d))
7137
+ this._drawer?.updateBotMessage(d.id, j, "photo_analysis", d.photoAnalysis), d.threadId && this._focusPresentationThread(d.threadId, "auto");
7098
7138
  else {
7099
- const R = this._shadow?.querySelector(`[data-message-id="${d.id}"] .gengage-chat-bubble-text`);
7100
- if (R) {
7139
+ const D = this._shadow?.querySelector(`[data-message-id="${d.id}"] .gengage-chat-bubble-text`);
7140
+ if (D) {
7101
7141
  this._activeTypewriter?.cancel();
7102
- const T = L?.productMentions;
7142
+ const Z = T?.productMentions;
7103
7143
  this._activeTypewriter = $i({
7104
- container: R,
7105
- html: he(U),
7144
+ container: D,
7145
+ html: fe(j),
7106
7146
  onTick: () => this._drawer?.scrollToBottomIfNeeded(),
7107
7147
  onComplete: () => {
7108
- this._activeTypewriter = null, T && T.length > 0 && R && qi({
7109
- container: R,
7110
- mentions: T,
7111
- onProductClick: (j) => {
7148
+ this._activeTypewriter = null, Z && Z.length > 0 && D && qi({
7149
+ container: D,
7150
+ mentions: Z,
7151
+ onProductClick: (te) => {
7112
7152
  this._sendAction({
7113
- title: T.find((G) => G.sku === j)?.short_name ?? j,
7153
+ title: Z.find((re) => re.sku === te)?.short_name ?? te,
7114
7154
  type: "launchSingleProduct",
7115
- payload: { sku: j }
7155
+ payload: { sku: te }
7116
7156
  });
7117
7157
  }
7118
7158
  });
@@ -7121,106 +7161,106 @@ var Ro = class Me extends Ka {
7121
7161
  }
7122
7162
  }
7123
7163
  },
7124
- onUISpec: (f, C, L, U) => {
7125
- if (!o && i !== this._activeRequestThreadId || C !== "chat") return;
7126
- U && (this._clearAssistantPanelLikeStreamClearPanel(), _ = !1, B = null);
7127
- const M = f.elements[f.root], R = M?.type ?? "unknown";
7128
- if (jn(R, M?.props ?? {}, E, {
7164
+ onUISpec: (b, E, T, j) => {
7165
+ if (!o && i !== this._activeRequestThreadId || E !== "chat") return;
7166
+ j && (this._clearAssistantPanelLikeStreamClearPanel(), _ = !1, N = null);
7167
+ const M = b.elements[b.root], D = M?.type ?? "unknown";
7168
+ if (jn(D, M?.props ?? {}, P, {
7129
7169
  drawer: this._drawer,
7130
7170
  ensureRendered: () => this._ensureAssistantMessageRendered(d),
7131
7171
  cancelTypewriter: () => {
7132
7172
  this._activeTypewriter?.cancel(), this._activeTypewriter = null;
7133
7173
  },
7134
7174
  sendSkipMessage: () => this._sendMessage(this._i18n.beautyPhotoStepSkipMessage),
7135
- streamDone: X
7175
+ streamDone: J
7136
7176
  }, d)) {
7137
- R === "PhotoAnalysisCard" && d.threadId && this._focusPresentationThread(d.threadId, "auto");
7177
+ D === "PhotoAnalysisCard" && d.threadId && this._focusPresentationThread(d.threadId, "auto");
7138
7178
  return;
7139
7179
  }
7140
- const T = ct(M), j = this.config.productDetailsExtended !== !0 && (R === "ProductDetailsPanel" || T);
7141
- j && !U && (this._clearAssistantPanelLikeStreamClearPanel(), _ = !1);
7142
- const G = R === "ProductDetailsPanel" && L !== "panel" ? "panel" : L, Q = this._buildRenderContext();
7143
- if (Q.isStreaming = !0, R === "ComparisonTable") {
7144
- const F = M?.props?.products;
7145
- $a(Array.isArray(F) ? F.length : 0);
7180
+ const Z = ct(M), te = this.config.productDetailsExtended !== !0 && (D === "ProductDetailsPanel" || Z);
7181
+ te && !j && (this._clearAssistantPanelLikeStreamClearPanel(), _ = !1);
7182
+ const re = D === "ProductDetailsPanel" && T !== "panel" ? "panel" : T, ie = this._buildRenderContext();
7183
+ if (ie.isStreaming = !0, D === "ComparisonTable") {
7184
+ const R = M?.props?.products;
7185
+ $a(Array.isArray(R) ? R.length : 0);
7146
7186
  }
7147
- if (R === "ProductGrid") {
7148
- const F = M?.children?.length ?? 0;
7149
- za(void 0, F);
7187
+ if (D === "ProductGrid") {
7188
+ const R = M?.children?.length ?? 0;
7189
+ za(void 0, R);
7150
7190
  }
7151
- const ne = G === "panel" && this._panel ? this._panel.toPanelSpec(f) : f;
7152
- if (G === "panel" && this._panel && !j && R === "ProductGrid" && M) {
7153
- const F = mt(M);
7154
- if (F.isConsulting && !ki(F)) {
7155
- B = f;
7191
+ const ce = re === "panel" && this._panel ? this._panel.toPanelSpec(b) : b;
7192
+ if (re === "panel" && this._panel && !te && D === "ProductGrid" && M) {
7193
+ const R = mt(M);
7194
+ if (R.isConsulting && !ki(R)) {
7195
+ N = b;
7156
7196
  return;
7157
7197
  }
7158
- F.isConsulting && (B = null);
7198
+ R.isConsulting && (N = null);
7159
7199
  }
7160
- if (Bo(M) && O(), G === "panel" && this._panel && !j) {
7161
- const F = !S;
7200
+ if (Bo(M) && O(), re === "panel" && this._panel && !te) {
7201
+ const R = !S;
7162
7202
  S = !0;
7163
- const J = M?.props?.replacePanel === !0, ee = M?.props?.rankingState, Z = J || ee === "pending" || ee === "final" ? "replace" : ro({
7164
- componentType: R,
7203
+ const V = M?.props?.replacePanel === !0, G = M?.props?.rankingState, Q = V || G === "pending" || G === "final" ? "replace" : ro({
7204
+ componentType: D,
7165
7205
  similarsAppend: M?.props?.similarsAppend === !0,
7166
7206
  currentPanelType: this._panel.currentType,
7167
7207
  hasPanelContent: this._drawer?.hasPanelContent() ?? !1,
7168
7208
  isPanelLoading: this._drawer?.isPanelLoading() ?? !1,
7169
- isFirstPanelContentInStream: F
7209
+ isFirstPanelContentInStream: R
7170
7210
  });
7171
- Q.panelProductListHeading = void 0, R === "ProductGrid" && (Z === "appendSimilars" ? Q.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products" : this._applyPanelListHeadingToContext(Q, {
7211
+ ie.panelProductListHeading = void 0, D === "ProductGrid" && (Q === "appendSimilars" ? ie.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products" : this._applyPanelListHeadingToContext(ie, {
7172
7212
  kind: "spec",
7173
- spec: ne
7174
- })), Z === "appendSimilars" ? this._appendSimilarsToPanel(ne, Q) : Z === "append" ? (this._drawer?.appendPanelContent(this._renderUISpec(ne, Q)), this._comparisonSelectMode && this._refreshComparisonUI()) : te(ne, Q, R), Y(R, M, Z, !0);
7213
+ spec: ce
7214
+ })), Q === "appendSimilars" ? this._appendSimilarsToPanel(ce, ie) : Q === "append" ? (this._drawer?.appendPanelContent(this._renderUISpec(ce, ie)), this._comparisonSelectMode && this._refreshComparisonUI()) : ee(ce, ie, D), X(D, M, Q, !0);
7175
7215
  }
7176
- if (R === "ProductDetailsPanel" && G === "panel" && (!d.silent || c)) {
7177
- const F = M?.props?.product;
7178
- if (F) {
7179
- c && (l = F), this._currentInlineProductSummaryRecord = F;
7180
- const J = {
7216
+ if (D === "ProductDetailsPanel" && re === "panel" && (!d.silent || c)) {
7217
+ const R = M?.props?.product;
7218
+ if (R) {
7219
+ c && (l = R), this._currentInlineProductSummaryRecord = R;
7220
+ const V = {
7181
7221
  root: "root",
7182
7222
  elements: { root: {
7183
7223
  type: "ProductSummaryCard",
7184
- props: { product: F }
7224
+ props: { product: R }
7185
7225
  } }
7186
- }, ee = this._shadow?.querySelector(".gengage-chat-messages");
7187
- if (ee) {
7188
- const Z = this._renderUISpec(J, Q);
7189
- d.threadId && (Z.dataset.threadId = d.threadId);
7190
- const le = this._shadow?.querySelector(`[data-message-id="${d.id}"]`);
7191
- le && le.parentNode === ee ? le.after(Z) : ee.appendChild(Z), this._scrollInlineIntoView(Z, d.threadId), this._drawer?.refreshPresentationCollapsed(), S = !0;
7226
+ }, G = this._shadow?.querySelector(".gengage-chat-messages");
7227
+ if (G) {
7228
+ const Q = this._renderUISpec(V, ie);
7229
+ d.threadId && (Q.dataset.threadId = d.threadId);
7230
+ const de = this._shadow?.querySelector(`[data-message-id="${d.id}"]`);
7231
+ de && de.parentNode === G ? de.after(Q) : G.appendChild(Q), this._scrollInlineIntoView(Q, d.threadId), this._drawer?.refreshPresentationCollapsed(), S = !0;
7192
7232
  }
7193
7233
  }
7194
7234
  }
7195
- const x = R === "AITopPicks" || R === "AIGroupingCards", $ = R === "ActionButtons" ? M?.props?.buttons : void 0, re = R === "ActionButtons" && this._modeController.mode !== "shopping" && Array.isArray($) && $.length > 0 && $.every((F) => F.action?.type === "inputText");
7196
- let ie = !1, oe = !1;
7197
- if (j && T && (Q.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products"), x && (!d.silent || s))
7198
- if (d.threadId && this._rememberPanelAiSpec(d.threadId, f), H) {
7199
- const F = this._renderUISpec(f, Q);
7200
- W = !0, this._drawer?.setPanelAiZoneState("results", { resultEl: F }), ie = !0, N = null;
7235
+ const x = D === "AITopPicks" || D === "AIGroupingCards", C = D === "ActionButtons" ? M?.props?.buttons : void 0, z = D === "ActionButtons" && this._modeController.mode !== "shopping" && Array.isArray(C) && C.length > 0 && C.every((R) => R.action?.type === "inputText");
7236
+ let Y = !1, ne = !1;
7237
+ if (te && Z && (ie.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products"), x && (!d.silent || s))
7238
+ if (d.threadId && this._rememberPanelAiSpec(d.threadId, b), F) {
7239
+ const R = this._renderUISpec(b, ie);
7240
+ W = !0, this._drawer?.setPanelAiZoneState("results", { resultEl: R }), Y = !0, B = null;
7201
7241
  } else
7202
- N = f, oe = !0;
7203
- const ue = s && (R === "GroundingReviewCard" || x);
7204
- if (!x && (!d.silent || ue) && (G !== "panel" || R === "ProductCard" || j && R === "ProductGrid" && !T) && (R !== "ActionButtons" || re) && !ie && !(oe && x)) {
7205
- const F = this._shadow?.querySelector(".gengage-chat-messages");
7206
- if (F) {
7207
- const J = this._renderUISpec(f, Q);
7208
- d.threadId && (J.dataset.threadId = d.threadId), F.appendChild(J), this._scrollInlineIntoView(J, d.threadId), this._drawer?.refreshPresentationCollapsed(), j && R === "ProductGrid" && (S = !0);
7242
+ B = b, ne = !0;
7243
+ const oe = s && (D === "GroundingReviewCard" || x);
7244
+ if (!x && (!d.silent || oe) && (re !== "panel" || D === "ProductCard" || te && D === "ProductGrid" && !Z) && (D !== "ActionButtons" || z) && !Y && !(ne && x)) {
7245
+ const R = this._shadow?.querySelector(".gengage-chat-messages");
7246
+ if (R) {
7247
+ const V = this._renderUISpec(b, ie);
7248
+ d.threadId && (V.dataset.threadId = d.threadId), R.appendChild(V), this._scrollInlineIntoView(V, d.threadId), this._drawer?.refreshPresentationCollapsed(), te && D === "ProductGrid" && (S = !0);
7209
7249
  }
7210
7250
  }
7211
- if ((R === "ProductGrid" || R === "ProductCard") && d.threadId) {
7212
- const F = M?.children ?? [], J = R === "ProductGrid" ? F.map((ee) => f.elements[ee]?.props?.product).filter(Boolean) : [M?.props?.product].filter(Boolean);
7213
- for (const ee of J) {
7214
- const Z = ee.sku;
7215
- Z && this._viewedProductSkus.add(Z);
7251
+ if ((D === "ProductGrid" || D === "ProductCard") && d.threadId) {
7252
+ const R = M?.children ?? [], V = D === "ProductGrid" ? R.map((G) => b.elements[G]?.props?.product).filter(Boolean) : [M?.props?.product].filter(Boolean);
7253
+ for (const G of V) {
7254
+ const Q = G.sku;
7255
+ Q && this._viewedProductSkus.add(Q);
7216
7256
  }
7217
7257
  }
7218
- if (R === "ProductGrid" || R === "ProductDetailsPanel") {
7219
- const F = (R === "ProductGrid" ? (M?.children ?? []).map((J) => f.elements[J]?.props?.product).filter(Boolean) : [M?.props?.product ?? M?.props].filter(Boolean)).map((J) => J.imageUrl).filter((J) => typeof J == "string").slice(0, 5);
7220
- F.length > 0 && this._bridge?.send("previewImages", { images: F });
7258
+ if (D === "ProductGrid" || D === "ProductDetailsPanel") {
7259
+ const R = (D === "ProductGrid" ? (M?.children ?? []).map((V) => b.elements[V]?.props?.product).filter(Boolean) : [M?.props?.product ?? M?.props].filter(Boolean)).map((V) => V.imageUrl).filter((V) => typeof V == "string").slice(0, 5);
7260
+ R.length > 0 && this._bridge?.send("previewImages", { images: R });
7221
7261
  }
7222
- const ve = M?.children?.length ?? 0;
7223
- if (R === "ProductGrid" && G === "panel" && !j && ve > 1 && !this._isMobileViewport && !this._modeController.isChoicePrompterHidden && !this._comparisonSelectMode && !Zi(this._currentThreadId ?? "") && (this._clearChoicePrompter(), this._choicePrompterEl = Yi({
7262
+ const le = M?.children?.length ?? 0;
7263
+ if (D === "ProductGrid" && re === "panel" && !te && le > 1 && !this._isMobileViewport && !this._modeController.isChoicePrompterHidden && !this._comparisonSelectMode && !Zi(this._currentThreadId ?? "") && (this._clearChoicePrompter(), this._choicePrompterEl = Yi({
7224
7264
  heading: this._i18n.choicePrompterHeading,
7225
7265
  suggestion: this._i18n.choicePrompterSuggestion,
7226
7266
  ctaLabel: this._i18n.choicePrompterCta,
@@ -7232,92 +7272,92 @@ var Ro = class Me extends Ka {
7232
7272
  onDismiss: () => {
7233
7273
  this._choicePrompterEl = null;
7234
7274
  }
7235
- }), this._mountChoicePrompter()), R === "ActionButtons") {
7236
- const F = M?.props?.buttons;
7237
- if (F && F.length > 0 && !re) {
7238
- const J = [], ee = [];
7239
- for (const Z of F) if (Wi(Z)) {
7240
- const le = {
7241
- label: Z.label,
7242
- action: Z.action
7275
+ }), this._mountChoicePrompter()), D === "ActionButtons") {
7276
+ const R = M?.props?.buttons;
7277
+ if (R && R.length > 0 && !z) {
7278
+ const V = [], G = [];
7279
+ for (const Q of R) if (Wi(Q)) {
7280
+ const de = {
7281
+ label: Q.label,
7282
+ action: Q.action
7243
7283
  };
7244
- Z.icon && (le.icon = Z.icon), J.push(le);
7245
- } else ee.push(Z);
7246
- J.length > 0 && this._drawer?.setInputAreaChips(J.map((Z) => ({
7247
- label: Z.label,
7248
- onAction: () => this._sendAction(Z.action),
7249
- ...Z.icon ? { icon: Z.icon } : {}
7250
- }))), ee.length > 0 && this._drawer?.setPills(ee.map((Z) => {
7251
- const le = {
7252
- label: Z.label,
7253
- onAction: () => this._sendAction(Z.action)
7284
+ Q.icon && (de.icon = Q.icon), V.push(de);
7285
+ } else G.push(Q);
7286
+ V.length > 0 && this._drawer?.setInputAreaChips(V.map((Q) => ({
7287
+ label: Q.label,
7288
+ onAction: () => this._sendAction(Q.action),
7289
+ ...Q.icon ? { icon: Q.icon } : {}
7290
+ }))), G.length > 0 && this._drawer?.setPills(G.map((Q) => {
7291
+ const de = {
7292
+ label: Q.label,
7293
+ onAction: () => this._sendAction(Q.action)
7254
7294
  };
7255
- return Z.icon && (le.icon = Z.icon), Z.image && (le.image = Z.image), Z.description && (le.description = Z.description), le;
7295
+ return Q.icon && (de.icon = Q.icon), Q.image && (de.image = Q.image), Q.description && (de.description = Q.description), de;
7256
7296
  }));
7257
7297
  }
7258
7298
  }
7259
- k(), d.uiSpec = f;
7299
+ k(), d.uiSpec = b;
7260
7300
  },
7261
- onAction: (f) => {
7262
- if (!(!o && i !== this._activeRequestThreadId) && f.type === "action") {
7263
- const C = {};
7264
- this.config.actionHandling?.unknownActionPolicy !== void 0 && (C.unknownActionPolicy = this.config.actionHandling.unknownActionPolicy), this.config.actionHandling?.allowScriptCall !== void 0 && (C.allowScriptCall = this.config.actionHandling.allowScriptCall), Ya(f, {
7301
+ onAction: (b) => {
7302
+ if (!(!o && i !== this._activeRequestThreadId) && b.type === "action") {
7303
+ const E = {};
7304
+ this.config.actionHandling?.unknownActionPolicy !== void 0 && (E.unknownActionPolicy = this.config.actionHandling.unknownActionPolicy), this.config.actionHandling?.allowScriptCall !== void 0 && (E.allowScriptCall = this.config.actionHandling.allowScriptCall), Ya(b, {
7265
7305
  openChat: () => this.open(),
7266
- navigate: (L) => {
7267
- be(L.url) && (this._bridge?.send("navigate", L), L.newTab ? window.open(L.url, "_blank", "noopener,noreferrer") : window.location.href = L.url);
7306
+ navigate: (T) => {
7307
+ ve(T.url) && (this._bridge?.send("navigate", T), T.newTab ? window.open(T.url, "_blank", "noopener,noreferrer") : window.location.href = T.url);
7268
7308
  },
7269
- saveSession: (L) => this.saveSession(L.sessionId, L.sku),
7270
- addToCart: (L) => {
7271
- this._runChatAddToCartFlow(L);
7309
+ saveSession: (T) => this.saveSession(T.sessionId, T.sku),
7310
+ addToCart: (T) => {
7311
+ this._runChatAddToCartFlow(T);
7272
7312
  },
7273
- scriptCall: (L) => {
7274
- we("gengage:chat:script-call", L), this.config.onScriptCall?.(L);
7313
+ scriptCall: (T) => {
7314
+ we("gengage:chat:script-call", T), this.config.onScriptCall?.(T);
7275
7315
  }
7276
- }, C);
7316
+ }, E);
7277
7317
  }
7278
7318
  },
7279
- onMetadata: (f) => {
7280
- if (!(!o && i !== this._activeRequestThreadId) && f.type === "metadata" && f.meta) {
7281
- if (f.meta.panel !== void 0 || f.meta.messages !== void 0 || f.meta.message_id !== void 0) {
7282
- this._lastBackendContext = f.meta;
7283
- const C = de(f.meta.panel);
7284
- C && (this._modeController.updateFromContext(C), this._applyUiHints());
7319
+ onMetadata: (b) => {
7320
+ if (!(!o && i !== this._activeRequestThreadId) && b.type === "metadata" && b.meta) {
7321
+ if (b.meta.panel !== void 0 || b.meta.messages !== void 0 || b.meta.message_id !== void 0) {
7322
+ this._lastBackendContext = b.meta;
7323
+ const E = he(b.meta.panel);
7324
+ E && (this._modeController.updateFromContext(E), this._applyUiHints());
7285
7325
  }
7286
- if (f.meta.panelLoading) {
7287
- const C = typeof f.meta.panelPendingType == "string" ? f.meta.panelPendingType : void 0;
7288
- this.config.productDetailsExtended !== !0 && (C === "productDetails" || C === "productDetailsSimilars") || (_ = !0, S = !1, v(), this._panel && (this._panel.currentType = null), this._drawer?.showPanelLoading(C), this._isMobileViewport && C === "productList" && this._ensureMobilePanelOverlayVisible(), C && this._panel?.updateTopBarForLoading(C));
7326
+ if (b.meta.panelLoading) {
7327
+ const E = typeof b.meta.panelPendingType == "string" ? b.meta.panelPendingType : void 0;
7328
+ this.config.productDetailsExtended !== !0 && (E === "productDetails" || E === "productDetailsSimilars") || (_ = !0, S = !1, v(), this._panel && (this._panel.currentType = null), this._drawer?.showPanelLoading(E), this._isMobileViewport && E === "productList" && this._ensureMobilePanelOverlayVisible(), E && this._panel?.updateTopBarForLoading(E));
7289
7329
  }
7290
- if (f.meta.voice) {
7291
- const C = new CustomEvent("gengage:chat:voice", {
7292
- detail: { payload: f.meta.voice },
7330
+ if (b.meta.voice) {
7331
+ const E = new CustomEvent("gengage:chat:voice", {
7332
+ detail: { payload: b.meta.voice },
7293
7333
  bubbles: !1,
7294
7334
  cancelable: !0
7295
- }), L = window.dispatchEvent(C);
7296
- if (Ba(), L) {
7297
- const U = f.meta.voice;
7298
- U.audio_base64 && (this._activeTtsHandle?.stop(), this._activeTtsHandle = Fi(U.audio_base64, U.content_type ?? "audio/ogg"));
7335
+ }), T = window.dispatchEvent(E);
7336
+ if (Ba(), T) {
7337
+ const j = b.meta.voice;
7338
+ j.audio_base64 && (this._activeTtsHandle?.stop(), this._activeTtsHandle = Fi(j.audio_base64, j.content_type ?? "audio/ogg"));
7299
7339
  }
7300
7340
  }
7301
- if ((f.meta.redirectTarget || f.meta.redirect) && (we("gengage:chat:redirect", {
7302
- target: f.meta.redirectTarget ?? null,
7303
- payload: f.meta.redirect ?? null
7304
- }), ze("redirect", "redirect dispatched", { target: f.meta.redirectTarget ?? null }), this._handleRedirectMetadata(f.meta.redirect)), f.meta.analyzeAnimation && this.config.productDetailsExtended === !0 && (_ = !0, S = !1, v(), this._panel && (this._panel.currentType = null), this._drawer?.showPanelLoading(), this._panel?.updateTopBarForLoading("productDetails")), f.meta.loading) {
7305
- const C = Array.isArray(f.meta.thinkingMessages) ? f.meta.thinkingMessages.filter((U) => typeof U == "string") : [], L = typeof f.meta.loadingText == "string" ? f.meta.loadingText : void 0;
7306
- if (C.length > 0) {
7307
- const U = L && this._modeController.shouldCondenseThinking() ? [...C.slice(0, 2), L] : C;
7308
- this._drawer?.setThinkingSteps(U);
7341
+ if ((b.meta.redirectTarget || b.meta.redirect) && (we("gengage:chat:redirect", {
7342
+ target: b.meta.redirectTarget ?? null,
7343
+ payload: b.meta.redirect ?? null
7344
+ }), ze("redirect", "redirect dispatched", { target: b.meta.redirectTarget ?? null }), this._handleRedirectMetadata(b.meta.redirect)), b.meta.analyzeAnimation && this.config.productDetailsExtended === !0 && (_ = !0, S = !1, v(), this._panel && (this._panel.currentType = null), this._drawer?.showPanelLoading(), this._panel?.updateTopBarForLoading("productDetails")), b.meta.loading) {
7345
+ const E = Array.isArray(b.meta.thinkingMessages) ? b.meta.thinkingMessages.filter((j) => typeof j == "string") : [], T = typeof b.meta.loadingText == "string" ? b.meta.loadingText : void 0;
7346
+ if (E.length > 0) {
7347
+ const j = T && this._modeController.shouldCondenseThinking() ? [...E.slice(0, 2), T] : E;
7348
+ this._drawer?.setThinkingSteps(j);
7309
7349
  }
7310
- typeof L == "string" && L.length > 0 && (this._drawer?.addThinkingStep(L), P || this._bridge?.send("loadingMessage", { text: L }));
7350
+ typeof T == "string" && T.length > 0 && (this._drawer?.addThinkingStep(T), L || this._bridge?.send("loadingMessage", { text: T }));
7311
7351
  }
7312
- f.meta.visitorDataResponse && this._bridge?.send("engagingMessage", f.meta.visitorDataResponse), f.meta.formType && this._bridge?.send("glovForm", {
7313
- type: f.meta.formType,
7314
- data: f.meta.formPayload
7315
- }), f.meta.launcherContent && this._bridge?.send("launcherContent", f.meta.launcherContent), we("gengage:chat:metadata", { payload: f.meta });
7352
+ b.meta.visitorDataResponse && this._bridge?.send("engagingMessage", b.meta.visitorDataResponse), b.meta.formType && this._bridge?.send("glovForm", {
7353
+ type: b.meta.formType,
7354
+ data: b.meta.formPayload
7355
+ }), b.meta.launcherContent && this._bridge?.send("launcherContent", b.meta.launcherContent), we("gengage:chat:metadata", { payload: b.meta });
7316
7356
  }
7317
7357
  },
7318
- onError: (f) => {
7319
- if (V && this._abortControllers.delete(V), !o && i !== this._activeRequestThreadId) return;
7320
- X = !0, this._activeTypewriter?.cancel(), this._activeTypewriter = null, k(), N = null, B = null, r(!1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), this._drawer?.clearInputAreaChips(), Vn(E, {
7358
+ onError: (b) => {
7359
+ if ($ && this._abortControllers.delete($), !o && i !== this._activeRequestThreadId) return;
7360
+ J = !0, this._activeTypewriter?.cancel(), this._activeTypewriter = null, k(), B = null, N = null, r(!1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), this._drawer?.clearInputAreaChips(), Vn(P, {
7321
7361
  drawer: this._drawer,
7322
7362
  ensureRendered: () => {
7323
7363
  },
@@ -7326,20 +7366,20 @@ var Ro = class Me extends Ka {
7326
7366
  sendSkipMessage: () => this._sendMessage(this._i18n.beautyPhotoStepSkipMessage),
7327
7367
  streamDone: !0
7328
7368
  });
7329
- const C = S;
7330
- _ && !S && b(), _ = !1, S = !1;
7331
- const L = d.content != null && d.content.length > 0 || u.length > 0 || C, U = d.silent || L, M = typeof navigator < "u" && navigator.onLine === !1 && Xt(f), R = () => {
7332
- this._shadow?.querySelector(`[data-message-id="${ge(d.id)}"]`)?.remove();
7333
- const G = this._messages.indexOf(d);
7334
- G >= 0 && this._messages.splice(G, 1);
7369
+ const E = S;
7370
+ _ && !S && f(), _ = !1, S = !1;
7371
+ const T = d.content != null && d.content.length > 0 || u.length > 0 || E, j = d.silent || T, M = typeof navigator < "u" && navigator.onLine === !1 && Xt(b), D = () => {
7372
+ this._shadow?.querySelector(`[data-message-id="${pe(d.id)}"]`)?.remove();
7373
+ const re = this._messages.indexOf(d);
7374
+ re >= 0 && this._messages.splice(re, 1);
7335
7375
  };
7336
- let T = !1;
7337
- const j = () => {
7376
+ let Z = !1;
7377
+ const te = () => {
7338
7378
  if (M) return;
7339
- this.emit("error", f);
7340
- const G = f.message;
7341
- G === this._lastErrorMessage ? this._consecutiveErrorCount++ : (this._consecutiveErrorCount = 1, this._lastErrorMessage = G);
7342
- const Q = f.message.trim(), ne = Q.length > 0 ? Q : this._i18n.errorMessage, x = {
7379
+ this.emit("error", b);
7380
+ const re = b.message;
7381
+ re === this._lastErrorMessage ? this._consecutiveErrorCount++ : (this._consecutiveErrorCount = 1, this._lastErrorMessage = re);
7382
+ const ie = b.message.trim(), ce = ie.length > 0 ? ie : this._i18n.errorMessage, x = {
7343
7383
  onRetry: () => {
7344
7384
  this._lastSentAction && this._sendAction(this._lastSentAction.action, this._lastSentAction.options);
7345
7385
  },
@@ -7348,43 +7388,43 @@ var Ro = class Me extends Ka {
7348
7388
  }
7349
7389
  };
7350
7390
  if (this._consecutiveErrorCount >= 2) {
7351
- R(), T = !0, this._drawer?.showErrorWithRecovery(this._i18n.accountInactiveMessage, x);
7391
+ D(), Z = !0, this._drawer?.showErrorWithRecovery(this._i18n.accountInactiveMessage, x);
7352
7392
  return;
7353
7393
  }
7354
- if (Co(f, ne)) {
7355
- R(), T = !0, this._drawer?.showErrorWithRecovery(ne, x);
7394
+ if (Co(b, ce)) {
7395
+ D(), Z = !0, this._drawer?.showErrorWithRecovery(ce, x);
7356
7396
  return;
7357
7397
  }
7358
- d.content = ne, d.status = "done";
7359
- const $ = he(ne.replace(/\r\n/g, `
7398
+ d.content = ce, d.status = "done";
7399
+ const C = fe(ce.replace(/\r\n/g, `
7360
7400
  `).split(`
7361
7401
  `).join("<br />"));
7362
- this._ensureAssistantMessageRendered(d), this._drawer?.updateBotMessage(d.id, $), this._drawer?.showRecoveryPillsOnly(x);
7402
+ this._ensureAssistantMessageRendered(d), this._drawer?.updateBotMessage(d.id, C), this._drawer?.showRecoveryPillsOnly(x);
7363
7403
  };
7364
- if (s && !L) if (c || this._hasUnavailableProductContext()) {
7404
+ if (s && !T) if (c || this._hasUnavailableProductContext()) {
7365
7405
  this._drawer?.setPills([]);
7366
- const G = this._i18n.productNotFoundMessage;
7367
- d.content = G, d.status = "done", this._ensureAssistantMessageRendered(d), this._drawer?.updateBotMessage(d.id, G), this._markUnavailableProductContext();
7406
+ const re = this._i18n.productNotFoundMessage;
7407
+ d.content = re, d.status = "done", this._ensureAssistantMessageRendered(d), this._drawer?.updateBotMessage(d.id, re), this._markUnavailableProductContext();
7368
7408
  } else d.status = "done";
7369
- else if (U)
7370
- this._drawer?.setPills([]), d.silent || j();
7371
- else if (j(), M) return;
7372
- s && (this._contextPrimingInFlight = !1, this._flushQueuedUserMessages()), !T && d.status === "streaming" && (d.status = "error");
7409
+ else if (j)
7410
+ this._drawer?.setPills([]), d.silent || te();
7411
+ else if (te(), M) return;
7412
+ s && (this._contextPrimingInFlight = !1, this._flushQueuedUserMessages()), !Z && d.status === "streaming" && (d.status = "error");
7373
7413
  },
7374
7414
  onDone: () => {
7375
- if (V && this._abortControllers.delete(V), !o && i !== this._activeRequestThreadId) return;
7376
- if (X = !0, B && this._panel && this._drawer) {
7415
+ if ($ && this._abortControllers.delete($), !o && i !== this._activeRequestThreadId) return;
7416
+ if (J = !0, N && this._panel && this._drawer) {
7377
7417
  const M = this._buildRenderContext();
7378
7418
  M.isStreaming = !1;
7379
- const R = B.elements[B.root], T = this._panel.toPanelSpec(B);
7419
+ const D = N.elements[N.root], Z = this._panel.toPanelSpec(N);
7380
7420
  this._applyPanelListHeadingToContext(M, {
7381
7421
  kind: "spec",
7382
- spec: T
7422
+ spec: Z
7383
7423
  });
7384
- const j = R?.type ?? "ProductGrid";
7385
- te(T, M, j), Y(j, R, "replace", !1), S = !0;
7424
+ const te = D?.type ?? "ProductGrid";
7425
+ ee(Z, M, te), X(te, D, "replace", !1), S = !0;
7386
7426
  }
7387
- B = null, N && D(!1), k(), this._activeRequestThreadId = null, this._consecutiveErrorCount = 0, this._lastErrorMessage = "", r(!1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), qn(E, {
7427
+ N = null, B && U(!1), k(), this._activeRequestThreadId = null, this._consecutiveErrorCount = 0, this._lastErrorMessage = "", r(!1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), qn(P, {
7388
7428
  drawer: this._drawer,
7389
7429
  ensureRendered: () => {
7390
7430
  },
@@ -7393,8 +7433,8 @@ var Ro = class Me extends Ka {
7393
7433
  sendSkipMessage: () => this._sendMessage(this._i18n.beautyPhotoStepSkipMessage),
7394
7434
  streamDone: !0
7395
7435
  });
7396
- const f = S;
7397
- if (_ && !S && b(), _ = !1, c && !u && !f) {
7436
+ const b = S;
7437
+ if (_ && !S && f(), _ = !1, c && !u && !b) {
7398
7438
  const M = this._i18n.productNotFoundMessage;
7399
7439
  d.content = M, this._ensureAssistantMessageRendered(d), this._drawer?.updateBotMessage(d.id, M), this._markUnavailableProductContext();
7400
7440
  }
@@ -7404,22 +7444,22 @@ var Ro = class Me extends Ka {
7404
7444
  this._flushQueuedUserMessages(), !M && c && this._ensurePdpPrimeSuggestedUiIfNeeded(l);
7405
7445
  }
7406
7446
  d.status === "streaming" && (d.status = "done", xt()), this._presentation.finalizeAssistantGroup(i);
7407
- const C = this._shadow?.querySelector(".gengage-chat-comparison-toggle-btn--hidden");
7408
- C && (C.classList.remove("gengage-chat-comparison-toggle-btn--hidden"), C.classList.add("gengage-chat-comparison-toggle-btn--reveal")), this.emit("message", d);
7409
- const L = this._currentPanelSource, U = L ? this._clonePanelSourceForHistory(L) : null;
7410
- this._panel?.snapshotForMessage(d.id, U ? {
7411
- source: U,
7447
+ const E = this._shadow?.querySelector(".gengage-chat-comparison-toggle-btn--hidden");
7448
+ E && (E.classList.remove("gengage-chat-comparison-toggle-btn--hidden"), E.classList.add("gengage-chat-comparison-toggle-btn--reveal")), this.emit("message", d);
7449
+ const T = this._currentPanelSource, j = T ? this._clonePanelSourceForHistory(T) : null;
7450
+ this._panel?.snapshotForMessage(d.id, j ? {
7451
+ source: j,
7412
7452
  threadId: d.threadId,
7413
7453
  rebuild: () => {
7414
7454
  const M = this._buildRenderContext();
7415
- return this._renderPanelFromSource(U, M);
7455
+ return this._renderPanelFromSource(j, M);
7416
7456
  }
7417
7457
  } : void 0), this._maybeAddPanelRestoreMessage(d), this._persistConversationState();
7418
7458
  }
7419
- }, A), this._abortControllers.add(V), !a?.silent && !o) {
7420
- const f = V;
7459
+ }, A), this._abortControllers.add($), !a?.silent && !o) {
7460
+ const b = $;
7421
7461
  this._drawer?.showStopButton(() => {
7422
- f.abort(), this._abortControllers.delete(f), this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }), d.status === "streaming" && (d.status = "done");
7462
+ b.abort(), this._abortControllers.delete(b), this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }), d.status === "streaming" && (d.status = "done");
7423
7463
  });
7424
7464
  }
7425
7465
  }
@@ -7451,14 +7491,14 @@ var Ro = class Me extends Ka {
7451
7491
  if (!e) return null;
7452
7492
  const a = e.elements[e.root];
7453
7493
  if (!a || a.type !== "ProductDetailsPanel") return null;
7454
- const n = de(a.props);
7455
- return de(n?.product) ?? n ?? null;
7494
+ const n = he(a.props);
7495
+ return he(n?.product) ?? n ?? null;
7456
7496
  }
7457
7497
  _productGridRecordFromSpec(e, a) {
7458
7498
  if (!e) return null;
7459
7499
  const n = e.elements[e.root];
7460
7500
  if (!n || n.type !== "ProductGrid") return null;
7461
- const r = Object.values(e.elements).filter((o) => o.type === "ProductCard").map((o) => de(o.props?.product)).filter((o) => o !== null);
7501
+ const r = Object.values(e.elements).filter((o) => o.type === "ProductCard").map((o) => he(o.props?.product)).filter((o) => o !== null);
7462
7502
  if (r.length === 0) return null;
7463
7503
  const i = this._coerceSkuKey(a);
7464
7504
  if (i) {
@@ -7469,7 +7509,7 @@ var Ro = class Me extends Ka {
7469
7509
  }
7470
7510
  _productRecordMatchesSku(e, a) {
7471
7511
  if (this._coerceSkuKey(e.sku) === a || this._coerceSkuKey(e.group_id ?? e.groupId) === a) return !0;
7472
- const n = de(e.extras);
7512
+ const n = he(e.extras);
7473
7513
  return this._coerceSkuKey(n?.group_id ?? n?.groupId) === a;
7474
7514
  }
7475
7515
  _getCurrentPanelProductRecord() {
@@ -7625,7 +7665,7 @@ var Ro = class Me extends Ka {
7625
7665
  return;
7626
7666
  this._currentThreadId = e, this._extendedModeManager?.setHiddenByUser(!1), this._lastThreadId != null && e === this._lastThreadId ? (this._presentation.setFocusedThreadId(e), this._drawer?.setPresentationFocus(e)) : (this._presentation.releaseFocusedThread(), this._drawer?.setPresentationFocus(null)), this._drawer?.setFormerMessagesButtonVisible(!1);
7627
7667
  for (const s of this._messages) {
7628
- const c = this._shadow?.querySelector(`[data-message-id="${ge(s.id)}"]`);
7668
+ const c = this._shadow?.querySelector(`[data-message-id="${pe(s.id)}"]`);
7629
7669
  c && (s.threadId && s.threadId > e ? c.classList.add("gengage-chat-bubble--hidden") : c.classList.remove("gengage-chat-bubble--hidden"));
7630
7670
  }
7631
7671
  this._shadow?.querySelectorAll("[data-thread-id]").forEach((s) => {
@@ -7683,7 +7723,7 @@ var Ro = class Me extends Ka {
7683
7723
  }
7684
7724
  _formatHistoryTimestamp(e) {
7685
7725
  try {
7686
- return new Intl.DateTimeFormat(Ue(this.config.locale), {
7726
+ return new Intl.DateTimeFormat(Oe(this.config.locale), {
7687
7727
  month: "short",
7688
7728
  day: "numeric",
7689
7729
  hour: "2-digit",
@@ -7779,7 +7819,7 @@ var Ro = class Me extends Ka {
7779
7819
  async _restoreFromHistoryRecord(e) {
7780
7820
  if (this._drawer?.lockScrollForRestore(), e.messages.length > 0 && (this.config.pageContext?.pageType === "pdp" && this.config.pageContext?.sku && (this._pdpLaunched = !0), this.config.pageContext?.pageType === "plp" && this.config.pageContext?.skuList?.length && (this._plpLaunched = !0), this.config.pageContext?.pageType === "home" && (this._homepageLaunched = !0)), this._currentThreadId = e.currentThreadId, this._lastThreadId = e.lastThreadId, this._currentThreadId && this._lastThreadId && this._currentThreadId > this._lastThreadId && (this._currentThreadId = this._lastThreadId), this._chatCreatedAt = e.createdAt, this._lastBackendContext = e.lastBackendContext, e.panelThreads && (this._panel.threads = [...e.panelThreads]), e.panelSnapshotHtml) for (const [n, r] of Object.entries(e.panelSnapshotHtml)) {
7781
7821
  const i = document.createElement("div");
7782
- i.innerHTML = he(r), this._panel.snapshots.set(n, i);
7822
+ i.innerHTML = fe(r), this._panel.snapshots.set(n, i);
7783
7823
  }
7784
7824
  if (e.panelSnapshotTypes) for (const [n, r] of Object.entries(e.panelSnapshotTypes)) this._panel.snapshotTypes.set(n, r);
7785
7825
  e.panelAiSpecByThread && this._restorePanelAiSpecMap(e.panelAiSpecByThread);
@@ -7804,7 +7844,7 @@ var Ro = class Me extends Ka {
7804
7844
  }
7805
7845
  if (this._currentThreadId) {
7806
7846
  const n = this._currentThreadId;
7807
- for (const r of this._messages) r.threadId && r.threadId > n && this._shadow?.querySelector(`[data-message-id="${ge(r.id)}"]`)?.classList.add("gengage-chat-bubble--hidden");
7847
+ for (const r of this._messages) r.threadId && r.threadId > n && this._shadow?.querySelector(`[data-message-id="${pe(r.id)}"]`)?.classList.add("gengage-chat-bubble--hidden");
7808
7848
  this._shadow?.querySelectorAll("[data-thread-id]").forEach((r) => {
7809
7849
  r instanceof HTMLElement && r.dataset.threadId && r.dataset.threadId > n && r.classList.add("gengage-chat-bubble--hidden");
7810
7850
  });
@@ -7848,7 +7888,7 @@ var Ro = class Me extends Ka {
7848
7888
  return e !== void 0 && e.length > 0 && this._productContextUnavailableSku === e;
7849
7889
  }
7850
7890
  _ensureAssistantMessageRendered(e) {
7851
- if (!(this._shadow?.querySelector(`[data-message-id="${ge(e.id)}"]`) || !this._drawer)) {
7891
+ if (!(this._shadow?.querySelector(`[data-message-id="${pe(e.id)}"]`) || !this._drawer)) {
7852
7892
  if (e.role === "assistant" && e.threadId && !this._threadsWithFirstBot.has(e.threadId)) {
7853
7893
  this._threadsWithFirstBot.add(e.threadId), this._drawer.addMessage(e), this._drawer.markFirstBotMessage(e.id);
7854
7894
  return;
@@ -7874,7 +7914,7 @@ var Ro = class Me extends Ka {
7874
7914
  if (o && i.sku && i.sku !== o) return;
7875
7915
  if (this._pdpLaunched = !0, this._drawer?.lockScrollForRestore(), this._currentThreadId = i.currentThreadId, this._lastThreadId = i.lastThreadId, this._currentThreadId && this._lastThreadId && this._currentThreadId > this._lastThreadId && (this._currentThreadId = this._lastThreadId), this._chatCreatedAt = i.createdAt, i.panelThreads && (this._panel.threads = i.panelThreads), i.panelSnapshotHtml) for (const [c, l] of Object.entries(i.panelSnapshotHtml)) {
7876
7916
  const p = document.createElement("div");
7877
- p.innerHTML = he(l), this._panel.snapshots.set(c, p);
7917
+ p.innerHTML = fe(l), this._panel.snapshots.set(c, p);
7878
7918
  }
7879
7919
  if (i.panelSnapshotTypes) for (const [c, l] of Object.entries(i.panelSnapshotTypes)) this._panel.snapshotTypes.set(c, l);
7880
7920
  i.panelAiSpecByThread && this._restorePanelAiSpecMap(i.panelAiSpecByThread);
@@ -7906,7 +7946,7 @@ var Ro = class Me extends Ka {
7906
7946
  }
7907
7947
  if (this._currentThreadId) {
7908
7948
  const c = this._currentThreadId;
7909
- for (const l of this._messages) l.threadId && l.threadId > c && this._shadow?.querySelector(`[data-message-id="${ge(l.id)}"]`)?.classList.add("gengage-chat-bubble--hidden");
7949
+ for (const l of this._messages) l.threadId && l.threadId > c && this._shadow?.querySelector(`[data-message-id="${pe(l.id)}"]`)?.classList.add("gengage-chat-bubble--hidden");
7910
7950
  this._shadow?.querySelectorAll("[data-thread-id]").forEach((l) => {
7911
7951
  l instanceof HTMLElement && l.dataset.threadId && l.dataset.threadId > c && l.classList.add("gengage-chat-bubble--hidden");
7912
7952
  });
@@ -7977,10 +8017,10 @@ var Ro = class Me extends Ka {
7977
8017
  if (o.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper")) {
7978
8018
  const m = o.parentElement, v = this._comparisonSelectedSkus.includes(o.dataset.sku);
7979
8019
  m.classList.toggle("gengage-chat-comparison-select-wrapper--selected", v);
7980
- const b = m.querySelector(".gengage-chat-comparison-checkbox");
7981
- if (b) {
7982
- b.dataset.selected = v ? "true" : "false", b.setAttribute("aria-pressed", v ? "true" : "false");
7983
- const u = b.querySelector(".gengage-chat-comparison-checkbox-icon"), d = b.querySelector(".gengage-chat-comparison-checkbox-label");
8020
+ const f = m.querySelector(".gengage-chat-comparison-checkbox");
8021
+ if (f) {
8022
+ f.dataset.selected = v ? "true" : "false", f.setAttribute("aria-pressed", v ? "true" : "false");
8023
+ const u = f.querySelector(".gengage-chat-comparison-checkbox-icon"), d = f.querySelector(".gengage-chat-comparison-checkbox-label");
7984
8024
  u && (u.innerHTML = v ? '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>' : '<span class="gengage-chat-comparison-checkbox-dot"></span>'), d && (d.textContent = v ? this._i18n.comparisonSelectedLabel ?? "Selected" : this._i18n.comparisonSelectLabel ?? "Select to compare");
7985
8025
  }
7986
8026
  continue;
@@ -8041,10 +8081,10 @@ var Ro = class Me extends Ka {
8041
8081
  return a ? (this._runChatAddToCartFlow(a), !0) : !1;
8042
8082
  }
8043
8083
  _resolveCurrentProductAddToCartParams() {
8044
- const e = de(this.config.pageContext?.extra), a = this._activeSkuForProductSummaryClick() ?? this._coerceSkuKey(this._bridgeContext?.sku), n = this.config.pageContext?.pageType === "pdp", r = this._getCurrentPanelProductRecord(), i = n ? this._getCurrentPanelProductGridRecord(a) : null, o = n ? this._getInlinePdpProductRecord() : null;
8084
+ const e = he(this.config.pageContext?.extra), a = this._activeSkuForProductSummaryClick() ?? this._coerceSkuKey(this._bridgeContext?.sku), n = this.config.pageContext?.pageType === "pdp", r = this._getCurrentPanelProductRecord(), i = n ? this._getCurrentPanelProductGridRecord(a) : null, o = n ? this._getInlinePdpProductRecord() : null;
8045
8085
  if (!r && !i && this._currentPanelSource && !o) return null;
8046
8086
  const s = [r, i];
8047
- n && s.push(o), this._currentPanelSource || (s.push(this._getLatestProductDetailsRecord()), n && s.push(this._getLatestProductGridRecord(a))), n && s.push(de(this._bridgeContext?.product), de(this._bridgeContext?.productDetails), this._bridgeContext, de(e?.product), de(e?.productDetails), e);
8087
+ n && s.push(o), this._currentPanelSource || (s.push(this._getLatestProductDetailsRecord()), n && s.push(this._getLatestProductGridRecord(a))), n && s.push(he(this._bridgeContext?.product), he(this._bridgeContext?.productDetails), this._bridgeContext, he(e?.product), he(e?.productDetails), e);
8048
8088
  for (const c of s) {
8049
8089
  const l = this._extractAddToCartParamsFromRecord(c, a);
8050
8090
  if (l) return l;
@@ -8103,7 +8143,7 @@ var Ro = class Me extends Ka {
8103
8143
  }
8104
8144
  _buildRenderContext() {
8105
8145
  const e = {
8106
- locale: Ue(this.config.locale),
8146
+ locale: Oe(this.config.locale),
8107
8147
  onAction: (a) => {
8108
8148
  if (a.type === "frontend_restore_panel_message") {
8109
8149
  this._restorePanelFromFrontendMessage(a.payload);
@@ -8128,7 +8168,7 @@ var Ro = class Me extends Ka {
8128
8168
  if (a.type === "getComparisonTable") {
8129
8169
  const r = a.payload, i = r && typeof r == "object" ? r : null, o = i && typeof i.gengage_analytics_source == "string" ? i.gengage_analytics_source : "";
8130
8170
  let s = [];
8131
- i && Array.isArray(i.sku_list) && (s = i.sku_list.filter((c) => typeof c == "string")), o === "floating_compare_dock" ? qa(s) : Ua(s.length > 0 ? s : this._comparisonSelectedSkus);
8171
+ i && Array.isArray(i.sku_list) && (s = i.sku_list.filter((c) => typeof c == "string")), o === "floating_compare_dock" ? qa(s) : Oa(s.length > 0 ? s : this._comparisonSelectedSkus);
8132
8172
  }
8133
8173
  const n = a.type === "addToCart" || a.type === "like";
8134
8174
  this._sendAction(a, n ? { preservePanel: !0 } : void 0);
@@ -8149,7 +8189,7 @@ var Ro = class Me extends Ka {
8149
8189
  return;
8150
8190
  }
8151
8191
  const i = a.url.trim();
8152
- if (!n && this.config.onProductNavigate !== void 0 && i.length > 0 && be(i)) {
8192
+ if (!n && this.config.onProductNavigate !== void 0 && i.length > 0 && ve(i)) {
8153
8193
  et(a.sku), this.config.onProductNavigate(i, a.sku, this.config.session?.sessionId ?? null);
8154
8194
  return;
8155
8195
  }
@@ -8232,7 +8272,7 @@ var Ro = class Me extends Ka {
8232
8272
  await this._session.toggleFavorite(n, r, e, a), this._drawer?.updateFavoritesBadge(this._session.favoritedSkus.size);
8233
8273
  }
8234
8274
  _revertFavoriteHeartUi(e) {
8235
- const a = this._shadow?.querySelectorAll(`[data-gengage-favorite-sku="${ge(e)}"]`);
8275
+ const a = this._shadow?.querySelectorAll(`[data-gengage-favorite-sku="${pe(e)}"]`);
8236
8276
  if (a?.length)
8237
8277
  for (const n of a) {
8238
8278
  if (!(n instanceof HTMLButtonElement)) continue;
@@ -8479,7 +8519,7 @@ var Ro = class Me extends Ka {
8479
8519
  _renderUISpec(e, a) {
8480
8520
  const n = e.elements[e.root];
8481
8521
  if (n?.type === "ProductSummaryCard") {
8482
- const c = de(n.props), l = de(c?.product) ?? c;
8522
+ const c = he(n.props), l = he(c?.product) ?? c;
8483
8523
  l && (this._currentInlineProductSummaryRecord = l);
8484
8524
  }
8485
8525
  const r = this._resolveUISpecRegistry(), i = this.config.renderer?.unknownRenderer ?? ga, o = (c, l) => Hr(c, l, r, i), s = this.config.renderer?.renderUISpec;