import{Ia as m,Id as b,Jd as y,Ka as u,Kd as D,Ld as I,Na as l,Ra as h,Sa as k,d as f,i as p,ia as g,na as x,pa as d,ya as a}from"./chunk-WL5U2YIT.js";import{e as w}from"./chunk-ADEKKGI2.js";function A(n){n||(n=a(u));let e=new f(t=>{if(n.destroyed){t.next();return}return n.onDestroy(t.next.bind(t))});return t=>t.pipe(g(e))}function V(n,e){let t=e?.injector??a(m),o=new p(1),c=D(()=>{let r;try{r=n()}catch(i){b(()=>o.error(i));return}b(()=>o.next(r))},{injector:t,manualCleanup:!0});return t.get(u).onDestroy(()=>{c.destroy(),o.complete()}),o.asObservable()}function $(n,e){let o=!e?.manualCleanup?e?.injector?.get(u)??a(u):null,c=j(e?.equal),r;e?.requireSync?r=l({kind:0},{equal:c}):r=l({kind:1,value:e?.initialValue},{equal:c});let i,v=n.subscribe({next:s=>r.set({kind:1,value:s}),error:s=>{r.set({kind:2,error:s}),i?.()},complete:()=>{i?.()}});if(e?.requireSync&&r().kind===0)throw new d(601,!1);return i=o?.onDestroy(v.unsubscribe.bind(v)),y(()=>{let s=r();switch(s.kind){case 1:return s.value;case 2:throw s.error;case 0:throw new d(601,!1)}},{equal:e?.equal})}function j(n=Object.is){return(e,t)=>e.kind===1&&t.kind===1&&n(e.value,t.value)}var M=w(()=>{x();k();h();I();});export{A as a,V as b,$ as c,M as d};
