@tradecanvas/commons 1.1.0 → 1.3.0
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/LICENSE +21 -21
- package/README.md +67 -67
- package/dist/constants/themes.d.ts +29 -0
- package/dist/constants/themes.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +138 -114
- package/dist/index.js.map +1 -1
- package/dist/types/chart.d.ts +19 -1
- package/dist/types/chart.d.ts.map +1 -1
- package/dist/types/drawing.d.ts +1 -1
- package/dist/types/drawing.d.ts.map +1 -1
- package/dist/types/finance.d.ts +11 -0
- package/dist/types/finance.d.ts.map +1 -1
- package/dist/types/indicator.d.ts +11 -0
- package/dist/types/indicator.d.ts.map +1 -1
- package/dist/types/rendering.d.ts +16 -2
- package/dist/types/rendering.d.ts.map +1 -1
- package/dist/utils/precision.d.ts +7 -0
- package/dist/utils/precision.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
//#region src/types/rendering.ts
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
|
-
return e[e.Background = 0] = "Background", e[e.Main = 1] = "Main", e[e.Panel = 2] = "Panel", e[e.Overlay = 3] = "Overlay", e[e.UI = 4] = "UI", e;
|
|
3
|
+
return e[e.Background = 0] = "Background", e[e.Main = 1] = "Main", e[e.Panel = 2] = "Panel", e[e.Overlay = 3] = "Overlay", e[e.UI = 4] = "UI", e[e.Hover = 5] = "Hover", e;
|
|
4
4
|
}({}), t = {
|
|
5
|
-
color: "#
|
|
5
|
+
color: "#4c8dff",
|
|
6
6
|
lineWidth: 1,
|
|
7
7
|
lineStyle: "solid",
|
|
8
|
-
fillColor: "rgba(
|
|
8
|
+
fillColor: "rgba(76, 141, 255, 0.1)",
|
|
9
9
|
fillOpacity: .1,
|
|
10
10
|
fontSize: 12
|
|
11
11
|
}, n = {
|
|
12
12
|
enabled: !0,
|
|
13
13
|
orderColors: {
|
|
14
|
-
buy: "#
|
|
15
|
-
sell: "#
|
|
14
|
+
buy: "#1fa874",
|
|
15
|
+
sell: "#e8505b"
|
|
16
16
|
},
|
|
17
17
|
positionColors: {
|
|
18
|
-
profit: "#
|
|
19
|
-
loss: "#
|
|
20
|
-
entry: "#
|
|
18
|
+
profit: "#1fa874",
|
|
19
|
+
loss: "#e8505b",
|
|
20
|
+
entry: "#4c8dff"
|
|
21
21
|
},
|
|
22
22
|
depthOverlay: {
|
|
23
23
|
enabled: !1,
|
|
24
|
-
bidColor: "rgba(
|
|
25
|
-
askColor: "rgba(
|
|
24
|
+
bidColor: "rgba(31, 168, 116,0.15)",
|
|
25
|
+
askColor: "rgba(232, 80, 91,0.15)",
|
|
26
26
|
maxWidth: 100
|
|
27
27
|
},
|
|
28
28
|
contextMenu: { enabled: !0 },
|
|
29
29
|
pricePrecision: 2,
|
|
30
30
|
dragThreshold: 3
|
|
31
31
|
}, r = {
|
|
32
|
-
longColor: "#
|
|
33
|
-
shortColor: "#
|
|
32
|
+
longColor: "#1fa874",
|
|
33
|
+
shortColor: "#e8505b",
|
|
34
34
|
neutralColor: "#9E9E9E",
|
|
35
35
|
arrowSize: 12,
|
|
36
36
|
showLabel: !0,
|
|
37
37
|
showConfidence: !0
|
|
38
38
|
}, i = {
|
|
39
|
-
profitColor: "#
|
|
40
|
-
lossColor: "#
|
|
41
|
-
activeColor: "#
|
|
39
|
+
profitColor: "#1fa874",
|
|
40
|
+
lossColor: "#e8505b",
|
|
41
|
+
activeColor: "#4c8dff",
|
|
42
42
|
fillOpacity: .12,
|
|
43
43
|
borderWidth: 1,
|
|
44
44
|
showLabel: !0,
|
|
@@ -81,7 +81,7 @@ function f(e, t, n) {
|
|
|
81
81
|
function p(e) {
|
|
82
82
|
return e > 0xe8d4a51000 ? e : e * 1e3;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function m(e) {
|
|
85
85
|
return {
|
|
86
86
|
time: p(e.time ?? e.t ?? 0),
|
|
87
87
|
open: e.open ?? e.o ?? 0,
|
|
@@ -91,11 +91,11 @@ function ee(e) {
|
|
|
91
91
|
volume: e.volume ?? e.v ?? 0
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function ee(e, t, n) {
|
|
95
95
|
let r = Math.max(0, t), i = Math.min(e.length, n + 1);
|
|
96
96
|
return e.slice(r, i);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function te(e, t) {
|
|
99
99
|
let n = 0, r = e.length - 1;
|
|
100
100
|
for (; n <= r;) {
|
|
101
101
|
let i = n + r >>> 1;
|
|
@@ -105,7 +105,7 @@ function h(e, t) {
|
|
|
105
105
|
}
|
|
106
106
|
return n;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function h(e, t, n, r = .05) {
|
|
109
109
|
if (e.length === 0) return {
|
|
110
110
|
min: 0,
|
|
111
111
|
max: 1
|
|
@@ -122,7 +122,7 @@ function g(e, t, n, r = .05) {
|
|
|
122
122
|
max: s + c * r
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function g(e, t) {
|
|
126
126
|
return {
|
|
127
127
|
...e,
|
|
128
128
|
high: Math.max(e.high, t.price),
|
|
@@ -134,15 +134,15 @@ function _(e, t) {
|
|
|
134
134
|
}
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/utils/color.ts
|
|
137
|
-
function
|
|
137
|
+
function _(e, t = 1) {
|
|
138
138
|
return `rgba(${parseInt(e.slice(1, 3), 16)}, ${parseInt(e.slice(3, 5), 16)}, ${parseInt(e.slice(5, 7), 16)}, ${t})`;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
if (e.startsWith("#")) return
|
|
140
|
+
function v(e, t) {
|
|
141
|
+
if (e.startsWith("#")) return _(e, t);
|
|
142
142
|
let n = e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
143
143
|
return n ? `rgba(${n[1]}, ${n[2]}, ${n[3]}, ${t})` : e;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function ne(e, t, n) {
|
|
146
146
|
let r = (e) => (e = e.replace("#", ""), e.length === 3 && (e = e[0] + e[0] + e[1] + e[1] + e[2] + e[2]), {
|
|
147
147
|
r: parseInt(e.slice(0, 2), 16),
|
|
148
148
|
g: parseInt(e.slice(2, 4), 16),
|
|
@@ -152,7 +152,7 @@ function b(e, t, n) {
|
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
154
|
//#region src/utils/time.ts
|
|
155
|
-
var
|
|
155
|
+
var y = {
|
|
156
156
|
"1s": 1e3,
|
|
157
157
|
"5s": 5e3,
|
|
158
158
|
"15s": 15e3,
|
|
@@ -180,11 +180,11 @@ var x = {
|
|
|
180
180
|
"6M": 15552e6,
|
|
181
181
|
"12M": 31536e6
|
|
182
182
|
};
|
|
183
|
-
function
|
|
184
|
-
return
|
|
183
|
+
function re(e) {
|
|
184
|
+
return y[e];
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
let n = new Date(e), r =
|
|
186
|
+
function ie(e, t) {
|
|
187
|
+
let n = new Date(e), r = y[t];
|
|
188
188
|
return r >= 864e5 ? n.toLocaleDateString(void 0, {
|
|
189
189
|
month: "short",
|
|
190
190
|
day: "numeric"
|
|
@@ -197,11 +197,11 @@ function ne(e, t) {
|
|
|
197
197
|
second: "2-digit"
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
let n =
|
|
200
|
+
function ae(e, t) {
|
|
201
|
+
let n = y[t];
|
|
202
202
|
return Math.floor(e / n) * n;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function oe(e, t) {
|
|
205
205
|
if (t === null) {
|
|
206
206
|
let t = new Date(e);
|
|
207
207
|
return {
|
|
@@ -221,15 +221,15 @@ function ie(e, t) {
|
|
|
221
221
|
minutes: n.getUTCMinutes()
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function se(e) {
|
|
225
225
|
return e.hours === 0 && e.minutes === 0;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function ce(e) {
|
|
228
228
|
let t = e === null ? -(/* @__PURE__ */ new Date()).getTimezoneOffset() : e, n = t >= 0 ? "+" : "-", r = Math.abs(t), i = Math.floor(r / 60), a = r % 60;
|
|
229
229
|
return a === 0 ? `UTC${n}${i}` : `UTC${n}${i}:${String(a).padStart(2, "0")}`;
|
|
230
230
|
}
|
|
231
|
-
var
|
|
232
|
-
function
|
|
231
|
+
var b = Date.UTC(1970, 0, 5);
|
|
232
|
+
function le(e) {
|
|
233
233
|
let t = /^(\d+)([smhdwM])$/.exec(e);
|
|
234
234
|
return t ? {
|
|
235
235
|
count: parseInt(t[1], 10),
|
|
@@ -239,47 +239,54 @@ function w(e) {
|
|
|
239
239
|
unit: "m"
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
let { count: r, unit: i } =
|
|
242
|
+
function ue(e, t, n = 1) {
|
|
243
|
+
let { count: r, unit: i } = le(t);
|
|
244
244
|
if (i === "s" || i === "m" || i === "h" || i === "d") {
|
|
245
|
-
let n =
|
|
245
|
+
let n = y[t];
|
|
246
246
|
return Math.floor(e / n) * n;
|
|
247
247
|
}
|
|
248
248
|
let a = new Date(e);
|
|
249
249
|
if (i === "w") {
|
|
250
|
-
let e =
|
|
250
|
+
let e = y["1d"], t = (a.getUTCDay() - n + 7) % 7, i = Date.UTC(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate() - t);
|
|
251
251
|
if (r <= 1) return i;
|
|
252
|
-
let o = Math.floor((i -
|
|
253
|
-
return
|
|
252
|
+
let o = Math.floor((i - b) / (7 * e));
|
|
253
|
+
return b + Math.floor(o / r) * r * 7 * e;
|
|
254
254
|
}
|
|
255
255
|
let o = a.getUTCFullYear() * 12 + a.getUTCMonth(), s = Math.floor(o / r) * r;
|
|
256
256
|
return Date.UTC(Math.floor(s / 12), s % 12, 1);
|
|
257
257
|
}
|
|
258
258
|
//#endregion
|
|
259
259
|
//#region src/utils/precision.ts
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
var x = 64, S = /* @__PURE__ */ new Map();
|
|
261
|
+
function C(e, t) {
|
|
262
|
+
let n = `${e}|${t}`, r = S.get(n);
|
|
263
|
+
return r || (S.size >= x && S.clear(), r = new Intl.NumberFormat(e, {
|
|
262
264
|
minimumFractionDigits: t,
|
|
263
265
|
maximumFractionDigits: t
|
|
264
|
-
});
|
|
266
|
+
}), S.set(n, r)), r;
|
|
265
267
|
}
|
|
266
|
-
function
|
|
268
|
+
function w(e, t = 2, n = "en-US") {
|
|
269
|
+
return C(n, t).format(e);
|
|
270
|
+
}
|
|
271
|
+
function T(e, t) {
|
|
272
|
+
if (!(t > e) || !Number.isFinite(e) || !Number.isFinite(t)) return 2;
|
|
273
|
+
let n = f(e, t, 8);
|
|
274
|
+
return n > 0 && n < 1 ? Math.ceil(-Math.log10(n)) + 1 : 2;
|
|
275
|
+
}
|
|
276
|
+
function E(e, t, n, r = 2, i = "en-US") {
|
|
267
277
|
if ((t === "percentage" || t === "indexedTo100") && n && n !== 0) {
|
|
268
278
|
if (t === "percentage") {
|
|
269
279
|
let t = (e / n - 1) * 100;
|
|
270
280
|
return `${t > 0 ? "+" : ""}${t.toFixed(2)}%`;
|
|
271
281
|
}
|
|
272
|
-
return (e / n * 100
|
|
273
|
-
minimumFractionDigits: 2,
|
|
274
|
-
maximumFractionDigits: 2
|
|
275
|
-
});
|
|
282
|
+
return w(e / n * 100, 2, i);
|
|
276
283
|
}
|
|
277
|
-
return
|
|
284
|
+
return w(e, r, i);
|
|
278
285
|
}
|
|
279
|
-
function
|
|
286
|
+
function D(e) {
|
|
280
287
|
return e >= 1e9 ? (e / 1e9).toFixed(2) + "B" : e >= 1e6 ? (e / 1e6).toFixed(2) + "M" : e >= 1e3 ? (e / 1e3).toFixed(2) + "K" : e.toFixed(0);
|
|
281
288
|
}
|
|
282
|
-
function
|
|
289
|
+
function O(e) {
|
|
283
290
|
let t = 0;
|
|
284
291
|
for (let n of e) {
|
|
285
292
|
let e = n.toString(), r = e.indexOf(".");
|
|
@@ -289,7 +296,7 @@ function k(e) {
|
|
|
289
296
|
}
|
|
290
297
|
//#endregion
|
|
291
298
|
//#region src/constants/defaults.ts
|
|
292
|
-
var
|
|
299
|
+
var k = {
|
|
293
300
|
autoScale: !0,
|
|
294
301
|
rightMargin: 5,
|
|
295
302
|
minBarSpacing: 2,
|
|
@@ -300,7 +307,7 @@ var A = {
|
|
|
300
307
|
vLineStyle: "solid"
|
|
301
308
|
},
|
|
302
309
|
crosshair: { mode: "magnet" }
|
|
303
|
-
},
|
|
310
|
+
}, A = [
|
|
304
311
|
"1s",
|
|
305
312
|
"1m",
|
|
306
313
|
"3m",
|
|
@@ -317,7 +324,7 @@ var A = {
|
|
|
317
324
|
"3d",
|
|
318
325
|
"1w",
|
|
319
326
|
"1M"
|
|
320
|
-
],
|
|
327
|
+
], j = [
|
|
321
328
|
"1m",
|
|
322
329
|
"5m",
|
|
323
330
|
"15m",
|
|
@@ -331,7 +338,7 @@ var A = {
|
|
|
331
338
|
"3M",
|
|
332
339
|
"6M",
|
|
333
340
|
"12M"
|
|
334
|
-
],
|
|
341
|
+
], M = [
|
|
335
342
|
"1m",
|
|
336
343
|
"5m",
|
|
337
344
|
"15m",
|
|
@@ -341,7 +348,7 @@ var A = {
|
|
|
341
348
|
"1d",
|
|
342
349
|
"1w",
|
|
343
350
|
"1M"
|
|
344
|
-
],
|
|
351
|
+
], N = [
|
|
345
352
|
"1m",
|
|
346
353
|
"5m",
|
|
347
354
|
"15m",
|
|
@@ -349,52 +356,69 @@ var A = {
|
|
|
349
356
|
"4h",
|
|
350
357
|
"1d",
|
|
351
358
|
"1w"
|
|
352
|
-
],
|
|
359
|
+
], P = 8, F = 2, I = 70, L = 30, R = 60, z = 120, B = {
|
|
353
360
|
family: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif",
|
|
354
361
|
sizeSmall: 10,
|
|
355
362
|
sizeMedium: 12,
|
|
356
363
|
sizeLarge: 14
|
|
357
|
-
},
|
|
364
|
+
}, V = {
|
|
365
|
+
amber: "#f2a93b",
|
|
366
|
+
up: "#1fa874",
|
|
367
|
+
down: "#e8505b",
|
|
368
|
+
ochre: "#c98316",
|
|
369
|
+
blue: "#4c8dff",
|
|
370
|
+
violet: "#a57cff",
|
|
371
|
+
cyan: "#1398a8",
|
|
372
|
+
rose: "#e25592",
|
|
373
|
+
neutral: "#7d8696",
|
|
374
|
+
ink: "#0c1016"
|
|
375
|
+
}, H = [
|
|
376
|
+
V.blue,
|
|
377
|
+
V.ochre,
|
|
378
|
+
V.violet,
|
|
379
|
+
V.cyan,
|
|
380
|
+
V.rose
|
|
381
|
+
], U = {
|
|
358
382
|
name: "dark",
|
|
359
|
-
background:
|
|
360
|
-
text: "#
|
|
361
|
-
textSecondary: "#
|
|
362
|
-
grid: "#
|
|
363
|
-
crosshair: "#
|
|
364
|
-
candleUp: "#
|
|
365
|
-
candleDown: "#
|
|
366
|
-
candleUpWick: "#
|
|
367
|
-
candleDownWick: "#
|
|
368
|
-
lineColor:
|
|
369
|
-
areaTopColor: "rgba(
|
|
370
|
-
areaBottomColor: "rgba(
|
|
371
|
-
volumeUp: "rgba(
|
|
372
|
-
volumeDown: "rgba(
|
|
373
|
-
axisLine: "#
|
|
374
|
-
axisLabel: "#
|
|
375
|
-
axisLabelBackground: "#
|
|
376
|
-
font:
|
|
377
|
-
},
|
|
383
|
+
background: V.ink,
|
|
384
|
+
text: "#d9dde4",
|
|
385
|
+
textSecondary: "#7d8696",
|
|
386
|
+
grid: "#161b23",
|
|
387
|
+
crosshair: "#8a93a3",
|
|
388
|
+
candleUp: "#3ccf91",
|
|
389
|
+
candleDown: "#f0616d",
|
|
390
|
+
candleUpWick: "#3ccf91",
|
|
391
|
+
candleDownWick: "#f0616d",
|
|
392
|
+
lineColor: V.amber,
|
|
393
|
+
areaTopColor: "rgba(242, 169, 59, 0.32)",
|
|
394
|
+
areaBottomColor: "rgba(242, 169, 59, 0.0)",
|
|
395
|
+
volumeUp: "rgba(60, 207, 145, 0.28)",
|
|
396
|
+
volumeDown: "rgba(240, 97, 109, 0.28)",
|
|
397
|
+
axisLine: "#1f2630",
|
|
398
|
+
axisLabel: "#c3c9d3",
|
|
399
|
+
axisLabelBackground: "#1f2630",
|
|
400
|
+
font: B
|
|
401
|
+
}, de = {
|
|
378
402
|
name: "light",
|
|
379
|
-
background: "#
|
|
380
|
-
text: "#
|
|
381
|
-
textSecondary: "#
|
|
382
|
-
grid: "#
|
|
383
|
-
crosshair: "#
|
|
384
|
-
candleUp: "#
|
|
385
|
-
candleDown: "#
|
|
386
|
-
candleUpWick: "#
|
|
387
|
-
candleDownWick: "#
|
|
388
|
-
lineColor: "#
|
|
389
|
-
areaTopColor: "rgba(
|
|
390
|
-
areaBottomColor: "rgba(
|
|
391
|
-
volumeUp: "rgba(
|
|
392
|
-
volumeDown: "rgba(
|
|
393
|
-
axisLine: "#
|
|
394
|
-
axisLabel: "#
|
|
395
|
-
axisLabelBackground: "#
|
|
396
|
-
font:
|
|
397
|
-
},
|
|
403
|
+
background: "#ffffff",
|
|
404
|
+
text: "#0f131a",
|
|
405
|
+
textSecondary: "#6b7380",
|
|
406
|
+
grid: "#eef0f3",
|
|
407
|
+
crosshair: "#8a93a3",
|
|
408
|
+
candleUp: "#16a36a",
|
|
409
|
+
candleDown: "#d9414f",
|
|
410
|
+
candleUpWick: "#16a36a",
|
|
411
|
+
candleDownWick: "#d9414f",
|
|
412
|
+
lineColor: "#c77a0a",
|
|
413
|
+
areaTopColor: "rgba(199, 122, 10, 0.24)",
|
|
414
|
+
areaBottomColor: "rgba(199, 122, 10, 0.0)",
|
|
415
|
+
volumeUp: "rgba(22, 163, 106, 0.25)",
|
|
416
|
+
volumeDown: "rgba(217, 65, 79, 0.25)",
|
|
417
|
+
axisLine: "#dde1e7",
|
|
418
|
+
axisLabel: "#3f4754",
|
|
419
|
+
axisLabelBackground: "#eef0f3",
|
|
420
|
+
font: B
|
|
421
|
+
}, fe = {
|
|
398
422
|
name: "terminal",
|
|
399
423
|
background: "#0E0E0E",
|
|
400
424
|
text: "#C0C0C0",
|
|
@@ -626,19 +650,19 @@ var A = {
|
|
|
626
650
|
numberDecimalSeparator: ",",
|
|
627
651
|
numberGroupSeparator: "."
|
|
628
652
|
}, K = new Map([["en", W], ["vi", G]]), q = "en", J = W;
|
|
629
|
-
function
|
|
653
|
+
function pe(e) {
|
|
630
654
|
q = e, J = K.get(e) ?? W;
|
|
631
655
|
}
|
|
632
|
-
function
|
|
656
|
+
function me() {
|
|
633
657
|
return q;
|
|
634
658
|
}
|
|
635
|
-
function
|
|
659
|
+
function he(e) {
|
|
636
660
|
return J[e] ?? W[e] ?? e;
|
|
637
661
|
}
|
|
638
|
-
function
|
|
662
|
+
function ge(e, t) {
|
|
639
663
|
K.set(e, t);
|
|
640
664
|
}
|
|
641
|
-
function
|
|
665
|
+
function _e(e) {
|
|
642
666
|
return K.get(e ?? q) ?? W;
|
|
643
667
|
}
|
|
644
668
|
function Y(e, t = 2, n) {
|
|
@@ -646,10 +670,10 @@ function Y(e, t = 2, n) {
|
|
|
646
670
|
for (let e = l.length - 1, t = 0; e >= 0; e--, t++) t > 0 && t % 3 == 0 && (u = a + u), u = l[e] + u;
|
|
647
671
|
return c && (u = "-" + u), s ? u + i + s : u;
|
|
648
672
|
}
|
|
649
|
-
function
|
|
673
|
+
function ve(e) {
|
|
650
674
|
return Y(e, 0, "vi");
|
|
651
675
|
}
|
|
652
|
-
function
|
|
676
|
+
function ye(e, t) {
|
|
653
677
|
return e >= 1e9 ? Y(e / 1e9, 2, t ?? q) + "B" : e >= 1e6 ? Y(e / 1e6, 2, t ?? q) + "M" : e >= 1e3 ? Y(e / 1e3, 2, t ?? q) + "K" : Y(e, 0, t ?? q);
|
|
654
678
|
}
|
|
655
679
|
//#endregion
|
|
@@ -717,7 +741,7 @@ var X = {
|
|
|
717
741
|
endTime: "14:45",
|
|
718
742
|
type: "preClose"
|
|
719
743
|
}
|
|
720
|
-
],
|
|
744
|
+
], be = {
|
|
721
745
|
type: "stock",
|
|
722
746
|
exchange: "HOSE",
|
|
723
747
|
currency: "VND",
|
|
@@ -731,7 +755,7 @@ var X = {
|
|
|
731
755
|
},
|
|
732
756
|
sessions: Z,
|
|
733
757
|
colorScheme: X
|
|
734
|
-
},
|
|
758
|
+
}, xe = {
|
|
735
759
|
type: "stock",
|
|
736
760
|
exchange: "HNX",
|
|
737
761
|
currency: "VND",
|
|
@@ -745,7 +769,7 @@ var X = {
|
|
|
745
769
|
},
|
|
746
770
|
sessions: Q,
|
|
747
771
|
colorScheme: X
|
|
748
|
-
},
|
|
772
|
+
}, Se = {
|
|
749
773
|
type: "stock",
|
|
750
774
|
exchange: "UPCOM",
|
|
751
775
|
currency: "VND",
|
|
@@ -759,12 +783,12 @@ var X = {
|
|
|
759
783
|
},
|
|
760
784
|
sessions: Q,
|
|
761
785
|
colorScheme: X
|
|
762
|
-
},
|
|
786
|
+
}, Ce = {
|
|
763
787
|
type: "crypto",
|
|
764
788
|
currency: "USDT",
|
|
765
789
|
pricePrecision: 2,
|
|
766
790
|
priceLimits: { enabled: !1 }
|
|
767
|
-
},
|
|
791
|
+
}, $ = {
|
|
768
792
|
type: "stock",
|
|
769
793
|
exchange: "NYSE",
|
|
770
794
|
currency: "USD",
|
|
@@ -792,7 +816,7 @@ var X = {
|
|
|
792
816
|
}
|
|
793
817
|
]
|
|
794
818
|
};
|
|
795
|
-
function
|
|
819
|
+
function we(e) {
|
|
796
820
|
return {
|
|
797
821
|
...e,
|
|
798
822
|
candleUp: X.up,
|
|
@@ -803,7 +827,7 @@ function ve(e) {
|
|
|
803
827
|
volumeDown: "rgba(0, 0, 255, 0.3)"
|
|
804
828
|
};
|
|
805
829
|
}
|
|
806
|
-
function
|
|
830
|
+
function Te(e, t) {
|
|
807
831
|
if (!t.priceLimits?.enabled || !t.priceLimits.ceilingPercent) return null;
|
|
808
832
|
let n = t.priceLimits.ceilingPercent / 100, r = (t.priceLimits.floorPercent ?? t.priceLimits.ceilingPercent) / 100;
|
|
809
833
|
return {
|
|
@@ -812,12 +836,12 @@ function ye(e, t) {
|
|
|
812
836
|
reference: e
|
|
813
837
|
};
|
|
814
838
|
}
|
|
815
|
-
function
|
|
839
|
+
function Ee(e) {
|
|
816
840
|
let t = /* @__PURE__ */ new Date(), n = `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
|
817
841
|
for (let t of e) if (n >= t.startTime && n < t.endTime) return t;
|
|
818
842
|
return null;
|
|
819
843
|
}
|
|
820
844
|
//#endregion
|
|
821
|
-
export {
|
|
845
|
+
export { fe as DARK_TERMINAL, U as DARK_THEME, F as DEFAULT_BAR_SPACING, P as DEFAULT_BAR_WIDTH, k as DEFAULT_CHART_OPTIONS, t as DEFAULT_DRAWING_STYLE, z as DEFAULT_PANEL_HEIGHT, a as DEFAULT_RECONNECT, r as DEFAULT_SIGNAL_STYLE, o as DEFAULT_STREAM_CONFIG, N as DEFAULT_TIMEFRAME_FAVORITES, i as DEFAULT_TRADE_ZONE_STYLE, n as DEFAULT_TRADING_CONFIG, Q as HNX_SESSIONS, Z as HOSE_SESSIONS, de as LIGHT_THEME, e as LayerType, Ce as MARKET_CRYPTO, xe as MARKET_HNX, be as MARKET_HOSE, $ as MARKET_NYSE, Se as MARKET_UPCOM, R as MIN_PANEL_HEIGHT, I as PRICE_AXIS_WIDTH, V as TC_PALETTE, H as TC_SERIES_COLORS, A as TIMEFRAMES_CRYPTO, M as TIMEFRAMES_FOREX, j as TIMEFRAMES_STOCK, L as TIME_AXIS_HEIGHT, X as VN_COLORS, ae as alignToTimeframe, T as autoPricePrecision, s as clamp, Te as computePriceLimits, h as computePriceRange, f as computeTickStep, we as createVNTheme, O as detectPrecision, W as en, te as findBarIndex, Y as formatNumber, w as formatPrice, E as formatPriceScaleLabel, ie as formatTimestamp, ve as formatVND, D as formatVolume, ye as formatVolumeLoc, Ee as getCurrentSession, me as getLocale, _e as getLocaleStrings, _ as hexToRgba, l as inverseLerp, se as isDateOnly, c as lerp, ne as lerpColor, g as mergeBar, d as niceNumber, m as normalizeBar, p as normalizeBarTime, ge as registerLocale, u as roundToStep, pe as setLocale, ee as sliceVisibleData, he as t, oe as timeParts, ue as timeframeBucketStart, re as timeframeToMs, ce as tzLabel, G as vi, v as withAlpha };
|
|
822
846
|
|
|
823
847
|
//# sourceMappingURL=index.js.map
|