PageSourceSearch

https://pizzahut.com.br/_next/static/chunks/app/layout-9ff9ed7df0eb5082.js

js pizzahut.com.br collected 2026-10-02 03:18:39 UTC 65,299 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{2237:(e,s,t)=>{"use strict";t.d(s,{u:()=>o});var a=t(95155),r=t(51207),l=t(52619),n=t.n(l);function o(e){let{className:s}=e;return(0,a.jsx)(n(),{href:"/",className:s,children:(0,a.jsxs)("picture",{children:[(0,a.jsx)("source",{srcSet:r.V9,media:"(max-width: 768px)"}),(0,a.jsx)("img",{className:"h-7 max-md:min-w-13",src:r.V9,alt:"Pizza Hut",height:28})]})})}},15192:(e,s,t)=>{"use strict";t.d(s,{JD:()=>u,KS:()=>d,R6:()=>m,SK:()=>c,Ws:()=>p});var a=t(95155),r=t(8602),l=t(83101),n=t(24033),o=t(12115),i=t(64269);let d=o.forwardRef((e,s)=>{let{className:t,children:l,...n}=e;return(0,a.jsxs)(r.bL,{ref:s,className:(0,i.cn)("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...n,children:[l,(0,a.jsx)(h,{})]})});d.displayName=r.bL.displayName;let c=o.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)(r.B8,{ref:s,className:(0,i.cn)("group flex flex-1 list-none items-center justify-center gap-4 space-x-0",t),...l})});c.displayName=r.B8.displayName;let u=r.q7,m=(0,l.F)("group inline-flex gap-2 h-6 w-max items-center justify-center rounded-md text-white p-2 text-sm font-normal transition-colors focus:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-active:font-semibold [&>svg]:p-1 [&>svg]:rounded-lg [&>svg]:text-white");o.forwardRef((e,s)=>{let{className:t,children:l,...o}=e;return(0,a.jsxs)(r.l9,{ref:s,className:(0,i.cn)(m(),"group",t),...o,children:[l,(0,a.jsx)(n.A,{className:"relative top-px ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}).displayName=r.l9.displayName,o.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)(r.UC,{ref:s,className:(0,i.cn)("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full md:absolute md:w-auto",t),...l})}).displayName=r.UC.displayName;let p=r.N_,h=o.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)("div",{className:(0,i.cn)("absolute top-full left-0 flex justify-center"),children:(0,a.jsx)(r.LM,{className:(0,i.cn)("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-md border shadow-sm md:w-(--radix-navigation-menu-viewport-width)","hidden",t),ref:s,...l})})});h.displayName=r.LM.displayName,o.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)(r.C1,{ref:s,className:(0,i.cn)("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-1 flex h-1.5 items-end justify-center overflow-hidden",t),...l,children:(0,a.jsx)("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}).displayName=r.C1.displayName},18490:(e,s,t)=>{"use strict";t.d(s,{N:()=>u});var a=t(95155),r=t(17129),l=t(83101),n=t(52619),o=t.n(n),i=t(12115),d=t(64269);let c=(0,l.F)("inline-flex items-center justify-center transition-colors",{variants:{variant:{default:"text-primary hover:text-primary underline",subtle:"text-gray-500 hover:text-gray-700",underline:"text-red-500 underline hover:no-underline"},size:{sm:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{variant:"default",size:"md"}}),u=i.forwardRef((e,s)=>{let{className:t,variant:l,size:n,asChild:i=!1,...u}=e,m=i?r.DX:o();return(0,a.jsx)(m,{className:(0,d.cn)(c({variant:l,size:n,className:t})),ref:s,...u})});u.displayName="Link"},21657:(e,s,t)=>{"use strict";t.d(s,{D1:()=>N,Gg:()=>d,OQ:()=>g,W1:()=>j,aw:()=>u,eU:()=>p,fB:()=>x,w0:()=>v}),t(51207);var a=t(22119),r=t(1962),l=t(53455),n=t(80549);function o(e){let s=e.data,t=[],a={};return(null==s?void 0:s.addresses.length)>0&&s.addresses.forEach(e=>{e.formatted_address=(0,r.Ik)(e),e.structured_formatting=(0,r.lU)(e),e.current?a=e:t.push(e)}),{addresses:t,currentAddress:a,status:s.status,message:s.message}}async function i(){return a.Ay.get("/client/address").then(o)}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.useQuery)({queryKey:["FetchAddress"],queryFn:()=>i(),...e})}async function c(e){return a.Ay.post("/client/address",e).then(e=>o(e))}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,n.useMutation)({mutationFn:c,...e})}async function m(e){return a.Ay.put("/client/address/".concat(e)).then(e=>{let s=e.data,t=[],a={};return(null==s?void 0:s.addresses.length)>
10?(s.addresses.forEach(e=>{e.formatted_address=(0,r.Ik)(e),e.current?a=e:t.push(e)}),{addresses:t,currentAddress:a,status:s.status,message:s.message}):{addresses:t,status:s.status,message:s.message}})}function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,n.useMutation)({mutationFn:m,...e})}async function h(e){return a.Ay.delete("/client/address/".concat(e)).then(e=>e.data)}function x(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,n.useMutation)({mutationFn:h,...e})}async function f(e){return a.Yr.post("/api/google/geocode",{address:e}).then(e=>e.data)}function g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,n.useMutation)({mutationFn:f,...e})}async function y(e){return a.Yr.post("/api/google/geocodeReverse",{latlng:e}).then(e=>e.data)}function j(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,n.useMutation)({mutationFn:y,...e})}async function b(e){return(await a.Ay.get("/client/v2/zipcode/".concat(e))).data}function v(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l.useQuery)({queryKey:["FetchZipcode",e],queryFn:async()=>b(e),enabled:!1,...s})}function N(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,n.useMutation)({mutationFn:e=>b(e),...e})}t(22663)},27063:(e,s,t)=>{"use strict";t.d(s,{CG:()=>c,Fm:()=>f,Qs:()=>j,XW:()=>g,cj:()=>d,h:()=>x,kN:()=>u,qp:()=>y});var a=t(95155),r=t(12982),l=t(83101),n=t(12115),o=t(64269),i=t(60093);let d=r.bL,c=r.l9,u=r.bm,m=r.ZL,p=n.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)(r.hJ,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...l,ref:s})});p.displayName=r.hJ.displayName;let h=(0,l.F)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-200 data-[state=open]:duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),x=n.forwardRef((e,s)=>{let{side:t="right",className:l,children:n,...d}=e;return(0,a.jsxs)(m,{children:[(0,a.jsx)(p,{}),(0,a.jsxs)(r.UC,{ref:s,className:(0,o.cn)(h({side:t}),l),...d,children:[(0,a.jsxs)(r.bm,{className:"absolute left-6 top-[18px] rounded-xs opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,a.jsx)(i.A,{className:"text-primary",icon:"x",size:18}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]}),n]})]})});x.displayName=r.UC.displayName;let f=e=>{let{className:s,...t}=e;return(0,a.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 pl-16 pr-6 text-center sm:text-left",s),...t})};f.displayName="SheetHeader";let g=e=>{let{className:s,...t}=e;return(0,a.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t})};g.displayName="SheetFooter";let y=n.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)(r.hE,{ref:s,className:(0,o.cn)("text-xl font-semibold text-gray-base",t),...l})});y.displayName=r.hE.displayName;let j=n.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)(r.VY,{ref:s,className:(0,o.cn)("text-sm text-muted-foreground",t),...l})});j.displayName=r.VY.displayName},28899:(e,s,t)=>{"use strict";t.d(s,{t:()=>u});var a=t(95155),r=t(60093),l=t(3998),n=t(20243),o=t(64269),i=t(25762),d=t(73819);let c={1:"Receber em",2:"Entregar em",3:"Local"};function u(e){let{className:s,isClosedStore:t,...u}=e,p=(0,i.L)(e=>e.address),h=(0,i.L)(e=>e.setIsOpen),x=(0,d.K)(e=>e.store),f=x.deliveryTypeId,{addressType:g,street:y,number:j}=p;return(0,a.jsxs)(l.$n,{size:"sm",variant:"ghost",className:(0,o.cn)("group hover:text-ph-primary text-inverse grid h-13 w-full grid-cols-[32px_1fr_32px] items-center gap-2 font-normal hover:bg-white",{"text-main":t},s),onClick:()=>h(!0),...u,children:[(0,a.jsx)("div",{className:"grid place-content-center",children:(0,a.jsx)(r.A,{icon:"pin-map",size:20})}),y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("b",{className:"title-1 text-sm font-extrabold",children:c[f]}),(0,a.jsx)(m,{street:"".concat(g," ").concat(y),number:j})]}),(0,a.jsx)("div",{className:"body-1 truncate",children:x.name})]}),(0,a.jsx)("div",{className:"grid place-content-center",children:(0,a.jsx)(r.A,{icon:"arrow-down",size:20,className:(0,o.cn)("text-primary group-hover:text-ph-primary p-1 text-white",{"text-main":t})})})]}):(0,a.jsx)(n.E,{className:"h-4 w-44"})]})}function m(e){let{street:s,number:t}=e,r=s.slice(0,19);return s.length>r.length&&(r+="..."),(0,a.jsxs)("span",{className:"truncate text-left",children:[r,", ",t]})}},30621:(e,s,t)=>{"use strict";t.d(s,{default:()=>n});var a=t(95155),r=t(68321);let l=["897831343306914","1274274964849785"];function n(){return(0,a.jsx)(a.Fragment,{children:l.map(e=>(0,a.jsx)(r.default,{id:"meta-pixel-".concat(e),strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:"\n              !function(f,b,e,v,n,t,s)\n              {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n              n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n              if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n              n.queue=[];t=b.createElement(e);t.async=!0;\n              t.src=v;s=b.getElementsByTagName(e)[0];\n              s.parentNode.insertBefore(t,s)}(window, document,'script',\n              'https://connect.facebook.net/en_US/fbevents.js');\n              fbq('init', '".concat(e,"');\n              fbq('track', 'PageView');\n            ")}},e))})}},34507:(e,s,t)=>{"use strict";t.d(s,{Ay:()=>m,Xy:()=>c,pm:()=>d,wA:()=>u});var a=t(95155),r=t(12115);let l={dialog:{status:"",open:!1},step:1,maxStep:3,data:{}},n=(e,s)=>{switch(s.type){case"PREVIOUS_STEP":let t=e.step>1?e.step-1:1;return{...e,step:t};case"NEXT_STEP":return{...e,step:e.step+1};case"SET_STEP":return{...e,step:s.payload};case"SET_MAX_STEP":return{...e,maxStep:s.payload};case"SET_DATA":return{...e,data:s.payload};case"ADD_DATA":return{...e,data:{...e.data,...s.payload}};case"RESET_STATE":return{...l};default:throw Error("Invalid action")}},o=(0,r.createContext)(l),i=(0,r.createContext)(void 0),d=e=>{let{children:s}=e,[t,d]=(0,r.useReducer)(n,l);return(0,a.jsx)(o.Provider,{value:t,children:(0,a.jsx)(i.Provider,{value:d,children:s})})},c=()=>(0,r.useContext)(o),u=()=>{let e=(0,r.useContext)(i);if(void 0===e)throw Error("useDispatch must be used within a useStepControl");return e},m=c},35724:(e,s,t)=>{"use strict";t.d(s,{r:()=>o});var a=t(95155),r=t(3998),l=t(51834),n=t(90854);let o=e=>{let{children:s}=e,{onLogout:t}=(0,n.A)();return(0,a.jsxs)(l.Dialog,{children:[(0,a.jsx)(l.DialogTrigger,{className:"w-full",children:s}),(0,a.jsx)(l.DialogContent,{className:"max-w-xs",children:(0,a.jsxs)(l.DialogHeader,{children:[(0,a.jsx)(l.DialogTitle,{className:"mb-4 text-center",children:"Tem certeza que deseja sair da sua conta?"}),(0,a.jsx)(l.DialogDescription,{className:"pb-8 text-center",children:"Voc\xea vai precisar fazer o login com seu e-mail e senha caso queira retornar."}),(0,a.jsx)(l.DialogClose,{asChild:!0,children:(0,a.jsx)(r.$n,{className:"mb-4 w-full",size:"lg",children:"Manter login"})}),(0,a.jsx)(r.$n,{className:"m-0",size:"lg",variant:"ghost",onClick:t,children:"Sim, quero sair!"})]})})]})}},48960:(e,s,t)=>{"use strict";t.d(s,{HeaderPage:()=>K});var a=t(95155),r=t(50318),l=t(94983),n=t(51207),o=t(64269),i=t(25762),d=t(19672),c=t(9903),u=t(15239),m=t
1(52619),p=t.n(m),h=t(20063),x=t(60093),f=t(3998),g=t(28899),y=t(2237),j=t(15192);let b=()=>{let e=(0,i.L)(e=>e.setIsOpen),s=(0,r.wA)();return{links:[{id:1,label:"Home",icon:"hut",type:"link",href:"/"},{id:2,label:"Card\xe1pio",icon:"menu",type:"link",href:"/menu"},{id:3,label:"Clube Hut",icon:"clube-icon-white",type:"link",href:"/user/club"},{id:4,label:"Cupons",icon:"coupon",type:"link",href:"/coupons"}],user:[{id:1,label:"Meus pedidos",icon:"orders",type:"link",href:"/user/orders"},{id:2,label:"Meus dados",icon:"personal-data",type:"link",href:"/user/profile"},{id:3,label:"Meus endere\xe7os",icon:"pin-map",type:"button",onClick:()=>e(!0)},{id:4,label:"Pagamento",icon:"creditcard",type:"button",onClick:()=>s({type:"OPEN_DIALOG"})},{id:5,label:"Configura\xe7\xf5es",icon:"settings",type:"link",href:"/user/settings"}]}};function v(e){let{className:s}=e,t=(0,h.usePathname)(),{links:r}=b();return(0,a.jsx)(j.KS,{value:"/",className:(0,o.cn)("hidden md:flex",s),children:(0,a.jsx)(j.SK,{children:r.map(e=>(0,a.jsx)(j.JD,{className:"h-6",value:e.href,children:(0,a.jsx)(p(),{className:"flex items-center gap-2",href:e.href,children:(0,a.jsxs)(j.Ws,{active:t===e.href,className:(0,o.cn)((0,j.R6)()),children:[(0,a.jsx)(x.A,{icon:e.icon,size:24}),e.label]})})},e.href))})})}var N=t(12115),w=t(27063),S=t(35724),A=t(86259);let E=e=>{let{onClick:s=()=>{}}=e,{points:t}=(0,l._2)();return(0,a.jsxs)("div",{className:"mr-3 flex items-center gap-x-2",children:[(0,a.jsx)(x.A,{className:"col-start-1 text-primary",icon:"clube-icon",size:24}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("p",{className:"col-start-2 font-bold",children:[t," ",(0,a.jsx)("span",{className:"text-xs",children:"pts."})]}),(0,a.jsx)(p(),{className:"col-start-2 text-xs text-primary hover:underline",href:"/user/club",onClick:s,children:"Ver Clube Hut"})]})]})};function _(e){var s,t;let{children:r}=e,[l,n]=(0,N.useState)(!1),o=(0,d.n)(e=>e.isAnonymous),i=null!=(t=null==(s=(0,c.K)(e=>e.profile).name)?void 0:s.split(" "))?t:[""];function u(){n(!1)}return(0,a.jsxs)(w.cj,{open:l,onOpenChange:n,children:[(0,a.jsx)(w.CG,{asChild:!0,children:r}),(0,a.jsxs)(w.h,{className:"max-w-80 p-0 pt-4 [&>button:first-child]:hidden",side:"left",children:[(0,a.jsxs)(w.Fm,{className:"relative gap-4 space-y-0 px-6",children:[(0,a.jsx)(w.qp,{children:(0,a.jsx)(y.u,{})}),(0,a.jsx)(w.Qs,{className:"hidden"}),(0,a.jsx)(w.kN,{asChild:!0,children:(0,a.jsx)(f.$n,{variant:"ghost",size:"icon",className:"text-primary absolute right-6 h-12 w-12",children:(0,a.jsx)(x.A,{icon:"x",size:20})})})]}),(0,a.jsx)(A.Separator,{className:"my-2"}),(0,a.jsxs)("div",{className:"grid gap-4 px-6 pt-2",children:[(0,a.jsx)(T,{type:"nav",onClose:u}),(0,a.jsx)(A.Separator,{className:"my-2"}),!o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"font-semibold",children:["Ol\xe1, ",i[0]]}),(0,a.jsx)(E,{onClick:u}),(0,a.jsx)(A.Separator,{className:"my-2"}),(0,a.jsx)(T,{type:"user",onClose:u}),(0,a.jsx)(A.Separator,{className:"my-2"}),(0,a.jsx)(S.r,{children:(0,a.jsxs)("div",{className:"group flex cursor-pointer items-center gap-2",children:[(0,a.jsx)(x.A,{className:"group-hover:text-primary h-6 w-6 rounded-lg p-1 group-hover:bg-gray-50",icon:"logout"}),(0,a.jsx)("span",{className:"group-hover:text-primary text-sm",children:"Sair"})]})})]}),o&&(0,a.jsxs)("div",{className:"grid gap-4",children:[(0,a.jsx)("div",{className:"text-xs text-gray-800",children:"Novo por aqui? Crie agora sua conta fa\xe7a login se j\xe1 tiver cadastro"}),(0,a.jsx)(p(),{href:"/auth/signup",passHref:!0,legacyBehavior:!0,children:(0,a.jsx)(f.$n,{className:"w-full text-center",onClick:u,children:"Criar conta"})}),(0,a.jsx)(p(),{href:"/auth/signin",passHref:!0,legacyBehavior:!0,children:(0,a.jsx)(f.$n,{variant:"ghost",className:"w-full",onClick:u,children:"Entrar"})})]})]})]})]})}function T(e){let{className:s,onClose:t,type:r}=e,l=(0,h.usePathname)(),{links:n,user:i}=b();return(0,a.jsx)("div",{className:(0,o.cn)("grid gap-2",s),children:("nav"===r?n:i).map(e=>{let s=l===e.href;return"link"===e.type?(0,a.jsxs)(p(),{className:(0,o.cn)("group flex items-center gap-2",{"text-primary [&>svg]:bg-gray-50":s}),onClick:t,href:e.href,children:[(0,a.jsx)(x.A,{className:"group-hover:text-primary h-6 w-6 cursor-pointer rounded-lg p-1 group-hover:bg-gray-50",icon:e.icon}),(0,a.jsx)("span",{className:"group-hover:text-primary text-sm",children:e.label})]},e.id):(0,a.jsxs)("button",{className:(0,o.cn)("group flex items-center gap-2"),onClick:()=>{e.onClick&&e.onClick(),t()},children:[(0,a.jsx)(x.A,{className:"group-hover:text-primary h-6 w-6 cursor-pointer rounded-lg p-1 group-hover:bg-gray-50",icon:e.icon}),(0,a.jsx)("span",{className:"group-hover:text-primary text-sm",children:e.label})]},e.id)})})}var C=t(20243),z=t(63997),D=t(56186),k=t(27937),P=t(5917),R=t(99051);let L=D.W1;D.YJ,D.ZL,D.Pb,D.z6;let O=N.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(D.bL,{ref:s,className:(0,o.cn)("flex h-9 items-center space-x-1 rounded-md border p-1",t),...r})});O.displayName=D.bL.displayName;let I=N.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(D.l9,{ref:s,className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-3 py-1 text-sm font-medium outline-hidden select-none",t),...r})});I.displayName=D.l9.displayName,N.forwardRef((e,s)=>{let{className:t,inset:r,children:l,...n}=e;return(0,a.jsxs)(D.ZP,{ref:s,className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-xs px-2 py-1.5 text-sm outline-hidden select-none",r&&"pl-8",t),...n,children:[l,(0,a.jsx)(k.A,{className:"ml-auto h-4 w-4"})]})}).displayName=D.ZP.displayName,N.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(D.G5,{ref:s,className:(0,o.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border p-1 shadow-lg",t),...r})}).displayName=D.G5.displayName;let q=N.forwardRef((e,s)=>{let{className:t,align:r="start",alignOffset:l=-4,sideOffset:n=8,...i}=e;return(0,a.jsx)(D.ZL,{children:(0,a.jsx)(D.UC,{ref:s,align:r,alignOffset:l,sideOffset:n,className:(0,o.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-background z-50 min-w-48 overflow-hidden rounded-md border p-1 shadow-md",t),...i})})});q.displayName=D.UC.displayName;let M=N.forwardRef((e,s)=>{let{className:t,inset:r,...l}=e;return(0,a.jsx)(D.q7,{ref:s,className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-xs px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50",r&&"pl-8",t),...l})});M.displayName=D.q7.displayName,N.forwardRef((e,s)=>{let{className:t,children:r,checked:l,...n}=e;return(0,a.jsxs)(D.H_,{ref:s,className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50",t),checked:l,...n,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(D.VF,{children:(0,a.jsx)(P.A,{className:"h-4 w-4"})})}),r]})}).displayName=D.H_.displayName,N.forwardRef((e,s)=>{let{className:t,children:r,...l}=e;return(0,a.jsxs)(D.hN,{ref:s,className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50",t),...l,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(D.VF,{children:(0,a.jsx)(R.A,{className:"h-4 w-4 fill-current"})})}),r]})}).displayName=D.hN.displayName,N.forwardRef((e,s)=>{let{className:t,inset:r,...l}=e;return(0,a.jsx)(D.JU,{ref:s,className:(0,o.cn)("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",t),...l})}).displayName=D.JU.displayName;let F=N.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(D.wv,{ref:s,className:(0,o.cn)("bg-muted -mx-1 my-1 h-px",t),...r})});F.displayName=D.wv.displayName;var V=t(24033);let B=()=>{var e,s;let{isOpen:t}=(0,r.jy)(),n=(0,r.wA)(),{points:o}=(0,l._2)(),i=null!=(s=null==(e=(0,c.K)(e=>e.profile).name)?void 0:e.split(" "))?s:[""],{user:d}=b();return(0,a.jsx)("div",{className:"flex items-center gap-x-6",children:(0,a.jsxs)(O,{className:"border-0 p-0",children:[(0,a.jsxs)(L,{children:[(0,a.jsxs)(I,{className:"bg-ph-primary-hover data-[state=open]:bg-ph-primary-hover focus:bg-ph-primary-hover cursor-pointer gap-2 rounded-full px-3 py-2",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(u.default,{src:"/assets/images/new-brand/user-avatar.png",width:24,height:24,alt:"Avatar do usu\xe1rio"}),(0,a.jsx)("p",{className:"title-2 text-base text-white",children:i[0]})]}),(0,a.jsx)(A.Separator,{className:"h-6 opacity-20",orientation:"vertical"}),(0,a.jsxs)("span",{className:"title-2 flex items-center gap-1 text-base text-white",children:[o," pts"]}),(0,a.jsx)(V.A,{className:"text-white"})]}),(0,a.jsxs)(q,{className:"flex min-w-62.5 flex-col gap-6 rounded-2xl p-6",align:"end",children:[(0,a.jsxs)("span",{className:"title-2 text-base",children:["Ol\xe1, ",i[0]]}),d.map(e=>(0,a.jsx)(M,{className:"w-max cursor-pointer px-0 focus:bg-inherit",asChild:!0,children:"link"===e.type?(0,a.jsxs)(p(),{className:"group flex items-center gap-2",href:e.href,children:[(0,a.jsx)(x.A,{className:"group-hover:text-primary text-primary h-6 w-6 cursor-pointer rounded-lg p-1 group-hover:bg-gray-50",icon:e.icon}),(0,a.jsx)("span",{className:"group-hover:text-primary text-sm",children:e.label})]}):(0,a.jsxs)("button",{className:"group flex items-center gap-2",onClick:e.onClick,children:[(0,a.jsx)(x.A,{className:"group-hover:text-primary text-primary h-6 w-6 cursor-pointer rounded-lg p-1 group-hover:bg-gray-50",icon:e.icon}),(0,a.jsx)("span",{className:"group-hover:text-primary text-sm",children:e.label})]})},e.id)),(0,a.jsx)(F,{}),(0,a.jsx)(M,{className:"px-0 focus:bg-inherit",asChild:!0,children:(0,a.jsx)(S.r,{children:(0,a.jsxs)("div",{className:"group flex cursor-pointer items-center gap-2",children:[(0,a.jsx)(x.A,{className:"group-hover:text-primary h-6 w-6 rounded-lg p-1 group-hover:bg-gray-50",icon:"logout"}),(0,a.jsx)("span",{className:"group-hover:text-primary text-sm",children:"Sair"})]})})})]})]}),(0,a.jsx)(z.f,{open:t,onOpenChange:e=>n({type:"SET_DIALOG",payload:e})})]})})};function U(){return(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)(p(),{href:"/auth/signin",children:(0,a.jsx)(f.$n,{size:"sm",variant:"outline-white",className:"px-6",children:"Entrar"})}),(0,a.jsx)(p(),{href:"/auth/signup",children:(0,a.jsx)(f.$n,{size:"sm",variant:"ghost-secondary",className:"px-6",children:"Criar conta"})})]})}function H(e){let{isLogged:s}=e,[t,r]=(0,N.useState)(!1);return((0,N.useEffect)(()=>{let e=setTimeout(()=>{r(!0)},500);return()=>clearTimeout(e)},[]),t)?(0,a.jsx)("div",{children:s?(0,a.jsx)(B,{}):(0,a.jsx)(U,{})}):(0,a.jsx)(C.E,{className:"h-10 w-56 animate-pulse rounded-full"})}function K(e){let{className:s}=e,t=(0,d.n)(e=>e.isAnonymous),m=(0,d.n)(e=>e.isAuth),j=(0,i.L)(e=>e.address),b=(0,c.K)(e=>e.profile),N=(0,h.useRouter)(),w=(0,h.usePathname)(),S=!!(!t&&m&&b.name),A=["/auth","/checkout"].some(e=>w.includes(e)),E=["/guest"].some(e=>w.includes(e)),T=["/auth"].some(e=>w.includes(e));return E?(0,a.jsx)(a.Fragment,{}):A?(0,a.jsx)("header",{className:"shadow-md",children:(0,a.jsx)("div",{className:"container",children:(0,a.jsxs)("div",{className:"relative flex h-20 items-center justify-center",children:[(0,a.jsxs)("button",{className:"text-primary absolute left-0 flex items-center gap-4",type:"button",onClick:()=>T?N.push("/"):N.back(),children:[(0,a.jsx)(x.A,{icon:"back",size:20})," ",T?"Home":"Voltar"]}),(0,a.jsxs)(p(),{href:"/",children:[(0,a.jsx)(u.default,{className:"hidden md:block",src:n.V9,alt:"logo",width:121,height:28}),(0,a.jsx)(u.default,{className:"block md:hidden",src:"/assets/images/logo-ph-mobile.png",alt:"logo",width:48,height:48})]})]})})}):j.latitude||E?(0,a.jsx)(r.PaymentActionControllProvider,{children:(0,a.jsx)(l.DU,{children:(0,a.jsx)("header",{className:(0,o.cn)("bg-ph-primary flex min-h-20 items-center gap-8",s),children:(0,a.jsx)("div",{className:"container",children:(0,a.jsxs)("div",{className:"flex w-full items-center gap-4",children:[(0,a.jsx)("div",{className:"block lg:hidden",children:(0,a.jsx)(_,{children:(0,a.jsx)(f.$n,{variant:"ghost",size:"icon",className:"lg:hidden",children:(0,a.jsx)(x.A,{icon:"union",className:"text-primary"})})})}),(0,a.jsx)(y.u,{className:"mr-4 lg:mr-12"}),(0,a.jsx)("div",{className:"hidden lg:block",children:(0,a.jsx)(v,{})}),(0,a.jsx)("div",{className:"ml-auto block lg:hidden",children:(0,a.jsx)(g.t,{})}),(0,a.jsx)("div",{className:"ml-auto hidden lg:block",children:(0,a.jsx)(H,{isLogged:S})})]})})})})}):(0,a.jsx)(r.PaymentActionControllProvider,{children:(0,a.jsx)(l.DU,{children:(0,a.jsx)("header",{className:(0,o.cn)("flex min-h-20 items-center gap-8 bg-white",s),children:(0,a.jsx)("div",{className:"container",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(y.u,{}),(0,a.jsx)(H,{isLogged:S})]})})})})})}},51207:(e,s,t)=>{"use strict";
1t.d(s,{Ux:()=>a,V9:()=>r});let a="/assets/images/img-default.png",r="/assets/images/new-brand/logo-pizzahut.png"},53241:(e,s,t)=>{"use strict";t.d(s,{O:()=>r});var a=t(80077);function r(e,s){return e.some(e=>(0,a.p1)(e).test(s))}},56028:(e,s,t)=>{"use strict";t.d(s,{q9:()=>o});var a=t(22119),r=t(1962),l=t(53455);async function n(e){return a.Ay.get("/stores",{params:e}).then(e=>{let{stores:s,...t}=e.data;return{stores:s.map(e=>({...e,formatted_address:(0,r.$h)(e)})).sort((e,s)=>e.open&&!s.open?-1:!e.open&&s.open?1:0),...t}})}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;return(0,l.useQuery)({queryKey:["FetchStores",s],queryFn:()=>n(s),...e})}},63782:(e,s,t)=>{"use strict";t.d(s,{default:()=>f});var a=t(53404),r=t(20063),l=t(12115),n=t(93429),o=t(44341),i=t(42987),d=t(53241),c=t(21657),u=t(56028),m=t(25762),p=t(19672),h=t(9903),x=t(73819);function f(e){var s,t,f;let{children:g,dehydratedState:y}=e,j=(0,r.usePathname)(),b=(0,r.useRouter)(),v=(0,r.useSearchParams)(),N=function(){let e=(0,r.useRouter)(),s=(0,r.usePathname)(),t=(0,r.useSearchParams)();return(0,l.useCallback)(a=>{let r=new URLSearchParams(t.toString());r.delete(a),e.replace("".concat(s,"?").concat(r.toString()))},[s,e,t])}(),w=(0,p.n)(e=>e.isAuth),S=(0,p.n)(e=>e.setAuth),A=(0,p.n)(e=>e.isAnonymous),E=(0,h.K)(e=>e.profile),_=(0,x.K)(e=>e.store),T=(0,x.K)(e=>e.setStore),C=(0,x.K)(e=>e.deliveryTypeId),z=(0,m.L)(e=>e.setIsOpen),D=(0,m.L)(e=>e.setAddress),k=(0,m.L)(e=>e.address),P=(0,c.Gg)({enabled:w,initialData:null!=(f=null==(t=y.queries[0])||null==(s=t.state)?void 0:s.data)?f:{},initialDataUpdatedAt:Date.now()}),R=(0,u.q9)({enabled:P.isSuccess&&!!(null==k?void 0:k.latitude)},{lat:String(null==k?void 0:k.latitude),lon:String(null==k?void 0:k.longitude),deliveryTypeId:C});return(0,l.useEffect)(()=>
1{n.P9.init()},[]),(0,l.useEffect)(()=>{E.cpf&&(0,o.Ly)(E.cpf)},[E]),(0,l.useEffect)(()=>{if(P.isSuccess){var e,s;let t=null==(e=P.data)?void 0:e.currentAddress;console.log("INITIALIZER ADDRESS EFFECT",{curAddress:t,pathname:j}),(null==t?void 0:t.latitude)?(D(t),(0,a.setCookie)(i.BD,String(null!=(s=null==t?void 0:t.id)?s:0),{path:"/"})):P.refetch().then(e=>{var s,t;let r=null==(s=e.data)?void 0:s.currentAddress;console.log("INITIALIZER ADDRESS FALLBACK",{curAddress:r,pathname:j}),(null==r?void 0:r.latitude)?(D(r),(0,a.setCookie)(i.BD,String(null!=(t=null==r?void 0:r.id)?t:0),{path:"/"})):(0,d.O)(["/","/menu"],j)&&z(!0)}),["/"].includes(j)&&b.refresh()}},[P.isSuccess,P.data]),(0,l.useEffect)(()=>{if(R.isSuccess){var e;let{stores:s}=R.data;console.log("inicializer",{stores:s});let t=v.get("store");if(t){let e=s.find(e=>e.id===Number(t));if(null==e?void 0:e.id){T(e),N("store");return}}if(_.id){let e=s.find(e=>e.id===_.id);if(null==e?void 0:e.id)return void T(e)}let a=s.find(e=>e.open);if(a)return void T(a);if(null==(e=R.data)?void 0:e.stores[0])return T(R.data.stores[0]);if(0===s.length)return T({})}},[R.isSuccess,R.dataUpdatedAt]),(0,l.useEffect)(()=>{let e=(0,a.getCookie)(i.CV);w||!e||A||S(!0)},[A,w]),g}},69058:(e,s,t)=>{"use strict";t.d(s,{default:()=>d,q:()=>i});var a=t(95155),r=t(31461),l=t(99776),n=t(38217),o=t(12115);let i=new r.E({defaultOptions:{queries:{refetchOnReconnect:!1,refetchOnWindowFocus:!1,retry:0}}}),d=function(e){let{children:s}=e,[t]=(0,o.useState)(i);return(0,a.jsxs)(l.QueryClientProvider,{client:t,children:[s,(0,a.jsx)(n.E,{initialIsOpen:!1})]})}},72676:(e,s,t)=>{Promise.resolve().then(t.bind(t,68332)),Promise.resolve().then(t.bind(t,98202)),Promise.resolve().then(t.bind(t,57445)),Promise.resolve().then(t.bind(t,18298)),Promise.resolve().then(t.bind(t,84019)),Promise.resolve().then(t.bind(t,99776)),Promise.resolve().then(t.bind(t,47785)),Promise.resolve().then(t.bind(t,25979)),Promise.resolve().then(t.bind(t,59441)),Promise.resolve().then(t.bind(t,80549)),Promise.resolve().then(t.bind(t,1043)),Promise.resolve().then(t.bind(t,11515)),Promise.resolve().then(t.bind(t,53455)),Promise.resolve().then(t.bind(t,45339)),Promise.resolve().then(t.bind(t,5947)),Promise.resolve().then(t.bind(t,86639)),Promise.resolve().then(t.t.bind(t,41402,23)),Promise.resolve().then(t.t.bind(t,20749,23)),Promise.resolve().then(t.t.bind(t,65442,23)),Promise.resolve().then(t.t.bind(t,70161,23)),Promise.resolve().then(t.bind(t,22663)),Promise.resolve().then(t.bind(t,30621)),Promise.resolve().then(t.bind(t,82678)),Promise.resolve().then(t.bind(t,48960)),Promise.resolve().then(t.bind(t,63782)),Promise.resolve().then(t.bind(t,86026)),Promise.resolve().then(t.bind(t,69058)),Promise.resolve().then(t.t.bind(t,93836,23))},73457:(e,s,t)=>{"use strict";t.d(s,{S:()=>i});var a=t(95155),r=t(53860),l=t(5917),n=t(12115),o=t(64269);let i=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,a.jsx)(r.bL,{ref:s,className:(0,o.cn)("peer h-5 w-5 shrink-0 rounded-xs border border-gray-base shadow-sm focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-gray-base data-[state=checked]:text-white",t),...n,children:(0,a.jsx)(r.C1,{className:(0,o.cn)("flex items-center justify-center text-current"),children:(0,a.jsx)(l.A,{className:"h-4 w-4"})})})});i.displayName=r.bL.displayName},80077:(e,s,t)=>{"use strict";t.d(s,{jR:()=>a,p1:()=>r});let a=new RegExp(/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi),r=e=>new RegExp("^".concat(e.replace(/\*/g,".*"),"$"))},82678:(e,s,t)=>{"use strict";t.d(s,{AddressSelector:()=>eg});var a=t(95155),r=t(51834),l=t(34507),n=t(25762),o=t(12115),i=t(20063),d=t(3998),c=t(73457),u=t(41052),m=t(65142),p=t(69058),h=t(1962),x=t(72627),f=t(21657),g=t(66942),y=t(22544),j=t(22663),b=t(41494),v=t(99776);let N={address:{},isDeletingAddress:!1,deleteAddressIsLoading:!1},w={...N,dispatch:{},handleSetAddress:{},handleEditAddress:{},handleDeleteAddress:{},handleConfirmDeleteAddress:{},handleCancelDeleteAddress:{},handleCancelEditAddress:{}},S=(0,o.createContext)(w),A=(e,s)=>{switch(s.type){case"SET_ADDRESS":return{...e,address:s.payload};case"SET_DELETING_ADDRESS":return{...e,isDeletingAddress:s.payload};case"RESET_EDIT":return{...e,address:N.address};default:return e}},E=e=>{let{children:s}=e,[t,r]=(0,o.useReducer)(A,N),n=(0,v.useQueryClient)(),i=(0,l.wA)(),d=(0,f.OQ)({onSuccess:e=>{i({type:"ADD_DATA",payload:{structured_formatting:(0,h.tD)(e.results[0].address_components),location:e.results[0].geometry.location,address_components:e.results[0].address_components}}),i({type:"SET_STEP",payload:2})}}),c=(0,f.fB)({onSuccess:e=>{1===e.status&&(r({type:"SET_ADDRESS",payload:{}}),r({type:"SET_DELETING_ADDRESS",payload:!1}),n.invalidateQueries({queryKey:["FetchAddress"],refetchType:"active"}),b.o.success("Endere\xe7o deletado com sucesso!"))}}),u=e=>r({type:"SET_ADDRESS",payload:e});return(0,a.jsx)(S.Provider,{value:{...t,deleteAddressIsLoading:c.isPending,dispatch:r,handleSetAddress:u,handleDeleteAddress:e=>{u(e),r({type:"SET_DELETING_ADDRESS",payload:!0})},handleConfirmDeleteAddress:()=>{void 0!==t.address.id&&c.mutate(t.address.id)},handleCancelDeleteAddress:()=>{r({type:"SET_ADDRESS",payload:{}}),r({type:"SET_DELETING_ADDRESS",payload:!1})},handleEditAddress:e=>{u(e);let s=(0,h.Ik)(e);d.mutate(s)},handleCancelEditAddress:()=>r({type:"RESET_EDIT"})},children:s})},_=()=>(0,o.useContext)(S);var T=t(64269);let C=e=>{let{form:s,state:t,dispatch:l}=e,n=s.watch("address_type"),o=()=>{l({type:"CLOSE_PROMPT_ADDRESS_TYPE"}),l({type:"SET_ADDRESS_TYPE_OTHERS"})};return(0,a.jsxs)(r.DialogFooter,{className:(0,T.cn)("collapse absolute bottom-0 left-0 grid h-full w-full grid-rows-[1fr_288px] overflow-hidden sm:space-x-0",{visible:t.promptAddressType}),children:[(0,a.jsx)("div",{className:(0,T.cn)("absolute left-0 top-0 h-full w-full rounded-b-lg bg-black/10"),onClick:o}),(0,a.jsxs)("div",{className:(0,T.cn)("absolute bottom-0 left-0 z-10 max-h-60 rounded-lg border-t bg-white","grid h-full w-full translate-y-full grid-cols-2 grid-rows-[auto_auto_1fr_auto] items-center gap-2 p-8 transition-all duration-500",{"translate-y-0":t.promptAddressType}),children:[(0,a.jsx)("p",{className:"col-span-2 text-xl font-semibold text-gray-base",children:"Gostaria de dar um nome a este endere\xe7o favorito?"}),(0,a.jsx)(u.zB,{control:s.control,name:"address_type",render:e=>{let{field:s}=e;return(0,a.jsxs)(u.eI,{className:"col-span-3",children:[(0,a.jsx)(u.MJ,{children:(0,a.jsxs)("div",{children:[(0,a.jsx)(m.pd,{placeholder:"Ex: Casa dos pais",maxLength:30,...s}),(0,a.jsx)("span",{className:"ml-4 mt-2 block text-xs text-gray-600",children:"".concat((null==n?void 0:n.length)||0,"/30 caracteres")})]})}),(0,a.jsx)(u.C5,{className:"ml-4"})]})}}),(0,a.jsx)(d.$n,{size:"lg",variant:"ghost",type:"button",onClick:o,children:"Agora n\xe3o"}),(0,a.jsx)(d.$n,{size:"lg",type:"button",disabled:(null==n?void 0:n.length)<=0,onClick:()=>{l({type:"CLOSE_PROMPT_ADDRESS_TYPE"}),l({type:"SET_ADDRESS_TYPE_OTHERS_CUSTOM",payload:n})},children:"Aplicar nome"})]})]})},z={0:"",1:"home",2:"work",3:"others"},D={promptAddressType:!1,promptCancelRegistration:!1,addressTypeSelected:z[1],addressTypeLabel:z[1],addressTypeCustom:""},k=(e,s)=>{let{type:t}=s;switch(t){case"OPEN_PROMPT_ADDRESS_TYPE":return{...e,promptAddressType:!0,addressTypeSelected:z[3],addressTypeLabel:e.addressTypeCustom?e.addressTypeCustom:""};case"CLOSE_PROMPT_ADDRESS_TYPE":return{...e,promptAddressType:!1};case"SET_ADDRESS_TYPE_HOME":return{...e,addressTypeSelected:z[1],addressTypeLabel:z[1]};case"SET_ADDRESS_TYPE_WORK":return{...e,addressTypeSelected:z[2],addressTypeLabel:z[2]};case"SET_ADDRESS_TYPE_OTHERS_CUSTOM":return{...e,addressTypeSelected:z[3],addressTypeLabel:s.payload,addressTypeCustom:s.payload};default:return e}};var P=t(15653);let R=P.z.object({address_type:P.z.string().min(1,"Campo obrigat\xf3rio"),street:P.z.string().min(1,"Campo obrigat\xf3rio"),neighborhood:P.z.string().min(1,"Campo obrigat\xf3rio"),number:P.z.string(),no_number:P.z.boolean().optional(),complement:P.z.string(),no_complement:P.z.boolean().optional(),reference:P.z.string().optional()}).refine(e=>e.no_number||e.number&&e.number.trim().length>0,{message:"Campo obrigat\xf3rio",path:["number"]}).refine(e=>e.no_complement||e.complement&&e.complement.trim().length>0,{message:"Campo obrigat\xf3rio",path:["complement"]});var L=t(60093);let O=e=>{let{className:s,state:t,dispatch:r}=e;return(0,a.jsxs)("div",{className:s,children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,a.jsx)("p",{className:"text-sm font-bold text-gray-base",children:"Como deseja favoritar esse endere\xe7o?"}),(0,a.jsx)("span",{className:"rounded-lg bg-gray-50 px-2 py-1 text-xs text-gray-700",children:"obrigat\xf3rio"})]}),(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)(I,{label:"Casa",icon:"home",isSelected:t.addressTypeSelected===z[1],onClick:()=>r({type:"SET_ADDRESS_TYPE_HOME"})}),(0,a.jsx)(I,{label:"Trabalho",icon:"building",isSelected:t.addressTypeSelected===z[2],onClick:()=>r({type:"SET_ADDRESS_TYPE_WORK"})}),(0,a.jsx)(I,{label:"Outros",icon:"star",isSelected:t.addressTypeSelected===z[3],onClick:()=>r({type:"OPEN_PROMPT_ADDRESS_TYPE"})})]})]})},I=e=>{let{onClick:s,isSelected:t,label:r,icon:l}=e;return(0,a.jsxs)("button",{className:(0,T.cn)("flex h-16 w-1/3 flex-col items-center justify-center rounded-2xl border-2 p-2 shadow-md",{"border-primary-300 shadow-md shadow-primary-50":t}),onClick:s,type:"button",children:[(0,a.jsx)(L.A,{className:"h-5 w-5 text-gray-base",icon:l}),(0,a.jsx)("span",{className:"text-sm text-gray-base",children:r})]})},q=()=>{let[e,s]=(0,o.useReducer)(k,D),t=(0,l.wA)(),{data:r}=(0,l.Xy)(),{address:n}=_(),i=(0,y.mN)({resolver:(0,g.u)(R),mode:"onBlur",defaultValues:{address_type:"",street:"",neighborhood:"",number:"",no_number:!1,complement:"",no_complement:!1,reference:""}}),b=i.getValues(),v=i.getValues(["address_type","street","neighborhood"]),N=(null==r?void 0:r.address_components)?(0,h._6)(r.address_components):r,w=(0,f.OQ)({onSuccess:e=>{t({type:"ADD_DATA",payload:{structured_formatting:(0,h.tD)(e.results[0].address_components),location:e.results[0].geometry.location,address_components:e.results[0].address_components}}),t({type:"NEXT_STEP"}),j.default.success("Localiza\xe7\xe3o atualizada"),p.q.removeQueries({queryKey:["FetchZipcode"]})}});return(0,o.useEffect)(()=>
1{if(i.setValue("number",N.number?String(N.number):""),i.setValue("street",N.street?String(N.street):""),i.setValue("neighborhood",N.neighborhood?String(N.neighborhood):""),n.id){let{complement:e,noComplement:t,reference:a,name:r}=n;switch(i.setValue("complement",e||""),i.setValue("no_complement",t),i.setValue("reference",a||""),r){case"home":s({type:"SET_ADDRESS_TYPE_HOME"});break;case"work":s({type:"SET_ADDRESS_TYPE_WORK"});break;case"others":s({type:"SET_ADDRESS_TYPE_OTHERS"});break;default:s({type:"SET_ADDRESS_TYPE_OTHERS_CUSTOM",payload:r})}}},[]),(0,o.useEffect)(()=>{b.no_number&&(i.setValue("number",""),i.clearErrors("number")),b.no_complement&&(i.setValue("complement",""),i.clearErrors("complement"))},[b.no_number,b.no_complement]),(0,o.useEffect)(()=>{i.setValue("address_type",e.addressTypeLabel)},[e]),(0,a.jsx)(u.lV,{...i,children:(0,a.jsxs)("form",{className:"-mr-6 grid h-full grid-cols-3 grid-rows-[repeat(4,auto)_1fr] gap-x-4 gap-y-6 overflow-scroll pr-6 pb-32",onSubmit:i.handleSubmit(s=>{var a;let{lat:l,lng:o}=null!=(a=r.location)?a:{},i={...N,typeAddress:e.addressTypeLabel,name:e.addressTypeLabel,current:!0,street:s.street,neighborhood:s.neighborhood,number:s.number||"",noNumber:s.no_number,complement:s.complement||"",noComplement:s.no_complement,country:"BR",latitude:l,longitude:o,reference:s.reference||""};n&&(i.id=n.id),t({type:"ADD_DATA",payload:i});let d=(0,h.mU)(i);w.mutate(d)}),children:[(0,a.jsx)(u.zB,{control:i.control,name:"street",render:e=>{let{field:s}=e;return(0,a.jsxs)(u.eI,{className:"col-span-2",children:[(0,a.jsx)(u.lR,{className:"ml-4",children:"Rua"}),(0,a.jsx)(u.MJ,{children:(0,a.jsx)(m.pd,{placeholder:"Rua",...s})}),(0,a.jsx)(u.C5,{className:"ml-4"})]})}}),(0,a.jsx)(u.zB,{control:i.control,name:"neighborhood",render:e=>{let{field:s}=e;return(0,a.jsxs)(u.eI,{className:"col-span-1",children:[(0,a.jsx)(u.lR,{className:"ml-4",children:"Bairro"}),(0,a.jsx)(u.MJ,{children:(0,a.jsx)(m.pd,{placeholder:"Bairro",...s})}),(0,a.jsx)(u.C5,{className:"ml-4"})]})}}),(0,a.jsx)(u.zB,{control:i.control,name:"number",render:e=>{let{field:s}=e;return(0,a.jsxs)(u.eI,{className:"col-span-1",children:[(0,a.jsx)(u.lR,{className:"ml-4",children:"N\xfamero"}),(0,a.jsx)(u.MJ,{children:(0,a.jsx)(m.pd,{placeholder:"N\xfamero",...s})}),(0,a.jsx)(u.C5,{className:"ml-4"})]})}}),(0,a.jsx)(u.zB,{control:i.control,name:"complement",render:e=>{let{field:s}=e;return(0,a.jsxs)(u.eI,{className:"col-span-2",children:[(0,a.jsx)(u.lR,{className:"ml-4",children:"Complemento"}),(0,a.jsx)(u.MJ,{children:(0,a.jsx)(m.pd,{placeholder:"Apto, bloco, casa...",...s})}),(0,a.jsx)(u.C5,{className:"ml-4"})]})}}),(0,a.jsx)(u.zB,{control:i.control,name:"no_number",render:e=>{let{field:s}=e;return(0,a.jsxs)(u.eI,{className:"col-span-1 ml-4 flex items-center space-y-0",children:[(0,a.jsx)(u.MJ,{children:(0,a.jsx)(c.S,{checked:s.value,onCheckedChange:s.onChange})}),(0,a.jsx)(u.lR,{className:"ml-2",children:"Endere\xe7o sem n\xfamero"}),(0,a.jsx)(u.C5,{className:"ml-4"})]})}}),(0,a.jsx)(u.zB,{control:i.control,name:"no_complement",render:e=>{let{field:s}=e;return(0,a.jsxs)(u.eI,{className:"col-span-2 ml-4 flex items-center space-y-0",children:[(0,a.jsx)(u.MJ,{children:(0,a.jsx)(c.S,{checked:s.value,onCheckedChange:s.onChange})}),(0,a.jsx)(u.lR,{className:"ml-2",children:"Endere\xe7o sem complemento"}),(0,a.jsx)(u.C5,{className:"ml-4"})]})}}),(0,a.jsx)(u.zB,{control:i.control,name:"reference",render:e=>{let{field:s}=e;return(0,a.jsxs)(u.eI,{className:"col-span-3",children:[(0,a.jsx)(u.lR,{className:"ml-4",children:"Tem algum ponto de refer\xeancia?"}),(0,a.jsx)(u.MJ,{children:(0,a.jsx)(m.pd,{placeholder:"Se houver, pode facilitar a entrega!",...s})}),(0,a.jsx)(u.C5,{className:"ml-4"})]})}}),(0,a.jsx)(O,{className:"col-span-3",dispatch:s,state:e}),(0,a.jsx)(C,{form:i,dispatch:s,state:e}),(0,a.jsxs)("div",{className:"fixed bottom-0 left-0 col-span-3 mt-auto grid w-full grid-cols-2 gap-6 border-t-2 bg-white p-8",children:[(0,a.jsx)(d.$n,{size:"lg",variant:"outline",type:"button",onClick:()=>t({type:"RESET_STATE"}),children:"Cancelar"}),(0,a.jsx)(d.XT,{size:"lg",type:"submit",disabled:(0,x.k)(v),children:"Usar endere\xe7o"})]})]})})};var M=t(15239),F=t(52619),V=t.n(F),B=t(20243);let U=()=>{let[e,s]=(0,o.useState)(!1),t=(0,l.wA)(),{mutate:r}=(0,f.W1)({onSuccess:e=>{t({type:"ADD_DATA",payload:{structured_formatting:(0,h.tD)(e.results[0].address_components),location:e.results[0].geometry.location,address_components:e.results[0].address_components,formatted_address:e.results[0].formatted_address}}),t({type:"SET_STEP",payload:2}),s(!1)}}),n=e=>{let{coords:s}=e;r({lat:s.latitude,lng:s.longitude})},i=e=>{switch(e.code){case e.PERMISSION_DENIED:b.o.warning("Opa! Para podermos utilizar sua localiza\xe7\xe3o \xe9 necess\xe1rio que voc\xea d\xea permiss\xe3o.");break;case e.POSITION_UNAVAILABLE:b.o.warning("Localiza\xe7\xe3o indispon\xedvel.");break;case e.TIMEOUT:b.o.warning("O tempo para obter a localiza\xe7\xe3o expirou.");break;default:b.o.error("Erro desconhecido: ".concat(e.message))}s(!1)},c=async()=>{"geolocation"in navigator&&(s(!0),navigator.geolocation.getCurrentPosition(n,i))};return(0,a.jsx)(d.$n,{className:(0,T.cn)("hover:ring-primary-base border-above h-auto min-h-14 roun
1ded-2xl border bg-white p-0 py-2 hover:bg-white hover:ring-2",{"opacity-80":e}),variant:"ghost",size:"lg",onClick:c,children:e?(0,a.jsxs)("div",{className:"grid grid-cols-[auto_1fr] items-center gap-x-2 gap-y-1 px-4",children:[(0,a.jsx)(B.E,{className:"row-span-2 h-6 w-6 rounded-md bg-neutral-300"}),(0,a.jsx)(B.E,{className:"h-5 w-52 rounded-md bg-neutral-300"}),(0,a.jsx)(B.E,{className:"h-4 w-80 rounded-md bg-neutral-300"})]}):(0,a.jsxs)("div",{className:"grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-1 px-4",children:[(0,a.jsx)(L.A,{icon:"target",className:"text-gray-base row-span-2",size:16}),(0,a.jsx)("span",{className:"text-neutral-base text-left text-sm font-normal",children:"Usar minha localiza\xe7\xe3o atual"}),(0,a.jsx)("p",{className:"text-left text-sm font-light text-gray-500",children:"Clique aqui para permitir usar sua localiza\xe7\xe3o no navegador."})]})})};var H=t(35299);let K=P.z.object({zipcode:P.z.string()}),$=()=>{let e,s=(0,y.mN)({resolver:(0,g.u)(K),mode:"onBlur",defaultValues:{zipcode:""}}),t=(0,l.wA)(),r=s.getValues("zipcode"),n=(0,f.w0)(r);return(0,o.useEffect)(()=>{let{data:e}=n;(null==e?void 0:e.status)===1&&(t({type:"ADD_DATA",payload:{...e.zipCode,neighborhood:e.zipCode.neighbourhood}}),t({type:"NEXT_STEP"}),s.reset({zipcode:""}),p.q.removeQueries({queryKey:["FetchZipcode"]}))},[n.isSuccess,n.data]),(0,o.useEffect)(()=>(9===r.length&&(clearTimeout(e),e=setTimeout(()=>{n.refetch()},1e3)),()=>clearTimeout(e)),[r]),(0,a.jsx)(u.lV,{...s,children:(0,a.jsxs)("form",{className:"flex items-center gap-2",onSubmit:s.handleSubmit(()=>{n.refetch()}),children:[(0,a.jsx)(u.zB,{control:s.control,name:"zipcode",render:e=>{let{field:s}=e;return(0,a.jsxs)(u.eI,{className:"w-full",children:[(0,a.jsx)(u.MJ,{children:(0,a.jsxs)("div",{className:"relative flex items-center",children:[(0,a.jsx)(L.A,{icon:"pin-map",className:"absolute left-4",size:16}),(0,a.jsx)(m.N5,{className:"pl-12 placeholder:text-gray-400",...s,type:"text",placeholder:"Buscar pelo CEP",mask:"00000-000"}),(0,a.jsx)(H.A,{className:(0,T.cn)("absolute right-4 hidden animate-spin text-gray-400",{block:n.isFetching}),size:24})]})}),(0,a.jsx)(u.C5,{})]})}}),(0,a.jsx)(d.$n,{className:"w-28",variant:"ph-outline-secondary",children:"Buscar"})]})})},Z=()=>{let e=(0,n.L)(e=>e.setIsOpen);return(0,a.jsxs)("div",{className:"custom-scrollbar -mr-6 grid h-full auto-rows-min gap-8 overflow-y-auto py-6 pr-6",children:[(0,a.jsxs)("div",{className:"relative flex align-bottom md:h-20",children:[(0,a.jsx)(L.A,{className:"text-icon-primary absolute -top-7 left-0 hidden! md:block!",icon:"hut",size:84}),(0,a.jsx)("h2",{className:"headline-3 text-ph-primary mt-auto h-min w-full",children:"Pe\xe7a sua pizza pelo App ou site"})]}),(0,a.jsxs)("div",{className:"bg-ph-main flex justify-between gap-6 rounded-2xl px-4 pt-2",children:[(0,a.jsx)("p",{className:"title-4 text-ph-primary max-w-80",children:"Entre na conta e aproveite as vantagens do Clube Hut"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(V(),{className:"text-ph-primary label-1 mr-1",href:"/auth/signin",onClick:()=>e(!1),children:(0,a.jsx)(d.$n,{variant:"ph-secondary",children:"Entre"})}),(0,a.jsx)("div",{className:"text-primary label-1",children:"ou"}),(0,a.jsx)(V(),{className:"text-ph-primary label-1 mr-1",href:"/auth/signup",onClick:()=>e(!1),children:(0,a.jsx)(d.$n,{variant:"ph-outline-secondary",children:"cadastre-se"})})]})]}),(0,a.jsxs)("div",{className:"border-border-primary bg-ph-white grid auto-rows-min gap-3 rounded-2xl border p-5",children:[(0,a.jsx)($,{}),(0,a.jsx)(U,{})]}),(0,a.jsxs)("div",{className:"bg-ph-main flex w-full flex-col items-center gap-6 rounded-2xl p-6 sm:flex-row",children:[(0,a.jsx)(M.default,{className:"object-contain",src:"/assets/images/new-brand/qr-code-red.png",alt:"Download App QR CODE",width:100,height:100}),(0,a.jsxs)("div",{className:"flex w-full items-center gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(V(),{className:"relative aspect-[3.325] h-10 w-33",href:"https://play.google.com/store/search?q=pizzahut",target:"__blank",children:(0,a.jsx)(M.default,{className:"object-contain",src:"/assets/images/new-brand/banner-play-store.png",alt:"Pizzahut Play Store",fill:!0})}),(0,a.jsx)(V(),{className:"relative aspect-[3.325] h-10 w-33",href:"https://apps.apple.com/br/app/pizza-hut-brasil/id1673115073",target:"__blank",children:(0,a.jsx)(M.default,{className:"object-contain",src:"/assets/images/new-brand/banner-apple-store.png",alt:"Pizzahut App Store",fill:!0})})]}),(0,a.jsxs)("p",{className:"label-1 w-full text-black",children:["Ou baixe nosso App e aproveite os ",(0,a.jsx)("br",{})," benef\xedcios do Clube Hut"]})]})]})]})};var Y=t(44897),J=t(42987),Q=t(22119),G=t(19672),X=t(53404);let W={width:"100%",height:"100%"},ee={styles:[{featureType:"administrative",elementType:"geometry",stylers:[{visibility:"off"}]},{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"transit",stylers:[{visibility:"off"}]}],disableDefaultUI:!0,zoomControl:!0,scrollwheel:!1,zoom:16,maxZoom:20,minZoom:15};function es(e){let{className:s}=e,{isLoaded:t}=(0,Y.KD)({id:"google-map-script",googleMapsApiKey:"AIzaSyAnN_RXE-URHSlwzF7bu39QILv96nAK7y0"}),r=(0,i.useRouter)(),c=(0,l.wA)(),{data:u}
1=(0,l.Xy)(),m=function(){let e=(0,G.n)(e=>e.isAnonymous),s=(0,G.n)(e=>e.setAnonymous),t=(0,G.n)(e=>e.isAuth),a=(0,G.n)(e=>e.setAuth);return function(){return e||t?Promise.resolve():Q.Ay.post("/client/signInAnonymous",{}).then(e=>e).then(e=>{if(200===e.status){let{authorization:t}=e.headers;(0,X.setCookie)(J.CV,"Bearer "+t,{path:"/"}),(0,X.setCookie)(J.F$,"true",{path:"/"}),a(!0),s(!0)}})}}(),[h,x]=(0,o.useState)(!1),g=(0,n.L)(e=>e.stepControlConfig),y=(0,n.L)(e=>e.setIsOpen),b=(0,n.L)(e=>e.setAddress),[v,N]=(0,o.useState)(u.location),[w,S]=(0,o.useState)(null),[A,E]=(0,o.useState)(!1),{mutate:_,isPending:C}=(0,f.aw)({onSuccess:e=>{1===e.status?(c({type:"RESET_STATE"}),y(!1),b(e.currentAddress),j.default.success("Endere\xe7o salvo com sucesso!"),console.log({stepControlConfig:g}),(null==g?void 0:g.redirect)?r.push(g.redirect):setTimeout(()=>{r.refresh()},100),p.q.setQueryData(["FetchAddress"],()=>({...e}),{updatedAt:Date.now()})):j.default.error(e.message)}}),z=(0,o.useCallback)(e=>{let s=new window.google.maps.LatLngBounds(u.location);e.fitBounds(s),e.setZoom(16),S(e)},[]),D=(0,o.useCallback)(e=>{S(null)},[]);return t?(0,a.jsxs)("div",{className:(0,T.cn)("relative flex items-center justify-center",s),children:[A&&(0,a.jsx)(L.A,{className:"absolute z-20 -translate-y-10",size:70,icon:"pin-move"}),(0,a.jsx)(Y.u6,{mapContainerStyle:W,options:ee,center:v,zoom:16,onDragEnd:()=>{let e=null==w?void 0:w.getCenter();N({lat:Number(null==e?void 0:e.lat()),lng:Number(null==e?void 0:e.lng())}),E(!1)},onDragStart:()=>{E(!0)},onLoad:z,onUnmount:D,children:!A&&(0,a.jsx)(Y.pH,{icon:{url:"/assets/images/address/pin.svg",scaledSize:new google.maps.Size(80,80)},position:v})}),(0,a.jsx)(d.XT,{className:"absolute bottom-10 z-20 w-80",onClick:()=>{let{address_components:e,location:s,structured_formatting:t,neighbourhood:a,...r}=u,l={...r,latitude:v.lat,longitude:v.lng};x(!0),m().then(()=>{_(l),x(!1)})},loading:h||C,children:"Confirmar localiza\xe7\xe3o"})]}):(0,a.jsx)("div",{})}var et=t(58944),ea=t(28936);let er=e=>{let{address:s,className:t,disabled:r}=e,[l,n]=(0,o.useState)(!1),{address:i,handleEditAddress:c,handleDeleteAddress:u}=_(),{current:m}=s,p=i.id===s.id;return(0,a.jsxs)("div",{className:t,children:[(0,a.jsx)("button",{className:(0,T.cn)("flex h-8 w-8 items-center justify-center rounded-full border bg-white p-0 shadow-md","hover:shadow-primary-50 group-hover:border-primary-300",{"border-primary-300":p||m}),disabled:r,onClick:()=>n(!l),children:l?(0,a.jsx)(L.A,{className:"text-primary-300",icon:"x",size:12}):(0,a.jsx)(L.A,{icon:"meatballs",className:"text-primary-300",size:14})}),(0,a.jsx)(et.N,{children:l&&(0,a.jsxs)(ea.P.div,{className:(0,T.cn)("absolute -left-[105px] flex items-center justify-between rounded-2xl border bg-white p-1 shadow-sm",{"-left-[60px]":m}),initial:{x:10,opacity:0},animate:{x:0,opacity:1},exit:{x:10,opacity:0},children:[(0,a.jsx)(d.$n,{className:"rounded-lg",variant:"ghost",size:"icon",type:"button",onClick:()=>c(s),children:(0,a.jsx)(L.A,{className:"text-primary",icon:"pencil",size:20})}),!m&&(0,a.jsx)(d.$n,{className:"rounded-lg",variant:"ghost",size:"icon",type:"button",onClick:()=>u(s),children:(0,a.jsx)(L.A,{className:"text-primary",icon:"trash",size:20})})]})})]})},el=e=>{let{disabled:s,address:t,className:r,handleSelectAddress:n}=e,{step:o}=(0,l.Ay)(),{structured_formatting:i,current:d,name:c,addressType:u}=t;return(0,a.jsx)("button",{className:(0,T.cn)("relative h-[100px] w-full cursor-default rounded-2xl border-2 bg-white shadow-md","group-hover:border-primary-300 group-hover:shadow-primary-50",{"cursor-pointer":o<3,"border-primary-300 shadow-primary-50":d},r),type:"button",disabled:s||!!d,onClick:n,children:(0,a.jsxs)("div",{className:(0,T.cn)("grid grid-cols-[auto_1fr] items-center gap-x-4 px-4"),children:[(0,a.jsxs)("div",{className:"row-span-3 flex h-full flex-col justify-evenly",children:[!!d&&(0,a.jsx)(L.A,{className:"rounded-full text-primary shadow-primary",icon:"check-circle",size:20}),(0,a.jsx)(en,{addressType:c||u})]}),(0,a.jsx)("p",{className:"col-start-2 line-clamp-1 w-max rounded-lg bg-gray-50 px-2 py-1 text-left text-xs text-gray-700",children:(()=>{switch(c){case"home":return"Casa";case"work":return"Trabalho";case"others":return"Outros";default:return c}})()}),(0,a.jsx)("p",{className:(0,T.cn)("col-start-2 row-span-2 line-clamp-1 text-left text-sm",{"row-span-1 row-start-2":c}),children:null==i?void 0:i.main}),(0,a.jsx)("p",{className:(0,T.cn)("col-start-2 row-span-2 line-clamp-1 text-left text-xs font-light",{"row-span-1 row-start-3":c}),children:null==i?void 0:i.secondary})]})})},en=e=>{let{addressType:s,className:t}=e;return"home"===s?(0,a.jsx)(L.A,{className:t,size:20,icon:"home"}):"work"===s?(0,a.jsx)(L.A,{className:t,size:20,icon:"building"}):(0,a.jsx)(L.A,{className:t,size:20,icon:"star"})},eo=e=>{let{handleSelectAddress:s,address:t,disabled:r}=e,{deleteAddressIsLoading:l,address:n}=_(),o=n.id===t.id&&l;return(0,a.jsxs)("div",{className:"group relative flex items-center justify-center",children:[(0,a.jsx)(el,{address:t,disabled:r,handleSelectAddress:s}),(0,a.jsx)(er,{className:"absolute -right-4 flex items-center",address:t}),o&&(0,a.jsx)(H.A,{className:"absolute animate-spin text-gray-300",size:32})]})},ei=()=>{let[e,s]=(0,o.useState)(!1),t=(0,l.wA)(),{mutate:r}=(0,f.W1)({onSuccess:e=>{t({type:"ADD_DATA",payload:{structured_formatting:(0,h.tD)(e.results[0].address_components),location:e.results[0].geometry.location,address_components:e.results[0].address_components,formatted_address:e.results[0].formatted_address}}),t({type:"SET_STEP",payload:2}),s(!1)}}),n=e=>{let{coords:s}=e;r({lat:s.latitude,lng:s.longitude})},i=e=>{switch(e.code){case e.PERMISSION_DENIED:b.o.warning("Opa! Para podermos utilizar sua localiza\xe7\xe3o \xe9 necess\xe1rio que voc\xea d\xea permiss\xe3o.");break;case e.POSITION_UNAVAILABLE:b.o.warning("Localiza\xe7\xe3o indispon\xedvel.");break;case e.TIMEOUT:b.o.warning("O tempo para obter a localiza\xe7\xe3o expirou.");break;default:b.o.error("Erro desconhecido: ".concat(e.message))}s(!1)},c=async()=>{"geolocation"in navigator&&(s(!0),navigator.geolocation.getCurrentPosition(n,i))};return(0,a.jsx)(d.$n,{className:(0,T.cn)("hover:ring-primary-base h-auto min-h-14 roun
1ded-2xl bg-white p-0 py-2 hover:bg-white hover:ring-2",{"opacity-80":e}),variant:"ghost",size:"lg",onClick:c,children:e?(0,a.jsxs)("div",{className:"grid grid-cols-[auto_1fr] items-center gap-x-2 gap-y-1 px-4",children:[(0,a.jsx)(B.E,{className:"row-span-2 h-6 w-6 rounded-md bg-neutral-300"}),(0,a.jsx)(B.E,{className:"h-5 w-52 rounded-md bg-neutral-300"}),(0,a.jsx)(B.E,{className:"h-4 w-80 rounded-md bg-neutral-300"})]}):(0,a.jsxs)("div",{className:"grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-1 px-4",children:[(0,a.jsx)(L.A,{icon:"target",className:"text-gray-base row-span-2",size:16}),(0,a.jsx)("span",{className:"text-neutral-base text-left text-sm font-normal",children:"Usar minha localiza\xe7\xe3o atual"}),(0,a.jsx)("p",{className:"text-left text-sm font-light text-gray-500",children:"Clique aqui para permitir usar sua localiza\xe7\xe3o no navegador."})]})})},ed=()=>{var e;let{handleConfirmDeleteAddress:s,handleCancelDeleteAddress:t,address:l,isDeletingAddress:n}=_();return(0,a.jsxs)(r.DialogFooter,{className:(0,T.cn)("collapse absolute bottom-0 left-0 grid h-full w-full grid-rows-[1fr_288px] overflow-hidden sm:space-x-0",{visible:n}),children:[(0,a.jsx)("div",{className:(0,T.cn)("absolute left-0 top-0 h-full w-full rounded-b-lg bg-black/10"),onClick:t}),(0,a.jsxs)("div",{className:(0,T.cn)("absolute bottom-0 left-0 z-10 grid h-full max-h-72 w-full translate-y-full grid-cols-2 grid-rows-[auto_auto_1fr_auto] items-center gap-2 rounded-lg border-t bg-white p-8 shadow-up transition-all duration-500",{"translate-y-0":n}),children:[(0,a.jsx)("span",{className:"mb-3 w-max rounded-lg bg-gray-50 px-2 py-1 text-xs text-gray-700",children:l.name}),(0,a.jsx)("h3",{className:"col-span-2 text-xl font-semibold text-gray-base",children:null==(e=l.structured_formatting)?void 0:e.main}),(0,a.jsx)("p",{className:"col-span-2 h-min text-gray-800",children:"Ao confirmar, este endere\xe7o ser\xe1 removido da sua lista de endere\xe7os dispon\xedveis."}),(0,a.jsx)(d.$n,{size:"lg",variant:"ghost",onClick:s,children:"Sim, excluir"}),(0,a.jsx)(d.$n,{size:"lg",onClick:t,children:"N\xe3o, voltar"})]})]})},ec=P.z.object({zipcode:P.z.string()}),eu=()=>{let e,s=(0,y.mN)({resolver:(0,g.u)(ec),mode:"onBlur",defaultValues:{zipcode:""}}),t=(0,l.wA)(),r=s.getValues("zipcode"),n=(0,f.w0)(r);return(0,o.useEffect)(()=>{let{data:e}=n;(null==e?void 0:e.status)===1&&(t({type:"ADD_DATA",payload:{...e.zipCode,neighborhood:e.zipCode.neighbourhood}}),t({type:"NEXT_STEP"}),s.reset({zipcode:""}),p.q.removeQueries({queryKey:["FetchZipcode"]}))},[n.isSuccess,n.data]),(0,o.useEffect)(()=>(9===r.length&&(clearTimeout(e),e=setTimeout(()=>{n.refetch()},1e3)),()=>clearTimeout(e)),[r]),(0,a.jsx)(u.lV,{...s,children:(0,a.jsx)("form",{className:"flex items-end gap-4",onSubmit:s.handleSubmit(()=>{n.refetch()}),children:(0,a.jsx)(u.zB,{control:s.control,name:"zipcode",render:e=>{let{field:s}=e;return(0,a.jsxs)(u.eI,{className:"w-full",children:[(0,a.jsx)(u.MJ,{children:(0,a.jsxs)("div",{className:"relative flex items-center",children:[(0,a.jsx)(L.A,{icon:"pin-map",className:"absolute left-4",size:16}),(0,a.jsx)(m.N5,{className:"pl-12 placeholder:text-gray-400",...s,type:"text",placeholder:"Buscar pelo CEP",mask:"00000-000"}),(0,a.jsx)(H.A,{className:(0,T.cn)("absolute right-4 hidden animate-spin text-gray-400",{block:n.isFetching}),size:24})]})}),(0,a.jsx)(u.C5,{})]})}})})})};var em=t(18490);function ep(){let e=(0,n.L)(e=>e.setIsOpen);return(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-5 rounded-2xl border-2 border-dashed p-4",children:[(0,a.jsx)(M.default,{src:"/assets/images/address/address.png",alt:"endere\xe7o",width:84,height:64}),(0,a.jsxs)("p",{className:"flex w-full items-center justify-center gap-1 text-sm text-gray-500",children:[(0,a.jsx)(em.N,{href:"/auth/signin",onClick:()=>e(!1),children:"Entre ou cadastre-se"}),"pra salvar mais endere\xe7os."]})]})}let eh=()=>{var e;let s=(0,n.L)(e=>e.setAddress),t=(0,n.L)(e=>e.setIsOpen),r=(0,G.n)(e=>e.isAnonymous),l=(0,G.n)(e=>e.isAuth),{handleCancelEditAddress:i}=_(),d=(0,f.eU)({onSuccess:e=>{1===e.status?(t(!1),s(e.currentAddress),j.default.success("Endere\xe7o selecionado")):j.default.error(e.message||"N\xe3o foi poss\xedvel selecionar o endere\xe7o")}}),{data:c}=(0,f.Gg)({enabled:l});(0,o.useEffect)(()=>
1{if(c){var e,s;(0,X.setCookie)(J.BD,String(null!=(s=null==c||null==(e=c.currentAddress)?void 0:e.id)?s:0),{path:"/"})}},[null==c?void 0:c.currentAddress]),(0,o.useEffect)(()=>{i()},[]);let{currentAddress:u,addresses:m}=null!=c?c:{currentAddress:{},addresses:[]};return(0,a.jsxs)("div",{className:"custom-scrollbar -mr-6 grid h-full auto-rows-min gap-6 overflow-y-auto pr-6 pb-6",children:[(0,a.jsxs)("div",{className:"grid auto-rows-min gap-3 rounded-2xl bg-gray-50 p-5",children:[(0,a.jsx)(eu,{}),(0,a.jsx)(ei,{})]}),(null==c||null==(e=c.currentAddress)?void 0:e.id)&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"mb-4 font-bold",children:"Endere\xe7o em uso"}),(0,a.jsx)(eo,{address:u||{}})]}),(null==m?void 0:m.length)>0&&!r&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"mb-4 font-bold",children:"Meus endere\xe7os:"}),(0,a.jsx)("ul",{className:"grid gap-4",children:m.map(e=>{let{isPending:s,variables:t}=d;return(0,a.jsx)(eo,{isLoading:s&&t===e.id,address:e,handleSelectAddress:()=>{d.mutate(Number(e.id))}},e.id)})})]}),(!l||r)&&(0,a.jsx)(ep,{}),(0,a.jsx)(ed,{})]})},ex=()=>{let{step:e}=(0,l.Ay)(),s=(0,i.usePathname)(),t=(0,l.wA)(),r=(0,n.L)(e=>e.stepControlConfig);return((0,o.useEffect)(()=>{var e;t({type:"SET_STEP",payload:null!=(e=r.step)?e:1}),t({type:"SET_DATA",payload:r.data})},[]),s.includes("guest")&&1===e)?(0,a.jsx)(Z,{}):1===e?(0,a.jsx)(eh,{}):2===e?(0,a.jsx)(q,{}):3===e?(0,a.jsx)(es,{className:"absolute top-0 left-0 h-full w-full"}):(0,a.jsx)(a.Fragment,{})},ef=()=>{let{step:e,data:s}=(0,l.Xy)(),t=(0,l.wA)(),n=(0,i.usePathname)();if((0,o.useEffect)(()=>()=>{t({type:"RESET_STATE"})},[]),n.includes("guest")&&1===e)return(0,a.jsx)(a.Fragment,{});if(1===e)return(0,a.jsx)(r.DialogHeader,{className:"p-8",children:(0,a.jsx)(r.DialogTitle,{className:"text-xl",children:"Onde voc\xea est\xe1?"})});if(2===e){var c;return(0,a.jsx)(r.DialogHeader,{className:"p-8",children:(0,a.jsx)(r.DialogTitle,{children:(0,a.jsxs)("div",{className:"relative flex items-center gap-4",children:[(0,a.jsx)(d.$n,{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-lg p-0",variant:"ghost",onClick:()=>t({type:"RESET_STATE"}),children:(0,a.jsx)(L.A,{icon:"arrow-left",className:"text-primary-base",size:24})}),null!=(c=null==s?void 0:s.formatted_address)?c:"Novo Endere\xe7o"]})})})}return 3===e?(0,a.jsx)(r.DialogHeader,{className:"p-8",children:(0,a.jsx)(r.DialogTitle,{children:(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(d.$n,{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-lg p-0",variant:"ghost",onClick:()=>t({type:"PREVIOUS_STEP"}),children:(0,a.jsx)(L.A,{icon:"arrow-left",className:"text-primary-base",size:24})}),"Confirmar localiza\xe7\xe3o"]})})}):(0,a.jsx)(a.Fragment,{})};function eg(){let{isOpen:e,setIsOpen:s}=(0,n.L)(e=>e),t=(0,n.L)(e=>e.setStepControlConfig);return(0,o.useEffect)(()=>{e||t({})},[e]),(0,a.jsx)(r.Dialog,{open:e,onOpenChange:s,children:(0,a.jsx)(l.pm,{children:(0,a.jsx)(E,{children:(0,a.jsxs)(r.DialogContent,{className:"h-screen max-w-full auto-rows-min gap-0 overflow-hidden p-0 sm:h-auto sm:max-w-2xl md:rounded-2xl",children:[(0,a.jsx)(ef,{}),(0,a.jsx)("div",{className:"relative h-[calc(100vh-92px)] px-6 sm:h-148",children:(0,a.jsx)(ex,{})})]})})})})}},86026:(e,s,t)=>{"use strict";t.d(s,{NextAuthProvider:()=>l});var a=t(95155),r=t(36489);function l(e){let{children:s}=e;return(0,a.jsx)(r.SessionProvider,{children:s})}},86259:(e,s,t)=>{"use strict";t.d(s,{Separator:()=>o});var a=t(95155),r=t(12115),l=t(78912),n=t(64269);let o=r.forwardRef((e,s)=>{let{className:t,orientation:r="horizontal",decorative:o=!0,...i}=e;return(0,a.jsx)(l.b,{ref:s,decorative:o,orientation:r,className:(0,n.cn)("shrink-0 bg-border","horizontal"===r?"h-px w-full":"h-full w-px",t),...i})});o.displayName=l.b.displayName},90854:(e,s,t)=>{"use strict";t.d(s,{A:()=>c});var a=t(44341),r=t(42987),l=t(19672),n=t(9903),o=t(53404),i=t(36489),d=t(20063);let c=()=>{(0,d.useRouter)();let e=(0,n.K)(e=>e.setProfile),s=(0,n.K)(e=>e.resetProfile),t=(0,l.n)(e=>e.setAnonymous),c=(0,l.n)(e=>e.setAuth);return{onLogin:s=>{var a,r,l;c(!0),t(!1),e({login:s.login,name:s.profile.name,phone:s.profile.phone,cpf:null!=(r=s.profile.cpf)?r:s.userDocument,birthday:null!=(l=null==(a=s.profile)?void 0:a.birthday)?l:""}),window.location.href="/"},onLogout:()=>{s(),(0,o.deleteCookie)(r.CV),(0,o.deleteCookie)(r.BD),c(!1),t(!1),(0,i.signOut)(),(0,a.z8)(),window.location.href="/guest"}}}},93836:()=>{}},e=>{e.O(0,[1725,5475,9268,6084,6996,3455,1356,2619,2663,9079,3038,6784,3992,397,5026,149,5146,3117,5578,4167,5602,103,8945,404,4976,8441,1255,7358],()=>e(e.s=72676)),_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.