"use strict";(()=>{var e={};e.id=6965,e.ids=[6965],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")},99815:(e,t,s)=>{s.r(t),s.d(t,{originalPathname:()=>v,patchFetch:()=>x,requestAsyncStorage:()=>f,routeModule:()=>l,serverHooks:()=>m,staticGenerationAsyncStorage:()=>g});var n={};s.r(n),s.d(n,{GET:()=>p});var r=s(49303),o=s(88716),a=s(60670),i=s(87070),c=s(19191),u=s(70446),d=s(90455);async function p(e){let t=await (0,u.Gg)(),s=(0,d.LP)(t)||(0,d.I2)(),n=e.nextUrl.searchParams,r=n.get("cartId"),o=n.get("userId");if(!r||!o)return i.NextResponse.json({success:!1,message:"cartId and userId are required"},{status:400});try{let e=await (0,c.q)(`/carts/v1/${r}/service-fee/${o}`,{apiBase:"mobile",token:s,langCode:t.langCode||"al",cache:"no-store"});return i.NextResponse.json({success:!0,data:e.data,serviceFee:e.data?.serviceFee??e.data??0})}catch(e){return console.error("[service-fee] ERROR:",e),i.NextResponse.json({success:!1,message:e.message||"Failed to fetch service fee"},{status:500})}}let l=new r.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/service-fee/route",pathname:"/api/service-fee",filename:"route",bundlePath:"app/api/service-fee/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/service-fee/route.ts",nextConfigOutput:"standalone",userland:n}),{requestAsyncStorage:f,staticGenerationAsyncStorage:g,serverHooks:m}=l,v="/api/service-fee/route";function x(){return(0,a.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:g})}},19191:(e,t,s)=>{s.d(t,{F:()=>a,q:()=>o});var n=s(47090),r=s(70446);async function o(e,t={}){let{apiBase:s="mobile",method:o="GET",body:a,token:i,langCode:c,notificationToken:u,headers:d={},revalidate:p,cache:l}=t,f=n.Y8[s],g=`${f}${e.startsWith("/")?e:"/"+e}`,m={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(m.Authorization=i),c&&(m.langCode=c);let v=u;if(!v)try{v=(await (0,r.Gg)()).fcmToken}catch{}v&&(m.notificationToken=v);let x={method:o,headers:m};a&&"GET"!==o&&(x.body=JSON.stringify(a)),void 0!==p&&(x.next={revalidate:p}),l&&(x.cache=l);let y=await fetch(g,x);if(!y.ok)throw Error(`API request failed: ${y.status} ${y.statusText}`);return y.json()}async function a(e,t={}){let{apiBase:s="mobile",method:o="GET",body:a,token:i,langCode:c,notificationToken:u,headers:d={}}=t,p=n.Y8[s],l=`${p}${e.startsWith("/")?e:"/"+e}`,f={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(f.Authorization=i),c&&(f.langCode=c);let g=u;if(!g)try{g=(await (0,r.Gg)()).fcmToken}catch{}g&&(f.notificationToken=g);let m={method:o,headers:f};return a&&"GET"!==o&&(m.body=JSON.stringify(a)),fetch(l,m)}},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 r(){return process.env.BABOON_APP_BUSINESS_TOKEN||""}s.d(t,{I2:()=>r,LP:()=>n})},47090:(e,t,s)=>{s.d(t,{RF:()=>n,Y8:()=>o,pH:()=>r});let n=["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}},o={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:()=>o,l7:()=>a,yK:()=>c});var n=s(78632),r=s(71615);let o={password:process.env.SESSION_SECRET,cookieName:"baboon-session",cookieOptions:{secure:!0,httpOnly:!0,sameSite:"lax",maxAge:604800}},a={...o,cookieName:"baboon-admin-session"};async function i(){let e=await (0,r.cookies)();return(0,n.iW)(e,o)}async function c(){let e=await (0,r.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(99815));module.exports=n})();