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