1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8026],{26117:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard",function(){return n(12893)}])},12893:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return V}});var r=n(47568),i=n(26042),s=n(69396),o=n(97582),a=n(85893),l=n(67294),d=n(51469),u=n(48641),c=n(23887),p=n(47741),h=n(39653),m=n(80419),x=n(31955),v=n(20531),f=n(11163),g=n(98087),y=n(89530),b=n(58971),j=n.n(b),Z=n(35119),C=n(21949),S=n(85663),_=n(34839),k=n(74148),w=n(51113),A=n(75989),N=n(35644),z=n(48046),D=n(46524),I=n(41664),P=n.n(I),B=n(82580),q=n(74231),O=n(36273),E=n(1728),W=function(e){var t=e.src,n=e.aspectRatio,r=(0,d.Sx)({base:!0,md:!1,lg:!1}),i=(0,d.Sx)({base:!1,md:!0,lg:!1}),s=(0,d.Sx)({base:!1,md:!1,lg:!0})&&t.lg||i&&(t.md||t.lg)||r&&(t.sm||t.md||t.lg)||t.lg||"",o=s.endsWith(".mp4")||s.endsWith(".webm")||/\bvideo\b/.test(s);return(0,a.jsx)(u.oM,{ratio:n,width:"100%",children:o?(0,a.jsx)("video",{src:s,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover"}}):(0,a.jsx)(c.Ee,{src:s,alt:"banner",objectFit:"cover",width:"100%",height:"100%"})})},L=function(e){return l.createElement(S.Tags,e)},U=function(e){var t=e.styles,n=e.products,r=e.data,o=e.hubName;return(0,a.jsxs)(u.kC,(0,s.Z)((0,i.Z)({flexDirection:{base:"column",md:"row"},width:"100%"},null==t?void 0:t.container),{children:[(0,a.jsxs)(u.xu,{width:{base:"100%",md:"40%"},textAlign:"left",p:4,display:"flex",flexDirection:{md:"column",sm:"row"},alignItems:{md:"flex-start",sm:"center"},justifyContent:{md:"flex-start",sm:"space-between"},children:[(0,a.jsx)(u.xv,(0,s.Z)((0,i.Z)({textTransform:"capitalize",fontSize:{md:"2.5rem",sm:"1.5rem"}},null==t?void 0:t.heading),{children:"New Arrivals"})),(0,a.jsx)(p.zx,(0,s.Z)((0,i.Z)({mt:{md:4,sm:0},border:"2px solid #000",fontSize:{md:"1.2rem",sm:"1rem"},borderRadius:"50px",fontWeight:"400",padding:{md:"20px 40px",sm:"6px 12px"}},null==t?void 0:t.button),{href:"/shop",children:(0,a.jsx)(P(),{href:"/shop",children:"Shop All"})}))]}),(0,a.jsx)(u.xu,{width:{base:"100%",md:"60%"},p:{md:4,sm:0},display:{base:"none",md:"block"},children:(0,a.jsx)(L,{data:r,content:{title:{},productCardComponent:"custom",isCarousel:!0,showButton:!0,showViewAll:!1},sectionData:{products:n,filterMetaData:{}},settings:{},wraperSettings:{},productStackSettings:{},productsCardSetting:{margin:"0px"},hubName:o||"",index:0,sortItem:null,sortType:null,allowSort:!1,limit:10,pageName:"dashboard",showNoText:!0})}),(0,a.jsx)(u.xu,{width:{base:"100%",md:"60%"},p:{md:4,sm:0},display:{base:"block",md:"none"},children:(0,a.jsx)(L,{data:r,content:{title:{},productCardComponent:"custom",isCarousel:!1,showButton:!0,showViewAll:!1},sectionData:{products:n,filterMetaData:{}},settings:{},wraperSettings:{},productStackSettings:{},productsCardSetting:{margin:"0px"},hubName:o||"",index:0,sortItem:null,sortType:null,allowSort:!1,limit:10,pageName:"dashboard",showNoText:!0})})]}))},T=function(e){e.styles;var t,n=(0,l.useState)([]),s=n[0],d=n[1],c=(0,l.useState)(!0),x=c[0],v=c[1],f=(0,l.useState)(""),g=f[0],y=f[1],b=(0,l.useState)({secruteKey:"",orderId:"",payment_intent_id:"",paymentGatewayId:""}),S=b[0],k=b[1],w=(0,h.qY)(),A=w.isOpen,N=w.onOpen,z=w.onClose,D=(0,l.useContext)(C.Z),I=D.currency,B=D.hideTaxInCart,q=void 0!==B&&B,E=(0,m.pm)(),W={duration:4e3,isClosable:!0,position:"top-right"};(0,l.useEffect)(function(){(0,r.Z)(function(){var e;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,3,4]),[4,Z.Z.getAllOrders({Authorization:"Bearer ".concat(j().get("token"))})];case 1:return d(Array.isArray(e=t.sent())?e:[]),[3,4];case 2:return t.sent(),E((0,i.Z)({title:"Could not load orders.",status:"error"},W)),[3,4];case 3:return v(!1),[7];case 4:return[2]}})})()},[]);var L=(t=(0,r.Z)(function(e){var t,n,r,s,a,l,d,u,c;return(0,o.__generator)(this,function(o){switch(o.label){case 0:return y(e),[4,Z.Z.getHubPaymentGatewayId()];case 1:if(t=o.sent(),n={orderId:e.toString(),currency:I||"USD"},!(r=Array.isArray(t)?t.find(function(e){return"stripe"===e.name.toLowerCase()}):null))return[3,3];return[4,Z.Z.getPaymentLink(r.paymentGatewayId,n)];case 2:if(null==(a=null==(s=o.sent())?void 0:s.result)?void 0:a.client_secret)return k({secruteKey:a.client_secret,orderId:e,payment_intent_id:a.id||"",paymentGatewayId:r.paymentGatewayId}),N(),[2];o.label=3;case 3:if(!(Array.isArray(t)&&t.length))return[3,5];return[4,Z.Z.getPaymentLink(t[0].paymentGatewayId,n)];case 4:if(c=null==(u=o.sent())?void 0:null===(l=u.result)||void 0===l?void 0:null===(d=l.payment_link)||void 0===d?void 0:d.url)return window.open(c,"_self"),[2];o.label=5;case 5:return y(""),E((0,i.Z)({title:"Payment gateway error, please try again later.",status:"info"},W)),[2]}})}),function(e){return t.apply(this,arguments)});return(0,a.jsxs)(u.xu,{children:[x?(0,a.jsx)(u.xu,{}):s.length?(0,a.jsx)(u.gC,{spacing:4,align:"stretch",children:s.map(function(e){var t=new Date(e.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return(0,a.jsxs)(u.xu,{borderWidth:"1px",borderRadius:"md",p:4,children:[(0,a.jsx)(u.xv,{fontSize:"sm",color:"gray.500",children:t}),(0,a.jsxs)(u.Ug,{justify:"space-between",mb:0,children:[(0,a.jsxs)(u.xv,{mb:1,fontWeight:600,textTransform:"uppercase",fontSize:{md:"1.5rem",sm:"1.2rem"},children:["Order ",e.currentStep]}),(0,a.jsx)(u.xv,{fontSize:{md:"1.5rem",sm:"1.2rem"},color:"gray.900",children:q?(0,O.Z)(null==e?void 0:e.subTotal,{currency:I},2,!0):e?(0,O.Z)(void 0!==e.netPayable&&null!==e.netPayable?e.netPayable:null==e?void 0:e.total,{currency:I}):(0,O.Z)(0,{currency:I},2,!0)})]}),(0,a.jsx)(P(),{href:"orders/".concat(e.orderId),passHref:!0,children:(0,a.jsx)(p.zx,{variant:"link",fontWeight:400,fontSize:{md:"1.5rem",sm:"1.2rem"},_hover:{textDecoration:"underline"},opacity:.8,children:(0,a.jsxs)("i",{children:["#",e.orderId]})})}),"PAYMENT_PENDING"===e.currentStep&&(0,a.jsx)(p.zx,{size:"sm",onClick:function(){return L(e.orderId)},isLoading:g===e.orderId,children:"Pay Now"})]},e.orderId)})}):(0,a.jsx)(u.xv,{children:"No orders found."}),A&&S.secruteKey&&(0,a.jsx)(_.Z,{isOpen:A,onClose:z,stripeData:S})]})},H=function(e){var t=e.styles;return(0,a.jsxs)(u.kC,(0,s.Z)((0,i.Z)({flexDirection:{base:"column",md:"row"},width:"100%"},null==t?void 0:t.container),{children:[(0,a.jsxs)(u.xu,{width:{base:"100%",md:"50%"},textAlign:"left",p:4,children:[(0,a.jsx)(u.xv,(0,s.Z)((0,i.Z)({textTransform:"capitalize",fontSize:{md:"2.5rem",sm:"1.5rem"}},null==t?void 0:t.heading),{children:"Your order History"})),(0,a.jsx)(u.xv,(0,s.Z)((0,i.Z)({mt:2,fontSize:{md:"1rem",sm:"0.8rem"},maxWidth:{md:"400px",sm:"240px"}},null==t?void 0:t.description),{children:"View complete order details including items, order status, price and other important information in one place."}))]}),(0,a.jsx)(u.xu,{width:{base:"100%",md:"60%"},p:4,children:(0,a.jsx)(T,{})})]}))},R=q.Ry().shape({firstName:q.Z_().nullable().required("first name is requried"),lastName:q.Z_().nullable().required("last name is requried"),phoneNumber:q.Z_().nullable().matches(/^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}
1\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/,"Phone number is not valid")}),F=function(e){e.styles;var t,n,s=(0,l.useContext)(y.Z),d=(0,l.useContext)(C.Z),c=(d.currency,d.phonePrefix),v=(0,m.pm)(),g=(0,l.useState)([]),b=g[0],S=g[1],_=(0,h.qY)(),I=_.isOpen,P=_.onOpen,q=_.onClose,O=(0,l.useState)(null),W=O[0],L=O[1],U=(t=(0,r.Z)(function(){var e;return(0,o.__generator)(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,Z.Z.getAllUserAddress({"api-key":j().get("apiKey"),Authorization:"Bearer ".concat(j().get("token"))})];case 1:return S(e.sent().result||[]),[3,3];case 2:return e.sent(),v({title:"Could not load addresses",status:"error",isClosable:!0,position:"top-right"}),[3,3];case 3:return[2]}})}),function(){return t.apply(this,arguments)});(0,l.useEffect)(function(){U()},[]);var T,H,F,K,G=(n=(0,r.Z)(function(e){return(0,o.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Z.Z.deleteAddress(e.addressId,{"api-key":j().get("apiKey")})];case 1:return t.sent(),v({title:"Address removed",status:"success",isClosable:!0,position:"top-right"}),U(),[3,3];case 2:return t.sent(),v({title:"Could not remove address",status:"error",isClosable:!0,position:"top-right"}),[3,3];case 3:return[2]}})}),function(e){return n.apply(this,arguments)}),V=(T=(0,r.Z)(function(e){return(0,o.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Z.Z.updateAddress(e,{isPrimary:!0},{"api-key":j().get("apiKey")})];case 1:return t.sent(),v({title:"Default address updated",status:"success",isClosable:!0,position:"top-right"}),U(),[3,3];case 2:return t.sent(),v({title:"Could not set default",status:"error",isClosable:!0,position:"top-right"}),[3,3];case 3:return[2]}})}),function(e){return T.apply(this,arguments)}),M=function(e){L(e),P()},Y=(H=(0,r.Z)(function(e){var t;return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,Z.Z.updateAddress(W.addressId,e,{"api-key":j().get("apiKey")})];case 1:return t=n.sent(),console.log("response",t),t?(v({title:"Address updated",status:"success",isClosable:!0,position:"top-right"}),q(),U()):v({title:"Could not update address. Please fill all the fields correctly.",status:"error",isClosable:!0,position:"top-right"}),[2]}})}),function(e){return H.apply(this,arguments)}),J=(0,f.useRouter)(),X=(F=(0,r.Z)(function(){var e;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Z.Z.getUserDetails({"api-key":j().get("apiKey"),Authorization:"Bearer ".concat(j().get("token"))})];case 1:return(null==(e=t.sent())?void 0:e.forceLogin)&&(j().remove("token"),x.Z.remove("token"),(0,D.Z)(),s.setUser({isAuthenticated:!1,addresses:[]}),J.push("/login")),(null==e?void 0:e.userId)&&s.setUser((0,i.Z)({isAuthenticated:!0},e)),e||(j().remove("token"),x.Z.remove("token"),(0,D.Z)(),null==s||s.setUser({isAuthenticated:!1}),J.push("/")),[3,3];case 2:return t.sent(),v({title:"Failed to fetch updated details",status:"error",isClosable:!0,position:"top-right"}),[3,3];case 3:return[2]}})}),function(){return F.apply(this,arguments)});return(0,a.jsxs)(u.xu,{children:[(0,a.jsx)(B.J9,{initialValues:{firstName:s.firstName||"",lastName:s.lastName||"",email:s.email||"",phone_prefix:s.phone_prefix||c,phoneNumber:s.phoneNumber||""},validationSchema:R,onSubmit:(K=(0,r.Z)(function(e,t){var n,r,i,a;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=t.setSubmitting,o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,Z.Z.updateUserDetails({firstName:e.firstName,lastName:e.lastName,phoneNumber:e.phoneNumber,phone_prefix:e.phone_prefix,email:e.email},{"api-key":j().get("apiKey")})];case 2:return(null==(r=o.sent())?void 0:r.success)?(v({title:"Succesfully updated your details",status:"success",duration:3e3,isClosable:!0,position:"top-right"}),X()):("Email or PhoneNumber is already taken."===r.error&&(i={},e.email!==s.email?(i.type="email",i.value=e.email):(i.type="phone",i.value=e.phoneNumber)),v({title:r.error.includes('child "email" fails because')?"you cannot delete email":r.error.includes('child "phoneNumber" fails because')?"you cannot delete phone":r.error,status:"info",position:"top-right",duration:3e3,isClosable:!0})),[3,5];case 3:return o.sent(),v({title:"Update failed",status:"error",isClosable:!0,position:"top-right"}),[3,5];case 4:return n(!1),[7];case 5:return[2]}})}),function(e,t){return K.apply(this,arguments)}),children:function(e){var t=e.values,n=e.handleChange,r=e.handleSubmit,i=e.isSubmitting;return(0,a.jsx)("form",{onSubmit:r,children:(0,a.jsxs)(u.gC,{spacing:4,align:"stretch",children:[(0,a.jsx)(u.xv,{fontWeight:"600",borderBottom:"2px s
1olid",pb:2,children:"Customer"}),(0,a.jsxs)(u.Ug,{spacing:4,alignItems:"start",children:[(0,a.jsx)(z.Z,{label:"First Name",name:"firstName",placeholder:"First Name",value:t.firstName,onChange:n}),(0,a.jsx)(z.Z,{label:"Last Name",name:"lastName",placeholder:"Last Name",value:t.lastName,onChange:n})]}),(0,a.jsx)(z.Z,{label:"Email",name:"email",type:"email",placeholder:"Email",value:t.email}),(0,a.jsx)(z.Z,{label:"Phone Number",name:"phoneNumber",type:"tel",placeholder:"Phone Number",value:t.phoneNumber,onChange:n,suffix:(0,a.jsx)(A.Z,{defaultCode:(0,E.Z)(null==t?void 0:t.phone_prefix),handleChange:function(e){return n({target:{name:"phone_prefix",value:"".concat(e)}})}})}),(0,a.jsx)(p.zx,{type:"submit",isLoading:i,isDisabled:i||!t.firstName||!t.lastName,variant:"primary",children:"Save changes"})]})})}}),(0,a.jsx)(u.xv,{fontWeight:"600",mt:8,mb:2,children:"Addresses"}),(0,a.jsxs)(u.rj,{gridTemplateColumns:{sm:"repeat(1, 1fr)",md:"repeat(2, 1fr)",xl:"repeat(2, 1fr)"},gap:4,mt:4,children:[(0,a.jsx)(u.P4,{border:"3px",borderColor:"color",borderStyle:"dashed",p:{sm:6,md:12},rounded:"md",display:"flex",alignItems:"center",justifyContent:"center",bg:"bgColor",cursor:"pointer",height:{sm:"fit-content",md:"175px"},children:(0,a.jsx)(w.Z,{addAddressState:U})}),b.map(function(e){return(0,a.jsx)(k.Z,{name:e.name,addressString:e.addressString,isPrimary:e.isPrimary,handleDelete:function(){return G(e)},handleSetDefault:function(){return V(e.addressId)},handleEdit:function(){return M(e)},settings:{minW:"100%"}},e.addressId)})]}),I&&(0,a.jsx)(N.Z,{isVisible:I,onClose:q,data:W,onSubmit:function(e){return Y(e)}})]})},K={Dashboard:U,"Order History":H,"Account Details":function(e){var t=e.styles;return(0,a.jsxs)(u.kC,(0,s.Z)((0,i.Z)({flexDirection:{base:"column",md:"row"},width:"100%"},null==t?void 0:t.container),{children:[(0,a.jsxs)(u.xu,{width:{base:"100%",md:"50%"},textAlign:"left",p:4,children:[(0,a.jsx)(u.xv,(0,s.Z)((0,i.Z)({textTransform:"capitalize",fontSize:{md:"2.5rem",sm:"1.5rem"}},null==t?void 0:t.heading),{children:"Your Account Details"})),(0,a.jsx)(u.xv,(0,s.Z)((0,i.Z)({mt:2,fontSize:{md:"1rem",sm:"0.8rem"},maxWidth:{md:"400px",sm:"240px"}},null==t?void 0:t.description),{children:"View and edit your personal information like name, address, and contact details whenever you need to."}))]}),(0,a.jsx)(u.xu,{width:{base:"100%",md:"50%"},p:4,children:(0,a.jsx)(F,{})})]}))}},G=function(e){var t,n,r,o,c,h,b,Z,C,S,_,k,w,A,N,z,D,I,P,B,q,O,E,L,U,T,H,R,F,G,V,M,Y,J,X,Q,$=e.data,ee=(e.seoData,e.globals,e.hubName),et=(0,l.useContext)(g.Z).cms,en=(0,l.useContext)(y.Z),er=Array.isArray(null==et?void 0:null===(t=et.dashboard)||void 0===t?void 0:t.sections)?et.dashboard.sections:[],ei=er.find(function(e){return"dashboard"===e.component.toLowerCase()})||er[0]||{},es=Array.isArray(null===(n=ei.banner)||void 0===n?void 0:n.src)?ei.banner.src:[],eo=(null===(r=ei.banner)||void 0===r?void 0:r.aspectRatio)||16/9,ea=(Array.isArray(null===(o=ei.navigation)||void 0===o?void 0:o.items)?ei.navigation.items:[]).map(function(e){return{key:e.name.toLowerCase().replace(/\s+/g,"-"),name:e.name,type:e.type,src:e.src,component:K[e.name]}});(null===(c=ei.navigation)||void 0===c?void 0:c.showLogOut)&&ea.push({key:"logout",name:"Logout",type:"logout"});var el=(null===(h=ea.find(function(e){return"component"===e.type}))||void 0===h?void 0:h.key)||"",ed=(0,l.useState)(el),eu=ed[0],ec=ed[1],ep=(0,f.useRouter)(),eh=(0,m.pm)(),em={duration:4e3,isClosable:!0,position:"top-right"},ex=function(){j().remove("token"),x.Z.remove("token"),en.setUser({isAuthenticated:!1}),eh((0,i.Z)({title:"User logged out",description:"You have been logged out successfully.",status:"success"},em)),ep.push("/")};null===(b=ea.find(function(e){return e.key===eu}))||void 0===b||b.component;var ev=(0,d.Sx)({base:!1,md:!0}),ef=(0,a.jsx)(u.xu,(0,s.Z)((0,i.Z)({position:"absolute",top:{base:"80%",md:"50%"},left:"50%",transform:"translate(-50%, -50%)",width:"100%",maxW:"1280px",px:"4"},null===(Z=ei.banner)||void 0===Z?void 0:null===(C=Z.title)||void 0===C?void 0:C.ContainerSettings),{children:(0,a.jsx)(u.xv,(0,s.Z)((0,i.Z)({fontSize:"2xl",textAlign:{base:"center",md:"left"},width:"100%",maxW:"1280px",mx:"auto",textTransform:"uppercase"},null===(S=ei.banner)||void 0===S?void 0:null===(_=S.title)||void 0===_?void 0:_.settings),{children:(null==en?void 0:en.firstName)?"Hey, ".concat(en.firstName,"!"):"Dashboard"}))}));return(0,a.jsxs)(u.xu,(0,s.Z)((0,i.Z)({m:0,p:0,width:"100%",height:"100%"}
1,null==ei?void 0:ei.wrapperSettings),{children:[es.length>1?(0,a.jsx)(v.Z,{controls:!1,indicators:!1,interval:6e3,children:es.map(function(e,t){return(0,a.jsx)(v.Z.Item,{children:(0,a.jsxs)(u.xu,{position:"relative",width:"100%",children:[(0,a.jsx)(W,{src:e,aspectRatio:eo}),ef]})},t)})}):1===es.length?(0,a.jsxs)(u.xu,{position:"relative",width:"100%",children:[(0,a.jsx)(W,{src:es[0],aspectRatio:eo}),ef]}):null,(0,a.jsx)(u.kC,(0,s.Z)((0,i.Z)({px:[2,4],py:{md:"2rem",sm:"0.8rem"},width:"100%",align:"center",overflowX:"auto",justifyContent:"center",background:"#D9D9D9"},null==ei?void 0:null===(k=ei.navigation)||void 0===k?void 0:k.ContainerSettings),{children:ev?(0,a.jsxs)(u.kC,(0,s.Z)((0,i.Z)({maxW:"1280px",width:"100%",mx:"auto"},null==ei?void 0:null===(w=ei.navigation)||void 0===w?void 0:w.wrapperDesktopSettings),{children:[(0,a.jsx)(u.Ug,(0,s.Z)((0,i.Z)({spacing:4},null==ei?void 0:null===(A=ei.navigation)||void 0===A?void 0:A.buttonWrapperSettings),{children:ea.filter(function(e){return"logout"!==e.type}).map(function(e){var t;return(0,a.jsx)(p.zx,(0,s.Z)((0,i.Z)({onClick:function(){"component"===e.type?ec(e.key):"link"===e.type&&e.src&&ep.push(e.src)},whiteSpace:"nowrap",fontWeight:400,background:"transparent",_hover:{background:"none"},_active:{bg:"transparent"},_focus:{bg:"transparent",boxShadow:"none"},textDecoration:eu===e.key?"underline":"none"},null==ei?void 0:null===(t=ei.navigation)||void 0===t?void 0:t.buttonDesktopSettings),{children:e.name}),e.key)})})),(0,a.jsx)(u.xu,{flex:"1"}),(0,a.jsx)(p.zx,(0,s.Z)((0,i.Z)({fontWeight:400,background:"transparent",_hover:{background:"none"},_active:{bg:"transparent"},_focus:{bg:"transparent",boxShadow:"none"},onClick:ex},null==ei?void 0:null===(N=ei.navigation)||void 0===N?void 0:N.logoutButtonSettings),{children:"Logout"}))]})):(0,a.jsx)(u.Ug,(0,s.Z)((0,i.Z)({spacing:4,justifyContent:"center"},null==ei?void 0:null===(z=ei.navigation)||void 0===z?void 0:z.wrapperMobileSettings),{children:ea.map(function(e){var t;return(0,a.jsx)(p.zx,(0,s.Z)((0,i.Z)({onClick:function(){"component"===e.type?ec(e.key):"link"===e.type&&e.src?ep.push(e.src):"logout"===e.type&&ex()},whiteSpace:"nowrap",fontWeight:400,background:"transparent",_hover:{background:"none"},_active:{bg:"transparent"},_focus:{bg:"transparent",boxShadow:"none"},textDecoration:eu===e.key?"underline":"none",fontSize:"0.6rem",p:0},null==ei?void 0:null===(t=ei.navigation)||void 0===t?void 0:t.buttonMobileSettings),{children:e.name}),e.key)})}))})),(0,a.jsxs)(u.xu,(0,s.Z)((0,i.Z)({maxW:"1280px",mx:"auto",my:{md:"3rem",sm:"1rem"}},null===(D=ei.content)||void 0===D?void 0:D.containerSettings),{children:["dashboard"===eu&&K.Dashboard&&l.createElement(K.Dashboard,{styles:{container:null===(I=ei.content)||void 0===I?void 0:null===(P=I.dashboard)||void 0===P?void 0:P.containerSettings,heading:null===(B=ei.content)||void 0===B?void 0:null===(q=B.dashboard)||void 0===q?void 0:q.headingSettings,button:null===(O=ei.content)||void 0===O?void 0:null===(E=O.dashboard)||void 0===E?void 0:E.buttonSettings},products:(null==$?void 0:null===(L=$[1])||void 0===L?void 0:L.products)||{},data:(null==ei?void 0:ei.data)||{},hubName:ee||""}),"order-history"===eu&&K["Order History"]&&l.createElement(K["Order History"],{styles:{container:null===(U=ei.content)||void 0===U?void 0:null===(T=U.orderHistory)||void 0===T?void 0:T.containerSettings,heading:null===(H=ei.content)||void 0===H?void 0:null===(R=H.orderHistory)||void 0===R?void 0:R.headingSettings,description:null===(F=ei.content)||void 0===F?void 0:null===(G=F.orderHistory)||void 0===G?void 0:G.textSettings}}),"account-details"===eu&&K["Account Details"]&&l.createElement(K["Account Details"],{styles:{container:null===(V=ei.content)||void 0===V?void 0:null===(M=V.accountDetails)||void 0===M?void 0:M.containerSettings,heading:null===(Y=ei.content)||void 0===Y?void 0:null===(J=Y.accountDetails)||void 0===J?void 0:J.headingSettings,description:null===(X=ei.content)||void 0===X?void 0:null===(Q=X.accountDetails)||void 0===Q?void 0:Q.textSettings}})]}))]}))},V=!0;t.default=G},51113:function(e,t,n){"use strict";var r=n(47568),i=n(26042),s=n(69396),o=n(99534),a=n(97582),l=n(85893),d=n(80419),u=n(76289),c=n(48641),p=n(47741),h=n(39653),m=n(5152),x=n.n(m),v=n(82580),f=n(74231),g=n(48046),y=n(89530),b=n(67294),j=n(58971),Z=n.n(j),C=n(96486),S=n.n(C),_=n(35119),k=x()(function(){return Promise.resolve().then(n.bind(n,99463))},{loadableGenerated:{webpack:function(){return[99463]}}}),w=function(e){var t,n,o,h=e.isVisible,m=e.onClose,x=e.addAddressState,j=Z().get("apiKey"),C=(0,d.pm)(),w=(0,b.useContext)(y.Z),A=(0,b.useState)(),N=A[0],z=A[1],D=(0,b.useState)(!1),I=D[0],P=D[1],B=Z().get("token"),q=(t=(0,r.Z)(function(){var e;return(0,a.__generator)(this,function(t){switch(t.label){case 0:return[4,_.Z.getUserDetails({"api-key":j,Authorization:"Bearer ".concat(B)})];case 1:return(e=t.sent()).success&&w.setUser((0,i.Z)({isAuthenticated:!0},e.result)),[2]}})}),function(){return t.apply(this,arguments)}),O=f.Ry().shape({name:f.Z_().required("Home/Work/Other is required"),address1:f.Z_().required("House #, Street name is required"),
1city:f.Z_().required("City is required"),state:f.Z_().required("state is required"),country:f.Z_().required("country is required"),county:f.Z_(),zip:f.Z_().required("zip code is required")}),E=function(e,t){z((0,s.Z)((0,i.Z)({},t),{name:""})),P(!0)},W=(n=(0,r.Z)(function(e,t){var n;return(0,a.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,_.Z.addUserAddress(e,t)];case 1:return n.sent().addressId&&(x(!0),C({title:"Succesfully Added Address",status:"success",duration:3e3,isClosable:!0,position:"top-right"}),q(),m()),[3,3];case 2:return n.sent(),x(!1),C({title:"Failed to Add Address!",description:"we are unable to preoces your request at this moment",status:"error",duration:3e3,isClosable:!0,position:"top-right"}),[3,3];case 3:return[2]}})}),function(e,t){return n.apply(this,arguments)});return(0,l.jsxs)(u.u_,{isOpen:h,onClose:m,children:[(0,l.jsx)(u.ZA,{}),(0,l.jsx)(v.J9,{initialValues:N,validationSchema:O,enableReinitialize:!0,onSubmit:(o=(0,r.Z)(function(e){return(0,a.__generator)(this,function(t){switch(t.label){case 0:return Object.keys(e).forEach(function(t){""===e[t]&&delete e[t]}),[4,W((0,s.Z)((0,i.Z)({},e),{latLng:null==N?void 0:N.latLng,short_state:null==N?void 0:N.short_state,addressString:S().filter([e.address1,e.city,e.state,e.zip,e.country]).join(", ")}),{"api-key":j})];case 1:return t.sent(),[2]}})}),function(e){return o.apply(this,arguments)}),children:function(e){var t=e.handleSubmit;return(0,l.jsx)("form",{onSubmit:t,children:(0,l.jsxs)(u.hz,{mb:"200px",bg:"bgColor",color:"color",backdropFilter:"auto",backdropInvert:"100%",backdropBlur:"10px",children:[(0,l.jsx)(u.xB,{children:"Add Address"}),(0,l.jsx)(u.ol,{}),(0,l.jsx)(u.fe,{pb:4,children:(0,l.jsxs)(c.kC,{display:"flex",flexDirection:"column",gap:"24px",children:[(0,l.jsx)(k,{handleAutoComplete:E}),I?(0,l.jsxs)(c.kC,{display:"flex",flexDirection:"column",gap:"24px",children:[(0,l.jsx)(g.Z,{label:"Name",name:"name",placeholder:"Home/Work"}),(0,l.jsx)(g.Z,{label:"Address Line 1",name:"address1",placeholder:"House no/Apt no, Street address "}),(0,l.jsx)(g.Z,{label:"City",name:"city",placeholder:"City"}),(0,l.jsx)(g.Z,{label:"State",name:"state",placeholder:"State"}),(0,l.jsx)(g.Z,{label:"County",name:"county",placeholder:"County"}),(0,l.jsx)(g.Z,{label:"Country",name:"country",placeholder:"Country"}),(0,l.jsx)(g.Z,{label:"ZipCode",name:"zip",placeholder:"Zip code"})]}):""]})}),(0,l.jsx)(u.mz,{children:I?(0,l.jsxs)(c.Ug,{spacing:4,children:[(0,l.jsx)(p.zx,{type:"submit",variant:"primary",_hover:"none",children:"Add"}),(0,l.jsx)(p.zx,{variant:"secondary",_hover:"none",onClick:m,children:"Cancel"})]}):""})]})})}})]})},A=function(e){var t=e.textOnly,n=e.addAddressState,r=(0,o.Z)(e,["textOnly","addAddressState"]),i=(0,h.qY)(),s=i.isOpen,a=i.onOpen,d=i.onClose;return(0,l.jsxs)(l.Fragment,{children:[void 0!==t&&t?(0,l.jsx)(p.zx,{_hover:"none",height:"inherit",background:"bgColor",color:"brand.500",onClick:a,children:(0,l.jsx)(c.xv,{fontSize:"sm",children:r.children})}):(0,l.jsx)(p.zx,{width:"100%",_hover:"none",height:"inherit",background:"bgColor",onClick:a,children:(0,l.jsx)(c.kC,{direction:"column",justifyContent:"center",alignItems:"center",children:(0,l.jsx)(c.xv,{variant:"pageSubTitle",children:"Add Address"})})}),(0,l.jsx)(w,{isVisible:s,onClose:d,addAddressState:n})]})};t.Z=A},74148:function(e,t,n){"use strict";var r=n(26042),i=n(69396),s=n(85893),o=n(48641),a=n(47741),l=function(e){var t=e.name,n=e.isPrimary,l=void 0!==n&&n,d=e.addressString,u=e.handleEdit,c=void 0===u?function(){}:u,p=e.handleDelete,h=void 0===p?function(){}:p,m=e.handleSetDefault,x=void 0===m?function(){}:m,v=e.settings;return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(o.kC,(0,i.Z)((0,r.Z)({border:"2px",borderColor:"#eeeeee",borderStyle:"solid",w:{sm:"100%",md:"25%"},position:"relative",minW:{sm:"100%",md:"250px"},height:{sm:"175px",md:"175px"},p:3,rounded:"md",gap:"12px",bg:"bgColor"},void 0===v?{}:v),{children:(0,s.jsxs)(o.kC,{direction:"column",justify:"space-between",height:"100%",children:[l&&(0,s.jsx)(o.xu,{className:"defaultBadge",children:(0,s.jsx)(o.xv,{variant:"tiny",children:"default"})}),(0,s.jsxs)(o.kC,{mt:4,direction:"column",children:[(0,s.jsx)(o.xv,{mb:2,variant:"pageText",fontWeight:"700",children:t}),(0,s.jsx)(o.xv,{variant:"tiny",children:d})]}
1),(0,s.jsxs)(o.kC,{justifyContent:"flexx-start",gap:2,alignItems:"center",marginTop:"auto",children:[(0,s.jsx)(a.zx,{onClick:function(){return c()},variant:"underline",marginRight:"-8px",children:"Edit"}),!l&&(0,s.jsxs)(s.Fragment,{children:["|",(0,s.jsx)(a.zx,{onClick:function(){return h()},variant:"underline",children:"Remove"}),"|",(0,s.jsx)(a.zx,{onClick:function(){return x()},variant:"underline",children:"Set as Default"})]})]})]})}),t)})};t.Z=l},35644:function(e,t,n){"use strict";var r=n(14924),i=n(26042),s=n(69396),o=n(85893),a=n(76289),l=n(48641),d=n(47741),u=n(82580),c=n(74231),p=n(48046),h=n(67294),m=function(e){var t=e.isVisible,n=e.onClose,m=e.data,x=e.onSubmit,v=void 0===x?function(){}:x,f=(0,h.useState)({}),g=f[0],y=f[1],b=c.Ry().shape({name:c.Z_(),address1:c.Z_().required("addressLine1 is required"),address2:c.Z_(),street:c.Z_(),city:c.Z_().required("street Name is required"),state:c.Z_().required("state is required"),country:c.Z_().required("country is required"),county:c.Z_(),zip:c.Z_().required("zip code is required")});return(0,o.jsxs)(a.u_,{isOpen:t,onClose:n,children:[(0,o.jsx)(a.ZA,{}),(0,o.jsx)(u.J9,{initialValues:{name:m.name,address1:m.address1,address2:m.address2?m.address2:"",city:m.city,state:m.state,county:m.county,country:m.country,zip:m.zip},validationSchema:b,onSubmit:function(){v(g)},children:function(e){var t=e.values,u=e.errors,c=e.touched,h=e.handleChange,m=e.handleBlur,x=e.handleSubmit,v=function(e){y(function(t){return(0,s.Z)((0,i.Z)({},t),(0,r.Z)({},e.target.name,e.target.value))}),h(e)};return(0,o.jsx)("form",{onSubmit:x,children:(0,o.jsxs)(a.hz,{mb:"200px",bg:"bgColor",color:"color",backdropFilter:"auto",backdropInvert:"100%",backdropBlur:"10px",children:[(0,o.jsx)(a.xB,{children:"Edit Address"}),(0,o.jsx)(a.ol,{}),(0,o.jsx)(a.fe,{pb:4,children:(0,o.jsxs)(l.kC,{display:"flex",flexDirection:"column",gap:"24px",children:[(0,o.jsx)(p.Z,{label:"Name",name:"name",onBlur:m,value:null==t?void 0:t.name,onChange:v,placeholder:"Home/Work"}),(0,o.jsx)(p.Z,{isInvalid:u.address1&&c.address1,errorBorderColor:"red.300",label:"Address Line 1",name:"address1",onBlur:m,value:null==t?void 0:t.address1,onChange:v,placeholder:"House no / Building Name"}),(0,o.jsx)(p.Z,{label:"Address Line 2",name:"address2",errorBorderColor:"red.300",onBlur:m,value:null==t?void 0:t.address2,onChange:v,placeholder:"Address line 2"}),(0,o.jsx)(p.Z,{label:"City",name:"city",isInvalid:u.city&&c.city,errorBorderColor:"red.300",onBlur:m,value:null==t?void 0:t.city,onChange:v,placeholder:"city"}),(0,o.jsx)(p.Z,{label:"State",name:"state",isInvalid:u.state&&c.state,errorBorderColor:"red.300",onBlur:m,value:null==t?void 0:t.state,onChange:v,placeholder:"State"}),(0,o.jsx)(p.Z,{label:"County",name:"county",errorBorderColor:"red.300",onBlur:m,value:null==t?void 0:t.county,onChange:v,placeholder:"county"}),(0,o.jsx)(p.Z,{label:"Country",name:"country",isInvalid:u.country&&c.country,errorBorderColor:"red.300",onBlur:m,value:null==t?void 0:t.country,onChange:v,placeholder:"State"}),(0,o.jsx)(p.Z,{label:"ZipCode",name:"zip",isInvalid:u.zip&&c.zip,errorBorderColor:"red.300",onBlur:m,value:null==t?void 0:t.zip,onChange:v,placeholder:"Zip code"})]})}),(0,o.jsx)(a.mz,{children:(0,o.jsxs)(l.Ug,{spacing:3,children:[(0,o.jsx)(d.zx,{type:"submit",variant:"primary",_hover:"none",children:"Save"}),(0,o.jsx)(d.zx,{variant:"secondary",_hover:"none",onClick:n,children:"Cancel"})]})})]})})}})]})};t.Z=m},34839:function(e,t,n){"use strict";var r=n(47568),i=n(97582),s=n(85893),o=n(67294),a=n(80419),l=n(48641),d=n(47741),u=n(76289),c=n(86664),p=n(2859),h=n(98087),m=n(35119),x=n(11163),v=n(21949),f=function(e){var t,n=e.onClose,u=e.stripeData,p=(0,o.useState)(!1),h=p[0],v=p[1],f=(0,c.useStripe)(),g=(0,c.useElements)(),y=(0,x.useRouter)(),b=(0,a.pm)(),j=(t=(0,r.Z)(function(e){var t,r,s,o,a;return(0,i.__generator)(this,function(i){switch(i.label){case 0:if(e.preventDefault(),!f||!g)return[2];return v(!0),[4,f.confirmPayment({elements:g,confirmParams:{return_url:"http://localhost:3888"},redirect:"if_required"})];case 1:if(r=(t=i.sent()).error,s=t.paymentIntent,!r)return[3,2];return b({title:"Payment failed",description:r.message,status:"info",position:"top-right",duration:3e3,isClosable:!0}),[3,7];case 2:if((null==s?void 0:s.status)!=="succeeded")return[3,7];
1b({title:"Payment successful",description:"Thank you for your payment!",status:"success",position:"top-right",duration:3e3,isClosable:!0}),i.label=3;case 3:return i.trys.push([3,5,,6]),o={paymentGatewayId:null==u?void 0:u.paymentGatewayId,orderId:null==u?void 0:u.orderId,payment_intent_id:null==u?void 0:u.payment_intent_id},[4,m.Z.payOrderStripe(o)];case 4:return i.sent(),y.push("/orders/".concat(null==u?void 0:u.orderId,"?refresh=true")),[3,6];case 5:return a=i.sent(),console.error("Error calling success API:",a),[3,6];case 6:n(),i.label=7;case 7:return v(!1),[2]}})}),function(e){return t.apply(this,arguments)});return(0,s.jsxs)("form",{onSubmit:j,children:[(0,s.jsx)(c.PaymentElement,{}),(0,s.jsx)(l.Ug,{width:"100%",justifyContent:"flex-end",mt:"4",children:(0,s.jsx)(d.zx,{type:"submit",variant:"primary",maxWidth:{sm:"100%",md:"160px"},isLoading:h,disabled:!f||!g,children:"Submit Payment"})})]})},g=function(e){var t=e.stripeData,n=e.isOpen,r=e.onClose;(0,o.useContext)(h.Z).cms;var i=(0,o.useContext)(v.Z).stripePublishableKey,a=(0,p.J)(i||"pk_test_51Qm22AH9ydG8Lyas8Eg1ZUeikePFOcb3MXvIEOrerjKW644vAkqWN8uBLRstjZV5sdyI5poufQG2orQHsIMFfWPR0008s1nL3D"),l=null==t?void 0:t.secruteKey;return(0,s.jsxs)(u.u_,{closeOnEsc:!1,closeOnOverlayClick:!1,size:"xl",isOpen:n,onClose:r,children:[(0,s.jsx)(u.ZA,{}),(0,s.jsxs)(u.hz,{margin:"auto 1rem",children:[(0,s.jsx)(u.xB,{children:"Payment"}),(0,s.jsx)(u.fe,{pb:"1rem",children:l&&(0,s.jsx)(c.Elements,{stripe:a,options:{clientSecret:l,appearance:{theme:"stripe",variables:{colorPrimary:"#0570de",colorBackground:"#ffffff",colorText:"#30313d",fontFamily:"Roboto, Open Sans, Segoe UI, sans-serif"}}},children:(0,s.jsx)(f,{onClose:r,clientSecret:l,stripeData:t})})})]})]})};t.Z=g}},function(e){e.O(0,[8907,1228,9866,5445,4090,2013,260,1255,1778,8766,9933,6066,5675,6126,8074,9052,9155,8806,280,6245,4069,6759,8491,4147,182,2344,8226,7949,4108,2941,6871,8548,7851,958,4980,5663,9774,2888,179],function(){return e(e.s=26117)}),_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.