var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component, Host, h, Prop, Element, Event, Watch } from '@stencil/core';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer, methodPlaceholder, slotPlaceholder, } from 'vega-slimmer/core';
import { sanitizeVegaComponent } from '../../utils/component';
import { VegaAccordionRenderer } from './slimmers/vega-accordion-renderer';
import { VegaAccordionExpandController } from './slimmers/vega-accordion-expand-controller';
import { createEventEmitSlimmer, } from '../../helpers/event-manager/slimmers/event-emit-slimmer';
import { VegaExpand } from '../../helpers/event-manager/event-id/vega-event-id';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../helpers/slimmers/component-usage-runtime-metrics';
import { TranslationSlimmer } from '../../helpers/slimmers/translation';
/**
 * @vegaVersion 1.0.4
 */
export class VegaAccordion {
  constructor() {
    this.globalSlimmers = {};
    this.renderer = new VegaAccordionRenderer();
    this.expandController = new VegaAccordionExpandController();
    this.translationSlimmer = new TranslationSlimmer();
    this.expandEventEmitter = createEventEmitSlimmer(VegaAccordion, VegaExpand, 'accordionExpand');
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
    /**
     * Determines whether the accordion block should be displayed
     *    with its default background color `bg-primary`
     *    and padding of `size-24`.
     *
     * @vegaVersion 1.3.0
     */
    this.drawsBackground = true;
    /**
     * Specifies the placement of the expand icon in the accordion.
     *
     * @vegaVersion 1.3.0
     */
    this.expandIconAlign = 'right';
    /* this property is modified by a slimmer */
    /**
     * Controls whether the accordion is expanded.
     *
     * @vegaVersion 1.0.4
     */
    /* eslint-disable-next-line @stencil/strict-mutable */
    this.expand = true;
    /**
     * Specifies the vertical placement of the prefix icon
     *    and expand icon within the accordion.
     *
     * @vegaVersion 1.8.1
     */
    this.iconPosition = 'top';
    /**
     * Specifies whether to display or hide the expand icon in the accordion.
     *
     * It can be provided as a ResponsiveType or boolean value.
     *
     * @vegaVersion 1.3.0
     */
    this.showExpandIcon = true;
  }
  watchExpand() {
    methodPlaceholder();
  }
  render() {
    slotPlaceholder(h("slot", null));
    return sanitizeVegaComponent(h(Host, null, this.renderer.render()), this.host);
  }
  static get is() { return "vega-accordion"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-accordion.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-accordion.css"]
  }; }
  static get properties() { return {
    "drawsBackground": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Determines whether the accordion block should be displayed\n   with its default background color `bg-primary`\n   and padding of `size-24`."
      },
      "attribute": "draws-background",
      "reflect": false,
      "defaultValue": "true"
    },
    "prefixIcon": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Specifies an optional icon to be displayed\n   alongside the accordion's title."
      },
      "attribute": "prefix-icon",
      "reflect": false
    },
    "accordionTitle": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Specifies the title of the accordion.\n\nIf the title exceeds the maximum width,\n   it will be displayed on a new line to\n   ensure visibility and readability."
      },
      "attribute": "accordion-title",
      "reflect": false
    },
    "expandIconAlign": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "'left' | 'right'",
        "resolved": "\"left\" | \"right\"",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Specifies the placement of the expand icon in the accordion."
      },
      "attribute": "expand-icon-align",
      "reflect": false,
      "defaultValue": "'right'"
    },
    "expand": {
      "type": "boolean",
      "mutable": true,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.0.4"
          }],
        "text": "Controls whether the accordion is expanded."
      },
      "attribute": "expand",
      "reflect": false,
      "defaultValue": "true"
    },
    "iconPosition": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "'top' | 'center'",
        "resolved": "\"center\" | \"top\"",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.8.1"
          }],
        "text": "Specifies the vertical placement of the prefix icon\n   and expand icon within the accordion."
      },
      "attribute": "icon-position",
      "reflect": false,
      "defaultValue": "'top'"
    },
    "showExpandIcon": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "ResponsiveType<boolean>",
        "resolved": "boolean | { S?: boolean; M?: boolean; L?: boolean; XL?: boolean; default?: boolean; }",
        "references": {
          "ResponsiveType": {
            "location": "import",
            "path": "../../types/ui.type"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Specifies whether to display or hide the expand icon in the accordion.\n\nIt can be provided as a ResponsiveType or boolean value."
      },
      "attribute": "show-expand-icon",
      "reflect": false,
      "defaultValue": "true"
    },
    "groupId": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Specifies the unique group ID for enabling accordion functionality.\n\nUse this parameter to assign a specific group ID to the accordions that should be grouped together,\n   ensuring that only one accordion can be expanded at a time within the same group."
      },
      "attribute": "group-id",
      "reflect": false
    }
  }; }
  static get events() { return [{
      "method": "vegaExpand",
      "name": "vegaExpand",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "An event emitter notifying the expand event of the accordion."
      },
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      }
    }, {
      "method": "accordionExpand",
      "name": "accordionExpand",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "eventSemantics",
            "text": "namespace:native"
          }, {
            "name": "vegaVersion",
            "text": "2.0.0"
          }],
        "text": "An event emitter notifying the expand event of the accordion.\nexpand is an attribute, so the event name here uses accordionExpand"
      },
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      }
    }]; }
  static get elementRef() { return "host"; }
  static get watchers() { return [{
      "propName": "expand",
      "methodName": "watchExpand"
    }]; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaAccordion.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaAccordion.prototype, "renderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaAccordion.prototype, "expandController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaAccordion.prototype, "translationSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaAccordion.prototype, "expandEventEmitter", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaAccordion.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
