@gengage/assistant-fe 0.1.9 → 0.2.0
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/assistant-fe.css +1 -1
- package/dist/chat/components/CategoriesContainer.d.ts.map +1 -1
- package/dist/chat/components/ChatDrawer.d.ts.map +1 -1
- package/dist/chat/components/renderUISpec.d.ts.map +1 -1
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat.cjs +1 -1
- package/dist/chat.iife.js +28 -28
- package/dist/chat.iife.js.map +1 -1
- package/dist/chat.js +2 -2
- package/dist/common/action-router.d.ts.map +1 -1
- package/dist/common/debug.d.ts.map +1 -1
- package/dist/common/events.d.ts.map +1 -1
- package/dist/common/native-webview.d.ts.map +1 -1
- package/dist/common/product-utils.d.ts +10 -0
- package/dist/common/product-utils.d.ts.map +1 -1
- package/dist/common/protocol-adapter.d.ts.map +1 -1
- package/dist/common.cjs +1 -1
- package/dist/common.js +5 -5
- package/dist/index-BA7N_XOO.cjs +2 -0
- package/dist/index-BA7N_XOO.cjs.map +1 -0
- package/dist/{index-DR2uepzb.js → index-C6KDzSjm.js} +181 -187
- package/dist/index-C6KDzSjm.js.map +1 -0
- package/dist/{index-CEt87kCd.js → index-RmQRBt6w.js} +1289 -1303
- package/dist/index-RmQRBt6w.js.map +1 -0
- package/dist/index-VgLdYuZV.cjs +13 -0
- package/dist/index-VgLdYuZV.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/native.cjs +1 -1
- package/dist/native.iife.js +30 -30
- package/dist/native.iife.js.map +1 -1
- package/dist/native.js +1 -1
- package/dist/qna.cjs +1 -1
- package/dist/qna.iife.js +2 -2
- package/dist/qna.iife.js.map +1 -1
- package/dist/qna.js +1 -1
- package/dist/quantity-stepper-BKtPQUR1.js +78 -0
- package/dist/quantity-stepper-BKtPQUR1.js.map +1 -0
- package/dist/quantity-stepper-DU6va4sS.cjs +2 -0
- package/dist/quantity-stepper-DU6va4sS.cjs.map +1 -0
- package/dist/{schemas-DIhL3DkL.js → schemas-BAEbjFPE.js} +17 -12
- package/dist/schemas-BAEbjFPE.js.map +1 -0
- package/dist/{schemas-Dsr0bbO_.cjs → schemas-DIyHm5pa.cjs} +4 -4
- package/dist/{schemas-DIhL3DkL.js.map → schemas-DIyHm5pa.cjs.map} +1 -1
- package/dist/simrel/api.d.ts.map +1 -1
- package/dist/simrel/components/ProductCard.d.ts.map +1 -1
- package/dist/simrel/locales/en.d.ts.map +1 -1
- package/dist/simrel/locales/tr.d.ts.map +1 -1
- package/dist/simrel/types.d.ts +1 -0
- package/dist/simrel/types.d.ts.map +1 -1
- package/dist/simrel.cjs +1 -1
- package/dist/simrel.cjs.map +1 -1
- package/dist/simrel.css +1 -1
- package/dist/simrel.iife.js +6 -6
- package/dist/simrel.iife.js.map +1 -1
- package/dist/simrel.js +236 -234
- package/dist/simrel.js.map +1 -1
- package/package.json +1 -1
- package/dist/index-BWPx4pM7.cjs +0 -13
- package/dist/index-BWPx4pM7.cjs.map +0 -1
- package/dist/index-CEt87kCd.js.map +0 -1
- package/dist/index-DL4CAkyL.cjs +0 -2
- package/dist/index-DL4CAkyL.cjs.map +0 -1
- package/dist/index-DR2uepzb.js.map +0 -1
- package/dist/quantity-stepper-C-nV4lwi.js +0 -77
- package/dist/quantity-stepper-C-nV4lwi.js.map +0 -1
- package/dist/quantity-stepper-CURMkwRF.cjs +0 -2
- package/dist/quantity-stepper-CURMkwRF.cjs.map +0 -1
- package/dist/schemas-Dsr0bbO_.cjs.map +0 -1
package/dist/simrel.js
CHANGED
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
import { b as P, p as
|
|
2
|
-
import { a as
|
|
1
|
+
import { b as P, p as j, q as M, c as N, a as x, v as B, x as q, r as z, o as b, s as f, f as H, e as $, _ as I, y as v, B as F, t as J, z as W, j as E, A as Q, C as V, g as Y, i as k, h as _, w as S, k as K, l as X, m as Z } from "./schemas-BAEbjFPE.js";
|
|
2
|
+
import { a as ee, c as te, b as ne, f as T, d as re } from "./quantity-stepper-BKtPQUR1.js";
|
|
3
3
|
function R(n) {
|
|
4
|
+
const e = [];
|
|
5
|
+
for (const t of Object.values(n))
|
|
6
|
+
if (t.type === "ProductCard" && t.props) {
|
|
7
|
+
const r = t.props.product ?? t.props;
|
|
8
|
+
typeof r.sku == "string" && typeof r.name == "string" && e.push(r);
|
|
9
|
+
}
|
|
10
|
+
return e;
|
|
11
|
+
}
|
|
12
|
+
function L(n) {
|
|
4
13
|
const e = n.headers.get("Content-Type") ?? "";
|
|
5
14
|
return e.includes("application/x-ndjson") || e.includes("text/event-stream");
|
|
6
15
|
}
|
|
7
|
-
async function
|
|
16
|
+
async function ie(n, e) {
|
|
8
17
|
const t = [], r = {
|
|
9
18
|
onEvent: (i) => {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
for (const s of Object.values(o.spec.elements))
|
|
13
|
-
if (s.type === "ProductCard" && s.props) {
|
|
14
|
-
const g = s.props.product ?? s.props;
|
|
15
|
-
typeof g.sku == "string" && typeof g.name == "string" && t.push(g);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
19
|
+
const s = x(i);
|
|
20
|
+
!s || s.type !== "ui_spec" || t.push(...R(s.spec.elements));
|
|
18
21
|
}
|
|
19
22
|
};
|
|
20
|
-
return e !== void 0 && (r.signal = e), await
|
|
23
|
+
return e !== void 0 && (r.signal = e), await N(n, r), t;
|
|
21
24
|
}
|
|
22
|
-
async function
|
|
25
|
+
async function oe(n, e, t) {
|
|
23
26
|
const r = P("similar_products", e), i = {
|
|
24
27
|
method: "POST",
|
|
25
28
|
headers: { "Content-Type": "application/json" },
|
|
26
29
|
body: JSON.stringify(n)
|
|
27
30
|
};
|
|
28
31
|
t !== void 0 && (i.signal = t);
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
31
|
-
throw new Error(`HTTP ${
|
|
32
|
-
if (
|
|
33
|
-
return
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
32
|
+
const s = await fetch(r, i);
|
|
33
|
+
if (!s.ok)
|
|
34
|
+
throw new Error(`HTTP ${s.status}: ${s.statusText}`);
|
|
35
|
+
if (L(s))
|
|
36
|
+
return ie(s, t);
|
|
37
|
+
const a = await s.text();
|
|
38
|
+
if (!a) return [];
|
|
36
39
|
try {
|
|
37
|
-
return
|
|
40
|
+
return j(JSON.parse(a));
|
|
38
41
|
} catch {
|
|
39
42
|
throw new Error("Invalid JSON from similar_products endpoint");
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
|
-
async function
|
|
45
|
+
async function se(n, e) {
|
|
43
46
|
const t = [];
|
|
44
47
|
let r = null;
|
|
45
48
|
const i = {
|
|
46
|
-
onEvent: (
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
if (
|
|
50
|
-
const
|
|
51
|
-
if (typeof
|
|
52
|
-
r = { name:
|
|
53
|
-
const
|
|
54
|
-
typeof
|
|
49
|
+
onEvent: (s) => {
|
|
50
|
+
const a = x(s);
|
|
51
|
+
if (a) {
|
|
52
|
+
if (a.type === "metadata" && a.meta) {
|
|
53
|
+
const p = a.meta.group_name;
|
|
54
|
+
if (typeof p == "string") {
|
|
55
|
+
r = { name: p, products: [] };
|
|
56
|
+
const l = a.meta.highlight;
|
|
57
|
+
typeof l == "string" && (r.highlight = l), t.push(r);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
|
-
|
|
58
|
-
for (const g of Object.values(s.spec.elements))
|
|
59
|
-
if (g.type === "ProductCard" && g.props) {
|
|
60
|
-
const d = g.props.product ?? g.props;
|
|
61
|
-
typeof d.sku == "string" && typeof d.name == "string" && r.products.push(d);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
60
|
+
a.type === "ui_spec" && r && r.products.push(...R(a.spec.elements));
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
63
|
};
|
|
67
|
-
return e !== void 0 && (i.signal = e), await
|
|
64
|
+
return e !== void 0 && (i.signal = e), await N(n, i), t;
|
|
68
65
|
}
|
|
69
|
-
async function
|
|
66
|
+
async function ae(n, e, t) {
|
|
70
67
|
const r = P("product_groupings", e), i = {
|
|
71
68
|
method: "POST",
|
|
72
69
|
headers: { "Content-Type": "application/json" },
|
|
73
70
|
body: JSON.stringify(n)
|
|
74
71
|
};
|
|
75
72
|
t !== void 0 && (i.signal = t);
|
|
76
|
-
const
|
|
77
|
-
if (!
|
|
78
|
-
throw new Error(`HTTP ${
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
73
|
+
const s = await fetch(r, i);
|
|
74
|
+
if (!s.ok)
|
|
75
|
+
throw new Error(`HTTP ${s.status}: ${s.statusText}`);
|
|
76
|
+
if (L(s))
|
|
77
|
+
return se(s, t);
|
|
78
|
+
const a = await s.text();
|
|
79
|
+
if (!a) return [];
|
|
83
80
|
try {
|
|
84
|
-
return
|
|
81
|
+
return M(JSON.parse(a));
|
|
85
82
|
} catch {
|
|
86
83
|
throw new Error("Invalid JSON from product_groupings endpoint");
|
|
87
84
|
}
|
|
88
85
|
}
|
|
89
86
|
function U(n) {
|
|
90
|
-
const { product: e, index: t, discountType: r, onClick: i, onAddToCart:
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
return
|
|
87
|
+
const { product: e, index: t, discountType: r, onClick: i, onAddToCart: s, renderCard: a } = n, p = n.i18n, l = n.pricing;
|
|
88
|
+
if (a) {
|
|
89
|
+
const o = document.createElement("div");
|
|
90
|
+
return o.className = "gengage-simrel-card gengage-simrel-card--custom", o.innerHTML = B(a(e, t)), o.addEventListener("click", (m) => {
|
|
94
91
|
m.target.closest(".gengage-simrel-atc") || m.target.closest(".gengage-chat-product-card-atc") || i(e);
|
|
95
|
-
}),
|
|
92
|
+
}), o;
|
|
96
93
|
}
|
|
97
94
|
const u = document.createElement("article");
|
|
98
95
|
u.className = "gengage-simrel-card gengage-chat-product-card", u.setAttribute("role", "listitem"), u.dataset.sku = e.sku;
|
|
99
96
|
const c = document.createElement("div");
|
|
100
|
-
if (c.className = "gengage-simrel-card-image gengage-chat-product-card-img-wrapper", e.imageUrl &&
|
|
101
|
-
const
|
|
102
|
-
|
|
97
|
+
if (c.className = "gengage-simrel-card-image gengage-chat-product-card-img-wrapper", e.imageUrl && q(e.imageUrl)) {
|
|
98
|
+
const o = document.createElement("img");
|
|
99
|
+
o.className = "gengage-chat-product-card-img", o.src = e.imageUrl, o.alt = e.name, o.loading = "lazy", ee(o), c.appendChild(o);
|
|
103
100
|
}
|
|
104
101
|
if (r === "badge" && e.discountPercent && e.discountPercent > 0) {
|
|
105
|
-
const
|
|
106
|
-
|
|
102
|
+
const o = document.createElement("span");
|
|
103
|
+
o.className = "gengage-simrel-badge gengage-chat-product-card-discount-badge", o.textContent = `%${te(e.discountPercent)}`, c.appendChild(o);
|
|
107
104
|
}
|
|
108
105
|
u.appendChild(c);
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
111
|
-
const
|
|
112
|
-
|
|
106
|
+
const g = document.createElement("div");
|
|
107
|
+
if (g.className = "gengage-simrel-card-info gengage-chat-product-card-body", e.brand) {
|
|
108
|
+
const o = document.createElement("div");
|
|
109
|
+
o.className = "gengage-simrel-card-brand gengage-chat-product-card-brand", o.textContent = e.brand, g.appendChild(o);
|
|
113
110
|
}
|
|
114
111
|
const h = document.createElement("div");
|
|
115
|
-
if (h.className = "gengage-simrel-card-name gengage-chat-product-card-name", h.textContent = e.name,
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
112
|
+
if (h.className = "gengage-simrel-card-name gengage-chat-product-card-name", h.textContent = e.name, g.appendChild(h), e.rating != null && e.rating > 0) {
|
|
113
|
+
const o = document.createElement("div");
|
|
114
|
+
if (o.className = "gengage-simrel-card-rating gengage-chat-product-card-rating", o.appendChild(ne(e.rating)), e.reviewCount != null) {
|
|
118
115
|
const m = document.createElement("span");
|
|
119
|
-
m.className = "gengage-simrel-card-review-count gengage-chat-product-card-review-count", m.textContent = ` (${e.reviewCount})`,
|
|
116
|
+
m.className = "gengage-simrel-card-review-count gengage-chat-product-card-review-count", m.textContent = ` (${e.reviewCount})`, o.appendChild(m);
|
|
120
117
|
}
|
|
121
|
-
|
|
118
|
+
g.appendChild(o);
|
|
122
119
|
}
|
|
123
120
|
const y = document.createElement("div");
|
|
124
121
|
if (y.className = "gengage-simrel-card-price gengage-chat-product-card-price", e.originalPrice && e.originalPrice !== e.price && (r === "strike-through" || !r)) {
|
|
125
|
-
const
|
|
126
|
-
|
|
122
|
+
const o = document.createElement("span");
|
|
123
|
+
o.className = "gengage-simrel-card-price-original gengage-chat-product-card-original-price", o.textContent = T(e.originalPrice, l), y.appendChild(o);
|
|
127
124
|
}
|
|
128
125
|
if (e.price) {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
}), u.appendChild(
|
|
137
|
-
const
|
|
126
|
+
const o = document.createElement("span");
|
|
127
|
+
o.className = "gengage-simrel-card-price-current gengage-chat-product-card-price-current", o.textContent = T(e.price, l), y.appendChild(o);
|
|
128
|
+
}
|
|
129
|
+
g.appendChild(y), u.appendChild(g);
|
|
130
|
+
const d = document.createElement("button");
|
|
131
|
+
if (d.className = "gengage-simrel-card-cta gengage-chat-product-card-cta", d.type = "button", d.textContent = p?.ctaLabel ?? "View", d.addEventListener("click", (o) => {
|
|
132
|
+
o.preventDefault(), o.stopPropagation(), i(e);
|
|
133
|
+
}), u.appendChild(d), e.inStock === !1) {
|
|
134
|
+
const o = document.createElement("div");
|
|
135
|
+
o.className = "gengage-simrel-card-oos", o.textContent = p?.outOfStockLabel ?? "Out of Stock", u.appendChild(o);
|
|
136
|
+
} else if (e.cartCode) {
|
|
137
|
+
const o = e.cartCode, m = re({
|
|
138
138
|
compact: !0,
|
|
139
|
-
label:
|
|
139
|
+
label: p?.addToCartButton ?? "Add to Cart",
|
|
140
140
|
onSubmit: (C) => {
|
|
141
|
-
|
|
141
|
+
s({ sku: e.sku, quantity: C, cartCode: o });
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
|
-
m.classList.add("gengage-simrel-atc"
|
|
144
|
+
m.classList.add("gengage-simrel-atc"), u.appendChild(m);
|
|
145
145
|
}
|
|
146
|
-
return u.addEventListener("click", (
|
|
147
|
-
|
|
146
|
+
return u.addEventListener("click", (o) => {
|
|
147
|
+
o.target.closest(".gengage-simrel-atc") || o.target.closest(".gengage-chat-product-card-atc") || o.target.closest(".gengage-chat-product-card-cta") || i(e);
|
|
148
148
|
}), u;
|
|
149
149
|
}
|
|
150
150
|
function w(n) {
|
|
@@ -158,8 +158,8 @@ function w(n) {
|
|
|
158
158
|
onAddToCart: n.onAddToCart
|
|
159
159
|
};
|
|
160
160
|
n.i18n !== void 0 && (i.i18n = n.i18n), n.discountType !== void 0 && (i.discountType = n.discountType), n.renderCard !== void 0 && (i.renderCard = n.renderCard);
|
|
161
|
-
const
|
|
162
|
-
e.appendChild(
|
|
161
|
+
const s = U(i);
|
|
162
|
+
e.appendChild(s);
|
|
163
163
|
}
|
|
164
164
|
if (n.products.length === 0) {
|
|
165
165
|
const t = document.createElement("div");
|
|
@@ -167,49 +167,49 @@ function w(n) {
|
|
|
167
167
|
}
|
|
168
168
|
return e;
|
|
169
169
|
}
|
|
170
|
-
let
|
|
171
|
-
function
|
|
172
|
-
const e =
|
|
170
|
+
let ce = 0;
|
|
171
|
+
function de(n) {
|
|
172
|
+
const e = ce++, t = document.createElement("div");
|
|
173
173
|
if (t.className = "gengage-simrel-groups", n.groups.length === 0) {
|
|
174
174
|
const c = document.createElement("div");
|
|
175
175
|
return c.className = "gengage-simrel-empty", c.textContent = n.i18n?.emptyStateMessage ?? "No similar products found.", t.appendChild(c), t;
|
|
176
176
|
}
|
|
177
177
|
const r = document.createElement("div");
|
|
178
178
|
r.className = "gengage-simrel-tabs", r.setAttribute("role", "tablist");
|
|
179
|
-
const i = [],
|
|
180
|
-
const
|
|
179
|
+
const i = [], s = [], a = (c) => {
|
|
180
|
+
const g = {
|
|
181
181
|
products: c.products,
|
|
182
182
|
onClick: n.onClick,
|
|
183
183
|
onAddToCart: n.onAddToCart
|
|
184
184
|
};
|
|
185
|
-
return n.i18n !== void 0 && (
|
|
186
|
-
},
|
|
187
|
-
for (let
|
|
188
|
-
const
|
|
189
|
-
i[
|
|
185
|
+
return n.i18n !== void 0 && (g.i18n = n.i18n), n.discountType !== void 0 && (g.discountType = n.discountType), n.renderCard !== void 0 && (g.renderCard = n.renderCard), g;
|
|
186
|
+
}, p = (c) => {
|
|
187
|
+
for (let d = 0; d < i.length; d++) {
|
|
188
|
+
const o = d === c;
|
|
189
|
+
i[d].classList.toggle("gengage-simrel-tab--active", o), i[d].setAttribute("aria-selected", String(o)), i[d].tabIndex = o ? 0 : -1;
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const g = n.groups[c], h = s[c];
|
|
192
192
|
h.innerHTML = "";
|
|
193
|
-
const y = w(
|
|
193
|
+
const y = w(a(g));
|
|
194
194
|
h.appendChild(y);
|
|
195
|
-
for (let
|
|
196
|
-
const
|
|
197
|
-
|
|
195
|
+
for (let d = 0; d < s.length; d++) {
|
|
196
|
+
const o = d === c;
|
|
197
|
+
s[d].style.display = o ? "" : "none", s[d].tabIndex = o ? 0 : -1;
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
200
|
for (let c = 0; c < n.groups.length; c++) {
|
|
201
|
-
const
|
|
202
|
-
|
|
201
|
+
const g = n.groups[c], h = `gengage-simrel-tab-${e}-${c}`, y = `gengage-simrel-panel-${e}-${c}`, d = document.createElement("button");
|
|
202
|
+
d.className = "gengage-simrel-tab", d.type = "button", d.id = h, d.textContent = g.name, d.setAttribute("role", "tab"), d.setAttribute("aria-controls", y), d.setAttribute("aria-selected", String(c === 0)), d.tabIndex = c === 0 ? 0 : -1, c === 0 && d.classList.add("gengage-simrel-tab--active"), d.addEventListener("click", () => p(c)), d.addEventListener("keydown", (m) => {
|
|
203
203
|
let C = -1;
|
|
204
|
-
m.key === "ArrowRight" || m.key === "ArrowDown" ? C = (c + 1) % n.groups.length : m.key === "ArrowLeft" || m.key === "ArrowUp" ? C = (c - 1 + n.groups.length) % n.groups.length : m.key === "Home" ? C = 0 : m.key === "End" && (C = n.groups.length - 1), C >= 0 && (m.preventDefault(),
|
|
205
|
-
}), i.push(
|
|
206
|
-
const
|
|
207
|
-
|
|
204
|
+
m.key === "ArrowRight" || m.key === "ArrowDown" ? C = (c + 1) % n.groups.length : m.key === "ArrowLeft" || m.key === "ArrowUp" ? C = (c - 1 + n.groups.length) % n.groups.length : m.key === "Home" ? C = 0 : m.key === "End" && (C = n.groups.length - 1), C >= 0 && (m.preventDefault(), p(C), i[C].focus());
|
|
205
|
+
}), i.push(d), r.appendChild(d);
|
|
206
|
+
const o = document.createElement("div");
|
|
207
|
+
o.className = "gengage-simrel-tab-panel", o.id = y, o.setAttribute("role", "tabpanel"), o.setAttribute("aria-labelledby", h), o.tabIndex = c === 0 ? 0 : -1, c !== 0 && (o.style.display = "none"), s.push(o);
|
|
208
208
|
}
|
|
209
209
|
t.appendChild(r);
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
for (const c of
|
|
210
|
+
const l = s[0], u = w(a(n.groups[0]));
|
|
211
|
+
l.appendChild(u);
|
|
212
|
+
for (const c of s) t.appendChild(c);
|
|
213
213
|
return t;
|
|
214
214
|
}
|
|
215
215
|
function A(n) {
|
|
@@ -225,75 +225,75 @@ function A(n) {
|
|
|
225
225
|
typeof r == "string" && (t.imageUrl = r);
|
|
226
226
|
const i = e.price;
|
|
227
227
|
typeof i == "string" && (t.price = i);
|
|
228
|
-
const
|
|
229
|
-
typeof
|
|
230
|
-
const
|
|
231
|
-
typeof
|
|
232
|
-
const
|
|
233
|
-
typeof
|
|
234
|
-
const
|
|
235
|
-
typeof
|
|
228
|
+
const s = e.originalPrice;
|
|
229
|
+
typeof s == "string" && (t.originalPrice = s);
|
|
230
|
+
const a = e.discountPercent;
|
|
231
|
+
typeof a == "number" && (t.discountPercent = a);
|
|
232
|
+
const p = e.brand;
|
|
233
|
+
typeof p == "string" && (t.brand = p);
|
|
234
|
+
const l = e.rating;
|
|
235
|
+
typeof l == "number" && (t.rating = l);
|
|
236
236
|
const u = e.reviewCount;
|
|
237
237
|
typeof u == "number" && (t.reviewCount = u);
|
|
238
238
|
const c = e.cartCode;
|
|
239
239
|
typeof c == "string" && (t.cartCode = c);
|
|
240
|
-
const
|
|
241
|
-
return typeof
|
|
240
|
+
const g = e.inStock;
|
|
241
|
+
return typeof g == "boolean" && (t.inStock = g), t;
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function le(n) {
|
|
244
244
|
if (!n || typeof n != "object") return null;
|
|
245
245
|
const e = n, t = e.title, r = e.type;
|
|
246
246
|
if (typeof t != "string" || typeof r != "string") return null;
|
|
247
247
|
const i = { title: t, type: r };
|
|
248
248
|
return e.payload !== void 0 && (i.payload = e.payload), i;
|
|
249
249
|
}
|
|
250
|
-
const
|
|
250
|
+
const O = {
|
|
251
251
|
ProductGrid: ({ element: n, renderElement: e, context: t }) => {
|
|
252
252
|
const r = document.createElement("div");
|
|
253
253
|
r.className = "gengage-simrel-grid", r.setAttribute("role", "list");
|
|
254
254
|
const i = n.props?.columns;
|
|
255
255
|
typeof i == "number" && Number.isFinite(i) && i > 0 && r.style.setProperty("--gengage-simrel-columns", String(i));
|
|
256
|
-
for (const
|
|
257
|
-
const
|
|
258
|
-
|
|
256
|
+
for (const s of n.children ?? []) {
|
|
257
|
+
const a = e(s);
|
|
258
|
+
a && r.appendChild(a);
|
|
259
259
|
}
|
|
260
260
|
if (r.children.length === 0) {
|
|
261
|
-
const
|
|
262
|
-
|
|
261
|
+
const s = document.createElement("div");
|
|
262
|
+
s.className = "gengage-simrel-empty", s.textContent = t.i18n.emptyStateMessage, r.appendChild(s);
|
|
263
263
|
}
|
|
264
264
|
return r;
|
|
265
265
|
},
|
|
266
266
|
ProductCard: ({ element: n, context: e }) => {
|
|
267
267
|
const t = n.props?.product ?? n.props, r = A(t);
|
|
268
268
|
if (!r) return null;
|
|
269
|
-
const i = n.props?.index,
|
|
269
|
+
const i = n.props?.index, s = typeof i == "number" && Number.isFinite(i) ? i : 0, a = n.props?.discountType, p = a === "strike-through" || a === "badge" ? a : e.discountType, l = {
|
|
270
270
|
product: r,
|
|
271
|
-
index:
|
|
271
|
+
index: s,
|
|
272
272
|
onClick: e.onClick,
|
|
273
273
|
onAddToCart: e.onAddToCart,
|
|
274
274
|
i18n: e.i18n
|
|
275
275
|
};
|
|
276
|
-
return
|
|
276
|
+
return p !== void 0 && (l.discountType = p), e.renderCard !== void 0 && (l.renderCard = e.renderCard), e.pricing !== void 0 && (l.pricing = e.pricing), U(l);
|
|
277
277
|
},
|
|
278
278
|
GroupTabs: ({ element: n, context: e }) => {
|
|
279
279
|
const t = n.props?.groups;
|
|
280
280
|
if (!Array.isArray(t)) return null;
|
|
281
281
|
const r = [];
|
|
282
|
-
for (const
|
|
283
|
-
if (!
|
|
284
|
-
const
|
|
285
|
-
if (typeof
|
|
286
|
-
const
|
|
287
|
-
if (Array.isArray(
|
|
288
|
-
for (const u of
|
|
282
|
+
for (const s of t) {
|
|
283
|
+
if (!s || typeof s != "object") continue;
|
|
284
|
+
const a = s;
|
|
285
|
+
if (typeof a.name != "string") continue;
|
|
286
|
+
const p = [];
|
|
287
|
+
if (Array.isArray(a.products))
|
|
288
|
+
for (const u of a.products) {
|
|
289
289
|
const c = A(u);
|
|
290
|
-
c &&
|
|
290
|
+
c && p.push(c);
|
|
291
291
|
}
|
|
292
|
-
const
|
|
293
|
-
name:
|
|
294
|
-
products:
|
|
292
|
+
const l = {
|
|
293
|
+
name: a.name,
|
|
294
|
+
products: p
|
|
295
295
|
};
|
|
296
|
-
typeof
|
|
296
|
+
typeof a.highlight == "string" && (l.highlight = a.highlight), r.push(l);
|
|
297
297
|
}
|
|
298
298
|
const i = {
|
|
299
299
|
groups: r,
|
|
@@ -301,7 +301,7 @@ const L = {
|
|
|
301
301
|
onAddToCart: e.onAddToCart,
|
|
302
302
|
i18n: e.i18n
|
|
303
303
|
};
|
|
304
|
-
return e.discountType !== void 0 && (i.discountType = e.discountType), e.renderCard !== void 0 && (i.renderCard = e.renderCard),
|
|
304
|
+
return e.discountType !== void 0 && (i.discountType = e.discountType), e.renderCard !== void 0 && (i.renderCard = e.renderCard), de(i);
|
|
305
305
|
},
|
|
306
306
|
EmptyState: ({ element: n, context: e }) => {
|
|
307
307
|
const t = document.createElement("div");
|
|
@@ -314,9 +314,9 @@ const L = {
|
|
|
314
314
|
if (typeof t != "string" || typeof r != "string") return null;
|
|
315
315
|
const i = document.createElement("button");
|
|
316
316
|
i.className = "gengage-simrel-atc gengage-chat-product-card-cta", i.type = "button";
|
|
317
|
-
const
|
|
318
|
-
return i.textContent = typeof
|
|
319
|
-
|
|
317
|
+
const s = n.props?.label;
|
|
318
|
+
return i.textContent = typeof s == "string" ? s : e.i18n.addToCartButton, i.addEventListener("click", (a) => {
|
|
319
|
+
a.preventDefault(), a.stopPropagation(), e.onAddToCart({ sku: t, quantity: 1, cartCode: r });
|
|
320
320
|
}), i;
|
|
321
321
|
},
|
|
322
322
|
QuickActions: ({ element: n, context: e }) => {
|
|
@@ -326,12 +326,12 @@ const L = {
|
|
|
326
326
|
if (!Array.isArray(r) || !e.onAction) return t;
|
|
327
327
|
for (const i of r) {
|
|
328
328
|
if (!i || typeof i != "object") continue;
|
|
329
|
-
const
|
|
330
|
-
if (typeof
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
u.preventDefault(), u.stopPropagation(), e.onAction?.(
|
|
334
|
-
}), t.appendChild(
|
|
329
|
+
const s = i, a = s.label, p = le(s.action);
|
|
330
|
+
if (typeof a != "string" || !p) continue;
|
|
331
|
+
const l = document.createElement("button");
|
|
332
|
+
l.className = "gengage-simrel-quick-action", l.type = "button", l.textContent = a, l.addEventListener("click", (u) => {
|
|
333
|
+
u.preventDefault(), u.stopPropagation(), e.onAction?.(p);
|
|
334
|
+
}), t.appendChild(l);
|
|
335
335
|
}
|
|
336
336
|
return t;
|
|
337
337
|
}
|
|
@@ -348,11 +348,11 @@ const L = {
|
|
|
348
348
|
}
|
|
349
349
|
return t;
|
|
350
350
|
};
|
|
351
|
-
function
|
|
352
|
-
return { ...
|
|
351
|
+
function ue() {
|
|
352
|
+
return { ...O };
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
354
|
+
function ge(n, e, t = O, r = G) {
|
|
355
|
+
return z({
|
|
356
356
|
spec: n,
|
|
357
357
|
context: e,
|
|
358
358
|
registry: t,
|
|
@@ -360,26 +360,28 @@ function ue(n, e, t = L, r = G) {
|
|
|
360
360
|
unknownRenderer: r
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
const
|
|
363
|
+
const D = {
|
|
364
364
|
similarProductsAriaLabel: "Benzer ürünler",
|
|
365
365
|
emptyStateMessage: "Benzer ürün bulunamadı.",
|
|
366
366
|
addToCartButton: "Sepete Ekle",
|
|
367
367
|
ctaLabel: "İncele",
|
|
368
|
+
outOfStockLabel: "Stokta Yok",
|
|
368
369
|
priceSuffix: " TL"
|
|
369
|
-
},
|
|
370
|
+
}, pe = {
|
|
370
371
|
similarProductsAriaLabel: "Similar products",
|
|
371
372
|
emptyStateMessage: "No similar products found.",
|
|
372
373
|
addToCartButton: "Add to cart",
|
|
373
374
|
ctaLabel: "View",
|
|
375
|
+
outOfStockLabel: "Out of Stock",
|
|
374
376
|
priceSuffix: ""
|
|
375
377
|
};
|
|
376
|
-
function
|
|
378
|
+
function me(n) {
|
|
377
379
|
return n ? n.toLowerCase().split("-")[0] ?? "tr" : "tr";
|
|
378
380
|
}
|
|
379
|
-
function
|
|
380
|
-
return
|
|
381
|
+
function fe(n) {
|
|
382
|
+
return me(n) === "en" ? pe : D;
|
|
381
383
|
}
|
|
382
|
-
const
|
|
384
|
+
const he = b({
|
|
383
385
|
sku: f(),
|
|
384
386
|
name: f(),
|
|
385
387
|
imageUrl: f().url().optional(),
|
|
@@ -390,60 +392,60 @@ const fe = b({
|
|
|
390
392
|
brand: f().optional(),
|
|
391
393
|
rating: v().min(0).max(5).optional(),
|
|
392
394
|
reviewCount: v().int().nonnegative().optional()
|
|
393
|
-
}), he = b({
|
|
394
|
-
layout: x(["grid", "carousel"]).optional(),
|
|
395
|
-
columns: v().int().positive().optional()
|
|
396
395
|
}), ye = b({
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
discountType: x(["strike-through", "badge"]).optional()
|
|
396
|
+
layout: I(["grid", "carousel"]).optional(),
|
|
397
|
+
columns: v().int().positive().optional()
|
|
400
398
|
}), Ce = b({
|
|
399
|
+
product: he,
|
|
400
|
+
index: v().int().nonnegative(),
|
|
401
|
+
discountType: I(["strike-through", "badge"]).optional()
|
|
402
|
+
}), be = b({
|
|
401
403
|
sku: f(),
|
|
402
404
|
label: f().optional(),
|
|
403
405
|
cartCode: f()
|
|
404
|
-
}),
|
|
405
|
-
actions:
|
|
406
|
+
}), ve = b({
|
|
407
|
+
actions: H(
|
|
406
408
|
b({
|
|
407
409
|
label: f(),
|
|
408
410
|
action: b({
|
|
409
411
|
title: f(),
|
|
410
412
|
type: f(),
|
|
411
|
-
payload:
|
|
413
|
+
payload: $().optional()
|
|
412
414
|
})
|
|
413
415
|
})
|
|
414
416
|
)
|
|
415
|
-
}),
|
|
417
|
+
}), Ee = b({
|
|
416
418
|
message: f().optional()
|
|
417
|
-
}),
|
|
419
|
+
}), Te = {
|
|
418
420
|
components: {
|
|
419
421
|
ProductGrid: {
|
|
420
|
-
schema:
|
|
422
|
+
schema: ye,
|
|
421
423
|
description: "Outer grid or carousel container for similar products."
|
|
422
424
|
},
|
|
423
425
|
ProductCard: {
|
|
424
|
-
schema:
|
|
426
|
+
schema: Ce,
|
|
425
427
|
description: "A single product card with image, title, price, and actions."
|
|
426
428
|
},
|
|
427
429
|
AddToCartButton: {
|
|
428
|
-
schema:
|
|
430
|
+
schema: be,
|
|
429
431
|
description: "Add-to-cart CTA rendered inside or below a product card."
|
|
430
432
|
},
|
|
431
433
|
QuickActions: {
|
|
432
|
-
schema:
|
|
434
|
+
schema: ve,
|
|
433
435
|
description: "A row of quick-action buttons below product info."
|
|
434
436
|
},
|
|
435
437
|
EmptyState: {
|
|
436
|
-
schema:
|
|
438
|
+
schema: Ee,
|
|
437
439
|
description: "Empty state shown when no similar products are available."
|
|
438
440
|
}
|
|
439
441
|
}
|
|
440
442
|
};
|
|
441
|
-
class
|
|
443
|
+
class ke extends F {
|
|
442
444
|
constructor() {
|
|
443
|
-
super(...arguments), this._abortController = null, this._contentEl = null, this._i18n =
|
|
445
|
+
super(...arguments), this._abortController = null, this._contentEl = null, this._i18n = D;
|
|
444
446
|
}
|
|
445
447
|
async onInit(e) {
|
|
446
|
-
this._i18n = this._resolveI18n(e), this._contentEl = document.createElement("div"), this._contentEl.className = "gengage-simrel-container", this.root.appendChild(this._contentEl), this._lastSku = e.sku, await this._fetchAndRender(e.sku), this.isVisible = !0,
|
|
448
|
+
this._i18n = this._resolveI18n(e), this._contentEl = document.createElement("div"), this._contentEl.className = "gengage-simrel-container", this.root.appendChild(this._contentEl), this._lastSku = e.sku, await this._fetchAndRender(e.sku), this.isVisible = !0, J("simrel");
|
|
447
449
|
}
|
|
448
450
|
onUpdate(e) {
|
|
449
451
|
const t = e.sku;
|
|
@@ -469,7 +471,7 @@ class Ee extends $ {
|
|
|
469
471
|
url: e.url
|
|
470
472
|
};
|
|
471
473
|
if (e.imageUrl !== void 0 && (t.imageUrl = e.imageUrl), e.price !== void 0 && (t.price = e.price), e.originalPrice !== void 0 && (t.originalPrice = e.originalPrice), e.discountPercent !== void 0 && (t.discountPercent = e.discountPercent), e.brand !== void 0 && (t.brand = e.brand), e.rating !== void 0 && (t.rating = e.rating), e.reviewCount !== void 0 && (t.reviewCount = e.reviewCount), e.cartCode !== void 0 && (t.cartCode = e.cartCode), e.inStock !== void 0 && (t.inStock = e.inStock), this.config.onProductClick?.(t) === !1) return;
|
|
472
|
-
|
|
474
|
+
W(e.sku, e.name);
|
|
473
475
|
const r = this.config.session?.sessionId ?? null;
|
|
474
476
|
E("gengage:similar:product-click", {
|
|
475
477
|
sku: e.sku,
|
|
@@ -478,8 +480,8 @@ class Ee extends $ {
|
|
|
478
480
|
}), this.config.onProductNavigate?.(e.url, e.sku, r);
|
|
479
481
|
}
|
|
480
482
|
_handleAddToCart(e) {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
+
Q(e.sku, e.quantity), this.config.onAddToCart?.(e), E("gengage:similar:add-to-cart", e), this.track(
|
|
484
|
+
V(this.analyticsContext(), {
|
|
483
485
|
attribution_source: "simrel",
|
|
484
486
|
attribution_action_id: crypto.randomUUID(),
|
|
485
487
|
cart_value: 0,
|
|
@@ -505,51 +507,51 @@ class Ee extends $ {
|
|
|
505
507
|
r.className = "gengage-simrel-loading";
|
|
506
508
|
const i = document.createElement("div");
|
|
507
509
|
i.className = "gengage-simrel-spinner", r.appendChild(i), this._contentEl.appendChild(r);
|
|
508
|
-
const
|
|
510
|
+
const s = {
|
|
509
511
|
middlewareUrl: this.config.middlewareUrl
|
|
510
|
-
},
|
|
512
|
+
}, a = crypto.randomUUID(), p = Date.now();
|
|
511
513
|
this.track(
|
|
512
|
-
|
|
514
|
+
Y(this.analyticsContext(), {
|
|
513
515
|
endpoint: "similar_products",
|
|
514
|
-
request_id:
|
|
516
|
+
request_id: a,
|
|
515
517
|
widget: "simrel"
|
|
516
518
|
})
|
|
517
519
|
);
|
|
518
520
|
try {
|
|
519
|
-
const
|
|
521
|
+
const l = {
|
|
520
522
|
account_id: this.config.accountId,
|
|
521
523
|
session_id: this.config.session?.sessionId ?? "",
|
|
522
524
|
correlation_id: this.config.session?.sessionId ?? "",
|
|
523
525
|
sku: e
|
|
524
526
|
};
|
|
525
|
-
this.config.domain !== void 0 && (
|
|
526
|
-
const u = await
|
|
527
|
+
this.config.domain !== void 0 && (l.domain = this.config.domain);
|
|
528
|
+
const u = await oe(l, s, t);
|
|
527
529
|
if (!this._contentEl) return;
|
|
528
530
|
if (this._contentEl.innerHTML = "", u.length > 0)
|
|
529
531
|
try {
|
|
530
|
-
const c = u.map((h) => h.sku),
|
|
532
|
+
const c = u.map((h) => h.sku), g = await ae(
|
|
531
533
|
{
|
|
532
534
|
account_id: this.config.accountId,
|
|
533
535
|
session_id: this.config.session?.sessionId ?? "",
|
|
534
536
|
correlation_id: this.config.session?.sessionId ?? "",
|
|
535
537
|
skus: c
|
|
536
538
|
},
|
|
537
|
-
|
|
539
|
+
s,
|
|
538
540
|
t
|
|
539
541
|
);
|
|
540
|
-
if (
|
|
541
|
-
const h = this._buildGroupsSpec(
|
|
542
|
-
this._contentEl.appendChild(y),
|
|
543
|
-
|
|
544
|
-
request_id:
|
|
545
|
-
latency_ms: Date.now() -
|
|
546
|
-
chunk_count:
|
|
542
|
+
if (g.length > 0 && this._contentEl) {
|
|
543
|
+
const h = this._buildGroupsSpec(g), y = this._renderUISpec(h);
|
|
544
|
+
this._contentEl.appendChild(y), k("simrel"), this.track(
|
|
545
|
+
_(this.analyticsContext(), {
|
|
546
|
+
request_id: a,
|
|
547
|
+
latency_ms: Date.now() - p,
|
|
548
|
+
chunk_count: g.reduce((d, o) => d + o.products.length, 0),
|
|
547
549
|
widget: "simrel"
|
|
548
550
|
})
|
|
549
551
|
), this.track(
|
|
550
552
|
S(this.analyticsContext(), {
|
|
551
|
-
message_count:
|
|
552
|
-
history_ref:
|
|
553
|
+
message_count: g.reduce((d, o) => d + o.products.length, 0),
|
|
554
|
+
history_ref: a,
|
|
553
555
|
redaction_level: "none",
|
|
554
556
|
widget: "simrel"
|
|
555
557
|
})
|
|
@@ -559,35 +561,35 @@ class Ee extends $ {
|
|
|
559
561
|
} catch {
|
|
560
562
|
}
|
|
561
563
|
if (this._contentEl) {
|
|
562
|
-
const c = this._buildProductsSpec(u),
|
|
563
|
-
this._contentEl.appendChild(
|
|
564
|
+
const c = this._buildProductsSpec(u), g = this._renderUISpec(c);
|
|
565
|
+
this._contentEl.appendChild(g);
|
|
564
566
|
}
|
|
565
|
-
u.length > 0 &&
|
|
566
|
-
|
|
567
|
-
request_id:
|
|
568
|
-
latency_ms: Date.now() -
|
|
567
|
+
u.length > 0 && k("simrel"), this.track(
|
|
568
|
+
_(this.analyticsContext(), {
|
|
569
|
+
request_id: a,
|
|
570
|
+
latency_ms: Date.now() - p,
|
|
569
571
|
chunk_count: u.length,
|
|
570
572
|
widget: "simrel"
|
|
571
573
|
})
|
|
572
574
|
), this.track(
|
|
573
575
|
S(this.analyticsContext(), {
|
|
574
576
|
message_count: u.length,
|
|
575
|
-
history_ref:
|
|
577
|
+
history_ref: a,
|
|
576
578
|
redaction_level: "none",
|
|
577
579
|
widget: "simrel"
|
|
578
580
|
})
|
|
579
581
|
);
|
|
580
|
-
} catch (
|
|
581
|
-
if (
|
|
582
|
+
} catch (l) {
|
|
583
|
+
if (l instanceof DOMException && l.name === "AbortError") return;
|
|
582
584
|
if (E("gengage:global:error", {
|
|
583
585
|
source: "simrel",
|
|
584
586
|
code: "FETCH_ERROR",
|
|
585
|
-
message:
|
|
587
|
+
message: K(this.config.locale)
|
|
586
588
|
}), this.track(
|
|
587
|
-
|
|
588
|
-
request_id:
|
|
589
|
+
X(this.analyticsContext(), {
|
|
590
|
+
request_id: a,
|
|
589
591
|
error_code: "FETCH_ERROR",
|
|
590
|
-
error_message:
|
|
592
|
+
error_message: l instanceof Error ? l.message : String(l),
|
|
591
593
|
widget: "simrel"
|
|
592
594
|
})
|
|
593
595
|
), this._contentEl) {
|
|
@@ -596,19 +598,19 @@ class Ee extends $ {
|
|
|
596
598
|
u.className = "gengage-simrel-error", u.style.cssText = "text-align:center;padding:16px;color:#6b7280;font-size:13px;";
|
|
597
599
|
const c = document.createElement("span");
|
|
598
600
|
c.textContent = this.config.locale?.startsWith("tr") ? "Benzer ürünler yüklenemedi." : "Could not load similar products.", u.appendChild(c);
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
+
const g = document.createElement("button");
|
|
602
|
+
g.textContent = this.config.locale?.startsWith("tr") ? "Tekrar dene" : "Try again", g.style.cssText = "margin-left:8px;border:1px solid #d1d5db;background:#fff;border-radius:6px;padding:4px 12px;cursor:pointer;font-size:13px;color:#374151;", g.addEventListener("click", () => {
|
|
601
603
|
this._fetchAndRender(this.config.sku);
|
|
602
|
-
}), u.appendChild(
|
|
604
|
+
}), u.appendChild(g), this._contentEl.appendChild(u);
|
|
603
605
|
}
|
|
604
606
|
}
|
|
605
607
|
}
|
|
606
608
|
_resolveI18n(e) {
|
|
607
|
-
return { ...
|
|
609
|
+
return { ...fe(e.locale), ...e.i18n };
|
|
608
610
|
}
|
|
609
611
|
_resolveUISpecRegistry() {
|
|
610
|
-
const e =
|
|
611
|
-
return
|
|
612
|
+
const e = ue();
|
|
613
|
+
return Z(e, this.config.renderer?.registry);
|
|
612
614
|
}
|
|
613
615
|
_buildRenderContext() {
|
|
614
616
|
const e = this.config.renderCard, t = {
|
|
@@ -619,21 +621,21 @@ class Ee extends $ {
|
|
|
619
621
|
return this.config.discountType !== void 0 && (t.discountType = this.config.discountType), e !== void 0 && (t.renderCard = e), this.config.pricing !== void 0 && (t.pricing = this.config.pricing), t;
|
|
620
622
|
}
|
|
621
623
|
_renderUISpec(e) {
|
|
622
|
-
const t = this._resolveUISpecRegistry(), r = this._buildRenderContext(), i = this.config.renderer?.unknownRenderer ?? G,
|
|
623
|
-
return
|
|
624
|
+
const t = this._resolveUISpecRegistry(), r = this._buildRenderContext(), i = this.config.renderer?.unknownRenderer ?? G, s = (l, u) => ge(l, u, t, i), a = this.config.renderer?.renderUISpec;
|
|
625
|
+
return a ? a(e, r, {
|
|
624
626
|
registry: t,
|
|
625
627
|
unknownRenderer: i,
|
|
626
|
-
defaultRender:
|
|
627
|
-
}) :
|
|
628
|
+
defaultRender: s
|
|
629
|
+
}) : s(e, r);
|
|
628
630
|
}
|
|
629
631
|
_buildProductsSpec(e) {
|
|
630
632
|
const t = {}, r = [];
|
|
631
633
|
for (let i = 0; i < e.length; i++) {
|
|
632
|
-
const
|
|
633
|
-
r.push(
|
|
634
|
+
const s = e[i], a = `product-${i}`;
|
|
635
|
+
r.push(a), t[a] = {
|
|
634
636
|
type: "ProductCard",
|
|
635
637
|
props: {
|
|
636
|
-
product:
|
|
638
|
+
product: s,
|
|
637
639
|
index: i,
|
|
638
640
|
discountType: this.config.discountType
|
|
639
641
|
}
|
|
@@ -662,15 +664,15 @@ class Ee extends $ {
|
|
|
662
664
|
};
|
|
663
665
|
}
|
|
664
666
|
}
|
|
665
|
-
function
|
|
666
|
-
return new
|
|
667
|
+
function we() {
|
|
668
|
+
return new ke();
|
|
667
669
|
}
|
|
668
670
|
export {
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
671
|
+
ke as GengageSimRel,
|
|
672
|
+
ue as createDefaultSimRelUISpecRegistry,
|
|
673
|
+
we as createSimRelWidget,
|
|
672
674
|
G as defaultSimRelUnknownUISpecRenderer,
|
|
673
|
-
|
|
674
|
-
|
|
675
|
+
ge as renderSimRelUISpec,
|
|
676
|
+
Te as simRelCatalog
|
|
675
677
|
};
|
|
676
678
|
//# sourceMappingURL=simrel.js.map
|