"use strict";(()=>{var e={};e.id=5998,e.ids=[5998],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")},4264:(e,t,o)=>{o.r(t),o.d(t,{originalPathname:()=>y,patchFetch:()=>h,requestAsyncStorage:()=>f,routeModule:()=>m,serverHooks:()=>x,staticGenerationAsyncStorage:()=>g});var n={};o.r(n),o.d(n,{GET:()=>l,PUT:()=>p});var a=o(49303),r=o(88716),s=o(60670),i=o(87070),c=o(19191),u=o(70446),d=o(90455);async function l(e,{params:t}){let o=await (0,u.Gg)(),n=(0,d.LP)(o),a=e.nextUrl.searchParams,r=(await (0,c.q)(`/customers/v1/${t.id}/mobile/profile?cityId=${a.get("cityId")||o.cityId}&latitude=${a.get("latitude")||o.storageLatitude}&longitude=${a.get("longitude")||o.storageLongitude}`,{apiBase:"mobile",token:n,cache:"no-store"})).data,s=r?.customer??{};return i.NextResponse.json({success:!0,data:{id:s.id,name:s.name??"",surname:s.surname??"",email:s.email??"",phone:s.phone??"",phonePrefix:s.phonePrefix??"+355",sex:s.sex??"",dateOfBirth:s.dateOfBirth??"",balance:r?.balance??s.account?.balance??0,totalOrdersNo:r?.ordersNo??s.totalOrdersNo??0,activeBonus:r?.activeBonus??0}})}async function p(e){let t=await (0,u.Gg)(),o=(0,d.LP)(t),n=await e.json(),a=await (0,c.q)("/customers/profile",{apiBase:"mobile",method:"PUT",token:o,body:n,cache:"no-store"});return i.NextResponse.json(a)}let m=new a.AppRouteRouteModule({definition:{kind:r.x.APP_ROUTE,page:"/api/customers/[id]/profile/route",pathname:"/api/customers/[id]/profile",filename:"route",bundlePath:"app/api/customers/[id]/profile/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/customers/[id]/profile/route.ts",nextConfigOutput:"standalone",userland:n}),{requestAsyncStorage:f,staticGenerationAsyncStorage:g,serverHooks:x}=m,y="/api/customers/[id]/profile/route";function h(){return(0,s.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:g})}},19191:(e,t,o)=>{o.d(t,{F:()=>s,q:()=>r});var n=o(47090),a=o(70446);async function r(e,t={}){let{apiBase:o="mobile",method:r="GET",body:s,token:i,langCode:c,notificationToken:u,headers:d={},revalidate:l,cache:p}=t,m=n.Y8[o],f=`${m}${e.startsWith("/")?e:"/"+e}`,g={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(g.Authorization=i),c&&(g.langCode=c);let x=u;if(!x)try{x=(await (0,a.Gg)()).fcmToken}catch{}x&&(g.notificationToken=x);let y={method:r,headers:g};s&&"GET"!==r&&(y.body=JSON.stringify(s)),void 0!==l&&(y.next={revalidate:l}),p&&(y.cache=p);let h=await fetch(f,y);if(!h.ok)throw Error(`API request failed: ${h.status} ${h.statusText}`);return h.json()}async function s(e,t={}){let{apiBase:o="mobile",method:r="GET",body:s,token:i,langCode:c,notificationToken:u,headers:d={}}=t,l=n.Y8[o],p=`${l}${e.startsWith("/")?e:"/"+e}`,m={"Content-Type":"application/json","User-Agent":"BaboonWeb",...d};i&&(m.Authorization=i),c&&(m.langCode=c);let f=u;if(!f)try{f=(await (0,a.Gg)()).fcmToken}catch{}f&&(m.notificationToken=f);let g={method:r,headers:m};return s&&"GET"!==r&&(g.body=JSON.stringify(s)),fetch(p,g)}},90455:(e,t,o)=>{function n(e){return e.token?e.token:e.user?.token?e.user.token:process.env.BABOON_APP_BUSINESS_TOKEN||""}function a(){return process.env.BABOON_APP_BUSINESS_TOKEN||""}o.d(t,{I2:()=>a,LP:()=>n})},47090:(e,t,o)=>{o.d(t,{RF:()=>n,Y8:()=>r,pH:()=>a});let n=["al","en","it"],a={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,o)=>{o.d(t,{Gg:()=>i,dx:()=>r,l7:()=>s,yK:()=>c});var n=o(78632),a=o(71615);let r={password:process.env.SESSION_SECRET,cookieName:"baboon-session",cookieOptions:{secure:!0,httpOnly:!0,sameSite:"lax",maxAge:604800}},s={...r,cookieName:"baboon-admin-session"};async function i(){let e=await (0,a.cookies)();return(0,n.iW)(e,r)}async function c(){let e=await (0,a.cookies)();return(0,n.iW)(e,s)}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var o=e=>t(t.s=e),n=t.X(0,[8948,3314,8632,5972],()=>o(4264));module.exports=n})();