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