import{r as m,_ as y,R as a,c as N,P as e}from"./index-sga-FecS.js";const g=m.forwardRef((l,o)=>{var{children:n,as:r="div",className:t,invalid:s,tooltip:i,valid:p}=l,f=y(l,["children","as","className","invalid","tooltip","valid"]);return a.createElement(r,Object.assign({className:N({[`invalid-${i?"tooltip":"feedback"}`]:s,[`valid-${i?"tooltip":"feedback"}`]:p},t)},f,{ref:o}),n)});g.propTypes={as:e.elementType,children:e.node,className:e.string,invalid:e.bool,tooltip:e.bool,valid:e.bool};g.displayName="CFormFeedback";const F=({describedby:l,feedback:o,feedbackInvalid:n,feedbackValid:r,invalid:t,tooltipFeedback:s,valid:i})=>a.createElement(a.Fragment,null,o&&(i||t)&&a.createElement(g,Object.assign({},t&&{id:l},{invalid:t,tooltip:s,valid:i}),o),n&&a.createElement(g,{id:l,invalid:!0,tooltip:s},n),r&&a.createElement(g,{valid:!0,tooltip:s},r));F.propTypes={describedby:e.string,feedback:e.oneOfType([e.node,e.string]),feedbackValid:e.oneOfType([e.node,e.string]),feedbackInvalid:e.oneOfType([e.node,e.string]),invalid:e.bool,tooltipFeedback:e.bool,valid:e.bool};F.displayName="CFormControlValidation";const u=m.forwardRef((l,o)=>{var{children:n,className:r,customClassName:t}=l,s=y(l,["children","className","customClassName"]);return a.createElement("label",Object.assign({className:t??N("form-label",r)},s,{ref:o}),n)});u.propTypes={children:e.node,className:e.string,customClassName:e.string};u.displayName="CFormLabel";const O=m.forwardRef((l,o)=>{var{children:n,className:r}=l,t=y(l,["children","className"]);return a.createElement("div",Object.assign({className:N("form-floating",r)},t,{ref:o}),n)});O.propTypes={children:e.node,className:e.string};O.displayName="CFormFloating";const T=m.forwardRef((l,o)=>{var{children:n,as:r="div",className:t}=l,s=y(l,["children","as","className"]);return a.createElement(r,Object.assign({className:N("form-text",t)},s,{ref:o}),n)});T.propTypes={as:e.elementType,children:e.node,className:e.string};T.displayName="CFormText";const E=({children:l,describedby:o,feedback:n,feedbackInvalid:r,feedbackValid:t,floatingClassName:s,floatingLabel:i,id:p,invalid:f,label:b,text:c,tooltipFeedback:v,valid:h})=>{const d=()=>a.createElement(F,{describedby:o,feedback:n,feedbackInvalid:r,feedbackValid:t,floatingLabel:i,invalid:f,tooltipFeedback:v,valid:h});return i?a.createElement(O,{className:s},l,a.createElement(u,{htmlFor:p},b||i),c&&a.createElement(T,{id:o},c),a.createElement(d,null)):a.createElement(a.Fragment,null,b&&a.createElement(u,{htmlFor:p},b),l,c&&a.createElement(T,{id:o},c),a.createElement(d,null))};E.propTypes=Object.assign({children:e.node,floatingClassName:e.string,floatingLabel:e.oneOfType([e.node,e.string]),label:e.oneOfType([e.node,e.string]),text:e.oneOfType([e.node,e.string])},F.propTypes);E.displayName="CFormControlWrapper";const R=m.forwardRef((l,o)=>{var{children:n,className:r,delay:t=!1,feedback:s,feedbackInvalid:i,feedbackValid:p,floatingClassName:f,floatingLabel:b,id:c,invalid:v,label:h,onChange:d,plainText:w,size:x,text:L,tooltipFeedback:z,type:j="text",valid:V}=l,I=y(l,["children","className","delay","feedback","feedbackInvalid","feedbackValid","floatingClassName","floatingLabel","id","invalid","label","onChange","plainText","size","text","tooltipFeedback","type","valid"]);const[k,$]=m.useState();return m.useEffect(()=>{const C=setTimeout(()=>k&&d&&d(k),typeof t=="number"?t:500);return()=>clearTimeout(C)},[k]),a.createElement(E,{describedby:I["aria-describedby"],feedback:s,feedbackInvalid:i,feedbackValid:p,floatingClassName:f,floatingLabel:b,id:c,invalid:v,label:h,text:L,tooltipFeedback:z,valid:V},a.createElement("input",Object.assign({className:N(w?"form-control-plaintext":"form-control",{[`form-control-${x}`]:x,"form-control-color":j==="color","is-invalid":v,"is-valid":V},r),id:c,type:j,onChange:C=>t?$(C):d&&d(C)},I,{ref:o}),n))});R.propTypes=Object.assign({className:e.string,id:e.string,delay:e.oneOfType([e.bool,e.number]),plainText:e.bool,size:e.oneOf(["sm","lg"]),type:e.oneOfType([e.oneOf(["color","file","text"]),e.string])},E.propTypes);R.displayName="CFormInput";export{R as C,u as a,E as b};
