@billgangcom/theme-lib 1.116.0 → 1.116.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{builder-CUCCG2gi.cjs → builder-C7KDCjPK.cjs} +10 -10
  2. package/dist/{builder-components-R1dTBy7D.js → builder-components-C8GR-K0b.js} +4 -4
  3. package/dist/{builder-components-D2219YPy.cjs → builder-components-DTCH52Zj.cjs} +1 -1
  4. package/dist/{builder-Bj8ViroH.js → builder-q7_i-usP.js} +15 -9
  5. package/dist/builder.cjs.js +1 -1
  6. package/dist/builder.es.js +22 -22
  7. package/dist/{charge-BrY_-ls8.cjs → charge-CjJu8ZCC.cjs} +24 -24
  8. package/dist/{charge-Cti1lSP2.js → charge-D5cvaKFj.js} +2015 -2001
  9. package/dist/{checkout-CTbZMuPC.js → checkout-CsTsjmHG.js} +5 -5
  10. package/dist/{checkout-C-7bV9sk.cjs → checkout-Dbu7YMSx.cjs} +1 -1
  11. package/dist/exports.cjs.js +1 -1
  12. package/dist/exports.es.js +6 -6
  13. package/dist/{index-CQm0i92r.cjs → index-2oIkoScp.cjs} +1 -1
  14. package/dist/{index-CILywG47.cjs → index-B-z0PneZ.cjs} +1 -1
  15. package/dist/{index-O5YekXKo.cjs → index-B1UP_MbR.cjs} +1 -1
  16. package/dist/{index-CUnfTwF8.js → index-BLeoCjpE.js} +5 -5
  17. package/dist/{index-B03fd16N.js → index-BbZMD5la.js} +5 -5
  18. package/dist/{index-BBcZT0G2.js → index-C9TT9z5B.js} +5 -5
  19. package/dist/{index-OTW9ycHk.js → index-DU5z0tPJ.js} +5 -5
  20. package/dist/{index-xbQ-1j9f.cjs → index-DXroLqaD.cjs} +1 -1
  21. package/dist/{index-CUFJfAc6.js → index-d8l00Hpw.js} +1 -1
  22. package/dist/{index-HhcLQjbw.cjs → index-r9HLobSy.cjs} +1 -1
  23. package/dist/index.cjs.js +1 -1
  24. package/dist/index.es.js +6 -6
  25. package/dist/{order-1lHCRSUw.js → order-Cveqw4gC.js} +121 -121
  26. package/dist/order-d9OX_gLP.cjs +1 -0
  27. package/dist/src/abstractions/PageContext.d.ts +7 -0
  28. package/dist/src/abstractions/Variable.d.ts +1 -0
  29. package/dist/src/builder/api/fetchData.d.ts +3 -0
  30. package/dist/style.css +1 -1
  31. package/dist/{subscription-BS-hdxzD.cjs → subscription-BvsNAnoC.cjs} +1 -1
  32. package/dist/{subscription-DBjS-E8T.js → subscription-Bz6FRE3J.js} +5 -5
  33. package/dist/{ticket-myEl0GYr.cjs → ticket-B90nYD05.cjs} +1 -1
  34. package/dist/{ticket-BtcmMwIl.js → ticket-DU1t1M0h.js} +9 -7
  35. package/dist/{top-up-DNSDJwN-.js → top-up-2OMBI611.js} +5 -5
  36. package/dist/{top-up-DTVCb-zx.cjs → top-up-CFc0wZAg.cjs} +1 -1
  37. package/dist/{ui-components-BR9v0VH1.cjs → ui-components-B79-9qoP.cjs} +1 -1
  38. package/dist/{ui-components-PK209o-T.js → ui-components-BxH-lR8m.js} +4 -4
  39. package/dist/ui.cjs.js +1 -1
  40. package/dist/ui.es.js +1 -1
  41. package/dist/{validation-D3uB6IO3.cjs → validation-Crn-70HH.cjs} +1 -1
  42. package/dist/{validation-DgaNU463.js → validation-DpREFoxz.js} +5 -5
  43. package/package.json +1 -1
  44. package/dist/order-DNaXADFJ.cjs +0 -1
@@ -1,140 +1,140 @@
1
- import { jsx as o, Fragment as G, jsxs as r } from "react/jsx-runtime";
2
- import i, { useState as Z, useMemo as I } from "react";
3
- import { X as ee, p as H, M as te, V as J, a7 as oe } from "./builder-Bj8ViroH.js";
4
- import { f as ne, N as ae, P as se, O as ce, g as ie, b as re, c as v, d as le, e as ue, h as de, i as me, j as he, V as pe, k as fe, L as _e, T as ge, l as z, m as ye, n as we, o as Se } from "./charge-Cti1lSP2.js";
5
- import { M as ke, I as X, g as B, e as ve } from "./ui-components-PK209o-T.js";
6
- import "./builder-components-R1dTBy7D.js";
7
- import "./ticket-BtcmMwIl.js";
1
+ import { jsx as o, Fragment as z, jsxs as r } from "react/jsx-runtime";
2
+ import i, { useState as ee, useMemo as I } from "react";
3
+ import { X as te, p as J, M as oe, V as X, a7 as ne } from "./builder-q7_i-usP.js";
4
+ import { f as ae, N as se, P as ce, O as ie, g as re, b as le, c as C, d as ue, e as de, h as me, i as he, j as pe, V as fe, k as _e, L as ge, T as ye, l as H, m as we, n as Se, o as ke } from "./charge-D5cvaKFj.js";
5
+ import { M as ve, I as Y, g as V, e as Ce } from "./ui-components-BxH-lR8m.js";
6
+ import "./builder-components-C8GR-K0b.js";
7
+ import "./ticket-DU1t1M0h.js";
8
8
  import "react-dom";
9
- const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
10
- const [n, c] = i.useState(null), [d, e] = Z(null), [_, C] = i.useState(0), { page: g } = ee(), [S, l] = i.useState(!0);
11
- async function k() {
9
+ const Ne = async (n = 1) => await ae({ PageNumber: n }), rt = () => {
10
+ const [n, c] = i.useState(null), [d, e] = ee(null), [_, N] = i.useState(0), { page: g } = te(), [k, l] = i.useState(!0);
11
+ async function v() {
12
12
  l(!0);
13
- const { list: y, totalCount: w } = await Ce(g);
14
- c(y), C(w), e(null), l(!1);
13
+ const { list: y, totalCount: w } = await Ne(g);
14
+ c(y), N(w), e(null), l(!1);
15
15
  }
16
- async function h() {
17
- const y = (n == null ? void 0 : n.map((N) => N.gatewayName)) || [], w = await ie(y);
16
+ async function m() {
17
+ const y = (n == null ? void 0 : n.map((b) => b.gatewayName)) || [], w = await re(y);
18
18
  e(w);
19
19
  }
20
20
  return i.useEffect(() => {
21
- !d && n && h();
21
+ !d && n && m();
22
22
  }, [n, d]), i.useEffect(() => {
23
- k();
24
- }, [g]), /* @__PURE__ */ o(G, { children: n != null && n.length && n.length === 0 ? /* @__PURE__ */ o(
25
- ae,
23
+ v();
24
+ }, [g]), /* @__PURE__ */ o(z, { children: n != null && n.length && n.length === 0 ? /* @__PURE__ */ o(
25
+ se,
26
26
  {
27
27
  title: "No Orders",
28
28
  description: "When you purchase products from our website, you'll see a history of orders here."
29
29
  }
30
- ) : /* @__PURE__ */ r(G, { children: [
31
- /* @__PURE__ */ o(se, { title: "Orders" }),
30
+ ) : /* @__PURE__ */ r(z, { children: [
31
+ /* @__PURE__ */ o(ce, { title: "Orders" }),
32
32
  /* @__PURE__ */ o(
33
- ce,
33
+ ie,
34
34
  {
35
35
  orders: n,
36
36
  gatewaysDetail: d,
37
37
  totalCount: _,
38
- isLoading: S
38
+ isLoading: k
39
39
  }
40
40
  )
41
41
  ] }) });
42
- }, Ne = "_orderPage_gc87l_1", be = "_leftSection_gc87l_15", Pe = "_content_gc87l_35", De = "_main_gc87l_42", Oe = "_mainAntistock_gc87l_56", Ae = "_orderMainDataAntistock_gc87l_69", Re = "_timelineBlockAntistock_gc87l_81", Me = "_footerAntistock_gc87l_92", Ie = "_statusBlock_gc87l_104", Be = "_timelineBlock_gc87l_81", Ve = "_footer_gc87l_92", $e = "_rightSection_gc87l_121", Fe = "_header_gc87l_142", Te = "_productList_gc87l_150", Le = "_mobileFooter_gc87l_157", Ee = "_loaderContainer_gc87l_166", We = "_orderMainData_gc87l_69", xe = "_prices_gc87l_181", qe = "_headerTitle_gc87l_185", Ue = "_headerDescription_gc87l_189", a = {
43
- orderPage: Ne,
44
- leftSection: be,
45
- content: Pe,
46
- main: De,
47
- mainAntistock: Oe,
48
- orderMainDataAntistock: Ae,
49
- timelineBlockAntistock: Re,
50
- footerAntistock: Me,
51
- statusBlock: Ie,
42
+ }, be = "_orderPage_gc87l_1", Pe = "_leftSection_gc87l_15", De = "_content_gc87l_35", Oe = "_main_gc87l_42", Ae = "_mainAntistock_gc87l_56", Re = "_orderMainDataAntistock_gc87l_69", Me = "_timelineBlockAntistock_gc87l_81", Ie = "_footerAntistock_gc87l_92", Ve = "_statusBlock_gc87l_104", Be = "_timelineBlock_gc87l_81", $e = "_footer_gc87l_92", Fe = "_rightSection_gc87l_121", Te = "_header_gc87l_142", Le = "_productList_gc87l_150", Ee = "_mobileFooter_gc87l_157", We = "_loaderContainer_gc87l_166", xe = "_orderMainData_gc87l_69", qe = "_prices_gc87l_181", Ue = "_headerTitle_gc87l_185", je = "_headerDescription_gc87l_189", a = {
43
+ orderPage: be,
44
+ leftSection: Pe,
45
+ content: De,
46
+ main: Oe,
47
+ mainAntistock: Ae,
48
+ orderMainDataAntistock: Re,
49
+ timelineBlockAntistock: Me,
50
+ footerAntistock: Ie,
51
+ statusBlock: Ve,
52
52
  timelineBlock: Be,
53
- footer: Ve,
54
- rightSection: $e,
55
- header: Fe,
56
- productList: Te,
57
- mobileFooter: Le,
58
- loaderContainer: Ee,
59
- orderMainData: We,
60
- prices: xe,
61
- headerTitle: qe,
62
- headerDescription: Ue
63
- }, je = "_modalContent_1a05n_1", Ge = "_iconContainer_1a05n_16", ze = "_warningIcon_1a05n_20", He = "_title_1a05n_25", Je = "_description_1a05n_33", Xe = "_buttonContainer_1a05n_40", Ye = "_button_1a05n_40", p = {
64
- modalContent: je,
65
- iconContainer: Ge,
66
- warningIcon: ze,
67
- title: He,
68
- description: Je,
69
- buttonContainer: Xe,
70
- button: Ye
71
- }, Ke = ({
53
+ footer: $e,
54
+ rightSection: Fe,
55
+ header: Te,
56
+ productList: Le,
57
+ mobileFooter: Ee,
58
+ loaderContainer: We,
59
+ orderMainData: xe,
60
+ prices: qe,
61
+ headerTitle: Ue,
62
+ headerDescription: je
63
+ }, Ge = "_modalContent_1a05n_1", ze = "_iconContainer_1a05n_16", He = "_warningIcon_1a05n_20", Je = "_title_1a05n_25", Xe = "_description_1a05n_33", Ye = "_buttonContainer_1a05n_40", Ke = "_button_1a05n_40", h = {
64
+ modalContent: Ge,
65
+ iconContainer: ze,
66
+ warningIcon: He,
67
+ title: Je,
68
+ description: Xe,
69
+ buttonContainer: Ye,
70
+ button: Ke
71
+ }, Qe = ({
72
72
  isOpen: n,
73
73
  onClose: c,
74
74
  refundedAmount: d,
75
75
  currency: e
76
76
  }) => {
77
77
  var D, O;
78
- const _ = H(), { token: C, shopDomain: g } = te(), { isAntistock: S, general: l } = J(), k = !!((D = l == null ? void 0 : l.info) != null && D.disableSupport), h = (O = l == null ? void 0 : l.info) == null ? void 0 : O.thirdPartySupportUrl, y = !(k && !h), w = new Intl.NumberFormat("en-US", {
78
+ const _ = J(), { token: N, shopDomain: g } = oe(), { isAntistock: k, general: l } = X(), v = !!((D = l == null ? void 0 : l.info) != null && D.disableSupport), m = (O = l == null ? void 0 : l.info) == null ? void 0 : O.thirdPartySupportUrl, y = !(v && !m), w = new Intl.NumberFormat("en-US", {
79
79
  style: "currency",
80
80
  currency: e
81
- }), N = () => {
82
- _(S ? "/account" : "/customer-dash");
81
+ }), b = () => {
82
+ _(k ? "/account" : "/customer-dash");
83
83
  }, u = async () => {
84
- if (k && h) {
85
- window.open(h);
84
+ if (v && m) {
85
+ window.open(m);
86
86
  return;
87
87
  }
88
- S ? window.open(`https://${g}/support`) : _("/contact");
88
+ k ? window.open(`https://${g}/support`) : _("/contact");
89
89
  }, s = () => {
90
90
  c();
91
91
  };
92
- return n ? /* @__PURE__ */ o(ke, { close: c, children: /* @__PURE__ */ r(
92
+ return n ? /* @__PURE__ */ o(ve, { close: c, children: /* @__PURE__ */ r(
93
93
  "div",
94
94
  {
95
- className: p.modalContent,
95
+ className: h.modalContent,
96
96
  onClick: (A) => A.stopPropagation(),
97
97
  children: [
98
- /* @__PURE__ */ o("div", { className: p.iconContainer, children: /* @__PURE__ */ o(
99
- X,
98
+ /* @__PURE__ */ o("div", { className: h.iconContainer, children: /* @__PURE__ */ o(
99
+ Y,
100
100
  {
101
101
  name: "WarningDiamond",
102
102
  fill: "var(--text-warning)",
103
- className: p.warningIcon
103
+ className: h.warningIcon
104
104
  }
105
105
  ) }),
106
- /* @__PURE__ */ o("h2", { className: p.title, children: "Partial Delivery Failure Refund" }),
107
- /* @__PURE__ */ r("p", { className: p.description, children: [
106
+ /* @__PURE__ */ o("h2", { className: h.title, children: "Partial Delivery Failure Refund" }),
107
+ /* @__PURE__ */ r("p", { className: h.description, children: [
108
108
  "Your payment was successful but a few products were out of stock. We've automatically refunded the products that were out of stock, with a total of",
109
109
  " ",
110
110
  w.format(d),
111
111
  ", to your account balance."
112
112
  ] }),
113
- /* @__PURE__ */ r("div", { className: p.buttonContainer, children: [
114
- !C && /* @__PURE__ */ o(
115
- B,
113
+ /* @__PURE__ */ r("div", { className: h.buttonContainer, children: [
114
+ !N && /* @__PURE__ */ o(
115
+ V,
116
116
  {
117
117
  type: "Secondary",
118
- onClick: N,
119
- className: p.button,
118
+ onClick: b,
119
+ className: h.button,
120
120
  children: "Login"
121
121
  }
122
122
  ),
123
123
  y && /* @__PURE__ */ o(
124
- B,
124
+ V,
125
125
  {
126
126
  type: "Secondary",
127
127
  onClick: u,
128
- className: p.button,
128
+ className: h.button,
129
129
  children: "Contact Support"
130
130
  }
131
131
  ),
132
132
  /* @__PURE__ */ o(
133
- B,
133
+ V,
134
134
  {
135
135
  type: "Primary",
136
136
  onClick: s,
137
- className: p.button,
137
+ className: h.button,
138
138
  children: "Continue"
139
139
  }
140
140
  )
@@ -142,26 +142,26 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
142
142
  ]
143
143
  }
144
144
  ) }) : null;
145
- }, Qe = () => {
145
+ }, Ze = () => {
146
146
  var $, F, T, L, E, W, x, q, U;
147
- const { id: n, accessToken: c } = oe(), d = H(), [e, _] = i.useState(), [C, g] = i.useState(!1), [S, l] = i.useState(!1), [k, h] = i.useState(!1), [y, w] = i.useState(!1), N = re(), { isAntistock: u, general: s } = J(), D = (($ = e == null ? void 0 : e.rawPrice) == null ? void 0 : $.currency) || "USD", O = new Intl.NumberFormat("en-US", {
147
+ const { id: n, accessToken: c } = ne(), d = J(), [e, _] = i.useState(), [N, g] = i.useState(!1), [k, l] = i.useState(!1), [v, m] = i.useState(!1), [y, w] = i.useState(!1), b = le(), { isAntistock: u, general: s } = X(), D = (($ = e == null ? void 0 : e.rawPrice) == null ? void 0 : $.currency) || "USD", O = new Intl.NumberFormat("en-US", {
148
148
  style: "currency",
149
149
  currency: D
150
150
  }), A = i.useMemo(() => (e == null ? void 0 : e.partOrders.map((t) => {
151
- var b, M;
151
+ var P, M, S;
152
152
  return {
153
- id: (t == null ? void 0 : t.id) || 0,
153
+ id: Number((P = t.productWithVariant) == null ? void 0 : P.id) || 0,
154
154
  image: t.productWithVariant.image,
155
155
  name: (() => {
156
- var P, j;
157
- const m = ((P = t.productWithVariant) == null ? void 0 : P.name) || "", f = ((j = t.productWithVariant) == null ? void 0 : j.variantName) || "";
158
- return !m && !f ? "" : !f || m === f ? m : m ? `${m} (${f})` : f;
156
+ var j, G;
157
+ const p = ((j = t.productWithVariant) == null ? void 0 : j.name) || "", f = ((G = t.productWithVariant) == null ? void 0 : G.variantName) || "";
158
+ return !p && !f ? "" : !f || p === f ? p : p ? `${p} (${f})` : f;
159
159
  })(),
160
160
  description: "",
161
161
  price: {
162
162
  quantity: t.quantity,
163
- amount: ((b = t.productWithVariant) == null ? void 0 : b.price.amount) || 0,
164
- currency: (M = t.productWithVariant) == null ? void 0 : M.price.currency
163
+ amount: ((M = t.productWithVariant) == null ? void 0 : M.price.amount) || 0,
164
+ currency: (S = t.productWithVariant) == null ? void 0 : S.price.currency
165
165
  },
166
166
  deliveryCategories: "deliveryCategories" in t ? t.deliveryCategories : void 0,
167
167
  customerNote: t.customerNote,
@@ -171,15 +171,15 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
171
171
  };
172
172
  })) || [], [e]);
173
173
  i.useEffect(() => {
174
- e && (e.status === v.FullDeliveryFailure || e.status === v.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && l(!0);
174
+ e && (e.status === C.FullDeliveryFailure || e.status === C.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && l(!0);
175
175
  }, [e == null ? void 0 : e.status]);
176
- const R = i.useCallback(async (t, b, M = !1) => {
177
- var f, P;
176
+ const R = i.useCallback(async (t, P, M = !1) => {
177
+ var p, f;
178
178
  M || g(!0);
179
- const { data: m } = await (b ? le(`${t}/${b}`) : ue(t));
180
- g(!1), m.status !== v.Completed && ((f = m.charge) == null ? void 0 : f.status) === de.NotPaid && d(`/charges/${(P = m.charge) == null ? void 0 : P.id}`, {
179
+ const { data: S } = await (P ? ue(`${t}/${P}`) : de(t));
180
+ g(!1), S.status !== C.Completed && ((p = S.charge) == null ? void 0 : p.status) === me.NotPaid && d(`/charges/${(f = S.charge) == null ? void 0 : f.id}`, {
181
181
  replace: !0
182
- }), _(m);
182
+ }), _(S);
183
183
  }, [d]);
184
184
  i.useLayoutEffect(() => {
185
185
  if (n && !c) {
@@ -195,22 +195,22 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
195
195
  clearInterval(t);
196
196
  };
197
197
  }, [n, c, R]);
198
- const Y = I(() => !!(e != null && e.isApplicableForReplacement && (e.status === v.Completed || e.status === v.PartiallyDelivered || e.status === v.FullDeliveryFailure)), [e]), V = I(() => {
198
+ const K = I(() => !!(e != null && e.isApplicableForReplacement && (e.status === C.Completed || e.status === C.PartiallyDelivered || e.status === C.FullDeliveryFailure)), [e]), B = I(() => {
199
199
  var t;
200
200
  return !!((t = s == null ? void 0 : s.info) != null && t.isVouchesEnabled && c);
201
- }, [(F = s == null ? void 0 : s.info) == null ? void 0 : F.isVouchesEnabled, c]), K = I(() => {
201
+ }, [(F = s == null ? void 0 : s.info) == null ? void 0 : F.isVouchesEnabled, c]), Q = I(() => {
202
202
  var t;
203
203
  return !!(!((t = s == null ? void 0 : s.info) != null && t.isVouchesEnabled) && (e != null && e.review) && "accessToken" in e.review && !u);
204
- }, [(T = s == null ? void 0 : s.info) == null ? void 0 : T.isVouchesEnabled, e == null ? void 0 : e.review, u]), Q = I(() => {
204
+ }, [(T = s == null ? void 0 : s.info) == null ? void 0 : T.isVouchesEnabled, e == null ? void 0 : e.review, u]), Z = I(() => {
205
205
  var t;
206
206
  return ((t = s == null ? void 0 : s.info) == null ? void 0 : t.domain) || window.location.hostname;
207
207
  }, [(L = s == null ? void 0 : s.info) == null ? void 0 : L.domain]);
208
- return C ? /* @__PURE__ */ o("div", { className: a.loaderContainer, children: /* @__PURE__ */ o(ve, {}) }) : /* @__PURE__ */ r("div", { className: a.orderPage, children: [
208
+ return N ? /* @__PURE__ */ o("div", { className: a.loaderContainer, children: /* @__PURE__ */ o(Ce, {}) }) : /* @__PURE__ */ r("div", { className: a.orderPage, children: [
209
209
  /* @__PURE__ */ o("div", { className: a.leftSection, children: /* @__PURE__ */ r("div", { className: a.content, children: [
210
- /* @__PURE__ */ o(me, {}),
210
+ /* @__PURE__ */ o(he, {}),
211
211
  e && /* @__PURE__ */ r("div", { className: `${a.main} ${u ? a.mainAntistock : ""}`, children: [
212
212
  /* @__PURE__ */ o(
213
- he,
213
+ pe,
214
214
  {
215
215
  className: a.statusBlock,
216
216
  orderStatus: e.status
@@ -221,15 +221,15 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
221
221
  {
222
222
  className: `${a.orderMainData} ${u ? a.orderMainDataAntistock : ""}`,
223
223
  children: [
224
- V && /* @__PURE__ */ o(
225
- pe,
224
+ B && /* @__PURE__ */ o(
225
+ fe,
226
226
  {
227
- onAddMessage: () => h(!0),
227
+ onAddMessage: () => m(!0),
228
228
  isSubmitted: y
229
229
  }
230
230
  ),
231
231
  /* @__PURE__ */ o(
232
- fe,
232
+ _e,
233
233
  {
234
234
  lastUpdate: e.createdAt,
235
235
  paymentType: (E = e.charge) == null ? void 0 : E.gateway,
@@ -237,8 +237,8 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
237
237
  orderId: e.id
238
238
  }
239
239
  ),
240
- K && e.review && /* @__PURE__ */ o(
241
- _e,
240
+ Q && e.review && /* @__PURE__ */ o(
241
+ ge,
242
242
  {
243
243
  orderId: e.id,
244
244
  review: e.review
@@ -248,14 +248,14 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
248
248
  }
249
249
  ),
250
250
  e.charge && e.charge.timeline && /* @__PURE__ */ o(
251
- ge,
251
+ ye,
252
252
  {
253
253
  className: `${a.timelineBlock} ${u ? a.timelineBlockAntistock : ""}`,
254
254
  timeline: e.charge.timeline
255
255
  }
256
256
  ),
257
257
  /* @__PURE__ */ o(
258
- z,
258
+ H,
259
259
  {
260
260
  className: `${a.footer} ${u ? a.footerAntistock : ""}`
261
261
  }
@@ -274,10 +274,10 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
274
274
  e.charge.description && /* @__PURE__ */ o("p", { className: a.headerDescription, children: e.charge.description })
275
275
  ] }),
276
276
  u ? null : /* @__PURE__ */ r(
277
- B,
277
+ V,
278
278
  {
279
279
  type: "Secondary",
280
- onClick: () => N((e == null ? void 0 : e.id) || ""),
280
+ onClick: () => b((e == null ? void 0 : e.id) || ""),
281
281
  style: {
282
282
  whiteSpace: "nowrap",
283
283
  display: "flex",
@@ -285,7 +285,7 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
285
285
  gap: "4px"
286
286
  },
287
287
  children: [
288
- /* @__PURE__ */ o(X, { name: "Copy" }),
288
+ /* @__PURE__ */ o(Y, { name: "Copy" }),
289
289
  /* @__PURE__ */ o("span", { children: "Copy ID" })
290
290
  ]
291
291
  }
@@ -293,11 +293,11 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
293
293
  ] }),
294
294
  /* @__PURE__ */ r("div", { children: [
295
295
  /* @__PURE__ */ o("div", { className: a.productList, children: A.map((t) => /* @__PURE__ */ o(
296
- ye,
296
+ we,
297
297
  {
298
298
  product: t,
299
299
  isOrder: !0,
300
- isApplicableForReplacement: Y,
300
+ isApplicableForReplacement: K,
301
301
  orderId: n,
302
302
  accessToken: c,
303
303
  allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
@@ -305,7 +305,7 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
305
305
  t.id
306
306
  )) }),
307
307
  u ? null : /* @__PURE__ */ o(
308
- we,
308
+ Se,
309
309
  {
310
310
  formatter: O,
311
311
  coupon: null,
@@ -316,40 +316,40 @@ const Ce = async (n = 1) => await ne({ PageNumber: n }), it = () => {
316
316
  isShowSubtotal: !1
317
317
  }
318
318
  ),
319
- /* @__PURE__ */ o(z, { className: a.mobileFooter })
319
+ /* @__PURE__ */ o(H, { className: a.mobileFooter })
320
320
  ] })
321
321
  ] })
322
322
  }
323
323
  ),
324
324
  (e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ o(
325
- Ke,
325
+ Qe,
326
326
  {
327
- isOpen: S,
327
+ isOpen: k,
328
328
  onClose: () => l(!1),
329
329
  refundedAmount: e.refundedPrice.amount,
330
330
  currency: e.refundedPrice.currency
331
331
  }
332
332
  ),
333
- V && /* @__PURE__ */ o(
334
- Se,
333
+ B && /* @__PURE__ */ o(
334
+ ke,
335
335
  {
336
- isOpen: k,
337
- onClose: () => h(!1),
336
+ isOpen: v,
337
+ onClose: () => m(!1),
338
338
  products: A,
339
339
  orderId: n,
340
340
  accessToken: c,
341
- shopDomain: Q,
341
+ shopDomain: Z,
342
342
  onSuccess: () => {
343
- w(!0), h(!1), n && R(n, c, !0);
343
+ w(!0), m(!1), n && R(n, c, !0);
344
344
  }
345
345
  }
346
346
  )
347
347
  ] });
348
- }, rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
348
+ }, lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
349
349
  __proto__: null,
350
- OrderPage: Qe
350
+ OrderPage: Ze
351
351
  }, Symbol.toStringTag, { value: "Module" }));
352
352
  export {
353
- it as O,
354
- rt as i
353
+ rt as O,
354
+ lt as i
355
355
  };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),i=require("react"),k=require("./builder-C7KDCjPK.cjs"),o=require("./charge-CjJu8ZCC.cjs"),_=require("./ui-components-B79-9qoP.cjs");require("./builder-components-DTCH52Zj.cjs");require("./ticket-B90nYD05.cjs");require("react-dom");const J=async(n=1)=>await o.fetchOrders({PageNumber:n}),Y=()=>{const[n,r]=i.useState(null),[d,e]=i.useState(null),[g,v]=i.useState(0),{page:y}=k.usePaginationPagesStore(),[C,l]=i.useState(!0);async function j(){l(!0);const{list:S,totalCount:w}=await J(y);r(S),v(w),e(null),l(!1)}async function m(){const S=(n==null?void 0:n.map(N=>N.gatewayName))||[],w=await o.getGatewaysDetail(S);e(w)}return i.useEffect(()=>{!d&&n&&m()},[n,d]),i.useEffect(()=>{j()},[y]),t.jsx(t.Fragment,{children:n!=null&&n.length&&n.length===0?t.jsx(o.NoItemsBlock,{title:"No Orders",description:"When you purchase products from our website, you'll see a history of orders here."}):t.jsxs(t.Fragment,{children:[t.jsx(o.PageTitle,{title:"Orders"}),t.jsx(o.OrdersTable,{orders:n,gatewaysDetail:d,totalCount:g,isLoading:C})]})})},K="_orderPage_gc87l_1",Q="_leftSection_gc87l_15",X="_content_gc87l_35",Z="_main_gc87l_42",ee="_mainAntistock_gc87l_56",te="_orderMainDataAntistock_gc87l_69",se="_timelineBlockAntistock_gc87l_81",ne="_footerAntistock_gc87l_92",oe="_statusBlock_gc87l_104",ae="_timelineBlock_gc87l_81",ce="_footer_gc87l_92",ie="_rightSection_gc87l_121",re="_header_gc87l_142",le="_productList_gc87l_150",ue="_mobileFooter_gc87l_157",de="_loaderContainer_gc87l_166",me="_orderMainData_gc87l_69",he="_prices_gc87l_181",pe="_headerTitle_gc87l_185",fe="_headerDescription_gc87l_189",a={orderPage:K,leftSection:Q,content:X,main:Z,mainAntistock:ee,orderMainDataAntistock:te,timelineBlockAntistock:se,footerAntistock:ne,statusBlock:oe,timelineBlock:ae,footer:ce,rightSection:ie,header:re,productList:le,mobileFooter:ue,loaderContainer:de,orderMainData:me,prices:he,headerTitle:pe,headerDescription:fe},_e="_modalContent_1a05n_1",ge="_iconContainer_1a05n_16",ye="_warningIcon_1a05n_20",Se="_title_1a05n_25",we="_description_1a05n_33",xe="_buttonContainer_1a05n_40",ke="_button_1a05n_40",h={modalContent:_e,iconContainer:ge,warningIcon:ye,title:Se,description:we,buttonContainer:xe,button:ke},Ce=({isOpen:n,onClose:r,refundedAmount:d,currency:e})=>{var O,D;const g=k.useNavigate(),{token:v,shopDomain:y}=k.useStorefrontStore(),{isAntistock:C,general:l}=k.useGeneralStore(),j=!!((O=l==null?void 0:l.info)!=null&&O.disableSupport),m=(D=l==null?void 0:l.info)==null?void 0:D.thirdPartySupportUrl,S=!(j&&!m),w=new Intl.NumberFormat("en-US",{style:"currency",currency:e}),N=()=>{g(C?"/account":"/customer-dash")},u=async()=>{if(j&&m){window.open(m);return}C?window.open(`https://${y}/support`):g("/contact")},c=()=>{r()};return n?t.jsx(_.Modal,{close:r,children:t.jsxs("div",{className:h.modalContent,onClick:P=>P.stopPropagation(),children:[t.jsx("div",{className:h.iconContainer,children:t.jsx(_.Icon,{name:"WarningDiamond",fill:"var(--text-warning)",className:h.warningIcon})}),t.jsx("h2",{className:h.title,children:"Partial Delivery Failure Refund"}),t.jsxs("p",{className:h.description,children:["Your payment was successful but a few products were out of stock. We've automatically refunded the products that were out of stock, with a total of"," ",w.format(d),", to your account balance."]}),t.jsxs("div",{className:h.buttonContainer,children:[!v&&t.jsx(_.Button,{type:"Secondary",onClick:N,className:h.button,children:"Login"}),S&&t.jsx(_.Button,{type:"Secondary",onClick:u,className:h.button,children:"Contact Support"}),t.jsx(_.Button,{type:"Primary",onClick:c,className:h.button,children:"Continue"})]})]})}):null},je=()=>{var I,B,F,V,$,T,q,L,E;const{id:n,accessToken:r}=k.useParams(),d=k.useNavigate(),[e,g]=i.useState(),[v,y]=i.useState(!1),[C,l]=i.useState(!1),[j,m]=i.useState(!1),[S,w]=i.useState(!1),N=o.useCopy(),{isAntistock:u,general:c}=k.useGeneralStore(),O=((I=e==null?void 0:e.rawPrice)==null?void 0:I.currency)||"USD",D=new Intl.NumberFormat("en-US",{style:"currency",currency:O}),P=i.useMemo(()=>(e==null?void 0:e.partOrders.map(s=>{var b,R,x;return{id:Number((b=s.productWithVariant)==null?void 0:b.id)||0,image:s.productWithVariant.image,name:(()=>{var W,U;const p=((W=s.productWithVariant)==null?void 0:W.name)||"",f=((U=s.productWithVariant)==null?void 0:U.variantName)||"";return!p&&!f?"":!f||p===f?p:p?`${p} (${f})`:f})(),description:"",price:{quantity:s.quantity,amount:((R=s.productWithVariant)==null?void 0:R.price.amount)||0,currency:(x=s.productWithVariant)==null?void 0:x.price.currency},deliveryCategories:"deliveryCategories"in s?s.deliveryCategories:void 0,customerNote:s.customerNote,chargeType:s.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in s?s.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in s?s.allowedReplacementReasons:void 0}}))||[],[e]);i.useEffect(()=>{e&&(e.status===o.OrderStatus.FullDeliveryFailure||e.status===o.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&l(!0)},[e==null?void 0:e.status]);const A=i.useCallback(async(s,b,R=!1)=>{var p,f;R||y(!0);const{data:x}=await(b?o.fetchAuthorizedOrder(`${s}/${b}`):o.fetchOrder(s));y(!1),x.status!==o.OrderStatus.Completed&&((p=x.charge)==null?void 0:p.status)===o.ChargeStatus.NotPaid&&d(`/charges/${(f=x.charge)==null?void 0:f.id}`,{replace:!0}),g(x)},[d]);i.useLayoutEffect(()=>{if(n&&!r){const s=JSON.parse(localStorage.getItem("orders")||"{}");s[n]&&d(`/orders/${n}/${s[n].fullAccessToken}`)}},[n,r,d]),i.useEffect(()=>{n&&A(n,r,!0);const s=setInterval(()=>{n&&A(n,r,!0)},5e3);return()=>{clearInterval(s)}},[n,r,A]);const G=i.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===o.OrderStatus.Completed||e.status===o.OrderStatus.PartiallyDelivered||e.status===o.OrderStatus.FullDeliveryFailure)),[e]),M=i.useMemo(()=>{var s;return!!((s=c==null?void 0:c.info)!=null&&s.isVouchesEnabled&&r)},[(B=c==null?void 0:c.info)==null?void 0:B.isVouchesEnabled,r]),z=i.useMemo(()=>{var s;return!!(!((s=c==null?void 0:c.info)!=null&&s.isVouchesEnabled)&&(e!=null&&e.review)&&"accessToken"in e.review&&!u)},[(F=c==null?void 0:c.info)==null?void 0:F.isVouchesEnabled,e==null?void 0:e.review,u]),H=i.useMemo(()=>{var s;return((s=c==null?void 0:c.info)==null?void 0:s.domain)||window.location.hostname},[(V=c==null?void 0:c.info)==null?void 0:V.domain]);return v?t.jsx("div",{className:a.loaderContainer,children:t.jsx(_.Loader,{})}):t.jsxs("div",{className:a.orderPage,children:[t.jsx("div",{className:a.leftSection,children:t.jsxs("div",{className:a.content,children:[t.jsx(o.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${a.main} ${u?a.mainAntistock:""}`,children:[t.jsx(o.OrderStatusBlock,{className:a.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${a.orderMainData} ${u?a.orderMainDataAntistock:""}`,children:[M&&t.jsx(o.VouchCard,{onAddMessage:()=>m(!0),isSubmitted:S}),t.jsx(o.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:($=e.charge)==null?void 0:$.gateway,email:e.customer?e.customer.email:((T=e.charge)==null?void 0:T.customerForCharge.email)||"",orderId:e.id}),z&&e.review&&t.jsx(o.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(o.TrackPayment,{className:`${a.timelineBlock} ${u?a.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(o.CheckoutFooter,{className:`${a.footer} ${u?a.footerAntistock:""}`})]})]})}),t.jsx("div",{className:a.rightSection,style:u?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:a.content,children:[((q=e==null?void 0:e.charge)==null?void 0:q.name)&&t.jsxs("header",{className:a.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:a.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:a.headerDescription,children:e.charge.description})]}),u?null:t.jsxs(_.Button,{type:"Secondary",onClick:()=>N((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(_.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:a.productList,children:P.map(s=>t.jsx(o.CheckoutProduct,{product:s,isOrder:!0,isApplicableForReplacement:G,orderId:n,accessToken:r,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},s.id))}),u?null:t.jsx(o.CheckoutPrices,{formatter:D,coupon:null,total:((L=e==null?void 0:e.endPrice)==null?void 0:L.amount)||0,discount:0,totalWithDiscount:((E=e==null?void 0:e.endPrice)==null?void 0:E.amount)||0,className:a.prices,isShowSubtotal:!1}),t.jsx(o.CheckoutFooter,{className:a.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(Ce,{isOpen:C,onClose:()=>l(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency}),M&&t.jsx(o.VouchModal,{isOpen:j,onClose:()=>m(!1),products:P,orderId:n,accessToken:r,shopDomain:H,onSuccess:()=>{w(!0),m(!1),n&&A(n,r,!0)}})]})},ve=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:je},Symbol.toStringTag,{value:"Module"}));exports.Orders=Y;exports.index=ve;
@@ -107,9 +107,16 @@ export interface Category {
107
107
  name: string;
108
108
  listingIdList: number[];
109
109
  }
110
+ export interface Vouch {
111
+ id: number;
112
+ message: string;
113
+ imageUrl: string;
114
+ productNames: string[];
115
+ }
110
116
  export interface PageContext {
111
117
  listings: Listing[] | null;
112
118
  products: Product[] | null;
119
+ vouches: Vouch[] | null;
113
120
  reviews: any;
114
121
  categories: Category[] | null;
115
122
  faqs: Faq[] | null;
@@ -12,6 +12,7 @@ export interface Listing extends ItemBase {
12
12
  }
13
13
  export type TypeValues = {
14
14
  CategoryId: number[];
15
+ VouchId: number[];
15
16
  ProductId: number[];
16
17
  ListingIds: {
17
18
  listingId: number;
@@ -11,4 +11,7 @@ export declare function fetchAllData(): Promise<{
11
11
  posts: PromiseSettledResult<{
12
12
  data: null;
13
13
  }>;
14
+ vouches: PromiseSettledResult<{
15
+ data: null;
16
+ }>;
14
17
  }>;