1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5405],{23795:function(e,n,t){"use strict";t.d(n,{Z:function(){return C}});var r=t(63366),o=t(87462),i=t(67294),a=t(90512),s=t(94780),c=t(98216),u=t(90948),l=t(28628),d=t(77760),v=t(51705),f=t(15861),p=t(1588),m=t(34867);function getLinkUtilityClass(e){return(0,m.ZP)("MuiLink",e)}let h=(0,p.Z)("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]);var g=t(54844),x=t(2101);let y={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},transformDeprecatedColors=e=>y[e]||e;var Link_getTextDecoration=({theme:e,ownerState:n})=>{let t=transformDeprecatedColors(n.color),r=(0,g.DW)(e,`palette.${t}`,!1)||n.color,o=(0,g.DW)(e,`palette.${t}Channel`);return"vars"in e&&o?`rgba(${o} / 0.4)`:(0,x.Fq)(r,.4)},b=t(85893);let Z=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],useUtilityClasses=e=>{let{classes:n,component:t,focusVisible:r,underline:o}=e,i={root:["root",`underline${(0,c.Z)(o)}`,"button"===t&&"button",r&&"focusVisible"]};return(0,s.Z)(i,getLinkUtilityClass,n)},I=(0,u.ZP)(f.Z,{name:"MuiLink",slot:"Root",overridesResolver:(e,n)=>{let{ownerState:t}=e;return[n.root,n[`underline${(0,c.Z)(t.underline)}`],"button"===t.component&&n.button]}})(({theme:e,ownerState:n})=>(0,o.Z)({},"none"===n.underline&&{textDecoration:"none"},"hover"===n.underline&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},"always"===n.underline&&(0,o.Z)({textDecoration:"underline"},"inherit"!==n.color&&{textDecorationColor:Link_getTextDecoration({theme:e,ownerState:n})},{"&:hover":{textDecorationColor:"inherit"}}),"button"===n.component&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${h.focusVisible}`]:{outline:"auto"}})),j=i.forwardRef(function(e,n){let t=(0,l.i)({props:e,name:"MuiLink"}),{className:s,color:c="primary",component:u="a",onBlur:f,onFocus:p,TypographyClasses:m,underline:h="always",variant:g="inherit",sx:x}=t,j=(0,r.Z)(t,Z),{isFocusVisibleRef:C,onBlur:w,onFocus:S,ref:k}=(0,d.Z)(),[_,R]=i.useState(!1),P=(0,v.Z)(n,k),W=(0,o.Z)({},t,{color:c,component:u,focusVisible:_,underline:h,variant:g}),Y=useUtilityClasses(W);return(0,b.jsx)(I,(0,o.Z)({color:c,className:(0,a.Z)(Y.root,s),classes:m,component:u,onBlur:e=>{w(e),!1===C.current&&R(!1),f&&f(e)},onFocus:e=>{S(e),!0===C.current&&R(!0),p&&p(e)},ref:P,ownerState:W,variant:g,sx:[...Object.keys(y).includes(c)?[]:[{color:c}],...Array.isArray(x)?x:[x]]},j))});var C=j},90629:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var r=t(63366),o=t(87462),i=t(67294),a=t(90512),s=t(94780),c=t(2101),u=t(90948),styles_getOverlayAlpha=e=>((e<1?5.11916*e**2:4.5*Math.log(e+1)+2)/100).toFixed(2),l=t(28628),d=t(1588),v=t(34867);function getPaperUtilityClass(e){return(0,v.ZP)("MuiPaper",e)}(0,d.Z)("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);var f=t(85893);let p=["className","component","elevation","square","variant"],useUtilityClasses=e=>{let{square:n,elevation:t,variant:r,classes:o}=e,i={root:["root",r,!n&&"rounded","elevation"===r&&`elevation${t}`]};return(0,s.Z)(i,getPaperUtilityClass,o)},m=(0,u.ZP)("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,n)=>{let{ownerState:t}=e;return[n.root,n[t.variant],!t.square&&n.rounded,"elevation"===t.variant&&n[`elevation${t.elevation}`]]}})(({theme:e,ownerState:n})=>{var t;return(0,o.Z)({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!n.square&&{borderRadius:e.shape.borderRadius},"outlined"===n.variant&&{border:`1px solid ${(e.vars||e).palette.divider}`},"elevation"===n.variant&&(0,o.Z)({boxShadow:(e.vars||e).shadows[n.elevation]},!e.vars&&"dark"===e.palette.mode&&{backgroundImage:`linear-gradient(${(0,c.Fq)("#fff",styles_getOverlayAlpha(n.elevation))}, ${(0,c.Fq)("#fff",styles_getOverlayAlpha(n.elevation))})`},e.vars&&{backgroundImage:null==(t=e.vars.overlays)?void 0:t[n.elevation]}))}),h=i.forwardRef(function(e,n){let t=(0,l.i)({props:e,name:"MuiPaper"}),{className:i,component:s="div",elevation:c=1,square:u=!1,variant:d="elevation"}=t,v=(0,r.Z)(t,p),h=(0,o.Z)({},t,{component:s,elevation:c,square:u,variant:d}),g=useUtilityClasses(h);return(0,f.jsx)(m,(0,o.Z)({as:s,ownerState:h,className:(0,a.Z)(g.root,i),ref:n},v))});var g=h},2734:function(e,n,t){"use strict";t.d(n,{Z:function(){return useTheme}}),t(67294);var r=t(96682),o=t(90247),i=t(10606);function useTheme(){let e=(0,r.Z)(o.Z);return e[i.Z]||e}},86875:function(e,n,t){"use strict";t.d(n,{BC:function(){return getVendorInvoiceSerialNo},FM:function(){return resendInvoiceRequest},FR:function(){return getInvoiceAsPdf},HZ:function(){return getExternalUserInvoice},Iv:function(){return setPaid},J8:function(){return createInvoiceCall},NX:function(){return deleteInvoiceCall},Ox:function(){return requestInvoiceCall},P8:function(){return getVendorInvoice},Qm:function(){return createTempInvoiceCall},Rj:function(){return getInvoiceRequests},YF:function(){return getCustomerInvoiceS},_D:function(){return claimInvoice},bG:function(){return externalInvoiceeRegister},hV:function(){return sendInvoiceCall},ii:function(){return getInvoiceRequestsByDate},jw:function(){return updateInvoiceCall},ng:function(){return getInvoiceRequestsBulk},xX:function(){return getCustomerInvoice},yY:function(){return sendReminder},z2:function(){return getVendorInvoiceS},z9:function(){return externalInvoiceeCreate}});var r=t(54180),o=t(53640),i="".concat(o.AC,"/invoice"),a="".concat(o.AC,"/files/export/invoice/preview"),individualInvoiceUrl=function(e){return"".concat(o.AC,"/invoice/").concat(e)};function createInvoiceCall(e){return(0,r.WY)("post","".concat(i),e)}function createTempInvoiceCall(e){return(0,r.iN)("post","".concat(a),e)}function updateInvoiceCall(e,n){return(0,r.WY)("put",individualInvoiceUrl(n),e)}function deleteInvoiceCall(e){return(0,r.WY)("delete",individualInvoiceUrl(e))}function getCustomerInvoiceS(e){return(0,r.WY)("get","".concat(i,"/me/customer"),null,e)}function getVendorInvoiceS(e){return(0,r.WY)("get","".concat(i,"/me/vendor"),null,e)}function getCustomerInvoice(e){return(0,r.WY)("get","".concat(individualInvoiceUrl(e),"/customer"))}function getVendorInvoice(e){return(0,r.WY)("get","".concat(individualInvoiceUrl(e),"/vendor"))}function getExternalUserInvoice(e){return(0,r.Bs)("get","".concat(individualInvoiceUrl(e),"/external"))}function getInvoiceRequests(){return(0,r.WY)("get","".concat(i,"/request"))}
1function getInvoiceRequestsByDate(){return(0,r.WY)("get","".concat(i,"/request-by-date"))}function getInvoiceRequestsBulk(e){return(0,r.WY)("post","".concat(i,"/request/bulk"),e)}function resendInvoiceRequest(e){return(0,r.WY)("post","".concat(i,"/request/").concat(e,"/remind"))}function sendInvoiceCall(e,n){return(0,r.WY)("post","".concat(individualInvoiceUrl(e),"/send"),n)}function requestInvoiceCall(e){return(0,r.WY)("post","".concat(i,"/request"),e)}function externalInvoiceeCreate(e){return(0,r.Bs)("post","".concat(o.AC,"/external-invoicee"),e)}function externalInvoiceeRegister(e){return(0,r.Bs)("post","".concat(o.AC,"/external-invoicee/register"),e)}function getVendorInvoiceSerialNo(){return(0,r.WY)("get","".concat(i,"/generate-id"))}function claimInvoice(e){return(0,r.WY)("post","".concat(individualInvoiceUrl(e),"/claim"))}function getInvoiceAsPdf(e){return(0,r.iN)("post","".concat("".concat(o.AC,"/files/export/invoice/").concat(e)))}function sendReminder(e){return(0,r.WY)("post","".concat(individualInvoiceUrl(e),"/remind"))}function setPaid(e){return(0,r.WY)("post","".concat(individualInvoiceUrl(e),"/paid"))}},36940:function(e,n,t){"use strict";t.d(n,{Z:function(){return Carousel}}),t(67294);var r=t(88494),o=t(71911);t(74614),t(99812),t(4661),t(501);var i=t(80822),a=t(85893);function Carousel(e){var n=e.carouselImages,t=e.padding;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(r.tq,{style:{"--swiper-pagination-color":"#fff"},centeredSlides:!0,autoplay:{delay:4500,disableOnInteraction:!1},pagination:{clickable:!0},className:"mySwiper",children:n.map(function(e,n){return(0,a.jsx)(r.o5,{style:{paddingBottom:"80px",textAlign:"center",display:"flex",alignItems:"center"},children:(0,a.jsx)(i.Z,{component:"img",sx:{pl:{xs:"20%",sm:"30%",md:t}},src:e,width:250,style:{width:250}})},n)})})})}o.ZP.use([o.pt,o.tl,o.W_])},17837:function(e,n,t){"use strict";var r=t(15861),o=t(25662),i=t(80822),a=t(11163),s=t(85893);n.Z=function(e){var n=e.subtext,t=e.person,c=e.subtext2,u=(0,a.useRouter)();return(0,s.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",color:"white.main",flexDirection:"column"},children:["general"===t?(0,s.jsx)(r.Z,{variant:"h5",mt:3,children:"Or Sign Up as a Vendor"}):(0,s.jsx)(r.Z,{"data-test-id":"welcome text",variant:"h5",mt:3,children:"customer"===t?" Connect With Experts":"more"===t?"Build your Profile":"Showcase Your Products"}),(0,s.jsx)(r.Z,{variant:"body3",mt:1,pl:3,children:n}),(0,s.jsx)(r.Z,{variant:"body3",mt:1,pl:3,children:c}),"more"!==t&&(0,s.jsx)(i.Z,{sx:{mt:2},children:(0,s.jsxs)(o.Z,{color:"background",size:"large",onClick:function(){"vendor"===t&&u.push("/signup/customer"),"vendor"!==t&&u.push("/signup/vendor")},variant:"contained",sx:{color:"customer"===t?"secondary.main":"primary.main",fontWeight:600},children:["Join now as a"," ","vendor"!==t?"vendor":"customer"]})})]})}},23438:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Home}});var r=t(15861),o=t(80822),i=t(86886),a=t(90629),s=t(45098),c=t(23795),u=t(72770),l=t(9008),d=t.n(l),v=t(36940),f=t(17837),p=t(98456),m=t(25662),h=t(25617),g=t(67294),x=t(29505);t(54661);var y=t(11163),b=t(53640),Z=t(85893),I=(0,s.Z)(i.ZP)(function(e){return{backgroundColor:e.theme.palette.secondary.main}});function Home(){var e=["/images/customer1.svg","/images/customer1.svg"],n=(0,h.I0)(),t=(0,h.v9)(function(e){return e.user}),s=(0,g.useState)(!0),l=s[0],j=s[1],C=(0,y.useRouter)();return((0,g.useEffect)(function(){!function(){if(!((0,b.gA)()&&null!=t&&t.activeRole)){j(!1),n((0,x.Ec)()),n((0,x.yB)());return}var e=t.email_verified,r=t.activeRole,o=t.user_type;e?o?C.push("".concat(r,"/dashboard")):C.push("/".concat(r,"/moreAboutYou")):C.push("/".concat(r,"/verifySignup"))}()},[]),l)?(0,Z.jsx)(o.Z,{sx:{},children:(0,Z.jsxs)(o.Z,{sx:{width:"100%",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,Z.jsx)(o.Z,{}),(0,Z.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,Z.jsx)(p.Z,{color:"success"})})]})}):(0,Z.jsxs)(o.Z,{sx:{height:"100vh"},children:[(0,Z.jsxs)(d(),{children:[(0,Z.jsx)("title",{children:"Workstedi"}),(0,Z.jsx)("meta",{name:"description",content:"Generated by create next app"}),(0,Z.jsx)("link",{rel:"icon",href:"/favicon.png"}),(0,Z.jsx)("script",{src:"https://upload-widget.cloudinary.com/global/all.js",type:"text/javascript"})]}),(0,Z.jsxs)(I,{container:!0,component:a.Z,sx:{height:"100%"},children:[(0,Z.jsxs)(i.ZP,{item:!0,xs:12,md:5,sx:{pt:"7%",display:{xs:"none",md:"block"}},children:[(0,Z.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",ml:{sm:"3%",md:"12%",lg:"28%"}},children:(0,Z.jsx)(v.Z,{carouselImages:["/images/vendor1.svg","/images/vendor1.svg"],padding:"100px"})}),(0,Z.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",ml:{sm:"3%",md:"12%",lg:"18%"}},children:(0,Z.jsx)(f.Z,{subtext:"You can start showcasing your products and services to thousands of individuals who need them today.",person:"vendor"})})]}),(0,Z.jsxs)(i.ZP,{item:!0,xs:0,md:7,sx:{display:{xs:"none",md:"block"},backgroundImage:"url(/images/signuphalf.svg)",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center center",position:"relative"},children:[(0,Z.jsxs)(m.Z,{component:u.Link,href:"/login",color:"background",size:"large",variant:"contained",sx:{color:"primary.main",fontWeight:600,position:"absolute",right:14,top:14},children:["LOG IN"," "]}),(0,Z.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",ml:{sm:"3%",md:"12%",lg:"28%"},px:{sm:"3%",md:"10%"},pt:"13%"},children:(0,Z.jsx)(v.Z,{carouselImages:e,padding:"90px"})}),(0,Z.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",ml:{sm:"3%",md:"12%",lg:"28%"},px:{sm:"3%",md:"10%"}},children:(0,Z.jsx)(f.Z,{subtext:"Gain access to thousands of unique goods and services today. You can sign up now to find a vendor or seller who has just what you need. ",person:"customer"})})]}
1),(0,Z.jsxs)(i.ZP,{item:!0,xs:12,sx:{display:{xs:"block",md:"none"},backgroundColor:"primary.main",pt:"7%"},children:[(0,Z.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",ml:{xs:0,sm:"7%"}},children:(0,Z.jsx)(v.Z,{carouselImages:e,padding:"30%"})}),(0,Z.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",color:"background.main"},children:[(0,Z.jsx)(r.Z,{variant:"caption",children:"Track your orders with ease"}),(0,Z.jsx)(r.Z,{variant:"h5",my:3,children:"Join now as a Vendor"}),(0,Z.jsx)(r.Z,{variant:"body3",children:"Give access to thousands of unique goods and services today."}),(0,Z.jsx)(r.Z,{variant:"body3",children:"You can sign up now to find a customer who needs just what you have."}),(0,Z.jsxs)(o.Z,{sx:{mt:5,mb:4,display:"flex",flexDirection:"column",alignItems:"center",width:"100%"},children:[(0,Z.jsx)(m.Z,{component:u.Link,href:"/signup/vendor",color:"secondary",size:"large",variant:"contained",sx:{color:"background.main",fontWeight:600,width:.5},children:"SIGN UP"}),(0,Z.jsx)(m.Z,{component:u.Link,href:"/login",color:"background",size:"large",variant:"contained",sx:{color:"primary.main",fontWeight:600,width:.5,mt:4},children:"LOG IN"})]}),(0,Z.jsxs)(r.Z,{variant:"body3",children:["Want to become a customer?"," ",(0,Z.jsx)(c.Z,{component:u.Link,href:"/signup/customer",sx:{color:"secondary.main",textDecoration:"none",fontWeight:600},children:(0,Z.jsx)("a",{children:" JOIN NOW"})})]})]})]})]})]})}},54661:function(e,n,t){"use strict";t.d(n,{FE:function(){return useRouteGuard},LS:function(){return useServiceImages},Yz:function(){return useInterval},c1:function(){return useGetTransactionInfo},hD:function(){return useDynamicFields},jl:function(){return useSelectorLoaderState},rQ:function(){return useSavedCards},wy:function(){return useSwitchAccount},y4:function(){return useServiceCategories}});var r=t(16835),o=t(27812),i=t(50029),a=t(59499),s=t(87794),c=t.n(s),u=t(30381),l=t.n(u),d=t(11163),v=t(67294),f=t(25617),p=t(86875),m=t(19726),h=t(29505),g=t(82336),x=t(82295),y=t(88767),b=t(74231);function ownKeys(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function _objectSpread(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ownKeys(Object(t),!0).forEach(function(n){(0,a.Z)(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function useGetTransactionInfo(e){var n,t=e.userRole,r=e.initialFetch,o=(0,f.I0)(),s="vendor"==t?"paid":"sent",u=(0,v.useState)([]),d=u[0],g=u[1],x=(0,v.useState)([]),y=x[0],b=x[1],Z=(0,v.useState)([]),I=Z[0],j=Z[1],C=(0,v.useState)({}),w=C[0],S=C[1],k=(0,v.useState)(0),_=k[0],R=k[1],P=(0,v.useState)(!1),W=P[0],Y=P[1],D=(0,v.useState)((n={},(0,a.Z)(n,s,0),(0,a.Z)(n,"completed",0),(0,a.Z)(n,"pending",0),n)),O=D[0],A=D[1];function getTransactions(e){return _getTransactions.apply(this,arguments)}function _getTransactions(){return(_getTransactions=(0,i.Z)(c().mark(function _callee(e){var n,r,i,u,d,v,f,x,y,Z,I,C,w,k,_,P,W,D,O,E;return c().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(Y(!0),e&&(n={start_date:l()().month(e).startOf("month").format("YYYY-MM-DD"),end_date:l()().month(e).endOf("month").format("YYYY-MM-DD")}),"vendor"!=t){c.next=8;break}return c.next=5,(0,p.z2)(n);case 5:c.t0=c.sent,c.next=11;break;case 8:return c.next=10,(0,p.YF)(n);case 10:c.t0=c.sent;case 11:if(i=(r=c.t0||{}).success,u=r.resData,Y(!1),i&&null!=u){if(v=[],f=[],x=0,y=0,Z=0,I=0,C={},w=e?l()().month(e):0,k=Math.ceil((e?w.daysInMonth():0)/7),_=u.metadata,P=u.invoice,S(_),null==P||P.forEach(function(n){if(n.published){if(v.push(n),n.paid){if(Z+=1,x+=n.total_amount,e){var t=l()(n.created_timestamp).date();C[Math.ceil(t/7)]=(C[Math.ceil(t/7)]||0)+1}}else y+=n.total_amount,I+=1}else f.push(n),v.push(n)}),e){if(W=[],w.month()==l()().month())for(O=1,D=Math.ceil(l()().date()/7);O<=k;O++)W.push(O<=D?C[O]||0:null);else if(w.month()>l()().month())W=Array(k).fill(null);else for(E=1;E<=k;E++)W.push(C[E]||0);j(W)}R(I),g([].concat(v)),b([].concat(f)),A((d={},(0,a.Z)(d,s,m.zW.format(x/100)),(0,a.Z)(d,"pending",m.zW.format(y/100)),(0,a.Z)(d,"completed",Z),d))}else o((0,h.xB)({message:"something went wrong",type:"error"}));case 15:case"end":return c.stop()}},_callee)}))).apply(this,arguments)}return(0,v.useEffect)(function(){r&&getTransactions()},[]),{transactions:d,getTransactions:getTransactions,loading:W,summary:O,drafts:y,pendingCount:_,weekly:I,meta:w}}var useInterval=function(e,n){var t=(0,v.useRef)();(0,v.useEffect)(function(){t.current=e},[e]),(0,v.useEffect)(function(){if(null!==n){var e=setInterval(function(){t.current()},n);return function(){return clearInterval(e)}}},[n])};function useRouteGuard(e){var n=e.userRole,t=e.skipVerifyEmail,r=e.skipVerifyUserType,o=(0,d.useRouter)(),i=(0,v.useState)(!0),a=i[0],s=i[1],c=((0,m.PR)()||{}).fresh,u=(0,f.v9)(function(e){return e.user}),l=o.pathname,p=["/customer/payment"].some(function(e){return l.includes(e)});function authenthicate(){return null!=u&&u.activeRole?l&&(0,m.A9)(l)&&((0,m.e3)(100)||!c)?o.push("/reauth?redirect=".concat(l)):(null==u?void 0:u.activeRole)===n||p?t||null!=u&&u.email_verified?r||null!=u&&u.user_type||o.push("/".concat(n,"/moreAboutYou")):o.push("/".concat(n,"/verifySignup")):o.push("/".concat(null==u?void 0:u.activeRole,"/dashboard")):o.push("/login"),setTimeout(function(){return s(!1)},1e3)}return authenthicate(),{loading:a,router:o,user:u,authenthicate:authenthicate}}function useSwitchAccount(){var e,n=(0,v.useState)(!1),t=n[0],r=n[1],o=(0,f.v9)(function(e){return e.user||{}}),a=o.activeRole,s=o.vendor_id,u=o.customer_id,l=(0,f.I0)(),p=(0,d.useRouter)();return{switchAccount:(e=(0,i.Z)(c().mark(function _callee2(e){var n,t,i,d,v;return c().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return n=e.role,i=void 0===(t=e.refresh)||t,r(!0),l((0,h.W9)({appLoding:!0})),d="",d=n||("customer"==a?"vendor":"customer"),v=_objectSpread(_objectSpread({},o),{},{activeRole:d,profile:null}),localStorage.setItem("user",JSON.stringify(v)),localStorage.setItem("userRole",d),c.next=10,l((0,g.YI)(d,"customer"==d?u:s));case 10:c.sent.success&&i?p.push("/".concat(d,"/dashboard")):(l((0,h.W9)({appLoding:!1})),l((0,h.yB)())),r(!1);case 14:case"end":return c.stop()}},_callee2)}
1)),function(n){return e.apply(this,arguments)}),loading:t}}function useServiceImages(){var e,n=(0,y.useQuery)(["AvailableCategories"],x.SL,{refetchOnWindowFocus:!0,initialData:{}}).data,t=(null==n?void 0:null===(e=n.resData)||void 0===e?void 0:e.categories)||[];return{servicesImages:(0,v.useMemo)(function(){var e={};return null==t||t.forEach(function(n){n.subcategories.forEach(function(n){var t;return e[null===(t=n.name)||void 0===t?void 0:t.toLowerCase()]=n.image})}),e},[t])}}function useDynamicFields(e){var n=e.initialData,t=e.max,i=void 0===t?1/0:t,a=e.min,s=void 0===a?1:a,c=e.schema,u=void 0===c?{}:c,l=e.initialValues,d=void 0===l?{}:l,f=(0,v.useState)(void 0===n?[]:n),p=f[0],m=f[1],h=(0,v.useState)({}),g=h[0],x=h[1],y=(0,v.useRef)(!0);(0,v.useEffect)(function(){y.current||validate()},[p]);var validate=function(){y.current=!1,x({});var e={},n={};p.forEach(function(t,o){Object.entries(t).forEach(function(t){var i=(0,r.Z)(t,2),a=i[0],s=i[1],c="".concat(o,"-").concat(a);e[c]=u[a],n[c]=s})});try{return b.Ry(e).validateSync(n,{abortEarly:!1}),!0}catch(e){var t={};return e.inner.forEach(function(e){t[e.path]=e.errors.join(",")}),x(t),!1}};return{fields:p,setFields:m,addEntry:function(){p.length<i&&m(function(e){return[].concat((0,o.Z)(e),[d])})},removeEntry:function(e){if(null!=e&&p.length>s){var n=(0,o.Z)(p);n.splice(e,1),m(n)}},handleFieldChange:function(e,n,t){if(e>=0){var r=(0,o.Z)(p),i=_objectSpread({},r[e]);i[n]=t,r.splice(e,1,i),m((0,o.Z)(r))}},errors:g,validate:validate}}var useSelectorLoaderState=function(){var e=(0,v.useState)(!1),n=e[0],t=e[1];return(0,v.useEffect)(function(){n&&setTimeout(function(){return t(!1)},5e3)},[n]),{selectorLoading:n,setSelectorLoading:t}};function useSavedCards(){var e,n=(0,v.useState)(!1),t=n[0],r=n[1],o=(0,f.v9)(function(e){return e.user.cards})||[],a=(0,f.I0)(),s=(e=(0,i.Z)(c().mark(function _callee3(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r(!0),e.next=3,a((0,g.Bs)());case 3:r(!1);case 4:case"end":return e.stop()}},_callee3)})),function(){return e.apply(this,arguments)});return(0,v.useEffect)(function(){s()},[]),{cards:o,loading:t,getCards:s}}function useServiceCategories(){var e=(0,f.v9)(function(e){var n;return null===(n=e.user)||void 0===n?void 0:n.profile}),n=(0,v.useState)([]),t=n[0],r=n[1];return(0,v.useEffect)(function(){var n;if((null==e?void 0:null===(n=e.categories)||void 0===n?void 0:n.length)>0){var t=e.categories.map(function(e){return{name:e.name,subCategories:e.subcategories,others:e.others}});r((0,o.Z)(t))}},[null==e?void 0:e.categories]),{selectedCategories:t,setSelectedCategories:r}}},75557:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(23438)}])},72770:function(e){"use strict";e.exports=next},16835:function(e,n,t){"use strict";t.d(n,{Z:function(){return _slicedToArray}});var r=t(2937);function _slicedToArray(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){s=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(s)throw r}}return i}}(e,n)||(0,r.Z)(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}},function(e){e.O(0,[4885,7456,8780,6886,3009,9726,9774,2888,179],function(){return e(e.s=75557)}),_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.