import{x as H,y as K,z as O,w as N,A as Q,B as W,a as V,d as Z,C as $,H as P,E as Y,F as k,G as b,I as j,J as ee,K as B,M as re,N as C,O as D,Q as ne,R as L,v as fe,T as y,U as ae,V as le,W as ie,X as se,Y as X,Z as q,_ as z,$ as ue,a0 as oe,a1 as te}from"./CYSP8FLW.js";function ge(e,a){return a}function ve(e,a,l){for(var v=[],g=a.length,s,i=a.length,n=0;n<g;n++){let u=a[n];q(u,()=>{if(s){if(s.pending.delete(u),s.done.add(u),s.pending.size===0){var d=e.outrogroups;F(y(s.done)),d.delete(s),d.size===0&&(e.outrogroups=null)}}else i-=1},!1)}if(i===0){var o=v.length===0&&l!==null;if(o){var f=l,t=f.parentNode;oe(t),t.append(f),e.items.clear()}F(a,!o)}else s={pending:new Set(a),done:new Set},(e.outrogroups??=new Set).add(s)}function F(e,a=!0){for(var l=0;l<e.length;l++)te(e[l],a)}var U;function he(e,a,l,v,g,s=null){var i=e,n=new Map;{var o=e;i=N?O(Q(o)):o.appendChild(H())}N&&W();var f=null,t=Z(()=>{var c=l();return ae(c)?c:c==null?[]:y(c)}),u,d=!0;function x(){_.fallback=f,de(_,u,i,a,v),f!==null&&(u.length===0?(f.f&C)===0?X(f):(f.f^=C,S(f,null,i)):q(f,()=>{f=null}))}var r=K(()=>{u=V(t);var c=u.length;let T=!1;if(N){var h=$(i)===P;h!==(c===0)&&(i=Y(),O(i),k(!1),T=!0)}for(var M=new Set,m=re,I=ne(),w=0;w<c;w+=1){N&&b.nodeType===j&&b.data===ee&&(i=b,T=!0,k(!1));var R=u[w],p=v(R,w),E=d?null:n.get(p);E?(E.v&&B(E.v,R),E.i&&B(E.i,w),I&&m.skipped_effects.delete(E.e)):(E=ce(n,d?i:U??=H(),R,p,w,g,a,l),d||(E.e.f|=C),n.set(p,E)),M.add(p)}if(c===0&&s&&!f&&(d?f=D(()=>s(i)):(f=D(()=>s(U??=H())),f.f|=C)),N&&c>0&&O(Y()),!d)if(I){for(const[G,J]of n)M.has(G)||m.skipped_effects.add(J.e);m.oncommit(x),m.ondiscard(()=>{})}else x();T&&k(!0),V(t)}),_={effect:r,items:n,outrogroups:null,fallback:f};d=!1,N&&(i=b)}function de(e,a,l,v,g){var s=a.length,i=e.items,n=e.effect.first,o,f=null,t=[],u=[],d,x,r,_;for(_=0;_<s;_+=1){if(d=a[_],x=g(d,_),r=i.get(x).e,e.outrogroups!==null)for(const p of e.outrogroups)p.pending.delete(r),p.done.delete(r);if((r.f&C)!==0)if(r.f^=C,r===n)S(r,null,l);else{var c=f?f.next:n;r===e.effect.last&&(e.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),A(e,f,r),A(e,r,c),S(r,c,l),f=r,t=[],u=[],n=f.next;continue}if((r.f&z)!==0&&X(r),r!==n){if(o!==void 0&&o.has(r)){if(t.length<u.length){var T=u[0],h;f=T.prev;var M=t[0],m=t[t.length-1];for(h=0;h<t.length;h+=1)S(t[h],T,l);for(h=0;h<u.length;h+=1)o.delete(u[h]);A(e,M.prev,m.next),A(e,f,M),A(e,m,T),n=T,f=m,_-=1,t=[],u=[]}else o.delete(r),S(r,n,l),A(e,r.prev,r.next),A(e,r,f===null?e.effect.first:f.next),A(e,f,r),f=r;continue}for(t=[],u=[];n!==null&&n!==r;)(o??=new Set).add(n),u.push(n),n=n.next;if(n===null)continue}(r.f&C)===0&&t.push(r),f=r,n=r.next}if(e.outrogroups!==null){for(const p of e.outrogroups)p.pending.size===0&&(F(y(p.done)),e.outrogroups?.delete(p));e.outrogroups.size===0&&(e.outrogroups=null)}if(n!==null||o!==void 0){var I=[];if(o!==void 0)for(r of o)(r.f&z)===0&&I.push(r);for(;n!==null;)(n.f&z)===0&&n!==e.fallback&&I.push(n),n=n.next;var w=I.length;if(w>0){var R=s===0?l:null;ve(e,I,R)}}}function ce(e,a,l,v,g,s,i,n){var o=(i&le)!==0?(i&ie)===0?fe(l,!1,!1):L(l):null,f=(i&se)!==0?L(g):null;return{v:o,i:f,e:D(()=>(s(a,o??l,f??g,n),()=>{e.delete(v)}))}}function S(e,a,l){if(e.nodes)for(var v=e.nodes.start,g=e.nodes.end,s=a&&(a.f&C)===0?a.nodes.start:l;v!==null;){var i=ue(v);if(s.before(v),v===g)return;v=i}}function A(e,a,l){a===null?e.effect.first=l:a.next=l,l===null?e.effect.last=a:l.prev=a}export{he as e,ge as i};
