Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 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 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 12x 1x 12x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 3x 3x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x 1x 25x 25x 25x 25x 25x 25x 25x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 14x 14x 14x 14x 14x 14x 14x 14x 14x 23x 23x 23x 16x 14x 14x 23x 23x 14x 8x 8x 8x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 16x 16x 16x 160x 160x 130x 160x 130x 160x 130x 130x 130x 130x 160x 48x 48x 82x 16x 16x 98x 98x 98x 16x 16x 16x 16x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 13x 13x 13x 13x 23x 23x 23x 23x 23x 23x 23x 23x 23x 3x 3x 3x 3x 3x 2x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 3x 1x 1x 1x 1x 23x 20x 20x 17x 17x 17x 20x 20x 23x 2x 2x 2x 20x 23x 23x 23x 23x 23x 23x 23x 23x 20x 20x 20x 20x 20x 23x 20x 20x 13x 13x 23x 23x 23x 23x 23x 5x 3x 5x 2x 2x 2x 2x 5x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 28x 14x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 28x 23x 23x 23x 23x 23x 23x 36x 23x 23x 23x 23x 23x 23x 14x 14x 14x 14x 13x 14x 14x 1x 1x 14x 14x 23x 23x 23x 23x 28x 14x 14x 5x 5x 5x 5x 14x 14x 14x 14x 23x 23x 23x 23x 23x 23x 23x 23x 28x 14x 14x 14x 14x 23x 23x 23x 23x 23x 23x 23x 23x 3x 2x 3x 1x 1x 23x 23x 23x 23x 12x 12x 12x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 1x 1x | <template>
<div class="min-h-screen bg-surface">
<!-- Deep-link match detail (from a push notification: ?matchId=). Overlays
everything; works for any match status. Shares ModalOverlay with the
tournament preview so both get the same close affordances, scroll lock
and dialog semantics (SB-896) -- this copy previously had none of
them, and a hardcoded bg-white that ignored dark mode. -->
<ModalOverlay
v-if="deepLinkMatchId"
label="Match details"
max-width="max-w-6xl"
close-label="Close match details"
@close="closeDeepLinkMatch"
>
<MatchDetailView :matchId="deepLinkMatchId" @back="closeDeepLinkMatch" />
</ModalOverlay>
<!-- PWA chrome: install prompt, offline indicator, update banner -->
<InstallBanner />
<NotificationSetupGuide />
<OfflineIndicator />
<UpdateAvailablePrompt />
<!-- Navigation -->
<AuthNav @show-login="showLoginModal = true" @logout="handleLogout" />
<!-- Login Modal -->
<div v-if="showLoginModal" class="modal-overlay" @click="closeModal">
<div class="modal-content" @click.stop>
<button @click="closeModal" class="modal-close">×</button>
<ResetPasswordForm
v-if="resetToken"
:token="resetToken"
@back-to-login="
() => {
resetToken = null;
showForgotPassword = false;
}
"
/>
<ForgotPasswordForm
v-else-if="showForgotPassword"
@back-to-login="showForgotPassword = false"
/>
<LoginForm
v-else
@login-success="handleLoginSuccess"
@show-forgot-password="showForgotPassword = true"
/>
</div>
</div>
<!-- Main Content -->
<div class="container mx-auto px-4 pt-2 pb-8">
<!-- Public privacy policy (SB-1310): /privacy renders for everyone,
signed in or not, without waiting on auth. -->
<PrivacyPolicy v-if="isPrivacyPage" />
<!-- Loading indicator -->
<div
v-if="authStore.state.loading && !isPrivacyPage"
class="loading-container"
>
<div class="loading-spinner"></div>
<p>Loading...</p>
</div>
<!-- Auth Error Display -->
<div v-if="authStore.state.error" class="error-banner">
<p>{{ authStore.state.error }}</p>
<button @click="authStore.clearError()" class="error-close">×</button>
</div>
<!-- Content based on auth status -->
<div v-if="!authStore.state.loading && !isPrivacyPage">
<!-- Unauthenticated view -->
<div v-if="!authStore.state.session" class="max-w-4xl mx-auto">
<!-- Hero (inside loading guard — renders exactly once) -->
<div
class="text-center mb-8 rounded-2xl py-14 px-6 text-white shadow-lg relative overflow-hidden"
style="
background-image: url('/hero-goal.png');
background-size: cover;
background-position: center;
"
>
<div class="absolute inset-0 bg-brand-700/55 rounded-2xl"></div>
<div class="relative z-10">
<h1 class="text-3xl sm:text-4xl font-bold mb-3 tracking-tight">
The table you've been missing.
</h1>
<p class="text-lg text-slate-300 max-w-xl mx-auto">
Community-built standings for the top youth soccer leagues in
the US. Invite-only.
</p>
<div class="mt-7 flex flex-col sm:flex-row gap-3 justify-center">
<button
@click="showInviteRequestModal = true"
class="bg-white text-brand-700 px-8 py-3 rounded-lg font-semibold hover:bg-slate-100 transition-colors text-base shadow-sm"
>
Request Invite
</button>
<button
@click="showLoginModal = true"
class="bg-white/10 text-white px-8 py-3 rounded-lg font-semibold hover:bg-white/20 transition-colors text-base border border-white/40"
>
Login
</button>
</div>
</div>
</div>
<!-- Product Preview -->
<LandingPreview />
</div>
<!-- Invite Request Modal -->
<div
v-if="showInviteRequestModal"
class="modal-overlay"
@click="showInviteRequestModal = false"
>
<div class="modal-content p-6" @click.stop>
<button @click="showInviteRequestModal = false" class="modal-close">
×
</button>
<h3 class="text-xl font-bold text-gray-800 mb-4">Request Invite</h3>
<p class="text-gray-600 mb-4">
Missing Table is currently invite-only. Please provide your
information and we'll reach out when spots are available.
</p>
<form @submit.prevent="submitInviteRequest" class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1"
>Email</label
>
<input
v-model="inviteRequest.email"
type="email"
required
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-brand-500"
placeholder="your@email.com"
/>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1"
>Name</label
>
<input
v-model="inviteRequest.name"
type="text"
required
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-brand-500"
placeholder="Your name"
/>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1"
>Team/Club (optional)</label
>
<input
v-model="inviteRequest.team"
type="text"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-brand-500"
placeholder="Your team or club name"
/>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1"
>Why do you want to join?</label
>
<textarea
v-model="inviteRequest.reason"
rows="3"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-brand-500"
placeholder="Tell us about your interest in Missing Table"
></textarea>
</div>
<label class="flex items-center gap-2 text-sm text-gray-700">
<input
v-model="inviteRequest.wants_ios_beta"
type="checkbox"
data-testid="invite-ios-beta"
class="h-4 w-4 rounded border-gray-300 text-brand-600 focus:ring-brand-500"
/>
Get the iPhone beta
</label>
<!-- Honeypot field - hidden from humans, bots will fill it -->
<div style="position: absolute; left: -9999px" aria-hidden="true">
<input
v-model="inviteRequest.website"
type="text"
name="website"
tabindex="-1"
autocomplete="off"
/>
</div>
<div class="flex gap-3">
<button
type="submit"
:disabled="inviteRequestSubmitting"
class="flex-1 bg-brand-600 text-white py-2 rounded-md font-semibold hover:bg-brand-700 transition-colors disabled:opacity-50"
>
{{
inviteRequestSubmitting ? 'Submitting...' : 'Submit Request'
}}
</button>
<button
type="button"
@click="showInviteRequestModal = false"
class="px-4 py-2 text-gray-600 hover:text-gray-800"
>
Cancel
</button>
</div>
</form>
<div
v-if="inviteRequestMessage"
:class="[
'mt-4 p-3 rounded-md text-sm',
inviteRequestSuccess
? 'bg-green-100 text-green-800'
: 'bg-red-100 text-red-800',
]"
>
{{ inviteRequestMessage }}
</div>
</div>
</div>
<!--
Tabs + Content card (authenticated users).
`overflow-clip`, not `overflow-hidden` (SB-1101). Both clip the tab
strip to the card's rounded corners, but `hidden` also makes this card
a scroll container, and `position: sticky` inside a scroll container
that never scrolls never moves. The day and league headers in the
matches list are sticky, so this has to be `clip`, which clips without
creating that container.
-->
<div
v-if="authStore.state.session"
class="bg-card rounded-xl shadow-sm ring-1 ring-line overflow-clip"
>
<nav
class="flex space-x-1 border-b border-line overflow-x-auto px-2"
aria-label="Tabs"
>
<button
v-for="tab in availableTabs"
:key="tab.id"
@click="
tab.id === 'live' ? handleLiveTabClick() : (currentTab = tab.id)
"
:class="[
currentTab === tab.id
? 'border-b-2 border-brand-500 text-brand-500 dark:border-brand-300 dark:text-brand-300'
: tab.isLive
? 'text-red-600 hover:text-red-700 live-tab-pulse border-b-2 border-transparent'
: 'text-fg-muted hover:text-fg border-b-2 border-transparent hover:border-line',
'px-4 py-3 font-medium text-sm whitespace-nowrap transition-colors',
]"
>
<span v-if="tab.isLive" class="live-dot"></span>
<!-- Before the label, not after: on a phone the tab strip
scrolls and Tournaments sits half off screen, which hid a
trailing dot (SB-1797). -->
<span
v-if="
tab.id === 'match-center' &&
currentTab !== 'match-center' &&
tournamentAnnouncements.hasUnseen.value
"
class="announcement-dot"
data-testid="tournaments-announcement-dot"
><span class="sr-only">New announcement</span></span
>
{{ tab.name }}
<span
v-if="tab.isBeta"
class="beta-badge"
data-testid="beta-badge"
aria-label="Beta feature"
>Beta</span
>
<span
v-if="
tab.id === 'admin' &&
authStore.isAdmin.value &&
adminAttention.total.value > 0
"
class="admin-attention-dot"
data-testid="admin-attention-dot"
:title="adminAttention.tooltip.value"
:aria-label="`Needs attention: ${adminAttention.tooltip.value}`"
></span>
</button>
</nav>
<!-- Standings -->
<div v-if="currentTab === 'table'" class="p-4">
<LeagueTable
:initial-age-group-id="tableFilters.ageGroupId"
:initial-league-id="tableFilters.leagueId"
:initial-division-id="tableFilters.divisionId"
:filter-key="tableFilters.key"
@navigate-to-team="handleNavigateToTeam"
/>
</div>
<!-- Matches -->
<div v-if="currentTab === 'scores'" class="p-4">
<MatchesView
:initial-age-group-id="matchesFilters.ageGroupId"
:initial-league-id="matchesFilters.leagueId"
:initial-division-id="matchesFilters.divisionId"
:initial-club-id="matchesFilters.clubId"
:initial-team-id="matchesFilters.teamId"
:initial-season-id="matchesFilters.seasonId"
:initial-match-type-id="matchesFilters.matchTypeId"
:filter-key="matchesFilters.key"
/>
</div>
<!-- Match Center -->
<div v-if="currentTab === 'match-center'" class="p-4">
<TournamentMatchCenter />
</div>
<!-- Ranking: cross-conference leaderboards (SB-1785) -->
<div v-if="currentTab === 'ranking'" class="p-4">
<RankingView @navigate-to-team="handleNavigateToTeam" />
</div>
<!-- QoP Rankings -->
<div v-if="currentTab === 'qop'" class="p-4">
<QoPStandings />
</div>
<!-- Add Match Form (auth required) -->
<div v-if="currentTab === 'add-match'" class="p-4">
<div v-if="!authStore.isAuthenticated" class="auth-required">
<p>You must be logged in to add matches.</p>
<button @click="showLoginModal = true" class="login-prompt-btn">
Login
</button>
</div>
<div v-else-if="!authStore.canManageTeam" class="permission-denied">
<p>You need team manager or admin permissions to add matches.</p>
</div>
<MatchForm v-else />
</div>
<!-- Profile (auth required) -->
<div v-if="currentTab === 'profile'" class="p-2 sm:p-4">
<ProfileRouter
@logout="handleLogout"
@switch-tab="handleSwitchTab"
/>
</div>
<!-- My Club (players only) -->
<div v-if="currentTab === 'my-club'" class="p-4">
<TeamRosterRouter />
</div>
<!-- MT AI chat (SB-1500): only listed when /api/ai/status is enabled -->
<div v-if="currentTab === 'chat'" class="p-4">
<AiChat />
</div>
<!-- Admin Panel (admin only) -->
<div v-if="currentTab === 'admin'" class="p-4">
<AdminPanel />
</div>
<!-- Live Match -->
<div v-if="currentTab === 'live'" class="live-tab-content">
<!-- Match Picker (if multiple live matches and none selected) -->
<div
v-if="liveMatches.length > 1 && !selectedLiveMatchId"
class="p-4"
>
<h2 class="text-xl font-bold mb-4">Live Matches</h2>
<div class="space-y-3">
<button
v-for="match in liveMatches"
:key="match.match_id"
@click="selectLiveMatch(match.match_id)"
class="w-full p-4 bg-gray-50 hover:bg-gray-100 rounded-lg text-left border border-gray-200"
>
<div class="flex justify-between items-center">
<div>
<span class="font-semibold">{{
match.home_team_name
}}</span>
<span class="text-gray-500 mx-2">vs</span>
<span class="font-semibold">{{
match.away_team_name
}}</span>
</div>
<div class="text-lg font-bold">
{{ match.home_score ?? 0 }} - {{ match.away_score ?? 0 }}
</div>
</div>
</button>
</div>
</div>
<!-- Live Match View -->
<LiveMatchView
v-else-if="selectedLiveMatchId"
:match-id="selectedLiveMatchId"
@back="handleLiveMatchBack"
/>
<!-- No live matches fallback -->
<div
v-else-if="liveMatches.length === 0"
class="p-8 text-center text-gray-500"
>
<p>No live matches at the moment.</p>
</div>
</div>
</div>
</div>
<!-- Version Footer -->
<VersionFooter @open-whats-new="showWhatsNew = true" />
</div>
<!-- What's New (changelog) overlay, launched from the footer version -->
<WhatsNewView v-if="showWhatsNew" @close="showWhatsNew = false" />
<ManagerRolesView
v-if="managerRoles.isOpen.value && authStore.state.session"
@close="managerRoles.close()"
/>
</div>
</template>
<script>
import { ref, computed, onMounted, onUnmounted, watch } from 'vue';
import { lazyView } from './utils/lazyView';
import { hasAnyRole, TEAM_PAGE_ROLES, liveMatchesQuery } from './utils/roles';
import { useAuthStore } from './stores/auth';
import { useAdminAttentionCounts } from './composables/useAdminAttentionCounts';
import { useTournamentAnnouncements } from './composables/useTournamentAnnouncements';
import { useManagerRolesPage } from './composables/useManagerRolesPage';
import { useBlockedUsers } from './composables/useBlockedUsers';
import { getApiBaseUrl } from './config/api';
import { errorMessage } from './utils/apiError';
import { parseTournamentPath } from './utils/tournamentRoute';
import { recordPageView, recordInviteRequest } from './faro';
// The tournaments path a signed-out visitor arrived on, kept across the
// Google sign-in round trip, which returns to /auth/callback (SB-1767).
const RETURN_PATH_KEY = 'mt_return_path';
const storeReturnPath = path => {
try {
window.sessionStorage.setItem(RETURN_PATH_KEY, path);
} catch {
// Storage blocked: sign-in still works, it just lands on the default tab.
}
};
const takeReturnPath = () => {
try {
const path = window.sessionStorage.getItem(RETURN_PATH_KEY);
window.sessionStorage.removeItem(RETURN_PATH_KEY);
// Only ever a tournaments path — never an arbitrary stored URL.
return parseTournamentPath(path) ? path : null;
} catch {
return null;
}
};
// Eagerly loaded: initial-paint view (LeagueTable is the default tab) and the
// always-mounted chrome (nav, footer, indicators, login screen). These belong
// in the initial bundle so first paint has no async waterfall.
import LeagueTable from './components/LeagueTable.vue';
import LandingPreview from './components/LandingPreview.vue';
import AuthNav from './components/AuthNav.vue';
import LoginForm from './components/LoginForm.vue';
import VersionFooter from './components/VersionFooter.vue';
import InstallBanner from './components/InstallBanner.vue';
import NotificationSetupGuide from './components/notifications/NotificationSetupGuide.vue';
import { useNotificationSetup } from './composables/useNotificationSetup';
import { isTouchDevice } from './utils/pwa';
import OfflineIndicator from './components/OfflineIndicator.vue';
import UpdateAvailablePrompt from './components/UpdateAvailablePrompt.vue';
// Lazily loaded (SB-122): every view that lives behind a tab `v-if` and isn't
// shown on first paint. Each becomes its own chunk, fetched only when its tab
// is opened — keeps the initial bundle (and TTI) small. TournamentMatchCenter
// pulls the heavy bracket components, so this is the biggest single win.
//
// lazyView (SB-439) rather than a bare defineAsyncComponent: on a failed chunk
// fetch — routine for tabs left open across a deploy — the bare version renders
// nothing at all, leaving a blank pane under a working nav.
const MatchForm = lazyView(
() => import('./components/MatchForm.vue'),
'MatchForm'
);
const MatchesView = lazyView(
() => import('./components/MatchesView.vue'),
'MatchesView'
);
const MatchDetailView = lazyView(
() => import('./components/MatchDetailView.vue'),
'MatchDetailView'
);
// Small and needed the moment any modal opens; not worth a lazy chunk.
import ModalOverlay from './components/ui/ModalOverlay.vue';
const ForgotPasswordForm = lazyView(
() => import('./components/ForgotPasswordForm.vue'),
'ForgotPasswordForm'
);
const ResetPasswordForm = lazyView(
() => import('./components/ResetPasswordForm.vue'),
'ResetPasswordForm'
);
const ProfileRouter = lazyView(
() => import('./components/ProfileRouter.vue'),
'ProfileRouter'
);
const TeamRosterRouter = lazyView(
() => import('./components/profiles/TeamRosterRouter.vue'),
'TeamRosterRouter'
);
const AdminPanel = lazyView(
() => import('./components/AdminPanel.vue'),
'AdminPanel'
);
const TournamentMatchCenter = lazyView(
() => import('./components/TournamentMatchCenter.vue'),
'TournamentMatchCenter'
);
const RankingView = lazyView(
() => import('./components/ranking/RankingView.vue'),
'RankingView'
);
const QoPStandings = lazyView(
() => import('./components/QoPStandings.vue'),
'QoPStandings'
);
const WhatsNewView = lazyView(
() => import('./components/WhatsNewView.vue'),
'WhatsNewView'
);
const ManagerRolesView = lazyView(
() => import('./components/ManagerRolesView.vue'),
'ManagerRolesView'
);
const PrivacyPolicy = lazyView(
() => import('./components/PrivacyPolicy.vue'),
'PrivacyPolicy'
);
const AiChat = lazyView(() => import('./components/ai/AiChat.vue'), 'AiChat');
const LiveMatchView = lazyView(
() => import('./components/live').then(m => m.LiveMatchView),
'LiveMatchView'
);
export default {
name: 'App',
components: {
MatchForm,
LeagueTable,
LandingPreview,
MatchesView,
MatchDetailView,
ModalOverlay,
AuthNav,
LoginForm,
ForgotPasswordForm,
ResetPasswordForm,
ProfileRouter,
TeamRosterRouter,
AdminPanel,
TournamentMatchCenter,
RankingView,
QoPStandings,
VersionFooter,
WhatsNewView,
ManagerRolesView,
LiveMatchView,
AiChat,
PrivacyPolicy,
InstallBanner,
NotificationSetupGuide,
OfflineIndicator,
UpdateAvailablePrompt,
},
setup() {
const authStore = useAuthStore();
const adminAttention = useAdminAttentionCounts();
const tournamentAnnouncements = useTournamentAnnouncements();
const blockedUsers = useBlockedUsers();
const notificationSetup = useNotificationSetup();
const currentTab = ref('table');
// /privacy is the one public page (SB-1310). Nothing on the web links to
// it (SB-1328); the iOS app and App Store listing open it directly, so
// reaching it is always a full page load.
const isPrivacyPage = /^\/privacy\/?$/.test(window.location.pathname);
// /chat opens the MT AI chat tab once the status check says it is on
// (SB-1500). There is no router; this is a one-shot deep link.
let openChatOnLoad = /^\/chat\/?$/.test(window.location.pathname);
// /tournaments and /tournaments/<id> open the Tournaments tab (SB-1767);
// TournamentMatchCenter reads the id. Signed out, the path only opens the
// login prompt — nothing about the tournament renders or is fetched — and
// is remembered so the Google sign-in round trip comes back to it.
let openTournamentsOnLoad =
parseTournamentPath(window.location.pathname) != null;
// MT AI chat (SB-1500): the tab is listed only when the backend says the
// feature is enabled for this deployment.
const aiChatEnabled = ref(false);
// Deep link from a push notification: ?matchId=<id> opens MatchDetailView
// as an overlay (SB-86). Works for any match status, incl. completed.
const deepLinkMatchId = ref(null);
const closeDeepLinkMatch = () => {
deepLinkMatchId.value = null;
};
// "What's New" changelog overlay, opened from the footer version.
const showWhatsNew = ref(false);
const managerRoles = useManagerRolesPage();
const tableFilters = ref({
ageGroupId: null,
leagueId: null,
divisionId: null,
key: 0, // Used to force re-render when filters change
});
const matchesFilters = ref({
ageGroupId: null,
leagueId: null,
divisionId: null,
clubId: null,
teamId: null,
seasonId: null,
matchTypeId: null,
key: 0, // Used to force re-render when filters change
});
const showLoginModal = ref(false);
const showForgotPassword = ref(false);
const resetToken = ref(null);
const showInviteRequestModal = ref(false);
const inviteRequest = ref({
email: '',
name: '',
team: '',
reason: '',
wants_ios_beta: false,
website: '', // Honeypot field - bots will fill this
});
const inviteRequestSubmitting = ref(false);
const inviteRequestMessage = ref('');
const inviteRequestSuccess = ref(false);
// Live match state
const liveMatches = ref([]);
const selectedLiveMatchId = ref(null);
let liveMatchPollInterval = null;
// Fetch live matches for the LIVE tab
const fetchLiveMatches = async () => {
if (!authStore.isAuthenticated.value) {
liveMatches.value = [];
return;
}
try {
const response = await authStore.apiRequest(
`${getApiBaseUrl()}/api/matches/live${liveMatchesQuery(authStore.userRole.value)}`
);
if (Array.isArray(response)) {
liveMatches.value = response;
}
} catch (error) {
console.error('Error fetching live matches:', error);
}
};
// Start/stop live match polling
const startLiveMatchPolling = () => {
if (liveMatchPollInterval) return;
fetchLiveMatches(); // Fetch immediately
liveMatchPollInterval = setInterval(fetchLiveMatches, 30000); // Poll every 30s
};
const stopLiveMatchPolling = () => {
if (liveMatchPollInterval) {
clearInterval(liveMatchPollInterval);
liveMatchPollInterval = null;
}
};
// Computed: has live matches
const hasLiveMatches = computed(() => liveMatches.value.length > 0);
// Define all possible tabs
const allTabs = [
{ id: 'table', name: 'Table', requiresAuth: true },
{ id: 'scores', name: 'Matches', requiresAuth: true },
{ id: 'match-center', name: 'Tournaments', requiresAuth: true },
{ id: 'ranking', name: 'Ranking', requiresAuth: true },
// Hidden pending a rethink (SB-1226). May return as an opt-in profile
// switch for users following U13/U15 MLS Next Homegrown teams.
{ id: 'qop', name: 'QoP', requiresAuth: true, hidden: true },
{
id: 'add-match',
name: 'Add Match',
requiresAuth: true,
requiresRole: ['admin', 'club_manager', 'team-manager'],
},
{
id: 'my-club',
name: 'My Club',
requiresAuth: true,
// Everyone with a stake in a squad, not just its players (SB-668).
// Shared with TeamRosterRouter so the tab and the page cannot disagree.
requiresRole: TEAM_PAGE_ROLES,
},
{
id: 'admin',
name: 'Admin',
requiresAuth: true,
requiresRole: ['admin', 'club_manager'],
},
{
id: 'chat',
name: 'Ask',
requiresAuth: true,
requiresAiChat: true,
isBeta: true,
},
{ id: 'profile', name: 'Profile', requiresAuth: true },
];
// Computed property for available tabs based on user's auth status and role
const availableTabs = computed(() => {
const userRole = authStore.userRole.value;
let tabs = allTabs
.filter(tab => {
if (tab.hidden) return false;
if (tab.requiresAiChat && !aiChatEnabled.value) return false;
// Always show public tabs
if (!tab.requiresAuth) return true;
// Don't show auth-required tabs if user is not authenticated
if (!authStore.isAuthenticated.value) return false;
// Check role requirements. Roles are stored in both spellings —
// user_profiles permits club-fan and club_fan, team-manager and
// team_manager, and so on — so an exact match silently excludes real
// users depending on which invite created them (SB-668).
if (tab.requiresRole) {
return hasAnyRole(tab.requiresRole, userRole);
}
return true;
})
.map(tab => {
// Rename "Admin" tab to "Manage Club" for club managers
if (tab.id === 'admin' && userRole === 'club_manager') {
return { ...tab, name: 'Manage Club' };
}
return tab;
});
// Add LIVE tab at the beginning if there are live matches
if (hasLiveMatches.value && authStore.isAuthenticated.value) {
tabs = [{ id: 'live', name: 'LIVE', isLive: true }, ...tabs];
}
return tabs;
});
const closeModal = () => {
showLoginModal.value = false;
showForgotPassword.value = false;
resetToken.value = null;
};
const handleLoginSuccess = () => {
showLoginModal.value = false;
// Optionally redirect to profile or keep current tab
};
const handleLogout = () => {
// Reset to public tab if current tab requires auth
const currentTabData = allTabs.find(t => t.id === currentTab.value);
if (currentTabData && currentTabData.requiresAuth) {
currentTab.value = 'table';
}
};
const handleSwitchTab = (tabId, filters = null) => {
// Switch to the requested tab
currentTab.value = tabId;
// If filters provided and switching to table, apply them
if (tabId === 'table' && filters) {
tableFilters.value = {
ageGroupId: filters.ageGroupId || null,
leagueId: filters.leagueId || null,
divisionId: filters.divisionId || null,
key: tableFilters.value.key + 1, // Force re-render
};
}
// If filters provided and switching to scores/matches, apply them
if (tabId === 'scores' && filters) {
matchesFilters.value = {
ageGroupId: filters.ageGroupId || null,
leagueId: filters.leagueId || null,
divisionId: filters.divisionId || null,
teamId: filters.teamId || null,
seasonId: filters.seasonId || null,
matchTypeId: filters.matchTypeId || null,
key: matchesFilters.value.key + 1, // Force re-render
};
}
};
const handleNavigateToTeam = filters => {
currentTab.value = 'scores';
matchesFilters.value = {
ageGroupId: filters.ageGroupId || null,
leagueId: filters.leagueId || null,
divisionId: filters.divisionId || null,
clubId: filters.clubId || null,
teamId: filters.teamId || null,
seasonId: filters.seasonId || null,
// Every competition, not just League (SB-849). Navigating to a team
// should show that team's schedule; pinning League here hid their
// Flex fixtures behind a filter they had not chosen.
matchTypeId: null,
key: matchesFilters.value.key + 1,
};
};
const submitInviteRequest = async () => {
inviteRequestSubmitting.value = true;
inviteRequestMessage.value = '';
try {
const response = await fetch(`${getApiBaseUrl()}/api/invite-requests`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(inviteRequest.value),
});
const data = await response.json();
if (response.ok && data.success) {
inviteRequestSuccess.value = true;
inviteRequestMessage.value = data.message;
recordInviteRequest(true);
// Reset form
inviteRequest.value = {
email: '',
name: '',
team: '',
reason: '',
wants_ios_beta: false,
website: '',
};
} else {
inviteRequestSuccess.value = false;
inviteRequestMessage.value = errorMessage(
data,
'Failed to submit request. Please try again.'
);
recordInviteRequest(false);
}
} catch (error) {
inviteRequestSuccess.value = false;
inviteRequestMessage.value =
'Failed to submit request. Please try again.';
recordInviteRequest(false);
} finally {
inviteRequestSubmitting.value = false;
}
};
// Watch for tab changes and record page views
watch(currentTab, newTab => {
recordPageView(newTab, {
authenticated: authStore.isAuthenticated.value ? 'true' : 'false',
user_role: authStore.userRole.value || 'anonymous',
});
});
// Initialize auth on app start
onMounted(async () => {
// For testing - uncomment the next line to force logout on each page load
// authStore.forceLogout()
// Check for OAuth callback (tokens in URL hash from Supabase redirect)
const hashParams = new URLSearchParams(window.location.hash.substring(1));
const accessToken = hashParams.get('access_token');
if (accessToken) {
// This is an OAuth callback - handle it
console.log('OAuth callback detected, processing...');
const result = await authStore.handleOAuthCallback();
const returnPath = takeReturnPath();
if (result.success) {
if (returnPath) {
// Signed in from a tournament link: back to that tournament.
window.history.replaceState(null, '', returnPath);
openTournamentsOnLoad = false;
currentTab.value = 'match-center';
} else {
// Redirect to home page and clear the OAuth tokens from URL
window.history.replaceState(null, '', '/');
currentTab.value = 'profile'; // Show profile tab after login
}
console.log('OAuth login successful');
} else {
console.error('OAuth callback failed:', result.error);
// Redirect to home even on failure to clear the callback URL
window.history.replaceState(null, '', '/');
}
} else {
// Normal initialization
await authStore.initialize();
// A return path is only for the sign-in that set it.
takeReturnPath();
}
// A tournament link, signed out: the login prompt and nothing else.
// The tab opens once someone signs in (the auth watcher below).
if (openTournamentsOnLoad && !authStore.isAuthenticated.value) {
storeReturnPath(window.location.pathname);
showLoginModal.value = true;
}
// Record initial page view after auth initialization
recordPageView(isPrivacyPage ? 'privacy' : currentTab.value, {
authenticated: authStore.isAuthenticated.value ? 'true' : 'false',
user_role: authStore.userRole.value || 'anonymous',
});
// Check for invite code in URL - automatically open login modal for signup
const urlParams = new URLSearchParams(window.location.search);
const inviteCode = urlParams.get('code');
if (inviteCode && !authStore.isAuthenticated.value) {
showLoginModal.value = true;
}
// Check for password reset token in URL
const resetTokenParam = urlParams.get('reset_token');
if (resetTokenParam) {
resetToken.value = resetTokenParam;
showLoginModal.value = true;
// Clean token from URL without triggering a reload
const cleanUrl =
window.location.pathname +
(urlParams.get('code') ? `?code=${urlParams.get('code')}` : '');
window.history.replaceState({}, '', cleanUrl);
}
// Deep link from a push notification: ?matchId=<id> → open the match.
const matchIdParam = urlParams.get('matchId');
if (matchIdParam && /^\d+$/.test(matchIdParam)) {
deepLinkMatchId.value = Number(matchIdParam);
// Strip matchId from the URL so a refresh/share doesn't re-trigger,
// preserving any invite code (mirrors the reset_token cleanup above).
const code = urlParams.get('code');
const cleanUrl =
window.location.pathname + (code ? `?code=${code}` : '');
window.history.replaceState({}, '', cleanUrl);
}
// Start live match polling if authenticated
if (authStore.isAuthenticated.value) {
startLiveMatchPolling();
}
});
// Watch for auth changes to start/stop live match polling
watch(
() => authStore.isAuthenticated.value,
isAuth => {
if (isAuth) {
startLiveMatchPolling();
} else {
stopLiveMatchPolling();
liveMatches.value = [];
selectedLiveMatchId.value = null;
}
}
);
// First authenticated visit on a phone: offer the notification setup
// guide once. On iPhone the install step is a hard prerequisite for push
// and there is no way for the user to discover that on their own — Apple
// exposes no install API, so nothing can prompt them but us (SB-810).
//
// Gated on shouldPromptUnprompted, which needs the follows list loaded
// before it can tell "brand new" from "already set up", and which respects
// a previous "not now" for 30 days.
watch(
() => authStore.isAuthenticated.value,
async isAuth => {
if (!isAuth) return;
if (!isTouchDevice()) return;
await notificationSetup.ensureFollowsLoaded();
if (notificationSetup.shouldPromptUnprompted.value) {
notificationSetup.open('first-login');
}
},
{ immediate: true }
);
// Start/stop admin attention-counts polling tied to admin status.
// When a user logs in as admin (or already-admin auth resolves on app
// boot), kick off the 60s poll; when they log out or lose admin
// role, stop. Composable handles the auth check + best-effort errors.
watch(
() => authStore.isAdmin.value,
isAdmin => {
if (isAdmin) {
adminAttention.startPolling();
} else {
adminAttention.stopPolling();
}
},
{ immediate: true }
);
// Tournaments tab "new announcement" dot (SB-1797). The tabs exist only
// when signed in, so the list is fetched then — once per app load.
// Opening the tab marks every current announcement seen, including when
// the list arrives after the tab is already open (a /tournaments link).
watch(
() => authStore.isAuthenticated.value,
isAuth => {
if (isAuth) tournamentAnnouncements.load();
},
{ immediate: true }
);
watch(
[currentTab, tournamentAnnouncements.hasUnseen],
([tab, unseen]) => {
if (tab === 'match-center' && unseen) {
tournamentAnnouncements.markSeen();
}
},
{ immediate: true }
);
// MT AI chat (SB-1500): ask whether it is on whenever someone signs in.
// Any failure leaves it off — the tab is an extra, never a blocker.
const loadAiChatStatus = async () => {
try {
const status = await authStore.apiRequest(
`${getApiBaseUrl()}/api/ai/status`
);
aiChatEnabled.value =
status?.enabled === true && status?.web_chat === true;
} catch {
aiChatEnabled.value = false;
}
if (openChatOnLoad && aiChatEnabled.value) currentTab.value = 'chat';
openChatOnLoad = false;
};
watch(
() => authStore.isAuthenticated.value,
isAuth => {
if (isAuth) {
loadAiChatStatus();
if (openTournamentsOnLoad) {
openTournamentsOnLoad = false;
currentTab.value = 'match-center';
takeReturnPath();
}
} else {
aiChatEnabled.value = false;
if (currentTab.value === 'chat') currentTab.value = 'table';
}
},
{ immediate: true }
);
// Live chat blocks (SB-1324): load them for whoever signs in, drop them on
// sign-out, so realtime chat from a blocked user is hidden from the start.
watch(
() => authStore.state.user?.id,
userId => {
if (userId) {
blockedUsers.load();
} else {
blockedUsers.clear();
}
},
{ immediate: true }
);
// Back / forward (SB-1767). This only switches tabs: a tournaments path
// opens the Tournaments tab, any other path leaves it. Index vs detail is
// TournamentMatchCenter's own popstate handler, so the two never fight.
// Signed out, nothing opens — the tab content is behind the session.
const handlePopState = () => {
if (parseTournamentPath(window.location.pathname)) {
if (authStore.isAuthenticated.value) currentTab.value = 'match-center';
} else if (currentTab.value === 'match-center') {
currentTab.value = 'table';
}
};
onMounted(() => window.addEventListener('popstate', handlePopState));
// Cleanup on unmount
onUnmounted(() => {
stopLiveMatchPolling();
adminAttention.stopPolling();
window.removeEventListener('popstate', handlePopState);
});
// Handle clicking on LIVE tab
const handleLiveTabClick = () => {
if (liveMatches.value.length === 1) {
// Single live match - go directly to it
selectedLiveMatchId.value = liveMatches.value[0].match_id;
} else if (liveMatches.value.length > 1) {
// Multiple live matches - show picker (just switch tab, picker shown in template)
selectedLiveMatchId.value = null;
}
currentTab.value = 'live';
};
// Handle selecting a live match from picker
const selectLiveMatch = matchId => {
selectedLiveMatchId.value = matchId;
};
// Handle going back from live match view
const handleLiveMatchBack = () => {
if (liveMatches.value.length > 1) {
// Go back to match picker
selectedLiveMatchId.value = null;
} else {
// Go back to previous tab
currentTab.value = 'scores';
}
};
return {
authStore,
adminAttention,
tournamentAnnouncements,
currentTab,
isPrivacyPage,
deepLinkMatchId,
closeDeepLinkMatch,
showWhatsNew,
managerRoles,
tableFilters,
matchesFilters,
availableTabs,
showLoginModal,
showForgotPassword,
resetToken,
showInviteRequestModal,
inviteRequest,
inviteRequestSubmitting,
inviteRequestMessage,
inviteRequestSuccess,
closeModal,
handleLoginSuccess,
handleLogout,
handleSwitchTab,
handleNavigateToTeam,
submitInviteRequest,
// Live match
liveMatches,
selectedLiveMatchId,
hasLiveMatches,
handleLiveTabClick,
selectLiveMatch,
handleLiveMatchBack,
};
},
};
</script>
<style>
/* Modal styles */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal-content {
position: relative;
background: rgb(var(--color-card));
border-radius: 12px;
max-width: 460px;
width: 90%;
max-height: 90vh;
overflow-y: auto;
overflow-x: hidden;
}
.modal-close {
position: absolute;
top: 10px;
right: 15px;
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: rgb(var(--color-fg-muted));
z-index: 1001;
}
.modal-close:hover {
color: rgb(var(--color-fg));
}
/* Loading styles */
.loading-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 3rem;
}
.loading-spinner {
width: 40px;
height: 40px;
border: 4px solid #e2e8f0;
border-top: 4px solid #2563eb;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 1rem;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* Error banner */
.error-banner {
background-color: #f8d7da;
color: #721c24;
padding: 1rem;
border-radius: 4px;
margin-bottom: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.error-close {
background: none;
border: none;
font-size: 18px;
cursor: pointer;
color: #721c24;
}
/* Auth prompts */
.auth-required,
.permission-denied {
text-align: center;
padding: 3rem;
color: #666;
}
.login-prompt-btn {
background-color: #2563eb;
color: white;
padding: 0.75rem 1.5rem;
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
margin-top: 1rem;
}
.login-prompt-btn:hover {
background-color: #1d4ed8;
}
/* Live Tab Styles */
.live-tab-pulse {
animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
0%,
100% {
background-color: #fee2e2;
}
50% {
background-color: #fecaca;
}
}
.live-dot {
display: inline-block;
width: 8px;
height: 8px;
background-color: #dc2626;
border-radius: 50%;
margin-right: 6px;
animation: liveDotPulse 1s ease-in-out infinite;
}
@keyframes liveDotPulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
/* Tournaments tab: an announcement not yet seen (SB-1797). Accent, not red —
news, not a problem. */
.announcement-dot {
display: inline-block;
width: 8px;
height: 8px;
margin-right: 6px;
vertical-align: 1px;
background-color: #f59e0b; /* accent-400 */
border-radius: 50%;
box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22);
}
.admin-attention-dot {
display: inline-block;
width: 8px;
height: 8px;
margin-left: 6px;
vertical-align: 1px;
background-color: #dc2626;
border-radius: 50%;
box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
cursor: help;
}
.beta-badge {
display: inline-block;
margin-left: 6px;
padding: 1px 6px;
font-size: 0.625rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.04em;
color: #92400e;
background-color: #fef3c7;
border: 1px solid #fcd34d;
border-radius: 9999px;
vertical-align: middle;
}
.live-tab-content {
min-height: 400px;
}
</style>
|