import{Aa as I,Ca as i,Ia as p,Ka as D,Zc as m,_c as h,da as y,ha as d,j as g,m as v,pa as u}from"./chunk-UNHECMG2.js";function M(t){t||(t=u(i));let e=new g(n=>{if(t.destroyed){n.next();return}return t.onDestroy(n.next.bind(n))});return n=>n.pipe(y(e))}var f=class{source;destroyed=!1;destroyRef=u(i);constructor(e){this.source=e,this.destroyRef.onDestroy(()=>{this.destroyed=!0})}subscribe(e){if(this.destroyed)throw new d(953,!1);let n=this.source.pipe(M(this.destroyRef)).subscribe({next:o=>e(o)});return{unsubscribe:()=>n.unsubscribe()}}};function z(t,e){return new f(t)}function P(t,e){let n=e?.injector??u(I),o=new v(1),a=D(()=>{let r;try{r=t()}catch(c){m(()=>o.error(c));return}m(()=>o.next(r))},{injector:n,manualCleanup:!0});return n.get(i).onDestroy(()=>{a.destroy(),o.complete()}),o.asObservable()}function Q(t,e){let o=!e?.manualCleanup?e?.injector?.get(i)??u(i):null,a=j(e?.equal),r;e?.requireSync?r=p({kind:0},{equal:a}):r=p({kind:1,value:e?.initialValue},{equal:a});let c,x=t.subscribe({next:s=>r.set({kind:1,value:s}),error:s=>{r.set({kind:2,error:s}),c?.()},complete:()=>{c?.()}});if(e?.requireSync&&r().kind===0)throw new d(601,!1);return c=o?.onDestroy(x.unsubscribe.bind(x)),h(()=>{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(t=Object.is){return(e,n)=>e.kind===1&&n.kind===1&&t(e.value,n.value)}var k=Math.pow(10,8)*24*60*60*1e3,B=-k,G=6048e5,J=864e5,K=6e4,X=36e5,Z=1e3;var S=3600;var w=S*24,_=w*7,C=w*365.2425,O=C/12,ee=O*3,b=Symbol.for("constructDateFrom");function l(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&b in t?t[b](e):t instanceof Date?new t.constructor(e):new Date(e)}function se(t,e){return l(e||t,t)}function ue(t,...e){let n=l.bind(null,t||e.find(o=>typeof o=="object"));return e.map(n)}export{M as a,z as b,P as c,Q as d,G as e,J as f,K as g,X as h,Z as i,l as j,se as k,ue as l};
