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]=`1cbe69f1-15f0-44f5-a700-f25ac7416727`,e._sentryDebugIdIdentifier=`sentry-dbid-1cbe69f1-15f0-44f5-a700-f25ac7416727`)}catch{}import{Eg as e,Fg as t,Fp as n,Ma as r,Ur as i}from"./entry.client-dr7r6s9a.js";var a=(e,t,n,r)=>{let i={appId:e,appVersion:r?.engineVersion??`Unknown`,appName:t};return r?.nativeAppName&&r?.nativeAppVersion?{...i,osVersion:r.osVersion??`Unknown`,hostName:n,hostVersion:r.nativeAppVersion}:r?.osVersion?{...i,osVersion:r.osVersion}:i},o=(e,t)=>{let i=e?.nativeAppName===n.Garrison||e?.nativeAppName===n.Bastion?r.PC:r.Web,a=i===r.Web,o=e?.isGamingHandheld,s=a?`Browser: ${e?.browserName}`:o?`GamingHandheld: ${e.model}`:e?.vendor&&e?.model?`${e.vendor} ${e.model}`:`Unspecified device`;return{...o&&{deviceForm:`GamingHandheld`},deviceFamily:i,deviceId:t&&!a?t:``,deviceType:s}},s=`https://purchasecore.xboxservices.com`,c=`/api/purchasecore`,l=`${s}/api`;function u(e){return e===!0?c:l}function d(e){let{getAuthToken:t,client:n,device:r,locale:a,market:o,flow:c,correlationVector:l,trackAppAction:u,trackHttpEvent:d,logger:f,getExtraHeaders:p,purchaseCoreRoot:m,adapterExtensions:h}=e;return{auth:{...h?.auth,getToken:async e=>({token:await t(s),signature:``}),invalidateToken:e=>Promise.resolve()},env:{...h?.env,client:n,device:r,language:a,market:o},exp:{...h?.exp,getVariables:()=>Promise.resolve({})},http:{...h?.http,root:m,dependencyName:`play-xbox`,getHeaders:async()=>({...p?await p()??{}:{},"x-ms-timezone-offset-minutes":String(new Date().getTimezoneOffset()),"x-ms-iana-timezone-id":Intl.DateTimeFormat().resolvedOptions().timeZone,"MS-CV":l.increment().value})},log:{...h?.log,logAppAction:(e,t,n)=>{u(`TitanAppAction`,{action:e,flow:c,reason:t,payload:n},{})},logError:e=>{let{name:t,message:n,data:r}=e;f.error(`Error ${r?.errorCode??t} : ${r?.errorClassification} : ${n}`)},logServiceResponse:e=>{d({name:i.HttpEvent,requestUrl:e.targetUri||`unspecified`,latencyMs:e.latencyMS,httpMethod:e.requestMethod,httpStatus:e.protocolStatusCode===void 0?0:Number(e.protocolStatusCode),errorMessage:e.succeeded?``:`${e.operationName} failed`,contentSize:e.responseSizeBytes||0})}}}}var f=t();function p(t){let n=(0,f.c)(5),r;n[0]===t.queries.configuration?r=n[1]:(r=t.queries.configuration.getOptions(`app.titanCommerce.usePurchaseCoreProxy`),n[0]=t.queries.configuration,n[1]=r);let{data:i}=e(r),a;return n[2]!==t||n[3]!==i?(a=u(t.castAsConfiguration(i,`app.titanCommerce.usePurchaseCoreProxy`)??void 0),n[2]=t,n[3]=i,n[4]=a):a=n[4],a}export{o as i,d as n,a as r,p as t};