tanya-chatbot 0.0.5 → 0.0.6
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/tanya-chatbot.cjs.js +10 -10
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +719 -720
- package/dist/tanya-chatbot.es.js.map +1 -1
- package/package.json +1 -1
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
2
|
-
import { forwardRef as Tt, useState as
|
|
1
|
+
import { jsx as c, jsxs as f, Fragment as Ge } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Tt, useState as D, useEffect as fe, createElement as We, useRef as Ce } from "react";
|
|
3
3
|
import * as _t from "@radix-ui/react-popover";
|
|
4
4
|
import "clsx";
|
|
5
5
|
import "tailwind-merge";
|
|
6
|
-
import
|
|
6
|
+
import M from "axios";
|
|
7
7
|
import "crypto-js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { createSlice as nn } from "@reduxjs/toolkit";
|
|
8
|
+
import { useDispatch as Pt, useSelector as je } from "react-redux";
|
|
9
|
+
import { createSlice as en } from "@reduxjs/toolkit";
|
|
11
10
|
import { Icon as at } from "@iconify/react";
|
|
12
|
-
import { toast as
|
|
13
|
-
const
|
|
11
|
+
import { toast as Q } from "react-toastify";
|
|
12
|
+
const ve = (e) => {
|
|
14
13
|
const t = new CustomEvent("reactCartUpdated", {
|
|
15
14
|
detail: {
|
|
16
15
|
cartUpdated: !0,
|
|
@@ -20,12 +19,12 @@ const be = (e) => {
|
|
|
20
19
|
});
|
|
21
20
|
window.dispatchEvent(t);
|
|
22
21
|
};
|
|
23
|
-
function
|
|
22
|
+
function tn({
|
|
24
23
|
...e
|
|
25
24
|
}) {
|
|
26
25
|
return /* @__PURE__ */ c(_t.Root, { "data-slot": "popover", ...e });
|
|
27
26
|
}
|
|
28
|
-
function
|
|
27
|
+
function nn({
|
|
29
28
|
...e
|
|
30
29
|
}) {
|
|
31
30
|
return /* @__PURE__ */ c(_t.Trigger, { "data-slot": "popover-trigger", ...e });
|
|
@@ -33,18 +32,18 @@ function rn({
|
|
|
33
32
|
const pe = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream", xAPIKey: "BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi", serverUrl: "https://tanya-sfcc-server.vercel.app/", basePath: "sc-api" }), Et = async () => {
|
|
34
33
|
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
35
34
|
try {
|
|
36
|
-
const t = await
|
|
37
|
-
`${e}api/auth/token-bm-grant?baseUrl=${
|
|
35
|
+
const t = await M.post(
|
|
36
|
+
`${e}api/auth/token-bm-grant?baseUrl=${se()}&siteId=${ee()}`
|
|
38
37
|
);
|
|
39
38
|
return t.status === 200 && t.data.access_token ? t.data.access_token : (console.error("Failed to fetch token:", t.data), null);
|
|
40
39
|
} catch (t) {
|
|
41
|
-
return
|
|
40
|
+
return M.isAxiosError(t) ? console.error("Error fetching token:", t.response || t.message) : console.error("Unexpected error:", t), null;
|
|
42
41
|
}
|
|
43
42
|
}, $t = async (e) => {
|
|
44
43
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
45
44
|
try {
|
|
46
|
-
const n = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, r = await
|
|
47
|
-
`${t}api/auth/token-existing-guest-customer?dwsid=${n}&baseUrl=${
|
|
45
|
+
const n = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, r = await M.post(
|
|
46
|
+
`${t}api/auth/token-existing-guest-customer?dwsid=${n}&baseUrl=${se()}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
|
|
48
47
|
{},
|
|
49
48
|
{
|
|
50
49
|
headers: {
|
|
@@ -55,10 +54,10 @@ const pe = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
55
54
|
);
|
|
56
55
|
return r.status === 200 && r.data ? r.data : null;
|
|
57
56
|
} catch (n) {
|
|
58
|
-
return
|
|
57
|
+
return M.isAxiosError(n) ? console.error("Error creating basket:", n.response || n.message) : console.error("Unexpected error:", n), null;
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
|
-
async function
|
|
60
|
+
async function Me() {
|
|
62
61
|
const e = localStorage.getItem("expires_in"), t = localStorage.getItem("access_token"), n = JSON.parse(
|
|
63
62
|
sessionStorage.getItem("customerData") || "{}"
|
|
64
63
|
).isGuest;
|
|
@@ -70,8 +69,8 @@ async function Be() {
|
|
|
70
69
|
sessionStorage.getItem("customerData") || "{}"
|
|
71
70
|
).usrRef;
|
|
72
71
|
try {
|
|
73
|
-
const i = n ? "unregister-auth" : "register-auth", l = await
|
|
74
|
-
`${r}sc-api/${i}?dwsid=${o}&email=${s}&pubCfg=${
|
|
72
|
+
const i = n ? "unregister-auth" : "register-auth", l = await M.get(
|
|
73
|
+
`${r}sc-api/${i}?dwsid=${o}&email=${s}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}&siteId=${ee()}`
|
|
75
74
|
);
|
|
76
75
|
return localStorage.setItem("access_token", l.data.access_token), localStorage.setItem(
|
|
77
76
|
"expires_in",
|
|
@@ -81,12 +80,12 @@ async function Be() {
|
|
|
81
80
|
console.log(i);
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
|
-
const
|
|
83
|
+
const se = () => sessionStorage.getItem("Host"), ee = () => sessionStorage.getItem("SiteId"), ie = () => sessionStorage.getItem("pubCfg"), ae = () => sessionStorage.getItem("envRef"), ce = () => sessionStorage.getItem("orgRef"), ct = async (e, t) => {
|
|
85
84
|
const { serverUrl: n, basePath: r } = pe();
|
|
86
85
|
try {
|
|
87
|
-
const o =
|
|
88
|
-
return (await
|
|
89
|
-
`${n}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${
|
|
86
|
+
const o = se();
|
|
87
|
+
return (await M.get(
|
|
88
|
+
`${n}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
|
|
90
89
|
{
|
|
91
90
|
headers: {
|
|
92
91
|
"Content-Type": "application/json",
|
|
@@ -99,11 +98,11 @@ const ie = () => sessionStorage.getItem("Host"), X = () => sessionStorage.getIte
|
|
|
99
98
|
}
|
|
100
99
|
}, At = async (e) => {
|
|
101
100
|
if (!e) throw new Error("Product ID is required");
|
|
102
|
-
const { serverUrl: t, basePath: n } = pe(), r =
|
|
101
|
+
const { serverUrl: t, basePath: n } = pe(), r = se();
|
|
103
102
|
console.log("calling access");
|
|
104
|
-
const { access_token: o } = await
|
|
105
|
-
return console.log(o), (await
|
|
106
|
-
`${t}${n}/product-sfcc/${e}?baseUrl=${r}&siteId=${
|
|
103
|
+
const { access_token: o } = await Me();
|
|
104
|
+
return console.log(o), (await M.get(
|
|
105
|
+
`${t}${n}/product-sfcc/${e}?baseUrl=${r}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
|
|
107
106
|
{
|
|
108
107
|
headers: {
|
|
109
108
|
"Content-Type": "application/json",
|
|
@@ -111,13 +110,13 @@ const ie = () => sessionStorage.getItem("Host"), X = () => sessionStorage.getIte
|
|
|
111
110
|
}
|
|
112
111
|
}
|
|
113
112
|
)).data;
|
|
114
|
-
},
|
|
113
|
+
}, on = async (e) => {
|
|
115
114
|
if (!e) throw new Error("customerId is required");
|
|
116
115
|
const t = await Et(), { customer_token: n } = await $t(
|
|
117
116
|
t
|
|
118
|
-
), { serverUrl: r, basePath: o } = pe(), i = (await
|
|
119
|
-
return (await
|
|
120
|
-
`${r}${o}/get-interest?baseUrl=${
|
|
117
|
+
), { serverUrl: r, basePath: o } = pe(), i = (await Me()).access_token;
|
|
118
|
+
return (await M.get(
|
|
119
|
+
`${r}${o}/get-interest?baseUrl=${se()}&customerId=${e}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
|
|
121
120
|
{
|
|
122
121
|
headers: {
|
|
123
122
|
"Content-Type": "application/json",
|
|
@@ -125,10 +124,10 @@ const ie = () => sessionStorage.getItem("Host"), X = () => sessionStorage.getIte
|
|
|
125
124
|
}
|
|
126
125
|
}
|
|
127
126
|
)).data;
|
|
128
|
-
}, lt = (e) => String(typeof e == "string" ? e : e["en-US"] || e),
|
|
127
|
+
}, lt = (e) => String(typeof e == "string" ? e : e["en-US"] || e), dt = (e) => e != null && e.image ? [e.image] : "variants" in e ? e.variants[0].images : e.masterVariant.images.map((t) => t.url), rn = (e, t) => e.toLocaleString("en-US", {
|
|
129
128
|
style: "currency",
|
|
130
129
|
currency: t || "USD"
|
|
131
|
-
}),
|
|
130
|
+
}), ut = (e) => {
|
|
132
131
|
var t, n, r;
|
|
133
132
|
return "variants" in e ? {
|
|
134
133
|
centAmount: (t = e.variants[0]) == null ? void 0 : t.prices.EUR.max,
|
|
@@ -137,11 +136,11 @@ const ie = () => sessionStorage.getItem("Host"), X = () => sessionStorage.getIte
|
|
|
137
136
|
centAmount: (n = e.masterVariant) == null ? void 0 : n.prices[0].value.centAmount,
|
|
138
137
|
currencyCode: (r = e.masterVariant) == null ? void 0 : r.prices[0].value.currencyCode
|
|
139
138
|
};
|
|
140
|
-
},
|
|
139
|
+
}, sn = (e) => e.charAt(0).toUpperCase() + e.slice(1), ft = (e, t) => e.length < t ? e : e.slice(0, t) + "...", Ve = (e) => e.split("\\n").map((t, n) => {
|
|
141
140
|
const r = t.match(/^(\d+)\.\s(.+)/);
|
|
142
141
|
return r ? `<p key=${n} class="mb-2"><strong>${r[1]}.</strong> ${r[2]}</p>` : t.trim() ? `<p key=${n} class="mb-2">${t}</p>` : "<br/>";
|
|
143
142
|
}).join("");
|
|
144
|
-
function
|
|
143
|
+
function an(e, t) {
|
|
145
144
|
const n = e.icons, r = e.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
|
|
146
145
|
function s(i) {
|
|
147
146
|
if (n[i]) return o[i] = [];
|
|
@@ -159,30 +158,30 @@ const Lt = Object.freeze({
|
|
|
159
158
|
top: 0,
|
|
160
159
|
width: 16,
|
|
161
160
|
height: 16
|
|
162
|
-
}),
|
|
161
|
+
}), Oe = Object.freeze({
|
|
163
162
|
rotate: 0,
|
|
164
163
|
vFlip: !1,
|
|
165
164
|
hFlip: !1
|
|
166
165
|
}), tt = Object.freeze({
|
|
167
166
|
...Lt,
|
|
168
|
-
...
|
|
167
|
+
...Oe
|
|
169
168
|
}), Qe = Object.freeze({
|
|
170
169
|
...tt,
|
|
171
170
|
body: "",
|
|
172
171
|
hidden: !1
|
|
173
172
|
});
|
|
174
|
-
function
|
|
173
|
+
function cn(e, t) {
|
|
175
174
|
const n = {};
|
|
176
175
|
!e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
|
|
177
176
|
const r = ((e.rotate || 0) + (t.rotate || 0)) % 4;
|
|
178
177
|
return r && (n.rotate = r), n;
|
|
179
178
|
}
|
|
180
179
|
function pt(e, t) {
|
|
181
|
-
const n =
|
|
182
|
-
for (const r in Qe) r in
|
|
180
|
+
const n = cn(e, t);
|
|
181
|
+
for (const r in Qe) r in Oe ? r in e && !(r in n) && (n[r] = Oe[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
|
|
183
182
|
return n;
|
|
184
183
|
}
|
|
185
|
-
function
|
|
184
|
+
function ln(e, t, n) {
|
|
186
185
|
const r = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
187
186
|
let s = {};
|
|
188
187
|
function i(l) {
|
|
@@ -196,14 +195,14 @@ function jt(e, t) {
|
|
|
196
195
|
e.not_found instanceof Array && e.not_found.forEach((o) => {
|
|
197
196
|
t(o, null), n.push(o);
|
|
198
197
|
});
|
|
199
|
-
const r =
|
|
198
|
+
const r = an(e);
|
|
200
199
|
for (const o in r) {
|
|
201
200
|
const s = r[o];
|
|
202
|
-
s && (t(o,
|
|
201
|
+
s && (t(o, ln(e, o, s)), n.push(o));
|
|
203
202
|
}
|
|
204
203
|
return n;
|
|
205
204
|
}
|
|
206
|
-
const
|
|
205
|
+
const dn = {
|
|
207
206
|
provider: "",
|
|
208
207
|
aliases: {},
|
|
209
208
|
not_found: {},
|
|
@@ -216,7 +215,7 @@ function Je(e, t) {
|
|
|
216
215
|
function Ot(e) {
|
|
217
216
|
if (typeof e != "object" || e === null) return null;
|
|
218
217
|
const t = e;
|
|
219
|
-
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !Je(e,
|
|
218
|
+
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !Je(e, dn)) return null;
|
|
220
219
|
const n = t.icons;
|
|
221
220
|
for (const o in n) {
|
|
222
221
|
const s = n[o];
|
|
@@ -230,7 +229,7 @@ function Ot(e) {
|
|
|
230
229
|
return t;
|
|
231
230
|
}
|
|
232
231
|
const ht = /* @__PURE__ */ Object.create(null);
|
|
233
|
-
function
|
|
232
|
+
function un(e, t) {
|
|
234
233
|
return {
|
|
235
234
|
provider: e,
|
|
236
235
|
prefix: t,
|
|
@@ -238,16 +237,16 @@ function pn(e, t) {
|
|
|
238
237
|
missing: /* @__PURE__ */ new Set()
|
|
239
238
|
};
|
|
240
239
|
}
|
|
241
|
-
function
|
|
240
|
+
function Ie(e, t) {
|
|
242
241
|
const n = ht[e] || (ht[e] = /* @__PURE__ */ Object.create(null));
|
|
243
|
-
return n[t] || (n[t] =
|
|
242
|
+
return n[t] || (n[t] = un(e, t));
|
|
244
243
|
}
|
|
245
244
|
function Dt(e, t) {
|
|
246
245
|
return Ot(t) ? jt(t, (n, r) => {
|
|
247
246
|
r ? e.icons[n] = r : e.missing.add(n);
|
|
248
247
|
}) : [];
|
|
249
248
|
}
|
|
250
|
-
function
|
|
249
|
+
function fn(e, t, n) {
|
|
251
250
|
try {
|
|
252
251
|
if (typeof n.body == "string")
|
|
253
252
|
return e.icons[t] = { ...n }, !0;
|
|
@@ -255,7 +254,7 @@ function hn(e, t, n) {
|
|
|
255
254
|
}
|
|
256
255
|
return !1;
|
|
257
256
|
}
|
|
258
|
-
const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/,
|
|
257
|
+
const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/, Be = (e, t, n, r = "") => {
|
|
259
258
|
const o = e.split(":");
|
|
260
259
|
if (e.slice(0, 1) === "@") {
|
|
261
260
|
if (o.length < 2 || o.length > 3) return null;
|
|
@@ -263,12 +262,12 @@ const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/, He = (e, t, n, r = "") => {
|
|
|
263
262
|
}
|
|
264
263
|
if (o.length > 3 || !o.length) return null;
|
|
265
264
|
if (o.length > 1) {
|
|
266
|
-
const l = o.pop(), a = o.pop(),
|
|
265
|
+
const l = o.pop(), a = o.pop(), u = {
|
|
267
266
|
provider: o.length > 0 ? o[0] : r,
|
|
268
267
|
prefix: a,
|
|
269
268
|
name: l
|
|
270
269
|
};
|
|
271
|
-
return t && !
|
|
270
|
+
return t && !Ae(u) ? null : u;
|
|
272
271
|
}
|
|
273
272
|
const s = o[0], i = s.split("-");
|
|
274
273
|
if (i.length > 1) {
|
|
@@ -277,7 +276,7 @@ const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/, He = (e, t, n, r = "") => {
|
|
|
277
276
|
prefix: i.shift(),
|
|
278
277
|
name: i.join("-")
|
|
279
278
|
};
|
|
280
|
-
return t && !
|
|
279
|
+
return t && !Ae(l) ? null : l;
|
|
281
280
|
}
|
|
282
281
|
if (n && r === "") {
|
|
283
282
|
const l = {
|
|
@@ -285,41 +284,41 @@ const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/, He = (e, t, n, r = "") => {
|
|
|
285
284
|
prefix: "",
|
|
286
285
|
name: s
|
|
287
286
|
};
|
|
288
|
-
return t && !
|
|
287
|
+
return t && !Ae(l, n) ? null : l;
|
|
289
288
|
}
|
|
290
289
|
return null;
|
|
291
|
-
},
|
|
292
|
-
let
|
|
290
|
+
}, Ae = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
|
|
291
|
+
let Pe = !1;
|
|
293
292
|
function Mt(e) {
|
|
294
|
-
return typeof e == "boolean" && (
|
|
293
|
+
return typeof e == "boolean" && (Pe = e), Pe;
|
|
295
294
|
}
|
|
296
295
|
function mt(e) {
|
|
297
|
-
const t = typeof e == "string" ?
|
|
296
|
+
const t = typeof e == "string" ? Be(e, !0, Pe) : e;
|
|
298
297
|
if (t) {
|
|
299
|
-
const n =
|
|
298
|
+
const n = Ie(t.provider, t.prefix), r = t.name;
|
|
300
299
|
return n.icons[r] || (n.missing.has(r) ? null : void 0);
|
|
301
300
|
}
|
|
302
301
|
}
|
|
303
|
-
function
|
|
304
|
-
const n =
|
|
302
|
+
function pn(e, t) {
|
|
303
|
+
const n = Be(e, !0, Pe);
|
|
305
304
|
if (!n) return !1;
|
|
306
|
-
const r =
|
|
307
|
-
return t ?
|
|
305
|
+
const r = Ie(n.provider, n.prefix);
|
|
306
|
+
return t ? fn(r, n.name, t) : (r.missing.add(n.name), !0);
|
|
308
307
|
}
|
|
309
|
-
function
|
|
308
|
+
function hn(e, t) {
|
|
310
309
|
if (typeof e != "object") return !1;
|
|
311
|
-
if (typeof t != "string" && (t = e.provider || ""),
|
|
310
|
+
if (typeof t != "string" && (t = e.provider || ""), Pe && !t && !e.prefix) {
|
|
312
311
|
let o = !1;
|
|
313
312
|
return Ot(e) && (e.prefix = "", jt(e, (s, i) => {
|
|
314
|
-
|
|
313
|
+
pn(s, i) && (o = !0);
|
|
315
314
|
})), o;
|
|
316
315
|
}
|
|
317
316
|
const n = e.prefix;
|
|
318
|
-
if (!
|
|
317
|
+
if (!Ae({
|
|
319
318
|
prefix: n,
|
|
320
319
|
name: "a"
|
|
321
320
|
})) return !1;
|
|
322
|
-
const r =
|
|
321
|
+
const r = Ie(t, n);
|
|
323
322
|
return !!Dt(r, e);
|
|
324
323
|
}
|
|
325
324
|
const Bt = Object.freeze({
|
|
@@ -327,16 +326,16 @@ const Bt = Object.freeze({
|
|
|
327
326
|
height: null
|
|
328
327
|
}), Ht = Object.freeze({
|
|
329
328
|
...Bt,
|
|
330
|
-
...
|
|
331
|
-
}),
|
|
329
|
+
...Oe
|
|
330
|
+
}), mn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, gn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
332
331
|
function gt(e, t, n) {
|
|
333
332
|
if (t === 1) return e;
|
|
334
333
|
if (n = n || 100, typeof e == "number") return Math.ceil(e * t * n) / n;
|
|
335
334
|
if (typeof e != "string") return e;
|
|
336
|
-
const r = e.split(
|
|
335
|
+
const r = e.split(mn);
|
|
337
336
|
if (r === null || !r.length) return e;
|
|
338
337
|
const o = [];
|
|
339
|
-
let s = r.shift(), i =
|
|
338
|
+
let s = r.shift(), i = gn.test(s);
|
|
340
339
|
for (; ; ) {
|
|
341
340
|
if (i) {
|
|
342
341
|
const l = parseFloat(s);
|
|
@@ -346,7 +345,7 @@ function gt(e, t, n) {
|
|
|
346
345
|
i = !i;
|
|
347
346
|
}
|
|
348
347
|
}
|
|
349
|
-
function
|
|
348
|
+
function yn(e, t = "defs") {
|
|
350
349
|
let n = "";
|
|
351
350
|
const r = e.indexOf("<" + t);
|
|
352
351
|
for (; r >= 0; ) {
|
|
@@ -361,15 +360,15 @@ function wn(e, t = "defs") {
|
|
|
361
360
|
content: e
|
|
362
361
|
};
|
|
363
362
|
}
|
|
364
|
-
function
|
|
363
|
+
function xn(e, t) {
|
|
365
364
|
return e ? "<defs>" + e + "</defs>" + t : t;
|
|
366
365
|
}
|
|
367
|
-
function
|
|
368
|
-
const r =
|
|
369
|
-
return
|
|
366
|
+
function wn(e, t, n) {
|
|
367
|
+
const r = yn(e);
|
|
368
|
+
return xn(r.defs, t + r.content + n);
|
|
370
369
|
}
|
|
371
|
-
const
|
|
372
|
-
function
|
|
370
|
+
const bn = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
371
|
+
function vn(e, t) {
|
|
373
372
|
const n = {
|
|
374
373
|
...tt,
|
|
375
374
|
...e
|
|
@@ -383,58 +382,58 @@ function In(e, t) {
|
|
|
383
382
|
height: n.height
|
|
384
383
|
};
|
|
385
384
|
let s = n.body;
|
|
386
|
-
[n, r].forEach((
|
|
387
|
-
const
|
|
388
|
-
let
|
|
389
|
-
v ?
|
|
390
|
-
let
|
|
391
|
-
switch (
|
|
385
|
+
[n, r].forEach((F) => {
|
|
386
|
+
const m = [], v = F.hFlip, U = F.vFlip;
|
|
387
|
+
let E = F.rotate;
|
|
388
|
+
v ? U ? E += 2 : (m.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), m.push("scale(-1 1)"), o.top = o.left = 0) : U && (m.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), m.push("scale(1 -1)"), o.top = o.left = 0);
|
|
389
|
+
let L;
|
|
390
|
+
switch (E < 0 && (E -= Math.floor(E / 4) * 4), E = E % 4, E) {
|
|
392
391
|
case 1:
|
|
393
|
-
|
|
392
|
+
L = o.height / 2 + o.top, m.unshift("rotate(90 " + L.toString() + " " + L.toString() + ")");
|
|
394
393
|
break;
|
|
395
394
|
case 2:
|
|
396
|
-
|
|
395
|
+
m.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
|
|
397
396
|
break;
|
|
398
397
|
case 3:
|
|
399
|
-
|
|
398
|
+
L = o.width / 2 + o.left, m.unshift("rotate(-90 " + L.toString() + " " + L.toString() + ")");
|
|
400
399
|
break;
|
|
401
400
|
}
|
|
402
|
-
|
|
401
|
+
E % 2 === 1 && (o.left !== o.top && (L = o.left, o.left = o.top, o.top = L), o.width !== o.height && (L = o.width, o.width = o.height, o.height = L)), m.length && (s = wn(s, '<g transform="' + m.join(" ") + '">', "</g>"));
|
|
403
402
|
});
|
|
404
|
-
const i = r.width, l = r.height, a = o.width,
|
|
405
|
-
let
|
|
406
|
-
i === null ? (
|
|
407
|
-
const b = {},
|
|
408
|
-
|
|
403
|
+
const i = r.width, l = r.height, a = o.width, u = o.height;
|
|
404
|
+
let p, g;
|
|
405
|
+
i === null ? (g = l === null ? "1em" : l === "auto" ? u : l, p = gt(g, a / u)) : (p = i === "auto" ? a : i, g = l === null ? gt(p, u / a) : l === "auto" ? u : l);
|
|
406
|
+
const b = {}, h = (F, m) => {
|
|
407
|
+
bn(m) || (b[F] = m.toString());
|
|
409
408
|
};
|
|
410
|
-
|
|
411
|
-
const
|
|
409
|
+
h("width", p), h("height", g);
|
|
410
|
+
const k = [
|
|
412
411
|
o.left,
|
|
413
412
|
o.top,
|
|
414
413
|
a,
|
|
415
|
-
|
|
414
|
+
u
|
|
416
415
|
];
|
|
417
|
-
return b.viewBox =
|
|
416
|
+
return b.viewBox = k.join(" "), {
|
|
418
417
|
attributes: b,
|
|
419
|
-
viewBox:
|
|
418
|
+
viewBox: k,
|
|
420
419
|
body: s
|
|
421
420
|
};
|
|
422
421
|
}
|
|
423
|
-
const
|
|
424
|
-
let
|
|
425
|
-
function
|
|
422
|
+
const kn = /\sid="(\S+)"/g, In = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
423
|
+
let Sn = 0;
|
|
424
|
+
function Cn(e, t = In) {
|
|
426
425
|
const n = [];
|
|
427
426
|
let r;
|
|
428
|
-
for (; r =
|
|
427
|
+
for (; r = kn.exec(e); ) n.push(r[1]);
|
|
429
428
|
if (!n.length) return e;
|
|
430
429
|
const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
431
430
|
return n.forEach((s) => {
|
|
432
|
-
const i = typeof t == "function" ? t(s) : t + (
|
|
431
|
+
const i = typeof t == "function" ? t(s) : t + (Sn++).toString(), l = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
433
432
|
e = e.replace(new RegExp('([#;"])(' + l + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
|
|
434
433
|
}), e = e.replace(new RegExp(o, "g"), ""), e;
|
|
435
434
|
}
|
|
436
435
|
const Ye = /* @__PURE__ */ Object.create(null);
|
|
437
|
-
function
|
|
436
|
+
function Fn(e, t) {
|
|
438
437
|
Ye[e] = t;
|
|
439
438
|
}
|
|
440
439
|
function Ze(e) {
|
|
@@ -455,25 +454,25 @@ function nt(e) {
|
|
|
455
454
|
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
456
455
|
};
|
|
457
456
|
}
|
|
458
|
-
const ot = /* @__PURE__ */ Object.create(null),
|
|
459
|
-
for (;
|
|
460
|
-
ot[""] = nt({ resources: ["https://api.iconify.design"].concat(
|
|
461
|
-
function
|
|
457
|
+
const ot = /* @__PURE__ */ Object.create(null), Fe = ["https://api.simplesvg.com", "https://api.unisvg.com"], Le = [];
|
|
458
|
+
for (; Fe.length > 0; ) Fe.length === 1 || Math.random() > 0.5 ? Le.push(Fe.shift()) : Le.push(Fe.pop());
|
|
459
|
+
ot[""] = nt({ resources: ["https://api.iconify.design"].concat(Le) });
|
|
460
|
+
function Nn(e, t) {
|
|
462
461
|
const n = nt(t);
|
|
463
462
|
return n === null ? !1 : (ot[e] = n, !0);
|
|
464
463
|
}
|
|
465
464
|
function rt(e) {
|
|
466
465
|
return ot[e];
|
|
467
466
|
}
|
|
468
|
-
const
|
|
467
|
+
const Tn = () => {
|
|
469
468
|
let e;
|
|
470
469
|
try {
|
|
471
470
|
if (e = fetch, typeof e == "function") return e;
|
|
472
471
|
} catch {
|
|
473
472
|
}
|
|
474
473
|
};
|
|
475
|
-
let yt =
|
|
476
|
-
function
|
|
474
|
+
let yt = Tn();
|
|
475
|
+
function _n(e, t) {
|
|
477
476
|
const n = rt(e);
|
|
478
477
|
if (!n) return 0;
|
|
479
478
|
let r;
|
|
@@ -488,19 +487,19 @@ function En(e, t) {
|
|
|
488
487
|
}
|
|
489
488
|
return r;
|
|
490
489
|
}
|
|
491
|
-
function
|
|
490
|
+
function Pn(e) {
|
|
492
491
|
return e === 404;
|
|
493
492
|
}
|
|
494
|
-
const
|
|
495
|
-
const r = [], o =
|
|
493
|
+
const En = (e, t, n) => {
|
|
494
|
+
const r = [], o = _n(e, t), s = "icons";
|
|
496
495
|
let i = {
|
|
497
496
|
type: s,
|
|
498
497
|
provider: e,
|
|
499
498
|
prefix: t,
|
|
500
499
|
icons: []
|
|
501
500
|
}, l = 0;
|
|
502
|
-
return n.forEach((a,
|
|
503
|
-
l += a.length + 1, l >= o &&
|
|
501
|
+
return n.forEach((a, u) => {
|
|
502
|
+
l += a.length + 1, l >= o && u > 0 && (r.push(i), i = {
|
|
504
503
|
type: s,
|
|
505
504
|
provider: e,
|
|
506
505
|
prefix: t,
|
|
@@ -508,19 +507,19 @@ const An = (e, t, n) => {
|
|
|
508
507
|
}, l = a.length), i.icons.push(a);
|
|
509
508
|
}), r.push(i), r;
|
|
510
509
|
};
|
|
511
|
-
function
|
|
510
|
+
function $n(e) {
|
|
512
511
|
if (typeof e == "string") {
|
|
513
512
|
const t = rt(e);
|
|
514
513
|
if (t) return t.path;
|
|
515
514
|
}
|
|
516
515
|
return "/";
|
|
517
516
|
}
|
|
518
|
-
const
|
|
517
|
+
const An = (e, t, n) => {
|
|
519
518
|
if (!yt) {
|
|
520
519
|
n("abort", 424);
|
|
521
520
|
return;
|
|
522
521
|
}
|
|
523
|
-
let r =
|
|
522
|
+
let r = $n(t.provider);
|
|
524
523
|
switch (t.type) {
|
|
525
524
|
case "icons": {
|
|
526
525
|
const s = t.prefix, l = t.icons.join(","), a = new URLSearchParams({ icons: l });
|
|
@@ -541,7 +540,7 @@ const jn = (e, t, n) => {
|
|
|
541
540
|
const i = s.status;
|
|
542
541
|
if (i !== 200) {
|
|
543
542
|
setTimeout(() => {
|
|
544
|
-
n(
|
|
543
|
+
n(Pn(i) ? "abort" : "next", i);
|
|
545
544
|
});
|
|
546
545
|
return;
|
|
547
546
|
}
|
|
@@ -559,9 +558,9 @@ const jn = (e, t, n) => {
|
|
|
559
558
|
}).catch(() => {
|
|
560
559
|
n("next", o);
|
|
561
560
|
});
|
|
562
|
-
},
|
|
563
|
-
prepare:
|
|
564
|
-
send:
|
|
561
|
+
}, Ln = {
|
|
562
|
+
prepare: En,
|
|
563
|
+
send: An
|
|
565
564
|
};
|
|
566
565
|
function qt(e, t) {
|
|
567
566
|
e.forEach((n) => {
|
|
@@ -569,7 +568,7 @@ function qt(e, t) {
|
|
|
569
568
|
r && (n.loaderCallbacks = r.filter((o) => o.id !== t));
|
|
570
569
|
});
|
|
571
570
|
}
|
|
572
|
-
function
|
|
571
|
+
function jn(e) {
|
|
573
572
|
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
574
573
|
e.pendingCallbacksFlag = !1;
|
|
575
574
|
const t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
|
@@ -580,16 +579,16 @@ function Dn(e) {
|
|
|
580
579
|
const i = s.icons, l = i.pending.length;
|
|
581
580
|
i.pending = i.pending.filter((a) => {
|
|
582
581
|
if (a.prefix !== o) return !0;
|
|
583
|
-
const
|
|
584
|
-
if (e.icons[
|
|
582
|
+
const u = a.name;
|
|
583
|
+
if (e.icons[u]) i.loaded.push({
|
|
585
584
|
provider: r,
|
|
586
585
|
prefix: o,
|
|
587
|
-
name:
|
|
586
|
+
name: u
|
|
588
587
|
});
|
|
589
|
-
else if (e.missing.has(
|
|
588
|
+
else if (e.missing.has(u)) i.missing.push({
|
|
590
589
|
provider: r,
|
|
591
590
|
prefix: o,
|
|
592
|
-
name:
|
|
591
|
+
name: u
|
|
593
592
|
});
|
|
594
593
|
else
|
|
595
594
|
return n = !0, !0;
|
|
@@ -598,9 +597,9 @@ function Dn(e) {
|
|
|
598
597
|
});
|
|
599
598
|
}));
|
|
600
599
|
}
|
|
601
|
-
let
|
|
602
|
-
function
|
|
603
|
-
const r =
|
|
600
|
+
let On = 0;
|
|
601
|
+
function Dn(e, t, n) {
|
|
602
|
+
const r = On++, o = qt.bind(null, n, r);
|
|
604
603
|
if (!t.pending.length) return o;
|
|
605
604
|
const s = {
|
|
606
605
|
id: r,
|
|
@@ -612,7 +611,7 @@ function Mn(e, t, n) {
|
|
|
612
611
|
(i.loaderCallbacks || (i.loaderCallbacks = [])).push(s);
|
|
613
612
|
}), o;
|
|
614
613
|
}
|
|
615
|
-
function
|
|
614
|
+
function Un(e) {
|
|
616
615
|
const t = {
|
|
617
616
|
loaded: [],
|
|
618
617
|
missing: [],
|
|
@@ -627,25 +626,25 @@ function Bn(e) {
|
|
|
627
626
|
return e.forEach((o) => {
|
|
628
627
|
if (r.name === o.name && r.prefix === o.prefix && r.provider === o.provider) return;
|
|
629
628
|
r = o;
|
|
630
|
-
const s = o.provider, i = o.prefix, l = o.name, a = n[s] || (n[s] = /* @__PURE__ */ Object.create(null)),
|
|
631
|
-
let
|
|
632
|
-
l in
|
|
633
|
-
const
|
|
629
|
+
const s = o.provider, i = o.prefix, l = o.name, a = n[s] || (n[s] = /* @__PURE__ */ Object.create(null)), u = a[i] || (a[i] = Ie(s, i));
|
|
630
|
+
let p;
|
|
631
|
+
l in u.icons ? p = t.loaded : i === "" || u.missing.has(l) ? p = t.missing : p = t.pending;
|
|
632
|
+
const g = {
|
|
634
633
|
provider: s,
|
|
635
634
|
prefix: i,
|
|
636
635
|
name: l
|
|
637
636
|
};
|
|
638
|
-
|
|
637
|
+
p.push(g);
|
|
639
638
|
}), t;
|
|
640
639
|
}
|
|
641
|
-
function
|
|
640
|
+
function Mn(e, t = !0, n = !1) {
|
|
642
641
|
const r = [];
|
|
643
642
|
return e.forEach((o) => {
|
|
644
|
-
const s = typeof o == "string" ?
|
|
643
|
+
const s = typeof o == "string" ? Be(o, t, n) : o;
|
|
645
644
|
s && r.push(s);
|
|
646
645
|
}), r;
|
|
647
646
|
}
|
|
648
|
-
const
|
|
647
|
+
const Bn = {
|
|
649
648
|
resources: [],
|
|
650
649
|
index: 0,
|
|
651
650
|
timeout: 2e3,
|
|
@@ -653,118 +652,118 @@ const qn = {
|
|
|
653
652
|
random: !1,
|
|
654
653
|
dataAfterTimeout: !1
|
|
655
654
|
};
|
|
656
|
-
function
|
|
655
|
+
function Hn(e, t, n, r) {
|
|
657
656
|
const o = e.resources.length, s = e.random ? Math.floor(Math.random() * o) : e.index;
|
|
658
657
|
let i;
|
|
659
658
|
if (e.random) {
|
|
660
|
-
let
|
|
661
|
-
for (i = [];
|
|
662
|
-
const
|
|
663
|
-
i.push(
|
|
659
|
+
let I = e.resources.slice(0);
|
|
660
|
+
for (i = []; I.length > 1; ) {
|
|
661
|
+
const O = Math.floor(Math.random() * I.length);
|
|
662
|
+
i.push(I[O]), I = I.slice(0, O).concat(I.slice(O + 1));
|
|
664
663
|
}
|
|
665
|
-
i = i.concat(
|
|
664
|
+
i = i.concat(I);
|
|
666
665
|
} else i = e.resources.slice(s).concat(e.resources.slice(0, s));
|
|
667
666
|
const l = Date.now();
|
|
668
|
-
let a = "pending",
|
|
669
|
-
typeof r == "function" &&
|
|
670
|
-
function
|
|
671
|
-
|
|
667
|
+
let a = "pending", u = 0, p, g = null, b = [], h = [];
|
|
668
|
+
typeof r == "function" && h.push(r);
|
|
669
|
+
function k() {
|
|
670
|
+
g && (clearTimeout(g), g = null);
|
|
672
671
|
}
|
|
673
|
-
function
|
|
674
|
-
a === "pending" && (a = "aborted"),
|
|
675
|
-
|
|
672
|
+
function F() {
|
|
673
|
+
a === "pending" && (a = "aborted"), k(), b.forEach((I) => {
|
|
674
|
+
I.status === "pending" && (I.status = "aborted");
|
|
676
675
|
}), b = [];
|
|
677
676
|
}
|
|
678
|
-
function
|
|
679
|
-
|
|
677
|
+
function m(I, O) {
|
|
678
|
+
O && (h = []), typeof I == "function" && h.push(I);
|
|
680
679
|
}
|
|
681
680
|
function v() {
|
|
682
681
|
return {
|
|
683
682
|
startTime: l,
|
|
684
683
|
payload: t,
|
|
685
684
|
status: a,
|
|
686
|
-
queriesSent:
|
|
685
|
+
queriesSent: u,
|
|
687
686
|
queriesPending: b.length,
|
|
688
|
-
subscribe:
|
|
689
|
-
abort:
|
|
687
|
+
subscribe: m,
|
|
688
|
+
abort: F
|
|
690
689
|
};
|
|
691
690
|
}
|
|
692
|
-
function
|
|
693
|
-
a = "failed",
|
|
694
|
-
|
|
691
|
+
function U() {
|
|
692
|
+
a = "failed", h.forEach((I) => {
|
|
693
|
+
I(void 0, p);
|
|
695
694
|
});
|
|
696
695
|
}
|
|
697
|
-
function
|
|
698
|
-
b.forEach((
|
|
699
|
-
|
|
696
|
+
function E() {
|
|
697
|
+
b.forEach((I) => {
|
|
698
|
+
I.status === "pending" && (I.status = "aborted");
|
|
700
699
|
}), b = [];
|
|
701
700
|
}
|
|
702
|
-
function
|
|
703
|
-
const
|
|
704
|
-
switch (b = b.filter((
|
|
701
|
+
function L(I, O, q) {
|
|
702
|
+
const z = O !== "success";
|
|
703
|
+
switch (b = b.filter(($) => $ !== I), a) {
|
|
705
704
|
case "pending":
|
|
706
705
|
break;
|
|
707
706
|
case "failed":
|
|
708
|
-
if (
|
|
707
|
+
if (z || !e.dataAfterTimeout) return;
|
|
709
708
|
break;
|
|
710
709
|
default:
|
|
711
710
|
return;
|
|
712
711
|
}
|
|
713
|
-
if (
|
|
714
|
-
|
|
712
|
+
if (O === "abort") {
|
|
713
|
+
p = q, U();
|
|
715
714
|
return;
|
|
716
715
|
}
|
|
717
|
-
if (
|
|
718
|
-
|
|
716
|
+
if (z) {
|
|
717
|
+
p = q, b.length || (i.length ? Y() : U());
|
|
719
718
|
return;
|
|
720
719
|
}
|
|
721
|
-
if (
|
|
722
|
-
const
|
|
723
|
-
|
|
720
|
+
if (k(), E(), !e.random) {
|
|
721
|
+
const $ = e.resources.indexOf(I.resource);
|
|
722
|
+
$ !== -1 && $ !== e.index && (e.index = $);
|
|
724
723
|
}
|
|
725
|
-
a = "completed",
|
|
726
|
-
|
|
724
|
+
a = "completed", h.forEach(($) => {
|
|
725
|
+
$(q);
|
|
727
726
|
});
|
|
728
727
|
}
|
|
729
|
-
function
|
|
728
|
+
function Y() {
|
|
730
729
|
if (a !== "pending") return;
|
|
731
|
-
|
|
732
|
-
const
|
|
733
|
-
if (
|
|
730
|
+
k();
|
|
731
|
+
const I = i.shift();
|
|
732
|
+
if (I === void 0) {
|
|
734
733
|
if (b.length) {
|
|
735
|
-
|
|
736
|
-
|
|
734
|
+
g = setTimeout(() => {
|
|
735
|
+
k(), a === "pending" && (E(), U());
|
|
737
736
|
}, e.timeout);
|
|
738
737
|
return;
|
|
739
738
|
}
|
|
740
|
-
|
|
739
|
+
U();
|
|
741
740
|
return;
|
|
742
741
|
}
|
|
743
|
-
const
|
|
742
|
+
const O = {
|
|
744
743
|
status: "pending",
|
|
745
|
-
resource:
|
|
746
|
-
callback: (
|
|
747
|
-
|
|
744
|
+
resource: I,
|
|
745
|
+
callback: (q, z) => {
|
|
746
|
+
L(O, q, z);
|
|
748
747
|
}
|
|
749
748
|
};
|
|
750
|
-
b.push(
|
|
749
|
+
b.push(O), u++, g = setTimeout(Y, e.rotate), n(I, t, O.callback);
|
|
751
750
|
}
|
|
752
|
-
return setTimeout(
|
|
751
|
+
return setTimeout(Y), v;
|
|
753
752
|
}
|
|
754
753
|
function zt(e) {
|
|
755
754
|
const t = {
|
|
756
|
-
...
|
|
755
|
+
...Bn,
|
|
757
756
|
...e
|
|
758
757
|
};
|
|
759
758
|
let n = [];
|
|
760
759
|
function r() {
|
|
761
760
|
n = n.filter((l) => l().status === "pending");
|
|
762
761
|
}
|
|
763
|
-
function o(l, a,
|
|
764
|
-
const
|
|
765
|
-
r(),
|
|
762
|
+
function o(l, a, u) {
|
|
763
|
+
const p = Hn(t, l, a, (g, b) => {
|
|
764
|
+
r(), u && u(g, b);
|
|
766
765
|
});
|
|
767
|
-
return n.push(
|
|
766
|
+
return n.push(p), p;
|
|
768
767
|
}
|
|
769
768
|
function s(l) {
|
|
770
769
|
return n.find((a) => l(a)) || null;
|
|
@@ -782,7 +781,7 @@ function zt(e) {
|
|
|
782
781
|
function xt() {
|
|
783
782
|
}
|
|
784
783
|
const Ke = /* @__PURE__ */ Object.create(null);
|
|
785
|
-
function
|
|
784
|
+
function qn(e) {
|
|
786
785
|
if (!Ke[e]) {
|
|
787
786
|
const t = rt(e);
|
|
788
787
|
if (!t) return;
|
|
@@ -794,14 +793,14 @@ function Rn(e) {
|
|
|
794
793
|
}
|
|
795
794
|
return Ke[e];
|
|
796
795
|
}
|
|
797
|
-
function
|
|
796
|
+
function zn(e, t, n) {
|
|
798
797
|
let r, o;
|
|
799
798
|
if (typeof e == "string") {
|
|
800
799
|
const s = Ze(e);
|
|
801
800
|
if (!s)
|
|
802
801
|
return n(void 0, 424), xt;
|
|
803
802
|
o = s.send;
|
|
804
|
-
const i =
|
|
803
|
+
const i = qn(e);
|
|
805
804
|
i && (r = i.redundancy);
|
|
806
805
|
} else {
|
|
807
806
|
const s = nt(e);
|
|
@@ -815,12 +814,12 @@ function Vn(e, t, n) {
|
|
|
815
814
|
}
|
|
816
815
|
function wt() {
|
|
817
816
|
}
|
|
818
|
-
function
|
|
817
|
+
function Rn(e) {
|
|
819
818
|
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
820
|
-
e.iconsLoaderFlag = !1,
|
|
819
|
+
e.iconsLoaderFlag = !1, jn(e);
|
|
821
820
|
}));
|
|
822
821
|
}
|
|
823
|
-
function
|
|
822
|
+
function Vn(e) {
|
|
824
823
|
const t = [], n = [];
|
|
825
824
|
return e.forEach((r) => {
|
|
826
825
|
(r.match(Ut) ? t : n).push(r);
|
|
@@ -829,7 +828,7 @@ function Kn(e) {
|
|
|
829
828
|
invalid: n
|
|
830
829
|
};
|
|
831
830
|
}
|
|
832
|
-
function
|
|
831
|
+
function Ne(e, t, n) {
|
|
833
832
|
function r() {
|
|
834
833
|
const o = e.pendingIcons;
|
|
835
834
|
t.forEach((s) => {
|
|
@@ -844,7 +843,7 @@ function Fe(e, t, n) {
|
|
|
844
843
|
} catch (o) {
|
|
845
844
|
console.error(o);
|
|
846
845
|
}
|
|
847
|
-
r(),
|
|
846
|
+
r(), Rn(e);
|
|
848
847
|
}
|
|
849
848
|
function bt(e, t) {
|
|
850
849
|
e instanceof Promise ? e.then((n) => {
|
|
@@ -853,47 +852,47 @@ function bt(e, t) {
|
|
|
853
852
|
t(null);
|
|
854
853
|
}) : t(e);
|
|
855
854
|
}
|
|
856
|
-
function
|
|
855
|
+
function Jn(e, t) {
|
|
857
856
|
e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(t).sort() : e.iconsToLoad = t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
|
|
858
857
|
e.iconsQueueFlag = !1;
|
|
859
858
|
const { provider: n, prefix: r } = e, o = e.iconsToLoad;
|
|
860
859
|
if (delete e.iconsToLoad, !o || !o.length) return;
|
|
861
860
|
const s = e.loadIcon;
|
|
862
861
|
if (e.loadIcons && (o.length > 1 || !s)) {
|
|
863
|
-
bt(e.loadIcons(o, r, n), (
|
|
864
|
-
|
|
862
|
+
bt(e.loadIcons(o, r, n), (p) => {
|
|
863
|
+
Ne(e, o, p);
|
|
865
864
|
});
|
|
866
865
|
return;
|
|
867
866
|
}
|
|
868
867
|
if (s) {
|
|
869
|
-
o.forEach((
|
|
870
|
-
const
|
|
871
|
-
bt(
|
|
872
|
-
const
|
|
868
|
+
o.forEach((p) => {
|
|
869
|
+
const g = s(p, r, n);
|
|
870
|
+
bt(g, (b) => {
|
|
871
|
+
const h = b ? {
|
|
873
872
|
prefix: r,
|
|
874
|
-
icons: { [
|
|
873
|
+
icons: { [p]: b }
|
|
875
874
|
} : null;
|
|
876
|
-
|
|
875
|
+
Ne(e, [p], h);
|
|
877
876
|
});
|
|
878
877
|
});
|
|
879
878
|
return;
|
|
880
879
|
}
|
|
881
|
-
const { valid: i, invalid: l } =
|
|
882
|
-
if (l.length &&
|
|
880
|
+
const { valid: i, invalid: l } = Vn(o);
|
|
881
|
+
if (l.length && Ne(e, l, null), !i.length) return;
|
|
883
882
|
const a = r.match(Ut) ? Ze(n) : null;
|
|
884
883
|
if (!a) {
|
|
885
|
-
|
|
884
|
+
Ne(e, i, null);
|
|
886
885
|
return;
|
|
887
886
|
}
|
|
888
|
-
a.prepare(n, r, i).forEach((
|
|
889
|
-
|
|
890
|
-
|
|
887
|
+
a.prepare(n, r, i).forEach((p) => {
|
|
888
|
+
zn(n, p, (g) => {
|
|
889
|
+
Ne(e, p.icons, g);
|
|
891
890
|
});
|
|
892
891
|
});
|
|
893
892
|
}));
|
|
894
893
|
}
|
|
895
|
-
const
|
|
896
|
-
const n =
|
|
894
|
+
const Kn = (e, t) => {
|
|
895
|
+
const n = Mn(e, !0, Mt()), r = Un(n);
|
|
897
896
|
if (!r.pending.length) {
|
|
898
897
|
let a = !0;
|
|
899
898
|
return t && setTimeout(() => {
|
|
@@ -905,20 +904,20 @@ const Wn = (e, t) => {
|
|
|
905
904
|
const o = /* @__PURE__ */ Object.create(null), s = [];
|
|
906
905
|
let i, l;
|
|
907
906
|
return r.pending.forEach((a) => {
|
|
908
|
-
const { provider:
|
|
909
|
-
if (
|
|
910
|
-
i =
|
|
911
|
-
const
|
|
912
|
-
|
|
907
|
+
const { provider: u, prefix: p } = a;
|
|
908
|
+
if (p === l && u === i) return;
|
|
909
|
+
i = u, l = p, s.push(Ie(u, p));
|
|
910
|
+
const g = o[u] || (o[u] = /* @__PURE__ */ Object.create(null));
|
|
911
|
+
g[p] || (g[p] = []);
|
|
913
912
|
}), r.pending.forEach((a) => {
|
|
914
|
-
const { provider:
|
|
915
|
-
|
|
913
|
+
const { provider: u, prefix: p, name: g } = a, b = Ie(u, p), h = b.pendingIcons || (b.pendingIcons = /* @__PURE__ */ new Set());
|
|
914
|
+
h.has(g) || (h.add(g), o[u][p].push(g));
|
|
916
915
|
}), s.forEach((a) => {
|
|
917
|
-
const
|
|
918
|
-
|
|
919
|
-
}), t ?
|
|
916
|
+
const u = o[a.provider][a.prefix];
|
|
917
|
+
u.length && Jn(a, u);
|
|
918
|
+
}), t ? Dn(t, r, s) : wt;
|
|
920
919
|
};
|
|
921
|
-
function
|
|
920
|
+
function Gn(e, t) {
|
|
922
921
|
const n = { ...e };
|
|
923
922
|
for (const r in t) {
|
|
924
923
|
const o = t[r], s = typeof o;
|
|
@@ -926,9 +925,9 @@ function Qn(e, t) {
|
|
|
926
925
|
}
|
|
927
926
|
return n;
|
|
928
927
|
}
|
|
929
|
-
const
|
|
930
|
-
function
|
|
931
|
-
t.split(
|
|
928
|
+
const Wn = /[\s,]+/;
|
|
929
|
+
function Qn(e, t) {
|
|
930
|
+
t.split(Wn).forEach((n) => {
|
|
932
931
|
switch (n.trim()) {
|
|
933
932
|
case "horizontal":
|
|
934
933
|
e.hFlip = !0;
|
|
@@ -939,7 +938,7 @@ function Zn(e, t) {
|
|
|
939
938
|
}
|
|
940
939
|
});
|
|
941
940
|
}
|
|
942
|
-
function
|
|
941
|
+
function Yn(e, t = 0) {
|
|
943
942
|
const n = e.replace(/^-?[0-9.]*/, "");
|
|
944
943
|
function r(o) {
|
|
945
944
|
for (; o < 0; ) o += 4;
|
|
@@ -964,40 +963,40 @@ function Xn(e, t = 0) {
|
|
|
964
963
|
}
|
|
965
964
|
return t;
|
|
966
965
|
}
|
|
967
|
-
function
|
|
966
|
+
function Zn(e, t) {
|
|
968
967
|
let n = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
969
968
|
for (const r in t) n += " " + r + '="' + t[r] + '"';
|
|
970
969
|
return '<svg xmlns="http://www.w3.org/2000/svg"' + n + ">" + e + "</svg>";
|
|
971
970
|
}
|
|
972
|
-
function
|
|
971
|
+
function Xn(e) {
|
|
973
972
|
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
974
973
|
}
|
|
975
|
-
function
|
|
976
|
-
return "data:image/svg+xml," +
|
|
974
|
+
function eo(e) {
|
|
975
|
+
return "data:image/svg+xml," + Xn(e);
|
|
977
976
|
}
|
|
978
|
-
function
|
|
979
|
-
return 'url("' +
|
|
977
|
+
function to(e) {
|
|
978
|
+
return 'url("' + eo(e) + '")';
|
|
980
979
|
}
|
|
981
|
-
let
|
|
982
|
-
function
|
|
980
|
+
let _e;
|
|
981
|
+
function no() {
|
|
983
982
|
try {
|
|
984
|
-
|
|
983
|
+
_e = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
|
|
985
984
|
} catch {
|
|
986
|
-
|
|
985
|
+
_e = null;
|
|
987
986
|
}
|
|
988
987
|
}
|
|
989
|
-
function
|
|
990
|
-
return
|
|
988
|
+
function oo(e) {
|
|
989
|
+
return _e === void 0 && no(), _e ? _e.createHTML(e) : e;
|
|
991
990
|
}
|
|
992
991
|
const Rt = {
|
|
993
992
|
...Ht,
|
|
994
993
|
inline: !1
|
|
995
|
-
},
|
|
994
|
+
}, ro = {
|
|
996
995
|
xmlns: "http://www.w3.org/2000/svg",
|
|
997
996
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
998
997
|
"aria-hidden": !0,
|
|
999
998
|
role: "img"
|
|
1000
|
-
},
|
|
999
|
+
}, so = {
|
|
1001
1000
|
display: "inline-block"
|
|
1002
1001
|
}, Xe = {
|
|
1003
1002
|
backgroundColor: "currentColor"
|
|
@@ -1017,33 +1016,33 @@ for (const e in kt) {
|
|
|
1017
1016
|
for (const n in vt)
|
|
1018
1017
|
t[e + n] = vt[n];
|
|
1019
1018
|
}
|
|
1020
|
-
const
|
|
1019
|
+
const io = {
|
|
1021
1020
|
...Rt,
|
|
1022
1021
|
inline: !0
|
|
1023
1022
|
};
|
|
1024
1023
|
function It(e) {
|
|
1025
1024
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1026
1025
|
}
|
|
1027
|
-
const
|
|
1028
|
-
const r = t.inline ?
|
|
1029
|
-
...s === "svg" ?
|
|
1026
|
+
const ao = (e, t, n) => {
|
|
1027
|
+
const r = t.inline ? io : Rt, o = Gn(r, t), s = t.mode || "svg", i = {}, l = t.style || {}, a = {
|
|
1028
|
+
...s === "svg" ? ro : {}
|
|
1030
1029
|
};
|
|
1031
1030
|
if (n) {
|
|
1032
|
-
const
|
|
1033
|
-
if (
|
|
1034
|
-
const v = ["iconify"],
|
|
1031
|
+
const m = Be(n, !1, !0);
|
|
1032
|
+
if (m) {
|
|
1033
|
+
const v = ["iconify"], U = [
|
|
1035
1034
|
"provider",
|
|
1036
1035
|
"prefix"
|
|
1037
1036
|
];
|
|
1038
|
-
for (const
|
|
1039
|
-
|
|
1037
|
+
for (const E of U)
|
|
1038
|
+
m[E] && v.push("iconify--" + m[E]);
|
|
1040
1039
|
a.className = v.join(" ");
|
|
1041
1040
|
}
|
|
1042
1041
|
}
|
|
1043
|
-
for (let
|
|
1044
|
-
const v = t[
|
|
1042
|
+
for (let m in t) {
|
|
1043
|
+
const v = t[m];
|
|
1045
1044
|
if (v !== void 0)
|
|
1046
|
-
switch (
|
|
1045
|
+
switch (m) {
|
|
1047
1046
|
// Properties to ignore
|
|
1048
1047
|
case "icon":
|
|
1049
1048
|
case "style":
|
|
@@ -1059,17 +1058,17 @@ const lo = (e, t, n) => {
|
|
|
1059
1058
|
break;
|
|
1060
1059
|
// Merge class names
|
|
1061
1060
|
case "className":
|
|
1062
|
-
a[
|
|
1061
|
+
a[m] = (a[m] ? a[m] + " " : "") + v;
|
|
1063
1062
|
break;
|
|
1064
1063
|
// Boolean attributes
|
|
1065
1064
|
case "inline":
|
|
1066
1065
|
case "hFlip":
|
|
1067
1066
|
case "vFlip":
|
|
1068
|
-
o[
|
|
1067
|
+
o[m] = v === !0 || v === "true" || v === 1;
|
|
1069
1068
|
break;
|
|
1070
1069
|
// Flip as string: 'horizontal,vertical'
|
|
1071
1070
|
case "flip":
|
|
1072
|
-
typeof v == "string" &&
|
|
1071
|
+
typeof v == "string" && Qn(o, v);
|
|
1073
1072
|
break;
|
|
1074
1073
|
// Color: copy to style
|
|
1075
1074
|
case "color":
|
|
@@ -1077,7 +1076,7 @@ const lo = (e, t, n) => {
|
|
|
1077
1076
|
break;
|
|
1078
1077
|
// Rotation as string
|
|
1079
1078
|
case "rotate":
|
|
1080
|
-
typeof v == "string" ? o[
|
|
1079
|
+
typeof v == "string" ? o[m] = Yn(v) : typeof v == "number" && (o[m] = v);
|
|
1081
1080
|
break;
|
|
1082
1081
|
// Remove aria-hidden
|
|
1083
1082
|
case "ariaHidden":
|
|
@@ -1086,37 +1085,37 @@ const lo = (e, t, n) => {
|
|
|
1086
1085
|
break;
|
|
1087
1086
|
// Copy missing property if it does not exist in customisations
|
|
1088
1087
|
default:
|
|
1089
|
-
r[
|
|
1088
|
+
r[m] === void 0 && (a[m] = v);
|
|
1090
1089
|
}
|
|
1091
1090
|
}
|
|
1092
|
-
const
|
|
1091
|
+
const u = vn(e, o), p = u.attributes;
|
|
1093
1092
|
if (o.inline && (i.verticalAlign = "-0.125em"), s === "svg") {
|
|
1094
1093
|
a.style = {
|
|
1095
1094
|
...i,
|
|
1096
1095
|
...l
|
|
1097
|
-
}, Object.assign(a,
|
|
1098
|
-
let
|
|
1096
|
+
}, Object.assign(a, p);
|
|
1097
|
+
let m = 0, v = t.id;
|
|
1099
1098
|
return typeof v == "string" && (v = v.replace(/-/g, "_")), a.dangerouslySetInnerHTML = {
|
|
1100
|
-
__html:
|
|
1099
|
+
__html: oo(Cn(u.body, v ? () => v + "ID" + m++ : "iconifyReact"))
|
|
1101
1100
|
}, We("svg", a);
|
|
1102
1101
|
}
|
|
1103
|
-
const { body:
|
|
1104
|
-
...
|
|
1102
|
+
const { body: g, width: b, height: h } = e, k = s === "mask" || (s === "bg" ? !1 : g.indexOf("currentColor") !== -1), F = Zn(g, {
|
|
1103
|
+
...p,
|
|
1105
1104
|
width: b + "",
|
|
1106
|
-
height:
|
|
1105
|
+
height: h + ""
|
|
1107
1106
|
});
|
|
1108
1107
|
return a.style = {
|
|
1109
1108
|
...i,
|
|
1110
|
-
"--svg":
|
|
1111
|
-
width: It(
|
|
1112
|
-
height: It(
|
|
1113
|
-
...
|
|
1114
|
-
...
|
|
1109
|
+
"--svg": to(F),
|
|
1110
|
+
width: It(p.width),
|
|
1111
|
+
height: It(p.height),
|
|
1112
|
+
...so,
|
|
1113
|
+
...k ? Xe : Vt,
|
|
1115
1114
|
...l
|
|
1116
1115
|
}, We("span", a);
|
|
1117
1116
|
};
|
|
1118
1117
|
Mt(!0);
|
|
1119
|
-
|
|
1118
|
+
Fn("", Ln);
|
|
1120
1119
|
if (typeof document < "u" && typeof window < "u") {
|
|
1121
1120
|
const e = window;
|
|
1122
1121
|
if (e.IconifyPreload !== void 0) {
|
|
@@ -1126,7 +1125,7 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
1126
1125
|
// Check if item is an object and not null/array
|
|
1127
1126
|
(typeof r != "object" || r === null || r instanceof Array || // Check for 'icons' and 'prefix'
|
|
1128
1127
|
typeof r.icons != "object" || typeof r.prefix != "string" || // Add icon set
|
|
1129
|
-
!
|
|
1128
|
+
!hn(r)) && console.error(n);
|
|
1130
1129
|
} catch {
|
|
1131
1130
|
console.error(n);
|
|
1132
1131
|
}
|
|
@@ -1141,7 +1140,7 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
1141
1140
|
const o = t[n];
|
|
1142
1141
|
if (typeof o != "object" || !o || o.resources === void 0)
|
|
1143
1142
|
continue;
|
|
1144
|
-
|
|
1143
|
+
Nn(n, o) || console.error(r);
|
|
1145
1144
|
} catch {
|
|
1146
1145
|
console.error(r);
|
|
1147
1146
|
}
|
|
@@ -1149,65 +1148,65 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
1149
1148
|
}
|
|
1150
1149
|
}
|
|
1151
1150
|
function Jt(e) {
|
|
1152
|
-
const [t, n] =
|
|
1153
|
-
function s(
|
|
1154
|
-
if (
|
|
1155
|
-
const
|
|
1156
|
-
if (typeof
|
|
1151
|
+
const [t, n] = D(!!e.ssr), [r, o] = D({});
|
|
1152
|
+
function s(h) {
|
|
1153
|
+
if (h) {
|
|
1154
|
+
const k = e.icon;
|
|
1155
|
+
if (typeof k == "object")
|
|
1157
1156
|
return {
|
|
1158
1157
|
name: "",
|
|
1159
|
-
data:
|
|
1158
|
+
data: k
|
|
1160
1159
|
};
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1160
|
+
const F = mt(k);
|
|
1161
|
+
if (F)
|
|
1163
1162
|
return {
|
|
1164
|
-
name:
|
|
1165
|
-
data:
|
|
1163
|
+
name: k,
|
|
1164
|
+
data: F
|
|
1166
1165
|
};
|
|
1167
1166
|
}
|
|
1168
1167
|
return {
|
|
1169
1168
|
name: ""
|
|
1170
1169
|
};
|
|
1171
1170
|
}
|
|
1172
|
-
const [i, l] =
|
|
1171
|
+
const [i, l] = D(s(!!e.ssr));
|
|
1173
1172
|
function a() {
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1173
|
+
const h = r.callback;
|
|
1174
|
+
h && (h(), o({}));
|
|
1176
1175
|
}
|
|
1177
|
-
function
|
|
1178
|
-
if (JSON.stringify(i) !== JSON.stringify(
|
|
1179
|
-
return a(), l(
|
|
1176
|
+
function u(h) {
|
|
1177
|
+
if (JSON.stringify(i) !== JSON.stringify(h))
|
|
1178
|
+
return a(), l(h), !0;
|
|
1180
1179
|
}
|
|
1181
|
-
function
|
|
1182
|
-
var
|
|
1183
|
-
const
|
|
1184
|
-
if (typeof
|
|
1185
|
-
|
|
1180
|
+
function p() {
|
|
1181
|
+
var h;
|
|
1182
|
+
const k = e.icon;
|
|
1183
|
+
if (typeof k == "object") {
|
|
1184
|
+
u({
|
|
1186
1185
|
name: "",
|
|
1187
|
-
data:
|
|
1186
|
+
data: k
|
|
1188
1187
|
});
|
|
1189
1188
|
return;
|
|
1190
1189
|
}
|
|
1191
|
-
const
|
|
1192
|
-
if (
|
|
1193
|
-
name:
|
|
1194
|
-
data:
|
|
1190
|
+
const F = mt(k);
|
|
1191
|
+
if (u({
|
|
1192
|
+
name: k,
|
|
1193
|
+
data: F
|
|
1195
1194
|
}))
|
|
1196
|
-
if (
|
|
1197
|
-
const
|
|
1195
|
+
if (F === void 0) {
|
|
1196
|
+
const m = Kn([k], p);
|
|
1198
1197
|
o({
|
|
1199
|
-
callback:
|
|
1198
|
+
callback: m
|
|
1200
1199
|
});
|
|
1201
|
-
} else
|
|
1200
|
+
} else F && ((h = e.onLoad) === null || h === void 0 || h.call(e, k));
|
|
1202
1201
|
}
|
|
1203
1202
|
fe(() => (n(!0), a), []), fe(() => {
|
|
1204
|
-
t &&
|
|
1203
|
+
t && p();
|
|
1205
1204
|
}, [e.icon, t]);
|
|
1206
|
-
const { name:
|
|
1207
|
-
return b ?
|
|
1205
|
+
const { name: g, data: b } = i;
|
|
1206
|
+
return b ? ao({
|
|
1208
1207
|
...tt,
|
|
1209
1208
|
...b
|
|
1210
|
-
}, e,
|
|
1209
|
+
}, e, g) : e.children ? e.children : e.fallback ? e.fallback : We("span", {});
|
|
1211
1210
|
}
|
|
1212
1211
|
const St = Tt((e, t) => Jt({
|
|
1213
1212
|
...e,
|
|
@@ -1218,11 +1217,11 @@ Tt((e, t) => Jt({
|
|
|
1218
1217
|
...e,
|
|
1219
1218
|
_ref: t
|
|
1220
1219
|
}));
|
|
1221
|
-
const
|
|
1220
|
+
const co = {
|
|
1222
1221
|
product: null
|
|
1223
|
-
}, Kt =
|
|
1222
|
+
}, Kt = en({
|
|
1224
1223
|
name: "product",
|
|
1225
|
-
initialState:
|
|
1224
|
+
initialState: co,
|
|
1226
1225
|
reducers: {
|
|
1227
1226
|
setProduct: (e, t) => {
|
|
1228
1227
|
e.product = t.payload;
|
|
@@ -1230,17 +1229,17 @@ const uo = {
|
|
|
1230
1229
|
}
|
|
1231
1230
|
}), { setProduct: et } = Kt.actions;
|
|
1232
1231
|
Kt.reducer;
|
|
1233
|
-
function
|
|
1234
|
-
const e = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [t, n] =
|
|
1232
|
+
function lo() {
|
|
1233
|
+
const e = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [t, n] = D(e);
|
|
1235
1234
|
return fe(() => {
|
|
1236
1235
|
const r = () => n(e());
|
|
1237
1236
|
return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
1238
1237
|
}, []), t;
|
|
1239
1238
|
}
|
|
1240
|
-
const
|
|
1239
|
+
const uo = ({
|
|
1241
1240
|
product: e
|
|
1242
1241
|
}) => {
|
|
1243
|
-
const t = Pt(), n =
|
|
1242
|
+
const t = Pt(), n = lo(), [r, o] = D(0), s = () => {
|
|
1244
1243
|
o(
|
|
1245
1244
|
(a) => a + n >= e.length ? 0 : a + n
|
|
1246
1245
|
);
|
|
@@ -1249,10 +1248,10 @@ const po = ({
|
|
|
1249
1248
|
(a) => a - n < 0 ? e.length - (e.length % n || n) : a - n
|
|
1250
1249
|
);
|
|
1251
1250
|
}, l = async (a) => {
|
|
1252
|
-
const
|
|
1253
|
-
t(et(
|
|
1251
|
+
const u = await At(a);
|
|
1252
|
+
t(et(u));
|
|
1254
1253
|
};
|
|
1255
|
-
return /* @__PURE__ */ c("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */
|
|
1254
|
+
return /* @__PURE__ */ c("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ f("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
1256
1255
|
(e == null ? void 0 : e.length) > n && /* @__PURE__ */ c(
|
|
1257
1256
|
"button",
|
|
1258
1257
|
{
|
|
@@ -1262,8 +1261,8 @@ const po = ({
|
|
|
1262
1261
|
}
|
|
1263
1262
|
),
|
|
1264
1263
|
/* @__PURE__ */ c("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: e.slice(r, r + n).map((a) => {
|
|
1265
|
-
var
|
|
1266
|
-
return /* @__PURE__ */
|
|
1264
|
+
var u, p, g, b;
|
|
1265
|
+
return /* @__PURE__ */ f(
|
|
1267
1266
|
"div",
|
|
1268
1267
|
{
|
|
1269
1268
|
className: "flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",
|
|
@@ -1274,20 +1273,20 @@ const po = ({
|
|
|
1274
1273
|
/* @__PURE__ */ c("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ c(
|
|
1275
1274
|
"img",
|
|
1276
1275
|
{
|
|
1277
|
-
src: ((
|
|
1276
|
+
src: ((u = dt(a)[0]) == null ? void 0 : u.link) || dt(a)[0] || // fallback if it's a string
|
|
1278
1277
|
"https://via.placeholder.com/120",
|
|
1279
1278
|
alt: a != null && a.productName ? a.productName : "Product",
|
|
1280
1279
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
1281
1280
|
}
|
|
1282
1281
|
) }),
|
|
1283
|
-
/* @__PURE__ */
|
|
1282
|
+
/* @__PURE__ */ f(
|
|
1284
1283
|
"div",
|
|
1285
1284
|
{
|
|
1286
1285
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
1287
1286
|
children: [
|
|
1288
|
-
/* @__PURE__ */
|
|
1287
|
+
/* @__PURE__ */ f("div", { className: "relative inline-block group", children: [
|
|
1289
1288
|
/* @__PURE__ */ c("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: a != null && a.productName ? a.productName : a != null && a.product_name ? a.product_name : ft(
|
|
1290
|
-
lt((
|
|
1289
|
+
lt((p = a == null ? void 0 : a.name) == null ? void 0 : p["en-US"]),
|
|
1291
1290
|
60
|
|
1292
1291
|
) || "Product" }),
|
|
1293
1292
|
/* @__PURE__ */ c(
|
|
@@ -1302,18 +1301,18 @@ const po = ({
|
|
|
1302
1301
|
zIndex: 50
|
|
1303
1302
|
},
|
|
1304
1303
|
children: a != null && a.productName ? a.productName : a != null && a.product_name ? a.product_name : ft(
|
|
1305
|
-
lt((
|
|
1304
|
+
lt((g = a == null ? void 0 : a.name) == null ? void 0 : g["en-US"]),
|
|
1306
1305
|
60
|
|
1307
1306
|
) || "Product"
|
|
1308
1307
|
}
|
|
1309
1308
|
)
|
|
1310
1309
|
] }),
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
/* @__PURE__ */ c("p", { children:
|
|
1313
|
-
a != null && a.price ? Number(a == null ? void 0 : a.price) :
|
|
1314
|
-
(b =
|
|
1310
|
+
/* @__PURE__ */ f("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
1311
|
+
/* @__PURE__ */ c("p", { children: rn(
|
|
1312
|
+
a != null && a.price ? Number(a == null ? void 0 : a.price) : ut(a).centAmount || 0,
|
|
1313
|
+
(b = ut(a)) == null ? void 0 : b.currencyCode
|
|
1315
1314
|
) }),
|
|
1316
|
-
/* @__PURE__ */
|
|
1315
|
+
/* @__PURE__ */ f("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
1317
1316
|
"$",
|
|
1318
1317
|
Number(a == null ? void 0 : a.price).toFixed(2) ?? 5
|
|
1319
1318
|
] })
|
|
@@ -1335,7 +1334,7 @@ const po = ({
|
|
|
1335
1334
|
}
|
|
1336
1335
|
)
|
|
1337
1336
|
] }) });
|
|
1338
|
-
},
|
|
1337
|
+
}, fo = ({ chat: e, storeDetails: t }) => /* @__PURE__ */ c("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: e.map((n, r) => /* @__PURE__ */ f(
|
|
1339
1338
|
"div",
|
|
1340
1339
|
{
|
|
1341
1340
|
className: "mb-4 p-3 rounded-xl",
|
|
@@ -1348,11 +1347,11 @@ const po = ({
|
|
|
1348
1347
|
"div",
|
|
1349
1348
|
{
|
|
1350
1349
|
className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
|
|
1351
|
-
children:
|
|
1350
|
+
children: sn(n.keyword) || "No keyword"
|
|
1352
1351
|
}
|
|
1353
1352
|
),
|
|
1354
1353
|
/* @__PURE__ */ c(
|
|
1355
|
-
|
|
1354
|
+
uo,
|
|
1356
1355
|
{
|
|
1357
1356
|
product: n.items,
|
|
1358
1357
|
storeDetails: t
|
|
@@ -1366,8 +1365,8 @@ const po = ({
|
|
|
1366
1365
|
console.log(`customer_token
|
|
1367
1366
|
`, e);
|
|
1368
1367
|
try {
|
|
1369
|
-
return (await
|
|
1370
|
-
`${o}${r}/basket/create?baseUrl=${
|
|
1368
|
+
return (await M.post(
|
|
1369
|
+
`${o}${r}/basket/create?baseUrl=${se()}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
|
|
1371
1370
|
t,
|
|
1372
1371
|
{
|
|
1373
1372
|
headers: {
|
|
@@ -1377,13 +1376,13 @@ const po = ({
|
|
|
1377
1376
|
}
|
|
1378
1377
|
)).data;
|
|
1379
1378
|
} catch (s) {
|
|
1380
|
-
return
|
|
1379
|
+
return M.isAxiosError(s) ? console.error("Error creating basket:", s.response || s.message) : console.error("Unexpected error:", s), null;
|
|
1381
1380
|
}
|
|
1382
|
-
},
|
|
1381
|
+
}, De = async (e, t, n) => {
|
|
1383
1382
|
const { serverUrl: r, basePath: o } = pe(), s = `${r}`;
|
|
1384
1383
|
try {
|
|
1385
|
-
const i = await
|
|
1386
|
-
`${s}${o}/basket/add-product/${e}?baseUrl=${
|
|
1384
|
+
const i = await M.post(
|
|
1385
|
+
`${s}${o}/basket/add-product/${e}?baseUrl=${se()}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
|
|
1387
1386
|
t,
|
|
1388
1387
|
{
|
|
1389
1388
|
headers: {
|
|
@@ -1394,7 +1393,7 @@ const po = ({
|
|
|
1394
1393
|
);
|
|
1395
1394
|
return i.status === 200 && i.data ? i.data : null;
|
|
1396
1395
|
} catch (i) {
|
|
1397
|
-
return
|
|
1396
|
+
return M.isAxiosError(i) ? console.error(
|
|
1398
1397
|
"Error adding products to basket:",
|
|
1399
1398
|
i.response || i.message
|
|
1400
1399
|
) : console.error("Unexpected error:", i), null;
|
|
@@ -1406,8 +1405,8 @@ const po = ({
|
|
|
1406
1405
|
var s;
|
|
1407
1406
|
const { serverUrl: n, basePath: r } = pe(), o = `${n}`;
|
|
1408
1407
|
try {
|
|
1409
|
-
const i = await
|
|
1410
|
-
`${o}${r}/basket/${e}?baseUrl=${
|
|
1408
|
+
const i = await M.get(
|
|
1409
|
+
`${o}${r}/basket/${e}?baseUrl=${se()}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
|
|
1411
1410
|
{
|
|
1412
1411
|
headers: {
|
|
1413
1412
|
"Content-Type": "application/json",
|
|
@@ -1417,141 +1416,141 @@ const po = ({
|
|
|
1417
1416
|
);
|
|
1418
1417
|
return { status: i.status, data: i.data };
|
|
1419
1418
|
} catch (i) {
|
|
1420
|
-
return
|
|
1419
|
+
return M.isAxiosError(i) ? { status: (s = i.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
|
|
1421
1420
|
}
|
|
1422
|
-
}, Ct = "sfcc_basket_id", Ft = "sfcc_customer_token",
|
|
1423
|
-
const
|
|
1421
|
+
}, Ct = "sfcc_basket_id", Ft = "sfcc_customer_token", Ee = "sfcc_token_expiry", po = 300 * 1e3, Te = "1.0.0";
|
|
1422
|
+
const ke = (e) => {
|
|
1424
1423
|
try {
|
|
1425
1424
|
e ? localStorage.setItem(Ct, e) : localStorage.removeItem(Ct);
|
|
1426
1425
|
} catch (t) {
|
|
1427
1426
|
console.error("Error saving basket ID to storage:", t);
|
|
1428
1427
|
}
|
|
1429
|
-
},
|
|
1428
|
+
}, Ue = (e) => {
|
|
1430
1429
|
try {
|
|
1431
1430
|
if (e) {
|
|
1432
1431
|
localStorage.setItem(Ft, e);
|
|
1433
|
-
const t = Date.now() +
|
|
1434
|
-
localStorage.setItem(
|
|
1432
|
+
const t = Date.now() + po;
|
|
1433
|
+
localStorage.setItem(Ee, t.toString());
|
|
1435
1434
|
} else
|
|
1436
1435
|
localStorage.removeItem(Ft);
|
|
1437
1436
|
} catch (t) {
|
|
1438
1437
|
console.error("Error storing token:", t);
|
|
1439
1438
|
}
|
|
1440
|
-
}, Nt = 300,
|
|
1441
|
-
var l, a,
|
|
1442
|
-
const e = Pt(), t =
|
|
1439
|
+
}, Nt = 300, ho = () => {
|
|
1440
|
+
var l, a, u, p, g, b;
|
|
1441
|
+
const e = Pt(), t = je((h) => h.product.product), n = je((h) => h.store.store), [r, o] = D(!!t);
|
|
1443
1442
|
if (fe(() => {
|
|
1444
1443
|
o(!!t);
|
|
1445
1444
|
}, [t]), !t) return null;
|
|
1446
1445
|
const s = async () => {
|
|
1447
|
-
var
|
|
1446
|
+
var h, k, F, m, v, U, E, L, Y, I, O, q, z, $, he, P;
|
|
1448
1447
|
console.log(t, "the prod");
|
|
1449
1448
|
try {
|
|
1450
|
-
if (!((
|
|
1451
|
-
|
|
1449
|
+
if (!((k = (h = t == null ? void 0 : t.variants) == null ? void 0 : h[0]) != null && k.product_id) && !(t.type.item || t.type.bundle) && !((m = (F = t == null ? void 0 : t.variants) == null ? void 0 : F[0]) != null && m.productId)) {
|
|
1450
|
+
Q.error("Variants not available", {
|
|
1452
1451
|
position: "bottom-right",
|
|
1453
1452
|
autoClose: 1e3
|
|
1454
1453
|
}), console.error("No product variant found");
|
|
1455
1454
|
return;
|
|
1456
1455
|
}
|
|
1457
|
-
const
|
|
1456
|
+
const A = [
|
|
1458
1457
|
{
|
|
1459
|
-
product_id: ((v = t.variants) == null ? void 0 : v[0].product_id) || ((
|
|
1458
|
+
product_id: ((v = t.variants) == null ? void 0 : v[0].product_id) || ((U = t.variants) == null ? void 0 : U[0].productId) || (t == null ? void 0 : t.id),
|
|
1460
1459
|
quantity: 1
|
|
1461
1460
|
}
|
|
1462
1461
|
];
|
|
1463
|
-
console.log(
|
|
1464
|
-
const
|
|
1462
|
+
console.log(A, "the product data");
|
|
1463
|
+
const Se = JSON.parse(
|
|
1465
1464
|
sessionStorage.getItem("customerData") || "{}"
|
|
1466
|
-
),
|
|
1467
|
-
if (!
|
|
1468
|
-
let
|
|
1465
|
+
), le = Se == null ? void 0 : Se.basketId, He = !1, te = localStorage.getItem(Ee), de = Date.now();
|
|
1466
|
+
if (!He || !te || de >= parseInt(te)) {
|
|
1467
|
+
let R = "";
|
|
1469
1468
|
{
|
|
1470
|
-
const
|
|
1471
|
-
console.log("token from auth data"),
|
|
1469
|
+
const me = await Me();
|
|
1470
|
+
console.log("token from auth data"), R = "Bearer " + me.access_token;
|
|
1472
1471
|
}
|
|
1473
|
-
if (!
|
|
1472
|
+
if (!R) {
|
|
1474
1473
|
console.error("Failed to get customer_token");
|
|
1475
1474
|
return;
|
|
1476
1475
|
}
|
|
1477
|
-
const
|
|
1478
|
-
if (
|
|
1479
|
-
const
|
|
1480
|
-
basketId:
|
|
1481
|
-
customer_token:
|
|
1476
|
+
const qe = de + 300 * 1e3;
|
|
1477
|
+
if (Ue(R), localStorage.setItem(Ee, qe.toString()), le) {
|
|
1478
|
+
const me = await Wt({
|
|
1479
|
+
basketId: le,
|
|
1480
|
+
customer_token: R
|
|
1482
1481
|
});
|
|
1483
|
-
if (console.log(
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1482
|
+
if (console.log(le, "basket id from customer"), me.status === 200 && me) {
|
|
1483
|
+
const ne = await De(
|
|
1484
|
+
le,
|
|
1485
|
+
A,
|
|
1486
|
+
R
|
|
1488
1487
|
);
|
|
1489
|
-
(((
|
|
1488
|
+
(((E = ne == null ? void 0 : ne.product_items) == null ? void 0 : E.length) > 0 || ((L = ne == null ? void 0 : ne.productItems) == null ? void 0 : L.length) > 0) && (Q.success("Added to cart", {
|
|
1490
1489
|
position: "bottom-right",
|
|
1491
1490
|
autoClose: 3e3,
|
|
1492
1491
|
hideProgressBar: !1,
|
|
1493
1492
|
closeOnClick: !0,
|
|
1494
1493
|
pauseOnHover: !0,
|
|
1495
1494
|
draggable: !0
|
|
1496
|
-
}),
|
|
1495
|
+
}), ve(le));
|
|
1497
1496
|
return;
|
|
1498
1497
|
}
|
|
1499
1498
|
}
|
|
1500
1499
|
const ze = {
|
|
1501
1500
|
productItems: [
|
|
1502
1501
|
{
|
|
1503
|
-
productId: ((
|
|
1502
|
+
productId: ((Y = t.variants) == null ? void 0 : Y[0].product_id) || ((I = t.variants) == null ? void 0 : I[0].productId) || (t == null ? void 0 : t.id),
|
|
1504
1503
|
quantity: 1
|
|
1505
1504
|
}
|
|
1506
1505
|
]
|
|
1507
1506
|
};
|
|
1508
1507
|
console.log("before create basket");
|
|
1509
|
-
const
|
|
1508
|
+
const x = await Gt(R, ze);
|
|
1510
1509
|
if (console.log(
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1510
|
+
x,
|
|
1511
|
+
x == null ? void 0 : x.basket_id,
|
|
1512
|
+
x == null ? void 0 : x.basketId,
|
|
1514
1513
|
"the basket response"
|
|
1515
|
-
), !(
|
|
1514
|
+
), !(x != null && x.basket_id) && !(x != null && x.basketId)) {
|
|
1516
1515
|
console.error("Failed to create basket");
|
|
1517
1516
|
return;
|
|
1518
1517
|
}
|
|
1519
1518
|
console.log(
|
|
1520
1519
|
"setting stored id",
|
|
1521
|
-
(
|
|
1522
|
-
),
|
|
1523
|
-
(
|
|
1520
|
+
(x == null ? void 0 : x.basket_id) || (x == null ? void 0 : x.basketId)
|
|
1521
|
+
), ke(
|
|
1522
|
+
(x == null ? void 0 : x.basket_id) || (x == null ? void 0 : x.basketId)
|
|
1524
1523
|
), console.log("adding product to basket");
|
|
1525
|
-
const
|
|
1526
|
-
(
|
|
1527
|
-
|
|
1528
|
-
|
|
1524
|
+
const V = await De(
|
|
1525
|
+
(x == null ? void 0 : x.basket_id) || (x == null ? void 0 : x.basketId),
|
|
1526
|
+
A,
|
|
1527
|
+
R
|
|
1529
1528
|
);
|
|
1530
|
-
console.log("object added to basket"), (((
|
|
1529
|
+
console.log("object added to basket"), (((O = V == null ? void 0 : V.product_items) == null ? void 0 : O.length) > 0 || ((q = V == null ? void 0 : V.productItems) == null ? void 0 : q.length) > 0) && Q.success("Added to cart", {
|
|
1531
1530
|
position: "bottom-right",
|
|
1532
1531
|
autoClose: 3e3,
|
|
1533
1532
|
hideProgressBar: !1,
|
|
1534
1533
|
closeOnClick: !0,
|
|
1535
1534
|
pauseOnHover: !0,
|
|
1536
1535
|
draggable: !0
|
|
1537
|
-
}),
|
|
1536
|
+
}), ve(x.basket_id || (x == null ? void 0 : x.basketId));
|
|
1538
1537
|
}
|
|
1539
|
-
} catch (
|
|
1540
|
-
console.error("Error adding to cart:",
|
|
1538
|
+
} catch (A) {
|
|
1539
|
+
console.error("Error adding to cart:", A), Q.error("Failed to add product to cart", {
|
|
1541
1540
|
position: "bottom-right",
|
|
1542
1541
|
autoClose: 3e3
|
|
1543
|
-
}), ((
|
|
1544
|
-
((
|
|
1542
|
+
}), ((z = A == null ? void 0 : A.response) == null ? void 0 : z.status) === 404 || // Basket not found
|
|
1543
|
+
(($ = A == null ? void 0 : A.response) == null ? void 0 : $.status) === 401 ? (((he = A == null ? void 0 : A.response) == null ? void 0 : he.status) === 404 && ke(null), ((P = A == null ? void 0 : A.response) == null ? void 0 : P.status) === 401 && (ke(null), Ue(null))) : (console.error("Failed to add product to basket:", A.message), Q.error("Failed to add product to cart", {
|
|
1545
1544
|
position: "bottom-right",
|
|
1546
1545
|
autoClose: 3e3
|
|
1547
1546
|
}));
|
|
1548
1547
|
} finally {
|
|
1549
|
-
|
|
1548
|
+
ve();
|
|
1550
1549
|
}
|
|
1551
1550
|
}, i = () => {
|
|
1552
1551
|
t && (window.location.href = t.c_pdpUrl);
|
|
1553
1552
|
};
|
|
1554
|
-
return console.log(t, "the prod"), /* @__PURE__ */
|
|
1553
|
+
return console.log(t, "the prod"), /* @__PURE__ */ f(Ge, { children: [
|
|
1555
1554
|
/* @__PURE__ */ c(
|
|
1556
1555
|
"div",
|
|
1557
1556
|
{
|
|
@@ -1561,7 +1560,7 @@ const ve = (e) => {
|
|
|
1561
1560
|
}
|
|
1562
1561
|
}
|
|
1563
1562
|
),
|
|
1564
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ f(
|
|
1565
1564
|
"div",
|
|
1566
1565
|
{
|
|
1567
1566
|
className: `
|
|
@@ -1570,9 +1569,9 @@ const ve = (e) => {
|
|
|
1570
1569
|
${r ? "translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100" : "translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
|
|
1571
1570
|
`,
|
|
1572
1571
|
style: { willChange: "transform, opacity" },
|
|
1573
|
-
onClick: (
|
|
1572
|
+
onClick: (h) => h.stopPropagation(),
|
|
1574
1573
|
children: [
|
|
1575
|
-
/* @__PURE__ */
|
|
1574
|
+
/* @__PURE__ */ f("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
1576
1575
|
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", { className: "text-[#000000] font-bold font-nunitoSans", children: t.name }) }),
|
|
1577
1576
|
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
1578
1577
|
at,
|
|
@@ -1588,36 +1587,36 @@ const ve = (e) => {
|
|
|
1588
1587
|
}
|
|
1589
1588
|
) })
|
|
1590
1589
|
] }),
|
|
1591
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ f("div", { className: "flex flex-row gap-2 items-center flex-wrap", children: [
|
|
1592
1591
|
/* @__PURE__ */ c("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ c(
|
|
1593
1592
|
"img",
|
|
1594
1593
|
{
|
|
1595
|
-
src: (
|
|
1594
|
+
src: (p = (u = (a = (l = t.imageGroups) == null ? void 0 : l[0]) == null ? void 0 : a.images) == null ? void 0 : u[0]) == null ? void 0 : p.link,
|
|
1596
1595
|
alt: t.name,
|
|
1597
1596
|
className: "rounded-[10px]"
|
|
1598
1597
|
}
|
|
1599
1598
|
) }),
|
|
1600
1599
|
/* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2", children: t.imageGroups.slice(1, 2).map(
|
|
1601
|
-
(
|
|
1600
|
+
(h) => h.images.slice(1, 2).map((k) => /* @__PURE__ */ c(
|
|
1602
1601
|
"img",
|
|
1603
1602
|
{
|
|
1604
|
-
src:
|
|
1603
|
+
src: k.link,
|
|
1605
1604
|
alt: t.name,
|
|
1606
1605
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
1607
1606
|
},
|
|
1608
|
-
|
|
1607
|
+
k.link
|
|
1609
1608
|
))
|
|
1610
1609
|
) })
|
|
1611
1610
|
] }),
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
/* @__PURE__ */
|
|
1611
|
+
/* @__PURE__ */ f("div", { className: "flex flex-row items-center justify-between w-full", children: [
|
|
1612
|
+
/* @__PURE__ */ f("div", { className: "flex flex-row items-center gap-2", children: [
|
|
1613
|
+
/* @__PURE__ */ f("p", { className: "text-[#14121F] font-bold font-nunitoSans", children: [
|
|
1615
1614
|
" ",
|
|
1616
1615
|
"$",
|
|
1617
1616
|
t.price.toFixed(2)
|
|
1618
1617
|
] }),
|
|
1619
1618
|
" ",
|
|
1620
|
-
/* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ f("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans", children: [
|
|
1621
1620
|
" ",
|
|
1622
1621
|
"$",
|
|
1623
1622
|
(t.price + 5).toFixed(2)
|
|
@@ -1626,7 +1625,7 @@ const ve = (e) => {
|
|
|
1626
1625
|
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children: t.discount }) })
|
|
1627
1626
|
] }),
|
|
1628
1627
|
/* @__PURE__ */ c("div", { className: "mt-2 w-full border-t-2 border-gray-200" }),
|
|
1629
|
-
/* @__PURE__ */
|
|
1628
|
+
/* @__PURE__ */ f("div", { className: "w-full text-left", children: [
|
|
1630
1629
|
/* @__PURE__ */ c("div", { className: "text-[#323135] font-bold font-nunitoSans mt-3 text-[14px]", children: "Product Details" }),
|
|
1631
1630
|
/* @__PURE__ */ c(
|
|
1632
1631
|
"div",
|
|
@@ -1636,22 +1635,22 @@ const ve = (e) => {
|
|
|
1636
1635
|
}
|
|
1637
1636
|
)
|
|
1638
1637
|
] }),
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */ c("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
((
|
|
1638
|
+
/* @__PURE__ */ f("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
1639
|
+
/* @__PURE__ */ c("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
|
|
1640
|
+
/* @__PURE__ */ f("div", { className: "text-[#323135] font-bold", children: [
|
|
1641
|
+
((g = t == null ? void 0 : t.rating) == null ? void 0 : g.rate) || 0,
|
|
1643
1642
|
" /",
|
|
1644
1643
|
" ",
|
|
1645
1644
|
/* @__PURE__ */ c("span", { className: "text-[#68656E]", children: "5" })
|
|
1646
1645
|
] }),
|
|
1647
1646
|
/* @__PURE__ */ c("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
1648
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ f("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
1649
1648
|
((b = t == null ? void 0 : t.rating) == null ? void 0 : b.count) || 0,
|
|
1650
1649
|
" ratings"
|
|
1651
1650
|
] })
|
|
1652
1651
|
] }) }),
|
|
1653
|
-
/* @__PURE__ */ c("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((
|
|
1654
|
-
var
|
|
1652
|
+
/* @__PURE__ */ c("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((h, k) => {
|
|
1653
|
+
var F;
|
|
1655
1654
|
return /* @__PURE__ */ c(
|
|
1656
1655
|
at,
|
|
1657
1656
|
{
|
|
@@ -1659,14 +1658,14 @@ const ve = (e) => {
|
|
|
1659
1658
|
width: "20",
|
|
1660
1659
|
height: "20",
|
|
1661
1660
|
className: `text-yellow-500
|
|
1662
|
-
${((
|
|
1661
|
+
${((F = t == null ? void 0 : t.rating) == null ? void 0 : F.rate) > k ? "text-yellow-500" : "text-gray-300"}
|
|
1663
1662
|
`
|
|
1664
1663
|
},
|
|
1665
|
-
|
|
1664
|
+
k
|
|
1666
1665
|
);
|
|
1667
1666
|
}) })
|
|
1668
1667
|
] }),
|
|
1669
|
-
/* @__PURE__ */
|
|
1668
|
+
/* @__PURE__ */ f(
|
|
1670
1669
|
"div",
|
|
1671
1670
|
{
|
|
1672
1671
|
className: "flex flex-col items-center justify-between font-nunitoSans font-semibold w-5/6 text-black gap-2",
|
|
@@ -1697,7 +1696,7 @@ const ve = (e) => {
|
|
|
1697
1696
|
}
|
|
1698
1697
|
)
|
|
1699
1698
|
] });
|
|
1700
|
-
},
|
|
1699
|
+
}, Co = () => {
|
|
1701
1700
|
const e = [
|
|
1702
1701
|
"Myself",
|
|
1703
1702
|
"My Child",
|
|
@@ -1712,143 +1711,143 @@ const ve = (e) => {
|
|
|
1712
1711
|
"Niece/Nephew": "his/her niece/nephew",
|
|
1713
1712
|
"My Friends": "his/her friends",
|
|
1714
1713
|
Others: "others"
|
|
1715
|
-
}, n =
|
|
1716
|
-
|
|
1717
|
-
), [
|
|
1718
|
-
id:
|
|
1719
|
-
title:
|
|
1720
|
-
image:
|
|
1721
|
-
price:
|
|
1722
|
-
}), [
|
|
1723
|
-
|
|
1724
|
-
},
|
|
1725
|
-
|
|
1714
|
+
}, n = Ce(null), r = Ce(null), o = Ce(null), s = Ce(null), [i, l] = D(null), [a, u] = D(
|
|
1715
|
+
!1
|
|
1716
|
+
), [p, g] = D(!1), [b, h] = D(!1), [k, F] = D(!1), [m, v] = D(!1), [U, E] = D(!1), [L, Y] = D(""), [I, O] = D(""), q = (d) => ({
|
|
1717
|
+
id: d.id,
|
|
1718
|
+
title: d.name,
|
|
1719
|
+
image: d.image ?? "",
|
|
1720
|
+
price: d.price ?? 0
|
|
1721
|
+
}), [z, $] = D([]), he = Ce(null), P = je((d) => d.store.store), A = je((d) => d.product.product), Se = () => {
|
|
1722
|
+
h(!0), setTimeout(() => g(!0), 10);
|
|
1723
|
+
}, le = () => {
|
|
1724
|
+
g(!1), setTimeout(() => h(!1), 300);
|
|
1726
1725
|
};
|
|
1727
1726
|
fe(() => {
|
|
1728
|
-
|
|
1729
|
-
}, [
|
|
1730
|
-
const
|
|
1731
|
-
|
|
1727
|
+
a ? Se() : le();
|
|
1728
|
+
}, [a]);
|
|
1729
|
+
const He = (d) => {
|
|
1730
|
+
O(t[d]);
|
|
1732
1731
|
};
|
|
1733
1732
|
fe(() => {
|
|
1734
1733
|
he.current && (he.current.scrollTop += 150);
|
|
1735
|
-
}, [
|
|
1736
|
-
let
|
|
1737
|
-
const
|
|
1738
|
-
if (
|
|
1739
|
-
return
|
|
1734
|
+
}, [z]);
|
|
1735
|
+
let te = null, de = null;
|
|
1736
|
+
const R = async () => {
|
|
1737
|
+
if (te && de && Date.now() < de)
|
|
1738
|
+
return te;
|
|
1740
1739
|
try {
|
|
1741
|
-
const
|
|
1740
|
+
const d = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", _ = new URLSearchParams({
|
|
1742
1741
|
grant_type: "client_credentials",
|
|
1743
1742
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
1744
1743
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
1745
1744
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
1746
|
-
}),
|
|
1745
|
+
}), C = await fetch(d, {
|
|
1747
1746
|
method: "POST",
|
|
1748
1747
|
headers: {
|
|
1749
1748
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
1750
1749
|
},
|
|
1751
|
-
body:
|
|
1750
|
+
body: _
|
|
1752
1751
|
});
|
|
1753
|
-
if (!
|
|
1752
|
+
if (!C.ok)
|
|
1754
1753
|
throw new Error(
|
|
1755
|
-
`Token request failed! status: ${
|
|
1754
|
+
`Token request failed! status: ${C.status}`
|
|
1756
1755
|
);
|
|
1757
|
-
const T = await
|
|
1758
|
-
|
|
1759
|
-
const
|
|
1760
|
-
return
|
|
1761
|
-
} catch (
|
|
1762
|
-
return console.error("Error obtaining JWT token:",
|
|
1756
|
+
const T = await C.json();
|
|
1757
|
+
te = T.access_token;
|
|
1758
|
+
const w = T.expires_in || 3600;
|
|
1759
|
+
return de = Date.now() + (w - 60) * 1e3, te;
|
|
1760
|
+
} catch (d) {
|
|
1761
|
+
return console.error("Error obtaining JWT token:", d), te = null, de = null, null;
|
|
1763
1762
|
}
|
|
1764
|
-
},
|
|
1765
|
-
const
|
|
1766
|
-
|
|
1763
|
+
}, qe = async () => {
|
|
1764
|
+
const d = await Me();
|
|
1765
|
+
d != null && l(d);
|
|
1767
1766
|
};
|
|
1768
1767
|
fe(() => {
|
|
1769
|
-
|
|
1768
|
+
qe(), console.log("scapi environment v1");
|
|
1770
1769
|
}, []);
|
|
1771
|
-
const
|
|
1772
|
-
const
|
|
1770
|
+
const ze = async () => {
|
|
1771
|
+
const d = JSON.parse(
|
|
1773
1772
|
sessionStorage.getItem("customerData") || "{}"
|
|
1774
1773
|
).customerId;
|
|
1775
|
-
return (await
|
|
1776
|
-
},
|
|
1777
|
-
console.log("in secondary flow",
|
|
1778
|
-
const
|
|
1779
|
-
if (console.log(
|
|
1774
|
+
return (await on(d || "")).c_interests;
|
|
1775
|
+
}, x = async (d, _) => {
|
|
1776
|
+
console.log("in secondary flow", Te);
|
|
1777
|
+
const C = await ze();
|
|
1778
|
+
if (console.log(C, "interests of customer", Te), !!C)
|
|
1780
1779
|
try {
|
|
1781
|
-
|
|
1782
|
-
(
|
|
1783
|
-
(
|
|
1780
|
+
$(
|
|
1781
|
+
(G) => G.map(
|
|
1782
|
+
(Z, X) => X === G.length - 1 ? { ...Z, secondaryLoading: !0 } : Z
|
|
1784
1783
|
)
|
|
1785
1784
|
);
|
|
1786
|
-
const T = await
|
|
1785
|
+
const T = await R();
|
|
1787
1786
|
if (!T) throw new Error("Failed to fetch token");
|
|
1788
|
-
const
|
|
1787
|
+
const w = localStorage.getItem("customerNumber"), S = localStorage.getItem("isLoggedIn"), ge = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
1789
1788
|
registered: String(S || !1),
|
|
1790
|
-
userId: String(
|
|
1791
|
-
}).toString()}`,
|
|
1789
|
+
userId: String(w || (/* @__PURE__ */ new Date()).getTime())
|
|
1790
|
+
}).toString()}`, ye = JSON.stringify({
|
|
1792
1791
|
flowId: "Q166PR519W",
|
|
1793
1792
|
flowAliasId: "HKFUVLWVH2",
|
|
1794
1793
|
input: {
|
|
1795
1794
|
loyaltyPoints: "",
|
|
1796
|
-
productName:
|
|
1797
|
-
productPoints: String(
|
|
1798
|
-
interests:
|
|
1795
|
+
productName: d,
|
|
1796
|
+
productPoints: String(_ || 0),
|
|
1797
|
+
interests: C
|
|
1799
1798
|
}
|
|
1800
|
-
}),
|
|
1799
|
+
}), J = await fetch(ge, {
|
|
1801
1800
|
signal: AbortSignal.timeout(3e4),
|
|
1802
1801
|
method: "POST",
|
|
1803
1802
|
headers: {
|
|
1804
1803
|
"Content-Type": "application/json",
|
|
1805
1804
|
Authorization: `Bearer ${T}`
|
|
1806
1805
|
},
|
|
1807
|
-
body:
|
|
1806
|
+
body: ye
|
|
1808
1807
|
});
|
|
1809
|
-
if (!
|
|
1810
|
-
const
|
|
1811
|
-
let
|
|
1808
|
+
if (!J.body) throw new Error("Readable stream not supported");
|
|
1809
|
+
const xe = J.body.getReader(), we = new TextDecoder();
|
|
1810
|
+
let K = "";
|
|
1812
1811
|
for (; ; ) {
|
|
1813
|
-
const { done:
|
|
1814
|
-
if (
|
|
1815
|
-
|
|
1816
|
-
const
|
|
1812
|
+
const { done: G, value: Z } = await xe.read();
|
|
1813
|
+
if (G) break;
|
|
1814
|
+
K += we.decode(Z, { stream: !0 });
|
|
1815
|
+
const X = K.split(`
|
|
1817
1816
|
`);
|
|
1818
|
-
|
|
1819
|
-
for (const
|
|
1820
|
-
if (
|
|
1821
|
-
const
|
|
1817
|
+
K = X.pop() || "";
|
|
1818
|
+
for (const oe of X)
|
|
1819
|
+
if (oe.startsWith("data:")) {
|
|
1820
|
+
const y = oe.slice(5).trim();
|
|
1822
1821
|
try {
|
|
1823
|
-
const
|
|
1824
|
-
|
|
1825
|
-
(
|
|
1826
|
-
(B,
|
|
1822
|
+
const W = JSON.parse(y);
|
|
1823
|
+
W.index === 0 && $(
|
|
1824
|
+
(j) => j.map(
|
|
1825
|
+
(B, re) => re === j.length - 1 ? {
|
|
1827
1826
|
...B,
|
|
1828
|
-
secondaryResponse:
|
|
1827
|
+
secondaryResponse: W.data,
|
|
1829
1828
|
secondaryLoading: !1
|
|
1830
1829
|
} : B
|
|
1831
1830
|
)
|
|
1832
1831
|
);
|
|
1833
|
-
} catch (
|
|
1834
|
-
|
|
1835
|
-
(
|
|
1836
|
-
(B,
|
|
1832
|
+
} catch (W) {
|
|
1833
|
+
$(
|
|
1834
|
+
(j) => j.map(
|
|
1835
|
+
(B, re) => re === j.length - 1 ? { ...B, secondaryLoading: !1 } : B
|
|
1837
1836
|
)
|
|
1838
|
-
), console.error("Secondary flow JSON parse error:",
|
|
1837
|
+
), console.error("Secondary flow JSON parse error:", W);
|
|
1839
1838
|
}
|
|
1840
1839
|
}
|
|
1841
1840
|
}
|
|
1842
1841
|
} catch (T) {
|
|
1843
1842
|
console.error("Secondary flow error:", T);
|
|
1844
1843
|
}
|
|
1845
|
-
},
|
|
1846
|
-
const
|
|
1847
|
-
if (
|
|
1848
|
-
|
|
1849
|
-
...
|
|
1844
|
+
}, V = async (d) => {
|
|
1845
|
+
const _ = d || L.trim();
|
|
1846
|
+
if (_) {
|
|
1847
|
+
v(!0), Y(""), n.current = null, r.current = null, o.current = null, s.current = null, $((C) => [
|
|
1848
|
+
...C,
|
|
1850
1849
|
{
|
|
1851
|
-
query:
|
|
1850
|
+
query: _,
|
|
1852
1851
|
response: "Thinking for what suits you best...",
|
|
1853
1852
|
potentialQuestions: "",
|
|
1854
1853
|
products: [],
|
|
@@ -1856,119 +1855,119 @@ const ve = (e) => {
|
|
|
1856
1855
|
}
|
|
1857
1856
|
]);
|
|
1858
1857
|
try {
|
|
1859
|
-
const
|
|
1858
|
+
const C = I, T = localStorage.getItem("customerNumber"), w = localStorage.getItem("isLoggedIn"), S = await R();
|
|
1860
1859
|
if (!S)
|
|
1861
1860
|
throw new Error("Failed to obtain access token");
|
|
1862
|
-
const
|
|
1863
|
-
registered: String(
|
|
1861
|
+
const ge = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
1862
|
+
registered: String(w || !1),
|
|
1864
1863
|
userId: String(T || (/* @__PURE__ */ new Date()).getTime())
|
|
1865
|
-
}).toString()}`,
|
|
1864
|
+
}).toString()}`, ye = JSON.stringify({
|
|
1866
1865
|
flowId: "MMHQKYI1NE",
|
|
1867
1866
|
flowAliasId: "SZF9ZK1ATE",
|
|
1868
1867
|
input: {
|
|
1869
|
-
userPrompt:
|
|
1870
|
-
whom:
|
|
1868
|
+
userPrompt: _,
|
|
1869
|
+
whom: C
|
|
1871
1870
|
}
|
|
1872
|
-
}),
|
|
1871
|
+
}), J = await fetch(ge, {
|
|
1873
1872
|
signal: AbortSignal.timeout(3e4),
|
|
1874
1873
|
method: "POST",
|
|
1875
1874
|
headers: {
|
|
1876
1875
|
"Content-Type": "application/json",
|
|
1877
1876
|
Authorization: `Bearer ${S}`
|
|
1878
1877
|
},
|
|
1879
|
-
body:
|
|
1878
|
+
body: ye
|
|
1880
1879
|
});
|
|
1881
|
-
if (!
|
|
1882
|
-
throw new Error(`HTTP error! status: ${
|
|
1883
|
-
if (!
|
|
1884
|
-
const
|
|
1885
|
-
let
|
|
1880
|
+
if (!J.ok)
|
|
1881
|
+
throw new Error(`HTTP error! status: ${J.status}`);
|
|
1882
|
+
if (!J.body) throw new Error("Readable stream not supported");
|
|
1883
|
+
const xe = J.body.getReader(), we = new TextDecoder();
|
|
1884
|
+
let K = "", G = "";
|
|
1886
1885
|
for (; ; ) {
|
|
1887
1886
|
E(!0);
|
|
1888
|
-
const { done:
|
|
1889
|
-
if (
|
|
1890
|
-
|
|
1891
|
-
const
|
|
1887
|
+
const { done: Z, value: X } = await xe.read();
|
|
1888
|
+
if (Z) break;
|
|
1889
|
+
K += we.decode(X, { stream: !0 });
|
|
1890
|
+
const oe = K.split(`
|
|
1892
1891
|
`);
|
|
1893
|
-
|
|
1894
|
-
for (const
|
|
1895
|
-
if (
|
|
1896
|
-
const
|
|
1892
|
+
K = oe.pop() || "";
|
|
1893
|
+
for (const y of oe)
|
|
1894
|
+
if (y.startsWith("data:")) {
|
|
1895
|
+
const W = y.slice(5).trim();
|
|
1897
1896
|
try {
|
|
1898
|
-
const
|
|
1899
|
-
|
|
1897
|
+
const j = JSON.parse(W);
|
|
1898
|
+
j.index == 1 && (G = j.data), $(
|
|
1900
1899
|
(B) => B.map(
|
|
1901
|
-
(
|
|
1902
|
-
...
|
|
1903
|
-
[
|
|
1904
|
-
} :
|
|
1900
|
+
(re, $e) => $e === B.length - 1 ? {
|
|
1901
|
+
...re,
|
|
1902
|
+
[j.index == 0 ? "response" : j.index == 1 ? "keywords" : j.index == 2 ? "potentialQuestions" : "end"]: j.data
|
|
1903
|
+
} : re
|
|
1905
1904
|
)
|
|
1906
1905
|
);
|
|
1907
|
-
} catch (
|
|
1908
|
-
console.error("Error parsing JSON:",
|
|
1906
|
+
} catch (j) {
|
|
1907
|
+
console.error("Error parsing JSON:", j);
|
|
1909
1908
|
}
|
|
1910
1909
|
}
|
|
1911
1910
|
}
|
|
1912
|
-
|
|
1913
|
-
} catch (
|
|
1914
|
-
console.error("Error sending message to Tanya:",
|
|
1911
|
+
ne(me(G));
|
|
1912
|
+
} catch (C) {
|
|
1913
|
+
console.error("Error sending message to Tanya:", C);
|
|
1915
1914
|
} finally {
|
|
1916
|
-
|
|
1915
|
+
v(!1);
|
|
1917
1916
|
}
|
|
1918
1917
|
}
|
|
1919
|
-
},
|
|
1920
|
-
const
|
|
1918
|
+
}, me = (d) => {
|
|
1919
|
+
const _ = d.match(
|
|
1921
1920
|
/top five relevant product or category names are: (.*)/i
|
|
1922
|
-
),
|
|
1923
|
-
return [...new Set(
|
|
1924
|
-
},
|
|
1925
|
-
if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof
|
|
1926
|
-
console.log(
|
|
1927
|
-
const
|
|
1928
|
-
for (const
|
|
1921
|
+
), w = (_ ? _[1] : d).split(", ").map((H) => H.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
1922
|
+
return [...new Set(w)].filter(Boolean).join(",");
|
|
1923
|
+
}, ne = async (d) => {
|
|
1924
|
+
if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof d == "string") {
|
|
1925
|
+
console.log(d, "keywords");
|
|
1926
|
+
const _ = d.split(",");
|
|
1927
|
+
for (const C of _) {
|
|
1929
1928
|
const T = await ct(
|
|
1930
|
-
|
|
1929
|
+
C,
|
|
1931
1930
|
i == null ? void 0 : i.access_token
|
|
1932
1931
|
);
|
|
1933
|
-
if (E(!1), (T == null ? void 0 : T.length) > 0 && (
|
|
1934
|
-
(
|
|
1935
|
-
(S,
|
|
1932
|
+
if (E(!1), (T == null ? void 0 : T.length) > 0 && ($(
|
|
1933
|
+
(w) => w.map(
|
|
1934
|
+
(S, H) => H === w.length - 1 ? {
|
|
1936
1935
|
...S,
|
|
1937
1936
|
products: [
|
|
1938
1937
|
...S.products || [],
|
|
1939
|
-
{ keyword:
|
|
1938
|
+
{ keyword: C, items: T, loading: !1 }
|
|
1940
1939
|
]
|
|
1941
1940
|
} : S
|
|
1942
1941
|
)
|
|
1943
1942
|
), !n.current || r.current == null)) {
|
|
1944
|
-
const
|
|
1945
|
-
n.current = String((
|
|
1946
|
-
const S = typeof (
|
|
1943
|
+
const w = T[0];
|
|
1944
|
+
n.current = String((w == null ? void 0 : w.product_name) ?? ""), o.current = w.image.link, r.current = w.product_id;
|
|
1945
|
+
const S = typeof (w == null ? void 0 : w.price) == "number" ? w.price : void 0;
|
|
1947
1946
|
s.current = typeof S == "number" && Number.isFinite(S) ? S : null;
|
|
1948
1947
|
}
|
|
1949
1948
|
}
|
|
1950
1949
|
} else
|
|
1951
|
-
for (const
|
|
1952
|
-
const
|
|
1953
|
-
|
|
1950
|
+
for (const _ of d) {
|
|
1951
|
+
const C = await ct(
|
|
1952
|
+
_,
|
|
1954
1953
|
i == null ? void 0 : i.access_token
|
|
1955
1954
|
);
|
|
1956
|
-
E(!1), (
|
|
1955
|
+
E(!1), (C == null ? void 0 : C.length) > 0 && $(
|
|
1957
1956
|
(T) => T.map(
|
|
1958
|
-
(
|
|
1959
|
-
...
|
|
1957
|
+
(w, S) => S === T.length - 1 ? {
|
|
1958
|
+
...w,
|
|
1960
1959
|
products: [
|
|
1961
|
-
...
|
|
1962
|
-
{ keyword:
|
|
1960
|
+
...w.products || [],
|
|
1961
|
+
{ keyword: _, items: C, loading: !1 }
|
|
1963
1962
|
]
|
|
1964
|
-
} :
|
|
1963
|
+
} : w
|
|
1965
1964
|
)
|
|
1966
1965
|
);
|
|
1967
1966
|
}
|
|
1968
1967
|
if (n.current) {
|
|
1969
|
-
|
|
1970
|
-
(
|
|
1971
|
-
(T,
|
|
1968
|
+
$(
|
|
1969
|
+
(C) => C.map(
|
|
1970
|
+
(T, w) => w === C.length - 1 ? {
|
|
1972
1971
|
...T,
|
|
1973
1972
|
productSnapshot: {
|
|
1974
1973
|
id: r.current,
|
|
@@ -1981,124 +1980,124 @@ const ve = (e) => {
|
|
|
1981
1980
|
} : T
|
|
1982
1981
|
)
|
|
1983
1982
|
);
|
|
1984
|
-
const
|
|
1983
|
+
const _ = JSON.parse(
|
|
1985
1984
|
sessionStorage.getItem("customerData") || "{}"
|
|
1986
1985
|
);
|
|
1987
|
-
(
|
|
1986
|
+
(_ == null ? void 0 : _.isGuest) == !1 ? (console.log("running secondary flow", Te), x(n.current, 0)) : console.log("not running secondary flow", Te);
|
|
1988
1987
|
}
|
|
1989
1988
|
E(!1);
|
|
1990
|
-
},
|
|
1991
|
-
var
|
|
1992
|
-
|
|
1989
|
+
}, Qt = async (d, _) => {
|
|
1990
|
+
var C, T, w, S, H, ge, ye, J, xe, we, K, G, Z, X, oe;
|
|
1991
|
+
F(!0);
|
|
1993
1992
|
try {
|
|
1994
|
-
const
|
|
1995
|
-
if (!((T = (
|
|
1996
|
-
|
|
1993
|
+
const y = await At(d.id);
|
|
1994
|
+
if (!((T = (C = y == null ? void 0 : y.variants) == null ? void 0 : C[0]) != null && T.product_id || (S = (w = y == null ? void 0 : y.variants) == null ? void 0 : w[0]) != null && S.productId) && !(y.type.item || y.type.bundle)) {
|
|
1995
|
+
F(!1), Q.error("Variants not found", {
|
|
1997
1996
|
position: "bottom-right",
|
|
1998
1997
|
autoClose: 1e3
|
|
1999
1998
|
}), console.error("No product variant found");
|
|
2000
1999
|
return;
|
|
2001
2000
|
}
|
|
2002
|
-
const
|
|
2001
|
+
const W = [
|
|
2003
2002
|
{
|
|
2004
|
-
product_id: ((
|
|
2005
|
-
quantity:
|
|
2003
|
+
product_id: ((H = y.variants) == null ? void 0 : H[0].product_id) || ((ge = y.variants) == null ? void 0 : ge[0].productId) || (y == null ? void 0 : y.id),
|
|
2004
|
+
quantity: _
|
|
2006
2005
|
}
|
|
2007
2006
|
];
|
|
2008
|
-
console.log(
|
|
2009
|
-
const
|
|
2007
|
+
console.log(W, "product data", "app version", Te);
|
|
2008
|
+
const j = JSON.parse(
|
|
2010
2009
|
sessionStorage.getItem("customerData") || "{}"
|
|
2011
|
-
), B =
|
|
2012
|
-
if (!
|
|
2013
|
-
const
|
|
2014
|
-
let { customer_token:
|
|
2015
|
-
|
|
2010
|
+
), B = j == null ? void 0 : j.basketId, re = !1, $e = localStorage.getItem(Ee), st = Date.now();
|
|
2011
|
+
if (!re || !$e || st >= parseInt($e)) {
|
|
2012
|
+
const Yt = await Et();
|
|
2013
|
+
let { customer_token: ue } = await $t(
|
|
2014
|
+
Yt
|
|
2016
2015
|
);
|
|
2017
|
-
if (
|
|
2016
|
+
if (ue = "Bearer " + i.access_token, !ue) {
|
|
2018
2017
|
console.error("Failed to get customer_token");
|
|
2019
2018
|
return;
|
|
2020
2019
|
}
|
|
2021
|
-
const
|
|
2022
|
-
if (
|
|
2020
|
+
const Zt = st + 300 * 1e3;
|
|
2021
|
+
if (Ue(ue), localStorage.setItem(Ee, Zt.toString()), B) {
|
|
2023
2022
|
const it = await Wt({
|
|
2024
2023
|
basketId: B,
|
|
2025
|
-
customer_token:
|
|
2024
|
+
customer_token: ue
|
|
2026
2025
|
});
|
|
2027
2026
|
if (it.status === 200 && it) {
|
|
2028
|
-
const Re = await
|
|
2027
|
+
const Re = await De(
|
|
2029
2028
|
B,
|
|
2030
|
-
|
|
2031
|
-
|
|
2029
|
+
W,
|
|
2030
|
+
ue
|
|
2032
2031
|
);
|
|
2033
|
-
((
|
|
2032
|
+
((ye = Re == null ? void 0 : Re.product_items) == null ? void 0 : ye.length) > 0 && (Q.success("Added to cart", {
|
|
2034
2033
|
position: "bottom-right",
|
|
2035
2034
|
autoClose: 3e3,
|
|
2036
2035
|
hideProgressBar: !1,
|
|
2037
2036
|
closeOnClick: !0,
|
|
2038
2037
|
pauseOnHover: !0,
|
|
2039
2038
|
draggable: !0
|
|
2040
|
-
}),
|
|
2039
|
+
}), ve(B), F(!1));
|
|
2041
2040
|
return;
|
|
2042
2041
|
}
|
|
2043
2042
|
}
|
|
2044
|
-
const
|
|
2043
|
+
const Xt = {
|
|
2045
2044
|
productItems: [
|
|
2046
2045
|
{
|
|
2047
|
-
productId: ((
|
|
2046
|
+
productId: ((J = y.variants) == null ? void 0 : J[0].product_id) || ((xe = y.variants) == null ? void 0 : xe[0].productId) || (y == null ? void 0 : y.id),
|
|
2048
2047
|
quantity: 1
|
|
2049
2048
|
}
|
|
2050
2049
|
]
|
|
2051
|
-
}, N = await Gt(
|
|
2050
|
+
}, N = await Gt(ue, Xt);
|
|
2052
2051
|
if (console.log(
|
|
2053
2052
|
N,
|
|
2054
2053
|
N == null ? void 0 : N.basket_id,
|
|
2055
2054
|
N == null ? void 0 : N.basketId,
|
|
2056
2055
|
"the basket response"
|
|
2057
2056
|
), !(N != null && N.basket_id || !(N != null && N.basketId))) {
|
|
2058
|
-
|
|
2057
|
+
F(!1), console.error("Failed to create basket");
|
|
2059
2058
|
return;
|
|
2060
2059
|
}
|
|
2061
|
-
|
|
2060
|
+
ke(
|
|
2062
2061
|
(N == null ? void 0 : N.basket_id) || (N == null ? void 0 : N.basketId)
|
|
2063
2062
|
);
|
|
2064
|
-
const
|
|
2063
|
+
const be = await De(
|
|
2065
2064
|
(N == null ? void 0 : N.basket_id) || (N == null ? void 0 : N.basketId),
|
|
2066
|
-
|
|
2067
|
-
|
|
2065
|
+
W,
|
|
2066
|
+
ue
|
|
2068
2067
|
);
|
|
2069
|
-
(((
|
|
2068
|
+
(((we = be == null ? void 0 : be.product_items) == null ? void 0 : we.length) > 0 || ((K = be == null ? void 0 : be.productItems) == null ? void 0 : K.length) > 0) && Q.success("Added to cart", {
|
|
2070
2069
|
position: "bottom-right",
|
|
2071
2070
|
autoClose: 3e3,
|
|
2072
2071
|
hideProgressBar: !1,
|
|
2073
2072
|
closeOnClick: !0,
|
|
2074
2073
|
pauseOnHover: !0,
|
|
2075
2074
|
draggable: !0
|
|
2076
|
-
}),
|
|
2075
|
+
}), ve(N.basket_id || (N == null ? void 0 : N.basketId));
|
|
2077
2076
|
}
|
|
2078
|
-
} catch (
|
|
2079
|
-
|
|
2077
|
+
} catch (y) {
|
|
2078
|
+
F(!1), console.error("Error adding to cart:", y), Q.error("Failed to add product to cart", {
|
|
2080
2079
|
position: "bottom-right",
|
|
2081
2080
|
autoClose: 3e3
|
|
2082
|
-
}), ((
|
|
2083
|
-
((
|
|
2081
|
+
}), ((G = y == null ? void 0 : y.response) == null ? void 0 : G.status) === 404 || // Basket not found
|
|
2082
|
+
((Z = y == null ? void 0 : y.response) == null ? void 0 : Z.status) === 401 ? (((X = y == null ? void 0 : y.response) == null ? void 0 : X.status) === 404 && ke(null), ((oe = y == null ? void 0 : y.response) == null ? void 0 : oe.status) === 401 && (ke(null), Ue(null))) : (console.error("Failed to add product to basket:", y.message), Q.error("Failed to add product to cart", {
|
|
2084
2083
|
position: "bottom-right",
|
|
2085
2084
|
autoClose: 3e3
|
|
2086
2085
|
}));
|
|
2087
2086
|
} finally {
|
|
2088
|
-
|
|
2087
|
+
ve();
|
|
2089
2088
|
}
|
|
2090
|
-
|
|
2089
|
+
F(!1);
|
|
2091
2090
|
};
|
|
2092
|
-
return /* @__PURE__ */ c("div", { className: "relative flex justify-center", children: /* @__PURE__ */
|
|
2091
|
+
return /* @__PURE__ */ c("div", { className: "relative flex justify-center", children: /* @__PURE__ */ f(tn, { open: a, onOpenChange: u, children: [
|
|
2093
2092
|
/* @__PURE__ */ c(
|
|
2094
|
-
|
|
2093
|
+
nn,
|
|
2095
2094
|
{
|
|
2096
|
-
onClick: () =>
|
|
2095
|
+
onClick: () => u(!0),
|
|
2097
2096
|
style: {
|
|
2098
2097
|
// background: storeDetails.tanyaThemeColor,
|
|
2099
2098
|
},
|
|
2100
2099
|
className: "flex items-center rounded-lg cursor-pointer hover:opacity-90 transition-opacity",
|
|
2101
|
-
children: /* @__PURE__ */ c("div", { className: "flex flex-col p-[5px]", children: /* @__PURE__ */
|
|
2100
|
+
children: /* @__PURE__ */ c("div", { className: "flex flex-col p-[5px]", children: /* @__PURE__ */ f(
|
|
2102
2101
|
"svg",
|
|
2103
2102
|
{
|
|
2104
2103
|
width: "40",
|
|
@@ -2107,7 +2106,7 @@ const ve = (e) => {
|
|
|
2107
2106
|
fill: "none",
|
|
2108
2107
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2109
2108
|
children: [
|
|
2110
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ f("g", { clipPath: "url(#clip0_958_585)", children: [
|
|
2111
2110
|
/* @__PURE__ */ c(
|
|
2112
2111
|
"path",
|
|
2113
2112
|
{
|
|
@@ -2130,8 +2129,8 @@ const ve = (e) => {
|
|
|
2130
2129
|
}
|
|
2131
2130
|
)
|
|
2132
2131
|
] }),
|
|
2133
|
-
/* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */
|
|
2132
|
+
/* @__PURE__ */ f("defs", { children: [
|
|
2133
|
+
/* @__PURE__ */ f(
|
|
2135
2134
|
"linearGradient",
|
|
2136
2135
|
{
|
|
2137
2136
|
id: "paint0_linear_958_585",
|
|
@@ -2153,15 +2152,15 @@ const ve = (e) => {
|
|
|
2153
2152
|
) })
|
|
2154
2153
|
}
|
|
2155
2154
|
),
|
|
2156
|
-
|
|
2155
|
+
b && /* @__PURE__ */ f(Ge, { children: [
|
|
2157
2156
|
/* @__PURE__ */ c(
|
|
2158
2157
|
"div",
|
|
2159
2158
|
{
|
|
2160
2159
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
2161
|
-
onClick: () =>
|
|
2160
|
+
onClick: () => u(!1)
|
|
2162
2161
|
}
|
|
2163
2162
|
),
|
|
2164
|
-
/* @__PURE__ */
|
|
2163
|
+
/* @__PURE__ */ f(
|
|
2165
2164
|
"div",
|
|
2166
2165
|
{
|
|
2167
2166
|
className: `
|
|
@@ -2169,16 +2168,16 @@ const ve = (e) => {
|
|
|
2169
2168
|
top-0 right-0
|
|
2170
2169
|
transition-transform duration-300 ease-in-out
|
|
2171
2170
|
lg:transform
|
|
2172
|
-
${
|
|
2171
|
+
${p ? "lg:translate-x-0" : "lg:translate-x-full"}
|
|
2173
2172
|
// For mobile: animate from bottom
|
|
2174
|
-
${
|
|
2173
|
+
${p ? "translate-y-0" : "translate-y-full"}
|
|
2175
2174
|
lg:translate-y-0
|
|
2176
2175
|
`,
|
|
2177
2176
|
style: {
|
|
2178
2177
|
background: "linear-gradient(170.1deg, #FFFFFF 60.03%, #E3DEEF 99.59%)"
|
|
2179
2178
|
},
|
|
2180
2179
|
children: [
|
|
2181
|
-
/* @__PURE__ */
|
|
2180
|
+
/* @__PURE__ */ f(
|
|
2182
2181
|
"div",
|
|
2183
2182
|
{
|
|
2184
2183
|
className: "flex justify-between p-3 bg-[#FFFFFF] border border-b-1 border-[#E5E5E5] ",
|
|
@@ -2188,12 +2187,12 @@ const ve = (e) => {
|
|
|
2188
2187
|
{
|
|
2189
2188
|
style: {
|
|
2190
2189
|
display: "flex",
|
|
2191
|
-
color:
|
|
2190
|
+
color: P.tanyaThemeContrastColor,
|
|
2192
2191
|
alignItems: "center",
|
|
2193
2192
|
gap: "0.5rem"
|
|
2194
2193
|
},
|
|
2195
|
-
children: /* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2194
|
+
children: /* @__PURE__ */ f("div", { className: "flex flex-col gap-1", children: [
|
|
2195
|
+
/* @__PURE__ */ f(
|
|
2197
2196
|
"div",
|
|
2198
2197
|
{
|
|
2199
2198
|
className: "flex gap-2 w-28 h-12 text-center items-center p-2 border rounded-l-[20px] rounded-tr-[20px]",
|
|
@@ -2201,7 +2200,7 @@ const ve = (e) => {
|
|
|
2201
2200
|
background: "linear-gradient(265.62deg, #6851C6 5.24%, #8668FF 98.49%)"
|
|
2202
2201
|
},
|
|
2203
2202
|
children: [
|
|
2204
|
-
/* @__PURE__ */
|
|
2203
|
+
/* @__PURE__ */ f(
|
|
2205
2204
|
"svg",
|
|
2206
2205
|
{
|
|
2207
2206
|
width: "20",
|
|
@@ -2225,7 +2224,7 @@ const ve = (e) => {
|
|
|
2225
2224
|
]
|
|
2226
2225
|
}
|
|
2227
2226
|
),
|
|
2228
|
-
/* @__PURE__ */
|
|
2227
|
+
/* @__PURE__ */ f(
|
|
2229
2228
|
"p",
|
|
2230
2229
|
{
|
|
2231
2230
|
className: "text-[#5B5B5B] font-nunitoSans font-semibold",
|
|
@@ -2249,7 +2248,7 @@ const ve = (e) => {
|
|
|
2249
2248
|
gap: "1.25rem",
|
|
2250
2249
|
margin: "0.75rem"
|
|
2251
2250
|
},
|
|
2252
|
-
children: /* @__PURE__ */ c("button", { onClick: () =>
|
|
2251
|
+
children: /* @__PURE__ */ c("button", { onClick: () => u(!1), children: /* @__PURE__ */ f(
|
|
2253
2252
|
"svg",
|
|
2254
2253
|
{
|
|
2255
2254
|
width: "24",
|
|
@@ -2258,7 +2257,7 @@ const ve = (e) => {
|
|
|
2258
2257
|
fill: "none",
|
|
2259
2258
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2260
2259
|
children: [
|
|
2261
|
-
/* @__PURE__ */
|
|
2260
|
+
/* @__PURE__ */ f("g", { clipPath: "url(#clip0_501_6036)", children: [
|
|
2262
2261
|
/* @__PURE__ */ c(
|
|
2263
2262
|
"path",
|
|
2264
2263
|
{
|
|
@@ -2297,50 +2296,50 @@ const ve = (e) => {
|
|
|
2297
2296
|
]
|
|
2298
2297
|
}
|
|
2299
2298
|
),
|
|
2300
|
-
/* @__PURE__ */
|
|
2301
|
-
/* @__PURE__ */
|
|
2299
|
+
/* @__PURE__ */ f("div", { className: "flex h-full md:flex-row lg:flex-row", children: [
|
|
2300
|
+
/* @__PURE__ */ f(
|
|
2302
2301
|
"div",
|
|
2303
2302
|
{
|
|
2304
|
-
className: `flex flex-col h-full ${
|
|
2303
|
+
className: `flex flex-col h-full ${A ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
2305
2304
|
children: [
|
|
2306
|
-
/* @__PURE__ */
|
|
2305
|
+
/* @__PURE__ */ f(
|
|
2307
2306
|
"div",
|
|
2308
2307
|
{
|
|
2309
2308
|
ref: he,
|
|
2310
2309
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
2311
2310
|
children: [
|
|
2312
|
-
(
|
|
2311
|
+
(P == null ? void 0 : P.whomRequired) && /* @__PURE__ */ f(
|
|
2313
2312
|
"div",
|
|
2314
2313
|
{
|
|
2315
2314
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
2316
2315
|
children: [
|
|
2317
2316
|
/* @__PURE__ */ c("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ c("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
|
|
2318
|
-
/* @__PURE__ */ c("div", { className: "flex flex-wrap gap-2 mt-2", children: e.map((
|
|
2317
|
+
/* @__PURE__ */ c("div", { className: "flex flex-wrap gap-2 mt-2", children: e.map((d) => /* @__PURE__ */ c(
|
|
2319
2318
|
"button",
|
|
2320
2319
|
{
|
|
2321
|
-
onClick: () =>
|
|
2320
|
+
onClick: () => He(d),
|
|
2322
2321
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
2323
2322
|
style: {
|
|
2324
|
-
backgroundColor:
|
|
2325
|
-
borderColor:
|
|
2323
|
+
backgroundColor: I === t[d] ? "#FFFFFF" : "#F3F3F3",
|
|
2324
|
+
borderColor: I === t[d] ? "#BBB3DD" : ""
|
|
2326
2325
|
},
|
|
2327
|
-
children:
|
|
2326
|
+
children: d
|
|
2328
2327
|
},
|
|
2329
|
-
|
|
2328
|
+
d
|
|
2330
2329
|
)) })
|
|
2331
2330
|
]
|
|
2332
2331
|
}
|
|
2333
2332
|
),
|
|
2334
|
-
|
|
2335
|
-
var
|
|
2336
|
-
return /* @__PURE__ */
|
|
2337
|
-
/* @__PURE__ */ c("div", { className: "flex justify-end", children: /* @__PURE__ */ c("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children:
|
|
2338
|
-
|
|
2333
|
+
z.map((d, _) => {
|
|
2334
|
+
var C, T;
|
|
2335
|
+
return /* @__PURE__ */ f("div", { children: [
|
|
2336
|
+
/* @__PURE__ */ c("div", { className: "flex justify-end", children: /* @__PURE__ */ c("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: d.query }) }),
|
|
2337
|
+
d.response && d.response.includes("Thinking") ? /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
2339
2338
|
"div",
|
|
2340
2339
|
{
|
|
2341
2340
|
className: "font-nunitoSans animate-pulse font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
2342
2341
|
dangerouslySetInnerHTML: {
|
|
2343
|
-
__html: Ve(
|
|
2342
|
+
__html: Ve(d.response)
|
|
2344
2343
|
}
|
|
2345
2344
|
}
|
|
2346
2345
|
) }) : /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
@@ -2348,41 +2347,41 @@ const ve = (e) => {
|
|
|
2348
2347
|
{
|
|
2349
2348
|
className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
2350
2349
|
dangerouslySetInnerHTML: {
|
|
2351
|
-
__html: Ve(
|
|
2350
|
+
__html: Ve(d.response)
|
|
2352
2351
|
}
|
|
2353
2352
|
}
|
|
2354
2353
|
) }),
|
|
2355
|
-
|
|
2356
|
-
(
|
|
2357
|
-
|
|
2354
|
+
U && !d.response.includes("Thinking") && ((C = d.products) == null ? void 0 : C.length) == 0 && /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", { className: "text-sm animate-pulse font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: "Finding best products for you" }) }),
|
|
2355
|
+
(d == null ? void 0 : d.products) && ((T = d == null ? void 0 : d.products) == null ? void 0 : T.length) > 0 && /* @__PURE__ */ c(
|
|
2356
|
+
fo,
|
|
2358
2357
|
{
|
|
2359
|
-
chat:
|
|
2360
|
-
storeDetails:
|
|
2358
|
+
chat: d.products,
|
|
2359
|
+
storeDetails: P
|
|
2361
2360
|
}
|
|
2362
2361
|
),
|
|
2363
|
-
|
|
2362
|
+
d.potentialQuestions.length > 0 && /* @__PURE__ */ f("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
2364
2363
|
/* @__PURE__ */ c(
|
|
2365
2364
|
"p",
|
|
2366
2365
|
{
|
|
2367
2366
|
className: "font-nunitoSans font-bold text-sm text-[#494949]",
|
|
2368
|
-
style: { color:
|
|
2367
|
+
style: { color: P.themeDarkColor },
|
|
2369
2368
|
children: "Why not explore these inquiries..."
|
|
2370
2369
|
}
|
|
2371
2370
|
),
|
|
2372
|
-
|
|
2371
|
+
d.potentialQuestions.split(",").map((w, S) => /* @__PURE__ */ c(
|
|
2373
2372
|
"button",
|
|
2374
2373
|
{
|
|
2375
|
-
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${
|
|
2376
|
-
onClick: () =>
|
|
2374
|
+
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${P.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
2375
|
+
onClick: () => V(w),
|
|
2377
2376
|
style: {
|
|
2378
|
-
backgroundColor:
|
|
2377
|
+
backgroundColor: P.tanyaThemeColorLight
|
|
2379
2378
|
},
|
|
2380
|
-
children:
|
|
2379
|
+
children: w
|
|
2381
2380
|
},
|
|
2382
2381
|
S
|
|
2383
2382
|
))
|
|
2384
2383
|
] }),
|
|
2385
|
-
|
|
2384
|
+
d.secondaryLoading && /* @__PURE__ */ c("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ f(
|
|
2386
2385
|
"div",
|
|
2387
2386
|
{
|
|
2388
2387
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -2390,7 +2389,7 @@ const ve = (e) => {
|
|
|
2390
2389
|
margin: "0.75rem"
|
|
2391
2390
|
},
|
|
2392
2391
|
children: [
|
|
2393
|
-
/* @__PURE__ */
|
|
2392
|
+
/* @__PURE__ */ f("div", { className: "flex gap-1", children: [
|
|
2394
2393
|
/* @__PURE__ */ c("div", { className: "tanya-sparkle tanya-sparkle-1", children: "✨" }),
|
|
2395
2394
|
/* @__PURE__ */ c("div", { className: "tanya-sparkle tanya-sparkle-2", children: "✨" }),
|
|
2396
2395
|
/* @__PURE__ */ c("div", { className: "tanya-sparkle tanya-sparkle-3", children: "✨" })
|
|
@@ -2400,7 +2399,7 @@ const ve = (e) => {
|
|
|
2400
2399
|
"p",
|
|
2401
2400
|
{
|
|
2402
2401
|
className: "font-semibold tanya-pulse",
|
|
2403
|
-
style: { color:
|
|
2402
|
+
style: { color: P.themeDarkColor },
|
|
2404
2403
|
children: "I’ve found a special surprise crafted just for you… hang on a sec!"
|
|
2405
2404
|
}
|
|
2406
2405
|
),
|
|
@@ -2408,35 +2407,35 @@ const ve = (e) => {
|
|
|
2408
2407
|
"p",
|
|
2409
2408
|
{
|
|
2410
2409
|
className: "tanya-dots mt-1",
|
|
2411
|
-
style: { color:
|
|
2410
|
+
style: { color: P.themeDarkColor },
|
|
2412
2411
|
children: "• • •"
|
|
2413
2412
|
}
|
|
2414
2413
|
)
|
|
2415
2414
|
]
|
|
2416
2415
|
}
|
|
2417
2416
|
) }),
|
|
2418
|
-
|
|
2417
|
+
d.secondaryResponse && /* @__PURE__ */ c(Ge, { children: /* @__PURE__ */ f("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
|
|
2419
2418
|
/* @__PURE__ */ c(
|
|
2420
2419
|
"div",
|
|
2421
2420
|
{
|
|
2422
2421
|
className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
|
|
2423
2422
|
style: {
|
|
2424
|
-
backgroundColor:
|
|
2423
|
+
backgroundColor: P.tanyaThemeColorLight
|
|
2425
2424
|
},
|
|
2426
2425
|
dangerouslySetInnerHTML: {
|
|
2427
2426
|
__html: Ve(
|
|
2428
|
-
|
|
2427
|
+
d.secondaryResponse
|
|
2429
2428
|
)
|
|
2430
2429
|
}
|
|
2431
2430
|
}
|
|
2432
2431
|
),
|
|
2433
|
-
|
|
2434
|
-
/* @__PURE__ */ c("div", { className: "mt-4 w-full", children: /* @__PURE__ */
|
|
2432
|
+
d.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
2433
|
+
/* @__PURE__ */ c("div", { className: "mt-4 w-full", children: /* @__PURE__ */ f(
|
|
2435
2434
|
"div",
|
|
2436
2435
|
{
|
|
2437
2436
|
className: "flex gap-4 items-stretch rounded-2xl p-4",
|
|
2438
2437
|
style: {
|
|
2439
|
-
backgroundColor:
|
|
2438
|
+
backgroundColor: P.tanyaThemeColorLight
|
|
2440
2439
|
},
|
|
2441
2440
|
children: [
|
|
2442
2441
|
/* @__PURE__ */ c(
|
|
@@ -2448,44 +2447,44 @@ const ve = (e) => {
|
|
|
2448
2447
|
height: 112,
|
|
2449
2448
|
borderColor: "#eee"
|
|
2450
2449
|
},
|
|
2451
|
-
children:
|
|
2450
|
+
children: d.productSnapshot.image ? /* @__PURE__ */ c(
|
|
2452
2451
|
"img",
|
|
2453
2452
|
{
|
|
2454
|
-
src:
|
|
2455
|
-
alt:
|
|
2453
|
+
src: d.productSnapshot.image,
|
|
2454
|
+
alt: d.productSnapshot.name,
|
|
2456
2455
|
className: "w-full h-full object-cover"
|
|
2457
2456
|
}
|
|
2458
2457
|
) : /* @__PURE__ */ c("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
2459
2458
|
}
|
|
2460
2459
|
),
|
|
2461
|
-
/* @__PURE__ */
|
|
2462
|
-
/* @__PURE__ */
|
|
2463
|
-
/* @__PURE__ */ c("p", { className: "font-semibold text-[15px] leading-snug", children:
|
|
2464
|
-
/* @__PURE__ */ c("p", { className: "mt-1 text-[14px] font-medium", children:
|
|
2460
|
+
/* @__PURE__ */ f("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
2461
|
+
/* @__PURE__ */ f("div", { children: [
|
|
2462
|
+
/* @__PURE__ */ c("p", { className: "font-semibold text-[15px] leading-snug", children: d.productSnapshot.name }),
|
|
2463
|
+
/* @__PURE__ */ c("p", { className: "mt-1 text-[14px] font-medium", children: d.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
2465
2464
|
style: "currency",
|
|
2466
|
-
currency: (
|
|
2465
|
+
currency: (P == null ? void 0 : P.currency) || "USD"
|
|
2467
2466
|
}).format(
|
|
2468
|
-
|
|
2467
|
+
d.productSnapshot.price
|
|
2469
2468
|
) : "" }),
|
|
2470
|
-
|
|
2469
|
+
d.productSnapshot.points > 0 && /* @__PURE__ */ f("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
2471
2470
|
"You will earn",
|
|
2472
2471
|
" ",
|
|
2473
|
-
/* @__PURE__ */
|
|
2474
|
-
|
|
2472
|
+
/* @__PURE__ */ f("strong", { children: [
|
|
2473
|
+
d.productSnapshot.points,
|
|
2475
2474
|
" ",
|
|
2476
2475
|
"points"
|
|
2477
2476
|
] })
|
|
2478
2477
|
] })
|
|
2479
2478
|
] }),
|
|
2480
|
-
/* @__PURE__ */
|
|
2481
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ f("div", { className: "mt-3 flex items-center gap-3", children: [
|
|
2480
|
+
/* @__PURE__ */ f("div", { className: "flex items-center border rounded-full overflow-hidden", children: [
|
|
2482
2481
|
/* @__PURE__ */ c(
|
|
2483
2482
|
"button",
|
|
2484
2483
|
{
|
|
2485
2484
|
className: "px-3 py-1 text-sm",
|
|
2486
|
-
onClick: () =>
|
|
2487
|
-
(
|
|
2488
|
-
(S,
|
|
2485
|
+
onClick: () => $(
|
|
2486
|
+
(w) => w.map(
|
|
2487
|
+
(S, H) => H === _ && S.productSnapshot ? {
|
|
2489
2488
|
...S,
|
|
2490
2489
|
productSnapshot: {
|
|
2491
2490
|
...S.productSnapshot,
|
|
@@ -2499,19 +2498,19 @@ const ve = (e) => {
|
|
|
2499
2498
|
),
|
|
2500
2499
|
style: {
|
|
2501
2500
|
background: "transparent",
|
|
2502
|
-
color:
|
|
2501
|
+
color: P.themeDarkColor
|
|
2503
2502
|
},
|
|
2504
2503
|
children: "−"
|
|
2505
2504
|
}
|
|
2506
2505
|
),
|
|
2507
|
-
/* @__PURE__ */ c("div", { className: "px-3 py-1 text-sm select-none", children:
|
|
2506
|
+
/* @__PURE__ */ c("div", { className: "px-3 py-1 text-sm select-none", children: d.productSnapshot.quantity }),
|
|
2508
2507
|
/* @__PURE__ */ c(
|
|
2509
2508
|
"button",
|
|
2510
2509
|
{
|
|
2511
2510
|
className: "px-3 py-1 text-sm",
|
|
2512
|
-
onClick: () =>
|
|
2513
|
-
(
|
|
2514
|
-
(S,
|
|
2511
|
+
onClick: () => $(
|
|
2512
|
+
(w) => w.map(
|
|
2513
|
+
(S, H) => H === _ && S.productSnapshot ? {
|
|
2515
2514
|
...S,
|
|
2516
2515
|
productSnapshot: {
|
|
2517
2516
|
...S.productSnapshot,
|
|
@@ -2522,7 +2521,7 @@ const ve = (e) => {
|
|
|
2522
2521
|
),
|
|
2523
2522
|
style: {
|
|
2524
2523
|
background: "transparent",
|
|
2525
|
-
color:
|
|
2524
|
+
color: P.themeDarkColor
|
|
2526
2525
|
},
|
|
2527
2526
|
children: "+"
|
|
2528
2527
|
}
|
|
@@ -2532,21 +2531,21 @@ const ve = (e) => {
|
|
|
2532
2531
|
"button",
|
|
2533
2532
|
{
|
|
2534
2533
|
onClick: () => {
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2534
|
+
Qt(
|
|
2535
|
+
q(
|
|
2536
|
+
d.productSnapshot
|
|
2538
2537
|
),
|
|
2539
|
-
|
|
2538
|
+
d.productSnapshot.quantity
|
|
2540
2539
|
);
|
|
2541
2540
|
},
|
|
2542
|
-
disabled:
|
|
2541
|
+
disabled: k,
|
|
2543
2542
|
className: "px-4 py-2 rounded-full font-medium",
|
|
2544
2543
|
style: {
|
|
2545
|
-
background:
|
|
2546
|
-
color: (
|
|
2547
|
-
opacity:
|
|
2544
|
+
background: P.tanyaThemeColor,
|
|
2545
|
+
color: (P == null ? void 0 : P.tanyaThemeContrastColor) || "#fff",
|
|
2546
|
+
opacity: k ? 0.8 : 1
|
|
2548
2547
|
},
|
|
2549
|
-
children:
|
|
2548
|
+
children: k ? "Adding..." : "Add to cart"
|
|
2550
2549
|
}
|
|
2551
2550
|
)
|
|
2552
2551
|
] })
|
|
@@ -2556,7 +2555,7 @@ const ve = (e) => {
|
|
|
2556
2555
|
) })
|
|
2557
2556
|
] }) }),
|
|
2558
2557
|
/* @__PURE__ */ c("div", { className: "mb-20" })
|
|
2559
|
-
] },
|
|
2558
|
+
] }, _);
|
|
2560
2559
|
})
|
|
2561
2560
|
]
|
|
2562
2561
|
}
|
|
@@ -2568,17 +2567,17 @@ const ve = (e) => {
|
|
|
2568
2567
|
style: {
|
|
2569
2568
|
background: "linear-gradient(180deg, #B09FFF 0%, #8D79F6 100%)"
|
|
2570
2569
|
},
|
|
2571
|
-
children: /* @__PURE__ */
|
|
2570
|
+
children: /* @__PURE__ */ f("div", { className: "flex items-center bg-[#FFFFFF] flex-1 rounded-xl px-2 py-1", children: [
|
|
2572
2571
|
/* @__PURE__ */ c(
|
|
2573
2572
|
"input",
|
|
2574
2573
|
{
|
|
2575
2574
|
className: "flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",
|
|
2576
2575
|
placeholder: "How can I help you...",
|
|
2577
|
-
value:
|
|
2576
|
+
value: L,
|
|
2578
2577
|
autoFocus: !0,
|
|
2579
|
-
onChange: (
|
|
2580
|
-
onKeyDown: (
|
|
2581
|
-
|
|
2578
|
+
onChange: (d) => Y(d.target.value),
|
|
2579
|
+
onKeyDown: (d) => {
|
|
2580
|
+
d.key === "Enter" && !m && V();
|
|
2582
2581
|
}
|
|
2583
2582
|
}
|
|
2584
2583
|
),
|
|
@@ -2586,16 +2585,16 @@ const ve = (e) => {
|
|
|
2586
2585
|
"button",
|
|
2587
2586
|
{
|
|
2588
2587
|
type: "submit",
|
|
2589
|
-
disabled:
|
|
2588
|
+
disabled: m,
|
|
2590
2589
|
className: "p-3",
|
|
2591
|
-
onClick: () =>
|
|
2592
|
-
children:
|
|
2590
|
+
onClick: () => V(),
|
|
2591
|
+
children: m ? /* @__PURE__ */ c(
|
|
2593
2592
|
"div",
|
|
2594
2593
|
{
|
|
2595
2594
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
2596
2595
|
style: {
|
|
2597
2596
|
borderBottom: "2px solid",
|
|
2598
|
-
color:
|
|
2597
|
+
color: P.tanyaThemeColor
|
|
2599
2598
|
}
|
|
2600
2599
|
}
|
|
2601
2600
|
) : /* @__PURE__ */ c(
|
|
@@ -2623,7 +2622,7 @@ const ve = (e) => {
|
|
|
2623
2622
|
]
|
|
2624
2623
|
}
|
|
2625
2624
|
),
|
|
2626
|
-
/* @__PURE__ */ c(
|
|
2625
|
+
/* @__PURE__ */ c(ho, {})
|
|
2627
2626
|
] })
|
|
2628
2627
|
]
|
|
2629
2628
|
}
|
|
@@ -2632,6 +2631,6 @@ const ve = (e) => {
|
|
|
2632
2631
|
] }) });
|
|
2633
2632
|
};
|
|
2634
2633
|
export {
|
|
2635
|
-
|
|
2634
|
+
Co as TanyaChatbot
|
|
2636
2635
|
};
|
|
2637
2636
|
//# sourceMappingURL=tanya-chatbot.es.js.map
|