tanya-chatbot 0.7.0 → 0.7.2
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.es.js
CHANGED
|
@@ -259,7 +259,7 @@ const Zo = ({
|
|
|
259
259
|
}
|
|
260
260
|
),
|
|
261
261
|
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: e.slice(n, n + r).map((l) => {
|
|
262
|
-
var g, p,
|
|
262
|
+
var g, p, y, x;
|
|
263
263
|
return /* @__PURE__ */ c(
|
|
264
264
|
"div",
|
|
265
265
|
{
|
|
@@ -299,7 +299,7 @@ const Zo = ({
|
|
|
299
299
|
zIndex: 50
|
|
300
300
|
},
|
|
301
301
|
children: l != null && l.productName ? l.productName : l != null && l.product_name ? l.product_name : Jr(
|
|
302
|
-
Hr((
|
|
302
|
+
Hr((y = l == null ? void 0 : l.name) == null ? void 0 : y["en-US"]),
|
|
303
303
|
60
|
|
304
304
|
) || "Product"
|
|
305
305
|
}
|
|
@@ -446,13 +446,13 @@ const it = (e) => {
|
|
|
446
446
|
console.error("Error storing token:", t);
|
|
447
447
|
}
|
|
448
448
|
}, Wr = 300, ra = ({ addToCartPwa: e }) => {
|
|
449
|
-
var l, g, p,
|
|
449
|
+
var l, g, p, y, x, S;
|
|
450
450
|
const t = In(), r = Yt((_) => _.product.product), n = Yt((_) => _.store.store), [o, s] = C(!!r);
|
|
451
451
|
if (be(() => {
|
|
452
452
|
s(!!r);
|
|
453
453
|
}, [r]), !r) return null;
|
|
454
454
|
const i = async () => {
|
|
455
|
-
var _, F, N, P, R,
|
|
455
|
+
var _, F, N, P, R, w, V, je, E, H, we, ae, G, Pe, $e, he;
|
|
456
456
|
try {
|
|
457
457
|
if (!((F = (_ = r == null ? void 0 : r.variants) == null ? void 0 : _[0]) != null && F.product_id) && !(r.type.item || r.type.bundle) && !((P = (N = r == null ? void 0 : r.variants) == null ? void 0 : N[0]) != null && P.productId)) {
|
|
458
458
|
Me.error("Variants not available", {
|
|
@@ -463,7 +463,7 @@ const it = (e) => {
|
|
|
463
463
|
}
|
|
464
464
|
const L = [
|
|
465
465
|
{
|
|
466
|
-
product_id: ((R = r.variants) == null ? void 0 : R[0].product_id) || ((
|
|
466
|
+
product_id: ((R = r.variants) == null ? void 0 : R[0].product_id) || ((w = r.variants) == null ? void 0 : w[0].productId) || (r == null ? void 0 : r.id),
|
|
467
467
|
quantity: 1
|
|
468
468
|
}
|
|
469
469
|
], O = JSON.parse(
|
|
@@ -518,7 +518,7 @@ const it = (e) => {
|
|
|
518
518
|
L,
|
|
519
519
|
_e
|
|
520
520
|
);
|
|
521
|
-
console.log("object added to basket"), (((
|
|
521
|
+
console.log("object added to basket"), (((we = le == null ? void 0 : le.product_items) == null ? void 0 : we.length) > 0 || ((ae = le == null ? void 0 : le.productItems) == null ? void 0 : ae.length) > 0) && Me.success("Added to cart", {
|
|
522
522
|
position: "bottom-right",
|
|
523
523
|
autoClose: 3e3,
|
|
524
524
|
hideProgressBar: !1,
|
|
@@ -583,7 +583,7 @@ const it = (e) => {
|
|
|
583
583
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ a(
|
|
584
584
|
"img",
|
|
585
585
|
{
|
|
586
|
-
src: (
|
|
586
|
+
src: (y = (p = (g = (l = r.imageGroups) == null ? void 0 : l[0]) == null ? void 0 : g.images) == null ? void 0 : p[0]) == null ? void 0 : y.link,
|
|
587
587
|
alt: r.name,
|
|
588
588
|
className: "rounded-[10px]"
|
|
589
589
|
}
|
|
@@ -711,7 +711,7 @@ const it = (e) => {
|
|
|
711
711
|
Others: "others"
|
|
712
712
|
}, s = Re(null), i = Re(null), d = Re(null), l = Re(null), [g, p] = C(null);
|
|
713
713
|
Re(null);
|
|
714
|
-
const [
|
|
714
|
+
const [y, x] = C(!1), [S, _] = C(!1), [F, N] = C(!1), [P, R] = C(!1), [w, V] = C(!1), [je, E] = C(!1), [H, we] = C(""), [ae, G] = C(""), Pe = (m) => ({
|
|
715
715
|
id: m.id,
|
|
716
716
|
title: m.name,
|
|
717
717
|
image: m.image ?? "",
|
|
@@ -744,8 +744,8 @@ const it = (e) => {
|
|
|
744
744
|
_(!1), setTimeout(() => N(!1), 300);
|
|
745
745
|
};
|
|
746
746
|
be(() => {
|
|
747
|
-
|
|
748
|
-
}, [
|
|
747
|
+
y ? Xe() : Ye();
|
|
748
|
+
}, [y]);
|
|
749
749
|
const ve = (m) => {
|
|
750
750
|
G(o[m]);
|
|
751
751
|
};
|
|
@@ -845,7 +845,7 @@ const it = (e) => {
|
|
|
845
845
|
}, Te = async (m) => {
|
|
846
846
|
const j = m || H.trim();
|
|
847
847
|
if (j) {
|
|
848
|
-
V(!0),
|
|
848
|
+
V(!0), we(""), s.current = null, i.current = null, d.current = null, l.current = null, he(($) => [
|
|
849
849
|
...$,
|
|
850
850
|
{
|
|
851
851
|
query: j,
|
|
@@ -1069,7 +1069,7 @@ const it = (e) => {
|
|
|
1069
1069
|
};
|
|
1070
1070
|
return be(() => {
|
|
1071
1071
|
F ? setTimeout(() => _(!0), 10) : _(!1);
|
|
1072
|
-
}, [F]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ c(Yo, { open:
|
|
1072
|
+
}, [F]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ c(Yo, { open: y, onOpenChange: x, children: [
|
|
1073
1073
|
/* @__PURE__ */ a(
|
|
1074
1074
|
Jo,
|
|
1075
1075
|
{
|
|
@@ -1558,9 +1558,9 @@ const it = (e) => {
|
|
|
1558
1558
|
placeholder: "How can I help you...",
|
|
1559
1559
|
value: H,
|
|
1560
1560
|
autoFocus: !0,
|
|
1561
|
-
onChange: (m) =>
|
|
1561
|
+
onChange: (m) => we(m.target.value),
|
|
1562
1562
|
onKeyDown: (m) => {
|
|
1563
|
-
m.key === "Enter" && !
|
|
1563
|
+
m.key === "Enter" && !w && Te();
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
1566
|
),
|
|
@@ -1568,10 +1568,10 @@ const it = (e) => {
|
|
|
1568
1568
|
"button",
|
|
1569
1569
|
{
|
|
1570
1570
|
type: "submit",
|
|
1571
|
-
disabled:
|
|
1571
|
+
disabled: w,
|
|
1572
1572
|
className: "p-3",
|
|
1573
1573
|
onClick: () => Te(),
|
|
1574
|
-
children:
|
|
1574
|
+
children: w ? /* @__PURE__ */ a(
|
|
1575
1575
|
"div",
|
|
1576
1576
|
{
|
|
1577
1577
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
@@ -1677,19 +1677,19 @@ function zt(e) {
|
|
|
1677
1677
|
e.debug = zt("debug"), e.log = zt("log"), e.warn = zt("warn"), e.error = zt("error");
|
|
1678
1678
|
})(st || (st = {}));
|
|
1679
1679
|
var Mn = "3.14.0";
|
|
1680
|
-
function
|
|
1680
|
+
function wt(e) {
|
|
1681
1681
|
try {
|
|
1682
1682
|
return e();
|
|
1683
1683
|
} catch {
|
|
1684
1684
|
}
|
|
1685
1685
|
}
|
|
1686
|
-
const hr =
|
|
1686
|
+
const hr = wt(function() {
|
|
1687
1687
|
return globalThis;
|
|
1688
|
-
}) ||
|
|
1688
|
+
}) || wt(function() {
|
|
1689
1689
|
return window;
|
|
1690
|
-
}) ||
|
|
1690
|
+
}) || wt(function() {
|
|
1691
1691
|
return self;
|
|
1692
|
-
}) ||
|
|
1692
|
+
}) || wt(function() {
|
|
1693
1693
|
return global;
|
|
1694
1694
|
}) || // We don't expect the Function constructor ever to be invoked at runtime, as
|
|
1695
1695
|
// long as at least one of globalThis, window, self, or global is defined, so
|
|
@@ -1697,8 +1697,8 @@ const hr = yt(function() {
|
|
|
1697
1697
|
// detect syntactic usage of the Function constructor. If you think you can
|
|
1698
1698
|
// improve your static analysis to detect this obfuscation, think again. This
|
|
1699
1699
|
// is an arms race you cannot win, at least not in JavaScript.
|
|
1700
|
-
|
|
1701
|
-
return
|
|
1700
|
+
wt(function() {
|
|
1701
|
+
return wt.constructor("return this")();
|
|
1702
1702
|
});
|
|
1703
1703
|
var Gr = /* @__PURE__ */ new Map();
|
|
1704
1704
|
function la(e) {
|
|
@@ -1923,7 +1923,7 @@ function _t(e) {
|
|
|
1923
1923
|
var t = e.constructor;
|
|
1924
1924
|
return t !== void 0 && (t = t[qn], t === null && (t = void 0)), t !== void 0 ? t : me;
|
|
1925
1925
|
}
|
|
1926
|
-
function
|
|
1926
|
+
function wa(e) {
|
|
1927
1927
|
return e instanceof me;
|
|
1928
1928
|
}
|
|
1929
1929
|
function xt(e) {
|
|
@@ -1957,7 +1957,7 @@ function Rn(e) {
|
|
|
1957
1957
|
function gr(e) {
|
|
1958
1958
|
e._observer = void 0, e._queue = void 0, e._state = "closed";
|
|
1959
1959
|
}
|
|
1960
|
-
function
|
|
1960
|
+
function ya(e) {
|
|
1961
1961
|
var t = e._queue;
|
|
1962
1962
|
if (t) {
|
|
1963
1963
|
e._queue = void 0, e._state = "ready";
|
|
@@ -2001,7 +2001,7 @@ function sr(e, t, r) {
|
|
|
2001
2001
|
type: t,
|
|
2002
2002
|
value: r
|
|
2003
2003
|
}], Ut(function() {
|
|
2004
|
-
return
|
|
2004
|
+
return ya(e);
|
|
2005
2005
|
});
|
|
2006
2006
|
return;
|
|
2007
2007
|
}
|
|
@@ -2130,19 +2130,19 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2130
2130
|
var s = _t(this), i = arguments.length > 1, d = !1, l = arguments[1], g = l;
|
|
2131
2131
|
return new s(function(p) {
|
|
2132
2132
|
return o.subscribe({
|
|
2133
|
-
next: function(
|
|
2133
|
+
next: function(y) {
|
|
2134
2134
|
var x = !d;
|
|
2135
2135
|
if (d = !0, !x || i)
|
|
2136
2136
|
try {
|
|
2137
|
-
g = n(g,
|
|
2137
|
+
g = n(g, y);
|
|
2138
2138
|
} catch (S) {
|
|
2139
2139
|
return p.error(S);
|
|
2140
2140
|
}
|
|
2141
2141
|
else
|
|
2142
|
-
g =
|
|
2142
|
+
g = y;
|
|
2143
2143
|
},
|
|
2144
|
-
error: function(
|
|
2145
|
-
p.error(
|
|
2144
|
+
error: function(y) {
|
|
2145
|
+
p.error(y);
|
|
2146
2146
|
},
|
|
2147
2147
|
complete: function() {
|
|
2148
2148
|
if (!d && !i) return p.error(new TypeError("Cannot reduce an empty sequence"));
|
|
@@ -2156,7 +2156,7 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2156
2156
|
var d = _t(this);
|
|
2157
2157
|
return new d(function(l) {
|
|
2158
2158
|
var g, p = 0;
|
|
2159
|
-
function
|
|
2159
|
+
function y(x) {
|
|
2160
2160
|
g = x.subscribe({
|
|
2161
2161
|
next: function(S) {
|
|
2162
2162
|
l.next(S);
|
|
@@ -2165,11 +2165,11 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2165
2165
|
l.error(S);
|
|
2166
2166
|
},
|
|
2167
2167
|
complete: function() {
|
|
2168
|
-
p === s.length ? (g = void 0, l.complete()) :
|
|
2168
|
+
p === s.length ? (g = void 0, l.complete()) : y(d.from(s[p++]));
|
|
2169
2169
|
}
|
|
2170
2170
|
});
|
|
2171
2171
|
}
|
|
2172
|
-
return
|
|
2172
|
+
return y(n), function() {
|
|
2173
2173
|
g && (g.unsubscribe(), g = void 0);
|
|
2174
2174
|
};
|
|
2175
2175
|
});
|
|
@@ -2186,7 +2186,7 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2186
2186
|
} catch (x) {
|
|
2187
2187
|
return i.error(x);
|
|
2188
2188
|
}
|
|
2189
|
-
var
|
|
2189
|
+
var y = s.from(p).subscribe({
|
|
2190
2190
|
next: function(x) {
|
|
2191
2191
|
i.next(x);
|
|
2192
2192
|
},
|
|
@@ -2194,11 +2194,11 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2194
2194
|
i.error(x);
|
|
2195
2195
|
},
|
|
2196
2196
|
complete: function() {
|
|
2197
|
-
var x = d.indexOf(
|
|
2197
|
+
var x = d.indexOf(y);
|
|
2198
2198
|
x >= 0 && d.splice(x, 1), g();
|
|
2199
2199
|
}
|
|
2200
2200
|
});
|
|
2201
|
-
d.push(
|
|
2201
|
+
d.push(y);
|
|
2202
2202
|
},
|
|
2203
2203
|
error: function(p) {
|
|
2204
2204
|
i.error(p);
|
|
@@ -2225,7 +2225,7 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2225
2225
|
if (s) {
|
|
2226
2226
|
var i = s.call(n);
|
|
2227
2227
|
if (Object(i) !== i) throw new TypeError(i + " is not an object");
|
|
2228
|
-
return
|
|
2228
|
+
return wa(i) && i.constructor === o ? i : new o(function(d) {
|
|
2229
2229
|
return i.subscribe(d);
|
|
2230
2230
|
});
|
|
2231
2231
|
}
|
|
@@ -2295,9 +2295,9 @@ function va(e) {
|
|
|
2295
2295
|
t = "@@observable";
|
|
2296
2296
|
return t;
|
|
2297
2297
|
}
|
|
2298
|
-
var
|
|
2299
|
-
typeof self < "u" ?
|
|
2300
|
-
va(
|
|
2298
|
+
var yt;
|
|
2299
|
+
typeof self < "u" ? yt = self : typeof window < "u" ? yt = window : typeof global < "u" ? yt = global : typeof module < "u" ? yt = module : yt = Function("return this")();
|
|
2300
|
+
va(yt);
|
|
2301
2301
|
var on = me.prototype, an = "@@observable";
|
|
2302
2302
|
on[an] || (on[an] = function() {
|
|
2303
2303
|
return this;
|
|
@@ -2493,7 +2493,7 @@ const Yn = Object.freeze({
|
|
|
2493
2493
|
}), Pr = Object.freeze({
|
|
2494
2494
|
...Yn,
|
|
2495
2495
|
...Gt
|
|
2496
|
-
}),
|
|
2496
|
+
}), wr = Object.freeze({
|
|
2497
2497
|
...Pr,
|
|
2498
2498
|
body: "",
|
|
2499
2499
|
hidden: !1
|
|
@@ -2506,7 +2506,7 @@ function La(e, t) {
|
|
|
2506
2506
|
}
|
|
2507
2507
|
function ln(e, t) {
|
|
2508
2508
|
const r = La(e, t);
|
|
2509
|
-
for (const n in
|
|
2509
|
+
for (const n in wr) n in Gt ? n in e && !(n in r) && (r[n] = Gt[n]) : n in t ? r[n] = t[n] : n in e && (r[n] = e[n]);
|
|
2510
2510
|
return r;
|
|
2511
2511
|
}
|
|
2512
2512
|
function za(e, t, r) {
|
|
@@ -2547,12 +2547,12 @@ function Kn(e) {
|
|
|
2547
2547
|
const r = t.icons;
|
|
2548
2548
|
for (const o in r) {
|
|
2549
2549
|
const s = r[o];
|
|
2550
|
-
if (!o || typeof s.body != "string" || !ir(s,
|
|
2550
|
+
if (!o || typeof s.body != "string" || !ir(s, wr)) return null;
|
|
2551
2551
|
}
|
|
2552
2552
|
const n = t.aliases || /* @__PURE__ */ Object.create(null);
|
|
2553
2553
|
for (const o in n) {
|
|
2554
2554
|
const s = n[o], i = s.parent;
|
|
2555
|
-
if (!o || typeof i != "string" || !r[i] && !n[i] || !ir(s,
|
|
2555
|
+
if (!o || typeof i != "string" || !r[i] && !n[i] || !ir(s, wr)) return null;
|
|
2556
2556
|
}
|
|
2557
2557
|
return t;
|
|
2558
2558
|
}
|
|
@@ -2712,10 +2712,10 @@ function Qa(e, t) {
|
|
|
2712
2712
|
let s = r.body;
|
|
2713
2713
|
[r, n].forEach((F) => {
|
|
2714
2714
|
const N = [], P = F.hFlip, R = F.vFlip;
|
|
2715
|
-
let
|
|
2716
|
-
P ? R ?
|
|
2715
|
+
let w = F.rotate;
|
|
2716
|
+
P ? R ? w += 2 : (N.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), N.push("scale(-1 1)"), o.top = o.left = 0) : R && (N.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), N.push("scale(1 -1)"), o.top = o.left = 0);
|
|
2717
2717
|
let V;
|
|
2718
|
-
switch (
|
|
2718
|
+
switch (w < 0 && (w -= Math.floor(w / 4) * 4), w = w % 4, w) {
|
|
2719
2719
|
case 1:
|
|
2720
2720
|
V = o.height / 2 + o.top, N.unshift("rotate(90 " + V.toString() + " " + V.toString() + ")");
|
|
2721
2721
|
break;
|
|
@@ -2726,15 +2726,15 @@ function Qa(e, t) {
|
|
|
2726
2726
|
V = o.width / 2 + o.left, N.unshift("rotate(-90 " + V.toString() + " " + V.toString() + ")");
|
|
2727
2727
|
break;
|
|
2728
2728
|
}
|
|
2729
|
-
|
|
2729
|
+
w % 2 === 1 && (o.left !== o.top && (V = o.left, o.left = o.top, o.top = V), o.width !== o.height && (V = o.width, o.width = o.height, o.height = V)), N.length && (s = Ka(s, '<g transform="' + N.join(" ") + '">', "</g>"));
|
|
2730
2730
|
});
|
|
2731
2731
|
const i = n.width, d = n.height, l = o.width, g = o.height;
|
|
2732
|
-
let p,
|
|
2733
|
-
i === null ? (
|
|
2732
|
+
let p, y;
|
|
2733
|
+
i === null ? (y = d === null ? "1em" : d === "auto" ? g : d, p = un(y, l / g)) : (p = i === "auto" ? l : i, y = d === null ? un(p, g / l) : d === "auto" ? g : d);
|
|
2734
2734
|
const x = {}, S = (F, N) => {
|
|
2735
2735
|
Wa(N) || (x[F] = N.toString());
|
|
2736
2736
|
};
|
|
2737
|
-
S("width", p), S("height",
|
|
2737
|
+
S("width", p), S("height", y);
|
|
2738
2738
|
const _ = [
|
|
2739
2739
|
o.left,
|
|
2740
2740
|
o.top,
|
|
@@ -2760,12 +2760,12 @@ function es(e, t = Xa) {
|
|
|
2760
2760
|
e = e.replace(new RegExp('([#;"])(' + d + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
|
|
2761
2761
|
}), e = e.replace(new RegExp(o, "g"), ""), e;
|
|
2762
2762
|
}
|
|
2763
|
-
const
|
|
2763
|
+
const yr = /* @__PURE__ */ Object.create(null);
|
|
2764
2764
|
function ts(e, t) {
|
|
2765
|
-
|
|
2765
|
+
yr[e] = t;
|
|
2766
2766
|
}
|
|
2767
2767
|
function xr(e) {
|
|
2768
|
-
return
|
|
2768
|
+
return yr[e] || yr[""];
|
|
2769
2769
|
}
|
|
2770
2770
|
function Tr(e) {
|
|
2771
2771
|
let t;
|
|
@@ -2957,12 +2957,12 @@ function ms(e) {
|
|
|
2957
2957
|
const s = o.provider, i = o.prefix, d = o.name, l = r[s] || (r[s] = /* @__PURE__ */ Object.create(null)), g = l[i] || (l[i] = bt(s, i));
|
|
2958
2958
|
let p;
|
|
2959
2959
|
d in g.icons ? p = t.loaded : i === "" || g.missing.has(d) ? p = t.missing : p = t.pending;
|
|
2960
|
-
const
|
|
2960
|
+
const y = {
|
|
2961
2961
|
provider: s,
|
|
2962
2962
|
prefix: i,
|
|
2963
2963
|
name: d
|
|
2964
2964
|
};
|
|
2965
|
-
p.push(
|
|
2965
|
+
p.push(y);
|
|
2966
2966
|
}), t;
|
|
2967
2967
|
}
|
|
2968
2968
|
function hs(e, t = !0, r = !1) {
|
|
@@ -2992,10 +2992,10 @@ function gs(e, t, r, n) {
|
|
|
2992
2992
|
i = i.concat(E);
|
|
2993
2993
|
} else i = e.resources.slice(s).concat(e.resources.slice(0, s));
|
|
2994
2994
|
const d = Date.now();
|
|
2995
|
-
let l = "pending", g = 0, p,
|
|
2995
|
+
let l = "pending", g = 0, p, y = null, x = [], S = [];
|
|
2996
2996
|
typeof n == "function" && S.push(n);
|
|
2997
2997
|
function _() {
|
|
2998
|
-
|
|
2998
|
+
y && (clearTimeout(y), y = null);
|
|
2999
2999
|
}
|
|
3000
3000
|
function F() {
|
|
3001
3001
|
l === "pending" && (l = "aborted"), _(), x.forEach((E) => {
|
|
@@ -3021,12 +3021,12 @@ function gs(e, t, r, n) {
|
|
|
3021
3021
|
E(void 0, p);
|
|
3022
3022
|
});
|
|
3023
3023
|
}
|
|
3024
|
-
function
|
|
3024
|
+
function w() {
|
|
3025
3025
|
x.forEach((E) => {
|
|
3026
3026
|
E.status === "pending" && (E.status = "aborted");
|
|
3027
3027
|
}), x = [];
|
|
3028
3028
|
}
|
|
3029
|
-
function V(E, H,
|
|
3029
|
+
function V(E, H, we) {
|
|
3030
3030
|
const ae = H !== "success";
|
|
3031
3031
|
switch (x = x.filter((G) => G !== E), l) {
|
|
3032
3032
|
case "pending":
|
|
@@ -3038,19 +3038,19 @@ function gs(e, t, r, n) {
|
|
|
3038
3038
|
return;
|
|
3039
3039
|
}
|
|
3040
3040
|
if (H === "abort") {
|
|
3041
|
-
p =
|
|
3041
|
+
p = we, R();
|
|
3042
3042
|
return;
|
|
3043
3043
|
}
|
|
3044
3044
|
if (ae) {
|
|
3045
|
-
p =
|
|
3045
|
+
p = we, x.length || (i.length ? je() : R());
|
|
3046
3046
|
return;
|
|
3047
3047
|
}
|
|
3048
|
-
if (_(),
|
|
3048
|
+
if (_(), w(), !e.random) {
|
|
3049
3049
|
const G = e.resources.indexOf(E.resource);
|
|
3050
3050
|
G !== -1 && G !== e.index && (e.index = G);
|
|
3051
3051
|
}
|
|
3052
3052
|
l = "completed", S.forEach((G) => {
|
|
3053
|
-
G(
|
|
3053
|
+
G(we);
|
|
3054
3054
|
});
|
|
3055
3055
|
}
|
|
3056
3056
|
function je() {
|
|
@@ -3059,8 +3059,8 @@ function gs(e, t, r, n) {
|
|
|
3059
3059
|
const E = i.shift();
|
|
3060
3060
|
if (E === void 0) {
|
|
3061
3061
|
if (x.length) {
|
|
3062
|
-
|
|
3063
|
-
_(), l === "pending" && (
|
|
3062
|
+
y = setTimeout(() => {
|
|
3063
|
+
_(), l === "pending" && (w(), R());
|
|
3064
3064
|
}, e.timeout);
|
|
3065
3065
|
return;
|
|
3066
3066
|
}
|
|
@@ -3070,11 +3070,11 @@ function gs(e, t, r, n) {
|
|
|
3070
3070
|
const H = {
|
|
3071
3071
|
status: "pending",
|
|
3072
3072
|
resource: E,
|
|
3073
|
-
callback: (
|
|
3074
|
-
V(H,
|
|
3073
|
+
callback: (we, ae) => {
|
|
3074
|
+
V(H, we, ae);
|
|
3075
3075
|
}
|
|
3076
3076
|
};
|
|
3077
|
-
x.push(H), g++,
|
|
3077
|
+
x.push(H), g++, y = setTimeout(je, e.rotate), r(E, t, H.callback);
|
|
3078
3078
|
}
|
|
3079
3079
|
return setTimeout(je), P;
|
|
3080
3080
|
}
|
|
@@ -3088,8 +3088,8 @@ function to(e) {
|
|
|
3088
3088
|
r = r.filter((d) => d().status === "pending");
|
|
3089
3089
|
}
|
|
3090
3090
|
function o(d, l, g) {
|
|
3091
|
-
const p = gs(t, d, l, (
|
|
3092
|
-
n(), g && g(
|
|
3091
|
+
const p = gs(t, d, l, (y, x) => {
|
|
3092
|
+
n(), g && g(y, x);
|
|
3093
3093
|
});
|
|
3094
3094
|
return r.push(p), p;
|
|
3095
3095
|
}
|
|
@@ -3109,7 +3109,7 @@ function to(e) {
|
|
|
3109
3109
|
function mn() {
|
|
3110
3110
|
}
|
|
3111
3111
|
const lr = /* @__PURE__ */ Object.create(null);
|
|
3112
|
-
function
|
|
3112
|
+
function ws(e) {
|
|
3113
3113
|
if (!lr[e]) {
|
|
3114
3114
|
const t = Or(e);
|
|
3115
3115
|
if (!t) return;
|
|
@@ -3121,14 +3121,14 @@ function ys(e) {
|
|
|
3121
3121
|
}
|
|
3122
3122
|
return lr[e];
|
|
3123
3123
|
}
|
|
3124
|
-
function
|
|
3124
|
+
function ys(e, t, r) {
|
|
3125
3125
|
let n, o;
|
|
3126
3126
|
if (typeof e == "string") {
|
|
3127
3127
|
const s = xr(e);
|
|
3128
3128
|
if (!s)
|
|
3129
3129
|
return r(void 0, 424), mn;
|
|
3130
3130
|
o = s.send;
|
|
3131
|
-
const i =
|
|
3131
|
+
const i = ws(e);
|
|
3132
3132
|
i && (n = i.redundancy);
|
|
3133
3133
|
} else {
|
|
3134
3134
|
const s = Tr(e);
|
|
@@ -3194,8 +3194,8 @@ function vs(e, t) {
|
|
|
3194
3194
|
}
|
|
3195
3195
|
if (s) {
|
|
3196
3196
|
o.forEach((p) => {
|
|
3197
|
-
const
|
|
3198
|
-
pn(
|
|
3197
|
+
const y = s(p, n, r);
|
|
3198
|
+
pn(y, (x) => {
|
|
3199
3199
|
const S = x ? {
|
|
3200
3200
|
prefix: n,
|
|
3201
3201
|
icons: { [p]: x }
|
|
@@ -3213,8 +3213,8 @@ function vs(e, t) {
|
|
|
3213
3213
|
return;
|
|
3214
3214
|
}
|
|
3215
3215
|
l.prepare(r, n, i).forEach((p) => {
|
|
3216
|
-
|
|
3217
|
-
Pt(e, p.icons,
|
|
3216
|
+
ys(r, p, (y) => {
|
|
3217
|
+
Pt(e, p.icons, y);
|
|
3218
3218
|
});
|
|
3219
3219
|
});
|
|
3220
3220
|
}));
|
|
@@ -3235,11 +3235,11 @@ const ks = (e, t) => {
|
|
|
3235
3235
|
const { provider: g, prefix: p } = l;
|
|
3236
3236
|
if (p === d && g === i) return;
|
|
3237
3237
|
i = g, d = p, s.push(bt(g, p));
|
|
3238
|
-
const
|
|
3239
|
-
|
|
3238
|
+
const y = o[g] || (o[g] = /* @__PURE__ */ Object.create(null));
|
|
3239
|
+
y[p] || (y[p] = []);
|
|
3240
3240
|
}), n.pending.forEach((l) => {
|
|
3241
|
-
const { provider: g, prefix: p, name:
|
|
3242
|
-
S.has(
|
|
3241
|
+
const { provider: g, prefix: p, name: y } = l, x = bt(g, p), S = x.pendingIcons || (x.pendingIcons = /* @__PURE__ */ new Set());
|
|
3242
|
+
S.has(y) || (S.add(y), o[g][p].push(y));
|
|
3243
3243
|
}), s.forEach((l) => {
|
|
3244
3244
|
const g = o[l.provider][l.prefix];
|
|
3245
3245
|
g.length && vs(l, g);
|
|
@@ -3334,13 +3334,13 @@ const ro = {
|
|
|
3334
3334
|
Image: "var(--svg)",
|
|
3335
3335
|
Repeat: "no-repeat",
|
|
3336
3336
|
Size: "100% 100%"
|
|
3337
|
-
},
|
|
3337
|
+
}, wn = {
|
|
3338
3338
|
WebkitMask: br,
|
|
3339
3339
|
mask: br,
|
|
3340
3340
|
background: no
|
|
3341
3341
|
};
|
|
3342
|
-
for (const e in
|
|
3343
|
-
const t =
|
|
3342
|
+
for (const e in wn) {
|
|
3343
|
+
const t = wn[e];
|
|
3344
3344
|
for (const r in gn)
|
|
3345
3345
|
t[e + r] = gn[r];
|
|
3346
3346
|
}
|
|
@@ -3348,7 +3348,7 @@ const $s = {
|
|
|
3348
3348
|
...ro,
|
|
3349
3349
|
inline: !0
|
|
3350
3350
|
};
|
|
3351
|
-
function
|
|
3351
|
+
function yn(e) {
|
|
3352
3352
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
3353
3353
|
}
|
|
3354
3354
|
const Ds = (e, t, r) => {
|
|
@@ -3362,8 +3362,8 @@ const Ds = (e, t, r) => {
|
|
|
3362
3362
|
"provider",
|
|
3363
3363
|
"prefix"
|
|
3364
3364
|
];
|
|
3365
|
-
for (const
|
|
3366
|
-
N[
|
|
3365
|
+
for (const w of R)
|
|
3366
|
+
N[w] && P.push("iconify--" + N[w]);
|
|
3367
3367
|
l.className = P.join(" ");
|
|
3368
3368
|
}
|
|
3369
3369
|
}
|
|
@@ -3427,7 +3427,7 @@ const Ds = (e, t, r) => {
|
|
|
3427
3427
|
__html: Os(es(g.body, P ? () => P + "ID" + N++ : "iconifyReact"))
|
|
3428
3428
|
}, cr("svg", l);
|
|
3429
3429
|
}
|
|
3430
|
-
const { body:
|
|
3430
|
+
const { body: y, width: x, height: S } = e, _ = s === "mask" || (s === "bg" ? !1 : y.indexOf("currentColor") !== -1), F = Is(y, {
|
|
3431
3431
|
...p,
|
|
3432
3432
|
width: x + "",
|
|
3433
3433
|
height: S + ""
|
|
@@ -3435,8 +3435,8 @@ const Ds = (e, t, r) => {
|
|
|
3435
3435
|
return l.style = {
|
|
3436
3436
|
...i,
|
|
3437
3437
|
"--svg": Ts(F),
|
|
3438
|
-
width:
|
|
3439
|
-
height:
|
|
3438
|
+
width: yn(p.width),
|
|
3439
|
+
height: yn(p.height),
|
|
3440
3440
|
...js,
|
|
3441
3441
|
..._ ? br : no,
|
|
3442
3442
|
...d
|
|
@@ -3530,11 +3530,11 @@ function oo(e) {
|
|
|
3530
3530
|
be(() => (r(!0), l), []), be(() => {
|
|
3531
3531
|
t && p();
|
|
3532
3532
|
}, [e.icon, t]);
|
|
3533
|
-
const { name:
|
|
3533
|
+
const { name: y, data: x } = i;
|
|
3534
3534
|
return x ? Ds({
|
|
3535
3535
|
...Pr,
|
|
3536
3536
|
...x
|
|
3537
|
-
}, e,
|
|
3537
|
+
}, e, y) : e.children ? e.children : e.fallback ? e.fallback : cr("span", {});
|
|
3538
3538
|
}
|
|
3539
3539
|
const re = _n((e, t) => oo({
|
|
3540
3540
|
...e,
|
|
@@ -3556,9 +3556,9 @@ const He = "USD", xn = (e) => {
|
|
|
3556
3556
|
if (!r.length) return null;
|
|
3557
3557
|
const n = (i) => {
|
|
3558
3558
|
var g, p;
|
|
3559
|
-
const d = i.find((
|
|
3559
|
+
const d = i.find((y) => {
|
|
3560
3560
|
var x;
|
|
3561
|
-
return !!((x =
|
|
3561
|
+
return !!((x = y.discounted) != null && x.value);
|
|
3562
3562
|
});
|
|
3563
3563
|
if (d)
|
|
3564
3564
|
return {
|
|
@@ -3669,10 +3669,11 @@ const He = "USD", xn = (e) => {
|
|
|
3669
3669
|
addressListProp: o,
|
|
3670
3670
|
addressLoading: s
|
|
3671
3671
|
}) => {
|
|
3672
|
-
|
|
3672
|
+
console.log(r, "the product for ai shopping");
|
|
3673
|
+
const i = null, d = null, l = Ht(r), g = Math.min(
|
|
3673
3674
|
Math.max(0, n || 0),
|
|
3674
3675
|
Math.max(0, l.length - 1)
|
|
3675
|
-
), p = l.length, [
|
|
3676
|
+
), p = l.length, [y, x] = C(g), [S, _] = C(null), [F, N] = C(null), P = Re(null), R = Re(null), w = Bs(r, y), [V, je] = C(""), [E, H] = C(!1), [we, ae] = C(!1), [G, Pe] = C(!1), [$e, he] = C(""), [L, O] = C(!1), [U, Xe] = C(null), [Ye, ve] = C([]), [_e, ft] = C([]), [Ze, M] = C([]), [le, Te] = C(!1), [Ie, Zt] = C(), [er, m] = C(!0), [j, $] = C(!1), [Y, z] = C(!1), [A, ce] = C("standard"), [B, D] = C(!1), [X, ne] = C(!1), [ke, Se] = C("card"), [Z, K] = C(!1), [Ne, ee] = C(!1), [k, J] = C(!1), [W, de] = C(null), [Ce, et] = C(null), [mt, At] = C(""), [Be, jt] = C(!1), ht = Re(null);
|
|
3676
3677
|
be(() => {
|
|
3677
3678
|
const u = Ht(r), h = Math.min(
|
|
3678
3679
|
Math.max(0, n || 0),
|
|
@@ -3694,9 +3695,9 @@ const He = "USD", xn = (e) => {
|
|
|
3694
3695
|
Ne,
|
|
3695
3696
|
k,
|
|
3696
3697
|
E,
|
|
3697
|
-
|
|
3698
|
+
we
|
|
3698
3699
|
]);
|
|
3699
|
-
const I = "var(--tanya)", De = "var(--tanya-contrast)", tt = I, kt = "
|
|
3700
|
+
const I = "var(--tanya)", De = "var(--tanya-contrast)", tt = I, kt = "#804c9e", so = () => {
|
|
3700
3701
|
console.log("AgenticShopping feedback:", {
|
|
3701
3702
|
rating: Ce,
|
|
3702
3703
|
comment: mt
|
|
@@ -3829,22 +3830,22 @@ const He = "USD", xn = (e) => {
|
|
|
3829
3830
|
);
|
|
3830
3831
|
return !!(b && ((q = b.variant) != null && q.sku));
|
|
3831
3832
|
};
|
|
3832
|
-
return u && h ? f(u, h) : u && !h ? f(u, null) : !u && h ? f(void 0, h) : !!(
|
|
3833
|
-
}, [Fe, S, F,
|
|
3833
|
+
return u && h ? f(u, h) : u && !h ? f(u, null) : !u && h ? f(void 0, h) : !!(w && w.sku);
|
|
3834
|
+
}, [Fe, S, F, w]), fo = G || L || !Nt, Ct = (u) => {
|
|
3834
3835
|
const h = Number((u == null ? void 0 : u.quantity) ?? 1);
|
|
3835
3836
|
return Number.isFinite(h) && h > 0 ? h : 1;
|
|
3836
3837
|
}, $r = (u) => {
|
|
3837
3838
|
const h = Ct(u), f = Number((u == null ? void 0 : u.max_price_minor) ?? 0);
|
|
3838
|
-
return Number.isFinite(f) && f > 0 ? +(f / 100) : +(Sn(r,
|
|
3839
|
+
return Number.isFinite(f) && f > 0 ? +(f / 100) : +(Sn(r, w) * h);
|
|
3839
3840
|
}, Dr = (u) => {
|
|
3840
3841
|
var Q;
|
|
3841
|
-
const h = U, f = Vt(
|
|
3842
|
+
const h = U, f = Vt(w), v = u || (h == null ? void 0 : h.currency) || f.currency || He, T = $r(h), b = +(T * 0.08).toFixed(2), q = ((Q = at[A]) == null ? void 0 : Q.fee) || 0;
|
|
3842
3843
|
return { product_total: T, tax: b, shipping_fee: q, currency: v };
|
|
3843
3844
|
}, tr = async (u, h, f) => {
|
|
3844
3845
|
jr(), uo(), Pe(!0), O(!0), H(!1), ae(!1);
|
|
3845
3846
|
const v = _e.slice(-Cn);
|
|
3846
3847
|
try {
|
|
3847
|
-
const T = await ur(
|
|
3848
|
+
const T = await ur(i, d);
|
|
3848
3849
|
if (!T) throw new Error("Failed to fetch token");
|
|
3849
3850
|
const b = localStorage.getItem("customerNumber"), q = localStorage.getItem("isLoggedIn"), ue = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
3850
3851
|
registered: String(q || !1),
|
|
@@ -3870,10 +3871,10 @@ const He = "USD", xn = (e) => {
|
|
|
3870
3871
|
})
|
|
3871
3872
|
});
|
|
3872
3873
|
if (!te.body) throw new Error("Readable stream not supported");
|
|
3873
|
-
const
|
|
3874
|
+
const ye = te.body.getReader(), oe = new TextDecoder();
|
|
3874
3875
|
let Ee = "", Oe = "", Le = "";
|
|
3875
3876
|
for (; ; ) {
|
|
3876
|
-
const { done: pe, value: Je } = await
|
|
3877
|
+
const { done: pe, value: Je } = await ye.read();
|
|
3877
3878
|
if (pe) break;
|
|
3878
3879
|
Ee += oe.decode(Je, { stream: !0 });
|
|
3879
3880
|
const pt = Ee.split(`
|
|
@@ -3925,10 +3926,10 @@ const He = "USD", xn = (e) => {
|
|
|
3925
3926
|
const h = $e.trim();
|
|
3926
3927
|
if (!h) return;
|
|
3927
3928
|
ve((b) => [...b, { query: h, response: "" }]), he(""), je(h);
|
|
3928
|
-
const f =
|
|
3929
|
+
const f = w == null ? void 0 : w.sku, v = Nn(r), T = f || v || "";
|
|
3929
3930
|
if (p <= 1) {
|
|
3930
3931
|
if (T) {
|
|
3931
|
-
tr(h, T,
|
|
3932
|
+
tr(h, T, y);
|
|
3932
3933
|
return;
|
|
3933
3934
|
}
|
|
3934
3935
|
ae(!0), O(!0);
|
|
@@ -3936,25 +3937,25 @@ const He = "USD", xn = (e) => {
|
|
|
3936
3937
|
}
|
|
3937
3938
|
T ? (H(!0), O(!0)) : (ae(!0), O(!0));
|
|
3938
3939
|
}, mo = () => {
|
|
3939
|
-
const u =
|
|
3940
|
-
u && tr(V, u,
|
|
3940
|
+
const u = w == null ? void 0 : w.sku;
|
|
3941
|
+
u && tr(V, u, y);
|
|
3941
3942
|
}, ho = () => {
|
|
3942
3943
|
H(!1), ae(!0), O(!0);
|
|
3943
3944
|
}, po = () => {
|
|
3944
|
-
if (!
|
|
3945
|
-
const u =
|
|
3946
|
-
tr(V, u,
|
|
3945
|
+
if (!w || !w.sku) return;
|
|
3946
|
+
const u = w.sku;
|
|
3947
|
+
tr(V, u, y);
|
|
3947
3948
|
}, go = async () => {
|
|
3948
3949
|
Te(!0), z(!1), ne(!1), ee(!1), $(!1), D(!1), K(!1), J(!1), await lo(), jr("initial", {
|
|
3949
3950
|
extractedDetails: U ?? void 0
|
|
3950
3951
|
});
|
|
3951
|
-
},
|
|
3952
|
+
}, wo = () => {
|
|
3952
3953
|
if (!Ie) return;
|
|
3953
3954
|
const u = Ze.find(
|
|
3954
3955
|
(h) => String(h.addressId ?? h.id) === Ie
|
|
3955
3956
|
) || null;
|
|
3956
3957
|
u && (localStorage.setItem("agentic_order_address", JSON.stringify(u)), $(!0), z(!0), D(!1), ne(!1), K(!1), ee(!1), J(!1), St("address", u));
|
|
3957
|
-
},
|
|
3958
|
+
}, yo = () => {
|
|
3958
3959
|
$(!1), z(!1), D(!1), ne(!1), K(!1), ee(!1), J(!1), localStorage.removeItem("agentic_order_address");
|
|
3959
3960
|
}, xo = () => {
|
|
3960
3961
|
A && (localStorage.setItem("agentic_order_delivery", A), D(!0), ne(!0), K(!1), ee(!1), J(!1), St("delivery", {
|
|
@@ -3996,10 +3997,10 @@ const He = "USD", xn = (e) => {
|
|
|
3996
3997
|
localStorage.getItem("agentic_order_address") || "null"
|
|
3997
3998
|
), f = localStorage.getItem(
|
|
3998
3999
|
"agentic_order_delivery"
|
|
3999
|
-
), v = localStorage.getItem("agentic_order_payment") || "card", { product_total: T, tax: b, shipping_fee: q, currency: Q } = Dr(), ue = u.shopper_id || localStorage.getItem("customerId") || void 0, te = (h == null ? void 0 : h.addressId) || (h == null ? void 0 : h.id) || void 0,
|
|
4000
|
+
), v = localStorage.getItem("agentic_order_payment") || "card", { product_total: T, tax: b, shipping_fee: q, currency: Q } = Dr(), ue = u.shopper_id || localStorage.getItem("customerId") || void 0, te = (h == null ? void 0 : h.addressId) || (h == null ? void 0 : h.id) || void 0, ye = f ? Ms[f] : "GROUND", oe = "card-visa", Ee = w == null ? void 0 : w.sku, Oe = (r == null ? void 0 : r.id) || "", Le = Ct(u), se = typeof u.max_price_minor == "number" ? u.max_price_minor : Math.round(T * 100), pt = {
|
|
4000
4001
|
shopper_id: ue,
|
|
4001
4002
|
shipping_address_id: te,
|
|
4002
|
-
shipping_method_id:
|
|
4003
|
+
shipping_method_id: ye,
|
|
4003
4004
|
payment_method_id: oe,
|
|
4004
4005
|
sku: Ee,
|
|
4005
4006
|
platform: "SFCC",
|
|
@@ -4072,7 +4073,7 @@ const He = "USD", xn = (e) => {
|
|
|
4072
4073
|
}
|
|
4073
4074
|
]);
|
|
4074
4075
|
}, Co = () => {
|
|
4075
|
-
const u = vn(r,
|
|
4076
|
+
const u = vn(r, w), h = kn(r), f = (w == null ? void 0 : w.sku) || "", v = qe(w) || "", T = We(w) || "", { amount: b } = Vt(w), q = !!(w != null && w.sku), Q = w && q ? xn(w) : !1;
|
|
4076
4077
|
return /* @__PURE__ */ a("div", { className: "mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4", children: /* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row items-center sm:items-center gap-4", children: [
|
|
4077
4078
|
/* @__PURE__ */ a("div", { className: "flex-shrink-0 flex justify-center sm:justify-start", children: /* @__PURE__ */ a("div", { className: "w-[150px] h-[150px] rounded-lg bg-gray-50 border border-gray-200 flex items-center justify-center overflow-hidden", children: u ? /* @__PURE__ */ a(
|
|
4078
4079
|
"img",
|
|
@@ -4113,7 +4114,7 @@ const He = "USD", xn = (e) => {
|
|
|
4113
4114
|
] }),
|
|
4114
4115
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-4 mt-2", children: f.map((b) => {
|
|
4115
4116
|
var Le;
|
|
4116
|
-
const q = S === b, Q = F || R.current || null, ue = Q ? ot(Fe, b, Q) : ot(Fe, b, null), te = !!ue,
|
|
4117
|
+
const q = S === b, Q = F || R.current || null, ue = Q ? ot(Fe, b, Q) : ot(Fe, b, null), te = !!ue, ye = te && xn(ue.variant), oe = te && ye ? vr(ue.variant, He) || vr(ue.variant) : null, Ee = Fe.find(
|
|
4117
4118
|
(se) => qe(se.variant) === b
|
|
4118
4119
|
), Oe = (Le = Ee == null ? void 0 : Ee.images) == null ? void 0 : Le[0];
|
|
4119
4120
|
return /* @__PURE__ */ c(
|
|
@@ -4121,7 +4122,7 @@ const He = "USD", xn = (e) => {
|
|
|
4121
4122
|
{
|
|
4122
4123
|
className: `flex flex-col items-center w-28 border rounded-md p-2
|
|
4123
4124
|
${q ? "border-2 border-tanya-light" : "border-gray-300"}
|
|
4124
|
-
${!te || !
|
|
4125
|
+
${!te || !ye ? "opacity-60" : ""}`,
|
|
4125
4126
|
children: [
|
|
4126
4127
|
/* @__PURE__ */ a(
|
|
4127
4128
|
"button",
|
|
@@ -4144,9 +4145,9 @@ const He = "USD", xn = (e) => {
|
|
|
4144
4145
|
}
|
|
4145
4146
|
),
|
|
4146
4147
|
/* @__PURE__ */ a("div", { className: "w-full border-t my-2" }),
|
|
4147
|
-
te && !
|
|
4148
|
+
te && !ye && /* @__PURE__ */ a("div", { className: "text-[11px] text-red-600 text-center", children: "Out of stock" }),
|
|
4148
4149
|
!te && /* @__PURE__ */ a("div", { className: "text-[11px] text-red-600 text-center", children: "any not offered" }),
|
|
4149
|
-
te &&
|
|
4150
|
+
te && ye && oe && /* @__PURE__ */ c("div", { className: "text-xs text-gray-800 font-medium text-center", children: [
|
|
4150
4151
|
Ae(oe.cent / 100, oe.cur),
|
|
4151
4152
|
oe.regularCent && oe.regularCent > oe.cent && /* @__PURE__ */ a("span", { className: "ml-1 line-through text-gray-500", children: Ae(
|
|
4152
4153
|
oe.regularCent / 100,
|
|
@@ -4194,12 +4195,12 @@ const He = "USD", xn = (e) => {
|
|
|
4194
4195
|
!(u != null && u.extractedDetails) && u && (u = { extractedDetails: u });
|
|
4195
4196
|
const f = (u == null ? void 0 : u.extractedDetails) || U;
|
|
4196
4197
|
if (!f) return null;
|
|
4197
|
-
const v = Ct(f), { currency: T } = Vt(
|
|
4198
|
+
const v = Ct(f), { currency: T } = Vt(w), b = Sn(r, w), q = Number((f == null ? void 0 : f.max_price_minor) ?? 0), ue = Number.isFinite(q) && q > 0 ? +(q / 100) : +(b * v), te = (f == null ? void 0 : f.currency) || T || He, ye = w != null && w.sku ? w.sku : f.product_id;
|
|
4198
4199
|
return /* @__PURE__ */ c(
|
|
4199
4200
|
"div",
|
|
4200
4201
|
{
|
|
4201
4202
|
className: "px-6 pb-6 flex flex-col items-center space-y-4",
|
|
4202
|
-
style: { backgroundColor: "
|
|
4203
|
+
style: { backgroundColor: "#14377D" },
|
|
4203
4204
|
children: [
|
|
4204
4205
|
/* @__PURE__ */ a(
|
|
4205
4206
|
"p",
|
|
@@ -4212,7 +4213,7 @@ const He = "USD", xn = (e) => {
|
|
|
4212
4213
|
/* @__PURE__ */ c("div", { className: "w-full max-w-md bg-white rounded-xl shadow-inner p-4", children: [
|
|
4213
4214
|
/* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-y-2 text-sm", children: [
|
|
4214
4215
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "SKU:" }),
|
|
4215
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4216
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: ye }),
|
|
4216
4217
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Quantity:" }),
|
|
4217
4218
|
/* @__PURE__ */ a("p", { className: "text-gray-800", children: Ct(f) }),
|
|
4218
4219
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Currency:" }),
|
|
@@ -4221,17 +4222,17 @@ const He = "USD", xn = (e) => {
|
|
|
4221
4222
|
/* @__PURE__ */ a("p", { className: "text-gray-800", children: Ae(ue, te) })
|
|
4222
4223
|
] }),
|
|
4223
4224
|
/* @__PURE__ */ c("div", { className: "mt-3 flex flex-wrap gap-2 text-xs", children: [
|
|
4224
|
-
qe(
|
|
4225
|
+
qe(w) && /* @__PURE__ */ c("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4225
4226
|
"Color: ",
|
|
4226
|
-
qe(
|
|
4227
|
+
qe(w)
|
|
4227
4228
|
] }),
|
|
4228
|
-
We(
|
|
4229
|
+
We(w) && /* @__PURE__ */ c("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4229
4230
|
"Size: ",
|
|
4230
|
-
We(
|
|
4231
|
+
We(w)
|
|
4231
4232
|
] }),
|
|
4232
|
-
(
|
|
4233
|
+
(w == null ? void 0 : w.sku) && /* @__PURE__ */ c("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4233
4234
|
"SKU: ",
|
|
4234
|
-
|
|
4235
|
+
w.sku
|
|
4235
4236
|
] })
|
|
4236
4237
|
] })
|
|
4237
4238
|
] }),
|
|
@@ -4298,7 +4299,7 @@ const He = "USD", xn = (e) => {
|
|
|
4298
4299
|
);
|
|
4299
4300
|
}, qr = (u, h = !0) => {
|
|
4300
4301
|
var gt, rt, Ue, ze, fe, nt;
|
|
4301
|
-
const f = u || {}, v = ((gt = f == null ? void 0 : f.summary) == null ? void 0 : gt.currency) || (U == null ? void 0 : U.currency) || He, T = vn(r,
|
|
4302
|
+
const f = u || {}, v = ((gt = f == null ? void 0 : f.summary) == null ? void 0 : gt.currency) || (U == null ? void 0 : U.currency) || He, T = vn(r, w), b = kn(r), q = w != null && w.sku ? w.sku : (r == null ? void 0 : r.id) ?? (U == null ? void 0 : U.product_id), Q = (w == null ? void 0 : w.sku) ?? Nn(r), ue = qe(w) || qs(r), te = We(w) || Rs(r), ye = Ct(f), oe = ((rt = f == null ? void 0 : f.summary) == null ? void 0 : rt.product_total) != null ? +f.summary.product_total : $r(f), Ee = ye > 0 ? +(oe / ye).toFixed(2) : 0, Oe = oe, Le = ((Ue = f == null ? void 0 : f.summary) == null ? void 0 : Ue.tax) ?? +(oe * 0.08).toFixed(2), se = ((ze = f == null ? void 0 : f.summary) == null ? void 0 : ze.shipping_fee) ?? (((fe = at[A]) == null ? void 0 : fe.fee) || 0), pe = f != null && f.address ? [
|
|
4302
4303
|
f.address.addressLine1,
|
|
4303
4304
|
f.address.addressLine2,
|
|
4304
4305
|
f.address.street,
|
|
@@ -4372,7 +4373,7 @@ const He = "USD", xn = (e) => {
|
|
|
4372
4373
|
] }),
|
|
4373
4374
|
/* @__PURE__ */ c("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4374
4375
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Quantity" }),
|
|
4375
|
-
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children:
|
|
4376
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: ye })
|
|
4376
4377
|
] }),
|
|
4377
4378
|
/* @__PURE__ */ c("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4378
4379
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Subtotal" }),
|
|
@@ -4620,10 +4621,14 @@ const He = "USD", xn = (e) => {
|
|
|
4620
4621
|
"div",
|
|
4621
4622
|
{
|
|
4622
4623
|
className: "text-sm text-[16px] rounded-r-xl p-3 m-3 rounded-bl-xl w-3/4 text-tanya-contrast",
|
|
4623
|
-
style: { backgroundColor: "
|
|
4624
|
+
style: { backgroundColor: "#804c9e" },
|
|
4624
4625
|
children: [
|
|
4625
4626
|
"Welcome to your smart shopping companion!",
|
|
4626
|
-
/* @__PURE__ */
|
|
4627
|
+
/* @__PURE__ */ c("p", { children: [
|
|
4628
|
+
"Simply share your instruction — like “If this product goes below $",
|
|
4629
|
+
parseInt(r.price) - 5,
|
|
4630
|
+
" grab it for me.”"
|
|
4631
|
+
] }),
|
|
4627
4632
|
/* @__PURE__ */ a("p", { children: "I’ll monitor it, calculate total prices, and place the order when your conditions are met." })
|
|
4628
4633
|
]
|
|
4629
4634
|
}
|
|
@@ -4660,10 +4665,10 @@ const He = "USD", xn = (e) => {
|
|
|
4660
4665
|
/* @__PURE__ */ c("div", { className: "text-sm text-gray-800", children: [
|
|
4661
4666
|
"Proceed with color:",
|
|
4662
4667
|
" ",
|
|
4663
|
-
/* @__PURE__ */ a("span", { className: "font-semibold", children: qe(
|
|
4668
|
+
/* @__PURE__ */ a("span", { className: "font-semibold", children: qe(w) || "—" }),
|
|
4664
4669
|
", size:",
|
|
4665
4670
|
" ",
|
|
4666
|
-
/* @__PURE__ */ a("span", { className: "font-semibold", children: We(
|
|
4671
|
+
/* @__PURE__ */ a("span", { className: "font-semibold", children: We(w) || "—" }),
|
|
4667
4672
|
"?"
|
|
4668
4673
|
] }),
|
|
4669
4674
|
/* @__PURE__ */ c("div", { className: "mt-3 flex gap-3", children: [
|
|
@@ -4690,7 +4695,7 @@ const He = "USD", xn = (e) => {
|
|
|
4690
4695
|
)
|
|
4691
4696
|
] })
|
|
4692
4697
|
] }),
|
|
4693
|
-
f &&
|
|
4698
|
+
f && we && /* @__PURE__ */ a(Br, { showSubmit: !0 }),
|
|
4694
4699
|
f && G && /* @__PURE__ */ a("div", { className: "mt-4", children: /* @__PURE__ */ a(
|
|
4695
4700
|
"div",
|
|
4696
4701
|
{
|
|
@@ -4738,7 +4743,7 @@ const He = "USD", xn = (e) => {
|
|
|
4738
4743
|
!k && /* @__PURE__ */ a(
|
|
4739
4744
|
"button",
|
|
4740
4745
|
{
|
|
4741
|
-
onClick:
|
|
4746
|
+
onClick: yo,
|
|
4742
4747
|
className: "ml-2 text-xs px-2 py-1 rounded-full border hover:bg-gray-50",
|
|
4743
4748
|
style: {
|
|
4744
4749
|
borderColor: "var(--tanya-light)",
|
|
@@ -4816,7 +4821,7 @@ const He = "USD", xn = (e) => {
|
|
|
4816
4821
|
/* @__PURE__ */ a(
|
|
4817
4822
|
"button",
|
|
4818
4823
|
{
|
|
4819
|
-
onClick:
|
|
4824
|
+
onClick: wo,
|
|
4820
4825
|
disabled: j,
|
|
4821
4826
|
className: `px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${j ? "opacity-60 cursor-not-allowed" : "hover:-translate-y-0.5 hover:shadow-lg"}`,
|
|
4822
4827
|
style: { background: I },
|
|
@@ -5041,7 +5046,7 @@ const He = "USD", xn = (e) => {
|
|
|
5041
5046
|
/* @__PURE__ */ a(
|
|
5042
5047
|
"input",
|
|
5043
5048
|
{
|
|
5044
|
-
placeholder: L ? "Complete the current step…" : Nt ?
|
|
5049
|
+
placeholder: L ? "Complete the current step…" : Nt ? `What would you like me to do? (e.g., If this product goes below $${parseInt(r.price) - 5}, grab it for me.)` : "Oops! This combination isn’t available for this product. Try a different option.",
|
|
5045
5050
|
disabled: fo,
|
|
5046
5051
|
className: `w-full rounded-full p-4 outline-none border-none focus:ring-0 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed
|
|
5047
5052
|
${Nt ? "" : "placeholder:text-red-400 text-red-500"}`,
|