"use strict";(()=>{var e={};e.id=6924,e.ids=[6924],e.modules={72934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},6005:e=>{e.exports=require("node:crypto")},52178:(e,t,s)=>{s.r(t),s.d(t,{originalPathname:()=>k,patchFetch:()=>m,requestAsyncStorage:()=>g,routeModule:()=>p,serverHooks:()=>h,staticGenerationAsyncStorage:()=>y});var n={};s.r(n),s.d(n,{GET:()=>l});var o=s(49303),r=s(88716),a=s(60670),i=s(87070),c=s(70446),u=s(90455),d=s(19191);async function l(e){let t=await (0,c.Gg)(),s=(0,u.LP)(t)||(0,u.I2)(),n=t.fcmToken||(0,u.I2)(),o=e.nextUrl.searchParams,r=o.get("businessId");if(!r)return i.NextResponse.json({error:"businessId is required"},{status:400});let a=t.user?.id??-1,l=o.get("lat")?parseFloat(o.get("lat")):t.storageLatitude||41.327546,p=o.get("lng")?parseFloat(o.get("lng")):t.storageLongitude||19.818698,g=`/mobile/v1/checkout_screen/tokens/${encodeURIComponent(n)}/businesses/${r}?customerId=${a}&latitude=${l}&longitude=${p}`;try{let e=(await (0,d.q)(g,{apiBase:"mobile",token:s,langCode:t.langCode||"al",cache:"no-store"})).data??{};return e.business?.discountList&&!e.discounts&&(e.discounts=e.business.discountList),e.business?.takeAwayPoints&&!e.takeAwayPoints&&(e.takeAwayPoints=e.business.takeAwayPoints),i.NextResponse.json({success:!0,data:e})}catch(e){return console.error("[checkout/screen] ERROR:",e),i.NextResponse.json({success:!1,error:"Failed to load checkout screen"},{status:500})}}let p=new o.AppRouteRouteModule({definition:{kind:r.x.APP_ROUTE,page:"/api/checkout/screen/route",pathname:"/api/checkout/screen",filename:"route",bundlePath:"app/api/checkout/screen/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/checkout/screen/route.ts",nextConfigOutput:"standalone",userland:n}),{requestAsyncStorage:g,staticGenerationAsyncStorage:y,serverHooks:h}=p,k="/api/checkout/screen/route";function m(){return(0,a.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:y})}},19191:(e,t,s)=>{s.d(t,{F:()=>a,q:()=>r});var n=s(47090),o=s(70446);async function r(e,t={}){let{apiBase:s="mobile",method:r="GET",body:a,token:i,langCode:c,notificationToken:u,headers:d={},revalidate:l,cache:p}=t,g=n.Y8[s],y=`${g}${e.startsWith("/")?e:"/"+e}`,h={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(h.Authorization=i),c&&(h.langCode=c);let k=u;if(!k)try{k=(await (0,o.Gg)()).fcmToken}catch{}k&&(h.notificationToken=k);let m={method:r,headers:h};a&&"GET"!==r&&(m.body=JSON.stringify(a)),void 0!==l&&(m.next={revalidate:l}),p&&(m.cache=p);let x=await fetch(y,m);if(!x.ok)throw Error(`API request failed: ${x.status} ${x.statusText}`);return x.json()}async function a(e,t={}){let{apiBase:s="mobile",method:r="GET",body:a,token:i,langCode:c,notificationToken:u,headers:d={}}=t,l=n.Y8[s],p=`${l}${e.startsWith("/")?e:"/"+e}`,g={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(g.Authorization=i),c&&(g.langCode=c);let y=u;if(!y)try{y=(await (0,o.Gg)()).fcmToken}catch{}y&&(g.notificationToken=y);let h={method:r,headers:g};return a&&"GET"!==r&&(h.body=JSON.stringify(a)),fetch(p,h)}},90455:(e,t,s)=>{function n(e){return e.token?e.token:e.user?.token?e.user.token:process.env.BABOON_APP_BUSINESS_TOKEN||""}function o(){return process.env.BABOON_APP_BUSINESS_TOKEN||""}s.d(t,{I2:()=>o,LP:()=>n})},47090:(e,t,s)=>{s.d(t,{RF:()=>n,Y8:()=>r,pH:()=>o});let n=["al","en","it"],o={AL:{latitude:41.327546,longitude:19.818698,cityId:1,countryId:1},XK:{latitude:42.662914,longitude:21.165503,cityId:2,countryId:2}},r={mobile:process.env.BABOON_API_MOBILE_URL,legacy:process.env.BABOON_API_URL,sysadmin:process.env.BABOON_API_SYSADMIN_URL,payment:process.env.BABOON_API_PAYMENT_URL}},70446:(e,t,s)=>{s.d(t,{Gg:()=>i,dx:()=>r,l7:()=>a,yK:()=>c});var n=s(78632),o=s(71615);let r={password:process.env.SESSION_SECRET,cookieName:"baboon-session",cookieOptions:{secure:!0,httpOnly:!0,sameSite:"lax",maxAge:604800}},a={...r,cookieName:"baboon-admin-session"};async function i(){let e=await (0,o.cookies)();return(0,n.iW)(e,r)}async function c(){let e=await (0,o.cookies)();return(0,n.iW)(e,a)}}};var t=require("../../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),n=t.X(0,[8948,3314,8632,5972],()=>s(52178));module.exports=n})();