You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
701 B

var f=(e,u,n)=>new Promise((r,c)=>{var t=s=>{try{o(n.next(s))}catch(a){c(a)}},i=s=>{try{o(n.throw(s))}catch(a){c(a)}},o=s=>s.done?r(s.value):Promise.resolve(s.value).then(t,i);o((n=n.apply(e,u)).next())});import{f as l,u as y,au as K,K as v,ap as O,co as b,cn as m}from"./index-f4658ae7.js";function h(e,u,n,r,c){const t=K(i,50);function i(s){return f(this,null,function*(){const a=!r.value,p=v(u.value);O(()=>{if((p==null?void 0:p.length)===0){e.activeSubMenuNames=[],e.openNames=[];return}const N=b(p,s);y(n)?e.openNames=N:e.openNames=m([...e.openNames,...N]),e.activeSubMenuNames=e.openNames},30,a)})}const o=l(()=>y(c)?[]:e.openNames);return{setOpenKeys:t,getOpenKeys:o}}export{h as useOpenKeys};