"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../_util/props-util/index.js");function f(i){const{key:l,children:d,props:{value:e,disabled:n,...o}}=i,t=d?.default;return{key:l,value:e!==void 0?e:l,children:t,disabled:n||n==="",...o}}function s(i,l=!1){return c.flattenChildren(i).map((e,n)=>{if(!c.isValidElement(e)||!e.type)return null;const{type:{isSelectOptGroup:o},key:t,children:r,props:a}=e;if(l||!o)return f(e);const u=r&&r.default?r.default():void 0,p=a?.label||r.label?.()||t;return{key:`__RC_SELECT_GRP__${t===null?n:String(t)}__`,...a,label:p,options:s(u||[])}}).filter(e=>e)}exports.convertChildrenToData=s;
