@billgangcom/theme-lib 1.117.3 → 1.117.5
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/README.md +2 -6
- package/dist/{builder-hB8NmH8C.cjs → builder-C6H1N4FP.cjs} +2 -2
- package/dist/{builder-ING-1TC5.js → builder-Dcp5JIX2.js} +5 -5
- package/dist/{builder-components-oKxTX6fj.cjs → builder-components-Bj_ecWtd.cjs} +2 -2
- package/dist/{builder-components-ClJQSJ2L.js → builder-components-D_-yBjUv.js} +4 -4
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +207 -205
- package/dist/{charge-C1osb-bm.cjs → charge-CDdwR76I.cjs} +1 -1
- package/dist/{charge-CuNPpaJ7.js → charge-_CEEL_lC.js} +6 -6
- package/dist/{checkout-DMKbVPtL.cjs → checkout-BY7eHMQg.cjs} +1 -1
- package/dist/{checkout-BnsWDYDl.js → checkout-LuD-xUEH.js} +5 -5
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-BiAMlV6S.js → index-6C0r0b28.js} +5 -5
- package/dist/{index-zDmFKbp8.cjs → index-C8knQe3w.cjs} +1 -1
- package/dist/{index-BMrIA4yw.js → index-CRXry6Nc.js} +1 -1
- package/dist/{index-lINjLxQX.cjs → index-Cyvdq9bC.cjs} +1 -1
- package/dist/{index-BFVW04-o.cjs → index-DOGDvdAe.cjs} +1 -1
- package/dist/{index-vFyF3Ow6.cjs → index-DU5qhu5H.cjs} +1 -1
- package/dist/{index-CDeg6Sk-.js → index-Dj9WbMhN.js} +5 -5
- package/dist/{index-BKrDDMuH.cjs → index-DlUuba7X.cjs} +1 -1
- package/dist/{index--_-vRaQR.js → index-Dnj_qRMe.js} +5 -5
- package/dist/{index-Dqp9j9qF.js → index-GWi3v3LH.js} +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +66 -44
- package/dist/{order-BqB3_Sr9.cjs → order-B2keJNN9.cjs} +1 -1
- package/dist/{order-BGMoWRhn.js → order-CRkNBk1l.js} +5 -5
- package/dist/src/assets/icons/index.d.ts +3 -0
- package/dist/src/constants/icon.d.ts +3 -2
- package/dist/src/hooks/useDynamicIconRegistration.d.ts +10 -0
- package/dist/src/ui/Icon/index.d.ts +5 -0
- package/dist/src/ui/SelectInfiniteList/index.d.ts +5 -0
- package/dist/src/ui/SelectSettings/index.d.ts +22 -0
- package/dist/src/ui/SelectSettings/utils/index.d.ts +2 -0
- package/dist/src/ui/index.d.ts +1 -0
- package/dist/src/utils/iconHelpers.d.ts +12 -0
- package/dist/src/utils/iconSelectHelpers.d.ts +35 -0
- package/dist/style.css +1 -1
- package/dist/{subscription-BYPJHXT2.js → subscription-qxCpanQb.js} +5 -5
- package/dist/{subscription-C27f2W_a.cjs → subscription-v64vRqA-.cjs} +1 -1
- package/dist/{ticket-eMmtCmvN.js → ticket-BK3fx1Sw.js} +5 -5
- package/dist/{ticket-Bru9-GYY.cjs → ticket-C-A_Ok9u.cjs} +1 -1
- package/dist/{top-up-CMpoWJbT.cjs → top-up-DCz_tgnE.cjs} +1 -1
- package/dist/{top-up-BbY79ujW.js → top-up-DvRo2FT6.js} +5 -5
- package/dist/ui-components-DD5zQkng.js +8390 -0
- package/dist/ui-components-DsX_DjBg.cjs +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +30 -29
- package/dist/{validation-CBWyX-kx.js → validation-Coc0Q-Ug.js} +5 -5
- package/dist/{validation-CtRwKk0C.cjs → validation-gGpkWETM.cjs} +1 -1
- package/package.json +1 -1
- package/dist/ui-components-BrBBLOj0.cjs +0 -1
- package/dist/ui-components-CmN3s0-4.js +0 -6542
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const b=require("./builder-hB8NmH8C.cjs"),i=require("react/jsx-runtime"),D=require("react"),v=require("./ui-components-BrBBLOj0.cjs"),Xc=require("./builder-components-oKxTX6fj.cjs"),Kc=require("./ticket-Bru9-GYY.cjs"),Qc=require("react-dom"),Jc=require("./order-BqB3_Sr9.cjs"),Kd=require("./subscription-C27f2W_a.cjs");function Qd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const fe=Qd(D),Jd=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,el=({children:e,className:t,as:n="span",...r})=>{const[u,a]=D.useState(!1);return D.useEffect(()=>{typeof window<"u"&&a(Jd())},[]),u?i.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):i.jsx(n,{className:t,...r,children:e})};async function e2(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await b.request({method:"get",url:r,withToken:!1})).data}const t2=async()=>{const e=b.useApiStore.getState().apiUrls,t=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await b.request({url:n,withToken:!0,method:"get"})},n2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},r2=async(e,t)=>{const r=`${b.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await b.request({url:r,method:"post",body:e,withToken:!1})},Ar=async e=>{const t=b.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},u2=()=>Ar("dash/info"),a2=()=>Ar("dash/dashboard/home"),s2=()=>Ar("rewards"),i2=()=>Ar("balance"),o2=()=>Ar("balance/top-up/settings"),c2=()=>Ar("referral-system"),Ws=e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return b.request({url:r,withToken:!1,method:"get"})},l2=()=>Ws("terms"),d2=()=>Ws("refund-policy"),f2=()=>Ws("privacy-policy"),_s=10,ua=async({url:e,PageNumber:t})=>{var o;const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${_s}`,a=await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),s=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:s}},aa=async(e,t="get",n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await b.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},h2=e=>aa("","post",e),p2=({PageNumber:e})=>ua({url:"customers/orders",PageNumber:e}),m2=e=>aa(e),g2=e=>aa(e),b2=(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v2/orders/${u}/${e}/${t}/replacement-requests`;return b.request({url:a,method:"post",withToken:!0,body:n,typeToken:"customer"})},tl=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/public/${n}/images`,u=new FormData;return u.append("file",e),b.request({url:r,method:"post",withToken:!1,body:u})},_2=(e,t,n)=>aa(`${e}/${t}/replacement-requests/${n}/cancel`,"post"),x2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await b.request({url:r,method:"post",withToken:!1,body:e})},C2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},E2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await b.request({url:u,method:"get",withToken:!1})},y2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await b.request({url:a,method:"post",withToken:!1,body:n})},T2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await b.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},k2=({PageNumber:e})=>ua({url:"customers/subscriptions",PageNumber:e}),A2=async({id:e,accessToken:t})=>await E2(e,t),S2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await b.request({url:u,method:"post",withToken:!1,body:t})},I2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},v2=async(e,t,n,r,u)=>{const a=b.useApiStore.getState().apiUrls,s=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${a.slApi}/v1/public/${s}/tickets/${e}/${t}/answer`;return(await b.request({url:o,method:"post",body:{message:n,recaptcha:r,tsId:u},withToken:!1})).data},N2=({PageNumber:e})=>ua({url:"customers/tickets",PageNumber:e}),w2=({PageNumber:e})=>ua({url:"customers/balance/transactions",PageNumber:e}),D2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},L2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await b.request({url:r,method:"get",withToken:!1})},P2=async e=>{const t=b.useApiStore.getState().apiUrls,n=e.map(s=>["names",s]),r=new URLSearchParams(n),u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await b.request({url:a,method:"get",withToken:!1})},yu=new Map,nl=async e=>{const t=b.useApiStore.getState().apiUrls,r=Array.from(new Set(e)).sort().map(l=>["names",l]),u=new URLSearchParams(r),a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${t.slApi}/v2/checkout?shopDomain=${a}&${u.toString()}`,o=`${s}`;if(yu.has(o))return yu.get(o);const c=b.request({url:s,method:"get",withToken:!1}).catch(l=>{throw yu.delete(o),l});return yu.set(o,c),c},rl=async({email:e,recaptcha:t,tsId:n})=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await b.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},ul=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=b.useApiStore.getState().apiUrls,a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await b.request({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return b.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},xs=async()=>{b.useStorefrontStore.getState().setToken(""),b.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},R2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:ul,logoutCustomer:xs,requestOtp:rl},Symbol.toStringTag,{value:"Module"})),O2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await b.request({url:r,method:"post",body:e,withToken:!1})},M2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await b.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},F2=async()=>{const{data:e}=await c2();return e},j2=async e=>{const{data:t}=await M2(e);return t},B2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},H2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await b.request({url:r,method:"get",withToken:!1})};async function U2(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return b.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const V2=async(e,t,n,r)=>{const a=`${b.useApiStore.getState().apiUrls.slApi}/v1/vouches/${t}/${n}/${r}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},Pa="Balance",On={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},$2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Ui=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const o=s.variants.find(h=>h.id===r);if(!o)throw new Error("Variant does not exist");if(a==="RECURRING"&&!o.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(u!==void 0&&((l=o.quantity)!=null&&l.available)&&o.quantity.available<u)throw new Error("Not enough quantity available");const c=b.useCartStore.getState().cart;if(c.parts.length>0){const h=e.find(m=>m.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===c.parts[0].productVariantId);if(f&&o.price.currency!==f.price.currency)throw new Error("Product have different currency")}return o},z2=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(u=>t>=u.amount);return n.length===0?0:n.reduce((u,a)=>a.amount>u.amount?a:u).percentage},q2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(g=>(g==null?void 0:g.id)===u.productId),s=a==null?void 0:a.variants.find(g=>g.id===u.productVariantId);if(!s)return;const{gateway:o}=b.useCartStore.getState().cart,c=(s==null?void 0:s.gateways)||[],l=c.some(g=>g.name===o&&g.overrodePrice)?(m=c.find(g=>g.name===o))==null?void 0:m.overrodePrice:null;let h=0,f=0;if(u.chargeType==="ONE_TIME"?(h=(l==null?void 0:l.amount)||(s==null?void 0:s.price.amount)||0,f=h*u.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((p=s.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const g=z2(s,u.quantity),x=f*(1-g/100);r+=x}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},Z2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),Vi=e=>new Set(e.gateways.map(t=>t.name)),Ra={availableGateways:[],requiresSignInGateways:[]},$i=(e,t)=>{if(t.length===0)return Ra;const n=e[0];if(!n)return Ra;const r=t.find(o=>o.id===n.productId),u=r==null?void 0:r.variants.find(o=>o.id===n.productVariantId);if(!u)return Ra;const a=Vi(u);for(const o of e){const c=t.find(f=>f.id===o.productId);if(!c)continue;const l=c.variants.find(f=>f.id===o.productVariantId);if(!l)continue;const h=Vi(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(Pa)?(a.delete(Pa),{availableGateways:[...a],requiresSignInGateways:[Pa]}):{availableGateways:[...a],requiresSignInGateways:[]}},zi=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const s=t.find(c=>c.id===a.productId),o=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,s)=>{const o=a[s.name];return o?(s.required&&!o.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},W2=(e,t)=>{const n=t.find(u=>u.id===e.productId),r=n==null?void 0:n.variants.find(u=>u.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},cu=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:s,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=b.useCartStore(),f=async x=>{var F;h(!0);const{cart:C}=b.useCartStore.getState(),{gateway:_,parts:N}=C,{notifications:T,setNotifications:L}=b.useNotificationStore.getState();_||(h(!1),L([...T,{message:"There should be a gateway for the coupon",status:"error",id:b.v4()}]));const S=N.map(Y=>Y.productId);let I=null;try{const{data:Y}=await O2({gateway:_,couponName:x,productIds:S});I=Y.data,L([...T,{message:"Coupon is applied",status:"success",id:b.v4()}]),s($=>({...$,coupon:x}))}catch(Y){const $=Y;L([...T,{message:`Coupon is not applied: ${$.message}`,status:"error",id:b.v4()}]),s(P=>({...P,coupon:null})),c(null),h(!1)}if(h(!1),(F=I==null?void 0:I.restrictToProductIds)!=null&&F.length&&!S.every(Y=>{var $;return($=I==null?void 0:I.restrictToProductIds)==null?void 0:$.includes(Y)}))throw new Error("Coupon can't be applied to such products");return c(I),I},g={reset(){s({...$2})},addProducts:x=>{const C=b.useCartStore.getState().products,_=x.filter(N=>!C.some(T=>T.id===N.id));o([...C,..._])},addProductToCart:x=>{const C=b.useCartStore.getState().cart;try{Ui(t,x)}catch(N){throw new Error(N)}const _=C.parts.find(N=>N.productId===x.productId&&N.productVariantId===x.productVariantId&&N.chargeType===x.chargeType);if(_)return g.updateQuantityOfProduct({..._,quantity:(_.quantity||1)+(x.quantity||1),chargeType:x.chargeType});if(C.parts.length&&$i([...C.parts,x],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...C,parts:[...C.parts,x]}),C.coupon&&f(C.coupon)},removeProduct({productId:x,productVariantId:C}){s(_=>({..._,parts:_.parts.filter(N=>N.productId!==x||N.productVariantId!==C)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return $i(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return Z2(t,e.parts)},updateQuantityOfProduct(x){Ui(t,x),s(C=>({...C,parts:C.parts.map(_=>_.productId===x.productId&&_.productVariantId===x.productVariantId?{..._,quantity:x.quantity,chargeType:x.chargeType}:_)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:x}=b.useCartStore.getState(),{total:C,totalWithVolumeDiscounts:_}=q2(e.parts,t);let N;const T=_;return x&&x.discount?!x.isFixed&&x.discount===100?N=0:N=x.isFixed?Math.max(0,T-x.discount):T*(1-x.discount/100):_!==C&&(N=_),{total:C,totalWithVolumeDiscounts:_!==C?_:void 0,totalWithDiscount:N}},setGateway(x){s(_=>({..._,gateway:x}));const{isAntistock:C}=b.useGeneralStore.getState();e.coupon&&!C&&f(e.coupon)},setPaymentMethod(x){s(C=>({...C,paymentMethod:x}))},async submitCart(x){l(!0);const{cart:C}=b.useCartStore.getState(),{discordInfo:_}=b.useDiscordStore.getState();let N;if(C.parts&&a&&W2(C.parts[0],t))try{const{data:T}=await x2({gateway:C.gateway,coupon:C.coupon,partOrder:C.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:_!=null&&_.authorized?_.id:null,customerEmail:a,recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId()});N=T.data}catch(T){console.error(T)}else try{const{data:T}=await h2({gateway:C.gateway,parts:[...C.parts],coupon:C.coupon,customerEmail:C.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId(),discordSocialConnectId:_!=null&&_.authorized?_.id:null,usePriorityReplacement:C.usePriorityReplacement===!0});N=T.data}catch(T){const L=T,{notifications:S,setNotifications:I}=b.useNotificationStore.getState();I([...S,{message:`Failed to create order: ${L.message}`,status:"error",id:b.v4()}])}if(l(!1),N)return N;throw new Error("Failed to create order")},setDiscordSocialConnectId(x){s(C=>({...C,discordSocialConnectId:x}))},setCustomFields(x){s(C=>({...C,customFields:{...x}}))}};return D.useEffect(()=>{s(x=>({...x,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...g}},rr=()=>{const{notifications:e,setNotifications:t}=b.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:b.v4()}])}};var Cs={exports:{}},Tu={exports:{}},He={};/** @license React v16.13.1
|
|
1
|
+
"use strict";const b=require("./builder-C6H1N4FP.cjs"),i=require("react/jsx-runtime"),D=require("react"),v=require("./ui-components-DsX_DjBg.cjs"),Xc=require("./builder-components-Bj_ecWtd.cjs"),Kc=require("./ticket-C-A_Ok9u.cjs"),Qc=require("react-dom"),Jc=require("./order-B2keJNN9.cjs"),Kd=require("./subscription-v64vRqA-.cjs");function Qd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const fe=Qd(D),Jd=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,el=({children:e,className:t,as:n="span",...r})=>{const[u,a]=D.useState(!1);return D.useEffect(()=>{typeof window<"u"&&a(Jd())},[]),u?i.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):i.jsx(n,{className:t,...r,children:e})};async function e2(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await b.request({method:"get",url:r,withToken:!1})).data}const t2=async()=>{const e=b.useApiStore.getState().apiUrls,t=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await b.request({url:n,withToken:!0,method:"get"})},n2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},r2=async(e,t)=>{const r=`${b.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await b.request({url:r,method:"post",body:e,withToken:!1})},Ar=async e=>{const t=b.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},u2=()=>Ar("dash/info"),a2=()=>Ar("dash/dashboard/home"),s2=()=>Ar("rewards"),i2=()=>Ar("balance"),o2=()=>Ar("balance/top-up/settings"),c2=()=>Ar("referral-system"),Ws=e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return b.request({url:r,withToken:!1,method:"get"})},l2=()=>Ws("terms"),d2=()=>Ws("refund-policy"),f2=()=>Ws("privacy-policy"),_s=10,ua=async({url:e,PageNumber:t})=>{var o;const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${_s}`,a=await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),s=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:s}},aa=async(e,t="get",n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await b.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},h2=e=>aa("","post",e),p2=({PageNumber:e})=>ua({url:"customers/orders",PageNumber:e}),m2=e=>aa(e),g2=e=>aa(e),b2=(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v2/orders/${u}/${e}/${t}/replacement-requests`;return b.request({url:a,method:"post",withToken:!0,body:n,typeToken:"customer"})},tl=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/public/${n}/images`,u=new FormData;return u.append("file",e),b.request({url:r,method:"post",withToken:!1,body:u})},_2=(e,t,n)=>aa(`${e}/${t}/replacement-requests/${n}/cancel`,"post"),x2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await b.request({url:r,method:"post",withToken:!1,body:e})},C2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},E2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await b.request({url:u,method:"get",withToken:!1})},y2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await b.request({url:a,method:"post",withToken:!1,body:n})},T2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await b.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},k2=({PageNumber:e})=>ua({url:"customers/subscriptions",PageNumber:e}),A2=async({id:e,accessToken:t})=>await E2(e,t),S2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await b.request({url:u,method:"post",withToken:!1,body:t})},I2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},v2=async(e,t,n,r,u)=>{const a=b.useApiStore.getState().apiUrls,s=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${a.slApi}/v1/public/${s}/tickets/${e}/${t}/answer`;return(await b.request({url:o,method:"post",body:{message:n,recaptcha:r,tsId:u},withToken:!1})).data},N2=({PageNumber:e})=>ua({url:"customers/tickets",PageNumber:e}),w2=({PageNumber:e})=>ua({url:"customers/balance/transactions",PageNumber:e}),D2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},L2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await b.request({url:r,method:"get",withToken:!1})},P2=async e=>{const t=b.useApiStore.getState().apiUrls,n=e.map(s=>["names",s]),r=new URLSearchParams(n),u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await b.request({url:a,method:"get",withToken:!1})},yu=new Map,nl=async e=>{const t=b.useApiStore.getState().apiUrls,r=Array.from(new Set(e)).sort().map(l=>["names",l]),u=new URLSearchParams(r),a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${t.slApi}/v2/checkout?shopDomain=${a}&${u.toString()}`,o=`${s}`;if(yu.has(o))return yu.get(o);const c=b.request({url:s,method:"get",withToken:!1}).catch(l=>{throw yu.delete(o),l});return yu.set(o,c),c},rl=async({email:e,recaptcha:t,tsId:n})=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await b.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},ul=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=b.useApiStore.getState().apiUrls,a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await b.request({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return b.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},xs=async()=>{b.useStorefrontStore.getState().setToken(""),b.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},R2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:ul,logoutCustomer:xs,requestOtp:rl},Symbol.toStringTag,{value:"Module"})),O2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await b.request({url:r,method:"post",body:e,withToken:!1})},M2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await b.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},F2=async()=>{const{data:e}=await c2();return e},j2=async e=>{const{data:t}=await M2(e);return t},B2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},H2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await b.request({url:r,method:"get",withToken:!1})};async function U2(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return b.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const V2=async(e,t,n,r)=>{const a=`${b.useApiStore.getState().apiUrls.slApi}/v1/vouches/${t}/${n}/${r}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},Pa="Balance",On={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},$2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Ui=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const o=s.variants.find(h=>h.id===r);if(!o)throw new Error("Variant does not exist");if(a==="RECURRING"&&!o.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(u!==void 0&&((l=o.quantity)!=null&&l.available)&&o.quantity.available<u)throw new Error("Not enough quantity available");const c=b.useCartStore.getState().cart;if(c.parts.length>0){const h=e.find(m=>m.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===c.parts[0].productVariantId);if(f&&o.price.currency!==f.price.currency)throw new Error("Product have different currency")}return o},z2=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(u=>t>=u.amount);return n.length===0?0:n.reduce((u,a)=>a.amount>u.amount?a:u).percentage},q2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(g=>(g==null?void 0:g.id)===u.productId),s=a==null?void 0:a.variants.find(g=>g.id===u.productVariantId);if(!s)return;const{gateway:o}=b.useCartStore.getState().cart,c=(s==null?void 0:s.gateways)||[],l=c.some(g=>g.name===o&&g.overrodePrice)?(m=c.find(g=>g.name===o))==null?void 0:m.overrodePrice:null;let h=0,f=0;if(u.chargeType==="ONE_TIME"?(h=(l==null?void 0:l.amount)||(s==null?void 0:s.price.amount)||0,f=h*u.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((p=s.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const g=z2(s,u.quantity),x=f*(1-g/100);r+=x}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},Z2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),Vi=e=>new Set(e.gateways.map(t=>t.name)),Ra={availableGateways:[],requiresSignInGateways:[]},$i=(e,t)=>{if(t.length===0)return Ra;const n=e[0];if(!n)return Ra;const r=t.find(o=>o.id===n.productId),u=r==null?void 0:r.variants.find(o=>o.id===n.productVariantId);if(!u)return Ra;const a=Vi(u);for(const o of e){const c=t.find(f=>f.id===o.productId);if(!c)continue;const l=c.variants.find(f=>f.id===o.productVariantId);if(!l)continue;const h=Vi(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(Pa)?(a.delete(Pa),{availableGateways:[...a],requiresSignInGateways:[Pa]}):{availableGateways:[...a],requiresSignInGateways:[]}},zi=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const s=t.find(c=>c.id===a.productId),o=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,s)=>{const o=a[s.name];return o?(s.required&&!o.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},W2=(e,t)=>{const n=t.find(u=>u.id===e.productId),r=n==null?void 0:n.variants.find(u=>u.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},cu=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:s,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=b.useCartStore(),f=async x=>{var F;h(!0);const{cart:C}=b.useCartStore.getState(),{gateway:_,parts:N}=C,{notifications:T,setNotifications:L}=b.useNotificationStore.getState();_||(h(!1),L([...T,{message:"There should be a gateway for the coupon",status:"error",id:b.v4()}]));const S=N.map(Y=>Y.productId);let I=null;try{const{data:Y}=await O2({gateway:_,couponName:x,productIds:S});I=Y.data,L([...T,{message:"Coupon is applied",status:"success",id:b.v4()}]),s($=>({...$,coupon:x}))}catch(Y){const $=Y;L([...T,{message:`Coupon is not applied: ${$.message}`,status:"error",id:b.v4()}]),s(P=>({...P,coupon:null})),c(null),h(!1)}if(h(!1),(F=I==null?void 0:I.restrictToProductIds)!=null&&F.length&&!S.every(Y=>{var $;return($=I==null?void 0:I.restrictToProductIds)==null?void 0:$.includes(Y)}))throw new Error("Coupon can't be applied to such products");return c(I),I},g={reset(){s({...$2})},addProducts:x=>{const C=b.useCartStore.getState().products,_=x.filter(N=>!C.some(T=>T.id===N.id));o([...C,..._])},addProductToCart:x=>{const C=b.useCartStore.getState().cart;try{Ui(t,x)}catch(N){throw new Error(N)}const _=C.parts.find(N=>N.productId===x.productId&&N.productVariantId===x.productVariantId&&N.chargeType===x.chargeType);if(_)return g.updateQuantityOfProduct({..._,quantity:(_.quantity||1)+(x.quantity||1),chargeType:x.chargeType});if(C.parts.length&&$i([...C.parts,x],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...C,parts:[...C.parts,x]}),C.coupon&&f(C.coupon)},removeProduct({productId:x,productVariantId:C}){s(_=>({..._,parts:_.parts.filter(N=>N.productId!==x||N.productVariantId!==C)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return $i(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return Z2(t,e.parts)},updateQuantityOfProduct(x){Ui(t,x),s(C=>({...C,parts:C.parts.map(_=>_.productId===x.productId&&_.productVariantId===x.productVariantId?{..._,quantity:x.quantity,chargeType:x.chargeType}:_)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:x}=b.useCartStore.getState(),{total:C,totalWithVolumeDiscounts:_}=q2(e.parts,t);let N;const T=_;return x&&x.discount?!x.isFixed&&x.discount===100?N=0:N=x.isFixed?Math.max(0,T-x.discount):T*(1-x.discount/100):_!==C&&(N=_),{total:C,totalWithVolumeDiscounts:_!==C?_:void 0,totalWithDiscount:N}},setGateway(x){s(_=>({..._,gateway:x}));const{isAntistock:C}=b.useGeneralStore.getState();e.coupon&&!C&&f(e.coupon)},setPaymentMethod(x){s(C=>({...C,paymentMethod:x}))},async submitCart(x){l(!0);const{cart:C}=b.useCartStore.getState(),{discordInfo:_}=b.useDiscordStore.getState();let N;if(C.parts&&a&&W2(C.parts[0],t))try{const{data:T}=await x2({gateway:C.gateway,coupon:C.coupon,partOrder:C.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:_!=null&&_.authorized?_.id:null,customerEmail:a,recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId()});N=T.data}catch(T){console.error(T)}else try{const{data:T}=await h2({gateway:C.gateway,parts:[...C.parts],coupon:C.coupon,customerEmail:C.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId(),discordSocialConnectId:_!=null&&_.authorized?_.id:null,usePriorityReplacement:C.usePriorityReplacement===!0});N=T.data}catch(T){const L=T,{notifications:S,setNotifications:I}=b.useNotificationStore.getState();I([...S,{message:`Failed to create order: ${L.message}`,status:"error",id:b.v4()}])}if(l(!1),N)return N;throw new Error("Failed to create order")},setDiscordSocialConnectId(x){s(C=>({...C,discordSocialConnectId:x}))},setCustomFields(x){s(C=>({...C,customFields:{...x}}))}};return D.useEffect(()=>{s(x=>({...x,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...g}},rr=()=>{const{notifications:e,setNotifications:t}=b.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:b.v4()}])}};var Cs={exports:{}},Tu={exports:{}},He={};/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { j as je, M as Qe, r as Ge, N as Gt, O as Xt, Q as pn, U as _s, V as hr, e as Lt, v as Ie, K as Ve, W as Cs, p as ln, f as te, X as wa, Y as Rr, Z as st, _ as Je, J as ut, $ as xt, b as C2, u as E2, a as Es, a0 as y2, a1 as T2, a2 as Iu, a3 as $i, a4 as x2, a5 as xo, a6 as Ll, a7 as ys, a8 as Da, a9 as k2 } from "./builder-
|
|
1
|
+
import { j as je, M as Qe, r as Ge, N as Gt, O as Xt, Q as pn, U as _s, V as hr, e as Lt, v as Ie, K as Ve, W as Cs, p as ln, f as te, X as wa, Y as Rr, Z as st, _ as Je, J as ut, $ as xt, b as C2, u as E2, a as Es, a0 as y2, a1 as T2, a2 as Iu, a3 as $i, a4 as x2, a5 as xo, a6 as Ll, a7 as ys, a8 as Da, a9 as k2 } from "./builder-Dcp5JIX2.js";
|
|
2
2
|
import { jsx as c, jsxs as b, Fragment as ze } from "react/jsx-runtime";
|
|
3
3
|
import * as pe from "react";
|
|
4
4
|
import Y, { useEffect as _n, forwardRef as Pl, createElement as ft, Component as A2, isValidElement as I2, useState as me, useRef as an, useCallback as Rl, useMemo as jn } from "react";
|
|
5
|
-
import { I as H, e as It, f as Cn, g as ue,
|
|
6
|
-
import { F as Bl } from "./builder-components-
|
|
7
|
-
import { T as Hl } from "./ticket-
|
|
5
|
+
import { I as H, e as It, f as Cn, g as ue, h as Ol, M as Pt, W as S2, i as Ml, j as Fl, k as Mu, l as ha, R as N2 } from "./ui-components-DD5zQkng.js";
|
|
6
|
+
import { F as Bl } from "./builder-components-D_-yBjUv.js";
|
|
7
|
+
import { T as Hl } from "./ticket-BK3fx1Sw.js";
|
|
8
8
|
import { createPortal as Ul } from "react-dom";
|
|
9
|
-
import { O as Vl } from "./order-
|
|
10
|
-
import { S as v2 } from "./subscription-
|
|
9
|
+
import { O as Vl } from "./order-CRkNBk1l.js";
|
|
10
|
+
import { S as v2 } from "./subscription-qxCpanQb.js";
|
|
11
11
|
const w2 = () => typeof document < "u" ? document.documentElement.hasAttribute("translated") || document.documentElement.querySelector(".translated-ltr, .translated-rtl") !== null || // Safari переводчик добавляет мета-тег с name="_translator"
|
|
12
12
|
document.head.querySelector('meta[name="_translator"]') !== null : !1, D2 = ({
|
|
13
13
|
children: e,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./charge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./charge-CDdwR76I.cjs"),u=require("./builder-C6H1N4FP.cjs"),l=require("react"),_=require("./ui-components-DsX_DjBg.cjs");require("./builder-components-Bj_ecWtd.cjs");require("./ticket-C-A_Ok9u.cjs");require("react-dom");const b="_checkoutContainer_thje1_1",S="_loaderContainer_thje1_20",s={checkoutContainer:b,loaderContainer:S},D=()=>{const{isAntistock:r}=u.useGeneralStore(),{cart:t,products:c,pending:d,getTotalAndDiscount:C,getPossibleGateways:h,submitCart:p,setGateway:m,applyCoupon:g,setDiscordSocialConnectId:j,setCustomFields:k,applyCouponPending:y,coupon:i,removeCoupon:q,getDiscordSettings:v,setPaymentMethod:x,reset:f}=n.useCart(),a=l.useMemo(()=>C(),[i,t]),o=u.useNavigate();return l.useEffect(()=>{if(t.parts.length===0){if(r){o("/");return}try{o(-1)}catch{o("/")}}},[t.parts]),d?e.jsx("div",{className:s.checkoutContainer,children:e.jsx("div",{className:s.loaderContainer,children:e.jsx(_.Loader,{})})}):e.jsxs("div",{className:s.checkoutContainer,children:[e.jsx(n.CheckoutItems,{cart:t,products:c,applyCoupon:g,applyCouponPending:y,coupon:i,removeCoupon:q,totalAndDiscount:a}),e.jsx(n.CheckoutOperational,{cart:t,getPossibleGateways:h,setGateway:m,getDiscordSettings:v,products:c,submitCart:p,totalAndDiscount:a,setCustomFieldsToCart:k,setDiscordSocialConnectId:j,setPaymentMethod:x,reset:f,isAntistock:r})]})};exports.Checkout=D;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as j } from "react/jsx-runtime";
|
|
2
|
-
import { u as D, C as N, a as x } from "./charge-
|
|
3
|
-
import { K as A, p as G } from "./builder-
|
|
2
|
+
import { u as D, C as N, a as x } from "./charge-_CEEL_lC.js";
|
|
3
|
+
import { K as A, p as G } from "./builder-Dcp5JIX2.js";
|
|
4
4
|
import c from "react";
|
|
5
|
-
import { e as P } from "./ui-components-
|
|
6
|
-
import "./builder-components-
|
|
7
|
-
import "./ticket-
|
|
5
|
+
import { e as P } from "./ui-components-DD5zQkng.js";
|
|
6
|
+
import "./builder-components-D_-yBjUv.js";
|
|
7
|
+
import "./ticket-BK3fx1Sw.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const S = "_checkoutContainer_thje1_1", b = "_loaderContainer_thje1_20", s = {
|
|
10
10
|
checkoutContainer: S,
|
package/dist/exports.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const o=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const o=require("./builder-C6H1N4FP.cjs");require("./ui-components-DsX_DjBg.cjs");require("./builder-components-Bj_ecWtd.cjs");const t=require("./charge-CDdwR76I.cjs"),e=require("./ticket-C-A_Ok9u.cjs"),r=require("./checkout-BY7eHMQg.cjs");require("react-dom");exports.AntistockRoutes=o.AntistockRoutes;exports.Routes=o.Routes;exports.formatPrice=o.formatPrice;exports.MarkdownText=t.MarkdownText;exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.parseDraftJsText=t.parseDraftJsText;exports.useCart=t.useCart;exports.useGeneralInfo=t.useGeneralInfo;exports.useMarkdownIt=t.useMarkdownIt;exports.useReCaptcha=t.useReCaptcha;exports.ColorVariables=e.ColorVariables;exports.aspectRatioOptions=e.aspectRatioOptions;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.removeNotification=e.removeNotification;exports.showNotification=e.showNotification;exports.splitTextIntoSpans=e.splitTextIntoSpans;exports.useAdaptiveStyles=e.useAdaptiveStyles;exports.useBalance=e.useBalance;exports.useBuilderPages=e.useBuilderPages;exports.useCreateTicket=e.useCreateTicket;exports.Checkout=r.Checkout;
|
package/dist/exports.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Y as p, Z as u, _ as c } from "./builder-
|
|
4
|
-
import "./ui-components-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import { M as n, G as f, J as l, u as d, I as x, K as C, H as h } from "./charge-
|
|
7
|
-
import { C as k, c as I, h as T, i as v, r as w, d as M, s as N, u as P, e as b, b as A, a as B } from "./ticket-
|
|
8
|
-
import { Checkout as J } from "./checkout-
|
|
3
|
+
import { Y as p, Z as u, _ as c } from "./builder-Dcp5JIX2.js";
|
|
4
|
+
import "./ui-components-DD5zQkng.js";
|
|
5
|
+
import "./builder-components-D_-yBjUv.js";
|
|
6
|
+
import { M as n, G as f, J as l, u as d, I as x, K as C, H as h } from "./charge-_CEEL_lC.js";
|
|
7
|
+
import { C as k, c as I, h as T, i as v, r as w, d as M, s as N, u as P, e as b, b as A, a as B } from "./ticket-BK3fx1Sw.js";
|
|
8
|
+
import { Checkout as J } from "./checkout-LuD-xUEH.js";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
export {
|
|
11
11
|
p as AntistockRoutes,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { B as m, a as w, C as _ } from "./ui-components-
|
|
2
|
+
import { B as m, a as w, C as _ } from "./ui-components-DD5zQkng.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { j as I, r as b, s as j, b as v, J as P, k as T, u as k } from "./builder-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import "./charge-
|
|
7
|
-
import "./ticket-
|
|
4
|
+
import { j as I, r as b, s as j, b as v, J as P, k as T, u as k } from "./builder-Dcp5JIX2.js";
|
|
5
|
+
import "./builder-components-D_-yBjUv.js";
|
|
6
|
+
import "./charge-_CEEL_lC.js";
|
|
7
|
+
import "./ticket-BK3fx1Sw.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const C = "_wrapper_1yd2j_1", A = "_error_1yd2j_11", N = "_title_1yd2j_21", B = "_buttons_1yd2j_29", i = {
|
|
10
10
|
wrapper: C,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./ui-components-DsX_DjBg.cjs");require("react");const n=require("./builder-C6H1N4FP.cjs");require("./builder-components-Bj_ecWtd.cjs");require("./charge-CDdwR76I.cjs");require("./ticket-C-A_Ok9u.cjs");require("react-dom");const s="_wrapper_ej209_1",c="_content_ej209_12",a="_title_ej209_22",r={wrapper:s,content:c,title:a},l=()=>{const o=n.useNavigate(),t=n.useRouteError();return console.error("ROUTE ERROR: ",t),alert(t),e.jsx("div",{className:r.wrapper,children:e.jsxs("div",{className:r.content,children:[e.jsx("h1",{className:r.title,children:"Something Went Wrong"}),e.jsx(i.Button,{type:"Primary",onClick:()=>{o("/")},children:"Go Home"})]})})};exports.DynamicErrorPage=l;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, Fragment as m } from "react/jsx-runtime";
|
|
2
|
-
import { ab as d, o as l, m as b, i as u, q as t, z as s } from "./builder-
|
|
2
|
+
import { ab as d, o as l, m as b, i as u, q as t, z as s } from "./builder-Dcp5JIX2.js";
|
|
3
3
|
import k from "react";
|
|
4
4
|
const B = (i) => {
|
|
5
5
|
const { children: c } = i, { pathname: r } = d(), { setActiveBlock: e } = l(), { setActiveBlock: a } = b(), { setActiveBlock: o } = u();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("./builder-C6H1N4FP.cjs");const r=require("react"),t=require("./ui-components-DsX_DjBg.cjs");require("./builder-components-Bj_ecWtd.cjs");require("./charge-CDdwR76I.cjs");require("./ticket-C-A_Ok9u.cjs");require("react-dom");const i=()=>(r.useEffect(()=>{setTimeout(()=>{window.location.reload()},500)},[]),e.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(t.Loader,{})}));exports.RouterErrorPage=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),e=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),e=require("./builder-C6H1N4FP.cjs"),o=require("react"),l=r=>{const{children:i}=r,{pathname:a}=e.useLocation(),{setActiveBlock:t}=e.useNavbarStore(),{setActiveBlock:s}=e.useThemeSettingsStore(),{setActiveBlock:n}=e.usePreviewStore();return o.useEffect(()=>{switch(n({id:null,neededScroll:!1}),a){case"/admin/builder":t(e.navbarBlocks[0]);break;case"/admin/builder/add":t(e.navbarBlocks[1]);break;case"/admin/builder/theme":t(e.navbarBlocks[2]);break;case"/admin/builder/settings":t(e.navbarBlocks[3]);break;case"/admin/builder/theme/colors":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[0]);break;case"/admin/builder/theme/fonts":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[1]);break;case"/admin/builder/theme/borders":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[2]);break;case"/admin/builder/theme/buttons":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[3]);break;case"/admin/builder/theme/inputs":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[4]);break}},[a]),c.jsx(c.Fragment,{children:i})};exports.ActivePage=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),P=require("./charge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),P=require("./charge-CDdwR76I.cjs"),t=require("./builder-C6H1N4FP.cjs"),J=require("./ticket-C-A_Ok9u.cjs"),g=require("./ui-components-DsX_DjBg.cjs");require("./builder-components-Bj_ecWtd.cjs");require("react-dom");const _="_notifications_1ntnm_1",F="_wrapper_1ntnm_12",j={notifications:_,wrapper:F},z=()=>(i.useEffect(()=>{document.title="Temporarily Unavailable"},[]),s.jsx("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden",background:"var(--surface-primary)",color:"var(--text-primary)"},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1",justifyContent:"center",alignItems:"center",gap:"24px"},children:[s.jsx("h2",{style:{color:"var(--text-primary)",fontSize:"var(--font-heading-h2-size)"},children:"Temporarily Unavailable"}),s.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"var(--font-heading-h3-size)",width:"85%",textAlign:"center"},children:"We're making some quick updates to improve your shopping experience. During this time, browsing and checkout are temporarily unavailable."})]})}));function R(){const c=new URLSearchParams(document.location.search),n=c.get("customerAccessToken"),{setToken:d}=t.useStorefrontStore.getState(),{setDashInfo:u}=t.useCustomerDashboardStore.getState();n&&(c.delete("customerAccessToken"),localStorage.setItem("token",n),d(n),u(null))}const U=({children:c})=>{const n=t.useLocation(),{token:d,setToken:u}=t.useStorefrontStore(),{dashInfo:S,setDashInfo:y}=t.useCustomerDashboardStore(),{shopPassword:f}=t.useStorefrontStore(),v=t.useNavigate(),[l,b]=t.useSearchParams(),{notifications:x}=t.useNotificationStore(),[T,h]=i.useState(!0),{setCustomerEmail:I}=t.useCartStore(),{setThemeSettings:w,themeSettings:N}=t.useThemeSettingsStore(),{settings:C,setSettings:k}=t.useSettingsStore(),{setHeader:D,setFooter:q,setAnnouncement:A}=t.useLayersStore(),{general:o,setGeneral:E,isAntistock:p}=t.useGeneralStore(),{pageContext:L,setPageContext:O}=t.usePagesStore();t.useTrackingAnalytics((o==null?void 0:o.info.id)||localStorage.getItem("shopId")||null,"production",p);const W=async()=>{const e=await J.getDynamicPage(encodeURIComponent("/products"),o==null?void 0:o.info.passwordProtected);if(e){const{data:a}=e;O({...L,listings:a.listings})}};return i.useEffect(()=>{R()},[]),i.useEffect(()=>{const e=localStorage.getItem("token");if(e&&(!d||!S))try{const a=t.jwtDecode(e);y(a),u(e),I(a.email)}catch(a){console.error("Failed to decode token:",a),localStorage.removeItem("token"),u(""),y(null)}},[d,S]),i.useEffect(()=>{const e=l.get("r");e&&(localStorage.setItem("referralCode",e),l.delete("r"),b(l),v({pathname:n.pathname,search:l.toString()},{replace:!0}))},[l,n]),i.useEffect(()=>{!n.pathname.startsWith("/products")&&!n.pathname.startsWith("/admin/builder")&&o&&(o.info.passwordProtected&&f||o.isPasswordValid)&&W()},[o,f]),i.useLayoutEffect(()=>{const e=async()=>{if(h(!0),!o){const r=await P.fetchGeneral(f);if(!r.isPasswordValid&&!n.pathname.includes("/admin/builder")){v("/validation",{state:{from:n.pathname}});return}if(!r.info.passwordProtected){localStorage.removeItem("shopPassword");const{setShopPassword:m}=t.useStorefrontStore.getState();m("")}E(r)}},a=async()=>{h(!0);const{settings:r,theme:m}=(await P.fetchThemeAndSettings()).data;r?(r.settings&&k(r.settings),r.header&&D(JSON.parse(JSON.stringify(r.header))),r.footer&&q(JSON.parse(JSON.stringify(r.footer))),r.announcement&&A(JSON.parse(JSON.stringify(r.announcement)))):k(C),w(m||N),h(!1)};n.pathname.startsWith("/validation")||e(),a()},[]),p&&(o!=null&&o.info.onHold)?s.jsx(z,{}):n.pathname.startsWith("/admin/builder")?s.jsx(s.Fragment,{children:c}):s.jsx(s.Fragment,{children:T?s.jsx("div",{className:j.wrapper,children:s.jsx(g.Loader,{})}):s.jsxs(s.Fragment,{children:[c,x.length>0&&s.jsx("div",{className:j.notifications,children:x.map(e=>s.jsx(g.NotificationBuilder,{type:e.status,message:e.message,timer:e.timer||10,id:e.id,element:p?g.NotificationAntistock:e.component,label:e.label},e.id))})]})})};exports.WrapperPage=U;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as o, jsxs as N, Fragment as g } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import { Y as z, a0 as U } from "./charge-
|
|
4
|
-
import { N as f, O as T, ab as F, p as G, a6 as R, e as H, Q as V, m as Y, a as q, u as B, K, b as M, al as Q, ag as X } from "./builder-
|
|
5
|
-
import { g as Z } from "./ticket-
|
|
6
|
-
import { e as $, N as ee,
|
|
7
|
-
import "./builder-components-
|
|
3
|
+
import { Y as z, a0 as U } from "./charge-_CEEL_lC.js";
|
|
4
|
+
import { N as f, O as T, ab as F, p as G, a6 as R, e as H, Q as V, m as Y, a as q, u as B, K, b as M, al as Q, ag as X } from "./builder-Dcp5JIX2.js";
|
|
5
|
+
import { g as Z } from "./ticket-BK3fx1Sw.js";
|
|
6
|
+
import { e as $, N as ee, w as te } from "./ui-components-DD5zQkng.js";
|
|
7
|
+
import "./builder-components-D_-yBjUv.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const se = "_notifications_1ntnm_1", ae = "_wrapper_1ntnm_12", x = {
|
|
10
10
|
notifications: se,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("./ui-components-DsX_DjBg.cjs");require("react");const s=require("./builder-C6H1N4FP.cjs");require("./builder-components-Bj_ecWtd.cjs");require("./charge-CDdwR76I.cjs");require("./ticket-C-A_Ok9u.cjs");require("react-dom");const j="_wrapper_1yd2j_1",w="_error_1yd2j_11",_="_title_1yd2j_21",b="_buttons_1yd2j_29",i={wrapper:j,error:w,title:_,buttons:b},S=async e=>{const o=localStorage.getItem("shopId")||void 0,r=localStorage.getItem("draftId"),d=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${o}/drafts/${r}/reset`;return await s.request({url:d,withToken:!0,method:"post",body:e})},x=()=>{const{error:e,setError:o}=s.useErrorStore(),{pages:r}=s.usePagesStore(),{setIsOpen:c}=s.useModalStore(),{title:d,description:m,setOnConfirm:u,setTitle:g,setDescription:p}=s.useConfirmationModalStore(),{setBlocks:h}=s.useLayersStore();async function y(){await S({resetSettings:(e==null?void 0:e.failedSettings)??!1,resetThemeSettings:(e==null?void 0:e.failedThemeSettings)??!1,resetPageIds:(e==null?void 0:e.failedPageIds)??[]}),o(null),h({}),window.location.reload()}async function f(){const a=[];r&&Object.keys(r).map(n=>r[n].id).filter(n=>n!==void 0).map(n=>a.push(n)),await S({resetSettings:!0,resetThemeSettings:!0,resetPageIds:a}),o(null)}return t.jsxs("div",{className:i.wrapper,children:[t.jsxs("div",{className:i.error,children:[t.jsxs("div",{children:[t.jsx("div",{className:i.title,children:"Oops! Something went wrong"}),t.jsx("span",{className:i.message,children:(e==null?void 0:e.message)||""})]}),t.jsxs("div",{className:i.buttons,children:[t.jsx(l.ButtonSettings,{type:"Primary",onClick:y,children:"Reset Settings"}),t.jsx(l.ButtonSettings,{type:"Secondary",onClick:a=>{a.stopPropagation(),g("Reset All Settings"),p("Are you sure you want to reset all settings? This is irreversible."),u(async()=>{await f()})},children:"Reset All Settings"})]})]}),d&&m&&t.jsx(l.BuilderModal,{close:()=>{c(!1),setTimeout(()=>{g(null),p(null),u(null),c(!0)},300)},children:t.jsx(l.ConfirmationModal,{})})]})};exports.ErrorPage=x;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import "./builder-
|
|
2
|
+
import "./builder-Dcp5JIX2.js";
|
|
3
3
|
import e from "react";
|
|
4
|
-
import { e as r } from "./ui-components-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import "./charge-
|
|
7
|
-
import "./ticket-
|
|
4
|
+
import { e as r } from "./ui-components-DD5zQkng.js";
|
|
5
|
+
import "./builder-components-D_-yBjUv.js";
|
|
6
|
+
import "./charge-_CEEL_lC.js";
|
|
7
|
+
import "./ticket-BK3fx1Sw.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const f = () => (e.useEffect(() => {
|
|
10
10
|
setTimeout(() => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { g as i } from "./ui-components-
|
|
2
|
+
import { g as i } from "./ui-components-DD5zQkng.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { p as s, am as a } from "./builder-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import "./charge-
|
|
7
|
-
import "./ticket-
|
|
4
|
+
import { p as s, am as a } from "./builder-Dcp5JIX2.js";
|
|
5
|
+
import "./builder-components-D_-yBjUv.js";
|
|
6
|
+
import "./charge-_CEEL_lC.js";
|
|
7
|
+
import "./ticket-BK3fx1Sw.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const c = "_wrapper_ej209_1", m = "_content_ej209_12", p = "_title_ej209_22", r = {
|
|
10
10
|
wrapper: c,
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./builder.cjs.js"),c=require("./builder-C6H1N4FP.cjs"),u=require("react/jsx-runtime"),d=require("react"),e=require("./ui-components-DsX_DjBg.cjs");require("./builder-components-Bj_ecWtd.cjs");const r=require("./charge-CDdwR76I.cjs"),t=require("./ticket-C-A_Ok9u.cjs");require("react-dom");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.d.ts
CHANGED
|
@@ -4,8 +4,12 @@ export * from './src/App.tsx';
|
|
|
4
4
|
export * from './src/abstractions';
|
|
5
5
|
export { hotReload, splitTextIntoSpans, useCreateTicket, useBuilderPages } from './src/lib';
|
|
6
6
|
export { useIconRegistration, registerIcons } from './src/hooks/useIconRegistration';
|
|
7
|
+
export { useDynamicIconRegistration } from './src/hooks/useDynamicIconRegistration';
|
|
7
8
|
export { registerIcon, getRegisteredIcon, isIconRegistered, getRegisteredIcons, } from '@assets/icon-registry/IconRegistry';
|
|
8
9
|
export { Icon } from './src/ui';
|
|
10
|
+
export { loadIcon } from './src/assets/icons';
|
|
11
|
+
export { stripIconSuffix, addIconSuffix } from './src/utils/iconHelpers';
|
|
12
|
+
export { createIconLeftAddons } from './src/utils/iconSelectHelpers';
|
|
9
13
|
export { iconNames, type IconNames, ColorVariables, type AspectRatio, aspectRatioOptions, } from './src/shared/constants';
|
|
10
14
|
export { Routes, AntistockRoutes } from './src/storefront/constants/routes';
|
|
11
15
|
export type { Notification, NotificationComponentProps } from './src/shared/constants';
|
package/dist/index.es.js
CHANGED
|
@@ -1,53 +1,75 @@
|
|
|
1
|
-
import { App as
|
|
2
|
-
import { Y as
|
|
3
|
-
import "react/jsx-runtime";
|
|
4
|
-
import { useEffect as
|
|
5
|
-
import { r as
|
|
6
|
-
import {
|
|
7
|
-
import "./builder-components-
|
|
8
|
-
import { M as
|
|
9
|
-
import { C as
|
|
1
|
+
import { App as R } from "./builder.es.js";
|
|
2
|
+
import { Y as w, Z as b, _ as k } from "./builder-Dcp5JIX2.js";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect as i } from "react";
|
|
5
|
+
import { r as o, I as n } from "./ui-components-DD5zQkng.js";
|
|
6
|
+
import { t as A, n as P, p as S, o as T, q as j, s as E, m as M } from "./ui-components-DD5zQkng.js";
|
|
7
|
+
import "./builder-components-D_-yBjUv.js";
|
|
8
|
+
import { M as y, G as B, J as D, u as G, I as J, K as q, H } from "./charge-_CEEL_lC.js";
|
|
9
|
+
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-BK3fx1Sw.js";
|
|
10
10
|
import "react-dom";
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
Object.entries(e).forEach(([s,
|
|
14
|
-
|
|
11
|
+
function m(e) {
|
|
12
|
+
i(() => {
|
|
13
|
+
Object.entries(e).forEach(([s, t]) => {
|
|
14
|
+
o(s, t);
|
|
15
15
|
});
|
|
16
16
|
}, [e]);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
Object.entries(e).forEach(([s,
|
|
20
|
-
|
|
18
|
+
function h(e) {
|
|
19
|
+
Object.entries(e).forEach(([s, t]) => {
|
|
20
|
+
o(s, t);
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
+
function c(e) {
|
|
24
|
+
return e.endsWith("Icon") ? e.slice(0, -4) : e;
|
|
25
|
+
}
|
|
26
|
+
function l(e, s = 20, t = !0) {
|
|
27
|
+
return e.map((a) => ({
|
|
28
|
+
value: t ? c(a) : a,
|
|
29
|
+
addon: /* @__PURE__ */ r(
|
|
30
|
+
n,
|
|
31
|
+
{
|
|
32
|
+
name: a,
|
|
33
|
+
width: s,
|
|
34
|
+
height: s,
|
|
35
|
+
showPlaceholder: !0
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
23
40
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
k as
|
|
35
|
-
|
|
36
|
-
S as
|
|
41
|
+
w as AntistockRoutes,
|
|
42
|
+
R as App,
|
|
43
|
+
L as ColorVariables,
|
|
44
|
+
n as Icon,
|
|
45
|
+
y as MarkdownText,
|
|
46
|
+
B as ReCaptchaProvider,
|
|
47
|
+
b as Routes,
|
|
48
|
+
A as addIconSuffix,
|
|
49
|
+
V as aspectRatioOptions,
|
|
50
|
+
l as createIconLeftAddons,
|
|
51
|
+
k as formatPrice,
|
|
52
|
+
P as getRegisteredIcon,
|
|
53
|
+
S as getRegisteredIcons,
|
|
54
|
+
W as hotReload,
|
|
55
|
+
Y as iconNames,
|
|
37
56
|
T as isIconRegistered,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
j as loadIcon,
|
|
58
|
+
D as parseDraftJsText,
|
|
59
|
+
o as registerIcon,
|
|
60
|
+
h as registerIcons,
|
|
61
|
+
Z as removeNotification,
|
|
62
|
+
_ as showNotification,
|
|
63
|
+
F as splitTextIntoSpans,
|
|
64
|
+
E as stripIconSuffix,
|
|
65
|
+
Q as useAdaptiveStyles,
|
|
66
|
+
U as useBalance,
|
|
67
|
+
X as useBuilderPages,
|
|
68
|
+
G as useCart,
|
|
69
|
+
$ as useCreateTicket,
|
|
70
|
+
M as useDynamicIconRegistration,
|
|
71
|
+
J as useGeneralInfo,
|
|
72
|
+
m as useIconRegistration,
|
|
73
|
+
q as useMarkdownIt,
|
|
74
|
+
H as useReCaptcha
|
|
53
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),i=require("react"),x=require("./builder-
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),i=require("react"),x=require("./builder-C6H1N4FP.cjs"),a=require("./charge-CDdwR76I.cjs"),O=require("./ui-components-DsX_DjBg.cjs");require("./builder-components-Bj_ecWtd.cjs");require("./ticket-C-A_Ok9u.cjs");require("react-dom");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,10 +1,10 @@
|
|
|
1
1
|
import { jsx as s, Fragment as W, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import i, { useState as H, useMemo as S } from "react";
|
|
3
|
-
import { X as J, a7 as K, p as X, K as Q } from "./builder-
|
|
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-
|
|
5
|
-
import { e as _e, g as ye, I as ke } from "./ui-components-
|
|
6
|
-
import "./builder-components-
|
|
7
|
-
import "./ticket-
|
|
3
|
+
import { X as J, a7 as K, p as X, K as Q } from "./builder-Dcp5JIX2.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-_CEEL_lC.js";
|
|
5
|
+
import { e as _e, g as ye, I as ke } from "./ui-components-DD5zQkng.js";
|
|
6
|
+
import "./builder-components-D_-yBjUv.js";
|
|
7
|
+
import "./ticket-BK3fx1Sw.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const ve = async (a = 1) => await Y({ PageNumber: a }), Xe = () => {
|
|
10
10
|
const [a, n] = i.useState(null), [d, e] = H(null), [N, O] = i.useState(0), { page: p } = J(), [C, g] = i.useState(!0);
|