@billgangcom/theme-lib 1.123.4 → 1.123.6

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 (45) hide show
  1. package/dist/{builder-CuCcIZjx.cjs → builder--8Ry7cQ4.cjs} +2 -2
  2. package/dist/{builder-Vw17cIvh.js → builder-DJQh1c1e.js} +15 -15
  3. package/dist/{builder-components-D8fl8nFz.cjs → builder-components-Bgg9F62l.cjs} +2 -2
  4. package/dist/{builder-components-CqsarjiD.js → builder-components-CpOz_SUG.js} +299 -290
  5. package/dist/builder.cjs.js +1 -1
  6. package/dist/builder.es.js +30 -30
  7. package/dist/{charge-D2IfRJ1B.cjs → charge-DywF6LWF.cjs} +1 -1
  8. package/dist/{charge-BxH20YHb.js → charge-z48cLi-k.js} +6 -6
  9. package/dist/{checkout-l_9O3JXV.cjs → checkout-DTwC9CX7.cjs} +1 -1
  10. package/dist/{checkout-BmEdO4pB.js → checkout-M3jKk4q6.js} +5 -5
  11. package/dist/exports.cjs.js +1 -1
  12. package/dist/exports.es.js +6 -6
  13. package/dist/{index-CWkTgTiA.cjs → index-9XqQn8Cq.cjs} +1 -1
  14. package/dist/{index-Bxzx1T1Y.cjs → index-BSrpJXEj.cjs} +1 -1
  15. package/dist/{index-BdggtqWP.js → index-BTjeATna.js} +3 -3
  16. package/dist/{index-DOMIQhcU.cjs → index-Bidor65E.cjs} +1 -1
  17. package/dist/{index-VcBR0LYA.js → index-CElp6y2B.js} +12 -12
  18. package/dist/{index-C9m6xbNq.js → index-CYANU9EG.js} +5 -5
  19. package/dist/{index-Lx5YZc2J.js → index-CcM2U332.js} +2 -2
  20. package/dist/{index-pPt21AZn.js → index-CloS3B1y.js} +5 -5
  21. package/dist/{index-Cz9vjw2u.cjs → index-D9rOdRq1.cjs} +1 -1
  22. package/dist/{index-uCRD-Te9.cjs → index-DD71JxVQ.cjs} +1 -1
  23. package/dist/{index-3cVWcT47.js → index-DHPgQ7DA.js} +5 -5
  24. package/dist/{index-pGpGZ-zG.cjs → index-DO-nVcAG.cjs} +1 -1
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.es.js +6 -6
  27. package/dist/{order-gdnIl9fl.cjs → order-2fi-ASUJ.cjs} +1 -1
  28. package/dist/{order-CfWBV151.js → order-P0fQ9MtH.js} +17 -17
  29. package/dist/src/builder/components/SidebarTheme/index.d.ts +1 -4
  30. package/dist/src/ui/ItemsSettings/popup.d.ts +6 -1
  31. package/dist/style.css +1 -1
  32. package/dist/{subscription-CKzWjY6c.cjs → subscription-BXILybzC.cjs} +1 -1
  33. package/dist/{subscription-DvtuQ1Gv.js → subscription-S3Q0J-LT.js} +7 -7
  34. package/dist/{ticket-DsTC46Fo.js → ticket-CF6WDvC5.js} +5 -5
  35. package/dist/{ticket-ZqwqBmci.cjs → ticket-D67XjuXI.cjs} +1 -1
  36. package/dist/{top-up-BV-1a3uD.cjs → top-up-Cl5gOjYY.cjs} +1 -1
  37. package/dist/{top-up-DYFlVzcS.js → top-up-DkwIdCFZ.js} +5 -5
  38. package/dist/{ui-components-C-CMo5C7.js → ui-components-CNP0TL7h.js} +304 -289
  39. package/dist/ui-components-DnpGt0Lr.cjs +1 -0
  40. package/dist/ui.cjs.js +1 -1
  41. package/dist/ui.es.js +1 -1
  42. package/dist/{validation-DKeEzJKR.js → validation-C8mTX1VQ.js} +8 -8
  43. package/dist/{validation-DOgf6jMh.cjs → validation-CFXeO04y.cjs} +1 -1
  44. package/package.json +1 -1
  45. package/dist/ui-components-C4tsxCG_.cjs +0 -1
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./builder.cjs.js"),c=require("./builder-CuCcIZjx.cjs"),u=require("react/jsx-runtime"),d=require("react"),e=require("./ui-components-C4tsxCG_.cjs");require("./builder-components-D8fl8nFz.cjs");const r=require("./charge-D2IfRJ1B.cjs");require("react-dom");const t=require("./ticket-ZqwqBmci.cjs");function I(o){d.useEffect(()=>{Object.entries(o).forEach(([s,i])=>{e.registerIcon(s,i)})},[o])}function f(o){Object.entries(o).forEach(([s,i])=>{e.registerIcon(s,i)})}function l(o){return o.endsWith("Icon")?o.slice(0,-4):o}function g(o,s=20,i=!0){return o.map(n=>({value:i?l(n):n,addon:u.jsx(e.Icon,{name:n,width:s,height:s,showPlaceholder:!0})}))}exports.App=a.App;exports.AntistockRoutes=c.AntistockRoutes;exports.Routes=c.Routes;exports.formatPrice=c.formatPrice;exports.Icon=e.Icon;exports.addIconSuffix=e.addIconSuffix;exports.getRegisteredIcon=e.getRegisteredIcon;exports.getRegisteredIcons=e.getRegisteredIcons;exports.isIconRegistered=e.isIconRegistered;exports.loadIcon=e.loadIcon;exports.registerIcon=e.registerIcon;exports.stripIconSuffix=e.stripIconSuffix;exports.useDynamicIconRegistration=e.useDynamicIconRegistration;exports.MarkdownText=r.MarkdownText;exports.ReCaptchaProvider=r.ReCaptchaProvider;exports.parseDraftJsText=r.parseDraftJsText;exports.useCart=r.useCart;exports.useGeneralInfo=r.useGeneralInfo;exports.useMarkdownIt=r.useMarkdownIt;exports.useReCaptcha=r.useReCaptcha;exports.ColorVariables=t.ColorVariables;exports.aspectRatioOptions=t.aspectRatioOptions;exports.hotReload=t.hotReload;exports.iconNames=t.iconNames;exports.removeNotification=t.removeNotification;exports.showNotification=t.showNotification;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useAdaptiveStyles=t.useAdaptiveStyles;exports.useBalance=t.useBalance;exports.useBuilderPages=t.useBuilderPages;exports.useCreateTicket=t.useCreateTicket;exports.createIconLeftAddons=g;exports.registerIcons=f;exports.useIconRegistration=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./builder.cjs.js"),c=require("./builder--8Ry7cQ4.cjs"),u=require("react/jsx-runtime"),d=require("react"),e=require("./ui-components-DnpGt0Lr.cjs");require("./builder-components-Bgg9F62l.cjs");const r=require("./charge-DywF6LWF.cjs");require("react-dom");const t=require("./ticket-D67XjuXI.cjs");function I(o){d.useEffect(()=>{Object.entries(o).forEach(([s,i])=>{e.registerIcon(s,i)})},[o])}function f(o){Object.entries(o).forEach(([s,i])=>{e.registerIcon(s,i)})}function l(o){return o.endsWith("Icon")?o.slice(0,-4):o}function g(o,s=20,i=!0){return o.map(n=>({value:i?l(n):n,addon:u.jsx(e.Icon,{name:n,width:s,height:s,showPlaceholder:!0})}))}exports.App=a.App;exports.AntistockRoutes=c.AntistockRoutes;exports.Routes=c.Routes;exports.formatPrice=c.formatPrice;exports.Icon=e.Icon;exports.addIconSuffix=e.addIconSuffix;exports.getRegisteredIcon=e.getRegisteredIcon;exports.getRegisteredIcons=e.getRegisteredIcons;exports.isIconRegistered=e.isIconRegistered;exports.loadIcon=e.loadIcon;exports.registerIcon=e.registerIcon;exports.stripIconSuffix=e.stripIconSuffix;exports.useDynamicIconRegistration=e.useDynamicIconRegistration;exports.MarkdownText=r.MarkdownText;exports.ReCaptchaProvider=r.ReCaptchaProvider;exports.parseDraftJsText=r.parseDraftJsText;exports.useCart=r.useCart;exports.useGeneralInfo=r.useGeneralInfo;exports.useMarkdownIt=r.useMarkdownIt;exports.useReCaptcha=r.useReCaptcha;exports.ColorVariables=t.ColorVariables;exports.aspectRatioOptions=t.aspectRatioOptions;exports.hotReload=t.hotReload;exports.iconNames=t.iconNames;exports.removeNotification=t.removeNotification;exports.showNotification=t.showNotification;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useAdaptiveStyles=t.useAdaptiveStyles;exports.useBalance=t.useBalance;exports.useBuilderPages=t.useBuilderPages;exports.useCreateTicket=t.useCreateTicket;exports.createIconLeftAddons=g;exports.registerIcons=f;exports.useIconRegistration=I;
package/dist/index.es.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { App as R } from "./builder.es.js";
2
- import { Y as v, Z as w, _ as b } from "./builder-Vw17cIvh.js";
2
+ import { Y as v, Z as w, _ as b } from "./builder-DJQh1c1e.js";
3
3
  import { jsx as r } from "react/jsx-runtime";
4
4
  import { useEffect as i } from "react";
5
- import { r as o, I as n } from "./ui-components-C-CMo5C7.js";
6
- import { v as A, o as P, q as S, p as T, s as j, t as E, n as M } from "./ui-components-C-CMo5C7.js";
7
- import "./builder-components-CqsarjiD.js";
8
- import { M as y, G as B, J as D, u as G, I as J, K as q, H } from "./charge-BxH20YHb.js";
5
+ import { r as o, I as n } from "./ui-components-CNP0TL7h.js";
6
+ import { v as A, o as P, q as S, p as T, s as j, t as E, n as M } from "./ui-components-CNP0TL7h.js";
7
+ import "./builder-components-CpOz_SUG.js";
8
+ import { M as y, G as B, J as D, u as G, I as J, K as q, H } from "./charge-z48cLi-k.js";
9
9
  import "react-dom";
10
- import { C as L, c as V, h as W, i as Y, r as Z, d as _, s as F, u as Q, e as U, b as X, a as $ } from "./ticket-DsTC46Fo.js";
10
+ import { C as L, c as V, h as W, i as Y, r as Z, d as _, s as F, u as Q, e as U, b as X, a as $ } from "./ticket-CF6WDvC5.js";
11
11
  function m(e) {
12
12
  i(() => {
13
13
  Object.entries(e).forEach(([s, t]) => {
@@ -1 +1 @@
1
- "use strict";const t=require("react/jsx-runtime"),r=require("react"),O=require("./builder-CuCcIZjx.cjs"),s=require("./charge-D2IfRJ1B.cjs"),C=require("./ui-components-C4tsxCG_.cjs");require("./builder-components-D8fl8nFz.cjs");require("react-dom");require("./ticket-ZqwqBmci.cjs");const K=async(n=1)=>await s.fetchOrders({PageNumber:n}),Q=()=>{const[n,l]=r.useState(null),[d,e]=r.useState(null),[p,g]=r.useState(0),{page:m}=O.usePaginationPagesStore(),[f,_]=r.useState(!0);async function j(){_(!0);const{list:S,totalCount:u}=await K(m);l(S),g(u),e(null),_(!1)}async function y(){const S=(n==null?void 0:n.map(c=>c.gatewayName))||[],u=await s.getGatewaysDetail(S);e(u)}return r.useEffect(()=>{!d&&n&&y()},[n,d]),r.useEffect(()=>{j()},[m]),t.jsx(t.Fragment,{children:n!=null&&n.length&&n.length===0?t.jsx(s.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(s.PageTitle,{title:"Orders"}),t.jsx(s.OrdersTable,{orders:n,gatewaysDetail:d,totalCount:p,isLoading:f})]})})},X="_orderPage_gc87l_1",Y="_leftSection_gc87l_15",Z="_content_gc87l_35",ee="_main_gc87l_42",te="_mainAntistock_gc87l_56",se="_orderMainDataAntistock_gc87l_69",ne="_timelineBlockAntistock_gc87l_81",ae="_footerAntistock_gc87l_92",oe="_statusBlock_gc87l_104",ie="_timelineBlock_gc87l_81",ce="_footer_gc87l_92",re="_rightSection_gc87l_121",le="_header_gc87l_142",ue="_productList_gc87l_150",de="_mobileFooter_gc87l_157",me="_loaderContainer_gc87l_166",he="_orderMainData_gc87l_69",ge="_prices_gc87l_181",fe="_headerTitle_gc87l_185",pe="_headerDescription_gc87l_189",i={orderPage:X,leftSection:Y,content:Z,main:ee,mainAntistock:te,orderMainDataAntistock:se,timelineBlockAntistock:ne,footerAntistock:ae,statusBlock:oe,timelineBlock:ie,footer:ce,rightSection:re,header:le,productList:ue,mobileFooter:de,loaderContainer:me,orderMainData:he,prices:ge,headerTitle:fe,headerDescription:pe},_e=n=>{if(!n)return null;const l=n.split(":");if(l.length!==3)return null;const[d,e,p]=l,g=Number(d),m=Number(e),f=Number(p);return Number.isNaN(g)||Number.isNaN(m)||Number.isNaN(f)?null:((g*60+m)*60+f)*1e3},ye=()=>{var A,R,M,T,F,E,I,V,B;const{id:n,accessToken:l}=O.useParams(),d=O.useNavigate(),[e,p]=r.useState(),[g,m]=r.useState(!1),[f,_]=r.useState(!1),[j,y]=r.useState(!1),S=s.useCopy(),{isAntistock:u,general:c}=O.useGeneralStore(),G=((A=e==null?void 0:e.rawPrice)==null?void 0:A.currency)||"USD",U=new Intl.NumberFormat("en-US",{style:"currency",currency:G}),D=r.useMemo(()=>{var h;const a=_e((e==null?void 0:e.estimatedProcessingTime)??null),N=(h=e==null?void 0:e.timeline)==null?void 0:h[s.OrderStatus.Processing],P=(e==null?void 0:e.status)===s.OrderStatus.Processing&&N&&a?{processingStartTime:new Date(N),expectedProcessingMs:a,processingExpiresAt:e!=null&&e.processingExpiresAt?new Date(e.processingExpiresAt):void 0}:null;return(e==null?void 0:e.partOrders.map(o=>{var x,$,q;return{id:Number((x=o.productWithVariant)==null?void 0:x.id)||0,partOrderId:Number(o==null?void 0:o.id)||0,image:o.productWithVariant.image,name:(()=>{var L,W;const v=((L=o.productWithVariant)==null?void 0:L.name)||"",k=((W=o.productWithVariant)==null?void 0:W.variantName)||"";return!v&&!k?"":!k||v===k?v:v?`${v} (${k})`:k})(),description:"",price:{quantity:o.quantity,amount:(($=o.productWithVariant)==null?void 0:$.price.amount)||0,currency:(q=o.productWithVariant)==null?void 0:q.price.currency},deliveryCategories:"deliveryCategories"in o?o.deliveryCategories:void 0,customerNote:o.customerNote,chargeType:o.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in o?o.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in o?o.allowedReplacementReasons:void 0,processingInfo:P}}))||[]},[e]);r.useEffect(()=>{e&&(e.status===s.OrderStatus.FullDeliveryFailure||e.status===s.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&_(!0)},[e==null?void 0:e.status]);const w=r.useCallback(async(a,N,P=!1)=>{var o,x;P||m(!0);const{data:h}=await(N?s.fetchAuthorizedOrder(`${a}/${N}`):s.fetchOrder(a));m(!1),h.status!==s.OrderStatus.Completed&&((o=h.charge)==null?void 0:o.status)===s.ChargeStatus.NotPaid&&d(`/charges/${(x=h.charge)==null?void 0:x.id}`,{replace:!0}),p(h)},[d]);r.useLayoutEffect(()=>{if(n&&!l){const a=JSON.parse(localStorage.getItem("orders")||"{}");a[n]&&d(`/orders/${n}/${a[n].fullAccessToken}`)}},[n,l,d]),r.useEffect(()=>{n&&w(n,l,!0);const a=setInterval(()=>{n&&w(n,l,!0)},5e3);return()=>{clearInterval(a)}},[n,l,w]);const z=r.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===s.OrderStatus.Completed||e.status===s.OrderStatus.PartiallyDelivered||e.status===s.OrderStatus.FullDeliveryFailure)),[e]),b=r.useMemo(()=>{var a;return!!((a=c==null?void 0:c.info)!=null&&a.isVouchesEnabled&&l&&((e==null?void 0:e.status)===s.OrderStatus.Completed||(e==null?void 0:e.status)===s.OrderStatus.FullDeliveryFailure||(e==null?void 0:e.status)===s.OrderStatus.PartiallyDelivered))},[(R=c==null?void 0:c.info)==null?void 0:R.isVouchesEnabled,l]),H=r.useMemo(()=>{var a;return!!(!((a=c==null?void 0:c.info)!=null&&a.isVouchesEnabled)&&(e!=null&&e.review)&&"accessToken"in e.review&&!u)},[(M=c==null?void 0:c.info)==null?void 0:M.isVouchesEnabled,e==null?void 0:e.review,u]),J=r.useMemo(()=>{var a;return((a=c==null?void 0:c.info)==null?void 0:a.domain)||window.location.hostname},[(T=c==null?void 0:c.info)==null?void 0:T.domain]);return g?t.jsx("div",{className:i.loaderContainer,children:t.jsx(C.Loader,{})}):(console.log("ORDER PAGE"),console.log(e),t.jsxs("div",{className:i.orderPage,children:[t.jsx("div",{className:i.leftSection,children:t.jsxs("div",{className:i.content,children:[t.jsx(s.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${i.main} ${u?i.mainAntistock:""}`,children:[t.jsx(s.OrderStatusBlock,{className:i.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${i.orderMainData} ${u?i.orderMainDataAntistock:""}`,children:[b&&t.jsx(s.VouchCard,{onAddMessage:()=>y(!0),isVouchLeft:e.isVouchLeft}),t.jsx(s.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(F=e.charge)==null?void 0:F.gateway,email:e.customer?e.customer.email:((E=e.charge)==null?void 0:E.customerForCharge.email)||"",orderId:e.id}),H&&e.review&&t.jsx(s.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(s.TrackPayment,{className:`${i.timelineBlock} ${u?i.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(s.CheckoutFooter,{className:`${i.footer} ${u?i.footerAntistock:""}`})]})]})}),t.jsx("div",{className:i.rightSection,style:u?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:i.content,children:[((I=e==null?void 0:e.charge)==null?void 0:I.name)&&t.jsxs("header",{className:i.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:i.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:i.headerDescription,children:e.charge.description})]}),u?null:t.jsxs(C.Button,{type:"Secondary",onClick:()=>S((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(C.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:i.productList,children:D.map(a=>t.jsx(s.CheckoutProduct,{product:a,isOrder:!0,isApplicableForReplacement:z,orderId:n,accessToken:l,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},a.id))}),u?null:t.jsx(s.CheckoutPrices,{formatter:U,coupon:null,total:((V=e==null?void 0:e.endPrice)==null?void 0:V.amount)||0,discount:0,totalWithDiscount:((B=e==null?void 0:e.endPrice)==null?void 0:B.amount)||0,className:i.prices,isShowSubtotal:!1}),t.jsx(s.CheckoutFooter,{className:i.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(s.RefundNotificationModal,{isOpen:f,onClose:()=>_(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency}),b&&t.jsx(s.VouchModal,{isOpen:j,onClose:()=>y(!1),products:D,orderId:n,accessToken:l,shopDomain:J,onSuccess:()=>{y(!1),n&&w(n,l,!0)}})]}))},Se=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:ye},Symbol.toStringTag,{value:"Module"}));exports.Orders=Q;exports.index=Se;
1
+ "use strict";const t=require("react/jsx-runtime"),r=require("react"),O=require("./builder--8Ry7cQ4.cjs"),s=require("./charge-DywF6LWF.cjs"),C=require("./ui-components-DnpGt0Lr.cjs");require("./builder-components-Bgg9F62l.cjs");require("react-dom");require("./ticket-D67XjuXI.cjs");const K=async(n=1)=>await s.fetchOrders({PageNumber:n}),Q=()=>{const[n,l]=r.useState(null),[d,e]=r.useState(null),[p,g]=r.useState(0),{page:m}=O.usePaginationPagesStore(),[f,_]=r.useState(!0);async function j(){_(!0);const{list:S,totalCount:u}=await K(m);l(S),g(u),e(null),_(!1)}async function y(){const S=(n==null?void 0:n.map(c=>c.gatewayName))||[],u=await s.getGatewaysDetail(S);e(u)}return r.useEffect(()=>{!d&&n&&y()},[n,d]),r.useEffect(()=>{j()},[m]),t.jsx(t.Fragment,{children:n!=null&&n.length&&n.length===0?t.jsx(s.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(s.PageTitle,{title:"Orders"}),t.jsx(s.OrdersTable,{orders:n,gatewaysDetail:d,totalCount:p,isLoading:f})]})})},X="_orderPage_gc87l_1",Y="_leftSection_gc87l_15",Z="_content_gc87l_35",ee="_main_gc87l_42",te="_mainAntistock_gc87l_56",se="_orderMainDataAntistock_gc87l_69",ne="_timelineBlockAntistock_gc87l_81",ae="_footerAntistock_gc87l_92",oe="_statusBlock_gc87l_104",ie="_timelineBlock_gc87l_81",ce="_footer_gc87l_92",re="_rightSection_gc87l_121",le="_header_gc87l_142",ue="_productList_gc87l_150",de="_mobileFooter_gc87l_157",me="_loaderContainer_gc87l_166",he="_orderMainData_gc87l_69",ge="_prices_gc87l_181",fe="_headerTitle_gc87l_185",pe="_headerDescription_gc87l_189",i={orderPage:X,leftSection:Y,content:Z,main:ee,mainAntistock:te,orderMainDataAntistock:se,timelineBlockAntistock:ne,footerAntistock:ae,statusBlock:oe,timelineBlock:ie,footer:ce,rightSection:re,header:le,productList:ue,mobileFooter:de,loaderContainer:me,orderMainData:he,prices:ge,headerTitle:fe,headerDescription:pe},_e=n=>{if(!n)return null;const l=n.split(":");if(l.length!==3)return null;const[d,e,p]=l,g=Number(d),m=Number(e),f=Number(p);return Number.isNaN(g)||Number.isNaN(m)||Number.isNaN(f)?null:((g*60+m)*60+f)*1e3},ye=()=>{var A,R,M,T,F,E,I,V,B;const{id:n,accessToken:l}=O.useParams(),d=O.useNavigate(),[e,p]=r.useState(),[g,m]=r.useState(!1),[f,_]=r.useState(!1),[j,y]=r.useState(!1),S=s.useCopy(),{isAntistock:u,general:c}=O.useGeneralStore(),G=((A=e==null?void 0:e.rawPrice)==null?void 0:A.currency)||"USD",U=new Intl.NumberFormat("en-US",{style:"currency",currency:G}),D=r.useMemo(()=>{var h;const a=_e((e==null?void 0:e.estimatedProcessingTime)??null),N=(h=e==null?void 0:e.timeline)==null?void 0:h[s.OrderStatus.Processing],P=(e==null?void 0:e.status)===s.OrderStatus.Processing&&N&&a?{processingStartTime:new Date(N),expectedProcessingMs:a,processingExpiresAt:e!=null&&e.processingExpiresAt?new Date(e.processingExpiresAt):void 0}:null;return(e==null?void 0:e.partOrders.map(o=>{var x,$,q;return{id:Number((x=o.productWithVariant)==null?void 0:x.id)||0,partOrderId:Number(o==null?void 0:o.id)||0,image:o.productWithVariant.image,name:(()=>{var L,W;const v=((L=o.productWithVariant)==null?void 0:L.name)||"",k=((W=o.productWithVariant)==null?void 0:W.variantName)||"";return!v&&!k?"":!k||v===k?v:v?`${v} (${k})`:k})(),description:"",price:{quantity:o.quantity,amount:(($=o.productWithVariant)==null?void 0:$.price.amount)||0,currency:(q=o.productWithVariant)==null?void 0:q.price.currency},deliveryCategories:"deliveryCategories"in o?o.deliveryCategories:void 0,customerNote:o.customerNote,chargeType:o.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in o?o.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in o?o.allowedReplacementReasons:void 0,processingInfo:P}}))||[]},[e]);r.useEffect(()=>{e&&(e.status===s.OrderStatus.FullDeliveryFailure||e.status===s.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&_(!0)},[e==null?void 0:e.status]);const w=r.useCallback(async(a,N,P=!1)=>{var o,x;P||m(!0);const{data:h}=await(N?s.fetchAuthorizedOrder(`${a}/${N}`):s.fetchOrder(a));m(!1),h.status!==s.OrderStatus.Completed&&((o=h.charge)==null?void 0:o.status)===s.ChargeStatus.NotPaid&&d(`/charges/${(x=h.charge)==null?void 0:x.id}`,{replace:!0}),p(h)},[d]);r.useLayoutEffect(()=>{if(n&&!l){const a=JSON.parse(localStorage.getItem("orders")||"{}");a[n]&&d(`/orders/${n}/${a[n].fullAccessToken}`)}},[n,l,d]),r.useEffect(()=>{n&&w(n,l,!0);const a=setInterval(()=>{n&&w(n,l,!0)},5e3);return()=>{clearInterval(a)}},[n,l,w]);const z=r.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===s.OrderStatus.Completed||e.status===s.OrderStatus.PartiallyDelivered||e.status===s.OrderStatus.FullDeliveryFailure)),[e]),b=r.useMemo(()=>{var a;return!!((a=c==null?void 0:c.info)!=null&&a.isVouchesEnabled&&l&&((e==null?void 0:e.status)===s.OrderStatus.Completed||(e==null?void 0:e.status)===s.OrderStatus.FullDeliveryFailure||(e==null?void 0:e.status)===s.OrderStatus.PartiallyDelivered))},[(R=c==null?void 0:c.info)==null?void 0:R.isVouchesEnabled,l]),H=r.useMemo(()=>{var a;return!!(!((a=c==null?void 0:c.info)!=null&&a.isVouchesEnabled)&&(e!=null&&e.review)&&"accessToken"in e.review&&!u)},[(M=c==null?void 0:c.info)==null?void 0:M.isVouchesEnabled,e==null?void 0:e.review,u]),J=r.useMemo(()=>{var a;return((a=c==null?void 0:c.info)==null?void 0:a.domain)||window.location.hostname},[(T=c==null?void 0:c.info)==null?void 0:T.domain]);return g?t.jsx("div",{className:i.loaderContainer,children:t.jsx(C.Loader,{})}):(console.log("ORDER PAGE"),console.log(e),t.jsxs("div",{className:i.orderPage,children:[t.jsx("div",{className:i.leftSection,children:t.jsxs("div",{className:i.content,children:[t.jsx(s.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${i.main} ${u?i.mainAntistock:""}`,children:[t.jsx(s.OrderStatusBlock,{className:i.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${i.orderMainData} ${u?i.orderMainDataAntistock:""}`,children:[b&&t.jsx(s.VouchCard,{onAddMessage:()=>y(!0),isVouchLeft:e.isVouchLeft}),t.jsx(s.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(F=e.charge)==null?void 0:F.gateway,email:e.customer?e.customer.email:((E=e.charge)==null?void 0:E.customerForCharge.email)||"",orderId:e.id}),H&&e.review&&t.jsx(s.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(s.TrackPayment,{className:`${i.timelineBlock} ${u?i.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(s.CheckoutFooter,{className:`${i.footer} ${u?i.footerAntistock:""}`})]})]})}),t.jsx("div",{className:i.rightSection,style:u?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:i.content,children:[((I=e==null?void 0:e.charge)==null?void 0:I.name)&&t.jsxs("header",{className:i.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:i.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:i.headerDescription,children:e.charge.description})]}),u?null:t.jsxs(C.Button,{type:"Secondary",onClick:()=>S((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(C.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:i.productList,children:D.map(a=>t.jsx(s.CheckoutProduct,{product:a,isOrder:!0,isApplicableForReplacement:z,orderId:n,accessToken:l,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},a.id))}),u?null:t.jsx(s.CheckoutPrices,{formatter:U,coupon:null,total:((V=e==null?void 0:e.endPrice)==null?void 0:V.amount)||0,discount:0,totalWithDiscount:((B=e==null?void 0:e.endPrice)==null?void 0:B.amount)||0,className:i.prices,isShowSubtotal:!1}),t.jsx(s.CheckoutFooter,{className:i.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(s.RefundNotificationModal,{isOpen:f,onClose:()=>_(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency}),b&&t.jsx(s.VouchModal,{isOpen:j,onClose:()=>y(!1),products:D,orderId:n,accessToken:l,shopDomain:J,onSuccess:()=>{y(!1),n&&w(n,l,!0)}})]}))},Se=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:ye},Symbol.toStringTag,{value:"Module"}));exports.Orders=Q;exports.index=Se;
@@ -1,11 +1,11 @@
1
1
  import { jsx as s, Fragment as G, jsxs as m } from "react/jsx-runtime";
2
2
  import r, { useState as Q, useMemo as b } from "react";
3
- import { X as Y, a8 as Z, p as ee, K as te } from "./builder-Vw17cIvh.js";
4
- import { f as se, N as ae, P as oe, O as ne, g as ie, b as ce, c as u, d as re, e as le, h as ue, i as de, j as me, V as he, k as fe, L as pe, T as ge, l as U, m as _e, n as ye, R as Ne, o as ve } from "./charge-BxH20YHb.js";
5
- import { e as ke, g as Se, I as we } from "./ui-components-C-CMo5C7.js";
6
- import "./builder-components-CqsarjiD.js";
3
+ import { X as Y, a8 as Z, p as ee, z as te } from "./builder-DJQh1c1e.js";
4
+ import { f as se, N as ae, P as oe, O as ne, g as ie, b as ce, c as u, d as re, e as le, h as ue, i as de, j as me, V as he, k as fe, L as pe, T as ge, l as z, m as _e, n as ye, R as Ne, o as ve } from "./charge-z48cLi-k.js";
5
+ import { e as ke, g as Se, I as we } from "./ui-components-CNP0TL7h.js";
6
+ import "./builder-components-CpOz_SUG.js";
7
7
  import "react-dom";
8
- import "./ticket-DsTC46Fo.js";
8
+ import "./ticket-CF6WDvC5.js";
9
9
  const Pe = async (t = 1) => await se({ PageNumber: t }), tt = () => {
10
10
  const [t, c] = r.useState(null), [d, e] = Q(null), [_, p] = r.useState(0), { page: h } = Y(), [g, y] = r.useState(!0);
11
11
  async function O() {
@@ -60,20 +60,20 @@ const Pe = async (t = 1) => await se({ PageNumber: t }), tt = () => {
60
60
  prices: qe,
61
61
  headerTitle: je,
62
62
  headerDescription: Ge
63
- }, Ue = (t) => {
63
+ }, ze = (t) => {
64
64
  if (!t) return null;
65
65
  const c = t.split(":");
66
66
  if (c.length !== 3) return null;
67
67
  const [d, e, _] = c, p = Number(d), h = Number(e), g = Number(_);
68
68
  return Number.isNaN(p) || Number.isNaN(h) || Number.isNaN(g) ? null : ((p * 60 + h) * 60 + g) * 1e3;
69
- }, ze = () => {
69
+ }, Ue = () => {
70
70
  var M, T, I, V, E, B, F, L, $;
71
- const { id: t, accessToken: c } = Z(), d = ee(), [e, _] = r.useState(), [p, h] = r.useState(!1), [g, y] = r.useState(!1), [O, N] = r.useState(!1), v = ce(), { isAntistock: l, general: i } = te(), z = ((M = e == null ? void 0 : e.rawPrice) == null ? void 0 : M.currency) || "USD", H = new Intl.NumberFormat("en-US", {
71
+ const { id: t, accessToken: c } = Z(), d = ee(), [e, _] = r.useState(), [p, h] = r.useState(!1), [g, y] = r.useState(!1), [O, N] = r.useState(!1), v = ce(), { isAntistock: l, general: i } = te(), U = ((M = e == null ? void 0 : e.rawPrice) == null ? void 0 : M.currency) || "USD", H = new Intl.NumberFormat("en-US", {
72
72
  style: "currency",
73
- currency: z
73
+ currency: U
74
74
  }), C = r.useMemo(() => {
75
75
  var f;
76
- const a = Ue(
76
+ const a = ze(
77
77
  (e == null ? void 0 : e.estimatedProcessingTime) ?? null
78
78
  ), k = (f = e == null ? void 0 : e.timeline) == null ? void 0 : f[u.Processing], A = (e == null ? void 0 : e.status) === u.Processing && k && a ? {
79
79
  processingStartTime: new Date(k),
@@ -137,10 +137,10 @@ const Pe = async (t = 1) => await se({ PageNumber: t }), tt = () => {
137
137
  const J = b(() => !!(e != null && e.isApplicableForReplacement && (e.status === u.Completed || e.status === u.PartiallyDelivered || e.status === u.FullDeliveryFailure)), [e]), R = b(() => {
138
138
  var a;
139
139
  return !!((a = i == null ? void 0 : i.info) != null && a.isVouchesEnabled && c && ((e == null ? void 0 : e.status) === u.Completed || (e == null ? void 0 : e.status) === u.FullDeliveryFailure || (e == null ? void 0 : e.status) === u.PartiallyDelivered));
140
- }, [(T = i == null ? void 0 : i.info) == null ? void 0 : T.isVouchesEnabled, c]), K = b(() => {
140
+ }, [(T = i == null ? void 0 : i.info) == null ? void 0 : T.isVouchesEnabled, c]), X = b(() => {
141
141
  var a;
142
142
  return !!(!((a = i == null ? void 0 : i.info) != null && a.isVouchesEnabled) && (e != null && e.review) && "accessToken" in e.review && !l);
143
- }, [(I = i == null ? void 0 : i.info) == null ? void 0 : I.isVouchesEnabled, e == null ? void 0 : e.review, l]), X = b(() => {
143
+ }, [(I = i == null ? void 0 : i.info) == null ? void 0 : I.isVouchesEnabled, e == null ? void 0 : e.review, l]), K = b(() => {
144
144
  var a;
145
145
  return ((a = i == null ? void 0 : i.info) == null ? void 0 : a.domain) || window.location.hostname;
146
146
  }, [(V = i == null ? void 0 : i.info) == null ? void 0 : V.domain]);
@@ -176,7 +176,7 @@ const Pe = async (t = 1) => await se({ PageNumber: t }), tt = () => {
176
176
  orderId: e.id
177
177
  }
178
178
  ),
179
- K && e.review && /* @__PURE__ */ s(
179
+ X && e.review && /* @__PURE__ */ s(
180
180
  pe,
181
181
  {
182
182
  orderId: e.id,
@@ -194,7 +194,7 @@ const Pe = async (t = 1) => await se({ PageNumber: t }), tt = () => {
194
194
  }
195
195
  ),
196
196
  /* @__PURE__ */ s(
197
- U,
197
+ z,
198
198
  {
199
199
  className: `${n.footer} ${l ? n.footerAntistock : ""}`
200
200
  }
@@ -255,7 +255,7 @@ const Pe = async (t = 1) => await se({ PageNumber: t }), tt = () => {
255
255
  isShowSubtotal: !1
256
256
  }
257
257
  ),
258
- /* @__PURE__ */ s(U, { className: n.mobileFooter })
258
+ /* @__PURE__ */ s(z, { className: n.mobileFooter })
259
259
  ] })
260
260
  ] })
261
261
  }
@@ -277,7 +277,7 @@ const Pe = async (t = 1) => await se({ PageNumber: t }), tt = () => {
277
277
  products: C,
278
278
  orderId: t,
279
279
  accessToken: c,
280
- shopDomain: X,
280
+ shopDomain: K,
281
281
  onSuccess: () => {
282
282
  N(!1), t && D(t, c, !0);
283
283
  }
@@ -286,7 +286,7 @@ const Pe = async (t = 1) => await se({ PageNumber: t }), tt = () => {
286
286
  ] }));
287
287
  }, st = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
288
288
  __proto__: null,
289
- OrderPage: ze
289
+ OrderPage: Ue
290
290
  }, Symbol.toStringTag, { value: "Module" }));
291
291
  export {
292
292
  tt as O,
@@ -1,4 +1 @@
1
- interface Props {
2
- }
3
- export declare const SidebarTheme: React.FC<Props>;
4
- export {};
1
+ export declare const SidebarTheme: React.FC;
@@ -21,6 +21,11 @@ interface InputOption<T> {
21
21
  field: keyof T;
22
22
  placeholder?: string;
23
23
  }
24
+ interface SwitchOption<T> {
25
+ type: 'Switch';
26
+ label: string;
27
+ field: keyof T;
28
+ }
24
29
  interface InputSwitchOption<T> {
25
30
  type: 'inputSwitch';
26
31
  inputLabel?: string;
@@ -69,7 +74,7 @@ interface SelectTypeFontOption<T> {
69
74
  label?: string;
70
75
  field: keyof T;
71
76
  }
72
- export type ModalOption<T> = ImageOption<T> | TextOption<T> | InputOption<T> | InputSwitchOption<T> | ListOption<T> | SelectOption<T> | SelectInfiniteListOption<T> | SelectTypeFontOption<T>;
77
+ export type ModalOption<T> = ImageOption<T> | TextOption<T> | InputOption<T> | SwitchOption<T> | InputSwitchOption<T> | ListOption<T> | SelectOption<T> | SelectInfiniteListOption<T> | SelectTypeFontOption<T>;
73
78
  interface Props<T extends ItemBase> {
74
79
  activeItem: T;
75
80
  setActiveItem: (value: T | null) => void;