1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5bd28e74-67c5-42b0-9e81-92aaec16c18d",e._sentryDebugIdIdentifier="sentry-dbid-5bd28e74-67c5-42b0-9e81-92aaec16c18d")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4047],{64047:(e,t,a)=>{a.d(t,{cancelTebexSubscription:()=>s,fetchTebexSubscriptionPrices:()=>c,fetchWalletBalance:()=>l,pollForActiveSubscription:()=>u});let n="https://prod.api.gammatime.ai/api/v1";class o extends Error{constructor(e,t){super(e),this.status=t,this.name="WalletApiError"}}async function i(e,t){var a,i;let r,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l="".concat(n).concat(e),{timeoutMs:s,...u}=c,d=new Headers(null!=(a=u.headers)?a:{});d.set("Authorization","Bearer ".concat(t)),d.has("Accept")||d.set("Accept","application/json"),u.body&&!d.has("Content-Type")&&d.set("Content-Type","application/json");let p=s?new AbortController:null,f=p?setTimeout(()=>p.abort(),s):null;try{r=await fetch(l,{...u,headers:d,signal:null!=(i=null==p?void 0:p.signal)?i:u.signal})}catch(t){if(f&&clearTimeout(f),(null==t?void 0:t.name)==="AbortError")throw new o("[wallet-api] ".concat(e," timed out after ").concat(s,"ms"),408);throw t}if(f&&clearTimeout(f),!r.ok){let t="";try{t=await r.text()}catch(e){}throw new o("[wallet-api] ".concat(e," failed: ").concat(r.status," ").concat(t),r.status)}if(204===r.status)return null;let h=await r.json();return void 0!==h.data&&null!==h.data?h.data:void 0!==h.result&&null!==h.result?h.result:void 0!==h.payload&&null!==h.payload?h.payload:void 0!==h.response&&null!==h.response?h.response:h}let r="12270-bc618957d53eec1aaf037ff52b6653a520096d40";async function c(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{let t=await fetch("https://headless.tebex.io/api/accounts/".concat(r,"/packages"),{headers:{Accept:"application/json"}});if(!t.ok)return[];return(await t.json()).data.filter(t=>e||t.name.toLowerCase().includes("subscription")||t.name.toLowerCase().includes("weekly")||t.name.toLowerCase().includes("yearly")).map(e=>({id:e.id,name:e.name,price:e.total_price,basePrice:e.base_price,currency:e.currency}))}catch(e){return[]}}async function l(e){return i("/wallet/balance",e,{method:"GET"})}async function s(e,t){return i("/wallet/cancel-tebex-subscription",e,{method:"POST",body:JSON.stringify({subscriptionReference:t})})}async function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1500,n=Math.min(500,a);for(let o=0;o<t;o++){let i=await l(e);if(i.hasActiveSubscription)return i;o<t-1&&(await new Promise(e=>setTimeout(e,n)),n=Math.min(Math.round(1.5*n),a))}return null}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.