import{h as e}from"./p-fdd3ce28.js";import{v as t,d as a}from"./p-29ab64f2.js";const l=(l,o)=>{let s="";const n=()=>({el:l.el,disabled:l.disabled,hasFocus:l.hasFocus,hover:l.hover,label:l.label,tooltip:l.tooltip,validation:l.validation,info:l.info}),r=async(e=!1)=>{const a=n();if(!a.validation)return i([]);const l={label:a.label||"",name:a.name||""},o=await t.validate(a.validation,a.el,l);return i(o,e)},i=(e,t=!1)=>(s=e.length?e[0].message:"",!t&&o&&o(s),e),c=a(r,1e3);return Object.assign((t,a)=>{const l=n();return[null!=l.label&&e("bce-label",{disabled:l.disabled,hasFocus:l.hasFocus,tooltip:l.tooltip,"data-hover":l.hover},l.label,e("slot",{name:"label"})),a,(s||l.info)&&e("small",null,s||l.info)]},{getProps:n,handleInput:()=>{s?r():c()},reset:()=>i([]),validate:r})};export{l as g};