@shophost/react 2.0.9 → 2.0.11
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/admin-client.cjs +1 -1
- package/admin-client.js +910 -910
- package/package.json +3 -3
- package/storefront/providers/api-provider.d.ts +1 -0
package/admin-client.js
CHANGED
|
@@ -21,7 +21,7 @@ import se, { Toaster as Un } from "react-hot-toast";
|
|
|
21
21
|
import { inferAdditionalFields as ms, organizationClient as gs } from "better-auth/client/plugins";
|
|
22
22
|
import { createAuthClient as hs } from "better-auth/react";
|
|
23
23
|
import { initClient as Wn } from "@shophost/client";
|
|
24
|
-
import { z as
|
|
24
|
+
import { z as m } from "@hono/zod-openapi";
|
|
25
25
|
import { Slot as Ea } from "@radix-ui/react-slot";
|
|
26
26
|
import { tv as Re } from "tailwind-variants";
|
|
27
27
|
import fs from "clsx";
|
|
@@ -62,14 +62,14 @@ const Ar = "shophost-cart", mo = {
|
|
|
62
62
|
return s.modifierGroups && s.modifierGroups.length > 0 && s.modifierGroups.forEach((c) => {
|
|
63
63
|
var p;
|
|
64
64
|
const u = (p = n.modifierGroups) == null ? void 0 : p.find(
|
|
65
|
-
(
|
|
65
|
+
(g) => g.id === c.id
|
|
66
66
|
);
|
|
67
|
-
u && c.modifiers.forEach((
|
|
67
|
+
u && c.modifiers.forEach((g) => {
|
|
68
68
|
const h = u.modifiers.find(
|
|
69
|
-
(f) => f.id ===
|
|
69
|
+
(f) => f.id === g.id
|
|
70
70
|
);
|
|
71
71
|
if (h) {
|
|
72
|
-
const f =
|
|
72
|
+
const f = g.quantity || 1;
|
|
73
73
|
d += Number(h.price ?? 0) * f * o;
|
|
74
74
|
}
|
|
75
75
|
});
|
|
@@ -80,18 +80,18 @@ const Ar = "shophost-cart", mo = {
|
|
|
80
80
|
}).format(t), su = (t, a, r = "en-US") => {
|
|
81
81
|
const s = a(t.productId);
|
|
82
82
|
return !s || !t.modifierGroups || t.modifierGroups.length === 0 ? "" : t.modifierGroups.filter((n) => n && n.modifiers).map((n) => {
|
|
83
|
-
var c, u, p,
|
|
83
|
+
var c, u, p, g;
|
|
84
84
|
const o = (c = s.modifierGroups) == null ? void 0 : c.find(
|
|
85
85
|
(h) => h && h.id === n.id
|
|
86
86
|
);
|
|
87
87
|
if (!o || !o.modifiers) return "";
|
|
88
|
-
const l = ((p = (u = o.translations) == null ? void 0 : u.find((h) => h && h.locale === r)) == null ? void 0 : p.title) || (o.translations && o.translations.length > 0 ? (
|
|
88
|
+
const l = ((p = (u = o.translations) == null ? void 0 : u.find((h) => h && h.locale === r)) == null ? void 0 : p.title) || (o.translations && o.translations.length > 0 ? (g = o.translations[0]) == null ? void 0 : g.title : "") || "", d = (n.modifiers || []).filter((h) => h).map((h) => {
|
|
89
89
|
const f = o.modifiers.find(
|
|
90
|
-
(
|
|
90
|
+
(w) => w && w.id === h.id
|
|
91
91
|
);
|
|
92
92
|
if (!f) return "";
|
|
93
|
-
const
|
|
94
|
-
return x > 1 ? `${
|
|
93
|
+
const y = f.title || "", x = h.quantity || 1;
|
|
94
|
+
return x > 1 ? `${y} (${x})` : y;
|
|
95
95
|
}).filter(Boolean).join(", ");
|
|
96
96
|
return l ? `${l}: ${d}` : d;
|
|
97
97
|
}).filter(Boolean).join(" | ");
|
|
@@ -138,10 +138,10 @@ const Ar = "shophost-cart", mo = {
|
|
|
138
138
|
return r.productId !== a.productId ? !1 : !((s = r.modifierGroups) != null && s.length) && !((n = a.modifierGroups) != null && n.length) ? !0 : (((o = r.modifierGroups) == null ? void 0 : o.length) || 0) !== (((l = a.modifierGroups) == null ? void 0 : l.length) || 0) ? !1 : ((d = r.modifierGroups) == null ? void 0 : d.every((c) => {
|
|
139
139
|
var p;
|
|
140
140
|
const u = (p = a.modifierGroups) == null ? void 0 : p.find(
|
|
141
|
-
(
|
|
141
|
+
(g) => g.id === c.id
|
|
142
142
|
);
|
|
143
|
-
return u ? c.modifiers.every((
|
|
144
|
-
(h) => h.id ===
|
|
143
|
+
return u ? c.modifiers.every((g) => u.modifiers.some(
|
|
144
|
+
(h) => h.id === g.id && h.quantity === g.quantity
|
|
145
145
|
)) : !1;
|
|
146
146
|
})) || !1;
|
|
147
147
|
}), fo = (t, a) => !t.modifierGroups || t.modifierGroups.length === 0 ? !0 : !a.modifierGroups || a.modifierGroups.length === 0 ? !1 : t.modifierGroups.every((r) => {
|
|
@@ -284,13 +284,13 @@ function Ss(t, a, r, s) {
|
|
|
284
284
|
const n = Number(a.discountedBasePrice ?? a.basePrice ?? 0), o = Pe((t.quantity || 1) * n, r, s), l = t.modifierGroups ? t.modifierGroups.map(
|
|
285
285
|
(c) => {
|
|
286
286
|
const u = a.modifierGroups.find(
|
|
287
|
-
(
|
|
287
|
+
(g) => g.id === c.id
|
|
288
288
|
);
|
|
289
289
|
if (!u) return null;
|
|
290
|
-
const p = c.modifiers.map((
|
|
290
|
+
const p = c.modifiers.map((g) => {
|
|
291
291
|
var f;
|
|
292
292
|
const h = (f = u.modifiers) == null ? void 0 : f.find(
|
|
293
|
-
(
|
|
293
|
+
(y) => y.id === g.id
|
|
294
294
|
);
|
|
295
295
|
return h ? h.title : "";
|
|
296
296
|
}).filter(Boolean).join(", ");
|
|
@@ -316,8 +316,8 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
316
316
|
}),
|
|
317
317
|
[t]
|
|
318
318
|
);
|
|
319
|
-
return /* @__PURE__ */ e(ks.Provider, { value: { client: r }, children: a });
|
|
320
|
-
},
|
|
319
|
+
return /* @__PURE__ */ e(ks.Provider, { value: { client: r, baseUrl: t }, children: a });
|
|
320
|
+
}, E = () => {
|
|
321
321
|
const t = le(ks);
|
|
322
322
|
if (!t)
|
|
323
323
|
throw new Error("useAPI must be used within a APIProvider");
|
|
@@ -328,7 +328,7 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
328
328
|
children: t,
|
|
329
329
|
organizationId: a
|
|
330
330
|
}) => {
|
|
331
|
-
const { client: r } =
|
|
331
|
+
const { client: r } = E(), s = q({
|
|
332
332
|
queryKey: ["organization", a],
|
|
333
333
|
queryFn: async () => {
|
|
334
334
|
const n = await r.organization.getOrganization({
|
|
@@ -367,17 +367,17 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
367
367
|
locale: a = "en",
|
|
368
368
|
organizationId: r
|
|
369
369
|
}) => {
|
|
370
|
-
const { organization: s } = qe(), n = s == null ? void 0 : s.configuration.defaultCurrency, { client: o } =
|
|
370
|
+
const { organization: s } = qe(), n = s == null ? void 0 : s.configuration.defaultCurrency, { client: o } = E(), [l, d] = I(null), [c, u] = I(
|
|
371
371
|
null
|
|
372
372
|
), [
|
|
373
373
|
{
|
|
374
374
|
items: p,
|
|
375
|
-
isInitialized:
|
|
375
|
+
isInitialized: g,
|
|
376
376
|
isModifiersModalOpen: h,
|
|
377
377
|
selectedProduct: f,
|
|
378
|
-
onModalAddToCart:
|
|
378
|
+
onModalAddToCart: y,
|
|
379
379
|
totalAmount: x,
|
|
380
|
-
itemCount:
|
|
380
|
+
itemCount: w,
|
|
381
381
|
removedItemsAlert: S
|
|
382
382
|
},
|
|
383
383
|
k
|
|
@@ -389,7 +389,7 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
389
389
|
isLoading: C,
|
|
390
390
|
isRefetching: $
|
|
391
391
|
} = q({
|
|
392
|
-
queryKey: ["cartProducts", A,
|
|
392
|
+
queryKey: ["cartProducts", A, w, c == null ? void 0 : c.id],
|
|
393
393
|
queryFn: async () => {
|
|
394
394
|
if (A.length === 0)
|
|
395
395
|
return {
|
|
@@ -429,10 +429,10 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
429
429
|
));
|
|
430
430
|
}, [v, $, p.length]), K(() => {
|
|
431
431
|
(() => {
|
|
432
|
-
const
|
|
433
|
-
if (
|
|
432
|
+
const D = localStorage.getItem(Ar);
|
|
433
|
+
if (D)
|
|
434
434
|
try {
|
|
435
|
-
const B = JSON.parse(
|
|
435
|
+
const B = JSON.parse(D);
|
|
436
436
|
k({ type: "INITIALIZE_CART", payload: B });
|
|
437
437
|
} catch (B) {
|
|
438
438
|
console.error("Failed to parse cart from localStorage:", B);
|
|
@@ -440,8 +440,8 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
440
440
|
k({ type: "SET_INITIALIZED", payload: !0 });
|
|
441
441
|
})();
|
|
442
442
|
}, []), K(() => {
|
|
443
|
-
|
|
444
|
-
}, [p,
|
|
443
|
+
g && localStorage.setItem(Ar, JSON.stringify(p));
|
|
444
|
+
}, [p, g]), K(() => {
|
|
445
445
|
p.length > 0 && v && k({
|
|
446
446
|
type: "UPDATE_TOTALS",
|
|
447
447
|
payload: { productsData: v.products }
|
|
@@ -450,18 +450,18 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
450
450
|
const ie = j((M) => {
|
|
451
451
|
k({ type: "ADD_ITEM", payload: M });
|
|
452
452
|
}, []), ae = j(
|
|
453
|
-
(M,
|
|
453
|
+
(M, D, B) => {
|
|
454
454
|
k({
|
|
455
455
|
type: "UPDATE_ITEM_QUANTITY",
|
|
456
|
-
payload: { productId: M, quantity:
|
|
456
|
+
payload: { productId: M, quantity: D, modifierGroups: B }
|
|
457
457
|
});
|
|
458
458
|
},
|
|
459
459
|
[]
|
|
460
460
|
), H = j(
|
|
461
|
-
(M,
|
|
461
|
+
(M, D) => {
|
|
462
462
|
k({
|
|
463
463
|
type: "REMOVE_ITEM",
|
|
464
|
-
payload: { productId: M, modifierGroups:
|
|
464
|
+
payload: { productId: M, modifierGroups: D }
|
|
465
465
|
});
|
|
466
466
|
},
|
|
467
467
|
[]
|
|
@@ -470,18 +470,18 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
470
470
|
}, []), Ce = j(() => {
|
|
471
471
|
console.log("Checkout clicked, implement onCheckout handler");
|
|
472
472
|
}, []), Ze = j(
|
|
473
|
-
(M,
|
|
473
|
+
(M, D) => {
|
|
474
474
|
k({
|
|
475
475
|
type: "OPEN_MODIFIERS_MODAL",
|
|
476
|
-
payload: { product: M, onAddToCart:
|
|
476
|
+
payload: { product: M, onAddToCart: D }
|
|
477
477
|
});
|
|
478
478
|
},
|
|
479
479
|
[]
|
|
480
480
|
), Ke = j(() => {
|
|
481
481
|
k({ type: "CLOSE_MODIFIERS_MODAL" });
|
|
482
482
|
}, []), Z = be(() => v != null && v.products ? p.map((M) => {
|
|
483
|
-
const
|
|
484
|
-
return
|
|
483
|
+
const D = v.products[M.productId];
|
|
484
|
+
return D ? Ss(M, D, n ?? "USD", a) : null;
|
|
485
485
|
}).filter((M) => M !== null) : [], [p, v == null ? void 0 : v.products, n, a]), De = be(
|
|
486
486
|
() => ({
|
|
487
487
|
locale: a,
|
|
@@ -494,14 +494,14 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
494
494
|
removeItem: H,
|
|
495
495
|
updateItemQuantity: ae,
|
|
496
496
|
clearCart: J,
|
|
497
|
-
itemCount:
|
|
497
|
+
itemCount: w,
|
|
498
498
|
totalAmount: x,
|
|
499
499
|
onCheckoutClick: Ce,
|
|
500
500
|
openModifiersModal: Ze,
|
|
501
501
|
closeModifiersModal: Ke,
|
|
502
502
|
isModifiersModalOpen: h,
|
|
503
503
|
selectedProduct: f,
|
|
504
|
-
onModalAddToCart:
|
|
504
|
+
onModalAddToCart: y,
|
|
505
505
|
isProductsLoading: C,
|
|
506
506
|
paymentMethod: l,
|
|
507
507
|
setPaymentMethod: d,
|
|
@@ -516,14 +516,14 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
516
516
|
H,
|
|
517
517
|
ae,
|
|
518
518
|
J,
|
|
519
|
-
|
|
519
|
+
w,
|
|
520
520
|
x,
|
|
521
521
|
Ce,
|
|
522
522
|
Ze,
|
|
523
523
|
Ke,
|
|
524
524
|
h,
|
|
525
525
|
f,
|
|
526
|
-
|
|
526
|
+
y,
|
|
527
527
|
v,
|
|
528
528
|
C,
|
|
529
529
|
l,
|
|
@@ -577,9 +577,9 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
577
577
|
(c, u, p = "") => {
|
|
578
578
|
if (!c || c.length === 0)
|
|
579
579
|
return p;
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
582
|
-
return
|
|
580
|
+
const g = c.find((f) => f.locale === a);
|
|
581
|
+
if (g && g[u])
|
|
582
|
+
return g[u];
|
|
583
583
|
const h = c[0];
|
|
584
584
|
return h && h[u] ? h[u] : p;
|
|
585
585
|
},
|
|
@@ -612,56 +612,56 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
612
612
|
r([]);
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
615
|
-
const
|
|
615
|
+
const g = t.modifierGroups.map((h) => ({
|
|
616
616
|
groupId: h.id,
|
|
617
617
|
modifierIds: []
|
|
618
618
|
}));
|
|
619
|
-
r(
|
|
620
|
-
}, [t]), l = j((
|
|
619
|
+
r(g), n(null);
|
|
620
|
+
}, [t]), l = j((g, h) => {
|
|
621
621
|
r((f) => {
|
|
622
|
-
const
|
|
622
|
+
const y = [...f], x = y.findIndex((w) => w.groupId === g);
|
|
623
623
|
if (x === -1)
|
|
624
|
-
|
|
625
|
-
groupId:
|
|
624
|
+
y.push({
|
|
625
|
+
groupId: g,
|
|
626
626
|
modifierIds: [h]
|
|
627
627
|
});
|
|
628
628
|
else {
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
...
|
|
632
|
-
modifierIds: [...
|
|
633
|
-
} :
|
|
634
|
-
...
|
|
635
|
-
modifierIds:
|
|
629
|
+
const w = y[x];
|
|
630
|
+
w.modifierIds.indexOf(h) === -1 ? y[x] = {
|
|
631
|
+
...w,
|
|
632
|
+
modifierIds: [...w.modifierIds, h]
|
|
633
|
+
} : y[x] = {
|
|
634
|
+
...w,
|
|
635
|
+
modifierIds: w.modifierIds.filter((k) => k !== h)
|
|
636
636
|
};
|
|
637
637
|
}
|
|
638
|
-
return
|
|
638
|
+
return y;
|
|
639
639
|
}), n(null);
|
|
640
|
-
}, []), d = j((
|
|
640
|
+
}, []), d = j((g, h) => {
|
|
641
641
|
r((f) => {
|
|
642
|
-
const
|
|
643
|
-
return x === -1 ?
|
|
644
|
-
groupId:
|
|
642
|
+
const y = [...f], x = y.findIndex((w) => w.groupId === g);
|
|
643
|
+
return x === -1 ? y.push({
|
|
644
|
+
groupId: g,
|
|
645
645
|
modifierIds: [h]
|
|
646
|
-
}) :
|
|
647
|
-
...
|
|
646
|
+
}) : y[x] = {
|
|
647
|
+
...y[x],
|
|
648
648
|
modifierIds: [h]
|
|
649
|
-
},
|
|
649
|
+
}, y;
|
|
650
650
|
}), n(null);
|
|
651
651
|
}, []), c = j(
|
|
652
|
-
(
|
|
653
|
-
const f = a.find((
|
|
652
|
+
(g, h) => {
|
|
653
|
+
const f = a.find((y) => y.groupId === g);
|
|
654
654
|
return f ? f.modifierIds.includes(h) : !1;
|
|
655
655
|
},
|
|
656
656
|
[a]
|
|
657
657
|
), u = j(() => {
|
|
658
658
|
if (!t)
|
|
659
659
|
return !0;
|
|
660
|
-
const
|
|
661
|
-
return !
|
|
662
|
-
}, [t, a]), p = j(() => a.filter((
|
|
663
|
-
id:
|
|
664
|
-
modifiers:
|
|
660
|
+
const g = go(t, a);
|
|
661
|
+
return !g.valid && g.message ? n(g.message) : n(null), g.valid;
|
|
662
|
+
}, [t, a]), p = j(() => a.filter((g) => g.modifierIds.length > 0).map((g) => ({
|
|
663
|
+
id: g.groupId,
|
|
664
|
+
modifiers: g.modifierIds.map((h) => ({
|
|
665
665
|
id: h,
|
|
666
666
|
quantity: 1
|
|
667
667
|
}))
|
|
@@ -686,12 +686,12 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
686
686
|
} = Ns(), [d, c] = I(1), {
|
|
687
687
|
initializeSelections: u,
|
|
688
688
|
toggleModifier: p,
|
|
689
|
-
selectModifier:
|
|
689
|
+
selectModifier: g,
|
|
690
690
|
isModifierSelected: h,
|
|
691
691
|
validateSelections: f,
|
|
692
|
-
validationError:
|
|
692
|
+
validationError: y,
|
|
693
693
|
getCartModifierGroups: x
|
|
694
|
-
} = xo(r || {}), { getProductName:
|
|
694
|
+
} = xo(r || {}), { getProductName: w, getModifierGroupName: S } = bo(a);
|
|
695
695
|
K(() => {
|
|
696
696
|
r && (u(), c(1));
|
|
697
697
|
}, [r, u]);
|
|
@@ -726,12 +726,12 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
726
726
|
handleIncrement: k,
|
|
727
727
|
handleDecrement: A,
|
|
728
728
|
handleAddToCart: v,
|
|
729
|
-
validationError:
|
|
729
|
+
validationError: y,
|
|
730
730
|
modifierGroups: C ? r.modifierGroups : [],
|
|
731
731
|
isModifierSelected: h,
|
|
732
732
|
isMultiSelect: ie,
|
|
733
733
|
toggleModifier: p,
|
|
734
|
-
selectModifier:
|
|
734
|
+
selectModifier: g,
|
|
735
735
|
getModifierGroupName: S,
|
|
736
736
|
formatModifierPrice: ae,
|
|
737
737
|
locale: a
|
|
@@ -756,11 +756,11 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
756
756
|
products: u,
|
|
757
757
|
isProductsLoading: p
|
|
758
758
|
} = Ns();
|
|
759
|
-
return !n || p ? s : l.length === 0 ? a : /* @__PURE__ */ e("div", { className: t || "flex-1 overflow-y-auto", children: u && l.map((
|
|
760
|
-
const h = u[
|
|
759
|
+
return !n || p ? s : l.length === 0 ? a : /* @__PURE__ */ e("div", { className: t || "flex-1 overflow-y-auto", children: u && l.map((g) => {
|
|
760
|
+
const h = u[g.productId];
|
|
761
761
|
if (!h) return null;
|
|
762
|
-
const f = () => d(
|
|
763
|
-
|
|
762
|
+
const f = () => d(g.productId, g.modifierGroups), y = (w) => c(g.productId, w, g.modifierGroups), x = Ss(
|
|
763
|
+
g,
|
|
764
764
|
h,
|
|
765
765
|
n.configuration.defaultCurrency,
|
|
766
766
|
o
|
|
@@ -771,10 +771,10 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
771
771
|
children: r({
|
|
772
772
|
...x,
|
|
773
773
|
remove: f,
|
|
774
|
-
updateQuantity:
|
|
774
|
+
updateQuantity: y
|
|
775
775
|
})
|
|
776
776
|
},
|
|
777
|
-
`${
|
|
777
|
+
`${g.productId}-${JSON.stringify(g.modifierGroups)}`
|
|
778
778
|
);
|
|
779
779
|
}) });
|
|
780
780
|
}, nt = (...t) => (a, r) => {
|
|
@@ -783,7 +783,7 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
783
783
|
);
|
|
784
784
|
if (o === -1) {
|
|
785
785
|
r.addIssue({
|
|
786
|
-
code:
|
|
786
|
+
code: m.ZodIssueCode.custom,
|
|
787
787
|
message: "Missing translation for the default locale",
|
|
788
788
|
path: ["translations"]
|
|
789
789
|
});
|
|
@@ -792,7 +792,7 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
792
792
|
t.forEach((l) => {
|
|
793
793
|
const d = s[o][l];
|
|
794
794
|
(typeof d != "string" || !d.trim()) && r.addIssue({
|
|
795
|
-
code:
|
|
795
|
+
code: m.ZodIssueCode.custom,
|
|
796
796
|
message: "This field is required",
|
|
797
797
|
path: ["translations", o, l]
|
|
798
798
|
});
|
|
@@ -913,7 +913,7 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
913
913
|
["zu", "Zulu"]
|
|
914
914
|
]), vr = Array.from(sa.entries()).map(
|
|
915
915
|
([t, a]) => ({ value: t, label: a })
|
|
916
|
-
), Be =
|
|
916
|
+
), Be = m.enum([
|
|
917
917
|
"af",
|
|
918
918
|
"sq",
|
|
919
919
|
"ar_dz",
|
|
@@ -1030,113 +1030,113 @@ const ks = Ae(null), As = ({ baseUrl: t, children: a }) => {
|
|
|
1030
1030
|
]).openapi({
|
|
1031
1031
|
description: "Enum for locale values",
|
|
1032
1032
|
example: "en"
|
|
1033
|
-
}), Ps =
|
|
1033
|
+
}), Ps = m.union([m.string(), m.number(), m.null()]).optional().transform((t) => {
|
|
1034
1034
|
if (t == null || t === "") return null;
|
|
1035
1035
|
if (typeof t == "number") return t;
|
|
1036
1036
|
const a = Number(t);
|
|
1037
1037
|
return isNaN(a) ? t : a;
|
|
1038
1038
|
}).pipe(
|
|
1039
|
-
|
|
1039
|
+
m.number().nonnegative({ message: "This field must be a positive number" }).nullable().refine((t) => t === null || t >= 0, {
|
|
1040
1040
|
message: "Price must be positive"
|
|
1041
1041
|
})
|
|
1042
|
-
), $t =
|
|
1042
|
+
), $t = m.coerce.number().min(0.1, "This field must be positive").refine((t) => /^\d+(\.\d{1,2})?$/.test(t.toString()), {
|
|
1043
1043
|
message: "This field can have a maximum of two decimal points"
|
|
1044
|
-
}), So =
|
|
1045
|
-
type:
|
|
1046
|
-
payload:
|
|
1047
|
-
pathname:
|
|
1048
|
-
callbackUrl:
|
|
1049
|
-
multipart:
|
|
1050
|
-
clientPayload:
|
|
1044
|
+
}), So = m.object({
|
|
1045
|
+
type: m.literal("blob.generate-client-token"),
|
|
1046
|
+
payload: m.object({
|
|
1047
|
+
pathname: m.string(),
|
|
1048
|
+
callbackUrl: m.string(),
|
|
1049
|
+
multipart: m.boolean(),
|
|
1050
|
+
clientPayload: m.string().nullable()
|
|
1051
1051
|
})
|
|
1052
|
-
}), ko =
|
|
1053
|
-
type:
|
|
1054
|
-
payload:
|
|
1052
|
+
}), ko = m.object({
|
|
1053
|
+
type: m.literal("blob.upload-completed"),
|
|
1054
|
+
payload: m.object({
|
|
1055
1055
|
// Replace z.any() with an appropriate schema for PutBlobResult if available
|
|
1056
|
-
blob:
|
|
1057
|
-
tokenPayload:
|
|
1056
|
+
blob: m.any(),
|
|
1057
|
+
tokenPayload: m.string().nullable().optional()
|
|
1058
1058
|
})
|
|
1059
1059
|
});
|
|
1060
|
-
|
|
1060
|
+
m.discriminatedUnion("type", [
|
|
1061
1061
|
So,
|
|
1062
1062
|
ko
|
|
1063
1063
|
]);
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
type:
|
|
1067
|
-
clientToken:
|
|
1064
|
+
m.discriminatedUnion("type", [
|
|
1065
|
+
m.object({
|
|
1066
|
+
type: m.literal("blob.generate-client-token"),
|
|
1067
|
+
clientToken: m.string()
|
|
1068
1068
|
}),
|
|
1069
|
-
|
|
1070
|
-
type:
|
|
1071
|
-
response:
|
|
1069
|
+
m.object({
|
|
1070
|
+
type: m.literal("blob.upload-completed"),
|
|
1071
|
+
response: m.literal("ok")
|
|
1072
1072
|
})
|
|
1073
1073
|
]);
|
|
1074
|
-
|
|
1075
|
-
mimeType:
|
|
1074
|
+
m.object({
|
|
1075
|
+
mimeType: m.string().min(1, "MIME type is required").openapi({
|
|
1076
1076
|
example: "image/png",
|
|
1077
1077
|
description: "MIME type of the file"
|
|
1078
1078
|
}),
|
|
1079
|
-
size:
|
|
1079
|
+
size: m.number().min(1, "Size is required").openapi({
|
|
1080
1080
|
example: 1024,
|
|
1081
1081
|
description: "Size of the file in bytes"
|
|
1082
1082
|
}),
|
|
1083
|
-
filename:
|
|
1083
|
+
filename: m.string().min(1, "Filename is required").openapi({
|
|
1084
1084
|
example: "example.png",
|
|
1085
1085
|
description: "Name of the file"
|
|
1086
1086
|
}),
|
|
1087
|
-
organizationId:
|
|
1087
|
+
organizationId: m.string().optional().openapi({
|
|
1088
1088
|
example: "clm1234567890abcdef",
|
|
1089
1089
|
description: "ID of the organization"
|
|
1090
1090
|
})
|
|
1091
1091
|
});
|
|
1092
|
-
const Fe =
|
|
1093
|
-
id:
|
|
1092
|
+
const Fe = m.object({
|
|
1093
|
+
id: m.string().min(1, "ID is required").openapi({
|
|
1094
1094
|
example: "clf9876543210abcdef",
|
|
1095
1095
|
description: "ID of the file"
|
|
1096
1096
|
}),
|
|
1097
|
-
url:
|
|
1097
|
+
url: m.string().min(1, "Path is required").openapi({
|
|
1098
1098
|
example: "/path/to/file",
|
|
1099
1099
|
description: "Path of the file"
|
|
1100
1100
|
}),
|
|
1101
|
-
mimeType:
|
|
1101
|
+
mimeType: m.string().min(1, "MIME type is required").openapi({
|
|
1102
1102
|
example: "image/png",
|
|
1103
1103
|
description: "MIME type of the file"
|
|
1104
1104
|
}),
|
|
1105
|
-
size:
|
|
1105
|
+
size: m.number().min(1, "Size is required").openapi({
|
|
1106
1106
|
example: 1024,
|
|
1107
1107
|
description: "Size of the file in bytes"
|
|
1108
1108
|
}),
|
|
1109
|
-
filename:
|
|
1109
|
+
filename: m.string().min(1, "Filename is required").openapi({
|
|
1110
1110
|
example: "example.png",
|
|
1111
1111
|
description: "Name of the file"
|
|
1112
1112
|
})
|
|
1113
|
-
}).openapi("UploadedFile"), ia =
|
|
1114
|
-
id:
|
|
1113
|
+
}).openapi("UploadedFile"), ia = m.object({
|
|
1114
|
+
id: m.string().openapi({
|
|
1115
1115
|
example: "clf9876543210abcdef",
|
|
1116
1116
|
description: "ID of the product category"
|
|
1117
1117
|
}),
|
|
1118
|
-
slug:
|
|
1118
|
+
slug: m.string().openapi({
|
|
1119
1119
|
example: "electronics",
|
|
1120
1120
|
description: "Slug of the product category"
|
|
1121
1121
|
}),
|
|
1122
1122
|
image: Fe.nullable().optional().openapi({
|
|
1123
1123
|
description: "Image of the product category"
|
|
1124
1124
|
}),
|
|
1125
|
-
createdAt:
|
|
1126
|
-
publishedAt:
|
|
1125
|
+
createdAt: m.date(),
|
|
1126
|
+
publishedAt: m.date().nullable().optional().openapi({
|
|
1127
1127
|
description: "Timestamp when the product category was published"
|
|
1128
1128
|
}),
|
|
1129
|
-
translations:
|
|
1130
|
-
|
|
1131
|
-
locale:
|
|
1129
|
+
translations: m.array(
|
|
1130
|
+
m.object({
|
|
1131
|
+
locale: m.string().min(1, "Locale is required").openapi({
|
|
1132
1132
|
example: "en-US",
|
|
1133
1133
|
description: "Locale code for the translation"
|
|
1134
1134
|
}),
|
|
1135
|
-
title:
|
|
1135
|
+
title: m.string().default("").openapi({
|
|
1136
1136
|
example: "Electronics",
|
|
1137
1137
|
description: "Name of the product category in the specified locale"
|
|
1138
1138
|
}),
|
|
1139
|
-
description:
|
|
1139
|
+
description: m.string().max(6e3, "Maximum character limit is 6000").nullable().default("").optional().openapi({
|
|
1140
1140
|
example: "A category for electronic devices.",
|
|
1141
1141
|
description: "Description of the product category in the specified locale"
|
|
1142
1142
|
})
|
|
@@ -1148,18 +1148,18 @@ const Fe = g.object({
|
|
|
1148
1148
|
ia.omit({
|
|
1149
1149
|
translations: !0
|
|
1150
1150
|
}).extend({
|
|
1151
|
-
title:
|
|
1152
|
-
description:
|
|
1151
|
+
title: m.string().default(""),
|
|
1152
|
+
description: m.string().default("")
|
|
1153
1153
|
}).openapi("LocalizedProductCategory");
|
|
1154
1154
|
const Ao = ia.pick({
|
|
1155
1155
|
slug: !0,
|
|
1156
1156
|
image: !0,
|
|
1157
1157
|
translations: !0
|
|
1158
1158
|
}).extend({
|
|
1159
|
-
defaultLocale:
|
|
1159
|
+
defaultLocale: m.string().min(1, "Default locale is required").openapi({
|
|
1160
1160
|
description: "The default locale for the product category"
|
|
1161
1161
|
}),
|
|
1162
|
-
imageId:
|
|
1162
|
+
imageId: m.string().cuid().optional().openapi({
|
|
1163
1163
|
description: "ID of the image for the product category"
|
|
1164
1164
|
})
|
|
1165
1165
|
}).superRefine(nt("title")).openapi("CreateProductCategory"), vo = ia.pick({
|
|
@@ -1167,66 +1167,66 @@ const Ao = ia.pick({
|
|
|
1167
1167
|
image: !0,
|
|
1168
1168
|
translations: !0
|
|
1169
1169
|
}).extend({
|
|
1170
|
-
defaultLocale:
|
|
1170
|
+
defaultLocale: m.string().min(1, "Default locale is required").openapi({
|
|
1171
1171
|
description: "The default locale for the product category"
|
|
1172
1172
|
}),
|
|
1173
|
-
imageId:
|
|
1173
|
+
imageId: m.string().cuid().optional().nullable().openapi({
|
|
1174
1174
|
description: "ID of the image for the product category"
|
|
1175
1175
|
})
|
|
1176
|
-
}).partial().superRefine(nt("title")).openapi("UpdateProductCategory"), Ts =
|
|
1177
|
-
id:
|
|
1178
|
-
title:
|
|
1176
|
+
}).partial().superRefine(nt("title")).openapi("UpdateProductCategory"), Ts = m.object({
|
|
1177
|
+
id: m.string().cuid().optional(),
|
|
1178
|
+
title: m.string().min(1, "This field is required").openapi({
|
|
1179
1179
|
example: "Large",
|
|
1180
1180
|
description: "Title of the modifier"
|
|
1181
1181
|
}),
|
|
1182
|
-
sku:
|
|
1182
|
+
sku: m.coerce.string().optional().openapi({
|
|
1183
1183
|
example: "csd9876543210abcdef",
|
|
1184
1184
|
description: "Stock Keeping Unit identifier"
|
|
1185
1185
|
}),
|
|
1186
|
-
price:
|
|
1186
|
+
price: m.coerce.number().optional().default(0).openapi({
|
|
1187
1187
|
example: 2.5,
|
|
1188
1188
|
description: "Price of the modifier"
|
|
1189
1189
|
})
|
|
1190
|
-
}).openapi("Modifier"), Qs =
|
|
1191
|
-
id:
|
|
1192
|
-
selectMin:
|
|
1190
|
+
}).openapi("Modifier"), Qs = m.object({
|
|
1191
|
+
id: m.string().cuid(),
|
|
1192
|
+
selectMin: m.coerce.number().min(0).openapi({
|
|
1193
1193
|
example: 1,
|
|
1194
1194
|
description: "Minimum number of modifiers that can be selected"
|
|
1195
1195
|
}),
|
|
1196
|
-
selectMax:
|
|
1196
|
+
selectMax: m.coerce.number().min(0).openapi({
|
|
1197
1197
|
example: 1,
|
|
1198
1198
|
description: "Maximum number of modifiers that can be selected"
|
|
1199
1199
|
}),
|
|
1200
1200
|
defaultLocale: Be.optional(),
|
|
1201
|
-
modifiers:
|
|
1202
|
-
translations:
|
|
1203
|
-
|
|
1201
|
+
modifiers: m.array(Ts).optional().openapi({}),
|
|
1202
|
+
translations: m.array(
|
|
1203
|
+
m.object({
|
|
1204
1204
|
locale: Be,
|
|
1205
|
-
title:
|
|
1205
|
+
title: m.string().optional().openapi({
|
|
1206
1206
|
example: "Size",
|
|
1207
1207
|
description: "Title of the modifier group"
|
|
1208
1208
|
})
|
|
1209
1209
|
})
|
|
1210
1210
|
)
|
|
1211
1211
|
}).openapi("ModifierGroup"), No = Qs.extend({
|
|
1212
|
-
title:
|
|
1212
|
+
title: m.string().default("").nullable()
|
|
1213
1213
|
}).omit({
|
|
1214
1214
|
translations: !0
|
|
1215
|
-
}).openapi("LocalizedModifierGroup"), Is =
|
|
1216
|
-
selectMin:
|
|
1215
|
+
}).openapi("LocalizedModifierGroup"), Is = m.object({
|
|
1216
|
+
selectMin: m.coerce.number().min(0).openapi({
|
|
1217
1217
|
example: 1,
|
|
1218
1218
|
description: "Minimum number of modifiers that can be selected"
|
|
1219
1219
|
}),
|
|
1220
|
-
selectMax:
|
|
1220
|
+
selectMax: m.coerce.number().min(0).openapi({
|
|
1221
1221
|
example: 1,
|
|
1222
1222
|
description: "Maximum number of modifiers that can be selected"
|
|
1223
1223
|
}),
|
|
1224
1224
|
defaultLocale: Be.optional(),
|
|
1225
|
-
modifiers:
|
|
1226
|
-
translations:
|
|
1227
|
-
|
|
1225
|
+
modifiers: m.array(Ts).optional().openapi({}),
|
|
1226
|
+
translations: m.array(
|
|
1227
|
+
m.object({
|
|
1228
1228
|
locale: Be,
|
|
1229
|
-
title:
|
|
1229
|
+
title: m.string().optional().openapi({
|
|
1230
1230
|
example: "Size",
|
|
1231
1231
|
description: "Title of the modifier group"
|
|
1232
1232
|
})
|
|
@@ -1245,67 +1245,67 @@ const Ao = ia.pick({
|
|
|
1245
1245
|
message: "Maximum selections cannot exceed the total number of modifiers",
|
|
1246
1246
|
path: ["selectMax"]
|
|
1247
1247
|
}
|
|
1248
|
-
).superRefine(nt("title")).openapi("ModifierGroup"), Ls =
|
|
1249
|
-
id:
|
|
1248
|
+
).superRefine(nt("title")).openapi("ModifierGroup"), Ls = m.object({
|
|
1249
|
+
id: m.string().cuid().openapi({
|
|
1250
1250
|
example: "clf9876543210abcdef",
|
|
1251
1251
|
description: "ID of the product"
|
|
1252
1252
|
}),
|
|
1253
|
-
slug:
|
|
1253
|
+
slug: m.string().optional().openapi({
|
|
1254
1254
|
example: "premium-watch",
|
|
1255
1255
|
description: "Unique slug for the product"
|
|
1256
1256
|
}),
|
|
1257
|
-
sku:
|
|
1257
|
+
sku: m.string().optional().openapi({
|
|
1258
1258
|
example: "PRM-WATCH-01",
|
|
1259
1259
|
description: "Stock Keeping Unit identifier"
|
|
1260
1260
|
}),
|
|
1261
1261
|
basePrice: $t,
|
|
1262
1262
|
discountedBasePrice: Ps,
|
|
1263
|
-
currency:
|
|
1263
|
+
currency: m.string().openapi({
|
|
1264
1264
|
example: "USD",
|
|
1265
1265
|
description: "Currency code for pricing"
|
|
1266
1266
|
}),
|
|
1267
|
-
images:
|
|
1267
|
+
images: m.array(Fe).optional().openapi({
|
|
1268
1268
|
description: "List of product images"
|
|
1269
1269
|
}),
|
|
1270
|
-
modifierGroups:
|
|
1270
|
+
modifierGroups: m.array(Qs).optional().openapi({
|
|
1271
1271
|
description: "List of product modifier groups"
|
|
1272
1272
|
}),
|
|
1273
|
-
categories:
|
|
1273
|
+
categories: m.array(ia).openapi({
|
|
1274
1274
|
example: ["cju0z9k4z0000l1qg5z1z1z"],
|
|
1275
1275
|
description: "IDs of associated product categories"
|
|
1276
1276
|
}),
|
|
1277
|
-
manufacturerId:
|
|
1277
|
+
manufacturerId: m.string().cuid().nullable().optional().openapi({
|
|
1278
1278
|
description: "ID of associated manufacturer"
|
|
1279
1279
|
}),
|
|
1280
|
-
createdAt:
|
|
1281
|
-
publishedAt:
|
|
1282
|
-
translations:
|
|
1283
|
-
|
|
1280
|
+
createdAt: m.date(),
|
|
1281
|
+
publishedAt: m.date().nullable().optional(),
|
|
1282
|
+
translations: m.array(
|
|
1283
|
+
m.object({
|
|
1284
1284
|
locale: Be,
|
|
1285
|
-
title:
|
|
1285
|
+
title: m.coerce.string().optional().openapi({
|
|
1286
1286
|
example: "Premium Watch",
|
|
1287
1287
|
description: "Product name in specified locale"
|
|
1288
1288
|
}),
|
|
1289
|
-
description:
|
|
1289
|
+
description: m.string().nullable().optional().openapi({
|
|
1290
1290
|
example: "High-quality premium watch",
|
|
1291
1291
|
description: "Product description in specified locale"
|
|
1292
1292
|
})
|
|
1293
1293
|
})
|
|
1294
1294
|
).optional(),
|
|
1295
|
-
metadata:
|
|
1296
|
-
|
|
1295
|
+
metadata: m.record(
|
|
1296
|
+
m.string().min(1, "Key cannot be empty").max(50, "Key too long").regex(
|
|
1297
1297
|
/^[a-zA-Z][a-zA-Z0-9_-]*$/,
|
|
1298
1298
|
"Key must start with letter and contain only letters, numbers, underscore, or dash"
|
|
1299
1299
|
),
|
|
1300
|
-
|
|
1300
|
+
m.string().min(1, "Value cannot be empty").max(200, "Value too long")
|
|
1301
1301
|
).optional().nullable()
|
|
1302
1302
|
}).openapi("Product"), Ro = Ls.extend({
|
|
1303
|
-
title:
|
|
1304
|
-
description:
|
|
1305
|
-
modifierGroups:
|
|
1306
|
-
categories:
|
|
1307
|
-
|
|
1308
|
-
id:
|
|
1303
|
+
title: m.string().default(""),
|
|
1304
|
+
description: m.string().nullable().default(""),
|
|
1305
|
+
modifierGroups: m.array(No),
|
|
1306
|
+
categories: m.array(
|
|
1307
|
+
m.object({
|
|
1308
|
+
id: m.string().cuid().openapi({
|
|
1309
1309
|
example: "cju0z9k4z0000l1qg5z1z1z",
|
|
1310
1310
|
description: "ID of the product category"
|
|
1311
1311
|
})
|
|
@@ -1324,57 +1324,57 @@ const Ao = ia.pick({
|
|
|
1324
1324
|
translations: !0,
|
|
1325
1325
|
metadata: !0
|
|
1326
1326
|
}).extend({
|
|
1327
|
-
defaultLocale:
|
|
1327
|
+
defaultLocale: m.string().min(1, "Default locale is required").openapi({
|
|
1328
1328
|
example: "en-US",
|
|
1329
1329
|
description: "Default translation locale"
|
|
1330
1330
|
}),
|
|
1331
|
-
modifierGroups:
|
|
1331
|
+
modifierGroups: m.array(Is).optional().openapi({
|
|
1332
1332
|
description: "List of product modifier groups"
|
|
1333
1333
|
}),
|
|
1334
|
-
categories:
|
|
1334
|
+
categories: m.array(m.string()).optional().openapi({
|
|
1335
1335
|
example: ["cju0z9k4z0000l1qg5z1z1z"],
|
|
1336
1336
|
description: "IDs of associated product categories"
|
|
1337
1337
|
})
|
|
1338
1338
|
}), Co = Es.superRefine(
|
|
1339
1339
|
(t, a) => (t.discountedBasePrice !== null && t.discountedBasePrice !== void 0 && t.discountedBasePrice > t.basePrice && a.addIssue({
|
|
1340
|
-
code:
|
|
1340
|
+
code: m.ZodIssueCode.custom,
|
|
1341
1341
|
path: ["discountedBasePrice"],
|
|
1342
1342
|
message: "Discounted price cannot exceed base price"
|
|
1343
1343
|
}), nt("title")(t, a))
|
|
1344
1344
|
).openapi("CreateProduct"), Po = Es.partial().superRefine((t, a) => (t.discountedBasePrice !== null && t.discountedBasePrice !== void 0 && t.basePrice && t.discountedBasePrice > t.basePrice && a.addIssue({
|
|
1345
|
-
code:
|
|
1345
|
+
code: m.ZodIssueCode.custom,
|
|
1346
1346
|
path: ["discountedBasePrice"],
|
|
1347
1347
|
message: "Discounted price cannot exceed base price"
|
|
1348
1348
|
}), nt("title")(t, a))).openapi("UpdateProduct");
|
|
1349
|
-
|
|
1350
|
-
|
|
1349
|
+
m.record(
|
|
1350
|
+
m.string().openapi({
|
|
1351
1351
|
example: "clf9876543210abcdef",
|
|
1352
1352
|
description: "ID of the product in the cart"
|
|
1353
1353
|
}),
|
|
1354
1354
|
Ro
|
|
1355
1355
|
);
|
|
1356
|
-
const Ds =
|
|
1357
|
-
productId:
|
|
1356
|
+
const Ds = m.object({
|
|
1357
|
+
productId: m.string().cuid().openapi({
|
|
1358
1358
|
example: "clf9876543210abcdef",
|
|
1359
1359
|
description: "ID of the product in the cart"
|
|
1360
1360
|
}),
|
|
1361
|
-
quantity:
|
|
1361
|
+
quantity: m.number().default(1).optional().openapi({
|
|
1362
1362
|
example: 2,
|
|
1363
1363
|
description: "Quantity of this item in the cart"
|
|
1364
1364
|
}),
|
|
1365
|
-
modifierGroups:
|
|
1366
|
-
|
|
1367
|
-
id:
|
|
1365
|
+
modifierGroups: m.array(
|
|
1366
|
+
m.object({
|
|
1367
|
+
id: m.string().cuid().openapi({
|
|
1368
1368
|
example: "clg1234567890abcdef",
|
|
1369
1369
|
description: "ID of the modifier group"
|
|
1370
1370
|
}),
|
|
1371
|
-
modifiers:
|
|
1372
|
-
|
|
1373
|
-
id:
|
|
1371
|
+
modifiers: m.array(
|
|
1372
|
+
m.object({
|
|
1373
|
+
id: m.string().cuid().openapi({
|
|
1374
1374
|
example: "clh9876543210abcdef",
|
|
1375
1375
|
description: "ID of the selected modifier"
|
|
1376
1376
|
}),
|
|
1377
|
-
quantity:
|
|
1377
|
+
quantity: m.number().default(1).openapi({
|
|
1378
1378
|
example: 1,
|
|
1379
1379
|
description: "Quantity of this modifier"
|
|
1380
1380
|
})
|
|
@@ -1382,22 +1382,22 @@ const Ds = g.object({
|
|
|
1382
1382
|
)
|
|
1383
1383
|
})
|
|
1384
1384
|
)
|
|
1385
|
-
}).openapi("CartItem"), To =
|
|
1386
|
-
items:
|
|
1387
|
-
shippingMethodId:
|
|
1385
|
+
}).openapi("CartItem"), To = m.object({
|
|
1386
|
+
items: m.array(Ds),
|
|
1387
|
+
shippingMethodId: m.string().cuid().optional()
|
|
1388
1388
|
});
|
|
1389
|
-
|
|
1390
|
-
status:
|
|
1389
|
+
m.object({
|
|
1390
|
+
status: m.number().openapi({
|
|
1391
1391
|
example: 404,
|
|
1392
1392
|
description: "The HTTP status code"
|
|
1393
1393
|
}),
|
|
1394
|
-
message:
|
|
1394
|
+
message: m.string().openapi({
|
|
1395
1395
|
example: "Not found",
|
|
1396
1396
|
description: "The error message"
|
|
1397
1397
|
})
|
|
1398
1398
|
});
|
|
1399
|
-
|
|
1400
|
-
"accept-language":
|
|
1399
|
+
m.object({
|
|
1400
|
+
"accept-language": m.string().optional().openapi({
|
|
1401
1401
|
example: "en-US",
|
|
1402
1402
|
description: "Accept-Language header",
|
|
1403
1403
|
param: {
|
|
@@ -1405,7 +1405,7 @@ g.object({
|
|
|
1405
1405
|
name: "accept-language"
|
|
1406
1406
|
}
|
|
1407
1407
|
}),
|
|
1408
|
-
cookie:
|
|
1408
|
+
cookie: m.string().optional().openapi({
|
|
1409
1409
|
example: "session=1234567890",
|
|
1410
1410
|
description: "Cookie header",
|
|
1411
1411
|
param: {
|
|
@@ -1414,126 +1414,126 @@ g.object({
|
|
|
1414
1414
|
}
|
|
1415
1415
|
})
|
|
1416
1416
|
}).openapi("Headers");
|
|
1417
|
-
|
|
1418
|
-
id:
|
|
1417
|
+
m.object({
|
|
1418
|
+
id: m.string().openapi({
|
|
1419
1419
|
example: "clm1234567890abcdef",
|
|
1420
1420
|
description: "User's ID"
|
|
1421
1421
|
}),
|
|
1422
|
-
email:
|
|
1422
|
+
email: m.string().openapi({
|
|
1423
1423
|
example: "user@example.com",
|
|
1424
1424
|
description: "User's email address",
|
|
1425
1425
|
format: "email"
|
|
1426
1426
|
}),
|
|
1427
|
-
firstname:
|
|
1427
|
+
firstname: m.string().openapi({
|
|
1428
1428
|
example: "John",
|
|
1429
1429
|
description: "User's first name"
|
|
1430
1430
|
}),
|
|
1431
|
-
lastname:
|
|
1431
|
+
lastname: m.string().openapi({
|
|
1432
1432
|
example: "Doe",
|
|
1433
1433
|
description: "User's last name"
|
|
1434
1434
|
}),
|
|
1435
|
-
image:
|
|
1435
|
+
image: m.string().nullable().optional().openapi({
|
|
1436
1436
|
example: "https://example.com/image.jpg",
|
|
1437
1437
|
description: "User's profile image"
|
|
1438
1438
|
}),
|
|
1439
|
-
name:
|
|
1439
|
+
name: m.string().nullable().optional().openapi({
|
|
1440
1440
|
description: "User's full name (optional)"
|
|
1441
1441
|
})
|
|
1442
1442
|
}).openapi("User");
|
|
1443
|
-
|
|
1444
|
-
page:
|
|
1443
|
+
m.object({
|
|
1444
|
+
page: m.coerce.number().optional().default(1).openapi({
|
|
1445
1445
|
example: 1,
|
|
1446
1446
|
description: "Page number"
|
|
1447
1447
|
}),
|
|
1448
|
-
limit:
|
|
1448
|
+
limit: m.coerce.number().optional().default(10).openapi({
|
|
1449
1449
|
example: 50,
|
|
1450
1450
|
description: "Number of items per page"
|
|
1451
1451
|
}),
|
|
1452
|
-
search:
|
|
1452
|
+
search: m.string().optional().openapi({
|
|
1453
1453
|
example: "Apple",
|
|
1454
1454
|
description: "Search query"
|
|
1455
1455
|
}),
|
|
1456
|
-
published:
|
|
1456
|
+
published: m.coerce.boolean().optional().openapi({
|
|
1457
1457
|
example: !0,
|
|
1458
1458
|
description: "Whether to filter by published items"
|
|
1459
1459
|
}),
|
|
1460
1460
|
locale: Be.optional()
|
|
1461
1461
|
});
|
|
1462
|
-
|
|
1463
|
-
isFirstPage:
|
|
1462
|
+
m.object({
|
|
1463
|
+
isFirstPage: m.boolean().openapi({
|
|
1464
1464
|
example: !0,
|
|
1465
1465
|
description: "Whether the current page is the first page"
|
|
1466
1466
|
}),
|
|
1467
|
-
isLastPage:
|
|
1467
|
+
isLastPage: m.boolean().openapi({
|
|
1468
1468
|
example: !1,
|
|
1469
1469
|
description: "Whether the current page is the last page"
|
|
1470
1470
|
}),
|
|
1471
|
-
currentPage:
|
|
1471
|
+
currentPage: m.number().openapi({
|
|
1472
1472
|
example: 1,
|
|
1473
1473
|
description: "The current page number"
|
|
1474
1474
|
}),
|
|
1475
|
-
previousPage:
|
|
1475
|
+
previousPage: m.number().nullable().openapi({
|
|
1476
1476
|
example: 0,
|
|
1477
1477
|
description: "The previous page number"
|
|
1478
1478
|
}),
|
|
1479
|
-
nextPage:
|
|
1479
|
+
nextPage: m.number().nullable().openapi({
|
|
1480
1480
|
example: 2,
|
|
1481
1481
|
description: "The next page number"
|
|
1482
1482
|
}),
|
|
1483
|
-
pageCount:
|
|
1483
|
+
pageCount: m.number().openapi({
|
|
1484
1484
|
example: 5,
|
|
1485
1485
|
description: "The total number of pages"
|
|
1486
1486
|
}),
|
|
1487
|
-
totalCount:
|
|
1487
|
+
totalCount: m.number().openapi({
|
|
1488
1488
|
example: 50,
|
|
1489
1489
|
description: "The total number of items"
|
|
1490
1490
|
})
|
|
1491
1491
|
}).openapi("PaginationMeta");
|
|
1492
|
-
const ot =
|
|
1493
|
-
id:
|
|
1492
|
+
const ot = m.object({
|
|
1493
|
+
id: m.string().cuid().openapi({
|
|
1494
1494
|
example: "clf9876543210abcdef",
|
|
1495
1495
|
description: "The unique identifier of the address"
|
|
1496
1496
|
}),
|
|
1497
|
-
firstname:
|
|
1497
|
+
firstname: m.string().optional().nullable().openapi({
|
|
1498
1498
|
example: "John",
|
|
1499
1499
|
description: "The first name of the recipient"
|
|
1500
1500
|
}),
|
|
1501
|
-
lastname:
|
|
1501
|
+
lastname: m.string().optional().nullable().openapi({
|
|
1502
1502
|
example: "Doe",
|
|
1503
1503
|
description: "The last name of the recipient"
|
|
1504
1504
|
}),
|
|
1505
|
-
phone:
|
|
1505
|
+
phone: m.string().optional().nullable().openapi({
|
|
1506
1506
|
example: "+1234567890",
|
|
1507
1507
|
description: "Phone number of the recipient"
|
|
1508
1508
|
}),
|
|
1509
|
-
addressLineOne:
|
|
1509
|
+
addressLineOne: m.string().openapi({
|
|
1510
1510
|
example: "123 Main Street",
|
|
1511
1511
|
description: "The first line of the address"
|
|
1512
1512
|
}),
|
|
1513
|
-
doorNumber:
|
|
1513
|
+
doorNumber: m.string().nullable().optional().openapi({
|
|
1514
1514
|
description: "The door number of the address"
|
|
1515
1515
|
}),
|
|
1516
|
-
addressLineTwo:
|
|
1516
|
+
addressLineTwo: m.string().nullable().optional().openapi({
|
|
1517
1517
|
example: "Suite 100",
|
|
1518
1518
|
description: "The second line of the address"
|
|
1519
1519
|
}),
|
|
1520
|
-
zipCode:
|
|
1520
|
+
zipCode: m.string().optional().openapi({
|
|
1521
1521
|
example: "12345",
|
|
1522
1522
|
description: "The postal code of the address"
|
|
1523
1523
|
}),
|
|
1524
|
-
city:
|
|
1524
|
+
city: m.string().openapi({
|
|
1525
1525
|
example: "New York",
|
|
1526
1526
|
description: "The city of the address"
|
|
1527
1527
|
}),
|
|
1528
|
-
country:
|
|
1528
|
+
country: m.string().openapi({
|
|
1529
1529
|
example: "USA",
|
|
1530
1530
|
description: "The country of the address"
|
|
1531
1531
|
}),
|
|
1532
|
-
placeId:
|
|
1532
|
+
placeId: m.string().openapi({
|
|
1533
1533
|
example: "ChIJN1t_tKlj4AR4GeTYWZ7frY",
|
|
1534
1534
|
description: "The Google Place ID for the address"
|
|
1535
1535
|
}),
|
|
1536
|
-
deliveryInstructions:
|
|
1536
|
+
deliveryInstructions: m.string().nullable().optional().openapi({
|
|
1537
1537
|
example: "Leave at the door",
|
|
1538
1538
|
description: "Delivery instructions for the address"
|
|
1539
1539
|
})
|
|
@@ -1546,15 +1546,15 @@ const ot = g.object({
|
|
|
1546
1546
|
country: !0,
|
|
1547
1547
|
placeId: !0
|
|
1548
1548
|
}).openapi("CreateAddress"), zs = na.partial().openapi("UpdateAddress"), Qo = ot.extend({
|
|
1549
|
-
firstname:
|
|
1549
|
+
firstname: m.string().min(2, "First Name must be at least 2 characters").openapi({
|
|
1550
1550
|
example: "John",
|
|
1551
1551
|
description: "The first name of the recipient"
|
|
1552
1552
|
}),
|
|
1553
|
-
lastname:
|
|
1553
|
+
lastname: m.string().min(1, "Last Name must be at least 2 characters").openapi({
|
|
1554
1554
|
example: "Doe",
|
|
1555
1555
|
description: "The last name of the recipient"
|
|
1556
1556
|
}),
|
|
1557
|
-
phone:
|
|
1557
|
+
phone: m.string().min(4).openapi({
|
|
1558
1558
|
example: "+1234567890",
|
|
1559
1559
|
description: "Phone number of the recepient"
|
|
1560
1560
|
})
|
|
@@ -1572,7 +1572,7 @@ const ot = g.object({
|
|
|
1572
1572
|
deliveryInstructions: !0
|
|
1573
1573
|
});
|
|
1574
1574
|
Ms.partial().extend({
|
|
1575
|
-
placeId:
|
|
1575
|
+
placeId: m.string().min(1, "This field is required").openapi({
|
|
1576
1576
|
example: "ChIJN1t_tKlj4AR4GeTYWZ7frY",
|
|
1577
1577
|
description: "The Google Place ID for the address"
|
|
1578
1578
|
})
|
|
@@ -1611,7 +1611,7 @@ const Io = [
|
|
|
1611
1611
|
{ value: "SAR", label: "Saudi Riyal" },
|
|
1612
1612
|
{ value: "MYR", label: "Malaysian Ringgit" },
|
|
1613
1613
|
{ value: "RON", label: "Romanian Leu" }
|
|
1614
|
-
], Ba =
|
|
1614
|
+
], Ba = m.enum([
|
|
1615
1615
|
"USD",
|
|
1616
1616
|
"EUR",
|
|
1617
1617
|
"GBP",
|
|
@@ -1647,21 +1647,21 @@ const Io = [
|
|
|
1647
1647
|
"RON"
|
|
1648
1648
|
]).openapi({
|
|
1649
1649
|
description: "The currency code for the transaction."
|
|
1650
|
-
}), Ja =
|
|
1650
|
+
}), Ja = m.enum(["card", "blik", "cash_on_delivery", "paypal"]).openapi({
|
|
1651
1651
|
description: "The payment method",
|
|
1652
1652
|
example: "card"
|
|
1653
|
-
}), Oa =
|
|
1653
|
+
}), Oa = m.enum(["stripe", "revolut", "payu", "not_applicable"]).openapi({
|
|
1654
1654
|
description: "The payment method",
|
|
1655
1655
|
example: "card"
|
|
1656
|
-
}), Lo =
|
|
1656
|
+
}), Lo = m.enum(["pending", "succeeded", "refunded", "failed", "canceled"]).openapi({
|
|
1657
1657
|
description: "The payment status",
|
|
1658
1658
|
example: "pending"
|
|
1659
1659
|
});
|
|
1660
|
-
|
|
1661
|
-
id:
|
|
1660
|
+
m.object({
|
|
1661
|
+
id: m.string().min(1),
|
|
1662
1662
|
provider: Oa,
|
|
1663
1663
|
method: Ja,
|
|
1664
|
-
description:
|
|
1664
|
+
description: m.string().min(1)
|
|
1665
1665
|
}).openapi({
|
|
1666
1666
|
description: "The payment method",
|
|
1667
1667
|
example: {
|
|
@@ -1669,22 +1669,22 @@ g.object({
|
|
|
1669
1669
|
type: "card"
|
|
1670
1670
|
}
|
|
1671
1671
|
});
|
|
1672
|
-
const Eo =
|
|
1673
|
-
id:
|
|
1672
|
+
const Eo = m.object({
|
|
1673
|
+
id: m.string().cuid().min(1),
|
|
1674
1674
|
method: Ja,
|
|
1675
1675
|
provider: Oa,
|
|
1676
1676
|
status: Lo,
|
|
1677
|
-
shipping:
|
|
1678
|
-
subtotal:
|
|
1679
|
-
total:
|
|
1680
|
-
discount:
|
|
1677
|
+
shipping: m.number().min(0).default(0),
|
|
1678
|
+
subtotal: m.number().min(0),
|
|
1679
|
+
total: m.number().min(0),
|
|
1680
|
+
discount: m.number().min(0).default(0),
|
|
1681
1681
|
currency: Ba
|
|
1682
|
-
}), Nr =
|
|
1683
|
-
id:
|
|
1682
|
+
}), Nr = m.object({
|
|
1683
|
+
id: m.string().optional().openapi({
|
|
1684
1684
|
example: "clf9876543210abcdef",
|
|
1685
1685
|
description: "ID of the shipping zone"
|
|
1686
1686
|
}),
|
|
1687
|
-
title:
|
|
1687
|
+
title: m.string().min(1, "Title is required").openapi({
|
|
1688
1688
|
example: "Zone 1",
|
|
1689
1689
|
description: "Title of the shipping zone"
|
|
1690
1690
|
}),
|
|
@@ -1700,36 +1700,36 @@ const Eo = g.object({
|
|
|
1700
1700
|
example: 50,
|
|
1701
1701
|
description: "Minimum order amount for this shipping zone"
|
|
1702
1702
|
}),
|
|
1703
|
-
eta:
|
|
1703
|
+
eta: m.string().min(1, "ETA is required").openapi({
|
|
1704
1704
|
example: "2-3 days",
|
|
1705
1705
|
description: "Estimated time of arrival for this shipping zone"
|
|
1706
1706
|
})
|
|
1707
|
-
}).openapi("ShippingZone"), Bs =
|
|
1708
|
-
id:
|
|
1707
|
+
}).openapi("ShippingZone"), Bs = m.object({
|
|
1708
|
+
id: m.string().openapi({
|
|
1709
1709
|
example: "clf9876543210abcdef",
|
|
1710
1710
|
description: "ID of the shipping method"
|
|
1711
1711
|
}),
|
|
1712
|
-
title:
|
|
1712
|
+
title: m.string().min(1, "Title is required").openapi({
|
|
1713
1713
|
example: "Standard Shipping",
|
|
1714
1714
|
description: "Title of the shipping method"
|
|
1715
1715
|
}),
|
|
1716
|
-
providerName:
|
|
1716
|
+
providerName: m.string().min(1, "Provider name is required").openapi({
|
|
1717
1717
|
example: "FedEx",
|
|
1718
1718
|
description: "Name of the shipping provider"
|
|
1719
1719
|
}),
|
|
1720
1720
|
providerLogo: Fe.nullable().optional().openapi({
|
|
1721
1721
|
description: "Logo of the shipping provider"
|
|
1722
1722
|
}),
|
|
1723
|
-
requireDateOfDelivery:
|
|
1723
|
+
requireDateOfDelivery: m.coerce.boolean().optional().openapi({
|
|
1724
1724
|
example: !0,
|
|
1725
1725
|
description: "Whether the delivery time should be selected"
|
|
1726
1726
|
}),
|
|
1727
|
-
shippingZones:
|
|
1727
|
+
shippingZones: m.array(Nr).openapi({
|
|
1728
1728
|
description: "List of shipping zones for this shipping method"
|
|
1729
1729
|
}),
|
|
1730
1730
|
eligibleShippingZone: Nr.optional(),
|
|
1731
|
-
createdAt:
|
|
1732
|
-
updatedAt:
|
|
1731
|
+
createdAt: m.date(),
|
|
1732
|
+
updatedAt: m.date()
|
|
1733
1733
|
}).openapi("ShippingMethod"), Js = Bs.pick({
|
|
1734
1734
|
title: !0,
|
|
1735
1735
|
providerName: !0,
|
|
@@ -1737,11 +1737,11 @@ const Eo = g.object({
|
|
|
1737
1737
|
requireDateOfDelivery: !0,
|
|
1738
1738
|
shippingZones: !0
|
|
1739
1739
|
}).extend({
|
|
1740
|
-
providerLogoId:
|
|
1740
|
+
providerLogoId: m.string().cuid().optional().openapi({
|
|
1741
1741
|
example: "clf9876543210abcdef",
|
|
1742
1742
|
description: "ID reference to the provider logo file"
|
|
1743
1743
|
})
|
|
1744
|
-
}).openapi("CreateShippingMethod"), Do = Js.partial().openapi("UpdateShippingMethod"), Os =
|
|
1744
|
+
}).openapi("CreateShippingMethod"), Do = Js.partial().openapi("UpdateShippingMethod"), Os = m.enum(["delivery", "pickup"]), zo = m.enum([
|
|
1745
1745
|
"draft",
|
|
1746
1746
|
"pending",
|
|
1747
1747
|
"accepted",
|
|
@@ -1752,18 +1752,18 @@ const Eo = g.object({
|
|
|
1752
1752
|
]).openapi({
|
|
1753
1753
|
description: "Status of the order",
|
|
1754
1754
|
example: "accepted"
|
|
1755
|
-
}), Mo =
|
|
1756
|
-
translations:
|
|
1757
|
-
|
|
1755
|
+
}), Mo = m.object({
|
|
1756
|
+
translations: m.array(
|
|
1757
|
+
m.object({
|
|
1758
1758
|
locale: Be.openapi({
|
|
1759
1759
|
description: "Locale of the translation",
|
|
1760
1760
|
example: "en-US"
|
|
1761
1761
|
}),
|
|
1762
|
-
title:
|
|
1762
|
+
title: m.string().openapi({
|
|
1763
1763
|
description: "Title of the ordered product",
|
|
1764
1764
|
example: "Premium Watch"
|
|
1765
1765
|
}),
|
|
1766
|
-
subtitle:
|
|
1766
|
+
subtitle: m.string().openapi({
|
|
1767
1767
|
description: "Additional details about the ordered item, including modifiers",
|
|
1768
1768
|
example: "Color: Silver, Size: Large"
|
|
1769
1769
|
})
|
|
@@ -1772,66 +1772,66 @@ const Eo = g.object({
|
|
|
1772
1772
|
description: "Translations for the order item"
|
|
1773
1773
|
}),
|
|
1774
1774
|
rawData: Ds,
|
|
1775
|
-
unitPrice:
|
|
1775
|
+
unitPrice: m.number().min(0).openapi({
|
|
1776
1776
|
description: "Price per unit of the item",
|
|
1777
1777
|
example: 299.99
|
|
1778
1778
|
}),
|
|
1779
1779
|
image: Fe.nullable().optional(),
|
|
1780
|
-
totalPrice:
|
|
1780
|
+
totalPrice: m.number().min(0).openapi({
|
|
1781
1781
|
description: "Total price for this item (unitPrice × quantity)",
|
|
1782
1782
|
example: 599.98
|
|
1783
1783
|
}),
|
|
1784
|
-
quantity:
|
|
1784
|
+
quantity: m.number().min(1).openapi({
|
|
1785
1785
|
description: "Number of units ordered",
|
|
1786
1786
|
example: 2
|
|
1787
1787
|
}),
|
|
1788
|
-
productSnapshotId:
|
|
1788
|
+
productSnapshotId: m.string().cuid()
|
|
1789
1789
|
}).openapi("OrderItem");
|
|
1790
|
-
|
|
1791
|
-
id:
|
|
1790
|
+
m.object({
|
|
1791
|
+
id: m.string().openapi({
|
|
1792
1792
|
description: "Unique identifier for the order",
|
|
1793
1793
|
example: "clj1234567890abcdef"
|
|
1794
1794
|
}),
|
|
1795
|
-
referenceId:
|
|
1795
|
+
referenceId: m.string().openapi({
|
|
1796
1796
|
description: "External reference ID for the order",
|
|
1797
1797
|
example: "ORD-12345"
|
|
1798
1798
|
}),
|
|
1799
1799
|
status: zo.optional(),
|
|
1800
|
-
token:
|
|
1800
|
+
token: m.string().openapi({
|
|
1801
1801
|
description: "Security token for order verification",
|
|
1802
1802
|
example: "a1b2c3d4e5f6g7h8i9j0"
|
|
1803
1803
|
}),
|
|
1804
|
-
expiresAt:
|
|
1804
|
+
expiresAt: m.date().openapi({
|
|
1805
1805
|
description: "Expiration date for the order",
|
|
1806
1806
|
example: "2023-12-31T23:59:59Z"
|
|
1807
1807
|
}),
|
|
1808
|
-
items:
|
|
1808
|
+
items: m.array(Mo).min(1).openapi({
|
|
1809
1809
|
description: "Array of items in the order"
|
|
1810
1810
|
}),
|
|
1811
1811
|
shippingMethod: Bs.nullable().openapi({
|
|
1812
1812
|
description: "Shipping method selected for the order"
|
|
1813
1813
|
}),
|
|
1814
|
-
acceptedAt:
|
|
1814
|
+
acceptedAt: m.date().nullable().optional().openapi({
|
|
1815
1815
|
description: "Date when the order was accepted",
|
|
1816
1816
|
example: "2023-06-15T14:30:00Z"
|
|
1817
1817
|
}),
|
|
1818
|
-
dispatchedAt:
|
|
1818
|
+
dispatchedAt: m.date().nullable().optional().openapi({
|
|
1819
1819
|
description: "Date when the order was dispatched",
|
|
1820
1820
|
example: "2023-06-16T09:15:00Z"
|
|
1821
1821
|
}),
|
|
1822
|
-
readyForDispatchAt:
|
|
1822
|
+
readyForDispatchAt: m.date().nullable().optional().openapi({
|
|
1823
1823
|
description: "Date when the order was ready for dispatch",
|
|
1824
1824
|
example: "2023-06-16T09:15:00Z"
|
|
1825
1825
|
}),
|
|
1826
|
-
createdAt:
|
|
1826
|
+
createdAt: m.date().openapi({
|
|
1827
1827
|
description: "Date when the order was created",
|
|
1828
1828
|
example: "2023-06-15T14:30:00Z"
|
|
1829
1829
|
}),
|
|
1830
|
-
completedAt:
|
|
1830
|
+
completedAt: m.date().nullable().optional().openapi({
|
|
1831
1831
|
description: "Date when the order was completed",
|
|
1832
1832
|
example: "2023-06-18T11:45:00Z"
|
|
1833
1833
|
}),
|
|
1834
|
-
cancelledAt:
|
|
1834
|
+
cancelledAt: m.date().nullable().optional().openapi({
|
|
1835
1835
|
description: "Date when the order was cancelled",
|
|
1836
1836
|
example: "2023-06-14T16:20:00Z"
|
|
1837
1837
|
}),
|
|
@@ -1854,11 +1854,11 @@ g.object({
|
|
|
1854
1854
|
}).openapi("Order");
|
|
1855
1855
|
To.extend({
|
|
1856
1856
|
fulfilmentMethod: Os.default("delivery"),
|
|
1857
|
-
payment:
|
|
1857
|
+
payment: m.object({
|
|
1858
1858
|
provider: Oa,
|
|
1859
1859
|
method: Ja
|
|
1860
1860
|
}),
|
|
1861
|
-
checkoutBaseUrl:
|
|
1861
|
+
checkoutBaseUrl: m.string().url()
|
|
1862
1862
|
}).refine(
|
|
1863
1863
|
(t) => t.fulfilmentMethod !== "delivery" || t.shippingMethodId !== void 0,
|
|
1864
1864
|
{
|
|
@@ -1866,83 +1866,83 @@ To.extend({
|
|
|
1866
1866
|
path: ["shippingMethodId"]
|
|
1867
1867
|
}
|
|
1868
1868
|
).openapi("CreateOrder");
|
|
1869
|
-
const Rr =
|
|
1870
|
-
monday:
|
|
1869
|
+
const Rr = m.object({
|
|
1870
|
+
monday: m.string().nullable().openapi({
|
|
1871
1871
|
example: "09:00",
|
|
1872
1872
|
description: "Opening time for Monday"
|
|
1873
1873
|
}),
|
|
1874
|
-
tuesday:
|
|
1874
|
+
tuesday: m.string().nullable().openapi({
|
|
1875
1875
|
example: "09:00",
|
|
1876
1876
|
description: "Opening time for Tuesday"
|
|
1877
1877
|
}),
|
|
1878
|
-
wednesday:
|
|
1878
|
+
wednesday: m.string().nullable().openapi({
|
|
1879
1879
|
example: "09:00",
|
|
1880
1880
|
description: "Opening time for Wednesday"
|
|
1881
1881
|
}),
|
|
1882
|
-
thursday:
|
|
1882
|
+
thursday: m.string().nullable().openapi({
|
|
1883
1883
|
example: "09:00",
|
|
1884
1884
|
description: "Opening time for Thursday"
|
|
1885
1885
|
}),
|
|
1886
|
-
friday:
|
|
1886
|
+
friday: m.string().nullable().openapi({
|
|
1887
1887
|
example: "09:00",
|
|
1888
1888
|
description: "Opening time for Friday"
|
|
1889
1889
|
}),
|
|
1890
|
-
saturday:
|
|
1890
|
+
saturday: m.string().nullable().openapi({
|
|
1891
1891
|
example: "09:00",
|
|
1892
1892
|
description: "Opening time for Saturday"
|
|
1893
1893
|
}),
|
|
1894
|
-
sunday:
|
|
1894
|
+
sunday: m.string().nullable().openapi({
|
|
1895
1895
|
example: "09:00",
|
|
1896
1896
|
description: "Opening time for Sunday"
|
|
1897
1897
|
})
|
|
1898
|
-
}).openapi("TimeSchedule"), Fs =
|
|
1899
|
-
id:
|
|
1898
|
+
}).openapi("TimeSchedule"), Fs = m.object({
|
|
1899
|
+
id: m.string().openapi({
|
|
1900
1900
|
example: "clm1234567890abcdef",
|
|
1901
1901
|
description: "Unique identifier for the organization configuration"
|
|
1902
1902
|
}),
|
|
1903
|
-
hostname:
|
|
1903
|
+
hostname: m.coerce.string().optional().openapi({
|
|
1904
1904
|
example: "store.example.com",
|
|
1905
1905
|
description: "Hostname associated with the organization"
|
|
1906
1906
|
}),
|
|
1907
|
-
countriesShipping:
|
|
1907
|
+
countriesShipping: m.array(m.string()).openapi({
|
|
1908
1908
|
example: ["US", "CA"],
|
|
1909
1909
|
description: "List of countries where shipping is available"
|
|
1910
1910
|
}),
|
|
1911
|
-
stripeAccountId:
|
|
1911
|
+
stripeAccountId: m.coerce.string().optional().openapi({
|
|
1912
1912
|
example: "acct_123456789",
|
|
1913
1913
|
description: "Stripe account ID associated with the organization"
|
|
1914
1914
|
}),
|
|
1915
|
-
enableHostCheckout:
|
|
1915
|
+
enableHostCheckout: m.boolean().openapi({
|
|
1916
1916
|
example: !0,
|
|
1917
1917
|
description: "Indicates if host checkout is enabled"
|
|
1918
1918
|
}),
|
|
1919
|
-
enableHostTracking:
|
|
1919
|
+
enableHostTracking: m.boolean().openapi({
|
|
1920
1920
|
example: !0,
|
|
1921
1921
|
description: "Indicates if host tracking is enabled"
|
|
1922
1922
|
}),
|
|
1923
|
-
isAcceptingOrders:
|
|
1923
|
+
isAcceptingOrders: m.boolean().openapi({
|
|
1924
1924
|
example: !0,
|
|
1925
1925
|
description: "Indicates if the organization is currently accepting orders"
|
|
1926
1926
|
}),
|
|
1927
|
-
isOpen:
|
|
1927
|
+
isOpen: m.boolean().default(!1).openapi({
|
|
1928
1928
|
example: !0,
|
|
1929
1929
|
description: "Indicates if the organization is currently open"
|
|
1930
1930
|
}),
|
|
1931
1931
|
defaultLocale: Be,
|
|
1932
|
-
supportedLocales:
|
|
1932
|
+
supportedLocales: m.array(Be).openapi({
|
|
1933
1933
|
description: "List of supported locales for the organization"
|
|
1934
1934
|
}),
|
|
1935
1935
|
openingTimes: Rr.optional(),
|
|
1936
1936
|
closingTimes: Rr.optional(),
|
|
1937
|
-
facebookProfile:
|
|
1937
|
+
facebookProfile: m.string().nullable().optional().openapi({
|
|
1938
1938
|
example: "https://www.facebook.com/example",
|
|
1939
1939
|
description: "Facebook profile URL for the organization"
|
|
1940
1940
|
}),
|
|
1941
|
-
instagramProfile:
|
|
1941
|
+
instagramProfile: m.string().nullable().optional().openapi({
|
|
1942
1942
|
example: "https://www.instagram.com/example",
|
|
1943
1943
|
description: "Instagram profile URL for the organization"
|
|
1944
1944
|
}),
|
|
1945
|
-
xProfile:
|
|
1945
|
+
xProfile: m.string().nullable().optional().openapi({
|
|
1946
1946
|
example: "https://www.x.com/example",
|
|
1947
1947
|
description: "X profile URL for the organization"
|
|
1948
1948
|
}),
|
|
@@ -1950,7 +1950,7 @@ const Rr = g.object({
|
|
|
1950
1950
|
example: "USD",
|
|
1951
1951
|
description: "Default currency for the organization"
|
|
1952
1952
|
}),
|
|
1953
|
-
createdAt:
|
|
1953
|
+
createdAt: m.date().openapi({
|
|
1954
1954
|
description: "Timestamp when the organization configuration was created"
|
|
1955
1955
|
})
|
|
1956
1956
|
}).openapi("OrganizationConfiguration"), Bo = Fs.pick({
|
|
@@ -1968,28 +1968,28 @@ const Rr = g.object({
|
|
|
1968
1968
|
facebookProfile: !0,
|
|
1969
1969
|
instagramProfile: !0,
|
|
1970
1970
|
xProfile: !0
|
|
1971
|
-
}).partial().openapi("UpdateOrganizationConfiguration"), Jo =
|
|
1972
|
-
id:
|
|
1971
|
+
}).partial().openapi("UpdateOrganizationConfiguration"), Jo = m.object({
|
|
1972
|
+
id: m.string().openapi({
|
|
1973
1973
|
example: "clm1234567890abcdef",
|
|
1974
1974
|
description: "The unique identifier of the organization"
|
|
1975
1975
|
}),
|
|
1976
|
-
name:
|
|
1976
|
+
name: m.string().openapi({
|
|
1977
1977
|
example: "Acme Store",
|
|
1978
1978
|
description: "The name of the organization"
|
|
1979
1979
|
}),
|
|
1980
|
-
phone:
|
|
1980
|
+
phone: m.string().min(1, "Phone number is required").openapi({
|
|
1981
1981
|
example: "+48123456890",
|
|
1982
1982
|
description: "The phone number of the organization"
|
|
1983
1983
|
}),
|
|
1984
|
-
email:
|
|
1984
|
+
email: m.string().email().optional().openapi({
|
|
1985
1985
|
example: "john.doe@example.com",
|
|
1986
1986
|
description: "The email address of the organization"
|
|
1987
1987
|
}),
|
|
1988
|
-
createdAt:
|
|
1988
|
+
createdAt: m.date().openapi({
|
|
1989
1989
|
example: "2022-01-01T00:00:00.000Z",
|
|
1990
1990
|
description: "The date and time the organization was created"
|
|
1991
1991
|
}),
|
|
1992
|
-
legalEntityId:
|
|
1992
|
+
legalEntityId: m.string().nullable().openapi({
|
|
1993
1993
|
example: "clm1234567890abcdef",
|
|
1994
1994
|
description: "The unique identifier of the legal entity associated with the organization"
|
|
1995
1995
|
}),
|
|
@@ -1997,7 +1997,7 @@ const Rr = g.object({
|
|
|
1997
1997
|
configuration: Fs.openapi({
|
|
1998
1998
|
description: "The configuration settings for the organization"
|
|
1999
1999
|
}),
|
|
2000
|
-
logo:
|
|
2000
|
+
logo: m.string().url().optional().nullable().openapi({
|
|
2001
2001
|
example: "https://example.com/logo.jpg",
|
|
2002
2002
|
description: "The logo of the organization"
|
|
2003
2003
|
}),
|
|
@@ -2010,7 +2010,7 @@ const Rr = g.object({
|
|
|
2010
2010
|
email: !0,
|
|
2011
2011
|
logoFile: !0
|
|
2012
2012
|
}).extend({
|
|
2013
|
-
logoId:
|
|
2013
|
+
logoId: m.string().optional().nullable().openapi({
|
|
2014
2014
|
example: "clm1234567890abcdef",
|
|
2015
2015
|
description: "The unique identifier of the thumbnail image associated with the organization"
|
|
2016
2016
|
}),
|
|
@@ -2018,24 +2018,24 @@ const Rr = g.object({
|
|
|
2018
2018
|
}).openapi("CreateOrganization"), Fa = js.extend({
|
|
2019
2019
|
address: zs,
|
|
2020
2020
|
configuration: Bo
|
|
2021
|
-
}).partial().openapi("UpdateOrganization"), Oo =
|
|
2022
|
-
id:
|
|
2021
|
+
}).partial().openapi("UpdateOrganization"), Oo = m.object({
|
|
2022
|
+
id: m.string().openapi({
|
|
2023
2023
|
example: "clf9876543210abcdef",
|
|
2024
2024
|
description: "ID of the manufacturer"
|
|
2025
2025
|
}),
|
|
2026
|
-
name:
|
|
2026
|
+
name: m.string().openapi({
|
|
2027
2027
|
example: "Tech Innovators Inc.",
|
|
2028
2028
|
description: "Name of the manufacturer"
|
|
2029
2029
|
}),
|
|
2030
2030
|
logo: Fe.nullable().optional().openapi({ description: "Logo of the manufacturer" }),
|
|
2031
|
-
createdAt:
|
|
2032
|
-
translations:
|
|
2033
|
-
|
|
2034
|
-
locale:
|
|
2031
|
+
createdAt: m.date(),
|
|
2032
|
+
translations: m.array(
|
|
2033
|
+
m.object({
|
|
2034
|
+
locale: m.string().min(1, "Locale is required").openapi({
|
|
2035
2035
|
example: "en-US",
|
|
2036
2036
|
description: "Locale code for the translation"
|
|
2037
2037
|
}),
|
|
2038
|
-
about:
|
|
2038
|
+
about: m.string().max(6e3, "Maximum character limit is 6000").nullable().optional().openapi({
|
|
2039
2039
|
example: "Tech Innovators Inc. is a technology company.",
|
|
2040
2040
|
description: "Description about the manufacturer in the specified locale"
|
|
2041
2041
|
})
|
|
@@ -2047,27 +2047,27 @@ const Rr = g.object({
|
|
|
2047
2047
|
Oo.omit({
|
|
2048
2048
|
translations: !0
|
|
2049
2049
|
}).extend({
|
|
2050
|
-
about:
|
|
2050
|
+
about: m.string().nullable().optional().default("")
|
|
2051
2051
|
}).openapi("LocalizedManufacturer");
|
|
2052
|
-
const Fo =
|
|
2053
|
-
name:
|
|
2052
|
+
const Fo = m.object({
|
|
2053
|
+
name: m.string().min(1, "Name is required").openapi({
|
|
2054
2054
|
example: "Apple Inc.",
|
|
2055
2055
|
description: "Name of the manufacturer"
|
|
2056
2056
|
}),
|
|
2057
|
-
defaultLocale:
|
|
2057
|
+
defaultLocale: m.string().min(1, "Default locale is required").openapi({
|
|
2058
2058
|
example: "en-US",
|
|
2059
2059
|
description: "The default locale for the manufacturer"
|
|
2060
2060
|
}),
|
|
2061
2061
|
logo: Fe.nullable().optional().openapi({
|
|
2062
2062
|
description: "Logo of the manufacturer"
|
|
2063
2063
|
}),
|
|
2064
|
-
translations:
|
|
2065
|
-
|
|
2066
|
-
locale:
|
|
2064
|
+
translations: m.array(
|
|
2065
|
+
m.object({
|
|
2066
|
+
locale: m.string().min(1, "Locale is required").openapi({
|
|
2067
2067
|
example: "en-US",
|
|
2068
2068
|
description: "Locale code for the translation"
|
|
2069
2069
|
}),
|
|
2070
|
-
about:
|
|
2070
|
+
about: m.string().max(6e3, "Maximum character limit is 6000").nullable().optional().openapi({
|
|
2071
2071
|
example: "Apple Inc. is a multinational technology company.",
|
|
2072
2072
|
description: "Description about the manufacturer in the specified locale"
|
|
2073
2073
|
})
|
|
@@ -2075,32 +2075,32 @@ const Fo = g.object({
|
|
|
2075
2075
|
).min(1, "Translations are required").openapi({
|
|
2076
2076
|
description: "List of translations for the manufacturer"
|
|
2077
2077
|
}),
|
|
2078
|
-
logoId:
|
|
2078
|
+
logoId: m.string().optional().openapi({
|
|
2079
2079
|
example: "clf9876543210abcdef",
|
|
2080
2080
|
description: "ID reference to the manufacturer's logo file"
|
|
2081
2081
|
})
|
|
2082
|
-
}).superRefine(nt("about")).openapi("CreateManufacturer"), jo =
|
|
2083
|
-
name:
|
|
2082
|
+
}).superRefine(nt("about")).openapi("CreateManufacturer"), jo = m.object({
|
|
2083
|
+
name: m.string().min(1, "Name is required").optional().openapi({
|
|
2084
2084
|
example: "Apple Inc. Updated",
|
|
2085
2085
|
description: "Name of the manufacturer"
|
|
2086
2086
|
}),
|
|
2087
2087
|
logo: Fe.nullable().optional().openapi({
|
|
2088
2088
|
description: "Logo of the manufacturer"
|
|
2089
2089
|
}),
|
|
2090
|
-
defaultLocale:
|
|
2090
|
+
defaultLocale: m.string().min(1, "Default locale is required").openapi({
|
|
2091
2091
|
description: "The default locale for the manufacturer"
|
|
2092
2092
|
}),
|
|
2093
|
-
logoId:
|
|
2093
|
+
logoId: m.string().nullable().optional().openapi({
|
|
2094
2094
|
example: "clf9876543210abcdef",
|
|
2095
2095
|
description: "ID reference to the manufacturer's logo file"
|
|
2096
2096
|
}),
|
|
2097
|
-
translations:
|
|
2098
|
-
|
|
2099
|
-
locale:
|
|
2097
|
+
translations: m.array(
|
|
2098
|
+
m.object({
|
|
2099
|
+
locale: m.string().min(1, "Locale is required").openapi({
|
|
2100
2100
|
example: "en-US",
|
|
2101
2101
|
description: "Locale code for the translation"
|
|
2102
2102
|
}),
|
|
2103
|
-
about:
|
|
2103
|
+
about: m.string().max(6e3, "Maximum character limit is 6000").nullable().optional().openapi({
|
|
2104
2104
|
example: "Apple Inc. is a multinational technology company.",
|
|
2105
2105
|
description: "Description about the manufacturer in the specified locale"
|
|
2106
2106
|
})
|
|
@@ -2109,29 +2109,29 @@ const Fo = g.object({
|
|
|
2109
2109
|
description: "List of translations for the manufacturer"
|
|
2110
2110
|
})
|
|
2111
2111
|
}).openapi("UpdateManufacturer");
|
|
2112
|
-
|
|
2113
|
-
id:
|
|
2112
|
+
m.object({
|
|
2113
|
+
id: m.string().openapi({
|
|
2114
2114
|
example: "clm1234567890abcdef",
|
|
2115
2115
|
description: "The unique identifier of the legal entity"
|
|
2116
2116
|
}),
|
|
2117
|
-
name:
|
|
2117
|
+
name: m.string().openapi({
|
|
2118
2118
|
example: "Acme Corporation",
|
|
2119
2119
|
description: "The name of the legal entity"
|
|
2120
2120
|
}),
|
|
2121
|
-
taxId:
|
|
2121
|
+
taxId: m.string().min(2).max(20).openapi({
|
|
2122
2122
|
example: "PL1234567890",
|
|
2123
2123
|
description: "The TAX ID of the legal entity"
|
|
2124
2124
|
}),
|
|
2125
|
-
email:
|
|
2125
|
+
email: m.string().email().nullable().openapi({
|
|
2126
2126
|
example: "contact@acme.com",
|
|
2127
2127
|
description: "The email of the legal entity",
|
|
2128
2128
|
format: "email"
|
|
2129
2129
|
}),
|
|
2130
|
-
phone:
|
|
2130
|
+
phone: m.string().nullable().openapi({
|
|
2131
2131
|
example: "+48123456789",
|
|
2132
2132
|
description: "The phone number of the legal entity"
|
|
2133
2133
|
}),
|
|
2134
|
-
createdAt:
|
|
2134
|
+
createdAt: m.date().openapi({
|
|
2135
2135
|
description: "The date and time when the legal entity was created",
|
|
2136
2136
|
format: "date-time"
|
|
2137
2137
|
}),
|
|
@@ -2139,21 +2139,21 @@ g.object({
|
|
|
2139
2139
|
description: "The address of the legal entity"
|
|
2140
2140
|
})
|
|
2141
2141
|
}).openapi("LegalEntity");
|
|
2142
|
-
|
|
2143
|
-
name:
|
|
2142
|
+
m.object({
|
|
2143
|
+
name: m.string().min(1, "Name is required").openapi({
|
|
2144
2144
|
example: "Acme Corporation",
|
|
2145
2145
|
description: "The name of the legal entity"
|
|
2146
2146
|
}),
|
|
2147
|
-
taxId:
|
|
2147
|
+
taxId: m.string().min(2).max(20).openapi({
|
|
2148
2148
|
example: "PL1234567890",
|
|
2149
2149
|
description: "The TAX ID of the legal entity"
|
|
2150
2150
|
}),
|
|
2151
|
-
email:
|
|
2151
|
+
email: m.string().email().optional().openapi({
|
|
2152
2152
|
example: "contact@acme.com",
|
|
2153
2153
|
description: "The email of the legal entity",
|
|
2154
2154
|
format: "email"
|
|
2155
2155
|
}),
|
|
2156
|
-
phone:
|
|
2156
|
+
phone: m.string().optional().openapi({
|
|
2157
2157
|
example: "+48123456789",
|
|
2158
2158
|
description: "The phone number of the legal entity"
|
|
2159
2159
|
}),
|
|
@@ -2161,21 +2161,21 @@ g.object({
|
|
|
2161
2161
|
description: "The address of the legal entity"
|
|
2162
2162
|
})
|
|
2163
2163
|
}).openapi("CreateLegalEntity");
|
|
2164
|
-
|
|
2165
|
-
name:
|
|
2164
|
+
m.object({
|
|
2165
|
+
name: m.string().min(1, "Name is required").optional().openapi({
|
|
2166
2166
|
example: "Acme Corporation",
|
|
2167
2167
|
description: "The name of the legal entity"
|
|
2168
2168
|
}),
|
|
2169
|
-
taxId:
|
|
2169
|
+
taxId: m.string().min(2).max(20).openapi({
|
|
2170
2170
|
example: "PL1234567890",
|
|
2171
2171
|
description: "The TAX ID of the legal entity"
|
|
2172
2172
|
}),
|
|
2173
|
-
email:
|
|
2173
|
+
email: m.string().email().optional().openapi({
|
|
2174
2174
|
example: "contact@acme.com",
|
|
2175
2175
|
description: "The email of the legal entity",
|
|
2176
2176
|
format: "email"
|
|
2177
2177
|
}),
|
|
2178
|
-
phone:
|
|
2178
|
+
phone: m.string().optional().openapi({
|
|
2179
2179
|
example: "+48123456789",
|
|
2180
2180
|
description: "The phone number of the legal entity"
|
|
2181
2181
|
}),
|
|
@@ -2183,28 +2183,28 @@ g.object({
|
|
|
2183
2183
|
description: "The address of the legal entity"
|
|
2184
2184
|
})
|
|
2185
2185
|
}).openapi("UpdateLegalEntity");
|
|
2186
|
-
const Vo =
|
|
2187
|
-
id:
|
|
2186
|
+
const Vo = m.object({
|
|
2187
|
+
id: m.string().openapi({
|
|
2188
2188
|
example: "clf9876543210abcdef",
|
|
2189
2189
|
description: "ID of the customer"
|
|
2190
2190
|
}),
|
|
2191
|
-
firstname:
|
|
2191
|
+
firstname: m.string().nullable().optional().openapi({
|
|
2192
2192
|
example: "John Doe",
|
|
2193
2193
|
description: "Name of the customer"
|
|
2194
2194
|
}),
|
|
2195
|
-
email:
|
|
2195
|
+
email: m.string().nullable().optional().openapi({
|
|
2196
2196
|
example: "john.doe@example.com",
|
|
2197
2197
|
description: "Email of the customer"
|
|
2198
2198
|
}),
|
|
2199
|
-
phone:
|
|
2199
|
+
phone: m.string().nullable().optional().openapi({
|
|
2200
2200
|
example: "+1234567890",
|
|
2201
2201
|
description: "Phone number of the customer"
|
|
2202
2202
|
}),
|
|
2203
2203
|
address: ot.nullable().optional().openapi({
|
|
2204
2204
|
description: "Address of the customer"
|
|
2205
2205
|
}),
|
|
2206
|
-
createdAt:
|
|
2207
|
-
updatedAt:
|
|
2206
|
+
createdAt: m.date(),
|
|
2207
|
+
updatedAt: m.date()
|
|
2208
2208
|
}).openapi("Customer"), Ho = Vo.pick({
|
|
2209
2209
|
firstname: !0,
|
|
2210
2210
|
email: !0,
|
|
@@ -2213,117 +2213,117 @@ const Vo = g.object({
|
|
|
2213
2213
|
address: na
|
|
2214
2214
|
}).openapi("Customer");
|
|
2215
2215
|
Ho.partial().openapi("UpdateCustomer");
|
|
2216
|
-
const ja =
|
|
2217
|
-
email:
|
|
2216
|
+
const ja = m.object({
|
|
2217
|
+
email: m.string().min(1, "Email is required").email("Invalid email").openapi({
|
|
2218
2218
|
example: "user@example.com",
|
|
2219
2219
|
description: "User's email address"
|
|
2220
2220
|
}),
|
|
2221
|
-
password:
|
|
2221
|
+
password: m.string().min(1, "Password is required").min(8, "Password must be more than 8 characters").max(32, "Password must be less than 32 characters").openapi({
|
|
2222
2222
|
example: "password123",
|
|
2223
2223
|
description: "User's password"
|
|
2224
2224
|
}),
|
|
2225
|
-
firstname:
|
|
2225
|
+
firstname: m.string().min(1, "First name is required").max(32, "First name must be less than 32 characters").openapi({
|
|
2226
2226
|
example: "John",
|
|
2227
2227
|
description: "User's first name"
|
|
2228
2228
|
}),
|
|
2229
|
-
lastname:
|
|
2229
|
+
lastname: m.string().min(1, "Last name is required").max(32, "Last name must be less than 32 characters").openapi({
|
|
2230
2230
|
example: "Doe",
|
|
2231
2231
|
description: "User's last name"
|
|
2232
2232
|
})
|
|
2233
2233
|
}).openapi("SignUp"), Vs = ja.pick({
|
|
2234
2234
|
email: !0,
|
|
2235
2235
|
password: !0
|
|
2236
|
-
}).openapi("SignIn"), Zo =
|
|
2237
|
-
organizationId:
|
|
2236
|
+
}).openapi("SignIn"), Zo = m.object({
|
|
2237
|
+
organizationId: m.string().cuid().min(1, "organizationId is required").openapi({
|
|
2238
2238
|
example: "ckel0e8qw00004n5p5w6fznym",
|
|
2239
2239
|
description: "The organization ID"
|
|
2240
2240
|
})
|
|
2241
2241
|
}).openapi("OrganizationParams");
|
|
2242
2242
|
Zo.extend({
|
|
2243
|
-
id:
|
|
2243
|
+
id: m.string().cuid().min(1, "id is required").openapi({
|
|
2244
2244
|
example: "ckel0e8qw00004n5p5w6fznym",
|
|
2245
2245
|
description: "The organization ID"
|
|
2246
2246
|
})
|
|
2247
2247
|
}).openapi("OrganizationWithIdParams");
|
|
2248
|
-
|
|
2249
|
-
placeId:
|
|
2248
|
+
m.object({
|
|
2249
|
+
placeId: m.string().openapi({
|
|
2250
2250
|
example: "ChIJN1t_tKlj4AR4GeTYWZ7frY",
|
|
2251
2251
|
description: "The Google Place ID for the address"
|
|
2252
2252
|
}),
|
|
2253
|
-
text:
|
|
2253
|
+
text: m.string().openapi({
|
|
2254
2254
|
example: "123 Main Street, New York, USA",
|
|
2255
2255
|
description: "The description of the place"
|
|
2256
2256
|
}),
|
|
2257
|
-
addressLineOne:
|
|
2257
|
+
addressLineOne: m.string().openapi({
|
|
2258
2258
|
example: "123 Main Street",
|
|
2259
2259
|
description: "The first line of the address"
|
|
2260
2260
|
}),
|
|
2261
|
-
addressLineTwo:
|
|
2261
|
+
addressLineTwo: m.string().optional().openapi({
|
|
2262
2262
|
example: "Suite 100",
|
|
2263
2263
|
description: "The second line of the address"
|
|
2264
2264
|
}),
|
|
2265
|
-
latitude:
|
|
2265
|
+
latitude: m.number().optional().openapi({
|
|
2266
2266
|
example: 40.712776,
|
|
2267
2267
|
description: "The latitude of the coordinate"
|
|
2268
2268
|
}),
|
|
2269
|
-
longitude:
|
|
2269
|
+
longitude: m.number().optional().openapi({
|
|
2270
2270
|
example: -74.005974,
|
|
2271
2271
|
description: "The longitude of the coordinate"
|
|
2272
2272
|
})
|
|
2273
2273
|
}).openapi("Place");
|
|
2274
|
-
|
|
2275
|
-
addressLineOne:
|
|
2274
|
+
m.object({
|
|
2275
|
+
addressLineOne: m.string().openapi({
|
|
2276
2276
|
example: "123 Main Street",
|
|
2277
2277
|
description: "The first line of the address"
|
|
2278
2278
|
}),
|
|
2279
|
-
zipCode:
|
|
2279
|
+
zipCode: m.string().optional().openapi({
|
|
2280
2280
|
example: "12345",
|
|
2281
2281
|
description: "The postal code of the address"
|
|
2282
2282
|
}),
|
|
2283
|
-
city:
|
|
2283
|
+
city: m.string().openapi({
|
|
2284
2284
|
example: "New York",
|
|
2285
2285
|
description: "The city of the address"
|
|
2286
2286
|
}),
|
|
2287
|
-
country:
|
|
2287
|
+
country: m.string().openapi({
|
|
2288
2288
|
example: "USA",
|
|
2289
2289
|
description: "The ISO 3166-1 alpha-2 country code"
|
|
2290
2290
|
})
|
|
2291
2291
|
}).openapi("PlaceDetails");
|
|
2292
|
-
const Uo =
|
|
2293
|
-
id:
|
|
2292
|
+
const Uo = m.object({
|
|
2293
|
+
id: m.string().openapi({
|
|
2294
2294
|
description: "Unique identifier for the order",
|
|
2295
2295
|
example: "clj1234567890abcdef"
|
|
2296
2296
|
}),
|
|
2297
|
-
firstname:
|
|
2297
|
+
firstname: m.string().openapi({
|
|
2298
2298
|
description: "Customer's first name",
|
|
2299
2299
|
example: "John"
|
|
2300
2300
|
}),
|
|
2301
|
-
lastname:
|
|
2301
|
+
lastname: m.string().openapi({
|
|
2302
2302
|
description: "Customer's last name",
|
|
2303
2303
|
example: "Doe"
|
|
2304
2304
|
}),
|
|
2305
2305
|
guests: $t,
|
|
2306
|
-
phone:
|
|
2306
|
+
phone: m.string().openapi({
|
|
2307
2307
|
description: "Customer's phone number",
|
|
2308
2308
|
example: "+1234567890"
|
|
2309
2309
|
}),
|
|
2310
|
-
date:
|
|
2310
|
+
date: m.coerce.date().openapi({
|
|
2311
2311
|
description: "Reservation date and time",
|
|
2312
2312
|
example: "2023-06-14T16:20:00Z"
|
|
2313
2313
|
}),
|
|
2314
|
-
referenceId:
|
|
2314
|
+
referenceId: m.string().openapi({
|
|
2315
2315
|
description: "External reference ID for the order",
|
|
2316
2316
|
example: "ORD-12345"
|
|
2317
2317
|
}),
|
|
2318
|
-
acceptedAt:
|
|
2318
|
+
acceptedAt: m.date().nullable().optional().openapi({
|
|
2319
2319
|
description: "Date when the order was accepted",
|
|
2320
2320
|
example: "2023-06-15T14:30:00Z"
|
|
2321
2321
|
}),
|
|
2322
|
-
cancelledAt:
|
|
2322
|
+
cancelledAt: m.date().nullable().optional().openapi({
|
|
2323
2323
|
description: "Date when the order was cancelled",
|
|
2324
2324
|
example: "2023-06-14T16:20:00Z"
|
|
2325
2325
|
}),
|
|
2326
|
-
createdAt:
|
|
2326
|
+
createdAt: m.date().nullable().optional().openapi({
|
|
2327
2327
|
description: "Date when the order was created",
|
|
2328
2328
|
example: "2023-06-14T16:20:00Z"
|
|
2329
2329
|
})
|
|
@@ -2899,11 +2899,11 @@ const al = ({
|
|
|
2899
2899
|
suffix: d,
|
|
2900
2900
|
...c
|
|
2901
2901
|
}, u) => {
|
|
2902
|
-
const [p,
|
|
2902
|
+
const [p, g] = R.useState(n), h = n === "password" && !o, f = n === "search" && !o, y = n === "textarea" ? "textarea" : "input";
|
|
2903
2903
|
return /* @__PURE__ */ i("div", { className: b("relative w-full", t), children: [
|
|
2904
2904
|
l && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-3 text-slate-600 dark:text-gray-600 z-10 text-sm border-r border-gray-200", children: l }),
|
|
2905
2905
|
/* @__PURE__ */ e(
|
|
2906
|
-
|
|
2906
|
+
y,
|
|
2907
2907
|
{
|
|
2908
2908
|
ref: u,
|
|
2909
2909
|
type: h ? p : n,
|
|
@@ -2932,7 +2932,7 @@ const al = ({
|
|
|
2932
2932
|
!d && h && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3", children: /* @__PURE__ */ e(
|
|
2933
2933
|
"button",
|
|
2934
2934
|
{
|
|
2935
|
-
onClick: () =>
|
|
2935
|
+
onClick: () => g(p === "password" ? "text" : "password"),
|
|
2936
2936
|
className: b(
|
|
2937
2937
|
lt,
|
|
2938
2938
|
"text-gray-400 hover:text-gray-500 dark:text-gray-600"
|
|
@@ -2951,8 +2951,8 @@ const sl = ({ ...t }) => {
|
|
|
2951
2951
|
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-muted-foreground/80 peer-disabled:opacity-50", children: /* @__PURE__ */ e(mn, { size: 16 }) })
|
|
2952
2952
|
] }) });
|
|
2953
2953
|
}, il = (t) => {
|
|
2954
|
-
const { client: a } =
|
|
2955
|
-
const { body:
|
|
2954
|
+
const { client: a } = E(), [r, s] = I(!1), [n, o] = I(0), l = async (p) => {
|
|
2955
|
+
const { body: g, status: h } = await a.file.createTemporaryFile({
|
|
2956
2956
|
body: {
|
|
2957
2957
|
filename: p.name,
|
|
2958
2958
|
mimeType: p.type,
|
|
@@ -2966,22 +2966,22 @@ const sl = ({ ...t }) => {
|
|
|
2966
2966
|
access: "public",
|
|
2967
2967
|
handleUploadUrl: `${process.env.NEXT_PUBLIC_API_BASE_URL}/api/files/token/vercel`,
|
|
2968
2968
|
clientPayload: JSON.stringify({
|
|
2969
|
-
fileId:
|
|
2969
|
+
fileId: g == null ? void 0 : g.id
|
|
2970
2970
|
}),
|
|
2971
|
-
onUploadProgress(
|
|
2972
|
-
o(
|
|
2971
|
+
onUploadProgress(y) {
|
|
2972
|
+
o(y.percentage);
|
|
2973
2973
|
}
|
|
2974
2974
|
});
|
|
2975
2975
|
return {
|
|
2976
|
-
id:
|
|
2976
|
+
id: g.id,
|
|
2977
2977
|
filename: p.name,
|
|
2978
2978
|
mimeType: p.type,
|
|
2979
2979
|
size: p.size,
|
|
2980
2980
|
url: f.url
|
|
2981
2981
|
};
|
|
2982
2982
|
}, d = async (p) => {
|
|
2983
|
-
var
|
|
2984
|
-
if ((
|
|
2983
|
+
var g;
|
|
2984
|
+
if ((g = p.target.files) != null && g[0]) {
|
|
2985
2985
|
s(!0);
|
|
2986
2986
|
try {
|
|
2987
2987
|
const h = await l(p.target.files[0]);
|
|
@@ -3000,8 +3000,8 @@ const sl = ({ ...t }) => {
|
|
|
3000
3000
|
if (t.multiple) {
|
|
3001
3001
|
if (!t.value)
|
|
3002
3002
|
return t.onChange(void 0);
|
|
3003
|
-
const
|
|
3004
|
-
t.onChange(
|
|
3003
|
+
const g = t.value.filter((h) => h.id !== p);
|
|
3004
|
+
t.onChange(g.length ? g : void 0);
|
|
3005
3005
|
} else
|
|
3006
3006
|
t.onChange(void 0);
|
|
3007
3007
|
};
|
|
@@ -3009,7 +3009,7 @@ const sl = ({ ...t }) => {
|
|
|
3009
3009
|
if (t.value) {
|
|
3010
3010
|
const p = t.multiple ? t.value : [t.value];
|
|
3011
3011
|
return /* @__PURE__ */ i("div", { className: "flex", children: [
|
|
3012
|
-
p.map((
|
|
3012
|
+
p.map((g) => /* @__PURE__ */ e(
|
|
3013
3013
|
"div",
|
|
3014
3014
|
{
|
|
3015
3015
|
className: "flex flex-col w-40 h-40 mr-3 transition-all rounded-lg relative animate-fade",
|
|
@@ -3018,15 +3018,15 @@ const sl = ({ ...t }) => {
|
|
|
3018
3018
|
"button",
|
|
3019
3019
|
{
|
|
3020
3020
|
className: "absolute w-6 h-6 bg-black flex items-center justify-center rounded-md right-1 top-1",
|
|
3021
|
-
onClick: () => c(
|
|
3021
|
+
onClick: () => c(g.id),
|
|
3022
3022
|
children: /* @__PURE__ */ e(qt, { className: "w-4 h-4 text-white" })
|
|
3023
3023
|
}
|
|
3024
3024
|
),
|
|
3025
3025
|
/* @__PURE__ */ e(
|
|
3026
3026
|
xe,
|
|
3027
3027
|
{
|
|
3028
|
-
src:
|
|
3029
|
-
alt:
|
|
3028
|
+
src: g.url,
|
|
3029
|
+
alt: g.filename,
|
|
3030
3030
|
width: 160,
|
|
3031
3031
|
height: 160,
|
|
3032
3032
|
className: "w-40 h-40 rounded-md object-cover"
|
|
@@ -3034,7 +3034,7 @@ const sl = ({ ...t }) => {
|
|
|
3034
3034
|
)
|
|
3035
3035
|
] })
|
|
3036
3036
|
},
|
|
3037
|
-
|
|
3037
|
+
g.id
|
|
3038
3038
|
)),
|
|
3039
3039
|
t.multiple && /* @__PURE__ */ i(
|
|
3040
3040
|
"div",
|
|
@@ -3116,15 +3116,15 @@ const sl = ({ ...t }) => {
|
|
|
3116
3116
|
onChange: a,
|
|
3117
3117
|
placeholder: r = "Search for a place"
|
|
3118
3118
|
}) => {
|
|
3119
|
-
const { client: s } =
|
|
3119
|
+
const { client: s } = E(), n = Ee(), [o, l] = I(!1), [d, c] = I(""), [u, p] = I(
|
|
3120
3120
|
null
|
|
3121
|
-
),
|
|
3121
|
+
), g = Rn(null), [h] = Ge(d, 300);
|
|
3122
3122
|
K(() => {
|
|
3123
3123
|
t && (u == null ? void 0 : u.text) !== t && c(t);
|
|
3124
3124
|
}, [t, u]);
|
|
3125
3125
|
const {
|
|
3126
3126
|
data: f = [],
|
|
3127
|
-
error:
|
|
3127
|
+
error: y,
|
|
3128
3128
|
isLoading: x
|
|
3129
3129
|
} = q({
|
|
3130
3130
|
queryKey: ["autocomplete", h],
|
|
@@ -3142,7 +3142,7 @@ const sl = ({ ...t }) => {
|
|
|
3142
3142
|
enabled: h.length >= 2,
|
|
3143
3143
|
refetchOnWindowFocus: !1
|
|
3144
3144
|
// Don't refetch on window focus
|
|
3145
|
-
}),
|
|
3145
|
+
}), w = (S) => {
|
|
3146
3146
|
p(S), c(S.text);
|
|
3147
3147
|
const k = {
|
|
3148
3148
|
placeId: S.placeId,
|
|
@@ -3153,7 +3153,7 @@ const sl = ({ ...t }) => {
|
|
|
3153
3153
|
a(k), l(!1);
|
|
3154
3154
|
};
|
|
3155
3155
|
return K(() => {
|
|
3156
|
-
o &&
|
|
3156
|
+
o && g.current && g.current.focus();
|
|
3157
3157
|
}, [o]), /* @__PURE__ */ i("div", { className: "mt-2 relative", children: [
|
|
3158
3158
|
/* @__PURE__ */ i(vt, { open: o, onOpenChange: l, children: [
|
|
3159
3159
|
/* @__PURE__ */ e(Nt, { asChild: !0, children: /* @__PURE__ */ i(
|
|
@@ -3190,7 +3190,7 @@ const sl = ({ ...t }) => {
|
|
|
3190
3190
|
/* @__PURE__ */ e(
|
|
3191
3191
|
"input",
|
|
3192
3192
|
{
|
|
3193
|
-
ref:
|
|
3193
|
+
ref: g,
|
|
3194
3194
|
placeholder: "Search places...",
|
|
3195
3195
|
className: "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
3196
3196
|
value: d,
|
|
@@ -3217,7 +3217,7 @@ const sl = ({ ...t }) => {
|
|
|
3217
3217
|
"div",
|
|
3218
3218
|
{
|
|
3219
3219
|
className: "relative flex cursor-pointer select-none items-center rounded-xs px-2 py-2 text-sm outline-hidden hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
3220
|
-
onClick: () =>
|
|
3220
|
+
onClick: () => w(S),
|
|
3221
3221
|
children: [
|
|
3222
3222
|
/* @__PURE__ */ i("div", { className: "flex flex-col grow", children: [
|
|
3223
3223
|
/* @__PURE__ */ e("span", { children: S.addressLineOne || S.text }),
|
|
@@ -3234,9 +3234,9 @@ const sl = ({ ...t }) => {
|
|
|
3234
3234
|
}
|
|
3235
3235
|
)
|
|
3236
3236
|
] }),
|
|
3237
|
-
|
|
3237
|
+
y && /* @__PURE__ */ i("p", { className: "text-xs text-red-500 mt-1", children: [
|
|
3238
3238
|
"Error fetching results: ",
|
|
3239
|
-
|
|
3239
|
+
y.message
|
|
3240
3240
|
] })
|
|
3241
3241
|
] });
|
|
3242
3242
|
}, _s = Yr(
|
|
@@ -3313,15 +3313,15 @@ const nl = ({
|
|
|
3313
3313
|
placeholder: n
|
|
3314
3314
|
}) => {
|
|
3315
3315
|
var p;
|
|
3316
|
-
const o = Ee(), [l, d] = I(!1), c = (
|
|
3316
|
+
const o = Ee(), [l, d] = I(!1), c = (g) => {
|
|
3317
3317
|
if (s) {
|
|
3318
3318
|
let h;
|
|
3319
|
-
Array.isArray(a) && a.includes(
|
|
3319
|
+
Array.isArray(a) && a.includes(g) ? h = a.filter((f) => f !== g) : h = Array.isArray(a) ? [...a, g] : [g], r(h);
|
|
3320
3320
|
} else
|
|
3321
|
-
r(
|
|
3322
|
-
}, u = (
|
|
3321
|
+
r(g), d(!1);
|
|
3322
|
+
}, u = (g) => {
|
|
3323
3323
|
if (s && Array.isArray(a)) {
|
|
3324
|
-
const h = a.filter((f) => f !==
|
|
3324
|
+
const h = a.filter((f) => f !== g);
|
|
3325
3325
|
r(h);
|
|
3326
3326
|
}
|
|
3327
3327
|
};
|
|
@@ -3335,9 +3335,9 @@ const nl = ({
|
|
|
3335
3335
|
variant: "secondary",
|
|
3336
3336
|
className: "w-full justify-between shadow-2xs! bg-background px-2! py-1 min-h-[41.6px] font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20",
|
|
3337
3337
|
children: [
|
|
3338
|
-
(a == null ? void 0 : a.length) > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: Array.isArray(a) ? a.map((
|
|
3338
|
+
(a == null ? void 0 : a.length) > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: Array.isArray(a) ? a.map((g) => {
|
|
3339
3339
|
const h = t.find(
|
|
3340
|
-
(f) => f.value ===
|
|
3340
|
+
(f) => f.value === g
|
|
3341
3341
|
);
|
|
3342
3342
|
return h ? /* @__PURE__ */ i(
|
|
3343
3343
|
"span",
|
|
@@ -3350,16 +3350,16 @@ const nl = ({
|
|
|
3350
3350
|
{
|
|
3351
3351
|
size: 12,
|
|
3352
3352
|
onClick: (f) => {
|
|
3353
|
-
f.preventDefault(), u(
|
|
3353
|
+
f.preventDefault(), u(g);
|
|
3354
3354
|
},
|
|
3355
3355
|
className: "cursor-pointer ml-1"
|
|
3356
3356
|
}
|
|
3357
3357
|
)
|
|
3358
3358
|
]
|
|
3359
3359
|
},
|
|
3360
|
-
|
|
3360
|
+
g
|
|
3361
3361
|
) : null;
|
|
3362
|
-
}) : /* @__PURE__ */ e("span", { className: "px-1 text-sm", children: (p = t.find((
|
|
3362
|
+
}) : /* @__PURE__ */ e("span", { className: "px-1 text-sm", children: (p = t.find((g) => g.value === a)) == null ? void 0 : p.label }) }) : /* @__PURE__ */ e("span", { className: "px-1 text-sm text-gray-400", children: n || (s ? "Select options" : "Select an option") }),
|
|
3363
3363
|
/* @__PURE__ */ e(
|
|
3364
3364
|
_e,
|
|
3365
3365
|
{
|
|
@@ -3388,18 +3388,18 @@ const nl = ({
|
|
|
3388
3388
|
),
|
|
3389
3389
|
/* @__PURE__ */ i(Ua, { children: [
|
|
3390
3390
|
/* @__PURE__ */ e(Wa, { children: "No options found." }),
|
|
3391
|
-
/* @__PURE__ */ e($a, { children: t.map((
|
|
3391
|
+
/* @__PURE__ */ e($a, { children: t.map((g) => /* @__PURE__ */ i(
|
|
3392
3392
|
_a,
|
|
3393
3393
|
{
|
|
3394
|
-
value:
|
|
3394
|
+
value: g.label,
|
|
3395
3395
|
className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
3396
|
-
onSelect: () => c(
|
|
3396
|
+
onSelect: () => c(g.value),
|
|
3397
3397
|
children: [
|
|
3398
|
-
|
|
3399
|
-
(s ? a.includes(
|
|
3398
|
+
g.label,
|
|
3399
|
+
(s ? a.includes(g.value) : a === g.value) && /* @__PURE__ */ e(kt, { size: 16, strokeWidth: 2, className: "ml-auto" })
|
|
3400
3400
|
]
|
|
3401
3401
|
},
|
|
3402
|
-
|
|
3402
|
+
g.value
|
|
3403
3403
|
)) })
|
|
3404
3404
|
] })
|
|
3405
3405
|
] })
|
|
@@ -3525,46 +3525,46 @@ const cl = ({
|
|
|
3525
3525
|
disabled: r
|
|
3526
3526
|
}) => {
|
|
3527
3527
|
const s = () => {
|
|
3528
|
-
const
|
|
3529
|
-
return S.setMinutes(
|
|
3528
|
+
const w = /* @__PURE__ */ new Date(), S = new Date(w);
|
|
3529
|
+
return S.setMinutes(w.getMinutes() + 30), S;
|
|
3530
3530
|
}, n = be(() => {
|
|
3531
|
-
const
|
|
3531
|
+
const w = [], S = /* @__PURE__ */ new Date();
|
|
3532
3532
|
for (let k = 0; k < 7; k++) {
|
|
3533
3533
|
const A = new Date(S);
|
|
3534
|
-
A.setDate(S.getDate() + k), A.setHours(0, 0, 0, 0),
|
|
3534
|
+
A.setDate(S.getDate() + k), A.setHours(0, 0, 0, 0), w.push(A);
|
|
3535
3535
|
}
|
|
3536
|
-
return
|
|
3537
|
-
}, []), o = (
|
|
3536
|
+
return w;
|
|
3537
|
+
}, []), o = (w) => {
|
|
3538
3538
|
const S = s();
|
|
3539
|
-
if (!(
|
|
3539
|
+
if (!(w.toDateString() === (/* @__PURE__ */ new Date()).toDateString())) return !0;
|
|
3540
3540
|
if (S.getHours() >= 21 && S.getMinutes() > 0)
|
|
3541
3541
|
return !1;
|
|
3542
3542
|
for (let A = 11; A <= 21; A++) {
|
|
3543
|
-
const v = new Date(
|
|
3543
|
+
const v = new Date(w);
|
|
3544
3544
|
if (v.setHours(A, 0, 0, 0), v > S)
|
|
3545
3545
|
return !0;
|
|
3546
3546
|
}
|
|
3547
3547
|
return !1;
|
|
3548
|
-
}, l = (
|
|
3548
|
+
}, l = (w) => !o(w), d = be(() => n.find((w) => !l(w)) || null, [n]), [c, u] = I(
|
|
3549
3549
|
t || d
|
|
3550
|
-
), [p,
|
|
3550
|
+
), [p, g] = I(
|
|
3551
3551
|
t ? `${t.getHours()}:${t.getMinutes() === 0 ? "00" : t.getMinutes()}` : null
|
|
3552
3552
|
), h = be(() => {
|
|
3553
3553
|
if (!c) return [];
|
|
3554
|
-
const
|
|
3554
|
+
const w = [], S = s(), k = c.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
3555
3555
|
for (let A = 11; A <= 21; A++) {
|
|
3556
3556
|
const v = new Date(c);
|
|
3557
|
-
v.setHours(A, 0, 0, 0), (!k || v > S) &&
|
|
3557
|
+
v.setHours(A, 0, 0, 0), (!k || v > S) && w.push(`${A}:00`);
|
|
3558
3558
|
}
|
|
3559
|
-
return
|
|
3560
|
-
}, [c]), f = (
|
|
3561
|
-
const S =
|
|
3559
|
+
return w;
|
|
3560
|
+
}, [c]), f = (w) => {
|
|
3561
|
+
const S = w.toLocaleDateString("en-US", { weekday: "short" }), k = w.toLocaleDateString("en-US", { month: "short" }), A = w.getDate();
|
|
3562
3562
|
return { weekday: S, month: k, day: A };
|
|
3563
|
-
},
|
|
3564
|
-
u(
|
|
3565
|
-
}, x = (
|
|
3566
|
-
if (
|
|
3567
|
-
const [S] =
|
|
3563
|
+
}, y = (w) => {
|
|
3564
|
+
u(w), g(null);
|
|
3565
|
+
}, x = (w) => {
|
|
3566
|
+
if (g(w), c) {
|
|
3567
|
+
const [S] = w.split(":").map(Number), k = new Date(c);
|
|
3568
3568
|
k.setHours(S, 0, 0, 0), a(k);
|
|
3569
3569
|
}
|
|
3570
3570
|
};
|
|
@@ -3573,15 +3573,15 @@ const cl = ({
|
|
|
3573
3573
|
}, []), /* @__PURE__ */ i("div", { className: "mt-2", children: [
|
|
3574
3574
|
/* @__PURE__ */ i("div", { className: "col-span-4 mt-4", children: [
|
|
3575
3575
|
/* @__PURE__ */ e(ye, { htmlFor: "date", children: "Select Date" }),
|
|
3576
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-2 mt-2", children: n.map((
|
|
3577
|
-
const { weekday: k, month: A, day: v } = f(
|
|
3576
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-2 mt-2", children: n.map((w, S) => {
|
|
3577
|
+
const { weekday: k, month: A, day: v } = f(w), C = l(w);
|
|
3578
3578
|
return /* @__PURE__ */ e(
|
|
3579
3579
|
"button",
|
|
3580
3580
|
{
|
|
3581
3581
|
type: "button",
|
|
3582
3582
|
disabled: C,
|
|
3583
|
-
className: `p-2 text-center border rounded-md ${C ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} ${c && c.toDateString() ===
|
|
3584
|
-
onClick: () => !C && w
|
|
3583
|
+
className: `p-2 text-center border rounded-md ${C ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} ${c && c.toDateString() === w.toDateString() ? "bg-teal-500 text-white" : "bg-white hover:bg-gray-100"}`,
|
|
3584
|
+
onClick: () => !C && y(w),
|
|
3585
3585
|
children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center", children: [
|
|
3586
3586
|
/* @__PURE__ */ e("span", { className: "text-xs font-medium", children: k }),
|
|
3587
3587
|
/* @__PURE__ */ e("span", { className: "text-xl font-black font-red-hat-display", children: v }),
|
|
@@ -3594,13 +3594,13 @@ const cl = ({
|
|
|
3594
3594
|
] }),
|
|
3595
3595
|
c && h.length > 0 && /* @__PURE__ */ i("div", { className: "col-span-4 mt-4", children: [
|
|
3596
3596
|
/* @__PURE__ */ e(ye, { htmlFor: "time", children: "Select Time" }),
|
|
3597
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-2 mt-2", children: h.map((
|
|
3597
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-2 mt-2", children: h.map((w, S) => /* @__PURE__ */ e(
|
|
3598
3598
|
"button",
|
|
3599
3599
|
{
|
|
3600
3600
|
type: "button",
|
|
3601
|
-
className: `p-2 text-sm text-center border rounded-md font-medium cursor-pointer ${p ===
|
|
3602
|
-
onClick: () => x(
|
|
3603
|
-
children:
|
|
3601
|
+
className: `p-2 text-sm text-center border rounded-md font-medium cursor-pointer ${p === w ? "bg-teal-500 text-white" : "bg-white hover:bg-gray-100"}`,
|
|
3602
|
+
onClick: () => x(w),
|
|
3603
|
+
children: w
|
|
3604
3604
|
},
|
|
3605
3605
|
S
|
|
3606
3606
|
)) })
|
|
@@ -3625,7 +3625,7 @@ const cl = ({
|
|
|
3625
3625
|
{
|
|
3626
3626
|
value: d(t),
|
|
3627
3627
|
multiple: s,
|
|
3628
|
-
onChange: (
|
|
3628
|
+
onChange: (g) => p(t, g, { shouldValidate: !0, shouldDirty: !0 })
|
|
3629
3629
|
}
|
|
3630
3630
|
);
|
|
3631
3631
|
case "week-time":
|
|
@@ -3633,7 +3633,7 @@ const cl = ({
|
|
|
3633
3633
|
cl,
|
|
3634
3634
|
{
|
|
3635
3635
|
value: d(t),
|
|
3636
|
-
onChange: (
|
|
3636
|
+
onChange: (g) => p(t, g, { shouldValidate: !0, shouldDirty: !0 })
|
|
3637
3637
|
}
|
|
3638
3638
|
);
|
|
3639
3639
|
case "phone-number":
|
|
@@ -3641,7 +3641,7 @@ const cl = ({
|
|
|
3641
3641
|
ol,
|
|
3642
3642
|
{
|
|
3643
3643
|
value: d("phone"),
|
|
3644
|
-
onChange: (
|
|
3644
|
+
onChange: (g) => p(t, g, { shouldValidate: !0, shouldDirty: !0 }),
|
|
3645
3645
|
onBlur: () => u("phone")
|
|
3646
3646
|
}
|
|
3647
3647
|
);
|
|
@@ -3650,19 +3650,19 @@ const cl = ({
|
|
|
3650
3650
|
al,
|
|
3651
3651
|
{
|
|
3652
3652
|
value: d(t),
|
|
3653
|
-
onChange: (
|
|
3653
|
+
onChange: (g) => p(t, g, { shouldValidate: !0, shouldDirty: !0 }),
|
|
3654
3654
|
disabled: o
|
|
3655
3655
|
}
|
|
3656
3656
|
);
|
|
3657
3657
|
case "select": {
|
|
3658
|
-
const
|
|
3658
|
+
const g = s ? d(t) || [] : d(t) || "";
|
|
3659
3659
|
if (!n)
|
|
3660
3660
|
throw new Error("Options are required for select input");
|
|
3661
3661
|
return /* @__PURE__ */ e(
|
|
3662
3662
|
ll,
|
|
3663
3663
|
{
|
|
3664
3664
|
options: n,
|
|
3665
|
-
value:
|
|
3665
|
+
value: g,
|
|
3666
3666
|
onChange: (h) => p(t, h),
|
|
3667
3667
|
placeholder: r,
|
|
3668
3668
|
multiple: s
|
|
@@ -3676,7 +3676,7 @@ const cl = ({
|
|
|
3676
3676
|
size: "default",
|
|
3677
3677
|
className: "mt-2",
|
|
3678
3678
|
value: d(t),
|
|
3679
|
-
onCheckedChange: (
|
|
3679
|
+
onCheckedChange: (g) => p(t, g)
|
|
3680
3680
|
}
|
|
3681
3681
|
);
|
|
3682
3682
|
case "location":
|
|
@@ -3684,7 +3684,7 @@ const cl = ({
|
|
|
3684
3684
|
Ga,
|
|
3685
3685
|
{
|
|
3686
3686
|
value: d(t),
|
|
3687
|
-
onChange: (
|
|
3687
|
+
onChange: (g) => p(t, g.addressLineOne)
|
|
3688
3688
|
}
|
|
3689
3689
|
);
|
|
3690
3690
|
case "time":
|
|
@@ -3718,7 +3718,7 @@ const cl = ({
|
|
|
3718
3718
|
prefix: u,
|
|
3719
3719
|
disabled: p
|
|
3720
3720
|
}) => {
|
|
3721
|
-
const { errors:
|
|
3721
|
+
const { errors: g } = Gt(), h = pl(g, a);
|
|
3722
3722
|
return /* @__PURE__ */ i("div", { className: b("w-full", s), children: [
|
|
3723
3723
|
typeof r == "string" && /* @__PURE__ */ i(
|
|
3724
3724
|
ye,
|
|
@@ -4089,7 +4089,7 @@ const Sl = ({
|
|
|
4089
4089
|
initialData: t,
|
|
4090
4090
|
shippingAndPaymentPageUrl: a
|
|
4091
4091
|
}) => {
|
|
4092
|
-
const { itemCount: r } = Ma(), s = Y(), { client: n } =
|
|
4092
|
+
const { itemCount: r } = Ma(), s = Y(), { client: n } = E(), o = pe({
|
|
4093
4093
|
resolver: ge(Ms),
|
|
4094
4094
|
reValidateMode: "onChange",
|
|
4095
4095
|
defaultValues: t ? {
|
|
@@ -4108,12 +4108,12 @@ const Sl = ({
|
|
|
4108
4108
|
K(() => {
|
|
4109
4109
|
(async () => {
|
|
4110
4110
|
if (l) {
|
|
4111
|
-
const { status:
|
|
4111
|
+
const { status: g, body: h } = await n.location.getPlaceDetails({
|
|
4112
4112
|
params: {
|
|
4113
4113
|
placeId: l
|
|
4114
4114
|
}
|
|
4115
4115
|
});
|
|
4116
|
-
if (
|
|
4116
|
+
if (g !== 200)
|
|
4117
4117
|
throw new Error("Failed to fetch place details");
|
|
4118
4118
|
o.setValue("zipCode", h.zipCode, {
|
|
4119
4119
|
shouldValidate: !0,
|
|
@@ -4129,9 +4129,9 @@ const Sl = ({
|
|
|
4129
4129
|
})();
|
|
4130
4130
|
}, [o, l]);
|
|
4131
4131
|
const c = G({
|
|
4132
|
-
mutationFn: async (
|
|
4132
|
+
mutationFn: async (g) => {
|
|
4133
4133
|
const { status: h, body: f } = await n.shipping.createShippingAddress({
|
|
4134
|
-
body:
|
|
4134
|
+
body: g
|
|
4135
4135
|
});
|
|
4136
4136
|
if (h !== 201)
|
|
4137
4137
|
throw new Error("Failed to create shipping address");
|
|
@@ -4141,17 +4141,17 @@ const Sl = ({
|
|
|
4141
4141
|
s.push(a);
|
|
4142
4142
|
}
|
|
4143
4143
|
}), u = G({
|
|
4144
|
-
mutationFn: async (
|
|
4144
|
+
mutationFn: async (g) => {
|
|
4145
4145
|
const { status: h, body: f } = await n.shipping.updateShippingAddress({
|
|
4146
|
-
body:
|
|
4146
|
+
body: g
|
|
4147
4147
|
});
|
|
4148
4148
|
if (h !== 200)
|
|
4149
4149
|
throw new Error("Failed to update shipping address");
|
|
4150
4150
|
return f;
|
|
4151
4151
|
},
|
|
4152
4152
|
onSuccess: () => s.push(a)
|
|
4153
|
-
}), p = (
|
|
4154
|
-
(t ? u : c).mutate(
|
|
4153
|
+
}), p = (g) => {
|
|
4154
|
+
(t ? u : c).mutate(g);
|
|
4155
4155
|
};
|
|
4156
4156
|
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ e(rt, { ...o, children: /* @__PURE__ */ i("form", { onSubmit: o.handleSubmit(p), children: [
|
|
4157
4157
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [
|
|
@@ -4197,11 +4197,11 @@ const Sl = ({
|
|
|
4197
4197
|
/* @__PURE__ */ e(
|
|
4198
4198
|
Ga,
|
|
4199
4199
|
{
|
|
4200
|
-
onChange: (
|
|
4201
|
-
o.setValue("addressLineOne",
|
|
4200
|
+
onChange: (g) => {
|
|
4201
|
+
o.setValue("addressLineOne", g.addressLineOne, {
|
|
4202
4202
|
shouldValidate: !0,
|
|
4203
4203
|
shouldDirty: !0
|
|
4204
|
-
}), o.setValue("placeId",
|
|
4204
|
+
}), o.setValue("placeId", g.placeId, {
|
|
4205
4205
|
shouldValidate: !0,
|
|
4206
4206
|
shouldDirty: !0
|
|
4207
4207
|
});
|
|
@@ -4306,7 +4306,7 @@ const Sl = ({
|
|
|
4306
4306
|
] }), Pr = ({
|
|
4307
4307
|
shippingAndPaymentPageUrl: t = "/checkout/shipping-and-payment"
|
|
4308
4308
|
}) => {
|
|
4309
|
-
const a = Y(), { client: r } =
|
|
4309
|
+
const a = Y(), { client: r } = E(), {
|
|
4310
4310
|
data: s,
|
|
4311
4311
|
isLoading: n,
|
|
4312
4312
|
error: o
|
|
@@ -4374,43 +4374,43 @@ const Sl = ({
|
|
|
4374
4374
|
paymentMethods: a,
|
|
4375
4375
|
customerDetailsPageUrl: r
|
|
4376
4376
|
}) => {
|
|
4377
|
-
const s = Y(), { client: n } =
|
|
4378
|
-
items:
|
|
4379
|
-
shippingMethod:
|
|
4380
|
-
paymentMethod:
|
|
4381
|
-
setPaymentMethod:
|
|
4382
|
-
setShippingMethod:
|
|
4383
|
-
} = Ma(),
|
|
4377
|
+
const s = Y(), { client: n, baseUrl: o } = E(), { organizationId: l } = qe(), {
|
|
4378
|
+
items: d,
|
|
4379
|
+
shippingMethod: c,
|
|
4380
|
+
paymentMethod: u,
|
|
4381
|
+
setPaymentMethod: p,
|
|
4382
|
+
setShippingMethod: g
|
|
4383
|
+
} = Ma(), h = G({
|
|
4384
4384
|
mutationFn: async () => {
|
|
4385
|
-
if (!d)
|
|
4386
|
-
throw new Error("Please select a shipping method");
|
|
4387
4385
|
if (!c)
|
|
4386
|
+
throw new Error("Please select a shipping method");
|
|
4387
|
+
if (!u)
|
|
4388
4388
|
throw new Error("Please select a payment method");
|
|
4389
|
-
const { body:
|
|
4389
|
+
const { body: y, status: x } = await n.order.createOrder({
|
|
4390
4390
|
params: {
|
|
4391
|
-
organizationId:
|
|
4391
|
+
organizationId: l
|
|
4392
4392
|
},
|
|
4393
4393
|
body: {
|
|
4394
|
-
items:
|
|
4395
|
-
shippingMethodId:
|
|
4394
|
+
items: d,
|
|
4395
|
+
shippingMethodId: c == null ? void 0 : c.id,
|
|
4396
4396
|
fulfilmentMethod: "delivery",
|
|
4397
4397
|
payment: {
|
|
4398
|
-
provider:
|
|
4399
|
-
method:
|
|
4398
|
+
provider: u.provider,
|
|
4399
|
+
method: u.method
|
|
4400
4400
|
},
|
|
4401
|
-
checkoutBaseUrl:
|
|
4401
|
+
checkoutBaseUrl: o
|
|
4402
4402
|
}
|
|
4403
4403
|
});
|
|
4404
|
-
if (
|
|
4404
|
+
if (x !== 201)
|
|
4405
4405
|
throw new Error("Failed to fetch shipping methods");
|
|
4406
|
-
return
|
|
4406
|
+
return y.redirectUrl && (window.location.href = y.redirectUrl), y;
|
|
4407
4407
|
}
|
|
4408
|
-
}),
|
|
4409
|
-
|
|
4408
|
+
}), f = () => {
|
|
4409
|
+
h.mutate();
|
|
4410
4410
|
};
|
|
4411
4411
|
return K(() => {
|
|
4412
|
-
t.length === 1 &&
|
|
4413
|
-
}, [
|
|
4412
|
+
t.length === 1 && g(t[0]);
|
|
4413
|
+
}, [g, t]), /* @__PURE__ */ i(P, { children: [
|
|
4414
4414
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
4415
4415
|
/* @__PURE__ */ e("h2", { className: "text-[32px] font-red-hat-display font-black", children: "Shipping Method" }),
|
|
4416
4416
|
/* @__PURE__ */ e("p", { className: "text-gray-500", children: "Select a shipping method" })
|
|
@@ -4419,40 +4419,40 @@ const Sl = ({
|
|
|
4419
4419
|
Aa,
|
|
4420
4420
|
{
|
|
4421
4421
|
className: "flex flex-col gap-2",
|
|
4422
|
-
value:
|
|
4423
|
-
children: t.map((
|
|
4422
|
+
value: c == null ? void 0 : c.id,
|
|
4423
|
+
children: t.map((y) => /* @__PURE__ */ e(
|
|
4424
4424
|
Na,
|
|
4425
4425
|
{
|
|
4426
|
-
value:
|
|
4427
|
-
disabled: !
|
|
4428
|
-
onClick: () =>
|
|
4426
|
+
value: y.id,
|
|
4427
|
+
disabled: !y.eligibleShippingZone,
|
|
4428
|
+
onClick: () => g(y),
|
|
4429
4429
|
children: /* @__PURE__ */ i(
|
|
4430
4430
|
"div",
|
|
4431
4431
|
{
|
|
4432
4432
|
className: b("flex items-center gap-3", {
|
|
4433
|
-
"opacity-60 cursor-not-allowed": !
|
|
4433
|
+
"opacity-60 cursor-not-allowed": !y.eligibleShippingZone
|
|
4434
4434
|
}),
|
|
4435
4435
|
children: [
|
|
4436
4436
|
/* @__PURE__ */ e(va, {}),
|
|
4437
4437
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ i("div", { children: [
|
|
4438
4438
|
/* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
4439
4439
|
/* @__PURE__ */ i("span", { className: "leading-5 font-red-hat-display font-black mr-2", children: [
|
|
4440
|
-
|
|
4440
|
+
y.title,
|
|
4441
4441
|
" (",
|
|
4442
|
-
|
|
4442
|
+
y.providerName,
|
|
4443
4443
|
")"
|
|
4444
4444
|
] }),
|
|
4445
|
-
!
|
|
4445
|
+
!y.eligibleShippingZone && /* @__PURE__ */ e(wt, { variant: "error", children: "Not Available" })
|
|
4446
4446
|
] }),
|
|
4447
|
-
|
|
4447
|
+
y.eligibleShippingZone && /* @__PURE__ */ i("p", { className: "text-xs font-medium text-gray-500 mt-0.5", children: [
|
|
4448
4448
|
"Shipping Fee: ",
|
|
4449
|
-
|
|
4449
|
+
y.eligibleShippingZone.price,
|
|
4450
4450
|
" zł ",
|
|
4451
4451
|
/* @__PURE__ */ e("br", {}),
|
|
4452
4452
|
"ETA: ",
|
|
4453
|
-
|
|
4453
|
+
y.eligibleShippingZone.eta
|
|
4454
4454
|
] }),
|
|
4455
|
-
!
|
|
4455
|
+
!y.eligibleShippingZone && /* @__PURE__ */ i("p", { className: "mt-0.5 text-xs text-gray-500", children: [
|
|
4456
4456
|
"Sorry, this address is too far for delivery ",
|
|
4457
4457
|
/* @__PURE__ */ e("br", {}),
|
|
4458
4458
|
" from our store."
|
|
@@ -4462,7 +4462,7 @@ const Sl = ({
|
|
|
4462
4462
|
}
|
|
4463
4463
|
)
|
|
4464
4464
|
},
|
|
4465
|
-
|
|
4465
|
+
y.id
|
|
4466
4466
|
))
|
|
4467
4467
|
}
|
|
4468
4468
|
),
|
|
@@ -4470,26 +4470,26 @@ const Sl = ({
|
|
|
4470
4470
|
/* @__PURE__ */ e("h2", { className: "text-[32px] font-red-hat-display font-black", children: "Payment Method" }),
|
|
4471
4471
|
/* @__PURE__ */ e("p", { className: "text-gray-500", children: "Select a payment method" })
|
|
4472
4472
|
] }),
|
|
4473
|
-
/* @__PURE__ */ e(Aa, { className: "flex flex-col gap-3", value:
|
|
4473
|
+
/* @__PURE__ */ e(Aa, { className: "flex flex-col gap-3", value: u == null ? void 0 : u.id, children: a.map((y) => /* @__PURE__ */ e(
|
|
4474
4474
|
Na,
|
|
4475
4475
|
{
|
|
4476
|
-
value:
|
|
4477
|
-
onClick: () =>
|
|
4476
|
+
value: y.id,
|
|
4477
|
+
onClick: () => p(y),
|
|
4478
4478
|
children: /* @__PURE__ */ i("div", { className: b("flex items-center gap-3"), children: [
|
|
4479
4479
|
/* @__PURE__ */ e(va, {}),
|
|
4480
4480
|
/* @__PURE__ */ i("div", { children: [
|
|
4481
|
-
/* @__PURE__ */ e("p", { className: "font-red-hat-display font-black mr-2 capitalize", children:
|
|
4481
|
+
/* @__PURE__ */ e("p", { className: "font-red-hat-display font-black mr-2 capitalize", children: y.method }),
|
|
4482
4482
|
/* @__PURE__ */ i("p", { className: "text-xs font-medium text-gray-500 capitalize", children: [
|
|
4483
|
-
|
|
4483
|
+
y.provider,
|
|
4484
4484
|
" • ",
|
|
4485
|
-
|
|
4485
|
+
y.description
|
|
4486
4486
|
] })
|
|
4487
4487
|
] })
|
|
4488
4488
|
] })
|
|
4489
4489
|
},
|
|
4490
|
-
|
|
4490
|
+
y.id
|
|
4491
4491
|
)) }),
|
|
4492
|
-
|
|
4492
|
+
h.error && /* @__PURE__ */ e("div", { className: "p-4 mt-2 rounded-lg bg-red-50 text-red-700", children: /* @__PURE__ */ e("p", { className: "text-sm", children: h.error.message }) }),
|
|
4493
4493
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ i("p", { className: "text-sm text-gray-500 mt-2 block", children: [
|
|
4494
4494
|
"By confirming this order you agree to our",
|
|
4495
4495
|
" ",
|
|
@@ -4512,8 +4512,8 @@ const Sl = ({
|
|
|
4512
4512
|
Se,
|
|
4513
4513
|
{
|
|
4514
4514
|
className: "shadow-none bg-teal-500 hover:bg-teal-400 text-white",
|
|
4515
|
-
onClick:
|
|
4516
|
-
isLoading:
|
|
4515
|
+
onClick: f,
|
|
4516
|
+
isLoading: h.isPending,
|
|
4517
4517
|
children: "Pay & Confirm"
|
|
4518
4518
|
}
|
|
4519
4519
|
)
|
|
@@ -4522,7 +4522,7 @@ const Sl = ({
|
|
|
4522
4522
|
}, Nl = ({
|
|
4523
4523
|
customerDetailsPageUrl: t = "/checkout/customer-details"
|
|
4524
4524
|
}) => {
|
|
4525
|
-
const { client: a } =
|
|
4525
|
+
const { client: a } = E(), { organizationId: r } = qe(), s = Y(), n = q({
|
|
4526
4526
|
queryKey: ["shippingAddress"],
|
|
4527
4527
|
queryFn: async () => {
|
|
4528
4528
|
const { status: d, body: c } = await a.shipping.getShippingAddress();
|
|
@@ -4631,7 +4631,7 @@ const Sl = ({
|
|
|
4631
4631
|
)
|
|
4632
4632
|
] }) }) }) : /* @__PURE__ */ i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [
|
|
4633
4633
|
/* @__PURE__ */ e("div", { className: "my-3 sm:my-6 sm:pb-1", children: a.map(
|
|
4634
|
-
({ title: d, subtitle: c, image: u, price: p, unitPrice:
|
|
4634
|
+
({ title: d, subtitle: c, image: u, price: p, unitPrice: g, quantity: h }, f) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [
|
|
4635
4635
|
/* @__PURE__ */ e("div", { className: "w-14 sm:min-w-32 h-10 sm:h-24 overflow-hidden rounded-lg", children: u != null && u.url ? /* @__PURE__ */ e(
|
|
4636
4636
|
xe,
|
|
4637
4637
|
{
|
|
@@ -4652,17 +4652,17 @@ const Sl = ({
|
|
|
4652
4652
|
")"
|
|
4653
4653
|
] })
|
|
4654
4654
|
] }),
|
|
4655
|
-
c && c.map((
|
|
4655
|
+
c && c.map((y, x) => /* @__PURE__ */ e(
|
|
4656
4656
|
"div",
|
|
4657
4657
|
{
|
|
4658
4658
|
className: "text-white text-xs opacity-50",
|
|
4659
|
-
children:
|
|
4659
|
+
children: y
|
|
4660
4660
|
},
|
|
4661
4661
|
x
|
|
4662
4662
|
)),
|
|
4663
4663
|
/* @__PURE__ */ i("div", { className: "text-white text-xs opacity-50 whitespace-nowrap sm:block hidden", children: [
|
|
4664
4664
|
"Price: ",
|
|
4665
|
-
|
|
4665
|
+
g
|
|
4666
4666
|
] }),
|
|
4667
4667
|
/* @__PURE__ */ e("div", { className: "font-red-hat-display h4 text-white text-sm text-sm whitespace-nowrap mt-2 sm:block hidden", children: p })
|
|
4668
4668
|
] }),
|
|
@@ -5383,7 +5383,7 @@ const Sl = ({
|
|
|
5383
5383
|
] })
|
|
5384
5384
|
] });
|
|
5385
5385
|
}, Fl = ({ orderId: t }) => {
|
|
5386
|
-
const { client: a } =
|
|
5386
|
+
const { client: a } = E(), { organization: r, organizationId: s } = qe(), n = me(), o = Y(), l = st(), { t: d } = Dl(), c = r == null ? void 0 : r.configuration.defaultCurrency;
|
|
5387
5387
|
K(() => {
|
|
5388
5388
|
if ((n == null ? void 0 : n.get("clearCart")) === "true" && l) {
|
|
5389
5389
|
localStorage.removeItem("shophost-cart");
|
|
@@ -5391,18 +5391,18 @@ const Sl = ({
|
|
|
5391
5391
|
Array.from(n.entries())
|
|
5392
5392
|
);
|
|
5393
5393
|
x.delete("clearCart");
|
|
5394
|
-
const
|
|
5395
|
-
o.replace(
|
|
5394
|
+
const w = x.toString() ? `${l}?${x.toString()}` : l;
|
|
5395
|
+
o.replace(w);
|
|
5396
5396
|
}
|
|
5397
5397
|
}, [n, o, l]);
|
|
5398
|
-
const { data: u, isLoading: p, error:
|
|
5398
|
+
const { data: u, isLoading: p, error: g } = q({
|
|
5399
5399
|
queryKey: ["order", t],
|
|
5400
5400
|
refetchInterval: ({ state: x }) => {
|
|
5401
|
-
var
|
|
5402
|
-
return ((
|
|
5401
|
+
var w, S;
|
|
5402
|
+
return ((w = x.data) == null ? void 0 : w.status) !== "completed" && ((S = x.data) == null ? void 0 : S.status) !== "cancelled" ? 30 * 1e3 : !1;
|
|
5403
5403
|
},
|
|
5404
5404
|
queryFn: async () => {
|
|
5405
|
-
const { status: x, body:
|
|
5405
|
+
const { status: x, body: w } = await a.order.getOrder({
|
|
5406
5406
|
params: {
|
|
5407
5407
|
id: t,
|
|
5408
5408
|
// Replace with the actual order ID
|
|
@@ -5412,7 +5412,7 @@ const Sl = ({
|
|
|
5412
5412
|
});
|
|
5413
5413
|
if (x !== 200)
|
|
5414
5414
|
throw new Error("Failed to fetch shipping address");
|
|
5415
|
-
return
|
|
5415
|
+
return w;
|
|
5416
5416
|
}
|
|
5417
5417
|
}), h = be(() => u ? u == null ? void 0 : u.items.map((x) => ({
|
|
5418
5418
|
title: x.translations[0].title,
|
|
@@ -5424,7 +5424,7 @@ const Sl = ({
|
|
|
5424
5424
|
})) : [], [u, c]);
|
|
5425
5425
|
if (!u || p)
|
|
5426
5426
|
return /* @__PURE__ */ e(zl, {});
|
|
5427
|
-
const { status: f } = u,
|
|
5427
|
+
const { status: f } = u, y = [
|
|
5428
5428
|
{
|
|
5429
5429
|
title: d("orderTracking.orderPlaced"),
|
|
5430
5430
|
description: d("orderTracking.orderPlacedDesc"),
|
|
@@ -5457,7 +5457,7 @@ const Sl = ({
|
|
|
5457
5457
|
showConfetti: !0
|
|
5458
5458
|
}
|
|
5459
5459
|
];
|
|
5460
|
-
return u.status === "cancelled" &&
|
|
5460
|
+
return u.status === "cancelled" && y.push({
|
|
5461
5461
|
title: d("orderTracking.orderCancelled"),
|
|
5462
5462
|
description: d("orderTracking.orderCancelledDesc"),
|
|
5463
5463
|
date: u.cancelledAt,
|
|
@@ -5527,11 +5527,11 @@ const Sl = ({
|
|
|
5527
5527
|
{
|
|
5528
5528
|
className: "absolute left-4 top-0 w-0.5 bg-gray-200",
|
|
5529
5529
|
style: {
|
|
5530
|
-
height: `calc(100% - ${
|
|
5530
|
+
height: `calc(100% - ${y.length > 1 ? "4rem" : "0rem"})`
|
|
5531
5531
|
}
|
|
5532
5532
|
}
|
|
5533
5533
|
),
|
|
5534
|
-
|
|
5534
|
+
y.map((x, w) => /* @__PURE__ */ e(Ol, { ...x }, w))
|
|
5535
5535
|
] }) })
|
|
5536
5536
|
] }) })
|
|
5537
5537
|
] }) })
|
|
@@ -5540,23 +5540,23 @@ const Sl = ({
|
|
|
5540
5540
|
/* @__PURE__ */ e("h1", { children: "All Orders" }),
|
|
5541
5541
|
/* @__PURE__ */ e("p", { children: "Order history and list will be displayed here" })
|
|
5542
5542
|
] }), Vl = () => {
|
|
5543
|
-
const t = me(), { signIn: a } = dt(), r = (t == null ? void 0 : t.get("redirect")) ?? "/checkout/customer-details", {
|
|
5544
|
-
register:
|
|
5545
|
-
handleSubmit:
|
|
5546
|
-
formState: { errors:
|
|
5543
|
+
const t = me(), { signIn: a } = dt(), { baseUrl: r } = E(), s = (t == null ? void 0 : t.get("redirect")) ?? "/checkout/customer-details", {
|
|
5544
|
+
register: n,
|
|
5545
|
+
handleSubmit: o,
|
|
5546
|
+
formState: { errors: l, isSubmitting: d }
|
|
5547
5547
|
} = pe({
|
|
5548
5548
|
resolver: ge(Vs),
|
|
5549
5549
|
shouldFocusError: !0
|
|
5550
|
-
}),
|
|
5550
|
+
}), c = async (p) => {
|
|
5551
5551
|
await a.email({
|
|
5552
|
-
email:
|
|
5553
|
-
password:
|
|
5554
|
-
callbackURL: `${
|
|
5552
|
+
email: p.email,
|
|
5553
|
+
password: p.password,
|
|
5554
|
+
callbackURL: `${r}${s}`
|
|
5555
5555
|
});
|
|
5556
|
-
},
|
|
5557
|
-
|
|
5556
|
+
}, u = async (p) => {
|
|
5557
|
+
p.preventDefault(), await a.social({
|
|
5558
5558
|
provider: "google",
|
|
5559
|
-
callbackURL: `${
|
|
5559
|
+
callbackURL: `${r}${s}`
|
|
5560
5560
|
});
|
|
5561
5561
|
};
|
|
5562
5562
|
return /* @__PURE__ */ i("div", { className: "flex w-full flex-col items-start sm:max-w-sm", children: [
|
|
@@ -5569,7 +5569,7 @@ const Sl = ({
|
|
|
5569
5569
|
F,
|
|
5570
5570
|
{
|
|
5571
5571
|
className: "text-teal-500 hover:text-teal-600 dark:text-teal-500 dark:hover:text-teal-400",
|
|
5572
|
-
href: `/account/sign-up?redirect=${
|
|
5572
|
+
href: `/account/sign-up?redirect=${s}`,
|
|
5573
5573
|
children: "Sign up"
|
|
5574
5574
|
}
|
|
5575
5575
|
)
|
|
@@ -5582,7 +5582,7 @@ const Sl = ({
|
|
|
5582
5582
|
variant: "secondary",
|
|
5583
5583
|
type: "button",
|
|
5584
5584
|
className: "mt-2 w-full sm:mt-0 shadow-none inline-flex items-center gap-2",
|
|
5585
|
-
onClick:
|
|
5585
|
+
onClick: u,
|
|
5586
5586
|
children: [
|
|
5587
5587
|
/* @__PURE__ */ e(Yt, { className: "size-4", "aria-hidden": "true" }),
|
|
5588
5588
|
"Login with Google"
|
|
@@ -5593,7 +5593,7 @@ const Sl = ({
|
|
|
5593
5593
|
/* @__PURE__ */ i(
|
|
5594
5594
|
"form",
|
|
5595
5595
|
{
|
|
5596
|
-
onSubmit:
|
|
5596
|
+
onSubmit: o(c),
|
|
5597
5597
|
className: "flex w-full flex-col gap-y-6",
|
|
5598
5598
|
children: [
|
|
5599
5599
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-y-4", children: [
|
|
@@ -5606,10 +5606,10 @@ const Sl = ({
|
|
|
5606
5606
|
autoComplete: "email",
|
|
5607
5607
|
id: "email-form-item",
|
|
5608
5608
|
placeholder: "emily.ross@acme.ch",
|
|
5609
|
-
...
|
|
5609
|
+
...n("email")
|
|
5610
5610
|
}
|
|
5611
5611
|
),
|
|
5612
|
-
|
|
5612
|
+
l.email && /* @__PURE__ */ e("span", { className: "text-sm text-red-500", children: l.email.message })
|
|
5613
5613
|
] }),
|
|
5614
5614
|
/* @__PURE__ */ i("div", { className: "flex flex-col space-y-2", children: [
|
|
5615
5615
|
/* @__PURE__ */ e(ye, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }),
|
|
@@ -5620,10 +5620,10 @@ const Sl = ({
|
|
|
5620
5620
|
autoComplete: "current-password",
|
|
5621
5621
|
id: "password-form-item",
|
|
5622
5622
|
placeholder: "Password",
|
|
5623
|
-
...
|
|
5623
|
+
...n("password")
|
|
5624
5624
|
}
|
|
5625
5625
|
),
|
|
5626
|
-
|
|
5626
|
+
l.password && /* @__PURE__ */ e("span", { className: "text-sm text-red-500", children: l.password.message })
|
|
5627
5627
|
] })
|
|
5628
5628
|
] }),
|
|
5629
5629
|
/* @__PURE__ */ e(
|
|
@@ -5631,8 +5631,8 @@ const Sl = ({
|
|
|
5631
5631
|
{
|
|
5632
5632
|
type: "submit",
|
|
5633
5633
|
className: "shadow-none",
|
|
5634
|
-
isLoading:
|
|
5635
|
-
children:
|
|
5634
|
+
isLoading: d,
|
|
5635
|
+
children: d ? "Submitting..." : "Continue"
|
|
5636
5636
|
}
|
|
5637
5637
|
)
|
|
5638
5638
|
]
|
|
@@ -5654,21 +5654,21 @@ const Sl = ({
|
|
|
5654
5654
|
] })
|
|
5655
5655
|
] });
|
|
5656
5656
|
}, Hl = () => /* @__PURE__ */ e(Vl, {}), Zl = () => {
|
|
5657
|
-
const t = me(), { signUp: a, signIn: r } = dt(), s = (t == null ? void 0 : t.get("redirect")) ?? "/checkout/customer-details", {
|
|
5658
|
-
register:
|
|
5659
|
-
handleSubmit:
|
|
5660
|
-
formState: { errors:
|
|
5657
|
+
const t = me(), { signUp: a, signIn: r } = dt(), { baseUrl: s } = E(), n = (t == null ? void 0 : t.get("redirect")) ?? "/checkout/customer-details", {
|
|
5658
|
+
register: o,
|
|
5659
|
+
handleSubmit: l,
|
|
5660
|
+
formState: { errors: d }
|
|
5661
5661
|
} = pe({
|
|
5662
5662
|
resolver: ge(ja),
|
|
5663
5663
|
shouldFocusError: !0
|
|
5664
|
-
}), { isPending:
|
|
5665
|
-
onMutate: async (
|
|
5666
|
-
email:
|
|
5667
|
-
password:
|
|
5668
|
-
name: `${
|
|
5669
|
-
firstname:
|
|
5670
|
-
lastname:
|
|
5671
|
-
callbackURL: `${
|
|
5664
|
+
}), { isPending: c, isError: u, mutate: p } = G({
|
|
5665
|
+
onMutate: async (h) => a.email({
|
|
5666
|
+
email: h.email,
|
|
5667
|
+
password: h.password,
|
|
5668
|
+
name: `${h.firstname} ${h.lastname}`,
|
|
5669
|
+
firstname: h.firstname,
|
|
5670
|
+
lastname: h.lastname,
|
|
5671
|
+
callbackURL: `${s}${n}`
|
|
5672
5672
|
})
|
|
5673
5673
|
});
|
|
5674
5674
|
return /* @__PURE__ */ e(P, { children: /* @__PURE__ */ i("div", { className: "flex w-full flex-col items-start md:max-w-sm", children: [
|
|
@@ -5694,9 +5694,9 @@ const Sl = ({
|
|
|
5694
5694
|
variant: "secondary",
|
|
5695
5695
|
type: "button",
|
|
5696
5696
|
className: "mt-2 w-full sm:mt-0 inline-flex items-center gap-2 shadow-none",
|
|
5697
|
-
onClick: async (
|
|
5697
|
+
onClick: async (h) => (h.preventDefault(), r.social({
|
|
5698
5698
|
provider: "google",
|
|
5699
|
-
callbackURL: `${
|
|
5699
|
+
callbackURL: `${s}${n}`
|
|
5700
5700
|
})),
|
|
5701
5701
|
children: [
|
|
5702
5702
|
/* @__PURE__ */ e(Yt, { className: "size-4", "aria-hidden": "true" }),
|
|
@@ -5708,7 +5708,7 @@ const Sl = ({
|
|
|
5708
5708
|
/* @__PURE__ */ i(
|
|
5709
5709
|
"form",
|
|
5710
5710
|
{
|
|
5711
|
-
onSubmit:
|
|
5711
|
+
onSubmit: l((h) => p(h)),
|
|
5712
5712
|
className: "flex w-full flex-col gap-y-6",
|
|
5713
5713
|
children: [
|
|
5714
5714
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-y-4", children: [
|
|
@@ -5720,10 +5720,10 @@ const Sl = ({
|
|
|
5720
5720
|
type: "text",
|
|
5721
5721
|
id: "email-form-item",
|
|
5722
5722
|
placeholder: "Emily",
|
|
5723
|
-
...
|
|
5723
|
+
...o("firstname")
|
|
5724
5724
|
}
|
|
5725
5725
|
),
|
|
5726
|
-
|
|
5726
|
+
d.firstname && /* @__PURE__ */ e("span", { className: "text-sm text-red-500", children: d.firstname.message })
|
|
5727
5727
|
] }),
|
|
5728
5728
|
/* @__PURE__ */ i("div", { className: "flex flex-col space-y-2", children: [
|
|
5729
5729
|
/* @__PURE__ */ e(ye, { htmlFor: "email-form-item", className: "font-medium", children: "Last Name" }),
|
|
@@ -5733,10 +5733,10 @@ const Sl = ({
|
|
|
5733
5733
|
type: "text",
|
|
5734
5734
|
id: "email-form-item",
|
|
5735
5735
|
placeholder: "Emily",
|
|
5736
|
-
...
|
|
5736
|
+
...o("lastname")
|
|
5737
5737
|
}
|
|
5738
5738
|
),
|
|
5739
|
-
|
|
5739
|
+
d.lastname && /* @__PURE__ */ e("span", { className: "text-sm text-red-500", children: d.lastname.message })
|
|
5740
5740
|
] }),
|
|
5741
5741
|
/* @__PURE__ */ i("div", { className: "flex flex-col space-y-2", children: [
|
|
5742
5742
|
/* @__PURE__ */ e(ye, { htmlFor: "email-form-item", className: "font-medium", children: "Email" }),
|
|
@@ -5747,10 +5747,10 @@ const Sl = ({
|
|
|
5747
5747
|
autoComplete: "email",
|
|
5748
5748
|
id: "email-form-item",
|
|
5749
5749
|
placeholder: "emily.ross@acme.ch",
|
|
5750
|
-
...
|
|
5750
|
+
...o("email")
|
|
5751
5751
|
}
|
|
5752
5752
|
),
|
|
5753
|
-
|
|
5753
|
+
d.email && /* @__PURE__ */ e("span", { className: "text-sm text-red-500", children: d.email.message })
|
|
5754
5754
|
] }),
|
|
5755
5755
|
/* @__PURE__ */ i("div", { className: "flex flex-col space-y-2", children: [
|
|
5756
5756
|
/* @__PURE__ */ e(ye, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }),
|
|
@@ -5761,14 +5761,14 @@ const Sl = ({
|
|
|
5761
5761
|
autoComplete: "current-password",
|
|
5762
5762
|
id: "password-form-item",
|
|
5763
5763
|
placeholder: "Password",
|
|
5764
|
-
...
|
|
5764
|
+
...o("password")
|
|
5765
5765
|
}
|
|
5766
5766
|
),
|
|
5767
|
-
|
|
5767
|
+
d.password && /* @__PURE__ */ e("span", { className: "text-sm text-red-500", children: d.password.message })
|
|
5768
5768
|
] })
|
|
5769
5769
|
] }),
|
|
5770
|
-
|
|
5771
|
-
/* @__PURE__ */ e(Se, { type: "submit", isLoading:
|
|
5770
|
+
u && /* @__PURE__ */ e("span", { className: "text-sm text-red-500", children: "An error occurred, please try again." }),
|
|
5771
|
+
/* @__PURE__ */ e(Se, { type: "submit", isLoading: c, children: c ? "Submitting..." : "Continue" })
|
|
5772
5772
|
]
|
|
5773
5773
|
}
|
|
5774
5774
|
)
|
|
@@ -5806,10 +5806,10 @@ const Sl = ({
|
|
|
5806
5806
|
total: d,
|
|
5807
5807
|
subtotal: c,
|
|
5808
5808
|
shipping: u
|
|
5809
|
-
} = Ma(), { organization: p, loading:
|
|
5809
|
+
} = Ma(), { organization: p, loading: g } = qe(), [h, f, ...y] = (t == null ? void 0 : t.segments) || [];
|
|
5810
5810
|
return console.log(h, f), K(() => {
|
|
5811
5811
|
!n && !s && r.push("/account/sign-in?redirect=/checkout/customer-details");
|
|
5812
|
-
}, [s, n, r]),
|
|
5812
|
+
}, [s, n, r]), y.length > 0 ? tt() : g || o || n ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center h-screen w-screen bg-gray-900", children: /* @__PURE__ */ e("div", { className: "mb-4", children: /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-18 w-18 border-b-2 border-teal-500" }) }) }) : p ? !p.configuration.isAcceptingOrders || !p.configuration.isOpen ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center h-screen w-screen bg-gray-900 text-center animate-fade-in", children: p.configuration.isOpen ? /* @__PURE__ */ i("div", { className: "relative z-10 max-w-[800px] px-10", children: [
|
|
5813
5813
|
/* @__PURE__ */ e("h1", { className: "text-2xl sm:text-3xl font-black font-red-hat-display text-white", children: "Unfortunately, We're currently not accepting online orders." }),
|
|
5814
5814
|
/* @__PURE__ */ i("p", { className: "text-gray-100 font-medium mt-3 text-lg mt-", children: [
|
|
5815
5815
|
"Please contact us directly for any inquiries. ",
|
|
@@ -5892,7 +5892,7 @@ const Sl = ({
|
|
|
5892
5892
|
handleIncrement: c,
|
|
5893
5893
|
handleDecrement: u,
|
|
5894
5894
|
handleAddToCart: p,
|
|
5895
|
-
validationError:
|
|
5895
|
+
validationError: g
|
|
5896
5896
|
} = ra();
|
|
5897
5897
|
if (!s)
|
|
5898
5898
|
return null;
|
|
@@ -5913,7 +5913,7 @@ const Sl = ({
|
|
|
5913
5913
|
isDecrementDisabled: h,
|
|
5914
5914
|
// Cart action props
|
|
5915
5915
|
onAddToCart: p,
|
|
5916
|
-
validationError:
|
|
5916
|
+
validationError: g
|
|
5917
5917
|
});
|
|
5918
5918
|
}, pu = ({
|
|
5919
5919
|
children: t,
|
|
@@ -5953,16 +5953,16 @@ const Sl = ({
|
|
|
5953
5953
|
formatModifierPrice: d,
|
|
5954
5954
|
product: c,
|
|
5955
5955
|
locale: u
|
|
5956
|
-
} = ra(), p = s(r, a.id),
|
|
5957
|
-
c.modifierGroups.find((
|
|
5956
|
+
} = ra(), p = s(r, a.id), g = n(
|
|
5957
|
+
c.modifierGroups.find((y) => y.id === r)
|
|
5958
5958
|
), h = d(a, c.currency);
|
|
5959
5959
|
return t({
|
|
5960
5960
|
modifier: a,
|
|
5961
5961
|
isSelected: p,
|
|
5962
5962
|
onSelect: () => {
|
|
5963
|
-
|
|
5963
|
+
g ? o(r, a.id) : l(r, a.id);
|
|
5964
5964
|
},
|
|
5965
|
-
isMultiSelect:
|
|
5965
|
+
isMultiSelect: g,
|
|
5966
5966
|
formattedPrice: h
|
|
5967
5967
|
});
|
|
5968
5968
|
}, hu = ({
|
|
@@ -5974,7 +5974,7 @@ const Sl = ({
|
|
|
5974
5974
|
(async () => {
|
|
5975
5975
|
o(!0);
|
|
5976
5976
|
try {
|
|
5977
|
-
const p = a.find((
|
|
5977
|
+
const p = a.find((g) => g.id === t);
|
|
5978
5978
|
if (p)
|
|
5979
5979
|
s(p);
|
|
5980
5980
|
else
|
|
@@ -5995,17 +5995,17 @@ const Sl = ({
|
|
|
5995
5995
|
o(!0);
|
|
5996
5996
|
try {
|
|
5997
5997
|
const h = a.filter(
|
|
5998
|
-
(
|
|
5998
|
+
(y) => t.includes(y.id)
|
|
5999
5999
|
).reduce(
|
|
6000
|
-
(
|
|
6000
|
+
(y, x) => (y[x.id] = x, y),
|
|
6001
6001
|
{}
|
|
6002
6002
|
);
|
|
6003
6003
|
s(h);
|
|
6004
|
-
const f = t.filter((
|
|
6004
|
+
const f = t.filter((y) => !h[y]);
|
|
6005
6005
|
f.length > 0 && console.warn(`Products with IDs ${f.join(", ")} not found`);
|
|
6006
|
-
} catch (
|
|
6006
|
+
} catch (g) {
|
|
6007
6007
|
d(
|
|
6008
|
-
|
|
6008
|
+
g instanceof Error ? g : new Error("Failed to fetch products")
|
|
6009
6009
|
);
|
|
6010
6010
|
} finally {
|
|
6011
6011
|
o(!1);
|
|
@@ -6568,21 +6568,21 @@ const od = Ae(void 0), ld = ({
|
|
|
6568
6568
|
children: t
|
|
6569
6569
|
}) => {
|
|
6570
6570
|
var d, c, u, p;
|
|
6571
|
-
const { client: a } =
|
|
6571
|
+
const { client: a } = E(), { organizationId: r } = nd(), s = q({
|
|
6572
6572
|
queryKey: ["organizations"],
|
|
6573
6573
|
queryFn: async () => {
|
|
6574
|
-
const { body:
|
|
6574
|
+
const { body: g, status: h } = await a.organization.getOrganizations();
|
|
6575
6575
|
if (h !== 200)
|
|
6576
6576
|
throw h !== 401 && se.error(
|
|
6577
6577
|
"Failed to update organizations list. Please refresh the page or try again later."
|
|
6578
6578
|
), new Error("Failed to fetch organizations");
|
|
6579
|
-
return
|
|
6579
|
+
return g;
|
|
6580
6580
|
},
|
|
6581
6581
|
retry: !1
|
|
6582
6582
|
}), n = q({
|
|
6583
6583
|
queryKey: ["organization", r],
|
|
6584
6584
|
queryFn: async () => {
|
|
6585
|
-
const { body:
|
|
6585
|
+
const { body: g, status: h } = await a.organization.getOrganization({
|
|
6586
6586
|
params: {
|
|
6587
6587
|
organizationId: r
|
|
6588
6588
|
}
|
|
@@ -6591,11 +6591,11 @@ const od = Ae(void 0), ld = ({
|
|
|
6591
6591
|
throw h !== 401 && se.error(
|
|
6592
6592
|
"Failed to fetch organization. Please try refreshing the page or try again later."
|
|
6593
6593
|
), new Error("Failed to fetch organizations");
|
|
6594
|
-
return
|
|
6594
|
+
return g;
|
|
6595
6595
|
},
|
|
6596
6596
|
enabled: !!r
|
|
6597
6597
|
}), o = ((d = n.data) == null ? void 0 : d.configuration.defaultLocale) ?? "en", l = ((u = (c = n.data) == null ? void 0 : c.configuration.supportedLocales) == null ? void 0 : u.sort(
|
|
6598
|
-
(
|
|
6598
|
+
(g) => g === o ? -1 : 1
|
|
6599
6599
|
)) || ["en"];
|
|
6600
6600
|
return /* @__PURE__ */ e(
|
|
6601
6601
|
li.Provider,
|
|
@@ -12430,12 +12430,12 @@ const md = (t) => {
|
|
|
12430
12430
|
activeLegend: l,
|
|
12431
12431
|
enableLegendSlider: d = !1,
|
|
12432
12432
|
...c
|
|
12433
|
-
} = t, u = R.useRef(null), [p,
|
|
12433
|
+
} = t, u = R.useRef(null), [p, g] = R.useState(null), [h, f] = R.useState(null), y = R.useRef(null), x = R.useCallback(() => {
|
|
12434
12434
|
const A = u == null ? void 0 : u.current;
|
|
12435
12435
|
if (!A) return;
|
|
12436
12436
|
const v = A.scrollLeft > 0, C = A.scrollWidth - A.clientWidth > A.scrollLeft;
|
|
12437
|
-
|
|
12438
|
-
}, [
|
|
12437
|
+
g({ left: v, right: C });
|
|
12438
|
+
}, [g]), w = R.useCallback(
|
|
12439
12439
|
(A) => {
|
|
12440
12440
|
const v = u == null ? void 0 : u.current, C = (v == null ? void 0 : v.clientWidth) ?? 0;
|
|
12441
12441
|
v && d && (v.scrollTo({
|
|
@@ -12449,12 +12449,12 @@ const md = (t) => {
|
|
|
12449
12449
|
);
|
|
12450
12450
|
R.useEffect(() => {
|
|
12451
12451
|
const A = (v) => {
|
|
12452
|
-
v === "ArrowLeft" ?
|
|
12452
|
+
v === "ArrowLeft" ? w("left") : v === "ArrowRight" && w("right");
|
|
12453
12453
|
};
|
|
12454
|
-
return h ? (A(h),
|
|
12454
|
+
return h ? (A(h), y.current = setInterval(() => {
|
|
12455
12455
|
A(h);
|
|
12456
|
-
}, 300)) : clearInterval(
|
|
12457
|
-
}, [h,
|
|
12456
|
+
}, 300)) : clearInterval(y.current), () => clearInterval(y.current);
|
|
12457
|
+
}, [h, w]);
|
|
12458
12458
|
const S = (A) => {
|
|
12459
12459
|
A.stopPropagation(), (A.key === "ArrowLeft" || A.key === "ArrowRight") && (A.preventDefault(), f(A.key));
|
|
12460
12460
|
}, k = (A) => {
|
|
@@ -12508,7 +12508,7 @@ const md = (t) => {
|
|
|
12508
12508
|
{
|
|
12509
12509
|
icon: Zt,
|
|
12510
12510
|
onClick: () => {
|
|
12511
|
-
f(null),
|
|
12511
|
+
f(null), w("left");
|
|
12512
12512
|
},
|
|
12513
12513
|
disabled: !(p != null && p.left)
|
|
12514
12514
|
}
|
|
@@ -12518,7 +12518,7 @@ const md = (t) => {
|
|
|
12518
12518
|
{
|
|
12519
12519
|
icon: at,
|
|
12520
12520
|
onClick: () => {
|
|
12521
|
-
f(null),
|
|
12521
|
+
f(null), w("right");
|
|
12522
12522
|
},
|
|
12523
12523
|
disabled: !(p != null && p.right)
|
|
12524
12524
|
}
|
|
@@ -12653,12 +12653,12 @@ const hd = ({ payload: t }, a, r, s, n, o) => {
|
|
|
12653
12653
|
showXAxis: c = !0,
|
|
12654
12654
|
showYAxis: u = !0,
|
|
12655
12655
|
showGridLines: p = !0,
|
|
12656
|
-
yAxisWidth:
|
|
12656
|
+
yAxisWidth: g = 56,
|
|
12657
12657
|
intervalType: h = "equidistantPreserveStart",
|
|
12658
12658
|
showTooltip: f = !0,
|
|
12659
|
-
showLegend:
|
|
12659
|
+
showLegend: y = !0,
|
|
12660
12660
|
autoMinValue: x = !1,
|
|
12661
|
-
minValue:
|
|
12661
|
+
minValue: w,
|
|
12662
12662
|
maxValue: S,
|
|
12663
12663
|
allowDecimals: k = !0,
|
|
12664
12664
|
connectNulls: A = !1,
|
|
@@ -12671,11 +12671,11 @@ const hd = ({ payload: t }, a, r, s, n, o) => {
|
|
|
12671
12671
|
...J
|
|
12672
12672
|
} = t, Ce = !c && !u ? 0 : 20, [Ze, Ke] = R.useState(60), [Z, De] = R.useState(
|
|
12673
12673
|
void 0
|
|
12674
|
-
), [M,
|
|
12674
|
+
), [M, D] = R.useState(
|
|
12675
12675
|
void 0
|
|
12676
|
-
), B = ud(s, o), ce = pd(x,
|
|
12676
|
+
), B = ud(s, o), ce = pd(x, w, S), zt = !!C;
|
|
12677
12677
|
function un(z, fe) {
|
|
12678
|
-
fe.stopPropagation(), zt && (z.index === (Z == null ? void 0 : Z.index) && z.dataKey === (Z == null ? void 0 : Z.dataKey) || wa(r, z.dataKey) && M && M === z.dataKey ? (
|
|
12678
|
+
fe.stopPropagation(), zt && (z.index === (Z == null ? void 0 : Z.index) && z.dataKey === (Z == null ? void 0 : Z.dataKey) || wa(r, z.dataKey) && M && M === z.dataKey ? (D(void 0), De(void 0), C == null || C(null)) : (D(z.dataKey), De({
|
|
12679
12679
|
index: z.index,
|
|
12680
12680
|
dataKey: z.dataKey
|
|
12681
12681
|
}), C == null || C({
|
|
@@ -12685,7 +12685,7 @@ const hd = ({ payload: t }, a, r, s, n, o) => {
|
|
|
12685
12685
|
})));
|
|
12686
12686
|
}
|
|
12687
12687
|
function pr(z) {
|
|
12688
|
-
zt && (z === M && !Z || wa(r, z) && Z && Z.dataKey === z ? (
|
|
12688
|
+
zt && (z === M && !Z || wa(r, z) && Z && Z.dataKey === z ? (D(void 0), C == null || C(null)) : (D(z), C == null || C({
|
|
12689
12689
|
eventType: "category",
|
|
12690
12690
|
categoryClicked: z
|
|
12691
12691
|
})), De(void 0));
|
|
@@ -12695,7 +12695,7 @@ const hd = ({ payload: t }, a, r, s, n, o) => {
|
|
|
12695
12695
|
{
|
|
12696
12696
|
data: r,
|
|
12697
12697
|
onClick: zt && (M || Z) ? () => {
|
|
12698
|
-
De(void 0),
|
|
12698
|
+
De(void 0), D(void 0), C == null || C(null);
|
|
12699
12699
|
} : void 0,
|
|
12700
12700
|
margin: {
|
|
12701
12701
|
bottom: ae ? 30 : void 0,
|
|
@@ -12746,7 +12746,7 @@ const hd = ({ payload: t }, a, r, s, n, o) => {
|
|
|
12746
12746
|
/* @__PURE__ */ e(
|
|
12747
12747
|
Kn,
|
|
12748
12748
|
{
|
|
12749
|
-
width:
|
|
12749
|
+
width: g,
|
|
12750
12750
|
hide: !u,
|
|
12751
12751
|
axisLine: !1,
|
|
12752
12752
|
tickLine: !1,
|
|
@@ -12797,7 +12797,7 @@ const hd = ({ payload: t }, a, r, s, n, o) => {
|
|
|
12797
12797
|
) : /* @__PURE__ */ e(P, {})
|
|
12798
12798
|
}
|
|
12799
12799
|
),
|
|
12800
|
-
|
|
12800
|
+
y ? /* @__PURE__ */ e(
|
|
12801
12801
|
Yn,
|
|
12802
12802
|
{
|
|
12803
12803
|
verticalAlign: "top",
|
|
@@ -13104,25 +13104,25 @@ const mi = ({
|
|
|
13104
13104
|
Caption: ({ ...u }) => {
|
|
13105
13105
|
const {
|
|
13106
13106
|
goToMonth: p,
|
|
13107
|
-
nextMonth:
|
|
13107
|
+
nextMonth: g,
|
|
13108
13108
|
previousMonth: h,
|
|
13109
13109
|
currentMonth: f,
|
|
13110
|
-
displayMonths:
|
|
13111
|
-
} = no(), { numberOfMonths: x, fromDate:
|
|
13110
|
+
displayMonths: y
|
|
13111
|
+
} = no(), { numberOfMonths: x, fromDate: w, toDate: S } = oo(), k = y.findIndex(
|
|
13112
13112
|
(H) => Ln(u.displayMonth, H)
|
|
13113
|
-
), A = k === 0, v = k ===
|
|
13113
|
+
), A = k === 0, v = k === y.length - 1, C = x > 1 && (A || !v), $ = x > 1 && (v || !A), ie = () => {
|
|
13114
13114
|
const H = Bt(f, -1);
|
|
13115
|
-
h && (!
|
|
13115
|
+
h && (!w || H.getTime() >= w.getTime()) && p(H);
|
|
13116
13116
|
}, ae = () => {
|
|
13117
13117
|
const H = Bt(f, 1);
|
|
13118
|
-
|
|
13118
|
+
g && (!S || H.getTime() <= S.getTime()) && p(H);
|
|
13119
13119
|
};
|
|
13120
13120
|
return /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
13121
13121
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
13122
13122
|
s && !$ && /* @__PURE__ */ e(
|
|
13123
13123
|
ht,
|
|
13124
13124
|
{
|
|
13125
|
-
disabled: n || !h ||
|
|
13125
|
+
disabled: n || !h || w && Bt(f, -1).getTime() < w.getTime(),
|
|
13126
13126
|
"aria-label": "Go to previous year",
|
|
13127
13127
|
onClick: ie,
|
|
13128
13128
|
icon: ds
|
|
@@ -13151,16 +13151,16 @@ const mi = ({
|
|
|
13151
13151
|
!C && /* @__PURE__ */ e(
|
|
13152
13152
|
ht,
|
|
13153
13153
|
{
|
|
13154
|
-
disabled: n || !
|
|
13154
|
+
disabled: n || !g,
|
|
13155
13155
|
"aria-label": "Go to next month",
|
|
13156
|
-
onClick: () =>
|
|
13156
|
+
onClick: () => g && p(g),
|
|
13157
13157
|
icon: at
|
|
13158
13158
|
}
|
|
13159
13159
|
),
|
|
13160
13160
|
s && !C && /* @__PURE__ */ e(
|
|
13161
13161
|
ht,
|
|
13162
13162
|
{
|
|
13163
|
-
disabled: n || !
|
|
13163
|
+
disabled: n || !g || S && Bt(f, 1).getTime() > S.getTime(),
|
|
13164
13164
|
"aria-label": "Go to next year",
|
|
13165
13165
|
onClick: ae,
|
|
13166
13166
|
icon: cs
|
|
@@ -13170,17 +13170,17 @@ const mi = ({
|
|
|
13170
13170
|
] });
|
|
13171
13171
|
},
|
|
13172
13172
|
Day: ({ date: u, displayMonth: p }) => {
|
|
13173
|
-
const
|
|
13174
|
-
if (
|
|
13173
|
+
const g = N.useRef(null), { activeModifiers: h, buttonProps: f, divProps: y, isButton: x, isHidden: w } = io(u, p, g), { selected: S, today: k, disabled: A, range_middle: v } = h;
|
|
13174
|
+
if (w)
|
|
13175
13175
|
return /* @__PURE__ */ e(P, {});
|
|
13176
13176
|
if (!x)
|
|
13177
13177
|
return /* @__PURE__ */ e(
|
|
13178
13178
|
"div",
|
|
13179
13179
|
{
|
|
13180
|
-
...
|
|
13180
|
+
...y,
|
|
13181
13181
|
className: b(
|
|
13182
13182
|
"flex items-center justify-center",
|
|
13183
|
-
|
|
13183
|
+
y.className
|
|
13184
13184
|
)
|
|
13185
13185
|
}
|
|
13186
13186
|
);
|
|
@@ -13192,7 +13192,7 @@ const mi = ({
|
|
|
13192
13192
|
return /* @__PURE__ */ i(
|
|
13193
13193
|
"button",
|
|
13194
13194
|
{
|
|
13195
|
-
ref:
|
|
13195
|
+
ref: g,
|
|
13196
13196
|
...ie,
|
|
13197
13197
|
type: "button",
|
|
13198
13198
|
className: b("relative", $),
|
|
@@ -13389,12 +13389,12 @@ const fi = ({
|
|
|
13389
13389
|
const s = (u) => "dateRange" in u, n = (u) => "date" in u, o = (u) => {
|
|
13390
13390
|
s(u) ? a(u.dateRange) : n(u) && a(u.date);
|
|
13391
13391
|
}, l = (u, p) => u.getDate() === p.getDate() && u.getMonth() === p.getMonth() && u.getFullYear() === p.getFullYear(), d = (u, p) => {
|
|
13392
|
-
const
|
|
13392
|
+
const g = u.from, h = p.from;
|
|
13393
13393
|
let f = !1;
|
|
13394
|
-
|
|
13395
|
-
const
|
|
13396
|
-
let
|
|
13397
|
-
return
|
|
13394
|
+
g && h && l(g, h) && (f = !0);
|
|
13395
|
+
const y = u.to, x = p.to;
|
|
13396
|
+
let w = !1;
|
|
13397
|
+
return y && x && l(y, x) && (w = !0), f && w;
|
|
13398
13398
|
}, c = (u) => {
|
|
13399
13399
|
if (s(u)) {
|
|
13400
13400
|
const p = r;
|
|
@@ -13448,28 +13448,28 @@ const zr = (t, a, r) => {
|
|
|
13448
13448
|
locale: c = ro,
|
|
13449
13449
|
showTimePicker: u,
|
|
13450
13450
|
placeholder: p = "Select date range",
|
|
13451
|
-
hasError:
|
|
13451
|
+
hasError: g,
|
|
13452
13452
|
translations: h,
|
|
13453
13453
|
align: f = "center",
|
|
13454
|
-
className:
|
|
13454
|
+
className: y,
|
|
13455
13455
|
...x
|
|
13456
13456
|
}) => {
|
|
13457
|
-
const [
|
|
13457
|
+
const [w, S] = N.useState(!1), [k, A] = N.useState(
|
|
13458
13458
|
a ?? t ?? void 0
|
|
13459
13459
|
), [v, C] = N.useState(k == null ? void 0 : k.from), [$, ie] = N.useState(
|
|
13460
13460
|
a != null && a.from ? new re(a.from.getHours(), a.from.getMinutes()) : t != null && t.from ? new re(t.from.getHours(), t.from.getMinutes()) : new re(0, 0)
|
|
13461
13461
|
), [ae, H] = N.useState(
|
|
13462
13462
|
a != null && a.to ? new re(a.to.getHours(), a.to.getMinutes()) : t != null && t.to ? new re(t.to.getHours(), t.to.getMinutes()) : new re(0, 0)
|
|
13463
|
-
), J = N.useMemo(() => k, [
|
|
13463
|
+
), J = N.useMemo(() => k, [w]);
|
|
13464
13464
|
N.useEffect(() => {
|
|
13465
13465
|
A(a ?? t ?? void 0);
|
|
13466
13466
|
}, [a, t]), N.useEffect(() => {
|
|
13467
13467
|
k && C(k.from);
|
|
13468
13468
|
}, [k]), N.useEffect(() => {
|
|
13469
|
-
|
|
13470
|
-
}, [
|
|
13471
|
-
const Ce = (
|
|
13472
|
-
const B =
|
|
13469
|
+
w || C(k == null ? void 0 : k.from);
|
|
13470
|
+
}, [w]);
|
|
13471
|
+
const Ce = (D) => {
|
|
13472
|
+
const B = D;
|
|
13473
13473
|
u && (B != null && B.from && !$ && ie(new re(0, 0)), B != null && B.to && !ae && H(new re(0, 0)), B != null && B.from && $ && (B.from.setHours($.hour), B.from.setMinutes($.minute)), B != null && B.to && ae && (B.to.setHours(ae.hour), B.to.setMinutes(ae.minute))), A(B);
|
|
13474
13474
|
}, Ze = () => {
|
|
13475
13475
|
A(J), ie(
|
|
@@ -13477,15 +13477,15 @@ const zr = (t, a, r) => {
|
|
|
13477
13477
|
), H(
|
|
13478
13478
|
J != null && J.to ? new re(J.to.getHours(), J.to.getMinutes()) : new re(0, 0)
|
|
13479
13479
|
), S(!1);
|
|
13480
|
-
}, Ke = (
|
|
13481
|
-
|
|
13482
|
-
}, Z = (
|
|
13480
|
+
}, Ke = (D) => {
|
|
13481
|
+
D || Ze(), S(D);
|
|
13482
|
+
}, Z = (D, B) => {
|
|
13483
13483
|
switch (B) {
|
|
13484
13484
|
case "start":
|
|
13485
|
-
ie(
|
|
13485
|
+
ie(D);
|
|
13486
13486
|
break;
|
|
13487
13487
|
case "end":
|
|
13488
|
-
H(
|
|
13488
|
+
H(D);
|
|
13489
13489
|
break;
|
|
13490
13490
|
}
|
|
13491
13491
|
if (k) {
|
|
@@ -13493,7 +13493,7 @@ const zr = (t, a, r) => {
|
|
|
13493
13493
|
if (!k.from)
|
|
13494
13494
|
return;
|
|
13495
13495
|
const ce = new Date(k.from.getTime());
|
|
13496
|
-
|
|
13496
|
+
D ? (ce.setHours(D.hour), ce.setMinutes(D.minute)) : (ce.setHours(0), ce.setMinutes(0)), A({
|
|
13497
13497
|
...k,
|
|
13498
13498
|
from: ce
|
|
13499
13499
|
});
|
|
@@ -13502,7 +13502,7 @@ const zr = (t, a, r) => {
|
|
|
13502
13502
|
if (!k.to)
|
|
13503
13503
|
return;
|
|
13504
13504
|
const ce = new Date(k.to.getTime());
|
|
13505
|
-
|
|
13505
|
+
D ? (ce.setHours(D.hour), ce.setMinutes(D.minute)) : (ce.setHours(0), ce.setMinutes(0)), A({
|
|
13506
13506
|
...k,
|
|
13507
13507
|
to: ce
|
|
13508
13508
|
});
|
|
@@ -13526,7 +13526,7 @@ const zr = (t, a, r) => {
|
|
|
13526
13526
|
W.Root,
|
|
13527
13527
|
{
|
|
13528
13528
|
"tremor-id": "tremor-raw",
|
|
13529
|
-
open:
|
|
13529
|
+
open: w,
|
|
13530
13530
|
onOpenChange: Ke,
|
|
13531
13531
|
children: [
|
|
13532
13532
|
/* @__PURE__ */ e(
|
|
@@ -13534,8 +13534,8 @@ const zr = (t, a, r) => {
|
|
|
13534
13534
|
{
|
|
13535
13535
|
placeholder: p,
|
|
13536
13536
|
disabled: n,
|
|
13537
|
-
className:
|
|
13538
|
-
hasError:
|
|
13537
|
+
className: y,
|
|
13538
|
+
hasError: g,
|
|
13539
13539
|
"aria-required": x.required || x["aria-required"],
|
|
13540
13540
|
"aria-invalid": x["aria-invalid"],
|
|
13541
13541
|
"aria-label": x["aria-label"],
|
|
@@ -13593,7 +13593,7 @@ const zr = (t, a, r) => {
|
|
|
13593
13593
|
Ca,
|
|
13594
13594
|
{
|
|
13595
13595
|
value: $,
|
|
13596
|
-
onChange: (
|
|
13596
|
+
onChange: (D) => Z(D, "start"),
|
|
13597
13597
|
"aria-label": "Start date time",
|
|
13598
13598
|
isDisabled: !(k != null && k.from),
|
|
13599
13599
|
isRequired: x.required
|
|
@@ -13610,7 +13610,7 @@ const zr = (t, a, r) => {
|
|
|
13610
13610
|
Ca,
|
|
13611
13611
|
{
|
|
13612
13612
|
value: ae,
|
|
13613
|
-
onChange: (
|
|
13613
|
+
onChange: (D) => Z(D, "end"),
|
|
13614
13614
|
"aria-label": "End date time",
|
|
13615
13615
|
isDisabled: !(k != null && k.to),
|
|
13616
13616
|
isRequired: x.required
|
|
@@ -13660,7 +13660,7 @@ const zr = (t, a, r) => {
|
|
|
13660
13660
|
if (t && t.length > 0) {
|
|
13661
13661
|
const c = s, u = r;
|
|
13662
13662
|
t.forEach((p) => {
|
|
13663
|
-
var
|
|
13663
|
+
var g, h, f, y, x, w;
|
|
13664
13664
|
if ("date" in p) {
|
|
13665
13665
|
const S = p.date.getFullYear();
|
|
13666
13666
|
if (s && S < s)
|
|
@@ -13692,7 +13692,7 @@ const zr = (t, a, r) => {
|
|
|
13692
13692
|
);
|
|
13693
13693
|
}
|
|
13694
13694
|
if ("dateRange" in p) {
|
|
13695
|
-
const S = (
|
|
13695
|
+
const S = (g = p.dateRange.from) == null ? void 0 : g.getFullYear(), k = (h = p.dateRange.to) == null ? void 0 : h.getFullYear();
|
|
13696
13696
|
if (S && s && S < s)
|
|
13697
13697
|
throw new Error(
|
|
13698
13698
|
`Preset ${p.label}'s 'from' is before fromYear ${c}.`
|
|
@@ -13712,7 +13712,7 @@ const zr = (t, a, r) => {
|
|
|
13712
13712
|
);
|
|
13713
13713
|
}
|
|
13714
13714
|
if (o) {
|
|
13715
|
-
const A = (
|
|
13715
|
+
const A = (y = p.dateRange.to) == null ? void 0 : y.getMonth();
|
|
13716
13716
|
if (A && A > o.getMonth())
|
|
13717
13717
|
throw new Error(
|
|
13718
13718
|
`Preset ${p.label}'s 'to' is after toMonth ${U(
|
|
@@ -13729,7 +13729,7 @@ const zr = (t, a, r) => {
|
|
|
13729
13729
|
);
|
|
13730
13730
|
}
|
|
13731
13731
|
if (d) {
|
|
13732
|
-
const A = (
|
|
13732
|
+
const A = (w = p.dateRange.to) == null ? void 0 : w.getDate();
|
|
13733
13733
|
if (A && A > d.getDate())
|
|
13734
13734
|
throw new Error(
|
|
13735
13735
|
`Preset ${p.label}'s 'to' is after toDay ${U(
|
|
@@ -14130,9 +14130,9 @@ function Td({
|
|
|
14130
14130
|
setSelectedCategories: d,
|
|
14131
14131
|
selectedCategories: c
|
|
14132
14132
|
}) {
|
|
14133
|
-
const [u, p] = R.useState(c),
|
|
14133
|
+
const [u, p] = R.useState(c), g = (f) => {
|
|
14134
14134
|
p(
|
|
14135
|
-
(
|
|
14135
|
+
(y) => y.includes(f) ? y.filter((x) => x !== f) : [...y, f]
|
|
14136
14136
|
);
|
|
14137
14137
|
}, h = () => {
|
|
14138
14138
|
d(u);
|
|
@@ -14215,7 +14215,7 @@ function Td({
|
|
|
14215
14215
|
id: f.title,
|
|
14216
14216
|
className: "absolute right-4",
|
|
14217
14217
|
checked: u.includes(f.title),
|
|
14218
|
-
onCheckedChange: () =>
|
|
14218
|
+
onCheckedChange: () => g(f.title)
|
|
14219
14219
|
}
|
|
14220
14220
|
),
|
|
14221
14221
|
/* @__PURE__ */ e("div", { className: "pointer-events-none", children: /* @__PURE__ */ e(
|
|
@@ -14260,8 +14260,8 @@ function Qi({
|
|
|
14260
14260
|
selectedPeriod: s,
|
|
14261
14261
|
isThumbnail: n
|
|
14262
14262
|
}) {
|
|
14263
|
-
const o = Qd[a], l = r != null && r.from && (r != null && r.to) ? Jt(r.from, r.to) : null, d = r != null && r.from && (r != null && r.to) ? ss(Jt(r.from, r.to)) : null, c = Pi(r, s), u = c != null && c.from && (c != null && c.to) ? Jt(c.from, c.to) : null, p = Ra.filter((S) => l ? fr(S.date, l) : !0).sort((S, k) => new Date(S.date).getTime() - new Date(k.date).getTime()),
|
|
14264
|
-
const A = p[k], v =
|
|
14263
|
+
const o = Qd[a], l = r != null && r.from && (r != null && r.to) ? Jt(r.from, r.to) : null, d = r != null && r.from && (r != null && r.to) ? ss(Jt(r.from, r.to)) : null, c = Pi(r, s), u = c != null && c.from && (c != null && c.to) ? Jt(c.from, c.to) : null, p = Ra.filter((S) => l ? fr(S.date, l) : !0).sort((S, k) => new Date(S.date).getTime() - new Date(k.date).getTime()), g = Ra.filter((S) => u ? fr(S.date, u) : !1).sort((S, k) => new Date(S.date).getTime() - new Date(k.date).getTime()), h = d == null ? void 0 : d.map((S, k) => {
|
|
14264
|
+
const A = p[k], v = g[k], C = (A == null ? void 0 : A[t]) || null, $ = (v == null ? void 0 : v[t]) || null;
|
|
14265
14265
|
return {
|
|
14266
14266
|
title: t,
|
|
14267
14267
|
date: S,
|
|
@@ -14272,14 +14272,14 @@ function Qi({
|
|
|
14272
14272
|
previousValue: s !== "no-comparison" ? $ : null,
|
|
14273
14273
|
evolution: s !== "no-comparison" && C && $ ? (C - $) / $ : void 0
|
|
14274
14274
|
};
|
|
14275
|
-
}).sort((S, k) => new Date(S.date).getTime() - new Date(k.date).getTime()), f = s === "no-comparison" ? ["value"] : ["value", "previousValue"],
|
|
14275
|
+
}).sort((S, k) => new Date(S.date).getTime() - new Date(k.date).getTime()), f = s === "no-comparison" ? ["value"] : ["value", "previousValue"], y = (h == null ? void 0 : h.reduce((S, k) => S + (k.value || 0), 0)) || 0, x = (h == null ? void 0 : h.reduce((S, k) => S + (k.previousValue || 0), 0)) || 0, w = s !== "no-comparison" ? (y - x) / x : 0;
|
|
14276
14276
|
return /* @__PURE__ */ i("div", { className: Q("transition"), children: [
|
|
14277
14277
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-x-2", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-x-2", children: [
|
|
14278
14278
|
/* @__PURE__ */ e("dt", { className: "font-bold text-gray-900 sm:text-sm dark:text-gray-50", children: t }),
|
|
14279
|
-
s !== "no-comparison" && /* @__PURE__ */ e(Tt, { variant: Ti(
|
|
14279
|
+
s !== "no-comparison" && /* @__PURE__ */ e(Tt, { variant: Ti(w), children: ii(w) })
|
|
14280
14280
|
] }) }),
|
|
14281
14281
|
/* @__PURE__ */ i("div", { className: "mt-2 flex items-baseline justify-between", children: [
|
|
14282
|
-
/* @__PURE__ */ e("dd", { className: "text-xl text-gray-900 dark:text-gray-50", children: o(
|
|
14282
|
+
/* @__PURE__ */ e("dd", { className: "text-xl text-gray-900 dark:text-gray-50", children: o(y) }),
|
|
14283
14283
|
s !== "no-comparison" && /* @__PURE__ */ i("dd", { className: "text-sm text-gray-500", children: [
|
|
14284
14284
|
"from ",
|
|
14285
14285
|
o(x)
|
|
@@ -14935,11 +14935,11 @@ const Fd = ({ value: t, onChange: a }) => {
|
|
|
14935
14935
|
suffix: d,
|
|
14936
14936
|
...c
|
|
14937
14937
|
}, u) => {
|
|
14938
|
-
const [p,
|
|
14938
|
+
const [p, g] = R.useState(n), h = n === "password" && !o, f = n === "search" && !o, y = n === "textarea" ? "textarea" : "input";
|
|
14939
14939
|
return /* @__PURE__ */ i("div", { className: b("relative w-full", t), children: [
|
|
14940
14940
|
l && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-3 text-slate-600 dark:text-gray-600 z-10 text-sm border-r border-gray-200", children: l }),
|
|
14941
14941
|
/* @__PURE__ */ e(
|
|
14942
|
-
|
|
14942
|
+
y,
|
|
14943
14943
|
{
|
|
14944
14944
|
ref: u,
|
|
14945
14945
|
type: h ? p : n,
|
|
@@ -14968,7 +14968,7 @@ const Fd = ({ value: t, onChange: a }) => {
|
|
|
14968
14968
|
!d && h && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3", children: /* @__PURE__ */ e(
|
|
14969
14969
|
"button",
|
|
14970
14970
|
{
|
|
14971
|
-
onClick: () =>
|
|
14971
|
+
onClick: () => g(p === "password" ? "text" : "password"),
|
|
14972
14972
|
className: b(
|
|
14973
14973
|
de,
|
|
14974
14974
|
"text-gray-400 hover:text-gray-500 dark:text-gray-600"
|
|
@@ -14987,8 +14987,8 @@ const Vd = ({ ...t }) => {
|
|
|
14987
14987
|
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-muted-foreground/80 peer-disabled:opacity-50", children: /* @__PURE__ */ e(wn, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })
|
|
14988
14988
|
] }) });
|
|
14989
14989
|
}, Hd = (t) => {
|
|
14990
|
-
const { client: a } =
|
|
14991
|
-
const { body:
|
|
14990
|
+
const { client: a } = E(), [r, s] = I(!1), [n, o] = I(0), l = async (p) => {
|
|
14991
|
+
const { body: g, status: h } = await a.file.createTemporaryFile({
|
|
14992
14992
|
body: {
|
|
14993
14993
|
filename: p.name,
|
|
14994
14994
|
mimeType: p.type,
|
|
@@ -15002,22 +15002,22 @@ const Vd = ({ ...t }) => {
|
|
|
15002
15002
|
access: "public",
|
|
15003
15003
|
handleUploadUrl: `${process.env.NEXT_PUBLIC_API_BASE_URL}/api/files/token/vercel`,
|
|
15004
15004
|
clientPayload: JSON.stringify({
|
|
15005
|
-
fileId:
|
|
15005
|
+
fileId: g == null ? void 0 : g.id
|
|
15006
15006
|
}),
|
|
15007
|
-
onUploadProgress(
|
|
15008
|
-
o(
|
|
15007
|
+
onUploadProgress(y) {
|
|
15008
|
+
o(y.percentage);
|
|
15009
15009
|
}
|
|
15010
15010
|
});
|
|
15011
15011
|
return {
|
|
15012
|
-
id:
|
|
15012
|
+
id: g.id,
|
|
15013
15013
|
filename: p.name,
|
|
15014
15014
|
mimeType: p.type,
|
|
15015
15015
|
size: p.size,
|
|
15016
15016
|
url: f.url
|
|
15017
15017
|
};
|
|
15018
15018
|
}, d = async (p) => {
|
|
15019
|
-
var
|
|
15020
|
-
if ((
|
|
15019
|
+
var g;
|
|
15020
|
+
if ((g = p.target.files) != null && g[0]) {
|
|
15021
15021
|
s(!0);
|
|
15022
15022
|
try {
|
|
15023
15023
|
const h = await l(p.target.files[0]);
|
|
@@ -15036,8 +15036,8 @@ const Vd = ({ ...t }) => {
|
|
|
15036
15036
|
if (t.multiple) {
|
|
15037
15037
|
if (!t.value)
|
|
15038
15038
|
return t.onChange(void 0);
|
|
15039
|
-
const
|
|
15040
|
-
t.onChange(
|
|
15039
|
+
const g = t.value.filter((h) => h.id !== p);
|
|
15040
|
+
t.onChange(g.length ? g : void 0);
|
|
15041
15041
|
} else
|
|
15042
15042
|
t.onChange(void 0);
|
|
15043
15043
|
};
|
|
@@ -15045,7 +15045,7 @@ const Vd = ({ ...t }) => {
|
|
|
15045
15045
|
if (t.value) {
|
|
15046
15046
|
const p = t.multiple ? t.value : [t.value];
|
|
15047
15047
|
return /* @__PURE__ */ i("div", { className: "flex", children: [
|
|
15048
|
-
p.map((
|
|
15048
|
+
p.map((g) => /* @__PURE__ */ e(
|
|
15049
15049
|
"div",
|
|
15050
15050
|
{
|
|
15051
15051
|
className: "flex flex-col w-40 h-40 mr-3 transition-all rounded-lg relative animate-fade",
|
|
@@ -15054,15 +15054,15 @@ const Vd = ({ ...t }) => {
|
|
|
15054
15054
|
"button",
|
|
15055
15055
|
{
|
|
15056
15056
|
className: "absolute w-6 h-6 bg-black flex items-center justify-center rounded-md right-1 top-1",
|
|
15057
|
-
onClick: () => c(
|
|
15057
|
+
onClick: () => c(g.id),
|
|
15058
15058
|
children: /* @__PURE__ */ e(qt, { className: "w-4 h-4 text-white" })
|
|
15059
15059
|
}
|
|
15060
15060
|
),
|
|
15061
15061
|
/* @__PURE__ */ e(
|
|
15062
15062
|
xe,
|
|
15063
15063
|
{
|
|
15064
|
-
src:
|
|
15065
|
-
alt:
|
|
15064
|
+
src: g.url,
|
|
15065
|
+
alt: g.filename,
|
|
15066
15066
|
width: 160,
|
|
15067
15067
|
height: 160,
|
|
15068
15068
|
className: "w-40 h-40 rounded-md object-cover"
|
|
@@ -15070,7 +15070,7 @@ const Vd = ({ ...t }) => {
|
|
|
15070
15070
|
)
|
|
15071
15071
|
] })
|
|
15072
15072
|
},
|
|
15073
|
-
|
|
15073
|
+
g.id
|
|
15074
15074
|
)),
|
|
15075
15075
|
t.multiple && /* @__PURE__ */ i(
|
|
15076
15076
|
"div",
|
|
@@ -15221,15 +15221,15 @@ const Zd = ({
|
|
|
15221
15221
|
placeholder: n
|
|
15222
15222
|
}) => {
|
|
15223
15223
|
var p;
|
|
15224
|
-
const o = Ee(), [l, d] = I(!1), c = (
|
|
15224
|
+
const o = Ee(), [l, d] = I(!1), c = (g) => {
|
|
15225
15225
|
if (s) {
|
|
15226
15226
|
let h;
|
|
15227
|
-
Array.isArray(a) && a.includes(
|
|
15227
|
+
Array.isArray(a) && a.includes(g) ? h = a.filter((f) => f !== g) : h = Array.isArray(a) ? [...a, g] : [g], r(h);
|
|
15228
15228
|
} else
|
|
15229
|
-
r(
|
|
15230
|
-
}, u = (
|
|
15229
|
+
r(g), d(!1);
|
|
15230
|
+
}, u = (g) => {
|
|
15231
15231
|
if (s && Array.isArray(a)) {
|
|
15232
|
-
const h = a.filter((f) => f !==
|
|
15232
|
+
const h = a.filter((f) => f !== g);
|
|
15233
15233
|
r(h);
|
|
15234
15234
|
}
|
|
15235
15235
|
};
|
|
@@ -15243,9 +15243,9 @@ const Zd = ({
|
|
|
15243
15243
|
variant: "secondary",
|
|
15244
15244
|
className: "w-full justify-between shadow-xs! bg-background px-2! py-1 min-h-[41.6px] font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20",
|
|
15245
15245
|
children: [
|
|
15246
|
-
(a == null ? void 0 : a.length) > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: Array.isArray(a) ? a.map((
|
|
15246
|
+
(a == null ? void 0 : a.length) > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: Array.isArray(a) ? a.map((g) => {
|
|
15247
15247
|
const h = t.find(
|
|
15248
|
-
(f) => f.value ===
|
|
15248
|
+
(f) => f.value === g
|
|
15249
15249
|
);
|
|
15250
15250
|
return h ? /* @__PURE__ */ i(
|
|
15251
15251
|
"span",
|
|
@@ -15258,16 +15258,16 @@ const Zd = ({
|
|
|
15258
15258
|
{
|
|
15259
15259
|
size: 12,
|
|
15260
15260
|
onClick: (f) => {
|
|
15261
|
-
f.preventDefault(), u(
|
|
15261
|
+
f.preventDefault(), u(g);
|
|
15262
15262
|
},
|
|
15263
15263
|
className: "cursor-pointer ml-1"
|
|
15264
15264
|
}
|
|
15265
15265
|
)
|
|
15266
15266
|
]
|
|
15267
15267
|
},
|
|
15268
|
-
|
|
15268
|
+
g
|
|
15269
15269
|
) : null;
|
|
15270
|
-
}) : /* @__PURE__ */ e("span", { className: "px-1 text-sm", children: (p = t.find((
|
|
15270
|
+
}) : /* @__PURE__ */ e("span", { className: "px-1 text-sm", children: (p = t.find((g) => g.value === a)) == null ? void 0 : p.label }) }) : /* @__PURE__ */ e("span", { className: "px-1 text-sm text-gray-400", children: n || (s ? "Select options" : "Select an option") }),
|
|
15271
15271
|
/* @__PURE__ */ e(
|
|
15272
15272
|
_e,
|
|
15273
15273
|
{
|
|
@@ -15296,18 +15296,18 @@ const Zd = ({
|
|
|
15296
15296
|
),
|
|
15297
15297
|
/* @__PURE__ */ i(ar, { children: [
|
|
15298
15298
|
/* @__PURE__ */ e(rr, { children: "No options found." }),
|
|
15299
|
-
/* @__PURE__ */ e(sr, { children: t.map((
|
|
15299
|
+
/* @__PURE__ */ e(sr, { children: t.map((g) => /* @__PURE__ */ i(
|
|
15300
15300
|
ir,
|
|
15301
15301
|
{
|
|
15302
|
-
value:
|
|
15302
|
+
value: g.label,
|
|
15303
15303
|
className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
15304
|
-
onSelect: () => c(
|
|
15304
|
+
onSelect: () => c(g.value),
|
|
15305
15305
|
children: [
|
|
15306
|
-
|
|
15307
|
-
(s ? a.includes(
|
|
15306
|
+
g.label,
|
|
15307
|
+
(s ? a.includes(g.value) : a === g.value) && /* @__PURE__ */ e(kt, { size: 16, strokeWidth: 2, className: "ml-auto" })
|
|
15308
15308
|
]
|
|
15309
15309
|
},
|
|
15310
|
-
|
|
15310
|
+
g.value
|
|
15311
15311
|
)) })
|
|
15312
15312
|
] })
|
|
15313
15313
|
] })
|
|
@@ -15425,7 +15425,7 @@ const _d = ({
|
|
|
15425
15425
|
{
|
|
15426
15426
|
options: n,
|
|
15427
15427
|
value: p,
|
|
15428
|
-
onChange: (
|
|
15428
|
+
onChange: (g) => u(t, g),
|
|
15429
15429
|
placeholder: r,
|
|
15430
15430
|
multiple: s
|
|
15431
15431
|
}
|
|
@@ -15478,7 +15478,7 @@ const _d = ({
|
|
|
15478
15478
|
localizable: c,
|
|
15479
15479
|
prefix: u
|
|
15480
15480
|
}) => {
|
|
15481
|
-
const { errors: p } = Gt(),
|
|
15481
|
+
const { errors: p } = Gt(), g = Gd(p, a);
|
|
15482
15482
|
return /* @__PURE__ */ i(
|
|
15483
15483
|
"div",
|
|
15484
15484
|
{
|
|
@@ -15520,7 +15520,7 @@ const _d = ({
|
|
|
15520
15520
|
prefix: u
|
|
15521
15521
|
}
|
|
15522
15522
|
),
|
|
15523
|
-
(
|
|
15523
|
+
(g == null ? void 0 : g.message) && /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-red-500", children: g.message })
|
|
15524
15524
|
]
|
|
15525
15525
|
}
|
|
15526
15526
|
);
|
|
@@ -15538,7 +15538,7 @@ const _d = ({
|
|
|
15538
15538
|
a.label && /* @__PURE__ */ e("h4", { className: "text-2xl flex items-center justify-between font-semibold", children: a.label }),
|
|
15539
15539
|
a.description && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500", children: a.description }),
|
|
15540
15540
|
o.map((u, p) => {
|
|
15541
|
-
var
|
|
15541
|
+
var g;
|
|
15542
15542
|
return /* @__PURE__ */ i(P, { children: [
|
|
15543
15543
|
/* @__PURE__ */ e(
|
|
15544
15544
|
"div",
|
|
@@ -15552,13 +15552,13 @@ const _d = ({
|
|
|
15552
15552
|
"grid-cols-4": r === 4
|
|
15553
15553
|
}
|
|
15554
15554
|
),
|
|
15555
|
-
children: (
|
|
15555
|
+
children: (g = a.fields) == null ? void 0 : g.map(
|
|
15556
15556
|
({
|
|
15557
15557
|
name: h,
|
|
15558
15558
|
label: f,
|
|
15559
|
-
type:
|
|
15559
|
+
type: y,
|
|
15560
15560
|
colspan: x,
|
|
15561
|
-
localizable:
|
|
15561
|
+
localizable: w,
|
|
15562
15562
|
multiple: S,
|
|
15563
15563
|
options: k,
|
|
15564
15564
|
placeholder: A,
|
|
@@ -15568,8 +15568,8 @@ const _d = ({
|
|
|
15568
15568
|
{
|
|
15569
15569
|
name: `${a.name}[${p}].${h}`,
|
|
15570
15570
|
label: f,
|
|
15571
|
-
type:
|
|
15572
|
-
localizable:
|
|
15571
|
+
type: y ?? "text",
|
|
15572
|
+
localizable: w,
|
|
15573
15573
|
className: b({
|
|
15574
15574
|
"col-span-1": x === 1,
|
|
15575
15575
|
"col-span-2": x === 2,
|
|
@@ -15644,7 +15644,7 @@ const _d = ({
|
|
|
15644
15644
|
colspan: c,
|
|
15645
15645
|
localizable: u,
|
|
15646
15646
|
multiple: p,
|
|
15647
|
-
options:
|
|
15647
|
+
options: g,
|
|
15648
15648
|
placeholder: h,
|
|
15649
15649
|
prefix: f
|
|
15650
15650
|
}) => /* @__PURE__ */ e(
|
|
@@ -15662,7 +15662,7 @@ const _d = ({
|
|
|
15662
15662
|
}),
|
|
15663
15663
|
placeholder: h,
|
|
15664
15664
|
multiple: p,
|
|
15665
|
-
options:
|
|
15665
|
+
options: g,
|
|
15666
15666
|
prefix: f
|
|
15667
15667
|
},
|
|
15668
15668
|
`${t.name}.${o}`
|
|
@@ -15746,8 +15746,8 @@ const Le = ({
|
|
|
15746
15746
|
columns: l = 2,
|
|
15747
15747
|
onSubmit: d
|
|
15748
15748
|
}) => {
|
|
15749
|
-
const c = t.watch("translations"), { organization: u, defaultLocale: p, supportedLocales:
|
|
15750
|
-
() => r.some((
|
|
15749
|
+
const c = t.watch("translations"), { organization: u, defaultLocale: p, supportedLocales: g } = he(), [h, f] = I(), y = be(
|
|
15750
|
+
() => r.some((w) => w.localizable),
|
|
15751
15751
|
[r]
|
|
15752
15752
|
);
|
|
15753
15753
|
K(() => {
|
|
@@ -15756,7 +15756,7 @@ const Le = ({
|
|
|
15756
15756
|
u.data,
|
|
15757
15757
|
p,
|
|
15758
15758
|
t,
|
|
15759
|
-
|
|
15759
|
+
g,
|
|
15760
15760
|
c
|
|
15761
15761
|
]), K(() => {
|
|
15762
15762
|
t.formState.errors.translations && f(p);
|
|
@@ -15771,24 +15771,24 @@ const Le = ({
|
|
|
15771
15771
|
"grid-cols-4": l === 4
|
|
15772
15772
|
}),
|
|
15773
15773
|
children: [
|
|
15774
|
-
|
|
15775
|
-
const S =
|
|
15774
|
+
y && /* @__PURE__ */ e("div", { className: "col-span-full", children: /* @__PURE__ */ e(cr, { className: "col-span-full mb-3", children: g.map((w) => {
|
|
15775
|
+
const S = w === p;
|
|
15776
15776
|
return /* @__PURE__ */ e(
|
|
15777
15777
|
ur,
|
|
15778
15778
|
{
|
|
15779
|
-
active:
|
|
15780
|
-
onClick: () => f(
|
|
15779
|
+
active: w === h,
|
|
15780
|
+
onClick: () => f(w),
|
|
15781
15781
|
className: "cursor-pointer",
|
|
15782
15782
|
children: /* @__PURE__ */ i(P, { children: [
|
|
15783
|
-
sa.get(
|
|
15783
|
+
sa.get(w),
|
|
15784
15784
|
" ",
|
|
15785
15785
|
S && "(Default)"
|
|
15786
15786
|
] })
|
|
15787
15787
|
},
|
|
15788
|
-
|
|
15788
|
+
w
|
|
15789
15789
|
);
|
|
15790
15790
|
}) }) }),
|
|
15791
|
-
r.map((
|
|
15791
|
+
r.map((w) => {
|
|
15792
15792
|
const {
|
|
15793
15793
|
name: S,
|
|
15794
15794
|
label: k,
|
|
@@ -15799,8 +15799,8 @@ const Le = ({
|
|
|
15799
15799
|
options: ie,
|
|
15800
15800
|
placeholder: ae,
|
|
15801
15801
|
prefix: H
|
|
15802
|
-
} =
|
|
15803
|
-
return A === "object" ? /* @__PURE__ */ e(Kd, { config:
|
|
15802
|
+
} = w, J = !C || !h ? S : `translations[${g == null ? void 0 : g.indexOf(h)}].${S}`;
|
|
15803
|
+
return A === "object" ? /* @__PURE__ */ e(Kd, { config: w }, S) : A === "array" ? /* @__PURE__ */ e(qd, { form: t, config: w }, S) : /* @__PURE__ */ e(
|
|
15804
15804
|
dr,
|
|
15805
15805
|
{
|
|
15806
15806
|
name: J,
|
|
@@ -15847,7 +15847,7 @@ const Le = ({
|
|
|
15847
15847
|
]
|
|
15848
15848
|
}
|
|
15849
15849
|
);
|
|
15850
|
-
return d ? /* @__PURE__ */ e(rt, { ...t, children: /* @__PURE__ */ e("form", { onSubmit: t.handleSubmit((
|
|
15850
|
+
return d ? /* @__PURE__ */ e(rt, { ...t, children: /* @__PURE__ */ e("form", { onSubmit: t.handleSubmit((w) => d(w)), children: x }) }) : /* @__PURE__ */ e("div", { className: "w-full", children: x });
|
|
15851
15851
|
}, Yd = [
|
|
15852
15852
|
{
|
|
15853
15853
|
name: "name",
|
|
@@ -15870,7 +15870,7 @@ const Le = ({
|
|
|
15870
15870
|
type: "file"
|
|
15871
15871
|
}
|
|
15872
15872
|
], Mi = ({ initialData: t }) => {
|
|
15873
|
-
const { client: a } =
|
|
15873
|
+
const { client: a } = E(), r = Y(), s = te(), n = ee(), { defaultLocale: o, supportedLocales: l } = he(), c = pe({
|
|
15874
15874
|
resolver: ge(t ? jo : Fo),
|
|
15875
15875
|
defaultValues: t ? {
|
|
15876
15876
|
defaultLocale: o,
|
|
@@ -15883,35 +15883,35 @@ const Le = ({
|
|
|
15883
15883
|
}
|
|
15884
15884
|
}), u = G({
|
|
15885
15885
|
mutationFn: async (f) => {
|
|
15886
|
-
var
|
|
15887
|
-
const
|
|
15886
|
+
var w;
|
|
15887
|
+
const y = {
|
|
15888
15888
|
name: f.name,
|
|
15889
15889
|
defaultLocale: f.defaultLocale,
|
|
15890
15890
|
translations: f.translations,
|
|
15891
|
-
logoId: (
|
|
15891
|
+
logoId: (w = f.logo) == null ? void 0 : w.id
|
|
15892
15892
|
}, { status: x } = await a.manufacturer.createManufacturer({
|
|
15893
15893
|
params: { organizationId: n },
|
|
15894
|
-
body:
|
|
15894
|
+
body: y
|
|
15895
15895
|
});
|
|
15896
15896
|
if (x !== 201)
|
|
15897
15897
|
throw se.error("Failed to create manufacturer. Please try again later."), new Error("Failed to create manufacturer");
|
|
15898
15898
|
}
|
|
15899
15899
|
}), p = G({
|
|
15900
15900
|
mutationFn: async (f) => {
|
|
15901
|
-
var
|
|
15902
|
-
const
|
|
15901
|
+
var w;
|
|
15902
|
+
const y = {
|
|
15903
15903
|
name: f.name,
|
|
15904
15904
|
defaultLocale: f.defaultLocale,
|
|
15905
15905
|
translations: f.translations,
|
|
15906
|
-
logoId: ((
|
|
15906
|
+
logoId: ((w = f.logo) == null ? void 0 : w.id) || null
|
|
15907
15907
|
}, { status: x } = await a.manufacturer.updateManufacturer({
|
|
15908
15908
|
params: { organizationId: n, id: t.id },
|
|
15909
|
-
body:
|
|
15909
|
+
body: y
|
|
15910
15910
|
});
|
|
15911
15911
|
if (x !== 200)
|
|
15912
15912
|
throw se.error("Failed to update manufacturer. Please try again later."), new Error("Failed to update manufacturer");
|
|
15913
15913
|
}
|
|
15914
|
-
}),
|
|
15914
|
+
}), g = async () => {
|
|
15915
15915
|
se.success("Manufacturer saved successfully"), r.push(s.manufacturers(n)), await Qe.invalidateQueries({ queryKey: ["manufacturers"] });
|
|
15916
15916
|
};
|
|
15917
15917
|
return /* @__PURE__ */ e(
|
|
@@ -15920,7 +15920,7 @@ const Le = ({
|
|
|
15920
15920
|
form: c,
|
|
15921
15921
|
config: Yd,
|
|
15922
15922
|
onSubmit: (f) => {
|
|
15923
|
-
t ? p.mutate(f, { onSuccess:
|
|
15923
|
+
t ? p.mutate(f, { onSuccess: g }) : u.mutate(f, { onSuccess: g });
|
|
15924
15924
|
},
|
|
15925
15925
|
loading: u.isPending || p.isPending,
|
|
15926
15926
|
cancelText: "Go back",
|
|
@@ -15949,7 +15949,7 @@ function ec() {
|
|
|
15949
15949
|
] });
|
|
15950
15950
|
}
|
|
15951
15951
|
function tc() {
|
|
15952
|
-
const t = ee(), a = Pt(), { client: r } =
|
|
15952
|
+
const t = ee(), a = Pt(), { client: r } = E(), { isLoading: s, data: n } = q({
|
|
15953
15953
|
queryKey: ["manufacturers", t, a],
|
|
15954
15954
|
queryFn: async () => {
|
|
15955
15955
|
const { status: o, body: l } = await r.manufacturer.getManufacturer({
|
|
@@ -16285,11 +16285,11 @@ function oc({
|
|
|
16285
16285
|
meta: t,
|
|
16286
16286
|
table: a
|
|
16287
16287
|
}) {
|
|
16288
|
-
const s = me(), n = Y(), o = st(), l = Number((s == null ? void 0 : s.get("page")) || "1"), d = (
|
|
16289
|
-
const
|
|
16290
|
-
return
|
|
16291
|
-
}, c = (
|
|
16292
|
-
n.push(`${o}?${d("page",
|
|
16288
|
+
const s = me(), n = Y(), o = st(), l = Number((s == null ? void 0 : s.get("page")) || "1"), d = (y, x) => {
|
|
16289
|
+
const w = new URLSearchParams(s == null ? void 0 : s.toString());
|
|
16290
|
+
return w.set(y, x), w.toString();
|
|
16291
|
+
}, c = (y) => {
|
|
16292
|
+
n.push(`${o}?${d("page", y.toString())}`);
|
|
16293
16293
|
}, u = [
|
|
16294
16294
|
{
|
|
16295
16295
|
icon: ds,
|
|
@@ -16341,18 +16341,18 @@ function oc({
|
|
|
16341
16341
|
" ",
|
|
16342
16342
|
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900 dark:text-gray-50", children: p })
|
|
16343
16343
|
] }),
|
|
16344
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-x-1.5", children: u.map((
|
|
16344
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-x-1.5", children: u.map((y, x) => /* @__PURE__ */ i(
|
|
16345
16345
|
T,
|
|
16346
16346
|
{
|
|
16347
16347
|
variant: "secondary",
|
|
16348
|
-
className: b(
|
|
16348
|
+
className: b(y.mobileView, "p-1.5"),
|
|
16349
16349
|
onClick: () => {
|
|
16350
|
-
|
|
16350
|
+
y.onClick(), a.resetRowSelection();
|
|
16351
16351
|
},
|
|
16352
|
-
disabled:
|
|
16352
|
+
disabled: y.disabled,
|
|
16353
16353
|
children: [
|
|
16354
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children:
|
|
16355
|
-
/* @__PURE__ */ e(
|
|
16354
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: y.srText }),
|
|
16355
|
+
/* @__PURE__ */ e(y.icon, { className: "size-4 shrink-0", "aria-hidden": "true" })
|
|
16356
16356
|
]
|
|
16357
16357
|
},
|
|
16358
16358
|
x
|
|
@@ -16370,7 +16370,7 @@ function ut({
|
|
|
16370
16370
|
refetch: l
|
|
16371
16371
|
}) {
|
|
16372
16372
|
var h, f;
|
|
16373
|
-
const d = ee(), c = te(), [u, p] = N.useState({}),
|
|
16373
|
+
const d = ee(), c = te(), [u, p] = N.useState({}), g = lo({
|
|
16374
16374
|
data: s,
|
|
16375
16375
|
columns: a,
|
|
16376
16376
|
state: {
|
|
@@ -16394,18 +16394,18 @@ function ut({
|
|
|
16394
16394
|
] }) })
|
|
16395
16395
|
) : /* @__PURE__ */ i(P, { children: [
|
|
16396
16396
|
/* @__PURE__ */ i(Bi, { children: [
|
|
16397
|
-
/* @__PURE__ */ e(Ji, { children:
|
|
16397
|
+
/* @__PURE__ */ e(Ji, { children: g.getHeaderGroups().map((y) => /* @__PURE__ */ e(
|
|
16398
16398
|
ft,
|
|
16399
16399
|
{
|
|
16400
16400
|
className: "border-y border-gray-200 dark:border-gray-800 back",
|
|
16401
|
-
children:
|
|
16402
|
-
var
|
|
16401
|
+
children: y.headers.map((x) => {
|
|
16402
|
+
var w;
|
|
16403
16403
|
return /* @__PURE__ */ e(
|
|
16404
16404
|
Oi,
|
|
16405
16405
|
{
|
|
16406
16406
|
className: b(
|
|
16407
16407
|
"whitespace-nowrap py-1 text-sm sm:text-xs",
|
|
16408
|
-
(
|
|
16408
|
+
(w = x.column.columnDef.meta) == null ? void 0 : w.className
|
|
16409
16409
|
),
|
|
16410
16410
|
children: kr(
|
|
16411
16411
|
x.column.columnDef.header,
|
|
@@ -16416,7 +16416,7 @@ function ut({
|
|
|
16416
16416
|
);
|
|
16417
16417
|
})
|
|
16418
16418
|
},
|
|
16419
|
-
|
|
16419
|
+
y.id
|
|
16420
16420
|
)) }),
|
|
16421
16421
|
/* @__PURE__ */ i(Fi, { children: [
|
|
16422
16422
|
r && /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(
|
|
@@ -16427,22 +16427,22 @@ function ut({
|
|
|
16427
16427
|
children: "An error occurred while fetching data. Please refresh the site and try again."
|
|
16428
16428
|
}
|
|
16429
16429
|
) }),
|
|
16430
|
-
((h =
|
|
16430
|
+
((h = g.getRowModel().rows) == null ? void 0 : h.length) > 0 && g.getRowModel().rows.map((y) => /* @__PURE__ */ e(
|
|
16431
16431
|
ft,
|
|
16432
16432
|
{
|
|
16433
16433
|
className: "group select-none hover:bg-gray-50 dark:hover:bg-gray-900",
|
|
16434
|
-
children:
|
|
16434
|
+
children: y.getVisibleCells().map((x, w) => {
|
|
16435
16435
|
var S;
|
|
16436
16436
|
return /* @__PURE__ */ i(
|
|
16437
16437
|
Ot,
|
|
16438
16438
|
{
|
|
16439
16439
|
className: b(
|
|
16440
|
-
|
|
16440
|
+
y.getIsSelected() ? "bg-gray-50 dark:bg-gray-900" : "",
|
|
16441
16441
|
"relative whitespace-nowrap py-1 text-gray-600 first:w-10 dark:text-gray-400",
|
|
16442
16442
|
(S = x.column.columnDef.meta) == null ? void 0 : S.className
|
|
16443
16443
|
),
|
|
16444
16444
|
children: [
|
|
16445
|
-
|
|
16445
|
+
w === 0 && y.getIsSelected() && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 w-0.5 bg-blue-600 dark:bg-blue-500" }),
|
|
16446
16446
|
kr(
|
|
16447
16447
|
x.column.columnDef.cell,
|
|
16448
16448
|
x.getContext()
|
|
@@ -16453,9 +16453,9 @@ function ut({
|
|
|
16453
16453
|
);
|
|
16454
16454
|
})
|
|
16455
16455
|
},
|
|
16456
|
-
|
|
16456
|
+
y.id
|
|
16457
16457
|
)),
|
|
16458
|
-
((f =
|
|
16458
|
+
((f = g.getRowModel().rows) == null ? void 0 : f.length) === 0 && !n && /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(
|
|
16459
16459
|
Ot,
|
|
16460
16460
|
{
|
|
16461
16461
|
colSpan: a.length,
|
|
@@ -16471,9 +16471,9 @@ function ut({
|
|
|
16471
16471
|
/* @__PURE__ */ e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })
|
|
16472
16472
|
] }) })
|
|
16473
16473
|
] }),
|
|
16474
|
-
/* @__PURE__ */ e(nc, { table:
|
|
16474
|
+
/* @__PURE__ */ e(nc, { table: g, rowSelection: u })
|
|
16475
16475
|
] }),
|
|
16476
|
-
t && /* @__PURE__ */ e(oc, { meta: t, table:
|
|
16476
|
+
t && /* @__PURE__ */ e(oc, { meta: t, table: g })
|
|
16477
16477
|
] }) });
|
|
16478
16478
|
}
|
|
16479
16479
|
const lc = Re({
|
|
@@ -17007,7 +17007,7 @@ const Ye = it(), uc = [
|
|
|
17007
17007
|
}
|
|
17008
17008
|
})
|
|
17009
17009
|
], pc = () => {
|
|
17010
|
-
const { client: t } =
|
|
17010
|
+
const { client: t } = E(), a = te(), r = ee(), s = me(), [n, o] = I(""), [l] = Ge(n, 300), d = Number((s == null ? void 0 : s.get("page")) || "1"), { isLoading: c, isRefetching: u, isError: p, data: g } = q({
|
|
17011
17011
|
queryKey: ["manufacturers", r, d, l],
|
|
17012
17012
|
queryFn: async () => {
|
|
17013
17013
|
const { body: h, status: f } = await t.manufacturer.getManufacturers({
|
|
@@ -17055,8 +17055,8 @@ const Ye = it(), uc = [
|
|
|
17055
17055
|
{
|
|
17056
17056
|
error: p,
|
|
17057
17057
|
loading: c || u,
|
|
17058
|
-
meta:
|
|
17059
|
-
data: (
|
|
17058
|
+
meta: g != null && g.meta ? { ...g == null ? void 0 : g.meta, currentPage: d } : void 0,
|
|
17059
|
+
data: (g == null ? void 0 : g.list) || [],
|
|
17060
17060
|
columns: uc,
|
|
17061
17061
|
className: "mt-8"
|
|
17062
17062
|
}
|
|
@@ -17075,8 +17075,8 @@ const gc = ({
|
|
|
17075
17075
|
status: r,
|
|
17076
17076
|
refetch: s
|
|
17077
17077
|
}) => {
|
|
17078
|
-
var
|
|
17079
|
-
const { client: n } =
|
|
17078
|
+
var y;
|
|
17079
|
+
const { client: n } = E(), o = G({
|
|
17080
17080
|
mutationFn: async ({ operation: x }) => {
|
|
17081
17081
|
if ((await n.order.updateStatus({
|
|
17082
17082
|
params: {
|
|
@@ -17123,7 +17123,7 @@ const gc = ({
|
|
|
17123
17123
|
x && o.mutate({ operation: x });
|
|
17124
17124
|
}, c = () => {
|
|
17125
17125
|
o.mutate({ operation: "cancelled" });
|
|
17126
|
-
}, u = o.isPending, p = (
|
|
17126
|
+
}, u = o.isPending, p = (y = o.variables) == null ? void 0 : y.operation;
|
|
17127
17127
|
return /* @__PURE__ */ i("div", { className: "flex items-center gap-2 min-w-28", children: [
|
|
17128
17128
|
/* @__PURE__ */ i(
|
|
17129
17129
|
"button",
|
|
@@ -17157,7 +17157,7 @@ const gc = ({
|
|
|
17157
17157
|
onOpenChange: a,
|
|
17158
17158
|
order: r
|
|
17159
17159
|
}) => {
|
|
17160
|
-
var o, l, d, c, u, p,
|
|
17160
|
+
var o, l, d, c, u, p, g;
|
|
17161
17161
|
if (!r) return null;
|
|
17162
17162
|
const s = (h) => new Intl.NumberFormat("en-US", {
|
|
17163
17163
|
style: "currency",
|
|
@@ -17299,7 +17299,7 @@ const gc = ({
|
|
|
17299
17299
|
/* @__PURE__ */ i("div", { className: "mt-6 bg-gray-50 dark:bg-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-800", children: [
|
|
17300
17300
|
/* @__PURE__ */ e("h3", { className: "font-medium text-gray-900 dark:text-gray-100 mb-3", children: "Order Items" }),
|
|
17301
17301
|
/* @__PURE__ */ e("div", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: r.items.map((h, f) => {
|
|
17302
|
-
const
|
|
17302
|
+
const y = h.translations.find((x) => x.locale === "en") || h.translations[0];
|
|
17303
17303
|
return /* @__PURE__ */ i(
|
|
17304
17304
|
"div",
|
|
17305
17305
|
{
|
|
@@ -17310,13 +17310,13 @@ const gc = ({
|
|
|
17310
17310
|
"img",
|
|
17311
17311
|
{
|
|
17312
17312
|
src: h.image.url,
|
|
17313
|
-
alt: (
|
|
17313
|
+
alt: (y == null ? void 0 : y.title) || "Product",
|
|
17314
17314
|
className: "h-full w-full object-cover"
|
|
17315
17315
|
}
|
|
17316
17316
|
) }),
|
|
17317
17317
|
/* @__PURE__ */ i("div", { children: [
|
|
17318
|
-
/* @__PURE__ */ e("h4", { className: "font-medium", children: (
|
|
17319
|
-
(
|
|
17318
|
+
/* @__PURE__ */ e("h4", { className: "font-medium", children: (y == null ? void 0 : y.title) || "Product" }),
|
|
17319
|
+
(y == null ? void 0 : y.subtitle) && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500", children: y.subtitle }),
|
|
17320
17320
|
/* @__PURE__ */ i("p", { className: "text-sm mt-1", children: [
|
|
17321
17321
|
s(h.unitPrice),
|
|
17322
17322
|
" × ",
|
|
@@ -17332,7 +17332,7 @@ const gc = ({
|
|
|
17332
17332
|
}) }),
|
|
17333
17333
|
/* @__PURE__ */ e("div", { className: "mt-4 pt-4 border-t border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ i("div", { className: "flex justify-between items-center", children: [
|
|
17334
17334
|
/* @__PURE__ */ e("span", { className: "font-medium", children: "Total" }),
|
|
17335
|
-
/* @__PURE__ */ e("span", { className: "font-bold text-lg", children: s(Number((
|
|
17335
|
+
/* @__PURE__ */ e("span", { className: "font-bold text-lg", children: s(Number((g = r.payment) == null ? void 0 : g.total) || 0) })
|
|
17336
17336
|
] }) })
|
|
17337
17337
|
] })
|
|
17338
17338
|
] }) });
|
|
@@ -17469,7 +17469,7 @@ const gc = ({
|
|
|
17469
17469
|
cell: ({ row: t, table: a }) => /* @__PURE__ */ e(yc, { order: t.original, table: a })
|
|
17470
17470
|
})
|
|
17471
17471
|
], bc = () => {
|
|
17472
|
-
const { client: t } =
|
|
17472
|
+
const { client: t } = E(), a = ee(), r = me(), [s, n] = I(""), [o] = Ge(s, 300), l = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: c, isError: u, data: p, refetch: g } = q({
|
|
17473
17473
|
queryKey: ["orders", a, l, o],
|
|
17474
17474
|
queryFn: async () => {
|
|
17475
17475
|
const { body: h, status: f } = await t.order.getOrders({
|
|
@@ -17509,7 +17509,7 @@ const gc = ({
|
|
|
17509
17509
|
data: (p == null ? void 0 : p.list) || [],
|
|
17510
17510
|
columns: wc,
|
|
17511
17511
|
className: "mt-8",
|
|
17512
|
-
refetch:
|
|
17512
|
+
refetch: g
|
|
17513
17513
|
}
|
|
17514
17514
|
)
|
|
17515
17515
|
] });
|
|
@@ -17525,7 +17525,7 @@ const _i = ({
|
|
|
17525
17525
|
initialData: a
|
|
17526
17526
|
}) => {
|
|
17527
17527
|
var u;
|
|
17528
|
-
const { client: r } =
|
|
17528
|
+
const { client: r } = E(), s = pe({
|
|
17529
17529
|
resolver: ge(
|
|
17530
17530
|
a ? Fa : js
|
|
17531
17531
|
),
|
|
@@ -17536,16 +17536,16 @@ const _i = ({
|
|
|
17536
17536
|
K(() => {
|
|
17537
17537
|
(async () => {
|
|
17538
17538
|
if (n) {
|
|
17539
|
-
const { status: p, body:
|
|
17539
|
+
const { status: p, body: g } = await r.location.getPlaceDetails({
|
|
17540
17540
|
params: {
|
|
17541
17541
|
placeId: n
|
|
17542
17542
|
}
|
|
17543
17543
|
});
|
|
17544
17544
|
if (p !== 200)
|
|
17545
17545
|
throw new Error("Failed to fetch place details");
|
|
17546
|
-
s.setValue("address.zipCode",
|
|
17546
|
+
s.setValue("address.zipCode", g.zipCode, {
|
|
17547
17547
|
shouldValidate: !0
|
|
17548
|
-
}), s.setValue("address.city",
|
|
17548
|
+
}), s.setValue("address.city", g.city, { shouldValidate: !0 }), s.setValue("address.country", g.country, {
|
|
17549
17549
|
shouldValidate: !0
|
|
17550
17550
|
});
|
|
17551
17551
|
}
|
|
@@ -17553,11 +17553,11 @@ const _i = ({
|
|
|
17553
17553
|
}, [s, n]);
|
|
17554
17554
|
const l = G({
|
|
17555
17555
|
mutationFn: async (p) => {
|
|
17556
|
-
const { logoFile:
|
|
17556
|
+
const { logoFile: g, ...h } = p;
|
|
17557
17557
|
return await r.organization.createOrganization({
|
|
17558
17558
|
body: {
|
|
17559
17559
|
...h,
|
|
17560
|
-
logoId:
|
|
17560
|
+
logoId: g == null ? void 0 : g.id
|
|
17561
17561
|
}
|
|
17562
17562
|
});
|
|
17563
17563
|
},
|
|
@@ -17566,14 +17566,14 @@ const _i = ({
|
|
|
17566
17566
|
}
|
|
17567
17567
|
}), d = G({
|
|
17568
17568
|
mutationFn: async (p) => {
|
|
17569
|
-
const { logoFile:
|
|
17569
|
+
const { logoFile: g, ...h } = p;
|
|
17570
17570
|
return await r.organization.updateOrganization({
|
|
17571
17571
|
params: {
|
|
17572
17572
|
organizationId: a.id
|
|
17573
17573
|
},
|
|
17574
17574
|
body: {
|
|
17575
17575
|
...h,
|
|
17576
|
-
logoId:
|
|
17576
|
+
logoId: g == null ? void 0 : g.id
|
|
17577
17577
|
}
|
|
17578
17578
|
});
|
|
17579
17579
|
},
|
|
@@ -17837,7 +17837,7 @@ function kc() {
|
|
|
17837
17837
|
}
|
|
17838
17838
|
const We = it(), Ac = ({ row: t, table: a }) => {
|
|
17839
17839
|
var c, u;
|
|
17840
|
-
const { client: r } =
|
|
17840
|
+
const { client: r } = E(), s = t.getValue("publishedAt"), n = (c = a.options.meta) == null ? void 0 : c.organizationId, o = (u = a.options.meta) == null ? void 0 : u.refetch, l = G({
|
|
17841
17841
|
mutationFn: async () => {
|
|
17842
17842
|
if ((await r.productCategory.updateStatus({
|
|
17843
17843
|
params: {
|
|
@@ -17877,7 +17877,7 @@ const We = it(), Ac = ({ row: t, table: a }) => {
|
|
|
17877
17877
|
) });
|
|
17878
17878
|
}, vc = ({ row: t, table: a }) => {
|
|
17879
17879
|
var d, c, u, p;
|
|
17880
|
-
const { client: r } =
|
|
17880
|
+
const { client: r } = E(), s = (d = a.options.meta) == null ? void 0 : d.organizationId, n = (c = a.options.meta) == null ? void 0 : c.refetch, o = G({
|
|
17881
17881
|
mutationFn: async () => {
|
|
17882
17882
|
if ((await r.productCategory.deleteProductCategory({
|
|
17883
17883
|
params: {
|
|
@@ -18034,7 +18034,7 @@ const We = it(), Ac = ({ row: t, table: a }) => {
|
|
|
18034
18034
|
cell: ({ row: t, table: a }) => /* @__PURE__ */ e(vc, { row: t, table: a })
|
|
18035
18035
|
})
|
|
18036
18036
|
], Rc = () => {
|
|
18037
|
-
const { client: t } =
|
|
18037
|
+
const { client: t } = E(), a = te(), { defaultLocale: r } = he(), s = ee(), n = me(), [o, l] = I(""), d = Number((n == null ? void 0 : n.get("page")) || "1"), [c] = Ge(o, 300), { isLoading: u, isRefetching: p, isError: g, data: h, refetch: f } = q({
|
|
18038
18038
|
queryKey: [
|
|
18039
18039
|
"productCategories",
|
|
18040
18040
|
s,
|
|
@@ -18043,7 +18043,7 @@ const We = it(), Ac = ({ row: t, table: a }) => {
|
|
|
18043
18043
|
r
|
|
18044
18044
|
],
|
|
18045
18045
|
queryFn: async () => {
|
|
18046
|
-
const { body:
|
|
18046
|
+
const { body: y, status: x } = await t.productCategory.getProductCategories({
|
|
18047
18047
|
params: {
|
|
18048
18048
|
organizationId: s
|
|
18049
18049
|
},
|
|
@@ -18056,7 +18056,7 @@ const We = it(), Ac = ({ row: t, table: a }) => {
|
|
|
18056
18056
|
});
|
|
18057
18057
|
if (x !== 200)
|
|
18058
18058
|
throw new Error("Failed to fetch product categories");
|
|
18059
|
-
return
|
|
18059
|
+
return y;
|
|
18060
18060
|
},
|
|
18061
18061
|
placeholderData: Ne
|
|
18062
18062
|
});
|
|
@@ -18068,7 +18068,7 @@ const We = it(), Ac = ({ row: t, table: a }) => {
|
|
|
18068
18068
|
type: "search",
|
|
18069
18069
|
placeholder: "Search by product category...",
|
|
18070
18070
|
value: o,
|
|
18071
|
-
onChange: (
|
|
18071
|
+
onChange: (y) => l(y.target.value),
|
|
18072
18072
|
className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]"
|
|
18073
18073
|
}
|
|
18074
18074
|
) }),
|
|
@@ -18087,7 +18087,7 @@ const We = it(), Ac = ({ row: t, table: a }) => {
|
|
|
18087
18087
|
/* @__PURE__ */ e(
|
|
18088
18088
|
ut,
|
|
18089
18089
|
{
|
|
18090
|
-
error:
|
|
18090
|
+
error: g,
|
|
18091
18091
|
loading: u || p,
|
|
18092
18092
|
meta: h == null ? void 0 : h.meta,
|
|
18093
18093
|
data: (h == null ? void 0 : h.list) || [],
|
|
@@ -18136,7 +18136,7 @@ const Pc = [
|
|
|
18136
18136
|
], Gi = ({
|
|
18137
18137
|
initialData: t
|
|
18138
18138
|
}) => {
|
|
18139
|
-
const { client: a } =
|
|
18139
|
+
const { client: a } = E(), r = Y(), s = te(), n = ee(), { defaultLocale: o, supportedLocales: l } = he(), c = pe({
|
|
18140
18140
|
resolver: ge(t ? vo : Ao),
|
|
18141
18141
|
defaultValues: t ? {
|
|
18142
18142
|
defaultLocale: o,
|
|
@@ -18149,15 +18149,15 @@ const Pc = [
|
|
|
18149
18149
|
}
|
|
18150
18150
|
}), u = G({
|
|
18151
18151
|
mutationFn: async (f) => {
|
|
18152
|
-
var
|
|
18153
|
-
const
|
|
18152
|
+
var w;
|
|
18153
|
+
const y = {
|
|
18154
18154
|
slug: f.slug,
|
|
18155
18155
|
defaultLocale: f.defaultLocale,
|
|
18156
18156
|
translations: f.translations,
|
|
18157
|
-
imageId: (
|
|
18157
|
+
imageId: (w = f.image) == null ? void 0 : w.id
|
|
18158
18158
|
}, { status: x } = await a.productCategory.createProductCategory({
|
|
18159
18159
|
params: { organizationId: n },
|
|
18160
|
-
body:
|
|
18160
|
+
body: y
|
|
18161
18161
|
});
|
|
18162
18162
|
if (x !== 201)
|
|
18163
18163
|
throw se.error(
|
|
@@ -18166,22 +18166,22 @@ const Pc = [
|
|
|
18166
18166
|
}
|
|
18167
18167
|
}), p = G({
|
|
18168
18168
|
mutationFn: async (f) => {
|
|
18169
|
-
var
|
|
18170
|
-
const
|
|
18169
|
+
var w;
|
|
18170
|
+
const y = {
|
|
18171
18171
|
slug: f.slug,
|
|
18172
18172
|
defaultLocale: f.defaultLocale,
|
|
18173
18173
|
translations: f.translations,
|
|
18174
|
-
imageId: ((
|
|
18174
|
+
imageId: ((w = f.image) == null ? void 0 : w.id) || null
|
|
18175
18175
|
}, { status: x } = await a.productCategory.updateProductCategory({
|
|
18176
18176
|
params: { organizationId: n, id: t.id },
|
|
18177
|
-
body:
|
|
18177
|
+
body: y
|
|
18178
18178
|
});
|
|
18179
18179
|
if (x !== 200)
|
|
18180
18180
|
throw se.error(
|
|
18181
18181
|
"Failed to update product category. Please try again later."
|
|
18182
18182
|
), new Error("Failed to update product category");
|
|
18183
18183
|
}
|
|
18184
|
-
}),
|
|
18184
|
+
}), g = async () => {
|
|
18185
18185
|
se.success("Product category saved successfully"), r.push(s.productCategories(n)), await Qe.invalidateQueries({ queryKey: ["productCategories"] });
|
|
18186
18186
|
};
|
|
18187
18187
|
return /* @__PURE__ */ e(
|
|
@@ -18191,9 +18191,9 @@ const Pc = [
|
|
|
18191
18191
|
config: Pc,
|
|
18192
18192
|
onSubmit: (f) => {
|
|
18193
18193
|
t ? p.mutate(f, {
|
|
18194
|
-
onSuccess:
|
|
18194
|
+
onSuccess: g
|
|
18195
18195
|
}) : u.mutate(f, {
|
|
18196
|
-
onSuccess:
|
|
18196
|
+
onSuccess: g
|
|
18197
18197
|
});
|
|
18198
18198
|
},
|
|
18199
18199
|
loading: u.isPending || p.isPending,
|
|
@@ -18223,7 +18223,7 @@ function Tc() {
|
|
|
18223
18223
|
] });
|
|
18224
18224
|
}
|
|
18225
18225
|
function Qc() {
|
|
18226
|
-
const t = ee(), a = Pt(), { client: r } =
|
|
18226
|
+
const t = ee(), a = Pt(), { client: r } = E(), { isLoading: s, data: n } = q({
|
|
18227
18227
|
queryKey: ["productCategories", t, a],
|
|
18228
18228
|
queryFn: async () => {
|
|
18229
18229
|
const { status: o, body: l } = await r.productCategory.getProductCategory({
|
|
@@ -18261,7 +18261,7 @@ function Qc() {
|
|
|
18261
18261
|
] });
|
|
18262
18262
|
}
|
|
18263
18263
|
const Ic = ({ form: t }) => {
|
|
18264
|
-
const { client: a } =
|
|
18264
|
+
const { client: a } = E(), r = ee(), { data: s } = q({
|
|
18265
18265
|
queryKey: ["product-categories", r],
|
|
18266
18266
|
queryFn: async () => {
|
|
18267
18267
|
const l = await a.productCategory.getProductCategories({
|
|
@@ -18362,8 +18362,8 @@ const Ic = ({ form: t }) => {
|
|
|
18362
18362
|
R.useEffect(() => {
|
|
18363
18363
|
const d = t.getValues("metadata") || {}, c = Object.entries(d);
|
|
18364
18364
|
c.length > 0 && r(
|
|
18365
|
-
c.map(([u, p],
|
|
18366
|
-
id: `metadata-${
|
|
18365
|
+
c.map(([u, p], g) => ({
|
|
18366
|
+
id: `metadata-${g}-${Date.now()}`,
|
|
18367
18367
|
key: u,
|
|
18368
18368
|
value: p
|
|
18369
18369
|
}))
|
|
@@ -18490,8 +18490,8 @@ const Ic = ({ form: t }) => {
|
|
|
18490
18490
|
defaultLocale: n
|
|
18491
18491
|
} : {
|
|
18492
18492
|
defaultLocale: n,
|
|
18493
|
-
translations: o.map((
|
|
18494
|
-
locale:
|
|
18493
|
+
translations: o.map((g) => ({
|
|
18494
|
+
locale: g,
|
|
18495
18495
|
title: ""
|
|
18496
18496
|
})),
|
|
18497
18497
|
modifiers: [{ title: "", price: 0 }]
|
|
@@ -18500,8 +18500,8 @@ const Ic = ({ form: t }) => {
|
|
|
18500
18500
|
}), { fields: d, append: c, remove: u } = Pa({
|
|
18501
18501
|
control: l.control,
|
|
18502
18502
|
name: "modifiers"
|
|
18503
|
-
}), p = (
|
|
18504
|
-
s(
|
|
18503
|
+
}), p = (g) => {
|
|
18504
|
+
s(g), a(), l.reset({
|
|
18505
18505
|
defaultLocale: n,
|
|
18506
18506
|
translations: o.map((h) => ({ locale: h, title: "" })),
|
|
18507
18507
|
modifiers: [{ title: "", price: 0 }]
|
|
@@ -18546,7 +18546,7 @@ const Ic = ({ form: t }) => {
|
|
|
18546
18546
|
),
|
|
18547
18547
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mt-6", children: "Modifier Options" }),
|
|
18548
18548
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-500 mb-6 mt-1", children: "Add options to this modifier group. Modifier options are the different variants of the product. The price adds to the base price of the product. Leave the price as 0 if it's free." }),
|
|
18549
|
-
d.map((
|
|
18549
|
+
d.map((g, h) => /* @__PURE__ */ i("div", { className: "mb-4 flex", children: [
|
|
18550
18550
|
/* @__PURE__ */ e(
|
|
18551
18551
|
Le,
|
|
18552
18552
|
{
|
|
@@ -18581,7 +18581,7 @@ const Ic = ({ form: t }) => {
|
|
|
18581
18581
|
children: /* @__PURE__ */ e(qt, { className: "w-4 h-4" })
|
|
18582
18582
|
}
|
|
18583
18583
|
)
|
|
18584
|
-
] },
|
|
18584
|
+
] }, g.id)),
|
|
18585
18585
|
/* @__PURE__ */ e(
|
|
18586
18586
|
T,
|
|
18587
18587
|
{
|
|
@@ -18627,20 +18627,20 @@ const Ic = ({ form: t }) => {
|
|
|
18627
18627
|
name: "modifierGroups"
|
|
18628
18628
|
}), [d, c] = I(!1), [u, p] = I(
|
|
18629
18629
|
null
|
|
18630
|
-
),
|
|
18630
|
+
), g = () => crypto.randomUUID(), h = (S) => {
|
|
18631
18631
|
var k;
|
|
18632
18632
|
return {
|
|
18633
18633
|
...S,
|
|
18634
|
-
id: S.id ??
|
|
18634
|
+
id: S.id ?? g(),
|
|
18635
18635
|
defaultLocale: S.defaultLocale ?? r,
|
|
18636
18636
|
modifiers: ((k = S.modifiers) == null ? void 0 : k.map((A) => ({
|
|
18637
18637
|
...A,
|
|
18638
|
-
id: A.id ??
|
|
18638
|
+
id: A.id ?? g()
|
|
18639
18639
|
}))) ?? []
|
|
18640
18640
|
};
|
|
18641
18641
|
}, f = (S) => {
|
|
18642
18642
|
S.preventDefault(), p(null), c(!0);
|
|
18643
|
-
},
|
|
18643
|
+
}, y = (S) => {
|
|
18644
18644
|
p(S), c(!0);
|
|
18645
18645
|
}, x = (S) => {
|
|
18646
18646
|
if (u === null) {
|
|
@@ -18648,27 +18648,27 @@ const Ic = ({ form: t }) => {
|
|
|
18648
18648
|
return;
|
|
18649
18649
|
}
|
|
18650
18650
|
l(u, h(S)), c(!1);
|
|
18651
|
-
},
|
|
18651
|
+
}, w = () => {
|
|
18652
18652
|
n({
|
|
18653
|
-
id:
|
|
18653
|
+
id: g(),
|
|
18654
18654
|
defaultLocale: r,
|
|
18655
18655
|
selectMin: 1,
|
|
18656
18656
|
selectMax: 1,
|
|
18657
18657
|
modifiers: [
|
|
18658
18658
|
{
|
|
18659
|
-
id:
|
|
18659
|
+
id: g(),
|
|
18660
18660
|
title: "Łagodny (Mild)",
|
|
18661
18661
|
sku: "null",
|
|
18662
18662
|
price: 0
|
|
18663
18663
|
},
|
|
18664
18664
|
{
|
|
18665
|
-
id:
|
|
18665
|
+
id: g(),
|
|
18666
18666
|
title: "Średni (Medium)",
|
|
18667
18667
|
sku: "null",
|
|
18668
18668
|
price: 0
|
|
18669
18669
|
},
|
|
18670
18670
|
{
|
|
18671
|
-
id:
|
|
18671
|
+
id: g(),
|
|
18672
18672
|
title: "Ostry (Spicy)",
|
|
18673
18673
|
sku: "null",
|
|
18674
18674
|
price: 0
|
|
@@ -18709,7 +18709,7 @@ const Ic = ({ form: t }) => {
|
|
|
18709
18709
|
type: "button",
|
|
18710
18710
|
variant: "secondary",
|
|
18711
18711
|
className: "shadow-none",
|
|
18712
|
-
onClick:
|
|
18712
|
+
onClick: w,
|
|
18713
18713
|
children: [
|
|
18714
18714
|
/* @__PURE__ */ e(mr, { className: "w-4 h-4 mr-2" }),
|
|
18715
18715
|
" Add From Template"
|
|
@@ -18738,7 +18738,7 @@ const Ic = ({ form: t }) => {
|
|
|
18738
18738
|
type: "button",
|
|
18739
18739
|
variant: "secondary",
|
|
18740
18740
|
className: "shadow-none",
|
|
18741
|
-
onClick:
|
|
18741
|
+
onClick: w,
|
|
18742
18742
|
children: [
|
|
18743
18743
|
/* @__PURE__ */ e(mr, { className: "w-4 h-4 mr-2" }),
|
|
18744
18744
|
" Add From Template"
|
|
@@ -18769,7 +18769,7 @@ const Ic = ({ form: t }) => {
|
|
|
18769
18769
|
"button",
|
|
18770
18770
|
{
|
|
18771
18771
|
type: "button",
|
|
18772
|
-
onClick: () =>
|
|
18772
|
+
onClick: () => y(k),
|
|
18773
18773
|
className: "text-blue-500 font-medium hover:underline text-sm mr-4",
|
|
18774
18774
|
children: "Edit"
|
|
18775
18775
|
}
|
|
@@ -18842,41 +18842,41 @@ const Ic = ({ form: t }) => {
|
|
|
18842
18842
|
}
|
|
18843
18843
|
], loading: a }) })
|
|
18844
18844
|
] }) }), qi = ({ initialData: t }) => {
|
|
18845
|
-
var
|
|
18846
|
-
const { client: a } =
|
|
18845
|
+
var y, x;
|
|
18846
|
+
const { client: a } = E(), r = Y(), s = te(), n = ee(), o = Pt(), { defaultLocale: l, supportedLocales: d } = he(), u = pe({
|
|
18847
18847
|
resolver: ge(t ? Po : Co),
|
|
18848
18848
|
defaultValues: t ? {
|
|
18849
18849
|
...t,
|
|
18850
18850
|
defaultLocale: l,
|
|
18851
|
-
categories: (
|
|
18851
|
+
categories: (y = t.categories) == null ? void 0 : y.map((w) => w.id),
|
|
18852
18852
|
translations: t.translations,
|
|
18853
18853
|
images: t.images,
|
|
18854
18854
|
metadata: t.metadata,
|
|
18855
|
-
modifierGroups: (x = t.modifierGroups) == null ? void 0 : x.map((
|
|
18856
|
-
...
|
|
18855
|
+
modifierGroups: (x = t.modifierGroups) == null ? void 0 : x.map((w) => ({
|
|
18856
|
+
...w,
|
|
18857
18857
|
defaultLocale: l,
|
|
18858
|
-
translations:
|
|
18859
|
-
modifiers:
|
|
18858
|
+
translations: w.translations,
|
|
18859
|
+
modifiers: w.modifiers
|
|
18860
18860
|
}))
|
|
18861
18861
|
} : {
|
|
18862
18862
|
defaultLocale: l,
|
|
18863
|
-
translations: d.map((
|
|
18863
|
+
translations: d.map((w) => ({ locale: w })),
|
|
18864
18864
|
currency: "USD"
|
|
18865
18865
|
}
|
|
18866
18866
|
}), p = G({
|
|
18867
|
-
mutationFn: async (
|
|
18867
|
+
mutationFn: async (w) => {
|
|
18868
18868
|
const { status: S } = await a.product.createProduct({
|
|
18869
18869
|
params: { organizationId: n },
|
|
18870
|
-
body:
|
|
18870
|
+
body: w
|
|
18871
18871
|
});
|
|
18872
18872
|
if (S !== 201)
|
|
18873
18873
|
throw new Error("Failed to create product");
|
|
18874
18874
|
}
|
|
18875
|
-
}),
|
|
18876
|
-
mutationFn: async (
|
|
18875
|
+
}), g = G({
|
|
18876
|
+
mutationFn: async (w) => {
|
|
18877
18877
|
const { status: S } = await a.product.updateProduct({
|
|
18878
18878
|
params: { organizationId: n, id: o },
|
|
18879
|
-
body:
|
|
18879
|
+
body: w
|
|
18880
18880
|
});
|
|
18881
18881
|
if (S !== 200)
|
|
18882
18882
|
throw new Error("Failed to update product");
|
|
@@ -18885,13 +18885,13 @@ const Ic = ({ form: t }) => {
|
|
|
18885
18885
|
se.success("Product saved successfully"), r.push(s.products(n)), await Qe.invalidateQueries({ queryKey: ["products"] }), await Qe.invalidateQueries({
|
|
18886
18886
|
queryKey: ["product", n, o]
|
|
18887
18887
|
});
|
|
18888
|
-
}, f = (
|
|
18889
|
-
t ?
|
|
18888
|
+
}, f = (w) => {
|
|
18889
|
+
t ? g.mutate(w, { onSuccess: h }) : p.mutate(w, { onSuccess: h });
|
|
18890
18890
|
};
|
|
18891
18891
|
return console.log(u.watch()), /* @__PURE__ */ e(rt, { ...u, children: /* @__PURE__ */ i(
|
|
18892
18892
|
"form",
|
|
18893
18893
|
{
|
|
18894
|
-
onSubmit: u.handleSubmit((
|
|
18894
|
+
onSubmit: u.handleSubmit((w) => f(w)),
|
|
18895
18895
|
className: "space-y-14",
|
|
18896
18896
|
children: [
|
|
18897
18897
|
/* @__PURE__ */ e(Ic, { form: u }),
|
|
@@ -18919,7 +18919,7 @@ const Ic = ({ form: t }) => {
|
|
|
18919
18919
|
T,
|
|
18920
18920
|
{
|
|
18921
18921
|
type: "submit",
|
|
18922
|
-
isLoading: p.isPending ||
|
|
18922
|
+
isLoading: p.isPending || g.isPending,
|
|
18923
18923
|
loadingText: "Saving...",
|
|
18924
18924
|
children: [
|
|
18925
18925
|
/* @__PURE__ */ e(Ur, { className: "w-4 h-4 mr-2" }),
|
|
@@ -18941,7 +18941,7 @@ function Mc() {
|
|
|
18941
18941
|
] });
|
|
18942
18942
|
}
|
|
18943
18943
|
function Bc() {
|
|
18944
|
-
const t = ee(), a = Pt(), { client: r } =
|
|
18944
|
+
const t = ee(), a = Pt(), { client: r } = E(), { data: s, isLoading: n } = q({
|
|
18945
18945
|
queryKey: ["product", t, a],
|
|
18946
18946
|
queryFn: async () => {
|
|
18947
18947
|
const { status: o, body: l } = await r.product.getProduct({
|
|
@@ -18960,7 +18960,7 @@ function Bc() {
|
|
|
18960
18960
|
}
|
|
18961
18961
|
const ze = it(), Jc = ({ row: t, table: a }) => {
|
|
18962
18962
|
var c;
|
|
18963
|
-
const { client: r } =
|
|
18963
|
+
const { client: r } = E(), s = t.getValue("publishedAt"), n = (c = a.options.meta) == null ? void 0 : c.organizationId, o = a.options.meta.refetch, l = G({
|
|
18964
18964
|
mutationFn: async () => {
|
|
18965
18965
|
if ((await r.product.updateStatus({
|
|
18966
18966
|
params: {
|
|
@@ -19000,7 +19000,7 @@ const ze = it(), Jc = ({ row: t, table: a }) => {
|
|
|
19000
19000
|
) });
|
|
19001
19001
|
}, Oc = ({ row: t, table: a }) => {
|
|
19002
19002
|
var d, c, u;
|
|
19003
|
-
const { client: r } =
|
|
19003
|
+
const { client: r } = E(), s = (d = a.options.meta) == null ? void 0 : d.organizationId, n = a.options.meta.refetch, o = G({
|
|
19004
19004
|
mutationFn: async () => {
|
|
19005
19005
|
if ((await r.product.deleteProduct({
|
|
19006
19006
|
params: {
|
|
@@ -19182,10 +19182,10 @@ const ze = it(), Jc = ({ row: t, table: a }) => {
|
|
|
19182
19182
|
cell: ({ row: t, table: a }) => /* @__PURE__ */ e(Oc, { row: t, table: a })
|
|
19183
19183
|
})
|
|
19184
19184
|
], jc = () => {
|
|
19185
|
-
const { client: t } =
|
|
19185
|
+
const { client: t } = E(), a = te(), { defaultLocale: r } = he(), s = ee(), n = me(), [o, l] = I(""), [d] = Ge(o, 300), c = Number((n == null ? void 0 : n.get("page")) || "1"), { isLoading: u, isRefetching: p, isError: g, data: h, refetch: f } = q({
|
|
19186
19186
|
queryKey: ["products", s, c, d],
|
|
19187
19187
|
queryFn: async () => {
|
|
19188
|
-
const { body:
|
|
19188
|
+
const { body: y, status: x } = await t.product.getProducts({
|
|
19189
19189
|
params: {
|
|
19190
19190
|
organizationId: s
|
|
19191
19191
|
},
|
|
@@ -19198,7 +19198,7 @@ const ze = it(), Jc = ({ row: t, table: a }) => {
|
|
|
19198
19198
|
});
|
|
19199
19199
|
if (x !== 200)
|
|
19200
19200
|
throw new Error("Failed to fetch products");
|
|
19201
|
-
return
|
|
19201
|
+
return y;
|
|
19202
19202
|
},
|
|
19203
19203
|
placeholderData: Ne
|
|
19204
19204
|
});
|
|
@@ -19210,7 +19210,7 @@ const ze = it(), Jc = ({ row: t, table: a }) => {
|
|
|
19210
19210
|
type: "search",
|
|
19211
19211
|
placeholder: "Search products...",
|
|
19212
19212
|
value: o,
|
|
19213
|
-
onChange: (
|
|
19213
|
+
onChange: (y) => l(y.target.value),
|
|
19214
19214
|
className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]"
|
|
19215
19215
|
}
|
|
19216
19216
|
) }),
|
|
@@ -19229,7 +19229,7 @@ const ze = it(), Jc = ({ row: t, table: a }) => {
|
|
|
19229
19229
|
/* @__PURE__ */ e(
|
|
19230
19230
|
ut,
|
|
19231
19231
|
{
|
|
19232
|
-
error:
|
|
19232
|
+
error: g,
|
|
19233
19233
|
loading: u || p,
|
|
19234
19234
|
meta: h != null && h.meta ? { ...h == null ? void 0 : h.meta, currentPage: c } : void 0,
|
|
19235
19235
|
data: (h == null ? void 0 : h.list) || [],
|
|
@@ -19254,13 +19254,13 @@ const Hc = ({
|
|
|
19254
19254
|
refetch: n
|
|
19255
19255
|
}) => {
|
|
19256
19256
|
var x;
|
|
19257
|
-
const { client: o } =
|
|
19258
|
-
mutationFn: async ({ operation:
|
|
19257
|
+
const { client: o } = E(), l = G({
|
|
19258
|
+
mutationFn: async ({ operation: w }) => {
|
|
19259
19259
|
if ((await o.reservation.updateReservationStatus({
|
|
19260
19260
|
params: {
|
|
19261
19261
|
organizationId: t,
|
|
19262
19262
|
reservationId: a,
|
|
19263
|
-
operation:
|
|
19263
|
+
operation: w
|
|
19264
19264
|
},
|
|
19265
19265
|
body: {}
|
|
19266
19266
|
})).status !== 200)
|
|
@@ -19471,7 +19471,7 @@ const Hc = ({
|
|
|
19471
19471
|
cell: ({ row: t, table: a }) => /* @__PURE__ */ e(Wc, { reservation: t.original, table: a })
|
|
19472
19472
|
})
|
|
19473
19473
|
], _c = () => {
|
|
19474
|
-
const { client: t } =
|
|
19474
|
+
const { client: t } = E(), a = ee(), r = me(), [s, n] = I(""), [o] = Ge(s, 300), l = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: c, isError: u, data: p, refetch: g } = q({
|
|
19475
19475
|
queryKey: ["reservations", a, l, o],
|
|
19476
19476
|
queryFn: async () => {
|
|
19477
19477
|
const { body: h, status: f } = await t.reservation.getReservations({
|
|
@@ -19510,7 +19510,7 @@ const Hc = ({
|
|
|
19510
19510
|
data: (p == null ? void 0 : p.list) || [],
|
|
19511
19511
|
columns: $c,
|
|
19512
19512
|
className: "mt-8",
|
|
19513
|
-
refetch:
|
|
19513
|
+
refetch: g
|
|
19514
19514
|
}
|
|
19515
19515
|
)
|
|
19516
19516
|
] });
|
|
@@ -20051,7 +20051,7 @@ function on({
|
|
|
20051
20051
|
children: t,
|
|
20052
20052
|
align: a = "start"
|
|
20053
20053
|
}) {
|
|
20054
|
-
var
|
|
20054
|
+
var g, h;
|
|
20055
20055
|
const r = Y(), [s, n] = N.useState(!1), { theme: o, setTheme: l } = Zn(), d = Ct(), c = te(), u = d.useSession();
|
|
20056
20056
|
N.useEffect(() => {
|
|
20057
20057
|
n(!0);
|
|
@@ -20064,7 +20064,7 @@ function on({
|
|
|
20064
20064
|
return s ? /* @__PURE__ */ e(P, { children: /* @__PURE__ */ i(je, { children: [
|
|
20065
20065
|
/* @__PURE__ */ e(Ve, { asChild: !0, children: t }),
|
|
20066
20066
|
/* @__PURE__ */ i(He, { align: a, children: [
|
|
20067
|
-
/* @__PURE__ */ e(ua, { children: (h = (
|
|
20067
|
+
/* @__PURE__ */ e(ua, { children: (h = (g = u.data) == null ? void 0 : g.user) == null ? void 0 : h.email }),
|
|
20068
20068
|
/* @__PURE__ */ e(St, { children: /* @__PURE__ */ i(Zi, { children: [
|
|
20069
20069
|
/* @__PURE__ */ e(Wi, { children: "Theme" }),
|
|
20070
20070
|
/* @__PURE__ */ e($i, { children: /* @__PURE__ */ i(
|
|
@@ -20372,8 +20372,8 @@ const i0 = [
|
|
|
20372
20372
|
onClose: t,
|
|
20373
20373
|
initialData: a
|
|
20374
20374
|
}) => {
|
|
20375
|
-
var l, d, c, u, p,
|
|
20376
|
-
const { client: r } =
|
|
20375
|
+
var l, d, c, u, p, g;
|
|
20376
|
+
const { client: r } = E(), s = pe({
|
|
20377
20377
|
resolver: ge(Fa),
|
|
20378
20378
|
defaultValues: {
|
|
20379
20379
|
configuration: {
|
|
@@ -20382,7 +20382,7 @@ const i0 = [
|
|
|
20382
20382
|
defaultCurrency: (c = a == null ? void 0 : a.configuration) == null ? void 0 : c.defaultCurrency,
|
|
20383
20383
|
openingTimes: (u = a == null ? void 0 : a.configuration) == null ? void 0 : u.openingTimes,
|
|
20384
20384
|
closingTimes: (p = a == null ? void 0 : a.configuration) == null ? void 0 : p.closingTimes,
|
|
20385
|
-
isAcceptingOrders: (
|
|
20385
|
+
isAcceptingOrders: (g = a == null ? void 0 : a.configuration) == null ? void 0 : g.isAcceptingOrders
|
|
20386
20386
|
}
|
|
20387
20387
|
}
|
|
20388
20388
|
});
|
|
@@ -20481,7 +20481,7 @@ const l0 = [
|
|
|
20481
20481
|
}
|
|
20482
20482
|
], d0 = ({ onClose: t, initialData: a }) => {
|
|
20483
20483
|
var l, d, c;
|
|
20484
|
-
const { client: r } =
|
|
20484
|
+
const { client: r } = E(), s = pe({
|
|
20485
20485
|
resolver: ge(Fa),
|
|
20486
20486
|
defaultValues: {
|
|
20487
20487
|
configuration: {
|
|
@@ -20620,13 +20620,13 @@ function c0() {
|
|
|
20620
20620
|
const dn = ({
|
|
20621
20621
|
initialData: t
|
|
20622
20622
|
}) => {
|
|
20623
|
-
var
|
|
20624
|
-
const { client: a } =
|
|
20623
|
+
var g;
|
|
20624
|
+
const { client: a } = E(), r = Y(), s = te(), n = ee(), l = pe({
|
|
20625
20625
|
resolver: ge(t ? Do : Js),
|
|
20626
20626
|
defaultValues: t ? {
|
|
20627
20627
|
title: t.title,
|
|
20628
20628
|
providerName: t.providerName,
|
|
20629
|
-
providerLogoId: (
|
|
20629
|
+
providerLogoId: (g = t.providerLogo) == null ? void 0 : g.id,
|
|
20630
20630
|
requireDateOfDelivery: t.requireDateOfDelivery,
|
|
20631
20631
|
shippingZones: t.shippingZones
|
|
20632
20632
|
} : {
|
|
@@ -20815,7 +20815,7 @@ function u0() {
|
|
|
20815
20815
|
] });
|
|
20816
20816
|
}
|
|
20817
20817
|
function p0() {
|
|
20818
|
-
const t = ee(), a = Pt(), { client: r } =
|
|
20818
|
+
const t = ee(), a = Pt(), { client: r } = E(), { isLoading: s, data: n } = q({
|
|
20819
20819
|
queryKey: ["shipping-and-payment", t, a],
|
|
20820
20820
|
queryFn: async () => {
|
|
20821
20821
|
const { status: o, body: l } = await r.shippingMethod.getShippingMethod({
|
|
@@ -20955,7 +20955,7 @@ const et = it(), m0 = [
|
|
|
20955
20955
|
}
|
|
20956
20956
|
})
|
|
20957
20957
|
], g0 = () => {
|
|
20958
|
-
const { client: t } =
|
|
20958
|
+
const { client: t } = E(), a = ee(), r = me(), [s] = I(""), [n] = Ge(s, 300), o = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: l, isRefetching: d, isError: c, data: u } = q({
|
|
20959
20959
|
queryKey: [
|
|
20960
20960
|
"shipping-and-payment",
|
|
20961
20961
|
a,
|
|
@@ -20963,7 +20963,7 @@ const et = it(), m0 = [
|
|
|
20963
20963
|
n
|
|
20964
20964
|
],
|
|
20965
20965
|
queryFn: async () => {
|
|
20966
|
-
const { body: p, status:
|
|
20966
|
+
const { body: p, status: g } = await t.shippingMethod.getShippingMethods(
|
|
20967
20967
|
{
|
|
20968
20968
|
params: {
|
|
20969
20969
|
organizationId: a
|
|
@@ -20975,7 +20975,7 @@ const et = it(), m0 = [
|
|
|
20975
20975
|
}
|
|
20976
20976
|
}
|
|
20977
20977
|
);
|
|
20978
|
-
if (
|
|
20978
|
+
if (g !== 200)
|
|
20979
20979
|
throw new Error("Failed to fetch shipping methods");
|
|
20980
20980
|
return p;
|
|
20981
20981
|
},
|
|
@@ -21034,7 +21034,7 @@ const f0 = () => {
|
|
|
21034
21034
|
} = pe({
|
|
21035
21035
|
resolver: ge(Vs),
|
|
21036
21036
|
shouldFocusError: !0
|
|
21037
|
-
}), p = () => t.push(o),
|
|
21037
|
+
}), p = () => t.push(o), g = async (f) => {
|
|
21038
21038
|
await n.email({
|
|
21039
21039
|
email: f.email,
|
|
21040
21040
|
password: f.password,
|
|
@@ -21252,7 +21252,7 @@ const f0 = () => {
|
|
|
21252
21252
|
/* @__PURE__ */ i(
|
|
21253
21253
|
"form",
|
|
21254
21254
|
{
|
|
21255
|
-
onSubmit: d(
|
|
21255
|
+
onSubmit: d(g),
|
|
21256
21256
|
className: "flex w-full flex-col gap-y-6",
|
|
21257
21257
|
children: [
|
|
21258
21258
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-y-4", children: [
|
|
@@ -21335,7 +21335,7 @@ const w0 = () => {
|
|
|
21335
21335
|
} = pe({
|
|
21336
21336
|
resolver: ge(ja),
|
|
21337
21337
|
shouldFocusError: !0
|
|
21338
|
-
}), p = () => t.push(l), { isPending:
|
|
21338
|
+
}), p = () => t.push(l), { isPending: g, isError: h, mutate: f } = G({
|
|
21339
21339
|
onMutate: async (x) => o.email({
|
|
21340
21340
|
email: x.email,
|
|
21341
21341
|
password: x.password,
|
|
@@ -21346,7 +21346,7 @@ const w0 = () => {
|
|
|
21346
21346
|
onSuccess: p
|
|
21347
21347
|
}
|
|
21348
21348
|
})
|
|
21349
|
-
}),
|
|
21349
|
+
}), y = async () => n.social({
|
|
21350
21350
|
provider: "google",
|
|
21351
21351
|
callbackURL: oi(
|
|
21352
21352
|
window.location.origin,
|
|
@@ -21541,7 +21541,7 @@ const w0 = () => {
|
|
|
21541
21541
|
"button",
|
|
21542
21542
|
{
|
|
21543
21543
|
className: "inline-flex items-center gap-2",
|
|
21544
|
-
onClick:
|
|
21544
|
+
onClick: y,
|
|
21545
21545
|
children: [
|
|
21546
21546
|
/* @__PURE__ */ e(Yt, { className: "size-4", "aria-hidden": "true" }),
|
|
21547
21547
|
"Signin with Google"
|
|
@@ -21612,7 +21612,7 @@ const w0 = () => {
|
|
|
21612
21612
|
] })
|
|
21613
21613
|
] }),
|
|
21614
21614
|
h && /* @__PURE__ */ e("span", { className: "text-sm text-red-500", children: "An error occurred, please try again." }),
|
|
21615
|
-
/* @__PURE__ */ e(T, { type: "submit", isLoading:
|
|
21615
|
+
/* @__PURE__ */ e(T, { type: "submit", isLoading: g, children: g ? "Submitting..." : "Continue" })
|
|
21616
21616
|
]
|
|
21617
21617
|
}
|
|
21618
21618
|
)
|
|
@@ -21645,16 +21645,16 @@ function x0(t) {
|
|
|
21645
21645
|
return r ? r === "dashboard" ? { type: "dashboard", orgId: l } : r === "orders" ? { type: "orders", orgId: l } : r === "reservations" ? { type: "reservations", orgId: l } : r === "products" ? s ? s === "create" ? { type: "product-create", orgId: l } : { type: "product-edit", orgId: l, id: s } : { type: "products-list", orgId: l } : r === "product-categories" ? s ? s === "create" ? { type: "product-category-create", orgId: l } : { type: "product-category-edit", orgId: l, id: s } : { type: "product-categories-list", orgId: l } : r === "manufacturers" ? s ? s === "create" ? { type: "manufacturer-create", orgId: l } : { type: "manufacturer-edit", orgId: l, id: s } : { type: "manufacturers-list", orgId: l } : r === "settings" ? s ? s === "opening-times" ? { type: "settings-opening-times", orgId: l } : s === "shipping-methods" ? n ? n === "create" ? { type: "shipping-method-create", orgId: l } : { type: "shipping-method-edit", orgId: l, id: n } : { type: "shipping-methods-list", orgId: l } : { type: "settings", orgId: l } : { type: "settings", orgId: l } : { type: "not-found" } : { type: "not-found" };
|
|
21646
21646
|
}
|
|
21647
21647
|
function Su({ segments: t }) {
|
|
21648
|
-
const a = Ct(), r = te(), s = Y(), n = st(), o = me(), { data: l, isPending: d } = a.useSession(), c = x0(t), u = c.type === "sign-in" || c.type === "sign-up", p = c.type === "home" || c.type === "organizations",
|
|
21648
|
+
const a = Ct(), r = te(), s = Y(), n = st(), o = me(), { data: l, isPending: d } = a.useSession(), c = x0(t), u = c.type === "sign-in" || c.type === "sign-up", p = c.type === "home" || c.type === "organizations", g = o == null ? void 0 : o.get("redirect"), h = o == null ? void 0 : o.toString(), f = n ? `${n}${h ? `?${h}` : ""}` : r.home, y = u ? da(g, r) : f;
|
|
21649
21649
|
if (K(() => {
|
|
21650
21650
|
if (!d) {
|
|
21651
21651
|
if (!l && !u) {
|
|
21652
|
-
s.replace(Xa(r.signIn,
|
|
21652
|
+
s.replace(Xa(r.signIn, y));
|
|
21653
21653
|
return;
|
|
21654
21654
|
}
|
|
21655
|
-
l && u && s.replace(
|
|
21655
|
+
l && u && s.replace(y);
|
|
21656
21656
|
}
|
|
21657
|
-
}, [l, d, u, s, r.signIn,
|
|
21657
|
+
}, [l, d, u, s, r.signIn, y]), d)
|
|
21658
21658
|
return /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-screen", children: /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600" }) });
|
|
21659
21659
|
if (u) {
|
|
21660
21660
|
if (c.type === "sign-in") return /* @__PURE__ */ e(y0, {});
|
|
@@ -21666,8 +21666,8 @@ function Su({ segments: t }) {
|
|
|
21666
21666
|
return /* @__PURE__ */ e(Er, { children: /* @__PURE__ */ e(kc, {}) });
|
|
21667
21667
|
if (c.type === "not-found")
|
|
21668
21668
|
return /* @__PURE__ */ e(ni, {});
|
|
21669
|
-
const x = "orgId" in c ? c.orgId : void 0,
|
|
21670
|
-
return /* @__PURE__ */ e(id, { organizationId: x, id:
|
|
21669
|
+
const x = "orgId" in c ? c.orgId : void 0, w = "id" in c ? c.id : void 0;
|
|
21670
|
+
return /* @__PURE__ */ e(id, { organizationId: x, id: w, children: /* @__PURE__ */ e(Er, { children: /* @__PURE__ */ e(ld, { children: /* @__PURE__ */ e(s0, { children: S0(c) }) }) }) });
|
|
21671
21671
|
}
|
|
21672
21672
|
function S0(t) {
|
|
21673
21673
|
switch (t.type) {
|
|
@@ -21712,7 +21712,7 @@ function S0(t) {
|
|
|
21712
21712
|
export {
|
|
21713
21713
|
Wa as $,
|
|
21714
21714
|
xu as A,
|
|
21715
|
-
|
|
21715
|
+
E as B,
|
|
21716
21716
|
wo as C,
|
|
21717
21717
|
qe as D,
|
|
21718
21718
|
ni as E,
|