@mashkovd/pelican-vue 0.3.2 → 0.3.4
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { onScopeDispose as fe, defineComponent as F, ref as P, watch as
|
|
1
|
+
import { onScopeDispose as fe, defineComponent as F, ref as P, watch as U, openBlock as g, createElementBlock as M, createElementVNode as i, createTextVNode as B, toDisplayString as b, Fragment as D, renderList as Y, unref as p, normalizeClass as E, computed as $, normalizeStyle as Q, createCommentVNode as K, createVNode as T, withDirectives as ye, vShow as Me, inject as Ue, withModifiers as ne, renderSlot as X, createBlock as ue, withCtx as ce, mergeProps as Ve, shallowRef as Ee, triggerRef as le, reactive as Te, provide as se, toRef as be, onMounted as Be, normalizeProps as Oe, guardReactiveProps as Ke } from "vue";
|
|
2
2
|
function Ye(e, t) {
|
|
3
3
|
let a = null;
|
|
4
4
|
const n = (...c) => {
|
|
@@ -10,7 +10,7 @@ function Ye(e, t) {
|
|
|
10
10
|
};
|
|
11
11
|
return fe(s), { wrapped: n, cancel: s };
|
|
12
12
|
}
|
|
13
|
-
const ze = 20,
|
|
13
|
+
const ze = 20, He = 350, Ge = 2e3, je = 2e4, We = 30, qe = [
|
|
14
14
|
"return-desc",
|
|
15
15
|
"return-asc",
|
|
16
16
|
"copiers-desc",
|
|
@@ -73,13 +73,13 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
73
73
|
emits: ["update:search", "update:sortKey", "refresh", "toggle-filters"],
|
|
74
74
|
setup(e, { emit: t }) {
|
|
75
75
|
const a = e, n = t, s = P(a.search);
|
|
76
|
-
|
|
76
|
+
U(
|
|
77
77
|
() => a.search,
|
|
78
78
|
(r) => {
|
|
79
79
|
r !== s.value && (s.value = r);
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
const { wrapped: c } = Ye((r) => n("update:search", r),
|
|
82
|
+
const { wrapped: c } = Ye((r) => n("update:search", r), He);
|
|
83
83
|
function l(r) {
|
|
84
84
|
const m = r.target.value;
|
|
85
85
|
s.value = m, c(m);
|
|
@@ -94,13 +94,13 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
94
94
|
onClick: m[0] || (m[0] = (h) => n("toggle-filters"))
|
|
95
95
|
}, " Filters "),
|
|
96
96
|
i("div", Qe, [
|
|
97
|
-
m[2] || (m[2] =
|
|
97
|
+
m[2] || (m[2] = B(" Showing ", -1)),
|
|
98
98
|
i("b", null, b(e.filteredTotal.toLocaleString("en-US")), 1),
|
|
99
|
-
m[3] || (m[3] =
|
|
99
|
+
m[3] || (m[3] = B(" of ", -1)),
|
|
100
100
|
i("b", null, b(e.total.toLocaleString("en-US")), 1),
|
|
101
|
-
m[4] || (m[4] =
|
|
101
|
+
m[4] || (m[4] = B(" · page ", -1)),
|
|
102
102
|
i("b", null, b(e.page), 1),
|
|
103
|
-
|
|
103
|
+
B(" / " + b(e.totalPages), 1)
|
|
104
104
|
]),
|
|
105
105
|
i("input", {
|
|
106
106
|
class: "search",
|
|
@@ -151,7 +151,7 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
151
151
|
(g(), M(D, null, Y(s, (r) => i("button", {
|
|
152
152
|
key: r,
|
|
153
153
|
type: "button",
|
|
154
|
-
class:
|
|
154
|
+
class: E(["chip", ["risk-" + r.toLowerCase(), { on: e.modelValue.has(r) }]]),
|
|
155
155
|
onClick: (m) => c(r)
|
|
156
156
|
}, b(r), 11, it)), 64))
|
|
157
157
|
]));
|
|
@@ -192,7 +192,7 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
192
192
|
}, null, 40, vt)
|
|
193
193
|
]));
|
|
194
194
|
}
|
|
195
|
-
}),
|
|
195
|
+
}), G = /* @__PURE__ */ N(pt, [["__scopeId", "data-v-10c5fe1c"]]), gt = { class: "pelican-fgroup" }, ht = { class: "title-row" }, yt = { class: "title" }, Mt = { class: "val" }, bt = ["min", "max", "value"], xt = ["min", "max", "value"], wt = {
|
|
196
196
|
key: 0,
|
|
197
197
|
class: "scale"
|
|
198
198
|
}, $t = /* @__PURE__ */ F({
|
|
@@ -224,16 +224,16 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
224
224
|
var(--track-bg, #e2e8f0) ${d.value}%,
|
|
225
225
|
var(--track-bg, #e2e8f0) 100%)`
|
|
226
226
|
}));
|
|
227
|
-
function I
|
|
228
|
-
let f = parseInt(
|
|
227
|
+
function _(I) {
|
|
228
|
+
let f = parseInt(I.target.value, 10);
|
|
229
229
|
isNaN(f) || (f > o.value && (f = o.value), n("update:modelValueMin", f <= s.value ? null : f));
|
|
230
230
|
}
|
|
231
|
-
function k(
|
|
232
|
-
let f = parseInt(
|
|
231
|
+
function k(I) {
|
|
232
|
+
let f = parseInt(I.target.value, 10);
|
|
233
233
|
isNaN(f) || (f < l.value && (f = l.value), n("update:modelValueMax", f >= c.value ? null : f));
|
|
234
234
|
}
|
|
235
|
-
return (
|
|
236
|
-
var
|
|
235
|
+
return (I, f) => {
|
|
236
|
+
var S;
|
|
237
237
|
return g(), M("div", gt, [
|
|
238
238
|
i("div", ht, [
|
|
239
239
|
i("label", yt, b(e.label), 1),
|
|
@@ -250,8 +250,8 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
250
250
|
max: c.value,
|
|
251
251
|
value: l.value,
|
|
252
252
|
style: Q({ zIndex: l.value <= s.value || l.value >= o.value ? 5 : 4 }),
|
|
253
|
-
onInput:
|
|
254
|
-
onChange:
|
|
253
|
+
onInput: _,
|
|
254
|
+
onChange: _
|
|
255
255
|
}, null, 44, bt),
|
|
256
256
|
i("input", {
|
|
257
257
|
type: "range",
|
|
@@ -264,7 +264,7 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
264
264
|
onChange: k
|
|
265
265
|
}, null, 44, xt)
|
|
266
266
|
], 4),
|
|
267
|
-
(
|
|
267
|
+
(S = e.scaleHints) != null && S.length ? (g(), M("div", wt, [
|
|
268
268
|
(g(!0), M(D, null, Y(e.scaleHints, (A) => (g(), M("span", { key: A }, b(A), 1))), 128))
|
|
269
269
|
])) : K("", !0)
|
|
270
270
|
]);
|
|
@@ -296,7 +296,7 @@ function ke(e, t = "en-US") {
|
|
|
296
296
|
function kt(e) {
|
|
297
297
|
return e.Fee == null ? e._meta ? "free" : "—" : `${(e.Fee * 100).toFixed(0)}%`;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function _e(e, t = "en-US") {
|
|
300
300
|
if (!e) return "—";
|
|
301
301
|
const a = new Date(e);
|
|
302
302
|
return isNaN(a.getTime()) ? "—" : a.toLocaleString(t, {
|
|
@@ -308,7 +308,7 @@ function Ie(e, t = "en-US") {
|
|
|
308
308
|
hour12: !1
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function _t(e) {
|
|
312
312
|
if (e == null) return "—";
|
|
313
313
|
if (e < 30) return `${e}d`;
|
|
314
314
|
const t = Math.floor(e / 30);
|
|
@@ -319,10 +319,10 @@ function It(e) {
|
|
|
319
319
|
function de(e) {
|
|
320
320
|
return e >= 1e6 ? "$" + (e / 1e6).toFixed(2) + "M" : e >= 1e3 ? "$" + Math.round(e / 1e3) + "K" : "$" + Math.round(e);
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function It(e) {
|
|
323
323
|
return e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "K%" : Math.round(e) + "%";
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Rt(e) {
|
|
326
326
|
return e && e.trim().split(/\s+/).slice(0, 2).map((a) => a.charAt(0).toUpperCase()).join("") || "?";
|
|
327
327
|
}
|
|
328
328
|
function W(e) {
|
|
@@ -330,7 +330,7 @@ function W(e) {
|
|
|
330
330
|
const t = new Date(e);
|
|
331
331
|
return isNaN(t.getTime()) ? null : Math.floor((Date.now() - t.getTime()) / 864e5);
|
|
332
332
|
}
|
|
333
|
-
const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)),
|
|
333
|
+
const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), Ie = (e) => e <= 0 ? 0 : Math.max(1, Math.min(100, Math.round(1 + (Math.log10(e) - 1) * 99 / 6))), ie = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, (e - 1) / 99 * 4.7)), St = { class: "pelican-fgroup" }, Pt = { class: "title-row" }, Ct = { class: "val" }, Tt = ["value"], At = /* @__PURE__ */ F({
|
|
334
334
|
__name: "InvestAmount",
|
|
335
335
|
props: {
|
|
336
336
|
modelValue: {}
|
|
@@ -351,9 +351,9 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
351
351
|
n("update:modelValue", null), n("apply", null);
|
|
352
352
|
return;
|
|
353
353
|
}
|
|
354
|
-
n("update:modelValue", r), n("apply", { min:
|
|
354
|
+
n("update:modelValue", r), n("apply", { min: Ie(50), max: Ie(r) });
|
|
355
355
|
}
|
|
356
|
-
return (l, o) => (g(), M("div",
|
|
356
|
+
return (l, o) => (g(), M("div", St, [
|
|
357
357
|
i("div", Pt, [
|
|
358
358
|
o[0] || (o[0] = i("label", { class: "title" }, "Your Investment Amount, $", -1)),
|
|
359
359
|
i("span", Ct, b(s.value), 1)
|
|
@@ -369,7 +369,7 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
369
369
|
}, null, 40, Tt)
|
|
370
370
|
]));
|
|
371
371
|
}
|
|
372
|
-
}), Ft = /* @__PURE__ */ N(At, [["__scopeId", "data-v-a76acc6c"]]), Nt = { class: "ftitle-row" },
|
|
372
|
+
}), Ft = /* @__PURE__ */ N(At, [["__scopeId", "data-v-a76acc6c"]]), Nt = { class: "ftitle-row" }, Dt = /* @__PURE__ */ F({
|
|
373
373
|
__name: "FiltersPanel",
|
|
374
374
|
props: {
|
|
375
375
|
filters: {},
|
|
@@ -379,20 +379,20 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
379
379
|
emits: ["update:filters", "update:investAmount", "reset"],
|
|
380
380
|
setup(e, { emit: t }) {
|
|
381
381
|
const a = e, n = t, s = P(0), c = P(100), l = P(0), o = P(100);
|
|
382
|
-
|
|
382
|
+
U(s, (v) => {
|
|
383
383
|
n("update:filters", { retMin: v <= 0 ? null : ie(v) });
|
|
384
|
-
}),
|
|
384
|
+
}), U(c, (v) => {
|
|
385
385
|
n("update:filters", { retMax: v >= 100 ? null : ie(v) });
|
|
386
|
-
}),
|
|
386
|
+
}), U(l, (v) => {
|
|
387
387
|
n("update:filters", { balanceMin: v <= 0 ? null : oe(v) });
|
|
388
|
-
}),
|
|
388
|
+
}), U(o, (v) => {
|
|
389
389
|
n("update:filters", { balanceMax: v >= 100 ? null : oe(v) });
|
|
390
|
-
}),
|
|
390
|
+
}), U(
|
|
391
391
|
() => [a.filters.retMin, a.filters.retMax],
|
|
392
392
|
([v, d]) => {
|
|
393
393
|
v == null && (s.value = 0), d == null && (c.value = 100);
|
|
394
394
|
}
|
|
395
|
-
),
|
|
395
|
+
), U(
|
|
396
396
|
() => [a.filters.balanceMin, a.filters.balanceMax],
|
|
397
397
|
([v, d]) => {
|
|
398
398
|
v == null && (l.value = 0), d == null && (o.value = 100);
|
|
@@ -408,7 +408,7 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
408
408
|
v == null ? (r({ balanceMin: null, balanceMax: null }), l.value = 0, o.value = 100) : (l.value = v.min, o.value = v.max);
|
|
409
409
|
}
|
|
410
410
|
return (v, d) => (g(), M("aside", {
|
|
411
|
-
class:
|
|
411
|
+
class: E(["pelican-filters", { open: e.open }])
|
|
412
412
|
}, [
|
|
413
413
|
i("div", Nt, [
|
|
414
414
|
d[13] || (d[13] = i("label", { class: "ftitle" }, "Risk", -1)),
|
|
@@ -431,14 +431,14 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
431
431
|
label: "Return %",
|
|
432
432
|
"model-value-min": s.value,
|
|
433
433
|
"model-value-max": c.value,
|
|
434
|
-
"format-raw": (u) => p(
|
|
434
|
+
"format-raw": (u) => p(It)(u),
|
|
435
435
|
"raw-to-domain": (u) => p(ie)(u),
|
|
436
436
|
"scale-hints": ["0%", "200%", "50K%+"],
|
|
437
437
|
"max-label": "50K%+",
|
|
438
438
|
"onUpdate:modelValueMin": d[2] || (d[2] = (u) => s.value = u ?? 0),
|
|
439
439
|
"onUpdate:modelValueMax": d[3] || (d[3] = (u) => c.value = u ?? 100)
|
|
440
440
|
}, null, 8, ["model-value-min", "model-value-max", "format-raw", "raw-to-domain"]),
|
|
441
|
-
T(
|
|
441
|
+
T(G, {
|
|
442
442
|
label: "Max Drawdown ≤",
|
|
443
443
|
"model-value": e.filters.ddMax,
|
|
444
444
|
min: 0,
|
|
@@ -460,7 +460,7 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
460
460
|
"onUpdate:modelValueMin": d[5] || (d[5] = (u) => l.value = u ?? 0),
|
|
461
461
|
"onUpdate:modelValueMax": d[6] || (d[6] = (u) => o.value = u ?? 100)
|
|
462
462
|
}, null, 8, ["model-value-min", "model-value-max", "format-raw", "raw-to-domain"]),
|
|
463
|
-
T(
|
|
463
|
+
T(G, {
|
|
464
464
|
label: "Mgmt Fee ≤",
|
|
465
465
|
"model-value": e.filters.feeMax,
|
|
466
466
|
min: 0,
|
|
@@ -471,7 +471,7 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
471
471
|
format: (u) => u + "%",
|
|
472
472
|
"onUpdate:modelValue": d[7] || (d[7] = (u) => r({ feeMax: u == null || u >= 100 ? null : u }))
|
|
473
473
|
}, null, 8, ["model-value", "format"]),
|
|
474
|
-
T(
|
|
474
|
+
T(G, {
|
|
475
475
|
label: "Copiers AUM ≥",
|
|
476
476
|
"model-value": e.filters.aumMin,
|
|
477
477
|
min: 0,
|
|
@@ -480,7 +480,7 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
480
480
|
format: (u) => "≥ " + p(de)(u),
|
|
481
481
|
"onUpdate:modelValue": d[8] || (d[8] = (u) => r({ aumMin: u && u > 0 ? u : null }))
|
|
482
482
|
}, null, 8, ["model-value", "format"]),
|
|
483
|
-
T(
|
|
483
|
+
T(G, {
|
|
484
484
|
label: "Copiers ≥",
|
|
485
485
|
"model-value": e.filters.copiersMin,
|
|
486
486
|
min: 0,
|
|
@@ -489,7 +489,7 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
489
489
|
format: (u) => "≥ " + u,
|
|
490
490
|
"onUpdate:modelValue": d[9] || (d[9] = (u) => r({ copiersMin: u && u > 0 ? u : null }))
|
|
491
491
|
}, null, 8, ["model-value", "format"]),
|
|
492
|
-
T(
|
|
492
|
+
T(G, {
|
|
493
493
|
label: "Age ≥ (days)",
|
|
494
494
|
"model-value": e.filters.ageMin,
|
|
495
495
|
min: 0,
|
|
@@ -498,7 +498,7 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
498
498
|
format: (u) => "≥ " + u + "d",
|
|
499
499
|
"onUpdate:modelValue": d[10] || (d[10] = (u) => r({ ageMin: u && u > 0 ? u : null }))
|
|
500
500
|
}, null, 8, ["model-value", "format"]),
|
|
501
|
-
T(
|
|
501
|
+
T(G, {
|
|
502
502
|
label: "Trades ≥",
|
|
503
503
|
"model-value": e.filters.tradesMin,
|
|
504
504
|
min: 0,
|
|
@@ -507,7 +507,7 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
507
507
|
format: (u) => "≥ " + u,
|
|
508
508
|
"onUpdate:modelValue": d[11] || (d[11] = (u) => r({ tradesMin: u && u > 0 ? u : null }))
|
|
509
509
|
}, null, 8, ["model-value", "format"]),
|
|
510
|
-
T(
|
|
510
|
+
T(G, {
|
|
511
511
|
label: "Win Rate ≥",
|
|
512
512
|
"model-value": e.filters.winrateMin,
|
|
513
513
|
min: 0,
|
|
@@ -518,7 +518,7 @@ const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _
|
|
|
518
518
|
}, null, 8, ["model-value", "format"])
|
|
519
519
|
], 2));
|
|
520
520
|
}
|
|
521
|
-
}),
|
|
521
|
+
}), Lt = /* @__PURE__ */ N(Dt, [["__scopeId", "data-v-67cc5448"]]), Re = [
|
|
522
522
|
"#f97316",
|
|
523
523
|
"#3b82f6",
|
|
524
524
|
"#10b981",
|
|
@@ -545,16 +545,16 @@ function Ut(e, t = 140, a = 34) {
|
|
|
545
545
|
startX: 1,
|
|
546
546
|
endX: t - 1
|
|
547
547
|
};
|
|
548
|
-
const n = e.map((
|
|
548
|
+
const n = e.map((R) => Date.parse(R.Timestamp)), s = n[0], c = n[n.length - 1], l = c - s || 1, o = e.map((R) => R.AccountReturn), r = Math.min(0, ...o), h = Math.max(0, ...o) - r || 1, v = (R) => (R - s) / l * (t - 2) + 1, d = (R) => a - 2 - (R - r) / h * (a - 4), u = e.map((R, x) => `${v(n[x]).toFixed(1)},${d(R.AccountReturn).toFixed(1)}`), _ = o[o.length - 1], k = d(0), I = v(s), f = v(c), S = `M ${u.join(" L ")}`, A = `M ${u[0]} ` + u.slice(1).map((R) => `L ${R}`).join(" ") + ` L ${f.toFixed(1)},${k.toFixed(1)} L ${I.toFixed(1)},${k.toFixed(1)} Z`;
|
|
549
549
|
return {
|
|
550
550
|
hasData: !0,
|
|
551
551
|
width: t,
|
|
552
552
|
height: a,
|
|
553
553
|
zeroY: k,
|
|
554
554
|
areaPath: A,
|
|
555
|
-
linePath:
|
|
556
|
-
positive:
|
|
557
|
-
startX:
|
|
555
|
+
linePath: S,
|
|
556
|
+
positive: _ >= 0,
|
|
557
|
+
startX: I,
|
|
558
558
|
endX: f
|
|
559
559
|
};
|
|
560
560
|
}
|
|
@@ -563,20 +563,20 @@ function Vt(e, t = 520, a = 280) {
|
|
|
563
563
|
let h = -Math.PI / 2;
|
|
564
564
|
const v = [];
|
|
565
565
|
return n.forEach((d, u) => {
|
|
566
|
-
const
|
|
566
|
+
const _ = (d.c || 0) / s, k = _ * Math.PI * 2, I = h, f = h + k;
|
|
567
567
|
h = f;
|
|
568
|
-
const
|
|
568
|
+
const S = (I + f) / 2, A = k > Math.PI ? 1 : 0, R = c + o * Math.cos(I), x = l + o * Math.sin(I), w = c + o * Math.cos(f), y = l + o * Math.sin(f), C = c + r * Math.cos(I), O = l + r * Math.sin(I), z = c + r * Math.cos(f), V = l + r * Math.sin(f), L = `M ${R.toFixed(2)} ${x.toFixed(2)} A ${o} ${o} 0 ${A} 1 ${w.toFixed(2)} ${y.toFixed(2)} L ${z.toFixed(2)} ${V.toFixed(2)} A ${r} ${r} 0 ${A} 0 ${C.toFixed(2)} ${O.toFixed(2)} Z`, H = Re[u % Re.length];
|
|
569
569
|
let ve = null, pe = 0, ge = 0, he = "start";
|
|
570
|
-
if (
|
|
571
|
-
const te = Math.cos(
|
|
572
|
-
ve = `${Ne.toFixed(1)},${
|
|
570
|
+
if (_ >= 0.015) {
|
|
571
|
+
const te = Math.cos(S) < 0, Ne = c + o * Math.cos(S), De = l + o * Math.sin(S), Z = c + m * Math.cos(S), ae = l + m * Math.sin(S), Le = te ? Z - 4 : Z + 4;
|
|
572
|
+
ve = `${Ne.toFixed(1)},${De.toFixed(1)} ${Z.toFixed(1)},${ae.toFixed(1)} ${Le.toFixed(1)},${ae.toFixed(1)}`, pe = te ? Z - 6 : Z + 6, ge = ae + 4, he = te ? "end" : "start";
|
|
573
573
|
}
|
|
574
574
|
v.push({
|
|
575
575
|
marketName: d.n,
|
|
576
576
|
count: d.c,
|
|
577
|
-
fraction:
|
|
578
|
-
color:
|
|
579
|
-
arcPath:
|
|
577
|
+
fraction: _,
|
|
578
|
+
color: H,
|
|
579
|
+
arcPath: L,
|
|
580
580
|
labelLine: ve,
|
|
581
581
|
labelX: pe,
|
|
582
582
|
labelY: ge,
|
|
@@ -643,7 +643,7 @@ const Et = ["width", "height"], Bt = ["width", "height", "viewBox"], Ot = ["x2",
|
|
|
643
643
|
}, "no data", -1)
|
|
644
644
|
])], 8, Et));
|
|
645
645
|
}
|
|
646
|
-
}),
|
|
646
|
+
}), Ht = /* @__PURE__ */ N(zt, [["__scopeId", "data-v-a9b85847"]]), Gt = {
|
|
647
647
|
key: 0,
|
|
648
648
|
class: "dim"
|
|
649
649
|
}, jt = ["viewBox"], Wt = ["d", "fill"], qt = ["points", "stroke"], Xt = ["x", "y", "text-anchor"], Zt = {
|
|
@@ -658,7 +658,7 @@ const Et = ["width", "height"], Bt = ["width", "height", "viewBox"], Ot = ["x2",
|
|
|
658
658
|
},
|
|
659
659
|
setup(e) {
|
|
660
660
|
const t = e, a = $(() => !t.markets || t.markets.length === 0), n = $(() => Vt(t.markets, t.width, t.height));
|
|
661
|
-
return (s, c) => a.value ? (g(), M("span",
|
|
661
|
+
return (s, c) => a.value ? (g(), M("span", Gt, "no market data")) : (g(), M("svg", {
|
|
662
662
|
key: 1,
|
|
663
663
|
class: "pelican-donut",
|
|
664
664
|
viewBox: `0 0 ${n.value.width} ${n.value.height}`,
|
|
@@ -697,7 +697,7 @@ const Et = ["width", "height"], Bt = ["width", "height", "viewBox"], Ot = ["x2",
|
|
|
697
697
|
fill: "var(--text)",
|
|
698
698
|
"font-weight": "500"
|
|
699
699
|
}, [
|
|
700
|
-
|
|
700
|
+
B(b(l.marketName) + " ", 1),
|
|
701
701
|
i("tspan", Zt, b(l.count), 1)
|
|
702
702
|
], 8, Xt)), [
|
|
703
703
|
[Me, l.labelLine]
|
|
@@ -732,23 +732,23 @@ const Et = ["width", "height"], Bt = ["width", "height", "viewBox"], Ot = ["x2",
|
|
|
732
732
|
(g(!0), M(D, null, Y(e.trades ?? [], (l, o) => (g(), M("li", { key: o }, [
|
|
733
733
|
i("span", sa, b(l.MarketName ?? "—"), 1),
|
|
734
734
|
i("span", {
|
|
735
|
-
class:
|
|
735
|
+
class: E(["dir", l.Direction === "Sell" ? "red" : "green"])
|
|
736
736
|
}, b(l.Direction ?? ""), 3),
|
|
737
737
|
i("span", oa, [
|
|
738
|
-
|
|
738
|
+
B(b(p(_e)(l.OpenTimestamp, e.locale)) + " ", 1),
|
|
739
739
|
l.CloseTimestamp ? (g(), M(D, { key: 0 }, [
|
|
740
|
-
|
|
740
|
+
B(" → " + b(p(_e)(l.CloseTimestamp, e.locale)), 1)
|
|
741
741
|
], 64)) : K("", !0)
|
|
742
742
|
]),
|
|
743
743
|
l.Pnl != null ? (g(), M("span", {
|
|
744
744
|
key: 0,
|
|
745
|
-
class:
|
|
745
|
+
class: E(["pnl", l.Pnl >= 0 ? "green" : "red"])
|
|
746
746
|
}, b(p(j)(l.Pnl, e.locale)), 3)) : K("", !0)
|
|
747
747
|
]))), 128))
|
|
748
748
|
]))
|
|
749
749
|
]));
|
|
750
750
|
}
|
|
751
|
-
}),
|
|
751
|
+
}), Se = /* @__PURE__ */ N(ia, [["__scopeId", "data-v-aa7cbcd7"]]);
|
|
752
752
|
function q(e) {
|
|
753
753
|
const t = e.Wins ?? 0, a = e.Losses ?? 0, n = t + a;
|
|
754
754
|
return n ? t / n * 100 : -1;
|
|
@@ -771,16 +771,16 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
771
771
|
}, ka = {
|
|
772
772
|
class: "c-num",
|
|
773
773
|
"data-label": "Max DD"
|
|
774
|
-
},
|
|
774
|
+
}, _a = { key: 1 }, Ia = {
|
|
775
775
|
class: "c-num",
|
|
776
776
|
"data-label": "Age"
|
|
777
|
-
},
|
|
777
|
+
}, Ra = {
|
|
778
778
|
class: "c-num",
|
|
779
779
|
"data-label": "Balance"
|
|
780
|
-
},
|
|
780
|
+
}, Sa = {
|
|
781
781
|
class: "c-num",
|
|
782
782
|
"data-label": "Fee"
|
|
783
|
-
}, Pa = ["href"], Ca = { class: "grid" }, Ta = { class: "col-stats" }, Aa = { class: "field" }, Fa = { class: "value" }, Na = { class: "field" },
|
|
783
|
+
}, Pa = ["href"], Ca = { class: "grid" }, Ta = { class: "col-stats" }, Aa = { class: "field" }, Fa = { class: "value" }, Na = { class: "field" }, Da = { class: "value" }, La = { class: "field" }, Ua = { class: "value" }, Va = { class: "field" }, Ea = { class: "value" }, Ba = { class: "field" }, Oa = { class: "value" }, Ka = { class: "field" }, Ya = { class: "value" }, za = { class: "field" }, Ha = { class: "value" }, Ga = { class: "field" }, ja = { class: "value" }, Wa = { key: 0 }, qa = {
|
|
784
784
|
key: 1,
|
|
785
785
|
class: "dim"
|
|
786
786
|
}, Xa = { class: "col-donut" }, Za = { class: "trade-toggles" }, Ja = /* @__PURE__ */ F({
|
|
@@ -795,27 +795,27 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
795
795
|
setup(e, { emit: t }) {
|
|
796
796
|
const a = e, n = t, s = Ue(Ae, "en-US"), c = $(() => we(a.s.Return, 1)), l = $(() => a.s.MaxDD != null ? we(a.s.MaxDD, 2) : null), o = $(() => W(a.s.Inception)), r = $(() => q(a.s)), m = $(() => r.value >= 0 ? 100 - r.value : -1), h = $(
|
|
797
797
|
() => {
|
|
798
|
-
var
|
|
799
|
-
return ((
|
|
798
|
+
var I, f;
|
|
799
|
+
return ((I = a.s.Profile) == null ? void 0 : I.Name) ?? ((f = a.s.Profile) != null && f.Id ? "#" + a.s.Profile.Id : "");
|
|
800
800
|
}
|
|
801
801
|
), v = $(() => `https://libertex.copy-trade.io/strategy/${a.s.Id}`), d = P(!1), u = P(!1);
|
|
802
|
-
function
|
|
802
|
+
function _() {
|
|
803
803
|
d.value = !d.value, d.value && !a.openTrades && n("load-trades", "open");
|
|
804
804
|
}
|
|
805
805
|
function k() {
|
|
806
806
|
u.value = !u.value, u.value && !a.closedTrades && n("load-trades", "closed");
|
|
807
807
|
}
|
|
808
|
-
return (
|
|
809
|
-
var
|
|
808
|
+
return (I, f) => {
|
|
809
|
+
var S, A, R, x;
|
|
810
810
|
return g(), M(D, null, [
|
|
811
811
|
i("div", {
|
|
812
|
-
class:
|
|
812
|
+
class: E(["pelican-row", { open: e.expanded }]),
|
|
813
813
|
"data-id": e.s.Id,
|
|
814
814
|
onClick: f[3] || (f[3] = (w) => n("toggle"))
|
|
815
815
|
}, [
|
|
816
816
|
i("div", da, [
|
|
817
817
|
i("div", ma, [
|
|
818
|
-
i("span", fa, b(p(
|
|
818
|
+
i("span", fa, b(p(Rt)(e.s.Name)), 1),
|
|
819
819
|
e.s.ImageUploaded ? (g(), M("img", {
|
|
820
820
|
key: 0,
|
|
821
821
|
class: "avatar-img",
|
|
@@ -828,21 +828,21 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
828
828
|
]),
|
|
829
829
|
i("div", pa, [
|
|
830
830
|
i("div", ga, [
|
|
831
|
-
|
|
831
|
+
B(b(e.s.Name || "#" + e.s.Id) + " ", 1),
|
|
832
832
|
e.s._meta && e.s.Fee == null ? (g(), M("span", ha, "free")) : K("", !0)
|
|
833
833
|
]),
|
|
834
834
|
i("div", ya, b(h.value), 1)
|
|
835
835
|
])
|
|
836
836
|
]),
|
|
837
837
|
i("div", Ma, [
|
|
838
|
-
T(
|
|
838
|
+
T(Ht, {
|
|
839
839
|
history: e.s.History
|
|
840
840
|
}, null, 8, ["history"])
|
|
841
841
|
]),
|
|
842
842
|
i("div", ba, [
|
|
843
843
|
c.value ? (g(), M("span", {
|
|
844
844
|
key: 0,
|
|
845
|
-
class:
|
|
845
|
+
class: E(c.value.positive ? "green" : "red")
|
|
846
846
|
}, b(c.value.text), 3)) : (g(), M("span", xa, "—"))
|
|
847
847
|
]),
|
|
848
848
|
i("div", wa, b(p(ke)(e.s.NumCopiers, p(s))), 1),
|
|
@@ -850,12 +850,12 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
850
850
|
i("div", ka, [
|
|
851
851
|
l.value ? (g(), M("span", {
|
|
852
852
|
key: 0,
|
|
853
|
-
class:
|
|
854
|
-
}, b(l.value.text), 3)) : (g(), M("span",
|
|
853
|
+
class: E(l.value.positive ? "green" : "red")
|
|
854
|
+
}, b(l.value.text), 3)) : (g(), M("span", _a, "—"))
|
|
855
855
|
]),
|
|
856
|
-
i("div",
|
|
857
|
-
i("div",
|
|
858
|
-
i("div",
|
|
856
|
+
i("div", Ia, b(p(_t)(o.value)), 1),
|
|
857
|
+
i("div", Ra, b(p($e)(e.s.AccountBalance, p(s))), 1),
|
|
858
|
+
i("div", Sa, b(p(kt)(e.s)), 1),
|
|
859
859
|
i("div", {
|
|
860
860
|
class: "c-link",
|
|
861
861
|
onClick: f[2] || (f[2] = ne(() => {
|
|
@@ -868,8 +868,8 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
868
868
|
rel: "noopener",
|
|
869
869
|
onClick: f[1] || (f[1] = ne(() => {
|
|
870
870
|
}, ["stop"]))
|
|
871
|
-
}, "
|
|
872
|
-
X(
|
|
871
|
+
}, " Subscribe ", 8, Pa),
|
|
872
|
+
X(I.$slots, "row-actions", { strategy: e.s }, void 0, !0)
|
|
873
873
|
])
|
|
874
874
|
], 10, ca),
|
|
875
875
|
e.expanded ? (g(), M("div", {
|
|
@@ -886,9 +886,9 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
886
886
|
]),
|
|
887
887
|
i("div", Na, [
|
|
888
888
|
f[6] || (f[6] = i("div", { class: "label" }, "Monthly profit", -1)),
|
|
889
|
-
i("div",
|
|
889
|
+
i("div", Da, b(p(j)(e.s.MonthlyProfit, p(s))), 1)
|
|
890
890
|
]),
|
|
891
|
-
i("div",
|
|
891
|
+
i("div", La, [
|
|
892
892
|
f[7] || (f[7] = i("div", { class: "label" }, "Yearly profit", -1)),
|
|
893
893
|
i("div", Ua, b(p(j)(e.s.YearlyProfit, p(s))), 1)
|
|
894
894
|
]),
|
|
@@ -906,9 +906,9 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
906
906
|
]),
|
|
907
907
|
i("div", za, [
|
|
908
908
|
f[11] || (f[11] = i("div", { class: "label" }, "Trades total", -1)),
|
|
909
|
-
i("div",
|
|
909
|
+
i("div", Ha, b(p(ke)(e.s.TradesTotal, p(s))), 1)
|
|
910
910
|
]),
|
|
911
|
-
i("div",
|
|
911
|
+
i("div", Ga, [
|
|
912
912
|
f[12] || (f[12] = i("div", { class: "label" }, "Win rate", -1)),
|
|
913
913
|
i("div", ja, [
|
|
914
914
|
r.value >= 0 ? (g(), M("span", Wa, b(r.value.toFixed(1)) + "% / " + b(m.value.toFixed(1)) + "%", 1)) : (g(), M("span", qa, "—"))
|
|
@@ -924,27 +924,27 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
924
924
|
]),
|
|
925
925
|
i("div", Za, [
|
|
926
926
|
i("button", {
|
|
927
|
-
class:
|
|
927
|
+
class: E(["pill", { on: d.value }]),
|
|
928
928
|
type: "button",
|
|
929
|
-
onClick:
|
|
929
|
+
onClick: _
|
|
930
930
|
}, b(d.value ? "Hide" : "Open Trades"), 3),
|
|
931
931
|
i("button", {
|
|
932
|
-
class:
|
|
932
|
+
class: E(["pill", { on: u.value }]),
|
|
933
933
|
type: "button",
|
|
934
934
|
onClick: k
|
|
935
935
|
}, b(u.value ? "Hide" : "Trade History"), 3)
|
|
936
936
|
]),
|
|
937
|
-
d.value ? (g(), ue(
|
|
937
|
+
d.value ? (g(), ue(Se, {
|
|
938
938
|
key: 0,
|
|
939
939
|
kind: "open",
|
|
940
|
-
trades: ((
|
|
940
|
+
trades: ((S = e.openTrades) == null ? void 0 : S.trades) ?? null,
|
|
941
941
|
loading: !!((A = e.openTrades) != null && A.loading),
|
|
942
942
|
locale: p(s)
|
|
943
943
|
}, null, 8, ["trades", "loading", "locale"])) : K("", !0),
|
|
944
|
-
u.value ? (g(), ue(
|
|
944
|
+
u.value ? (g(), ue(Se, {
|
|
945
945
|
key: 1,
|
|
946
946
|
kind: "closed",
|
|
947
|
-
trades: ((
|
|
947
|
+
trades: ((R = e.closedTrades) == null ? void 0 : R.trades) ?? null,
|
|
948
948
|
loading: !!((x = e.closedTrades) != null && x.loading),
|
|
949
949
|
locale: p(s)
|
|
950
950
|
}, null, 8, ["trades", "loading", "locale"])) : K("", !0)
|
|
@@ -952,7 +952,7 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
952
952
|
], 64);
|
|
953
953
|
};
|
|
954
954
|
}
|
|
955
|
-
}), Qa = /* @__PURE__ */ N(Ja, [["__scopeId", "data-v-
|
|
955
|
+
}), Qa = /* @__PURE__ */ N(Ja, [["__scopeId", "data-v-a2fd3e98"]]), en = {
|
|
956
956
|
key: 0,
|
|
957
957
|
class: "pelican-pager"
|
|
958
958
|
}, tn = ["disabled"], an = {
|
|
@@ -983,7 +983,7 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
983
983
|
(g(!0), M(D, null, Y(e.range, (r, m) => (g(), M(D, { key: m }, [
|
|
984
984
|
r === "…" ? (g(), M("span", an, "…")) : (g(), M("button", {
|
|
985
985
|
key: 1,
|
|
986
|
-
class:
|
|
986
|
+
class: E(["page", { cur: r === e.page }]),
|
|
987
987
|
onClick: (h) => s(r)
|
|
988
988
|
}, b(r), 11, nn))
|
|
989
989
|
], 64))), 128)),
|
|
@@ -992,7 +992,7 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
992
992
|
onClick: o[1] || (o[1] = (r) => s("next"))
|
|
993
993
|
}, "next ›", 8, ln),
|
|
994
994
|
i("span", sn, [
|
|
995
|
-
o[2] || (o[2] =
|
|
995
|
+
o[2] || (o[2] = B(" go to ", -1)),
|
|
996
996
|
i("input", {
|
|
997
997
|
type: "number",
|
|
998
998
|
min: 1,
|
|
@@ -1038,14 +1038,14 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
1038
1038
|
o[2] || (o[2] = i("div", null, "Equity curve", -1)),
|
|
1039
1039
|
(g(), M(D, null, Y(s, (r) => i("div", {
|
|
1040
1040
|
key: r.key,
|
|
1041
|
-
class:
|
|
1041
|
+
class: E(["c-num sortable", c(r.key)]),
|
|
1042
1042
|
onClick: (m) => n("toggle-sort", r.key)
|
|
1043
1043
|
}, b(r.label), 11, mn)), 64)),
|
|
1044
1044
|
o[3] || (o[3] = i("div", null, null, -1))
|
|
1045
1045
|
]),
|
|
1046
1046
|
e.pageItems.length === 0 ? (g(), M("div", fn, [
|
|
1047
1047
|
X(l.$slots, "empty", {}, () => [
|
|
1048
|
-
o[4] || (o[4] =
|
|
1048
|
+
o[4] || (o[4] = B("No matches.", -1))
|
|
1049
1049
|
], !0)
|
|
1050
1050
|
])) : (g(!0), M(D, { key: 1 }, Y(e.pageItems, (r) => (g(), ue(Qa, {
|
|
1051
1051
|
key: r.Id,
|
|
@@ -1073,7 +1073,7 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
1073
1073
|
}), pn = /* @__PURE__ */ N(vn, [["__scopeId", "data-v-c61b9ce8"]]), gn = {
|
|
1074
1074
|
key: 0,
|
|
1075
1075
|
class: "pelican-progress"
|
|
1076
|
-
}, hn = { class: "bar" }, yn = { class: "caption" }, Mn =
|
|
1076
|
+
}, hn = { class: "bar" }, yn = { class: "caption" }, Mn = /* @__PURE__ */ F({
|
|
1077
1077
|
__name: "ProgressBar",
|
|
1078
1078
|
props: {
|
|
1079
1079
|
loaded: {},
|
|
@@ -1090,24 +1090,18 @@ const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = S
|
|
|
1090
1090
|
style: Q({ width: a.value.toFixed(1) + "%" })
|
|
1091
1091
|
}, null, 4)
|
|
1092
1092
|
]),
|
|
1093
|
-
i("div", yn,
|
|
1094
|
-
s[0] || (s[0] = L(" Building full catalog: ", -1)),
|
|
1095
|
-
i("b", null, b(e.loaded.toLocaleString("en-US")), 1),
|
|
1096
|
-
L(" / " + b(e.total.toLocaleString("en-US")) + " strategies (" + b(a.value.toFixed(0)) + "%) · ", 1),
|
|
1097
|
-
s[1] || (s[1] = i("i", null, "upstream rate-limited", -1))
|
|
1098
|
-
]),
|
|
1099
|
-
i("div", Mn, " All " + b(e.total.toLocaleString("en-US")) + " strategies are visible. Stats fill in as the build progresses; refresh of data every 20 sec. ", 1)
|
|
1093
|
+
i("div", yn, "Refreshing strategy data · " + b(a.value.toFixed(0)) + "%", 1)
|
|
1100
1094
|
])) : K("", !0);
|
|
1101
1095
|
}
|
|
1102
|
-
}),
|
|
1103
|
-
function
|
|
1104
|
-
const t =
|
|
1096
|
+
}), bn = /* @__PURE__ */ N(Mn, [["__scopeId", "data-v-032fb4e2"]]), Fe = "pelican-theme";
|
|
1097
|
+
function xn(e = "auto") {
|
|
1098
|
+
const t = wn(), a = P(t ?? e), n = P("dark"), s = typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null, c = () => {
|
|
1105
1099
|
const m = a.value;
|
|
1106
1100
|
n.value = m === "dark" ? "dark" : m === "light" ? "light" : s != null && s.matches ? "dark" : "light";
|
|
1107
1101
|
}, l = () => {
|
|
1108
1102
|
a.value === "auto" && c();
|
|
1109
1103
|
};
|
|
1110
|
-
s && (s.addEventListener ? s.addEventListener("change", l) : s.addListener(l)),
|
|
1104
|
+
s && (s.addEventListener ? s.addEventListener("change", l) : s.addListener(l)), U(a, (m) => {
|
|
1111
1105
|
try {
|
|
1112
1106
|
localStorage.setItem(Fe, m);
|
|
1113
1107
|
} catch {
|
|
@@ -1124,7 +1118,7 @@ function wn(e = "auto") {
|
|
|
1124
1118
|
}
|
|
1125
1119
|
return { mode: a, resolved: n, setMode: o, cycle: r };
|
|
1126
1120
|
}
|
|
1127
|
-
function
|
|
1121
|
+
function wn() {
|
|
1128
1122
|
try {
|
|
1129
1123
|
const e = localStorage.getItem(Fe);
|
|
1130
1124
|
return e === "dark" || e === "light" || e === "auto" ? e : null;
|
|
@@ -1157,7 +1151,7 @@ function ee(e, t) {
|
|
|
1157
1151
|
const a = e.endsWith("/") ? e.slice(0, -1) : e, n = t.startsWith("/") ? t : "/" + t;
|
|
1158
1152
|
return a + n;
|
|
1159
1153
|
}
|
|
1160
|
-
function
|
|
1154
|
+
function $n({ apiBase: e, catalogBase: t, onError: a }) {
|
|
1161
1155
|
const n = Ee(/* @__PURE__ */ new Map()), s = P(!1), c = P(!1), l = P(0), o = P(0), r = P(null), m = $(() => Array.from(n.value.values()));
|
|
1162
1156
|
let h = !1;
|
|
1163
1157
|
const v = (y) => {
|
|
@@ -1166,12 +1160,12 @@ function kn({ apiBase: e, catalogBase: t, onError: a }) {
|
|
|
1166
1160
|
const y = t == null ? void 0 : t.value;
|
|
1167
1161
|
return !!y && y !== e.value;
|
|
1168
1162
|
}, u = () => (t == null ? void 0 : t.value) || e.value;
|
|
1169
|
-
async function
|
|
1163
|
+
async function _(y) {
|
|
1170
1164
|
try {
|
|
1171
1165
|
const O = await re(y ? "/api/strategies-full?partial=1" : "/api/strategies-full", u());
|
|
1172
1166
|
o.value = O.length;
|
|
1173
1167
|
const z = n.value;
|
|
1174
|
-
for (const
|
|
1168
|
+
for (const V of O) z.set(V.Id, { ...z.get(V.Id), ...V });
|
|
1175
1169
|
le(n);
|
|
1176
1170
|
} catch (C) {
|
|
1177
1171
|
v(C);
|
|
@@ -1185,12 +1179,12 @@ function kn({ apiBase: e, catalogBase: t, onError: a }) {
|
|
|
1185
1179
|
return v(y), null;
|
|
1186
1180
|
}
|
|
1187
1181
|
}
|
|
1188
|
-
async function
|
|
1182
|
+
async function I() {
|
|
1189
1183
|
if (d()) {
|
|
1190
|
-
await
|
|
1184
|
+
await _(!1), k(), s.value = !0;
|
|
1191
1185
|
return;
|
|
1192
1186
|
}
|
|
1193
|
-
await
|
|
1187
|
+
await _(!0);
|
|
1194
1188
|
let y = Date.now();
|
|
1195
1189
|
for (; !h; ) {
|
|
1196
1190
|
const C = await k();
|
|
@@ -1199,23 +1193,23 @@ function kn({ apiBase: e, catalogBase: t, onError: a }) {
|
|
|
1199
1193
|
continue;
|
|
1200
1194
|
}
|
|
1201
1195
|
if (C.ready) break;
|
|
1202
|
-
Date.now() - y > je && (await
|
|
1196
|
+
Date.now() - y > je && (await _(!0), y = Date.now()), await Ce(Ge);
|
|
1203
1197
|
}
|
|
1204
|
-
h || (await
|
|
1198
|
+
h || (await _(!1), s.value = !0);
|
|
1205
1199
|
}
|
|
1206
1200
|
const f = /* @__PURE__ */ new Set();
|
|
1207
|
-
async function
|
|
1201
|
+
async function S(y) {
|
|
1208
1202
|
var O;
|
|
1209
1203
|
if (f.has(y)) return;
|
|
1210
1204
|
const C = n.value.get(y);
|
|
1211
1205
|
if (!(C != null && C._enrichAttempted && C._meta && C._stats && ((O = C.History) != null && O.length))) {
|
|
1212
1206
|
f.add(y);
|
|
1213
1207
|
try {
|
|
1214
|
-
const [z,
|
|
1208
|
+
const [z, V] = await Promise.all([
|
|
1215
1209
|
Pe(ee(e.value, `/api/strategies/${y}`)),
|
|
1216
1210
|
Pe(ee(e.value, `/api/strategies/${y}/stats`))
|
|
1217
|
-
]),
|
|
1218
|
-
|
|
1211
|
+
]), L = n.value, H = L.get(y) ?? { Id: y };
|
|
1212
|
+
kn(H, z), _n(H, V), H._enrichAttempted = !0, H.IsEnabled === !1 ? L.delete(y) : L.set(y, H), le(n);
|
|
1219
1213
|
} finally {
|
|
1220
1214
|
f.delete(y);
|
|
1221
1215
|
}
|
|
@@ -1228,23 +1222,23 @@ function kn({ apiBase: e, catalogBase: t, onError: a }) {
|
|
|
1228
1222
|
`/api/strategies?filter=${encodeURIComponent(y)}`,
|
|
1229
1223
|
e.value
|
|
1230
1224
|
), O = n.value, z = [];
|
|
1231
|
-
let
|
|
1232
|
-
for (const
|
|
1233
|
-
O.has(
|
|
1234
|
-
|
|
1235
|
-
for (const
|
|
1225
|
+
let V = 0;
|
|
1226
|
+
for (const L of C)
|
|
1227
|
+
O.has(L.Id) || (O.set(L.Id, { ...L, _stats: !1, _meta: !1 }), z.push(L.Id), V++);
|
|
1228
|
+
V && (o.value += V, le(n));
|
|
1229
|
+
for (const L of z) S(L);
|
|
1236
1230
|
} catch (C) {
|
|
1237
1231
|
v(C);
|
|
1238
1232
|
}
|
|
1239
1233
|
}
|
|
1240
|
-
function
|
|
1241
|
-
h = !1,
|
|
1234
|
+
function R() {
|
|
1235
|
+
h = !1, I();
|
|
1242
1236
|
}
|
|
1243
1237
|
function x() {
|
|
1244
1238
|
h = !0;
|
|
1245
1239
|
}
|
|
1246
1240
|
async function w() {
|
|
1247
|
-
x(), n.value = /* @__PURE__ */ new Map(), s.value = !1, l.value = 0, o.value = 0, r.value = null,
|
|
1241
|
+
x(), n.value = /* @__PURE__ */ new Map(), s.value = !1, l.value = 0, o.value = 0, r.value = null, R();
|
|
1248
1242
|
}
|
|
1249
1243
|
return fe(x), {
|
|
1250
1244
|
catalog: m,
|
|
@@ -1253,10 +1247,10 @@ function kn({ apiBase: e, catalogBase: t, onError: a }) {
|
|
|
1253
1247
|
loaded: l,
|
|
1254
1248
|
total: o,
|
|
1255
1249
|
builtAt: r,
|
|
1256
|
-
enrichOne:
|
|
1250
|
+
enrichOne: S,
|
|
1257
1251
|
searchExtra: A,
|
|
1258
1252
|
refresh: w,
|
|
1259
|
-
start:
|
|
1253
|
+
start: R,
|
|
1260
1254
|
stop: x
|
|
1261
1255
|
};
|
|
1262
1256
|
}
|
|
@@ -1268,13 +1262,13 @@ async function Pe(e) {
|
|
|
1268
1262
|
return null;
|
|
1269
1263
|
}
|
|
1270
1264
|
}
|
|
1271
|
-
function
|
|
1265
|
+
function kn(e, t) {
|
|
1272
1266
|
t && (e.Name = t.Name ?? e.Name, e.NumCopiers = t.NumCopiers ?? null, e.Fee = t.Fee ?? null, e.RiskProfile = t.RiskProfile ?? null, e.IsSimulated = t.IsSimulated ?? !1, t.IsEnabled !== void 0 && (e.IsEnabled = t.IsEnabled), t.ImageUploaded !== void 0 && (e.ImageUploaded = t.ImageUploaded), e.Profile = t.Profile ?? e.Profile, e._meta = !0);
|
|
1273
1267
|
}
|
|
1274
1268
|
function _n(e, t) {
|
|
1275
1269
|
var o, r, m, h, v, d;
|
|
1276
1270
|
if (!t) return;
|
|
1277
|
-
const a = ((o = t.Profitability) == null ? void 0 : o.Inception) ?? {}, n = ((r = t.Trades) == null ? void 0 : r.Inception) ?? {}, s = a.History ?? [], c = s.length > 60 ? Math.ceil(s.length / 60) : 1, l = s.filter((u,
|
|
1271
|
+
const a = ((o = t.Profitability) == null ? void 0 : o.Inception) ?? {}, n = ((r = t.Trades) == null ? void 0 : r.Inception) ?? {}, s = a.History ?? [], c = s.length > 60 ? Math.ceil(s.length / 60) : 1, l = s.filter((u, _) => _ % c === 0 || _ === s.length - 1).map((u) => ({ Timestamp: u.Timestamp, AccountReturn: u.AccountReturn }));
|
|
1278
1272
|
e.Inception = t.Inception ?? e.Inception, e.Currency = t.CurrencyCode || "USD", e.Return = a.UnrealisedReturn != null ? a.UnrealisedReturn * 100 : a.RealisedReturn != null ? a.RealisedReturn * 100 : null, e.MaxDD = a.MaxDrawdown != null ? a.MaxDrawdown * 100 : null, e.RealisedPnl = a.RealisedPnl ?? null, e.UnrealisedPnl = a.UnrealisedPnl ?? null, e.History = l, e.TradesTotal = n.Total ?? 0, e.Wins = n.Wins ?? 0, e.Losses = n.Losses ?? 0, e.Markets = Array.isArray(n.Markets) ? n.Markets.slice(0, 12).map((u) => ({ n: u.MarketName, c: u.Count })) : [], e.AccountBalance = ((m = t.Status) == null ? void 0 : m.Balance) ?? null, e.CopiersAUM = ((h = t.CopiersBalance) == null ? void 0 : h.Balance) ?? null, e.MonthlyProfit = ((v = t.CopiersProfit) == null ? void 0 : v.Month) ?? null, e.YearlyProfit = ((d = t.CopiersProfit) == null ? void 0 : d.Year) ?? null, e._stats = !0;
|
|
1279
1273
|
}
|
|
1280
1274
|
function Ce(e) {
|
|
@@ -1297,7 +1291,7 @@ function me() {
|
|
|
1297
1291
|
search: ""
|
|
1298
1292
|
};
|
|
1299
1293
|
}
|
|
1300
|
-
function
|
|
1294
|
+
function In(e, t = {}) {
|
|
1301
1295
|
const a = me(), n = Te({
|
|
1302
1296
|
...a,
|
|
1303
1297
|
...t,
|
|
@@ -1322,7 +1316,7 @@ function Rn(e, t) {
|
|
|
1322
1316
|
const n = W(e.Inception);
|
|
1323
1317
|
return !(t.ageMin != null && (n == null || n < t.ageMin) || t.retMin != null && (e.Return == null || e.Return < t.retMin) || t.retMax != null && (e.Return == null || e.Return > t.retMax) || t.ddMax != null && e.MaxDD != null && Math.abs(e.MaxDD) > t.ddMax);
|
|
1324
1318
|
}
|
|
1325
|
-
const
|
|
1319
|
+
const Sn = {
|
|
1326
1320
|
"return-desc": (e, t) => (t.Return ?? -1e18) - (e.Return ?? -1e18),
|
|
1327
1321
|
"return-asc": (e, t) => (e.Return ?? 1e18) - (t.Return ?? 1e18),
|
|
1328
1322
|
"dd-asc": (e, t) => Math.abs(e.MaxDD ?? 1e9) - Math.abs(t.MaxDD ?? 1e9),
|
|
@@ -1344,9 +1338,9 @@ const Pn = {
|
|
|
1344
1338
|
"monthly-desc": (e, t) => (t.MonthlyProfit ?? -1e18) - (e.MonthlyProfit ?? -1e18),
|
|
1345
1339
|
"monthly-asc": (e, t) => (e.MonthlyProfit ?? 1e18) - (t.MonthlyProfit ?? 1e18)
|
|
1346
1340
|
};
|
|
1347
|
-
function
|
|
1341
|
+
function Pn(e, t = "return-desc") {
|
|
1348
1342
|
const a = P(t), n = $(() => {
|
|
1349
|
-
const c =
|
|
1343
|
+
const c = Sn[a.value] ?? (() => 0);
|
|
1350
1344
|
return e.value.slice().sort(c);
|
|
1351
1345
|
});
|
|
1352
1346
|
function s(c) {
|
|
@@ -1362,9 +1356,9 @@ function Cn(e, t = "return-desc") {
|
|
|
1362
1356
|
}
|
|
1363
1357
|
};
|
|
1364
1358
|
}
|
|
1365
|
-
function
|
|
1359
|
+
function Cn(e, t) {
|
|
1366
1360
|
const a = P(1), n = $(() => Math.max(1, Math.ceil(e.value.length / t)));
|
|
1367
|
-
|
|
1361
|
+
U(n, (l) => {
|
|
1368
1362
|
a.value > l && (a.value = l), a.value < 1 && (a.value = 1);
|
|
1369
1363
|
});
|
|
1370
1364
|
const s = $(() => {
|
|
@@ -1394,7 +1388,7 @@ function Tn(e, t) {
|
|
|
1394
1388
|
}
|
|
1395
1389
|
};
|
|
1396
1390
|
}
|
|
1397
|
-
function
|
|
1391
|
+
function Tn(e) {
|
|
1398
1392
|
const t = P(/* @__PURE__ */ new Map()), a = P(/* @__PURE__ */ new Map());
|
|
1399
1393
|
function n(c, l) {
|
|
1400
1394
|
return (l === "open" ? t.value : a.value).get(c) ?? null;
|
|
@@ -1406,8 +1400,8 @@ function An(e) {
|
|
|
1406
1400
|
m.set(c, { loading: !0, trades: null, error: null }), o.value = m;
|
|
1407
1401
|
let h = "";
|
|
1408
1402
|
if (l === "closed") {
|
|
1409
|
-
const k = /* @__PURE__ */ new Date(),
|
|
1410
|
-
h = `?startDate=${encodeURIComponent(f(
|
|
1403
|
+
const k = /* @__PURE__ */ new Date(), I = new Date(Date.now() - We * 864e5), f = (S) => S.toISOString().replace(/\.\d+Z$/, "Z");
|
|
1404
|
+
h = `?startDate=${encodeURIComponent(f(I))}&endDate=${encodeURIComponent(f(k))}`;
|
|
1411
1405
|
}
|
|
1412
1406
|
const v = ee(e.value, `/api/strategies/${c}/signals/${l}${h}`);
|
|
1413
1407
|
let d = [], u = null;
|
|
@@ -1418,12 +1412,12 @@ function An(e) {
|
|
|
1418
1412
|
} catch (k) {
|
|
1419
1413
|
u = k.code ? k : J("fetch_failed", k.message), d = [];
|
|
1420
1414
|
}
|
|
1421
|
-
const
|
|
1422
|
-
|
|
1415
|
+
const _ = new Map(o.value);
|
|
1416
|
+
_.set(c, { loading: !1, trades: d, error: u }), o.value = _;
|
|
1423
1417
|
}
|
|
1424
1418
|
return { open: t, closed: a, load: s, get: n };
|
|
1425
1419
|
}
|
|
1426
|
-
const
|
|
1420
|
+
const An = ["data-theme"], Fn = { class: "brand-row" }, Nn = ["title"], Dn = { "aria-hidden": "true" }, Ln = { class: "pelican-main" }, Un = /* @__PURE__ */ F({
|
|
1427
1421
|
__name: "PelicanLibertexSocial",
|
|
1428
1422
|
props: {
|
|
1429
1423
|
apiBase: {},
|
|
@@ -1439,49 +1433,49 @@ const Fn = ["data-theme"], Nn = { class: "brand-row" }, Ln = ["title"], Dn = { "
|
|
|
1439
1433
|
setup(e, { emit: t }) {
|
|
1440
1434
|
const a = e, n = t;
|
|
1441
1435
|
se(ra, a.apiBase), se(ua, a.catalogBase ?? a.apiBase), se(Ae, a.locale);
|
|
1442
|
-
const s = be(a, "apiBase"), c = be(a, "catalogBase"), l =
|
|
1443
|
-
|
|
1436
|
+
const s = be(a, "apiBase"), c = be(a, "catalogBase"), l = xn(a.theme);
|
|
1437
|
+
U(l.mode, (x) => n("update:theme", x)), U(
|
|
1444
1438
|
() => a.theme,
|
|
1445
1439
|
(x) => l.setMode(x)
|
|
1446
1440
|
);
|
|
1447
|
-
const o =
|
|
1441
|
+
const o = $n({
|
|
1448
1442
|
apiBase: s,
|
|
1449
1443
|
catalogBase: c,
|
|
1450
1444
|
onError: (x) => n("error", x)
|
|
1451
|
-
}), r =
|
|
1452
|
-
|
|
1445
|
+
}), r = In(o.catalog, a.defaultFilters ?? {}), m = Pn(r.filtered, a.defaultSort), h = Cn(m.sorted, a.pageSize), v = Tn(s);
|
|
1446
|
+
U(h.pageItems, (x) => {
|
|
1453
1447
|
x.forEach((w) => {
|
|
1454
1448
|
var y;
|
|
1455
1449
|
(y = w.History) != null && y.length || o.enrichOne(w.Id);
|
|
1456
1450
|
});
|
|
1457
1451
|
}, { immediate: !0 });
|
|
1458
|
-
const d = Te(/* @__PURE__ */ new Set()), u = P(!1),
|
|
1452
|
+
const d = Te(/* @__PURE__ */ new Set()), u = P(!1), _ = P(null);
|
|
1459
1453
|
function k(x) {
|
|
1460
1454
|
d.has(x) ? d.delete(x) : d.add(x);
|
|
1461
1455
|
const w = o.catalog.value.find((y) => y.Id === x);
|
|
1462
1456
|
w && ((!w._meta || !w._stats) && !w._enrichAttempted && o.enrichOne(x), n("select-strategy", w));
|
|
1463
1457
|
}
|
|
1464
|
-
function
|
|
1458
|
+
function I(x) {
|
|
1465
1459
|
m.toggleColumn(x), h.setPage(1);
|
|
1466
1460
|
}
|
|
1467
1461
|
function f(x) {
|
|
1468
1462
|
Object.assign(r.filters, x), h.setPage(1);
|
|
1469
1463
|
}
|
|
1470
|
-
function
|
|
1464
|
+
function S() {
|
|
1471
1465
|
const x = me();
|
|
1472
|
-
Object.assign(r.filters, x), r.filters.risk = x.risk,
|
|
1466
|
+
Object.assign(r.filters, x), r.filters.risk = x.risk, _.value = null, h.setPage(1);
|
|
1473
1467
|
}
|
|
1474
1468
|
function A({ id: x, kind: w }) {
|
|
1475
1469
|
v.load(x, w);
|
|
1476
1470
|
}
|
|
1477
|
-
function
|
|
1471
|
+
function R(x) {
|
|
1478
1472
|
x === "prev" ? h.prev() : x === "next" ? h.next() : h.setPage(x);
|
|
1479
1473
|
}
|
|
1480
1474
|
return Be(() => o.start()), (x, w) => (g(), M("div", {
|
|
1481
1475
|
class: "pelican-libsoc",
|
|
1482
1476
|
"data-theme": p(l).resolved.value
|
|
1483
1477
|
}, [
|
|
1484
|
-
i("header",
|
|
1478
|
+
i("header", Fn, [
|
|
1485
1479
|
X(x.$slots, "brand", {}, () => [
|
|
1486
1480
|
w[6] || (w[6] = i("div", { class: "default-brand" }, "Libertex Social — Copy Trading", -1))
|
|
1487
1481
|
], !0),
|
|
@@ -1493,7 +1487,7 @@ const Fn = ["data-theme"], Nn = { class: "brand-row" }, Ln = ["title"], Dn = { "
|
|
|
1493
1487
|
(...y) => p(l).cycle && p(l).cycle(...y))
|
|
1494
1488
|
}, [
|
|
1495
1489
|
i("span", Dn, b(p(l).resolved.value === "dark" ? "🌙" : "☀️"), 1)
|
|
1496
|
-
], 8,
|
|
1490
|
+
], 8, Nn)
|
|
1497
1491
|
]),
|
|
1498
1492
|
T(st, {
|
|
1499
1493
|
search: p(r).filters.search,
|
|
@@ -1507,19 +1501,19 @@ const Fn = ["data-theme"], Nn = { class: "brand-row" }, Ln = ["title"], Dn = { "
|
|
|
1507
1501
|
onRefresh: p(o).refresh,
|
|
1508
1502
|
onToggleFilters: w[3] || (w[3] = (y) => u.value = !u.value)
|
|
1509
1503
|
}, null, 8, ["search", "sort-key", "total", "filtered-total", "page", "total-pages", "onRefresh"]),
|
|
1510
|
-
T(
|
|
1504
|
+
T(bn, {
|
|
1511
1505
|
loaded: p(o).loaded.value,
|
|
1512
1506
|
total: p(o).total.value,
|
|
1513
1507
|
active: p(o).building.value && !p(o).ready.value
|
|
1514
1508
|
}, null, 8, ["loaded", "total", "active"]),
|
|
1515
|
-
i("main",
|
|
1516
|
-
T(
|
|
1509
|
+
i("main", Ln, [
|
|
1510
|
+
T(Lt, {
|
|
1517
1511
|
filters: p(r).filters,
|
|
1518
|
-
"invest-amount":
|
|
1512
|
+
"invest-amount": _.value,
|
|
1519
1513
|
open: u.value,
|
|
1520
1514
|
"onUpdate:filters": f,
|
|
1521
|
-
"onUpdate:investAmount": w[4] || (w[4] = (y) =>
|
|
1522
|
-
onReset:
|
|
1515
|
+
"onUpdate:investAmount": w[4] || (w[4] = (y) => _.value = y),
|
|
1516
|
+
onReset: S
|
|
1523
1517
|
}, null, 8, ["filters", "invest-amount", "open"]),
|
|
1524
1518
|
T(pn, {
|
|
1525
1519
|
"page-items": p(h).pageItems.value,
|
|
@@ -1531,14 +1525,14 @@ const Fn = ["data-theme"], Nn = { class: "brand-row" }, Ln = ["title"], Dn = { "
|
|
|
1531
1525
|
"open-signals": p(v).open.value,
|
|
1532
1526
|
"closed-signals": p(v).closed.value,
|
|
1533
1527
|
onToggleRow: k,
|
|
1534
|
-
onToggleSort:
|
|
1528
|
+
onToggleSort: I,
|
|
1535
1529
|
onLoadTrades: A,
|
|
1536
1530
|
onSelect: w[5] || (w[5] = (y) => n("select-strategy", y)),
|
|
1537
|
-
onGo:
|
|
1531
|
+
onGo: R
|
|
1538
1532
|
}, {
|
|
1539
1533
|
empty: ce(() => [
|
|
1540
1534
|
X(x.$slots, "empty", {}, () => [
|
|
1541
|
-
w[7] || (w[7] =
|
|
1535
|
+
w[7] || (w[7] = B("No matches.", -1))
|
|
1542
1536
|
], !0)
|
|
1543
1537
|
]),
|
|
1544
1538
|
"row-actions": ce((y) => [
|
|
@@ -1547,11 +1541,11 @@ const Fn = ["data-theme"], Nn = { class: "brand-row" }, Ln = ["title"], Dn = { "
|
|
|
1547
1541
|
_: 3
|
|
1548
1542
|
}, 8, ["page-items", "expanded", "sort-key", "page", "total-pages", "page-range", "open-signals", "closed-signals"])
|
|
1549
1543
|
])
|
|
1550
|
-
], 8,
|
|
1544
|
+
], 8, An));
|
|
1551
1545
|
}
|
|
1552
|
-
}),
|
|
1546
|
+
}), En = /* @__PURE__ */ N(Un, [["__scopeId", "data-v-e2cce41d"]]);
|
|
1553
1547
|
export {
|
|
1554
|
-
|
|
1548
|
+
En as PelicanLibertexSocial,
|
|
1555
1549
|
qe as SORT_KEYS,
|
|
1556
1550
|
Xe as SORT_LABELS,
|
|
1557
1551
|
Ze as SORT_TOGGLE,
|