/*
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 { FinancialBucketCalculator } from "./FinancialBucketCalculator";
import { markType } from "igniteui-angular-core";
/**
 * @hidden
 */
export let FinancialPriceBucketCalculator = /*@__PURE__*/ (() => {
    class FinancialPriceBucketCalculator extends FinancialBucketCalculator {
        constructor(a) {
            super(a);
        }
        getBucket(a) {
            let b = a * this.b;
            let c = Math.min(b + this.b - 1, this.a.bz.ck.count - 1);
            if (b <= c && b >= 0 && c >= 0) {
                let d = this.a.bz.rc.item(b);
                let e = Number.NEGATIVE_INFINITY;
                let f = Number.POSITIVE_INFINITY;
                let g = this.a.bz.q9.item(c);
                for (let h = b; h <= c; ++h) {
                    e = Math.max(e, this.a.bz.ra.item(h));
                    f = Math.min(f, this.a.bz.rb.item(h));
                }
                f = Math.min(d, f);
                e = Math.max(g, e);
                return [0.5 * (b + c), d, e, f, g];
            }
            return [NaN, NaN, NaN, NaN, NaN];
        }
    }
    FinancialPriceBucketCalculator.$t = markType(FinancialPriceBucketCalculator, 'FinancialPriceBucketCalculator', FinancialBucketCalculator.$);
    return FinancialPriceBucketCalculator;
})();
