import{nasb,Aasw,xasm,sasq,Basx}from"./scheduler.7_EeBW2g.js";consta=[];functionA(s,u){return{subscribe:z(s,u).subscribe}}functionz(s,u=b){lett;constr=newSet;functiono(n){if(q(s,n)&&(s=n,t)){consti=!a.length;for(consteofr)e[1](),a.push(e,s);if(i){for(lete=0;e<a.length;e+=2)a[e][0](a[e+1]);a.length=0}}}functionf(n){o(n(s))}functionl(n,i=b){conste=[n,i];returnr.add(e),r.size===1&&(t=u(o,f)||b),n(s),()=>{r.delete(e),r.size===0&&t&&(t(),t=null)}}return{set:o,update:f,subscribe:l}}functionE(s,u,t){constr=!Array.isArray(s),o=r?[s]:s;if(!o.every(Boolean))thrownewError("derived() expects stores as input, got a falsy value");constf=u.length<2;returnA(t,(l,n)=>{leti=!1;conste=[];letd=0,p=b;consty=()=>{if(d)return;p();constc=u(r?e[0]:e,l,n);f?l(c):p=x(c)?c:b},h=o.map((c,g)=>w(c,_=>{e[g]=_,d&=~(1<<g),i&&y()},()=>{d|=1<<g}));returni=!0,y(),function(){m(h),p(),i=!1}})}functionS(s){return{subscribe:s.subscribe.bind(s)}}export{Sasa,Easd,Aasr,zasw};