@golstats/gsc-game-data 1.0.325-alpha.0 → 1.0.325-alpha.2

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.
Files changed (40) hide show
  1. package/README.md +74 -19
  2. package/dist/chunks/GSCDatosGSMain-11cd7d4d.js +130 -0
  3. package/dist/chunks/ModalEventsLive-8ba1588b.js +325 -0
  4. package/dist/chunks/section-comparative-main-6aa6f890.js +9887 -0
  5. package/dist/chunks/section-lineups-main-3667a84b.js +124 -0
  6. package/dist/chunks/section-positioning-main-a2dee4c3.js +53 -0
  7. package/dist/chunks/section-prominent-chalkboard-9f953d75.js +2771 -0
  8. package/dist/chunks/section-prominent-events-b575c56d.js +547 -0
  9. package/dist/chunks/section-prominent-main-cdb32eee.js +2752 -0
  10. package/dist/chunks/section-prominent-volumetric-7b2ffa59.js +785 -0
  11. package/dist/chunks/section-statistics-comparative-d01d4094.js +973 -0
  12. package/dist/chunks/section-statistics-distribution-8cc2a694.js +510 -0
  13. package/dist/chunks/section-statistics-main-285ee5a1.js +965 -0
  14. package/dist/chunks/section-statistics-trend-78efa2c0.js +844 -0
  15. package/dist/chunks/section-statistics-xg-8c02a83a.js +1554 -0
  16. package/dist/chunks/section-tactics-main-3c546d60.js +99 -0
  17. package/dist/chunks/section-video-main-4ee54fef.js +194 -0
  18. package/dist/chunks/shared-components-b34ee5c5.js +1501 -0
  19. package/dist/chunks/vendor-core-a1fbe4ec.js +79 -0
  20. package/dist/gsc-game-data.js +82 -23506
  21. package/dist/style.css +1 -1
  22. package/dist/style10.css +1 -0
  23. package/dist/style11.css +1 -0
  24. package/dist/style12.css +1 -0
  25. package/dist/style13.css +1 -0
  26. package/dist/style14.css +1 -0
  27. package/dist/style15.css +1 -0
  28. package/dist/style16.css +1 -0
  29. package/dist/style17.css +1 -0
  30. package/dist/style18.css +1 -0
  31. package/dist/style2.css +1 -0
  32. package/dist/style3.css +1 -0
  33. package/dist/style4.css +1 -0
  34. package/dist/style5.css +1 -0
  35. package/dist/style6.css +1 -0
  36. package/dist/style7.css +1 -0
  37. package/dist/style8.css +1 -0
  38. package/dist/style9.css +1 -0
  39. package/package.json +13 -11
  40. package/dist/gsc-game-data.umd.cjs +0 -1
@@ -0,0 +1,2771 @@
1
+ import { useCssVars, ref, computed, watch, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, createCommentVNode, toDisplayString, pushScopeId, popScopeId, withDirectives, vShow, createBlock, createVNode, unref, mergeProps, createTextVNode } from "vue";
2
+ import { e as emitter } from "./vendor-core-a1fbe4ec.js";
3
+ import { _ as _export_sfc } from "./section-comparative-main-6aa6f890.js";
4
+ import { GSCFilters, filtersTypes } from "@golstats/gsc-filters";
5
+ import { GSCCheckbox } from "@golstats/gsc-checkbox";
6
+ import { GSCRadioButton } from "@golstats/gsc-radio-button";
7
+ import { p as playerPositions } from "./section-prominent-volumetric-7b2ffa59.js";
8
+ import axios from "axios";
9
+ const navigatorUserAgent = navigator.userAgent || navigator.vendor || window.opera;
10
+ function areTwoArraysEquals(arr1, arr2) {
11
+ let flag = Array.isArray(arr1) && Array.isArray(arr2) ? arr1.length === arr2.length : false;
12
+ if (flag) {
13
+ for (let item of arr1) {
14
+ if (!arr2.includes(item)) {
15
+ flag = false;
16
+ break;
17
+ }
18
+ }
19
+ }
20
+ return flag;
21
+ }
22
+ function getPlayValueIndexesFromArray(playsValues) {
23
+ return playsValues.reduce((accumulator, valueName, index) => {
24
+ accumulator[valueName] = index;
25
+ return accumulator;
26
+ }, {});
27
+ }
28
+ function getTeamFilterOptions(currentFilterOptions, newFilterOptions, teamId) {
29
+ const filterAux = {
30
+ statistics: newFilterOptions.statistics.value || 0,
31
+ playingAs: [...newFilterOptions.playingAs],
32
+ matchResult: [...newFilterOptions.matchResult],
33
+ sections: newFilterOptions.firstHalf.concat(newFilterOptions.secondHalf),
34
+ requiresPlaysFiltering: newFilterOptions.requiresPlaysFiltering || true
35
+ };
36
+ filterAux.teamId = teamId;
37
+ return filterAux;
38
+ }
39
+ function toFixedTwoDigitsMax(number) {
40
+ return typeof number === "number" ? number.toFixed(2).replace(/\.0+$|0$/g, "") : number;
41
+ }
42
+ function getIsMobileOrTablet() {
43
+ return (
44
+ // eslint-disable-next-line max-len
45
+ /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(
46
+ navigatorUserAgent
47
+ ) || // eslint-disable-next-line max-len,no-useless-escape
48
+ /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
49
+ navigatorUserAgent.substr(0, 4)
50
+ )
51
+ );
52
+ }
53
+ function getTeamLogoUrl(teamId) {
54
+ const baseUrl = {}.TEAM_LOGOS_URL || "https://golstatsimages.blob.core.windows.net/teams-80/";
55
+ return `${baseUrl}${teamId}.png`;
56
+ }
57
+ const _imports_0 = "/play-icn.svg";
58
+ const ToggleButtons_vue_vue_type_style_index_0_scoped_8c3c29c6_lang = "";
59
+ const _hoisted_1$a = { class: "toggle-buttons__background" };
60
+ const _hoisted_2$a = ["onClick"];
61
+ const _hoisted_3$a = {
62
+ key: 0,
63
+ class: "toggle-buttons__button__img"
64
+ };
65
+ const _hoisted_4$a = ["src"];
66
+ const _sfc_main$b = {
67
+ __name: "ToggleButtons",
68
+ props: {
69
+ buttons: {
70
+ type: Array,
71
+ required: true
72
+ },
73
+ selectedButtonIndex: {
74
+ type: Number,
75
+ default: 0
76
+ },
77
+ height: {
78
+ type: String,
79
+ default: "29px"
80
+ },
81
+ width: {
82
+ type: String,
83
+ default: "100%"
84
+ },
85
+ fontSize: {
86
+ type: String,
87
+ default: "12px"
88
+ },
89
+ fontFamily: {
90
+ type: String,
91
+ default: "Poppins-Medium"
92
+ },
93
+ borderRadius: {
94
+ type: String,
95
+ default: "8px"
96
+ },
97
+ mainBackgroundColor: {
98
+ type: String,
99
+ default: "#364448"
100
+ },
101
+ mainBorderColor: {
102
+ type: String,
103
+ default: "#9AA1A3"
104
+ },
105
+ mainBorderWidth: {
106
+ type: String,
107
+ default: "0.5px"
108
+ },
109
+ activeBorderColor: {
110
+ type: String,
111
+ default: "#cbee6b"
112
+ },
113
+ activeBorderWidth: {
114
+ type: String,
115
+ default: "1px"
116
+ },
117
+ activeBackgroundColor: {
118
+ type: String,
119
+ default: "#2e3b46"
120
+ },
121
+ activeFontColor: {
122
+ type: String,
123
+ default: "#FFFFFF"
124
+ }
125
+ },
126
+ emits: ["change"],
127
+ setup(__props, { emit }) {
128
+ const props = __props;
129
+ useCssVars((_ctx) => ({
130
+ "64265112": __props.height,
131
+ "df19770a": __props.width,
132
+ "6caf15d1": __props.mainBackgroundColor,
133
+ "2d25df89": __props.borderRadius,
134
+ "21a281f6": __props.mainBorderWidth,
135
+ "208b8393": __props.mainBorderColor,
136
+ "94332204": __props.fontFamily,
137
+ "3e48121b": __props.fontSize,
138
+ "37a2dd49": __props.activeBorderWidth,
139
+ "368bdee6": __props.activeBorderColor,
140
+ "ecc8e0b8": __props.activeBackgroundColor,
141
+ "5528ac63": __props.activeFontColor
142
+ }));
143
+ const selectedButtonIndexLocal = ref(props.selectedButtonIndex);
144
+ const toggleButtonsStyle = computed(() => {
145
+ return {
146
+ "--grid-template-columns": `repeat(${props.buttons.length}, 1fr)`
147
+ };
148
+ });
149
+ watch(
150
+ () => props.selectedButtonIndex,
151
+ (newValue) => {
152
+ selectedButtonIndexLocal.value = newValue;
153
+ }
154
+ );
155
+ watch(selectedButtonIndexLocal, (newValue, oldValue) => {
156
+ if (newValue !== oldValue) {
157
+ emit("change", { index: newValue, button: props.buttons[newValue] });
158
+ }
159
+ });
160
+ function onClick(index) {
161
+ selectedButtonIndexLocal.value = index;
162
+ }
163
+ return (_ctx, _cache) => {
164
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
165
+ createElementVNode("div", {
166
+ class: "toggle-buttons",
167
+ style: normalizeStyle(toggleButtonsStyle.value)
168
+ }, [
169
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.buttons, (button, index) => {
170
+ return openBlock(), createElementBlock("div", {
171
+ key: `b${index}`,
172
+ class: normalizeClass(["toggle-buttons__button", { active: selectedButtonIndexLocal.value === index, right: button.img && index > 0 }]),
173
+ onClick: ($event) => onClick(index)
174
+ }, [
175
+ button.img ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
176
+ createElementVNode("img", {
177
+ src: button.img,
178
+ alt: ""
179
+ }, null, 8, _hoisted_4$a)
180
+ ])) : createCommentVNode("", true),
181
+ createElementVNode("div", null, toDisplayString(button.text || button), 1)
182
+ ], 10, _hoisted_2$a);
183
+ }), 128))
184
+ ], 4)
185
+ ]);
186
+ };
187
+ }
188
+ };
189
+ const ToggleButtons = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-8c3c29c6"]]);
190
+ const TooltipChalkboard_vue_vue_type_style_index_0_scoped_b3a94cf2_lang = "";
191
+ const _withScopeId$4 = (n) => (pushScopeId("data-v-b3a94cf2"), n = n(), popScopeId(), n);
192
+ const _hoisted_1$9 = { class: "tooltip__content" };
193
+ const _hoisted_2$9 = {
194
+ key: 0,
195
+ class: "tooltip__content__category"
196
+ };
197
+ const _hoisted_3$9 = { class: "tooltip__content__player" };
198
+ const _hoisted_4$9 = { class: "tooltip__content__player__name" };
199
+ const _hoisted_5$8 = { class: "tooltip__content__player__photo" };
200
+ const _hoisted_6$8 = ["src"];
201
+ const _hoisted_7$7 = { class: "tooltip__content__minute" };
202
+ const _hoisted_8$4 = {
203
+ key: 1,
204
+ class: "tooltip__content__game"
205
+ };
206
+ const _hoisted_9$3 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ createElementVNode("div", { class: "tooltip__content__game__name" }, "Partido:", -1));
207
+ const _hoisted_10$2 = { class: "tooltip__content__game__round-abbreviation" };
208
+ const _hoisted_11$2 = { class: "tooltip__content__game__logo" };
209
+ const _hoisted_12$1 = ["src"];
210
+ const _hoisted_13$1 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ createElementVNode("div", { class: "tooltip__content__game__vs" }, "VS", -1));
211
+ const _hoisted_14$1 = { class: "tooltip__content__game__logo" };
212
+ const _hoisted_15$1 = ["src"];
213
+ const _hoisted_16$1 = {
214
+ key: 2,
215
+ class: "tooltip__content__team"
216
+ };
217
+ const _hoisted_17$1 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ createElementVNode("div", { class: "tooltip__content__team__name" }, "Equipo:", -1));
218
+ const _hoisted_18$1 = { class: "tooltip__content__team__logo" };
219
+ const _hoisted_19$1 = ["src"];
220
+ const _sfc_main$a = {
221
+ __name: "TooltipChalkboard",
222
+ props: {
223
+ event: {
224
+ type: Object,
225
+ default: () => ({})
226
+ },
227
+ position: {
228
+ type: Object,
229
+ default: () => ({ x: "0", y: "0" })
230
+ }
231
+ },
232
+ emits: ["close"],
233
+ setup(__props, { emit }) {
234
+ const props = __props;
235
+ const style = computed(() => {
236
+ return {
237
+ "--top": props.position.y,
238
+ "--left": props.position.x
239
+ };
240
+ });
241
+ const playerName = computed(() => {
242
+ return `${props.event.player.player_name} ${props.event.player.player_lastname}`;
243
+ });
244
+ const minute = computed(() => {
245
+ const [minute2] = props.event.momentOfPlay.split(":");
246
+ return `${Number(minute2)}'`;
247
+ });
248
+ function onClickOverlay() {
249
+ emit("close");
250
+ }
251
+ return (_ctx, _cache) => {
252
+ return openBlock(), createElementBlock("div", {
253
+ class: "tooltip",
254
+ onClick: onClickOverlay,
255
+ style: normalizeStyle(style.value)
256
+ }, [
257
+ createElementVNode("div", _hoisted_1$9, [
258
+ __props.event.categoryName ? (openBlock(), createElementBlock("div", _hoisted_2$9, toDisplayString(__props.event.categoryName), 1)) : createCommentVNode("", true),
259
+ createElementVNode("div", _hoisted_3$9, [
260
+ createElementVNode("div", _hoisted_4$9, toDisplayString(playerName.value), 1),
261
+ createElementVNode("div", _hoisted_5$8, [
262
+ createElementVNode("img", {
263
+ src: __props.event.player.photo,
264
+ alt: ""
265
+ }, null, 8, _hoisted_6$8)
266
+ ])
267
+ ]),
268
+ createElementVNode("div", _hoisted_7$7, "Minuto: " + toDisplayString(minute.value), 1),
269
+ __props.event.game ? (openBlock(), createElementBlock("div", _hoisted_8$4, [
270
+ _hoisted_9$3,
271
+ createElementVNode("div", _hoisted_10$2, toDisplayString(__props.event.game.roundAbbreviation), 1),
272
+ createElementVNode("div", _hoisted_11$2, [
273
+ createElementVNode("img", {
274
+ src: __props.event.game.homeTeam.logo,
275
+ alt: ""
276
+ }, null, 8, _hoisted_12$1)
277
+ ]),
278
+ _hoisted_13$1,
279
+ createElementVNode("div", _hoisted_14$1, [
280
+ createElementVNode("img", {
281
+ src: __props.event.game.awayTeam.logo,
282
+ alt: ""
283
+ }, null, 8, _hoisted_15$1)
284
+ ])
285
+ ])) : (openBlock(), createElementBlock("div", _hoisted_16$1, [
286
+ _hoisted_17$1,
287
+ createElementVNode("div", _hoisted_18$1, [
288
+ createElementVNode("img", {
289
+ src: __props.event.team.logo,
290
+ alt: ""
291
+ }, null, 8, _hoisted_19$1)
292
+ ])
293
+ ]))
294
+ ])
295
+ ], 4);
296
+ };
297
+ }
298
+ };
299
+ const Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-b3a94cf2"]]);
300
+ const _hoisted_1$8 = ["id"];
301
+ const _hoisted_2$8 = ["fill"];
302
+ const _hoisted_3$8 = ["id"];
303
+ const _hoisted_4$8 = ["fill"];
304
+ const _hoisted_5$7 = ["stroke-dasharray", "x1", "y1", "x2", "y2", "marker-end"];
305
+ const _hoisted_6$7 = ["x", "y", "stroke-width", "fill", "stroke"];
306
+ const _hoisted_7$6 = ["x", "y"];
307
+ const _sfc_main$9 = {
308
+ __name: "EventConnection",
309
+ props: {
310
+ eventConnection: {
311
+ type: Object,
312
+ required: true
313
+ },
314
+ color: {
315
+ type: String,
316
+ required: true
317
+ },
318
+ isLastEvent: {
319
+ type: Boolean,
320
+ default: false
321
+ },
322
+ mainEventIdSelected: {
323
+ type: Number,
324
+ default: 0
325
+ }
326
+ },
327
+ setup(__props) {
328
+ const props = __props;
329
+ const connectionPath = computed(() => {
330
+ const connectionPath2 = [];
331
+ if (props.eventConnection.hasConnectionPath) {
332
+ const totalPaths = props.eventConnection.x1 === props.eventConnection.x2 && props.eventConnection.y1 === props.eventConnection.y2 ? 1 : 2;
333
+ let firstPointY = getFieldY(
334
+ props.eventConnection.previousEvent ? props.eventConnection.previousEvent.y3 : props.eventConnection.y1
335
+ );
336
+ const firstPointX = getFieldX(
337
+ props.eventConnection.previousEvent ? props.eventConnection.previousEvent.x3 : props.eventConnection.x1
338
+ );
339
+ let secondPointY = 0;
340
+ let secondPointX = 0;
341
+ if (totalPaths === 2) {
342
+ secondPointY = getFieldY(props.eventConnection.y2);
343
+ secondPointX = getFieldX(props.eventConnection.x2);
344
+ }
345
+ const thirdPointY = getFieldY(props.eventConnection.y3);
346
+ const thirdPointX = getFieldX(props.eventConnection.x3);
347
+ if (totalPaths === 1) {
348
+ connectionPath2.push({
349
+ x1: firstPointX,
350
+ y1: firstPointY,
351
+ x2: thirdPointX,
352
+ y2: thirdPointY
353
+ });
354
+ } else {
355
+ connectionPath2.push({
356
+ x1: firstPointX,
357
+ y1: firstPointY,
358
+ x2: secondPointX,
359
+ y2: secondPointY
360
+ });
361
+ connectionPath2.push({
362
+ x1: secondPointX,
363
+ y1: secondPointY,
364
+ x2: thirdPointX,
365
+ y2: thirdPointY
366
+ });
367
+ }
368
+ }
369
+ return connectionPath2;
370
+ });
371
+ const opacity = computed(() => {
372
+ return props.mainEventIdSelected !== 0 ? props.eventConnection.relatedPlayId === props.mainEventIdSelected ? 1 : 0.1 : 1;
373
+ });
374
+ const isVisible = computed(() => {
375
+ return props.mainEventIdSelected !== 0 ? props.eventConnection.relatedPlayId === props.mainEventIdSelected : true;
376
+ });
377
+ const y = computed(() => {
378
+ return getFieldY(
379
+ props.eventConnection.previousEvent ? props.eventConnection.previousEvent.y3 : props.eventConnection.y1
380
+ );
381
+ });
382
+ const x = computed(() => {
383
+ return getFieldX(
384
+ props.eventConnection.previousEvent ? props.eventConnection.previousEvent.x3 : props.eventConnection.x1
385
+ );
386
+ });
387
+ function getFieldY(y2) {
388
+ return (1 - y2) * 100;
389
+ }
390
+ function getFieldX(x2) {
391
+ return x2 * 100;
392
+ }
393
+ function onMouseOver(event) {
394
+ emitter.emit("mouse-over-event", {
395
+ mouseEvent: event,
396
+ eventConnection: props.eventConnection,
397
+ position: {
398
+ x: x.value,
399
+ y: y.value
400
+ }
401
+ });
402
+ }
403
+ function onMouseLeave() {
404
+ emitter.emit("mouse-leave-event", {
405
+ mainEventId: props.eventConnection.relatedPlayId,
406
+ eventId: props.eventConnection.playId
407
+ });
408
+ }
409
+ return (_ctx, _cache) => {
410
+ return openBlock(), createElementBlock(Fragment, null, [
411
+ createElementVNode("defs", null, [
412
+ withDirectives(createElementVNode("marker", {
413
+ id: `a-${__props.eventConnection.playId}`,
414
+ markerWidth: "10",
415
+ markerHeight: "10",
416
+ refX: "0",
417
+ refY: "3",
418
+ orient: "auto",
419
+ markerUnits: "strokeWidth",
420
+ style: normalizeStyle({ opacity: opacity.value })
421
+ }, [
422
+ createElementVNode("path", {
423
+ d: "M0,0 L0,6 L9,3 z",
424
+ fill: __props.color
425
+ }, null, 8, _hoisted_2$8)
426
+ ], 12, _hoisted_1$8), [
427
+ [vShow, isVisible.value]
428
+ ]),
429
+ withDirectives(createElementVNode("marker", {
430
+ id: `b-${__props.eventConnection.playId}`,
431
+ markerWidth: "4",
432
+ markerHeight: "4",
433
+ refX: "2",
434
+ refY: "2",
435
+ orient: "auto",
436
+ markerUnits: "strokeWidth",
437
+ style: normalizeStyle({ opacity: opacity.value })
438
+ }, [
439
+ createElementVNode("circle", {
440
+ cx: "2",
441
+ cy: "2",
442
+ r: "2",
443
+ fill: __props.color
444
+ }, null, 8, _hoisted_4$8)
445
+ ], 12, _hoisted_3$8), [
446
+ [vShow, isVisible.value]
447
+ ])
448
+ ]),
449
+ (openBlock(true), createElementBlock(Fragment, null, renderList(connectionPath.value, (path, i) => {
450
+ return openBlock(), createElementBlock(Fragment, null, [
451
+ path.x1 && path.y1 ? withDirectives((openBlock(), createElementBlock("line", {
452
+ key: `${__props.eventConnection.playId}-${i}`,
453
+ style: normalizeStyle({ stroke: __props.color, "stroke-width": 2, opacity: opacity.value }),
454
+ "stroke-dasharray": i === 0 && connectionPath.value.length === 2 ? "none" : "5,5",
455
+ x1: `${path.x1}%`,
456
+ y1: `${path.y1}%`,
457
+ x2: `${path.x2}%`,
458
+ y2: `${path.y2}%`,
459
+ "marker-start": "`url(`#b-${eventConnection.playId}`)`",
460
+ "marker-end": `url(${__props.isLastEvent && i === connectionPath.value.length - 1 ? `#a-${__props.eventConnection.playId}` : ""})`
461
+ }, null, 12, _hoisted_5$7)), [
462
+ [vShow, isVisible.value]
463
+ ]) : createCommentVNode("", true)
464
+ ], 64);
465
+ }), 256)),
466
+ withDirectives(createElementVNode("g", {
467
+ onMouseover: onMouseOver,
468
+ onMouseleave: onMouseLeave,
469
+ style: normalizeStyle({ cursor: "pointer", opacity: opacity.value })
470
+ }, [
471
+ createElementVNode("rect", {
472
+ x: `${x.value}%`,
473
+ y: `${y.value}%`,
474
+ transform: "translate(-14, -14)",
475
+ height: "28",
476
+ width: "28",
477
+ "stroke-width": __props.eventConnection.isMainPlay ? 2 : 1,
478
+ fill: __props.color,
479
+ stroke: __props.eventConnection.isMainPlay ? "#fff" : "#999",
480
+ style: normalizeStyle({ opacity: opacity.value }),
481
+ rx: "14",
482
+ ry: "14"
483
+ }, null, 12, _hoisted_6$7),
484
+ createElementVNode("text", {
485
+ x: `${x.value}%`,
486
+ y: `${y.value}%`,
487
+ "text-anchor": "middle",
488
+ "dominant-baseline": "middle",
489
+ dy: "1",
490
+ "font-size": "15",
491
+ fill: "#fff",
492
+ "font-family": "'Poppins-SemiBold', sans-serif",
493
+ style: normalizeStyle({ opacity: opacity.value })
494
+ }, toDisplayString(__props.eventConnection.player ? __props.eventConnection.player.jersey : ""), 13, _hoisted_7$6)
495
+ ], 36), [
496
+ [vShow, isVisible.value]
497
+ ])
498
+ ], 64);
499
+ };
500
+ }
501
+ };
502
+ const _sfc_main$8 = {
503
+ __name: "EventConnections",
504
+ props: {
505
+ eventConnections: {
506
+ type: Object,
507
+ required: true
508
+ },
509
+ mainEventIdSelected: {
510
+ type: Number,
511
+ default: 0
512
+ }
513
+ },
514
+ setup(__props) {
515
+ const props = __props;
516
+ const eventConnectionsToShow = computed(() => {
517
+ return props.eventConnections.getEventsConnectionsByEventType();
518
+ });
519
+ return (_ctx, _cache) => {
520
+ return openBlock(true), createElementBlock(Fragment, null, renderList(eventConnectionsToShow.value, (eventConnection, index) => {
521
+ return openBlock(), createBlock(_sfc_main$9, {
522
+ key: eventConnection.id,
523
+ color: __props.eventConnections.getEventColor(eventConnection),
524
+ "is-last-event": index === eventConnectionsToShow.value.length - 1,
525
+ "event-connection": eventConnection,
526
+ "main-event-id-selected": __props.mainEventIdSelected
527
+ }, null, 8, ["color", "is-last-event", "event-connection", "main-event-id-selected"]);
528
+ }), 128);
529
+ };
530
+ }
531
+ };
532
+ const SoccerChalkboard_vue_vue_type_style_index_0_scoped_17190e13_lang = "";
533
+ const _hoisted_1$7 = { class: "soccer-chalkboard" };
534
+ const _hoisted_2$7 = {
535
+ id: "soccerChalkboardField",
536
+ class: "soccer-chalkboard__field"
537
+ };
538
+ const _hoisted_3$7 = ["src"];
539
+ const _hoisted_4$7 = {
540
+ viewBox: "0 0 547 340",
541
+ fill: "none",
542
+ xmlns: "http://www.w3.org/2000/svg"
543
+ };
544
+ const _sfc_main$7 = {
545
+ __name: "SoccerChalkboard",
546
+ props: {
547
+ eventsConnections: {
548
+ type: Array,
549
+ default: () => []
550
+ },
551
+ listType: {
552
+ type: String,
553
+ default: "events"
554
+ },
555
+ playersSelected: {
556
+ type: Set,
557
+ default: () => /* @__PURE__ */ new Set()
558
+ },
559
+ teamsSelected: {
560
+ type: Set,
561
+ default: () => /* @__PURE__ */ new Set()
562
+ },
563
+ isAssistantZoneVisible: {
564
+ type: Boolean,
565
+ default: false
566
+ }
567
+ },
568
+ setup(__props) {
569
+ const props = __props;
570
+ const isMobileOrTablet = getIsMobileOrTablet();
571
+ const mouseLeaveTimeout = isMobileOrTablet ? 0 : 1e3;
572
+ emitter.on("mouse-over-time-event", (mainEventId) => {
573
+ setMainEventIdSelected(mainEventId);
574
+ setTimeout(() => {
575
+ setMainEventIdSelected(mainEventId);
576
+ }, mouseLeaveTimeout);
577
+ });
578
+ emitter.on("mouse-leave-time-event", (mainEventId) => {
579
+ setTimeout(() => {
580
+ if (mainEventIdSelected.value == mainEventId && !isTooltipVisible.value)
581
+ setMainEventIdSelected(0);
582
+ }, mouseLeaveTimeout);
583
+ });
584
+ emitter.on("mouse-over-event", (event) => {
585
+ onMouseOverEvent(event);
586
+ });
587
+ emitter.on("mouse-leave-event", (event) => {
588
+ setTimeout(() => {
589
+ if (event.eventId === eventIdShowingTooltip.value) {
590
+ onMouseLeaveEvent();
591
+ }
592
+ }, mouseLeaveTimeout);
593
+ });
594
+ const isTooltipVisible = ref(false);
595
+ const eventSelected = ref({});
596
+ const mainEventIdSelected = ref(0);
597
+ const eventIdShowingTooltip = ref(0);
598
+ const tooltipPosition = ref({ x: 0, y: 0 });
599
+ const fieldImgSrc = computed(() => {
600
+ return props.isAssistantZoneVisible ? "https://golstatsimages.blob.core.windows.net/todoelfut/pizarra.jpg" : "https://golstatsimages.blob.core.windows.net/todoelfut/field-green-posesion.jpg";
601
+ });
602
+ function setMainEventIdSelected(mainEventId) {
603
+ mainEventIdSelected.value = mainEventId;
604
+ }
605
+ function onCloseTooltip() {
606
+ isTooltipVisible.value = false;
607
+ }
608
+ function onMouseOverEvent(event) {
609
+ const tooltipMaxWidth = 170;
610
+ const soccerChalkboardField = document.getElementById("soccerChalkboardField");
611
+ if (soccerChalkboardField) {
612
+ const fieldRect = soccerChalkboardField.getBoundingClientRect();
613
+ const xInsideField = event.position.x / 100 * fieldRect.width + 14;
614
+ const yInsideField = event.position.y / 100 * fieldRect.height + 14;
615
+ const xAux = xInsideField + tooltipMaxWidth > fieldRect.width ? fieldRect.width - tooltipMaxWidth : xInsideField;
616
+ const yAux = yInsideField;
617
+ mainEventIdSelected.value = event.eventConnection.relatedPlayId;
618
+ eventIdShowingTooltip.value = event.eventConnection.playId;
619
+ eventSelected.value = event.eventConnection;
620
+ tooltipPosition.value = {
621
+ x: `${xAux}px`,
622
+ y: `${yAux}px`
623
+ };
624
+ isTooltipVisible.value = true;
625
+ }
626
+ }
627
+ function onMouseLeaveEvent() {
628
+ isTooltipVisible.value = false;
629
+ mainEventIdSelected.value = 0;
630
+ }
631
+ return (_ctx, _cache) => {
632
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [
633
+ createElementVNode("div", _hoisted_2$7, [
634
+ createElementVNode("img", {
635
+ src: fieldImgSrc.value,
636
+ alt: ""
637
+ }, null, 8, _hoisted_3$7),
638
+ (openBlock(), createElementBlock("svg", _hoisted_4$7, [
639
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.eventsConnections, (eventConnections, index) => {
640
+ return openBlock(), createElementBlock(Fragment, null, [
641
+ __props.listType === "events" && eventConnections.hasTeam(__props.teamsSelected) || __props.listType === "players" && eventConnections.hasPlayer(__props.playersSelected) ? (openBlock(), createBlock(_sfc_main$8, {
642
+ key: index,
643
+ "event-connections": eventConnections,
644
+ "main-event-id-selected": mainEventIdSelected.value
645
+ }, null, 8, ["event-connections", "main-event-id-selected"])) : createCommentVNode("", true)
646
+ ], 64);
647
+ }), 256))
648
+ ]))
649
+ ]),
650
+ isTooltipVisible.value ? (openBlock(), createBlock(Tooltip, {
651
+ key: 0,
652
+ position: tooltipPosition.value,
653
+ event: eventSelected.value,
654
+ onClose: onCloseTooltip
655
+ }, null, 8, ["position", "event"])) : createCommentVNode("", true)
656
+ ]);
657
+ };
658
+ }
659
+ };
660
+ const SoccerChalkboard = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-17190e13"]]);
661
+ const EventsTimeLine_vue_vue_type_style_index_0_scoped_f70399b8_lang = "";
662
+ const _withScopeId$3 = (n) => (pushScopeId("data-v-f70399b8"), n = n(), popScopeId(), n);
663
+ const _hoisted_1$6 = { class: "events-timeline" };
664
+ const _hoisted_2$6 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("div", { class: "events-timeline__back-line" }, null, -1));
665
+ const _hoisted_3$6 = ["onMouseover", "onMouseleave"];
666
+ const _hoisted_4$6 = ["id"];
667
+ const _hoisted_5$6 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("path", {
668
+ "fill-rule": "evenodd",
669
+ "clip-rule": "evenodd",
670
+ d: "M3.77234 0.45166C2.11548 0.45166 0.772339 1.79481 0.772339 3.45166V14.4517C0.772339 16.1085 2.11548 17.4517 3.77234 17.4517H7.96294L10.2723 21.4517L12.5817 17.4517H16.7723C18.4292 17.4517 19.7723 16.1085 19.7723 14.4517V3.45166C19.7723 1.79481 18.4292 0.45166 16.7723 0.45166H3.77234Z"
671
+ }, null, -1));
672
+ const _hoisted_6$6 = [
673
+ _hoisted_5$6
674
+ ];
675
+ const _hoisted_7$5 = ["fill"];
676
+ const _hoisted_8$3 = ["mask"];
677
+ const _hoisted_9$2 = ["stroke"];
678
+ const _sfc_main$6 = {
679
+ __name: "EventsTimeLine",
680
+ props: {
681
+ eventsConnections: {
682
+ type: Array,
683
+ default: () => []
684
+ },
685
+ listType: {
686
+ type: String,
687
+ default: "events"
688
+ },
689
+ playersSelected: {
690
+ type: Set,
691
+ default: () => /* @__PURE__ */ new Set()
692
+ },
693
+ teamsSelected: {
694
+ type: Set,
695
+ default: () => /* @__PURE__ */ new Set()
696
+ }
697
+ },
698
+ setup(__props) {
699
+ const props = __props;
700
+ const gameTimes = ["0'", "45'", "90'"];
701
+ const eventsByTime = computed(() => {
702
+ return props.eventsConnections.reduce((acc, eventsConnection) => {
703
+ const eventTime = {
704
+ minute: `0'`,
705
+ left: "0%",
706
+ color: eventsConnection.getTeamColor(),
707
+ fontColor: eventsConnection.getTeamFontColor(),
708
+ playId: eventsConnection.mainPlay.playId,
709
+ playerId: eventsConnection.mainPlay.playerId,
710
+ teamId: eventsConnection.mainPlay.teamId,
711
+ relatedPlayId: eventsConnection.relatedPlayId
712
+ };
713
+ const [minutes] = eventsConnection.mainPlay.momentOfPlay.split(":");
714
+ const minutesNumber = parseInt(minutes);
715
+ if (minutesNumber >= 90) {
716
+ eventTime.minute = `${minutesNumber}'`;
717
+ eventTime.left = "100%";
718
+ } else {
719
+ eventTime.minute = `${minutesNumber}'`;
720
+ eventTime.left = `${minutesNumber / 90 * 100}%`;
721
+ }
722
+ acc.push(eventTime);
723
+ return acc;
724
+ }, []);
725
+ });
726
+ function onMouseOver(event) {
727
+ emitter.emit("mouse-over-time-event", event.playId);
728
+ }
729
+ function onMouseLeave(event) {
730
+ emitter.emit("mouse-leave-time-event", event.playId);
731
+ }
732
+ return (_ctx, _cache) => {
733
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
734
+ (openBlock(), createElementBlock(Fragment, null, renderList(gameTimes, (gameTime, index) => {
735
+ return createElementVNode("div", {
736
+ class: "events-timeline__game-time",
737
+ key: index
738
+ }, toDisplayString(gameTime), 1);
739
+ }), 64)),
740
+ _hoisted_2$6,
741
+ (openBlock(true), createElementBlock(Fragment, null, renderList(eventsByTime.value, (eventMinute, index) => {
742
+ return openBlock(), createElementBlock(Fragment, null, [
743
+ __props.listType === "events" && __props.teamsSelected.has(eventMinute.teamId) || __props.listType === "players" && __props.playersSelected.has(eventMinute.playerId) ? (openBlock(), createElementBlock("svg", {
744
+ key: index,
745
+ width: "20",
746
+ height: "22",
747
+ viewBox: "0 0 20 22",
748
+ fill: "none",
749
+ xmlns: "http://www.w3.org/2000/svg",
750
+ style: normalizeStyle({ left: eventMinute.left, cursor: "pointer" }),
751
+ onMouseover: ($event) => onMouseOver(eventMinute),
752
+ onMouseleave: ($event) => onMouseLeave(eventMinute)
753
+ }, [
754
+ createElementVNode("mask", {
755
+ id: eventMinute.playId.toString(),
756
+ fill: "white"
757
+ }, _hoisted_6$6, 8, _hoisted_4$6),
758
+ createElementVNode("path", {
759
+ "fill-rule": "evenodd",
760
+ "clip-rule": "evenodd",
761
+ d: "M3.77234 0.45166C2.11548 0.45166 0.772339 1.79481 0.772339 3.45166V14.4517C0.772339 16.1085 2.11548 17.4517 3.77234 17.4517H7.96294L10.2723 21.4517L12.5817 17.4517H16.7723C18.4292 17.4517 19.7723 16.1085 19.7723 14.4517V3.45166C19.7723 1.79481 18.4292 0.45166 16.7723 0.45166H3.77234Z",
762
+ fill: eventMinute.color
763
+ }, null, 8, _hoisted_7$5),
764
+ createElementVNode("path", {
765
+ d: "M7.96294 17.4517L8.82896 16.9517L8.54029 16.4517H7.96294V17.4517ZM10.2723 21.4517L9.40631 21.9517L10.2723 23.4517L11.1384 21.9517L10.2723 21.4517ZM12.5817 17.4517V16.4517H12.0044L11.7157 16.9517L12.5817 17.4517ZM1.77234 3.45166C1.77234 2.34709 2.66777 1.45166 3.77234 1.45166V-0.54834C1.5632 -0.54834 -0.227661 1.24252 -0.227661 3.45166H1.77234ZM1.77234 14.4517V3.45166H-0.227661V14.4517H1.77234ZM3.77234 16.4517C2.66777 16.4517 1.77234 15.5562 1.77234 14.4517H-0.227661C-0.227661 16.6608 1.5632 18.4517 3.77234 18.4517V16.4517ZM7.96294 16.4517H3.77234V18.4517H7.96294V16.4517ZM7.09691 17.9517L9.40631 21.9517L11.1384 20.9517L8.82896 16.9517L7.09691 17.9517ZM11.1384 21.9517L13.4478 17.9517L11.7157 16.9517L9.40631 20.9517L11.1384 21.9517ZM16.7723 16.4517H12.5817V18.4517H16.7723V16.4517ZM18.7723 14.4517C18.7723 15.5562 17.8769 16.4517 16.7723 16.4517V18.4517C18.9815 18.4517 20.7723 16.6608 20.7723 14.4517H18.7723ZM18.7723 3.45166V14.4517H20.7723V3.45166H18.7723ZM16.7723 1.45166C17.8769 1.45166 18.7723 2.34709 18.7723 3.45166H20.7723C20.7723 1.24252 18.9815 -0.54834 16.7723 -0.54834V1.45166ZM3.77234 1.45166H16.7723V-0.54834H3.77234V1.45166Z",
766
+ fill: "#172531",
767
+ mask: `url(#${eventMinute.playId})`
768
+ }, null, 8, _hoisted_8$3),
769
+ createElementVNode("g", null, [
770
+ createElementVNode("text", {
771
+ x: "50%",
772
+ y: "8",
773
+ "text-anchor": "middle",
774
+ "dominant-baseline": "middle",
775
+ dy: "1",
776
+ "font-size": "9",
777
+ "font-family": "Poppins-Light",
778
+ stroke: eventMinute.fontColor,
779
+ "stroke-width": "0.7"
780
+ }, toDisplayString(eventMinute.minute), 9, _hoisted_9$2)
781
+ ])
782
+ ], 44, _hoisted_3$6)) : createCommentVNode("", true)
783
+ ], 64);
784
+ }), 256))
785
+ ]);
786
+ };
787
+ }
788
+ };
789
+ const EventsTimeLine = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-f70399b8"]]);
790
+ const CategoriesHeaderTeam_vue_vue_type_style_index_0_scoped_2a81f2f0_lang = "";
791
+ const _withScopeId$2 = (n) => (pushScopeId("data-v-2a81f2f0"), n = n(), popScopeId(), n);
792
+ const _hoisted_1$5 = { class: "header-team__info" };
793
+ const _hoisted_2$5 = { class: "header-team__info__checkbox" };
794
+ const _hoisted_3$5 = {
795
+ key: 0,
796
+ class: "header-team__info__logo"
797
+ };
798
+ const _hoisted_4$5 = ["src"];
799
+ const _hoisted_5$5 = { class: "header-team__info__name" };
800
+ const _hoisted_6$5 = { class: "header-team__arrow" };
801
+ const _hoisted_7$4 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "header-team__arrow__circle" }, null, -1));
802
+ const _hoisted_8$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "header-team__arrow__line" }, null, -1));
803
+ const _sfc_main$5 = {
804
+ __name: "CategoriesHeaderTeam",
805
+ props: {
806
+ team: {
807
+ type: Object,
808
+ default: () => {
809
+ }
810
+ },
811
+ isHomeTeam: {
812
+ type: Boolean,
813
+ default: true
814
+ },
815
+ teamsSelected: {
816
+ type: Set,
817
+ default: () => /* @__PURE__ */ new Set()
818
+ },
819
+ isGamePreMatch: {
820
+ type: Boolean,
821
+ default: false
822
+ },
823
+ isTeamForAnalysis: {
824
+ type: Boolean,
825
+ default: false
826
+ }
827
+ },
828
+ emits: ["change-team"],
829
+ setup(__props, { emit }) {
830
+ const props = __props;
831
+ const style = computed(() => {
832
+ return {
833
+ "--flex-direction-info": props.isHomeTeam ? "flex" : "row-reverse",
834
+ "--justify-content-info": props.isHomeTeam ? "flex-start" : "flex-end",
835
+ "--arrow-color": props.isHomeTeam ? "#336dff" : "#7ed321"
836
+ };
837
+ });
838
+ const teamName = computed(() => {
839
+ return props.team.colloquial_name || props.team.colloquialName || props.team.name || props.team.team_name || "";
840
+ });
841
+ function onChangeTeam(value) {
842
+ emit("change-team", { value, team: props.team });
843
+ }
844
+ return (_ctx, _cache) => {
845
+ return openBlock(), createElementBlock("div", {
846
+ class: "header-team",
847
+ style: normalizeStyle(style.value)
848
+ }, [
849
+ createElementVNode("div", _hoisted_1$5, [
850
+ createElementVNode("div", _hoisted_2$5, [
851
+ createVNode(unref(GSCCheckbox), {
852
+ "model-value": __props.team.isSelected,
853
+ "avoid-interaction": __props.teamsSelected.size === 1 && __props.team.isSelected,
854
+ "onUpdate:modelValue": onChangeTeam
855
+ }, null, 8, ["model-value", "avoid-interaction"])
856
+ ]),
857
+ teamName.value !== "Rival" ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
858
+ __props.team.logo ? (openBlock(), createElementBlock("img", {
859
+ key: 0,
860
+ src: __props.team.logo,
861
+ alt: "h-team"
862
+ }, null, 8, _hoisted_4$5)) : createCommentVNode("", true)
863
+ ])) : createCommentVNode("", true),
864
+ createElementVNode("div", _hoisted_5$5, toDisplayString(teamName.value), 1)
865
+ ]),
866
+ createElementVNode("div", _hoisted_6$5, [
867
+ _hoisted_7$4,
868
+ _hoisted_8$2,
869
+ createElementVNode("div", {
870
+ class: normalizeClass(`header-team__arrow__triangle-${props.isHomeTeam ? "right" : "left"}`)
871
+ }, null, 2)
872
+ ])
873
+ ], 4);
874
+ };
875
+ }
876
+ };
877
+ const CategoriesHeaderTeam = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2a81f2f0"]]);
878
+ const ListEvents_vue_vue_type_style_index_0_scoped_bfb2c86b_lang = "";
879
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-bfb2c86b"), n = n(), popScopeId(), n);
880
+ const _hoisted_1$4 = { class: "list-events" };
881
+ const _hoisted_2$4 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", { class: "list-events__title" }, "Tipos de jugadas:", -1));
882
+ const _hoisted_3$4 = { class: "list-events__list" };
883
+ const _hoisted_4$4 = ["onClick"];
884
+ const _hoisted_5$4 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("img", {
885
+ src: _imports_0,
886
+ alt: ""
887
+ }, null, -1));
888
+ const _hoisted_6$4 = [
889
+ _hoisted_5$4
890
+ ];
891
+ const _sfc_main$4 = {
892
+ __name: "ListEvents",
893
+ props: {
894
+ listEventsToDisplay: {
895
+ type: Array,
896
+ default: () => []
897
+ },
898
+ awaitForListEvents: {
899
+ type: Boolean,
900
+ default: false
901
+ },
902
+ lastEventTypeSelected: {
903
+ type: Object,
904
+ default: () => ({})
905
+ },
906
+ canPlayVideos: {
907
+ type: Boolean,
908
+ default: true
909
+ },
910
+ totalEvents: {
911
+ type: Number,
912
+ default: 0
913
+ },
914
+ isPrivilegesVrApplicable: {
915
+ type: Boolean,
916
+ default: false
917
+ },
918
+ totalEventsPrivilegesVr: {
919
+ type: Number,
920
+ default: 0
921
+ }
922
+ },
923
+ emits: ["change-event-type", "click-play"],
924
+ setup(__props, { emit }) {
925
+ const props = __props;
926
+ const defaultEvents = [
927
+ {
928
+ categoriesIds: /* @__PURE__ */ new Set([607, 608]),
929
+ name: "Oportunidad de gol",
930
+ value: "0"
931
+ },
932
+ {
933
+ categoriesIds: /* @__PURE__ */ new Set([12, 55, "54_r", "35_r"]),
934
+ name: "Goles",
935
+ value: "1"
936
+ },
937
+ {
938
+ categoriesIds: /* @__PURE__ */ new Set([19]),
939
+ name: "Tiros a gol",
940
+ value: "2"
941
+ },
942
+ {
943
+ categoriesIds: /* @__PURE__ */ new Set([537, 540, 544, 547]),
944
+ name: "Tiros a gol (portería)",
945
+ value: "3"
946
+ },
947
+ // {
948
+ // categoriesIds: new Set([]),
949
+ // name: 'Pases que ganan terreno',
950
+ // value: '4'
951
+ // },
952
+ {
953
+ categoriesIds: /* @__PURE__ */ new Set([13, 25]),
954
+ name: "Centros totales",
955
+ value: "5"
956
+ },
957
+ {
958
+ categoriesIds: /* @__PURE__ */ new Set([98, 101, 104, 105, 109, 112, 115, 116]),
959
+ name: "Centros acertados",
960
+ value: "6"
961
+ },
962
+ {
963
+ categoriesIds: /* @__PURE__ */ new Set([11]),
964
+ name: "Balones ganados en área rival",
965
+ value: "7"
966
+ },
967
+ {
968
+ categoriesIds: /* @__PURE__ */ new Set([4]),
969
+ name: "1vs1 exitosos ofensivos",
970
+ value: "8"
971
+ },
972
+ {
973
+ categoriesIds: /* @__PURE__ */ new Set([208]),
974
+ name: "1vs1 no exitosos ofensivos",
975
+ value: "9"
976
+ },
977
+ {
978
+ categoriesIds: /* @__PURE__ */ new Set([5]),
979
+ name: "1vs1 exitoso defensivo",
980
+ value: "10"
981
+ },
982
+ {
983
+ categoriesIds: /* @__PURE__ */ new Set([31, 32]),
984
+ name: "Corners",
985
+ value: "11"
986
+ }
987
+ ];
988
+ const listEvents = ref(props.awaitForListEvents ? [] : defaultEvents);
989
+ const listEventsMap = ref(
990
+ props.awaitForListEvents ? /* @__PURE__ */ new Map() : listEvents.value.reduce((acc, item) => {
991
+ acc.set(item.value, item);
992
+ return acc;
993
+ }, /* @__PURE__ */ new Map())
994
+ );
995
+ const radioEventTypeSelected = ref(props.awaitForListEvents ? "" : listEvents.value[0].value);
996
+ watch(
997
+ () => props.listEventsToDisplay,
998
+ (newListEvents) => {
999
+ if (newListEvents.length) {
1000
+ listEventsMap.value = /* @__PURE__ */ new Map();
1001
+ listEvents.value = newListEvents.map((event, index) => {
1002
+ const eventAux = {
1003
+ name: event.name,
1004
+ singleName: event.single_name,
1005
+ categories: new Set(event.categories),
1006
+ categoriesIds: event.categories,
1007
+ post: event.post,
1008
+ prev: event.prev,
1009
+ value: index.toString()
1010
+ };
1011
+ listEventsMap.value.set(eventAux.value, eventAux);
1012
+ return eventAux;
1013
+ });
1014
+ let eventTypeSelected = null;
1015
+ if (props.lastEventTypeSelected && props.lastEventTypeSelected.name) {
1016
+ eventTypeSelected = listEventsMap.value.get(props.lastEventTypeSelected.value);
1017
+ }
1018
+ radioEventTypeSelected.value = eventTypeSelected ? eventTypeSelected.value : listEvents.value[0].value;
1019
+ }
1020
+ },
1021
+ { immediate: true, deep: true }
1022
+ );
1023
+ watch(
1024
+ () => radioEventTypeSelected.value,
1025
+ (newEventType) => {
1026
+ const event = listEventsMap.value.get(newEventType);
1027
+ if (event) {
1028
+ emit("change-event-type", event);
1029
+ }
1030
+ }
1031
+ );
1032
+ function onClickPlay(listEvent, isActive) {
1033
+ if (props.canPlayVideos && isActive) {
1034
+ emit("click-play", listEvent.categoriesIds);
1035
+ }
1036
+ }
1037
+ return (_ctx, _cache) => {
1038
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
1039
+ _hoisted_2$4,
1040
+ createElementVNode("div", _hoisted_3$4, [
1041
+ (openBlock(true), createElementBlock(Fragment, null, renderList(listEvents.value, (event) => {
1042
+ return openBlock(), createElementBlock("div", {
1043
+ key: event.value,
1044
+ class: "list-events__list__item"
1045
+ }, [
1046
+ createVNode(unref(GSCRadioButton), {
1047
+ modelValue: radioEventTypeSelected.value,
1048
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => radioEventTypeSelected.value = $event),
1049
+ value: event.value,
1050
+ label: event.name,
1051
+ name: "event-type",
1052
+ "radio-position": "left",
1053
+ class: "list-events__list__item__radio"
1054
+ }, null, 8, ["modelValue", "value", "label"]),
1055
+ createElementVNode("button", {
1056
+ class: normalizeClass(["list-events__list__item__btn-play", {
1057
+ disabled: !(__props.canPlayVideos && radioEventTypeSelected.value === event.value && (__props.isPrivilegesVrApplicable ? __props.totalEventsPrivilegesVr : __props.totalEvents) > 0)
1058
+ }]),
1059
+ onClick: ($event) => onClickPlay(
1060
+ event,
1061
+ __props.canPlayVideos && radioEventTypeSelected.value === event.value && (__props.isPrivilegesVrApplicable ? __props.totalEventsPrivilegesVr : __props.totalEvents) > 0
1062
+ )
1063
+ }, _hoisted_6$4, 10, _hoisted_4$4)
1064
+ ]);
1065
+ }), 128))
1066
+ ])
1067
+ ]);
1068
+ };
1069
+ }
1070
+ };
1071
+ const ListEvents = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-bfb2c86b"]]);
1072
+ const ItemPlayer_vue_vue_type_style_index_0_scoped_03a1125d_lang = "";
1073
+ const _hoisted_1$3 = { class: "item-player__info" };
1074
+ const _hoisted_2$3 = { class: "item-player__info__photo" };
1075
+ const _hoisted_3$3 = { class: "item-player__info__photo__img" };
1076
+ const _hoisted_4$3 = ["src"];
1077
+ const _hoisted_5$3 = { class: "item-player__info__data" };
1078
+ const _hoisted_6$3 = { class: "item-player__info__data__name" };
1079
+ const _hoisted_7$3 = { class: "item-player__info__data__position" };
1080
+ const _hoisted_8$1 = { class: "item-player__info__data__position__nationality" };
1081
+ const _hoisted_9$1 = ["src"];
1082
+ const _hoisted_10$1 = { class: "item-player__info__data__position__position" };
1083
+ const _hoisted_11$1 = { class: "item-player__jersey-number" };
1084
+ const _sfc_main$3 = {
1085
+ __name: "ItemPlayer",
1086
+ props: {
1087
+ isFemale: {
1088
+ type: Boolean,
1089
+ default: false
1090
+ },
1091
+ player: {
1092
+ type: Object,
1093
+ default: () => {
1094
+ }
1095
+ },
1096
+ selectedPlayers: {
1097
+ type: Set,
1098
+ default: () => /* @__PURE__ */ new Set()
1099
+ }
1100
+ },
1101
+ emits: ["change-player"],
1102
+ setup(__props, { emit }) {
1103
+ const props = __props;
1104
+ const playerPosition = computed(() => {
1105
+ return playerPositions.get(props.player.position_id) || "";
1106
+ });
1107
+ const nationalityFlagUrl = computed(() => {
1108
+ return `https://golstatsimages.blob.core.windows.net/flags/${props.player.nationality_id}.jpg`;
1109
+ });
1110
+ function onUpdateModelValue(value) {
1111
+ emit("change-player", value);
1112
+ }
1113
+ return (_ctx, _cache) => {
1114
+ return openBlock(), createElementBlock("div", {
1115
+ class: normalizeClass(["item-player", { inactive: !__props.player.isSelected }])
1116
+ }, [
1117
+ createVNode(unref(GSCCheckbox), {
1118
+ "model-value": __props.player.isSelected,
1119
+ "avoid-interaction": __props.selectedPlayers.size === 1 && __props.player.isSelected,
1120
+ "onUpdate:modelValue": onUpdateModelValue
1121
+ }, null, 8, ["model-value", "avoid-interaction"]),
1122
+ createElementVNode("div", _hoisted_1$3, [
1123
+ createElementVNode("div", _hoisted_2$3, [
1124
+ createElementVNode("div", _hoisted_3$3, [
1125
+ createElementVNode("img", {
1126
+ src: __props.player.photo,
1127
+ alt: "player-photo"
1128
+ }, null, 8, _hoisted_4$3)
1129
+ ])
1130
+ ]),
1131
+ createElementVNode("div", _hoisted_5$3, [
1132
+ createElementVNode("div", _hoisted_6$3, toDisplayString(__props.player.player_lastname) + ", " + toDisplayString(__props.player.player_name), 1),
1133
+ createElementVNode("div", _hoisted_7$3, [
1134
+ createElementVNode("div", _hoisted_8$1, [
1135
+ createElementVNode("img", { src: nationalityFlagUrl.value }, null, 8, _hoisted_9$1)
1136
+ ]),
1137
+ createElementVNode("div", _hoisted_10$1, toDisplayString(__props.isFemale ? playerPosition.value.replace("Portero", "Portera").replace("Delantero", "Delantera").replace("Volante defensivo", "Volante defensiva").replace("Volante ofensivo", "Volante ofensiva") : playerPosition.value), 1)
1138
+ ])
1139
+ ])
1140
+ ]),
1141
+ createElementVNode("div", _hoisted_11$1, toDisplayString(__props.player.jersey), 1)
1142
+ ], 2);
1143
+ };
1144
+ }
1145
+ };
1146
+ const ItemPlayer = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-03a1125d"]]);
1147
+ const ListPlayers_vue_vue_type_style_index_0_scoped_a0fc063d_lang = "";
1148
+ const _hoisted_1$2 = { class: "list-players" };
1149
+ const _hoisted_2$2 = { class: "list-players__header" };
1150
+ const _hoisted_3$2 = ["src"];
1151
+ const _hoisted_4$2 = { class: "list-players__header__team__name" };
1152
+ const _hoisted_5$2 = ["src"];
1153
+ const _hoisted_6$2 = { class: "list-players__header__team__name" };
1154
+ const _hoisted_7$2 = { class: "list-players__body" };
1155
+ const _sfc_main$2 = {
1156
+ __name: "ListPlayers",
1157
+ props: {
1158
+ isFemale: {
1159
+ type: Boolean,
1160
+ default: false
1161
+ },
1162
+ homeTeam: {
1163
+ type: Object,
1164
+ default: () => ({})
1165
+ },
1166
+ awayTeam: {
1167
+ type: Object,
1168
+ default: () => ({})
1169
+ },
1170
+ availablePlayersByTeam: {
1171
+ type: Map,
1172
+ default: () => /* @__PURE__ */ new Map()
1173
+ }
1174
+ },
1175
+ emits: ["change-players"],
1176
+ setup(__props, { emit }) {
1177
+ const props = __props;
1178
+ const teamIdSelected = ref(0);
1179
+ watch(
1180
+ () => props.homeTeam.team_id,
1181
+ (newVal) => {
1182
+ if (newVal === void 0) {
1183
+ if (props.awayTeam && props.awayTeam.team_id) {
1184
+ teamIdSelected.value = props.awayTeam.team_id;
1185
+ }
1186
+ } else {
1187
+ teamIdSelected.value = newVal;
1188
+ }
1189
+ },
1190
+ { immediate: true }
1191
+ );
1192
+ const availablePlayers = computed(() => {
1193
+ return props.availablePlayersByTeam.get(teamIdSelected.value) || [];
1194
+ });
1195
+ const selectedPlayers = computed(() => {
1196
+ return availablePlayers.value.reduce((acc, player) => {
1197
+ if (player.isSelected) {
1198
+ acc.add(player.player_id);
1199
+ }
1200
+ return acc;
1201
+ }, /* @__PURE__ */ new Set());
1202
+ });
1203
+ watch(
1204
+ () => selectedPlayers.value,
1205
+ (newValue) => {
1206
+ emit("change-players", newValue);
1207
+ },
1208
+ { immediate: true }
1209
+ );
1210
+ function onClickTeam(teamId) {
1211
+ teamIdSelected.value = teamId;
1212
+ }
1213
+ function onChangePlayer(event, player) {
1214
+ player.isSelected = event;
1215
+ }
1216
+ return (_ctx, _cache) => {
1217
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
1218
+ createElementVNode("div", _hoisted_2$2, [
1219
+ __props.homeTeam.team_id !== void 0 ? (openBlock(), createElementBlock("div", {
1220
+ key: 0,
1221
+ role: "button",
1222
+ class: normalizeClass(["list-players__header__team", { active: teamIdSelected.value === __props.homeTeam.team_id }]),
1223
+ onClick: _cache[0] || (_cache[0] = ($event) => onClickTeam(__props.homeTeam.team_id))
1224
+ }, [
1225
+ createElementVNode("img", {
1226
+ src: __props.homeTeam.logo,
1227
+ alt: "team-logo"
1228
+ }, null, 8, _hoisted_3$2),
1229
+ createElementVNode("div", _hoisted_4$2, toDisplayString(__props.homeTeam.colloquial_name), 1)
1230
+ ], 2)) : createCommentVNode("", true),
1231
+ __props.awayTeam.team_id !== void 0 ? (openBlock(), createElementBlock("div", {
1232
+ key: 1,
1233
+ role: "button",
1234
+ class: normalizeClass(["list-players__header__team away", { active: teamIdSelected.value === __props.awayTeam.team_id }]),
1235
+ onClick: _cache[1] || (_cache[1] = ($event) => onClickTeam(__props.awayTeam.team_id))
1236
+ }, [
1237
+ createElementVNode("img", {
1238
+ src: __props.awayTeam.logo,
1239
+ alt: "team-logo"
1240
+ }, null, 8, _hoisted_5$2),
1241
+ createElementVNode("div", _hoisted_6$2, toDisplayString(__props.awayTeam.colloquial_name), 1)
1242
+ ], 2)) : createCommentVNode("", true)
1243
+ ]),
1244
+ createElementVNode("div", _hoisted_7$2, [
1245
+ (openBlock(true), createElementBlock(Fragment, null, renderList(availablePlayers.value, (player) => {
1246
+ return openBlock(), createBlock(ItemPlayer, {
1247
+ key: player.player_id,
1248
+ "is-female": __props.isFemale,
1249
+ player,
1250
+ "selected-players": selectedPlayers.value,
1251
+ onChangePlayer: ($event) => onChangePlayer($event, player)
1252
+ }, null, 8, ["is-female", "player", "selected-players", "onChangePlayer"]);
1253
+ }), 128))
1254
+ ])
1255
+ ]);
1256
+ };
1257
+ }
1258
+ };
1259
+ const ListPlayers = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-a0fc063d"]]);
1260
+ const CategoriesList_vue_vue_type_style_index_0_scoped_86727bbf_lang = "";
1261
+ const _hoisted_1$1 = { class: "categories-list" };
1262
+ const _hoisted_2$1 = {
1263
+ key: 0,
1264
+ class: "categories-list__games"
1265
+ };
1266
+ const _hoisted_3$1 = {
1267
+ key: 1,
1268
+ class: "categories-list__header"
1269
+ };
1270
+ const _hoisted_4$1 = { class: "categories-list__switch" };
1271
+ const _hoisted_5$1 = { class: "categories-list__lists" };
1272
+ const _hoisted_6$1 = {
1273
+ key: 0,
1274
+ class: "categories-list__lists__events"
1275
+ };
1276
+ const _hoisted_7$1 = {
1277
+ key: 1,
1278
+ class: "categories-list__lists__players"
1279
+ };
1280
+ const _sfc_main$1 = {
1281
+ __name: "CategoriesList",
1282
+ props: {
1283
+ isFemale: {
1284
+ type: Boolean,
1285
+ default: false
1286
+ },
1287
+ homeTeam: {
1288
+ type: Object,
1289
+ default: () => ({})
1290
+ },
1291
+ awayTeam: {
1292
+ type: Object,
1293
+ default: () => ({})
1294
+ },
1295
+ listEventsToDisplay: {
1296
+ type: Array,
1297
+ default: () => []
1298
+ },
1299
+ awaitForListEvents: {
1300
+ type: Boolean,
1301
+ default: false
1302
+ },
1303
+ tournamentSelected: {
1304
+ type: Object,
1305
+ default: () => ({})
1306
+ },
1307
+ availablePlayersByTeam: {
1308
+ type: Map,
1309
+ default: () => /* @__PURE__ */ new Map()
1310
+ },
1311
+ listType: {
1312
+ type: String,
1313
+ default: "events"
1314
+ },
1315
+ canPlayVideos: {
1316
+ type: Boolean,
1317
+ default: true
1318
+ },
1319
+ isGamePreMatch: {
1320
+ type: Boolean,
1321
+ default: false
1322
+ },
1323
+ selectedTeamData: {
1324
+ type: Object,
1325
+ default: () => ({})
1326
+ },
1327
+ rivalTeams: {
1328
+ type: Object,
1329
+ default: () => ({
1330
+ isSelected: false,
1331
+ colloquialName: "Rival"
1332
+ })
1333
+ },
1334
+ teamSelected: {
1335
+ type: Object,
1336
+ default: () => ({ teamId: 0 })
1337
+ },
1338
+ totalEvents: {
1339
+ type: Number,
1340
+ default: 0
1341
+ },
1342
+ isPrivilegesVrApplicable: {
1343
+ type: Boolean,
1344
+ default: false
1345
+ },
1346
+ totalEventsPrivilegesVr: {
1347
+ type: Number,
1348
+ default: 0
1349
+ }
1350
+ },
1351
+ emits: [
1352
+ "change-event-type",
1353
+ "change-list-type",
1354
+ "change-players",
1355
+ "change-teams",
1356
+ "change-games"
1357
+ ],
1358
+ setup(__props, { emit }) {
1359
+ const props = __props;
1360
+ const listTypes = ref([
1361
+ "Eventos",
1362
+ props.tournamentSelected.is_female == 1 ? "Jugadoras" : "Jugadores"
1363
+ ]);
1364
+ const listTypeSelectedIndex = ref(0);
1365
+ const lastEventTypeSelected = ref({});
1366
+ const expansionPanelModeProps = ref({
1367
+ isExpansionPanel: false,
1368
+ templateProps: {
1369
+ boxShadow: "0px 4px 4px rgba(0, 0, 0, 0)",
1370
+ width: "100%"
1371
+ },
1372
+ buttonFilterProps: {
1373
+ width: "100%",
1374
+ "background-color": "#293640",
1375
+ padding: "3px 8px",
1376
+ "border-radius": "5px",
1377
+ "border-color": "#293640",
1378
+ "info-border-color": "#424D58"
1379
+ },
1380
+ fieldComponentProps: {
1381
+ width: "100%"
1382
+ },
1383
+ width: "100%"
1384
+ });
1385
+ const currentTeamGamesSelected = ref([]);
1386
+ const homeTeamPreMatch = ref({});
1387
+ const awayTeamPreMatch = ref({});
1388
+ const teamsSelectedPreMatch = ref(/* @__PURE__ */ new Set());
1389
+ const teamsSelected = computed(() => {
1390
+ const teamsSelectedAux = /* @__PURE__ */ new Set();
1391
+ const teamsSelected2 = /* @__PURE__ */ new Set();
1392
+ if (props.isGamePreMatch) {
1393
+ if (props.selectedTeamData.isSelected) {
1394
+ teamsSelected2.add(props.selectedTeamData.teamId);
1395
+ teamsSelectedAux.add(1);
1396
+ }
1397
+ if (props.rivalTeams.isSelected) {
1398
+ teamsSelectedAux.add(2);
1399
+ currentTeamGamesSelected.value.forEach((game) => {
1400
+ teamsSelected2.add(
1401
+ game.rivalTeam.team_id === props.selectedTeamData.teamId ? game.team.team_id : game.rivalTeam.team_id
1402
+ );
1403
+ });
1404
+ }
1405
+ setTamsSelectedPreMatch(teamsSelectedAux);
1406
+ } else {
1407
+ if (props.homeTeam.isSelected) {
1408
+ teamsSelected2.add(props.homeTeam.team_id);
1409
+ }
1410
+ if (props.awayTeam.isSelected) {
1411
+ teamsSelected2.add(props.awayTeam.team_id);
1412
+ }
1413
+ }
1414
+ return teamsSelected2;
1415
+ });
1416
+ const isHomeTeamTeamForAnalysis = computed(() => {
1417
+ return props.homeTeam.team_id === props.teamSelected.teamId;
1418
+ });
1419
+ const isAwayTeamTeamForAnalysis = computed(() => {
1420
+ return props.awayTeam.team_id === props.teamSelected.teamId;
1421
+ });
1422
+ watch(
1423
+ () => listTypeSelectedIndex.value,
1424
+ (newVal) => {
1425
+ emit("change-list-type", newVal ? "players" : "events");
1426
+ },
1427
+ { immediate: true }
1428
+ );
1429
+ watch(
1430
+ () => teamsSelected.value,
1431
+ (newVal) => {
1432
+ emit("change-teams", newVal);
1433
+ },
1434
+ { immediate: true }
1435
+ );
1436
+ const filterGames = computed(() => {
1437
+ if (props.isGamePreMatch && props.selectedTeamData.games && props.selectedTeamData.games.length > 0) {
1438
+ return props.selectedTeamData.games.map((game) => {
1439
+ return {
1440
+ ...game,
1441
+ label: `${game.roundAbbreviation} ${game.team.acronym} vs ${game.rivalTeam.acronym}`,
1442
+ teamsIds: [game.team.team_id, game.rivalTeam.team_id]
1443
+ };
1444
+ });
1445
+ }
1446
+ return [];
1447
+ });
1448
+ function setTamsSelectedPreMatch(teamsSelectedAux) {
1449
+ teamsSelectedPreMatch.value = teamsSelectedAux;
1450
+ }
1451
+ function onChangeListType(value) {
1452
+ listTypeSelectedIndex.value = value.index;
1453
+ }
1454
+ function onChangeEventType(eventType) {
1455
+ lastEventTypeSelected.value = eventType;
1456
+ emit("change-event-type", eventType);
1457
+ }
1458
+ function onChangePlayers(players) {
1459
+ emit("change-players", players);
1460
+ }
1461
+ function onChangeTeam({ value, team }) {
1462
+ team.isSelected = value;
1463
+ }
1464
+ function onClickPlay(categoriesIds) {
1465
+ emit("click-play", categoriesIds);
1466
+ }
1467
+ function onUpdateFiltersGames(filters) {
1468
+ const gamesIds = /* @__PURE__ */ new Set();
1469
+ currentTeamGamesSelected.value = filters.filter((game) => {
1470
+ if (game.isSelected) {
1471
+ gamesIds.add(game.game_id);
1472
+ }
1473
+ return game.isSelected;
1474
+ });
1475
+ if (currentTeamGamesSelected.value.length === 1) {
1476
+ const gameSelected = currentTeamGamesSelected.value[0];
1477
+ homeTeamPreMatch.value = gameSelected.homeTeam;
1478
+ awayTeamPreMatch.value = gameSelected.awayTeam;
1479
+ } else {
1480
+ homeTeamPreMatch.value = props.teamSelected.isHomeTeam ? props.homeTeam : {};
1481
+ awayTeamPreMatch.value = props.teamSelected.isHomeTeam ? {} : props.awayTeam;
1482
+ listTypeSelectedIndex.value = 0;
1483
+ }
1484
+ emit("change-games", {
1485
+ gamesIds,
1486
+ availableTeamsIds: teamsSelected.value,
1487
+ currentTeamGamesSelected: currentTeamGamesSelected.value
1488
+ });
1489
+ }
1490
+ return (_ctx, _cache) => {
1491
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [
1492
+ __props.isGamePreMatch ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
1493
+ createVNode(unref(GSCFilters), mergeProps(expansionPanelModeProps.value, {
1494
+ "filter-type": unref(filtersTypes).GAMES,
1495
+ filters: filterGames.value,
1496
+ "onUpdate:filters": onUpdateFiltersGames
1497
+ }), null, 16, ["filter-type", "filters"])
1498
+ ])) : createCommentVNode("", true),
1499
+ __props.listType === "events" ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
1500
+ createVNode(CategoriesHeaderTeam, {
1501
+ team: __props.isGamePreMatch ? isHomeTeamTeamForAnalysis.value ? __props.selectedTeamData : __props.rivalTeams : __props.homeTeam,
1502
+ "teams-selected": __props.isGamePreMatch ? teamsSelectedPreMatch.value : teamsSelected.value,
1503
+ "is-game-pre-match": __props.isGamePreMatch,
1504
+ "is-team-for-analysis": isHomeTeamTeamForAnalysis.value,
1505
+ onChangeTeam
1506
+ }, null, 8, ["team", "teams-selected", "is-game-pre-match", "is-team-for-analysis"]),
1507
+ createVNode(CategoriesHeaderTeam, {
1508
+ team: __props.isGamePreMatch ? isAwayTeamTeamForAnalysis.value ? __props.selectedTeamData : __props.rivalTeams : __props.awayTeam,
1509
+ "is-home-team": false,
1510
+ "is-game-pre-match": __props.isGamePreMatch,
1511
+ "teams-selected": __props.isGamePreMatch ? teamsSelectedPreMatch.value : teamsSelected.value,
1512
+ "is-team-for-analysis": isAwayTeamTeamForAnalysis.value,
1513
+ onChangeTeam
1514
+ }, null, 8, ["team", "is-game-pre-match", "teams-selected", "is-team-for-analysis"])
1515
+ ])) : createCommentVNode("", true),
1516
+ createElementVNode("div", _hoisted_4$1, [
1517
+ createVNode(ToggleButtons, {
1518
+ "selected-button-index": listTypeSelectedIndex.value,
1519
+ buttons: listTypes.value,
1520
+ width: "220px",
1521
+ "border-radius": "16px",
1522
+ onChange: onChangeListType
1523
+ }, null, 8, ["selected-button-index", "buttons"])
1524
+ ]),
1525
+ createElementVNode("div", _hoisted_5$1, [
1526
+ listTypeSelectedIndex.value === 0 ? (openBlock(), createElementBlock("div", _hoisted_6$1, [
1527
+ createVNode(ListEvents, {
1528
+ "list-events-to-display": __props.isGamePreMatch ? __props.selectedTeamData.categories : __props.listEventsToDisplay,
1529
+ "await-for-list-events": __props.awaitForListEvents,
1530
+ "last-event-type-selected": lastEventTypeSelected.value,
1531
+ "can-play-videos": __props.canPlayVideos,
1532
+ "total-events": __props.totalEvents,
1533
+ "total-events-privileges-vr": __props.totalEventsPrivilegesVr,
1534
+ "is-privileges-vr-applicable": __props.isPrivilegesVrApplicable,
1535
+ onChangeEventType,
1536
+ onClickPlay
1537
+ }, null, 8, ["list-events-to-display", "await-for-list-events", "last-event-type-selected", "can-play-videos", "total-events", "total-events-privileges-vr", "is-privileges-vr-applicable"])
1538
+ ])) : (openBlock(), createElementBlock("div", _hoisted_7$1, [
1539
+ createVNode(ListPlayers, {
1540
+ "is-female": __props.isFemale,
1541
+ "available-players-by-team": __props.availablePlayersByTeam,
1542
+ "home-team": __props.isGamePreMatch ? homeTeamPreMatch.value : __props.homeTeam,
1543
+ "away-team": __props.isGamePreMatch ? awayTeamPreMatch.value : __props.awayTeam,
1544
+ onChangeEventType,
1545
+ onChangePlayers
1546
+ }, null, 8, ["is-female", "available-players-by-team", "home-team", "away-team"])
1547
+ ]))
1548
+ ])
1549
+ ]);
1550
+ };
1551
+ }
1552
+ };
1553
+ const CategoriesList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-86727bbf"]]);
1554
+ const chalkboardPlayValues = [
1555
+ "playId",
1556
+ "playerId",
1557
+ "teamId",
1558
+ "gameId",
1559
+ "categoryId",
1560
+ "x1",
1561
+ "y1",
1562
+ "x2",
1563
+ "y2",
1564
+ "x3",
1565
+ "y3",
1566
+ "momentOfPlay",
1567
+ "relatedPlayId",
1568
+ "order",
1569
+ "nationalityId",
1570
+ "jersey"
1571
+ ];
1572
+ let chalkboardPlayIndex = null;
1573
+ function getChalkboardPlayIndexes() {
1574
+ if (!chalkboardPlayIndex) {
1575
+ chalkboardPlayIndex = getPlayValueIndexesFromArray(chalkboardPlayValues);
1576
+ }
1577
+ return chalkboardPlayIndex;
1578
+ }
1579
+ const rivalCategoryIds = /* @__PURE__ */ new Set([35, 54]);
1580
+ const rivalCategoryIdsR = /* @__PURE__ */ new Set(["35_r", "54_r"]);
1581
+ const teamColors = {
1582
+ homeTeam: "#336dff",
1583
+ awayTeam: "#7ed321"
1584
+ };
1585
+ const teamFontColors = {
1586
+ homeTeam: "#fff",
1587
+ awayTeam: "#000"
1588
+ };
1589
+ class EventsConnection {
1590
+ constructor(mainPlay = {}, events = [], categoriesIds = /* @__PURE__ */ new Set(), playersIds = /* @__PURE__ */ new Set(), game = null, teamForAnalysis = null) {
1591
+ const isRivalCategory = rivalCategoryIds.has(mainPlay.categoryId);
1592
+ this.mainPlay = mainPlay;
1593
+ this.playEvents = events.sort((a, b) => b.order - a.order);
1594
+ this.categoriesIds = categoriesIds;
1595
+ this.playersIds = playersIds;
1596
+ this.teamForAnalysis = teamForAnalysis;
1597
+ this.mainCategoryId = isRivalCategory ? `${mainPlay.categoryId}_r` : mainPlay.categoryId || 0;
1598
+ this.mainPlay.isMainPlay = true;
1599
+ this.playEvents.forEach((event) => {
1600
+ event.game = game;
1601
+ });
1602
+ }
1603
+ setEventType(eventType) {
1604
+ this.eventType = eventType;
1605
+ this.mainPlay.categoryName = eventType.singleName;
1606
+ this.playEvents.forEach((event) => {
1607
+ event.hasConnectionPath = this.eventType.prev !== 0 || this.eventType.post !== 0;
1608
+ });
1609
+ }
1610
+ getEventsConnectionsByEventType() {
1611
+ const mainEventIndex = this.playEvents.findIndex((event) => {
1612
+ return event.playId === this.mainPlay.playId;
1613
+ });
1614
+ if (mainEventIndex > -1 && this.eventType) {
1615
+ let minEventIndex = mainEventIndex - this.eventType.post;
1616
+ let maxEventIndex = mainEventIndex + this.eventType.prev;
1617
+ if (minEventIndex < 0) {
1618
+ minEventIndex = 0;
1619
+ }
1620
+ if (maxEventIndex > this.playEvents.length - 1) {
1621
+ maxEventIndex = this.playEvents.length - 1;
1622
+ }
1623
+ const eventsConnectionsByEventType = this.playEvents.slice(minEventIndex, maxEventIndex + 1).reverse();
1624
+ eventsConnectionsByEventType.forEach((eventConnection, index) => {
1625
+ if (index > 0) {
1626
+ eventConnection.previousEvent = eventsConnectionsByEventType[index - 1];
1627
+ }
1628
+ });
1629
+ return eventsConnectionsByEventType;
1630
+ }
1631
+ return [];
1632
+ }
1633
+ hasMainCategory(categoriesIds = /* @__PURE__ */ new Set()) {
1634
+ return categoriesIds.has(this.mainCategoryId);
1635
+ }
1636
+ hasCategories(categoriesIds = /* @__PURE__ */ new Set(), teams = { homeTeamId: 0, awayTeamId: 0 }) {
1637
+ const teamsIndex = [];
1638
+ categoriesIds.forEach((categoryId) => {
1639
+ teamsIndex.push(`${teams.homeTeamId}-${categoryId}`);
1640
+ teamsIndex.push(`${teams.awayTeamId}-${categoryId}`);
1641
+ });
1642
+ return teamsIndex.some((categoryId) => this.teamEventsIndex.has(categoryId));
1643
+ }
1644
+ hasPlayer(playersIds = /* @__PURE__ */ new Set()) {
1645
+ return playersIds.has(this.mainPlay.playerId);
1646
+ }
1647
+ hasPlayers(playersIds = /* @__PURE__ */ new Set()) {
1648
+ return Array.from(playersIds.values()).some((playerId) => this.playersIds.has(playerId));
1649
+ }
1650
+ hasTeam(teamIds = /* @__PURE__ */ new Set()) {
1651
+ return teamIds.has(this.mainPlay.teamId);
1652
+ }
1653
+ getTeamColor() {
1654
+ let isHomeTeamAux = this.teamForAnalysis ? this.teamForAnalysis.isHomeTeam ? this.mainPlay.teamId === this.teamForAnalysis.teamId : this.mainPlay.teamId !== this.teamForAnalysis.teamId : this.mainPlay.team.isHomeTeam;
1655
+ if (rivalCategoryIdsR.has(this.mainPlay.categoryId)) {
1656
+ isHomeTeamAux = !isHomeTeamAux;
1657
+ }
1658
+ return isHomeTeamAux ? teamColors.homeTeam : teamColors.awayTeam;
1659
+ }
1660
+ getEventColor(event) {
1661
+ let isHomeTeamAux = this.teamForAnalysis ? this.teamForAnalysis.isHomeTeam ? event.teamId === this.teamForAnalysis.teamId : event.teamId !== this.teamForAnalysis.teamId : event.team.isHomeTeam;
1662
+ return isHomeTeamAux ? teamColors.homeTeam : teamColors.awayTeam;
1663
+ }
1664
+ getTeamFontColor() {
1665
+ let isHomeTeamAux = this.teamForAnalysis ? this.teamForAnalysis.isHomeTeam ? this.mainPlay.teamId === this.teamForAnalysis.teamId : this.mainPlay.teamId !== this.teamForAnalysis.teamId : this.mainPlay.team.isHomeTeam;
1666
+ if (rivalCategoryIdsR.has(this.mainPlay.categoryId)) {
1667
+ isHomeTeamAux = !isHomeTeamAux;
1668
+ }
1669
+ return isHomeTeamAux ? teamFontColors.homeTeam : teamFontColors.awayTeam;
1670
+ }
1671
+ getSingleName(categoryName) {
1672
+ const categoryNameArray = categoryName.split(" ");
1673
+ return categoryNameArray.reduce((accumulator, word) => {
1674
+ let wordAux = word;
1675
+ if (word.endsWith("minaron")) {
1676
+ wordAux = word.replace("minaron", "minó");
1677
+ } else if (word.endsWith("vocan")) {
1678
+ wordAux = word.replace("vocan", "voca");
1679
+ } else if (word.endsWith("lones")) {
1680
+ wordAux = word.replace("lones", "lón");
1681
+ } else if (word.endsWith("oles")) {
1682
+ wordAux = word.replace("oles", "ol");
1683
+ } else if (word.endsWith("os") || word.endsWith("as") || word.endsWith("es")) {
1684
+ wordAux = word.slice(0, word.length - 1);
1685
+ }
1686
+ accumulator.push(wordAux);
1687
+ return accumulator;
1688
+ }, []).join(" ");
1689
+ }
1690
+ }
1691
+ const cupType0 = /* @__PURE__ */ new Map([
1692
+ [
1693
+ 1,
1694
+ {
1695
+ matchDayId: 1,
1696
+ matchDayName: "Jornada 1",
1697
+ matchDayAbbreviation: "J1",
1698
+ matchDayAbbreviation2: "JOR 1"
1699
+ }
1700
+ ],
1701
+ [
1702
+ 2,
1703
+ {
1704
+ matchDayId: 2,
1705
+ matchDayName: "Jornada 2",
1706
+ matchDayAbbreviation: "J2",
1707
+ matchDayAbbreviation2: "JOR 2"
1708
+ }
1709
+ ],
1710
+ [
1711
+ 3,
1712
+ {
1713
+ matchDayId: 3,
1714
+ matchDayName: "Jornada 3",
1715
+ matchDayAbbreviation: "J3",
1716
+ matchDayAbbreviation2: "JOR 3"
1717
+ }
1718
+ ],
1719
+ [
1720
+ 4,
1721
+ {
1722
+ matchDayId: 4,
1723
+ matchDayName: "Jornada 4",
1724
+ matchDayAbbreviation: "J4",
1725
+ matchDayAbbreviation2: "JOR 4"
1726
+ }
1727
+ ],
1728
+ [
1729
+ 5,
1730
+ {
1731
+ matchDayId: 5,
1732
+ matchDayName: "Jornada 5",
1733
+ matchDayAbbreviation: "J5",
1734
+ matchDayAbbreviation2: "JOR 5"
1735
+ }
1736
+ ],
1737
+ [
1738
+ 6,
1739
+ {
1740
+ matchDayId: 6,
1741
+ matchDayName: "Jornada 6",
1742
+ matchDayAbbreviation: "J6",
1743
+ matchDayAbbreviation2: "JOR 6"
1744
+ }
1745
+ ],
1746
+ [
1747
+ 7,
1748
+ {
1749
+ matchDayId: 7,
1750
+ matchDayName: "Jornada 7",
1751
+ matchDayAbbreviation: "J7",
1752
+ matchDayAbbreviation2: "JOR 7"
1753
+ }
1754
+ ],
1755
+ [
1756
+ 8,
1757
+ {
1758
+ matchDayId: 8,
1759
+ matchDayName: "Jornada 8",
1760
+ matchDayAbbreviation: "J8",
1761
+ matchDayAbbreviation2: "JOR 8"
1762
+ }
1763
+ ],
1764
+ [
1765
+ 9,
1766
+ {
1767
+ matchDayId: 9,
1768
+ matchDayName: "Jornada 9",
1769
+ matchDayAbbreviation: "J9",
1770
+ matchDayAbbreviation2: "JOR 9"
1771
+ }
1772
+ ],
1773
+ [
1774
+ 10,
1775
+ {
1776
+ matchDayId: 10,
1777
+ matchDayName: "Jornada 10",
1778
+ matchDayAbbreviation: "J10",
1779
+ matchDayAbbreviation2: "JOR 10"
1780
+ }
1781
+ ],
1782
+ [
1783
+ 11,
1784
+ {
1785
+ matchDayId: 11,
1786
+ matchDayName: "Jornada 11",
1787
+ matchDayAbbreviation: "J11",
1788
+ matchDayAbbreviation2: "JOR 11"
1789
+ }
1790
+ ],
1791
+ [
1792
+ 12,
1793
+ {
1794
+ matchDayId: 12,
1795
+ matchDayName: "Jornada 12",
1796
+ matchDayAbbreviation: "J12",
1797
+ matchDayAbbreviation2: "JOR 12"
1798
+ }
1799
+ ],
1800
+ [
1801
+ 13,
1802
+ {
1803
+ matchDayId: 13,
1804
+ matchDayName: "Jornada 13",
1805
+ matchDayAbbreviation: "J13",
1806
+ matchDayAbbreviation2: "JOR 13"
1807
+ }
1808
+ ],
1809
+ [
1810
+ 14,
1811
+ {
1812
+ matchDayId: 14,
1813
+ matchDayName: "Jornada 14",
1814
+ matchDayAbbreviation: "J14",
1815
+ matchDayAbbreviation2: "JOR 14"
1816
+ }
1817
+ ],
1818
+ [
1819
+ 15,
1820
+ {
1821
+ matchDayId: 15,
1822
+ matchDayName: "Jornada 15",
1823
+ matchDayAbbreviation: "J15",
1824
+ matchDayAbbreviation2: "JOR 15"
1825
+ }
1826
+ ],
1827
+ [
1828
+ 16,
1829
+ {
1830
+ matchDayId: 16,
1831
+ matchDayName: "Jornada 16",
1832
+ matchDayAbbreviation: "J16",
1833
+ matchDayAbbreviation2: "JOR 16"
1834
+ }
1835
+ ],
1836
+ [
1837
+ 17,
1838
+ {
1839
+ matchDayId: 17,
1840
+ matchDayName: "Jornada 17",
1841
+ matchDayAbbreviation: "J17",
1842
+ matchDayAbbreviation2: "JOR 17"
1843
+ }
1844
+ ],
1845
+ [
1846
+ 18,
1847
+ {
1848
+ matchDayId: 18,
1849
+ matchDayName: "Cuartos de Final Ida",
1850
+ matchDayAbbreviation: "CFI",
1851
+ matchDayAbbreviation2: "CFI"
1852
+ }
1853
+ ],
1854
+ [
1855
+ 19,
1856
+ {
1857
+ matchDayId: 19,
1858
+ matchDayName: "Cuartos de Final Vuelta",
1859
+ matchDayAbbreviation: "CFV",
1860
+ matchDayAbbreviation2: "CFV"
1861
+ }
1862
+ ],
1863
+ [
1864
+ 20,
1865
+ {
1866
+ matchDayId: 20,
1867
+ matchDayName: "Semifinal Ida",
1868
+ matchDayAbbreviation: "SFI",
1869
+ matchDayAbbreviation2: "SFI"
1870
+ }
1871
+ ],
1872
+ [
1873
+ 21,
1874
+ {
1875
+ matchDayId: 21,
1876
+ matchDayName: "Semifinal Vuelta",
1877
+ matchDayAbbreviation: "SFV",
1878
+ matchDayAbbreviation2: "SFV"
1879
+ }
1880
+ ],
1881
+ [
1882
+ 22,
1883
+ {
1884
+ matchDayId: 22,
1885
+ matchDayName: "Final Ida",
1886
+ matchDayAbbreviation: "FI",
1887
+ matchDayAbbreviation2: "FI"
1888
+ }
1889
+ ],
1890
+ [
1891
+ 86,
1892
+ {
1893
+ matchDayId: 86,
1894
+ matchDayName: "Final Vuelta",
1895
+ matchDayAbbreviation: "FV",
1896
+ matchDayAbbreviation2: "FV"
1897
+ }
1898
+ ],
1899
+ [
1900
+ 182,
1901
+ {
1902
+ matchDayId: 182,
1903
+ matchDayName: "Play In 1",
1904
+ matchDayAbbreviation: "PI1",
1905
+ matchDayAbbreviation2: "PI1"
1906
+ }
1907
+ ],
1908
+ [
1909
+ 183,
1910
+ {
1911
+ matchDayId: 183,
1912
+ matchDayName: "Play In 2",
1913
+ matchDayAbbreviation: "PI2",
1914
+ matchDayAbbreviation2: "PI2"
1915
+ }
1916
+ ],
1917
+ [
1918
+ 184,
1919
+ {
1920
+ matchDayId: 184,
1921
+ matchDayName: "Repechaje",
1922
+ matchDayAbbreviation: "R",
1923
+ matchDayAbbreviation2: "R"
1924
+ }
1925
+ ]
1926
+ ]);
1927
+ const cupType1ById = /* @__PURE__ */ new Map([
1928
+ [1, { matchDayId: 1, matchDayName: "Jornada 1", matchDayAbbreviation: "J1" }],
1929
+ [2, { matchDayId: 2, matchDayName: "Jornada 2", matchDayAbbreviation: "J2" }],
1930
+ [3, { matchDayId: 3, matchDayName: "Jornada 3", matchDayAbbreviation: "J3" }],
1931
+ [4, { matchDayId: 4, matchDayName: "Jornada 4", matchDayAbbreviation: "J4" }],
1932
+ [5, { matchDayId: 5, matchDayName: "Jornada 5", matchDayAbbreviation: "J5" }],
1933
+ [6, { matchDayId: 6, matchDayName: "Jornada 6", matchDayAbbreviation: "J6" }],
1934
+ [181, { matchDayId: 181, matchDayName: "16vos de Final", matchDayAbbreviation: "DF" }],
1935
+ [176, { matchDayId: 176, matchDayName: "Octavos de Final", matchDayAbbreviation: "OF" }],
1936
+ [177, { matchDayId: 177, matchDayName: "Cuartos de Final", matchDayAbbreviation: "CF" }],
1937
+ [178, { matchDayId: 178, matchDayName: "Semifinales", matchDayAbbreviation: "SF" }],
1938
+ [179, { matchDayId: 179, matchDayName: "Tercer lugar", matchDayAbbreviation: "3ER" }],
1939
+ [180, { matchDayId: 180, matchDayName: "Final", matchDayAbbreviation: "FINAL" }]
1940
+ ]);
1941
+ const cupType2ById = /* @__PURE__ */ new Map([
1942
+ [1, { matchDayId: 1, matchDayName: "16vos de Final Ida", matchDayAbbreviation: "DFI" }],
1943
+ [2, { matchDayId: 2, matchDayName: "16vos de Final Vuelta", matchDayAbbreviation: "DFV" }],
1944
+ [3, { matchDayId: 3, matchDayName: "Octavos de Final Ida", matchDayAbbreviation: "OFI" }],
1945
+ [4, { matchDayId: 4, matchDayName: "Octavos de Final Vuelta", matchDayAbbreviation: "OFV" }],
1946
+ [5, { matchDayId: 5, matchDayName: "Cuartos de Final Ida", matchDayAbbreviation: "CFI" }],
1947
+ [6, { matchDayId: 6, matchDayName: "Cuartos de Final Vuelta", matchDayAbbreviation: "CFV" }],
1948
+ [7, { matchDayId: 7, matchDayName: "Semifinales Ida", matchDayAbbreviation: "SFI" }],
1949
+ [8, { matchDayId: 8, matchDayName: "Semifinales Vuelta", matchDayAbbreviation: "SFV" }],
1950
+ [10, { matchDayId: 10, matchDayName: "Final", matchDayAbbreviation: "FINAL" }]
1951
+ ]);
1952
+ const namesAndAbbByTournamentTypeAndMatchDayId = /* @__PURE__ */ new Map([
1953
+ [0, cupType0],
1954
+ [1, cupType1ById],
1955
+ [2, cupType2ById]
1956
+ ]);
1957
+ const ChalkboardSectionContainer_vue_vue_type_style_index_0_scoped_96de1508_lang = "";
1958
+ const _withScopeId = (n) => (pushScopeId("data-v-96de1508"), n = n(), popScopeId(), n);
1959
+ const _hoisted_1 = { class: "chalkboard-section-container" };
1960
+ const _hoisted_2 = {
1961
+ key: 0,
1962
+ class: "chalkboard-section-container__pre-match-header"
1963
+ };
1964
+ const _hoisted_3 = {
1965
+ key: 0,
1966
+ class: "container-info-text-pre-match"
1967
+ };
1968
+ const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "info-text-bold" }, "IMPORTANTE:", -1));
1969
+ const _hoisted_5 = {
1970
+ key: 1,
1971
+ class: "container-info-text-pre-match-mobile"
1972
+ };
1973
+ const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "info-text-bold" }, "IMPORTANTE:", -1));
1974
+ const _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("br", null, null, -1));
1975
+ const _hoisted_8 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("br", null, null, -1));
1976
+ const _hoisted_9 = {
1977
+ key: 2,
1978
+ class: "container-info-text-pre-match-mobile"
1979
+ };
1980
+ const _hoisted_10 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "info-text-bold" }, "IMPORTANTE:", -1));
1981
+ const _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("br", null, null, -1));
1982
+ const _hoisted_12 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("br", null, null, -1));
1983
+ const _hoisted_13 = { class: "section-container" };
1984
+ const _hoisted_14 = { class: "section-container__left-column" };
1985
+ const _hoisted_15 = { class: "chalkboard-component" };
1986
+ const _hoisted_16 = { class: "assistant-zones" };
1987
+ const _hoisted_17 = { class: "categories-time-line-component" };
1988
+ const _hoisted_18 = { class: "total-events" };
1989
+ const _hoisted_19 = { class: "section-container__right-column" };
1990
+ const _sfc_main = {
1991
+ __name: "ChalkboardSectionContainer",
1992
+ props: {
1993
+ isFemale: {
1994
+ type: Boolean,
1995
+ default: false
1996
+ },
1997
+ game: {
1998
+ type: Object,
1999
+ default: () => ({})
2000
+ },
2001
+ seasonSelected: {
2002
+ type: Object,
2003
+ default: () => ({})
2004
+ },
2005
+ tournamentSelected: {
2006
+ type: Object,
2007
+ default: () => ({})
2008
+ },
2009
+ token: {
2010
+ type: String,
2011
+ default: ""
2012
+ },
2013
+ canPlayVideos: {
2014
+ type: Boolean,
2015
+ default: true
2016
+ },
2017
+ widthSection: {
2018
+ type: Number,
2019
+ default: 0
2020
+ },
2021
+ isGamePreMatch: {
2022
+ type: Boolean,
2023
+ default: false
2024
+ },
2025
+ playVideosPrivileges: {
2026
+ type: Object,
2027
+ default: null
2028
+ },
2029
+ chalkboardIntervalMinutes: {
2030
+ type: Number,
2031
+ default: 2
2032
+ }
2033
+ },
2034
+ emits: ["open-media-player"],
2035
+ setup(__props, { emit }) {
2036
+ const props = __props;
2037
+ let eventsInterval = null;
2038
+ const chalkboardPlayIndexes = getChalkboardPlayIndexes();
2039
+ const teamSelected = ref({ teamId: 0 });
2040
+ const teamButtonSelectedIndex = ref(0);
2041
+ const homeTeam = ref({});
2042
+ const awayTeam = ref({});
2043
+ const eventsList = ref([]);
2044
+ const eventTypeSelected = ref({ value: "" });
2045
+ const eventsConnectionsToShow = ref([]);
2046
+ const eventsConnectionsBase = ref([]);
2047
+ const availablePlayersByTeamMap = ref(/* @__PURE__ */ new Map());
2048
+ const playersMap = ref(/* @__PURE__ */ new Map());
2049
+ const currentListType = ref("events");
2050
+ const playersSelected = ref(/* @__PURE__ */ new Set());
2051
+ const teamsSelected = ref(/* @__PURE__ */ new Set());
2052
+ const currentTeamGamesSelected = ref([]);
2053
+ const chalkboardDataPreMatchByTeam = /* @__PURE__ */ new Map();
2054
+ const selectedTeamData = ref({});
2055
+ const rivalTeams = ref({
2056
+ isSelected: true,
2057
+ colloquialName: "Rival"
2058
+ });
2059
+ const selectedGamesIds = ref(/* @__PURE__ */ new Set());
2060
+ const selectedGamesIdsPrivilegesVR = ref(/* @__PURE__ */ new Set());
2061
+ const gameTotalEventsIds = ref(/* @__PURE__ */ new Set());
2062
+ const lastGameFilledId = ref(0);
2063
+ const playsIdsUsed = /* @__PURE__ */ new Set();
2064
+ const isAssistantZoneVisible = ref(false);
2065
+ const toggleButtonsValues = computed(() => {
2066
+ return [
2067
+ {
2068
+ teamId: props.game.homeTeam.team_id,
2069
+ text: props.game.homeTeam.colloquial_name,
2070
+ img: props.game.homeTeam.logo,
2071
+ isHomeTeam: true
2072
+ },
2073
+ {
2074
+ teamId: props.game.awayTeam.team_id,
2075
+ text: props.game.awayTeam.colloquial_name,
2076
+ img: props.game.awayTeam.logo,
2077
+ isHomeTeam: false
2078
+ }
2079
+ ];
2080
+ });
2081
+ const totalCurrentEvents = computed(() => {
2082
+ return eventsConnectionsToShow.value.reduce((acc, eventsConnection) => {
2083
+ if (currentListType.value === "events" && teamsSelected.value.has(eventsConnection.mainPlay.teamId) || currentListType.value === "players" && playersSelected.value.has(eventsConnection.mainPlay.playerId)) {
2084
+ acc++;
2085
+ }
2086
+ return acc;
2087
+ }, 0);
2088
+ });
2089
+ const isPrivilegesVRApplicable = computed(() => {
2090
+ return props.isGamePreMatch && props.playVideosPrivileges;
2091
+ });
2092
+ const totalCurrentEventsPrivilegesVR = computed(() => {
2093
+ if (isPrivilegesVRApplicable.value) {
2094
+ return eventsConnectionsToShow.value.reduce((acc, eventsConnection) => {
2095
+ if ((currentListType.value === "events" && teamsSelected.value.has(eventsConnection.mainPlay.teamId) || currentListType.value === "players" && playersSelected.value.has(eventsConnection.mainPlay.playerId)) && selectedGamesIdsPrivilegesVR.value.has(eventsConnection.mainPlay.gameId)) {
2096
+ acc++;
2097
+ }
2098
+ return acc;
2099
+ }, 0);
2100
+ }
2101
+ return 0;
2102
+ });
2103
+ const totalEvents = computed(() => {
2104
+ return `${eventTypeSelected.value.name}: ${totalCurrentEvents.value}`;
2105
+ });
2106
+ const canPlayVideosChalkboard = computed(() => {
2107
+ if (props.isGamePreMatch) {
2108
+ return props.playVideosPrivileges ? getCanPlayVideosPreMatch() : props.canPlayVideos;
2109
+ } else {
2110
+ return props.playVideosPrivileges ? props.canPlayVideos && teamsSelected.value.has(props.playVideosPrivileges.seasonAndPrivileges.teamId) : props.canPlayVideos;
2111
+ }
2112
+ });
2113
+ watch(
2114
+ () => teamSelected.value.teamId,
2115
+ (newVal) => {
2116
+ if (props.isGamePreMatch && newVal) {
2117
+ if (selectedTeamData.value && !selectedTeamData.value.isSelected) {
2118
+ selectedTeamData.value.isSelected = true;
2119
+ }
2120
+ rivalTeams.value.isSelected = true;
2121
+ selectedTeamData.value = chalkboardDataPreMatchByTeam.get(newVal);
2122
+ const gamesSelectedIdsSet = /* @__PURE__ */ new Set();
2123
+ const availableTeamsIdsSet = /* @__PURE__ */ new Set();
2124
+ if (selectedTeamData.value) {
2125
+ selectedTeamData.value.games.forEach((game) => {
2126
+ if (game.isSelected) {
2127
+ gamesSelectedIdsSet.add(game.id);
2128
+ availableTeamsIdsSet.add(game.team.team_id);
2129
+ availableTeamsIdsSet.add(game.rivalTeam.team_id);
2130
+ }
2131
+ });
2132
+ onChangeGames({ gamesIds: gamesSelectedIdsSet, availableTeamsIds: availableTeamsIdsSet });
2133
+ }
2134
+ }
2135
+ },
2136
+ { immediate: true }
2137
+ );
2138
+ watch(
2139
+ () => props.game.gameId,
2140
+ (newVal) => {
2141
+ if (newVal) {
2142
+ homeTeam.value = { ...props.game.homeTeam, isSelected: true };
2143
+ awayTeam.value = { ...props.game.awayTeam, isSelected: true };
2144
+ gameTotalEventsIds.value = /* @__PURE__ */ new Set();
2145
+ deleteInterval();
2146
+ if (props.game.game_status === 4 && !props.game.is_live) {
2147
+ fillPlaysPreMatch();
2148
+ } else {
2149
+ fillPlays(newVal, props.game.is_live && props.game.game_status === 4);
2150
+ }
2151
+ }
2152
+ },
2153
+ { immediate: true }
2154
+ );
2155
+ watch(
2156
+ () => toggleButtonsValues.value,
2157
+ () => {
2158
+ teamButtonSelectedIndex.value = 0;
2159
+ teamSelected.value = toggleButtonsValues.value[teamButtonSelectedIndex.value];
2160
+ },
2161
+ { immediate: true, deep: true }
2162
+ );
2163
+ watch(
2164
+ () => eventTypeSelected.value.value,
2165
+ () => {
2166
+ if (props.isGamePreMatch) {
2167
+ fillEventsConnectionsToShowPreMatch();
2168
+ } else {
2169
+ availablePlayersByTeamMap.value = /* @__PURE__ */ new Map([
2170
+ [props.game.homeTeam.team_id, []],
2171
+ [props.game.awayTeam.team_id, []]
2172
+ ]);
2173
+ if (eventTypeSelected.value.name) {
2174
+ fillEventsConnectionsToShow(eventsConnectionsBase.value);
2175
+ }
2176
+ }
2177
+ },
2178
+ { immediate: true, deep: true }
2179
+ );
2180
+ function getCanPlayVideosPreMatch() {
2181
+ if (currentTeamGamesSelected.value) {
2182
+ if (teamSelected.value && props.playVideosPrivileges && props.playVideosPrivileges.seasonAndPrivileges && teamSelected.value.teamId === props.playVideosPrivileges.seasonAndPrivileges.teamId) {
2183
+ const validGamesCount = currentTeamGamesSelected.value.reduce((acc, game) => {
2184
+ if (game.home_team === teamSelected.value.teamId || game.visiting_team === teamSelected.value.teamId) {
2185
+ const playingAs = game.home_team === teamSelected.value.teamId ? 1 : 2;
2186
+ if (props.playVideosPrivileges.seasonAndPrivileges.playingAs.has(playingAs)) {
2187
+ acc++;
2188
+ }
2189
+ }
2190
+ return acc;
2191
+ }, 0);
2192
+ return validGamesCount > 0 && teamsSelected.value.has(teamSelected.value.teamId);
2193
+ }
2194
+ }
2195
+ return false;
2196
+ }
2197
+ function createInterval() {
2198
+ eventsInterval = setInterval(
2199
+ () => {
2200
+ fillPlays(props.game.gameId);
2201
+ },
2202
+ 1e3 * 60 * props.chalkboardIntervalMinutes
2203
+ );
2204
+ }
2205
+ function fillEventsConnectionsToShow(eventsConnections) {
2206
+ const availablePlayersIds = /* @__PURE__ */ new Set();
2207
+ eventsConnectionsToShow.value = [];
2208
+ eventsConnections.forEach((eventsConnection) => {
2209
+ if (eventsConnection.hasMainCategory(eventTypeSelected.value.categories)) {
2210
+ eventsConnection.setEventType(eventTypeSelected.value);
2211
+ eventsConnectionsToShow.value.push(eventsConnection);
2212
+ availablePlayersIds.add(eventsConnection.mainPlay.playerId);
2213
+ }
2214
+ });
2215
+ availablePlayersIds.forEach((playerId) => {
2216
+ const player = playersMap.value.get(playerId);
2217
+ if (player) {
2218
+ const teamPlayers = availablePlayersByTeamMap.value.get(player.team_id);
2219
+ const playerExists = teamPlayers.find(
2220
+ (teamPlayer) => teamPlayer.player_id === player.player_id
2221
+ );
2222
+ if (!playerExists) {
2223
+ teamPlayers.push({ ...player, isSelected: true });
2224
+ }
2225
+ }
2226
+ });
2227
+ }
2228
+ function deleteInterval() {
2229
+ if (eventsInterval) {
2230
+ clearInterval(eventsInterval);
2231
+ eventsInterval = null;
2232
+ }
2233
+ }
2234
+ function getPreMatchTeamData({
2235
+ isHomeTeam,
2236
+ acronym,
2237
+ team_id,
2238
+ team_name,
2239
+ colloquial_name,
2240
+ logo,
2241
+ categories,
2242
+ data,
2243
+ games,
2244
+ players,
2245
+ teams
2246
+ }) {
2247
+ const preMatchTeamData = {
2248
+ logo,
2249
+ acronym,
2250
+ categories,
2251
+ teamId: team_id,
2252
+ name: team_name,
2253
+ colloquialName: colloquial_name,
2254
+ isSelected: true,
2255
+ availablePlayersMap: /* @__PURE__ */ new Map()
2256
+ };
2257
+ const matchDayAbbreviations = namesAndAbbByTournamentTypeAndMatchDayId.get(
2258
+ props.tournamentSelected.tournament_type
2259
+ );
2260
+ const availableTeamsMap = Object.values(teams).reduce((acc, team) => {
2261
+ acc.set(team.team_id, { ...team, colloquial_name: team.colloquial_name || team.team_name });
2262
+ return acc;
2263
+ }, /* @__PURE__ */ new Map());
2264
+ const playersByTeamMap = Object.values(players).reduce((acc, player) => {
2265
+ preMatchTeamData.availablePlayersMap.set(player.player_id, { ...player });
2266
+ const teamPlayers = acc.get(player.team_id);
2267
+ if (teamPlayers) {
2268
+ teamPlayers.set(player.player_id, { ...player });
2269
+ } else {
2270
+ acc.set(player.team_id, /* @__PURE__ */ new Map([[player.player_id, { ...player }]]));
2271
+ }
2272
+ return acc;
2273
+ }, /* @__PURE__ */ new Map());
2274
+ const preMatchDataGamesMap = games.reduce((acc, game, index) => {
2275
+ const matchDayData = matchDayAbbreviations.get(game.matchday_id);
2276
+ const gameData = {
2277
+ ...game,
2278
+ dateTimeMillis: new Date(game.date_time_utc).getTime(),
2279
+ id: game.game_id,
2280
+ roundAbbreviation: matchDayData ? matchDayData.matchDayAbbreviation : "",
2281
+ playingAs: teamSelected.value.id === game.home_team ? 1 : 2,
2282
+ team: teamSelected.value.teamId === game.home_team ? availableTeamsMap.get(game.home_team) : availableTeamsMap.get(game.visiting_team),
2283
+ rivalTeam: teamSelected.value.teamId === game.home_team ? availableTeamsMap.get(game.visiting_team) : availableTeamsMap.get(game.home_team),
2284
+ homeTeam: availableTeamsMap.get(game.home_team),
2285
+ awayTeam: availableTeamsMap.get(game.visiting_team),
2286
+ playersSelected: /* @__PURE__ */ new Set(),
2287
+ eventsConnectionsBase: [],
2288
+ availablePlayersByTeamMap: /* @__PURE__ */ new Map([
2289
+ [game.home_team, playersByTeamMap.get(game.home_team)],
2290
+ [game.visiting_team, playersByTeamMap.get(game.visiting_team)]
2291
+ ]),
2292
+ availableTeamsByTeamMapSimple: /* @__PURE__ */ new Map([
2293
+ [game.home_team, Array.from(playersByTeamMap.get(game.home_team).values())],
2294
+ [game.visiting_team, Array.from(playersByTeamMap.get(game.visiting_team).values())]
2295
+ ]),
2296
+ teamsMap: /* @__PURE__ */ new Map([
2297
+ [game.home_team, availableTeamsMap.get(game.home_team)],
2298
+ [game.visiting_team, availableTeamsMap.get(game.visiting_team)]
2299
+ ]),
2300
+ isSelected: index < 4
2301
+ };
2302
+ acc.set(game.game_id, gameData);
2303
+ return acc;
2304
+ }, /* @__PURE__ */ new Map());
2305
+ const teamsForAnalysisMap = /* @__PURE__ */ new Map([
2306
+ [toggleButtonsValues.value[0].teamId, toggleButtonsValues.value[0]],
2307
+ [toggleButtonsValues.value[1].teamId, toggleButtonsValues.value[1]]
2308
+ ]);
2309
+ const allRelatedPlaysByGame = getAllRelatedPlaysByGame(data, preMatchDataGamesMap, isHomeTeam);
2310
+ preMatchTeamData.games = Array.from(preMatchDataGamesMap.values()).map((gameData) => {
2311
+ const eventsConnectionsBaseByGame = [];
2312
+ const relatedPlaysByGame = allRelatedPlaysByGame.get(gameData.id);
2313
+ if (relatedPlaysByGame) {
2314
+ Array.from(relatedPlaysByGame.values()).forEach((relatedPlay) => {
2315
+ if (relatedPlay.mainPlay) {
2316
+ relatedPlay.mainPlay.gameAux = {
2317
+ homeTeam: gameData.homeTeam,
2318
+ awayTeam: gameData.awayTeam
2319
+ };
2320
+ eventsConnectionsBaseByGame.push(
2321
+ new EventsConnection(
2322
+ relatedPlay.mainPlay,
2323
+ relatedPlay.events,
2324
+ relatedPlay.categoriesIds,
2325
+ relatedPlay.playersIds,
2326
+ {
2327
+ homeTeam: gameData.homeTeam,
2328
+ awayTeam: gameData.awayTeam,
2329
+ roundAbbreviation: gameData.roundAbbreviation
2330
+ },
2331
+ teamsForAnalysisMap.get(team_id)
2332
+ )
2333
+ );
2334
+ }
2335
+ });
2336
+ }
2337
+ return {
2338
+ ...gameData,
2339
+ eventsConnectionsBase: eventsConnectionsBaseByGame
2340
+ };
2341
+ });
2342
+ return preMatchTeamData;
2343
+ }
2344
+ async function fillPlaysPreMatch() {
2345
+ try {
2346
+ const preMatchGameTeamsData = await fetchPlaysDataPreMatch();
2347
+ preMatchGameTeamsData.forEach((teamData, index) => {
2348
+ if (index === 0) {
2349
+ teamData.isHomeTeam = true;
2350
+ }
2351
+ chalkboardDataPreMatchByTeam.set(teamData.team_id, getPreMatchTeamData(teamData));
2352
+ });
2353
+ if (selectedTeamData.value && !selectedTeamData.value.isSelected) {
2354
+ selectedTeamData.value.isSelected = true;
2355
+ }
2356
+ rivalTeams.value.isSelected = true;
2357
+ selectedTeamData.value = chalkboardDataPreMatchByTeam.get(teamSelected.value.teamId);
2358
+ } catch (e) {
2359
+ throw new Error(e);
2360
+ }
2361
+ }
2362
+ async function fillPlays(gameId, createIntervalFunc = false) {
2363
+ try {
2364
+ const isSameGame = gameId === lastGameFilledId.value;
2365
+ const { categories, data, players, teams } = await fetchPlaysData(gameId);
2366
+ let dataAux = data;
2367
+ const newEventsConnections = [];
2368
+ if (!isSameGame.value) {
2369
+ eventsList.value = categories;
2370
+ lastGameFilledId.value = gameId;
2371
+ eventsConnectionsBase.value = [];
2372
+ playsIdsUsed.clear();
2373
+ }
2374
+ dataAux = data.filter((play) => {
2375
+ const playId = `${play[chalkboardPlayIndexes.relatedPlayId]}-${play[chalkboardPlayIndexes.playId]}`;
2376
+ const isPlayUsed = playsIdsUsed.has(playId);
2377
+ if (!isPlayUsed) {
2378
+ playsIdsUsed.add(playId);
2379
+ }
2380
+ return !isPlayUsed;
2381
+ });
2382
+ playersMap.value = Object.values(players).reduce((acc, player) => {
2383
+ acc.set(player.player_id, { ...player });
2384
+ return acc;
2385
+ }, /* @__PURE__ */ new Map());
2386
+ const teamsMap = Object.values(teams).reduce((acc, team) => {
2387
+ acc.set(team.team_id, { ...team, isHomeTeam: props.game.homeTeam.team_id === team.team_id });
2388
+ return acc;
2389
+ }, /* @__PURE__ */ new Map());
2390
+ const relatedPlays = getAllRelatedPlays(dataAux, playersMap.value, teamsMap);
2391
+ Array.from(relatedPlays.values()).forEach((relatedPlay) => {
2392
+ if (relatedPlay.mainPlay) {
2393
+ relatedPlay.mainPlay.gameAux = {
2394
+ homeTeam: teamsMap.get(props.game.homeTeam.team_id),
2395
+ awayTeam: teamsMap.get(props.game.awayTeam.team_id)
2396
+ };
2397
+ const EventsConnectionObj = new EventsConnection(
2398
+ relatedPlay.mainPlay,
2399
+ relatedPlay.events,
2400
+ relatedPlay.categoriesIds,
2401
+ relatedPlay.playersIds
2402
+ );
2403
+ eventsConnectionsBase.value.push(EventsConnectionObj);
2404
+ newEventsConnections.push(EventsConnectionObj);
2405
+ }
2406
+ });
2407
+ if (newEventsConnections.length) {
2408
+ fillEventsConnectionsToShow(newEventsConnections);
2409
+ }
2410
+ if (createIntervalFunc) {
2411
+ createInterval();
2412
+ }
2413
+ } catch (e) {
2414
+ throw new Error(e);
2415
+ }
2416
+ }
2417
+ function getPlayObject(play) {
2418
+ return play.reduce((acc, value, index) => {
2419
+ acc[chalkboardPlayValues[index]] = value;
2420
+ return acc;
2421
+ }, {});
2422
+ }
2423
+ function getAllRelatedPlaysByGame(plays, dataGamesMap, isHomeTeam) {
2424
+ const relatedPlaysAux = plays.reduce((acc, play) => {
2425
+ const playObject = getPlayObject(play);
2426
+ const gameData = dataGamesMap.get(playObject.gameId);
2427
+ if (gameData) {
2428
+ const isMainPlay = playObject.relatedPlayId === playObject.playId;
2429
+ const relatedPlaysByGameId = acc.get(playObject.gameId);
2430
+ const playersByTeam = gameData.availablePlayersByTeamMap.get(playObject.teamId);
2431
+ if (!isHomeTeam) {
2432
+ playObject.x1 = 1 - playObject.x1;
2433
+ playObject.x2 = 1 - playObject.x2;
2434
+ playObject.x3 = 1 - playObject.x3;
2435
+ playObject.y1 = 1 - playObject.y1;
2436
+ playObject.y2 = 1 - playObject.y2;
2437
+ playObject.y3 = 1 - playObject.y3;
2438
+ }
2439
+ playObject.player = playersByTeam ? playersByTeam.get(playObject.playerId) : {};
2440
+ playObject.team = gameData.teamsMap.get(playObject.teamId) || {};
2441
+ if (relatedPlaysByGameId) {
2442
+ const relatedPlaysByPlayId = relatedPlaysByGameId.get(playObject.relatedPlayId);
2443
+ if (relatedPlaysByPlayId) {
2444
+ if (isMainPlay) {
2445
+ relatedPlaysByPlayId.mainPlay = playObject;
2446
+ }
2447
+ if (!relatedPlaysByPlayId.playsIds.has(playObject.playId)) {
2448
+ relatedPlaysByPlayId.events.push(playObject);
2449
+ relatedPlaysByPlayId.categoriesIds.add(playObject.categoryId);
2450
+ relatedPlaysByPlayId.playersIds.add(playObject.playerId);
2451
+ relatedPlaysByPlayId.playsIds.add(playObject.playId);
2452
+ relatedPlaysByPlayId.players.push(playObject.player);
2453
+ }
2454
+ } else {
2455
+ const relatedPlays = {
2456
+ events: [playObject],
2457
+ categoriesIds: /* @__PURE__ */ new Set([playObject.categoryId]),
2458
+ playersIds: /* @__PURE__ */ new Set([playObject.playerId]),
2459
+ playsIds: /* @__PURE__ */ new Set([playObject.playId]),
2460
+ players: [playObject.player]
2461
+ };
2462
+ if (isMainPlay) {
2463
+ relatedPlays.mainPlay = playObject;
2464
+ }
2465
+ relatedPlaysByGameId.set(playObject.relatedPlayId, relatedPlays);
2466
+ }
2467
+ } else {
2468
+ const relatedPlaysByPlayId = /* @__PURE__ */ new Map();
2469
+ const relatedPlaysByPlayIdAux = {
2470
+ events: [playObject],
2471
+ categoriesIds: /* @__PURE__ */ new Set([playObject.categoryId]),
2472
+ playersIds: /* @__PURE__ */ new Set([playObject.playerId]),
2473
+ playsIds: /* @__PURE__ */ new Set([playObject.playId]),
2474
+ players: [playObject.player]
2475
+ };
2476
+ if (isMainPlay) {
2477
+ relatedPlaysByPlayIdAux.mainPlay = playObject;
2478
+ }
2479
+ relatedPlaysByPlayId.set(playObject.relatedPlayId, relatedPlaysByPlayIdAux);
2480
+ acc.set(playObject.gameId, relatedPlaysByPlayId);
2481
+ }
2482
+ }
2483
+ return acc;
2484
+ }, /* @__PURE__ */ new Map());
2485
+ return relatedPlaysAux;
2486
+ }
2487
+ function getAllRelatedPlays(plays, playersMap2, teamsMap) {
2488
+ const relatedPlaysAux = plays.reduce((acc, play) => {
2489
+ const playObject = getPlayObject(play);
2490
+ const relatedPlaysByPlayId = acc.get(playObject.relatedPlayId);
2491
+ const isMainPlay = playObject.relatedPlayId === playObject.playId;
2492
+ playObject.player = playersMap2.get(playObject.playerId);
2493
+ playObject.team = teamsMap.get(playObject.teamId);
2494
+ if (relatedPlaysByPlayId) {
2495
+ if (isMainPlay) {
2496
+ relatedPlaysByPlayId.mainPlay = playObject;
2497
+ }
2498
+ if (!relatedPlaysByPlayId.playsIds.has(playObject.playId)) {
2499
+ relatedPlaysByPlayId.events.push(playObject);
2500
+ relatedPlaysByPlayId.categoriesIds.add(playObject.categoryId);
2501
+ relatedPlaysByPlayId.playersIds.add(playObject.playerId);
2502
+ relatedPlaysByPlayId.playsIds.add(playObject.playId);
2503
+ relatedPlaysByPlayId.players.push(playObject.player);
2504
+ }
2505
+ } else {
2506
+ const relatedPlays = {
2507
+ events: [playObject],
2508
+ categoriesIds: /* @__PURE__ */ new Set([playObject.categoryId]),
2509
+ playersIds: /* @__PURE__ */ new Set([playObject.playerId]),
2510
+ playsIds: /* @__PURE__ */ new Set([playObject.playId]),
2511
+ players: [playObject.player]
2512
+ };
2513
+ if (isMainPlay) {
2514
+ relatedPlays.mainPlay = playObject;
2515
+ }
2516
+ acc.set(playObject.relatedPlayId, relatedPlays);
2517
+ }
2518
+ return acc;
2519
+ }, /* @__PURE__ */ new Map());
2520
+ Array.from(relatedPlaysAux.values()).forEach((relatedPlay) => {
2521
+ relatedPlay.events.sort((a, b) => b.order - a.order);
2522
+ });
2523
+ return relatedPlaysAux;
2524
+ }
2525
+ async function fetchPlaysDataPreMatch() {
2526
+ try {
2527
+ const config = {
2528
+ headers: {
2529
+ Authorization: ""
2530
+ }
2531
+ };
2532
+ const [homeTeamResponse, awayTeamResponse] = await Promise.all([
2533
+ axios.get(
2534
+ `https://golstats-microservices.s3.us-west-2.amazonaws.com/chalkboard/chalkboard_${props.seasonSelected.id}_${props.game.homeTeam.team_id}.json`,
2535
+ config
2536
+ ),
2537
+ axios.get(
2538
+ `https://golstats-microservices.s3.us-west-2.amazonaws.com/chalkboard/chalkboard_${props.seasonSelected.id}_${props.game.awayTeam.team_id}.json`,
2539
+ config
2540
+ )
2541
+ ]);
2542
+ return [homeTeamResponse.data, awayTeamResponse.data];
2543
+ } catch (error) {
2544
+ throw new Error(error);
2545
+ }
2546
+ }
2547
+ async function fetchPlaysData(gameId) {
2548
+ try {
2549
+ const response = await axios.get(
2550
+ `https://df43gcr5d6.execute-api.us-east-2.amazonaws.com/prod/chalkboard/seasons/${props.seasonSelected.id}/games/${gameId}`,
2551
+ {
2552
+ headers: {
2553
+ Authorization: props.token
2554
+ }
2555
+ }
2556
+ );
2557
+ return response.data;
2558
+ } catch (error) {
2559
+ throw new Error(error);
2560
+ }
2561
+ }
2562
+ function fillEventsConnectionsToShowPreMatch() {
2563
+ if (selectedTeamData.value && selectedTeamData.value.games && selectedTeamData.value.games.length > 0) {
2564
+ const availablePlayersIds = /* @__PURE__ */ new Set();
2565
+ availablePlayersByTeamMap.value = /* @__PURE__ */ new Map();
2566
+ eventsConnectionsToShow.value = [];
2567
+ selectedTeamData.value.games.forEach((game) => {
2568
+ if (selectedGamesIds.value.has(game.id)) {
2569
+ game.eventsConnectionsBase.forEach((eventsConnection) => {
2570
+ if (eventsConnection.hasMainCategory(eventTypeSelected.value.categories)) {
2571
+ eventsConnection.setEventType(eventTypeSelected.value);
2572
+ eventsConnectionsToShow.value.push(eventsConnection);
2573
+ availablePlayersIds.add(eventsConnection.mainPlay.playerId);
2574
+ }
2575
+ });
2576
+ }
2577
+ });
2578
+ availablePlayersIds.forEach((playerId) => {
2579
+ const player = selectedTeamData.value.availablePlayersMap.get(playerId);
2580
+ if (player) {
2581
+ const teamPlayers = availablePlayersByTeamMap.value.get(player.team_id);
2582
+ if (teamPlayers) {
2583
+ if (!teamPlayers.find((teamPlayer) => teamPlayer.player_id === player.player_id)) {
2584
+ teamPlayers.push({ ...player, isSelected: true });
2585
+ }
2586
+ } else {
2587
+ availablePlayersByTeamMap.value.set(player.team_id, [{ ...player, isSelected: true }]);
2588
+ }
2589
+ }
2590
+ });
2591
+ }
2592
+ }
2593
+ function onChangeEventType(eventType) {
2594
+ eventTypeSelected.value = eventType;
2595
+ }
2596
+ function onChangeListType(listType) {
2597
+ currentListType.value = listType;
2598
+ if (listType === "events") {
2599
+ homeTeam.value.isSelected = true;
2600
+ awayTeam.value.isSelected = true;
2601
+ }
2602
+ }
2603
+ function onChangePlayers(players) {
2604
+ playersSelected.value = players;
2605
+ }
2606
+ function onChangeTeams(teams) {
2607
+ teamsSelected.value = teams;
2608
+ }
2609
+ function onChangeGames({ gamesIds, availableTeamsIds, currentTeamGamesSelected: gamesSelected }) {
2610
+ selectedGamesIds.value = gamesIds;
2611
+ teamsSelected.value = availableTeamsIds;
2612
+ currentTeamGamesSelected.value = gamesSelected;
2613
+ if (props.isGamePreMatch) {
2614
+ selectedGamesIdsPrivilegesVR.value.clear();
2615
+ if (props.playVideosPrivileges && props.playVideosPrivileges.seasonAndPrivileges) {
2616
+ gamesSelected.forEach((game) => {
2617
+ const playingAs = game.home_team === props.playVideosPrivileges.seasonAndPrivileges.teamId ? 1 : game.visiting_team === props.playVideosPrivileges.seasonAndPrivileges.teamId ? 2 : 0;
2618
+ if (props.playVideosPrivileges.seasonAndPrivileges.playingAs.has(playingAs)) {
2619
+ selectedGamesIdsPrivilegesVR.value.add(game.game_id);
2620
+ }
2621
+ });
2622
+ } else {
2623
+ selectedGamesIdsPrivilegesVR.value = gamesIds;
2624
+ }
2625
+ }
2626
+ fillEventsConnectionsToShowPreMatch();
2627
+ }
2628
+ function onChangeToggle(value) {
2629
+ teamButtonSelectedIndex.value = value.index;
2630
+ teamSelected.value = value.button;
2631
+ }
2632
+ function onClickPlay(categoriesIds) {
2633
+ const modalInitialState = {
2634
+ seasonId: props.game.is_live || props.game.game_status === 0 ? props.game.seasonId : props.seasonSelected.id,
2635
+ isFeaturedPlayers: false,
2636
+ // para indicar si es de la seccion jugadores destacados
2637
+ mainSectionType: 1,
2638
+ // 1 = videoplayer, 2 = my playlists
2639
+ playListType: (
2640
+ /*props.isGamePreMatch ? 3 :*/
2641
+ 1
2642
+ ),
2643
+ // 1 = partidos, 2 = jugadores, 3 = equipos
2644
+ gameIdsToFilter: props.isGamePreMatch ? Array.from(selectedGamesIds.value.values()) : [props.game.gameId],
2645
+ // array de id de partido, en caso de no ser necesario dejar en null
2646
+ playerIds: [],
2647
+ // ids de jugador, en caso de no ser necesario dejar array vacio
2648
+ teamIdsToFilter: Array.from(teamsSelected.value.values()),
2649
+ // ids de equipos a ser filtrados
2650
+ categoryIds: categoriesIds,
2651
+ // son los ids de las categorias a ser pedidas
2652
+ teamId: props.isGamePreMatch ? (
2653
+ /*teamSelected.value.teamId*/
2654
+ null
2655
+ ) : teamsSelected.value.size === 1 ? Array.from(teamsSelected.value)[0] : 0,
2656
+ // id de equipo, en caso de no ser necesario dejar en null
2657
+ matchResult: [1, 2, 3],
2658
+ // 1 = gana, 2 = pierde, 3 = empate.
2659
+ currentPlayIndex: 0
2660
+ };
2661
+ emit("open-media-player", modalInitialState);
2662
+ }
2663
+ return (_ctx, _cache) => {
2664
+ return openBlock(), createElementBlock("div", _hoisted_1, [
2665
+ __props.isGamePreMatch ? (openBlock(), createElementBlock("div", _hoisted_2, [
2666
+ __props.widthSection > 590 ? (openBlock(), createElementBlock("div", _hoisted_3, [
2667
+ _hoisted_4,
2668
+ createTextVNode("  Con base en las estadísticas de los partidos ya jugados en el torneo. ")
2669
+ ])) : createCommentVNode("", true),
2670
+ __props.widthSection > 340 && __props.widthSection <= 590 ? (openBlock(), createElementBlock("div", _hoisted_5, [
2671
+ _hoisted_6,
2672
+ createTextVNode("  "),
2673
+ _hoisted_7,
2674
+ createTextVNode("Con base en las estadísticas de los partidos ya "),
2675
+ _hoisted_8,
2676
+ createTextVNode(" jugados en el torneo. ")
2677
+ ])) : createCommentVNode("", true),
2678
+ __props.widthSection <= 340 ? (openBlock(), createElementBlock("div", _hoisted_9, [
2679
+ _hoisted_10,
2680
+ createTextVNode("  "),
2681
+ _hoisted_11,
2682
+ createTextVNode("Con base en las estadísticas de los "),
2683
+ _hoisted_12,
2684
+ createTextVNode("partidos ya jugados en el torneo. ")
2685
+ ])) : createCommentVNode("", true),
2686
+ createElementVNode("div", {
2687
+ class: normalizeClass(
2688
+ __props.widthSection > 420 ? "container-switch-pre-match-teams" : "container-switch-pre-match-teams-mobile"
2689
+ )
2690
+ }, [
2691
+ createVNode(ToggleButtons, {
2692
+ "selected-button-index": teamButtonSelectedIndex.value,
2693
+ buttons: toggleButtonsValues.value,
2694
+ width: "320px",
2695
+ "border-radius": "16px",
2696
+ onChange: onChangeToggle
2697
+ }, null, 8, ["selected-button-index", "buttons"])
2698
+ ], 2)
2699
+ ])) : createCommentVNode("", true),
2700
+ createElementVNode("div", _hoisted_13, [
2701
+ createElementVNode("div", _hoisted_14, [
2702
+ createElementVNode("div", _hoisted_15, [
2703
+ createElementVNode("div", _hoisted_16, [
2704
+ createVNode(unref(GSCCheckbox), {
2705
+ modelValue: isAssistantZoneVisible.value,
2706
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isAssistantZoneVisible.value = $event),
2707
+ label: "Mostrar zona de asistencia"
2708
+ }, null, 8, ["modelValue"])
2709
+ ]),
2710
+ createVNode(SoccerChalkboard, {
2711
+ "events-connections": eventsConnectionsToShow.value,
2712
+ "list-type": currentListType.value,
2713
+ "players-selected": playersSelected.value,
2714
+ "teams-selected": teamsSelected.value,
2715
+ "is-game-pre-match": __props.isGamePreMatch,
2716
+ "is-assistant-zone-visible": isAssistantZoneVisible.value
2717
+ }, null, 8, ["events-connections", "list-type", "players-selected", "teams-selected", "is-game-pre-match", "is-assistant-zone-visible"])
2718
+ ]),
2719
+ createElementVNode("div", _hoisted_17, [
2720
+ createVNode(EventsTimeLine, {
2721
+ "events-connections": eventsConnectionsToShow.value,
2722
+ "list-type": currentListType.value,
2723
+ "players-selected": playersSelected.value,
2724
+ "teams-selected": teamsSelected.value,
2725
+ "is-game-pre-match": __props.isGamePreMatch
2726
+ }, null, 8, ["events-connections", "list-type", "players-selected", "teams-selected", "is-game-pre-match"])
2727
+ ]),
2728
+ createElementVNode("div", _hoisted_18, toDisplayString(totalEvents.value), 1)
2729
+ ]),
2730
+ createElementVNode("div", _hoisted_19, [
2731
+ createVNode(CategoriesList, {
2732
+ "is-female": __props.isFemale,
2733
+ "home-team": homeTeam.value,
2734
+ "away-team": awayTeam.value,
2735
+ "tournament-selected": __props.tournamentSelected,
2736
+ "list-events-to-display": eventsList.value,
2737
+ "available-players-by-team": availablePlayersByTeamMap.value,
2738
+ "list-type": currentListType.value,
2739
+ "can-play-videos": canPlayVideosChalkboard.value,
2740
+ "is-game-pre-match": __props.isGamePreMatch,
2741
+ "selected-team-data": selectedTeamData.value,
2742
+ "rival-teams": rivalTeams.value,
2743
+ "team-selected": teamSelected.value,
2744
+ "total-events": totalCurrentEvents.value,
2745
+ "total-events-privileges-vr": totalCurrentEventsPrivilegesVR.value,
2746
+ "is-privileges-vr-applicable": isPrivilegesVRApplicable.value,
2747
+ "await-for-list-events": "",
2748
+ onChangeEventType,
2749
+ onChangeListType,
2750
+ onChangePlayers,
2751
+ onChangeTeams,
2752
+ onChangeGames,
2753
+ onClickPlay
2754
+ }, null, 8, ["is-female", "home-team", "away-team", "tournament-selected", "list-events-to-display", "available-players-by-team", "list-type", "can-play-videos", "is-game-pre-match", "selected-team-data", "rival-teams", "team-selected", "total-events", "total-events-privileges-vr", "is-privileges-vr-applicable"])
2755
+ ])
2756
+ ])
2757
+ ]);
2758
+ };
2759
+ }
2760
+ };
2761
+ const ChalkboardSectionContainer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-96de1508"]]);
2762
+ export {
2763
+ ChalkboardSectionContainer as C,
2764
+ ToggleButtons as T,
2765
+ _imports_0 as _,
2766
+ getTeamLogoUrl as a,
2767
+ getTeamFilterOptions as b,
2768
+ areTwoArraysEquals as c,
2769
+ getPlayValueIndexesFromArray as g,
2770
+ toFixedTwoDigitsMax as t
2771
+ };