@burdenoff/microfe-atheletebridge 2026.629.1 → 2026.705.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/atheletebridge/AthleteBridgeRoot.js +45 -37
  2. package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
  3. package/dist/atheletebridge/AthleteBridgeRoutes.js +10 -6
  4. package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
  5. package/dist/atheletebridge/components/AthleteSelect.js +66 -0
  6. package/dist/atheletebridge/components/AthleteSelect.js.map +1 -0
  7. package/dist/atheletebridge/components/DrillVideoLink.js +28 -0
  8. package/dist/atheletebridge/components/DrillVideoLink.js.map +1 -0
  9. package/dist/atheletebridge/components/MetricsCard.js +20 -46
  10. package/dist/atheletebridge/components/MetricsCard.js.map +1 -1
  11. package/dist/atheletebridge/components/UserSearchSelect.js +129 -0
  12. package/dist/atheletebridge/components/UserSearchSelect.js.map +1 -0
  13. package/dist/atheletebridge/components/domain.js +10 -1
  14. package/dist/atheletebridge/components/domain.js.map +1 -1
  15. package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +313 -180
  16. package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
  17. package/dist/atheletebridge/pages/DashboardPage.js +77 -69
  18. package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
  19. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +4 -4
  20. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
  21. package/dist/atheletebridge/pages/performance/PerformancePage.js +496 -0
  22. package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -0
  23. package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +176 -142
  24. package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
  25. package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +86 -85
  26. package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
  27. package/dist/atheletebridge/pages/sessions/SessionFormPage.js +92 -98
  28. package/dist/atheletebridge/pages/sessions/SessionFormPage.js.map +1 -1
  29. package/dist/atheletebridge/pages/teams/TeamDetailPage.js +132 -137
  30. package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
  31. package/dist/atheletebridge/utils/formatters.js +2 -25
  32. package/dist/atheletebridge/utils/formatters.js.map +1 -1
  33. package/dist/atheletebridge/utils/url.js +17 -0
  34. package/dist/atheletebridge/utils/url.js.map +1 -0
  35. package/dist/index.js +4 -4
  36. package/package.json +5 -5
@@ -1,10 +1,11 @@
1
1
  import { useAthleteBridge as e } from "../context/AthleteBridgeContext.js";
2
2
  import "../context/index.js";
3
- import { useMutation as t, useQuery as n, useQueryClient as r } from "@tanstack/react-query";
4
- import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
3
+ import { useCallback as t } from "react";
4
+ import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
5
+ import { clearGraphqlFetchResponseCache as a, graphqlFetch as o } from "@burdenoff/fe-libs/shared/graphql";
5
6
  //#region src/atheletebridge/hooks/useAthleteBridgeApi.ts
6
- var a = async (e, t, n) => {
7
- let r = await i({
7
+ var s = async (e, t, n) => {
8
+ let r = await o({
8
9
  gateway: "workspace",
9
10
  baseUrl: n,
10
11
  query: e,
@@ -13,195 +14,222 @@ var a = async (e, t, n) => {
13
14
  });
14
15
  if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
15
16
  if (!r.data) throw Error("GraphQL response did not include data");
16
- return r.data;
17
- }, o = "\n id workspaceId name sport status description ageGroup season homeVenue\n headCoachId tags createdAt updatedAt\n", s = "\n id workspaceId teamId userId displayName role status position jerseyNumber\n height weight dominantSide notes joinedAt createdAt updatedAt\n", c = "\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", l = "\n id workspaceId competition teamId played won drawn lost goalsFor goalsAgainst\n points rank createdAt updatedAt\n team { id name sport }\n", u = "\n id workspaceId programId name description weekNumber orderIndex sets reps\n durationSec restSec createdAt updatedAt\n video { id }\n", d = "\n id workspaceId coachId name sport level status summary weeks isTemplate tags\n createdAt updatedAt\n", f = "\n id workspaceId coachId athleteId programId title type status location\n meetingUrl scheduledAt durationMin completedAt feedback rating\n createdAt updatedAt\n", p = (t = {}) => {
18
- let { apiGatewayUrl: r } = e();
19
- return n({
17
+ return e.trimStart().startsWith("mutation") && a(), r.data;
18
+ }, c = async (e, t) => {
19
+ let n = await o({
20
+ gateway: "global",
21
+ query: e,
22
+ variables: t,
23
+ suppressGlobalErrorEvent: !0
24
+ });
25
+ if (n.errors?.length) throw Error(n.errors[0]?.message ?? "GraphQL request failed");
26
+ if (!n.data) throw Error("GraphQL response did not include data");
27
+ return n.data;
28
+ }, l = "\n id workspaceId name sport status description ageGroup season homeVenue\n headCoachId tags createdAt updatedAt\n", u = "\n id workspaceId teamId userId displayName role status position jerseyNumber\n height weight dominantSide notes joinedAt createdAt updatedAt\n", d = "\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", f = "\n id workspaceId competition teamId played won drawn lost goalsFor goalsAgainst\n points rank createdAt updatedAt\n team { id name sport }\n", p = "\n id workspaceId programId name description weekNumber orderIndex sets reps\n durationSec restSec createdAt updatedAt\n video { id }\n", m = "\n id workspaceId coachId name sport level status summary weeks isTemplate tags\n createdAt updatedAt\n", h = "\n id workspaceId coachId athleteId programId title type status location\n meetingUrl scheduledAt durationMin completedAt feedback rating\n createdAt updatedAt\n", g = "\n id workspaceId athleteId programId title status performedAt durationMin rpe\n totalLoad metrics notes createdAt updatedAt\n", _ = "\n id workspaceId athleteId type label value unit source recordedAt\n createdAt updatedAt\n", v = (t = {}) => {
29
+ let { apiGatewayUrl: n } = e();
30
+ return r({
20
31
  queryKey: [
21
32
  "atheletebridge",
22
33
  "teams",
23
34
  t
24
35
  ],
25
- queryFn: async () => (await a(`query AthListTeams($sport: AthSport, $status: AthTeamStatus, $pagination: PaginationInput) {
36
+ queryFn: async () => (await s(`query AthListTeams($sport: AthSport, $status: AthTeamStatus, $pagination: PaginationInput) {
26
37
  athListTeams(sport: $sport, status: $status, pagination: $pagination) {
27
- items { ${o} }
38
+ items { ${l} }
28
39
  pageInfo { cursor hasMore }
29
40
  }
30
41
  }`, {
31
42
  sport: t.sport,
32
43
  status: t.status,
33
44
  pagination: t.pagination
34
- }, r)).athListTeams
45
+ }, n)).athListTeams
35
46
  });
36
- }, m = (t) => {
37
- let { apiGatewayUrl: r } = e();
38
- return n({
47
+ }, y = (t) => {
48
+ let { apiGatewayUrl: n } = e();
49
+ return r({
39
50
  queryKey: [
40
51
  "atheletebridge",
41
52
  "team",
42
53
  t
43
54
  ],
44
- queryFn: async () => (await a(`query AthTeam($id: ID!) {
55
+ queryFn: async () => (await s(`query AthTeam($id: ID!) {
45
56
  athTeam(id: $id) {
46
- ${o}
47
- members { ${s} }
48
- fixtures { ${c} }
57
+ ${l}
58
+ members { ${u} }
59
+ fixtures { ${d} }
49
60
  }
50
- }`, { id: t }, r)).athTeam,
61
+ }`, { id: t }, n)).athTeam,
62
+ enabled: !!t
63
+ });
64
+ }, b = (t, n) => {
65
+ let { apiGatewayUrl: i } = e();
66
+ return r({
67
+ queryKey: [
68
+ "atheletebridge",
69
+ "members",
70
+ t,
71
+ n
72
+ ],
73
+ queryFn: async () => (await s(`query AthListMembers($teamId: ID!, $status: AthMemberStatus) {
74
+ athListMembers(teamId: $teamId, status: $status) { ${u} }
75
+ }`, {
76
+ teamId: t,
77
+ status: n
78
+ }, i)).athListMembers,
51
79
  enabled: !!t
52
80
  });
53
- }, h = () => {
54
- let n = r(), { apiGatewayUrl: i } = e();
55
- return t({
56
- mutationFn: async (e) => (await a(`mutation AthCreateTeam($input: AthCreateTeamInput!) {
57
- athCreateTeam(input: $input) { ${o} }
58
- }`, { input: e }, i)).athCreateTeam,
81
+ }, x = () => {
82
+ let t = i(), { apiGatewayUrl: r } = e();
83
+ return n({
84
+ mutationFn: async (e) => (await s(`mutation AthCreateTeam($input: AthCreateTeamInput!) {
85
+ athCreateTeam(input: $input) { ${l} }
86
+ }`, { input: e }, r)).athCreateTeam,
59
87
  onSuccess: () => {
60
- n.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
88
+ t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
61
89
  }
62
90
  });
63
- }, g = () => {
64
- let n = r(), { apiGatewayUrl: i } = e();
65
- return t({
66
- mutationFn: async ({ id: e, input: t }) => (await a(`mutation AthUpdateTeam($id: ID!, $input: AthUpdateTeamInput!) {
67
- athUpdateTeam(id: $id, input: $input) { ${o} }
91
+ }, S = () => {
92
+ let t = i(), { apiGatewayUrl: r } = e();
93
+ return n({
94
+ mutationFn: async ({ id: e, input: t }) => (await s(`mutation AthUpdateTeam($id: ID!, $input: AthUpdateTeamInput!) {
95
+ athUpdateTeam(id: $id, input: $input) { ${l} }
68
96
  }`, {
69
97
  id: e,
70
98
  input: t
71
- }, i)).athUpdateTeam,
99
+ }, r)).athUpdateTeam,
72
100
  onSuccess: (e) => {
73
- n.invalidateQueries({ queryKey: ["atheletebridge", "teams"] }), n.invalidateQueries({ queryKey: [
101
+ t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] }), t.invalidateQueries({ queryKey: [
74
102
  "atheletebridge",
75
103
  "team",
76
104
  e.id
77
105
  ] });
78
106
  }
79
107
  });
80
- }, _ = () => {
81
- let n = r(), { apiGatewayUrl: i } = e();
82
- return t({
83
- mutationFn: async (e) => (await a("mutation AthArchiveTeam($id: ID!) { athArchiveTeam(id: $id) }", { id: e }, i)).athArchiveTeam,
108
+ }, C = () => {
109
+ let t = i(), { apiGatewayUrl: r } = e();
110
+ return n({
111
+ mutationFn: async (e) => (await s("mutation AthArchiveTeam($id: ID!) { athArchiveTeam(id: $id) }", { id: e }, r)).athArchiveTeam,
84
112
  onSuccess: () => {
85
- n.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
113
+ t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
86
114
  }
87
115
  });
88
- }, v = () => {
89
- let n = r(), { apiGatewayUrl: i } = e();
90
- return t({
91
- mutationFn: async (e) => (await a(`mutation AthAddMember($input: AthAddMemberInput!) {
92
- athAddMember(input: $input) { ${s} }
93
- }`, { input: e }, i)).athAddMember,
116
+ }, w = () => {
117
+ let t = i(), { apiGatewayUrl: r } = e();
118
+ return n({
119
+ mutationFn: async (e) => (await s(`mutation AthAddMember($input: AthAddMemberInput!) {
120
+ athAddMember(input: $input) { ${u} }
121
+ }`, { input: e }, r)).athAddMember,
94
122
  onSuccess: (e) => {
95
- n.invalidateQueries({ queryKey: [
123
+ t.invalidateQueries({ queryKey: [
96
124
  "atheletebridge",
97
125
  "members",
98
126
  e.teamId
99
- ] }), n.invalidateQueries({ queryKey: [
127
+ ] }), t.invalidateQueries({ queryKey: [
100
128
  "atheletebridge",
101
129
  "team",
102
130
  e.teamId
103
131
  ] });
104
132
  }
105
133
  });
106
- }, y = (n) => {
107
- let i = r(), { apiGatewayUrl: o } = e();
108
- return t({
109
- mutationFn: async (e) => (await a("mutation AthRemoveMember($id: ID!) { athRemoveMember(id: $id) }", { id: e }, o)).athRemoveMember,
134
+ }, T = (t) => {
135
+ let r = i(), { apiGatewayUrl: a } = e();
136
+ return n({
137
+ mutationFn: async (e) => (await s("mutation AthRemoveMember($id: ID!) { athRemoveMember(id: $id) }", { id: e }, a)).athRemoveMember,
110
138
  onSuccess: () => {
111
- i.invalidateQueries({ queryKey: [
139
+ r.invalidateQueries({ queryKey: [
112
140
  "atheletebridge",
113
141
  "members",
114
- n
115
- ] }), i.invalidateQueries({ queryKey: [
142
+ t
143
+ ] }), r.invalidateQueries({ queryKey: [
116
144
  "atheletebridge",
117
145
  "team",
118
- n
146
+ t
119
147
  ] });
120
148
  }
121
149
  });
122
- }, b = (t = {}) => {
123
- let { apiGatewayUrl: r } = e();
124
- return n({
150
+ }, E = (t = {}) => {
151
+ let { apiGatewayUrl: n } = e();
152
+ return r({
125
153
  queryKey: [
126
154
  "atheletebridge",
127
155
  "fixtures",
128
156
  t
129
157
  ],
130
- queryFn: async () => (await a(`query AthListFixtures($status: AthFixtureStatus, $teamId: ID, $pagination: PaginationInput) {
158
+ queryFn: async () => (await s(`query AthListFixtures($status: AthFixtureStatus, $teamId: ID, $pagination: PaginationInput) {
131
159
  athListFixtures(status: $status, teamId: $teamId, pagination: $pagination) {
132
- items { ${c} }
160
+ items { ${d} }
133
161
  pageInfo { cursor hasMore }
134
162
  }
135
163
  }`, {
136
164
  status: t.status,
137
165
  teamId: t.teamId,
138
166
  pagination: t.pagination
139
- }, r)).athListFixtures
167
+ }, n)).athListFixtures
140
168
  });
141
- }, x = (t) => {
142
- let { apiGatewayUrl: r } = e();
143
- return n({
169
+ }, D = (t) => {
170
+ let { apiGatewayUrl: n } = e();
171
+ return r({
144
172
  queryKey: [
145
173
  "atheletebridge",
146
174
  "fixture",
147
175
  t
148
176
  ],
149
- queryFn: async () => (await a(`query AthFixture($id: ID!) {
150
- athFixture(id: $id) { ${c} }
151
- }`, { id: t }, r)).athFixture,
177
+ queryFn: async () => (await s(`query AthFixture($id: ID!) {
178
+ athFixture(id: $id) { ${d} }
179
+ }`, { id: t }, n)).athFixture,
152
180
  enabled: !!t
153
181
  });
154
- }, S = (t) => {
155
- let { apiGatewayUrl: r } = e();
156
- return n({
182
+ }, O = (t) => {
183
+ let { apiGatewayUrl: n } = e();
184
+ return r({
157
185
  queryKey: [
158
186
  "atheletebridge",
159
187
  "standings",
160
188
  t
161
189
  ],
162
- queryFn: async () => (await a(`query AthStandings($competition: String!) {
163
- athStandings(competition: $competition) { ${l} }
164
- }`, { competition: t }, r)).athStandings,
190
+ queryFn: async () => (await s(`query AthStandings($competition: String!) {
191
+ athStandings(competition: $competition) { ${f} }
192
+ }`, { competition: t }, n)).athStandings,
165
193
  enabled: !!t
166
194
  });
167
- }, C = () => {
168
- let n = r(), { apiGatewayUrl: i } = e();
169
- return t({
170
- mutationFn: async (e) => (await a(`mutation AthScheduleFixture($input: AthCreateFixtureInput!) {
171
- athScheduleFixture(input: $input) { ${c} }
172
- }`, { input: e }, i)).athScheduleFixture,
195
+ }, k = () => {
196
+ let t = i(), { apiGatewayUrl: r } = e();
197
+ return n({
198
+ mutationFn: async (e) => (await s(`mutation AthScheduleFixture($input: AthCreateFixtureInput!) {
199
+ athScheduleFixture(input: $input) { ${d} }
200
+ }`, { input: e }, r)).athScheduleFixture,
173
201
  onSuccess: () => {
174
- n.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] });
202
+ t.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] });
175
203
  }
176
204
  });
177
- }, w = () => {
178
- let n = r(), { apiGatewayUrl: i } = e();
179
- return t({
180
- mutationFn: async ({ id: e, input: t }) => (await a(`mutation AthRecordFixtureResult($id: ID!, $input: AthRecordResultInput!) {
181
- athRecordFixtureResult(id: $id, input: $input) { ${c} }
205
+ }, A = () => {
206
+ let t = i(), { apiGatewayUrl: r } = e();
207
+ return n({
208
+ mutationFn: async ({ id: e, input: t }) => (await s(`mutation AthRecordFixtureResult($id: ID!, $input: AthRecordResultInput!) {
209
+ athRecordFixtureResult(id: $id, input: $input) { ${d} }
182
210
  }`, {
183
211
  id: e,
184
212
  input: t
185
- }, i)).athRecordFixtureResult,
213
+ }, r)).athRecordFixtureResult,
186
214
  onSuccess: (e) => {
187
- n.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] }), n.invalidateQueries({ queryKey: [
215
+ t.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] }), t.invalidateQueries({ queryKey: [
188
216
  "atheletebridge",
189
217
  "fixture",
190
218
  e.id
191
- ] }), n.invalidateQueries({ queryKey: ["atheletebridge", "standings"] });
219
+ ] }), t.invalidateQueries({ queryKey: ["atheletebridge", "standings"] });
192
220
  }
193
221
  });
194
- }, T = (t = {}) => {
195
- let { apiGatewayUrl: r } = e();
196
- return n({
222
+ }, j = (t = {}) => {
223
+ let { apiGatewayUrl: n } = e();
224
+ return r({
197
225
  queryKey: [
198
226
  "atheletebridge",
199
227
  "programs",
200
228
  t
201
229
  ],
202
- queryFn: async () => (await a(`query AthListPrograms($sport: AthSport, $level: AthProgramLevel, $status: AthProgramStatus, $pagination: PaginationInput) {
230
+ queryFn: async () => (await s(`query AthListPrograms($sport: AthSport, $level: AthProgramLevel, $status: AthProgramStatus, $pagination: PaginationInput) {
203
231
  athListPrograms(sport: $sport, level: $level, status: $status, pagination: $pagination) {
204
- items { ${d} }
232
+ items { ${m} }
205
233
  pageInfo { cursor hasMore }
206
234
  }
207
235
  }`, {
@@ -209,113 +237,113 @@ var a = async (e, t, n) => {
209
237
  level: t.level,
210
238
  status: t.status,
211
239
  pagination: t.pagination
212
- }, r)).athListPrograms
240
+ }, n)).athListPrograms
213
241
  });
214
- }, E = (t) => {
215
- let { apiGatewayUrl: r } = e();
216
- return n({
242
+ }, M = (t) => {
243
+ let { apiGatewayUrl: n } = e();
244
+ return r({
217
245
  queryKey: [
218
246
  "atheletebridge",
219
247
  "program",
220
248
  t
221
249
  ],
222
- queryFn: async () => (await a(`query AthProgram($id: ID!) {
250
+ queryFn: async () => (await s(`query AthProgram($id: ID!) {
223
251
  athProgram(id: $id) {
224
- ${d}
225
- drills { ${u} }
252
+ ${m}
253
+ drills { ${p} }
226
254
  }
227
- }`, { id: t }, r)).athProgram,
255
+ }`, { id: t }, n)).athProgram,
228
256
  enabled: !!t
229
257
  });
230
- }, D = () => {
231
- let n = r(), { apiGatewayUrl: i } = e();
232
- return t({
233
- mutationFn: async (e) => (await a(`mutation AthCreateProgram($input: AthCreateProgramInput!) {
234
- athCreateProgram(input: $input) { ${d} }
235
- }`, { input: e }, i)).athCreateProgram,
258
+ }, N = () => {
259
+ let t = i(), { apiGatewayUrl: r } = e();
260
+ return n({
261
+ mutationFn: async (e) => (await s(`mutation AthCreateProgram($input: AthCreateProgramInput!) {
262
+ athCreateProgram(input: $input) { ${m} }
263
+ }`, { input: e }, r)).athCreateProgram,
236
264
  onSuccess: () => {
237
- n.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
265
+ t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
238
266
  }
239
267
  });
240
- }, O = () => {
241
- let n = r(), { apiGatewayUrl: i } = e();
242
- return t({
243
- mutationFn: async ({ id: e, input: t }) => (await a(`mutation AthUpdateProgram($id: ID!, $input: AthUpdateProgramInput!) {
244
- athUpdateProgram(id: $id, input: $input) { ${d} }
268
+ }, P = () => {
269
+ let t = i(), { apiGatewayUrl: r } = e();
270
+ return n({
271
+ mutationFn: async ({ id: e, input: t }) => (await s(`mutation AthUpdateProgram($id: ID!, $input: AthUpdateProgramInput!) {
272
+ athUpdateProgram(id: $id, input: $input) { ${m} }
245
273
  }`, {
246
274
  id: e,
247
275
  input: t
248
- }, i)).athUpdateProgram,
276
+ }, r)).athUpdateProgram,
249
277
  onSuccess: (e) => {
250
- n.invalidateQueries({ queryKey: ["atheletebridge", "programs"] }), n.invalidateQueries({ queryKey: [
278
+ t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] }), t.invalidateQueries({ queryKey: [
251
279
  "atheletebridge",
252
280
  "program",
253
281
  e.id
254
282
  ] });
255
283
  }
256
284
  });
257
- }, k = () => {
258
- let n = r(), { apiGatewayUrl: i } = e();
259
- return t({
260
- mutationFn: async ({ id: e, status: t }) => (await a(`mutation AthTransitionProgram($id: ID!, $status: AthProgramStatus!) {
261
- athTransitionProgram(id: $id, status: $status) { ${d} }
285
+ }, F = () => {
286
+ let t = i(), { apiGatewayUrl: r } = e();
287
+ return n({
288
+ mutationFn: async ({ id: e, status: t }) => (await s(`mutation AthTransitionProgram($id: ID!, $status: AthProgramStatus!) {
289
+ athTransitionProgram(id: $id, status: $status) { ${m} }
262
290
  }`, {
263
291
  id: e,
264
292
  status: t
265
- }, i)).athTransitionProgram,
293
+ }, r)).athTransitionProgram,
266
294
  onSuccess: (e) => {
267
- n.invalidateQueries({ queryKey: ["atheletebridge", "programs"] }), n.invalidateQueries({ queryKey: [
295
+ t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] }), t.invalidateQueries({ queryKey: [
268
296
  "atheletebridge",
269
297
  "program",
270
298
  e.id
271
299
  ] });
272
300
  }
273
301
  });
274
- }, A = () => {
275
- let n = r(), { apiGatewayUrl: i } = e();
276
- return t({
277
- mutationFn: async (e) => (await a("mutation AthArchiveProgram($id: ID!) { athArchiveProgram(id: $id) }", { id: e }, i)).athArchiveProgram,
302
+ }, I = () => {
303
+ let t = i(), { apiGatewayUrl: r } = e();
304
+ return n({
305
+ mutationFn: async (e) => (await s("mutation AthArchiveProgram($id: ID!) { athArchiveProgram(id: $id) }", { id: e }, r)).athArchiveProgram,
278
306
  onSuccess: () => {
279
- n.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
307
+ t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
280
308
  }
281
309
  });
282
- }, j = () => {
283
- let n = r(), { apiGatewayUrl: i } = e();
284
- return t({
285
- mutationFn: async (e) => (await a(`mutation AthAddDrill($input: AthAddDrillInput!) {
286
- athAddDrill(input: $input) { ${u} }
287
- }`, { input: e }, i)).athAddDrill,
310
+ }, L = () => {
311
+ let t = i(), { apiGatewayUrl: r } = e();
312
+ return n({
313
+ mutationFn: async (e) => (await s(`mutation AthAddDrill($input: AthAddDrillInput!) {
314
+ athAddDrill(input: $input) { ${p} }
315
+ }`, { input: e }, r)).athAddDrill,
288
316
  onSuccess: (e) => {
289
- n.invalidateQueries({ queryKey: [
317
+ t.invalidateQueries({ queryKey: [
290
318
  "atheletebridge",
291
319
  "program",
292
320
  e.programId
293
321
  ] });
294
322
  }
295
323
  });
296
- }, M = (n) => {
297
- let i = r(), { apiGatewayUrl: o } = e();
298
- return t({
299
- mutationFn: async (e) => (await a("mutation AthRemoveDrill($id: ID!) { athRemoveDrill(id: $id) }", { id: e }, o)).athRemoveDrill,
324
+ }, R = (t) => {
325
+ let r = i(), { apiGatewayUrl: a } = e();
326
+ return n({
327
+ mutationFn: async (e) => (await s("mutation AthRemoveDrill($id: ID!) { athRemoveDrill(id: $id) }", { id: e }, a)).athRemoveDrill,
300
328
  onSuccess: () => {
301
- i.invalidateQueries({ queryKey: [
329
+ r.invalidateQueries({ queryKey: [
302
330
  "atheletebridge",
303
331
  "program",
304
- n
332
+ t
305
333
  ] });
306
334
  }
307
335
  });
308
- }, N = (t = {}) => {
309
- let { apiGatewayUrl: r } = e();
310
- return n({
336
+ }, z = (t = {}) => {
337
+ let { apiGatewayUrl: n } = e();
338
+ return r({
311
339
  queryKey: [
312
340
  "atheletebridge",
313
341
  "sessions",
314
342
  t
315
343
  ],
316
- queryFn: async () => (await a(`query AthListSessions($athleteId: ID, $coachId: ID, $status: AthSessionStatus, $pagination: PaginationInput) {
344
+ queryFn: async () => (await s(`query AthListSessions($athleteId: ID, $coachId: ID, $status: AthSessionStatus, $pagination: PaginationInput) {
317
345
  athListSessions(athleteId: $athleteId, coachId: $coachId, status: $status, pagination: $pagination) {
318
- items { ${f} }
346
+ items { ${h} }
319
347
  pageInfo { cursor hasMore }
320
348
  }
321
349
  }`, {
@@ -323,78 +351,183 @@ var a = async (e, t, n) => {
323
351
  coachId: t.coachId,
324
352
  status: t.status,
325
353
  pagination: t.pagination
326
- }, r)).athListSessions
354
+ }, n)).athListSessions
327
355
  });
328
- }, P = (t) => {
329
- let { apiGatewayUrl: r } = e();
330
- return n({
356
+ }, B = (t) => {
357
+ let { apiGatewayUrl: n } = e();
358
+ return r({
331
359
  queryKey: [
332
360
  "atheletebridge",
333
361
  "session",
334
362
  t
335
363
  ],
336
- queryFn: async () => (await a(`query AthSession($id: ID!) {
337
- athSession(id: $id) { ${f} }
338
- }`, { id: t }, r)).athSession,
364
+ queryFn: async () => (await s(`query AthSession($id: ID!) {
365
+ athSession(id: $id) { ${h} }
366
+ }`, { id: t }, n)).athSession,
339
367
  enabled: !!t
340
368
  });
341
- }, F = () => {
342
- let n = r(), { apiGatewayUrl: i } = e();
343
- return t({
344
- mutationFn: async (e) => (await a(`mutation AthBookSession($input: AthBookSessionInput!) {
345
- athBookSession(input: $input) { ${f} }
346
- }`, { input: e }, i)).athBookSession,
369
+ }, V = () => {
370
+ let t = i(), { apiGatewayUrl: r } = e();
371
+ return n({
372
+ mutationFn: async (e) => (await s(`mutation AthBookSession($input: AthBookSessionInput!) {
373
+ athBookSession(input: $input) { ${h} }
374
+ }`, { input: e }, r)).athBookSession,
347
375
  onSuccess: () => {
348
- n.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] });
376
+ t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] });
349
377
  }
350
378
  });
351
- }, I = () => {
352
- let n = r(), { apiGatewayUrl: i } = e();
353
- return t({
354
- mutationFn: async (e) => (await a(`mutation AthConfirmSession($id: ID!) {
355
- athConfirmSession(id: $id) { ${f} }
356
- }`, { id: e }, i)).athConfirmSession,
379
+ }, H = () => {
380
+ let t = i(), { apiGatewayUrl: r } = e();
381
+ return n({
382
+ mutationFn: async (e) => (await s(`mutation AthConfirmSession($id: ID!) {
383
+ athConfirmSession(id: $id) { ${h} }
384
+ }`, { id: e }, r)).athConfirmSession,
357
385
  onSuccess: (e) => {
358
- n.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), n.invalidateQueries({ queryKey: [
386
+ t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
359
387
  "atheletebridge",
360
388
  "session",
361
389
  e.id
362
390
  ] });
363
391
  }
364
392
  });
365
- }, L = () => {
366
- let n = r(), { apiGatewayUrl: i } = e();
367
- return t({
368
- mutationFn: async ({ id: e, input: t }) => (await a(`mutation AthCompleteSession($id: ID!, $input: AthCompleteSessionInput) {
369
- athCompleteSession(id: $id, input: $input) { ${f} }
393
+ }, U = () => {
394
+ let t = i(), { apiGatewayUrl: r } = e();
395
+ return n({
396
+ mutationFn: async ({ id: e, input: t }) => (await s(`mutation AthCompleteSession($id: ID!, $input: AthCompleteSessionInput) {
397
+ athCompleteSession(id: $id, input: $input) { ${h} }
370
398
  }`, {
371
399
  id: e,
372
400
  input: t
373
- }, i)).athCompleteSession,
401
+ }, r)).athCompleteSession,
374
402
  onSuccess: (e) => {
375
- n.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), n.invalidateQueries({ queryKey: [
403
+ t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
376
404
  "atheletebridge",
377
405
  "session",
378
406
  e.id
379
407
  ] });
380
408
  }
381
409
  });
382
- }, R = () => {
383
- let n = r(), { apiGatewayUrl: i } = e();
384
- return t({
385
- mutationFn: async (e) => (await a(`mutation AthCancelSession($id: ID!) {
386
- athCancelSession(id: $id) { ${f} }
387
- }`, { id: e }, i)).athCancelSession,
410
+ }, W = () => {
411
+ let t = i(), { apiGatewayUrl: r } = e();
412
+ return n({
413
+ mutationFn: async (e) => (await s(`mutation AthCancelSession($id: ID!) {
414
+ athCancelSession(id: $id) { ${h} }
415
+ }`, { id: e }, r)).athCancelSession,
388
416
  onSuccess: (e) => {
389
- n.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), n.invalidateQueries({ queryKey: [
417
+ t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
390
418
  "atheletebridge",
391
419
  "session",
392
420
  e.id
393
421
  ] });
394
422
  }
395
423
  });
424
+ }, G = (t = {}) => {
425
+ let { apiGatewayUrl: n } = e();
426
+ return r({
427
+ queryKey: [
428
+ "atheletebridge",
429
+ "workout-logs",
430
+ t
431
+ ],
432
+ queryFn: async () => (await s(`query AthListWorkoutLogs($athleteId: ID, $programId: ID, $pagination: PaginationInput) {
433
+ athListWorkoutLogs(athleteId: $athleteId, programId: $programId, pagination: $pagination) {
434
+ items { ${g} }
435
+ pageInfo { cursor hasMore }
436
+ }
437
+ }`, {
438
+ athleteId: t.athleteId,
439
+ programId: t.programId,
440
+ pagination: t.pagination
441
+ }, n)).athListWorkoutLogs
442
+ });
443
+ }, K = (t) => {
444
+ let { apiGatewayUrl: n } = e();
445
+ return r({
446
+ queryKey: [
447
+ "atheletebridge",
448
+ "metrics",
449
+ t
450
+ ],
451
+ queryFn: async () => (await s(`query AthPerformanceMetrics($athleteId: ID!) {
452
+ athPerformanceMetrics(athleteId: $athleteId) { ${_} }
453
+ }`, { athleteId: t }, n)).athPerformanceMetrics,
454
+ enabled: !!t
455
+ });
456
+ }, q = () => {
457
+ let t = i(), { apiGatewayUrl: r } = e();
458
+ return n({
459
+ mutationFn: async (e) => (await s(`mutation AthLogWorkout($input: AthLogWorkoutInput!) {
460
+ athLogWorkout(input: $input) { ${g} }
461
+ }`, { input: e }, r)).athLogWorkout,
462
+ onSuccess: () => {
463
+ t.invalidateQueries({ queryKey: ["atheletebridge", "workout-logs"] });
464
+ }
465
+ });
466
+ }, J = () => {
467
+ let t = i(), { apiGatewayUrl: r } = e();
468
+ return n({
469
+ mutationFn: async (e) => (await s(`mutation AthRecordMetric($input: AthRecordMetricInput!) {
470
+ athRecordMetric(input: $input) { ${_} }
471
+ }`, { input: e }, r)).athRecordMetric,
472
+ onSuccess: () => {
473
+ t.invalidateQueries({ queryKey: ["atheletebridge", "metrics"] });
474
+ }
475
+ });
476
+ }, Y = (e) => {
477
+ let t = e.lastIndexOf(".");
478
+ return t >= 0 ? e.slice(t + 1).toLowerCase() : "bin";
479
+ }, X = () => {
480
+ let { apiGatewayUrl: n } = e();
481
+ return t(async (e) => {
482
+ let t = await s("mutation AthInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) { uploadUrl session { id } }\n }", { input: {
483
+ fileName: e.name,
484
+ extension: Y(e.name),
485
+ fileSize: e.size,
486
+ mimeType: e.type || "application/octet-stream",
487
+ visibility: "WORKSPACE"
488
+ } }, n), r = t.initiateUpload.uploadUrl, i = t.initiateUpload.session.id;
489
+ if (!r || !i) throw Error("Upload could not be initialised.");
490
+ let a = await fetch(r, {
491
+ method: "PUT",
492
+ body: e,
493
+ headers: { "Content-Type": e.type || "application/octet-stream" }
494
+ });
495
+ if (!a.ok) throw Error(`Storage rejected the upload (HTTP ${a.status}).`);
496
+ return (await s("mutation AthCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) { fileId }\n }", { input: { sessionId: i } }, n)).completeUpload.fileId;
497
+ }, [n]);
498
+ }, Z = (t) => {
499
+ let { apiGatewayUrl: n } = e();
500
+ return r({
501
+ queryKey: [
502
+ "atheletebridge",
503
+ "file",
504
+ t
505
+ ],
506
+ queryFn: async () => (await s("query AthGetFile($id: ID!) {\n getFile(id: $id) { id name downloadUrl }\n }", { id: t }, n)).getFile,
507
+ enabled: !!t,
508
+ staleTime: 6e4
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), $ = (e) => {
511
+ let t = e.trim();
512
+ return r({
513
+ queryKey: [
514
+ "atheletebridge",
515
+ "user-search",
516
+ t
517
+ ],
518
+ queryFn: async () => (await c("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
+ filter: { search: t },
520
+ pagination: {
521
+ limit: 8,
522
+ offset: 0
523
+ }
524
+ })).users.users,
525
+ enabled: t.length >= 2,
526
+ staleTime: 3e4,
527
+ retry: !1
528
+ });
396
529
  };
397
530
  //#endregion
398
- export { j as useAddDrill, v as useAddMember, A as useArchiveProgram, _ as useArchiveTeam, F as useBookSession, R as useCancelSession, L as useCompleteSession, I as useConfirmSession, D as useCreateProgram, h as useCreateTeam, x as useFixture, b as useFixtures, E as useProgram, T as usePrograms, w as useRecordFixtureResult, M as useRemoveDrill, y as useRemoveMember, C as useScheduleFixture, P as useSession, N as useSessions, S as useStandings, m as useTeam, p as useTeams, k as useTransitionProgram, O as useUpdateProgram, g as useUpdateTeam };
531
+ export { Q as directoryUserName, L as useAddDrill, w as useAddMember, I as useArchiveProgram, C as useArchiveTeam, V as useBookSession, W as useCancelSession, U as useCompleteSession, H as useConfirmSession, N as useCreateProgram, x as useCreateTeam, Z as useFile, D as useFixture, E as useFixtures, q as useLogWorkout, K as usePerformanceMetrics, M as useProgram, j as usePrograms, A as useRecordFixtureResult, J as useRecordMetric, R as useRemoveDrill, T as useRemoveMember, k as useScheduleFixture, B as useSession, z as useSessions, O as useStandings, y as useTeam, b as useTeamMembers, v as useTeams, F as useTransitionProgram, P as useUpdateProgram, S as useUpdateTeam, X as useUploadFile, $ as useUserSearch, G as useWorkoutLogs };
399
532
 
400
533
  //# sourceMappingURL=useAthleteBridgeApi.js.map