PageSourceSearch

https://www.antoniospizzafl.com/_next/static/chunks/pages/item/[slug]-fe0ae13027f76e0a.js

js antoniospizzafl.com collected 2026-10-02 01:23:35 UTC 21,608 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[449],{52955:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/item/[slug]",function(){return i(66607)}])},20743:function(e,n,i){"use strict";i.d(n,{T:function(){return c}});var t=i(85893),s=i(67294),a=i(94184),l=i.n(a),r=i(79127);let c=e=>{var n,i;let{brand:a}=(0,s.useContext)(r.I),c=null!==(i=null!==(n=e.url)&&void 0!==n?n:a.background)&&void 0!==i?i:"/images/default-brand-background.png";return(0,t.jsxs)("div",{className:l()("text-white flex flex-col text-3xl z-10 relative w-full",e.className),style:{...e.style,backgroundImage:"url(".concat(c,")"),backgroundSize:"cover",zIndex:1,backgroundPosition:"center"},children:[(0,t.jsx)("div",{className:"absolute top-0 left-0 bg-black bg-opacity-60 z-20 w-full h-full",style:{zIndex:-1}}),(0,t.jsx)("div",{className:"relative z-30 flex justify-center items-center flex-grow",children:e.children})]})}},66607:function(e,n,i){"use strict";i.r(n),i.d(n,{CardTitle:function(){return D},__N_SSP:function(){return A},default:function(){return J}});var t=i(85893),s=i(50948),a=i(67294),l=i(11163),r=i(64593),c=i(7551),d=i(19819),o=i(82849),h=i(94184),p=i.n(h),m=i(97580);let u=(0,a.createContext)({});var x=i(87399);let _=e=>{let{portionOption:n,currentTopping:i}=e,{form:l,setForm:r,itemPageJson:c}=(0,a.useContext)(u),d=l.toppings.find(e=>e.name===i.name&&e.portion_name===n.portion_name),o=()=>{let e={...i,hash_id:n.hash_id,portion_name:n.portion_name};e.is_included=(0,x.RF)(e,c),e.price=(0,x.O)(e,c),e.price+=n.price_difference;let t=(0,x.Sm)(l.toppings.map(e=>e.price))*l.quantity,s=l.toppings.map(n=>n.name===i.name&&n.tile_hash_id===i.tile_hash_id?e:n),a=(0,x.Sm)(s.map(e=>e.price))*l.quantity;r({...l,price:l.price-t+a,toppings:s})},h=(n.price_difference>0?"+":"")+(0,x.CZ)(n.price_difference);return(0,t.jsxs)(s.Button,{className:"border-none rounded-none space-x-4 justify-between",onClick:()=>o(),children:[(0,t.jsx)("span",{children:n.portion_name}),(0,t.jsx)("span",{children:d?"Selected":h})]})},f=(0,a.createContext)({}),j=()=>{let{topping:e}=(0,a.useContext)(f),[n,i]=(0,a.useState)(!1),[l=[],r,c]=(0,s.useFetch)({url:"/api/topping/".concat(e.hash_id,"/portion"),isAllowed:n});return(0,t.jsxs)(s.Select,{isOpen:n,onClose:()=>i(!1),onOpen:()=>i(!0),className:"flex-grow-0",children:[(0,t.jsxs)(s.SelectButton,{className:"px-3 py-1 min-h-0 space-x-2",children:[(0,t.jsx)("span",{className:"text-xs",children:e.portion_name}),(0,t.jsx)(s.SelectButtonCaret,{className:"w-3 h-3"})]}),(0,t.jsx)(s.SelectDropdown,{children:(0,t.jsx)(s.Suspense,{hook:c,children:l.map(n=>(0,t.jsx)(_,{currentTopping:e,portionOption:n},n.hash_id))})})]})};var g=i(79127);let y=e=>{let{type:n,w:i=16,h:s=16}=e;return(0,t.jsxs)("div",{className:p()("rounded-full border border-red-500 relative flex items-center",{"justify-center":"whole"===n,"justify-end":"right"===n,"justify-start":"left"===n}),style:{height:s+4,width:i+4},children:["whole"===n?(0,t.jsx)("div",{className:"bg-red-500 rounded-full",style:{height:s,width:i}}):null,"left"===n?(0,t.jsx)("div",{className:"bg-red-500 ml-[1px] rounded-l-full",style:{height:s,width:i/2}}):null,"right"===n?(0,t.jsx)("div",{className:"bg-red-500 mr-[1px] rounded-r-full",style:{height:s,width:i/2}}):null]})},v={0:"whole",1:"left",2:"right"},b=()=>{let{topping:e}=(0,a.useContext)(f),{brand:n}=(0,a.useContext)(g.I),{form:i,item:l,setForm:r}=(0,a.useContext)(u),c=i=>{r(t=>({...t,toppings:t.toppings.map(t=>{if(t.hash_id===e.hash_id){let e=t.price;return 0!==i&&0===t.side&&(e*=n.hnh_discount_percent),0===i&&0!==t.side&&(e=t.section_topping_price),{...t,side:i,price:e}}return t})}))};return(0,t.jsxs)(s.Select,{className:"flex-grow-0",children:[(0,t.jsxs)(s.SelectButton,{className:"px-3 py-1 min-h-0 space-x-2",children:[(0,t.jsx)(y,{w:12,h:12,type:v[e.side]}),(0,t.jsx)("span",{className:"text-xs",children:(0,x.kC)(v[e.side])}),(0,t.jsx)(s.SelectButtonCaret,{className:"w-3 h-3"})]}),(0,t.jsxs)(s.SelectDropdown,{children:[(0,t.jsxs)(s.Button,{className:"border-none rounded-none space-x-2 w-full",onClick:()=>c(0),children:[(0,t.jsx)(y,{type:"whole"}),(0,t.jsx)("span",{children:"Whole"})]}),(0,t.jsxs)(s.Button,{className:"border-none rounded-none space-x-2 w-full",onClick:()=>c(1),children:[(0,t.jsx)(y,{type:"left"}),(0,t.jsx)("span",{children:"Left"})]}),(0,t.jsxs)(s.Button,{className:"border-none rounded-none space-x-2 w-full",onClick:()=>c(2),children:[(0,t.jsx)(y,{type:"right"}),(0,t.jsx)("span",{children:"Right"})]})]})]})};
1var C=i(79821);let w=()=>{let{topping:e,setTopping:n}=(0,a.useContext)(f),i=async e=>{n(n=>({...n,topping_option_name:e.name}))},[l,r]=(0,a.useState)(!1),[c,d,o]=(0,s.usePaginate)({url:"/api/topping-option-list/".concat(e.topping_option_list_hash_id,"/topping-option"),isAllowed:!!e.topping_option_list_hash_id});if(!e.topping_option_list_hash_id)return null;let h=!e.topping_option_name;return(0,t.jsxs)(s.Select,{onOpen:()=>r(!0),onClose:()=>r(!1),isOpen:l,children:[(0,t.jsxs)(s.SelectButton,{className:p()("w-full rounded-none border-none",{"overflow-visible":h}),children:[h?(0,t.jsx)(C.U,{}):null,(0,t.jsxs)("div",{className:"flex space-x-4 justify-between w-full",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:"How would you like it?"}),(0,t.jsxs)("div",{className:"flex items-center flex-shrink-0 flex-nowrap max-w-[200px]",children:[(0,t.jsx)("span",{children:e.topping_option_name}),(0,t.jsx)(s.SelectButtonCaret,{})]})]})]}),(0,t.jsx)(s.SelectDropdown,{children:(0,t.jsx)(s.Suspense,{hook:o,children:c.map(e=>(0,t.jsx)(s.Button,{className:"rounded-none border-none w-full",onClick:()=>i(e),children:e.name},e.hash_id))})})]})};function N(e){return e.is_included?"Included":e.price<=0?"Free":(0,x.CZ)(e.price)}let k=e=>{let{topping:n,tile:i}=e,{form:l,item:r,setForm:c}=(0,a.useContext)(u),{name:d,hash_id:o,is_removable:h,is_hah_disabled:p}=n,m=(0,a.useCallback)(()=>{c(e=>{let n=e.toppings.filter(e=>e.hash_id!==o),i=(0,x.Sm)(e.toppings.map(e=>e.price))*e.quantity,t=(0,x.Sm)(n.map(e=>e.price))*e.quantity;return{...e,price:e.price-i+t,toppings:n}})},[c,o]),_=(0,a.useCallback)(e=>{let i=e instanceof Function?e(n):e;c(e=>({...e,toppings:e.toppings.map(e=>e.hash_id===i.hash_id?i:e)}))},[c,n]);return(0,t.jsx)(f.Provider,{value:{topping:n,setTopping:_},children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-sm flex justify-between items-center p-2",children:[(0,t.jsxs)("div",{className:"w-28 flex items-center flex-nowrap space-x-2",children:[h?(0,t.jsx)(s.Checkbox,{checked:!0,onClick:m}):null,(0,t.jsxs)("div",{className:"flex-shrink-0",children:[(0,t.jsx)("div",{children:d}),(0,t.jsx)("div",{className:"text-xs",children:N(n)})]})]}),(0,t.jsxs)("div",{className:"space-y-1 flex items-end flex-col",children:[(0,t.jsx)(j,{}),r.has_hah&&!p?(0,t.jsx)(b,{}):null]})]}),(0,t.jsx)(w,{})]})})};function S(e,n){return n.toppings.filter(n=>e.find(e=>e.tile_hash_ids.includes(n.tile_hash_id)))}let q=e=>{let{tile:n}=e,{form:i,item:l,setTileModal:r,rules:c}=(0,a.useContext)(u),d=i.toppings.filter(e=>e.tile_hash_id===n.hash_id),o=c.filter(e=>e.tile_hash_ids.includes(n.hash_id)),h=o.filter(e=>e.min>S(o,i).length).length>0;return(0,t.jsxs)("div",{className:"space-y-2 my-2 bg-gray-50",children:[(0,t.jsxs)("div",{className:p()("flex rounded border-primary items relative p-2 items-center justify-between bg-primary text-primary-contrast"),children:[h?(0,t.jsx)(C.U,{}):null,(0,t.jsx)("span",{className:"font-bold",children:n.name}),(0,t.jsxs)(s.Button,{className:"size-sm px-3 py-2",onClick:()=>r(n),children:[(0,t.jsx)(s.Icon,{src:m.Z}),(0,t.jsx)("span",{children:"Add"})]})]}),d.map(e=>(0,t.jsx)(k,{topping:e,tile:n},e.hash_id))]})},z=(0,a.createContext)({});function I(){let{rules:e,itemPageJson:n,tiles:i,hasFreeAvailable:t,form:s}=(0,a.useContext)(u),{recipe_toppings:l}=n;return(0,a.useCallback)(e=>e.map(e=>{var i;let a=s.toppings.find(n=>n.name===e.name&&n.tile_hash_id===e.tile_hash_id),r=e.quantity-(null!==(i=null==a?void 0:a.free_quantity)&&void 0!==i?i:0),c=e.price*r;if(t(e)||(0,x.RF)(e,n))c=0;else{let i=l.find(n=>n.name===e.name&&"Regular"===n.portion_name),t=(0,x.RF)(i,n);"Extra"===e.portion_name&&(t?c=e.section_topping_price-i.section_topping_price:(null==a?void 0:a.free_quantity)>0&&(c=e.section_topping_price-a.section_topping_price))}return{...e,price:c}}),[s.toppings,t,n,l])}let B=e=>{let{tileToppings:n,toppingName:i,tile:l}=e,{form:r,setForm:c,rules:d,hasFreeAvailable:o}=(0,a.useContext)(u),h={};n.filter(e=>e.size_name===r.size_name&&e.name===i).forEach(e=>{h[e.portion_name]=e});let p=r.toppings.find(e=>e.name===i&&e.tile_hash_id===l.hash_id),m=n.find(e=>e.name===i&&e.tile_hash_id===l.hash_id),x=!!p,_=I(),f=(0,a.useCallback)(()=>{c(e=>{let n=!!e.toppings.some(e=>
1e.name===i&&e.tile_hash_id===l.hash_id),t={...m,free_quantity:o(m)?1:0,section_topping_price:m.price,tile_hash_id:l.hash_id,quantity:1};t.price=_([t])[0].price;let s=t.price*e.quantity,a=n?e.price-s:e.price+s;return{...e,price:a,toppings:n?e.toppings.filter(e=>e.name!==i):[...e.toppings,t]}})},[c,m,o,l.hash_id,_,i]),j=!!d.filter(e=>e.tile_hash_ids.includes(l.hash_id)).some(e=>e.max>0&&e.max<=S([e],r).length);return(0,t.jsx)(z.Provider,{value:{tileToppings:n,tile:l,selectedTopping:p,toppingName:i},children:(0,t.jsx)("div",{className:"flex items-center w-full space-x-4 border-dashed border-b",children:(0,t.jsx)(s.CheckboxInput,{disabled:j&&!x,onClick:f,checked:x,label:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{children:i}),(0,t.jsx)("span",{children:N(null!=p?p:m)})]}),className:"w-auto flex-grow topping-btn"})})})},F=()=>{let{form:e,item:n,rules:i,tileModal:l,setTileModal:r}=(0,a.useContext)(u),c=!!l,d=I(),[o=[],h,p]=(0,s.useFetch)({url:"/api/tile/".concat(null==l?void 0:l.hash_id,"/topping?size_name=").concat(encodeURIComponent(e.size_name),"&recipe_name=").concat(encodeURIComponent(n.name)),isAllowed:c,formatResponse:e=>d(e.data)}),{refresh:m}=p;(0,a.useEffect)(()=>{m()},[e.toppings,m]);let x=function(e){let n={};return e.sort((e,n)=>e.price-n.price).forEach(e=>{n[e.name]=!0}),Object.keys(n)}(o);return(0,t.jsxs)(s.Modal,{isOpen:c,onClose:()=>r(void 0),children:[(0,t.jsx)(s.ModalHeader,{children:null==l?void 0:l.name}),(0,t.jsx)(s.ModalContent,{className:"max-h-screen-1/2 overflow-y-auto",children:(0,t.jsx)(s.Suspense,{hook:p,children:x.map(e=>(0,t.jsx)(B,{tileToppings:o,tile:l,toppingName:e},e))})}),(0,t.jsx)("div",{className:"w-full h-16 flex justify-center items-center bg-panel",children:(0,t.jsx)(s.Button,{className:"primary",onClick:()=>r(void 0),children:"Close"})})]})},R=e=>{let{item:n,addon:i,addonIsMaxed:l}=e,{form:r,setForm:c}=(0,a.useContext)(u),d=r.children.find(e=>e.addon_hash_id===i.hash_id&&e.size_name===n.size_name&&e.name===n.name),o=(0,a.useCallback)(()=>{let e=(0,x.Sm)(r.children.filter(e=>e.addon_hash_id===i.hash_id).map(e=>{var n;return null!==(n=e.free_quantity)&&void 0!==n?n:0}));return Math.max(0,i.free-e)},[i.free,i.hash_id,r.children]),h=(0,a.useCallback)(e=>{c(n=>{let t=d?n.children.filter(n=>n.name+n.size_name!==e.name+e.size_name):[...n.children,{hash_id:e.hash_id,name:e.name,addon_hash_id:i.hash_id,size_name:e.size_name,price:e.price*n.quantity,quantity:n.quantity,free_quantity:o()>0?1:0}];return{...n,children:t}})},[i.hash_id,d,o,c]),p=(null==d?void 0:d.free_quantity)>0||o()>0,m=!!d;return(0,t.jsxs)("div",{className:"flex items-center justify-between w-full space-x-2",children:[(0,t.jsx)(s.CheckboxInput,{disabled:l&&!m,className:"w-auto flex-grow flex-shrink",label:(0,t.jsxs)("div",{className:"flex items-center justify-between space-x-2",children:[(0,t.jsx)("span",{children:n.name}),(0,t.jsx)(s.Badge,{children:p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("s",{children:(0,x.CZ)(n.price)}),(0,t.jsx)("span",{children:" - Free"})]}):(0,t.jsx)(t.Fragment,{children:(0,x.CZ)(n.price)})})]}),checked:m,onClick:()=>h(n)}),d&&(0,t.jsx)(s.NumberInput,{min:"1",className:"w-20",value:null==d?void 0:d.quantity,onChange:e=>{c(t=>{var s;let a=parseInt(e.target.value,10),l=Math.min(o()+(null!==(s=null==d?void 0:d.free_quantity)&&void 0!==s?s:0),a),r=n.price,c=t.children.map(e=>e.addon_hash_id===i.hash_id&&e.name===n.name&&e.size_name===n.size_name?{hash_id:e.hash_id,size_name:e.size_name,addon_hash_id:i.hash_id,name:e.name,price:r*(a-l),quantity:a,free_quantity:l}:e);return{...t,children:c}})}})]})},T=e=>{let{addon:n}=e,{form:i}=(0,a.useContext)(u),l=i.children.filter(e=>n.items.find(i=>e.addon_hash_id===n.hash_id&&e.size_name===i.size_name&&e.name===i.name)),r=n.max>0&&(0,x.Sm)(l.map(e=>e.quantity))>=n.max;return(0,t.jsxs)(s.Card,{children:[(0,t.jsxs)("div",{className:"bg-primary text-primary-contrast p-2 flex justify-between items-center space-x-2 rounded",children:[(0,t.jsx)("span",{className:"font-bold",children:n.title}),(0,t.jsxs)("div",{className:"flex flex-shrink-0 items-center space-x-2",children:[n.free?(0,t.jsx)(s.Badge,{children:"".concat(n.free," free")}):null,n.min?(0,t.jsx)(s.Badge,{children:"".concat(n.min," min")}):null,n.max?(0,t.jsx)(s.Badge,{children:"".concat(n.max," max")}
1):null]})]}),(0,t.jsx)("div",{className:"space-y-2 overflow-y-auto max-h-48",children:n.items.map(e=>(0,t.jsx)(R,{addon:n,item:e,addonIsMaxed:r},e.hash_id))})]})};var O=i(20743);let P=e=>{let{rules:n,tiles:i}=e;return(0,t.jsx)("div",{className:"flex flex-wrap justify-center space-x-1",children:(0,x.FP)(n,i).map(e=>(0,t.jsx)(s.Badge,{className:"bg-gray-50 m-1",children:e},e))})},E=e=>{let{className:n}=e,{setForm:i,form:l}=(0,a.useContext)(u),r=e=>{e=Math.max(1,e);let n=l.price/l.quantity,t=l.children.map(n=>{let i=n.price/n.quantity;return{...n,quantity:e,price:i*e}});i(i=>({...i,price:n*e,children:t,quantity:e}))};return(0,t.jsx)("div",{className:p()("flex items-center space-x-2 mt-0",n),children:(0,t.jsxs)("div",{className:"bg-white flex flex-nowrap border-2 border-dashed rounded-full border-gray items-center flex-shrink-0 p-1 space-x-2",children:[(0,t.jsx)(s.Button,{className:"h-8 px-5 min-h-0 text-xl",onClick:()=>r(l.quantity+1),children:"+"}),(0,t.jsx)(s.TextInput,{className:"w-14 h-8 rounded-full min-h-0 no-arrows quantity-input",type:"number",value:l.quantity,onChange:e=>r(parseInt(e.target.value,10))}),(0,t.jsx)(s.Button,{className:"h-8 px-5 min-h-0 text-xl",onClick:()=>r(l.quantity-1),children:"-"})]})})},Z=()=>{let{form:e,item:n,orderItem:i,setItemPageJson:l,itemPageJson:r,setForm:c,setBusy:d,hasFreeAvailable:o,rules:h}=(0,a.useContext)(u),{setAlert:p}=(0,a.useContext)(s.JourneyAppContext),m=async a=>{if(a.unavailable_until_at)return p((0,t.jsxs)("div",{className:"flex space-x-1",children:[(0,t.jsx)("span",{children:"Sorry this size is unavailable until"}),(0,t.jsx)(s.DateFormat,{format:"M/d/yy h:mma",value:a.unavailable_until_at})]})),!1;d(!0);try{let t=await (0,s.enhancedFetch)("/api/item/change-size",{method:"POST",body:{size_hash_id:a.hash_id,item_hash_id:null==i?void 0:i.hash_id,toppings:e.toppings.map(e=>({hash_id:e.hash_id}))}});l(t.item_page);let d=n.sizes.find(n=>n.name===e.size_name);c(e=>{let n=t.new_toppings.map(n=>{var i;let s=n.price,a=e.toppings.find(e=>e.name===n.name&&e.portion_name===n.portion_name);return(a&&a.free_quantity>0||(0,x.RF)(n,r))&&(s=0),{...n,is_included:(0,x.RF)(n,t.item_page),free_quantity:null!==(i=null==a?void 0:a.free_quantity)&&void 0!==i?i:0,price:s}}),i=(0,x.Sm)(n.map(e=>e.price))*e.quantity,s=(0,x.Sm)(e.toppings.map(e=>e.price))*e.quantity,l=d.price*e.quantity,c=a.price*e.quantity;return{...e,size_name:a.name,price:e.price-l+c-s+i,toppings:n}})}catch(e){throw d(!1),e}d(!1)};return(0,t.jsxs)(s.Card,{children:[(0,t.jsx)(D,{children:"Select A Size"}),(0,t.jsx)(s.Row,{className:"justify-start",children:n.sizes.map(e=>(0,t.jsx)(s.Col,{className:"flex items-center",lg:n.sizes.length>=4?3:6,md:4,sm:6,xs:6,children:(0,t.jsx)(s.RadioInput,{name:"size_name",className:"m-0",checkedValue:e.name,label:"".concat(e.name," - ").concat((0,x.CZ)(e.price)),onClick:()=>m(e)})},e.hash_id))})]})};var M=i(10969);let U=()=>{let{form:e,item:n,tiles:i,rules:l}=(0,a.useContext)(u),r=l.filter(n=>n.min>S(l,e).length);return r.length<=0?null:(0,t.jsxs)(s.Card,{className:"bg-yellow-400 p-4 flex items-center space-x-4",children:[(0,t.jsx)(s.Icon,{className:"md:w-12 md:h-12 flex-shrink-0",src:M.Z}),(0,t.jsxs)("div",{className:"flex items-center",children:[n.parent_name?'This item was included with your "'.concat(n.parent_name,'" and it'):"This item"," ","requires you to make a selection of"," ",r.map(e=>(0,x.YP)(e,i).toLowerCase()).join(" "),"."]})]})};var A=!0;let D=s.Journey.div("text-lg my-2 heading-font font-bold text-center"),Y=()=>(0,t.jsx)("div",{className:"flex flex-wrap justify-center space-x-1",children:"You can not add additional toppings, you may only remove existing ones added already."});var J=e=>{var n,i,h,p,m,_;let f=(0,l.useRouter)(),[j,y]=(0,a.useState)(e),{title:v,description:b,brand:C,item:w,rules:N,addons:k,tiles:S,recipe_hash_id:z}=j;(0,a.useEffect)(()=>{y(e)},[e]);let[I,B]=(0,a.useState)({size_name:w.size_name,price:null!==(p=w.price)&&void 0!==p?p:null===(n=w.sizes.find(e=>e.name===w.size_name))||void 0===n?void 0:n.price,quantity:null!==(m=w.quantity)&&void 0!==m?m:1,toppings:w.toppings.map(e=>w.hash_id===z?{...e,price:0}
1:e),children:w.children.map(e=>({price:e.price,size_name:e.size_name,name:e.name,addon_hash_id:e.addon_hash_id,hash_id:e.hash_id,free_quantity:e.free_quantity,quantity:e.quantity}))}),[R,M]=(0,a.useState)(),{refreshCart:A,order:J,setCartNotifications:L,setCartModalOpen:H}=(0,a.useContext)(g.I),X=w.sizes.find(e=>e.name===I.size_name),Q=null==J?void 0:null===(i=J.items)||void 0===i?void 0:i.find(e=>e.hash_id===f.query.slug),V=async()=>{let e=await (0,s.enhancedFetch)(Q?"/api/order/update-item":"/api/order/add-item",{method:Q?"PUT":"POST",body:{item_hash_id:null==Q?void 0:Q.hash_id,size_hash_id:X.hash_id,quantity:I.quantity,children:I.children,toppings:I.toppings.map(e=>({name:e.name,size_name:e.size_name,portion_name:e.portion_name,tile_hash_id:e.tile_hash_id,side:e.side,free_quantity:e.free_quantity,topping_option_name:e.topping_option_name}))}});A();let n=e.items.find(e=>e.has_issue&&!localStorage.getItem("item-redirect-".concat(e.hash_id)));if(L(n=>(0,x.RM)(n,J,e)),n){localStorage.setItem("item-redirect-".concat(n.hash_id),"1"),f.push("/item/".concat(n.hash_id)).then(()=>f.reload()).catch(console.error);return}f.push("/menu");let i=e.items.find(e=>e.has_free_toppings&&!localStorage.getItem("item-free-topping-popup-".concat(e.hash_id)));i&&(localStorage.setItem("item-free-topping-popup-".concat(i.hash_id),"1"),H(!0))},W=async()=>(await (0,s.enhancedFetch)("/api/order/remove-item",{body:{item_hash_id:w.hash_id},method:"DELETE"}),A(),f.push("/cart")),G=(0,a.useCallback)(e=>{if("Regular"!==e.portion_name)return!1;let n=N.filter(n=>{var i;let t=n.tile_hash_ids.includes(e.tile_hash_id);return(null===(i=n.topping_hash_ids)||void 0===i?void 0:i.length)>0?t&&n.topping_hash_ids.includes(e.hash_id):t}),i=(0,x.Sm)(n.map(e=>e.free)),t=(0,x.Sm)(n.flatMap(e=>I.toppings.filter(n=>e.tile_hash_ids.includes(n.tile_hash_id)).map(e=>e.free_quantity)));return i>0&&i>t},[I.toppings,N]),[K,$]=(0,a.useState)(!1),ee={"@context":"https://schema.org","@type":"Product",name:w.name,image:(0,x.dU)(w.picture),description:b,mpn:w.hash_id,price:(0,x.CZ)(null!==(_=w.price)&&void 0!==_?_:null===(h=w.sizes.find(e=>e.name===w.size_name))||void 0===h?void 0:h.price),priceCurrency:"USD",availability:"InStock"},en=(0,x.CZ)(I.price+(0,x.Sm)(I.children.map(e=>e.price)));return"Free"!==en&&(en="".concat(en)),(0,t.jsx)(u.Provider,{value:{item:w,form:I,setForm:B,rules:N,orderItem:Q,addons:k,itemPageJson:j,setItemPageJson:y,busy:K,setBusy:$,tileModal:R,hasFreeAvailable:G,tiles:S,setTileModal:M},children:(0,t.jsxs)(o.n,{brand:C,title:v,description:b,backUrl:"/menu",className:"full-screen",children:[(0,t.jsx)(r.q,{children:(0,t.jsx)("script",{type:"application/ld+json",children:JSON.stringify(ee)})}),(0,t.jsx)(O.T,{className:"h-32",children:(0,t.jsx)("h2",{className:"text-xl sm:text-3xl z-20 font-bold text-center px-1",children:w.name})}),(0,t.jsxs)(s.Form,{value:I,onChange:B,className:"space-y-2 p-2 item-edit-form",children:[(0,t.jsx)(U,{}),(0,t.jsx)(Z,{}),S.length>0?(0,t.jsxs)(s.Card,{children:[(0,t.jsx)(D,{children:"Change Your Options"}),w.can_add_toppings?null:(0,t.jsx)(Y,{}),(0,t.jsx)(P,{rules:N,tiles:S}),(0,t.jsx)(s.Row,{children:S.sort((e,n)=>n.position-e.position).map(e=>(0,t.jsx)(s.Col,{md:6,lg:6,sm:6,children:(0,t.jsx)(q,{tile:e})},e.hash_id))})]}):null,k.length>0&&(0,t.jsxs)(s.Card,{children:[(0,t.jsx)(D,{children:"Select Your Addons"}),(0,t.jsx)(s.Row,{children:k.map(e=>(0,t.jsx)(s.Col,{md:12,children:(0,t.jsx)(T,{addon:e})},e.hash_id))})]}),(0,t.jsxs)(s.Card,{className:"flex flex-col w-full justify-center items-center",children:[(0,t.jsx)(D,{children:"Quantity"}),(0,t.jsx)(E,{})]}),Q&&(0,t.jsxs)(s.Card,{className:"flex justify-between w-full items-center sticky left-0 bottom-12 md:bottom-0",children:[(0,t.jsx)(s.Button,{className:"danger mt-0",onClick:W,children:(0,t.jsx)(s.Icon,{src:c.Z})}),(0,t.jsx)("div",{className:"flex flex-col items-center mt-0",children:(0,t.jsxs)(s.SubmitButton,{disabled:K,className:"flex-grow-0 justify-center w-48 mt-0",onClick:V,children:["Update (",en,")"]})})]}),!Q&&(0,t.jsx)(s.Card,{className:"items-center sticky left-0 bottom-12 md:bottom-0",children:(0,t.jsxs)(s.SubmitButton,{disabled:K,className:"mx-auto w-48 mt-0",onClick:V,children:["Add To Cart (",en,")",(0,t.jsx)(s.Icon,{src:d.Z,className:"pb-1 pl-1"})]})})]}),(0,t.jsx)(F,{})]})})}}},function(e){e.O(0,[593,849,888,774,179],function(){return e(e.s=52955)}),_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.