1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8601],{21277:function(e,a,t){"use strict";var s,l=t(52983);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e}).apply(this,arguments)}a.Z=function(e){return l.createElement("svg",i({width:15,height:15,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=l.createElement("path",{d:"m8.756 4.75.744.744-7.188 7.173h-.729v-.729L8.756 4.75ZM11.606 0a.792.792 0 0 0-.554.23l-1.45 1.448 2.97 2.97 1.448-1.45c.31-.308.31-.823 0-1.116L12.168.23a.777.777 0 0 0-.562-.23Zm-2.85 2.525L0 11.281v2.969h2.969l8.756-8.756-2.97-2.969Z",fill:"#000"})))}},4488:function(e,a,t){"use strict";var s,l=t(52983);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e}).apply(this,arguments)}a.Z=function(e){return l.createElement("svg",i({width:17,height:17,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=l.createElement("path",{d:"M13.458 9.208h-4.25v4.25H7.792v-4.25h-4.25V7.792h4.25v-4.25h1.416v4.25h4.25v1.416Z",fill:"#000"})))}},29177:function(e,a,t){"use strict";var s,l=t(52983);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e}).apply(this,arguments)}a.Z=function(e){return l.createElement("svg",i({width:14,height:15,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=l.createElement("path",{d:"M4.314 0v.833H.252V2.5h.812v10.833c0 .442.172.866.476 1.179.305.312.718.488 1.15.488h8.125c.43 0 .844-.176 1.149-.488.304-.313.476-.737.476-1.179V2.5h.812V.833H9.189V0H4.314ZM2.69 2.5h8.126v10.833H2.689V2.5Zm1.625 1.667v7.5H5.94v-7.5H4.314Zm3.25 0v7.5H9.19v-7.5H7.564Z",fill:"#22292F"})))}},5152:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/customer/account-settings",function(){return t(75694)}])},1571:function(e,a,t){"use strict";t.d(a,{k:function(){return n}});var s=t(97458),l=t(52983),i=t(55462),r=t(89044);let n=(0,l.forwardRef)((e,a)=>{let{children:t,className:l,disabled:n,loading:o,type:c="button",variant:d="primary",theme:u="black",...m}=e;return(0,s.jsxs)("button",{ref:a,type:c,disabled:n||o,className:(0,i.cn)("helvetica-16-400 flex w-fit justify-center gap-x-2",{"bg-opacity-50":n||o,"border border-black bg-black text-white":"black"===u,"border border-gray-400 bg-white text-black":"white"===u,"w-full py-3":"primary"===d},l),...m,children:[t," ",o&&(0,s.jsx)(r.U,{size:"small"})]})})},89044:function(e,a,t){"use strict";t.d(a,{U:function(){return i}});var s=t(97458);t(52983);var l=t(55462);function i(e){let{className:a,size:t="medium",customSize:i=""}=e;return(0,s.jsxs)("div",{className:(0,l.cn)("relative",a,{"h-4 w-4":"small"===t,"h-6 w-6":"medium"===t,"h-8 w-8":"large"===t},i),children:[(0,s.jsx)("div",{className:"absolute left-0 top-0 h-full w-full animate-spin rounded-full border-2 border-gray-200"}),(0,s.jsx)("div",{className:"h-full w-full animate-spin rounded-full border-2 border-ar-culinista-black border-t-transparent",role:"status"}),(0,s.jsx)("span",{className:"invisible",children:"Loading..."})]})}},2241:function(e,a,t){"use strict";t.d(a,{X:function(){return g}});var s=t(97458),l=t(52983),i=t(78906),r=t(15783),n=t(88786),o=t(92156),c=t(43359),d=t(14517),u=t(49122),m=t(71977),h=t(31165),p=t(10059),f=t(15913),v=t(39957);function x(e){let{className:a,messages:t}=e;return(0,s.jsxs)("div",{className:(0,d.Z)("flex items-center bg-ar-red bg-opacity-10 px-8 py-2.5 text-ar-red",a,{"gap-2":1===t.length,"gap-4":t.length>1}),children:[(0,s.jsx)(v.k,{icon:(0,s.jsx)(f.Z,{}),size:16}),(0,s.jsx)("p",{className:"helvetica-14-400 flex-1",children:1===t.length?t:(0,s.jsx)("ul",{className:"flex list-inside list-disc flex-col gap-0.5",children:t.map(e=>(0,s.jsx)("li",{children:e},e))})})]})}let b=new Date;function g(e){let{children:a}=e,t=(0,c.a)(890),f=(0,h.Q)(),[v,g]=(0,l.useState)({payment:void 0,mealPrep:void 0});(0,u.N66)({fetchPolicy:"network-only",variables:{input:{serviceType:u.UW4.MealPrep,serviceDateLessThan:new Date(new Date(b).setMonth(new Date(b).getMonth()+3)),serviceDateGreaterThan:new Date(b)}},onCompleted:async e=>{let{serviceList:a}=e;if(a.items.length>0){let e=a.items.sort((e,a)=>(0,m.EM)(e.serviceDate).getTime()-(0,m.EM)(a.serviceDate).getTime()).filter(e=>"CANCELLED_ENDED"!==e.serviceStatus)[0],t=(0,m.EM)(e.serviceDate);t.setHours(parseFloat(e.startTime.split(":")[0])),t.setMinutes(parseFloat(e.startTime.split(":")[1]));let s=Math.floor((t.getTime()-b.getTime())/36e5),l={mealPrep:void 0,payment:void 0};if(s<72&&0===e.dishes.length&&(l.mealPrep="Important: Select your dishes at least 24 hours prior to your service time to avoid service cancellation and fee."),s<72){let{data:e}=await f.query({query:u.KDL,fetchPolicy:"network-only"});0===e.paymentMethods.items.length?l.payment="Add a valid payment method at least 48 hours prior to your service time to avoid service cancellation.":g(e=>({...e,payment:void 0}))}g(e=>({...e,...l}))}else g(e=>({...e,mealPrep:void 0}))}});let j=!!v.payment||!!v.mealPrep,y=Object.values(v).filter(e=>!!e);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex min-h-screen flex-col",children:[(0,s.jsx)(n.W,{className:"border-b border-ar-culinista-black border-opacity-40",backgroundColor:r.bG.BeigeLight,textColor:r.bG.CulinistaBlack,keepColorThemeOnScroll:!0,mobileCta:{label:"Book a service",href:o.y.bookingService(),backgroundColor:r.bG.Navy,textColor:r.bG.NavyLight},hideLoginLinkOnMobile:!0}),(0,s.jsx)("div",{className:"flex flex-grow bg-ar-beige-light text-ar-culinista-black ",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-[1750px] flex-grow",children:[!t&&(0,s.jsx)(p.U,{}),(0,s.jsxs)("main",{className:"max-w-full flex-1",children:[!!j&&(0,s.jsx)("div",{className:"px-[30px] pt-16 md:px-[118px]",children:(0,s.jsx)(x,{messages:y})}),(0,s.jsx)("div",{className:(0,d.Z)({"pt-16":!j,"pt-8":!!j}),children:a})]})]})})]}),(0,s.jsx)(i.a,{backgroundColor:r.bG.CulinistaBlack,textAndBorderColor:r.bG.NavyLight})]})}},57337:function(e,a,t){"use strict";t.d(a,{_:function(){return n}});var s=t(97458);t(52983);
1var l=t(14517),i=t(15783),r=t(35031);function n(e){let{children:a,className:t,descriptionClassName:n="mt-5",childrenClassName:o,title:c,customActionElement:d,titleRightElement:u,description:m}=e,h=(0,r.M)("border",i.bG.CulinistaBlack),p=(0,r.M)("text",i.bG.CulinistaBlack),f=c||m;return(0,s.jsxs)("section",{className:(0,l.Z)("mb-[60px] md:mb-[88px]",t),children:[f&&(0,s.jsx)("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between",children:(0,s.jsxs)("div",{className:"w-full",children:[c&&(0,s.jsxs)("div",{className:"flex flex-col md:flex-row md:justify-between",children:[(0,s.jsx)("h3",{className:(0,l.Z)(p,"editorial-24 md:editorial-38"),children:c}),u&&(0,s.jsx)("div",{className:"mt-6 md:mt-0",children:u})]}),m&&(0,s.jsx)("p",{className:(0,l.Z)("garamond-16 mt-4 max-w-[680px] md:mt-6",n),children:m})]})}),a&&(0,s.jsxs)("div",{className:(0,l.Z)(h,"border border-opacity-40 p-6 md:p-8",f&&"mt-6 md:mt-8",o),children:[a,d&&(0,s.jsx)("div",{className:"ml-auto w-fit pt-8",children:d})]})]})}},80250:function(e,a,t){"use strict";t.d(a,{e:function(){return i}});var s=t(97458);t(52983);var l=t(14517);function i(e){let{className:a,children:t}=e;return(0,s.jsx)("div",{className:(0,l.Z)("px-[30px] pb-40 md:px-[118px]",a),children:t})}},45537:function(e,a,t){"use strict";t.d(a,{f:function(){return n}});var s=t(97458);t(52983);var l=t(37249),i=t(90015),r=t(74870);function n(e){let{title:a,description:t,images:n}=e,{siteName:o,siteDescription:c}=(0,i.K)(),d={description:t||c,images:n||r.nI.images,url:r.nI.url,siteName:o,ogTitle:"".concat(r.nI.siteName," | ").concat(a||r.nI.title)},u=Array.isArray(d.images)?d.images.filter(e=>!!e&&"object"==typeof e&&"string"==typeof e.url&&!!e.url).map(e=>({url:e.url,alt:e.alt||d.description||r.nI.description})):[];return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(l.PB,{title:a,titleTemplate:"%s | ".concat(d.siteName),defaultTitle:"".concat(r.nI.title," | ").concat(d.siteName),description:d.description,openGraph:{url:d.url,title:d.ogTitle,description:d.description,images:u.length?u:void 0,siteName:r.nI.siteName,locale:"en_US"}})})}},94036:function(e,a,t){"use strict";function s(e){if((null==e?void 0:e.name)==="ServerError"){let{result:t}=e;if("object"==typeof t){var a;let e=null==t?void 0:t.errors[0];if(null==e?void 0:null===(a=e.extensions)||void 0===a?void 0:a.violations)return JSON.parse(e.extensions.violations);if(null==e?void 0:e.message)return[{Message:e.message,Property:e.message}]}}return[]}t.d(a,{s:function(){return s}})},18140:function(e,a,t){"use strict";t.d(a,{O:function(){return l}});var s=t(52983);function l(e,a){let[t,l]=(0,s.useState)(e);return{state:t,options:function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.keys(e).filter(t=>!a.includes(e[t])).map(a=>({label:e[a].toString().replaceAll("_"," ").toLowerCase().replace(/^\w/,e=>e.toUpperCase()),value:e[a]}))}(a),onInputChange:e=>{l(a=>e.target.checked?[...a,e.target.value]:a.filter(a=>a!==e.target.value))},reset:()=>{l(e)},checkAll:()=>{l(Object.values(a))},clear:()=>{l([])}}}},33902:function(e,a,t){"use strict";function s(e,a){return e.length===a.length&&e.every(e=>a.includes(e))}t.d(a,{a:function(){return s}})},75694:function(e,a,t){"use strict";t.r(a),t.d(a,{__N_SSP:function(){return ed},default:function(){return eu}});var s,l=t(97458),i=t(52983),r=t(49588),n=t(47411),o=t(98680),c=t(49122),d=t(55462),u=t(99099),m=t(15783),h=t(59328),p=t(76241);function f(){let e=(0,i.useRef)(null),{data:a}=(0,c.J90)(),[t,s]=(0,c.sHt)({refetchQueries:[c.tQJ]}),f=(0,o.cI)(),{register:v,handleSubmit:x,watch:b,setValue:g,reset:j}=f,y=(0,i.useMemo)(()=>{var e,t,s;let l=null==a?void 0:null===(e=a.customer)||void 0===e?void 0:e.defaultAddressId;if(!l)return g("isDefault",!0),null;g("isDefault",!1);let i=null===(s=a.customer)||void 0===s?void 0:null===(t=s.addresses)||void 0===t?void 0:t.find(e=>e.id===l);return"".concat(null==i?void 0:i.streetAddress).concat((null==i?void 0:i.streetAddress2)?" ".concat(null==i?void 0:i.streetAddress2):""," ").concat(null==i?void 0:i.city,", ").concat(null==i?void 0:i.state," ").concat(null==i?void 0:i.zipCode)},[a,g]),N=!b("address.streetAddress")||!b("address.city")||!b("address.state")||!b("address.zipCode"),w=async e=>{let{address:a,isDefault:s}=e,{city:l,state:i,streetAddress:r,streetAddress2:n,zipCode:o,nickname:c,additionalComments:d}=a;await t({variables:{input:{city:l,state:i,streetAddress:r,streetAddress2:n,zipCode:o,nickname:c||null,additionalComments:d,isDefault:s}}})},C=async()=>{j(),s.reset()};return(0,l.jsx)(h.k,{modalId:r.Ti.AddAddress,title:"Add an Address",onSaveClick:()=>{e.current.requestSubmit()},afterClose:C,queryState:s,saveButtonTextColor:N?m.bG.Navy:m.bG.White,saveButtonBackgroun
1dColor:N?m.bG.NavyLight:m.bG.Navy,saveButtonClassName:"helvetica-12-500",cancelButtonClassName:"helvetica-12-500",saveButtonDisabled:N,closeAfterSaveButtonClick:!1,children:(0,l.jsx)(p.h,{queryState:s,successPrompt:"Address Added",beforeModalClose:C,children:(0,l.jsxs)("form",{ref:e,className:"flex flex-col",onSubmit:x(w),children:[(0,l.jsx)(u.j,{className:"mb-8 grid grid-cols-1 gap-x-6 gap-y-8 md:grid-cols-3 md:[&>div:nth-child(-n+2)]:col-span-3 md:[&>div:nth-child(n+6)]:col-span-3",...f}),(0,l.jsxs)("div",{className:"mb-8 flex flex-col gap-2.5",children:[(0,l.jsx)(n.W,{label:"Make this my default address.",labelClassName:(0,d.cn)('select-none before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:mr-2 before:border before:border-ar-culinista-black before:p-[3px] before:bg-clip-content',{"opacity-70 before:border-opacity-40":!b("isDefault"),"before:bg-ar-culinista-black":b("isDefault")}),className:"hidden cursor-pointer",disabled:!y,variant:"customer-panel",...v("isDefault")}),(0,l.jsxs)("div",{className:(0,d.cn)("helvetica-12-400 md:helvetica-14-400 w-full bg-ar-navy-light p-2 md:pr-8",(!b("isDefault")||!y)&&"invisible"),children:[(0,l.jsx)("span",{className:"helvetica-12-500 md:helvetica-14-500",children:"Please note: "}),"Your current default address is ".concat(y,". Checking this option will change your default address.")]})]})]})})})}var v=t(48095),x=t(39957),b=t(21277),g=t(29177),j=t(4488);function y(e){let{addressData:a,defaultAddressText:t}=e,s=(0,i.useRef)(null),f=(0,o.cI)({defaultValues:{address:{additionalComments:a.additionalComments,city:a.city,nickname:a.nickname,state:a.state,streetAddress:a.streetAddress,streetAddress2:a.streetAddress2,zipCode:a.zipCode},isDefault:a.isDefault}}),{register:v,handleSubmit:x,watch:b,reset:g}=f,[j,y]=(0,c.zhB)({refetchQueries:[c.tQJ]}),N=async e=>{let{address:t,isDefault:s}=e,{city:l,state:i,streetAddress:r,streetAddress2:n,zipCode:o,nickname:c,additionalComments:d}=t;await j({variables:{input:{addressId:a.id,city:l,state:i,streetAddress:r,streetAddress2:n||null,zipCode:o,nickname:c||null,additionalComments:d,isDefault:s}}})},w=async()=>{g(),y.reset()};return(0,l.jsx)(h.k,{modalId:r.Ti.EditAddress,title:"Edit an Address",onSaveClick:()=>{s.current.requestSubmit()},afterClose:w,queryState:y,saveButtonTextColor:m.bG.White,saveButtonBackgroundColor:m.bG.Navy,saveButtonClassName:"helvetica-12-500",cancelButtonClassName:"helvetica-12-500",closeAfterSaveButtonClick:!1,children:(0,l.jsx)(p.h,{queryState:y,successPrompt:"Your address information has been updated.",beforeModalClose:w,children:(0,l.jsxs)("form",{ref:s,className:"flex flex-col",onSubmit:x(N),children:[(0,l.jsx)(u.j,{className:"mb-8 grid grid-cols-1 gap-x-6 gap-y-8 md:grid-cols-3 md:[&>div:nth-child(-n+2)]:col-span-3 md:[&>div:nth-child(n+6)]:col-span-3",...f}),(0,l.jsxs)("div",{className:"mb-8 flex flex-col gap-2.5",children:[(0,l.jsx)(n.W,{label:"Make this my default address.",labelClassName:(0,d.cn)('select-none before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:mr-2 before:border before:border-ar-culinista-black before:p-[3px] before:bg-clip-content',{"opacity-70 before:border-opacity-40":!b("isDefault"),"before:bg-ar-culinista-black":b("isDefault")}),className:"hidden cursor-pointer",disabled:a.isDefault,variant:"customer-panel",...v("isDefault")}),(0,l.jsxs)("div",{className:(0,d.cn)("helvetica-12-400 md:helvetica-14-400 w-full bg-ar-navy-light p-2 md:pr-8",(!b("isDefault")||a.isDefault)&&"invisible"),children:[(0,l.jsx)("span",{className:"helvetica-12-500 md:helvetica-14-500",children:"Please note: "}),"Your current default address is ".concat(t,". Checking this option will change your default address.")]})]})]})})})}function N(e){let{address:a}=e,t="".concat(null==a?void 0:a.streetAddress," ").concat(null==a?void 0:a.streetAddress2," ").concat(null==a?void 0:a.city,", ").concat(null==a?void 0:a.state," ").concat(null==a?void 0:a.zipCode),[s,i]=(0,c.ctD)({refetchQueries:[c.tQJ]}),n=async()=>{await s({variables:{input:{addressId:null==a?void 0:a.id}}})},o=async()=>{i.reset()};return(0,l.jsx)(h.k,{modalId:r.Ti.DeleteAddress,title:"Delete address",onSaveClickRaw:n,saveButtonText:"Delete",queryState:i,saveButtonTextColor:m.bG.White,saveButtonBackgroun
1dColor:m.bG.Navy,saveButtonClassName:"helvetica-12-500",cancelButtonClassName:"helvetica-12-500",closeAfterSaveButtonClick:!1,children:(0,l.jsx)(p.h,{queryState:i,successPrompt:"Address Deleted",beforeModalClose:o,children:(0,l.jsx)("div",{className:"helvetica-14-400 text-lg ",children:(0,l.jsxs)("h1",{className:"pb-16",children:["Are you sure you want to delete"," ",(0,l.jsx)("span",{className:"font-bold text-ar-culinista-black",children:(null==a?void 0:a.nickname)||t}),"?"]})})})})}function w(){var e;let[a,t]=(0,i.useState)(null),{openedModal:s}=(0,r.S9)(),{openModal:n}=(0,r.ws)(),{data:o,error:d}=(0,c.J90)(),u=null==o?void 0:null===(e=o.customer)||void 0===e?void 0:e.defaultAddressId,m=(0,i.useMemo)(()=>{var e;let a=null==o?void 0:null===(e=o.customer)||void 0===e?void 0:e.addresses;if(!a)return[];let t=a.filter(e=>e.id!==u),s=a.find(e=>e.id===u);return s&&t.unshift(s),t},[o,u]),h="",p=(e,a)=>{t({...e,isDefault:a}),n(r.Ti.EditAddress)},f=(e,a)=>{t({...e,isDefault:a}),n(r.Ti.DeleteAddress)};return d?(0,l.jsx)("div",{className:"grid place-items-center",children:(0,l.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,l.jsx)("h1",{className:"text-xl text-ar-red",children:"Error:"}),(0,l.jsx)("p",{className:"text-red-200",children:d.message})]})}):m?(0,l.jsxs)("div",{className:"helvetica-14-400 grid grid-cols-[1fr_auto_auto] gap-x-4 gap-y-6 text-ar-culinista-black lg:grid-cols-[1fr_2fr_1fr_1fr] lg:gap-y-10",children:[m.length>0?m.map(e=>{let{id:a,state:t,streetAddress:s,streetAddress2:r,city:n,zipCode:o,additionalComments:c,nickname:d}=e,m="".concat(s," ").concat(r||""," ").concat(n,", ").concat(t," ").concat(o),v=a===u;return v&&(h=m),(0,l.jsxs)(i.Fragment,{children:[(0,l.jsx)("h1",{className:"helvetica-14-500",children:d}),(0,l.jsxs)("div",{className:"hidden h-full flex-col justify-between text-black lg:flex",children:[(0,l.jsx)("p",{className:"max-w-40",children:m}),c&&(0,l.jsx)("p",{className:"mt-1 max-w-80 opacity-70",children:c})]}),v?(0,l.jsx)("p",{className:"helvetica-9-400 md:helvetica-10-400 ml-auto h-fit w-fit bg-ar-navy-light px-2 py-[3px] uppercase",children:"Default"}):(0,l.jsx)("div",{}),(0,l.jsxs)("div",{className:"-mr-2 -mt-2 flex flex-wrap justify-self-end",children:[(0,l.jsx)("button",{title:"Edit address",type:"button",className:"h-fit p-2",onClick:()=>p(e,v),children:(0,l.jsx)(x.k,{width:15,height:15,icon:(0,l.jsx)(b.Z,{})})}),(0,l.jsx)("button",{title:"Delete address",type:"button",className:"h-fit p-2",onClick:()=>f(e,v),children:(0,l.jsx)(x.k,{size:15,icon:(0,l.jsx)(g.Z,{})})})]}),(0,l.jsxs)("div",{className:"col-span-3 flex h-full flex-col justify-between text-black lg:hidden",children:[(0,l.jsx)("p",{children:m}),c&&(0,l.jsx)("p",{className:"mt-2 opacity-70",children:c})]}),(0,l.jsx)("div",{className:"col-span-3 border-t border-ar-culinista-black border-opacity-40 lg:col-span-4"})]},a)}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"helvetica-16-400 col-span-3 grid place-items-center lg:col-span-4",children:"You haven't added any addresses yet"}),(0,l.jsx)("div",{className:"col-span-3 border-t border-ar-culinista-black border-opacity-40 lg:col-span-4"})]}),(0,l.jsx)("div",{className:"col-span-3 lg:col-span-4 lg:justify-self-end",children:(0,l.jsxs)("button",{type:"button",onClick:()=>{n(r.Ti.AddAddress)},className:"helvetica-14-500 flex cursor-pointer items-center gap-2",children:[(0,l.jsx)("p",{children:"Add an address"}),(0,l.jsx)(x.k,{size:17,icon:(0,l.jsx)(j.Z,{})})]})}),s===r.Ti.EditAddress&&(0,l.jsx)(y,{addressData:a,defaultAddressText:h}),(0,l.jsx)(N,{address:a})]}):(0,l.jsx)("div",{className:"flex flex-1 justify-center",children:(0,l.jsx)(v.U,{})})}function C(){return(C=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e}).apply(this,arguments)}var k=function(e){return i.createElement("svg",C({viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=i.createElement("path",{d:"M9.473 1.5c4.147 0 7.507 3.375 7.507 7.5s-3.36 7.5-7.508 7.5c-2.632 0-4.934-1.365-6.277-3.428l1.185-.937C5.438 13.852 7.32 15 9.48 15a6 6 0 1 0 0-12 5.998 5.998 0 0 0-5.947 5.25h2.07l-2.805 2.797L0 8.25h2.018c.375-3.787 3.57-6.75 7.455-6.75Zm2.22 6.18a.691.691 0 0 1 .682.69v3.458c0 .375-.307.69-.69.69H7.537a.693.693 0 0 1-.69-.69V8.37c0-.382.308-.682.683-.69v-.757a2.082 2.082 0 0 1 4.163 0v.757ZM9.608 5.895A1.03
11.03 0 0 0 8.58 6.923v.757h2.063v-.757a1.03 1.03 0 0 0-1.036-1.028Z",fill:"currentColor"})))},B=t(1571),S=t(60728),P=t(21967);function D(){let{openModal:e}=(0,r.ws)(),{user:a}=(0,P.jJ)(),t=a.isLoggedIn&&a.isPasswordSet;return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"mt-10 flex flex-col gap-y-5 border-t border-ar-culinista-black border-opacity-40 pt-10 text-ar-culinista-black",children:[(0,l.jsx)("p",{className:"helvetica-14-500",children:"Account Password"}),(0,l.jsxs)("div",{className:"flex justify-between",children:[(0,l.jsx)("p",{className:"helvetica-14-400",children:"Your password is".concat(t?"":" not"," set.")}),(0,l.jsxs)(B.k,{className:"helvetica-14-500 -mr-2 -mt-2 p-2",type:"button",onClick:()=>{e(r.Ti.ChangePassword)},theme:"transparent",variant:"text",children:[(0,l.jsx)("p",{className:"hidden md:block",children:"".concat(t?"Change":"Set"," Password")}),(0,l.jsx)(S.k,{className:"hidden md:block",icon:(0,l.jsx)(k,{}),size:18}),(0,l.jsx)(S.k,{className:"md:hidden",width:15,height:15,icon:(0,l.jsx)(b.Z,{})})]})]})]})})}var A=t(94036),T=t(19685),M=t(42424),E=t.n(M),I=t(92156);function O(){let[e,a]=(0,c.JbC)(),[t,s]=(0,i.useState)([]),{logout:n}=(0,T.a)(),{closeModal:o}=(0,r.ws)(),d=async()=>{s([]),await e({onCompleted:async()=>{o(),await n()},onError:e=>{let{networkError:a}=e;s((0,A.s)(a))}})};return(0,l.jsx)(h.k,{modalId:r.Ti.DeleteAccount,title:"Delete Account",saveButtonText:"Delete Account",saveButtonClassName:"bg-transparent text-ar-red border border-ar-red helvetica-12-500",saveButtonBackgroundColor:m.bG.Transparent,saveButtonTextColor:m.bG.Red,saveButtonLoading:null==a?void 0:a.loading,onSaveClick:d,cancelButtonClassName:"helvetica-12-500",cancelButtonBackgroundColor:m.bG.Navy,cancelButtonTextColor:m.bG.White,margins:"sm",reverseButtons:!1,closeAfterSaveButtonClick:!1,queryState:a,children:(0,l.jsxs)(p.h,{queryState:a,successPrompt:"An email with final steps to delete your account has been sent.",displayIcon:!1,children:[(0,l.jsxs)("p",{className:"helvetica-14-400 pb-44 text-ar-culinista-black opacity-70",children:["If you delete your account, all services will be canceled and all client information will be permanently deleted, including Culinista credits and payment information. If you cancel your account within 48 hours of a service, you will be charged a late cancellation fee. Please review our full cancellation policy"," ",(0,l.jsx)(E(),{href:I.y.faq("Billing"),className:"underline",rel:"noopener noreferrer",target:"_blank",children:"here"}),".",(0,l.jsx)("br",{}),(0,l.jsx)("br",{}),'If you would like to save your client information for the future, you can deactivate your account by closing this popup and selecting "Deactivate Account."']}),t&&t.map(e=>(0,l.jsx)("p",{className:"pb-2 text-center text-ar-red-warning",children:e.Message},e.Property))]})})}var _=t(2241),G=t(89044);let Z={[c.K0c.Email]:"Send weekly meal prep dish selection reminders by email only",[c.K0c.Sms]:"Send weekly meal prep dish selection reminders by text and email"},q={[c.K0c.Email]:"Send my contact Weekly Meal Prep Dish Selection Reminders by text and email",[c.K0c.Sms]:"Send my contact Weekly Meal Prep Dish Selection Reminders by email only"},L={[c._5S.ServiceUpdates]:"Send my contact booking & confirmation emails",[c._5S.Invoices]:"Send my contact invoice emails"},W={[c.UW4.Gathering]:"Gatherings",[c.UW4.CookingClass]:"Cooking Classes",[c.UW4.MealPrep]:"Weekly Meal Prep",[c.UW4.Company]:"Company",[c.UW4.Placement]:"Seasonal & Long Term"};c.y1L.HeHim,c.y1L.SheHer,c.y1L.TheyThem,c.y1L.NotSpecified;var U=t(61954),R=t(18140),H=t(33902),z=t(99068),F=t(57399),Y=t(98024),V=t(52682);function Q(e){var a,t,s,u;let{variant:f,...v}=e,x=(0,i.useRef)(null),b=(0,z.Ry)().shape({firstName:(0,z.Z_)().required("First name is required"),lastName:(0,z.Z_)().required("Last name is required"),email:"editPersonalDetails"!==f&&(0,z.Z_)().required("Email is required").email("Please enter valid email address"),phoneNumber:(0,z.Z_)().required("Phone is required").matches(/^\d{10}$/,"Phone number is not valid"),pronouns:(0,z.Z_)().nullable(),dateOfBirth:(0,z.hT)().nullable().transform((e,a)=>""===a?null:e)}),{register:g,handleSubmit:j,reset:y,formState:{isDirty:N,errors:w},watch:C,control:k,setValue:B}=(0,o.cI)({resolver:(0,F.X)(b)}),[S,P]=(0,i.useState)([]),[D,T]=(0,c.$Hb)({refetchQueries:[c.vcZ]}),[M,E]=(0,c.lo8)({refetchQueries:[c.vcZ]}),[I,O]=(0,c._WB)({refetchQueries:[c.vcZ]}),{state:_,onInputChange:G,options:Z,reset:Q}=(0,R.O)(v.serviceTypes||[],c.UW4),{state:K,onInputChange:J,options:X,reset:$}=(0,R.O)(v.notificationMethods||[],c.K0c),{state:ee,onInputChange:ea,options:et,reset:es}=(0,R.O)(v.notificationTypes||[],c._5S),el=(0,i.useMemo)(()=>"editPersonalDetails"===f?T:"editAdditionalContact"===f?E:O,[O,E,T,f]),ei=(0,i.useMemo)(()=>"editPersonalDetails"===f?"Edit Client Information":"editAdditionalContact"===f?"Edit a Contact":"Add a Contact",[f]),er=(0,i.useMemo)(()=>"editPersonalDetails"===f?"Client Information":"Contact Information",[f]),en=(0,i.useMemo)(()=>"editPersonalDetails"===f?"Communication method":"What information would you like this contact to re
1ceive?",[f]),eo=(0,i.useMemo)(()=>"editPersonalDetails"===f?"Please choose how you would like to receive weekly meal prep dish selection reminders. Booking & confirmation emails and invoices are always sent via email.":"Note that booking & confirmation emails and invoices are always sent via email.",[f]),ec=(0,i.useMemo)(()=>"editPersonalDetails"===f?"Please complete your personal information.":"Please fill in the details below. You can specify which services and types of communications you want this contact to receive.",[f]),ed=(0,i.useMemo)(()=>N||!(0,H.a)(_,v.serviceTypes||[])||!(0,H.a)(K,v.notificationMethods||[])||!(0,H.a)(ee,v.notificationTypes||[]),[K,N,ee,_,v]),eu=async e=>{let a=e.dateOfBirth?(0,V.Z)(e.dateOfBirth,"yyyy-MM-dd"):null;"editPersonalDetails"===f?await D({variables:{input:{firstName:e.firstName,lastName:e.lastName,phoneNumber:e.phoneNumber,pronouns:e.pronouns||void 0,dateOfBirth:a||void 0,notificationMethods:K.length>0?K:[]}},onError:e=>{let{networkError:a}=e;return P((0,A.s)(a))}}):"editAdditionalContact"===f?await M({variables:{input:{additionalContactId:v.id,email:e.email,firstName:e.firstName,lastName:e.lastName,phoneNumber:e.phoneNumber,pronouns:e.pronouns||void 0,dateOfBirth:a||void 0,notificationMethods:K.length>0?K:[],notificationTypes:ee.length>0?ee:[],serviceTypes:_.length>0?_:[]}},onError:e=>{let{networkError:a}=e;return P((0,A.s)(a))}}):await I({variables:{input:{email:e.email,firstName:e.firstName,lastName:e.lastName,phoneNumber:e.phoneNumber,pronouns:e.pronouns||void 0,dateOfBirth:a||void 0,notificationMethods:K.length>0?K:[],notificationTypes:ee.length>0?ee:[],serviceTypes:_.length>0?_:[]}},onError:e=>{let{networkError:a}=e;return P((0,A.s)(a))}})},em=async()=>{y(),Q(),$(),es(),P([]),el.reset()},{pronouns:eh,dateOfBirth:ep}=v;return(0,i.useEffect)(()=>{eh&&B("pronouns",eh),ep&&B("dateOfBirth",ep)},[ep,eh,B]),(0,l.jsx)(h.k,{title:ei,modalId:r.Ti.UpdatePersonalDetails,onSaveClick:()=>{x.current.requestSubmit(),P([])},saveButtonTextColor:ed?m.bG.White:m.bG.Navy,saveButtonBackgroundColor:ed?m.bG.Navy:m.bG.NavyLight,saveButtonClassName:"helvetica-12-500",cancelButtonClassName:"helvetica-12-500",afterClose:em,closeAfterSaveButtonClick:!1,queryState:el,saveButtonDisabled:!ed,children:(0,l.jsx)(p.h,{queryState:el,successPrompt:"Your information has been updated.",beforeModalClose:em,children:(0,l.jsxs)("div",{className:"mb-24",children:[(0,l.jsxs)("div",{className:"mb-8 mt-2 flex flex-col gap-y-1",children:[(0,l.jsx)("p",{className:"helvetica-14-500",children:er}),(0,l.jsx)("p",{className:"helvetica-14-400 opacity-70",children:ec})]}),(0,l.jsxs)("form",{ref:x,onSubmit:j(eu),className:"flex flex-col gap-y-16",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-x-6 gap-y-8 md:grid-cols-2 md:gap-y-10",children:[(0,l.jsx)(U.j,{variant:"underlined",label:"First Name",error:null===(a=w.firstName)||void 0===a?void 0:a.message.toString(),defaultValue:v.firstName,...g("firstName")}),(0,l.jsx)(U.j,{variant:"underlined",label:"Last Name",error:null===(t=w.lastName)||void 0===t?void 0:t.message.toString(),defaultValue:v.lastName,...g("lastName")}),(0,l.jsx)(U.j,{variant:"underlined",label:"Email",error:null===(s=w.email)||void 0===s?void 0:s.message.toString(),disabled:"editPersonalDetails"===f,defaultValue:v.email,...g("email")}),(0,l.jsx)(U.j,{variant:"underlined",label:"Phone Number",error:null===(u=w.phoneNumber)||void 0===u?void 0:u.message.toString(),defaultValue:v.phoneNumber,...g("phoneNumber")}),(0,l.jsx)(Y.f,{...g("dateOfBirth"),control:k,placeholder:"Date of Birth (Optional)",label:"Date of Birth (Optional)",showLabel:C("dateOfBirth"),minDate:null,maxDate:new Date,primaryColor:m.bG.CulinistaBlack})]}),"editPersonalDetails"!==f&&(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("h2",{className:"helvetica-14-500 mb-2 md:mb-1",children:"Which services would you like this contact to be informed about?"}),(0,l.jsx)("p",{className:"helvetica-14-400 mb-6 opacity-70 md:mb-4",children:"Select all that apply."}),(0,l.jsx)("div",{className:"flex flex-col gap-y-3",children:Z.filter(e=>![c.UW4.Company].includes(e.value)).map(e=>(0,l.jsx)("span",{className:"w-fit cursor-pointer",children:(0,l.jsx)(n.W,{checked:!!(null==_?void 0:_.find(a=>a===e.value)),variant:"customer-panel",labelClassName:(0,d.cn)('select-none before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:mr-2 before:border before:border-ar-culinista-black before:p-[3px] before:bg-clip-content',{"opacity-70 before:border-opacity-40":!(null==_?void 0:_.find(a=>a===e.value)),"before:bg-ar-culinista-black":null==_?void 0:_.find(a=>a===e.value)}),className:"hidden cursor-pointer",label:W[e.value],value:e.value,onChange:e=>G(e)})},e.value))})]}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("h2",{className:"helvetica-14-500 mb-2 md:mb-1",children:en}),(0,l.jsx)("p",{className:"helvetica-14-400 mb-6 opacity-70 md:mb-4",children:eo}),(0,l.jsxs)("div",{className:"flex flex-col gap-y-3",children:[X.map(e=>(0,l.jsx)("span",{className:"w-fit cursor-pointer",children:(0,l.jsx)(n.W,{checked:!!(null==K?void 0:K.find(a=>a===e.value))||e.value===c.K0c.Email&&"editPersonalDetails"===f,variant:"customer-panel",labelClassName:(0,d.cn)('select-none before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:mr-2 before:border before:border-ar-culinista-black before:p-[3px] before:bg-clip-content',{"opacity-70 before:border-opacity-40":!(null==K?void 0:K.find(a=>a===e.value)),"before:bg-ar-culinista-black":(null==K?void 0:K.find(a=>a===e.value))||e.value===c.K0c.Email&&"editPersonalDetails"===f}),className:"hidden cursor-pointer",disabled:e.value===c.K0c.Email&&"editPersonalDetails"===f,label:q[e.value],value:e.value,onChange:e=>J(e)})},e.value)),"editPersonalDetails"!==f&&(0,l.jsx)(l.Fragment,{children:et.map(e=>(0,l.jsx)("span",{className:"w-fit cursor-pointer",children:(0,l.jsx)(n.W,{checked:!!(null==ee?void 0:ee.find(a=>a===e.value)),variant:"customer-panel",labelClassName:(0,d.cn)('select-none before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:mr-2 before:border before:border-ar-culinista-black before:p-[3px] before:bg-clip-content',{"opacity-70 before:border-opacity-40":!(null==ee?void 0:ee.find(a=>a===e.value)),"before:bg-ar-culinista-black":null==ee?void 0:ee.find(a=>a===e.value)}),className:"hidden cursor-pointer",label:L[e.value],value:e.value,onChange:e=>ea(e)})},e.value))})]})]})]}),S&&(0,l.jsx)("div",{className:"pt-7",children:S.map(e=>(0,l.jsx)("p",{className:"py-2 text-ar-red",children:e.Message},e.Property))})]})})})}function K(e){let{id:a,firstName:t,lastName:s}=e,[i,n]=(0,c.zYR)({refetchQueries:[c.vcZ]}),o=async()=>{await i({variables:{input:{additionalContactId:a}}})},d=async()=>{n.reset()};return(0,l.jsx)(h.k,{title:"Delete a Contact",modalId:r.Ti.DeleteAdditionalContact,saveButtonTextColor:m.bG.Red,saveButtonBackgroun
1dColor:m.bG.Transparent,saveButtonClassName:"helvetica-12-500 border-ar-red border",cancelButtonBackgroundColor:m.bG.Navy,cancelButtonTextColor:m.bG.White,cancelButtonClassName:"helvetica-12-500",saveButtonText:"Remove Contact",onSaveClick:o,queryState:n,afterClose:d,closeAfterSaveButtonClick:!1,margins:"sm",reverseButtons:!1,children:(0,l.jsx)(p.h,{successPrompt:"Your contact has been deleted.",queryState:n,beforeModalClose:d,displayIcon:!1,children:(0,l.jsxs)("p",{className:"helvetica-14-400 mb-52 opacity-70",children:["Remove",(0,l.jsx)("span",{className:"helvetica-14-500",children:" ".concat(t," ").concat(s," ")}),"from your contacts?",(0,l.jsx)("br",{}),(0,l.jsx)("br",{}),"".concat(t," will no longer receive communications about your services.")]})})})}function J(){let{data:e,loading:a,error:t}=(0,c.pOo)(),s=null==e?void 0:e.customer,{openedModal:n}=(0,r.S9)(),{openModal:o}=(0,r.ws)(),[d,u]=(0,i.useState)(),[m,h]=(0,i.useState)(null);function p(e){u(e),o(r.Ti.UpdatePersonalDetails)}let f=e=>{h(e),o(r.Ti.DeleteAdditionalContact)};if(a)return(0,l.jsx)("div",{className:"flex flex-1 justify-center",children:(0,l.jsx)(G.U,{size:"large"})});if(t)return(0,l.jsx)("div",{className:"flex flex-1 justify-center",children:(0,l.jsx)("p",{className:"editorial-24",children:t.message})});if(s){var v;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"helvetica-14-400 grid grid-cols-[1fr_auto_auto] gap-x-4 gap-y-6 text-ar-culinista-black lg:grid-cols-[1fr_2fr_1fr_1fr] lg:gap-y-10",children:[(0,l.jsx)("div",{children:(0,l.jsxs)("p",{className:"helvetica-14-500",children:[s.firstName," ",s.lastName]})}),(0,l.jsxs)("div",{className:"hidden lg:flex lg:flex-col",children:[(0,l.jsx)("p",{children:s.email}),(0,l.jsx)("p",{className:"mt-1",children:s.phoneNumber})]}),(0,l.jsx)("div",{children:(0,l.jsx)("p",{className:"helvetica-9-400 md:helvetica-10-400 ml-auto h-fit w-fit bg-ar-navy-light px-2 py-[3px] uppercase",children:"default"})}),(0,l.jsx)("div",{className:"-mr-2 -mt-2 flex flex-wrap justify-self-end",children:(0,l.jsx)("button",{className:"h-fit p-2",type:"button",onClick:()=>p({variant:"editPersonalDetails",id:s.id,firstName:s.firstName,lastName:s.lastName,email:s.email,phoneNumber:s.phoneNumber,pronouns:s.pronouns,dateOfBirth:s.dateOfBirth,notificationMethods:s.notificationMethods||[]}),children:(0,l.jsx)(x.k,{width:15,height:15,icon:(0,l.jsx)(b.Z,{})})})}),(0,l.jsxs)("div",{className:"col-span-3 flex flex-col lg:hidden",children:[(0,l.jsx)("p",{children:s.email}),(0,l.jsx)("p",{className:"mt-2",children:s.phoneNumber})]}),(0,l.jsxs)("div",{className:"col-span-3 mt-2 lg:col-start-2 lg:col-end-4 lg:mt-0",children:[(0,l.jsx)("p",{className:"helvetica-10-400 mb-2 uppercase tracking-wider",children:"Service Reminders"}),(0,l.jsx)("p",{children:[...s.notificationMethods?s.notificationMethods:[]].map(e=>Z[e]).join(", ")})]}),(0,l.jsx)("div",{className:"col-span-3 border-t border-ar-culinista-black border-opacity-40 lg:col-span-4"}),null===(v=s.additionalContacts)||void 0===v?void 0:v.map(e=>{let{id:a,firstName:t,lastName:s,pronouns:r,phoneNumber:n,email:o,dateOfBirth:c,serviceTypes:d,notificationMethods:u,notificationTypes:m}=e;return(0,l.jsxs)(i.Fragment,{children:[(0,l.jsx)("div",{children:(0,l.jsxs)("p",{className:"helvetica-14-500",children:[t," ",s]})}),(0,l.jsxs)("div",{className:"hidden lg:flex lg:flex-col",children:[(0,l.jsx)("p",{children:o}),(0,l.jsx)("p",{className:"mt-1",children:n})]}),(0,l.jsx)("div",{}),(0,l.jsxs)("div",{className:"-mr-2 -mt-2 flex flex-wrap justify-self-end",children:[(0,l.jsx)("button",{className:"h-fit p-2",type:"button",onClick:()=>p({variant:"editAdditionalContact",id:a,firstName:t,lastName:s,email:o,phoneNumber:n,dateOfBirth:c,pronouns:r,serviceTypes:d,notificationMethods:u,notificationTypes:m}),children:(0,l.jsx)(x.k,{width:15,height:15,icon:(0,l.jsx)(b.Z,{})})}),(0,l.jsx)("button",{type:"button",className:"h-fit p-2",onClick:()=>f({id:a,firstName:t,lastName:s}),children:(0,l.jsx)(x.k,{className:"cursor-pointer",size:15,icon:(0,l.jsx)(g.Z,{})})})]}),(0,l.jsxs)("div",{className:"col-span-3 flex flex-col lg:hidden",children:[(0,l.jsx)("p",{children:o}),(0,l.jsx)("p",{className:"mt-2",children:n})]}),[u,m,d].some(e=>e.length>0)&&(0,l.jsxs)("div",{className:"col-span-3 mt-2 flex flex-col flex-wrap gap-x-10 gap-y-6 sm:flex-row lg:col-start-2 lg:col-end-5 lg:mt-0 lg:gap-x-16",children:[u.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"helvetica-10-400 mb-2 uppercase tracking-wider",children:"Service Reminders"}),(0,l.jsx)("p",{children:u.map(e=>q[e]).join(", ")})]}),d.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"helvetica-10-400 mb-2 uppercase tracking-wider",children:"Services"}),(0,l.jsx)("p",{children:d.map(e=>W[e]).join(", ")})]})]}),(0,l.jsx)("div",{className:"col-span-3 border-t border-ar-culinista-black border-opacity-40 lg:col-span-4"})]},a)}),(0,l.jsx)("div",{className:"col-span-3 lg:col-span-4 lg:justify-self-end",children:(0,l.jsx)("button",{className:"helvetica-14-500",type:"button",onClick:()=>{u({variant:"addAdditionalContact",id:null,firstName:null,lastName:null,email:null,phoneNumber:null,pronouns:null,dateOfBirth:null}),o(r.Ti.UpdatePersonalDetails)},children:"Add a contact +"})})]}),n===r.Ti.UpdatePersonalDetails&&(0,l.jsx)(Q,{...d}),(0,l.jsx)(K,{...m})]})}}var X=t(57337),$=t(80250),ee=t(45537),ea=t(74297),et=t(19218),es=t(35031),el=t(14517),ei=t(85517);function er(e){let{children:a,networkError:t,isSubmitted:s,loading:i}=e;return i?(0,l.jsx)("div",{className:"relative opacity-10",children:a}):t?(0,l.jsx)("div",{className:"grid h-full w-full place-items-center gap-8 pb-20",children:(0,l.jsxs)("p",{className:"text-xl font-bold",children:[(0,l.jsx)("span",{className:"text-ar-red",children:"Error: "}),t]})}):s?(0,l.jsxs)("div",{className:"grid h-full w-full place-items-center gap-8 pb-20",children:[(0,l.jsx)(x.k,{size:92,className:(0,el.Z)((0,es.M)("text",m.bG.NavyLight)),icon:(0,l.jsx)(ei.Z,{})}),(0,l.jsx)("h2",{className:"editorial-24 md:editorial-38",children:"Your password has been updated."})]}):(0,l.jsx)(l.Fragment,{children:a})}function en(){var e;let{user:a}=(0,P.jJ)(),t=(0,i.useRef)(null),[s,n]=(0,i.useState)(null),[c,d]=(0,i.useState)(!1),[u,p]=(0,i.useState)(!1),f=a.isLoggedIn&&a.isPasswordSet,{register:v,handleSubmit:x,watch:b,formState:{errors:g},setError:j,clearErrors:y,reset:N}=(0,o.cI)(),w=b("newPassword"),C=b("repeatPassword");(0,i.useEffect)(()=>{g.repeatPassword&&w===C&&y("repeatPassword")},[w,g.repeatPassword,C,y]);let k=async e=>{if(d(!0),n(null),e.newPassword!==e.repeatPassword){j("repeatPassword",{type:"manual",message:"Passwords do not match"});return}if(f){let t=await (0,ea.OG)(a.email,e.oldPassword);if(t.error){n(new et.U(t.error).getErrorMessage()),d(!1);return}}let t=await (0,ea.BH)(e.newPassword);if("error"===t.type){n(t.data.message),d(!1);return}d(!1)},B=e=>(e.preventDefault(),!1),S=async()=>{N(),p(!1),n(null)};return(0,l.jsx)(h.k,{modalId:r.Ti.ChangePassword,title:"Change Your Password",onSaveClick:()=>{t.current.requestSubmit(),p(!0)},afterClose:S,saveButtonTextColor:m.bG.White,saveButtonBackgroun
1dColor:m.bG.Navy,saveButtonClassName:"helvetica-12-500",cancelButtonClassName:"helvetica-12-500",closeAfterSaveButtonClick:!1,queryState:{data:u,loading:c,error:s},children:(0,l.jsx)(er,{isSubmitted:u,networkError:s,loading:c,children:(0,l.jsxs)("form",{ref:t,className:"grid grid-cols-[2fr_2fr_1fr] gap-x-6 gap-y-12",onSubmit:x(k),children:[f?(0,l.jsx)("div",{className:"col-span-3",children:(0,l.jsx)(U.j,{label:"Current Password",variant:"underlined",type:"password",onPaste:B,...v("oldPassword",{required:!0})})}):null,(0,l.jsx)("div",{className:"col-span-3",children:(0,l.jsx)(U.j,{label:"New Password",variant:"underlined",type:"password",onPaste:B,...v("newPassword",{required:!0})})}),(0,l.jsx)("div",{className:"col-span-3",children:(0,l.jsx)(U.j,{label:"Re-enter New Password",variant:"underlined",onPaste:B,type:"password",error:null===(e=g.repeatPassword)||void 0===e?void 0:e.message.toString(),...v("repeatPassword",{required:!0})})}),(0,l.jsxs)("p",{className:"helvetica-14-400 col-span-3 -mt-6 mb-14 opacity-70",children:["Password requirements:",(0,l.jsx)("br",{}),"Minimum 6 characters",(0,l.jsx)("br",{}),"Must include 1 lowercase character, 1 uppercase character, number, and 1 non-alphanumeric character."]})]})})})}function eo(){let{logout:e}=(0,T.a)(),{closeModal:a}=(0,r.ws)(),[t,s]=(0,c.$ib)({}),i=async()=>{try{await t({onCompleted:async()=>{a(),await e()}})}catch(e){}},n=async()=>{s.reset()};return(0,l.jsx)(h.k,{modalId:r.Ti.DeactivateAccount,title:"Deactivate Account",saveButtonText:"Deactivate Account",saveButtonClassName:"bg-transparent text-ar-red border border-ar-red helvetica-12-500",saveButtonBackgroundColor:m.bG.Transparent,saveButtonTextColor:m.bG.Red,onSaveClick:i,cancelButtonClassName:"helvetica-12-500",cancelButtonBackgroundColor:m.bG.Navy,cancelButtonTextColor:m.bG.White,margins:"sm",reverseButtons:!1,closeAfterSaveButtonClick:!1,queryState:s,children:(0,l.jsx)(p.h,{queryState:s,successPrompt:"Your account has been deactivated. You will be logged out.",displayIcon:!1,beforeModalClose:n,children:(0,l.jsx)("p",{className:"pb-44 text-ar-culinista-black",children:(0,l.jsxs)("span",{className:"helvetica-14-400 opacity-70",children:["By deactivating your account, you are cancelling all upcoming services. If you deactivate within 48 hours of a service, you will be charged a late cancellation fee. Please review our full cancellation policy"," ",(0,l.jsx)(E(),{href:I.y.faq("Billing"),className:"underline",rel:"noopener noreferrer",target:"_blank",children:"here"}),".",(0,l.jsx)("br",{}),(0,l.jsx)("br",{}),"To pause your weekly meal prep instead, go to the Weekly Meal Prep section of your Account Dashboard.",(0,l.jsx)("br",{}),(0,l.jsx)("br",{}),"If you choose to reactivate your account, client information and account history will be restored, along with any Culinista credits that have not expired. To reactivate, email our client services team at"," ",(0,l.jsx)("a",{className:"underline",href:"mailto:[email protected]",children:"[email protected]"}),"."]})})})})}function ec(e){let{title:a}=e,{openModal:t}=(0,r.ws)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ee.f,{title:a}),(0,l.jsxs)($.e,{children:[(0,l.jsxs)(X._,{title:"Client Information",children:[(0,l.jsx)(J,{}),(0,l.jsx)(D,{})]}),(0,l.jsx)(X._,{title:"Addresses",children:(0,l.jsx)(w,{})}),(0,l.jsxs)("div",{className:"flex flex-col gap-y-10",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,l.jsx)(B.k,{variant:"text",theme:"transparent",className:" font-bold",onClick:()=>{t(r.Ti.DeactivateAccount)},children:"Deactivate Account"}),(0,l.jsx)("p",{className:"helvetica-14-400 opacity-50",children:"All services will be paused indefinitely until you choose to reactivate your account, and you will be logged out. You can reactivate by emailing [email protected]."})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,l.jsx)(B.k,{variant:"text",theme:"transparent",className:" font-bold",onClick:()=>{t(r.Ti.DeleteAccount)},children:"Delete Account (Permanent)"}),(0,l.jsx)("p",{className:"helvetica-14-400 opacity-50",children:"All services will be canceled and all client information will be permanently deleted. This action cannot be undone."})]})]})]}),(0,l.jsx)(f,{}),(0,l.jsx)(O,{}),(0,l.jsx)(eo,{}),(0,l.jsx)(en,{})]})}ec.Layout=_.X;var ed=!0,eu=ec}},function(e){e.O(0,[7249,2888,9774,179],function(){return e(e.s=5152)}),_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.