import{Cd as y,Gd as h,Ha as i,Qa as s,Ya as a,d as f,ia as v,ma as g,na as p,oa as u,ya as c}from"./chunk-JSJB5BKT.js";import{e as m}from"./chunk-SZAW6ZBW.js";function w(r){r||(i(w),r=c(s));let e=new f(t=>r.onDestroy(t.next.bind(t)));return t=>t.pipe(v(e))}function k(r,e){let t=!e?.manualCleanup;t&&!e?.injector&&i(k);let d=t?e?.injector?.get(s)??c(s):null,l=x(e?.equal),o;e?.requireSync?o=a({kind:0},{equal:l}):o=a({kind:1,value:e?.initialValue},{equal:l});let b=r.subscribe({next:n=>o.set({kind:1,value:n}),error:n=>{if(e?.rejectErrors)throw n;o.set({kind:2,error:n})}});if(e?.requireSync&&o().kind===0)throw new u(601,!1);return d?.onDestroy(b.unsubscribe.bind(b)),y(()=>{let n=o();switch(n.kind){case 1:return n.value;case 2:throw n.error;case 0:throw new u(601,!1)}},{equal:e?.equal})}function x(r=Object.is){return(e,t)=>e.kind===1&&t.kind===1&&r(e.value,t.value)}var j=m(()=>{h();g();p();});export{w as a,k as b,j as c};
