@instockng/storefront-ui 1.0.69 → 1.0.71

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.
Files changed (155) hide show
  1. package/dist/contexts/CartContext.d.ts.map +1 -1
  2. package/dist/index.mjs +65 -63
  3. package/dist/index100.mjs +2 -69
  4. package/dist/index140.mjs +1 -1
  5. package/dist/index142.mjs +2 -21
  6. package/dist/index143.mjs +19 -54
  7. package/dist/index144.mjs +55 -28
  8. package/dist/index145.mjs +28 -6
  9. package/dist/index146.mjs +6 -51
  10. package/dist/index147.mjs +51 -5
  11. package/dist/index148.mjs +6 -12
  12. package/dist/index149.mjs +12 -7
  13. package/dist/index15.mjs +1 -1
  14. package/dist/index150.mjs +6 -27
  15. package/dist/index151.mjs +28 -2
  16. package/dist/index152.mjs +2 -70
  17. package/dist/index153.mjs +67 -164
  18. package/dist/index154.mjs +167 -2
  19. package/dist/index158.mjs +1 -1
  20. package/dist/index159.mjs +1 -1
  21. package/dist/index160.mjs +1 -1
  22. package/dist/index161.mjs +1 -1
  23. package/dist/index162.mjs +1 -1
  24. package/dist/index164.mjs +1 -1
  25. package/dist/index165.mjs +1 -1
  26. package/dist/index167.mjs +2 -2
  27. package/dist/index168.mjs +1 -1
  28. package/dist/index173.mjs +2 -2
  29. package/dist/index175.mjs +1 -1
  30. package/dist/index177.mjs +2 -2
  31. package/dist/index178.mjs +5 -5
  32. package/dist/index181.mjs +1 -1
  33. package/dist/index184.mjs +1 -1
  34. package/dist/index187.mjs +1 -1
  35. package/dist/index188.mjs +1 -1
  36. package/dist/index192.mjs +1 -1
  37. package/dist/index194.mjs +1 -1
  38. package/dist/index198.mjs +1 -1
  39. package/dist/index2.mjs +1 -1
  40. package/dist/index200.mjs +1 -1
  41. package/dist/index209.mjs +2 -2
  42. package/dist/index211.mjs +1 -1
  43. package/dist/index212.mjs +1 -1
  44. package/dist/index213.mjs +2 -31
  45. package/dist/index214.mjs +2 -11
  46. package/dist/index215.mjs +2 -4
  47. package/dist/index216.mjs +2 -4
  48. package/dist/index217.mjs +2 -13
  49. package/dist/index218.mjs +2 -7
  50. package/dist/index219.mjs +2 -12
  51. package/dist/index22.mjs +10 -6
  52. package/dist/index220.mjs +2 -5
  53. package/dist/index221.mjs +37 -33
  54. package/dist/index222.mjs +2 -31
  55. package/dist/index223.mjs +2 -28
  56. package/dist/index224.mjs +2 -61
  57. package/dist/index225.mjs +2 -2
  58. package/dist/index226.mjs +2 -2
  59. package/dist/index227.mjs +244 -2
  60. package/dist/index228.mjs +2 -2
  61. package/dist/index229.mjs +33 -2
  62. package/dist/index23.mjs +13 -14
  63. package/dist/index230.mjs +65 -2
  64. package/dist/index231.mjs +25 -2
  65. package/dist/index232.mjs +2 -2
  66. package/dist/index233.mjs +2 -108
  67. package/dist/index234.mjs +2 -2
  68. package/dist/index235.mjs +108 -2
  69. package/dist/index236.mjs +2 -2
  70. package/dist/index237.mjs +2 -37
  71. package/dist/index238.mjs +2 -2
  72. package/dist/index239.mjs +4 -2
  73. package/dist/index240.mjs +31 -2
  74. package/dist/index241.mjs +10 -243
  75. package/dist/index242.mjs +4 -2
  76. package/dist/index243.mjs +3 -32
  77. package/dist/index244.mjs +13 -65
  78. package/dist/index245.mjs +7 -25
  79. package/dist/index246.mjs +2 -2
  80. package/dist/index247.mjs +2 -2
  81. package/dist/index248.mjs +12 -2
  82. package/dist/index249.mjs +5 -2
  83. package/dist/index250.mjs +33 -2
  84. package/dist/index251.mjs +31 -2
  85. package/dist/index252.mjs +28 -2
  86. package/dist/index253.mjs +61 -4
  87. package/dist/index254.mjs +2 -2
  88. package/dist/index256.mjs +2 -3
  89. package/dist/index257.mjs +18 -2
  90. package/dist/index258.mjs +47 -2
  91. package/dist/index259.mjs +2 -17
  92. package/dist/index260.mjs +2 -13
  93. package/dist/index261.mjs +2 -6
  94. package/dist/index262.mjs +2 -30
  95. package/dist/index263.mjs +91 -2
  96. package/dist/index264.mjs +2 -2
  97. package/dist/index265.mjs +2 -18
  98. package/dist/index266.mjs +3 -47
  99. package/dist/index267.mjs +2 -2
  100. package/dist/index268.mjs +2 -2
  101. package/dist/index269.mjs +17 -2
  102. package/dist/index27.mjs +17 -17
  103. package/dist/index270.mjs +13 -2
  104. package/dist/index271.mjs +6 -91
  105. package/dist/index272.mjs +30 -2
  106. package/dist/index28.mjs +58 -47
  107. package/dist/index29.mjs +11 -11
  108. package/dist/index3.mjs +141 -123
  109. package/dist/index30.mjs +4 -4
  110. package/dist/index31.mjs +5 -5
  111. package/dist/index33.mjs +21 -20
  112. package/dist/index35.mjs +35 -28
  113. package/dist/index36.mjs +8 -25
  114. package/dist/index38.mjs +26 -9
  115. package/dist/index39.mjs +9 -9
  116. package/dist/index4.mjs +58 -46
  117. package/dist/index40.mjs +1 -1
  118. package/dist/index42.mjs +1 -1
  119. package/dist/index45.mjs +3 -3
  120. package/dist/index46.mjs +1 -1
  121. package/dist/index49.mjs +1 -1
  122. package/dist/index54.mjs +17 -17
  123. package/dist/index69.mjs +153 -2
  124. package/dist/index7.mjs +1 -1
  125. package/dist/index70.mjs +2 -75
  126. package/dist/index71.mjs +23 -15
  127. package/dist/index72.mjs +68 -56
  128. package/dist/index73.mjs +15 -23
  129. package/dist/index74.mjs +58 -148
  130. package/dist/index81.mjs +1 -1
  131. package/dist/index83.mjs +235 -2
  132. package/dist/index84.mjs +4 -233
  133. package/dist/index85.mjs +133 -5
  134. package/dist/index86.mjs +63 -129
  135. package/dist/index87.mjs +86 -67
  136. package/dist/index88.mjs +27 -85
  137. package/dist/index89.mjs +8 -28
  138. package/dist/index90.mjs +74 -8
  139. package/dist/index91.mjs +3 -74
  140. package/dist/index92.mjs +2 -4
  141. package/dist/index93.mjs +83 -2
  142. package/dist/index94.mjs +52 -81
  143. package/dist/index95.mjs +5 -53
  144. package/dist/index96.mjs +4 -5
  145. package/dist/index97.mjs +178 -4
  146. package/dist/index98.mjs +48 -174
  147. package/dist/index99.mjs +67 -51
  148. package/dist/lib/utils.d.ts +5 -0
  149. package/dist/lib/utils.d.ts.map +1 -1
  150. package/dist/providers/MetaPixelProvider.d.ts +2 -1
  151. package/dist/providers/MetaPixelProvider.d.ts.map +1 -1
  152. package/package.json +2 -2
  153. package/src/contexts/CartContext.tsx +50 -22
  154. package/src/lib/utils.ts +11 -0
  155. package/src/providers/MetaPixelProvider.tsx +16 -3
package/dist/index3.mjs CHANGED
@@ -1,35 +1,35 @@
1
1
  'use client';
2
- import { jsxs as it, jsx as ut } from "react/jsx-runtime";
3
- import { createContext as mt, useState as _, useRef as g, useEffect as d, useCallback as n, useContext as dt } from "react";
2
+ import { jsxs as dt, jsx as ft } from "react/jsx-runtime";
3
+ import { createContext as lt, useState as x, useRef as P, useEffect as f, useCallback as a, useContext as Ct } from "react";
4
4
  import "./index23.mjs";
5
- import { queryKeys as ft } from "./index32.mjs";
6
- import { useGetCart as lt, useCreateCart as Ct, useAddCartItem as It, useUpdateCartItem as wt, useRemoveCartItem as pt, useApplyDiscount as kt, useRemoveDiscount as yt, useUpdateCart as ht, useCheckoutCart as vt } from "./index35.mjs";
7
- import { useQueryClient as Tt } from "@tanstack/react-query";
8
- import { ShoppingCart as At } from "./index13.mjs";
9
- import { useMetaPixel as Dt } from "./index4.mjs";
10
- import { useTikTokPixel as Mt } from "./index5.mjs";
11
- import { getFbCookies as Et, getTikTokCookies as St } from "./index22.mjs";
12
- const f = "oms_cart_id", j = mt(null);
13
- function Lt({ children: l, brandSlug: u, initialCartId: C, shoppingCartProps: q }) {
14
- const [t, m] = _(C || null), [I, T] = _(!1), [O, Q] = _(!1), x = g(!1), R = g(!1), A = g(!1), G = Tt(), { trackAddToCart: D, trackInitiateCheckout: P } = Dt(), { trackAddToCart: M, trackInitiateCheckout: b } = Mt();
15
- d(() => {
16
- Q(!0);
17
- }, []), d(() => {
18
- if (C || x.current) return;
19
- x.current = !0;
20
- const r = new URLSearchParams(window.location.search).get("cartId");
21
- if (r) {
22
- m(r), T(!0);
5
+ import { queryKeys as pt } from "./index32.mjs";
6
+ import { useGetCart as It, useCreateCart as kt, useAddCartItem as wt, useUpdateCartItem as ht, useRemoveCartItem as yt, useApplyDiscount as vt, useRemoveDiscount as Tt, useUpdateCart as gt, useCheckoutCart as At, useInitiateCheckout as Dt } from "./index35.mjs";
7
+ import { useQueryClient as Mt } from "@tanstack/react-query";
8
+ import { ShoppingCart as Et } from "./index13.mjs";
9
+ import { useMetaPixel as St } from "./index4.mjs";
10
+ import { useTikTokPixel as xt } from "./index5.mjs";
11
+ import { getFbCookies as j, getTikTokCookies as O, generateClientEventId as Pt } from "./index22.mjs";
12
+ const l = "oms_cart_id", Q = lt(null);
13
+ function Ot({ children: C, brandSlug: u, initialCartId: p, shoppingCartProps: $ }) {
14
+ const [t, m] = x(p || null), [I, y] = x(!1), [G, H] = x(!1), _ = P(!1), R = P(!1), v = P(!1), Y = Mt(), { trackAddToCart: T, trackInitiateCheckout: g } = St(), { trackAddToCart: A, trackInitiateCheckout: D } = xt();
15
+ f(() => {
16
+ H(!0);
17
+ }, []), f(() => {
18
+ if (p || _.current) return;
19
+ _.current = !0;
20
+ const o = new URLSearchParams(window.location.search).get("cartId");
21
+ if (o) {
22
+ m(o), y(!0);
23
23
  return;
24
24
  }
25
- const o = localStorage.getItem(f);
26
- o && m(o);
27
- }, [C]);
28
- const { data: i, isLoading: H, error: w, refetch: c } = lt(t || "", {
25
+ const c = localStorage.getItem(l);
26
+ c && m(c);
27
+ }, [p]);
28
+ const { data: n, isLoading: z, error: k, refetch: s } = It(t || "", {
29
29
  enabled: !!t,
30
30
  retry: !1
31
31
  // Don't retry on failure - cart might be invalid/expired
32
- }), E = Ct({
32
+ }), M = kt({
33
33
  onSuccess: (e) => {
34
34
  if ("error" in e) {
35
35
  console.error("Failed to create cart:", e.error);
@@ -42,149 +42,167 @@ function Lt({ children: l, brandSlug: u, initialCartId: C, shoppingCartProps: q
42
42
  },
43
43
  retry: 10
44
44
  });
45
- d(() => {
45
+ f(() => {
46
46
  if (R.current) return;
47
47
  R.current = !0;
48
48
  const e = setTimeout(() => {
49
- !(typeof window < "u" ? localStorage.getItem(f) : null) && !C && E.mutate(u);
49
+ !(typeof window < "u" ? localStorage.getItem(l) : null) && !p && M.mutate(u);
50
50
  }, 150);
51
51
  return () => clearTimeout(e);
52
- }, []), d(() => {
53
- w && t && !A.current && (A.current = !0, console.warn("Cart fetch failed, creating new cart:", w), m(null), typeof window < "u" && localStorage.removeItem(f), setTimeout(() => {
54
- E.mutate(u), A.current = !1;
52
+ }, []), f(() => {
53
+ k && t && !v.current && (v.current = !0, console.warn("Cart fetch failed, creating new cart:", k), m(null), typeof window < "u" && localStorage.removeItem(l), setTimeout(() => {
54
+ M.mutate(u), v.current = !1;
55
55
  }, 100));
56
- }, [w, t, u]);
57
- const Y = It(t || "", {
58
- onSuccess: () => c()
59
- }), z = wt(t || "", {
60
- onSuccess: () => c()
61
- }), B = pt(t || "", {
56
+ }, [k, t, u]);
57
+ const B = wt(t || "", {
58
+ onSuccess: () => s()
59
+ }), J = ht(t || "", {
60
+ onSuccess: () => s()
61
+ }), V = yt(t || "", {
62
62
  onSuccess: () => {
63
- c(), t && G.invalidateQueries({ queryKey: ft.public.carts.recommendations(t) });
63
+ s(), t && Y.invalidateQueries({ queryKey: pt.public.carts.recommendations(t) });
64
64
  }
65
- }), J = kt(t || "", {
66
- onSuccess: () => c()
67
- }), V = yt(t || "", {
68
- onSuccess: () => c()
69
- }), W = ht(t || "", {
70
- onSuccess: () => c(),
65
+ }), W = vt(t || "", {
66
+ onSuccess: () => s()
67
+ }), X = Tt(t || "", {
68
+ onSuccess: () => s()
69
+ }), Z = gt(t || "", {
70
+ onSuccess: () => s(),
71
71
  retry: 3
72
- }), X = vt(t || "", {
72
+ }), tt = At(t || "", {
73
73
  onSuccess: () => {
74
74
  }
75
- });
76
- d(() => {
77
- t && typeof window < "u" && localStorage.setItem(f, t);
75
+ }), b = Dt(t || "");
76
+ f(() => {
77
+ t && typeof window < "u" && localStorage.setItem(l, t);
78
78
  }, [t]);
79
- const Z = n(
80
- async (e, r, o, p, a) => {
81
- var L;
79
+ const et = a(
80
+ async (e, o, c, i, r) => {
81
+ var K;
82
82
  if (!t) throw new Error("No cart ID");
83
- const { fbc: k, fbp: y } = Et(), { ttp: s, ttclid: S } = St(), U = await Y.mutateAsync({
84
- sku: p,
85
- quantity: a,
86
- fbc: k,
87
- fbp: y,
88
- ttp: s,
89
- ttclid: S,
83
+ const { fbc: d, fbp: E } = j(), { ttp: S, ttclid: mt } = O(), N = await B.mutateAsync({
84
+ sku: i,
85
+ quantity: r,
86
+ fbc: d,
87
+ fbp: E,
88
+ ttp: S,
89
+ ttclid: mt,
90
90
  refreshRecommendations: !I
91
91
  });
92
- if ("error" in U) return;
93
- const h = (L = U.items) == null ? void 0 : L.filter(
94
- (v) => {
95
- var $;
96
- return (($ = v.variant) == null ? void 0 : $.sku) === p;
92
+ if ("error" in N) return;
93
+ const w = (K = N.items) == null ? void 0 : K.filter(
94
+ (h) => {
95
+ var L;
96
+ return ((L = h.variant) == null ? void 0 : L.sku) === i;
97
97
  }
98
- ), K = h == null ? void 0 : h[h.length - 1];
99
- if (K) {
100
- const v = `cart_${t}_item_${K.id}`;
101
- D(e, r, o, a, v), M(e, r, o, a, v);
98
+ ), U = w == null ? void 0 : w[w.length - 1];
99
+ if (U) {
100
+ const h = `cart_${t}_item_${U.id}`;
101
+ T(i, o, c, r, h), A(e, o, c, r, h);
102
102
  } else
103
- D(e, r, o, a), M(e, r, o, a);
103
+ T(i, o, c, r), A(e, o, c, r);
104
104
  },
105
105
  // eslint-disable-next-line react-hooks/exhaustive-deps
106
- [t, I, D, M]
107
- ), tt = n(
108
- async (e, r) => {
106
+ [t, I, T, A]
107
+ ), rt = a(
108
+ async (e, o) => {
109
109
  if (!t) throw new Error("No cart ID");
110
- await z.mutateAsync({ itemId: e, quantity: r });
110
+ await J.mutateAsync({ itemId: e, quantity: o });
111
111
  },
112
112
  // eslint-disable-next-line react-hooks/exhaustive-deps
113
113
  [t]
114
- ), et = n(
114
+ ), ot = a(
115
115
  async (e) => {
116
116
  if (!t) throw new Error("No cart ID");
117
- await B.mutateAsync(e);
117
+ await V.mutateAsync(e);
118
118
  },
119
119
  // eslint-disable-next-line react-hooks/exhaustive-deps
120
120
  [t]
121
- ), rt = n(
121
+ ), nt = a(
122
122
  async (e) => {
123
123
  if (!t) throw new Error("No cart ID");
124
- await J.mutateAsync({ code: e });
124
+ await W.mutateAsync({ code: e });
125
125
  },
126
126
  // eslint-disable-next-line react-hooks/exhaustive-deps
127
127
  [t]
128
- ), ot = n(async () => {
128
+ ), ct = a(async () => {
129
129
  if (!t) throw new Error("No cart ID");
130
- await V.mutateAsync();
131
- }, [t]), F = n(() => {
132
- m(null), typeof window < "u" && localStorage.removeItem(f);
133
- }, []), nt = n(() => {
134
- F(), E.mutate(u);
135
- }, [u]), at = n(() => {
136
- T(!0);
137
- }, []), N = n(() => {
138
- T(!1);
139
- }, []), ct = n(() => {
140
- var a, k, y;
141
- if (!i || !t) return;
142
- const e = Number(((a = i.pricing) == null ? void 0 : a.total) || 0), r = ((k = i.items) == null ? void 0 : k.reduce((s, S) => s + S.quantity, 0)) || 0, o = `cart_${t}_checkout`, p = ((y = i.items) == null ? void 0 : y.map((s) => ({
143
- content_id: s.variant.sku,
144
- quantity: s.quantity,
145
- price: Number(s.variant.price)
146
- }))) || [];
147
- P(e, r, o), b(e, r, o, p);
148
- }, [i, t, P, b]), st = {
149
- cart: i || null,
130
+ await X.mutateAsync();
131
+ }, [t]), F = a(() => {
132
+ m(null), typeof window < "u" && localStorage.removeItem(l);
133
+ }, []), at = a(() => {
134
+ F(), M.mutate(u);
135
+ }, [u]), st = a(() => {
136
+ y(!0);
137
+ }, []), q = a(() => {
138
+ y(!1);
139
+ }, []), it = a(async () => {
140
+ if (!(!n || !n.pricing))
141
+ try {
142
+ const e = Pt("cart", n.id, "checkout"), o = n.pricing.total, c = n.items.reduce((r, d) => r + d.quantity, 0), i = n.items.map((r) => ({
143
+ id: r.variant.sku,
144
+ quantity: r.quantity,
145
+ item_price: Number(r.variant.price)
146
+ }));
147
+ if (g && g(o, c, i, e), n.brand.metaPixelId || n.brand.tiktokPixelId) {
148
+ const { fbc: r, fbp: d } = j(), { ttp: E, ttclid: S } = O();
149
+ b.mutate({
150
+ email: n.customerEmail,
151
+ phone: n.customerPhone,
152
+ fbc: r,
153
+ fbp: d,
154
+ ttp: E,
155
+ ttclid: S
156
+ });
157
+ }
158
+ D && D(o, c, e, i.map((r) => ({
159
+ content_id: r.id,
160
+ quantity: r.quantity,
161
+ price: r.item_price
162
+ })));
163
+ } catch (e) {
164
+ console.error("Error tracking initiate checkout:", e);
165
+ }
166
+ }, [n, g, D, b]), ut = {
167
+ cart: n || null,
150
168
  cartId: t,
151
- isLoading: H,
152
- error: w,
153
- updateCartMutation: W,
154
- checkoutMutation: X,
155
- addItem: Z,
156
- updateItem: tt,
157
- removeItem: et,
158
- applyDiscount: rt,
159
- removeDiscount: ot,
160
- trackCheckoutInitiated: ct,
169
+ isLoading: z,
170
+ error: k,
171
+ updateCartMutation: Z,
172
+ checkoutMutation: tt,
173
+ addItem: et,
174
+ updateItem: rt,
175
+ removeItem: ot,
176
+ applyDiscount: nt,
177
+ removeDiscount: ct,
178
+ trackCheckoutInitiated: it,
161
179
  clearCart: F,
162
- clearAndCreateNewCart: nt,
163
- refetch: c,
180
+ clearAndCreateNewCart: at,
181
+ refetch: s,
164
182
  isOpen: I,
165
- open: at,
166
- close: N
183
+ open: st,
184
+ close: q
167
185
  };
168
- return /* @__PURE__ */ it(j.Provider, { value: st, children: [
169
- l,
170
- O && /* @__PURE__ */ ut(
171
- At,
186
+ return /* @__PURE__ */ dt(Q.Provider, { value: ut, children: [
187
+ C,
188
+ G && /* @__PURE__ */ ft(
189
+ Et,
172
190
  {
173
191
  isOpen: I,
174
- onClose: N,
175
- ...q
192
+ onClose: q,
193
+ ...$
176
194
  }
177
195
  )
178
196
  ] });
179
197
  }
180
- function $t() {
181
- const l = dt(j);
182
- if (!l)
198
+ function Qt() {
199
+ const C = Ct(Q);
200
+ if (!C)
183
201
  throw new Error("useCart must be used within CartProvider");
184
- return l;
202
+ return C;
185
203
  }
186
204
  export {
187
- j as CartContext,
188
- Lt as CartProvider,
189
- $t as useCart
205
+ Q as CartContext,
206
+ Ot as CartProvider,
207
+ Qt as useCart
190
208
  };
package/dist/index30.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { createRpcClients as o } from "./index26.mjs";
3
- import { API_BASE_URL as r } from "./index23.mjs";
4
- async function c(t) {
5
- const e = await o(r).deliveryZones.index.$get({
3
+ const n = "https://oms-api.instock.com.ng";
4
+ async function r(t) {
5
+ const e = await o(n).deliveryZones.index.$get({
6
6
  query: t ? { brandId: t } : {}
7
7
  });
8
8
  if (!e.ok)
@@ -10,5 +10,5 @@ async function c(t) {
10
10
  return e.json();
11
11
  }
12
12
  export {
13
- c as fetchDeliveryZones
13
+ r as fetchDeliveryZones
14
14
  };
package/dist/index31.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use client';
2
- import { createRpcClients as e } from "./index26.mjs";
3
- import { API_BASE_URL as n } from "./index23.mjs";
4
- async function c(r) {
5
- const t = await e(n).brands[":slug"].$get({
6
- param: { slug: r }
2
+ import { createRpcClients as s } from "./index26.mjs";
3
+ const o = "https://oms-api.instock.com.ng";
4
+ async function c(n) {
5
+ const t = await s(o).brands[":slug"].$get({
6
+ param: { slug: n }
7
7
  });
8
8
  if (!t.ok)
9
9
  throw new Error(`Failed to fetch brand: ${t.statusText}`);
package/dist/index33.mjs CHANGED
@@ -1,26 +1,27 @@
1
1
  'use client';
2
- import { useAddCartItem as r, useApplyDiscount as s, useCheckoutCart as o, useCreateCart as u, useGetCart as d, useGetCartRecommendations as m, useRemoveCartItem as a, useRemoveDiscount as C, useUpdateCart as n, useUpdateCartItem as p } from "./index35.mjs";
3
- import { useConfirmOrder as c, useGetOrder as f, useGetOrderRecommendations as i } from "./index36.mjs";
4
- import { useGetProduct as O, useGetProductAddOns as R, useGetProducts as v } from "./index37.mjs";
5
- import { useGetDeliveryZones as D } from "./index38.mjs";
6
- import { useGetBrand as P } from "./index39.mjs";
2
+ import { useAddCartItem as r, useApplyDiscount as s, useCheckoutCart as u, useCreateCart as o, useGetCart as a, useGetCartRecommendations as d, useInitiateCheckout as m, useRemoveCartItem as C, useRemoveDiscount as n, useUpdateCart as c, useUpdateCartItem as p } from "./index35.mjs";
3
+ import { useGetBrand as i } from "./index36.mjs";
4
+ import { useGetProduct as x, useGetProductAddOns as I, useGetProducts as O } from "./index37.mjs";
5
+ import { useConfirmOrder as v, useGetOrder as A, useGetOrderRecommendations as D } from "./index38.mjs";
6
+ import { useGetDeliveryZones as h } from "./index39.mjs";
7
7
  export {
8
8
  r as useAddCartItem,
9
9
  s as useApplyDiscount,
10
- o as useCheckoutCart,
11
- c as useConfirmOrder,
12
- u as useCreateCart,
13
- P as useGetBrand,
14
- d as useGetCart,
15
- m as useGetCartRecommendations,
16
- D as useGetDeliveryZones,
17
- f as useGetOrder,
18
- i as useGetOrderRecommendations,
19
- O as useGetProduct,
20
- R as useGetProductAddOns,
21
- v as useGetProducts,
22
- a as useRemoveCartItem,
23
- C as useRemoveDiscount,
24
- n as useUpdateCart,
10
+ u as useCheckoutCart,
11
+ v as useConfirmOrder,
12
+ o as useCreateCart,
13
+ i as useGetBrand,
14
+ a as useGetCart,
15
+ d as useGetCartRecommendations,
16
+ h as useGetDeliveryZones,
17
+ A as useGetOrder,
18
+ D as useGetOrderRecommendations,
19
+ x as useGetProduct,
20
+ I as useGetProductAddOns,
21
+ O as useGetProducts,
22
+ m as useInitiateCheckout,
23
+ C as useRemoveCartItem,
24
+ n as useRemoveDiscount,
25
+ c as useUpdateCart,
25
26
  p as useUpdateCartItem
26
27
  };
package/dist/index35.mjs CHANGED
@@ -1,17 +1,17 @@
1
1
  'use client';
2
- import { useQueryClient as s, useMutation as r } from "@tanstack/react-query";
2
+ import { useQueryClient as o, useMutation as r } from "@tanstack/react-query";
3
3
  import { useQueryUnwrapped as c } from "./index75.mjs";
4
4
  import { queryKeys as i } from "./index32.mjs";
5
- import { updateCart as a, createCart as l, applyDiscount as m, removeDiscount as y, addCartItem as p, updateCartItem as C, removeCartItem as q, checkoutCart as f, fetchCart as d, fetchCartRecommendations as b } from "./index28.mjs";
5
+ import { updateCart as a, createCart as l, applyDiscount as m, removeDiscount as y, addCartItem as p, updateCartItem as C, removeCartItem as q, checkoutCart as f, initiateCheckout as d, fetchCart as b, fetchCartRecommendations as v } from "./index28.mjs";
6
6
  function S(e, t) {
7
7
  return c({
8
8
  queryKey: i.public.carts.detail(e),
9
- queryFn: () => d(e),
9
+ queryFn: () => b(e),
10
10
  ...t
11
11
  });
12
12
  }
13
- function h(e, t) {
14
- const u = s();
13
+ function k(e, t) {
14
+ const u = o();
15
15
  return r({
16
16
  mutationFn: (n) => a(e, n),
17
17
  onSuccess: () => {
@@ -27,7 +27,7 @@ function R(e) {
27
27
  });
28
28
  }
29
29
  function D(e, t) {
30
- const u = s();
30
+ const u = o();
31
31
  return r({
32
32
  mutationFn: (n) => m(e, n.code),
33
33
  onSuccess: () => {
@@ -36,8 +36,8 @@ function D(e, t) {
36
36
  ...t
37
37
  });
38
38
  }
39
- function k(e, t) {
40
- const u = s();
39
+ function U(e, t) {
40
+ const u = o();
41
41
  return r({
42
42
  mutationFn: () => y(e),
43
43
  onSuccess: () => {
@@ -46,28 +46,28 @@ function k(e, t) {
46
46
  ...t
47
47
  });
48
48
  }
49
- function U(e, t) {
50
- const u = s();
49
+ function A(e, t) {
50
+ const u = o();
51
51
  return r({
52
52
  mutationFn: (n) => p(e, n.sku, n.quantity, n.fbc, n.fbp, n.ttp, n.ttclid),
53
- onSuccess: (n, o) => {
54
- u.invalidateQueries({ queryKey: i.public.carts.detail(e) }), o.refreshRecommendations && u.invalidateQueries({ queryKey: i.public.carts.recommendations(e) });
53
+ onSuccess: (n, s) => {
54
+ u.invalidateQueries({ queryKey: i.public.carts.detail(e) }), s.refreshRecommendations && u.invalidateQueries({ queryKey: i.public.carts.recommendations(e) });
55
55
  },
56
56
  ...t
57
57
  });
58
58
  }
59
- function A(e, t) {
60
- const u = s();
59
+ function G(e, t) {
60
+ const u = o();
61
61
  return r({
62
- mutationFn: ({ itemId: n, quantity: o }) => C(e, n, o),
62
+ mutationFn: ({ itemId: n, quantity: s }) => C(e, n, s),
63
63
  onSuccess: () => {
64
64
  u.invalidateQueries({ queryKey: i.public.carts.detail(e) });
65
65
  },
66
66
  ...t
67
67
  });
68
68
  }
69
- function G(e, t) {
70
- const u = s();
69
+ function w(e, t) {
70
+ const u = o();
71
71
  return r({
72
72
  mutationFn: (n) => q(e, n),
73
73
  onSuccess: () => {
@@ -76,8 +76,8 @@ function G(e, t) {
76
76
  ...t
77
77
  });
78
78
  }
79
- function w(e, t) {
80
- const u = s();
79
+ function x(e, t) {
80
+ const u = o();
81
81
  return r({
82
82
  mutationFn: (n) => f(e, n),
83
83
  onSuccess: () => {
@@ -86,23 +86,30 @@ function w(e, t) {
86
86
  ...t
87
87
  });
88
88
  }
89
- function x(e, t, u) {
89
+ function M(e, t) {
90
+ return r({
91
+ mutationFn: (u) => d(e, u),
92
+ ...t
93
+ });
94
+ }
95
+ function _(e, t, u) {
90
96
  return c({
91
97
  queryKey: e ? i.public.carts.recommendations(e, t) : ["public", "carts", "recommendations"],
92
- queryFn: () => b(e, t),
98
+ queryFn: () => v(e, t),
93
99
  enabled: !!e,
94
100
  ...u
95
101
  });
96
102
  }
97
103
  export {
98
- U as useAddCartItem,
104
+ A as useAddCartItem,
99
105
  D as useApplyDiscount,
100
- w as useCheckoutCart,
106
+ x as useCheckoutCart,
101
107
  R as useCreateCart,
102
108
  S as useGetCart,
103
- x as useGetCartRecommendations,
104
- G as useRemoveCartItem,
105
- k as useRemoveDiscount,
106
- h as useUpdateCart,
107
- A as useUpdateCartItem
109
+ _ as useGetCartRecommendations,
110
+ M as useInitiateCheckout,
111
+ w as useRemoveCartItem,
112
+ U as useRemoveDiscount,
113
+ k as useUpdateCart,
114
+ G as useUpdateCartItem
108
115
  };
package/dist/index36.mjs CHANGED
@@ -1,31 +1,14 @@
1
1
  'use client';
2
- import { useMutation as m } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as u } from "./index75.mjs";
4
- import { queryKeys as o } from "./index32.mjs";
5
- import { confirmOrder as i, fetchOrder as c, fetchOrderRecommendations as f } from "./index29.mjs";
6
- function a(e, r, n) {
7
- return u({
8
- queryKey: o.public.orders.detail(e, r),
9
- queryFn: () => c(e, r),
10
- ...n
11
- });
12
- }
13
- function O(e) {
14
- return m({
15
- mutationFn: (r) => i(r.orderId, r.token),
2
+ import { useQueryUnwrapped as t } from "./index75.mjs";
3
+ import { queryKeys as u } from "./index32.mjs";
4
+ import { fetchBrandBySlug as n } from "./index31.mjs";
5
+ function i(r, e) {
6
+ return t({
7
+ queryKey: u.public.brands.detail(r),
8
+ queryFn: () => n(r),
16
9
  ...e
17
10
  });
18
11
  }
19
- function q(e, r, n = 4, t) {
20
- return u({
21
- queryKey: o.public.orders.recommendations(e, r, n),
22
- queryFn: () => f(e, r, n),
23
- enabled: !!e && !!r,
24
- ...t
25
- });
26
- }
27
12
  export {
28
- O as useConfirmOrder,
29
- a as useGetOrder,
30
- q as useGetOrderRecommendations
13
+ i as useGetBrand
31
14
  };
package/dist/index38.mjs CHANGED
@@ -1,14 +1,31 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as o } from "./index75.mjs";
3
- import { queryKeys as i } from "./index32.mjs";
4
- import { fetchDeliveryZones as t } from "./index30.mjs";
5
- function p(e, r) {
6
- return o({
7
- queryKey: i.public.deliveryZones.list(e),
8
- queryFn: () => t(e),
9
- ...r
2
+ import { useMutation as m } from "@tanstack/react-query";
3
+ import { useQueryUnwrapped as u } from "./index75.mjs";
4
+ import { queryKeys as o } from "./index32.mjs";
5
+ import { confirmOrder as i, fetchOrder as c, fetchOrderRecommendations as f } from "./index29.mjs";
6
+ function a(e, r, n) {
7
+ return u({
8
+ queryKey: o.public.orders.detail(e, r),
9
+ queryFn: () => c(e, r),
10
+ ...n
11
+ });
12
+ }
13
+ function O(e) {
14
+ return m({
15
+ mutationFn: (r) => i(r.orderId, r.token),
16
+ ...e
17
+ });
18
+ }
19
+ function q(e, r, n = 4, t) {
20
+ return u({
21
+ queryKey: o.public.orders.recommendations(e, r, n),
22
+ queryFn: () => f(e, r, n),
23
+ enabled: !!e && !!r,
24
+ ...t
10
25
  });
11
26
  }
12
27
  export {
13
- p as useGetDeliveryZones
28
+ O as useConfirmOrder,
29
+ a as useGetOrder,
30
+ q as useGetOrderRecommendations
14
31
  };
package/dist/index39.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as t } from "./index75.mjs";
3
- import { queryKeys as u } from "./index32.mjs";
4
- import { fetchBrandBySlug as n } from "./index31.mjs";
5
- function i(r, e) {
6
- return t({
7
- queryKey: u.public.brands.detail(r),
8
- queryFn: () => n(r),
9
- ...e
2
+ import { useQueryUnwrapped as o } from "./index75.mjs";
3
+ import { queryKeys as i } from "./index32.mjs";
4
+ import { fetchDeliveryZones as t } from "./index30.mjs";
5
+ function p(e, r) {
6
+ return o({
7
+ queryKey: i.public.deliveryZones.list(e),
8
+ queryFn: () => t(e),
9
+ ...r
10
10
  });
11
11
  }
12
12
  export {
13
- i as useGetBrand
13
+ p as useGetDeliveryZones
14
14
  };