@billgangcom/theme-lib 1.116.6 → 1.116.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{builder-BY0Rb4M2.js → builder-CZXu5Hac.js} +5 -5
- package/dist/{builder-DNBb55cK.cjs → builder-DjAWZsWX.cjs} +2 -2
- package/dist/{builder-components-WhQZRsjh.cjs → builder-components-Cs3Kd5Fp.cjs} +1 -1
- package/dist/{builder-components-D32G52II.js → builder-components-DYJCevXV.js} +4 -4
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +22 -22
- package/dist/{charge-D3WaQExC.js → charge-BO33PRmH.js} +3392 -3390
- package/dist/{charge-DJ2ABv8r.cjs → charge-CbGV61dW.cjs} +35 -35
- package/dist/{checkout-BkjjdfgB.js → checkout-BHws_JKB.js} +5 -5
- package/dist/{checkout-PIqkSEIk.cjs → checkout-BMr1ltyW.cjs} +1 -1
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-B1V3clXn.cjs → index-BpETNor-.cjs} +1 -1
- package/dist/{index-CKAcAIMo.js → index-C23sLqTE.js} +5 -5
- package/dist/{index-N6L5jr8R.js → index-CmFApHUc.js} +5 -5
- package/dist/{index-CZwDjcie.cjs → index-D0GkszCa.cjs} +1 -1
- package/dist/{index-fGPfT0MO.cjs → index-D9Pj1vKe.cjs} +1 -1
- package/dist/{index-DhcgCjK9.js → index-DOlYOPkO.js} +5 -5
- package/dist/{index-BBJrDob_.cjs → index-DTWBap2Z.cjs} +1 -1
- package/dist/{index-CnZNMIvU.js → index-DVr6y1N6.js} +5 -5
- package/dist/{index-se0I6Nit.js → index-_p2-YMlC.js} +1 -1
- package/dist/{index-D4lM8Gps.cjs → index-jWgMpgga.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/order-BWjIxR9H.cjs +1 -0
- package/dist/order-CRherMAs.js +356 -0
- package/dist/src/storefront/components/VouchCard/index.d.ts +1 -1
- package/dist/src/storefront/models/order.d.ts +1 -0
- package/dist/{subscription-B5Vchjn4.cjs → subscription-BXxBl9fr.cjs} +1 -1
- package/dist/{subscription-CPqQio-m.js → subscription-NWrEJGZq.js} +5 -5
- package/dist/{ticket-GT08dLcM.cjs → ticket-CC5fRwuL.cjs} +1 -1
- package/dist/{ticket-BpOEfhzk.js → ticket-L3tJ9ftw.js} +5 -5
- package/dist/{top-up-B38JX-i2.cjs → top-up-9EYY5Qos.cjs} +1 -1
- package/dist/{top-up-BPsY5Ko7.js → top-up-Dby7Plbm.js} +5 -5
- package/dist/{ui-components-DHcXCOwO.js → ui-components-C1eixdPN.js} +4 -4
- package/dist/{ui-components-aBWzEy56.cjs → ui-components-xoMojTNf.cjs} +1 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-DC0bsag2.cjs → validation-B8Rt08hM.cjs} +1 -1
- package/dist/{validation-wvd0-hht.js → validation-Dj02XiYC.js} +5 -5
- package/package.json +1 -1
- package/dist/order-CIkGoDRC.js +0 -356
- package/dist/order-DbUM9KTX.cjs +0 -1
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ui-components-xoMojTNf.cjs");exports.Accordion=t.Accordion;exports.AlignText=t.AlignText;exports.BurgerMenuButton=t.BurgerMenuButton;exports.Button=t.Button;exports.ButtonSettings=t.ButtonSettings;exports.ButtonTypeSettings=t.ButtonTypeSettings;exports.ButtonsSettings=t.ButtonsSettings;exports.CategorySettings=t.CategorySettings;exports.ChargeTypes=t.ChargeTypes;exports.Checkbox=t.Checkbox;exports.CheckboxSettings=t.CheckboxSettings;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ConfirmationModal=t.ConfirmationModal;exports.EmptyCart=t.EmptyCart;exports.ErrorableBlock=t.ErrorableBlock;exports.FormSettings=t.FormSettings;exports.GroupCardModal=t.GroupCardModal;exports.HeaderButtons=t.HeaderButtons;exports.Icon=t.Icon;exports.InputSettings=t.InputSettings;exports.InputUI=t.Input;exports.ItemsSettings=t.ItemsSettings;exports.LayoutSettings=t.LayoutSettings;exports.Link=t.Link;exports.ListingSelector=t.ListingSelector;exports.Loader=t.Loader;exports.LoaderBuilder=t.LoaderBuilder;exports.MetaInfoPost=t.MetaInfoPost;exports.Modal=t.Modal;exports.NotificationBuilder=t.NotificationBuilder;exports.PagesMobileMenu=t.PagesMobileMenu;exports.PagesMobileModal=t.PagesMobileModal;exports.PagesSettings=t.PagesSettings;exports.ProductCardButtons=t.ProductCardButtons;exports.ProductCardModal=t.ProductCardModal;exports.ProductOptions=t.ProductOptions;exports.RadioUI=t.Radio;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.SelectInfiniteList=t.SelectInfiniteList;exports.SelectTypeText=t.SelectTypeText;exports.SelectUI=t.Select;exports.ShareLink=t.ShareLink;exports.ShoppingButton=t.ShoppingButton;exports.ShoppingModalCart=t.ShoppingModalCart;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.TextareaSettings;exports.TextareaUI=t.Textarea;exports.Tip=t.Tip;exports.TypesText=t.TypesText;exports.UserInfo=t.UserInfo;exports.Wrapper=t.Wrapper;
|
package/dist/ui.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as t, A as e, Y as o, g as n, B as i, y as r, w as g, v as S, G as d, i as l, k as u, a5 as c, b as p, C as I, Q as B, E as C, F as M, a3 as T, J as h, I as x, c as y, f as L, t as P, q as f, $ as m, D as b, e as k, L as U, a1 as A, M as E, N as R, X as w, V as F, P as G, a0 as H, a2 as N, H as O, R as W, z as j, S as q, a6 as v, a4 as z, S as D, Z as J, K, O as Q, d as V, s as X, T as Y, j as Z, h as _, x as $, U as aa, W as sa } from "./ui-components-
|
|
1
|
+
import { _ as t, A as e, Y as o, g as n, B as i, y as r, w as g, v as S, G as d, i as l, k as u, a5 as c, b as p, C as I, Q as B, E as C, F as M, a3 as T, J as h, I as x, c as y, f as L, t as P, q as f, $ as m, D as b, e as k, L as U, a1 as A, M as E, N as R, X as w, V as F, P as G, a0 as H, a2 as N, H as O, R as W, z as j, S as q, a6 as v, a4 as z, S as D, Z as J, K, O as Q, d as V, s as X, T as Y, j as Z, h as _, x as $, U as aa, W as sa } from "./ui-components-C1eixdPN.js";
|
|
2
2
|
export {
|
|
3
3
|
t as Accordion,
|
|
4
4
|
e as AlignText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),g=require("./charge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),g=require("./charge-CbGV61dW.cjs"),d=require("./builder-DjAWZsWX.cjs"),u=require("./ui-components-xoMojTNf.cjs");require("./builder-components-Cs3Kd5Fp.cjs");require("./ticket-CC5fRwuL.cjs");require("react-dom");const j="_lock_1mxa7_1",b="_wrapper_1mxa7_12",I="_content_1mxa7_22",y="_info_1mxa7_31",N="_buttons_1mxa7_38",q="_button_1mxa7_38",k="_input_1mxa7_50",L="_error_1mxa7_57",s={lock:j,wrapper:b,content:I,info:y,buttons:N,button:q,input:k,error:L},V=()=>{const[f,n]=r.useState(!1),[h,w]=r.useState(!1),[c,P]=r.useState(""),{general:o,setGeneral:_}=d.useGeneralStore(),{setShopPassword:p}=d.useStorefrontStore(),i=d.useLocation(),m=d.useNavigate();r.useEffect(()=>{if(o&&(!o.info.passwordProtected||o.isPasswordValid)){const t=i.state.from==="/validation"?"/":i.state.from;m(t)}},[o]),r.useEffect(()=>{o||(async()=>{var x;n(!0);const l=localStorage.getItem("shopPassword")||"",a=await g.fetchGeneral(l);if(a.isPasswordValid){const S=((x=i.state)==null?void 0:x.from)||"/";m(S)}a.info.passwordProtected||(localStorage.removeItem("shopPassword"),p("")),_(a),n(!1)})()},[o]);async function v(){var l;n(!0);const t=await g.fetchGeneral(c);if(!t.isPasswordValid)w(!0);else{localStorage.setItem("shopPassword",c),p(c);const a=((l=i.state)==null?void 0:l.from)||"/";m(a),t.info.passwordProtected||(localStorage.removeItem("shopPassword"),p("")),_(t)}n(!1)}return e.jsxs("div",{className:s.wrapper,children:[!f&&e.jsxs("div",{className:s.content,children:[e.jsx("div",{className:s.lock,children:e.jsx(u.Icon,{name:"Lock",fill:"var(--text-secondary)",width:64,height:64})}),e.jsxs("div",{className:s.info,children:[e.jsx("h2",{id:"h2",className:s.title,children:"The store is password protected"}),e.jsx("p",{id:"p",className:s.description,children:"If you do not have a password, we recommend you to contact the technical support of the store or write to the mail"})]}),e.jsxs("div",{className:s.input,children:[e.jsx(u.Input,{type:"password",onChange:t=>{w(!1),P(t)},value:c,placeholder:"Password",required:!0}),e.jsx("span",{className:s.error,children:h&&"Incorrect password"})]}),e.jsx("div",{className:s.buttons,children:e.jsx(u.Button,{type:"Primary",className:s.button,disabled:h,onClick:v,children:"Submit"})})]}),f&&e.jsx(u.Loader,{})]})};exports.ValidationPage=V;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import { X as g } from "./charge-
|
|
4
|
-
import { V as I, M as b, ab as x, p as N } from "./builder-
|
|
5
|
-
import { I as y, f as k, g as L, e as V } from "./ui-components-
|
|
6
|
-
import "./builder-components-
|
|
7
|
-
import "./ticket-
|
|
3
|
+
import { X as g } from "./charge-BO33PRmH.js";
|
|
4
|
+
import { V as I, M as b, ab as x, p as N } from "./builder-CZXu5Hac.js";
|
|
5
|
+
import { I as y, f as k, g as L, e as V } from "./ui-components-C1eixdPN.js";
|
|
6
|
+
import "./builder-components-DYJCevXV.js";
|
|
7
|
+
import "./ticket-L3tJ9ftw.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const E = "_lock_1mxa7_1", G = "_wrapper_1mxa7_12", j = "_content_1mxa7_22", C = "_info_1mxa7_31", q = "_buttons_1mxa7_38", B = "_button_1mxa7_38", M = "_input_1mxa7_50", R = "_error_1mxa7_57", t = {
|
|
10
10
|
lock: E,
|
package/package.json
CHANGED
package/dist/order-CIkGoDRC.js
DELETED
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
import { jsx as o, Fragment as z, jsxs as r } from "react/jsx-runtime";
|
|
2
|
-
import i, { useState as ee, useMemo as M } from "react";
|
|
3
|
-
import { X as te, p as J, M as oe, V as X, a7 as ne } from "./builder-BY0Rb4M2.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-D3WaQExC.js";
|
|
5
|
-
import { M as ve, I as Y, g as V, e as Ce } from "./ui-components-DHcXCOwO.js";
|
|
6
|
-
import "./builder-components-D32G52II.js";
|
|
7
|
-
import "./ticket-BpOEfhzk.js";
|
|
8
|
-
import "react-dom";
|
|
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
|
-
l(!0);
|
|
13
|
-
const { list: y, totalCount: w } = await Ne(g);
|
|
14
|
-
c(y), N(w), e(null), l(!1);
|
|
15
|
-
}
|
|
16
|
-
async function m() {
|
|
17
|
-
const y = (n == null ? void 0 : n.map((b) => b.gatewayName)) || [], w = await re(y);
|
|
18
|
-
e(w);
|
|
19
|
-
}
|
|
20
|
-
return i.useEffect(() => {
|
|
21
|
-
!d && n && m();
|
|
22
|
-
}, [n, d]), i.useEffect(() => {
|
|
23
|
-
v();
|
|
24
|
-
}, [g]), /* @__PURE__ */ o(z, { children: n != null && n.length && n.length === 0 ? /* @__PURE__ */ o(
|
|
25
|
-
se,
|
|
26
|
-
{
|
|
27
|
-
title: "No Orders",
|
|
28
|
-
description: "When you purchase products from our website, you'll see a history of orders here."
|
|
29
|
-
}
|
|
30
|
-
) : /* @__PURE__ */ r(z, { children: [
|
|
31
|
-
/* @__PURE__ */ o(ce, { title: "Orders" }),
|
|
32
|
-
/* @__PURE__ */ o(
|
|
33
|
-
ie,
|
|
34
|
-
{
|
|
35
|
-
orders: n,
|
|
36
|
-
gatewaysDetail: d,
|
|
37
|
-
totalCount: _,
|
|
38
|
-
isLoading: k
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
] }) });
|
|
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", Ie = "_timelineBlockAntistock_gc87l_81", Me = "_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: Ie,
|
|
50
|
-
footerAntistock: Me,
|
|
51
|
-
statusBlock: Ve,
|
|
52
|
-
timelineBlock: Be,
|
|
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
|
-
isOpen: n,
|
|
73
|
-
onClose: c,
|
|
74
|
-
refundedAmount: d,
|
|
75
|
-
currency: e
|
|
76
|
-
}) => {
|
|
77
|
-
var D, O;
|
|
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
|
-
style: "currency",
|
|
80
|
-
currency: e
|
|
81
|
-
}), b = () => {
|
|
82
|
-
_(k ? "/account" : "/customer-dash");
|
|
83
|
-
}, u = async () => {
|
|
84
|
-
if (v && m) {
|
|
85
|
-
window.open(m);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
k ? window.open(`https://${g}/support`) : _("/contact");
|
|
89
|
-
}, s = () => {
|
|
90
|
-
c();
|
|
91
|
-
};
|
|
92
|
-
return n ? /* @__PURE__ */ o(ve, { close: c, children: /* @__PURE__ */ r(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
className: h.modalContent,
|
|
96
|
-
onClick: (A) => A.stopPropagation(),
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ o("div", { className: h.iconContainer, children: /* @__PURE__ */ o(
|
|
99
|
-
Y,
|
|
100
|
-
{
|
|
101
|
-
name: "WarningDiamond",
|
|
102
|
-
fill: "var(--text-warning)",
|
|
103
|
-
className: h.warningIcon
|
|
104
|
-
}
|
|
105
|
-
) }),
|
|
106
|
-
/* @__PURE__ */ o("h2", { className: h.title, children: "Partial Delivery Failure Refund" }),
|
|
107
|
-
/* @__PURE__ */ r("p", { className: h.description, children: [
|
|
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
|
-
" ",
|
|
110
|
-
w.format(d),
|
|
111
|
-
", to your account balance."
|
|
112
|
-
] }),
|
|
113
|
-
/* @__PURE__ */ r("div", { className: h.buttonContainer, children: [
|
|
114
|
-
!N && /* @__PURE__ */ o(
|
|
115
|
-
V,
|
|
116
|
-
{
|
|
117
|
-
type: "Secondary",
|
|
118
|
-
onClick: b,
|
|
119
|
-
className: h.button,
|
|
120
|
-
children: "Login"
|
|
121
|
-
}
|
|
122
|
-
),
|
|
123
|
-
y && /* @__PURE__ */ o(
|
|
124
|
-
V,
|
|
125
|
-
{
|
|
126
|
-
type: "Secondary",
|
|
127
|
-
onClick: u,
|
|
128
|
-
className: h.button,
|
|
129
|
-
children: "Contact Support"
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
/* @__PURE__ */ o(
|
|
133
|
-
V,
|
|
134
|
-
{
|
|
135
|
-
type: "Primary",
|
|
136
|
-
onClick: s,
|
|
137
|
-
className: h.button,
|
|
138
|
-
children: "Continue"
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
] })
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
) }) : null;
|
|
145
|
-
}, Ze = () => {
|
|
146
|
-
var $, F, T, L, E, W, x, q, U;
|
|
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
|
-
style: "currency",
|
|
149
|
-
currency: D
|
|
150
|
-
}), A = i.useMemo(() => (e == null ? void 0 : e.partOrders.map((t) => {
|
|
151
|
-
var P, I, S;
|
|
152
|
-
return {
|
|
153
|
-
id: Number((P = t.productWithVariant) == null ? void 0 : P.id) || 0,
|
|
154
|
-
partOrderId: Number(t == null ? void 0 : t.id) || 0,
|
|
155
|
-
image: t.productWithVariant.image,
|
|
156
|
-
name: (() => {
|
|
157
|
-
var j, G;
|
|
158
|
-
const p = ((j = t.productWithVariant) == null ? void 0 : j.name) || "", f = ((G = t.productWithVariant) == null ? void 0 : G.variantName) || "";
|
|
159
|
-
return !p && !f ? "" : !f || p === f ? p : p ? `${p} (${f})` : f;
|
|
160
|
-
})(),
|
|
161
|
-
description: "",
|
|
162
|
-
price: {
|
|
163
|
-
quantity: t.quantity,
|
|
164
|
-
amount: ((I = t.productWithVariant) == null ? void 0 : I.price.amount) || 0,
|
|
165
|
-
currency: (S = t.productWithVariant) == null ? void 0 : S.price.currency
|
|
166
|
-
},
|
|
167
|
-
deliveryCategories: "deliveryCategories" in t ? t.deliveryCategories : void 0,
|
|
168
|
-
customerNote: t.customerNote,
|
|
169
|
-
chargeType: t.chargeType || "ONE_TIME",
|
|
170
|
-
replacementRequests: "replacementRequests" in t ? t.replacementRequests : void 0,
|
|
171
|
-
allowedReplacementReasons: "allowedReplacementReasons" in t ? t.allowedReplacementReasons : void 0
|
|
172
|
-
};
|
|
173
|
-
})) || [], [e]);
|
|
174
|
-
i.useEffect(() => {
|
|
175
|
-
e && (e.status === C.FullDeliveryFailure || e.status === C.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && l(!0);
|
|
176
|
-
}, [e == null ? void 0 : e.status]);
|
|
177
|
-
const R = i.useCallback(async (t, P, I = !1) => {
|
|
178
|
-
var p, f;
|
|
179
|
-
I || g(!0);
|
|
180
|
-
const { data: S } = await (P ? ue(`${t}/${P}`) : de(t));
|
|
181
|
-
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}`, {
|
|
182
|
-
replace: !0
|
|
183
|
-
}), _(S);
|
|
184
|
-
}, [d]);
|
|
185
|
-
i.useLayoutEffect(() => {
|
|
186
|
-
if (n && !c) {
|
|
187
|
-
const t = JSON.parse(localStorage.getItem("orders") || "{}");
|
|
188
|
-
t[n] && d(`/orders/${n}/${t[n].fullAccessToken}`);
|
|
189
|
-
}
|
|
190
|
-
}, [n, c, d]), i.useEffect(() => {
|
|
191
|
-
n && R(n, c, !0);
|
|
192
|
-
const t = setInterval(() => {
|
|
193
|
-
n && R(n, c, !0);
|
|
194
|
-
}, 5e3);
|
|
195
|
-
return () => {
|
|
196
|
-
clearInterval(t);
|
|
197
|
-
};
|
|
198
|
-
}, [n, c, R]);
|
|
199
|
-
const K = M(() => !!(e != null && e.isApplicableForReplacement && (e.status === C.Completed || e.status === C.PartiallyDelivered || e.status === C.FullDeliveryFailure)), [e]), B = M(() => {
|
|
200
|
-
var t;
|
|
201
|
-
return !!((t = s == null ? void 0 : s.info) != null && t.isVouchesEnabled && c);
|
|
202
|
-
}, [(F = s == null ? void 0 : s.info) == null ? void 0 : F.isVouchesEnabled, c]), Q = M(() => {
|
|
203
|
-
var t;
|
|
204
|
-
return !!(!((t = s == null ? void 0 : s.info) != null && t.isVouchesEnabled) && (e != null && e.review) && "accessToken" in e.review && !u);
|
|
205
|
-
}, [(T = s == null ? void 0 : s.info) == null ? void 0 : T.isVouchesEnabled, e == null ? void 0 : e.review, u]), Z = M(() => {
|
|
206
|
-
var t;
|
|
207
|
-
return ((t = s == null ? void 0 : s.info) == null ? void 0 : t.domain) || window.location.hostname;
|
|
208
|
-
}, [(L = s == null ? void 0 : s.info) == null ? void 0 : L.domain]);
|
|
209
|
-
return N ? /* @__PURE__ */ o("div", { className: a.loaderContainer, children: /* @__PURE__ */ o(Ce, {}) }) : /* @__PURE__ */ r("div", { className: a.orderPage, children: [
|
|
210
|
-
/* @__PURE__ */ o("div", { className: a.leftSection, children: /* @__PURE__ */ r("div", { className: a.content, children: [
|
|
211
|
-
/* @__PURE__ */ o(he, {}),
|
|
212
|
-
e && /* @__PURE__ */ r("div", { className: `${a.main} ${u ? a.mainAntistock : ""}`, children: [
|
|
213
|
-
/* @__PURE__ */ o(
|
|
214
|
-
pe,
|
|
215
|
-
{
|
|
216
|
-
className: a.statusBlock,
|
|
217
|
-
orderStatus: e.status
|
|
218
|
-
}
|
|
219
|
-
),
|
|
220
|
-
/* @__PURE__ */ r(
|
|
221
|
-
"div",
|
|
222
|
-
{
|
|
223
|
-
className: `${a.orderMainData} ${u ? a.orderMainDataAntistock : ""}`,
|
|
224
|
-
children: [
|
|
225
|
-
B && /* @__PURE__ */ o(
|
|
226
|
-
fe,
|
|
227
|
-
{
|
|
228
|
-
onAddMessage: () => m(!0),
|
|
229
|
-
isSubmitted: y
|
|
230
|
-
}
|
|
231
|
-
),
|
|
232
|
-
/* @__PURE__ */ o(
|
|
233
|
-
_e,
|
|
234
|
-
{
|
|
235
|
-
lastUpdate: e.createdAt,
|
|
236
|
-
paymentType: (E = e.charge) == null ? void 0 : E.gateway,
|
|
237
|
-
email: e.customer ? e.customer.email : ((W = e.charge) == null ? void 0 : W.customerForCharge.email) || "",
|
|
238
|
-
orderId: e.id
|
|
239
|
-
}
|
|
240
|
-
),
|
|
241
|
-
Q && e.review && /* @__PURE__ */ o(
|
|
242
|
-
ge,
|
|
243
|
-
{
|
|
244
|
-
orderId: e.id,
|
|
245
|
-
review: e.review
|
|
246
|
-
}
|
|
247
|
-
)
|
|
248
|
-
]
|
|
249
|
-
}
|
|
250
|
-
),
|
|
251
|
-
e.charge && e.charge.timeline && /* @__PURE__ */ o(
|
|
252
|
-
ye,
|
|
253
|
-
{
|
|
254
|
-
className: `${a.timelineBlock} ${u ? a.timelineBlockAntistock : ""}`,
|
|
255
|
-
timeline: e.charge.timeline
|
|
256
|
-
}
|
|
257
|
-
),
|
|
258
|
-
/* @__PURE__ */ o(
|
|
259
|
-
H,
|
|
260
|
-
{
|
|
261
|
-
className: `${a.footer} ${u ? a.footerAntistock : ""}`
|
|
262
|
-
}
|
|
263
|
-
)
|
|
264
|
-
] })
|
|
265
|
-
] }) }),
|
|
266
|
-
/* @__PURE__ */ o(
|
|
267
|
-
"div",
|
|
268
|
-
{
|
|
269
|
-
className: a.rightSection,
|
|
270
|
-
style: u ? { borderLeft: "1px solid var(--border-secondary)" } : void 0,
|
|
271
|
-
children: /* @__PURE__ */ r("div", { className: a.content, children: [
|
|
272
|
-
((x = e == null ? void 0 : e.charge) == null ? void 0 : x.name) && /* @__PURE__ */ r("header", { className: a.header, children: [
|
|
273
|
-
/* @__PURE__ */ r("div", { children: [
|
|
274
|
-
/* @__PURE__ */ o("h1", { className: a.headerTitle, children: e.charge.name }),
|
|
275
|
-
e.charge.description && /* @__PURE__ */ o("p", { className: a.headerDescription, children: e.charge.description })
|
|
276
|
-
] }),
|
|
277
|
-
u ? null : /* @__PURE__ */ r(
|
|
278
|
-
V,
|
|
279
|
-
{
|
|
280
|
-
type: "Secondary",
|
|
281
|
-
onClick: () => b((e == null ? void 0 : e.id) || ""),
|
|
282
|
-
style: {
|
|
283
|
-
whiteSpace: "nowrap",
|
|
284
|
-
display: "flex",
|
|
285
|
-
alignItems: "center",
|
|
286
|
-
gap: "4px"
|
|
287
|
-
},
|
|
288
|
-
children: [
|
|
289
|
-
/* @__PURE__ */ o(Y, { name: "Copy" }),
|
|
290
|
-
/* @__PURE__ */ o("span", { children: "Copy ID" })
|
|
291
|
-
]
|
|
292
|
-
}
|
|
293
|
-
)
|
|
294
|
-
] }),
|
|
295
|
-
/* @__PURE__ */ r("div", { children: [
|
|
296
|
-
/* @__PURE__ */ o("div", { className: a.productList, children: A.map((t) => /* @__PURE__ */ o(
|
|
297
|
-
we,
|
|
298
|
-
{
|
|
299
|
-
product: t,
|
|
300
|
-
isOrder: !0,
|
|
301
|
-
isApplicableForReplacement: K,
|
|
302
|
-
orderId: n,
|
|
303
|
-
accessToken: c,
|
|
304
|
-
allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
|
|
305
|
-
},
|
|
306
|
-
t.id
|
|
307
|
-
)) }),
|
|
308
|
-
u ? null : /* @__PURE__ */ o(
|
|
309
|
-
Se,
|
|
310
|
-
{
|
|
311
|
-
formatter: O,
|
|
312
|
-
coupon: null,
|
|
313
|
-
total: ((q = e == null ? void 0 : e.endPrice) == null ? void 0 : q.amount) || 0,
|
|
314
|
-
discount: 0,
|
|
315
|
-
totalWithDiscount: ((U = e == null ? void 0 : e.endPrice) == null ? void 0 : U.amount) || 0,
|
|
316
|
-
className: a.prices,
|
|
317
|
-
isShowSubtotal: !1
|
|
318
|
-
}
|
|
319
|
-
),
|
|
320
|
-
/* @__PURE__ */ o(H, { className: a.mobileFooter })
|
|
321
|
-
] })
|
|
322
|
-
] })
|
|
323
|
-
}
|
|
324
|
-
),
|
|
325
|
-
(e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ o(
|
|
326
|
-
Qe,
|
|
327
|
-
{
|
|
328
|
-
isOpen: k,
|
|
329
|
-
onClose: () => l(!1),
|
|
330
|
-
refundedAmount: e.refundedPrice.amount,
|
|
331
|
-
currency: e.refundedPrice.currency
|
|
332
|
-
}
|
|
333
|
-
),
|
|
334
|
-
B && /* @__PURE__ */ o(
|
|
335
|
-
ke,
|
|
336
|
-
{
|
|
337
|
-
isOpen: v,
|
|
338
|
-
onClose: () => m(!1),
|
|
339
|
-
products: A,
|
|
340
|
-
orderId: n,
|
|
341
|
-
accessToken: c,
|
|
342
|
-
shopDomain: Z,
|
|
343
|
-
onSuccess: () => {
|
|
344
|
-
w(!0), m(!1), n && R(n, c, !0);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
)
|
|
348
|
-
] });
|
|
349
|
-
}, lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
350
|
-
__proto__: null,
|
|
351
|
-
OrderPage: Ze
|
|
352
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
353
|
-
export {
|
|
354
|
-
rt as O,
|
|
355
|
-
lt as i
|
|
356
|
-
};
|
package/dist/order-DbUM9KTX.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),i=require("react"),k=require("./builder-DNBb55cK.cjs"),o=require("./charge-DJ2ABv8r.cjs"),_=require("./ui-components-aBWzEy56.cjs");require("./builder-components-WhQZRsjh.cjs");require("./ticket-GT08dLcM.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,partOrderId:Number(s==null?void 0:s.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;
|