"use strict";(()=>{var e={};e.id=4841,e.ids=[4841],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")},24313:(e,t,n)=>{n.r(t),n.d(t,{originalPathname:()=>f,patchFetch:()=>x,requestAsyncStorage:()=>h,routeModule:()=>y,serverHooks:()=>m,staticGenerationAsyncStorage:()=>g});var r={};n.r(r),n.d(r,{GET:()=>p});var o=n(49303),s=n(88716),a=n(60670),i=n(87070),c=n(19191),u=n(70446),d=n(90455),l=n(64900);async function p(){let e=(0,d.I2)(),t="al",n=-1;try{let r=await (0,u.Gg)(),o=(0,d.LP)(r);o&&(e=o),r.langCode&&(t=r.langCode),r.user?.id&&(n=r.user.id)}catch{}let{latitude:r,longitude:o,cityId:s}=(0,l.yt)(),a=[`latitude=${r}`,`longitude=${o}`,`cityId=${s||1}`,"businessTypeId=-1",`customerId=${n}`];try{let n=await (0,c.q)(`/mobile/v1/search_screen?${a.join("&")}`,{apiBase:"mobile",token:e,langCode:t,cache:"no-store"});return i.NextResponse.json({success:!0,data:n.data??{}})}catch(e){return console.error("[search/screen] ERROR:",e),i.NextResponse.json({success:!1,error:"Failed to load search screen"},{status:500})}}let y=new o.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/search/screen/route",pathname:"/api/search/screen",filename:"route",bundlePath:"app/api/search/screen/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/search/screen/route.ts",nextConfigOutput:"standalone",userland:r}),{requestAsyncStorage:h,staticGenerationAsyncStorage:g,serverHooks:m}=y,f="/api/search/screen/route";function x(){return(0,a.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:g})}},19191:(e,t,n)=>{n.d(t,{F:()=>a,q:()=>s});var r=n(47090),o=n(70446);async function s(e,t={}){let{apiBase:n="mobile",method:s="GET",body:a,token:i,langCode:c,notificationToken:u,headers:d={},revalidate:l,cache:p}=t,y=r.Y8[n],h=`${y}${e.startsWith("/")?e:"/"+e}`,g={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(g.Authorization=i),c&&(g.langCode=c);let m=u;if(!m)try{m=(await (0,o.Gg)()).fcmToken}catch{}m&&(g.notificationToken=m);let f={method:s,headers:g};a&&"GET"!==s&&(f.body=JSON.stringify(a)),void 0!==l&&(f.next={revalidate:l}),p&&(f.cache=p);let x=await fetch(h,f);if(!x.ok)throw Error(`API request failed: ${x.status} ${x.statusText}`);return x.json()}async function a(e,t={}){let{apiBase:n="mobile",method:s="GET",body:a,token:i,langCode:c,notificationToken:u,headers:d={}}=t,l=r.Y8[n],p=`${l}${e.startsWith("/")?e:"/"+e}`,y={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(y.Authorization=i),c&&(y.langCode=c);let h=u;if(!h)try{h=(await (0,o.Gg)()).fcmToken}catch{}h&&(y.notificationToken=h);let g={method:s,headers:y};return a&&"GET"!==s&&(g.body=JSON.stringify(a)),fetch(p,g)}},90455:(e,t,n)=>{function r(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||""}n.d(t,{I2:()=>o,LP:()=>r})},47090:(e,t,n)=>{n.d(t,{RF:()=>r,Y8:()=>s,pH:()=>o});let r=["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}},s={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}},64900:(e,t,n)=>{n.d(t,{cO:()=>s,yt:()=>a});var r=n(47090);let o={1:"tirana",2:"prishtina",3:"durres",4:"vlora",5:"elbasan",6:"shkoder",7:"fier",8:"korce"};function s(e){return o[e]||"tirana"}function a(e,t,n){let o="XK"===n?{...r.pH.XK}:{...r.pH.AL},s=e?Number(e):null,a=t?Number(t):null;return s&&a&&!isNaN(s)&&!isNaN(a)?{latitude:s,longitude:a,cityId:o.cityId,countryId:o.countryId}:{latitude:o.latitude,longitude:o.longitude,cityId:o.cityId,countryId:o.countryId}}},70446:(e,t,n)=>{n.d(t,{Gg:()=>i,dx:()=>s,l7:()=>a,yK:()=>c});var r=n(78632),o=n(71615);let s={password:process.env.SESSION_SECRET,cookieName:"baboon-session",cookieOptions:{secure:!0,httpOnly:!0,sameSite:"lax",maxAge:604800}},a={...s,cookieName:"baboon-admin-session"};async function i(){let e=await (0,o.cookies)();return(0,r.iW)(e,s)}async function c(){let e=await (0,o.cookies)();return(0,r.iW)(e,a)}}};var t=require("../../../../webpack-runtime.js");t.C(e);var n=e=>t(t.s=e),r=t.X(0,[8948,3314,8632,5972],()=>n(24313));module.exports=r})();