@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.
Files changed (145) hide show
  1. package/dist/contexts/CartContext.d.ts.map +1 -1
  2. package/dist/index100.mjs +8 -8
  3. package/dist/index101.mjs +6 -6
  4. package/dist/index102.mjs +3 -3
  5. package/dist/index103.mjs +1 -1
  6. package/dist/index104.mjs +1 -1
  7. package/dist/index105.mjs +1 -1
  8. package/dist/index106.mjs +2 -2
  9. package/dist/index107.mjs +2 -2
  10. package/dist/index108.mjs +3 -3
  11. package/dist/index109.mjs +1 -1
  12. package/dist/index110.mjs +3 -3
  13. package/dist/index111.mjs +2 -2
  14. package/dist/index112.mjs +2 -2
  15. package/dist/index113.mjs +1 -1
  16. package/dist/index114.mjs +3 -3
  17. package/dist/index115.mjs +1 -1
  18. package/dist/index116.mjs +1 -1
  19. package/dist/index117.mjs +3 -3
  20. package/dist/index118.mjs +2 -2
  21. package/dist/index119.mjs +4 -4
  22. package/dist/index120.mjs +1 -1
  23. package/dist/index121.mjs +3 -3
  24. package/dist/index122.mjs +4 -4
  25. package/dist/index123.mjs +1 -1
  26. package/dist/index124.mjs +1 -1
  27. package/dist/index125.mjs +1 -1
  28. package/dist/index126.mjs +1 -1
  29. package/dist/index127.mjs +1 -1
  30. package/dist/index128.mjs +1 -1
  31. package/dist/index129.mjs +1 -1
  32. package/dist/index130.mjs +2 -2
  33. package/dist/index131.mjs +3 -3
  34. package/dist/index134.mjs +1 -1
  35. package/dist/index148.mjs +2 -2
  36. package/dist/index150.mjs +2 -2
  37. package/dist/index151.mjs +2 -18
  38. package/dist/index152.mjs +11 -25
  39. package/dist/index153.mjs +26 -32
  40. package/dist/index154.mjs +32 -12
  41. package/dist/index155.mjs +9 -9
  42. package/dist/index156.mjs +18 -2
  43. package/dist/index157.mjs +2 -20
  44. package/dist/index158.mjs +13 -39
  45. package/dist/index159.mjs +46 -2
  46. package/dist/index160.mjs +2 -30
  47. package/dist/index161.mjs +24 -12
  48. package/dist/index162.mjs +18 -2
  49. package/dist/index163.mjs +2 -2
  50. package/dist/index164.mjs +2 -2
  51. package/dist/index165.mjs +2 -2
  52. package/dist/index166.mjs +2 -72
  53. package/dist/index167.mjs +72 -2
  54. package/dist/index168.mjs +2 -53
  55. package/dist/index169.mjs +53 -2
  56. package/dist/index170.mjs +2 -36
  57. package/dist/index171.mjs +30 -146
  58. package/dist/index172.mjs +152 -2
  59. package/dist/index173.mjs +2 -2
  60. package/dist/index174.mjs +2 -19
  61. package/dist/index175.mjs +19 -2
  62. package/dist/index176.mjs +2 -2
  63. package/dist/index177.mjs +2 -26
  64. package/dist/index178.mjs +26 -2
  65. package/dist/index179.mjs +2 -2
  66. package/dist/index180.mjs +2 -24
  67. package/dist/index181.mjs +17 -16
  68. package/dist/index182.mjs +23 -2
  69. package/dist/index184.mjs +2 -2
  70. package/dist/index185.mjs +2 -23
  71. package/dist/index186.mjs +23 -2
  72. package/dist/index187.mjs +2 -23
  73. package/dist/index188.mjs +23 -2
  74. package/dist/index189.mjs +2 -2
  75. package/dist/index191.mjs +2 -23
  76. package/dist/index192.mjs +23 -2
  77. package/dist/index193.mjs +2 -23
  78. package/dist/index194.mjs +23 -2
  79. package/dist/index195.mjs +2 -2
  80. package/dist/index196.mjs +2 -2
  81. package/dist/index198.mjs +2 -2
  82. package/dist/index199.mjs +2 -2
  83. package/dist/index200.mjs +2 -2
  84. package/dist/index201.mjs +2 -2
  85. package/dist/index202.mjs +2 -127
  86. package/dist/index203.mjs +127 -2
  87. package/dist/index204.mjs +2 -74
  88. package/dist/index205.mjs +60 -60
  89. package/dist/index206.mjs +74 -2
  90. package/dist/index222.mjs +2 -2
  91. package/dist/index223.mjs +108 -2
  92. package/dist/index224.mjs +2 -2
  93. package/dist/index225.mjs +2 -2
  94. package/dist/index226.mjs +2 -2
  95. package/dist/index227.mjs +2 -37
  96. package/dist/index228.mjs +2 -2
  97. package/dist/index229.mjs +2 -2
  98. package/dist/index230.mjs +36 -243
  99. package/dist/index231.mjs +2 -2
  100. package/dist/index232.mjs +2 -33
  101. package/dist/index233.mjs +240 -61
  102. package/dist/index234.mjs +2 -25
  103. package/dist/index235.mjs +33 -2
  104. package/dist/index236.mjs +56 -99
  105. package/dist/index237.mjs +25 -2
  106. package/dist/index239.mjs +2 -2
  107. package/dist/index240.mjs +2 -2
  108. package/dist/index241.mjs +2 -2
  109. package/dist/index247.mjs +1 -1
  110. package/dist/index257.mjs +2 -2
  111. package/dist/index258.mjs +2 -18
  112. package/dist/index259.mjs +13 -42
  113. package/dist/index260.mjs +47 -2
  114. package/dist/index261.mjs +2 -2
  115. package/dist/index262.mjs +2 -2
  116. package/dist/index263.mjs +2 -2
  117. package/dist/index264.mjs +2 -91
  118. package/dist/index265.mjs +91 -2
  119. package/dist/index3.mjs +75 -71
  120. package/dist/index38.mjs +2 -2
  121. package/dist/index40.mjs +2 -2
  122. package/dist/index44.mjs +1 -1
  123. package/dist/index5.mjs +36 -35
  124. package/dist/index50.mjs +2 -2
  125. package/dist/index63.mjs +21 -20
  126. package/dist/index64.mjs +2 -24
  127. package/dist/index65.mjs +19 -149
  128. package/dist/index66.mjs +153 -2
  129. package/dist/index69.mjs +1 -1
  130. package/dist/index87.mjs +34 -2
  131. package/dist/index88.mjs +42 -5
  132. package/dist/index89.mjs +2 -1134
  133. package/dist/index90.mjs +5 -19
  134. package/dist/index91.mjs +1119 -40
  135. package/dist/index92.mjs +14 -27
  136. package/dist/index93.mjs +55 -2
  137. package/dist/index94.mjs +33 -34
  138. package/dist/index95.mjs +2 -43
  139. package/dist/index98.mjs +1 -1
  140. package/dist/index99.mjs +1 -1
  141. package/dist/providers/TikTokPixelProvider.d.ts +5 -1
  142. package/dist/providers/TikTokPixelProvider.d.ts.map +1 -1
  143. package/package.json +1 -1
  144. package/src/contexts/CartContext.tsx +8 -1
  145. 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 D, useRef as M, useEffect as d, useCallback as n, useContext as it } from "react";
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 kt } from "./index33.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 pt } from "./index33.mjs";
6
6
  import "@tanstack/react-query";
7
- import { ShoppingCart as pt } from "./index11.mjs";
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 f = "oms_cart_id", $ = st(null);
12
- function Pt({ children: l, brandSlug: s, initialCartId: C, shoppingCartProps: j }) {
13
- const [t, i] = D(C || null), [E, S] = D(!1), [O, G] = D(!1), x = M(!1), _ = M(!1), p = M(!1), { trackAddToCart: h, trackInitiateCheckout: g } = ht(), { trackAddToCart: y, trackInitiateCheckout: P } = yt();
14
- d(() => {
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
- }, []), d(() => {
17
- if (C || x.current) return;
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
- i(r);
21
+ d(r);
22
22
  return;
23
23
  }
24
- const o = localStorage.getItem(f);
25
- o && i(o);
26
- }, [C]);
27
- const { data: u, isLoading: H, error: I, refetch: c } = ut(t || "", {
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
- }), v = mt({
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
- i(e.id);
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
- d(() => {
45
- if (_.current) return;
46
- _.current = !0;
44
+ f(() => {
45
+ if (g.current) return;
46
+ g.current = !0;
47
47
  const e = setTimeout(() => {
48
- !(typeof window < "u" ? localStorage.getItem(f) : null) && !C && v.mutate(s);
48
+ !(typeof window < "u" ? localStorage.getItem(l) : null) && !I && D.mutate(m);
49
49
  }, 150);
50
50
  return () => clearTimeout(e);
51
- }, []), d(() => {
52
- I && t && !p.current && (p.current = !0, console.warn("Cart fetch failed, creating new cart:", I), i(null), typeof window < "u" && localStorage.removeItem(f), setTimeout(() => {
53
- v.mutate(s), p.current = !1;
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
- }, [I, t, s]);
55
+ }, [w, t, m]);
56
56
  const K = dt(t || "", {
57
- onSuccess: () => c()
57
+ onSuccess: () => s()
58
58
  }), Y = ft(t || "", {
59
- onSuccess: () => c()
59
+ onSuccess: () => s()
60
60
  }), z = lt(t || "", {
61
- onSuccess: () => c()
61
+ onSuccess: () => s()
62
62
  }), B = Ct(t || "", {
63
- onSuccess: () => c()
63
+ onSuccess: () => s()
64
64
  }), J = It(t || "", {
65
- onSuccess: () => c()
65
+ onSuccess: () => s()
66
66
  }), Q = wt(t || "", {
67
- onSuccess: () => c(),
67
+ onSuccess: () => s(),
68
68
  retry: 3
69
- }), V = kt(t || "", {
69
+ }), V = pt(t || "", {
70
70
  onSuccess: () => {
71
71
  }
72
72
  });
73
- d(() => {
74
- t && typeof window < "u" && localStorage.setItem(f, t);
73
+ f(() => {
74
+ t && typeof window < "u" && localStorage.setItem(l, t);
75
75
  }, [t]);
76
76
  const W = n(
77
- async (e, r, o, m, a) => {
78
- var b;
77
+ async (e, r, o, p, a) => {
78
+ var U;
79
79
  if (!t) throw new Error("No cart ID");
80
- const { fbc: T, fbp: A } = vt(), N = await K.mutateAsync({ sku: m, quantity: a, fbc: T, fbp: A });
81
- if ("error" in N) return;
82
- const w = (b = N.items) == null ? void 0 : b.filter(
83
- (k) => {
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 = k.variant) == null ? void 0 : L.sku) === m;
85
+ return ((L = y.variant) == null ? void 0 : L.sku) === p;
86
86
  }
87
- ), U = w == null ? void 0 : w[w.length - 1];
88
- if (U) {
89
- const k = `cart_${t}_item_${U.id}`;
90
- h(e, r, o, a, k), y(e, r, o, a, k);
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
- h(e, r, o, a), y(e, r, o, a);
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, h, y]
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]), R = n(() => {
121
- i(null), typeof window < "u" && localStorage.removeItem(f);
120
+ }, [t]), F = n(() => {
121
+ d(null), typeof window < "u" && localStorage.removeItem(l);
122
122
  }, []), et = n(() => {
123
- R(), v.mutate(s);
124
- }, [s]), rt = n(() => {
125
- S(!0);
126
- }, []), F = n(() => {
127
- S(!1);
123
+ F(), D.mutate(m);
124
+ }, [m]), rt = n(() => {
125
+ _(!0);
126
+ }, []), N = n(() => {
127
+ _(!1);
128
128
  }, []), ot = n(() => {
129
- var m, a;
130
- if (!u || !t) return;
131
- const e = Number(((m = u.pricing) == null ? void 0 : m.total) || 0), r = ((a = u.items) == null ? void 0 : a.reduce((T, A) => T + A.quantity, 0)) || 0, o = `cart_${t}_checkout`;
132
- g(e, r, o), P(e, r, o);
133
- }, [u, t, g, P]), nt = {
134
- cart: u || null,
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: I,
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: R,
150
+ clearCart: F,
147
151
  clearAndCreateNewCart: et,
148
- refetch: c,
149
- isOpen: E,
152
+ refetch: s,
153
+ isOpen: S,
150
154
  open: rt,
151
- close: F
155
+ close: N
152
156
  };
153
157
  return /* @__PURE__ */ at($.Provider, { value: nt, children: [
154
- l,
158
+ C,
155
159
  O && /* @__PURE__ */ ct(
156
- pt,
160
+ kt,
157
161
  {
158
- isOpen: E,
159
- onClose: F,
162
+ isOpen: S,
163
+ onClose: N,
160
164
  ...j
161
165
  }
162
166
  )
163
167
  ] });
164
168
  }
165
169
  function Rt() {
166
- const l = it($);
167
- if (!l)
170
+ const C = it($);
171
+ if (!C)
168
172
  throw new Error("useCart must be used within CartProvider");
169
- return l;
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 "./index64.mjs";
3
- import { __module as q } from "./index66.mjs";
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 "./index64.mjs";
3
- import { __require as i } from "./index65.mjs";
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
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import * as l from "react";
3
- import { composeRefs as m } from "./index63.mjs";
3
+ import { composeRefs as m } from "./index65.mjs";
4
4
  import { jsx as u } from "react/jsx-runtime";
5
5
  // @__NO_SIDE_EFFECTS__
6
6
  function y(e) {
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 y } from "react";
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: n = !1
9
+ debug: r = !1
10
10
  }) {
11
11
  const [T, d] = w(!1);
12
- y(() => {
12
+ v(() => {
13
13
  if (typeof window > "u") return;
14
14
  if (!k) {
15
- n && console.log("TikTok Pixel ID not provided. Tracking disabled.");
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: n }), t.pageView(), c = t, d(!0), n && console.log("TikTok Pixel initialized:", k);
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, n]);
27
- const r = (e, t, i) => {
26
+ }, [k, r]);
27
+ const n = (i, t, o) => {
28
28
  if (!T || !c) {
29
- n && console.log("TikTok Pixel not initialized. Event not tracked:", e);
29
+ r && console.log("TikTok Pixel not initialized. Event not tracked:", i);
30
30
  return;
31
31
  }
32
32
  try {
33
- const o = i ? { ...t, event_id: i } : t;
34
- c.track(e, o), n && console.log("TikTok Pixel tracked event:", e, o);
35
- } catch (o) {
36
- console.error("Failed to track TikTok Pixel event:", o);
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: r,
39
+ track: n,
40
40
  trackPageView: () => {
41
41
  if (!(!T || !c))
42
42
  try {
43
- c.pageView(), n && console.log("TikTok Pixel tracked page view");
44
- } catch (e) {
45
- console.error("Failed to track TikTok Pixel page view:", e);
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: (e, t, i, o) => {
49
- r(
48
+ trackProductView: (i, t, o, e) => {
49
+ n(
50
50
  "ViewContent",
51
51
  {
52
52
  content_type: "product",
53
- content_id: e,
53
+ content_id: i,
54
54
  content_name: t,
55
- price: i,
55
+ price: o,
56
56
  currency: "NGN"
57
57
  },
58
- o
58
+ e
59
59
  );
60
60
  },
61
- trackAddToCart: (e, t, i, o, l) => {
62
- r(
61
+ trackAddToCart: (i, t, o, e, l) => {
62
+ n(
63
63
  "AddToCart",
64
64
  {
65
65
  content_type: "product",
66
- content_id: e,
66
+ content_id: i,
67
67
  content_name: t,
68
- price: i,
69
- quantity: o,
68
+ value: o * e,
69
+ quantity: e,
70
70
  currency: "NGN"
71
71
  },
72
72
  l
73
73
  );
74
74
  },
75
- trackInitiateCheckout: (e, t, i) => {
76
- r(
75
+ trackInitiateCheckout: (i, t, o, e) => {
76
+ n(
77
77
  "InitiateCheckout",
78
78
  {
79
79
  content_type: "product",
80
- value: e,
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
- i
85
+ o
85
86
  );
86
87
  },
87
- trackPurchase: (e, t, i, o, l) => {
88
- r(
88
+ trackPurchase: (i, t, o, e, l) => {
89
+ n(
89
90
  "CompletePayment",
90
91
  {
91
92
  content_type: "product",
92
- value: e,
93
+ value: i,
93
94
  currency: t,
94
- contents: o.map((s) => ({
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 "./index94.mjs";
6
- import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index95.mjs";
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
- import "react";
3
- function i(n, o) {
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 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;
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
- 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);
20
- }
21
- };
22
- };
22
+ }), t;
23
23
  }
24
24
  export {
25
- f as composeRefs
25
+ c as getAugmentedNamespace,
26
+ n as getDefaultExportFromCjs
26
27
  };
package/dist/index64.mjs CHANGED
@@ -1,27 +1,5 @@
1
1
  'use client';
2
- function n(e) {
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
- c as getAugmentedNamespace,
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 { __module as l } from "./index87.mjs";
3
- import "./index88.mjs";
4
- import j from "react";
5
- import { __require as A } from "./index89.mjs";
6
- import { __require as O } from "./index90.mjs";
7
- import { __require as x } from "./index91.mjs";
8
- import { __require as F } from "./index92.mjs";
9
- import { __exports as M } from "./index93.mjs";
10
- var p;
11
- function W() {
12
- return p ? l.exports : (p = 1, function(g, u) {
13
- Object.defineProperty(u, "__esModule", {
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
- function m() {
86
- if (!n.router) {
87
- const e = `No router instance found.
88
- You should only use "next/router" on the client side of your app.
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
- }), C.forEach((e) => {
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
- W as __require
25
+ f as composeRefs
156
26
  };