import{a1asa,nasw,amasq,oasx}from"./nyjtQ1Ok.js";function_(e,t,n){if(e==null)returnt(void0),n&&n(void0),a;constr=w(()=>e.subscribe(t,n));returnr.unsubscribe?()=>r.unsubscribe():r}constf=[];functionz(e,t){return{subscribe:A(e,t).subscribe}}functionA(e,t=a){letn=null;constr=newSet;functioni(u){if(q(e,u)&&(e=u,n)){consto=!f.length;for(constsofr)s[1](),f.push(s,e);if(o){for(lets=0;s<f.length;s+=2)f[s][0](f[s+1]);f.length=0}}}functionb(u){i(u(e))}functionl(u,o=a){consts=[u,o];returnr.add(s),r.size===1&&(n=t(i,b)||a),u(e),()=>{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:b,subscribe:l}}functionB(e,t,n){constr=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))thrownewError("derived() expects stores as input, got a falsy value");constb=t.length<2;returnz(n,(l,u)=>{leto=!1;consts=[];letd=0,p=a;consty=()=>{if(d)return;p();constc=t(r?s[0]:s,l,u);b?l(c):p=typeofc=="function"?c:a},h=i.map((c,g)=>_(c,m=>{s[g]=m,d&=~(1<<g),o&&y()},()=>{d|=1<<g}));returno=!0,y(),function(){x(h),p(),o=!1}})}functionE(e){lett;return_(e,n=>t=n)(),t}export{Basd,Easg,_ass,Aasw};