import{o as a,d as _,q as p,v as d,b as m,c as l,w as g,x as h}from"./BnUNjuXp.js";function v(e,n,t){if(e==null)return n(void 0),a;const s=_(()=>e.subscribe(n,t));return s.unsubscribe?()=>s.unsubscribe():s}const o=[];function y(e,n){return{subscribe:x(e,n).subscribe}}function x(e,n=a){let t=null;const s=new Set;function r(c){if(p(e,c)&&(e=c,t)){const b=!o.length;for(const u of s)u[1](),o.push(u,e);if(b){for(let u=0;u<o.length;u+=2)o[u][0](o[u+1]);o.length=0}}}function i(c){r(c(e))}function f(c,b=a){const u=[c,b];return s.add(u),s.size===1&&(t=n(r,i)||a),c(e),()=>{s.delete(u),s.size===0&&t&&(t(),t=null)}}return{set:r,update:i,subscribe:f}}function z(e){let n;return v(e,t=>n=t)(),n}function E(e){l===null&&d(),g&&l.l!==null?w(l).m.push(e):m(()=>{const n=_(e);if(typeof n=="function")return n})}function q(e,n,{bubbles:t=!1,cancelable:s=!1}={}){return new CustomEvent(e,{detail:n,bubbles:t,cancelable:s})}function $(){const e=l;return e===null&&d(),(n,t,s)=>{const r=e.s.$$events?.[n];if(r){const i=h(r)?r.slice():[r],f=q(n,t,s);for(const c of i)c.call(e.x,f);return!f.defaultPrevented}return!0}}function w(e){var n=e.l;return n.u??={a:[],b:[],m:[]}}export{$ as c,z as g,E as o,y as r,v as s,x as w};
