@billgangcom/theme-lib 1.121.0 → 1.122.0
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-CULKvuzI.js → builder-BDWYOk4o.js} +8 -6
- package/dist/{builder-GUSC-VqG.cjs → builder-DOCPzptl.cjs} +10 -10
- package/dist/{builder-components-DD74FeFy.cjs → builder-components-Bb96v4TW.cjs} +1 -1
- package/dist/{builder-components-Bh7Wzulo.js → builder-components-CvexDBBH.js} +4 -4
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +23 -23
- package/dist/{charge-D2D0KO0N.js → charge-C15xUj35.js} +8671 -8328
- package/dist/charge-CJQibcfu.cjs +115 -0
- package/dist/{checkout-DmVjQ7qL.js → checkout-BrL3RJUF.js} +5 -5
- package/dist/{checkout-BPim1kWl.cjs → checkout-CpzLu5oq.cjs} +1 -1
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-CyjdClPE.cjs → index-BHCz9QsY.cjs} +1 -1
- package/dist/{index-DmmQUpBX.js → index-BWWTIm1T.js} +2 -2
- package/dist/{index-DJeUikc5.cjs → index-Bxaj05Fb.cjs} +1 -1
- package/dist/{index-kAYyWOg3.cjs → index-C0e_BhGQ.cjs} +1 -1
- package/dist/{index-BSv52ixn.js → index-CaE8IYfM.js} +1 -1
- package/dist/{index-BGcK4oXQ.js → index-DNSijKmM.js} +5 -5
- package/dist/{index-CspqOvt6.js → index-DOXo55nb.js} +5 -5
- package/dist/{index-D3tHDwlB.cjs → index-DYH2kLjz.cjs} +1 -1
- package/dist/{index-Co6SbqR4.cjs → index-Dcnqy8X3.cjs} +1 -1
- package/dist/{index-DVRVUkVq.cjs → index-Duey4obm.cjs} +1 -1
- package/dist/{index-DhlWg3_R.js → index-LHU1sHHV.js} +5 -5
- package/dist/{index-CqJBTbYk.js → index-foFJrz8D.js} +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/{order-5WoovJR7.js → order-C-Ur9Jbh.js} +72 -72
- package/dist/order-DNKJ-JsD.cjs +1 -0
- package/dist/src/pages/api/index.d.ts +2 -0
- package/dist/src/storefront/api/apiKey.d.ts +2 -0
- package/dist/src/storefront/api/index.d.ts +1 -0
- package/dist/src/storefront/components/Sidebar/nav-list.d.ts +1 -0
- package/dist/src/storefront/constants/routes.d.ts +4 -2
- package/dist/src/storefront/store/useCustomerDashboardStore.d.ts +17 -0
- package/dist/style.css +1 -1
- package/dist/{subscription-DTxohDSL.cjs → subscription-B6uyLDB4.cjs} +1 -1
- package/dist/{subscription-CgYzqQq4.js → subscription-BySRgrl2.js} +5 -5
- package/dist/{ticket-DwzKY7OF.cjs → ticket-DWQeThhP.cjs} +2 -2
- package/dist/{ticket-BjAWQBHH.js → ticket-FYGZ32D-.js} +49 -48
- package/dist/{top-up-jTGvS5Wv.cjs → top-up-BO5_olGw.cjs} +1 -1
- package/dist/{top-up-C-TbJas2.js → top-up-IV8ZjQ3f.js} +5 -5
- package/dist/{ui-components-B0NcrAD7.cjs → ui-components-CencTE96.cjs} +1 -1
- package/dist/{ui-components-BKXG7k9L.js → ui-components-CiVZSTvC.js} +4 -4
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-BS6RZGb8.cjs → validation-2cuCf_Ob.cjs} +1 -1
- package/dist/{validation-BDVKIwl1.js → validation-D7cnZ3qf.js} +5 -5
- package/package.json +1 -1
- package/dist/charge--UEFO_yq.cjs +0 -109
- package/dist/order-BF9gce6B.cjs +0 -1
package/dist/order-BF9gce6B.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),r=require("react"),j=require("./builder-GUSC-VqG.cjs"),o=require("./charge--UEFO_yq.cjs"),b=require("./ui-components-B0NcrAD7.cjs");require("./builder-components-DD74FeFy.cjs");require("react-dom");require("./ticket-DwzKY7OF.cjs");const K=async(s=1)=>await o.fetchOrders({PageNumber:s}),Q=()=>{const[s,l]=r.useState(null),[d,e]=r.useState(null),[p,g]=r.useState(0),{page:m}=j.usePaginationPagesStore(),[f,_]=r.useState(!0);async function O(){_(!0);const{list:S,totalCount:u}=await K(m);l(S),g(u),e(null),_(!1)}async function y(){const S=(s==null?void 0:s.map(i=>i.gatewayName))||[],u=await o.getGatewaysDetail(S);e(u)}return r.useEffect(()=>{!d&&s&&y()},[s,d]),r.useEffect(()=>{O()},[m]),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: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",oe="_timelineBlockAntistock_gc87l_81",ne="_footerAntistock_gc87l_92",ae="_statusBlock_gc87l_104",ce="_timelineBlock_gc87l_81",ie="_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",c={orderPage:X,leftSection:Y,content:Z,main:ee,mainAntistock:te,orderMainDataAntistock:se,timelineBlockAntistock:oe,footerAntistock:ne,statusBlock:ae,timelineBlock:ce,footer:ie,rightSection:re,header:le,productList:ue,mobileFooter:de,loaderContainer:me,orderMainData:he,prices:ge,headerTitle:fe,headerDescription:pe},_e=s=>{if(!s)return null;const l=s.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 D,R,M,T,E,I,V,B,F;const{id:s,accessToken:l}=j.useParams(),d=j.useNavigate(),[e,p]=r.useState(),[g,m]=r.useState(!1),[f,_]=r.useState(!1),[O,y]=r.useState(!1),S=o.useCopy(),{isAntistock:u,general:i}=j.useGeneralStore(),G=((D=e==null?void 0:e.rawPrice)==null?void 0:D.currency)||"USD",U=new Intl.NumberFormat("en-US",{style:"currency",currency:G}),C=r.useMemo(()=>{var h;const n=_e((e==null?void 0:e.estimatedProcessingTime)??null),N=(h=e==null?void 0:e.timeline)==null?void 0:h[o.OrderStatus.Processing],P=(e==null?void 0:e.status)===o.OrderStatus.Processing&&N&&n?{processingStartTime:new Date(N),expectedProcessingMs:n,processingExpiresAt:e!=null&&e.processingExpiresAt?new Date(e.processingExpiresAt):void 0}:null;return(e==null?void 0:e.partOrders.map(a=>{var x,$,q;return{id:Number((x=a.productWithVariant)==null?void 0:x.id)||0,partOrderId:Number(a==null?void 0:a.id)||0,image:a.productWithVariant.image,name:(()=>{var L,W;const k=((L=a.productWithVariant)==null?void 0:L.name)||"",v=((W=a.productWithVariant)==null?void 0:W.variantName)||"";return!k&&!v?"":!v||k===v?k:k?`${k} (${v})`:v})(),description:"",price:{quantity:a.quantity,amount:(($=a.productWithVariant)==null?void 0:$.price.amount)||0,currency:(q=a.productWithVariant)==null?void 0:q.price.currency},deliveryCategories:"deliveryCategories"in a?a.deliveryCategories:void 0,customerNote:a.customerNote,chargeType:a.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in a?a.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in a?a.allowedReplacementReasons:void 0,processingInfo:P}}))||[]},[e]);r.useEffect(()=>{e&&(e.status===o.OrderStatus.FullDeliveryFailure||e.status===o.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&_(!0)},[e==null?void 0:e.status]);const w=r.useCallback(async(n,N,P=!1)=>{var a,x;P||m(!0);const{data:h}=await(N?o.fetchAuthorizedOrder(`${n}/${N}`):o.fetchOrder(n));m(!1),h.status!==o.OrderStatus.Completed&&((a=h.charge)==null?void 0:a.status)===o.ChargeStatus.NotPaid&&d(`/charges/${(x=h.charge)==null?void 0:x.id}`,{replace:!0}),p(h)},[d]);r.useLayoutEffect(()=>{if(s&&!l){const n=JSON.parse(localStorage.getItem("orders")||"{}");n[s]&&d(`/orders/${s}/${n[s].fullAccessToken}`)}},[s,l,d]),r.useEffect(()=>{s&&w(s,l,!0);const n=setInterval(()=>{s&&w(s,l,!0)},5e3);return()=>{clearInterval(n)}},[s,l,w]);const z=r.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===o.OrderStatus.Completed||e.status===o.OrderStatus.PartiallyDelivered||e.status===o.OrderStatus.FullDeliveryFailure)),[e]),A=r.useMemo(()=>{var n;return!!((n=i==null?void 0:i.info)!=null&&n.isVouchesEnabled&&l)},[(R=i==null?void 0:i.info)==null?void 0:R.isVouchesEnabled,l]),H=r.useMemo(()=>{var n;return!!(!((n=i==null?void 0:i.info)!=null&&n.isVouchesEnabled)&&(e!=null&&e.review)&&"accessToken"in e.review&&!u)},[(M=i==null?void 0:i.info)==null?void 0:M.isVouchesEnabled,e==null?void 0:e.review,u]),J=r.useMemo(()=>{var n;return((n=i==null?void 0:i.info)==null?void 0:n.domain)||window.location.hostname},[(T=i==null?void 0:i.info)==null?void 0:T.domain]);return g?t.jsx("div",{className:c.loaderContainer,children:t.jsx(b.Loader,{})}):(console.log("ORDER PAGE"),console.log(e),t.jsxs("div",{className:c.orderPage,children:[t.jsx("div",{className:c.leftSection,children:t.jsxs("div",{className:c.content,children:[t.jsx(o.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${c.main} ${u?c.mainAntistock:""}`,children:[t.jsx(o.OrderStatusBlock,{className:c.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${c.orderMainData} ${u?c.orderMainDataAntistock:""}`,children:[A&&t.jsx(o.VouchCard,{onAddMessage:()=>y(!0),isVouchLeft:e.isVouchLeft}),t.jsx(o.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(E=e.charge)==null?void 0:E.gateway,email:e.customer?e.customer.email:((I=e.charge)==null?void 0:I.customerForCharge.email)||"",orderId:e.id}),H&&e.review&&t.jsx(o.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(o.TrackPayment,{className:`${c.timelineBlock} ${u?c.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(o.CheckoutFooter,{className:`${c.footer} ${u?c.footerAntistock:""}`})]})]})}),t.jsx("div",{className:c.rightSection,style:u?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:c.content,children:[((V=e==null?void 0:e.charge)==null?void 0:V.name)&&t.jsxs("header",{className:c.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:c.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:c.headerDescription,children:e.charge.description})]}),u?null:t.jsxs(b.Button,{type:"Secondary",onClick:()=>S((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(b.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:c.productList,children:C.map(n=>t.jsx(o.CheckoutProduct,{product:n,isOrder:!0,isApplicableForReplacement:z,orderId:s,accessToken:l,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},n.id))}),u?null:t.jsx(o.CheckoutPrices,{formatter:U,coupon:null,total:((B=e==null?void 0:e.endPrice)==null?void 0:B.amount)||0,discount:0,totalWithDiscount:((F=e==null?void 0:e.endPrice)==null?void 0:F.amount)||0,className:c.prices,isShowSubtotal:!1}),t.jsx(o.CheckoutFooter,{className:c.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(o.RefundNotificationModal,{isOpen:f,onClose:()=>_(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency}),A&&t.jsx(o.VouchModal,{isOpen:O,onClose:()=>y(!1),products:C,orderId:s,accessToken:l,shopDomain:J,onSuccess:()=>{y(!1),s&&w(s,l,!0)}})]}))},Se=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:ye},Symbol.toStringTag,{value:"Module"}));exports.Orders=Q;exports.index=Se;
|