var _=Object.defineProperty;var B=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var K=(e,o,s)=>o in e?_(e,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[o]=s,k=(e,o)=>{for(var s in o||(o={}))j.call(o,s)&&K(e,s,o[s]);if(B)for(var s of B(o))q.call(o,s)&&K(e,s,o[s]);return e};import{u as f,ah as E,b_ as A}from"./index-f4658ae7.js";function z(e,o){function s(h){const t=[],n=h||f(e),{key:c,children:r}=f(o);if(!r||!c)return t;for(let l=0;l{if(i[r]===h)return i[l]=i[l]||[],i[l][n](t),!0}),e.value=c)}function S({parentKey:h=null,list:t,push:n="push"}){const c=E(f(e));if(!(!t||t.length<1))if(h){const{key:r,children:l}=f(o);if(!l||!r)return;A(c,i=>{if(i[r]===h){i[l]=i[l]||[];for(let u=0;u{if(n!=null&&n.key||(n==null?void 0:n.key)===0)return n;if(r.key===h){n=r;return}r.children&&r.children.length&&(n=a(h,r.children,n))}),n||null)}return{deleteNodeByKey:b,insertNodeByKey:C,insertNodesByKey:S,filterByLevel:x,updateNodeByKey:F,getAllKeys:s,getChildrenKeys:p,getEnabledKeys:g,getSelectedNode:a}}export{z as useTree};