1import{Ct as e}from"./BxR1oLWR.js";import{$a as t,Ao as n,Ca as r}from"./M-W19bnO.js";import{t as i}from"./E1SbQVKC.js";import{a,t as o}from"./CZ38Ym2f.js";import{D as s,E as c,T as l}from"./D-5Rzi4q.js";import{t as u}from"./DthSupV_.js";import{t as d}from"./DhPDUwS_.js";import{t as f}from"./RqYGfMwm.js";var p=new a(window.localStorage,s),m=`baseline`,h=`anonymous`,g=1500,_=3e3,v=new Map;function y(e,t,n){return new Promise(r=>{let i=setTimeout(()=>r(n),t);e.then(r,()=>r(n)).finally(()=>clearTimeout(i))})}function b(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>i(Error(n)),t);e.then(r,i).finally(()=>clearTimeout(a))})}function x(e,t){return p.get(e)?.[t]}function S(e,t,n){p.set(e,{...p.get(e),[t]:{alternative:n,expirationTimeMs:Date.now()+l}})}function C(e){return!!e?.alternative&&(e?.expirationTimeMs??0)>Date.now()}function w(){let e=p.store;Object.entries(e).forEach(([e,t])=>{let n=Object.entries(t??{}).filter(([,e])=>(e?.expirationTimeMs??0)+c>Date.now());n.length!==Object.keys(t??{}).length&&(p.remove(e),n.length&&p.set(e,Object.fromEntries(n)))})}function T(a,s={}){let{autoStart:c=!0}=s,l=i(),p=o(),T=e(),{waitForUser:E}=f(),D=null;try{D=d()}catch{D=null}let O=n(null),k=O,A=r(()=>l.experiments?.[a]?.name??null);function j(){let e=T?.query?.[`abtest[${a}]`],t=Array.isArray(e)?e[0]:e;return t?String(t):void 0}function M(e){return e?.id?String(e.id):h}function N(e){return!!e?.isBot||!!window?.isOldBrowser}function P(e,t,n){try{D?.identify?.(e,{[t]:n})}catch{}}async function F(e,t,n){w();let r=j();if(r)return S(t,e,r),r;let i=x(t,e);if(C(i))return i.alternative;if(N(n))return m;let a=`${t}:${e}`,o=v.get(a);if(o)return o;let s=b(u.startAbtest(e),_,`[ABTEST] timeout starting ${e}`).then(n=>{let r=n?.alternative;if(!r)throw Error(`[ABTEST] empty alternative for ${e}`);return S(t,e,r),P(t,e,r),r}).catch(()=>x(t,e)?.alternative||`baseline`).finally(()=>{v.delete(a)});return v.set(a,s),s}function I(e){return O.value=e,p.assignAbtest({[a]:e}),e}async function L(){return y(Promise.resolve(E()),g,null)}async function R(){let e=A.value;if(!e)return I(m);let t=j();if(t)return L().then(n=>{S(M(n),e,t)}),I(t);let n=await L();return I(await F(e,M(n),n))}let z=`setUserAlternative${a.replace(/(^|[-_\s])(\w)/g,(e,t,n)=>n.toUpperCase())}`;return t(()=>{c&&R()}),{variation:O,variant:k,start:R,[z]:R}}export{T 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.