@instockng/storefront-ui 1.0.33 → 1.0.34
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/contexts/CartContext.d.ts.map +1 -1
- package/dist/index100.mjs +8 -8
- package/dist/index101.mjs +6 -6
- package/dist/index102.mjs +3 -3
- package/dist/index103.mjs +1 -1
- package/dist/index104.mjs +1 -1
- package/dist/index105.mjs +1 -1
- package/dist/index106.mjs +2 -2
- package/dist/index107.mjs +2 -2
- package/dist/index108.mjs +3 -3
- package/dist/index109.mjs +1 -1
- package/dist/index110.mjs +3 -3
- package/dist/index111.mjs +2 -2
- package/dist/index112.mjs +2 -2
- package/dist/index113.mjs +1 -1
- package/dist/index114.mjs +3 -3
- package/dist/index115.mjs +1 -1
- package/dist/index116.mjs +1 -1
- package/dist/index117.mjs +3 -3
- package/dist/index118.mjs +2 -2
- package/dist/index119.mjs +4 -4
- package/dist/index120.mjs +1 -1
- package/dist/index121.mjs +3 -3
- package/dist/index122.mjs +4 -4
- package/dist/index123.mjs +1 -1
- package/dist/index124.mjs +1 -1
- package/dist/index125.mjs +1 -1
- package/dist/index126.mjs +1 -1
- package/dist/index127.mjs +1 -1
- package/dist/index128.mjs +1 -1
- package/dist/index129.mjs +1 -1
- package/dist/index130.mjs +2 -2
- package/dist/index131.mjs +3 -3
- package/dist/index134.mjs +1 -1
- package/dist/index148.mjs +2 -2
- package/dist/index150.mjs +2 -2
- package/dist/index151.mjs +2 -18
- package/dist/index152.mjs +11 -25
- package/dist/index153.mjs +26 -32
- package/dist/index154.mjs +32 -12
- package/dist/index155.mjs +9 -9
- package/dist/index156.mjs +18 -2
- package/dist/index157.mjs +2 -20
- package/dist/index158.mjs +13 -39
- package/dist/index159.mjs +46 -2
- package/dist/index160.mjs +2 -30
- package/dist/index161.mjs +24 -12
- package/dist/index162.mjs +18 -2
- package/dist/index163.mjs +2 -2
- package/dist/index164.mjs +2 -2
- package/dist/index165.mjs +2 -2
- package/dist/index166.mjs +2 -72
- package/dist/index167.mjs +72 -2
- package/dist/index168.mjs +2 -53
- package/dist/index169.mjs +53 -2
- package/dist/index170.mjs +2 -36
- package/dist/index171.mjs +30 -146
- package/dist/index172.mjs +152 -2
- package/dist/index173.mjs +2 -2
- package/dist/index174.mjs +2 -19
- package/dist/index175.mjs +19 -2
- package/dist/index176.mjs +2 -2
- package/dist/index177.mjs +2 -26
- package/dist/index178.mjs +26 -2
- package/dist/index179.mjs +2 -2
- package/dist/index180.mjs +2 -24
- package/dist/index181.mjs +17 -16
- package/dist/index182.mjs +23 -2
- package/dist/index184.mjs +2 -2
- package/dist/index185.mjs +2 -23
- package/dist/index186.mjs +23 -2
- package/dist/index187.mjs +2 -23
- package/dist/index188.mjs +23 -2
- package/dist/index189.mjs +2 -2
- package/dist/index191.mjs +2 -23
- package/dist/index192.mjs +23 -2
- package/dist/index193.mjs +2 -23
- package/dist/index194.mjs +23 -2
- package/dist/index195.mjs +2 -2
- package/dist/index196.mjs +2 -2
- package/dist/index198.mjs +2 -2
- package/dist/index199.mjs +2 -2
- package/dist/index200.mjs +2 -2
- package/dist/index201.mjs +2 -2
- package/dist/index202.mjs +2 -127
- package/dist/index203.mjs +127 -2
- package/dist/index204.mjs +2 -74
- package/dist/index205.mjs +60 -60
- package/dist/index206.mjs +74 -2
- package/dist/index222.mjs +2 -2
- package/dist/index223.mjs +108 -2
- package/dist/index224.mjs +2 -2
- package/dist/index225.mjs +2 -2
- package/dist/index226.mjs +2 -2
- package/dist/index227.mjs +2 -37
- package/dist/index228.mjs +2 -2
- package/dist/index229.mjs +2 -2
- package/dist/index230.mjs +36 -243
- package/dist/index231.mjs +2 -2
- package/dist/index232.mjs +2 -33
- package/dist/index233.mjs +240 -61
- package/dist/index234.mjs +2 -25
- package/dist/index235.mjs +33 -2
- package/dist/index236.mjs +56 -99
- package/dist/index237.mjs +25 -2
- package/dist/index239.mjs +2 -2
- package/dist/index240.mjs +2 -2
- package/dist/index241.mjs +2 -2
- package/dist/index247.mjs +1 -1
- package/dist/index257.mjs +2 -2
- package/dist/index258.mjs +2 -18
- package/dist/index259.mjs +13 -42
- package/dist/index260.mjs +47 -2
- package/dist/index261.mjs +2 -2
- package/dist/index262.mjs +2 -2
- package/dist/index263.mjs +2 -2
- package/dist/index264.mjs +2 -91
- package/dist/index265.mjs +91 -2
- package/dist/index3.mjs +75 -71
- package/dist/index38.mjs +2 -2
- package/dist/index40.mjs +2 -2
- package/dist/index44.mjs +1 -1
- package/dist/index5.mjs +36 -35
- package/dist/index50.mjs +2 -2
- package/dist/index63.mjs +21 -20
- package/dist/index64.mjs +2 -24
- package/dist/index65.mjs +19 -149
- package/dist/index66.mjs +153 -2
- package/dist/index69.mjs +1 -1
- package/dist/index87.mjs +34 -2
- package/dist/index88.mjs +42 -5
- package/dist/index89.mjs +2 -1134
- package/dist/index90.mjs +5 -19
- package/dist/index91.mjs +1119 -40
- package/dist/index92.mjs +14 -27
- package/dist/index93.mjs +55 -2
- package/dist/index94.mjs +33 -34
- package/dist/index95.mjs +2 -43
- package/dist/index98.mjs +1 -1
- package/dist/index99.mjs +1 -1
- package/dist/providers/TikTokPixelProvider.d.ts +5 -1
- package/dist/providers/TikTokPixelProvider.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/contexts/CartContext.tsx +8 -1
- package/src/providers/TikTokPixelProvider.tsx +10 -3
package/dist/index3.mjs
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs as at, jsx as ct } from "react/jsx-runtime";
|
|
3
|
-
import { createContext as st, useState as
|
|
3
|
+
import { createContext as st, useState as M, useRef as E, useEffect as f, useCallback as n, useContext as it } from "react";
|
|
4
4
|
import "./index21.mjs";
|
|
5
|
-
import { useGetCart as ut, useCreateCart as mt, useAddCartItem as dt, useUpdateCartItem as ft, useRemoveCartItem as lt, useApplyDiscount as Ct, useRemoveDiscount as It, useUpdateCart as wt, useCheckoutCart as
|
|
5
|
+
import { useGetCart as ut, useCreateCart as mt, useAddCartItem as dt, useUpdateCartItem as ft, useRemoveCartItem as lt, useApplyDiscount as Ct, useRemoveDiscount as It, useUpdateCart as wt, useCheckoutCart as pt } from "./index33.mjs";
|
|
6
6
|
import "@tanstack/react-query";
|
|
7
|
-
import { ShoppingCart as
|
|
7
|
+
import { ShoppingCart as kt } from "./index11.mjs";
|
|
8
8
|
import { useMetaPixel as ht } from "./index4.mjs";
|
|
9
9
|
import { useTikTokPixel as yt } from "./index5.mjs";
|
|
10
10
|
import { getFbCookies as vt } from "./index20.mjs";
|
|
11
|
-
const
|
|
12
|
-
function Pt({ children:
|
|
13
|
-
const [t,
|
|
14
|
-
|
|
11
|
+
const l = "oms_cart_id", $ = st(null);
|
|
12
|
+
function Pt({ children: C, brandSlug: m, initialCartId: I, shoppingCartProps: j }) {
|
|
13
|
+
const [t, d] = M(I || null), [S, _] = M(!1), [O, G] = M(!1), x = E(!1), g = E(!1), v = E(!1), { trackAddToCart: T, trackInitiateCheckout: P } = ht(), { trackAddToCart: A, trackInitiateCheckout: R } = yt();
|
|
14
|
+
f(() => {
|
|
15
15
|
G(!0);
|
|
16
|
-
}, []),
|
|
17
|
-
if (
|
|
16
|
+
}, []), f(() => {
|
|
17
|
+
if (I || x.current) return;
|
|
18
18
|
x.current = !0;
|
|
19
19
|
const r = new URLSearchParams(window.location.search).get("cartId");
|
|
20
20
|
if (r) {
|
|
21
|
-
|
|
21
|
+
d(r);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
const o = localStorage.getItem(
|
|
25
|
-
o &&
|
|
26
|
-
}, [
|
|
27
|
-
const { data:
|
|
24
|
+
const o = localStorage.getItem(l);
|
|
25
|
+
o && d(o);
|
|
26
|
+
}, [I]);
|
|
27
|
+
const { data: i, isLoading: H, error: w, refetch: s } = ut(t || "", {
|
|
28
28
|
enabled: !!t,
|
|
29
29
|
retry: !1
|
|
30
30
|
// Don't retry on failure - cart might be invalid/expired
|
|
31
|
-
}),
|
|
31
|
+
}), D = mt({
|
|
32
32
|
onSuccess: (e) => {
|
|
33
33
|
if ("error" in e) {
|
|
34
34
|
console.error("Failed to create cart:", e.error);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
d(e.id);
|
|
38
38
|
},
|
|
39
39
|
onError: (e) => {
|
|
40
40
|
console.error("Failed to create cart:", e);
|
|
41
41
|
},
|
|
42
42
|
retry: 10
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
|
|
44
|
+
f(() => {
|
|
45
|
+
if (g.current) return;
|
|
46
|
+
g.current = !0;
|
|
47
47
|
const e = setTimeout(() => {
|
|
48
|
-
!(typeof window < "u" ? localStorage.getItem(
|
|
48
|
+
!(typeof window < "u" ? localStorage.getItem(l) : null) && !I && D.mutate(m);
|
|
49
49
|
}, 150);
|
|
50
50
|
return () => clearTimeout(e);
|
|
51
|
-
}, []),
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
}, []), f(() => {
|
|
52
|
+
w && t && !v.current && (v.current = !0, console.warn("Cart fetch failed, creating new cart:", w), d(null), typeof window < "u" && localStorage.removeItem(l), setTimeout(() => {
|
|
53
|
+
D.mutate(m), v.current = !1;
|
|
54
54
|
}, 100));
|
|
55
|
-
}, [
|
|
55
|
+
}, [w, t, m]);
|
|
56
56
|
const K = dt(t || "", {
|
|
57
|
-
onSuccess: () =>
|
|
57
|
+
onSuccess: () => s()
|
|
58
58
|
}), Y = ft(t || "", {
|
|
59
|
-
onSuccess: () =>
|
|
59
|
+
onSuccess: () => s()
|
|
60
60
|
}), z = lt(t || "", {
|
|
61
|
-
onSuccess: () =>
|
|
61
|
+
onSuccess: () => s()
|
|
62
62
|
}), B = Ct(t || "", {
|
|
63
|
-
onSuccess: () =>
|
|
63
|
+
onSuccess: () => s()
|
|
64
64
|
}), J = It(t || "", {
|
|
65
|
-
onSuccess: () =>
|
|
65
|
+
onSuccess: () => s()
|
|
66
66
|
}), Q = wt(t || "", {
|
|
67
|
-
onSuccess: () =>
|
|
67
|
+
onSuccess: () => s(),
|
|
68
68
|
retry: 3
|
|
69
|
-
}), V =
|
|
69
|
+
}), V = pt(t || "", {
|
|
70
70
|
onSuccess: () => {
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
|
|
74
|
-
t && typeof window < "u" && localStorage.setItem(
|
|
73
|
+
f(() => {
|
|
74
|
+
t && typeof window < "u" && localStorage.setItem(l, t);
|
|
75
75
|
}, [t]);
|
|
76
76
|
const W = n(
|
|
77
|
-
async (e, r, o,
|
|
78
|
-
var
|
|
77
|
+
async (e, r, o, p, a) => {
|
|
78
|
+
var U;
|
|
79
79
|
if (!t) throw new Error("No cart ID");
|
|
80
|
-
const { fbc:
|
|
81
|
-
if ("error" in
|
|
82
|
-
const
|
|
83
|
-
(
|
|
80
|
+
const { fbc: k, fbp: h } = vt(), c = await K.mutateAsync({ sku: p, quantity: a, fbc: k, fbp: h });
|
|
81
|
+
if ("error" in c) return;
|
|
82
|
+
const u = (U = c.items) == null ? void 0 : U.filter(
|
|
83
|
+
(y) => {
|
|
84
84
|
var L;
|
|
85
|
-
return ((L =
|
|
85
|
+
return ((L = y.variant) == null ? void 0 : L.sku) === p;
|
|
86
86
|
}
|
|
87
|
-
),
|
|
88
|
-
if (
|
|
89
|
-
const
|
|
90
|
-
|
|
87
|
+
), b = u == null ? void 0 : u[u.length - 1];
|
|
88
|
+
if (b) {
|
|
89
|
+
const y = `cart_${t}_item_${b.id}`;
|
|
90
|
+
T(e, r, o, a, y), A(e, r, o, a, y);
|
|
91
91
|
} else
|
|
92
|
-
|
|
92
|
+
T(e, r, o, a), A(e, r, o, a);
|
|
93
93
|
},
|
|
94
94
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
95
|
-
[t,
|
|
95
|
+
[t, T, A]
|
|
96
96
|
), X = n(
|
|
97
97
|
async (e, r) => {
|
|
98
98
|
if (!t) throw new Error("No cart ID");
|
|
@@ -117,24 +117,28 @@ function Pt({ children: l, brandSlug: s, initialCartId: C, shoppingCartProps: j
|
|
|
117
117
|
), tt = n(async () => {
|
|
118
118
|
if (!t) throw new Error("No cart ID");
|
|
119
119
|
await J.mutateAsync();
|
|
120
|
-
}, [t]),
|
|
121
|
-
|
|
120
|
+
}, [t]), F = n(() => {
|
|
121
|
+
d(null), typeof window < "u" && localStorage.removeItem(l);
|
|
122
122
|
}, []), et = n(() => {
|
|
123
|
-
|
|
124
|
-
}, [
|
|
125
|
-
|
|
126
|
-
}, []),
|
|
127
|
-
|
|
123
|
+
F(), D.mutate(m);
|
|
124
|
+
}, [m]), rt = n(() => {
|
|
125
|
+
_(!0);
|
|
126
|
+
}, []), N = n(() => {
|
|
127
|
+
_(!1);
|
|
128
128
|
}, []), ot = n(() => {
|
|
129
|
-
var
|
|
130
|
-
if (!
|
|
131
|
-
const e = Number(((
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
var a, k, h;
|
|
130
|
+
if (!i || !t) return;
|
|
131
|
+
const e = Number(((a = i.pricing) == null ? void 0 : a.total) || 0), r = ((k = i.items) == null ? void 0 : k.reduce((c, u) => c + u.quantity, 0)) || 0, o = `cart_${t}_checkout`, p = ((h = i.items) == null ? void 0 : h.map((c) => ({
|
|
132
|
+
content_id: c.variant.sku,
|
|
133
|
+
quantity: c.quantity,
|
|
134
|
+
price: Number(c.variant.price)
|
|
135
|
+
}))) || [];
|
|
136
|
+
P(e, r, o), R(e, r, o, p);
|
|
137
|
+
}, [i, t, P, R]), nt = {
|
|
138
|
+
cart: i || null,
|
|
135
139
|
cartId: t,
|
|
136
140
|
isLoading: H,
|
|
137
|
-
error:
|
|
141
|
+
error: w,
|
|
138
142
|
updateCartMutation: Q,
|
|
139
143
|
checkoutMutation: V,
|
|
140
144
|
addItem: W,
|
|
@@ -143,30 +147,30 @@ function Pt({ children: l, brandSlug: s, initialCartId: C, shoppingCartProps: j
|
|
|
143
147
|
applyDiscount: q,
|
|
144
148
|
removeDiscount: tt,
|
|
145
149
|
trackCheckoutInitiated: ot,
|
|
146
|
-
clearCart:
|
|
150
|
+
clearCart: F,
|
|
147
151
|
clearAndCreateNewCart: et,
|
|
148
|
-
refetch:
|
|
149
|
-
isOpen:
|
|
152
|
+
refetch: s,
|
|
153
|
+
isOpen: S,
|
|
150
154
|
open: rt,
|
|
151
|
-
close:
|
|
155
|
+
close: N
|
|
152
156
|
};
|
|
153
157
|
return /* @__PURE__ */ at($.Provider, { value: nt, children: [
|
|
154
|
-
|
|
158
|
+
C,
|
|
155
159
|
O && /* @__PURE__ */ ct(
|
|
156
|
-
|
|
160
|
+
kt,
|
|
157
161
|
{
|
|
158
|
-
isOpen:
|
|
159
|
-
onClose:
|
|
162
|
+
isOpen: S,
|
|
163
|
+
onClose: N,
|
|
160
164
|
...j
|
|
161
165
|
}
|
|
162
166
|
)
|
|
163
167
|
] });
|
|
164
168
|
}
|
|
165
169
|
function Rt() {
|
|
166
|
-
const
|
|
167
|
-
if (!
|
|
170
|
+
const C = it($);
|
|
171
|
+
if (!C)
|
|
168
172
|
throw new Error("useCart must be used within CartProvider");
|
|
169
|
-
return
|
|
173
|
+
return C;
|
|
170
174
|
}
|
|
171
175
|
export {
|
|
172
176
|
$ as CartContext,
|
package/dist/index38.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getDefaultExportFromCjs as x } from "./
|
|
3
|
-
import { __module as q } from "./
|
|
2
|
+
import { getDefaultExportFromCjs as x } from "./index63.mjs";
|
|
3
|
+
import { __module as q } from "./index64.mjs";
|
|
4
4
|
function S(b, p) {
|
|
5
5
|
for (var s = 0; s < p.length; s++) {
|
|
6
6
|
const c = p[s];
|
package/dist/index40.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getDefaultExportFromCjs as n } from "./
|
|
3
|
-
import { __require as i } from "./
|
|
2
|
+
import { getDefaultExportFromCjs as n } from "./index63.mjs";
|
|
3
|
+
import { __require as i } from "./index66.mjs";
|
|
4
4
|
function s(t, a) {
|
|
5
5
|
for (var o = 0; o < a.length; o++) {
|
|
6
6
|
const e = a[o];
|
package/dist/index44.mjs
CHANGED
package/dist/index5.mjs
CHANGED
|
@@ -1,97 +1,98 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
-
import { createContext as x, useContext as p, useState as w, useEffect as
|
|
3
|
+
import { createContext as x, useContext as p, useState as w, useEffect as v } from "react";
|
|
4
4
|
const u = x(void 0);
|
|
5
5
|
let c = null;
|
|
6
6
|
function N({
|
|
7
7
|
children: a,
|
|
8
8
|
pixelId: k,
|
|
9
|
-
debug:
|
|
9
|
+
debug: r = !1
|
|
10
10
|
}) {
|
|
11
11
|
const [T, d] = w(!1);
|
|
12
|
-
|
|
12
|
+
v(() => {
|
|
13
13
|
if (typeof window > "u") return;
|
|
14
14
|
if (!k) {
|
|
15
|
-
|
|
15
|
+
r && console.log("TikTok Pixel ID not provided. Tracking disabled.");
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
(async () => {
|
|
19
19
|
try {
|
|
20
20
|
const t = (await import("./index39.mjs")).default;
|
|
21
|
-
t.init(k, {}, { debug:
|
|
21
|
+
t.init(k, {}, { debug: r }), t.pageView(), c = t, d(!0), r && console.log("TikTok Pixel initialized:", k);
|
|
22
22
|
} catch (t) {
|
|
23
23
|
console.error("Failed to initialize TikTok Pixel:", t);
|
|
24
24
|
}
|
|
25
25
|
})();
|
|
26
|
-
}, [k,
|
|
27
|
-
const
|
|
26
|
+
}, [k, r]);
|
|
27
|
+
const n = (i, t, o) => {
|
|
28
28
|
if (!T || !c) {
|
|
29
|
-
|
|
29
|
+
r && console.log("TikTok Pixel not initialized. Event not tracked:", i);
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
try {
|
|
33
|
-
const
|
|
34
|
-
c.track(
|
|
35
|
-
} catch (
|
|
36
|
-
console.error("Failed to track TikTok Pixel event:",
|
|
33
|
+
const e = o ? { ...t, event_id: o } : t;
|
|
34
|
+
c.track(i, e), r && console.log("TikTok Pixel tracked event:", i, e);
|
|
35
|
+
} catch (e) {
|
|
36
|
+
console.error("Failed to track TikTok Pixel event:", e);
|
|
37
37
|
}
|
|
38
38
|
}, P = {
|
|
39
|
-
track:
|
|
39
|
+
track: n,
|
|
40
40
|
trackPageView: () => {
|
|
41
41
|
if (!(!T || !c))
|
|
42
42
|
try {
|
|
43
|
-
c.pageView(),
|
|
44
|
-
} catch (
|
|
45
|
-
console.error("Failed to track TikTok Pixel page view:",
|
|
43
|
+
c.pageView(), r && console.log("TikTok Pixel tracked page view");
|
|
44
|
+
} catch (i) {
|
|
45
|
+
console.error("Failed to track TikTok Pixel page view:", i);
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
trackProductView: (
|
|
49
|
-
|
|
48
|
+
trackProductView: (i, t, o, e) => {
|
|
49
|
+
n(
|
|
50
50
|
"ViewContent",
|
|
51
51
|
{
|
|
52
52
|
content_type: "product",
|
|
53
|
-
content_id:
|
|
53
|
+
content_id: i,
|
|
54
54
|
content_name: t,
|
|
55
|
-
price:
|
|
55
|
+
price: o,
|
|
56
56
|
currency: "NGN"
|
|
57
57
|
},
|
|
58
|
-
|
|
58
|
+
e
|
|
59
59
|
);
|
|
60
60
|
},
|
|
61
|
-
trackAddToCart: (
|
|
62
|
-
|
|
61
|
+
trackAddToCart: (i, t, o, e, l) => {
|
|
62
|
+
n(
|
|
63
63
|
"AddToCart",
|
|
64
64
|
{
|
|
65
65
|
content_type: "product",
|
|
66
|
-
content_id:
|
|
66
|
+
content_id: i,
|
|
67
67
|
content_name: t,
|
|
68
|
-
|
|
69
|
-
quantity:
|
|
68
|
+
value: o * e,
|
|
69
|
+
quantity: e,
|
|
70
70
|
currency: "NGN"
|
|
71
71
|
},
|
|
72
72
|
l
|
|
73
73
|
);
|
|
74
74
|
},
|
|
75
|
-
trackInitiateCheckout: (
|
|
76
|
-
|
|
75
|
+
trackInitiateCheckout: (i, t, o, e) => {
|
|
76
|
+
n(
|
|
77
77
|
"InitiateCheckout",
|
|
78
78
|
{
|
|
79
79
|
content_type: "product",
|
|
80
|
-
value:
|
|
80
|
+
value: i,
|
|
81
81
|
currency: "NGN",
|
|
82
|
-
num_items: t
|
|
82
|
+
num_items: t,
|
|
83
|
+
...e && e.length > 0 ? { contents: e } : {}
|
|
83
84
|
},
|
|
84
|
-
|
|
85
|
+
o
|
|
85
86
|
);
|
|
86
87
|
},
|
|
87
|
-
trackPurchase: (
|
|
88
|
-
|
|
88
|
+
trackPurchase: (i, t, o, e, l) => {
|
|
89
|
+
n(
|
|
89
90
|
"CompletePayment",
|
|
90
91
|
{
|
|
91
92
|
content_type: "product",
|
|
92
|
-
value:
|
|
93
|
+
value: i,
|
|
93
94
|
currency: t,
|
|
94
|
-
contents:
|
|
95
|
+
contents: e.map((s) => ({
|
|
95
96
|
content_id: s.id,
|
|
96
97
|
quantity: s.quantity,
|
|
97
98
|
price: s.item_price
|
package/dist/index50.mjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
var p = Object.defineProperty;
|
|
3
3
|
var k = (r, e, i) => e in r ? p(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i;
|
|
4
4
|
var h = (r, e, i) => k(r, typeof e != "symbol" ? e + "" : e, i);
|
|
5
|
-
import { serialize as j } from "./
|
|
6
|
-
import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./
|
|
5
|
+
import { serialize as j } from "./index87.mjs";
|
|
6
|
+
import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index88.mjs";
|
|
7
7
|
var v = (r, e) => new Proxy(() => {
|
|
8
8
|
}, {
|
|
9
9
|
get(t, s) {
|
package/dist/index63.mjs
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (typeof n == "function")
|
|
5
|
-
return n(o);
|
|
6
|
-
n != null && (n.current = o);
|
|
2
|
+
function n(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
7
4
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
5
|
+
function c(e) {
|
|
6
|
+
if (e.__esModule) return e;
|
|
7
|
+
var o = e.default;
|
|
8
|
+
if (typeof o == "function") {
|
|
9
|
+
var t = function r() {
|
|
10
|
+
return this instanceof r ? Reflect.construct(o, arguments, this.constructor) : o.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
t.prototype = o.prototype;
|
|
13
|
+
} else t = {};
|
|
14
|
+
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
|
|
15
|
+
var u = Object.getOwnPropertyDescriptor(e, r);
|
|
16
|
+
Object.defineProperty(t, r, u.get ? u : {
|
|
17
|
+
enumerable: !0,
|
|
18
|
+
get: function() {
|
|
19
|
+
return e[r];
|
|
20
|
+
}
|
|
14
21
|
});
|
|
15
|
-
|
|
16
|
-
return () => {
|
|
17
|
-
for (let t = 0; t < c.length; t++) {
|
|
18
|
-
const e = c[t];
|
|
19
|
-
typeof e == "function" ? e() : i(n[t], null);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
22
|
+
}), t;
|
|
23
23
|
}
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
c as getAugmentedNamespace,
|
|
26
|
+
n as getDefaultExportFromCjs
|
|
26
27
|
};
|
package/dist/index64.mjs
CHANGED
|
@@ -1,27 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
-
}
|
|
5
|
-
function c(e) {
|
|
6
|
-
if (e.__esModule) return e;
|
|
7
|
-
var o = e.default;
|
|
8
|
-
if (typeof o == "function") {
|
|
9
|
-
var t = function r() {
|
|
10
|
-
return this instanceof r ? Reflect.construct(o, arguments, this.constructor) : o.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
t.prototype = o.prototype;
|
|
13
|
-
} else t = {};
|
|
14
|
-
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
|
|
15
|
-
var u = Object.getOwnPropertyDescriptor(e, r);
|
|
16
|
-
Object.defineProperty(t, r, u.get ? u : {
|
|
17
|
-
enumerable: !0,
|
|
18
|
-
get: function() {
|
|
19
|
-
return e[r];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}), t;
|
|
23
|
-
}
|
|
2
|
+
var e = { exports: {} };
|
|
24
3
|
export {
|
|
25
|
-
|
|
26
|
-
n as getDefaultExportFromCjs
|
|
4
|
+
e as __module
|
|
27
5
|
};
|
package/dist/index65.mjs
CHANGED
|
@@ -1,156 +1,26 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
value: !0
|
|
15
|
-
});
|
|
16
|
-
function _(e, o) {
|
|
17
|
-
for (var t in o) Object.defineProperty(e, t, {
|
|
18
|
-
enumerable: !0,
|
|
19
|
-
get: o[t]
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
_(u, {
|
|
23
|
-
Router: function() {
|
|
24
|
-
return i.default;
|
|
25
|
-
},
|
|
26
|
-
createRouter: function() {
|
|
27
|
-
return P;
|
|
28
|
-
},
|
|
29
|
-
// Export the singletonRouter and this is the public API.
|
|
30
|
-
default: function() {
|
|
31
|
-
return v;
|
|
32
|
-
},
|
|
33
|
-
makePublicRouterInstance: function() {
|
|
34
|
-
return E;
|
|
35
|
-
},
|
|
36
|
-
useRouter: function() {
|
|
37
|
-
return q;
|
|
38
|
-
},
|
|
39
|
-
withRouter: function() {
|
|
40
|
-
return w.default;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
const f = M, R = /* @__PURE__ */ f._(j), i = /* @__PURE__ */ f._(A()), b = O(), y = /* @__PURE__ */ f._(x()), w = /* @__PURE__ */ f._(F()), n = {
|
|
44
|
-
router: null,
|
|
45
|
-
readyCallbacks: [],
|
|
46
|
-
ready(e) {
|
|
47
|
-
if (this.router) return e();
|
|
48
|
-
typeof window < "u" && this.readyCallbacks.push(e);
|
|
49
|
-
}
|
|
50
|
-
}, d = [
|
|
51
|
-
"pathname",
|
|
52
|
-
"route",
|
|
53
|
-
"query",
|
|
54
|
-
"asPath",
|
|
55
|
-
"components",
|
|
56
|
-
"isFallback",
|
|
57
|
-
"basePath",
|
|
58
|
-
"locale",
|
|
59
|
-
"locales",
|
|
60
|
-
"defaultLocale",
|
|
61
|
-
"isReady",
|
|
62
|
-
"isPreview",
|
|
63
|
-
"isLocaleDomain",
|
|
64
|
-
"domainLocales"
|
|
65
|
-
], C = [
|
|
66
|
-
"routeChangeStart",
|
|
67
|
-
"beforeHistoryChange",
|
|
68
|
-
"routeChangeComplete",
|
|
69
|
-
"routeChangeError",
|
|
70
|
-
"hashChangeStart",
|
|
71
|
-
"hashChangeComplete"
|
|
72
|
-
], h = [
|
|
73
|
-
"push",
|
|
74
|
-
"replace",
|
|
75
|
-
"reload",
|
|
76
|
-
"back",
|
|
77
|
-
"prefetch",
|
|
78
|
-
"beforePopState"
|
|
79
|
-
];
|
|
80
|
-
Object.defineProperty(n, "events", {
|
|
81
|
-
get() {
|
|
82
|
-
return i.default.events;
|
|
83
|
-
}
|
|
2
|
+
import "react";
|
|
3
|
+
function i(n, o) {
|
|
4
|
+
if (typeof n == "function")
|
|
5
|
+
return n(o);
|
|
6
|
+
n != null && (n.current = o);
|
|
7
|
+
}
|
|
8
|
+
function f(...n) {
|
|
9
|
+
return (o) => {
|
|
10
|
+
let u = !1;
|
|
11
|
+
const c = n.map((t) => {
|
|
12
|
+
const e = i(t, o);
|
|
13
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
84
14
|
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
throw new Error(e);
|
|
91
|
-
}
|
|
92
|
-
return n.router;
|
|
93
|
-
}
|
|
94
|
-
d.forEach((e) => {
|
|
95
|
-
Object.defineProperty(n, e, {
|
|
96
|
-
get() {
|
|
97
|
-
return m()[e];
|
|
15
|
+
if (u)
|
|
16
|
+
return () => {
|
|
17
|
+
for (let t = 0; t < c.length; t++) {
|
|
18
|
+
const e = c[t];
|
|
19
|
+
typeof e == "function" ? e() : i(n[t], null);
|
|
98
20
|
}
|
|
99
|
-
});
|
|
100
|
-
}), h.forEach((e) => {
|
|
101
|
-
n[e] = function() {
|
|
102
|
-
for (var o = arguments.length, t = new Array(o), r = 0; r < o; r++)
|
|
103
|
-
t[r] = arguments[r];
|
|
104
|
-
return m()[e](...t);
|
|
105
21
|
};
|
|
106
|
-
|
|
107
|
-
n.ready(() => {
|
|
108
|
-
i.default.events.on(e, function() {
|
|
109
|
-
for (var o = arguments.length, t = new Array(o), r = 0; r < o; r++)
|
|
110
|
-
t[r] = arguments[r];
|
|
111
|
-
const s = "on" + e.charAt(0).toUpperCase() + e.substring(1), c = n;
|
|
112
|
-
if (c[s])
|
|
113
|
-
try {
|
|
114
|
-
c[s](...t);
|
|
115
|
-
} catch (a) {
|
|
116
|
-
console.error("Error when running the Router event: " + s), console.error((0, y.default)(a) ? a.message + `
|
|
117
|
-
` + a.stack : a + "");
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
const v = n;
|
|
123
|
-
function q() {
|
|
124
|
-
const e = R.default.useContext(b.RouterContext);
|
|
125
|
-
if (!e)
|
|
126
|
-
throw new Error("NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted");
|
|
127
|
-
return e;
|
|
128
|
-
}
|
|
129
|
-
function P() {
|
|
130
|
-
for (var e = arguments.length, o = new Array(e), t = 0; t < e; t++)
|
|
131
|
-
o[t] = arguments[t];
|
|
132
|
-
return n.router = new i.default(...o), n.readyCallbacks.forEach((r) => r()), n.readyCallbacks = [], n.router;
|
|
133
|
-
}
|
|
134
|
-
function E(e) {
|
|
135
|
-
const o = e, t = {};
|
|
136
|
-
for (const r of d) {
|
|
137
|
-
if (typeof o[r] == "object") {
|
|
138
|
-
t[r] = Object.assign(Array.isArray(o[r]) ? [] : {}, o[r]);
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
t[r] = o[r];
|
|
142
|
-
}
|
|
143
|
-
return t.events = i.default.events, h.forEach((r) => {
|
|
144
|
-
t[r] = function() {
|
|
145
|
-
for (var s = arguments.length, c = new Array(s), a = 0; a < s; a++)
|
|
146
|
-
c[a] = arguments[a];
|
|
147
|
-
return o[r](...c);
|
|
148
|
-
};
|
|
149
|
-
}), t;
|
|
150
|
-
}
|
|
151
|
-
(typeof u.default == "function" || typeof u.default == "object" && u.default !== null) && typeof u.default.__esModule > "u" && (Object.defineProperty(u.default, "__esModule", { value: !0 }), Object.assign(u.default, u), g.exports = u.default);
|
|
152
|
-
}(l, l.exports), l.exports);
|
|
22
|
+
};
|
|
153
23
|
}
|
|
154
24
|
export {
|
|
155
|
-
|
|
25
|
+
f as composeRefs
|
|
156
26
|
};
|