/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import { r as registerInstance, c as createEvent, i as forceUpdate, w as writeTask, h, d as Host, g as getElement } from './index-gD7P82jx.js';
import { c as createNotchController } from './notch-controller-CEiB8plC.js';
import { c as checkInvalidState, r as reportValidityToElementInternals } from './validity-BjW8SOqw.js';
import { d as debounceEvent, i as inheritAriaAttributes, b as inheritAttributes, c as componentOnReady } from './helpers-6l6yFg3S.js';
import { c as createSlotMutationController, g as getCounterText } from './input.utils-C3tJs_iL.js';
import { h as hostContext, c as createColorClasses } from './theme-DaJxRxSQ.js';
import { c as getIonTheme } from './ionic-global-KnoA5TnE.js';
import './focus-visible-vXpMhGrs.js';

const textareaIonicCss = ":host{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--padding-top:0;--padding-end:0;--padding-start:0;--border-radius:0;--border-style:solid;--highlight-color:var(--highlight-color-focused);display:block;position:relative;width:100%;color:var(--color);-webkit-box-sizing:border-box;box-sizing:border-box}:host([cols]:not([auto-grow])){width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host(.ion-color){background:initial}:host(.in-item){-ms-flex-item-align:baseline;align-self:baseline}:host(.in-item[slot=start]),:host(.in-item[slot=end]){width:auto}.native-textarea{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;white-space:pre-wrap;z-index:1;-webkit-box-sizing:border-box;box-sizing:border-box;resize:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.native-textarea::-webkit-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea::-moz-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea:-ms-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea::-ms-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;grid-area:1/1/2/2;word-break:break-word}.cloned-input{top:0;bottom:0;position:absolute;pointer-events:none}.cloned-input{inset-inline-start:0}.cloned-input:disabled{opacity:1}:host([auto-grow]) .cloned-input{height:100%}:host([auto-grow]) .native-textarea{overflow:hidden}.textarea-wrapper{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:0px;padding-bottom:0px;border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:start;align-items:flex-start;height:inherit;min-height:inherit;-webkit-transition:background-color 15ms linear;transition:background-color 15ms linear;background:var(--background);line-height:normal}.native-wrapper{position:relative;width:100%;height:100%}:host(.has-focus) textarea{caret-color:var(--highlight-color)}.native-wrapper{display:grid;min-width:inherit;max-width:inherit;grid-auto-rows:100%}.native-wrapper::after{white-space:pre-wrap;content:attr(data-replicated-value) \" \";visibility:hidden}.native-wrapper::after{padding-left:0;padding-right:0;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:var(--border-radius);color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;grid-area:1/1/2/2;word-break:break-word}.textarea-wrapper-inner{display:-ms-flexbox;display:flex;width:100%;min-height:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}:host(.ion-touched.ion-invalid){--highlight-color:var(--highlight-color-invalid)}:host(.ion-valid){--highlight-color:var(--highlight-color-valid)}.textarea-bottom{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;border-top:var(--border-width) var(--border-style) var(--border-color);white-space:normal}:host(.has-focus.ion-valid),:host(.ion-touched.ion-invalid){--border-color:var(--highlight-color)}.textarea-bottom .error-text{display:none;color:var(--highlight-color-invalid)}.textarea-bottom .helper-text{display:block}:host(.ion-touched.ion-invalid) .textarea-bottom .error-text{display:block}:host(.ion-touched.ion-invalid) .textarea-bottom .helper-text{display:none}.textarea-bottom .counter{-webkit-margin-start:auto;margin-inline-start:auto;white-space:nowrap}.label-text-wrapper{-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);pointer-events:none}.label-text,::slotted([slot=label]){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.textarea-outline{-webkit-box-sizing:border-box;box-sizing:border-box}.label-text-wrapper-hidden,.textarea-outline-notch-hidden{display:none}:host(.textarea-label-placement-start) .textarea-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.textarea-label-placement-end) .textarea-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.textarea-label-placement-stacked) .textarea-wrapper,:host(.textarea-label-placement-floating) .textarea-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:start}:host(.textarea-label-placement-stacked) .label-text-wrapper,:host(.textarea-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;max-width:100%;z-index:2}:host-context([dir=rtl]):host(.textarea-label-placement-stacked) .label-text-wrapper,:host-context([dir=rtl]).textarea-label-placement-stacked .label-text-wrapper,:host-context([dir=rtl]):host(.textarea-label-placement-floating) .label-text-wrapper,:host-context([dir=rtl]).textarea-label-placement-floating .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.textarea-label-placement-stacked:dir(rtl)) .label-text-wrapper,:host(.textarea-label-placement-floating:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.textarea-label-placement-stacked) textarea,:host(.textarea-label-placement-floating) textarea,:host(.textarea-label-placement-stacked[auto-grow]) .native-wrapper::after,:host(.textarea-label-placement-floating[auto-grow]) .native-wrapper::after{-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:8px;margin-bottom:0px}:host(.textarea-label-placement-floating) .label-text-wrapper{-webkit-transform:translateY(100%) scale(1);transform:translateY(100%) scale(1)}:host(.textarea-label-placement-floating) textarea{opacity:0}:host(.has-focus.textarea-label-placement-floating) textarea,:host(.has-value.textarea-label-placement-floating) textarea{opacity:1}:host(.textarea-fill-outline.sc-ion-textarea-md-h[rows]),:host(.textarea-label-placement-stacked[rows]),:host(.textarea-label-placement-floating[rows]){min-height:auto}.start-slot-wrapper,.end-slot-wrapper{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-ms-flex-item-align:start;align-self:start}:host(.textarea-fill-outline){--border-width:var(--token-border-size-025, var(--token-scale-025, 1px));--border-color:var(--token-border-input-default, var(--token-primitives-neutral-600, #8c8c8c))}:host(.textarea-fill-outline) .textarea-wrapper{background:initial}:host(.textarea-fill-outline) .textarea-wrapper-inner{position:relative}:host(.textarea-fill-outline) .textarea-outline{right:0;left:0;top:0;bottom:0;border-radius:var(--border-radius);position:absolute;width:100%;height:100%;pointer-events:none;border:var(--border-width) var(--border-style) var(--border-color);background:var(--background)}:host(.textarea-fill-outline) .textarea-bottom{border-top:none}:host(.textarea-fill-outline.has-focus.ion-valid),:host(.textarea-fill-outline.ion-touched.ion-invalid){--border-color:var(--highlight-color)}:host(.textarea-fill-outline.textarea-readonly){--border-color:var(--token-border-input-default, var(--token-primitives-neutral-600, #8c8c8c));--border-width:var(--token-border-size-025, var(--token-scale-025, 1px))}:host(.textarea-fill-solid){--border-color:var(--token-bg-input-bold-default, var(--token-primitives-neutral-200, #eae9e9));--border-width:var(--token-border-size-050, var(--token-scale-050, 2px));--background:var(--token-bg-input-bold-default, var(--token-primitives-neutral-200, #eae9e9))}:host(.textarea-fill-solid) .textarea-wrapper{border-bottom:none;background:none}:host(.textarea-fill-solid) .textarea-wrapper-inner{border-radius:var(--border-radius);position:relative;border:var(--border-width) var(--border-style) var(--border-color);background:var(--background)}:host(.textarea-fill-solid) .textarea-bottom{--border-width:var(--token-scale-0, 0px)}:host(.textarea-fill-solid.has-focus){--border-color:var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7))}:host(.textarea-fill-solid.has-focus.ion-valid),:host(.textarea-fill-solid.ion-touched.ion-invalid){--border-width:var(--token-border-size-050, var(--token-scale-050, 2px));--border-color:var(--highlight-color)}:host(.textarea-fill-solid.textarea-readonly){--background:var(--token-bg-input-bold-read-only, var(--token-primitives-neutral-300, #e0e0e0));--border-color:var(--token-bg-input-bold-read-only, var(--token-primitives-neutral-300, #e0e0e0))}:host(.textarea-fill-solid.textarea-readonly.ion-invalid){--border-color:rgba(var(--token-semantics-danger-base-rgb, 229, 41, 41), 0.6)}:host(.textarea-fill-solid.textarea-disabled){--background:var(--token-bg-input-bold-disabled, var(--token-primitives-neutral-300, #e0e0e0));--border-color:var(--token-bg-input-bold-disabled, var(--token-primitives-neutral-300, #e0e0e0))}:host{--border-color:var(--token-border-input-default, var(--token-primitives-neutral-600, #8c8c8c));--color:var(--token-text-default, var(--token-primitives-neutral-1200, #242424));--highlight-color-valid:var(--token-text-success, var(--token-semantics-success-900, var(--token-primitives-green-900, #126f23)));--highlight-color-invalid:var(--token-semantics-danger-800, var(--token-primitives-red-800, #bf2222));--highlight-color-focused:var(--ion-color-primary, var(--token-bg-primary-base-default, var(--token-semantics-primary-base, var(--token-semantics-primary-700, var(--token-primitives-blue-700, #105cef)))));--placeholder-color:var(--token-text-subtlest, var(--token-primitives-neutral-800, #626262));--placeholder-opacity:1;--background:var(--token-bg-surface-default, var(--token-primitives-base-white, #ffffff));--padding-bottom:var(--token-space-200, var(--token-scale-200, 8px));font-size:var(--token-font-size-350, 14px);font-weight:var(--token-font-weight-regular, 400);letter-spacing:var(--token-font-letter-spacing-0, 0%);line-height:var(--token-font-line-height-600, var(--token-scale-600, 24px));text-decoration:none;text-transform:none}:host(.ion-color){--highlight-color-focused:var(--ion-color-base)}.textarea-wrapper-inner{height:0}:host(.textarea-size-small) .textarea-wrapper-inner{--padding-top:var(--token-space-200, var(--token-scale-200, 8px));--padding-end:var(--token-space-300, var(--token-scale-300, 12px));--padding-bottom:var(--token-space-200, var(--token-scale-200, 8px));--padding-start:var(--token-space-300, var(--token-scale-300, 12px))}:host(.textarea-size-medium) .textarea-wrapper-inner{--padding-top:var(--token-space-300, var(--token-scale-300, 12px));--padding-end:var(--token-space-400, var(--token-scale-400, 16px));--padding-bottom:var(--token-space-300, var(--token-scale-300, 12px));--padding-start:var(--token-space-400, var(--token-scale-400, 16px))}:host(.textarea-size-large) .textarea-wrapper-inner{--padding-top:var(--token-space-400, var(--token-scale-400, 16px));--padding-end:var(--token-space-500, var(--token-scale-500, 20px));--padding-bottom:var(--token-space-400, var(--token-scale-400, 16px));--padding-start:var(--token-space-500, var(--token-scale-500, 20px))}.textarea-wrapper-inner[data-attr-rows]{--rows-number:attr(data-attr-rows number);min-height:calc(var(--ide-rows-number, var(--rows-number)) * 1.2em + 1.5em + 12px)}:host(.textarea-shape-soft){--border-radius:var(--token-soft-xl, var(--token-border-radius-200, var(--token-scale-200, 8px)))}:host(.textarea-shape-round){--border-radius:var(--token-round-xl, var(--token-border-radius-400, var(--token-scale-400, 16px)))}:host(.textarea-shape-rectangular){--border-radius:var(--token-rectangular-xl, var(--token-border-radius-0, var(--token-scale-0, 0px)))}.textarea-wrapper{gap:var(--token-space-100, var(--token-scale-100, 4px))}.textarea-wrapper-inner{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom)}:host([auto-grow]:not([auto-grow=false])) .textarea-wrapper-inner{height:auto}:host([auto-grow]:not([auto-grow=false])) .native-wrapper{min-height:inherit;max-height:inherit}.label-text-wrapper{font-size:var(--token-font-size-300, 12px);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-0, 0%);line-height:var(--token-font-line-height-500, var(--token-scale-500, 20px));text-decoration:none;text-transform:none;max-width:var(--token-scale-5000, 200px);-webkit-transition:color var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1)), -webkit-transform var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1));transition:color var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1)), -webkit-transform var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1));transition:color var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1)), transform var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1));transition:color var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1)), transform var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1)), -webkit-transform var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1));color:var(--token-text-subtle, var(--token-primitives-neutral-1000, #3b3b3b))}:host(.label-floating) .label-text-wrapper{-webkit-transform:none;transform:none}ion-icon{--color:globals.$ion-icon-subtlest;font-size:var(--token-scale-400, 16px)}.start-slot-wrapper,.end-slot-wrapper{margin-top:var(--token-space-050, var(--token-scale-050, 2px))}.textarea-bottom{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--token-space-100, var(--token-scale-100, 4px));font-size:var(--token-font-size-300, 12px);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-0, 0%);line-height:var(--token-font-line-height-500, var(--token-scale-500, 20px));text-decoration:none;text-transform:none}.textarea-bottom .error-text{color:var(--token-text-danger, var(--token-semantics-danger-900, var(--token-primitives-red-900, #991b1b)))}.textarea-bottom .helper-text,.textarea-bottom .counter{color:var(--token-text-subtlest, var(--token-primitives-neutral-800, #626262))}:host(.has-focus.ion-valid) .helper-text{color:var(--highlight-color-valid)}:host(.has-focus.ion-valid),:host(.ion-touched.ion-invalid){--border-width:var(--token-border-size-025, var(--token-scale-025, 1px))}.textarea-highlight{bottom:-1px;position:absolute;width:100%;height:var(--token-border-size-050, var(--token-scale-050, 2px));-webkit-transform:scale(0);transform:scale(0);-webkit-transition:-webkit-transform var(--token-transition-time-200, 200ms);transition:-webkit-transform var(--token-transition-time-200, 200ms);transition:transform var(--token-transition-time-200, 200ms);transition:transform var(--token-transition-time-200, 200ms), -webkit-transform var(--token-transition-time-200, 200ms);background:var(--border-color)}.textarea-highlight{inset-inline-start:0}:host(.has-focus){--border-color:var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7));--border-width:var(--token-border-size-050, var(--token-scale-050, 2px))}:host(.has-focus) .textarea-highlight{-webkit-transform:scale(1);transform:scale(1)}@media (any-hover: hover){:host(:hover){--border-color:var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7))}}:host(.textarea-disabled){--color:var(--token-text-disabled, var(--token-primitives-neutral-500, #a2a2a2));--background:var(--token-bg-input-disabled, var(--token-primitives-neutral-100, #f3f3f3));--border-color:var(--token-border-disabled, var(--token-primitives-neutral-300, #e0e0e0));--placeholder-color:var(--token-text-disabled, var(--token-primitives-neutral-500, #a2a2a2))}:host(.textarea-disabled:not(.ion-valid)) .textarea-bottom .helper-text,:host(.textarea-disabled) .textarea-bottom .counter,:host(.textarea-disabled) .label-text-wrapper{color:var(--token-text-disabled, var(--token-primitives-neutral-500, #a2a2a2))}:host(.textarea-disabled.has-focus.ion-valid){--border-color:rgba(var(--token-semantics-success-base-rgb, 27, 164, 51), 0.6)}:host(.textarea-disabled.ion-touched.ion-invalid){--border-color:rgba(var(--token-semantics-danger-base-rgb, 229, 41, 41), 0.6)}:host(.textarea-disabled.ion-color){--border-color:rgba(var(--ion-color-base-rgb), 0.6)}:host(.textarea-disabled.has-focus.ion-valid) .textarea-bottom .helper-text,:host(.textarea-disabled.ion-touched.ion-invalid) .error-text{opacity:0.6}:host(.textarea-readonly){--background:var(--token-bg-input-read-only, var(--token-primitives-neutral-100, #f3f3f3))}:host(.label-floating) .label-text-wrapper{max-width:calc(100% / 0.75)}.textarea-wrapper textarea{-webkit-transition:opacity var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1));transition:opacity var(--token-transition-time-150, 150ms) var(--token-transition-curve-expressive, cubic-bezier(0.4, 0, 0.2, 1))}:host(.textarea-label-placement-fixed) .label-text{-ms-flex:0 0 calc(var(--token-scale-2400, 96px) + var(--token-space-100, var(--token-scale-100, 4px)));flex:0 0 calc(var(--token-scale-2400, 96px) + var(--token-space-100, var(--token-scale-100, 4px)));width:calc(var(--token-scale-2400, 96px) + var(--token-space-100, var(--token-scale-100, 4px)));min-width:calc(var(--token-scale-2400, 96px) + var(--token-space-100, var(--token-scale-100, 4px)));max-width:var(--token-scale-5000, 200px)}:host(.textarea-label-placement-stacked) textarea,:host(.textarea-label-placement-floating) textarea{margin-top:0}";

const textareaIosCss = ":host{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--padding-top:0;--padding-end:0;--padding-start:0;--border-radius:0;--border-style:solid;--highlight-color:var(--highlight-color-focused);display:block;position:relative;width:100%;color:var(--color);-webkit-box-sizing:border-box;box-sizing:border-box}:host([cols]:not([auto-grow])){width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host(.ion-color){background:initial}:host(.in-item){-ms-flex-item-align:baseline;align-self:baseline}:host(.in-item[slot=start]),:host(.in-item[slot=end]){width:auto}.native-textarea{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;white-space:pre-wrap;z-index:1;-webkit-box-sizing:border-box;box-sizing:border-box;resize:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.native-textarea::-webkit-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea::-moz-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea:-ms-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea::-ms-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;grid-area:1/1/2/2;word-break:break-word}.cloned-input{top:0;bottom:0;position:absolute;pointer-events:none}.cloned-input{inset-inline-start:0}.cloned-input:disabled{opacity:1}:host([auto-grow]) .cloned-input{height:100%}:host([auto-grow]) .native-textarea{overflow:hidden}.textarea-wrapper{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:0px;padding-bottom:0px;border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:start;align-items:flex-start;height:inherit;min-height:inherit;-webkit-transition:background-color 15ms linear;transition:background-color 15ms linear;background:var(--background);line-height:normal}.native-wrapper{position:relative;width:100%;height:100%}:host(.has-focus) textarea{caret-color:var(--highlight-color)}.native-wrapper{display:grid;min-width:inherit;max-width:inherit;grid-auto-rows:100%}.native-wrapper::after{white-space:pre-wrap;content:attr(data-replicated-value) \" \";visibility:hidden}.native-wrapper::after{padding-left:0;padding-right:0;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:var(--border-radius);color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;grid-area:1/1/2/2;word-break:break-word}.textarea-wrapper-inner{display:-ms-flexbox;display:flex;width:100%;min-height:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}:host(.ion-touched.ion-invalid){--highlight-color:var(--highlight-color-invalid)}:host(.ion-valid){--highlight-color:var(--highlight-color-valid)}.textarea-bottom{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;border-top:var(--border-width) var(--border-style) var(--border-color);white-space:normal}:host(.has-focus.ion-valid),:host(.ion-touched.ion-invalid){--border-color:var(--highlight-color)}.textarea-bottom .error-text{display:none;color:var(--highlight-color-invalid)}.textarea-bottom .helper-text{display:block}:host(.ion-touched.ion-invalid) .textarea-bottom .error-text{display:block}:host(.ion-touched.ion-invalid) .textarea-bottom .helper-text{display:none}.textarea-bottom .counter{-webkit-margin-start:auto;margin-inline-start:auto;white-space:nowrap}.label-text-wrapper{-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);pointer-events:none}.label-text,::slotted([slot=label]){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.textarea-outline{-webkit-box-sizing:border-box;box-sizing:border-box}.label-text-wrapper-hidden,.textarea-outline-notch-hidden{display:none}:host(.textarea-label-placement-start) .textarea-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.textarea-label-placement-end) .textarea-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.textarea-label-placement-stacked) .textarea-wrapper,:host(.textarea-label-placement-floating) .textarea-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:start}:host(.textarea-label-placement-stacked) .label-text-wrapper,:host(.textarea-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;max-width:100%;z-index:2}:host-context([dir=rtl]):host(.textarea-label-placement-stacked) .label-text-wrapper,:host-context([dir=rtl]).textarea-label-placement-stacked .label-text-wrapper,:host-context([dir=rtl]):host(.textarea-label-placement-floating) .label-text-wrapper,:host-context([dir=rtl]).textarea-label-placement-floating .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.textarea-label-placement-stacked:dir(rtl)) .label-text-wrapper,:host(.textarea-label-placement-floating:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.textarea-label-placement-stacked) textarea,:host(.textarea-label-placement-floating) textarea,:host(.textarea-label-placement-stacked[auto-grow]) .native-wrapper::after,:host(.textarea-label-placement-floating[auto-grow]) .native-wrapper::after{-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:8px;margin-bottom:0px}:host(.textarea-label-placement-floating) .label-text-wrapper{-webkit-transform:translateY(100%) scale(1);transform:translateY(100%) scale(1)}:host(.textarea-label-placement-floating) textarea{opacity:0}:host(.has-focus.textarea-label-placement-floating) textarea,:host(.has-value.textarea-label-placement-floating) textarea{opacity:1}:host(.textarea-fill-outline.sc-ion-textarea-md-h[rows]),:host(.textarea-label-placement-stacked[rows]),:host(.textarea-label-placement-floating[rows]){min-height:auto}.start-slot-wrapper,.end-slot-wrapper{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-ms-flex-item-align:start;align-self:start}:host{--placeholder-opacity:var(--ion-placeholder-opacity, 0.6);--padding-bottom:8px;--highlight-color-focused:var(--ion-color-primary, #0054e9);--highlight-color-valid:var(--ion-color-success, #2dd55b);--highlight-color-invalid:var(--ion-color-danger, #c5000f);min-height:44px;font-family:var(--ion-font-family, inherit);z-index:2}:host(.ion-color){--highlight-color-focused:var(--ion-color-base)}:host(.textarea-label-placement-floating),:host(.textarea-label-placement-stacked){--padding-top:0px;min-height:56px}.native-wrapper{min-height:inherit;max-height:inherit}.native-wrapper textarea{-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom)}.textarea-bottom{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:5px;padding-bottom:0;font-size:0.75rem}.textarea-bottom .helper-text{color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}.textarea-bottom .counter{color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d));-webkit-padding-start:16px;padding-inline-start:16px}:host(.textarea-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.textarea-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.textarea-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}.start-slot-wrapper,.end-slot-wrapper{padding-left:0;padding-right:0;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom)}:host(.textarea-label-placement-stacked) ::slotted([slot=start]),:host(.textarea-label-placement-stacked) ::slotted([slot=end]),:host(.textarea-label-placement-floating) ::slotted([slot=start]),:host(.textarea-label-placement-floating) ::slotted([slot=end]){margin-top:8px}::slotted([slot=start]),::slotted([slot=end]){margin-top:0}::slotted([slot=start]:last-of-type){-webkit-margin-end:16px;margin-inline-end:16px;-webkit-margin-start:0;margin-inline-start:0}::slotted([slot=end]:first-of-type){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.label-floating) .label-text-wrapper{-webkit-transform:translateY(50%) scale(0.75);transform:translateY(50%) scale(0.75);max-width:calc(100% / 0.75)}.label-text-wrapper{max-width:200px;-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.textarea-wrapper textarea{-webkit-transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}:host(.textarea-label-placement-fixed) .label-text{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host{--border-width:0.55px;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, var(--ion-background-color-step-250, #c8c7cc))));--padding-top:10px;--padding-end:0px;--padding-bottom:8px;--padding-start:0px;--highlight-height:0px;font-size:inherit}:host(.textarea-disabled){opacity:0.3}::slotted(ion-button[slot=start].button-has-icon-only),::slotted(ion-button[slot=end].button-has-icon-only){--border-radius:50%;--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;aspect-ratio:1}";

const textareaMdCss = ":host{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--padding-top:0;--padding-end:0;--padding-start:0;--border-radius:0;--border-style:solid;--highlight-color:var(--highlight-color-focused);display:block;position:relative;width:100%;color:var(--color);-webkit-box-sizing:border-box;box-sizing:border-box}:host([cols]:not([auto-grow])){width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host(.ion-color){background:initial}:host(.in-item){-ms-flex-item-align:baseline;align-self:baseline}:host(.in-item[slot=start]),:host(.in-item[slot=end]){width:auto}.native-textarea{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;position:relative;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;white-space:pre-wrap;z-index:1;-webkit-box-sizing:border-box;box-sizing:border-box;resize:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.native-textarea::-webkit-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea::-moz-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea:-ms-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea::-ms-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;grid-area:1/1/2/2;word-break:break-word}.cloned-input{top:0;bottom:0;position:absolute;pointer-events:none}.cloned-input{inset-inline-start:0}.cloned-input:disabled{opacity:1}:host([auto-grow]) .cloned-input{height:100%}:host([auto-grow]) .native-textarea{overflow:hidden}.textarea-wrapper{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:0px;padding-bottom:0px;border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:start;align-items:flex-start;height:inherit;min-height:inherit;-webkit-transition:background-color 15ms linear;transition:background-color 15ms linear;background:var(--background);line-height:normal}.native-wrapper{position:relative;width:100%;height:100%}:host(.has-focus) textarea{caret-color:var(--highlight-color)}.native-wrapper{display:grid;min-width:inherit;max-width:inherit;grid-auto-rows:100%}.native-wrapper::after{white-space:pre-wrap;content:attr(data-replicated-value) \" \";visibility:hidden}.native-wrapper::after{padding-left:0;padding-right:0;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:var(--border-radius);color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;grid-area:1/1/2/2;word-break:break-word}.textarea-wrapper-inner{display:-ms-flexbox;display:flex;width:100%;min-height:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}:host(.ion-touched.ion-invalid){--highlight-color:var(--highlight-color-invalid)}:host(.ion-valid){--highlight-color:var(--highlight-color-valid)}.textarea-bottom{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;border-top:var(--border-width) var(--border-style) var(--border-color);white-space:normal}:host(.has-focus.ion-valid),:host(.ion-touched.ion-invalid){--border-color:var(--highlight-color)}.textarea-bottom .error-text{display:none;color:var(--highlight-color-invalid)}.textarea-bottom .helper-text{display:block}:host(.ion-touched.ion-invalid) .textarea-bottom .error-text{display:block}:host(.ion-touched.ion-invalid) .textarea-bottom .helper-text{display:none}.textarea-bottom .counter{-webkit-margin-start:auto;margin-inline-start:auto;white-space:nowrap}.label-text-wrapper{-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);pointer-events:none}.label-text,::slotted([slot=label]){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.textarea-outline{-webkit-box-sizing:border-box;box-sizing:border-box}.label-text-wrapper-hidden,.textarea-outline-notch-hidden{display:none}:host(.textarea-label-placement-start) .textarea-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.textarea-label-placement-end) .textarea-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.textarea-label-placement-stacked) .textarea-wrapper,:host(.textarea-label-placement-floating) .textarea-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:start}:host(.textarea-label-placement-stacked) .label-text-wrapper,:host(.textarea-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;max-width:100%;z-index:2}:host-context([dir=rtl]):host(.textarea-label-placement-stacked) .label-text-wrapper,:host-context([dir=rtl]).textarea-label-placement-stacked .label-text-wrapper,:host-context([dir=rtl]):host(.textarea-label-placement-floating) .label-text-wrapper,:host-context([dir=rtl]).textarea-label-placement-floating .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.textarea-label-placement-stacked:dir(rtl)) .label-text-wrapper,:host(.textarea-label-placement-floating:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.textarea-label-placement-stacked) textarea,:host(.textarea-label-placement-floating) textarea,:host(.textarea-label-placement-stacked[auto-grow]) .native-wrapper::after,:host(.textarea-label-placement-floating[auto-grow]) .native-wrapper::after{-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:8px;margin-bottom:0px}:host(.textarea-label-placement-floating) .label-text-wrapper{-webkit-transform:translateY(100%) scale(1);transform:translateY(100%) scale(1)}:host(.textarea-label-placement-floating) textarea{opacity:0}:host(.has-focus.textarea-label-placement-floating) textarea,:host(.has-value.textarea-label-placement-floating) textarea{opacity:1}:host(.textarea-fill-outline.sc-ion-textarea-md-h[rows]),:host(.textarea-label-placement-stacked[rows]),:host(.textarea-label-placement-floating[rows]){min-height:auto}.start-slot-wrapper,.end-slot-wrapper{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-ms-flex-item-align:start;align-self:start}:host{--placeholder-opacity:var(--ion-placeholder-opacity, 0.6);--padding-bottom:8px;--highlight-color-focused:var(--ion-color-primary, #0054e9);--highlight-color-valid:var(--ion-color-success, #2dd55b);--highlight-color-invalid:var(--ion-color-danger, #c5000f);min-height:44px;font-family:var(--ion-font-family, inherit);z-index:2}:host(.ion-color){--highlight-color-focused:var(--ion-color-base)}:host(.textarea-label-placement-floating),:host(.textarea-label-placement-stacked){--padding-top:0px;min-height:56px}.native-wrapper{min-height:inherit;max-height:inherit}.native-wrapper textarea{-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom)}.textarea-bottom{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:5px;padding-bottom:0;font-size:0.75rem}.textarea-bottom .helper-text{color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}.textarea-bottom .counter{color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d));-webkit-padding-start:16px;padding-inline-start:16px}:host(.textarea-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.textarea-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.textarea-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}.start-slot-wrapper,.end-slot-wrapper{padding-left:0;padding-right:0;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom)}:host(.textarea-label-placement-stacked) ::slotted([slot=start]),:host(.textarea-label-placement-stacked) ::slotted([slot=end]),:host(.textarea-label-placement-floating) ::slotted([slot=start]),:host(.textarea-label-placement-floating) ::slotted([slot=end]){margin-top:8px}::slotted([slot=start]),::slotted([slot=end]){margin-top:0}::slotted([slot=start]:last-of-type){-webkit-margin-end:16px;margin-inline-end:16px;-webkit-margin-start:0;margin-inline-start:0}::slotted([slot=end]:first-of-type){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.label-floating) .label-text-wrapper{-webkit-transform:translateY(50%) scale(0.75);transform:translateY(50%) scale(0.75);max-width:calc(100% / 0.75)}.label-text-wrapper{max-width:200px;-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.textarea-wrapper textarea{-webkit-transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}:host(.textarea-label-placement-fixed) .label-text{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.textarea-fill-solid){--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--border-color:var(--ion-color-step-500, var(--ion-background-color-step-500, gray));--border-radius:4px;--padding-start:16px;--padding-end:16px;min-height:56px}:host(.textarea-fill-solid) .textarea-wrapper{border-bottom:var(--border-width) var(--border-style) var(--border-color)}:host(.has-focus.textarea-fill-solid.ion-valid),:host(.textarea-fill-solid.ion-touched.ion-invalid){--border-color:var(--highlight-color)}:host(.textarea-fill-solid) .textarea-bottom{border-top:none}@media (any-hover: hover){:host(.textarea-fill-solid:hover){--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6));--border-color:var(--ion-color-step-750, var(--ion-background-color-step-750, #404040))}}:host(.textarea-fill-solid.has-focus){--background:var(--ion-color-step-150, var(--ion-background-color-step-150, #d9d9d9));--border-color:var(--ion-color-step-750, var(--ion-background-color-step-750, #404040))}:host(.textarea-fill-solid) .textarea-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0px;border-end-start-radius:0px}:host(.label-floating.textarea-fill-solid) .label-text-wrapper{max-width:calc(100% / 0.75)}:host(.textarea-fill-outline){--border-color:var(--ion-color-step-300, var(--ion-background-color-step-300, #b3b3b3));--border-radius:4px;--padding-start:16px;--padding-end:16px;min-height:56px}:host(.textarea-fill-outline.textarea-shape-round){--border-radius:28px;--padding-start:32px;--padding-end:32px}:host(.has-focus.textarea-fill-outline.ion-valid),:host(.textarea-fill-outline.ion-touched.ion-invalid){--border-color:var(--highlight-color)}@media (any-hover: hover){:host(.textarea-fill-outline:hover){--border-color:var(--ion-color-step-750, var(--ion-background-color-step-750, #404040))}}:host(.textarea-fill-outline.has-focus){--border-width:var(--highlight-height);--border-color:var(--highlight-color)}:host(.textarea-fill-outline) .textarea-bottom{border-top:none}:host(.textarea-fill-outline) .textarea-wrapper{border-bottom:none}:host(.textarea-fill-outline.textarea-label-placement-stacked) .label-text-wrapper,:host(.textarea-fill-outline.textarea-label-placement-floating) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top;position:absolute;max-width:calc(100% - var(--padding-start) - var(--padding-end))}:host-context([dir=rtl]):host(.textarea-fill-outline.textarea-label-placement-stacked) .label-text-wrapper,:host-context([dir=rtl]).textarea-fill-outline.textarea-label-placement-stacked .label-text-wrapper,:host-context([dir=rtl]):host(.textarea-fill-outline.textarea-label-placement-floating) .label-text-wrapper,:host-context([dir=rtl]).textarea-fill-outline.textarea-label-placement-floating .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.textarea-fill-outline.textarea-label-placement-stacked:dir(rtl)) .label-text-wrapper,:host(.textarea-fill-outline.textarea-label-placement-floating:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.textarea-fill-outline) .label-text-wrapper{position:relative}:host(.label-floating.textarea-fill-outline) .label-text-wrapper{-webkit-transform:translateY(-32%) scale(0.75);transform:translateY(-32%) scale(0.75);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;max-width:calc(\n    (100% - var(--padding-start) - var(--padding-end) - 8px) / 0.75\n  )}:host(.textarea-fill-outline.textarea-label-placement-stacked) textarea,:host(.textarea-fill-outline.textarea-label-placement-floating) textarea,:host(.textarea-fill-outline.textarea-label-placement-stacked[auto-grow]) .native-wrapper::after,:host(.textarea-fill-outline.textarea-label-placement-floating[auto-grow]) .native-wrapper::after{-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:12px;margin-bottom:0px}:host(.textarea-fill-outline.textarea-label-placement-stacked) ::slotted([slot=start]),:host(.textarea-fill-outline.textarea-label-placement-stacked) ::slotted([slot=end]),:host(.textarea-fill-outline.textarea-label-placement-floating) ::slotted([slot=start]),:host(.textarea-fill-outline.textarea-label-placement-floating) ::slotted([slot=end]){margin-top:12px}:host(.textarea-fill-outline) .textarea-outline-container{right:0;left:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;width:100%;height:100%}:host(.textarea-fill-outline) .textarea-outline-start,:host(.textarea-fill-outline) .textarea-outline-end{pointer-events:none}:host(.textarea-fill-outline) .textarea-outline-start,:host(.textarea-fill-outline) .textarea-outline-notch,:host(.textarea-fill-outline) .textarea-outline-end{border-top:var(--border-width) var(--border-style) var(--border-color);border-bottom:var(--border-width) var(--border-style) var(--border-color);-webkit-box-sizing:border-box;box-sizing:border-box}:host(.textarea-fill-outline) .textarea-outline-notch{max-width:calc(100% - var(--padding-start) - var(--padding-end))}:host(.textarea-fill-outline) .notch-spacer{-webkit-padding-end:8px;padding-inline-end:8px;font-size:calc(1em * 0.75);opacity:0;pointer-events:none;-webkit-box-sizing:content-box;box-sizing:content-box}:host(.textarea-fill-outline) .textarea-outline-start{border-start-start-radius:var(--border-radius);border-start-end-radius:0px;border-end-end-radius:0px;border-end-start-radius:var(--border-radius);-webkit-border-start:var(--border-width) var(--border-style) var(--border-color);border-inline-start:var(--border-width) var(--border-style) var(--border-color);width:calc(var(--padding-start) - 4px)}:host(.textarea-fill-outline) .textarea-outline-end{-webkit-border-end:var(--border-width) var(--border-style) var(--border-color);border-inline-end:var(--border-width) var(--border-style) var(--border-color);border-start-start-radius:0px;border-start-end-radius:var(--border-radius);border-end-end-radius:var(--border-radius);border-end-start-radius:0px;-ms-flex-positive:1;flex-grow:1}:host(.label-floating.textarea-fill-outline) .textarea-outline-notch{border-top:none}:host{--border-width:1px;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));--padding-top:18px;--padding-end:0px;--padding-bottom:8px;--padding-start:0px;--highlight-height:2px;font-size:inherit}.textarea-bottom .counter{letter-spacing:0.0333333333em}:host(.textarea-label-placement-floating.has-focus) .label-text-wrapper,:host(.textarea-label-placement-stacked.has-focus) .label-text-wrapper{color:var(--highlight-color)}:host(.has-focus.textarea-label-placement-floating.ion-valid) .label-text-wrapper,:host(.textarea-label-placement-floating.ion-touched.ion-invalid) .label-text-wrapper,:host(.has-focus.textarea-label-placement-stacked.ion-valid) .label-text-wrapper,:host(.textarea-label-placement-stacked.ion-touched.ion-invalid) .label-text-wrapper{color:var(--highlight-color)}:host(.textarea-disabled){opacity:0.38}.textarea-highlight{bottom:-1px;position:absolute;width:100%;height:var(--highlight-height);-webkit-transform:scale(0);transform:scale(0);-webkit-transition:-webkit-transform 200ms;transition:-webkit-transform 200ms;transition:transform 200ms;transition:transform 200ms, -webkit-transform 200ms;background:var(--highlight-color)}.textarea-highlight{inset-inline-start:0}:host(.has-focus) .textarea-highlight{-webkit-transform:scale(1);transform:scale(1)}:host(.in-item) .textarea-highlight{bottom:0}:host(.in-item) .textarea-highlight{inset-inline-start:0}:host(.textarea-shape-round){--border-radius:16px}::slotted(ion-button[slot=start].button-has-icon-only),::slotted(ion-button[slot=end].button-has-icon-only){--border-radius:50%;--padding-start:8px;--padding-end:8px;--padding-top:8px;--padding-bottom:8px;aspect-ratio:1;min-height:40px}";

const Textarea = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.ionChange = createEvent(this, "ionChange", 7);
        this.ionInput = createEvent(this, "ionInput", 7);
        this.ionBlur = createEvent(this, "ionBlur", 7);
        this.ionFocus = createEvent(this, "ionFocus", 7);
        if (hostRef.$hostElement$["s-ei"]) {
            this.internals = hostRef.$hostElement$["s-ei"];
        }
        else {
            this.internals = hostRef.$hostElement$.attachInternals();
            hostRef.$hostElement$["s-ei"] = this.internals;
        }
        this.inputId = `ion-textarea-${textareaIds++}`;
        this.helperTextId = `${this.inputId}-helper-text`;
        this.errorTextId = `${this.inputId}-error-text`;
        /**
         * `true` if the textarea was cleared as a result of the user typing
         * with `clearOnEdit` enabled.
         *
         * Resets when the textarea loses focus.
         */
        this.didTextareaClearOnEdit = false;
        this.inheritedAttributes = {};
        /**
         * The `hasFocus` state ensures the focus class is
         * added regardless of how the element is focused.
         * The `ion-focused` class only applies when focused
         * via tabbing, not by clicking.
         * The `has-focus` logic was added to ensure the class
         * is applied in both cases.
         */
        this.hasFocus = false;
        /**
         * Track validation state for proper aria-live announcements
         */
        this.isInvalid = false;
        /**
         * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
         * Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
         */
        this.autocapitalize = 'none';
        /**
         * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.
         *
         * This may not be sufficient for the element to be focused on page load. See [managing focus](/docs/developing/managing-focus) for more information.
         */
        this.autofocus = false;
        /**
         * If `true`, the value will be cleared after focus upon edit.
         */
        this.clearOnEdit = false;
        /**
         * If `true`, the user cannot interact with the textarea.
         */
        this.disabled = false;
        /**
         * The name of the control, which is submitted with the form data.
         */
        this.name = this.inputId;
        /**
         * If `true`, the user cannot modify the value.
         */
        this.readonly = false;
        /**
         * If `true`, the user must fill in a value before submitting a form.
         */
        this.required = false;
        /**
         * If `true`, the element will have its spelling and grammar checked.
         */
        this.spellcheck = false;
        /**
         * If `true`, the textarea container will grow and shrink based
         * on the contents of the textarea.
         */
        this.autoGrow = false;
        /**
         * The value of the textarea.
         */
        this.value = '';
        /**
         * If `true`, a character counter will display the ratio of characters used and the total character limit.
         * Developers must also set the `maxlength` property for the counter to be calculated correctly.
         */
        this.counter = false;
        /**
         * Where to place the label relative to the textarea.
         * `"start"`: The label will appear to the left of the textarea in LTR and to the right in RTL.
         * `"end"`: The label will appear to the right of the textarea in LTR and to the left in RTL.
         * `"floating"`: The label will appear smaller and above the textarea when the textarea is focused or it has a value. Otherwise it will appear on top of the textarea.
         * `"stacked"`: The label will appear smaller and above the textarea regardless even when the textarea is blurred or has no value.
         * `"fixed"`: The label has the same behavior as `"start"` except it also has a fixed width. Long text will be truncated with ellipses ("...").
         */
        this.labelPlacement = 'start';
        /**
         * The size of the textarea. If "large" it will increase the height of the textarea, while
         * "small" and "medium" provide progressively smaller heights. The default size is "medium".
         * This property only applies to the `"ionic"` theme.
         */
        this.size = 'medium';
        // `Event` type is used instead of `InputEvent`
        // since the types from Stencil are not derived
        // from the element (e.g. textarea and input
        // should be InputEvent, but all other elements
        // should be Event).
        this.onInput = (ev) => {
            const input = ev.target;
            if (input) {
                this.value = input.value || '';
            }
            this.emitInputChange(ev);
        };
        this.onChange = (ev) => {
            this.emitValueChange(ev);
        };
        this.onFocus = (ev) => {
            this.hasFocus = true;
            this.focusedValue = this.value;
            this.ionFocus.emit(ev);
        };
        this.onBlur = (ev) => {
            this.hasFocus = false;
            if (this.focusedValue !== this.value) {
                /**
                 * Emits the `ionChange` event when the textarea value
                 * is different than the value when the textarea was focused.
                 */
                this.emitValueChange(ev);
            }
            this.didTextareaClearOnEdit = false;
            this.ionBlur.emit(ev);
        };
        this.onKeyDown = (ev) => {
            this.checkClearOnEdit(ev);
        };
        /**
         * Stops propagation when the label is clicked,
         * otherwise, two clicks will be triggered.
         */
        this.onLabelClick = (ev) => {
            // Only stop propagation if the click was directly on the label
            // and not on the input or other child elements
            if (ev.target === ev.currentTarget) {
                ev.stopPropagation();
            }
        };
    }
    debounceChanged() {
        const { ionInput, debounce, originalIonInput } = this;
        /**
         * If debounce is undefined, we have to manually revert the ionInput emitter in case
         * debounce used to be set to a number. Otherwise, the event would stay debounced.
         */
        this.ionInput = debounce === undefined ? originalIonInput !== null && originalIonInput !== void 0 ? originalIonInput : ionInput : debounceEvent(ionInput, debounce);
    }
    /**
     * Update element internals when disabled prop changes
     */
    disabledChanged() {
        this.updateElementInternals();
    }
    /**
     * Update the native input element when the value changes
     */
    valueChanged() {
        const nativeInput = this.nativeInput;
        const value = this.getValue();
        if (nativeInput && nativeInput.value !== value) {
            nativeInput.value = value;
        }
        this.updateElementInternals();
        this.runAutoGrow();
    }
    /**
     * Update native input and element internals when required prop changes
     */
    requiredChanged() {
        // Explicitly update the native element's required attribute to ensure
        // browser validation works correctly when required changes dynamically.
        // While the template binding should handle this, we need to update it
        // synchronously for the browser's validation to recognize the change.
        if (this.nativeInput) {
            this.nativeInput.required = this.required;
        }
        this.updateElementInternals();
    }
    /**
     * dir is a globally enumerated attribute.
     * As a result, creating these as properties
     * can have unintended side effects. Instead, we
     * listen for attribute changes and inherit them
     * to the inner `<textarea>` element.
     */
    onDirChanged(newValue) {
        this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { dir: newValue });
        forceUpdate(this);
    }
    /**
     * This prevents the native input from emitting the click event.
     * Instead, the click event from the ion-textarea is emitted.
     */
    onClickCapture(ev) {
        const nativeInput = this.nativeInput;
        if (nativeInput && ev.target === nativeInput) {
            ev.stopPropagation();
            this.el.click();
        }
    }
    connectedCallback() {
        const { el } = this;
        this.slotMutationController = createSlotMutationController(el, ['label', 'start', 'end'], () => forceUpdate(this));
        this.notchController = createNotchController(el, () => this.notchSpacerEl, () => this.labelSlot);
        // Watch for class changes to update validation state
        if (typeof MutationObserver !== 'undefined') {
            this.validationObserver = new MutationObserver(() => {
                const newIsInvalid = checkInvalidState(this.el);
                if (this.isInvalid !== newIsInvalid) {
                    this.isInvalid = newIsInvalid;
                    // Force a re-render to update aria-describedby immediately
                    forceUpdate(this);
                }
            });
            this.validationObserver.observe(el, {
                attributes: true,
                attributeFilter: ['class'],
            });
        }
        // Always set initial state
        this.isInvalid = checkInvalidState(this.el);
        this.debounceChanged();
        {
            document.dispatchEvent(new CustomEvent('ionInputDidLoad', {
                detail: el,
            }));
        }
    }
    disconnectedCallback() {
        {
            document.dispatchEvent(new CustomEvent('ionInputDidUnload', {
                detail: this.el,
            }));
        }
        if (this.slotMutationController) {
            this.slotMutationController.destroy();
            this.slotMutationController = undefined;
        }
        if (this.notchController) {
            this.notchController.destroy();
            this.notchController = undefined;
        }
        // Clean up validation observer to prevent memory leaks
        if (this.validationObserver) {
            this.validationObserver.disconnect();
            this.validationObserver = undefined;
        }
    }
    componentWillLoad() {
        this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes(this.el, ['data-form-type', 'title', 'tabindex', 'dir']));
    }
    componentDidLoad() {
        this.originalIonInput = this.ionInput;
        this.updateElementInternals();
        this.runAutoGrow();
        // Override focus() to delegate to the native textarea.
        // This is needed for Safari and Firefox which don't properly
        // delegate focus when calling focus() directly on the host.
        this.el.focus = () => {
            this.setFocus();
        };
    }
    componentDidRender() {
        var _a;
        (_a = this.notchController) === null || _a === void 0 ? void 0 : _a.calculateNotchWidth();
    }
    /**
     * Sets focus on the native `textarea` in `ion-textarea`. Use this method instead of the global
     * `textarea.focus()`.
     *
     * See [managing focus](/docs/developing/managing-focus) for more information.
     */
    async setFocus() {
        if (this.nativeInput) {
            this.nativeInput.focus();
        }
    }
    /**
     * Returns the native `<textarea>` element used under the hood.
     */
    async getInputElement() {
        /**
         * If this gets called in certain early lifecycle hooks (ex: Vue onMounted),
         * nativeInput won't be defined yet with the custom elements build, so wait for it to load in.
         */
        if (!this.nativeInput) {
            await new Promise((resolve) => componentOnReady(this.el, resolve));
        }
        return Promise.resolve(this.nativeInput);
    }
    /**
     * Emits an `ionChange` event.
     *
     * This API should be called for user committed changes.
     * This API should not be used for external value changes.
     */
    emitValueChange(event) {
        const { value } = this;
        // Checks for both null and undefined values
        const newValue = value == null ? value : value.toString();
        // Emitting a value change should update the internal state for tracking the focused value
        this.focusedValue = newValue;
        this.ionChange.emit({ value: newValue, event });
    }
    /**
     * Emits an `ionInput` event.
     */
    emitInputChange(event) {
        const { value } = this;
        this.ionInput.emit({ value, event });
    }
    runAutoGrow() {
        if (this.nativeInput && this.autoGrow) {
            writeTask(() => {
                var _a;
                if (this.textareaWrapper) {
                    // Replicated value is an attribute to be used in the stylesheet
                    // to set the inner contents of a pseudo element.
                    this.textareaWrapper.dataset.replicatedValue = (_a = this.value) !== null && _a !== void 0 ? _a : '';
                }
            });
        }
    }
    /**
     * Check if we need to clear the text input if clearOnEdit is enabled
     */
    checkClearOnEdit(ev) {
        if (!this.clearOnEdit) {
            return;
        }
        /**
         * The following keys do not modify the
         * contents of the input. As a result, pressing
         * them should not edit the textarea.
         *
         * We can't check to see if the value of the textarea
         * was changed because we call checkClearOnEdit
         * in a keydown listener, and the key has not yet
         * been added to the textarea.
         *
         * Unlike ion-input, the "Enter" key does modify the
         * textarea by adding a new line, so "Enter" is not
         * included in the IGNORED_KEYS array.
         */
        const IGNORED_KEYS = ['Tab', 'Shift', 'Meta', 'Alt', 'Control'];
        const pressedIgnoredKey = IGNORED_KEYS.includes(ev.key);
        /**
         * Clear the textarea if the control has not been previously cleared
         * during focus.
         */
        if (!this.didTextareaClearOnEdit && this.hasValue() && !pressedIgnoredKey) {
            this.value = '';
            this.emitInputChange(ev);
        }
        /**
         * Pressing an IGNORED_KEYS first and
         * then an allowed key will cause the input to not
         * be cleared.
         */
        if (!pressedIgnoredKey) {
            this.didTextareaClearOnEdit = true;
        }
    }
    hasValue() {
        return this.getValue() !== '';
    }
    getValue() {
        return this.value || '';
    }
    /**
     * Called when the form state is restored.
     * Restores the component's value.
     */
    formStateRestoreCallback(value) {
        this.value = value;
    }
    /**
     * Called when the form is reset.
     * Resets the component's value.
     */
    formResetCallback() {
        this.value = '';
    }
    /**
     * Updates the form value and reports validity state to the browser via
     * ElementInternals. This should be called when the component loads, when
     * the required prop changes, when the disabled prop changes, and when the value
     * changes to ensure the form value stays in sync and validation state is updated.
     */
    updateElementInternals() {
        // Disabled form controls should not be included in form data
        // Pass null to setFormValue when disabled to exclude it from form submission
        const value = this.disabled ? null : this.getValue();
        // ElementInternals may not be fully available in test environments
        // so we need to check if the method exists before calling it
        if (typeof this.internals.setFormValue === 'function') {
            this.internals.setFormValue(value);
        }
        reportValidityToElementInternals(this.nativeInput, this.internals);
    }
    renderLabel() {
        const { label } = this;
        return (h("div", { class: {
                'label-text-wrapper': true,
                'label-text-wrapper-hidden': !this.hasLabel,
            }, part: "label" }, label === undefined ? h("slot", { name: "label" }) : h("div", { class: "label-text" }, label)));
    }
    /**
     * Gets any content passed into the `label` slot,
     * not the <slot> definition.
     */
    get labelSlot() {
        return this.el.querySelector('[slot="label"]');
    }
    /**
     * Returns `true` if label content is provided
     * either by a prop or a content. If you want
     * to get the plaintext value of the label use
     * the `labelText` getter instead.
     */
    get hasLabel() {
        return this.label !== undefined || this.labelSlot !== null;
    }
    getFill() {
        const theme = getIonTheme(this);
        const { fill } = this;
        if (theme === 'ionic' && fill === undefined) {
            return 'outline';
        }
        return fill;
    }
    getShape() {
        const theme = getIonTheme(this);
        const { shape } = this;
        // TODO(ROU-11050): Update theme check when shapes are defined for all themes.
        if (theme === 'ionic' && shape === undefined) {
            return 'round';
        }
        return shape;
    }
    /**
     * Renders the border container when fill="outline".
     */
    renderLabelContainer() {
        const theme = getIonTheme(this);
        const hasOutlineFill = theme === 'md' && this.fill === 'outline';
        if (hasOutlineFill) {
            /**
             * The outline fill has a special outline
             * that appears around the textarea and the label.
             * Certain stacked and floating label placements cause the
             * label to translate up and create a "cut out"
             * inside of that border by using the notch-spacer element.
             */
            return [
                h("div", { class: "textarea-outline-container" }, h("div", { class: "textarea-outline-start" }), h("div", { class: {
                        'textarea-outline-notch': true,
                        'textarea-outline-notch-hidden': !this.hasLabel,
                    } }, h("div", { class: "notch-spacer", "aria-hidden": "true", ref: (el) => (this.notchSpacerEl = el) }, this.label)), h("div", { class: "textarea-outline-end" })),
                this.renderLabel(),
            ];
        }
        /**
         * If not using the outline style,
         * we can render just the label.
         */
        return this.renderLabel();
    }
    /**
     * Renders the helper text or error text values
     */
    renderHintText() {
        const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
        return [
            h("div", { id: helperTextId, class: "helper-text", part: "supporting-text helper-text", "aria-live": "polite" }, !isInvalid ? helperText : null),
            h("div", { id: errorTextId, class: "error-text", part: "supporting-text error-text", role: "alert" }, isInvalid ? errorText : null),
        ];
    }
    getHintTextID() {
        const { isInvalid, helperText, errorText, helperTextId, errorTextId } = this;
        if (isInvalid && errorText) {
            return errorTextId;
        }
        if (helperText) {
            return helperTextId;
        }
        return undefined;
    }
    renderCounter() {
        const { counter, maxlength, counterFormatter, value } = this;
        if (counter !== true || maxlength === undefined) {
            return;
        }
        return (h("div", { class: "counter", part: "counter" }, getCounterText(value, maxlength, counterFormatter)));
    }
    /**
     * Responsible for rendering helper text,
     * error text, and counter. This element should only
     * be rendered if hint text is set or counter is enabled.
     */
    renderBottomContent() {
        const { counter, helperText, errorText, maxlength } = this;
        /**
         * undefined and empty string values should
         * be treated as not having helper/error text.
         */
        const hasHintText = !!helperText || !!errorText;
        const hasCounter = counter === true && maxlength !== undefined;
        if (!hasHintText && !hasCounter) {
            return;
        }
        return (h("div", { class: "textarea-bottom", part: "bottom" }, this.renderHintText(), this.renderCounter()));
    }
    render() {
        const { inputId, disabled, readonly, size, labelPlacement, el, hasFocus } = this;
        const fill = this.getFill();
        const theme = getIonTheme(this);
        const shape = this.getShape();
        const value = this.getValue();
        const inItem = hostContext('ion-item', this.el);
        const shouldRenderHighlight = theme === 'md' && fill !== 'outline' && !inItem;
        const hasValue = this.hasValue();
        const hasStartEndSlots = el.querySelector('[slot="start"], [slot="end"]') !== null;
        /**
         * If the label is stacked, it should always sit above the textarea.
         * For floating labels, the label should move above the textarea if
         * the textarea has a value, is focused, or has anything in either
         * the start or end slot.
         *
         * If there is content in the start slot, the label would overlap
         * it if not forced to float. This is also applied to the end slot
         * because with the default or solid fills, the textarea is not
         * vertically centered in the container, but the label is. This
         * causes the slots and label to appear vertically offset from each
         * other when the label isn't floating above the input. This doesn't
         * apply to the outline fill, but this was not accounted for to keep
         * things consistent.
         *
         * TODO(FW-5592): Remove hasStartEndSlots condition
         */
        const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
        return (h(Host, { key: '5be3ab7c5adf5ef61d70aff916d233239cc3034e', class: createColorClasses(this.color, {
                [theme]: true,
                'has-value': hasValue,
                'has-focus': hasFocus,
                'label-floating': labelShouldFloat,
                [`textarea-fill-${fill}`]: fill !== undefined,
                [`textarea-shape-${shape}`]: shape !== undefined,
                [`textarea-size-${size}`]: true,
                [`textarea-label-placement-${labelPlacement}`]: true,
                'in-item': inItem,
                'textarea-disabled': disabled,
                'textarea-readonly': readonly,
            }) }, h("label", { key: '7eb9826e9618606e1de74cb842c9236a2b5d0cb4', class: "textarea-wrapper", htmlFor: inputId, onClick: this.onLabelClick, part: "wrapper" }, this.renderLabelContainer(), h("div", { key: 'f351e5a51a0ee995bb6a08f35777166e4da922c2', class: "textarea-wrapper-inner", "data-attr-rows": this.rows !== undefined ? this.rows.toString() : undefined }, 
        /**
         * For the ionic theme, we render the outline container here
         * instead of higher up, so it can be positioned relative to
         * the native wrapper instead of the <label> element or the
         * entire component. This allows the label text to be positioned
         * above the outline, while staying within the bounds of the
         * <label> element, ensuring that clicking the label text
         * focuses the textarea.
         */
        theme === 'ionic' && fill === 'outline' && h("div", { key: '7e4c28115bc77c79a72c155b5e8ebfeeda1a64f8', class: "textarea-outline" }), h("div", { key: '104f49bd68dde7a0a98376effa9cb8b28ff9282b', class: "start-slot-wrapper" }, h("slot", { key: '2df3634d16e38450c4d312cd4ed8468640d8d796', name: "start" })), h("div", { key: 'ce440dcc385e4f94894a460c6c70c7d7ec0f8949', class: "native-wrapper", ref: (el) => (this.textareaWrapper = el), part: "container" }, h("textarea", Object.assign({ key: '949c986f2a279d49e348a0ded381981356670c8a', class: "native-textarea", part: "native", ref: (el) => (this.nativeInput = el), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown, "aria-describedby": this.getHintTextID(), "aria-invalid": this.isInvalid ? 'true' : undefined }, this.inheritedAttributes), value)), h("div", { key: '991ddbf1560b4590acbe78fb63c772637599a3fa', class: "end-slot-wrapper" }, h("slot", { key: '22635c13a8766770c683139394d2b27eefd78ea9', name: "end" }))), shouldRenderHighlight && h("div", { key: 'de9ec0d62a7dde0831ebb753efa547fb1c183e63', class: "textarea-highlight" })), this.renderBottomContent()));
    }
    static get delegatesFocus() { return true; }
    static get formAssociated() { return true; }
    get el() { return getElement(this); }
    static get watchers() { return {
        "debounce": ["debounceChanged"],
        "disabled": ["disabledChanged"],
        "value": ["valueChanged"],
        "required": ["requiredChanged"],
        "dir": ["onDirChanged"]
    }; }
};
let textareaIds = 0;
Textarea.style = {
    ionic: textareaIonicCss,
    ios: textareaIosCss,
    md: textareaMdCss
};

export { Textarea as ion_textarea };
