import{r as e,h as t,g as r}from"./p-aee8b1df.js";const i=class{constructor(t){e(this,t)}async validate(e=!1){const t=this.el.shadowRoot.querySelectorAll("bce-input"),r=Array.from(t),i=await Promise.all(r.map(t=>t.validate(e)));return[].concat(...i)}isSelect(e){return"radio"===e.type}renderInput(e){return t("bce-input",{id:e.id,key:e.id,label:e.label,type:e.type,validation:e.required?"required":void 0})}renderSelect(e){return t("bce-select",{id:e.id,key:e.id,label:e.label,type:e.type,validation:e.required?"required":void 0},(e.options||[]).map((e,r)=>t("bce-option",{key:r,value:e},e)))}render(){return this.template.input.map(e=>this.isSelect(e)?this.renderSelect(e):this.renderInput(e))}get el(){return r(this)}static get style(){return":host{position:relative;display:block}"}};export{i as bce_element_form};