1/* Minification failed. Returning unminified contents. 2(4817,23-24): run-time error JS1005: Expected '(': { 3(4818,21-27): run-time error JS1009: Expected '}': return 4(4818,21-27): run-time error JS1006: Expected ')': return 5(4818,21-27): run-time error JS1008: Expected '{': return 6(4828,23-24): run-time error JS1005: Expected '(': { 7(4829,21-27): run-time error JS1009: Expected '}': return 8(4829,21-27): run-time error JS1006: Expected ')': return 9(4829,21-27): run-time error JS1008: Expected '{': return 10 */ 11(function () { 12 'use strict'; 13 14 angular 15 .module('app.services', []) 16 .config(config); 17 18 config.$inject = ['$translatePartialLoaderProvider']; 19 20 function config($translatePartialLoaderProvider) { 21 if (__environment__ !== 'local') { 22 $translatePartialLoaderProvider.addPart('app'); 23 24 } else { 25 $translatePartialLoaderProvider.addPart('app/core/services/solution'); 26 $translatePartialLoaderProvider.addPart('app/core/services/scoreboard');
27 $translatePartialLoaderProvider.addPart('app/core/services/website'); 28 } 29 } 30})();; 31(function () { 32 'use strict'; 33 34 angular 35 .module('app.services') 36 .factory('AuthenticationService', authenticationService); 37 38 authenticationService.$inject = ['$http', '$q', '$sessionStorage']; 39 40 function authenticationService($http, $q, $sessionStorage) { 41 return { 42 login: login, 43 loginWithToken: loginWithToken, 44 loginSolution: loginSolution, 45 logout: logout 46 } 47 48 function login(credential) { 49 return $q(function (resolve, reject) { 50 $http.post(`${$sessionStorage.configurations.servers.rest}/api/authentication`, angular.toJson(credential)) 51 .then(function (response) { 52 resolve(response); 53 }, function (response) { 54 reject(response); 55 }); 56 }); 57 } 58 59 function loginWithToken(token) { 60 return $q(function (resolve, reject) { 61 $http.post(`${$sessionStorage.configurations.servers.rest}/api/authentication/token`, null, { headers: { '__token__': token } }) 62 .then(function (response) { 63 resolve(response); 64 }, function (response) { 65 reject(response); 66 }); 67 }); 68 } 69 70 function logout(sessionToken) { 71 return $q(function (resolve, reject) { 72 $http.post(`${$sessionStorage.configurations.servers.rest}/api/authentication/signout`, null, { headers: { '__KreezeeSession__': angular.toJson(sessionToken) } }) 73 .then(function (response) { 74 resolve(response); 75 }, function (response) { 76 reject(response); 77 }); 78 }); 79 } 80 81 function loginSolution(credential, solutionId) { 82 return $q(function (resolve, reject) { 83 $http.post(`${$sessionStorage.configurations.servers.rest}/api/authentication/solution/${solutionId}`, angular.toJson(credential)) 84 .then(function (response) { 85 resolve(response); 86 }, function (response) { 87 reject(response); 88 }); 89 }); 90 } 91 } 92})();; 93(function () { 94 'use strict'; 95 96 angular 97 .module('app.services') 98 .factory('FacilityService', facilityService); 99 100 facilityService.$inject = ['$http', '$q', '$sessionStorage']; 101 102 function facilityService($http, $q, $sessionStorage) { 103 return { 104 getFacilitiesBySolutionId: getFacilitiesBySolutionId, 105 getFacilitiesDetailsBySolutionId: getFacilitiesDetailsBySolutionId, 106 getFacilityStatById: getFacilityStatById, 107 getFacilitiesStats: getFacilitiesStats, 108 getFacilitiesDetailsWithUpdateDate: getFacilitiesDetailsWithUpdateDate 109 } 110 111 function getFacilityStatById(statId) { 112 switch (statId) { 113 case 1: 114 return { id: 1, name: 'directives.widgets.facility.list.labels.name' }; 115 116 case 2: 117 return { id: 2, name: 'directives.widgets.facility.list.labels.abbreviation' }; 118 119 case 3: 120 return { id: 3, name: 'directives.widgets.facility.list.labels.type' }; 121 122 case 4: 123 return { id: 4, name: 'directives.widgets.facility.list.labels.status' }; 124 125 case 5: 126 return { id: 5, name: 'directives.widgets.facility.list.labels.note' }; 127 128 case 6: 129 return { id: 6, name: 'directives.widgets.facility.list.labels.address' }; 130 131 case 7: 132 return { id: 7, name: 'directives.widgets.facility.list.labels.city' }; 133 134 case 8: 135 return { id: 8, name: 'directives.widgets.facility.list.labels.state' }; 136 137 case 9: 138 return { id: 9, name: 'directives.widgets.facility.list.labels.phone' }; 139 140 default: 141 return null; 142 } 143 } 144 145 function getFacilitiesStats() { 146 return [1, 2, 3, 4, 5, 6, 7, 8, 9].map(function (id) { 147 return getFacilityStatById(id); 148 }) 149 } 150 151 function getFacilitiesBySolutionId(solutionId) { 152 return $q(function (resolve, reject) { 153 // TODO Rename rest service «facilities» 154 $http.get(`api/v2/solutions/${solutionId}/facilities`) 155 .then(function (response) { 156 resolve(response); 157 }, function (response) { 158 reject(response); 159 }); 160 }); 161 } 162 163 function getFacilitiesDetailsBySolutionId(solutionId) { 164 return $q(function (resolve, reject) { 165 // TODO Rename rest service «facilities» 166 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/facility/details`) 167 .then(function (response) { 168 resolve(response); 169 }, function (response) { 170 reject(response); 171 }); 172 }); 173 } 174 175 function getFacilitiesDetailsWithUpdateDate(solutionId) { 176 return $q(function (resolve, reject) { 177 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/facility/status`) 178 .then(function (response) { 179 resolve(response); 180 }, function (response) { 181 reject(response); 182 }); 183 }); 184 } 185 } 186})();; 187(function () { 188 'use strict'; 189 190 angular 191 .module('app.services') 192 .factory('GoogleMapService', googleMapService); 193 194 googleMapService.$inject = []; 195 196 function googleMapService() { 197 return { 198 getMapSearchUrl: getMapSearchUrl 199 } 200 201 function getMapSearchUrl(query) { 202 var parameters = query 203 .replace(/[,]+/g, '%2C') 204 .replace(/[ ]+/g, '+'); 205 206 return `https://www.google.com/maps/search/?api=1&query=${parameters}`; 207 } 208 } 209})();; 210(function () { 211 'use strict'; 212 213 angular 214 .module('app.services') 215 .factory('GoogleWebFontsService', googleWebFontsService); 216 217 googleWebFontsService.$inject = ['$http', '$q']; 218 219 function googleWebFontsService($http, $q) { 220 var googleWebFont = null; 221 var apiKey = "AIzaSyAD95_4CBGbo3H-0AUzPKr3pg7D13OxoC0"; 222 223 return { 224 getWebFonts: getWebFonts 225 } 226 227 function getWebFonts(sort) { 228 if (!googleWebFont) { 229 googleWebFont = $q(function (resolve, reject) { 230 $http.get(`https://www.googleapis.com/webfonts/v1/webfonts?key=${apiKey}&sort=${sort}`) 231 .then(function (response) { 232 resolve(response); 233 }, function (response) { 234 reject(response); 235 }); 236 }); 237 } 238 return googleWebFont; 239 } 240 } 241})();; 242(function () { 243 'use strict'; 244 245 angular 246 .module('app.services') 247 .factory('DocumentService', documentService); 248 249 documentService.$inject = ['$http', '$q']; 250 251 function documentService($http, $q) { 252 return { 253 getDocumentsBySolutionId: getDocumentsBySolutionId 254 } 255 256 function getDocumentsBySolutionId(solutionId) { 257 return $q(function (resolve, reject) { 258 $http.get(`/api/v2/website/${solutionId}/documents`) 259 .then(function (response) { 260 resolve(response); 261 }, function (response) { 262 reject(response); 263 }); 264 }); 265 } 266 } 267})();; 268(function () { 269 'use strict'; 270 271 angular 272 .module('app.services') 273 .factory('NewsService', newsService); 274 275 newsService.$inject = ['$http', '$q']; 276 277 function newsService($http, $q) { 278 return { 279 getNewsBySolutionId: getNewsBySolutionId, 280 getNewsBySolutionTags: getNewsBySolutionTags 281 } 282 283 function getNewsBySolutionId(solutionId, options) { 284 var queryString = ''; 285 286 if (options) { 287 for (var option in options) { 288 if (queryString) { 289 queryString += '&' 290 } 291 292 queryString += `${option}=${encodeURI(options[option])}`; 293 } 294 } 295 296 return $q(function (resolve, reject) { 297 $http.get(`api/v2/solutions/${solutionId}/news?${queryString}`) 298 .then(function (response) { 299 resolve(response); 300 }, function (response) { 301 reject(response); 302 }); 303 }); 304 } 305 306 function getNewsBySolutionTags(solutionId, options) { 307 var queryString = ''; 308 309 if (options) { 310 for (var option in options) { 311 if (queryString) { 312 queryString += '&' 313 } 314 315 if (angular.isArray(options[option])) { 316 var tagsQuery = []; 317 for (var optionValue in options[option]) { 318 tagsQuery.push(`${option}=${encodeURI(options[option][optionValue])}`); 319 } 320 321 if (tagsQuery.length > 0) { 322 queryString += tagsQuery.join("&"); 323 } 324 } 325 else { 326 queryString += `${option}=${encodeURI(options[option])}`; 327 } 328 } 329 } 330 331 return $q(function (resolve, reject) { 332 $http.get(`api/v2/solutions/${solutionId}/news/tags?${queryString}`) 333 .then(function (response) { 334 resolve(response); 335 }, function (response) { 336 reject(response); 337 }); 338 }); 339 } 340 } 341})();; 342(function () { 343 'use strict'; 344 345 angular 346 .module('app.services') 347 .factory('PhotoService', photoService); 348 349 photoService.$inject = ['$http', '$q']; 350 351 function photoService($http, $q) { 352 return { 353 getPhotosBySolutionId: getPhotosBySolutionId 354 } 355 356 function getPhotosBySolutionId(solutionId, options) { 357 var queryString = ''; 358 359 if (options) { 360 for (var option in options) { 361 if (queryString) { 362 queryString += '&' 363 } 364 365 queryString += `${option}=${encodeURI(options[option])}`; 366 } 367 } 368 369 return $q(function (resolve, reject) { 370 $http.get(`api/v2/solutions/${solutionId}/photos?${queryString}`) 371 .then(function (response) { 372 resolve(response); 373 }, function (response) { 374 reject(response); 375 }); 376 }); 377 } 378 } 379})();; 380(function () { 381 'use strict'; 382 383 angular 384 .module('app.services') 385 .factory('VideoService', videoService); 386 387 videoService.$inject = ['$http', '$q']; 388 389 function videoService($http, $q) { 390 return { 391 getVideosBySolutionId: getVideosBySolutionId 392 } 393 394 function getVideosBySolutionId(solutionId, options) { 395 var queryString = ''; 396 397 if (options) { 398 for (var option in options) { 399 if (queryString) { 400 queryString += '&' 401 } 402 403 queryString += `${option}=${encodeURI(options[option])}`; 404 } 405 } 406 407 return $q(function (resolve, reject) { 408 $http.get(`api/v2/solutions/${solutionId}/videos?${queryString}`) 409 .then(function (response) { 410 resolve(response); 411 }, function (response) { 412 reject(response); 413 }); 414 }); 415 } 416 } 417})();; 418(function () { 419 'use strict'; 420 421 angular 422 .module('app.services') 423 .factory('StripeConnectService', StripeConnectService); 424 425 StripeConnectService.$inject = ['$http', '$q']; 426 427 function StripeConnectService($http, $q) { 428 429 return { 430 getStripeConnectBySolutionId: getStripeConnectBySolutionId 431 }; 432 433 function getStripeConnectBySolutionId(solutionId) { 434 return $q(function (resolve, reject) { 435 $http.get(`/api/v2/payment/${solutionId}/stripe/connect`) 436 .then(function (response) { 437 resolve(response); 438 }, function (response) { 439 reject(response); 440 }); 441 }); 442 } 443 } 444})();; 445(function () { 446 'use strict'; 447 448 angular 449 .module('app.services') 450 .factory('ScheduleService', scheduleService); 451 452 scheduleService.$inject = ['$http', '$q']; 453 454 function scheduleService($http, $q) { 455 return { 456 getScheduleBySolutionId: getScheduleBySolutionId, 457 getScheduleBySeasonId: getScheduleBySeasonId 458 } 459 460 function getScheduleBySolutionId(solutionId, options) { 461 var queryString = ''; 462 463 if (options) { 464 for (var option in options) { 465 if (queryString) { 466 queryString += '&' 467 } 468 469 queryString += `${option}=${encodeURI(options[option])}`; 470 } 471 } 472 473 return $q(function (resolve, reject) { 474 $http.get(`/api/v2/solutions/${solutionId}/schedule?${queryString}`) 475 .then(function (response) { 476 resolve(response); 477 }, function (response) { 478 reject(response); 479 }); 480 }); 481 } 482 483 function getScheduleBySeasonId(solutionId, seasonId, options) { 484 var queryString = ''; 485 486 if (options) { 487 for (var option in options) { 488 if (queryString) { 489 queryString += '&' 490 } 491 492 queryString += `${option}=${encodeURI(options[option])}`; 493 } 494 } 495 496 return $q(function (resolve, reject) { 497 $http.get(`/api/v2/solutions/${solutionId}/seasons/${seasonId}/schedule?${queryString}`) 498 .then(function (response) { 499 resolve(response); 500 }, function (response) { 501 reject(response); 502 }); 503 }); 504 } 505 } 506})();; 507(function () { 508 'use strict'; 509 510 angular 511 .module('app.services') 512 .factory('ScoreboardBaseballService', scoreboardBaseballService); 513 514 scoreboardBaseballService.$inject = ['$http', '$q', '$
514sessionStorage']; 515 516 function scoreboardBaseballService($http, $q, $sessionStorage) { 517 var latestScoreboardBaseball = { v: 0, promise: null }; 518 519 return { 520 getScoreboardBaseball: getScoreboardBaseball, 521 getDefensePositions: getDefensePositions, 522 getPositionTranslation: getPositionTranslation, 523 getScoreboardBaseballStatsHistory: getScoreboardBaseballStatsHistory, 524 getScoreboardBaseballInningSummary: getScoreboardBaseballInningSummary, 525 getLineupBaseball: getLineupBaseball, 526 putLineupBaseball, 527 getGroup: getGroup, 528 getType: getType, 529 getCategory: getCategory, 530 updateSequence: updateSequence, 531 putSequence: putSequence, 532 startGame: startGame, 533 switchDesignatedHitter: switchDesignatedHitter, 534 resetGame: resetGame, 535 substitutePlayer: substitutePlayer, 536 rollbackSequence: rollbackSequence, 537 closeGame: closeGame, 538 addPitch: addPitch 539 } 540 541 function getDefensePositions() { 542 return [ 543 { id: 0, name: "retired", text: "services.scoreboard.baseball.retired.description", abbreviation: "services.scoreboard.baseball.retired.abbreviation" }, 544 { id: 1, name: "pitcher", text: "services.scoreboard.baseball.pitcher.description", abbreviation: "services.scoreboard.baseball.pitcher.abbreviation" }, 545 { id: 2, name: "catcher", text: "services.scoreboard.baseball.catcher.description", abbreviation: "services.scoreboard.baseball.catcher.abbreviation" }, 546 { id: 3, name: "firstbase", text: "services.scoreboard.baseball.firstbase.description", abbreviation: "services.scoreboard.baseball.firstbase.abbreviation" }, 547 { id: 4, name: "secondbase", text: "services.scoreboard.baseball.secondbase.description", abbreviation: "services.scoreboard.baseball.secondbase.abbreviation" }, 548 { id: 5, name: "thirdbase", text: "services.scoreboard.baseball.thirdbase.description", abbreviation: "services.scoreboard.baseball.thirdbase.abbreviation" }, 549 { id: 6, name: "shortstop", text: "services.scoreboard.baseball.shortstop.description", abbreviation: "services.scoreboard.baseball.shortstop.abbreviation" }, 550 { id: 7, name: "fieldleft", text: "services.scoreboard.baseball.fieldleft.description", abbreviation: "services.scoreboard.baseball.fieldleft.abbreviation" }, 551 { id: 8, name: "fieldcenter", text: "services.scoreboard.baseball.fieldcenter.description", abbreviation: "services.scoreboard.baseball.fieldcenter.abbreviation" }, 552 { id: 9, name: "fieldright", text: "services.scoreboard.baseball.fieldright.description", abbreviation: "services.scoreboard.baseball.fieldright.abbreviation" }, 553 { id: 10, name: "designatedhitter", text: "services.scoreboard.baseball.designatedhitter.description", abbreviation: "services.scoreboard.baseball.designatedhitter.abbreviation" }, 554 { id: 14, name: "pinchhitter", text: "services.scoreboard.baseball.pinchhitter.description", abbreviation: "services.scoreboard.baseball.pinchhitter.abbreviation" }, 555 { id: 15, name: "pinchrunner", text: "services.scoreboard.baseball.pinchrunner.description", abbreviation: "services.scoreboard.baseball.pinchrunner.abbreviation" }, 556 { id: 16, name: "extrahitter", text: "services.scoreboard.baseball.extrahitter.description", abbreviation: "services.scoreboard.baseball.extrahitter.abbreviation" } 557 ] 558 } 559 560 function getPositionTranslation(position) { 561 return { 562 description: `services.scoreboard.baseball.${position}.description`, 563 abbreviation: `services.scoreboard.baseball.${position}.abbreviation` 564 } 565 } 566 567 function getGroup(group) { 568 return `services.scoreboard.baseball.group.${group}`; 569 } 570 571 function getType(group) { 572 return `services.scoreboard.baseball.type.${group}`; 573 } 574 575 function getCategory(group) { 576 return `services.scoreboard.baseball.category.${group}`; 577 } 578 579 function getScoreboardBaseball(solutionId, gameId, version) { 580 function getPromise() { 581 return $q(function (resolve, reject) { 582 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboard/baseball/${gameId}`) 583 .then(function (response) { 584 resolve(response); 585 }, function (response) { 586 reject(response); 587 }); 588 }); 589 } 590 591 if (version) { 592 if (version <= latestScoreboardBaseball.v) { 593 return latestScoreboardBaseball.promise; 594 } 595 else { 596 var promise = getPromise(); 597 latestScoreboardBaseball.v = version; 598 latestScoreboardBaseball.promise = promise; 599 return promise; 600 } 601 } 602 603 return getPromise(); 604 } 605 606 function getScoreboardBaseballStatsHistory(solutionId, gameId) { 607 return $q(function (resolve, reject) { 608 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/event/game/baseball/inning/${gameId}`) 609 .then(function (response) { 610 resolve(response); 611 }, function (response) { 612 reject(response); 613 }); 614 }); 615 } 616 617 function getScoreboardBaseballInningSummary(solutionId, gameId, periodId, posId) { 618 return $q(function (resolve, reject) { 619 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/event/game/baseball/inning/${gameId}
619/summary/period/${periodId}/pos/${posId}`) 620 .then(function (response) { 621 resolve(response); 622 }, function (response) { 623 reject(response); 624 }); 625 }); 626 } 627 628 function getLineupBaseball(solutionId, gameId) { 629 return $q(function (resolve, reject) { 630 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/lineup/baseball/starting/${gameId}`) 631 .then(function (response) { 632 resolve(response); 633 }, function (response) { 634 reject(response); 635 }); 636 }); 637 } 638 639 function putLineupBaseball(solutionId, gameId, startingLineup) { 640 return $q(function (resolve, reject) { 641 $http.put(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/lineup/baseball/starting/${gameId}`, startingLineup) 642 .then(function (response) { 643 resolve(response); 644 }, function (response) { 645 reject(response); 646 }); 647 }); 648 } 649 650 function updateSequence(solutionId, sequence) { 651 return $q(function (resolve, reject) { 652 $http.put(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/event/baseball`, sequence) 653 .then(function (response) { 654 resolve(response); 655 }, function (response) { 656 reject(response); 657 }); 658 }); 659 } 660 661 function putSequence(solutionId, gameId, sequence) { 662 return $q(function (resolve, reject) { 663 $http.put(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/event/baseball/game/${gameId}/sequence`, sequence) 664 .then(function (response) { 665 resolve(response); 666 }, function (response) { 667 reject(response); 668 }); 669 }); 670 } 671 672 function startGame(solutionId, gameId) { 673 return $q(function (resolve, reject) { 674 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboard/baseball/start/${gameId}`) 675 .then(function (response) { 676 resolve(response); 677 }, function (response) { 678 reject(response); 679 }); 680 }); 681 } 682 683 function switchDesignatedHitter(solutionId, sequence) { 684 return $q(function (resolve, reject) { 685 $http.put(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/event/baseball/switchdesignatedhitter`, sequence) 686 .then(function (response) { 687 resolve(response); 688 }, function (response) { 689 reject(response); 690 }); 691 }); 692 } 693 694 function resetGame(solutionId, gameId, keepPitchCount = false) { 695 var endpoint = `${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboard/baseball/reset/${gameId}`; 696 697 if (keepPitchCount) { 698 endpoint = `${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboard/baseball/reset/${gameId}/pitch-count` 699 } 700 701 return $q(function (resolve, reject) { 702 $http.post(endpoint) 703 .then(function (response) { 704 resolve(response); 705 }, function (response) { 706 reject(response); 707 }); 708 }); 709 } 710 711 function substitutePlayer(solutionId, gameId, substitution) { 712 return $q(function (resolve, reject) { 713 $http.put(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/lineup/baseball/${gameId}/substitution`, substitution) 714 .then(function (response) { 715 resolve(response); 716 }, function (response) { 717 reject(response); 718 }); 719 }); 720 } 721 722 function rollbackSequence(solutionId, sequence) { 723 return $q(function (resolve, reject) { 724 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/event/baseball/rollback`, sequence) 725 .then(function (response) { 726 resolve(response); 727 }, function (response) { 728 reject(response); 729 }); 730 }); 731 } 732 733 function closeGame(solutionId, gameId) { 734 return $q(function (resolve, reject) { 735 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboard/baseball/close/${gameId}`) 736 .then(function (response) { 737 resolve(response); 738 }, function (response) { 739 reject(response); 740 }); 741 }); 742 } 743 744 function addPitch(solutionId, gameId, sequenceId, pitch) { 745 return $q(function (resolve, reject) { 746 $http.put(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/event/baseball/game/${gameId}/sequence/${sequenceId}/pitch`, pitch) 747 .then(function (response) { 748 resolve(response); 749 }, function (response) { 750 reject(response); 751 }); 752 }); 753 } 754 755 } 756})();; 757(function () { 758 'use strict'; 759 760 angular 761 .module('app.services') 762 .factory('ScoreboardBasketballService', scoreboardBasketballService); 763 764 scoreboardBasketballService.$inject = ['$http', '$q', '$sessionStorage', '$localStorage']; 765 766 function scoreboardBasketballService($http, $q, $sessionStorage, $localStorage) { 767 return { 768 getDetails: getDetails, 769 createEvent: createEvent, 770 updateEvent: updateEvent, 771 deleteEvent: deleteEvent, 772 updateLineup: updateLineup, 773 startGame: startGame, 774 updateProperties: updateProperties, 775 closeGame: closeGame, 776 updateGame: updateGame, 777 updateStaffList, 778 updatePeriod: updatePeriod, 779 rollback: rollback 780 } 781 782 function getDetails(solutionId, gameId) { 783 return $q(function (resolve, reject) { 784 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/getdetails/${gameId}`, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 785 .then(function (response) { 786 resolve(response); 787 }, function (response) { 788 reject(response); 789 }); 790 }); 791 } 792 793 function createEvent(solutionId, gameId, event) { 794 return $q(function (resolve, reject) { 795 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/${gameId}/event/create`, event, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 796 .then(function (response) { 797 resolve(response); 798 }, function (response) { 799 reject(response); 800 }); 801 }); 802 } 803 804 function updateEvent(solutionId, gameId, event) { 805 return $q(function (resolve, reject) { 806 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/${gameId}/event/${event.id}/update`, event, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 807 .then(function (response) { 808 resolve(response); 809 }, function (response) { 810 reject(response); 811 }); 812 }); 813 } 814 815 function deleteEvent(solutionId, gameId, eventId) { 816 return $q(function (resolve, reject) { 817 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/${gameId}/event/${eventId}/delete`, {}, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 818 .then(function (response) { 819 resolve(response); 820 }, function (response) { 821 reject(response); 822 }); 823 }); 824 } 825 826 function updateLineup(solutionId, gameId, lineup) { 827 return $q(function (resolve, reject) { 828 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/lineup/${gameId}`, lineup, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 829 .then(function (response) { 830 resolve(response); 831 }, function (response) { 832 reject(response); 833 }); 834 }); 835 } 836 837 function startGame(solutionId, gameId) { 838 return $q(function (resolve, reject) { 839 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/start/${gameId}`, {}, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 840 .then(function (response) { 841 resolve(response); 842 }, function (response) { 843 reject(response); 844 }); 845 }); 846 } 847 848 function updateProperties(solutionId, gameId, teamId, properties) { 849 return $q(function (resolve, reject) { 850 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/${gameId}/teams/${teamId}/properties`, properties, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 851 .then(function (response) { 852 resolve(response); 853 }, function (response) { 854 reject(response); 855 }); 856 }); 857 } 858 859 function closeGame(solutionId, gameId) { 860 return $q(function (resolve, reject) { 861 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/close/${gameId}`, {}, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 862 .then(function (response) { 863 resolve(response); 864 }, function (response) { 865 reject(response); 866 }); 867 }); 868 } 869 870 function updateGame(solutionId, gameId, game) { 871 return $q(function (resolve, reject) { 872 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/${gameId}/update`, game, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 873 .then(function (response) { 874 resolve(response); 875 }, function (response) { 876 reject(response); 877 }); 878 }); 879 } 880 881 function updateStaffList(solutionId, gameId, staff) { 882 return $q(function (resolve, reject) { 883 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/game/${gameId}/staff`, staff, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 884 .then(function (response) { 885 resolve(response); 886 }, function (response) { 887 reject(response); 888 }); 889 }); 890 } 891 892 function updatePeriod(solutionId, gameId, periodId) { 893 return $q(function (resolve, reject) { 894 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/${gameId}/updateperiod`, periodId, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 895 .then(function (response) { 896 resolve(response); 897 }, function (response) { 898 reject(response); 899 }); 900 }); 901 } 902 903 function rollback(solutionId, gameId) { 904 return $q(function (resolve, reject) { 905 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/scoreboardbasketball/rollback/${gameId}`, {}, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 906 .then(function (response) { 907 rollback 908 resolve(response); 909 }, function (response) { 910 reject(response); 911 }); 912 }); 913 } 914 } 915})();; 916(function () { 917 'use strict'; 918 919 angular 920 .module('app.services') 921 .factory('ModalService', modalService); 922 923 modalService.$inject = ['GuidService']; 924 925 function modalService(guidService) { 926 return { 927 init: init 928 } 929 930 function init(element) { 931 var modal = null; 932 933 if (element.length > 0) { 934 var id = guidService.getGuid(); 935 element.addClass(id).appendTo('body'); 936 937 modal = { 938 show: function () { 939 $(`.${id}`).modal('show'); 940 }, 941 hide: function () { 942 $(`.${id}`).modal('hide'); 943 }, 944 modal: $(`.${id}`).modal, 945 element: $(`.${id}`) 946 } 947 } 948 949 return modal; 950 } 951 } 952})();; 953(function () { 954 'use strict'; 955 956 angular 957 .module('app.services') 958 .factory('SecurityService', securityService); 959 960 securityService.$inject = ['$http', '$q', '$localStorage', '$sessionStorage']; 961 962 function securityService($http, $q, $localStorage, $sessionStorage) { 963 964 const accessMapping = { 965 websiteEditor: [1, 2], 966 addWidget: [1, 2], 967 editWidget: [1, 2], 968 moveWidget: [1, 2], 969 deleteWidget: [1, 2], 970 addRow: [1, 2], 971 editRow: [1, 2], 972 moveRow: [1, 2], 973 deleteRow: [1, 2], 974 resizeColumns: [1, 2], 975 scoreboard: [1, 2, 4], 976 } 977 978 var access = {}; 979 980 return { 981 setRole: setRole, 982 getAccess: getAccess 983 } 984 985 function getAccess() { 986 return access; 987 } 988 989 function setRole() { 990 return $q(function (resolve, reject) { 991 $http.post(`${$sessionStorage.configurations.servers.rest}/api/authentication/securitysolution/${__solutionId__}`, {}, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 992 .then(function (response) { 993
993 const role = response.data.roleId; 994 for (const [key, value] of Object.entries(accessMapping)) { 995 access[key] = value.includes(role); 996 } 997 resolve(response); 998 }, function (response) { 999 reject(response); 1000 }); 1001 }); 1002 } 1003 } 1004})();; 1005(function () { 1006 'use strict'; 1007 1008 angular 1009 .module('app.services') 1010 .factory('DivisionService', divisionService); 1011 1012 divisionService.$inject = ['$http', '$q']; 1013 1014 function divisionService($http, $q) { 1015 return { 1016 getDivisionsBySeasonId: getDivisionsBySeasonId, 1017 getDivisionsBySolutionId: getDivisionsBySolutionId 1018 } 1019 1020 function getDivisionsBySeasonId(solutionId, seasonId) { 1021 return $q(function (resolve, reject) { 1022 $http.get(`api/v2/solutions/${solutionId}/seasons/${seasonId}/divisions`) 1023 .then(function (response) { 1024 resolve(response); 1025 }, function (response) { 1026 reject(response); 1027 }); 1028 }); 1029 } 1030 1031 function getDivisionsBySolutionId(solutionId) { 1032 return $q(function (resolve, reject) { 1033 $http.get(`api/leagues/${solutionId}/divisions`) 1034 .then(function (response) { 1035 resolve(response); 1036 }, function (response) { 1037 reject(response); 1038 }); 1039 }); 1040 } 1041 } 1042})();; 1043(function () { 1044 'use strict'; 1045 1046 angular 1047 .module('app.services') 1048 .factory('EventService', eventService); 1049 1050 eventService.$inject = []; 1051 1052 function eventService() { 1053 return { 1054 getEventById: getEventById, 1055 getPenaltyTypeById: getPenaltyTypeById, 1056 getPenaltyById: getPenaltyById 1057 } 1058 1059 function getEventById(id) { 1060 switch (id) { 1061 case 161: 1062 return { id: 161, name: 'services.event.hockey.equalForce.text', abbreviation: 'services.event.hockey.equalForce.abbreviation'}; 1063 1064 case 162: 1065 return { id: 162, name: 'services.event.hockey.powerPlayGoal.text', abbreviation: 'services.event.hockey.powerPlayGoal.abbreviation'}; 1066 1067 case 163: 1068 return { id: 163, name: 'services.event.hockey.shortHandedGoal.text', abbreviation: 'services.event.hockey.shortHandedGoal.abbreviation'}; 1069 1070 case 256: 1071 return { id: 256, name: 'services.event.hockey.penaltyShot.text', abbreviation: 'services.event.hockey.penaltyShot.abbreviation'}; 1072 1073 case 259: 1074 return { id: 259, name: 'services.event.hockey.emptyNet.text', abbreviation: 'services.event.hockey.emptyNet.abbreviation'}; 1075 } 1076 } 1077 1078 function getPenaltyTypeById(id) { 1079 switch (id) { 1080 case 1: 1081 return { id: 1, text: 'services.event.penalty.hockey.types.minor.text', abbreviation: 'services.event.penalty.hockey.types.minor.abbreviation', minute: '2', code: 'A' }; 1082 1083 case 2: 1084 return { id: 2, text: 'services.event.penalty.hockey.types.benchMinor.text', abbreviation: 'services.event.penalty.hockey.types.benchMinor.abbreviation', minute: '2', code: 'A' }; 1085 1086 case 3: 1087 return { id: 3, text: 'services.event.penalty.hockey.types.major.text', abbreviation: 'services.event.penalty.hockey.types.major.abbreviation', minute: '5', code: 'B' }; 1088 1089 case 4: 1090 return { id: 4, text: 'services.event.penalty.hockey.types.misconduct.text', abbreviation: 'services.event.penalty.hockey.types.misconduct.abbreviation', minute: '10', code: 'C' }; 1091 1092 case 5: 1093 return { id: 5, text: 'services.event.penalty.hockey.types.extremeMisconduct.text', abbreviation: 'services.event.penalty.hockey.types.extremeMisconduct.abbreviation', minute: '10', code: 'D' }; 1094 1095 case 6: 1096 return { id: 6, text: 'services.event.penalty.hockey.types.match.text', abbreviation: 'services.event.penalty.hockey.types.match.abbreviation', minute: '10', code: 'E' }; 1097 1098 case 7: 1099 return { id: 7, text: 'services.event.penalty.hockey.types.penaltyShot.text', abbreviation: 'services.event.penalty.hockey.types.penaltyShot.abbreviation', minute: null, code: 'F' }; 1100 1101 case 273: 1102 return { id: 273, text: 'services.event.penalty.hockey.types.minor.text', abbreviation: 'services.event.penalty.hockey.types.minor.abbreviation', minute: '3', co
1102de: 'A3' }; 1103 1104 case 274: 1105 return { id: 274, text: 'services.event.penalty.hockey.types.minor.text', abbreviation: 'services.event.penalty.hockey.types.minor.abbreviation', minute: '4', code: 'A4' }; 1106 1107 case 275: 1108 return { id: 275, text: 'services.event.penalty.hockey.types.minor.text', abbreviation: 'services.event.penalty.hockey.types.minor.abbreviation', minute: '1.5', code: 'A1.5' }; 1109 1110 case 276: 1111 return { id: 276, text: 'services.event.penalty.hockey.types.major.text', abbreviation: 'services.event.penalty.hockey.types.major.abbreviation', minute: '15', code: 'B15' }; 1112 1113 case 277: 1114 return { id: 277, text: 'services.event.penalty.hockey.types.minor.text', abbreviation: 'services.event.penalty.hockey.types.minor.abbreviation', minute: '1', code: 'A1' }; 1115 1116 case 278: 1117 return { id: 278, text: 'services.event.penalty.hockey.types.major.text', abbreviation: 'services.event.penalty.hockey.types.major.abbreviation', minute: '3', code: 'B3' }; 1118 1119 case 279: 1120 return { id: 279, text: 'services.event.penalty.hockey.types.major.text', abbreviation: 'services.event.penalty.hockey.types.major.abbreviation', minute: '4', code: 'B4' }; 1121 1122 case 280: 1123 return { id: 280, text: 'services.event.penalty.hockey.types.misconduct.text', abbreviation: 'services.event.penalty.hockey.types.misconduct.abbreviation', minute: '8', code: 'C8' }; 1124 } 1125 } 1126 1127 function getPenaltyById(id) { 1128 switch (id) { 1129 case 11: 1130 return { id: 11, text: 'services.event.penalty.hockey.agressor', group: 1 }; 1131 1132 case 12: 1133 return { id: 12, text: 'services.event.penalty.hockey.fighting', group: 1 }; 1134 1135 case 13: 1136 return { id: 13, text: 'services.event.penalty.hockey.fightingOneGuyInvolved', group: 1 }; 1137 1138 case 14: 1139 return { id: 14, text: 'services.event.penalty.hockey.instigator', group: 1 }; 1140 1141 case 15: 1142 return { id: 15, text: 'services.event.penalty.hockey.useOfMaterial', group: 1 }; 1143 1144 case 16: 1145 return { id: 16, text: 'services.event.penalty.hockey.remainingOnSiteFight', group: 1 }; 1146 1147 case 17: 1148 return { id: 17, text: 'services.event.penalty.hockey.secongFight', group: 1 }; 1149 1150 case 18: 1151 return { id: 18, text: 'services.event.penalty.hockey.thirdPlayerFighting', group: 1 }; 1152 1153 case 19: 1154 return { id: 19, text: 'services.event.penalty.hockey.firstPlayerQuittingBench', group: 1 }; 1155 1156 case 20: 1157 return { id: 20, text: 'services.event.penalty.hockey.goaltenderLeavingGoal', group: 1 }; 1158 1159 case 21: 1160 return { id: 21, text: 'services.event.penalty.hockey.grappingOpponentWithoutAdvantage', group: 1 }; 1161 1162 case 22: 1163 return { id: 22, text: 'services.event.penalty.hockey.grappingOpponentGainingAdvantage', group: 1 }; 1164 1165 case 23: 1166 return { id: 23, text: 'services.event.penalty.hockey.usingEquipmentWeapon', group: 1 }; 1167 1168 case 24: 1169 return { id: 24, text: 'services.event.penalty.hockey.playerRemovesHelmet', group: 1 }; 1170 1171 case 25: 1172 return { id: 25, text: 'services.event.penalty.hockey.slashing', group: 2 }; 1173 1174 case 26: 1175 return { id: 26, text: 'services.event.penalty.hockey.spearing', group: 2 }; 1176 1177 case 27: 1178 return { id: 27, text: 'services.event.penalty.hockey.buttEnding', group: 2 }; 1179 1180 case 28: 1181 return { id: 28, text: 'services.event.penalty.hockey.crossChecking', group: 2 }; 1182 1183 case 29: 1184 return { id: 29, text: 'services.event.penalty.hockey.highSticking', group: 2 }; 1185 1186 case 30: 1187 return { id: 30, text: 'services.event.penalty.hockey.charging', group: 3 }; 1188 1189 case 31: 1190 return { id: 31, text: 'services.event.penalty.hockey.attemptToInjure', group: 3 }; 1191 1192 case 32: 1193 return { id: 32, text: 'services.event.penalty.hockey.elbowing', group: 3 }; 1194 1195 case 33: 1196 return { id: 33, text: 'services.event.penalty.hockey.kneeing', group: 3 }; 1197 1198 case 34: 1199 return { id: 34, text: 'services.event.penalty.hockey.kicking', group: 3 }; 1200 1201 case 35: 1202 return { id: 35, text: 'services.event.penalty.hockey.headButting', group: 3 }; 1203 1204 case 36: 1205 return { id: 36, text: 'services.event.penalty.hockey.illegalBodyChecking', group: 3 }; 1206 1207 case 37: 1208 return { id: 37, text: 'services.event.penalty.hockey.checkingFromBehind', group: 3 }; 1209 1210 case 38: 1211 return { id: 38, text: 'services.event.penalty.hockey.boarding', group: 3 }; 1212 1213 case 39: 1214 return { id: 39, text: 'services.event.penalty.hockey.roughing', group: 3 }; 1215 1216 case 40: 1217 return { id: 40, text: 'services.event.penalty.hockey.headContact', group: 3 }; 1218 1219 case 41: 1220 return { id: 41, text: 'services.event.penalty.hockey.holding', group: 4 }; 1221 1222 case 42: 1223 return { id: 42, text: 'services.event.penalty.hockey.holdingTheStick', group: 4 }; 1224 1225 case 43: 1226 return { id: 43, text: 'services.event.penalty.hockey.hooking', group: 4 }; 1227 1228 case 44: 1229 return { id: 44, text: 'services.event.penalty.hockey.tripping', group: 4 }; 1230 1231 case 45: 1232 return { id: 45, text: 'services.event.penalty.hockey.slewFooting', group: 4 }; 1233 1234 case 46: 1235 return { id: 46, text: 'services.event.penalty.hockey.interference', group: 4 }; 1236 1237 case 47: 1238 return { id: 47, text: 'services.event.penalty.hockey.interferenceFromBench', group: 4 }; 1239 1240 case 48: 1241 return { id: 48, text: 'services.event.penalty.hockey.verbalAbuseAgainstOfficials', group: 5 }; 1242 1243 case 49: 1244 return { id: 49, text: 'services.event.penalty.hockey.diving', group: 5 }; 1245 1246 case 50: 1247 return { id: 50, text: 'services.event.penalty.hockey.engagingInVerbalTaunts', group: 5 }; 1248 1249 case 51: 1250 return { id: 51, text: 'services.event.penalty.hockey.teamManifestion', group: 5 }; 1251 1252 case 52: 1253 return { id: 52, text: 'services.event.penalty.hockey.grossMisconduct', group: 5 }; 1254 1255 case 53: 1256 return { id: 53, text: 'services.event.penalty.hockey.abusiveLanguage', group: 5 }; 1257 1258 case 54: 1259 return { id: 54, text: 'services.event.penalty.hockey.notProceedingToPenaltyBox', group: 5 }; 1260 1261 case 55: 1262 return { id: 55, text: 'services.event.penalty.hockey.incitingOpponent', group: 5 }; 1263 1264 case 56: 1265 return { id: 56, text: 'services.event.penalty.hockey.threatheningOfficial', group: 5 }; 1266 1267 case 57: 1268 return { id: 57, text: 'services.event.penalty.hockey.physicalAggression', group: 5 }; 1269 1270 case 58: 1271 return { id: 55, text: 'services.event.penalty.hockey.spitting', group: 5 }; 1272 1273 case 59: 1274 return { id: 59, text: 'services.event.penalty.hockey.tooManyPlayersOnTheIce', group: 6 }; 1275 1276 case 60: 1277 return { id: 60, text: 'services.event.penalty.hockey.playingWithBrokenStick', group: 6 }; 1278 1279 case 61: 1280 return { id: 61, text: 'services.event.penalty.hockey.unsustainedRequestEquipmentMeasurement', group: 6 }; 1281 1282 case 62: 1283 return { id: 62, text: 'services.event.penalty.hockey.refusingEquipmentMeasured', group: 6 }; 1284 1285 case 63: 1286 return { id: 63, text: 'services.event.penalty.hockey.participatingWithoutProperEquipment', group: 6 }; 1287 1288 case 64: 1289 return { id: 64, text: 'services.event.penalty.hockey.wearingNonCertifiedEquipment', group: 6 }; 1290 1291 case 65: 1292 return { id: 65, text: 'services.event.penalty.hockey.wearingEquipmentInNonRegulatoryFashion', group: 6 }; 1293 1294 case 66: 1295 return { id: 66, text: 'services.event.penalty.hockey.benchMinorOrTeamPenalty', group: 6 }; 1296 1297 case 67: 1298 return { id: 67, text: 'services.event.penalty.hockey.secondMisconductPenalty', group: 6 }; 1299 1300 case 68: 1301 return { id: 68, text: 'services.event.penalty.hockey.kickShot', group: 6 }; 1302 1303 case 69: 1304 return { id: 69, text: 'services.event.penalty.hockey.leavingPlayersBench', group: 6 }; 1305 1306 case 70: 1307 return { id: 70, text: 'services.event.penalty.hockey.throwingStick', group: 6 }; 1308 1309 case 71: 1310 return { id: 71, text: 'services.event.penalty.hockey.delayingGame', group: 6 }; 1311 1312 case 72: 1313 return { id: 72, text: 'services.event.penalty.hockey.deliberatelyDislodgingGoal', group: 6 }; 1314 1315 case 73: 1316 return { id: 73, text: 'services.event.penalty.hockey.ineligiblePlayer', group: 6 }; 1317 1318 case 74: 1319 return { id: 74, text: 'services.event.penalty.hockey.illegalFaceOff', group: 6 }; 1320 1321 case 75: 1322 return { id: 75, text: 'services.event.penalty.hockey.closingTheHandOnThePuck', group: 6 }; 1323 1324 case 76: 1325 return { id: 76, text: 'services.event.penalty.hockey.refusingToStartPlay', group: 6 }; 1326 1327 case 77: 1328 return { id: 77, text: 'services.event.penalty.hockey.leavingTheBench', group: 6 }; 1329 1330 case 164: 1331 return { id: 164, text: 'services.event.penalty.hockey.miscellaneous', group: 6 }; 1332 1333 case 260: 1334 return { id: 260, text: 'services.event.penalty.hockey.interferenceWithTheBench', group: 4 }; 1335 1336 case 261: 1337 return { id: 261, text: 'services.event.penalty.hockey.instigatorOfAGathering', group: 5 }; 1338 1339 case 262: 1340 return { id: 262, text: 'services.event.penalty.hockey.misconduct', group: 5 }; 1341 1342 case 263: 1343 return { id: 263, text: 'services.event.penalty.hockey.gameMisconduct', group: 5 }; 1344 1345 case 264: 1346 return { id: 264, text: 'services.event.penalty.hockey.matchPenalty', group: 5 }; 1347 1348 case 265: 1349 return { id: 265, text: 'services.event.penalty.hockey.secondFight', group: 5 }; 1350 1351 case 266: 1352 return { id: 266, text: 'services.event.penalty.hockey.grabbingFaceMask', group: 3 }; 1353 1354 case 267: 1355 return { id: 267, text: 'services.event.penalty.hockey.attemptRemoveHelmet', group: 5 }; 1356 1357 case 268: 1358 return { id: 268, text: 'services.event.penalty.hockey.checkAfterWhistle', group: 1 }; 1359 1360 case 269: 1361 return { id: 269, text: 'services.event.penalty.hockey.deliberateIllegalSubstitution', group: 1 }; 1362 1363 case 270: 1364 return { id: 270, text: 'services.event.penalty.hockey.unsportsmanlikeconduct', group: 5 }; 1365 1366 case 281: 1367 return { id: 281, text: 'services.event.penalty.hockey.playerWearingJersey', group: 1 }; 1368 1369 case 285: 1370 return { id: 285, text: 'services.event.penalty.hockey.interfernceWithGoaltender', group: 4 }; 1371 1372 case 286: 1373 return { id: 286, text: 'services.event.penalty.hockey.discriminationAllegations', group: 5 }; 1374 } 1375 } 1376 } 1377})();; 1378(function () { 1379 'use strict'; 1380 1381 angular 1382 .module('app.services') 1383 .factory('GameService', gameService); 1384 1385 gameService.$inject = ['$http', '$q', '$sessionStorage']; 1386 1387 function gameService($http, $q, $sessionStorage) { 1388 return { 1389 getGamesBySolutionId: getGamesBySolutionId, 1390 getGamesBySeasonId: getGamesBySeasonId, 1391 getGamesByDates: getGamesByDates, 1392 getGameDetailsById: getGameDetailsById, 1393 getStatisticsReportByGameId: getStatisticsReportByGameId, 1394 addStaff: addStaff, 1395 updateStaff: updateStaff, 1396 addPlayer: addPlayer,
1397 updatePlayer: updatePlayer, 1398 updateNote: updateNote, 1399 updateStaffSigned: updateStaffSigned, 1400 } 1401 1402 function getGamesBySolutionId(solutionId, options) { 1403 var queryString = ''; 1404 1405 if (options) { 1406 for (var option in options) { 1407 if (queryString) { 1408 queryString += '&' 1409 } 1410 1411 queryString += `${option}=${encodeURI(options[option])}`; 1412 } 1413 } 1414 1415 return $q(function (resolve, reject) { 1416 $http.get(`api/v2/solutions/${solutionId}/matches?${queryString}`) 1417 .then(function (response) { 1418 resolve(response); 1419 }, function (response) { 1420 reject(response); 1421 }); 1422 }); 1423 } 1424 1425 function getGamesBySeasonId(solutionId, seasonId, options) { 1426 var queryString = ''; 1427 1428 if (options) { 1429 for (var option in options) { 1430 if (queryString) { 1431 queryString += '&' 1432 } 1433 1434 queryString += `${option}=${encodeURI(options[option])}`; 1435 } 1436 } 1437 1438 return $q(function (resolve, reject) { 1439 $http.get(`api/v2/solutions/${solutionId}/seasons/${seasonId}/matches/dates?${queryString}`) 1440 .then(function (response) { 1441 resolve(response); 1442 }, function (response) { 1443 reject(response); 1444 }); 1445 }); 1446 } 1447 1448 function getGamesByDates(solutionId, options) { 1449 var queryString = ''; 1450 1451 if (options) { 1452 for (var option in options) { 1453 if (queryString) { 1454 queryString += '&' 1455 } 1456 1457 queryString += `${option}=${encodeURI(options[option])}`; 1458 } 1459 } 1460 1461 return $q(function (resolve, reject) { 1462 $http.get(`api/v2/solutions/${solutionId}/matches/dates?${queryString}`) 1463 .then(function (response) { 1464 resolve(response); 1465 }, function (response) { 1466 reject(response); 1467 }); 1468 }); 1469 } 1470 1471 function getGameDetailsById(solutionId, gameId) { 1472 return $q(function (resolve, reject) { 1473 $http.get(`api/v2/solutions/${solutionId}/matches/${gameId}/details`) 1474 .then(function (response) { 1475 resolve(response); 1476 }, function (response) { 1477 reject(response); 1478 }); 1479 }); 1480 } 1481 1482 function getStatisticsReportByGameId(gameId) { 1483 return $q(function (resolve, reject) { 1484 $http.get(`api/v2/games/${gameId}/statistics`) 1485 .then(function (response) { 1486 resolve(response); 1487 }, function (response) { 1488 reject(response); 1489 }); 1490 }); 1491 } 1492 1493 function addPlayer(solutionId, gameId, player) { 1494 return $q(function (resolve, reject) { 1495 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/game/${gameId}/player`, player) 1496 .then(function (response) { 1497 resolve(response); 1498 }, function (response) { 1499 reject(response); 1500 }); 1501 }); 1502 } 1503 1504 function updatePlayer(solutionId, gameId, player) { 1505 return $q(function (resolve, reject) { 1506 $http.put(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/game/${gameId}/player/${player.id}`, player) 1507 .then(function (response) { 1508 resolve(response); 1509 }, function (response) { 1510 reject(response); 1511 }); 1512 }); 1513 } 1514 1515 function addStaff(solutionId, gameId, staff) { 1516 return $q(function (resolve, reject) { 1517 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/game/${gameId}/staff`, staff) 1518 .then(function (response) { 1519 resolve(response); 1520 }, function (response) { 1521 reject(response); 1522 }); 1523 }); 1524 } 1525 1526 function updateStaff(solutionId, gameId, staff) { 1527 return $q(function (resolve, reject) { 1528 $http.put(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/game/${gameId}/staff/${staff.id}`, staff) 1529 .then(function (response) { 1530 resolve(response); 1531 }, function (response) { 1532 reject(response); 1533 }); 1534 }); 1535 } 1536 1537 function updateNote(gameId, note) { 1538 return $q(function (resolve, reject) { 1539 $http.put(`${$sessionStorage.configurations.servers.rest}/api/game/${gameId}/note`, JSON.stringify(note)) 1540 .then(function (response) { 1541 resolve(response); 1542 }, function (response) { 1543 reject(response); 1544 }); 1545 }); 1546 } 1547 1548 function updateStaffSigned(gameId, staffSigned) { 1549 return $q(function (resolve, reject) { 1550 $http.put(`${$sessionStorage.configurations.servers.rest}/api/game/${gameId}/staffSigned`, staffSigned) 1551 .then(function (response) { 1552 resolve(response); 1553 }, function (response) { 1554 reject(response); 1555 }); 1556 }); 1557 } 1558 } 1559})();; 1560(function () { 1561 'use strict'; 1562 1563 angular 1564 .module('app.services') 1565 .factory('ListService', listService); 1566 1567 listService.$inject = ['$http', '$q', '$sessionStorage', '$localStorage']; 1568 1569 function listService($http, $q, $sessionStorage, $localStorage) { 1570 return { 1571 createTemplate: createTemplate, 1572 getListById: getListById, 1573 getListsBySolutionId: getListsBySolutionId, 1574 getListItems: getListItems, 1575 getFilterOptions: getFilterOptions, 1576 createList: createList, 1577 updateList: updateList, 1578 deleteList: deleteList, 1579 } 1580 1581 function deleteList(solutionId, id) { 1582 return $q(function (resolve, reject) { 1583 $http.delete(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}/list/${id}`, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 1584 .then(function (response) { 1585 resolve(response); 1586 }, function (response) { 1587 reject(response); 1588 }); 1589 }); 1590 } 1591 1592 function createList(solutionId, list) { 1593 return $q(function (resolve, reject) { 1594 $http.post(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}/list`, list, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 1595 .then(function (response) { 1596 resolve(response); 1597 }, function (response) { 1598 reject(response); 1599 }); 1600 }); 1601 } 1602 1603 function updateList(solutionId, list, listId) { 1604 return $q(function (resolve, reject) { 1605 $http.put(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}/list/${listId}`, list, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 1606 .then(function (response) { 1607 resolve(response); 1608 }, function (response) { 1609 reject(response); 1610 }); 1611 }); 1612 } 1613 1614 function getListsBySolutionId(solutionId) { 1615 return $q(function (resolve, reject) { 1616 $http.get(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}/list`, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 1617 .then(function (response) { 1618 resolve(response); 1619 }, function (response) { 1620 reject(response); 1621 }); 1622 }); 1623 } 1624 1625 function getListById(solutionId, listId) { 1626 return $q(function (resolve, reject) { 1627 $http.get(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}/list/${listId}`, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 1628 .then(function (response) { 1629 resolve(response); 1630 }, function (response) { 1631 reject(response); 1632 }); 1633 }); 1634 } 1635 1636 function getListItems(solutionId, listId, page, pageSize, filters) { 1637 return $q(function (resolve, reject) { 1638 $http.post(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}/list/${listId}/items?page=${page}&pagesize=${pageSize}`, filters || [], { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 1639 .then(function (response) { 1640 resolve(response); 1641 }, function (response) { 1642 reject(response); 1643 }); 1644 }); 1645 } 1646 1647 function getFilterOptions(solutionId, listId, filters) { 1648 console.log(filters); 1649 return $q(function (resolve, reject) { 1650 $http.post(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}/list/${listId}/filters`, filters || [], { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 1651 .then(function (response) { 1652 resolve(response); 1653 }, function (response) { 1654 reject(response); 1655 }); 1656 }); 1657 } 1658 1659 function createTemplate(fields, name) { 1660 return $q(function (resolve, reject) { 1661 $http.post(`/handlers/CreateTemplate.ashx?name=${name}&fields=${JSON.stringify(fields)}`, null, { headers: { 'Content-Type': undefined } }) 1662 .then(function (response) { 1663 resolve(response); 1664 }, function (response) { 1665 reject(response); 1666 }); 1667 }); 1668 } 1669 1670 } 1671})();; 1672(function () { 1673 'use strict'; 1674 1675 angular 1676 .module('app.services') 1677 .factory('PlanService', planService); 1678 1679 planService.$inject = ['$localStorage']; 1680 1681 function planService($localStorage) { 1682 var plans = [ 1683 { 1684 id: 0, 1685 text: 'services.plan.free' 1686 }, 1687 { 1688 id: 1, 1689 text: 'services.plan.rookie' 1690 }, 1691 { 1692 id: 2, 1693 text: 'services.plan.pro' 1694 }, 1695 { 1696 id: 3, 1697 text: 'services.plan.mvp' 1698 }, 1699 { 1700 id: 4, 1701 text: 'services.plan.demo' 1702 }, 1703 { 1704 id: 5, 1705 text: 'services.plan.agent'
1706 } 1707 ] 1708 1709 return { 1710 plans: plans, 1711 getPlanFromLocalStorage: getPlanFromLocalStorage, 1712 getPlanFromId: getPlanFromId 1713 } 1714 1715 function getPlanFromId(planId) { 1716 return _.find(plans, { id: planId }); 1717 } 1718 1719 function getPlanFromLocalStorage() { 1720 return _.find(plans, { id: $localStorage.solution.planId }); 1721 } 1722 } 1723})();; 1724(function () { 1725 'use strict'; 1726 1727 angular 1728 .module('app.services') 1729 .factory('PlayerService', playerService); 1730 1731 playerService.$inject = ['$http', '$q', '$sessionStorage']; 1732 1733 function playerService($http, $q, $sessionStorage) { 1734 return { 1735 getAge: getAge, 1736 getPlayersBySolutionId: getPlayersBySolutionId, 1737 getPlayerColumns: getPlayerColumns, 1738 getPlayerColumn: getPlayerColumn, 1739 getStatus: getStatus, 1740 getPlayerGameLog: getPlayerGameLog, 1741 getPlayerType: getPlayerType, 1742 } 1743 1744 function getAge(birthday) { 1745 return birthday !== null 1746 ? moment().diff(birthday, 'years') 1747 : ''; 1748 } 1749 1750 function getPlayersBySolutionId(solutionId, options) { 1751 var queryString = ''; 1752 1753 if (options) { 1754 for (var option in options) { 1755 if (queryString) { 1756 queryString += '&' 1757 } 1758 1759 queryString += `${option}=${encodeURI(options[option])}`; 1760 } 1761 } 1762 1763 return $q(function (resolve, reject) { 1764 $http.get(`api/v2/solutions/${solutionId}/players?${queryString}`) 1765 .then(function (response) { 1766 resolve(response); 1767 }, function (response) { 1768 reject(response); 1769 }); 1770 }); 1771 } 1772 1773 function getStatus(status) { 1774 switch (status) { 1775 case 0: 1776 return "directives.widgets.player.list.status.inactive"; 1777 case 1: 1778 return "directives.widgets.player.list.status.active"; 1779 case 2: 1780 return "directives.widgets.player.list.status.international"; 1781 case 3: 1782 return "directives.widgets.player.list.status.injured"; 1783 case 4: 1784 return "directives.widgets.player.list.status.suspended"; 1785 case 6: 1786 return "directives.widgets.player.list.status.temporary"; 1787 case 7: 1788 return "directives.widgets.player.list.status.reserve"; 1789 } 1790 return ""; 1791 } 1792 1793 function getPlayerColumn(id) { 1794 switch (id) { 1795 case 1: 1796 return { id: 1, name: 'directives.widgets.player.list.columns.number' }; 1797 case 2: 1798 return { id: 2, name: 'directives.widgets.player.list.columns.name' }; 1799 case 3: 1800 return { id: 3, name: 'directives.widgets.player.list.columns.position' }; 1801 case 4: 1802 return { id: 4, name: 'directives.widgets.player.list.columns.team' }; 1803 case 5: 1804 return { id: 5, name: 'directives.widgets.player.list.columns.age' }; 1805 case 6: 1806 return { id: 6, name: 'directives.widgets.player.list.columns.height' }; 1807 case 7: 1808 return { id: 7, name: 'directives.widgets.player.list.columns.weight' }; 1809 case 8: 1810 return { id: 8, name: 'directives.widgets.player.list.columns.level' }; 1811 case 9: 1812 return { id: 9, name: 'directives.widgets.player.list.columns.birthday' }; 1813 case 10: 1814 return { id: 10, name: 'directives.widgets.player.list.columns.status' }; 1815 case 11: 1816 return { id: 11, name: 'directives.widgets.player.list.columns.type' }; 1817 case 12: 1818 return { id: 12, name: 'directives.widgets.player.list.columns.grade' }; 1819 case 13: 1820 return { id: 13, name: 'directives.widgets.player.list.columns.rating' }; 1821 case 14: 1822 return { id: 14, name: 'directives.widgets.player.list.columns.classification' }; 1823 } 1824 } 1825 1826 function getPlayerColumns() { 1827 return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14].map(function (x) { return getPlayerColumn(x) }) 1828 } 1829 1830 function getPlayerGameLog(playerId, seasonId) { 1831 return $q(function (resolve, reject) { 1832 $http.get(`${$sessionStorage.configurations.servers.rest}/api/player/${playerId}/log/season/${seasonId}`) 1833 .then(function (response) { 1834 resolve(response); 1835 }, function (response) { 1836 reject(response); 1837 }); 1838 }); 1839 } 1840 1841 function getPlayerType(playerStatus) { 1842 switch (playerStatus) { 1843 case 1: { return 'directives.widgets.player.type.regular' }; 1844 case 2: { return 'directives.widgets.player.type.backup' }; 1845 default: { return 'directives.widgets.player.type.regular' }; 1846 } 1847 } 1848 1849 } 1850})();; 1851(function () { 1852 'use strict'; 1853 1854 angular 1855 .module('app.services') 1856 .factory('PositionService', positionService); 1857 1858 positionService.$inject = ['$translate']; 1859 1860 function positionService($translate) { 1861 return { 1862 getPositions: getPositions, 1863 getPosition: getPosition, 1864 getCategory: getCategory, 1865 getStaffPosition: getStaffPosition, 1866 getStaffPositions: getStaffPositions, 1867 getStaffTeamPositions: getStaffTeamPositions, 1868 getStaffSolutionPositions: getStaffSolutionPositions, 1869 getPositionsByCategory: getPositionsByCategory 1870 } 1871 1872 function getPositions(sport) { 1873 switch (sport) { 1874 case 1: 1875 return [ 1876 { id: 5, text: $translate.instant('services.position.hockey.center.text') }, 1877 { id: 6, text: $translate.instant('services.position.hockey.rightWing.text') }, 1878 { id: 7, text: $translate.instant('services.position.hockey.leftWing.text') }, 1879 { id: 2, text: $translate.instant('services.position.hockey.forward.text') }, 1880 { id: 3, text: $translate.instant('services.position.hockey.defense.text') }, 1881 { id: 4, text: $translate.instant('services.position.hockey.goaltender.text') }, 1882 { id: 8, text: $translate.instant('services.position.hockey.player.text') }, 1883 { id: 0, text: 'N/A' } 1884 ]; 1885 case 2: 1886 return [ 1887 { id: 61, text: $translate.instant('services.position.baseball.pitcher.text') }, 1888 { id: 62, text: $translate.instant('services.position.baseball.firstbase.text') }, 1889 { id: 63, text: $translate.instant('services.position.baseball.secondbase.text') }, 1890 { id: 64, text: $translate.instant('services.position.baseball.thirdbase.text') }, 1891 { id: 65, text: $translate.instant('services.position.baseball.shortstop.text') }, 1892 { id: 66, text: $translate.instant('services.position.baseball.catcher.text') }, 1893 { id: 67, text: $translate.instant('services.position.baseball.fieldleft.text') }, 1894 { id: 68, text: $translate.instant('services.position.baseball.fieldcenter.text') }, 1895 { id: 69, text: $translate.instant('services.position.baseball.fieldright.text') }, 1896 { id: 75, text: $translate.instant('services.position.baseball.batter.text') }, 1897 { id: 135, text: $translate.instant('services.position.baseball.outfielder.text') }, 1898 { id: 136, text: $translate.instant('services.position.baseball.rover.text') }, 1899 { id: 137, text: $translate.instant('services.position.baseball.infielder.text') }, 1900 ]; 1901 case 3: 1902 return [ 1903 { id: 34, text: $translate.instant('services.position.football.quarterback.text') }, 1904 { id: 35, text: $translate.instant('services.position.football.runningback.text') }, 1905 { id: 38, text: $translate.instant('services.position.football.widereceiver.text') }, 1906 { id: 71, text: $translate.instant('services.position.football.tightend.text') }, 1907 { id: 41, text: $translate.instant('services.position.football.center.text') }, 1908 { id: 42, text: $translate.instant('services.position.football.offensiveguard.text') }, 1909 { id: 40, text: $translate.instant('services.position.football.offensivetackle.text') }, 1910 { id: 53, text: $translate.instant('services.position.football.defensivetackle.text') }, 1911 { id: 47, text: $translate.instant('services.position.football.defensiveend.text') }, 1912 { id: 44, text: $translate.instant('services.position.football.tackle.text') }, 1913 { id: 36, text: $translate.instant('services.position.football.halfback.text') }, 1914 { id: 48, text: $translate.instant('services.position.football.linebacker.text') }, 1915 { id: 49, text: $translate.instant('services.position.football.outsidelinebacker.text') }, 1916 { id: 50, text: $translate.instant('services.position.football.middlelinebacker.text') }, 1917 { id: 51, text: $translate.instant('services.position.football.defensiveback.text') }, 1918 { id: 52, text: $translate.instant('services.position.football.cornerback.text') }, 1919 { id: 39, text: $translate.instant('services.position.football.defensivehalfback.text') }, 1920 { id: 43, text: $translate.instant('services.position.football.slotback.text') }, 1921 { id: 37, text: $translate.instant('services.position.football.fullback.text') }, 1922 { id: 70, text: $translate.instant('services.position.football.freesafety.text') }, 1923 { id: 46, text: $translate.instant('services.position.football.strongsafety.text') }, 1924 { id: 55, text: $translate.instant('services.position.football.kicker.text') }, 1925 { id: 54, text: $translate.instant('services.position.football.punter.text') }, 1926 { id: 74, text: $translate.instant('services.position.football.kickreturner.text') }, 1927 { id: 56, text: $translate.instant('services.position.football.puntreturner.text') }, 1928 { id: 72, text: $translate.instant('services.position.football.longsnapper.text') }, 1929 { id: 73, text: $translate.instant('services.position.football.kickoffspecialist.text') }, 1930 ]; 1931 case 4: 1932 return [ 1933 { id: 76, text: $translate.instant('services.position.basketball.pointGuard.text') }, 1934 { id: 77, text: $translate.instant('services.position.basketball.shootingGuard.text') }, 1935 { id: 78, text: $translate.instant('services.position.basketball.smallForward.text') }, 1936 { id: 79, text: $translate.instant('services.position.basketball.powerForward.text') }, 1937 { id: 80, text: $translate.instant('services.position.basketball.center.text') }, 1938 { id: 142, text: $translate.instant('services.position.basketball.comboGuard.text') }, 1939 { id: 143, text: $translate.instant('services.position.basketball.swingman.text') }, 1940 { id: 144, text: $translate.instant('services.position.basketball.pointForward.text') }, 1941 { id: 145, text: $translate.instant('services.position.basketball.pointForward2.text') }, 1942 { id: 146, text: $translate.instant('services.position.basketball.comboForward.text') }, 1943 { id: 147, text: $translate.instant('services.position.basketball.forwardCenter.text') }, 1944 ]; 1945 default: 1946 return [ 1947 { id: 5, text: $translate.instant('services.position.hockey.center.text') }, 1948 { id: 6, text: $translate.instant('services.position.hockey.rightWing.text') }, 1949 { id: 7, text: $translate.instant('services.position.hockey.leftWing.text') }, 1950 { id: 2, text: $translate.instant('services.position.hockey.forward.text') }, 1951 { id: 3, text: $translate.instant('services.position.hockey.defense.text') }, 1952 { id: 4, text: $translate.instant('services.position.hockey.goaltender.text') }, 1953 { id: 8, text: $translate.instant('services.position.hockey.player.text') }, 1954 { id: 0, text: 'N/A' } 1955 ] 1956 } 1957 } 1958 1959 function getCategory(categoryId) { 1960 switch (Number(categoryId)) { 1961 case 1: 1962 return $translate.instant('services.categoryId.goalie') 1963 case 2: 1964 return $translate.instant('services.categoryId.player') 1965 case 3: 1966 return $translate.instant('services.categoryId.player') 1967 case 4: 1968 return $translate.instant('services.categoryId.goalie') 1969 case 8: 1970 return $translate.instant('services.categoryId.pitcher') 1971 case 9: 1972 return $translate.instant('services.categoryId.hitter') 1973 case 10: 1974 return $translate.instant('services.categoryId.player') 1975 case 16: 1976 return $translate.instant('services.categoryId.player') 1977 case 17: 1978 return $translate.instant('services.categoryId.goalie') 1979 case 20: 1980 return $translate.instant('services.categoryId.player') 1981 case 21: 1982 return $translate.instant('services.categoryId.defense') 1983 } 1984 } 1985 1986 function getPositionsByCategory(sportId, categoryId) { 1987 var allPositions = getPositions(sportId); 1988 var positions = { 1989 1: [4], 1990 2: [5, 6, 7, 8, 2, 3], 1991 3: [58, 59, 60], 1992 4: [57], 1993 5: [34, 35, 36, 37, 38, 40, 41, 42, 43, 71], 1994 6: [44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 39, 70], 1995 7: [54, 55, 56, 72, 73, 74], 1996 8: [61],
1997 9: [62, 63, 64, 65, 66, 67, 68, 69, 135, 136, 137, 140, 141, 148, 75], 1998 10: [76, 77, 78, 79, 80, 142, 143, 144, 145, 146, 147], 1999 11: [81, 82, 83, 84, 85], 2000 12: [86], 2001 13: [87, 88, 89, 90], 2002 14: [91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119], 2003 15: [120, 121], 2004 16: [122, 123, 124, 125, 126, 127], 2005 17: [128], 2006 18: [129, 130, 131, 132, 133], 2007 19: [134], 2008 20: [138], 2009 21: [139], 2010 22: [149] 2011 } 2012 2013 return _.filter(allPositions, function (position) { return _.includes(positions[categoryId], position.id) }); 2014 } 2015 2016 function getPosition(position, type) { 2017 /*sportUserPosition: { 2018 2: { 2019 pitcher: { id: 61, description: 'Lanceur', abbreviation: 'L', categoryId: 8 }, 2020 firstBase: { id: 62, description: 'Premier but', abbreviation: '1B', categoryId: 9 }, 2021 secondBase: { id: 63, description: 'Deuxième but', abbreviation: '2B', categoryId: 9 }, 2022 thirdBase: { id: 64, description: 'Troisième but', abbreviation: '3B', categoryId: 9 }, 2023 shortStop: { id: 65, description: 'Arrêt-court', abbreviation: 'AC', categoryId: 9 }, 2024 catcher: { id: 66, description: 'Receveur', abbreviation: 'R', categoryId: 9 }, 2025 leftField: { id: 67, description: 'Joueur de champ gauche', abbreviation: 'CG', categoryId: 9 }, 2026 centerField: { id: 68, description: 'Joueur de champ centre', abbreviation: 'CC', categoryId: 9 }, 2027 rightField: { id: 69, description: 'Joueur de champ droit', abbreviation: 'CD', categoryId: 9 }, 2028 designatedHitter: { id: 75, description: 'Frappeur désigné', abbreviation: 'FD', categoryId: 9 }, 2029 outfielder: { id: 135, description: 'Voltigeur', abbreviation: 'V', categoryId: 9 }, 2030 rover: { id: 136, description: 'Entre-champ', abbreviation: 'EC', categoryId: 9 }, 2031 infielder: { id: 137, description: 'Avant-champ', abbreviation: 'AC', categoryId: 9 }, 2032 undefined: { id: 0, description: 'N/D', abbreviation: '', categoryId: 0 } 2033 }, 2034 3: { 2035 quarterback: { id: 34, description: 'Quart-arrière', abbreviation: 'Q', categoryId: 5 }, 2036 runningBack: { id: 35, description: 'Porteur de ballon', abbreviation: 'PB', categoryId: 5 }, 2037 halfback: { id: 36, description: 'Demi offensif', abbreviation: 'DO', categoryId: 5 }, 2038 fullback: { id: 37, description: 'Centre arrière', abbreviation: 'CA', categoryId: 5 }, 2039 wideReceiver: { id: 38, description: 'Receveur éloigné', abbreviation: 'RE', categoryId: 5 }, 2040 defensiveHalfback: { id: 39, description: 'Demi inséré', abbreviation: 'DI', categoryId: 6 }, 2041 offensiveTackle: { id: 40, description: 'Bloqueur offensif', abbreviation: 'BO', categoryId: 5 }, 2042 center: { id: 41, description: 'Centre', abbreviation: 'C', categoryId: 5 }, 2043 offensiveGuard: { id: 42, description: 'Garde offensif', abbreviation: 'GO', categoryId: 5 }, 2044 slotBack: { id: 43, description: 'Receveur intérieur', abbreviation: 'RI', categoryId: 5 }, 2045 tackle: { id: 44, description: 'Bloqueur', abbreviation: 'B', categoryId: 6 }, 2046 defensiveTackle: { id: 45, description: 'Plaqueur défensif', abbreviation: 'PD', categoryId: 6 }, 2047 strongSafety: { id: 46, description: 'Maraudeur côté fort', abbreviation: 'M', categoryId: 6 }, 2048 defensiveEnd: { id: 47, description: 'Aillier défensif', abbreviation: 'AD', categoryId: 6 }, 2049 linebacker: { id: 48, description: 'Secondeur de ligne', abbreviation: 'SEC', categoryId: 6 }, 2050 outsideLinebacker: { id: 49, description: 'Secondeur extérieur', abbreviation: 'SEC E', categoryId: 6 }, 2051 middleLinebacker: { id: 50, description: 'Secondeur intérieur', abbreviation: 'SEC I', categoryId: 6 }, 2052 defensiveBack: { id: 51, description: 'Demi défensif', abbreviation: 'DD', categoryId: 6 }, 2053 cornerback: { id: 52, description: 'Demi de coin', abbreviation: 'DC', categoryId: 6 }, 2054 defensiveTackle: { id: 53, description: 'Ailliers défensifs', abbreviation: 'AD', categoryId: 6 }, 2055 punter: { id: 54, description: 'Botteur de dégagement', abbreviation: 'BD', categoryId: 7 }, 2056 kicker: { id: 55, description: 'Botteur de précision', abbreviation: 'BP', categoryId: 7 }, 2057 puntReturner: { id: 56, description: 'Retourneur de botté', abbreviation: 'REB', categoryId: 7 }, 2058 freeSafety: { id: 70, description: 'Maraudeur', abbreviation: 'M', categoryId: 6 }, 2059 tightEnd: { id: 71, description: 'Demi inséré offensif', abbreviation: 'DI', categoryId: 5 }, 2060 longSnapper: { id: 72, description: 'Spécialiste des longues remises', abbreviation: 'SLR', categoryId: 7 }, 2061 kickoffSpecialist: { id: 73, description: 'Spécialiste des bottés d\'envoi', abbreviation: 'SBE', categoryId: 7 }, 2062 kickReturner: { id: 74, description: 'Retourneur', abbreviation: 'RE', categoryId: 7 }, 2063 undefined: { id: 0, description: 'N/D', abbreviation: '',
2063categoryId: 0 } 2064 }, 2065 4: { 2066 pointGuard: { id: 76, description: 'Meneur', abbreviation: 'M', categoryId: 10 }, 2067 shootingGuard: { id: 77, description: 'Arrière', abbreviation: 'Arr', categoryId: 10 }, 2068 smallForward: { id: 78, description: 'Ailier', abbreviation: 'A', categoryId: 10 }, 2069 powerForward: { id: 79, description: 'Ailier fort', abbreviation: 'AF', categoryId: 10 }, 2070 center: { id: 80, description: 'Pivot', abbreviation: 'P', categoryId: 10 }, 2071 undefined: { id: 0, description: 'N/D', abbreviation: '', categoryId: 0 } 2072 }, 2073 6: { 2074 goalkeeper: { id: 57, description: 'Gardien de but', abbreviation: 'GB', categoryId: 4 }, 2075 defender: { id: 58, description: 'Défenseur', abbreviation: 'D', categoryId: 3 }, 2076 midfield: { id: 59, description: 'Milieu de terrain', abbreviation: 'M', categoryId: 3 }, 2077 attacking: { id: 60, description: 'Attaquant', abbreviation: 'A', categoryId: 3 }, 2078 undefined: { id: 0, description: 'N/D', abbreviation: '', categoryId: 0 } 2079 }, 2080 7: { 2081 middle: { id: 87, description: 'Central', abbreviation: 'C', categoryId: 13 }, 2082 setter: { id: 88, description: 'Passeur', abbreviation: 'P', categoryId: 13 }, 2083 libero: { id: 89, description: 'Libéro', abbreviation: 'L', categoryId: 13 }, 2084 hitter: { id: 90, description: 'Attaquant', abbreviation: 'A', categoryId: 13 }, 2085 undefined: { id: 0, description: 'N/D', abbreviation: '', categoryId: 0 } 2086 }, 2087 10: { 2088 player: { id: 138, description: 'Joueur', abbreviation: 'J', categoryId: 20 }, 2089 undefined: { id: 0, description: 'N/D', abbreviation: '', categoryId: 0 } 2090 }, 2091 11: { 2092 defensmen: { id: 81, description: 'Défenseur', abbreviation: 'D', categoryId: 11 }, 2093 forward: { id: 82, description: 'Avant', abbreviation: 'A', categoryId: 11 }, 2094 rightWing: { id: 83, description: 'Ailier droit', abbreviation: 'AD', categoryId: 11 }, 2095 leftWing: { id: 84, description: 'Ailier gauche', abbreviation: 'AG', categoryId: 11 }, 2096 center: { id: 85, description: 'Centre', abbreviation: 'C', categoryId: 11 }, 2097 goaltender: { id: 86, description: 'Gardien de but', abbreviation: 'GB', categoryId: 12 }, 2098 undefined: { id: 0, description: 'N/D', abbreviation: '', categoryId: 0 } 2099 }, 2100 12: { 2101 forward: { id: 91, description: 'Avant', abbreviation: 'A', categoryId: 14 }, 2102 firstRow: { id: 92, description: 'Première ligne', abbreviation: '1re L', categoryId: 14 }, 2103 secondRow: { id: 93, description: 'Deuxième ligne', abbreviation: '2e L', categoryId: 14 }, 2104 thirdRow: { id: 94, description: 'Troisième ligne', abbreviation: '3e L', categoryId: 14 }, 2105 half: { id: 95, description: 'Charnière', abbreviation: 'CH', categoryId: 14 }, 2106 backRows: { id: 96, description: 'Arrière', abbreviation: 'ARR', categoryId: 14 }, 2107 center: { id: 97, description: 'Trois-quarts centre', abbreviation: 'TQC', categoryId: 14 }, 2108 wing: { id: 98, description: 'Trois-quarts aile', abbreviation: 'TQA', categoryId: 14 }, 2109 looseHeadProp: { id: 99, description: 'Pilier', abbreviation: 'P', categoryId: 14 }, 2110 prop: { id: 100, description: 'Pilier', abbreviation: 'P', categoryId: 14 }, 2111 hooker: { id: 101, description: 'Talonneur', abbreviation: 'T', categoryId: 14 }, 2112 tightHeadProp: { id: 102, description: 'Pilier', abbreviation: 'P', categoryId: 14 }, 2113 lock: { id: 103, description: '2e ligne', abbreviation: '2e L', categoryId: 14 }, 2114 leftLock: { id: 104, description: '2e ligne gauche', abbreviation: '2e LG', categoryId: 14 }, 2115 rightLock: { id: 105, description: '2e ligne droit', abbreviation: '2e LD', categoryId: 14 }, 2116 flanker: { id: 106, description: '3e ligne', abbreviation: '3e L', categoryId: 14 }, 2117 blindsideFlanker: { id: 107, description: '3e ligne gauche', abbreviation: '3e LG', categoryId: 14 }, 2118 opensideFlanker: { id: 108, description: '3e ligne droit', abbreviation: '3e LD', categoryId: 14 }, 2119 number: { id: 109, description: 'Numéro 8', abbreviation: 'No. 8', categoryId: 14 }, 2120 scrumHalf: { id: 110, description: 'Demi de mêlée', abbreviation: 'DM', categoryId: 14 }, 2121 flyHalf: { id: 111, description: 'Demi d\'ouverture', abbreviation: 'DO', categoryId: 14 }, 2122 outsideHalf: { id: 112, description: 'Demi d\'ouverture', abbreviation: 'DO', categoryId: 14 }, 2123 leftCenter: { id: 113, description: 'Centre gauche', abbreviation: 'CG', categoryId: 14 }, 2124 insideCenter: { id: 114, description: 'Centre intérieur', abbreviation: 'CI', categoryId: 14 }, 2125 rightCenter: { id: 115, description: 'Centre droit', abbreviation: 'CD', categoryId: 14 }, 2126 outsideCenter: { id: 116, description: 'Centre extérieur', abbreviation: 'CE', categoryId: 14 }, 2127 leftWing: { id: 117, description: 'Trois-quarts aile', abbreviation: 'TQA', categoryId: 14 }, 2128 rightWing: { id: 118, description: 'Ailier droit', abbreviation: 'AD', categoryId: 14 }, 2129 fullBack: { id: 119, description: 'Arrière', abbreviation: 'ARR', categoryId: 14 }, 2130 undefined: { id: 0, description: 'N/D', abbreviation: '',
2130categoryId: 0 } 2131 }, 2132 13: { 2133 handler: { id: 120, description: 'Lanceur', abbreviation: 'L', categoryId: 15 }, 2134 cutter: { id: 121, description: 'Receveur', abbreviation: 'H', categoryId: 15 }, 2135 undefined: { id: 0, description: 'N/D', abbreviation: '', categoryId: 0 } 2136 }, 2137 14: { 2138 rightWinger: { id: 122, description: 'Ailier droit', abbreviation: 'AD', categoryId: 16 }, 2139 rightBack: { id: 123, description: 'Arrière droit', abbreviation: 'AR D', categoryId: 16 }, 2140 centerBack: { id: 124, description: 'Arrière central', abbreviation: 'AR C', categoryId: 16 }, 2141 leftBack: { id: 125, description: 'Arrière gauche', abbreviation: 'AR G', categoryId: 16 }, 2142 leftWinger: { id: 126, description: 'Ailier gauche', abbreviation: 'AG', categoryId: 16 }, 2143 centerForward: { id: 127, description: 'Pivot', abbreviation: 'P', categoryId: 16 }, 2144 goalKeeper: { id: 128, description: 'Gardien de but', abbreviation: 'GB', categoryId: 17 }, 2145 undefined: { id: 0, description: 'N/D', abbreviation: '', categoryId: 0 } 2146 }, 2147 15: { 2148 centerr: { id: 129, description: 'Centre', abbreviation: 'C', categoryId: 18 }, 2149 forward: { id: 130, description: 'Attaquant', abbreviation: 'F', categoryId: 18 }, 2150 leftWinger: { id: 131, description: 'Ailier gauche', abbreviation: 'LW', categoryId: 18 }, 2151 rightWinger: { id: 132, description: 'Ailier droit', abbreviation: 'RW', categoryId: 18 }, 2152 defender: { id: 133, description: 'Défenseur', abbreviation: 'D', categoryId: 18 }, 2153 goaltender: { id: 134, description: 'Gardien de but', abbreviation: 'G', categoryId: 19 }, 2154 undefined: { id: 0, description: 'N/D', abbreviation: '', categoryId: 0 } 2155 } 2156 },*/ 2157 2158 switch (position.toLowerCase()) { 2159 //Baseball 2160 case 'baseballpitcher': 2161 return type === 'abbreviation' 2162 ? $translate.instant('services.position.baseball.pitcher.abbreviation') 2163 : $translate.instant('services.position.baseball.pitcher.text'); 2164 2165 case 'baseballfirstbase': 2166 return type === 'abbreviation' 2167 ? $translate.instant('services.position.baseball.firstbase.abbreviation') 2168 : $translate.instant('services.position.baseball.firstbase.text'); 2169 2170 case 'baseballsecondbase': 2171 return type === 'abbreviation' 2172 ? $translate.instant('services.position.baseball.secondbase.abbreviation') 2173 : $translate.instant('services.position.baseball.secondbase.text'); 2174 2175 case 'baseballthirdbase': 2176 return type === 'abbreviation' 2177 ? $translate.instant('services.position.baseball.thirdbase.abbreviation') 2178 : $translate.instant('services.position.baseball.thirdbase.text'); 2179 2180 case 'baseballshortstop': 2181 return type === 'abbreviation' 2182 ? $translate.instant('services.position.baseball.shortstop.abbreviation') 2183 : $translate.instant('services.position.baseball.shortstop.text'); 2184 2185 case 'baseballcatcher': 2186 return type === 'abbreviation' 2187 ? $translate.instant('services.position.baseball.catcher.abbreviation') 2188 : $translate.instant('services.position.baseball.catcher.text'); 2189 2190 case 'baseballleftfield': 2191 return type === 'abbreviation' 2192 ? $translate.instant('services.position.baseball.fieldleft.abbreviation') 2193 : $translate.instant('services.position.baseball.fieldleft.text'); 2194 2195 case 'baseballcenterfield': 2196 return type === 'abbreviation' 2197 ? $translate.instant('services.position.baseball.fieldcenter.abbreviation') 2198 : $translate.instant('services.position.baseball.fieldcenter.text'); 2199 2200 case 'baseballrightfield': 2201 return type === 'abbreviation' 2202 ? $translate.instant('services.position.baseball.fieldright.abbreviation') 2203 : $translate.instant('services.position.baseball.fieldright.text'); 2204 2205 case 'baseballdesignatedhitter': 2206 return type === 'abbreviation' 2207 ? $translate.instant('services.position.baseball.batter.abbreviation') 2208 : $translate.instant('services.position.baseball.batter.text'); 2209 2210 case 'baseballinfielder': 2211 return type === 'abbreviation' 2212 ? $translate.instant('services.position.baseball.infielder.abbreviation') 2213 : $translate.instant('services.position.baseball.infielder.text'); 2214 2215 case 'baseballrover': 2216 return type === 'abbreviation' 2217 ? $translate.instant('services.position.baseball.rover.abbreviation') 2218 : $translate.instant('services.position.baseball.rover.text'); 2219 2220 case 'baseballoutfielder': 2221 return type === 'abbreviation' 2222 ? $translate.instant('services.position.baseball.outfielder.abbreviation') 2223 : $translate.instant('services.position.baseball.outfielder.text'); 2224 2225 //Hockey 2226 case 'hockeycenter': 2227 return type === 'abbreviation' 2228 ? $translate.instant('services.position.hockey.center.abbreviation') 2229 : $translate.instant('services.position.hockey.center.text'); 2230 2231 case 'hockeydefense': 2232 return type === 'abbreviation' 2233 ? $translate.instant('services.position.hockey.defense.abbreviation') 2234 : $translate.instant('services.position.hockey.defense.text'); 2235 2236 case 'hockeyforward': 2237 return type === 'abbreviation' 2238 ? $translate.instant('services.position.hockey.forward.abbreviation') 2239 : $translate.instant('services.position.hockey.forward.text'); 2240 2241 case 'hockeygoalie': 2242 return type === 'abbreviation' 2243 ? $translate.instant('services.position.hockey.goaltender.abbreviation') 2244 : $translate.instant('services.position.hockey.goaltender.text'); 2245 2246 case 'hockeyleftwing': 2247 return type === 'abbreviation' 2248 ? $translate.instant('services.position.hockey.leftWing.abbreviation') 2249 : $translate.instant('services.position.hockey.leftWing.text'); 2250 2251 case 'hockeyplayer': 2252 return type === 'abbreviation' 2253 ? $translate.instant('services.position.hockey.player.abbreviation') 2254 : $translate.instant('services.position.hockey.player.text'); 2255 2256 case 'hockeyrightwing': 2257 return type === 'abbreviation' 2258 ? $translate.instant('services.position.hockey.rightWing.abbreviation') 2259 : $translate.instant('services.position.hockey.rightWing.text'); 2260 2261 // Football 2262 case 'footballquarterback': 2263 return type === 'abbreviation' 2264 ? $translate.instant('services.position.football.quarterback.abbreviation') 2265 : $translate.instant('services.position.football.quarterback.text'); 2266 2267 case 'footballrunningback': 2268 return type === 'abbreviation' 2269 ? $translate.instant('services.position.football.runningback.abbreviation') 2270 : $translate.instant('services.position.football.runningback.text'); 2271 2272 case 'footballwidereceiver': 2273 return type === 'abbreviation' 2274 ? $translate.instant('services.position.football.widereceiver.abbreviation') 2275 : $translate.instant('services.position.football.widereceiver.text'); 2276 2277 case 'footballtightend': 2278 return type === 'abbreviation' 2279 ? $translate.instant('services.position.football.tightend.abbreviation') 2280 : $translate.instant('services.position.football.tightend.text'); 2281 2282 case 'footballcenter': 2283 return type === 'abbreviation' 2284 ? $translate.instant('services.position.football.center.abbreviation') 2285 : $translate.instant('services.position.football.center.text'); 2286 2287 case 'footballoffensiveguard': 2288 return type === 'abbreviation' 2289 ? $translate.instant('services.position.football.offensiveguard.abbreviation') 2290 : $translate.instant('services.position.football.offensiveguard.text'); 2291 2292 case 'footballoffensivetackle': 2293 return type === 'abbreviation' 2294 ? $translate.instant('services.position.football.offensivetackle.abbreviation') 2295 : $translate.instant('services.position.football.offensivetackle.text'); 2296 2297 case 'footballdefensivetackle': 2298 return type === 'abbreviation' 2299 ? $translate.instant('services.position.football.defensivetackle.abbreviation') 2300 : $translate.instant('services.position.football.defensivetackle.text'); 2301 2302 case 'footballdefensiveend': 2303 return type === 'abbreviation' 2304 ? $translate.instant('services.position.football.defensiveend.abbreviation') 2305 : $translate.instant('services.position.football.defensiveend.text'); 2306 2307 case 'footballtackle': 2308 return type === 'abbreviation' 2309 ? $translate.instant('services.position.football.tackle.abbreviation') 2310 : $translate.instant('services.position.football.tackle.text'); 2311 2312 case 'footballhalfback': 2313 return type === 'abbreviation' 2314 ? $translate.instant('services.position.football.halfback.abbreviation') 2315 : $translate.instant('services.position.football.halfback.text'); 2316 2317 case 'footballlinebacker': 2318 return type === 'abbreviation' 2319 ? $translate.instant('services.position.football.linebacker.abbreviation') 2320 : $translate.instant('services.position.football.linebacker.text'); 2321 2322 case 'footballoutsidelinebacker': 2323 return type === 'abbreviation' 2324 ? $translate.instant('services.position.football.outsidelinebacker.abbreviation') 2325 : $translate.instant('services.position.football.outsidelinebacker.text'); 2326 2327 case 'footballmiddlelinebacker': 2328 return type === 'abbreviation' 2329 ? $translate.instant('services.position.football.middlelinebacker.abbreviation') 2330 : $translate.instant('services.position.football.middlelinebacker.text'); 2331 2332 case 'footballdefensiveback': 2333 return type === 'abbreviation' 2334 ? $translate.instant('services.position.football.defensiveback.abbreviation') 2335 : $translate.instant('services.position.football.defensiveback.text'); 2336 2337 case 'footballcornerback': 2338 return type === 'abbreviation' 2339 ? $translate.instant('services.position.football.cornerback.abbreviation') 2340 : $translate.instant('services.position.football.cornerback.text'); 2341 2342 case 'footballdefensivehalfback': 2343 return type === 'abbreviation' 2344 ? $translate.instant('services.position.football.defensivehalfback.abbreviation') 2345 : $translate.instant('services.position.football.defensivehalfback.text'); 2346 2347 case 'footballslotback': 2348 return type === 'abbreviation' 2349 ? $translate.instant('services.position.football.slotback.abbreviation') 2350 : $translate.instant('services.position.football.slotback.text'); 2351 2352 case 'footballfullback': 2353 return type === 'abbreviation' 2354 ? $translate.instant('services.position.football.fullback.abbreviation') 2355 : $translate.instant('services.position.football.fullback.text'); 2356 2357 case 'footballfreesafety': 2358 return type === 'abbreviation' 2359 ? $translate.instant('services.position.football.freesafety.abbreviation') 2360 : $translate.instant('services.position.football.freesafety.text'); 2361 2362 case 'footballstrongsafety': 2363 return type === 'abbreviation' 2364 ? $translate.instant('services.position.football.strongsafety.abbreviation') 2365 : $translate.instant('services.position.football.strongsafety.text'); 2366 2367 case 'footballkicker': 2368 return type === 'abbreviation' 2369 ? $translate.instant('services.position.football.kicker.abbreviation') 2370 : $translate.instant('services.position.football.kicker.text'); 2371 2372 case 'footballpunter': 2373 return type === 'abbreviation' 2374 ? $translate.instant('services.position.football.punter.abbreviation') 2375 : $translate.instant('services.position.football.punter.text'); 2376 2377 case 'footballkickreturner': 2378 return type === 'abbreviation' 2379 ? $translate.instant('services.position.football.kickreturner.abbreviation') 2380 : $translate.instant('services.position.football.kickreturner.text'); 2381 2382 case 'footballpuntreturner': 2383 return type === 'abbreviation' 2384 ? $translate.instant('services.position.football.puntreturner.abbreviation') 2385 : $translate.instant('services.position.football.puntreturner.text'); 2386 2387 case 'footballlongsnapper': 2388 return type === 'abbreviation' 2389 ? $translate.instant('services.position.football.longsnapper.abbreviation') 2390 : $translate.instant('services.position.football.longsnapper.text'); 2391 2392 case 'footballkickoffspecialist': 2393 return type === 'abbreviation' 2394 ? $translate.instant('services.position.football.kickoffspecialist.abbreviation') 2395 : $translate.instant('services.position.football.kickoffspecialist.text'); 2396 2397 //Basketball 2398 case 'basketballpointguard': 2399 return type === 'abbreviation' 2400 ? $translate.instant('services.position.basketball.pointGuard.abbreviation') 2401 : $translate.instant('services.position.basketball.pointGuard.text'); 2402 case 'basketballshootingguard': 2403 return type === 'abbreviation' 2404 ? $translate.instant('services.position.basketball.shootingGua
2404rd.abbreviation') 2405 : $translate.instant('services.position.basketball.shootingGuard.text'); 2406 case 'basketballsmallforward': 2407 return type === 'abbreviation' 2408 ? $translate.instant('services.position.basketball.smallForward.abbreviation') 2409 : $translate.instant('services.position.basketball.smallForward.text'); 2410 case 'basketballpowerforward': 2411 return type === 'abbreviation' 2412 ? $translate.instant('services.position.basketball.powerForward.abbreviation') 2413 : $translate.instant('services.position.basketball.powerForward.text'); 2414 case 'basketballcenter': 2415 return type === 'abbreviation' 2416 ? $translate.instant('services.position.basketball.center.abbreviation') 2417 : $translate.instant('services.position.basketball.center.text'); 2418 case 'basketballcomboguard': 2419 return type === 'abbreviation' 2420 ? $translate.instant('services.position.basketball.comboGuard.abbreviation') 2421 : $translate.instant('services.position.basketball.comboGuard.text'); 2422 case 'basketballswingman': 2423 return type === 'abbreviation' 2424 ? $translate.instant('services.position.basketball.swingman.abbreviation') 2425 : $translate.instant('services.position.basketball.swingman.text'); 2426 case 'basketballpointforward': 2427 return type === 'abbreviation' 2428 ? $translate.instant('services.position.basketball.pointForward.abbreviation') 2429 : $translate.instant('services.position.basketball.pointForward.text'); 2430 case 'basketballpointforward2': 2431 return type === 'abbreviation' 2432 ? $translate.instant('services.position.basketball.pointForward2.abbreviation') 2433 : $translate.instant('services.position.basketball.pointForward2.text'); 2434 case 'basketballcomboforward': 2435 return type === 'abbreviation' 2436 ? $translate.instant('services.position.basketball.comboForward.abbreviation') 2437 : $translate.instant('services.position.basketball.comboForward.text'); 2438 case 'basketballforwardcenter': 2439 return type === 'abbreviation' 2440 ? $translate.instant('services.position.basketball.forwardCenter.abbreviation') 2441 : $translate.instant('services.position.basketball.forwardCenter.text'); 2442 default: 2443 return ''; 2444 } 2445 /*public const short undefined = 0; 2446 2447 public const short baseballpitcher = 61; 2448 public const short baseballfirstBase = 62; 2449 public const short baseballsecondBase = 63; 2450 public const short baseballthirdBase = 64; 2451 public const short baseballshortStop = 65; 2452 public const short baseballcatcher = 66; 2453 public const short baseballleftField = 67; 2454 public const short baseballcenterField = 68; 2455 public const short baseballrightField = 69; 2456 public const short baseballdesignatedHitter = 75; 2457 public const short baseballoutfielder = 135; 2458 public const short baseballrover = 136; 2459 public const short baseballinfielder = 137; 2460 public const short footballquarterback = 34; 2461 public const short footballrunningBack = 35; 2462 public const short footballhalfback = 36; 2463 public const short footballfullback = 37; 2464 public const short footballwideReceiver = 38; 2465 public const short footballdefensiveHalfback = 39; 2466 public const short footballoffensiveTackle = 40; 2467 public const short footballcenter = 41; 2468 public const short footballoffensiveGuard = 42; 2469 public const short footballslotBack = 43; 2470 public const short footballtackle = 44; 2471 public const short footballdefensiveTackle = 45; 2472 public const short footballstrongSafety = 46; 2473 public const short footballdefensiveEnd = 47; 2474 public const short footballlinebacker = 48; 2475 public const short footballoutsideLinebacker = 49; 2476 public const short footballmiddleLinebacker = 50; 2477 public const short footballdefensiveBack = 51; 2478 public const short footballcornerback = 52; 2479 public const short footballdefensiveend = 53; 2480 public const short footballpunter = 54; 2481 public const short footballkicker = 55; 2482 public const short footballpuntReturner = 56; 2483 public const short footballfreeSafety = 70; 2484 public const short footballtightEnd = 71; 2485 public const short footballlongSnapper = 72; 2486 public const short footballkickoffSpecialist = 73; 2487 public const short footballkickReturner = 74; 2488 public const short basketballpointGuard = 76; 2489 public const short basketballshootingGuard = 77; 2490 public const short basketballsmallForward = 78; 2491 public const short basketballpowerForward = 79; 2492 public const short basketballcenter = 80; 2493 public const short soccergoalkeeper = 57; 2494 public const short soccerdefender = 58; 2495 public const short soccermidfield = 59; 2496 public const short soccerattacking = 60; 2497 public const short volleyballmiddle = 87; 2498 public const short volleyballsetter = 88; 2499 public const short volleyballlibero = 89; 2500 public const short volleyballhitter = 90; 2501 public const short genericplayer = 138; 2502 public const short dekhockeydefensmen = 81; 2503 public const short dekhockeyforward = 82; 2504 public const short dekhockeyrightWing = 83; 2505 public const short dekhockeyleftWing = 84; 2506 public const short dekhockeycenter = 85; 2507 public const short dekhockeygoaltender = 86; 2508 public const short rugbyforward = 91; 2509 public const short rugbyfirstRow = 92; 2510 public const short rugbysecondRow = 93; 2511 public const short rugbythirdRow = 94; 2512 public const short rugbyhalf = 95; 2513 public const short rugbybackRows = 96; 2514 public const short rugbycenter = 97; 2515 public const short rugbywing = 98; 2516 public const short rugbylooseHeadProp = 99; 2517 public const short rugbyprop = 100; 2518 public const short rugbyhooker = 101; 2519 public const short rugbytightHeadProp = 102; 2520 public const short rugbylock = 103; 2521 public const short rugbyleftLock = 104; 2522 public const short rugbyrightLock = 105; 2523 public const short rugbyflanker = 106; 2524 public const short rugbyblindsideFlanker = 107; 2525 public const short rugbyopensideFlanker = 108; 2526 public const short rugbynumber = 109; 2527 public const short rugbyscrumHalf = 110; 2528 public const short rugbyflyHalf = 111; 2529 public const short rugbyoutsideHalf = 112; 2530 public const short rugbyleftCenter = 113; 2531 public const short rugbyinsideCenter = 114; 2532 public const short rugbyrightCenter = 115; 2533 public const short rugbyoutsideCenter = 116; 2534 public const short rugbyleftWing = 117; 2535 public const short rugbyrightWing = 118; 2536 public const short rugbyfullBack = 119; 2537 public const short frisbeehandler = 120; 2538 public const short frisbeecutter = 121; 2539 public const short handballrightWinger = 122; 2540 public const short handballrightBack = 123; 2541 public const short handballcenterBack = 124; 2542 public const short handballleftBack = 125; 2543 public const short handballleftWinger = 126; 2544 public const short handballcenterForward = 127; 2545 public const short handballgoalKeeper = 128; 2546 public const short ringuettecenter = 129; 2547 public const short ringuetteforward = 130; 2548 public const short ringuetteleftWinger = 131; 2549 public const short ringuetterightWinger = 132; 2550 public const short ringuettedefender = 133; 2551 public const short ringuettegoaltender = 134; */ 2552 } 2553 2554 function getStaffPosition(type) { 2555 switch (type) { 2556 case 'teamassistantcoach': // 1 2557 return $translate.instant('services.staff.team.assistant.coach'); 2558 2559 case 'teamgeneralmanager': // 2 2560 return $translate.instant('services.staff.team.general.manager'); 2561 2562 case 'teamheadcoach': // 3 2563 return $translate.instant('services.staff.team.head.coach'); 2564 2565 case 'orggeneralmanager': // 6 2566 return $translate.instant('services.staff.league.generalManager'); 2567 2568 case 'orgofficial': // 7 2569 return $translate.instant('services.staff.league.official'); 2570 2571 case 'orglinesman': // 8 2572 return $translate.instant('services.staff.league.linesman'); 2573 2574 case 'orgscorekeeper': // 9 2575 return $translate.instant('services.staff.league.scoreKeeper'); 2576 2577 case 'orgsecretary': // 10 2578 return $translate.instant('services.staff.league.secretary'); 2579 2580 case 'teamgoaltendingcoach': // 11 2581 return $translate.instant('services.staff.team.goaltending.coach'); 2582 2583 case 'teamassitantgeneralmanager': // 12 2584 return $translate.instant('services.staff.team.assistant.general.manager'); 2585 2586 case 'teampresident': // 13 2587 return $translate.instant('services.staff.team.president'); 2588 2589 case 'teamequipmentmanager': // 14 2590 return $translate.instant('services.staff.team.equipment.manager'); 2591 2592 case 'teamathletictherapist': // 15 2593 return $translate.instant('services.staff.team.athletic.therapist'); 2594
2595 case 'teamstrengthconditioningcoach': // 16 2596 return $translate.instant('services.staff.team.strength.conditioning.coach'); 2597 2598 case 'teamsecretary': // 17 2599 return $translate.instant('services.staff.team.secretary'); 2600 2601 case 'teamtreasurer': // 18 2602 return $translate.instant('services.staff.team.treasurer'); 2603 2604 case 'teammemberoftheboard': // 19 2605 return $translate.instant('services.staff.team.memberOfTheBoard'); 2606 2607 case 'orgassistantgeneralmanager': // 20 2608 return $translate.instant('services.staff.league.assistant.general.manager'); 2609 2610 case 'orgpresident': // 21 2611 return $translate.instant('services.staff.league.president'); 2612 2613 case 'orgtreasurer': // 22 2614 return $translate.instant('services.staff.league.treasurer'); 2615 2616 case 'orgmemberoftheboard': // 23 2617 return $translate.instant('services.staff.league.memberOfTheBoard'); 2618 2619 case 'orgrefereeinchief': // 24 2620 return $translate.instant('services.staff.league.refereeInChief'); 2621 2622 case 'orgreferee': // 25 2623 return $translate.instant('services.staff.league.referee'); 2624 2625 case 'orgadministrator': // 26 2626 return $translate.instant('services.staff.league.administrator'); 2627 2628 case 'orgstatistician': // 27 2629 return $translate.instant('services.staff.league.statistician'); 2630 2631 case 'orgmediamanager': // 28 2632 return $translate.instant('services.staff.league.mediaManager'); 2633 2634 case 'teammanager': // 29 2635 return $translate.instant('services.staff.team.manager'); 2636 2637 case 'orgtimekeeper': // 33 2638 return $translate.instant('services.staff.league.timeKeeper'); 2639 2640 case 'organnouncer': // 34 2641 return $translate.instant('services.staff.league.announcer'); 2642 2643 case 'teamcoach': // 35 2644 return $translate.instant('services.staff.team.coach'); 2645 2646 case 'orgleagueofficial': // 36 2647 return $translate.instant('services.staff.league.leagueOfficial'); 2648 2649 case 'orgeventsecurity': // 37 2650 return $translate.instant('services.staff.league.eventSecurity'); 2651 2652 case 'orgmedicalstaff': // 38 2653 return $translate.instant('services.staff.league.medicalStaff'); 2654 2655 case 'teamstatistician': // 39 2656 return $translate.instant('services.staff.team.statistician'); 2657 2658 case 'teamlockerroommanager': // 40 2659 return $translate.instant('services.staff.team.lockerRoomManager'); 2660 2661 case 'orgshotclockoperator': // 41 2662 return $translate.instant('services.staff.league.shotClockOperator'); 2663 } 2664 2665 } 2666 2667 function getStaffPositions() { 2668 return [{ id: 'teamassistantcoach', name: $translate.instant('services.staff.team.assistant.coach') }, 2669 { id: 'teamgeneralmanager', name: $translate.instant('services.staff.team.general.manager') }, 2670 { id: 'teamheadcoach', name: $translate.instant('services.staff.team.head.coach') }, 2671 { id: 'orggeneralmanager', name: $translate.instant('services.staff.league.generalManager') }, 2672 { id: 'orgofficial', name: $translate.instant('services.staff.league.official') }, 2673 { id: 'orglinesman', name: $translate.instant('services.staff.league.linesman') }, 2674 { id: 'orgscorekeeper', name: $translate.instant('services.staff.league.scoreKeeper') }, 2675 { id: 'orgsecretary', name: $translate.instant('services.staff.league.secretary') }, 2676 { id: 'teamgoaltendingcoach', name: $translate.instant('services.staff.team.goaltending.coach') }, 2677 { id: 'teamassitantgeneralmanager', name: $translate.instant('services.staff.team.assistant.general.manager') }, 2678 { id: 'teampresident', name: $translate.instant('services.staff.team.president') }, 2679 { id: 'teamequipmentmanager', name: $translate.instant('services.staff.team.equipment.manager') }, 2680 { id: 'teamathletictherapist', name: $translate.instant('services.staff.team.athletic.therapist') }, 2681 { id: 'teamstrengthconditioningcoach', name: $translate.instant('services.staff.team.strength.conditioning.coach') }, 2682 { id: 'teamsecretary', name: $translate.instant('services.staff.team.secretary') }, 2683 { id: 'teamtreasurer', name: $translate.instant('services.staff.team.treasurer') }, 2684 { id: 'teammemberoftheboard', name: $translate.instant('services.staff.team.memberOfTheBoard') }, 2685 { id: 'orgassistantgeneralmanager', name: $translate.instant('services.staff.league.assistant.general.manager') }, 2686 { id: 'orgpresident', name: $translate.instant('services.staff.league.president') }, 2687 { id: 'orgtreasurer', name: $translate.instant('services.staff.league.treasurer') }, 2688 { id: 'orgmemberoftheboard', name: $translate.instant('services.staff.league.memberOfTheBoard') }, 2689 { id: 'orgrefereeinchief', name: $translate.instant('services.staff.league.refereeInChief') }, 2690 { id: 'orgreferee', name: $translate.instant('services.staff.league.referee') }, 2691 { id: 'orgadministrator', name: $translate.instant('services.staff.league.administrator') }, 2692 { id: 'orgstatistician', name: $translate.instant('services.staff.league.statistician') }, 2693 { id: 'orgmediamanager', name: $translate.instant('services.staff.league.mediaManager') }, 2694 { id: 'teammanager', name: $translate.instant('services.staff.team.manager') }, 2695 { id: 'orgtimekeeper', name: $translate.instant('services.staff.league.timeKeeper') }, 2696 { id: 'organnouncer', name: $translate.instant('services.staff.league.announcer') }, 2697 { id: 'teamcoach', name: $translate.instant('services.staff.team.coach') }, 2698 { id: 'orgleagueofficial', name: $translate.instant('services.staff.league.leagueOfficial') }, 2699 { id: 'orgeventsecurity', name: $translate.instant('services.staff.league.eventSecurity') }, 2700 { id: 'orgmedicalstaff', name: $translate.instant('services.staff.league.medicalStaff') }, 2701 { id: 'teamstatistician', name: $translate.instant('services.staff.team.statistician') }, 2702 { id: 'orgshotclockoperator', name: $translate.instant('services.staff.team.orgshotclockoperator') }, 2703 { id: 'teamlockerroommanager', name: $translate.instant('services.staff.team.lockerRoomManager') }, 2704 ] 2705 } 2706 2707 function getStaffTeamPositions() { 2708 return [{ id: 'teamassistantcoach', name: $translate.instant('services.staff.team.assistant.coach') }, 2709 { id: 'teamgeneralmanager', name: $translate.instant('services.staff.team.general.manager') }, 2710 { id: 'teamheadcoach', name: $translate.instant('services.staff.team.head.coach') }, 2711 { id: 'teamgoaltendingcoach', name: $translate.instant('services.staff.team.goaltending.coach') }, 2712 { id: 'teamassitantgeneralmanager', name: $translate.instant('services.staff.team.assistant.general.manager') }, 2713 { id: 'teampresident', name: $translate.instant('services.staff.team.president') }, 2714 { id: 'teamequipmentmanager', name: $translate.instant('services.staff.team.equipment.manager') }, 2715 { id: 'teamathletictherapist', name: $translate.instant('services.staff.team.athletic.therapist') }, 2716 { id: 'teamstrengthconditioningcoach', name: $translate.instant('services.staff.team.strength.conditioning.coach') }, 2717 { id: 'teamsecretary', name: $translate.instant('services.staff.team.secretary') }, 2718 { id: 'teamtreasurer', name: $translate.instant('services.staff.team.treasurer') }, 2719 { id: 'teammemberoftheboard', name: $translate.instant('services.staff.team.memberOfTheBoard') }, 2720 { id: 'teammanager', name: $translate.instant('services.staff.team.manager') }, 2721 { id: 'teamcoach', name: $translate.instant('services.staff.team.coach') }, 2722 { id: 'teamlockerroommanager', name: $translate.instant('services.staff.team.lockerRoomManager') }, 2723 ] 2724 } 2725 2726 function getStaffSolutionPositions() { 2727 return [{ id: 'orggeneralmanager', name: $translate.instant('services.staff.league.generalManager') }, 2728 { id: 'orgofficial', name: $translate.instant('services.staff.league.official') }, 2729 { id: 'orglinesman', name: $translate.instant('services.staff.league.linesman') }, 2730 { id: 'orgscorekeeper', name: $translate.instant('services.staff.league.scoreKeeper') }, 2731 { id: 'orgsecretary', name: $translate.instant('services.staff.league.secretary') }, 2732 { id: 'orgassistantgeneralmanager', name: $translate.instant('services.staff.league.assistant.general.manager') }, 2733 { id: 'orgpresident', name: $translate.instant('services.staff.league.president') }, 2734 { id: 'orgtreasurer', name: $translate.instant('services.staff.league.treasurer') }, 2735 { id: 'orgmemberoftheboard', name: $translate.instant('services.staff.league.memberOfTheBoard') }, 2736 { id: 'orgrefereeinchief', name: $translate.instant('services.staff.league.refereeInChief') }, 2737 { id: 'orgreferee', name: $translate.instant('services.staff.league.referee') }, 2738 { id: 'orgadministrator', name: $translate.instant('services.staff.league.administrator') }, 2739 { id: 'orgstatistician', name: $translate.instant('services.staff.league.statistician') }, 2740 { id: 'orgmediamanager', name: $translate.instant('services.staff.league.mediaManager') }, 2741 { id: 'orgtimekeeper', name: $translate.instant('services.staff.league.timeKeeper') }, 2742 { id: 'organnouncer', name: $translate.instant('services.staff.league.announcer') }, 2743 { id: 'orgleagueofficial', name: $translate.instant('services.staff.league.leagueOfficial') }, 2744 { id: 'orgeventsecurity', name: $translate.instant('services.staff.league.eventSecurity') }, 2745 { id: 'orgmedicalstaff', name: $translate.instant('services.staff.league.medicalStaff') }, 2746 { id: 'orgshotclockoperator', name: $translate.instant('services.staff.league.shotClockOperator') }, 2747 ] 2748 } 2749 } 2750})();; 2751(function () { 2752 'use strict'; 2753 2754 angular 2755 .module('app.services') 2756 .factory('SeasonService', seasonService); 2757 2758 seasonService.$inject = ['$http', '$q']; 2759 2760 function seasonService($http, $q) { 2761 return { 2762 getSeasonsBySolutionId: getSeasonsBySolutionId, 2763 getSeasonBySeasonId: getSeasonBySeasonId, 2764 getSeasonParametersBySeasonId: getSeasonParametersBySeasonId, 2765 getSeasonsByContainerId: getSeasonsByContainerId, 2766 getSeasonsByContainerIdDivisions: getSeasonsByContainerIdDivisions, 2767 getSeasonsBySolutionIdDivisions: getSeasonsBySolutionIdDivisions 2768 } 2769 2770 function getSeasonsBySolutionId(solutionId, options) { 2771 var queryString = '?'; 2772 2773 if (options) { 2774 for (var option in options) { 2775 if (queryString) { 2776 queryString += '&' 2777 } 2778 2779 queryString += `${option}=${encodeURI(options[option])}`; 2780 } 2781 } 2782 2783 return $q(function (resolve, reject) { 2784 $http.get(`api/v2/solutions/${solutionId}/seasons${queryString}`) 2785 .then(function (response) { 2786 resolve(response); 2787 }, function (response) { 2788 reject(response); 2789 }); 2790 }); 2791 } 2792 2793 function getSeasonsBySolutionIdDivisions(solutionId, options) { 2794 var queryString = '?'; 2795 2796 if (options) { 2797 for (var option in options) { 2798 if (queryString) { 2799 queryString += '&' 2800 } 2801 2802 queryString += `${option}=${encodeURI(options[option])}`; 2803 } 2804 } 2805 2806 return $q(function (resolve, reject) { 2807 $http.get(`api/v2/solutions/${solutionId}
2807/seasons/containdivision${queryString}`) 2808 .then(function (response) { 2809 resolve(response); 2810 }, function (response) { 2811 reject(response); 2812 }); 2813 }); 2814 } 2815 2816 function getSeasonBySeasonId(solutionId, seasonId) { 2817 return $q(function (resolve, reject) { 2818 $http.get(`api/v2/solutions/${solutionId}/seasons/${seasonId}`) 2819 .then(function (response) { 2820 resolve(response); 2821 }, function (response) { 2822 reject(response); 2823 }); 2824 }); 2825 } 2826 2827 function getSeasonParametersBySeasonId(solutionId, seasonId) { 2828 return $q(function (resolve, reject) { 2829 $http.get(`api/v2/solutions/${solutionId}/seasons/${seasonId}/parameters`) 2830 .then(function (response) { 2831 resolve(response); 2832 }, function (response) { 2833 reject(response); 2834 }); 2835 }); 2836 } 2837 2838 function getSeasonsByContainerId(solutionId, containerId, seasonId) { 2839 var url = `api/v2/solutions/${solutionId}/containers/${containerId}`; 2840 2841 if (seasonId) { 2842 url += `?seasonId=${seasonId}`; 2843 } 2844 2845 return $q(function (resolve, reject) { 2846 $http.get(url) 2847 .then(function (response) { 2848 resolve(response); 2849 }, function (response) { 2850 reject(response); 2851 }); 2852 }); 2853 } 2854 2855 function getSeasonsByContainerIdDivisions(solutionId, containerId) { 2856 return $q(function (resolve, reject) { 2857 $http.get(`api/v2/solutions/${solutionId}/containers/${containerId}/containdivision`) 2858 .then(function (response) { 2859 resolve(response); 2860 }, function (response) { 2861 reject(response); 2862 }); 2863 }); 2864 } 2865 } 2866})();; 2867(function () { 2868 'use strict'; 2869 2870 angular 2871 .module('app.services') 2872 .factory('ContainerService', containerService); 2873 2874 containerService.$inject = ['$http', '$q']; 2875 2876 function containerService($http, $q) { 2877 return { 2878 getContainersBySolutionId: getContainersBySolutionId 2879 } 2880 2881 function getContainersBySolutionId(solutionId) { 2882 return $q(function (resolve, reject) { 2883 $http.get(`api/v2/solutions/${solutionId}/folder`) 2884 .then(function (response) { 2885 resolve(response); 2886 }, function (response) { 2887 reject(response); 2888 }); 2889 }); 2890 } 2891 } 2892})();; 2893(function () { 2894 'use strict'; 2895 2896 angular 2897 .module('app.services') 2898 .factory('SolutionService', solutionService); 2899 2900 solutionService.$inject = ['$http', '$q', '$sessionStorage']; 2901 2902 function solutionService($http, $q, $sessionStorage) { 2903 var solutionPromise = null; 2904 var solution = null; 2905 2906 return { 2907 getSolutionById: getSolutionById 2908 } 2909 2910 function getSolutionById(solutionId) { 2911 if (solution != solutionId || solutionPromise == null) { 2912 solution = solutionId; 2913 solutionPromise = $q(function (resolve, reject) { 2914 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/config`) 2915 .then(function (response) { 2916 resolve(response); 2917 }, function (response) { 2918 reject(response); 2919 }); 2920 }); 2921 } 2922 return solutionPromise; 2923 } 2924 } 2925})();; 2926(function () { 2927 'use strict'; 2928 2929 angular 2930 .module('app.services') 2931 .factory('StaffService', staffService); 2932 2933 staffService.$inject = ['$http', '$q', '$sessionStorage']; 2934 2935 function staffService($http, $q, $sessionStorage) { 2936 return { 2937 getBySolutionId: getBySolutionId, 2938 getAge: getAge, 2939 getStaffByTeamId: getStaffByTeamId, 2940 create: create 2941 } 2942 2943 function getBySolutionId(solutionId) { 2944 return $q(function (resolve, reject) { 2945 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/staff`) 2946 .then(function (response) { 2947 resolve(response); 2948 }, function (response) { 2949 reject(response); 2950 }); 2951 }); 2952 } 2953 2954 function getAge(birthday) { 2955 return moment().diff(birthday, 'years') 2956 } 2957 2958 function getStaffByTeamId(teamId) { 2959 return $q(function (resolve, reject) { 2960 $http.get(`/api/v2/teams/${teamId}/staff`) 2961 .then(function (response) { 2962 resolve(response); 2963 }, function (response) { 2964 reject(response); 2965 }); 2966 }); 2967 } 2968 2969 function create(solutionId, staff) { 2970 return $q(function (resolve, reject) { 2971 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/staff`, staff) 2972 .then(function (response) { 2973 resolve(response); 2974 }, function (response) { 2975 reject(response); 2976 }); 2977 }); 2978 } 2979 } 2980})();; 2981(function () { 2982 'use strict'; 2983 2984 angular 2985 .module('app.services') 2986 .factory('SocialMediaService', socialMediaService); 2987 2988 socialMediaService.$inject = ['$http', '$q', '$sessionStorage']; 2989 2990 function socialMediaService($http, $q, $sessionStorage) { 2991 return { 2992 getLatestPosts: getLatestPosts, 2993 getFacebookPages: getFacebookPages 2994 } 2995 2996 2997 function getLatestPosts(solutionId, ids) { 2998 var queryString = ''; 2999 3000 if (ids) { 3001 queryString += `ids=${ids.join(',')}` 3002 } 3003 3004 return $q(function (resolve, reject) { 3005 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solutions/${solutionId}/social-media/latest-posts?${queryString}`) 3006 .then(function (response) { 3007 resolve(response); 3008 }, function (response) { 3009 reject(response); 3010 }); 3011 }); 3012 } 3013 3014 function getFacebookPages(solutionId, id) { 3015 var queryString = `id=${id}`; 3016 3017 return $q(function (resolve, reject) { 3018 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solutions/${solutionId}/social-media/facebook-pages?${queryString}`) 3019 .then(function (response) { 3020 resolve(response); 3021 }, function (response) { 3022 reject(response); 3023 }); 3024 }); 3025 } 3026 } 3027})();; 3028(function () { 3029 'use strict'; 3030 3031 angular 3032 .module('app.services') 3033 .factory('StatisticService', statisticService); 3034 3035 statisticService.$inject = ['$http', '$q', '$sessionStorage']; 3036 3037 function statisticService($http, $q, $sessionStorage) { 3038 return { 3039 getPlayerStatisticByStatId: getPlayerStatisticByStatId, 3040 getPlayerStatisticColumnsByColumnIds: getPlayerStatisticColumnsByColumnIds, 3041 getPlayerStatisticColumnsBySportId: getPlayerStatisticColumnsBySportId, 3042 getPlayerConfigStatisticColumnsBySportId: getPlayerConfigStatisticColumnsBySportId, 3043 getPlayerStatisticsBySolutionId: getPlayerStatisticsBySolutionId, 3044 getPlayerLeadersByStatisticId: getPlayerLeadersByStatisticId, 3045 getPlayerStatisticsDateRangeBySolutionId: getPlayerStatisticsDateRangeBySolutionId, 3046 getPlayersStatisticsByTeamId: getPlayersStatisticsByTeamId, 3047 getPlayerAllStatisticsByPlayerId: getPlayerAllStatisticsByPlayerId, 3048 getTeamStatisticByStatId: getTeamStatisticByStatId, 3049 getTeamStatisticColumnsByColumnIds: getTeamStatisticColumnsByColumnIds, 3050 getTeamStatisticColumnsBySportId: getTeamStatisticColumnsBySportId, 3051 getTeamStatisticsBySolutionId: getTeamStatisticsBySolutionId, 3052 getSummarizedTeamStatisticsBySolutionId: getSummarizedTeamStatisticsBySolutionId, 3053 getTeamAllStatisticsByTeamId: getTeamAllStatisticsByTeamId, 3054 getTeamPlayerStatisticsByTeamId: getTeamPlayerStatisticsByTeamId, 3055 getSportTeamStatsByType: getSportTeamStatsByType, 3056 getTeamLeadersBySolutionId: getTeamLeadersBySolutionId, 3057 getPlayerLeadersByStatistic: getPlayerLeadersByStatistic, 3058 getPlayerLeaderBySeasons: getPlayerLeaderBySeasons 3059 } 3060 3061 function getPlayerStatisticByStatId(statId) { 3062 switch (statId) { 3063 case 6: 3064 return { id: 6, name: 'services.statistic.player.goals.text', abbreviation: 'services.statistic.player.goals.abbreviation' }; 3065 3066 case 7: 3067 return { id: 7, name: 'services.statistic.player.assists.text', abbreviation: 'services.statistic.player.assists.abbreviation' }; 3068 3069 case 8: 3070 return { id: 8, name: 'services.statistic.player.penaltyInMinute.text', abbreviation: 'services.statistic.player.penaltyInMinute.abbreviation' }; 3071 3072 case 9: 3073 return { id: 9, name: 'services.statistic.player.shots.text', abbreviation: 'services.statistic.player.shots.abbreviation' }; 3074 3075 case 10: 3076 return { id: 10, name: 'services.statistic.player.save.text', abbreviation: 'services.statistic.player.save.abbreviation' }; 3077 3078 case 11: 3079 return { id: 11, name: 'services.statistic.player.check.text', abbreviation: 'services.statistic.player.check.abbreviation' }; 3080 3081 case 12: 3082 return { id: 12, name: 'services.statistic.player.shootoutGoal.text', abbreviation: 'services.statistic.player.shootoutGoal.abbreviation' }; 3083 3084 case 13: 3085 return { id: 13, name: 'services.statistic.player.shootoutSave.text', abbreviation: 'services.statistic.player.shootoutSave.abbreviation' }; 3086 3087 case 14: 3088 return { id: 14, name: 'services.statistic.player.gamePlayed.text', abbreviation: 'services.statistic.player.gamePlayed.abbreviation' }; 3089 3090 case 15: 3091 return { id: 15, name: 'services.statistic.player.victory.text', abbreviation: 'services.statistic.player.victory.abbreviation' }; 3092 3093 case 16: 3094 return { id: 16, name: 'services.statistic.player.defeat.text', abbreviation: 'services.statistic.player.defeat.abbreviation' }; 3095 3096 case 17: 3097 return { id: 17, name: 'services.statistic.player.draw.text', abbreviation: 'services.statistic.player.draw.abbreviation' }; 3098 3099 case 19: 3100 return { id: 19, name: 'services.statistic.player.overtimeDefeat.text', abbreviation: 'services.statistic.player.overtimeDefeat.abbreviation' }; 3101 3102 case 20: 3103 return { id: 20, name: 'services.statistic.player.shootoutWin.text', abbreviation: 'services.statistic.player.shootoutWin.abbreviation' }; 3104 3105 case 21: 3106 return { id: 21, name: 'services.statistic.player.shootoutDefeat.text', abbreviation: 'services.statistic.player.shootoutDefeat.abbreviation' }; 3107 3108 case 22: 3109 return { id: 22, name: 'services.statistic.player.goalAgaints.text', abbreviation: 'services.statistic.player.goalAgaints.abbreviation' }; 3110 3111 case 23: 3112 return { id: 23, name: 'services.statistic.player.shotAgainst.text', abbreviation: 'services.statistic.player.shotAgainst.abbreviation' }; 3113 3114 case 24: 3115 return { id: 24, name: 'services.statistic.player.minutes.text', abbreviation: 'services.statistic.player.minutes.abbreviation' }; 3116 3117 case 25: 3118 return { id: 25, name: 'services.statistic.player.shutout.text', abbreviation: 'services.statistic.player.shutout.abbreviation', tooltip: 'services.statistic.player.shutout.tooltip' }; 3119 3120 case 26: 3121 return { id: 26, name: 'services.statistic.player.powerplayGoal.text', abbreviation: 'services.statistic.player.powerplayGoal.abbreviation' }; 3122 3123 case 27: 3124 return { id: 27, name: 'services.statistic.player.shorthandedGoal.text', abbreviation: 'services.statistic.player.shorthandedGoal.abbreviation' }; 3125 3126 case 28: 3127 return { id: 28, name: 'services.statistic.player.winningGoal.text', abbreviation: 'services.statistic.player.winningGoal.abbreviation' }; 3128 3129 case 29: 3130 return { id: 29, name: 'services.statistic.player.points.text', abbreviation: 'services.statistic.player.points.abbreviation' }; 3131 3132 case 30: 3133 return { id: 30, name: 'services.statistic.player.savePercentage.text', abbreviation: 'services.statistic.player.savePercentage.abbreviation' }; 3134 3135 case 31: 3136 return { id: 31, name: 'services.statistic.player.pointsPerGame.text', abbreviation: 'services.statistic.player.pointsPerGame.abbreviation' }; 3137 3138 case 32: 3139 return { id: 32, name: 'services.statistic.player.goalsAgainstAverage.text', abbreviation: 'services.statistic.player.goalsAgainstAverage.abbreviation' }; 3140 3141 case 33: 3142 return { id: 33, name: 'services.statistic.player.lossOvertimeShootout.text', abbreviation: 'services.statistic.player.lossOvertimeShootout.abbreviation' }; 3143 3144 case 34: 3145 return { id: 34, name: 'services.statistic.player.gamePlayed.text', abbreviation: 'services.statistic.player.gamePlayed.abbreviation' }; 3146 3147 case 35: 3148 return { id: 35, name: 'services.statistic.player.gameStarted.text', abbreviation: 'services.statistic.player.gameStarted.abbreviation' }; 3149 3150 case 36: 3151 return { id: 36, name: 'services.statistic.player.minutes.text', abbreviation: 'services.statistic.player.minutes.abbreviation' }; 3152 3153 case 37: 3154 return { id: 37, name: 'services.statistic.player.goals.text', abbreviation: 'services.statistic.player.goals.abbreviation' }; 3155 3156 case 38: 3157 return { id: 38, name: 'services.statistic.player.assists.text', abbreviation: 'services.statistic.player.assists.abbreviation' }; 3158 3159 case 39: 3160 return { id: 39, name: 'services.statistic.player.shots.text', abbreviation: 'services.statistic.player.shots.abbreviation' }; 3161 3162 case 40: 3163 return { id: 40, name: 'services.statistic.player.soccer.shotOnTarget.text', abbreviation: 'services.statistic.player.soccer.shotOnTarget.abbreviation' }; 3164 3165 case 41: 3166 return { id: 41, name: 'services.statistic.player.soccer.fouls.text', abbreviation: 'services.statistic.player.soccer.fouls.abbreviation' }; 3167 3168 case 42: 3169 return { id: 42, name: 'services.statistic.player.offside.text', abbreviation: 'services.statistic.player.offside.abbreviation' }; 3170 3171 case 43: 3172 return { id: 43, name: 'services.statis
3172tic.player.soccer.yellowCard.text', abbreviation: 'services.statistic.player.soccer.yellowCard.abbreviation' }; 3173 3174 case 44: 3175 return { id: 44, name: 'services.statistic.player.soccer.redCard.text', abbreviation: 'services.statistic.player.soccer.redCard.abbreviation' }; 3176 3177 case 45: 3178 return { id: 45, name: 'services.statistic.player.shotsBlocked.text', abbreviation: 'services.statistic.player.shotsBlocked.abbreviation' }; 3179 3180 case 46: 3181 return { id: 46, name: 'services.statistic.player.victory.text', abbreviation: 'services.statistic.player.victory.abbreviation' }; 3182 3183 case 47: 3184 return { id: 47, name: 'services.statistic.player.defeat.text', abbreviation: 'services.statistic.player.defeat.abbreviation' }; 3185 3186 case 48: 3187 return { id: 48, name: 'services.statistic.player.draw.text', abbreviation: 'services.statistic.player.draw.abbreviation' }; 3188 3189 case 49: 3190 return { id: 49, name: 'services.statistic.player.shutout.text', abbreviation: 'services.statistic.player.shutout.abbreviation' }; 3191 3192 case 50: 3193 return { id: 50, name: 'services.statistic.player.goalAgaints.text', abbreviation: 'services.statistic.player.goalAgaints.abbreviation' }; 3194 3195 case 51: 3196 return { id: 51, name: 'services.statistic.player.points.text', abbreviation: 'services.statistic.player.points.abbreviation' }; 3197 3198 case 52: 3199 return { id: 52, name: 'services.statistic.player.goalsAgainstAverage.text', abbreviation: 'services.statistic.player.goalsAgainstAverage.abbreviation' }; 3200 3201 case 53: 3202 return { id: 53, name: 'services.statistic.player.gamePlayed.text', abbreviation: 'services.statistic.player.gamePlayed.abbreviation' }; 3203 3204 case 54: 3205 return { id: 54, name: 'services.statistic.player.goals.text', abbreviation: 'services.statistic.player.goals.abbreviation' }; 3206 3207 case 55: 3208 return { id: 55, name: 'services.statistic.player.penaltyGoal.text', abbreviation: 'services.statistic.player.penaltyGoal.abbreviation' }; 3209 3210 case 56: 3211 return { id: 56, name: 'services.statistic.player.handball.yellowCards.text', abbreviation: 'services.statistic.player.handball.yellowCards.abbreviation' }; 3212 3213 case 57: 3214 return { id: 57, name: 'services.statistic.player.handball.twoMinutes.text', abbreviation: 'services.statistic.player.handball.twoMinutes.abbreviation' }; 3215 3216 case 58: 3217 return { id: 58, name: 'services.statistic.player.handball.redCards.text', abbreviation: 'services.statistic.player.handball.redCards.abbreviation' }; 3218 3219 case 59: 3220 return { id: 59, name: 'services.statistic.player.handball.blueCards.text', abbreviation: 'services.statistic.player.handball.blueCards.abbreviation' }; 3221 3222 case 60: 3223 return { id: 60, name: 'services.statistic.player.points.text', abbreviation: 'services.statistic.player.points.abbreviation' }; 3224 3225 case 61: 3226 return { id: 61, name: 'services.statistic.player.handball.average.text', abbreviation: 'services.statistic.player.handball.average.abbreviation' }; 3227 3228 case 62: 3229 return { id: 62, name: 'services.statistic.player.gamePlayed.text', abbreviation: 'services.statistic.player.gamePlayed.abbreviation' }; 3230 3231 case 63: 3232 return { id: 63, name: 'services.statistic.player.gamePlayed.text', abbreviation: 'services.statistic.player.gamePlayed.abbreviation' }; 3233 3234 case 65: 3235 return { id: 65, name: 'services.statistic.player.baseball.gamesPlayed.text', abbreviation: 'services.statistic.player.baseball.gamesPlayed.abbreviation' }; 3236 3237 case 66: 3238 return { id: 66, name: 'services.statistic.player.baseball.plateAppearance.text', abbreviation: 'services.statistic.player.baseball.plateAppearance.abbreviation' }; 3239 3240 case 67: 3241 return { id: 67, name: 'services.statistic.player.baseball.atBat.text', abbreviation: 'services.statistic.player.baseball.atBat.abbreviation' }; 3242 3243 case 68: 3244 return { id: 68, name: 'services.statistic.player.baseball.simples.text', abbreviation: 'services.statistic.player.baseball.simples.abbreviation' }; 3245 3246 case 69: 3247 return { id: 69, name: 'services.statistic.player.baseball.doubles.text', abbreviation: 'services.statistic.player.baseball.doubles.abbreviation' }; 3248 3249 case 70: 3250 return { id: 70, name: 'services.statistic.player.baseball.triples.text', abbreviation: 'services.statistic.player.baseball.triples.abbreviation' }; 3251 3252 case 71: 3253 return { id: 71, name: 'services.statistic.player.baseball.homeRuns.text', abbreviation: 'services.statistic.player.baseball.homeRuns.abbreviation' }; 3254 3255 case 72: 3256 return { id: 72, name: 'services.statistic.player.baseball.basesOnBalls.text', abbreviation: 'services.statistic.player.baseball.basesOnBalls.abbreviation' }; 3257 3258 case 73: 3259 return { id: 73, name: 'services.statistic.player.baseball.hits
3259ByPitch.text', abbreviation: 'services.statistic.player.baseball.hitsByPitch.abbreviation' }; 3260 3261 case 74: 3262 return { id: 74, name: 'services.statistic.player.baseball.sacrificeFly.text', abbreviation: 'services.statistic.player.baseball.sacrificeFly.abbreviation' }; 3263 3264 case 75: 3265 return { id: 75, name: 'services.statistic.player.baseball.runsBattedIn.text', abbreviation: 'services.statistic.player.baseball.runsBattedIn.abbreviation' }; 3266 3267 case 76: 3268 return { id: 76, name: 'services.statistic.player.baseball.strikeOuts.text', abbreviation: 'services.statistic.player.baseball.strikeOuts.abbreviation' }; 3269 3270 case 77: 3271 return { id: 77, name: 'services.statistic.player.baseball.runsScored.text', abbreviation: 'services.statistic.player.baseball.runsScored.abbreviation' }; 3272 3273 // Stats not count 3274 //case 78: 3275 // return { id: 78, name: 'services.statistic.player.baseball.runsProduced.text', abbreviation: 'services.statistic.player.baseball.runsProduced.abbreviation' }; 3276 3277 case 79: 3278 return { id: 79, name: 'services.statistic.player.baseball.stolenBase.text', abbreviation: 'services.statistic.player.baseball.stolenBase.abbreviation' }; 3279 3280 case 80: 3281 return { id: 80, name: 'services.statistic.player.baseball.hits.text', abbreviation: 'services.statistic.player.baseball.hits.abbreviation' }; 3282 3283 case 81: 3284 return { id: 81, name: 'services.statistic.player.baseball.battingAverage.text', abbreviation: 'services.statistic.player.baseball.battingAverage.abbreviation' }; 3285 3286 case 82: 3287 return { id: 82, name: 'services.statistic.player.baseball.sluggingAverage.text', abbreviation: 'services.statistic.player.baseball.sluggingAverage.abbreviation' }; 3288 3289 case 83: 3290 return { id: 83, name: 'services.statistic.player.baseball.onBasePercentage.text', abbreviation: 'services.statistic.player.baseball.onBasePercentage.abbreviation' }; 3291 3292 case 85: 3293 return { id: 85, name: 'services.statistic.player.baseball.totalBases.text', abbreviation: 'services.statistic.player.baseball.totalBases.abbreviation' }; 3294 3295 case 86: 3296 return { id: 86, name: 'services.statistic.player.baseball.onBasePlusSlogging.text', abbreviation: 'services.statistic.player.baseball.onBasePlusSlogging.abbreviation' }; 3297 3298 case 87: 3299 return { id: 87, name: 'services.statistic.player.baseball.pitchs.text', abbreviation: 'services.statistic.player.baseball.pitchs.abbreviation' }; 3300 3301 case 88: 3302 return { id: 88, name: 'services.statistic.player.baseball.balls.text', abbreviation: 'services.statistic.player.baseball.balls.abbreviation' }; 3303 3304 case 89: 3305 return { id: 89, name: 'services.statistic.player.baseball.strikes.text', abbreviation: 'services.statistic.player.baseball.strikes.abbreviation' }; 3306 3307 case 90: 3308 return { id: 90, name: 'services.statistic.player.baseball.outs.text', abbreviation: 'services.statistic.player.baseball.outs.abbreviation' }; 3309 3310 case 91: 3311 return { id: 91, name: 'services.statistic.player.baseball.strikeOuts.text', abbreviation: 'services.statistic.player.baseball.strikeOuts.abbreviation' }; 3312 3313 case 92: 3314 return { id: 92, name: 'services.statistic.player.baseball.basesOnBalls.text', abbreviation: 'services.statistic.player.baseball.basesOnBalls.abbreviation' }; 3315 3316 case 93: 3317 return { id: 93, name: 'services.statistic.player.baseball.earnedRuns.text', abbreviation: 'services.statistic.player.baseball.earnedRuns.abbreviation' }; 3318 3319 case 94: 3320 return { id: 94, name: 'services.statistic.player.baseball.batterFaced.text', abbreviation: 'services.statistic.player.baseball.batterFaced.abbreviation' }; 3321 3322 case 95: 3323 return { id: 95, name: 'services.statistic.player.baseball.hitsAllowed.text', abbreviation: 'services.statistic.player.baseball.hitsAllowed.abbreviation' }; 3324 3325 case 96: 3326 return { id: 96, name: 'services.statistic.player.baseball.wins.text', abbreviation: 'services.statistic.player.baseball.wins.abbreviation' }; 3327 3328 case 97: 3329 return { id: 97, name: 'services.statistic.player.baseball.loss.text', abbreviation: 'services.statistic.player.baseball.loss.abbreviation' }; 3330 3331 case 98: 3332 return { id: 98, name: 'services.statistic.player.baseball.save.text', abbreviation: 'services.statistic.player.baseball.save.abbreviation' }; 3333 3334 case 99: 3335 return { id: 99, name: 'services.statistic.player.baseball.inningsPitched.text', abbreviation: 'services.statistic.player.baseball.inningsPitched.abbreviation' }; 3336 3337 case 100: 3338 return { id: 100, name: 'services.statistic.player.baseball.earnedRunsAverage.text', abbreviation: 'services.statistic.player.baseball.earnedRunsAverage.abbreviation' }; 3339 3340 case 101: 3341 return { id: 101, name: 'services.statistic.player.baseball.opponentsBattingAverage.text', abbreviation: 'services.statistic.player.baseball.opponentsBattingAverage.abbreviation' }; 3342 3343 case 102: 3344 return { id: 102, name: 'services.statistic.player.baseball.unearnedRun.text', abbreviation: 'services.statistic.player.baseball.unearnedRun.abbreviation' }; 3345 3346 case 103: 3347 return { id: 103, name: 'services.statistic.player.baseball.hitByPitch.text', abbreviation: 'services.statistic.player.baseball.hitByPitch.abbreviation' }; 3348 3349 case 104: 3350 return { id: 104, name: 'services.statistic.player.baseball.gamesPlayed.text', abbreviation: 'services.statistic.player.baseball.gamesPlayed.abbreviation' }; 3351 3352 case 105: 3353 return { id: 105, name: 'services.statistic.player.baseball.errors.text', abbreviation: 'services.statistic.player.baseball.errors.abbreviation' }; 3354 3355 case 106: 3356 return { id: 106, name: 'services.statistic.player.baseball.caughtStealing.text', abbreviation: 'services.statistic.player.baseball.caughtStealing.abbreviation' }; 3357 3358 case 107: 3359 return { id: 107, name: 'services.statistic.player.baseball.outs.text', abbreviation: 'services.statistic.player.baseball.outs.abbreviation' }; 3360 3361 case 108: 3362 return { id: 108, name: 'services.statistic.player.baseball.assists.text', abbreviation: 'services.statistic.player.baseball.assists.abbreviation' }; 3363 3364 case 109: 3365 return { id: 109, name: 'services.statistic.player.baseball.groundOut.text', abbreviation: 'services.statistic.player.baseball.groundOut.abbreviation' }; 3366 3367 case 110: 3368 return { id: 110, name: 'services.statistic.player.baseball.flyOut.text', abbreviation: 'services.statistic.player.baseball.flyOut.abbreviation' }; 3369 3370 case 111: 3371 return { id: 111, name: 'services.statistic.player.baseball.fielderChoice.text', abbreviation: 'services.statistic.player.baseball.fielderChoice.abbreviation' }; 3372 3373 case 112: 3374 return { id: 112, name: 'services.statistic.player.baseball.extraBaseHit.text', abbreviation: 'services.statistic.player.baseball.extraBaseHit.abbreviation' }; 3375 3376 case 113: 3377 return { id: 113, name: 'services.statistic.player.baseball.grandSlam.text', abbreviation: 'services.statistic.player.baseball.grandSlam.abbreviation' }; 3378 3379 case 114: 3380 return { id: 114, name: 'services.statistic.player.baseball.intentionalBaseOnBall.text', abbreviation: 'services.statistic.player.baseball.intentionalBaseOnBall.abbreviation' }; 3381 3382 case 115: 3383 return { id: 115, name: 'services.statistic.player.baseball.stolenBaseAttempt.text', abbreviation: 'services.statistic.player.baseball.stolenBaseAttempt.abbreviation' }; 3384 3385 case 116: 3386 return { id: 116, name: 'services.statistic.player.baseball.runsAllowed.text', abbreviation: 'services.statistic.player.baseball.runsAllowed.abbreviation' }; 3387 3388 case 117: 3389 return { id: 117, name: 'services.statistic.player.baseball.homeRunsAllowed.text', abbreviation: 'services.statistic.player.baseball.homeRunsAllowed.abbreviation' }; 3390 3391 case 118: 3392 return { id: 118, name: 'services.statistic.player.baseball.badPitch.text', abbreviation: 'services.statistic.player.baseball.badPitch.abbreviation' }; 3393 3394 case 119: 3395 return { id: 119, name: 'services.statistic.player.baseball.leftOnBases.text', abbreviation: 'services.statistic.player.baseball.leftOnBases.abbreviation' }; 3396 3397 case 120: 3398 return { id: 120, name: 'services.statistic.player.baseball.hitterBBI.text', abbreviation: 'services.statistic.player.baseball.hitterBBI.abbreviation' }; 3399 3400 case 121: 3401 return { id: 121, name: 'services.statistic.player.baseball.catcherInterference.text', abbreviation: 'services.statistic.player.baseball.catcherInterference.abbreviation' }; 3402 3403 case 122: 3404 return { id: 122, name: 'services.statistic.player.baseball.passedBall.text', abbreviation: 'services.statistic.player.baseball.passedBall.abbreviation' }; 3405 3406 case 123: 3407 return { id: 123, name: 'services.statistic.player.baseball.lineDriveOut.text', abbreviation: 'services.statistic.player.baseball.lineDriveOut.abbreviation' }; 3408 3409 case 124: 3410 return { id: 124, name: 'services.statistic.player.baseball.starting.text', abbreviation: 'services.statistic.player.baseball.starting.abbreviation' }; 3411 3412 case 125: 3413 return { id: 125, name: 'services.statistic.player.baseball.sacrifice.text', abbreviation: 'services.statistic.player.baseball.sacrifice.abbreviation' }; 3414 3415 case 126:
3416 return { id: 126, name: 'services.statistic.player.baseball.whip.text', abbreviation: 'services.statistic.player.baseball.whip.abbreviation' }; 3417 3418 case 127: 3419 return { id: 127, name: 'services.statistic.player.baseball.atBatPitcher.text', abbreviation: 'services.statistic.player.baseball.atBatPitcher.abbreviation' }; 3420 3421 case 128: 3422 return { id: 128, name: 'services.statistic.player.basketball.gamesPlayed.text', abbreviation: 'services.statistic.player.basketball.gamesPlayed.abbreviation' }; 3423 3424 case 129: 3425 return { id: 129, name: 'services.statistic.player.basketball.gamesStarted.text', abbreviation: 'services.statistic.player.basketball.gamesStarted.abbreviation' }; 3426 3427 case 130: 3428 return { id: 130, name: 'services.statistic.player.basketball.minutes.text', abbreviation: 'services.statistic.player.basketball.minutes.abbreviation' }; 3429 3430 case 131: 3431 return { id: 131, name: 'services.statistic.player.basketball.minutesPerGame.text', abbreviation: 'services.statistic.player.basketball.minutesPerGame.abbreviation' }; 3432 3433 case 132: 3434 return { id: 132, name: 'services.statistic.player.basketball.points.text', abbreviation: 'services.statistic.player.basketball.points.abbreviation' }; 3435 3436 case 133: 3437 return { id: 133, name: 'services.statistic.player.basketball.pointsPerGame.text', abbreviation: 'services.statistic.player.basketball.pointsPerGame.abbreviation' }; 3438 3439 case 134: 3440 return { id: 134, name: 'services.statistic.player.basketball.pts2Made.text', abbreviation: 'services.statistic.player.basketball.pts2Made.abbreviation' }; 3441 3442 case 135: 3443 return { id: 135, name: 'services.statistic.player.basketball.pts2Attempt.text', abbreviation: 'services.statistic.player.basketball.pts2Attempt.abbreviation' }; 3444 3445 case 136: 3446 return { id: 136, name: 'services.statistic.player.basketball.pts2Pct.text', abbreviation: 'services.statistic.player.basketball.pts2Pct.abbreviation' }; 3447 3448 case 137: 3449 return { id: 137, name: 'services.statistic.player.basketball.pts3Made.text', abbreviation: 'services.statistic.player.basketball.pts3Made.abbreviation' }; 3450 3451 case 138: 3452 return { id: 138, name: 'services.statistic.player.basketball.pts3Attempt.text', abbreviation: 'services.statistic.player.basketball.pts3Attempt.abbreviation' }; 3453 3454 case 139: 3455 return { id: 139, name: 'services.statistic.player.basketball.pts3Pct.text', abbreviation: 'services.statistic.player.basketball.pts3Pct.abbreviation' }; 3456 3457 case 140: 3458 return { id: 140, name: 'services.statistic.player.basketball.freeThrowsMade.text', abbreviation: 'services.statistic.player.basketball.freeThrowsMade.abbreviation' }; 3459 3460 case 141: 3461 return { id: 141, name: 'services.statistic.player.basketball.freeThrowsAttempt.text', abbreviation: 'services.statistic.player.basketball.freeThrowsAttempt.abbreviation' }; 3462 3463 case 142: 3464 return { id: 142, name: 'services.statistic.player.basketball.freeThrowsPct.text', abbreviation: 'services.statistic.player.basketball.freeThrowsPct.abbreviation' }; 3465 3466 case 143: 3467 return { id: 143, name: 'services.statistic.player.basketball.offensiveRebounds.text', abbreviation: 'services.statistic.player.basketball.offensiveRebounds.abbreviation' }; 3468 3469 case 144: 3470 return { id: 144, name: 'services.statistic.player.basketball.defensiveRebounds.text', abbreviation: 'services.statistic.player.basketball.defensiveRebounds.abbreviation' }; 3471 3472 case 145: 3473 return { id: 145, name: 'services.statistic.player.basketball.totalRebounds.text', abbreviation: 'services.statistic.player.basketball.totalRebounds.abbreviation' }; 3474 3475 case 146: 3476 return { id: 146, name: 'services.statistic.player.basketball.reboundsPerGame.text', abbreviation: 'services.statistic.player.basketball.reboundsPerGame.abbreviation' }; 3477 3478 case 147: 3479 return { id: 147, name: 'services.statistic.player.basketball.assists.text', abbreviation: 'services.statistic.player.basketball.assists.abbreviation' }; 3480 3481 //case 148: 3482 // return { id: 148, name: 'services.statistic.player.basketball.gamesPlayed.text', abbreviation: 'services.statistic.player.basketball.gamesPlayed.abbreviation' }; 3483 3484 case 149: 3485 return { id: 149, name: 'services.statistic.player.basketball.turnovers.text', abbreviation: 'services.statistic.player.basketball.turnovers.abbreviation' }; 3486 3487 case 150: 3488 return { id: 150, name: 'services.statistic.player.basketball.steals.text', abbreviation: 'services.statistic.player.basketball.steals.abbreviation' }; 3489 3490 case 151: 3491 return { id: 151, name: 'services.statistic.player.basketball.blockedShots.text', abbreviation: 'services.statistic.player.basketball.blockedShots.abbreviation' }; 3492 3493 case 152: 3494 return { id: 152, name: 'services.statistic.player.basketball.personalFouls.text', abbreviation: 'services.statistic.player.basketball.personalFouls.abbreviation' }; 3495 3496 case 153: 3497 return { id: 153, name: 'services.statistic.player.basketball.technicalFouls.text', abbreviation: 'services.statistic.player.basketball.technicalFouls.abbreviation' }; 3498 3499 case 154: 3500 return { id: 154, name: 'services.statistic.player.basketball.unsportManLikeFouls.text', abbreviation: 'services.statistic.player.basketball.unsportManLikeFouls.abbreviation' }; 3501 3502 case 155: 3503 return { id: 155, name: 'services.statistic.player.basketball.gameDisqualification.text', abbreviation: 'services.statistic.player.basketball.gameDisqualification.abbreviation' }; 3504 3505 case 156: 3506 return { id: 156, name: 'services.statistic.player.basketball.totalFouls.text', abbreviation: 'services.statistic.player.basketball.totalFouls.abbreviation' }; 3507 3508 case 157: 3509 return { id: 157, name: 'services.statistic.player.basketball.gameAssists.text', abbreviation: 'services.statistic.player.basketball.gameAssists.abbreviation' }; 3510 3511 case 162: 3512 return { id: 162, name: 'services.statistic.player.basketball.majorFouls.text', abbreviation: 'services.statistic.player.basketball.majorFouls.abbreviation' }; 3513 3514 case 165: 3515 return { id: 165, name: 'services.statistic.player.gamePlayed.text', abbreviation: 'services.statistic.player.gamePlayed.abbreviation' }; 3516 3517 case 167: 3518 return { id: 167, name: 'services.statistic.player.baseball.percentDef.text', abbreviation: 'services.statistic.player.baseball.percentDef.abbreviation' }; 3519 } 3520 return null; 3521 } 3522 3523 function getPlayerStatisticColumnsByColumnIds(columnIds) { 3524 var columns = []; 3525 3526 _.forEach(columnIds, function (columnId) { 3527 const stat = getPlayerStatisticByStatId(columnId); 3528 if (stat) { 3529 columns.push(stat); 3530 } 3531 }); 3532 3533 return columns; 3534 } 3535 3536 function getPlayerStatisticColumnsBySportId(sportId, categoryId) { 3537 const statsSportConfig = { 3538 1: { 3539 2: [6, 7, 8, 9, 11, 12, 14, 26, 27, 28, 29, 31], 3540 1: [10, 13, 62, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 30, 32, 33, 8] 3541 }, 3542 2: { 3543 9: [66, 67, 68, 69, 70, 71, 72, 73, 77, 75, 78, 79, 80, 81, 82, 83, 86, 85
3543], 3544 8: [99, 100, 101, 91, 102, 93, 90, 96, 97, 98, 103, 127, 95, 116, 117, 92, 114, 126], 3545 21: [65, 105, 107, 108, 121, 122, 167] 3546 }, 3547 3: { 3548 22: [165] 3549 }, 3550 4: { 3551 10: [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 149, 150, 151, 152, 153, 154, 155, 156, 157, 162], 3552 }, 3553 6: { 3554 3: [34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 51], 3555 4: [46, 47, 48, 49, 50, 52, 63, 64], 3556 }, 3557 14: { 3558 16: [53, 54, 55, 60, 61, 57, 56, 58, 59], 3559 17: [53, 54, 55, 60, 61, 57, 56, 58, 59] 3560 } 3561 } 3562 return getPlayerStatisticColumnsByColumnIds(statsSportConfig[sportId][categoryId]); 3563 } 3564 3565 function getPlayerConfigStatisticColumnsBySportId(sportId, categoryId) { 3566 const statsSportConfig = { 3567 1: { 3568 2: [6, 7, 8, 9, 11, 12, 14, 26, 27, 28, 29, 31], 3569 1: [10, 13, 62, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 30, 32, 33, 8] 3570 }, 3571 2: { 3572 9: [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 106, 109, 110, 111, 112, 113, 115, 119, 120, 123], 3573 8: [87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 114, 116, 117, 118, 124, 125, 126, 127, 159, 160, 161], 3574 21: [65, 105, 107, 108, 121, 122, 167] 3575 }, 3576 4: { 3577 10: [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 149, 150, 151, 152, 153, 154, 155, 156, 157, 162], 3578 }, 3579 6: { 3580 3: [34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 51], 3581 4: [46, 47, 48, 49, 50, 52, 63, 64], 3582 }, 3583 14: { 3584 16: [53, 54, 55, 56, 57, 58, 59, 60, 61], 3585 17: [53, 54, 55, 56, 57, 58, 59, 60, 61], 3586 } 3587 } 3588 3589 if (categoryId == null) { 3590 var allStats = _.reduce(statsSportConfig[sportId], function (result, value) { return result.concat(value) }, []); 3591 return getPlayerStatisticColumnsByColumnIds(_.uniq(allStats)); 3592 } 3593 3594 return getPlayerStatisticColumnsByColumnIds(statsSportConfig[sportId][categoryId]); 3595 } 3596 3597 function getPlayerLeadersByStatisticId(solutionId, options) { 3598 var queryString = ''; 3599 3600 if (options) { 3601 for (var option in options) { 3602 if (queryString) { 3603 queryString += '&' 3604 } 3605 3606 queryString += `${option}=${encodeURI(options[option])}`; 3607 } 3608 } 3609 3610 return $q(function (resolve, reject) { 3611 $http.get(`/api/v2/solutions/${solutionId}/statistics?${queryString}`) 3612 .then(function (response) { 3613 resolve(response); 3614 }, function (response) { 3615 reject(response); 3616 }); 3617 }); 3618 } 3619 3620 function getTeamStatisticByStatId(statId) { 3621 switch (statId) { 3622 case 1: 3623 return { id: 1, name: 'services.statistic.team.goalFor.text', abbreviation: 'services.statistic.team.goalFor.abbreviation' }; 3624 3625 case 2: 3626 return { id: 2, name: 'services.statistic.team.goalAgaints.text', abbreviation: 'services.statistic.team.goalAgaints.abbreviation' }; 3627 3628 case 3: 3629 return { id: 3, name: 'services.statistic.team.goalSupNum.text', abbreviation: 'services.statistic.team.goalSupNum.abbreviation' }; 3630 3631 case 4: 3632 return { id: 4, name: 'services.statistic.team.goalInfNum.text', abbreviation: 'services.statistic.team.goalInfNum.abbreviation' }; 3633 3634 case 5: 3635 return { id: 5, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 3636 3637 case 6: 3638 return { id: 6, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 3639 3640 case 7: 3641 return { id: 7, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 3642 3643 case 8: 3644 return { id: 8, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 3645 3646 case 9: 3647 return { id: 9, name: 'services.statistic.team.overtimeVictory.text', abbreviation: 'services.statistic.team.overtimeVictory.abbreviation' }; 3648 3649 case 10: 3650 return { id: 10, name: 'services.statistic.team.overtimeDefeat.text', abbreviation: 'services.statistic.team.overtimeDefeat.abbreviation' }; 3651 3652 case 11: 3653 return { id: 11, name: 'services.statistic.team.shootoutVictory.text', abbreviation: 'services.statistic.team.shootoutVictory.abbreviation' }; 3654 3655 case 12: 3656 return { id: 12, name: 'services.statistic.team.shootoutDefeat.text', abbreviation: 'services.statistic.team.shootoutDefeat.abbreviation' }; 3657 3658 case 13: 3659 return { id: 13, name: 'services.statistic.team.penalty.text', abbreviation: 'services.statistic.team.penalty.abbreviation' }; 3660 3661 case 14: 3662 return { id: 14, name: 'services.statistic.team.shutout.text', abbreviation: 'services.statistic.team.shutout.abbreviation' }; 3663 3664 case 15: 3665 return { id: 15, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation', tooltip: 'services.statistic.team.points.tooltip' }; 3666 3667 case 16: 3668 return { id: 16, name: 'services.statistic.team.differential.text', abbreviation: 'services.statistic.team.differential.abbreviation', tooltip: 'services.statistic.team.differential.tooltip' }; 3669 3670 case 17: 3671 return { id: 17, name: 'services.statistic.team.bonusPoints.text', abbreviation: 'services.statistic.team.bonusPoints.abbreviation', tooltip: 'services.statistic.team.bonusPoints.tooltip' }; 3672 3673 case 18: 3674 return { id: 18, name: 'services.statistic.team.firstPeriodPoints.text', abbreviation: 'services.statistic.team.firstPeriodPoints.abbreviation' }; 3675 3676 case 19: 3677 return { id: 19, name: 'services.statistic.team.secondPeriodPoints.text', abbreviation: 'services.statistic.team.secondPeriodPoints.abbreviation' }; 3678 3679 case 20: 3680 return { id: 20, name: 'services.statistic.team.thirdPeriodPoints.text', abbreviation: 'services.statistic.team.thirdPeriodPoints.abbreviation' }; 3681 3682 case 21: 3683 return { id: 21, name: 'services.statistic.team.fourthPeriodPoints.text', abbreviation: 'services.statistic.team.fourthPeriodPoints.abbreviation' }; 3684 3685 case 22: 3686 return { id: 22, name: 'services.statistic.team.emptyNetShots.text', abbreviation: 'services.statistic.team.emptyNetShots.abbreviation' }; 3687 3688 case 23: 3689 return { id: 23, name: 'services.statistic.team.emptyNetGoals.text', abbreviation: 'services.statistic.team.emptyNetGoals.abbreviation' }; 3690 3691 case 24: 3692 return { id: 24, name: 'services.statistic.team.manualStandings.text', abbreviation: 'services.statistic.team.manualStandings.abbreviation', tooltip: 'services.statistic.team.manualStandings.tooltip' }; 3693 3694 case 25: 3695 return { id: 25, name: 'services.statistic.team.bestDifferential2.text', abbreviation: 'services.statistic.team.bestDifferential2.abbreviation', tooltip: 'services.statistic.team.bestDifferential2.tooltip2' }; 3696 3697 case 26: 3698 return { id: 26, name: 'services.statistic.team.firstPeriodWins.text', abbreviation: 'services.statistic.team.firstPeriodWins.abbreviation' }; 3699 3700 case 27: 3701 return { id: 27, name: 'services.statistic.team.secondPeriodWins.text', abbreviation: 'services.statistic.team.secondPeriodWins.abbreviation' }; 3702 3703 case 28: 3704 return { id: 28, name: 'services.statistic.team.thirdPeriodWins.text', abbreviation: 'services.statistic.team.thirdPeriodWins.abbreviation' }; 3705 3706 case 29: 3707 return { id: 29, name: 'services.statistic.team.fourthPeriodWins.text', abbreviation: 'services.statistic.team.fourthPeriodWins.abbreviation' }; 3708 3709 case 30: 3710 return { id: 30, name: 'services.statistic.team.firstPeriodTies.text', abbreviation: 'services.statistic.team.firstPeriodTies.abbreviation' }; 3711 3712 case 31: 3713 return { id: 31, name: 'services.statistic.team.secondPeriodTies.text', abbreviation: 'services.statistic.team.secondPeriodTies.abbreviation' }; 3714 3715 case 32: 3716 return { id: 32, name: 'services.statistic.team.thirdPeriodTies.text', abbreviation: 'services.statistic.team.thirdPeriodTies.abbreviation' }; 3717 3718 case 33: 3719 return { id: 33, name: 'services.statistic.team.fourthPeriodTies.text', abbreviation: 'services.statistic.team.fourthPeriodTies.abbreviation' }; 3720 3721 case 34: 3722 return { id: 34, name: 'services.statistic.team.firstPeriodDefeat.text', abbreviation: 'services.statistic.team.firstPeriodDefeat.abbreviation' }; 3723 3724 case 35: 3725 return { id: 35, name: 'services.statistic.team.secondPeriodDefeat.text', abbreviation: 'services.statistic.team.secondPeriodDefeat.abbreviation' }; 3726 3727 case 36: 3728 return { id: 36, name: 'services.statistic.team.thirdPeriodDefeat.text', abbreviation: 'services.statistic.team.thirdPeriodDefeat.abbreviation' }; 3729 3730 case 37: 3731 return { id: 37, name: 'services.statistic.team.fourthPeriodDefeat.text', abbreviation: 'services.statistic.team.fourthPeriodDefeat.abbreviation' }; 3732 3733 case 38: 3734 return { id: 38, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 3735 3736 case 39: 3737 return { id: 39, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 3738 3739 case 40: 3740 return { id: 40, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 3741 3742 case 41: 3743 return { id: 41, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 3744 3745 case 42: 3746 return { id: 42, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 3747 3748 case 43: 3749 return { id: 43, name: 'services.statistic.team.soccer.shots.text', abbreviation: 'services.statistic.team.soccer.shots.abbreviation' }; 3750 3751 case 44: 3752 return { id: 44, name: 'services.statistic.team.soccer.shotsOnGoal.text', abbreviation: 'services.statistic.team.soccer.shotsOnGoal.abbreviation' }; 3753 3754 case 45: 3755 return { id: 45, name: 'services.statistic.team.soccer.offside.text', abbreviation: 'services.statistic.team.soccer.offside.abbreviation' }; 3756 3757 case 46: 3758 return { id: 46, name: 'services.statistic.team.soccer.yellowCards.text', abbreviation: 'services.statistic.team.soccer.yellowCards.abbreviation' }; 3759 3760 case 47: 3761 return { id: 47, name: 'services.statistic.team.soccer.redCards.text', abbreviation: 'services.statistic.team.soccer.redCards.abbreviation' }; 3762 3763 case 48: 3764 return { id: 48, name: 'services.statistic.team.goalFor.text', abbreviation: 'services.statistic.team.goalFor.abbreviation' }; 3765 3766 case 49: 3767 return { id: 49, name: 'services.statistic.team.goalAgaints.text', abbreviation: 'services.statistic.team.goalAgaints.abbreviation' }; 3768 3769 case 50: 3770 return { id: 50, name: 'services.statistic.team.differential.text', abbreviation: 'services.statistic.team.differential.abbreviation', tooltip: 'services.statistic.team.differential.tooltip' }; 3771 3772 case 51: 3773 return { id: 51, name: 'services.statistic.team.shutout.text', abbreviation: 'services.statistic.team.shutout.abbreviation' }; 3774 3775 case 55: 3776 return { id: 55, name: 'services.statistic.team.baseball.gamePlayed.text', abbreviation: 'services.statistic.team.baseball.gamePlayed.abbreviation' }; 3777 3778 case 56: 3779 return { id: 56, name: 'services.statistic.team.baseball.victory.text', abbreviation: 'services.statistic.team.baseball.victory.abbreviation' }; 3780 3781 case 57: 3782 return { id: 57, name: 'services.statistic.team.baseball.defeat.text', abbreviation: 'services.statistic.team.baseball.defeat.abbreviation' }; 3783 3784 case 58: 3785 return { id: 58, name: 'services.statistic.team.baseball.tieGames.text', abbreviation: 'services.statistic.team.baseball.tieGames.abbreviation' }; 3786 3787 case 59: 3788 return { id: 59, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 3789 3790 case 60: 3791 return { id: 60, name: 'services.statistic.team.baseball.pointsFor.text', abbreviation: 'services.statistic.team.baseball.pointsFor.abbreviation' }; 3792 3793 case 61: 3794 return { id: 61, name: 'services.statistic.team.baseball.pointsAgainst.text', abbreviation: 'services.statistic.team.baseball.pointsAgainst.abbreviation' }; 3795 3796 case 62: 3797 return { id: 62, name: 'services.statistic.team.shutout.text', abbreviation: 'services.statistic.team.shutout.abbreviation' }; 3798 3799 case 63: 3800 return { id: 63, name: 'services.statistic.team.differentialSport.text', abbreviation: 'services.statistic.team.differentialSport.abbreviation', tooltip: 'services.statistic.team.differentialSport.tooltip' }; 3801 3802 case 64: 3803 return { id: 64, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 3804 3805 case 65: 3806 return { id: 65, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 3807 3808 case 66: 3809 return { id: 66, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 3810 3811 case 67: 3812 return { id: 67, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 3813 3814 case 68: 3815 return { id: 68, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 3816 3817 case 69: 3818 return { id: 69, name: 'services.statistic.team.pointsFor.text', abbreviation: 'services.statistic.team.pointsFor.abbreviation' }; 3819 3820 case 70: 3821 return { id: 70, name: 'services.statistic.team.pointsAgaint.text', abbreviation: 'services.statistic.team.pointsAgaint.a
3821bbreviation' }; 3822 3823 case 71: 3824 return { id: 71, name: 'services.statistic.team.shutout.text', abbreviation: 'services.statistic.team.shutout.abbreviation' }; 3825 3826 case 72: 3827 return { id: 72, name: 'services.statistic.team.differentialSport.text', abbreviation: 'services.statistic.team.differentialSport.abbreviation', tooltip: 'services.statistic.team.differentialSport.tooltip' }; 3828 3829 case 73: 3830 return { id: 73, name: 'services.statistic.team.winningPercentage.text', abbreviation: 'services.statistic.team.winningPercentage.abbreviation' }; 3831 3832 case 74: 3833 return { id: 74, name: 'services.statistic.team.winningPercentage.text', abbreviation: 'services.statistic.team.winningPercentage.abbreviation' }; 3834 3835 case 75: 3836 return { id: 75, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 3837 3838 case 76: 3839 return { id: 76, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 3840 3841 case 77: 3842 return { id: 77, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 3843 3844 case 78: 3845 return { id: 78, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 3846 3847 case 79: 3848 return { id: 79, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 3849 3850 case 80: 3851 return { id: 80, name: 'services.statistic.team.pointsFor.text', abbreviation: 'services.statistic.team.pointsFor.abbreviation' }; 3852 3853 case 81: 3854 return { id: 81, name: 'services.statistic.team.pointsAgaint.text', abbreviation: 'services.statistic.team.pointsAgaint.abbreviation' }; 3855 3856 case 82: 3857 return { id: 82, name: 'services.statistic.team.differentialSport.text', abbreviation: 'services.statistic.team.differentialSport.abbreviation', tooltip: 'services.statistic.team.differentialSport.tooltip' }; 3858 3859 case 83: 3860 return { id: 83, name: 'services.statistic.team.winningPercentage.text', abbreviation: 'services.statistic.team.winningPercentage.abbreviation' }; 3861 3862 case 84: 3863 return { id: 84, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 3864 3865 case 85: 3866 return { id: 85, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 3867 3868 case 86: 3869 return { id: 86, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 3870 3871 case 87: 3872 return { id: 87, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 3873 3874 case 88: 3875 return { id: 88, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 3876 3877 case 89: 3878 return { id: 89, name: 'services.statistic.team.pointsFor.text', abbreviation: 'services.statistic.team.pointsFor.abbreviation' }; 3879 3880 case 90: 3881 return { id: 90, name: 'services.statistic.team.pointsAgaint.text', abbreviation: 'services.statistic.team.pointsAgaint.abbreviation' }; 3882 3883 case 91: 3884 return { id: 91, name: 'services.statistic.team.differentialSport.text', abbreviation: 'services.statistic.team.differentialSport.abbreviation', tooltip: 'services.statistic.team.differentialSport.tooltip' }; 3885 3886 case 92: 3887 return { id: 92, name: 'services.statistic.team.winningPercentage.text', abbreviation: 'services.statistic.team.winningPercentage.abbreviation' }; 3888 3889 case 93: 3890 return { id: 93, name: 'services.statistic.team.goalFor.text', abbreviation: 'services.statistic.team.goalFor.abbreviation' }; 3891 3892 case 94: 3893 return { id: 94, name: 'services.statistic.team.goalAgaints.text', abbreviation: 'services.statistic.team.goalAgaints.abbreviation' }; 3894 3895 case 95: 3896 return { id: 95, name: 'services.statistic.team.goalSupNum.text', abbreviation: 'services.statistic.team.goalSupNum.abbreviation' }; 3897 3898 case 96: 3899 return { id: 96, name: 'services.statistic.team.goalInfNum.text', abbreviation: 'services.statistic.team.goalInfNum.abbreviation' }; 3900 3901 case 97: 3902 return { id: 97, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 3903 3904 case 98: 3905 return { id: 98, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 3906 3907 case 99: 3908 return { id: 99, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 3909 3910 case 100: 3911 return { id: 100, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 3912 3913 case 101: 3914 return { id: 101, name: 'services.statistic.team.overtimeVictory.text', abbreviation: 'services.statistic.team.overtimeVictory.abbreviation' }; 3915 3916 case 102: 3917 return { id: 102, name: 'services.statistic.team.overtimeDefeat.text', abbreviation: 'services.statistic.team.overtimeDefeat.abbreviation' }; 3918 3919 case 103: 3920 return { id: 103, name: 'services.statistic.team.shootoutVictory.text', abbreviation: 'services.statistic.team.shootoutVictory.abbreviation' }; 3921 3922 case 104: 3923 return { id: 104, name: 'services.statistic.team.shootoutDefeat.text', abbreviation: 'services.statistic.team.shootoutDefeat.abbreviation' }; 3924 3925 case 105: 3926 return { id: 105, name: 'services.statistic.team.penalty.text', abbreviation: 'services.statistic.team.penalty.abbreviation' }; 3927 3928 case 106: 3929 return { id: 106, name: 'services.statistic.team.shutout.text', abbreviation: 'services.statistic.team.shutout.abbreviation' }; 3930 3931 case 107: 3932 return { id: 107, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 3933 3934 case 108: 3935 return { id: 108, name: 'services.statistic.team.bonusPoints.text', abbreviation: 'services.statistic.team.bonusPoints.abbreviation' }; 3936 3937 case 109: 3938 return { id: 109, name: 'services.statistic.team.firstPeriodPoints.text', abbreviation: 'services.statistic.team.firstPeriodPoints.abbreviation' }; 3939 3940 case 110: 3941 return { id: 110, name: 'services.statistic.team.secondPeriodPoints.text', abbreviation: 'services.statistic.team.secondPeriodPoints.abbreviation' }; 3942 3943 case 111: 3944 return { id: 111, name: 'services.statistic.team.thirdPeriodPoints.text', abbreviation: 'services.statistic.team.thirdPeriodPoints.abbreviation' }; 3945 3946 case 112: 3947 return { id: 112, name: 'services.statistic.team.fourthPeriodPoints.text', abbreviation: 'services.statistic.team.fourthPeriodPoints.abbreviation' }; 3948 3949 case 113: 3950 return { id: 113, name: 'services.statistic.team.firstPeriodWins.text', abbreviation: 'services.statistic.team.firstPeriodWins.abbreviation' }; 3951 3952 case 114: 3953 return { id: 114, name: 'services.statistic.team.secondPeriodWins.text', abbreviation: 'services.statistic.team.secondPeriodWins.abbreviation' }; 3954 3955 case 115: 3956 return { id: 115, name: 'services.statistic.team.thirdPeriodWins.text', abbreviation: 'services.statistic.team.thirdPeriodWins.abbreviation' }; 3957 3958 case 116: 3959 return { id: 116, name: 'services.statistic.team.fourthPeriodWins.text', abbreviation: 'services.statistic.team.fourthPeriodWins.abbreviation' }; 3960 3961 case 117: 3962 return { id: 117, name: 'services.statistic.team.firstPeriodTies.text', abbreviation: 'services.statistic.team.firstPeriodTies.abbreviation' }; 3963 3964 case 118: 3965 return { id: 118, name: 'services.statistic.team.secondPeriodTies.text', abbreviation: 'services.statistic.team.secondPeriodTies.abbreviation' }; 3966 3967 case 119: 3968 return { id: 119, name: 'services.statistic.team.thirdPeriodTies.text', abbreviation: 'services.statistic.team.thirdPeriodTies.abbreviation' }; 3969 3970 case 120: 3971 return { id: 120, name: 'services.statistic.team.fourthPeriodTies.text', abbreviation: 'services.statistic.team.fourthPeriodTies.abbreviation' }; 3972 3973 case 121: 3974 return { id: 121, name: 'services.statistic.team.firstPeriodDefeat.text', abbreviation: 'services.statistic.team.firstPeriodDefeat.abbreviation' }; 3975 3976 case 122: 3977 return { id: 122, name: 'services.statistic.team.secondPeriodDefeat.text', abbreviation: 'services.statistic.team.secondPeriodDefeat.abbreviation' }; 3978 3979 case 123: 3980 return { id: 123, name: 'services.statistic.team.thirdPeriodDefeat.text', abbreviation: 'services.statistic.team.thirdPeriodDefeat.abbreviation' }; 3981 3982 case 124: 3983 return { id: 124, name: 'services.statistic.team.fourthPeriodDefeat.text', abbreviation: 'services.statistic.team.fourthPeriodDefeat.abbreviation' }; 3984 3985 case 125: 3986 return { id: 125, name: 'services.statistic.team.winsPointsPerPeriod.text', abbreviation: 'services.statistic.team.winsPointsPerPeriod.abbreviation' }; 3987 3988 case 126:
3989 return { id: 126, name: 'services.statistic.team.lossesPointsPerPeriod.text', abbreviation: 'services.statistic.team.lossesPointsPerPeriod.abbreviation' }; 3990 3991 case 127: 3992 return { id: 127, name: 'services.statistic.team.tiesPointsPerPeriod.text', abbreviation: 'services.statistic.team.tiesPointsPerPeriod.abbreviation' }; 3993 3994 case 128: 3995 return { id: 128, name: 'services.statistic.team.differential.text', abbreviation: 'services.statistic.team.differential.abbreviation', tooltip: 'services.statistic.team.differential.abbreviation' }; 3996 3997 case 129: 3998 return { id: 129, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 3999 4000 case 130: 4001 return { id: 130, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 4002 4003 case 131: 4004 return { id: 131, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 4005 4006 case 132: 4007 return { id: 132, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 4008 4009 case 133: 4010 return { id: 133, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 4011 4012 case 134: 4013 return { id: 134, name: 'services.statistic.team.pointsFor.text', abbreviation: 'services.statistic.team.pointsFor.abbreviation' }; 4014 4015 case 135: 4016 return { id: 135, name: 'services.statistic.team.pointsAgaint.text', abbreviation: 'services.statistic.team.pointsAgaint.abbreviation' }; 4017 4018 case 136: 4019 return { id: 136, name: 'services.statistic.team.bonusPoints.text', abbreviation: 'services.statistic.team.bonusPoints.abbreviation' }; 4020 4021 case 137: 4022 return { id: 137, name: 'services.statistic.team.rugby.badPoint.text', abbreviation: 'services.statistic.team.rugby.badPoint.abbreviation' }; 4023 4024 case 138: 4025 return { id: 138, name: 'services.statistic.team.differentialSport.text', abbreviation: 'services.statistic.team.differentialSport.abbreviation', tooltip: 'services.statistic.team.differentialSport.tooltip' }; 4026 4027 case 139: 4028 return { id: 139, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 4029 4030 case 140: 4031 return { id: 140, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 4032 4033 case 141: 4034 return { id: 141, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 4035 4036 case 142: 4037 return { id: 142, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 4038 4039 case 143: 4040 return { id: 143, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 4041 4042 case 144: 4043 return { id: 144, name: 'services.statistic.team.pointsFor.text', abbreviation: 'services.statistic.team.pointsFor.abbreviation' }; 4044 4045 case 145: 4046 return { id: 145, name: 'services.statistic.team.pointsAgaint.text', abbreviation: 'services.statistic.team.pointsAgaint.abbreviation' }; 4047 4048 case 146: 4049 return { id: 146, name: 'services.statistic.team.bonusPoints.text', abbreviation: 'services.statistic.team.bonusPoints.abbreviation' }; 4050 4051 case 147: 4052 return { id: 147, name: 'services.statistic.team.differential.text', abbreviation: 'services.statistic.team.differential.abbreviation', tooltip: 'services.statistic.team.differential.tooltip' }; 4053 4054 case 148: 4055 return { id: 148, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 4056 4057 case 149: 4058 return { id: 149, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 4059 4060 case 150: 4061 return { id: 150, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 4062 4063 case 151: 4064 return { id: 151, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 4065 4066 case 152: 4067 return { id: 152, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 4068 4069 case 153: 4070 return { id: 153, name: 'services.statistic.team.pointsFor.text', abbreviation: 'services.statistic.team.pointsFor.abbreviation' }; 4071 4072 case 154: 4073 return { id: 154, name: 'services.statistic.team.pointsAgaint.text', abbreviation: 'services.statistic.team.pointsAgaint.abbreviation' }; 4074 4075 case 155: 4076 return { id: 155, name: 'services.statistic.team.differential.text', abbreviation: 'services.statistic.team.differential.abbreviation', tooltip: 'services.statistic.team.differential.tooltip' }; 4077 4078 case 156: 4079 return { id: 156, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 4080 4081 case 157: 4082 return { id: 157, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 4083 4084 case 158: 4085 return { id: 158, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 4086 4087 case 159: 4088 return { id: 159, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 4089 4090 case 160: 4091 return { id: 160, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 4092 4093 case 161: 4094 return { id: 161, name: 'services.statistic.team.pointsFor.text', abbreviation: 'services.statistic.team.pointsFor.abbreviation' }; 4095 4096 case 162: 4097 return { id: 162, name: 'services.statistic.team.pointsAgaint.text', abbreviation: 'services.statistic.team.pointsAgaint.abbreviation' }; 4098 4099 case 163: 4100 return { id: 163, name: 'services.statistic.team.differential.text', abbreviation: 'services.statistic.team.differential.abbreviation', tooltip: 'services.statistic.team.differential.tooltip' }; 4101 4102 case 164: 4103 return { id: 164, name: 'services.statistic.team.winningPercentage.text', abbreviation: 'services.statistic.team.winningPercentage.abbreviation' }; 4104 4105 case 165: 4106 return { id: 165, name: 'services.statistic.team.gamePlayed.text', abbreviation: 'services.statistic.team.gamePlayed.abbreviation' }; 4107 4108 case 166: 4109 return { id: 166, name: 'services.statistic.team.victory.text', abbreviation: 'services.statistic.team.victory.abbreviation' }; 4110 4111 case 167: 4112 return { id: 167, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation' }; 4113 4114 case 168: 4115 return { id: 168, name: 'services.statistic.team.draw.text', abbreviation: 'services.statistic.team.draw.abbreviation' }; 4116 4117 case 169: 4118 return { id: 169, name: 'services.statistic.team.points.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 4119 4120 case 170: 4121 return { id: 170, name: 'services.statistic.team.pointsFor.text', abbreviation: 'services.statistic.team.pointsFor.abbreviation' }; 4122 4123 case 171: 4124 return { id: 171, name: 'services.statistic.team.pointsAgaint.text', abbreviation: 'services.statistic.team.pointsAgaint.abbreviation' }; 4125 4126 case 172: 4127 return { id: 172, name: 'services.statistic.team.differential.text', abbreviation: 'services.statistic.team.differential.abbreviation', tooltip: 'services.statistic.team.differential.tooltip' }; 4128 4129 case 173: 4130 return { id: 173, name: 'services.statistic.team.winningPercentage.text', abbreviation: 'services.statistic.team.winningPercentage.abbreviation' }; 4131 4132 case 174: 4133 return { id: 174, name: 'services.statistic.team.winningPercentage.text', abbreviation: 'services.statistic.team.winningPercentage.abbreviation' }; 4134 4135 case 175: 4136 return { id: 175, name: 'services.statistic.team.bonusPoints.text', abbreviation: 'services.statistic.team.bonusPoints.abbreviation', tooltip: 'services.statistic.team.bonusPoints.tooltip' }; 4137 4138 case 176: 4139 return { id: 176, name: 'services.statistic.team.manualStandings.text', abbreviation: 'services.statistic.team.manualStandings.abbreviation', tooltip: 'services.statistic.team.manualStandings.tooltip' }; 4140 4141 case 177: 4142 return { id: 177, name: 'services.statistic.team.bonusPoints.text', abbreviation: 'services.statistic.team.bonusPoints.abbreviation', tooltip: 'services.statistic.team.bonusPoints.tooltip' }; 4143 4144 case 178: 4145 return { id: 178, name: 'services.statistic.team.soccer.fault.text', abbreviation: 'services.statistic.team.soccer.fault.abbreviation' }; 4146 4147 case 179: 4148 return { id: 179, name: 'services.statistic.team.manualStandings.text', abbreviation: 'services.statistic.team.manualStandings.abbreviation', tooltip: 'services.statistic.team.manualStandings.tooltip' }; 4149 4150 case 180: 4151 return { id: 180, name: 'services.statistic.team.manualStandings.text', abbreviation: 'services.statistic.team.manualStandings.abbreviation', tooltip: 'services.statistic.team.manualStandings.tooltip' }; 4152 4153 case 181: 4154 return { id: 181, name: 'services.statistic.team.bestDifferential2.text', abbreviation: 'services.statistic.team.bestDifferential2.abbreviation', tooltip: 'services.statistic.team.bestDifferential2.tooltip' }; 4155 4156 case 182: 4157 return { id: 182, name: 'services.statistic.team.bonusPoints.text', abbreviation: 'services.statistic.team.bonusPoints.abbreviation', tooltip: 'services.statistic.team.bonusPoints.tooltip' }; 4158 4159 case 183: 4160 return { id: 183, name: 'services.statistic.team.defeat.text', abbreviation: 'services.statistic.team.defeat.abbreviation', tooltip: 'services.statistic.team.defeat.tooltip' }; 4161 4162 case 184: 4163 return { id: 184, name: 'services.statistic.team.manualStandings.text', abbreviation: 'services.statistic.team.manualStandings.abbreviation', tooltip: 'services.statistic.team.manualStandings.tooltip' }; 4164 4165 case 185: 4166 return { id: 185, name: 'services.statistic.team.bestDifferential3.text', abbreviation: 'services.statistic.team.bestDifferential3.abbreviation', tooltip: 'services.statistic.team.bestDifferential3.tooltip' }; 4167 4168 case 188: 4169 return { id: 188, name: 'services.statistic.team.regularTimeVictory.text', abbreviation: 'services.statistic.team.regularTimeVictory.abbreviation' }; 4170 4171 case 193: 4172 return { id: 193, name: 'services.statistic.team.pointsSpecial.text', abbreviation: 'services.statistic.team.points.abbreviation' }; 4173 4174 case 194: 4175 return { id: 194, name: 'services.statistic.team.winningPercentage.text', abbreviation: 'services.statistic.team.winningPercentage.abbreviation' }; 4176 4177 case 195: 4178 return { id: 195, name: 'services.statistic.team.bonusPoints.text', abbreviation: 'services.statistic.team.bonusPoints.abbreviation', tooltip: 'services.statistic.team.bonusPoints.tooltip' }; 4179 4180 case 198: 4181 return { id: 198, name: 'services.statistic.team.overtimeDefeat.text', abbreviation: 'services.statistic.team.overtimeDefeat.abbreviation' }; 4182 4183 case 203: 4184 return { id: 203, name: 'services.statistic.team.bonusPoints.text', abbreviation: 'services.statistic.team.bonusPoints.abbreviation', tooltip: 'services.statistic.team.bonusPoints.tooltip' }; 4185 4186 case 204: 4187 return { id: 204, name: 'services.statistic.team.setsWon.text', abbreviation: 'services.statistic.team.setsWon.abbreviation' }; 4188 4189 case 205: 4190 return { id: 205, name: 'services.statistic.team.setsLost.text', abbreviation: 'services.statistic.team.setsLost.abbreviation' }; 4191 4192 case 206: 4193 return { id: 206, name: 'services.statistic.team.pointsSet1.text', abbreviation: 'services.statistic.team.pointsSet1.abbreviation' }; 4194 4195 case 207: 4196 return { id: 207, name: 'services.statistic.team.pointsSet2.text', abbreviation: 'services.statistic.team.pointsSet2.abbreviation' }; 4197 4198 case 208: 4199 return { id: 208, name: 'services.statistic.team.pointsSet3.text', abbreviation: 'services.statistic.team.pointsSet3.abbreviation' }; 4200 4201 case 209: 4202 return { id: 209, name: 'services.statistic.team.pointsSet4.text', abbreviation: 'services.statistic.team.pointsSet4.abbreviation' }; 4203 4204 case 210: 4205 return { id: 210, name: 'services.statistic.team.pointsSet5.text', abbreviation: 'services.statistic.team.pointsSet5.abbreviation' }; 4206 4207 case 211: 4208 return { id: 211, name: 'services.statistic.team.pointsSet6.text', abbreviation: 'services.statistic.team.pointsSet6.abbreviation' }; 4209 4210 case 212: 4211 return { id: 212, name: 'services.statistic.team.pointsSet7.text', abbreviation: 'services.statistic.team.pointsSet7.abbreviation' }; 4212 4213 case 213: 4214 return { id: 213, name: 'services.statistic.team.totalPointsPerSet.text', abbreviation: 'services.statistic.team.totalPointsPerSet.abbreviation' }; 4215 4216 case 215: 4217 return { id: 215, name: 'services.statistic.team.bestDifferential2.text', abbreviation: 'services.statistic.team.bestDifferential2.abbreviation', tooltip: 'services.statistic.team.bestDifferential2.tooltip3' }; 4218 4219 case 216: 4220 return { id: 216, name: 'services.statistic.team.divisionPoints.text', abbreviation: 'services.statistic.team.divisionPoints.abbreviation' }; 4221 4222 case 217: 4223 return { id: 217, name: 'services.statistic.team.totalPoints.text', abbreviation: 'services.statistic.team.totalPoints.abbreviation', tooltip: 'services.statistic.team.totalPoints.tooltip' }; 4224 4225 case 218: 4226 return { id: 218, name: 'services.statistic.team.regularPoints.text', abbreviation: 'services.statistic.team.regularPoints.abbreviation' }; 4227 4228 } 4229 } 4230 4231 function getTeamStatisticColumnsByColumnIds(columnIds) { 4232 var columns = []; 4233 4234 _.forEach(columnIds, function (columnId) { 4235 columns.push(getTeamStatisticByStatId(columnId)); 4236 }); 4237 4238 return columns; 4239 } 4240 4241 4242 function getTeamStatisticColumnsBySportId(sportId) { 4243 const statsSportConfig
4243= { 4244 1: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 52, 53, 54, 181, 183, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194], 4245 3: [64, 65, 66, 67, 68, 69, 70, 71, 72, 182], 4246 2: [55, 56, 57, 58, 59, 60, 61, 62, 63, 73, 175], 4247 4: [75, 76, 77, 78, 79, 80, 81, 82, 83, 195, 198, 215], 4248 6: [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 184, 177, 178], 4249 7: [84, 85, 86, 87, 88, 89, 90, 91, 92, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 216, 217, 218], 4250 10: [165, 166, 167, 168, 169, 170, 171, 172], 4251 14: [148, 149, 150, 151, 152, 153, 154, 155], 4252 15: [139, 140, 141, 142, 143, 144, 145, 146, 147, 179] 4253 } 4254 return getTeamStatisticColumnsByColumnIds(statsSportConfig[sportId]); 4255 } 4256 4257 function getTeamStatisticsBySolutionId(solutionId, options) { 4258 var queryString = ''; 4259 4260 if (options) { 4261 for (var option in options) { 4262 if (queryString) { 4263 queryString += '&' 4264 } 4265 4266 queryString += `${option}=${encodeURI(options[option])}`; 4267 } 4268 } 4269 4270 return $q(function (resolve, reject) { 4271 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/team/statistics?${queryString}`) 4272 .then(function (response) { 4273 resolve(response); 4274 }, function (response) { 4275 reject(response); 4276 }); 4277 }); 4278 } 4279 4280 function getSummarizedTeamStatisticsBySolutionId(solutionId, teamId, seasonId, options) { 4281 var queryString = ''; 4282 4283 if (options) { 4284 for (var option in options) { 4285 if (queryString) { 4286 queryString += '&' 4287 } 4288 4289 queryString += `${option}=${encodeURI(options[option])}`; 4290 } 4291 } 4292 4293 return $q(function (resolve, reject) { 4294 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/team/${teamId}/log/${seasonId}?${queryString}`) 4295 .then(function (response) { 4296 resolve(response); 4297 }, function (response) { 4298 reject(response); 4299 }); 4300 }); 4301 } 4302 4303 function getTeamAllStatisticsByTeamId(solutionId, teamId) { 4304 4305 return $q(function (resolve, reject) { 4306 $http.get(`/api/v2/solutions/${solutionId}/teams/${teamId}/seasons/statistics`) 4307 .then(function (response) { 4308 resolve(response); 4309 }, function (response) { 4310 reject(response); 4311 }); 4312 }); 4313 } 4314 4315 function getPlayerStatisticsBySolutionId(solutionId, options) { 4316 var queryString = ''; 4317 4318 if (options) { 4319 for (var option in options) { 4320 if (queryString) { 4321 queryString += '&' 4322 } 4323 queryString += `${option}=${encodeURI(options[option])}`; 4324 } 4325 } 4326 4327 return $q(function (resolve, reject) { 4328 $http.get(`/api/v2/solutions/${solutionId}/players/statistics?${queryString}`) 4329 .then(function (response) { 4330 resolve(response); 4331 }, function (response) { 4332 reject(response); 4333 }); 4334 }); 4335 } 4336 4337 function getPlayerStatisticsDateRangeBySolutionId(solutionId, options) { 4338 var queryString = ''; 4339 4340 if (options) { 4341 for (var option in options) { 4342 if (queryString) { 4343 queryString += '&' 4344 } 4345 queryString += `${option}=${encodeURI(options[option])}`; 4346 } 4347 } 4348 4349 return $q(function (resolve, reject) { 4350 $http.get(`/api/v2/solutions/${solutionId}/players/statistics/daterange?${queryString}`) 4351 .then(function (response) { 4352 resolve(response); 4353 }, function (response) { 4354 reject(response); 4355 }); 4356 }); 4357 } 4358 4359 function getPlayerAllStatisticsByPlayerId(solutionId, playerId) { 4360 return $q(function (resolve, reject) { 4361 $http.get(`/api/v2/solutions/${solutionId}/players/${playerId}/seasons/statistics`) 4362 .then(function (response) { 4363 resolve(response); 4364 }, function (response) { 4365 reject(response); 4366 }); 4367 }); 4368 } 4369 4370 function getPlayersStatisticsByTeamId(solutionId, teamId, options) { 4371 var queryString; 4372 4373 if (options) { 4374 queryString = '?'; 4375 4376 for (var option in options) { 4377 if (queryString) { 4378 queryString += '&' 4379 } 4380 4381 queryString += `${option}=${encodeURI(options[option])}`; 4382 } 4383 } 4384 4385 return $q(function (resolve, reject) { 4386 $http.get(`/api/v2/solutions/${solutionId}/teams/${teamId}/players/statistics${queryString}`) 4387 .then(function (response) { 4388 resolve(response); 4389 }, function (response) { 4390 reject(response); 4391 }); 4392 }); 4393 } 4394 4395 function getTeamPlayerStatisticsByTeamId(solutionId, teamId) { 4396 return $q(function (resolve, reject) { 4397 $http.get(`/api/v2/solutions/${solutionId}/team/${teamId}/seasons/statistics`) 4398 .then(function (response) { 4399 resolve(response); 4400 }, function (response) { 4401 reject(response); 4402 }); 4403 }); 4404 } 4405 4406 function getSportTeamStatsByType(type, sportId) { 4407 var result = null; 4408 var stats = { 4409 'shotsOnGoal': { 6: 43 },
4410 'scorePeriod': { 1: 8, 2: 9, 3: 8, 4: 10, 6: 8, 7: 8 } 4411 } 4412 4413 return stats[type][sportId] || null; 4414 } 4415 4416 function getTeamLeadersBySolutionId(solutionId, leaderboardSettings, options) { 4417 var queryString = ''; 4418 4419 if (options) { 4420 for (var option in options) { 4421 if (queryString) { 4422 queryString += '&' 4423 } 4424 4425 queryString += `${option}=${encodeURI(options[option])}`; 4426 } 4427 } 4428 4429 return $q(function (resolve, reject) { 4430 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/teamleader?${queryString}`, leaderboardSettings) 4431 .then(function (response) { 4432 resolve(response); 4433 }, function (response) { 4434 reject(response); 4435 }); 4436 }); 4437 } 4438 4439 function getPlayerLeadersByStatistic(solutionId, leaderboardSettings, options) { 4440 var queryString = ''; 4441 4442 if (options) { 4443 for (var option in options) { 4444 if (queryString) { 4445 queryString += '&' 4446 } 4447 4448 queryString += `${option}=${encodeURI(options[option])}`; 4449 } 4450 } 4451 4452 return $q(function (resolve, reject) { 4453 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/playerleader?${queryString}`, leaderboardSettings) 4454 .then(function (response) { 4455 resolve(response); 4456 }, function (response) { 4457 reject(response); 4458 }); 4459 }); 4460 } 4461 4462 function getPlayerLeaderBySeasons(solutionId, leaderboardSettings, options) { 4463 var queryString = ''; 4464 4465 if (options) { 4466 for (var option in options) { 4467 if (queryString) { 4468 queryString += '&' 4469 } 4470 4471 queryString += `${option}=${encodeURI(options[option])}`; 4472 } 4473 } 4474 4475 return $q(function (resolve, reject) { 4476 $http.post(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/player/leaders?${queryString}`, leaderboardSettings) 4477 .then(function (response) { 4478 resolve(response); 4479 }, function (response) { 4480 reject(response); 4481 }); 4482 }); 4483 } 4484 4485 } 4486})();; 4487(function () { 4488 'use strict'; 4489 4490 angular 4491 .module('app.services') 4492 .factory('SuspensionService', suspensionService); 4493 4494 suspensionService.$inject = ['$http', '$q']; 4495 4496 function suspensionService($http, $q) { 4497 return { 4498 getSuspensionsBySolutionId: getSuspensionsBySolutionId 4499 } 4500 4501 function getSuspensionsBySolutionId(solutionId, options) { 4502 var queryString = ''; 4503 4504 if (options) { 4505 for (var option in options) { 4506 if (queryString) { 4507 queryString += '&' 4508 } 4509 4510 queryString += `${option}=${encodeURI(options[option])}`; 4511 } 4512 } 4513 4514 return $q(function (resolve, reject) { 4515 $http.get(`/api/v2/solutions/${solutionId}/suspensions?${queryString}`) 4516 .then(function (response) { 4517 resolve(response); 4518 }, function (response) { 4519 reject(response); 4520 }); 4521 }); 4522 } 4523 } 4524})();; 4525(function () { 4526 'use strict'; 4527 4528 angular 4529 .module('app.services') 4530 .factory('TeamService', teamService); 4531 4532 teamService.$inject = ['$http', '$q', '$sessionStorage']; 4533 4534 function teamService($http, $q, $sessionStorage) { 4535 return { 4536 getTeamsBySolutionIdWithOptions: getTeamsBySolutionIdWithOptions, 4537 getTeamsBySolutionId: getTeamsBySolutionId, 4538 getTeamsBySeasonId: getTeamsBySeasonId, 4539 getTeamById: getTeamById, 4540 getTeamLineupById: getTeamLineupById 4541 } 4542 4543 function getTeamsBySolutionIdWithOptions(solutionId, options) { 4544 var queryString = ''; 4545 4546 if (options) { 4547 for (var option in options) { 4548 if (queryString) { 4549 queryString += '&' 4550 } 4551 4552 if (option !== options[option]) { 4553 queryString += `${option}=${encodeURI(options[option])}`; 4554 } 4555 } 4556 } 4557 4558 return $q(function (resolve, reject) { 4559 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/team/active/filter?${queryString}`) 4560 .then(function (response) { 4561 resolve(response); 4562 }, function (response) { 4563 reject(response); 4564 }); 4565 }); 4566 } 4567 4568 function getTeamsBySolutionId(solutionId) { 4569 return $q(function (resolve, reject) { 4570 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/team/active/filter`) 4571 .then(function (response) { 4572 resolve(response); 4573 }, function (response) { 4574 reject(response); 4575 }); 4576 }); 4577 } 4578 4579 function getTeamsBySeasonId(solutionId, seasonId) { 4580 return $q(function (resolve, reject) { 4581 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/team/season/${seasonId}`) 4582 .then(function (response) { 4583 resolve(response); 4584 }, function (response) { 4585 reject(response); 4586 }); 4587 }); 4588 } 4589 4590 function getTeamById(solutionId, teamId) { 4591 return $q(function (resolve, reject) { 4592 $http.get(`/api/v2/solutions/${solutionId}/teams/${teamId}}`) 4593 .then(function (response) { 4594 resolve(response); 4595 }, function (response) { 4596 reject(response); 4597 }); 4598 }); 4599 } 4600 4601 function getTeamLineupById(solutionId, teamId) { 4602 return $q(function (resolve, reject) { 4603 $http.get(`/api/v2/solutions/${solutionId}/teams/${teamId}/lineup/active`) 4604 .then(function (response) { 4605 resolve(response); 4606 }, function (response) { 4607 reject(response); 4608 }); 4609 }); 4610 } 4611 } 4612})();; 4613(function () { 4614'use strict'; 4615 4616angular 4617 .module('app.services') 4618 .factory('GuidService', guidService); 4619 4620 guidService.$inject = []; 4621 4622 function guidService() { 4623 return { 4624 getGuid: getGuid 4625 } 4626 4627 function getGuid() { 4628 return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { 4629 var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); 4630 return v.toString(16); 4631 }); 4632 } 4633 } 4634})();; 4635(function () { 4636 'use strict'; 4637 4638 angular 4639 .module('app.services') 4640 .factory('HashService', hashService); 4641 4642 hashService.$inject = ['$location', '$translate']; 4643 4644 function hashService($location, $translate) { 4645 const STATISTICS_TABS = { 4646 LEADERS: $translate.instant('directives.widgets.statistics.tabsUrl.leadersTab'), 4647 TEAMS: $translate.instant('directives.widgets.statistics.tabsUrl.teamsTab'), 4648 PLAYERS: $translate.instant('directives.widgets.statistics.tabsUrl.playersTab'), 4649 GOALIES: $translate.instant('directives.widgets.statistics.tabsUrl.goaliesTab'), 4650 PITCHERS: $translate.instant('directives.widgets.statistics.tabsUrl.pitchersTab'), 4651 DEFENSE: $translate.instant('directives.widgets.statistics.tabsUrl.defenseTab'), 4652 SUSPENSIONS: $translate.instant('directives.widgets.statistics.tabsUrl.suspensionsTab') 4653 } 4654 4655 const DIVISIONS_TABS = { 4656 SCHEDULE: $translate.instant('widgets.divisions.divisionsPage.tabsUrl.scheduleTab'), 4657 STANDINGS: $translate.instant('widgets.divisions.divisionsPage.tabsUrl.standingsTab'), 4658 BRACKETS: $translate.instant('widgets.divisions.divisionsPage.tabsUrl.bracketsTab'), 4659 STATS_LEADERS: $translate.instant('widgets.divisions.divisionsPage.tabsUrl.statsLeadersTab'), 4660 STATS_TEAMS: $translate.instant('widgets.divisions.divisionsPage.tabsUrl.statsTeamsTab'), 4661 STATS_PLAYERS: $translate.instant('widgets.divisions.divisionsPage.tabsUrl.statsPlayersTab'), 4662 STATS_GOALIES: $translate.instant('widgets.divisions.divisionsPage.tabsUrl.statsGoaliesTab'), 4663 STATS_SUSPENSIONS: $translate.instant('widgets.divisions.divisionsPage.tabsUrl.statsSuspensionsTab'), 4664 STATS_PITCHERS: $translate.instant('widgets.divisions.divisionsPage.tabsUrl.statsPitchersTab'), 4665 } 4666 4667 return { 4668 getParams: getParams, 4669 setParams: setParams, 4670 hasStatisticsTabsChanged: hasStatisticsTabsChanged, 4671 hasDivisionsTabsChanged: hasDivisionsTabsChanged, 4672 hasNoHashFilters: hasNoHashFilters, 4673 STATISTICS_TABS: STATISTICS_TABS, 4674 DIVISIONS_TABS: DIVISIONS_TABS 4675 } 4676 4677 4678 function getParams() { 4679 const hash = $location.hash(); 4680 if (hash) { 4681 return hash.split('&').reduce(function (result, item) { 4682 var parts = item.split('='); 4683 result[parts[0]] = parts[1]; 4684 return result; 4685 }, {}); 4686 } else { 4687 return {}; 4688 } 4689 } 4690 4691 function setParams(params, deletePrevious) { 4692 let oldParams = getParams(); 4693 if (deletePrevious) { 4694 oldParams = {}; 4695 } 4696
4697 Object.keys(params).forEach(function (key) { 4698 if (params[key] !== undefined && params[key] !== null) { 4699 oldParams[key] = params[key]; 4700 } 4701 }) 4702 4703 const params_url = Object.keys(oldParams).map(function (key) { 4704 return key + '=' + oldParams[key]; 4705 }).join('&'); 4706 4707 $location.hash(params_url); 4708 } 4709 4710 function hasStatisticsTabsChanged(newUrl, oldUrl) { 4711 let tabNew = undefined; 4712 let tabOld = undefined; 4713 Object.keys(STATISTICS_TABS).forEach(function (key) { 4714 const tab = STATISTICS_TABS[key]; 4715 if (newUrl && newUrl.includes(`tab=${tab}`)) { 4716 tabNew = tab; 4717 } 4718 if (oldUrl && oldUrl.includes(`tab=${tab}`)) { 4719 tabOld = tab; 4720 } 4721 }); 4722 return tabNew !== tabOld; 4723 } 4724 4725 function hasDivisionsTabsChanged(newUrl, oldUrl) { 4726 let tabNew = undefined; 4727 let tabOld = undefined; 4728 Object.keys(DIVISIONS_TABS).forEach(function (key) { 4729 const tab = DIVISIONS_TABS[key]; 4730 if (newUrl && newUrl.includes(`tab=${tab}`)) { 4731 tabNew = tab; 4732 } 4733 if (oldUrl && oldUrl.includes(`tab=${tab}`)) { 4734 tabOld = tab; 4735 } 4736 }); 4737 return tabNew !== tabOld; 4738 } 4739 4740 function hasNoHashFilters(tabs) { 4741 const params = getParams(); 4742 if (Object.keys(params).length > 1) { 4743 return false; 4744 } else if (Object.keys(params).length === 1) { //Check if it's a tab 4745 let found = false; 4746 for (let key of Object.keys(tabs)) { 4747 if (params.tab === tabs[key]) { 4748 found = true; 4749 break; 4750 } 4751 } 4752 return found; 4753 } 4754 return true; 4755 } 4756 } 4757})();; 4758(function () { 4759 'use strict'; 4760 4761 angular 4762 .module('app.services') 4763 .factory('SlugService', SlugService); 4764 4765 function SlugService() { 4766 return { 4767 slugify: function (text) { 4768 const a = 'à áäâèéëêìÃïîòóöôùúüûñçÃÿÅæÅÅÅá¹áºÇµÇ¹á¸¿ÇáºÅºá¸§Â·/_,:;' 4769 const b = 'aaaaeeeeiiiioooouuuuncsyoarsnpwgnmuxzh------' 4770 const p = new RegExp(a.split('').join('|'), 'g') 4771 4772 return text.toString().toLowerCase() 4773 .replace(/\s+/g, '-') // Replace spaces with - 4774 .replace(p, c => 4775 b.charAt(a.indexOf(c))) // Replace special chars 4776 .replace(/'/g, '-') // Replace & with 'and' 4777 .replace(/&/g, '-and-') // Replace & with 'and' 4778 .replace(/[^\w\-]+/g, '') // Remove all non-word chars 4779 .replace(/\-\-+/g, '-') // Replace multiple - with single - 4780 .replace(/^-+/, '') // Trim - from start of text 4781 .replace(/-+$/, '') // Trim - from end of text 4782 } 4783 }; 4784 } 4785})();; 4786(function () { 4787 'use strict'; 4788 4789 angular 4790 .module('app.services') 4791 .factory('StyleService', StyleService); 4792 4793 function StyleService() { 4794 return { 4795 fontSettingToStyle: function (setting) { 4796 var style = {}; 4797 4798 style['font-size'] = setting.size + 'px'; 4799 style['color'] = setting.color; 4800 4801 4802 style['font-weight'] = setting.bold ? 'bold' : 'normal'; 4803 style['font-style'] = setting.italic ? 'italic' : 'normal'; 4804 style['text-decoration'] = setting.underline ? 'underline' : 'none'; 4805 4806 return style; 4807 } 4808 }; 4809 } 4810})();; 4811(function () { 4812 'use strict'; 4813 4814 angular 4815 .module('app.services') 4816 .factory('TextService', TextService); 4817 4818 function TextService() { 4819 return { 4820 btoa: function(str) { 4821 const bytes = new TextEncoder().encode(str); 4822 const binString = String.fromCodePoint(...bytes); 4823 4824 try { 4825 return btoa(binString); 4826 } 4827 catch { 4828 return str; 4829 } 4830 }, 4831 4832 atob: function (base64) { 4833 try { 4834 const binString = atob(base64); 4835 const bytes = Uint8Array.from(binString, (m) => m.codePointAt(0)); 4836 return new TextDecoder().decode(bytes); 4837 } 4838 catch { 4839 return base64; 4840 } 4841 } 4842 }; 4843 } 4844})();; 4845(function () { 4846 'use strict'; 4847 4848 angular 4849 .module('app.services') 4850 .factory('ConfigurationService', ConfigurationService); 4851 4852 ConfigurationService.$inject = ['$http', '$q']; 4853 4854 function ConfigurationService($http, $q) { 4855 return { 4856 getConfiguration: getConfiguration 4857 } 4858 4859 function getConfiguration() { 4860 return $q(function (resolve, reject) { 4861 $http.get(`/public/v2/configs/${__environment__}.config.json`) 4862 .then(function (response) { 4863 resolve(response); 4864 }, function (response) { 4865 reject(response); 4866 }); 4867 }); 4868 } 4869 } 4870})();; 4871(function () { 4872 'use strict'; 4873 4874 angular 4875 .module('app.services') 4876 .factory('FormService', FormService); 4877 4878 FormService.$inject = ['$http', '$q', '$sessionStorage']; 4879 4880 function FormService($http, $q, $sessionStorage) { 4881 return { 4882 getFormByFormId: getFormByFormId, 4883 submit: submit, 4884 uploadFile: uploadFile, 4885 isLimitReached: isLimitReached, 4886 getFormsBySolutionId: getFormsBySolutionId 4887 } 4888 4889 function getFormByFormId(solutionId, pageId, formId) { 4890 return $q(function (resolve, reject) { 4891 $http.get(`/api/v2/website/${solutionId}/pages/${pageId}/forms/${formId}`) 4892 .then(function (response) { 4893 resolve(response); 4894 }, function (response) { 4895 reject(response); 4896 }); 4897 }); 4898 } 4899 4900 function getFormsBySolutionId(solutionId) { 4901 return $q(function (resolve, reject) { 4902 $http.get(`${$sessionStorage.configurations.servers.rest}/api/solution/${solutionId}/forms`) 4903 .then(function (response) { 4904 resolve(response); 4905 }, function (response) { 4906 reject(response); 4907 }); 4908 }); 4909 } 4910 4911 function submit(solutionId, pageId, formId, formData, recaptchaToken) { 4912 return $q(function (resolve, reject) { 4913 $http.put(`/api/v2/website/${solutionId}/pages/${pageId}/forms/${formId}`, 4914 formData, 4915 { headers: { 4916 'Content-Type': 'application/x-www-form-urlencoded; charset-UTF-8', 4917 '__RequestVerificationToken': __requestVerificationToken__, 4918 '__googleRecaptcha': recaptchaToken 4919 } }) 4920 .then(function (response) { 4921 resolve(response); 4922 }, function (response) { 4923 reject(response); 4924 }); 4925 }); 4926 } 4927 4928 function uploadFile(fileFormData) { 4929 return $q(function (resolve, reject) {
4930 $http.post(`/handlers/UploadStorageFile.ashx`, 4931 fileFormData, 4932 { 4933 headers: { 4934 'Content-Type': undefined, 4935 }, 4936 transformRequest: [] 4937 }) 4938 .then(function (response) { 4939 resolve(response); 4940 }, function (response) { 4941 reject(response); 4942 }); 4943 }); 4944 } 4945 4946 function isLimitReached(formId) { 4947 return $q(function (resolve, reject) { 4948 $http.get(`/api/form/${formId}/limit`) 4949 .then(function (response) { 4950 resolve(response); 4951 }, function (response) { 4952 reject(response); 4953 }); 4954 }); 4955 } 4956 } 4957})();; 4958(function () { 4959 'use strict'; 4960 4961 angular 4962 .module('app.services') 4963 .factory('TemplateService', TemplateService); 4964 4965 TemplateService.$inject = ['$http', '$q', '$sessionStorage']; 4966 4967 function TemplateService($http, $q, $sessionStorage) { 4968 return { 4969 getCardWidgetTemplates: getCardWidgetTemplates, 4970 } 4971 4972 function getCardWidgetTemplates(solutionId) { 4973 return $q(function (resolve, reject) { 4974 $http.get(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}/template/cardwidget`) 4975 .then(function (response) { 4976 resolve(response); 4977 }, function (response) { 4978 reject(response); 4979 }); 4980 }); 4981 } 4982 4983 } 4984})();; 4985(function () { 4986 'use strict'; 4987 4988 angular 4989 .module('app.services') 4990 .factory('SignalrService', signalrService); 4991 4992 signalrService.$inject = ['$q', '$http', '$sessionStorage', '$localStorage']; 4993 4994 function signalrService($q, $http, $sessionStorage, $localStorage) { 4995 var connection = null; 4996 var callbacks = []; 4997 var groups = []; 4998 var loaded = false; 4999 5000 var GROUPS = { 5001 BaseballGameUpdate: function (gameId) { return `GameBaseballUpdate-${gameId}`; }, 5002 GamebarUpdate: function (solutionId) { return `GamebarUpdate-${solutionId}`; } 5003 } 5004 5005 var EVENTS = { 5006 BaseballScoreboardUpdate: 'GameBaseballScoreboardUpdate', 5007 BaseballStatsUpdate: 'GameBaseballStatsUpdate', 5008 GameUpdate: 'GameUpdate' 5009 } 5010 5011 return { 5012 GROUPS, 5013 EVENTS, 5014 getConnection, 5015 joinGroups, 5016 } 5017 5018 function getAccessToken() { 5019 return $q(function (resolve, reject) { 5020 $http.get(`${$sessionStorage.configurations.servers.signalR}/api/security/signalr`) 5021 .then(function (response) { 5022 resolve(response); 5023 }, function (response) { 5024 reject(response); 5025 }); 5026 }); 5027 } 5028 5029 function getConnection(groupName) { 5030 if (!connection && !loaded) { 5031 loaded = true; 5032 5033 var retryTimes = [1000, 2000, 3000, 5000, 10000, 15000]; 5034 var index = 0; 5035 getAccessToken().then(function (response) { 5036 connection = new signalR.HubConnectionBuilder() 5037 .withUrl(response.data.url, { 5038 accessTokenFactory: function () { return response.data.accessToken } 5039 }).withAutomaticReconnect({ 5040 nextRetryDelayInMilliseconds: function() { 5041 return retryTimes[index++] || 15000; 5042 } 5043 }) 5044 .build(); 5045 5046 5047 groups.push(groupName); 5048 connection.start().then(function () { 5049 joinGroups(groups); 5050 }); 5051 5052 for (var callback of callbacks) { 5053 setCallback(callback.event, callback.callback); 5054 } 5055 }); 5056 } 5057 else { 5058 if (connection && connection.connectionId) { 5059 joinGroups([groupName]); 5060 } 5061 else if(groups.indexOf(groupName) == -1) { 5062 groups.push(groupName); 5063 } 5064 } 5065 5066 return { 5067 on: function (event, callback) { 5068 if (!connection) { 5069 callbacks.push({ event: event, callback: callback }); 5070 } 5071 else { 5072 setCallback(event, callback); 5073 } 5074 } 5075 }; 5076 } 5077 5078 function joinGroups(groups) { 5079 return $q(function (resolve, reject) { 5080 $http.post(`${$sessionStorage.configurations.servers.signalR}/api/signalr/joingroups`, { connectionId: connection.connectionId, groups: groups }) 5081 .then(function (response) { 5082 resolve(response); 5083 }, function (response) { 5084 reject(response); 5085 }); 5086 }); 5087 } 5088 5089 function base64ToArrayBuffer(base64) { 5090 const binaryString = atob(base64); 5091 5092 const length = binaryString.length; 5093 const bytes = new Uint8Array(length); 5094 5095 for (let i = 0; i < length; i++) { 5096 bytes[i] = binaryString.charCodeAt(i); 5097 } 5098 5099 return bytes.buffer; 5100 } 5101 5102 function setCallback(event, callback) { 5103 connection.on(event, function (response) { 5104 var arrayBuffer = base64ToArrayBuffer(response); 5105 var uncompressedResponse = pako.ungzip(arrayBuffer, { to: 'string' }); 5106 5107 callback(uncompressedResponse); 5108 }); 5109 } 5110 } 5111})();; 5112(function () { 5113 'use strict'; 5114 5115 angular 5116 .module('app.services') 5117 .factory('PageService', PageService); 5118 5119 PageService.$inject = ['$http', '$q', '$sessionStorage']; 5120 5121 function PageService($http, $q, $sessionStorage) { 5122 return { 5123 getReservedPages: getReservedPages, 5124 getPagesBySolutionId: getPagesBySolutionId 5125 } 5126 5127 function getReservedPages() { 5128 return $q(function (resolve, reject) { 5129 $http.get(`/public/v2/page-definitions/pages.json`) 5130 .then(function (response) { 5131 resolve(response); 5132 }, function (response) { 5133 reject(response); 5134 }); 5135 }); 5136 } 5137 5138 function getPagesBySolutionId(solutionId, culture) { 5139 return $q(function (resolve, reject) { 5140 $http.get(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}/page/culture/${culture}`) 5141 .then(function (response) { 5142 resolve(response); 5143 }, function (response) { 5144 reject(response); 5145 }); 5146 }); 5147 } 5148 } 5149})();; 5150(function () { 5151 'use strict'; 5152 5153 angular 5154 .module('app.services') 5155 .factory('TranslationService', translationService); 5156 5157 translationService.$inject = ['$localStorage']; 5158 5159 function translationService($localStorage) { 5160 return { 5161 getTranslation: getTranslation, 5162 setTranslation: setTranslation, 5163 translateExternalUrl: translateExternalUrl 5164 } 5165 5166 function setTranslation(property, newvalue, list, culture) { 5167 culture = culture || $localStorage.currentLanguage.culture; 5168 try { 5169 var value = _.find(list, function(value) { 5170 return value.culture === culture; 5171 }); 5172 if (value) { 5173 value[property] = newvalue; 5174 } else { 5175 var newCulture = angular.extend({}, list[0]); 5176 newCulture.culture = culture; 5177 newCulture[property] = newvalue; 5178 list.push(newCulture); 5179 5180 } 5181 } catch (error) { 5182 // TODO if error, fallback ... ? 5183 } 5184 } 5185 5186 function getTranslation(property, list, culture) { 5187 culture = culture || $localStorage.currentLanguage.culture; 5188 try { 5189 var value = _.find(list, function(value) { 5190 return value.culture === culture; 5191 }); 5192 5193 // Select first translation if not defined for the current culture 5194 if (value === undefined) { 5195 value = _.first(list); 5196 } 5197 5198 if (property) { 5199 return value[property]; 5200 } 5201 return value; 5202 } catch (error) { 5203 // TODO if error, fallback ... ? 5204 } 5205 } 5206 5207 function translateExternalUrl(property) { 5208 let urlPage = getTranslation('url', property); 5209 if (urlPage && urlPage[0] !== "/") { 5210 if (urlPage.substr(0, 4) === "www.") { 5211 urlPage = "https://" + urlPage; 5212 } else if (urlPage.substr(0, 4) !== "http") { 5213 urlPage = "https://www." + urlPage; 5214 } 5215 } 5216 return urlPage; 5217 } 5218 } 5219})();; 5220(function () { 5221 'use strict'; 5222 5223 angular 5224 .module('app.services') 5225 .factory('UrlService', urlService); 5226 5227 urlService.$inject = ['$log', '$translate', '$sessionStorage', 'SlugService']; 5228 5229 function urlService($log, $translate, $sessionStorage, slugService) { 5230 return { 5231 getAppUrl: getAppUrl, 5232 getFollowUrl: getFollowUrl, 5233 getGameUrl: getGameUrl, 5234 getGameSheetUrl: getGameSheetUrl, 5235 getTeamUrl: getTeamUrl, 5236 getPlayersUrl: getPlayersUrl, 5237 getPlayerUrl: getPlayerUrl, 5238 getNewsUrl: getNewsUrl, 5239 getNewsListUrl: getNewsListUrl, 5240 getVideoUrl: getVideoUrl, 5241 getShareImageUrl: getShareImageUrl, 5242 parseVideoUrl: parseVideoUrl 5243 } 5244 5245 function getAppUrl() {
5246 return `http://kreezee.app.link/${__solutionId__}-ads-solution?solutionid=${__solutionId__}`; 5247 } 5248 5249 function getFollowUrl(solutionId, teamId) { 5250 return `https://kreezee.app.link/${solutionId}-team?teamid=${teamId}`; 5251 } 5252 5253 function getGameUrl(gameId) { 5254 var scores = $translate.instant('services.websites.urls.scores.url'); 5255 var game = $translate.instant('services.websites.urls.game.url'); 5256 5257 if (__whiteLabel__) { 5258 return `/${scores}/${game}-${gameId}`; 5259 } else { 5260 $log.warn('Not implemented yet.'); 5261 } 5262 } 5263 5264 function getGameSheetUrl(gameId) { 5265 return `/handlers/GameSheet.ashx?gameId=${gameId}`; 5266 } 5267 5268 function getTeamUrl(name, id) { 5269 var teams = $translate.instant('services.websites.urls.teams.url'); 5270 5271 if (__whiteLabel__) { 5272 return `/${teams}/${slugService.slugify(name)}-${id}`; 5273 } else { 5274 $log.warn('Not implemented yet.'); 5275 } 5276 } 5277 5278 function getPlayersUrl() { 5279 var players = $translate.instant('services.websites.urls.players.url'); 5280 5281 if (__whiteLabel__) { 5282 return `/${players}`; 5283 } else { 5284 $log.warn('Not implemented yet.'); 5285 } 5286 } 5287 5288 function getNewsListUrl() { 5289 var news = $translate.instant('services.websites.urls.news.url'); 5290 5291 if (__whiteLabel__) { 5292 return `/${news}`; 5293 } else { 5294 $log.warn('Not implemented yet.'); 5295 } 5296 } 5297 5298 function getPlayerUrl(name, id) { 5299 var players = $translate.instant('services.websites.urls.players.url'); 5300 5301 if (__whiteLabel__) { 5302 if (name && id) { 5303 return `/${players}/${slugService.slugify(name)}-${id}`; 5304 } 5305 } else { 5306 $log.warn('Not implemented yet.'); 5307 } 5308 } 5309 5310 function getNewsUrl(title, id) { 5311 var news = $translate.instant('services.websites.urls.news.url'); 5312 5313 if (__whiteLabel__) { 5314 return `/${news}/${slugService.slugify(title)}-${id}`; 5315 } else { 5316 $log.warn('Not implemented yet.'); 5317 } 5318 } 5319 5320 function getVideoUrl(title, id) { 5321 var videos = $translate.instant('services.websites.urls.videos.url'); 5322 5323 if (__whiteLabel__) { 5324 return `/${videos}/${slugService.slugify(title)}-${id}`; 5325 } else { 5326 $log.warn('Not implemented yet.'); 5327 } 5328 } 5329 5330 function getShareImageUrl(id) { 5331 return `${$sessionStorage.configurations.servers.rest}/api/social-media/image/${id}`; 5332 } 5333 5334 function parseVideoUrl(url) { 5335 var youtubeRegEx = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/; 5336 var vimeoRegEx = /\/\/(www\.)?vimeo.com\/(\d+)($|\/)/; 5337 var dailyMotionRegEx = /^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/; 5338 var match = null; 5339 5340 if ((url.toLowerCase().indexOf('youtube') !== -1) || 5341 (url.toLowerCase().indexOf('youtu.be') !== -1)) { 5342 match = url.match(youtubeRegEx); 5343 return match !== null ? match[1] : null; 5344 5345 } else if (url.toLowerCase().indexOf('vimeo') !== -1) { 5346 match = url.match(vimeoRegEx); 5347 return match !== null ? match[2] : null; 5348 5349 } else if (url.toLowerCase().indexOf('dailymotion') !== -1) { 5350 match = url.match(dailyMotionRegEx); 5351 if (match !== null) { 5352 if (angular.isDefined(match[4])) { 5353 return match[4]; 5354 } 5355 return match[2]; 5356 } 5357 return null; 5358 } else { 5359 return null; 5360 } 5361 } 5362 } 5363})();; 5364(function () { 5365 'use strict'; 5366 5367 angular 5368 .module('app.services') 5369 .factory('WebsiteEditorService', WebsiteEditorService); 5370 5371 WebsiteEditorService.$inject = ['$http', '$q', '$sessionStorage', '$localStorage', 'SecurityService']; 5372 5373 function WebsiteEditorService($http, $q, $sessionStorage, $localStorage, securityService) { 5374 var mode = ''; 5375 5376 return { 5377 editMode: editMode, 5378 isEditMode: isEditMode, 5379 getWidgets: getWidgets, 5380 validateAuthorization: validateAuthorization, 5381 updatePage: updatePage, 5382 updateWebsite: updateWebsite, 5383 uploadImage: uploadImage 5384 } 5385 5386 function editMode(activated) { 5387 mode = activated ? 'edit' : ''; 5388 } 5389 5390 function isEditMode() { 5391 return mode === 'edit'; 5392 } 5393 5394 function getWidgets() { 5395 return $q(function (resolve, reject) { 5396 $http.get('/public/v2/widget-definitions/widgets.json') 5397 .then(function (response) { 5398 resolve(response); 5399 }, function (response) { 5400 reject(response); 5401 }); 5402 }); 5403 } 5404 5405 function validateAuthorization() { 5406 return $q(function (resolve, reject) { 5407 $http.post(`${$sessionStorage.configurations.servers.rest}/api/authentication/validate`, {}, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 5408 .then(function (response) { 5409 securityService.setRole() 5410 .then(function (response) { 5411 resolve(response); 5412 }) 5413 .catch(function (error) { 5414 reject(error); 5415 bugsnag.notify(error); 5416 }); 5417 }, function (response) { 5418 if (response.status === 401) { 5419 redirectToLogin(); 5420 } 5421 reject(response); 5422 }); 5423 }); 5424 } 5425 5426 function updatePage(solutionId, pageId, options) { 5427 if (angular.isDefined(options)) { 5428 for (var row in page.rows) { 5429 var sections = page.rows[row].sections; 5430 5431 for (var section in sections) { 5432 var widgets = sections[section].widgets; 5433 5434 for (var widget in widgets) { 5435 // Find the widget to update. 5436 if (options.uuid === widgets[widget].uuid) { 5437 var widget = widgets[widget]; 5438 5439 for (var parameter in widget.parameters) { 5440 var parameter = widget.parameters[parameter]; 5441 5442 // Loop through all parameters. 5443 for (var variable of Object.keys(options.parameters)) { 5444 if (parameter.id === variable) { 5445 parameter.value = options.parameters[variable]; 5446 } 5447 } 5448 } 5449 } 5450 } 5451 } 5452 } 5453 } 5454 5455 return $q(function (resolve, reject) { 5456 $http.put(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}/page/${pageId}`, { pageId: pageId, value: angular.toJson(page).replace(/\\\\\"/g, '\"') }, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 5457 .then(function (response) { 5458 resolve(response); 5459 }, function (response) { 5460 if (response.status === 401) { 5461 redirectToLogin(); 5462 } 5463 reject(response); 5464 }); 5465 }); 5466 } 5467 5468 function updateWebsite(solutionId, website) { 5469 return $q(function (resolve, reject) { 5470 $http.put(`${$sessionStorage.configurations.servers.rest}/api/website/${solutionId}`, { solutionId: solutionId, value: angular.toJson(website) }, { headers: { '__KreezeeSession__': angular.toJson($localStorage.__KreezeeSession__) } }) 5471 .then(function (response) { 5472 resolve(response); 5473 }, function (response) { 5474 if (response.status === 401) { 5475 redirectToLogin(); 5476 } 5477 reject(response); 5478 }); 5479 }); 5480 } 5481 5482 function uploadImage(solutionId, fileName, image, width) { 5483 return $q(function (resolve, reject) { 5484 $http.post(`/handlers/v2/amazon-s3.ashx?solutionId=${solutionId}&fileName=${fileName}${width ? `&maxWidth=${width}` : ""}`, image, { headers: { 'Content-Type': undefined } }) 5485 .then(function (response) { 5486 resolve(response); 5487 }, function (response) { 5488 reject(response); 5489 }); 5490 }); 5491 } 5492 5493 //Helpers 5494 function redirectToLogin() { 5495 $localStorage.__KreezeeSession__ = undefined; 5496 window.location.href = '/login'; 5497 } 5498 } 5499})();;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.