PageSourceSearch

https://www.stamford-eats.co.uk/_next/static/chunks/850-89c111110deca8a7.js

js stamford-eats.co.uk collected 2026-10-02 01:12:41 UTC 90,963 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[850],{56330:function(e,t,n){"use strict";n.d(t,{S:function(){return eM}});var l=n(85893),i=n(24761),r=n(83663),o=n(14091),a=n(91514),s=n(11949),d=n(51906),c=n(95249),u=n(2516),p=n(85551),h=n(67294),m=n(43644),v=n(50561),y=n(82057),g=n(93411),f=n(99e3),b=n(69166),x=n(83846),j=n(95858),C=n(87076),Z=n(74873),w=n(97454),_=n(22825),S=n(52675),N=n(89204),T=n(60486);let I=e=>{if(e.length>0){let t=(0,T.Mh)(e),n=e.find(e=>"coordinates"===e.fieldName);return{address:t,coordinates:(0,T.xN)(null==n?void 0:n.fieldValue)}}return{address:"",coordinates:null}};var P=n(36422),E=n(97845),M=n(55493),k=n(43807),A=n(22971),L=n(6644),O=n.n(L);function R(e){let{isLoading:t,isSkeletonLoading:n,selectedService:i,specialInstructions:o,handleInstructionsChange:a}=e,{t:d}=(0,s.q)(),{isModalOpen:c,handleOpenModal:m,handleCloseModal:v}=(0,_.X)(),[g]=(0,A.Z)(),f=(0,x.K9)(null==i?void 0:i.orderType),b=d(f?"label.add.delivery.instructions":"label.add.order.notes");return((0,h.useEffect)(()=>{g.resetFields()},[i]),n)?(0,l.jsx)(u.Z,{className:O().container,children:(0,l.jsx)(E.Z.Button,{active:!0,size:"large",shape:"default",block:!0,style:{width:"100%"}})}):(0,l.jsxs)(u.Z,{className:O().container,children:[(0,l.jsxs)(u.Z,{justify:"space-between",align:"center",style:{width:"100%"},children:[(0,l.jsxs)(u.Z,{gap:8,justify:"center",align:"center",children:[(0,l.jsx)(P.Z,{style:{fontSize:20}}),(0,l.jsx)(y._,{children:o||b})]}),(0,l.jsx)(p.ZP,{icon:(0,l.jsx)(j.Z,{}),onClick:m,disabled:t,children:d("label.link.edit")})]}),(0,l.jsx)(C.Z,{centered:!0,open:c,styles:{content:{maxWidth:640}},footer:null,title:(0,l.jsx)(r.F,{level:4,children:d(f?"label.delivery.instructions":"label.order.notes")}),onCancel:v,children:(0,l.jsxs)(M.Z,{layout:"vertical",labelAlign:"left",form:g,onFinish:e=>{let{instructions:t}=e;a(t),v()},initialValues:{instructions:o},children:[(0,l.jsx)("p",{children:d(f?"label.delivery.instructions.message":"label.order.notes.instructions.message")}),(0,l.jsxs)(u.Z,{vertical:!0,gap:24,children:[(0,l.jsx)(u.Z,{vertical:!0,gap:4,children:(0,l.jsx)(M.Z.Item,{required:!1,label:(0,l.jsxs)(y._,{strong:!0,children:[d("label.delivery.instructions.add.your.note")," ",d("label.optional")]}),name:"instructions",children:(0,l.jsx)(k.Z.TextArea,{placeholder:f?d("label.delivery.instructions.input.placeholder").toString():d("label.order.notes.input.placeholder").toString(),autoSize:{minRows:4,maxRows:4}})})}),(0,l.jsx)(u.Z,{justify:"end",children:(0,l.jsx)(p.ZP,{htmlType:"submit",type:"primary",size:"large",children:d("label.button.save")})})]})]})})]})}var F=n(8213),D=n(37054),B=n(9895),U=n.n(B);let z=(0,h.memo)(function(e){let{coordinates:t,branchCoordinates:n,orderType:i}=e,r=(0,x.K9)(i)?t:null;return(0,l.jsx)(u.Z,{vertical:!0,gap:12,children:(0,l.jsx)(u.Z,{vertical:!0,gap:8,className:U().container,children:n&&(0,l.jsxs)(F.P,{mapContainerClassName:U().map,center:n,options:{streetViewControl:!1,mapTypeControl:!1,fullscreenControl:!1},zoom:13,children:[(()=>{if(r&&r.lat&&r.lng)return(0,l.jsx)(D.jC,{position:r,icon:{url:"customer-maker.svg"}},"".concat(r.lat,"-").concat(r.lng,"-").concat(Date.now()))})(),(()=>{if(n&&n.lat&&n.lng)return(0,l.jsx)(D.jC,{position:n,icon:{url:"marker.svg"}},"".concat(n.lat,"-").concat(n.lng,"-").concat(Date.now()))})()]})})})});var V=n(44588),q=n(6955),G=n(2558),H=n.n(G);function K(e){let{isLoading:t,isSkeletonLoading:n,phoneNumber:i,isModalPhoneOpen:o,onPhoneNumberChange:a,handleOpenModalPhone:d,handleCloseModalPhone:c}=e,{t:h}=(0,s.q)(),m=async e=>{let{phone:t}=e,n=(0,x.un)(t);await a(n)};return n?(0,l.jsx)(u.Z,{className:H().container,children:(0,l.jsx)(E.Z.Button,{active:!0,size:"large",shape:"default",block:!0,style:{width:"100%"}})}):(0,l.jsxs)(u.Z,{className:H().container,children:[(0,l.jsxs)(u.Z,{justify:"space-between",align:"center",style:{width:"100%"},children:[(0,l.jsxs)(u.Z,{gap:8,justify:"center",align:"center",children:[(0,l.jsx)(V.q,{style:{fontSize:20}}),(0,l.jsx)(y._,{children:i})]}),(0,l.jsx)(p.ZP,{icon:(0,l.jsx)(j.Z,{}),onClick:d,disabled:t,children:h("label.link.edit")})]}),(0,l.jsx)(C.Z,{centered:!0,destroyOnHidden:!0,open:o,styles:{content:{maxWidth:375}},footer:null,title:(0,l.jsx)(r.F,{level:4,children:h("label.phone.edit")}),onCancel:c,children:(0,l.jsx)(M.Z,{layout:"vertical",labelAlign:"left",onFinish:m,initialValues:{phone:i},requiredMark:"optional",children:(0,l.jsxs)(u.Z,{vertical:!0,gap:16,children:[(0,l.jsx)(M.Z.Item,{name:"phone",rules:[{required:!0,message:h("phone.required")},{validator:x.tH,message:h("phone.invalid")}],children:(0,l.jsx)(q.Z,{enableSearch:!0,size:"large",disableParentheses:!0})}),(0,l.jsxs)(u.Z,{justify:"end",gap:12,children:[(0,l.jsx)(p.ZP,{size:"large",onClick:c,disabled:t,children:h("label.button.cancel")}),(0,l.jsx)(p.ZP,{type:"primary",size:"large",htmlType:"submit",loading:t,children:h("label.button.save")})]})]})})})]})}var Y=n(10042),W=n(89287),J=n(14733),X=n(93974),Q=n.n(X);function $(e){let{handleOpenModal:t,isGuest:n=!1}=e,{t:i}=(0,s.q)(),{isTablet:o}=(0,g.p)(),{colorError:a}=(0,Y.F)();return(0,l.jsxs)(u.Z,{className:Q()["no-address"],justify:"space-between",vertical:!0,gap:8,style:{backgroundColor:"var(--ant-checkout-section-background-color, var(--ant-main-background-color, #fafafa))",padding:16,borderRadius:8},children:[!n&&(0,l.jsxs)(u.Z,{gap:8,align:"center",children:[(0,l.jsx)(W.Z,{style:{color:a,fontSize:20}}),(0,l.jsx)(r.F,{level:5,className:"text-left",style:{color:a,margin:0},children:i("label.no.delivery.address")})]}),(0,l.jsx)(u.Z,{justify:"end",children:(0,l.jsx)(p.ZP,{icon:(0,l.jsx)(J.Z,{}),style:{width:o?"fit-content":"100%"},onClick:t,children:i("label.link.addaddress")})})]})}function ee(e){let{isLoading:t,isSkeletonLoading:n,shoppingCart:i,selectedService:a,updateShoppingCart:d,updateShoppingCartAddress:c}=e,{isPhoneNumberLoading:T,isNoAddress:P,deliveryAddress:E,isModalOpen:M,isModalPhoneOpen:k,specialInstructions:A,phoneNumber:L,branchName:O,branchAddress:F,handleOpenModal:D,handleOpenModalPhone:B,handleCloseModal:U,handleCloseModalPhone:V,handleAddressChange:q,handleInstructionsChange:G,handlePhoneNumberChange:H}=function(e){var t,n,l,i,r;let{shoppingCart:a,selectedService:s,updateShoppingCart:d,updateShoppingCartAddress:c}=e,{isModalOpen:u,handleOpenModal:p,handleCloseModal:m}=(0,_.X)(),v=(0,o.l)(),{isModalOpen:y,handleOpenModal:g,handleCloseModal:f}=(0,_.X)(),{customer:b,setCustomer:x}=(0,N.Z)(e=>e),{branch:j}=(0,S.Z)(e=>e),{mutateAsync:C,isPending:T}=(0,Z.B)(),{getBranchCoordinates:P,getBranchAddress:E}=(0,w.v)(),M=null!==(n=null==b?void 0:b.addresses)&&void 0!==n?n:[],k=null!==(l=null==a?void 0:null===(t=a.shoppingCartAddress)||void 0===t?void 0:t.shoppingCartAddressFields)&&void 0!==l?l:[],A=null!==(i=null==a?void 0:a.specialInstructions)&&void 0!==i?i:"",L=0===M.length&&0===k.length,O=null!==(r=null==b?void 0:b.phone)&&void 0!==r?r:"",R=(0,h.useMemo)(()=>I(k),[k]),F=(0,h.useMemo)(()=>{let e=P(j);return{address:E(null!=j?j:void 0),coordinates:e}},[j]),D=(0,h.useCallback)(async e=>{await c(e),m()},[c,m]),B=(0,h.useCallback)(async e=>{await d({specialInstructions:e},{flow:v})},[v,d]),U=(0,h.useCallback)(async e=>{b&&b.id&&await C({phone:e},{onSuccess:e=>{x(e),f()}})},[C,x,f,b]);return{isPhoneNumberLoading:T,isNoAddress:L,deliveryAddress:R,selectedService:s,specialInstructions:A,phoneNumber:O,isModalOpen:u,isModalPhoneOpen:y,branchName:null==j?void 0:j.name,branchAddress:F,handleOpenModal:p,handleOpenModalPhone:g,handleCloseModal:m,handleCloseModalPhone:f,handleAddressChange:D,handleInstructionsChange:B,handlePhoneNumberChange:U}}({shoppingCart:i,updateShoppingCart:d,updateShoppingCartAddress:c,selectedService:a}),{t:Y}=(0,s.q)(),{isDesktop:W,isSmallMobile:J}=(0,g.p)(),X=(0,x.K9)(null==a?void 0:a.orderType),ee=(0,x.XJ)(null==a?void 0:a.orderType),et=(null==a?void 0:a.orderType)===b.m["EAT-IN"],en=X?null==E?void 0:E.address:null==F?void 0:F.address,el=X||ee,ei=(0,h.useMemo)(()=>J?350:600,[J]);return(0,l.jsxs)(u.Z,{vertical:!0,gap:12,children:[el&&(0,l.jsx)(m.B,{title:Y(X?"label.deliver.to":"label.pickup.at")}),(0,l.jsxs)(u.Z,{vertical:!0,gap:12,children:[el&&(X?P?(0,l.jsx)($,{handleOpenModal:D}):(0,l.jsxs)(u.Z,{vertical:!0,className:Q().info,gap:12,children:[(0,l.jsx)(z,{coordinates:null==E?void 0:E.
1coordinates,branchCoordinates:null==F?void 0:F.coordinates,orderType:null==a?void 0:a.orderType}),(0,l.jsxs)(u.Z,{className:Q().info,justify:"space-between",align:"center",children:[(0,l.jsxs)(u.Z,{gap:8,children:[(0,l.jsx)(f.Zl,{}),(0,l.jsx)(r.F,{level:5,className:Q().label,children:en})]}),(0,l.jsx)(p.ZP,{icon:(0,l.jsx)(j.Z,{}),onClick:D,children:Y("label.link.edit")})]})]}):(0,l.jsxs)(u.Z,{vertical:!0,className:Q().info,gap:12,children:[(0,l.jsx)(z,{coordinates:null==E?void 0:E.coordinates,branchCoordinates:null==F?void 0:F.coordinates,orderType:null==a?void 0:a.orderType}),(0,l.jsx)(u.Z,{className:Q().info,justify:"space-between",align:"center",children:(0,l.jsxs)(u.Z,{gap:8,justify:"start",align:"start",children:[(0,l.jsx)(f.Zl,{}),(0,l.jsxs)(u.Z,{vertical:!0,children:[(0,l.jsx)(r.F,{level:5,className:Q().label,children:O}),(0,l.jsx)(y._,{children:null==F?void 0:F.address})]})]})})]})),(0,l.jsxs)(u.Z,{vertical:!0,gap:12,children:[(0,l.jsx)(R,{isLoading:t,isSkeletonLoading:n,selectedService:a,specialInstructions:A,handleInstructionsChange:G}),!et&&(0,l.jsx)(K,{isLoading:t||T,isSkeletonLoading:n,phoneNumber:L,isModalPhoneOpen:k,onPhoneNumberChange:H,handleOpenModalPhone:B,handleCloseModalPhone:V})]})]}),(0,l.jsx)(C.Z,{className:Q().modal,centered:!0,open:M,styles:{content:{maxWidth:800,width:W?800:"auto",padding:"48px 24px 24px 24px",minWidth:ei}},footer:null,onCancel:U,children:(0,l.jsx)(u.Z,{style:{width:"100%"},justify:"center",vertical:!0,gap:12,children:(0,l.jsx)(v.o,{onAddressChange:q,isInsideModal:!0})})})]})}var et=n(85789),en=n(46835),el=n(37521),ei=n(7292),er=n(50820),eo=n(99290),ea=n(45057),es=n.n(ea);function ed(e){var t;let{shoppingCart:n,updateShoppingCart:i,updateShoppingCartAddress:o,selectedService:a,isLoading:d,isSkeletonLoading:c}=e,{t:v}=(0,s.q)(),{isDesktop:b,isSmallMobile:Z}=(0,g.p)(),{form:N,isModalOpen:T,isMapService:P,isZipCode2NoGeo:E,addressFieldRules:k,isNoAddress:A,deliveryAddress:L,branchAddress:O,branchName:F,positionMap:D,positionMarker:B,address:U,predictions:V,formData:q,onSearchAddressValueChange:G,onPredictionSelect:H,onMapClick:K,onSave:Y,handleOpenAddressModal:W,handleCloseModal:J}=function(e){var t,n;let{shoppingCart:l,updateShoppingCartAddress:i}=e,[r]=M.Z.useForm(),{isModalOpen:o,handleOpenModal:a,handleCloseModal:s}=(0,_.X)(),{branch:d}=(0,S.Z)(e=>e),c=(0,er.Z)(e=>e.company),{getBranchCoordinates:u,getBranchAddress:p}=(0,w.v)(),{data:m}=(0,ei._)(null==c?void 0:c.id),v=(0,h.useMemo)(()=>{var e;return null==m?void 0:null===(e=m.addressFieldRules)||void 0===e?void 0:e.filter(e=>"text"===e.userInterfaceType)},[null==m?void 0:m.addressFieldRules]),{positionMap:y,positionMarker:g,isMapService:f,isZipCode2NoGeo:b,address:x,predictions:j,onSearchAddressValueChange:C,onPredictionSelect:Z,onMapClick:N,resetPosition:T}=(0,en.h)(r),{processPostCodeIfNeeded:P}=(0,el.T)(r),E=(0,h.useMemo)(()=>{var e,t;return null!==(t=null==l?void 0:null===(e=l.shoppingCartAddress)||void 0===e?void 0:e.shoppingCartAddressFields)&&void 0!==t?t:[]},[null==l?void 0:null===(t=l.shoppingCartAddress)||void 0===t?void 0:t.shoppingCartAddressFields]),k=(0,h.useMemo)(()=>I(E),[E]),A=(0,h.useMemo)(()=>{let e=u(d);return{address:p(null!=d?d:void 0),coordinates:e}},[d,p,u]),L=!(null==E?void 0:E.length)||!k.address,O=(0,h.useCallback)(()=>{0===E.length&&(r.resetFields(),T()),a()},[r,T,a,E]),R=(0,h.useMemo)(()=>{if(0!==E.length)return E.reduce((e,t)=>({...e,[t.fieldName]:t.fieldValue}),{})},[E]),F=(0,h.useCallback)(()=>{r.resetFields(),s()},[r,s]),D=(0,h.useCallback)(async e=>{let t=await P(e,b,v);if(!t)return;let n=null==v?void 0:v.map(e=>{var n;return{id:null,fieldName:e.fieldName,label:e.label,fieldValue:null!==(n=t[e.fieldName])&&void 0!==n?n:"",addressId:null}});await i({addressFields:n},{flow:null==l?void 0:l.flow}),n&&(null==l?void 0:l.branchId)&&(0,eo.Zj)(l.branchId,n),s()},[v,b,P,i,null==l?void 0:l.branchId,null==l?void 0:l.flow,s]);return{form:r,isModalOpen:o,isMapService:f,isZipCode2NoGeo:b,addressFieldRules:v,isNoAddress:L,deliveryAddress:k,branchAddress:A,branchName:null!==(n=null==d?void 0:d.name)&&void 0!==n?n:"",positionMap:y,positionMarker:g,address:x,predictions:j,formData:R,onSearchAddressValueChange:C,onPredictionSelect:Z,onMapClick:N,onSave:D,handleOpenAddressModal:O,handleCloseModal:F}}({shoppingCart:n,updateShoppingCartAddress:o}),X=(0,x.K9)(null==a?void 0:a.orderType),Q=(0,x.XJ)(null==a?void 0:a.orderType),ee=X||Q,ea=(0,h.useMemo)(()=>Z?350:600,[Z]);return(0,l.jsxs)(u.Z,{vertical:!0,gap:12,children:[ee&&(0,l.jsx)(m.B,{title:v(X?"label.deliver.to":"label.pickup.at")}),ee&&(X?A?(0,l.jsx)($,{handleOpenModal:W,isGuest:!0}):(0,l.jsxs)(u.Z,{vertical:!0,className:es().info,gap:12,children:[L.coordinates&&O.coordinates&&(0,l.jsx)(z,{coordinates:L.coordinates,branchCoordinates:O.coordinates,orderType:null==a?void 0:a.orderType}),(0,l.jsxs)(u.Z,{className:es().info,justify:"space-between",align:"center",children:[(0,l.jsxs)(u.Z,{gap:8,children:[(0,l.jsx)(f.Zl,{}),(0,l.jsx)(r.F,{level:5,className:es().label,children:L.address})]}),(0,l.jsx)(p.ZP,{icon:(0,l.jsx)(j.Z,{}),onClick:W,disabled:d,children:v("label.link.edit")})]})]}):(0,l.jsxs)(u.Z,{vertical:!0,className:es().info,gap:12,children:[(0,l.jsx)(z,{coordinates:L.coordinates,branchCoordinates:O.coordinates,orderType:null==a?void 0:a.orderType}),(0,l.jsx)(u.Z,{className:es().info,justify:"space-between",align:"center",children:(0,l.jsxs)(u.Z,{gap:8,justify:"start",align:"start",children:[(0,l.jsx)(f.Zl,{}),(0,l.jsxs)(u.Z,{vertical:!0,children:[(0,l.jsx)(r.F,{level:5,className:es().label,children:F}),(0,l.jsx)(y._,{children:O.address})]})]})})]})),(0,l.jsx)(R,{isLoading:d,isSkeletonLoading:c,selectedService:a,specialInstructions:null!==(t=null==n?void 0:n.specialInstructions)&&void 0!==t?t:"",handleInstructionsChange:async e=>{await i({specialInstructions:e},{flow:null==n?void 0:n.flow})}}),X&&(0,l.jsx)(C.Z,{className:es().modal,centered:!0,destroyOnHidden:!0,open:T,footer:null,onCancel:J,styles:{content:{maxWidth:800,width:b?800:"auto",padding:"48px 24px 24px 24px",minWidth:ea}},children:(0,l.jsx)(et.B,{isInsideModal:!0,selectedId:void 0,formData:q,form:N,isFormLoading:d,addressFieldRules:k,isMapService:P,isZipCode2NoGeo:E,positionMap:D,positionMarker:B,address:U,predictions:V,onSearchAddressValueChange:G,onPredictionSelect:H,onMapClick:K,onSubmit:Y,onCancelModal:J})})]})}var ec=n(76822),eu=n(10227),ep=n(78021),eh=n(66340),em=n(18619),ev=n(97975),ey=n.n(ev);function eg(e){let{shoppingCart:t,updateShoppingCart:n,isLoading:i,isInitialValuesLoading:r,currentFlow:o}
1=e,{t:a}=(0,s.q)(),d={xs:24,sm:(0,ec.sq)()?24:12},{form:c,country:p,formData:v,handleFieldBlur:y}=function(e){let{shoppingCart:t,updateShoppingCart:n,currentFlow:l}=e,[i]=M.Z.useForm(),r=(0,h.useRef)(!1),o=(0,er.Z)(e=>e.company),[,a]=(0,em.Xe)(null,null==o?void 0:o.languageLocales).split("_"),s=eh.iG.has(l),d=(0,h.useMemo)(()=>{var e,n,l,i;return{guestFirstName:null!==(e=null==t?void 0:t.guestFirstName)&&void 0!==e?e:"",guestLastName:null!==(n=null==t?void 0:t.guestLastName)&&void 0!==n?n:"",guestEmail:null!==(l=null==t?void 0:t.guestEmail)&&void 0!==l?l:"",guestPhone:null!==(i=null==t?void 0:t.guestPhone)&&void 0!==i?i:""}},[null==t?void 0:t.guestFirstName,null==t?void 0:t.guestLastName,null==t?void 0:t.guestEmail,null==t?void 0:t.guestPhone]),c=(0,h.useCallback)(async()=>{let e;try{e=await i.validateFields({validateOnly:!0})}catch(e){return}let l=e.guestPhone?(0,x.un)(e.guestPhone):"";if(e.guestFirstName===(null==t?void 0:t.guestFirstName)&&e.guestLastName===(null==t?void 0:t.guestLastName)&&e.guestEmail===(null==t?void 0:t.guestEmail)&&l===(null==t?void 0:t.guestPhone))return;let r={guestFirstName:e.guestFirstName,guestLastName:e.guestLastName,guestEmail:e.guestEmail,guestPhone:l},o=null==t?void 0:t.flow;await n(r,{flow:o}),(null==t?void 0:t.branchId)&&(0,eo.Bd)({branchId:t.branchId,...r})},[t,n,i]);return(0,h.useEffect)(()=>{!r.current&&t&&(r.current=!0,i.setFieldsValue(d))},[t,d,i]),{form:i,country:a,formData:d,shouldHideContactInfo:s,handleFieldBlur:c}}({shoppingCart:t,updateShoppingCart:n,currentFlow:o});return r?(0,l.jsx)(u.Z,{vertical:!0,gap:24,children:(0,l.jsx)(E.Z.Button,{active:!0,size:"large",className:"!w-full !h-[130px]"})}):(0,l.jsxs)(u.Z,{vertical:!0,gap:12,children:[(0,l.jsx)(m.B,{title:a("label.guest.contact.details")}),(0,l.jsx)(M.Z,{layout:"vertical",form:c,initialValues:v,validateTrigger:"onBlur",className:ey().container,onBlur:y,children:(0,l.jsxs)(eu.Z,{gutter:16,children:[(0,l.jsx)(ep.Z,{...d,children:(0,l.jsx)(M.Z.Item,{name:"guestFirstName",label:a("label.firstname"),rules:[{required:!0,message:a("error.guest.firstname.missing")}],children:(0,l.jsx)(k.Z,{size:"large",disabled:i})})}),(0,l.jsx)(ep.Z,{...d,children:(0,l.jsx)(M.Z.Item,{name:"guestLastName",label:a("label.lastname"),rules:[{required:!0,message:a("error.guest.lastname.missing")}],children:(0,l.jsx)(k.Z,{size:"large",disabled:i})})}),(0,l.jsx)(ep.Z,{...d,children:(0,l.jsx)(M.Z.Item,{name:"guestEmail",label:a("label.email"),rules:[{required:!0,message:a("error.guest.email.missing")},{type:"email",message:a("error.guest.email.invalid")}],children:(0,l.jsx)(k.Z,{size:"large",type:"email",disabled:i})})}),(0,l.jsx)(ep.Z,{...d,children:(0,l.jsx)(M.Z.Item,{name:"guestPhone",label:a("label.phone"),rules:[{required:!0,message:a("error.guest.phone.missing")},{validator:x.tH,message:a("phone.invalid")}],children:(0,l.jsx)(q.Z,{enableSearch:!0,size:"large",disableParentheses:!0,disabled:i,country:null==p?void 0:p.toLowerCase()})})})]})})]})}var ef=n(23721),eb=n(43475),ex=n.n(eb);function ej(e){let{icon:t,title:n,checked:i,item:o,onPaymentMethodChange:a,isLoading:s}=e;return(0,l.jsx)(ef.Z,{className:"".concat(ex().paymentCard," ").concat(i?ex().checked:""," ").concat(s?ex().disabled:""),styles:{body:{padding:6}},onClick:()=>a(o),children:(0,l.jsxs)(u.Z,{style:{width:"100%"},justify:"center",align:"center",vertical:!0,children:[t,(0,l.jsx)(r.F,{level:5,style:{margin:0},children:n})]})})}function eC(e){let{payment:t,isLoading:n,isInitialValuesLoading:i}=e,{t:r}=(0,s.q)(),{isMobile:o}=(0,g.p)(),a=function(){let{t:e}=(0,s.q)();return{CARD:{icon:(0,l.jsx)(f.ON,{style:{height:36,color:"var(--ant-color-text-base)"}}),title:(0,x.fm)(e("CARD").toLocaleLowerCase())},CARDTERMINAL:{icon:(0,l.jsx)(f.U5,{style:{height:36,color:"var(--ant-color-text-base)"}}),title:(0,x.fm)(e("CARDTERMINAL").toLocaleLowerCase())},CASH:{icon:(0,l.jsx)(f.E9,{style:{height:36,color:"var(--ant-color-text-base)"}}),title:(0,x.fm)(e("CASH").toLocaleLowerCase())},PAYPAL:{icon:(0,l.jsx)(f.cF,{style:{height:36,color:"var(--ant-color-text-base)"}}),title:(0,x.fm)(e("PAYPAL").toLocaleLowerCase())},APPLEPAY:{icon:(0,l.jsx)(f.iz,{style:{height:36,color:"var(--ant-color-text-base)"}}),title:(0,x.fm)(e("APPLEPAY").toLocaleLowerCase())}}}();return i?(0,l.jsx)(u.Z,{vertical:!0,gap:24,children:(0,l.jsx)(E.Z.Button,{active:!0,size:"large",className:"!w-full !h-[130px]"})}):(0,l.jsxs)(u.Z,{vertical:!0,gap:24,children:[(0,l.jsx)(m.B,{title:r("label.paymentmethod.title")}),o?(0,l.jsx)("div",{className:"grid grid-cols-2 gap-3",children:t.paymentMethods&&t.paymentMethods.map(e=>{var i;let{icon:r,title:o}=a[e.paymentType]||{};return(0,l.jsx)(ej,{icon:r,title:o,item:e,onPaymentMethodChange:t.onPaymentMethodChange,checked:e.id===(null===(i=t.selectedPaymentMethod)||void 0===i?void 0:i.id),isLoading:n},e.id)})}):(0,l.jsx)(u.Z,{gap:12,children:t.paymentMethods&&t.paymentMethods.length>0?t.paymentMethods.map(e=>{var i;let{icon:r,title:o}=a[e.paymentType]||{};return(0,l.jsx)(ej,{icon:r,title:o,item:e,onPaymentMethodChange:t.onPaymentMethodChange,checked:e.id===(null===(i=t.selectedPaymentMethod)||void 0===i?void 0:i.id),isLoading:n},e.id)}):(0,l.jsx)(l.Fragment,{})})]})}var eZ=n(6811),ew=n(66598),e_=n(57307),eS=n(54981),eN=n(23174),eT=n.n(eN);function eI(e){var t,n,i,o,a,d,c;let{table:m,selectedService:v,isLoading:g,isInitialValuesLoading:f}=e,{t:x}=(0,s.q)(),{colorError:Z}=(0,Y.F)(),[w]=(0,A.Z)(),[_,S]=(0,h.useState)(!1),N=null==v?void 0:v.servedAtTable,T=(null==v?void 0:v.orderType)===b.m["EAT-IN"],I=(0,h.useMemo)(()=>{let e=(0,eZ.WJ)(null,"orderSource");if(!e)return!1;try{return!!JSON.parse(e).tableNumber}catch(e){return!1}},[]);return((0,h.useEffect)(()=>
1{if(v&&T&&N){var e;w.setFieldsValue({tableNumber:null===(e=m.selectedTableNumber)||void 0===e?void 0:e.tableNumber})}},[m.selectedTableNumber,v,w]),v&&T)?f?(0,l.jsx)(u.Z,{className:eT().container,children:(0,l.jsx)(E.Z.Button,{active:!0,size:"large",shape:"default",block:!0,style:{width:"100%"}})}):N?I?(0,l.jsx)(u.Z,{className:eT().container,children:(0,l.jsx)(e_.Z,{type:"info",showIcon:!0,icon:(0,l.jsx)(ew.Z,{}),message:x("label.table.served",[null!==(d=null===(a=m.selectedTableNumber)||void 0===a?void 0:a.tableNumber)&&void 0!==d?d:""]),style:{width:"100%"}})}):(0,l.jsxs)(u.Z,{className:eT().container,children:[(0,l.jsxs)(u.Z,{justify:"space-between",align:"center",style:{width:"100%"},children:[m.selectedTableNumber?(0,l.jsxs)(u.Z,{gap:8,justify:"center",align:"center",children:[(0,l.jsx)(ew.Z,{style:{fontSize:20}}),(0,l.jsxs)(y._,{children:[x("label.table")," ",null===(t=m.selectedTableNumber)||void 0===t?void 0:t.tableNumber]})]}):(0,l.jsxs)(u.Z,{gap:8,align:"center",children:[(0,l.jsx)(W.Z,{style:{color:Z,fontSize:20}}),(0,l.jsx)(r.F,{level:5,className:"text-left",style:{color:Z,margin:0},children:x("label.table.selecttablenumber")})]}),(0,l.jsx)(p.ZP,{icon:(0,l.jsx)(j.Z,{}),onClick:()=>{S(!0)},disabled:g||f,children:x("label.link.edit")})]}),(0,l.jsx)(C.Z,{centered:!0,open:_,styles:{content:{maxWidth:640}},footer:null,title:(0,l.jsx)(r.F,{level:4,children:x("label.table.selection")}),onCancel:()=>{w.resetFields(),S(!1)},children:(0,l.jsx)(M.Z,{layout:"vertical",labelAlign:"left",form:w,onFinish:e=>{let{tableNumber:t}=e;m.onTableNumberChange(t),S(!1)},initialValues:{tableNumber:null===(n=m.selectedTableNumber)||void 0===n?void 0:n.tableNumber},children:(0,l.jsxs)(u.Z,{vertical:!0,gap:8,children:[(0,l.jsx)(u.Z,{vertical:!0,gap:4,children:(0,l.jsx)(M.Z.Item,{rules:[{required:!0,message:x("label.table.selecttablenumber")}],name:"tableNumber",children:(0,l.jsx)(eS.default,{size:"large",placeholder:x("label.table.select"),defaultValue:null===(i=m.selectedTableNumber)||void 0===i?void 0:i.tableNumber,value:null===(o=m.selectedTableNumber)||void 0===o?void 0:o.tableNumber,children:(null!==(c=m.tableNumbers)&&void 0!==c?c:[]).filter(e=>e.active).map(e=>(0,l.jsxs)(eS.default.Option,{value:e.tableNumber,children:[x("label.table")," ",e.tableNumber]},e.tableNumber))})})}),(0,l.jsx)(p.ZP,{htmlType:"submit",type:"primary",size:"large",block:!0,children:x("label.button.save")})]})})})]}):(0,l.jsx)(u.Z,{className:eT().container,children:(0,l.jsx)(u.Z,{justify:"space-between",align:"center",style:{width:"100%"},children:(0,l.jsx)(e_.Z,{type:"info",showIcon:!0,icon:(0,l.jsx)(ew.Z,{}),message:x("label.pickup.from.counter"),style:{width:"100%"}})})}):null}var eP=n(92420),eE=n.n(eP);function eM(e){var t;let{service:n,cart:h,payment:m,table:v,actions:y,isLoading:g,isInitialValuesLoading:f,isGuest:b=!1}=e,{t:x}=(0,s.q)(),{getServiceOptions:j}=(0,a.r)(),C=j(n.availableServices),Z=(0,o.l)(),w=Z===d.Zw.QR_TABLE_ORDERING||Z===d.Zw.QR_QUEUE_ORDERING,_=async e=>{e.preventDefault(),y.handleBackToMenuPage()};return(0,l.jsxs)(u.Z,{className:eE().container,vertical:!0,gap:16,children:[(0,l.jsx)("form",{onSubmit:_,children:(0,l.jsx)(p.ZP,{type:"text",size:"large",htmlType:"submit",style:{width:"fit-content"},icon:(0,l.jsx)(c.Z,{style:{fontSize:12}}),children:(0,l.jsx)(r.F,{level:5,style:{margin:0},children:x("label.button.back.to.store")})})}),(0,l.jsxs)(u.Z,{className:eE().content,vertical:!0,gap:24,children:[(0,l.jsx)(i.e,{flow:Z,isLoading:g,shoppingCart:h.shoppingCart,updateShoppingCart:h.updateShoppingCart,service:{serviceOptions:C,selectedService:n.selectedService,onServiceChange:n.onServiceChange}}),b?(0,l.jsxs)(l.Fragment,{children:[!w&&(0,l.jsx)(eg,{shoppingCart:h.shoppingCart,updateShoppingCart:h.updateShoppingCart,isLoading:g,isInitialValuesLoading:f,currentFlow:Z}),(null===(t=h.shoppingCart)||void 0===t?void 0:t.flow)===d.Zw.ONLINE_DELIVERY&&(0,l.jsx)(ed,{shoppingCart:h.shoppingCart,updateShoppingCart:h.updateShoppingCart,updateShoppingCartAddress:h.updateShoppingCartAddress,selectedService:n.selectedService,isSkeletonLoading:f,isLoading:g})]}):(0,l.jsx)(ee,{shoppingCart:h.shoppingCart,updateShoppingCart:h.updateShoppingCart,updateShoppingCartAddress:h.updateShoppingCartAddress,selectedService:n.selectedService,isSkeletonLoading:f,isLoading:g}),(0,l.jsx)(eI,{table:v,selectedService:n.selectedService,isLoading:g,isInitialValuesLoading:f}),(0,l.jsx)(eC,{payment:m,isLoading:g,isInitialValuesLoading:f})]})]})}},94398:function(e,t,n){"use strict";n.d(t,{v:function(){return ew}});var l=n(85893),i=n(67294),r=n(15109),o=n(65139),a=n(67936),s=n(5695),d=n(10042),c=n(11949),u=n(22453),p=n(2516),h=n(
157307),m=n(18446),v=n.n(m),y=n(81763),g=n.n(y),f=n(92080);function b(e){var t,n,i,m,y,b,x,j;let{item:C,orderSummaryTip:Z,notificationText:w,style:_,isLoading:S}=e,{t:N}=(0,c.q)(),{colorPrimaryText:T}=(0,d.F)(),{formatCompanyCurrency:I}=(0,a.f)(),{formatPromotionName:P,getFilteredPromotions:E}=(0,s.f)(),M=!["DELIVERY","CATERING"].includes(null!==(n=null==C?void 0:C.orderType)&&void 0!==n?n:""),k=E(null==C?void 0:C.discounts);return(0,l.jsxs)(p.Z,{vertical:!0,style:{width:"100%",padding:"16px",gap:"12px",..._},children:[k&&k.length>0&&k.map(e=>(0,l.jsx)(o.w,{label:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Z,{style:{width:18,height:18,paddingRight:4}}),P(e)]}),value:"-".concat(I(e.discountAmount)),isLoading:S},e.promotionId)),(0,l.jsx)(o.w,{label:N("label.subtotal"),value:I(null!==(i=null==C?void 0:C.subTotal)&&void 0!==i?i:0),priceAfterDiscount:g()(null==C?void 0:C.subTotalAfterDiscount)&&!v()(C.subTotalAfterDiscount,null==C?void 0:C.subTotal)?I(null!==(m=null==C?void 0:C.subTotalAfterDiscount)&&void 0!==m?m:0):void 0,isLoading:S}),!!(null==C?void 0:C.serviceFee)&&(0,l.jsx)(o.w,{label:(0,l.jsxs)(p.Z,{gap:4,children:[(0,l.jsx)("span",{children:N("label.service.fee")}),C.serviceFeeContent&&(0,l.jsx)(r.N,{styles:{color:"#2378DC"},title:N("label.service.fee"),content:C.serviceFeeContent})]}),value:I(null!==(y=null==C?void 0:C.serviceFee)&&void 0!==y?y:0),isLoading:S}),!!(null==C?void 0:C.bagFee)&&(0,l.jsx)(o.w,{label:(0,l.jsxs)(p.Z,{gap:4,children:[(0,l.jsx)("span",{children:N("label.bag.fee")}),C.bagFee&&(0,l.jsx)(r.N,{styles:{color:"#2378DC"},title:N("label.bag.fee"),content:N("label.bag.fee.description")})]}),value:I(null!==(b=null==C?void 0:C.bagFee)&&void 0!==b?b:0),isLoading:S}),!!(null==C?void 0:C.orderDiscount)&&g()(null==C?void 0:C.orderDiscount)&&(0,l.jsx)(o.w,{label:N("label.discount"),value:I(-((null!==(x=null==C?void 0:C.orderDiscount)&&void 0!==x?x:0)*1)),isLoading:S}),!!(null==C?void 0:C.promoCodeDiscount)&&g()(null==C?void 0:C.promoCodeDiscount)&&(0,l.jsx)(o.w,{label:N("label.promocodediscount")+((null==C?void 0:C.promoCode)?" (".concat(null==C?void 0:C.promoCode,")"):""),value:I(-1*C.promoCodeDiscount),isLoading:S}),!!(null==C?void 0:C.voucherDiscount)&&g()(null==C?void 0:C.voucherDiscount)&&(0,l.jsx)(o.w,{label:N("label.voucherdiscount")+((null==C?void 0:C.voucherCode)?" (".concat(null==C?void 0:C.voucherCode,")"):""),value:I(-1*C.voucherDiscount),isLoading:S}),!!(null==C?void 0:C.surCharge)&&(0,l.jsx)(o.w,{label:N("label.card.fee"),value:I(C.surCharge),isLoading:S}),!!(null==C?void 0:C.deliveryCharge)&&(0,l.jsx)(o.w,{label:N("label.delivery.fee"),value:I(C.deliveryCharge),isLoading:S}),!!(null==C?void 0:C.customerOrderTaxes)&&C.customerOrderTaxes.map(e=>(0,l.jsx)(o.w,{label:e.taxLabel,value:I(e.taxAmount),isLoading:S},e.id)),M&&!!(null==C?void 0:C.tip)&&(0,l.jsx)(o.w,{label:N("order.details.tip"),value:I(C.tip),isLoading:S}),!!(null==C?void 0:C.driverTip)&&(0,l.jsx)(o.w,{label:N("label.drivertip"),value:I(C.driverTip),isLoading:S}),null==C?void 0:null===(t=C.shoppingCartTaxes)||void 0===t?void 0:t.map(e=>{let{chargeMode:t,taxLabel:n,taxAmount:i,taxRule:r,rate:a}=e,s=1===t?I(a):"".concat(100*a,"%"),d="".concat(n," (").concat(s,")"),c=I(i),u="".concat(n,"-").concat(i,"-").concat(r);return(0,l.jsx)(o.w,{label:d,value:c,isLoading:S},u)}),!!(null==C?void 0:C.amount)&&(0,l.jsx)(o.w,{label:N("label.amount"),value:I(C.amount),isLoading:S}),Z&&(0,l.jsx)(f.g,{styles:{paddingBottom:8},isLoading:Z.isLoading,shoppingCart:Z.shoppingCart,service:Z.service,onTipChange:Z.onTipChange,tipType:Z.tipType,tipValue:Z.tipValue}),(0,l.jsx)(o.w,{isPrimary:!0,isBold:!0,label:N("label.total.capital").toUpperCase(),value:I(null!==(j=null==C?void 0:C.total)&&void 0!==j?j:0),isLoading:S}),w&&(0,l.jsx)(h.Z,{message:w,style:{color:T,marginTop:12},type:"success"})]})}var x=n(43644),j=n(69913),C=n(62682),Z=n(46423),w=n(85551),_=n(82057),S=n(83663),N=n(22825),T=n(52675),I=n(87076),P=n(41664),E=n.n(P);function M(){let{t:e}=(0,c.q)(),{branch:t}=(0,T.Z)(e=>e),{isModalOpen:n,handleOpenModal:i,handleCloseModal:r}=(0,N.X)();return(0,l.jsxs)(p.Z,{children:[(0,l.jsxs)(_._,{children:[(0,l.jsxs)("span",{style:{fontWeight:"bold"},children:[e("label.allergies"),": "]})," ".concat(e("label.allergies.message")," "),(0,l.jsx)(w.ZP,{type:"text",color:"primary",onClick:i,style:{padding:0,margin:0},children:e("label.link.click.here")}),"."]}),(0,l.jsx)(I.Z,{centered:!0,open:n,styles:{content:{maxWidth:605}},footer:null,title:(0,l.jsx)(S.F,{level:4,children:e("label.allergies.modal.title")}),onCancel:r,children:(0,l.jsxs)(p.Z,{vertical:!0,gap:24,children:[(0,l.jsx)("p",{children:e("label.allergies.modal.message",[(0,l.jsxs)(E(),{href:"tel:".concat(null==t?void 0:t.phone),children:["(",null==t?void 0:t.phone,")"]},"branch-phone")])}),(0,l.jsx)(w.ZP,{type:"primary",onClick:r,size:"large",block:!0,children:e("label.button.ok")})]})})]})}var k=n(97454),A=n(66340),L=n(67371),O=n(25675),R=n.n(O),F=n(9615),D=n.n(F);function B(e){let{handleBackToMenuPage:t,branchInfo:n}=e,{getBranchAddress:i}=(0,k.v)(),r=(0,T.Z)(e=>e.branch),o=i(null!=r?r:void 0),a=async()=>{t()};return(0,l.jsxs)(p.Z,{className:D().container,onClick:a,justify:"space-between",align:"center",style:{padding:"16px 12px",cursor:"pointer"},children:[(0,l.jsxs)(p.Z,{gap:12,align:"center",children:[(0,l.jsx)(R(),{src:(null==r?void 0:r.locationWebLogoUrl)||n.branchImageUrl||A.TL.NONE,alt:"item",width:0,height:0,sizes:"100vw",style:{borderRadius:"50%",width:"36px",height:"36px",objectFit:"cover"},blurDataURL:(null==r?void 0:r.locationWebLogoUrl)||n.branchImageUrl||A.TL.NONE}),(0,l.jsxs)(p.Z,{vertical:!0,justify:"center",children:[(0,l.jsx)(S.F,{level:5,children:(null==r?void 0:r.name)||n.branchName}),(0,l.jsx)(_._,{type:"secondary",children:o||n.branchAddress})]})]}),(0,l.jsx)(L.Z,{style:{fontSize:20,color:"var(--ant-color-text-base)"}})]})}var U=n(99e3),z=n(90619),V=n(84368),q=n(14733),G=n(97845),H=n(65378),K=n(21165),Y=n(69289),W=n(77056),J=n.n(W);function X(e){let{shoppingCart:t}=e,{t:n}=(0,c.q)(),{branch:i}=(0,T.Z)(e=>e),{selectedService:r}=(0,z.Z)(e=>e),o=(0,K.q)(null==i?void 0:i.urlPath),a=(null==t?void 0:t.discounts)||[],s=async e=>{e.preventDefault();let t=(0,K.t)();(0,V.E)(o+t,{orderType:(null==r?void 0:r.orderType)||""})},d=null==t?void 0:t.items.reduce((e,t)=>
1e+(t.quantity||0),0),u=[{key:"1",label:(0,l.jsxs)(p.Z,{gap:12,align:"center",children:[(0,l.jsx)(U.wh,{style:{color:"var(--ant-color-text-base)"}}),(0,l.jsx)(p.Z,{vertical:!0,justify:"center",children:(0,l.jsx)(S.F,{level:5,children:t?n("label.show.total.item",[d]):(0,l.jsx)(G.Z.Input,{active:!0,size:"small",style:{width:100}})})})]}),children:(0,l.jsxs)(p.Z,{vertical:!0,gap:16,children:[(0,l.jsx)(p.Z,{style:{width:"100%"},justify:"end",align:"center",children:(0,l.jsx)("form",{onSubmit:s,children:(0,l.jsx)(w.ZP,{htmlType:"submit",icon:(0,l.jsx)(q.Z,{}),color:"default",variant:"filled",children:n("label.button.add.more.item")})})}),(0,l.jsx)(p.Z,{vertical:!0,gap:16,children:null==t?void 0:t.items.map(e=>(0,l.jsx)(Y.D,{discounts:a,shoppingCartItem:e,quantityStyle:"text"},e.entityId))})]})}];return(0,l.jsx)(H.Z,{className:J().container,expandIconPosition:"end",bordered:!1,expandIcon:e=>{let{isActive:t}=e;return(0,l.jsx)(L.Z,{style:{fontSize:20,color:"var(--ant-color-text-base)"},rotate:t?90:0})},items:u})}var Q=n(1237),$=n(55493),ee=n(43807),et=n(52506),en=n(22971),el=n(57321),ei=n(22116),er=n(5215),eo=n(23920);function ea(e){let{shoppingCart:t,closeCouponModal:n}=e,{productState:r}=function(e){var t;let{shoppingCart:n,closeCouponModal:l}=e,r=null!==(t=null==n?void 0:n.promoCode)&&void 0!==t?t:null,o=(0,i.useRef)(r),a=(0,i.useMemo)(()=>{var e;return r?null==n?void 0:null===(e=n.freeItemOffers)||void 0===e?void 0:e.find(e=>e.promoCode===r&&e.items.length>0):void 0},[null==n?void 0:n.freeItemOffers,r]),s=(0,er.f)(),{onOpenProductDetailModal:d}=s;return(0,i.useEffect)(()=>{if(r===o.current)return;if(!r){o.current=null;return}if(!a)return;o.current=r,l();let[e]=a.items;a.status===eo.P.UNLOCKED&&1===a.items.length&&d(e.productId,void 0,{name:e.name,description:void 0,productPhotoUrl:e.imageUrl})},[r,a,l,d]),{productState:s}}({shoppingCart:t,closeCouponModal:n});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(el.E,{shoppingCart:t,onOpenProductDetailModal:r.onOpenProductDetailModal,promoCodeOnly:!0,style:{marginTop:12}}),r.isOpenProductDetail&&(0,l.jsx)(ei.E,{onClose:r.onCloseProductDetail,isLoading:r.isFetchingProduct,product:r.product,keyId:r.selectedKey,menuProductPreview:r.selectedMenuProductPreview,validateBeforeAddCart:r.validateBeforeAddCart}),(0,l.jsx)("div",{children:r.validateModalContextHolder})]})}var es=n(71242),ed=n(23721),ec=n(87913),eu=n(85164),ep=n.n(eu);function eh(e){let{imageUrl:t,name:n,discountType:i}=e;return t?(0,l.jsx)(R(),{src:t,alt:n,fill:!0,sizes:"96px",className:ep().image}):i===es.a1.DELIVERY?(0,l.jsx)(p.Z,{align:"center",justify:"center",style:{height:"100%"},children:(0,l.jsx)(U.cy,{style:{width:64,height:64}})}):(0,l.jsx)(p.Z,{align:"center",justify:"center",style:{height:"100%"},children:(0,l.jsx)(U.oO,{style:{width:64,height:64}})})}function em(e){var t,n,i,r,o;let{item:a,appliedPromoCode:s,onApply:d,onRemove:u,isLoading:h}=e,{t:m}=(0,c.q)(),{name:v,description:y,imageUrl:g,conditionGroups:f}=a,b=null!==(o=null===(n=f[0])||void 0===n?void 0:null===(t=n.conditions[0])||void 0===t?void 0:t.promotionCode)&&void 0!==o?o:"",x=null===(r=f[0])||void 0===r?void 0:null===(i=r.discounts[0])||void 0===i?void 0:i.type,j=!!b&&s===b;return(0,l.jsx)(ed.Z,{className:ep().card,styles:{body:{padding:12}},children:(0,l.jsxs)(p.Z,{vertical:!0,gap:16,children:[(0,l.jsxs)(p.Z,{align:"center",gap:12,children:[(0,l.jsx)("div",{className:ep().imageWrapper,children:(0,l.jsx)(eh,{imageUrl:g,name:v,discountType:x})}),(0,l.jsx)(p.Z,{vertical:!0,gap:8,style:{flex:1},children:(0,l.jsxs)(p.Z,{vertical:!0,gap:4,children:[(0,l.jsx)(ec.Z,{className:"no-margin",ellipsis:{rows:1},style:{margin:0},children:(0,l.jsx)(S.F,{level:5,style:{margin:0,fontWeight:800},children:v})}),(0,l.jsx)(_._,{className:"text-bold",children:"Code: ".concat(b)}),(0,l.jsx)(ec.Z,{className:"no-margin",ellipsis:{rows:2},style:{margin:0},children:(0,l.jsx)(_._,{type:"secondary",children:y})})]})})]}),(0,l.jsx)(w.ZP,{type:j?"primary":"default",size:"large",style:{alignSelf:"flex-start"},onClick:()=>j?u():d(b),disabled:h,children:m(j?"label.coupon.remove":"label.coupon.apply")})]})})}var ev=n(31223),ey=n.n(ev);function eg(e){let{item:t,appliedVoucherCode:n,onApply:i,onRemove:r,isLoading:o}=e,{t:s}=(0,c.q)(),{formatCompanyCurrency:d}=(0,a.f)(),u=n===t.voucherCode,h="PERCENTAGE"===t.discountType?"".concat(t.discountValue,"%"):d(t.discountValue);return(0,l.jsx)(ed.Z,{className:ey().card,styles:{body:{padding:12}},children:(0,l.jsxs)(p.Z,{vertical:!0,gap:16,children:[(0,l.jsxs)(p.Z,{align:"center",gap:12,children:[(0,l.jsx)("div",{className:ey().iconWrapper,children:(0,l.jsx)(p.Z,{align:"center",justify:"center",style:{height:"100%"},children:(0,l.jsx)(U.oO,{style:{width:48,height:48}})})}),(0,l.jsxs)(p.Z,{vertical:!0,gap:4,style:{flex:1},children:[(0,l.jsx)(ec.Z,{className:"no-margin",ellipsis:{rows:1},style:{margin:0},children:(0,l.jsx)(S.F,{level:5,style:{margin:0,fontWeight:800},children:"".concat(t.voucherName," \xb7 ").concat(h)})}),(0,l.jsx)(_._,{className:"text-bold",children:s("label.voucher.code",[t.voucherCode])}),!!t.voucherDescription&&(0,l.jsx)(ec.Z,{className:"no-margin",ellipsis:{rows:2},style:{margin:0},children:(0,l.jsx)(_._,{type:"secondary",children:t.voucherDescription})}),!!t.minOrderAmount&&(0,l.jsx)(_._,{type:"secondary",children:s("loyalty.reward.terms.minimum.spend",[d(t.minOrderAmount)])}),null!=t.daysUntilExpiration&&t.daysUntilExpiration>=0&&(0,l.jsx)(_._,{type:"secondary",children:s("label.voucher.expiresin",[t.daysUntilExpiration])})]})]}),(0,l.jsx)(w.ZP,{type:u?"primary":"default",size:"large",style:{alignSelf:"flex-start"},onClick:()=>u?r():i(t.voucherCode),disabled:o,children:s(u?"label.coupon.remove":"label.coupon.apply")})]})})}var ef=n(17535),eb=n.n(ef);function ex(){let{t:e}=(0,c.q)();return(0,l.jsx)(p.Z,{style:{minHeight:116,width:"100%",textAlign:"center",paddingTop:40},vertical:!0,justify:"center",align:"center",gap:24,children:(0,l.jsx)(_._,{type:"secondary",children:e("label.coupon.empty")})})}function ej(e){var t,n,r,o,a;let{cart:s,promo:d}=e,{t:u}=(0,c.q)(),[m]=(0,en.Z)(),v=(0,i.useMemo)(()=>{var e,t;return(null===(e=s.shoppingCart)||void 0===e?void 0:e.voucherCode)!=null?d.voucherNotice?u("label.voucher.notApplied",[s.shoppingCart.voucherCode]):u("label.voucher.title",[s.shoppingCart.voucherCode]):(null===(t=s.shoppingCart)||void 0===t?void 0:t.promoCode)!=null?u("label.promocode.title",[s.shoppingCart.promoCode]):u("label.coupon.add")},[null===(t=s.shoppingCart)||void 0===t?void 0:t.promoDiscount,null===(n=s.shoppingCart)||void 0===n?void 0:n.promoCode,null===(r=s.shoppingCart)||void 0===r?void 0:r.voucherCode,d.voucherNotice,u]),y=d.canUseVouchers?{key:"VOUCHERS",label:(0,l.jsx)(_._,{children:u("label.voucher.yours")}),children:d.isLoadingVouchers?(0,l.jsx)(p.Z,{justify:"center",style:{padding:"24px 0"},children:(0,l.jsx)(Q.b,{})}):0===d.vouchers.length?(0,l.jsx)(p.Z,{style:{padding:"12px 0"},children:(0,l.jsx)(_._,{type:"secondary",children:u("label.voucher.empty")})}):(0,l.jsx)(p.Z,{vertical:!0,gap:8,className:eb().couponList,children:d.vouchers.map(e=>(0,l.jsx)(eg,{item:e,appliedVoucherCode:d.appliedVoucherCode,onApply:d.handleApplyVoucher,onRemove:d.handleRemoveCoupon,isLoading:s.isShoppingCartLoading},e.id))})}:null,g={key:"COUPONS",label:(0,l.jsx)(_._,{children:u("label.coupon.available")}),children:d.isLoadingCoupons?(0,l.jsx)(p.Z,{justify:"center",style:{padding:"24px 0"},children:(0,l.jsx)(Q.b,{})}):0===d.coupons.length?(0,l.jsx)(ex,{}):(0,l.jsx)(p.Z,{vertical:!0,gap:8,className:eb().couponList,children:d.coupons.map(e=>(0,l.jsx)(em,{item:e,appliedPromoCode:d.appliedPromoCode,onApply:d.handleApplyCoupon,onRemove:d.handleRemoveCoupon,isLoading:s.isShoppingCartLoading},e.id))})};return(0,i.useEffect)(()=>{var e,t;m.setFieldValue("promoCode",null!==(t=null!==(e=d.appliedVoucherCode)&&void 0!==e?e:d.appliedPromoCode)&&void 0!==t?t:"")},[d.appliedPromoCode,d.appliedVoucherCode,m]),(0,l.jsxs)(p.Z,{vertical:!0,style:{width:"100%"},children:[d.contextHolder,(0,l.jsxs)(p.Z,{className:eb().container,onClick:d.handleOpenModal,justify:"space-between",align:"center",children:[(0,l.jsxs)(p.Z,{gap:12,align:"center",style:{minHeight:46},children:[(0,l.jsx)(U.$7,{style:{color:d.voucherNotice?"var(--ant-color-warning)":"var(--ant-color-text-base)"}}),(0,l.jsxs)(p.Z,{vertical:!0,justify:"center",children:[(0,l.jsx)(S.F,{level:5,children:v}),d.voucherNotice&&(0,l.jsx)(_._,{type:"secondary",children:d.voucherNotice})]})]}),(0,l.jsx)(L.Z,{style:{fontSize:20,color:"var(--ant-color-text-base)"}})]}),(0,l.jsx)(ea,{shoppingCart:s.shoppingCart,closeCouponModal:d.handleCloseModal}),(0,l.jsxs)(I.Z,{centered:!0,open:d.isModalOpen,styles:{content:{maxWidth:600,paddingBottom:48}},footer:null,title:(0,l.jsx)(S.F,{level:4,children:u("label.coupon.add")}),onCancel:d.handleCloseModal,children:[d.voucherNotice&&(0,l.jsx)(h.Z,{type:"warning",showIcon:!0,style:{marginBottom:16},message:u("label.voucher.notApplied",[null!==(o=d.appliedVoucherCode)&&void 0!==o?o:""]),description:d.voucherNotice,action:(0,l.jsx)(w.ZP,{size:"small",onClick:d.handleRemoveCoupon,loading:s.isShoppingCartLoading,children:u("label.coupon.remove")})}),(0,l.jsx)($.Z,{layout:"vertical",labelAlign:"left",form:m,onFinish:e=>{let{promoCode:t}=e;t&&d.handleApplyCoupon(t)},initialValues:{promoCode:d.promoCode},children:(0,l.jsxs)(p.Z,{gap:12,justify:"space-between",align:"end",style:{width:"100%"},children:[(0,l.jsx)(p.Z,{vertical:!0,style:{width:"100%"},children:(0,l.jsx)($.Z.Item,{required:!1,label:(0,l.jsx)(_._,{strong:!0,children:u("label.promocode.enter")}),name:"promoCode",style:{marginBottom:0},validateStatus:d.codeError?"error":void 0,help:null!==(a=d.codeError)&&void 0!==a?a:void 0,children:(0,l.jsx)(ee.Z,{placeholder:u("label.promocode.enterHere"),size:"large",prefix:(0,l.jsx)(U.$7,{color:"#3B3B3B"})})})}),(0,l.jsx)(w.ZP,{type:"primary",size:"large",htmlType:"submit",loading:d.isApplyingCode,style:{marginBottom:
1d.codeError?24:0},children:u("label.button.apply")})]})}),y?(0,l.jsx)(et.Z,{defaultActiveKey:"VOUCHERS",items:[y,g]}):g.children]})]})}var eC=n(9216),eZ=n.n(eC);function ew(e){let{service:t,cart:n,tip:r,promoCode:o,payment:s,actions:d,isLoading:u,isPaymentSuccess:h=!1,initialValues:m}=e,{t:v}=(0,c.q)(),{isRestaurantCompany:y,formatCompanyCurrency:g}=(0,a.f)(),f=(0,i.useMemo)(()=>{var e,t,l,i;let r=null!==(l=null===(e=n.shoppingCart)||void 0===e?void 0:e.total)&&void 0!==l?l:0,o=null!==(i=null===(t=n.summaryPrice)||void 0===t?void 0:t.subTotal)&&void 0!==i?i:0;return r>0||0===r&&o>0},[n.shoppingCart,n.summaryPrice]),_=(0,i.useMemo)(()=>{var e,t,l;let i=null!==(l=null===(e=n.shoppingCart)||void 0===e?void 0:e.total)&&void 0!==l?l:0,r=null===(t=s.selectedPaymentMethod)||void 0===t?void 0:t.paymentType;if(!n.shoppingCart||!s.selectedPaymentMethod||i<=0)return v("label.button.submitordertorestaurant");let o=g(i);return r===C.u.CARD?"".concat(v("label.button.paybycard.standard")," (").concat(o,")"):"".concat(v("label.button.submitordertorestaurant")," (").concat(o,")")},[n.shoppingCart,s.selectedPaymentMethod,g,v]);return(0,l.jsx)(p.Z,{className:eZ().container,children:(0,l.jsxs)(p.Z,{className:eZ().content,vertical:!0,gap:16,children:[(0,l.jsx)(x.B,{title:v("page.title.ordersummary")}),(0,l.jsx)(B,{handleBackToMenuPage:d.handleBackToMenuPage,branchInfo:m.branchInfo}),(0,l.jsx)(j.e,{area:Z.tp.CHECKOUT,entityType:"BRANCH",entityId:m.branchId}),(0,l.jsx)(X,{shoppingCart:n.shoppingCart}),(0,l.jsx)(ej,{cart:n,promo:o}),(0,l.jsx)(b,{style:{backgroundColor:"var(--ant-checkout-section-background-color, var(--ant-main-background-color, #fafafa))",padding:"28px 16px",borderRadius:8},item:n.summaryPrice,isLoading:u,orderSummaryTip:{shoppingCart:n.shoppingCart,service:t.selectedService,onTipChange:r.onTipChange,tipType:r.tipType,tipValue:r.tipValue,isLoading:u}}),(0,l.jsx)(p.Z,{className:eZ().checkoutButton,children:(0,l.jsx)(w.ZP,{block:!0,type:"primary",size:"large",onClick:d.handleSubmit,disabled:h||!f,loading:u,children:_})}),y&&(0,l.jsx)(M,{})]})})}},9414:function(e,t,n){"use strict";n.d(t,{E:function(){return x}});var l=n(85893),i=n(97005),r=n(82057),o=n(83663),a=n(10042),s=n(11949),d=n(50820),c=n(89204),u=n(87076),p=n(2516),h=n(57307),m=n(85551),v=n(67294),y=n(4982),g=n(97588),f=n(76837);let b=["Approved","Captured"];function x(e){let{onClose:t,paymentContext:n,onSuccess:x,onError:j}=e,{colorError:C}=(0,a.F)(),{t:Z}=(0,s.q)(),{isSubmitting:w,isDisabledSubmit:_,errorMessage:S,formRef:N,payBtnRef:T,payButtonLabel:I,handleSubmit:P}=function(e){var t;let{paymentContext:n,onSuccess:l,onError:i,onClose:r}=e,{t:o}=(0,s.q)(),{colorPrimaryBg:d,Modal:c,colorTextBase:u}=(0,a.F)(),{formatCurrencyByCurrencyCode:p}=(0,y.U)(),[h,m]=(0,v.useState)(!1),[x,j]=(0,v.useState)(!0),[C,Z]=(0,v.useState)(null),w=(0,v.useRef)(null),_=(0,v.useRef)(null),S=null==n?void 0:n.customerOrder,N="".concat(o("label.button.paybycard.standard")," (").concat(p(null!==(t=null==S?void 0:S.subTotal)&&void 0!==t?t:0,null==S?void 0:S.currencyCode),")");return(0,v.useEffect)(()=>{if(!(null==n?void 0:n.ryftContext)||"undefined"==typeof Ryft)return;let{publicApiKey:e,clientSecret:t,subAccount:l,paymentMethodsJsonString:i}=n.ryftContext,r={publicKey:e,clientSecret:t,usage:"payment",customerPaymentMethods:{allowStorage:!n.isGuest,rawJson:i},style:{backgroundColor:(null==c?void 0:c.contentBg)||d,bodyColor:(null==c?void 0:c.contentBg)||d,color:u}};l&&(r.accountId=l),Ryft.init(r),Ryft.addEventHandler("cardValidationChanged",e=>{_.current&&j(!e.isValid),e.isValid&&(0,f.y)({event:g.s.ADD_PAYMENT_INFO,add_payment_info_success:1,add_payment_info_type:"ryft"})}),Ryft.addEventHandler("paymentMethodSelectionChanged",e=>{_.current&&j(!e.paymentMethod)})},[null==n?void 0:n.ryftContext]),{isSubmitting:h,isDisabledSubmit:x,errorMessage:C,formRef:w,payBtnRef:_,payButtonLabel:N,handleSubmit:async e=>{e.preventDefault();try{m(!0),Z(null);let e=await Ryft.attemptPayment();if(b.includes(e.status))l(n),r();else if(e.lastError){console.log("session.lastError",e.lastError);let t=Ryft.getUserFacingErrorMessage(e.lastError);Z(t),i(t)}}catch(e){i((null==e?void 0:e.message)||"Unexpected error")}finally{m(!1)}}}}({paymentContext:n,onSuccess:x,onError:j,onClose:t}),E=(0,d.Z)(e=>e.company),M=(0,c.Z)(e=>e.customer),k=!w;
1return(0,l.jsx)(u.Z,{open:!0,onCancel:t,footer:null,maskClosable:!1,closable:k,children:(0,l.jsxs)(p.Z,{gap:32,vertical:!0,style:{paddingTop:32},children:[(0,l.jsxs)(p.Z,{justify:"space-between",align:"center",style:{width:"100%"},vertical:!0,gap:8,children:[(0,l.jsx)(o.F,{level:4,children:null==E?void 0:E.name}),(0,l.jsx)(r._,{children:null==M?void 0:M.email})]}),(0,l.jsxs)("form",{id:"ryft-pay-form",onSubmit:P,ref:N,style:{display:"flex",flexDirection:"column"},children:[w&&(0,l.jsx)(h.Z,{banner:!0,type:"info",message:(0,l.jsx)(i.Z,{pauseOnHover:!0,gradient:!1,children:(0,l.jsx)(r._,{style:{paddingRight:12,color:"#545454"},children:Z("label.payment.processing")})}),style:{marginBottom:12}}),(0,l.jsx)(m.ZP,{id:"pay-btn",ref:T,className:"btn btn-block btn-primary",loading:w,disabled:_||w,block:!0,size:"large",type:"primary",htmlType:"submit",children:I}),(0,l.jsx)(r._,{id:"ryft-pay-error",style:{marginTop:12,color:C},children:S})]})]})})}},61843:function(e,t,n){"use strict";n.d(t,{P:function(){return K}});var l=n(85893),i=n(82057),r=n(83663),o=n(1237),a=n(4982),s=n(11949),d=n(50820),c=n(89204),u=n(31596),p=n(87076),h=n(2516),m=n(57307),v=n(67294),y=n(97005),g=n(10042),f=n(95249),b=n(85551),x=n(618);let j={border:"1px solid #d9d9d9",borderRadius:6,padding:"10px 12px"};function C(e){let{hasSavedCards:t,saveCard:n,isGuest:r,onSaveCardChange:o,onPay:a,onAddCard:d,onBack:c,isSubmitting:p,payButtonLabel:C}=e,Z=(0,g.F)(),{t:w}=(0,s.q)(),_=(0,u.lq)(),[S,N]=(0,v.useState)(!1),[T,I]=(0,v.useState)(!1),[P,E]=(0,v.useState)(!1),M=(0,v.useMemo)(()=>({style:{base:{fontSize:"16px",color:Z.colorTextBase,"::placeholder":{color:Z.colorTextPlaceholder}},invalid:{color:Z.colorError}}}),[Z]),k=()=>{var e;return null!==(e=null==_?void 0:_.getElement(u.Ke))&&void 0!==e?e:null};return(0,l.jsxs)(h.Z,{vertical:!0,gap:12,style:{paddingTop:16},children:[c&&(0,l.jsxs)(b.ZP,{type:"text",onClick:c,style:{alignSelf:"flex-start",padding:0},children:[(0,l.jsx)(f.Z,{})," ",w("label.button.back")]}),(0,l.jsx)("div",{style:j,children:(0,l.jsx)(u.Ke,{options:M,onReady:()=>N(!0)})}),(0,l.jsxs)(h.Z,{gap:12,children:[(0,l.jsx)("div",{style:{...j,flex:1},children:(0,l.jsx)(u.Oh,{options:M,onReady:()=>I(!0)})}),(0,l.jsx)("div",{style:{...j,flex:1},children:(0,l.jsx)(u.vk,{options:M,onReady:()=>E(!0)})})]}),!t&&!r&&(0,l.jsx)(x.Z,{checked:n,onChange:e=>o(e.target.checked),children:w("info.card.savecard")}),p&&(0,l.jsx)(m.Z,{banner:!0,type:"info",message:(0,l.jsx)(y.Z,{pauseOnHover:!0,gradient:!1,children:(0,l.jsx)(i._,{style:{paddingRight:12,color:"#545454"},children:w("label.payment.processing")})}),style:{marginBottom:12}}),(0,l.jsx)(b.ZP,{type:"primary",block:!0,size:"large",loading:p||!(S&&T&&P),disabled:p,onClick:()=>{let e=k();e&&(t?d(e):a(e))},children:t?w("label.card.save"):C})]})}var Z=n(6218);async function w(e,t){var n;let l=new URLSearchParams({customerId:String(e),paymentMethodId:String(t)}),i=await fetch("/api/stripe/cards?".concat(l));if(!i.ok)throw Error(null!==(n=(await i.json()).error)&&void 0!==n?n:"Failed to load cards");return i.json()}async function _(e){var t;let n=await fetch("/api/stripe/paymentintents",{method:"POST",headers:{"Content-Type":"application/json",...(0,Z.Z)()},body:JSON.stringify(e)});if(!n.ok)throw Error(null!==(t=(await n.json()).error)&&void 0!==t?t:"Failed to create payment intent");return n.json()}async function S(e){var t;let n=await fetch("/api/stripe/paymentmethods",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw Error(null!==(t=(await n.json()).error)&&void 0!==t?t:"Failed to attach card");return n.json()}async function N(e,t){let n=await fetch("/api/stripe/paymentmethods/".concat(e,"?paymentMethodID=").concat(t),{method:"DELETE"});if(!n.ok&&204!==n.status){var l;throw Error(null!==(l=(await n.json()).error)&&void 0!==l?l:"Failed to delete card")}}async function T(e){var t;let n=await fetch("/api/stripe/confirm-payment",{method:"POST",headers:{"Content-Type":"application/json",...(0,Z.Z)()},body:JSON.stringify(e)});if(!n.ok)throw Error(null!==(t=(await n.json()).error)&&void 0!==t?t:"Failed to confirm payment");return n.json()}async function I(e){var t;let n=await fetch("/api/stripe/setupintents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentMethodID:e})});if(!n.ok)throw Error(null!==(t=(await n.json()).error)&&void 0!==t?t:"Failed to create setup intent");return n.json()}var P=n(99e3),E=n(74661),M=n(61107),k=n(21811),A=n(57446),L=n(14733),O=n(82220),R=n(76260);function F(e){let{brand:t}=e,n={fontSize:24,height:24,display:"flex",alignItems:"center"};return"visa"===t?(0,l.jsx)("span",{style:n,children:(0,l.jsx)(M.c,{})}):"mastercard"===t?(0,l.jsx)("span",{style:n,children:(0,l.jsx)(E.s,{})}):(0,l.jsx)("span",{style:n,children:(0,l.jsx)(P.ON,{})})}function D(e){let{cards:t,selectedCardId:n,onSelectCard:r,onDeleteCard:o,onAddNewCard:a,onPay:d,isSubmitting:c,payButtonLabel:u}=e,{t:p}=(0,s.q)(),{selectedPaymentMethod:v}=(0,k.Z)(e=>e),g=async e=>{(null==v?void 0:v.id)&&(await N(e,v.id),o(e))};return(0,l.jsxs)(h.Z,{vertical:!0,gap:16,style:{paddingTop:16},children:[(0,l.jsx)(O.Z,{dataSource:t,split:!1,renderItem:e=>(0,l.jsx)(O.Z.Item,{style:{cursor:"pointer",borderRadius:8,padding:"12px 16px",marginBottom:8,border:"1.5px solid ".concat(e.id===n?"#4096ff":"#f0f0f0")},onClick:()=>r(e.id),actions:[(0,l.jsx)(R.Z,{title:p("label.card.remove.title"),description:p("label.card.remove.description"),okText:p("label.yes"),cancelText:p("label.button.cancel"),onConfirm:t=>{null==t||t.stopPropagation(),g(e.id)},onPopupClick:e=>e.stopPropagation(),children:(0,l.jsx)(b.ZP,{size:"small",type:"text",icon:(0,l.jsx)(A.Z,{}),onClick:e=>e.stopPropagation()})},"delete")],children:(0,l.jsxs)(h.Z,{gap:8,align:"center",children:[(0,l.jsx)(F,{brand:e.card.brand}),(0,l.jsxs)(i._,{children:["•••• •••• •••• ",e.card.last4]})]})})}),(0,l.jsx)(b.ZP,{type:"text",onClick:a,style:{alignSelf:"flex-start",padding:0},icon:(0,l.jsx)(L.Z,{}),children:p("label.card.add.new")}),c&&(0,l.jsx)(m.Z,{banner:!0,type:"info",message:(0,l.jsx)(y.Z,{pauseOnHover:!0,gradient:!1,children:(0,l.jsx)(i._,{style:{paddingRight:12,color:"#545454"},children:p("label.payment.processing")})}),style:{marginBottom:12}}),(0,l.jsx)(b.ZP,{type:"primary",block:!0,size:"large",loading:c,disabled:!n||c,onClick:d,children:u})]})}var B=n(35186),U=n(32351);let z="GET_STRIPE_CARDS";var V=n(97588),q=n(76837),G=n(2859),H=n(30202);function K(e){var t,n;let{paymentContext:y,onClose:g,onSuccess:f,onError:b}=e,{stripe:x,savedCards:j,selectedCardId:Z,setSelectedCardId:N,view:P,setView:E,saveCard:M,setSaveCard:k,isSubmitting:A,isLoadingCards:L,errorMessage:O,handlePayWithSavedCard:R,handlePayWithNewCard:F,handleAddNewCard:K,handleDeleteC
1ard:Y}=function(e){var t,n;let{paymentContext:l,onSuccess:i,onError:r,onClose:o}=e,a=(0,v.useRef)(i),s=(0,v.useRef)(r),d=(0,v.useRef)(o);a.current=i,s.current=r,d.current=o;let[c,u]=(0,v.useState)(null),[p,h]=(0,v.useState)([]),[m,y]=(0,v.useState)(null),[g,f]=(0,v.useState)("new-card"),[b,x]=(0,v.useState)(!1),[j,C]=(0,v.useState)(!1),[Z,N]=(0,v.useState)(null),P=null==l?void 0:l.stripeContext,E=null==l?void 0:l.paymentMethod,M=null==l?void 0:l.customer,k=(0,H.NL)(),{mutateAsync:A,isPending:L}=function(){let{mutateAsync:e,isPending:t}=(0,B.b)({mutationFn:e=>_(e)});return{mutateAsync:e,isPending:t}}(),{mutateAsync:O,isPending:R}=function(){let{mutateAsync:e,isPending:t}=(0,B.b)({mutationFn:e=>I(e)});return{mutateAsync:e,isPending:t}}(),{mutateAsync:F,isPending:D}=function(){let{mutateAsync:e,isPending:t}=(0,B.b)({mutationFn:e=>S(e)});return{mutateAsync:e,isPending:t}}(),{mutateAsync:K,isPending:Y}=function(){let{mutateAsync:e,isPending:t}=(0,B.b)({mutationFn:e=>T(e)});return{mutateAsync:e,isPending:t}}(),{data:W,isLoading:J}=function(e){let{customerId:t,paymentMethodId:n,enabled:l}=e;return(0,U.z)({queryKey:[z,t,n],queryFn:()=>w(t,n),enabled:l&&!!t&&!!n})}({customerId:null!==(t=null==M?void 0:M.id)&&void 0!==t?t:void 0,paymentMethodId:null!==(n=null==E?void 0:E.id)&&void 0!==n?n:void 0,enabled:!!l});(0,v.useEffect)(()=>{W&&(h(W),W.length>0&&(f("saved-cards"),y(e=>null!=e?e:W[0].id)))},[W]),(0,v.useEffect)(()=>{if(!(null==P?void 0:P.publicApiKey))return;let{publicApiKey:e,isDirectCharges:t,connectAccount:n}=P;(0,G.J)(e,t&&n?{stripeAccount:n}:void 0).then(e=>u(e))},[null==P?void 0:P.publicApiKey]);let X=(0,v.useCallback)(async()=>{var e,t,n,i;if(c&&m&&(null==M?void 0:M.id)&&E&&(null==l?void 0:l.customerOrder))try{C(!0),N(null);let n=await A({payment_method_id:m,customerId:M.id,paymentMethodId:E.id,customerOrder:l.customerOrder}),i=await c.confirmCardPayment(n.clientSecret,{payment_method:m});i.error?(N(null!==(e=i.error.message)&&void 0!==e?e:"Payment failed"),s.current(null!==(t=i.error.message)&&void 0!==t?t:"Payment failed")):(a.current(l),d.current())}catch(e){N(null!==(n=null==e?void 0:e.message)&&void 0!==n?n:"Unexpected error"),s.current(null!==(i=null==e?void 0:e.message)&&void 0!==i?i:"Unexpected error")}finally{C(!1)}},[c,m,M,E,l,A]),Q=(0,v.useCallback)(async e=>{var t,n,i,r,o,u,p,h,m;let v=null!==(t=null==l?void 0:l.isGuest)&&void 0!==t&&t;if(c&&E&&(null==l?void 0:l.customerOrder)&&(v||(null==M?void 0:M.id)))try{C(!0),N(null);let t=await A({customerId:null!==(i=null==M?void 0:M.id)&&void 0!==i?i:null,paymentMethodId:E.id,customerOrder:l.customerOrder}),h=await c.confirmCardPayment(t.clientSecret,{payment_method:{card:e}});if(h.error){N(null!==(r=h.error.message)&&void 0!==r?r:"Payment failed"),s.current(null!==(o=h.error.message)&&void 0!==o?o:"Payment failed");return}let m=null===(n=h.paymentIntent)||void 0===n?void 0:n.payment_method,y="string"==typeof m?m:null;b&&y&&!v&&await K({payment_method_id:y,save_card:!0,customerId:null!==(u=null==M?void 0:M.id)&&void 0!==u?u:null,customerEmail:null!==(p=null==M?void 0:M.email)&&void 0!==p?p:"",paymentMethodId:E.id}),a.current(l),d.current()}catch(e){N(null!==(h=null==e?void 0:e.message)&&void 0!==h?h:"Unexpected error"),s.current(null!==(m=null==e?void 0:e.message)&&void 0!==m?m:"Unexpected error")}finally{C(!1)}},[c,M,E,l,b,A,K]),$=(0,v.useCallback)(async e=>{var t,n,l,i,r;if(c&&(null==M?void 0:M.id)&&E)try{C(!0),N(null);let i=await O(E.id),r=await c.confirmCardSetup(i.clientSecret,{payment_method:{card:e}});if(r.error){N(null!==(n=r.error.message)&&void 0!==n?n:"Failed to add card"),s.current(null!==(l=r.error.message)&&void 0!==l?l:"Failed to add card");return}let o=null===(t=r.setupIntent)||void 0===t?void 0:t.payment_method,a="string"==typeof o?o:null;if(!a)throw Error("Failed to add card: missing payment method ID from Stripe");await F({payment_method_id:a,customerId:M.id,paymentMethodId:E.id}),y(a),await k.invalidateQueries({queryKey:[z]}),(0,q.y)({event:V.s.ADD_PAYMENT_INFO,add_payment_info_success:1,add_payment_info_type:"stripe"}),f("saved-cards")}catch(e){N(null!==(i=null==e?void 0:e.message)&&void 0!==i?i:"Unexpected error"),(0,q.y)({event:V.s.ADD_PAYMENT_INFO,add_payment_info_success:0,add_payment_info_type:"stripe"}),s.current(null!==(r=null==e?void 0:e.message)&&void 0!==r?r:"Unexpected error")}finally{C(!1)}},[c,M,E,O,F,k]),ee=(0,v.useCallback)(e=>{let t=p.filter(t=>t.id!==e);if(h(t),m===e){var n,l;y(null!==(l=null===(n=t[0])||void 0===n?void 0:n.id)&&void 0!==l?l:null)}0===t.length&&f("new-card")},[p,m]);return{stripe:c,savedCards:p,selectedCardId:m,setSelectedCardId:y,view:g,setView:f,saveCard:b,setSaveCard:x,isSubmitting:j||L||R||D||Y,isLoadingCards:J,errorMessage:Z,handlePayWithSavedCard:X,handlePayWithNewCard:Q,handleAddNewCard:$,handleDeleteC
1ard:ee}}({paymentContext:y,onSuccess:f,onError:b,onClose:g}),{t:W}=(0,s.q)(),{formatCurrencyByCurrencyCode:J}=(0,a.U)(),X=(0,d.Z)(e=>e.company),Q=(0,c.Z)(e=>e.customer),$=null==y?void 0:y.customerOrder,ee="".concat(W("label.button.paybycard.standard")," (").concat(J(null!==(t=null==$?void 0:$.subTotal)&&void 0!==t?t:0,null==$?void 0:$.currencyCode),")");return(0,l.jsx)(p.Z,{open:!0,onCancel:g,footer:null,maskClosable:!1,closable:!A,centered:!0,children:(0,l.jsxs)(h.Z,{gap:32,vertical:!0,style:{paddingTop:32},children:[(0,l.jsxs)(h.Z,{justify:"space-between",align:"center",style:{width:"100%"},vertical:!0,gap:8,children:[(0,l.jsx)(r.F,{level:4,children:null==X?void 0:X.name}),(0,l.jsx)(i._,{children:null==Q?void 0:Q.email})]}),L?(0,l.jsx)(o.b,{style:{display:"block",margin:"24px auto"}}):(0,l.jsxs)(u.eK,{stripe:x,children:[O&&(0,l.jsx)(m.Z,{type:"error",message:O,style:{marginBottom:12}}),"saved-cards"===P?(0,l.jsx)(D,{cards:j,selectedCardId:Z,onSelectCard:N,onDeleteCard:Y,onAddNewCard:()=>E("new-card"),onPay:R,isSubmitting:A,payButtonLabel:ee}):(0,l.jsx)(C,{hasSavedCards:j.length>0,saveCard:M,isGuest:null!==(n=null==y?void 0:y.isGuest)&&void 0!==n&&n,onSaveCardChange:k,onPay:F,onAddCard:K,onBack:j.length>0?()=>E("saved-cards"):void 0,isSubmitting:A,payButtonLabel:ee})]})]})})}},93543:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var l=n(67294),i=n(71164),r=n(79585);function o(e){let{isGuestFromServer:t=!1}=e,{isGuest:n,setIsGuest:o}=(0,r.Z)(e=>e),a=(0,l.useRef)(!1);(0,i.t)();let s=!a.current;return s&&(a.current=!0,o(t)),(0,l.useEffect)(()=>{o(t)},[t,o]),{isGuest:s?t:n}}},20458:function(e,t,n){"use strict";n.d(t,{c:function(){return eC}});var l=n(67294),i=n(52140),r=n(1073),o=n(70751),a=n(24678);async function s(e){let t=await (0,a.U2)(e);return t?Date.now()-t.updatedAt>t.ttl?(await c(e),null):t.data:null}async function d(e,t,n){var l;let i=null!==(l=null==n?void 0:n.ttl)&&void 0!==l?l:864e5,r={data:t,updatedAt:Date.now(),ttl:i};await (0,a.t8)(e,r)}async function c(e){await (0,a.IV)(e)}var u=n(66340),p=n(35186),h=n(5579),m=n(97454),v=n(14091),y=n(36423),g=n(11949),f=n(69166),b=n(52675),x=n(89204),j=n(79585),C=n(87121),Z=n(21811),w=n(89486),_=n(90619),S=n(70073),N=n(90661),T=n(34026),I=n(30381),P=n.n(I),E=n(15093);let M=["CASH","CARD"];var k=n(20357),A=n(76822),L=n(95547),O=n(85893),R=n(86830),F=n(32351),D=n(6609),B=n(51906),U=n(87076),z=n(14640),V=n(82057),q=n(83663),G=n(71242);function H(e){let t=null==e?void 0:e.body;return t&&"string"==typeof t.detail&&t.detail.trim()?t.detail:e instanceof Error?e.message:""}var K=n(97826),Y=n(83846),W=n(84368),J=n(21165),X=n(5854),Q=n(84976),$=n(62682);let ee=[$.u.CASH,$.u.CARD,$.u.CARDTERMINAL];var et=n(40048);let en=e=>(0,et.v_)("transactionsequences",{},e);var el=n(6350),ei=n(57453),er=n(96535),eo=n(37781),ea=n(76837),es=n(6218);async function ed(e){var t;let n=await fetch("/api/ryft/paymentsessions",{method:"POST",headers:{"Content-Type":"application/json",...(0,es.Z)()},body:JSON.stringify(e)});if(!n.ok)throw Error(null!==(t=(await n.json()).error)&&void 0!==t?t:"Failed to create Ryft payment session");return n.json()}async function ec(e){var t;let n=await fetch("/api/ryft/paymentmethods",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw Error(null!==(t=(await n.json()).error)&&void 0!==t?t:"Failed to fetch Ryft payment methods");return n.json()}let eu=()=>({async handlePayment(e){var t,n,l,i,r,o,a;if(!e.paymentMethod)throw Error("Missing payment method.");if(!e.customerOrder)throw Error("Missing customer order.");let s=e.paymentMethod,d=e.customerOrder,c=s.paymentMethodIntegration,u=null===(n=s.paymentMethodParams)||void 0===n?void 0:null===(t=n.find(e=>"sub_account"===e.key))||void 0===t?void 0:t.value,p=null==c?void 0:null===(i=c.paymentMethodIntegrationParams)||void 0===i?void 0:null===(l=i.find(e=>"client_public_key"===e.key))||void 0===l?void 0:l.value,h=await ed({paymentMethodId:null!==(r=s.id)&&void 0!==r?r:0,customerOrderId:null!==(o=d.id)&&void 0!==o?o:0}),m=e.isGuest?null:await ec({customerEmail:d.customerEmail,paymentMethodIntegrationId:null!==(a=null==c?void 0:c.id)&&void 0!==a?a:0});if(!h)throw Error("Failed to create payment session.");return{...e,ryftContext:{publicApiKey:null!=p?p:"",clientSecret:h.clientSecret,paymentMethodsJsonString:JSON.stringify(m),subAccount:null!=u?u:""}}}});n(96430);let ep=()=>({async handlePayment(e){var t;if(!e.paymentMethod)throw Error("Missing payment method.");if(!e.customerOrder)throw Error("Missing customer order.");if(!e.isGuest&&!(null===(t=e.customer)||void 0===t?void 0:t.id))throw Error("Missing customer.");let n=function(e){var t,n;let l=null!==(n=null===(t=e.paymentMethodIntegration)||void 0===t?void 0:t.paymentMethodIntegrationParams)&&void 0!==n?n:[],i=e=>{var t,n;return null!==(n=null===(t=l.find(t=>t.key===e))||void 0===t?void 0:t.value)&&void 0!==n?n:""};return{secretApiKey:i("secret_api_key"),publicApiKey:i("public_api_key"),isDirectCharges:"true"===i("direct_charges"),connectAccount:i("connect_account")||null}}(e.paymentMethod);return{...e,stripeContext:{clientSecret:"",publicApiKey:n.publicApiKey,isDirectCharges:n.isDirectCharges,connectAccount:n.connectAccount}}}});var eh=n(2516);let em=e=>({title:(0,O.jsx)(q.F,{level:4,children:"Notice"}),content:(0,O.jsxs)(eh.Z,{vertical:!0,children:[(0,O.jsxs)(V._,{children:["You have already made a successful payment at ",e,"."]}),(0,O.jsx)(V._,{children:"If you want to process another payment for a new order tap the link below."})]}),okText:"Process new payment",cancelText:"View your last paid orders",icon:null,maskClosable:!1,cancelButtonProps:{style:{width:"100%",marginLeft:0,marginRight:0}},okButtonProps:{style:{width:"100%",marginTop:12,marginLeft:0,marginRight:0}},styles:{content:{padding:24,width:350}}}
1),ev=(e,t,n)=>(0,et.gz)("checkout/".concat(e,"?lang=").concat(t),{},n),ey=(e,t,n)=>(0,et.v_)("checkout/".concat(e,"/validate?lang=").concat(t),{},n);var eg=n(49826),ef=n(54887);let eb=(e,t)=>(0,et.U2)("idempotencykeys?".concat(ef.Z.stringify(e)),t),ex={USER_PROFILE_ORDERS:"/user-profile#orders-history",ORDER_CONFIRMATION:"/order-confirmation"},ej={UNSUPPORTED_PROCESSOR:"error.payment.unsupported.processor",MISSING_CUSTOMER:"error.customer.missing",MISSING_CUSTOMER_OR_TRANS_ID:"error.customer.missing.trans.id",MISSING_CART:"error.cart.missing",CUSTOMER_ORDER_NOT_AVAILABLE:"error.order.not.available",FAILED_CONFIRM_TIME_SLOT:"error.preorder.failed.confirm.time.slot",MISSING_ORDER_TIME:"error.order.time.missing",MISSING_PAYMENT_METHOD:"error.payment.method.missing",MISSING_TABLE_NUMBER:"error.table.number.missing",MISSING_PHONE_NUMBER:"error.phone.number.missing",MISSING_LINE_ITEMS:"error.line.items.missing"};function eC(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,{availableServices:c,selectedService:I,tableNumbers:et}=e,{branch:es}=(0,b.Z)(e=>e),{setSelectedService:ed,setAvailableServices:ec}=(0,_.Z)(e=>e),eh=(0,A.bn)(),{shoppingCart:ef,isLoading:eC,updateShoppingCart:eZ,updateShoppingCartAddress:ew,applyVoucher:e_,removeVoucher:eS,removeCartItemByIds:eN,clearCart:eT}=(0,k.$)(),{onServiceChange:eI,onServiceSelected:eP,selectedService:eE,availableServices:eM,modalChangeTypeContextHolder:ek,isLoading:eA}=function(e){let{updateShoppingCart:t,removeCartItemByIds:n,shoppingCart:a,initialAvailableServices:c}=e,{t:I}=(0,g.q)(),k=(0,v.l)(),{isGuest:A,isQrAccess:L}=(0,j.Z)(e=>e),{branch:O,setBranch:R}=(0,b.Z)(e=>e),{selectedService:F,availableServices:D,setSelectedService:B,setAvailableServices:U}=(0,_.Z)(e=>e),{setPaymentMethods:z,setSelectedPaymentMethod:V}=(0,Z.Z)(e=>e),{setDateOptionsForPreOrders:q,setPreOrderData:G}=(0,w.Z)(e=>e),{resetTip:H}=(0,N.Z)(e=>e),{customer:K}=(0,x.Z)(e=>e),{selectedTableNumber:Y}=(0,S.Z)(e=>e),{setSelectedDate:W,setSelectedTime:J,setSelectedOrderTimeType:X}=(0,C.Z)(e=>e),{updateCartWithValidatedOrderType:Q,modalChangeTypeContextHolder:$}=(0,y.U)({removeCartItemByIds:n,updateShoppingCart:t}),{mutateAsync:ee,isPending:et}=function(){let{mutate:e,mutateAsync:t,status:n,error:l,isPending:i,data:r,isSuccess:a}=(0,p.b)({mutationFn:async e=>{let t=JSON.stringify([h.z,e]),n=await s(t);if(n)return n;let l=await (0,o.aM)(null!=e?e:0,"All");return await d(t,l,{ttl:u.cA}),l}});return{mutate:e,mutateAsync:t,status:n,error:l,isPending:i,data:r,isSuccess:a}}(),{getPreOrderData:en}=(0,E.n)(),{getBranchStatus:el}=(0,m.v)(),ei=(0,l.useCallback)(async(e,t)=>{let n=await ee(t.id),l=(0,o.No)(n),i=(0,T.m)(l,e),r=n.paymentMethods.filter(e=>e.orderType===(null==i?void 0:i.orderType)&&"ENABLED"===e.status&&M.includes(e.paymentType)),a=el(n,null==i?void 0:i.orderType),{preOrderData:s,dateOptionsForPreOrders:d}=await en(i),c=(null==i?void 0:i.orderTime)?"ASAP (AROUND ".concat(null==i?void 0:i.orderTime," minutes)"):"";return{newBranch:n,availableServices:l,selectedService:i,paymentMethods:r,isOrderNow:a.now,asapLabel:c,currentDate:P()().format("YYYY-MM-DD"),preOrderData:s,dateOptionsForPreOrders:d}},[ee,el,en,I]),er=(0,l.useCallback)(e=>{let{newBranch:t,availableServices:n,selectedService:l,paymentMethods:i,isOrderNow:r,asapLabel:o,currentDate:a,preOrderData:s,dateOptionsForPreOrders:d}=e;H(),R(t),U(n),B(l),z(i),i.length>0&&V(i[0]),q(d),G(s),r?(W(a),J(o),X("now")):(W(null),J(null),X(null))},[H,R,U,B,z,V,q,G,W,J,X]),eo=(0,l.useCallback)(e=>{var t,n,l,o;let{selectedService:s,paymentMethods:d,isOrderNow:c,asapLabel:u}=e,p=null==K?void 0:null===(t=K.addresses)||void 0===t?void 0:t.find(e=>e.isDefault),h=(0,r.uz)(p,null==a?void 0:a.shoppingCartAddress,null==s?void 0:s.orderType),m=(null==s?void 0:s.orderType)===f.m["EAT-IN"]&&(null==s?void 0:s.servedAtTable)?null==Y?void 0:null===(n=Y.tableNumber)||void 0===n?void 0:n.toString():void 0,v=(0,i._0)(A,null==s?void 0:s.orderType,L),y=(0,i.C)(v,A,null==a?void 0:a.branchId),g=(0,i.z$)(v,A,null==a?void 0:a.branchId);return!g||(null==a?void 0:a.shoppingCartAddress)||(h=g),{orderType:null==s?void 0:s.orderType,preOrdered:!c,orderTime:c?u:null,tableNumber:m,paymentMethodId:null!==(o=null===(l=d[0])||void 0===l?void 0:l.id)&&void 0!==o?o:null,shoppingCartAddress:h,flow:v,...y}},[k,A,L,K,a,Y]),ea=(0,l.useCallback)(async e=>{if(!O||!e)return;let t=await ei(e,O),n=eo(t);try{await Q(n,{flow:k})&&er(t)}catch(e){console.error("Failed to change service:",e)}},[O,ei,er,eo,Q]),es=(0,l.useCallback)(async e=>{var t;B(null!==(t=D.find(t=>t.orderType===e))&&void 0!==t?t:null)},[B,D]);return(0,l.useEffect)(()=>{U(c)},[c]),{onServiceChange:ea,onServiceSelected:es,selectedService:F,availableServices:D,modalChangeTypeContextHolder:$,isLoading:et}}({updateShoppingCart:eZ,removeCartItemByIds:eN,shoppingCart:ef,initialAvailableServices:c}),{paymentMethods:eL,selectedPaymentMethod:eO,onPaymentMethodSelected:eR,onPaymentMethodChange:eF}=function(e){let{updateShoppingCart:t,selectedService:n,branch:i}=e,{setPaymentMethods:r,setSelectedPaymentMethod:o,paymentMethods:a,selectedPaymentMethod:s}=(0,Z.Z)(e=>e),d=(0,v.l)(),c=(0,l.useCallback)(e=>{o(e)},[]),u=(0,l.useCallback)(async e=>{var n;let l={paymentMethodId:null!==(n=null==e?void 0:e.id)&&void 0!==n?n:null,flow:d};o(e),await t(l,{flow:d})},[d,t,o]);return(0,l.useEffect)(()=>{i&&i.paymentMethods&&n&&r(i.paymentMethods.filter(e=>e.orderType===n.orderType&&"ENABLED"===e.status&&(e.channel===Q.g[Q.$.ALL]||e.channel===Q.g[Q.$.WEB])&&ee.
1includes(e.paymentType)))},[i,n]),{paymentMethods:a,selectedPaymentMethod:s,onPaymentMethodSelected:c,onPaymentMethodChange:u}}({updateShoppingCart:eZ,selectedService:eE,branch:es}),{tableNumbers:eD,selectedTableNumber:eB,onTableNumberChange:eU}=function(e,t,n){let{setTableNumbers:i,setSelectedTableNumber:r,tableNumbers:o,selectedTableNumber:a}=(0,S.Z)(e=>e),s=(0,v.l)(),d=(0,l.useCallback)(e=>{var t;r(null!==(t=null==o?void 0:o.find(t=>t.tableNumber===e))&&void 0!==t?t:null)},[o,r]),c=(0,l.useCallback)(async t=>{var n;let l=null!==(n=null==o?void 0:o.find(e=>e.tableNumber===t))&&void 0!==n?n:null;r(l),await e({tableNumber:null==l?void 0:l.tableNumber},{flow:s})},[s,o,r,e]);return(0,l.useEffect)(()=>{r(null)},[t]),(0,l.useEffect)(()=>{i(n)},[n]),{selectedService:t,tableNumbers:o,selectedTableNumber:a,onTableNumberSelected:d,onTableNumberChange:c}}(eZ,eE,et),{isCheckoutInitializing:ez}=function(e){let{shoppingCart:t,availableServices:n,paymentMethods:r,updateShoppingCart:o,onPaymentMethodSelected:a,isInitialValuesLoading:s,isGuest:d=!1}=e,[c,u]=(0,l.useState)(s),{branch:p}=(0,b.Z)(e=>e),{setSelectedService:h}=(0,_.Z)(e=>e),{setDateOptionsForPreOrders:v,setPreOrderData:y}=(0,w.Z)(e=>e),{setSelectedDate:g,setSelectedTime:f,setSelectedOrderTimeType:x}=(0,C.Z)(e=>e),{setSelectedTableNumber:j,tableNumbers:Z}=(0,S.Z)(e=>e),N=(0,l.useRef)(!1),{getPreOrderData:T}=(0,E.n)(),{getBranchStatus:I}=(0,m.v)();return(0,l.useEffect)(()=>{(async()=>{var e,l;if(N.current||!t||0===n.length)return;N.current=!0;let s=(0,X._W)(t,r),c=(0,X.Fo)(t,n),m=I(p,null==c?void 0:c.orderType),{preOrderData:b,dateOptionsForPreOrders:C}=await T(c),w=(0,X.HC)(t,c,m);if(h(c),a(s),v(C),y(b),w&&(g(w.date),f(w.time),x(w.type)),t.tableNumber&&Z){let e=Z.find(e=>e.tableNumber===t.tableNumber);e&&j(e)}let _={orderType:null==c?void 0:c.orderType,preOrdered:(null==w?void 0:w.type)==="later",orderTime:w&&"later"===w.type?"".concat(w.date," ").concat(w.time):null!==(e=null==w?void 0:w.time)&&void 0!==e?e:null,paymentMethodId:null!==(l=null==s?void 0:s.id)&&void 0!==l?l:null,tableNumber:null==t?void 0:t.tableNumber};d||(_.customerId=t.customerId);let S=(0,i._0)(d,null==c?void 0:c.orderType);Object.assign(_,(0,i.C)(S,d,null==t?void 0:t.branchId));let P=(0,i.z$)(S,d,null==t?void 0:t.branchId);!P||(null==t?void 0:t.shoppingCartAddress)||(_.shoppingCartAddress=P),await o(_,{flow:S}),u(!1)})()},[t]),{isInitialized:N.current,isCheckoutInitializing:c}}({shoppingCart:ef,availableServices:eM,paymentMethods:eL,updateShoppingCart:eZ,onPaymentMethodSelected:eR,isInitialValuesLoading:t,isGuest:n}),{summaryPrice:eV}=(0,L.Y)({shoppingCart:ef,selectedService:eE}),{tipType:eq,tipValue:eG,onTipChange:eH}=function(e){let{selectedService:t,updateShoppingCart:n}=e,{tipType:i,tipValue:r,setTip:o,resetTip:a}=(0,N.Z)(e=>e),s=(0,v.l)();return{tipType:i,tipValue:r,onTipChange:(0,l.useCallback)(async(e,l,i)=>{0===e?a():o(l,i);let r=null==t?void 0:t.orderType,d=(0,Y.K9)(r)?{driverTip:e,tip:0}:{driverTip:0,tip:e};await n(d,{flow:s})},[t,n,a,o,s]),resetTip:a}}({selectedService:eE,updateShoppingCart:eZ}),{isModalOpen:eK,formType:eY,handleShow:eW,handleCancel:eJ,onChangeFormType:eX}=(0,K.F)(),eQ=function(e){var t,n,i,o,a,s;let{shoppingCart:d,updateShoppingCart:c,applyVoucher:p,removeVoucher:h,isGuest:m=!1,onLoginRequired:y}=e,{t:f}=(0,g.q)(),b=(0,z.useLocale)(),C=(0,v.l)(),{customer:Z}=(0,x.Z)(e=>e),{selectedService:w}=(0,_.Z)(e=>e),{setIsGuest:S}=(0,j.Z)(e=>e),[N,T]=(0,l.useState)(!1),[I,P]=U.Z.useModal(),[E,M]=(0,l.useState)(null),[k,A]=(0,l.useState)(null),[L,K]=(0,l.useState)(!1),Y=null!==(t=null==d?void 0:d.branchId)&&void 0!==t?t:0,W=null!==(n=null==d?void 0:d.promoCode)&&void 0!==n?n:null,J=null!==(i=null==d?void 0:d.voucherCode)&&void 0!==i?i:null,X=null!==(o=null==d?void 0:d.voucherDiscount)&&void 0!==o?o:0,Q=J&&null!==(a=null==d?void 0:d.voucherNotice)&&void 0!==a?a:null,$=!!(null==d?void 0:d.customerId)&&!!p,{data:ee,isLoading:et}=function(e){let{isEnabled:t,...n}=e,{data:l,isLoading:i}=(0,F.z)({queryKey:["GET_PROMOTION_COUPONS",n],queryFn:()=>(0,R.sA)(n),enabled:t,select:e=>Array.isArray(e)?e:[],...u.lb});return{data:l,isLoading:i}}({storeIds:Y,conditionTypes:G.Ex.PROMOTION_CODE,visibility:[G.hr.PUBLIC,G.hr.TARGETED].join(","),lang:b,isEnabled:N&&Y>0}),{data:en,isLoading:el}=(0,D.v)($&&null!==(s=null==d?void 0:d.customerId)&&void 0!==s?s:void 0),ei=(0,l.useMemo)(()=>{var e;return(null!==(e=null==en?void 0:en.earnedVouchers)&&void 0!==e?e:[]).filter(e=>"ACTIVE"===e.status)},[null==en?void 0:en.earnedVouchers]),er=(0,l.useCallback)(async()=>{let e=await I.confirm({title:(0,O.jsx)(q.F,{level:4,children:f("coupon.onetime.login.title")}),content:(0,O.jsx)(V._,{children:f("coupon.onetime.login.description")}),okText:f("label.button.login.register"),cancelText:f("label.button.cancel"),centered:!0,icon:null,closable:!0,width:360,styles:{content:{padding:24,width:360}},cancelButtonProps:{style:{width:"100%",marginLeft:0,marginRight:0}},okButtonProps:{style:{width:"100%",marginTop:12,marginLeft:0,marginRight:0}}});return e&&(null==y||y()),e},[I,f,y]),eo=(0,l.useCallback)(async e=>{if(m&&e&&(null==ee?void 0:ee.some(t=>{var n;return null===(n=t.conditionGroups)||void 0===n?void 0:n.some(t=>{var n;return null===(n=t.conditions)||void 0===n?void 0:n.some(t=>t.type===G.Ex.PROMOTION_CODE&&t.promotionCode===e&&t.promoCodeOnePerUser)})}))){M(e),await er();return}await c({promoCode:e},{flow:C})},[m,ee,er,c,C]),ea=(0,l.useCallback)(async e=>{A(null),K(!0);try{if($&&p)try{await p(e);return}catch(t){let e=H(t);if(!/not found|does not belong/i.test(e)){A(e||f("label.promocode.invalid"));return}}try{await eo(e)}catch(e){A(H(e)||f("label.promocode.invalid"))}}finally{K(!1)}},[$,p,eo,f]),es=(0,l.useCallback)(async e=>{if(p){A(null),K(!0);try{await p(e)}catch(e){A(H(e)||f("label.promocode.invalid"))}finally{K(!1)}}},[p,f]),ed=(0,l.useCallback)(()=>T(!0),[]),ec=(0,l.useCallback)(()=>{A(null),T(!1)},[]),eu=(0,l.useCallback)(async e=>{(!W||W===e||await I.confirm({title:(0,O.jsx)(q.F,{level:4,children:f("coupon.conflict.title")}),content:(0,O.jsx)(V._,{children:f("coupon.conflict.description")}),okText:f("label.yes"),cancelText:f("label.no"),centered:!0,icon:null,closable:!0,width:360,styles:{content:{padding:24,width:360}},cancelButtonProps:{style:{width:"100%",marginLeft:0,marginRight:0}},okButtonProps:{style:{width:"100%",marginTop:12,marginLeft:0,marginRight:0}}}))&&ea(e)},[W,ea,I,f]),ep=(0,l.useCallback)(async()=>
1{if(A(null),J&&h){await h();return}await eo(null)},[J,h,eo]);return{promoCode:null!=W?W:"",handlePromoCodeChange:eo,isModalOpen:N,handleOpenModal:ed,handleCloseModal:ec,contextHolder:P,coupons:null!=ee?ee:[],isLoadingCoupons:et,appliedPromoCode:W,vouchers:ei,isLoadingVouchers:el,appliedVoucherCode:J,voucherDiscount:X,voucherNotice:Q,canUseVouchers:$,handleApplyVoucher:es,handleApplyCoupon:eu,handleRemoveCoupon:ep,onLoginSuccess:(0,l.useCallback)(async e=>{let t=null!=e?e:Z;if(!t)return;let n={flow:B.Zw.CHECKOUT,customerId:t.id,shoppingCartAddress:(0,r.AO)(t,null==w?void 0:w.orderType),guestFirstName:null,guestLastName:null,guestEmail:null,guestPhone:null};E&&(n.promoCode=E),(0,r.XH)(void 0,void 0,t.id),await (0,r.Mm)(c,n),M(null),S(!1)},[Z,null==w?void 0:w.orderType,c,C,E]),codeError:k,isApplyingCode:L}}({shoppingCart:ef,updateShoppingCart:eZ,applyVoucher:e_,removeVoucher:eS,isGuest:n,onLoginRequired:eW}),{isPaymentSuccess:e$,isLoadingCheckout:e0,idempotencyContextHolder:e1,notificationContextHolder:e2,isRyftModalOpen:e4,isStripeModalOpen:e6,paymentContext:e5,handleSubmit:e8,ryftHideModal:e9,stripeHideModal:e3,onPaymentSuccess:e7,onPaymentError:te}=function(e){var t,n;let{shoppingCart:i,clearCart:r,updateShoppingCart:o}=e,{t:a}=(0,g.q)(),s=(0,j.Z)(e=>e.isGuest),d=(0,v.l)(),[c,u]=(0,l.useState)(!1),[h,m]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!1),[w,N]=(0,l.useState)(!1),[T,I]=(0,l.useState)(null),{customer:P}=(0,x.Z)(e=>e),{selectedService:E}=(0,_.Z)(e=>e),{selectedDate:M,selectedTime:k,selectedOrderTimeType:L,selectedPreOrderTimeSlot:O}=(0,C.Z)(e=>e),{selectedPaymentMethod:R}=(0,Z.Z)(e=>e),F=(null!==(t=null==i?void 0:i.total)&&void 0!==t?t:0)===0&&(null!==(n=null==i?void 0:i.subTotal)&&void 0!==n?n:0)>0,{selectedTableNumber:D}=(0,S.Z)(e=>e),{showError:V}=(0,eo.p)(),q=(0,A.bn)(),[G,H]=U.Z.useModal(),{showWarning:K,showError:Y,contextHolder:W}=(0,er.C)(),{mutateAsync:J,isPending:X}=(0,ei.v)(),{mutateAsync:Q,isPending:ee}=function(){let{mutate:e,mutateAsync:t,status:n,error:l,isPending:i,data:r,isSuccess:o}=(0,p.b)({mutationFn:e=>(0,el.Fw)(e)});return{mutate:e,mutateAsync:t,status:n,error:l,isPending:i,data:r,isSuccess:o}}(),{mutateAsync:et,isPending:es}=function(){let e=(0,z.useLocale)(),{mutate:t,mutateAsync:n,status:l,error:i,isPending:r,data:o,isSuccess:a}=(0,p.b)({mutationFn:t=>ev(t,e,{apiVersion:"v1"})});return{mutate:t,mutateAsync:n,status:l,error:i,isPending:r,data:o,isSuccess:a}}(),{mutateAsync:ed,isPending:ec}=function(){let e=(0,z.useLocale)(),{mutate:t,mutateAsync:n,status:l,error:i,isPending:r,data:o,isSuccess:a}=(0,p.b)({mutationFn:t=>ey(t,e,{apiVersion:"v1"}),disableGlobalErrorHandler:!0,onError:e=>{if(eg.fK.is(e))throw new eg.fK(e.body)}});return{mutate:t,mutateAsync:n,status:l,error:i,isPending:r,data:o,isSuccess:a}}(),{mutateAsync:eh,isPending:ef}=function(){let{mutate:e,mutateAsync:t,status:n,error:l,isPending:i,data:r,isSuccess:o}=(0,p.b)({mutationFn:e=>eb({customerID:e})});return{mutate:e,mutateAsync:t,status:n,error:l,isPending:i,data:r,isSuccess:o}}(),{mutateAsync:eC}=function(){let{mutate:e,mutateAsync:t,status:n,error:l,isPending:i,data:r,isSuccess:o}=(0,p.b)({mutationFn:()=>en()});return{mutate:e,mutateAsync:t,status:n,error:l,isPending:i,data:r,isSuccess:o}}(),eZ=e=>{I(e),b(!0)},ew=e=>{I(e),N(!0)},e_=(0,l.useMemo)(()=>eu(),[]),eS=(0,l.useMemo)(()=>ep(),[]),eN=(0,l.useMemo)(()=>({RYFTPAY:{processor:e_,openModal:eZ},STRIPE:{processor:eS,openModal:ew}}),[e_,eS]),eT=e=>!!e&&e in eN,eI=(0,l.useCallback)(async e=>{var t,n,l,i,r,o;let d=a("label.warning"),c=a("label.got.it"),u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error";"error"===t?Y({title:d,content:e,okText:c}):K({title:d,content:e,okText:c})};if(!e.shoppingCart)return u(a(ej.MISSING_CART)),!1;let p=(null===(t=e.selectedService)||void 0===t?void 0:t.orderType)===f.m["EAT-IN"],h=null===(n=e.selectedService)||void 0===n?void 0:n.servedAtTable;if(void 0===e.paymentMethod)return u(a(ej.MISSING_PAYMENT_METHOD)),!1;if(p&&h&&!e.tableNumber)return u(a(ej.MISSING_TABLE_NUMBER)),!1;if(s){let{guestFirstName:t,guestLastName:n,guestEmail:l,guestPhone:i}=e.shoppingCart,r=[B.Zw.ONLINE_DELIVERY,B.Zw.ONLINE_COLLECTION].includes(e.shoppingCart.flow);if(!(t&&n&&l&&i)&&r)return u(a("error.guest.contact.missing"),"warning"),!1}if(s){let{shoppingCartAddress:t}=e.shoppingCart,n=e.shoppingCart.flow===B.Zw.ONLINE_DELIVERY,l=null==t?void 0:null===(o=t.shoppingCartAddressFields)||void 0===o?void 0:o.some(e=>
1"coordinates"===e.fieldName&&e.fieldValue);if(n&&!l)return u(a("error.guest.address.missing"),"warning"),!1}return s||(null===(l=e.customer)||void 0===l?void 0:l.phone)||p?(null===(i=e.shoppingCart.items)||void 0===i?void 0:i.length)===0?(u(a(ej.MISSING_LINE_ITEMS)),!1):null!==(r=e.shoppingCart)&&void 0!==r&&!!r.orderTime||(u(a(ej.MISSING_ORDER_TIME)),!1):(u(a(ej.MISSING_PHONE_NUMBER)),!1)},[K,Y,a]),eP=async e=>{var t,n;if(s)return;if(!(null===(t=e.customer)||void 0===t?void 0:t.id)||!(null===(n=e.shoppingCart)||void 0===n?void 0:n.transId))throw Error(a(ej.MISSING_CUSTOMER_OR_TRANS_ID));let l=await Q({customerID:e.customer.id,transID:e.shoppingCart.transId,excludeFields:"All",offset:0,limit:1});if(l.length>0)return l[0]},eE=async e=>{var t;return await ed((null===(t=e.shoppingCart)||void 0===t?void 0:t.id)||0),{...e}},eM=async e=>{var t;if(s)return e;if(!(null===(t=e.customer)||void 0===t?void 0:t.id))throw Error(a(ej.MISSING_CUSTOMER));if("later"===e.selectedOrderTimeType&&e.selectedPreOrderTimeSlot&&!await J({customerId:e.customer.id,preOrderTimeSlot:e.selectedPreOrderTimeSlot}))throw Error(ej.FAILED_CONFIRM_TIME_SLOT);return e},ek=async e=>{var t,n,l;if((null===(t=e.paymentMethod)||void 0===t?void 0:t.paymentType)===$.u.CARD){let t=null===(l=e.paymentMethod)||void 0===l?void 0:null===(n=l.paymentMethodIntegration)||void 0===n?void 0:n.processorName;if(!t)throw Error("Payment processor not specified for card payment");if(!eT(t))throw Error("".concat(ej.UNSUPPORTED_PROCESSOR," ").concat(t))}let i={};if(await eP(e)||s){let e=await eC({});i.transId=e.sequenceID}return await o(i,{flow:d}),e},eA=async e=>{var t;let n=await et((null===(t=e.shoppingCart)||void 0===t?void 0:t.id)||0);return{...e,customerOrder:n}},eL=async e=>({...e,_redirectTo:"/order-confirmation"}),eO=async e=>({...e,_redirectTo:"/order-confirmation"}),eR=async e=>{var t;if(s)return e;if(!(null===(t=e.customer)||void 0===t?void 0:t.id))throw Error(ej.MISSING_CUSTOMER_OR_TRANS_ID);let n=await eh(e.customer.id);return{...e,idempotencyKeyList:n}},eF=async(e,t)=>{for(let n of t)e=await n(e);return e},eD=async e=>{if(!e.customerOrder)throw Error(ej.CUSTOMER_ORDER_NOT_AVAILABLE);(0,ea.F)(e.customerOrder),r();let t=e.customerOrder.id;if(q&&t)return q.goToConfirmation(t),e;let n="".concat(ex.ORDER_CONFIRMATION,"/").concat(t);return window.location.href=n,e},eB=async e=>await eF(e,[eE,eM,ek,eA,eL,eD]),eU=async e=>await eF(e,[eE,eM,ek,eA,eO,eD]),ez=async e=>await eF(e,[eE,eM,eR]),eV=async e=>await eF(e,[ek,eA]),eq=async e=>{if(F)return eB(e);try{var t,n;m(!0);let l=await ez(e);if(l.idempotencyKeyList&&l.idempotencyKeyList.length>0){m(!1);let e=l.idempotencyKeyList[0];if(!await G.confirm(em(e.customerDateCreated)))return m(!1),q||(window.location.href=ex.USER_PROFILE_ORDERS),l;m(!0)}let i=await eV(l),r=eN[null===(n=i.paymentMethod)||void 0===n?void 0:null===(t=n.paymentMethodIntegration)||void 0===t?void 0:t.processorName],o=await r.processor.handlePayment(i);return r.openModal(o),o}finally{m(!1)}},eG=(0,l.useCallback)(e=>{let t=e.detail||e.message;B.PR.is(e)&&(t=new B.PR(e.body.shoppingCartId,e.body.errors).errors.map(e=>e.errorMessage).join(", ")),V(a("label.error"),t)},[V,a]),eH=(0,l.useCallback)(async()=>{let e={isGuest:s,customer:P,shoppingCart:i,selectedService:E,selectedDate:M,selectedTime:k,selectedOrderTimeType:L,selectedPreOrderTimeSlot:O,paymentMethod:R,tableNumber:D,customerOrder:void 0,idempotencyKeyList:void 0,ryftContext:void 0,stripeContext:void 0};if(await eI(e))try{switch(null==R?void 0:R.paymentType){case $.u.CASH:await eB(e);break;case $.u.CARD:await eq(e);break;case $.u.CARDTERMINAL:await eU(e);break;default:throw Error("Unsupported payment type.")}}catch(e){eG(e)}},[P,i,E,M,k,L,O,R,D,eG,eI,eB,eq,eU]);return{handleSubmitCash:eB,handleSubmitCard:eq,handleSubmit:eH,ryftHideModal:()=>{b(!1),I(null)},stripeHideModal:()=>{N(!1),I(null)},onPaymentSuccess:e=>{if(!e){console.error("Payment context is null");return}u(!0),eD(e)},onPaymentError:e=>{console.error("Payment failed",e)},validateStateBeforeSubmit:eI,isRyftModalOpen:y,isStripeModalOpen:w,paymentContext:T,idempotencyContextHolder:H,notificationContextHolder:W,isPaymentSuccess:c,isLoadingCheckout:h||X||ee||ef||es||ec}}({shoppingCart:ef,clearCart:eT,updateShoppingCart:eZ}),tt=(0,l.useCallback)(async()=>
1{if(eh){eh.goToMenu();return}if(a){window.location.href=a;return}let e=(0,J.q)(null==es?void 0:es.urlPath),t=(0,J.t)();(0,W.E)(e+t,{orderType:(null==eE?void 0:eE.orderType)||""})},[eh,a,null==eE?void 0:eE.orderType,null==es?void 0:es.urlPath]);return(0,l.useEffect)(()=>{ed(I),ec(c)},[null==I?void 0:I.id,c.length]),{branch:es,service:{selectedService:eE,availableServices:eM,onServiceChange:eI,onServiceSelected:eP},cart:{shoppingCart:ef,isShoppingCartLoading:eC,updateShoppingCart:eZ,updateShoppingCartAddress:ew,summaryPrice:eV},tip:{tipType:eq,tipValue:eG,onTipChange:eH},promoCode:eQ,payment:{paymentMethods:eL,selectedPaymentMethod:eO,onPaymentMethodChange:eF},table:{tableNumbers:eD,selectedTableNumber:eB,onTableNumberChange:eU},actions:{handleSubmit:e8,handleBackToMenuPage:tt},modals:{modalChangeTypeContextHolder:ek,idempotencyContextHolder:e1,notificationContextHolder:e2},authModal:{isOpen:eK,formType:eY,handleCancel:eJ,onChangeFormType:eX,onLoginSuccess:eQ.onLoginSuccess},isLoadingCheckoutButton:eC||e0||eA||ez,isLoadingCheckout:e0,isCheckoutInitializing:ez,ryft:{isRyftModalOpen:e4,ryftHideModal:e9,paymentContext:e5,onPaymentSuccess:e7,onPaymentError:te,isPaymentSuccess:e$},stripe:{isStripeModalOpen:e6,stripeHideModal:e3,paymentContext:e5,onPaymentSuccess:e7,onPaymentError:te,isPaymentSuccess:e$}}}},59304:function(e,t,n){"use strict";n.d(t,{F:function(){return h}});var l=n(67294),i=n(70751),r=n(5579),o=n(71164),a=n(52675),s=n(34026),d=n(49826);n(40048);let c=async e=>{let t=await fetch("/api/tables?branchId=".concat(e),{method:"GET",headers:{"Content-Type":"application/json"}}),n=await t.json();if(t.ok)return n;throw new d.S0({code:n.code.toString(),message:n.message,status:n.status,name:d.S0.name})};var u=n(32351);let p=e=>{let{data:t,error:n,isFetching:l,isSuccess:i,refetch:r,isLoading:o,isPending:a}=(0,u.z)({queryKey:["GET_TABLES_BY_BRANCH_ID",e],queryFn:()=>c(null!=e?e:0),staleTime:1e3,enabled:!!e});return{data:t,error:n,isFetching:l,isSuccess:i,refetch:r,isLoading:o,isPending:a}};function h(e){let{branchId:t,orderType:n,branchInfo:d}=e,c=(0,a.Z)(e=>e.setBranch),{isQrAccess:u,orderSourceData:h}=(0,o.t)(),{data:m,isLoading:v,error:y}=(0,r.i)(t),{data:g,isLoading:f,error:b}=p(t),x=(0,l.useMemo)(()=>{if(!m)return[];let e=(0,i.No)(m);return u&&(null==h?void 0:h.orderType)?e.filter(e=>e.orderType===h.orderType):e},[m,u,h]),j=(0,l.useMemo)(()=>x?(0,s.m)(x,n):null,[x,n]);return(0,l.useEffect)(()=>{m&&c(m)},[m]),{initialValues:{branchId:t,branch:m,availableServices:x,selectedService:j,tableNumbers:g,branchInfo:d},isLoading:v||f,error:y||b}}},21165:function(e,t,n){"use strict";n.d(t,{q:function(){return i},t:function(){return r}});var l=n(6811);let i=e=>e?"/menu/".concat(e):"/menu",r=()=>{let e=(0,l.WJ)(null,"orderSource");if(e)try{let t=JSON.parse(e),n=new URLSearchParams;return t.orderType&&n.set("orderType",t.orderType),t.tableNumber&&n.set("tableNumber",t.tableNumber),t.orderSource&&n.set("orderSource",t.orderSource),"?".concat(n.toString())}catch(e){return""}return" "}},5215:function(e,t,n){"use strict";n.d(t,{f:function(){return d}});var l=n(67294),i=n(90030),r=n(90619),o=n(14640),a=n(69588),s=n(86671);function d(){let e=(0,o.useLocale)(),{selectedProductId:t,selectedKey:n,isOpenProductDetail:d,selectedMenuProductPreview:c,setSelectedProductId:u,setSelectedKey:p,setIsOpenProductDetail:h,setSelectedMenuProductPreview:m}=(0,i.Z)(e=>e),v=(0,r.Z)(e=>e.selectedService),y=(0,l.useMemo)(()=>({orderType:null==v?void 0:v.orderType,includePromotions:!0,lang:e,active:!0}),[null==v?void 0:v.orderType,e]),{data:g,isFetching:f,error:b}=(0,a.l$)(t,y),{contextHolder:x,validateBeforeAddCart:j}=(0,s.w)();return{product:g,isFetchingProduct:f,productError:b,selectedProductId:t,selectedKey:n,isOpenProductDetail:d,selectedMenuProductPreview:c,validateModalContextHolder:x,onOpenProductDetailModal:(0,l.useCallback)((e,t,n)=>{u(e),p(t),h(!0),m(n)},[]),onCloseProductDetail:(0,l.useCallback)(()=>{h(!1),u(void 0),p(void 0)},[]),validateBeforeAddCart:j}}},14091:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var l=n(52140),i=n(79585),r=n(90619);function o(){let e=(0,i.Z)(e=>e.isGuest),t=(0,i.Z)(e=>e.isQrAccess),n=(0,r.Z)(e=>e.selectedService);return(0,l._0)(e,null==n?void 0:n.orderType,t)}},62682:function(e,t,n){"use strict";var l,i;n.d(t,{u:function(){return l}}),(i=l||(l={})).CASH="CASH",i.CARD="CARD",i.CARDTERMINAL="CARDTERMINAL",i.PAYPAL="PAYPAL",i.APPLEPAY="APPLEPAY"},90030:function(e,t,n){"use strict";let l=(0,n(31993).U)(e=>({selectedProductId:void 0,selectedKey:void 0,isOpenProductDetail:!1,selectedMenuProductPreview:void 0,setSelectedProductId:t=>e({selectedProductId:t}),setSelectedKey:t=>e({selectedKey:t}),setIsOpenProductDetail:t=>e({isOpenProductDetail:t}),setSelectedMenuProductPreview:t=>e({selectedMenuProductPreview:t})}));t.Z=l},21811:function(e,t,n){"use strict";let l=(0,n(31993).U)(e=>
1({paymentMethods:[],selectedPaymentMethod:null,setPaymentMethods:t=>e({paymentMethods:t}),setSelectedPaymentMethod:t=>e({selectedPaymentMethod:t})}));t.Z=l},34026:function(e,t,n){"use strict";n.d(t,{m:function(){return l}});let l=(e,t)=>e.length?t&&e.find(e=>e.orderType===t)||e[0]:null},9615:function(e){e.exports={container:"CheckoutBranchInfo_container__Iemwu"}},93974:function(e){e.exports={info:"CheckoutCustomerAddress_info__TEsx_",label:"CheckoutCustomerAddress_label__iYxt_",modal:"CheckoutCustomerAddress_modal__lY7Go","no-address":"CheckoutCustomerAddress_no-address__y4E8j"}},92420:function(e){e.exports={container:"CheckoutDelivery_container__AVOzO",content:"CheckoutDelivery_content__xdnc9"}},6644:function(e){e.exports={container:"CheckoutDeliveryInstruction_container__V6NQT"}},45057:function(e){e.exports={info:"CheckoutGuestAddress_info__rnFnd",label:"CheckoutGuestAddress_label__bt74S",modal:"CheckoutGuestAddress_modal__4CaPa","no-address":"CheckoutGuestAddress_no-address__RdjaE"}},97975:function(e){e.exports={container:"CheckoutGuestContactInfo_container__JZHng"}},9216:function(e){e.exports={container:"CheckoutInformation_container__b6tkE",content:"CheckoutInformation_content__CPEgo",checkoutButton:"CheckoutInformation_checkoutButton__YZZP2"}},9895:function(e){e.exports={container:"CheckoutMap_container__bJ6bl",map:"CheckoutMap_map__DAtJg"}},43475:function(e){e.exports={paymentCard:"CheckoutPaymentMethod_paymentCard__dno9n",disabled:"CheckoutPaymentMethod_disabled__z9Lji",checked:"CheckoutPaymentMethod_checked__ITaZA",content:"CheckoutPaymentMethod_content__SKSXQ"}},2558:function(e){e.exports={container:"CheckoutPhoneNumber_container__ZdEMe"}},85164:function(e){e.exports={card:"CouponItem_card__jD4fN",imageWrapper:"CouponItem_imageWrapper__gWTpI",image:"CouponItem_image__GS9es"}},31223:function(e){e.exports={card:"VoucherItem_card__JjJ6j",iconWrapper:"VoucherItem_iconWrapper__gH4Fc"}},17535:function(e){e.exports={container:"CheckoutPromoCode_container__TOK2i",couponList:"CheckoutPromoCode_couponList__TQC5y"}},23174:function(e){e.exports={container:"CheckoutTable_container__ziSpg"}}}]);

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.