@billgangcom/theme-lib 1.115.0 → 1.116.1
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-CVbCKY8a.js → builder-DUFJOYbB.js} +5 -5
- package/dist/{builder-Iu70o8Zi.cjs → builder-DqDtctC5.cjs} +2 -2
- package/dist/{builder-components-3ULrMVTv.cjs → builder-components-D3Bb10J8.cjs} +1 -1
- package/dist/{builder-components-BuaB_nik.js → builder-components-DzvQc6D4.js} +4 -4
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +34 -34
- package/dist/{charge-pzp63q8N.cjs → charge-I1l9O9oW.cjs} +41 -41
- package/dist/{charge-CqeINukp.js → charge-JAW-QeMZ.js} +8233 -7844
- package/dist/{checkout-YVutPZ7f.js → checkout-BvcF30gE.js} +5 -5
- package/dist/{checkout-B98fqO6J.cjs → checkout-CwhyZ4zD.cjs} +1 -1
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +7 -7
- package/dist/{index-CiY9zOlN.js → index-BGpMbUmG.js} +1 -1
- package/dist/{index-BV4ZiotJ.cjs → index-Bfh9GkFs.cjs} +1 -1
- package/dist/{index-D50xf07C.cjs → index-BsM2kPyQ.cjs} +1 -1
- package/dist/{index-D0izKDtJ.cjs → index-Cdm3FwGu.cjs} +1 -1
- package/dist/{index-C32vke_m.js → index-CyaRCiT9.js} +5 -5
- package/dist/{index-BUlydTOo.js → index-DcWpxbHI.js} +5 -5
- package/dist/{index-Ck3jvxGA.cjs → index-DjnhbFh9.cjs} +1 -1
- package/dist/{index-dHSb9Tg9.js → index-EjVO3qce.js} +5 -5
- package/dist/{index-B3WK0Wpu.js → index-bsPNagUY.js} +8 -8
- package/dist/{index-Lf_IZiQr.cjs → index-dp4B_uob.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +14 -14
- package/dist/order-BLPHbRzn.js +355 -0
- package/dist/order-DN9oIA9o.cjs +1 -0
- package/dist/src/storefront/api/index.d.ts +1 -0
- package/dist/src/storefront/api/vouches.d.ts +7 -0
- package/dist/src/storefront/components/VouchCard/index.d.ts +7 -0
- package/dist/src/storefront/components/VouchModal/index.d.ts +12 -0
- package/dist/src/storefront/components/index.d.ts +2 -0
- package/dist/src/storefront/models/shop.d.ts +1 -0
- package/dist/src/ui/Checkbox/index.d.ts +1 -0
- package/dist/src/ui/Textarea/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{subscription-D9tguRYG.js → subscription-D0TYbXFf.js} +5 -5
- package/dist/{subscription-4CHOOBkd.cjs → subscription-r7qA65EX.cjs} +1 -1
- package/dist/{ticket-BODLy8iD.js → ticket--uOANXoZ.js} +5 -5
- package/dist/{ticket-BKgdPBSh.cjs → ticket-BivnxhDp.cjs} +1 -1
- package/dist/{top-up-DR4KDupr.cjs → top-up-C13wralR.cjs} +1 -1
- package/dist/{top-up-BxIXamXN.js → top-up-u1oUf64a.js} +8 -8
- package/dist/ui-components-CC9DRvrZ.cjs +1 -0
- package/dist/{ui-components-B2XdfTmJ.js → ui-components-CqwUR9GH.js} +978 -968
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-B_jzusSg.cjs → validation-BtrRWzoi.cjs} +1 -1
- package/dist/{validation-BusGxggf.js → validation-ekksqWOd.js} +9 -9
- package/package.json +1 -1
- package/dist/order-C0KsOrOK.cjs +0 -1
- package/dist/order-D4daxyzU.js +0 -325
- package/dist/ui-components-DnGzB9kA.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-CC9DRvrZ.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-CqwUR9GH.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-I1l9O9oW.cjs"),d=require("./builder-DqDtctC5.cjs"),u=require("./ui-components-CC9DRvrZ.cjs");require("./builder-components-D3Bb10J8.cjs");require("./ticket-BivnxhDp.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 {
|
|
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
|
|
6
|
-
import "./builder-components-
|
|
7
|
-
import "./ticket
|
|
3
|
+
import { X as g } from "./charge-JAW-QeMZ.js";
|
|
4
|
+
import { V as I, M as b, ab as x, p as N } from "./builder-DUFJOYbB.js";
|
|
5
|
+
import { I as y, f as k, g as L, e as V } from "./ui-components-CqwUR9GH.js";
|
|
6
|
+
import "./builder-components-DzvQc6D4.js";
|
|
7
|
+
import "./ticket--uOANXoZ.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,
|
|
@@ -15,7 +15,7 @@ const E = "_lock_1mxa7_1", G = "_wrapper_1mxa7_12", j = "_content_1mxa7_22", C =
|
|
|
15
15
|
button: B,
|
|
16
16
|
input: M,
|
|
17
17
|
error: R
|
|
18
|
-
},
|
|
18
|
+
}, K = () => {
|
|
19
19
|
const [f, n] = r.useState(!1), [u, h] = r.useState(!1), [c, P] = r.useState(""), { general: e, setGeneral: w } = I(), { setShopPassword: p } = b(), i = x(), m = N();
|
|
20
20
|
r.useEffect(() => {
|
|
21
21
|
if (e && (!e.info.passwordProtected || e.isPasswordValid)) {
|
|
@@ -92,7 +92,7 @@ const E = "_lock_1mxa7_1", G = "_wrapper_1mxa7_12", j = "_content_1mxa7_22", C =
|
|
|
92
92
|
/* @__PURE__ */ o("span", { className: t.error, children: u && "Incorrect password" })
|
|
93
93
|
] }),
|
|
94
94
|
/* @__PURE__ */ o("div", { className: t.buttons, children: /* @__PURE__ */ o(
|
|
95
|
-
|
|
95
|
+
L,
|
|
96
96
|
{
|
|
97
97
|
type: "Primary",
|
|
98
98
|
className: t.button,
|
|
@@ -102,9 +102,9 @@ const E = "_lock_1mxa7_1", G = "_wrapper_1mxa7_12", j = "_content_1mxa7_22", C =
|
|
|
102
102
|
}
|
|
103
103
|
) })
|
|
104
104
|
] }),
|
|
105
|
-
f && /* @__PURE__ */ o(
|
|
105
|
+
f && /* @__PURE__ */ o(V, {})
|
|
106
106
|
] });
|
|
107
107
|
};
|
|
108
108
|
export {
|
|
109
|
-
|
|
109
|
+
K as ValidationPage
|
|
110
110
|
};
|
package/package.json
CHANGED
package/dist/order-C0KsOrOK.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),r=require("react"),x=require("./builder-Iu70o8Zi.cjs"),o=require("./charge-pzp63q8N.cjs"),p=require("./ui-components-DnGzB9kA.cjs");require("./builder-components-3ULrMVTv.cjs");require("./ticket-BKgdPBSh.cjs");require("react-dom");const M=async(s=1)=>await o.fetchOrders({PageNumber:s}),$=()=>{const[s,l]=r.useState(null),[m,e]=r.useState(null),[g,j]=r.useState(0),{page:_}=x.usePaginationPagesStore(),[S,i]=r.useState(!0);async function k(){i(!0);const{list:f,totalCount:y}=await M(_);l(f),j(y),e(null),i(!1)}async function c(){const f=(s==null?void 0:s.map(C=>C.gatewayName))||[],y=await o.getGatewaysDetail(f);e(y)}return r.useEffect(()=>{!m&&s&&c()},[s,m]),r.useEffect(()=>{k()},[_]),t.jsx(t.Fragment,{children:s!=null&&s.length&&s.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:s,gatewaysDetail:m,totalCount:g,isLoading:S})]})})},T="_orderPage_gc87l_1",q="_leftSection_gc87l_15",L="_content_gc87l_35",W="_main_gc87l_42",E="_mainAntistock_gc87l_56",U="_orderMainDataAntistock_gc87l_69",G="_timelineBlockAntistock_gc87l_81",V="_footerAntistock_gc87l_92",z="_statusBlock_gc87l_104",H="_timelineBlock_gc87l_81",J="_footer_gc87l_92",Y="_rightSection_gc87l_121",K="_header_gc87l_142",Q="_productList_gc87l_150",X="_mobileFooter_gc87l_157",Z="_loaderContainer_gc87l_166",ee="_orderMainData_gc87l_69",te="_prices_gc87l_181",ne="_headerTitle_gc87l_185",se="_headerDescription_gc87l_189",a={orderPage:T,leftSection:q,content:L,main:W,mainAntistock:E,orderMainDataAntistock:U,timelineBlockAntistock:G,footerAntistock:V,statusBlock:z,timelineBlock:H,footer:J,rightSection:Y,header:K,productList:Q,mobileFooter:X,loaderContainer:Z,orderMainData:ee,prices:te,headerTitle:ne,headerDescription:se},oe="_modalContent_1a05n_1",ae="_iconContainer_1a05n_16",ce="_warningIcon_1a05n_20",re="_title_1a05n_25",ie="_description_1a05n_33",le="_buttonContainer_1a05n_40",ue="_button_1a05n_40",d={modalContent:oe,iconContainer:ae,warningIcon:ce,title:re,description:ie,buttonContainer:le,button:ue},de=({isOpen:s,onClose:l,refundedAmount:m,currency:e})=>{var w,v;const g=x.useNavigate(),{token:j,shopDomain:_}=x.useStorefrontStore(),{isAntistock:S,general:i}=x.useGeneralStore(),k=!!((w=i==null?void 0:i.info)!=null&&w.disableSupport),c=(v=i==null?void 0:i.info)==null?void 0:v.thirdPartySupportUrl,f=!(k&&!c),y=new Intl.NumberFormat("en-US",{style:"currency",currency:e}),C=()=>{g(S?"/account":"/customer-dash")},O=async()=>{if(k&&c){window.open(c);return}S?window.open(`https://${_}/support`):g("/contact")},A=()=>{l()};return s?t.jsx(p.Modal,{close:l,children:t.jsxs("div",{className:d.modalContent,onClick:P=>P.stopPropagation(),children:[t.jsx("div",{className:d.iconContainer,children:t.jsx(p.Icon,{name:"WarningDiamond",fill:"var(--text-warning)",className:d.warningIcon})}),t.jsx("h2",{className:d.title,children:"Partial Delivery Failure Refund"}),t.jsxs("p",{className:d.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"," ",y.format(m),", to your account balance."]}),t.jsxs("div",{className:d.buttonContainer,children:[!j&&t.jsx(p.Button,{type:"Secondary",onClick:C,className:d.button,children:"Login"}),f&&t.jsx(p.Button,{type:"Secondary",onClick:O,className:d.button,children:"Contact Support"}),t.jsx(p.Button,{type:"Primary",onClick:A,className:d.button,children:"Continue"})]})]})}):null},me=()=>{var w,v,P,R,B,I;const{id:s,accessToken:l}=x.useParams(),m=x.useNavigate(),[e,g]=r.useState(),[j,_]=r.useState(!1),[S,i]=r.useState(!1),k=o.useCopy(),{isAntistock:c}=x.useGeneralStore(),f=((w=e==null?void 0:e.rawPrice)==null?void 0:w.currency)||"USD",y=new Intl.NumberFormat("en-US",{style:"currency",currency:f}),C=r.useMemo(()=>(e==null?void 0:e.partOrders.map(n=>{var N,D;return{id:(n==null?void 0:n.id)||0,image:n.productWithVariant.image,name:(()=>{var b,F;const u=((b=n.productWithVariant)==null?void 0:b.name)||"",h=((F=n.productWithVariant)==null?void 0:F.variantName)||"";return!u&&!h?"":!h||u===h?u:u?`${u} (${h})`:h})(),description:"",price:{quantity:n.quantity,amount:((N=n.productWithVariant)==null?void 0:N.price.amount)||0,currency:(D=n.productWithVariant)==null?void 0:D.price.currency},deliveryCategories:"deliveryCategories"in n?n.deliveryCategories:void 0,customerNote:n.customerNote,chargeType:n.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in n?n.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in n?n.allowedReplacementReasons:void 0}}))||[],[e]);r.useEffect(()=>{e&&(e.status===o.OrderStatus.FullDeliveryFailure||e.status===o.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&i(!0)},[e==null?void 0:e.status]);const O=async(n,N,D=!1)=>{var h,b;D||_(!0);const{data:u}=await(N?o.fetchAuthorizedOrder(`${n}/${N}`):o.fetchOrder(n));_(!1),u.status!==o.OrderStatus.Completed&&((h=u.charge)==null?void 0:h.status)===o.ChargeStatus.NotPaid&&m(`/charges/${(b=u.charge)==null?void 0:b.id}`,{replace:!0}),g(u)};r.useLayoutEffect(()=>{if(s&&!l){const n=JSON.parse(localStorage.getItem("orders")||"{}");n[s]&&m(`/orders/${s}/${n[s].fullAccessToken}`)}},[s]),r.useEffect(()=>{s&&O(s,l,!0);const n=setInterval(()=>{s&&O(s,l,!0)},5e3);return()=>{clearInterval(n)}},[s,l]);const A=r.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===o.OrderStatus.Completed||e.status===o.OrderStatus.PartiallyDelivered||e.status===o.OrderStatus.FullDeliveryFailure)),[e]);return j?t.jsx("div",{className:a.loaderContainer,children:t.jsx(p.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} ${c?a.mainAntistock:""}`,children:[t.jsx(o.OrderStatusBlock,{className:a.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${a.orderMainData} ${c?a.orderMainDataAntistock:""}`,children:[t.jsx(o.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(v=e.charge)==null?void 0:v.gateway,email:e.customer?e.customer.email:((P=e.charge)==null?void 0:P.customerForCharge.email)||"",orderId:e.id}),"accessToken"in e.review&&!c&&t.jsx(o.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(o.TrackPayment,{className:`${a.timelineBlock} ${c?a.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(o.CheckoutFooter,{className:`${a.footer} ${c?a.footerAntistock:""}`})]})]})}),t.jsx("div",{className:a.rightSection,style:c?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:a.content,children:[((R=e==null?void 0:e.charge)==null?void 0:R.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})]}),c?null:t.jsxs(p.Button,{type:"Secondary",onClick:()=>k((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(p.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:a.productList,children:C.map(n=>t.jsx(o.CheckoutProduct,{product:n,isOrder:!0,isApplicableForReplacement:A,orderId:s,accessToken:l,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},n.id))}),c?null:t.jsx(o.CheckoutPrices,{formatter:y,coupon:null,total:((B=e==null?void 0:e.endPrice)==null?void 0:B.amount)||0,discount:0,totalWithDiscount:((I=e==null?void 0:e.endPrice)==null?void 0:I.amount)||0,className:a.prices,isShowSubtotal:!1}),t.jsx(o.CheckoutFooter,{className:a.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(de,{isOpen:S,onClose:()=>i(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency})]})},he=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:me},Symbol.toStringTag,{value:"Module"}));exports.Orders=$;exports.index=he;
|
package/dist/order-D4daxyzU.js
DELETED
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
import { jsx as t, Fragment as T, jsxs as c } from "react/jsx-runtime";
|
|
2
|
-
import r, { useState as q, useMemo as U } from "react";
|
|
3
|
-
import { X as V, p as W, M as j, V as x, a7 as G } from "./builder-CVbCKY8a.js";
|
|
4
|
-
import { f as z, N as H, P as J, O as X, g as Y, b as K, c as w, d as Q, e as Z, h as ee, L as te, T as ne, i as L, j as ae, k as oe, l as se, m as ce, n as ie } from "./charge-CqeINukp.js";
|
|
5
|
-
import { M as re, I as E, g as R, e as le } from "./ui-components-B2XdfTmJ.js";
|
|
6
|
-
import "./builder-components-BuaB_nik.js";
|
|
7
|
-
import "./ticket-BODLy8iD.js";
|
|
8
|
-
import "react-dom";
|
|
9
|
-
const de = async (a = 1) => await z({ PageNumber: a }), Je = () => {
|
|
10
|
-
const [a, l] = r.useState(null), [m, e] = q(null), [p, C] = r.useState(0), { page: f } = V(), [y, i] = r.useState(!0);
|
|
11
|
-
async function k() {
|
|
12
|
-
i(!0);
|
|
13
|
-
const { list: _, totalCount: g } = await de(f);
|
|
14
|
-
l(_), C(g), e(null), i(!1);
|
|
15
|
-
}
|
|
16
|
-
async function s() {
|
|
17
|
-
const _ = (a == null ? void 0 : a.map((N) => N.gatewayName)) || [], g = await Y(_);
|
|
18
|
-
e(g);
|
|
19
|
-
}
|
|
20
|
-
return r.useEffect(() => {
|
|
21
|
-
!m && a && s();
|
|
22
|
-
}, [a, m]), r.useEffect(() => {
|
|
23
|
-
k();
|
|
24
|
-
}, [f]), /* @__PURE__ */ t(T, { children: a != null && a.length && a.length === 0 ? /* @__PURE__ */ t(
|
|
25
|
-
H,
|
|
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__ */ c(T, { children: [
|
|
31
|
-
/* @__PURE__ */ t(J, { title: "Orders" }),
|
|
32
|
-
/* @__PURE__ */ t(
|
|
33
|
-
X,
|
|
34
|
-
{
|
|
35
|
-
orders: a,
|
|
36
|
-
gatewaysDetail: m,
|
|
37
|
-
totalCount: p,
|
|
38
|
-
isLoading: y
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
] }) });
|
|
42
|
-
}, ue = "_orderPage_gc87l_1", me = "_leftSection_gc87l_15", he = "_content_gc87l_35", pe = "_main_gc87l_42", fe = "_mainAntistock_gc87l_56", _e = "_orderMainDataAntistock_gc87l_69", ge = "_timelineBlockAntistock_gc87l_81", ye = "_footerAntistock_gc87l_92", ke = "_statusBlock_gc87l_104", we = "_timelineBlock_gc87l_81", Ce = "_footer_gc87l_92", Ne = "_rightSection_gc87l_121", Se = "_header_gc87l_142", ve = "_productList_gc87l_150", be = "_mobileFooter_gc87l_157", Pe = "_loaderContainer_gc87l_166", De = "_orderMainData_gc87l_69", Oe = "_prices_gc87l_181", Ae = "_headerTitle_gc87l_185", Re = "_headerDescription_gc87l_189", o = {
|
|
43
|
-
orderPage: ue,
|
|
44
|
-
leftSection: me,
|
|
45
|
-
content: he,
|
|
46
|
-
main: pe,
|
|
47
|
-
mainAntistock: fe,
|
|
48
|
-
orderMainDataAntistock: _e,
|
|
49
|
-
timelineBlockAntistock: ge,
|
|
50
|
-
footerAntistock: ye,
|
|
51
|
-
statusBlock: ke,
|
|
52
|
-
timelineBlock: we,
|
|
53
|
-
footer: Ce,
|
|
54
|
-
rightSection: Ne,
|
|
55
|
-
header: Se,
|
|
56
|
-
productList: ve,
|
|
57
|
-
mobileFooter: be,
|
|
58
|
-
loaderContainer: Pe,
|
|
59
|
-
orderMainData: De,
|
|
60
|
-
prices: Oe,
|
|
61
|
-
headerTitle: Ae,
|
|
62
|
-
headerDescription: Re
|
|
63
|
-
}, Ie = "_modalContent_1a05n_1", Me = "_iconContainer_1a05n_16", Be = "_warningIcon_1a05n_20", $e = "_title_1a05n_25", Fe = "_description_1a05n_33", Te = "_buttonContainer_1a05n_40", Le = "_button_1a05n_40", u = {
|
|
64
|
-
modalContent: Ie,
|
|
65
|
-
iconContainer: Me,
|
|
66
|
-
warningIcon: Be,
|
|
67
|
-
title: $e,
|
|
68
|
-
description: Fe,
|
|
69
|
-
buttonContainer: Te,
|
|
70
|
-
button: Le
|
|
71
|
-
}, We = ({
|
|
72
|
-
isOpen: a,
|
|
73
|
-
onClose: l,
|
|
74
|
-
refundedAmount: m,
|
|
75
|
-
currency: e
|
|
76
|
-
}) => {
|
|
77
|
-
var S, v;
|
|
78
|
-
const p = W(), { token: C, shopDomain: f } = j(), { isAntistock: y, general: i } = x(), k = !!((S = i == null ? void 0 : i.info) != null && S.disableSupport), s = (v = i == null ? void 0 : i.info) == null ? void 0 : v.thirdPartySupportUrl, _ = !(k && !s), g = new Intl.NumberFormat("en-US", {
|
|
79
|
-
style: "currency",
|
|
80
|
-
currency: e
|
|
81
|
-
}), N = () => {
|
|
82
|
-
p(y ? "/account" : "/customer-dash");
|
|
83
|
-
}, D = async () => {
|
|
84
|
-
if (k && s) {
|
|
85
|
-
window.open(s);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
y ? window.open(`https://${f}/support`) : p("/contact");
|
|
89
|
-
}, I = () => {
|
|
90
|
-
l();
|
|
91
|
-
};
|
|
92
|
-
return a ? /* @__PURE__ */ t(re, { close: l, children: /* @__PURE__ */ c(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
className: u.modalContent,
|
|
96
|
-
onClick: (O) => O.stopPropagation(),
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ t("div", { className: u.iconContainer, children: /* @__PURE__ */ t(
|
|
99
|
-
E,
|
|
100
|
-
{
|
|
101
|
-
name: "WarningDiamond",
|
|
102
|
-
fill: "var(--text-warning)",
|
|
103
|
-
className: u.warningIcon
|
|
104
|
-
}
|
|
105
|
-
) }),
|
|
106
|
-
/* @__PURE__ */ t("h2", { className: u.title, children: "Partial Delivery Failure Refund" }),
|
|
107
|
-
/* @__PURE__ */ c("p", { className: u.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
|
-
g.format(m),
|
|
111
|
-
", to your account balance."
|
|
112
|
-
] }),
|
|
113
|
-
/* @__PURE__ */ c("div", { className: u.buttonContainer, children: [
|
|
114
|
-
!C && /* @__PURE__ */ t(
|
|
115
|
-
R,
|
|
116
|
-
{
|
|
117
|
-
type: "Secondary",
|
|
118
|
-
onClick: N,
|
|
119
|
-
className: u.button,
|
|
120
|
-
children: "Login"
|
|
121
|
-
}
|
|
122
|
-
),
|
|
123
|
-
_ && /* @__PURE__ */ t(
|
|
124
|
-
R,
|
|
125
|
-
{
|
|
126
|
-
type: "Secondary",
|
|
127
|
-
onClick: D,
|
|
128
|
-
className: u.button,
|
|
129
|
-
children: "Contact Support"
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
/* @__PURE__ */ t(
|
|
133
|
-
R,
|
|
134
|
-
{
|
|
135
|
-
type: "Primary",
|
|
136
|
-
onClick: I,
|
|
137
|
-
className: u.button,
|
|
138
|
-
children: "Continue"
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
] })
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
) }) : null;
|
|
145
|
-
}, xe = () => {
|
|
146
|
-
var S, v, O, M, B, $;
|
|
147
|
-
const { id: a, accessToken: l } = G(), m = W(), [e, p] = r.useState(), [C, f] = r.useState(!1), [y, i] = r.useState(!1), k = K(), { isAntistock: s } = x(), _ = ((S = e == null ? void 0 : e.rawPrice) == null ? void 0 : S.currency) || "USD", g = new Intl.NumberFormat("en-US", {
|
|
148
|
-
style: "currency",
|
|
149
|
-
currency: _
|
|
150
|
-
}), N = r.useMemo(() => (e == null ? void 0 : e.partOrders.map((n) => {
|
|
151
|
-
var b, A;
|
|
152
|
-
return {
|
|
153
|
-
id: (n == null ? void 0 : n.id) || 0,
|
|
154
|
-
image: n.productWithVariant.image,
|
|
155
|
-
name: (() => {
|
|
156
|
-
var P, F;
|
|
157
|
-
const d = ((P = n.productWithVariant) == null ? void 0 : P.name) || "", h = ((F = n.productWithVariant) == null ? void 0 : F.variantName) || "";
|
|
158
|
-
return !d && !h ? "" : !h || d === h ? d : d ? `${d} (${h})` : h;
|
|
159
|
-
})(),
|
|
160
|
-
description: "",
|
|
161
|
-
price: {
|
|
162
|
-
quantity: n.quantity,
|
|
163
|
-
amount: ((b = n.productWithVariant) == null ? void 0 : b.price.amount) || 0,
|
|
164
|
-
currency: (A = n.productWithVariant) == null ? void 0 : A.price.currency
|
|
165
|
-
},
|
|
166
|
-
deliveryCategories: "deliveryCategories" in n ? n.deliveryCategories : void 0,
|
|
167
|
-
customerNote: n.customerNote,
|
|
168
|
-
chargeType: n.chargeType || "ONE_TIME",
|
|
169
|
-
replacementRequests: "replacementRequests" in n ? n.replacementRequests : void 0,
|
|
170
|
-
allowedReplacementReasons: "allowedReplacementReasons" in n ? n.allowedReplacementReasons : void 0
|
|
171
|
-
};
|
|
172
|
-
})) || [], [e]);
|
|
173
|
-
r.useEffect(() => {
|
|
174
|
-
e && (e.status === w.FullDeliveryFailure || e.status === w.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && i(!0);
|
|
175
|
-
}, [e == null ? void 0 : e.status]);
|
|
176
|
-
const D = async (n, b, A = !1) => {
|
|
177
|
-
var h, P;
|
|
178
|
-
A || f(!0);
|
|
179
|
-
const { data: d } = await (b ? se(`${n}/${b}`) : ce(n));
|
|
180
|
-
f(!1), d.status !== w.Completed && ((h = d.charge) == null ? void 0 : h.status) === ie.NotPaid && m(`/charges/${(P = d.charge) == null ? void 0 : P.id}`, {
|
|
181
|
-
replace: !0
|
|
182
|
-
}), p(d);
|
|
183
|
-
};
|
|
184
|
-
r.useLayoutEffect(() => {
|
|
185
|
-
if (a && !l) {
|
|
186
|
-
const n = JSON.parse(localStorage.getItem("orders") || "{}");
|
|
187
|
-
n[a] && m(`/orders/${a}/${n[a].fullAccessToken}`);
|
|
188
|
-
}
|
|
189
|
-
}, [a]), r.useEffect(() => {
|
|
190
|
-
a && D(a, l, !0);
|
|
191
|
-
const n = setInterval(() => {
|
|
192
|
-
a && D(a, l, !0);
|
|
193
|
-
}, 5e3);
|
|
194
|
-
return () => {
|
|
195
|
-
clearInterval(n);
|
|
196
|
-
};
|
|
197
|
-
}, [a, l]);
|
|
198
|
-
const I = U(() => !!(e != null && e.isApplicableForReplacement && (e.status === w.Completed || e.status === w.PartiallyDelivered || e.status === w.FullDeliveryFailure)), [e]);
|
|
199
|
-
return C ? /* @__PURE__ */ t("div", { className: o.loaderContainer, children: /* @__PURE__ */ t(le, {}) }) : /* @__PURE__ */ c("div", { className: o.orderPage, children: [
|
|
200
|
-
/* @__PURE__ */ t("div", { className: o.leftSection, children: /* @__PURE__ */ c("div", { className: o.content, children: [
|
|
201
|
-
/* @__PURE__ */ t(Q, {}),
|
|
202
|
-
e && /* @__PURE__ */ c("div", { className: `${o.main} ${s ? o.mainAntistock : ""}`, children: [
|
|
203
|
-
/* @__PURE__ */ t(
|
|
204
|
-
Z,
|
|
205
|
-
{
|
|
206
|
-
className: o.statusBlock,
|
|
207
|
-
orderStatus: e.status
|
|
208
|
-
}
|
|
209
|
-
),
|
|
210
|
-
/* @__PURE__ */ c(
|
|
211
|
-
"div",
|
|
212
|
-
{
|
|
213
|
-
className: `${o.orderMainData} ${s ? o.orderMainDataAntistock : ""}`,
|
|
214
|
-
children: [
|
|
215
|
-
/* @__PURE__ */ t(
|
|
216
|
-
ee,
|
|
217
|
-
{
|
|
218
|
-
lastUpdate: e.createdAt,
|
|
219
|
-
paymentType: (v = e.charge) == null ? void 0 : v.gateway,
|
|
220
|
-
email: e.customer ? e.customer.email : ((O = e.charge) == null ? void 0 : O.customerForCharge.email) || "",
|
|
221
|
-
orderId: e.id
|
|
222
|
-
}
|
|
223
|
-
),
|
|
224
|
-
"accessToken" in e.review && !s && /* @__PURE__ */ t(
|
|
225
|
-
te,
|
|
226
|
-
{
|
|
227
|
-
orderId: e.id,
|
|
228
|
-
review: e.review
|
|
229
|
-
}
|
|
230
|
-
)
|
|
231
|
-
]
|
|
232
|
-
}
|
|
233
|
-
),
|
|
234
|
-
e.charge && e.charge.timeline && /* @__PURE__ */ t(
|
|
235
|
-
ne,
|
|
236
|
-
{
|
|
237
|
-
className: `${o.timelineBlock} ${s ? o.timelineBlockAntistock : ""}`,
|
|
238
|
-
timeline: e.charge.timeline
|
|
239
|
-
}
|
|
240
|
-
),
|
|
241
|
-
/* @__PURE__ */ t(
|
|
242
|
-
L,
|
|
243
|
-
{
|
|
244
|
-
className: `${o.footer} ${s ? o.footerAntistock : ""}`
|
|
245
|
-
}
|
|
246
|
-
)
|
|
247
|
-
] })
|
|
248
|
-
] }) }),
|
|
249
|
-
/* @__PURE__ */ t(
|
|
250
|
-
"div",
|
|
251
|
-
{
|
|
252
|
-
className: o.rightSection,
|
|
253
|
-
style: s ? { borderLeft: "1px solid var(--border-secondary)" } : void 0,
|
|
254
|
-
children: /* @__PURE__ */ c("div", { className: o.content, children: [
|
|
255
|
-
((M = e == null ? void 0 : e.charge) == null ? void 0 : M.name) && /* @__PURE__ */ c("header", { className: o.header, children: [
|
|
256
|
-
/* @__PURE__ */ c("div", { children: [
|
|
257
|
-
/* @__PURE__ */ t("h1", { className: o.headerTitle, children: e.charge.name }),
|
|
258
|
-
e.charge.description && /* @__PURE__ */ t("p", { className: o.headerDescription, children: e.charge.description })
|
|
259
|
-
] }),
|
|
260
|
-
s ? null : /* @__PURE__ */ c(
|
|
261
|
-
R,
|
|
262
|
-
{
|
|
263
|
-
type: "Secondary",
|
|
264
|
-
onClick: () => k((e == null ? void 0 : e.id) || ""),
|
|
265
|
-
style: {
|
|
266
|
-
whiteSpace: "nowrap",
|
|
267
|
-
display: "flex",
|
|
268
|
-
alignItems: "center",
|
|
269
|
-
gap: "4px"
|
|
270
|
-
},
|
|
271
|
-
children: [
|
|
272
|
-
/* @__PURE__ */ t(E, { name: "Copy" }),
|
|
273
|
-
/* @__PURE__ */ t("span", { children: "Copy ID" })
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
)
|
|
277
|
-
] }),
|
|
278
|
-
/* @__PURE__ */ c("div", { children: [
|
|
279
|
-
/* @__PURE__ */ t("div", { className: o.productList, children: N.map((n) => /* @__PURE__ */ t(
|
|
280
|
-
ae,
|
|
281
|
-
{
|
|
282
|
-
product: n,
|
|
283
|
-
isOrder: !0,
|
|
284
|
-
isApplicableForReplacement: I,
|
|
285
|
-
orderId: a,
|
|
286
|
-
accessToken: l,
|
|
287
|
-
allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
|
|
288
|
-
},
|
|
289
|
-
n.id
|
|
290
|
-
)) }),
|
|
291
|
-
s ? null : /* @__PURE__ */ t(
|
|
292
|
-
oe,
|
|
293
|
-
{
|
|
294
|
-
formatter: g,
|
|
295
|
-
coupon: null,
|
|
296
|
-
total: ((B = e == null ? void 0 : e.endPrice) == null ? void 0 : B.amount) || 0,
|
|
297
|
-
discount: 0,
|
|
298
|
-
totalWithDiscount: (($ = e == null ? void 0 : e.endPrice) == null ? void 0 : $.amount) || 0,
|
|
299
|
-
className: o.prices,
|
|
300
|
-
isShowSubtotal: !1
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
/* @__PURE__ */ t(L, { className: o.mobileFooter })
|
|
304
|
-
] })
|
|
305
|
-
] })
|
|
306
|
-
}
|
|
307
|
-
),
|
|
308
|
-
(e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ t(
|
|
309
|
-
We,
|
|
310
|
-
{
|
|
311
|
-
isOpen: y,
|
|
312
|
-
onClose: () => i(!1),
|
|
313
|
-
refundedAmount: e.refundedPrice.amount,
|
|
314
|
-
currency: e.refundedPrice.currency
|
|
315
|
-
}
|
|
316
|
-
)
|
|
317
|
-
] });
|
|
318
|
-
}, Xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
319
|
-
__proto__: null,
|
|
320
|
-
OrderPage: xe
|
|
321
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
322
|
-
export {
|
|
323
|
-
Je as O,
|
|
324
|
-
Xe as i
|
|
325
|
-
};
|