import{F as l,ay as p,bF as y,h as d,I as T,a5 as S,N as f}from"./LrfSKRHt.js";const b=a=>!!a&&a.value!==void 0,C=3e3,h=a=>{const t=l(),c=p(y),n=l(),o=l(),u=d(()=>{var e;return((e=t.value)==null?void 0:e.some(i=>i.id.toString()===a))??!1}),r=d(()=>{var e,i;return(i=(e=t.value)==null?void 0:e.find(s=>s.id.toString()===a))==null?void 0:i.variant}),v=e=>{if(!e||e.functionality_storage==="denied"){o.value={state:"no-consent",description:"Consent not given"};return}const s=window;if(s!=null&&s.symplify){if(u.value)return;o.value={state:"not-in-test",description:"Test not found"};return}n.value=setTimeout(()=>{if(s.symplify){if(u.value)return;o.value={state:"not-in-test",description:"Test not found"};return}o.value={state:"no-symplify",description:"Symplify script not loaded"}},C)},m=()=>{const e=window;if(e!=null&&e.abTests){t.value=e.abTests.value;return}t.value=[],b(t)&&(e.abTests=t)};return T(()=>{v(c.value),m()}),S(()=>{n.value&&clearTimeout(n.value)}),f(c,v),f(r,()=>{!r.value||!n.value||(o.value=void 0,clearTimeout(n.value),n.value=void 0)}),{isInTest:u,variant:r,errorState:o}};export{h as u};