import * as i0 from '@angular/core';
import { Injectable, Optional, inject, NgZone, ChangeDetectorRef, DestroyRef, signal, input, EventEmitter, computed, effect, Component, ChangeDetectionStrategy, HostBinding, Input, Output, ViewChild, NgModule } from '@angular/core';
import * as i3 from '@angular/cdk/menu';
import { CdkMenuModule } from '@angular/cdk/menu';
import * as i1 from '@metad/ocap-angular/core';
import { DisplayDensity, csvDownload, OcapCoreModule } from '@metad/ocap-angular/core';
import { ChartBusinessService, isEqual, isAdvancedFilter, getEntityProperty, slicerAsString, getPropertyName, putFilter, getEntityHierarchy, getEntityLevel, nonNullable, isSlicer, omit, pick, getPropertyHierarchy, Drill, parseDimension } from '@metad/ocap-core';
import { SmartEChartEngine } from '@metad/ocap-echarts';
import { ComponentStore } from '@metad/store';
import { isEmpty, isNil, cloneDeep, findIndex, assign } from 'lodash-es';
import { BehaviorSubject, combineLatest } from 'rxjs';
import { skip, distinctUntilChanged, filter, map, startWith, withLatestFrom, shareReplay, pairwise, tap } from 'rxjs/operators';
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
import * as i14 from '@ngx-translate/core';
import { TranslateService, TranslateModule } from '@ngx-translate/core';
import * as i13 from '@metad/ocap-angular/selection';
import { SlicersCapacity, NgmSelectionModule } from '@metad/ocap-angular/selection';
import * as i1$1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from '@angular/forms';
import { FormsModule } from '@angular/forms';
import * as i4 from '@angular/material/button';
import { MatButtonModule } from '@angular/material/button';
import * as i5 from '@angular/material/icon';
import { MatIconModule } from '@angular/material/icon';
import * as i6 from '@angular/material/progress-spinner';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import * as i7 from '@angular/material/tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import * as i8 from '@angular/material/button-toggle';
import { MatButtonToggleModule } from '@angular/material/button-toggle';
import * as i9 from 'ngx-echarts';
import { NgxEchartsModule } from 'ngx-echarts';
import * as i10 from '@metad/ocap-angular/common';
import { NgmCommonModule } from '@metad/ocap-angular/common';
import * as i12 from '@metad/ocap-angular/entity';
import { NgmEntityPropertyComponent } from '@metad/ocap-angular/entity';
import { MatCardModule } from '@angular/material/card';

class AnalyticalCardService extends ChartBusinessService {
    constructor(dsCoreService, filterBarService) {
        super(dsCoreService, filterBarService);
    }
    ngOnDestroy() {
        super.onDestroy();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticalCardService, deps: [{ token: i1.NgmDSCoreService }, { token: i1.NgmSmartFilterBarService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticalCardService }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticalCardService, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: i1.NgmDSCoreService }, { type: i1.NgmSmartFilterBarService, decorators: [{
                    type: Optional
                }] }] });

class AnalyticalCardComponent extends ComponentStore {
    #destroyRef;
    /**
     * Data Settings
     */
    get dataSettings() {
        return this.get((state) => state.dataSettings);
    }
    set dataSettings(value) {
        this._dataSettings.set(value);
        this.patchState({
            dataSettings: value
        });
    }
    get slicers() {
        // return this.get((state) => state.slicers)
        return this.#slicers();
    }
    set slicers(value) {
        // this.patchState({slicers: value})
        this.#slicers.set(value);
    }
    #slicers;
    get displayDensity() {
        return this.appearance?.displayDensity;
    }
    get chartType() {
        return this.dataSettings?.chartAnnotation?.chartType;
    }
    set chartType(chartType) {
        this.patchState({
            dataSettings: {
                ...this.dataSettings,
                chartAnnotation: {
                    ...(this.dataSettings.chartAnnotation ?? {}),
                    chartType
                }
            }
        });
    }
    set empty(value) {
        this._empty$.next(value);
    }
    constructor() {
        super({});
        this.DisplayDensity = DisplayDensity;
        this.eSlicersCapacity = SlicersCapacity;
        this.businessService = inject(AnalyticalCardService);
        this.translate = inject(TranslateService);
        this._ngZone = inject(NgZone);
        this._cdr = inject(ChangeDetectorRef);
        this.#destroyRef = inject(DestroyRef);
        this.echartsEngine = new SmartEChartEngine();
        this._slicersChanging$ = new BehaviorSubject(null);
        this._isAnalyticalCard = true;
        this._dataSettings$ = this.select((state) => state.dataSettings);
        this._dataSettings = signal(null, { equal: isEqual });
        this.chartSettings = input(null);
        this.chartOptions = input(null);
        this.options = input(null);
        this.#slicers = signal(null);
        /**
         * @deprecated use slicersChanging
         */
        this.slicersChange = new EventEmitter();
        /**
         * To avoid being confused with slicers & slicersChange
         */
        this.slicersChanging = this._slicersChanging$.pipe(skip(1), distinctUntilChanged(isEqual));
        this.chartClick = this.echartsEngine.chartClick$;
        this.chartHighlight = this.echartsEngine.chartHighlight$;
        this.chartContextMenu = this.echartsEngine.chartContextMenu$;
        this.explain = new EventEmitter();
        this.contextMenuPosition = { x: '0px', y: '0px' };
        this._chartSettings = computed(() => this.chartSettings(), { equal: isEqual });
        this._chartOptions = computed(() => this.chartOptions(), { equal: isEqual });
        this._options = computed(() => this.options(), { equal: isEqual });
        this.showHeader = computed(() => !this.options()?.hideHeader);
        // Inner states
        // The final option for ECharts instance
        this.options$ = this.echartsEngine.selectChartOptions().pipe(filter(({ error }) => {
            if (error) {
                this.error$.next(error);
            }
            else {
                this.error$.next(null);
            }
            return !error;
        }), map(({ options }) => options), 
        // 为初始化 ECharts 实例，然后传递给 SmartEChartEngine 以便进行事件绑定
        startWith({}));
        this.isLoading$ = this.businessService.loading$;
        this.error$ = new BehaviorSubject(null);
        this._empty$ = new BehaviorSubject(false);
        this.empty$ = combineLatest([this._empty$, this.error$]).pipe(map(([empty, error]) => empty && !error));
        // For drill down
        this.selectedDrilledDimensions$ = this.select((state) => state.selectedDrilledDimensions);
        this.selectedSlicers$ = this.select((state) => state.selectedSlicers);
        this.drilledDimensions$ = this.select((state) => state.drilledDimensions);
        this.breadcrumbs$ = this.drilledDimensions$.pipe(map((drills) => {
            return drills?.map((item) => ({
                value: item,
                label: item.slicer.members[0].label || item.slicer.members[0].value,
                active: true
            }));
        }));
        this.dillSlicers$ = this.selectedSlicers$.pipe(map((slicers) => {
            if (isAdvancedFilter(slicers?.[0])) {
                return slicers[0].children;
            }
            return slicers;
        }), withLatestFrom(this.businessService.selectEntityType()), map(([slicers, entityType]) => {
            return slicers?.map((slicer) => {
                const property = getEntityProperty(entityType, slicer.dimension);
                return {
                    value: slicer,
                    label: (property.caption || property.name) + ':' + slicerAsString(slicer)
                };
            });
        }));
        /**
         * 维度下钻
         * 1. 来自于 PresentationVariant 中的 groupBy
         * 2. disable 已被选中的下钻维度
         */
        this.drillDimensions$ = this.select(this.businessService.presentationVariant$, this.businessService.selectEntityType(), this.selectedDrilledDimensions$, (presentationVariant, entityType, selectedDrilledDimensions) => {
            return presentationVariant?.groupBy?.map((item) => ({
                dimension: item,
                property: getEntityProperty(entityType, item),
                disabled: !!selectedDrilledDimensions?.find((selected) => getPropertyName(selected.dimension) === getPropertyName(item))
            })).filter(({ property }) => !!property);
        });
        this.canDrillDimensions$ = this.drillDimensions$.pipe(map((drillDimensions) => !isEmpty(drillDimensions)));
        /**
         * 最终的数据设置
         */
        this.dataSettings$ = combineLatest([
            this._dataSettings$,
            // this.select((state) => state.slicers),
            toObservable(this.#slicers),
            this.selectedDrilledDimensions$
        ]).pipe(filter(([dataSettings]) => !isNil(dataSettings)), map(([dataSettings, slicers, selectedHierachyLevels]) => {
            const chartAnnotation = dataSettings.chartAnnotation;
            const _selectOptions = (dataSettings.selectionVariant?.selectOptions ?? []);
            const selectionVariant = {
                ...(dataSettings.selectionVariant ?? {}),
                selectOptions: slicers?.reduce((slicers, item) => putFilter(slicers, item), _selectOptions) ?? _selectOptions
            };
            if (isEmpty(selectedHierachyLevels)) {
                return {
                    ...dataSettings,
                    selectionVariant
                };
            }
            // 每次都 clone chartAnnotation 防止重复修改
            const _chartAnnotation = cloneDeep(chartAnnotation);
            const dimensions = _chartAnnotation.dimensions;
            selectedHierachyLevels.forEach((item) => {
                const index = findIndex(dimensions, (o) => getPropertyName(o) === getPropertyName(item.parent));
                dimensions.splice(index, 1, {
                    ...dimensions[index],
                    ...item.dimension
                });
            });
            const selectOptions = selectedHierachyLevels.reduce((slicers, item) => putFilter(slicers, item.slicer), selectionVariant.selectOptions);
            return assign(cloneDeep(dataSettings), {
                chartAnnotation: {
                    ..._chartAnnotation,
                    dimensions
                },
                selectionVariant: {
                    ...selectionVariant,
                    selectOptions
                }
            });
        }), takeUntilDestroyed(), shareReplay(1));
        /**
         * 1. TODO 暂时取 chartAnnotation 中所有的 dimensions 维度
         * 2. disable 级别数小于已选中层级的维度
         */
        this.drillLevels$ = combineLatest([
            this.dataSettings$,
            this.businessService.selectEntityType(),
            this.select((state) => state.selectedSlicers)
        ]).pipe(map(([dataSettings, entityType, selectedSlicers]) => {
            const chartAnnotation = dataSettings.chartAnnotation;
            return chartAnnotation.dimensions
                .map((dimension) => {
                return {
                    dimension,
                    hierarchy: getEntityHierarchy(entityType, dimension)
                };
            })
                .filter(({ hierarchy }) => hierarchy?.levels)
                .map(({ dimension, hierarchy }) => {
                const selectedSlicer = selectedSlicers[0];
                const slicer = isAdvancedFilter(selectedSlicer)
                    ? selectedSlicer.children?.find((slicer) => slicer.dimension.dimension === dimension.dimension)
                    : selectedSlicer;
                if (slicer?.dimension?.dimension !== dimension.dimension) {
                    return {
                        property: hierarchy,
                        slicer: null,
                    };
                }
                const slicerLevel = getEntityLevel(entityType, slicer?.dimension);
                return {
                    slicer,
                    property: hierarchy,
                    levels: hierarchy.levels.map((level) => ({
                        property: level,
                        disabled: level.levelNumber <= (slicerLevel?.levelNumber || 0)
                    })),
                    slicerCaption: slicerAsString(slicer)
                };
            })
                .filter(({ slicer }) => nonNullable(slicer));
        }), takeUntilDestroyed(), shareReplay(1));
        this.canDrillLevels$ = this.drillLevels$.pipe(map((levels) => !isEmpty(levels)));
        /**
         * 默认下钻行为: 如果图形为多维度, 则默认取第一个维度
         */
        this.dilldown$ = this.selectedSlicers$.pipe(map((selectedSlicers) => {
            const first = selectedSlicers[0];
            return isAdvancedFilter(first) ? first.children[0] : isSlicer(first) ? first : null;
        }));
        /**
        |--------------------------------------------------------------------------
        | Subscriptions (effect)
        |--------------------------------------------------------------------------
        */
        // Listener for dataSettings changed
        this._dataSettingsSub = this.dataSettings$
            .pipe(filter(Boolean), startWith(null), pairwise(), takeUntilDestroyed())
            .subscribe(([a, b]) => {
            if (isEqual({
                ...(a ?? {}),
                chartAnnotation: omit(a?.chartAnnotation, 'chartType')
            }, {
                ...b,
                chartAnnotation: omit(b.chartAnnotation, 'chartType')
            })) {
                this.echartsEngine.chartAnnotation = b?.chartAnnotation;
            }
            this.businessService.dataSettings = b;
        });
        // Listeners for explain logic
        this._explainSub = combineLatest([
            this.dataSettings$,
            this.businessService.selectResult(),
            this.echartsEngine.selectChartOptions().pipe(startWith(null))
        ]).pipe(takeUntilDestroyed()).subscribe(([dataSettings, queryReturn, chartOptions]) => {
            this.explain.emit([
                dataSettings, queryReturn, chartOptions
            ]);
        });
        // Clear slicers changed output when ECharts refresh
        this._echartsOptionSub = this.echartsEngine.selectChartOptions().pipe(takeUntilDestroyed()).subscribe(() => {
            this.openContextMenu(null);
        });
        // Listeners for ECharts events
        // ECharts ContextMenu event
        this._contextMenuSub = this.echartsEngine.chartContextMenu$.pipe(takeUntilDestroyed()).subscribe((event) => {
            event.event.stopPropagation();
            event.event.preventDefault();
            // Unselect selected data item in series component
            this.echartsEngine.dispatchAction({
                ...pick(event, 'seriesIndex', 'seriesId', 'seriesName', 'dataIndex', 'name'),
                type: 'unselect',
            });
        });
        // ECharts selecchanged event
        this._selectChangedSub = this.echartsEngine.selectChanged$.pipe(takeUntilDestroyed()).subscribe((event) => {
            this._ngZone.run(() => {
                this.openContextMenu(event.slicers, event.event);
            });
        });
        this.drill = this.updater((state, drillLevel) => {
            state.selectedDrilledDimensions = state.selectedDrilledDimensions || [];
            state.drilledDimensions = state.drilledDimensions || [];
            state.drilledDimensions = [...state.selectedDrilledDimensions, drillLevel];
            state.selectedDrilledDimensions = [...state.drilledDimensions];
        });
        this.reselectDrill = this.updater((state, drillLevels) => {
            state.selectedDrilledDimensions = drillLevels.map(({ value }) => value);
        });
        this.drillLevel = this.effect((origin$) => {
            return origin$.pipe(withLatestFrom(this.businessService.selectEntityType()), tap(([{ slicer, property }, entityType]) => {
                if (isAdvancedFilter(slicer)) {
                    const parentFilter = slicer.children.find((item) => getPropertyHierarchy(item.dimension) === property.hierarchyLevelFor);
                    parentFilter.drill = Drill.Children;
                    this.drill({
                        parent: parentFilter.dimension,
                        slicer: parentFilter,
                        dimension: parseDimension(property.name, entityType)
                    });
                }
                else {
                    this.drill({
                        parent: slicer.dimension,
                        slicer: {
                            ...slicer,
                            drill: Drill.Children
                        },
                        dimension: parseDimension(property.name, entityType)
                    });
                }
                this.contextMenu.close();
            }));
        });
        this.drillDown = this.updater((state, slicer) => {
            if (isAdvancedFilter(slicer)) {
                slicer.children.forEach((slicer) => {
                    this.drill({
                        parent: slicer.dimension,
                        slicer: {
                            ...slicer,
                            drill: Drill.Children
                        },
                        dimension: slicer.dimension
                    });
                });
            }
            else {
                this.drill({
                    parent: slicer.dimension,
                    slicer: {
                        ...slicer,
                        drill: Drill.Children
                    },
                    dimension: slicer.dimension
                });
            }
        });
        this.clearDrill = this.updater((state) => {
            state.drilledDimensions = null;
            state.selectedDrilledDimensions = null;
        });
        effect(() => {
            const dataSettings = this._dataSettings();
            const chartSettings = this._chartSettings();
            const chartOptions = this._chartOptions();
            this.error$.next(null);
        });
        effect(() => {
            this.echartsEngine.settings = this.chartSettings();
        });
        effect(() => {
            this.echartsEngine.options = this.chartOptions();
        });
    }
    ngOnInit() {
        this.businessService
            .selectResult()
            .pipe(filter(({ error }) => {
            if (error) {
                this.error$.next(error);
            }
            else {
                this.error$.next(null);
            }
            return !error;
        }), withLatestFrom(this.businessService.chartAnnotation$), takeUntilDestroyed(this.#destroyRef))
            .subscribe(([result, chartAnnotation]) => {
            this.empty = !result.data?.length;
            this.echartsEngine.data = result;
            this.echartsEngine.chartAnnotation = chartAnnotation;
        });
        this.businessService
            .onAfterServiceInit()
            .pipe(takeUntilDestroyed(this.#destroyRef))
            .subscribe(async () => {
            this.echartsEngine.entityType = await this.businessService.getEntityType();
            this.refresh();
        });
    }
    /**
     * Refresh data
     *
     * @param force Force refresh
     */
    refresh(force) {
        this.businessService.refresh(force);
    }
    onChartInit(event) {
        this.echartsEngine.echarts = event;
    }
    onOptionsError(event) {
        this.error$.next(event.message);
        this.echartsEngine.echarts.dispose();
        this._cdr.detectChanges();
    }
    openContextMenu(slicers, event) {
        event?.stopPropagation();
        event?.preventDefault();
        // 设置当前选中过滤器
        this.patchState({ selectedSlicers: slicers });
        // 弹出菜单坐标
        if (event?.type === 'touchend') {
            this.contextMenuPosition.x = event.zrX + 50 + 'px';
            this.contextMenuPosition.y = event.zrY + 'px';
        }
        else if (event) {
            this.contextMenuPosition.x = event.offsetX + 50 + 'px';
            this.contextMenuPosition.y = event.offsetY + 'px';
        }
        this.contextMenu.menuData = { slicers };
        if (isEmpty(slicers)) {
            this.contextMenu.close();
            this.onLinkAnalysis([]);
        }
        else {
            if (!this.options()?.disableContextMenu) {
                this.contextMenu.open();
            }
            if (this.options()?.realtimeLinked) {
                this.onLinkAnalysis(slicers);
            }
        }
    }
    /**
     * Linked analysis, output selected slicers on chart
     *
     * @param slicers
     */
    onLinkAnalysis(slicers) {
        this.slicersChange.emit(slicers);
        this._slicersChanging$.next(slicers);
    }
    updateSlicers(slicers) {
        this.#slicers.set(slicers);
    }
    screenshot() {
        const baseImage = this.echartsEngine.echarts.getDataURL({ type: 'png' });
        const downloadLink = document.createElement('a');
        document.body.appendChild(downloadLink);
        downloadLink.href = baseImage;
        downloadLink.target = '_self';
        downloadLink.download = (this.title || 'image') + '.png';
        downloadLink.click();
    }
    downloadData() {
        csvDownload(this.echartsEngine.data.data, (this.title || 'data') + '.csv', ',');
    }
    get _drilled() {
        return this.get((state) => state.selectedDrilledDimensions);
    }
    ngOnDestroy() {
        this.echartsEngine.onDestroy();
        super.onDestroy();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticalCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: AnalyticalCardComponent, selector: "ngm-analytical-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: false, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: false, isRequired: false, transformFunction: null }, dataSettings: { classPropertyName: "dataSettings", publicName: "dataSettings", isSignal: false, isRequired: false, transformFunction: null }, chartSettings: { classPropertyName: "chartSettings", publicName: "chartSettings", isSignal: true, isRequired: false, transformFunction: null }, chartOptions: { classPropertyName: "chartOptions", publicName: "chartOptions", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, slicers: { classPropertyName: "slicers", publicName: "slicers", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { slicersChange: "slicersChange", slicersChanging: "slicersChanging", chartClick: "chartClick", chartHighlight: "chartHighlight", chartContextMenu: "chartContextMenu", explain: "explain" }, host: { properties: { "class.ngm-density__compact": "!displayDensity||displayDensity==='compact'", "class.ngm-density__cosy": "displayDensity==='cosy'", "class.ngm-analytical-card": "this._isAnalyticalCard", "class.ngm-analytical-card__drilled": "this._drilled" } }, providers: [AnalyticalCardService], viewQueries: [{ propertyName: "contextMenu", first: true, predicate: ["cmt"], descendants: true }], usesInheritance: true, ngImport: i0, template: "@if (showHeader()) {\n  <div class=\"ngm-card-header flex justify-between items-center z-10\">\n    <div class=\"ngm-card-header__title\">{{ title }}</div>\n    \n    <div class=\"flex-1 flex justify-end items-center\">\n\n      <ng-content></ng-content>\n    @if (chartSettings()?.chartTypes?.length) {\n      <mat-button-toggle-group displayDensity=\"compact\" ngmAppearance=\"color\" color=\"primary\"\n        [(ngModel)]=\"chartType\"  \n      >\n        @if (_dataSettings()?.chartAnnotation?.chartType) {\n          <mat-button-toggle [value]=\"_dataSettings().chartAnnotation.chartType\">\n            {{ _dataSettings().chartAnnotation.chartType.name || _dataSettings().chartAnnotation.chartType.type }}\n          </mat-button-toggle>\n        }\n        @for (chartType of chartSettings().chartTypes; track $index) {\n          <mat-button-toggle [value]=\"chartType\">\n            {{ chartType?.name || chartType?.type }}\n          </mat-button-toggle>\n        }\n      </mat-button-toggle-group>\n    }\n    </div>\n\n    <div class=\"actions flex justify-around items-center\">\n\n      <ng-content select=\"[ngmAction]\"></ng-content>\n\n      <!-- data download -->\n    @if (!options()?.hideDataDownload) {\n      <button mat-icon-button displayDensity=\"cosy\" [matTooltip]=\" 'Ngm.AnalyticalCard.DataDownload' | translate: {Default: 'Data Download'} \"\n        matTooltipPosition=\"above\"\n        (click)=\"downloadData()\">\n        <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\n      </button>\n    }\n      <!-- screenshot -->\n    @if (!options()?.hideScreenshot) {\n      <button mat-icon-button displayDensity=\"cosy\" [matTooltip]=\" 'Ngm.AnalyticalCard.Screenshot' | translate: {Default: 'Screenshot'} \"\n        matTooltipPosition=\"above\"\n        (click)=\"screenshot()\">\n        <mat-icon fontSet=\"material-icons-outlined\">photo_camera</mat-icon>\n      </button>\n    }\n\n    @if (options()?.showSlicers) {\n      <button ngmAction class=\"btn pressable flex justify-center items-center w-7 h-7 rounded-full border-0 bg-transparent hover:bg-hover-bg\"\n        [cdkMenuTriggerFor]=\"filtersMenu\"\n        [cdkMenuTriggerData]=\"{trigger: mt}\"\n        #mt=\"cdkMenuTriggerFor\"\n        [class.active]=\"mt.isOpen()\"\n        [matTooltip]=\"'Story.Common.Slicers' | translate: {Default: 'Slicers'}\"\n        matTooltipPosition=\"above\">\n        <i class=\"ri-filter-line\"></i>\n      </button>\n    }\n\n      <!-- Refresh & Loading icon -->\n      <button mat-icon-button class=\"ngm-analytical-card__refresh\" displayDensity=\"cosy\"\n        [matTooltip]=\" 'Ngm.AnalyticalCard.Refresh' | translate: {Default: 'Refresh'} \"\n        matTooltipPosition=\"above\"\n        [style.visibility]=\"(isLoading$ | async) ? 'hidden' : 'visible'\"\n        (click)=\"refresh(true)\">\n        <mat-icon fontSet=\"material-icons-outlined\">refresh</mat-icon>\n      </button>\n    @if (isLoading$ | async) {\n      <mat-spinner class=\"ngm-analytical-card__loading\"\n        [diameter]=\"20\"\n        [strokeWidth]=\"1\"\n      />\n    }\n    </div>\n  </div>\n}\n\n@if (breadcrumbs$ | async; as breadcrumbs) {\n  <ngm-breadcrumb-bar class=\"shrink-0\" [displayDensity]=\"appearance?.displayDensity ?? DisplayDensity.compact\"\n    [steps]=\"breadcrumbs\"\n    (selectedChange)=\"reselectDrill($event)\"\n    (close)=\"clearDrill()\">\n  </ngm-breadcrumb-bar>\n}\n\n<div class=\"ngm-card-content\">\n  <div *ngIf=\"error$ | async as error\" class=\"ngm-card-error\">\n    <span class=\"title-icon text-2xl font-notoColorEmoji\">\uD83D\uDC1E</span>\n    <span>\n      {{ error }}\n    </span>\n  </div>\n\n  <div *ngIf=\"empty$ | async\" class=\"ngm-card-error\">\n    <span class=\"title-icon text-2xl font-notoColorEmoji\">\uD83D\uDED2</span>\n    <span>\n      {{ 'Ngm.AnalyticalCard.DataEmpty' | translate: {Default: \"Data Empty\"} }}\n    </span>\n  </div>\n\n  <ng-container *ngIf=\"!((error$ | async) || (empty$ | async))\">\n    <div echarts class=\"echarts-chart\"\n      [options]=\"options$ | async\"\n      [theme]=\"chartSettings()?.theme ?? 'default'\"\n      (chartInit)=\"onChartInit($event)\"\n      (optionsError)=\"onOptionsError($event)\"\n    >\n    </div>\n  </ng-container>\n    \n</div>\n\n\n<div style=\"visibility: hidden; position: absolute;\"\n  #cmt=\"cdkMenuTriggerFor\"\n  [style.left]=\"contextMenuPosition.x\"\n  [style.top]=\"contextMenuPosition.y\"\n  [cdkMenuTriggerFor]=\"contextMenu\">\n</div>\n\n<!-- [hasBackdrop]=\"false\" -->\n<ng-template #contextMenu let-slicers=\"slicers\">\n  <div cdkMenu class=\"cdk-menu__large\">\n    <button cdkMenuItem (click)=\"onLinkAnalysis(slicers)\">\n      <mat-icon displayDensity=\"cosy\">add_link</mat-icon>\n      {{ 'Ngm.AnalyticalCard.LinkAnalysis' | translate: {Default: \"Link Analysis\"} }}\n    </button>\n\n    @if (canDrillLevels$ | async) {\n      <div class=\"border-b border-solid border-divider-regular my-1\"></div>\n      <div class=\"p-2\">\n        {{ 'Ngm.AnalyticalCard.DrillLevel' | translate: {Default: \"Drill Level\"} }}\n      </div>\n\n      @for (drill of drillLevels$ | async; track drill) {\n        <button cdkMenuItem\n          [cdkMenuTriggerFor]=\"drillLevelsMenu\"\n          [cdkMenuTriggerData]=\"{slicer: drill.slicer, levels: drill.levels}\"\n        >\n          <mat-icon displayDensity=\"cosy\">format_list_numbered</mat-icon>\n          <div class=\"flex-1 overflow-hidden whitespace-nowrap text-ellipsis\">\n            {{drill.property.caption || drill.property.name}}:{{drill.slicerCaption}}\n          </div>\n        </button>\n      }\n    }\n\n    @if (canDrillDimensions$ | async) {\n      <div class=\"border-b border-solid border-divider-regular my-1\"></div>\n      <div class=\"p-2\">\n        {{ 'Ngm.AnalyticalCard.DrillDimension' | translate: {Default: \"Drill Dimension\"} }}\n      </div>\n\n      @for (item of dillSlicers$ | async; track item) {\n        <button cdkMenuItem\n          [cdkMenuTriggerFor]=\"drillDimensionsMenu\"\n          [cdkMenuTriggerData]=\"{slicer: item.value}\"\n        >\n          <mat-icon displayDensity=\"cosy\">tag</mat-icon>{{ item.label }}\n        </button>\n      }\n    }\n\n    @if (dilldown$ | async; as slicer) {\n      <div class=\"border-b border-solid border-divider-regular my-1\"></div>\n      <button cdkMenuItem (click)=\"drillDown(slicer)\">\n        <mat-icon displayDensity=\"cosy\">arrow_drop_down</mat-icon>\n        {{ 'Ngm.AnalyticalCard.DrillDown' | translate: {Default: \"Drill Down\"} }}\n      </button>\n    }\n  </div>\n</ng-template>\n\n<ng-template #drillLevelsMenu let-levels=\"levels\" let-slicer=\"slicer\">\n  <div cdkMenu class=\"cdk-menu__medium\">\n    @for (item of levels; track item) {\n      <button cdkMenuItem\n        [disabled]=\"item.disabled\"\n        (click)=\"drillLevel({property: item.property, slicer})\">\n        <ngm-entity-property class=\"w-full\" [property]=\"item.property\"></ngm-entity-property>\n      </button>\n    }\n  </div>\n</ng-template>\n\n<ng-template #drillDimensionsMenu let-slicer=\"slicer\">\n  <div cdkMenu class=\"cdk-menu__medium\">\n    @for (item of drillDimensions$ | async; track item) {\n      <button cdkMenuItem \n        [disabled]=\"item.disabled\"\n        (click)=\"drill({parent: slicer.dimension, dimension: item.dimension, slicer})\">\n        <ngm-entity-property class=\"w-full\" [property]=\"item.property\"></ngm-entity-property>\n      </button>\n    }\n  </div>\n</ng-template>\n\n\n<ng-template #filtersMenu let-trigger=\"trigger\">\n  <div class=\"relative p-4 rounded-2xl border-light shadow-md bg-components-card-bg\">\n    <div class=\"text-base font-semibold\">{{ 'Ngm.Selection.Slicers' | translate: {Default: \"Slicers\"} }}</div>\n    <ngm-slicers class=\"overflow-hidden\" inline editable\n      [slicers]=\"slicers\"\n      [dataSettings]=\"_dataSettings()\"\n      [limit]=\"5\"\n      [capacities]=\"[eSlicersCapacity.CombinationSlicer, eSlicersCapacity.AdvancedSlicer, eSlicersCapacity.Variable]\"\n      (valueChange)=\"updateSlicers($event)\"\n      (click)=\"$event.stopPropagation()\"\n    />\n\n    <button type=\"button\" class=\"absolute right-2 top-2 pressable cursor-pointer text-text-secondary hover:bg-hover-bg rounded-full p-1\"\n      (click)=\"trigger.close()\"\n    ><i class=\"ri-close-circle-line w-6 h-6 block\"></i>\n    </button>\n  </div>\n</ng-template>", styles: [":host{display:flex;flex-direction:column;position:relative}:host .ngm-card-header .actions{position:relative}:host .ngm-card-header .actions>*:not(.active){opacity:.1}:host:hover .ngm-card-header .actions>*{opacity:1}:host.ngm-analytical-card__drilled .ngm-card-content{height:calc(100% - 60px);max-height:calc(100% - 60px)}:host.ngm-density__compact.ngm-analytical-card__drilled .ngm-card-content{height:calc(100% - 55px);max-height:calc(100% - 55px)}:host.ngm-density__cosy.ngm-analytical-card__drilled .ngm-card-content{height:calc(100% - 60px);max-height:calc(100% - 60px)}.ngm-card-header__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ngm-card-content{height:calc(100% - 30px);max-height:calc(100% - 30px);margin-bottom:0}.echarts-chart{height:100%;max-height:100%}.ngm-analytical-card__loading{position:absolute;right:0;margin:5px}.ngm-card-error{position:absolute;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.CdkMenu, selector: "[cdkMenu]", outputs: ["closed"], exportAs: ["cdkMenu"] }, { kind: "directive", type: i3.CdkMenuItem, selector: "[cdkMenuItem]", inputs: ["cdkMenuItemDisabled", "cdkMenuitemTypeaheadLabel"], outputs: ["cdkMenuItemTriggered"], exportAs: ["cdkMenuItem"] }, { kind: "directive", type: i3.CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i8.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i8.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "directive", type: i9.NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "loading", "initOpts", "merge", "autoResize", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartPieSelectChanged", "chartPieSelected", "chartPieUnselected", "chartMapSelectChanged", "chartMapSelected", "chartMapUnselected", "chartAxisAreaSelected", "chartFocusNodeAdjacency", "chartUnfocusNodeAdjacency", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartRendered", "chartFinished"], exportAs: ["echarts"] }, { kind: "component", type: i10.NgmBreadcrumbBarComponent, selector: "ngm-breadcrumb-bar", inputs: ["steps", "disabled"], outputs: ["selectedChange", "close"] }, { kind: "directive", type: i1.DensityDirective, selector: "[displayDensity]", inputs: ["displayDensity"] }, { kind: "directive", type: i1.AppearanceDirective, selector: "[ngmAppearance]", inputs: ["color", "ngmAppearance", "outline", "hero", "acrylic", "opacity", "dashed", "danger"] }, { kind: "component", type: i12.NgmEntityPropertyComponent, selector: "ngm-entity-property", inputs: ["property", "displayBehaviour", "displayDensity", "hiddenIcon", "highlight", "role"] }, { kind: "component", type: i13.SlicersComponent, selector: "ngm-slicers", inputs: ["dataSettings", "slicers", "inline", "limit", "capacities"], outputs: ["valueChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i14.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticalCardComponent, decorators: [{
            type: Component,
            args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ngm-analytical-card', providers: [AnalyticalCardService], host: {
                        '[class.ngm-density__compact]': `!displayDensity||displayDensity==='compact'`,
                        '[class.ngm-density__cosy]': `displayDensity==='cosy'`
                    }, template: "@if (showHeader()) {\n  <div class=\"ngm-card-header flex justify-between items-center z-10\">\n    <div class=\"ngm-card-header__title\">{{ title }}</div>\n    \n    <div class=\"flex-1 flex justify-end items-center\">\n\n      <ng-content></ng-content>\n    @if (chartSettings()?.chartTypes?.length) {\n      <mat-button-toggle-group displayDensity=\"compact\" ngmAppearance=\"color\" color=\"primary\"\n        [(ngModel)]=\"chartType\"  \n      >\n        @if (_dataSettings()?.chartAnnotation?.chartType) {\n          <mat-button-toggle [value]=\"_dataSettings().chartAnnotation.chartType\">\n            {{ _dataSettings().chartAnnotation.chartType.name || _dataSettings().chartAnnotation.chartType.type }}\n          </mat-button-toggle>\n        }\n        @for (chartType of chartSettings().chartTypes; track $index) {\n          <mat-button-toggle [value]=\"chartType\">\n            {{ chartType?.name || chartType?.type }}\n          </mat-button-toggle>\n        }\n      </mat-button-toggle-group>\n    }\n    </div>\n\n    <div class=\"actions flex justify-around items-center\">\n\n      <ng-content select=\"[ngmAction]\"></ng-content>\n\n      <!-- data download -->\n    @if (!options()?.hideDataDownload) {\n      <button mat-icon-button displayDensity=\"cosy\" [matTooltip]=\" 'Ngm.AnalyticalCard.DataDownload' | translate: {Default: 'Data Download'} \"\n        matTooltipPosition=\"above\"\n        (click)=\"downloadData()\">\n        <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\n      </button>\n    }\n      <!-- screenshot -->\n    @if (!options()?.hideScreenshot) {\n      <button mat-icon-button displayDensity=\"cosy\" [matTooltip]=\" 'Ngm.AnalyticalCard.Screenshot' | translate: {Default: 'Screenshot'} \"\n        matTooltipPosition=\"above\"\n        (click)=\"screenshot()\">\n        <mat-icon fontSet=\"material-icons-outlined\">photo_camera</mat-icon>\n      </button>\n    }\n\n    @if (options()?.showSlicers) {\n      <button ngmAction class=\"btn pressable flex justify-center items-center w-7 h-7 rounded-full border-0 bg-transparent hover:bg-hover-bg\"\n        [cdkMenuTriggerFor]=\"filtersMenu\"\n        [cdkMenuTriggerData]=\"{trigger: mt}\"\n        #mt=\"cdkMenuTriggerFor\"\n        [class.active]=\"mt.isOpen()\"\n        [matTooltip]=\"'Story.Common.Slicers' | translate: {Default: 'Slicers'}\"\n        matTooltipPosition=\"above\">\n        <i class=\"ri-filter-line\"></i>\n      </button>\n    }\n\n      <!-- Refresh & Loading icon -->\n      <button mat-icon-button class=\"ngm-analytical-card__refresh\" displayDensity=\"cosy\"\n        [matTooltip]=\" 'Ngm.AnalyticalCard.Refresh' | translate: {Default: 'Refresh'} \"\n        matTooltipPosition=\"above\"\n        [style.visibility]=\"(isLoading$ | async) ? 'hidden' : 'visible'\"\n        (click)=\"refresh(true)\">\n        <mat-icon fontSet=\"material-icons-outlined\">refresh</mat-icon>\n      </button>\n    @if (isLoading$ | async) {\n      <mat-spinner class=\"ngm-analytical-card__loading\"\n        [diameter]=\"20\"\n        [strokeWidth]=\"1\"\n      />\n    }\n    </div>\n  </div>\n}\n\n@if (breadcrumbs$ | async; as breadcrumbs) {\n  <ngm-breadcrumb-bar class=\"shrink-0\" [displayDensity]=\"appearance?.displayDensity ?? DisplayDensity.compact\"\n    [steps]=\"breadcrumbs\"\n    (selectedChange)=\"reselectDrill($event)\"\n    (close)=\"clearDrill()\">\n  </ngm-breadcrumb-bar>\n}\n\n<div class=\"ngm-card-content\">\n  <div *ngIf=\"error$ | async as error\" class=\"ngm-card-error\">\n    <span class=\"title-icon text-2xl font-notoColorEmoji\">\uD83D\uDC1E</span>\n    <span>\n      {{ error }}\n    </span>\n  </div>\n\n  <div *ngIf=\"empty$ | async\" class=\"ngm-card-error\">\n    <span class=\"title-icon text-2xl font-notoColorEmoji\">\uD83D\uDED2</span>\n    <span>\n      {{ 'Ngm.AnalyticalCard.DataEmpty' | translate: {Default: \"Data Empty\"} }}\n    </span>\n  </div>\n\n  <ng-container *ngIf=\"!((error$ | async) || (empty$ | async))\">\n    <div echarts class=\"echarts-chart\"\n      [options]=\"options$ | async\"\n      [theme]=\"chartSettings()?.theme ?? 'default'\"\n      (chartInit)=\"onChartInit($event)\"\n      (optionsError)=\"onOptionsError($event)\"\n    >\n    </div>\n  </ng-container>\n    \n</div>\n\n\n<div style=\"visibility: hidden; position: absolute;\"\n  #cmt=\"cdkMenuTriggerFor\"\n  [style.left]=\"contextMenuPosition.x\"\n  [style.top]=\"contextMenuPosition.y\"\n  [cdkMenuTriggerFor]=\"contextMenu\">\n</div>\n\n<!-- [hasBackdrop]=\"false\" -->\n<ng-template #contextMenu let-slicers=\"slicers\">\n  <div cdkMenu class=\"cdk-menu__large\">\n    <button cdkMenuItem (click)=\"onLinkAnalysis(slicers)\">\n      <mat-icon displayDensity=\"cosy\">add_link</mat-icon>\n      {{ 'Ngm.AnalyticalCard.LinkAnalysis' | translate: {Default: \"Link Analysis\"} }}\n    </button>\n\n    @if (canDrillLevels$ | async) {\n      <div class=\"border-b border-solid border-divider-regular my-1\"></div>\n      <div class=\"p-2\">\n        {{ 'Ngm.AnalyticalCard.DrillLevel' | translate: {Default: \"Drill Level\"} }}\n      </div>\n\n      @for (drill of drillLevels$ | async; track drill) {\n        <button cdkMenuItem\n          [cdkMenuTriggerFor]=\"drillLevelsMenu\"\n          [cdkMenuTriggerData]=\"{slicer: drill.slicer, levels: drill.levels}\"\n        >\n          <mat-icon displayDensity=\"cosy\">format_list_numbered</mat-icon>\n          <div class=\"flex-1 overflow-hidden whitespace-nowrap text-ellipsis\">\n            {{drill.property.caption || drill.property.name}}:{{drill.slicerCaption}}\n          </div>\n        </button>\n      }\n    }\n\n    @if (canDrillDimensions$ | async) {\n      <div class=\"border-b border-solid border-divider-regular my-1\"></div>\n      <div class=\"p-2\">\n        {{ 'Ngm.AnalyticalCard.DrillDimension' | translate: {Default: \"Drill Dimension\"} }}\n      </div>\n\n      @for (item of dillSlicers$ | async; track item) {\n        <button cdkMenuItem\n          [cdkMenuTriggerFor]=\"drillDimensionsMenu\"\n          [cdkMenuTriggerData]=\"{slicer: item.value}\"\n        >\n          <mat-icon displayDensity=\"cosy\">tag</mat-icon>{{ item.label }}\n        </button>\n      }\n    }\n\n    @if (dilldown$ | async; as slicer) {\n      <div class=\"border-b border-solid border-divider-regular my-1\"></div>\n      <button cdkMenuItem (click)=\"drillDown(slicer)\">\n        <mat-icon displayDensity=\"cosy\">arrow_drop_down</mat-icon>\n        {{ 'Ngm.AnalyticalCard.DrillDown' | translate: {Default: \"Drill Down\"} }}\n      </button>\n    }\n  </div>\n</ng-template>\n\n<ng-template #drillLevelsMenu let-levels=\"levels\" let-slicer=\"slicer\">\n  <div cdkMenu class=\"cdk-menu__medium\">\n    @for (item of levels; track item) {\n      <button cdkMenuItem\n        [disabled]=\"item.disabled\"\n        (click)=\"drillLevel({property: item.property, slicer})\">\n        <ngm-entity-property class=\"w-full\" [property]=\"item.property\"></ngm-entity-property>\n      </button>\n    }\n  </div>\n</ng-template>\n\n<ng-template #drillDimensionsMenu let-slicer=\"slicer\">\n  <div cdkMenu class=\"cdk-menu__medium\">\n    @for (item of drillDimensions$ | async; track item) {\n      <button cdkMenuItem \n        [disabled]=\"item.disabled\"\n        (click)=\"drill({parent: slicer.dimension, dimension: item.dimension, slicer})\">\n        <ngm-entity-property class=\"w-full\" [property]=\"item.property\"></ngm-entity-property>\n      </button>\n    }\n  </div>\n</ng-template>\n\n\n<ng-template #filtersMenu let-trigger=\"trigger\">\n  <div class=\"relative p-4 rounded-2xl border-light shadow-md bg-components-card-bg\">\n    <div class=\"text-base font-semibold\">{{ 'Ngm.Selection.Slicers' | translate: {Default: \"Slicers\"} }}</div>\n    <ngm-slicers class=\"overflow-hidden\" inline editable\n      [slicers]=\"slicers\"\n      [dataSettings]=\"_dataSettings()\"\n      [limit]=\"5\"\n      [capacities]=\"[eSlicersCapacity.CombinationSlicer, eSlicersCapacity.AdvancedSlicer, eSlicersCapacity.Variable]\"\n      (valueChange)=\"updateSlicers($event)\"\n      (click)=\"$event.stopPropagation()\"\n    />\n\n    <button type=\"button\" class=\"absolute right-2 top-2 pressable cursor-pointer text-text-secondary hover:bg-hover-bg rounded-full p-1\"\n      (click)=\"trigger.close()\"\n    ><i class=\"ri-close-circle-line w-6 h-6 block\"></i>\n    </button>\n  </div>\n</ng-template>", styles: [":host{display:flex;flex-direction:column;position:relative}:host .ngm-card-header .actions{position:relative}:host .ngm-card-header .actions>*:not(.active){opacity:.1}:host:hover .ngm-card-header .actions>*{opacity:1}:host.ngm-analytical-card__drilled .ngm-card-content{height:calc(100% - 60px);max-height:calc(100% - 60px)}:host.ngm-density__compact.ngm-analytical-card__drilled .ngm-card-content{height:calc(100% - 55px);max-height:calc(100% - 55px)}:host.ngm-density__cosy.ngm-analytical-card__drilled .ngm-card-content{height:calc(100% - 60px);max-height:calc(100% - 60px)}.ngm-card-header__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ngm-card-content{height:calc(100% - 30px);max-height:calc(100% - 30px);margin-bottom:0}.echarts-chart{height:100%;max-height:100%}.ngm-analytical-card__loading{position:absolute;right:0;margin:5px}.ngm-card-error{position:absolute;width:100%;height:100%}\n"] }]
        }], ctorParameters: () => [], propDecorators: { _isAnalyticalCard: [{
                type: HostBinding,
                args: ['class.ngm-analytical-card']
            }], title: [{
                type: Input
            }], appearance: [{
                type: Input
            }], dataSettings: [{
                type: Input
            }], slicers: [{
                type: Input
            }], slicersChange: [{
                type: Output
            }], slicersChanging: [{
                type: Output
            }], chartClick: [{
                type: Output
            }], chartHighlight: [{
                type: Output
            }], chartContextMenu: [{
                type: Output
            }], explain: [{
                type: Output
            }], contextMenu: [{
                type: ViewChild,
                args: ['cmt']
            }], _drilled: [{
                type: HostBinding,
                args: ['class.ngm-analytical-card__drilled']
            }] } });

class AnalyticalCardModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticalCardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: AnalyticalCardModule, declarations: [AnalyticalCardComponent], imports: [CommonModule,
            FormsModule,
            CdkMenuModule,
            MatCardModule,
            MatButtonModule,
            MatIconModule,
            MatProgressSpinnerModule,
            MatTooltipModule,
            MatButtonToggleModule,
            NgxEchartsModule,
            TranslateModule,
            NgmCommonModule,
            NgmEntityPropertyComponent,
            NgmSelectionModule,
            OcapCoreModule], exports: [AnalyticalCardComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticalCardModule, imports: [CommonModule,
            FormsModule,
            CdkMenuModule,
            MatCardModule,
            MatButtonModule,
            MatIconModule,
            MatProgressSpinnerModule,
            MatTooltipModule,
            MatButtonToggleModule,
            NgxEchartsModule,
            TranslateModule,
            NgmCommonModule,
            NgmEntityPropertyComponent,
            NgmSelectionModule,
            OcapCoreModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AnalyticalCardModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        CommonModule,
                        FormsModule,
                        CdkMenuModule,
                        MatCardModule,
                        MatButtonModule,
                        MatIconModule,
                        MatProgressSpinnerModule,
                        MatTooltipModule,
                        MatButtonToggleModule,
                        NgxEchartsModule,
                        TranslateModule,
                        NgmCommonModule,
                        NgmEntityPropertyComponent,
                        NgmSelectionModule,
                        OcapCoreModule
                    ],
                    declarations: [AnalyticalCardComponent],
                    exports: [AnalyticalCardComponent]
                }]
        }] });

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

export { AnalyticalCardComponent, AnalyticalCardModule, AnalyticalCardService };
//# sourceMappingURL=metad-ocap-angular-analytical-card.mjs.map
