@shophost/react 2.0.25 → 2.0.26

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.js CHANGED
@@ -10,14 +10,14 @@ import { createAuthClient as $r } from "better-auth/react";
10
10
  import { useFormContext as _r, useFormState as Gt, useForm as de, FormProvider as Ge, useFieldArray as Ea } from "react-hook-form";
11
11
  import { Search as Da, ChevronDown as Ke, Check as vt, MailIcon as Rn, XIcon as Kt, CloudUpload as Zt, Loader2 as Cn, Phone as qr, X as At, LanguagesIcon as Gr, ChevronLeft as Xt, ShoppingBasketIcon as Kr, UserIcon as Pn, CircleChevronRightIcon as Tn, PartyPopperIcon as Qn, AtSign as In, PlusCircleIcon as Ln, XCircleIcon as En, PlusIcon as je, CheckCircle as Yt, ArrowRight as Dn, EyeOffIcon as Xr, PencilIcon as Yr, Trash2 as es, TrashIcon as zn, BookCopyIcon as fr, CheckIcon as ts, HomeIcon as as, RadioIcon as rs, LogsIcon as ss, CalendarCheckIcon as is, PackageIcon as ns, BoxesIcon as os, FactoryIcon as ls, UserCircleIcon as Mn, ExternalLinkIcon as Bn } from "lucide-react";
12
12
  import { upload as ds } from "@vercel/blob/client";
13
- import ge from "next/image.js";
13
+ import he from "next/image.js";
14
14
  import { useDebounce as Xe } from "use-debounce";
15
15
  import x from "classnames";
16
16
  import { withMask as Jn } from "use-mask-input";
17
17
  import { Transition as cs, Dialog as On, TransitionChild as yr, DialogPanel as Fn } from "@headlessui/react";
18
18
  import O from "next/link.js";
19
19
  import { RiCloseLine as us, RiLoader2Fill as ps, RiSearchLine as za, RiEyeFill as ms, RiEyeOffFill as gs, RiGoogleFill as ea, RiArrowLeftSLine as Ut, RiArrowRightSLine as it, RiArrowLeftDoubleLine as hs, RiArrowRightDoubleLine as fs, RiCalendar2Fill as jn, RiSubtractFill as Vn, RiArrowDownSLine as Ma, RiArrowUpSLine as ys, RiCheckLine as ta, RiSettings5Line as Ba, RiRadioButtonFill as Hn, RiCheckboxBlankCircleLine as Zn, RiMoreFill as aa, RiMenuLine as Un, RiExpandUpDownLine as ws, RiSunLine as Wn, RiMoonLine as $n, RiComputerLine as _n, RiMore2Fill as qn } from "@remixicon/react";
20
- import { useRouter as K, useSearchParams as fe, usePathname as nt, useParams as bs, notFound as _e } from "next/navigation.js";
20
+ import { useRouter as K, useSearchParams as ye, usePathname as nt, useParams as bs, notFound as _e } from "next/navigation.js";
21
21
  import { zodResolver as ce } from "@hookform/resolvers/zod";
22
22
  import { format as V, isValid as xs, isSameMonth as Gn, addYears as Bt, subYears as wr, interval as Ot, eachDayOfInterval as Ss, subDays as Ra, isWithinInterval as br, formatDate as xr, toDate as ks } from "date-fns";
23
23
  import { initClient as Kn } from "@shophost/client";
@@ -195,7 +195,7 @@ const Rr = "shophost-cart", Ao = {
195
195
  if (!o || !o.modifiers) return "";
196
196
  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 ? (m = o.translations[0]) == null ? void 0 : m.title : "") || "", d = (n.modifiers || []).filter((h) => h).map((h) => {
197
197
  const f = o.modifiers.find(
198
- (w) => w && w.id === h.id
198
+ (S) => S && S.id === h.id
199
199
  );
200
200
  if (!f) return "";
201
201
  const y = f.title || "", b = h.quantity || 1;
@@ -469,8 +469,8 @@ const zs = ve(
469
469
  selectedProduct: f,
470
470
  onModalAddToCart: y,
471
471
  totalAmount: b,
472
- itemCount: w,
473
- removedItemsAlert: S
472
+ itemCount: S,
473
+ removedItemsAlert: w
474
474
  },
475
475
  k
476
476
  ] = An(Es, Ao), v = Se(
@@ -481,7 +481,7 @@ const zs = ve(
481
481
  isLoading: P,
482
482
  isRefetching: _
483
483
  } = G({
484
- queryKey: ["cartProducts", v, w, c == null ? void 0 : c.id],
484
+ queryKey: ["cartProducts", v, S, c == null ? void 0 : c.id],
485
485
  queryFn: async () => {
486
486
  if (v.length === 0)
487
487
  return {
@@ -586,7 +586,7 @@ const zs = ve(
586
586
  removeItem: Z,
587
587
  updateItemQuantity: ae,
588
588
  clearCart: J,
589
- itemCount: w,
589
+ itemCount: S,
590
590
  totalAmount: b,
591
591
  onCheckoutClick: Te,
592
592
  openModifiersModal: We,
@@ -608,7 +608,7 @@ const zs = ve(
608
608
  Z,
609
609
  ae,
610
610
  J,
611
- w,
611
+ S,
612
612
  b,
613
613
  Te,
614
614
  We,
@@ -711,27 +711,27 @@ const zs = ve(
711
711
  r(m), n(null);
712
712
  }, [t]), l = j((m, h) => {
713
713
  r((f) => {
714
- const y = [...f], b = y.findIndex((w) => w.groupId === m);
714
+ const y = [...f], b = y.findIndex((S) => S.groupId === m);
715
715
  if (b === -1)
716
716
  y.push({
717
717
  groupId: m,
718
718
  modifierIds: [h]
719
719
  });
720
720
  else {
721
- const w = y[b];
722
- w.modifierIds.indexOf(h) === -1 ? y[b] = {
723
- ...w,
724
- modifierIds: [...w.modifierIds, h]
721
+ const S = y[b];
722
+ S.modifierIds.indexOf(h) === -1 ? y[b] = {
723
+ ...S,
724
+ modifierIds: [...S.modifierIds, h]
725
725
  } : y[b] = {
726
- ...w,
727
- modifierIds: w.modifierIds.filter((k) => k !== h)
726
+ ...S,
727
+ modifierIds: S.modifierIds.filter((k) => k !== h)
728
728
  };
729
729
  }
730
730
  return y;
731
731
  }), n(null);
732
732
  }, []), d = j((m, h) => {
733
733
  r((f) => {
734
- const y = [...f], b = y.findIndex((w) => w.groupId === m);
734
+ const y = [...f], b = y.findIndex((S) => S.groupId === m);
735
735
  return b === -1 ? y.push({
736
736
  groupId: m,
737
737
  modifierIds: [h]
@@ -783,7 +783,7 @@ const zs = ve(
783
783
  validateSelections: f,
784
784
  validationError: y,
785
785
  getCartModifierGroups: b
786
- } = Io(r || {}), { getProductName: w, getModifierGroupName: S } = Qo(a);
786
+ } = Io(r || {}), { getProductName: S, getModifierGroupName: w } = Qo(a);
787
787
  X(() => {
788
788
  r && (u(), c(1));
789
789
  }, [r, u]);
@@ -824,7 +824,7 @@ const zs = ve(
824
824
  isMultiSelect: ie,
825
825
  toggleModifier: p,
826
826
  selectModifier: m,
827
- getModifierGroupName: S,
827
+ getModifierGroupName: w,
828
828
  formatModifierPrice: ae,
829
829
  locale: a
830
830
  };
@@ -851,7 +851,7 @@ const zs = ve(
851
851
  return !n || p ? i : l.length === 0 ? a : /* @__PURE__ */ e("div", { className: t || "flex-1 overflow-y-auto", children: u && l.map((m) => {
852
852
  const h = u[m.productId];
853
853
  if (!h) return null;
854
- const f = () => d(m.productId, m.modifierGroups), y = (w) => c(m.productId, w, m.modifierGroups), b = Ds(
854
+ const f = () => d(m.productId, m.modifierGroups), y = (S) => c(m.productId, S, m.modifierGroups), b = Ds(
855
855
  m,
856
856
  h,
857
857
  n.configuration.defaultCurrency,
@@ -879,7 +879,7 @@ const zs = ve(
879
879
  updateQuantity: l
880
880
  }) => /* @__PURE__ */ e("div", { className: x("p-1 mb-3 transition-shadow"), children: /* @__PURE__ */ s("div", { className: "grid grid-cols-5", children: [
881
881
  /* @__PURE__ */ e("div", { className: "shrink-0 w-full h-full mr-3 rounded-md overflow-hidden col-span-2", children: r ? /* @__PURE__ */ e(
882
- ge,
882
+ he,
883
883
  {
884
884
  width: 100,
885
885
  height: 100,
@@ -979,7 +979,7 @@ const zs = ve(
979
979
  renderHeader: m,
980
980
  renderItem: h = Mo
981
981
  }) => {
982
- const { itemCount: f, total: y, locale: b } = Va(), { organization: w } = ze(), S = (w == null ? void 0 : w.configuration.defaultCurrency) ?? "USD", k = Ne(y, S, b), v = {
982
+ const { itemCount: f, total: y, locale: b } = Va(), { organization: S } = ze(), w = (S == null ? void 0 : S.configuration.defaultCurrency) ?? "USD", k = Ne(y, w, b), v = {
983
983
  checkoutHref: t,
984
984
  checkoutLabel: a,
985
985
  close: l ?? (() => {
@@ -1036,13 +1036,13 @@ const zs = ve(
1036
1036
  renderFooter: u,
1037
1037
  renderItem: p
1038
1038
  }) => {
1039
- const m = Hr(null), [h, f] = I(null), [y, b] = I(null), w = 50, S = (A) => {
1039
+ const m = Hr(null), [h, f] = I(null), [y, b] = I(null), S = 50, w = (A) => {
1040
1040
  b(null), f(A.targetTouches[0].clientY);
1041
1041
  }, k = (A) => {
1042
1042
  b(A.targetTouches[0].clientY);
1043
1043
  }, v = () => {
1044
1044
  if (!h || !y) return;
1045
- y - h > w && a(), f(null), b(null);
1045
+ y - h > S && a(), f(null), b(null);
1046
1046
  };
1047
1047
  return /* @__PURE__ */ s(C, { children: [
1048
1048
  t && /* @__PURE__ */ e(
@@ -1076,7 +1076,7 @@ const zs = ve(
1076
1076
  {
1077
1077
  className: "h-full",
1078
1078
  ref: m,
1079
- onTouchStart: S,
1079
+ onTouchStart: w,
1080
1080
  onTouchMove: k,
1081
1081
  onTouchEnd: v,
1082
1082
  children: /* @__PURE__ */ e(
@@ -3348,7 +3348,7 @@ const kl = ({ ...t }) => {
3348
3348
  }
3349
3349
  ),
3350
3350
  /* @__PURE__ */ e(
3351
- ge,
3351
+ he,
3352
3352
  {
3353
3353
  src: m.url,
3354
3354
  alt: m.filename,
@@ -3455,25 +3455,25 @@ const kl = ({ ...t }) => {
3455
3455
  queryKey: ["autocomplete", h],
3456
3456
  queryFn: async () => {
3457
3457
  if (!h || h.length < 2) return [];
3458
- const S = await i.location.getPredictions({
3458
+ const w = await i.location.getPredictions({
3459
3459
  query: {
3460
3460
  query: h
3461
3461
  }
3462
3462
  });
3463
- if (S.status !== 200)
3463
+ if (w.status !== 200)
3464
3464
  throw new Error("Failed to fetch predictions");
3465
- return Array.isArray(S.body) ? S.body : (console.warn("API did not return an array:", S.body), []);
3465
+ return Array.isArray(w.body) ? w.body : (console.warn("API did not return an array:", w.body), []);
3466
3466
  },
3467
3467
  enabled: h.length >= 2,
3468
3468
  refetchOnWindowFocus: !1
3469
3469
  // Don't refetch on window focus
3470
- }), w = (S) => {
3471
- p(S), c(S.text);
3470
+ }), S = (w) => {
3471
+ p(w), c(w.text);
3472
3472
  const k = {
3473
- placeId: S.placeId,
3474
- text: S.text,
3475
- addressLineOne: S.addressLineOne,
3476
- addressLineTwo: S.addressLineTwo
3473
+ placeId: w.placeId,
3474
+ text: w.text,
3475
+ addressLineOne: w.addressLineOne,
3476
+ addressLineTwo: w.addressLineTwo
3477
3477
  };
3478
3478
  a(k), l(!1);
3479
3479
  };
@@ -3519,8 +3519,8 @@ const kl = ({ ...t }) => {
3519
3519
  placeholder: "Search places...",
3520
3520
  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",
3521
3521
  value: d,
3522
- onChange: (S) => {
3523
- c(S.target.value), S.target.value.length >= 2 && l(!0);
3522
+ onChange: (w) => {
3523
+ c(w.target.value), w.target.value.length >= 2 && l(!0);
3524
3524
  }
3525
3525
  }
3526
3526
  )
@@ -3538,20 +3538,20 @@ const kl = ({ ...t }) => {
3538
3538
  f.length,
3539
3539
  " results"
3540
3540
  ] }),
3541
- f.map((S, k) => /* @__PURE__ */ s(
3541
+ f.map((w, k) => /* @__PURE__ */ s(
3542
3542
  "div",
3543
3543
  {
3544
3544
  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",
3545
- onClick: () => w(S),
3545
+ onClick: () => S(w),
3546
3546
  children: [
3547
3547
  /* @__PURE__ */ s("div", { className: "flex flex-col grow", children: [
3548
- /* @__PURE__ */ e("span", { children: S.addressLineOne || S.text }),
3549
- S.addressLineTwo && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: S.addressLineTwo })
3548
+ /* @__PURE__ */ e("span", { children: w.addressLineOne || w.text }),
3549
+ w.addressLineTwo && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: w.addressLineTwo })
3550
3550
  ] }),
3551
- (u == null ? void 0 : u.placeId) === S.placeId && /* @__PURE__ */ e(vt, { size: 16, strokeWidth: 2, className: "ml-auto" })
3551
+ (u == null ? void 0 : u.placeId) === w.placeId && /* @__PURE__ */ e(vt, { size: 16, strokeWidth: 2, className: "ml-auto" })
3552
3552
  ]
3553
3553
  },
3554
- `${S.placeId || "place"}-${k}`
3554
+ `${w.placeId || "place"}-${k}`
3555
3555
  ))
3556
3556
  ] })
3557
3557
  ] })
@@ -3850,47 +3850,47 @@ const Pl = ({
3850
3850
  disabled: r
3851
3851
  }) => {
3852
3852
  const i = () => {
3853
- const w = /* @__PURE__ */ new Date(), S = new Date(w);
3854
- return S.setMinutes(w.getMinutes() + 30), S;
3853
+ const S = /* @__PURE__ */ new Date(), w = new Date(S);
3854
+ return w.setMinutes(S.getMinutes() + 30), w;
3855
3855
  }, n = Se(() => {
3856
- const w = [], S = /* @__PURE__ */ new Date();
3856
+ const S = [], w = /* @__PURE__ */ new Date();
3857
3857
  for (let k = 0; k < 7; k++) {
3858
- const v = new Date(S);
3859
- v.setDate(S.getDate() + k), v.setHours(0, 0, 0, 0), w.push(v);
3858
+ const v = new Date(w);
3859
+ v.setDate(w.getDate() + k), v.setHours(0, 0, 0, 0), S.push(v);
3860
3860
  }
3861
- return w;
3862
- }, []), o = (w) => {
3863
- const S = i();
3864
- if (!(w.toDateString() === (/* @__PURE__ */ new Date()).toDateString())) return !0;
3865
- if (S.getHours() >= 21 && S.getMinutes() > 0)
3861
+ return S;
3862
+ }, []), o = (S) => {
3863
+ const w = i();
3864
+ if (!(S.toDateString() === (/* @__PURE__ */ new Date()).toDateString())) return !0;
3865
+ if (w.getHours() >= 21 && w.getMinutes() > 0)
3866
3866
  return !1;
3867
3867
  for (let v = 11; v <= 21; v++) {
3868
- const A = new Date(w);
3869
- if (A.setHours(v, 0, 0, 0), A > S)
3868
+ const A = new Date(S);
3869
+ if (A.setHours(v, 0, 0, 0), A > w)
3870
3870
  return !0;
3871
3871
  }
3872
3872
  return !1;
3873
- }, l = (w) => !o(w), d = Se(() => n.find((w) => !l(w)) || null, [n]), [c, u] = I(
3873
+ }, l = (S) => !o(S), d = Se(() => n.find((S) => !l(S)) || null, [n]), [c, u] = I(
3874
3874
  t || d
3875
3875
  ), [p, m] = I(
3876
3876
  t ? `${t.getHours()}:${t.getMinutes() === 0 ? "00" : t.getMinutes()}` : null
3877
3877
  ), h = Se(() => {
3878
3878
  if (!c) return [];
3879
- const w = [], S = i(), k = c.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
3879
+ const S = [], w = i(), k = c.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
3880
3880
  for (let v = 11; v <= 21; v++) {
3881
3881
  const A = new Date(c);
3882
- A.setHours(v, 0, 0, 0), (!k || A > S) && w.push(`${v}:00`);
3882
+ A.setHours(v, 0, 0, 0), (!k || A > w) && S.push(`${v}:00`);
3883
3883
  }
3884
- return w;
3885
- }, [c]), f = (w) => {
3886
- const S = w.toLocaleDateString("en-US", { weekday: "short" }), k = w.toLocaleDateString("en-US", { month: "short" }), v = w.getDate();
3887
- return { weekday: S, month: k, day: v };
3888
- }, y = (w) => {
3889
- u(w), m(null);
3890
- }, b = (w) => {
3891
- if (m(w), c) {
3892
- const [S] = w.split(":").map(Number), k = new Date(c);
3893
- k.setHours(S, 0, 0, 0), a(k);
3884
+ return S;
3885
+ }, [c]), f = (S) => {
3886
+ const w = S.toLocaleDateString("en-US", { weekday: "short" }), k = S.toLocaleDateString("en-US", { month: "short" }), v = S.getDate();
3887
+ return { weekday: w, month: k, day: v };
3888
+ }, y = (S) => {
3889
+ u(S), m(null);
3890
+ }, b = (S) => {
3891
+ if (m(S), c) {
3892
+ const [w] = S.split(":").map(Number), k = new Date(c);
3893
+ k.setHours(w, 0, 0, 0), a(k);
3894
3894
  }
3895
3895
  };
3896
3896
  return X(() => {
@@ -3898,36 +3898,36 @@ const Pl = ({
3898
3898
  }, []), /* @__PURE__ */ s("div", { className: "mt-2", children: [
3899
3899
  /* @__PURE__ */ s("div", { className: "col-span-4 mt-4", children: [
3900
3900
  /* @__PURE__ */ e(Re, { htmlFor: "date", children: "Select Date" }),
3901
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-2 mt-2", children: n.map((w, S) => {
3902
- const { weekday: k, month: v, day: A } = f(w), P = l(w);
3901
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-2 mt-2", children: n.map((S, w) => {
3902
+ const { weekday: k, month: v, day: A } = f(S), P = l(S);
3903
3903
  return /* @__PURE__ */ e(
3904
3904
  "button",
3905
3905
  {
3906
3906
  type: "button",
3907
3907
  disabled: P,
3908
- className: `p-2 text-center border rounded-md ${P ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} ${c && c.toDateString() === w.toDateString() ? "bg-teal-500 text-white" : "bg-white hover:bg-gray-100"}`,
3909
- onClick: () => !P && y(w),
3908
+ className: `p-2 text-center border rounded-md ${P ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} ${c && c.toDateString() === S.toDateString() ? "bg-teal-500 text-white" : "bg-white hover:bg-gray-100"}`,
3909
+ onClick: () => !P && y(S),
3910
3910
  children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center", children: [
3911
3911
  /* @__PURE__ */ e("span", { className: "text-xs font-medium", children: k }),
3912
3912
  /* @__PURE__ */ e("span", { className: "text-xl font-black font-red-hat-display", children: A }),
3913
3913
  /* @__PURE__ */ e("span", { className: "text-xs font-medium", children: v })
3914
3914
  ] })
3915
3915
  },
3916
- S
3916
+ w
3917
3917
  );
3918
3918
  }) })
3919
3919
  ] }),
3920
3920
  c && h.length > 0 && /* @__PURE__ */ s("div", { className: "col-span-4 mt-4", children: [
3921
3921
  /* @__PURE__ */ e(Re, { htmlFor: "time", children: "Select Time" }),
3922
- /* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-2 mt-2", children: h.map((w, S) => /* @__PURE__ */ e(
3922
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-2 mt-2", children: h.map((S, w) => /* @__PURE__ */ e(
3923
3923
  "button",
3924
3924
  {
3925
3925
  type: "button",
3926
- 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"}`,
3927
- onClick: () => b(w),
3928
- children: w
3926
+ className: `p-2 text-sm text-center border rounded-md font-medium cursor-pointer ${p === S ? "bg-teal-500 text-white" : "bg-white hover:bg-gray-100"}`,
3927
+ onClick: () => b(S),
3928
+ children: S
3929
3929
  },
3930
- S
3930
+ w
3931
3931
  )) })
3932
3932
  ] })
3933
3933
  ] });
@@ -4032,7 +4032,7 @@ const Pl = ({
4032
4032
  }, Ql = (t, a) => !t || typeof t != "object" ? void 0 : a ? a.replace(/\[/g, ".").replace(/\]/g, "").split(".").filter(Boolean).reduce((i, n) => {
4033
4033
  if (i != null)
4034
4034
  return i[n];
4035
- }, t) : t, me = ({
4035
+ }, t) : t, ge = ({
4036
4036
  type: t = "text",
4037
4037
  name: a,
4038
4038
  label: r,
@@ -4483,7 +4483,7 @@ const Ol = ({
4483
4483
  return /* @__PURE__ */ e("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ e(Ge, { ...o, children: /* @__PURE__ */ s("form", { onSubmit: o.handleSubmit(p), children: [
4484
4484
  /* @__PURE__ */ s("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [
4485
4485
  /* @__PURE__ */ e(
4486
- me,
4486
+ ge,
4487
4487
  {
4488
4488
  name: "firstname",
4489
4489
  label: "First Name",
@@ -4493,7 +4493,7 @@ const Ol = ({
4493
4493
  }
4494
4494
  ),
4495
4495
  /* @__PURE__ */ e(
4496
- me,
4496
+ ge,
4497
4497
  {
4498
4498
  name: "lastname",
4499
4499
  label: "Last Name",
@@ -4503,7 +4503,7 @@ const Ol = ({
4503
4503
  }
4504
4504
  ),
4505
4505
  /* @__PURE__ */ e(
4506
- me,
4506
+ ge,
4507
4507
  {
4508
4508
  name: "phone",
4509
4509
  label: "Phone",
@@ -4539,7 +4539,7 @@ const Ol = ({
4539
4539
  o.formState.errors.addressLineOne && /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-red-500", children: String(o.formState.errors.addressLineOne.message ?? "") })
4540
4540
  ] }),
4541
4541
  /* @__PURE__ */ e(
4542
- me,
4542
+ ge,
4543
4543
  {
4544
4544
  name: "doorNumber",
4545
4545
  label: "Door Number",
@@ -4549,7 +4549,7 @@ const Ol = ({
4549
4549
  }
4550
4550
  ),
4551
4551
  /* @__PURE__ */ e(
4552
- me,
4552
+ ge,
4553
4553
  {
4554
4554
  name: "zipCode",
4555
4555
  label: "Postal Code",
@@ -4559,7 +4559,7 @@ const Ol = ({
4559
4559
  }
4560
4560
  ),
4561
4561
  /* @__PURE__ */ e(
4562
- me,
4562
+ ge,
4563
4563
  {
4564
4564
  name: "city",
4565
4565
  label: "City",
@@ -4569,7 +4569,7 @@ const Ol = ({
4569
4569
  }
4570
4570
  ),
4571
4571
  /* @__PURE__ */ e(
4572
- me,
4572
+ ge,
4573
4573
  {
4574
4574
  name: "country",
4575
4575
  label: "Country",
@@ -4579,7 +4579,7 @@ const Ol = ({
4579
4579
  }
4580
4580
  ),
4581
4581
  /* @__PURE__ */ e(
4582
- me,
4582
+ ge,
4583
4583
  {
4584
4584
  name: "deliveryInstructions",
4585
4585
  label: "Notes / Instructions",
@@ -4960,7 +4960,7 @@ const Ol = ({
4960
4960
  /* @__PURE__ */ e("div", { className: "my-3 sm:my-6 sm:pb-1", children: a.map(
4961
4961
  ({ title: d, subtitle: c, image: u, price: p, unitPrice: m, quantity: h }, f) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ s("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [
4962
4962
  /* @__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(
4963
- ge,
4963
+ he,
4964
4964
  {
4965
4965
  width: 100,
4966
4966
  height: 100,
@@ -5091,7 +5091,7 @@ const Ol = ({
5091
5091
  /* @__PURE__ */ s(O, { href: "/", className: "flex items-center", children: [
5092
5092
  /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(Xt, { className: "w-5 h-5 text-white" }) }),
5093
5093
  l ? /* @__PURE__ */ e("span", { className: "ml-1.5 w-7 xl:w-8 h-7 xl:h-8 overflow-hidden rounded-full", children: /* @__PURE__ */ e(
5094
- ge,
5094
+ he,
5095
5095
  {
5096
5096
  src: l.url,
5097
5097
  alt: o,
@@ -5148,7 +5148,7 @@ const Ol = ({
5148
5148
  /* @__PURE__ */ e(ua, {}),
5149
5149
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ s("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [
5150
5150
  /* @__PURE__ */ e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 relative", children: /* @__PURE__ */ e("div", { className: "absolute inset-0 z-0", children: /* @__PURE__ */ e(
5151
- ge,
5151
+ he,
5152
5152
  {
5153
5153
  src: "/images/15750.jpg",
5154
5154
  alt: "Authentication background",
@@ -5720,7 +5720,7 @@ const Ol = ({
5720
5720
  ] })
5721
5721
  ] });
5722
5722
  }, td = ({ orderId: t }) => {
5723
- const { client: a } = L(), { organization: r, organizationId: i } = ze(), n = fe(), o = K(), l = nt(), { t: d } = ui(), c = r == null ? void 0 : r.configuration.defaultCurrency;
5723
+ const { client: a } = L(), { organization: r, organizationId: i } = ze(), n = ye(), o = K(), l = nt(), { t: d } = ui(), c = r == null ? void 0 : r.configuration.defaultCurrency;
5724
5724
  X(() => {
5725
5725
  if ((n == null ? void 0 : n.get("clearCart")) === "true" && l) {
5726
5726
  localStorage.removeItem("shophost-cart");
@@ -5728,18 +5728,18 @@ const Ol = ({
5728
5728
  Array.from(n.entries())
5729
5729
  );
5730
5730
  b.delete("clearCart");
5731
- const w = b.toString() ? `${l}?${b.toString()}` : l;
5732
- o.replace(w);
5731
+ const S = b.toString() ? `${l}?${b.toString()}` : l;
5732
+ o.replace(S);
5733
5733
  }
5734
5734
  }, [n, o, l]);
5735
5735
  const { data: u, isLoading: p, error: m } = G({
5736
5736
  queryKey: ["order", t],
5737
5737
  refetchInterval: ({ state: b }) => {
5738
- var w, S;
5739
- return ((w = b.data) == null ? void 0 : w.status) !== "completed" && ((S = b.data) == null ? void 0 : S.status) !== "cancelled" ? 30 * 1e3 : !1;
5738
+ var S, w;
5739
+ return ((S = b.data) == null ? void 0 : S.status) !== "completed" && ((w = b.data) == null ? void 0 : w.status) !== "cancelled" ? 30 * 1e3 : !1;
5740
5740
  },
5741
5741
  queryFn: async () => {
5742
- const { status: b, body: w } = await a.order.getOrder({
5742
+ const { status: b, body: S } = await a.order.getOrder({
5743
5743
  params: {
5744
5744
  id: t,
5745
5745
  // Replace with the actual order ID
@@ -5749,7 +5749,7 @@ const Ol = ({
5749
5749
  });
5750
5750
  if (b !== 200)
5751
5751
  throw new Error("Failed to fetch shipping address");
5752
- return w;
5752
+ return S;
5753
5753
  }
5754
5754
  }), h = Se(() => u ? u == null ? void 0 : u.items.map((b) => ({
5755
5755
  title: b.translations[0].title,
@@ -5868,7 +5868,7 @@ const Ol = ({
5868
5868
  }
5869
5869
  }
5870
5870
  ),
5871
- y.map((b, w) => /* @__PURE__ */ e(mi, { ...b }, w))
5871
+ y.map((b, S) => /* @__PURE__ */ e(mi, { ...b }, S))
5872
5872
  ] }) })
5873
5873
  ] }) })
5874
5874
  ] }) })
@@ -5911,7 +5911,7 @@ const Ol = ({
5911
5911
  children: [
5912
5912
  /* @__PURE__ */ s("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [
5913
5913
  /* @__PURE__ */ e(
5914
- me,
5914
+ ge,
5915
5915
  {
5916
5916
  name: "firstname",
5917
5917
  label: "First Name",
@@ -5921,7 +5921,7 @@ const Ol = ({
5921
5921
  }
5922
5922
  ),
5923
5923
  /* @__PURE__ */ e(
5924
- me,
5924
+ ge,
5925
5925
  {
5926
5926
  name: "lastname",
5927
5927
  label: "Last Name",
@@ -5931,7 +5931,7 @@ const Ol = ({
5931
5931
  }
5932
5932
  ),
5933
5933
  /* @__PURE__ */ e(
5934
- me,
5934
+ ge,
5935
5935
  {
5936
5936
  name: "phone",
5937
5937
  label: "Phone",
@@ -5941,7 +5941,7 @@ const Ol = ({
5941
5941
  }
5942
5942
  ),
5943
5943
  /* @__PURE__ */ e(
5944
- me,
5944
+ ge,
5945
5945
  {
5946
5946
  name: "guests",
5947
5947
  label: "Number of Guests",
@@ -5951,7 +5951,7 @@ const Ol = ({
5951
5951
  }
5952
5952
  ),
5953
5953
  /* @__PURE__ */ e(
5954
- me,
5954
+ ge,
5955
5955
  {
5956
5956
  name: "date",
5957
5957
  type: "week-time",
@@ -6193,7 +6193,7 @@ const Ol = ({
6193
6193
  ] })
6194
6194
  ] });
6195
6195
  }, nd = () => {
6196
- const t = fe(), { signIn: a } = Ye(), { baseUrl: r } = L(), i = (t == null ? void 0 : t.get("redirect")) ?? "/checkout/customer-details", {
6196
+ const t = ye(), { signIn: a } = Ye(), { baseUrl: r } = L(), i = (t == null ? void 0 : t.get("redirect")) ?? "/checkout/customer-details", {
6197
6197
  register: n,
6198
6198
  handleSubmit: o,
6199
6199
  formState: { errors: l, isSubmitting: d }
@@ -6307,7 +6307,7 @@ const Ol = ({
6307
6307
  ] })
6308
6308
  ] });
6309
6309
  }, od = () => /* @__PURE__ */ e(nd, {}), ld = () => {
6310
- const t = fe(), { signUp: a, signIn: r } = Ye(), { baseUrl: i } = L(), n = (t == null ? void 0 : t.get("redirect")) ?? "/checkout/customer-details", {
6310
+ const t = ye(), { signUp: a, signIn: r } = Ye(), { baseUrl: i } = L(), n = (t == null ? void 0 : t.get("redirect")) ?? "/checkout/customer-details", {
6311
6311
  register: o,
6312
6312
  handleSubmit: l,
6313
6313
  formState: { errors: d }
@@ -6640,13 +6640,13 @@ const Ol = ({
6640
6640
  onDecrement: f,
6641
6641
  isDecrementDisabled: y,
6642
6642
  onAddToCart: b,
6643
- validationError: w
6643
+ validationError: S
6644
6644
  }) => /* @__PURE__ */ e(
6645
6645
  la,
6646
6646
  {
6647
6647
  open: d,
6648
- onOpenChange: (S) => {
6649
- S || c();
6648
+ onOpenChange: (w) => {
6649
+ w || c();
6650
6650
  },
6651
6651
  children: /* @__PURE__ */ s(
6652
6652
  da,
@@ -6675,15 +6675,15 @@ const Ol = ({
6675
6675
  }
6676
6676
  )
6677
6677
  ] }),
6678
- p.length > 0 ? /* @__PURE__ */ e("div", { className: "px-4", children: p.map((S) => /* @__PURE__ */ e(
6678
+ p.length > 0 ? /* @__PURE__ */ e("div", { className: "px-4", children: p.map((w) => /* @__PURE__ */ e(
6679
6679
  pd,
6680
6680
  {
6681
- group: S,
6682
- renderOptions: () => S.modifiers.map((k) => /* @__PURE__ */ e(
6681
+ group: w,
6682
+ renderOptions: () => w.modifiers.map((k) => /* @__PURE__ */ e(
6683
6683
  md,
6684
6684
  {
6685
6685
  modifier: k,
6686
- groupId: S.id,
6686
+ groupId: w.id,
6687
6687
  children: (v) => l ? l(v) : /* @__PURE__ */ s(
6688
6688
  "div",
6689
6689
  {
@@ -6726,7 +6726,7 @@ const Ol = ({
6726
6726
  /* @__PURE__ */ e("div", { children: k.renderOptions() })
6727
6727
  ] })
6728
6728
  },
6729
- S.id
6729
+ w.id
6730
6730
  )) }) : a,
6731
6731
  i ? i({
6732
6732
  isDecrementDisabled: y,
@@ -6734,7 +6734,7 @@ const Ol = ({
6734
6734
  onDecrement: f,
6735
6735
  onIncrement: h,
6736
6736
  quantity: m,
6737
- validationError: w
6737
+ validationError: S
6738
6738
  }) : /* @__PURE__ */ s(C, { children: [
6739
6739
  /* @__PURE__ */ s("div", { className: "p-4 flex items-center justify-center border-t mt-8", children: [
6740
6740
  /* @__PURE__ */ e(
@@ -6764,7 +6764,7 @@ const Ol = ({
6764
6764
  )
6765
6765
  ] }),
6766
6766
  /* @__PURE__ */ s("div", { className: "p-4 border-t", children: [
6767
- w && /* @__PURE__ */ e("div", { className: "text-red-500 mb-2", children: w }),
6767
+ S && /* @__PURE__ */ e("div", { className: "text-red-500 mb-2", children: S }),
6768
6768
  /* @__PURE__ */ e(
6769
6769
  "button",
6770
6770
  {
@@ -7272,7 +7272,7 @@ const vd = ve(void 0), Ad = ({
7272
7272
  }) => {
7273
7273
  const [r, i] = I(a);
7274
7274
  return /* @__PURE__ */ e(vd.Provider, { value: { flyoutOpen: r, setFlyoutOpen: i }, children: t });
7275
- }, he = ({ className: t, ...a }) => /* @__PURE__ */ s(
7275
+ }, fe = ({ className: t, ...a }) => /* @__PURE__ */ s(
7276
7276
  "svg",
7277
7277
  {
7278
7278
  "aria-hidden": "true",
@@ -7306,45 +7306,46 @@ const vd = ve(void 0), Ad = ({
7306
7306
  ), Mr = ({
7307
7307
  children: t
7308
7308
  }) => {
7309
- var d, c, u, p;
7309
+ var c, u, p, m, h;
7310
7310
  const { client: a } = L(), { organizationId: r } = kd(), i = G({
7311
7311
  queryKey: ["organizations"],
7312
7312
  queryFn: async () => {
7313
- const { body: m, status: h } = await a.organization.getOrganizations();
7314
- if (h !== 200)
7315
- throw h !== 401 && se.error(
7313
+ const { body: f, status: y } = await a.organization.getOrganizations();
7314
+ if (y !== 200)
7315
+ throw y !== 401 && se.error(
7316
7316
  "Failed to update organizations list. Please refresh the page or try again later."
7317
7317
  ), new Error("Failed to fetch organizations");
7318
- return m;
7318
+ return f;
7319
7319
  },
7320
7320
  retry: !1
7321
7321
  }), n = G({
7322
7322
  queryKey: ["organization", r],
7323
7323
  queryFn: async () => {
7324
- const { body: m, status: h } = await a.organization.getOrganization({
7324
+ const { body: f, status: y } = await a.organization.getOrganization({
7325
7325
  params: {
7326
7326
  organizationId: r
7327
7327
  }
7328
7328
  });
7329
- if (h !== 200)
7330
- throw h !== 401 && se.error(
7329
+ if (y !== 200)
7330
+ throw y !== 401 && se.error(
7331
7331
  "Failed to fetch organization. Please try refreshing the page or try again later."
7332
7332
  ), new Error("Failed to fetch organizations");
7333
- return m;
7333
+ return f;
7334
7334
  },
7335
7335
  enabled: !!r
7336
- }), 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(
7337
- (m) => m === o ? -1 : 1
7336
+ }), o = ((c = n.data) == null ? void 0 : c.configuration.defaultLocale) ?? "en", l = ((u = n.data) == null ? void 0 : u.configuration.defaultCurrency) ?? "USD", d = ((m = (p = n.data) == null ? void 0 : p.configuration.supportedLocales) == null ? void 0 : m.sort(
7337
+ (f) => f === o ? -1 : 1
7338
7338
  )) || ["en"];
7339
7339
  return /* @__PURE__ */ e(
7340
7340
  yi.Provider,
7341
7341
  {
7342
7342
  value: {
7343
7343
  defaultLocale: o,
7344
- supportedLocales: l,
7344
+ defaultCurrency: l,
7345
+ supportedLocales: d,
7345
7346
  organizations: {
7346
7347
  loading: i.isLoading,
7347
- data: ((p = i.data) == null ? void 0 : p.list) ?? [],
7348
+ data: ((h = i.data) == null ? void 0 : h.list) ?? [],
7348
7349
  error: i.isError
7349
7350
  },
7350
7351
  organization: {
@@ -7354,12 +7355,12 @@ const vd = ve(void 0), Ad = ({
7354
7355
  }
7355
7356
  },
7356
7357
  children: n.isLoading || i.isLoading ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-screen mt-5", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
7357
- /* @__PURE__ */ e(he, { className: "w-12 h-12" }),
7358
+ /* @__PURE__ */ e(fe, { className: "w-12 h-12" }),
7358
7359
  /* @__PURE__ */ e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })
7359
7360
  ] }) }) : t
7360
7361
  }
7361
7362
  );
7362
- }, ye = () => {
7363
+ }, pe = () => {
7363
7364
  const t = le(yi);
7364
7365
  if (!t)
7365
7366
  throw new Error(
@@ -13174,7 +13175,7 @@ const Td = (t) => {
13174
13175
  if (!v) return;
13175
13176
  const A = v.scrollLeft > 0, P = v.scrollWidth - v.clientWidth > v.scrollLeft;
13176
13177
  m({ left: A, right: P });
13177
- }, [m]), w = R.useCallback(
13178
+ }, [m]), S = R.useCallback(
13178
13179
  (v) => {
13179
13180
  const A = u == null ? void 0 : u.current, P = (A == null ? void 0 : A.clientWidth) ?? 0;
13180
13181
  A && d && (A.scrollTo({
@@ -13188,21 +13189,21 @@ const Td = (t) => {
13188
13189
  );
13189
13190
  R.useEffect(() => {
13190
13191
  const v = (A) => {
13191
- A === "ArrowLeft" ? w("left") : A === "ArrowRight" && w("right");
13192
+ A === "ArrowLeft" ? S("left") : A === "ArrowRight" && S("right");
13192
13193
  };
13193
13194
  return h ? (v(h), y.current = setInterval(() => {
13194
13195
  v(h);
13195
13196
  }, 300)) : clearInterval(y.current), () => clearInterval(y.current);
13196
- }, [h, w]);
13197
- const S = (v) => {
13197
+ }, [h, S]);
13198
+ const w = (v) => {
13198
13199
  v.stopPropagation(), (v.key === "ArrowLeft" || v.key === "ArrowRight") && (v.preventDefault(), f(v.key));
13199
13200
  }, k = (v) => {
13200
13201
  v.stopPropagation(), f(null);
13201
13202
  };
13202
13203
  return R.useEffect(() => {
13203
13204
  const v = u == null ? void 0 : u.current;
13204
- return d && (b(), v == null || v.addEventListener("keydown", S), v == null || v.addEventListener("keyup", k)), () => {
13205
- v == null || v.removeEventListener("keydown", S), v == null || v.removeEventListener("keyup", k);
13205
+ return d && (b(), v == null || v.addEventListener("keydown", w), v == null || v.addEventListener("keyup", k)), () => {
13206
+ v == null || v.removeEventListener("keydown", w), v == null || v.removeEventListener("keyup", k);
13206
13207
  };
13207
13208
  }, [b, d]), /* @__PURE__ */ s(
13208
13209
  "ol",
@@ -13247,7 +13248,7 @@ const Td = (t) => {
13247
13248
  {
13248
13249
  icon: Ut,
13249
13250
  onClick: () => {
13250
- f(null), w("left");
13251
+ f(null), S("left");
13251
13252
  },
13252
13253
  disabled: !(p != null && p.left)
13253
13254
  }
@@ -13257,7 +13258,7 @@ const Td = (t) => {
13257
13258
  {
13258
13259
  icon: it,
13259
13260
  onClick: () => {
13260
- f(null), w("right");
13261
+ f(null), S("right");
13261
13262
  },
13262
13263
  disabled: !(p != null && p.right)
13263
13264
  }
@@ -13397,8 +13398,8 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
13397
13398
  showTooltip: f = !0,
13398
13399
  showLegend: y = !0,
13399
13400
  autoMinValue: b = !1,
13400
- minValue: w,
13401
- maxValue: S,
13401
+ minValue: S,
13402
+ maxValue: w,
13402
13403
  allowDecimals: k = !0,
13403
13404
  connectNulls: v = !1,
13404
13405
  className: A,
@@ -13412,7 +13413,7 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
13412
13413
  void 0
13413
13414
  ), [M, D] = R.useState(
13414
13415
  void 0
13415
- ), B = Cd(i, o), pe = Pd(b, w, S), zt = !!P;
13416
+ ), B = Cd(i, o), me = Pd(b, S, w), zt = !!P;
13416
13417
  function xn(z, we) {
13417
13418
  we.stopPropagation(), zt && (z.index === (U == null ? void 0 : U.index) && z.dataKey === (U == null ? void 0 : U.dataKey) || va(r, z.dataKey) && M && M === z.dataKey ? (D(void 0), Me(void 0), P == null || P(null)) : (D(z.dataKey), Me({
13418
13419
  index: z.index,
@@ -13490,7 +13491,7 @@ const Id = ({ payload: t }, a, r, i, n, o) => {
13490
13491
  axisLine: !1,
13491
13492
  tickLine: !1,
13492
13493
  type: "number",
13493
- domain: pe,
13494
+ domain: me,
13494
13495
  tick: { transform: "translate(-3, 0)" },
13495
13496
  fill: "",
13496
13497
  stroke: "",
@@ -13846,21 +13847,21 @@ const ki = ({
13846
13847
  previousMonth: h,
13847
13848
  currentMonth: f,
13848
13849
  displayMonths: y
13849
- } = po(), { numberOfMonths: b, fromDate: w, toDate: S } = mo(), k = y.findIndex(
13850
+ } = po(), { numberOfMonths: b, fromDate: S, toDate: w } = mo(), k = y.findIndex(
13850
13851
  (Z) => Gn(u.displayMonth, Z)
13851
13852
  ), v = k === 0, A = k === y.length - 1, P = b > 1 && (v || !A), _ = b > 1 && (A || !v), ie = () => {
13852
13853
  const Z = Bt(f, -1);
13853
- h && (!w || Z.getTime() >= w.getTime()) && p(Z);
13854
+ h && (!S || Z.getTime() >= S.getTime()) && p(Z);
13854
13855
  }, ae = () => {
13855
13856
  const Z = Bt(f, 1);
13856
- m && (!S || Z.getTime() <= S.getTime()) && p(Z);
13857
+ m && (!w || Z.getTime() <= w.getTime()) && p(Z);
13857
13858
  };
13858
13859
  return /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
13859
13860
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
13860
13861
  i && !_ && /* @__PURE__ */ e(
13861
13862
  yt,
13862
13863
  {
13863
- disabled: n || !h || w && Bt(f, -1).getTime() < w.getTime(),
13864
+ disabled: n || !h || S && Bt(f, -1).getTime() < S.getTime(),
13864
13865
  "aria-label": "Go to previous year",
13865
13866
  onClick: ie,
13866
13867
  icon: hs
@@ -13898,7 +13899,7 @@ const ki = ({
13898
13899
  i && !P && /* @__PURE__ */ e(
13899
13900
  yt,
13900
13901
  {
13901
- disabled: n || !m || S && Bt(f, 1).getTime() > S.getTime(),
13902
+ disabled: n || !m || w && Bt(f, 1).getTime() > w.getTime(),
13902
13903
  "aria-label": "Go to next year",
13903
13904
  onClick: ae,
13904
13905
  icon: fs
@@ -13908,8 +13909,8 @@ const ki = ({
13908
13909
  ] });
13909
13910
  },
13910
13911
  Day: ({ date: u, displayMonth: p }) => {
13911
- const m = N.useRef(null), { activeModifiers: h, buttonProps: f, divProps: y, isButton: b, isHidden: w } = uo(u, p, m), { selected: S, today: k, disabled: v, range_middle: A } = h;
13912
- if (w)
13912
+ const m = N.useRef(null), { activeModifiers: h, buttonProps: f, divProps: y, isButton: b, isHidden: S } = uo(u, p, m), { selected: w, today: k, disabled: v, range_middle: A } = h;
13913
+ if (S)
13913
13914
  return /* @__PURE__ */ e(C, {});
13914
13915
  if (!b)
13915
13916
  return /* @__PURE__ */ e(
@@ -13942,9 +13943,9 @@ const ki = ({
13942
13943
  className: x(
13943
13944
  "absolute inset-x-1/2 bottom-1.5 h-0.5 w-4 -translate-x-1/2 rounded-[2px]",
13944
13945
  {
13945
- "bg-blue-500 dark:bg-blue-500": !S,
13946
- "bg-white! dark:bg-gray-950!": S,
13947
- "bg-gray-400! dark:bg-gray-600!": S && A,
13946
+ "bg-blue-500 dark:bg-blue-500": !w,
13947
+ "bg-white! dark:bg-gray-950!": w,
13948
+ "bg-gray-400! dark:bg-gray-600!": w && A,
13948
13949
  "bg-gray-400 text-gray-400 dark:bg-gray-400 dark:text-gray-600": v
13949
13950
  }
13950
13951
  )
@@ -14131,8 +14132,8 @@ const Ni = ({
14131
14132
  let f = !1;
14132
14133
  m && h && l(m, h) && (f = !0);
14133
14134
  const y = u.to, b = p.to;
14134
- let w = !1;
14135
- return y && b && l(y, b) && (w = !0), f && w;
14135
+ let S = !1;
14136
+ return y && b && l(y, b) && (S = !0), f && S;
14136
14137
  }, c = (u) => {
14137
14138
  if (i(u)) {
14138
14139
  const p = r;
@@ -14192,20 +14193,20 @@ const Jr = (t, a, r) => {
14192
14193
  className: y,
14193
14194
  ...b
14194
14195
  }) => {
14195
- const [w, S] = N.useState(!1), [k, v] = N.useState(
14196
+ const [S, w] = N.useState(!1), [k, v] = N.useState(
14196
14197
  a ?? t ?? void 0
14197
14198
  ), [A, P] = N.useState(k == null ? void 0 : k.from), [_, ie] = N.useState(
14198
14199
  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)
14199
14200
  ), [ae, Z] = N.useState(
14200
14201
  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)
14201
- ), J = N.useMemo(() => k, [w]);
14202
+ ), J = N.useMemo(() => k, [S]);
14202
14203
  N.useEffect(() => {
14203
14204
  v(a ?? t ?? void 0);
14204
14205
  }, [a, t]), N.useEffect(() => {
14205
14206
  k && P(k.from);
14206
14207
  }, [k]), N.useEffect(() => {
14207
- w || P(k == null ? void 0 : k.from);
14208
- }, [w]);
14208
+ S || P(k == null ? void 0 : k.from);
14209
+ }, [S]);
14209
14210
  const Te = (D) => {
14210
14211
  const B = D;
14211
14212
  u && (B != null && B.from && !_ && ie(new re(0, 0)), B != null && B.to && !ae && Z(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))), v(B);
@@ -14214,9 +14215,9 @@ const Jr = (t, a, r) => {
14214
14215
  J != null && J.from ? new re(J.from.getHours(), J.from.getMinutes()) : new re(0, 0)
14215
14216
  ), Z(
14216
14217
  J != null && J.to ? new re(J.to.getHours(), J.to.getMinutes()) : new re(0, 0)
14217
- ), S(!1);
14218
+ ), w(!1);
14218
14219
  }, et = (D) => {
14219
- D || We(), S(D);
14220
+ D || We(), w(D);
14220
14221
  }, U = (D, B) => {
14221
14222
  switch (B) {
14222
14223
  case "start":
@@ -14230,19 +14231,19 @@ const Jr = (t, a, r) => {
14230
14231
  if (B === "start") {
14231
14232
  if (!k.from)
14232
14233
  return;
14233
- const pe = new Date(k.from.getTime());
14234
- D ? (pe.setHours(D.hour), pe.setMinutes(D.minute)) : (pe.setHours(0), pe.setMinutes(0)), v({
14234
+ const me = new Date(k.from.getTime());
14235
+ D ? (me.setHours(D.hour), me.setMinutes(D.minute)) : (me.setHours(0), me.setMinutes(0)), v({
14235
14236
  ...k,
14236
- from: pe
14237
+ from: me
14237
14238
  });
14238
14239
  }
14239
14240
  if (B === "end") {
14240
14241
  if (!k.to)
14241
14242
  return;
14242
- const pe = new Date(k.to.getTime());
14243
- D ? (pe.setHours(D.hour), pe.setMinutes(D.minute)) : (pe.setHours(0), pe.setMinutes(0)), v({
14243
+ const me = new Date(k.to.getTime());
14244
+ D ? (me.setHours(D.hour), me.setMinutes(D.minute)) : (me.setHours(0), me.setMinutes(0)), v({
14244
14245
  ...k,
14245
- to: pe
14246
+ to: me
14246
14247
  });
14247
14248
  }
14248
14249
  }
@@ -14258,13 +14259,13 @@ const Jr = (t, a, r) => {
14258
14259
  );
14259
14260
  }, [a, t]);
14260
14261
  const Me = N.useMemo(() => k ? `${k.from ? Jr(k.from, c, u) : ""} - ${k.to ? Jr(k.to, c, u) : ""}` : null, [k, c, u]), M = () => {
14261
- S(!1), r == null || r(k);
14262
+ w(!1), r == null || r(k);
14262
14263
  };
14263
14264
  return /* @__PURE__ */ s(
14264
14265
  W.Root,
14265
14266
  {
14266
14267
  "tremor-id": "tremor-raw",
14267
- open: w,
14268
+ open: S,
14268
14269
  onOpenChange: et,
14269
14270
  children: [
14270
14271
  /* @__PURE__ */ e(
@@ -14398,14 +14399,14 @@ const Jr = (t, a, r) => {
14398
14399
  if (t && t.length > 0) {
14399
14400
  const c = i, u = r;
14400
14401
  t.forEach((p) => {
14401
- var m, h, f, y, b, w;
14402
+ var m, h, f, y, b, S;
14402
14403
  if ("date" in p) {
14403
- const S = p.date.getFullYear();
14404
- if (i && S < i)
14404
+ const w = p.date.getFullYear();
14405
+ if (i && w < i)
14405
14406
  throw new Error(
14406
14407
  `Preset ${p.label} is before fromYear ${c}.`
14407
14408
  );
14408
- if (r && S > r)
14409
+ if (r && w > r)
14409
14410
  throw new Error(
14410
14411
  `Preset ${p.label} is after toYear ${u}.`
14411
14412
  );
@@ -14430,8 +14431,8 @@ const Jr = (t, a, r) => {
14430
14431
  );
14431
14432
  }
14432
14433
  if ("dateRange" in p) {
14433
- const S = (m = p.dateRange.from) == null ? void 0 : m.getFullYear(), k = (h = p.dateRange.to) == null ? void 0 : h.getFullYear();
14434
- if (S && i && S < i)
14434
+ const w = (m = p.dateRange.from) == null ? void 0 : m.getFullYear(), k = (h = p.dateRange.to) == null ? void 0 : h.getFullYear();
14435
+ if (w && i && w < i)
14435
14436
  throw new Error(
14436
14437
  `Preset ${p.label}'s 'from' is before fromYear ${c}.`
14437
14438
  );
@@ -14467,7 +14468,7 @@ const Jr = (t, a, r) => {
14467
14468
  );
14468
14469
  }
14469
14470
  if (d) {
14470
- const v = (w = p.dateRange.to) == null ? void 0 : w.getDate();
14471
+ const v = (S = p.dateRange.to) == null ? void 0 : S.getDate();
14471
14472
  if (v && v > d.getDate())
14472
14473
  throw new Error(
14473
14474
  `Preset ${p.label}'s 'to' is after toDay ${V(
@@ -14998,23 +14999,23 @@ function Oi({
14998
14999
  selectedPeriod: i,
14999
15000
  isThumbnail: n
15000
15001
  }) {
15001
- const o = Wd[a], l = r != null && r.from && (r != null && r.to) ? Ot(r.from, r.to) : null, d = r != null && r.from && (r != null && r.to) ? Ss(Ot(r.from, r.to)) : null, c = Bi(r, i), u = c != null && c.from && (c != null && c.to) ? Ot(c.from, c.to) : null, p = Ia.filter((S) => l ? br(S.date, l) : !0).sort((S, k) => new Date(S.date).getTime() - new Date(k.date).getTime()), m = Ia.filter((S) => u ? br(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) => {
15002
+ const o = Wd[a], l = r != null && r.from && (r != null && r.to) ? Ot(r.from, r.to) : null, d = r != null && r.from && (r != null && r.to) ? Ss(Ot(r.from, r.to)) : null, c = Bi(r, i), u = c != null && c.from && (c != null && c.to) ? Ot(c.from, c.to) : null, p = Ia.filter((w) => l ? br(w.date, l) : !0).sort((w, k) => new Date(w.date).getTime() - new Date(k.date).getTime()), m = Ia.filter((w) => u ? br(w.date, u) : !1).sort((w, k) => new Date(w.date).getTime() - new Date(k.date).getTime()), h = d == null ? void 0 : d.map((w, k) => {
15002
15003
  const v = p[k], A = m[k], P = (v == null ? void 0 : v[t]) || null, _ = (A == null ? void 0 : A[t]) || null;
15003
15004
  return {
15004
15005
  title: t,
15005
- date: S,
15006
- formattedDate: xr(S, "dd/MM/yyyy"),
15006
+ date: w,
15007
+ formattedDate: xr(w, "dd/MM/yyyy"),
15007
15008
  value: P,
15008
15009
  previousDate: A == null ? void 0 : A.date,
15009
15010
  previousFormattedDate: A ? xr(A.date, "dd/MM/yyyy") : null,
15010
15011
  previousValue: i !== "no-comparison" ? _ : null,
15011
15012
  evolution: i !== "no-comparison" && P && _ ? (P - _) / _ : void 0
15012
15013
  };
15013
- }).sort((S, k) => new Date(S.date).getTime() - new Date(k.date).getTime()), f = i === "no-comparison" ? ["value"] : ["value", "previousValue"], y = (h == null ? void 0 : h.reduce((S, k) => S + (k.value || 0), 0)) || 0, b = (h == null ? void 0 : h.reduce((S, k) => S + (k.previousValue || 0), 0)) || 0, w = i !== "no-comparison" ? (y - b) / b : 0;
15014
+ }).sort((w, k) => new Date(w.date).getTime() - new Date(k.date).getTime()), f = i === "no-comparison" ? ["value"] : ["value", "previousValue"], y = (h == null ? void 0 : h.reduce((w, k) => w + (k.value || 0), 0)) || 0, b = (h == null ? void 0 : h.reduce((w, k) => w + (k.previousValue || 0), 0)) || 0, S = i !== "no-comparison" ? (y - b) / b : 0;
15014
15015
  return /* @__PURE__ */ s("div", { className: Q("transition"), children: [
15015
15016
  /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-x-2", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-x-2", children: [
15016
15017
  /* @__PURE__ */ e("dt", { className: "font-bold text-gray-900 sm:text-sm dark:text-gray-50", children: t }),
15017
- i !== "no-comparison" && /* @__PURE__ */ e(Tt, { variant: Ji(w), children: gi(w) })
15018
+ i !== "no-comparison" && /* @__PURE__ */ e(Tt, { variant: Ji(S), children: gi(S) })
15018
15019
  ] }) }),
15019
15020
  /* @__PURE__ */ s("div", { className: "mt-2 flex items-baseline justify-between", children: [
15020
15021
  /* @__PURE__ */ e("dd", { className: "text-xl text-gray-900 dark:text-gray-50", children: o(y) }),
@@ -15031,7 +15032,7 @@ function Oi({
15031
15032
  index: "formattedDate",
15032
15033
  colors: ["fuchsia", "gray"],
15033
15034
  startEndOnly: !0,
15034
- valueFormatter: (S) => o(S),
15035
+ valueFormatter: (w) => o(w),
15035
15036
  showYAxis: !1,
15036
15037
  showLegend: !1,
15037
15038
  categories: f,
@@ -15797,7 +15798,7 @@ const sc = ({ ...t }) => {
15797
15798
  }
15798
15799
  ),
15799
15800
  /* @__PURE__ */ e(
15800
- ge,
15801
+ he,
15801
15802
  {
15802
15803
  src: m.url,
15803
15804
  alt: m.filename,
@@ -16296,8 +16297,8 @@ const cc = ({
16296
16297
  label: f,
16297
16298
  type: y,
16298
16299
  colspan: b,
16299
- localizable: w,
16300
- multiple: S,
16300
+ localizable: S,
16301
+ multiple: w,
16301
16302
  options: k,
16302
16303
  placeholder: v,
16303
16304
  prefix: A
@@ -16307,7 +16308,7 @@ const cc = ({
16307
16308
  name: `${a.name}[${p}].${h}`,
16308
16309
  label: f,
16309
16310
  type: y ?? "text",
16310
- localizable: w,
16311
+ localizable: S,
16311
16312
  className: x({
16312
16313
  "col-span-1": b === 1,
16313
16314
  "col-span-2": b === 2,
@@ -16315,7 +16316,7 @@ const cc = ({
16315
16316
  "col-span-4": b === 4
16316
16317
  }),
16317
16318
  placeholder: v,
16318
- multiple: S,
16319
+ multiple: w,
16319
16320
  options: k,
16320
16321
  prefix: A
16321
16322
  },
@@ -16484,8 +16485,8 @@ const Ee = ({
16484
16485
  columns: l = 2,
16485
16486
  onSubmit: d
16486
16487
  }) => {
16487
- const c = t.watch("translations"), { organization: u, defaultLocale: p, supportedLocales: m } = ye(), [h, f] = I(), y = Se(
16488
- () => r.some((w) => w.localizable),
16488
+ const c = t.watch("translations"), { organization: u, defaultLocale: p, supportedLocales: m } = pe(), [h, f] = I(), y = Se(
16489
+ () => r.some((S) => S.localizable),
16489
16490
  [r]
16490
16491
  );
16491
16492
  X(() => {
@@ -16509,26 +16510,26 @@ const Ee = ({
16509
16510
  "grid-cols-4": l === 4
16510
16511
  }),
16511
16512
  children: [
16512
- y && /* @__PURE__ */ e("div", { className: "col-span-full", children: /* @__PURE__ */ e(mr, { className: "col-span-full mb-3", children: m.map((w) => {
16513
- const S = w === p;
16513
+ y && /* @__PURE__ */ e("div", { className: "col-span-full", children: /* @__PURE__ */ e(mr, { className: "col-span-full mb-3", children: m.map((S) => {
16514
+ const w = S === p;
16514
16515
  return /* @__PURE__ */ e(
16515
16516
  gr,
16516
16517
  {
16517
- active: w === h,
16518
- onClick: () => f(w),
16518
+ active: S === h,
16519
+ onClick: () => f(S),
16519
16520
  className: "cursor-pointer",
16520
16521
  children: /* @__PURE__ */ s(C, { children: [
16521
- ia.get(w),
16522
+ ia.get(S),
16522
16523
  " ",
16523
- S && "(Default)"
16524
+ w && "(Default)"
16524
16525
  ] })
16525
16526
  },
16526
- w
16527
+ S
16527
16528
  );
16528
16529
  }) }) }),
16529
- r.map((w) => {
16530
+ r.map((S) => {
16530
16531
  const {
16531
- name: S,
16532
+ name: w,
16532
16533
  label: k,
16533
16534
  type: v,
16534
16535
  colspan: A,
@@ -16537,8 +16538,8 @@ const Ee = ({
16537
16538
  options: ie,
16538
16539
  placeholder: ae,
16539
16540
  prefix: Z
16540
- } = w, J = !P || !h ? S : `translations[${m == null ? void 0 : m.indexOf(h)}].${S}`;
16541
- return v === "object" ? /* @__PURE__ */ e(mc, { config: w }, S) : v === "array" ? /* @__PURE__ */ e(pc, { form: t, config: w }, S) : /* @__PURE__ */ e(
16541
+ } = S, J = !P || !h ? w : `translations[${m == null ? void 0 : m.indexOf(h)}].${w}`;
16542
+ return v === "object" ? /* @__PURE__ */ e(mc, { config: S }, w) : v === "array" ? /* @__PURE__ */ e(pc, { form: t, config: S }, w) : /* @__PURE__ */ e(
16542
16543
  Ae,
16543
16544
  {
16544
16545
  name: J,
@@ -16585,7 +16586,7 @@ const Ee = ({
16585
16586
  ]
16586
16587
  }
16587
16588
  );
16588
- return d ? /* @__PURE__ */ e(Ge, { ...t, children: /* @__PURE__ */ e("form", { onSubmit: t.handleSubmit((w) => d(w)), children: b }) }) : /* @__PURE__ */ e("div", { className: "w-full", children: b });
16589
+ return d ? /* @__PURE__ */ e(Ge, { ...t, children: /* @__PURE__ */ e("form", { onSubmit: t.handleSubmit((S) => d(S)), children: b }) }) : /* @__PURE__ */ e("div", { className: "w-full", children: b });
16589
16590
  }, hc = [
16590
16591
  {
16591
16592
  name: "name",
@@ -16608,7 +16609,7 @@ const Ee = ({
16608
16609
  type: "file"
16609
16610
  }
16610
16611
  ], Ui = ({ initialData: t }) => {
16611
- const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultLocale: o, supportedLocales: l } = ye(), c = de({
16612
+ const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultLocale: o, supportedLocales: l } = pe(), c = de({
16612
16613
  resolver: ce(t ? sl : rl),
16613
16614
  defaultValues: t ? {
16614
16615
  defaultLocale: o,
@@ -16621,12 +16622,12 @@ const Ee = ({
16621
16622
  }
16622
16623
  }), u = $({
16623
16624
  mutationFn: async (f) => {
16624
- var w;
16625
+ var S;
16625
16626
  const y = {
16626
16627
  name: f.name,
16627
16628
  defaultLocale: f.defaultLocale,
16628
16629
  translations: f.translations,
16629
- logoId: (w = f.logo) == null ? void 0 : w.id
16630
+ logoId: (S = f.logo) == null ? void 0 : S.id
16630
16631
  }, { status: b } = await a.manufacturer.createManufacturer({
16631
16632
  params: { organizationId: n },
16632
16633
  body: y
@@ -16636,12 +16637,12 @@ const Ee = ({
16636
16637
  }
16637
16638
  }), p = $({
16638
16639
  mutationFn: async (f) => {
16639
- var w;
16640
+ var S;
16640
16641
  const y = {
16641
16642
  name: f.name,
16642
16643
  defaultLocale: f.defaultLocale,
16643
16644
  translations: f.translations,
16644
- logoId: ((w = f.logo) == null ? void 0 : w.id) || null
16645
+ logoId: ((S = f.logo) == null ? void 0 : S.id) || null
16645
16646
  }, { status: b } = await a.manufacturer.updateManufacturer({
16646
16647
  params: { organizationId: n, id: t.id },
16647
16648
  body: y
@@ -16718,7 +16719,7 @@ function yc() {
16718
16719
  /* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the manufacturer." })
16719
16720
  ] }),
16720
16721
  /* @__PURE__ */ e("div", { className: "md:col-span-2", children: i || !n ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-screen mt-5", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
16721
- /* @__PURE__ */ e(he, { className: "w-12 h-12" }),
16722
+ /* @__PURE__ */ e(fe, { className: "w-12 h-12" }),
16722
16723
  /* @__PURE__ */ e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })
16723
16724
  ] }) }) : /* @__PURE__ */ e(Ui, { initialData: n }) })
16724
16725
  ] }) }) }) })
@@ -17023,9 +17024,9 @@ function vc({
17023
17024
  meta: t,
17024
17025
  table: a
17025
17026
  }) {
17026
- const i = fe(), n = K(), o = nt(), l = Number((i == null ? void 0 : i.get("page")) || "1"), d = (y, b) => {
17027
- const w = new URLSearchParams(i == null ? void 0 : i.toString());
17028
- return w.set(y, b), w.toString();
17027
+ const i = ye(), n = K(), o = nt(), l = Number((i == null ? void 0 : i.get("page")) || "1"), d = (y, b) => {
17028
+ const S = new URLSearchParams(i == null ? void 0 : i.toString());
17029
+ return S.set(y, b), S.toString();
17029
17030
  }, c = (y) => {
17030
17031
  n.push(`${o}?${d("page", y.toString())}`);
17031
17032
  }, u = [
@@ -17127,7 +17128,7 @@ function pt({
17127
17128
  n && !i ? (
17128
17129
  // Render a loading spinner when loading is true
17129
17130
  /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-48", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
17130
- /* @__PURE__ */ e(he, { className: "w-10 h-10" }),
17131
+ /* @__PURE__ */ e(fe, { className: "w-10 h-10" }),
17131
17132
  /* @__PURE__ */ e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })
17132
17133
  ] }) })
17133
17134
  ) : /* @__PURE__ */ s(C, { children: [
@@ -17137,13 +17138,13 @@ function pt({
17137
17138
  {
17138
17139
  className: "border-y border-gray-200 dark:border-gray-800 back",
17139
17140
  children: y.headers.map((b) => {
17140
- var w;
17141
+ var S;
17141
17142
  return /* @__PURE__ */ e(
17142
17143
  _i,
17143
17144
  {
17144
17145
  className: x(
17145
17146
  "whitespace-nowrap py-1 text-sm sm:text-xs",
17146
- (w = b.column.columnDef.meta) == null ? void 0 : w.className
17147
+ (S = b.column.columnDef.meta) == null ? void 0 : S.className
17147
17148
  ),
17148
17149
  children: Nr(
17149
17150
  b.column.columnDef.header,
@@ -17169,18 +17170,18 @@ function pt({
17169
17170
  wt,
17170
17171
  {
17171
17172
  className: "group select-none hover:bg-gray-50 dark:hover:bg-gray-900",
17172
- children: y.getVisibleCells().map((b, w) => {
17173
- var S;
17173
+ children: y.getVisibleCells().map((b, S) => {
17174
+ var w;
17174
17175
  return /* @__PURE__ */ s(
17175
17176
  Ft,
17176
17177
  {
17177
17178
  className: x(
17178
17179
  y.getIsSelected() ? "bg-gray-50 dark:bg-gray-900" : "",
17179
17180
  "relative whitespace-nowrap py-1 text-gray-600 first:w-10 dark:text-gray-400",
17180
- (S = b.column.columnDef.meta) == null ? void 0 : S.className
17181
+ (w = b.column.columnDef.meta) == null ? void 0 : w.className
17181
17182
  ),
17182
17183
  children: [
17183
- w === 0 && y.getIsSelected() && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 w-0.5 bg-blue-600 dark:bg-blue-500" }),
17184
+ S === 0 && y.getIsSelected() && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 w-0.5 bg-blue-600 dark:bg-blue-500" }),
17184
17185
  Nr(
17185
17186
  b.column.columnDef.cell,
17186
17187
  b.getContext()
@@ -17205,7 +17206,7 @@ function pt({
17205
17206
  ] }),
17206
17207
  n && i && // Render a loading overlay when refetching is true
17207
17208
  /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-white bg-opacity-75 dark:bg-gray-900 dark:bg-opacity-75", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
17208
- /* @__PURE__ */ e(he, { className: "w-10 h-10" }),
17209
+ /* @__PURE__ */ e(fe, { className: "w-10 h-10" }),
17209
17210
  /* @__PURE__ */ e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })
17210
17211
  ] }) })
17211
17212
  ] }),
@@ -17745,7 +17746,7 @@ const at = ot(), Cc = [
17745
17746
  }
17746
17747
  })
17747
17748
  ], Pc = () => {
17748
- const { client: t } = L(), a = te(), r = ee(), i = fe(), [n, o] = I(""), [l] = Xe(n, 300), d = Number((i == null ? void 0 : i.get("page")) || "1"), { isLoading: c, isRefetching: u, isError: p, data: m } = G({
17749
+ const { client: t } = L(), a = te(), r = ee(), i = ye(), [n, o] = I(""), [l] = Xe(n, 300), d = Number((i == null ? void 0 : i.get("page")) || "1"), { isLoading: c, isRefetching: u, isError: p, data: m } = G({
17749
17750
  queryKey: ["manufacturers", r, d, l],
17750
17751
  queryFn: async () => {
17751
17752
  const { body: h, status: f } = await t.manufacturer.getManufacturers({
@@ -18207,7 +18208,7 @@ const Qc = ({
18207
18208
  cell: ({ row: t, table: a }) => /* @__PURE__ */ e(Ec, { order: t.original, table: a })
18208
18209
  })
18209
18210
  ], zc = () => {
18210
- const { client: t } = L(), a = ee(), r = fe(), [i, n] = I(""), [o] = Xe(i, 300), l = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: c, isError: u, data: p, refetch: m } = G({
18211
+ const { client: t } = L(), a = ee(), r = ye(), [i, n] = I(""), [o] = Xe(i, 300), l = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: c, isError: u, data: p, refetch: m } = G({
18211
18212
  queryKey: ["orders", a, l, o],
18212
18213
  queryFn: async () => {
18213
18214
  const { body: h, status: f } = await t.order.getOrders({
@@ -18452,7 +18453,7 @@ const rn = ({
18452
18453
  }
18453
18454
  ) }) });
18454
18455
  }, Bc = () => {
18455
- const [t, a] = I(!1), r = te(), { organizations: i } = ye(), n = () => a(!1);
18456
+ const [t, a] = I(!1), r = te(), { organizations: i } = pe(), n = () => a(!1);
18456
18457
  return /* @__PURE__ */ s(C, { children: [
18457
18458
  /* @__PURE__ */ s("div", { className: "max-w-4xl mx-auto py-8 px-4", children: [
18458
18459
  /* @__PURE__ */ s("div", { className: "flex justify-between items-center", children: [
@@ -18508,7 +18509,7 @@ const rn = ({
18508
18509
  }
18509
18510
  ),
18510
18511
  o.logoFile ? /* @__PURE__ */ e(
18511
- ge,
18512
+ he,
18512
18513
  {
18513
18514
  src: o.logoFile.url,
18514
18515
  alt: o.name,
@@ -18561,7 +18562,7 @@ function Jc() {
18561
18562
  const { appearance: t } = Is(), a = t == null ? void 0 : t.organizationImage;
18562
18563
  return /* @__PURE__ */ s("div", { className: "flex w-full min-h-screen", children: [
18563
18564
  a && /* @__PURE__ */ e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: /* @__PURE__ */ e(
18564
- ge,
18565
+ he,
18565
18566
  {
18566
18567
  src: a,
18567
18568
  alt: "Organization Visual",
@@ -18597,7 +18598,7 @@ const $e = ot(), Oc = ({ row: t, table: a }) => {
18597
18598
  "tremor-id": "tremor-raw",
18598
18599
  disabled: !0,
18599
18600
  children: [
18600
- /* @__PURE__ */ e(he, { className: "w-4 h-4" }),
18601
+ /* @__PURE__ */ e(fe, { className: "w-4 h-4" }),
18601
18602
  " Saving..."
18602
18603
  ]
18603
18604
  }
@@ -18638,7 +18639,7 @@ const $e = ot(), Oc = ({ row: t, table: a }) => {
18638
18639
  variant: "ghost",
18639
18640
  className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900",
18640
18641
  disabled: o.isPending,
18641
- children: o.isPending ? /* @__PURE__ */ e(he, { className: "size-4 shrink-0" }) : /* @__PURE__ */ e(
18642
+ children: o.isPending ? /* @__PURE__ */ e(fe, { className: "size-4 shrink-0" }) : /* @__PURE__ */ e(
18642
18643
  aa,
18643
18644
  {
18644
18645
  className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300",
@@ -18666,7 +18667,7 @@ const $e = ot(), Oc = ({ row: t, table: a }) => {
18666
18667
  onClick: l,
18667
18668
  disabled: o.isPending,
18668
18669
  children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
18669
- o.isPending ? /* @__PURE__ */ e(he, { className: "w-4 h-4" }) : /* @__PURE__ */ e(es, { className: "w-4 h-4" }),
18670
+ o.isPending ? /* @__PURE__ */ e(fe, { className: "w-4 h-4" }) : /* @__PURE__ */ e(es, { className: "w-4 h-4" }),
18670
18671
  o.isPending ? "Deleting..." : "Delete"
18671
18672
  ] })
18672
18673
  }
@@ -18772,7 +18773,7 @@ const $e = ot(), Oc = ({ row: t, table: a }) => {
18772
18773
  cell: ({ row: t, table: a }) => /* @__PURE__ */ e(Fc, { row: t, table: a })
18773
18774
  })
18774
18775
  ], Vc = () => {
18775
- const { client: t } = L(), a = te(), { defaultLocale: r } = ye(), i = ee(), n = fe(), [o, l] = I(""), d = Number((n == null ? void 0 : n.get("page")) || "1"), [c] = Xe(o, 300), { isLoading: u, isRefetching: p, isError: m, data: h, refetch: f } = G({
18776
+ const { client: t } = L(), a = te(), { defaultLocale: r } = pe(), i = ee(), n = ye(), [o, l] = I(""), d = Number((n == null ? void 0 : n.get("page")) || "1"), [c] = Xe(o, 300), { isLoading: u, isRefetching: p, isError: m, data: h, refetch: f } = G({
18776
18777
  queryKey: [
18777
18778
  "productCategories",
18778
18779
  i,
@@ -18874,7 +18875,7 @@ const Zc = [
18874
18875
  ], sn = ({
18875
18876
  initialData: t
18876
18877
  }) => {
18877
- const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultLocale: o, supportedLocales: l } = ye(), c = de({
18878
+ const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultLocale: o, supportedLocales: l } = pe(), c = de({
18878
18879
  resolver: ce(t ? jo : Fo),
18879
18880
  defaultValues: t ? {
18880
18881
  defaultLocale: o,
@@ -18887,12 +18888,12 @@ const Zc = [
18887
18888
  }
18888
18889
  }), u = $({
18889
18890
  mutationFn: async (f) => {
18890
- var w;
18891
+ var S;
18891
18892
  const y = {
18892
18893
  slug: f.slug,
18893
18894
  defaultLocale: f.defaultLocale,
18894
18895
  translations: f.translations,
18895
- imageId: (w = f.image) == null ? void 0 : w.id
18896
+ imageId: (S = f.image) == null ? void 0 : S.id
18896
18897
  }, { status: b } = await a.productCategory.createProductCategory({
18897
18898
  params: { organizationId: n },
18898
18899
  body: y
@@ -18904,12 +18905,12 @@ const Zc = [
18904
18905
  }
18905
18906
  }), p = $({
18906
18907
  mutationFn: async (f) => {
18907
- var w;
18908
+ var S;
18908
18909
  const y = {
18909
18910
  slug: f.slug,
18910
18911
  defaultLocale: f.defaultLocale,
18911
18912
  translations: f.translations,
18912
- imageId: ((w = f.image) == null ? void 0 : w.id) || null
18913
+ imageId: ((S = f.image) == null ? void 0 : S.id) || null
18913
18914
  }, { status: b } = await a.productCategory.updateProductCategory({
18914
18915
  params: { organizationId: n, id: t.id },
18915
18916
  body: y
@@ -18992,7 +18993,7 @@ function Wc() {
18992
18993
  /* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the product category." })
18993
18994
  ] }),
18994
18995
  /* @__PURE__ */ e("div", { className: "md:col-span-2", children: i || !n ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-[500px] mt-5", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
18995
- /* @__PURE__ */ e(he, { className: "w-12 h-12" }),
18996
+ /* @__PURE__ */ e(fe, { className: "w-12 h-12" }),
18996
18997
  /* @__PURE__ */ e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })
18997
18998
  ] }) }) : /* @__PURE__ */ e(sn, { initialData: n }) })
18998
18999
  ] }) }) }) })
@@ -19221,7 +19222,7 @@ const $c = ({ form: t }) => {
19221
19222
  initialData: r,
19222
19223
  onSubmit: i
19223
19224
  }) => {
19224
- const { defaultLocale: n, supportedLocales: o } = ye(), l = de({
19225
+ const { defaultLocale: n, supportedLocales: o } = pe(), l = de({
19225
19226
  resolver: ce(js),
19226
19227
  defaultValues: r ? {
19227
19228
  ...r,
@@ -19355,7 +19356,7 @@ const $c = ({ form: t }) => {
19355
19356
  ] })
19356
19357
  ] }) });
19357
19358
  }, Gc = ({ form: t }) => {
19358
- const { control: a } = t, { defaultLocale: r } = ye(), {
19359
+ const { control: a } = t, { defaultLocale: r } = pe(), {
19359
19360
  fields: i,
19360
19361
  append: n,
19361
19362
  remove: o,
@@ -19365,28 +19366,28 @@ const $c = ({ form: t }) => {
19365
19366
  name: "modifierGroups"
19366
19367
  }), [d, c] = I(!1), [u, p] = I(
19367
19368
  null
19368
- ), m = () => crypto.randomUUID(), h = (S) => {
19369
+ ), m = () => crypto.randomUUID(), h = (w) => {
19369
19370
  var k;
19370
19371
  return {
19371
- ...S,
19372
- id: S.id ?? m(),
19373
- defaultLocale: S.defaultLocale ?? r,
19374
- modifiers: ((k = S.modifiers) == null ? void 0 : k.map((v) => ({
19372
+ ...w,
19373
+ id: w.id ?? m(),
19374
+ defaultLocale: w.defaultLocale ?? r,
19375
+ modifiers: ((k = w.modifiers) == null ? void 0 : k.map((v) => ({
19375
19376
  ...v,
19376
19377
  id: v.id ?? m()
19377
19378
  }))) ?? []
19378
19379
  };
19379
- }, f = (S) => {
19380
- S.preventDefault(), p(null), c(!0);
19381
- }, y = (S) => {
19382
- p(S), c(!0);
19383
- }, b = (S) => {
19380
+ }, f = (w) => {
19381
+ w.preventDefault(), p(null), c(!0);
19382
+ }, y = (w) => {
19383
+ p(w), c(!0);
19384
+ }, b = (w) => {
19384
19385
  if (u === null) {
19385
- n(h(S)), c(!1);
19386
+ n(h(w)), c(!1);
19386
19387
  return;
19387
19388
  }
19388
- l(u, h(S)), c(!1);
19389
- }, w = () => {
19389
+ l(u, h(w)), c(!1);
19390
+ }, S = () => {
19390
19391
  n({
19391
19392
  id: m(),
19392
19393
  defaultLocale: r,
@@ -19447,7 +19448,7 @@ const $c = ({ form: t }) => {
19447
19448
  type: "button",
19448
19449
  variant: "secondary",
19449
19450
  className: "shadow-none",
19450
- onClick: w,
19451
+ onClick: S,
19451
19452
  children: [
19452
19453
  /* @__PURE__ */ e(fr, { className: "w-4 h-4 mr-2" }),
19453
19454
  " Add From Template"
@@ -19476,7 +19477,7 @@ const $c = ({ form: t }) => {
19476
19477
  type: "button",
19477
19478
  variant: "secondary",
19478
19479
  className: "shadow-none",
19479
- onClick: w,
19480
+ onClick: S,
19480
19481
  children: [
19481
19482
  /* @__PURE__ */ e(fr, { className: "w-4 h-4 mr-2" }),
19482
19483
  " Add From Template"
@@ -19497,11 +19498,11 @@ const $c = ({ form: t }) => {
19497
19498
  }
19498
19499
  )
19499
19500
  ] }),
19500
- /* @__PURE__ */ e("div", { className: "space-y-4", children: i.map((S, k) => {
19501
+ /* @__PURE__ */ e("div", { className: "space-y-4", children: i.map((w, k) => {
19501
19502
  var v;
19502
19503
  return /* @__PURE__ */ s("div", { className: "p-4 border rounded-md", children: [
19503
19504
  /* @__PURE__ */ s("div", { className: "flex justify-between items-center", children: [
19504
- /* @__PURE__ */ e("h3", { className: "text-lg font-semibold", children: S.translations[0].title || "Unnamed Group" }),
19505
+ /* @__PURE__ */ e("h3", { className: "text-lg font-semibold", children: w.translations[0].title || "Unnamed Group" }),
19505
19506
  /* @__PURE__ */ s("div", { children: [
19506
19507
  /* @__PURE__ */ e(
19507
19508
  "button",
@@ -19525,16 +19526,16 @@ const $c = ({ form: t }) => {
19525
19526
  ] }),
19526
19527
  /* @__PURE__ */ s("p", { className: "text-sm text-gray-500 mt-3", children: [
19527
19528
  "Min: ",
19528
- S.selectMin,
19529
+ w.selectMin,
19529
19530
  " | Max: ",
19530
- S.selectMax
19531
+ w.selectMax
19531
19532
  ] }),
19532
19533
  /* @__PURE__ */ s("p", { className: "text-sm text-gray-500 mt-1", children: [
19533
19534
  "Available Options:",
19534
19535
  " ",
19535
- (v = S.modifiers) == null ? void 0 : v.map((A) => A == null ? void 0 : A.title).join(",")
19536
+ (v = w.modifiers) == null ? void 0 : v.map((A) => A == null ? void 0 : A.title).join(",")
19536
19537
  ] })
19537
- ] }, S.id);
19538
+ ] }, w.id);
19538
19539
  }) })
19539
19540
  ] }) })
19540
19541
  ] }),
@@ -19551,94 +19552,97 @@ const $c = ({ form: t }) => {
19551
19552
  u
19552
19553
  )
19553
19554
  ] });
19554
- }, Kc = ({ form: t, loading: a }) => /* @__PURE__ */ e("section", { "aria-labelledby": "product-information", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [
19555
- /* @__PURE__ */ s("div", { children: [
19556
- /* @__PURE__ */ e(
19557
- "h2",
19555
+ }, Kc = ({ form: t, loading: a }) => {
19556
+ const { defaultCurrency: r } = pe();
19557
+ return /* @__PURE__ */ e("section", { "aria-labelledby": "product-information", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [
19558
+ /* @__PURE__ */ s("div", { children: [
19559
+ /* @__PURE__ */ e(
19560
+ "h2",
19561
+ {
19562
+ id: "product-information",
19563
+ className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50",
19564
+ children: "Pricing"
19565
+ }
19566
+ ),
19567
+ /* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the pricing details of your product, including the base price and discounted price." })
19568
+ ] }),
19569
+ /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e(Ee, { form: t, config: [
19558
19570
  {
19559
- id: "product-information",
19560
- className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50",
19561
- children: "Pricing"
19571
+ name: "basePrice",
19572
+ label: "Base Price",
19573
+ type: "number",
19574
+ placeholder: "Enter base price",
19575
+ prefix: r
19576
+ },
19577
+ {
19578
+ name: "discountedBasePrice",
19579
+ label: "Discounted Price",
19580
+ type: "number",
19581
+ placeholder: "Enter discounted price",
19582
+ prefix: r
19562
19583
  }
19563
- ),
19564
- /* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the pricing details of your product, including the base price and discounted price." })
19565
- ] }),
19566
- /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e(Ee, { form: t, config: [
19567
- {
19568
- name: "basePrice",
19569
- label: "Base Price",
19570
- type: "number",
19571
- placeholder: "Enter base price",
19572
- prefix: "USD"
19573
- },
19574
- {
19575
- name: "discountedBasePrice",
19576
- label: "Discounted Price",
19577
- type: "number",
19578
- placeholder: "Enter discounted price",
19579
- prefix: "USD"
19580
- }
19581
- ], loading: a }) })
19582
- ] }) }), nn = ({ initialData: t }) => {
19583
- var y, b;
19584
- const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultLocale: o, supportedLocales: l } = ye(), d = t == null ? void 0 : t.id, u = de({
19584
+ ], loading: a }) })
19585
+ ] }) });
19586
+ }, nn = ({ initialData: t }) => {
19587
+ var b, S;
19588
+ const { client: a } = L(), r = K(), i = te(), n = ee(), { defaultCurrency: o, defaultLocale: l, supportedLocales: d } = pe(), c = t == null ? void 0 : t.id, p = de({
19585
19589
  resolver: ce(t ? Uo : Zo),
19586
19590
  defaultValues: t ? {
19587
19591
  ...t,
19588
- defaultLocale: o,
19589
- categories: (y = t.categories) == null ? void 0 : y.map((w) => w.id),
19592
+ defaultLocale: l,
19593
+ categories: (b = t.categories) == null ? void 0 : b.map((w) => w.id),
19590
19594
  translations: t.translations,
19591
19595
  images: t.images,
19592
19596
  metadata: t.metadata,
19593
- modifierGroups: (b = t.modifierGroups) == null ? void 0 : b.map((w) => ({
19597
+ modifierGroups: (S = t.modifierGroups) == null ? void 0 : S.map((w) => ({
19594
19598
  ...w,
19595
- defaultLocale: o,
19599
+ defaultLocale: l,
19596
19600
  translations: w.translations,
19597
19601
  modifiers: w.modifiers
19598
19602
  }))
19599
19603
  } : {
19600
- defaultLocale: o,
19601
- translations: l.map((w) => ({ locale: w })),
19602
- currency: "USD"
19604
+ defaultLocale: l,
19605
+ translations: d.map((w) => ({ locale: w })),
19606
+ currency: o
19603
19607
  }
19604
- }), p = $({
19608
+ }), m = $({
19605
19609
  mutationFn: async (w) => {
19606
- const { status: S } = await a.product.createProduct({
19610
+ const { status: k } = await a.product.createProduct({
19607
19611
  params: { organizationId: n },
19608
19612
  body: w
19609
19613
  });
19610
- if (S !== 201)
19614
+ if (k !== 201)
19611
19615
  throw new Error("Failed to create product");
19612
19616
  }
19613
- }), m = $({
19617
+ }), h = $({
19614
19618
  mutationFn: async (w) => {
19615
- const { status: S } = await a.product.updateProduct({
19616
- params: { organizationId: n, id: d },
19619
+ const { status: k } = await a.product.updateProduct({
19620
+ params: { organizationId: n, id: c },
19617
19621
  body: w
19618
19622
  });
19619
- if (S !== 200)
19623
+ if (k !== 200)
19620
19624
  throw new Error("Failed to update product");
19621
19625
  }
19622
- }), h = async () => {
19623
- se.success("Product saved successfully"), r.push(i.products(n)), await Ie.invalidateQueries({ queryKey: ["products"] }), d && await Ie.invalidateQueries({
19624
- queryKey: ["product", n, d]
19626
+ }), f = async () => {
19627
+ se.success("Product saved successfully"), r.push(i.products(n)), await Ie.invalidateQueries({ queryKey: ["products"] }), c && await Ie.invalidateQueries({
19628
+ queryKey: ["product", n, c]
19625
19629
  });
19626
- }, f = (w) => {
19627
- t ? m.mutate(w, { onSuccess: h }) : p.mutate(w, { onSuccess: h });
19630
+ }, y = (w) => {
19631
+ t ? h.mutate(w, { onSuccess: f }) : m.mutate(w, { onSuccess: f });
19628
19632
  };
19629
- return /* @__PURE__ */ e(Ge, { ...u, children: /* @__PURE__ */ s(
19633
+ return /* @__PURE__ */ e(Ge, { ...p, children: /* @__PURE__ */ s(
19630
19634
  "form",
19631
19635
  {
19632
- onSubmit: u.handleSubmit((w) => f(w)),
19636
+ onSubmit: p.handleSubmit((w) => y(w)),
19633
19637
  className: "space-y-14",
19634
19638
  children: [
19635
- /* @__PURE__ */ e($c, { form: u }),
19639
+ /* @__PURE__ */ e($c, { form: p }),
19636
19640
  /* @__PURE__ */ e(q, {}),
19637
- /* @__PURE__ */ e(Kc, { form: u }),
19641
+ /* @__PURE__ */ e(Kc, { form: p }),
19638
19642
  /* @__PURE__ */ e(q, {}),
19639
- /* @__PURE__ */ e(Gc, { form: u }),
19643
+ /* @__PURE__ */ e(Gc, { form: p }),
19640
19644
  /* @__PURE__ */ e(q, {}),
19641
- /* @__PURE__ */ e(_c, { form: u }),
19645
+ /* @__PURE__ */ e(_c, { form: p }),
19642
19646
  /* @__PURE__ */ e(q, {}),
19643
19647
  /* @__PURE__ */ s("div", { className: "flex justify-end space-x-3", children: [
19644
19648
  /* @__PURE__ */ s(
@@ -19657,7 +19661,7 @@ const $c = ({ form: t }) => {
19657
19661
  T,
19658
19662
  {
19659
19663
  type: "submit",
19660
- isLoading: p.isPending || m.isPending,
19664
+ isLoading: m.isPending || h.isPending,
19661
19665
  loadingText: "Saving...",
19662
19666
  children: [
19663
19667
  /* @__PURE__ */ e(ts, { className: "w-4 h-4 mr-2" }),
@@ -19693,7 +19697,7 @@ function Yc() {
19693
19697
  return /* @__PURE__ */ s("div", { className: "space-y-6", children: [
19694
19698
  /* @__PURE__ */ e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Edit Product" }),
19695
19699
  /* @__PURE__ */ e(q, {}),
19696
- n ? /* @__PURE__ */ e("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ e(he, { className: "w-8 h-8" }) }) : /* @__PURE__ */ e("div", { className: "pt-6", children: /* @__PURE__ */ e(nn, { initialData: i }) })
19700
+ n ? /* @__PURE__ */ e("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ e(fe, { className: "w-8 h-8" }) }) : /* @__PURE__ */ e("div", { className: "pt-6", children: /* @__PURE__ */ e(nn, { initialData: i }) })
19697
19701
  ] });
19698
19702
  }
19699
19703
  const Be = ot(), e0 = ({ row: t, table: a }) => {
@@ -19720,7 +19724,7 @@ const Be = ot(), e0 = ({ row: t, table: a }) => {
19720
19724
  "tremor-id": "tremor-raw",
19721
19725
  disabled: !0,
19722
19726
  children: [
19723
- /* @__PURE__ */ e(he, { className: "w-4 h-4" }),
19727
+ /* @__PURE__ */ e(fe, { className: "w-4 h-4" }),
19724
19728
  " Saving..."
19725
19729
  ]
19726
19730
  }
@@ -19761,7 +19765,7 @@ const Be = ot(), e0 = ({ row: t, table: a }) => {
19761
19765
  variant: "ghost",
19762
19766
  className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900",
19763
19767
  disabled: o.isPending,
19764
- children: o.isPending ? /* @__PURE__ */ e(he, { className: "size-4 shrink-0" }) : /* @__PURE__ */ e(
19768
+ children: o.isPending ? /* @__PURE__ */ e(fe, { className: "size-4 shrink-0" }) : /* @__PURE__ */ e(
19765
19769
  aa,
19766
19770
  {
19767
19771
  className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300",
@@ -19789,7 +19793,7 @@ const Be = ot(), e0 = ({ row: t, table: a }) => {
19789
19793
  onClick: l,
19790
19794
  disabled: o.isPending,
19791
19795
  children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
19792
- o.isPending ? /* @__PURE__ */ e(he, { className: "w-4 h-4" }) : /* @__PURE__ */ e(es, { className: "w-4 h-4" }),
19796
+ o.isPending ? /* @__PURE__ */ e(fe, { className: "w-4 h-4" }) : /* @__PURE__ */ e(es, { className: "w-4 h-4" }),
19793
19797
  o.isPending ? "Deleting..." : "Delete"
19794
19798
  ] })
19795
19799
  }
@@ -19920,8 +19924,14 @@ const Be = ot(), e0 = ({ row: t, table: a }) => {
19920
19924
  cell: ({ row: t, table: a }) => /* @__PURE__ */ e(t0, { row: t, table: a })
19921
19925
  })
19922
19926
  ], r0 = () => {
19923
- const { client: t } = L(), a = te(), { defaultLocale: r } = ye(), i = ee(), n = fe(), [o, l] = I(""), [d] = Xe(o, 300), c = Number((n == null ? void 0 : n.get("page")) || "1"), { isLoading: u, isRefetching: p, isError: m, data: h, refetch: f } = G({
19924
- queryKey: ["products", i, c, d],
19927
+ const { client: t } = L(), a = te(), { defaultLocale: r } = pe(), i = ee(), n = ye(), [o, l] = I(""), [d] = Xe(o, 300), c = Number((n == null ? void 0 : n.get("page")) || "1"), { isLoading: u, isRefetching: p, isError: m, data: h, refetch: f } = G({
19928
+ queryKey: [
19929
+ "products",
19930
+ i,
19931
+ c,
19932
+ d,
19933
+ r
19934
+ ],
19925
19935
  queryFn: async () => {
19926
19936
  const { body: y, status: b } = await t.product.getProducts({
19927
19937
  params: {
@@ -19993,12 +20003,12 @@ const i0 = ({
19993
20003
  }) => {
19994
20004
  var b;
19995
20005
  const { client: o } = L(), l = $({
19996
- mutationFn: async ({ operation: w }) => {
20006
+ mutationFn: async ({ operation: S }) => {
19997
20007
  if ((await o.reservation.updateReservationStatus({
19998
20008
  params: {
19999
20009
  organizationId: t,
20000
20010
  reservationId: a,
20001
- operation: w
20011
+ operation: S
20002
20012
  },
20003
20013
  body: {}
20004
20014
  })).status !== 200)
@@ -20209,7 +20219,7 @@ const i0 = ({
20209
20219
  cell: ({ row: t, table: a }) => /* @__PURE__ */ e(l0, { reservation: t.original, table: a })
20210
20220
  })
20211
20221
  ], c0 = () => {
20212
- const { client: t } = L(), a = ee(), r = fe(), [i, n] = I(""), [o] = Xe(i, 300), l = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: c, isError: u, data: p, refetch: m } = G({
20222
+ const { client: t } = L(), a = ee(), r = ye(), [i, n] = I(""), [o] = Xe(i, 300), l = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: c, isError: u, data: p, refetch: m } = G({
20213
20223
  queryKey: ["reservations", a, l, o],
20214
20224
  queryFn: async () => {
20215
20225
  const { body: h, status: f } = await t.reservation.getReservations({
@@ -20574,7 +20584,7 @@ function g0() {
20574
20584
  }
20575
20585
  const h0 = () => {
20576
20586
  var d;
20577
- const [t, a] = R.useState(!1), r = R.useRef(null), { organizations: i, organization: n } = ye(), o = K(), l = te();
20587
+ const [t, a] = R.useState(!1), r = R.useRef(null), { organizations: i, organization: n } = pe(), o = K(), l = te();
20578
20588
  return /* @__PURE__ */ e(C, { children: /* @__PURE__ */ s(
20579
20589
  He,
20580
20590
  {
@@ -20591,7 +20601,7 @@ const h0 = () => {
20591
20601
  ),
20592
20602
  children: [
20593
20603
  n.data.logoFile ? /* @__PURE__ */ e(
20594
- ge,
20604
+ he,
20595
20605
  {
20596
20606
  src: n.data.logoFile.url,
20597
20607
  alt: n.data.name,
@@ -20647,7 +20657,7 @@ const h0 = () => {
20647
20657
  onClick: () => o.push(l.dashboard(c.id)),
20648
20658
  children: /* @__PURE__ */ s("div", { className: "flex w-full items-center gap-x-2.5", children: [
20649
20659
  c.logoFile ? /* @__PURE__ */ e(
20650
- ge,
20660
+ he,
20651
20661
  {
20652
20662
  src: c.logoFile.url,
20653
20663
  alt: c.name,
@@ -20682,7 +20692,7 @@ const h0 = () => {
20682
20692
  }
20683
20693
  ) });
20684
20694
  }, f0 = () => {
20685
- const [t, a] = R.useState(!1), r = R.useRef(null), { organizations: i, organization: n } = ye(), o = K(), l = te();
20695
+ const [t, a] = R.useState(!1), r = R.useRef(null), { organizations: i, organization: n } = pe(), o = K(), l = te();
20686
20696
  return /* @__PURE__ */ s(
20687
20697
  He,
20688
20698
  {
@@ -20692,7 +20702,7 @@ const h0 = () => {
20692
20702
  children: [
20693
20703
  /* @__PURE__ */ e(Ze, { asChild: !0, children: n.data && /* @__PURE__ */ s("button", { className: "flex items-center gap-x-1.5 rounded-md p-2 hover:bg-gray-100 focus:outline-hidden dark:hover:bg-gray-900", children: [
20694
20704
  n.data.logoFile ? /* @__PURE__ */ e(
20695
- ge,
20705
+ he,
20696
20706
  {
20697
20707
  src: n.data.logoFile.url,
20698
20708
  alt: n.data.name,
@@ -20750,7 +20760,7 @@ const h0 = () => {
20750
20760
  onClick: () => o.push(l.dashboard(d.id)),
20751
20761
  children: /* @__PURE__ */ s("div", { className: "flex w-full items-center gap-x-2.5", children: [
20752
20762
  d.logoFile ? /* @__PURE__ */ e(
20753
- ge,
20763
+ he,
20754
20764
  {
20755
20765
  src: d.logoFile.url,
20756
20766
  alt: d.name,
@@ -21154,7 +21164,7 @@ const S0 = [
21154
21164
  );
21155
21165
  };
21156
21166
  function v0() {
21157
- const { organization: t } = ye();
21167
+ const { organization: t } = pe();
21158
21168
  return t.data ? /* @__PURE__ */ e("div", { className: "space-y-10", children: /* @__PURE__ */ e("section", { "aria-labelledby": "opening-times", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [
21159
21169
  /* @__PURE__ */ s("div", { children: [
21160
21170
  /* @__PURE__ */ e(
@@ -21275,7 +21285,7 @@ const A0 = [
21275
21285
  );
21276
21286
  yn.displayName = "Card";
21277
21287
  function R0() {
21278
- const { organization: t } = ye();
21288
+ const { organization: t } = pe();
21279
21289
  return t.data ? /* @__PURE__ */ s("div", { className: "space-y-10", children: [
21280
21290
  /* @__PURE__ */ e("section", { "aria-labelledby": "org-information", children: /* @__PURE__ */ s("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [
21281
21291
  /* @__PURE__ */ s("div", { children: [
@@ -21572,7 +21582,7 @@ function P0() {
21572
21582
  /* @__PURE__ */ e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Shipping Method" }),
21573
21583
  /* @__PURE__ */ e(q, {}),
21574
21584
  /* @__PURE__ */ e("div", { className: "pt-6", children: /* @__PURE__ */ e("div", { className: "space-y-10", children: i || !n ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-screen mt-5", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2", children: [
21575
- /* @__PURE__ */ e(he, { className: "w-12 h-12" }),
21585
+ /* @__PURE__ */ e(fe, { className: "w-12 h-12" }),
21576
21586
  /* @__PURE__ */ e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })
21577
21587
  ] }) }) : /* @__PURE__ */ e(wn, { initialData: n }) }) })
21578
21588
  ] });
@@ -21693,7 +21703,7 @@ const rt = ot(), T0 = [
21693
21703
  }
21694
21704
  })
21695
21705
  ], Q0 = () => {
21696
- const { client: t } = L(), a = ee(), r = fe(), [i] = I(""), [n] = Xe(i, 300), o = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: l, isRefetching: d, isError: c, data: u } = G({
21706
+ const { client: t } = L(), a = ee(), r = ye(), [i] = I(""), [n] = Xe(i, 300), o = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: l, isRefetching: d, isError: c, data: u } = G({
21697
21707
  queryKey: [
21698
21708
  "shipping-and-payment",
21699
21709
  a,
@@ -21762,7 +21772,7 @@ function I0() {
21762
21772
  ] });
21763
21773
  }
21764
21774
  const L0 = () => {
21765
- const t = K(), a = fe(), r = Nt(), i = te(), n = r.signIn, o = ma(
21775
+ const t = K(), a = ye(), r = Nt(), i = te(), n = r.signIn, o = ma(
21766
21776
  a == null ? void 0 : a.get("redirect"),
21767
21777
  i
21768
21778
  ), {
@@ -22047,7 +22057,7 @@ function bn({ children: t }) {
22047
22057
  const { appearance: a } = Is(), r = a == null ? void 0 : a.loginImage;
22048
22058
  return /* @__PURE__ */ s("div", { className: "flex w-full min-h-screen", children: [
22049
22059
  r && /* @__PURE__ */ e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: /* @__PURE__ */ e(
22050
- ge,
22060
+ he,
22051
22061
  {
22052
22062
  src: r,
22053
22063
  alt: "Login Visual",
@@ -22063,7 +22073,7 @@ function E0() {
22063
22073
  return /* @__PURE__ */ e(bn, { children: /* @__PURE__ */ e(L0, {}) });
22064
22074
  }
22065
22075
  const D0 = () => {
22066
- const t = K(), a = fe(), r = Nt(), i = te(), { signIn: n, signUp: o } = r, l = ma(
22076
+ const t = K(), a = ye(), r = Nt(), i = te(), { signIn: n, signUp: o } = r, l = ma(
22067
22077
  a == null ? void 0 : a.get("redirect"),
22068
22078
  i
22069
22079
  ), {
@@ -22383,7 +22393,7 @@ function M0(t) {
22383
22393
  return r ? r === "dashboard" ? { type: "dashboard", orgId: l } : r === "orders" ? { type: "orders", orgId: l } : r === "reservations" ? { type: "reservations", orgId: l } : r === "products" ? i ? i === "create" ? { type: "product-create", orgId: l } : { type: "product-edit", orgId: l, id: i } : { type: "products-list", orgId: l } : r === "product-categories" ? i ? i === "create" ? { type: "product-category-create", orgId: l } : { type: "product-category-edit", orgId: l, id: i } : { type: "product-categories-list", orgId: l } : r === "manufacturers" ? i ? i === "create" ? { type: "manufacturer-create", orgId: l } : { type: "manufacturer-edit", orgId: l, id: i } : { type: "manufacturers-list", orgId: l } : r === "settings" ? i ? i === "opening-times" ? { type: "settings-opening-times", orgId: l } : i === "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" };
22384
22394
  }
22385
22395
  function zu({ segments: t }) {
22386
- const a = Nt(), r = te(), i = K(), n = nt(), o = fe(), { data: l, isPending: d } = a.useSession(), c = M0(t), u = c.type === "sign-in" || c.type === "sign-up", p = c.type === "home" || c.type === "organizations", m = o == null ? void 0 : o.get("redirect"), h = o == null ? void 0 : o.toString(), f = n ? `${n}${h ? `?${h}` : ""}` : r.home, y = u ? ma(m, r) : f;
22396
+ const a = Nt(), r = te(), i = K(), n = nt(), o = ye(), { data: l, isPending: d } = a.useSession(), c = M0(t), u = c.type === "sign-in" || c.type === "sign-up", p = c.type === "home" || c.type === "organizations", m = o == null ? void 0 : o.get("redirect"), h = o == null ? void 0 : o.toString(), f = n ? `${n}${h ? `?${h}` : ""}` : r.home, y = u ? ma(m, r) : f;
22387
22397
  if (X(() => {
22388
22398
  if (!d) {
22389
22399
  if (!l && !u) {
@@ -22404,8 +22414,8 @@ function zu({ segments: t }) {
22404
22414
  return /* @__PURE__ */ e(Mr, { children: /* @__PURE__ */ e(Jc, {}) });
22405
22415
  if (c.type === "not-found")
22406
22416
  return /* @__PURE__ */ e(hi, {});
22407
- const b = "orgId" in c ? c.orgId : void 0, w = "id" in c ? c.id : void 0;
22408
- return /* @__PURE__ */ e(Sd, { organizationId: b, id: w, children: /* @__PURE__ */ e(Mr, { children: /* @__PURE__ */ e(Ad, { children: /* @__PURE__ */ e(x0, { children: B0(c) }) }) }) });
22417
+ const b = "orgId" in c ? c.orgId : void 0, S = "id" in c ? c.id : void 0;
22418
+ return /* @__PURE__ */ e(Sd, { organizationId: b, id: S, children: /* @__PURE__ */ e(Mr, { children: /* @__PURE__ */ e(Ad, { children: /* @__PURE__ */ e(x0, { children: B0(c) }) }) }) });
22409
22419
  }
22410
22420
  function B0(t) {
22411
22421
  switch (t.type) {
@@ -22475,7 +22485,7 @@ export {
22475
22485
  oi as X,
22476
22486
  Re as Y,
22477
22487
  Ql as Z,
22478
- me as _,
22488
+ ge as _,
22479
22489
  zu as a,
22480
22490
  Nu as a0,
22481
22491
  qa as a1,