import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { d as defineCustomElement$1 } from './ecl-icon2.js';

const eclFormGroupEcCss = ".ecl-form-group.sc-ecl-form-group-ec{align-items:flex-start;border-width:0;box-sizing:border-box;display:block;margin:0;padding:0}.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+*.sc-ecl-form-group-ec{margin-top:0.75rem}.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-feedback-message.sc-ecl-form-group-ec{margin-top:0.5rem}.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-help-block.sc-ecl-form-group-ec{margin-top:0.5rem}.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-checkbox.sc-ecl-form-group-ec,.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-radio.sc-ecl-form-group-ec{margin-top:0.75rem}.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-checkbox.sc-ecl-form-group-ec~.ecl-checkbox.sc-ecl-form-group-ec,.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-checkbox.sc-ecl-form-group-ec~.ecl-radio.sc-ecl-form-group-ec,.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-radio.sc-ecl-form-group-ec~.ecl-checkbox.sc-ecl-form-group-ec,.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-radio.sc-ecl-form-group-ec~.ecl-radio.sc-ecl-form-group-ec{margin-top:1.5rem}.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-radio--binary.sc-ecl-form-group-ec{margin-top:1rem}.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-radio--binary.sc-ecl-form-group-ec~.ecl-radio--binary.sc-ecl-form-group-ec{margin-top:1rem}.ecl-form-group.sc-ecl-form-group-ec>.ecl-checkbox.sc-ecl-form-group-ec:first-child+.ecl-checkbox.sc-ecl-form-group-ec,.ecl-form-group.sc-ecl-form-group-ec>.ecl-radio.sc-ecl-form-group-ec:first-child+.ecl-radio.sc-ecl-form-group-ec:not(.ecl-radio--binary){margin-top:1.5rem}.ecl-form-group.sc-ecl-form-group-ec>.ecl-radio--binary.sc-ecl-form-group-ec:first-child+.ecl-radio--binary.sc-ecl-form-group-ec{margin-top:0}.ecl-form-group.sc-ecl-form-group-ec>*.sc-ecl-form-group-ec:not(.ecl-u-sr-only)+.ecl-file-upload__list.sc-ecl-form-group-ec{margin-top:1rem}.ecl-form-group.sc-ecl-form-group-ec>.ecl-feedback-message.sc-ecl-form-group-ec+.ecl-help-block.sc-ecl-form-group-ec{margin-top:0}.ecl-feedback-message.sc-ecl-form-group-ec{align-items:center;box-sizing:border-box;color:#da2131;display:flex;font:normal normal 400 0.875rem/1.25rem arial, sans-serif;margin:0;padding:0}.ecl-feedback-message__icon.sc-ecl-form-group-ec{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}.ecl-help-block.sc-ecl-form-group-ec{box-sizing:border-box;color:#404040;display:block;font:normal normal 400 0.875rem/1.25rem arial, sans-serif;margin:0;padding:0}.ecl-form-label.sc-ecl-form-group-ec{box-sizing:border-box;color:#404040;display:inline-flex;font:normal normal 400 1rem/1.5rem arial, sans-serif;font-weight:700;margin:0;padding:0;white-space:pre-wrap}.ecl-form-label__required.sc-ecl-form-group-ec{color:#da2131;font:normal normal 400 1rem/1.25rem arial, sans-serif;font-weight:700;-webkit-margin-start:0.25rem;margin-inline-start:0.25rem}.ecl-form-label__optional.sc-ecl-form-group-ec{color:#404040;font:normal normal 400 1rem/1.25rem arial, sans-serif;font-style:italic;font-weight:400}.ecl-feedback-message__icon.sc-ecl-form-group-ec.sc-ecl-form-group-ec{-webkit-margin-end:0.5rem !important;margin-inline-end:0.5rem !important;vertical-align:bottom}.ecl-form-label__optional.sc-ecl-form-group-ec{align-self:center;-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}";

const eclFormGroupEuCss = ".ecl-form-group.sc-ecl-form-group-eu{align-items:flex-start;border-width:0;box-sizing:border-box;display:block;margin:0;padding:0}.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+*.sc-ecl-form-group-eu{margin-top:0.5rem}.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-feedback-message.sc-ecl-form-group-eu{margin-top:0.25rem}.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-help-block.sc-ecl-form-group-eu{margin-top:0.5rem}.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-checkbox.sc-ecl-form-group-eu,.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-radio.sc-ecl-form-group-eu{margin-top:1rem}.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-checkbox.sc-ecl-form-group-eu~.ecl-checkbox.sc-ecl-form-group-eu,.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-checkbox.sc-ecl-form-group-eu~.ecl-radio.sc-ecl-form-group-eu,.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-radio.sc-ecl-form-group-eu~.ecl-checkbox.sc-ecl-form-group-eu,.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-radio.sc-ecl-form-group-eu~.ecl-radio.sc-ecl-form-group-eu{margin-top:1.5rem}.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-radio--binary.sc-ecl-form-group-eu{margin-top:1rem}.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-radio--binary.sc-ecl-form-group-eu~.ecl-radio--binary.sc-ecl-form-group-eu{margin-top:1rem}.ecl-form-group.sc-ecl-form-group-eu>.ecl-checkbox.sc-ecl-form-group-eu:first-child+.ecl-checkbox.sc-ecl-form-group-eu,.ecl-form-group.sc-ecl-form-group-eu>.ecl-radio.sc-ecl-form-group-eu:first-child+.ecl-radio.sc-ecl-form-group-eu:not(.ecl-radio--binary){margin-top:1.5rem}.ecl-form-group.sc-ecl-form-group-eu>.ecl-radio--binary.sc-ecl-form-group-eu:first-child+.ecl-radio--binary.sc-ecl-form-group-eu{margin-top:0}.ecl-form-group.sc-ecl-form-group-eu>*.sc-ecl-form-group-eu:not(.ecl-u-sr-only)+.ecl-file-upload__list.sc-ecl-form-group-eu{margin-top:1rem}.ecl-form-group.sc-ecl-form-group-eu>.ecl-feedback-message.sc-ecl-form-group-eu+.ecl-help-block.sc-ecl-form-group-eu{margin-top:0}.ecl-feedback-message.sc-ecl-form-group-eu{align-items:center;box-sizing:border-box;color:#bf0036;display:flex;font:normal normal 400 1rem/1.5rem arial, sans-serif;margin:0;padding:0}.ecl-feedback-message__icon.sc-ecl-form-group-eu{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}.ecl-help-block.sc-ecl-form-group-eu{box-sizing:border-box;color:#515560;display:block;font:normal normal 400 1rem/1.5rem arial, sans-serif;margin:0;padding:0}.ecl-form-label.sc-ecl-form-group-eu{box-sizing:border-box;color:#171a22;display:inline-flex;font:normal normal 400 1rem/1.5rem arial, sans-serif;font-weight:700;margin:0;padding:0;white-space:pre-wrap}.ecl-form-label__required.sc-ecl-form-group-eu{color:#bf0036;font:normal normal 400 1rem/1.25rem arial, sans-serif;font-weight:700;-webkit-margin-start:0.25rem;margin-inline-start:0.25rem}.ecl-form-label__optional.sc-ecl-form-group-eu{color:#515560;font:normal normal 400 1rem/1.25rem arial, sans-serif;font-style:italic;font-weight:400}.ecl-feedback-message__icon.sc-ecl-form-group-eu.sc-ecl-form-group-eu{-webkit-margin-end:0.5rem !important;margin-inline-end:0.5rem !important;vertical-align:bottom}.ecl-form-label__optional.sc-ecl-form-group-eu{align-self:center;-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}";

const EclFormGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.styleClass = '';
    this.theme = 'ec';
    this.label = undefined;
    this.invalid = false;
    this.required = false;
    this.requiredText = '*';
    this.optionalText = undefined;
    this.invalidText = undefined;
    this.helperText = undefined;
    this.helperId = undefined;
    this.name = undefined;
    this.invalidIcon = 'error';
    this.labelClass = undefined;
  }
  getClass() {
    return [
      `ecl-form-group`,
      this.styleClass
    ].join(' ');
  }
  render() {
    return (h("fieldset", { class: this.getClass(), "aria-describedby": this.helperId }, this.label ?
      h("legend", { class: `ecl-form-label ${this.invalid ? 'ecl-form-label--invalid' : ''} ${this.labelClass || ''}` }, this.label, this.required && this.requiredText ?
        h("span", { class: "ecl-form-label__required" }, this.requiredText) : '', !this.required && this.optionalText ?
        h("span", { class: "ecl-form-label__optional" }, this.optionalText) : '') : '', this.helperText ?
      h("div", { class: "ecl-help-block" }, this.helperText) : '', this.invalid && this.invalidText ?
      h("div", { class: "ecl-feedback-message" }, this.invalidIcon ?
        h("ecl-icon", { styleClass: `ecl-feedback-message__icon sc-ecl-form-group-${this.theme}`, icon: this.invalidIcon, size: "m" }) : '', this.invalidText) : '', h("slot", null)));
  }
  static get style() { return {
    ec: eclFormGroupEcCss,
    eu: eclFormGroupEuCss
  }; }
}, [38, "ecl-form-group", {
    "styleClass": [1, "style-class"],
    "theme": [1],
    "label": [1],
    "invalid": [4],
    "required": [4],
    "requiredText": [1, "required-text"],
    "optionalText": [1, "optional-text"],
    "invalidText": [1, "invalid-text"],
    "helperText": [1, "helper-text"],
    "helperId": [1, "helper-id"],
    "name": [1],
    "invalidIcon": [1, "invalid-icon"],
    "labelClass": [1, "label-class"]
  }]);
function defineCustomElement() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["ecl-form-group", "ecl-icon"];
  components.forEach(tagName => { switch (tagName) {
    case "ecl-form-group":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, EclFormGroup);
      }
      break;
    case "ecl-icon":
      if (!customElements.get(tagName)) {
        defineCustomElement$1();
      }
      break;
  } });
}

export { EclFormGroup as E, defineCustomElement as d };

//# sourceMappingURL=ecl-form-group2.js.map