PageSourceSearch

https://www.theculinistas.com/_next/static/chunks/pages/customer/services/[[...slug]]-3a447c40ebcd2ed9.js

js theculinistas.com collected 2026-10-04 16:35:31 UTC 105,107 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4789],{21535:function(e,t,l){"use strict";var i,a=l(52983);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e}).apply(this,arguments)}t.Z=function(e){return a.createElement("svg",s({viewBox:"0 0 9 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i||(i=a.createElement("path",{d:"m.5 1 4.033 4 4.033-4",stroke:"currentColor"})))}},62291:function(e,t,l){"use strict";var i,a=l(52983);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e}).apply(this,arguments)}t.Z=function(e){return a.createElement("svg",s({viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i||(i=a.createElement("path",{d:"m9 16.012-1.088-.99C4.05 11.52 1.5 9.203 1.5 6.376c0-2.317 1.815-4.125 4.125-4.125A4.51 4.51 0 0 1 9 3.81a4.51 4.51 0 0 1 3.375-1.56c2.31 0 4.125 1.808 4.125 4.125 0 2.828-2.55 5.145-6.412 8.648L9 16.012Z",fill:"currentColor"})))}},60805:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/customer/services/[[...slug]]",function(){return l(96278)}])},1571:function(e,t,l){"use strict";l.d(t,{k:function(){return r}});var i=l(97458),a=l(52983),s=l(55462),n=l(89044);let r=(0,a.forwardRef)((e,t)=>{let{children:l,className:a,disabled:r,loading:o,type:d="button",variant:c="primary",theme:u="black",...v}=e;return(0,i.jsxs)("button",{ref:t,type:d,disabled:r||o,className:(0,s.cn)("helvetica-16-400 flex w-fit justify-center gap-x-2",{"bg-opacity-50":r||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"===c},a),...v,children:[l," ",o&&(0,i.jsx)(n.U,{size:"small"})]})})},50570:function(e,t,l){"use strict";l.d(t,{o:function(){return n}});var i=l(97458),a=l(52983),s=l(14517);let n=(0,a.forwardRef)((e,t)=>{let{className:l,lighterOnMobiles:a=!1}=e;return(0,i.jsx)("hr",{ref:t,className:(0,s.Z)("border-t border-ar-culinista-black/40",l,{"border-ar-culinista-black/20 md:border-ar-culinista-black/40":a,"border-ar-culinista-black/40":!a})})})},89044:function(e,t,l){"use strict";l.d(t,{U:function(){return s}});var i=l(97458);l(52983);var a=l(55462);function s(e){let{className:t,size:l="medium",customSize:s=""}=e;return(0,i.jsxs)("div",{className:(0,a.cn)("relative",t,{"h-4 w-4":"small"===l,"h-6 w-6":"medium"===l,"h-8 w-8":"large"===l},s),children:[(0,i.jsx)("div",{className:"absolute left-0 top-0 h-full w-full animate-spin rounded-full border-2 border-gray-200"}),(0,i.jsx)("div",{className:"h-full w-full animate-spin rounded-full border-2 border-ar-culinista-black border-t-transparent",role:"status"}),(0,i.jsx)("span",{className:"invisible",children:"Loading..."})]})}},2241:function(e,t,l){"use strict";l.d(t,{X:function(){return y}});var i=l(97458),a=l(52983),s=l(78906),n=l(15783),r=l(88786),o=l(92156),d=l(43359),c=l(14517),u=l(49122),v=l(71977),m=l(31165),h=l(10059),p=l(15913),x=l(39957);function b(e){let{className:t,messages:l}=e;return(0,i.jsxs)("div",{className:(0,c.Z)("flex items-center bg-ar-red bg-opacity-10 px-8 py-2.5 text-ar-red",t,{"gap-2":1===l.length,"gap-4":l.length>1}),children:[(0,i.jsx)(x.k,{icon:(0,i.jsx)(p.Z,{}),size:16}),(0,i.jsx)("p",{className:"helvetica-14-400 flex-1",children:1===l.length?l:(0,i.jsx)("ul",{className:"flex list-inside list-disc flex-col gap-0.5",children:l.map(e=>(0,i.jsx)("li",{children:e},e))})})]})}let f=new Date;function y(e){let{children:t}=e,l=(0,d.a)(890),p=(0,m.Q)(),[x,y]=(0,a.useState)({payment:void 0,mealPrep:void 0});(0,u.N66)({fetchPolicy:"network-only",variables:{input:{serviceType:u.UW4.MealPrep,serviceDateLessThan:new Date(new Date(f).setMonth(new Date(f).getMonth()+3)),serviceDateGreaterThan:new Date(f)}},onCompleted:async e=>{let{serviceList:t}=e;if(t.items.length>0){let e=t.items.sort((e,t)=>(0,v.EM)(e.serviceDate).getTime()-(0,v.EM)(t.serviceDate).getTime()).filter(e=>"CANCELLED_ENDED"!==e.serviceStatus)[0],l=(0,v.EM)(e.serviceDate);l.setHours(parseFloat(e.startTime.split(":")[0])),l.setMinutes(parseFloat(e.startTime.split(":")[1]));let i=Math.floor((l.getTime()-f.getTime())/36e5),a={mealPrep:void 0,payment:void 0};if(i<72&&0===e.dishes.length&&(a.mealPrep="Important: Select your dishes at least 24 hours prior to your service time to avoid service cancellation and fee."),i<72){let{data:e}=await p.query({query:u.KDL,fetchPolicy:"network-only"});0===e.paymentMethods.items.length?a.payment="Add a valid payment method at least 48 hours prior to your service time to avoid service cancellation.":y(e=>({...e,payment:void 0}))}y(e=>({...e,...a}))}else y(e=>({...e,mealPrep:void 0}))}});let g=!!x.payment||!!x.mealPrep,j=Object.values(x).filter(e=>!!e);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex min-h-screen flex-col",children:[(0,i.jsx)(r.W,{className:"border-b border-ar-culinista-black border-opacity-40",backgroundColor:n.bG.BeigeLight,textColor:n.bG.CulinistaBlack,keepColorThemeOnScroll:!0,mobileCta:{label:"Book a service",href:o.y.bookingService(),backgroundColor:n.bG.Navy,textColor:n.bG.NavyLight},hideLoginLinkOnMobile:!0}),(0,i.jsx)("div",{className:"flex flex-grow bg-ar-beige-light text-ar-culinista-black ",children:(0,i.jsxs)("div",{className:"mx-auto flex max-w-[1750px] flex-grow",children:[!l&&(0,i.jsx)(h.U,{}),(0,i.jsxs)("main",{className:"max-w-full flex-1",children:[!!g&&(0,i.jsx)("div",{className:"px-[30px] pt-16 md:px-[118px]",children:(0,i.jsx)(b,{messages:j})}
1),(0,i.jsx)("div",{className:(0,c.Z)({"pt-16":!g,"pt-8":!!g}),children:t})]})]})})]}),(0,i.jsx)(s.a,{backgroundColor:n.bG.CulinistaBlack,textAndBorderColor:n.bG.NavyLight})]})}},80250:function(e,t,l){"use strict";l.d(t,{e:function(){return s}});var i=l(97458);l(52983);var a=l(14517);function s(e){let{className:t,children:l}=e;return(0,i.jsx)("div",{className:(0,a.Z)("px-[30px] pb-40 md:px-[118px]",t),children:l})}},45537:function(e,t,l){"use strict";l.d(t,{f:function(){return r}});var i=l(97458);l(52983);var a=l(37249),s=l(90015),n=l(74870);function r(e){let{title:t,description:l,images:r}=e,{siteName:o,siteDescription:d}=(0,s.K)(),c={description:l||d,images:r||n.nI.images,url:n.nI.url,siteName:o,ogTitle:"".concat(n.nI.siteName," | ").concat(t||n.nI.title)},u=Array.isArray(c.images)?c.images.filter(e=>!!e&&"object"==typeof e&&"string"==typeof e.url&&!!e.url).map(e=>({url:e.url,alt:e.alt||c.description||n.nI.description})):[];return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(a.PB,{title:t,titleTemplate:"%s | ".concat(c.siteName),defaultTitle:"".concat(n.nI.title," | ").concat(c.siteName),description:c.description,openGraph:{url:c.url,title:c.ogTitle,description:c.description,images:u.length?u:void 0,siteName:n.nI.siteName,locale:"en_US"}})})}},35871:function(e,t,l){"use strict";l.d(t,{w:function(){return a}});var i=l(49122);function a(e){switch(e){case 2:return i.YtR.Small;case 4:default:return i.YtR.Medium;case 6:return i.YtR.Large}}},96278:function(e,t,l){"use strict";l.r(t),l.d(t,{__N_SSP:function(){return tG},default:function(){return tF}});var i,a,s,n,r,o,d,c,u=l(97458),v=l(2241),m=l(52983),h=l(42424),p=l.n(h),x=l(39957),b=l(45606),f=l(81286),y=l(43359),g=l(70967),j=l(48095),w=l(9703),C=l(80250),k=l(49588),N=l(15783),S=l(49122),T=l(52682),D=l(71977);let M=new Date,I=(e,t)=>{if(!e||!t)return!1;let l=(0,D.EM)(e),i=l.getFullYear(),a=l.getMonth(),s=l.getDate(),[n,r]=t.split(":").map(Number),o=(new Date(i,a,s,n,r).getTime()-M.getTime())/36e5;return o<0?168+o:o};var R=l(92156),P=l(59328),E=l(76241);function Z(e){let{id:t,date:l,serviceType:i,primaryColor:a,peopleCount:s,arrivalTime:n,startTime:r,address:o}=e,{clearServiceToCancel:d,openModal:c,setServiceToEdit:v,closeModal:m}=(0,k.ws)(),[h,x]=(0,S.MEk)({refetchQueries:[S.V1Z,S.toe]}),[b,f]=(0,S.RB2)({refetchQueries:[S.GGp,S.toe]}),y=i===S.UW4.MealPrep?f:x,g=async()=>{i===S.UW4.MealPrep?await b({variables:{input:{seriesId:t,weeklyRepeatEndDate:(0,T.Z)(new Date().setDate(new Date().getDate()+1),"yyyy-MM-dd")}}}):await h({variables:{input:{cancellationType:S.AQX.CancelledClient,serviceId:t}}})},j=async()=>{d(),y.reset()},w="";switch(i){case S.UW4.Gathering:w="Are you sure you want to cancel your ".concat((0,T.Z)(new Date(l),"MMMM d"),"th gathering?");break;case S.UW4.MealPrep:w="Are you sure you want to cancel your weakly meal prep?";break;default:w="Are you sure you want to cancel your service?"}return(0,u.jsx)(P.k,{modalId:k.Ti.CancelService,title:"Cancel Service",onSaveClickRaw:g,afterClose:j,saveButtonTextColor:(null==y?void 0:y.data)?N.bG.White:N.bG.Red,saveButtonBackgroundColor:(null==y?void 0:y.data)?a:N.bG.Transparent,saveButtonText:"Cancel Service",saveButtonClassName:"helvetica-12-500 border border-ar-red",cancelButtonTextColor:N.bG.White,cancelButtonBackgroundColor:a,cancelButtonText:"Back",cancelButtonClassName:"helvetica-12-500",margins:"sm",reverseButtons:!1,queryState:y,children:(0,u.jsx)(E.h,{queryState:y,successPrompt:"Your Service has been cancelled",displayIcon:!1,beforeModalClose:j,children:(0,u.jsx)("div",{className:"helvetica-14-400 mb-44 opacity-70",children:(0,u.jsx)("p",{children:+I(l,r)>48?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{children:w}),i===S.UW4.MealPrep?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("br",{}),(0,u.jsx)("br",{}),(0,u.jsx)("span",{children:" You can skip services or pause your meal prep instead."})]}):(0,u.jsxs)("span",{children:[" ","You can also edit your service anytime prior to 48 hours before your service"," ",(0,u.jsx)("button",{type:"button",onClick:()=>{d(),m(),c(k.Ti.EditSettings),v({serviceId:t,peopleCount:s,serviceDate:l,arrivalTime:n,startTime:r,address:o})},children:"here"}),"."]})]}):(0,u.jsxs)(u.Fragment,{children:["Are you sure you want to cancel your service? Since your service is occurring in the next 48 hours you will still be billed. Read our full billing policy ",(0,u.jsx)(p(),{href:R.y.faqBilling(),children:"here"}),"."]})})})})})}var B=l(45537),U=l(14517),q=l(6722);function A(){return(A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e}).apply(this,arguments)}var O=function(e){return m.createElement("svg",A({viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=m.createElement("path",{d:"M2 16c-.55 0-1.021-.196-1.413-.588A1.922 1.922 0 0 1 0 14v-3h2v3h12v-3h2v3c0 .55-.196 1.021-.588 1.413A1.922 1.922 0 0 1 14 16H2Zm6-4L3 7l1.4-1.45L7 8.15V0h2v8.15l2.6-2.6L13 7l-5 5Z",fill:"#22292F"})))},W=l(60728),G=l(1137),F=l(78778);function J(e){let{children:t,title:l,className:i,initialOpened:a=!1}=e,[s,n]=(0,m.useState)(a);return(0,u.jsxs)("div",{className:(0,U.Z)(i,"border-t border-ar-culinista-black border-opacity-40"),children:[(0,u.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between gap-5 py-5 md:py-6",onClick:()=>n(!s),children:[(0,u.jsx)("p",{className:"editorial-24 md:editorial-28",children:l}
1),(0,u.jsx)("span",{className:"editorial-20",children:s?"-":"+"})]}),(0,u.jsx)(G.M,{initial:!1,children:s&&(0,u.jsx)(F.E.div,{initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{height:"auto"},collapsed:{height:0}},transition:{duration:.3},children:(0,u.jsx)(F.E.div,{initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,visibility:"visible"},collapsed:{opacity:0,visibility:"hidden"}},transition:{duration:.3,delay:.1},className:(0,U.Z)("pb-8"),children:t})})})]})}function L(e){let{data:t,title:l,withBorderBottom:i=!1,description:a,richTextDescription:s,initialOpened:n=!1,stripeInvoicePdfUrl:r=""}=e;return(0,u.jsx)(J,{title:l,className:(0,U.Z)(i&&"border-b"),initialOpened:n,children:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("ul",{children:null==t?void 0:t.map((e,t)=>(0,u.jsx)("li",{className:(0,U.Z)({"helvetica-14-400 list-inside list-disc pt-6":!e.value,"flex w-full items-center justify-between gap-10 border-b border-ar-culinista-black border-opacity-10 pt-6 pb-4":e.value,"last:border-b-0":!s&&!a}),children:e.value?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("p",{className:"helvetica-14-400 capitalize opacity-70",children:e.label}),(0,u.jsx)("p",{className:"helvetica-14-500 max-w-[188px] text-right",children:e.value})]}):e.label},t))}),a&&(0,u.jsx)("p",{className:"helvetica-14-400 mt-6",children:a}),s&&(0,u.jsx)(q.i,{className:(0,U.Z)("helvetica-14-400 [&>p>a>span]:helvetica-14-500 mt-6 [&>p>a>span]:underline-offset-4"),value:s}),r&&(0,u.jsxs)(p(),{href:r,className:"helvetica-12-500 mt-2 flex w-full items-center justify-end gap-4",children:[(0,u.jsx)("p",{children:"Download Invoice"}),(0,u.jsx)(W.k,{icon:(0,u.jsx)(O,{}),size:16})]})]})})}var z=l(13916),_=l(54100),V=l.n(_),H=l(31759),Y=l(62291),Q=l(89044);function X(e){let{data:t,isServiceActive:l,isServiceCompleted:i}=e,{image:a,mobileImage:s,courses:n}=t,r=(0,y.a)(768),{openModal:o,setDishToCustomize:d}=(0,k.ws)(),[c,v]=(0,m.useState)(null),[h]=(0,S.mqZ)({refetchQueries:[S.VO6]}),[p]=(0,S.rEU)({refetchQueries:[S.VO6]}),{data:x}=(0,S.q00)({fetchPolicy:"network-only",skip:!i,onCompleted:()=>{v(null)}}),b=(0,m.useMemo)(()=>{var e,t;return(null==x?void 0:null===(t=x.customer)||void 0===t?void 0:null===(e=t.favoriteDishes)||void 0===e?void 0:e.map(e=>e.dishId))||[]},[x]),f=e=>{d({id:e.id,title:e.title,ingredients:e.ingredients,diets:e.diets,customInstructions:e.customInstructions,dishId:e.dishId}),o(k.Ti.CustomizeDish)},g=async(e,t)=>{v(e),await h({variables:{input:{dishId:e,dishTitle:t}}})},j=async e=>{v(e),await p({variables:{input:{dishId:e}}})};return(0,u.jsxs)("div",{className:"border border-ar-culinista-black border-opacity-40 p-2 md:px-4 md:pb-7 md:pt-4",children:[(null==a?void 0:a.url)&&(0,u.jsx)(V(),{src:r&&s.url?s.url:a.url,alt:r&&s.alt?s.alt:a.alt,width:r&&s.metadata.width?s.metadata.width:a.metadata.width,height:r&&s.metadata.height?s.metadata.height:a.metadata.height,blurDataURL:r&&s.metadata.lqip?s.metadata.lqip:a.metadata.lqip,placeholder:"blur",className:"aspect-[299/165] self-center object-cover object-center md:aspect-[438/314]"}),n&&n.length>0&&n.map(e=>(0,u.jsx)(m.Fragment,{children:e.dishes&&e.dishes.length>0&&(0,u.jsxs)("section",{className:"mx-1 border-t border-ar-culinista-black border-opacity-40 pt-8 first:border-t-0 md:mx-4",children:[(0,u.jsx)("h2",{className:"helvetica-10-400 mb-6 uppercase md:mb-8",children:e.title}),(0,u.jsx)("div",{className:"mb-8 flex flex-col gap-10 md:gap-14",children:e.dishes.map(e=>(0,u.jsxs)("div",{className:"relative",children:[(0,u.jsx)("h3",{className:(0,U.Z)("editorial-18 md:editorial-22",{"pr-4":i}),children:e.title}),(0,u.jsx)("p",{className:"garamond-12 md:garamond-16 mt-1 md:mt-2",children:e.ingredients}),e.customInstructions&&(0,u.jsx)("p",{className:"helvetica-12-400 mt-1 opacity-40 ",children:e.customInstructions}),l&&(0,u.jsx)("button",{type:"button",className:"helvetica-12-500 mt-3 md:mt-5",onClick:()=>f(e),children:"Customize"}),i&&(0,u.jsx)(u.Fragment,{children:c===e.id?(0,u.jsx)(Q.U,{className:"absolute right-0 top-0 p-1",size:"small"}):(0,u.jsx)("button",{type:"button",title:"Add to favorites",className:"absolute -right-1 top-0 p-1",onClick:()=>b.includes(e.id)?j(e.id):g(e.id,e.title),children:(0,u.jsx)(W.k,{icon:b.includes(e.id)?(0,u.jsx)(Y.Z,{}):(0,u.jsx)(H.Z,{}),size:14})})})]},e.id))})]})},e.id))]})}var $=l(6241),K=l(1530),ee=l(98680),et=l(98024),el=l(83679),ei=l(85494),ea=l(99068),es=l(57399),en=l(77693),er=l(84922),eo=l(84918),ed=l(878),ec=l(19563),eu=l(78857),ev=l(77245);let em=(0,ea.Ry)().shape({date:(0,ea.hT)().nullable().transform((e,t)=>""===t?null:e).required("Date is required"),arrivalTime:(0,ea.Z_)().required("Arrival time is required"),dinnerTime:(0,ea.Z_)().required("Table time is required"),numberOfPeople:(0,ea.Rx)().required("Number of Guests is required").typeError("Number of Guests is required").min(1,"Minimum number of Guests is 1").max(200,"Maximum number of Guests is 200")});function eh(e){var t,l,i,a,s,n;let{serviceId:r,peopleCount:o,serviceDate:d,arrivalTime:c,startTime:v,address:h,primaryColor:p}=e,{handleSubmit:x,register:b,control:f,watch:y,formState:g,setValue:j,reset:w}=(0,ee.cI)({resolver:(0,es.X)(em)}),{clearServiceToEdit:C}=(0,k.ws)(),{data:M}=(0,S.J90)(),[I,R]=(0,S.Qg9)(),Z=null!==(n=null==M?void 0:null===(l=M.customer)||void 0===l?void 0:null===(t=l.addresses)||void 0===t?void 0:t.map(e=>({label:"".concat(e.streetAddress).concat(e.streetAddress2?" ".concat(e.streetAddress2):"",", ").concat(e.city,", ").concat(e.state,", ").concat(e.zipCode),value:e.id})))&&void 0!==n?n:[],B=(0,ee.qo)({control:f,name:"date",defaultValue:(0,D.p6)(d)}),q=(0,ee.qo)({control:f,name:"arrivalTime",defaultValue:(0,en.Z)(new Date("".concat(d," ").concat(c)))}),A=(0,ee.qo)({control:f,name:"dinnerTime",defaultValue:(0,en.Z)(new Date("".concat(d," ").concat(v)))}),O=(0,ee.qo)({control:f,name:"address",defaultValue:null==h?void 0:h.id}),{availableDays:G,startTimesOptions:F}=(0,ev.f)({serviceType:"gatherings",date:B,zipCode:null==M?void 0:null===(s=M.customer)||void 0===s?void 0:null===(a=s.addresses)||void 0===a?void 0:null===(i=a.find(e=>e.id===(null==h?void 0:h.id)))||void 0===i?void 0:i.zipCode}),{errors:J}=g,L=async e=>{let t={serviceDate:d,arrivalTime:c,startTime:v,address:h,peopleCount:o},l={address:"address",numberOfPeople:"peopleCount",date:"serviceDate",arrivalTime:"arrivalTime",dinnerTime:"startTime"},i=Object.keys(e).reduce((i,a)=>{let s="dinnerTime"===a&&(0,T.Z)(new Date(e[a]),"HH:mm"),n="arrivalTime"===a&&(0,T.Z)(new Date(e[a]),"HH:mm"),r="date"===a&&(0,T.Z)(new Date(e[a]),"yyyy-MM-dd");switch(a){case"dinnerTime":s!==t[l[a]]&&(i[a]=s);break;case"arrivalTime":n!==t[l[a]]&&(i[a]=n);break;case"date":r!==t[l[a]]&&(i[a]=r);break;case"address":e[a]!==t[l[a]].id&&(i[a]=e[a]);break;case"numberOfPeople":e[a]!==t[l[a]]&&(i[a]=e[a])}return i},{});await I({variables:{input:{serviceId:r,addressId:i.address,peopleCount:i.numberOfPeople,serviceDate:i.date,arrivalTime:i.arrivalTime,startTime:i.dinnerTime}}})},z=async()=>{C(),w(),R.reset()};return(0,m.useEffect)(()=>{let e=document.documentElement;e.style.setProperty("--calendar-primary-color",el.COLORS[p]),e.style.setProperty("--calendar-secondary-color",el.COLORS[(0,ei._)(p)])},[p]),(0,u.jsx)(P.k,{modalId:k.Ti.EditSettings,title:"Edit Details",onSaveClickRaw:x(L),afterClose:z,saveButtonTextColor:N.bG.White,saveButtonBackgroun
1dColor:p,saveButtonText:"Request Changes",saveButtonClassName:"helvetica-12-500",cancelButtonText:"Cancel",cancelButtonClassName:"helvetica-12-500",margins:"sm",queryState:R,children:(0,u.jsx)(E.h,{queryState:R,successPrompt:"Your request has been sent.",displayIcon:!1,beforeModalClose:z,children:(0,u.jsxs)("div",{className:"helvetica-14-400 mb-20 flex flex-col",children:[(0,u.jsx)("p",{className:"mb-6 opacity-70 md:mb-10",children:'Any changes will be reviewed by our client services team and your Culinista chef before they are confirmed. We will update the status of your service to "Confirmed" once this review is complete.'}),(0,u.jsx)("h3",{className:"helvetica-14-500 mb-6",children:"Guest count"}),(0,u.jsx)("span",{className:(0,U.Z)("helvetica-10-400 relative bottom-0 mb-0.5 block",{"opacity-0":!y("numberOfPeople"),"opacity-100":y("numberOfPeople"),"text-ar-red":null==J?void 0:J.numberOfPeople}),children:"Guest count"}),(0,u.jsxs)("div",{className:(0,U.Z)("flex w-full justify-between border-b pb-2.5",{"border-ar-culinista-black":!(null==J?void 0:J.numberOfPeople),"border-ar-red":null==J?void 0:J.numberOfPeople}),children:[(0,u.jsx)("input",{...b("numberOfPeople"),className:(0,U.Z)("helvetica-14-400 form-input w-full border-none bg-transparent focus:!outline-none focus:ring-0",{"text-ar-red placeholder:text-ar-red":null==J?void 0:J.numberOfPeople,"text-ar-culinista-black placeholder:text-ar-culinista-black":!(null==J?void 0:J.numberOfPeople)}),type:"number",placeholder:"Guest count",defaultValue:o}),(0,u.jsxs)("div",{className:"flex items-center",children:[(0,u.jsx)("button",{type:"button",onClick:()=>{j("numberOfPeople",+y("numberOfPeople")-1)},disabled:1>=y("numberOfPeople"),className:"min-h-full w-7 px-2 disabled:opacity-40",children:(0,u.jsx)(W.k,{icon:(0,u.jsx)(ed.Z,{}),size:12})}),(0,u.jsx)("button",{type:"button",onClick:()=>{j("numberOfPeople",+y("numberOfPeople")+1)},className:"min-h-full w-5 pl-2 disabled:opacity-40",children:(0,u.jsx)(W.k,{icon:(0,u.jsx)(ec.Z,{}),size:12})})]})]}),(null==J?void 0:J.numberOfPeople)&&(0,u.jsx)(eu.P,{error:null==J?void 0:J.numberOfPeople}),(0,u.jsx)("h3",{className:"helvetica-14-500 mb-6 mt-16",children:"Details"}),(0,u.jsx)(et.f,{...b("date",{value:B}),control:f,placeholder:"Date",label:"Date",showLabel:y("date"),primaryColor:p,className:"mb-6",inputClassName:"!helvetica-14-400 placeholder:!helvetica-14-400",availableDates:G}),(0,u.jsx)(eo.h,{...b("arrivalTime",{value:q}),control:f,options:F,label:"Guest arrival time",showLabel:!!y("arrivalTime"),hoverColor:(0,ei._)(p),variant:"small",className:"mb-6 w-full",inputClassName:"placeholder:text-opacity-100 placeholder:!helvetica-14-400 !helvetica-14-400",primaryColor:N.bG.CulinistaBlack,defaultValue:(0,en.Z)(new Date("".concat(d," ").concat(c))),disabled:!B}),(0,u.jsx)(eo.h,{...b("dinnerTime",{value:A}),control:f,options:F.filter(e=>
1!(0,er.Z)(new Date(e.value),new Date(y("arrivalTime")))),label:"Table Time",showLabel:!!y("dinnerTime"),variant:"small",hoverColor:(0,ei._)(p),className:"mb-16 w-full",inputClassName:"placeholder:text-opacity-100 placeholder:!helvetica-14-400 !helvetica-14-400",primaryColor:N.bG.CulinistaBlack,defaultValue:(0,en.Z)(new Date("".concat(d," ").concat(v))),disabled:!B||!q}),(0,u.jsx)("h3",{className:"helvetica-14-500 mb-6",children:"Address"}),(0,u.jsx)(eo.h,{...b("address",{value:O}),control:f,options:Z,label:"Address",showLabel:!!y("address"),variant:"small",hoverColor:(0,ei._)(p),className:"w-full",inputClassName:"placeholder:text-opacity-100 placeholder:!helvetica-14-400 !helvetica-14-400",primaryColor:N.bG.CulinistaBlack,defaultValue:null==h?void 0:h.id})]})})})}var ep=l(90015),ex=l(35871);function eb(e){let{data:t,isServiceActive:l,peopleCount:i}=e,{sitePlaceholderImage:a}=(0,ep.K)(),s=(0,y.a)(768),{openModal:n,setDishToCustomize:r}=(0,k.ws)(),[o,d]=(0,m.useState)(null),[c]=(0,S.mqZ)({refetchQueries:[S.VO6]}),[v]=(0,S.rEU)({refetchQueries:[S.VO6]}),{data:h}=(0,S.q00)({fetchPolicy:"network-only",skip:l,onCompleted:()=>{d(null)}}),p=(0,m.useMemo)(()=>{var e,t;return(null==h?void 0:null===(t=h.customer)||void 0===t?void 0:null===(e=t.favoriteDishes)||void 0===e?void 0:e.map(e=>e.dishId))||[]},[h]),x=e=>{r({id:e.id,title:e.title,ingredients:e.ingredients,diets:e.diets,customInstructions:e.customInstructions,customServings:e.customServings,dishId:e.dishId}),n(k.Ti.CustomizeDish)},b=async(e,t)=>{d(e),await c({variables:{input:{dishId:e,dishTitle:t}}})},f=async e=>{d(e),await v({variables:{input:{dishId:e}}})},g=(e,t)=>(null==e?void 0:e.url)?(0,u.jsx)(V(),{src:s&&t.url?t.url:e.url,alt:s&&t.alt?t.alt:e.alt,width:s&&t.metadata.width?t.metadata.width:e.metadata.width,height:s&&t.metadata.height?t.metadata.height:e.metadata.height,blurDataURL:s&&t.metadata.lqip?t.metadata.lqip:e.metadata.lqip,placeholder:"blur",className:"self-start object-cover object-center"}):(0,u.jsx)(V(),{src:a.url,alt:a.alt,width:a.metadata.width,height:a.metadata.height,className:"self-center object-cover object-center"});return(0,u.jsxs)("div",{className:"border border-ar-culinista-black border-opacity-40 px-0 md:px-8",children:[s&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"mx-2 mb-8 mt-2 grid grid-cols-3 gap-2",children:null==t?void 0:t.map(e=>g(e.image,e.mobileImage))}),(0,u.jsx)("h2",{className:"helvetica-10-400 mx-4 mb-6 uppercase",children:"Dishes set"})]}),null==t?void 0:t.map(e=>(0,u.jsxs)("div",{className:"mx-4 mb-10 md:mx-0 md:mb-0 md:grid md:grid-cols-[3fr_8fr] md:gap-6 md:border-t md:border-ar-culinista-black md:border-opacity-40 md:py-8 md:first:border-t-0",children:[!s&&g(e.image),(0,u.jsxs)("div",{className:"relative flex flex-col",children:[(0,u.jsx)("h3",{className:(0,U.Z)("editorial-18 md:editorial-22",{"pr-4":!l}),children:e.title}),(0,u.jsx)("p",{className:"garamond-12 md:garamond-16 mt-2 opacity-70 md:opacity-100",children:e.ingredients}),e.customInstructions&&(0,u.jsx)("p",{className:"helvetica-12-400 mt-1 opacity-40 ",children:e.customInstructions}),e.customServings!==i&&(0,u.jsx)("p",{className:"helvetica-12-400 mt-1 opacity-40",children:w.t4.find(t=>t.value===(0,ex.w)(e.customServings)).label}),l&&(0,u.jsx)("button",{type:"button",id:e.id,className:"helvetica-12-500 mt-3 self-start md:mt-5",onClick:()=>x(e),children:"Customize"}),(0,u.jsx)(u.Fragment,{children:o===e.id?(0,u.jsx)(Q.U,{className:"absolute right-0 top-0 p-1",size:"small"}):(0,u.jsx)("button",{type:"button",title:"Add to favorites",className:"absolute -right-1 top-0 p-1",onClick:()=>p.includes(e.id)?f(e.id):b(e.id,e.title),children:(0,u.jsx)(W.k,{icon:p.includes(e.id)?(0,u.jsx)(Y.Z,{}):(0,u.jsx)(H.Z,{}),size:14})})})]})]},e.id))]})}var ef=l(10387),ey=l(10248),eg=l(35031),ej=l(81932);function ew(e){let{primaryColor:t,title:l,ingredients:i,dishId:a,customInstructions:s,customServings:n}=e,{clearDishToCustomize:r}=(0,k.ws)(),{handleSubmit:o,register:d,resetField:c,control:v,setValue:h}=(0,ee.cI)(),[p,b]=(0,S.iKT)({refetchQueries:[S.V1Z]}),f=(0,ee.qo)({control:v,name:"additionalRequest",defaultValue:s}),g=(0,ee.qo)({control:v,name:"portion",defaultValue:(0,ex.w)(n)}),j=(0,y.a)(768),C=(0,m.useMemo)(()=>f===s&&n&&n===(0,ej.c)(g),[f,s,n,g]),T=(0,ei._)(t),D=(0,eg.M)("bg",T),M=(0,eg.M)("text",t),I=!(b.loading||b.error||b.data),R=async e=>
1{await p({variables:{input:n?{dishId:a,customInstructions:null==e?void 0:e.additionalRequest,customServings:(0,ej.c)(null==e?void 0:e.portion)}:{dishId:a,customInstructions:null==e?void 0:e.additionalRequest}}})},Z=async()=>{r(),c("additionalRequest"),c("portion"),b.reset()};return(0,u.jsx)(P.k,{modalId:k.Ti.CustomizeDish,title:"Edit Settings",onSaveClickRaw:o(R),afterClose:Z,saveButtonTextColor:C?t:N.bG.White,saveButtonBackgroundColor:C?T:t,saveButtonText:"Save",saveButtonClassName:"helvetica-12-500",cancelButtonText:"Cancel",cancelButtonClassName:"helvetica-12-500",headerBackgroundColor:I&&T,hideCancelButton:j,saveButtonDisabled:C,queryState:b,children:(0,u.jsxs)(E.h,{queryState:b,successPrompt:"Your customization has been added.",displayIcon:!1,beforeModalClose:Z,children:[(0,u.jsxs)("div",{className:(0,U.Z)(M,"px-[30px] pb-8 pt-10 md:px-10 md:pb-10 md:pt-[60px]",{[D]:I}),children:[(0,u.jsx)("p",{className:"editorial-24 md:editorial-38",children:"Customize"}),(0,u.jsx)("p",{className:"editorial-24 md:editorial-38 mb-2",children:l}),(0,u.jsx)("p",{className:"mb-2.5 md:mb-4",children:i})]}),(0,u.jsxs)("div",{className:"helvetica-14-400 mb-20 flex flex-col px-[30px] pt-8 md:px-10 md:pt-12",children:[(0,u.jsx)("h3",{className:"helvetica-14-500 mb-6",children:"I want to modify this dish."}),(0,u.jsx)(ey.C,{...d("additionalRequest",{value:f}),className:"!helvetica-14-400 h-[112px] border-ar-culinista-black border-opacity-50 p-4 placeholder:text-ar-culinista-black placeholder:opacity-40 md:p-6",placeholder:"Let us know if you would like to substitute an ingredient, add an ingredient, or put an ingredient (sauce, nuts, cheese) on the side.",maxLength:1e3}),n&&(0,u.jsxs)("div",{className:"helvetica-14-500 mt-6 flex items-center justify-between gap-3",children:[(0,u.jsx)("input",{type:"hidden",...d("portion",{value:g})}),(0,u.jsx)("p",{className:"flex-1",children:"Size"}),(0,u.jsx)("button",{type:"button",title:"Minus",onClick:()=>{h("portion",w.t4[w.t4.findIndex(e=>e.value===g)-1].value)},disabled:0===w.t4.findIndex(e=>e.value===g),className:"flex h-5 w-5 items-center justify-center disabled:opacity-40",children:(0,u.jsx)(x.k,{width:10,height:2,icon:(0,u.jsx)(ed.Z,{})})}),(0,u.jsx)("span",{children:w.t4.find(e=>e.value===g).label}),(0,u.jsx)("button",{type:"button",title:"Plus",onClick:()=>{h("portion",w.t4[w.t4.findIndex(e=>e.value===g)+1].value)},disabled:w.t4.findIndex(e=>e.value===g)===w.t4.length-1,className:"flex h-5 w-5 items-center justify-center disabled:opacity-40",children:(0,u.jsx)(x.k,{width:10,height:10,icon:(0,u.jsx)(ec.Z,{})})})]})]})]})})}var eC=l(82561);function ek(e){let{id:t,date:l,primaryColor:i,startTime:a}=e,[s,n]=(0,S.MEk)(),{handleSubmit:r,register:o,reset:d}=(0,ee.cI)(),{clearServiceToSkip:c}=(0,k.ws)(),v=async e=>{var l;await s({variables:{input:{cancellationType:S.AQX.CancelledClient,serviceId:t,cancelReasoning:(null===(l=w.rN.find(t=>t.value===(null==e?void 0:e.skipReason)))||void 0===l?void 0:l.label)||null}},refetchQueries:[S.V1Z,S.toe]})},h=async()=>{c(),d(),n.reset()};return(0,u.jsx)(P.k,{modalId:k.Ti.SkipService,title:"Skip Service",onSaveClickRaw:r(v),afterClose:h,saveButtonTextColor:(null==n?void 0:n.data)?N.bG.White:N.bG.Red,saveButtonBackgroundColor:(null==n?void 0:n.data)?i:N.bG.Transparent,saveButtonText:"Skip Service",saveButtonClassName:"helvetica-12-500 border border-ar-red",cancelButtonTextColor:N.bG.White,cancelButtonBackgroundColor:i,
1cancelButtonText:"Back",cancelButtonClassName:"helvetica-12-500",margins:"sm",reverseButtons:!1,queryState:n,children:(0,u.jsx)(E.h,{queryState:n,successPrompt:"Your ".concat(l&&(0,T.Z)(new Date("".concat(l,"T00:00:00")),"MMMM d")," meal prep will be skipped."),displayIcon:!1,beforeModalClose:h,children:(0,u.jsxs)("div",{className:"helvetica-14-400 mb-20 flex flex-col gap-6 opacity-70",children:[(0,u.jsxs)("p",{children:["Are you sure you want to skip your service?",48>+I(l,a)&&(0,u.jsxs)(u.Fragment,{children:[" ","Since your service is within 48 hours, you will still be billed for this service. Read our full billing policy"," ",(0,u.jsx)(p(),{className:"underline",href:R.y.faqBilling(),children:"here"}),"."]}),(0,u.jsx)("br",{}),(0,u.jsx)("br",{}),"Let us know why you're skipping your service this week:"]}),(0,u.jsx)("ul",{className:"flex flex-col gap-6",children:w.rN.map(e=>(0,u.jsx)("li",{children:(0,m.createElement)(eC.a,{...o("skipReason"),id:e.value,key:e.value,additionalLabelClassName:"helvetica-14-400",labelClassName:"w-full",variant:"small",...e})},e.value))})]})})})}let eN=(0,ea.Ry)().shape({overallExperienceRating:(0,ea.Rx)().required("Rating is required").typeError("Rating is required").min(1,"Minimum number of Rating is 1").max(5,"Maximum number of Rating is 5"),culinistaChefRating:(0,ea.Rx)().required("Rating is required").typeError("Rating is required").min(1,"Minimum number of Rating is 1").max(5,"Maximum number of Rating is 5")});function eS(e){let{primaryColor:t,serviceId:l,feedback:i}=e,[a,s]=(0,S.MSK)({refetchQueries:[S.XaK]}),{clearServiceToReview:n}=(0,k.ws)(),{handleSubmit:r,register:o,watch:d,formState:c,setValue:v,clearErrors:m,reset:h}=(0,ee.cI)({resolver:(0,es.X)(eN)}),{errors:p}=c,x=e=>{v("overallExperienceRating",e),m("overallExperienceRating")},b=e=>{v("culinistaChefRating",e),m("culinistaChefRating")},f=async e=>{await a({variables:{input:{additionalNote:null==e?void 0:e.additionalComment,overallNote:null==e?void 0:e.overallExperienceComment,overallRating:null==e?void 0:e.overallExperienceRating,serviceId:l,staffNote:null==e?void 0:e.culinistaChefComment,staffRating:null==e?void 0:e.culinistaChefRating}}})},y=async()=>{n(),h(),s.reset()};return(0,u.jsx)(P.k,{modalId:k.Ti.Survey,title:i?"View Feedback":"Add Feedback",onSaveClickRaw:r(f),afterClose:y,saveButtonTextColor:N.bG.White,saveButtonBackgroundColor:t,saveButtonText:"Send",saveButtonClassName:"helvetica-12-500",cancelButtonText:"Cancel",cancelButtonClassName:"helvetica-12-500",hideButtons:!!i,titleVariant:"sm",queryState:s,children:(0,u.jsx)(E.h,{queryState:s,successPrompt:"Your Feedback has been sent",displayIcon:!1,beforeModalClose:y,children:(0,u.jsxs)("div",{className:(0,U.Z)("helvetica-14-400 flex flex-col",{"mb-20":!i,"mb-5":i}),children:[(0,u.jsx)("p",{className:"mb-4",children:"How would you rate your overall experience with The Culinistas?"}),i?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"flex gap-3",children:[1,2,3,4,5].map(e=>(0,u.jsx)("span",{dangerouslySetInnerHTML:{__html:e<=i.overallRating?"&#9733;":"&#9734;"}},e))}),(0,u.jsx)("p",{className:"garamond-16 md:garamond-14 mb-8 mt-4 border-b border-ar-culinista-black border-opacity-10 pb-8",children:i.overallNote||"No additional comment"})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"flex gap-3",children:[1,2,3,4,5].map(e=>(0,u.jsx)("span",{onClick:()=>x(e),className:"cursor-pointer",role:"presentation",dangerouslySetInnerHTML:{__html:e<=d("overallExperienceRating")?"&#9733;":"&#9734;"}},e))}),(null==p?void 0:p.overallExperienceRating)&&(0,u.jsx)(eu.P,{error:null==p?void 0:p.overallExperienceRating}),(0,u.jsx)(ey.C,{...o("overallExperienceComment"),className:"!helvetica-14-400 mb-12 mt-6 h-[88px] border-ar-culinista-black border-opacity-10 p-4 placeholder:text-ar-culinista-black placeholder:opacity-40 md:mb-14",placeholder:"Anything you’d like to add?",maxLength:1e3})]}),(0,u.jsx)("p",{className:"mb-4",children:"How would you rate your Culinista chef (timeliness, execution, professionalism, clean up, etc.) ?"}),i?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"flex gap-3",children:[1,2,3,4,5].map(e=>(0,u.jsx)("span",{dangerouslySetInnerHTML:{__html:e<=i.staffRating?"&#9733;":"&#9734;"}}
1,e))}),(0,u.jsx)("p",{className:"garamond-16 md:garamond-14 mb-8 mt-4 border-b border-ar-culinista-black border-opacity-10 pb-8",children:i.overallNote||"No additional comment"})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"flex gap-3",children:[1,2,3,4,5].map(e=>(0,u.jsx)("span",{onClick:()=>b(e),className:"cursor-pointer",role:"presentation",dangerouslySetInnerHTML:{__html:e<=d("culinistaChefRating")?"&#9733;":"&#9734;"}},e))}),(null==p?void 0:p.culinistaChefRating)&&(0,u.jsx)(eu.P,{error:null==p?void 0:p.culinistaChefRating}),(0,u.jsx)(ey.C,{...o("culinistaChefComment"),className:"!helvetica-14-400 mb-12 mt-6 h-[88px] border-ar-culinista-black border-opacity-10 p-4 placeholder:text-ar-culinista-black placeholder:opacity-40 md:mb-14",placeholder:"Anything you’d like to add?",maxLength:1e3})]}),(0,u.jsx)("p",{children:"Any additional feedback you’d like to share?"}),i?(0,u.jsx)("p",{className:"garamond-16 md:garamond-14 mt-4",children:i.additionalNote||"No additional comment"}):(0,u.jsx)(ey.C,{...o("additionalComment"),className:"!helvetica-14-400 mt-6 h-[88px] border-ar-culinista-black border-opacity-10 p-4 placeholder:text-ar-culinista-black placeholder:opacity-40 md:mt-4",placeholder:"Anything you’d like to add?",maxLength:1e3})]})})})}var eT=l(55462),eD=l(63730);function eM(e){let{children:t,text:l,richText:i,offsetY:a=10,variant:s="default",className:n}=e,[r,o]=(0,m.useState)(!1),d=(0,m.useRef)(null);return(0,u.jsxs)("div",{className:"relative inline-block",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[(0,u.jsx)("div",{ref:d,children:t}),d.current&&(0,eD.createPortal)((0,u.jsx)(G.M,{children:r&&(0,u.jsxs)(F.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:(0,eT.cn)(n,"helvetica-10-400 absolute left-1/2 z-50 w-[160px] -translate-x-1/2 px-3 py-5","default"===s&&"bg-white text-ar-culinista-black","error"===s&&"bg-ar-red text-ar-beige-light"),style:{marginTop:a},children:[l,i&&(0,u.jsx)(q.i,{className:"helvetica-10-400 [&>p>a>span]:helvetica-10-500 [&>p>a>span]:underline-offset-4",value:i}),(0,u.jsx)("div",{className:(0,eT.cn)("absolute left-1/2 origin-top-left rotate-45","default"===s&&"bg-white","error"===s&&"bg-ar-red"),style:{width:2*a/Math.sqrt(2),height:2*a/Math.sqrt(2),top:0,marginTop:-a}})]})}),d.current)]})}var eI=l(89125),eR=l(54283);function eP(e){let{id:t,date:l,startTime:i,primaryColor:a}=e,[s,n]=(0,S.CzK)({refetchQueries:[S.V1Z,S.toe]}),{clearServiceToUnSkip:r}=(0,k.ws)(),o=async()=>{await s({variables:{input:{serviceId:t}}})},d=async()=>{r(),n.reset()};return(0,u.jsx)(P.k,{modalId:k.Ti.UnSkipService,title:"Unskip Service",onSaveClickRaw:o,afterClose:d,saveButtonTextColor:N.bG.White,saveButtonBackgroundColor:a,saveButtonText:"Unskip Service",saveButtonClassName:"helvetica-12-500",cancelButtonText:"Cancel",cancelButtonClassName:"helvetica-12-500",margins:"sm",queryState:n,children:(0,u.jsx)(E.h,{queryState:n,successPrompt:"Your ".concat(l&&(0,T.Z)(new Date("".concat(l,"T00:00:00")),"MMMM d")," meal prep has been unskipped."),displayIcon:!1,beforeModalClose:d,children:(0,u.jsx)("div",{className:"helvetica-14-400 mb-44 opacity-70",children:(0,u.jsx)("p",{children:+I(l,i)>48?"Are you sure you want to unskip your service?":(0,u.jsxs)(u.Fragment,{children:["Since your service is within 48 hours, we cannot guarantee chef availability. Please email"," ",(0,u.jsx)(p(),{href:"mailto:[email protected]",children:"[email protected]"})," to see if we can make a last minute accommodation for your service."]})})})})})}var eE=l(77413),eZ=l(26903),eB=l(76102);let eU=["1 Large cutting board","1 blender / Food processor","1 4-QT large stock pot","Dutch Oven","1 colander","1 fine mesh strainer","1 set mixing bowls","19 x 13 baking dish","1-4 baking sheets","1 parchment paper","1 large saute pan","1 small saute pan","1 small saucepan","1 rubber spatula","1 spatula","1 fish spatula","1 tongs","1 whisk","1 can opener","1 box grater"].map(e=>({label:e,value:null})),eq={[S.UW4.Gathering]:"All gatherings",[S.UW4.MealPrep]:"All weekly meal preps",[S.UW4.CookingClass]:"All cooking classes"};function eA(e){var t,l,i,a,s,n,r,o,d;let{serviceSlug:c,serviceType:v}=e,h=(0,eE.useRouter)(),{serviceToCancel:T,serviceToEdit:M,dishToCustomize:I,serviceToSkip:P,serviceToUnSkip:E}=(0,k.S9)(),{openModal:U,setServiceToCancel:q,setServiceToEdit:A,setServiceToSkip:O,setServiceToUnSkip:W}=(0,k.ws)(),{data:G,loading:F,error:_}=(0,S.E7r)({variables:{input:{serviceId:c}}}),V=(0,m.useMemo)(()=>null==G?void 0:G.service,[G]),{data:H}=(0,S.yBE)({skip:!(null==V?void 0:V.id),variables:{input:{serviceId:null==V?void 0:V.id}}}),[Y]=(0,S.ubW)({refetchQueries:[S.HT8]}),[Q]=(0,S.ASh)({refetchQueries:[S.HT8]}),ee=(0,y.a)(768),{width:et}=(0,K.i)(),[el,ei]=(0,m.useState)(!1),{data:ea,loading:es,error:en}=(0,g.TvZ)({skip:v!==S.UW4.Gathering||!(null==V?void 0:V.menuRefId),variables:{id:null==V?void 0:V.menuRefId}}),{data:er,loading:eo,error:ed}=(0,g.TSf)({skip:v!==S.UW4.CookingClass||!(null==V?void 0:V.menuRefId),variables:{id:null==V?void 0:V.menuRefId}}),{data:ec,loading:eu,error:ev}=(0,g.bze)({skip:v!==S.UW4.MealPrep||(null==V?void 0:null===(t=V.dishes)||void 0===t?void 0:t.length)===0,variables:{ids:null==V?void 0:null===(i=V.dishes)||void 0===i?void 0:null===(l=i.filter(e=>e.dishRefId))||void 0===l?void 0:l.map(e=>e.dishRefId)}}),{data:em}=(0,S.D_9)({fetchPolicy:"network-only",skip:v!==S.UW4.Gathering,onCompleted:()=>ei(!1)}),ep=(0,m.useMemo)(()=>null==H?void 0:H.review,[null==H?void 0:H.review]),ey=(0,m.useMemo)(()=>{if(!(null==V?void 0:V.address))return"-";let{streetAddress:e,streetAddress2:t,city:l}=V.address;return"".concat(e).concat(t?" ".concat(t):"",", ").concat(l)},[V]),eg=(0,m.useMemo)(()=>{var e,t;return V?(null==V?void 0:V.serviceType)===S.UW4.MealPrep?[{label:"Date",value:(0,D.p6)(V.serviceDate)},{label:"Service Time",value:(null==V?void 0:V.startTime)===(null==V?void 0:V.endTime)?(0,D.mr)(V.startTime):"".concat((0,D.mr)(V.startTime)," - ").concat((0,D.mr)(V.endTime))},{label:"Address",value:ey||"-"},{label:"Portions",value:w.t4.find(e=>e.value===(0,ex.w)(null==V?void 0:V.peopleCount)).label},{label:"Chef",value:(null===(t=V.assignedChefs)||void 0===t?void 0:t.map(e=>"".concat(null==e?void 0:e.firstName," ").concat(null==e?void 0:e.lastName)).join(", "))||"Chef matching in progress"}]:[{label:"Date",value:(0,D.p6)(V.serviceDate)},{label:"Guests Arrival Time",value:(0,D.mr)(V.startTime)},{label:"Table Time",value:(0,D.mr)(V.startTime)},{label:"Address",value:ey||"-"},{label:"Guests",value:V.peopleCount.toString()},{label:"Chef",value:(null===(e=V.assignedChefs)||void 0===e?void 0:e.map(e=>"".concat(null==e?void 0:e.firstName," ").concat(null==e?void 0:e.lastName)).join(", "))||"Chef matching in progress"}]:[]},[ey,V]),ej=(0,eI.Y)({serviceStatus:null==V?void 0:V.serviceStatus,serviceType:null==V?void 0:V.serviceType,isDishesSelected:(null==V?void 0:null===(a=V.dishes)||void 0===a?void 0:a.length)>=6,isEditDisabled:(0,eR.s)(null==V?void 0:V.serviceType,null==V?void 0:V.serviceDate,null==V?void 0:V.startTime,v===S.UW4.MealPrep?24:void 0),isChefSelected:(null==V?void 0:null===(s=V.assignedChefs)||void 0===s?void 0:s.length)>0}),eC=(0,m.useMemo)(()=>
1{if(!V)return[];let e=new Date(V.serviceDate)>new Date;return[{label:"Service Fee",value:(0,z.T)(100*V.serviceFee)},{label:e?"Est. Groceries":"Groceries",value:(0,z.T)((e?V.estGroceryExpense:V.groceryExpense)*100)},{label:"Tip",value:(0,z.T)(100*V.tip)},{label:"Travel Reimbursement",value:(0,z.T)(100*V.travel)},{label:"Sales Tax",value:(0,z.T)(100*V.tax)},{label:"Est. Total",value:(0,z.T)((V.serviceFee+V.estGroceryExpense+V.tip+V.travel+V.tax)*100)}]},[V]),eN=(0,m.useMemo)(()=>{var e,t;return(null==em?void 0:null===(t=em.customer)||void 0===t?void 0:null===(e=t.favoriteMenus)||void 0===e?void 0:e.map(e=>e.menuId))||[]},[em]),eD=(0,m.useMemo)(()=>{var e;return(0,$.ir)((null==ea?void 0:ea.menu[0])||(null==er?void 0:null===(e=er.menu[0])||void 0===e?void 0:e.cookingClass))},[er,ea]),eA=(0,m.useMemo)(()=>{var e;return(null==V?void 0:null===(e=V.dishes)||void 0===e?void 0:e.map(e=>null==e?void 0:e.dishRefId))||[]},[V]),eO=(0,m.useMemo)(()=>{var e;let t=(null==eD?void 0:null===(e=eD.courses)||void 0===e?void 0:e.map(e=>{var t;return null==e?void 0:null===(t=e.dishes)||void 0===t?void 0:t.map(e=>e.id)}).flat())||[];return eA.filter(e=>!t.includes(e))||[]},[eD,eA]),{data:eW}=(0,g.bze)({skip:0===eO.length,variables:{ids:eO}}),eG=(0,m.useMemo)(()=>{var e,t;let l=null==V?void 0:V.dishes,i=null==eD?void 0:null===(e=eD.courses)||void 0===e?void 0:e.map(e=>{var t,i;let a=null==e?void 0:null===(i=e.dishes)||void 0===i?void 0:null===(t=i.filter(e=>eA.includes(null==e?void 0:e.id)))||void 0===t?void 0:t.map(e=>{let t=l.find(t=>t.dishRefId===(null==e?void 0:e.id));return{...e,dishId:null==t?void 0:t.id,customInstructions:null==t?void 0:t.customInstructions}});return{...e,dishes:a}});return(null==eW?void 0:null===(t=eW.dishes)||void 0===t?void 0:t.length)>0&&(null==i||i.push({id:"offMenu",title:"Off Menu Dishes",dishes:eW.dishes.map(e=>{let t=l.find(t=>t.dishRefId===(null==e?void 0:e._id));return{...(0,$.s0)(e),dishId:null==t?void 0:t.id,customInstructions:null==t?void 0:t.customInstructions}})})),i?{...eD,courses:i}:null},[eW,eD,eA,V]),eF=(0,m.useMemo)(()=>{var e,t,l;if((null==V?void 0:V.serviceType)!==S.UW4.MealPrep)return null;let i=null==V?void 0:V.dishes,a=(null==ec?void 0:null===(e=ec.dishes)||void 0===e?void 0:e.map(e=>{let t=i.find(t=>t.dishRefId===(null==e?void 0:e._id));return{...(0,$.s0)(e),dishId:null==t?void 0:t.id,customInstructions:null==t?void 0:t.customInstructions,customServings:(null==t?void 0:t.customServings)||V.peopleCount}}))||[],s=(null==V?void 0:null===(l=V.dishes)||void 0===l?void 0:null===(t=l.filter(e=>!(null==e?void 0:e.dishRefId)))||void 0===t?void 0:t.map(e=>({dishId:null==e?void 0:e.dishName,customInstructions:null==e?void 0:e.customInstructions,customServings:(null==e?void 0:e.customServings)||V.peopleCount,id:null==e?void 0:e.dishName,title:null==e?void 0:e.dishName,image:null,mobileImage:null,ingredients:"",diets:[]})))||[];return a.concat(s)},[null==ec?void 0:ec.dishes,null==V?void 0:V.dishes,null==V?void 0:V.peopleCount,null==V?void 0:V.serviceType]),eJ=(null==ea?void 0:null===(n=ea.menu)||void 0===n?void 0:n.length)>0||(null==er?void 0:null===(r=er.menu)||void 0===r?void 0:r.length)>0||(null==ec?void 0:null===(o=ec.dishes)||void 0===o?void 0:o.length)>0,eL=es||eo||eu,ez=en||ed||ev,e_=w.vL[v],eV=v?w.UH[v]:N.bG.Navy,eH=![ef.J.Complete,ef.J.Cancelled].includes(ej),eY=()=>{U(k.Ti.EditSettings),A({serviceId:null==V?void 0:V.id,peopleCount:null==V?void 0:V.peopleCount,serviceDate:null==V?void 0:V.serviceDate,arrivalTime:null==V?void 0:V.arrivalTime,startTime:null==V?void 0:V.startTime,address:null==V?void 0:V.address})},eQ=async()=>{ei(!0),await Y({variables:{input:{menuId:eG.id,menuTitle:eG.title}}})},eX=async()=>{ei(!0),await Q({variables:{input:{menuId:eG.id}}})};return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(B.f,{title:e_}),(0,u.jsxs)(C.e,{children:[(F||_)&&(0,u.jsxs)("div",{className:"flex items-center justify-center",children:[F&&(0,u.jsx)(j.U,{size:"medium"}),_&&(0,u.jsx)("div",{children:(0,eB.i)(_)||"Something went wrong."})]}),G&&!F&&!_&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("header",{className:"mb-6 flex flex-col gap-10 md:mb-8 md:gap-14",children:[(0,u.jsxs)(p(),{href:b.Z.services(null==V?void 0:V.serviceType),className:"flex items-center gap-4 self-start whitespace-nowrap",children:[(0,u.jsx)(x.k,{icon:(0,u.jsx)(f.Z,{}),size:10}),(0,u.jsx)("span",{className:"helvetica-10-400 md:helvetica-14-400",children:null!==(d=null==eq?void 0:eq[null==V?void 0:V.serviceType])&&void 0!==d?d:"Back ".concat(!ee&&"to services")})]}),(0,u.jsxs)("h2",{className:"editorial-32 md:editorial-38 flex flex-col gap-2 md:flex-row md:items-center md:gap-4",children:[(0,u.jsx)("span",{children:e_}),eG&&(0,u.jsxs)(u.Fragment,{children:[!ee&&(0,u.jsx)("div",{className:"h-8 w-px bg-ar-culinista-black opacity-40"}),(0,u.jsx)("span",{children:eG.title})]})]}),(0,u.jsx)("div",{className:"helvetica-12-500 flex gap-5 md:gap-2.5",children:eH?(0,u.jsxs)(u.Fragment,{children:[v===S.UW4.MealPrep?(0,u.jsx)("button",{type:"button",className:"order-last text-ar-red md:order-none",onClick:ej===ef.J.Skipped?()=>{U(k.Ti.UnSkipService),W({id:null==V?void 0:V.id,serviceDate:null==V?void 0:V.serviceDate,startTime:null==V?void 0:V.startTime})}:()=>{U(k.Ti.SkipService),O({id:null==V?void 0:V.id,serviceDate:null==V?void 0:V.serviceDate,startTime:null==V?void 0:V.startTime})},children:ej===ef.J.Skipped?"Unskip service":"Skip Service"}):(0,u.jsxs)(u.Fragment,{children:[(0,eR.s)(null==V?void 0:V.serviceType,null==V?void 0:V.serviceDate,null==V?void 0:V.startTime)?(0,u.jsx)(eM,{richText:w.N3.editSettingsNotAvailableNote,variant:"error",className:"!w-32 md:!w-[232px]",children:(0,u.jsx)("button",{type:"button",onClick:eY,disabled:!0,className:"disabled:opacity-40",children:"Edit Details"})}):(0,u.jsx)("button",{type:"button",onClick:eY,children:"Edit Details"}),(0,u.jsx)("button",{type:"button",className:"order-last text-ar-red md:order-none",onClick:()=>{U(k.Ti.CancelService),q({id:null==V?void 0:V.id,serviceDate:null==V?void 0:V.serviceDate,serviceType:null==V?void 0:V.serviceType,peopleCount:null==V?void 0:V.peopleCount,arrivalTime:null==V?void 0:V.arrivalTime,startTime:null==V?void 0:V.startTime,address:null==V?void 0:V.address})},children:"Cancel Service"})]}),(0,u.jsx)("div",{className:"hidden flex-1 md:block"}),(eJ||v===S.UW4.MealPrep)&&(0,u.jsx)(u.Fragment,{children:v!==S.UW4.MealPrep||(0,eR.s)(null==V?void 0:V.serviceType,null==V?void 0:V.serviceDate,null==V?void 0:V.startTime,24)?(0,u.jsx)(eM,{richText:w.N3.editNotAvailableNote,variant:"error",className:"!w-[232px]",children:(0,u.jsx)("button",{type:"button",disabled:!0,className:"disabled:opacity-40",children:v===S.UW4.MealPrep?"Edit Dishes":"Edit Menu"})}):(0,u.jsx)("button",{type:"button",onClick:()=>{h.push(R.y.bookingOrder({step:"1",service:(0,eZ.u)(S.UW4.MealPrep),orderId:null==V?void 0:V.id}))},children:(null==eF?void 0:eF.length)>0?"Edit Dishes":"Select Dishes"})})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{type:"button",onClick:()=>{h.push(R.y.bookingOrder({step:"1",service:(0,eZ.u)(v),reorderId:null==V?void 0:V.id,zipCode:null==V?void 0:V.address.zipCode}))},disabled:null==eG?void 0:eG.isArchive,className:"disabled:opacity-40",children:v===S.UW4.MealPrep?"Re-order dishes":"Rebook service"}),ej===ef.J.Complete&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{type:"button",onClick:()=>{U(k.Ti.Survey)},children:ep?"View feedback":"Add feedback"}),!ee&&v===S.UW4.Gathering&&!!eJ&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"block flex-1"}),el?(0,u.jsx)(j.U,{size:"small"}):(0,u.jsx)("button",{type:"button",onClick:eN.includes(null==eG?void 0:eG.id)?eX:eQ,className:eN.includes(null==eG?void 0:eG.id)?"text-ar-red":void 0,children:eN.includes(null==eG?void 0:eG.id)?"Remove menu from favorites":"Add menu to favorites"})]})]})]})})]}),(0,u.jsxs)("div",{className:"xl:grid xl:grid-cols-[3fr_4fr] xl:gap-x-28",children:[(0,u.jsxs)("div",{children:[(0,u.jsx)(L,{data:eg,title:"Service Details",description:[S.UW4.Gathering,S.UW4.CookingClass].includes(v)&&w.N3.serviceDetailsDescription,initialOpened:eH}),et<1240&&(0,u.jsxs)(J,{title:"Menu",children:[(eL||ez)&&(0,u.jsxs)(u.Fragment,{children:[eL&&(0,u.jsx)(j.U,{size:"medium"}),ez&&(0,u.jsx)("div",{children:(0,eB.i)(ez)})]}),!eJ&&!eL&&!ez&&(0,u.jsx)("div",{children:v===S.UW4.MealPrep?"No Dishes":"No Menu"}),eJ&&(0,u.jsxs)("div",{className:"pt-6",children:[eG&&(0,u.jsxs)(u.Fragment,{children:[ee&&!!eJ&&v===S.UW4.Gathering&&ej===ef.J.Complete&&(0,u.jsx)(u.Fragment,{children:el?(0,u.jsx)(j.U,{size:"small",className:"mb-4"}):(0,u.jsx)("button",{type:"button",onClick:eN.includes(eG.id)?eX:eQ,className:(0,eT.cn)("helvetica-12-500 mb-4",{"text-ar-red":eN.includes(eG.id)}),children:eN.includes(eG.id)?"Remove menu from favorites":"Add menu to favorites"})}),(0,u.jsx)(X,{data:eG,isServiceActive:eH,isServiceCompleted:ej===ef.J.Complete})]}),eF&&(0,u.jsx)(eb,{data:eF,isServiceActive:eH,peopleCount:null==V?void 0:V.peopleCount})]})]}),(0,u.jsx)(L,{data:eU,title:"Required Equipment",richTextDescription:w.N3.requiredEquipmentDescription}),(0,u.jsx)(L,{data:eC,title:"Payment Estimate",withBorderBottom:!0,description:eH&&w.N3.serviceChargeDescription,initialOpened:ej===ef.J.Complete,stripeInvoicePdfUrl:(null==V?void 0:V.stripeInvoicePdfUrl)||""})]}),et>=1240&&(0,u.jsxs)(u.Fragment,{children:[(eL||ez)&&(0,u.jsxs)(u.Fragment,{children:[eL&&(0,u.jsx)(j.U,{size:"medium",className:"ml-auto"}),ez&&(0,u.jsx)("div",{className:"ml-auto",children:(0,eB.i)(ez)})]}),!eJ&&!eL&&!ez&&(0,u.jsx)("div",{className:"ml-auto",children:v===S.UW4.MealPrep?"No Dishes":"No Menu"}),eG&&(0,u.jsx)(X,{data:eG,isServiceActive:eH,isServiceCompleted:ej===ef.J.Complete}),eF&&(0,u.jsx)(eb,{data:eF,isServiceActive:!(0,eR.s)(null==V?void 0:V.serviceType,null==V?void 0:V.serviceDate,null==V?void 0:V.startTime),peopleCount:null==V?void 0:V.peopleCount})]})]})]})]}),(0,u.jsx)(Z,{id:null==T?void 0:T.id,date:null==T?void 0:T.serviceDate,serviceType:null==T?void 0:T.serviceType,peopleCount:null==T?void 0:T.peopleCount,arrivalTime:null==T?void 0:T.arr
1ivalTime,startTime:null==T?void 0:T.startTime,address:null==T?void 0:T.address,primaryColor:eV}),(null==M?void 0:M.serviceId)&&(0,u.jsx)(eh,{serviceId:null==M?void 0:M.serviceId,peopleCount:null==M?void 0:M.peopleCount,serviceDate:null==M?void 0:M.serviceDate,arrivalTime:null==M?void 0:M.arrivalTime,startTime:null==M?void 0:M.startTime,address:null==M?void 0:M.address,primaryColor:eV}),(null==I?void 0:I.dishId)&&(0,u.jsx)(ew,{primaryColor:eV,id:null==I?void 0:I.id,title:null==I?void 0:I.title,ingredients:null==I?void 0:I.ingredients,diets:null==I?void 0:I.diets,dishId:null==I?void 0:I.dishId,customInstructions:null==I?void 0:I.customInstructions,customServings:null==I?void 0:I.customServings}),(0,u.jsx)(ek,{id:null==P?void 0:P.id,date:null==P?void 0:P.serviceDate,startTime:null==P?void 0:P.startTime,primaryColor:eV}),(0,u.jsx)(eP,{id:null==E?void 0:E.id,date:null==E?void 0:E.serviceDate,startTime:null==E?void 0:E.startTime,primaryColor:eV}),(0,u.jsx)(eS,{primaryColor:eV,serviceId:null==V?void 0:V.id,feedback:ep})]})}var eO=l(21535);function eW(){return(eW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e}).apply(this,arguments)}var eG=function(e){return m.createElement("svg",eW({width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=m.createElement("path",{d:"M12 9a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM7.5 9a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM3 9a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z",fill:"#22292F"})))},eF=l(27623);function eJ(e){let{className:t,icon:l,buttonTitle:i,children:a}=e,s=(0,m.useRef)(),[n,r]=(0,m.useState)(!1);return(0,eF.t)(s,()=>r(!1)),(0,m.useEffect)(()=>{let e=e=>{"Escape"===e.key&&r(!1)};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[]),(0,u.jsx)("div",{className:t,children:(0,u.jsxs)("div",{className:"relative",ref:s,children:[(0,u.jsx)("button",{type:"button",title:i,onClick:()=>{r(e=>!e)},className:"flex h-6 w-6 items-center justify-center",children:l}),(0,u.jsx)(G.M,{children:n&&(0,u.jsx)(F.E.div,{initial:"closed",animate:"open",exit:"closed",transition:{duration:.3},variants:{closed:{opacity:0},open:{opacity:1}},className:"absolute right-0 top-5 z-20",children:(0,u.jsx)("ul",{className:"helvetica-12-500 w-[200px] border border-ar-culinista-black border-opacity-40 bg-ar-beige-light text-left",children:a})},"actions")})]})})}function eL(e){let{className:t,children:l}=e;return(0,u.jsx)("li",{className:(0,eT.cn)("border-b border-ar-culinista-black/20 last:border-0",t),children:l})}var ez=l(50570);let e_=(0,F.E)(ez.o);function eV(e){let{text:t}=e;return t?"string"==typeof t?(0,u.jsx)("span",{className:"truncate",children:t}):(0,u.jsx)("div",{className:"truncate",children:t.filter(e=>e).map((e,l)=>(0,u.jsxs)("span",{children:[l+1===t.length&&(0,u.jsx)("div",{className:"mx-2.5 inline-block h-5 w-[1px] bg-ar-culinista-black/40"}),e]},e))}):null}let eH=Object.assign(function(e){let{color:t,when:l,title:i,expandable:a,expandedByDefault:s=!1,rightAdornment:n,content:r,details:o,actions:d,disabled:c=!1,href:v,onMouseEnter:h}=e,[p,x]=(0,m.useState)(s),b=(0,y.a)(1240),f=(0,m.useRef)(h);return(0,m.useEffect)(()=>{if(s){var e;null===(e=f.current)||void 0===e||e.call(f)}},[s]),(0,u.jsx)("div",{className:"border border-ar-culinista-black/40",onMouseEnter:c?void 0:h,children:(0,u.jsxs)("div",{className:"flex",children:[(0,u.jsx)("div",{className:(0,eT.cn)("flex-shrink-0",c?"w-[11px]":"my-[-1px] ml-[-1px] w-3",c?"bg-ar-culinista-black/40":(0,eg.M)("bg",t))}),(0,u.jsxs)("div",{className:"flex-grow",children:[(0,u.jsxs)("div",{className:"flex items-center justify-between p-2 sm:p-4 xl:p-8",children:[(0,u.jsx)(c?"div":"a",{href:v,className:(0,eT.cn)("editorial-16 sm:editorial-18 xl:editorial-24 flex gap-x-2 truncate xl:gap-x-10",c&&"text-ar-culinista-black/40"),children:b&&"string"!=typeof i?(0,u.jsxs)("div",{children:[(0,u.jsxs)("div",{className:"mb-1.5 flex gap-x-2",children:[(0,u.jsx)("span",{className:"text-ar-culinista-black",children:l}),(0,u.jsx)(eV,{text:null==i?void 0:i[0]})]}),(0,u.jsx)(eV,{text:null==i?void 0:i[1]})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{className:"text-ar-culinista-black",children:l}),(0,u.jsx)(eV,{text:i})]})}),(0,u.jsxs)("div",{className:"flex items-center gap-x-4",children:[n&&n,a&&!c&&(0,u.jsx)("button",{type:"button",onClick:()=>x(e=>!e),className:"-mr-2 flex h-6 w-6 items-center justify-center",children:(0,u.jsx)(F.E.div,{animate:{rotate:p?180:0}
1,transition:{duration:.3},children:(0,u.jsx)(W.k,{size:8,icon:(0,u.jsx)(eO.Z,{})})})})]})]}),(0,u.jsx)(G.M,{initial:!s,children:p&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(e_,{initial:"collapsed",animate:"expanded",exit:"collapsed",transition:{duration:.2},variants:{expanded:{opacity:1},collapsed:{opacity:0}},className:"mx-4 xl:mx-8"},"expanded-content-divider"),(0,u.jsx)(F.E.div,{initial:"collapsed",animate:"expanded",exit:"collapsed",transition:{duration:.3,ease:"linear"},variants:{expanded:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},className:"overflow-hidden",children:r},"expanded-content")]})}),(0,u.jsx)(ez.o,{className:"mx-4 xl:mx-8"}),(0,u.jsxs)("div",{className:"relative flex justify-between px-4 py-4 xl:px-8",children:[(0,u.jsxs)("div",{className:"flex items-center gap-x-14",children:[(0,u.jsx)("span",{className:"helvetica-10-400 hidden uppercase xl:inline",children:"Details"}),(0,u.jsx)("div",{className:"flex flex-col gap-x-5 gap-y-2 xl:flex-row",children:o})]}),(0,u.jsx)("ul",{className:"hidden gap-x-2.5 xl:flex",children:d.map((e,t)=>(0,u.jsx)("li",{children:e},t))}),(0,u.jsx)(eJ,{className:"absolute bottom-2 right-3 xl:hidden",icon:(0,u.jsx)(W.k,{icon:(0,u.jsx)(eG,{}),width:18,height:18}),children:d.map((e,t)=>(0,u.jsx)(eL,{children:e},t))})]})]})]})})},{Title:eV,Tag:function(e){let{label:t,value:l,labelClassName:i,valueClassName:a}=e;return(0,u.jsxs)("div",{className:"flex gap-x-1 truncate",children:[(0,u.jsx)("span",{className:(0,eT.cn)("helvetica-12-400 text-ar-culinista-black text-opacity-50 xl:text-opacity-70",i),children:t}),(0,u.jsx)("span",{className:(0,eT.cn)("helvetica-12-500 inline-flex",a),children:l})]})},ActionButton:function(e){let{as:t,text:l,color:i=N.bG.CulinistaBlack,disabled:a,...s}=e,n=t||"button";return(0,u.jsx)(n,{type:"button"===n?"button":void 0,className:(0,eT.cn)("helvetica-12-500 inline-block w-full p-4 text-left xl:p-0",(0,eg.M)("text",i),a&&"text-opacity-40"),disabled:a,...s,children:l})},Content:function(e){let{error:t,loading:l,sections:i,media:a,peopleCount:s,isServiceCompleted:n,menuId:r,menuTitle:o}=e,{allFavoriteDishesIds:d,allFavoriteMenusIds:c}=(0,k.S9)(),[v]=(0,S.mqZ)({refetchQueries:[S.VO6]}),[h]=(0,S.rEU)({refetchQueries:[S.VO6]}),[p]=(0,S.ubW)({refetchQueries:[S.HT8]}),[x]=(0,S.ASh)({refetchQueries:[S.HT8]}),[b,f]=(0,m.useState)(null),[y,g]=(0,m.useState)(!1),C=async(e,t)=>{f(e),await v({variables:{input:{dishId:e,dishTitle:t}}}),setTimeout(()=>f(null),300)},N=async e=>{f(e),await h({variables:{input:{dishId:e}}}),setTimeout(()=>f(null),300)},T=async()=>{g(!0),await p({variables:{input:{menuId:r,menuTitle:o}}}),setTimeout(()=>g(!1),300)},D=async()=>{g(!0),await x({variables:{input:{menuId:r}}}),setTimeout(()=>g(!1),300)};if(l)return(0,u.jsx)("div",{className:"flex justify-center p-8",children:(0,u.jsx)(j.U,{})});if(t)return(0,u.jsx)("div",{className:"flex justify-center p-8",children:(0,u.jsx)("p",{children:t.message})});let M=Array.isArray(a)?null:a;return(0,u.jsxs)("div",{className:"flex flex-col-reverse p-4 xl:flex-row xl:p-8",children:[(0,u.jsx)("div",{className:"mr-6 flex-grow",children:i&&(0,u.jsx)("ul",{children:i.map((e,t)=>(0,u.jsx)(m.Fragment,{children:e.dishes&&e.dishes.length>0&&(0,u.jsxs)("li",{className:(0,eT.cn)("flex flex-col gap-4 xl:flex-row",t!==i.length-1&&"mb-8"),children:[(0,u.jsx)("div",{className:"helvetica-10-400 w-[100px] uppercase",children:e.title}),(0,u.jsx)("ul",{className:"flex-grow",children:e.dishes.map((t,l)=>(0,u.jsxs)("li",{className:(0,eT.cn)("editorial-18 relative",l!==e.dishes.length-1&&"mb-4"),children:[(0,u.jsx)("h3",{className:n&&"pr-4",children:t.title}),t.customInstructions&&(0,u.jsx)("p",{className:"helvetica-12-400 mt-1 opacity-40 ",children:t.customInstructions}),t.customServings&&t.customServings!==s&&(0,u.jsx)("p",{className:"helvetica-12-400 mt-1 opacity-40",children:w.t4.find(e=>e.value===(0,ex.w)(t.customServings)).label}),n&&(0,u.jsx)(u.Fragment,{children:b===t.id?(0,u.jsx)(j.U,{className:"!absolute -top-1 right-0 p-1",size:"small"}):(0,u.jsx)("button",{type:"button",title:"Add to favorites",className:"absolute -right-1 -top-1 p-1",onClick:()=>d.includes(t.id)?N(t.id):C(t.id,t.title),children:(0,u.jsx)(W.k,{icon:d.includes(t.id)?(0,u.jsx)(Y.Z,{}):(0,u.jsx)(H.Z,{}),size:14})})})]},t.id))})]})},e.id))})}),(0,u.jsxs)("div",{className:"mb-8 flex w-full flex-col gap-2 xl:mb-0 xl:w-5/12 xl:items-end",children:[r&&n&&(0,u.jsx)("div",{className:"h-6",children:y?(0,u.jsx)(j.U,{size:"small"}):(0,u.jsx)("button",{type:"button",onClick:c.includes(r)?D:T,className:c.includes(r)?"text-ar-red":void 0,children:c.includes(r)?"Remove menu from favorites":"Add menu to favorites"})}),M?(0,u.jsx)(V(),{priority:!0,className:"aspect-[275/152] w-full object-cover object-center xl:aspect-[356/255]",src:M.url,alt:M.alt,placeholder:"blur",width:M.metadata.width,height:M.metadata.height,blurDataURL:M.metadata.lqip}):(0,u.jsx)("div",{className:"grid aspect-[275/237] grid-cols-3 grid-rows-2 gap-1.5 xl:aspect-[294/254]",children:null==a?void 0:a.slice(0,6).filter(e=>!!e).map((e,t)=>(0,u.jsx)(V(),{className:"h-full object-cover object-center",src:e.url,alt:e.alt,placeholder:"blur",width:e.metadata.width,height:e.metadata.height,blurDataURL:e.metadata.lqip},t))})]})]})}});var eY=l(34376);let eQ={additionalDetails:[ef.J.ChefRequested,ef.J.ChefMatched,ef.J.ChangeRequested],rebookService:[ef.J.Cancelled,ef.J.Complete],sendFeedback:[ef.J.Complete],seeMore:[ef.J.ChefRequested,ef.J.ChefMatched,ef.J.ChangeRequested,ef.J.Cancelled,ef.J.Complete],cancelService:[ef.J.ChefRequested,ef.J.ChefMatched,ef.J.ChangeRequested]};function eX(e){var t;let{id:l,serviceDate:i,menuRefId:a,expandedByDefault:s,serviceStatus:n,arrivalTime:r,startTime:o,review:d,dishes:c,address:v,peopleCount:h,menuName:p}=e,x=(0,eY.useRouter)(),{openModal:f,setServiceToCancel:j,setServiceToReview:C}=(0,k.ws)(),[M,{data:I,loading:P,error:E,called:Z}]=(0,g.trH)({variables:{id:a}}),B=(0,m.useMemo)(()=>(0,$.ir)(null==I?void 0:I.menu[0]),[I]),U=(0,m.useMemo)(()=>(null==c?void 0:c.map(e=>null==e?void 0:e.dishRefId))||[],[c]),q=(0,m.useMemo)(()=>{var e;let t=(null==B?void 0:null===(e=B.courses)||void 0===e?void 0:e.map(e=>{var t;return null==e?void 0:null===(t=e.dishes)||void 0===t?void 0:t.map(e=>e.id)}).flat())||[];return U.filter(e=>!t.includes(e))||[]},[B,U]),{data:A}=(0,g.bze)({skip:0===q.length,variables:{ids:q}}),O=(0,m.useMemo)(()=>{var e,t;let l=null==B?void 0:null===(e=B.courses)||void 0===e?void 0:e.map(e=>{var t,l;let i=null==e?void 0:null===(l=e.dishes)||void 0===l?void 0:null===(t=l.filter(e=>U.includes(null==e?void 0:e.id)))||void 0===t?void 0:t.map(e=>{let t=c.find(t=>t.dishRefId===(null==e?void 0:e.id));
1return{...e,dishId:null==t?void 0:t.id,customInstructions:null==t?void 0:t.customInstructions}});return{...e,dishes:i}});return(null==A?void 0:null===(t=A.dishes)||void 0===t?void 0:t.length)>0&&(null==l||l.push({id:"offMenu",title:"Off Menu Dishes",dishes:A.dishes.map(e=>{let t=c.find(t=>t.dishRefId===(null==e?void 0:e._id));return{...(0,$.s0)(e),dishId:null==t?void 0:t.id,customInstructions:null==t?void 0:t.customInstructions}})})),{...B,courses:l}},[c,A,B,U]),W=(0,y.a)(768);return(0,u.jsx)(eH,{color:w.UH[S.UW4.Gathering],when:(0,T.Z)((0,D.EM)(i),"MMM d"),title:["Gathering",p],href:b.Z.singleService(S.UW4.Gathering,l),expandable:!!a,content:(0,u.jsx)(eH.Content,{loading:P,error:E,media:W&&(null==O?void 0:null===(t=O.mobileImage)||void 0===t?void 0:t.url)?O.mobileImage:null==O?void 0:O.image,sections:null==O?void 0:O.courses,isServiceCompleted:n===ef.J.Complete,menuId:null==O?void 0:O.id,menuTitle:null==O?void 0:O.title}),details:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(eH.Tag,{label:"Service Status",value:n===ef.J.ChefRequested?"Chef Requested":w.wh[n]}),eQ.additionalDetails.includes(n)&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(eH.Tag,{label:"Guest Arrival Time",value:(0,D.mr)(r)}),(0,u.jsx)(eH.Tag,{label:"Table Time",value:(0,D.mr)(o)})]})]}),actions:[eQ.rebookService.includes(n)&&(0,u.jsx)(eH.ActionButton,{text:"Rebook service",onClick:()=>{x.push(R.y.bookingOrder({step:"1",service:(0,eZ.u)(S.UW4.Gathering),reorderId:l,zipCode:(null==v?void 0:v.zipCode)||""}))}}),eQ.sendFeedback.includes(n)&&(0,u.jsx)(eH.ActionButton,{text:d?"View feedback":"Add feedback",onClick:()=>{f(k.Ti.Survey),C({serviceId:l,review:d})}}),eQ.seeMore.includes(n)&&(0,u.jsx)(eH.ActionButton,{text:"See More",as:"a",href:b.Z.singleService(S.UW4.Gathering,l)}),eQ.cancelService.includes(n)&&(0,u.jsx)(eH.ActionButton,{text:"Cancel Service",color:N.bG.Red,onClick:()=>{f(k.Ti.CancelService),j({id:l,serviceDate:i,serviceType:S.UW4.Gathering,peopleCount:h,arrivalTime:r,startTime:o,address:v})}})].filter(Boolean),onMouseEnter:()=>{a&&!Z&&M()},expandedByDefault:s&&!!a})}var e$=l(18844);let eK={additionalDetails:[ef.J.InPlanning,ef.J.DishSelectionNeeded,ef.J.DishesAvailable,ef.J.Scheduled],rebookService:[ef.J.Complete,ef.J.Cancelled],sendFeedback:[ef.J.Complete],seeMore:[ef.J.InPlanning,ef.J.Scheduled,ef.J.Complete,ef.J.DishSelectionNeeded,ef.J.DishesAvailable],unskipService:[ef.J.Skipped],skipService:[ef.J.InPlanning,ef.J.DishSelectionNeeded,ef.J.DishesAvailable,ef.J.Scheduled]},e0=new Date,e1=e=>((0,D.EM)(e).getTime()-e0.getTime())/36e5;function e4(e){var t,l,i,a;let{id:s,serviceDate:n,expandedByDefault:r,serviceStatus:o,review:d,arrivalTime:c,startTime:v,dishes:h,peopleCount:p,assignedChefs:x}=e,f=(0,y.a)(500),{sitePlaceholderImage:j}=(0,ep.K)(),C=(0,eE.useRouter)(),{openModal:M,setServiceToSkip:I,setServiceToUnSkip:P,setServiceToReview:E}=(0,k.ws)(),{data:Z,loading:B,error:U}=(0,g.bze)({skip:0===h.length,variables:{ids:null==h?void 0:null===(t=h.filter(e=>e.dishRefId))||void 0===t?void 0:t.map(e=>e.dishRefId)}}),q=(null==Z?void 0:null===(l=Z.dishes)||void 0===l?void 0:l.map(e=>{let t=h.find(t=>t.dishRefId===(null==e?void 0:e._id));return{...(0,$.s0)(e),dishId:null==t?void 0:t.id,customInstructions:null==t?void 0:t.customInstructions,customServings:null==t?void 0:t.customServings}}))||[],A=(null==h?void 0:null===(i=h.filter(e=>!(null==e?void 0:e.dishRefId)))||void 0===i?void 0:i.map(e=>({dishId:null==e?void 0:e.dishName,customInstructions:null==e?void 0:e.customInstructions,customServings:null==e?void 0:e.customServings,id:null==e?void 0:e.dishName,title:null==e?void 0:e.dishName,image:j,mobileImage:null,ingredients:"",diets:[]})))||[],O=(0,m.useMemo)(()=>o===ef.J.Cancelled?w.wh[ef.J.Cancelled]:(null==x?void 0:x.length)===0?"In Planning":o===ef.J.DishesAvailable||o===ef.J.DishSelectionNeeded&&e1(n)>72?w.wh[ef.J.Scheduled]:w.wh[o],[null==x?void 0:x.length,n,o]),W=()=>{C.push(R.y.bookingOrder({step:"1",service:(0,eZ.u)(S.UW4.MealPrep),reorderId:s}))};return(0,u.jsx)(eH,{color:w.UH[S.UW4.MealPrep],when:(0,T.Z)((0,D.EM)(n),"MMM d"),title:"Weekly Meal Prep",expandable:(null==h?void 0:h.length)>0,disabled:o===ef.J.Skipped,rightAdornment:!(0,eR.s)(S.UW4.MealPrep,n,v,24)&&![ef.J.Cancelled,ef.J.Skipped,ef.J.Complete].includes(o)&&(f?(0,u.jsx)("button",{type:"button",className:"helvetica-10-500 bg-ar-green p-2 text-ar-beige-light",onClick:()=>{C.push(R.y.bookingOrder({step:"1",service:(0,eZ.u)(S.UW4.MealPrep),orderId:s}))},children:(null==h?void 0:h.length)>0?"Edit Dishes":"Select Dishes"}):(0,u.jsx)(e$.k,{backgroundColor:N.bG.Green,textColor:N.bG.White,variant:e$.$.ServiceCard,onClick:()=>{C.push(R.y.bookingOrder({step:"1",service:(0,eZ.u)(S.UW4.MealPrep),orderId:s}))},children:(null==h?void 0:h.length)>0?"Edit Dishes":"Select Dishes"})),content:(0,u.jsx)(eH.Content,{loading:B,error:U,media:(null===(a=q.concat(A))||void 0===a?void 0:a.map(e=>e.image))||[],sections:[{id:"dishesSet",title:"Dishes Set",dishes:q.concat(A)||[]}],peopleCount:p,isServiceCompleted:o===ef.J.Complete}),details:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(eH.Tag,{label:"Service Status",value:O,labelClassName:o===ef.J.Skipped?"text-opacity-40 md:text-opacity-40":void 0,valueClassName:o===ef.J.Skipped||o===ef.J.DishSelectionNeeded&&72>e1(n)?"text-ar-red-warning":void 0}),eK.additionalDetails.includes(o)&&(0,u.jsx)(eH.Tag,{label:"Chef Arrival Time",value:(0,D.mr)(c)})]}),actions:[eK.rebookService.includes(o)&&(0,u.jsx)(u.Fragment,{children:o===ef.J.Cancelled?(0,u.jsx)(eM,{text:"Your weekly meal prep service is no longer active. Please book a new service to add dishes.",variant:"error",children:(0,u.jsx)(eH.ActionButton,{text:"Re-order dishes",onClick:W,disabled:!0})}):(0,u.jsx)(eH.ActionButton,{text:"Re-order dishes",onClick:W})}),eK.sendFeedback.includes(o)&&(0,u.jsx)(eH.ActionButton,{text:d?"View feedback":"Add feedback",onClick:()=>{M(k.Ti.Survey),E({serviceId:s,review:d})}}),eK.seeMore.includes(o)&&(null==h?void 0:h.length)>0&&(0,u.jsx)(eH.ActionButton,{text:"See More",as:"a",href:b.Z.singleService(S.UW4.MealPrep,s)}),eK.unskipService.includes(o)&&(0,u.jsx)(eH.ActionButton,{text:"Unskip Service",color:N.bG.Red,onClick:()=>{M(k.Ti.UnSkipService),P({id:s,serviceDate:n,startTime:v})}}),eK.skipService.includes(o)&&(0,u.jsx)(eH.ActionButton,{text:"Skip Service",color:N.bG.Red,onClick:()=>{M(k.Ti.SkipService),I({id:s,serviceDate:n,startTime:v})}}
1)].filter(Boolean),expandedByDefault:r&&(null==h?void 0:h.length)>0})}let e5={sendFeedback:[ef.J.Complete],contactUs:[ef.J.ChefRequested,ef.J.ChefMatched]};function e2(e){let{id:t,serviceDate:l,title:i,serviceStatus:a,review:s}=e,{openModal:n,setServiceToReview:r}=(0,k.ws)();return(0,u.jsx)(eH,{color:w.UH[S.UW4.Placement],when:(0,T.Z)((0,D.EM)(l),"MMM d"),title:i,details:(0,u.jsx)(eH.Tag,{label:"Service status",value:w.wh[a]}),actions:[e5.sendFeedback.includes(a)&&(0,u.jsx)(eH.ActionButton,{text:s?"View feedback":"Add feedback",onClick:()=>{n(k.Ti.Survey),r({serviceId:t,review:s})}}),e5.contactUs.includes(a)&&(0,u.jsx)(eH.ActionButton,{text:"Contact Us",as:"a",href:R.y.contact()})].filter(Boolean)})}let e3={additionalDetails:[ef.J.ChefRequested,ef.J.ChefMatched,ef.J.ChangeRequested],rebookService:[ef.J.Cancelled,ef.J.Complete],sendFeedback:[ef.J.Complete],seeMore:[ef.J.ChefRequested,ef.J.ChefMatched,ef.J.ChangeRequested,ef.J.Cancelled,ef.J.Complete],cancelService:[ef.J.ChefRequested,ef.J.ChefMatched,ef.J.ChangeRequested]};function e6(e){var t;let{id:l,serviceDate:i,menuRefId:a,expandedByDefault:s,serviceStatus:n,arrivalTime:r,startTime:o,review:d,dishes:c,address:v,peopleCount:h,menuName:p}=e,x=(0,eE.useRouter)(),{openModal:f,setServiceToCancel:j,setServiceToReview:C}=(0,k.ws)(),[M,{data:I,loading:P,error:E,called:Z}]=(0,g.tTF)({variables:{id:a}}),B=(0,m.useMemo)(()=>{var e;return(0,$.ir)(null==I?void 0:null===(e=I.menu[0])||void 0===e?void 0:e.cookingClass)},[I]),U=(0,m.useMemo)(()=>(null==c?void 0:c.map(e=>null==e?void 0:e.dishRefId))||[],[c]),q=(0,m.useMemo)(()=>{var e;let t=(null==B?void 0:null===(e=B.courses)||void 0===e?void 0:e.map(e=>{var t;return null==e?void 0:null===(t=e.dishes)||void 0===t?void 0:t.map(e=>e.id)}).flat())||[];return U.filter(e=>!t.includes(e))||[]},[B,U]),{data:A}=(0,g.bze)({skip:0===q.length,variables:{ids:q}}),O=(0,m.useMemo)(()=>{var e,t;let l=null==B?void 0:null===(e=B.courses)||void 0===e?void 0:e.map(e=>{var t,l;let i=null==e?void 0:null===(l=e.dishes)||void 0===l?void 0:null===(t=l.filter(e=>U.includes(null==e?void 0:e.id)))||void 0===t?void 0:t.map(e=>{let t=c.find(t=>t.dishRefId===(null==e?void 0:e.id));return{...e,dishId:null==t?void 0:t.id,customInstructions:null==t?void 0:t.customInstructions}});return{...e,dishes:i}});return(null==A?void 0:null===(t=A.dishes)||void 0===t?void 0:t.length)>0&&(null==l||l.push({id:"offMenu",title:"Off Menu Dishes",dishes:A.dishes.map(e=>{let t=c.find(t=>t.dishRefId===(null==e?void 0:e._id));return{...(0,$.s0)(e),dishId:null==t?void 0:t.id,customInstructions:null==t?void 0:t.customInstructions}})})),{...B,courses:l}},[A,B,U,c]),W=(0,y.a)(768);return(0,u.jsx)(eH,{color:w.UH[S.UW4.CookingClass],when:(0,T.Z)((0,D.EM)(i),"MMM d"),title:["Cooking class",p],href:b.Z.singleService(S.UW4.CookingClass,l),expandable:!!a,content:(0,u.jsx)(eH.Content,{loading:P,error:E,media:W&&(null==O?void 0:null===(t=O.mobileImage)||void 0===t?void 0:t.url)?O.mobileImage:null==O?void 0:O.image,sections:null==O?void 0:O.courses,isServiceCompleted:n===ef.J.Complete,menuId:null==O?void 0:O.id,menuTitle:null==O?void 0:O.title}),details:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(eH.Tag,{label:"Service Status",value:n===ef.J.ChefRequested?"Chef Requested":w.wh[n]}),e3.additionalDetails.includes(n)&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(eH.Tag,{label:"Guest Arrival Time",value:(0,D.mr)(r)}),(0,u.jsx)(eH.Tag,{label:"Table Time",value:(0,D.mr)(o)})]})]}),actions:[e3.rebookService.includes(n)&&(0,u.jsx)(eH.ActionButton,{text:"Rebook Service",onClick:()=>{x.push(R.y.bookingOrder({step:"1",service:(0,eZ.u)(S.UW4.CookingClass),reorderId:l,zipCode:(null==v?void 0:v.zipCode)||""}))}}),e3.sendFeedback.includes(n)&&(0,u.jsx)(eH.ActionButton,{text:d?"View feedback":"Add feedback",onClick:()=>{f(k.Ti.Survey),C({serviceId:l,review:d})}}),e3.seeMore.includes(n)&&(0,u.jsx)(eH.ActionButton,{text:"See More",as:"a",href:b.Z.singleService(S.UW4.CookingClass,l)}),e3.cancelService.includes(n)&&(0,u.jsx)(eH.ActionButton,{text:"Cancel Service",color:N.bG.Red,onClick:()=>{f(k.Ti.CancelService),j({id:l,serviceDate:i,serviceType:S.UW4.CookingClass,peopleCount:h,arrivalTime:r,startTime:o,address:v})}}
1)].filter(Boolean),onMouseEnter:()=>{a&&!Z&&M()},expandedByDefault:s&&!!a})}function e8(e){let{serviceType:t,id:l,serviceStatus:i,...a}=e,{data:s}=(0,S.yBE)({skip:i!==ef.J.Complete,variables:{input:{serviceId:l}}}),n=(0,m.useMemo)(()=>null==s?void 0:s.review,[null==s?void 0:s.review]);switch(t){case S.UW4.Gathering:return(0,u.jsx)(eX,{id:l,serviceStatus:i,review:n,...a});case S.UW4.MealPrep:return(0,u.jsx)(e4,{id:l,serviceStatus:i,review:n,...a});case S.UW4.Placement:return(0,u.jsx)(e2,{id:l,serviceStatus:i,review:n,...a});case S.UW4.CookingClass:return(0,u.jsx)(e6,{id:l,serviceStatus:i,review:n,...a});default:throw Error("ArServiceCard - Invalid variant")}}function e9(e){let{className:t,nextService:l}=e,i=(0,y.a)(768);return(0,u.jsxs)("div",{className:t,children:[(0,u.jsx)("h4",{className:"helvetica-14-400 mb-4",children:"Next Service"}),(0,u.jsx)(e8,{...l,expandedByDefault:!i})]})}var e7=l(1571);function te(e){let{className:t,items:l,value:i,onChange:a}=e;return(0,u.jsx)("div",{className:(0,eT.cn)("flex gap-x-5 border-b border-b-ar-culinista-black border-opacity-40",t),children:l.map(e=>(0,u.jsxs)(e7.k,{variant:"text",theme:"transparent",onClick:()=>a(e.key),className:(0,eT.cn)("helvetica-14-400 relative top-px pb-2.5",{"opacity-40":i!==e.key,"border-b-2 border-ar-culinista-black":i===e.key}),children:[(0,u.jsx)("span",{className:"invisible font-medium",children:e.label}),(0,u.jsx)("span",{className:(0,eT.cn)("absolute",{"font-medium":i===e.key}),children:e.label})]},e.key))})}(i=n||(n={})).UPCOMING="upcoming",i.PAST="past";let tt=[{key:n.UPCOMING,label:"Upcoming Services"},{key:n.PAST,label:"Past Services"}];function tl(e){let{services:t}=e;return(0,u.jsx)(F.E.div,{animate:{opacity:1},initial:{opacity:0}
1,className:"md:gap-7-8 grid gap-y-6",children:t.map(e=>(0,u.jsx)(e8,{...e},e.id))})}function ti(e){let{upcomingServices:t,pastServices:l}=e,[i,a]=(0,m.useState)(n.UPCOMING);return(0,u.jsxs)("div",{children:[(0,u.jsx)(te,{className:"mb-6 md:mb-14",items:tt,value:i,onChange:e=>{a(e)}}),i===n.UPCOMING&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(tl,{services:t}),0===t.length&&(0,u.jsx)("p",{className:"helvetica-14-500 mt-6 text-center",children:"No upcoming services found"})]}),i===n.PAST&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(tl,{services:l}),0===l.length&&(0,u.jsx)("p",{className:"helvetica-14-500 mt-6 text-center",children:"No past services found"})]})]})}function ta(){return(ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e}).apply(this,arguments)}var ts=function(e){return m.createElement("svg",ta({width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=m.createElement("path",{d:"M12 9a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM7.5 9a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM3 9a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z",fill:"#22292F"})))};function tn(){return(tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e}).apply(this,arguments)}var tr=function(e){return m.createElement("svg",tn({width:12,height:11,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),o||(o=m.createElement("mask",{id:"warning_svg__a",maskUnits:"userSpaceOnUse",x:.5,y:0,width:11,height:11,fill:"#000"},m.createElement("path",{fill:"#fff",d:"M.5 0h11v11H.5z"}),m.createElement("path",{d:"M6.45 5.95h-.9v-2.7h.9m0 4.5h-.9v-.9h.9M6 1a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9Z"}))),d||(d=m.createElement("path",{d:"M6.45 5.95h-.9v-2.7h.9m0 4.5h-.9v-.9h.9M6 1a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9Z",fill:"#093C34"})),c||(c=m.createElement("path",{d:"M5.55 5.95h-1v1h1v-1Zm0-2.7v-1h-1v1h1Zm0 4.5h-1v1h1v-1Zm0-.9v-1h-1v1h1ZM1.5 5.5h-1 1ZM6 10v1-1Zm.45-5.05h-.9v2h.9v-2Zm.1 1v-2.7h-2v2.7h2Zm-1-1.7h.9v-2h-.9v2Zm.9 2.5h-.9v2h.9v-2Zm.1 1v-.9h-2v.9h2Zm-1 .1h.9v-2h-.9v2ZM6 0a5.5 5.5 0 0 0-2.105.419l.766 1.847A3.5 3.5 0 0 1 6 2V0ZM3.895.419A5.5 5.5 0 0 0 2.111 1.61l1.414 1.414a3.5 3.5 0 0 1 1.136-.759L3.895.42ZM2.111 1.61A5.5 5.5 0 0 0 .5 5.5h2a3.5 3.5 0 0 1 1.025-2.475L2.111 1.611ZM.5 5.5a5.5 5.5 0 0 0 1.61 3.89l1.415-1.415A3.5 3.5 0 0 1 2.5 5.5h-2Zm1.61 3.89a5.5 5.5 0 0 0 1.785 1.191l.766-1.847a3.5 3.5 0 0 1-1.136-.76L2.111 9.39Zm1.785 1.191A5.5 5.5 0 0 0 6 11V9a3.5 3.5 0 0 1-1.34-.266l-.765 1.847ZM6 11a5.5 5.5 0 0 0 3.89-1.61L8.474 7.974A3.5 3.5 0 0 1 6 9v2Zm3.89-1.61A5.5 5.5 0 0 0 11.5 5.5h-2a3.5 3.5 0 0 1-1.025 2.475l1.414 1.414ZM11.5 5.5a5.5 5.5 0 0 0-.419-2.105l-1.847.766A3.5 3.5 0 0 1 9.5 5.5h2Zm-.419-2.105A5.5 5.5 0 0 0 9.89 1.611L8.475 3.025a3.5 3.5 0 0 1 .759 1.136l1.847-.766ZM9.89 1.611A5.5 5.5 0 0 0 8.105.419l-.766 1.847a3.5 3.5 0 0 1 1.136.76L9.889 1.61ZM8.105.419A5.5 5.5 0 0 0 6 0v2c.46 0 .915.09 1.34.266L8.104.42Z",fill:"#FCF6F2",mask:"url(#warning_svg__a)"})))};function to(e){let{seriesStatus:t,weeklyRepeatPauseStartDate:l,weeklyRepeatPauseEndDate:i}=e;switch(t){case S.v0p.Active:case S.v0p.Scheduled:return"Active";case S.v0p.Paused:case S.v0p.PauseScheduled:return"Paused ".concat(i?"<br/> ".concat((0,D.p6)(l),"-").concat((0,D.p6)(i)):"from <br/> ".concat((0,D.p6)(l)));case S.v0p.Inactive:case S.v0p.Ended:return"Completed";case S.v0p.Canceled:case S.v0p.EndScheduled:return"Cancelled";default:return"Active"}}var td=l(83004),tc=l(11916),tu=l(97407),tv=l(12846),tm=l(65413),th=l(35963);let tp=(e,t)=>{if(!e||!t)return;let l=new Date("".concat(e,"T").concat(t,"Z")),i=new Date,a=function(e,t,l){(0,tu.Z)(2,arguments);var i=(0,tc.Z)(e,t)/td.yJ;return(0,tv.u)(null==l?void 0:l.roundingMethod)(i)}(l,i);if((0,er.Z)(i,l))return e;let s=function(e,t){(0,tu.Z)(2,arguments);var l=(0,tm.Z)(t);return(0,th.Z)(e,6e4*l)}(l,Math.abs(a));return(0,T.Z)(s,"yyyy-MM-dd")};function tx(e){let{className:t}=e;return(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(p(),{href:R.y.contact(),className:(0,U.Z)(t,"block"),children:"Contact Us"})})}function tb(e){let{className:t,seriesId:l,weeklyRepeatStartDate:i,weeklyRepeatEndDate:a,weeklyRepeatWeekdays:s,arrivalTime:n,address:r,peopleCount:o,weeklyRepeatPauseStartDate:d,nextServiceDate:c,weeklyRepeatPauseEndDate:v}=e,{openModal:m,setServiceToCancel:h,setSeriesToPause:p,setSeriesToEdit:x,setSeriesToUnPause:b}=(0,k.ws)(),f=async()=>{m(k.Ti.UnPauseService),b({id:l,weeklyRepeatPauseStartDate:d,weeklyRepeatPauseEndDate:v,weeklyRepeatWeekdays:s,nextServiceDate:c,startTime:n})};return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{type:"button",onClick:()=>{m(k.Ti.EditGlobalSettings),x({id:l,weeklyRepeatStartDate:i,weeklyRepeatWeekdays:s,arrivalTime:n,address:r,peopleCount:o})}
1,className:(0,U.Z)(t),children:"Edit Settings"}),(0,u.jsx)("button",{type:"button",onClick:d?f:()=>{m(k.Ti.PauseService),p({id:l,weeklyRepeatStartDate:i,weeklyRepeatEndDate:a,nextServiceDate:c,startTime:n})},className:(0,U.Z)(t),children:d?"Unpause Service":"Pause Service"}),(0,u.jsx)("button",{type:"button",onClick:()=>{m(k.Ti.CancelService),h({id:l,serviceDate:c,serviceType:S.UW4.MealPrep,startTime:n})},className:(0,U.Z)(t,"text-ar-red"),children:"Cancel Service"})]})}let tf=e=>{let{variant:t,seriesId:l,weeklyRepeatStartDate:i,weeklyRepeatEndDate:a,weeklyRepeatWeekdays:s,arrivalTime:n,address:r,peopleCount:o,weeklyRepeatPauseStartDate:d,nextServiceDate:c,weeklyRepeatPauseEndDate:v}=e,m="w-full border-t border-ar-culinista-black border-opacity-40 p-4 text-left first:border-t-0 xl:border-t-0 xl:w-fit xl:p-0";switch(t){case S.UW4.MealPrep:return(0,u.jsx)(tb,{className:m,seriesId:l,weeklyRepeatStartDate:i,weeklyRepeatEndDate:a,weeklyRepeatWeekdays:s,arrivalTime:n,address:r,peopleCount:o,weeklyRepeatPauseStartDate:d,nextServiceDate:c,weeklyRepeatPauseEndDate:v});case S.UW4.Placement:return(0,u.jsx)(tx,{className:m});default:return null}};function ty(e){let{series:t,variant:l}=e,i=(0,y.a)(1240),a=(0,m.useMemo)(()=>{var e,l,i;let a=null==t?void 0:t.address;switch(null==t?void 0:t.serviceType){case S.UW4.MealPrep:return{serviceStatus:to({seriesStatus:null==t?void 0:t.seriesStatus,weeklyRepeatPauseStartDate:null==t?void 0:t.weeklyRepeatPauseStartDate,weeklyRepeatPauseEndDate:null==t?void 0:t.weeklyRepeatPauseEndDate}),size:w.t4.find(e=>e.value===(0,ex.w)(null==t?void 0:t.peopleCount)).label,serviceDay:(null==t?void 0:null===(l=t.weeklyRepeatWeekdays)||void 0===l?void 0:null===(e=l.map(e=>e[0].toUpperCase()+e.slice(1).toLowerCase()))||void 0===e?void 0:e.join(", "))||"-",serviceTime:(0,D.mr)(null==t?void 0:t.startTime)||"-",address:a?"".concat(null==a?void 0:a.streetAddress).concat((null==a?void 0:a.streetAddress2)?" ".concat(null==a?void 0:a.streetAddress2):"",", ").concat(null==a?void 0:a.city):"-"};case S.UW4.Placement:return{serviceStatus:to({seriesStatus:null==t?void 0:t.seriesStatus}),date:(null==t?void 0:t.weeklyRepeatEndDate)?"".concat((0,T.Z)(new Date(null==t?void 0:t.weeklyRepeatStartDate),"MMMM d, yyyy")," - ").concat((0,T.Z)(new Date(null==t?void 0:t.weeklyRepeatEndDate),"MMMM d, yyyy")):"form ".concat((0,T.Z)(new Date(null==t?void 0:t.weeklyRepeatStartDate),"MMMM d, yyyy")),rate:t.serviceFee?"$".concat(t.serviceFee):"-",serviceCount:(null==t?void 0:t.peopleCount)||"-",chef:(null==t?void 0:null===(i=t.assignedChefs)||void 0===i?void 0:i.map(e=>"".concat(null==e?void 0:e.firstName," ").concat(null==e?void 0:e.lastName)).join(", "))||"Chef matching in progress",address:a?"".concat(null==a?void 0:a.streetAddress).concat((null==a?void 0:a.streetAddress2)?" ".concat(null==a?void 0:a.streetAddress2):"",", ").concat(null==a?void 0:a.city):"-"};default:return null}},[t]),s=Object.entries(a).map((e,t)=>{let[l,i]=e;return null!==i?{key:t+1,name:l.split(/(?=[A-Z])/).join(" "),value:i}:null}).filter(Boolean);return(0,u.jsxs)("div",{className:"mb-12 xl:mb-16",children:[(0,u.jsxs)("div",{className:"border border-ar-culinista-black border-opacity-40",children:[(0,u.jsxs)("div",{className:"relative flex items-center justify-between p-4 xl:px-8",children:[(0,u.jsx)("h4",{className:"helvetica-14-400",children:"Service settings"}),!i&&(0,u.jsx)("div",{className:"helvetica-12-500 flex gap-2.5 xl:flex-row",children:tf({variant:l,seriesId:null==t?void 0:t.id,weeklyRepeatStartDate:null==t?void 0:t.weeklyRepeatStartDate,weeklyRepeatEndDate:null==t?void 0:t.weeklyRepeatEndDate,weeklyRepeatWeekdays:null==t?void 0:t.weeklyRepeatWeekdays,arrivalTime:null==t?void 0:t.startTime,address:null==t?void 0:t.address,peopleCount:null==t?void 0:t.peopleCount,weeklyRepeatPauseStartDate:null==t?void 0:t.weeklyRepeatPauseStartDate,nextServiceDate:tp(null==t?void 0:t.weeklyRepeatStartDate,null==t?void 0:t.startTime),weeklyRepeatPauseEndDate:null==t?void 0:t.weeklyRepeatPauseEndDate})}),i&&(0,u.jsx)(eJ,{buttonTitle:"Actions",icon:(0,u.jsx)(x.k,{icon:(0,u.jsx)(ts,{}),width:18,height:18}),children:tf({variant:l,seriesId:null==t?void 0:t.id,weeklyRepeatStartDate:null==t?void 0:t.weeklyRepeatStartDate,weeklyRepeatEndDate:null==t?void 0:t.weeklyRepeatEndDate,weeklyRepeatWeekdays:null==t?void 0:t.weeklyRepeatWeekdays,arrivalTime:null==t?void 0:t.startTime,address:null==t?void 0:t.address,peopleCount:null==t?void 0:t.peopleCount,weeklyRepeatPauseStartDate:null==t?void 0:t.weeklyRepeatPauseStartDate,nextServiceDate:tp(null==t?void 0:t.weeklyRepeatStartDate,null==t?void 0:t.startTime),weeklyRepeatPauseEndDate:null==t?void 0:t.weeklyRepeatPauseEndDate})})]}),(0,u.jsx)("div",{className:(0,U.Z)("flex flex-col px-4 pb-0 pt-2 xl:flex-row xl:gap-8 xl:p-8 xl:px-8",{"bg-ar-culinista-black bg-opacity-10":l===S.UW4.Placement,"bg-ar-green-light bg-opacity-40":l===S.UW4.MealPrep}),children:s.map(e=>(0,u.jsxs)("div",{className:"flex w-full items-center justify-between gap-5 border-t border-ar-culinista-black border-opacity-40 py-4 first:border-t-0 xl:w-fit xl:flex-shrink-0 xl:flex-grow  xl:flex-col xl:items-start xl:justify-start xl:gap-2.5 xl:border-0 xl:py-0 last:xl:flex-shrink last:xl:flex-grow-0",children:[(0,u.jsx)("p",{className:"helvetica-10-400 uppercase",children:e.name}),(0,u.jsx)("p",{className:"helvetica-12-400 2xl:helvetica-14-400 text-right xl:text-left",dangerouslySetInnerHTML:{__html:e.value}})]},e.key))})]}),"Change requested"===a.serviceStatus&&(0,u.jsxs)("div",{className:"helvetica-10-400 flex gap-2 bg-ar-green px-4 py-2.5 text-white xl:px-8",children:[(0,u.jsx)(x.k,{icon:(0,u.jsx)(tr,{}),width:12,height:11}),(0,u.jsx)("p",{children:"Our client services team is reviewing your requested changes. Your settings will update once these changes are confirmed."})]})]})}let tg=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],tj=(0,ea.Ry)().shape({selectDay:(0,ea.Z_)().required("Select day is required"),time:(0,ea.Z_)().required("Time day is required"),date:(0,ea.hT)().nullable().transform((e,t)=>""===t?null:e).required("Date is required"),address:(0,ea.Z_)().required("Address is required"),portions:(0,ea.Z_)().required("Portion size is required")}),tw=new Date;function tC(e){var t,l,i,a,s,n;let{id:r,weeklyRepeatStartDate:o,weeklyRepeatWeekdays:d,arrivalTime:c,address:v,peopleCount:h,primaryColor:p}=e,{handleSubmit:x,register:b,control:f,watch:y,setValue:g,reset:j}=(0,ee.cI)({resolver:(0,es.X)(tj)}),{clearSeriesToEdit:C}=(0,k.ws)(),{data:M}=(0,S.J90)({}
1),[I,R]=(0,S.EIB)({refetchQueries:[S.GGp,S.toe]}),Z=null!==(n=null==M?void 0:null===(l=M.customer)||void 0===l?void 0:null===(t=l.addresses)||void 0===t?void 0:t.map(e=>({label:"".concat(e.streetAddress).concat(e.streetAddress2?" ".concat(e.streetAddress2):"",", ").concat(e.city,", ").concat(e.state,", ").concat(e.zipCode),value:e.id})))&&void 0!==n?n:[],B=(0,ee.qo)({control:f,name:"selectDay",defaultValue:tg.indexOf(d[0]).toString()}),U=(0,ee.qo)({control:f,name:"time",defaultValue:(0,D.q$)(c).toString()}),q=(0,ee.qo)({control:f,name:"date",defaultValue:(0,D.p6)(o)}),A=(0,ee.qo)({control:f,name:"address",defaultValue:null==v?void 0:v.id}),O=(0,ee.qo)({control:f,name:"portion",defaultValue:(0,ex.w)(h)}),{availableDays:W,selectDaysOptions:G,timesOptions:F}=(0,ev.f)({serviceType:"mealPrep",selectDay:B,time:U,date:q,zipCode:null==M?void 0:null===(s=M.customer)||void 0===s?void 0:null===(a=s.addresses)||void 0===a?void 0:null===(i=a.find(e=>e.id===(null==v?void 0:v.id)))||void 0===i?void 0:i.zipCode}),J=async e=>{let t={weeklyRepeatStartDate:o,weeklyRepeatWeekdays:d,arrivalTime:c,address:v,peopleCount:h},l={selectDay:"weeklyRepeatWeekdays",time:"arrivalTime",date:"weeklyRepeatStartDate",address:"address",portions:"peopleCount"},i=Object.keys(e).reduce((i,a)=>{let s="selectDay"===a&&(0,D.$G)(Number(e[a])).toLocaleLowerCase(),n="time"===a&&(0,T.Z)(new Date(0,0,0,0,Number(e[a])),"HH:mm"),r="date"===a&&(0,T.Z)(new Date(e[a]),"yyyy-MM-dd"),o="portions"===a&&(0,ej.c)(e[a]);switch(a){case"selectDay":s!==t[l[a]][0]&&(i[a]=[s]);break;case"time":n!==t[l[a]]&&(i[a]=n);break;case"date":r!==t[l[a]]&&(i[a]=r);break;case"address":e[a]!==t[l[a]].id&&(i[a]=e[a]);break;case"portions":o!==t[l[a]]&&(i[a]=o)}return i},{address:null,time:null,portions:null,date:null,selectDay:null});await I({variables:{input:{seriesId:r,addressId:i.address,arrivalTime:i.time,peopleCount:i.portions,changeEffectiveDate:i.date,weeklyRepeatWeekdays:i.selectDay}}})},L=async()=>{C(),j(),R.reset()};return(0,m.useEffect)(()=>{let e=document.documentElement;e.style.setProperty("--calendar-primary-color",el.COLORS[p]),e.style.setProperty("--calendar-secondary-color",el.COLORS[(0,ei._)(p)])},[p]),(0,u.jsx)(P.k,{modalId:k.Ti.EditGlobalSettings,title:"Edit Settings",onSaveClickRaw:x(J),afterClose:L,saveButtonTextColor:N.bG.White,saveButtonBackgroundColor:p,saveButtonText:"Request Changes",saveButtonClassName:"helvetica-12-500",cancelButtonText:"Cancel",cancelButtonClassName:"helvetica-12-500",margins:"sm",queryState:R,children:(0,u.jsx)(E.h,{queryState:R,successPrompt:"Your request has been sent.",displayIcon:!1,beforeModalClose:L,children:(0,u.jsxs)("div",{className:"helvetica-14-400 mb-20 flex flex-col",children:[(0,u.jsx)("p",{className:"mb-6 opacity-70 md:mb-10",children:"Our client services team will review any changes with your Culinista chef. Please allow 48 hours for changes to be confirmed and updated in your account."}),(0,u.jsx)("h3",{className:"helvetica-14-500 mb-1",children:"Edit Service Schedule"}),(0,u.jsx)("p",{className:"mb-8 opacity-70 md:mb-6",children:"Our meal prep service recurs weekly. Sunday, Monday, and Tuesday slots are in high demand and may have limited availability. We will do our best to find a time that works for you. The chef will be in your home for 3-4 hours during each service."}),(0,u.jsx)(eo.h,{...b("selectDay",{value:B,onChange:()=>{new Date(o)>tw&&(g("time",""),g("date",""))}}),control:f,options:G,label:"Service Day",showLabel:!!y("selectDay"),hoverColor:(0,ei._)(p),variant:"small",className:"mb-6 w-full",inputClassName:"placeholder:text-opacity-100 placeholder:!helvetica-14-400 !helvetica-14-400",primaryColor:N.bG.CulinistaBlack}),(0,u.jsx)(eo.h,{...b("time",{value:U,onChange:()=>{new Date(o)>tw&&g("date","")}}),control:f,options:F,label:"Time",showLabel:!!y("time"),variant:"small",hoverColor:(0,ei._)(p),className:"mb-6 w-full",inputClassName:"placeholder:text-opacity-100 placeholder:!helvetica-14-400 !helvetica-14-400",primaryColor:N.bG.CulinistaBlack,disabled:!B}),(0,u.jsx)(et.f,{...b("date",{value:q}
1),control:f,availableDates:W,placeholder:"Change Effective Date",label:"Change Effective Date",showLabel:y("date"),className:"mb-16",inputClassName:"!helvetica-14-400 placeholder:!helvetica-14-400",primaryColor:p,disabled:!B||!U||new Date(o)<tw}),(0,u.jsx)("h3",{className:"helvetica-14-500 mb-1",children:"Service Address"}),(0,u.jsx)("p",{className:"mb-6 opacity-70",children:"Choose from your saved addresses."}),(0,u.jsx)(eo.h,{...b("address",{value:A}),control:f,options:Z,label:"Address",showLabel:!!y("address"),variant:"small",hoverColor:(0,ei._)(p),className:"mb-16 w-full",inputClassName:"placeholder:text-opacity-100 placeholder:!helvetica-14-400 !helvetica-14-400",primaryColor:N.bG.CulinistaBlack}),(0,u.jsx)("h3",{className:"helvetica-14-500 mb-1",children:"Meal Prep Size"}),(0,u.jsx)("p",{className:"mb-6 opacity-70",children:"Your Culinista chef will use this information to guide their shopping and cooking for your household. Your service fee will not change based on your selection, but the cost of groceries will adjust accordingly. You may request a larger or smaller portion of any dish, regardless of your selection here."}),(0,u.jsx)(eo.h,{...b("portions",{value:O}),control:f,options:w.t4,label:"Size",showLabel:!!y("portions"),variant:"small",hoverColor:(0,ei._)(p),className:"w-full",inputClassName:"placeholder:text-opacity-100 placeholder:!helvetica-14-400 !helvetica-14-400",primaryColor:N.bG.CulinistaBlack})]})})})}let tk=(0,ea.Ry)().shape({startDate:(0,ea.hT)().required("Start date is required").typeError("Start date is required")});function tN(e){let{id:t,weeklyRepeatStartDate:l,weeklyRepeatEndDate:i,nextServiceDate:a,startTime:s,primaryColor:n}=e,[r,o]=(0,S.Pxd)({refetchQueries:[S.GGp,S.toe]}),{handleSubmit:d,register:c,control:v,watch:h,reset:p,resetField:x}=(0,ee.cI)({resolver:(0,es.X)(tk)}),{clearSeriesToPause:b}=(0,k.ws)(),f=(0,ee.qo)({control:v,name:"startDate"}),y=(0,ee.qo)({control:v,name:"endDate"}),g=async e=>{var l;await r({variables:{input:{seriesId:t,weeklyRepeatPauseEndDate:(null==e?void 0:e.endDate)?(0,T.Z)(new Date(e.endDate),"yyyy-MM-dd"):null,weeklyRepeatPauseStartDate:(null==e?void 0:e.startDate)?(0,T.Z)(new Date(e.startDate),"yyyy-MM-dd"):null,pauseReasoning:(null===(l=w.Gs.find(t=>t.value===(null==e?void 0:e.pauseReason)))||void 0===l?void 0:l.label)||null}}})},j=async()=>{b(),p(),o.reset()};return(0,m.useEffect)(()=>{let e=document.documentElement;e.style.setProperty("--calendar-primary-color",el.COLORS[n]),e.style.setProperty("--calendar-secondary-color",el.COLORS[(0,ei._)(n)])},[n]),(0,u.jsx)(P.k,{modalId:k.Ti.PauseService,title:"Pause Service",onSaveClickRaw:d(g),afterClose:j,saveButtonTextColor:N.bG.White,saveButtonBackgroundColor:n,saveButtonText:"Save Changes",saveButtonClassName:"helvetica-12-500",cancelButtonText:"Cancel",cancelButtonClassName:"helvetica-12-500",margins:"sm",queryState:o,children:(0,u.jsx)(E.h,{queryState:o,successPrompt:"Your service will pause on ".concat(h("startDate")?(0,T.Z)(new Date(h("startDate")),"MMMM d, yyyy"):"",".").concat(h("endDate")?" It will resume on ".concat((0,T.Z)(new Date(h("endDate")),"MMMM d, yyyy"),"."):""),displayIcon:!1,beforeModalClose:j,children:(0,u.jsxs)("div",{className:"helvetica-14-400 mb-20 flex flex-col opacity-70",children:[(0,u.jsxs)("p",{className:"mb-8 max-w-[426px] md:mb-6",children:[(0,u.jsx)("span",{children:"To suspend your weekly meal prep service, please enter the fields below."}),48>+I(a,s)&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("br",{}),(0,u.jsx)("br",{}),(0,u.jsx)("span",{children:"Please note that if you're pausing within 48 hours of your next service you will still be billed for your next service."})]})]}),(0,u.jsx)(et.f,{...c("startDate",{value:f,onChange:()=>x("endDate")}),control:v,placeholder:"Pause Date",label:"Pause Date",showLabel:h("startDate"),primaryColor:n,className:"mb-8",minDate:l?new Date(l):null,maxDate:i?new Date(i):null}),(0,u.jsx)(et.f,{...c("endDate",{value:y}),control:v,placeholder:"Resume Date (Optional)",label:"Resume Date (Optional)",showLabel:h("endDate"),primaryColor:n,className:"mb-16",minDate:new Date(f),maxDate:i?new Date(i):null,disabled:!f}),(0,u.jsx)("p",{className:"mb-8 md:mb-10",children:"Let us know why you're pausing your service:"}),(0,u.jsx)("ul",{className:"flex flex-col gap-6",children:w.Gs.map(e=>(0,u.jsx)("li",{children:(0,m.createElement)(eC.a,{...c("pauseReason"),id:e.value,key:e.value,additionalLabelClassName:"helvetica-14-400",labelClassName:"w-full",variant:"small",...e})},e.value))})]})})})}var tS=l(45655);function tT(e,t){(0,tu.Z)(1,arguments);var l,i,a,s=(0,tm.Z)(null!==(l=null==t?void 0:t.additionalDigits)&&void 0!==l?l:2);if(2!==s&&1!==s&&0!==s)throw RangeError("additionalDigits must be 0, 1 or 2");if(!("string"==typeof e||"[object String]"===Object.prototype.toString.call(e)))return new Date(NaN);var n=function(e){var t,l={},i=e.split(tD.dateTimeDelimiter);if(i.length>2)return l;if(/:/.test(i[0])?t=i[0]:(l.date=i[0],t=i[1],tD.timeZoneDelimiter.test(l.date)&&(l.date=e.split(tD.timeZoneDelimiter)[0],t=e.substr(l.date.length,e.length))),t){var a=tD.timezone.exec(t);a?(l.time=t.replace(a[1],""),l.timezone=a[1]):l.time=t}return l}(e);if(n.date){var r=function(e,t){var l=RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(l);if(!i)return{year:NaN,restDateString:""};
1var a=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:null===s?a:100*s,restDateString:e.slice((i[1]||i[2]).length)}}(n.date,s);i=function(e,t){if(null===t)return new Date(NaN);var l,i,a=e.match(tM);if(!a)return new Date(NaN);var s=!!a[4],n=tP(a[1]),r=tP(a[2])-1,o=tP(a[3]),d=tP(a[4]),c=tP(a[5])-1;if(s)return d>=1&&d<=53&&c>=0&&c<=6?((l=new Date(0)).setUTCFullYear(t,0,4),i=l.getUTCDay()||7,l.setUTCDate(l.getUTCDate()+((d-1)*7+c+1-i)),l):new Date(NaN);var u=new Date(0);return r>=0&&r<=11&&o>=1&&o<=(tZ[r]||(tB(t)?29:28))&&n>=1&&n<=(tB(t)?366:365)?(u.setUTCFullYear(t,r,Math.max(n,o)),u):new Date(NaN)}(r.restDateString,r.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var o=i.getTime(),d=0;if(n.time&&isNaN(d=function(e){var t=e.match(tI);if(!t)return NaN;var l=tE(t[1]),i=tE(t[2]),a=tE(t[3]);return(24===l?0===i&&0===a:a>=0&&a<60&&i>=0&&i<60&&l>=0&&l<25)?l*td.vh+i*td.yJ+1e3*a:NaN}(n.time)))return new Date(NaN);if(n.timezone){if(isNaN(a=function(e){if("Z"===e)return 0;var t=e.match(tR);if(!t)return 0;var l="+"===t[1]?-1:1,i=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return a>=0&&a<=59?l*(i*td.vh+a*td.yJ):NaN}(n.timezone)))return new Date(NaN)}else{var c=new Date(o+d),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(o+d+a)}var tD={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},tM=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,tI=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,tR=/^([+-])(\d{2})(?::?(\d{2}))?$/;function tP(e){return e?parseInt(e):1}function tE(e){return e&&parseFloat(e.replace(",","."))||0}var tZ=[31,null,31,30,31,30,31,31,30,31,30,31];function tB(e){return e%400==0||e%4==0&&e%100!=0}let tU=new Date,tq=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function tA(e){let{id:t,weeklyRepeatPauseStartDate:l,weeklyRepeatPauseEndDate:i,weeklyRepeatWeekdays:a,nextServiceDate:s,startTime:n,primaryColor:r}=e,[o,d]=(0,S.d3I)({refetchQueries:[S.GGp,S.toe]}),{clearSeriesToUnPause:c}=(0,k.ws)(),v=async()=>{await o({variables:{input:{seriesId:t}}})},m=async()=>{c(),d.reset()};return(0,u.jsx)(P.k,{modalId:k.Ti.UnPauseService,title:"Unpause Service",onSaveClickRaw:v,afterClose:m,saveButtonTextColor:N.bG.White,saveButtonBackgroundColor:r,saveButtonText:"Save Changes",saveButtonClassName:"helvetica-12-500",cancelButtonText:"Cancel",cancelButtonClassName:"helvetica-12-500",margins:"sm",queryState:d,children:(0,u.jsx)(E.h,{queryState:d,successPrompt:"Your meal prep has been unpaused.",displayIcon:!1,beforeModalClose:m,children:(0,u.jsx)("div",{className:"helvetica-14-400 mb-44 opacity-70",children:(0,u.jsx)("p",{children:new Date(s)<=new Date(l)||new Date(s)>new Date(l)&&+I((()=>{let e=((0,tS.Z)(tU)+2)%7,t=tq.indexOf(null==a?void 0:a[0]);return(0,T.Z)(new Date(tU.getTime()+864e5*Math.abs(t-e)),"yyyy-MM-dd")})(),n)>48?(0,u.jsxs)(u.Fragment,{children:[" ",(0,u.jsx)("span",{children:"Your service is paused from ".concat(l?(0,T.Z)(tT(l),"MMMM d, yyyy"):"").concat(i?" to ".concat((0,T.Z)(tT(i),"MMMM d, yyyy")):"",".")}),(0,u.jsx)("span",{children:" Are you sure you want to unpause your service?"})]}):(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("span",{children:[" ","Since your service is within 48 hours, we cannot guarantee chef availability. Please email"," ",(0,u.jsx)(p(),{href:"mailto:[email protected]",children:"[email protected]"})," to see if we can make a last minute accommodation for your service."]})})})})})})}let tO=new Date;function tW(e){var t;let{serviceType:l}=e,{serviceToCancel:i,serviceToSkip:a,seriesToPause:s,serviceToEdit:n,serviceToUnSkip:r,serviceToReview:o,seriesToEdit:d,seriesToUnPause:c}=(0,k.S9)(),{setAllFavoriteDishesIds:v,setAllFavoriteMenusIds:h}=(0,k.ws)(),{data:p,loading:x,error:b}=(0,S.O_c)({fetchPolicy:"network-only",skip:![S.UW4.MealPrep,S.UW4.Placement].includes(l),variables:{input:{serviceType:l}}}),{data:f,loading:y,error:g,fetchMore:j}=(0,S.N66)({fetchPolicy:"network-only",variables:{input:{serviceDateLessThan:new Date(new Date(tO).setMonth(new Date(tO).getMonth()+12)),serviceDateGreaterThan:new Date(tO),serviceType:l||void 0}}}),{data:T,loading:D,error:M,fetchMore:I}=(0,S.N66)({fetchPolicy:"network-only",variables:{input:{serviceDateLessThan:new Date(tO),serviceDateGreaterThan:new Date(new Date(tO).setMonth(new Date(tO).getMonth()-12)),serviceType:l||void 0}}});(0,S.D_9)({fetchPolicy:"network-only",onCompleted:e=>{var t,l;h((null==e?void 0:null===(l=e.customer)||void 0===l?void 0:null===(t=l.favoriteMenus)||void 0===t?void 0:t.map(e=>e.menuId))||[])}}),(0,S.q00)({fetchPolicy:"network-only",onCompleted:e=>{var t,l;v((null==e?void 0:null===(l=e.customer)||void 0===l?void 0:null===(t=l.favoriteDishes)||void 0===t?void 0:t.map(e=>e.dishId))||[])}});let R=f||T,P=y||D,E=g||M,U=(0,m.useMemo)(()=>{var e;let t=(null==f?void 0:null===(e=f.serviceList)||void 0===e?void 0:e.items)||[];return 0===t.length?[]:t.map(e=>{var t,l;let{__typename:i,serviceStatus:a,...s}=e;return{...s,title:null==e?void 0:e.customServiceName,serviceStatus:(0,eI.Y)({serviceStatus:a,serviceType:null==e?void 0:e.serviceType,isDishesSelected:(null==e?void 0:null===(t=e.dishes)||void 0===t?void 0:t.length)>=6,isEditDisabled:(0,eR.s)(null==e?void 0:e.serviceType,null==e?void 0:e.serviceDate,null==e?void 0:e.startTime,(null==e?void 0:e.serviceType)===S.UW4.MealPrep?24:void 0),isChefSelected:(null==e?void 0:null===(l=e.assignedChefs)||void 0===l?void 0:l.length)>0})}})},[f]),q=(0,m.useMemo)(()=>{var e;let t=(null==T?void 0:null===(e=T.serviceList)||void 0===e?void 0:e.items)||[];return 0===t.length?[]:t.map(e=>{var t,l;let{__typename:i,serviceStatus:a,...s}=e;return{...s,serviceStatus:(0,eI.Y)({serviceStatus:a,serviceType:null==e?void 0:e.serviceType,isDishesSelected:(null==e?void 0:null===(t=e.dishes)||void 0===t?void 0:t.length)>=6,isEditDisabled:(0,eR.s)(null==e?void 0:e.serviceType,null==e?void 0:e.serviceDate,null==e?void 0:e.startTime,(null==e?void 0:e.serviceType)===S.UW4.MealPrep?24:void 0),isChefSelected:(null==e?void 0:null===(l=e.assignedChefs)||void 0===l?void 0:l.length)>0})}})},[T]),A=(0,m.useMemo)(()=>{let e=U.sort((e,t)=>
1{let l=new Date(e.serviceDate).getTime(),i=new Date(t.serviceDate).getTime();return Math.abs(l-tO.getTime())-Math.abs(i-tO.getTime())}).filter(e=>e.serviceStatus!==ef.J.Cancelled);return null==e?void 0:e[0]},[U]),O=l?w.vL[l]:"Your Services",W=l?w.UH[l]:N.bG.Navy,G=(0,m.useMemo)(()=>{var e;return(null==p?void 0:null===(e=p.seriesList)||void 0===e?void 0:e.items)||[]},[p]);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(B.f,{title:O}),(0,u.jsxs)(C.e,{children:[(0,u.jsx)("h1",{className:(0,eT.cn)("editorial-32 md:editorial-38 mb-8",{"md:mb-10":0===G.length}),children:O}),x||b?(0,u.jsxs)("div",{className:"mb-12 flex items-center justify-center xl:mb-16",children:[x&&(0,u.jsx)(Q.U,{size:"medium"}),b&&(0,u.jsx)("div",{children:(0,eB.i)(b)||"Something went wrong."})]}):(0,u.jsx)(u.Fragment,{children:null==G?void 0:null===(t=G.filter(e=>![S.v0p.Canceled,S.v0p.Ended,S.v0p.EndScheduled,S.v0p.Inactive].includes(e.seriesStatus)))||void 0===t?void 0:t.map(e=>(0,u.jsx)(ty,{series:e,variant:l},e.id))}),!x&&(P||E)&&(0,u.jsxs)("div",{className:"flex items-center justify-center",children:[P&&(0,u.jsx)(Q.U,{size:"medium"}),E&&(0,u.jsx)("div",{children:(0,eB.i)(E)||"Something went wrong."})]}),R&&!P&&!E&&(0,u.jsxs)(u.Fragment,{children:[A&&(0,u.jsx)(e9,{className:"mb-[60px] md:mb-[84px]",nextService:A}),(0,u.jsx)(ti,{upcomingServices:U.filter(e=>e.id!==(null==A?void 0:A.id)),pastServices:q,fetchMoreUpcomingServicesData:j,fetchMorePastServicesData:I,currentDate:tO,serviceType:l})]})]}),(0,u.jsx)(Z,{id:null==i?void 0:i.id,date:null==i?void 0:i.serviceDate,serviceType:null==i?void 0:i.serviceType,peopleCount:null==i?void 0:i.peopleCount,arrivalTime:null==i?void 0:i.arrivalTime,startTime:null==i?void 0:i.startTime,address:null==i?void 0:i.address,primaryColor:W}),(null==d?void 0:d.id)&&(0,u.jsx)(tC,{id:null==d?void 0:d.id,weeklyRepeatStartDate:null==d?void 0:d.weeklyRepeatStartDate,weeklyRepeatWeekdays:null==d?void 0:d.weeklyRepeatWeekdays,arrivalTime:null==d?void 0:d.arrivalTime,address:null==d?void 0:d.address,peopleCount:null==d?void 0:d.peopleCount,primaryColor:W}),(null==n?void 0:n.serviceId)&&(0,u.jsx)(eh,{serviceId:null==n?void 0:n.serviceId,peopleCount:null==n?void 0:n.peopleCount,serviceDate:null==n?void 0:n.serviceDate,arrivalTime:null==n?void 0:n.arrivalTime,startTime:null==n?void 0:n.startTime,address:null==n?void 0:n.address,primaryColor:W}),(0,u.jsx)(tN,{id:null==s?void 0:s.id,weeklyRepeatStartDate:null==s?void 0:s.weeklyRepeatStartDate,weeklyRepeatEndDate:null==s?void 0:s.weeklyRepeatEndDate,nextServiceDate:null==s?void 0:s.nextServiceDate,startTime:null==s?void 0:s.startTime,primaryColor:W}),(0,u.jsx)(ek,{id:null==a?void 0:a.id,date:null==a?void 0:a.serviceDate,startTime:null==a?void 0:a.startTime,primaryColor:W}),(0,u.jsx)(eP,{id:null==r?void 0:r.id,date:null==r?void 0:r.serviceDate,startTime:null==r?void 0:r.startTime,primaryColor:W}),(0,u.jsx)(eS,{primaryColor:W,serviceId:null==o?void 0:o.serviceId,feedback:null==o?void 0:o.review}),(0,u.jsx)(tA,{id:null==c?void 0:c.id,weeklyRepeatPauseStartDate:null==c?void 0:c.weeklyRepeatPauseStartDate,weeklyRepeatPauseEndDate:null==c?void 0:c.weeklyRepeatPauseEndDate,weeklyRepeatWeekdays:null==c?void 0:c.weeklyRepeatWeekdays,nextServiceDate:null==c?void 0:c.nextServiceDate,startTime:null==c?void 0:c.startTime,primaryColor:W})]})}var tG=!0;function tF(e){let{serviceSlug:t,...l}=e;return t?(0,u.jsx)(eA,{serviceSlug:t,...l}):(0,u.jsx)(tW,{serviceSlug:t,...l})}tF.Layout=v.X}},function(e){e.O(0,[7249,2888,9774,179],function(){return e(e.s=60805)}),_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.