@burdenoff/microfe-atheletebridge 2026.1031.2 → 2026.1102.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.
Files changed (75) hide show
  1. package/dist/atheletebridge/AthleteBridgeRoot.d.ts.map +1 -1
  2. package/dist/atheletebridge/AthleteBridgeRoot.js +63 -47
  3. package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
  4. package/dist/atheletebridge/AthleteBridgeRoutes.d.ts.map +1 -1
  5. package/dist/atheletebridge/AthleteBridgeRoutes.js +62 -6
  6. package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
  7. package/dist/atheletebridge/components/StatusBadge.d.ts.map +1 -1
  8. package/dist/atheletebridge/components/StatusBadge.js +13 -1
  9. package/dist/atheletebridge/components/StatusBadge.js.map +1 -1
  10. package/dist/atheletebridge/components/registration/PaymentSummaryPanel.d.ts +6 -0
  11. package/dist/atheletebridge/components/registration/PaymentSummaryPanel.d.ts.map +1 -0
  12. package/dist/atheletebridge/components/registration/PaymentSummaryPanel.js +104 -0
  13. package/dist/atheletebridge/components/registration/PaymentSummaryPanel.js.map +1 -0
  14. package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts +15 -0
  15. package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts.map +1 -0
  16. package/dist/atheletebridge/components/registration/RegistrationEntryFields.js +236 -0
  17. package/dist/atheletebridge/components/registration/RegistrationEntryFields.js.map +1 -0
  18. package/dist/atheletebridge/components/registration/entryRules.d.ts +23 -0
  19. package/dist/atheletebridge/components/registration/entryRules.d.ts.map +1 -0
  20. package/dist/atheletebridge/components/registration/entryRules.js +29 -0
  21. package/dist/atheletebridge/components/registration/entryRules.js.map +1 -0
  22. package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts +6 -2
  23. package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts.map +1 -1
  24. package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +297 -281
  25. package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
  26. package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +54 -0
  27. package/dist/atheletebridge/hooks/useRegistrationApi.d.ts.map +1 -0
  28. package/dist/atheletebridge/hooks/useRegistrationApi.js +265 -0
  29. package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -0
  30. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts.map +1 -1
  31. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +123 -416
  32. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
  33. package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts +10 -0
  34. package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts.map +1 -0
  35. package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js +89 -0
  36. package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js.map +1 -0
  37. package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.d.ts +10 -0
  38. package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.d.ts.map +1 -0
  39. package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.js +94 -0
  40. package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.js.map +1 -0
  41. package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts +11 -0
  42. package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts.map +1 -0
  43. package/dist/atheletebridge/pages/registrations/RegisterPage.js +160 -0
  44. package/dist/atheletebridge/pages/registrations/RegisterPage.js.map +1 -0
  45. package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.d.ts +10 -0
  46. package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.d.ts.map +1 -0
  47. package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +602 -0
  48. package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -0
  49. package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.d.ts +9 -0
  50. package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.d.ts.map +1 -0
  51. package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +317 -0
  52. package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -0
  53. package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts +9 -0
  54. package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts.map +1 -0
  55. package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js +127 -0
  56. package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js.map +1 -0
  57. package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts +11 -0
  58. package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts.map +1 -0
  59. package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +411 -0
  60. package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -0
  61. package/dist/atheletebridge/types/registration.d.ts +220 -0
  62. package/dist/atheletebridge/types/registration.d.ts.map +1 -0
  63. package/dist/atheletebridge/utils/fixtureCapabilities.d.ts +19 -0
  64. package/dist/atheletebridge/utils/fixtureCapabilities.d.ts.map +1 -0
  65. package/dist/atheletebridge/utils/fixtureCapabilities.js +21 -0
  66. package/dist/atheletebridge/utils/fixtureCapabilities.js.map +1 -0
  67. package/dist/atheletebridge/utils/money.d.ts +22 -0
  68. package/dist/atheletebridge/utils/money.d.ts.map +1 -0
  69. package/dist/atheletebridge/utils/money.js +38 -0
  70. package/dist/atheletebridge/utils/money.js.map +1 -0
  71. package/dist/atheletebridge/utils/registration.d.ts +17 -0
  72. package/dist/atheletebridge/utils/registration.d.ts.map +1 -0
  73. package/dist/atheletebridge/utils/registration.js +25 -0
  74. package/dist/atheletebridge/utils/registration.js.map +1 -0
  75. package/package.json +1 -1
@@ -1,10 +1,11 @@
1
1
  import { useAthleteBridge as e } from "../context/AthleteBridgeContext.js";
2
2
  import "../context/index.js";
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";
3
+ import { fixtureOutcomeSelection as t, normalizeFixture as n, normalizeFixtureOrNull as r } from "../utils/fixtureCapabilities.js";
4
+ import { useCallback as i, useMemo as a } from "react";
5
+ import { useMutation as o, useQuery as s, useQueryClient as c } from "@tanstack/react-query";
6
+ import { clearGraphqlFetchResponseCache as l, graphqlFetch as u } from "@burdenoff/fe-libs/shared/graphql";
6
7
  //#region src/atheletebridge/hooks/useAthleteBridgeApi.ts
7
- var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
8
+ var d = "AI_PROVIDER_UNAVAILABLE", f = class extends Error {
8
9
  code;
9
10
  agentRunId;
10
11
  constructor(e, t) {
@@ -12,8 +13,8 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
12
13
  let n = t?.code, r = t?.agentRunId;
13
14
  this.code = typeof n == "string" && n ? n : null, this.agentRunId = typeof r == "string" && r ? r : null;
14
15
  }
15
- }, u = async (e, t, n) => {
16
- let r = await s({
16
+ }, p = async (e, t, n) => {
17
+ let r = await u({
17
18
  gateway: "workspace",
18
19
  baseUrl: n,
19
20
  query: e,
@@ -22,12 +23,12 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
22
23
  });
23
24
  if (r.errors?.length) {
24
25
  let e = r.errors[0];
25
- throw new l(e?.message ?? "GraphQL request failed", e?.extensions);
26
+ throw new f(e?.message ?? "GraphQL request failed", e?.extensions);
26
27
  }
27
- if (!r.data) throw new l("GraphQL response did not include data");
28
- return e.trimStart().startsWith("mutation") && o(), r.data;
29
- }, d = async (e, t) => {
30
- let n = await s({
28
+ if (!r.data) throw new f("GraphQL response did not include data");
29
+ return e.trimStart().startsWith("mutation") && l(), r.data;
30
+ }, m = async (e, t) => {
31
+ let n = await u({
31
32
  gateway: "global",
32
33
  query: e,
33
34
  variables: t,
@@ -35,32 +36,32 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
35
36
  });
36
37
  if (n.errors?.length) {
37
38
  let e = n.errors[0];
38
- throw new l(e?.message ?? "GraphQL request failed", e?.extensions);
39
+ throw new f(e?.message ?? "GraphQL request failed", e?.extensions);
39
40
  }
40
- if (!n.data) throw new l("GraphQL response did not include data");
41
+ if (!n.data) throw new f("GraphQL response did not include data");
41
42
  return n.data;
42
- }, f = "\n id workspaceId name sport status description ageGroup season homeVenue\n headCoachId tags createdAt updatedAt\n", p = "\n id workspaceId teamId userId displayName role status position jerseyNumber\n height weight dominantSide notes joinedAt createdAt updatedAt\n", m = "\n runs wickets overs balls extras\n", h = `
43
+ }, h = "\n id workspaceId name sport status description ageGroup season homeVenue\n headCoachId tags createdAt updatedAt\n", g = "\n id workspaceId teamId userId displayName role status position jerseyNumber\n height weight dominantSide notes joinedAt createdAt updatedAt\n", _ = "\n runs wickets overs balls extras\n", v = `
43
44
  id workspaceId type status competition round venue homeTeamId awayTeamId
44
- homeScore awayScore extraTimeHomeScore extraTimeAwayScore penaltyHomeScore penaltyAwayScore
45
- cricketScorecard { ${`
46
- homeInnings { ${m} }
47
- awayInnings { ${m} }
45
+ homeScore awayScore
46
+ ${t(`
47
+ homeInnings { ${_} }
48
+ awayInnings { ${_} }
48
49
  winner decidedBy margin superOver dls
49
- `} }
50
+ `)}
50
51
  scheduledAt kickoffAt notes createdAt updatedAt
51
52
  homeTeam { id name sport }
52
53
  awayTeam { id name sport }
53
- `, g = "\n id workspaceId competition teamId played won drawn lost goalsFor goalsAgainst\n points rank createdAt updatedAt\n team { id name sport }\n", _ = "\n id workspaceId programId name description weekNumber orderIndex sets reps\n durationSec restSec createdAt updatedAt\n video { id }\n", v = "\n id workspaceId coachId name sport level status summary weeks isTemplate tags\n createdAt updatedAt\n", y = "\n id workspaceId coachId athleteId programId title type status location\n meetingUrl scheduledAt durationMin completedAt feedback rating\n createdAt updatedAt\n", b = "\n id workspaceId athleteId programId title status performedAt durationMin rpe\n totalLoad metrics notes createdAt updatedAt\n", x = "\n id workspaceId athleteId type label value unit source recordedAt\n createdAt updatedAt\n", S = (t = {}) => {
54
+ `, y = "\n id workspaceId competition teamId played won drawn lost goalsFor goalsAgainst\n points rank createdAt updatedAt\n team { id name sport }\n", b = "\n id workspaceId programId name description weekNumber orderIndex sets reps\n durationSec restSec createdAt updatedAt\n video { id }\n", x = "\n id workspaceId coachId name sport level status summary weeks isTemplate tags\n createdAt updatedAt\n", S = "\n id workspaceId coachId athleteId programId title type status location\n meetingUrl scheduledAt durationMin completedAt feedback rating\n createdAt updatedAt\n", C = "\n id workspaceId athleteId programId title status performedAt durationMin rpe\n totalLoad metrics notes createdAt updatedAt\n", w = "\n id workspaceId athleteId type label value unit source recordedAt\n createdAt updatedAt\n", T = (t = {}) => {
54
55
  let { apiGatewayUrl: n } = e();
55
- return i({
56
+ return s({
56
57
  queryKey: [
57
58
  "atheletebridge",
58
59
  "teams",
59
60
  t
60
61
  ],
61
- queryFn: async () => (await u(`query AthListTeams($sport: AthSport, $status: AthTeamStatus, $pagination: PaginationInput) {
62
+ queryFn: async () => (await p(`query AthListTeams($sport: AthSport, $status: AthTeamStatus, $pagination: PaginationInput) {
62
63
  athListTeams(sport: $sport, status: $status, pagination: $pagination) {
63
- items { ${f} members { items { id } } }
64
+ items { ${h} members { items { id } } }
64
65
  pageInfo { cursor hasMore }
65
66
  }
66
67
  }`, {
@@ -69,55 +70,64 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
69
70
  pagination: t.pagination
70
71
  }, n)).athListTeams
71
72
  });
72
- }, C = (t) => {
73
- let { apiGatewayUrl: n } = e();
74
- return i({
73
+ }, E = (t) => {
74
+ let { apiGatewayUrl: r } = e();
75
+ return s({
75
76
  queryKey: [
76
77
  "atheletebridge",
77
78
  "team",
78
79
  t
79
80
  ],
80
- queryFn: async () => (await u(`query AthTeam($id: ID!) {
81
+ queryFn: async () => {
82
+ let e = (await p(`query AthTeam($id: ID!) {
81
83
  athTeam(id: $id) {
82
- ${f}
83
- members { items { ${p} } }
84
- fixtures { items { ${h} } }
84
+ ${h}
85
+ members { items { ${g} } }
86
+ fixtures { items { ${v} } }
85
87
  }
86
- }`, { id: t }, n)).athTeam,
88
+ }`, { id: t }, r)).athTeam;
89
+ return e?.fixtures ? {
90
+ ...e,
91
+ fixtures: {
92
+ ...e.fixtures,
93
+ items: e.fixtures.items.map(n)
94
+ }
95
+ } : e;
96
+ },
87
97
  enabled: !!t
88
98
  });
89
- }, w = (t, n) => {
99
+ }, D = (t, n) => {
90
100
  let { apiGatewayUrl: r } = e();
91
- return i({
101
+ return s({
92
102
  queryKey: [
93
103
  "atheletebridge",
94
104
  "members",
95
105
  t,
96
106
  n
97
107
  ],
98
- queryFn: async () => (await u(`query AthListMembers($teamId: ID!, $status: AthMemberStatus) {
99
- athListMembers(teamId: $teamId, status: $status) { items { ${p} } }
108
+ queryFn: async () => (await p(`query AthListMembers($teamId: ID!, $status: AthMemberStatus) {
109
+ athListMembers(teamId: $teamId, status: $status) { items { ${g} } }
100
110
  }`, {
101
111
  teamId: t,
102
112
  status: n
103
113
  }, r)).athListMembers.items,
104
114
  enabled: !!t
105
115
  });
106
- }, T = () => {
107
- let t = a(), { apiGatewayUrl: n } = e();
108
- return r({
109
- mutationFn: async (e) => (await u(`mutation AthCreateTeam($input: AthCreateTeamInput!) {
110
- athCreateTeam(input: $input) { ${f} }
116
+ }, O = () => {
117
+ let t = c(), { apiGatewayUrl: n } = e();
118
+ return o({
119
+ mutationFn: async (e) => (await p(`mutation AthCreateTeam($input: AthCreateTeamInput!) {
120
+ athCreateTeam(input: $input) { ${h} }
111
121
  }`, { input: e }, n)).athCreateTeam,
112
122
  onSuccess: () => {
113
123
  t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
114
124
  }
115
125
  });
116
- }, E = () => {
117
- let t = a(), { apiGatewayUrl: n } = e();
118
- return r({
119
- mutationFn: async ({ id: e, input: t }) => (await u(`mutation AthUpdateTeam($id: ID!, $input: AthUpdateTeamInput!) {
120
- athUpdateTeam(id: $id, input: $input) { ${f} }
126
+ }, k = () => {
127
+ let t = c(), { apiGatewayUrl: n } = e();
128
+ return o({
129
+ mutationFn: async ({ id: e, input: t }) => (await p(`mutation AthUpdateTeam($id: ID!, $input: AthUpdateTeamInput!) {
130
+ athUpdateTeam(id: $id, input: $input) { ${h} }
121
131
  }`, {
122
132
  id: e,
123
133
  input: t
@@ -130,19 +140,19 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
130
140
  ] });
131
141
  }
132
142
  });
133
- }, D = () => {
134
- let t = a(), { apiGatewayUrl: n } = e();
135
- return r({
136
- mutationFn: async (e) => (await u("mutation AthArchiveTeam($id: ID!) { athArchiveTeam(id: $id) }", { id: e }, n)).athArchiveTeam,
143
+ }, A = () => {
144
+ let t = c(), { apiGatewayUrl: n } = e();
145
+ return o({
146
+ mutationFn: async (e) => (await p("mutation AthArchiveTeam($id: ID!) { athArchiveTeam(id: $id) }", { id: e }, n)).athArchiveTeam,
137
147
  onSuccess: () => {
138
148
  t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
139
149
  }
140
150
  });
141
- }, O = () => {
142
- let t = a(), { apiGatewayUrl: n } = e();
143
- return r({
144
- mutationFn: async (e) => (await u(`mutation AthAddMember($input: AthAddMemberInput!) {
145
- athAddMember(input: $input) { ${p} }
151
+ }, j = () => {
152
+ let t = c(), { apiGatewayUrl: n } = e();
153
+ return o({
154
+ mutationFn: async (e) => (await p(`mutation AthAddMember($input: AthAddMemberInput!) {
155
+ athAddMember(input: $input) { ${g} }
146
156
  }`, { input: e }, n)).athAddMember,
147
157
  onSuccess: (e) => {
148
158
  t.invalidateQueries({ queryKey: [
@@ -156,10 +166,10 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
156
166
  ] });
157
167
  }
158
168
  });
159
- }, k = (t) => {
160
- let n = a(), { apiGatewayUrl: i } = e();
161
- return r({
162
- mutationFn: async (e) => (await u("mutation AthRemoveMember($id: ID!) { athRemoveMember(id: $id) }", { id: e }, i)).athRemoveMember,
169
+ }, M = (t) => {
170
+ let n = c(), { apiGatewayUrl: r } = e();
171
+ return o({
172
+ mutationFn: async (e) => (await p("mutation AthRemoveMember($id: ID!) { athRemoveMember(id: $id) }", { id: e }, r)).athRemoveMember,
163
173
  onSuccess: () => {
164
174
  n.invalidateQueries({ queryKey: [
165
175
  "atheletebridge",
@@ -172,70 +182,76 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
172
182
  ] });
173
183
  }
174
184
  });
175
- }, A = (t = {}) => {
176
- let { apiGatewayUrl: n } = e();
177
- return i({
185
+ }, N = (t = {}) => {
186
+ let { apiGatewayUrl: r } = e();
187
+ return s({
178
188
  queryKey: [
179
189
  "atheletebridge",
180
190
  "fixtures",
181
191
  t
182
192
  ],
183
- queryFn: async () => (await u(`query AthListFixtures($status: AthFixtureStatus, $teamId: ID, $pagination: PaginationInput) {
193
+ queryFn: async () => {
194
+ let e = await p(`query AthListFixtures($status: AthFixtureStatus, $teamId: ID, $pagination: PaginationInput) {
184
195
  athListFixtures(status: $status, teamId: $teamId, pagination: $pagination) {
185
- items { ${h} }
196
+ items { ${v} }
186
197
  pageInfo { cursor hasMore }
187
198
  }
188
199
  }`, {
189
- status: t.status,
190
- teamId: t.teamId,
191
- pagination: t.pagination
192
- }, n)).athListFixtures
200
+ status: t.status,
201
+ teamId: t.teamId,
202
+ pagination: t.pagination
203
+ }, r);
204
+ return {
205
+ ...e.athListFixtures,
206
+ items: e.athListFixtures.items.map(n)
207
+ };
208
+ }
193
209
  });
194
- }, j = (t) => {
210
+ }, P = (t) => {
195
211
  let { apiGatewayUrl: n } = e();
196
- return i({
212
+ return s({
197
213
  queryKey: [
198
214
  "atheletebridge",
199
215
  "fixture",
200
216
  t
201
217
  ],
202
- queryFn: async () => (await u(`query AthFixture($id: ID!) {
203
- athFixture(id: $id) { ${h} }
204
- }`, { id: t }, n)).athFixture,
218
+ queryFn: async () => r((await p(`query AthFixture($id: ID!) {
219
+ athFixture(id: $id) { ${v} }
220
+ }`, { id: t }, n)).athFixture),
205
221
  enabled: !!t
206
222
  });
207
- }, M = (t) => {
223
+ }, F = (t) => {
208
224
  let { apiGatewayUrl: n } = e();
209
- return i({
225
+ return s({
210
226
  queryKey: [
211
227
  "atheletebridge",
212
228
  "standings",
213
229
  t
214
230
  ],
215
- queryFn: async () => (await u(`query AthStandings($competition: String!) {
216
- athStandings(competition: $competition) { items { ${g} } }
231
+ queryFn: async () => (await p(`query AthStandings($competition: String!) {
232
+ athStandings(competition: $competition) { items { ${y} } }
217
233
  }`, { competition: t }, n)).athStandings.items,
218
234
  enabled: !!t
219
235
  });
220
- }, ee = () => {
221
- let t = a(), { apiGatewayUrl: n } = e();
222
- return r({
223
- mutationFn: async (e) => (await u(`mutation AthScheduleFixture($input: AthCreateFixtureInput!) {
224
- athScheduleFixture(input: $input) { ${h} }
225
- }`, { input: e }, n)).athScheduleFixture,
236
+ }, I = () => {
237
+ let t = c(), { apiGatewayUrl: r } = e();
238
+ return o({
239
+ mutationFn: async (e) => n((await p(`mutation AthScheduleFixture($input: AthCreateFixtureInput!) {
240
+ athScheduleFixture(input: $input) { ${v} }
241
+ }`, { input: e }, r)).athScheduleFixture),
226
242
  onSuccess: () => {
227
243
  t.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] });
228
244
  }
229
245
  });
230
- }, N = () => {
231
- let t = a(), { apiGatewayUrl: n } = e();
232
- return r({
233
- mutationFn: async ({ id: e, input: t }) => (await u(`mutation AthRecordFixtureResult($id: ID!, $input: AthRecordResultInput!) {
234
- athRecordFixtureResult(id: $id, input: $input) { ${h} }
246
+ }, L = () => {
247
+ let t = c(), { apiGatewayUrl: r } = e();
248
+ return o({
249
+ mutationFn: async ({ id: e, input: t }) => n((await p(`mutation AthRecordFixtureResult($id: ID!, $input: AthRecordResultInput!) {
250
+ athRecordFixtureResult(id: $id, input: $input) { ${v} }
235
251
  }`, {
236
252
  id: e,
237
253
  input: t
238
- }, n)).athRecordFixtureResult,
254
+ }, r)).athRecordFixtureResult),
239
255
  onSuccess: (e) => {
240
256
  t.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] }), t.invalidateQueries({ queryKey: [
241
257
  "atheletebridge",
@@ -244,17 +260,17 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
244
260
  ] }), t.invalidateQueries({ queryKey: ["atheletebridge", "standings"] });
245
261
  }
246
262
  });
247
- }, P = (t = {}) => {
263
+ }, ee = (t = {}) => {
248
264
  let { apiGatewayUrl: n } = e();
249
- return i({
265
+ return s({
250
266
  queryKey: [
251
267
  "atheletebridge",
252
268
  "programs",
253
269
  t
254
270
  ],
255
- queryFn: async () => (await u(`query AthListPrograms($sport: AthSport, $level: AthProgramLevel, $status: AthProgramStatus, $pagination: PaginationInput) {
271
+ queryFn: async () => (await p(`query AthListPrograms($sport: AthSport, $level: AthProgramLevel, $status: AthProgramStatus, $pagination: PaginationInput) {
256
272
  athListPrograms(sport: $sport, level: $level, status: $status, pagination: $pagination) {
257
- items { ${v} drills { items { id } } }
273
+ items { ${x} drills { items { id } } }
258
274
  pageInfo { cursor hasMore }
259
275
  }
260
276
  }`, {
@@ -264,37 +280,37 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
264
280
  pagination: t.pagination
265
281
  }, n)).athListPrograms
266
282
  });
267
- }, F = (t) => {
283
+ }, te = (t) => {
268
284
  let { apiGatewayUrl: n } = e();
269
- return i({
285
+ return s({
270
286
  queryKey: [
271
287
  "atheletebridge",
272
288
  "program",
273
289
  t
274
290
  ],
275
- queryFn: async () => (await u(`query AthProgram($id: ID!) {
291
+ queryFn: async () => (await p(`query AthProgram($id: ID!) {
276
292
  athProgram(id: $id) {
277
- ${v}
278
- drills { items { ${_} } }
293
+ ${x}
294
+ drills { items { ${b} } }
279
295
  }
280
296
  }`, { id: t }, n)).athProgram,
281
297
  enabled: !!t
282
298
  });
283
- }, te = () => {
284
- let t = a(), { apiGatewayUrl: n } = e();
285
- return r({
286
- mutationFn: async (e) => (await u(`mutation AthCreateProgram($input: AthCreateProgramInput!) {
287
- athCreateProgram(input: $input) { ${v} }
299
+ }, ne = () => {
300
+ let t = c(), { apiGatewayUrl: n } = e();
301
+ return o({
302
+ mutationFn: async (e) => (await p(`mutation AthCreateProgram($input: AthCreateProgramInput!) {
303
+ athCreateProgram(input: $input) { ${x} }
288
304
  }`, { input: e }, n)).athCreateProgram,
289
305
  onSuccess: () => {
290
306
  t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
291
307
  }
292
308
  });
293
- }, ne = () => {
294
- let t = a(), { apiGatewayUrl: n } = e();
295
- return r({
296
- mutationFn: async ({ id: e, input: t }) => (await u(`mutation AthUpdateProgram($id: ID!, $input: AthUpdateProgramInput!) {
297
- athUpdateProgram(id: $id, input: $input) { ${v} }
309
+ }, re = () => {
310
+ let t = c(), { apiGatewayUrl: n } = e();
311
+ return o({
312
+ mutationFn: async ({ id: e, input: t }) => (await p(`mutation AthUpdateProgram($id: ID!, $input: AthUpdateProgramInput!) {
313
+ athUpdateProgram(id: $id, input: $input) { ${x} }
298
314
  }`, {
299
315
  id: e,
300
316
  input: t
@@ -307,11 +323,11 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
307
323
  ] });
308
324
  }
309
325
  });
310
- }, re = () => {
311
- let t = a(), { apiGatewayUrl: n } = e();
312
- return r({
313
- mutationFn: async ({ id: e, status: t }) => (await u(`mutation AthTransitionProgram($id: ID!, $status: AthProgramStatus!) {
314
- athTransitionProgram(id: $id, status: $status) { ${v} }
326
+ }, ie = () => {
327
+ let t = c(), { apiGatewayUrl: n } = e();
328
+ return o({
329
+ mutationFn: async ({ id: e, status: t }) => (await p(`mutation AthTransitionProgram($id: ID!, $status: AthProgramStatus!) {
330
+ athTransitionProgram(id: $id, status: $status) { ${x} }
315
331
  }`, {
316
332
  id: e,
317
333
  status: t
@@ -324,19 +340,19 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
324
340
  ] });
325
341
  }
326
342
  });
327
- }, ie = () => {
328
- let t = a(), { apiGatewayUrl: n } = e();
329
- return r({
330
- mutationFn: async (e) => (await u("mutation AthArchiveProgram($id: ID!) { athArchiveProgram(id: $id) }", { id: e }, n)).athArchiveProgram,
343
+ }, ae = () => {
344
+ let t = c(), { apiGatewayUrl: n } = e();
345
+ return o({
346
+ mutationFn: async (e) => (await p("mutation AthArchiveProgram($id: ID!) { athArchiveProgram(id: $id) }", { id: e }, n)).athArchiveProgram,
331
347
  onSuccess: () => {
332
348
  t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
333
349
  }
334
350
  });
335
- }, ae = () => {
336
- let t = a(), { apiGatewayUrl: n } = e();
337
- return r({
338
- mutationFn: async (e) => (await u(`mutation AthAddDrill($input: AthAddDrillInput!) {
339
- athAddDrill(input: $input) { ${_} }
351
+ }, oe = () => {
352
+ let t = c(), { apiGatewayUrl: n } = e();
353
+ return o({
354
+ mutationFn: async (e) => (await p(`mutation AthAddDrill($input: AthAddDrillInput!) {
355
+ athAddDrill(input: $input) { ${b} }
340
356
  }`, { input: e }, n)).athAddDrill,
341
357
  onSuccess: (e) => {
342
358
  t.invalidateQueries({ queryKey: [
@@ -346,10 +362,10 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
346
362
  ] });
347
363
  }
348
364
  });
349
- }, oe = (t) => {
350
- let n = a(), { apiGatewayUrl: i } = e();
351
- return r({
352
- mutationFn: async (e) => (await u("mutation AthRemoveDrill($id: ID!) { athRemoveDrill(id: $id) }", { id: e }, i)).athRemoveDrill,
365
+ }, se = (t) => {
366
+ let n = c(), { apiGatewayUrl: r } = e();
367
+ return o({
368
+ mutationFn: async (e) => (await p("mutation AthRemoveDrill($id: ID!) { athRemoveDrill(id: $id) }", { id: e }, r)).athRemoveDrill,
353
369
  onSuccess: () => {
354
370
  n.invalidateQueries({ queryKey: [
355
371
  "atheletebridge",
@@ -358,17 +374,17 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
358
374
  ] });
359
375
  }
360
376
  });
361
- }, I = (t = {}) => {
377
+ }, R = (t = {}) => {
362
378
  let { apiGatewayUrl: n } = e();
363
- return i({
379
+ return s({
364
380
  queryKey: [
365
381
  "atheletebridge",
366
382
  "sessions",
367
383
  t
368
384
  ],
369
- queryFn: async () => (await u(`query AthListSessions($athleteId: ID, $coachId: ID, $status: AthSessionStatus, $pagination: PaginationInput) {
385
+ queryFn: async () => (await p(`query AthListSessions($athleteId: ID, $coachId: ID, $status: AthSessionStatus, $pagination: PaginationInput) {
370
386
  athListSessions(athleteId: $athleteId, coachId: $coachId, status: $status, pagination: $pagination) {
371
- items { ${y} }
387
+ items { ${S} }
372
388
  pageInfo { cursor hasMore }
373
389
  }
374
390
  }`, {
@@ -378,34 +394,34 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
378
394
  pagination: t.pagination
379
395
  }, n)).athListSessions
380
396
  });
381
- }, L = (t) => {
397
+ }, z = (t) => {
382
398
  let { apiGatewayUrl: n } = e();
383
- return i({
399
+ return s({
384
400
  queryKey: [
385
401
  "atheletebridge",
386
402
  "session",
387
403
  t
388
404
  ],
389
- queryFn: async () => (await u(`query AthSession($id: ID!) {
390
- athSession(id: $id) { ${y} }
405
+ queryFn: async () => (await p(`query AthSession($id: ID!) {
406
+ athSession(id: $id) { ${S} }
391
407
  }`, { id: t }, n)).athSession,
392
408
  enabled: !!t
393
409
  });
394
- }, R = () => {
395
- let t = a(), { apiGatewayUrl: n } = e();
396
- return r({
397
- mutationFn: async (e) => (await u(`mutation AthBookSession($input: AthBookSessionInput!) {
398
- athBookSession(input: $input) { ${y} }
410
+ }, B = () => {
411
+ let t = c(), { apiGatewayUrl: n } = e();
412
+ return o({
413
+ mutationFn: async (e) => (await p(`mutation AthBookSession($input: AthBookSessionInput!) {
414
+ athBookSession(input: $input) { ${S} }
399
415
  }`, { input: e }, n)).athBookSession,
400
416
  onSuccess: () => {
401
417
  t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] });
402
418
  }
403
419
  });
404
- }, z = () => {
405
- let t = a(), { apiGatewayUrl: n } = e();
406
- return r({
407
- mutationFn: async (e) => (await u(`mutation AthConfirmSession($id: ID!) {
408
- athConfirmSession(id: $id) { ${y} }
420
+ }, V = () => {
421
+ let t = c(), { apiGatewayUrl: n } = e();
422
+ return o({
423
+ mutationFn: async (e) => (await p(`mutation AthConfirmSession($id: ID!) {
424
+ athConfirmSession(id: $id) { ${S} }
409
425
  }`, { id: e }, n)).athConfirmSession,
410
426
  onSuccess: (e) => {
411
427
  t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
@@ -415,11 +431,11 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
415
431
  ] });
416
432
  }
417
433
  });
418
- }, B = () => {
419
- let t = a(), { apiGatewayUrl: n } = e();
420
- return r({
421
- mutationFn: async ({ id: e, input: t }) => (await u(`mutation AthCompleteSession($id: ID!, $input: AthCompleteSessionInput) {
422
- athCompleteSession(id: $id, input: $input) { ${y} }
434
+ }, H = () => {
435
+ let t = c(), { apiGatewayUrl: n } = e();
436
+ return o({
437
+ mutationFn: async ({ id: e, input: t }) => (await p(`mutation AthCompleteSession($id: ID!, $input: AthCompleteSessionInput) {
438
+ athCompleteSession(id: $id, input: $input) { ${S} }
423
439
  }`, {
424
440
  id: e,
425
441
  input: t
@@ -432,11 +448,11 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
432
448
  ] });
433
449
  }
434
450
  });
435
- }, V = () => {
436
- let t = a(), { apiGatewayUrl: n } = e();
437
- return r({
438
- mutationFn: async (e) => (await u(`mutation AthCancelSession($id: ID!) {
439
- athCancelSession(id: $id) { ${y} }
451
+ }, U = () => {
452
+ let t = c(), { apiGatewayUrl: n } = e();
453
+ return o({
454
+ mutationFn: async (e) => (await p(`mutation AthCancelSession($id: ID!) {
455
+ athCancelSession(id: $id) { ${S} }
440
456
  }`, { id: e }, n)).athCancelSession,
441
457
  onSuccess: (e) => {
442
458
  t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
@@ -446,17 +462,17 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
446
462
  ] });
447
463
  }
448
464
  });
449
- }, H = (t = {}) => {
465
+ }, W = (t = {}) => {
450
466
  let { apiGatewayUrl: n } = e();
451
- return i({
467
+ return s({
452
468
  queryKey: [
453
469
  "atheletebridge",
454
470
  "workout-logs",
455
471
  t
456
472
  ],
457
- queryFn: async () => (await u(`query AthListWorkoutLogs($athleteId: ID, $programId: ID, $pagination: PaginationInput) {
473
+ queryFn: async () => (await p(`query AthListWorkoutLogs($athleteId: ID, $programId: ID, $pagination: PaginationInput) {
458
474
  athListWorkoutLogs(athleteId: $athleteId, programId: $programId, pagination: $pagination) {
459
- items { ${b} }
475
+ items { ${C} }
460
476
  pageInfo { cursor hasMore }
461
477
  }
462
478
  }`, {
@@ -465,18 +481,18 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
465
481
  pagination: t.pagination
466
482
  }, n)).athListWorkoutLogs
467
483
  });
468
- }, U = (t, n) => {
484
+ }, G = (t, n) => {
469
485
  let { apiGatewayUrl: r } = e();
470
- return i({
486
+ return s({
471
487
  queryKey: [
472
488
  "atheletebridge",
473
489
  "metrics",
474
490
  t,
475
491
  n ?? null
476
492
  ],
477
- queryFn: async () => (await u(`query AthPerformanceMetrics($athleteId: ID!, $pagination: PaginationInput) {
493
+ queryFn: async () => (await p(`query AthPerformanceMetrics($athleteId: ID!, $pagination: PaginationInput) {
478
494
  athPerformanceMetrics(athleteId: $athleteId, pagination: $pagination) {
479
- items { ${x} }
495
+ items { ${w} }
480
496
  }
481
497
  }`, {
482
498
  athleteId: t,
@@ -484,51 +500,51 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
484
500
  }, r)).athPerformanceMetrics.items,
485
501
  enabled: !!t
486
502
  });
487
- }, W = () => {
488
- let t = a(), { apiGatewayUrl: n } = e();
489
- return r({
490
- mutationFn: async (e) => (await u(`mutation AthLogWorkout($input: AthLogWorkoutInput!) {
491
- athLogWorkout(input: $input) { ${b} }
503
+ }, K = () => {
504
+ let t = c(), { apiGatewayUrl: n } = e();
505
+ return o({
506
+ mutationFn: async (e) => (await p(`mutation AthLogWorkout($input: AthLogWorkoutInput!) {
507
+ athLogWorkout(input: $input) { ${C} }
492
508
  }`, { input: e }, n)).athLogWorkout,
493
509
  onSuccess: () => {
494
510
  t.invalidateQueries({ queryKey: ["atheletebridge", "workout-logs"] });
495
511
  }
496
512
  });
497
- }, G = () => {
498
- let t = a(), { apiGatewayUrl: n } = e();
499
- return r({
500
- mutationFn: async (e) => (await u(`mutation AthRecordMetric($input: AthRecordMetricInput!) {
501
- athRecordMetric(input: $input) { ${x} }
513
+ }, ce = () => {
514
+ let t = c(), { apiGatewayUrl: n } = e();
515
+ return o({
516
+ mutationFn: async (e) => (await p(`mutation AthRecordMetric($input: AthRecordMetricInput!) {
517
+ athRecordMetric(input: $input) { ${w} }
502
518
  }`, { input: e }, n)).athRecordMetric,
503
519
  onSuccess: () => {
504
520
  t.invalidateQueries({ queryKey: ["atheletebridge", "metrics"] });
505
521
  }
506
522
  });
507
- }, K = "\n id workspaceId memberId fixtureId sessionId response respondedAt note\n createdAt updatedAt\n member { id displayName role }\n", q = (t) => {
508
- let { apiGatewayUrl: n } = e(), { fixtureId: r, sessionId: a } = t;
509
- return i({
523
+ }, q = "\n id workspaceId memberId fixtureId sessionId response respondedAt note\n createdAt updatedAt\n member { id displayName role }\n", le = (t) => {
524
+ let { apiGatewayUrl: n } = e(), { fixtureId: r, sessionId: i } = t;
525
+ return s({
510
526
  queryKey: [
511
527
  "atheletebridge",
512
528
  "availability",
513
529
  r ?? null,
514
- a ?? null
530
+ i ?? null
515
531
  ],
516
- queryFn: async () => (await u(`query AthListAvailability($fixtureId: ID, $sessionId: ID) {
532
+ queryFn: async () => (await p(`query AthListAvailability($fixtureId: ID, $sessionId: ID) {
517
533
  athListAvailability(fixtureId: $fixtureId, sessionId: $sessionId) {
518
- items { ${K} }
534
+ items { ${q} }
519
535
  pageInfo { cursor hasMore }
520
536
  }
521
537
  }`, {
522
538
  fixtureId: r,
523
- sessionId: a
539
+ sessionId: i
524
540
  }, n)).athListAvailability.items,
525
- enabled: !!(r || a)
541
+ enabled: !!(r || i)
526
542
  });
527
- }, se = () => {
528
- let t = a(), { apiGatewayUrl: n } = e();
529
- return r({
530
- mutationFn: async (e) => (await u(`mutation AthSetAvailability($input: AthSetAvailabilityInput!) {
531
- athSetAvailability(input: $input) { ${K} }
543
+ }, ue = () => {
544
+ let t = c(), { apiGatewayUrl: n } = e();
545
+ return o({
546
+ mutationFn: async (e) => (await p(`mutation AthSetAvailability($input: AthSetAvailabilityInput!) {
547
+ athSetAvailability(input: $input) { ${q} }
532
548
  }`, { input: e }, n)).athSetAvailability,
533
549
  onSuccess: (e) => {
534
550
  t.invalidateQueries({ queryKey: [
@@ -539,22 +555,22 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
539
555
  ] });
540
556
  }
541
557
  });
542
- }, ce = () => {
558
+ }, de = () => {
543
559
  let { apiGatewayUrl: t } = e();
544
- return r({ mutationFn: async (e) => (await u("mutation AthRemindAvailability($fixtureId: ID, $sessionId: ID) {\n athRemindAvailability(fixtureId: $fixtureId, sessionId: $sessionId)\n }", e, t)).athRemindAvailability });
545
- }, le = (e) => {
560
+ return o({ mutationFn: async (e) => (await p("mutation AthRemindAvailability($fixtureId: ID, $sessionId: ID) {\n athRemindAvailability(fixtureId: $fixtureId, sessionId: $sessionId)\n }", e, t)).athRemindAvailability });
561
+ }, fe = (e) => {
546
562
  let t = e.lastIndexOf(".");
547
563
  return t >= 0 ? e.slice(t + 1).toLowerCase() : "bin";
548
- }, ue = () => {
549
- let { apiGatewayUrl: n } = e();
550
- return t(async (e) => {
551
- let t = await u("mutation AthInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) { uploadUrl session { id } }\n }", { input: {
564
+ }, pe = () => {
565
+ let { apiGatewayUrl: t } = e();
566
+ return i(async (e) => {
567
+ let n = await p("mutation AthInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) { uploadUrl session { id } }\n }", { input: {
552
568
  fileName: e.name,
553
- extension: le(e.name),
569
+ extension: fe(e.name),
554
570
  fileSize: e.size,
555
571
  mimeType: e.type || "application/octet-stream",
556
572
  visibility: "WORKSPACE"
557
- } }, n), r = t.initiateUpload.uploadUrl, i = t.initiateUpload.session.id;
573
+ } }, t), r = n.initiateUpload.uploadUrl, i = n.initiateUpload.session.id;
558
574
  if (!r || !i) throw Error("Upload could not be initialised.");
559
575
  let a = await fetch(r, {
560
576
  method: "PUT",
@@ -562,29 +578,29 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
562
578
  headers: { "Content-Type": e.type || "application/octet-stream" }
563
579
  });
564
580
  if (!a.ok) throw Error(`Storage rejected the upload (HTTP ${a.status}).`);
565
- return (await u("mutation AthCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) { fileId }\n }", { input: { sessionId: i } }, n)).completeUpload.fileId;
566
- }, [n]);
567
- }, de = (t) => {
581
+ return (await p("mutation AthCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) { fileId }\n }", { input: { sessionId: i } }, t)).completeUpload.fileId;
582
+ }, [t]);
583
+ }, me = (t) => {
568
584
  let { apiGatewayUrl: n } = e();
569
- return i({
585
+ return s({
570
586
  queryKey: [
571
587
  "atheletebridge",
572
588
  "file",
573
589
  t
574
590
  ],
575
- queryFn: async () => (await u("query AthGetFile($id: ID!) {\n getFile(id: $id) { id name downloadUrl }\n }", { id: t }, n)).getFile,
591
+ queryFn: async () => (await p("query AthGetFile($id: ID!) {\n getFile(id: $id) { id name downloadUrl }\n }", { id: t }, n)).getFile,
576
592
  enabled: !!t,
577
593
  staleTime: 6e4
578
594
  });
579
- }, J = (e) => e.name?.trim() ? e.name.trim() : [e.firstName, e.lastName].filter(Boolean).join(" ").trim() || (e.username?.trim() ? e.username.trim() : e.email), fe = (e) => {
595
+ }, J = (e) => e.name?.trim() ? e.name.trim() : [e.firstName, e.lastName].filter(Boolean).join(" ").trim() || (e.username?.trim() ? e.username.trim() : e.email), he = (e) => {
580
596
  let t = e.trim();
581
- return i({
597
+ return s({
582
598
  queryKey: [
583
599
  "atheletebridge",
584
600
  "user-search",
585
601
  t
586
602
  ],
587
- queryFn: async () => (await d("query AthUserSearch($filter: UserFilterInput, $pagination: PaginationInput) {\n users(filter: $filter, pagination: $pagination) {\n users { id name firstName lastName email username }\n hasMore\n }\n }", {
603
+ queryFn: async () => (await m("query AthUserSearch($filter: UserFilterInput, $pagination: PaginationInput) {\n users(filter: $filter, pagination: $pagination) {\n users { id name firstName lastName email username }\n hasMore\n }\n }", {
588
604
  filter: { search: t },
589
605
  pagination: {
590
606
  limit: 8,
@@ -596,8 +612,8 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
596
612
  retry: !1
597
613
  });
598
614
  }, Y = (e) => {
599
- let t = n(() => Array.from(new Set(e.filter((e) => !!(e && e.trim())))).sort(), [e]);
600
- return i({
615
+ let t = a(() => Array.from(new Set(e.filter((e) => !!(e && e.trim())))).sort(), [e]);
616
+ return s({
601
617
  queryKey: [
602
618
  "atheletebridge",
603
619
  "users-by-id",
@@ -609,7 +625,7 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
609
625
  t.forEach((e, t) => {
610
626
  r[`id${t}`] = e;
611
627
  });
612
- let i = (await s({
628
+ let i = (await u({
613
629
  gateway: "global",
614
630
  query: `query AthUsersByIds(${e}) {\n${n}\n}`,
615
631
  variables: r,
@@ -626,7 +642,7 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
626
642
  staleTime: 5 * 6e4,
627
643
  retry: !1
628
644
  });
629
- }, pe = (e) => {
645
+ }, ge = (e) => {
630
646
  let t = Y(e), n = t.data ?? {};
631
647
  return {
632
648
  byId: n,
@@ -635,10 +651,10 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
635
651
  nameOf: (e) => e ? n[e]?.name : void 0,
636
652
  emailOf: (e) => e ? n[e]?.email : void 0
637
653
  };
638
- }, me = ({ teams: e = [], fixtures: t = [], sessions: r = [], programs: i = [], limit: a = 8 }) => n(() => {
639
- let n = [];
654
+ }, _e = ({ teams: e = [], fixtures: t = [], sessions: n = [], programs: r = [], limit: i = 8 }) => a(() => {
655
+ let a = [];
640
656
  for (let t of e) {
641
- n.push({
657
+ a.push({
642
658
  id: `team-${t.id}`,
643
659
  type: "team-created",
644
660
  title: `Team ${t.name} created`,
@@ -646,7 +662,7 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
646
662
  entityId: t.id,
647
663
  entityKind: "team"
648
664
  });
649
- for (let e of t.members?.items ?? []) n.push({
665
+ for (let e of t.members?.items ?? []) a.push({
650
666
  id: `member-${e.id}`,
651
667
  type: "member-added",
652
668
  title: `${e.displayName} added to ${t.name}`,
@@ -655,7 +671,7 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
655
671
  entityKind: "team"
656
672
  });
657
673
  }
658
- for (let e of i) e.status === "PUBLISHED" && n.push({
674
+ for (let e of r) e.status === "PUBLISHED" && a.push({
659
675
  id: `program-${e.id}`,
660
676
  type: "program-published",
661
677
  title: `${e.name} published`,
@@ -664,18 +680,18 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
664
680
  entityKind: "program"
665
681
  });
666
682
  for (let e of t) {
667
- let t = e.homeTeam?.name ?? "Home", r = e.awayTeam?.name ?? (e.awayTeamId ? "Away" : "TBD"), i = e.homeScore !== null && e.awayScore !== null;
668
- n.push({
683
+ let t = e.homeTeam?.name ?? "Home", n = e.awayTeam?.name ?? (e.awayTeamId ? "Away" : "TBD"), r = e.homeScore !== null && e.awayScore !== null;
684
+ a.push({
669
685
  id: `fixture-${e.id}`,
670
686
  type: "fixture-updated",
671
- title: i ? `${t} ${e.homeScore}–${e.awayScore} ${r}` : `Fixture ${t} vs ${r} updated`,
687
+ title: r ? `${t} ${e.homeScore}–${e.awayScore} ${n}` : `Fixture ${t} vs ${n} updated`,
672
688
  subtitle: e.competition ?? void 0,
673
689
  at: e.updatedAt,
674
690
  entityId: e.id,
675
691
  entityKind: "fixture"
676
692
  });
677
693
  }
678
- for (let e of r) e.status === "COMPLETED" && n.push({
694
+ for (let e of n) e.status === "COMPLETED" && a.push({
679
695
  id: `session-${e.id}`,
680
696
  type: "session-completed",
681
697
  title: `Session "${e.title}" completed`,
@@ -684,29 +700,29 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
684
700
  entityId: e.id,
685
701
  entityKind: "session"
686
702
  });
687
- 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);
703
+ return a.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, i);
688
704
  }, [
689
705
  e,
690
706
  t,
707
+ n,
691
708
  r,
692
- i,
693
- a
694
- ]), he = (e, t) => {
695
- let r = w(e), i = n(() => (r.data ?? []).find((e) => e.id === t) ?? null, [r.data, t]), a = i?.userId, o = U(a), s = H({
696
- athleteId: a,
709
+ i
710
+ ]), ve = (e, t) => {
711
+ let n = D(e), r = a(() => (n.data ?? []).find((e) => e.id === t) ?? null, [n.data, t]), i = r?.userId, o = G(i), s = W({
712
+ athleteId: i,
697
713
  pagination: { limit: 100 }
698
- }), c = I({
699
- athleteId: a,
714
+ }), c = R({
715
+ athleteId: i,
700
716
  pagination: { limit: 100 }
701
717
  });
702
718
  return {
703
- member: i,
704
- athleteId: a,
719
+ member: r,
720
+ athleteId: i,
705
721
  metrics: o.data ?? [],
706
722
  workouts: s.data?.items ?? [],
707
723
  sessions: c.data?.items ?? [],
708
- isLoading: r.isLoading || !!a && (o.isLoading || s.isLoading || c.isLoading),
709
- isError: r.isError || o.isError || s.isError || c.isError
724
+ isLoading: n.isLoading || !!i && (o.isLoading || s.isLoading || c.isLoading),
725
+ isError: n.isError || o.isError || s.isError || c.isError
710
726
  };
711
727
  };
712
728
  function X(e, t, n, r = 8) {
@@ -727,17 +743,17 @@ function X(e, t, n, r = 8) {
727
743
  };
728
744
  });
729
745
  }
730
- var ge = (e = {}) => {
731
- let { competition: t, sampleLimit: r = 200 } = e, i = I({ pagination: { limit: r } }), a = H({ pagination: { limit: r } }), o = A({ 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(() => {
746
+ var ye = (e = {}) => {
747
+ let { competition: t, sampleLimit: n = 200 } = e, r = R({ pagination: { limit: n } }), i = W({ pagination: { limit: n } }), o = N({ pagination: { limit: n } }), s = a(() => r.data?.items ?? [], [r.data]), c = a(() => i.data?.items ?? [], [i.data]), l = a(() => o.data?.items ?? [], [o.data]), u = a(() => {
732
748
  if (t) return t;
733
749
  let e = /* @__PURE__ */ new Map();
734
750
  for (let t of l) t.competition && e.set(t.competition, (e.get(t.competition) ?? 0) + 1);
735
751
  let n = null, r = 0;
736
752
  for (let [t, i] of e) i > r && (r = i, n = t);
737
753
  return n;
738
- }, [t, l]), d = M(u ?? void 0);
739
- return n(() => {
740
- 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 = [
754
+ }, [t, l]), d = F(u ?? void 0);
755
+ return a(() => {
756
+ let e = s.length, t = s.filter((e) => e.rating !== null), n = t.length, a = 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 = [
741
757
  "REQUESTED",
742
758
  "CONFIRMED",
743
759
  "COMPLETED",
@@ -785,11 +801,11 @@ var ge = (e = {}) => {
785
801
  workoutCount: t.workoutCount,
786
802
  loadedCount: t.loadedCount
787
803
  };
788
- }).sort((e, t) => t.acute - e.acute || t.chronic - e.chronic), A = (a.data?.pageInfo.hasMore ?? !1) && T > S, j = X(c, (e) => e.performedAt, (e) => e.totalLoad ?? 0), M = X(s, (e) => e.scheduledAt, () => 1);
804
+ }).sort((e, t) => t.acute - e.acute || t.chronic - e.chronic), A = (i.data?.pageInfo.hasMore ?? !1) && T > S, j = X(c, (e) => e.performedAt, (e) => e.totalLoad ?? 0), M = X(s, (e) => e.scheduledAt, () => 1);
789
805
  return {
790
806
  totalSessions: e,
791
807
  ratedCount: n,
792
- avgRating: r,
808
+ avgRating: a,
793
809
  completedCount: l,
794
810
  completedPct: f,
795
811
  sessionsByStatus: h,
@@ -807,43 +823,43 @@ var ge = (e = {}) => {
807
823
  sessionTrend: M,
808
824
  standings: d.data ?? [],
809
825
  competition: u,
810
- isLoading: i.isLoading || a.isLoading || o.isLoading || !!u && d.isLoading,
811
- isError: i.isError || a.isError || o.isError || d.isError
826
+ isLoading: r.isLoading || i.isLoading || o.isLoading || !!u && d.isLoading,
827
+ isError: r.isError || i.isError || o.isError || d.isError
812
828
  };
813
829
  }, [
814
830
  s,
815
831
  c,
816
- a.data,
832
+ i.data,
817
833
  u,
818
834
  d.data,
819
835
  d.isLoading,
820
836
  d.isError,
837
+ r.isLoading,
838
+ r.isError,
821
839
  i.isLoading,
822
840
  i.isError,
823
- a.isLoading,
824
- a.isError,
825
841
  o.isLoading,
826
842
  o.isError
827
843
  ]);
828
- }, Z = "\n id workspaceId actorId actorType provider model trigger status error\n promptSummary inputRefs decision tokensIn tokensOut latencyMs costUsd\n createdAt\n", Q = "\n workspaceId provider model autoPilotEnabled autoPilotLastRunAt updatedAt\n", _e = () => {
844
+ }, Z = "\n id workspaceId actorId actorType provider model trigger status error\n promptSummary inputRefs decision tokensIn tokensOut latencyMs costUsd\n createdAt\n", Q = "\n workspaceId provider model autoPilotEnabled autoPilotLastRunAt updatedAt\n", be = () => {
829
845
  let { apiGatewayUrl: t } = e();
830
- return i({
846
+ return s({
831
847
  queryKey: ["atheletebridge", "ai-model-catalog"],
832
- queryFn: async () => (await u("query AthAiModelCatalog {\n athAiModelCatalog { provider model label isDefault capabilities configured }\n }", {}, t)).athAiModelCatalog,
848
+ queryFn: async () => (await p("query AthAiModelCatalog {\n athAiModelCatalog { provider model label isDefault capabilities configured }\n }", {}, t)).athAiModelCatalog,
833
849
  staleTime: 30 * 6e4
834
850
  });
835
- }, ve = () => {
851
+ }, $ = () => {
836
852
  let { apiGatewayUrl: t } = e();
837
- return i({
853
+ return s({
838
854
  queryKey: ["atheletebridge", "ai-config"],
839
- queryFn: async () => (await u(`query AthWorkspaceAiConfig {
855
+ queryFn: async () => (await p(`query AthWorkspaceAiConfig {
840
856
  athWorkspaceAiConfig { ${Q} }
841
857
  }`, {}, t)).athWorkspaceAiConfig
842
858
  });
843
- }, ye = () => {
844
- let t = a(), { apiGatewayUrl: n } = e();
845
- return r({
846
- mutationFn: async ({ provider: e, model: t }) => (await u(`mutation AthSetWorkspaceAiModel($provider: String!, $model: String!) {
859
+ }, xe = () => {
860
+ let t = c(), { apiGatewayUrl: n } = e();
861
+ return o({
862
+ mutationFn: async ({ provider: e, model: t }) => (await p(`mutation AthSetWorkspaceAiModel($provider: String!, $model: String!) {
847
863
  athSetWorkspaceAiModel(provider: $provider, model: $model) { ${Q} }
848
864
  }`, {
849
865
  provider: e,
@@ -853,10 +869,10 @@ var ge = (e = {}) => {
853
869
  t.setQueryData(["atheletebridge", "ai-config"], e);
854
870
  }
855
871
  });
856
- }, be = () => {
857
- let t = a(), { apiGatewayUrl: n } = e();
858
- return r({
859
- mutationFn: async (e) => (await u(`mutation AthSetWorkspaceAutoPilot($enabled: Boolean!) {
872
+ }, Se = () => {
873
+ let t = c(), { apiGatewayUrl: n } = e();
874
+ return o({
875
+ mutationFn: async (e) => (await p(`mutation AthSetWorkspaceAutoPilot($enabled: Boolean!) {
860
876
  athSetWorkspaceAutoPilot(enabled: $enabled) { ${Q} }
861
877
  }`, { enabled: e }, n)).athSetWorkspaceAutoPilot,
862
878
  onSuccess: (e) => {
@@ -864,21 +880,21 @@ var ge = (e = {}) => {
864
880
  }
865
881
  });
866
882
  };
867
- function $(e) {
883
+ function Ce(e) {
868
884
  let t = {};
869
885
  return e.athleteId && (t.athleteId = e.athleteId), e.teamId && (t.teamId = e.teamId), e.programId && (t.programId = e.programId), Object.keys(t).length > 0 ? t : null;
870
886
  }
871
- var xe = (t = {}) => {
872
- let { apiGatewayUrl: n } = e(), { limit: r = 10, offset: a = 0 } = t, o = $(t);
873
- return i({
887
+ var we = (t = {}) => {
888
+ let { apiGatewayUrl: n } = e(), { limit: r = 10, offset: i = 0 } = t, a = Ce(t);
889
+ return s({
874
890
  queryKey: [
875
891
  "atheletebridge",
876
892
  "agent-runs",
877
893
  r,
878
- a,
879
- o
894
+ i,
895
+ a
880
896
  ],
881
- queryFn: async () => (await u(`query AthAgentRuns($pagination: PaginationInput, $filter: AthAgentRunFilter) {
897
+ queryFn: async () => (await p(`query AthAgentRuns($pagination: PaginationInput, $filter: AthAgentRunFilter) {
882
898
  athAgentRuns(pagination: $pagination, filter: $filter) {
883
899
  items { ${Z} }
884
900
  pageInfo { cursor hasMore }
@@ -886,56 +902,56 @@ var xe = (t = {}) => {
886
902
  }`, {
887
903
  pagination: {
888
904
  limit: r,
889
- offset: a
905
+ offset: i
890
906
  },
891
- filter: o
907
+ filter: a
892
908
  }, n)).athAgentRuns
893
909
  });
894
- }, Se = (t) => {
910
+ }, Te = (t) => {
895
911
  let { apiGatewayUrl: n } = e();
896
- return i({
912
+ return s({
897
913
  queryKey: [
898
914
  "atheletebridge",
899
915
  "agent-run",
900
916
  t
901
917
  ],
902
- queryFn: async () => (await u(`query AthAgentRun($id: ID!) {
918
+ queryFn: async () => (await p(`query AthAgentRun($id: ID!) {
903
919
  athAgentRun(id: $id) { ${Z} }
904
920
  }`, { id: t }, n)).athAgentRun,
905
921
  enabled: !!t,
906
922
  retry: !1
907
923
  });
908
- }, Ce = (t) => {
924
+ }, Ee = (t) => {
909
925
  let { apiGatewayUrl: n } = e();
910
- return i({
926
+ return s({
911
927
  queryKey: [
912
928
  "atheletebridge",
913
929
  "program-ai-state",
914
930
  t
915
931
  ],
916
- queryFn: async () => (await u("query AthProgramAiState($id: ID!) {\n athProgram(id: $id) { id name status context }\n }", { id: t }, n)).athProgram,
932
+ queryFn: async () => (await p("query AthProgramAiState($id: ID!) {\n athProgram(id: $id) { id name status context }\n }", { id: t }, n)).athProgram,
917
933
  enabled: !!t,
918
934
  retry: !1
919
935
  });
920
- }, we = () => {
921
- let t = a(), { apiGatewayUrl: n } = e();
922
- return r({
923
- mutationFn: async (e) => (await u(`mutation AthGenerateProgram($input: AthGenerateProgramInput!) {
936
+ }, De = () => {
937
+ let t = c(), { apiGatewayUrl: n } = e();
938
+ return o({
939
+ mutationFn: async (e) => (await p(`mutation AthGenerateProgram($input: AthGenerateProgramInput!) {
924
940
  athGenerateProgram(input: $input) {
925
941
  agentRunId
926
942
  drillCount
927
943
  sessionCount
928
- program { ${v} }
944
+ program { ${x} }
929
945
  }
930
946
  }`, { input: e }, n)).athGenerateProgram,
931
947
  onSuccess: () => {
932
948
  t.invalidateQueries({ queryKey: ["atheletebridge", "agent-runs"] }), t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] }), t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] });
933
949
  }
934
950
  });
935
- }, Te = () => {
936
- let t = a(), { apiGatewayUrl: n } = e();
937
- return r({
938
- mutationFn: async ({ athleteId: e, programId: t, requestedProvider: r }) => (await u("mutation AthAdjustPlanFromPerformance($athleteId: ID!, $programId: ID!, $requestedProvider: String) {\n athAdjustPlanFromPerformance(athleteId: $athleteId, programId: $programId, requestedProvider: $requestedProvider) {\n agentRunId athleteId programId assessment rationale confidence\n recommendedWeeklyLoadChangePct flags appliedToProgram createdAt\n }\n }", {
951
+ }, Oe = () => {
952
+ let t = c(), { apiGatewayUrl: n } = e();
953
+ return o({
954
+ mutationFn: async ({ athleteId: e, programId: t, requestedProvider: r }) => (await p("mutation AthAdjustPlanFromPerformance($athleteId: ID!, $programId: ID!, $requestedProvider: String) {\n athAdjustPlanFromPerformance(athleteId: $athleteId, programId: $programId, requestedProvider: $requestedProvider) {\n agentRunId athleteId programId assessment rationale confidence\n recommendedWeeklyLoadChangePct flags appliedToProgram createdAt\n }\n }", {
939
955
  athleteId: e,
940
956
  programId: t,
941
957
  requestedProvider: r
@@ -948,10 +964,10 @@ var xe = (t = {}) => {
948
964
  ] });
949
965
  }
950
966
  });
951
- }, Ee = () => {
952
- let t = a(), { apiGatewayUrl: n } = e();
953
- return r({
954
- mutationFn: async ({ runId: e, programId: t, assessment: r, note: i }) => (await u("mutation AthOverrideAgentRun($runId: ID!, $programId: ID!, $assessment: AthAiAssessment!, $note: String!) {\n athOverrideAgentRun(runId: $runId, programId: $programId, assessment: $assessment, note: $note) {\n id workspaceId programId supersedesRunId assessment note\n appliedToProgram createdAt\n }\n }", {
967
+ }, ke = () => {
968
+ let t = c(), { apiGatewayUrl: n } = e();
969
+ return o({
970
+ mutationFn: async ({ runId: e, programId: t, assessment: r, note: i }) => (await p("mutation AthOverrideAgentRun($runId: ID!, $programId: ID!, $assessment: AthAiAssessment!, $note: String!) {\n athOverrideAgentRun(runId: $runId, programId: $programId, assessment: $assessment, note: $note) {\n id workspaceId programId supersedesRunId assessment note\n appliedToProgram createdAt\n }\n }", {
955
971
  runId: e,
956
972
  programId: t,
957
973
  assessment: r,
@@ -967,6 +983,6 @@ var xe = (t = {}) => {
967
983
  });
968
984
  };
969
985
  //#endregion
970
- export { c as AI_PROVIDER_UNAVAILABLE, l as AthApiError, J as directoryUserName, ae as useAddDrill, O as useAddMember, Te as useAdjustPlanFromPerformance, Se as useAgentRun, xe as useAgentRuns, _e as useAiModelCatalog, ie as useArchiveProgram, D as useArchiveTeam, he as useAthleteProfile, q as useAvailability, R as useBookSession, V as useCancelSession, ge as useCoachAnalytics, B as useCompleteSession, z as useConfirmSession, te as useCreateProgram, T as useCreateTeam, de as useFile, j as useFixture, A as useFixtures, we as useGenerateProgram, W as useLogWorkout, Ee as useOverrideAgentRun, U as usePerformanceMetrics, F as useProgram, Ce as useProgramAiState, P as usePrograms, me as useRecentActivity, N as useRecordFixtureResult, G as useRecordMetric, ce as useRemindAvailability, oe as useRemoveDrill, k as useRemoveMember, ee as useScheduleFixture, L as useSession, I as useSessions, se as useSetAvailability, ye as useSetWorkspaceAiModel, be as useSetWorkspaceAutoPilot, M as useStandings, C as useTeam, w as useTeamMembers, S as useTeams, re as useTransitionProgram, ne as useUpdateProgram, E as useUpdateTeam, ue as useUploadFile, pe as useUserDirectory, fe as useUserSearch, Y as useUsersByIds, H as useWorkoutLogs, ve as useWorkspaceAiConfig };
986
+ export { d as AI_PROVIDER_UNAVAILABLE, f as AthApiError, p as athQuery, J as directoryUserName, oe as useAddDrill, j as useAddMember, Oe as useAdjustPlanFromPerformance, Te as useAgentRun, we as useAgentRuns, be as useAiModelCatalog, ae as useArchiveProgram, A as useArchiveTeam, ve as useAthleteProfile, le as useAvailability, B as useBookSession, U as useCancelSession, ye as useCoachAnalytics, H as useCompleteSession, V as useConfirmSession, ne as useCreateProgram, O as useCreateTeam, me as useFile, P as useFixture, N as useFixtures, De as useGenerateProgram, K as useLogWorkout, ke as useOverrideAgentRun, G as usePerformanceMetrics, te as useProgram, Ee as useProgramAiState, ee as usePrograms, _e as useRecentActivity, L as useRecordFixtureResult, ce as useRecordMetric, de as useRemindAvailability, se as useRemoveDrill, M as useRemoveMember, I as useScheduleFixture, z as useSession, R as useSessions, ue as useSetAvailability, xe as useSetWorkspaceAiModel, Se as useSetWorkspaceAutoPilot, F as useStandings, E as useTeam, D as useTeamMembers, T as useTeams, ie as useTransitionProgram, re as useUpdateProgram, k as useUpdateTeam, pe as useUploadFile, ge as useUserDirectory, he as useUserSearch, Y as useUsersByIds, W as useWorkoutLogs, $ as useWorkspaceAiConfig };
971
987
 
972
988
  //# sourceMappingURL=useAthleteBridgeApi.js.map