PageSourceSearch

https://www.agoldenstate.com/_next/static/chunks/pages/checkout/guest-657c7c94a95baf1d.js

js agoldenstate.com collected 2026-09-26 01:35:09 UTC 51,259 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8554],{99776:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout/guest",function(){return n(17370)}])},70124:function(e,t,n){"use strict";n.r(t);var i=n(85893),o=n(3382),r=n(48641),l=n(67294),s=n(98087),d=function(e){var t,n,d,a,u=e.steps,c=e.currentStep,v=e.completedSteps,p=e.handleStepClick,h=(0,l.useContext)(s.Z).cms,g=(null===(n=null==h?void 0:null===(t=h.globals)||void 0===t?void 0:t.settings[0])||void 0===n?void 0:n.mode)||"light",m=null===(a=null==h?void 0:null===(d=h.globals)||void 0===d?void 0:d.settings[0])||void 0===a?void 0:a.checkoutStyles,f=(null==m?void 0:m.stepperColor)?m.stepperColor:"color",y=(null==m?void 0:m.stepperCompletedColor)?m.stepperCompletedColor:"dark"===g?"bgColor":"color";return(0,i.jsx)(r.xu,{width:"100%",mb:0,children:(0,i.jsx)(r.Ug,{gap:"0",spacing:0,width:"100%",justify:"space-between",children:u.map(function(e,t){return(0,i.jsxs)(l.Fragment,{children:[(0,i.jsxs)(r.xu,{position:"relative",width:{sm:"32px",md:"40px"},cursor:"pointer",onClick:v.includes(t)?function(){return p(t)}:function(){},height:{sm:"32px",md:"40px"},borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bg:v.includes(t)?"dark"===g?"color":"brand.400":c===t?"dark"===g?"bgColor":"brand.100":"gray.200",color:v.includes(t)?y:c===t?"dark"===g?"white":f:"gray.500",border:c===t?"2px solid":"none",borderColor:"dark"===g?"color":"brand.400",fontWeight:"600",fontSize:"sm",children:[v.includes(t)?(0,i.jsx)(o.nQ,{color:y}):t+1,(0,i.jsx)(r.xv,{width:{sm:"200%",md:"300%"},position:"absolute",whiteSpace:"nowrap",top:{sm:"-25px",md:"-30px"},fontSize:{sm:"9px",md:"16px"},variant:"stepTitle",fontWeight:c===t?"500":"400",color:v.includes(t)||c===t?"color":"gray.500",textAlign:"center",children:e.title})]}),t<u.length-1&&(0,i.jsx)(r.xu,{flex:"1",height:"6px",bg:v.includes(t)?"dark"===g?"color":"brand.400":"gray.200"})]},t)})})})};t.default=d},17370:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return er},default:function(){return el}});var i=n(47568),o=n(26042),r=n(69396),l=n(29815),s=n(97582),d=n(85893),a=n(80419),u=n(39653),c=n(48641),v=n(47741),p=n(42588),h=n(36158),g=n(23887),m=n(35610),f=n(3038),y=n(74373),x=n(11163),b=n(67294),w=n(58971),C=n.n(w),j=n(47622),I=n(34839),S=n(70124),Z=n(69345),_=n(89530),P=n(65349),k=n(61197),A=n(48339),L=n(35119),O=n(64413),D=n(98087),T=n(20593),E=function(e){var t,n,o,r,l,a,u,p,h,g,m=e.saveAddressId,f=e.addresses,y=(e.errors,e.handleStepCompleted),x=void 0===y?function(){}:y,w=e.guestCheckout;e.restrictedMessage,e.isAddressRestricted,(0,b.useRef)(null);var j=(0,b.useContext)(A.Z).service,I=(0,b.useState)(!0),S=(I[0],I[1]),Z=(0,b.useState)(!1),E=(Z[0],Z[1]),M=(0,b.useContext)(_.Z),U=(0,b.useState)(!(0,k.y)()&&C().get("current_address")),N=(U[0],U[1]),q=(0,b.useState)(!1),z=(q[0],q[1]),G=(0,b.useState)(!1),R=(G[0],G[1]),B=(0,b.useState)(!1),K=(B[0],B[1]),W=(0,b.useState)(f),V=(W[0],W[1]),F=(0,b.useState)();F[0],F[1];var H,Y,J=(0,b.useContext)(D.Z),$=(null==j?void 0:j.type)||(null===(t=C().get("hub"))||void 0===t?void 0:t.type),Q=(null==j?void 0:null===(n=j.hub)||void 0===n?void 0:n.name)||(null===(o=C().get("hub"))||void 0===o?void 0:null===(r=o.hub)||void 0===r?void 0:r.name),X=(null==j?void 0:null===(l=j.hub)||void 0===l?void 0:l.addressString)||(null===(a=C().get("hub"))||void 0===a?void 0:null===(u=a.hub)||void 0===u?void 0:u.address);null===(g=null==J?void 0:null===(p=J.cms)||void 0===p?void 0:null===(h=p.globals)||void 0===h?void 0:h.settings[0])||void 0===g||g.mode,(0,i.Z)(function(e){var t;return(0,s.__generator)(this,function(t){switch(t.label){case 0:return C().set("current_address",{addressString:e.addressString,address1:null==e?void 0:e.address1,city:e.city,state:e.state,country:e.country,county:e.county,zip:e.zip,addressId:e.addressId}),N(e),m(null==e?void 0:e.addressId),R(!0),S(!1),E(!1),z(!1),K(!1),[4,L.Z.getUserAddresses()];case 1:return V(t.sent()),[2]}})}),(0,i.Z)(function(e){var t;return(0,s.__generator)(this,function(n){switch(n.label){case 0:return t=C().get("apiKey"),[4,L.Z.updateAddress(e,{isPrimary:!0},{"api-key":t})];case 1:return n.sent(),m(e),[2]}})});var ee=function(){if(null==M?void 0:M.firstName){var e="".concat(null==M?void 0:M.firstName," ").concat(null==M?void 0:M.lastName);return(0,d.jsxs)(c.Kq,{width:"100%",pt:5,spacing:6,children:[(0,d.jsx)(P.Z,{border:!w,heading:"",children:(0,d.jsxs)(c.kC,{direction:{lg:"column",md:"column",sm:"column"},w:"full",justify:"flex-start",wrap:"wrap",borderColor:"color",border:"1px solid",borderRadius:"4px",px:15,py:15,children:[(0,d.jsx)(c.xv,{variant:"detailBold",children:e}),(0,d.jsx)(c.xv,{variant:"",children:null==M?void 0:M.email})]})}),w&&(0,d.jsx)(v.zx,{onClick:function(){return x()},variant:"primary",children:"Continue"})]})}return w?(0,d.jsx)(T.Z,{handleStepCompleted:x}):(0,d.jsx)(O.Z,{})},et=function(){return(0,d.jsx)(c.Kq,{width:"100%",children:ee()})},en=function(){return(0,d.jsxs)(c.Kq,{width:"100%",children:[(0,d.jsx)(P.Z,{border:!w,heading:w?"":"Pickup Location",children:(0,d.jsxs)(c.kC,{direction:{lg:"column",md:"column",sm:"column"},w:"full",justify:"flex-start",wrap:"wrap",borderColor:"color",border:"1px solid",borderRadius:"4px",p:5,children:[w&&(0,d.jsx)(c.xv,{fontSize:"1rem",fontWeight:"600",mb:2,children:"Pickup Location"}),(0,d.jsx)(c.xv,{variant:"pageText",children:Q}),(0,d.jsx)(c.xv,{variant:"pageTextDim",children:X})]})}),ee()]})},ei=function(){return(0,d.jsx)(c.Kq,{width:"100%",children:ee()})};return(0,d.jsx)(c.gC,{w:"100%",alignItems:"flex-start",children:(null==$?void 0:$.toUpperCase())==="PICKUP"?(0,d.jsx)(en,{}):(null==$?void 0:$.toUpperCase())==="DELIVERY"||(null==$?void 0:$.toUpperCase())==="RAPID"?(0,d.jsx)(et,{}):(null==$?void 0:$.toUpperCase())==="SHIPMENT"?(0,d.jsx)(ei,{}):""})},M=n(93550),U=n(41664),N=n.n(U),q=n(3382),z=n(31955),G=n(58634),R=n(60250),B=n(5152),K=n.n(B),W=n(61587),V=n(70024),F=n(9269);n(30517);var H=n(55239),Y=n(21949),J=n(85993),$=n(47659),Q=n(11637),X=n(39686),ee=n(38121),et=n(59304),en=K()(function(){return Promise.all([n.e(5675),n.e(9696)]).then(n.bind(n,9696))},{loadableGenerated:{webpack:function(){return[9696]}}}),ei=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],eo=[1,2,3,4,5].map(function(e){var t=new Date;return t.setDate(t.getDate()+e),"".concat(t.getDate()," ").concat(ei[t.getMonth()])}),er=!0,el=function(e){var t,n,w,O,T,U,B,K,ei,er,el,es,ed,ea,eu,ec,ev,ep,eh,eg,em,ef,ey,ex,eb,ew,eC,ej,eI,eS,eZ,e_=e.pageFeatureControls,eP=e.userAddresses,ek=(e.userDocuments,e.loyalityPointsJson),eA=void 0===ek?{}:ek,eL=e.isLoyalityHas_pointsJson,eO=function(e){return e%1!=0?Math.floor(e):e-1},eD=(0,a.pm)(),eT=(0,x.useRouter)(),eE=e_.showGovtId,eM=e_.showPaymentOptions,eU=e_.showPatientId,eN=e_.uploadFields,eq=e_.placeOrderMessage,ez=void 0===eq?"":eq,eG=e_.showContinueShopping,eR=e_.paymentGateway,eB=e_.currency,eK=e_.emptyBagMessage,eW=e_.paymentOptions,eV=e_.defaultPaymentType,eF=e_.paymentSupportText,eH=e_.showPromotions,eY=e_.isGovtIdMandatory,eJ=e_.createOrderButtonText,e$=e_.showFreeProduct,eQ=void 0!==e$&&e$,eX=(0,b.useState)(!0),e0=eX[0],e1=eX[1],e2=(0,b.useState)(eV),e3=e2[0],e4=e2[1],e5=(0,u.qY)(),e9=e5.isOpen,e6=e5.onOpen,e8=e5.onClose,e7=(0,b.useState)(""),te=e7[0],tt=e7[1],tn=(0,u.qY)(),ti=tn.isOpen,to=tn.onOpen,tr=tn.onClose,tl=(0,u.qY)(),ts=tl.isOpen,td=tl.onOpen,ta=tl.onClose,tu=(0,u.qY)(),tc=tu.isOpen,tv=tu.onOpen,tp=tu.onClose,th=(0,b.useState)(!1),tg=th[0],tm=th[1],tf=(0,b.useState)({orderId:"",gateWayId:""}),ty=tf[0],tx=tf[1],tb=(0,b.useState)(eA||""),tw=tb[0],tC=tb[1],tj=(0,b.useState)(eL||""),tI=tj[0],tS=tj[1],tZ=(0,b.useState)({}
1),t_=tZ[0],tP=tZ[1],tk=(0,b.useState)(0),tA=(tk[0],tk[1]),tL=(0,b.useState)([]),tO=tL[0],tD=tL[1],tT=(0,b.useState)(!1),tE=tT[0],tM=tT[1],tU=(0,b.useState)(0),tN=tU[0],tq=tU[1],tz=(0,b.useState)(""),tG=tz[0],tR=tz[1],tB=(0,b.useState)(""),tK=tB[0],tW=tB[1],tV=(0,b.useState)(!1),tF=tV[0],tH=tV[1],tY=(0,b.useRef)(!1),tJ=(0,b.useState)({token:"",id:null}),t$=tJ[0],tQ=tJ[1],tX=(0,b.useState)(null),t0=tX[0],t1=tX[1],t2=(0,b.useState)({id:null,error:null}),t3=t2[0],t4=t2[1],t5=(0,b.useState)(""),t9=t5[0],t6=t5[1],t8=(0,b.useState)(""),t7=t8[0],ne=t8[1],nt=(0,b.useState)({open:!0,date:eo[0],timeSlot:null===(t=e_.scheduleDeliverySlots)||void 0===t?void 0:t.split(",")[0]}),nn=nt[0];nt[1];var ni=!(0,k.y)()&&C().get("current_address"),no=(0,b.useState)((null==ni?void 0:ni.addressId)||""),nr=no[0],nl=no[1],ns=(0,b.useState)(!1),nd=ns[0],na=ns[1],nu=(0,b.useState)(""),nc=nu[0],nv=nu[1],np=(0,b.useContext)(_.Z),nh=(0,b.useContext)(V.Z),ng=(0,b.useState)(null==np?void 0:null===(n=np.addresses)||void 0===n?void 0:n.find(function(e){return e.addressId===nr})),nm=ng[0],nf=ng[1],ny=(0,b.useState)(null==nh?void 0:null===(w=nh.headers)||void 0===w?void 0:w.subTotal)[0],nx=(0,b.useState)(!1),nb=nx[0];nx[1];var nw=(0,b.useContext)(Y.Z),nC=nw.maximumInternationalOrder,nj=nw.maximumInternationalOrderMessage,nI=nw.catalogPage,nS=nw.restrictedMessage,nZ=(nw.showBrandImage,nw.allowGtm),n_=nw.hideTaxBeforeAddress,nP=nw.hidePrice,nk=(0,b.useContext)(X.Z),nA=(0,b.useContext)(V.Z).setCart,nL=(0,b.useContext)(A.Z).service,nO=(0,et.r)().trackPurchasePixel,nD=null==nk?void 0:null===(O=nk.siteConfiguration)||void 0===O?void 0:null===(T=O.restrictedStates)||void 0===T?void 0:T.json,nT=C().get("hubCurrency"),nE=(0,b.useState)((null==np?void 0:null===(U=np.user_documents)||void 0===U?void 0:U.filter(function(e){return"age_proof"===e.type&&e.isValid}))||[]),nM=nE[0],nU=nE[1],nN=(0,b.useState)((null==np?void 0:null===(B=np.user_documents)||void 0===B?void 0:B.filter(function(e){return"patientId"===e.type&&e.isValid}))||[]),nq=nN[0],nz=nN[1],nG=null==np?void 0:null===(K=np.addresses)||void 0===K?void 0:K.find(function(e){return e.addressId===nr}),nR=C().get("hubAddress"),nB=(0,b.useState)(!1),nK=nB[0],nW=nB[1],nV=(0,b.useState)({secruteKey:"",orderId:"",payment_intent_id:"",paymentGatewayId:""}),nF=nV[0],nH=nV[1],nY=(0,b.useState)(!1),nJ=nY[0],n$=nY[1],nQ=(0,b.useContext)(D.Z).cms,nX=(null==nL?void 0:nL.type)||(null===(ei=C().get("hub"))||void 0===ei?void 0:ei.type),n0=(null==nL?void 0:null===(er=nL.type)||void 0===er?void 0:er.toLowerCase())||(null===(el=C().get("hub"))||void 0===el?void 0:null===(es=el.type)||void 0===es?void 0:es.toLowerCase());null===(ed=e_.scheduleDeliverySlots)||void 0===ed||ed.split(",");var n1=C().get("orderMethods");null===(eu=null==nQ?void 0:null===(ea=nQ.globals)||void 0===ea?void 0:ea.settings[0])||void 0===eu||eu.mode;var n2,n3,n4=function(e){nh.syncBag(),nl(e)},n5=(null===(ec=nh.meta)||void 0===ec?void 0:null===(ev=ec.promoCodesApplied)||void 0===ev?void 0:ev.bySystem)||[],n9=new Set((0,l.Z)((null===(ep=nh.meta)||void 0===ep?void 0:null===(eh=ep.promoCodesApplied)||void 0===eh?void 0:eh.bySystem)||[]).concat((0,l.Z)((null===(eg=nh.meta)||void 0===eg?void 0:null===(em=eg.promoCodesApplied)||void 0===em?void 0:em.byCustomer)||[]))),n6=new Set(null===(eb=null===(ex=null===(ey=(null===(ef=nh.headers)||void 0===ef?void 0:ef.discountDetails)||[])||void 0===ey?void 0:ey.filter(function(e){var t,n;return(null==e?void 0:null===(t=e.description)||void 0===t?void 0:null===(n=t.toLowerCase)||void 0===n?void 0:n.call(t))==="free"}))||void 0===ex?void 0:ex.map(function(e){return null==e?void 0:e.discountCode}))||void 0===eb?void 0:eb.filter(Boolean)),n8=null===(ew=nh.headers)||void 0===ew?void 0:null===(eC=ew.discountDetails)||void 0===eC?void 0:eC.map(function(e){return e.discountCode}),n7=(n2=(0,i.Z)(function(e){return(0,s.__generator)(this,function(t){return t6("transferring to the payment gateway momentarily"),window.open(e,"_self"),[2]})}),function(e){return n2.apply(this,arguments)}),ie=null==eW?void 0:eW.find(function(e){var t;return(null==e?void 0:null===(t=e.key)||void 0===t?void 0:t.toLowerCase())==="aeropay"});(0,b.useEffect)(function(){iC()},[]),(0,b.useEffect)(function(){var e,t=(null==np?void 0:null===(e=np.user_documents)||void 0===e?void 0:e.filter(function(e){return"age_proof"===e.type&&e.isValid}))||[];t&&t.length>0&&nU(t)},[np]);var it,ii,io=(n3=(0,i.Z)(function(e){var t,n,i,o,r,l,d,a,u,c,v,p,h,g,m,f,y,x,b,w,j,I,S,Z,_,P,k,A,O,D,T,E,M;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return[4,L.Z.getHubPaymentGatewayId()];case 1:if(n=s.sent(),(null==(i=null===(t=null==eW?void 0:eW.find(function(e){return e.key===e3}))||void 0===t?void 0:t.key)?void 0:i.toLowerCase())!=="square")return[3,3];return(r={}).orderId=e.toString(),r.currency=nT||eB||"USD",l=null===(o=null==n?void 0:n.find(function(e){var t;return(null==e?void 0:null===(t=e.name)||void 0===t?void 0:t.toLowerCase())===(null==i?void 0:i.toLowerCase())}))||void 0===o?void 0:o.paymentGatewayId,t6("Directing to payment gateway ..."),[4,L.Z.getPaymentLink(l,r)];case 2:return(a=null==(d=s.sent())?void 0:d.result)&&a.payment_link.long_url?(C().set("cart",{bag:[]}),nh.syncBag(),n7(a.payment_link.long_url)):(t6("Oops issue in sending to payment gateway. Please try again."),tH(!1),eD({title:"There is an issue with the payment gateway. Please try again later. ",status:"error",position:"top-right",duration:3e3,isClosable:!0})),[3,15];case 3:if((null==i?void 0:i.toLowerCase())!=="stripe")return[3,5];return(c={}).orderId=e.toString(),c.currency=nT||eB||"USD",v=null===(u=null==n?void 0:n.find(function(e){var t;return(null==e?void 0:null===(t=e.name)||void 0===t?void 0:t.toLowerCase())===(null==i?void 0:i.toLowerCase())}))||void 0===u?void 0:u.paymentGatewayId,t6("Directing to payment gateway ..."),[4,L.Z.getPaymentLink(v,c)];case 4:return(h=null==(p=s.sent())?void 0:p.result)&&(null==h?void 0:h.client_secret)?(nH({secruteKey:null==h?void 0:h.client_secret,orderId:e.toString(),payment_intent_id:null==h?void 0:h.id,paymentGatewayId:v}),tv(),t6("You will be directed back to our site post the payment confirmation"),C().set("cart",{bag:[]}),nh.syncBag()):(t6("Oops issue in sending to payment gateway. Please try again."),tH(!1),eD({title:"There is an issue with the payment gateway. Please try again later. ",status:"error",position:"top-right",duration:3e3,isClosable:!0})),[3,15];case 5:if((null==i?void 0:i.toLowerCase())!=="barterpay")return[3,7];return(m={}).orderId=e.toString(),m.currency=nT||eB||"USD",f=null===(g=null==n?void 0:n.find(function(e){var t;return(null==e?void 0:null===(t=e.name)||void 0===t?void 0:t.toLowerCase())===(null==i?void 0:i.toLowerCase())}))||void 0===g?void 0:g.paymentGatewayId,t6("Directing to payment gateway ..."),[4,L.Z.getPaymentLink(f,m)];case 6:return x=null==(y=s.sent())?void 0:y.result,console.log("BarterPay Payment Link:",x),x&&x.redirectUrl?(C().set("cart",{bag:[]}),nh.syncBag(),n7(x.redirectUrl)):(t6("Oops issue in sending to payment gateway. Please try again."),tH(!1),eD({title:"There is an issue with the payment gateway. Please try again later. ",status:"error",position:"top-right",duration:3e3,isClosable:!0})),[3,15];case 7:if((null==i?void 0:i.toLowerCase())!=="merchantic")return[3,9];return(w={}).orderId=e.toString(),w.currency=nT||eB||"USD",j=null===(b=null==n?void 0:n.find(function(e){var t;return(null==e?void 0:null===(t=e.name)||void 0===t?void 0:t.toLowerCase())===(null==i?void 0:i.toLowerCase())}))||void 0===b?void 0:b.paymentGatewayId,t6("Directing to payment gateway ..."),[4,L.Z.getPaymentLink(j,w)];case 8:return(S=null==(I=s.sent())?void 0:I.result)?(C().set("cart",{bag:[]}),nh.syncBag(),n7(S)):(t6("Oops issue in sending to payment gateway. Please try again."),tH(!1),eD({title:"There is an issue with the payment gateway. Please try again later. ",status:"error",position:"top-right",duration:3e3,isClosable:!0})),[3,15];case 9:if((null==i?void 0:i.toLowerCase())!=="peer.xyz")return[3,11];return(_={}).orderId=e.toString(),_.currency=nT||eB||"USD",P=null===(Z=null==n?void 0:n.find(function(e){var t;return(null==e?void 0:null===(t=e.name)||void 0===t?void 0:t.toLowerCase())===(null==i?void 0:i.toLowerCase())}))||void 0===Z?void 0:Z.paymentGatewayId,t6("Directing to payment gateway ..."),[4,L.Z.getPaymentLink(P,_)];case 10:return(A="string"==typeof(null==(k=s.sent())?void 0:k.result)?k.result:null)?(C().set("cart",{bag:[]}),nh.syncBag(),n7(A)):(t6("Oops issue in sending to payment gateway. Please try again."),tH(!1),eD({title:"There is an issue with the payment gateway. Please try again later. ",status:"error",position:"top-right",duration:3e3,isClosable:!0})),[3,15];case 11:D=null===(O=null==n?void 0:n.find(function(e){return"aeropay"===e.name.toLowerCase()}))||void 0===O?void 0:O.paymentGatewayId,C().set("cart",{bag:[]}),nh.syncBag(),t6("Order is completing through Aeropay..."),(T={}).orderId=e.toString(),T.bankAccountId=t7.toString(),T.paymentGatewayId=D,s.label=12;case 12:return s.trys.push([12,14,,15]),[4,L.Z.payOrderAeroPay(T)];case 13:return(null==(E=s.sent())?void 0:E.orderId)&&eT.push("/orders/".concat(e)),[3,15];case 14:return t4({id:e,error:s.sent()}),[3,15];case 15:return[2]}})}),function(e){return n3.apply(this,arguments)}),ir=null==tw?void 0:tw.total,il=null==tw?void 0:null===(ej=tw.brand_level)||void 0===ej?void 0:ej.point_spend_ratio,is=function(){var e;if((null===(e=Object.keys(t_))||void 0===e?void 0:e.length)>=1){var t="PICKUP"!==nX?Object.keys(t_).find(function(e){return t_[e]&&"name"!==e}):Object.keys(t_).find(function(e){return t_[e]});if(t){if("address"===t||"name"===t||"identification"===t){var n=document.getElementById("address"===t||"name"===t?"address":"govId");if(n){var i=n.getBoundingClientRect().top+window.pageYOffset-300;window.scrollTo({top:i,behavior:"smooth"})}}eD({title:t_[t],status:"info",position:"top-right",duration:3e3,isClosable:!0})}}},id=(it=(0,i.Z)(function(){var e,t,n,i,l,d,a,u,c,v,p,h,g,m,f,y;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(e0)return is(),[2];if(tY.current||tF)return[2];tY.current=!0,t6("Creating Order..."),tH(!0),(e={}).addressId=nr,tK&&""!==tK&&(e.method=tK),nb&&tI&&(null==tw?void 0:tw.total)&&il&&(ir>=ny*il?(t=eO(ny),e.points=t/il):e.points=ir),!nn.open&&nn.date&&nn.timeSlot&&(e.deliverySchedule="".concat(nn.date," ").concat(nn.timeSlot)),(null==n8?void 0:n8.length)>0&&(e.discounts=n8),eR&&(e.isPrepaidOrder=!0),nr||delete e.addressId,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,L.Z.createOrder(e)];
1case 2:if(n=s.sent(),nZ&&(c=(null==nh?void 0:null===(i=nh.bag)||void 0===i?void 0:i.map(function(e){var t;return{item_id:e.hubProductId||"",item_name:e.title||"",price:e.retailPrice||"",quantity:e.quantity||"",item_variant:(null===(t=e.attrs.find(function(e){return"Size"===e.name}))||void 0===t?void 0:t.value)||"",currency:"USD",coupon:"",item_category:e.category||"",value:e.totalPayable||""}}))||[],v=z.Z.get("promotion"),p=z.Z.get("campaign_id"),h=(0,r.Z)((0,o.Z)({event:"purchase"},v?{campaign_id:v}:p&&{campaign_id:p},p?{utm_campaign:p}:{}),{transaction_id:n.orderId,value:(null==nh?void 0:null===(l=nh.headers)||void 0===l?void 0:l.netPayable)||0,currency:"USD",eventModel:{hub:null===(d=C().get("hub"))||void 0===d?void 0:null===(a=d.hub)||void 0===a?void 0:a.name,orderId:n.orderId||"",totalRevenue:(null==nh?void 0:null===(u=nh.headers)||void 0===u?void 0:u.netPayable)||"",userId:(null==np?void 0:np.userId)||"",currency:"USD",items:c||""}}),window.dataLayer.push(h)),n){if(nO({cntr_revenue:null==nh?void 0:null===(g=nh.headers)||void 0===g?void 0:g.subTotal,cntr_transactionId:n.orderId}),t6("Order Created..."),"Authorizenet"===e3)return f=null===(m=null==t0?void 0:t0.find(function(e){var t;return(null==e?void 0:null===(t=e.name)||void 0===t?void 0:t.toLowerCase())==="authorizenet"}))||void 0===m?void 0:m.paymentGatewayId,tx(function(e){return(0,r.Z)((0,o.Z)({},e),{orderId:n.orderId,gateWayId:f})}),td(),[2];if(t7||"cash"!==(null==e3?void 0:e3.toLowerCase()))return t6("Directing to payment gateway ..."),io(n.orderId),[2];eD({title:"Your order was placed succesfully",status:"success",position:"top-right",duration:3e3,isClosable:!0}),C().set("cart",{bag:[]}),nh.syncBag(),nA({bag:[],syncBag:!0,modification:[]}),eT.push("/orders/".concat(n.orderId))}return[3,4];case 3:return y=s.sent(),tY.current=!1,tH(!1),null==y||y.startsWith("California daily limit"),eD({title:"Exceeded daily limit",status:"info",description:y,position:"top-right",duration:3e3,isClosable:!0}),[3,4];case 4:return[2]}})}),function(){return it.apply(this,arguments)}),ia=[{title:"Step 1",content:"Complete your basic information"},{title:"Step 2",content:"Add your address details"},{title:"Step 3",content:"Review and submit"}],iu=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("patientId"===t)n&&n$(!0),nz(e);else{if(nZ){var i,l,s=z.Z.get("promotion"),d=z.Z.get("campaign_id"),a=(0,r.Z)((0,o.Z)({event:"guest_upload_documents"},s?{campaign_id:s}:d&&{campaign_id:d},d?{utm_campaign:d}:{}),{eventModel:{hub:null===(i=C().get("hub"))||void 0===i?void 0:null===(l=i.hub)||void 0===l?void 0:l.name,type:"govId",userId:(null==np?void 0:np.userId)||""}});window.dataLayer.push(a)}n&&nW(!0),nU(e)}iA(1)},ic=function(e){"patientId"===e?n$(!1):nW(!1)},iv=function(e){if("patientId"===e){var t;n$(!1),nz((null==np?void 0:null===(t=np.user_documents)||void 0===t?void 0:t.filter(function(e){return"patientId"===e.type&&e.isValid}))||[])}else nW(!1)},ip=nC&&"SHIPMENT"===nX&&(null==nG?void 0:nG.country)!==nR.country&&(null==nh?void 0:null===(eI=nh.headers)||void 0===eI?void 0:eI.netPayable)>nC;(0,b.useEffect)(function(){var e=t_;if(iP()){e1(!0);return}if(eE&&"PICKUP"!==nX)(null==np?void 0:np.firstName)&&(null==np?void 0:np.lastName)&&nr&&(!eY||!nM||(null==nM?void 0:nM.length)!==0||"validForSession"===z.Z.get("age_proof"))?(tP({}),e1(!1)):((null==np?void 0:np.firstName)||(null==np?void 0:np.lastName)?delete e.name:e=(0,r.Z)((0,o.Z)({},e),{name:"Please confirm your details"}),nr?delete e.address:e=(0,r.Z)((0,o.Z)({},e),{address:"Please confirm your contact and delivery address"}),nM&&(null==nM?void 0:nM.length)===0?e=(0,r.Z)((0,o.Z)({},e),{identification:"Government Identification is mandatory"}):delete e.identification,"validForSession"===z.Z.get("age_proof")&&delete e.identification,tP(e));else{if("PICKUP"===nX||(null==np?void 0:np.firstName)&&(null==np?void 0:np.lastName)&&nr){if("PICKUP"===nX&&(!(null==np?void 0:np.firstName)||!(null==np?void 0:np.lastName)||eY&&nM&&(null==nM?void 0:nM.length)===0&&"validForSession"!==z.Z.get("age_proof"))){(null==np?void 0:np.firstName)&&(null==np?void 0:np.lastName)?delete e.name:e=(0,r.Z)((0,o.Z)({},e),{name:"Please confirm first name and last name"}),nM&&(null==nM?void 0:nM.length)===0?e=(0,r.Z)((0,o.Z)({},e),{identification:"Government Identification is mandatory"}):delete e.identification,e1(!0),tP(e);return}}else{nr?delete e.address:e=(0,r.Z)((0,o.Z)({},e),{address:"Please confirm your contact and delivery address"}),(null==np?void 0:np.firstName)&&(null==np?void 0:np.lastName)?delete e.name:e=(0,r.Z)((0,o.Z)({},e),{name:"Please confirm First Name or Last Name"}),tP(e),e1(!0);return}e1(!1)}},[nr,nM,np,nh]);var ih,ig,im,iy,ix,ib=(ii=(0,i.Z)(function(e){var t;return(0,s.__generator)(this,function(n){switch(n.label){case 0:if(sessionStorage.removeItem("appliedCodes"),!e.length)return[3,2];return[4,L.Z.checkPromo(e)];case 1:if(t=n.sent())return nA(t),eD({title:"Promo Code Removed",status:"info",position:"top-right",duration:3e3,isClosable:!0}),[2];n.label=2;case 2:return nh.syncBag(),eD({title:"Promo Code Removed",status:"info",position:"top-right",duration:3e3,isClosable:!0}),[2]}})}),function(e){return ii.apply(this,arguments)}),iw=(ih=(0,i.Z)(function(e){var t,n,i;return(0,s.__generator)(this,function(n){switch(n.label){case 0:if(!((null==tw?void 0:tw.total)&&tI&&il))return[3,4];if(e?sessionStorage.setItem("usedPoint",e):sessionStorage.removeItem("usedPoint"),!(e>=ny/il))return[3,2];return t=eO(ny)/il,[4,L.Z.syncBag(null,!0,t)];case 1:return nA(n.sent()),[3,4];case 2:return[4,L.Z.syncBag(null,!0,e)];case 3:nA(n.sent()),n.label=4;case 4:return[2]}})}),function(e){return ih.apply(this,arguments)}),iC=(ig=(0,i.Z)(function(){var e,t,n,i;return(0,s.__generator)(this,function(o){switch(o.label){case 0:return na(!0),[4,L.Z.getHubPaymentGatewayId()];case 1:if(n=null===(e=null==(t=o.sent())?void 0:t.find(function(e){var t;return(null==e?void 0:null===(t=e.name)||void 0===t?void 0:t.toLowerCase())==="aeropay"}))||void 0===e?void 0:e.paymentGatewayId,t1(t),!(n&&ie))return[3,3];return tm(!0),[4,L.Z.getUserPaymentInfo(n)];case 2:return(null==(i=o.sent())?void 0:i.bankAccounts)&&tR(null==i?void 0:i.bankAccounts),na(!1),[3,4];case 3:na(!1),o.label=4;case 4:return[2]}})}),function(){return ig.apply(this,arguments)}),ij=(im=(0,i.Z)(function(e){return(0,s.__generator)(this,function(t){return e4(e),ne(""),[2]})}),function(e){return im.apply(this,arguments)});(0,i.Z)(function(e){return(0,s.__generator)(this,function(t){return tW(e),[2]})});var iI,iS=(ix=(0,i.Z)(function(){var e,t,n,i,r,l,d,a,u,c;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return tM(!0),window.scrollTo({top:0,left:0,behavior:"instant"}),t6("Connecting with Aeropay"),i=null===(e=null==t0?void 0:t0.find(function(e){var t;return(null==e?void 0:null===(t=e.name)||void 0===t?void 0:t.toLowerCase())==="aeropay"}))||void 0===e?void 0:e.paymentGatewayId,(r={}).currency=nT||eB||"USD",[4,L.Z.getPaymentLink(i,r)];case 1:return(null==(l=s.sent())?void 0:null===(t=l.result)||void 0===t?void 0:t.token)?(t6("Connecting with Aeropay"),tM(!1),tQ({token:null==l?void 0:null===(d=l.result)||void 0===d?void 0:d.token,id:i}),e6()):(null==l?void 0:null===(n=l.result)||void 0===n?void 0:n.existingUser)?(tM(!1),tt((0,o.Z)({paymentGatewayId:i},null==l?void 0:null===(a=l.result)||void 0===a?void 0:a.existingUser)),c=null==l?void 0:null===(u=l.result)||void 0===u?void 0:u.displayMessage,to(),nv(c)):(eD({title:null==l?void 0:l.error,status:"info",position:"top-right",duration:3e3,isClosable:!0}),eT.push("/profile/account")),[2]}})}),function(){return ix.apply(this,arguments)}),iZ=function(){iS()},i_=(iI=(0,i.Z)(function(e){var t,n,i;return(0,s.__generator)(this,function(o){switch(o.label){case 0:return e8(),t6("Hold On Adding Your Account"),tM(!0),[4,L.Z.linkAeroPay(e)];case 1:return o.sent(),n=null===(t=null==t0?void 0:t0.find(function(e){var t;return(null==e?void 0:null===(t=e.name)||void 0===t?void 0:t.toLowerCase())==="aeropay"}))||void 0===t?void 0:t.paymentGatewayId,[4,L.Z.getUserPaymentInfo(n)];case 2:return(null==(i=o.sent())?void 0:i.bankAccounts)&&tR(null==i?void 0:i.bankAccounts),tM(!1),[2]}})}),function(e){return iI.apply(this,arguments)});(0,b.useEffect)(function(){var e;"shipment"!==n0&&n1&&n0&&(null===(e=n1[n0])||void 0===e?void 0:e.length)&&tW(n1[n0][0])},[nX]);var iP=function(){return null!=nD&&!!nD.includes((null==nm?void 0:nm.state)||(null==nG?void 0:nG.state))&&"SHIPMENT"===nX};(0,b.useEffect)(function(){var e;sessionStorage.getItem("tracked_view_checkout")||((0,ee.s$)(null==nh?void 0:null===(e=nh.bag)||void 0===e?void 0:e.map(function(e){return{id:e.productId,name:e.title,brand:e.brandName,category:e.category,price:e.retailPrice,currency:eB||"USD",quantity:e.quantity}})),sessionStorage.setItem("tracked_view_checkout","true"))},[nh]);var ik,iA=function(e){tD((0,l.Z)(tO).concat([e])),e+1<(null==ia?void 0:ia.length)&&tA(e+1)};(0,b.useEffect)(function(){var e=C().get("token");if("PICKUP"===nX){if(e&&(null==np?void 0:np.firstName)&&(null==nM?void 0:nM.length)){tD([0,1]),tA(2);return}e&&(tD([0]),tA(1))}else if("SHIPMENT"===nX){if(e&&(null==np?void 0:np.firstName)&&(null==nG?void 0:nG.addressId)&&!iP&&(null==nM?void 0:nM.length)){tD([0,1,2]),tq(3),tA
1(3);return}if(e&&(null==np?void 0:np.firstName)&&(null==nM?void 0:nM.length)){tD([0,1]),tq(2),tA(2);return}e&&(null==np?void 0:np.firstName)&&(tD([0]),tq(1),tA(1))}else{if(e&&(null==np?void 0:np.firstName)&&(null==nM?void 0:nM.length)&&(null==nG?void 0:nG.addressId)&&!iP){tD([0,1,2]),tA(3);return}if(e&&(null==np?void 0:np.firstName)&&(null==nM?void 0:nM.length)){tD([0,1]),tA(2);return}e&&(null==np?void 0:np.firstName)&&(tD([0]),tA(1))}},[tK,C().get("token"),np,nM,nG]);var iL=(ik=(0,i.Z)(function(){var e,t;return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,L.Z.getLoyalityUserPoints()];case 1:return e=n.sent(),[4,L.Z.getBrandLoyalityDetails()];case 2:return t=n.sent(),tC(e),tS(null==t?void 0:t.has_points),[2]}})}),function(){return ik.apply(this,arguments)});if((0,b.useEffect)(function(){var e;null==np||!np.isAuthenticated||(null===(e=Object.keys(eA))||void 0===e?void 0:e.length)||eL||iL()},[null==np?void 0:np.isAuthenticated]),null==t3?void 0:t3.error)return(0,d.jsx)(c.xu,{minH:"600px",width:"100%",height:"100%",display:"flex",children:(0,d.jsxs)(c.Kq,{alignItems:"center",minH:"600px",justifyContent:"center",height:"100%",width:"100%",spacing:3,children:[(0,d.jsxs)(c.Kq,{textAlign:"center",spacing:"0",children:[(0,d.jsx)(c.xv,{fontSize:"1.5rem",textAlign:"center",fontWeight:"600",children:null==t3?void 0:t3.error}),(0,d.jsx)(c.xv,{fontSize:"16px",children:" you can still pay letter!"})]}),(0,d.jsx)(v.zx,{onClick:function(){eT.push("/orders/".concat(null==t3?void 0:t3.id))},variant:"primary",children:"Continue"})]})});var iO=[{title:"User Details",id:"user-details"}].concat((0,l.Z)(eE||eU?[{title:"Identification",id:"identification"}]:[]),(0,l.Z)("SHIPMENT"===nX||"DELIVERY"===nX?[{title:"Delivery Address",id:"deliveryAddress"}]:[]),(0,l.Z)(eW.length&&(void 0===eM||eM)?[{title:"Payment",id:"payment"}]:[])),iD=function(e){tO.includes(e)||tD((0,l.Z)(tO).concat([e])),e+1<iO.length&&tq(e+1)},iT=function(e){var t=e.user,n=(e.userAddresses,e.addressId,e.handleAddress),i=e.checkoutErrors,o=e.onStepComplete,r=e.isAddressRestricted,l=e.restrictedMessage;return e.deliveryMethod,(0,d.jsx)(E,{guestCheckout:!0,saveAddressId:n,addresses:t.addresses,errors:i,handleStepCompleted:o,isAddressRestricted:r,restrictedMessage:l||"Delivery is not available in this state"})},iE=function(e){var t=e.user,n=(e.userAddresses,e.addressId,e.handleAddress),i=e.checkoutErrors,o=e.onStepComplete,r=e.isAddressRestricted,l=e.restrictedMessage;return e.deliveryMethod,(0,d.jsx)(M.Z,{guestCheckout:!0,saveAddressId:n,addresses:t.addresses,handleAdduserAddress:function(e){nf(e)},errors:i,handleStepCompleted:o,isAddressRestricted:r,restrictedMessage:l||"Delivery is not available in this state"})},iM=function(e){var t=e.showGovtId,n=e.showPatientId,i=e.identification,o=e.medicalCard,r=e.handleVerifyUserDocument,l=e.uploadFields,s=e.checkoutErrors,a=e.onStepComplete;return(0,d.jsxs)(c.xu,{children:[(0,d.jsxs)(c.Kq,{gap:"5",children:[t&&(0,d.jsxs)(c.Kq,{children:[(0,d.jsx)(c.xv,{fontWeight:"600",children:"Government ID"}),(0,d.jsx)(W.Z,{availableAgeProof:i,setFileUrls:r,uploadFields:l,isGuestUser:!0,errors:s.identification})]}),n&&(0,d.jsxs)(c.Kq,{children:[(0,d.jsx)(c.xv,{fontWeight:"600",children:"Patient ID"}),(0,d.jsx)(en,{availableMedicalProof:o,setFileUrls:r})]})]}),(null==iO?void 0:iO.length)>2&&(0,d.jsx)(v.zx,{mt:4,width:"100%",variant:"primary",onClick:a,isDisabled:t&&(null==i?void 0:i.length)===0,children:"Continue"})]})},iU=function(e){var t=e.paymentOptions,n=e.paymentType,i=e.selectedAcountId,o=e.userAccountInfo,r=e.loadingOptions,l=e.showAeropay,s=e.getwayInfo,a=e.paymentSupportText,u=e.handleSetPaymentType,m=e.setSelectedAccountId,f=e.handleOpenAddAccount;return e.onStepComplete,(0,d.jsxs)(c.kC,{direction:{lg:"row",md:"row",sm:"row"},justify:"flex-start",wrap:"wrap",py:"15",gap:5,children:[(0,d.jsx)(p.Ee,{defaultValue:"Cash",onChange:u,value:i?"":n,children:(0,d.jsx)(c.Kq,{width:"100%",spacing:5,direction:"column",children:t.map(function(e){var t,n,i=null==s?void 0:s.find(function(t){var n;return(null==t?void 0:t.name.toLowerCase())===(null==e?void 0:null===(n=e.key)||void 0===n?void 0:n.toLowerCase())});if((null==e?void 0:null===(t=e.key)||void 0===t?void 0:t.toLowerCase())!=="aeropay"&&i||(null==e?void 0:null===(n=e.key)||void 0===n?void 0:n.toLowerCase())==="cash")return(0,d.jsx)(p.Y8,{width:"100%",color:"brand",borderColor:"brand",colorScheme:"brand",value:e.key,children:(0,d.jsx)(c.Ug,{marginLeft:"8px",minW:"288px",justifyContent:"space-between",width:"100%",alignItems:"center",border:"1px solid",borderColor:"color",padding:"12px 8px",borderRadius:"6px",children:(0,d.jsx)(c.xv,{variant:"pageText",children:e.name})})},null==e?void 0:e.key)})})}),r&&!(null==o?void 0:o.length)&&(0,d.jsx)(h.Od,{marginLeft:"32px",width:"280px",borderRadius:"6px",height:"38px"}),(0,d.jsxs)(c.Kq,{spacing:5,alignItems:"flex-start",children:[(null==o?void 0:o.length)>0&&(0,d.jsx)(c.Kq,{spacing:5,children:(0,d.jsx)(c.Kq,{spacing:5,width:"100%",children:(0,d.jsx)(p.Ee,{value:i||"",onChange:m,children:(0,d.jsx)(c.Kq,{spacing:5,direction:"column",children:null==o?void 0:o.map(function(e){return(0,d.jsx)(p.Y8,{value:null==e?void 0:e.bankAccountId,color:"brand",borderColor:"brand",colorScheme:"brand",children:(0,d.jsxs)(c.Ug,{marginLeft:"8px",minW:"288px",justifyContent:"space-between",width:"100%",alignItems:"center",border:"1px solid",borderColor:"color",padding:"12px 8px",borderRadius:"6px",children:[(0,d.jsx)(c.xv,{variant:"pageText",children:null==e?void 0:e.bankName}),(0,d.jsx)(c.xv,{variant:"pageTextDim",children:null==e?void 0:e.name})]},null==e?void 0:e.bankAccountId)},null==e?void 0:e.bankAccountId)})})})})}),l&&!(null==o?void 0:o.length)&&(0,d.jsx)(p.Y8,{color:"brand",borderColor:"brand",onClick:function(){return f()},colorScheme:"brand",children:(0,d.jsxs)(c.Ug,{marginLeft:"8px",minW:"288px",onClick:function(){return f()},width:"100%",alignItems:"center",border:"1px solid",borderColor:"color",padding:"12px 8px",borderRadius:"6px",children:[(0,d.jsx)(c.xv,{fontWeight:"500",fontSize:"14px",children:"Pay by bank with"}),(0,d.jsx)(G.Z,{width:"100px"})]})}),l&&(null==o?void 0:o.length)&&(0,d.jsx)(c.Ug,{width:"100%",children:(0,d.jsxs)(v.zx,{onClick:function(){return f()},marginLeft:"32px",minW:"298px",variant:"primary",children:["Add account using",(0,d.jsx)(G.Z,{width:"100px"})]})}),l&&(0,d.jsxs)(c.gC,{spacing:2,alignItems:"flex-start",padding:"16px",bg:"secondary",borderRadius:"12px",width:"100%",children:[(0,d.jsx)(c.xv,{fontSize:"14px",fontWeight:"600",children:"Secure contactless payments. Simply link your bank and pay"}),(0,d.jsxs)(c.Ug,{spacing:"0",gap:"12px",children:[(0,d.jsx)(g.Ee,{width:"24px",src:"https://res.cloudinary.com/dcwq74lfg/image/upload/v1700122549/download_11.png"}),(0,d.jsx)(g.Ee,{width:"24px",src:"https://res.cloudinary.com/dcwq74lfg/image/upload/v1700122549/download_9.png"}),(0,d.jsx)(g.Ee,{width:"24px",src:"https://res.cloudinary.com/dcwq74lfg/image/upload/v1700122549/download_10.png"}),(0,d.jsx)(g.Ee,{width:"70px",src:"https://res.cloudinary.com/dcwq74lfg/image/upload/v1700123078/capital-one-logo.svg"}),(0,d.jsx)(c.xv,{fontSize:"12px",fontWeight:"600",children:"+ 1000s more"})]})]})]}),a&&(0,d.jsxs)(c.xv,{fontSize:"14px",textTransform:"none",children:[" ",(0,d.jsx)("p",{dangerouslySetInnerHTML:{__html:a}})]})]})};return(0,d.jsxs)(d.Fragment,{children:[tF||tE||e9?(0,d.jsxs)(c.xu,{width:"100%",height:"80vh",display:"flex",justifyContent:"center",alignItems:"center",children:[(0,d.jsxs)(c.Kq,{alignItems:"center",width:"fit-content",justifyContent:"center",children:[(0,d.jsx)(m.$,{width:7,height:7,size:"sm",thickness:"3px",color:"brand.400",speed:"0.65s",emptyColor:"gray.200"}),t9&&(0,d.jsx)(c.xv,{children:t9})]}),e9&&(null==t$?void 0:t$.token)&&(0,d.jsx)(J.Z,{onSucccess:function(e){return i_(e)},paymentGatewayId:null==t$?void 0:t$.id,isOpen:e9,onClose:e8,token:null==t$?void 0:t$.token})]}):(null==nh?void 0:null===(eS=nh.bag)||void 0===eS?void 0:eS.length)===0?(0,d.jsx)(c.xu,{maxW:{base
1:"3xl",lg:"7xl"},mx:"auto",px:{base:"4",md:"8",lg:"12"},py:{base:"6",md:"8",lg:"12"},children:(0,d.jsxs)(c.gC,{mt:"16px",spacing:8,width:"100%",children:[(0,d.jsx)(c.xv,{textAlign:"center",variant:"pageTitle",children:"Checkout"}),(0,d.jsxs)(c.xv,{fontSize:"sm",children:[" ",eK," "]}),(0,d.jsx)(N(),{href:nI||"/",passHref:!0,children:(0,d.jsx)(v.zx,{variant:"primary",children:"Continue Shopping"})})]})}):(0,d.jsxs)(c.xu,{maxW:{base:"3xl",lg:"7xl"},mx:"auto",py:{base:"4",md:"8",lg:"12"},children:[(0,d.jsxs)(c.Kq,{direction:{base:"column",lg:"row"},align:{lg:"flex-start"},spacing:{base:"8",md:"20"},children:[(0,d.jsxs)(c.Kq,{mt:"24px",width:{sm:"100%",md:"55%"},spacing:{base:"50px"},children:[(0,d.jsx)(S.default,{steps:iO,handleStepClick:function(e){return tq(e)},currentStep:tN,completedSteps:tO}),(0,d.jsx)(c.xu,{children:function(){switch(tN){case 0:return(0,d.jsx)(iT,{user:np,userAddresses:eP,addressId:nr,handleAddress:n4,checkoutErrors:t_,onStepComplete:function(){if(nZ){var e,t,n=z.Z.get("promotion"),i=z.Z.get("campaign_id"),l=(0,r.Z)((0,o.Z)({event:"guest_login"},n?{campaign_id:n}:i&&{campaign_id:i},i?{utm_campaign:i}:{}),{eventModel:(0,o.Z)({hub:null===(e=C().get("hub"))||void 0===e?void 0:null===(t=e.hub)||void 0===t?void 0:t.name},np.id?{userId:null==np?void 0:np.userId}:{})});window.dataLayer.push(l)}iD(0)},isAddressRestricted:iP(),restrictedMessage:nS,deliveryMethod:nX});case iO.findIndex(function(e){return"deliveryAddress"===e.id}):return(0,d.jsx)(iE,{user:np,userAddresses:eP,addressId:nr,handleAddress:n4,checkoutErrors:t_,onStepComplete:function(){return iD(tN)},isAddressRestricted:iP(),restrictedMessage:nS,deliveryMethod:nX});case iO.findIndex(function(e){return"identification"===e.id}):return(0,d.jsx)(iM,{showGovtId:eE,showPatientId:eU,identification:nM,medicalCard:nq,handleVerifyUserDocument:iu,uploadFields:eN,checkoutErrors:t_,onStepComplete:function(){iD(tN)}});case iO.findIndex(function(e){return"payment"===e.id}):return(0,d.jsx)(iU,{paymentOptions:eW,paymentType:e3,selectedAcountId:t7,userAccountInfo:tG,loadingOptions:nd,showAeropay:tg,getwayInfo:t0,paymentSupportText:eF,handleSetPaymentType:ij,setSelectedAccountId:ne,handleOpenAddAccount:iS,onStepComplete:function(){if(nZ){var e,t,n,i,l=z.Z.get("promotion"),s=z.Z.get("campaign_id"),d=(null==nh?void 0:null===(e=nh.bag)||void 0===e?void 0:e.map(function(e){var t;return{item_id:e.hubProductId||"",item_name:e.title||"",price:e.retailPrice||"",quantity:e.quantity||"",item_variant:(null===(t=e.attrs.find(function(e){return"Size"===e.name}))||void 0===t?void 0:t.value)||"",currency:"USD",coupon:"",item_category:e.category||"",value:e.totalPayable||""}}))||[],a=(0,r.Z)((0,o.Z)({event:"add_payment_info"},l?{campaign_id:l}:s&&{campaign_id:s},s?{utm_campaign:s}:{}),{eventModel:(0,o.Z)({hub:null===(t=C().get("hub"))||void 0===t?void 0:null===(n=t.hub)||void 0===n?void 0:n.name,currency:eB,value:(null==nh?void 0:null===(i=nh.headers)||void 0===i?void 0:i.netPayable)||0,items:d},np.id?{userId:null==np?void 0:np.userId}:{})});window.dataLayer.push(a)}iD(tN)}});default:return null}}()})]}),(0,d.jsxs)(c.kC,{width:"100%",borderRadius:"12px",padding:"0",direction:"column",flex:"1",rowGap:"15px",children:[ip&&(0,d.jsx)(c.Kq,{children:(0,d.jsxs)(f.bZ,{status:"info",children:[(0,d.jsx)(f.zM,{}),nj||"Order limit Exceed for Internaltional Orders"]})}),!nP&&(0,d.jsx)(c.kC,{direction:{lg:"row",md:"row",sm:"row"},justify:"flex-start",wrap:"wrap",gap:"15px",children:null==nh?void 0:null===(eZ=nh.bag)||void 0===eZ?void 0:eZ.map(function(e){var t,n=eQ&&(null==e?void 0:e.discountCode)&&n9.has(e.discountCode)&&n6.has(e.discountCode);return"Bundles"===e.category?null==e?void 0:null===(t=e.customer_bundles)||void 0===t?void 0:t.map(function(t,i){return(0,d.jsx)(R.Z,{showCoutToggle:!1,brand:null==e?void 0:e.brandName,title:e.title,quantity:e.quantity,category:e.category,price:n?"FREE":parseInt(e.priceExclusive)/(null==e?void 0:e.customer_bundles.length),hubProductId:e.hubProductId,availableInventory:e.availableInventory,id:e.productId,productId:e.productId,attrs:null==e?void 0:e.attrs,product_group:null==e?void 0:e.product_group,img:(0,$.Z)(null==e?void 0:e.assets),bundleDetails:null==t?void 0:t.customer_bundle_details},t.customer_bundle_id)}):(0,d.jsx)(R.Z,{showCoutToggle:!1,brand:null==e?void 0:e.brandName,title:e.title,quantity:e.quantity,category:e.category,price:n?"FREE":e.priceExclusive,hubProductId:e.hubProductId,availableInventory:e.availableInventory,id:e.productId,productId:e.productId,attrs:null==e?void 0:e.attrs,product_group:null==e?void 0:e.product_group,img:(0,$.Z)(null==e?void 0:e.assets)},e.slug)})}),!nP&&(0,d.jsx)(c.xv,{width:"100%",textAlign:"center",variant:"pageTitle",children:"Order Summary"}),!nP&&(0,d.jsx)(Z.M,(0,r.Z)((0,o.Z)({},nh),{hideTaxBeforeAddress:!!(void 0!==n_&&n_)&&(!!iP()||!nr),spendRatio:il,userPoints:null==tw?void 0:tw.total,isLoyalityHas_points:tI,onPointsChange:iw})),(0,d.jsx)(H.Z,{showPromotions:eH}),(null==n8?void 0:n8.length)>
10&&(0,d.jsx)(P.Z,{dir:"col",border:!0,heading:"Applied Promotions",children:(0,d.jsx)(c.kC,{gap:"12px",flexWrap:"wrap",width:"100%",marginTop:3,children:n8.map(function(e){return(0,d.jsxs)(y.Vp,{size:"md",padding:"6px",variant:"outline",border:"1px solid",borderColor:"brand.400",colorScheme:"brand.400",children:[(0,d.jsx)(c.xu,{borderRadius:"50%",padding:"3px 5px",bg:"brand.400",display:"flex",alignItems:"center",justifyContent:"center",marginRight:2,children:(0,d.jsx)(q.nQ,{width:"12px",height:"12px",color:"white"})}),(0,d.jsx)(y.Sn,{fontWeight:"600",fontSize:"12px",children:e}),!n5.includes(e)&&(0,d.jsx)(y.SD,{onClick:function(){ib(n8.filter(function(t){return e!==t}))}})]},e+2)})})}),(0,d.jsx)(v.zx,{variant:"primary",mx:"auto",width:"100%",mt:5,opacity:e0?".5":"1",onClick:id,minW:"175px",isLoading:tF,isDisabled:tF||e0,loadingText:"Placing order...",children:void 0===eJ?"Place Order":eJ}),ez&&(0,d.jsx)(c.xv,{variant:"pageTextDim",children:(0,d.jsx)("p",{dangerouslySetInnerHTML:{__html:ez}})}),(void 0===eG||eG)&&(0,d.jsx)(v.zx,{fontSize:"14px",textDecor:"underline",bg:"transparent",lineHeight:"21px",_hover:{bg:"transparent"},onClick:function(){if(nI){eT.push(nI);return}eT.push("/")},children:"Continue shopping"})]})]}),!!(null==nM?void 0:nM.length)&&nK&&(0,d.jsx)(F.Z,{isVisible:!!(null==nM?void 0:nM.length)&&nK,handleClose:ic,type:"age_proof",document:nM?nM[0]:"",handleCancel:iv}),!!(null==nq?void 0:nq.length)&&nJ&&(0,d.jsx)(F.Z,{isVisible:!!(null==nq?void 0:nq.length)&&nJ,handleClose:ic,type:"patientId",document:nq.length&&nq[0],handleCancel:iv}),ti&&(0,d.jsx)(Q.Z,{handleSuccess:iZ,data:te,message:nc,isVisible:ti,onClose:tr})]})," ",ts&&(0,d.jsx)(j.Z,{orderId:null==ty?void 0:ty.orderId,paymentGatewayId:null==ty?void 0:ty.gateWayId,isOpen:ts,onClose:ta}),tc&&(null==nF?void 0:nF.secruteKey)?(0,d.jsx)(I.Z,{isOpen:tc,onClose:tp,stripeData:nF}):(0,d.jsx)(d.Fragment,{})]})}},58634:function(e,t,n){"use strict";var i=n(26042),o=n(69396),r=n(85893),l=n(52494);n(67294);var s=function(e){return(0,r.jsxs)(l.JO,(0,o.Z)((0,i.Z)({fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 214.98 36"},e),{children:[(0,r.jsx)("defs",{children:(0,r.jsx)("style",{})}),(0,r.jsx)("g",{id:"a"}),(0,r.jsx)("g",{id:"b",children:(0,r.jsx)("g",{id:"c",children:(0,r.jsxs)("g",{children:[(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M70.53,28.38v-1.13l.73-.9,.11-.39c-.28,.34-.62,.62-.96,.9-1.69,1.24-3.84,1.86-6.43,1.86-1.52,0-2.99-.28-4.4-.9s-2.65-1.41-3.72-2.48-1.92-2.31-2.48-3.72-.85-2.88-.85-4.4,.28-3.05,.85-4.46,1.47-2.71,2.54-3.78c1.02-1.07,2.26-1.97,3.67-2.54s2.88-.9,4.34-.85c2.65,0,4.85,.68,6.55,1.97,.28,.23,.62,.51,.85,.73l-.11-.34-.73-.9v-1.3h6.09V28.33h-6.04v.06h0Zm-6.04-17.27c-.79,0-1.58,.11-2.31,.45-.73,.28-1.41,.79-1.92,1.35-1.13,1.18-1.69,2.71-1.69,4.29s.62,3.16,1.69,4.29c.56,.56,1.18,1.02,1.92,1.35,.73,.28,1.52,.45,2.31,.45s1.64-.11,2.37-.45c.73-.28,1.47-.73,2.03-1.35,.56-.56,1.02-1.24,1.3-1.97s.45-1.52,.45-2.31-.17-1.58-.45-2.31-.73-1.41-1.35-1.97c-.56-.56-1.24-1.02-1.97-1.35-.79-.28-1.58-.45-2.37-.45Z"}),(0,r.jsx)("path",{d:"M101.34,23.53c-2.37,3.55-5.92,5.36-10.72,5.36-3.55,0-6.43-1.13-8.63-3.33-2.14-2.31-3.27-5.3-3.27-8.41s1.18-6.15,3.33-8.41c2.26-2.26,5.08-3.39,8.58-3.39s6.26,1.07,8.35,3.22,3.1,4.91,3.1,8.24v.9c0,.34-.06,.62-.06,.85v.39h-17.27c.28,1.35,1.02,2.6,2.09,3.44,1.13,.85,2.48,1.3,3.89,1.24,1.18,.06,2.31-.23,3.39-.73,1.07-.51,1.92-1.3,2.6-2.26l4.63,2.88Zm-10.72-13.15c-2.93,0-4.8,1.35-5.64,4.12h10.95c-.28-1.24-.96-2.31-1.92-3.05-.96-.73-2.14-1.13-3.39-1.07Z"}),(0,r.jsx)("path",{d:"M110.42,28.38h-6.15V5.81h6.09v2.43l-.34,1.07s.34-.51,.39-.51c.73-1.07,1.69-1.92,2.82-2.48s2.43-.9,3.67-.85v6.15c-2.2,0-3.78,.56-4.91,1.69-1.07,1.13-1.64,2.71-1.64,4.74l.06,10.33h0Z"}),(0,r.jsx)("path",{d:"M129.27,5.36c1.58-.06,3.22,.23,4.68,.85,1.47,.56,2.82,1.47,4.01,2.6,1.13,1.07,1.97,2.43,2.6,3.84s.9,2.99,.9,4.51-.28,3.1-.9,4.51-1.47,2.76-2.6,3.84c-2.37,2.2-5.47,3.39-8.63,3.39s-6.32-1.18-8.69-3.39c-1.07-1.07-1.97-2.43-2.54-3.84-.62-1.41-.9-2.99-.9-4.51s.28-3.1,.9-4.51,1.47-2.76,2.6-3.84c1.13-1.13,2.48-2.03,3.95-2.6,1.47-.62,3.05-.9,4.63-.85Zm4.34,7.34c-1.13-1.13-2.71-1.81-4.34-1.81s-3.16,.62-4.34,1.81c-.56,.56-1.02,1.3-1.3,2.03-.28,.79-.45,1.58-.39,2.43-.06,.85,.11,1.64,.39,2.43,.28,.79,.73,1.47,1.3,2.09,.56,.56,1.18,1.02,1.92,1.35,.73,.28,1.52,.45,2.31,.45,.85,0,1.64-.11,2.37-.45s1.47-.79,2.03-1.35c1.13-1.18,1.81-2.82,1.81-4.46,0-1.69-.62-3.27-1.75-4.51h0Z"}),(0,r.jsx)("path",{d:"M155.56,28.72c-1.47,.06-2.93-.23-4.34-.79-1.35-.56-2.6-1.41-3.67-2.43l-.39-.56,.39,1.07v9.99h-3.78V6.09l3.89-.39v2.93l-.34,.96,.34-.51c1.97-2.2,4.63-3.33,7.96-3.33,1.47,
10,2.99,.28,4.34,.85,1.35,.56,2.6,1.41,3.67,2.48,2.14,2.14,3.33,5.08,3.33,8.13s-1.18,5.98-3.33,8.13c-1.02,1.07-2.26,1.92-3.67,2.48-1.41,.68-2.88,.96-4.4,.9Zm-.17-19.3c-2.09,0-4.12,.85-5.59,2.31s-2.31,3.5-2.31,5.59,.85,4.12,2.31,5.59,3.5,2.31,5.59,2.31c1.02,0,2.03-.17,2.99-.56,.96-.39,1.81-.96,2.54-1.75,1.41-1.52,2.2-3.5,2.2-5.59s-.79-4.06-2.2-5.59c-.73-.73-1.58-1.35-2.54-1.75-.96-.39-1.97-.62-2.99-.56Z"}),(0,r.jsx)("path",{d:"M188.29,28.38v-2.99c-2.03,2.26-4.68,3.33-8.01,3.33-1.47,0-2.99-.28-4.34-.85-1.35-.56-2.6-1.41-3.67-2.48-2.14-2.14-3.33-5.08-3.33-8.13s1.18-5.98,3.33-8.13c1.02-1.07,2.26-1.92,3.67-2.48s2.88-.85,4.34-.85c1.47-.06,2.99,.23,4.34,.79,1.35,.56,2.65,1.41,3.67,2.48v-2.93h3.84V28.44l-3.84-.06Zm-7.84-18.96c-1.02,0-2.03,.17-2.99,.56-.96,.39-1.81,.96-2.54,1.75-1.41,1.52-2.2,3.5-2.2,5.59s.79,4.06,2.2,5.59c.73,.73,1.58,1.35,2.54,1.75,.96,.39,1.97,.56,2.99,.56,2.09,0,4.12-.85,5.59-2.31s2.31-3.5,2.31-5.59-.85-4.12-2.31-5.59c-1.47-1.47-3.44-2.31-5.59-2.31h0Z"}),(0,r.jsx)("path",{d:"M214.98,6.09l-7.9,21.67c-1.07,2.93-2.37,5.02-3.89,6.32-1.58,1.3-3.61,1.92-6.09,1.92h-1.02v-3.5h1.02c2.71,0,4.74-1.52,6.04-4.51l-8.92-21.89h4.29l6.55,16.87,5.92-16.87h4.01Z"})]}),(0,r.jsx)("path",{class:"d",d:"M10.44,20.03h0c1.35-.73,24.04-13.49,24.6-13.77,.17-.17,.45-.23,.68-.34,.23-.11,.51-.06,.68,.06,.17,.17,.23,.39,.17,.62-.11,.17-.23,.39-.45,.51-.28,.17-24.09,15.07-25.11,15.69-.68,.45-1.3,.9-1.35,1.81-.06,.45,.17,.79,.45,1.13,.28,.23,.73,.39,1.13,.39s.79-.06,1.18-.06c1.18,0,2.43,.45,3.39,1.18,1.13,.96,2.09,2.09,2.76,3.39,.45,.73,1.18,2.09,2.2,2.09h.06l.34,.06c.85,.06,1.58-.73,2.09-1.47,2.26-2.93,21.5-28.61,22.29-29.91,.28-.45,.23-1.3-.56-1.41-.56-.11-36.73,10.61-38.37,11.12l-1.86,.62-.51,.17-.51,.17c-.34,.11-.68,.17-.96,.34-.73,.23-1.47,.51-2.09,.79-.17,.11-.39,.23-.51,.39-.17,.17-.17,.45-.17,.68,0,.51,.28,.9,.79,1.13,.68,.28,1.41,.56,2.09,.79,1.97,.73,3.72,1.92,4.97,3.55,.23,.34,.45,.62,.9,.68,.34,.06,.68,0,1.02-.11l.68-.28Z"})]})})})]}))};t.Z=s},85993:function(e,t,n){"use strict";var i=n(85893),o=n(80419),r=n(48641);n(9008);var l=n(67294);n(35119);var s=function(e){e.isOpen;var t=e.onClose,n=e.token,s=e.paymentGatewayId,d=e.onSucccess,a=void 0===d?function(){}:d,u=(0,o.pm)(),c=function(e){a(e)};return(0,l.useEffect)(function(){window.scrollTo({top:0,left:0,behavior:"instant"})}),(0,l.useEffect)(function(){n&&(document.getElementById("openBank"),new window.AerosyncConnect({token:n,id:"widget",iframeTitle:"Connect",width:"100%",height:"100%",style:{bgColor:"#000",opacity:".5"},environment:"production",onEvent:function(e,t){console.log("onEvent",e,t)},onLoad:function(e){console.log("onLoad",e)},onClose:function(e){console.log("onLoad",e),t()},onSuccess:function(e){c({user_id:e.user_id,user_password:e.user_password,paymentGatewayId:s})},onBankAdded:function(e){},onError:function(e){t(),u({title:"There is an issue with the payment using AeropAY. Please try again later. ",status:"info",position:"top-right",duration:3e3,isClosable:!0})}}).launch())},[n]),console.log("modal is calling"),(0,i.jsxs)(r.xu,{width:"100vw",height:"200vh",position:"absolute",top:"-140px",zIndex:"99999999999999",bg:"#fff",children:[(0,i.jsx)("div",{id:"widget"}),(0,i.jsx)("p",{id:"wrapData"})]})};t.Z=s},11637:function(e,t,n){"use strict";var i=n(47568),o=n(97582),r=n(85893),l=n(51469),s=n(80419),d=n(48641),a=n(76289),u=n(47741),c=n(82580),v=n(67294),p=n(74231),h=n(98087),g=n(35119),m=n(48046),f=n(58634),y=function(e){var t,n,y=e.isVisible,x=e.onClose,b=e.message,w=e.data,C=e.handleSuccess,j=void 0===C?function(){}:C,I=(0,v.useContext)(h.Z).cms,S=(null===(n=null==I?void 0:null===(t=I.globals)||void 0===t?void 0:t.settings[0])||void 0===n?void 0:n.mode)||"light";(0,l.Sx)({sm:"4rem",lg:"7rem"});var Z,_,P=(0,s.pm)(),k=(Z=(0,i.Z)(function(e){var t,n;return(0,o.__generator)(this,function(i){switch(i.label){case 0:return t={user_pg_id:null==w?void 0:w.userId,phone_number:null==w?void 0:w.phone,paymentGatewayId:null==w?void 0:w.paymentGatewayId,code:"".concat(e)},[4,g.Z.confirmUserAeropay(t)];case 1:return(n=i.sent()).success?(x(),j()):P({title:null==n?void 0:n.error,status:"info",position:"top-right",duration:3e3,isClosable:!0}),[2]}})}),function(e){return Z.apply(this,arguments)}),A=p.Ry().shape({oneTimeCode:p.Z_().required("enter you one time code").matches(/^[0-9]+$/,"Must be only digits").min(6,"Must be exactly 6 digits").max(6,"Must be exactly 6 digits")});return(0,r.jsx)(d.xu,{height:"100vh",children:(0,r.jsxs)(a.u_,{isOpen:y,onClose:x,closeOnOverlayClick:!0,size:"lg",children:[(0,r.jsx)(a.ZA,{backdropFilter:"auto",backdropBlur:"7px"}),(0,r.jsxs)(a.hz,{mx:"4",children:[(0,r.jsx)(a.ol,{}),(0,r.jsx)(a.fe,{padding:"1rem 12px",borderRadius:"12px",bg:"secondary",color:"dark"===S?"#fff":"#000",children:(0,r.jsxs)(d.Kq,{padding:{sm:"12px 16px",md:"21px 16px",lg:"36px 16px"},spacing:{base:"8",md:"8"},width:"100%",alignItems:"center",children:[(0,r.jsx)(f.Z,{width:"200px"}),(0,r.jsx)(d.xv,{fontSize:"14px",textAlign:"center",variant:"detail",children:(void 0===b?"":b)||"You've previously used AeroPay to pay another business using this phone number. Please verify your identity by entering the pin sent to your email."}),(0,r.jsx)(c.J9,{initialValues:{oneTimeCode:""},onSubmit:(_=(0,i.Z)(function(e){return(0,o.__generator)(this,function(t){switch(t.label){case 0:return[4,k(null==e?void 0:e.oneTimeCode)];case 1:return t.sent(),[2]}})}),function(e){return _.apply(this,arguments)}),validationSchema:A,children:function(e){var t=e.handleSubmit,n=e.isSubmitting;return(0,r.jsx)("form",{style:{width:"100%"},onSubmit:t,children:(0,r.jsxs)(d.gC,{width:"100%",spacing:5,children:[(0,r.jsx)(m.Z,{label:"",variant:"formInput",placeholder:"One time code",type:"number",pattern:"\\\\d*",autocomplete:"one-time-code",name:"oneTimeCode",isDisabled:n}),(0,r.jsx)(u.zx,{height:"42px",width:"100%",variant:"primary",type:"submit",isLoading:n,isDisabled:n,loadingText:"Verifying...",children:"Submit"})]})})}})]})})]})]})})};t.Z=y}},function(e){e.O(0,[8074,8806,8491,4620,2344,250,2753,5239,3550,8348,9774,2888,179],function(){return e(e.s=99776)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.