import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ControlContainer, FormGroupDirective } from '@angular/forms';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
import * as i3 from "@ironsource/fusion-ui/components/icon/v1";
import * as i4 from "@ironsource/fusion-ui/components/input/v1";
const _c0 = a0 => ({ "is-disabled": a0 });
const _c1 = () => ({ iconName: "calendar-2", iconVersion: "v2" });
const _c2 = a0 => ({ iconData: a0, iconPos: "right" });
function DatepickerSelectionComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div")(1, "div", 3);
    i0.ɵɵlistener("click", function DatepickerSelectionComponent_div_1_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onInputFocus()); });
    i0.ɵɵelementStart(2, "label", 4);
    i0.ɵɵelement(3, "fusion-icon", 5);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c0, ctx_r1.isDisabled));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("name", i0.ɵɵpureFunction0(5, _c1));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", ctx_r1.label, "");
} }
function DatepickerSelectionComponent_ng_template_2_fusion_input_0_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-input", 7);
    i0.ɵɵlistener("ngFocus", function DatepickerSelectionComponent_ng_template_2_fusion_input_0_Template_fusion_input_ngFocus_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onInputFocus()); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("icon", i0.ɵɵpureFunction1(5, _c2, i0.ɵɵpureFunction0(4, _c1)))("isDisabled", ctx_r1.isDisabled)("placeholder", "YYYY-MM-DD")("error", ctx_r1.error);
} }
function DatepickerSelectionComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, DatepickerSelectionComponent_ng_template_2_fusion_input_0_Template, 1, 7, "fusion-input", 6);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngIf", !ctx_r1.dropDownStyle);
} }
export class DatepickerSelectionComponent {
    constructor() {
        this.inputFocus = new EventEmitter();
    }
    onInputFocus() {
        this.inputFocus.emit();
    }
    static { this.ɵfac = function DatepickerSelectionComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatepickerSelectionComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DatepickerSelectionComponent, selectors: [["fusion-datepicker-selection"]], inputs: { dropDownStyle: "dropDownStyle", isDisabled: "isDisabled", label: "label", error: "error" }, outputs: { inputFocus: "inputFocus" }, features: [i0.ɵɵProvidersFeature([], [{ provide: ControlContainer, useExisting: FormGroupDirective }])], decls: 4, vars: 2, consts: [["inputStyle", ""], [1, "is-datepicker"], [4, "ngIf", "ngIfElse"], [1, "is-datepicker-select", 3, "click", "ngClass"], [1, "truncate"], [3, "name"], ["formControlName", "dateVal", 3, "icon", "isDisabled", "placeholder", "error", "ngFocus", 4, "ngIf"], ["formControlName", "dateVal", 3, "ngFocus", "icon", "isDisabled", "placeholder", "error"]], template: function DatepickerSelectionComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 1);
            i0.ɵɵtemplate(1, DatepickerSelectionComponent_div_1_Template, 5, 6, "div", 2)(2, DatepickerSelectionComponent_ng_template_2_Template, 1, 1, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            const inputStyle_r4 = i0.ɵɵreference(3);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.dropDownStyle)("ngIfElse", inputStyle_r4);
        } }, dependencies: [i1.NgClass, i1.NgIf, i2.NgControlStatus, i2.FormControlName, i3.IconComponent, i4.InputComponent], styles: [".is-datepicker[_ngcontent-%COMP%]   .is-datepicker-select[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-size:13px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:400}.is-datepicker[_ngcontent-%COMP%]   .is-datepicker-select[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}.is-datepicker[_ngcontent-%COMP%]   .fu-input-holder[_ngcontent-%COMP%]:after, .is-datepicker[_ngcontent-%COMP%]   .is-datepicker-select[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]:after{content:\"\";display:block;position:absolute;top:14px;right:10px;border-width:4px 4px 0;border-style:solid;border-color:var(--dark-color-300, #172D4C) transparent transparent}.is-datepicker[_ngcontent-%COMP%]{display:inline-block;width:250px;vertical-align:bottom}.is-datepicker[_ngcontent-%COMP%]   .is-datepicker-select[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{color:var(--dark-color-300, #172D4C);cursor:pointer;display:block;border-radius:3px;background-image:linear-gradient(to bottom,#fff,var(--light-color-300, #EAEEF1));border:1px solid var(--light-color, #E1E6EB);height:32px;line-height:30px;padding-left:10px;position:relative}.is-datepicker[_ngcontent-%COMP%]   .is-datepicker-select[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]   fusion-icon[class^=calendar-2][_ngcontent-%COMP%]{position:relative;top:2px;margin-right:5px}.is-datepicker[_ngcontent-%COMP%]   .is-datepicker-select[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]   fusion-icon[class^=calendar-2][_ngcontent-%COMP%]     svg{width:15px;height:15px}.is-datepicker[_ngcontent-%COMP%]   .is-datepicker-select[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]   fusion-icon[class^=calendar-2][_ngcontent-%COMP%]     svg *{fill:var(--light-color-800, #678099)}.is-datepicker[_ngcontent-%COMP%]   .is-datepicker-select.is-disabled[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{color:var(--light-color-800, #678099);cursor:default}.is-datepicker[_ngcontent-%COMP%]   .is-datepicker-select.is-disabled[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]:after{border-color:var(--light-color-700, #95A6B8) transparent transparent}.is-datepicker[_ngcontent-%COMP%]   .fu-input-holder.is-disabled[_ngcontent-%COMP%]:after{border-color:var(--light-color-700, #95A6B8) transparent transparent}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatepickerSelectionComponent, [{
        type: Component,
        args: [{ selector: 'fusion-datepicker-selection', viewProviders: [{ provide: ControlContainer, useExisting: FormGroupDirective }], template: "<div class=\"is-datepicker\">\n  <div *ngIf=\"dropDownStyle; else inputStyle\">\n    <div class=\"is-datepicker-select\" (click)=\"onInputFocus()\" [ngClass]=\"{'is-disabled': isDisabled}\">\n      <label class=\"truncate\">\n        <fusion-icon [name]=\"{iconName:'calendar-2', iconVersion: 'v2'}\"></fusion-icon>\n        {{label}}</label>\n    </div>\n  </div>\n  <ng-template #inputStyle>\n    <fusion-input *ngIf=\"!dropDownStyle\"\n                  [icon]=\"{iconData: {iconName: 'calendar-2', iconVersion:'v2'}, iconPos: 'right'}\"\n                  [isDisabled]=\"isDisabled\"\n                  formControlName=\"dateVal\"\n                  [placeholder]=\"'YYYY-MM-DD'\"\n                  (ngFocus)=\"onInputFocus()\"\n                  [error]=\"error\"></fusion-input>\n  </ng-template>\n</div>\n", styles: [".is-datepicker .is-datepicker-select label{font-size:13px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:400}.is-datepicker .is-datepicker-select label{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}.is-datepicker .fu-input-holder:after,.is-datepicker .is-datepicker-select label:after{content:\"\";display:block;position:absolute;top:14px;right:10px;border-width:4px 4px 0;border-style:solid;border-color:var(--dark-color-300, #172D4C) transparent transparent}.is-datepicker{display:inline-block;width:250px;vertical-align:bottom}.is-datepicker .is-datepicker-select label{color:var(--dark-color-300, #172D4C);cursor:pointer;display:block;border-radius:3px;background-image:linear-gradient(to bottom,#fff,var(--light-color-300, #EAEEF1));border:1px solid var(--light-color, #E1E6EB);height:32px;line-height:30px;padding-left:10px;position:relative}.is-datepicker .is-datepicker-select label fusion-icon[class^=calendar-2]{position:relative;top:2px;margin-right:5px}.is-datepicker .is-datepicker-select label fusion-icon[class^=calendar-2] ::ng-deep svg{width:15px;height:15px}.is-datepicker .is-datepicker-select label fusion-icon[class^=calendar-2] ::ng-deep svg *{fill:var(--light-color-800, #678099)}.is-datepicker .is-datepicker-select.is-disabled label{color:var(--light-color-800, #678099);cursor:default}.is-datepicker .is-datepicker-select.is-disabled label:after{border-color:var(--light-color-700, #95A6B8) transparent transparent}.is-datepicker .fu-input-holder.is-disabled:after{border-color:var(--light-color-700, #95A6B8) transparent transparent}\n"] }]
    }], null, { dropDownStyle: [{
            type: Input
        }], isDisabled: [{
            type: Input
        }], label: [{
            type: Input
        }], error: [{
            type: Input
        }], inputFocus: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DatepickerSelectionComponent, { className: "DatepickerSelectionComponent", filePath: "datepicker-selection/datepicker-selection.component.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXBpY2tlci1zZWxlY3Rpb24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZnVzaW9uLXVpL2NvbXBvbmVudHMvZGF0ZXBpY2tlci92MS9kYXRl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