1import{a as e}from"./jsx-runtime-D_MnEzuy.js";import{t}from"./react-DBEjWt7A.js";import{n,t as r}from"./createServerFn-VTmtgM-o.js";import{n as i}from"./dist-DT2jQ2P_.js";import{t as a}from"./useQuery-B_tVWEJs.js";import{n as o}from"./auth-DZmhojk1.js";var s=e(t(),1),c=r({method:`GET`}).handler(n(`de70666cd641f3b0a74d3a373c821624cb4e42957652093cae6cef5ae4dbec96`)),l=r({method:`POST`}).handler(n(`5dfe7e5812f80456af6b2415b0d2e10b9b1bd3f0cfa838f8785904b1bb9d4669`)),u=r({method:`POST`}).handler(n(`010ddcad569648a88185b641f1de538fa9b2968654c4e9357424451d6af87883`)),d=e=>{try{return JSON.parse(e.message).message}catch{return`Something went wrong. Please try again.`}},f=({enabled:e=!0}={})=>{let{user:t}=o(),{data:n,isLoading:r}=a({queryKey:[`billing`,t?.id],queryFn:()=>c().then(e=>e.json()),staleTime:3e4,enabled:e}),[f,p]=(0,s.useState)(null),m=(0,s.useCallback)(async(e,t)=>{p(e);try{let{url:e}=await(await t()).json();window.location.assign(e)}catch(e){i.error(d(e)),p(null)}},[]),h=(0,s.useCallback)((e,t)=>m(`${t}-${e}`,()=>l({data:{interval:e,method:t}})),[m]),g=(0,s.useCallback)(()=>m(`portal`,()=>u()),[m]);return{enabled:!!n?.enabled,alipay:!!n?.alipay,status:n?.status??null,isLoading:r,pending:f,checkout:h,manage:g}};export{f as t};
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.