@burdenoff/microfe-atheletebridge 2026.705.2 → 2026.706.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atheletebridge/AthleteBridgeRoot.js +55 -39
- package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.js +18 -6
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/components/Crest.js +70 -0
- package/dist/atheletebridge/components/Crest.js.map +1 -0
- package/dist/atheletebridge/components/FixtureCard.js +8 -72
- package/dist/atheletebridge/components/FixtureCard.js.map +1 -1
- package/dist/atheletebridge/components/MatchupRow.js +74 -0
- package/dist/atheletebridge/components/MatchupRow.js.map +1 -0
- package/dist/atheletebridge/components/MetricsCard.js +61 -21
- package/dist/atheletebridge/components/MetricsCard.js.map +1 -1
- package/dist/atheletebridge/components/ProgramCard.js +75 -43
- package/dist/atheletebridge/components/ProgramCard.js.map +1 -1
- package/dist/atheletebridge/components/Scoreboard.js +163 -0
- package/dist/atheletebridge/components/Scoreboard.js.map +1 -0
- package/dist/atheletebridge/components/SessionCard.js +64 -41
- package/dist/atheletebridge/components/SessionCard.js.map +1 -1
- package/dist/atheletebridge/components/SessionStatusTimeline.js +80 -0
- package/dist/atheletebridge/components/SessionStatusTimeline.js.map +1 -0
- package/dist/atheletebridge/components/StatusBadge.js +5 -5
- package/dist/atheletebridge/components/StatusBadge.js.map +1 -1
- package/dist/atheletebridge/components/TeamCard.js +65 -35
- package/dist/atheletebridge/components/TeamCard.js.map +1 -1
- package/dist/atheletebridge/components/UserAvatar.js +33 -0
- package/dist/atheletebridge/components/UserAvatar.js.map +1 -0
- package/dist/atheletebridge/components/domain.js +5 -2
- package/dist/atheletebridge/components/domain.js.map +1 -1
- package/dist/atheletebridge/components/viz/AvatarStack.js +2 -0
- package/dist/atheletebridge/components/viz/BarChart.js +83 -0
- package/dist/atheletebridge/components/viz/BarChart.js.map +1 -0
- package/dist/atheletebridge/components/viz/DonutChart.js +109 -0
- package/dist/atheletebridge/components/viz/DonutChart.js.map +1 -0
- package/dist/atheletebridge/components/viz/LineChart.js +123 -0
- package/dist/atheletebridge/components/viz/LineChart.js.map +1 -0
- package/dist/atheletebridge/components/viz/ProgressRing.js +6 -0
- package/dist/atheletebridge/components/viz/ProgressRing.js.map +1 -0
- package/dist/atheletebridge/components/viz/RatingStars.js +92 -0
- package/dist/atheletebridge/components/viz/RatingStars.js.map +1 -0
- package/dist/atheletebridge/components/viz/Sparkline.js +74 -0
- package/dist/atheletebridge/components/viz/Sparkline.js.map +1 -0
- package/dist/atheletebridge/components/viz/StatCard.js +60 -0
- package/dist/atheletebridge/components/viz/StatCard.js.map +1 -0
- package/dist/atheletebridge/components/viz/StepProgress.js +3 -0
- package/dist/atheletebridge/components/viz/Timeline.js +66 -0
- package/dist/atheletebridge/components/viz/Timeline.js.map +1 -0
- package/dist/atheletebridge/components/viz/index.js +13 -0
- package/dist/atheletebridge/components/viz/lib/Avatar.js +1 -0
- package/dist/atheletebridge/components/viz/lib/CartesianFrame.js +119 -0
- package/dist/atheletebridge/components/viz/lib/CartesianFrame.js.map +1 -0
- package/dist/atheletebridge/components/viz/lib/ResponsiveSvg.js +35 -0
- package/dist/atheletebridge/components/viz/lib/ResponsiveSvg.js.map +1 -0
- package/dist/atheletebridge/components/viz/lib/format.js +17 -0
- package/dist/atheletebridge/components/viz/lib/format.js.map +1 -0
- package/dist/atheletebridge/components/viz/lib/geometry.js +61 -0
- package/dist/atheletebridge/components/viz/lib/geometry.js.map +1 -0
- package/dist/atheletebridge/components/viz/lib/hooks.js +39 -0
- package/dist/atheletebridge/components/viz/lib/hooks.js.map +1 -0
- package/dist/atheletebridge/components/viz/lib/palette.js +27 -0
- package/dist/atheletebridge/components/viz/lib/palette.js.map +1 -0
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +369 -163
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
- package/dist/atheletebridge/pages/DashboardPage.js +182 -117
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/StandingsPage.js +119 -95
- package/dist/atheletebridge/pages/StandingsPage.js.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js +372 -0
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -0
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +511 -0
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -0
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +120 -131
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.js +264 -176
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js +84 -47
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js.map +1 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.js +432 -281
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +187 -123
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js +56 -39
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +267 -139
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js +253 -162
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js +38 -36
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +437 -189
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.js +368 -177
- package/dist/atheletebridge/pages/teams/TeamFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.js +3 -0
- package/dist/atheletebridge/pages/teams/TeamsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js +298 -0
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js.map +1 -0
- package/dist/atheletebridge/utils/identity.js +31 -0
- package/dist/atheletebridge/utils/identity.js.map +1 -0
- package/dist/atheletebridge/utils/timeAgo.js +20 -0
- package/dist/atheletebridge/utils/timeAgo.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useAthleteBridge as e } from "../context/AthleteBridgeContext.js";
|
|
2
2
|
import "../context/index.js";
|
|
3
|
-
import { useCallback as t } from "react";
|
|
4
|
-
import { useMutation as
|
|
5
|
-
import { clearGraphqlFetchResponseCache as
|
|
3
|
+
import { useCallback as t, useMemo as n } from "react";
|
|
4
|
+
import { useMutation as r, useQuery as i, useQueryClient as a } from "@tanstack/react-query";
|
|
5
|
+
import { clearGraphqlFetchResponseCache as o, graphqlFetch as s } from "@burdenoff/fe-libs/shared/graphql";
|
|
6
6
|
//#region src/atheletebridge/hooks/useAthleteBridgeApi.ts
|
|
7
|
-
var
|
|
8
|
-
let r = await
|
|
7
|
+
var c = async (e, t, n) => {
|
|
8
|
+
let r = await s({
|
|
9
9
|
gateway: "workspace",
|
|
10
10
|
baseUrl: n,
|
|
11
11
|
query: e,
|
|
@@ -14,9 +14,9 @@ var s = async (e, t, n) => {
|
|
|
14
14
|
});
|
|
15
15
|
if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
|
|
16
16
|
if (!r.data) throw Error("GraphQL response did not include data");
|
|
17
|
-
return e.trimStart().startsWith("mutation") &&
|
|
18
|
-
},
|
|
19
|
-
let n = await
|
|
17
|
+
return e.trimStart().startsWith("mutation") && o(), r.data;
|
|
18
|
+
}, l = async (e, t) => {
|
|
19
|
+
let n = await s({
|
|
20
20
|
gateway: "global",
|
|
21
21
|
query: e,
|
|
22
22
|
variables: t,
|
|
@@ -25,17 +25,17 @@ var s = async (e, t, n) => {
|
|
|
25
25
|
if (n.errors?.length) throw Error(n.errors[0]?.message ?? "GraphQL request failed");
|
|
26
26
|
if (!n.data) throw Error("GraphQL response did not include data");
|
|
27
27
|
return n.data;
|
|
28
|
-
},
|
|
28
|
+
}, u = "\n id workspaceId name sport status description ageGroup season homeVenue\n headCoachId tags createdAt updatedAt\n", d = "\n id workspaceId teamId userId displayName role status position jerseyNumber\n height weight dominantSide notes joinedAt createdAt updatedAt\n", f = "\n id workspaceId type status competition round venue homeTeamId awayTeamId\n homeScore awayScore scheduledAt kickoffAt notes createdAt updatedAt\n homeTeam { id name sport }\n awayTeam { id name sport }\n", p = "\n id workspaceId competition teamId played won drawn lost goalsFor goalsAgainst\n points rank createdAt updatedAt\n team { id name sport }\n", m = "\n id workspaceId programId name description weekNumber orderIndex sets reps\n durationSec restSec createdAt updatedAt\n video { id }\n", h = "\n id workspaceId coachId name sport level status summary weeks isTemplate tags\n createdAt updatedAt\n", g = "\n id workspaceId coachId athleteId programId title type status location\n meetingUrl scheduledAt durationMin completedAt feedback rating\n createdAt updatedAt\n", _ = "\n id workspaceId athleteId programId title status performedAt durationMin rpe\n totalLoad metrics notes createdAt updatedAt\n", v = "\n id workspaceId athleteId type label value unit source recordedAt\n createdAt updatedAt\n", y = (t = {}) => {
|
|
29
29
|
let { apiGatewayUrl: n } = e();
|
|
30
|
-
return
|
|
30
|
+
return i({
|
|
31
31
|
queryKey: [
|
|
32
32
|
"atheletebridge",
|
|
33
33
|
"teams",
|
|
34
34
|
t
|
|
35
35
|
],
|
|
36
|
-
queryFn: async () => (await
|
|
36
|
+
queryFn: async () => (await c(`query AthListTeams($sport: AthSport, $status: AthTeamStatus, $pagination: PaginationInput) {
|
|
37
37
|
athListTeams(sport: $sport, status: $status, pagination: $pagination) {
|
|
38
|
-
items { ${
|
|
38
|
+
items { ${u} members { id } }
|
|
39
39
|
pageInfo { cursor hasMore }
|
|
40
40
|
}
|
|
41
41
|
}`, {
|
|
@@ -44,59 +44,59 @@ var s = async (e, t, n) => {
|
|
|
44
44
|
pagination: t.pagination
|
|
45
45
|
}, n)).athListTeams
|
|
46
46
|
});
|
|
47
|
-
},
|
|
47
|
+
}, b = (t) => {
|
|
48
48
|
let { apiGatewayUrl: n } = e();
|
|
49
|
-
return
|
|
49
|
+
return i({
|
|
50
50
|
queryKey: [
|
|
51
51
|
"atheletebridge",
|
|
52
52
|
"team",
|
|
53
53
|
t
|
|
54
54
|
],
|
|
55
|
-
queryFn: async () => (await
|
|
55
|
+
queryFn: async () => (await c(`query AthTeam($id: ID!) {
|
|
56
56
|
athTeam(id: $id) {
|
|
57
|
-
${
|
|
58
|
-
members { ${
|
|
59
|
-
fixtures { ${
|
|
57
|
+
${u}
|
|
58
|
+
members { ${d} }
|
|
59
|
+
fixtures { ${f} }
|
|
60
60
|
}
|
|
61
61
|
}`, { id: t }, n)).athTeam,
|
|
62
62
|
enabled: !!t
|
|
63
63
|
});
|
|
64
|
-
},
|
|
65
|
-
let { apiGatewayUrl:
|
|
66
|
-
return
|
|
64
|
+
}, x = (t, n) => {
|
|
65
|
+
let { apiGatewayUrl: r } = e();
|
|
66
|
+
return i({
|
|
67
67
|
queryKey: [
|
|
68
68
|
"atheletebridge",
|
|
69
69
|
"members",
|
|
70
70
|
t,
|
|
71
71
|
n
|
|
72
72
|
],
|
|
73
|
-
queryFn: async () => (await
|
|
74
|
-
athListMembers(teamId: $teamId, status: $status) { ${
|
|
73
|
+
queryFn: async () => (await c(`query AthListMembers($teamId: ID!, $status: AthMemberStatus) {
|
|
74
|
+
athListMembers(teamId: $teamId, status: $status) { ${d} }
|
|
75
75
|
}`, {
|
|
76
76
|
teamId: t,
|
|
77
77
|
status: n
|
|
78
|
-
},
|
|
78
|
+
}, r)).athListMembers,
|
|
79
79
|
enabled: !!t
|
|
80
80
|
});
|
|
81
|
-
},
|
|
82
|
-
let t =
|
|
83
|
-
return
|
|
84
|
-
mutationFn: async (e) => (await
|
|
85
|
-
athCreateTeam(input: $input) { ${
|
|
86
|
-
}`, { input: e },
|
|
81
|
+
}, S = () => {
|
|
82
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
83
|
+
return r({
|
|
84
|
+
mutationFn: async (e) => (await c(`mutation AthCreateTeam($input: AthCreateTeamInput!) {
|
|
85
|
+
athCreateTeam(input: $input) { ${u} }
|
|
86
|
+
}`, { input: e }, n)).athCreateTeam,
|
|
87
87
|
onSuccess: () => {
|
|
88
88
|
t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
},
|
|
92
|
-
let t =
|
|
93
|
-
return
|
|
94
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
95
|
-
athUpdateTeam(id: $id, input: $input) { ${
|
|
91
|
+
}, C = () => {
|
|
92
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
93
|
+
return r({
|
|
94
|
+
mutationFn: async ({ id: e, input: t }) => (await c(`mutation AthUpdateTeam($id: ID!, $input: AthUpdateTeamInput!) {
|
|
95
|
+
athUpdateTeam(id: $id, input: $input) { ${u} }
|
|
96
96
|
}`, {
|
|
97
97
|
id: e,
|
|
98
98
|
input: t
|
|
99
|
-
},
|
|
99
|
+
}, n)).athUpdateTeam,
|
|
100
100
|
onSuccess: (e) => {
|
|
101
101
|
t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] }), t.invalidateQueries({ queryKey: [
|
|
102
102
|
"atheletebridge",
|
|
@@ -105,20 +105,20 @@ var s = async (e, t, n) => {
|
|
|
105
105
|
] });
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
|
-
},
|
|
109
|
-
let t =
|
|
110
|
-
return
|
|
111
|
-
mutationFn: async (e) => (await
|
|
108
|
+
}, w = () => {
|
|
109
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
110
|
+
return r({
|
|
111
|
+
mutationFn: async (e) => (await c("mutation AthArchiveTeam($id: ID!) { athArchiveTeam(id: $id) }", { id: e }, n)).athArchiveTeam,
|
|
112
112
|
onSuccess: () => {
|
|
113
113
|
t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
|
-
},
|
|
117
|
-
let t =
|
|
118
|
-
return
|
|
119
|
-
mutationFn: async (e) => (await
|
|
120
|
-
athAddMember(input: $input) { ${
|
|
121
|
-
}`, { input: e },
|
|
116
|
+
}, T = () => {
|
|
117
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
118
|
+
return r({
|
|
119
|
+
mutationFn: async (e) => (await c(`mutation AthAddMember($input: AthAddMemberInput!) {
|
|
120
|
+
athAddMember(input: $input) { ${d} }
|
|
121
|
+
}`, { input: e }, n)).athAddMember,
|
|
122
122
|
onSuccess: (e) => {
|
|
123
123
|
t.invalidateQueries({ queryKey: [
|
|
124
124
|
"atheletebridge",
|
|
@@ -131,33 +131,33 @@ var s = async (e, t, n) => {
|
|
|
131
131
|
] });
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
|
-
},
|
|
135
|
-
let
|
|
136
|
-
return
|
|
137
|
-
mutationFn: async (e) => (await
|
|
134
|
+
}, E = (t) => {
|
|
135
|
+
let n = a(), { apiGatewayUrl: i } = e();
|
|
136
|
+
return r({
|
|
137
|
+
mutationFn: async (e) => (await c("mutation AthRemoveMember($id: ID!) { athRemoveMember(id: $id) }", { id: e }, i)).athRemoveMember,
|
|
138
138
|
onSuccess: () => {
|
|
139
|
-
|
|
139
|
+
n.invalidateQueries({ queryKey: [
|
|
140
140
|
"atheletebridge",
|
|
141
141
|
"members",
|
|
142
142
|
t
|
|
143
|
-
] }),
|
|
143
|
+
] }), n.invalidateQueries({ queryKey: [
|
|
144
144
|
"atheletebridge",
|
|
145
145
|
"team",
|
|
146
146
|
t
|
|
147
147
|
] });
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
|
-
},
|
|
150
|
+
}, D = (t = {}) => {
|
|
151
151
|
let { apiGatewayUrl: n } = e();
|
|
152
|
-
return
|
|
152
|
+
return i({
|
|
153
153
|
queryKey: [
|
|
154
154
|
"atheletebridge",
|
|
155
155
|
"fixtures",
|
|
156
156
|
t
|
|
157
157
|
],
|
|
158
|
-
queryFn: async () => (await
|
|
158
|
+
queryFn: async () => (await c(`query AthListFixtures($status: AthFixtureStatus, $teamId: ID, $pagination: PaginationInput) {
|
|
159
159
|
athListFixtures(status: $status, teamId: $teamId, pagination: $pagination) {
|
|
160
|
-
items { ${
|
|
160
|
+
items { ${f} }
|
|
161
161
|
pageInfo { cursor hasMore }
|
|
162
162
|
}
|
|
163
163
|
}`, {
|
|
@@ -166,51 +166,51 @@ var s = async (e, t, n) => {
|
|
|
166
166
|
pagination: t.pagination
|
|
167
167
|
}, n)).athListFixtures
|
|
168
168
|
});
|
|
169
|
-
},
|
|
169
|
+
}, O = (t) => {
|
|
170
170
|
let { apiGatewayUrl: n } = e();
|
|
171
|
-
return
|
|
171
|
+
return i({
|
|
172
172
|
queryKey: [
|
|
173
173
|
"atheletebridge",
|
|
174
174
|
"fixture",
|
|
175
175
|
t
|
|
176
176
|
],
|
|
177
|
-
queryFn: async () => (await
|
|
178
|
-
athFixture(id: $id) { ${
|
|
177
|
+
queryFn: async () => (await c(`query AthFixture($id: ID!) {
|
|
178
|
+
athFixture(id: $id) { ${f} }
|
|
179
179
|
}`, { id: t }, n)).athFixture,
|
|
180
180
|
enabled: !!t
|
|
181
181
|
});
|
|
182
|
-
},
|
|
182
|
+
}, k = (t) => {
|
|
183
183
|
let { apiGatewayUrl: n } = e();
|
|
184
|
-
return
|
|
184
|
+
return i({
|
|
185
185
|
queryKey: [
|
|
186
186
|
"atheletebridge",
|
|
187
187
|
"standings",
|
|
188
188
|
t
|
|
189
189
|
],
|
|
190
|
-
queryFn: async () => (await
|
|
191
|
-
athStandings(competition: $competition) { ${
|
|
190
|
+
queryFn: async () => (await c(`query AthStandings($competition: String!) {
|
|
191
|
+
athStandings(competition: $competition) { ${p} }
|
|
192
192
|
}`, { competition: t }, n)).athStandings,
|
|
193
193
|
enabled: !!t
|
|
194
194
|
});
|
|
195
|
-
},
|
|
196
|
-
let t =
|
|
197
|
-
return
|
|
198
|
-
mutationFn: async (e) => (await
|
|
199
|
-
athScheduleFixture(input: $input) { ${
|
|
200
|
-
}`, { input: e },
|
|
195
|
+
}, A = () => {
|
|
196
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
197
|
+
return r({
|
|
198
|
+
mutationFn: async (e) => (await c(`mutation AthScheduleFixture($input: AthCreateFixtureInput!) {
|
|
199
|
+
athScheduleFixture(input: $input) { ${f} }
|
|
200
|
+
}`, { input: e }, n)).athScheduleFixture,
|
|
201
201
|
onSuccess: () => {
|
|
202
202
|
t.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] });
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
|
-
},
|
|
206
|
-
let t =
|
|
207
|
-
return
|
|
208
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
209
|
-
athRecordFixtureResult(id: $id, input: $input) { ${
|
|
205
|
+
}, j = () => {
|
|
206
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
207
|
+
return r({
|
|
208
|
+
mutationFn: async ({ id: e, input: t }) => (await c(`mutation AthRecordFixtureResult($id: ID!, $input: AthRecordResultInput!) {
|
|
209
|
+
athRecordFixtureResult(id: $id, input: $input) { ${f} }
|
|
210
210
|
}`, {
|
|
211
211
|
id: e,
|
|
212
212
|
input: t
|
|
213
|
-
},
|
|
213
|
+
}, n)).athRecordFixtureResult,
|
|
214
214
|
onSuccess: (e) => {
|
|
215
215
|
t.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] }), t.invalidateQueries({ queryKey: [
|
|
216
216
|
"atheletebridge",
|
|
@@ -219,17 +219,17 @@ var s = async (e, t, n) => {
|
|
|
219
219
|
] }), t.invalidateQueries({ queryKey: ["atheletebridge", "standings"] });
|
|
220
220
|
}
|
|
221
221
|
});
|
|
222
|
-
},
|
|
222
|
+
}, M = (t = {}) => {
|
|
223
223
|
let { apiGatewayUrl: n } = e();
|
|
224
|
-
return
|
|
224
|
+
return i({
|
|
225
225
|
queryKey: [
|
|
226
226
|
"atheletebridge",
|
|
227
227
|
"programs",
|
|
228
228
|
t
|
|
229
229
|
],
|
|
230
|
-
queryFn: async () => (await
|
|
230
|
+
queryFn: async () => (await c(`query AthListPrograms($sport: AthSport, $level: AthProgramLevel, $status: AthProgramStatus, $pagination: PaginationInput) {
|
|
231
231
|
athListPrograms(sport: $sport, level: $level, status: $status, pagination: $pagination) {
|
|
232
|
-
items { ${
|
|
232
|
+
items { ${h} drills { id } }
|
|
233
233
|
pageInfo { cursor hasMore }
|
|
234
234
|
}
|
|
235
235
|
}`, {
|
|
@@ -239,41 +239,41 @@ var s = async (e, t, n) => {
|
|
|
239
239
|
pagination: t.pagination
|
|
240
240
|
}, n)).athListPrograms
|
|
241
241
|
});
|
|
242
|
-
},
|
|
242
|
+
}, N = (t) => {
|
|
243
243
|
let { apiGatewayUrl: n } = e();
|
|
244
|
-
return
|
|
244
|
+
return i({
|
|
245
245
|
queryKey: [
|
|
246
246
|
"atheletebridge",
|
|
247
247
|
"program",
|
|
248
248
|
t
|
|
249
249
|
],
|
|
250
|
-
queryFn: async () => (await
|
|
250
|
+
queryFn: async () => (await c(`query AthProgram($id: ID!) {
|
|
251
251
|
athProgram(id: $id) {
|
|
252
|
-
${
|
|
253
|
-
drills { ${
|
|
252
|
+
${h}
|
|
253
|
+
drills { ${m} }
|
|
254
254
|
}
|
|
255
255
|
}`, { id: t }, n)).athProgram,
|
|
256
256
|
enabled: !!t
|
|
257
257
|
});
|
|
258
|
-
},
|
|
259
|
-
let t =
|
|
260
|
-
return
|
|
261
|
-
mutationFn: async (e) => (await
|
|
262
|
-
athCreateProgram(input: $input) { ${
|
|
263
|
-
}`, { input: e },
|
|
258
|
+
}, ee = () => {
|
|
259
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
260
|
+
return r({
|
|
261
|
+
mutationFn: async (e) => (await c(`mutation AthCreateProgram($input: AthCreateProgramInput!) {
|
|
262
|
+
athCreateProgram(input: $input) { ${h} }
|
|
263
|
+
}`, { input: e }, n)).athCreateProgram,
|
|
264
264
|
onSuccess: () => {
|
|
265
265
|
t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
268
|
}, P = () => {
|
|
269
|
-
let t =
|
|
270
|
-
return
|
|
271
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
272
|
-
athUpdateProgram(id: $id, input: $input) { ${
|
|
269
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
270
|
+
return r({
|
|
271
|
+
mutationFn: async ({ id: e, input: t }) => (await c(`mutation AthUpdateProgram($id: ID!, $input: AthUpdateProgramInput!) {
|
|
272
|
+
athUpdateProgram(id: $id, input: $input) { ${h} }
|
|
273
273
|
}`, {
|
|
274
274
|
id: e,
|
|
275
275
|
input: t
|
|
276
|
-
},
|
|
276
|
+
}, n)).athUpdateProgram,
|
|
277
277
|
onSuccess: (e) => {
|
|
278
278
|
t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] }), t.invalidateQueries({ queryKey: [
|
|
279
279
|
"atheletebridge",
|
|
@@ -283,14 +283,14 @@ var s = async (e, t, n) => {
|
|
|
283
283
|
}
|
|
284
284
|
});
|
|
285
285
|
}, F = () => {
|
|
286
|
-
let t =
|
|
287
|
-
return
|
|
288
|
-
mutationFn: async ({ id: e, status: t }) => (await
|
|
289
|
-
athTransitionProgram(id: $id, status: $status) { ${
|
|
286
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
287
|
+
return r({
|
|
288
|
+
mutationFn: async ({ id: e, status: t }) => (await c(`mutation AthTransitionProgram($id: ID!, $status: AthProgramStatus!) {
|
|
289
|
+
athTransitionProgram(id: $id, status: $status) { ${h} }
|
|
290
290
|
}`, {
|
|
291
291
|
id: e,
|
|
292
292
|
status: t
|
|
293
|
-
},
|
|
293
|
+
}, n)).athTransitionProgram,
|
|
294
294
|
onSuccess: (e) => {
|
|
295
295
|
t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] }), t.invalidateQueries({ queryKey: [
|
|
296
296
|
"atheletebridge",
|
|
@@ -300,19 +300,19 @@ var s = async (e, t, n) => {
|
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
302
|
}, I = () => {
|
|
303
|
-
let t =
|
|
304
|
-
return
|
|
305
|
-
mutationFn: async (e) => (await
|
|
303
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
304
|
+
return r({
|
|
305
|
+
mutationFn: async (e) => (await c("mutation AthArchiveProgram($id: ID!) { athArchiveProgram(id: $id) }", { id: e }, n)).athArchiveProgram,
|
|
306
306
|
onSuccess: () => {
|
|
307
307
|
t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
|
|
308
308
|
}
|
|
309
309
|
});
|
|
310
310
|
}, L = () => {
|
|
311
|
-
let t =
|
|
312
|
-
return
|
|
313
|
-
mutationFn: async (e) => (await
|
|
314
|
-
athAddDrill(input: $input) { ${
|
|
315
|
-
}`, { input: e },
|
|
311
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
312
|
+
return r({
|
|
313
|
+
mutationFn: async (e) => (await c(`mutation AthAddDrill($input: AthAddDrillInput!) {
|
|
314
|
+
athAddDrill(input: $input) { ${m} }
|
|
315
|
+
}`, { input: e }, n)).athAddDrill,
|
|
316
316
|
onSuccess: (e) => {
|
|
317
317
|
t.invalidateQueries({ queryKey: [
|
|
318
318
|
"atheletebridge",
|
|
@@ -322,11 +322,11 @@ var s = async (e, t, n) => {
|
|
|
322
322
|
}
|
|
323
323
|
});
|
|
324
324
|
}, R = (t) => {
|
|
325
|
-
let
|
|
326
|
-
return
|
|
327
|
-
mutationFn: async (e) => (await
|
|
325
|
+
let n = a(), { apiGatewayUrl: i } = e();
|
|
326
|
+
return r({
|
|
327
|
+
mutationFn: async (e) => (await c("mutation AthRemoveDrill($id: ID!) { athRemoveDrill(id: $id) }", { id: e }, i)).athRemoveDrill,
|
|
328
328
|
onSuccess: () => {
|
|
329
|
-
|
|
329
|
+
n.invalidateQueries({ queryKey: [
|
|
330
330
|
"atheletebridge",
|
|
331
331
|
"program",
|
|
332
332
|
t
|
|
@@ -335,15 +335,15 @@ var s = async (e, t, n) => {
|
|
|
335
335
|
});
|
|
336
336
|
}, z = (t = {}) => {
|
|
337
337
|
let { apiGatewayUrl: n } = e();
|
|
338
|
-
return
|
|
338
|
+
return i({
|
|
339
339
|
queryKey: [
|
|
340
340
|
"atheletebridge",
|
|
341
341
|
"sessions",
|
|
342
342
|
t
|
|
343
343
|
],
|
|
344
|
-
queryFn: async () => (await
|
|
344
|
+
queryFn: async () => (await c(`query AthListSessions($athleteId: ID, $coachId: ID, $status: AthSessionStatus, $pagination: PaginationInput) {
|
|
345
345
|
athListSessions(athleteId: $athleteId, coachId: $coachId, status: $status, pagination: $pagination) {
|
|
346
|
-
items { ${
|
|
346
|
+
items { ${g} }
|
|
347
347
|
pageInfo { cursor hasMore }
|
|
348
348
|
}
|
|
349
349
|
}`, {
|
|
@@ -355,33 +355,33 @@ var s = async (e, t, n) => {
|
|
|
355
355
|
});
|
|
356
356
|
}, B = (t) => {
|
|
357
357
|
let { apiGatewayUrl: n } = e();
|
|
358
|
-
return
|
|
358
|
+
return i({
|
|
359
359
|
queryKey: [
|
|
360
360
|
"atheletebridge",
|
|
361
361
|
"session",
|
|
362
362
|
t
|
|
363
363
|
],
|
|
364
|
-
queryFn: async () => (await
|
|
365
|
-
athSession(id: $id) { ${
|
|
364
|
+
queryFn: async () => (await c(`query AthSession($id: ID!) {
|
|
365
|
+
athSession(id: $id) { ${g} }
|
|
366
366
|
}`, { id: t }, n)).athSession,
|
|
367
367
|
enabled: !!t
|
|
368
368
|
});
|
|
369
369
|
}, V = () => {
|
|
370
|
-
let t =
|
|
371
|
-
return
|
|
372
|
-
mutationFn: async (e) => (await
|
|
373
|
-
athBookSession(input: $input) { ${
|
|
374
|
-
}`, { input: e },
|
|
370
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
371
|
+
return r({
|
|
372
|
+
mutationFn: async (e) => (await c(`mutation AthBookSession($input: AthBookSessionInput!) {
|
|
373
|
+
athBookSession(input: $input) { ${g} }
|
|
374
|
+
}`, { input: e }, n)).athBookSession,
|
|
375
375
|
onSuccess: () => {
|
|
376
376
|
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] });
|
|
377
377
|
}
|
|
378
378
|
});
|
|
379
379
|
}, H = () => {
|
|
380
|
-
let t =
|
|
381
|
-
return
|
|
382
|
-
mutationFn: async (e) => (await
|
|
383
|
-
athConfirmSession(id: $id) { ${
|
|
384
|
-
}`, { id: e },
|
|
380
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
381
|
+
return r({
|
|
382
|
+
mutationFn: async (e) => (await c(`mutation AthConfirmSession($id: ID!) {
|
|
383
|
+
athConfirmSession(id: $id) { ${g} }
|
|
384
|
+
}`, { id: e }, n)).athConfirmSession,
|
|
385
385
|
onSuccess: (e) => {
|
|
386
386
|
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
|
|
387
387
|
"atheletebridge",
|
|
@@ -391,14 +391,14 @@ var s = async (e, t, n) => {
|
|
|
391
391
|
}
|
|
392
392
|
});
|
|
393
393
|
}, U = () => {
|
|
394
|
-
let t =
|
|
395
|
-
return
|
|
396
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
397
|
-
athCompleteSession(id: $id, input: $input) { ${
|
|
394
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
395
|
+
return r({
|
|
396
|
+
mutationFn: async ({ id: e, input: t }) => (await c(`mutation AthCompleteSession($id: ID!, $input: AthCompleteSessionInput) {
|
|
397
|
+
athCompleteSession(id: $id, input: $input) { ${g} }
|
|
398
398
|
}`, {
|
|
399
399
|
id: e,
|
|
400
400
|
input: t
|
|
401
|
-
},
|
|
401
|
+
}, n)).athCompleteSession,
|
|
402
402
|
onSuccess: (e) => {
|
|
403
403
|
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
|
|
404
404
|
"atheletebridge",
|
|
@@ -408,11 +408,11 @@ var s = async (e, t, n) => {
|
|
|
408
408
|
}
|
|
409
409
|
});
|
|
410
410
|
}, W = () => {
|
|
411
|
-
let t =
|
|
412
|
-
return
|
|
413
|
-
mutationFn: async (e) => (await
|
|
414
|
-
athCancelSession(id: $id) { ${
|
|
415
|
-
}`, { id: e },
|
|
411
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
412
|
+
return r({
|
|
413
|
+
mutationFn: async (e) => (await c(`mutation AthCancelSession($id: ID!) {
|
|
414
|
+
athCancelSession(id: $id) { ${g} }
|
|
415
|
+
}`, { id: e }, n)).athCancelSession,
|
|
416
416
|
onSuccess: (e) => {
|
|
417
417
|
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
|
|
418
418
|
"atheletebridge",
|
|
@@ -423,15 +423,15 @@ var s = async (e, t, n) => {
|
|
|
423
423
|
});
|
|
424
424
|
}, G = (t = {}) => {
|
|
425
425
|
let { apiGatewayUrl: n } = e();
|
|
426
|
-
return
|
|
426
|
+
return i({
|
|
427
427
|
queryKey: [
|
|
428
428
|
"atheletebridge",
|
|
429
429
|
"workout-logs",
|
|
430
430
|
t
|
|
431
431
|
],
|
|
432
|
-
queryFn: async () => (await
|
|
432
|
+
queryFn: async () => (await c(`query AthListWorkoutLogs($athleteId: ID, $programId: ID, $pagination: PaginationInput) {
|
|
433
433
|
athListWorkoutLogs(athleteId: $athleteId, programId: $programId, pagination: $pagination) {
|
|
434
|
-
items { ${
|
|
434
|
+
items { ${_} }
|
|
435
435
|
pageInfo { cursor hasMore }
|
|
436
436
|
}
|
|
437
437
|
}`, {
|
|
@@ -442,33 +442,33 @@ var s = async (e, t, n) => {
|
|
|
442
442
|
});
|
|
443
443
|
}, K = (t) => {
|
|
444
444
|
let { apiGatewayUrl: n } = e();
|
|
445
|
-
return
|
|
445
|
+
return i({
|
|
446
446
|
queryKey: [
|
|
447
447
|
"atheletebridge",
|
|
448
448
|
"metrics",
|
|
449
449
|
t
|
|
450
450
|
],
|
|
451
|
-
queryFn: async () => (await
|
|
452
|
-
athPerformanceMetrics(athleteId: $athleteId) { ${
|
|
451
|
+
queryFn: async () => (await c(`query AthPerformanceMetrics($athleteId: ID!) {
|
|
452
|
+
athPerformanceMetrics(athleteId: $athleteId) { ${v} }
|
|
453
453
|
}`, { athleteId: t }, n)).athPerformanceMetrics,
|
|
454
454
|
enabled: !!t
|
|
455
455
|
});
|
|
456
456
|
}, q = () => {
|
|
457
|
-
let t =
|
|
458
|
-
return
|
|
459
|
-
mutationFn: async (e) => (await
|
|
460
|
-
athLogWorkout(input: $input) { ${
|
|
461
|
-
}`, { input: e },
|
|
457
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
458
|
+
return r({
|
|
459
|
+
mutationFn: async (e) => (await c(`mutation AthLogWorkout($input: AthLogWorkoutInput!) {
|
|
460
|
+
athLogWorkout(input: $input) { ${_} }
|
|
461
|
+
}`, { input: e }, n)).athLogWorkout,
|
|
462
462
|
onSuccess: () => {
|
|
463
463
|
t.invalidateQueries({ queryKey: ["atheletebridge", "workout-logs"] });
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
}, J = () => {
|
|
467
|
-
let t =
|
|
468
|
-
return
|
|
469
|
-
mutationFn: async (e) => (await
|
|
470
|
-
athRecordMetric(input: $input) { ${
|
|
471
|
-
}`, { input: e },
|
|
467
|
+
let t = a(), { apiGatewayUrl: n } = e();
|
|
468
|
+
return r({
|
|
469
|
+
mutationFn: async (e) => (await c(`mutation AthRecordMetric($input: AthRecordMetricInput!) {
|
|
470
|
+
athRecordMetric(input: $input) { ${v} }
|
|
471
|
+
}`, { input: e }, n)).athRecordMetric,
|
|
472
472
|
onSuccess: () => {
|
|
473
473
|
t.invalidateQueries({ queryKey: ["atheletebridge", "metrics"] });
|
|
474
474
|
}
|
|
@@ -479,7 +479,7 @@ var s = async (e, t, n) => {
|
|
|
479
479
|
}, X = () => {
|
|
480
480
|
let { apiGatewayUrl: n } = e();
|
|
481
481
|
return t(async (e) => {
|
|
482
|
-
let t = await
|
|
482
|
+
let t = await c("mutation AthInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) { uploadUrl session { id } }\n }", { input: {
|
|
483
483
|
fileName: e.name,
|
|
484
484
|
extension: Y(e.name),
|
|
485
485
|
fileSize: e.size,
|
|
@@ -493,29 +493,29 @@ var s = async (e, t, n) => {
|
|
|
493
493
|
headers: { "Content-Type": e.type || "application/octet-stream" }
|
|
494
494
|
});
|
|
495
495
|
if (!a.ok) throw Error(`Storage rejected the upload (HTTP ${a.status}).`);
|
|
496
|
-
return (await
|
|
496
|
+
return (await c("mutation AthCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) { fileId }\n }", { input: { sessionId: i } }, n)).completeUpload.fileId;
|
|
497
497
|
}, [n]);
|
|
498
498
|
}, Z = (t) => {
|
|
499
499
|
let { apiGatewayUrl: n } = e();
|
|
500
|
-
return
|
|
500
|
+
return i({
|
|
501
501
|
queryKey: [
|
|
502
502
|
"atheletebridge",
|
|
503
503
|
"file",
|
|
504
504
|
t
|
|
505
505
|
],
|
|
506
|
-
queryFn: async () => (await
|
|
506
|
+
queryFn: async () => (await c("query AthGetFile($id: ID!) {\n getFile(id: $id) { id name downloadUrl }\n }", { id: t }, n)).getFile,
|
|
507
507
|
enabled: !!t,
|
|
508
508
|
staleTime: 6e4
|
|
509
509
|
});
|
|
510
|
-
}, Q = (e) => e.name?.trim() ? e.name.trim() : [e.firstName, e.lastName].filter(Boolean).join(" ").trim() || (e.username?.trim() ? e.username.trim() : e.email),
|
|
510
|
+
}, Q = (e) => e.name?.trim() ? e.name.trim() : [e.firstName, e.lastName].filter(Boolean).join(" ").trim() || (e.username?.trim() ? e.username.trim() : e.email), te = (e) => {
|
|
511
511
|
let t = e.trim();
|
|
512
|
-
return
|
|
512
|
+
return i({
|
|
513
513
|
queryKey: [
|
|
514
514
|
"atheletebridge",
|
|
515
515
|
"user-search",
|
|
516
516
|
t
|
|
517
517
|
],
|
|
518
|
-
queryFn: async () => (await
|
|
518
|
+
queryFn: async () => (await l("query AthUserSearch($filter: UserFilterInput, $pagination: PaginationInput) {\n users(filter: $filter, pagination: $pagination) {\n users { id name firstName lastName email username }\n hasMore\n }\n }", {
|
|
519
519
|
filter: { search: t },
|
|
520
520
|
pagination: {
|
|
521
521
|
limit: 8,
|
|
@@ -526,8 +526,214 @@ var s = async (e, t, n) => {
|
|
|
526
526
|
staleTime: 3e4,
|
|
527
527
|
retry: !1
|
|
528
528
|
});
|
|
529
|
+
}, ne = (e) => {
|
|
530
|
+
let t = n(() => Array.from(new Set(e.filter((e) => !!(e && e.trim())))).sort(), [e]);
|
|
531
|
+
return i({
|
|
532
|
+
queryKey: [
|
|
533
|
+
"atheletebridge",
|
|
534
|
+
"users-by-id",
|
|
535
|
+
t
|
|
536
|
+
],
|
|
537
|
+
queryFn: async () => {
|
|
538
|
+
if (t.length === 0) return {};
|
|
539
|
+
let e = t.map((e, t) => `$id${t}: ID!`).join(", "), n = t.map((e, t) => `u${t}: user(id: $id${t}) { id name firstName lastName email username }`).join("\n"), r = {};
|
|
540
|
+
t.forEach((e, t) => {
|
|
541
|
+
r[`id${t}`] = e;
|
|
542
|
+
});
|
|
543
|
+
let i = (await s({
|
|
544
|
+
gateway: "global",
|
|
545
|
+
query: `query AthUsersByIds(${e}) {\n${n}\n}`,
|
|
546
|
+
variables: r,
|
|
547
|
+
suppressGlobalErrorEvent: !0
|
|
548
|
+
})).data ?? {}, a = {};
|
|
549
|
+
for (let e of Object.values(i)) e && e.id && (a[e.id] = {
|
|
550
|
+
id: e.id,
|
|
551
|
+
name: Q(e),
|
|
552
|
+
email: e.email ?? null
|
|
553
|
+
});
|
|
554
|
+
return a;
|
|
555
|
+
},
|
|
556
|
+
enabled: t.length > 0,
|
|
557
|
+
staleTime: 5 * 6e4,
|
|
558
|
+
retry: !1
|
|
559
|
+
});
|
|
560
|
+
}, re = (e) => {
|
|
561
|
+
let t = ne(e), n = t.data ?? {};
|
|
562
|
+
return {
|
|
563
|
+
byId: n,
|
|
564
|
+
isLoading: t.isLoading,
|
|
565
|
+
isError: t.isError,
|
|
566
|
+
nameOf: (e) => e ? n[e]?.name : void 0,
|
|
567
|
+
emailOf: (e) => e ? n[e]?.email : void 0
|
|
568
|
+
};
|
|
569
|
+
}, ie = ({ teams: e = [], fixtures: t = [], sessions: r = [], programs: i = [], limit: a = 8 }) => n(() => {
|
|
570
|
+
let n = [];
|
|
571
|
+
for (let t of e) {
|
|
572
|
+
n.push({
|
|
573
|
+
id: `team-${t.id}`,
|
|
574
|
+
type: "team-created",
|
|
575
|
+
title: `Team ${t.name} created`,
|
|
576
|
+
at: t.createdAt,
|
|
577
|
+
entityId: t.id,
|
|
578
|
+
entityKind: "team"
|
|
579
|
+
});
|
|
580
|
+
for (let e of t.members ?? []) n.push({
|
|
581
|
+
id: `member-${e.id}`,
|
|
582
|
+
type: "member-added",
|
|
583
|
+
title: `${e.displayName} added to ${t.name}`,
|
|
584
|
+
at: e.joinedAt ?? e.createdAt,
|
|
585
|
+
entityId: t.id,
|
|
586
|
+
entityKind: "team"
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
for (let e of i) e.status === "PUBLISHED" && n.push({
|
|
590
|
+
id: `program-${e.id}`,
|
|
591
|
+
type: "program-published",
|
|
592
|
+
title: `${e.name} published`,
|
|
593
|
+
at: e.updatedAt,
|
|
594
|
+
entityId: e.id,
|
|
595
|
+
entityKind: "program"
|
|
596
|
+
});
|
|
597
|
+
for (let e of t) {
|
|
598
|
+
let t = e.homeTeam?.name ?? "Home", r = e.awayTeam?.name ?? (e.awayTeamId ? "Away" : "TBD"), i = e.homeScore !== null && e.awayScore !== null;
|
|
599
|
+
n.push({
|
|
600
|
+
id: `fixture-${e.id}`,
|
|
601
|
+
type: "fixture-updated",
|
|
602
|
+
title: i ? `${t} ${e.homeScore}–${e.awayScore} ${r}` : `Fixture ${t} vs ${r} updated`,
|
|
603
|
+
subtitle: e.competition ?? void 0,
|
|
604
|
+
at: e.updatedAt,
|
|
605
|
+
entityId: e.id,
|
|
606
|
+
entityKind: "fixture"
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
for (let e of r) e.status === "COMPLETED" && n.push({
|
|
610
|
+
id: `session-${e.id}`,
|
|
611
|
+
type: "session-completed",
|
|
612
|
+
title: `Session "${e.title}" completed`,
|
|
613
|
+
subtitle: e.rating === null ? void 0 : `Rated ${e.rating}/5`,
|
|
614
|
+
at: e.completedAt ?? e.updatedAt,
|
|
615
|
+
entityId: e.id,
|
|
616
|
+
entityKind: "session"
|
|
617
|
+
});
|
|
618
|
+
return n.filter((e) => !!e.at && !Number.isNaN(new Date(e.at).getTime())).sort((e, t) => new Date(t.at).getTime() - new Date(e.at).getTime()).slice(0, a);
|
|
619
|
+
}, [
|
|
620
|
+
e,
|
|
621
|
+
t,
|
|
622
|
+
r,
|
|
623
|
+
i,
|
|
624
|
+
a
|
|
625
|
+
]), ae = (e, t) => {
|
|
626
|
+
let r = x(e), i = n(() => (r.data ?? []).find((e) => e.id === t) ?? null, [r.data, t]), a = i?.userId, o = K(a), s = G({
|
|
627
|
+
athleteId: a,
|
|
628
|
+
pagination: { limit: 100 }
|
|
629
|
+
}), c = z({
|
|
630
|
+
athleteId: a,
|
|
631
|
+
pagination: { limit: 100 }
|
|
632
|
+
});
|
|
633
|
+
return {
|
|
634
|
+
member: i,
|
|
635
|
+
athleteId: a,
|
|
636
|
+
metrics: o.data ?? [],
|
|
637
|
+
workouts: s.data?.items ?? [],
|
|
638
|
+
sessions: c.data?.items ?? [],
|
|
639
|
+
isLoading: r.isLoading || !!a && (o.isLoading || s.isLoading || c.isLoading),
|
|
640
|
+
isError: r.isError || o.isError || s.isError || c.isError
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
function $(e, t, n, r = 8) {
|
|
644
|
+
let i = Date.now(), a = Array.from({ length: r }, () => 0);
|
|
645
|
+
for (let o of e) {
|
|
646
|
+
let e = new Date(t(o)).getTime();
|
|
647
|
+
if (Number.isNaN(e)) continue;
|
|
648
|
+
let s = i - e;
|
|
649
|
+
if (s < 0) continue;
|
|
650
|
+
let c = Math.floor(s / 6048e5);
|
|
651
|
+
c >= 0 && c < r && (a[r - 1 - c] += n(o));
|
|
652
|
+
}
|
|
653
|
+
return a.map((e, t) => {
|
|
654
|
+
let n = r - 1 - t;
|
|
655
|
+
return {
|
|
656
|
+
label: n === 0 ? "Now" : `${n}w`,
|
|
657
|
+
value: e
|
|
658
|
+
};
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
var oe = (e = {}) => {
|
|
662
|
+
let { competition: t, sampleLimit: r = 200 } = e, i = z({ pagination: { limit: r } }), a = G({ pagination: { limit: r } }), o = D({ pagination: { limit: r } }), s = n(() => i.data?.items ?? [], [i.data]), c = n(() => a.data?.items ?? [], [a.data]), l = n(() => o.data?.items ?? [], [o.data]), u = n(() => {
|
|
663
|
+
if (t) return t;
|
|
664
|
+
let e = /* @__PURE__ */ new Map();
|
|
665
|
+
for (let t of l) t.competition && e.set(t.competition, (e.get(t.competition) ?? 0) + 1);
|
|
666
|
+
let n = null, r = 0;
|
|
667
|
+
for (let [t, i] of e) i > r && (r = i, n = t);
|
|
668
|
+
return n;
|
|
669
|
+
}, [t, l]), d = k(u ?? void 0);
|
|
670
|
+
return n(() => {
|
|
671
|
+
let e = s.length, t = s.filter((e) => e.rating !== null), n = t.length, r = n > 0 ? t.reduce((e, t) => e + (t.rating ?? 0), 0) / n : null, l = s.filter((e) => e.status === "COMPLETED").length, f = e > 0 ? l / e * 100 : 0, p = [
|
|
672
|
+
"REQUESTED",
|
|
673
|
+
"CONFIRMED",
|
|
674
|
+
"COMPLETED",
|
|
675
|
+
"CANCELLED",
|
|
676
|
+
"NO_SHOW"
|
|
677
|
+
], m = /* @__PURE__ */ new Map();
|
|
678
|
+
for (let e of s) m.set(e.status, (m.get(e.status) ?? 0) + 1);
|
|
679
|
+
let h = p.map((e) => ({
|
|
680
|
+
status: e,
|
|
681
|
+
count: m.get(e) ?? 0
|
|
682
|
+
})).filter((e) => e.count > 0), g = /* @__PURE__ */ new Map();
|
|
683
|
+
for (let e of t) {
|
|
684
|
+
let t = g.get(e.coachId) ?? {
|
|
685
|
+
sum: 0,
|
|
686
|
+
count: 0
|
|
687
|
+
};
|
|
688
|
+
t.sum += e.rating ?? 0, t.count += 1, g.set(e.coachId, t);
|
|
689
|
+
}
|
|
690
|
+
let _ = Array.from(g.entries()).map(([e, { sum: t, count: n }]) => ({
|
|
691
|
+
coachId: e,
|
|
692
|
+
avgRating: t / n,
|
|
693
|
+
count: n
|
|
694
|
+
})).sort((e, t) => t.avgRating - e.avgRating), v = Array.from(new Set(s.map((e) => e.coachId))), y = Date.now(), b = 864e5, x = 0, S = 0;
|
|
695
|
+
for (let e of c) {
|
|
696
|
+
let t = e.totalLoad ?? 0, n = y - new Date(e.performedAt).getTime();
|
|
697
|
+
Number.isNaN(n) || (n <= 7 * b && (x += t), n <= 28 * b && (S += t));
|
|
698
|
+
}
|
|
699
|
+
let C = S / 4, w = C > 0 ? x / C : null, T = $(c, (e) => e.performedAt, (e) => e.totalLoad ?? 0), E = $(s, (e) => e.scheduledAt, () => 1);
|
|
700
|
+
return {
|
|
701
|
+
totalSessions: e,
|
|
702
|
+
ratedCount: n,
|
|
703
|
+
avgRating: r,
|
|
704
|
+
completedCount: l,
|
|
705
|
+
completedPct: f,
|
|
706
|
+
sessionsByStatus: h,
|
|
707
|
+
ratingByCoach: _,
|
|
708
|
+
coachIds: v,
|
|
709
|
+
trainingLoad: {
|
|
710
|
+
acute: x,
|
|
711
|
+
chronic: C,
|
|
712
|
+
ratio: w
|
|
713
|
+
},
|
|
714
|
+
loadTrend: T,
|
|
715
|
+
sessionTrend: E,
|
|
716
|
+
standings: d.data ?? [],
|
|
717
|
+
competition: u,
|
|
718
|
+
isLoading: i.isLoading || a.isLoading || o.isLoading || !!u && d.isLoading,
|
|
719
|
+
isError: i.isError || a.isError || o.isError || d.isError
|
|
720
|
+
};
|
|
721
|
+
}, [
|
|
722
|
+
s,
|
|
723
|
+
c,
|
|
724
|
+
u,
|
|
725
|
+
d.data,
|
|
726
|
+
d.isLoading,
|
|
727
|
+
d.isError,
|
|
728
|
+
i.isLoading,
|
|
729
|
+
i.isError,
|
|
730
|
+
a.isLoading,
|
|
731
|
+
a.isError,
|
|
732
|
+
o.isLoading,
|
|
733
|
+
o.isError
|
|
734
|
+
]);
|
|
529
735
|
};
|
|
530
736
|
//#endregion
|
|
531
|
-
export { Q as directoryUserName, L as useAddDrill,
|
|
737
|
+
export { Q as directoryUserName, L as useAddDrill, T as useAddMember, I as useArchiveProgram, w as useArchiveTeam, ae as useAthleteProfile, V as useBookSession, W as useCancelSession, oe as useCoachAnalytics, U as useCompleteSession, H as useConfirmSession, ee as useCreateProgram, S as useCreateTeam, Z as useFile, O as useFixture, D as useFixtures, q as useLogWorkout, K as usePerformanceMetrics, N as useProgram, M as usePrograms, ie as useRecentActivity, j as useRecordFixtureResult, J as useRecordMetric, R as useRemoveDrill, E as useRemoveMember, A as useScheduleFixture, B as useSession, z as useSessions, k as useStandings, b as useTeam, x as useTeamMembers, y as useTeams, F as useTransitionProgram, P as useUpdateProgram, C as useUpdateTeam, X as useUploadFile, re as useUserDirectory, te as useUserSearch, G as useWorkoutLogs };
|
|
532
738
|
|
|
533
739
|
//# sourceMappingURL=useAthleteBridgeApi.js.map
|