@instockng/storefront-ui 1.0.17 → 1.0.19
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/OrderConfirmation.d.ts +1 -1
- package/dist/components/OrderConfirmation.d.ts.map +1 -1
- package/dist/components/ShoppingCart.d.ts.map +1 -1
- package/dist/contexts/CartContext.d.ts +2 -2
- package/dist/contexts/CartContext.d.ts.map +1 -1
- package/dist/fetchers.d.ts +19 -0
- package/dist/fetchers.d.ts.map +1 -0
- package/dist/hooks/usePageTracking.d.ts +40 -0
- package/dist/hooks/usePageTracking.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +101 -92
- package/dist/index10.mjs +149 -624
- package/dist/index100.mjs +22 -33
- package/dist/index101.mjs +22 -30
- package/dist/index102.mjs +32 -27
- package/dist/index103.mjs +152 -57
- package/dist/index104.mjs +20 -3
- package/dist/index105.mjs +31 -2
- package/dist/index106.mjs +84 -2
- package/dist/index107.mjs +37 -16
- package/dist/index108.mjs +144 -12
- package/dist/index109.mjs +55 -6
- package/dist/index11.mjs +94 -56
- package/dist/index110.mjs +23 -30
- package/dist/index111.mjs +30 -0
- package/dist/index112.mjs +26 -0
- package/dist/index113.mjs +28 -0
- package/dist/index114.mjs +24 -0
- package/dist/index115.mjs +25 -0
- package/dist/index116.mjs +24 -0
- package/dist/index117.mjs +68 -0
- package/dist/index118.mjs +21 -0
- package/dist/index119.mjs +42 -0
- package/dist/index12.mjs +645 -62
- package/dist/index120.mjs +27 -0
- package/dist/index121.mjs +37 -0
- package/dist/index122.mjs +30 -0
- package/dist/index123.mjs +22 -0
- package/dist/index124.mjs +24 -0
- package/dist/index125.mjs +50 -0
- package/dist/index126.mjs +26 -0
- package/dist/index127.mjs +271 -0
- package/dist/index128.mjs +73 -0
- package/dist/index129.mjs +11 -0
- package/dist/index13.mjs +50 -14
- package/dist/index130.mjs +5 -0
- package/dist/index131.mjs +5 -0
- package/dist/index132.mjs +36 -0
- package/dist/index133.mjs +5 -0
- package/dist/index134.mjs +24 -0
- package/dist/index135.mjs +59 -0
- package/dist/index136.mjs +32 -0
- package/dist/index137.mjs +10 -0
- package/dist/index138.mjs +55 -0
- package/dist/index139.mjs +9 -0
- package/dist/index14.mjs +62 -115
- package/dist/index140.mjs +15 -0
- package/dist/index141.mjs +10 -0
- package/dist/index142.mjs +31 -0
- package/dist/index143.mjs +5 -0
- package/dist/index144.mjs +73 -0
- package/dist/index145.mjs +170 -0
- package/dist/index146.mjs +5 -0
- package/dist/index147.mjs +5 -0
- package/dist/index148.mjs +5 -0
- package/dist/index149.mjs +21 -0
- package/dist/index15.mjs +23 -41
- package/dist/index150.mjs +35 -0
- package/dist/index151.mjs +41 -0
- package/dist/index152.mjs +21 -0
- package/dist/index153.mjs +21 -0
- package/dist/index154.mjs +5 -0
- package/dist/index155.mjs +23 -0
- package/dist/index156.mjs +49 -0
- package/dist/index157.mjs +5 -0
- package/dist/index158.mjs +33 -0
- package/dist/index159.mjs +21 -0
- package/dist/index16.mjs +115 -42
- package/dist/index160.mjs +5 -0
- package/dist/index161.mjs +5 -0
- package/dist/index162.mjs +5 -0
- package/dist/index163.mjs +5 -0
- package/dist/index164.mjs +75 -0
- package/dist/index165.mjs +5 -0
- package/dist/index166.mjs +56 -0
- package/dist/index167.mjs +5 -0
- package/dist/index168.mjs +39 -0
- package/dist/index169.mjs +155 -0
- package/dist/index17.mjs +42 -42
- package/dist/index170.mjs +5 -0
- package/dist/index171.mjs +5 -0
- package/dist/index172.mjs +22 -0
- package/dist/index173.mjs +5 -0
- package/dist/index174.mjs +5 -0
- package/dist/index175.mjs +29 -0
- package/dist/index176.mjs +5 -0
- package/dist/index177.mjs +5 -0
- package/dist/index178.mjs +27 -0
- package/dist/index179.mjs +26 -0
- package/dist/index18.mjs +41 -31
- package/dist/index180.mjs +5 -0
- package/dist/index181.mjs +5 -0
- package/dist/index182.mjs +5 -0
- package/dist/index183.mjs +26 -0
- package/dist/index184.mjs +5 -0
- package/dist/index185.mjs +26 -0
- package/dist/index186.mjs +5 -0
- package/dist/index187.mjs +5 -0
- package/dist/index188.mjs +5 -0
- package/dist/index189.mjs +26 -0
- package/dist/index19.mjs +40 -7
- package/dist/index190.mjs +5 -0
- package/dist/index191.mjs +26 -0
- package/dist/index192.mjs +5 -0
- package/dist/index193.mjs +5 -0
- package/dist/index194.mjs +5 -0
- package/dist/index195.mjs +5 -0
- package/dist/index196.mjs +5 -0
- package/dist/index197.mjs +5 -0
- package/dist/index198.mjs +5 -0
- package/dist/index199.mjs +5 -0
- package/dist/index2.mjs +31 -12
- package/dist/index20.mjs +27 -17
- package/dist/index200.mjs +130 -0
- package/dist/index201.mjs +5 -0
- package/dist/index202.mjs +77 -0
- package/dist/index203.mjs +77 -0
- package/dist/index204.mjs +5 -0
- package/dist/index205.mjs +5 -0
- package/dist/index206.mjs +111 -0
- package/dist/index207.mjs +5 -0
- package/dist/index208.mjs +5 -0
- package/dist/index209.mjs +5 -0
- package/dist/index21.mjs +6 -29
- package/dist/index210.mjs +5 -0
- package/dist/index211.mjs +5 -0
- package/dist/index212.mjs +5 -0
- package/dist/index213.mjs +5 -0
- package/dist/index214.mjs +5 -0
- package/dist/index215.mjs +5 -0
- package/dist/index216.mjs +40 -0
- package/dist/index217.mjs +5 -0
- package/dist/index218.mjs +5 -0
- package/dist/index219.mjs +5 -0
- package/dist/index22.mjs +20 -18
- package/dist/index220.mjs +247 -0
- package/dist/index221.mjs +5 -0
- package/dist/index222.mjs +36 -0
- package/dist/index223.mjs +68 -0
- package/dist/index224.mjs +28 -0
- package/dist/index225.mjs +5 -0
- package/dist/index226.mjs +5 -0
- package/dist/index227.mjs +5 -0
- package/dist/index228.mjs +5 -0
- package/dist/index229.mjs +5 -0
- package/dist/index23.mjs +32 -87
- package/dist/index230.mjs +5 -0
- package/dist/index231.mjs +5 -0
- package/dist/index232.mjs +5 -0
- package/dist/index233.mjs +7 -0
- package/dist/index234.mjs +5 -0
- package/dist/index235.mjs +5 -0
- package/dist/index236.mjs +34 -0
- package/dist/index237.mjs +14 -0
- package/dist/index238.mjs +7 -0
- package/dist/index239.mjs +7 -0
- package/dist/index24.mjs +12 -12
- package/dist/index240.mjs +16 -0
- package/dist/index241.mjs +10 -0
- package/dist/index242.mjs +15 -0
- package/dist/index243.mjs +8 -0
- package/dist/index244.mjs +36 -0
- package/dist/index245.mjs +34 -0
- package/dist/index246.mjs +31 -0
- package/dist/index247.mjs +64 -0
- package/dist/index248.mjs +5 -0
- package/dist/index249.mjs +5 -0
- package/dist/index25.mjs +85 -8
- package/dist/index250.mjs +21 -0
- package/dist/index251.mjs +50 -0
- package/dist/index252.mjs +5 -0
- package/dist/index253.mjs +5 -0
- package/dist/index254.mjs +5 -0
- package/dist/index255.mjs +5 -0
- package/dist/index256.mjs +94 -0
- package/dist/index257.mjs +5 -0
- package/dist/index258.mjs +6 -0
- package/dist/index259.mjs +5 -0
- package/dist/index26.mjs +20 -97
- package/dist/index260.mjs +5 -0
- package/dist/index261.mjs +20 -0
- package/dist/index262.mjs +16 -0
- package/dist/index263.mjs +9 -0
- package/dist/index264.mjs +33 -0
- package/dist/index265.mjs +5 -0
- package/dist/index266.mjs +5 -0
- package/dist/index267.mjs +5 -0
- package/dist/index27.mjs +11 -18
- package/dist/index28.mjs +11 -65
- package/dist/index29.mjs +94 -89
- package/dist/index3.mjs +117 -97
- package/dist/index30.mjs +20 -19
- package/dist/index31.mjs +65 -19
- package/dist/index32.mjs +93 -8
- package/dist/index33.mjs +18 -1432
- package/dist/index34.mjs +19 -2
- package/dist/index35.mjs +10 -56
- package/dist/index36.mjs +9 -49
- package/dist/index37.mjs +103 -33
- package/dist/index38.mjs +24 -14
- package/dist/index39.mjs +1411 -2241
- package/dist/index4.mjs +82 -197
- package/dist/index40.mjs +2 -36
- package/dist/index41.mjs +56 -43
- package/dist/index42.mjs +50 -98
- package/dist/index43.mjs +33 -97
- package/dist/index44.mjs +13 -79
- package/dist/index45.mjs +2255 -69
- package/dist/index46.mjs +36 -95
- package/dist/index47.mjs +43 -80
- package/dist/index48.mjs +99 -79
- package/dist/index49.mjs +93 -15
- package/dist/index5.mjs +15 -108
- package/dist/index50.mjs +77 -14
- package/dist/index51.mjs +58 -44
- package/dist/index52.mjs +63 -93
- package/dist/index53.mjs +51 -99
- package/dist/index54.mjs +78 -4
- package/dist/index55.mjs +18 -22
- package/dist/index56.mjs +17 -74
- package/dist/index57.mjs +63 -15
- package/dist/index58.mjs +121 -59
- package/dist/index59.mjs +122 -228
- package/dist/index6.mjs +190 -73
- package/dist/index60.mjs +23 -5
- package/dist/index61.mjs +145 -126
- package/dist/index62.mjs +2 -68
- package/dist/index63.mjs +22 -86
- package/dist/index64.mjs +73 -27
- package/dist/index65.mjs +15 -9
- package/dist/index66.mjs +58 -70
- package/dist/index67.mjs +4 -3
- package/dist/index68.mjs +2 -2
- package/dist/index69.mjs +5 -82
- package/dist/index7.mjs +97 -85
- package/dist/index70.mjs +1133 -53
- package/dist/index71.mjs +19 -5
- package/dist/index72.mjs +54 -4
- package/dist/index73.mjs +28 -174
- package/dist/index74.mjs +2 -53
- package/dist/index75.mjs +2 -69
- package/dist/index76.mjs +231 -30
- package/dist/index77.mjs +5 -42
- package/dist/index78.mjs +133 -3
- package/dist/index79.mjs +68 -2
- package/dist/index8.mjs +78 -162
- package/dist/index80.mjs +85 -19
- package/dist/index81.mjs +26 -53
- package/dist/index82.mjs +8 -28
- package/dist/index83.mjs +74 -6
- package/dist/index84.mjs +3 -51
- package/dist/index85.mjs +2 -6
- package/dist/index86.mjs +81 -10
- package/dist/index87.mjs +53 -6
- package/dist/index88.mjs +5 -27
- package/dist/index89.mjs +5 -2
- package/dist/index9.mjs +90 -90
- package/dist/index90.mjs +175 -66
- package/dist/index91.mjs +49 -163
- package/dist/index92.mjs +68 -30
- package/dist/index93.mjs +34 -11
- package/dist/index94.mjs +42 -3
- package/dist/index95.mjs +2 -4
- package/dist/index96.mjs +28 -13
- package/dist/index97.mjs +18 -7
- package/dist/index98.mjs +214 -11
- package/dist/index99.mjs +179 -4
- package/dist/providers/MetaPixelProvider.d.ts +98 -0
- package/dist/providers/MetaPixelProvider.d.ts.map +1 -0
- package/dist/providers/StorefrontProvider.d.ts +1 -0
- package/dist/providers/StorefrontProvider.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +8 -3
- package/src/components/OrderConfirmation.tsx +0 -2
- package/src/components/ShoppingCart.tsx +12 -1
- package/src/contexts/CartContext.tsx +30 -5
- package/src/fetchers.ts +33 -0
- package/src/hooks/usePageTracking.ts +72 -0
- package/src/index.ts +5 -0
- package/src/providers/MetaPixelProvider.tsx +236 -0
- package/src/providers/StorefrontProvider.tsx +29 -3
package/dist/index58.mjs
CHANGED
|
@@ -1,66 +1,128 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
2
|
+
import { useQueryClient as l, useMutation as y } from "@tanstack/react-query";
|
|
3
|
+
import { useQueryUnwrapped as C } from "./index67.mjs";
|
|
4
|
+
import { createAdminRpcClients as c, authHeaders as a } from "./index23.mjs";
|
|
5
|
+
import { queryKeys as r } from "./index29.mjs";
|
|
6
|
+
import { useApiConfig as d } from "./index21.mjs";
|
|
7
|
+
function p(e, n) {
|
|
8
|
+
const { baseURL: s, authToken: i } = d();
|
|
9
|
+
return C({
|
|
10
|
+
queryKey: r.admin.discountCodes.list(e),
|
|
11
|
+
queryFn: async () => {
|
|
12
|
+
const t = await c(s).discountCodes.index.$get({ query: e }, a(i));
|
|
13
|
+
if (!t.ok)
|
|
14
|
+
throw new Error(`Failed to fetch discount codes: ${t.statusText}`);
|
|
15
|
+
return t.json();
|
|
16
|
+
},
|
|
17
|
+
...n
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function F(e, n) {
|
|
21
|
+
const { baseURL: s, authToken: i } = d();
|
|
22
|
+
return C({
|
|
23
|
+
queryKey: r.admin.discountCodes.detail(e),
|
|
24
|
+
queryFn: async () => {
|
|
25
|
+
const t = await c(s).discountCodes[":id"].$get({ param: { id: e } }, a(i));
|
|
26
|
+
if (!t.ok)
|
|
27
|
+
throw new Error(`Failed to fetch discount code: ${t.statusText}`);
|
|
28
|
+
return t.json();
|
|
29
|
+
},
|
|
30
|
+
...n
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function T(e) {
|
|
34
|
+
const { baseURL: n, authToken: s } = d(), i = l();
|
|
35
|
+
return y({
|
|
36
|
+
mutationFn: async (o) => {
|
|
37
|
+
const u = await c(n).discountCodes.index.$post({ json: o }, a(s));
|
|
38
|
+
if (!u.ok)
|
|
39
|
+
throw new Error(`Failed to create discount code: ${u.statusText}`);
|
|
40
|
+
return u.json();
|
|
41
|
+
},
|
|
42
|
+
onSuccess: () => {
|
|
43
|
+
i.invalidateQueries({ queryKey: r.admin.discountCodes.all });
|
|
44
|
+
},
|
|
45
|
+
...e
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function $(e, n) {
|
|
49
|
+
const { baseURL: s, authToken: i } = d(), o = l();
|
|
50
|
+
return y({
|
|
51
|
+
mutationFn: async (t) => {
|
|
52
|
+
const w = await c(s).discountCodes[":id"].$patch({ json: t, param: { id: e } }, a(i));
|
|
53
|
+
if (!w.ok)
|
|
54
|
+
throw new Error(`Failed to update discount code: ${w.statusText}`);
|
|
55
|
+
return w.json();
|
|
56
|
+
},
|
|
57
|
+
onSuccess: () => {
|
|
58
|
+
o.invalidateQueries({ queryKey: r.admin.discountCodes.detail(e) }), o.invalidateQueries({ queryKey: r.admin.discountCodes.all });
|
|
59
|
+
},
|
|
60
|
+
...n
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function v(e, n) {
|
|
64
|
+
const { baseURL: s, authToken: i } = d(), o = l();
|
|
65
|
+
return y({
|
|
66
|
+
mutationFn: async () => {
|
|
67
|
+
const u = await c(s).discountCodes[":id"].$delete({ param: { id: e } }, a(i));
|
|
68
|
+
if (!u.ok)
|
|
69
|
+
throw new Error(`Failed to delete discount code: ${u.statusText}`);
|
|
70
|
+
return u.json();
|
|
71
|
+
},
|
|
72
|
+
onSuccess: () => {
|
|
73
|
+
o.invalidateQueries({ queryKey: r.admin.discountCodes.all });
|
|
74
|
+
},
|
|
75
|
+
...n
|
|
76
|
+
});
|
|
42
77
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
r.
|
|
47
|
-
|
|
48
|
-
|
|
78
|
+
function j(e, n) {
|
|
79
|
+
const { baseURL: s, authToken: i } = d();
|
|
80
|
+
return C({
|
|
81
|
+
queryKey: r.admin.discountCodes.analytics(e),
|
|
82
|
+
queryFn: async () => {
|
|
83
|
+
const t = await c(s).discountCodes[":id"].analytics.$get({ param: { id: e } }, a(i));
|
|
84
|
+
if (!t.ok)
|
|
85
|
+
throw new Error(`Failed to fetch discount code analytics: ${t.statusText}`);
|
|
86
|
+
return t.json();
|
|
87
|
+
},
|
|
88
|
+
...n
|
|
89
|
+
});
|
|
49
90
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
91
|
+
function x(e) {
|
|
92
|
+
const { baseURL: n, authToken: s } = d(), i = l();
|
|
93
|
+
return y({
|
|
94
|
+
mutationFn: async (o) => {
|
|
95
|
+
const u = await c(n).discountCodes["bulk-generate"].$post({ json: o }, a(s));
|
|
96
|
+
if (!u.ok)
|
|
97
|
+
throw new Error(`Failed to bulk generate discount codes: ${u.statusText}`);
|
|
98
|
+
return u.json();
|
|
99
|
+
},
|
|
100
|
+
onSuccess: () => {
|
|
101
|
+
i.invalidateQueries({ queryKey: r.admin.discountCodes.all });
|
|
102
|
+
},
|
|
103
|
+
...e
|
|
104
|
+
});
|
|
56
105
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
106
|
+
function b(e) {
|
|
107
|
+
const { baseURL: n, authToken: s } = d();
|
|
108
|
+
return C({
|
|
109
|
+
queryKey: r.admin.discountCodes.overviewStats(),
|
|
110
|
+
queryFn: async () => {
|
|
111
|
+
const o = await c(n).discountCodes.stats.overview.$get({}, a(s));
|
|
112
|
+
if (!o.ok)
|
|
113
|
+
throw new Error(`Failed to fetch discount code overview stats: ${o.statusText}`);
|
|
114
|
+
return o.json();
|
|
115
|
+
},
|
|
116
|
+
...e
|
|
117
|
+
});
|
|
61
118
|
}
|
|
62
|
-
var k = v.exports;
|
|
63
|
-
const A = /* @__PURE__ */ d(k);
|
|
64
119
|
export {
|
|
65
|
-
|
|
120
|
+
x as useBulkGenerateDiscountCodes,
|
|
121
|
+
T as useCreateDiscountCode,
|
|
122
|
+
v as useDeleteDiscountCode,
|
|
123
|
+
F as useGetDiscountCode,
|
|
124
|
+
j as useGetDiscountCodeAnalytics,
|
|
125
|
+
b as useGetDiscountCodeOverviewStats,
|
|
126
|
+
p as useListDiscountCodes,
|
|
127
|
+
$ as useUpdateDiscountCode
|
|
66
128
|
};
|
package/dist/index59.mjs
CHANGED
|
@@ -1,238 +1,132 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
2
|
+
import { useQueryClient as y, useMutation as v } from "@tanstack/react-query";
|
|
3
|
+
import { useQueryUnwrapped as m } from "./index67.mjs";
|
|
4
|
+
import { createAdminRpcClients as u, authHeaders as l } from "./index23.mjs";
|
|
5
|
+
import { queryKeys as o } from "./index29.mjs";
|
|
6
|
+
import { useApiConfig as c } from "./index21.mjs";
|
|
7
|
+
function p(t) {
|
|
8
|
+
const { baseURL: s, authToken: i } = c();
|
|
9
|
+
return m({
|
|
10
|
+
queryKey: o.admin.deliveryZones.states.list(),
|
|
11
|
+
queryFn: async () => {
|
|
12
|
+
const e = await u(s).deliveryZones.states.$get({}, l(i));
|
|
13
|
+
if (!e.ok)
|
|
14
|
+
throw new Error(`Failed to fetch states: ${e.statusText}`);
|
|
15
|
+
return e.json();
|
|
16
|
+
},
|
|
17
|
+
...t
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function k(t) {
|
|
21
|
+
const { baseURL: s, authToken: i } = c(), r = y();
|
|
22
|
+
return v({
|
|
23
|
+
mutationFn: async (e) => {
|
|
24
|
+
const n = await u(s).deliveryZones.states.$post({ json: e }, l(i));
|
|
25
|
+
if (!n.ok)
|
|
26
|
+
throw new Error(`Failed to create state: ${n.statusText}`);
|
|
27
|
+
return n.json();
|
|
28
|
+
},
|
|
29
|
+
onSuccess: () => {
|
|
30
|
+
r.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
|
|
31
|
+
},
|
|
32
|
+
...t
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function F(t, s) {
|
|
36
|
+
const { baseURL: i, authToken: r } = c(), e = y();
|
|
37
|
+
return v({
|
|
38
|
+
mutationFn: async (a) => {
|
|
39
|
+
const d = await u(i).deliveryZones.states[":id"].$patch({ json: a, param: { id: t } }, l(r));
|
|
40
|
+
if (!d.ok)
|
|
41
|
+
throw new Error(`Failed to update state: ${d.statusText}`);
|
|
42
|
+
return d.json();
|
|
43
|
+
},
|
|
44
|
+
onSuccess: () => {
|
|
45
|
+
e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.detail(t) }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
|
|
46
|
+
},
|
|
47
|
+
...s
|
|
48
|
+
});
|
|
9
49
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
50
|
+
function T(t, s) {
|
|
51
|
+
const { baseURL: i, authToken: r } = c(), e = y();
|
|
52
|
+
return v({
|
|
53
|
+
mutationFn: async () => {
|
|
54
|
+
const n = await u(i).deliveryZones.states[":id"].$delete({ param: { id: t } }, l(r));
|
|
55
|
+
if (!n.ok)
|
|
56
|
+
throw new Error(`Failed to delete state: ${n.statusText}`);
|
|
57
|
+
return n.json();
|
|
58
|
+
},
|
|
59
|
+
onSuccess: () => {
|
|
60
|
+
e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
|
|
61
|
+
},
|
|
62
|
+
...s
|
|
63
|
+
});
|
|
14
64
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}, I = f("Date"), V = f("File"), _ = f("Blob"), q = f("FileList"), H = (e) => y(e) && c(e.pipe), z = (e) => {
|
|
29
|
-
let t;
|
|
30
|
-
return e && (typeof FormData == "function" && e instanceof FormData || c(e.append) && ((t = F(e)) === "formdata" || // detect form-data instance
|
|
31
|
-
t === "object" && c(e.toString) && e.toString() === "[object FormData]"));
|
|
32
|
-
}, J = f("URLSearchParams"), [K, $, W, G] = ["ReadableStream", "Request", "Response", "Headers"].map(f), Q = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
33
|
-
function m(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
34
|
-
if (e === null || typeof e > "u")
|
|
35
|
-
return;
|
|
36
|
-
let r, s;
|
|
37
|
-
if (typeof e != "object" && (e = [e]), p(e))
|
|
38
|
-
for (r = 0, s = e.length; r < s; r++)
|
|
39
|
-
t.call(null, e[r], r, e);
|
|
40
|
-
else {
|
|
41
|
-
if (d(e))
|
|
42
|
-
return;
|
|
43
|
-
const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
|
|
44
|
-
let l;
|
|
45
|
-
for (r = 0; r < i; r++)
|
|
46
|
-
l = o[r], t.call(null, e[l], l, e);
|
|
47
|
-
}
|
|
65
|
+
function $(t, s) {
|
|
66
|
+
const { baseURL: i, authToken: r } = c();
|
|
67
|
+
return m({
|
|
68
|
+
queryKey: o.admin.deliveryZones.zones.list(t),
|
|
69
|
+
queryFn: async () => {
|
|
70
|
+
const a = await u(i).deliveryZones.zones.$get({ query: t }, l(r));
|
|
71
|
+
if (!a.ok)
|
|
72
|
+
throw new Error(`Failed to fetch delivery zones: ${a.statusText}`);
|
|
73
|
+
return a.json();
|
|
74
|
+
},
|
|
75
|
+
...s
|
|
76
|
+
});
|
|
48
77
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
function z(t) {
|
|
79
|
+
const { baseURL: s, authToken: i } = c(), r = y();
|
|
80
|
+
return v({
|
|
81
|
+
mutationFn: async (e) => {
|
|
82
|
+
const n = await u(s).deliveryZones.zones.$post({ json: e }, l(i));
|
|
83
|
+
if (!n.ok)
|
|
84
|
+
throw new Error(`Failed to create delivery zone: ${n.statusText}`);
|
|
85
|
+
return n.json();
|
|
86
|
+
},
|
|
87
|
+
onSuccess: () => {
|
|
88
|
+
r.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all }), r.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
|
|
89
|
+
},
|
|
90
|
+
...t
|
|
91
|
+
});
|
|
59
92
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
93
|
+
function K(t, s) {
|
|
94
|
+
const { baseURL: i, authToken: r } = c(), e = y();
|
|
95
|
+
return v({
|
|
96
|
+
mutationFn: async (a) => {
|
|
97
|
+
const d = await u(i).deliveryZones.zones[":id"].$patch({ json: a, param: { id: t } }, l(r));
|
|
98
|
+
if (!d.ok)
|
|
99
|
+
throw new Error(`Failed to update delivery zone: ${d.statusText}`);
|
|
100
|
+
return d.json();
|
|
101
|
+
},
|
|
102
|
+
onSuccess: () => {
|
|
103
|
+
e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.detail(t) }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
|
|
104
|
+
},
|
|
105
|
+
...s
|
|
106
|
+
});
|
|
69
107
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
e = n !== !1 && A(e);
|
|
84
|
-
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
85
|
-
return t;
|
|
86
|
-
}, v = (e, t, n) => {
|
|
87
|
-
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
88
|
-
const r = e.indexOf(t, n);
|
|
89
|
-
return r !== -1 && r === n;
|
|
90
|
-
}, ee = (e) => {
|
|
91
|
-
if (!e) return null;
|
|
92
|
-
if (p(e)) return e;
|
|
93
|
-
let t = e.length;
|
|
94
|
-
if (!E(t)) return null;
|
|
95
|
-
const n = new Array(t);
|
|
96
|
-
for (; t-- > 0; )
|
|
97
|
-
n[t] = e[t];
|
|
98
|
-
return n;
|
|
99
|
-
}, te = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && A(Uint8Array)), ne = (e, t) => {
|
|
100
|
-
const r = (e && e[g]).call(e);
|
|
101
|
-
let s;
|
|
102
|
-
for (; (s = r.next()) && !s.done; ) {
|
|
103
|
-
const o = s.value;
|
|
104
|
-
t.call(e, o[0], o[1]);
|
|
105
|
-
}
|
|
106
|
-
}, re = (e, t) => {
|
|
107
|
-
let n;
|
|
108
|
-
const r = [];
|
|
109
|
-
for (; (n = e.exec(t)) !== null; )
|
|
110
|
-
r.push(n);
|
|
111
|
-
return r;
|
|
112
|
-
}, se = f("HTMLFormElement"), oe = (e) => e.toLowerCase().replace(
|
|
113
|
-
/[-_\s]([a-z\d])(\w*)/g,
|
|
114
|
-
function(n, r, s) {
|
|
115
|
-
return r.toUpperCase() + s;
|
|
116
|
-
}
|
|
117
|
-
), x = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), ie = f("RegExp"), C = (e, t) => {
|
|
118
|
-
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
119
|
-
m(n, (s, o) => {
|
|
120
|
-
let i;
|
|
121
|
-
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
|
|
122
|
-
}), Object.defineProperties(e, r);
|
|
123
|
-
}, ce = (e) => {
|
|
124
|
-
C(e, (t, n) => {
|
|
125
|
-
if (c(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
126
|
-
return !1;
|
|
127
|
-
const r = e[n];
|
|
128
|
-
if (c(r)) {
|
|
129
|
-
if (t.enumerable = !1, "writable" in t) {
|
|
130
|
-
t.writable = !1;
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
t.set || (t.set = () => {
|
|
134
|
-
throw Error("Can not rewrite read-only method '" + n + "'");
|
|
135
|
-
});
|
|
136
|
-
}
|
|
108
|
+
function j(t, s) {
|
|
109
|
+
const { baseURL: i, authToken: r } = c(), e = y();
|
|
110
|
+
return v({
|
|
111
|
+
mutationFn: async () => {
|
|
112
|
+
const n = await u(i).deliveryZones.zones[":id"].$delete({ param: { id: t } }, l(r));
|
|
113
|
+
if (!n.ok)
|
|
114
|
+
throw new Error(`Failed to delete delivery zone: ${n.statusText}`);
|
|
115
|
+
return n.json();
|
|
116
|
+
},
|
|
117
|
+
onSuccess: () => {
|
|
118
|
+
e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
|
|
119
|
+
},
|
|
120
|
+
...s
|
|
137
121
|
});
|
|
138
|
-
}, fe = (e, t) => {
|
|
139
|
-
const n = {}, r = (s) => {
|
|
140
|
-
s.forEach((o) => {
|
|
141
|
-
n[o] = !0;
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
return p(e) ? r(e) : r(String(e).split(t)), n;
|
|
145
|
-
}, le = () => {
|
|
146
|
-
}, ue = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
147
|
-
function ae(e) {
|
|
148
|
-
return !!(e && c(e.append) && e[S] === "FormData" && e[g]);
|
|
149
122
|
}
|
|
150
|
-
const pe = (e) => {
|
|
151
|
-
const t = new Array(10), n = (r, s) => {
|
|
152
|
-
if (y(r)) {
|
|
153
|
-
if (t.indexOf(r) >= 0)
|
|
154
|
-
return;
|
|
155
|
-
if (d(r))
|
|
156
|
-
return r;
|
|
157
|
-
if (!("toJSON" in r)) {
|
|
158
|
-
t[s] = r;
|
|
159
|
-
const o = p(r) ? [] : {};
|
|
160
|
-
return m(r, (i, l) => {
|
|
161
|
-
const b = n(i, s + 1);
|
|
162
|
-
!a(b) && (o[l] = b);
|
|
163
|
-
}), t[s] = void 0, o;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return r;
|
|
167
|
-
};
|
|
168
|
-
return n(e, 0);
|
|
169
|
-
}, de = f("AsyncFunction"), ye = (e) => e && (y(e) || c(e)) && c(e.then) && c(e.catch), D = ((e, t) => e ? setImmediate : t ? ((n, r) => (u.addEventListener("message", ({ source: s, data: o }) => {
|
|
170
|
-
s === u && o === n && r.length && r.shift()();
|
|
171
|
-
}, !1), (s) => {
|
|
172
|
-
r.push(s), u.postMessage(n, "*");
|
|
173
|
-
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
174
|
-
typeof setImmediate == "function",
|
|
175
|
-
c(u.postMessage)
|
|
176
|
-
), me = typeof queueMicrotask < "u" ? queueMicrotask.bind(u) : typeof process < "u" && process.nextTick || D, we = (e) => e != null && c(e[g]), Fe = {
|
|
177
|
-
isArray: p,
|
|
178
|
-
isArrayBuffer: B,
|
|
179
|
-
isBuffer: d,
|
|
180
|
-
isFormData: z,
|
|
181
|
-
isArrayBufferView: M,
|
|
182
|
-
isString: k,
|
|
183
|
-
isNumber: E,
|
|
184
|
-
isBoolean: N,
|
|
185
|
-
isObject: y,
|
|
186
|
-
isPlainObject: w,
|
|
187
|
-
isEmptyObject: U,
|
|
188
|
-
isReadableStream: K,
|
|
189
|
-
isRequest: $,
|
|
190
|
-
isResponse: W,
|
|
191
|
-
isHeaders: G,
|
|
192
|
-
isUndefined: a,
|
|
193
|
-
isDate: I,
|
|
194
|
-
isFile: V,
|
|
195
|
-
isBlob: _,
|
|
196
|
-
isRegExp: ie,
|
|
197
|
-
isFunction: c,
|
|
198
|
-
isStream: H,
|
|
199
|
-
isURLSearchParams: J,
|
|
200
|
-
isTypedArray: te,
|
|
201
|
-
isFileList: q,
|
|
202
|
-
forEach: m,
|
|
203
|
-
merge: h,
|
|
204
|
-
extend: X,
|
|
205
|
-
trim: Q,
|
|
206
|
-
stripBOM: Y,
|
|
207
|
-
inherits: Z,
|
|
208
|
-
toFlatObject: j,
|
|
209
|
-
kindOf: F,
|
|
210
|
-
kindOfTest: f,
|
|
211
|
-
endsWith: v,
|
|
212
|
-
toArray: ee,
|
|
213
|
-
forEachEntry: ne,
|
|
214
|
-
matchAll: re,
|
|
215
|
-
isHTMLForm: se,
|
|
216
|
-
hasOwnProperty: x,
|
|
217
|
-
hasOwnProp: x,
|
|
218
|
-
// an alias to avoid ESLint no-prototype-builtins detection
|
|
219
|
-
reduceDescriptors: C,
|
|
220
|
-
freezeMethods: ce,
|
|
221
|
-
toObjectSet: fe,
|
|
222
|
-
toCamelCase: oe,
|
|
223
|
-
noop: le,
|
|
224
|
-
toFiniteNumber: ue,
|
|
225
|
-
findKey: P,
|
|
226
|
-
global: u,
|
|
227
|
-
isContextDefined: L,
|
|
228
|
-
isSpecCompliantForm: ae,
|
|
229
|
-
toJSONObject: pe,
|
|
230
|
-
isAsyncFn: de,
|
|
231
|
-
isThenable: ye,
|
|
232
|
-
setImmediate: D,
|
|
233
|
-
asap: me,
|
|
234
|
-
isIterable: we
|
|
235
|
-
};
|
|
236
123
|
export {
|
|
237
|
-
|
|
124
|
+
z as useCreateDeliveryZone,
|
|
125
|
+
k as useCreateState,
|
|
126
|
+
j as useDeleteDeliveryZone,
|
|
127
|
+
T as useDeleteState,
|
|
128
|
+
$ as useListDeliveryZones,
|
|
129
|
+
p as useListStates,
|
|
130
|
+
K as useUpdateDeliveryZone,
|
|
131
|
+
F as useUpdateState
|
|
238
132
|
};
|