import { NgModule, Component, HostBinding, Input, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
import { CommonModule } from '@angular/common';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { EuiIconModule } from '../atoms';
import { BaseDirective } from '../../base.directive';
import { EuiLabelModule } from '../atoms';
import { TranslateModule } from '@ngx-translate/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../atoms/eui-icon/eui-icon.component";
const _c0 = ["euiButton", ""];
function EuiButtonComponent_span_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 2);
    i0.ɵɵelement(1, "eui-icon", 3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("isLoading", true);
} }
const _c1 = ["*"];
export class EuiButtonComponent extends BaseDirective {
    constructor() {
        super();
        this._euiBasicButton = false;
        this._euiButtonCall = false;
        this._euiButtonBlock = false;
        this._euiBlockButton = false;
        this._euiRaisedButton = false;
        this._isLoading = false;
        this._euiIconButton = false;
        this._euiLineWrap = false;
        this.e2eAttr = 'eui-button';
        this.role = 'button'; // in case eui-button selector is used and not the button html element
    }
    get euiBasicButton() { return this._euiBasicButton; }
    set euiBasicButton(value) { this._euiBasicButton = coerceBooleanProperty(value); }
    get euiButtonCall() { return this._euiButtonCall; }
    set euiButtonCall(value) { this._euiButtonCall = coerceBooleanProperty(value); }
    get euiButtonBlock() { return this._euiButtonBlock; }
    set euiButtonBlock(value) { this._euiButtonBlock = coerceBooleanProperty(value); }
    get euiBlockButton() { return this._euiBlockButton; }
    set euiBlockButton(value) { this._euiBlockButton = coerceBooleanProperty(value); }
    get euiRaisedButton() { return this._euiRaisedButton; }
    set euiRaisedButton(value) { this._euiRaisedButton = coerceBooleanProperty(value); }
    get isLoading() { return this._isLoading; }
    set isLoading(value) { this._isLoading = coerceBooleanProperty(value); }
    get euiIconButton() { return this._euiIconButton; }
    set euiIconButton(value) { this._euiIconButton = coerceBooleanProperty(value); }
    get euiLineWrap() { return this._euiLineWrap; }
    set euiLineWrap(value) { this._euiLineWrap = coerceBooleanProperty(value); }
    get cssClasses() {
        return [
            this.euiBasicButton ? `eui-button--basic` : ``,
            this.euiButtonBlock ? `eui-button--block` : ``,
            this.euiRaisedButton ? `eui-button--raised` : ``,
            this.euiBlockButton ? `eui-button--block` : ``,
            this.isLoading ? `eui-button--loading` : ``,
            this.euiIconButton ? `eui-button--icon-only` : ``,
            this.euiLineWrap ? `eui-button--line-wrap` : ``,
            super.getCssClasses('eui-button'),
        ].join(' ').trim();
    }
}
/** @nocollapse */ EuiButtonComponent.ɵfac = function EuiButtonComponent_Factory(t) { return new (t || EuiButtonComponent)(); };
/** @nocollapse */ EuiButtonComponent.ɵcmp = i0.ɵɵdefineComponent({ type: EuiButtonComponent, selectors: [["button", "euiButton", ""], ["eui-button"]], hostVars: 4, hostBindings: function EuiButtonComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵattribute("data-e2e", ctx.e2eAttr)("role", ctx.role);
        i0.ɵɵclassMap(ctx.cssClasses);
    } }, inputs: { euiBasicButton: "euiBasicButton", euiButtonCall: "euiButtonCall", euiButtonBlock: "euiButtonBlock", euiBlockButton: "euiBlockButton", euiRaisedButton: "euiRaisedButton", isLoading: "isLoading", euiIconButton: "euiIconButton", euiLineWrap: "euiLineWrap", e2eAttr: "e2eAttr" }, features: [i0.ɵɵInheritDefinitionFeature], attrs: _c0, ngContentSelectors: _c1, decls: 3, vars: 1, consts: [[1, "eui-button__container"], ["class", "eui-button__loading-icon", 4, "ngIf"], [1, "eui-button__loading-icon"], [3, "isLoading"]], template: function EuiButtonComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵprojectionDef();
        i0.ɵɵelementStart(0, "span", 0);
        i0.ɵɵtemplate(1, EuiButtonComponent_span_1_Template, 2, 1, "span", 1);
        i0.ɵɵprojection(2);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.isLoading);
    } }, directives: [i1.NgIf, i2.EuiIconComponent], styles: ["[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:none}.eui-button{align-items:center;background-color:var(--eui-color-white);background-image:none;border:none;border-radius:var(--eui-border-radius-base);box-sizing:border-box;cursor:pointer;display:inline-flex;flex-shrink:0;font-size:var(--eui-font-size);font-style:normal;font-weight:400;justify-content:center;line-height:inherit;margin:0;min-height:calc(var(--eui-spacing-2xl) + var(--eui-spacing-2xs));min-width:calc(var(--eui-spacing-2xl) + var(--eui-spacing-2xs));outline:none;padding:calc(var(--eui-spacing-s) - 1px) var(--eui-spacing-m);text-transform:none;transition:none;vertical-align:middle;white-space:nowrap}.eui-button.active,.eui-button:active,.eui-button:focus{border-color:var(--eui-color-accessible-focus)!important;box-shadow:inset 0 0 0 1px var(--eui-color-accessible-focus),inset 0 0 0 2px var(--eui-color-grey-lightester);outline:none;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;z-index:1}.eui-button .eui-button__container{align-items:center;display:inline-flex;position:relative}.eui-button .eui-button__container .eui-icon{font-size:var(--eui-font-size-xl)}.eui-button .eui-button__container .fa{font-size:var(--eui-font-size);padding-right:var(--eui-spacing-2xs)}.eui-button .eui-button__container .eui-icon:first-child:not(.eui-u-loading),.eui-button .eui-button__container>.eui-icon:not(.eui-u-loading){margin-right:var(--eui-spacing-xs)}.eui-button .eui-button__container .eui-icon:first-child:not(.eui-u-loading):not(.eui-button--icon-only),.eui-button .eui-button__container>.eui-icon:not(.eui-u-loading):not(.eui-button--icon-only){margin-left:0}.eui-button .eui-button__container .eui-icon:last-child:not(.eui-u-loading){margin-left:var(--eui-spacing-xs)}.eui-button .eui-button__container .eui-icon:last-child:not(.eui-u-loading):not(.eui-button--icon-only){margin-right:0}.eui-button .eui-button__container .eui-label+.eui-badge{margin-left:var(--eui-spacing-s);max-height:calc(var(--eui-spacing-m) + var(--eui-spacing-2xs))}.eui-button .eui-button__container .eui-label+.eui-icon{margin-left:var(--eui-spacing-s)}.eui-button--icon-only{padding:var(--eui-spacing-xs) 0}.eui-button .eui-button__loading-icon{align-items:center;display:inline-flex}.eui-button .eui-button__loading-icon .eui-icon.eui-u-loading{margin-right:var(--eui-spacing-xl)}.eui-button--fixed{bottom:calc(var(--eui-layout-footer-height) + var(--eui-spacing));position:fixed;right:var(--eui-spacing-xl);z-index:var(--eui-z-index-btn-floating)}.eui-button-floating{align-items:center;border-radius:100%;box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);display:inline-flex;height:var(--eui-spacing-3xl);overflow:hidden;padding:0;position:relative;transform:translateY(35%);transition:.3s;vertical-align:middle;width:var(--eui-spacing-3xl);z-index:1}.eui-button-floating:hover{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);cursor:pointer}.eui-button-floating .eui-icon{display:inline-block;font-size:var(--eui-font-size-3xl);text-align:center;width:inherit}.eui-button-floating:before{border-radius:0}a.eui-button{text-decoration:none}a.eui-button:active,a.eui-button:focus,a.eui-button:hover{color:var(--eui-color-white);text-decoration:none}a.eui-button.eui-button--accent:hover,a.eui-button.eui-button--secondary:hover{color:var(--eui-color)}.eui-button__expand-trigger{border-top:1px solid var(--eui-color-grey-lighter);cursor:pointer;display:flex;justify-content:center;margin-bottom:var(--eui-spacing-l);width:100%;z-index:1}.eui-button__expand-trigger:hover .eui-button--expand-toggle{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12)!important}.eui-button__expand-trigger--collapsed{margin-top:var(--eui-spacing-s)}.eui-button__expand-trigger .eui-icon+.eui-label,.eui-button__expand-trigger .eui-label+.eui-icon{margin-left:var(--eui-spacing-s)}.eui-split-button{align-items:center;display:inline-flex;position:relative}.eui-split-button--disabled,.eui-split-button:disabled{pointer-events:none}.eui-split-button button{border-radius:var(--eui-border-radius-base) 0 0 var(--eui-border-radius-base);cursor:pointer}.eui-split-button .eui-dropdown button{border-radius:0 var(--eui-border-radius-base) var(--eui-border-radius-base) 0;margin-left:-1px}.eui-dropdown-button{align-items:center;display:inline-flex;flex-shrink:0;justify-content:center;position:relative}.eui-dropdown-button--disabled,.eui-dropdown-button:disabled{pointer-events:none}.eui-button--size-s{height:calc(var(--eui-spacing)*2);min-height:calc(var(--eui-spacing)*2);min-width:calc(var(--eui-spacing)*2);padding:0 var(--eui-spacing-s)}.eui-button--size-s .eui-button__container{font-size:var(--eui-font-size-s)}.eui-button--size-s .eui-button__container .eui-icon{font-size:var(--eui-font-size-xl)}.eui-button--size-s.eui-button--icon-only{padding:0}.eui-button--size-m .eui-button__container{font-size:var(--eui-font-size)}.eui-button--size-m .eui-button__container .eui-icon{font-size:var(--eui-font-size-xl)}.eui-button--size-l{height:calc(var(--eui-spacing)*3.25);min-height:calc(var(--eui-spacing)*3.25);min-width:calc(var(--eui-spacing)*3.25)}.eui-button--size-l .eui-button__container{font-size:var(--eui-font-size-l)}.eui-button--size-l .eui-button__container .eui-label+.eui-badge{max-height:inherit}.eui-button--size-l .eui-button__container .eui-icon{font-size:var(--eui-font-size-2xl)}.eui-button{border:1px solid}.eui-button--primary{background-color:#004494;border-color:var(--eui-color-primary-darker);color:#fff}.eui-button--primary:focus,.eui-button--primary:hover{background-color:var(--eui-color-primary-light)}.eui-button--secondary{background-color:var(--eui-color-white);border-color:var(--eui-color-grey-light);color:var(--eui-color-grey-dark)}.eui-button--secondary:focus,.eui-button--secondary:hover{background-color:var(--eui-color-grey-lightest);border-color:var(--eui-color-grey)}.eui-button--info{background-color:#006fb4;border-color:var(--eui-color-info-darker);color:#fff}.eui-button--info:focus,.eui-button--info:hover{background-color:var(--eui-color-info-light)}.eui-button--success{background-color:#467a39;border-color:var(--eui-color-success-darker);color:#fff}.eui-button--success:focus,.eui-button--success:hover{background-color:var(--eui-color-success-light)}.eui-button--warning{background-color:#f29527;border-color:var(--eui-color-warning-darker);color:var(--eui-color-font);color:#333}.eui-button--warning:focus,.eui-button--warning:hover{background-color:var(--eui-color-warning-light)}.eui-button--danger{background-color:var(--eui-color-danger);border-color:var(--eui-color-danger-darker);color:#fff}.eui-button--danger:focus,.eui-button--danger:hover{background-color:var(--eui-color-danger-light)}.eui-button--accent{background-color:var(--eui-color-accent);border-color:var(--eui-color-accent-darker);color:var(--eui-color-font);color:#333}.eui-button--accent:focus,.eui-button--accent:hover{background-color:var(--eui-color-accent-light)}.eui-button--basic{background-color:initial;border:1px solid transparent}.eui-button--basic:focus,.eui-button--basic:hover{background-color:var(--eui-color-grey-lightest);border:1px solid transparent;border-radius:var(--eui-border-radius-base)}.eui-button--basic.eui-button--primary{color:var(--eui-color-primary-light)}.eui-button--basic.eui-button--primary:focus,.eui-button--basic.eui-button--primary:hover{background-color:var(--eui-color-primary-lightester-2);color:var(--eui-color-primary-dark)}.eui-button--basic.eui-button--secondary{color:var(--eui-color-grey-darker)}.eui-button--basic.eui-button--secondary:hover{background-color:var(--eui-color-grey-lightest)}.eui-button--basic.eui-button--info{color:var(--eui-color-info)}.eui-button--basic.eui-button--info:focus,.eui-button--basic.eui-button--info:hover{background-color:var(--eui-color-info-lightester-2);color:var(--eui-color-info-dark)}.eui-button--basic.eui-button--success{color:var(--eui-color-success)}.eui-button--basic.eui-button--success:focus,.eui-button--basic.eui-button--success:hover{background-color:var(--eui-color-success-lightester-2);color:var(--eui-color-success-dark)}.eui-button--basic.eui-button--warning{color:#915917}.eui-button--basic.eui-button--warning:focus,.eui-button--basic.eui-button--warning:hover{background-color:var(--eui-color-warning-lightester)}.eui-button--basic.eui-button--danger{color:var(--eui-color-danger)}.eui-button--basic.eui-button--danger:focus,.eui-button--basic.eui-button--danger:hover{background-color:var(--eui-color-danger-lightester-2);color:var(--eui-color-danger-dark)}.eui-button--outline{background-color:var(--eui-color-white)}.eui-button--outline.eui-button--primary{border-color:var(--eui-color-primary);color:var(--eui-color-primary)}.eui-button--outline.eui-button--primary:hover{background-color:var(--eui-color-primary-light);color:var(--eui-color-white)}.eui-button--outline.eui-button--primary.active,.eui-button--outline.eui-button--primary:focus{background-color:var(--eui-color-primary);color:var(--eui-color-white)}.eui-button--outline.eui-button--secondary{border-color:var(--eui-color-grey);color:var(--eui-color-grey-darker)}.eui-button--outline.eui-button--secondary:hover{background-color:var(--eui-color-grey-lightest);color:var(--eui-color-grey-darker)}.eui-button--outline.eui-button--secondary.active,.eui-button--outline.eui-button--secondary:focus{background-color:var(--eui-color-grey-lighter);color:var(--eui-color)}.eui-button--outline.eui-button--info{border-color:var(--eui-color-info);color:var(--eui-color-info)}.eui-button--outline.eui-button--info:hover{background-color:var(--eui-color-info-light);color:var(--eui-color-white)}.eui-button--outline.eui-button--info.active,.eui-button--outline.eui-button--info:focus{background-color:var(--eui-color-info);color:var(--eui-color-white)}.eui-button--outline.eui-button--success{border-color:var(--eui-color-success);color:var(--eui-color-success)}.eui-button--outline.eui-button--success:hover{background-color:var(--eui-color-success-light);color:var(--eui-color-white)}.eui-button--outline.eui-button--success.active,.eui-button--outline.eui-button--success:focus{background-color:var(--eui-color-success);color:var(--eui-color-white)}.eui-button--outline.eui-button--warning{border-color:var(--eui-color-warning);color:#915917}.eui-button--outline.eui-button--warning:hover{background-color:var(--eui-color-warning-light);color:var(--eui-color-font)}.eui-button--outline.eui-button--warning.active,.eui-button--outline.eui-button--warning:focus{background-color:var(--eui-color-warning);color:var(--eui-color-font)}.eui-button--outline.eui-button--danger{border-color:var(--eui-color-danger);color:var(--eui-color-danger)}.eui-button--outline.eui-button--danger:hover{background-color:var(--eui-color-danger-light);color:var(--eui-color-white)}.eui-button--outline.eui-button--danger.active,.eui-button--outline.eui-button--danger:focus{background-color:var(--eui-color-danger);color:var(--eui-color-white)}.eui-button--outline.eui-button--accent{border-color:var(--eui-color-accent-darker);color:var(--eui-color-font)}.eui-button--outline.eui-button--accent:hover{background-color:var(--eui-color-accent-light);color:var(--eui-color)}.eui-button--outline.eui-button--accent.active,.eui-button--outline.eui-button--accent:focus{background-color:var(--eui-color-accent);color:var(--eui-color)}.eui-button--raised{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)!important}.eui-button--raised:focus,.eui-button--raised:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)!important}.eui-button--raised.eui-button--secondary,.eui-button--raised.eui-button--secondary:hover{border-color:transparent}.eui-button--rounded,.eui-button--rounded:hover{border-radius:50%}.eui-button--rounded:active,.eui-button--rounded:focus{border:2px solid var(--eui-color-accessible-focus);border-radius:50%;height:calc(var(--eui-spacing-xl)*1);outline:none;transition:border .15s ease-in-out;width:calc(var(--eui-spacing-xl)*1)}.eui-button--responsive{position:relative;width:100%}.eui-button--responsive .eui-button__container{overflow:hidden}.eui-button--responsive .eui-button__container>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-button--responsive .eui-button__container .eui-icon{overflow:visible}.eui-button--block{display:block;width:100%}.eui-button--line-wrap{line-height:var(--eui-line-height-base);padding:var(--eui-spacing-s);white-space:normal}.eui-button--expand-toggle{background:var(--eui-color-white);border-color:transparent;border-radius:0 0 var(--eui-spacing-xs) var(--eui-spacing-xs);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12)!important;min-height:var(--eui-spacing);padding:0 var(--eui-spacing-xl)}.eui-button--expand-toggle:focus,.eui-button--expand-toggle:hover{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12)!important}.eui-button--expand-toggle .eui-icon{color:var(--eui-color-grey-dark);font-size:var(--eui-font-size-l)}.eui-button.disabled,.eui-button:disabled{background-image:none;box-shadow:none;cursor:not-allowed;opacity:var(--eui-disabled-opacity-base);pointer-events:none}"], encapsulation: 2, changeDetection: 0 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiButtonComponent, [{
        type: Component,
        args: [{
                templateUrl: './eui-button.component.html',
                selector: 'button[euiButton], eui-button',
                styleUrls: ['./styles/_index.scss'],
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None,
            }]
    }], function () { return []; }, { euiBasicButton: [{
            type: Input
        }], euiButtonCall: [{
            type: Input
        }], euiButtonBlock: [{
            type: Input
        }], euiBlockButton: [{
            type: Input
        }], euiRaisedButton: [{
            type: Input
        }], isLoading: [{
            type: Input
        }], euiIconButton: [{
            type: Input
        }], euiLineWrap: [{
            type: Input
        }], cssClasses: [{
            type: HostBinding,
            args: ['class']
        }], e2eAttr: [{
            type: HostBinding,
            args: ['attr.data-e2e']
        }, {
            type: Input
        }], role: [{
            type: HostBinding,
            args: ['attr.role']
        }] }); })();
export class EuiButtonModule {
}
/** @nocollapse */ EuiButtonModule.ɵmod = i0.ɵɵdefineNgModule({ type: EuiButtonModule });
/** @nocollapse */ EuiButtonModule.ɵinj = i0.ɵɵdefineInjector({ factory: function EuiButtonModule_Factory(t) { return new (t || EuiButtonModule)(); }, imports: [[
            CommonModule,
            EuiIconModule,
            EuiLabelModule,
            TranslateModule,
        ]] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(EuiButtonModule, { declarations: [EuiButtonComponent], imports: [CommonModule,
        EuiIconModule,
        EuiLabelModule,
        TranslateModule], exports: [EuiButtonComponent] }); })();
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiButtonModule, [{
        type: NgModule,
        args: [{
                imports: [
                    CommonModule,
                    EuiIconModule,
                    EuiLabelModule,
                    TranslateModule,
                ],
                declarations: [
                    EuiButtonComponent,
                ],
                exports: [
                    EuiButtonComponent,
                ],
            }]
    }], null, null); })();
//# sourceMappingURL=data:application/json;base64, 