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" });
function DatepickerSelectionComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div")(1, "div", 3);
    i0.ɵɵlistener("click", function DatepickerSelectionComponent_div_1_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r4); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.onInputFocus()); });
    i0.ɵɵelementStart(2, "label", 4);
    i0.ɵɵelement(3, "fusion-icon", 5);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c0, ctx_r0.isDisabled));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("name", i0.ɵɵpureFunction0(5, _c1));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", ctx_r0.label, "");
} }
const _c2 = a0 => ({ iconData: a0, iconPos: "right" });
function DatepickerSelectionComponent_ng_template_2_fusion_input_0_Template(rf, ctx) { if (rf & 1) {
    const _r7 = 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(_r7); const ctx_r6 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r6.onInputFocus()); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("icon", i0.ɵɵpureFunction1(5, _c2, i0.ɵɵpureFunction0(4, _c1)))("isDisabled", ctx_r5.isDisabled)("placeholder", "YYYY-MM-DD")("error", ctx_r5.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(t) { return new (t || 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: [[1, "is-datepicker"], [4, "ngIf", "ngIfElse"], ["inputStyle", ""], [1, "is-datepicker-select", 3, "ngClass", "click"], [1, "truncate"], [3, "name"], ["formControlName", "dateVal", 3, "icon", "isDisabled", "placeholder", "error", "ngFocus", 4, "ngIf"], ["formControlName", "dateVal", 3, "icon", "isDisabled", "placeholder", "error", "ngFocus"]], template: function DatepickerSelectionComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0);
            i0.ɵɵtemplate(1, DatepickerSelectionComponent_div_1_Template, 5, 6, "div", 1)(2, DatepickerSelectionComponent_ng_template_2_Template, 1, 1, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            const _r2 = i0.ɵɵreference(3);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.dropDownStyle)("ngIfElse", _r2);
        } }, 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXBpY2tlci1zZWxlY3Rpb24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZnVzaW9uLXVpL2NvbXBvbmVudHMvZGF0ZXBpY2tlci92MS9kYXRlcGlja2VyLXNlbGVjdGlvbi9kYXR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