/*
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 { Base, Boolean_$type, markType } from "igniteui-angular-core";
import { IEG_AnchorVisitor$2_$type } from "./IEG_AnchorVisitor$2";
import { Tuple$2 } from "igniteui-angular-core";
import { Sheet } from "./Sheet";
import { WorksheetShape } from "./WorksheetShape";
import { ExcelUtils } from "./ExcelUtils";
import { MathUtilities } from "./MathUtilities";
import { XlsxUtilities } from "./XlsxUtilities";
import { truncate } from "igniteui-angular-core";
/**
 * @hidden
 */
export class WorkbookLoadManagerExcel2007_ShapeAnchorApplicator extends Base {
    _visitCT_AbsoluteAnchor$i(a, b) {
        let c = b.c;
        let d = b.d;
        d.positioningMode = 3;
        if (a.c == null || a.d == null) {
            d._setBoundsInTwips(c, ExcelUtils.hb(0, 0, 1, 1));
            return false;
        }
        let e = ExcelUtils.hb(truncate(MathUtilities.f(a.c.a.k())), truncate(MathUtilities.f(a.c.b.k())), truncate(MathUtilities.f(a.d.a.j())), truncate(MathUtilities.f(a.d.b.j())));
        d._setBoundsInTwips(c, e);
        return true;
    }
    _visitCT_OneCellAnchor$i(a, b) {
        let c = b.c;
        let d = b.d;
        d.positioningMode = 2;
        if (a.d == null || a.c == null) {
            d._setBoundsInTwips(c, ExcelUtils.hb(0, 0, 1, 1));
            return false;
        }
        else if (c.type != 0) {
            d._setBoundsInTwips(c, ExcelUtils.hb(0, 0, 1, 1));
            return false;
        }
        let e = c;
        let f = XlsxUtilities.bd(a.d, e);
        let g = WorksheetShape._ds(e, f.c, f.d, f.c, f.d);
        let h = ExcelUtils.hb(truncate(MathUtilities.f(g.left)), truncate(MathUtilities.f(g.top)), truncate(MathUtilities.f(a.c.a.j())), truncate(MathUtilities.f(a.c.b.j())));
        d._setBoundsInTwips(e, h);
        return true;
    }
    _visitCT_TwoCellAnchor$i(a, b) {
        let c = b.c;
        let d = b.d;
        d.positioningMode = XlsxUtilities.w(a.e);
        if (a.c == null || a.d == null) {
            d._setBoundsInTwips(c, ExcelUtils.hb(0, 0, 1, 1));
            return false;
        }
        else if (c.type != 0) {
            d._setBoundsInTwips(c, ExcelUtils.hb(0, 0, 1, 1));
            return false;
        }
        let e = c;
        let f = XlsxUtilities.bd(a.c, e);
        let g = XlsxUtilities.bd(a.d, e);
        d._c5(e, f.c, f.d, g.c, g.d);
        return true;
    }
}
WorkbookLoadManagerExcel2007_ShapeAnchorApplicator.$t = markType(WorkbookLoadManagerExcel2007_ShapeAnchorApplicator, 'WorkbookLoadManagerExcel2007_ShapeAnchorApplicator', Base.$, [IEG_AnchorVisitor$2_$type.specialize(Tuple$2.$.specialize(Sheet.$, WorksheetShape.$), Boolean_$type)]);
WorkbookLoadManagerExcel2007_ShapeAnchorApplicator.a = new WorkbookLoadManagerExcel2007_ShapeAnchorApplicator();
//# sourceMappingURL=WorkbookLoadManagerExcel2007_ShapeAnchorApplicator.js.map