1 line
903 B
JavaScript
1 line
903 B
JavaScript
import{t as z,a as B}from"./index-3a0d73e3.js";import{r as C}from"./utils-6ebe0a8e.js";function G(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function D(n,d){z(n,1,1,()=>{d.delete(n.key)})}function H(n,d){n.f(),D(n,d)}function I(n,d,x,S,A,g,o,j,p,k,a,q){let i=n.length,c=g.length,f=i;const u={};for(;f--;)u[n[f].key]=f;const h=[],w=new Map,m=new Map,_=[];for(f=c;f--;){const e=q(A,g,f),s=x(e);let t=o.get(s);t?S&&_.push(()=>t.p(e,d)):(t=k(s,e),t.c()),w.set(s,h[f]=t),s in u&&m.set(s,Math.abs(f-u[s]))}const M=new Set,v=new Set;function y(e){B(e,1),e.m(j,a),o.set(e.key,e),a=e.first,c--}for(;i&&c;){const e=h[c-1],s=n[i-1],t=e.key,l=s.key;e===s?(a=e.first,i--,c--):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(;c;)y(h[c-1]);return C(_),h}export{G as e,H as f,D as o,I as u};
|