/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { AnchoredRadialSeries } from "./AnchoredRadialSeries";
import { DependencyProperty } from "igniteui-react-core";
import { Point_$type, markType, markDep, runOn, fromEnum } from "igniteui-react-core";
import { Pool$1 } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { PathGeometry } from "igniteui-react-core";
import { PathFigure } from "igniteui-react-core";
import { PolyLineSegment } from "igniteui-react-core";
import { ViewportUtils } from "./ViewportUtils";
import { PropertyMetadata } from "igniteui-react-core";
import { AnchoredRadialSeriesView } from "./AnchoredRadialSeriesView";
/**
 * @hidden
 */
export let RadialColumnSeries = /*@__PURE__*/ (() => {
    class RadialColumnSeries extends AnchoredRadialSeries {
        constructor() {
            super();
            this.ab = RadialColumnSeries.$;
        }
        bf() {
            return new RadialColumnSeriesView(this);
        }
        i2(a) {
            super.i2(a);
            this.o2 = a;
        }
        ac() {
            super.ac();
            this.jl(false);
        }
        preferredCategoryMode(a) {
            return a != null && a == this.nd ? 2 : 0;
        }
        h3(a, b) {
            super.h3(a, b);
            let c = b;
            if (a) {
                c.cx.count = 0;
            }
        }
        eg() {
            return this.nd.jz(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
        }
        nx(a, b) {
            super.nx(a, b);
            let c = a.f;
            let d = b.bs;
            let e = b.br;
            let f = this.getEffectiveViewport1(b);
            let g = this.l0(b);
            let h = this.nf.jo(e, d, f, g);
            let i = b;
            let j = this.nf;
            let k = Math.max(0, 0.5 * j.lq);
            k = Math.max(k, h.minLength * 0.9);
            let l = ViewportUtils.d(k, d, e);
            let m = this.nd.jz(d, e, f);
            let n = Math.max(0.1 * this.nf.lr, k);
            let o = this.ng.d(0, n, d, e);
            let p = this.ng.e(0, n, d, e);
            let q = this.ng.d(m, n, d, e);
            let r = this.ng.e(m, n, d, e);
            let s = Math.sqrt((o - q) * (o - q) + (p - r) * (p - r));
            let t = { $type: Point_$type, x: ViewportUtils.c(0.5, d, e), y: ViewportUtils.f(0.5, d, e) };
            for (let u = 0; u < c.count; ++u) {
                let v = Math.min(a.f._inner[u][2], h.maxLength * 1.1);
                let w = this.ng.d(a.f._inner[u][0], v, d, e);
                let x = this.ng.e(a.f._inner[u][0], v, d, e);
                let y = Math.sqrt((w - t.x) * (w - t.x) + (x - t.y) * (x - t.y));
                let z = y;
                let aa = l;
                let ab = a.f._inner[u][0] - (Math.PI / 2);
                let ac = i.cx.item(u);
                let ad = 0 - (s / 2);
                let ae = (s / 2);
                let af = Math.max(aa, z);
                let ag = Math.min(aa, z);
                let ah = Math.cos(ab);
                let ai = Math.sin(ab);
                let aj = { $type: Point_$type, x: t.x + (ad * ah - af * ai), y: t.y + (ad * ai + af * ah) };
                let ak = { $type: Point_$type, x: t.x + (ae * ah - af * ai), y: t.y + (ae * ai + af * ah) };
                let al = { $type: Point_$type, x: t.x + (ae * ah - ag * ai), y: t.y + (ae * ai + ag * ah) };
                let am = { $type: Point_$type, x: t.x + (ad * ah - ag * ai), y: t.y + (ad * ai + ag * ah) };
                let an = new PathGeometry();
                let ao = new PathFigure();
                ao._startPoint = aj;
                ao._isClosed = true;
                let ap = new PolyLineSegment();
                ap._points.add(ak);
                ap._points.add(al);
                ap._points.add(am);
                ao._segments.add(ap);
                an.c.add(ao);
                ac.ak = an;
            }
            i.cx.count = c.count;
            this.o2.c2();
        }
    }
    RadialColumnSeries.$t = /*@__PURE__*/ markType(RadialColumnSeries, 'RadialColumnSeries', AnchoredRadialSeries.$);
    RadialColumnSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, RadialColumnSeries, 'raisePropertyChanged', ['RadiusX:o3:o7', [1, 2], 'RadiusY:o4:o8', [1, 2]]);
    return RadialColumnSeries;
})();
/**
 * @hidden
 */
export let RadialColumnSeriesView = /*@__PURE__*/ (() => {
    class RadialColumnSeriesView extends AnchoredRadialSeriesView {
        constructor(a) {
            super(a);
            this.cw = null;
            this.cx = null;
            this.cy = null;
            this.cw = a;
            this.cx = ((() => {
                let $ret = new Pool$1(Path.$);
                $ret.create = runOn(this, this.c4);
                $ret.activate = runOn(this, this.cz);
                $ret.disactivate = runOn(this, this.c1);
                $ret.destroy = runOn(this, this.c0);
                return $ret;
            })());
        }
        ap() {
            super.ap();
            this.cy = new List$1(Path.$, 0);
            if (!this.n) {
                this.e.eu = 4;
                this.e.bj = 1;
            }
        }
        c4() {
            let a = new Path();
            this.cy.add(a);
            a._visibility = 1;
            return a;
        }
        cz(a) {
            a._visibility = 0;
        }
        c1(a) {
            a._visibility = 1;
        }
        c0(a) {
            this.cy.remove(a);
        }
        c3(a, b, c, d, e, f) {
            this.an();
        }
        bb(a, b) {
            super.bb(a, b);
            let c = a;
            c._fill = this.e.lb;
            c._stroke = this.e.lc;
            c.ac = this.e.ey;
            c.ai = this.e.ll;
            c.ad = this.e.lm;
        }
        bc(a, b) {
            super.bc(a, b);
            let c = a;
            let d = this.bm(b);
            c._fill = d;
            c._stroke = d;
            c.ac = this.e.ey + 3;
        }
        a3(a, b) {
            super.a3(a, b);
            if (a.d) {
                for (let c = 0; c < this.cy.count; c++) {
                    let d = this.cy._inner[c];
                    this.ba(d, c, b);
                    a.s(d);
                }
            }
        }
        ai(a) {
            super.ai(a);
            let b = 0;
            for (let c of fromEnum(this.cx.a)) {
                this.e.a2.exportPathData(a, c, "column" + b, ["Main", "Fill"]);
                b++;
            }
        }
        c2() {
            this.an();
        }
    }
    RadialColumnSeriesView.$t = /*@__PURE__*/ markType(RadialColumnSeriesView, 'RadialColumnSeriesView', AnchoredRadialSeriesView.$);
    return RadialColumnSeriesView;
})();
//# sourceMappingURL=RadialColumnSeries_combined.js.map
