1import{u as K}from"./DrPsXeWN.js";import{k as F}from"./BI5BN1rn.js";import{w as L,r}from"./BA2cZanY.js";function C(e){return Array.isArray(e)?e.length:e&&typeof e=="object"&&Array.isArray(e.data)?e.data.length:0}const u=r(null),l=r(null),o=r(null),c=r(null),i=r(null),f=r(!1);let y=null,n=null,h=!1;function E(){const{accountFetch:e,isAccountReady:d,shopId:A,apiKey:p}=K(),{isFeatureEnabled:m}=F(),g=()=>`${A.value||""}:${p.value||""}`,v=()=>{u.value=null,l.value=null,o.value=null,c.value=null,i.value=null,y=null};h||(h=!0,L(p,s=>{s||v()}));const t=async s=>{try{const a=await e(s);return C(a)>0}catch{return!1}};return{hasAnyOrders:u,hasAnyReservations:l,hasAnyTickets:o,hasAnyCodes:c,hasAnySubscriptions:i,presenceLoading:f,fetchAccountPresence:async s=>{if(!d.value)return;const a=g();if(!(!s?.force&&y===a&&u.value!==null))return n||(f.value=!0,n=(async()=>{try{const[w,j,P,b,k]=await Promise.all([t("orders.json?user=true&size=1&page=1&rawformat=true"),t("reservations.json?user=true&size=1&page=1&rawformat=true"),t("tickets.json?user=true&size=1&page=1"),t("valuecards.json?user=true&size=1&page=1&rawformat=true"),m("paymentplans")?Promise.all([t("subscriptions.json?user=true"),t("orders.json?user=true&rawformat=true&paymentdue=true")]).then(z=>z.includes(!0)):Promise.resolve(!1)]);u.value=w,l.value=j,o.value=P,c.value=b,i.value=k,y=a}finally{f.value=!1,n=null}})(),n)},resetAccountPresence:v}}export{C as a,E as u};
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.