UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

1,465 lines (1,464 loc) 46.1 kB
/* 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, Point_$type, runOn, fromEnum, markType, PointUtil } from "igniteui-react-core"; import { ISeriesViewerInteractionManager_$type } from "./ISeriesViewerInteractionManager"; import { SeriesHighlightingManager } from "./SeriesHighlightingManager"; import { SeriesSelectionHighlightingManager } from "./SeriesSelectionHighlightingManager"; import { SeriesFocusHighlightingManager } from "./SeriesFocusHighlightingManager"; import { SeriesViewerScrollbarManager } from "./SeriesViewerScrollbarManager"; import { Rect } from "igniteui-react-core"; import { TileZoomManager } from "./TileZoomManager"; import { ChartSelection } from "./ChartSelection"; import { MouseButtonEventArgs } from "igniteui-react-core"; import { MouseEventArgs } from "igniteui-react-core"; import { ViewportUtils } from "./ViewportUtils"; import { Size } from "igniteui-react-core"; import { MathUtil } from "igniteui-react-core"; import { truncate, intDivide, isNaN_ } from "igniteui-react-core"; /** * @hidden */ export let SeriesViewerInteractionManager = /*@__PURE__*/ (() => { class SeriesViewerInteractionManager extends Base { constructor() { super(); this.y = 0; this.z = 0; this.ar = null; this.v = 0; this.w = 0; this.u = 0; this.x = 0; this.k = false; this.l = false; this.as = null; this.au = null; this.m = false; this.q = false; this.h = null; this.e = null; this.f = null; this.d = null; this.g = null; this.at = null; this.av = null; this.c = null; this.a = null; this.j = false; this.at = Rect.empty; this.as = Rect.empty; } get f$e() { if (this.e == null) { this.e = new SeriesHighlightingManager(); } return this.e; } get f$f() { if (this.f == null) { this.f = new SeriesSelectionHighlightingManager(); } return this.f; } get f$d() { if (this.d == null) { this.d = new SeriesFocusHighlightingManager(); } return this.d; } get f$b() { if (this.g == null) { this.g = new SeriesViewerScrollbarManager(); } return this.g; } f$j(a, b, c) { let d = a.dc; if (a.bo != null) { a = a.bo; } if (a.bl != null) { a = a.bl; } let e = ((() => { let $ret = new ChartSelection(); $ret.item = b; $ret.series = a; return $ret; })()); let f = a.dc.selectedSeriesItems; if (f.contains(e)) { return; } a.dc.selectedSeriesItems.add(e); } f$aq(a, b, c) { let d = a.dc; if (a.bo != null) { a = a.bo; } if (a.bl != null) { a = a.bl; } let e = ((() => { let $ret = new ChartSelection(); $ret.item = b; $ret.series = a; return $ret; })()); let f = a.dc.selectedSeriesItems; if (!f.contains(e)) { return; } a.dc.selectedSeriesItems.remove(e); } f$as(a, b) { this.f$at(a, b); let c = null; let d = null; let e = null; e = a.dw.e(); let f; let g = ((() => { let h = a.dw.f(b, false, f, false); f = h.p2; return h.ret; })()); c = f; if (g != null) { if (d == null) { d = ((() => { let $ret = new MouseButtonEventArgs(); return $ret; })()); } g.ba.a$ad(g, b, c, d); g.ba.a$ah(g, b, c, d); } } f$au(a) { let b = null; let c = null; let d = null; d = a.dw.e(); if (d != null) { let e = new MouseEventArgs(); d.ba.a$ag(d, { $type: Point_$type, x: NaN, y: NaN }, null, e, false); } a.q7({ $type: Point_$type, x: NaN, y: NaN }, false); } f$at(a, b) { let c = null; let d = null; let e = null; e = a.dw.e(); let f; let g = ((() => { let h = a.dw.f(b, false, f, false); f = h.p2; return h.ret; })()); if (g != e) { if (e != null && e.ba.a$f) { e.ba.a$ag(e, b, null, null, false); } } c = f; if (a != null) { a.tr(b); a.o3(b, false, false, false, false); } if (g != null && !g.ba.a$f) { if (d == null) { d = ((() => { let $ret = new MouseButtonEventArgs(); return $ret; })()); } g.ba.a$af(g, b, c, d, false); } } f$a(a) { if (a.a7 != 0) { return a.a7; } let b = 1; let c = false; let d = false; for (let e = 0; e < a.b9.count; e++) { let f = a.b9._inner[e]; if (f.isStacked) { f.qh((g) => { if (g.b2 == 2) { c = true; } if (g.b2 == 1) { d = true; } return true; }); } else { if (f.b2 == 2) { c = true; } if (f.b2 == 1) { d = true; } } } if (d) { b = 1; } if (c) { b = 2; } if (c && d) { b = 3; } return b; } f$ar(a) { let b = a.yi; let c = b; let d = a.dw; let e = a.e6(); let f = a.e9; let g = a.gu; let h = a.g6; if (!e) { c = { $type: Point_$type, x: NaN, y: NaN }; } if (c.x < 0 || c.x > 1 || c.y < 0 || c.y > 1) { c = { $type: Point_$type, x: NaN, y: NaN }; } for (let i = 0; i < a.b9.count; i++) { let j = a.b9._inner[i]; j.qq(c); } a.pz(c); let k = a.dm == 0 && !a.fv && (a.ff || f) && !g && !h; let l = a.y9; let m = a.yv; if (k && !isNaN_(b.x) && !l.isEmpty) { let n = ViewportUtils.e(b.x, a.yr, l, m); d.er(n, l.top, n, l.bottom); d.eg(); d.el(n); } else { d.co(); } if (k && !isNaN_(b.y) && !l.isEmpty) { let o = ViewportUtils.i(b.y, a.yr, l, m); d.ek(l.left, o, l.right, o); d.ec(); } else { d.cj(); } } f$aj(a) { switch (a.dm) { case 0: a.dw.d8(); this.f$ar(a); a.dw.cg(); break; case 1: a.dw.ea(); a.dw.cn(); this.f$ar(a); a.dw.cf(); break; case 2: a.dw.ea(); a.dw.cn(); this.f$ar(a); a.dw.ch(); break; } } f$t(a, b) { if (b.x >= 0 && b.y >= 0 && b.x <= a.y9.width && b.y <= a.y9.height) { this.an(a, b); } else { a.pk(); } } an(a, b) { let c = a.dw; let d = a.y9; if (a.fw || a.fv) { return; } if (a.e9 && a.ff) { let e = d.height > d.width; c.by(e); for (let f of fromEnum(a.b9)) { if (f.isStacked) { f.qh((g) => { if (g._visibility == 0) { g.sn(b, runOn(c, c.bp)); } if (g.ei) { g.qf((h) => { if (h._visibility == 0) { h.sn(b, runOn(c, c.bp)); } return true; }); } return true; }); } else if (f.ei) { if (f._visibility == 0) { if (f._visibility == 0) { f.sn(b, runOn(c, c.bp)); } } f.qf((g) => { if (g._visibility == 0) { g.sn(b, runOn(c, c.bp)); } return true; }); } else { if (f._visibility == 0) { f.sn(b, runOn(c, c.bp)); } } } c.ed(); } } am(a, b) { if (a.ff || a.ft) { a.e9 = true; a.r0(); this.as = new Rect(0, b.x, b.y, 0, 0); this.au = new Rect(0, b.x, b.y, 0, 0); a.dm = 0; a.oz(a.yl(b)); } } f$ah(a, b) { this.am(a, b); this.an(a, b); this.f$ar(a); } f$u(a, b, c) { if (!a.e9) { this.ap(a, b, c); } } f$s(a, b) { this.at = Rect.empty; a.pk(); } f$ao(a, b) { if (this.m) { this.f$b.onScrollbarDragCancel(); this.m = false; } let c = a.dw; this.x = 1; this.ah(a); a.dm = 0; this.k = true; a.gu = true; a.r1(true, b); } ah(a) { let b = a.dw; a.e9 = false; b.cm(); b.ci(); b.ck(); a.oz({ $type: Point_$type, x: NaN, y: NaN }); b.cj(); b.co(); b.cn(); } f$ag(a, b) { this.f$ao(a, b); } f$ap(a, b, c, d, e) { this.y = b.x; this.z = b.y; this.v = c; this.w = d; this.u = e; this.ar = a.yr; this.f$ao(a, b); } f$af(a, b) { let c = a.dw; c.cj(); c.co(); if (c.aw) { this.ad(a, b); } else { this.af(a, b); this.x = b; } } f$al(a, b, c, d, e) { let f = a.dw; f.cj(); f.co(); this.v = this.v * c; this.w = this.w * d; this.u = this.u * e; if (a.f4) { this.v = this.u; this.w = this.u; } let g = a.yr; let h = a.y9; let i = b.x - this.y; let j = b.y - this.z; this.y = b.x; this.z = b.y; let k = g.width; let l = g.height; let m = this.ar.width / this.v; let n = this.ar.height / this.w; if (m > 1) { m = 1; } if (n > 1) { n = 1; } let o = { $type: Point_$type, x: b.x, y: b.y }; let p = { $type: Point_$type, x: (o.x - h.left) / h.width * g.width + g.left, y: (o.y - h.top) / h.height * g.height + g.top }; let q = new Rect(0, g.left, g.top, m, n); let r = { $type: Point_$type, x: (p.x - q.left) / q.width * h.width + h.left, y: (p.y - q.top) / q.height * h.height + h.top }; let s = (r.x - o.x) - i; let t = (r.y - o.y) - j; let u = s / h.width * q.width; let v = t / h.height * q.height; q = new Rect(0, q.left + u, q.top + v, q.width, q.height); g = q; a.ud(g, true); } f$ac(a, b) { this.as = new Rect(0, b.x, b.y, 0, 0); this.au = new Rect(0, b.x, b.y, 0, 0); } ae(a, b, c) { let d = a.yr.width; let e = a.yr.height; let f = a.yr.left + d / 2; let g = a.yr.top + e / 2; d = d / b; e = e / b; let h = f - d / 2; let i = g - e / 2; a.ud(new Rect(0, h, i, d, e), true); } f$ae(a, b) { let c = a.dw; if (c.aw) { this.ad(a, b); } else { this.af(a, b); } this.as = Rect.empty; a.gu = false; } f$v(a, b) { a.gu = false; this.as = Rect.empty; a.pk(); } f$ab(a, b) { a.os(); } f$ak(a, b, c, d, e) { a.gu = false; this.as = Rect.empty; a.pk(); } ad(a, b) { let c = a.za; let d = 1 / b; let e = { $type: Point_$type, x: c.x + c.width / 2, y: c.y + c.height / 2 }; let f = { $type: Point_$type, x: c.x - e.x, y: c.y - e.y }; let g = new Rect(0, f.x * d + e.x, f.y * d + e.y, c.width * d, c.height * d); a.ud(g, true); } af(a, b) { let c = a.y9; let d = a.za; let e = b - this.x; if (e != 0) { let f = 0.03; let g = e < 0 ? 1 + f : 1 - f; let h = { $type: Point_$type, x: d.x + d.width / 2, y: d.y + d.height / 2 }; let i = { $type: Point_$type, x: d.x - h.x, y: d.y - h.y }; let j = new Rect(0, i.x * g + h.x, i.y * g + h.y, d.width * g, d.height * g); a.ud(j, true); } } f$q(a, b, c) { if (!this.p(a, b, true)) { return; } if (!a.gu) { this.k = false; } let d = false; if (a.fa) { if (this.f$b.shouldHandleInteraction(b, c)) { this.m = true; d = true; this.ah(a); a.dw.du(); return; } } this.ap(a, b, c); a.rc(b, c); } ap(a, b, c) { let d; let e = a.dw; if (a.dj != 0) { d = a.dj; } else if (e.e2 == 0) { let f = a.dk(c); switch (f) { case 1: d = a.gf() ? f : 0; break; default: d = f; break; } } else { if (e.e2 == a.xo) { d = 1; } else if (e.e2 == a.xp) { d = 2; } else if (e.e2 == a.xq) { d = 3; } else { d = 0; } } switch (d) { case 1: case 2: case 3: a.dw.cd(); a.dw.du(); break; } a.dm = d; switch (a.dm) { case 1: this.as = new Rect(0, b.x, b.y, 0, 0); this.au = new Rect(0, b.x, b.y, 0, 0); this.at = new Rect(0, b.x, b.y, 0, 0); e.eb(); e.ej(this.as); a.r6(Rect.empty, true); break; case 2: this.as = new Rect(0, b.x, b.y, 0, 0); this.at = new Rect(0, b.x, b.y, 0, 0); break; case 3: this.as = new Rect(0, b.x, b.y, 0, 0); this.au = new Rect(0, b.x, b.y, 0, 0); this.at = new Rect(0, b.x, b.y, 0, 0); e.eb(); e.ej(this.as); a.r6(Rect.empty, true); break; } this.av = a.yr; a.zb = a.yr; } f$an(a) { a.tw(); a.dw.dp(); } f$am(a) { a.o4(); a.dw.dn(); } f$av(a) { if (a.e5 && !this.q) { this.q = true; this.ao(a); } } f$n(a) { if (this.q) { this.ag(a); this.q = false; } } f$k(a) { if (this.h == null) { return; } this.i.ab(); } get i() { return this.h; } ao(a) { if (this.h == null) { this.h = new TileZoomManager(a, true, a.j4); this.h.h = !a.gv; } a.fr = true; a.r5(); this.h.al(); a.dw.bu(); a.dw.bv(); } ag(a) { if (this.h == null) { return; } a.fr = false; a.dw.dj(); this.h.ah(); a.s5(); a.dw.b1(); } f$m(a) { a.ox(); a.s7(); } s(a) { return a.dm == 2; } t(a, b) { return a.c9 == 1 || b || a.e5; } r(a) { return a.dm == 1; } f$p(a, b, c) { let d = a.dw; if (this.m) { a.br.onScrollbarDrag(b, c); return; } if (this.as.isEmpty && c) { this.ap(a, b, c); } let e = 2; if (c) { e = 10; } let f = false; let g = false; let h = new Rect(2, { $type: Point_$type, x: this.as.x, y: this.as.y }, b); let i = new Rect(0, 0, 0, 0, 0); if (!this.at.isEmpty) { i = new Rect(2, { $type: Point_$type, x: this.at.x, y: this.at.y }, b); } if (i.width > e || i.height > e) { g = true; } if (i.width > e && i.height > e) { f = true; } if (!a.gu) { if (f) { this.k = false; } } if (!a.gu && (a.e9 || !c)) { a.oz(a.yl(b)); } if (a.dm == 3) { if (f) { let j = a.y7(h); a.r6(j, true); } else { a.r6(Rect.empty, true); } a.qb(g, b); d.ej(h); } if (this.r(a)) { if (f) { let k = a.y7(h); a.r6(k, true); } else { a.r6(Rect.empty, true); } a.qd(g, b); d.ej(h); } let l = a.y9; let m = a.yr; if (this.s(a)) { let n = l; let o = m.left + m.width * (this.as.x - b.x) / n.width; let p = m.top + m.height * (this.as.y - b.y) / n.height; let q = new Rect(0, o, p, m.width, m.height); if (this.t(a, c)) { if (i.width != 0 || i.height != 0) { a.r1(g, b); } a.r6(Rect.empty, true); let r = a.yr; a.ud(q, true); let s = a.yr; if (r.equals1(s) && a.dw.k.ac) { a.dw.k.av(); } this.as = new Rect(3, b, new Size(1, 0, 0)); this.au = new Rect(3, b, new Size(1, 0, 0)); } else { a.r6(q, true); } } this.au = new Rect(3, b, new Size(1, 0, 0)); d.bx(b); } f$o(a, b, c, d) { let e = a.dw; let f = 2; if (c) { f = 10; } let g = a.y9; let h = a.yr; if (!d) { if (this.m) { this.f$b.onScrollbarDragComplete(b, c); this.m = false; e.bz(); return; } } if (!this.k) { let i = false; let j = new Rect(2, { $type: Point_$type, x: this.as.x, y: this.as.y }, b); if (j.width > f && j.height > f) { i = true; } if (a.dm == 3 && i) { let k = a.gr(j); if (!k) { a.ol(j); } e.ci(); } if (a.dm == 1) { a.qc(); e.ci(); if (i) { a.ud(a.y7(j), true); } } if (a.dm == 2) { let l = g; let m = h.left + h.width * (this.as.x - b.x) / l.width; let n = h.top + h.height * (this.as.y - b.y) / l.height; a.ud(new Rect(0, m, n, h.width, h.height), true); } } let o = false; let p = new Rect(2, { $type: Point_$type, x: this.at.x, y: this.at.y }, b); if (p.width > f || p.height > f) { o = true; } if (o) { a.g6 = true; } a.dm = 0; a.r6(Rect.empty, true); e.bz(); a.g6 = false; e.cj(); e.co(); if (c) { e.cn(); e.cj(); e.co(); e.ck(); } a.pk(); a.r0(); a.rd(b, c, d); } f$ai(a) { if (this.i != null) { this.i.h = !a.gv; } } f$g(a, b) { let c = a.dw; let d = a.yr; if (a.dm == 2 && b == 8) { c.bw(); a.dm = 0; a.r0(); a.r6(Rect.empty, true); if (a.c9 == 1) { a.ud(this.av, true); } return true; } if (a.dm == 1 && b == 8) { c.bw(); a.dm = 0; a.r0(); c.ci(); a.r6(Rect.empty, true); return true; } let e = Rect.empty; let f = false; switch (b) { case 13: f = true; e = new Rect(0, 0, 0, 1, 1); break; case 11: f = true; e = new Rect(0, d.left - 0.1 * d.width, d.top - 0.1 * d.height, 1.2 * d.width, 1.2 * d.height); break; case 10: f = true; e = new Rect(0, d.left + 0.1 * d.width, d.top + 0.1 * d.height, 0.8 * d.width, 0.8 * d.height); break; case 14: if (c.e2 == 2) { f = true; this.ai(a); } else { f = true; e = new Rect(0, d.left - 0.1 * d.width, d.top, d.width, d.height); e.x = e.x - Math.min(e.left, 0); } break; case 16: if (c.e2 == 2) { f = true; this.al(a); } else { f = true; e = new Rect(0, d.left + 0.1 * d.width, d.top, d.width, d.height); e.x = e.x - Math.max(e.right - 1, 0); } break; case 9: if (a.focusedSeriesItems.count > 0) { f = true; for (let g of fromEnum(a.focusedSeriesItems)) { a.ri(g.series, g.item); } } break; case 15: if (c.e2 == 2) { f = true; this.ak(a); } else { f = true; e = new Rect(0, d.left, d.top - 0.1 * d.height, d.width, d.height); e.y = e.y - Math.min(e.top, 0); } break; case 17: if (c.e2 == 2) { f = true; this.aj(a); } else { f = true; e = new Rect(0, d.left, d.top + 0.1 * d.height, d.width, d.height); e.y = e.y - Math.max(e.bottom - 1, 0); } break; } if (!e.isEmpty && Rect.l_op_Inequality(e, d)) { a.ud(e, true); } return f; } al(a) { let b = null; if (a.focusedSeriesItems.count > 0) { b = a.focusedSeriesItems._inner[0]; } let c = null; if (b != null) { c = b.series; } if (c == null) { if (a.b9.count == 0) { return; } c = a.b9._inner[0]; } if (c != null && c.dp != null) { if (b == null) { let d = ((() => { let $ret = new ChartSelection(); $ret.series = c; $ret.item = c.dp.item(0); return $ret; })()); a.focusedSeriesItems.clear(); a.focusedSeriesItems.add(d); return; } let e = c.dp.indexOf(b.item); if (e == -1) { return; } e++; if (e > c.dp.count - 1) { return; } let f = ((() => { let $ret = new ChartSelection(); $ret.series = c; $ret.item = c.dp.item(e); return $ret; })()); a.focusedSeriesItems.clear(); a.focusedSeriesItems.add(f); } } ai(a) { let b = null; if (a.focusedSeriesItems.count > 0) { b = a.focusedSeriesItems._inner[0]; } let c = null; if (b != null) { c = b.series; } if (c == null) { if (a.b9.count == 0) { return; } c = a.b9._inner[0]; } if (c != null && c.dp != null) { if (b == null) { let d = ((() => { let $ret = new ChartSelection(); $ret.series = c; $ret.item = c.dp.item(0); return $ret; })()); a.focusedSeriesItems.clear(); a.focusedSeriesItems.add(d); return; } let e = c.dp.indexOf(b.item); if (e == -1) { return; } e--; if (e < 0) { return; } let f = ((() => { let $ret = new ChartSelection(); $ret.series = c; $ret.item = c.dp.item(e); return $ret; })()); a.focusedSeriesItems.clear(); a.focusedSeriesItems.add(f); } } ak(a) { let b = null; if (a.focusedSeriesItems.count > 0) { b = a.focusedSeriesItems._inner[0]; } let c = null; if (b != null) { c = b.series; } if (c == null) { if (a.b9.count == 0) { return; } c = a.b9._inner[0]; } if (c != null) { let d = a.b9.indexOf(c); if (d == -1) { return; } let e = 0; if (b != null && b.item != null && c.dp != null) { e = c.dp.indexOf(b.item); if (e == -1) { e = 0; } } d--; if (d < 0) { return; } c = a.b9._inner[d]; if (c.dp == null) { let f = ((() => { let $ret = new ChartSelection(); $ret.series = c; $ret.item = null; return $ret; })()); a.focusedSeriesItems.clear(); a.focusedSeriesItems.add(f); return; } if (e > c.dp.count - 1) { e = 0; } let g = ((() => { let $ret = new ChartSelection(); $ret.series = c; $ret.item = c.dp.item(e); return $ret; })()); a.focusedSeriesItems.clear(); a.focusedSeriesItems.add(g); } } aj(a) { let b = null; if (a.focusedSeriesItems.count > 0) { b = a.focusedSeriesItems._inner[0]; } let c = null; if (b != null) { c = b.series; } if (c == null) { if (a.b9.count == 0) { return; } c = a.b9._inner[0]; } if (c != null) { let d = a.b9.indexOf(c); if (d == -1) { return; } let e = 0; if (b != null && b.item != null && c.dp != null) { e = c.dp.indexOf(b.item); if (e == -1) { e = 0; } } d++; if (d > a.b9.count - 1) { return; } c = a.b9._inner[d]; if (c.dp == null) { let f = ((() => { let $ret = new ChartSelection(); $ret.series = c; $ret.item = null; return $ret; })()); a.focusedSeriesItems.clear(); a.focusedSeriesItems.add(f); return; } if (e > c.dp.count - 1) { e = 0; } let g = ((() => { let $ret = new ChartSelection(); $ret.series = c; $ret.item = c.dp.item(e); return $ret; })()); a.focusedSeriesItems.clear(); a.focusedSeriesItems.add(g); } } f$h(a, b, c) { let d = a.dw; let e = a.yr; let f = e.left + e.width * b.x / a.y9.width; let g = e.top + e.height * b.y / a.y9.height; let h = 1 - MathUtil.e(c, -0.5, 0.5); let i = Math.max(0, f - h * (f - e.left)); let j = Math.min(1, g + h * (e.bottom - g)); let k = Math.min(1, f + h * (e.right - f)); let l = Math.max(0, g - h * (g - e.top)); a.r1(true, b); this.ac(a, 1000); a.ud(new Rect(0, i, l, k - i, j - l), true); return a.gf(); } ac(a, b) { a.dw.b2(b); } f$r(a, b) { let c = a.yr; let d = c.left + c.width * b.x / a.y9.width; let e = c.top + c.height * b.y / a.y9.height; let f = 0.7; let g = Math.max(0, d - f * (d - c.left)); let h = Math.min(1, e + f * (c.bottom - e)); let i = Math.min(1, d + f * (c.right - d)); let j = Math.max(0, e - f * (e - c.top)); a.ud(new Rect(0, g, j, i - g, h - j), true); } f$l(a) { this.i.ac(); } p(a, b, c) { let d = b.x; let e = b.y; if (c) { d += a.y9.left; e += a.y9.top; } return d >= a.y9.left && e >= a.y9.top && d <= a.y9.left + a.y9.width && e <= a.y9.top + a.y9.height; } f$c(a, b, c, d, e, f, g) { let h = true; let i = false; let j = false; let k = a; if (k.a6 == 1) { h = false; i = true; } if (k.a6 == 3 || k.a6 == 4) { i = true; } if (k.a6 == 4) { j = true; } let l = truncate(Math.round(d.x)); let m = truncate(Math.round(d.y)); f = null; let n = -1; if (h && c != null) { let o = l; let p = m; if (a.ij != 1) { o = truncate(Math.round(d.x * a.ij)); p = truncate(Math.round(d.y * a.ij)); } let q = c.a(o, p); if (q == null || q.length == 0) { f = null; return { ret: null, p5: f }; } if ((q[0] > 0 || q[1] > 0 || q[2] > 0) && q[3] == 255) { let num2_ = q[2]; if (num2_ % 4 != 0) { num2_ = num2_ + (4 - (num2_ % 4)); } let num1_ = q[1]; if (num1_ % 4 != 0) { num1_ = num1_ + (4 - (num1_ % 4)); } let num0_ = q[0]; if (num0_ % 4 != 0) { num0_ = num0_ + (4 - (num0_ % 4)); } let num_ = 0; num_ = (num2_ >> 2); num_ = (num_ << 6); num_ = (num_ | (num1_ >> 2)); num_ = (num_ << 6); num_ = (num_ | (num0_ >> 2)); n = truncate(Math.floor((intDivide(num_, 1000)))); n--; } } let r = null; let s = -1; if (n >= 0) { let t = false; let u = 0; for (let v of fromEnum(b)) { if (!v.ge) { continue; } if (t) { break; } if (v.isStacked) { v.qh((w) => { if (w.kp == n) { r = w; s = u; t = true; return false; } return true; }); } else if (v.kp == n) { r = v; s = u; break; } u++; } } let w = null; if (i) { let x = false; for (let y = b.count - 1; y >= 0; y--) { let z = b._inner[y]; if (!z.ge) { continue; } let aa = z.cw; if (!z.hk(aa.b9, aa.ca, aa)) { continue; } if (!x && y < s && h && !j) { if (r != null) { w = r; x = true; break; } } if (z != null && z.b2 == 1) { if (z.g2(d, g)) { w = z; break; } } } if (h && !x) { if (r != null) { w = r; x = true; } } } else { w = r; } if (w != null) { let ab = w.a2({ $type: Point_$type, x: l, y: m }, g); if (ab != null) { f = ab; } return { ret: w, p5: f }; } return { ret: null, p5: f }; } f$i(a, b) { if (PointUtil.equals(b, null)) { return false; } if (this.m) { return true; } if (this.p(a, b, false)) { let c = a.dp; if (c != null && c.viewShouldInteract(b)) { return false; } return true; } return this.o(a, b); } o(a, b) { return a.f7(b); } b(a) { if (a != null) { return a.bq(); } else { return null; } } f$z(a, b, c, d, e, f) { a.o3(d, f, false, false, false); if (!this.p(a, d, false)) { if (this.l) { this.l = false; this.f$y(a, d); } return; } this.l = true; if (!f && a.e4) { this.aq(a, false); } let g = new MouseEventArgs(); g.position = d; if (a.dm == 2 || a.dm == 1 || a.gu || (a.dp != null && a.dp.isPinching)) { if (!a.fk && this.c != null) { this.c.ba.a$ag(this.c, g.position, this.a, g, f); this.c = null; } return; } let h = null; let i = ((() => { let j = this.f$c(a, b, c, d, !e, h, f); h = j.p5; return j.ret; })()); this.a = h; let j = this.b(i); if (i != null) { let k = false; let l = false; if (this.c != i) { l = true; } if (this.c == null || l) { k = true; } if (k) { if (l) { if (this.c != null) { j = this.b(this.c); this.c.ba.a$ag(this.c, g.position, h, g, f); if (j != null) { j.ba.a$ag(j, g.position, h, g, f); } } } this.c = i; j = this.b(this.c); i.ra(g.position, h, g, f); if (j != null) { j.ra(g.position, h, g, f); } } else { this.c = i; j = this.b(this.c); i.ba.a$ai(i, g.position, h, g, f); if (j != null) { j.ba.a$ai(j, g.position, h, g, f); } } } else { if (this.c != null) { j = this.b(this.c); this.c.ba.a$ag(this.c, g.position, h, g, f); if (j != null) { j.ba.a$ag(j, g.position, h, g, f); } this.c = null; } for (let m = 0; m < a.b9.count; m++) { let n = a.b9._inner[m]; if (n.ba.a$c) { j = this.b(n); n.ba.a$ag(n, g.position, n.ba.a$t, g, f); if (j != null) { j.ba.a$ag(j, g.position, n.ba.a$t, g, f); } } } } } f$y(a, b) { if (this.c != null) { let c = this.b(this.c); let d = new MouseEventArgs(); d.position = b; this.c.ba.a$ag(this.c, d.position, null, d, false); if (c != null) { c.ba.a$ag(c, d.position, null, d, false); } this.c = null; } a.q7(b, a.dm != 0 || a.gk); a.o3(b, false, false, false, false); } f$x(a, b, c) { if (this.c != null) { let d = new MouseButtonEventArgs(); d.position = c; if (b.al) { this.c.ba.a$aj(this.c, d.position, this.a, d); } else { this.c.ba.a$ad(this.c, d.position, this.a, d); } } a.o3(c, false, true, false, false); } f$aa(a, b, c) { let d; let e = (this.c != null) ? this.c : ((() => { let f = a.dw.f(c, false, d, false); d = f.p2; return f.ret; })()); if (e != null) { let f = new MouseButtonEventArgs(); f.position = c; if (b.al) { e.ba.a$ak(e, f.position, this.a, f); } else { e.ba.a$ah(e, f.position, this.a, f); } } a.o3(c, false, false, true, false); } f$w(a, b, c) { if (!this.p(a, b, false)) { return; } if (!c && a.gm) { this.aq(a, false); } if (c && !a.gm) { this.aq(a, true); } a.qi(b, c); } aq(a, b) { if (a != null) { if (!this.n) { a.e4 = b; } } } f$ad(a, b) { this.j = true; } get n() { return this.j; } } SeriesViewerInteractionManager.$t = /*@__PURE__*/ markType(SeriesViewerInteractionManager, 'SeriesViewerInteractionManager', Base.$, [ISeriesViewerInteractionManager_$type]); return SeriesViewerInteractionManager; })();