@gengage/assistant-fe 0.6.17 → 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.
- package/dist/{request-text-DThlE-Xd.js → account-config-gj7_mF6Q.js} +725 -312
- package/dist/agentic/events/comparison.d.ts +6 -0
- package/dist/agentic/events/context-products.d.ts +6 -0
- package/dist/agentic/index.d.ts +8 -0
- package/dist/agentic/index.js +251 -168
- package/dist/agentic/recipes/catalog-assistant-flow.d.ts +50 -0
- package/dist/agentic/recipes/input-text/actions.d.ts +15 -0
- package/dist/agentic/recipes/input-text/index.d.ts +4 -0
- package/dist/agentic/recipes/input-text/products.d.ts +4 -0
- package/dist/agentic/recipes/input-text/ranking.d.ts +14 -0
- package/dist/agentic/recipes/input-text/steps.d.ts +31 -0
- package/dist/agentic/util/account-config.d.ts +8 -0
- package/dist/agentic/util/privacy.d.ts +12 -0
- package/dist/agentic/widgets/endpoints.d.ts +12 -0
- package/dist/agentic/worker.d.ts +8 -0
- package/dist/agentic/worker.js +415 -106
- package/dist/agentic.iife.js +7 -5
- package/dist/{api-paths-xsHH9jtm.js → api-paths-CEDR4rld.js} +1 -1
- package/dist/chat-runtime.js +1 -1
- package/dist/{chat-BP-yXukW.js → chat-rvSffJXw.js} +1 -1
- package/dist/chat.iife.js +11 -11
- package/dist/chat.js +2 -2
- package/dist/{common-O0BUdXOn.js → common-BBgWfT-W.js} +3 -3
- package/dist/common.js +8 -8
- package/dist/{connection-warning-DWMfjv0Y.js → connection-warning-B-doodzu.js} +1 -1
- package/dist/{fastIntent-RTSVRJhw.js → fastIntent-CloHPZQh.js} +2 -2
- package/dist/index.js +13 -13
- package/dist/{native-webview-U9HtGabb.js → native-webview-NWc9LrJh.js} +1 -1
- package/dist/native.iife.js +2 -2
- package/dist/native.js +1 -1
- package/dist/{overlay-ClYgI2Kl.js → overlay-COzFFq0-.js} +1 -1
- package/dist/overlay.js +2 -2
- package/dist/{qna-B3lMzHvS.js → qna-DUs97irI.js} +1 -1
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +1 -1
- package/dist/qna.js +2 -2
- package/dist/{runtime-n7fEJGDt.js → runtime-BGCNkU1H.js} +6 -6
- package/dist/{runtime-BKU-NQXf.js → runtime-CbWCU424.js} +116 -116
- package/dist/{runtime-COh3CwNU.js → runtime-Ctqq0V6G.js} +8 -8
- package/dist/{simbut-DaFCfvp7.js → simbut-Dh4cJysK.js} +3 -3
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/{simrel-CX1JBDa5.js → simrel-B-sjHbL5.js} +4 -4
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +2 -2
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-DoZrhVze.js → widget-base-CIJT5AiP.js} +2 -2
- package/package.json +1 -1
- /package/dist/{context-BBuSsXZ9.js → context-heG8hv5l.js} +0 -0
- /package/dist/{locale-CfqNifrU.js → locale-uQ5XZ2yS.js} +0 -0
- /package/dist/{price-formatter-CFsWT0lP.js → price-formatter-CHUmYq8I.js} +0 -0
- /package/dist/{request-response-cache-zsgz3Awp.js → request-response-cache-BxRsKGJ0.js} +0 -0
- /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-
|
|
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
|
|
3
|
-
import { i as ze, s as Xt, t as Ka } from "./widget-base-
|
|
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-
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as tn } from "./request-response-cache-
|
|
7
|
-
import { a as Qt, i as Jt, n as be, r as ea, t as ae } from "./price-formatter-
|
|
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;
|
|
@@ -967,31 +967,31 @@ var Bn = class {
|
|
|
967
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
|
|
970
|
+
const U = (x) => {
|
|
971
971
|
L(), this._touchStartY = x.touches[0]?.clientY ?? null;
|
|
972
972
|
}, q = (x) => {
|
|
973
973
|
L();
|
|
974
974
|
const C = x.touches[0]?.clientY, z = this._touchStartY;
|
|
975
975
|
typeof C == "number" && typeof z == "number" && C - z > 10 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
|
|
976
976
|
};
|
|
977
|
-
this.messagesEl.addEventListener("touchstart",
|
|
978
|
-
this.messagesEl.removeEventListener("touchstart",
|
|
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);
|
|
982
|
-
const
|
|
983
|
-
|
|
982
|
+
const O = document.createElement("button");
|
|
983
|
+
O.className = "gengage-chat-pills-arrow gds-btn gds-btn-ghost", O.dataset.gengagePart = "chat-suggestion-pills-more", O.type = "button", O.setAttribute("aria-label", this.i18n.moreSuggestionsAriaLabel), O.textContent = "›", O.addEventListener("click", () => {
|
|
984
984
|
K.scrollBy({
|
|
985
985
|
left: 150,
|
|
986
986
|
behavior: "smooth"
|
|
987
987
|
});
|
|
988
|
-
}), this._pillsEl.appendChild(
|
|
988
|
+
}), this._pillsEl.appendChild(O);
|
|
989
989
|
let ee = !1;
|
|
990
990
|
const X = () => {
|
|
991
991
|
ee || (ee = !0, requestAnimationFrame(() => {
|
|
992
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
997
|
K.addEventListener("scroll", X, { passive: !0 }), this._cleanups.push(() => {
|
|
@@ -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
|
|
1848
|
+
var Un = class {
|
|
1849
1849
|
constructor() {
|
|
1850
1850
|
this._mode = "shopping", this._uiHints = null;
|
|
1851
1851
|
}
|
|
@@ -1907,7 +1907,7 @@ var On = class {
|
|
|
1907
1907
|
return this._mode !== "shopping";
|
|
1908
1908
|
}
|
|
1909
1909
|
};
|
|
1910
|
-
function
|
|
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(
|
|
1980
|
+
return t.toLocaleUpperCase(Oe(e));
|
|
1981
1981
|
} catch {
|
|
1982
1982
|
return t.toLocaleUpperCase("tr");
|
|
1983
1983
|
}
|
|
@@ -3208,17 +3208,17 @@ function dt(t, e) {
|
|
|
3208
3208
|
if (g && ve(g)) {
|
|
3209
3209
|
const k = document.createElement("div");
|
|
3210
3210
|
k.className = "gengage-chat-product-card-img-wrapper";
|
|
3211
|
-
const
|
|
3212
|
-
|
|
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 && (
|
|
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
3217
|
const b = document.createElement("span");
|
|
3218
3218
|
b.className = "gengage-chat-product-card-discount-badge", b.textContent = `%${ea(K)}`, k.appendChild(b);
|
|
3219
3219
|
}
|
|
3220
|
-
const
|
|
3221
|
-
|
|
3220
|
+
const O = document.createElement("div");
|
|
3221
|
+
O.className = "gengage-chat-product-card-img-actions";
|
|
3222
3222
|
const ee = n.sku;
|
|
3223
3223
|
if (ee && e.onFavoriteToggle) {
|
|
3224
3224
|
const b = document.createElement("button");
|
|
@@ -3228,7 +3228,7 @@ function dt(t, e) {
|
|
|
3228
3228
|
T.stopPropagation(), b.classList.toggle("gengage-chat-favorite-btn--active");
|
|
3229
3229
|
const j = b.querySelector("svg");
|
|
3230
3230
|
j && j.setAttribute("fill", b.classList.contains("gengage-chat-favorite-btn--active") ? "currentColor" : "none"), e.onFavoriteToggle(ee, n);
|
|
3231
|
-
}),
|
|
3231
|
+
}), O.appendChild(b);
|
|
3232
3232
|
}
|
|
3233
3233
|
const X = n.sku, $ = e.i18n?.findSimilarLabel ?? "Find Similar";
|
|
3234
3234
|
if (X) {
|
|
@@ -3241,9 +3241,9 @@ function dt(t, e) {
|
|
|
3241
3241
|
type: "findSimilar",
|
|
3242
3242
|
payload: { sku: X }
|
|
3243
3243
|
});
|
|
3244
|
-
}),
|
|
3244
|
+
}), O.appendChild(b);
|
|
3245
3245
|
}
|
|
3246
|
-
|
|
3246
|
+
O.childElementCount > 0 && k.appendChild(O), a.appendChild(k);
|
|
3247
3247
|
}
|
|
3248
3248
|
const h = document.createElement("div");
|
|
3249
3249
|
h.className = "gengage-chat-product-card-body";
|
|
@@ -3269,12 +3269,12 @@ function dt(t, e) {
|
|
|
3269
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
|
|
3272
|
+
const U = Jt(v), q = [`${U.toFixed(1)}`, "out of 5 stars"];
|
|
3273
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
|
-
const
|
|
3277
|
-
|
|
3276
|
+
const O = document.createElement("span");
|
|
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
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");
|
|
@@ -3290,8 +3290,8 @@ function dt(t, e) {
|
|
|
3290
3290
|
if (B) {
|
|
3291
3291
|
const k = document.createElement("div");
|
|
3292
3292
|
k.className = "gengage-chat-product-card-buy-footer";
|
|
3293
|
-
const
|
|
3294
|
-
|
|
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
3296
|
title: e.i18n?.addToCartButton ?? N,
|
|
3297
3297
|
type: "addToCart",
|
|
@@ -3301,24 +3301,24 @@ function dt(t, e) {
|
|
|
3301
3301
|
quantity: 1
|
|
3302
3302
|
}
|
|
3303
3303
|
});
|
|
3304
|
-
}), k.appendChild(
|
|
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" ? N : i.title || N, k.addEventListener("click", (
|
|
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
|
-
|
|
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", ge(k, "href", l), ge(k, "target", "_blank"), ge(k, "rel", "noopener noreferrer"), k.textContent = N, k.addEventListener("click", (
|
|
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
|
-
|
|
3318
|
+
U.preventDefault(), U.stopPropagation();
|
|
3319
3319
|
return;
|
|
3320
3320
|
}
|
|
3321
|
-
e.onProductClick && c && (
|
|
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
|
|
3332
|
-
|
|
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
|
-
const
|
|
3336
|
-
|
|
3335
|
+
const O = document.createElement("button");
|
|
3336
|
+
O.type = "button", O.className = "gengage-chat-comparison-checkbox", O.dataset.selected = U ? "true" : "false", O.setAttribute("aria-pressed", U ? "true" : "false");
|
|
3337
3337
|
const ee = document.createElement("span");
|
|
3338
|
-
ee.className = "gengage-chat-comparison-checkbox-icon", ee.innerHTML =
|
|
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
3339
|
const X = document.createElement("span");
|
|
3340
|
-
X.className = "gengage-chat-comparison-checkbox-label", X.textContent =
|
|
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
3341
|
b.stopPropagation(), e.onToggleComparisonSku?.(c);
|
|
3342
3342
|
});
|
|
3343
3343
|
const $ = document.createElement("div");
|
|
3344
3344
|
return $.className = "gengage-chat-comparison-card-hint", $.setAttribute("aria-hidden", "true"), $.textContent = K, k.addEventListener("click", (b) => {
|
|
3345
3345
|
b.target.closest(".gengage-chat-comparison-checkbox") || (b.stopPropagation(), e.onToggleComparisonSku?.(c));
|
|
3346
|
-
}), k.appendChild(
|
|
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
|
-
]),
|
|
3356
|
+
]), Ur = /* @__PURE__ */ new Set([
|
|
3357
3357
|
"size",
|
|
3358
3358
|
"beden",
|
|
3359
3359
|
"boyut"
|
|
3360
|
-
]),
|
|
3360
|
+
]), Or = /* @__PURE__ */ new Set([
|
|
3361
3361
|
"finish",
|
|
3362
3362
|
"bitiş",
|
|
3363
3363
|
"bitişi"
|
|
@@ -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) ||
|
|
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();
|
|
@@ -3556,20 +3556,20 @@ function oi(t, e) {
|
|
|
3556
3556
|
const B = document.createElement("div");
|
|
3557
3557
|
B.className = "gengage-chat-product-gallery-thumbs";
|
|
3558
3558
|
const N = 6;
|
|
3559
|
-
let k = null,
|
|
3560
|
-
const q = e.i18n, K = q?.galleryPrevAriaLabel ?? "Previous image",
|
|
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
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
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",
|
|
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
3564
|
const b = () => {
|
|
3565
|
-
X.disabled =
|
|
3565
|
+
X.disabled = U <= 0, $.disabled = U >= d.length - 1;
|
|
3566
3566
|
}, E = (M) => {
|
|
3567
|
-
if (M < 0 || M >= d.length || M ===
|
|
3567
|
+
if (M < 0 || M >= d.length || M === U) return;
|
|
3568
3568
|
const D = d[M];
|
|
3569
3569
|
if (!D) return;
|
|
3570
3570
|
ge(P, "src", D);
|
|
3571
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,
|
|
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
3575
|
const D = d[M];
|
|
@@ -3584,9 +3584,9 @@ function oi(t, e) {
|
|
|
3584
3584
|
M.className = "gengage-chat-product-gallery-thumb-more", M.textContent = `+${d.length - N}`, B.appendChild(M);
|
|
3585
3585
|
}
|
|
3586
3586
|
X.addEventListener("click", (M) => {
|
|
3587
|
-
M.stopPropagation(), E(
|
|
3587
|
+
M.stopPropagation(), E(U - 1);
|
|
3588
3588
|
}), $.addEventListener("click", (M) => {
|
|
3589
|
-
M.stopPropagation(), E(
|
|
3589
|
+
M.stopPropagation(), E(U + 1);
|
|
3590
3590
|
}), b();
|
|
3591
3591
|
let T = 0;
|
|
3592
3592
|
const j = 50;
|
|
@@ -3594,7 +3594,7 @@ function oi(t, e) {
|
|
|
3594
3594
|
T = M.changedTouches[0].clientX;
|
|
3595
3595
|
}, { passive: !0 }), P.addEventListener("touchend", (M) => {
|
|
3596
3596
|
const D = M.changedTouches[0].clientX, Z = T - D;
|
|
3597
|
-
Math.abs(Z) < j || E(Z > 0 ? Math.min(
|
|
3597
|
+
Math.abs(Z) < j || E(Z > 0 ? Math.min(U + 1, d.length - 1) : Math.max(U - 1, 0));
|
|
3598
3598
|
}), L.appendChild(X), L.appendChild($), L.appendChild(B), a.appendChild(L);
|
|
3599
3599
|
} else if (d.length === 1) {
|
|
3600
3600
|
const L = document.createElement("div");
|
|
@@ -3689,14 +3689,14 @@ function oi(t, e) {
|
|
|
3689
3689
|
const B = document.createElement("div");
|
|
3690
3690
|
B.className = "gengage-chat-product-variants-list";
|
|
3691
3691
|
for (const N of H) {
|
|
3692
|
-
const k = ha(N),
|
|
3693
|
-
if (!k && !
|
|
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 ??
|
|
3696
|
+
const K = k ?? U ?? "";
|
|
3697
3697
|
q.title = K;
|
|
3698
|
-
const
|
|
3699
|
-
|
|
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
3700
|
const ee = Jr(N), X = Qr(N);
|
|
3701
3701
|
if (ee && ve(ee)) {
|
|
3702
3702
|
const E = document.createElement("img");
|
|
@@ -3712,13 +3712,13 @@ function oi(t, e) {
|
|
|
3712
3712
|
const E = document.createElement("span");
|
|
3713
3713
|
E.className = "gengage-chat-product-variant-price", E.textContent = ae(String(b), e.pricing), q.appendChild(E);
|
|
3714
3714
|
}
|
|
3715
|
-
if (
|
|
3715
|
+
if (U && U !== o) {
|
|
3716
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
3719
|
title: j,
|
|
3720
3720
|
type: "launchVariant",
|
|
3721
|
-
payload: { sku:
|
|
3721
|
+
payload: { sku: U }
|
|
3722
3722
|
});
|
|
3723
3723
|
});
|
|
3724
3724
|
}
|
|
@@ -3761,18 +3761,18 @@ function oi(t, e) {
|
|
|
3761
3761
|
const F = S;
|
|
3762
3762
|
if (F && ve(F)) {
|
|
3763
3763
|
let k = function(q, K) {
|
|
3764
|
-
const
|
|
3765
|
-
|
|
3766
|
-
},
|
|
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
3767
|
const X = document.createElementNS(B, "line");
|
|
3768
|
-
X.setAttribute("x1", q), X.setAttribute("y1", K), X.setAttribute("x2",
|
|
3768
|
+
X.setAttribute("x1", q), X.setAttribute("y1", K), X.setAttribute("x2", O), X.setAttribute("y2", ee), N.appendChild(X);
|
|
3769
3769
|
};
|
|
3770
3770
|
const L = document.createElement("button");
|
|
3771
3771
|
L.className = "gengage-chat-product-details-share gds-btn gds-btn-ghost gds-icon-btn", L.type = "button";
|
|
3772
3772
|
const P = e.i18n?.shareButton ?? "Share";
|
|
3773
3773
|
L.title = P, L.setAttribute("aria-label", P);
|
|
3774
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"),
|
|
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 ?? "",
|
|
@@ -3990,14 +3990,14 @@ function ui(t, e, a, n) {
|
|
|
3990
3990
|
B.setAttribute("aria-selected", N ? "true" : "false"), N && B.classList.add("gengage-chat-product-sort-option--active", "gds-menu-option-active");
|
|
3991
3991
|
const k = P.sortState.type === "related" ? "related" : `price-${P.sortState.direction ?? ""}`;
|
|
3992
3992
|
B.dataset.sortKey = k;
|
|
3993
|
-
const
|
|
3994
|
-
|
|
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
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"), N || K.classList.add("gengage-chat-product-sort-option-check--hidden"), B.appendChild(
|
|
3999
|
-
m = P.sortState, n.onSortChange?.(P.sortState), hi(c, s, e, P.sortState), I.querySelectorAll(".gengage-chat-product-sort-option").forEach((
|
|
4000
|
-
const ee =
|
|
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
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
4002
|
}), w(P.sortState), F();
|
|
4003
4003
|
}), I.appendChild(B);
|
|
@@ -4699,7 +4699,7 @@ function Ti(t, e, a) {
|
|
|
4699
4699
|
H.className = "gengage-fl", H.dataset.gengagePart = "floating-launcher", H.innerHTML = Li();
|
|
4700
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
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,
|
|
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
4704
|
const R = I.value.trim().length > 0;
|
|
4705
4705
|
if (J.classList.toggle("is-recording", k), k) {
|
|
@@ -4718,7 +4718,7 @@ function Ti(t, e, a) {
|
|
|
4718
4718
|
X !== null && (clearTimeout(X), X = null);
|
|
4719
4719
|
}
|
|
4720
4720
|
function re() {
|
|
4721
|
-
k && (k = !1, ce(),
|
|
4721
|
+
k && (k = !1, ce(), U = !1, z(), u && ne(), q = "", I.style.display = "", _.style.display = "none", S.textContent = "", F.textContent = "");
|
|
4722
4722
|
const R = I.value.trim();
|
|
4723
4723
|
R && (e.onSend(R), K || (K = !0)), I.value = "", q = "", M();
|
|
4724
4724
|
}
|
|
@@ -4728,7 +4728,7 @@ function Ti(t, e, a) {
|
|
|
4728
4728
|
console.warn("[FloatingLauncher] SpeechRecognition not supported.");
|
|
4729
4729
|
return;
|
|
4730
4730
|
}
|
|
4731
|
-
|
|
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
4733
|
let Q = "", de = "";
|
|
4734
4734
|
for (let Pe = G.resultIndex; Pe < G.results.length; Pe++) {
|
|
@@ -4738,21 +4738,21 @@ function Ti(t, e, a) {
|
|
|
4738
4738
|
Ae.isFinal ? de += Fe : Q += Fe;
|
|
4739
4739
|
}
|
|
4740
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();
|
|
4744
4744
|
} catch {
|
|
4745
4745
|
x();
|
|
4746
4746
|
}
|
|
4747
4747
|
}
|
|
4748
4748
|
function ce() {
|
|
4749
4749
|
try {
|
|
4750
|
-
|
|
4750
|
+
O?.stop();
|
|
4751
4751
|
} catch {
|
|
4752
4752
|
}
|
|
4753
4753
|
}
|
|
4754
4754
|
function x() {
|
|
4755
|
-
|
|
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
4757
|
async function C() {
|
|
4758
4758
|
const R = ++j, V = Array.from(B.querySelectorAll("span"));
|
|
@@ -4803,7 +4803,7 @@ function Ti(t, e, a) {
|
|
|
4803
4803
|
W.addEventListener("click", re), J.addEventListener("click", (R) => {
|
|
4804
4804
|
R.preventDefault(), R.stopPropagation(), k ? ce() : ie();
|
|
4805
4805
|
}), P.addEventListener("click", () => {
|
|
4806
|
-
k && (k = !1, ce(),
|
|
4806
|
+
k && (k = !1, ce(), U = !1, z(), u && ne(), q = "", I.style.display = "", _.style.display = "none", S.textContent = "", F.textContent = "", M());
|
|
4807
4807
|
}), L.addEventListener("click", (R) => {
|
|
4808
4808
|
R.preventDefault(), R.stopPropagation(), e.onOpenChat();
|
|
4809
4809
|
}), I.addEventListener("input", M), I.addEventListener("keydown", (R) => {
|
|
@@ -4813,7 +4813,7 @@ function Ti(t, e, a) {
|
|
|
4813
4813
|
K = !0, M();
|
|
4814
4814
|
}
|
|
4815
4815
|
function le() {
|
|
4816
|
-
te(), z(), ne(), k && (k = !1, ce()),
|
|
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
4819
|
container: H,
|
|
@@ -4821,7 +4821,7 @@ function Ti(t, e, a) {
|
|
|
4821
4821
|
destroy: le
|
|
4822
4822
|
};
|
|
4823
4823
|
}
|
|
4824
|
-
var Ai = "gengage-inline-launcher-style",
|
|
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",
|
|
@@ -5025,7 +5025,7 @@ function Ri(t, e, a) {
|
|
|
5025
5025
|
rowPlacement: s,
|
|
5026
5026
|
siblingPlacement: o
|
|
5027
5027
|
};
|
|
5028
|
-
},
|
|
5028
|
+
}, U = (C) => [
|
|
5029
5029
|
C.hostSelector,
|
|
5030
5030
|
C.siblingSelector ?? "",
|
|
5031
5031
|
C.siblingRestoreParentSelector
|
|
@@ -5044,15 +5044,15 @@ function Ri(t, e, a) {
|
|
|
5044
5044
|
}), document.head.appendChild(C);
|
|
5045
5045
|
}, K = (C) => {
|
|
5046
5046
|
if (!A || !a.shadowRoot) return;
|
|
5047
|
-
const z = a.shadowRoot.getElementById(
|
|
5047
|
+
const z = a.shadowRoot.getElementById(Ut);
|
|
5048
5048
|
if (!C) {
|
|
5049
5049
|
z?.remove();
|
|
5050
5050
|
return;
|
|
5051
5051
|
}
|
|
5052
5052
|
if (z) return;
|
|
5053
5053
|
const Y = document.createElement("style");
|
|
5054
|
-
Y.id =
|
|
5055
|
-
},
|
|
5054
|
+
Y.id = Ut, Y.textContent = ".gengage-chat-launcher-container,.gengage-fl{display:none!important;}", a.shadowRoot.appendChild(Y);
|
|
5055
|
+
}, O = (C) => {
|
|
5056
5056
|
const z = document.querySelector(C);
|
|
5057
5057
|
return z instanceof HTMLElement ? z : null;
|
|
5058
5058
|
}, ee = (C) => {
|
|
@@ -5112,7 +5112,7 @@ function Ri(t, e, a) {
|
|
|
5112
5112
|
}, te = () => {
|
|
5113
5113
|
if (N) {
|
|
5114
5114
|
b(N);
|
|
5115
|
-
const C =
|
|
5115
|
+
const C = O(N.hostSelector);
|
|
5116
5116
|
C && E(C), N = null;
|
|
5117
5117
|
}
|
|
5118
5118
|
K(!1), J = !1;
|
|
@@ -5122,13 +5122,13 @@ function Ri(t, e, a) {
|
|
|
5122
5122
|
return te(), !1;
|
|
5123
5123
|
q();
|
|
5124
5124
|
const Y = k();
|
|
5125
|
-
N &&
|
|
5125
|
+
N && U(N) !== U(Y) && te();
|
|
5126
5126
|
for (let ne = 0; ne < y; ne += 1) {
|
|
5127
5127
|
if (!re(z))
|
|
5128
5128
|
return te(), !1;
|
|
5129
|
-
const oe = k(), le =
|
|
5129
|
+
const oe = k(), le = O(oe.hostSelector), R = ee(oe.siblingSelector);
|
|
5130
5130
|
if (le && (!oe.siblingSelector || R)) {
|
|
5131
|
-
N &&
|
|
5131
|
+
N && U(N) !== U(oe) && te(), R && $(R);
|
|
5132
5132
|
let V = le.querySelector(`.${r}`);
|
|
5133
5133
|
V instanceof HTMLElement || (V = document.createElement("div"), V.className = r, oe.rowPlacement === "start" ? le.insertBefore(V, le.firstChild) : le.appendChild(V));
|
|
5134
5134
|
let G = V.querySelector(`#${CSS.escape(H)}`);
|
|
@@ -5204,13 +5204,13 @@ var Di = /* @__PURE__ */ new Set([
|
|
|
5204
5204
|
"DT",
|
|
5205
5205
|
"DD"
|
|
5206
5206
|
]);
|
|
5207
|
-
function
|
|
5207
|
+
function Ui(t) {
|
|
5208
5208
|
const e = [];
|
|
5209
5209
|
let a = [];
|
|
5210
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);
|
|
5211
5211
|
return a.length > 0 && e.push(a), e;
|
|
5212
5212
|
}
|
|
5213
|
-
function
|
|
5213
|
+
function Oi(t) {
|
|
5214
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;
|
|
5215
5215
|
return !1;
|
|
5216
5216
|
}
|
|
@@ -5220,8 +5220,8 @@ function ji() {
|
|
|
5220
5220
|
function $i(t) {
|
|
5221
5221
|
const { container: e, html: a, delayMs: n = 30, onTick: r, onComplete: i } = t, o = document.createElement("template");
|
|
5222
5222
|
o.innerHTML = a;
|
|
5223
|
-
const s =
|
|
5224
|
-
if (ji() || s.length <= 1 ||
|
|
5223
|
+
const s = Ui(o.content.childNodes);
|
|
5224
|
+
if (ji() || s.length <= 1 || Oi(s))
|
|
5225
5225
|
return e.innerHTML = a, i?.(), {
|
|
5226
5226
|
complete() {
|
|
5227
5227
|
},
|
|
@@ -5253,7 +5253,7 @@ function $i(t) {
|
|
|
5253
5253
|
}
|
|
5254
5254
|
};
|
|
5255
5255
|
}
|
|
5256
|
-
function
|
|
5256
|
+
function Ot(t) {
|
|
5257
5257
|
return t !== void 0 && /[\p{L}\p{N}_]/u.test(t);
|
|
5258
5258
|
}
|
|
5259
5259
|
function qi(t) {
|
|
@@ -5273,7 +5273,7 @@ function qi(t) {
|
|
|
5273
5273
|
continue;
|
|
5274
5274
|
}
|
|
5275
5275
|
const h = g > 0 ? p[g - 1] : void 0, m = p[g + o.short_name.length];
|
|
5276
|
-
if (
|
|
5276
|
+
if (Ot(h) || Ot(m)) {
|
|
5277
5277
|
c = s.nextNode();
|
|
5278
5278
|
continue;
|
|
5279
5279
|
}
|
|
@@ -5700,7 +5700,7 @@ function lo(t, e) {
|
|
|
5700
5700
|
function rt(t) {
|
|
5701
5701
|
return `${io}:${t}`;
|
|
5702
5702
|
}
|
|
5703
|
-
function
|
|
5703
|
+
function Ue(t, e) {
|
|
5704
5704
|
return `${oo}:${t}:${e}`;
|
|
5705
5705
|
}
|
|
5706
5706
|
function wa(t) {
|
|
@@ -5777,7 +5777,7 @@ var bo = class {
|
|
|
5777
5777
|
return t ? t.map(mo).sort((e, a) => a.updatedAt.localeCompare(e.updatedAt)) : [];
|
|
5778
5778
|
}
|
|
5779
5779
|
loadSession(t) {
|
|
5780
|
-
const e = Vt(this._storage?.getItem(
|
|
5780
|
+
const e = Vt(this._storage?.getItem(Ue(this._scope, t)) ?? null);
|
|
5781
5781
|
return !e || e.version !== qt ? null : fo(e);
|
|
5782
5782
|
}
|
|
5783
5783
|
saveSession(t) {
|
|
@@ -5825,14 +5825,14 @@ var bo = class {
|
|
|
5825
5825
|
sourceSessionId: c.sourceSessionId
|
|
5826
5826
|
}); l.length > so; ) {
|
|
5827
5827
|
const p = l.pop();
|
|
5828
|
-
p && this._storage.removeItem(
|
|
5828
|
+
p && this._storage.removeItem(Ue(this._scope, p.id));
|
|
5829
5829
|
}
|
|
5830
5830
|
return this._commitRecord(c, l) ? c : null;
|
|
5831
5831
|
}
|
|
5832
5832
|
deleteSession(t) {
|
|
5833
5833
|
if (!this._storage) return;
|
|
5834
5834
|
const e = this.listSessions().filter((a) => a.id !== t);
|
|
5835
|
-
this._storage.removeItem(
|
|
5835
|
+
this._storage.removeItem(Ue(this._scope, t));
|
|
5836
5836
|
try {
|
|
5837
5837
|
this._storage.setItem(rt(this._scope), JSON.stringify(e));
|
|
5838
5838
|
} catch {
|
|
@@ -5842,12 +5842,12 @@ var bo = class {
|
|
|
5842
5842
|
if (!this._storage) return !1;
|
|
5843
5843
|
const a = [...e];
|
|
5844
5844
|
for (; a.length > 0; ) try {
|
|
5845
|
-
return this._storage.setItem(
|
|
5845
|
+
return this._storage.setItem(Ue(this._scope, t.id), JSON.stringify(t)), this._storage.setItem(rt(this._scope), JSON.stringify(a)), !0;
|
|
5846
5846
|
} catch {
|
|
5847
5847
|
const n = a.pop();
|
|
5848
5848
|
if (!n) break;
|
|
5849
5849
|
if (n.id !== t.id) {
|
|
5850
|
-
this._storage.removeItem(
|
|
5850
|
+
this._storage.removeItem(Ue(this._scope, n.id));
|
|
5851
5851
|
continue;
|
|
5852
5852
|
}
|
|
5853
5853
|
break;
|
|
@@ -6156,7 +6156,7 @@ var Ro = class Me extends Ka {
|
|
|
6156
6156
|
if (!this._hostScrollLockActive || !this._hostScrollLockViewport || this._hostScrollPinning || this._isMobileViewport && window.visualViewport && window.visualViewport.height < window.innerHeight) return;
|
|
6157
6157
|
const a = this._hostScrollLockViewport;
|
|
6158
6158
|
window.scrollX === a.x && window.scrollY === a.y || (this._hostScrollPinning = !0, window.scrollTo(a.x, a.y), this._hostScrollPinning = !1);
|
|
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
|
|
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;
|
|
6160
6160
|
}
|
|
6161
6161
|
static {
|
|
6162
6162
|
this._MAX_COMPARISON_SELECTION = 5;
|
|
@@ -6191,7 +6191,7 @@ var Ro = class Me extends Ka {
|
|
|
6191
6191
|
for (const [u, d] of Object.entries(e.theme)) u.startsWith("--") && typeof d == "string" && r(u, d);
|
|
6192
6192
|
this._applyDiscountedPriceColorVar(e.productPriceUi?.discountedPriceColor);
|
|
6193
6193
|
const i = document.createElement("div");
|
|
6194
|
-
i.className = "gengage-chat-root", i.lang =
|
|
6194
|
+
i.className = "gengage-chat-root", i.lang = Oe(e.locale), this._rootEl = i, this._shadow.appendChild(i);
|
|
6195
6195
|
const o = e.variant ?? "floating";
|
|
6196
6196
|
if (o === "inline" && i.classList.add("gengage-chat--inline"), o !== "inline") {
|
|
6197
6197
|
const u = document.createElement("div");
|
|
@@ -6929,7 +6929,7 @@ var Ro = class Me extends Ka {
|
|
|
6929
6929
|
}
|
|
6930
6930
|
if (this._maybeHandleDirectAddToCartCommand(e)) return;
|
|
6931
6931
|
}
|
|
6932
|
-
this._contextPrimingInFlight && (this._abortAllActiveRequests(), this._contextPrimingInFlight = !1, this._queuedUserMessages = []), this._ensureMobileFullSheetForPanel(), Ia(), this._messages.some((r) => r.role === "user") ||
|
|
6932
|
+
this._contextPrimingInFlight && (this._abortAllActiveRequests(), this._contextPrimingInFlight = !1, this._queuedUserMessages = []), this._ensureMobileFullSheetForPanel(), Ia(), this._messages.some((r) => r.role === "user") || Ua(), ze("chat", "sendMessage", {
|
|
6933
6933
|
mode: this._assistantMode,
|
|
6934
6934
|
hasAttachment: a !== void 0,
|
|
6935
6935
|
textLength: e.length
|
|
@@ -7051,7 +7051,7 @@ var Ro = class Me extends Ka {
|
|
|
7051
7051
|
session_id: this.config.session?.sessionId ?? "",
|
|
7052
7052
|
correlation_id: this.config.session?.sessionId ?? "",
|
|
7053
7053
|
type: H.type,
|
|
7054
|
-
locale:
|
|
7054
|
+
locale: Oe(this.config.locale),
|
|
7055
7055
|
meta: w,
|
|
7056
7056
|
context: {
|
|
7057
7057
|
...this._lastBackendContext ?? {},
|
|
@@ -7061,7 +7061,7 @@ var Ro = class Me extends Ka {
|
|
|
7061
7061
|
};
|
|
7062
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
7063
|
let _ = !1, S = !1, F = !1, W = !1, J = !1, L = !1;
|
|
7064
|
-
const P =
|
|
7064
|
+
const P = On();
|
|
7065
7065
|
let B = null, N = null;
|
|
7066
7066
|
const k = () => {
|
|
7067
7067
|
if (this._drawer && !W) {
|
|
@@ -7071,7 +7071,7 @@ var Ro = class Me extends Ka {
|
|
|
7071
7071
|
}
|
|
7072
7072
|
J ? this._drawer.setPanelAiZoneState("hidden") : this._drawer.setPanelAiZoneState("analyzing", { analyzingLabel: this._i18n.aiAnalysisAnalyzingLabel });
|
|
7073
7073
|
}
|
|
7074
|
-
},
|
|
7074
|
+
}, U = (b) => {
|
|
7075
7075
|
if (!B || !this._drawer) return;
|
|
7076
7076
|
const E = this._buildRenderContext();
|
|
7077
7077
|
E.isStreaming = b;
|
|
@@ -7079,11 +7079,11 @@ var Ro = class Me extends Ka {
|
|
|
7079
7079
|
W = !0, this._drawer.setPanelAiZoneState("results", { resultEl: T }), B = null;
|
|
7080
7080
|
}, q = (b, E, T) => {
|
|
7081
7081
|
if (b === "ProductGrid" || b === "CategoriesContainer") {
|
|
7082
|
-
F = !0,
|
|
7082
|
+
F = !0, U(T), k();
|
|
7083
7083
|
return;
|
|
7084
7084
|
}
|
|
7085
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),
|
|
7086
|
+
}, K = (b) => (b === "ProductGrid" || b === "CategoriesContainer") && (F || W || B !== null), O = () => {
|
|
7087
7087
|
L || (L = !0, this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }));
|
|
7088
7088
|
}, ee = (b, E, T) => {
|
|
7089
7089
|
if (!this._drawer || !this._panel) return;
|
|
@@ -7114,7 +7114,7 @@ var Ro = class Me extends Ka {
|
|
|
7114
7114
|
let $ = null;
|
|
7115
7115
|
if ($ = pn(I, {
|
|
7116
7116
|
onTextChunk: (b, E, T) => {
|
|
7117
|
-
if (!o && i !== this._activeRequestThreadId || (u += b, zo(u) &&
|
|
7117
|
+
if (!o && i !== this._activeRequestThreadId || (u += b, zo(u) && O(), T?.skuToProductItem && (this._skuToProductItem = {
|
|
7118
7118
|
...this._skuToProductItem,
|
|
7119
7119
|
...T.skuToProductItem
|
|
7120
7120
|
}), T?.conversationMode && (this._conversationMode = T.conversationMode), T?.renderHint && (d.renderHint = T.renderHint), !this._drawer)) return;
|
|
@@ -7197,7 +7197,7 @@ var Ro = class Me extends Ka {
|
|
|
7197
7197
|
}
|
|
7198
7198
|
R.isConsulting && (N = null);
|
|
7199
7199
|
}
|
|
7200
|
-
if (Bo(M) &&
|
|
7200
|
+
if (Bo(M) && O(), re === "panel" && this._panel && !te) {
|
|
7201
7201
|
const R = !S;
|
|
7202
7202
|
S = !0;
|
|
7203
7203
|
const V = M?.props?.replacePanel === !0, G = M?.props?.rankingState, Q = V || G === "pending" || G === "final" ? "replace" : ro({
|
|
@@ -7424,7 +7424,7 @@ var Ro = class Me extends Ka {
|
|
|
7424
7424
|
const te = D?.type ?? "ProductGrid";
|
|
7425
7425
|
ee(Z, M, te), X(te, D, "replace", !1), S = !0;
|
|
7426
7426
|
}
|
|
7427
|
-
N = null, B &&
|
|
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, {
|
|
7428
7428
|
drawer: this._drawer,
|
|
7429
7429
|
ensureRendered: () => {
|
|
7430
7430
|
},
|
|
@@ -7723,7 +7723,7 @@ var Ro = class Me extends Ka {
|
|
|
7723
7723
|
}
|
|
7724
7724
|
_formatHistoryTimestamp(e) {
|
|
7725
7725
|
try {
|
|
7726
|
-
return new Intl.DateTimeFormat(
|
|
7726
|
+
return new Intl.DateTimeFormat(Oe(this.config.locale), {
|
|
7727
7727
|
month: "short",
|
|
7728
7728
|
day: "numeric",
|
|
7729
7729
|
hour: "2-digit",
|
|
@@ -8143,7 +8143,7 @@ var Ro = class Me extends Ka {
|
|
|
8143
8143
|
}
|
|
8144
8144
|
_buildRenderContext() {
|
|
8145
8145
|
const e = {
|
|
8146
|
-
locale:
|
|
8146
|
+
locale: Oe(this.config.locale),
|
|
8147
8147
|
onAction: (a) => {
|
|
8148
8148
|
if (a.type === "frontend_restore_panel_message") {
|
|
8149
8149
|
this._restorePanelFromFrontendMessage(a.payload);
|
|
@@ -8168,7 +8168,7 @@ var Ro = class Me extends Ka {
|
|
|
8168
8168
|
if (a.type === "getComparisonTable") {
|
|
8169
8169
|
const r = a.payload, i = r && typeof r == "object" ? r : null, o = i && typeof i.gengage_analytics_source == "string" ? i.gengage_analytics_source : "";
|
|
8170
8170
|
let s = [];
|
|
8171
|
-
i && Array.isArray(i.sku_list) && (s = i.sku_list.filter((c) => typeof c == "string")), o === "floating_compare_dock" ? qa(s) :
|
|
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);
|
|
8172
8172
|
}
|
|
8173
8173
|
const n = a.type === "addToCart" || a.type === "like";
|
|
8174
8174
|
this._sendAction(a, n ? { preservePanel: !0 } : void 0);
|