{l(),qh(this)},{checked:t!==!1});return}else l()}const i=this.parent;!i||i.level===0||s||qh(i)}getChildren(t=!1){if(this.level===0)return this.data;const n=this.data;if(!n)return null;const s=this.store.props;let r="children";return s&&(r=s.children||"children"),n[r]===void 0&&(n[r]=null),t&&!n[r]&&(n[r]=[]),n[r]}updateChildren(){const t=this.getChildren()||[],n=this.childNodes.map(i=>i.data),s={},r=[];t.forEach((i,o)=>{const a=i[Fl];!!a&&n.findIndex(u=>u[Fl]===a)>=0?s[a]={index:o,data:i}:r.push({index:o,data:i})}),this.store.lazy||n.forEach(i=>{s[i[Fl]]||this.removeChildByData(i)}),r.forEach(({index:i,data:o})=>{this.insertChild({data:o},i)}),this.updateLeafState()}loadData(t,n={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(n).length)){this.loading=!0;const s=r=>{this.childNodes=[],this.doCreateChildren(r,n),this.loaded=!0,this.loading=!1,this.updateLeafState(),t&&t.call(this,r)};this.store.load(this,s)}else t&&t.call(this)}};class _fe{constructor(t){this.currentNode=null,this.currentNodeKey=null;for(const n in t)Vt(t,n)&&(this[n]=t[n]);this.nodesMap={}}initialize(){if(this.root=new _y({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const t=this.load;t(this.root,n=>{this.root.doCreateChildren(n),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(t){const n=this.filterNodeMethod,s=this.lazy,r=function(i){const o=i.root?i.root.childNodes:i.childNodes;if(o.forEach(a=>{a.visible=n.call(a,t,a.data,a),r(a)}),!i.visible&&o.length){let a=!0;a=!o.some(l=>l.visible),i.root?i.root.visible=a===!1:i.visible=a===!1}t&&i.visible&&!i.isLeaf&&!s&&i.expand()};r(this)}setData(t){t!==this.root.data?(this.root.setData(t),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(t){if(t instanceof _y)return t;const n=$t(t)?e1(this.key,t):t;return this.nodesMap[n]||null}insertBefore(t,n){const s=this.getNode(n);s.parent.insertBefore({data:t},s)}insertAfter(t,n){const s=this.getNode(n);s.parent.insertAfter({data:t},s)}remove(t){const n=this.getNode(t);n&&n.parent&&(n===this.currentNode&&(this.currentNode=null),n.parent.removeChild(n))}append(t,n){const s=n?this.getNode(n):this.root;s&&s.insertChild({data:t})}_initDefaultCheckedNodes(){const t=this.defaultCheckedKeys||[],n=this.nodesMap;t.forEach(s=>{const r=n[s];r&&r.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(t){(this.defaultCheckedKeys||[]).includes(t.key)&&t.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(t){t!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=t,this._initDefaultCheckedNodes())}registerNode(t){const n=this.key;!t||!t.data||(n?t.key!==void 0&&(this.nodesMap[t.key]=t):this.nodesMap[t.id]=t)}deregisterNode(t){!this.key||!t||!t.data||(t.childNodes.forEach(s=>{this.deregisterNode(s)}),delete this.nodesMap[t.key])}getCheckedNodes(t=!1,n=!1){const s=[],r=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(a=>{(a.checked||n&&a.indeterminate)&&(!t||t&&a.isLeaf)&&s.push(a.data),r(a)})};return r(this),s}getCheckedKeys(t=!1){return this.getCheckedNodes(t).map(n=>(n||{})[this.key])}getHalfCheckedNodes(){const t=[],n=function(s){(s.root?s.root.childNodes:s.childNodes).forEach(i=>{i.indeterminate&&t.push(i.data),n(i)})};return n(this),t}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(t=>(t||{})[this.key])}_getAllNodes(){const t=[],n=this.nodesMap;for(const s in n)Vt(n,s)&&t.push(n[s]);return t}updateChildren(t,n){const s=this.nodesMap[t];if(!s)return;const r=s.childNodes;for(let i=r.length-1;i>=0;i--){const o=r[i];this.remove(o.data)}for(let i=0,o=n.length;i