import{b as j,t as k}from"./index.Ddm4CqKS.js";import{I as q}from"./scheduler.VqJF7Vna.js";function E(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function z(n,d){j(n,1,1,()=>{d.delete(n.key)})}function F(n,d){n.f(),z(n,d)}function G(n,d,x,B,S,g,o,A,p,I,a,b){let i=n.length,f=g.length,c=i;const u={};for(;c--;)u[n[c].key]=c;const h=[],w=new Map,m=new Map,_=[];for(c=f;c--;){const e=b(S,g,c),s=x(e);let t=o.get(s);t?_.push(()=>t.p(e,d)):(t=I(s,e),t.c()),w.set(s,h[c]=t),s in u&&m.set(s,Math.abs(c-u[s]))}const M=new Set,v=new Set;function y(e){k(e,1),e.m(A,a),o.set(e.key,e),a=e.first,f--}for(;i&&f;){const e=h[f-1],s=n[i-1],t=e.key,l=s.key;e===s?(a=e.first,i--,f--):w.has(l)?!o.has(t)||M.has(t)?y(e):v.has(l)?i--:m.get(t)>m.get(l)?(v.add(t),y(e)):(M.add(l),i--):(p(s,o),i--)}for(;i--;){const e=n[i];w.has(e.key)||p(e,o)}for(;f;)y(h[f-1]);return q(_),h}export{E as e,F as f,z as o,G as u};
//# sourceMappingURL=each.COPsAJmc.js.map
