@billgangcom/theme-lib 1.120.4 → 1.121.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.
Files changed (49) hide show
  1. package/dist/{builder-B7zcAFlP.js → builder-BLJW4r2I.js} +5 -5
  2. package/dist/{builder-D-_y0UZo.cjs → builder-CEuUvIOl.cjs} +2 -2
  3. package/dist/{builder-components-DTblcA5b.js → builder-components-B5VitaYF.js} +4 -4
  4. package/dist/{builder-components-BINsMpjv.cjs → builder-components-Bxh6HqE7.cjs} +1 -1
  5. package/dist/builder.cjs.js +1 -1
  6. package/dist/builder.es.js +239 -217
  7. package/dist/{charge-D_2QP2MU.js → charge-BJBo-Ac6.js} +5662 -5570
  8. package/dist/{charge-DFWqP484.cjs → charge-C3aekkW0.cjs} +39 -39
  9. package/dist/{checkout-BFUUel8K.cjs → checkout-C0yD2KNO.cjs} +1 -1
  10. package/dist/{checkout-CW4kk1A2.js → checkout-DJRMAUFt.js} +5 -5
  11. package/dist/exports.cjs.js +1 -1
  12. package/dist/exports.es.js +6 -6
  13. package/dist/{index-XUyDh3Pa.cjs → index-0pbQYR0W.cjs} +1 -1
  14. package/dist/{index-Dcc_1V35.cjs → index-3ooWNOdm.cjs} +1 -1
  15. package/dist/{index-BiNYeUmn.js → index-BVgZHPmL.js} +1 -1
  16. package/dist/index-BYph4R_R.cjs +1 -0
  17. package/dist/{index-CMzqaOZI.js → index-BwkJb9iY.js} +5 -5
  18. package/dist/{index-CQMyE7Wb.js → index-C4RdZsKS.js} +5 -5
  19. package/dist/{index-DScxpPuH.cjs → index-Cy04C1Ft.cjs} +1 -1
  20. package/dist/index-DHu9EjiI.js +45 -0
  21. package/dist/{index-CyrZrBYf.cjs → index-DOq8Ex8r.cjs} +1 -1
  22. package/dist/{index-BUpWXhdd.js → index-DkCtdfUs.js} +5 -5
  23. package/dist/{index-DOsbUE9W.js → index-DznvnZMn.js} +5 -5
  24. package/dist/{index-DI14JIuH.cjs → index-WUENht00.cjs} +1 -1
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.es.js +6 -6
  27. package/dist/order-DImEf9Qd.cjs +1 -0
  28. package/dist/order-DjqVEizs.js +294 -0
  29. package/dist/src/components/lazy-pages.d.ts +2 -1
  30. package/dist/src/pages/terms/index.d.ts +2 -0
  31. package/dist/src/storefront/models/checkout.d.ts +5 -0
  32. package/dist/src/storefront/models/order.d.ts +3 -0
  33. package/dist/style.css +1 -1
  34. package/dist/{subscription-BqANqkMh.cjs → subscription-DRM99xSt.cjs} +1 -1
  35. package/dist/{subscription-BbMSdNBC.js → subscription-Dy4VkIUb.js} +5 -5
  36. package/dist/{ticket-DZLQHt1e.cjs → ticket-DfRwG42e.cjs} +2 -2
  37. package/dist/{ticket-ClWCwOa2.js → ticket-UF6olQ4f.js} +49 -48
  38. package/dist/{top-up-YIsioJgU.js → top-up-BifI2B0D.js} +5 -5
  39. package/dist/{top-up-CRprLre3.cjs → top-up-BrN49_Uk.cjs} +1 -1
  40. package/dist/ui-components-BkVsTiHC.cjs +1 -0
  41. package/dist/{ui-components-B9RxvEbc.js → ui-components-C6LT11Nu.js} +6 -5
  42. package/dist/ui.cjs.js +1 -1
  43. package/dist/ui.es.js +1 -1
  44. package/dist/{validation-CbLHhgF-.cjs → validation-B54ivxep.cjs} +1 -1
  45. package/dist/{validation-BRWhHglL.js → validation-Cy2VBGwW.js} +5 -5
  46. package/package.json +1 -1
  47. package/dist/order-Ctzxqbbs.cjs +0 -1
  48. package/dist/order-x-Rke14d.js +0 -277
  49. package/dist/ui-components-CAVkeo8V.cjs +0 -1
@@ -3,11 +3,11 @@ var In = (e, n, o) => n in e ? mn(e, n, { enumerable: !0, configurable: !0, writ
3
3
  var Ot = (e, n, o) => In(e, typeof n != "symbol" ? n + "" : n, o);
4
4
  import { jsx as t, jsxs as d, Fragment as J } from "react/jsx-runtime";
5
5
  import _, { useState as st, useRef as ft, useCallback as Xe, useEffect as un, createElement as Ct, PureComponent as gn } from "react";
6
- import { f as R, ad as lt, j as Qt, r as Zt, m as _t, K as Ge, ae as en, J as Pe, v as me, af as Dt, ag as Ft, b as Je, l as fn, e as ze, p as St, _ as ye, a5 as _n, N as Sn, ah as bn, ai as tn, k as yn } from "./builder-B7zcAFlP.js";
7
- import { X as Cn, Y as vn, u as We, I as wn } from "./charge-D_2QP2MU.js";
8
- import { u as Ye, d as Qe, D as Ze, e as et, v as tt, f as nt, g as ot, C as it, F as Mt } from "./builder-components-DTblcA5b.js";
6
+ import { f as R, ad as lt, j as Qt, r as Zt, m as _t, K as Ge, ae as en, J as Pe, v as me, af as Dt, ag as Ft, b as Je, l as fn, e as ze, p as St, _ as ye, a5 as _n, N as Sn, ah as bn, ai as tn, k as yn } from "./builder-BLJW4r2I.js";
7
+ import { X as Cn, Y as vn, u as We, I as wn } from "./charge-BJBo-Ac6.js";
8
+ import { u as Ye, d as Qe, D as Ze, e as et, v as tt, f as nt, g as ot, C as it, F as Mt } from "./builder-components-B5VitaYF.js";
9
9
  import kn, { createPortal as Tn } from "react-dom";
10
- import { s as Fe, g as Nn, u as Pn } from "./ticket-ClWCwOa2.js";
10
+ import { s as Fe, g as Nn, u as Pn } from "./ticket-UF6olQ4f.js";
11
11
  const An = "_wrapper_5w9s8_1", Ln = {
12
12
  wrapper: An
13
13
  }, $h = (e) => {
@@ -3916,7 +3916,8 @@ const Vh = (e) => {
3916
3916
  width: "15px",
3917
3917
  height: "15px",
3918
3918
  borderWidth: "2px"
3919
- }
3919
+ },
3920
+ ...e
3920
3921
  }
3921
3922
  ) : /* @__PURE__ */ t(
3922
3923
  "div",
package/dist/ui.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ui-components-CAVkeo8V.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.ImagesLoader=t.ImagesLoader;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.SelectSettings=t.SelectSettings;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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ui-components-BkVsTiHC.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.ImagesLoader=t.ImagesLoader;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.SelectSettings=t.SelectSettings;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 { a4 as t, J as e, a2 as o, g as n, B as i, K as r, G as g, D as S, U as d, j as l, m as c, ab as u, b as p, C as I, _ as B, E as C, F as M, a9 as T, X as h, I as m, k as x, c as L, f as y, A as P, y as b, a5 as f, Q as k, e as U, L as A, a7 as E, M as R, N as F, a1 as G, a0 as H, P as N, a6 as O, a8 as W, V as j, R as w, O as z, h as D, ac as J, S as K, aa as Q, h as V, a3 as X, Y, Z, d as _, z as $, T as q, l as v, i as aa, H as sa, $ as ta, W as ea } from "./ui-components-B9RxvEbc.js";
1
+ import { a4 as t, J as e, a2 as o, g as n, B as i, K as r, G as g, D as S, U as d, j as l, m as c, ab as u, b as p, C as I, _ as B, E as C, F as M, a9 as T, X as h, I as m, k as x, c as L, f as y, A as P, y as b, a5 as f, Q as k, e as U, L as A, a7 as E, M as R, N as F, a1 as G, a0 as H, P as N, a6 as O, a8 as W, V as j, R as w, O as z, h as D, ac as J, S as K, aa as Q, h as V, a3 as X, Y, Z, d as _, z as $, T as q, l as v, i as aa, H as sa, $ as ta, W as ea } from "./ui-components-C6LT11Nu.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-DFWqP484.cjs"),d=require("./builder-D-_y0UZo.cjs"),u=require("./ui-components-CAVkeo8V.cjs");require("./builder-components-BINsMpjv.cjs");require("react-dom");require("./ticket-DZLQHt1e.cjs");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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),g=require("./charge-C3aekkW0.cjs"),d=require("./builder-CEuUvIOl.cjs"),u=require("./ui-components-BkVsTiHC.cjs");require("./builder-components-Bxh6HqE7.cjs");require("react-dom");require("./ticket-DfRwG42e.cjs");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,11 +1,11 @@
1
1
  import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
2
  import r from "react";
3
- import { Z as g } from "./charge-D_2QP2MU.js";
4
- import { K as I, N as x, ac as N, p as b } from "./builder-B7zcAFlP.js";
5
- import { I as y, f as k, g as L, e as E } from "./ui-components-B9RxvEbc.js";
6
- import "./builder-components-DTblcA5b.js";
3
+ import { Z as g } from "./charge-BJBo-Ac6.js";
4
+ import { K as I, N as x, ac as N, p as b } from "./builder-BLJW4r2I.js";
5
+ import { I as y, f as k, g as L, e as E } from "./ui-components-C6LT11Nu.js";
6
+ import "./builder-components-B5VitaYF.js";
7
7
  import "react-dom";
8
- import "./ticket-ClWCwOa2.js";
8
+ import "./ticket-UF6olQ4f.js";
9
9
  const V = "_lock_1mxa7_1", G = "_wrapper_1mxa7_12", j = "_content_1mxa7_22", C = "_info_1mxa7_31", q = "_buttons_1mxa7_38", B = "_button_1mxa7_38", K = "_input_1mxa7_50", R = "_error_1mxa7_57", t = {
10
10
  lock: V,
11
11
  wrapper: G,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@billgangcom/theme-lib",
3
- "version": "1.120.4",
3
+ "version": "1.121.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1 +0,0 @@
1
- "use strict";const s=require("react/jsx-runtime"),i=require("react"),x=require("./builder-D-_y0UZo.cjs"),a=require("./charge-DFWqP484.cjs"),O=require("./ui-components-CAVkeo8V.cjs");require("./builder-components-BINsMpjv.cjs");require("react-dom");require("./ticket-DZLQHt1e.cjs");const U=async(o=1)=>await a.fetchOrders({PageNumber:o}),z=()=>{const[o,r]=i.useState(null),[u,e]=i.useState(null),[v,w]=i.useState(0),{page:f}=x.usePaginationPagesStore(),[j,g]=i.useState(!0);async function N(){g(!0);const{list:p,totalCount:l}=await U(f);r(p),w(l),e(null),g(!1)}async function _(){const p=(o==null?void 0:o.map(n=>n.gatewayName))||[],l=await a.getGatewaysDetail(p);e(l)}return i.useEffect(()=>{!u&&o&&_()},[o,u]),i.useEffect(()=>{N()},[f]),s.jsx(s.Fragment,{children:o!=null&&o.length&&o.length===0?s.jsx(a.NoItemsBlock,{title:"No Orders",description:"When you purchase products from our website, you'll see a history of orders here."}):s.jsxs(s.Fragment,{children:[s.jsx(a.PageTitle,{title:"Orders"}),s.jsx(a.OrdersTable,{orders:o,gatewaysDetail:u,totalCount:v,isLoading:j})]})})},H="_orderPage_gc87l_1",J="_leftSection_gc87l_15",K="_content_gc87l_35",Q="_main_gc87l_42",X="_mainAntistock_gc87l_56",Y="_orderMainDataAntistock_gc87l_69",Z="_timelineBlockAntistock_gc87l_81",ee="_footerAntistock_gc87l_92",te="_statusBlock_gc87l_104",se="_timelineBlock_gc87l_81",oe="_footer_gc87l_92",ae="_rightSection_gc87l_121",ce="_header_gc87l_142",ne="_productList_gc87l_150",ie="_mobileFooter_gc87l_157",re="_loaderContainer_gc87l_166",le="_orderMainData_gc87l_69",ue="_prices_gc87l_181",de="_headerTitle_gc87l_185",me="_headerDescription_gc87l_189",c={orderPage:H,leftSection:J,content:K,main:Q,mainAntistock:X,orderMainDataAntistock:Y,timelineBlockAntistock:Z,footerAntistock:ee,statusBlock:te,timelineBlock:se,footer:oe,rightSection:ae,header:ce,productList:ne,mobileFooter:ie,loaderContainer:re,orderMainData:le,prices:ue,headerTitle:de,headerDescription:me},he=()=>{var A,P,b,R,M,V,B,F,I;const{id:o,accessToken:r}=x.useParams(),u=x.useNavigate(),[e,v]=i.useState(),[w,f]=i.useState(!1),[j,g]=i.useState(!1),[N,_]=i.useState(!1),p=a.useCopy(),{isAntistock:l,general:n}=x.useGeneralStore(),q=((A=e==null?void 0:e.rawPrice)==null?void 0:A.currency)||"USD",L=new Intl.NumberFormat("en-US",{style:"currency",currency:q}),C=i.useMemo(()=>(e==null?void 0:e.partOrders.map(t=>{var y,S,h;return{id:Number((y=t.productWithVariant)==null?void 0:y.id)||0,partOrderId:Number(t==null?void 0:t.id)||0,image:t.productWithVariant.image,name:(()=>{var T,$;const d=((T=t.productWithVariant)==null?void 0:T.name)||"",m=(($=t.productWithVariant)==null?void 0:$.variantName)||"";return!d&&!m?"":!m||d===m?d:d?`${d} (${m})`:m})(),description:"",price:{quantity:t.quantity,amount:((S=t.productWithVariant)==null?void 0:S.price.amount)||0,currency:(h=t.productWithVariant)==null?void 0:h.price.currency},deliveryCategories:"deliveryCategories"in t?t.deliveryCategories:void 0,customerNote:t.customerNote,chargeType:t.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in t?t.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in t?t.allowedReplacementReasons:void 0}}))||[],[e]);i.useEffect(()=>{e&&(e.status===a.OrderStatus.FullDeliveryFailure||e.status===a.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&g(!0)},[e==null?void 0:e.status]);const k=i.useCallback(async(t,y,S=!1)=>{var d,m;S||f(!0);const{data:h}=await(y?a.fetchAuthorizedOrder(`${t}/${y}`):a.fetchOrder(t));f(!1),h.status!==a.OrderStatus.Completed&&((d=h.charge)==null?void 0:d.status)===a.ChargeStatus.NotPaid&&u(`/charges/${(m=h.charge)==null?void 0:m.id}`,{replace:!0}),v(h)},[u]);i.useLayoutEffect(()=>{if(o&&!r){const t=JSON.parse(localStorage.getItem("orders")||"{}");t[o]&&u(`/orders/${o}/${t[o].fullAccessToken}`)}},[o,r,u]),i.useEffect(()=>{o&&k(o,r,!0);const t=setInterval(()=>{o&&k(o,r,!0)},5e3);return()=>{clearInterval(t)}},[o,r,k]);const E=i.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===a.OrderStatus.Completed||e.status===a.OrderStatus.PartiallyDelivered||e.status===a.OrderStatus.FullDeliveryFailure)),[e]),D=i.useMemo(()=>{var t;return!!((t=n==null?void 0:n.info)!=null&&t.isVouchesEnabled&&r)},[(P=n==null?void 0:n.info)==null?void 0:P.isVouchesEnabled,r]),W=i.useMemo(()=>{var t;return!!(!((t=n==null?void 0:n.info)!=null&&t.isVouchesEnabled)&&(e!=null&&e.review)&&"accessToken"in e.review&&!l)},[(b=n==null?void 0:n.info)==null?void 0:b.isVouchesEnabled,e==null?void 0:e.review,l]),G=i.useMemo(()=>{var t;return((t=n==null?void 0:n.info)==null?void 0:t.domain)||window.location.hostname},[(R=n==null?void 0:n.info)==null?void 0:R.domain]);return w?s.jsx("div",{className:c.loaderContainer,children:s.jsx(O.Loader,{})}):s.jsxs("div",{className:c.orderPage,children:[s.jsx("div",{className:c.leftSection,children:s.jsxs("div",{className:c.content,children:[s.jsx(a.CheckoutHeader,{}),e&&s.jsxs("div",{className:`${c.main} ${l?c.mainAntistock:""}`,children:[s.jsx(a.OrderStatusBlock,{className:c.statusBlock,orderStatus:e.status}),s.jsxs("div",{className:`${c.orderMainData} ${l?c.orderMainDataAntistock:""}`,children:[D&&s.jsx(a.VouchCard,{onAddMessage:()=>_(!0),isVouchLeft:e.isVouchLeft}),s.jsx(a.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(M=e.charge)==null?void 0:M.gateway,email:e.customer?e.customer.email:((V=e.charge)==null?void 0:V.customerForCharge.email)||"",orderId:e.id}),W&&e.review&&s.jsx(a.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&s.jsx(a.TrackPayment,{className:`${c.timelineBlock} ${l?c.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),s.jsx(a.CheckoutFooter,{className:`${c.footer} ${l?c.footerAntistock:""}`})]})]})}),s.jsx("div",{className:c.rightSection,style:l?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:s.jsxs("div",{className:c.content,children:[((B=e==null?void 0:e.charge)==null?void 0:B.name)&&s.jsxs("header",{className:c.header,children:[s.jsxs("div",{children:[s.jsx("h1",{className:c.headerTitle,children:e.charge.name}),e.charge.description&&s.jsx("p",{className:c.headerDescription,children:e.charge.description})]}),l?null:s.jsxs(O.Button,{type:"Secondary",onClick:()=>p((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[s.jsx(O.Icon,{name:"Copy"}),s.jsx("span",{children:"Copy ID"})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:c.productList,children:C.map(t=>s.jsx(a.CheckoutProduct,{product:t,isOrder:!0,isApplicableForReplacement:E,orderId:o,accessToken:r,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},t.id))}),l?null:s.jsx(a.CheckoutPrices,{formatter:L,coupon:null,total:((F=e==null?void 0:e.endPrice)==null?void 0:F.amount)||0,discount:0,totalWithDiscount:((I=e==null?void 0:e.endPrice)==null?void 0:I.amount)||0,className:c.prices,isShowSubtotal:!1}),s.jsx(a.CheckoutFooter,{className:c.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&s.jsx(a.RefundNotificationModal,{isOpen:j,onClose:()=>g(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency}),D&&s.jsx(a.VouchModal,{isOpen:N,onClose:()=>_(!1),products:C,orderId:o,accessToken:r,shopDomain:G,onSuccess:()=>{_(!1),o&&k(o,r,!0)}})]})},fe=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:he},Symbol.toStringTag,{value:"Module"}));exports.Orders=z;exports.index=fe;
@@ -1,277 +0,0 @@
1
- import { jsx as s, Fragment as W, jsxs as l } from "react/jsx-runtime";
2
- import i, { useState as H, useMemo as S } from "react";
3
- import { X as J, a8 as K, p as X, K as Q } from "./builder-B7zcAFlP.js";
4
- import { f as Y, N as Z, P as ee, O as te, g as ae, b as se, c as f, d as oe, e as ce, h as ie, i as ne, j as re, V as le, k as de, L as ue, T as me, l as x, m as he, n as fe, R as pe, o as ge } from "./charge-D_2QP2MU.js";
5
- import { e as _e, g as ye, I as ke } from "./ui-components-B9RxvEbc.js";
6
- import "./builder-components-DTblcA5b.js";
7
- import "react-dom";
8
- import "./ticket-ClWCwOa2.js";
9
- const ve = async (a = 1) => await Y({ PageNumber: a }), Xe = () => {
10
- const [a, n] = i.useState(null), [d, e] = H(null), [N, O] = i.useState(0), { page: p } = J(), [C, g] = i.useState(!0);
11
- async function D() {
12
- g(!0);
13
- const { list: y, totalCount: r } = await ve(p);
14
- n(y), O(r), e(null), g(!1);
15
- }
16
- async function _() {
17
- const y = (a == null ? void 0 : a.map((c) => c.gatewayName)) || [], r = await ae(y);
18
- e(r);
19
- }
20
- return i.useEffect(() => {
21
- !d && a && _();
22
- }, [a, d]), i.useEffect(() => {
23
- D();
24
- }, [p]), /* @__PURE__ */ s(W, { children: a != null && a.length && a.length === 0 ? /* @__PURE__ */ s(
25
- Z,
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__ */ l(W, { children: [
31
- /* @__PURE__ */ s(ee, { title: "Orders" }),
32
- /* @__PURE__ */ s(
33
- te,
34
- {
35
- orders: a,
36
- gatewaysDetail: d,
37
- totalCount: N,
38
- isLoading: C
39
- }
40
- )
41
- ] }) });
42
- }, we = "_orderPage_gc87l_1", Se = "_leftSection_gc87l_15", Ne = "_content_gc87l_35", Oe = "_main_gc87l_42", Ce = "_mainAntistock_gc87l_56", De = "_orderMainDataAntistock_gc87l_69", Pe = "_timelineBlockAntistock_gc87l_81", Ae = "_footerAntistock_gc87l_92", be = "_statusBlock_gc87l_104", Re = "_timelineBlock_gc87l_81", Me = "_footer_gc87l_92", Ve = "_rightSection_gc87l_121", Ie = "_header_gc87l_142", Be = "_productList_gc87l_150", Te = "_mobileFooter_gc87l_157", Le = "_loaderContainer_gc87l_166", $e = "_orderMainData_gc87l_69", Fe = "_prices_gc87l_181", Ee = "_headerTitle_gc87l_185", We = "_headerDescription_gc87l_189", o = {
43
- orderPage: we,
44
- leftSection: Se,
45
- content: Ne,
46
- main: Oe,
47
- mainAntistock: Ce,
48
- orderMainDataAntistock: De,
49
- timelineBlockAntistock: Pe,
50
- footerAntistock: Ae,
51
- statusBlock: be,
52
- timelineBlock: Re,
53
- footer: Me,
54
- rightSection: Ve,
55
- header: Ie,
56
- productList: Be,
57
- mobileFooter: Te,
58
- loaderContainer: Le,
59
- orderMainData: $e,
60
- prices: Fe,
61
- headerTitle: Ee,
62
- headerDescription: We
63
- }, xe = () => {
64
- var b, R, M, V, I, B, T, L, $;
65
- const { id: a, accessToken: n } = K(), d = X(), [e, N] = i.useState(), [O, p] = i.useState(!1), [C, g] = i.useState(!1), [D, _] = i.useState(!1), y = se(), { isAntistock: r, general: c } = Q(), q = ((b = e == null ? void 0 : e.rawPrice) == null ? void 0 : b.currency) || "USD", j = new Intl.NumberFormat("en-US", {
66
- style: "currency",
67
- currency: q
68
- }), P = i.useMemo(() => (e == null ? void 0 : e.partOrders.map((t) => {
69
- var k, w, h;
70
- return {
71
- id: Number((k = t.productWithVariant) == null ? void 0 : k.id) || 0,
72
- partOrderId: Number(t == null ? void 0 : t.id) || 0,
73
- image: t.productWithVariant.image,
74
- name: (() => {
75
- var F, E;
76
- const u = ((F = t.productWithVariant) == null ? void 0 : F.name) || "", m = ((E = t.productWithVariant) == null ? void 0 : E.variantName) || "";
77
- return !u && !m ? "" : !m || u === m ? u : u ? `${u} (${m})` : m;
78
- })(),
79
- description: "",
80
- price: {
81
- quantity: t.quantity,
82
- amount: ((w = t.productWithVariant) == null ? void 0 : w.price.amount) || 0,
83
- currency: (h = t.productWithVariant) == null ? void 0 : h.price.currency
84
- },
85
- deliveryCategories: "deliveryCategories" in t ? t.deliveryCategories : void 0,
86
- customerNote: t.customerNote,
87
- chargeType: t.chargeType || "ONE_TIME",
88
- replacementRequests: "replacementRequests" in t ? t.replacementRequests : void 0,
89
- allowedReplacementReasons: "allowedReplacementReasons" in t ? t.allowedReplacementReasons : void 0
90
- };
91
- })) || [], [e]);
92
- i.useEffect(() => {
93
- e && (e.status === f.FullDeliveryFailure || e.status === f.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && g(!0);
94
- }, [e == null ? void 0 : e.status]);
95
- const v = i.useCallback(
96
- async (t, k, w = !1) => {
97
- var u, m;
98
- w || p(!0);
99
- const { data: h } = await (k ? oe(`${t}/${k}`) : ce(t));
100
- p(!1), h.status !== f.Completed && ((u = h.charge) == null ? void 0 : u.status) === ie.NotPaid && d(`/charges/${(m = h.charge) == null ? void 0 : m.id}`, {
101
- replace: !0
102
- }), N(h);
103
- },
104
- [d]
105
- );
106
- i.useLayoutEffect(() => {
107
- if (a && !n) {
108
- const t = JSON.parse(localStorage.getItem("orders") || "{}");
109
- t[a] && d(`/orders/${a}/${t[a].fullAccessToken}`);
110
- }
111
- }, [a, n, d]), i.useEffect(() => {
112
- a && v(a, n, !0);
113
- const t = setInterval(() => {
114
- a && v(a, n, !0);
115
- }, 5e3);
116
- return () => {
117
- clearInterval(t);
118
- };
119
- }, [a, n, v]);
120
- const G = S(() => !!(e != null && e.isApplicableForReplacement && (e.status === f.Completed || e.status === f.PartiallyDelivered || e.status === f.FullDeliveryFailure)), [e]), A = S(() => {
121
- var t;
122
- return !!((t = c == null ? void 0 : c.info) != null && t.isVouchesEnabled && n);
123
- }, [(R = c == null ? void 0 : c.info) == null ? void 0 : R.isVouchesEnabled, n]), U = S(() => {
124
- var t;
125
- return !!(!((t = c == null ? void 0 : c.info) != null && t.isVouchesEnabled) && (e != null && e.review) && "accessToken" in e.review && !r);
126
- }, [(M = c == null ? void 0 : c.info) == null ? void 0 : M.isVouchesEnabled, e == null ? void 0 : e.review, r]), z = S(() => {
127
- var t;
128
- return ((t = c == null ? void 0 : c.info) == null ? void 0 : t.domain) || window.location.hostname;
129
- }, [(V = c == null ? void 0 : c.info) == null ? void 0 : V.domain]);
130
- return O ? /* @__PURE__ */ s("div", { className: o.loaderContainer, children: /* @__PURE__ */ s(_e, {}) }) : /* @__PURE__ */ l("div", { className: o.orderPage, children: [
131
- /* @__PURE__ */ s("div", { className: o.leftSection, children: /* @__PURE__ */ l("div", { className: o.content, children: [
132
- /* @__PURE__ */ s(ne, {}),
133
- e && /* @__PURE__ */ l("div", { className: `${o.main} ${r ? o.mainAntistock : ""}`, children: [
134
- /* @__PURE__ */ s(
135
- re,
136
- {
137
- className: o.statusBlock,
138
- orderStatus: e.status
139
- }
140
- ),
141
- /* @__PURE__ */ l(
142
- "div",
143
- {
144
- className: `${o.orderMainData} ${r ? o.orderMainDataAntistock : ""}`,
145
- children: [
146
- A && /* @__PURE__ */ s(
147
- le,
148
- {
149
- onAddMessage: () => _(!0),
150
- isVouchLeft: e.isVouchLeft
151
- }
152
- ),
153
- /* @__PURE__ */ s(
154
- de,
155
- {
156
- lastUpdate: e.createdAt,
157
- paymentType: (I = e.charge) == null ? void 0 : I.gateway,
158
- email: e.customer ? e.customer.email : ((B = e.charge) == null ? void 0 : B.customerForCharge.email) || "",
159
- orderId: e.id
160
- }
161
- ),
162
- U && e.review && /* @__PURE__ */ s(
163
- ue,
164
- {
165
- orderId: e.id,
166
- review: e.review
167
- }
168
- )
169
- ]
170
- }
171
- ),
172
- e.charge && e.charge.timeline && /* @__PURE__ */ s(
173
- me,
174
- {
175
- className: `${o.timelineBlock} ${r ? o.timelineBlockAntistock : ""}`,
176
- timeline: e.charge.timeline
177
- }
178
- ),
179
- /* @__PURE__ */ s(
180
- x,
181
- {
182
- className: `${o.footer} ${r ? o.footerAntistock : ""}`
183
- }
184
- )
185
- ] })
186
- ] }) }),
187
- /* @__PURE__ */ s(
188
- "div",
189
- {
190
- className: o.rightSection,
191
- style: r ? { borderLeft: "1px solid var(--border-secondary)" } : void 0,
192
- children: /* @__PURE__ */ l("div", { className: o.content, children: [
193
- ((T = e == null ? void 0 : e.charge) == null ? void 0 : T.name) && /* @__PURE__ */ l("header", { className: o.header, children: [
194
- /* @__PURE__ */ l("div", { children: [
195
- /* @__PURE__ */ s("h1", { className: o.headerTitle, children: e.charge.name }),
196
- e.charge.description && /* @__PURE__ */ s("p", { className: o.headerDescription, children: e.charge.description })
197
- ] }),
198
- r ? null : /* @__PURE__ */ l(
199
- ye,
200
- {
201
- type: "Secondary",
202
- onClick: () => y((e == null ? void 0 : e.id) || ""),
203
- style: {
204
- whiteSpace: "nowrap",
205
- display: "flex",
206
- alignItems: "center",
207
- gap: "4px"
208
- },
209
- children: [
210
- /* @__PURE__ */ s(ke, { name: "Copy" }),
211
- /* @__PURE__ */ s("span", { children: "Copy ID" })
212
- ]
213
- }
214
- )
215
- ] }),
216
- /* @__PURE__ */ l("div", { children: [
217
- /* @__PURE__ */ s("div", { className: o.productList, children: P.map((t) => /* @__PURE__ */ s(
218
- he,
219
- {
220
- product: t,
221
- isOrder: !0,
222
- isApplicableForReplacement: G,
223
- orderId: a,
224
- accessToken: n,
225
- allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
226
- },
227
- t.id
228
- )) }),
229
- r ? null : /* @__PURE__ */ s(
230
- fe,
231
- {
232
- formatter: j,
233
- coupon: null,
234
- total: ((L = e == null ? void 0 : e.endPrice) == null ? void 0 : L.amount) || 0,
235
- discount: 0,
236
- totalWithDiscount: (($ = e == null ? void 0 : e.endPrice) == null ? void 0 : $.amount) || 0,
237
- className: o.prices,
238
- isShowSubtotal: !1
239
- }
240
- ),
241
- /* @__PURE__ */ s(x, { className: o.mobileFooter })
242
- ] })
243
- ] })
244
- }
245
- ),
246
- (e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ s(
247
- pe,
248
- {
249
- isOpen: C,
250
- onClose: () => g(!1),
251
- refundedAmount: e.refundedPrice.amount,
252
- currency: e.refundedPrice.currency
253
- }
254
- ),
255
- A && /* @__PURE__ */ s(
256
- ge,
257
- {
258
- isOpen: D,
259
- onClose: () => _(!1),
260
- products: P,
261
- orderId: a,
262
- accessToken: n,
263
- shopDomain: z,
264
- onSuccess: () => {
265
- _(!1), a && v(a, n, !0);
266
- }
267
- }
268
- )
269
- ] });
270
- }, Qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
271
- __proto__: null,
272
- OrderPage: xe
273
- }, Symbol.toStringTag, { value: "Module" }));
274
- export {
275
- Xe as O,
276
- Qe as i
277
- };