"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("@aplus-frontend/antdv"),f=require("lodash-unified"),g={key:0},B=e.defineComponent({name:"ApFieldCascaderRead",__name:"read",props:{mode:{default:"read"},class:{},style:{},emptyText:{default:"--"},customReadMode:{},multiple:{type:Boolean},size:{},bordered:{type:Boolean},placement:{},suffixIcon:{},status:{},options:{},popupClassName:{},dropdownClassName:{},"onUpdate:value":{},variant:{},value:{},children:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},open:{type:Boolean},animation:{},direction:{},disabled:{type:Boolean},prefixCls:{},id:{},autofocus:{type:Boolean},getPopupContainer:{},dropdownMatchSelectWidth:{type:[Number,Boolean]},placeholder:{},loading:{type:Boolean},defaultValue:{},prefix:{},clearIcon:{},allowClear:{type:Boolean},getInputElement:{},getRawInputElement:{},fieldNames:{},searchValue:{},onSearch:{},maxCount:{},showSearch:{type:[Boolean,Object]},tagRender:{},optionLabelRender:{},notFoundContent:{},onClear:{},choiceTransitionName:{},defaultOpen:{type:Boolean},onDropdownVisibleChange:{},maxTagTextLength:{},maxTagCount:{},maxTagPlaceholder:{},removeIcon:{},transitionName:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showAction:{},onPopupScroll:{},onInputKeyDown:{},onPopupVisibleChange:{},popupStyle:{},popupPlacement:{},popupVisible:{type:Boolean},expandIcon:{},changeOnSelect:{type:Boolean},displayRender:{},showCheckedStrategy:{},expandTrigger:{},dropdownPrefixCls:{},dropdownMenuColumnStyle:{},loadingIcon:{},request:{},lazy:{type:Boolean},params:{},loadData:{type:Boolean}},setup(d){const a=d,i=e.computed(()=>{const n=e.unref(a.value);if(!n?.length)return[];const u=a.fieldNames?.label||"label",p=a.fieldNames?.value||"value";function l(s,o){const t=[];for(const r of s||[]){if(o.find(h=>h===r[p])&&t.push(r[u]),t.length===o.length)return t;r.children?.length&&t.push(...l(r.children,o))}return t}const c=[],m=f.isArray(n[0])?n:[n];for(const s of m){const o=l(a.options,s);o.length&&c.push(o)}return c});return(n,u)=>i.value.length?(e.openBlock(),e.createBlock(e.unref(y.Space),{key:1,size:4},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(p,l)=>(e.openBlock(),e.createElementBlock("span",{key:l},e.toDisplayString(p.join(", ")),1))),128))]),_:1})):(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(d.emptyText),1))}});exports.default=B;
