@mjsz-vbr-elements/core 2.7.2 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * name: @mjsz-vbr-elements/core
3
- * version: v2.7.2 - 25/10/2024, 08:07:02
4
- * (c) 2024
3
+ * version: v2.9.0 - 09/01/2025, 14:35:52
4
+ * (c) 2025
5
5
  * description: Data visualization for MJSZ VBR
6
6
  * author: Ákos Stegner <akos.stegner@gmail.com>
7
7
  */
8
- import { k as S, l as D, n as h, m as I, p as T, q as b } from "./useAdditionalText-D1LaWU-i.js";
9
- import { c as H, i as tt, h as et, u as nt, b as rt, a as it, d as st, e as at, f as ot, g as ut, v as ct } from "./useAdditionalText-D1LaWU-i.js";
10
- import { unref as u, ref as E, watch as P, nextTick as B } from "vue";
11
- import { VBR_API_BASE_URL as C } from "./constants.js";
12
- import { Q as x, T as y, C as g, S as _, J as V, I as A, i as v, f as M } from "./datetime-BzdN4htO.js";
13
- var O = /* @__PURE__ */ function() {
8
+ import { k as S, l as I, m as D, n as l, p as E, q as T, r as b } from "./useAdditionalText-BCKSsRDN.js";
9
+ import { c as rt, i as it, h as st, u as at, b as ot, a as ut, d as ct, e as ft, f as dt, g as pt, v as lt } from "./useAdditionalText-BCKSsRDN.js";
10
+ import { unref as u, ref as P, watch as B, nextTick as C } from "vue";
11
+ import { VBR_API_BASE_URL as V } from "./constants.js";
12
+ import { Q as x, T as y, C as g, S as _, J as A, I as M, i as v, f as O } from "./datetime-BzdN4htO.js";
13
+ var R = /* @__PURE__ */ function() {
14
14
  function e(t, n) {
15
15
  this.xf = n, this.f = t, this.found = !1;
16
16
  }
@@ -20,18 +20,18 @@ var O = /* @__PURE__ */ function() {
20
20
  return this.f(n) && (this.found = !0, t = y(this.xf["@@transducer/step"](t, n))), t;
21
21
  }, e;
22
22
  }();
23
- function R(e) {
23
+ function F(e) {
24
24
  return function(t) {
25
- return new O(e, t);
25
+ return new R(e, t);
26
26
  };
27
27
  }
28
- var F = /* @__PURE__ */ g(/* @__PURE__ */ _(["find"], R, function(t, n) {
28
+ var X = /* @__PURE__ */ g(/* @__PURE__ */ _(["find"], F, function(t, n) {
29
29
  for (var r = 0, i = n.length; r < i; ) {
30
30
  if (t(n[r]))
31
31
  return n[r];
32
32
  r += 1;
33
33
  }
34
- })), X = /* @__PURE__ */ function() {
34
+ })), Y = /* @__PURE__ */ function() {
35
35
  function e(t, n) {
36
36
  this.xf = n, this.f = t, this.idx = -1, this.found = !1;
37
37
  }
@@ -41,30 +41,30 @@ var F = /* @__PURE__ */ g(/* @__PURE__ */ _(["find"], R, function(t, n) {
41
41
  return this.idx += 1, this.f(n) && (this.found = !0, t = y(this.xf["@@transducer/step"](t, this.idx))), t;
42
42
  }, e;
43
43
  }();
44
- function Y(e) {
44
+ function $(e) {
45
45
  return function(t) {
46
- return new X(e, t);
46
+ return new Y(e, t);
47
47
  };
48
48
  }
49
- var G = /* @__PURE__ */ g(/* @__PURE__ */ _([], Y, function(t, n) {
49
+ var G = /* @__PURE__ */ g(/* @__PURE__ */ _([], $, function(t, n) {
50
50
  for (var r = 0, i = n.length; r < i; ) {
51
51
  if (t(n[r]))
52
52
  return r;
53
53
  r += 1;
54
54
  }
55
55
  return -1;
56
- })), w = /* @__PURE__ */ V(function(t, n, r) {
57
- return t(A(n, r));
56
+ })), w = /* @__PURE__ */ A(function(t, n, r) {
57
+ return t(M(n, r));
58
58
  });
59
59
  const K = async (e, t, n) => {
60
- const r = `${C}${u(e)}?${L(n)}`;
60
+ const r = `${V}${u(e)}${S(n) ? "" : `?${L(n)}`}`;
61
61
  return new Promise((i, o) => {
62
62
  fetch(r, {
63
63
  method: "GET",
64
64
  cache: "no-cache",
65
65
  headers: {
66
66
  "Content-Type": "application/json",
67
- "X-API-KEY": $(t)
67
+ "X-API-KEY": j(t)
68
68
  }
69
69
  }).then((s) => s.json()).then((s) => {
70
70
  if (s.error) return o(s);
@@ -73,12 +73,12 @@ const K = async (e, t, n) => {
73
73
  o(s);
74
74
  });
75
75
  });
76
- }, L = (e) => Object.keys(e).map((t) => t + "=" + e[t]).join("&"), $ = (e) => {
76
+ }, L = (e) => Object.keys(e).map((t) => t + "=" + e[t]).join("&"), j = (e) => {
77
77
  var t;
78
78
  return e || ((t = window.__MJSZ_VBR_WIDGET__) != null && t.apiKey ? window.__MJSZ_VBR_WIDGET__.apiKey : "");
79
- }, Q = (e = {}) => {
80
- const { initial: t = 1, items: n = [], limit: r, auto: i = !1 } = e, o = E(u(t)), s = (a) => v(a, "day");
81
- return S(n, () => {
79
+ }, z = (e = {}) => {
80
+ const { initial: t = 1, items: n = [], limit: r, auto: i = !1 } = e, o = P(u(t)), s = (a) => v(a, "day");
81
+ return I(n, () => {
82
82
  if (!i) return;
83
83
  const a = G(w(s, "gameDate"))(u(n));
84
84
  o.value = a === -1 ? 1 : Math.floor(a / r) + 1;
@@ -88,43 +88,42 @@ const K = async (e, t, n) => {
88
88
  o.value = a;
89
89
  }
90
90
  };
91
- }, W = ({ options: e = {}, transform: t = (i) => i, onError: n = h, onSuccess: r = h }) => {
92
- const { path: i, apiKey: o, params: s, resetOnExecute: d = !1, immediate: c = !1 } = e, {
93
- state: a,
94
- error: f,
95
- isLoading: l,
96
- execute: m
97
- } = D(() => K(i, o, u(s)).then((p) => t(p)), [], {
98
- immediate: c,
99
- resetOnExecute: d,
100
- onError: n,
101
- onSuccess: r
102
- });
91
+ }, N = ({ options: e = {}, transform: t = (i) => i, onError: n = l, onSuccess: r = l }) => {
92
+ const { path: i, apiKey: o, params: s, resetOnExecute: d = !1, immediate: c = !1 } = e, { state: a, error: f, isLoading: h, execute: m } = D(
93
+ () => K(i, o, u(s)).then((p) => t(p)),
94
+ [],
95
+ {
96
+ immediate: c,
97
+ resetOnExecute: d,
98
+ onError: n,
99
+ onSuccess: r
100
+ }
101
+ );
103
102
  return {
104
103
  state: a,
105
104
  error: f,
106
- isLoading: l,
105
+ isLoading: h,
107
106
  execute: m
108
107
  };
109
108
  };
110
- function Z(e = !1, t = h, n = h) {
111
- const r = I();
112
- P(r, (i) => {
109
+ function U(e = !1, t = l, n = l) {
110
+ const r = E();
111
+ B(r, (i) => {
113
112
  if (u(e)) {
114
113
  if (i === "visible") return t();
115
114
  n();
116
115
  }
117
116
  });
118
117
  }
119
- const z = (e = {}) => {
118
+ const H = (e = {}) => {
120
119
  const { items: t = [], element: n, offset: r = 0, enabled: i = !0 } = e, o = (c) => v(c, "day"), s = () => {
121
120
  var p;
122
121
  if (d(), !u(i)) return;
123
- const c = F(w(o, "gameDate"))(u(t));
122
+ const c = X(w(o, "gameDate"))(u(t));
124
123
  if (!c) return;
125
- const a = M(c.gameDate, "YYYY-MM-DD"), f = b(n).querySelector(`div[data-gamedate="${a}"]`);
124
+ const a = O(c.gameDate, "YYYY-MM-DD"), f = b(n).querySelector(`div[data-gamedate="${a}"]`);
126
125
  if (!f) return;
127
- const l = getComputedStyle(f).getPropertyValue("--vbr-widget-sticky-top-offset") || 0, m = (((p = f.getBoundingClientRect()) == null ? void 0 : p.top) ?? 0) - u(r) - parseFloat(l);
126
+ const h = getComputedStyle(f).getPropertyValue("--vbr-widget-sticky-top-offset") || 0, m = (((p = f.getBoundingClientRect()) == null ? void 0 : p.top) ?? 0) - u(r) - parseFloat(h);
128
127
  window.scrollTo(0, m);
129
128
  }, { stop: d } = T(
130
129
  () => ({
@@ -132,25 +131,33 @@ const z = (e = {}) => {
132
131
  element: u(n)
133
132
  }),
134
133
  async ({ items: c, element: a }) => {
135
- c.length === 0 || !a || (await B(), s());
134
+ c.length === 0 || !a || (await C(), s());
136
135
  }
137
136
  );
138
137
  };
138
+ let k = 0;
139
+ function J() {
140
+ return ++k;
141
+ }
142
+ function tt() {
143
+ return J();
144
+ }
139
145
  export {
140
- H as createI18n,
146
+ rt as createI18n,
141
147
  K as fetchVBRData,
142
- tt as i18n,
143
- et as useAdditionalText,
144
- nt as useColumns,
145
- rt as useError,
146
- it as useErrorProvider,
147
- st as useI18n,
148
- at as useLazyLoadingState,
149
- ot as useMainClass,
150
- Q as usePage,
151
- z as useScrollToGameDate,
152
- W as useServices,
153
- ut as useSort,
154
- Z as useVisibilityChange,
155
- ct as validateColumnsName
148
+ it as i18n,
149
+ st as useAdditionalText,
150
+ at as useColumns,
151
+ ot as useError,
152
+ ut as useErrorProvider,
153
+ ct as useI18n,
154
+ tt as useId,
155
+ ft as useLazyLoadingState,
156
+ dt as useMainClass,
157
+ z as usePage,
158
+ H as useScrollToGameDate,
159
+ N as useServices,
160
+ pt as useSort,
161
+ U as useVisibilityChange,
162
+ lt as validateColumnsName
156
163
  };
package/dist/constants.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * name: @mjsz-vbr-elements/core
3
- * version: v2.7.2 - 25/10/2024, 08:07:02
4
- * (c) 2024
3
+ * version: v2.9.0 - 09/01/2025, 14:35:52
4
+ * (c) 2025
5
5
  * description: Data visualization for MJSZ VBR
6
6
  * author: Ákos Stegner <akos.stegner@gmail.com>
7
7
  */
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * name: @mjsz-vbr-elements/core
3
- * version: v2.7.2 - 25/10/2024, 08:07:02
4
- * (c) 2024
3
+ * version: v2.9.0 - 09/01/2025, 14:35:52
4
+ * (c) 2025
5
5
  * description: Data visualization for MJSZ VBR
6
6
  * author: Ákos Stegner <akos.stegner@gmail.com>
7
7
  */
8
- import { SORT_STATE_ORIGINAL as j, SORT_STATE_ASCEND as F } from "./constants.js";
9
- import { C as p, L as S, D as v, I as h, _ as f, w as g, x as R, M as O, J as c, N, O as M, K as T, P as U, Q as G, R as k, S as H, T as X, U as q, V as K, B as A, F as Y, H as J, f as m, c as C, b as Q, a as V } from "./datetime-BzdN4htO.js";
8
+ import { SORT_STATE_ORIGINAL as F, SORT_STATE_ASCEND as U } from "./constants.js";
9
+ import { C as p, L as S, D as v, I as m, _ as f, w as g, x as R, M as b, J as c, N, O as M, K as T, P as j, Q as G, R as k, S as H, T as X, U as q, V as Y, B as I, F as K, H as J, f as h, c as $, b as Q, a as V } from "./datetime-BzdN4htO.js";
10
10
  var Z = /* @__PURE__ */ p(function(e, r) {
11
11
  if (e === r)
12
12
  return r;
@@ -23,7 +23,7 @@ var Z = /* @__PURE__ */ p(function(e, r) {
23
23
  var s = S(e), i = n(s, S(r));
24
24
  return i !== void 0 && i === s ? e : r;
25
25
  }), z = /* @__PURE__ */ p(function(e, r) {
26
- return v(h(e), r);
26
+ return v(m(e), r);
27
27
  }), w = /* @__PURE__ */ f(function(e) {
28
28
  return g(e) ? !0 : !e || typeof e != "object" || R(e) ? !1 : e.length === 0 ? !0 : e.length > 0 ? e.hasOwnProperty(0) && e.hasOwnProperty(e.length - 1) : !1;
29
29
  }), D = typeof Symbol < "u" ? Symbol.iterator : "@@iterator";
@@ -55,7 +55,7 @@ function te(t, e, r) {
55
55
  return t["@@transducer/result"](e);
56
56
  }
57
57
  var re = /* @__PURE__ */ p(function(e, r) {
58
- return O(e.length, function() {
58
+ return b(e.length, function() {
59
59
  return e.apply(r, arguments);
60
60
  });
61
61
  });
@@ -72,7 +72,7 @@ function ne(t, e, r) {
72
72
  function ae(t, e, r, n) {
73
73
  return t["@@transducer/result"](r[n](re(t["@@transducer/step"], t), e));
74
74
  }
75
- var $ = /* @__PURE__ */ ee(te, ae, ne), se = /* @__PURE__ */ function() {
75
+ var C = /* @__PURE__ */ ee(te, ae, ne), se = /* @__PURE__ */ function() {
76
76
  function t(e) {
77
77
  this.f = e;
78
78
  }
@@ -84,17 +84,17 @@ var $ = /* @__PURE__ */ ee(te, ae, ne), se = /* @__PURE__ */ function() {
84
84
  return this.f(e, r);
85
85
  }, t;
86
86
  }();
87
- function x(t) {
87
+ function E(t) {
88
88
  return new se(t);
89
89
  }
90
- var E = /* @__PURE__ */ c(function(t, e, r) {
91
- return $(typeof t == "function" ? x(t) : t, e, r);
92
- }), I = /* @__PURE__ */ f(function(e) {
90
+ var P = /* @__PURE__ */ c(function(t, e, r) {
91
+ return C(typeof t == "function" ? E(t) : t, e, r);
92
+ }), O = /* @__PURE__ */ f(function(e) {
93
93
  return function() {
94
94
  return e;
95
95
  };
96
96
  }), ue = /* @__PURE__ */ f(function(e) {
97
- return N(E(Z, 0, z("length", e)), function() {
97
+ return N(P(Z, 0, z("length", e)), function() {
98
98
  for (var r = 0, n = e.length; r < n; ) {
99
99
  if (e[r].apply(this, arguments))
100
100
  return !0;
@@ -135,8 +135,8 @@ var oe = /* @__PURE__ */ f(function(e) {
135
135
  function fe(t) {
136
136
  return new RegExp(t.source, t.flags ? t.flags : (t.global ? "g" : "") + (t.ignoreCase ? "i" : "") + (t.multiline ? "m" : "") + (t.sticky ? "y" : "") + (t.unicode ? "u" : "") + (t.dotAll ? "s" : ""));
137
137
  }
138
- function B(t, e, r) {
139
- if (r || (r = new me()), he(t))
138
+ function L(t, e, r) {
139
+ if (r || (r = new he()), me(t))
140
140
  return t;
141
141
  var n = function(u) {
142
142
  var s = r.get(t);
@@ -147,7 +147,7 @@ function B(t, e, r) {
147
147
  Object.prototype.hasOwnProperty.call(t, i) && (u[i] = t[i]);
148
148
  return u;
149
149
  };
150
- switch (U(t)) {
150
+ switch (j(t)) {
151
151
  case "Object":
152
152
  return n(Object.create(Object.getPrototypeOf(t)));
153
153
  case "Array":
@@ -172,11 +172,11 @@ function B(t, e, r) {
172
172
  return t;
173
173
  }
174
174
  }
175
- function he(t) {
175
+ function me(t) {
176
176
  var e = typeof t;
177
177
  return t == null || e != "object" && e != "function";
178
178
  }
179
- var me = /* @__PURE__ */ function() {
179
+ var he = /* @__PURE__ */ function() {
180
180
  function t() {
181
181
  this.map = {}, this.length = 0;
182
182
  }
@@ -227,12 +227,12 @@ var ye = /* @__PURE__ */ c(/* @__PURE__ */ _("slice", function(e, r, n) {
227
227
  function d() {
228
228
  if (arguments.length === 0)
229
229
  throw new Error("pipe requires at least one argument");
230
- return O(arguments[0].length, E(de, arguments[0], ve(arguments)));
230
+ return b(arguments[0].length, P(de, arguments[0], ve(arguments)));
231
231
  }
232
232
  var ge = /* @__PURE__ */ f(function(e) {
233
233
  return R(e) ? e.split("").reverse().join("") : Array.prototype.slice.call(e, 0).reverse();
234
234
  });
235
- function L() {
235
+ function x() {
236
236
  if (arguments.length === 0)
237
237
  throw new Error("compose requires at least one argument");
238
238
  return d.apply(this, ge(arguments));
@@ -251,7 +251,7 @@ var Ne = /* @__PURE__ */ function() {
251
251
  return this.inputs = null, this.xf["@@transducer/result"](e);
252
252
  }, t.prototype["@@transducer/step"] = function(e, r) {
253
253
  var n = this.keyFn(r);
254
- return this.inputs[n] = this.inputs[n] || [n, B(this.valueAcc)], this.inputs[n][1] = this.valueFn(this.inputs[n][1], r), e;
254
+ return this.inputs[n] = this.inputs[n] || [n, L(this.valueAcc)], this.inputs[n][1] = this.valueFn(this.inputs[n][1], r), e;
255
255
  }, t;
256
256
  }();
257
257
  function Te(t, e, r) {
@@ -260,21 +260,21 @@ function Te(t, e, r) {
260
260
  };
261
261
  }
262
262
  var _e = /* @__PURE__ */ k(4, [], /* @__PURE__ */ H([], Te, function(e, r, n, a) {
263
- var u = x(function(s, i) {
264
- var o = n(i), l = e(T(o, s) ? s[o] : B(r), i);
263
+ var u = E(function(s, i) {
264
+ var o = n(i), l = e(T(o, s) ? s[o] : L(r), i);
265
265
  return l && l["@@transducer/reduced"] ? X(s) : (s[o] = l, s);
266
266
  });
267
- return $(u, {}, a);
267
+ return C(u, {}, a);
268
268
  })), Se = /* @__PURE__ */ c(function(e, r, n) {
269
269
  var a = e(r), u = e(n);
270
270
  return a > u ? -1 : a < u ? 1 : 0;
271
- }), Ae = /* @__PURE__ */ p(/* @__PURE__ */ _("groupBy", /* @__PURE__ */ _e(function(t, e) {
271
+ }), Ie = /* @__PURE__ */ p(/* @__PURE__ */ _("groupBy", /* @__PURE__ */ _e(function(t, e) {
272
272
  return t.push(e), t;
273
273
  }, []))), De = /* @__PURE__ */ c(function(e, r, n) {
274
274
  return N(Math.max(e.length, r.length, n.length), function() {
275
275
  return e.apply(this, arguments) ? r.apply(this, arguments) : n.apply(this, arguments);
276
276
  });
277
- }), Ie = /* @__PURE__ */ p(q), be = /* @__PURE__ */ p(function(e, r) {
277
+ }), Oe = /* @__PURE__ */ p(q), Ae = /* @__PURE__ */ p(function(e, r) {
278
278
  return function(n) {
279
279
  return function(a) {
280
280
  return v(function(u) {
@@ -283,21 +283,21 @@ var _e = /* @__PURE__ */ k(4, [], /* @__PURE__ */ H([], Te, function(e, r, n, a)
283
283
  };
284
284
  };
285
285
  }), Re = /* @__PURE__ */ f(function(e) {
286
- return be(h(e), pe(e));
287
- }), P = function(t) {
286
+ return Ae(m(e), pe(e));
287
+ }), B = function(t) {
288
288
  return {
289
289
  value: t,
290
290
  map: function(e) {
291
- return P(e(t));
291
+ return B(e(t));
292
292
  }
293
293
  };
294
- }, Oe = /* @__PURE__ */ c(function(e, r, n) {
294
+ }, be = /* @__PURE__ */ c(function(e, r, n) {
295
295
  return e(function(a) {
296
- return P(r(a));
296
+ return B(r(a));
297
297
  })(n).value;
298
298
  }), Me = /* @__PURE__ */ c(function(e, r, n) {
299
299
  return n.replace(e, r);
300
- }), Ce = /* @__PURE__ */ p(function(e, r) {
300
+ }), $e = /* @__PURE__ */ p(function(e, r) {
301
301
  return Array.prototype.slice.call(r, 0).sort(e);
302
302
  }), W = /* @__PURE__ */ p(function(e, r) {
303
303
  return Array.prototype.slice.call(r, 0).sort(function(n, a) {
@@ -305,8 +305,8 @@ var _e = /* @__PURE__ */ k(4, [], /* @__PURE__ */ H([], Te, function(e, r, n, a)
305
305
  u = e[s](n, a), s += 1;
306
306
  return u;
307
307
  });
308
- }), b = /* @__PURE__ */ K(0, "toLowerCase");
309
- const je = (t, e = "body") => {
308
+ }), A = /* @__PURE__ */ Y(0, "toLowerCase");
309
+ const Fe = (t, e = "body") => {
310
310
  if (!t) return;
311
311
  if (typeof e != "string") {
312
312
  e == null || e.append(t);
@@ -315,25 +315,33 @@ const je = (t, e = "body") => {
315
315
  const r = document.querySelector(e);
316
316
  r == null || r.append(t);
317
317
  };
318
- class Fe extends Error {
318
+ function Ue(t, e = () => ({})) {
319
+ return t.slice().sort((r, n) => {
320
+ let a = e(r), u = e(n);
321
+ if (a === null || u === null) return 0;
322
+ let s = a.compareDocumentPosition(u);
323
+ return s & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : s & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
324
+ });
325
+ }
326
+ class je extends Error {
319
327
  constructor(e, r = {}) {
320
328
  const { key: n, cause: a } = r;
321
329
  super(e), this.name = "WidgetError", this.key = n, this.cause = a;
322
330
  }
323
331
  }
324
- const Ue = {
332
+ const Ge = {
325
333
  message: "Undefined Column name Message",
326
334
  options: {
327
335
  key: "undefined-column",
328
336
  cause: {}
329
337
  }
330
- }, Ge = {
338
+ }, ke = {
331
339
  message: "Invalid season name",
332
340
  options: {
333
341
  key: "invalid-season-name",
334
342
  cause: {}
335
343
  }
336
- }, ke = (t = []) => ({
344
+ }, He = (t = []) => ({
337
345
  result: [...t],
338
346
  filteredRowsLength: 0,
339
347
  isFiltered: !1,
@@ -347,17 +355,17 @@ const Ue = {
347
355
  filter(e, r = [], n = !1) {
348
356
  if (e) {
349
357
  const a = r.map(
350
- (i) => n ? d(Y(i), A(e)) : d(h(i), b, Ie(b(e)))
351
- ), u = ie((i) => i.name ? Oe(Re("name"), Me(",", ""), i) : i), s = J(d(u, ue([...a])), this.result);
358
+ (i) => n ? d(K(i), I(e)) : d(m(i), A, Oe(A(e)))
359
+ ), u = ie((i) => i.name ? be(Re("name"), Me(",", ""), i) : i), s = J(d(u, ue([...a])), this.result);
352
360
  this.isFiltered = !0, this.filteredRowsLength = s.length, this.result = s;
353
361
  }
354
362
  return this;
355
363
  },
356
364
  sorted(e) {
357
365
  if (!e.sortTarget) return this;
358
- if (e.orders[0].direction === j) return this;
359
- const r = De(A(F), I(y), I(Se));
360
- return this.result = W(e.orders.map((n) => L(r(n.direction), h)(n.target)))(this.result), this;
366
+ if (e.orders[0].direction === F) return this;
367
+ const r = De(I(U), O(y), O(Se));
368
+ return this.result = W(e.orders.map((n) => x(r(n.direction), m)(n.target)))(this.result), this;
361
369
  },
362
370
  addIndex(e = null) {
363
371
  return this.result.reduce((r, n, a) => {
@@ -396,20 +404,20 @@ const Ue = {
396
404
  return this.result = this.result.map((n) => ({
397
405
  ...n,
398
406
  gameResult: `${n.homeTeamScore}-${n.awayTeamScore}`,
399
- gameDateDate: m(n.gameDate, "L dddd", e, r),
400
- gameDateTime: m(n.gameDate, "HH:mm", e, r)
407
+ gameDateDate: h(n.gameDate, "L dddd", e, r),
408
+ gameDateTime: h(n.gameDate, "HH:mm", e, r)
401
409
  })), this;
402
410
  },
403
411
  gameDateFilter(e) {
404
412
  return e === null ? this : (this.result = this.result.filter((r) => new Date(r.gameDate).getMonth() == e), this);
405
413
  },
406
414
  convertTimes(e = []) {
407
- return this.result = this.result.map((r) => (e.map((n) => r[n] ? r[`${n}Sec`] = C(r[n]) : r), r)), this;
415
+ return this.result = this.result.map((r) => (e.map((n) => r[n] ? r[`${n}Sec`] = $(r[n]) : r), r)), this;
408
416
  },
409
417
  groupByDays() {
410
- return this.currentItems = this.result.length, this.result = Ae((e) => m(e.gameDate, "YYYY-MM-DD"))(this.result), this;
418
+ return this.currentItems = this.result.length, this.result = Ie((e) => h(e.gameDate, "YYYY-MM-DD"))(this.result), this;
411
419
  }
412
- }), He = (t, ...e) => v(L(...e))(t), Xe = (t) => {
420
+ }), Xe = (t, ...e) => v(x(...e))(t), qe = (t) => {
413
421
  var e, r, n, a;
414
422
  return {
415
423
  ...t,
@@ -418,9 +426,12 @@ const Ue = {
418
426
  ...((r = t.player) == null ? void 0 : r.id) && { name: `${t.player.lastName} ${t.player.firstName}` },
419
427
  ...((n = t.player) == null ? void 0 : n.nationality) && {
420
428
  name: (a = t.player) != null && a.nationality.includes("hu") ? `${t.player.lastName} ${t.player.firstName}` : `${t.player.lastName}, ${t.player.firstName}`
429
+ },
430
+ ...t.nationality && {
431
+ name: t.nationality.includes("hu") ? `${t.lastName} ${t.firstName}` : `${t.lastName}, ${t.firstName}`
421
432
  }
422
433
  };
423
- }, qe = (t) => {
434
+ }, Ye = (t) => {
424
435
  var e;
425
436
  return {
426
437
  ...t,
@@ -428,46 +439,46 @@ const Ue = {
428
439
  };
429
440
  }, Ke = (t = "", e = "hu") => (r) => ({
430
441
  ...r,
431
- gameDateDate: m(r.gameDate, "L dddd", t, e),
432
- gameDateTime: m(r.gameDate, "HH:mm", t, e)
433
- }), Ye = (t) => (e) => ({
442
+ gameDateDate: h(r.gameDate, "L dddd", t, e),
443
+ gameDateTime: h(r.gameDate, "HH:mm", t, e)
444
+ }), Je = (t) => (e) => ({
434
445
  ...e,
435
- gameResult: Be(e)
436
- }), Je = (t) => ({
437
- ...t,
438
- opponent: Ee(t)
446
+ gameResult: Le(e)
439
447
  }), Qe = (t) => ({
440
448
  ...t,
441
- resultType: Le(t)
449
+ opponent: Pe(t)
442
450
  }), Ve = (t) => ({
451
+ ...t,
452
+ resultType: xe(t)
453
+ }), Ze = (t) => ({
443
454
  ...t,
444
455
  rowClasses: t.optional ? "is-optional" : ""
445
- }), Ze = (t = []) => (e) => {
456
+ }), ze = (t = []) => (e) => {
446
457
  var r;
447
458
  return {
448
459
  ...e,
449
460
  [t]: (r = e[t]) == null ? void 0 : r.toUpperCase()
450
461
  };
451
- }, ze = (t = []) => (e) => (t.map((r) => e[r] ? e[`${r}Sec`] = C(e[r]) : e), e), we = (t = []) => (e) => (t.map((r) => e[r] ? e[`${r}Min`] = Q(e[r]) : e), e), et = (t = []) => (e) => (t.map((r) => e[`${r}Min`] = V(e[r])), e), tt = (t) => {
462
+ }, we = (t = []) => (e) => (t.map((r) => e[r] ? e[`${r}Sec`] = $(e[r]) : e), e), et = (t = []) => (e) => (t.map((r) => e[r] ? e[`${r}Min`] = Q(e[r]) : e), e), tt = (t = []) => (e) => (t.map((r) => e[`${r}Min`] = V(e[r])), e), rt = (t) => {
452
463
  var e, r;
453
464
  return {
454
465
  ...t,
455
466
  periodResults: ((r = (e = t.result) == null ? void 0 : e.match(/\(.*?\)/)) == null ? void 0 : r[0]) ?? ""
456
467
  };
457
- }, $e = (t, e) => new Date(t.gameDate).getTime() - new Date(e.gameDate).getTime(), rt = W([$e, y(h("id")), y(h("gameId"))]), xe = (t) => (e, r) => e[t].localeCompare(r[t], "hu"), nt = Ce(xe("name"));
458
- function Ee(t) {
468
+ }, Ce = (t, e) => new Date(t.gameDate).getTime() - new Date(e.gameDate).getTime(), nt = W([Ce, y(m("id")), y(m("gameId"))]), Ee = (t) => (e, r) => e[t].localeCompare(r[t], "hu"), at = $e(Ee("name"));
469
+ function Pe(t) {
459
470
  var e;
460
471
  return [t.isHomeGame ? null : "@", (e = t.opponent) == null ? void 0 : e.shortName].join(" ");
461
472
  }
462
- function Be(t, e) {
473
+ function Le(t, e) {
463
474
  let r = t == null ? void 0 : t.homeTeamScore, n = t == null ? void 0 : t.awayTeamScore;
464
475
  return t.isHomeGame || (r = t == null ? void 0 : t.awayTeamScore, n = t == null ? void 0 : t.homeTeamScore), [r, n].join(":");
465
476
  }
466
- function Le(t) {
477
+ function xe(t) {
467
478
  const e = t.gameResult.split(":"), r = e[0] > e[1], n = e[0] < e[1];
468
479
  return r && t.isOvertime ? "OTW" : r && t.isShootout ? "SOW" : r ? "W" : n && t.isOvertime ? "OTL" : n && t.isShootout ? "SOL" : n ? "L" : "D";
469
480
  }
470
- const at = (t) => t.map((e) => {
481
+ const st = (t) => t.map((e) => {
471
482
  var r, n;
472
483
  return {
473
484
  phaseId: e.phaseId,
@@ -481,25 +492,26 @@ const at = (t) => t.map((e) => {
481
492
  };
482
493
  });
483
494
  export {
484
- Ge as I,
485
- Ue as U,
486
- Fe as W,
487
- Ye as a,
488
- Je as b,
489
- ke as c,
490
- Qe as d,
491
- ze as e,
492
- we as f,
495
+ ke as I,
496
+ Ge as U,
497
+ je as W,
498
+ Je as a,
499
+ Qe as b,
500
+ He as c,
501
+ Ve as d,
502
+ we as e,
503
+ et as f,
493
504
  Ke as g,
494
- et as h,
495
- tt as i,
496
- rt as j,
497
- at as k,
498
- nt as l,
499
- je as m,
500
- Xe as p,
501
- He as r,
502
- Ve as s,
503
- qe as t,
504
- Ze as u
505
+ tt as h,
506
+ rt as i,
507
+ nt as j,
508
+ st as k,
509
+ at as l,
510
+ Fe as m,
511
+ Ue as n,
512
+ qe as p,
513
+ Xe as r,
514
+ Ze as s,
515
+ Ye as t,
516
+ ze as u
505
517
  };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * name: @mjsz-vbr-elements/core
3
- * version: v2.7.2 - 25/10/2024, 08:07:02
4
- * (c) 2024
3
+ * version: v2.9.0 - 09/01/2025, 14:35:52
4
+ * (c) 2025
5
5
  * description: Data visualization for MJSZ VBR
6
6
  * author: Ákos Stegner <akos.stegner@gmail.com>
7
7
  */