import * as i0 from '@angular/core';
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import { ArcElement, LineElement, BarElement, PointElement, LineController, BarController, PieController, ScatterController, CategoryScale, LinearScale, Filler, Tooltip, Chart } from 'chart.js';
import { ChartBaseComponent, ChartDataService } from '@ironsource/fusion-ui/components/chart/common/base';
export { ChartDataService, ChartType } from '@ironsource/fusion-ui/components/chart/common/base';
import * as i1 from '@angular/common';
import { DatePipe, CurrencyPipe, DecimalPipe, PercentPipe, CommonModule } from '@angular/common';
import * as i2 from '@ironsource/fusion-ui/components/loader/v2';
import { LoaderModule } from '@ironsource/fusion-ui/components/loader/v2';
import * as i3 from '@ironsource/fusion-ui/pipes/numbers';
import { ShortNumberScaleSuffixPipe } from '@ironsource/fusion-ui/pipes/numbers';
import { ClonePipe } from '@ironsource/fusion-ui/pipes/clone';

function ChartComponent_div_1_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 6);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "shortNumberScaleSuffix");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r2.pieDataSum));
} }
function ChartComponent_div_1_div_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r3.pieSumLabel);
} }
function ChartComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵtemplate(1, ChartComponent_div_1_div_1_Template, 3, 3, "div", 4)(2, ChartComponent_div_1_div_2_Template, 2, 1, "div", 5);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("fu-summary-with-label", ctx_r0.pieSumLabel);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r0.pieDataSum);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r0.pieSumLabel);
} }
function ChartComponent_div_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelement(1, "div", 10);
    i0.ɵɵelementStart(2, "div", 11);
    i0.ɵɵtext(3, "No data to display");
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} }
function ChartComponent_div_3_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "fusion-loader", 12);
    i0.ɵɵtext(2, "Loading please wait");
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵadvance();
    i0.ɵɵproperty("status", true);
} }
function ChartComponent_div_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 8);
    i0.ɵɵtemplate(1, ChartComponent_div_3_ng_container_1_Template, 4, 0, "ng-container", 9)(2, ChartComponent_div_3_ng_container_2_Template, 3, 1, "ng-container", 9);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("fu-loading", ctx_r1.loading);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r1.noData && !ctx_r1.loading);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r1.loading);
} }
Chart.register(ArcElement, LineElement, BarElement, PointElement, LineController, BarController, PieController, ScatterController, CategoryScale, LinearScale, Filler, Tooltip);
class ChartComponent extends ChartBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵChartComponent_BaseFactory; return function ChartComponent_Factory(t) { return (ɵChartComponent_BaseFactory || (ɵChartComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ChartComponent)))(t || ChartComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ChartComponent, selectors: [["fusion-chart"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 4, consts: [[1, "canvas-holder", 3, "ngClass", "hidden"], ["class", "summary-holder", 3, "fu-summary-with-label", 4, "ngIf"], ["class", "chart-nodata", 3, "fu-loading", 4, "ngIf"], [1, "summary-holder"], ["class", "fu-summary-data", 4, "ngIf"], ["class", "fu-summary-label truncate", 4, "ngIf"], [1, "fu-summary-data"], [1, "fu-summary-label", "truncate"], [1, "chart-nodata"], [4, "ngIf"], [1, "no-data-img"], [1, "no-data-text"], [3, "status"]], template: function ChartComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0);
            i0.ɵɵtemplate(1, ChartComponent_div_1_Template, 3, 4, "div", 1);
            i0.ɵɵelement(2, "canvas");
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(3, ChartComponent_div_3_Template, 3, 4, "div", 2);
        } if (rf & 2) {
            i0.ɵɵproperty("ngClass", "fu-type-" + ctx.type)("hidden", ctx.loading || ctx.noData);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.pieDataSum || ctx.pieSumLabel);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.noData || ctx.loading);
        } }, dependencies: [i1.NgClass, i1.NgIf, i2.LoaderComponent, i3.ShortNumberScaleSuffixPipe], styles: ["[_nghost-%COMP%]   .canvas-holder[_ngcontent-%COMP%]{height:var(--chart-canvas-height, 100%);position:relative}[_nghost-%COMP%]   .canvas-holder[_ngcontent-%COMP%]   canvas[_ngcontent-%COMP%]{position:absolute}[_nghost-%COMP%]   .canvas-holder[_ngcontent-%COMP%]   .summary-holder[_ngcontent-%COMP%]{position:absolute;display:block;text-align:center;top:45%;width:100%}[_nghost-%COMP%]   .canvas-holder[_ngcontent-%COMP%]   .summary-holder.fu-summary-with-label[_ngcontent-%COMP%]{top:38%}[_nghost-%COMP%]   .chart-nodata[_ngcontent-%COMP%]{text-align:center;height:var(--chart-canvas-height, 100%);padding-top:148px}[_nghost-%COMP%]   .chart-nodata[_ngcontent-%COMP%]   .no-data-img[_ngcontent-%COMP%]{display:none}", "[_nghost-%COMP%]   .canvas-holder[_ngcontent-%COMP%]   .summary-holder[_ngcontent-%COMP%]{font-size:18px;font-family:NHaasGroteskDSPro-75Bd,sans-serif;font-weight:400}[_nghost-%COMP%]   .chart-nodata[_ngcontent-%COMP%]{font-size:15px;font-family:NHaasGroteskDSPro-75Bd,sans-serif;font-weight:400}[_nghost-%COMP%]   .canvas-holder[_ngcontent-%COMP%]   .summary-holder[_ngcontent-%COMP%]{color:var(--fu-dark-700, #1d1c64)}[_nghost-%COMP%]   .canvas-holder.fu-type-pie[_ngcontent-%COMP%]   .summary-holder[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%]   .chart-nodata[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding-top:initial;color:var(--fu-light-800, #8e959d);background-color:var(--fu-light-100, #f7f8f9);position:relative}[_nghost-%COMP%]   .chart-nodata[_ngcontent-%COMP%]   .no-data-img[_ngcontent-%COMP%]{display:block;height:57px;width:100%;margin-bottom:11px;background:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 57'%3E%3Cg fill='%23B7BBC0' fill-rule='evenodd'%3E%3Cpath d='M48 56.5c26.51 0 48-6.384 48-11.647S77.09 38.5 50.58 38.5C24.072 38.5 0 39.59 0 44.853S21.49 56.5 48 56.5z' opacity='.361'/%3E%3Cpath d='M56.37 1.224c.193-.562.8-.86 1.351-.663.553.197.845.814.65 1.375l-3.145 9.174a9.463 9.463 0 012.025 2.78c1.964.184 3.503 1.866 3.503 3.915 0 1.983-1.438 3.617-3.307 3.89a9.383 9.383 0 01-4.718 4.917v1.198H55c3.26 0 5.905 2.695 5.905 6.018 0 3.289-2.591 5.96-5.806 6.016v3.387a2.271 2.271 0 01-4.542 0v-3.386H47.35v3.385a2.272 2.272 0 01-4.544 0v-3.388C39.589 39.787 37 37.117 37 33.83c0-3.323 2.643-6.017 5.905-6.016h2.27v-1.198a9.383 9.383 0 01-4.717-4.916c-1.87-.277-3.308-1.911-3.308-3.891 0-2.049 1.54-3.732 3.505-3.918a9.48 9.48 0 012.025-2.78l-3.146-9.174a1.085 1.085 0 01.65-1.375 1.059 1.059 0 011.352.663l2.932 8.553a9.098 9.098 0 014.472-1.2h.022a9.066 9.066 0 014.475 1.2zm-.553 34.716a1.023 1.023 0 00-.158.545c0 .559.446 1.013.995 1.013.196 0 .38-.06.533-.163zm.837-.467c-.197 0-.38.06-.534.159l1.37 1.4c.099-.161.158-.348.161-.545 0-.563-.447-1.014-.997-1.014zm-.837-2.372a1.047 1.047 0 00-.16.544c0 .561.447 1.015.996 1.015.196 0 .381-.06.534-.162zm.837-.467c-.197 0-.38.06-.534.16l1.37 1.396c.099-.157.158-.344.161-.544 0-.56-.447-1.012-.997-1.012zm-.837-2.22a1.048 1.048 0 00-.16.545c0 .56.447 1.012.996 1.012.196 0 .381-.06.534-.16zm.837-.469c-.197 0-.38.06-.534.16l1.37 1.398c.099-.157.158-.343.161-.543 0-.562-.447-1.015-.997-1.015zm-7.69-18.82h-.023l-.236.005c-3.6.152-6.48 3.181-6.48 6.885 0 3.782 3.007 6.863 6.716 6.889h.022l.236-.006c3.599-.151 6.482-3.182 6.482-6.883 0-3.784-3.009-6.863-6.718-6.89zm-.01 1.08c3.127.02 5.667 2.616 5.667 5.81 0 3.192-2.54 5.786-5.667 5.809-3.13-.021-5.668-2.617-5.668-5.81 0-3.193 2.538-5.789 5.668-5.808zm.01 1.62h-.021c-2.252.027-4.068 1.89-4.068 4.19 0 2.297 1.816 4.162 4.068 4.189h.022l.203-.008c2.155-.132 3.862-1.953 3.862-4.181 0-2.3-1.815-4.163-4.065-4.19z'/%3E%3Cpath d='M21.244 16.256a.835.835 0 001.179 0l1.077-1.078 1.077 1.078a.835.835 0 001.179 0 .834.834 0 000-1.178L24.678 14l1.078-1.077a.835.835 0 00-1.179-1.179L23.5 12.822l-1.077-1.078a.835.835 0 00-1.179 1.179L22.322 14l-1.078 1.078a.834.834 0 000 1.178zm-6.996 10.902c.227.228.526.342.825.342.298 0 .597-.114.824-.342l1.509-1.508 1.508 1.508a1.162 1.162 0 001.65 0 1.166 1.166 0 000-1.65L19.055 24l1.509-1.508a1.166 1.166 0 10-1.65-1.65l-1.508 1.509-1.509-1.509a1.166 1.166 0 10-1.65 1.65L15.757 24l-1.51 1.509a1.168 1.168 0 000 1.65zm64.996-14.902a.835.835 0 001.179 0l1.077-1.078 1.077 1.078a.835.835 0 001.179 0 .834.834 0 000-1.178L82.678 10l1.078-1.077a.835.835 0 00-1.179-1.179L81.5 8.822l-1.077-1.078a.835.835 0 00-1.179 1.179L80.322 10l-1.078 1.078a.834.834 0 000 1.178z' opacity='.361'/%3E%3C/g%3E%3C/svg%3E\") center center no-repeat}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ChartComponent, [{
        type: Component,
        args: [{ selector: 'fusion-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"canvas-holder\" [ngClass]=\"'fu-type-' + type\" [hidden]=\"loading || noData\">\n    <div class=\"summary-holder\" [class.fu-summary-with-label]=\"pieSumLabel\" *ngIf=\"pieDataSum || pieSumLabel\">\n        <div class=\"fu-summary-data\" *ngIf=\"pieDataSum\">{{pieDataSum | shortNumberScaleSuffix}}</div>\n        <div class=\"fu-summary-label truncate\" *ngIf=\"pieSumLabel\">{{pieSumLabel}}</div>\n    </div>\n    <canvas></canvas>\n</div>\n<div *ngIf=\"noData || loading\" class=\"chart-nodata\" [class.fu-loading]=\"loading\">\n    <ng-container *ngIf=\"noData && !loading\">\n        <div class=\"no-data-img\"></div>\n        <div class=\"no-data-text\">No data to display</div>\n    </ng-container>\n    <ng-container *ngIf=\"loading\">\n        <fusion-loader [status]=\"true\">Loading please wait</fusion-loader>\n    </ng-container>\n</div>\n", styles: [":host .canvas-holder{height:var(--chart-canvas-height, 100%);position:relative}:host .canvas-holder canvas{position:absolute}:host .canvas-holder .summary-holder{position:absolute;display:block;text-align:center;top:45%;width:100%}:host .canvas-holder .summary-holder.fu-summary-with-label{top:38%}:host .chart-nodata{text-align:center;height:var(--chart-canvas-height, 100%);padding-top:148px}:host .chart-nodata .no-data-img{display:none}\n", ":host .canvas-holder .summary-holder{font-size:18px;font-family:NHaasGroteskDSPro-75Bd,sans-serif;font-weight:400}:host .chart-nodata{font-size:15px;font-family:NHaasGroteskDSPro-75Bd,sans-serif;font-weight:400}:host .canvas-holder .summary-holder{color:var(--fu-dark-700, #1d1c64)}:host .canvas-holder.fu-type-pie .summary-holder{display:none}:host .chart-nodata{width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding-top:initial;color:var(--fu-light-800, #8e959d);background-color:var(--fu-light-100, #f7f8f9);position:relative}:host .chart-nodata .no-data-img{display:block;height:57px;width:100%;margin-bottom:11px;background:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 57'%3E%3Cg fill='%23B7BBC0' fill-rule='evenodd'%3E%3Cpath d='M48 56.5c26.51 0 48-6.384 48-11.647S77.09 38.5 50.58 38.5C24.072 38.5 0 39.59 0 44.853S21.49 56.5 48 56.5z' opacity='.361'/%3E%3Cpath d='M56.37 1.224c.193-.562.8-.86 1.351-.663.553.197.845.814.65 1.375l-3.145 9.174a9.463 9.463 0 012.025 2.78c1.964.184 3.503 1.866 3.503 3.915 0 1.983-1.438 3.617-3.307 3.89a9.383 9.383 0 01-4.718 4.917v1.198H55c3.26 0 5.905 2.695 5.905 6.018 0 3.289-2.591 5.96-5.806 6.016v3.387a2.271 2.271 0 01-4.542 0v-3.386H47.35v3.385a2.272 2.272 0 01-4.544 0v-3.388C39.589 39.787 37 37.117 37 33.83c0-3.323 2.643-6.017 5.905-6.016h2.27v-1.198a9.383 9.383 0 01-4.717-4.916c-1.87-.277-3.308-1.911-3.308-3.891 0-2.049 1.54-3.732 3.505-3.918a9.48 9.48 0 012.025-2.78l-3.146-9.174a1.085 1.085 0 01.65-1.375 1.059 1.059 0 011.352.663l2.932 8.553a9.098 9.098 0 014.472-1.2h.022a9.066 9.066 0 014.475 1.2zm-.553 34.716a1.023 1.023 0 00-.158.545c0 .559.446 1.013.995 1.013.196 0 .38-.06.533-.163zm.837-.467c-.197 0-.38.06-.534.159l1.37 1.4c.099-.161.158-.348.161-.545 0-.563-.447-1.014-.997-1.014zm-.837-2.372a1.047 1.047 0 00-.16.544c0 .561.447 1.015.996 1.015.196 0 .381-.06.534-.162zm.837-.467c-.197 0-.38.06-.534.16l1.37 1.396c.099-.157.158-.344.161-.544 0-.56-.447-1.012-.997-1.012zm-.837-2.22a1.048 1.048 0 00-.16.545c0 .56.447 1.012.996 1.012.196 0 .381-.06.534-.16zm.837-.469c-.197 0-.38.06-.534.16l1.37 1.398c.099-.157.158-.343.161-.543 0-.562-.447-1.015-.997-1.015zm-7.69-18.82h-.023l-.236.005c-3.6.152-6.48 3.181-6.48 6.885 0 3.782 3.007 6.863 6.716 6.889h.022l.236-.006c3.599-.151 6.482-3.182 6.482-6.883 0-3.784-3.009-6.863-6.718-6.89zm-.01 1.08c3.127.02 5.667 2.616 5.667 5.81 0 3.192-2.54 5.786-5.667 5.809-3.13-.021-5.668-2.617-5.668-5.81 0-3.193 2.538-5.789 5.668-5.808zm.01 1.62h-.021c-2.252.027-4.068 1.89-4.068 4.19 0 2.297 1.816 4.162 4.068 4.189h.022l.203-.008c2.155-.132 3.862-1.953 3.862-4.181 0-2.3-1.815-4.163-4.065-4.19z'/%3E%3Cpath d='M21.244 16.256a.835.835 0 001.179 0l1.077-1.078 1.077 1.078a.835.835 0 001.179 0 .834.834 0 000-1.178L24.678 14l1.078-1.077a.835.835 0 00-1.179-1.179L23.5 12.822l-1.077-1.078a.835.835 0 00-1.179 1.179L22.322 14l-1.078 1.078a.834.834 0 000 1.178zm-6.996 10.902c.227.228.526.342.825.342.298 0 .597-.114.824-.342l1.509-1.508 1.508 1.508a1.162 1.162 0 001.65 0 1.166 1.166 0 000-1.65L19.055 24l1.509-1.508a1.166 1.166 0 10-1.65-1.65l-1.508 1.509-1.509-1.509a1.166 1.166 0 10-1.65 1.65L15.757 24l-1.51 1.509a1.168 1.168 0 000 1.65zm64.996-14.902a.835.835 0 001.179 0l1.077-1.078 1.077 1.078a.835.835 0 001.179 0 .834.834 0 000-1.178L82.678 10l1.078-1.077a.835.835 0 00-1.179-1.179L81.5 8.822l-1.077-1.078a.835.835 0 00-1.179 1.179L80.322 10l-1.078 1.078a.834.834 0 000 1.178z' opacity='.361'/%3E%3C/g%3E%3C/svg%3E\") center center no-repeat}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ChartComponent, { className: "ChartComponent", filePath: "chart.component.ts", lineNumber: 40 }); })();

class ChartModule {
    static { this.ɵfac = function ChartModule_Factory(t) { return new (t || ChartModule)(); }; }
    static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: ChartModule }); }
    static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [DatePipe, CurrencyPipe, DecimalPipe, PercentPipe, ChartDataService, ShortNumberScaleSuffixPipe], imports: [CommonModule, LoaderModule] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ChartModule, [{
        type: NgModule,
        args: [{
                imports: [CommonModule, LoaderModule, ShortNumberScaleSuffixPipe, ClonePipe],
                declarations: [ChartComponent],
                exports: [ChartComponent],
                providers: [DatePipe, CurrencyPipe, DecimalPipe, PercentPipe, ChartDataService, ShortNumberScaleSuffixPipe]
            }]
    }], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ChartModule, { declarations: [ChartComponent], imports: [CommonModule, LoaderModule, ShortNumberScaleSuffixPipe, ClonePipe], exports: [ChartComponent] }); })();

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

export { ChartComponent, ChartModule };
//# sourceMappingURL=ironsource-fusion-ui-components-chart-v2.mjs.map
