module.exports=[39057,a=>{"use strict";let b={BASE_URL:"https://sempreg.com/api/proxy",ENDPOINTS:{VISIT:"/analytics/visit",EVENT:"/analytics/event",COOKIE_CONSENT:"/analytics/cookie-consent",METRICS:"/api/analytics/metrics",EVENTS:"/api/analytics/events",DETAILED_METRICS:"/api/analytics/metrics/detailed",EXPORT:"/api/analytics/export"},HEADERS:{"Content-Type":"application/json"}},c=async(a,c={})=>{try{let d={endpoint:a,method:c.method||"GET"};c.body&&(d.body="string"==typeof c.body?JSON.parse(c.body):c.body);let e=await fetch(b.BASE_URL,{method:"POST",headers:b.HEADERS,body:JSON.stringify(d)}),f=await e.json().catch(()=>{throw Error("Invalid JSON response")});if(!e.ok)throw Error(f.error||f.message||`HTTP error! status: ${e.status}`);return f}catch(a){throw console.warn("Public API request failed:",a.message),a}},d=async(a,c,d={})=>{try{let e=await fetch(b.BASE_URL,{method:"POST",headers:{...b.HEADERS,Authorization:`Bearer ${c}`},body:JSON.stringify({endpoint:a,...d})}),f=await e.json().catch(()=>{throw Error("Response is not valid JSON")});if(!e.ok)throw Error(f.error||f.message||`HTTP error! status: ${e.status}`);return f}catch(a){throw console.error("Protected API request failed:",a.message),a}},e=async(a=window.location.href)=>{let d=sessionStorage.getItem("sessionId")||g();sessionStorage.setItem("sessionId",d);try{return await c(b.ENDPOINTS.VISIT,{method:"POST",body:{timestamp:new Date().toISOString(),url:a,sessionId:d}})}catch(a){throw console.error("Failed to track analytics:",a.message),a}},f=async(a,d={})=>{let e=sessionStorage.getItem("sessionId")||g();sessionStorage.setItem("sessionId",e);try{return await c(b.ENDPOINTS.EVENT,{method:"POST",body:{timestamp:new Date().toISOString(),url:window.location.href,sessionId:e,event:a,...d}})}catch(a){throw console.error("Failed to track event:",a.message),a}};function g(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}a.s(["API_CONFIG",0,b,"protectedApiRequest",0,d,"publicApiRequest",0,c,"trackAnalytics",0,e,"trackEvent",0,f])},52500,a=>{a.v(a=>Promise.resolve().then(()=>a(39057)))},51701,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__3a9246eb._.js"].map(b=>a.l(b))).then(()=>b(22461)))}];

//# sourceMappingURL=src_fd8959df._.js.map