import{r as e,c as r,a,h as t,d as s}from"./p-wX3eJOEL.js";import{i}from"./p-CtINY9El.js";import{d as o,t as p}from"./p-DNHOWgWh.js";const l=class{constructor(a){e(this,a),this.ifxInput=r(this,"ifxInput",7),a.$hostElement$["s-ei"]?this.internals=a.$hostElement$["s-ei"]:(this.internals=a.$hostElement$.attachInternals(),a.$hostElement$["s-ei"]=this.internals)}inputId="ifx-textarea-"+ ++d;internals;ifxInput;get el(){return a(this)}caption;cols;disabled=!1;error=!1;label;maxlength;name;placeholder;required=!1;readOnly=!1;resize="both";rows;value;wrap="soft";fullWidth="false";async reset(){this.resetTextarea()}handleComponentWidth(){const e=this.el.shadowRoot.querySelector(".wrapper__textarea");"true"===this.fullWidth.toLowerCase()?e.classList.add("fullWidth"):e.classList.contains("fullWidth")&&e.classList.remove("fullWidth")}componentDidRender(){this.handleComponentWidth()}formResetCallback(){this.resetTextarea()}handleOnInput(e){this.value=e.target.value,this.ifxInput.emit(this.value)}resetTextarea(){this.value=""}async componentDidLoad(){if(!i(this.el)){const e=o();p("ifx-textarea",await e)}}render(){return t(s,{key:"bb5760e994c83d00aed582063c6f36ad8250f68c",class:`wrapper--${this.error?"error":""} wrapper--${this.disabled&&!this.error?"disabled":""}`},t("label",{key:"acf8813be71b292fa6510ca911638021c4a6fa6c",class:"wrapper__label",htmlFor:this.inputId},this.label?.trim(),this.required&&t("span",{key:"1841f106b4c766842c4682d164885e1b3d6919cb",class:"required "+(this.error?"error":"")},"*")),t("div",{key:"55fce236fb5a6fa432dfe236c2a1143bf1802232",class:"wrapper__textarea"},t("textarea",{key:"cb54b8271a488ae10bd1ef93537d3c5cf306f155","aria-label":"a textarea","aria-value":this.value,"aria-disabled":this.disabled&&!this.error,id:this.inputId,style:{resize:this.resize},name:this.name?this.name:this.inputId,cols:this.cols,rows:this.rows,maxlength:this.maxlength,wrap:this.wrap,disabled:this.disabled&&!this.error,readonly:this.readOnly,placeholder:this.placeholder,value:this.value,onInput:e=>this.handleOnInput(e)})),this.caption?.trim()&&t("div",{key:"e5ea69d8f3406c53c19f5277817cd74a3475c376",class:"wrapper__caption"},this.caption.trim()))}};let d=0;l.style=':host{display:flex;flex-direction:column;width:100%}.wrapper__label{color:#1D1D1D;font:400 1rem/1.5rem "Source Sans 3"}.wrapper__label .required{margin-left:4px}.wrapper__label .required.error{color:#CD002F}:host(.wrapper--disabled) .wrapper__label{color:#BFBBBB}.wrapper__textarea{width:100%}.wrapper__textarea.fullWidth{width:100%}.wrapper__textarea.fullWidth textarea{width:100%;box-sizing:border-box}.wrapper__textarea textarea{border:1px solid #8D8786;border-radius:1px;padding:8px 16px;background-color:#FFFFFF;color:#1D1D1D;font:400 1rem/1.5rem "Source Sans 3";transition:all 100ms ease;transition-property:border-color}.wrapper__textarea textarea:hover{border:1px solid #575352}.wrapper__textarea textarea:focus-within{outline:2px solid #0A8276;outline-offset:0}:host(.wrapper--error) .wrapper__textarea textarea{border:1px solid #CD002F}:host(.wrapper--disabled) .wrapper__textarea textarea{border:1px solid #BFBBBB;background-color:#BFBBBB;color:#FFFFFF}:host(.wrapper--disabled) .wrapper__textarea textarea::placeholder{color:#FFFFFF}.wrapper__caption{color:#1D1D1D;font:400 0.75rem/1rem "Source Sans 3"}:host(.wrapper--error) .wrapper__caption{color:#CD002F}:host(.wrapper--disabled) .wrapper__caption{color:#BFBBBB}';export{l as ifx_textarea}