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