try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`65efac8a-2ebf-4923-977b-15bbf261f882`,e._sentryDebugIdIdentifier=`sentry-dbid-65efac8a-2ebf-4923-977b-15bbf261f882`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{Au as t,Fm as n,Lm as r,Nu as i,Oi as a,Zm as o,jg as s,jm as c,ju as l,ng as u}from"./entry.client-mpghtlrl.js";import{r as d,t as f}from"./ContextualStoreHost-jce1zzlr.js";var p=e(s(),1),m=u(),h=r(a(function(){let{productId:e,skuId:r,availabilityId:a}=n(),{search:s}=c(),{logging:u}=o(),h=(0,p.useMemo)(()=>u.getLogger(`ContextualStorePage`),[u]),g=(0,p.useMemo)(()=>new URLSearchParams(s),[s]),_=(0,p.useMemo)(()=>g.get(`skipPurchaseConfirmation`)===`true`,[g]),v=(0,p.useMemo)(()=>g.get(`version`)===`v1`?t.v1:t.v2,[g]),y=(0,p.useMemo)(()=>g.get(`theme`)===`light`?l.Light:l.Dark,[g]),b=(0,p.useMemo)(()=>g.get(`callerApplicationId`)||void 0,[g]),x=(0,p.useMemo)(()=>{switch(g.get(`experience`)){case i.Browse:return i.Browse;case i.Redeem:return i.Redeem;case i.Purchase:return i.Purchase;default:case i.Details:return i.Details}},[g]),S=(0,p.useMemo)(()=>g.get(`campaignId`)||void 0,[g]),C=(0,p.useMemo)(()=>g.get(`itemTypes`)||``,[g]),w=(0,p.useMemo)(()=>g.get(`hideClose`)===`true`,[g]),T=(0,p.useMemo)(()=>g.get(`referringProductId`)||void 0,[g]),E=(0,p.useMemo)(()=>g.get(`xStoreScenario`)||void 0,[g]),D=(0,p.useMemo)(()=>g.get(`clientType`)||void 0,[g]),O=(0,p.useCallback)(()=>{h.info(`Contextual Store closed`)},[h]);if(!e)throw h.error(`Product ID is missing`),Error(`Product ID is required to render Contextual Store`);return(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(d,{}),children:(0,m.jsx)(`div`,{className:`relative h-screen w-full`,children:(0,m.jsx)(f,{productId:e,skuId:r,availabilityId:a,skipPurchaseConfirmation:_,version:v,theme:y,callerApplicationId:b,experience:x,campaignId:S,itemTypes:C,referringProductId:T,hideClose:w,xStoreScenario:E,sourceClientName:D,onClose:O})})})},`ContextualStorePage`));export{h as default};