@instockng/storefront-ui 1.0.20 → 1.0.22
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/components/ui/modal.d.ts +1 -1
- package/dist/components/ui/modal.d.ts.map +1 -1
- package/dist/contexts/CartContext.d.ts +2 -0
- package/dist/contexts/CartContext.d.ts.map +1 -1
- package/dist/index134.mjs +2 -2
- package/dist/index135.mjs +1 -1
- package/dist/index136.mjs +6 -6
- package/dist/index137.mjs +2 -2
- package/dist/index138.mjs +2 -2
- package/dist/index140.mjs +2 -2
- package/dist/index141.mjs +2 -2
- package/dist/index142.mjs +1 -1
- package/dist/index144.mjs +8 -8
- package/dist/index145.mjs +8 -8
- package/dist/index150.mjs +1 -1
- package/dist/index151.mjs +1 -1
- package/dist/index152.mjs +1 -1
- package/dist/index153.mjs +1 -1
- package/dist/index154.mjs +1 -1
- package/dist/index156.mjs +1 -1
- package/dist/index157.mjs +1 -1
- package/dist/index159.mjs +2 -2
- package/dist/index160.mjs +1 -1
- package/dist/index167.mjs +1 -1
- package/dist/index169.mjs +2 -2
- package/dist/index170.mjs +5 -5
- package/dist/index173.mjs +1 -1
- package/dist/index186.mjs +1 -1
- package/dist/index190.mjs +1 -1
- package/dist/index192.mjs +1 -1
- package/dist/index203.mjs +1 -1
- package/dist/index204.mjs +1 -1
- package/dist/index205.mjs +2 -2
- package/dist/index206.mjs +2 -108
- package/dist/index207.mjs +2 -2
- package/dist/index208.mjs +2 -2
- package/dist/index209.mjs +2 -2
- package/dist/index210.mjs +2 -2
- package/dist/index211.mjs +2 -2
- package/dist/index212.mjs +2 -2
- package/dist/index213.mjs +108 -2
- package/dist/index214.mjs +2 -2
- package/dist/index216.mjs +3 -3
- package/dist/index217.mjs +2 -2
- package/dist/index218.mjs +244 -2
- package/dist/index219.mjs +2 -244
- package/dist/index220.mjs +33 -2
- package/dist/index221.mjs +60 -28
- package/dist/index222.mjs +20 -60
- package/dist/index223.mjs +2 -25
- package/dist/index224.mjs +2 -2
- package/dist/index229.mjs +2 -2
- package/dist/index230.mjs +2 -2
- package/dist/index234.mjs +2 -31
- package/dist/index235.mjs +2 -11
- package/dist/index236.mjs +30 -3
- package/dist/index237.mjs +10 -3
- package/dist/index238.mjs +4 -13
- package/dist/index239.mjs +4 -7
- package/dist/index240.mjs +13 -12
- package/dist/index241.mjs +7 -5
- package/dist/index242.mjs +12 -33
- package/dist/index243.mjs +5 -31
- package/dist/index244.mjs +32 -27
- package/dist/index245.mjs +28 -58
- package/dist/index246.mjs +28 -2
- package/dist/index247.mjs +61 -2
- package/dist/index248.mjs +2 -2
- package/dist/index249.mjs +18 -2
- package/dist/index25.mjs +48 -48
- package/dist/index250.mjs +42 -13
- package/dist/index251.mjs +2 -47
- package/dist/index252.mjs +2 -2
- package/dist/index253.mjs +2 -2
- package/dist/index254.mjs +2 -2
- package/dist/index255.mjs +91 -2
- package/dist/index256.mjs +2 -91
- package/dist/index258.mjs +1 -1
- package/dist/index264.mjs +1 -1
- package/dist/index3.mjs +133 -102
- package/dist/index32.mjs +26 -26
- package/dist/index37.mjs +72 -52
- package/dist/index38.mjs +1 -1
- package/dist/index4.mjs +53 -48
- package/dist/index42.mjs +1 -1
- package/dist/index47.mjs +17 -17
- package/dist/index48.mjs +2 -2
- package/dist/index62.mjs +19 -149
- package/dist/index63.mjs +149 -19
- package/dist/index66.mjs +1 -1
- package/dist/index73.mjs +1 -1
- package/dist/index75.mjs +2 -235
- package/dist/index76.mjs +233 -4
- package/dist/index77.mjs +5 -133
- package/dist/index78.mjs +129 -63
- package/dist/index79.mjs +67 -86
- package/dist/index80.mjs +85 -27
- package/dist/index81.mjs +28 -8
- package/dist/index82.mjs +8 -74
- package/dist/index83.mjs +74 -3
- package/dist/index84.mjs +4 -2
- package/dist/index85.mjs +2 -83
- package/dist/index86.mjs +81 -52
- package/dist/index87.mjs +53 -5
- package/dist/index88.mjs +5 -4
- package/dist/index89.mjs +4 -178
- package/dist/index90.mjs +174 -48
- package/dist/index91.mjs +51 -67
- package/dist/index92.mjs +69 -34
- package/dist/index93.mjs +31 -40
- package/dist/index94.mjs +43 -2
- package/dist/providers/MetaPixelProvider.d.ts +10 -5
- package/dist/providers/MetaPixelProvider.d.ts.map +1 -1
- package/package.json +9 -10
- package/src/components/ui/modal.tsx +1 -1
- package/src/contexts/CartContext.tsx +69 -6
- package/src/providers/MetaPixelProvider.tsx +46 -30
package/dist/index3.mjs
CHANGED
|
@@ -1,170 +1,201 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { createContext as
|
|
2
|
+
import { jsxs as nt, jsx as ct } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as st, useState as k, useRef as _, useCallback as c, useEffect as d, useContext as at } from "react";
|
|
4
4
|
import "./index20.mjs";
|
|
5
|
-
import { useGetCart as
|
|
5
|
+
import { useGetCart as ut, useCreateCart as it, useAddCartItem as ft, useUpdateCartItem as mt, useRemoveCartItem as dt, useApplyDiscount as lt, useRemoveDiscount as pt, useUpdateCart as Ct, useCheckoutCart as It } from "./index32.mjs";
|
|
6
6
|
import "@tanstack/react-query";
|
|
7
|
-
import { ShoppingCart as
|
|
8
|
-
import { useMetaPixel as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
const [t,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
import { ShoppingCart as wt } from "./index10.mjs";
|
|
8
|
+
import { useMetaPixel as ht } from "./index4.mjs";
|
|
9
|
+
const l = "oms_cart_id", F = st(null);
|
|
10
|
+
function St({ children: p, brandSlug: i, initialCartId: C, shoppingCartProps: L }) {
|
|
11
|
+
const [t, f] = k(C || null), [g, A] = k(!1), [U, j] = k(!1), S = _(!1), b = _(!1), w = _(!1), { trackAddToCart: h, trackInitiateCheckout: M, trackPurchase: G } = ht(), E = c(() => {
|
|
12
|
+
if (typeof document > "u") return { fbc: void 0, fbp: void 0 };
|
|
13
|
+
const e = (r) => {
|
|
14
|
+
var o;
|
|
15
|
+
const n = `; ${document.cookie}`.split(`; ${r}=`);
|
|
16
|
+
if (n.length === 2) return (o = n.pop()) == null ? void 0 : o.split(";").shift();
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
fbc: e("_fbc"),
|
|
20
|
+
fbp: e("_fbp")
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
23
|
+
d(() => {
|
|
24
|
+
j(!0);
|
|
25
|
+
}, []), d(() => {
|
|
26
|
+
if (C || S.current) return;
|
|
16
27
|
S.current = !0;
|
|
17
28
|
const r = new URLSearchParams(window.location.search).get("cartId");
|
|
18
29
|
if (r) {
|
|
19
|
-
|
|
30
|
+
f(r);
|
|
20
31
|
return;
|
|
21
32
|
}
|
|
22
|
-
const s = localStorage.getItem(
|
|
23
|
-
s &&
|
|
24
|
-
}, [
|
|
25
|
-
const { data:
|
|
33
|
+
const s = localStorage.getItem(l);
|
|
34
|
+
s && f(s);
|
|
35
|
+
}, [C]);
|
|
36
|
+
const { data: m, isLoading: O, error: I, refetch: a } = ut(t || "", {
|
|
26
37
|
enabled: !!t,
|
|
27
38
|
retry: !1
|
|
28
39
|
// Don't retry on failure - cart might be invalid/expired
|
|
29
|
-
}),
|
|
40
|
+
}), v = it({
|
|
30
41
|
onSuccess: (e) => {
|
|
31
42
|
if ("error" in e) {
|
|
32
43
|
console.error("Failed to create cart:", e.error);
|
|
33
44
|
return;
|
|
34
45
|
}
|
|
35
|
-
|
|
46
|
+
f(e.id);
|
|
36
47
|
},
|
|
37
48
|
onError: (e) => {
|
|
38
49
|
console.error("Failed to create cart:", e);
|
|
39
50
|
},
|
|
40
51
|
retry: 10
|
|
41
52
|
});
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
|
|
53
|
+
d(() => {
|
|
54
|
+
if (b.current) return;
|
|
55
|
+
b.current = !0;
|
|
45
56
|
const e = setTimeout(() => {
|
|
46
|
-
!(typeof window < "u" ? localStorage.getItem(
|
|
57
|
+
!(typeof window < "u" ? localStorage.getItem(l) : null) && !C && v.mutate(i);
|
|
47
58
|
}, 150);
|
|
48
59
|
return () => clearTimeout(e);
|
|
49
|
-
}, []),
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
}, []), d(() => {
|
|
61
|
+
I && t && !w.current && (w.current = !0, console.warn("Cart fetch failed, creating new cart:", I), f(null), typeof window < "u" && localStorage.removeItem(l), setTimeout(() => {
|
|
62
|
+
v.mutate(i), w.current = !1;
|
|
52
63
|
}, 100));
|
|
53
|
-
}, [
|
|
54
|
-
const
|
|
55
|
-
onSuccess: () =>
|
|
56
|
-
}),
|
|
57
|
-
onSuccess: () =>
|
|
58
|
-
}),
|
|
59
|
-
onSuccess: () =>
|
|
60
|
-
}),
|
|
61
|
-
onSuccess: () =>
|
|
62
|
-
}),
|
|
63
|
-
onSuccess: () =>
|
|
64
|
-
}),
|
|
65
|
-
onSuccess: () =>
|
|
64
|
+
}, [I, t, i]);
|
|
65
|
+
const q = ft(t || "", {
|
|
66
|
+
onSuccess: () => a()
|
|
67
|
+
}), H = mt(t || "", {
|
|
68
|
+
onSuccess: () => a()
|
|
69
|
+
}), K = dt(t || "", {
|
|
70
|
+
onSuccess: () => a()
|
|
71
|
+
}), Y = lt(t || "", {
|
|
72
|
+
onSuccess: () => a()
|
|
73
|
+
}), z = pt(t || "", {
|
|
74
|
+
onSuccess: () => a()
|
|
75
|
+
}), B = Ct(t || "", {
|
|
76
|
+
onSuccess: () => a(),
|
|
66
77
|
retry: 3
|
|
67
|
-
}),
|
|
78
|
+
}), J = It(t || "", {
|
|
68
79
|
onSuccess: (e) => {
|
|
69
|
-
var
|
|
80
|
+
var n;
|
|
70
81
|
if ("error" in e) return;
|
|
71
|
-
const r = ((
|
|
72
|
-
var
|
|
82
|
+
const r = ((n = e.items) == null ? void 0 : n.map((o) => {
|
|
83
|
+
var u;
|
|
73
84
|
return {
|
|
74
|
-
id: ((
|
|
75
|
-
quantity:
|
|
76
|
-
item_price: Number(
|
|
85
|
+
id: ((u = o.variant) == null ? void 0 : u.sku) || "",
|
|
86
|
+
quantity: o.quantity,
|
|
87
|
+
item_price: Number(o.priceAtPurchase)
|
|
77
88
|
};
|
|
78
|
-
})) || []
|
|
79
|
-
|
|
89
|
+
})) || [], s = `order_${e.id}`;
|
|
90
|
+
G(
|
|
80
91
|
Number(e.totalPrice),
|
|
81
92
|
"NGN",
|
|
82
93
|
e.id,
|
|
83
|
-
r
|
|
94
|
+
r,
|
|
95
|
+
s
|
|
84
96
|
);
|
|
85
97
|
}
|
|
86
98
|
});
|
|
87
|
-
|
|
88
|
-
t && typeof window < "u" && localStorage.setItem(
|
|
99
|
+
d(() => {
|
|
100
|
+
t && typeof window < "u" && localStorage.setItem(l, t);
|
|
89
101
|
}, [t]);
|
|
90
|
-
const
|
|
91
|
-
async (e, r, s,
|
|
102
|
+
const Q = c(
|
|
103
|
+
async (e, r, s, n, o) => {
|
|
104
|
+
var T;
|
|
92
105
|
if (!t) throw new Error("No cart ID");
|
|
93
|
-
|
|
106
|
+
const { fbc: u, fbp: y } = E(), x = await q.mutateAsync({ sku: n, quantity: o, fbc: u, fbp: y });
|
|
107
|
+
if ("error" in x) return;
|
|
108
|
+
const R = (T = x.items) == null ? void 0 : T.findLast(
|
|
109
|
+
(D) => {
|
|
110
|
+
var $;
|
|
111
|
+
return (($ = D.variant) == null ? void 0 : $.sku) === n;
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
if (R) {
|
|
115
|
+
const D = `cart_${t}_item_${R.id}`;
|
|
116
|
+
h(e, r, s, o, D);
|
|
117
|
+
} else
|
|
118
|
+
h(e, r, s, o);
|
|
94
119
|
},
|
|
95
120
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
|
-
[t,
|
|
97
|
-
),
|
|
121
|
+
[t, h, E]
|
|
122
|
+
), V = c(
|
|
98
123
|
async (e, r) => {
|
|
99
124
|
if (!t) throw new Error("No cart ID");
|
|
100
|
-
await
|
|
125
|
+
await H.mutateAsync({ itemId: e, quantity: r });
|
|
101
126
|
},
|
|
102
127
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
128
|
[t]
|
|
104
|
-
),
|
|
129
|
+
), W = c(
|
|
105
130
|
async (e) => {
|
|
106
131
|
if (!t) throw new Error("No cart ID");
|
|
107
|
-
await
|
|
132
|
+
await K.mutateAsync(e);
|
|
108
133
|
},
|
|
109
134
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
110
135
|
[t]
|
|
111
|
-
),
|
|
136
|
+
), X = c(
|
|
112
137
|
async (e) => {
|
|
113
138
|
if (!t) throw new Error("No cart ID");
|
|
114
|
-
await
|
|
139
|
+
await Y.mutateAsync({ code: e });
|
|
115
140
|
},
|
|
116
141
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
117
142
|
[t]
|
|
118
|
-
),
|
|
143
|
+
), Z = c(async () => {
|
|
119
144
|
if (!t) throw new Error("No cart ID");
|
|
120
|
-
await
|
|
121
|
-
}, [t]),
|
|
122
|
-
|
|
123
|
-
}, []),
|
|
124
|
-
|
|
125
|
-
}, [
|
|
126
|
-
|
|
127
|
-
}, []),
|
|
128
|
-
|
|
129
|
-
}, []),
|
|
130
|
-
|
|
145
|
+
await z.mutateAsync();
|
|
146
|
+
}, [t]), N = c(() => {
|
|
147
|
+
f(null), typeof window < "u" && localStorage.removeItem(l);
|
|
148
|
+
}, []), tt = c(() => {
|
|
149
|
+
N(), v.mutate(i);
|
|
150
|
+
}, [i]), et = c(() => {
|
|
151
|
+
A(!0);
|
|
152
|
+
}, []), P = c(() => {
|
|
153
|
+
A(!1);
|
|
154
|
+
}, []), rt = c(() => {
|
|
155
|
+
var n, o;
|
|
156
|
+
if (!m || !t) return;
|
|
157
|
+
const e = Number(((n = m.pricing) == null ? void 0 : n.total) || 0), r = ((o = m.items) == null ? void 0 : o.reduce((u, y) => u + y.quantity, 0)) || 0, s = `cart_${t}_checkout`;
|
|
158
|
+
M(e, r, s);
|
|
159
|
+
}, [m, t, M]), ot = {
|
|
160
|
+
cart: m || null,
|
|
131
161
|
cartId: t,
|
|
132
|
-
isLoading:
|
|
133
|
-
error:
|
|
134
|
-
updateCartMutation:
|
|
135
|
-
checkoutMutation:
|
|
136
|
-
addItem:
|
|
137
|
-
updateItem:
|
|
138
|
-
removeItem:
|
|
139
|
-
applyDiscount:
|
|
140
|
-
removeDiscount:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
162
|
+
isLoading: O,
|
|
163
|
+
error: I,
|
|
164
|
+
updateCartMutation: B,
|
|
165
|
+
checkoutMutation: J,
|
|
166
|
+
addItem: Q,
|
|
167
|
+
updateItem: V,
|
|
168
|
+
removeItem: W,
|
|
169
|
+
applyDiscount: X,
|
|
170
|
+
removeDiscount: Z,
|
|
171
|
+
trackCheckoutInitiated: rt,
|
|
172
|
+
clearCart: N,
|
|
173
|
+
clearAndCreateNewCart: tt,
|
|
174
|
+
refetch: a,
|
|
175
|
+
isOpen: g,
|
|
176
|
+
open: et,
|
|
177
|
+
close: P
|
|
147
178
|
};
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
179
|
+
return /* @__PURE__ */ nt(F.Provider, { value: ot, children: [
|
|
180
|
+
p,
|
|
181
|
+
U && /* @__PURE__ */ ct(
|
|
182
|
+
wt,
|
|
152
183
|
{
|
|
153
|
-
isOpen:
|
|
154
|
-
onClose:
|
|
155
|
-
...
|
|
184
|
+
isOpen: g,
|
|
185
|
+
onClose: P,
|
|
186
|
+
...L
|
|
156
187
|
}
|
|
157
188
|
)
|
|
158
189
|
] });
|
|
159
190
|
}
|
|
160
|
-
function
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
191
|
+
function bt() {
|
|
192
|
+
const p = at(F);
|
|
193
|
+
if (!p)
|
|
163
194
|
throw new Error("useCart must be used within CartProvider");
|
|
164
|
-
return
|
|
195
|
+
return p;
|
|
165
196
|
}
|
|
166
197
|
export {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
198
|
+
F as CartContext,
|
|
199
|
+
St as CartProvider,
|
|
200
|
+
bt as useCart
|
|
170
201
|
};
|
package/dist/index32.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as s, useMutation as i } from "@tanstack/react-query";
|
|
3
|
-
import { useQueryUnwrapped as
|
|
3
|
+
import { useQueryUnwrapped as a } from "./index67.mjs";
|
|
4
4
|
import { queryKeys as r } from "./index29.mjs";
|
|
5
|
-
import { updateCart as c, createCart as l, applyDiscount as y, removeDiscount as m, addCartItem as
|
|
6
|
-
function
|
|
7
|
-
return
|
|
5
|
+
import { updateCart as c, createCart as l, applyDiscount as y, removeDiscount as m, addCartItem as p, updateCartItem as C, removeCartItem as q, checkoutCart as f, fetchCart as d } from "./index25.mjs";
|
|
6
|
+
function Q(e, t) {
|
|
7
|
+
return a({
|
|
8
8
|
queryKey: r.public.carts.detail(e),
|
|
9
|
-
queryFn: () =>
|
|
9
|
+
queryFn: () => d(e),
|
|
10
10
|
...t
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
function S(e, t) {
|
|
14
|
-
const
|
|
14
|
+
const n = s();
|
|
15
15
|
return i({
|
|
16
|
-
mutationFn: (
|
|
16
|
+
mutationFn: (u) => c(e, u),
|
|
17
17
|
onSuccess: () => {
|
|
18
|
-
|
|
18
|
+
n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
|
|
19
19
|
},
|
|
20
20
|
...t
|
|
21
21
|
});
|
|
@@ -27,61 +27,61 @@ function D(e) {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
function h(e, t) {
|
|
30
|
-
const
|
|
30
|
+
const n = s();
|
|
31
31
|
return i({
|
|
32
|
-
mutationFn: (
|
|
32
|
+
mutationFn: (u) => y(e, u.code),
|
|
33
33
|
onSuccess: () => {
|
|
34
|
-
|
|
34
|
+
n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
|
|
35
35
|
},
|
|
36
36
|
...t
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
function k(e, t) {
|
|
40
|
-
const
|
|
40
|
+
const n = s();
|
|
41
41
|
return i({
|
|
42
42
|
mutationFn: () => m(e),
|
|
43
43
|
onSuccess: () => {
|
|
44
|
-
|
|
44
|
+
n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
|
|
45
45
|
},
|
|
46
46
|
...t
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
function U(e, t) {
|
|
50
|
-
const
|
|
50
|
+
const n = s();
|
|
51
51
|
return i({
|
|
52
|
-
mutationFn: (
|
|
52
|
+
mutationFn: (u) => p(e, u.sku, u.quantity, u.fbc, u.fbp),
|
|
53
53
|
onSuccess: () => {
|
|
54
|
-
|
|
54
|
+
n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
|
|
55
55
|
},
|
|
56
56
|
...t
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
function A(e, t) {
|
|
60
|
-
const
|
|
60
|
+
const n = s();
|
|
61
61
|
return i({
|
|
62
|
-
mutationFn: ({ itemId:
|
|
62
|
+
mutationFn: ({ itemId: u, quantity: o }) => C(e, u, o),
|
|
63
63
|
onSuccess: () => {
|
|
64
|
-
|
|
64
|
+
n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
|
|
65
65
|
},
|
|
66
66
|
...t
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
function R(e, t) {
|
|
70
|
-
const
|
|
70
|
+
const n = s();
|
|
71
71
|
return i({
|
|
72
|
-
mutationFn: (
|
|
72
|
+
mutationFn: (u) => q(e, u),
|
|
73
73
|
onSuccess: () => {
|
|
74
|
-
|
|
74
|
+
n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
|
|
75
75
|
},
|
|
76
76
|
...t
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
function w(e, t) {
|
|
80
|
-
const
|
|
80
|
+
const n = s();
|
|
81
81
|
return i({
|
|
82
|
-
mutationFn: (
|
|
82
|
+
mutationFn: (u) => f(e, u),
|
|
83
83
|
onSuccess: () => {
|
|
84
|
-
|
|
84
|
+
n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
|
|
85
85
|
},
|
|
86
86
|
...t
|
|
87
87
|
});
|
|
@@ -91,7 +91,7 @@ export {
|
|
|
91
91
|
h as useApplyDiscount,
|
|
92
92
|
w as useCheckoutCart,
|
|
93
93
|
D as useCreateCart,
|
|
94
|
-
|
|
94
|
+
Q as useGetCart,
|
|
95
95
|
R as useRemoveCartItem,
|
|
96
96
|
k as useRemoveDiscount,
|
|
97
97
|
S as useUpdateCart,
|
package/dist/index37.mjs
CHANGED
|
@@ -1,46 +1,62 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __module as
|
|
4
|
-
|
|
5
|
-
(
|
|
6
|
-
|
|
2
|
+
import { getDefaultExportFromCjs as x } from "./index60.mjs";
|
|
3
|
+
import { __module as q } from "./index61.mjs";
|
|
4
|
+
function S(b, p) {
|
|
5
|
+
for (var s = 0; s < p.length; s++) {
|
|
6
|
+
const c = p[s];
|
|
7
|
+
if (typeof c != "string" && !Array.isArray(c)) {
|
|
8
|
+
for (const o in c)
|
|
9
|
+
if (o !== "default" && !(o in b)) {
|
|
10
|
+
const t = Object.getOwnPropertyDescriptor(c, o);
|
|
11
|
+
t && Object.defineProperty(b, o, t.get ? t : {
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
get: () => c[o]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze(Object.defineProperty(b, Symbol.toStringTag, { value: "Module" }));
|
|
19
|
+
}
|
|
20
|
+
(function(b, p) {
|
|
21
|
+
(function(s, c) {
|
|
22
|
+
b.exports = c();
|
|
7
23
|
})(window, function() {
|
|
8
|
-
return function(
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
12
|
-
var
|
|
13
|
-
return
|
|
24
|
+
return function(s) {
|
|
25
|
+
var c = {};
|
|
26
|
+
function o(t) {
|
|
27
|
+
if (c[t]) return c[t].exports;
|
|
28
|
+
var a = c[t] = { i: t, l: !1, exports: {} };
|
|
29
|
+
return s[t].call(a.exports, a, a.exports, o), a.l = !0, a.exports;
|
|
14
30
|
}
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
},
|
|
31
|
+
return o.m = s, o.c = c, o.d = function(t, a, i) {
|
|
32
|
+
o.o(t, a) || Object.defineProperty(t, a, { enumerable: !0, get: i });
|
|
33
|
+
}, o.r = function(t) {
|
|
18
34
|
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
|
|
19
|
-
},
|
|
20
|
-
if (1 &
|
|
35
|
+
}, o.t = function(t, a) {
|
|
36
|
+
if (1 & a && (t = o(t)), 8 & a || 4 & a && typeof t == "object" && t && t.__esModule) return t;
|
|
21
37
|
var i = /* @__PURE__ */ Object.create(null);
|
|
22
|
-
if (
|
|
38
|
+
if (o.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: t }), 2 & a && typeof t != "string") for (var d in t) o.d(i, d, (function(u) {
|
|
23
39
|
return t[u];
|
|
24
40
|
}).bind(null, d));
|
|
25
41
|
return i;
|
|
26
|
-
},
|
|
27
|
-
var
|
|
42
|
+
}, o.n = function(t) {
|
|
43
|
+
var a = t && t.__esModule ? function() {
|
|
28
44
|
return t.default;
|
|
29
45
|
} : function() {
|
|
30
46
|
return t;
|
|
31
47
|
};
|
|
32
|
-
return
|
|
33
|
-
},
|
|
34
|
-
return Object.prototype.hasOwnProperty.call(t,
|
|
35
|
-
},
|
|
36
|
-
}([function(
|
|
37
|
-
|
|
38
|
-
}, function(
|
|
48
|
+
return o.d(a, "a", a), a;
|
|
49
|
+
}, o.o = function(t, a) {
|
|
50
|
+
return Object.prototype.hasOwnProperty.call(t, a);
|
|
51
|
+
}, o.p = "", o(o.s = 0);
|
|
52
|
+
}([function(s, c, o) {
|
|
53
|
+
s.exports = o(1);
|
|
54
|
+
}, function(s, c, o) {
|
|
39
55
|
function t(n) {
|
|
40
56
|
return function(e) {
|
|
41
57
|
if (Array.isArray(e)) {
|
|
42
|
-
for (var r = 0,
|
|
43
|
-
return
|
|
58
|
+
for (var r = 0, f = new Array(e.length); r < e.length; r++) f[r] = e[r];
|
|
59
|
+
return f;
|
|
44
60
|
}
|
|
45
61
|
}(n) || function(e) {
|
|
46
62
|
if (Symbol.iterator in Object(e) || Object.prototype.toString.call(e) === "[object Arguments]") return Array.from(e);
|
|
@@ -48,41 +64,41 @@ import { __module as y } from "./index61.mjs";
|
|
|
48
64
|
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
|
49
65
|
}();
|
|
50
66
|
}
|
|
51
|
-
|
|
52
|
-
var
|
|
67
|
+
o.r(c);
|
|
68
|
+
var a = !!window.fbq, i = !1, d = function() {
|
|
53
69
|
var n;
|
|
54
70
|
if (i) {
|
|
55
|
-
for (var e = arguments.length, r = new Array(e),
|
|
71
|
+
for (var e = arguments.length, r = new Array(e), f = 0; f < e; f++) r[f] = arguments[f];
|
|
56
72
|
(n = console).info.apply(n, t(["[react-facebook-pixel]"].concat(r)));
|
|
57
73
|
}
|
|
58
74
|
}, u = function() {
|
|
59
75
|
var n;
|
|
60
76
|
if (i) {
|
|
61
|
-
for (var e = arguments.length, r = new Array(e),
|
|
77
|
+
for (var e = arguments.length, r = new Array(e), f = 0; f < e; f++) r[f] = arguments[f];
|
|
62
78
|
(n = console).info.apply(n, t(["[react-facebook-pixel]"].concat(r)));
|
|
63
79
|
}
|
|
64
|
-
},
|
|
65
|
-
return
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
var e, r,
|
|
69
|
-
e = window, r = document,
|
|
70
|
-
|
|
71
|
-
}, e._fbq || (e._fbq =
|
|
80
|
+
}, g = function() {
|
|
81
|
+
return a || d("Pixel not initialized before using call ReactPixel.init with required params"), a;
|
|
82
|
+
}, h = { autoConfig: !0, debug: !1 };
|
|
83
|
+
c.default = { init: function(n) {
|
|
84
|
+
var e, r, f, l, m, y, k = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, v = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : h;
|
|
85
|
+
e = window, r = document, f = "script", e.fbq || (l = e.fbq = function() {
|
|
86
|
+
l.callMethod ? l.callMethod.apply(l, arguments) : l.queue.push(arguments);
|
|
87
|
+
}, e._fbq || (e._fbq = l), l.push = l, l.loaded = !0, l.version = "2.0", l.queue = [], (m = r.createElement(f)).async = !0, m.src = "https://connect.facebook.net/en_US/fbevents.js", (y = r.getElementsByTagName(f)[0]).parentNode.insertBefore(m, y)), n ? (v.autoConfig === !1 && fbq("set", "autoConfig", !1, n), fbq("init", n, k), a = !0, i = v.debug) : d("Please insert pixel id for initializing");
|
|
72
88
|
}, pageView: function() {
|
|
73
|
-
|
|
89
|
+
g() && (fbq("track", "PageView"), i && u("called fbq('track', 'PageView');"));
|
|
74
90
|
}, track: function(n, e) {
|
|
75
|
-
|
|
91
|
+
g() && (fbq("track", n, e), i && (u("called fbq('track', '".concat(n, "');")), e && u("with data", e)));
|
|
76
92
|
}, trackSingle: function(n, e, r) {
|
|
77
|
-
|
|
93
|
+
g() && (fbq("trackSingle", n, e, r), i && (u("called fbq('trackSingle', '".concat(n, "', '").concat(e, "');")), r && u("with data", r)));
|
|
78
94
|
}, trackCustom: function(n, e) {
|
|
79
|
-
|
|
95
|
+
g() && (fbq("trackCustom", n, e), i && (u("called fbq('trackCustom', '".concat(n, "');")), e && u("with data", e)));
|
|
80
96
|
}, trackSingleCustom: function(n, e, r) {
|
|
81
|
-
|
|
97
|
+
g() && (fbq("trackSingle", n, e, r), i && (u("called fbq('trackSingleCustom', '".concat(n, "', '").concat(e, "');")), r && u("with data", r)));
|
|
82
98
|
}, grantConsent: function() {
|
|
83
|
-
|
|
99
|
+
g() && (fbq("consent", "grant"), i && u("called fbq('consent', 'grant');"));
|
|
84
100
|
}, revokeConsent: function() {
|
|
85
|
-
|
|
101
|
+
g() && (fbq("consent", "revoke"), i && u("called fbq('consent', 'revoke');"));
|
|
86
102
|
}, fbq: function(n) {
|
|
87
103
|
function e() {
|
|
88
104
|
return n.apply(this, arguments);
|
|
@@ -91,16 +107,20 @@ import { __module as y } from "./index61.mjs";
|
|
|
91
107
|
return n.toString();
|
|
92
108
|
}, e;
|
|
93
109
|
}(function() {
|
|
94
|
-
if (
|
|
110
|
+
if (g()) {
|
|
95
111
|
for (var n = arguments.length, e = new Array(n), r = 0; r < n; r++) e[r] = arguments[r];
|
|
96
112
|
fbq.apply(void 0, e), i && (u("called fbq('".concat(e.slice(0, 2).join("', '"), "')")), e[2] && u("with data", e[2]));
|
|
97
113
|
}
|
|
98
114
|
}) };
|
|
99
115
|
}]);
|
|
100
116
|
});
|
|
101
|
-
})(
|
|
102
|
-
var
|
|
103
|
-
const
|
|
117
|
+
})(q);
|
|
118
|
+
var w = q.exports;
|
|
119
|
+
const j = /* @__PURE__ */ x(w), O = /* @__PURE__ */ S({
|
|
120
|
+
__proto__: null,
|
|
121
|
+
default: j
|
|
122
|
+
}, [w]);
|
|
104
123
|
export {
|
|
105
|
-
|
|
124
|
+
j as default,
|
|
125
|
+
O as f
|
|
106
126
|
};
|
package/dist/index38.mjs
CHANGED