import{computed as e}from"vue";var t=`__rc_cascader_search_mark__`,n=(e,t,{label:n})=>t.some(t=>String(t[n]).toLowerCase().includes(e.toLowerCase())),r=({path:e,fieldNames:t})=>e.map(e=>e[t.label]).join(` / `),i=(i,a,o,s,c,l)=>e(()=>{let{filter:e=n,render:u=r,limit:d=50,sort:f}=c.value,p=[];if(!i.value)return[];function m(n,r){n.forEach(n=>{if(!f&&d>0&&p.length>=d)return;let a=[...r,n],c=n[o.value.children];(!c||c.length===0||l.value)&&e(i.value,a,{label:o.value.label})&&p.push({...n,[o.value.label]:u({inputValue:i.value,path:a,prefixCls:s.value,fieldNames:o.value}),[t]:a}),c&&m(n[o.value.children],a)})}return m(a.value,[]),f&&p.sort((e,n)=>f(e[t],n[t],i.value,o.value)),d>0?p.slice(0,d):p});export{t as SEARCH_MARK,i as default};