@alphacharts/drawings 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -303,13 +303,13 @@ function S(e, r) {
303
303
  }
304
304
  return a;
305
305
  }
306
- var se = /* @__PURE__ */ new Map();
307
- function ce(e, t) {
308
- let n = t ?? e.fontSize, r = `${e.italic ? "i" : ""}${e.bold ? "b" : ""}${n}`, i = se.get(r);
309
- return i === void 0 && (se.size > 512 && se.clear(), i = `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${n}px system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif`, se.set(r, i)), i;
306
+ var C = /* @__PURE__ */ new Map();
307
+ function se(e, t) {
308
+ let n = t ?? e.fontSize, r = `${e.italic ? "i" : ""}${e.bold ? "b" : ""}${n}`, i = C.get(r);
309
+ return i === void 0 && (C.size > 512 && C.clear(), i = `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${n}px system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif`, C.set(r, i)), i;
310
310
  }
311
- function le(e, t, n) {
312
- let r = e.size ?? t.fontSize, i = e.pad ?? (e.bg || e.border ? 4 : 0), a = ce(t, r), o, s;
311
+ function ce(e, t, n) {
312
+ let r = e.size ?? t.fontSize, i = e.pad ?? (e.bg || e.border ? 4 : 0), a = se(t, r), o, s;
313
313
  if (e.text.indexOf("\n") < 0) o = n(e.text, a) + 2 * i, s = 1;
314
314
  else {
315
315
  let t = e.text.split("\n");
@@ -323,6 +323,25 @@ function le(e, t, n) {
323
323
  h: c
324
324
  };
325
325
  }
326
+ function le(e, t) {
327
+ let n = [], r = e.map((e) => ({
328
+ it: e,
329
+ b: ce(e.s, e.style, t)
330
+ })).sort((e, t) => e.b.y - t.b.y);
331
+ for (let { it: e, b: t } of r) {
332
+ let r = t.y;
333
+ for (let e = !0, i = 0; e && i < 64; i++) {
334
+ e = !1;
335
+ for (let i of n) t.x < i.x + i.w && i.x < t.x + t.w && r < i.y + i.h && i.y < r + t.h && (r = i.y + i.h + 1, e = !0);
336
+ }
337
+ r !== t.y && (e.s.y += r - t.y), n.push({
338
+ x: t.x,
339
+ y: r,
340
+ w: t.w,
341
+ h: t.h
342
+ });
343
+ }
344
+ }
326
345
  var ue = /* @__PURE__ */ new Map(), de = 0;
327
346
  function fe(e, t, n) {
328
347
  let r = ue.get(n);
@@ -330,7 +349,7 @@ function fe(e, t, n) {
330
349
  let i = r.get(t);
331
350
  return i === void 0 && (de > 4096 && (ue.clear(), de = 0, ue.set(n, r = /* @__PURE__ */ new Map())), e.font = n, r.set(t, i = e.measureText(t).width), de++), i;
332
351
  }
333
- function C(e, t, n, r, i, a, o) {
352
+ function w(e, t, n, r, i, a, o) {
334
353
  return n < -o || e > i + o || r < -o || t > a + o;
335
354
  }
336
355
  function pe(e, t, n, r, i, a = {}) {
@@ -363,7 +382,7 @@ function pe(e, t, n, r, i, a = {}) {
363
382
  let t = a.pts[e], n = a.pts[e + 1];
364
383
  t < o && (o = t), t > c && (c = t), n < s && (s = n), n > l && (l = n);
365
384
  }
366
- if (C(o, s, c, l, r, i, t)) break;
385
+ if (w(o, s, c, l, r, i, t)) break;
367
386
  e.beginPath(), e.moveTo(a.pts[0], a.pts[1]);
368
387
  for (let t = 1; t < n; t++) e.lineTo(a.pts[2 * t], a.pts[2 * t + 1]);
369
388
  a.close && e.closePath(), a.fill && (p(a.fill), e.fill()), f(a) && e.stroke();
@@ -371,18 +390,18 @@ function pe(e, t, n, r, i, a = {}) {
371
390
  }
372
391
  case "ellipse": {
373
392
  let n = Math.max(Math.abs(a.rx), Math.abs(a.ry));
374
- if (C(a.cx - n, a.cy - n, a.cx + n, a.cy + n, r, i, t)) break;
393
+ if (w(a.cx - n, a.cy - n, a.cx + n, a.cy + n, r, i, t)) break;
375
394
  e.beginPath(), e.ellipse(a.cx, a.cy, Math.max(0, a.rx), Math.max(0, a.ry), a.rot ?? 0, 0, Math.PI * 2), a.fill && (p(a.fill), e.fill()), f(a) && e.stroke();
376
395
  break;
377
396
  }
378
397
  case "arc":
379
- if (C(a.cx - Math.abs(a.r), a.cy - Math.abs(a.r), a.cx + Math.abs(a.r), a.cy + Math.abs(a.r), r, i, t)) break;
398
+ if (w(a.cx - Math.abs(a.r), a.cy - Math.abs(a.r), a.cx + Math.abs(a.r), a.cy + Math.abs(a.r), r, i, t)) break;
380
399
  e.beginPath(), a.fill && e.moveTo(a.cx, a.cy), e.arc(a.cx, a.cy, Math.max(0, a.r), a.a0, a.a1, a.a1 < a.a0), a.fill && (e.closePath(), p(a.fill), e.fill()), f(a) && e.stroke();
381
400
  break;
382
401
  case "text": {
383
- let t = a.size ?? n.fontSize, o = le(a, n, (t, n) => fe(e, t, n));
384
- if (C(o.x, o.y, o.x + o.w, o.y + o.h, r, i, 2)) break;
385
- e.font = ce(n, t), a.bg && (p(a.bg), e.fillRect(o.x, o.y, o.w, o.h)), a.border && (e.strokeStyle = s = a.border, e.lineWidth = u = 1, e.setLineDash([]), d = "", e.strokeRect(o.x + .5, o.y + .5, o.w - 1, o.h - 1)), p(a.textColor ?? n.textColor), e.textAlign = "left", e.textBaseline = "top";
402
+ let t = a.size ?? n.fontSize, o = ce(a, n, (t, n) => fe(e, t, n));
403
+ if (w(o.x, o.y, o.x + o.w, o.y + o.h, r, i, 2)) break;
404
+ e.font = se(n, t), a.bg && (p(a.bg), e.fillRect(o.x, o.y, o.w, o.h)), a.border && (e.strokeStyle = s = a.border, e.lineWidth = u = 1, e.setLineDash([]), d = "", e.strokeRect(o.x + .5, o.y + .5, o.w - 1, o.h - 1)), p(a.textColor ?? n.textColor), e.textAlign = "left", e.textBaseline = "top";
386
405
  let c = a.pad ?? (a.bg || a.border ? 4 : 0);
387
406
  a.text.indexOf("\n") < 0 ? e.fillText(a.text, o.x + c, o.y + c + t * .125) : a.text.split("\n").forEach((n, r) => e.fillText(n, o.x + c, o.y + c + r * t * 1.25 + t * .125));
388
407
  break;
@@ -429,7 +448,7 @@ function me(e, t, n) {
429
448
  function he(e, t, n, r, i, a, o) {
430
449
  if (e.hit === !1) return Infinity;
431
450
  if (e.k === "text") {
432
- let r = le(e, a, o), i = Math.max(r.x - t, 0, t - (r.x + r.w)), s = Math.max(r.y - n, 0, n - (r.y + r.h));
451
+ let r = ce(e, a, o), i = Math.max(r.x - t, 0, t - (r.x + r.w)), s = Math.max(r.y - n, 0, n - (r.y + r.h));
433
452
  return Math.hypot(i, s);
434
453
  }
435
454
  if (e.k === "line") {
@@ -506,7 +525,7 @@ var ve = class {
506
525
  let n = await this.favourites(), r = t ? n.includes(e) ? n : [...n, e] : n.filter((t) => t !== e);
507
526
  return await this.store.save(`${this.prefix}favourites`, r), r;
508
527
  }
509
- }, ye = {
528
+ }, T = {
510
529
  color: "#2962ff",
511
530
  width: 1.5,
512
531
  dash: "solid",
@@ -518,11 +537,11 @@ var ve = class {
518
537
  text: "",
519
538
  extendLeft: !1,
520
539
  extendRight: !1
521
- }, be = 1, xe = 4, Se = {
540
+ }, ye = 1, be = 4, xe = {
522
541
  mouse: 5,
523
542
  pen: 8,
524
543
  touch: 14
525
- }, Ce = 16, we = 5, Te = class {
544
+ }, Se = 16, Ce = 5, we = class {
526
545
  options;
527
546
  id;
528
547
  events = new a();
@@ -625,7 +644,7 @@ var ve = class {
625
644
  price: e.price
626
645
  })),
627
646
  style: {
628
- ...ye,
647
+ ...T,
629
648
  ...i.style,
630
649
  ...e.style
631
650
  },
@@ -648,7 +667,7 @@ var ve = class {
648
667
  e.anchors.forEach((t, n) => {
649
668
  if (typeof t?.time != "number" || typeof t?.price != "number" || !Number.isFinite(t.time) || !Number.isFinite(t.price)) throw TypeError(`drawings: ${e.tool} "${e.id}" anchor ${n} must be {time, price} with finite numbers`);
650
669
  });
651
- for (let t of Object.keys(ye)) if (typeof e.style?.[t] != typeof ye[t] && (t !== "fill" || e.style?.fill !== null && typeof e.style?.fill != "string")) throw TypeError(`drawings: ${e.tool} "${e.id}" style.${t} has the wrong type`);
670
+ for (let t of Object.keys(T)) if (typeof e.style?.[t] != typeof T[t] && (t !== "fill" || e.style?.fill !== null && typeof e.style?.fill != "string")) throw TypeError(`drawings: ${e.tool} "${e.id}" style.${t} has the wrong type`);
652
671
  if (e.intervals !== null && (!Array.isArray(e.intervals) || e.intervals.some((e) => !(e > 0)))) throw TypeError(`drawings: ${e.tool} "${e.id}" intervals must be null or positive numbers`);
653
672
  if (t.needsSource && !this.source) throw Error(`drawings: ${e.tool} needs a BarSource; pass \`source\` to DrawingsPlugin`);
654
673
  if (t.screen && (typeof e.props.fx != "number" || typeof e.props.fy != "number")) throw TypeError(`drawings: ${e.tool} "${e.id}" needs numeric props fx and fy`);
@@ -736,6 +755,7 @@ var ve = class {
736
755
  this.select(this.store.list.filter((e) => !e.hidden).map((e) => e.id));
737
756
  }
738
757
  setTool(e) {
758
+ if (e !== null && this.options.readOnly) throw Error("drawings: a read-only plugin takes no tool");
739
759
  e !== null && this.toolDef(e), this.creating = null, this.tool !== e && (this.tool = e, e !== null && this.select([]), this.events.emit("tool", e), this.render());
740
760
  }
741
761
  anchorAt(e, t, n) {
@@ -918,7 +938,7 @@ var ve = class {
918
938
  }
919
939
  }
920
940
  tolerance(e) {
921
- return Se[e ?? this.last?.pointerType ?? "mouse"] ?? Se.mouse;
941
+ return xe[e ?? this.last?.pointerType ?? "mouse"] ?? xe.mouse;
922
942
  }
923
943
  hitTest(e, t, n, r = this.tolerance()) {
924
944
  if (!this.api) throw Error("drawings: the plugin is not installed on a chart");
@@ -970,23 +990,32 @@ var ve = class {
970
990
  };
971
991
  }
972
992
  drawPane(e, t) {
973
- let n = this.ctxFor(t);
974
- for (let r of this.store.list) {
975
- if (r.pane !== t.pane || !this.visible(r)) continue;
976
- let i = this.selected.has(r.id);
977
- pe(e, this.shapesOf(r, n), r.style, n.W, n.H, { widthBoost: i || r.id === this.hover ? .5 : 0 });
993
+ let n = this.ctxFor(t), r = [];
994
+ for (let e of this.store.list) e.pane === t.pane && this.visible(e) && r.push({
995
+ d: e,
996
+ shapes: this.shapesOf(e, n)
997
+ });
998
+ let i = [];
999
+ for (let { d: e, shapes: t } of r) for (let n of t) n.k === "text" && n.stack && i.push({
1000
+ s: n,
1001
+ style: e.style
1002
+ });
1003
+ i.length > 1 && le(i, this.measure);
1004
+ for (let { d: t, shapes: i } of r) {
1005
+ let r = this.selected.has(t.id);
1006
+ pe(e, i, t.style, n.W, n.H, { widthBoost: r || t.id === this.hover ? .5 : 0 });
978
1007
  }
979
1008
  for (let r of this.store.list) if (r.pane === t.pane && this.selected.has(r.id) && this.visible(r)) for (let t of this.handlePoints(r, n)) e.beginPath(), e.arc(t.x, t.y, 4, 0, Math.PI * 2), e.fillStyle = "#ffffff", e.fill(), e.lineWidth = 1.5, e.strokeStyle = r.style.color, e.stroke();
980
- let r = this.creating;
981
- if (r && r.pane === t.pane) {
982
- let t = this.previewDrawing(r);
1009
+ let a = this.creating;
1010
+ if (a && a.pane === t.pane) {
1011
+ let t = this.previewDrawing(a);
983
1012
  if (t) {
984
1013
  e.save(), pe(e, this.shapesOf(t, n), t.style, n.W, n.H), e.restore();
985
- for (let i of r.anchors) e.beginPath(), e.arc(n.X(i.time), n.Y(i.price), 3.5, 0, Math.PI * 2), e.fillStyle = t.style.color, e.fill();
1014
+ for (let r of a.anchors) e.beginPath(), e.arc(n.X(r.time), n.Y(r.price), 3.5, 0, Math.PI * 2), e.fillStyle = t.style.color, e.fill();
986
1015
  }
987
1016
  }
988
- let i = this.drag;
989
- i?.kind === "box" && i.pane === t.pane && (e.save(), e.strokeStyle = "#2962ff", e.fillStyle = "rgba(41,98,255,0.12)", e.lineWidth = 1, e.setLineDash([4, 3]), e.fillRect(Math.min(i.x0, i.x1), Math.min(i.y0, i.y1), Math.abs(i.x1 - i.x0), Math.abs(i.y1 - i.y0)), e.strokeRect(Math.min(i.x0, i.x1) + .5, Math.min(i.y0, i.y1) + .5, Math.abs(i.x1 - i.x0), Math.abs(i.y1 - i.y0)), e.restore());
1017
+ let o = this.drag;
1018
+ o?.kind === "box" && o.pane === t.pane && (e.save(), e.strokeStyle = "#2962ff", e.fillStyle = "rgba(41,98,255,0.12)", e.lineWidth = 1, e.setLineDash([4, 3]), e.fillRect(Math.min(o.x0, o.x1), Math.min(o.y0, o.y1), Math.abs(o.x1 - o.x0), Math.abs(o.y1 - o.y0)), e.strokeRect(Math.min(o.x0, o.x1) + .5, Math.min(o.y0, o.y1) + .5, Math.abs(o.x1 - o.x0), Math.abs(o.y1 - o.y0)), e.restore());
990
1019
  }
991
1020
  previewDrawing(e) {
992
1021
  let t = e.def, n = [...e.anchors];
@@ -1014,6 +1043,7 @@ var ve = class {
1014
1043
  if (t.constrain) for (let n = 0; n < e.anchors.length; n++) t.constrain(e, n);
1015
1044
  }
1016
1045
  pointer(e) {
1046
+ if (this.options.readOnly) return !1;
1017
1047
  switch (this.last = {
1018
1048
  pane: e.pane,
1019
1049
  x: e.x,
@@ -1228,6 +1258,7 @@ var ve = class {
1228
1258
  }
1229
1259
  }
1230
1260
  cursor(e, t, n) {
1261
+ if (this.options.readOnly) return null;
1231
1262
  if (this.tool || this.creating) return "crosshair";
1232
1263
  if (this.drag) return this.drag.kind === "move" ? "move" : "pointer";
1233
1264
  if (!this.api) return null;
@@ -1235,6 +1266,7 @@ var ve = class {
1235
1266
  return r ? r.handle === null ? this.store.require(r.id).locked ? "default" : "move" : "pointer" : null;
1236
1267
  }
1237
1268
  key(e) {
1269
+ if (this.options.readOnly) return !1;
1238
1270
  let t = e.metaKey || e.ctrlKey, n = e.key;
1239
1271
  if (n === "Escape") return this.drag ? (this.cancelDrag(), !0) : this.creating ? (this.cancelCreate(), !0) : this.tool ? (this.setTool(null), !0) : this.selected.size ? (this.select([]), !0) : !1;
1240
1272
  if (n === "Enter" && this.creating?.def.variable) return this.finishVariable(this.creating), !0;
@@ -1254,7 +1286,7 @@ var ve = class {
1254
1286
  else for (let t of e.before) Object.assign(this.store.require(t.id), v(t));
1255
1287
  this.render();
1256
1288
  }
1257
- }, Ee = class e {
1289
+ }, Te = class e {
1258
1290
  t = [];
1259
1291
  o = [];
1260
1292
  h = [];
@@ -1358,25 +1390,25 @@ var ve = class {
1358
1390
  };
1359
1391
  //#endregion
1360
1392
  //#region src/tools/util.ts
1361
- function w(e, t) {
1393
+ function E(e, t) {
1362
1394
  let n = e.anchors[t];
1363
1395
  if (!n) throw Error(`drawings: ${e.tool} "${e.id}" has no anchor ${t} (has ${e.anchors.length})`);
1364
1396
  return n;
1365
1397
  }
1366
- var T = (e, t) => ({
1398
+ var D = (e, t) => ({
1367
1399
  x: e.X(t.time),
1368
1400
  y: e.Y(t.price)
1369
- }), E = (e, t) => t.anchors.map((t) => T(e, t));
1370
- function De(e, t) {
1401
+ }), O = (e, t) => t.anchors.map((t) => D(e, t));
1402
+ function Ee(e, t) {
1371
1403
  if (!(t in e.props)) throw Error(`drawings: ${e.tool} "${e.id}" is missing prop "${t}"`);
1372
1404
  return e.props[t];
1373
1405
  }
1374
- function D(e) {
1375
- let t = De(e, "levels");
1406
+ function k(e) {
1407
+ let t = Ee(e, "levels");
1376
1408
  if (!Array.isArray(t) || t.some((e) => typeof e != "number" || !Number.isFinite(e))) throw TypeError(`drawings: ${e.tool} "${e.id}" prop "levels" must be an array of finite numbers`);
1377
1409
  return t;
1378
1410
  }
1379
- function O(e, t, n = {}) {
1411
+ function A(e, t, n = {}) {
1380
1412
  return {
1381
1413
  k: "line",
1382
1414
  x1: e.x,
@@ -1386,7 +1418,7 @@ function O(e, t, n = {}) {
1386
1418
  ...n
1387
1419
  };
1388
1420
  }
1389
- function k(e, t = {}) {
1421
+ function j(e, t = {}) {
1390
1422
  let n = [];
1391
1423
  for (let t of e) n.push(t.x, t.y);
1392
1424
  return {
@@ -1395,15 +1427,15 @@ function k(e, t = {}) {
1395
1427
  ...t
1396
1428
  };
1397
1429
  }
1398
- function A(e, t) {
1399
- return k(e, {
1430
+ function M(e, t) {
1431
+ return j(e, {
1400
1432
  close: !0,
1401
1433
  fill: t,
1402
1434
  width: 0,
1403
1435
  hit: !1
1404
1436
  });
1405
1437
  }
1406
- function j(e, t, n, r = {}) {
1438
+ function N(e, t, n, r = {}) {
1407
1439
  return {
1408
1440
  k: "text",
1409
1441
  x: e,
@@ -1412,9 +1444,9 @@ function j(e, t, n, r = {}) {
1412
1444
  ...r
1413
1445
  };
1414
1446
  }
1415
- function M(e, t, n, r) {
1447
+ function P(e, t, n, r) {
1416
1448
  let i = Math.atan2(t.y - e.y, t.x - e.x), a = .45;
1417
- return k([
1449
+ return j([
1418
1450
  t,
1419
1451
  {
1420
1452
  x: t.x - n * Math.cos(i - a),
@@ -1432,21 +1464,21 @@ function M(e, t, n, r) {
1432
1464
  hit: !1
1433
1465
  });
1434
1466
  }
1435
- function Oe(e, t, n) {
1467
+ function De(e, t, n) {
1436
1468
  let r = t.x <= n.x;
1437
1469
  return {
1438
1470
  extA: r ? e.extendLeft : e.extendRight,
1439
1471
  extB: r ? e.extendRight : e.extendLeft
1440
1472
  };
1441
1473
  }
1442
- var ke = (e, t, n) => ({
1474
+ var Oe = (e, t, n) => ({
1443
1475
  x: e.x + (t.x - e.x) * n,
1444
1476
  y: e.y + (t.y - e.y) * n
1445
- }), N = (e, t) => ke(e, t, .5);
1446
- function P(e, t = .15) {
1477
+ }), F = (e, t) => Oe(e, t, .5);
1478
+ function ke(e, t = .15) {
1447
1479
  return e.fill ?? S(e.color, t);
1448
1480
  }
1449
- function F(e) {
1481
+ function I(e) {
1450
1482
  if (!Number.isFinite(e)) throw RangeError(`fmtTime: ${e}`);
1451
1483
  return new Date(e).toISOString().slice(0, 16).replace("T", " ");
1452
1484
  }
@@ -1460,7 +1492,7 @@ function Ae(e) {
1460
1492
  i ? `${i}m` : ""
1461
1493
  ].filter(Boolean).join(" ");
1462
1494
  }
1463
- function I(e, t, n) {
1495
+ function L(e, t, n) {
1464
1496
  let r = t.price - e.price;
1465
1497
  return {
1466
1498
  dPrice: r,
@@ -1478,7 +1510,7 @@ function Ne(e, t) {
1478
1510
  let n = e.pct === null ? "" : ` (${je(e.pct)}${Math.abs(e.pct).toFixed(2)}%)`, r = [`${je(e.dPrice)}${t.fmt(Math.abs(e.dPrice))}${n}`], i = [e.bars === null ? "" : `${Me(e.bars)} bars`, Ae(e.dTime)].filter(Boolean).join(", ");
1479
1511
  return r.push(i), r;
1480
1512
  }
1481
- function L(e, t) {
1513
+ function R(e, t) {
1482
1514
  return t === 0 ? null : e / t;
1483
1515
  }
1484
1516
  function Pe(e) {
@@ -1498,7 +1530,7 @@ var Fe = {
1498
1530
  "2.618": "#f23645",
1499
1531
  "3.618": "#9c27b0",
1500
1532
  "4.236": "#e91e63"
1501
- }, R = (e) => Fe[String(e)] ?? "#787b86", Ie = [
1533
+ }, z = (e) => Fe[String(e)] ?? "#787b86", Ie = [
1502
1534
  0,
1503
1535
  .236,
1504
1536
  .382,
@@ -1519,24 +1551,24 @@ var Fe = {
1519
1551
  .786,
1520
1552
  1
1521
1553
  ];
1522
- function z(e) {
1554
+ function B(e) {
1523
1555
  return e;
1524
1556
  }
1525
- function B(e, t, n) {
1526
- if (w(e, t).time === w(e, n).time) throw RangeError(`drawings: ${e.tool} "${e.id}" needs anchors ${t} and ${n} at different times`);
1557
+ function V(e, t, n) {
1558
+ if (E(e, t).time === E(e, n).time) throw RangeError(`drawings: ${e.tool} "${e.id}" needs anchors ${t} and ${n} at different times`);
1527
1559
  }
1528
- function V(e) {
1560
+ function H(e) {
1529
1561
  e.anchors.forEach((t, n) => {
1530
1562
  if (!Number.isFinite(t.time) || !Number.isFinite(t.price)) throw TypeError(`drawings: ${e.tool} "${e.id}" anchor ${n} is not finite (${t.time}, ${t.price})`);
1531
1563
  });
1532
1564
  }
1533
1565
  //#endregion
1534
1566
  //#region src/tools/annotations.ts
1535
- var H = {
1567
+ var U = {
1536
1568
  border: null,
1537
1569
  pad: 5
1538
1570
  };
1539
- function U(e, t) {
1571
+ function W(e, t) {
1540
1572
  return e.style.text || t;
1541
1573
  }
1542
1574
  function Re(e, t) {
@@ -1547,23 +1579,23 @@ function Re(e, t) {
1547
1579
  y: r * t.H
1548
1580
  };
1549
1581
  }
1550
- var ze = z({
1582
+ var ze = B({
1551
1583
  id: "text",
1552
1584
  label: "Text",
1553
1585
  family: "annotations",
1554
1586
  gesture: "single",
1555
1587
  anchors: 1,
1556
1588
  defaults: () => ({ style: { text: "Text" } }),
1557
- validate: V,
1589
+ validate: H,
1558
1590
  shapes(e, t) {
1559
- let n = T(t, w(e, 0));
1560
- return [j(n.x, n.y, U(e, "Text"), {
1591
+ let n = D(t, E(e, 0));
1592
+ return [N(n.x, n.y, W(e, "Text"), {
1561
1593
  align: "left",
1562
1594
  base: "middle",
1563
1595
  textColor: e.style.color
1564
1596
  })];
1565
1597
  }
1566
- }), Be = z({
1598
+ }), Be = B({
1567
1599
  id: "anchoredText",
1568
1600
  label: "Anchored text",
1569
1601
  family: "annotations",
@@ -1579,7 +1611,7 @@ var ze = z({
1579
1611
  }),
1580
1612
  shapes(e, t) {
1581
1613
  let n = Re(e, t);
1582
- return [j(n.x, n.y, U(e, "Text"), {
1614
+ return [N(n.x, n.y, W(e, "Text"), {
1583
1615
  align: "left",
1584
1616
  base: "middle",
1585
1617
  textColor: e.style.color
@@ -1588,7 +1620,7 @@ var ze = z({
1588
1620
  });
1589
1621
  function Ve(e, t) {
1590
1622
  return [
1591
- O(t, {
1623
+ A(t, {
1592
1624
  x: t.x + 14,
1593
1625
  y: t.y - 14
1594
1626
  }, { width: 1 }),
@@ -1601,25 +1633,25 @@ function Ve(e, t) {
1601
1633
  fill: e.style.color,
1602
1634
  width: 1
1603
1635
  },
1604
- j(t.x + 14, t.y - 14, U(e, "Note"), {
1636
+ N(t.x + 14, t.y - 14, W(e, "Note"), {
1605
1637
  align: "left",
1606
1638
  base: "bottom",
1607
1639
  bg: S(e.style.color, .9),
1608
1640
  textColor: "#ffffff",
1609
- ...H
1641
+ ...U
1610
1642
  })
1611
1643
  ];
1612
1644
  }
1613
- var He = z({
1645
+ var He = B({
1614
1646
  id: "note",
1615
1647
  label: "Note",
1616
1648
  family: "annotations",
1617
1649
  gesture: "single",
1618
1650
  anchors: 1,
1619
1651
  defaults: () => ({ style: { text: "Note" } }),
1620
- validate: V,
1621
- shapes: (e, t) => Ve(e, T(t, w(e, 0)))
1622
- }), Ue = z({
1652
+ validate: H,
1653
+ shapes: (e, t) => Ve(e, D(t, E(e, 0)))
1654
+ }), Ue = B({
1623
1655
  id: "anchoredNote",
1624
1656
  label: "Anchored note",
1625
1657
  family: "annotations",
@@ -1634,18 +1666,18 @@ var He = z({
1634
1666
  }
1635
1667
  }),
1636
1668
  shapes: (e, t) => Ve(e, Re(e, t))
1637
- }), We = z({
1669
+ }), We = B({
1638
1670
  id: "callout",
1639
1671
  label: "Callout",
1640
1672
  family: "annotations",
1641
1673
  gesture: "drag",
1642
1674
  anchors: 2,
1643
1675
  defaults: () => ({ style: { text: "Callout" } }),
1644
- validate: V,
1676
+ validate: H,
1645
1677
  shapes(e, t) {
1646
- let [n, r] = E(t, e);
1678
+ let [n, r] = O(t, e);
1647
1679
  return [
1648
- O(r, n, { width: 1 }),
1680
+ A(r, n, { width: 1 }),
1649
1681
  {
1650
1682
  k: "ellipse",
1651
1683
  cx: n.x,
@@ -1655,26 +1687,26 @@ var He = z({
1655
1687
  fill: e.style.color,
1656
1688
  width: 1
1657
1689
  },
1658
- j(r.x, r.y, U(e, "Callout"), {
1690
+ N(r.x, r.y, W(e, "Callout"), {
1659
1691
  align: "center",
1660
1692
  base: "middle",
1661
1693
  bg: S(e.style.color, .9),
1662
1694
  textColor: "#ffffff",
1663
- ...H
1695
+ ...U
1664
1696
  })
1665
1697
  ];
1666
1698
  }
1667
- }), Ge = z({
1699
+ }), Ge = B({
1668
1700
  id: "comment",
1669
1701
  label: "Comment",
1670
1702
  family: "annotations",
1671
1703
  gesture: "single",
1672
1704
  anchors: 1,
1673
1705
  defaults: () => ({ style: { text: "Comment" } }),
1674
- validate: V,
1706
+ validate: H,
1675
1707
  shapes(e, t) {
1676
- let n = T(t, w(e, 0));
1677
- return [k([
1708
+ let n = D(t, E(e, 0));
1709
+ return [j([
1678
1710
  n,
1679
1711
  {
1680
1712
  x: n.x - 6,
@@ -1689,25 +1721,25 @@ var He = z({
1689
1721
  fill: S(e.style.color, .9),
1690
1722
  width: 0,
1691
1723
  hit: !1
1692
- }), j(n.x, n.y - 14, U(e, "Comment"), {
1724
+ }), N(n.x, n.y - 14, W(e, "Comment"), {
1693
1725
  align: "center",
1694
1726
  base: "bottom",
1695
1727
  bg: S(e.style.color, .9),
1696
1728
  textColor: "#ffffff",
1697
- ...H
1729
+ ...U
1698
1730
  })];
1699
1731
  }
1700
- }), Ke = z({
1732
+ }), Ke = B({
1701
1733
  id: "priceLabel",
1702
1734
  label: "Price label",
1703
1735
  family: "annotations",
1704
1736
  gesture: "single",
1705
1737
  anchors: 1,
1706
1738
  defaults: () => ({}),
1707
- validate: V,
1739
+ validate: H,
1708
1740
  shapes(e, t) {
1709
- let n = T(t, w(e, 0)), r = `${e.style.text ? e.style.text + " " : ""}${t.fmt(w(e, 0).price)}`;
1710
- return [k([
1741
+ let n = D(t, E(e, 0)), r = `${e.style.text ? e.style.text + " " : ""}${t.fmt(E(e, 0).price)}`;
1742
+ return [j([
1711
1743
  n,
1712
1744
  {
1713
1745
  x: n.x + 8,
@@ -1722,33 +1754,33 @@ var He = z({
1722
1754
  fill: e.style.color,
1723
1755
  width: 0,
1724
1756
  hit: !1
1725
- }), j(n.x + 8, n.y, r, {
1757
+ }), N(n.x + 8, n.y, r, {
1726
1758
  align: "left",
1727
1759
  base: "middle",
1728
1760
  bg: e.style.color,
1729
1761
  textColor: "#ffffff",
1730
- ...H
1762
+ ...U
1731
1763
  })];
1732
1764
  }
1733
- }), qe = z({
1765
+ }), qe = B({
1734
1766
  id: "priceNote",
1735
1767
  label: "Price note",
1736
1768
  family: "annotations",
1737
1769
  gesture: "drag",
1738
1770
  anchors: 2,
1739
1771
  defaults: () => ({}),
1740
- validate: V,
1772
+ validate: H,
1741
1773
  shapes(e, t) {
1742
- let n = T(t, w(e, 0)), r = T(t, w(e, 1)), i = `${e.style.text ? e.style.text + " " : ""}${t.fmt(w(e, 0).price)}`;
1774
+ let n = D(t, E(e, 0)), r = D(t, E(e, 1)), i = `${e.style.text ? e.style.text + " " : ""}${t.fmt(E(e, 0).price)}`;
1743
1775
  return [
1744
- O(n, {
1776
+ A(n, {
1745
1777
  x: r.x,
1746
1778
  y: n.y
1747
1779
  }, {
1748
1780
  dash: "dashed",
1749
1781
  width: 1
1750
1782
  }),
1751
- O({
1783
+ A({
1752
1784
  x: r.x,
1753
1785
  y: n.y
1754
1786
  }, r, { width: 1 }),
@@ -1761,30 +1793,30 @@ var He = z({
1761
1793
  fill: e.style.color,
1762
1794
  width: 1
1763
1795
  },
1764
- j(r.x, r.y, i, {
1796
+ N(r.x, r.y, i, {
1765
1797
  align: "center",
1766
1798
  base: "middle",
1767
1799
  bg: e.style.color,
1768
1800
  textColor: "#ffffff",
1769
- ...H
1801
+ ...U
1770
1802
  })
1771
1803
  ];
1772
1804
  }
1773
- }), Je = z({
1805
+ }), Je = B({
1774
1806
  id: "signpost",
1775
1807
  label: "Signpost",
1776
1808
  family: "annotations",
1777
1809
  gesture: "single",
1778
1810
  anchors: 1,
1779
1811
  defaults: () => ({ style: { text: "Sign" } }),
1780
- validate: V,
1812
+ validate: H,
1781
1813
  shapes(e, t) {
1782
- let n = T(t, w(e, 0)), r = {
1814
+ let n = D(t, E(e, 0)), r = {
1783
1815
  x: n.x,
1784
1816
  y: n.y - 44
1785
1817
  };
1786
1818
  return [
1787
- O(n, r),
1819
+ A(n, r),
1788
1820
  {
1789
1821
  k: "ellipse",
1790
1822
  cx: n.x,
@@ -1794,29 +1826,29 @@ var He = z({
1794
1826
  fill: e.style.color,
1795
1827
  width: 1
1796
1828
  },
1797
- j(r.x, r.y, U(e, "Sign"), {
1829
+ N(r.x, r.y, W(e, "Sign"), {
1798
1830
  align: "left",
1799
1831
  base: "bottom",
1800
1832
  bg: e.style.color,
1801
1833
  textColor: "#ffffff",
1802
- ...H
1834
+ ...U
1803
1835
  })
1804
1836
  ];
1805
1837
  }
1806
- }), Ye = z({
1838
+ }), Ye = B({
1807
1839
  id: "flagMark",
1808
1840
  label: "Flag mark",
1809
1841
  family: "annotations",
1810
1842
  gesture: "single",
1811
1843
  anchors: 1,
1812
1844
  defaults: () => ({}),
1813
- validate: V,
1845
+ validate: H,
1814
1846
  shapes(e, t) {
1815
- let n = T(t, w(e, 0));
1816
- return [O(n, {
1847
+ let n = D(t, E(e, 0));
1848
+ return [A(n, {
1817
1849
  x: n.x,
1818
1850
  y: n.y - 28
1819
- }), k([
1851
+ }), j([
1820
1852
  {
1821
1853
  x: n.x,
1822
1854
  y: n.y - 28
@@ -1834,34 +1866,34 @@ var He = z({
1834
1866
  fill: e.style.color
1835
1867
  })];
1836
1868
  }
1837
- }), Xe = z({
1869
+ }), Xe = B({
1838
1870
  id: "arrow",
1839
1871
  label: "Arrow",
1840
1872
  family: "annotations",
1841
1873
  gesture: "drag",
1842
1874
  anchors: 2,
1843
1875
  defaults: () => ({}),
1844
- validate: V,
1876
+ validate: H,
1845
1877
  shapes(e, t) {
1846
- let [n, r] = E(t, e);
1847
- return [O(n, r), M(n, r, 6 + e.style.width * 2, e.style.color)];
1878
+ let [n, r] = O(t, e);
1879
+ return [A(n, r), P(n, r, 6 + e.style.width * 2, e.style.color)];
1848
1880
  }
1849
- }), Ze = z({
1881
+ }), Ze = B({
1850
1882
  id: "arrowMarker",
1851
1883
  label: "Arrow marker",
1852
1884
  family: "annotations",
1853
1885
  gesture: "drag",
1854
1886
  anchors: 2,
1855
1887
  defaults: () => ({ style: { fill: "#2962ff" } }),
1856
- validate: V,
1888
+ validate: H,
1857
1889
  shapes(e, t) {
1858
- let [n, r] = E(t, e), i = Math.hypot(r.x - n.x, r.y - n.y);
1859
- if (i === 0) return [O(n, r)];
1890
+ let [n, r] = O(t, e), i = Math.hypot(r.x - n.x, r.y - n.y);
1891
+ if (i === 0) return [A(n, r)];
1860
1892
  let a = (r.x - n.x) / i, o = (r.y - n.y) / i, s = -o, c = a, l = Math.min(i * .45, 20), u = (e, t) => ({
1861
1893
  x: n.x + a * e + s * t,
1862
1894
  y: n.y + o * e + c * t
1863
1895
  });
1864
- return [k([
1896
+ return [j([
1865
1897
  u(0, 4),
1866
1898
  u(i - l, 4),
1867
1899
  u(i - l, 10),
@@ -1877,7 +1909,7 @@ var He = z({
1877
1909
  });
1878
1910
  function Qe(e, t, n) {
1879
1911
  let r = n ? 1 : -1;
1880
- return [k([
1912
+ return [j([
1881
1913
  t,
1882
1914
  {
1883
1915
  x: t.x - 9,
@@ -1909,24 +1941,24 @@ function Qe(e, t, n) {
1909
1941
  width: 1
1910
1942
  })];
1911
1943
  }
1912
- var $e = z({
1944
+ var $e = B({
1913
1945
  id: "arrowMarkUp",
1914
1946
  label: "Arrow mark up",
1915
1947
  family: "annotations",
1916
1948
  gesture: "single",
1917
1949
  anchors: 1,
1918
1950
  defaults: () => ({ style: { color: "#26a69a" } }),
1919
- validate: V,
1920
- shapes: (e, t) => Qe(e, T(t, w(e, 0)), !0)
1921
- }), et = z({
1951
+ validate: H,
1952
+ shapes: (e, t) => Qe(e, D(t, E(e, 0)), !0)
1953
+ }), et = B({
1922
1954
  id: "arrowMarkDown",
1923
1955
  label: "Arrow mark down",
1924
1956
  family: "annotations",
1925
1957
  gesture: "single",
1926
1958
  anchors: 1,
1927
1959
  defaults: () => ({ style: { color: "#ef5350" } }),
1928
- validate: V,
1929
- shapes: (e, t) => Qe(e, T(t, w(e, 0)), !1)
1960
+ validate: H,
1961
+ shapes: (e, t) => Qe(e, D(t, E(e, 0)), !1)
1930
1962
  }), tt = [
1931
1963
  ze,
1932
1964
  Be,
@@ -1947,7 +1979,7 @@ function rt(e, t, n, r) {
1947
1979
  let i = Math.min(t.x, n.x), a = Math.max(t.x, n.x);
1948
1980
  return [e.style.extendLeft ? -10 : i, e.style.extendRight ? r.W + 10 : a];
1949
1981
  }
1950
- var it = z({
1982
+ var it = B({
1951
1983
  id: "parallelChannel",
1952
1984
  label: "Parallel channel",
1953
1985
  family: "channels",
@@ -1958,28 +1990,28 @@ var it = z({
1958
1990
  props: { midline: !0 }
1959
1991
  }),
1960
1992
  validate(e) {
1961
- V(e), B(e, 0, 1);
1993
+ H(e), V(e, 0, 1);
1962
1994
  },
1963
1995
  shapes(e, t) {
1964
- let [n, r, i] = E(t, e), a = i.y - nt(n, r, i.x), [o, s] = rt(e, n, r, t), c = (e) => [{
1996
+ let [n, r, i] = O(t, e), a = i.y - nt(n, r, i.x), [o, s] = rt(e, n, r, t), c = (e) => [{
1965
1997
  x: o,
1966
1998
  y: nt(n, r, o) + e
1967
1999
  }, {
1968
2000
  x: s,
1969
2001
  y: nt(n, r, s) + e
1970
2002
  }], [l, u] = c(0), [d, f] = c(a), p = [
1971
- A([
2003
+ M([
1972
2004
  l,
1973
2005
  u,
1974
2006
  f,
1975
2007
  d
1976
- ], P(e.style, .12)),
1977
- O(l, u),
1978
- O(d, f)
2008
+ ], ke(e.style, .12)),
2009
+ A(l, u),
2010
+ A(d, f)
1979
2011
  ];
1980
2012
  if (e.props.midline !== !1) {
1981
2013
  let [t, n] = c(a / 2);
1982
- p.push(O(t, n, {
2014
+ p.push(A(t, n, {
1983
2015
  dash: "dashed",
1984
2016
  width: Math.max(1, e.style.width * .66)
1985
2017
  }));
@@ -2018,7 +2050,7 @@ function ot(e, t, n) {
2018
2050
  hi: i
2019
2051
  };
2020
2052
  }
2021
- var st = z({
2053
+ var st = B({
2022
2054
  id: "regressionTrendChannel",
2023
2055
  label: "Regression trend channel",
2024
2056
  family: "channels",
@@ -2027,13 +2059,13 @@ var st = z({
2027
2059
  needsSource: !0,
2028
2060
  defaults: () => ({ props: { deviations: 2 } }),
2029
2061
  validate(e) {
2030
- V(e), B(e, 0, 1);
2062
+ H(e), V(e, 0, 1);
2031
2063
  let t = e.props.deviations;
2032
2064
  if (typeof t != "number" || !(t > 0)) throw RangeError(`drawings: regressionTrendChannel "${e.id}" prop "deviations" must be > 0`);
2033
2065
  },
2034
2066
  shapes(e, t) {
2035
2067
  if (!t.source) throw Error("regressionTrendChannel needs a BarSource");
2036
- let { reg: n, lo: r, hi: i } = ot(t.source, w(e, 0).time, w(e, 1).time), a = e.props.deviations, o = t.source.at(r).time, s = t.source.at(i - 1).time, c = (e, r) => ({
2068
+ let { reg: n, lo: r, hi: i } = ot(t.source, E(e, 0).time, E(e, 1).time), a = e.props.deviations, o = t.source.at(r).time, s = t.source.at(i - 1).time, c = (e, r) => ({
2037
2069
  x: 0,
2038
2070
  y: t.Y(n.intercept + n.slope * e + r * n.sigma)
2039
2071
  }), l = t.X(o), u = t.X(s), d = (e) => [{
@@ -2044,18 +2076,18 @@ var st = z({
2044
2076
  y: c(i - r - 1, e).y
2045
2077
  }], [f, p] = d(a), [m, h] = d(0), [g, _] = d(-a);
2046
2078
  return [
2047
- A([
2079
+ M([
2048
2080
  f,
2049
2081
  p,
2050
2082
  _,
2051
2083
  g
2052
- ], P(e.style, .1)),
2053
- O(f, p),
2054
- O(g, _),
2055
- O(m, h, { dash: "dashed" })
2084
+ ], ke(e.style, .1)),
2085
+ A(f, p),
2086
+ A(g, _),
2087
+ A(m, h, { dash: "dashed" })
2056
2088
  ];
2057
2089
  }
2058
- }), ct = z({
2090
+ }), ct = B({
2059
2091
  id: "flatTopBottom",
2060
2092
  label: "Flat top/bottom",
2061
2093
  family: "channels",
@@ -2063,12 +2095,12 @@ var st = z({
2063
2095
  anchors: 3,
2064
2096
  defaults: () => ({}),
2065
2097
  validate(e) {
2066
- V(e), B(e, 0, 1);
2098
+ H(e), V(e, 0, 1);
2067
2099
  },
2068
2100
  shapes(e, t) {
2069
- let [n, r, i] = E(t, e), a = i.y;
2101
+ let [n, r, i] = O(t, e), a = i.y;
2070
2102
  return [
2071
- A([
2103
+ M([
2072
2104
  n,
2073
2105
  r,
2074
2106
  {
@@ -2079,9 +2111,9 @@ var st = z({
2079
2111
  x: n.x,
2080
2112
  y: a
2081
2113
  }
2082
- ], P(e.style, .12)),
2083
- O(n, r),
2084
- O({
2114
+ ], ke(e.style, .12)),
2115
+ A(n, r),
2116
+ A({
2085
2117
  x: n.x,
2086
2118
  y: a
2087
2119
  }, {
@@ -2090,7 +2122,7 @@ var st = z({
2090
2122
  })
2091
2123
  ];
2092
2124
  }
2093
- }), lt = z({
2125
+ }), lt = B({
2094
2126
  id: "disjointChannel",
2095
2127
  label: "Disjoint channel",
2096
2128
  family: "channels",
@@ -2098,24 +2130,24 @@ var st = z({
2098
2130
  anchors: 4,
2099
2131
  defaults: () => ({}),
2100
2132
  validate(e) {
2101
- V(e), B(e, 0, 1);
2133
+ H(e), V(e, 0, 1);
2102
2134
  },
2103
2135
  shapes(e, t) {
2104
- let [n, r, i, a] = E(t, e);
2136
+ let [n, r, i, a] = O(t, e);
2105
2137
  return [
2106
- A([
2138
+ M([
2107
2139
  n,
2108
2140
  r,
2109
2141
  a,
2110
2142
  i
2111
- ], P(e.style, .12)),
2112
- O(n, r),
2113
- O(i, a)
2143
+ ], ke(e.style, .12)),
2144
+ A(n, r),
2145
+ A(i, a)
2114
2146
  ];
2115
2147
  }
2116
2148
  });
2117
2149
  function ut(e, t, n, r) {
2118
- let i = N(n, r);
2150
+ let i = F(n, r);
2119
2151
  switch (e) {
2120
2152
  case "standard": return {
2121
2153
  origin: t,
@@ -2133,7 +2165,7 @@ function ut(e, t, n, r) {
2133
2165
  t2: r
2134
2166
  };
2135
2167
  case "modifiedSchiff": return {
2136
- origin: N(t, n),
2168
+ origin: F(t, n),
2137
2169
  m: i,
2138
2170
  t1: n,
2139
2171
  t2: r
@@ -2141,22 +2173,22 @@ function ut(e, t, n, r) {
2141
2173
  case "inside": return {
2142
2174
  origin: t,
2143
2175
  m: i,
2144
- t1: N(t, n),
2145
- t2: N(t, r)
2176
+ t1: F(t, n),
2177
+ t2: F(t, r)
2146
2178
  };
2147
2179
  }
2148
2180
  }
2149
- function W(e, t, n) {
2150
- return z({
2181
+ function G(e, t, n) {
2182
+ return B({
2151
2183
  id: e,
2152
2184
  label: t,
2153
2185
  family: "pitchforks",
2154
2186
  gesture: "clicks",
2155
2187
  anchors: 3,
2156
2188
  defaults: () => ({}),
2157
- validate: V,
2189
+ validate: H,
2158
2190
  shapes(t, r) {
2159
- let [i, a, o] = E(r, t), s = ut(n, i, a, o), c = {
2191
+ let [i, a, o] = O(r, t), s = ut(n, i, a, o), c = {
2160
2192
  x: s.m.x - s.origin.x,
2161
2193
  y: s.m.y - s.origin.y
2162
2194
  };
@@ -2172,26 +2204,26 @@ function W(e, t, n) {
2172
2204
  };
2173
2205
  }, d = u(s.origin);
2174
2206
  return [
2175
- A([
2207
+ M([
2176
2208
  s.origin,
2177
2209
  s.t1,
2178
2210
  u(s.t1),
2179
2211
  d
2180
2212
  ], S(t.style.color, .08)),
2181
- A([
2213
+ M([
2182
2214
  s.origin,
2183
2215
  s.t2,
2184
2216
  u(s.t2),
2185
2217
  d
2186
2218
  ], S(t.style.color, .08)),
2187
- O(s.origin, l(s.origin), { extB: !0 }),
2188
- O(s.t1, l(s.t1), { extB: !0 }),
2189
- O(s.t2, l(s.t2), { extB: !0 }),
2190
- O(a, o, {
2219
+ A(s.origin, l(s.origin), { extB: !0 }),
2220
+ A(s.t1, l(s.t1), { extB: !0 }),
2221
+ A(s.t2, l(s.t2), { extB: !0 }),
2222
+ A(a, o, {
2191
2223
  dash: "dashed",
2192
2224
  width: 1
2193
2225
  }),
2194
- O(i, a, {
2226
+ A(i, a, {
2195
2227
  dash: "dotted",
2196
2228
  width: 1,
2197
2229
  hit: !1
@@ -2200,21 +2232,21 @@ function W(e, t, n) {
2200
2232
  }
2201
2233
  });
2202
2234
  }
2203
- var dt = W("pitchfork", "Pitchfork", "standard"), ft = W("schiffPitchfork", "Schiff pitchfork", "schiff"), pt = W("modifiedSchiffPitchfork", "Modified Schiff pitchfork", "modifiedSchiff"), mt = W("insidePitchfork", "Inside pitchfork", "inside"), ht = z({
2235
+ var dt = G("pitchfork", "Pitchfork", "standard"), ft = G("schiffPitchfork", "Schiff pitchfork", "schiff"), pt = G("modifiedSchiffPitchfork", "Modified Schiff pitchfork", "modifiedSchiff"), mt = G("insidePitchfork", "Inside pitchfork", "inside"), ht = B({
2204
2236
  id: "pitchfan",
2205
2237
  label: "Pitchfan",
2206
2238
  family: "pitchforks",
2207
2239
  gesture: "clicks",
2208
2240
  anchors: 3,
2209
2241
  defaults: () => ({ props: { levels: Le } }),
2210
- validate: V,
2242
+ validate: H,
2211
2243
  shapes(e, t) {
2212
- let [n, r, i] = E(t, e), a = e.props.levels, o = [O(r, i, {
2244
+ let [n, r, i] = O(t, e), a = e.props.levels, o = [A(r, i, {
2213
2245
  dash: "dashed",
2214
2246
  width: 1
2215
2247
  })], s = a.map((e) => ({
2216
2248
  r: e,
2217
- p: ke(r, i, e)
2249
+ p: Oe(r, i, e)
2218
2250
  }));
2219
2251
  for (let e = 0; e + 1 < s.length; e++) {
2220
2252
  let r = s[e].p, i = s[e + 1].p, a = (e) => {
@@ -2224,18 +2256,18 @@ var dt = W("pitchfork", "Pitchfork", "standard"), ft = W("schiffPitchfork", "Sch
2224
2256
  y: n.y + i * a
2225
2257
  };
2226
2258
  };
2227
- o.push(A([
2259
+ o.push(M([
2228
2260
  n,
2229
2261
  a(r),
2230
2262
  a(i)
2231
- ], S(R(s[e].r), .07)));
2263
+ ], S(z(s[e].r), .07)));
2232
2264
  }
2233
- for (let { r: t, p: r } of s) o.push(O(n, r, {
2265
+ for (let { r: t, p: r } of s) o.push(A(n, r, {
2234
2266
  extB: !0,
2235
- color: R(t),
2267
+ color: z(t),
2236
2268
  width: t === .5 ? e.style.width : 1
2237
- }), j(r.x, r.y, String(t), {
2238
- textColor: R(t),
2269
+ }), N(r.x, r.y, String(t), {
2270
+ textColor: z(t),
2239
2271
  size: 10,
2240
2272
  hit: !1
2241
2273
  }));
@@ -2255,7 +2287,7 @@ var dt = W("pitchfork", "Pitchfork", "standard"), ft = W("schiffPitchfork", "Sch
2255
2287
  function yt(e, t) {
2256
2288
  return Math.abs(t.x - e.x);
2257
2289
  }
2258
- var bt = z({
2290
+ var bt = B({
2259
2291
  id: "cyclicLines",
2260
2292
  label: "Cyclic lines",
2261
2293
  family: "cycles",
@@ -2263,15 +2295,15 @@ var bt = z({
2263
2295
  anchors: 2,
2264
2296
  defaults: () => ({}),
2265
2297
  validate: (e) => {
2266
- V(e), B(e, 0, 1);
2298
+ H(e), V(e, 0, 1);
2267
2299
  },
2268
2300
  shapes(e, t) {
2269
- let [n, r] = E(t, e), i = yt(n, r);
2270
- if (i < vt) return [O(n, r)];
2301
+ let [n, r] = O(t, e), i = yt(n, r);
2302
+ if (i < vt) return [A(n, r)];
2271
2303
  let a = Math.ceil((-50 - n.x) / i), o = Math.floor((t.W + 50 - n.x) / i), s = [];
2272
2304
  for (let e = a; e <= o && s.length < _t; e++) {
2273
2305
  let r = n.x + e * i;
2274
- s.push(O({
2306
+ s.push(A({
2275
2307
  x: r,
2276
2308
  y: 0
2277
2309
  }, {
@@ -2284,7 +2316,7 @@ var bt = z({
2284
2316
  }
2285
2317
  return s;
2286
2318
  }
2287
- }), xt = z({
2319
+ }), xt = B({
2288
2320
  id: "timeCycles",
2289
2321
  label: "Time cycles",
2290
2322
  family: "cycles",
@@ -2292,11 +2324,11 @@ var bt = z({
2292
2324
  anchors: 2,
2293
2325
  defaults: () => ({ style: { fill: "rgba(41,98,255,0.1)" } }),
2294
2326
  validate: (e) => {
2295
- V(e), B(e, 0, 1);
2327
+ H(e), V(e, 0, 1);
2296
2328
  },
2297
2329
  shapes(e, t) {
2298
- let [n, r] = E(t, e), i = yt(n, r);
2299
- if (i < vt) return [O(n, r)];
2330
+ let [n, r] = O(t, e), i = yt(n, r);
2331
+ if (i < vt) return [A(n, r)];
2300
2332
  let a = [], o = r.x >= n.x ? 1 : -1;
2301
2333
  for (let r = 0; r < _t; r++) {
2302
2334
  let s = n.x + o * r * i;
@@ -2318,7 +2350,7 @@ function St(e, t, n, r, i) {
2318
2350
  let a = (t + r) / 2;
2319
2351
  return a + (t - a) * Math.cos(Math.PI * (i - e) / (n - e));
2320
2352
  }
2321
- var Ct = z({
2353
+ var Ct = B({
2322
2354
  id: "sineLine",
2323
2355
  label: "Sine line",
2324
2356
  family: "cycles",
@@ -2326,11 +2358,11 @@ var Ct = z({
2326
2358
  anchors: 2,
2327
2359
  defaults: () => ({}),
2328
2360
  validate: (e) => {
2329
- V(e), B(e, 0, 1);
2361
+ H(e), V(e, 0, 1);
2330
2362
  },
2331
2363
  shapes(e, t) {
2332
- let [n, r] = E(t, e);
2333
- if (Math.abs(r.x - n.x) < vt) return [O(n, r)];
2364
+ let [n, r] = O(t, e);
2365
+ if (Math.abs(r.x - n.x) < vt) return [A(n, r)];
2334
2366
  let i = [];
2335
2367
  for (let e = -4; e <= t.W + 4; e += 2) i.push(e, St(n.x, n.y, r.x, r.y, e));
2336
2368
  return [{
@@ -2354,23 +2386,23 @@ var Ct = z({
2354
2386
  34,
2355
2387
  55,
2356
2388
  89
2357
- ], Ot = (1 + Math.sqrt(5)) / 2, G = (e) => ({ props: { levels: e } }), kt = z({
2389
+ ], Ot = (1 + Math.sqrt(5)) / 2, K = (e) => ({ props: { levels: e } }), kt = B({
2358
2390
  id: "fibRetracement",
2359
2391
  label: "Fib retracement",
2360
2392
  family: "fibonacci",
2361
2393
  gesture: "drag",
2362
2394
  anchors: 2,
2363
- defaults: () => G(Ie),
2395
+ defaults: () => K(Ie),
2364
2396
  validate: (e) => {
2365
- V(e), D(e);
2397
+ H(e), k(e);
2366
2398
  },
2367
2399
  shapes(e, t) {
2368
- let n = w(e, 0), r = w(e, 1), i = T(t, n), a = T(t, r), o = Math.min(i.x, a.x), s = e.style.extendRight ? t.W + 10 : Math.max(i.x, a.x), c = [O(i, a, {
2400
+ let n = E(e, 0), r = E(e, 1), i = D(t, n), a = D(t, r), o = Math.min(i.x, a.x), s = e.style.extendRight ? t.W + 10 : Math.max(i.x, a.x), c = [A(i, a, {
2369
2401
  dash: "dashed",
2370
2402
  width: 1,
2371
2403
  color: "#787b86"
2372
- })], l = D(e), u = l.map((e) => t.Y(Tt(n, r, e)));
2373
- for (let e = 0; e + 1 < l.length; e++) c.push(A([
2404
+ })], l = k(e), u = l.map((e) => t.Y(Tt(n, r, e)));
2405
+ for (let e = 0; e + 1 < l.length; e++) c.push(M([
2374
2406
  {
2375
2407
  x: o,
2376
2408
  y: u[e]
@@ -2387,34 +2419,34 @@ var Ct = z({
2387
2419
  x: o,
2388
2420
  y: u[e + 1]
2389
2421
  }
2390
- ], S(R(l[e + 1]), .07)));
2422
+ ], S(z(l[e + 1]), .07)));
2391
2423
  return l.forEach((e, i) => {
2392
2424
  let a = u[i];
2393
- c.push(O({
2425
+ c.push(A({
2394
2426
  x: o,
2395
2427
  y: a
2396
2428
  }, {
2397
2429
  x: s,
2398
2430
  y: a
2399
2431
  }, {
2400
- color: R(e),
2432
+ color: z(e),
2401
2433
  width: 1
2402
- })), c.push(j(o - 4, a, `${e} (${t.fmt(Tt(n, r, e))})`, {
2434
+ })), c.push(N(o - 4, a, `${e} (${t.fmt(Tt(n, r, e))})`, {
2403
2435
  align: "right",
2404
2436
  base: "middle",
2405
- textColor: R(e),
2437
+ textColor: z(e),
2406
2438
  size: 10,
2407
2439
  hit: !1
2408
2440
  }));
2409
2441
  }), c;
2410
2442
  }
2411
- }), At = z({
2443
+ }), At = B({
2412
2444
  id: "fibExtension",
2413
2445
  label: "Trend-based Fib extension",
2414
2446
  family: "fibonacci",
2415
2447
  gesture: "clicks",
2416
2448
  anchors: 3,
2417
- defaults: () => G([
2449
+ defaults: () => K([
2418
2450
  0,
2419
2451
  .236,
2420
2452
  .382,
@@ -2430,27 +2462,27 @@ var Ct = z({
2430
2462
  4.236
2431
2463
  ]),
2432
2464
  validate: (e) => {
2433
- V(e), D(e);
2465
+ H(e), k(e);
2434
2466
  },
2435
2467
  shapes(e, t) {
2436
2468
  let [n, r, i] = [
2437
- w(e, 0),
2438
- w(e, 1),
2439
- w(e, 2)
2469
+ E(e, 0),
2470
+ E(e, 1),
2471
+ E(e, 2)
2440
2472
  ], [a, o, s] = [
2441
- T(t, n),
2442
- T(t, r),
2443
- T(t, i)
2444
- ], c = s.x, l = e.style.extendRight ? t.W + 10 : Math.max(s.x, o.x) + 40, u = [O(a, o, {
2473
+ D(t, n),
2474
+ D(t, r),
2475
+ D(t, i)
2476
+ ], c = s.x, l = e.style.extendRight ? t.W + 10 : Math.max(s.x, o.x) + 40, u = [A(a, o, {
2445
2477
  dash: "dashed",
2446
2478
  width: 1,
2447
2479
  color: "#787b86"
2448
- }), O(o, s, {
2480
+ }), A(o, s, {
2449
2481
  dash: "dashed",
2450
2482
  width: 1,
2451
2483
  color: "#787b86"
2452
- })], d = D(e), f = d.map((e) => t.Y(Et(n, r, i, e)));
2453
- for (let e = 0; e + 1 < d.length; e++) u.push(A([
2484
+ })], d = k(e), f = d.map((e) => t.Y(Et(n, r, i, e)));
2485
+ for (let e = 0; e + 1 < d.length; e++) u.push(M([
2454
2486
  {
2455
2487
  x: c,
2456
2488
  y: f[e]
@@ -2467,34 +2499,34 @@ var Ct = z({
2467
2499
  x: c,
2468
2500
  y: f[e + 1]
2469
2501
  }
2470
- ], S(R(d[e + 1]), .07)));
2502
+ ], S(z(d[e + 1]), .07)));
2471
2503
  return d.forEach((e, a) => {
2472
2504
  let o = f[a];
2473
- u.push(O({
2505
+ u.push(A({
2474
2506
  x: c,
2475
2507
  y: o
2476
2508
  }, {
2477
2509
  x: l,
2478
2510
  y: o
2479
2511
  }, {
2480
- color: R(e),
2512
+ color: z(e),
2481
2513
  width: 1
2482
- })), u.push(j(c - 4, o, `${e} (${t.fmt(Et(n, r, i, e))})`, {
2514
+ })), u.push(N(c - 4, o, `${e} (${t.fmt(Et(n, r, i, e))})`, {
2483
2515
  align: "right",
2484
2516
  base: "middle",
2485
- textColor: R(e),
2517
+ textColor: z(e),
2486
2518
  size: 10,
2487
2519
  hit: !1
2488
2520
  }));
2489
2521
  }), u;
2490
2522
  }
2491
- }), jt = z({
2523
+ }), jt = B({
2492
2524
  id: "fibChannel",
2493
2525
  label: "Fib channel",
2494
2526
  family: "fibonacci",
2495
2527
  gesture: "clicks",
2496
2528
  anchors: 3,
2497
- defaults: () => G([
2529
+ defaults: () => K([
2498
2530
  0,
2499
2531
  .236,
2500
2532
  .382,
@@ -2506,10 +2538,10 @@ var Ct = z({
2506
2538
  2.618
2507
2539
  ]),
2508
2540
  validate(e) {
2509
- V(e), D(e), B(e, 0, 1);
2541
+ H(e), k(e), V(e, 0, 1);
2510
2542
  },
2511
2543
  shapes(e, t) {
2512
- let [n, r, i] = E(t, e), a = n.y + (r.y - n.y) * (i.x - n.x) / (r.x - n.x), o = i.y - a, s = D(e), c = (e) => [{
2544
+ let [n, r, i] = O(t, e), a = n.y + (r.y - n.y) * (i.x - n.x) / (r.x - n.x), o = i.y - a, s = k(e), c = (e) => [{
2513
2545
  x: n.x,
2514
2546
  y: n.y + e * o
2515
2547
  }, {
@@ -2518,44 +2550,44 @@ var Ct = z({
2518
2550
  }], l = [];
2519
2551
  for (let e = 0; e + 1 < s.length; e++) {
2520
2552
  let [t, n] = c(s[e]), [r, i] = c(s[e + 1]);
2521
- l.push(A([
2553
+ l.push(M([
2522
2554
  t,
2523
2555
  n,
2524
2556
  i,
2525
2557
  r
2526
- ], S(R(s[e + 1]), .07)));
2558
+ ], S(z(s[e + 1]), .07)));
2527
2559
  }
2528
2560
  for (let t of s) {
2529
2561
  let [n, r] = c(t);
2530
- l.push(O(n, r, {
2562
+ l.push(A(n, r, {
2531
2563
  extB: e.style.extendRight,
2532
2564
  extA: e.style.extendLeft,
2533
- color: R(t),
2565
+ color: z(t),
2534
2566
  width: 1
2535
- }), j(r.x + 4, r.y, String(t), {
2567
+ }), N(r.x + 4, r.y, String(t), {
2536
2568
  base: "middle",
2537
- textColor: R(t),
2569
+ textColor: z(t),
2538
2570
  size: 10,
2539
2571
  hit: !1
2540
2572
  }));
2541
2573
  }
2542
2574
  return l;
2543
2575
  }
2544
- }), Mt = z({
2576
+ }), Mt = B({
2545
2577
  id: "fibTimeZone",
2546
2578
  label: "Fib time zone",
2547
2579
  family: "fibonacci",
2548
2580
  gesture: "drag",
2549
2581
  anchors: 2,
2550
- defaults: () => G(Dt),
2582
+ defaults: () => K(Dt),
2551
2583
  validate(e) {
2552
- V(e), D(e), B(e, 0, 1);
2584
+ H(e), k(e), V(e, 0, 1);
2553
2585
  },
2554
2586
  shapes(e, t) {
2555
- let [n, r] = E(t, e), i = r.x - n.x, a = [];
2556
- for (let r of D(e)) {
2587
+ let [n, r] = O(t, e), i = r.x - n.x, a = [];
2588
+ for (let r of k(e)) {
2557
2589
  let e = n.x + r * i;
2558
- e < -50 || e > t.W + 50 || a.push(O({
2590
+ e < -50 || e > t.W + 50 || a.push(A({
2559
2591
  x: e,
2560
2592
  y: 0
2561
2593
  }, {
@@ -2566,14 +2598,14 @@ var Ct = z({
2566
2598
  extB: !0,
2567
2599
  color: r === 0 || r === 1 ? "#787b86" : "#2962ff",
2568
2600
  width: 1
2569
- }), j(e + 3, 3, String(r), {
2601
+ }), N(e + 3, 3, String(r), {
2570
2602
  base: "top",
2571
2603
  size: 10,
2572
2604
  textColor: "#787b86",
2573
2605
  hit: !1
2574
2606
  }));
2575
2607
  }
2576
- return a.push(O(n, r, {
2608
+ return a.push(A(n, r, {
2577
2609
  dash: "dashed",
2578
2610
  width: 1
2579
2611
  })), a;
@@ -2585,19 +2617,19 @@ var Ct = z({
2585
2617
  .618,
2586
2618
  .75,
2587
2619
  1
2588
- ], Pt = z({
2620
+ ], Pt = B({
2589
2621
  id: "fibSpeedFan",
2590
2622
  label: "Fib speed resistance fan",
2591
2623
  family: "fibonacci",
2592
2624
  gesture: "drag",
2593
2625
  anchors: 2,
2594
- defaults: () => G(Nt),
2626
+ defaults: () => K(Nt),
2595
2627
  validate(e) {
2596
- if (V(e), D(e), B(e, 0, 1), w(e, 0).price === w(e, 1).price) throw RangeError(`drawings: fibSpeedFan "${e.id}" needs anchors at different prices`);
2628
+ if (H(e), k(e), V(e, 0, 1), E(e, 0).price === E(e, 1).price) throw RangeError(`drawings: fibSpeedFan "${e.id}" needs anchors at different prices`);
2597
2629
  },
2598
2630
  shapes(e, t) {
2599
- let [n, r] = E(t, e), i = [
2600
- A([
2631
+ let [n, r] = O(t, e), i = [
2632
+ M([
2601
2633
  n,
2602
2634
  {
2603
2635
  x: r.x,
@@ -2609,7 +2641,7 @@ var Ct = z({
2609
2641
  y: r.y
2610
2642
  }
2611
2643
  ], S(e.style.color, .05)),
2612
- O(n, {
2644
+ A(n, {
2613
2645
  x: r.x,
2614
2646
  y: n.y
2615
2647
  }, {
@@ -2617,7 +2649,7 @@ var Ct = z({
2617
2649
  width: 1,
2618
2650
  hit: !1
2619
2651
  }),
2620
- O({
2652
+ A({
2621
2653
  x: r.x,
2622
2654
  y: n.y
2623
2655
  }, r, {
@@ -2625,7 +2657,7 @@ var Ct = z({
2625
2657
  width: 1,
2626
2658
  hit: !1
2627
2659
  }),
2628
- O(r, {
2660
+ A(r, {
2629
2661
  x: n.x,
2630
2662
  y: r.y
2631
2663
  }, {
@@ -2633,7 +2665,7 @@ var Ct = z({
2633
2665
  width: 1,
2634
2666
  hit: !1
2635
2667
  }),
2636
- O({
2668
+ A({
2637
2669
  x: n.x,
2638
2670
  y: r.y
2639
2671
  }, n, {
@@ -2642,23 +2674,23 @@ var Ct = z({
2642
2674
  hit: !1
2643
2675
  })
2644
2676
  ];
2645
- for (let t of D(e)) {
2646
- let e = R(t === .25 ? .5 : t), a = {
2677
+ for (let t of k(e)) {
2678
+ let e = z(t === .25 ? .5 : t), a = {
2647
2679
  x: r.x,
2648
2680
  y: n.y + t * (r.y - n.y)
2649
2681
  }, o = {
2650
2682
  x: n.x + t * (r.x - n.x),
2651
2683
  y: r.y
2652
2684
  };
2653
- i.push(O(n, a, {
2685
+ i.push(A(n, a, {
2654
2686
  extB: !0,
2655
2687
  color: e,
2656
2688
  width: 1
2657
- }), O(n, o, {
2689
+ }), A(n, o, {
2658
2690
  extB: !0,
2659
2691
  color: e,
2660
2692
  width: 1
2661
- }), j(a.x + 3, a.y, String(t), {
2693
+ }), N(a.x + 3, a.y, String(t), {
2662
2694
  base: "middle",
2663
2695
  size: 10,
2664
2696
  textColor: e,
@@ -2667,13 +2699,13 @@ var Ct = z({
2667
2699
  }
2668
2700
  return i;
2669
2701
  }
2670
- }), Ft = z({
2702
+ }), Ft = B({
2671
2703
  id: "fibTrendTime",
2672
2704
  label: "Trend-based Fib time",
2673
2705
  family: "fibonacci",
2674
2706
  gesture: "clicks",
2675
2707
  anchors: 3,
2676
- defaults: () => G([
2708
+ defaults: () => K([
2677
2709
  0,
2678
2710
  .382,
2679
2711
  .5,
@@ -2688,17 +2720,17 @@ var Ct = z({
2688
2720
  4.236
2689
2721
  ]),
2690
2722
  validate(e) {
2691
- V(e), D(e), B(e, 0, 1);
2723
+ H(e), k(e), V(e, 0, 1);
2692
2724
  },
2693
2725
  shapes(e, t) {
2694
- let [n, r, i] = E(t, e), a = r.x - n.x, o = [O(n, r, {
2726
+ let [n, r, i] = O(t, e), a = r.x - n.x, o = [A(n, r, {
2695
2727
  dash: "dashed",
2696
2728
  width: 1,
2697
2729
  color: "#787b86"
2698
2730
  })];
2699
- for (let n of D(e)) {
2731
+ for (let n of k(e)) {
2700
2732
  let e = i.x + n * a;
2701
- e < -50 || e > t.W + 50 || o.push(O({
2733
+ e < -50 || e > t.W + 50 || o.push(A({
2702
2734
  x: e,
2703
2735
  y: 0
2704
2736
  }, {
@@ -2707,24 +2739,24 @@ var Ct = z({
2707
2739
  }, {
2708
2740
  extA: !0,
2709
2741
  extB: !0,
2710
- color: R(n),
2742
+ color: z(n),
2711
2743
  width: 1
2712
- }), j(e + 3, 3, String(n), {
2744
+ }), N(e + 3, 3, String(n), {
2713
2745
  base: "top",
2714
2746
  size: 10,
2715
- textColor: R(n),
2747
+ textColor: z(n),
2716
2748
  hit: !1
2717
2749
  }));
2718
2750
  }
2719
2751
  return o;
2720
2752
  }
2721
- }), It = z({
2753
+ }), It = B({
2722
2754
  id: "fibCircles",
2723
2755
  label: "Fib circles",
2724
2756
  family: "fibonacci",
2725
2757
  gesture: "drag",
2726
2758
  anchors: 2,
2727
- defaults: () => G([
2759
+ defaults: () => K([
2728
2760
  .236,
2729
2761
  .382,
2730
2762
  .5,
@@ -2735,41 +2767,41 @@ var Ct = z({
2735
2767
  2.618
2736
2768
  ]),
2737
2769
  validate(e) {
2738
- V(e), D(e);
2770
+ H(e), k(e);
2739
2771
  },
2740
2772
  shapes(e, t) {
2741
- let [n, r] = E(t, e), i = s(n.x, n.y, r.x, r.y), a = [O(n, r, {
2773
+ let [n, r] = O(t, e), i = s(n.x, n.y, r.x, r.y), a = [A(n, r, {
2742
2774
  dash: "dashed",
2743
2775
  width: 1,
2744
2776
  color: "#787b86"
2745
2777
  })];
2746
- for (let t of D(e)) a.push({
2778
+ for (let t of k(e)) a.push({
2747
2779
  k: "ellipse",
2748
2780
  cx: n.x,
2749
2781
  cy: n.y,
2750
2782
  rx: i * t,
2751
2783
  ry: i * t,
2752
- color: R(t),
2784
+ color: z(t),
2753
2785
  width: 1
2754
- }, j(n.x + i * t, n.y, String(t), {
2786
+ }, N(n.x + i * t, n.y, String(t), {
2755
2787
  size: 10,
2756
2788
  base: "bottom",
2757
- textColor: R(t),
2789
+ textColor: z(t),
2758
2790
  hit: !1
2759
2791
  }));
2760
2792
  return a;
2761
2793
  }
2762
- }), Lt = z({
2794
+ }), Lt = B({
2763
2795
  id: "fibSpiral",
2764
2796
  label: "Fib spiral",
2765
2797
  family: "fibonacci",
2766
2798
  gesture: "drag",
2767
2799
  anchors: 2,
2768
2800
  defaults: () => ({ props: { clockwise: !1 } }),
2769
- validate: V,
2801
+ validate: H,
2770
2802
  shapes(e, t) {
2771
- let [n, r] = E(t, e), i = s(n.x, n.y, r.x, r.y);
2772
- if (i === 0) return [O(n, r)];
2803
+ let [n, r] = O(t, e), i = s(n.x, n.y, r.x, r.y);
2804
+ if (i === 0) return [A(n, r)];
2773
2805
  let a = Math.atan2(r.y - n.y, r.x - n.x), o = e.props.clockwise === !0 ? 1 : -1, c = 2 * Math.hypot(t.W, t.H), l = Math.min(8 * Math.PI, Math.log(c / i) * Math.PI / (2 * Math.log(Ot))), u = [];
2774
2806
  for (let e = -3 * Math.PI; e <= l; e += .08) {
2775
2807
  let t = i * Ot ** (2 * e / Math.PI);
@@ -2778,7 +2810,7 @@ var Ct = z({
2778
2810
  y: n.y + t * Math.sin(a + o * e)
2779
2811
  });
2780
2812
  }
2781
- return [O(n, r, {
2813
+ return [A(n, r, {
2782
2814
  dash: "dashed",
2783
2815
  width: 1
2784
2816
  }), {
@@ -2793,46 +2825,46 @@ var Ct = z({
2793
2825
  1,
2794
2826
  1.382,
2795
2827
  1.618
2796
- ], zt = z({
2828
+ ], zt = B({
2797
2829
  id: "fibSpeedArcs",
2798
2830
  label: "Fib speed resistance arcs",
2799
2831
  family: "fibonacci",
2800
2832
  gesture: "drag",
2801
2833
  anchors: 2,
2802
- defaults: () => G(Rt),
2834
+ defaults: () => K(Rt),
2803
2835
  validate: (e) => {
2804
- V(e), D(e);
2836
+ H(e), k(e);
2805
2837
  },
2806
2838
  shapes(e, t) {
2807
- let [n, r] = E(t, e), i = s(n.x, n.y, r.x, r.y), a = Math.atan2(r.y - n.y, r.x - n.x), o = [O(n, r, {
2839
+ let [n, r] = O(t, e), i = s(n.x, n.y, r.x, r.y), a = Math.atan2(r.y - n.y, r.x - n.x), o = [A(n, r, {
2808
2840
  dash: "dashed",
2809
2841
  width: 1,
2810
2842
  color: "#787b86"
2811
2843
  })];
2812
- for (let t of D(e)) o.push({
2844
+ for (let t of k(e)) o.push({
2813
2845
  k: "arc",
2814
2846
  cx: r.x,
2815
2847
  cy: r.y,
2816
2848
  r: i * t,
2817
2849
  a0: a - Math.PI / 2,
2818
2850
  a1: a + Math.PI / 2,
2819
- color: R(t),
2851
+ color: z(t),
2820
2852
  width: 1
2821
- }), o.push(j(r.x + i * t * Math.cos(a), r.y + i * t * Math.sin(a), String(t), {
2853
+ }), o.push(N(r.x + i * t * Math.cos(a), r.y + i * t * Math.sin(a), String(t), {
2822
2854
  size: 10,
2823
2855
  base: "middle",
2824
- textColor: R(t),
2856
+ textColor: z(t),
2825
2857
  hit: !1
2826
2858
  }));
2827
2859
  return o;
2828
2860
  }
2829
- }), Bt = z({
2861
+ }), Bt = B({
2830
2862
  id: "fibWedge",
2831
2863
  label: "Fib wedge",
2832
2864
  family: "fibonacci",
2833
2865
  gesture: "clicks",
2834
2866
  anchors: 3,
2835
- defaults: () => G([
2867
+ defaults: () => K([
2836
2868
  .236,
2837
2869
  .382,
2838
2870
  .5,
@@ -2842,18 +2874,18 @@ var Ct = z({
2842
2874
  1.618
2843
2875
  ]),
2844
2876
  validate: (e) => {
2845
- V(e), D(e);
2877
+ H(e), k(e);
2846
2878
  },
2847
2879
  shapes(e, t) {
2848
- let [n, r, i] = E(t, e), a = s(n.x, n.y, r.x, r.y), o = Math.atan2(r.y - n.y, r.x - n.x), c = ((Math.atan2(i.y - n.y, i.x - n.x) - o + Math.PI) % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI) - Math.PI, l = [O(n, r, { extB: !0 }), O(n, i, { extB: !0 })];
2849
- for (let t of D(e)) l.push({
2880
+ let [n, r, i] = O(t, e), a = s(n.x, n.y, r.x, r.y), o = Math.atan2(r.y - n.y, r.x - n.x), c = ((Math.atan2(i.y - n.y, i.x - n.x) - o + Math.PI) % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI) - Math.PI, l = [A(n, r, { extB: !0 }), A(n, i, { extB: !0 })];
2881
+ for (let t of k(e)) l.push({
2850
2882
  k: "arc",
2851
2883
  cx: n.x,
2852
2884
  cy: n.y,
2853
2885
  r: a * t,
2854
2886
  a0: o,
2855
2887
  a1: o + c,
2856
- color: R(t),
2888
+ color: z(t),
2857
2889
  width: 1
2858
2890
  });
2859
2891
  return l;
@@ -2869,25 +2901,25 @@ var Ct = z({
2869
2901
  Lt,
2870
2902
  zt,
2871
2903
  Bt
2872
- ], K = "rgba(41,98,255,0.15)";
2873
- function q(e, t) {
2874
- return e ? [j(t.x, t.y, e, {
2904
+ ], q = "rgba(41,98,255,0.15)";
2905
+ function Ht(e, t) {
2906
+ return e ? [N(t.x, t.y, e, {
2875
2907
  align: "center",
2876
2908
  base: "middle",
2877
2909
  hit: !1
2878
2910
  })] : [];
2879
2911
  }
2880
- var Ht = z({
2912
+ var Ut = B({
2881
2913
  id: "rectangle",
2882
2914
  label: "Rectangle",
2883
2915
  family: "shapes",
2884
2916
  gesture: "drag",
2885
2917
  anchors: 2,
2886
- defaults: () => ({ style: { fill: K } }),
2887
- validate: V,
2918
+ defaults: () => ({ style: { fill: q } }),
2919
+ validate: H,
2888
2920
  shapes(e, t) {
2889
- let [n, r] = E(t, e);
2890
- return [k([
2921
+ let [n, r] = O(t, e);
2922
+ return [j([
2891
2923
  n,
2892
2924
  {
2893
2925
  x: r.x,
@@ -2901,10 +2933,10 @@ var Ht = z({
2901
2933
  ], {
2902
2934
  close: !0,
2903
2935
  fill: e.style.fill
2904
- }), ...q(e.style.text, N(n, r))];
2936
+ }), ...Ht(e.style.text, F(n, r))];
2905
2937
  }
2906
2938
  });
2907
- function Ut(e, t, n) {
2939
+ function Wt(e, t, n) {
2908
2940
  let r = t.x - e.x, i = t.y - e.y, a = Math.hypot(r, i);
2909
2941
  if (a === 0) throw RangeError("rotated rectangle: its first two anchors coincide");
2910
2942
  let o = -i / a, s = r / a, c = (n.x - e.x) * o + (n.y - e.y) * s;
@@ -2921,31 +2953,31 @@ function Ut(e, t, n) {
2921
2953
  }
2922
2954
  ];
2923
2955
  }
2924
- var Wt = z({
2956
+ var Gt = B({
2925
2957
  id: "rotatedRectangle",
2926
2958
  label: "Rotated rectangle",
2927
2959
  family: "shapes",
2928
2960
  gesture: "clicks",
2929
2961
  anchors: 3,
2930
- defaults: () => ({ style: { fill: K } }),
2931
- validate: V,
2962
+ defaults: () => ({ style: { fill: q } }),
2963
+ validate: H,
2932
2964
  shapes(e, t) {
2933
- let [n, r, i] = E(t, e), a = Ut(n, r, i);
2934
- return [k(a, {
2965
+ let [n, r, i] = O(t, e), a = Wt(n, r, i);
2966
+ return [j(a, {
2935
2967
  close: !0,
2936
2968
  fill: e.style.fill
2937
- }), ...q(e.style.text, N(a[0], a[2]))];
2969
+ }), ...Ht(e.style.text, F(a[0], a[2]))];
2938
2970
  }
2939
- }), Gt = z({
2971
+ }), Kt = B({
2940
2972
  id: "ellipse",
2941
2973
  label: "Ellipse",
2942
2974
  family: "shapes",
2943
2975
  gesture: "drag",
2944
2976
  anchors: 2,
2945
- defaults: () => ({ style: { fill: K } }),
2946
- validate: V,
2977
+ defaults: () => ({ style: { fill: q } }),
2978
+ validate: H,
2947
2979
  shapes(e, t) {
2948
- let [n, r] = E(t, e), i = N(n, r);
2980
+ let [n, r] = O(t, e), i = F(n, r);
2949
2981
  return [{
2950
2982
  k: "ellipse",
2951
2983
  cx: i.x,
@@ -2953,18 +2985,18 @@ var Wt = z({
2953
2985
  rx: Math.abs(r.x - n.x) / 2,
2954
2986
  ry: Math.abs(r.y - n.y) / 2,
2955
2987
  fill: e.style.fill
2956
- }, ...q(e.style.text, i)];
2988
+ }, ...Ht(e.style.text, i)];
2957
2989
  }
2958
- }), Kt = z({
2990
+ }), qt = B({
2959
2991
  id: "circle",
2960
2992
  label: "Circle",
2961
2993
  family: "shapes",
2962
2994
  gesture: "drag",
2963
2995
  anchors: 2,
2964
- defaults: () => ({ style: { fill: K } }),
2965
- validate: V,
2996
+ defaults: () => ({ style: { fill: q } }),
2997
+ validate: H,
2966
2998
  shapes(e, t) {
2967
- let [n, r] = E(t, e), i = s(n.x, n.y, r.x, r.y);
2999
+ let [n, r] = O(t, e), i = s(n.x, n.y, r.x, r.y);
2968
3000
  return [
2969
3001
  {
2970
3002
  k: "ellipse",
@@ -2974,30 +3006,30 @@ var Wt = z({
2974
3006
  ry: i,
2975
3007
  fill: e.style.fill
2976
3008
  },
2977
- O(n, r, {
3009
+ A(n, r, {
2978
3010
  dash: "dotted",
2979
3011
  width: 1,
2980
3012
  hit: !1
2981
3013
  }),
2982
- ...q(e.style.text, n)
3014
+ ...Ht(e.style.text, n)
2983
3015
  ];
2984
3016
  }
2985
- }), qt = z({
3017
+ }), Jt = B({
2986
3018
  id: "triangle",
2987
3019
  label: "Triangle",
2988
3020
  family: "shapes",
2989
3021
  gesture: "clicks",
2990
3022
  anchors: 3,
2991
- defaults: () => ({ style: { fill: K } }),
2992
- validate: V,
3023
+ defaults: () => ({ style: { fill: q } }),
3024
+ validate: H,
2993
3025
  shapes(e, t) {
2994
- return [k(E(t, e), {
3026
+ return [j(O(t, e), {
2995
3027
  close: !0,
2996
3028
  fill: e.style.fill
2997
3029
  })];
2998
3030
  }
2999
3031
  });
3000
- function Jt(e, t, n) {
3032
+ function Yt(e, t, n) {
3001
3033
  let r = m(e, t, n);
3002
3034
  if (!r) return null;
3003
3035
  let i = (e) => Math.atan2(e.y - r.cy, e.x - r.cx), a = (e) => (e % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI), o = i(e), s = a(i(t) - o), c = a(i(n) - o);
@@ -3007,16 +3039,16 @@ function Jt(e, t, n) {
3007
3039
  a1: c < s ? o + s : o - (2 * Math.PI - s)
3008
3040
  };
3009
3041
  }
3010
- var Yt = z({
3042
+ var Xt = B({
3011
3043
  id: "arc",
3012
3044
  label: "Arc",
3013
3045
  family: "shapes",
3014
3046
  gesture: "clicks",
3015
3047
  anchors: 3,
3016
3048
  defaults: () => ({}),
3017
- validate: V,
3049
+ validate: H,
3018
3050
  shapes(e, t) {
3019
- let [n, r, i] = E(t, e), a = Jt(n, r, i);
3051
+ let [n, r, i] = O(t, e), a = Yt(n, r, i);
3020
3052
  return a ? [{
3021
3053
  k: "arc",
3022
3054
  cx: a.cx,
@@ -3025,39 +3057,39 @@ var Yt = z({
3025
3057
  a0: a.a0,
3026
3058
  a1: a.a1,
3027
3059
  fill: e.style.fill
3028
- }] : [O(n, r)];
3060
+ }] : [A(n, r)];
3029
3061
  }
3030
- }), Xt = z({
3062
+ }), Zt = B({
3031
3063
  id: "curve",
3032
3064
  label: "Curve",
3033
3065
  family: "shapes",
3034
3066
  gesture: "clicks",
3035
3067
  anchors: 3,
3036
3068
  defaults: () => ({}),
3037
- validate: V,
3069
+ validate: H,
3038
3070
  shapes(e, t) {
3039
- let [n, r, i] = E(t, e);
3071
+ let [n, r, i] = O(t, e);
3040
3072
  return [{
3041
3073
  k: "poly",
3042
3074
  pts: f(n, p(n, i, r), r)
3043
3075
  }];
3044
3076
  }
3045
- }), Zt = z({
3077
+ }), Qt = B({
3046
3078
  id: "doubleCurve",
3047
3079
  label: "Double curve",
3048
3080
  family: "shapes",
3049
3081
  gesture: "clicks",
3050
3082
  anchors: 4,
3051
3083
  defaults: () => ({}),
3052
- validate: V,
3084
+ validate: H,
3053
3085
  shapes(e, t) {
3054
- let [n, r, i, a] = E(t, e), o = N(n, r);
3086
+ let [n, r, i, a] = O(t, e), o = F(n, r);
3055
3087
  return [{
3056
3088
  k: "poly",
3057
3089
  pts: [...f(n, p(n, i, o), o), ...f(o, p(o, a, r), r)]
3058
3090
  }];
3059
3091
  }
3060
- }), Qt = z({
3092
+ }), $t = B({
3061
3093
  id: "polyline",
3062
3094
  label: "Polyline",
3063
3095
  family: "shapes",
@@ -3065,14 +3097,14 @@ var Yt = z({
3065
3097
  anchors: 2,
3066
3098
  variable: !0,
3067
3099
  defaults: () => ({}),
3068
- validate: V,
3100
+ validate: H,
3069
3101
  shapes(e, t) {
3070
- return [k(E(t, e), {
3102
+ return [j(O(t, e), {
3071
3103
  close: e.style.fill !== null,
3072
3104
  fill: e.style.fill
3073
3105
  })];
3074
3106
  }
3075
- }), $t = z({
3107
+ }), en = B({
3076
3108
  id: "path",
3077
3109
  label: "Path",
3078
3110
  family: "shapes",
@@ -3080,12 +3112,12 @@ var Yt = z({
3080
3112
  anchors: 2,
3081
3113
  variable: !0,
3082
3114
  defaults: () => ({}),
3083
- validate: V,
3115
+ validate: H,
3084
3116
  shapes(e, t) {
3085
- let n = E(t, e);
3086
- return [k(n), M(n[n.length - 2], n[n.length - 1], 6 + e.style.width * 2, e.style.color)];
3117
+ let n = O(t, e);
3118
+ return [j(n), P(n[n.length - 2], n[n.length - 1], 6 + e.style.width * 2, e.style.color)];
3087
3119
  }
3088
- }), en = z({
3120
+ }), tn = B({
3089
3121
  id: "brush",
3090
3122
  label: "Brush",
3091
3123
  family: "shapes",
@@ -3094,9 +3126,9 @@ var Yt = z({
3094
3126
  variable: !0,
3095
3127
  noHandles: !0,
3096
3128
  defaults: () => ({ style: { width: 2 } }),
3097
- validate: V,
3098
- shapes: (e, t) => [k(E(t, e))]
3099
- }), tn = z({
3129
+ validate: H,
3130
+ shapes: (e, t) => [j(O(t, e))]
3131
+ }), nn = B({
3100
3132
  id: "highlighter",
3101
3133
  label: "Highlighter",
3102
3134
  family: "shapes",
@@ -3108,22 +3140,22 @@ var Yt = z({
3108
3140
  width: 14,
3109
3141
  color: "rgba(255,235,59,0.4)"
3110
3142
  } }),
3111
- validate: V,
3112
- shapes: (e, t) => [k(E(t, e))]
3113
- }), nn = [
3114
- Ht,
3115
- Wt,
3143
+ validate: H,
3144
+ shapes: (e, t) => [j(O(t, e))]
3145
+ }), rn = [
3146
+ Ut,
3116
3147
  Gt,
3117
3148
  Kt,
3118
3149
  qt,
3119
- Yt,
3150
+ Jt,
3120
3151
  Xt,
3121
3152
  Zt,
3122
3153
  Qt,
3123
3154
  $t,
3124
3155
  en,
3125
- tn
3126
- ], rn = [
3156
+ tn,
3157
+ nn
3158
+ ], an = [
3127
3159
  0,
3128
3160
  .25,
3129
3161
  .382,
@@ -3131,7 +3163,7 @@ var Yt = z({
3131
3163
  .618,
3132
3164
  .75,
3133
3165
  1
3134
- ], an = (e, t, n) => e.price + (t.price - e.price) * n, on = (e, t, n, r) => e.price + (t.price - e.price) * n / r, sn = [
3166
+ ], on = (e, t, n) => e.price + (t.price - e.price) * n, sn = (e, t, n, r) => e.price + (t.price - e.price) * n / r, cn = [
3135
3167
  [8, 1],
3136
3168
  [4, 1],
3137
3169
  [3, 1],
@@ -3142,9 +3174,9 @@ var Yt = z({
3142
3174
  [1, 4],
3143
3175
  [1, 8]
3144
3176
  ];
3145
- function cn(e, t, n, r, i) {
3177
+ function ln(e, t, n, r, i) {
3146
3178
  let a = [];
3147
- for (let r of n) a.push(O({
3179
+ for (let r of n) a.push(A({
3148
3180
  x: e.x + r * (t.x - e.x),
3149
3181
  y: e.y
3150
3182
  }, {
@@ -3154,7 +3186,7 @@ function cn(e, t, n, r, i) {
3154
3186
  width: 1,
3155
3187
  color: S(i, .7)
3156
3188
  }));
3157
- for (let n of r) a.push(O({
3189
+ for (let n of r) a.push(A({
3158
3190
  x: e.x,
3159
3191
  y: e.y + n * (t.y - e.y)
3160
3192
  }, {
@@ -3166,21 +3198,21 @@ function cn(e, t, n, r, i) {
3166
3198
  }));
3167
3199
  return a;
3168
3200
  }
3169
- var ln = z({
3201
+ var un = B({
3170
3202
  id: "gannBox",
3171
3203
  label: "Gann box",
3172
3204
  family: "gann",
3173
3205
  gesture: "drag",
3174
3206
  anchors: 2,
3175
- defaults: () => ({ props: { levels: rn } }),
3207
+ defaults: () => ({ props: { levels: an } }),
3176
3208
  validate: (e) => {
3177
- V(e), B(e, 0, 1), D(e);
3209
+ H(e), V(e, 0, 1), k(e);
3178
3210
  },
3179
3211
  shapes(e, t) {
3180
- let n = w(e, 0), r = w(e, 1), [i, a] = E(t, e), o = D(e), s = (e) => t.Y(an(n, r, e)), c = [];
3212
+ let n = E(e, 0), r = E(e, 1), [i, a] = O(t, e), o = k(e), s = (e) => t.Y(on(n, r, e)), c = [];
3181
3213
  for (let t = 0; t + 1 < o.length; t += 2) {
3182
3214
  let n = s(o[t]), r = s(o[t + 1]);
3183
- c.push(A([
3215
+ c.push(M([
3184
3216
  {
3185
3217
  x: i.x,
3186
3218
  y: n
@@ -3199,8 +3231,8 @@ var ln = z({
3199
3231
  }
3200
3232
  ], S(e.style.color, .06)));
3201
3233
  }
3202
- c.push(...cn(i, a, o, [], e.style.color));
3203
- for (let t of o) c.push(O({
3234
+ c.push(...ln(i, a, o, [], e.style.color));
3235
+ for (let t of o) c.push(A({
3204
3236
  x: i.x,
3205
3237
  y: s(t)
3206
3238
  }, {
@@ -3210,27 +3242,27 @@ var ln = z({
3210
3242
  width: 1,
3211
3243
  color: S(e.style.color, .7)
3212
3244
  }));
3213
- c.push(O(i, a), O({
3245
+ c.push(A(i, a), A({
3214
3246
  x: i.x,
3215
3247
  y: a.y
3216
3248
  }, {
3217
3249
  x: a.x,
3218
3250
  y: i.y
3219
- })), c.push(O(i, {
3251
+ })), c.push(A(i, {
3220
3252
  x: a.x,
3221
3253
  y: i.y
3222
- }), O({
3254
+ }), A({
3223
3255
  x: a.x,
3224
3256
  y: i.y
3225
- }, a), O(a, {
3257
+ }, a), A(a, {
3226
3258
  x: i.x,
3227
3259
  y: a.y
3228
- }), O({
3260
+ }), A({
3229
3261
  x: i.x,
3230
3262
  y: a.y
3231
3263
  }, i));
3232
3264
  for (let l of o) {
3233
- c.push(j(Math.min(i.x, a.x) - 4, s(l), t.fmt(an(n, r, l)), {
3265
+ c.push(N(Math.min(i.x, a.x) - 4, s(l), t.fmt(on(n, r, l)), {
3234
3266
  align: "right",
3235
3267
  base: "middle",
3236
3268
  size: 10,
@@ -3238,7 +3270,7 @@ var ln = z({
3238
3270
  hit: !1
3239
3271
  }));
3240
3272
  let o = i.x + l * (a.x - i.x);
3241
- c.push(j(o, Math.min(i.y, a.y) - 4, F(t.T(o)), {
3273
+ c.push(N(o, Math.min(i.y, a.y) - 4, I(t.T(o)), {
3242
3274
  align: "center",
3243
3275
  base: "bottom",
3244
3276
  size: 9,
@@ -3248,7 +3280,7 @@ var ln = z({
3248
3280
  }
3249
3281
  return c;
3250
3282
  }
3251
- }), un = [
3283
+ }), dn = [
3252
3284
  0,
3253
3285
  1 / 8,
3254
3286
  2 / 8,
@@ -3259,36 +3291,36 @@ var ln = z({
3259
3291
  7 / 8,
3260
3292
  1
3261
3293
  ];
3262
- function dn(e, t, n) {
3263
- let r = cn(e, t, un, un, n), i = {
3294
+ function fn(e, t, n) {
3295
+ let r = ln(e, t, dn, dn, n), i = {
3264
3296
  x: (e.x + t.x) / 2,
3265
3297
  y: (e.y + t.y) / 2
3266
3298
  };
3267
- return r.push(O(e, t, { extB: !0 }), O({
3299
+ return r.push(A(e, t, { extB: !0 }), A({
3268
3300
  x: e.x,
3269
3301
  y: t.y
3270
3302
  }, {
3271
3303
  x: t.x,
3272
3304
  y: e.y
3273
- }, { extB: !0 })), r.push(O({
3305
+ }, { extB: !0 })), r.push(A({
3274
3306
  x: i.x,
3275
3307
  y: e.y
3276
3308
  }, {
3277
3309
  x: t.x,
3278
3310
  y: i.y
3279
- }, { width: 1 }), O({
3311
+ }, { width: 1 }), A({
3280
3312
  x: t.x,
3281
3313
  y: i.y
3282
3314
  }, {
3283
3315
  x: i.x,
3284
3316
  y: t.y
3285
- }, { width: 1 }), O({
3317
+ }, { width: 1 }), A({
3286
3318
  x: i.x,
3287
3319
  y: t.y
3288
3320
  }, {
3289
3321
  x: e.x,
3290
3322
  y: i.y
3291
- }, { width: 1 }), O({
3323
+ }, { width: 1 }), A({
3292
3324
  x: e.x,
3293
3325
  y: i.y
3294
3326
  }, {
@@ -3296,7 +3328,7 @@ function dn(e, t, n) {
3296
3328
  y: e.y
3297
3329
  }, { width: 1 })), r;
3298
3330
  }
3299
- var fn = z({
3331
+ var pn = B({
3300
3332
  id: "gannSquare",
3301
3333
  label: "Gann square",
3302
3334
  family: "gann",
@@ -3304,21 +3336,21 @@ var fn = z({
3304
3336
  anchors: 2,
3305
3337
  defaults: () => ({}),
3306
3338
  validate: (e) => {
3307
- V(e), B(e, 0, 1);
3339
+ H(e), V(e, 0, 1);
3308
3340
  },
3309
3341
  shapes: (e, t) => {
3310
- let [n, r] = E(t, e);
3311
- return dn(n, r, e.style.color);
3342
+ let [n, r] = O(t, e);
3343
+ return fn(n, r, e.style.color);
3312
3344
  }
3313
3345
  });
3314
- function pn(e, t) {
3315
- let n = T(t, e.anchors[0]), r = T(t, e.anchors[1]), i = Math.abs(r.x - n.x);
3346
+ function mn(e, t) {
3347
+ let n = D(t, e.anchors[0]), r = D(t, e.anchors[1]), i = Math.abs(r.x - n.x);
3316
3348
  return {
3317
3349
  x: r.x,
3318
3350
  y: n.y + (r.y >= n.y ? i : -i)
3319
3351
  };
3320
3352
  }
3321
- var mn = z({
3353
+ var hn = B({
3322
3354
  id: "gannSquareFixed",
3323
3355
  label: "Gann square fixed",
3324
3356
  family: "gann",
@@ -3326,11 +3358,11 @@ var mn = z({
3326
3358
  anchors: 2,
3327
3359
  defaults: () => ({}),
3328
3360
  validate: (e) => {
3329
- V(e), B(e, 0, 1);
3361
+ H(e), V(e, 0, 1);
3330
3362
  },
3331
- handlePoints: (e, t) => [T(t, w(e, 0)), pn(e, t)],
3332
- shapes: (e, t) => dn(T(t, w(e, 0)), pn(e, t), e.style.color)
3333
- }), hn = z({
3363
+ handlePoints: (e, t) => [D(t, E(e, 0)), mn(e, t)],
3364
+ shapes: (e, t) => fn(D(t, E(e, 0)), mn(e, t), e.style.color)
3365
+ }), gn = B({
3334
3366
  id: "gannFan",
3335
3367
  label: "Gann fan",
3336
3368
  family: "gann",
@@ -3338,15 +3370,15 @@ var mn = z({
3338
3370
  anchors: 2,
3339
3371
  defaults: () => ({}),
3340
3372
  validate(e) {
3341
- if (V(e), B(e, 0, 1), w(e, 0).price === w(e, 1).price) throw RangeError(`drawings: gannFan "${e.id}" needs anchors at different prices (its 1×1 line would be flat)`);
3373
+ if (H(e), V(e, 0, 1), E(e, 0).price === E(e, 1).price) throw RangeError(`drawings: gannFan "${e.id}" needs anchors at different prices (its 1×1 line would be flat)`);
3342
3374
  },
3343
3375
  shapes(e, t) {
3344
- let n = w(e, 0), r = w(e, 1), i = T(t, n), a = t.X(r.time), o = [], s = sn.map(([e, i]) => ({
3376
+ let n = E(e, 0), r = E(e, 1), i = D(t, n), a = t.X(r.time), o = [], s = cn.map(([e, i]) => ({
3345
3377
  n: e,
3346
3378
  m: i,
3347
3379
  e: {
3348
3380
  x: a,
3349
- y: t.Y(on(n, r, e, i))
3381
+ y: t.Y(sn(n, r, e, i))
3350
3382
  }
3351
3383
  }));
3352
3384
  for (let n = 0; n + 1 < s.length; n++) {
@@ -3357,17 +3389,17 @@ var mn = z({
3357
3389
  y: i.y + r * a
3358
3390
  };
3359
3391
  };
3360
- a > i.x && o.push(A([
3392
+ a > i.x && o.push(M([
3361
3393
  i,
3362
3394
  r(s[n].e),
3363
3395
  r(s[n + 1].e)
3364
3396
  ], S(e.style.color, n % 2 ? .04 : .09)));
3365
3397
  }
3366
- for (let { n: t, m: n, e: r } of s) o.push(O(i, r, {
3398
+ for (let { n: t, m: n, e: r } of s) o.push(A(i, r, {
3367
3399
  extB: !0,
3368
3400
  extA: !1,
3369
3401
  width: t === n ? e.style.width : 1
3370
- }), j(r.x + 3, r.y, `${t}x${n}`, {
3402
+ }), N(r.x + 3, r.y, `${t}x${n}`, {
3371
3403
  base: "middle",
3372
3404
  size: 10,
3373
3405
  textColor: e.style.color,
@@ -3375,14 +3407,14 @@ var mn = z({
3375
3407
  }));
3376
3408
  return o;
3377
3409
  }
3378
- }), gn = [
3379
- ln,
3380
- mn,
3381
- fn,
3382
- hn
3410
+ }), _n = [
3411
+ un,
3412
+ hn,
3413
+ pn,
3414
+ gn
3383
3415
  ], J = (e) => {
3384
- V(e);
3385
- }, _n = z({
3416
+ H(e);
3417
+ }, vn = B({
3386
3418
  id: "trendLine",
3387
3419
  label: "Trend line",
3388
3420
  family: "lines",
@@ -3391,10 +3423,10 @@ var mn = z({
3391
3423
  defaults: () => ({}),
3392
3424
  validate: J,
3393
3425
  shapes: (e, t) => {
3394
- let n = T(t, w(e, 0)), r = T(t, w(e, 1));
3395
- return [O(n, r, Oe(e.style, n, r))];
3426
+ let n = D(t, E(e, 0)), r = D(t, E(e, 1));
3427
+ return [A(n, r, De(e.style, n, r))];
3396
3428
  }
3397
- }), vn = z({
3429
+ }), yn = B({
3398
3430
  id: "ray",
3399
3431
  label: "Ray",
3400
3432
  family: "lines",
@@ -3402,11 +3434,11 @@ var mn = z({
3402
3434
  anchors: 2,
3403
3435
  defaults: () => ({ style: { extendRight: !0 } }),
3404
3436
  validate: J,
3405
- shapes: (e, t) => [O(T(t, w(e, 0)), T(t, w(e, 1)), {
3437
+ shapes: (e, t) => [A(D(t, E(e, 0)), D(t, E(e, 1)), {
3406
3438
  extA: !1,
3407
3439
  extB: !0
3408
3440
  })]
3409
- }), yn = z({
3441
+ }), bn = B({
3410
3442
  id: "extendedLine",
3411
3443
  label: "Extended line",
3412
3444
  family: "lines",
@@ -3417,11 +3449,11 @@ var mn = z({
3417
3449
  extendRight: !0
3418
3450
  } }),
3419
3451
  validate: J,
3420
- shapes: (e, t) => [O(T(t, w(e, 0)), T(t, w(e, 1)), {
3452
+ shapes: (e, t) => [A(D(t, E(e, 0)), D(t, E(e, 1)), {
3421
3453
  extA: !0,
3422
3454
  extB: !0
3423
3455
  })]
3424
- }), bn = z({
3456
+ }), xn = B({
3425
3457
  id: "infoLine",
3426
3458
  label: "Info line",
3427
3459
  family: "lines",
@@ -3430,8 +3462,8 @@ var mn = z({
3430
3462
  defaults: () => ({}),
3431
3463
  validate: J,
3432
3464
  shapes(e, t) {
3433
- let n = w(e, 0), r = w(e, 1), i = T(t, n), a = T(t, r), o = I(n, r, t.source);
3434
- return [O(i, a, Oe(e.style, i, a)), j((i.x + a.x) / 2, (i.y + a.y) / 2 - 8, [...Ne(o, t), `${F(n.time)} → ${F(r.time)}`].join("\n"), {
3465
+ let n = E(e, 0), r = E(e, 1), i = D(t, n), a = D(t, r), o = L(n, r, t.source);
3466
+ return [A(i, a, De(e.style, i, a)), N((i.x + a.x) / 2, (i.y + a.y) / 2 - 8, [...Ne(o, t), `${I(n.time)} → ${I(r.time)}`].join("\n"), {
3435
3467
  align: "center",
3436
3468
  base: "bottom",
3437
3469
  bg: e.style.color,
@@ -3440,7 +3472,7 @@ var mn = z({
3440
3472
  pad: 4
3441
3473
  })];
3442
3474
  }
3443
- }), xn = z({
3475
+ }), Sn = B({
3444
3476
  id: "horizontalLine",
3445
3477
  label: "Horizontal line",
3446
3478
  family: "lines",
@@ -3449,8 +3481,8 @@ var mn = z({
3449
3481
  defaults: () => ({}),
3450
3482
  validate: J,
3451
3483
  shapes(t, n) {
3452
- let r = T(n, w(t, 0)), i = e(r.y, n.dpr, t.style.width);
3453
- return [O({
3484
+ let r = D(n, E(t, 0)), i = e(r.y, n.dpr, t.style.width);
3485
+ return [A({
3454
3486
  x: 0,
3455
3487
  y: i
3456
3488
  }, {
@@ -3459,14 +3491,15 @@ var mn = z({
3459
3491
  }, {
3460
3492
  extA: !0,
3461
3493
  extB: !0
3462
- }), j(n.W - 6, i - 2, n.fmt(w(t, 0).price), {
3494
+ }), N(n.W - 6, i - 2, n.fmt(E(t, 0).price), {
3463
3495
  align: "right",
3464
3496
  base: "bottom",
3465
3497
  textColor: t.style.color,
3466
- hit: !1
3498
+ hit: !1,
3499
+ stack: !0
3467
3500
  })];
3468
3501
  }
3469
- }), Sn = z({
3502
+ }), Cn = 72, wn = B({
3470
3503
  id: "horizontalRay",
3471
3504
  label: "Horizontal ray",
3472
3505
  family: "lines",
@@ -3475,21 +3508,28 @@ var mn = z({
3475
3508
  defaults: () => ({}),
3476
3509
  validate: J,
3477
3510
  shapes(t, n) {
3478
- let r = T(n, w(t, 0)), i = e(r.y, n.dpr, t.style.width);
3479
- return [O({
3511
+ let r = D(n, E(t, 0)), i = e(r.y, n.dpr, t.style.width), a = r.x >= Cn ? N(r.x - 4, i, n.fmt(E(t, 0).price), {
3512
+ align: "right",
3513
+ base: "middle",
3514
+ textColor: t.style.color,
3515
+ hit: !1,
3516
+ stack: !0
3517
+ }) : N(Math.max(r.x, 0) + 4, i - 2, n.fmt(E(t, 0).price), {
3518
+ align: "left",
3519
+ base: "bottom",
3520
+ textColor: t.style.color,
3521
+ hit: !1,
3522
+ stack: !0
3523
+ });
3524
+ return [A({
3480
3525
  x: r.x,
3481
3526
  y: i
3482
3527
  }, {
3483
3528
  x: r.x + 1,
3484
3529
  y: i
3485
- }, { extB: !0 }), j(n.W - 6, i - 2, n.fmt(w(t, 0).price), {
3486
- align: "right",
3487
- base: "bottom",
3488
- textColor: t.style.color,
3489
- hit: !1
3490
- })];
3530
+ }, { extB: !0 }), a];
3491
3531
  }
3492
- }), Cn = z({
3532
+ }), Tn = B({
3493
3533
  id: "verticalLine",
3494
3534
  label: "Vertical line",
3495
3535
  family: "lines",
@@ -3498,8 +3538,8 @@ var mn = z({
3498
3538
  defaults: () => ({}),
3499
3539
  validate: J,
3500
3540
  shapes(t, n) {
3501
- let r = T(n, w(t, 0)), i = e(r.x, n.dpr, t.style.width);
3502
- return [O({
3541
+ let r = D(n, E(t, 0)), i = e(r.x, n.dpr, t.style.width);
3542
+ return [A({
3503
3543
  x: i,
3504
3544
  y: 0
3505
3545
  }, {
@@ -3508,13 +3548,13 @@ var mn = z({
3508
3548
  }, {
3509
3549
  extA: !0,
3510
3550
  extB: !0
3511
- }), j(i + 4, 4, F(w(t, 0).time), {
3551
+ }), N(i + 4, 4, I(E(t, 0).time), {
3512
3552
  base: "top",
3513
3553
  textColor: t.style.color,
3514
3554
  hit: !1
3515
3555
  })];
3516
3556
  }
3517
- }), wn = z({
3557
+ }), En = B({
3518
3558
  id: "crossLine",
3519
3559
  label: "Cross line",
3520
3560
  family: "lines",
@@ -3523,8 +3563,8 @@ var mn = z({
3523
3563
  defaults: () => ({}),
3524
3564
  validate: J,
3525
3565
  shapes(t, n) {
3526
- let r = T(n, w(t, 0)), i = e(r.x, n.dpr, t.style.width), a = e(r.y, n.dpr, t.style.width);
3527
- return [O({
3566
+ let r = D(n, E(t, 0)), i = e(r.x, n.dpr, t.style.width), a = e(r.y, n.dpr, t.style.width);
3567
+ return [A({
3528
3568
  x: 0,
3529
3569
  y: a
3530
3570
  }, {
@@ -3533,7 +3573,7 @@ var mn = z({
3533
3573
  }, {
3534
3574
  extA: !0,
3535
3575
  extB: !0
3536
- }), O({
3576
+ }), A({
3537
3577
  x: i,
3538
3578
  y: 0
3539
3579
  }, {
@@ -3544,22 +3584,22 @@ var mn = z({
3544
3584
  extB: !0
3545
3585
  })];
3546
3586
  }
3547
- }), Tn = [
3548
- _n,
3587
+ }), Dn = [
3549
3588
  vn,
3550
- bn,
3551
3589
  yn,
3552
3590
  xn,
3591
+ bn,
3553
3592
  Sn,
3554
- Cn,
3555
- wn
3593
+ wn,
3594
+ Tn,
3595
+ En
3556
3596
  ];
3557
3597
  //#endregion
3558
3598
  //#region src/tools/measure.ts
3559
- function En(e, t) {
3599
+ function On(e, t) {
3560
3600
  return t < 0 ? "#ef5350" : e.style.color;
3561
3601
  }
3562
- var Dn = (e, t, n, r) => j(e, t, n, {
3602
+ var kn = (e, t, n, r) => N(e, t, n, {
3563
3603
  align: "center",
3564
3604
  base: "middle",
3565
3605
  bg: S(r, .9),
@@ -3567,26 +3607,26 @@ var Dn = (e, t, n, r) => j(e, t, n, {
3567
3607
  pad: 4,
3568
3608
  hit: !1
3569
3609
  });
3570
- function On(e, t) {
3571
- let n = I(w(e, 0), w(e, 1), t.source), r = n.dPrice < 0 ? "-" : n.dPrice > 0 ? "+" : "";
3610
+ function An(e, t) {
3611
+ let n = L(E(e, 0), E(e, 1), t.source), r = n.dPrice < 0 ? "-" : n.dPrice > 0 ? "+" : "";
3572
3612
  return `${r}${t.fmt(Math.abs(n.dPrice))}${n.pct === null ? "" : ` (${r}${Math.abs(n.pct).toFixed(2)}%)`}`;
3573
3613
  }
3574
- function kn(e, t) {
3575
- let n = I(w(e, 0), w(e, 1), t.source);
3614
+ function jn(e, t) {
3615
+ let n = L(E(e, 0), E(e, 1), t.source);
3576
3616
  return [n.bars === null ? "" : `${Me(n.bars)} bars`, Ae(n.dTime)].filter(Boolean).join(", ");
3577
3617
  }
3578
- var An = z({
3618
+ var Mn = B({
3579
3619
  id: "dateRange",
3580
3620
  label: "Date range",
3581
3621
  family: "measure",
3582
3622
  gesture: "drag",
3583
3623
  anchors: 2,
3584
3624
  defaults: () => ({}),
3585
- validate: V,
3625
+ validate: H,
3586
3626
  shapes(e, t) {
3587
- let [n, r] = E(t, e), i = (n.y + r.y) / 2, a = e.style.color;
3627
+ let [n, r] = O(t, e), i = (n.y + r.y) / 2, a = e.style.color;
3588
3628
  return [
3589
- k([
3629
+ j([
3590
3630
  {
3591
3631
  x: n.x,
3592
3632
  y: 0
@@ -3608,7 +3648,7 @@ var An = z({
3608
3648
  fill: S(a, .1),
3609
3649
  width: 0
3610
3650
  }),
3611
- O({
3651
+ A({
3612
3652
  x: n.x,
3613
3653
  y: 0
3614
3654
  }, {
@@ -3618,7 +3658,7 @@ var An = z({
3618
3658
  width: 1,
3619
3659
  color: a
3620
3660
  }),
3621
- O({
3661
+ A({
3622
3662
  x: r.x,
3623
3663
  y: 0
3624
3664
  }, {
@@ -3628,7 +3668,7 @@ var An = z({
3628
3668
  width: 1,
3629
3669
  color: a
3630
3670
  }),
3631
- O({
3671
+ A({
3632
3672
  x: n.x,
3633
3673
  y: i
3634
3674
  }, {
@@ -3638,28 +3678,28 @@ var An = z({
3638
3678
  width: 1,
3639
3679
  color: a
3640
3680
  }),
3641
- M({
3681
+ P({
3642
3682
  x: n.x,
3643
3683
  y: i
3644
3684
  }, {
3645
3685
  x: r.x,
3646
3686
  y: i
3647
3687
  }, 8, a),
3648
- Dn((n.x + r.x) / 2, i - 14, kn(e, t), a)
3688
+ kn((n.x + r.x) / 2, i - 14, jn(e, t), a)
3649
3689
  ];
3650
3690
  }
3651
- }), jn = z({
3691
+ }), Nn = B({
3652
3692
  id: "priceRange",
3653
3693
  label: "Price range",
3654
3694
  family: "measure",
3655
3695
  gesture: "drag",
3656
3696
  anchors: 2,
3657
3697
  defaults: () => ({}),
3658
- validate: V,
3698
+ validate: H,
3659
3699
  shapes(e, t) {
3660
- let [n, r] = E(t, e), i = (n.x + r.x) / 2, a = En(e, w(e, 1).price - w(e, 0).price);
3700
+ let [n, r] = O(t, e), i = (n.x + r.x) / 2, a = On(e, E(e, 1).price - E(e, 0).price);
3661
3701
  return [
3662
- k([
3702
+ j([
3663
3703
  {
3664
3704
  x: 0,
3665
3705
  y: n.y
@@ -3681,7 +3721,7 @@ var An = z({
3681
3721
  fill: S(a, .1),
3682
3722
  width: 0
3683
3723
  }),
3684
- O({
3724
+ A({
3685
3725
  x: 0,
3686
3726
  y: n.y
3687
3727
  }, {
@@ -3693,7 +3733,7 @@ var An = z({
3693
3733
  extA: !0,
3694
3734
  extB: !0
3695
3735
  }),
3696
- O({
3736
+ A({
3697
3737
  x: 0,
3698
3738
  y: r.y
3699
3739
  }, {
@@ -3705,7 +3745,7 @@ var An = z({
3705
3745
  extA: !0,
3706
3746
  extB: !0
3707
3747
  }),
3708
- O({
3748
+ A({
3709
3749
  x: i,
3710
3750
  y: n.y
3711
3751
  }, {
@@ -3715,28 +3755,28 @@ var An = z({
3715
3755
  width: 1,
3716
3756
  color: a
3717
3757
  }),
3718
- M({
3758
+ P({
3719
3759
  x: i,
3720
3760
  y: n.y
3721
3761
  }, {
3722
3762
  x: i,
3723
3763
  y: r.y
3724
3764
  }, 8, a),
3725
- Dn(i, (n.y + r.y) / 2, On(e, t), a)
3765
+ kn(i, (n.y + r.y) / 2, An(e, t), a)
3726
3766
  ];
3727
3767
  }
3728
- }), Mn = z({
3768
+ }), Pn = B({
3729
3769
  id: "dateAndPriceRange",
3730
3770
  label: "Date and price range",
3731
3771
  family: "measure",
3732
3772
  gesture: "drag",
3733
3773
  anchors: 2,
3734
3774
  defaults: () => ({}),
3735
- validate: V,
3775
+ validate: H,
3736
3776
  shapes(e, t) {
3737
- let [n, r] = E(t, e), i = En(e, w(e, 1).price - w(e, 0).price), a = (n.x + r.x) / 2, o = (n.y + r.y) / 2;
3777
+ let [n, r] = O(t, e), i = On(e, E(e, 1).price - E(e, 0).price), a = (n.x + r.x) / 2, o = (n.y + r.y) / 2;
3738
3778
  return [
3739
- k([
3779
+ j([
3740
3780
  n,
3741
3781
  {
3742
3782
  x: r.x,
@@ -3753,7 +3793,7 @@ var An = z({
3753
3793
  color: i,
3754
3794
  width: 1
3755
3795
  }),
3756
- O({
3796
+ A({
3757
3797
  x: a,
3758
3798
  y: n.y
3759
3799
  }, {
@@ -3764,14 +3804,14 @@ var An = z({
3764
3804
  color: i,
3765
3805
  hit: !1
3766
3806
  }),
3767
- M({
3807
+ P({
3768
3808
  x: a,
3769
3809
  y: n.y
3770
3810
  }, {
3771
3811
  x: a,
3772
3812
  y: r.y
3773
3813
  }, 8, i),
3774
- O({
3814
+ A({
3775
3815
  x: n.x,
3776
3816
  y: o
3777
3817
  }, {
@@ -3782,51 +3822,51 @@ var An = z({
3782
3822
  color: i,
3783
3823
  hit: !1
3784
3824
  }),
3785
- M({
3825
+ P({
3786
3826
  x: n.x,
3787
3827
  y: o
3788
3828
  }, {
3789
3829
  x: r.x,
3790
3830
  y: o
3791
3831
  }, 8, i),
3792
- Dn(a, Math.min(n.y, r.y) - 14, `${On(e, t)}\n${kn(e, t)}`, i)
3832
+ kn(a, Math.min(n.y, r.y) - 14, `${An(e, t)}\n${jn(e, t)}`, i)
3793
3833
  ];
3794
3834
  }
3795
- }), Nn = [
3796
- An,
3797
- jn,
3798
- Mn
3835
+ }), Fn = [
3836
+ Mn,
3837
+ Nn,
3838
+ Pn
3799
3839
  ], Y = (e, t) => Math.abs(t.price - e.price);
3800
- function Pn(e, t, n, r, i) {
3840
+ function In(e, t, n, r, i) {
3801
3841
  return {
3802
- abXa: L(Y(t, n), Y(e, t)),
3803
- bcAb: L(Y(n, r), Y(t, n)),
3804
- cdBc: L(Y(r, i), Y(n, r)),
3805
- adXa: L(Y(t, i), Y(e, t))
3842
+ abXa: R(Y(t, n), Y(e, t)),
3843
+ bcAb: R(Y(n, r), Y(t, n)),
3844
+ cdBc: R(Y(r, i), Y(n, r)),
3845
+ adXa: R(Y(t, i), Y(e, t))
3806
3846
  };
3807
3847
  }
3808
- function Fn(e, t, n, r, i) {
3848
+ function Ln(e, t, n, r, i) {
3809
3849
  return {
3810
- abXa: L(Y(t, n), Y(e, t)),
3811
- xcXa: L(Y(e, r), Y(e, t)),
3812
- cdXc: L(Y(r, i), Y(e, r))
3850
+ abXa: R(Y(t, n), Y(e, t)),
3851
+ xcXa: R(Y(e, r), Y(e, t)),
3852
+ cdXc: R(Y(r, i), Y(e, r))
3813
3853
  };
3814
3854
  }
3815
- function In(e, t, n, r) {
3855
+ function Rn(e, t, n, r) {
3816
3856
  return {
3817
- bcAb: L(Y(t, n), Y(e, t)),
3818
- cdBc: L(Y(n, r), Y(t, n))
3857
+ bcAb: R(Y(t, n), Y(e, t)),
3858
+ cdBc: R(Y(n, r), Y(t, n))
3819
3859
  };
3820
3860
  }
3821
- function Ln(e) {
3861
+ function zn(e) {
3822
3862
  if (e.length !== 7) throw RangeError(`three drives needs 7 anchors, got ${e.length}`);
3823
3863
  let t = e;
3824
3864
  return [
3825
- L(Y(t[1], t[2]), Y(t[0], t[1])),
3826
- L(Y(t[2], t[3]), Y(t[1], t[2])),
3827
- L(Y(t[3], t[4]), Y(t[2], t[3])),
3828
- L(Y(t[4], t[5]), Y(t[3], t[4])),
3829
- L(Y(t[5], t[6]), Y(t[4], t[5]))
3865
+ R(Y(t[1], t[2]), Y(t[0], t[1])),
3866
+ R(Y(t[2], t[3]), Y(t[1], t[2])),
3867
+ R(Y(t[3], t[4]), Y(t[2], t[3])),
3868
+ R(Y(t[4], t[5]), Y(t[3], t[4])),
3869
+ R(Y(t[5], t[6]), Y(t[4], t[5]))
3830
3870
  ];
3831
3871
  }
3832
3872
  function X(e, t, n) {
@@ -3835,7 +3875,7 @@ function X(e, t, n) {
3835
3875
  let o = t[a];
3836
3876
  if (!o) return;
3837
3877
  let s = e[a - 1], c = e[a + 1], l = (!s || i.y <= s.y) && (!c || i.y <= c.y);
3838
- r.push(j(i.x, i.y + (l ? -6 : 6), o, {
3878
+ r.push(N(i.x, i.y + (l ? -6 : 6), o, {
3839
3879
  align: "center",
3840
3880
  base: l ? "bottom" : "top",
3841
3881
  textColor: n,
@@ -3848,8 +3888,8 @@ var Z = {
3848
3888
  width: 1,
3849
3889
  hit: !1
3850
3890
  }, Q = (e, t, n, r) => {
3851
- let i = N(e, t);
3852
- return j(i.x, i.y, Pe(n), {
3891
+ let i = F(e, t);
3892
+ return N(i.x, i.y, Pe(n), {
3853
3893
  align: "center",
3854
3894
  base: "middle",
3855
3895
  bg: S(r, .85),
@@ -3858,38 +3898,38 @@ var Z = {
3858
3898
  size: 10,
3859
3899
  hit: !1
3860
3900
  });
3861
- }, Rn = z({
3901
+ }, Bn = B({
3862
3902
  id: "xabcd",
3863
3903
  label: "XABCD pattern",
3864
3904
  family: "patterns",
3865
3905
  gesture: "clicks",
3866
3906
  anchors: 5,
3867
3907
  defaults: () => ({ style: { fill: "rgba(41,98,255,0.12)" } }),
3868
- validate: V,
3908
+ validate: H,
3869
3909
  shapes(e, t) {
3870
- let [n, r, i, a, o] = E(t, e), s = Pn(w(e, 0), w(e, 1), w(e, 2), w(e, 3), w(e, 4)), c = e.style.color;
3910
+ let [n, r, i, a, o] = O(t, e), s = In(E(e, 0), E(e, 1), E(e, 2), E(e, 3), E(e, 4)), c = e.style.color;
3871
3911
  return [
3872
- A([
3912
+ M([
3873
3913
  n,
3874
3914
  r,
3875
3915
  i
3876
3916
  ], e.style.fill ?? S(c, .12)),
3877
- A([
3917
+ M([
3878
3918
  i,
3879
3919
  a,
3880
3920
  o
3881
3921
  ], e.style.fill ?? S(c, .12)),
3882
- k([
3922
+ j([
3883
3923
  n,
3884
3924
  r,
3885
3925
  i,
3886
3926
  a,
3887
3927
  o
3888
3928
  ]),
3889
- O(n, i, Z),
3890
- O(r, a, Z),
3891
- O(i, o, Z),
3892
- O(n, o, Z),
3929
+ A(n, i, Z),
3930
+ A(r, a, Z),
3931
+ A(i, o, Z),
3932
+ A(n, o, Z),
3893
3933
  Q(n, i, s.abXa, c),
3894
3934
  Q(r, a, s.bcAb, c),
3895
3935
  Q(i, o, s.cdBc, c),
@@ -3909,7 +3949,7 @@ var Z = {
3909
3949
  ], c)
3910
3950
  ];
3911
3951
  }
3912
- }), zn = z({
3952
+ }), Vn = B({
3913
3953
  id: "cypher",
3914
3954
  label: "Cypher pattern",
3915
3955
  family: "patterns",
@@ -3919,31 +3959,31 @@ var Z = {
3919
3959
  fill: "rgba(156,39,176,0.12)",
3920
3960
  color: "#9c27b0"
3921
3961
  } }),
3922
- validate: V,
3962
+ validate: H,
3923
3963
  shapes(e, t) {
3924
- let [n, r, i, a, o] = E(t, e), s = Fn(w(e, 0), w(e, 1), w(e, 2), w(e, 3), w(e, 4)), c = e.style.color;
3964
+ let [n, r, i, a, o] = O(t, e), s = Ln(E(e, 0), E(e, 1), E(e, 2), E(e, 3), E(e, 4)), c = e.style.color;
3925
3965
  return [
3926
- A([
3966
+ M([
3927
3967
  n,
3928
3968
  r,
3929
3969
  i
3930
3970
  ], e.style.fill ?? S(c, .12)),
3931
- A([
3971
+ M([
3932
3972
  i,
3933
3973
  a,
3934
3974
  o
3935
3975
  ], e.style.fill ?? S(c, .12)),
3936
- k([
3976
+ j([
3937
3977
  n,
3938
3978
  r,
3939
3979
  i,
3940
3980
  a,
3941
3981
  o
3942
3982
  ]),
3943
- O(n, i, Z),
3944
- O(r, a, Z),
3945
- O(n, a, Z),
3946
- O(i, o, Z),
3983
+ A(n, i, Z),
3984
+ A(r, a, Z),
3985
+ A(n, a, Z),
3986
+ A(i, o, Z),
3947
3987
  Q(n, i, s.abXa, c),
3948
3988
  Q(n, a, s.xcXa, c),
3949
3989
  Q(i, o, s.cdXc, c),
@@ -3962,25 +4002,25 @@ var Z = {
3962
4002
  ], c)
3963
4003
  ];
3964
4004
  }
3965
- }), Bn = z({
4005
+ }), Hn = B({
3966
4006
  id: "abcd",
3967
4007
  label: "ABCD pattern",
3968
4008
  family: "patterns",
3969
4009
  gesture: "clicks",
3970
4010
  anchors: 4,
3971
4011
  defaults: () => ({}),
3972
- validate: V,
4012
+ validate: H,
3973
4013
  shapes(e, t) {
3974
- let [n, r, i, a] = E(t, e), o = In(w(e, 0), w(e, 1), w(e, 2), w(e, 3)), s = e.style.color;
4014
+ let [n, r, i, a] = O(t, e), o = Rn(E(e, 0), E(e, 1), E(e, 2), E(e, 3)), s = e.style.color;
3975
4015
  return [
3976
- k([
4016
+ j([
3977
4017
  n,
3978
4018
  r,
3979
4019
  i,
3980
4020
  a
3981
4021
  ]),
3982
- O(n, i, Z),
3983
- O(r, a, Z),
4022
+ A(n, i, Z),
4023
+ A(r, a, Z),
3984
4024
  Q(n, i, o.bcAb, s),
3985
4025
  Q(r, a, o.cdBc, s),
3986
4026
  ...X([
@@ -3996,34 +4036,34 @@ var Z = {
3996
4036
  ], s)
3997
4037
  ];
3998
4038
  }
3999
- }), Vn = z({
4039
+ }), Un = B({
4000
4040
  id: "trianglePattern",
4001
4041
  label: "Triangle pattern",
4002
4042
  family: "patterns",
4003
4043
  gesture: "clicks",
4004
4044
  anchors: 4,
4005
4045
  defaults: () => ({ style: { fill: "rgba(41,98,255,0.1)" } }),
4006
- validate: V,
4046
+ validate: H,
4007
4047
  shapes(e, t) {
4008
- let [n, r, i, a] = E(t, e), o = e.style.color, s = [
4009
- k([
4048
+ let [n, r, i, a] = O(t, e), o = e.style.color, s = [
4049
+ j([
4010
4050
  n,
4011
4051
  r,
4012
4052
  i,
4013
4053
  a
4014
4054
  ]),
4015
- O(n, i, {
4055
+ A(n, i, {
4016
4056
  extB: !0,
4017
4057
  dash: "dashed",
4018
4058
  width: 1
4019
4059
  }),
4020
- O(r, a, {
4060
+ A(r, a, {
4021
4061
  extB: !0,
4022
4062
  dash: "dashed",
4023
4063
  width: 1
4024
4064
  })
4025
4065
  ], c = _(n, i, r, a);
4026
- return c && c.x > Math.max(i.x, a.x) && s.unshift(A([
4066
+ return c && c.x > Math.max(i.x, a.x) && s.unshift(M([
4027
4067
  n,
4028
4068
  r,
4029
4069
  c
@@ -4039,16 +4079,16 @@ var Z = {
4039
4079
  "D"
4040
4080
  ], o)];
4041
4081
  }
4042
- }), Hn = z({
4082
+ }), Wn = B({
4043
4083
  id: "threeDrives",
4044
4084
  label: "Three drives pattern",
4045
4085
  family: "patterns",
4046
4086
  gesture: "clicks",
4047
4087
  anchors: 7,
4048
4088
  defaults: () => ({}),
4049
- validate: V,
4089
+ validate: H,
4050
4090
  shapes(e, t) {
4051
- let n = E(t, e), r = e.style.color, i = Ln(e.anchors), a = [k(n)];
4091
+ let n = O(t, e), r = e.style.color, i = zn(e.anchors), a = [j(n)];
4052
4092
  return i.forEach((e, t) => a.push(Q(n[t + 1], n[t + 2], e, r))), [...a, ...X(n, [
4053
4093
  "0",
4054
4094
  "1",
@@ -4059,39 +4099,39 @@ var Z = {
4059
4099
  "C"
4060
4100
  ], r)];
4061
4101
  }
4062
- }), Un = z({
4102
+ }), Gn = B({
4063
4103
  id: "headAndShoulders",
4064
4104
  label: "Head and shoulders",
4065
4105
  family: "patterns",
4066
4106
  gesture: "clicks",
4067
4107
  anchors: 7,
4068
4108
  defaults: () => ({ style: { fill: "rgba(239,83,80,0.12)" } }),
4069
- validate: V,
4109
+ validate: H,
4070
4110
  shapes(e, t) {
4071
- let n = E(t, e), [, r, i, a, o, s] = n, c = e.style.color;
4111
+ let n = O(t, e), [, r, i, a, o, s] = n, c = e.style.color;
4072
4112
  return [
4073
- A([
4113
+ M([
4074
4114
  i,
4075
4115
  r,
4076
4116
  a
4077
4117
  ], e.style.fill ?? S(c, .12)),
4078
- A([
4118
+ M([
4079
4119
  i,
4080
4120
  a,
4081
4121
  o
4082
4122
  ], e.style.fill ?? S(c, .12)),
4083
- A([
4123
+ M([
4084
4124
  o,
4085
4125
  a,
4086
4126
  s
4087
4127
  ], e.style.fill ?? S(c, .12)),
4088
- k(n),
4089
- O(i, o, {
4128
+ j(n),
4129
+ A(i, o, {
4090
4130
  extB: !0,
4091
4131
  dash: "dashed",
4092
4132
  width: 1
4093
4133
  }),
4094
- j(o.x + 6, o.y, "Neckline", {
4134
+ N(o.x + 6, o.y, "Neckline", {
4095
4135
  base: "top",
4096
4136
  size: 10,
4097
4137
  textColor: c,
@@ -4109,7 +4149,7 @@ var Z = {
4109
4149
  ];
4110
4150
  }
4111
4151
  });
4112
- function Wn(e, t) {
4152
+ function Kn(e, t) {
4113
4153
  switch (e) {
4114
4154
  case "minuette": return `((${t}))`;
4115
4155
  case "minor": return t;
@@ -4118,7 +4158,7 @@ function Wn(e, t) {
4118
4158
  }
4119
4159
  }
4120
4160
  function $(e, t, n) {
4121
- return z({
4161
+ return B({
4122
4162
  id: e,
4123
4163
  label: t,
4124
4164
  family: "elliott",
@@ -4126,7 +4166,7 @@ function $(e, t, n) {
4126
4166
  anchors: n.length,
4127
4167
  defaults: () => ({ props: { degree: "intermediate" } }),
4128
4168
  validate(t) {
4129
- if (V(t), ![
4169
+ if (H(t), ![
4130
4170
  "minuette",
4131
4171
  "minor",
4132
4172
  "intermediate",
@@ -4134,58 +4174,58 @@ function $(e, t, n) {
4134
4174
  ].includes(t.props.degree)) throw RangeError(`drawings: ${e} "${t.id}" prop "degree" must be minuette, minor, intermediate or primary`);
4135
4175
  },
4136
4176
  shapes(e, t) {
4137
- let r = E(t, e), i = e.props.degree;
4138
- return [k(r), ...X(r, n.map((e) => e ? Wn(i, e) : ""), e.style.color)];
4177
+ let r = O(t, e), i = e.props.degree;
4178
+ return [j(r), ...X(r, n.map((e) => e ? Kn(i, e) : ""), e.style.color)];
4139
4179
  }
4140
4180
  });
4141
4181
  }
4142
- var Gn = $("elliottImpulse", "Elliott impulse wave", [
4182
+ var qn = $("elliottImpulse", "Elliott impulse wave", [
4143
4183
  "",
4144
4184
  "1",
4145
4185
  "2",
4146
4186
  "3",
4147
4187
  "4",
4148
4188
  "5"
4149
- ]), Kn = $("elliottCorrection", "Elliott correction wave", [
4189
+ ]), Jn = $("elliottCorrection", "Elliott correction wave", [
4150
4190
  "",
4151
4191
  "A",
4152
4192
  "B",
4153
4193
  "C"
4154
- ]), qn = $("elliottTriangle", "Elliott triangle wave", [
4194
+ ]), Yn = $("elliottTriangle", "Elliott triangle wave", [
4155
4195
  "",
4156
4196
  "A",
4157
4197
  "B",
4158
4198
  "C",
4159
4199
  "D",
4160
4200
  "E"
4161
- ]), Jn = $("elliottDoubleCombo", "Elliott double combo wave", [
4201
+ ]), Xn = $("elliottDoubleCombo", "Elliott double combo wave", [
4162
4202
  "",
4163
4203
  "W",
4164
4204
  "X",
4165
4205
  "Y"
4166
- ]), Yn = $("elliottTripleCombo", "Elliott triple combo wave", [
4206
+ ]), Zn = $("elliottTripleCombo", "Elliott triple combo wave", [
4167
4207
  "",
4168
4208
  "W",
4169
4209
  "X",
4170
4210
  "Y",
4171
4211
  "X",
4172
4212
  "Z"
4173
- ]), Xn = [
4174
- Rn,
4175
- zn,
4213
+ ]), Qn = [
4176
4214
  Bn,
4177
4215
  Vn,
4178
4216
  Hn,
4179
4217
  Un,
4218
+ Wn,
4180
4219
  Gn,
4181
- Kn,
4182
4220
  qn,
4183
4221
  Jn,
4184
- Yn
4222
+ Yn,
4223
+ Xn,
4224
+ Zn
4185
4225
  ];
4186
4226
  //#endregion
4187
4227
  //#region src/tools/position.ts
4188
- function Zn(e, t, n, r, i = {}) {
4228
+ function $n(e, t, n, r, i = {}) {
4189
4229
  if (!(e === "long" ? n >= t && t >= r : n <= t && t <= r)) throw RangeError(`position: a ${e} needs ${e === "long" ? "target ≥ entry ≥ stop" : "target ≤ entry ≤ stop"}, got target ${n}, entry ${t}, stop ${r}`);
4190
4230
  let a = Math.abs(t - r), o = Math.abs(n - t), s = null;
4191
4231
  if (t === 0) throw RangeError("position: entry price 0 has no percent risk");
@@ -4207,22 +4247,22 @@ function Zn(e, t, n, r, i = {}) {
4207
4247
  loss: s === null ? null : s * a
4208
4248
  };
4209
4249
  }
4210
- var Qn = (e, t, n) => {
4250
+ var er = (e, t, n) => {
4211
4251
  if (e == null) return null;
4212
4252
  if (typeof e != "number" || !Number.isFinite(e)) throw TypeError(`drawings: ${n.tool} "${n.id}" prop "${t}" must be a finite number or null`);
4213
4253
  return e;
4214
4254
  };
4215
- function $n(e, t) {
4216
- return Zn(e, w(t, 0).price, w(t, 1).price, w(t, 2).price, {
4217
- accountSize: Qn(t.props.accountSize, "accountSize", t),
4218
- riskPercent: Qn(t.props.riskPercent, "riskPercent", t) ?? void 0,
4219
- lotSize: Qn(t.props.lotSize, "lotSize", t) ?? void 0
4255
+ function tr(e, t) {
4256
+ return $n(e, E(t, 0).price, E(t, 1).price, E(t, 2).price, {
4257
+ accountSize: er(t.props.accountSize, "accountSize", t),
4258
+ riskPercent: er(t.props.riskPercent, "riskPercent", t) ?? void 0,
4259
+ lotSize: er(t.props.lotSize, "lotSize", t) ?? void 0
4220
4260
  });
4221
4261
  }
4222
- var er = (e) => e.toFixed(2);
4223
- function tr(e) {
4262
+ var nr = (e) => e.toFixed(2);
4263
+ function rr(e) {
4224
4264
  let t = e === "long";
4225
- return z({
4265
+ return B({
4226
4266
  id: t ? "longPosition" : "shortPosition",
4227
4267
  label: t ? "Long position" : "Short position",
4228
4268
  family: "position",
@@ -4234,13 +4274,13 @@ function tr(e) {
4234
4274
  lotSize: 1
4235
4275
  } }),
4236
4276
  validate(t) {
4237
- V(t), $n(e, t);
4277
+ H(t), tr(e, t);
4238
4278
  },
4239
4279
  constrain(e, n) {
4240
4280
  let [r, i, a] = [
4241
- w(e, 0),
4242
- w(e, 1),
4243
- w(e, 2)
4281
+ E(e, 0),
4282
+ E(e, 1),
4283
+ E(e, 2)
4244
4284
  ];
4245
4285
  if (n === 1 || n === 2) {
4246
4286
  let e = n === 1 ? i.time : a.time;
@@ -4249,8 +4289,8 @@ function tr(e) {
4249
4289
  t ? (i.price < r.price && (i.price = r.price), a.price > r.price && (a.price = r.price)) : (i.price > r.price && (i.price = r.price), a.price < r.price && (a.price = r.price));
4250
4290
  },
4251
4291
  shapes(t, n) {
4252
- let r = $n(e, t), [i, a, o] = E(n, t), s = Math.min(i.x, a.x), c = Math.max(i.x, a.x), l = "#26a69a", u = "#ef5350", d = [
4253
- k([
4292
+ let r = tr(e, t), [i, a, o] = O(n, t), s = Math.min(i.x, a.x), c = Math.max(i.x, a.x), l = "#26a69a", u = "#ef5350", d = [
4293
+ j([
4254
4294
  {
4255
4295
  x: s,
4256
4296
  y: i.y
@@ -4272,7 +4312,7 @@ function tr(e) {
4272
4312
  fill: S(l, .2),
4273
4313
  width: 0
4274
4314
  }),
4275
- k([
4315
+ j([
4276
4316
  {
4277
4317
  x: s,
4278
4318
  y: i.y
@@ -4294,45 +4334,45 @@ function tr(e) {
4294
4334
  fill: S(u, .2),
4295
4335
  width: 0
4296
4336
  }),
4297
- O({
4337
+ A({
4298
4338
  x: s,
4299
4339
  y: i.y
4300
4340
  }, {
4301
4341
  x: c,
4302
4342
  y: i.y
4303
4343
  }, { color: t.style.color }),
4304
- O({
4344
+ A({
4305
4345
  x: s,
4306
4346
  y: a.y
4307
4347
  }, {
4308
4348
  x: c,
4309
4349
  y: a.y
4310
4350
  }, { color: l }),
4311
- O({
4351
+ A({
4312
4352
  x: s,
4313
4353
  y: o.y
4314
4354
  }, {
4315
4355
  x: c,
4316
4356
  y: o.y
4317
4357
  }, { color: u })
4318
- ], f = (e) => `${e < 0 ? "-" : e > 0 ? "+" : ""}${n.fmt(Math.abs(e))}`, p = w(t, 1).price - w(t, 0).price, m = w(t, 2).price - w(t, 0).price, h = [`Target ${n.fmt(w(t, 1).price)} (${f(p)}, ${r.rewardPct.toFixed(2)}%)`];
4319
- r.profit !== null && h.push(`P&L ${er(r.profit)}`);
4320
- let g = [`Stop ${n.fmt(w(t, 2).price)} (${f(m)}, ${r.riskPct.toFixed(2)}%)`];
4321
- r.loss !== null && g.push(`P&L -${er(r.loss)}`);
4358
+ ], f = (e) => `${e < 0 ? "-" : e > 0 ? "+" : ""}${n.fmt(Math.abs(e))}`, p = E(t, 1).price - E(t, 0).price, m = E(t, 2).price - E(t, 0).price, h = [`Target ${n.fmt(E(t, 1).price)} (${f(p)}, ${r.rewardPct.toFixed(2)}%)`];
4359
+ r.profit !== null && h.push(`P&L ${nr(r.profit)}`);
4360
+ let g = [`Stop ${n.fmt(E(t, 2).price)} (${f(m)}, ${r.riskPct.toFixed(2)}%)`];
4361
+ r.loss !== null && g.push(`P&L -${nr(r.loss)}`);
4322
4362
  let _ = (s + c) / 2;
4323
- d.push(j(_, (i.y + a.y) / 2, h.join("\n"), {
4363
+ d.push(N(_, (i.y + a.y) / 2, h.join("\n"), {
4324
4364
  align: "center",
4325
4365
  base: "middle",
4326
4366
  textColor: l,
4327
4367
  hit: !1
4328
- })), d.push(j(_, (i.y + o.y) / 2, g.join("\n"), {
4368
+ })), d.push(N(_, (i.y + o.y) / 2, g.join("\n"), {
4329
4369
  align: "center",
4330
4370
  base: "middle",
4331
4371
  textColor: u,
4332
4372
  hit: !1
4333
4373
  }));
4334
- let ee = [`Entry ${n.fmt(w(t, 0).price)}`, r.rr === null ? "R:R n/a" : `R:R ${r.rr.toFixed(2)}`];
4335
- return r.qty !== null && ee.push(`Qty ${r.qty}`), d.push(j(_, i.y, ee.join(" "), {
4374
+ let ee = [`Entry ${n.fmt(E(t, 0).price)}`, r.rr === null ? "R:R n/a" : `R:R ${r.rr.toFixed(2)}`];
4375
+ return r.qty !== null && ee.push(`Qty ${r.qty}`), d.push(N(_, i.y, ee.join(" "), {
4336
4376
  align: "center",
4337
4377
  base: "middle",
4338
4378
  bg: S(t.style.color, .9),
@@ -4343,18 +4383,18 @@ function tr(e) {
4343
4383
  }
4344
4384
  });
4345
4385
  }
4346
- var nr = tr("long"), rr = tr("short"), ir = z({
4386
+ var ir = rr("long"), ar = rr("short"), or = B({
4347
4387
  id: "forecast",
4348
4388
  label: "Forecast",
4349
4389
  family: "position",
4350
4390
  gesture: "drag",
4351
4391
  anchors: 2,
4352
4392
  defaults: () => ({ style: { fill: "rgba(41,98,255,0.15)" } }),
4353
- validate: V,
4393
+ validate: H,
4354
4394
  shapes(e, t) {
4355
- let [n, r] = [w(e, 0), w(e, 1)], [i, a] = [T(t, n), T(t, r)], o = I(n, r, t.source);
4395
+ let [n, r] = [E(e, 0), E(e, 1)], [i, a] = [D(t, n), D(t, r)], o = L(n, r, t.source);
4356
4396
  return [
4357
- A([
4397
+ M([
4358
4398
  i,
4359
4399
  {
4360
4400
  x: a.x,
@@ -4362,7 +4402,7 @@ var nr = tr("long"), rr = tr("short"), ir = z({
4362
4402
  },
4363
4403
  a
4364
4404
  ], e.style.fill ?? S(e.style.color, .15)),
4365
- O(i, {
4405
+ A(i, {
4366
4406
  x: a.x,
4367
4407
  y: i.y
4368
4408
  }, {
@@ -4370,7 +4410,7 @@ var nr = tr("long"), rr = tr("short"), ir = z({
4370
4410
  width: 1,
4371
4411
  hit: !1
4372
4412
  }),
4373
- O({
4413
+ A({
4374
4414
  x: a.x,
4375
4415
  y: i.y
4376
4416
  }, a, {
@@ -4378,7 +4418,7 @@ var nr = tr("long"), rr = tr("short"), ir = z({
4378
4418
  width: 1,
4379
4419
  hit: !1
4380
4420
  }),
4381
- O(i, a, { dash: "dashed" }),
4421
+ A(i, a, { dash: "dashed" }),
4382
4422
  {
4383
4423
  k: "ellipse",
4384
4424
  cx: a.x,
@@ -4388,7 +4428,7 @@ var nr = tr("long"), rr = tr("short"), ir = z({
4388
4428
  fill: e.style.color,
4389
4429
  width: 1
4390
4430
  },
4391
- j(a.x + 8, a.y, Ne(o, t).join("\n"), {
4431
+ N(a.x + 8, a.y, Ne(o, t).join("\n"), {
4392
4432
  align: "left",
4393
4433
  base: "middle",
4394
4434
  bg: e.style.color,
@@ -4399,35 +4439,35 @@ var nr = tr("long"), rr = tr("short"), ir = z({
4399
4439
  ];
4400
4440
  }
4401
4441
  });
4402
- function ar(e, t, n) {
4442
+ function sr(e, t, n) {
4403
4443
  return n.price + (t.price - e.price);
4404
4444
  }
4405
- var or = z({
4445
+ var cr = B({
4406
4446
  id: "projection",
4407
4447
  label: "Projection",
4408
4448
  family: "position",
4409
4449
  gesture: "clicks",
4410
4450
  anchors: 3,
4411
4451
  defaults: () => ({}),
4412
- validate: V,
4452
+ validate: H,
4413
4453
  shapes(e, t) {
4414
4454
  let [n, r, i] = [
4415
- w(e, 0),
4416
- w(e, 1),
4417
- w(e, 2)
4418
- ], [a, o, s] = E(t, e), c = {
4455
+ E(e, 0),
4456
+ E(e, 1),
4457
+ E(e, 2)
4458
+ ], [a, o, s] = O(t, e), c = {
4419
4459
  x: s.x + (o.x - a.x),
4420
- y: t.Y(ar(n, r, i))
4460
+ y: t.Y(sr(n, r, i))
4421
4461
  };
4422
4462
  return [
4423
- O(a, o),
4424
- O(s, c, { dash: "dashed" }),
4425
- O(a, s, {
4463
+ A(a, o),
4464
+ A(s, c, { dash: "dashed" }),
4465
+ A(a, s, {
4426
4466
  dash: "dotted",
4427
4467
  width: 1,
4428
4468
  hit: !1
4429
4469
  }),
4430
- O(o, c, {
4470
+ A(o, c, {
4431
4471
  dash: "dotted",
4432
4472
  width: 1,
4433
4473
  hit: !1
@@ -4441,7 +4481,7 @@ var or = z({
4441
4481
  fill: e.style.color,
4442
4482
  width: 1
4443
4483
  },
4444
- j(c.x + 6, c.y, t.fmt(ar(n, r, i)), {
4484
+ N(c.x + 6, c.y, t.fmt(sr(n, r, i)), {
4445
4485
  align: "left",
4446
4486
  base: "middle",
4447
4487
  textColor: e.style.color,
@@ -4449,12 +4489,12 @@ var or = z({
4449
4489
  })
4450
4490
  ];
4451
4491
  }
4452
- }), sr = "#26a69a", cr = "#ef5350";
4453
- function lr(e, t, n, r, i, a, o) {
4454
- let s = a >= n ? sr : cr;
4492
+ }), lr = "#26a69a", ur = "#ef5350";
4493
+ function dr(e, t, n, r, i, a, o) {
4494
+ let s = a >= n ? lr : ur;
4455
4495
  if (o) {
4456
4496
  let o = Math.min(n, a), c = Math.max(n, a);
4457
- return [O({
4497
+ return [A({
4458
4498
  x: e,
4459
4499
  y: r
4460
4500
  }, {
@@ -4463,7 +4503,7 @@ function lr(e, t, n, r, i, a, o) {
4463
4503
  }, {
4464
4504
  color: s,
4465
4505
  width: 1
4466
- }), k([
4506
+ }), j([
4467
4507
  {
4468
4508
  x: e - t,
4469
4509
  y: o
@@ -4488,7 +4528,7 @@ function lr(e, t, n, r, i, a, o) {
4488
4528
  })];
4489
4529
  }
4490
4530
  return [
4491
- O({
4531
+ A({
4492
4532
  x: e,
4493
4533
  y: r
4494
4534
  }, {
@@ -4498,7 +4538,7 @@ function lr(e, t, n, r, i, a, o) {
4498
4538
  color: s,
4499
4539
  width: 1
4500
4540
  }),
4501
- O({
4541
+ A({
4502
4542
  x: e - t,
4503
4543
  y: n
4504
4544
  }, {
@@ -4508,7 +4548,7 @@ function lr(e, t, n, r, i, a, o) {
4508
4548
  color: s,
4509
4549
  width: 1
4510
4550
  }),
4511
- O({
4551
+ A({
4512
4552
  x: e,
4513
4553
  y: a
4514
4554
  }, {
@@ -4520,12 +4560,12 @@ function lr(e, t, n, r, i, a, o) {
4520
4560
  })
4521
4561
  ];
4522
4562
  }
4523
- function ur(e, t) {
4563
+ function fr(e, t) {
4524
4564
  if (!e.source) throw Error(`${t} needs a BarSource`);
4525
4565
  return e.source;
4526
4566
  }
4527
- function dr(e, t, n) {
4528
- let r = ur(e, n), i = w(t, 0).time, a = w(t, 1).time, [o, s] = r.range(Math.min(i, a), Math.max(i, a));
4567
+ function pr(e, t, n) {
4568
+ let r = fr(e, n), i = E(t, 0).time, a = E(t, 1).time, [o, s] = r.range(Math.min(i, a), Math.max(i, a));
4529
4569
  if (s <= o) throw RangeError(`${n} "${t.id}": no bars between the first two anchors`);
4530
4570
  return {
4531
4571
  src: r,
@@ -4533,7 +4573,7 @@ function dr(e, t, n) {
4533
4573
  hi: s
4534
4574
  };
4535
4575
  }
4536
- function fr(e, t) {
4576
+ function mr(e, t) {
4537
4577
  let n = e[0];
4538
4578
  if (!n) throw RangeError("patternBars: no bars");
4539
4579
  let r = t - n.close;
@@ -4545,7 +4585,7 @@ function fr(e, t) {
4545
4585
  close: e.close + r
4546
4586
  }));
4547
4587
  }
4548
- var pr = z({
4588
+ var hr = B({
4549
4589
  id: "barsPattern",
4550
4590
  label: "Bars pattern",
4551
4591
  family: "position",
@@ -4553,12 +4593,12 @@ var pr = z({
4553
4593
  anchors: 3,
4554
4594
  needsSource: !0,
4555
4595
  defaults: () => ({}),
4556
- validate: V,
4596
+ validate: H,
4557
4597
  shapes(e, t) {
4558
- let { src: n, lo: r, hi: i } = dr(t, e, "barsPattern"), a = [];
4598
+ let { src: n, lo: r, hi: i } = pr(t, e, "barsPattern"), a = [];
4559
4599
  for (let e = r; e < i; e++) a.push(n.at(e));
4560
- let o = fr(a, w(e, 2).price), s = t.X(a[0].time), c = t.X(w(e, 2).time), l = Math.max(1, (a.length > 1 ? Math.abs(t.X(a[1].time) - s) : 6) * .35), u = [], d = t.X(w(e, 0).time), f = t.X(w(e, 1).time);
4561
- u.push(O({
4600
+ let o = mr(a, E(e, 2).price), s = t.X(a[0].time), c = t.X(E(e, 2).time), l = Math.max(1, (a.length > 1 ? Math.abs(t.X(a[1].time) - s) : 6) * .35), u = [], d = t.X(E(e, 0).time), f = t.X(E(e, 1).time);
4601
+ u.push(A({
4562
4602
  x: d,
4563
4603
  y: 0
4564
4604
  }, {
@@ -4569,7 +4609,7 @@ var pr = z({
4569
4609
  width: 1,
4570
4610
  extA: !0,
4571
4611
  extB: !0
4572
- }), O({
4612
+ }), A({
4573
4613
  x: f,
4574
4614
  y: 0
4575
4615
  }, {
@@ -4583,12 +4623,12 @@ var pr = z({
4583
4623
  }));
4584
4624
  for (let e = 0; e < o.length; e++) {
4585
4625
  let n = o[e], r = c + (t.X(a[e].time) - s);
4586
- u.push(...lr(r, l, t.Y(n.open), t.Y(n.high), t.Y(n.low), t.Y(n.close), !1));
4626
+ u.push(...dr(r, l, t.Y(n.open), t.Y(n.high), t.Y(n.low), t.Y(n.close), !1));
4587
4627
  }
4588
4628
  return u;
4589
4629
  }
4590
4630
  });
4591
- function mr(e) {
4631
+ function gr(e) {
4592
4632
  let t = e >>> 0;
4593
4633
  return () => {
4594
4634
  t = t + 1831565813 >>> 0;
@@ -4596,9 +4636,9 @@ function mr(e) {
4596
4636
  return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
4597
4637
  };
4598
4638
  }
4599
- function hr(e, t, n, r) {
4639
+ function _r(e, t, n, r) {
4600
4640
  if (e.length === 0) throw RangeError("ghostBars: no history to sample");
4601
- let i = mr(r), a = [], o = t;
4641
+ let i = gr(r), a = [], o = t;
4602
4642
  for (let t = 0; t < n; t++) {
4603
4643
  let t = e[Math.floor(i() * e.length)], n = o, r = n + (t.close - t.open);
4604
4644
  a.push({
@@ -4610,7 +4650,7 @@ function hr(e, t, n, r) {
4610
4650
  }
4611
4651
  return a;
4612
4652
  }
4613
- var gr = z({
4653
+ var vr = B({
4614
4654
  id: "ghostFeed",
4615
4655
  label: "Ghost feed (resampled bars)",
4616
4656
  family: "position",
@@ -4622,35 +4662,35 @@ var gr = z({
4622
4662
  count: 30
4623
4663
  } }),
4624
4664
  validate(e) {
4625
- V(e);
4665
+ H(e);
4626
4666
  let t = e.props.count, n = e.props.seed;
4627
4667
  if (typeof t != "number" || !Number.isInteger(t) || t < 1 || t > 5e3) throw RangeError(`drawings: ghostFeed "${e.id}" prop "count" must be an integer in 1..5000`);
4628
4668
  if (typeof n != "number" || !Number.isInteger(n)) throw RangeError(`drawings: ghostFeed "${e.id}" prop "seed" must be an integer`);
4629
4669
  },
4630
4670
  shapes(e, t) {
4631
- let { src: n, lo: r, hi: i } = dr(t, e, "ghostFeed"), a = [];
4671
+ let { src: n, lo: r, hi: i } = pr(t, e, "ghostFeed"), a = [];
4632
4672
  for (let e = r; e < i; e++) a.push(n.at(e));
4633
- let o = hr(a, w(e, 2).price, e.props.count, e.props.seed), s = w(e, 2).time, c = Math.max(1, Math.abs(t.X(s + n.interval) - t.X(s)) * .35), l = [];
4634
- o.forEach((e, r) => l.push(...lr(t.X(s + r * n.interval), c, t.Y(e.open), t.Y(e.high), t.Y(e.low), t.Y(e.close), !0)));
4635
- let u = T(t, w(e, 2));
4636
- return l.push(j(u.x, u.y - 6, "ghost feed", {
4673
+ let o = _r(a, E(e, 2).price, e.props.count, e.props.seed), s = E(e, 2).time, c = Math.max(1, Math.abs(t.X(s + n.interval) - t.X(s)) * .35), l = [];
4674
+ o.forEach((e, r) => l.push(...dr(t.X(s + r * n.interval), c, t.Y(e.open), t.Y(e.high), t.Y(e.low), t.Y(e.close), !0)));
4675
+ let u = D(t, E(e, 2));
4676
+ return l.push(N(u.x, u.y - 6, "ghost feed", {
4637
4677
  base: "bottom",
4638
4678
  size: 10,
4639
4679
  textColor: e.style.color,
4640
4680
  hit: !1
4641
4681
  })), l;
4642
4682
  }
4643
- }), _r = [
4644
- nr,
4645
- rr,
4683
+ }), yr = [
4646
4684
  ir,
4685
+ ar,
4647
4686
  or,
4648
- pr,
4649
- gr
4687
+ cr,
4688
+ hr,
4689
+ vr
4650
4690
  ];
4651
4691
  //#endregion
4652
4692
  //#region src/tools/volume.ts
4653
- function vr(e, t) {
4693
+ function br(e, t) {
4654
4694
  if (!Number.isInteger(t) || t < 0 || t >= e.length) throw RangeError(`anchoredVwap: start ${t} outside 0..${e.length - 1}`);
4655
4695
  let n = e.length - t, r = new Float64Array(n), i = new Float64Array(n), a = 0, o = 0;
4656
4696
  for (let s = 0; s < n; s++) {
@@ -4662,24 +4702,24 @@ function vr(e, t) {
4662
4702
  values: i
4663
4703
  };
4664
4704
  }
4665
- function yr(e, t) {
4705
+ function xr(e, t) {
4666
4706
  if (e.length === 0) return null;
4667
4707
  let [n, r] = e.range(t, t);
4668
4708
  return r > n ? n : n >= e.length ? null : Math.max(0, n - 1);
4669
4709
  }
4670
- var br = /* @__PURE__ */ new WeakMap();
4671
- function xr(e, t) {
4672
- let n = br.get(e);
4673
- n || br.set(e, n = /* @__PURE__ */ new Map());
4710
+ var Sr = /* @__PURE__ */ new WeakMap();
4711
+ function Cr(e, t) {
4712
+ let n = Sr.get(e);
4713
+ n || Sr.set(e, n = /* @__PURE__ */ new Map());
4674
4714
  let r = n.get(t);
4675
4715
  if (r && r.version === e.version) return r.series;
4676
- let i = vr(e, t);
4716
+ let i = br(e, t);
4677
4717
  return n.size > 64 && n.clear(), n.set(t, {
4678
4718
  version: e.version,
4679
4719
  series: i
4680
4720
  }), i;
4681
4721
  }
4682
- var Sr = z({
4722
+ var wr = B({
4683
4723
  id: "anchoredVwap",
4684
4724
  label: "Anchored VWAP",
4685
4725
  family: "volume",
@@ -4687,10 +4727,10 @@ var Sr = z({
4687
4727
  anchors: 1,
4688
4728
  needsSource: !0,
4689
4729
  defaults: () => ({ style: { color: "#ff9800" } }),
4690
- validate: V,
4730
+ validate: H,
4691
4731
  shapes(e, t) {
4692
4732
  if (!t.source) throw Error("anchoredVwap needs a BarSource");
4693
- let n = T(t, w(e, 0)), r = [{
4733
+ let n = D(t, E(e, 0)), r = [{
4694
4734
  k: "ellipse",
4695
4735
  cx: n.x,
4696
4736
  cy: n.y,
@@ -4698,9 +4738,9 @@ var Sr = z({
4698
4738
  ry: 4,
4699
4739
  fill: e.style.color,
4700
4740
  width: 1
4701
- }], i = yr(t.source, w(e, 0).time);
4741
+ }], i = xr(t.source, E(e, 0).time);
4702
4742
  if (i === null) return r;
4703
- let a = xr(t.source, i), o = t.T(-2), s = t.T(t.W + 2), c = (e) => {
4743
+ let a = Cr(t.source, i), o = t.T(-2), s = t.T(t.W + 2), c = (e) => {
4704
4744
  let t = 0, n = a.times.length;
4705
4745
  for (; t < n;) {
4706
4746
  let r = t + n >> 1;
@@ -4715,7 +4755,7 @@ var Sr = z({
4715
4755
  }), r;
4716
4756
  }
4717
4757
  });
4718
- function Cr(e, t, n, r) {
4758
+ function Tr(e, t, n, r) {
4719
4759
  if (!Number.isInteger(r) || r < 1) throw RangeError(`volumeProfile: rows must be a positive integer, got ${r}`);
4720
4760
  if (n <= t) throw RangeError("volumeProfile: no bars in the range");
4721
4761
  let i = Infinity, a = -Infinity;
@@ -4748,12 +4788,12 @@ function Cr(e, t, n, r) {
4748
4788
  poc: l
4749
4789
  };
4750
4790
  }
4751
- function wr(e, t) {
4752
- let [n, r] = t.range(Math.min(w(e, 0).time, w(e, 1).time), Math.max(w(e, 0).time, w(e, 1).time));
4791
+ function Er(e, t) {
4792
+ let [n, r] = t.range(Math.min(E(e, 0).time, E(e, 1).time), Math.max(E(e, 0).time, E(e, 1).time));
4753
4793
  if (r <= n) throw RangeError(`drawings: volumeProfile "${e.id}" has no bars between its anchors`);
4754
4794
  return [n, r];
4755
4795
  }
4756
- var Tr = z({
4796
+ var Dr = B({
4757
4797
  id: "volumeProfile",
4758
4798
  label: "Fixed range volume profile (bar-level approximation)",
4759
4799
  family: "volume",
@@ -4762,13 +4802,13 @@ var Tr = z({
4762
4802
  needsSource: !0,
4763
4803
  defaults: () => ({ props: { rows: 24 } }),
4764
4804
  validate(e) {
4765
- V(e), B(e, 0, 1);
4805
+ H(e), V(e, 0, 1);
4766
4806
  let t = e.props.rows;
4767
4807
  if (typeof t != "number" || !Number.isInteger(t) || t < 1 || t > 500) throw RangeError(`drawings: volumeProfile "${e.id}" prop "rows" must be an integer in 1..500`);
4768
4808
  },
4769
4809
  shapes(e, t) {
4770
4810
  if (!t.source) throw Error("volumeProfile needs a BarSource");
4771
- let [n, r] = wr(e, t.source), i = e.props.rows, a = Cr(t.source, n, r, i), o = t.X(w(e, 0).time), s = t.X(w(e, 1).time), c = Math.min(o, s), l = Math.max(o, s), u = (l - c) * .6, d = a.volumes[a.poc], f = [O({
4811
+ let [n, r] = Er(e, t.source), i = e.props.rows, a = Tr(t.source, n, r, i), o = t.X(E(e, 0).time), s = t.X(E(e, 1).time), c = Math.min(o, s), l = Math.max(o, s), u = (l - c) * .6, d = a.volumes[a.poc], f = [A({
4772
4812
  x: c,
4773
4813
  y: 0
4774
4814
  }, {
@@ -4779,7 +4819,7 @@ var Tr = z({
4779
4819
  width: 1,
4780
4820
  extA: !0,
4781
4821
  extB: !0
4782
- }), O({
4822
+ }), A({
4783
4823
  x: l,
4784
4824
  y: 0
4785
4825
  }, {
@@ -4811,32 +4851,32 @@ var Tr = z({
4811
4851
  y: o
4812
4852
  }
4813
4853
  ];
4814
- f.push(k(l, {
4854
+ f.push(j(l, {
4815
4855
  close: !0,
4816
4856
  fill: S(r === a.poc ? "#ff9800" : e.style.color, r === a.poc ? .6 : .35),
4817
4857
  width: 0
4818
4858
  }));
4819
- }), f.push(j(c + 4, 4, "Volume profile (bar-level approximation)", {
4859
+ }), f.push(N(c + 4, 4, "Volume profile (bar-level approximation)", {
4820
4860
  base: "top",
4821
4861
  size: 10,
4822
4862
  textColor: e.style.color,
4823
4863
  hit: !1
4824
4864
  })), f;
4825
4865
  }
4826
- }), Er = [Sr, Tr], Dr = [
4827
- ...Tn,
4866
+ }), Or = [wr, Dr], kr = [
4867
+ ...Dn,
4828
4868
  ...gt,
4829
4869
  ...Vt,
4830
- ...gn,
4831
- ...nn,
4870
+ ..._n,
4871
+ ...rn,
4832
4872
  ...tt,
4833
- ..._r,
4834
- ...Nn,
4835
- ...Xn,
4873
+ ...yr,
4874
+ ...Fn,
4875
+ ...Qn,
4836
4876
  ...wt,
4837
- ...Er
4877
+ ...Or
4838
4878
  ];
4839
4879
  //#endregion
4840
- export { y as AddCommand, Ee as ArrayBarSource, ie as BatchCommand, ye as DEFAULT_STYLE, xe as DRAG_SLOP, we as DUPLICATE_BARS, te as DrawingStore, Te as DrawingsPlugin, Dt as FIB_SEQUENCE, sn as GANN_RATIOS, ae as History, b as PatchCommand, ne as RemoveCommand, re as ReorderCommand, be as SCHEMA_VERSION, Se as TOLERANCE, ve as TemplateStore, Ce as WEAK_MAGNET_PX, Bn as abcd, In as abcdRatios, Dr as allTools, Ue as anchoredNote, Be as anchoredText, vr as anchoredVwap, Sr as anchoredVwapTool, tt as annotationTools, Yt as arc, Jt as arcThrough, Xe as arrow, et as arrowMarkDown, $e as arrowMarkUp, Ze as arrowMarker, pr as barsPattern, en as brush, We as callout, gt as channelTools, Kt as circle, Ge as comment, wn as crossLine, Xt as curve, wt as cycleTools, bt as cyclicLines, zn as cypher, Fn as cypherRatios, Mn as dateAndPriceRange, An as dateRange, lt as disjointChannel, Zt as doubleCurve, pe as drawShapes, Ln as driveRatios, Kn as elliottCorrection, Jn as elliottDoubleCombo, Gn as elliottImpulse, qn as elliottTriangle, Yn as elliottTripleCombo, Gt as ellipse, yn as extendedLine, jt as fibChannel, It as fibCircles, At as fibExtension, Et as fibExtensionPrice, kt as fibRetracement, Tt as fibRetracementPrice, zt as fibSpeedArcs, Pt as fibSpeedFan, Lt as fibSpiral, Mt as fibTimeZone, Vt as fibTools, Ft as fibTrendTime, Bt as fibWedge, nn as figureTools, Ye as flagMark, ct as flatTopBottom, Ae as fmtDuration, F as fmtTime, ir as forecast, ut as forkGeometry, ln as gannBox, an as gannBoxPrice, hn as gannFan, on as gannFanPrice, fn as gannSquare, mn as gannSquareFixed, gn as gannTools, o as geometry, hr as ghostBars, gr as ghostFeed, Un as headAndShoulders, tn as highlighter, xn as horizontalLine, Sn as horizontalRay, bn as infoLine, mt as insidePitchfork, Tn as lineTools, nr as longPosition, I as measure, Nn as measureTools, pt as modifiedSchiffPitchfork, He as note, it as parallelChannel, $t as path, fr as patternBars, Xn as patternTools, ht as pitchfan, dt as pitchfork, Qt as polyline, Zn as positionStats, _r as positionTools, Ke as priceLabel, qe as priceNote, jn as priceRange, or as projection, ar as projectionTarget, vn as ray, Ht as rectangle, at as regression, ot as regressionOf, st as regressionTrendChannel, Ut as rotatedRectCorners, Wt as rotatedRectangle, ft as schiffPitchfork, mr as seeded, he as shapeDistance, ge as shapeInRect, rr as shortPosition, Je as signpost, Ct as sineLine, St as sineY, yr as startIndex, ze as textTool, Hn as threeDrives, xt as timeCycles, _n as trendLine, qt as triangle, Vn as trianglePattern, Cn as verticalLine, Cr as volumeProfile, Tr as volumeProfileTool, Er as volumeTools, Wn as waveLabel, S as withAlpha, Rn as xabcd, Pn as xabcdRatios };
4880
+ export { y as AddCommand, Te as ArrayBarSource, ie as BatchCommand, T as DEFAULT_STYLE, be as DRAG_SLOP, Ce as DUPLICATE_BARS, te as DrawingStore, we as DrawingsPlugin, Dt as FIB_SEQUENCE, cn as GANN_RATIOS, ae as History, b as PatchCommand, ne as RemoveCommand, re as ReorderCommand, ye as SCHEMA_VERSION, xe as TOLERANCE, ve as TemplateStore, Se as WEAK_MAGNET_PX, Hn as abcd, Rn as abcdRatios, kr as allTools, Ue as anchoredNote, Be as anchoredText, br as anchoredVwap, wr as anchoredVwapTool, tt as annotationTools, Xt as arc, Yt as arcThrough, Xe as arrow, et as arrowMarkDown, $e as arrowMarkUp, Ze as arrowMarker, hr as barsPattern, tn as brush, We as callout, gt as channelTools, qt as circle, Ge as comment, En as crossLine, Zt as curve, wt as cycleTools, bt as cyclicLines, Vn as cypher, Ln as cypherRatios, Pn as dateAndPriceRange, Mn as dateRange, le as declutter, lt as disjointChannel, Qt as doubleCurve, pe as drawShapes, zn as driveRatios, Jn as elliottCorrection, Xn as elliottDoubleCombo, qn as elliottImpulse, Yn as elliottTriangle, Zn as elliottTripleCombo, Kt as ellipse, bn as extendedLine, jt as fibChannel, It as fibCircles, At as fibExtension, Et as fibExtensionPrice, kt as fibRetracement, Tt as fibRetracementPrice, zt as fibSpeedArcs, Pt as fibSpeedFan, Lt as fibSpiral, Mt as fibTimeZone, Vt as fibTools, Ft as fibTrendTime, Bt as fibWedge, rn as figureTools, Ye as flagMark, ct as flatTopBottom, Ae as fmtDuration, I as fmtTime, or as forecast, ut as forkGeometry, un as gannBox, on as gannBoxPrice, gn as gannFan, sn as gannFanPrice, pn as gannSquare, hn as gannSquareFixed, _n as gannTools, o as geometry, _r as ghostBars, vr as ghostFeed, Gn as headAndShoulders, nn as highlighter, Sn as horizontalLine, wn as horizontalRay, xn as infoLine, mt as insidePitchfork, Dn as lineTools, ir as longPosition, L as measure, Fn as measureTools, pt as modifiedSchiffPitchfork, He as note, it as parallelChannel, en as path, mr as patternBars, Qn as patternTools, ht as pitchfan, dt as pitchfork, $t as polyline, $n as positionStats, yr as positionTools, Ke as priceLabel, qe as priceNote, Nn as priceRange, cr as projection, sr as projectionTarget, yn as ray, Ut as rectangle, at as regression, ot as regressionOf, st as regressionTrendChannel, Wt as rotatedRectCorners, Gt as rotatedRectangle, ft as schiffPitchfork, gr as seeded, he as shapeDistance, ge as shapeInRect, ar as shortPosition, Je as signpost, Ct as sineLine, St as sineY, xr as startIndex, ze as textTool, Wn as threeDrives, xt as timeCycles, vn as trendLine, Jt as triangle, Un as trianglePattern, Tn as verticalLine, Tr as volumeProfile, Dr as volumeProfileTool, Or as volumeTools, Kn as waveLabel, S as withAlpha, Bn as xabcd, In as xabcdRatios };
4841
4881
 
4842
4882
  //# sourceMappingURL=index.js.map