PageSourceSearch

https://www.karispizza.fi/assets/OrderDetailsPage-630fba25.js

js karispizza.fi collected 2026-09-25 12:15:00 UTC 39,365 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-radix-0e72cabc.js";import{a as t,u as s,r,f as a,e as i}from"./vendor-react-9016e4a2.js";import{w as n,B as d,x as l,ad as c,M as o,n as m,a8 as x,H as u,ah as p,ai as h,aj as b,ak as g,al as f}from"./index-31192add.js";import{d as j,G as v,L as N}from"./GenericMap-a31dd393.js";import{S as y,O as k,A as w}from"./OrderProgressBar-90816400.js";import{A as z}from"./AuthDialog-625569a4.js";import{g as _,c as S}from"./loyaltyService-5a623587.js";import{u as C,a as F,A as I,m as D}from"./vendor-motion-a26fe6c4.js";import{ay as O,bK as T,d as A,bO as R,ag as E,X as $,y as M,N as P,bT as B,bN as q,l as L,J as G,ad as U,K as W,B as K,b1 as V,v as H}from"./vendor-icons-e8b10069.js";import{a as J}from"./customerPhone-99f7324a.js";import{M as Y,P as Z,D as X}from"./esm-265e2841.js";import"./vendor-supabase-36eb0853.js";import"./vendor-capacitor-43d743f6.js";import"./customerProfileService-bda51590.js";import"./addressService-e93d518b.js";const Q=({filled:t,index:s,delay:r})=>e.jsx(D.div,{initial:t?{scale:0,opacity:0}:{scale:1,opacity:1},animate:{scale:1,opacity:1},transition:{delay:r,type:"spring",stiffness:400,damping:15},className:`\n      w-9 h-9 rounded-full flex items-center justify-center text-sm font-semibold\n      transition-all duration-300\n      ${t?"bg-gradient-to-br from-orange-400 to-amber-500 shadow-md shadow-orange-400/30 text-white":"bg-white/60 dark:bg-zinc-700/50 border-2 border-dashed border-zinc-300 dark:border-zinc-600 text-zinc-400 dark:text-zinc-500"}\n    `,children:t?"🍕":s}),ee=({open:s,onClose:r,stampsRequired:a=10,onAuthSuccess:i})=>{const{t:l}=n(),[c,o]=t.useState(!1),[m,x]=t.useState(null),[u,p]=t.useState(!1),h=C(0),b=F(h,[0,300],[1,0]);t.useEffect(()=>{if(s){const e=_();x(e)}},[s]);const g=(e=!1)=>{e&&localStorage.setItem("loyalty_prompt_dismissed","true"),localStorage.removeItem("show_loyalty_signup_prompt"),r()},f=m?.totalPending||1,j=m?.eligibleItems||0,v=m?.signupBonus??1,N=m?.stampsRequired||a,y=Math.min(f/N*100,100),k=Array.from({length:N},(e,t)=>({index:t+1,filled:t<f}));return e.jsx(I,{children:s&&e.jsxs(e.Fragment,{children:[e.jsx(D.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},style:{opacity:b},onClick:()=>g(!1),className:"fixed inset-0 bg-black/80 backdrop-blur-md z-50"}),e.jsx(D.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:28,stiffness:350},style:{y:h},drag:"y",dragConstraints:{top:0},dragElastic:.2,onDragEnd:(e,t)=>{(t.offset.y>100||t.velocity.y>500)&&g(!1)},className:"fixed bottom-0 left-0 right-0 z-50 touch-none",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-900 rounded-t-[2rem] shadow-[0_-10px_60px_rgba(0,0,0,0.3)] overflow-hidden",children:[e.jsx("div",{className:"flex justify-center pt-3 pb-1 cursor-grab active:cursor-grabbing",children:e.jsx("div",{className:"w-10 h-1.5 rounded-full bg-zinc-300 dark:bg-zinc-700"})}),e.jsx("button",{onClick:()=>g(!1),className:"absolute top-4 right-4 p-1.5 rounded-full bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700 z-10 transition-colors",children:e.jsx(O,{className:"w-4 h-4 text-zinc-500"})}),e.jsxs("div",{className:"px-5 pb-6 pt-2",children:[e.jsxs(D.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"text-center mb-5",children:[e.jsx("div",{className:"text-5xl mb-3",children:"🍕"}),e.jsx("h2",{className:"text-2xl font-extrabold tracking-tight text-zinc-900 dark:text-white mb-1.5",children:f>1?l("earnedMultipleStamps",{count:f}):l("earnedOneStamp")}),e.jsx("p",{className:"text-sm text-zinc-500 dark:text-zinc-400 leading-relaxed max-w-[280px] mx-auto",children:l("signUpToClaimStamps",{total:f})})]}),e.jsxs(D.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:.2},className:"relative bg-gradient-to-br from-orange-50 via-amber-50/50 to-orange-50 dark:from-zinc-800/80 dark:via-zinc-800/50 dark:to-zinc-800/80 rounded-2xl p-4 mb-4 border border-orange-100 dark:border-zinc-700/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-orange-600/80 dark:text-orange-400/80",children:l("loyaltyCard")}),e.jsxs("span",{className:"text-xs font-mono font-bold text-zinc-400 dark:text-zinc-500",children:[f,"/",N]})]}),e.jsx("div",{className:"grid grid-cols-5 gap-2 mb-3",children:k.map(t=>e.jsx(Q,{filled:t.filled,index:t.index,delay:t.filled?.3+.08*t.index:0},t.index))}),e.jsx("div",{className:"h-1.5 bg-zinc-200/80 dark:bg-zinc-700 rounded-full overflow-hidden",children:e.jsx(D.div,{initial:{width:0},animate:{width:`${y}%`},transition:{delay:.5,duration:.8,ease:"easeOut"},className:"h-full bg-gradient-to-r from-orange-400 to-amber-500 rounded-full"})}),e.jsxs("div",{className:"flex items-center justify-between mt-2",children:[e.jsx("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 font-medium",children:l("stampsToReward",{needed:N-f,total:N})}),e.jsx("span",{className:"text-xs",children:"🎁"})]})]}),e.jsxs(D.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.35},className:"flex flex-wrap gap-2 mb-5 justify-center",children:[j>0&&e.jsxs("div",{className:"inline-flex items-center gap-1.5 bg-zinc-100 dark:bg-zinc-800 rounded-full px-3 py-1.5 text-xs font-medium text-zinc-700 dark:text-zinc-300",children:[e.jsx("span",{children:"🍕"}),l("stampsFromOrder",{count:j})]}),v>0&&e.jsxs("div",{className:"inline-flex items-center gap-1.5 bg-orange-100 dark:bg-orange-900/30 rounded-full px-3 py-1.5 text-xs font-bold text-orange-700 dark:text-orange-300",children:[e.jsx("span",{children:"🎁"}),l("signupBonusStamp",{count:v})]})]}),e.jsx(D.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.45},children:e.jsx(z,{open:c,onOpenChange:o,onSuccess:async e=>{if(o(!1),localStorage.removeItem("show_loyalty_signup_prompt"),m&&e?.id){p(!0);try{(await S({restaurantId:m.restaurantId,customerId:e.id,orderId:m.orderId,signupBonus:m.signupBonus||1})).success}catch(t){}p(!1)}i?.(),r()},trigger:e.jsxs(d,{disabled:u,className:"w-full h-14 text-base font-bold text-white bg-gradient-to-r from-orange-500 via-amber-500 to-orange-500 hover:from-orange-600 hover:via-amber-600 hover:to-orange-600 shadow-xl shadow-orange-500/25 rounded-2xl group transition-all active:scale-[0.98]",children:[e.jsx(T,{className:"w-5 h-5 mr-2"}),u?l("claimingStamps"):l("signUpClaimStamps",{count:f}),e.jsx(A,{className:"w-4 h-4 ml-1 opacity-60 group-hover:translate-x-0.5 transition-transform"})]})})}),e.jsx(D.button,{initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.6},onClick:()=>g(!0),className:"w-full py-3 mt-2 text-xs text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-400 transition-colors",children:l("dontShowAgain")})]})]})})]})})};let te=!1;const se=({restaurant:t,deliveryAddress:s})=>{const{isLoaded:a}=j(),[i,n]=r.useState(null),[d,l]=r.useState(null),[c,o]=r.useState(null),[m,x]=r.useState(null),[u,p]=r.useState(null),[h,b]=r.useState(null),g=r.useCallback(e=>{b(e)},[]),f=r.useCallback(()=>{b(null),o(null),x(null)},[]);r.useEffect(()=>()=>{o(null),x(null),p(null)},[]),r.useEffect(()=>{if(!h||!i||!d)return;const e=new window.google.maps.LatLngBounds;e.extend(d),e.extend(i),h.fitBounds(e,{top:60,right:60,bottom:60,left:60})},[h,i,d]),r.useEffect(()=>{if(a)if(t?.latitude&&t?.longitude)l({lat:parseFloat(t.latitude),lng:parseFloat(t.longitude)});else if(t?.address){(new window.google.maps.Geocoder).geocode({address:t.address},(e,t)=>{"OK"===t&&e[0]&&l(e[0].geometry.location.toJSON())})}},[t,a]),r.useEffect(()=>{if(!a||!s)return;(new window.google.maps.Geocoder).geocode({address:s},(e,t)=>{"OK"===t&&e[0]&&n(e[0].geometry.location.toJSON())})},[s,a]);const N=r.useRef(null);return r.useEffect(()=>{if(!a||!i||!d)return;const e=`${d.lat},${d.lng}|${i.lat},${i.lng}`;if(N.current===e)return;N.current=e;const t=()=>{(new window.google.maps.DirectionsService).route({origin:d,destination:i,travelMode:window.google.maps.TravelMode.DRIVING},(t,s)=>{"OK"===s&&N.current===e&&(o(t),t.routes[0]&&t.routes[0].legs[0]&&p(t.routes[0].legs[0].distance.text))})};te||"function"!=typeof window.google?.maps?.importLibrary?t():(async()=>{try{const{Route:t}=await window.google.maps.importLibrary("routes"),{routes:s}=await t.computeRoutes({origin:d,destination:i,travelMode:"DRIVING",fields:["distanceMeters","path"]}),r=s&&s[0];if(!r||!Array.isArray(r.path)||0===r.path.length)throw new Error("NO_ROUTES");if(N.current!==e)return;x(r.path),Number.isFinite(r.distanceMeters)&&p(`${(r.distanceMeters/1e3).toLocaleString("fi-FI",{minimumFractionDigits:1,maximumFractionDigits:1})} km`)}catch{te=!0,N.current===e&&(x(null),t())}})()},[i,d,a]),a&&d?e.jsxs("div",{className:"relative w-full h-full bg-white dark:bg-zinc-900",children:[e.jsxs(v,{center:d,zoom:15,onLoad:g,onUnmount:f,children:[e.jsx(Y,{position:d,icon:{path:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z",fillColor:"#FF6B35",fillOpacity:1,strokeWeight:1,strokeColor:"#FFFFFF",scale:2,anchor:new window.google.maps.Point(12,22)}}),i&&e.jsx(Y,{position:i,icon:{path:window.google.maps.SymbolPath.CIRCLE,scale:6,fillColor:"#ffffff",fillOpacity:1,strokeColor:"#FF6B35",strokeWeight:3}}),m?e.jsx(Z,{path:m,options:{strokeColor:"#FF6B35",strokeOpacity:.8,strokeWeight:5}}):c&&e.jsx(X,{directions:c,options:{suppressMarkers:!0,polylineOptions:{strokeColor:"#FF6B35",strokeOpacity:.8,strokeWeight:5}}})]}),u&&e.jsxs("div",{className:"absolute top-1/2 right-8 -translate-y-1/2 z-20 bg-zinc-800/90 backdrop-blur-md px-4 py-2 rounded-full flex items-center gap-2 border border-zinc-700 shadow-xl animate-in fade-in slide-in-from-right-4 duration-700",children:[e.jsx(R,{className:"w-5 h-5 text-[#FF6B35]"}),e.jsx("span",{className:"text-base font-bold text-white",children:u})]})]}):null},re=({orderStatus:t,estimatedTime:s})=>{const{t:a}=n(),[i,d]=r.useState(""),[l,c]=r.useState(!1),[o,m]=r.useState(100);let x=a("estimatedArrival").replace("{time}",s);return"pending"===t?x=a("waitingForConfirmation"):"completed"===t?x=a("enjoyYourMeal"):"ready_for_pickup"===t&&(x=a("readyForPickup")),r.useEffect(()=>{let e;return e=setTimeout(()=>{const e=i;l?""===e?(c(!1),m(100)):(d(e.substring(0,e.length-1)),m(60)):!x.startsWith(e)&&e.length>0?c(!0):e!==x&&(d(x.substring(0,e.length+1)),m(35+60*Math.random()))},o),()=>clearTimeout(e)},[i,l,x,o]),e.jsxs("span",{className:"font-mono text-[#FF6B35] text-sm drop-shadow-[0_0_3px_rgba(255,107,53,0.5)] tracking-wider",children:[i,e.jsx("span",{className:"ml-1 inline-block w-[2px] h-4 bg-[#FF6B35] align-middle animate-[blink_1s_step-end_infinite] shadow-[0_0_5px_rgba(255,107,53,0.8)]"}),e.jsx("style",{children:"\n        @keyframes blink {\n          0%, 100% { opacity: 1; }\n          50% { opacity: 0; }\n        }\n      "})]})},ae=(e,t)=>{const s=e?.payment_method,r=e?.card_last4?`${(e.card_brand||"card").charAt(0).toUpperCase()+(e.card_brand||"card").slice(1)} •••• ${e.card_last4}`:null;switch(s){case"online":case"card":case"mobilepay":case"pivo":case"siirto":return{label:r||t("paidOnline"),icon:W,isPaid:!0,cardInfo:r};case"cash":case"cash_at_door":return{label:t("cashOnDelivery"),icon:K,isPaid:!1,cardInfo:null};case"card_at_door":case"card at door":return{label:t("cardOnDelivery"),icon:W,isPaid:!1,cardInfo:null};case"smartum":case"edenred":case"epassi":case"lounasseteli":return{label:s.charAt(0).toUpperCase()+s.slice(1),icon:W,isPaid:!1,cardInfo:null};default:return{label:t("paymentMethod"),icon:W,isPaid:!1,cardInfo:null}}},ie=({order:t,t:s})=>{const a=r.useMemo(()=>J(t?.customer_phone),[t?.customer_phone]);if(!t||"cancelled"===t.status||"ok"===a.level)return null;const i=t.restaurants?.contact_phone;return e.jsxs("div",{role:"alert",className:"rounded-2xl border border-amber-300 bg-amber-50 dark:bg-amber-900/20 dark:border-amber-700 p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(V,{className:"w-5 h-5 text-amber-600 dar
1k:text-amber-400 shrink-0 mt-0.5"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-bold text-sm text-amber-900 dark:text-amber-100",children:s("orderContactIssueTitle")}),e.jsx("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:s("orderContactIssueBody")})]})]}),i&&e.jsxs("a",{href:`tel:${i.replace(/\s+/g,"")}`,className:"inline-flex items-center gap-2 rounded-full bg-amber-600 px-4 py-2 text-sm font-bold text-white hover:bg-amber-700 transition-colors",children:[e.jsx(H,{className:"w-4 h-4"}),s("callRestaurant"),": ",i]})]})},ne=({order:t,loading:l,accessDenied:c,showCancelDialog:m,setShowCancelDialog:j,isReordering:v,restaurantAddress:N,handleReorder:y,calculateItemTotal:_,getEstimatedDeliveryTime:S})=>{const C=s(),F=i();a();const{t:I}=n(),{permission:D,requestPermission:O}=x(),{user:A}=o(),[R,W]=r.useState(!1),[K,V]=r.useState(!1),[H,J]=r.useState(0),[Y,Z]=r.useState(!1);r.useEffect(()=>{const e=/iPhone|iPad|iPod/i.test(navigator.userAgent);if(Z(e),!A)try{const e=localStorage.getItem("pending_loyalty_stamps");if(e){const t=JSON.parse(e);J(t.totalPending||0)}}catch(t){}},[A]),r.useEffect(()=>{if(A)return;if("true"===localStorage.getItem("loyalty_prompt_dismissed"))return;const e=()=>"true"===localStorage.getItem("show_loyalty_signup_prompt");if(e()){const e=setTimeout(()=>V(!0),1500);return()=>clearTimeout(e)}let t=0;const s=setInterval(()=>{t++,e()?(clearInterval(s),setTimeout(()=>V(!0),500)):t>=10&&clearInterval(s)},500);return()=>clearInterval(s)},[A]);const X=()=>{if("my-orders"===F.state?.from)return void C(-1);const e=t?.restaurants?.secret_url||localStorage.getItem("current_restaurant_secret_url");C(e?`/menu/${e}`:"/")};return l?e.jsxs("div",{className:"min-h-screen bg-white dark:bg-zinc-950 flex items-center justify-center",children:[e.jsx(u,{children:e.jsx("title",{children:I("loadingOrder")})}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),e.jsx("p",{className:"mt-4 text-zinc-500 dark:text-zinc-400",children:I("loadingOrderDetails")})]})]}):!t&&c?e.jsxs("div",{className:"min-h-screen bg-white dark:bg-zinc-950 flex items-center justify-center px-6",children:[e.jsx(u,{children:e.jsx("title",{children:I("orderNotVisibleTitle")})}),e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx(E,{className:"h-16 w-16 text-zinc-400 mx-auto mb-4"}),e.jsx("h2",{className:"text-2xl font-bold mb-2 text-zinc-900 dark:text-white",children:I("orderNotVisibleTitle")}),e.jsx("p",{className:"text-zinc-500 dark:text-zinc-400 mb-4",children:I("orderNotVisibleMessage")}),e.jsx(d,{onClick:()=>{const e=localStorage.getItem("current_restaurant_secret_url");C(e?`/menu/${e}`:"/")},children:I("returnToHome")})]})]}):t?e.jsxs("div",{className:"min-h-screen bg-white dark:bg-zinc-950 text-zinc-900 dark:text-zinc-100 relative",children:[e.jsx(u,{children:e.jsx("title",{children:`Order #${t?.short_id||t?.id?.slice(0,8)||""}`})}),e.jsxs("div",{className:"lg:hidden",children:[t&&"cancelled"!==t.status&&e.jsxs("div",{className:"fixed top-0 left-0 right-0 h-[45vh] z-0",children:[e.jsx(se,{restaurant:t.restaurants,deliveryAddress:t.delivery_address}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-24 bg-gradient-to-b from-black/60 to-transparent pointer-events-none"})]}),e.jsx("div",{className:"fixed top-0 left-0 right-0 z-50 p-4 pointer-events-none",children:e.jsxs("div",{className:"flex items-center justify-between pointer-events-auto",children:[e.jsx(d,{variant:"ghost",size:"icon",onClick:X,className:"backdrop-blur-md rounded-full w-10 h-10 border transition-colors "+("cancelled"===t.status?"bg-white/80 dark:bg-black/20 text-zinc-900 dark:text-white border-zinc-200 dark:border-white/10 hover:bg-zinc-100 dark:hover:bg-black/40":"bg-black/20 text-white hover:bg-black/40 border-white/10"),children:e.jsx(M,{className:"h-5 w-5"})}),e.jsx("div",{className:"backdrop-blur-md px-3 py-1.5 rounded-full border "+("cancelled"===t.status?"bg-white/80 dark:bg-black/20 border-zinc-200 dark:border-white/10":"bg-black/20 border-white/10"),children:e.jsxs("span",{className:"font-mono font-bold text-xs tracking-wider "+("cancelled"===t.status?"text-zinc-900 dark:text-white":"text-white"),children:["#",t?.short_id||t?.id?.slice(0,6).toUpperCase()]})})]})}),e.jsxs("div",{className:`relative z-10 ${"cancelled"===t.status?"mt-24":"mt-[40vh]"} bg-white dark:bg-zinc-950 rounded-t-[2rem] shadow-[0_-10px_40px_rgba(0,0,0,0.1)] dark:shadow-[0_-10px_40px_rgba(0,0,0,0.5)] min-h-[60vh] pb-24 transition-all duration-500`,children:[e.jsx("div",{className:"w-12 h-1.5 bg-zinc-200 dark:bg-zinc-800 rounded-full mx-auto mt-3 mb-6"}),e.jsxs("div",{className:"px-6 space-y-8",children:[e.jsx(ie,{order:t,t:I}),e.jsx("div",{className:"text-center space-y-2",children:"cancelled"===t.status?e.jsxs("div",{className:"bg-red-50 dark:bg-red-500/10 border border-red-200 dark:border-red-500/20 rounded-2xl p-6 mb-6",children:[e.jsx($,{className:"w-12 h-12 text-red-500 mx-auto mb-3"}),e.jsx("h1",{className:"text-2xl font-bold text-red-600 dark:text-red-500 tracking-tight mb-2",children:I("orderCancelled")}),e.jsx("p",{className:"text-zinc-600 dark:text-zinc-400 text-sm mb-4",children:I("orderCancelledByRestaurant")}),t.cancellation_reason&&e.jsxs("div",{className:"bg-white dark:bg-zinc-900/50 rounded-lg p-3 text-left border border-red-100 dark:border-red-500/10",children:[e.jsxs("p",{className:"text-xs text-zinc-500 uppercase font-bold mb-1",children:[I("cancelReason"),":"]}),e.jsx("p",{className:"text-sm text-zinc-800 dark:text-zinc-200",children:t.cancellation_reason})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-2xl font-bold text-zinc-900 dark:text-white tracking-tight",children:"completed"===t.status?I("orderDelivered"):"out_for_delivery"===t.status?I("orderOnTheWay"):"preparing"===t.status?I("preparingYourFood"):I("orderReceived")}),e.jsx("div",{className:"min-h-[24px] flex items-center",children:e.jsx(re,{orderStatus:t.status,estimatedTime:S()})})]})}),"cancelled"!==t.status&&e.jsx(k,{currentStatus:t.status,orderType:t.order_type}),"granted"!==D&&"completed"!==t.status&&"cancelled"!==t.status&&e.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-100 dar
1k:bg-blue-900/40 flex items-center justify-center text-blue-600 dark:text-blue-400 shrink-0",children:e.jsx(P,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-sm font-bold text-zinc-900 dark:text-zinc-100 mb-1",children:I("getOrderUpdates")}),e.jsx("p",{className:"text-xs text-zinc-500 dark:text-zinc-400 mb-3 leading-relaxed",children:I("enableNotificationsDesc")}),e.jsx(d,{onClick:O,size:"sm",className:"w-full bg-blue-600 hover:bg-blue-700 text-white h-9 text-xs font-semibold",children:I("denied"===D?"notificationsBlocked":"enableNotifications")}),Y&&"default"===D&&e.jsx("p",{className:"text-[10px] text-zinc-400 mt-2 text-center italic",children:I("iosNotificationNote")})]})]})}),!A&&"cancelled"!==t.status&&e.jsxs("div",{className:"bg-gradient-to-br from-green-50 to-green-100 dark:from-green-900/10 dark:to-green-900/20 border border-green-200 dark:border-green-800 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-green-200 dark:bg-green-900 flex items-center justify-center text-green-700 dark:text-green-400 shrink-0",children:e.jsx(T,{className:"w-5 h-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-sm font-bold text-foreground mb-1",children:I(H>0?"saveDetailsAndStamps":"saveDetails")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3 leading-relaxed",children:H>0?I("saveDetailsStampsDesc",{count:H}):I("saveDetailsDesc")}),e.jsx(d,{size:"sm",onClick:()=>W(!0),className:"w-full sm:w-auto bg-green-600 hover:bg-green-700 text-white",children:I("saveInfoCreateAccount")})]})]}),e.jsx(z,{open:R,onOpenChange:W})]}),"pickup"===t.order_type&&e.jsx("div",{className:"mb-4",children:e.jsxs(d,{className:"w-full h-12 gap-2 bg-primary hover:bg-primary/90 text-primary-foreground font-bold rounded-xl shadow-lg shadow-primary/20",onClick:()=>{const{latitude:e,longitude:s}=t.restaurants||{};let r="";e&&s?r=`https://www.google.com/maps/dir/?api=1&destination=${e},${s}`:N&&(r=`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(N)}`),r&&window.open(r,"_blank")},children:[e.jsx(B,{className:"h-5 w-5"}),I("takeMeThere")]})}),e.jsx("div",{className:"mb-4",children:e.jsx(w,{className:"w-full"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 dark:text-zinc-400 pb-2 border-b border-zinc-100 dark:border-zinc-900",children:[e.jsx(q,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",children:I("orderSummary")})]}),t.order_items?.map(t=>{const s=_(t);return e.jsxs("div",{className:"flex justify-between items-start py-2",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"bg-zinc-100 dark:bg-zinc-900 w-6 h-6 rounded flex items-center justify-center text-xs font-bold text-zinc-500 dark:text-zinc-400 flex-shrink-0",children:[t.quantity,"x"]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-zinc-800 dark:text-zinc-200 leading-tight",children:t.product_name}),t.selected_options&&Object.values(t.selected_options).map((t,s)=>t.options&&Object.values(t.options).length>0&&e.jsx("p",{className:"text-[10px] text-zinc-500 mt-0.5",children:Object.values(t.options).map(e=>`${e.name}${Number(e.price)>0?` (+€${Number(e.price).toFixed(2)})`:""}`).join(", ")},s))]})]}),e.jsxs("span",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-300",children:["€",(s*t.quantity).toFixed(2)]})]},t.id)}),e.jsxs("div",{className:"pt-4 mt-4 border-t border-zinc-100 dark:border-zinc-900 space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm text-zinc-500 dark:text-zinc-400",children:[e.jsx("span",{children:I("subtotal")}),e.jsxs("span",{children:["€",t.subtotal?.toFixed(2)||(t.total_amount-(t.delivery_fee||0)).toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between text-sm text-zinc-500 dark:text-zinc-400",children:[e.jsx("span",{children:I("deliveryFee")}),e.jsxs("span",{children:["€",t.delivery_fee?.toFixed(2)||"0.00"]})]}),e.jsxs("div",{className:"flex justify-between items-center pt-2 text-zinc-900 dark:text-white",children:[e.jsx("span",{className:"font-bold",children:I("total")}),e.jsxs("div",{className:"text-right",children:[e.jsxs("span",{className:"font-bold text-xl block",children:["€",t.total_amount?.toFixed(2)||t.total_price?.toFixed(2)]}),e.jsxs("span",{className:"text-[10px] text-zinc-500 font-normal",children:[I("vatIncluded")," (Sis. ALV)"]})]})]}),t.payment_method&&(()=>{const s=ae(t,I),r=s.icon;return e.jsxs("div",{className:"flex justify-between items-center pt-3 mt-2 border-t border-dashed border-zinc-200 dark:border-zinc-800",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-500 dark:text-zinc-400",children:[e.jsx(r,{className:"h-4 w-4"}),e.jsx("span",{children:s.label})]}),s.isPaid&&"paid"===t.payment_status&&e.jsxs("span",{className:"text-xs font-semibold text-green-600 dark:text-green-400",children:["✓ ",I("paid")]})]})})()]})]}),e.jsxs("div",{className:"bg-zinc-50 dark:bg-zinc-900/50 rounded-xl p-4 space-y-3 border border-zinc-100 dark:border-zinc-900",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(E,{className:"h-5 w-5 text-zinc-500 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs font-bold text-zinc-500 uppercase tracking-wider mb-0.5",children:I("restaurant")}),e.jsx("p",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-300",children:t.restaurants?.name})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(L,{className:"h-5 w-5 text-zinc-500 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs font-bold text-zinc-500 uppercase tracking-wider mb-0.5",children:I("orderTime")}),e.jsx("p",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:new Date(t.created_at).toLocaleStr
1ing(void 0,{dateStyle:"medium",timeStyle:"short"})})]})]})]}),e.jsxs("div",{className:"bg-zinc-50 dark:bg-zinc-900/50 rounded-xl p-4 space-y-4 border border-zinc-100 dark:border-zinc-900",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(G,{className:"h-5 w-5 text-zinc-500 mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs font-bold text-zinc-500 uppercase tracking-wider mb-1",children:"pickup"===t.order_type?I("pickupAddress"):I("deliveryAddress")}),e.jsx("p",{className:"text-sm text-zinc-700 dark:text-zinc-300 leading-relaxed",children:"pickup"===t.order_type?N||I("loadingAddress"):t.delivery_address})]})]}),t.address_notes&&"pickup"!==t.order_type&&e.jsx("div",{className:"pl-8",children:e.jsxs("p",{className:"text-xs text-zinc-500 bg-zinc-100 dark:bg-zinc-900 p-2 rounded",children:[I("note"),": ",t.address_notes]})})]})]})]}),("completed"===t.status||"cancelled"===t.status)&&e.jsx("div",{className:"fixed bottom-0 left-0 right-0 p-4 bg-white dark:bg-zinc-950 border-t border-zinc-100 dark:border-zinc-900 z-40 safe-area-bottom",children:e.jsx("div",{className:"container mx-auto max-w-md",children:e.jsx(d,{onClick:y,disabled:v,className:"w-full bg-primary hover:bg-primary/90 text-primary-foreground h-12 text-base font-bold rounded-xl",children:v?e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"h-4 w-4 mr-2"}),I("reorder")]})})})})]}),e.jsxs("div",{className:"hidden lg:grid lg:grid-cols-[1fr_480px] lg:min-h-screen",children:[e.jsxs("div",{className:"relative lg:sticky lg:top-0 lg:h-screen",children:[t&&"cancelled"!==t.status?e.jsx(se,{restaurant:t.restaurants,deliveryAddress:t.delivery_address}):e.jsx("div",{className:"h-full bg-zinc-100 dark:bg-zinc-900 flex items-center justify-center",children:e.jsx($,{className:"w-16 h-16 text-zinc-300 dark:text-zinc-700"})}),e.jsx("div",{className:"absolute top-4 left-4 z-50",children:e.jsx(d,{variant:"ghost",size:"icon",onClick:X,className:"backdrop-blur-md rounded-full w-10 h-10 border bg-black/20 text-white hover:bg-black/40 border-white/10",children:e.jsx(M,{className:"h-5 w-5"})})})]}),e.jsxs("div",{className:"overflow-y-auto bg-white dark:bg-zinc-950 px-6 py-8 space-y-8 pb-24",children:[e.jsx(ie,{order:t,t:I}),e.jsx("div",{className:"text-center space-y-2",children:"cancelled"===t.status?e.jsxs("div",{className:"bg-red-50 dark:bg-red-500/10 border border-red-200 dark:border-red-500/20 rounded-2xl p-6 mb-6",children:[e.jsx($,{className:"w-12 h-12 text-red-500 mx-auto mb-3"}),e.jsx("h1",{className:"text-2xl font-bold text-red-600 dark:text-red-500 tracking-tight mb-2",children:I("orderCancelled")}),e.jsx("p",{className:"text-zinc-600 dark:text-zinc-400 text-sm mb-4",children:I("orderCancelledByRestaurant")}),t.cancellation_reason&&e.jsxs("div",{className:"bg-white dark:bg-zinc-900/50 rounded-lg p-3 text-left border border-red-100 dark:border-red-500/10",children:[e.jsxs("p",{className:"text-xs text-zinc-500 uppercase font-bold mb-1",children:[I("cancelReason"),":"]}),e.jsx("p",{className:"text-sm text-zinc-800 dark:text-zinc-200",children:t.cancellation_reason})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"font-mono font-bold text-xs tracking-wider text-zinc-500 dark:text-zinc-400",children:["#",t?.short_id||t?.id?.slice(0,6).toUpperCase()]}),e.jsx("h1",{className:"text-2xl font-bold text-zinc-900 dark:text-white tracking-tight",children:"completed"===t.status?I("orderDelivered"):"out_for_delivery"===t.status?I("orderOnTheWay"):"preparing"===t.status?I("preparingYourFood"):I("orderReceived")}),e.jsx("div",{className:"min-h-[24px] flex items-center justify-center",children:e.jsx(re,{orderStatus:t.status,estimatedTime:S()})})]})}),"cancelled"!==t.status&&e.jsx(k,{currentStatus:t.status,orderType:t.order_type}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 dark:text-zinc-400 pb-2 border-b border-zinc-100 dark:border-zinc-900",children:[e.jsx(q,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",children:I("orderSummary")}
1)]}),t.order_items?.map(t=>{const s=_(t);return e.jsxs("div",{className:"flex justify-between items-start py-2",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"bg-zinc-100 dark:bg-zinc-900 w-6 h-6 rounded flex items-center justify-center text-xs font-bold text-zinc-500 dark:text-zinc-400 flex-shrink-0",children:[t.quantity,"x"]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-zinc-800 dark:text-zinc-200 leading-tight",children:t.product_name}),t.selected_options&&Object.values(t.selected_options).map((t,s)=>t.options&&Object.values(t.options).length>0&&e.jsx("p",{className:"text-[10px] text-zinc-500 mt-0.5",children:Object.values(t.options).map(e=>`${e.name}${Number(e.price)>0?` (+€${Number(e.price).toFixed(2)})`:""}`).join(", ")},s))]})]}),e.jsxs("span",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-300",children:["€",(s*t.quantity).toFixed(2)]})]},t.id)}),e.jsxs("div",{className:"pt-4 mt-4 border-t border-zinc-100 dark:border-zinc-900 space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm text-zinc-500 dark:text-zinc-400",children:[e.jsx("span",{children:I("subtotal")}),e.jsxs("span",{children:["€",t.subtotal?.toFixed(2)||(t.total_amount-(t.delivery_fee||0)).toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between text-sm text-zinc-500 dark:text-zinc-400",children:[e.jsx("span",{children:I("deliveryFee")}),e.jsxs("span",{children:["€",t.delivery_fee?.toFixed(2)||"0.00"]})]}),e.jsxs("div",{className:"flex justify-between items-center pt-2 text-zinc-900 dark:text-white",children:[e.jsx("span",{className:"font-bold",children:I("total")}),e.jsxs("div",{className:"text-right",children:[e.jsxs("span",{className:"font-bold text-xl block",children:["€",t.total_amount?.toFixed(2)||t.total_price?.toFixed(2)]}),e.jsxs("span",{className:"text-[10px] text-zinc-500 font-normal",children:[I("vatIncluded")," (Sis. ALV)"]})]})]}),t.payment_method&&(()=>{const s=ae(t,I),r=s.icon;return e.jsxs("div",{className:"flex justify-between items-center pt-3 mt-2 border-t border-dashed border-zinc-200 dark:border-zinc-800",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-500 dark:text-zinc-400",children:[e.jsx(r,{className:"h-4 w-4"}),e.jsx("span",{children:s.label})]}),s.isPaid&&"paid"===t.payment_status&&e.jsxs("span",{className:"text-xs font-semibold text-green-600 dark:text-green-400",children:["✓ ",I("paid")]})]})})()]})]}),e.jsxs("div",{className:"bg-zinc-50 dark:bg-zinc-900/50 rounded-xl p-4 space-y-3 border border-zinc-100 dark:border-zinc-900",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(E,{className:"h-5 w-5 text-zinc-500 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs font-bold text-zinc-500 uppercase tracking-wider mb-0.5",children:I("restaurant")}),e.jsx("p",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-300",children:t.restaurants?.name})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(L,{className:"h-5 w-5 text-zinc-500 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs font-bold text-zinc-500 uppercase tracking-wider mb-0.5",children:I("orderTime")}),e.jsx("p",{className:"text-sm text-zinc-700 dark:text-zinc-300",children:new Date(t.created_at).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})})]})]})]}),e.jsxs("div",{className:"bg-zinc-50 dark:bg-zinc-900/50 rounded-xl p-4 space-y-4 border border-zinc-100 dark:border-zinc-900",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(G,{className:"h-5 w-5 text-zinc-500 mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs font-bold text-zinc-500 uppercase tracking-wider mb-1",children:"pickup"===t.order_type?I("pickupAddress"):I("deliveryAddress")}),e.jsx("p",{className:"text-sm text-zinc-700 dark:text-zinc-300 leading-relaxed",children:"pickup"===t.order_type?N||I("loadingAddress"):t.delivery_address})]})]}),t.address_notes&&"pickup"!==t.order_type&&e.jsx("div",{className:"pl-8",children:e.jsxs("p",{className:"text-xs text-zinc-500 bg-zinc-100 dark:bg-zinc-900 p-2 rounded",children:[I("note"),": ",t.address_notes]})})]}),("completed"===t.status||"cancelled"===t.status)&&e.jsx(d,{onClick:y,disabled:v,className:"w-full bg-primary hover:bg-primary/90 text-primary-foreground h-12 text-base font-bold rounded-xl",children:v?e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"h-4 w-4 mr-2"}),I("reorder")]})})]})]}),e.jsx(p,{open:m,onOpenChange:j,children:e.jsxs(h,{children:[e.jsxs(b,{children:[e.jsxs(g,{className:"flex items-center gap-2 text-destructive",children:[e.jsx($,{className:"h-6 w-6"}),I("orderCancelled")]}),e.jsx(f,{children:I("orderCancelledRefund")})]}),e.jsx(d,{onClick:()=>j(!1),className:"w-full",children:"OK"})]})}),e.jsx(ee,{open:K,onClose:()=>V(!1),stampsRequired:t?.restaurants?.loyalty_stamps_required||10})]}):e.jsxs("div",{className:"min-h-screen bg-white dark:bg-zinc-950 flex items-center justify-center",children:[e.jsx(u,{children:e.jsx("title",{children:I("orderNotFound")})}),e.jsxs("div",{className:"text-center",children:[e.jsx($,{className:"h-16 w-16 text-destructive mx-auto mb-4"}),e.jsx("h2",{className:"text-2xl font-bold mb-2 text-zinc-900 dark:text-white",children:I("orderNotFound")}),e.jsx("p",{className:"text-zinc-500 dark:text-zinc-400 mb-4",children:I("orderNotFoundMessage")}),e.jsx(d,{onClick:()=>{const e=localStorage.getItem("current_restaurant_secret_url");C(e?`/menu/${e}`:"/")},children:I("returnToHome")})]})]})},de=()=>{const{orderId:t}=a(),{order:i,loading:n,accessDenied:d,showCancelDialog:x,setShowCancelDialog:u,isReordering:p,restaurantAddress:h,handleReorder:b,calculateItemTotal:g,getEstimatedDeliveryTime:f}=(e=>{const{toast:t}=l(),{addToCart:a}=c(),{user:i}=o(),n=s(),d=r.useRef(null),x=r.useRef(null),[u,p]=r.useState(null),[h,b]=r.useState(!0),[g,f]=r.useState(!1),[v,N]=r.useState(!1),[y,k]=r.useState(!1),[w,z]=r.useState(""),{isLoaded:_}=j(),S=r.useCallback(async()=>
1{if(e)try{const{data:t,error:s}=await m.from("orders").select("*, order_items(*, menu_items(image_url)), restaurants(name, latitude, longitude, secret_url)").eq("id",e).single();if(s){if("PGRST116"===s.code)return f(!0),void p(null);throw s}if(t){f(!1),p(t);const e=`order_cancelled_seen_${t.id}`,s=localStorage.getItem(e);"cancelled"!==t.status||s||(N(!0),localStorage.setItem(e,"true"))}}catch(s){t({title:"Error",description:"Order details could not be loaded.",variant:"destructive"})}finally{b(!1)}},[e,t]);return r.useEffect(()=>{e&&S()},[e,S]),r.useEffect(()=>{if(e){if(i){const t=m.channel(`order-${e}`).on("postgres_changes",{event:"*",schema:"public",table:"orders",filter:`id=eq.${e}`},()=>{S()}).subscribe();return x.current=t,()=>{m.removeChannel(t),x.current=null}}return d.current=setInterval(()=>{S()},5e3),()=>{d.current&&(clearInterval(d.current),d.current=null)}}},[e,S,i]),r.useEffect(()=>{(g||u&&["completed","cancelled"].includes(u.status))&&(x.current&&(m.removeChannel(x.current),x.current=null),d.current&&(clearInterval(d.current),d.current=null))},[u?.status,g]),r.useEffect(()=>{if(_&&u?.restaurants?.latitude&&u?.restaurants?.longitude&&!w){const e=new window.google.maps.Geocoder,t={lat:parseFloat(u.restaurants.latitude),lng:parseFloat(u.restaurants.longitude)};e.geocode({location:t},(e,t)=>{"OK"===t&&e[0]&&z(e[0].formatted_address)})}},[_,u,w]),{order:u,loading:h,accessDenied:g,showCancelDialog:v,setShowCancelDialog:N,isReordering:y,restaurantAddress:w,handleReorder:async()=>{if(u&&u.order_items){k(!0);try{const e=u.restaurant_id;let s=0,r=0;const i=u.order_items.map(e=>e.menu_item_id).filter(e=>e);let d=[];if(i.length>0){const{data:t,error:s}=await m.from("menu_items").select("id, name, description, price, image_url, is_active, restaurant_id").in("id",i).eq("restaurant_id",e).eq("is_active",!0);!s&&t&&(d=t)}const l=new Map(d.map(e=>[e.id,e]));for(const t of u.order_items){let i=null;if(t.menu_item_id&&l.has(t.menu_item_id)&&(i=l.get(t.menu_item_id)),!i&&t.product_name){const{data:s}=await m.from("menu_items").select("id, name, description, price, image_url, is_active, restaurant_id").eq("restaurant_id",e).eq("name",t.product_name).eq("is_active",!0).maybeSingle();s&&(i=s)}if(!i){r++;continue}const n={cartItemId:Date.now()+Math.random(),quantity:1,productId:i.id,productName:t.product_name||i.name,image_url:i.image_url,basePrice:i.price??t.price_at_time,restaurantId:e,selectedOptions:t.selected_options||t.options_selected||{},note:t.item_note||t.note||t.notes||"",productDescription:i.description,optionsDescription:"",allOptionGroups:[]};for(let e=0;e<(t.quantity||1);e++)a(n);s++}if(s>0){let a=`${s} items added to your cart.`;r>0&&(a+=` Some old items are no longer available in the menu (${r}).`),t({title:"✅ Added to Cart!",description:a}),k(!1),setTimeout(async()=>{try{let t=localStorage.getItem("current_restaurant_secret_url");if(!t&&e){const{data:s,error:r}=await m.from("restaurants").select("secret_url").eq("id",e).single();r||s?.secret_url&&(t=s.secret_url,localStorage.setItem("current_restaurant_secret_url",t))}n("/checkout")}catch(t){}},800)}else t({title:"Warning",description:"Items not found or no longer available.",variant:"destructive"}),k(!1)}catch(e){t({title:"Error",description:"An error occurred while re-adding the order.",variant:"destructive"}),k(!1)}}},calculateItemTotal:e=>{let t=e.base_price||0;return e.selected_options&&Object.values(e.selected_options).forEach(e=>{"object"==typeof e&&e.options&&Object.values(e.options).forEach(e=>{if(e){const s=void 0!==e.priceChange?e.priceChange:e.price||0;t+=Number(s)}})}),t},getEstimatedDeliveryTime:()=>{if(u&&u.delivery_time)return new Date(u.delivery_time).toLocaleTimeString("fi-FI",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:"Europe/Helsinki"});if(!u||!u.confirmed_at||!u.preparation_time_minutes)return"--:--";const e=new Date(u.confirmed_at).getTime(),t=60*u.preparation_time_minutes*1e3;return new Date(e+t).toLocaleTimeString("fi-FI",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:"Europe/Helsinki"})}}})(t),v=i?.restaurant_id||null;return e.jsxs(N,{restaurantId:v,children:[e.jsx(ne,{order:i,loading:n,accessDenied:d,showCancelDialog:x,setShowCancelDialog:u,isReordering:p,restaurantAddress:h,handleReorder:b,calculateItemTotal:g,getEstimatedDeliveryTime:f}),e.jsx(y,{})]})};export{de as default};

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.