import{nasf,sasw,rasm,aasq,iasx}from"./index-C1iGU3rq.js";consta=[];functionz(e,o){return{subscribe:A(e,o).subscribe}}functionA(e,o=f){letn;constr=newSet;functionu(t){if(q(e,t)&&(e=t,n)){consti=!a.length;for(constsofr)s[1](),a.push(s,e);if(i){for(lets=0;s<a.length;s+=2)a[s][0](a[s+1]);a.length=0}}}functionl(t){u(t(e))}functionb(t,i=f){consts=[t,i];returnr.add(s),r.size===1&&(n=o(u,l)||f),t(e),()=>{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:u,update:l,subscribe:b}}functionE(e,o,n){constr=!Array.isArray(e),u=r?[e]:e;if(!u.every(Boolean))thrownewError("derived() expects stores as input, got a falsy value");constl=o.length<2;returnz(n,(b,t)=>{leti=!1;consts=[];letd=0,p=f;consth=()=>{if(d)return;p();constc=o(r?s[0]:s,b,t);l?b(c):p=x(c)?c:f},y=u.map((c,g)=>w(c,_=>{s[g]=_,d&=~(1<<g),i&&h()},()=>{d|=1<<g}));returni=!0,h(),function(){m(y),p(),i=!1}})}export{Easd,zasr,Aasw};