import * as i0 from '@angular/core';
import { ElementRef, Component, ChangeDetectionStrategy, ViewChildren, NgModule } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import * as i1 from '@ironsource/fusion-ui/components/calendar/common/base';
import { CalendarBaseComponent, HOVER_RANGE_CLASS, HOVER_CURRENT_CLASS, CalendarService } from '@ironsource/fusion-ui/components/calendar/common/base';
export { CalendarService } from '@ironsource/fusion-ui/components/calendar/common/base';
import { CalendarType } from '@ironsource/fusion-ui/components/calendar/entities';
export * from '@ironsource/fusion-ui/components/calendar/entities';
import * as i2 from '@angular/common';
import { CommonModule } from '@angular/common';

const _c0 = ["date"];
function CalendarComponent_th_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "th");
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const dow_r2 = ctx.$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(dow_r2);
} }
const _c1 = a0 => [a0];
function CalendarComponent_ng_container_10_tr_1_ng_container_1_td_1_Template(rf, ctx) { if (rf & 1) {
    const _r15 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "td", 8, 9);
    i0.ɵɵlistener("mouseenter", function CalendarComponent_ng_container_10_tr_1_ng_container_1_td_1_Template_td_mouseenter_0_listener($event) { i0.ɵɵrestoreView(_r15); const day_r7 = i0.ɵɵnextContext().$implicit; const ctx_r13 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r13.dayHovered(day_r7, $event)); })("click", function CalendarComponent_ng_container_10_tr_1_ng_container_1_td_1_Template_td_click_0_listener() { i0.ɵɵrestoreView(_r15); const day_r7 = i0.ɵɵnextContext().$implicit; const ctx_r16 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r16.selectDay(day_r7)); });
    i0.ɵɵelement(2, "span", 10);
    i0.ɵɵelementStart(3, "span", 11);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const dayInMonth_r11 = ctx.ngIf;
    const day_r7 = i0.ɵɵnextContext().$implicit;
    const ctx_r8 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("ngClass", ctx_r8.getDayClasses(day_r7));
    i0.ɵɵattribute("data-datetime", i0.ɵɵpureFunction1(3, _c1, day_r7.date.getTime()));
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(dayInMonth_r11);
} }
function CalendarComponent_ng_container_10_tr_1_ng_container_1_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "td");
    i0.ɵɵtext(1, "\u00A0");
    i0.ɵɵelementEnd();
} }
function CalendarComponent_ng_container_10_tr_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, CalendarComponent_ng_container_10_tr_1_ng_container_1_td_1_Template, 5, 5, "td", 6);
    i0.ɵɵpipe(2, "date");
    i0.ɵɵtemplate(3, CalendarComponent_ng_container_10_tr_1_ng_container_1_ng_template_3_Template, 2, 0, "ng-template", null, 7, i0.ɵɵtemplateRefExtractor);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const day_r7 = ctx.$implicit;
    const _r10 = i0.ɵɵreference(4);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind2(2, 2, day_r7.date, "d"))("ngIfElse", _r10);
} }
function CalendarComponent_ng_container_10_tr_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr");
    i0.ɵɵtemplate(1, CalendarComponent_ng_container_10_tr_1_ng_container_1_Template, 5, 5, "ng-container", 3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const week_r3 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngForOf", week_r3);
} }
function CalendarComponent_ng_container_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, CalendarComponent_ng_container_10_tr_1_Template, 2, 1, "tr", 5);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const week_r3 = ctx.$implicit;
    const last_r4 = ctx.last;
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", !last_r4 || last_r4 && week_r3[0].date);
} }
const _c2 = a0 => ({ waitingForDateSelection: a0 });
class CalendarComponent extends CalendarBaseComponent {
    constructor(
    /** @internal */
    calendarService, 
    /** @internal */
    renderer) {
        super(calendarService);
        this.renderer = renderer;
        this.onDestroy$ = new Subject();
        /** @internal */
        this.daysOfTheWeek = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
    }
    ngOnInit() {
        super.ngOnInit();
        this.initListeners();
    }
    ngOnDestroy() {
        this.onDestroy$.next();
        this.onDestroy$.complete();
    }
    /** @internal */
    initListeners() {
        this.calendarService.dayHoverStart
            .pipe(takeUntil(this.onDestroy$), filter(({ parentDaterangeId }) => parentDaterangeId === this.configuration.parentDaterangeId))
            .subscribe(({ day, hoveredElement }) => {
            this.dateList.forEach(item => {
                const dayInMonth = Number(item.nativeElement.dataset.datetime);
                if (dayInMonth < day.date.getTime() && this._configurations.selection.endDate.getTime() <= dayInMonth) {
                    this.renderer.addClass(item.nativeElement, HOVER_RANGE_CLASS);
                    this.renderer.removeClass(item.nativeElement, HOVER_CURRENT_CLASS);
                }
                else if (hoveredElement !== item.nativeElement) {
                    this.renderer.removeClass(item.nativeElement, HOVER_RANGE_CLASS);
                    this.renderer.removeClass(item.nativeElement, HOVER_CURRENT_CLASS);
                }
            });
        });
        this.calendarService.dayHoverEnd
            .pipe(takeUntil(this.onDestroy$), filter(({ parentDaterangeId }) => parentDaterangeId === this.configuration.parentDaterangeId))
            .subscribe(() => {
            this.dateList.forEach(item => {
                this.renderer.removeClass(item.nativeElement, HOVER_RANGE_CLASS);
                this.renderer.removeClass(item.nativeElement, HOVER_CURRENT_CLASS);
            });
        });
    }
    /** @internal */
    dayHovered(day, event) {
        if (this.configuration.calendarType === CalendarType.DATE_PICKER ||
            !(this.configuration?.selection?.date ?? this.configuration?.selection?.endDate ?? this.configuration?.selection?.startDate)) {
            return;
        }
        const hoveredElement = event.target;
        const isNotDatePicker = !this.configuration.selection.date;
        const isStartSelection = this.configuration.selection.startDate.getTime() === this.configuration.selection.endDate.getTime();
        const isHoveredDayBiggerThenSelected = day.date.getTime() > this.configuration.selection.startDate.getTime();
        if (isNotDatePicker && isStartSelection) {
            if (isHoveredDayBiggerThenSelected) {
                this.renderer.addClass(hoveredElement, HOVER_CURRENT_CLASS);
                this.renderer.removeClass(hoveredElement, HOVER_RANGE_CLASS);
                const data = {
                    parentDaterangeId: this.configuration.parentDaterangeId,
                    day,
                    hoveredElement
                };
                this.calendarService.dayHoverStart.emit(data);
            }
            else {
                this.hoverEnd();
            }
        }
    }
    /** @internal */
    selectDay(day) {
        super.selectDay(day);
        this.hoverEnd();
    }
    /** @internal */
    hoverEnd() {
        if (this.configuration.calendarType === CalendarType.DATE_RANGE) {
            this.calendarService.dayHoverEnd.emit({ parentDaterangeId: this.configuration.parentDaterangeId });
        }
    }
    static { this.ɵfac = function CalendarComponent_Factory(t) { return new (t || CalendarComponent)(i0.ɵɵdirectiveInject(i1.CalendarService), i0.ɵɵdirectiveInject(i0.Renderer2)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CalendarComponent, selectors: [["fusion-calendar"]], viewQuery: function CalendarComponent_Query(rf, ctx) { if (rf & 1) {
            i0.ɵɵviewQuery(_c0, 5, ElementRef);
        } if (rf & 2) {
            let _t;
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.dateList = _t);
        } }, features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 13, consts: [[1, "calendar", 3, "mouseleave"], ["colspan", "7", 1, "month"], [1, "day-in-week"], [4, "ngFor", "ngForOf"], [3, "ngClass"], [4, "ngIf"], ["class", "day", 3, "ngClass", "mouseenter", "click", 4, "ngIf", "ngIfElse"], ["notThisMonthDay", ""], [1, "day", 3, "ngClass", "mouseenter", "click"], ["date", ""], [1, "selected-range"], [1, "date-text"]], template: function CalendarComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "table", 0);
            i0.ɵɵlistener("mouseleave", function CalendarComponent_Template_table_mouseleave_0_listener() { return ctx.hoverEnd(); });
            i0.ɵɵelementStart(1, "thead")(2, "tr")(3, "th", 1);
            i0.ɵɵtext(4);
            i0.ɵɵpipe(5, "date");
            i0.ɵɵpipe(6, "date");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(7, "tr", 2);
            i0.ɵɵtemplate(8, CalendarComponent_th_8_Template, 2, 1, "th", 3);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(9, "tbody", 4);
            i0.ɵɵtemplate(10, CalendarComponent_ng_container_10_Template, 2, 1, "ng-container", 3);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵadvance(4);
            i0.ɵɵtextInterpolate2("", i0.ɵɵpipeBind2(5, 5, ctx.configuration.month, "MMMM"), " ", i0.ɵɵpipeBind2(6, 8, ctx.configuration.month, "y"), "");
            i0.ɵɵadvance(4);
            i0.ɵɵproperty("ngForOf", ctx.daysOfTheWeek);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(11, _c2, (ctx.configuration.selection == null ? null : ctx.configuration.selection.startDate == null ? null : ctx.configuration.selection.startDate.getTime()) === (ctx.configuration.selection == null ? null : ctx.configuration.selection.endDate == null ? null : ctx.configuration.selection.endDate.getTime())));
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngForOf", ctx.calendarService.getParsedMonth(ctx.configuration.month, ctx.configuration.maxDate).weeks);
        } }, dependencies: [i2.NgClass, i2.NgForOf, i2.NgIf, i2.DatePipe], styles: ["@font-face{font-family:NHaasGroteskDSPro;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.ttf) format(\"truetype\")}@font-face{font-family:NHaasGroteskDSPro-65Md;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue-Medium;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.ttf) format(\"truetype\")}[_nghost-%COMP%]   .month[_ngcontent-%COMP%], .font-heading-6[_ngcontent-%COMP%], .font-heading-5[_ngcontent-%COMP%], .font-heading-4[_ngcontent-%COMP%], .font-heading-3[_ngcontent-%COMP%], .font-heading-2[_ngcontent-%COMP%], .font-heading-1[_ngcontent-%COMP%]{font-family:NHaasGroteskDSPro,sans-serif}.font-heading-1[_ngcontent-%COMP%]{font-size:60px}.font-heading-2[_ngcontent-%COMP%]{font-size:32px}.font-heading-3[_ngcontent-%COMP%]{font-size:22px}.font-heading-4[_ngcontent-%COMP%]{font-size:18px}.font-heading-5[_ngcontent-%COMP%]{font-size:15px}[_nghost-%COMP%]   .month[_ngcontent-%COMP%], .font-heading-6[_ngcontent-%COMP%]{font-size:13px}.font-heading-label[_ngcontent-%COMP%]{font-size:11px;font-family:NHaasGroteskDSPro-65Md,sans-serif;letter-spacing:.25px}.font-caption[_ngcontent-%COMP%], [_nghost-%COMP%]   .day-in-week[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .font-bodyXSmall[_ngcontent-%COMP%], [_nghost-%COMP%]   .day[_ngcontent-%COMP%], .font-bodySmall[_ngcontent-%COMP%], .font-bodyMedium[_ngcontent-%COMP%], .font-bodyLarge[_ngcontent-%COMP%]{font-family:HelveticaNeue,helvetica,sans-serif;line-height:1.5}.font-bodyXSmallStrong[_ngcontent-%COMP%], .font-bodySmallStrong[_ngcontent-%COMP%], .font-bodyMediumStrong[_ngcontent-%COMP%], .font-bodyLargeStrong[_ngcontent-%COMP%]{font-family:HelveticaNeue-Medium,helvetica,sans-serif;line-height:1.5}.font-bodyLarge[_ngcontent-%COMP%], .font-bodyLargeStrong[_ngcontent-%COMP%]{font-size:16px}.font-bodyMedium[_ngcontent-%COMP%], .font-bodyMediumStrong[_ngcontent-%COMP%]{font-size:14px}[_nghost-%COMP%]   .day[_ngcontent-%COMP%], .font-bodySmall[_ngcontent-%COMP%]{font-size:13px;letter-spacing:.24px}.font-bodySmallStrong[_ngcontent-%COMP%]{font-size:13px;letter-spacing:.24px}[_nghost-%COMP%]   .day-in-week[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .font-bodyXSmall[_ngcontent-%COMP%]{font-size:12px;letter-spacing:.24px}.font-bodyXSmallStrong[_ngcontent-%COMP%]{font-size:12px;letter-spacing:.24px}.font-caption[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes _ngcontent-%COMP%_shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}[_nghost-%COMP%]   .calendar[_ngcontent-%COMP%]{width:224px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;border-spacing:0 4px;color:var(--fu-black-500, #53575B);background-color:var(--fu-white, #ffffff)}[_nghost-%COMP%]   .month[_ngcontent-%COMP%]{color:var(--fu-black-500, #53575B);height:40px}[_nghost-%COMP%]   .day-in-week[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{color:var(--fu-light-800, #8E959D);width:32px;height:32px}[_nghost-%COMP%]   .day[_ngcontent-%COMP%]{line-height:16px;letter-spacing:.24px;color:var(--fu-black-500, #53575B);text-align:center;cursor:pointer;width:32px;height:32px;position:relative}[_nghost-%COMP%]   .day[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%]   .day[_ngcontent-%COMP%]:not(.selected):not(.disabled):not(.hover-current):hover:before{position:absolute;content:\"\";left:0;top:-1px;background-color:var(--fu-light-100, #F1F3F4);height:32px;width:32px;border-radius:50%;display:block}[_nghost-%COMP%]   .day.selected[_ngcontent-%COMP%]:not(.active), [_nghost-%COMP%]   .day.hover-range[_ngcontent-%COMP%]:not(.active){border:none}[_nghost-%COMP%]   .day.selected[_ngcontent-%COMP%]:not(.active)   .selected-range[_ngcontent-%COMP%], [_nghost-%COMP%]   .day.hover-range[_ngcontent-%COMP%]:not(.active)   .selected-range[_ngcontent-%COMP%]{display:inline;cursor:pointer;width:32px;height:32px;position:absolute;top:-1px;left:0;background-color:var(--fu-primary-300, #96C0FF)}[_nghost-%COMP%]   .day.selected[_ngcontent-%COMP%]:not(.active)   .selected-range[_ngcontent-%COMP%] + span[_ngcontent-%COMP%], [_nghost-%COMP%]   .day.hover-range[_ngcontent-%COMP%]:not(.active)   .selected-range[_ngcontent-%COMP%] + span[_ngcontent-%COMP%]{color:var(--fu-white, #ffffff)}[_nghost-%COMP%]   .day.today.selected[_ngcontent-%COMP%]:after, [_nghost-%COMP%]   .day.today.active[_ngcontent-%COMP%]:after, [_nghost-%COMP%]   .day.today.hover-current[_ngcontent-%COMP%]:after{content:\"\";background-color:var(--fu-white, #ffffff);width:4px;height:4px;position:absolute;bottom:5px;border-radius:100px;left:calc(50% - 2px)}[_nghost-%COMP%]   .day.today[_ngcontent-%COMP%]:not(.selected):not(.active):not(.hover-current):after{content:\"\";background-color:var(--fu-primary-500, #3083FF);width:4px;height:4px;position:absolute;bottom:5px;border-radius:100px;left:calc(50% - 2px)}[_nghost-%COMP%]   .day.active[_ngcontent-%COMP%]{color:var(--fu-white, #ffffff);background-color:transparent}[_nghost-%COMP%]   .day.active.selected.oneDaySelection[_ngcontent-%COMP%]:before{position:absolute;content:\"\";left:0;top:-1px;background-color:var(--fu-primary-500, #3083FF);height:32px;width:32px;border-radius:50%;display:block}[_nghost-%COMP%]   .day.hover-current[_ngcontent-%COMP%]{color:var(--fu-white, #ffffff)}[_nghost-%COMP%]   .day.hover-current[_ngcontent-%COMP%]:before{position:absolute;content:\"\";left:0;top:-1px;background-color:var(--fu-primary-300, #96C0FF);height:32px;width:32px;border-radius:0 50% 50% 0;display:block}[_nghost-%COMP%]   .day.selectedEnd[_ngcontent-%COMP%]:before{position:absolute;content:\"\";left:0;top:-1px;background-color:var(--fu-primary-500, #3083FF);height:32px;width:32px;border-radius:0 50% 50% 0;display:block}[_nghost-%COMP%]   .day.selectedStart[_ngcontent-%COMP%]:before, [_nghost-%COMP%]   .day.active.selected.oneDaySelection.hover-range[_ngcontent-%COMP%]:before{position:absolute;content:\"\";left:0;top:-1px;background-color:var(--fu-primary-500, #3083FF);height:32px;width:32px;border-radius:50% 0 0 50%;display:block}[_nghost-%COMP%]   .day.selectedDayAfterDay[_ngcontent-%COMP%]:not(:last-child).selectedStart:after{content:\"\";background-color:var(--fu-primary-500, #3083FF);width:8px;height:28px;position:absolute;display:block;top:2px;right:-4px}[_nghost-%COMP%]   .day.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%]   .day.disabled[_ngcontent-%COMP%]:not(.selected){color:var(--fu-light-700, #A9AFB4)}.fu-calendar-grid[_nghost-%COMP%]   table.calendar[_ngcontent-%COMP%]{border-spacing:0}.fu-calendar-grid[_nghost-%COMP%]   table.calendar[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%], .fu-calendar-grid[_nghost-%COMP%]   table.calendar[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border-bottom:solid 4px #F5F5F5;height:36px}.fu-calendar-grid[_nghost-%COMP%]   table.calendar[_ngcontent-%COMP%]   .day.oneDaySelection[_ngcontent-%COMP%]:before, .fu-calendar-grid[_nghost-%COMP%]   table.calendar[_ngcontent-%COMP%]   .day.selectedStart[_ngcontent-%COMP%]:before, .fu-calendar-grid[_nghost-%COMP%]   table.calendar[_ngcontent-%COMP%]   .day.selectedEnd[_ngcontent-%COMP%]:before{top:0}.fu-calendar-grid[_nghost-%COMP%]   table.calendar[_ngcontent-%COMP%]   .day.selected[_ngcontent-%COMP%]   .selected-range[_ngcontent-%COMP%]{top:0}.oneDaySelection.hover-range[_ngcontent-%COMP%] + .hover-current[_ngcontent-%COMP%]:not(.today):after{content:\"\";background-color:var(--fu-primary-500, #3083FF);width:8px;height:28px;position:absolute;display:block;top:2px;left:-10px}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CalendarComponent, [{
        type: Component,
        args: [{ selector: 'fusion-calendar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"calendar\" (mouseleave)=\"hoverEnd()\">\n    <thead>\n        <tr>\n            <th class=\"month\" colspan=\"7\">{{ configuration.month | date: 'MMMM' }} {{ configuration.month | date: 'y' }}</th>\n        </tr>\n        <tr class=\"day-in-week\">\n            <th *ngFor=\"let dow of daysOfTheWeek\">{{ dow }}</th>\n        </tr>\n    </thead>\n    <tbody\n        [ngClass]=\"{waitingForDateSelection: configuration.selection?.startDate?.getTime() === configuration.selection?.endDate?.getTime()}\"\n    >\n        <ng-container\n            *ngFor=\"let week of calendarService.getParsedMonth(configuration.month, configuration.maxDate).weeks; let last = last\"\n        >\n            <tr *ngIf=\"!last || (last && week[0].date)\">\n                <ng-container *ngFor=\"let day of week\">\n                    <td\n                        #date\n                        class=\"day\"\n                        *ngIf=\"day.date | date: 'd' as dayInMonth; else notThisMonthDay\"\n                        [ngClass]=\"getDayClasses(day)\"\n                        (mouseenter)=\"dayHovered(day, $event)\"\n                        [attr.data-datetime]=\"[day.date.getTime()]\"\n                        (click)=\"selectDay(day)\"\n                    >\n                        <span class=\"selected-range\"></span>\n                        <span class=\"date-text\">{{ dayInMonth }}</span>\n                    </td>\n                    <ng-template #notThisMonthDay><td>&nbsp;</td></ng-template>\n                </ng-container>\n            </tr>\n        </ng-container>\n    </tbody>\n</table>\n", styles: ["@font-face{font-family:NHaasGroteskDSPro;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.ttf) format(\"truetype\")}@font-face{font-family:NHaasGroteskDSPro-65Md;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue-Medium;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.ttf) format(\"truetype\")}:host .month,.font-heading-6,.font-heading-5,.font-heading-4,.font-heading-3,.font-heading-2,.font-heading-1{font-family:NHaasGroteskDSPro,sans-serif}.font-heading-1{font-size:60px}.font-heading-2{font-size:32px}.font-heading-3{font-size:22px}.font-heading-4{font-size:18px}.font-heading-5{font-size:15px}:host .month,.font-heading-6{font-size:13px}.font-heading-label{font-size:11px;font-family:NHaasGroteskDSPro-65Md,sans-serif;letter-spacing:.25px}.font-caption,:host .day-in-week th,.font-bodyXSmall,:host .day,.font-bodySmall,.font-bodyMedium,.font-bodyLarge{font-family:HelveticaNeue,helvetica,sans-serif;line-height:1.5}.font-bodyXSmallStrong,.font-bodySmallStrong,.font-bodyMediumStrong,.font-bodyLargeStrong{font-family:HelveticaNeue-Medium,helvetica,sans-serif;line-height:1.5}.font-bodyLarge,.font-bodyLargeStrong{font-size:16px}.font-bodyMedium,.font-bodyMediumStrong{font-size:14px}:host .day,.font-bodySmall{font-size:13px;letter-spacing:.24px}.font-bodySmallStrong{font-size:13px;letter-spacing:.24px}:host .day-in-week th,.font-bodyXSmall{font-size:12px;letter-spacing:.24px}.font-bodyXSmallStrong{font-size:12px;letter-spacing:.24px}.font-caption{font-size:11px}:host *{box-sizing:border-box}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}:host .calendar{width:224px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;border-spacing:0 4px;color:var(--fu-black-500, #53575B);background-color:var(--fu-white, #ffffff)}:host .month{color:var(--fu-black-500, #53575B);height:40px}:host .day-in-week th{color:var(--fu-light-800, #8E959D);width:32px;height:32px}:host .day{line-height:16px;letter-spacing:.24px;color:var(--fu-black-500, #53575B);text-align:center;cursor:pointer;width:32px;height:32px;position:relative}:host .day span{position:relative}:host .day:not(.selected):not(.disabled):not(.hover-current):hover:before{position:absolute;content:\"\";left:0;top:-1px;background-color:var(--fu-light-100, #F1F3F4);height:32px;width:32px;border-radius:50%;display:block}:host .day.selected:not(.active),:host .day.hover-range:not(.active){border:none}:host .day.selected:not(.active) .selected-range,:host .day.hover-range:not(.active) .selected-range{display:inline;cursor:pointer;width:32px;height:32px;position:absolute;top:-1px;left:0;background-color:var(--fu-primary-300, #96C0FF)}:host .day.selected:not(.active) .selected-range+span,:host .day.hover-range:not(.active) .selected-range+span{color:var(--fu-white, #ffffff)}:host .day.today.selected:after,:host .day.today.active:after,:host .day.today.hover-current:after{content:\"\";background-color:var(--fu-white, #ffffff);width:4px;height:4px;position:absolute;bottom:5px;border-radius:100px;left:calc(50% - 2px)}:host .day.today:not(.selected):not(.active):not(.hover-current):after{content:\"\";background-color:var(--fu-primary-500, #3083FF);width:4px;height:4px;position:absolute;bottom:5px;border-radius:100px;left:calc(50% - 2px)}:host .day.active{color:var(--fu-white, #ffffff);background-color:transparent}:host .day.active.selected.oneDaySelection:before{position:absolute;content:\"\";left:0;top:-1px;background-color:var(--fu-primary-500, #3083FF);height:32px;width:32px;border-radius:50%;display:block}:host .day.hover-current{color:var(--fu-white, #ffffff)}:host .day.hover-current:before{position:absolute;content:\"\";left:0;top:-1px;background-color:var(--fu-primary-300, #96C0FF);height:32px;width:32px;border-radius:0 50% 50% 0;display:block}:host .day.selectedEnd:before{position:absolute;content:\"\";left:0;top:-1px;background-color:var(--fu-primary-500, #3083FF);height:32px;width:32px;border-radius:0 50% 50% 0;display:block}:host .day.selectedStart:before,:host .day.active.selected.oneDaySelection.hover-range:before{position:absolute;content:\"\";left:0;top:-1px;background-color:var(--fu-primary-500, #3083FF);height:32px;width:32px;border-radius:50% 0 0 50%;display:block}:host .day.selectedDayAfterDay:not(:last-child).selectedStart:after{content:\"\";background-color:var(--fu-primary-500, #3083FF);width:8px;height:28px;position:absolute;display:block;top:2px;right:-4px}:host .day.disabled{pointer-events:none}:host .day.disabled:not(.selected){color:var(--fu-light-700, #A9AFB4)}:host.fu-calendar-grid table.calendar{border-spacing:0}:host.fu-calendar-grid table.calendar thead th,:host.fu-calendar-grid table.calendar tbody td{border-bottom:solid 4px #F5F5F5;height:36px}:host.fu-calendar-grid table.calendar .day.oneDaySelection:before,:host.fu-calendar-grid table.calendar .day.selectedStart:before,:host.fu-calendar-grid table.calendar .day.selectedEnd:before{top:0}:host.fu-calendar-grid table.calendar .day.selected .selected-range{top:0}.oneDaySelection.hover-range+.hover-current:not(.today):after{content:\"\";background-color:var(--fu-primary-500, #3083FF);width:8px;height:28px;position:absolute;display:block;top:2px;left:-10px}\n"] }]
    }], () => [{ type: i1.CalendarService }, { type: i0.Renderer2 }], { dateList: [{
            type: ViewChildren,
            args: ['date', { read: ElementRef }]
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CalendarComponent, { className: "CalendarComponent", filePath: "calendar.component.ts", lineNumber: 14 }); })();

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

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

export { CalendarComponent, CalendarModule };
//# sourceMappingURL=ironsource-fusion-ui-components-calendar-v3.mjs.map
