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]=`38e99f00-4cd3-4461-aae3-5aa4ec559952`,e._sentryDebugIdIdentifier=`sentry-dbid-38e99f00-4cd3-4461-aae3-5aa4ec559952`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{R as t,z as n}from"./vendor-misc-hfpbxrii.js";import{$d as r,Ag as i,Dp as a,Ep as o,Fg as s,Ig as c,_r as l,dn as u,go as d,sh as f,th as p}from"./entry.client-dr7r6s9a.js";import{n as m,t as h}from"./createGetAuthToken-gzsh85ms.js";import{t as g}from"./useFlowId-n9vqrww9.js";import{t as _}from"./purchasePageReadyUtils-n2r38x2a.js";import{n as v,r as y,t as b}from"./parseSearchParams-lzmzldiy.js";import{t as x}from"./RenewIntoHost-jmp0eyac.js";var S=s(),C=e(c(),1),w=i(),T=(0,C.createContext)(null),E=u(e=>{let t=(0,S.c)(3),n=x.useComponent(),r;return t[0]!==n||t[1]!==e?(r=(0,w.jsx)(n,{...e}),t[0]=n,t[1]=e,t[2]=r):r=t[2],r},()=>{let{recurrenceId:e,productId:i,skuId:s,availabilityId:c}=n(r.external.commerce.renewInto),[l]=t(r.external.commerce.renewInto),{getLogger:u}=p(),{adaptor:{native:m}}=f(),x=g(),S=(0,C.useContext)(T),w=u(`RenewIntoPage`);if(!S)throw new o(`HostCommunicationContext`,a.Missing);if(!e)throw new o(`recurrenceId`,a.Missing);if(!i)throw new o(`productId`,a.Missing);if(!s)throw new o(`skuId`,a.Missing);if(!c)throw new o(`availabilityId`,a.Missing);let{mode:E,getXToken:D,getToken:O,getMsaToken:k,onExit:A,onPageReady:j}=S,M=y(l.clientName),N=b(l.callerApplicationId)??d.PCGamingApp,P=v(l.purchaseSource),F=l.identityMismatch??!1;return{recurrenceId:e,productId:i,skuId:s,availabilityId:c,renewIntoLaunchStartTime:0,callerApplicationId:N,sourceClientName:M,purchaseSource:P,getAuthToken:h({mode:E,getXToken:D,getToken:O,getMsaToken:k,isNhpAvailable:()=>m.bridge.isSupported(),logger:w,msaVersion:`MSAv1`}),onExit:async e=>{w.info(`onExit — status: ${e.status}`),await A({productId:i,skuId:s,availabilityId:c,status:e.status})},onPurchasePageReady:_(j),flowId:x,identityMismatch:F}}),D=l(()=>{let e=m({resultReporting:`onExit`}),{isReady:t,error:n}=e,r=E.useComponent();if(n)throw n;return t?(0,w.jsx)(T.Provider,{value:e,children:(0,w.jsx)(C.Suspense,{children:(0,w.jsx)(r,{})})}):null},`RenewIntoPage`);export{D as t};