import{computed as d}from"vue";import{isValidElement as f}from"../../_util/props-util/index.mjs";import{cloneElement as v}from"../../_util/vnode.mjs";import{toPathKey as y}from"../utils/commonUtil.mjs";import{toPathOptions as b}from"../utils/treeUtil.mjs";const h=(m,i,a,p,l)=>d(()=>{const c=l.value||(({labels:t})=>{const r=p.value?t.slice(-1):t,n=" / ";return r.every(o=>["string","number"].includes(typeof o))?r.join(n):r.reduce((o,e,u)=>{const s=f(e)?v(e,{key:u}):e;return u===0?[s]:[...o,n,s]},[])});return m.value.map(t=>{const r=b(t,i.value,a.value),n=c({labels:r.map(({option:e,value:u})=>e?.[a.value.label]??u),selectedOptions:r.map(({option:e})=>e)}),o=y(t);return{label:n,value:o,key:o,valueCells:t}})});export{h as default};
