import{shallowRef as o,watch as d,toRaw as g,watchEffect as h}from"vue";import{convertChildrenToData as b}from"../utils/legacyUtil.mjs";function V(a,s,w){const u=o(),i=o(),p=o(),n=o([]);return d([a,s],()=>{a.value?n.value=g(a.value).slice():n.value=b(s.value)},{immediate:!0,deep:!0}),h(()=>{const c=n.value,r=new Map,f=new Map,t=w.value;function v(m,O=!1){for(let l=0;l<m.length;l+=1){const e=m[l];!e[t.options]||O?(r.set(e[t.value],e),f.set(e[t.label],e)):v(e[t.options],!0)}}v(c),u.value=c,i.value=r,p.value=f}),{options:u,valueOptions:i,labelOptions:p}}export{V as default};
