@mashkovd/pelican-vue 0.2.0 → 0.3.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/README.md +15 -1
- package/dist/index.d.ts +8 -0
- package/dist/pelican-libertex-social.mjs +630 -619
- package/dist/pelican-libertex-social.mjs.map +1 -1
- package/dist/pelican-libertex-social.umd.cjs +1 -1
- package/dist/pelican-libertex-social.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { onScopeDispose as
|
|
1
|
+
import { onScopeDispose as me, defineComponent as F, ref as R, watch as E, openBlock as p, createElementBlock as y, createElementVNode as i, createTextVNode as D, toDisplayString as b, Fragment as U, renderList as K, unref as v, normalizeClass as B, computed as k, normalizeStyle as ie, createCommentVNode as O, createVNode as P, withDirectives as he, vShow as ye, inject as Ue, withModifiers as te, renderSlot as q, createBlock as re, withCtx as ue, mergeProps as Ve, shallowRef as Ee, triggerRef as ae, reactive as Ce, provide as ne, toRef as Me, 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) => {
|
|
5
5
|
a && clearTimeout(a), a = setTimeout(() => {
|
|
6
6
|
a = null, e(...c);
|
|
7
7
|
}, t);
|
|
8
|
-
},
|
|
8
|
+
}, s = () => {
|
|
9
9
|
a && (clearTimeout(a), a = null);
|
|
10
10
|
};
|
|
11
|
-
return
|
|
11
|
+
return me(s), { wrapped: n, cancel: s };
|
|
12
12
|
}
|
|
13
13
|
const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
14
14
|
"return-desc",
|
|
@@ -60,7 +60,7 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
60
60
|
fee: ["fee-asc", "fee-desc"],
|
|
61
61
|
age: ["age-desc", "age-asc"],
|
|
62
62
|
balance: ["balance-desc", "balance-asc"]
|
|
63
|
-
}, Je = { class: "pelican-toolbar" }, Qe = { class: "counts" }, et = ["value"], tt = { class: "sort" }, at = ["value"], nt = ["value"], lt = /* @__PURE__ */
|
|
63
|
+
}, Je = { class: "pelican-toolbar" }, Qe = { class: "counts" }, et = ["value"], tt = { class: "sort" }, at = ["value"], nt = ["value"], lt = /* @__PURE__ */ F({
|
|
64
64
|
__name: "Toolbar",
|
|
65
65
|
props: {
|
|
66
66
|
search: {},
|
|
@@ -72,91 +72,91 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
72
72
|
},
|
|
73
73
|
emits: ["update:search", "update:sortKey", "refresh", "toggle-filters"],
|
|
74
74
|
setup(e, { emit: t }) {
|
|
75
|
-
const a = e, n = t,
|
|
76
|
-
|
|
75
|
+
const a = e, n = t, s = R(a.search);
|
|
76
|
+
E(
|
|
77
77
|
() => a.search,
|
|
78
78
|
(u) => {
|
|
79
|
-
u !==
|
|
79
|
+
u !== s.value && (s.value = u);
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
82
|
const { wrapped: c } = Ye((u) => n("update:search", u), Ge);
|
|
83
83
|
function l(u) {
|
|
84
84
|
const m = u.target.value;
|
|
85
|
-
|
|
85
|
+
s.value = m, c(m);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function o(u) {
|
|
88
88
|
n("update:sortKey", u.target.value);
|
|
89
89
|
}
|
|
90
|
-
return (u, m) => (
|
|
91
|
-
|
|
90
|
+
return (u, m) => (p(), y("div", Je, [
|
|
91
|
+
i("button", {
|
|
92
92
|
class: "btn-flat filters-toggle",
|
|
93
93
|
type: "button",
|
|
94
|
-
onClick: m[0] || (m[0] = (
|
|
94
|
+
onClick: m[0] || (m[0] = (g) => n("toggle-filters"))
|
|
95
95
|
}, " Filters "),
|
|
96
|
-
|
|
97
|
-
m[2] || (m[2] =
|
|
98
|
-
|
|
99
|
-
m[3] || (m[3] =
|
|
100
|
-
|
|
101
|
-
m[4] || (m[4] =
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
i("div", Qe, [
|
|
97
|
+
m[2] || (m[2] = D(" Showing ", -1)),
|
|
98
|
+
i("b", null, b(e.filteredTotal.toLocaleString("en-US")), 1),
|
|
99
|
+
m[3] || (m[3] = D(" of ", -1)),
|
|
100
|
+
i("b", null, b(e.total.toLocaleString("en-US")), 1),
|
|
101
|
+
m[4] || (m[4] = D(" · page ", -1)),
|
|
102
|
+
i("b", null, b(e.page), 1),
|
|
103
|
+
D(" / " + b(e.totalPages), 1)
|
|
104
104
|
]),
|
|
105
|
-
|
|
105
|
+
i("input", {
|
|
106
106
|
class: "search",
|
|
107
107
|
type: "search",
|
|
108
108
|
placeholder: "Search by signal name…",
|
|
109
109
|
autocomplete: "off",
|
|
110
|
-
value:
|
|
110
|
+
value: s.value,
|
|
111
111
|
onInput: l
|
|
112
112
|
}, null, 40, et),
|
|
113
|
-
|
|
114
|
-
m[5] || (m[5] =
|
|
115
|
-
|
|
113
|
+
i("div", tt, [
|
|
114
|
+
m[5] || (m[5] = i("label", null, "Sort:", -1)),
|
|
115
|
+
i("select", {
|
|
116
116
|
value: e.sortKey,
|
|
117
|
-
onChange:
|
|
117
|
+
onChange: o
|
|
118
118
|
}, [
|
|
119
|
-
(
|
|
120
|
-
key:
|
|
121
|
-
value:
|
|
122
|
-
},
|
|
119
|
+
(p(!0), y(U, null, K(v(qe), (g) => (p(), y("option", {
|
|
120
|
+
key: g,
|
|
121
|
+
value: g
|
|
122
|
+
}, b(v(Xe)[g]), 9, nt))), 128))
|
|
123
123
|
], 40, at)
|
|
124
124
|
]),
|
|
125
|
-
|
|
125
|
+
i("button", {
|
|
126
126
|
class: "btn-flat",
|
|
127
127
|
type: "button",
|
|
128
128
|
title: "reload",
|
|
129
|
-
onClick: m[1] || (m[1] = (
|
|
129
|
+
onClick: m[1] || (m[1] = (g) => n("refresh"))
|
|
130
130
|
}, " ↻ reload ")
|
|
131
131
|
]));
|
|
132
132
|
}
|
|
133
|
-
}),
|
|
133
|
+
}), N = (e, t) => {
|
|
134
134
|
const a = e.__vccOpts || e;
|
|
135
|
-
for (const [n,
|
|
136
|
-
a[n] =
|
|
135
|
+
for (const [n, s] of t)
|
|
136
|
+
a[n] = s;
|
|
137
137
|
return a;
|
|
138
|
-
}, st = /* @__PURE__ */
|
|
138
|
+
}, st = /* @__PURE__ */ N(lt, [["__scopeId", "data-v-9803823c"]]), ot = { class: "pelican-chips" }, it = ["onClick"], rt = /* @__PURE__ */ F({
|
|
139
139
|
__name: "RiskChips",
|
|
140
140
|
props: {
|
|
141
141
|
modelValue: {}
|
|
142
142
|
},
|
|
143
143
|
emits: ["update:modelValue"],
|
|
144
144
|
setup(e, { emit: t }) {
|
|
145
|
-
const a = e, n = t,
|
|
145
|
+
const a = e, n = t, s = ["Low", "Medium", "High"];
|
|
146
146
|
function c(l) {
|
|
147
|
-
const
|
|
148
|
-
|
|
147
|
+
const o = new Set(a.modelValue);
|
|
148
|
+
o.has(l) ? o.delete(l) : o.add(l), n("update:modelValue", o);
|
|
149
149
|
}
|
|
150
|
-
return (l,
|
|
151
|
-
(
|
|
150
|
+
return (l, o) => (p(), y("div", ot, [
|
|
151
|
+
(p(), y(U, null, K(s, (u) => i("button", {
|
|
152
152
|
key: u,
|
|
153
153
|
type: "button",
|
|
154
|
-
class:
|
|
154
|
+
class: B(["chip", ["risk-" + u.toLowerCase(), { on: e.modelValue.has(u) }]]),
|
|
155
155
|
onClick: (m) => c(u)
|
|
156
|
-
},
|
|
156
|
+
}, b(u), 11, it)), 64))
|
|
157
157
|
]));
|
|
158
158
|
}
|
|
159
|
-
}), ut = /* @__PURE__ */
|
|
159
|
+
}), ut = /* @__PURE__ */ N(rt, [["__scopeId", "data-v-742a6c3b"]]), ct = { class: "pelican-fgroup" }, dt = { class: "title-row" }, mt = { class: "title" }, ft = { class: "val" }, vt = ["min", "max", "step", "value"], pt = /* @__PURE__ */ F({
|
|
160
160
|
__name: "RangeSingle",
|
|
161
161
|
props: {
|
|
162
162
|
label: {},
|
|
@@ -170,17 +170,17 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
170
170
|
},
|
|
171
171
|
emits: ["update:modelValue"],
|
|
172
172
|
setup(e, { emit: t }) {
|
|
173
|
-
const a = e, n = t,
|
|
173
|
+
const a = e, n = t, s = k(() => a.anyAt ?? a.min), c = k(() => !!a.inverted), l = k(() => a.modelValue == null ? c.value ? a.max : s.value : a.modelValue), o = k(() => a.modelValue == null ? "any" : a.format ? a.format(a.modelValue) : String(a.modelValue));
|
|
174
174
|
function u(m) {
|
|
175
|
-
const
|
|
176
|
-
isNaN(
|
|
175
|
+
const g = parseInt(m.target.value, 10);
|
|
176
|
+
isNaN(g) || (c.value && g >= a.max || !c.value && g <= s.value ? n("update:modelValue", null) : n("update:modelValue", g));
|
|
177
177
|
}
|
|
178
|
-
return (m,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
return (m, g) => (p(), y("div", ct, [
|
|
179
|
+
i("div", dt, [
|
|
180
|
+
i("label", mt, b(e.label), 1),
|
|
181
|
+
i("span", ft, b(o.value), 1)
|
|
182
182
|
]),
|
|
183
|
-
|
|
183
|
+
i("input", {
|
|
184
184
|
type: "range",
|
|
185
185
|
class: "range",
|
|
186
186
|
min: e.min,
|
|
@@ -192,10 +192,10 @@ 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 = { class: "dual-track" }, xt = ["min", "max", "value"], wt = ["min", "max", "value"], $t = {
|
|
196
196
|
key: 0,
|
|
197
197
|
class: "scale"
|
|
198
|
-
}, kt = /* @__PURE__ */
|
|
198
|
+
}, kt = /* @__PURE__ */ F({
|
|
199
199
|
__name: "RangeDual",
|
|
200
200
|
props: {
|
|
201
201
|
label: {},
|
|
@@ -211,65 +211,67 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
211
211
|
},
|
|
212
212
|
emits: ["update:modelValueMin", "update:modelValueMax"],
|
|
213
213
|
setup(e, { emit: t }) {
|
|
214
|
-
const a = e, n = t,
|
|
215
|
-
() => l.value <=
|
|
216
|
-
), m =
|
|
217
|
-
() =>
|
|
218
|
-
),
|
|
219
|
-
function
|
|
214
|
+
const a = e, n = t, s = k(() => a.rawMin ?? 0), c = k(() => a.rawMax ?? 100), l = k(() => a.modelValueMin ?? s.value), o = k(() => a.modelValueMax ?? c.value), u = k(
|
|
215
|
+
() => l.value <= s.value ? a.minLabel ?? "any" : a.formatRaw(a.rawToDomain(l.value))
|
|
216
|
+
), m = k(
|
|
217
|
+
() => o.value >= c.value ? a.maxLabel ?? "any" : a.formatRaw(a.rawToDomain(o.value))
|
|
218
|
+
), g = k(() => l.value <= s.value && o.value >= c.value ? "any" : `${u.value} – ${m.value}`);
|
|
219
|
+
function f(r) {
|
|
220
220
|
let w = parseInt(r.target.value, 10);
|
|
221
|
-
isNaN(w) || (w >
|
|
221
|
+
isNaN(w) || (w > o.value && (w = o.value), n("update:modelValueMin", w <= s.value ? null : w));
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function d(r) {
|
|
224
224
|
let w = parseInt(r.target.value, 10);
|
|
225
225
|
isNaN(w) || (w < l.value && (w = l.value), n("update:modelValueMax", w >= c.value ? null : w));
|
|
226
226
|
}
|
|
227
227
|
return (r, w) => {
|
|
228
228
|
var I;
|
|
229
|
-
return
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
return p(), y("div", gt, [
|
|
230
|
+
i("div", ht, [
|
|
231
|
+
i("label", yt, b(e.label), 1),
|
|
232
|
+
i("span", Mt, b(g.value), 1)
|
|
233
233
|
]),
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
i("div", bt, [
|
|
235
|
+
i("input", {
|
|
236
236
|
type: "range",
|
|
237
237
|
class: "range-dual",
|
|
238
|
-
min:
|
|
238
|
+
min: s.value,
|
|
239
239
|
max: c.value,
|
|
240
240
|
value: l.value,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
241
|
+
style: ie({ zIndex: l.value <= s.value || l.value >= o.value ? 5 : 4 }),
|
|
242
|
+
onInput: f,
|
|
243
|
+
onChange: f
|
|
244
|
+
}, null, 44, xt),
|
|
245
|
+
i("input", {
|
|
245
246
|
type: "range",
|
|
246
247
|
class: "range-dual",
|
|
247
|
-
min:
|
|
248
|
+
min: s.value,
|
|
248
249
|
max: c.value,
|
|
249
|
-
value:
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
value: o.value,
|
|
251
|
+
style: ie({ zIndex: l.value <= s.value || l.value >= o.value ? 4 : 5 }),
|
|
252
|
+
onInput: d,
|
|
253
|
+
onChange: d
|
|
254
|
+
}, null, 44, wt)
|
|
253
255
|
]),
|
|
254
|
-
(I = e.scaleHints) != null && I.length ? (
|
|
255
|
-
(
|
|
256
|
-
])) :
|
|
256
|
+
(I = e.scaleHints) != null && I.length ? (p(), y("div", $t, [
|
|
257
|
+
(p(!0), y(U, null, K(e.scaleHints, (_) => (p(), y("span", { key: _ }, b(_), 1))), 128))
|
|
258
|
+
])) : O("", !0)
|
|
257
259
|
]);
|
|
258
260
|
};
|
|
259
261
|
}
|
|
260
|
-
}),
|
|
261
|
-
function
|
|
262
|
+
}), be = /* @__PURE__ */ N(kt, [["__scopeId", "data-v-0bf11d26"]]);
|
|
263
|
+
function xe(e, t = 2) {
|
|
262
264
|
if (e == null || isNaN(Number(e))) return null;
|
|
263
265
|
const a = Number(e);
|
|
264
266
|
return { text: `${a.toFixed(t)}%`, positive: a >= 0 };
|
|
265
267
|
}
|
|
266
|
-
function
|
|
268
|
+
function we(e, t = "en-US") {
|
|
267
269
|
if (e == null || isNaN(Number(e))) return "—";
|
|
268
|
-
const a = Number(e), n = a < 0 ? "-" : "",
|
|
270
|
+
const a = Number(e), n = a < 0 ? "-" : "", s = Math.abs(a);
|
|
269
271
|
let c;
|
|
270
|
-
return
|
|
272
|
+
return s >= 1e6 ? c = (s / 1e6).toFixed(2) + "M" : s >= 1e3 ? c = Math.round(s).toLocaleString(t) : c = s.toFixed(2), `${n}$${c}`;
|
|
271
273
|
}
|
|
272
|
-
function
|
|
274
|
+
function H(e, t = "en-US") {
|
|
273
275
|
if (e == null || isNaN(Number(e))) return "—";
|
|
274
276
|
const a = Number(e);
|
|
275
277
|
return `${a < 0 ? "-" : ""}$${Math.abs(a).toLocaleString(t, {
|
|
@@ -277,13 +279,13 @@ function Y(e, t = "en-US") {
|
|
|
277
279
|
maximumFractionDigits: 2
|
|
278
280
|
})}`;
|
|
279
281
|
}
|
|
280
|
-
function
|
|
282
|
+
function $e(e, t = "en-US") {
|
|
281
283
|
return e == null ? "—" : Number(e).toLocaleString(t);
|
|
282
284
|
}
|
|
283
285
|
function It(e) {
|
|
284
286
|
return e.Fee == null ? e._meta ? "free" : "—" : `${(e.Fee * 100).toFixed(0)}%`;
|
|
285
287
|
}
|
|
286
|
-
function
|
|
288
|
+
function ke(e, t = "en-US") {
|
|
287
289
|
if (!e) return "—";
|
|
288
290
|
const a = new Date(e);
|
|
289
291
|
return isNaN(a.getTime()) ? "—" : a.toLocaleString(t, {
|
|
@@ -303,7 +305,7 @@ function _t(e) {
|
|
|
303
305
|
const a = Math.floor(e / 365), n = Math.floor((e - a * 365) / 30);
|
|
304
306
|
return n ? `${a}y ${n}mo` : `${a}y`;
|
|
305
307
|
}
|
|
306
|
-
function
|
|
308
|
+
function ce(e) {
|
|
307
309
|
return e >= 1e6 ? "$" + (e / 1e6).toFixed(2) + "M" : e >= 1e3 ? "$" + Math.round(e / 1e3) + "K" : "$" + Math.round(e);
|
|
308
310
|
}
|
|
309
311
|
function St(e) {
|
|
@@ -312,40 +314,40 @@ function St(e) {
|
|
|
312
314
|
function Rt(e) {
|
|
313
315
|
return e && e.trim().split(/\s+/).slice(0, 2).map((a) => a.charAt(0).toUpperCase()).join("") || "?";
|
|
314
316
|
}
|
|
315
|
-
function
|
|
317
|
+
function j(e) {
|
|
316
318
|
if (!e) return null;
|
|
317
319
|
const t = new Date(e);
|
|
318
320
|
return isNaN(t.getTime()) ? null : Math.floor((Date.now() - t.getTime()) / 864e5);
|
|
319
321
|
}
|
|
320
|
-
const
|
|
322
|
+
const le = (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))), se = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, (e - 1) / 99 * 4.7)), Pt = { class: "pelican-fgroup" }, Ct = { class: "title-row" }, Tt = { class: "val" }, At = ["value"], Ft = /* @__PURE__ */ F({
|
|
321
323
|
__name: "InvestAmount",
|
|
322
324
|
props: {
|
|
323
325
|
modelValue: {}
|
|
324
326
|
},
|
|
325
327
|
emits: ["update:modelValue", "apply"],
|
|
326
328
|
setup(e, { emit: t }) {
|
|
327
|
-
const a = e, n = t,
|
|
328
|
-
() => a.modelValue == null ? "any" :
|
|
329
|
+
const a = e, n = t, s = k(
|
|
330
|
+
() => a.modelValue == null ? "any" : ce(a.modelValue)
|
|
329
331
|
);
|
|
330
332
|
function c(l) {
|
|
331
|
-
const
|
|
332
|
-
if (!
|
|
333
|
+
const o = l.target.value.trim();
|
|
334
|
+
if (!o) {
|
|
333
335
|
n("update:modelValue", null), n("apply", null);
|
|
334
336
|
return;
|
|
335
337
|
}
|
|
336
|
-
const u = parseInt(
|
|
338
|
+
const u = parseInt(o, 10);
|
|
337
339
|
if (isNaN(u) || u <= 0) {
|
|
338
340
|
n("update:modelValue", null), n("apply", null);
|
|
339
341
|
return;
|
|
340
342
|
}
|
|
341
|
-
n("update:modelValue", u), n("apply", { min:
|
|
343
|
+
n("update:modelValue", u), n("apply", { min: Ie(50), max: Ie(u) });
|
|
342
344
|
}
|
|
343
|
-
return (l,
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
return (l, o) => (p(), y("div", Pt, [
|
|
346
|
+
i("div", Ct, [
|
|
347
|
+
o[0] || (o[0] = i("label", { class: "title" }, "Your Investment Amount, $", -1)),
|
|
348
|
+
i("span", Tt, b(s.value), 1)
|
|
347
349
|
]),
|
|
348
|
-
|
|
350
|
+
i("input", {
|
|
349
351
|
type: "number",
|
|
350
352
|
min: 50,
|
|
351
353
|
step: 50,
|
|
@@ -356,7 +358,7 @@ const ee = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), b
|
|
|
356
358
|
}, null, 40, At)
|
|
357
359
|
]));
|
|
358
360
|
}
|
|
359
|
-
}), Nt = /* @__PURE__ */
|
|
361
|
+
}), Nt = /* @__PURE__ */ N(Ft, [["__scopeId", "data-v-a76acc6c"]]), Lt = { class: "ftitle-row" }, Dt = /* @__PURE__ */ F({
|
|
360
362
|
__name: "FiltersPanel",
|
|
361
363
|
props: {
|
|
362
364
|
filters: {},
|
|
@@ -365,44 +367,44 @@ const ee = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), b
|
|
|
365
367
|
},
|
|
366
368
|
emits: ["update:filters", "update:investAmount", "reset"],
|
|
367
369
|
setup(e, { emit: t }) {
|
|
368
|
-
const a = e, n = t,
|
|
369
|
-
|
|
370
|
-
n("update:filters", { retMin:
|
|
371
|
-
}),
|
|
372
|
-
n("update:filters", { retMax:
|
|
373
|
-
}),
|
|
374
|
-
n("update:filters", { balanceMin:
|
|
375
|
-
}),
|
|
376
|
-
n("update:filters", { balanceMax:
|
|
377
|
-
}),
|
|
370
|
+
const a = e, n = t, s = R(0), c = R(100), l = R(0), o = R(100);
|
|
371
|
+
E(s, (f) => {
|
|
372
|
+
n("update:filters", { retMin: f <= 0 ? null : se(f) });
|
|
373
|
+
}), E(c, (f) => {
|
|
374
|
+
n("update:filters", { retMax: f >= 100 ? null : se(f) });
|
|
375
|
+
}), E(l, (f) => {
|
|
376
|
+
n("update:filters", { balanceMin: f <= 0 ? null : le(f) });
|
|
377
|
+
}), E(o, (f) => {
|
|
378
|
+
n("update:filters", { balanceMax: f >= 100 ? null : le(f) });
|
|
379
|
+
}), E(
|
|
378
380
|
() => [a.filters.retMin, a.filters.retMax],
|
|
379
|
-
([
|
|
380
|
-
|
|
381
|
+
([f, d]) => {
|
|
382
|
+
f == null && (s.value = 0), d == null && (c.value = 100);
|
|
381
383
|
}
|
|
382
|
-
),
|
|
384
|
+
), E(
|
|
383
385
|
() => [a.filters.balanceMin, a.filters.balanceMax],
|
|
384
|
-
([
|
|
385
|
-
|
|
386
|
+
([f, d]) => {
|
|
387
|
+
f == null && (l.value = 0), d == null && (o.value = 100);
|
|
386
388
|
}
|
|
387
389
|
);
|
|
388
|
-
function u(
|
|
389
|
-
n("update:filters",
|
|
390
|
+
function u(f) {
|
|
391
|
+
n("update:filters", f);
|
|
390
392
|
}
|
|
391
|
-
function m(
|
|
392
|
-
u({ risk:
|
|
393
|
+
function m(f) {
|
|
394
|
+
u({ risk: f });
|
|
393
395
|
}
|
|
394
|
-
function
|
|
395
|
-
|
|
396
|
+
function g(f) {
|
|
397
|
+
f == null ? (u({ balanceMin: null, balanceMax: null }), l.value = 0, o.value = 100) : (l.value = f.min, o.value = f.max);
|
|
396
398
|
}
|
|
397
|
-
return (
|
|
398
|
-
class:
|
|
399
|
+
return (f, d) => (p(), y("aside", {
|
|
400
|
+
class: B(["pelican-filters", { open: e.open }])
|
|
399
401
|
}, [
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
402
|
+
i("div", Lt, [
|
|
403
|
+
d[13] || (d[13] = i("label", { class: "ftitle" }, "Risk", -1)),
|
|
404
|
+
i("button", {
|
|
403
405
|
class: "btn-reset",
|
|
404
406
|
type: "button",
|
|
405
|
-
onClick:
|
|
407
|
+
onClick: d[0] || (d[0] = (r) => n("reset"))
|
|
406
408
|
}, "reset filters")
|
|
407
409
|
]),
|
|
408
410
|
P(ut, {
|
|
@@ -411,21 +413,21 @@ const ee = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), b
|
|
|
411
413
|
}, null, 8, ["model-value"]),
|
|
412
414
|
P(Nt, {
|
|
413
415
|
"model-value": e.investAmount,
|
|
414
|
-
"onUpdate:modelValue":
|
|
415
|
-
onApply:
|
|
416
|
+
"onUpdate:modelValue": d[1] || (d[1] = (r) => n("update:investAmount", r)),
|
|
417
|
+
onApply: g
|
|
416
418
|
}, null, 8, ["model-value"]),
|
|
417
|
-
P(
|
|
419
|
+
P(be, {
|
|
418
420
|
label: "Return %",
|
|
419
|
-
"model-value-min":
|
|
421
|
+
"model-value-min": s.value,
|
|
420
422
|
"model-value-max": c.value,
|
|
421
|
-
"format-raw": (r) =>
|
|
422
|
-
"raw-to-domain": (r) =>
|
|
423
|
+
"format-raw": (r) => v(St)(r),
|
|
424
|
+
"raw-to-domain": (r) => v(se)(r),
|
|
423
425
|
"scale-hints": ["0%", "200%", "50K%+"],
|
|
424
426
|
"max-label": "50K%+",
|
|
425
|
-
"onUpdate:modelValueMin":
|
|
426
|
-
"onUpdate:modelValueMax":
|
|
427
|
+
"onUpdate:modelValueMin": d[2] || (d[2] = (r) => s.value = r ?? 0),
|
|
428
|
+
"onUpdate:modelValueMax": d[3] || (d[3] = (r) => c.value = r ?? 100)
|
|
427
429
|
}, null, 8, ["model-value-min", "model-value-max", "format-raw", "raw-to-domain"]),
|
|
428
|
-
P(
|
|
430
|
+
P(G, {
|
|
429
431
|
label: "Max Drawdown ≤",
|
|
430
432
|
"model-value": e.filters.ddMax,
|
|
431
433
|
min: 0,
|
|
@@ -434,20 +436,20 @@ const ee = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), b
|
|
|
434
436
|
"any-at": 100,
|
|
435
437
|
inverted: !0,
|
|
436
438
|
format: (r) => r + "%",
|
|
437
|
-
"onUpdate:modelValue":
|
|
439
|
+
"onUpdate:modelValue": d[4] || (d[4] = (r) => u({ ddMax: r == null || r >= 100 ? null : r }))
|
|
438
440
|
}, null, 8, ["model-value", "format"]),
|
|
439
|
-
P(
|
|
441
|
+
P(be, {
|
|
440
442
|
label: "Balance",
|
|
441
443
|
"model-value-min": l.value,
|
|
442
|
-
"model-value-max":
|
|
443
|
-
"format-raw": (r) =>
|
|
444
|
-
"raw-to-domain": (r) =>
|
|
444
|
+
"model-value-max": o.value,
|
|
445
|
+
"format-raw": (r) => v(ce)(r),
|
|
446
|
+
"raw-to-domain": (r) => v(le)(r),
|
|
445
447
|
"scale-hints": ["$0", "$10K", "$10M"],
|
|
446
448
|
"max-label": "$10M+",
|
|
447
|
-
"onUpdate:modelValueMin":
|
|
448
|
-
"onUpdate:modelValueMax":
|
|
449
|
+
"onUpdate:modelValueMin": d[5] || (d[5] = (r) => l.value = r ?? 0),
|
|
450
|
+
"onUpdate:modelValueMax": d[6] || (d[6] = (r) => o.value = r ?? 100)
|
|
449
451
|
}, null, 8, ["model-value-min", "model-value-max", "format-raw", "raw-to-domain"]),
|
|
450
|
-
P(
|
|
452
|
+
P(G, {
|
|
451
453
|
label: "Mgmt Fee ≤",
|
|
452
454
|
"model-value": e.filters.feeMax,
|
|
453
455
|
min: 0,
|
|
@@ -456,56 +458,56 @@ const ee = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), b
|
|
|
456
458
|
"any-at": 100,
|
|
457
459
|
inverted: !0,
|
|
458
460
|
format: (r) => r + "%",
|
|
459
|
-
"onUpdate:modelValue":
|
|
461
|
+
"onUpdate:modelValue": d[7] || (d[7] = (r) => u({ feeMax: r == null || r >= 100 ? null : r }))
|
|
460
462
|
}, null, 8, ["model-value", "format"]),
|
|
461
|
-
P(
|
|
463
|
+
P(G, {
|
|
462
464
|
label: "Copiers AUM ≥",
|
|
463
465
|
"model-value": e.filters.aumMin,
|
|
464
466
|
min: 0,
|
|
465
467
|
max: 5e6,
|
|
466
468
|
step: 5e4,
|
|
467
|
-
format: (r) => "≥ " +
|
|
468
|
-
"onUpdate:modelValue":
|
|
469
|
+
format: (r) => "≥ " + v(ce)(r),
|
|
470
|
+
"onUpdate:modelValue": d[8] || (d[8] = (r) => u({ aumMin: r && r > 0 ? r : null }))
|
|
469
471
|
}, null, 8, ["model-value", "format"]),
|
|
470
|
-
P(
|
|
472
|
+
P(G, {
|
|
471
473
|
label: "Copiers ≥",
|
|
472
474
|
"model-value": e.filters.copiersMin,
|
|
473
475
|
min: 0,
|
|
474
476
|
max: 3e3,
|
|
475
477
|
step: 10,
|
|
476
478
|
format: (r) => "≥ " + r,
|
|
477
|
-
"onUpdate:modelValue":
|
|
479
|
+
"onUpdate:modelValue": d[9] || (d[9] = (r) => u({ copiersMin: r && r > 0 ? r : null }))
|
|
478
480
|
}, null, 8, ["model-value", "format"]),
|
|
479
|
-
P(
|
|
481
|
+
P(G, {
|
|
480
482
|
label: "Age ≥ (days)",
|
|
481
483
|
"model-value": e.filters.ageMin,
|
|
482
484
|
min: 0,
|
|
483
485
|
max: 3e3,
|
|
484
486
|
step: 10,
|
|
485
487
|
format: (r) => "≥ " + r + "d",
|
|
486
|
-
"onUpdate:modelValue":
|
|
488
|
+
"onUpdate:modelValue": d[10] || (d[10] = (r) => u({ ageMin: r && r > 0 ? r : null }))
|
|
487
489
|
}, null, 8, ["model-value", "format"]),
|
|
488
|
-
P(
|
|
490
|
+
P(G, {
|
|
489
491
|
label: "Trades ≥",
|
|
490
492
|
"model-value": e.filters.tradesMin,
|
|
491
493
|
min: 0,
|
|
492
494
|
max: 1e4,
|
|
493
495
|
step: 50,
|
|
494
496
|
format: (r) => "≥ " + r,
|
|
495
|
-
"onUpdate:modelValue":
|
|
497
|
+
"onUpdate:modelValue": d[11] || (d[11] = (r) => u({ tradesMin: r && r > 0 ? r : null }))
|
|
496
498
|
}, null, 8, ["model-value", "format"]),
|
|
497
|
-
P(
|
|
499
|
+
P(G, {
|
|
498
500
|
label: "Win Rate ≥",
|
|
499
501
|
"model-value": e.filters.winrateMin,
|
|
500
502
|
min: 0,
|
|
501
503
|
max: 100,
|
|
502
504
|
step: 5,
|
|
503
505
|
format: (r) => "≥ " + r + "%",
|
|
504
|
-
"onUpdate:modelValue":
|
|
506
|
+
"onUpdate:modelValue": d[12] || (d[12] = (r) => u({ winrateMin: r && r > 0 ? r : null }))
|
|
505
507
|
}, null, 8, ["model-value", "format"])
|
|
506
508
|
], 2));
|
|
507
509
|
}
|
|
508
|
-
}), Ut = /* @__PURE__ */
|
|
510
|
+
}), Ut = /* @__PURE__ */ N(Dt, [["__scopeId", "data-v-67cc5448"]]), _e = [
|
|
509
511
|
"#f97316",
|
|
510
512
|
"#3b82f6",
|
|
511
513
|
"#10b981",
|
|
@@ -532,46 +534,46 @@ function Vt(e, t = 140, a = 34) {
|
|
|
532
534
|
startX: 1,
|
|
533
535
|
endX: t - 1
|
|
534
536
|
};
|
|
535
|
-
const n = e.map((
|
|
537
|
+
const n = e.map((S) => Date.parse(S.Timestamp)), s = n[0], c = n[n.length - 1], l = c - s || 1, o = e.map((S) => S.AccountReturn), u = Math.min(0, ...o), g = Math.max(0, ...o) - u || 1, f = (S) => (S - s) / l * (t - 2) + 1, d = (S) => a - 2 - (S - u) / g * (a - 4), r = e.map((S, x) => `${f(n[x]).toFixed(1)},${d(S.AccountReturn).toFixed(1)}`), w = o[o.length - 1], I = d(0), _ = f(s), h = f(c), C = `M ${r.join(" L ")}`, V = `M ${r[0]} ` + r.slice(1).map((S) => `L ${S}`).join(" ") + ` L ${h.toFixed(1)},${I.toFixed(1)} L ${_.toFixed(1)},${I.toFixed(1)} Z`;
|
|
536
538
|
return {
|
|
537
539
|
hasData: !0,
|
|
538
540
|
width: t,
|
|
539
541
|
height: a,
|
|
540
542
|
zeroY: I,
|
|
541
|
-
areaPath:
|
|
542
|
-
linePath:
|
|
543
|
+
areaPath: V,
|
|
544
|
+
linePath: C,
|
|
543
545
|
positive: w >= 0,
|
|
544
546
|
startX: _,
|
|
545
|
-
endX:
|
|
547
|
+
endX: h
|
|
546
548
|
};
|
|
547
549
|
}
|
|
548
550
|
function Et(e, t = 520, a = 280) {
|
|
549
|
-
const n = e.slice().sort((
|
|
550
|
-
let
|
|
551
|
-
const
|
|
552
|
-
return n.forEach((
|
|
553
|
-
const w = (
|
|
554
|
-
|
|
555
|
-
const
|
|
556
|
-
let
|
|
551
|
+
const n = e.slice().sort((d, r) => (r.c || 0) - (d.c || 0)), s = n.reduce((d, r) => d + (r.c || 0), 0) || 1, c = t / 2, l = a / 2, o = 90, u = 52, m = o + 10;
|
|
552
|
+
let g = -Math.PI / 2;
|
|
553
|
+
const f = [];
|
|
554
|
+
return n.forEach((d, r) => {
|
|
555
|
+
const w = (d.c || 0) / s, I = w * Math.PI * 2, _ = g, h = g + I;
|
|
556
|
+
g = h;
|
|
557
|
+
const C = (_ + h) / 2, V = I > Math.PI ? 1 : 0, S = c + o * Math.cos(_), x = l + o * Math.sin(_), $ = c + o * Math.cos(h), M = l + o * Math.sin(h), T = c + u * Math.cos(_), Y = l + u * Math.sin(_), z = c + u * Math.cos(h), L = l + u * Math.sin(h), A = `M ${S.toFixed(2)} ${x.toFixed(2)} A ${o} ${o} 0 ${V} 1 ${$.toFixed(2)} ${M.toFixed(2)} L ${z.toFixed(2)} ${L.toFixed(2)} A ${u} ${u} 0 ${V} 0 ${T.toFixed(2)} ${Y.toFixed(2)} Z`, Fe = _e[r % _e.length];
|
|
558
|
+
let fe = null, ve = 0, pe = 0, ge = "start";
|
|
557
559
|
if (w >= 0.015) {
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
+
const Q = Math.cos(C) < 0, Ne = c + o * Math.cos(C), Le = l + o * Math.sin(C), X = c + m * Math.cos(C), ee = l + m * Math.sin(C), De = Q ? X - 4 : X + 4;
|
|
561
|
+
fe = `${Ne.toFixed(1)},${Le.toFixed(1)} ${X.toFixed(1)},${ee.toFixed(1)} ${De.toFixed(1)},${ee.toFixed(1)}`, ve = Q ? X - 6 : X + 6, pe = ee + 4, ge = Q ? "end" : "start";
|
|
560
562
|
}
|
|
561
|
-
|
|
562
|
-
marketName:
|
|
563
|
-
count:
|
|
563
|
+
f.push({
|
|
564
|
+
marketName: d.n,
|
|
565
|
+
count: d.c,
|
|
564
566
|
fraction: w,
|
|
565
|
-
color:
|
|
566
|
-
arcPath:
|
|
567
|
-
labelLine:
|
|
568
|
-
labelX:
|
|
569
|
-
labelY:
|
|
570
|
-
labelAnchor:
|
|
567
|
+
color: Fe,
|
|
568
|
+
arcPath: A,
|
|
569
|
+
labelLine: fe,
|
|
570
|
+
labelX: ve,
|
|
571
|
+
labelY: pe,
|
|
572
|
+
labelAnchor: ge
|
|
571
573
|
});
|
|
572
|
-
}), { width: t, height: a, cx: c, cy: l, outerR:
|
|
574
|
+
}), { width: t, height: a, cx: c, cy: l, outerR: o, innerR: u, slices: f };
|
|
573
575
|
}
|
|
574
|
-
const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2", "y1", "y2"], Yt = ["d", "fill"], zt = ["d", "stroke"], Gt = /* @__PURE__ */
|
|
576
|
+
const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2", "y1", "y2"], Yt = ["d", "fill"], zt = ["d", "stroke"], Gt = /* @__PURE__ */ F({
|
|
575
577
|
__name: "Sparkline",
|
|
576
578
|
props: {
|
|
577
579
|
history: {},
|
|
@@ -579,8 +581,8 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
579
581
|
height: { default: 34 }
|
|
580
582
|
},
|
|
581
583
|
setup(e) {
|
|
582
|
-
const t = e, a =
|
|
583
|
-
return (n,
|
|
584
|
+
const t = e, a = k(() => Vt(t.history, t.width, t.height));
|
|
585
|
+
return (n, s) => a.value.hasData ? (p(), y("svg", {
|
|
584
586
|
key: 1,
|
|
585
587
|
class: "pelican-spark",
|
|
586
588
|
width: a.value.width,
|
|
@@ -590,7 +592,7 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
590
592
|
role: "img",
|
|
591
593
|
"aria-label": "Equity curve"
|
|
592
594
|
}, [
|
|
593
|
-
|
|
595
|
+
i("line", {
|
|
594
596
|
x1: "0",
|
|
595
597
|
x2: a.value.width,
|
|
596
598
|
y1: a.value.zeroY,
|
|
@@ -600,12 +602,12 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
600
602
|
"stroke-width": "1",
|
|
601
603
|
"vector-effect": "non-scaling-stroke"
|
|
602
604
|
}, null, 8, Kt),
|
|
603
|
-
|
|
605
|
+
i("path", {
|
|
604
606
|
d: a.value.areaPath,
|
|
605
607
|
fill: a.value.positive ? "var(--area-green)" : "var(--area-red)",
|
|
606
608
|
stroke: "none"
|
|
607
609
|
}, null, 8, Yt),
|
|
608
|
-
|
|
610
|
+
i("path", {
|
|
609
611
|
d: a.value.linePath,
|
|
610
612
|
fill: "none",
|
|
611
613
|
stroke: a.value.positive ? "var(--green)" : "var(--red)",
|
|
@@ -614,15 +616,15 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
614
616
|
"stroke-linecap": "round",
|
|
615
617
|
"vector-effect": "non-scaling-stroke"
|
|
616
618
|
}, null, 8, zt)
|
|
617
|
-
], 8, Ot)) : (
|
|
619
|
+
], 8, Ot)) : (p(), y("svg", {
|
|
618
620
|
key: 0,
|
|
619
621
|
class: "pelican-spark",
|
|
620
622
|
width: a.value.width,
|
|
621
623
|
height: a.value.height,
|
|
622
624
|
role: "img",
|
|
623
625
|
"aria-label": "No equity data"
|
|
624
|
-
}, [...
|
|
625
|
-
|
|
626
|
+
}, [...s[0] || (s[0] = [
|
|
627
|
+
i("text", {
|
|
626
628
|
x: "2",
|
|
627
629
|
y: "20",
|
|
628
630
|
"font-size": "11",
|
|
@@ -630,13 +632,13 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
630
632
|
}, "no data", -1)
|
|
631
633
|
])], 8, Bt));
|
|
632
634
|
}
|
|
633
|
-
}), Ht = /* @__PURE__ */
|
|
635
|
+
}), Ht = /* @__PURE__ */ N(Gt, [["__scopeId", "data-v-a9b85847"]]), jt = {
|
|
634
636
|
key: 0,
|
|
635
637
|
class: "dim"
|
|
636
638
|
}, Wt = ["viewBox"], qt = ["d", "fill"], Xt = ["points", "stroke"], Zt = ["x", "y", "text-anchor"], Jt = {
|
|
637
639
|
fill: "var(--muted)",
|
|
638
640
|
"font-weight": "400"
|
|
639
|
-
}, Qt = /* @__PURE__ */
|
|
641
|
+
}, Qt = /* @__PURE__ */ F({
|
|
640
642
|
__name: "MarketsDonut",
|
|
641
643
|
props: {
|
|
642
644
|
markets: {},
|
|
@@ -644,8 +646,8 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
644
646
|
height: { default: 280 }
|
|
645
647
|
},
|
|
646
648
|
setup(e) {
|
|
647
|
-
const t = e, a =
|
|
648
|
-
return (
|
|
649
|
+
const t = e, a = k(() => !t.markets || t.markets.length === 0), n = k(() => Et(t.markets, t.width, t.height));
|
|
650
|
+
return (s, c) => a.value ? (p(), y("span", jt, "no market data")) : (p(), y("svg", {
|
|
649
651
|
key: 1,
|
|
650
652
|
class: "pelican-donut",
|
|
651
653
|
viewBox: `0 0 ${n.value.width} ${n.value.height}`,
|
|
@@ -654,8 +656,8 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
654
656
|
role: "img",
|
|
655
657
|
"aria-label": "Markets donut chart"
|
|
656
658
|
}, [
|
|
657
|
-
|
|
658
|
-
(
|
|
659
|
+
i("g", null, [
|
|
660
|
+
(p(!0), y(U, null, K(n.value.slices, (l) => (p(), y("path", {
|
|
659
661
|
key: l.marketName + l.fraction,
|
|
660
662
|
d: l.arcPath,
|
|
661
663
|
fill: l.color,
|
|
@@ -663,19 +665,19 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
663
665
|
"stroke-width": "1.5"
|
|
664
666
|
}, null, 8, qt))), 128))
|
|
665
667
|
]),
|
|
666
|
-
|
|
667
|
-
(
|
|
668
|
+
i("g", null, [
|
|
669
|
+
(p(!0), y(U, null, K(n.value.slices, (l) => he((p(), y("polyline", {
|
|
668
670
|
key: `l-${l.marketName}`,
|
|
669
671
|
points: l.labelLine ?? "",
|
|
670
672
|
stroke: l.color,
|
|
671
673
|
"stroke-width": "1",
|
|
672
674
|
fill: "none"
|
|
673
675
|
}, null, 8, Xt)), [
|
|
674
|
-
[
|
|
676
|
+
[ye, l.labelLine]
|
|
675
677
|
])), 128))
|
|
676
678
|
]),
|
|
677
|
-
|
|
678
|
-
(
|
|
679
|
+
i("g", null, [
|
|
680
|
+
(p(!0), y(U, null, K(n.value.slices, (l) => he((p(), y("text", {
|
|
679
681
|
key: `t-${l.marketName}`,
|
|
680
682
|
x: l.labelX,
|
|
681
683
|
y: l.labelY,
|
|
@@ -684,15 +686,15 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
684
686
|
fill: "var(--text)",
|
|
685
687
|
"font-weight": "500"
|
|
686
688
|
}, [
|
|
687
|
-
|
|
688
|
-
|
|
689
|
+
D(b(l.marketName) + " ", 1),
|
|
690
|
+
i("tspan", Jt, b(l.count), 1)
|
|
689
691
|
], 8, Zt)), [
|
|
690
|
-
[
|
|
692
|
+
[ye, l.labelLine]
|
|
691
693
|
])), 128))
|
|
692
694
|
])
|
|
693
695
|
], 8, Wt));
|
|
694
696
|
}
|
|
695
|
-
}), ea = /* @__PURE__ */
|
|
697
|
+
}), ea = /* @__PURE__ */ N(Qt, [["__scopeId", "data-v-c514d53f"]]), ta = { class: "pelican-trades" }, aa = { class: "hd" }, na = {
|
|
696
698
|
key: 0,
|
|
697
699
|
class: "dim"
|
|
698
700
|
}, la = {
|
|
@@ -701,7 +703,7 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
701
703
|
}, sa = {
|
|
702
704
|
key: 2,
|
|
703
705
|
class: "list"
|
|
704
|
-
}, oa = { class: "market" }, ia = { class: "trade-time" }, ra = /* @__PURE__ */
|
|
706
|
+
}, oa = { class: "market" }, ia = { class: "trade-time" }, ra = /* @__PURE__ */ F({
|
|
705
707
|
__name: "TradesPanel",
|
|
706
708
|
props: {
|
|
707
709
|
kind: {},
|
|
@@ -710,67 +712,67 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
710
712
|
locale: {}
|
|
711
713
|
},
|
|
712
714
|
setup(e) {
|
|
713
|
-
const t = e, a =
|
|
715
|
+
const t = e, a = k(() => t.kind === "open" ? "Open Trades" : "Trade History (30d)"), n = k(
|
|
714
716
|
() => !t.loading && (t.trades == null || t.trades.length === 0)
|
|
715
717
|
);
|
|
716
|
-
return (
|
|
717
|
-
|
|
718
|
-
e.loading ? (
|
|
719
|
-
(
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
class:
|
|
723
|
-
},
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
l.CloseTimestamp ? (
|
|
727
|
-
|
|
728
|
-
], 64)) :
|
|
718
|
+
return (s, c) => (p(), y("div", ta, [
|
|
719
|
+
i("div", aa, b(a.value), 1),
|
|
720
|
+
e.loading ? (p(), y("div", na, "Loading…")) : n.value ? (p(), y("div", la, "No trades.")) : (p(), y("ul", sa, [
|
|
721
|
+
(p(!0), y(U, null, K(e.trades ?? [], (l, o) => (p(), y("li", { key: o }, [
|
|
722
|
+
i("span", oa, b(l.MarketName ?? "—"), 1),
|
|
723
|
+
i("span", {
|
|
724
|
+
class: B(["dir", l.Direction === "Sell" ? "red" : "green"])
|
|
725
|
+
}, b(l.Direction ?? ""), 3),
|
|
726
|
+
i("span", ia, [
|
|
727
|
+
D(b(v(ke)(l.OpenTimestamp, e.locale)) + " ", 1),
|
|
728
|
+
l.CloseTimestamp ? (p(), y(U, { key: 0 }, [
|
|
729
|
+
D(" → " + b(v(ke)(l.CloseTimestamp, e.locale)), 1)
|
|
730
|
+
], 64)) : O("", !0)
|
|
729
731
|
]),
|
|
730
|
-
l.Pnl != null ? (
|
|
732
|
+
l.Pnl != null ? (p(), y("span", {
|
|
731
733
|
key: 0,
|
|
732
|
-
class:
|
|
733
|
-
},
|
|
734
|
+
class: B(["pnl", l.Pnl >= 0 ? "green" : "red"])
|
|
735
|
+
}, b(v(H)(l.Pnl, e.locale)), 3)) : O("", !0)
|
|
734
736
|
]))), 128))
|
|
735
737
|
]))
|
|
736
738
|
]));
|
|
737
739
|
}
|
|
738
|
-
}),
|
|
739
|
-
function
|
|
740
|
+
}), Se = /* @__PURE__ */ N(ra, [["__scopeId", "data-v-aa7cbcd7"]]);
|
|
741
|
+
function W(e) {
|
|
740
742
|
const t = e.Wins ?? 0, a = e.Losses ?? 0, n = t + a;
|
|
741
743
|
return n ? t / n * 100 : -1;
|
|
742
744
|
}
|
|
743
|
-
const ua = Symbol("pelican.apiBase"),
|
|
745
|
+
const ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Te = Symbol("pelican.locale"), da = ["data-id"], ma = { class: "name" }, fa = { class: "avatar" }, va = { class: "avatar-fallback" }, pa = ["src"], ga = { class: "nm" }, ha = { class: "title" }, ya = {
|
|
744
746
|
key: 0,
|
|
745
747
|
class: "free-badge"
|
|
746
|
-
},
|
|
748
|
+
}, Ma = { class: "by" }, ba = {
|
|
747
749
|
class: "c-spark",
|
|
748
750
|
"data-label": "Equity curve"
|
|
749
|
-
},
|
|
751
|
+
}, xa = {
|
|
750
752
|
class: "c-num",
|
|
751
753
|
"data-label": "Return"
|
|
752
|
-
},
|
|
754
|
+
}, wa = { key: 1 }, $a = {
|
|
753
755
|
class: "c-num",
|
|
754
756
|
"data-label": "Copiers"
|
|
755
|
-
},
|
|
757
|
+
}, ka = {
|
|
756
758
|
class: "c-num",
|
|
757
759
|
"data-label": "Copiers AUM"
|
|
758
|
-
},
|
|
760
|
+
}, Ia = {
|
|
759
761
|
class: "c-num",
|
|
760
762
|
"data-label": "Max DD"
|
|
761
|
-
},
|
|
763
|
+
}, _a = { key: 1 }, Sa = {
|
|
762
764
|
class: "c-num",
|
|
763
765
|
"data-label": "Age"
|
|
764
|
-
},
|
|
766
|
+
}, Ra = {
|
|
765
767
|
class: "c-num",
|
|
766
768
|
"data-label": "Balance"
|
|
767
|
-
},
|
|
769
|
+
}, Pa = {
|
|
768
770
|
class: "c-num",
|
|
769
771
|
"data-label": "Fee"
|
|
770
|
-
},
|
|
772
|
+
}, Ca = ["href"], Ta = { class: "grid" }, Aa = { class: "col-stats" }, Fa = { class: "field" }, Na = { class: "value" }, La = { class: "field" }, Da = { class: "value" }, Ua = { class: "field" }, Va = { class: "value" }, Ea = { class: "field" }, Ba = { class: "value" }, Oa = { class: "field" }, Ka = { class: "value" }, Ya = { class: "field" }, za = { class: "value" }, Ga = { class: "field" }, Ha = { class: "value" }, ja = { class: "field" }, Wa = { class: "value" }, qa = { key: 0 }, Xa = {
|
|
771
773
|
key: 1,
|
|
772
774
|
class: "dim"
|
|
773
|
-
},
|
|
775
|
+
}, Za = { class: "col-donut" }, Ja = { class: "trade-toggles" }, Qa = /* @__PURE__ */ F({
|
|
774
776
|
__name: "StrategyRow",
|
|
775
777
|
props: {
|
|
776
778
|
s: {},
|
|
@@ -780,172 +782,172 @@ const ua = Symbol("pelican.apiBase"), _e = Symbol("pelican.locale"), ca = ["data
|
|
|
780
782
|
},
|
|
781
783
|
emits: ["toggle", "load-trades", "select"],
|
|
782
784
|
setup(e, { emit: t }) {
|
|
783
|
-
const a = e, n = t,
|
|
785
|
+
const a = e, n = t, s = Ue(Te, "en-US"), c = k(() => xe(a.s.Return, 1)), l = k(() => a.s.MaxDD != null ? xe(a.s.MaxDD, 2) : null), o = k(() => j(a.s.Inception)), u = k(() => W(a.s)), m = k(() => u.value >= 0 ? 100 - u.value : -1), g = k(
|
|
784
786
|
() => {
|
|
785
|
-
var _,
|
|
786
|
-
return ((_ = a.s.Profile) == null ? void 0 : _.Name) ?? ((
|
|
787
|
+
var _, h;
|
|
788
|
+
return ((_ = a.s.Profile) == null ? void 0 : _.Name) ?? ((h = a.s.Profile) != null && h.Id ? "#" + a.s.Profile.Id : "");
|
|
787
789
|
}
|
|
788
|
-
),
|
|
790
|
+
), f = k(() => `https://libertex.copy-trade.io/strategy/${a.s.Id}`), d = R(!1), r = R(!1);
|
|
789
791
|
function w() {
|
|
790
|
-
|
|
792
|
+
d.value = !d.value, d.value && !a.openTrades && n("load-trades", "open");
|
|
791
793
|
}
|
|
792
794
|
function I() {
|
|
793
795
|
r.value = !r.value, r.value && !a.closedTrades && n("load-trades", "closed");
|
|
794
796
|
}
|
|
795
|
-
return (_,
|
|
796
|
-
var
|
|
797
|
-
return
|
|
798
|
-
|
|
799
|
-
class:
|
|
797
|
+
return (_, h) => {
|
|
798
|
+
var C, V, S, x;
|
|
799
|
+
return p(), y(U, null, [
|
|
800
|
+
i("div", {
|
|
801
|
+
class: B(["pelican-row", { open: e.expanded }]),
|
|
800
802
|
"data-id": e.s.Id,
|
|
801
|
-
onClick:
|
|
803
|
+
onClick: h[3] || (h[3] = ($) => n("toggle"))
|
|
802
804
|
}, [
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
e.s.ImageUploaded ? (
|
|
805
|
+
i("div", ma, [
|
|
806
|
+
i("div", fa, [
|
|
807
|
+
i("span", va, b(v(Rt)(e.s.Name)), 1),
|
|
808
|
+
e.s.ImageUploaded ? (p(), y("img", {
|
|
807
809
|
key: 0,
|
|
808
810
|
class: "avatar-img",
|
|
809
811
|
src: `https://assets.copy-trade.io/images/strategies/thumbnails/${e.s.Id}`,
|
|
810
812
|
alt: "",
|
|
811
813
|
loading: "lazy",
|
|
812
814
|
decoding: "async",
|
|
813
|
-
onError:
|
|
814
|
-
}, null, 40,
|
|
815
|
+
onError: h[0] || (h[0] = ($) => $.target.remove())
|
|
816
|
+
}, null, 40, pa)) : O("", !0)
|
|
815
817
|
]),
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
e.s._meta && e.s.Fee == null ? (
|
|
818
|
+
i("div", ga, [
|
|
819
|
+
i("div", ha, [
|
|
820
|
+
D(b(e.s.Name || "#" + e.s.Id) + " ", 1),
|
|
821
|
+
e.s._meta && e.s.Fee == null ? (p(), y("span", ya, "free")) : O("", !0)
|
|
820
822
|
]),
|
|
821
|
-
|
|
823
|
+
i("div", Ma, b(g.value), 1)
|
|
822
824
|
])
|
|
823
825
|
]),
|
|
824
|
-
|
|
826
|
+
i("div", ba, [
|
|
825
827
|
P(Ht, {
|
|
826
828
|
history: e.s.History
|
|
827
829
|
}, null, 8, ["history"])
|
|
828
830
|
]),
|
|
829
|
-
|
|
830
|
-
c.value ? (
|
|
831
|
+
i("div", xa, [
|
|
832
|
+
c.value ? (p(), y("span", {
|
|
831
833
|
key: 0,
|
|
832
|
-
class:
|
|
833
|
-
},
|
|
834
|
+
class: B(c.value.positive ? "green" : "red")
|
|
835
|
+
}, b(c.value.text), 3)) : (p(), y("span", wa, "—"))
|
|
834
836
|
]),
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
l.value ? (
|
|
837
|
+
i("div", $a, b(v($e)(e.s.NumCopiers, v(s))), 1),
|
|
838
|
+
i("div", ka, b(v(we)(e.s.CopiersAUM, v(s))), 1),
|
|
839
|
+
i("div", Ia, [
|
|
840
|
+
l.value ? (p(), y("span", {
|
|
839
841
|
key: 0,
|
|
840
|
-
class:
|
|
841
|
-
},
|
|
842
|
+
class: B(l.value.positive ? "green" : "red")
|
|
843
|
+
}, b(l.value.text), 3)) : (p(), y("span", _a, "—"))
|
|
842
844
|
]),
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
845
|
+
i("div", Sa, b(v(_t)(o.value)), 1),
|
|
846
|
+
i("div", Ra, b(v(we)(e.s.AccountBalance, v(s))), 1),
|
|
847
|
+
i("div", Pa, b(v(It)(e.s)), 1),
|
|
848
|
+
i("div", {
|
|
847
849
|
class: "c-link",
|
|
848
|
-
onClick:
|
|
850
|
+
onClick: h[2] || (h[2] = te(() => {
|
|
849
851
|
}, ["stop"]))
|
|
850
852
|
}, [
|
|
851
|
-
|
|
853
|
+
i("a", {
|
|
852
854
|
class: "signal-link",
|
|
853
|
-
href:
|
|
855
|
+
href: f.value,
|
|
854
856
|
target: "_blank",
|
|
855
857
|
rel: "noopener",
|
|
856
|
-
onClick:
|
|
858
|
+
onClick: h[1] || (h[1] = te(() => {
|
|
857
859
|
}, ["stop"]))
|
|
858
|
-
}, " Get connected ", 8,
|
|
859
|
-
|
|
860
|
+
}, " Get connected ", 8, Ca),
|
|
861
|
+
q(_.$slots, "row-actions", { strategy: e.s }, void 0, !0)
|
|
860
862
|
])
|
|
861
|
-
], 10,
|
|
862
|
-
e.expanded ? (
|
|
863
|
+
], 10, da),
|
|
864
|
+
e.expanded ? (p(), y("div", {
|
|
863
865
|
key: 0,
|
|
864
866
|
class: "pelican-row-expanded",
|
|
865
|
-
onClick:
|
|
867
|
+
onClick: h[4] || (h[4] = te(() => {
|
|
866
868
|
}, ["stop"]))
|
|
867
869
|
}, [
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
870
|
+
i("div", Ta, [
|
|
871
|
+
i("div", Aa, [
|
|
872
|
+
i("div", Fa, [
|
|
873
|
+
h[5] || (h[5] = i("div", { class: "label" }, "Currency", -1)),
|
|
874
|
+
i("div", Na, b(e.s.Currency ?? "USD"), 1)
|
|
873
875
|
]),
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
876
|
+
i("div", La, [
|
|
877
|
+
h[6] || (h[6] = i("div", { class: "label" }, "Monthly profit", -1)),
|
|
878
|
+
i("div", Da, b(v(H)(e.s.MonthlyProfit, v(s))), 1)
|
|
877
879
|
]),
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
880
|
+
i("div", Ua, [
|
|
881
|
+
h[7] || (h[7] = i("div", { class: "label" }, "Yearly profit", -1)),
|
|
882
|
+
i("div", Va, b(v(H)(e.s.YearlyProfit, v(s))), 1)
|
|
881
883
|
]),
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
884
|
+
i("div", Ea, [
|
|
885
|
+
h[8] || (h[8] = i("div", { class: "label" }, "Balance", -1)),
|
|
886
|
+
i("div", Ba, b(v(H)(e.s.AccountBalance, v(s))), 1)
|
|
885
887
|
]),
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
888
|
+
i("div", Oa, [
|
|
889
|
+
h[9] || (h[9] = i("div", { class: "label" }, "Realized P/L", -1)),
|
|
890
|
+
i("div", Ka, b(v(H)(e.s.RealisedPnl, v(s))), 1)
|
|
889
891
|
]),
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
892
|
+
i("div", Ya, [
|
|
893
|
+
h[10] || (h[10] = i("div", { class: "label" }, "Unrealized P/L", -1)),
|
|
894
|
+
i("div", za, b(v(H)(e.s.UnrealisedPnl, v(s))), 1)
|
|
893
895
|
]),
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
896
|
+
i("div", Ga, [
|
|
897
|
+
h[11] || (h[11] = i("div", { class: "label" }, "Trades total", -1)),
|
|
898
|
+
i("div", Ha, b(v($e)(e.s.TradesTotal, v(s))), 1)
|
|
897
899
|
]),
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
u.value >= 0 ? (
|
|
900
|
+
i("div", ja, [
|
|
901
|
+
h[12] || (h[12] = i("div", { class: "label" }, "Win rate", -1)),
|
|
902
|
+
i("div", Wa, [
|
|
903
|
+
u.value >= 0 ? (p(), y("span", qa, b(u.value.toFixed(1)) + "% / " + b(m.value.toFixed(1)) + "%", 1)) : (p(), y("span", Xa, "—"))
|
|
902
904
|
])
|
|
903
905
|
])
|
|
904
906
|
]),
|
|
905
|
-
|
|
906
|
-
|
|
907
|
+
i("div", Za, [
|
|
908
|
+
h[13] || (h[13] = i("div", { class: "hd" }, "Markets", -1)),
|
|
907
909
|
P(ea, {
|
|
908
910
|
markets: e.s.Markets
|
|
909
911
|
}, null, 8, ["markets"])
|
|
910
912
|
])
|
|
911
913
|
]),
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
class:
|
|
914
|
+
i("div", Ja, [
|
|
915
|
+
i("button", {
|
|
916
|
+
class: B(["pill", { on: d.value }]),
|
|
915
917
|
type: "button",
|
|
916
918
|
onClick: w
|
|
917
|
-
},
|
|
918
|
-
|
|
919
|
-
class:
|
|
919
|
+
}, b(d.value ? "Hide" : "Open Trades"), 3),
|
|
920
|
+
i("button", {
|
|
921
|
+
class: B(["pill", { on: r.value }]),
|
|
920
922
|
type: "button",
|
|
921
923
|
onClick: I
|
|
922
|
-
},
|
|
924
|
+
}, b(r.value ? "Hide" : "Trade History"), 3)
|
|
923
925
|
]),
|
|
924
|
-
|
|
926
|
+
d.value ? (p(), re(Se, {
|
|
925
927
|
key: 0,
|
|
926
928
|
kind: "open",
|
|
927
|
-
trades: ((
|
|
928
|
-
loading: !!((
|
|
929
|
-
locale:
|
|
930
|
-
}, null, 8, ["trades", "loading", "locale"])) :
|
|
931
|
-
r.value ? (
|
|
929
|
+
trades: ((C = e.openTrades) == null ? void 0 : C.trades) ?? null,
|
|
930
|
+
loading: !!((V = e.openTrades) != null && V.loading),
|
|
931
|
+
locale: v(s)
|
|
932
|
+
}, null, 8, ["trades", "loading", "locale"])) : O("", !0),
|
|
933
|
+
r.value ? (p(), re(Se, {
|
|
932
934
|
key: 1,
|
|
933
935
|
kind: "closed",
|
|
934
|
-
trades: ((
|
|
935
|
-
loading: !!((
|
|
936
|
-
locale:
|
|
937
|
-
}, null, 8, ["trades", "loading", "locale"])) :
|
|
938
|
-
])) :
|
|
936
|
+
trades: ((S = e.closedTrades) == null ? void 0 : S.trades) ?? null,
|
|
937
|
+
loading: !!((x = e.closedTrades) != null && x.loading),
|
|
938
|
+
locale: v(s)
|
|
939
|
+
}, null, 8, ["trades", "loading", "locale"])) : O("", !0)
|
|
940
|
+
])) : O("", !0)
|
|
939
941
|
], 64);
|
|
940
942
|
};
|
|
941
943
|
}
|
|
942
|
-
}),
|
|
944
|
+
}), en = /* @__PURE__ */ N(Qa, [["__scopeId", "data-v-61c1236b"]]), tn = {
|
|
943
945
|
key: 0,
|
|
944
946
|
class: "pelican-pager"
|
|
945
|
-
},
|
|
947
|
+
}, an = ["disabled"], nn = {
|
|
946
948
|
key: 0,
|
|
947
949
|
class: "gap"
|
|
948
|
-
},
|
|
950
|
+
}, ln = ["onClick"], sn = ["disabled"], on = { class: "info" }, rn = ["max", "value"], un = /* @__PURE__ */ F({
|
|
949
951
|
__name: "Pager",
|
|
950
952
|
props: {
|
|
951
953
|
page: {},
|
|
@@ -955,45 +957,45 @@ const ua = Symbol("pelican.apiBase"), _e = Symbol("pelican.locale"), ca = ["data
|
|
|
955
957
|
emits: ["go"],
|
|
956
958
|
setup(e, { emit: t }) {
|
|
957
959
|
const a = e, n = t;
|
|
958
|
-
function
|
|
960
|
+
function s(l) {
|
|
959
961
|
n("go", l);
|
|
960
962
|
}
|
|
961
963
|
function c(l) {
|
|
962
|
-
const
|
|
963
|
-
isNaN(
|
|
964
|
+
const o = parseInt(l.target.value, 10);
|
|
965
|
+
isNaN(o) || n("go", o);
|
|
964
966
|
}
|
|
965
|
-
return (l,
|
|
966
|
-
|
|
967
|
+
return (l, o) => a.totalPages > 1 ? (p(), y("nav", tn, [
|
|
968
|
+
i("button", {
|
|
967
969
|
disabled: e.page <= 1,
|
|
968
|
-
onClick:
|
|
969
|
-
}, "‹ prev", 8,
|
|
970
|
-
(
|
|
971
|
-
u === "…" ? (
|
|
970
|
+
onClick: o[0] || (o[0] = (u) => s("prev"))
|
|
971
|
+
}, "‹ prev", 8, an),
|
|
972
|
+
(p(!0), y(U, null, K(e.range, (u, m) => (p(), y(U, { key: m }, [
|
|
973
|
+
u === "…" ? (p(), y("span", nn, "…")) : (p(), y("button", {
|
|
972
974
|
key: 1,
|
|
973
|
-
class:
|
|
974
|
-
onClick: (
|
|
975
|
-
},
|
|
975
|
+
class: B(["page", { cur: u === e.page }]),
|
|
976
|
+
onClick: (g) => s(u)
|
|
977
|
+
}, b(u), 11, ln))
|
|
976
978
|
], 64))), 128)),
|
|
977
|
-
|
|
979
|
+
i("button", {
|
|
978
980
|
disabled: e.page >= e.totalPages,
|
|
979
|
-
onClick:
|
|
980
|
-
}, "next ›", 8,
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
981
|
+
onClick: o[1] || (o[1] = (u) => s("next"))
|
|
982
|
+
}, "next ›", 8, sn),
|
|
983
|
+
i("span", on, [
|
|
984
|
+
o[2] || (o[2] = D(" go to ", -1)),
|
|
985
|
+
i("input", {
|
|
984
986
|
type: "number",
|
|
985
987
|
min: 1,
|
|
986
988
|
max: e.totalPages,
|
|
987
989
|
value: e.page,
|
|
988
990
|
onChange: c
|
|
989
|
-
}, null, 40,
|
|
991
|
+
}, null, 40, rn)
|
|
990
992
|
])
|
|
991
|
-
])) :
|
|
993
|
+
])) : O("", !0);
|
|
992
994
|
}
|
|
993
|
-
}),
|
|
995
|
+
}), cn = /* @__PURE__ */ N(un, [["__scopeId", "data-v-42928155"]]), dn = { class: "pelican-table" }, mn = { class: "row head" }, fn = ["onClick"], vn = {
|
|
994
996
|
key: 0,
|
|
995
997
|
class: "empty"
|
|
996
|
-
},
|
|
998
|
+
}, pn = /* @__PURE__ */ F({
|
|
997
999
|
__name: "StrategyTable",
|
|
998
1000
|
props: {
|
|
999
1001
|
pageItems: {},
|
|
@@ -1007,7 +1009,7 @@ const ua = Symbol("pelican.apiBase"), _e = Symbol("pelican.locale"), ca = ["data
|
|
|
1007
1009
|
},
|
|
1008
1010
|
emits: ["toggle-row", "toggle-sort", "load-trades", "select", "go"],
|
|
1009
1011
|
setup(e, { emit: t }) {
|
|
1010
|
-
const a = e, n = t,
|
|
1012
|
+
const a = e, n = t, s = [
|
|
1011
1013
|
{ key: "return", label: "Return %" },
|
|
1012
1014
|
{ key: "copiers", label: "Copiers" },
|
|
1013
1015
|
{ key: "aum", label: "Copiers AUM" },
|
|
@@ -1019,22 +1021,22 @@ const ua = Symbol("pelican.apiBase"), _e = Symbol("pelican.locale"), ca = ["data
|
|
|
1019
1021
|
function c(l) {
|
|
1020
1022
|
return a.sortKey === `${l}-asc` ? "active-asc" : a.sortKey === `${l}-desc` ? "active-desc" : "";
|
|
1021
1023
|
}
|
|
1022
|
-
return (l,
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
(
|
|
1024
|
+
return (l, o) => (p(), y("section", dn, [
|
|
1025
|
+
i("div", mn, [
|
|
1026
|
+
o[1] || (o[1] = i("div", null, "Name", -1)),
|
|
1027
|
+
o[2] || (o[2] = i("div", null, "Equity curve", -1)),
|
|
1028
|
+
(p(), y(U, null, K(s, (u) => i("div", {
|
|
1027
1029
|
key: u.key,
|
|
1028
|
-
class:
|
|
1030
|
+
class: B(["c-num sortable", c(u.key)]),
|
|
1029
1031
|
onClick: (m) => n("toggle-sort", u.key)
|
|
1030
|
-
},
|
|
1031
|
-
|
|
1032
|
+
}, b(u.label), 11, fn)), 64)),
|
|
1033
|
+
o[3] || (o[3] = i("div", null, null, -1))
|
|
1032
1034
|
]),
|
|
1033
|
-
e.pageItems.length === 0 ? (
|
|
1034
|
-
|
|
1035
|
-
|
|
1035
|
+
e.pageItems.length === 0 ? (p(), y("div", vn, [
|
|
1036
|
+
q(l.$slots, "empty", {}, () => [
|
|
1037
|
+
o[4] || (o[4] = D("No matches.", -1))
|
|
1036
1038
|
], !0)
|
|
1037
|
-
])) : (
|
|
1039
|
+
])) : (p(!0), y(U, { key: 1 }, K(e.pageItems, (u) => (p(), re(en, {
|
|
1038
1040
|
key: u.Id,
|
|
1039
1041
|
s: u,
|
|
1040
1042
|
expanded: e.expanded.has(u.Id),
|
|
@@ -1044,23 +1046,23 @@ const ua = Symbol("pelican.apiBase"), _e = Symbol("pelican.locale"), ca = ["data
|
|
|
1044
1046
|
onLoadTrades: (m) => n("load-trades", { id: u.Id, kind: m }),
|
|
1045
1047
|
onSelect: (m) => n("select", u)
|
|
1046
1048
|
}, {
|
|
1047
|
-
"row-actions":
|
|
1048
|
-
|
|
1049
|
+
"row-actions": ue((m) => [
|
|
1050
|
+
q(l.$slots, "row-actions", Ve({ ref_for: !0 }, m), void 0, !0)
|
|
1049
1051
|
]),
|
|
1050
1052
|
_: 3
|
|
1051
1053
|
}, 8, ["s", "expanded", "open-trades", "closed-trades", "onToggle", "onLoadTrades", "onSelect"]))), 128)),
|
|
1052
|
-
P(
|
|
1054
|
+
P(cn, {
|
|
1053
1055
|
page: e.page,
|
|
1054
1056
|
"total-pages": e.totalPages,
|
|
1055
1057
|
range: e.pageRange,
|
|
1056
|
-
onGo:
|
|
1058
|
+
onGo: o[0] || (o[0] = (u) => n("go", u))
|
|
1057
1059
|
}, null, 8, ["page", "total-pages", "range"])
|
|
1058
1060
|
]));
|
|
1059
1061
|
}
|
|
1060
|
-
}),
|
|
1062
|
+
}), gn = /* @__PURE__ */ N(pn, [["__scopeId", "data-v-c61b9ce8"]]), hn = {
|
|
1061
1063
|
key: 0,
|
|
1062
1064
|
class: "pelican-progress"
|
|
1063
|
-
},
|
|
1065
|
+
}, yn = { class: "bar" }, Mn = { class: "caption" }, bn = { class: "hint" }, xn = /* @__PURE__ */ F({
|
|
1064
1066
|
__name: "ProgressBar",
|
|
1065
1067
|
props: {
|
|
1066
1068
|
loaded: {},
|
|
@@ -1068,178 +1070,185 @@ const ua = Symbol("pelican.apiBase"), _e = Symbol("pelican.locale"), ca = ["data
|
|
|
1068
1070
|
active: { type: Boolean }
|
|
1069
1071
|
},
|
|
1070
1072
|
setup(e) {
|
|
1071
|
-
const t = e, a =
|
|
1073
|
+
const t = e, a = k(
|
|
1072
1074
|
() => t.total > 0 ? Math.min(100, t.loaded / t.total * 100) : 0
|
|
1073
1075
|
);
|
|
1074
|
-
return (n,
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
style:
|
|
1076
|
+
return (n, s) => e.active ? (p(), y("div", hn, [
|
|
1077
|
+
i("div", yn, [
|
|
1078
|
+
i("span", {
|
|
1079
|
+
style: ie({ width: a.value.toFixed(1) + "%" })
|
|
1078
1080
|
}, null, 4)
|
|
1079
1081
|
]),
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1082
|
+
i("div", Mn, [
|
|
1083
|
+
s[0] || (s[0] = D(" Building full catalog: ", -1)),
|
|
1084
|
+
i("b", null, b(e.loaded.toLocaleString("en-US")), 1),
|
|
1085
|
+
D(" / " + b(e.total.toLocaleString("en-US")) + " strategies (" + b(a.value.toFixed(0)) + "%) · ", 1),
|
|
1086
|
+
s[1] || (s[1] = i("i", null, "upstream rate-limited", -1))
|
|
1085
1087
|
]),
|
|
1086
|
-
|
|
1087
|
-
])) :
|
|
1088
|
+
i("div", bn, " All " + b(e.total.toLocaleString("en-US")) + " strategies are visible. Stats fill in as the build progresses; refresh of data every 20 sec. ", 1)
|
|
1089
|
+
])) : O("", !0);
|
|
1088
1090
|
}
|
|
1089
|
-
}),
|
|
1090
|
-
function
|
|
1091
|
-
const t =
|
|
1091
|
+
}), wn = /* @__PURE__ */ N(xn, [["__scopeId", "data-v-8767a909"]]), Ae = "pelican-theme";
|
|
1092
|
+
function $n(e = "auto") {
|
|
1093
|
+
const t = kn(), a = R(t ?? e), n = R("dark"), s = typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null, c = () => {
|
|
1092
1094
|
const m = a.value;
|
|
1093
|
-
n.value = m === "dark" ? "dark" : m === "light" ? "light" :
|
|
1095
|
+
n.value = m === "dark" ? "dark" : m === "light" ? "light" : s != null && s.matches ? "dark" : "light";
|
|
1094
1096
|
}, l = () => {
|
|
1095
1097
|
a.value === "auto" && c();
|
|
1096
1098
|
};
|
|
1097
|
-
|
|
1099
|
+
s && (s.addEventListener ? s.addEventListener("change", l) : s.addListener(l)), E(a, (m) => {
|
|
1098
1100
|
try {
|
|
1099
|
-
localStorage.setItem(
|
|
1101
|
+
localStorage.setItem(Ae, m);
|
|
1100
1102
|
} catch {
|
|
1101
1103
|
}
|
|
1102
1104
|
c();
|
|
1103
|
-
}), c(),
|
|
1104
|
-
|
|
1105
|
+
}), c(), me(() => {
|
|
1106
|
+
s && (s.removeEventListener ? s.removeEventListener("change", l) : s.removeListener(l));
|
|
1105
1107
|
});
|
|
1106
|
-
function
|
|
1108
|
+
function o(m) {
|
|
1107
1109
|
a.value = m;
|
|
1108
1110
|
}
|
|
1109
1111
|
function u() {
|
|
1110
1112
|
a.value = a.value === "dark" ? "light" : a.value === "light" ? "auto" : "dark";
|
|
1111
1113
|
}
|
|
1112
|
-
return { mode: a, resolved: n, setMode:
|
|
1114
|
+
return { mode: a, resolved: n, setMode: o, cycle: u };
|
|
1113
1115
|
}
|
|
1114
|
-
function
|
|
1116
|
+
function kn() {
|
|
1115
1117
|
try {
|
|
1116
|
-
const e = localStorage.getItem(
|
|
1118
|
+
const e = localStorage.getItem(Ae);
|
|
1117
1119
|
return e === "dark" || e === "light" || e === "auto" ? e : null;
|
|
1118
1120
|
} catch {
|
|
1119
1121
|
return null;
|
|
1120
1122
|
}
|
|
1121
1123
|
}
|
|
1122
|
-
function
|
|
1124
|
+
function Z(e, t, a) {
|
|
1123
1125
|
const n = new Error(t);
|
|
1124
1126
|
return n.code = e, a !== void 0 && (n.status = a), n;
|
|
1125
1127
|
}
|
|
1126
|
-
async function
|
|
1127
|
-
const a =
|
|
1128
|
+
async function oe(e, t) {
|
|
1129
|
+
const a = J(t, e);
|
|
1128
1130
|
let n;
|
|
1129
1131
|
try {
|
|
1130
1132
|
n = await fetch(a);
|
|
1131
|
-
} catch (
|
|
1132
|
-
throw
|
|
1133
|
+
} catch (s) {
|
|
1134
|
+
throw Z("fetch_failed", s.message ?? "fetch failed");
|
|
1133
1135
|
}
|
|
1134
1136
|
if (n.status === 401 || n.status === 503)
|
|
1135
|
-
throw
|
|
1137
|
+
throw Z("no_token", "Proxy has no token yet", n.status);
|
|
1136
1138
|
if (!n.ok) {
|
|
1137
|
-
const
|
|
1138
|
-
throw
|
|
1139
|
+
const s = await n.text().catch(() => "");
|
|
1140
|
+
throw Z("http_error", `${n.status}: ${s.slice(0, 120)}`, n.status);
|
|
1139
1141
|
}
|
|
1140
1142
|
return await n.json();
|
|
1141
1143
|
}
|
|
1142
|
-
function
|
|
1144
|
+
function J(e, t) {
|
|
1143
1145
|
if (!e) return t;
|
|
1144
1146
|
const a = e.endsWith("/") ? e.slice(0, -1) : e, n = t.startsWith("/") ? t : "/" + t;
|
|
1145
1147
|
return a + n;
|
|
1146
1148
|
}
|
|
1147
|
-
function
|
|
1148
|
-
const
|
|
1149
|
-
let
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1149
|
+
function In({ apiBase: e, catalogBase: t, onError: a }) {
|
|
1150
|
+
const n = Ee(/* @__PURE__ */ new Map()), s = R(!1), c = R(!1), l = R(0), o = R(0), u = R(null), m = k(() => Array.from(n.value.values()));
|
|
1151
|
+
let g = !1;
|
|
1152
|
+
const f = (M) => {
|
|
1153
|
+
a ? a(M) : console.warn("[pelican-vue]", M);
|
|
1154
|
+
}, d = () => {
|
|
1155
|
+
const M = t == null ? void 0 : t.value;
|
|
1156
|
+
return !!M && M !== e.value;
|
|
1157
|
+
}, r = () => (t == null ? void 0 : t.value) || e.value;
|
|
1158
|
+
async function w(M) {
|
|
1154
1159
|
try {
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
const
|
|
1158
|
-
for (const
|
|
1159
|
-
|
|
1160
|
-
} catch (
|
|
1161
|
-
|
|
1160
|
+
const Y = await oe(M ? "/api/strategies-full?partial=1" : "/api/strategies-full", r());
|
|
1161
|
+
o.value = Y.length;
|
|
1162
|
+
const z = n.value;
|
|
1163
|
+
for (const L of Y) z.set(L.Id, { ...z.get(L.Id), ...L });
|
|
1164
|
+
ae(n);
|
|
1165
|
+
} catch (T) {
|
|
1166
|
+
f(T);
|
|
1162
1167
|
}
|
|
1163
1168
|
}
|
|
1164
|
-
async function
|
|
1169
|
+
async function I() {
|
|
1165
1170
|
try {
|
|
1166
|
-
const
|
|
1167
|
-
return
|
|
1168
|
-
} catch (
|
|
1169
|
-
return
|
|
1171
|
+
const M = await oe("/api/strategies-full/progress", r());
|
|
1172
|
+
return l.value = M.loaded, o.value = M.total || o.value, c.value = M.building, u.value = M.built_at, M;
|
|
1173
|
+
} catch (M) {
|
|
1174
|
+
return f(M), null;
|
|
1170
1175
|
}
|
|
1171
1176
|
}
|
|
1172
|
-
async function
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1177
|
+
async function _() {
|
|
1178
|
+
if (d()) {
|
|
1179
|
+
await w(!1), I(), s.value = !0;
|
|
1180
|
+
return;
|
|
1181
|
+
}
|
|
1182
|
+
await w(!0);
|
|
1183
|
+
let M = Date.now();
|
|
1184
|
+
for (; !g; ) {
|
|
1185
|
+
const T = await I();
|
|
1186
|
+
if (!T) {
|
|
1187
|
+
await Pe(1500);
|
|
1179
1188
|
continue;
|
|
1180
1189
|
}
|
|
1181
|
-
if (
|
|
1182
|
-
Date.now() -
|
|
1190
|
+
if (T.ready) break;
|
|
1191
|
+
Date.now() - M > je && (await w(!0), M = Date.now()), await Pe(He);
|
|
1183
1192
|
}
|
|
1184
|
-
|
|
1193
|
+
g || (await w(!1), s.value = !0);
|
|
1185
1194
|
}
|
|
1186
|
-
const
|
|
1187
|
-
async function
|
|
1188
|
-
if (
|
|
1189
|
-
const
|
|
1190
|
-
if (!(
|
|
1191
|
-
|
|
1195
|
+
const h = /* @__PURE__ */ new Set();
|
|
1196
|
+
async function C(M) {
|
|
1197
|
+
if (h.has(M)) return;
|
|
1198
|
+
const T = n.value.get(M);
|
|
1199
|
+
if (!(T != null && T._enrichAttempted && T._meta && T._stats)) {
|
|
1200
|
+
h.add(M);
|
|
1192
1201
|
try {
|
|
1193
|
-
const [
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
]),
|
|
1197
|
-
|
|
1202
|
+
const [Y, z] = await Promise.all([
|
|
1203
|
+
Re(J(e.value, `/api/strategies/${M}`)),
|
|
1204
|
+
Re(J(e.value, `/api/strategies/${M}/stats`))
|
|
1205
|
+
]), L = n.value, A = L.get(M) ?? { Id: M };
|
|
1206
|
+
_n(A, Y), Sn(A, z), A._enrichAttempted = !0, A.IsEnabled === !1 ? L.delete(M) : L.set(M, A), ae(n);
|
|
1198
1207
|
} finally {
|
|
1199
|
-
|
|
1208
|
+
h.delete(M);
|
|
1200
1209
|
}
|
|
1201
1210
|
}
|
|
1202
1211
|
}
|
|
1203
|
-
async function
|
|
1204
|
-
if (!(!
|
|
1212
|
+
async function V(M) {
|
|
1213
|
+
if (!(!M || !s.value))
|
|
1205
1214
|
try {
|
|
1206
|
-
const
|
|
1207
|
-
`/api/strategies?filter=${encodeURIComponent(
|
|
1215
|
+
const T = await oe(
|
|
1216
|
+
`/api/strategies?filter=${encodeURIComponent(M)}`,
|
|
1208
1217
|
e.value
|
|
1209
|
-
),
|
|
1210
|
-
let
|
|
1211
|
-
for (const
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
for (const
|
|
1215
|
-
} catch (
|
|
1216
|
-
|
|
1218
|
+
), Y = n.value, z = [];
|
|
1219
|
+
let L = 0;
|
|
1220
|
+
for (const A of T)
|
|
1221
|
+
Y.has(A.Id) || (Y.set(A.Id, { ...A, _stats: !1, _meta: !1 }), z.push(A.Id), L++);
|
|
1222
|
+
L && (o.value += L, ae(n));
|
|
1223
|
+
for (const A of z) C(A);
|
|
1224
|
+
} catch (T) {
|
|
1225
|
+
f(T);
|
|
1217
1226
|
}
|
|
1218
1227
|
}
|
|
1219
|
-
function
|
|
1220
|
-
|
|
1228
|
+
function S() {
|
|
1229
|
+
g = !1, _();
|
|
1221
1230
|
}
|
|
1222
|
-
function
|
|
1223
|
-
|
|
1231
|
+
function x() {
|
|
1232
|
+
g = !0;
|
|
1224
1233
|
}
|
|
1225
|
-
async function
|
|
1226
|
-
|
|
1234
|
+
async function $() {
|
|
1235
|
+
x(), n.value = /* @__PURE__ */ new Map(), s.value = !1, l.value = 0, o.value = 0, u.value = null, S();
|
|
1227
1236
|
}
|
|
1228
|
-
return
|
|
1229
|
-
catalog:
|
|
1230
|
-
ready:
|
|
1231
|
-
building:
|
|
1232
|
-
loaded:
|
|
1233
|
-
total:
|
|
1234
|
-
builtAt:
|
|
1235
|
-
enrichOne:
|
|
1236
|
-
searchExtra:
|
|
1237
|
-
refresh:
|
|
1238
|
-
start:
|
|
1239
|
-
stop:
|
|
1237
|
+
return me(x), {
|
|
1238
|
+
catalog: m,
|
|
1239
|
+
ready: s,
|
|
1240
|
+
building: c,
|
|
1241
|
+
loaded: l,
|
|
1242
|
+
total: o,
|
|
1243
|
+
builtAt: u,
|
|
1244
|
+
enrichOne: C,
|
|
1245
|
+
searchExtra: V,
|
|
1246
|
+
refresh: $,
|
|
1247
|
+
start: S,
|
|
1248
|
+
stop: x
|
|
1240
1249
|
};
|
|
1241
1250
|
}
|
|
1242
|
-
async function
|
|
1251
|
+
async function Re(e) {
|
|
1243
1252
|
try {
|
|
1244
1253
|
const t = await fetch(e);
|
|
1245
1254
|
return t.ok ? await t.json() : null;
|
|
@@ -1247,19 +1256,19 @@ async function $e(e) {
|
|
|
1247
1256
|
return null;
|
|
1248
1257
|
}
|
|
1249
1258
|
}
|
|
1250
|
-
function
|
|
1259
|
+
function _n(e, t) {
|
|
1251
1260
|
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);
|
|
1252
1261
|
}
|
|
1253
|
-
function
|
|
1254
|
-
var
|
|
1262
|
+
function Sn(e, t) {
|
|
1263
|
+
var o, u, m, g, f, d;
|
|
1255
1264
|
if (!t) return;
|
|
1256
|
-
const a = ((
|
|
1257
|
-
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((r) => ({ n: r.MarketName, c: r.Count })) : [], e.AccountBalance = ((m = t.Status) == null ? void 0 : m.Balance) ?? null, e.CopiersAUM = ((
|
|
1265
|
+
const a = ((o = t.Profitability) == null ? void 0 : o.Inception) ?? {}, n = ((u = t.Trades) == null ? void 0 : u.Inception) ?? {}, s = a.History ?? [], c = s.length > 60 ? Math.ceil(s.length / 60) : 1, l = s.filter((r, w) => w % c === 0 || w === s.length - 1).map((r) => ({ Timestamp: r.Timestamp, AccountReturn: r.AccountReturn }));
|
|
1266
|
+
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((r) => ({ n: r.MarketName, c: r.Count })) : [], e.AccountBalance = ((m = t.Status) == null ? void 0 : m.Balance) ?? null, e.CopiersAUM = ((g = t.CopiersBalance) == null ? void 0 : g.Balance) ?? null, e.MonthlyProfit = ((f = t.CopiersProfit) == null ? void 0 : f.Month) ?? null, e.YearlyProfit = ((d = t.CopiersProfit) == null ? void 0 : d.Year) ?? null, e._stats = !0;
|
|
1258
1267
|
}
|
|
1259
|
-
function
|
|
1268
|
+
function Pe(e) {
|
|
1260
1269
|
return new Promise((t) => setTimeout(t, e));
|
|
1261
1270
|
}
|
|
1262
|
-
function
|
|
1271
|
+
function de() {
|
|
1263
1272
|
return {
|
|
1264
1273
|
risk: /* @__PURE__ */ new Set(),
|
|
1265
1274
|
retMin: null,
|
|
@@ -1276,32 +1285,32 @@ function oe() {
|
|
|
1276
1285
|
search: ""
|
|
1277
1286
|
};
|
|
1278
1287
|
}
|
|
1279
|
-
function
|
|
1280
|
-
const a =
|
|
1288
|
+
function Rn(e, t = {}) {
|
|
1289
|
+
const a = de(), n = Ce({
|
|
1281
1290
|
...a,
|
|
1282
1291
|
...t,
|
|
1283
1292
|
risk: new Set(t.risk ?? a.risk)
|
|
1284
|
-
}),
|
|
1293
|
+
}), s = k(() => e.value.filter((l) => Pn(l, n)));
|
|
1285
1294
|
function c() {
|
|
1286
|
-
const l =
|
|
1295
|
+
const l = de();
|
|
1287
1296
|
n.risk = l.risk, n.retMin = null, n.retMax = null, n.ddMax = null, n.aumMin = null, n.copiersMin = null, n.ageMin = null, n.tradesMin = null, n.winrateMin = null, n.feeMax = null, n.balanceMin = null, n.balanceMax = null, n.search = "";
|
|
1288
1297
|
}
|
|
1289
|
-
return { filters: n, filtered:
|
|
1298
|
+
return { filters: n, filtered: s, reset: c };
|
|
1290
1299
|
}
|
|
1291
|
-
function
|
|
1292
|
-
var
|
|
1300
|
+
function Pn(e, t) {
|
|
1301
|
+
var s;
|
|
1293
1302
|
if (t.search) {
|
|
1294
1303
|
const c = t.search.toLowerCase();
|
|
1295
|
-
if (!(e.Name || "").toLowerCase().includes(c) && !(((
|
|
1304
|
+
if (!(e.Name || "").toLowerCase().includes(c) && !(((s = e.Profile) == null ? void 0 : s.Name) || "").toLowerCase().includes(c))
|
|
1296
1305
|
return !1;
|
|
1297
1306
|
}
|
|
1298
1307
|
if (t.risk.size && e.RiskProfile && !t.risk.has(e.RiskProfile) || e.IsSimulated || e._stats && !e.TradesTotal || t.copiersMin != null && (e.NumCopiers ?? 0) < t.copiersMin || t.aumMin != null && (e.CopiersAUM ?? 0) < t.aumMin || t.balanceMin != null && (e.AccountBalance ?? 0) < t.balanceMin || t.balanceMax != null && (e.AccountBalance ?? 1 / 0) > t.balanceMax || t.feeMax != null && e.Fee != null && e.Fee * 100 > t.feeMax || t.tradesMin != null && (e.TradesTotal ?? 0) < t.tradesMin) return !1;
|
|
1299
|
-
const a =
|
|
1308
|
+
const a = W(e);
|
|
1300
1309
|
if (t.winrateMin != null && (a < 0 || a < t.winrateMin)) return !1;
|
|
1301
|
-
const n =
|
|
1310
|
+
const n = j(e.Inception);
|
|
1302
1311
|
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);
|
|
1303
1312
|
}
|
|
1304
|
-
const
|
|
1313
|
+
const Cn = {
|
|
1305
1314
|
"return-desc": (e, t) => (t.Return ?? -1e18) - (e.Return ?? -1e18),
|
|
1306
1315
|
"return-asc": (e, t) => (e.Return ?? 1e18) - (t.Return ?? 1e18),
|
|
1307
1316
|
"dd-asc": (e, t) => Math.abs(e.MaxDD ?? 1e9) - Math.abs(t.MaxDD ?? 1e9),
|
|
@@ -1312,55 +1321,55 @@ const Pn = {
|
|
|
1312
1321
|
"copiers-asc": (e, t) => (e.NumCopiers ?? 1 / 0) - (t.NumCopiers ?? 1 / 0),
|
|
1313
1322
|
"fee-asc": (e, t) => (e.Fee ?? 1 / 0) - (t.Fee ?? 1 / 0),
|
|
1314
1323
|
"fee-desc": (e, t) => (t.Fee ?? -1) - (e.Fee ?? -1),
|
|
1315
|
-
"age-desc": (e, t) => (
|
|
1316
|
-
"age-asc": (e, t) => (
|
|
1324
|
+
"age-desc": (e, t) => (j(t.Inception) ?? -1) - (j(e.Inception) ?? -1),
|
|
1325
|
+
"age-asc": (e, t) => (j(e.Inception) ?? 1 / 0) - (j(t.Inception) ?? 1 / 0),
|
|
1317
1326
|
"balance-desc": (e, t) => (t.AccountBalance ?? -1) - (e.AccountBalance ?? -1),
|
|
1318
1327
|
"balance-asc": (e, t) => (e.AccountBalance ?? 1 / 0) - (t.AccountBalance ?? 1 / 0),
|
|
1319
|
-
"winrate-desc": (e, t) =>
|
|
1320
|
-
"winrate-asc": (e, t) =>
|
|
1328
|
+
"winrate-desc": (e, t) => W(t) - W(e),
|
|
1329
|
+
"winrate-asc": (e, t) => W(e) - W(t),
|
|
1321
1330
|
"trades-desc": (e, t) => (t.TradesTotal ?? -1) - (e.TradesTotal ?? -1),
|
|
1322
1331
|
"trades-asc": (e, t) => (e.TradesTotal ?? 1 / 0) - (t.TradesTotal ?? 1 / 0),
|
|
1323
1332
|
"monthly-desc": (e, t) => (t.MonthlyProfit ?? -1e18) - (e.MonthlyProfit ?? -1e18),
|
|
1324
1333
|
"monthly-asc": (e, t) => (e.MonthlyProfit ?? 1e18) - (t.MonthlyProfit ?? 1e18)
|
|
1325
1334
|
};
|
|
1326
1335
|
function Tn(e, t = "return-desc") {
|
|
1327
|
-
const a =
|
|
1328
|
-
const c =
|
|
1336
|
+
const a = R(t), n = k(() => {
|
|
1337
|
+
const c = Cn[a.value] ?? (() => 0);
|
|
1329
1338
|
return e.value.slice().sort(c);
|
|
1330
1339
|
});
|
|
1331
|
-
function
|
|
1332
|
-
const [l,
|
|
1333
|
-
a.value = a.value === l ?
|
|
1340
|
+
function s(c) {
|
|
1341
|
+
const [l, o] = Ze[c];
|
|
1342
|
+
a.value = a.value === l ? o : l;
|
|
1334
1343
|
}
|
|
1335
1344
|
return {
|
|
1336
1345
|
sortKey: a,
|
|
1337
1346
|
sorted: n,
|
|
1338
|
-
toggleColumn:
|
|
1347
|
+
toggleColumn: s,
|
|
1339
1348
|
setKey: (c) => {
|
|
1340
1349
|
a.value = c;
|
|
1341
1350
|
}
|
|
1342
1351
|
};
|
|
1343
1352
|
}
|
|
1344
|
-
function
|
|
1345
|
-
const a =
|
|
1346
|
-
|
|
1353
|
+
function An(e, t) {
|
|
1354
|
+
const a = R(1), n = k(() => Math.max(1, Math.ceil(e.value.length / t)));
|
|
1355
|
+
E(n, (l) => {
|
|
1347
1356
|
a.value > l && (a.value = l), a.value < 1 && (a.value = 1);
|
|
1348
1357
|
});
|
|
1349
|
-
const
|
|
1358
|
+
const s = k(() => {
|
|
1350
1359
|
const l = (a.value - 1) * t;
|
|
1351
1360
|
return e.value.slice(l, l + t);
|
|
1352
|
-
}), c =
|
|
1353
|
-
const l = a.value,
|
|
1354
|
-
if (
|
|
1355
|
-
const m = [.../* @__PURE__ */ new Set([1,
|
|
1356
|
-
for (let
|
|
1357
|
-
|
|
1358
|
-
return
|
|
1361
|
+
}), c = k(() => {
|
|
1362
|
+
const l = a.value, o = n.value;
|
|
1363
|
+
if (o <= 1) return [];
|
|
1364
|
+
const m = [.../* @__PURE__ */ new Set([1, o, l, l - 1, l + 1, l - 2, l + 2, 2, o - 1])].filter((f) => f >= 1 && f <= o).sort((f, d) => f - d), g = [];
|
|
1365
|
+
for (let f = 0; f < m.length; f++)
|
|
1366
|
+
f && m[f] - m[f - 1] > 1 && g.push("…"), g.push(m[f]);
|
|
1367
|
+
return g;
|
|
1359
1368
|
});
|
|
1360
1369
|
return {
|
|
1361
1370
|
page: a,
|
|
1362
1371
|
totalPages: n,
|
|
1363
|
-
pageItems:
|
|
1372
|
+
pageItems: s,
|
|
1364
1373
|
pageRange: c,
|
|
1365
1374
|
setPage: (l) => {
|
|
1366
1375
|
a.value = Math.max(1, Math.min(n.value, l));
|
|
@@ -1373,39 +1382,40 @@ function Cn(e, t) {
|
|
|
1373
1382
|
}
|
|
1374
1383
|
};
|
|
1375
1384
|
}
|
|
1376
|
-
function
|
|
1377
|
-
const t =
|
|
1385
|
+
function Fn(e) {
|
|
1386
|
+
const t = R(/* @__PURE__ */ new Map()), a = R(/* @__PURE__ */ new Map());
|
|
1378
1387
|
function n(c, l) {
|
|
1379
1388
|
return (l === "open" ? t.value : a.value).get(c) ?? null;
|
|
1380
1389
|
}
|
|
1381
|
-
async function
|
|
1382
|
-
const
|
|
1390
|
+
async function s(c, l) {
|
|
1391
|
+
const o = l === "open" ? t : a, u = o.value.get(c);
|
|
1383
1392
|
if (u && (u.loading || u.trades !== null)) return;
|
|
1384
|
-
const m = new Map(
|
|
1385
|
-
m.set(c, { loading: !0, trades: null, error: null }),
|
|
1386
|
-
let
|
|
1393
|
+
const m = new Map(o.value);
|
|
1394
|
+
m.set(c, { loading: !0, trades: null, error: null }), o.value = m;
|
|
1395
|
+
let g = "";
|
|
1387
1396
|
if (l === "closed") {
|
|
1388
|
-
const I = /* @__PURE__ */ new Date(), _ = new Date(Date.now() - We * 864e5),
|
|
1389
|
-
|
|
1397
|
+
const I = /* @__PURE__ */ new Date(), _ = new Date(Date.now() - We * 864e5), h = (C) => C.toISOString().replace(/\.\d+Z$/, "Z");
|
|
1398
|
+
g = `?startDate=${encodeURIComponent(h(_))}&endDate=${encodeURIComponent(h(I))}`;
|
|
1390
1399
|
}
|
|
1391
|
-
const
|
|
1392
|
-
let
|
|
1400
|
+
const f = J(e.value, `/api/strategies/${c}/signals/${l}${g}`);
|
|
1401
|
+
let d = [], r = null;
|
|
1393
1402
|
try {
|
|
1394
|
-
const I = await fetch(
|
|
1395
|
-
if (!I.ok) throw
|
|
1396
|
-
|
|
1403
|
+
const I = await fetch(f);
|
|
1404
|
+
if (!I.ok) throw Z("http_error", `${I.status}`);
|
|
1405
|
+
d = await I.json();
|
|
1397
1406
|
} catch (I) {
|
|
1398
|
-
r = I.code ? I :
|
|
1407
|
+
r = I.code ? I : Z("fetch_failed", I.message), d = [];
|
|
1399
1408
|
}
|
|
1400
|
-
const w = new Map(
|
|
1401
|
-
w.set(c, { loading: !1, trades:
|
|
1409
|
+
const w = new Map(o.value);
|
|
1410
|
+
w.set(c, { loading: !1, trades: d, error: r }), o.value = w;
|
|
1402
1411
|
}
|
|
1403
|
-
return { open: t, closed: a, load:
|
|
1412
|
+
return { open: t, closed: a, load: s, get: n };
|
|
1404
1413
|
}
|
|
1405
|
-
const
|
|
1414
|
+
const Nn = ["data-theme"], Ln = { class: "brand-row" }, Dn = ["title"], Un = { "aria-hidden": "true" }, Vn = { class: "pelican-main" }, En = /* @__PURE__ */ F({
|
|
1406
1415
|
__name: "PelicanLibertexSocial",
|
|
1407
1416
|
props: {
|
|
1408
1417
|
apiBase: {},
|
|
1418
|
+
catalogBase: {},
|
|
1409
1419
|
theme: { default: "auto" },
|
|
1410
1420
|
defaultSort: { default: "return-desc" },
|
|
1411
1421
|
defaultFilters: {},
|
|
@@ -1416,115 +1426,116 @@ const Fn = ["data-theme"], Nn = { class: "brand-row" }, Ln = ["title"], Dn = { "
|
|
|
1416
1426
|
emits: ["update:theme", "select-strategy", "error"],
|
|
1417
1427
|
setup(e, { emit: t }) {
|
|
1418
1428
|
const a = e, n = t;
|
|
1419
|
-
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1429
|
+
ne(ua, a.apiBase), ne(ca, a.catalogBase ?? a.apiBase), ne(Te, a.locale);
|
|
1430
|
+
const s = Me(a, "apiBase"), c = Me(a, "catalogBase"), l = $n(a.theme);
|
|
1431
|
+
E(l.mode, (x) => n("update:theme", x)), E(
|
|
1422
1432
|
() => a.theme,
|
|
1423
|
-
(
|
|
1433
|
+
(x) => l.setMode(x)
|
|
1424
1434
|
);
|
|
1425
|
-
const
|
|
1426
|
-
apiBase:
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1435
|
+
const o = In({
|
|
1436
|
+
apiBase: s,
|
|
1437
|
+
catalogBase: c,
|
|
1438
|
+
onError: (x) => n("error", x)
|
|
1439
|
+
}), u = Rn(o.catalog, a.defaultFilters ?? {}), m = Tn(u.filtered, a.defaultSort), g = An(m.sorted, a.pageSize), f = Fn(s), d = Ce(/* @__PURE__ */ new Set()), r = R(!1), w = R(null);
|
|
1440
|
+
function I(x) {
|
|
1441
|
+
d.has(x) ? d.delete(x) : d.add(x);
|
|
1442
|
+
const $ = o.catalog.value.find((M) => M.Id === x);
|
|
1443
|
+
$ && ((!$._meta || !$._stats) && !$._enrichAttempted && o.enrichOne(x), n("select-strategy", $));
|
|
1433
1444
|
}
|
|
1434
|
-
function
|
|
1435
|
-
|
|
1445
|
+
function _(x) {
|
|
1446
|
+
m.toggleColumn(x), g.setPage(1);
|
|
1436
1447
|
}
|
|
1437
|
-
function
|
|
1438
|
-
Object.assign(
|
|
1448
|
+
function h(x) {
|
|
1449
|
+
Object.assign(u.filters, x), g.setPage(1);
|
|
1439
1450
|
}
|
|
1440
|
-
function
|
|
1441
|
-
const
|
|
1442
|
-
Object.assign(
|
|
1451
|
+
function C() {
|
|
1452
|
+
const x = de();
|
|
1453
|
+
Object.assign(u.filters, x), u.filters.risk = x.risk, w.value = null, g.setPage(1);
|
|
1443
1454
|
}
|
|
1444
|
-
function
|
|
1445
|
-
|
|
1455
|
+
function V({ id: x, kind: $ }) {
|
|
1456
|
+
f.load(x, $);
|
|
1446
1457
|
}
|
|
1447
|
-
function
|
|
1448
|
-
|
|
1458
|
+
function S(x) {
|
|
1459
|
+
x === "prev" ? g.prev() : x === "next" ? g.next() : g.setPage(x);
|
|
1449
1460
|
}
|
|
1450
|
-
return Be(() =>
|
|
1461
|
+
return Be(() => o.start()), (x, $) => (p(), y("div", {
|
|
1451
1462
|
class: "pelican-libsoc",
|
|
1452
|
-
"data-theme":
|
|
1463
|
+
"data-theme": v(l).resolved.value
|
|
1453
1464
|
}, [
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1465
|
+
i("header", Ln, [
|
|
1466
|
+
q(x.$slots, "brand", {}, () => [
|
|
1467
|
+
$[6] || ($[6] = i("div", { class: "default-brand" }, "Libertex Social — Copy Trading", -1))
|
|
1457
1468
|
], !0),
|
|
1458
|
-
|
|
1469
|
+
i("button", {
|
|
1459
1470
|
class: "theme-toggle",
|
|
1460
1471
|
type: "button",
|
|
1461
|
-
title:
|
|
1462
|
-
onClick:
|
|
1463
|
-
(...
|
|
1472
|
+
title: v(l).mode.value,
|
|
1473
|
+
onClick: $[0] || ($[0] = //@ts-ignore
|
|
1474
|
+
(...M) => v(l).cycle && v(l).cycle(...M))
|
|
1464
1475
|
}, [
|
|
1465
|
-
|
|
1466
|
-
], 8,
|
|
1476
|
+
i("span", Un, b(v(l).resolved.value === "dark" ? "🌙" : "☀️"), 1)
|
|
1477
|
+
], 8, Dn)
|
|
1467
1478
|
]),
|
|
1468
1479
|
P(st, {
|
|
1469
|
-
search:
|
|
1470
|
-
"sort-key":
|
|
1471
|
-
total:
|
|
1472
|
-
"filtered-total":
|
|
1473
|
-
page:
|
|
1474
|
-
"total-pages":
|
|
1475
|
-
"onUpdate:search":
|
|
1476
|
-
"onUpdate:sortKey":
|
|
1477
|
-
onRefresh:
|
|
1478
|
-
onToggleFilters:
|
|
1480
|
+
search: v(u).filters.search,
|
|
1481
|
+
"sort-key": v(m).sortKey.value,
|
|
1482
|
+
total: v(o).total.value,
|
|
1483
|
+
"filtered-total": v(u).filtered.value.length,
|
|
1484
|
+
page: v(g).page.value,
|
|
1485
|
+
"total-pages": v(g).totalPages.value,
|
|
1486
|
+
"onUpdate:search": $[1] || ($[1] = (M) => h({ search: M })),
|
|
1487
|
+
"onUpdate:sortKey": $[2] || ($[2] = (M) => v(m).setKey(M)),
|
|
1488
|
+
onRefresh: v(o).refresh,
|
|
1489
|
+
onToggleFilters: $[3] || ($[3] = (M) => r.value = !r.value)
|
|
1479
1490
|
}, null, 8, ["search", "sort-key", "total", "filtered-total", "page", "total-pages", "onRefresh"]),
|
|
1480
|
-
P(
|
|
1481
|
-
loaded:
|
|
1482
|
-
total:
|
|
1483
|
-
active:
|
|
1491
|
+
P(wn, {
|
|
1492
|
+
loaded: v(o).loaded.value,
|
|
1493
|
+
total: v(o).total.value,
|
|
1494
|
+
active: v(o).building.value && !v(o).ready.value
|
|
1484
1495
|
}, null, 8, ["loaded", "total", "active"]),
|
|
1485
|
-
|
|
1496
|
+
i("main", Vn, [
|
|
1486
1497
|
P(Ut, {
|
|
1487
|
-
filters:
|
|
1488
|
-
"invest-amount":
|
|
1489
|
-
open:
|
|
1490
|
-
"onUpdate:filters":
|
|
1491
|
-
"onUpdate:investAmount":
|
|
1492
|
-
onReset:
|
|
1498
|
+
filters: v(u).filters,
|
|
1499
|
+
"invest-amount": w.value,
|
|
1500
|
+
open: r.value,
|
|
1501
|
+
"onUpdate:filters": h,
|
|
1502
|
+
"onUpdate:investAmount": $[4] || ($[4] = (M) => w.value = M),
|
|
1503
|
+
onReset: C
|
|
1493
1504
|
}, null, 8, ["filters", "invest-amount", "open"]),
|
|
1494
|
-
P(
|
|
1495
|
-
"page-items":
|
|
1496
|
-
expanded:
|
|
1497
|
-
"sort-key":
|
|
1498
|
-
page:
|
|
1499
|
-
"total-pages":
|
|
1500
|
-
"page-range":
|
|
1501
|
-
"open-signals":
|
|
1502
|
-
"closed-signals":
|
|
1503
|
-
onToggleRow:
|
|
1504
|
-
onToggleSort:
|
|
1505
|
-
onLoadTrades:
|
|
1506
|
-
onSelect:
|
|
1507
|
-
onGo:
|
|
1505
|
+
P(gn, {
|
|
1506
|
+
"page-items": v(g).pageItems.value,
|
|
1507
|
+
expanded: d,
|
|
1508
|
+
"sort-key": v(m).sortKey.value,
|
|
1509
|
+
page: v(g).page.value,
|
|
1510
|
+
"total-pages": v(g).totalPages.value,
|
|
1511
|
+
"page-range": v(g).pageRange.value,
|
|
1512
|
+
"open-signals": v(f).open.value,
|
|
1513
|
+
"closed-signals": v(f).closed.value,
|
|
1514
|
+
onToggleRow: I,
|
|
1515
|
+
onToggleSort: _,
|
|
1516
|
+
onLoadTrades: V,
|
|
1517
|
+
onSelect: $[5] || ($[5] = (M) => n("select-strategy", M)),
|
|
1518
|
+
onGo: S
|
|
1508
1519
|
}, {
|
|
1509
|
-
empty:
|
|
1510
|
-
|
|
1511
|
-
|
|
1520
|
+
empty: ue(() => [
|
|
1521
|
+
q(x.$slots, "empty", {}, () => [
|
|
1522
|
+
$[7] || ($[7] = D("No matches.", -1))
|
|
1512
1523
|
], !0)
|
|
1513
1524
|
]),
|
|
1514
|
-
"row-actions":
|
|
1515
|
-
|
|
1525
|
+
"row-actions": ue((M) => [
|
|
1526
|
+
q(x.$slots, "row-actions", Oe(Ke(M)), void 0, !0)
|
|
1516
1527
|
]),
|
|
1517
1528
|
_: 3
|
|
1518
1529
|
}, 8, ["page-items", "expanded", "sort-key", "page", "total-pages", "page-range", "open-signals", "closed-signals"])
|
|
1519
1530
|
])
|
|
1520
|
-
], 8,
|
|
1531
|
+
], 8, Nn));
|
|
1521
1532
|
}
|
|
1522
|
-
}),
|
|
1533
|
+
}), On = /* @__PURE__ */ N(En, [["__scopeId", "data-v-33b03803"]]);
|
|
1523
1534
|
export {
|
|
1524
|
-
|
|
1535
|
+
On as PelicanLibertexSocial,
|
|
1525
1536
|
qe as SORT_KEYS,
|
|
1526
1537
|
Xe as SORT_LABELS,
|
|
1527
1538
|
Ze as SORT_TOGGLE,
|
|
1528
|
-
|
|
1539
|
+
de as defaultFilters
|
|
1529
1540
|
};
|
|
1530
1541
|
//# sourceMappingURL=pelican-libertex-social.mjs.map
|