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]=`450856e2-96ea-4214-a887-564c537df1bb`,e._sentryDebugIdIdentifier=`sentry-dbid-450856e2-96ea-4214-a887-564c537df1bb`)}catch{}import{Ag as e,Fc as t,Ic as n,Zh as r,ga as i}from"./entry.client-mpghtlrl.js";var a=`https://purchasecore.xboxservices.com`,o=`/api/purchasecore`,s=`${a}/api`;function c(e){return e===!0?o:s}function l(e){let{getAuthToken:t,client:n,device:r,locale:o,market:s,tracking:c,flow:l,correlationVector:u,trackAppAction:d,trackHttpEvent:f,logger:p,getExtraHeaders:m,purchaseCoreRoot:h,flights:g,adapterExtensions:_}=e;return{auth:{..._?.auth,getToken:async e=>({token:await t(a),signature:``}),invalidateToken:e=>Promise.resolve()},env:{..._?.env,client:n,device:r,language:o,market:s,tracking:c},exp:{..._?.exp,getVariables:()=>Promise.resolve({}),getFlights:()=>g},http:{..._?.http,root:h,dependencyName:`play-xbox`,getHeaders:async()=>({...m?await m()??{}:{},"x-ms-timezone-offset-minutes":String(new Date().getTimezoneOffset()),"x-ms-iana-timezone-id":Intl.DateTimeFormat().resolvedOptions().timeZone,"MS-CV":u.increment().value})},log:{..._?.log,logAppAction:(e,t,n)=>{d(`TitanAppAction`,{action:e,flow:l,reason:t,payload:n},{})},logError:e=>{let{name:t,message:n,data:r}=e;p.error(`Error ${r?.errorCode??t} : ${r?.errorClassification} : ${n}`)},logServiceResponse:e=>{f({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 u=e(),d=`Play Xbox`,f=new Set([t.BaysidePurchase,t.PCGamingApp,t.SaturnPC,t.XENative]),p=(e,t,n)=>{let r={appId:e,appVersion:t?.engineVersion??`Unknown`,appName:d};return t?.nativeAppName&&t?.nativeAppVersion?{...r,osVersion:t.osVersion??`Unknown`,hostName:n??t.nativeAppName,hostVersion:t.nativeAppVersion}:t?.osVersion?{...r,osVersion:t.osVersion}:r},m=(e,t,r)=>{let i=f.has(e),a=t?.isGamingHandheld,o=i?n.PC:n.Web,s=o===n.Web,c=s?`Browser: ${t?.browserName}`:a?`GamingHandheld: ${t.model}`:t?.vendor&&t?.model?`${t.vendor} ${t.model}`:`Unspecified device`;return{deviceForm:a?`GamingHandheld`:void 0,deviceFamily:o,deviceId:r&&!s?r:``,deviceType:c}};function h(e){let t=(0,u.c)(11),{clientName:n,deviceInfo:r,deviceId:i,hostName:a}=e,o,s;t[0]!==n||t[1]!==r||t[2]!==a?(s=p(n,r,a),t[0]=n,t[1]=r,t[2]=a,t[3]=s):s=t[3];let c;t[4]!==n||t[5]!==r||t[6]!==i?(c=m(n,r,i),t[4]=n,t[5]=r,t[6]=i,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==c?(l={client:s,device:c},t[8]=s,t[9]=c,t[10]=l):l=t[10],o=l,o}function g(e){let t=(0,u.c)(5),n;t[0]===e.queries.configuration?n=t[1]:(n=e.queries.configuration.getOptions(`commerce.enablePurchaseProxy`),t[0]=e.queries.configuration,t[1]=n);let{data:i}=r(n),a;return t[2]!==e||t[3]!==i?(a=c(e.castAsConfiguration(i,`commerce.enablePurchaseProxy`)??void 0),t[2]=e,t[3]=i,t[4]=a):a=t[4],a}export{h as n,l as r,g as t};