import * as i0 from '@angular/core';
import { Component, Input, ChangeDetectionStrategy, NgModule } from '@angular/core';
import { ButtonBaseComponent, BUTTON_OPTIONS_DEFAULT_VALUE } from '@ironsource/fusion-ui/components/button/common/base';
import * as i1$1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i1 from '@ironsource/fusion-ui/components/icon/v1';
import { IconModule } from '@ironsource/fusion-ui/components/icon/v1';
import { SVG_OPTIONS_TOKEN } from '@ironsource/fusion-ui/components/svg';

const _c0$1 = () => ({ iconName: "loading", iconVersion: "v1" });
class ButtonLoadingComponent {
    constructor() {
        this.projectContent = false;
        this.buttonWithIcon = false;
    }
    static { this.ɵfac = function ButtonLoadingComponent_Factory(t) { return new (t || ButtonLoadingComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ButtonLoadingComponent, selectors: [["fusion-button-loading"]], inputs: { projectContent: "projectContent", buttonWithIcon: "buttonWithIcon" }, decls: 1, vars: 2, consts: [[1, "icon-loading", 3, "name"]], template: function ButtonLoadingComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelement(0, "fusion-icon", 0);
        } if (rf & 2) {
            i0.ɵɵproperty("name", i0.ɵɵpureFunction0(1, _c0$1));
        } }, dependencies: [i1.IconComponent], styles: [".fu-with-loading[_nghost-%COMP%]   .loading[_ngcontent-%COMP%], .fu-with-loading   [_nghost-%COMP%]   .loading[_ngcontent-%COMP%]{vertical-align:middle;margin-right:5px}.fu-with-loading[_nghost-%COMP%]   .loading[_ngcontent-%COMP%]     svg, .fu-with-loading   [_nghost-%COMP%]   .loading[_ngcontent-%COMP%]     svg{width:15px;height:15px}.fu-with-loading[_nghost-%COMP%]   .loading[_ngcontent-%COMP%]     svg *, .fu-with-loading   [_nghost-%COMP%]   .loading[_ngcontent-%COMP%]     svg *{fill:none;stroke:currentColor}.fu-with-loading[_nghost-%COMP%]   .loading[_ngcontent-%COMP%] + span[_ngcontent-%COMP%], .fu-with-loading   [_nghost-%COMP%]   .loading[_ngcontent-%COMP%] + span[_ngcontent-%COMP%]{vertical-align:text-bottom}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ButtonLoadingComponent, [{
        type: Component,
        args: [{ selector: 'fusion-button-loading', template: "<fusion-icon\n    class=\"icon-loading\"\n    [name]=\"{iconName: 'loading', iconVersion: 'v1'}\"\n></fusion-icon>\n", styles: [":host-context(.fu-with-loading) .loading{vertical-align:middle;margin-right:5px}:host-context(.fu-with-loading) .loading ::ng-deep svg{width:15px;height:15px}:host-context(.fu-with-loading) .loading ::ng-deep svg *{fill:none;stroke:currentColor}:host-context(.fu-with-loading) .loading+span{vertical-align:text-bottom}\n"] }]
    }], null, { projectContent: [{
            type: Input
        }], buttonWithIcon: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ButtonLoadingComponent, { className: "ButtonLoadingComponent", filePath: "components/button-loading/button-loading.component.ts", lineNumber: 8 }); })();

function ButtonComponent_fusion_icon_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 4);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("name", ctx_r0.iconData);
} }
function ButtonComponent_fusion_button_loading_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-button-loading", 5);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("buttonWithIcon", !!ctx_r1.iconName)("projectContent", ctx_r1.projectContent);
} }
const _c0 = a0 => ({ "is-icon-text": a0 });
const _c1 = ["*"];
class ButtonComponent extends ButtonBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵButtonComponent_BaseFactory; return function ButtonComponent_Factory(t) { return (ɵButtonComponent_BaseFactory || (ɵButtonComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ButtonComponent)))(t || ButtonComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ButtonComponent, selectors: [["fusion-button"], ["", "fusion-button", ""]], features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c1, decls: 6, vars: 5, consts: [[3, "ngClass"], ["class", "icon", 3, "name", 4, "ngIf"], [3, "buttonWithIcon", "projectContent", 4, "ngIf"], ["contentRef", ""], [1, "icon", 3, "name"], [3, "buttonWithIcon", "projectContent"]], template: function ButtonComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵelementStart(0, "span", 0);
            i0.ɵɵtemplate(1, ButtonComponent_fusion_icon_1_Template, 1, 1, "fusion-icon", 1)(2, ButtonComponent_fusion_button_loading_2_Template, 1, 2, "fusion-button-loading", 2);
            i0.ɵɵelementStart(3, "span", null, 3);
            i0.ɵɵprojection(5);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c0, ctx.iconName && ctx.projectContent));
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.iconName && !ctx.loading);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.loading);
        } }, dependencies: [i1$1.NgClass, i1$1.NgIf, i1.IconComponent, ButtonLoadingComponent], styles: ["[_nghost-%COMP%]{font-size:13px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:600}.small[_nghost-%COMP%]{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:600}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]:disabled, .disabled[_nghost-%COMP%]{pointer-events:none;cursor:default;touch-callout:none;-webkit-user-select:none;user-select:none}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}[_nghost-%COMP%]{border-radius:var(--border-radius, 3px)}[_nghost-%COMP%]{border:1px solid var(--light-color, #E1E6EB)}.is-btngroup[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%]{position:relative;display:inline-block;height:32px;min-width:90px;outline:none;background-image:linear-gradient(to bottom,#fff,var(--light-color-200, #F3F5F7));color:var(--dark-color-300, #172D4C);line-height:1.2em;padding:7px 15px;cursor:pointer;text-align:var(--button-text-align, center)}[_nghost-%COMP%]:hover{color:var(--primary-color, #3091F6)}[_nghost-%COMP%]:disabled, .disabled[_nghost-%COMP%]{color:var(--light-color-800, #678099)}.fu-with-loading[_nghost-%COMP%]{padding-left:10px}.fu-with-loading[_nghost-%COMP%] + span[_ngcontent-%COMP%]{display:block;position:relative;padding:25px 0;border:solid 1px red}.fu-iconed[_nghost-%COMP%]{min-width:32px;padding:8px 8px 7px;margin-bottom:2px}.fu-iconed[_nghost-%COMP%]   fusion-icon.icon[_ngcontent-%COMP%]{vertical-align:middle}.fu-iconed[_nghost-%COMP%]   fusion-icon.icon[_ngcontent-%COMP%]     svg{width:15px;height:15px}.fu-iconed[_nghost-%COMP%]   fusion-icon.icon[_ngcontent-%COMP%]     svg *{fill:currentColor}.fu-iconed[_nghost-%COMP%]   .is-icon-text[_ngcontent-%COMP%]{padding:0 5px}.fu-iconed[_nghost-%COMP%]   .is-icon-text[_ngcontent-%COMP%]   fusion-icon[_ngcontent-%COMP%]{margin-right:4px}.fu-iconed[_nghost-%COMP%]   .is-icon-text[_ngcontent-%COMP%]   fusion-icon[_ngcontent-%COMP%] + span[_ngcontent-%COMP%]{vertical-align:text-top}.is-btngroup   [_nghost-%COMP%]{border-radius:3px 0 0 3px;float:left}.is-btngroup   [_nghost-%COMP%] + *[fusion-button][_ngcontent-%COMP%]{border-left:none;border-radius:0;margin-left:0}.is-btngroup   [_nghost-%COMP%]:last-child{border-radius:0 3px 3px 0}.small[_nghost-%COMP%]{line-height:.8em;height:25px;min-width:70px}.large[_nghost-%COMP%]{height:40px;min-width:140px}.stroke[_nghost-%COMP%]{border-color:var(--dark-color-100, #224574);background:none}.stroke[_nghost-%COMP%]:hover{color:#fff;background-color:var(--dark-color-100, #224574)}.stroke[_nghost-%COMP%]:disabled, .stroke.disabled[_nghost-%COMP%]{color:var(--light-color-800, #678099);border-color:var(--light-color-700, #95A6B8)}.stroke[_nghost-%COMP%]:disabled:hover, .stroke.disabled[_nghost-%COMP%]:hover{background-color:#fff}.primary[_nghost-%COMP%]{border-color:var(--primary-color, #3091F6);background:var(--primary-color, #3091F6);color:#fff}.primary[_nghost-%COMP%]:hover{background-color:var(--primary-color-hover, #489ef7);border-color:var(--primary-color-hover, #489ef7)}.primary[_nghost-%COMP%]:disabled, .primary.disabled[_nghost-%COMP%]{opacity:.7}.primary[_nghost-%COMP%]:disabled:hover, .primary.disabled[_nghost-%COMP%]:hover{border-color:var(--primary-color, #3091F6);background:var(--primary-color, #3091F6)}.negative[_nghost-%COMP%]{border-color:var(--negative-color, #e1174c);background:var(--negative-color, #e1174c);color:#fff}.negative[_nghost-%COMP%]:hover{background-color:var(--negative-color-hover, #eb406d);border-color:var(--negative-color-hover, #eb406d)}.negative[_nghost-%COMP%]:disabled, .negative.disabled[_nghost-%COMP%]{opacity:.7}.negative[_nghost-%COMP%]:disabled:hover, .negative.disabled[_nghost-%COMP%]:hover{border-color:var(--negative-color, #e1174c);background:var(--negative-color, #e1174c)}.secondary[_nghost-%COMP%]{border-color:var(--light-color, #E1E6EB);background:var(--light-color, #E1E6EB);color:var(--light-color-900, #52677B)}.secondary[_nghost-%COMP%]:hover{background-color:var(--light-color-hover, #d8dee5);border-color:var(--light-color-hover, #d8dee5)}.secondary[_nghost-%COMP%]:disabled, .secondary.disabled[_nghost-%COMP%]{opacity:.7}.secondary[_nghost-%COMP%]:disabled:hover, .secondary.disabled[_nghost-%COMP%]:hover{border-color:var(--light-color, #E1E6EB);background:var(--light-color, #E1E6EB)}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ButtonComponent, [{
        type: Component,
        args: [{ selector: 'fusion-button,[fusion-button]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span [ngClass]=\"{'is-icon-text': iconName && projectContent}\">\n    <fusion-icon *ngIf=\"iconName && !loading\" class=\"icon\" [name]=\"iconData\"></fusion-icon>\n    <fusion-button-loading *ngIf=\"loading\" [buttonWithIcon]=\"!!iconName\" [projectContent]=\"projectContent\"></fusion-button-loading>\n    <span #contentRef><ng-content></ng-content></span>\n</span>\n\n\n", styles: [":host{font-size:13px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:600}:host.small{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:600}:host *{box-sizing:border-box}:host:disabled,:host.disabled{pointer-events:none;cursor:default;touch-callout:none;-webkit-user-select:none;user-select:none}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host{border-radius:var(--border-radius, 3px)}:host{border:1px solid var(--light-color, #E1E6EB)}.is-btngroup{overflow:hidden}:host{position:relative;display:inline-block;height:32px;min-width:90px;outline:none;background-image:linear-gradient(to bottom,#fff,var(--light-color-200, #F3F5F7));color:var(--dark-color-300, #172D4C);line-height:1.2em;padding:7px 15px;cursor:pointer;text-align:var(--button-text-align, center)}:host:hover{color:var(--primary-color, #3091F6)}:host:disabled,:host.disabled{color:var(--light-color-800, #678099)}:host.fu-with-loading{padding-left:10px}:host.fu-with-loading+span{display:block;position:relative;padding:25px 0;border:solid 1px red}:host.fu-iconed{min-width:32px;padding:8px 8px 7px;margin-bottom:2px}:host.fu-iconed fusion-icon.icon{vertical-align:middle}:host.fu-iconed fusion-icon.icon ::ng-deep svg{width:15px;height:15px}:host.fu-iconed fusion-icon.icon ::ng-deep svg *{fill:currentColor}:host.fu-iconed .is-icon-text{padding:0 5px}:host.fu-iconed .is-icon-text fusion-icon{margin-right:4px}:host.fu-iconed .is-icon-text fusion-icon+span{vertical-align:text-top}.is-btngroup :host{border-radius:3px 0 0 3px;float:left}.is-btngroup :host+*[fusion-button]{border-left:none;border-radius:0;margin-left:0}.is-btngroup :host:last-child{border-radius:0 3px 3px 0}:host.small{line-height:.8em;height:25px;min-width:70px}:host.large{height:40px;min-width:140px}:host.stroke{border-color:var(--dark-color-100, #224574);background:none}:host.stroke:hover{color:#fff;background-color:var(--dark-color-100, #224574)}:host.stroke:disabled,:host.stroke.disabled{color:var(--light-color-800, #678099);border-color:var(--light-color-700, #95A6B8)}:host.stroke:disabled:hover,:host.stroke.disabled:hover{background-color:#fff}:host.primary{border-color:var(--primary-color, #3091F6);background:var(--primary-color, #3091F6);color:#fff}:host.primary:hover{background-color:var(--primary-color-hover, #489ef7);border-color:var(--primary-color-hover, #489ef7)}:host.primary:disabled,:host.primary.disabled{opacity:.7}:host.primary:disabled:hover,:host.primary.disabled:hover{border-color:var(--primary-color, #3091F6);background:var(--primary-color, #3091F6)}:host.negative{border-color:var(--negative-color, #e1174c);background:var(--negative-color, #e1174c);color:#fff}:host.negative:hover{background-color:var(--negative-color-hover, #eb406d);border-color:var(--negative-color-hover, #eb406d)}:host.negative:disabled,:host.negative.disabled{opacity:.7}:host.negative:disabled:hover,:host.negative.disabled:hover{border-color:var(--negative-color, #e1174c);background:var(--negative-color, #e1174c)}:host.secondary{border-color:var(--light-color, #E1E6EB);background:var(--light-color, #E1E6EB);color:var(--light-color-900, #52677B)}:host.secondary:hover{background-color:var(--light-color-hover, #d8dee5);border-color:var(--light-color-hover, #d8dee5)}:host.secondary:disabled,:host.secondary.disabled{opacity:.7}:host.secondary:disabled:hover,:host.secondary.disabled:hover{border-color:var(--light-color, #E1E6EB);background:var(--light-color, #E1E6EB)}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ButtonComponent, { className: "ButtonComponent", filePath: "button.component.ts", lineNumber: 10 }); })();

class ButtonLoadingModule {
    static { this.ɵfac = function ButtonLoadingModule_Factory(t) { return new (t || ButtonLoadingModule)(); }; }
    static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ButtonLoadingModule }); }
    static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule, IconModule] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ButtonLoadingModule, [{
        type: NgModule,
        args: [{
                declarations: [ButtonLoadingComponent],
                exports: [ButtonLoadingComponent],
                imports: [CommonModule, IconModule]
            }]
    }], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ButtonLoadingModule, { declarations: [ButtonLoadingComponent], imports: [CommonModule, IconModule], exports: [ButtonLoadingComponent] }); })();

class ButtonModule {
    static forRoot(options) {
        return {
            ngModule: ButtonModule,
            providers: [
                {
                    provide: SVG_OPTIONS_TOKEN,
                    useValue: options ? options.svgOptions : BUTTON_OPTIONS_DEFAULT_VALUE.svgOptions
                }
            ]
        };
    }
    static { this.ɵfac = function ButtonModule_Factory(t) { return new (t || ButtonModule)(); }; }
    static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ButtonModule }); }
    static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule, IconModule, ButtonLoadingModule] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ButtonModule, [{
        type: NgModule,
        args: [{
                declarations: [ButtonComponent],
                exports: [ButtonComponent],
                imports: [CommonModule, IconModule, ButtonLoadingModule]
            }]
    }], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ButtonModule, { declarations: [ButtonComponent], imports: [CommonModule, IconModule, ButtonLoadingModule], exports: [ButtonComponent] }); })();

/**
 * Generated bundle index. Do not edit.
 */

export { ButtonComponent, ButtonModule };
//# sourceMappingURL=ironsource-fusion-ui-components-button-v1.mjs.map
