@gen3/frontend 0.12.63 → 0.12.64

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 (96) hide show
  1. package/dist/dts/components/Content/Form.d.ts +5 -5
  2. package/dist/dts/components/Content/Form.d.ts.map +1 -1
  3. package/dist/dts/components/Content/Form.js +9 -1
  4. package/dist/dts/components/Content/Form.js.map +1 -1
  5. package/dist/dts/components/Content/FormContent.d.ts +16 -5
  6. package/dist/dts/components/Content/FormContent.d.ts.map +1 -1
  7. package/dist/dts/components/Content/FormContent.js +26 -4
  8. package/dist/dts/components/Content/FormContent.js.map +1 -1
  9. package/dist/dts/components/Content/formValidators.d.ts +7 -0
  10. package/dist/dts/components/Content/formValidators.d.ts.map +1 -0
  11. package/dist/dts/components/Content/formValidators.js +52 -0
  12. package/dist/dts/components/Content/formValidators.js.map +1 -0
  13. package/dist/dts/components/Providers/Gen3Provider.d.ts +7 -7
  14. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +22 -22
  15. package/dist/dts/features/CohortBuilder/ExplorerTable/ArrayCellRenderer.d.ts +1 -1
  16. package/dist/dts/features/CohortSimilarity/cohortSimilarityApi.d.ts +4 -4
  17. package/dist/dts/features/DiscoveryForms/StudyRegistration/FormContentViews.d.ts +16 -0
  18. package/dist/dts/features/DiscoveryForms/StudyRegistration/FormContentViews.d.ts.map +1 -0
  19. package/dist/dts/features/DiscoveryForms/StudyRegistration/FormContentViews.js +18 -0
  20. package/dist/dts/features/DiscoveryForms/StudyRegistration/FormContentViews.js.map +1 -0
  21. package/dist/dts/features/DiscoveryForms/StudyRegistration/FormContentViews.stories.d.ts +30 -0
  22. package/dist/dts/features/DiscoveryForms/StudyRegistration/FormContentViews.stories.d.ts.map +1 -0
  23. package/dist/dts/features/DiscoveryForms/StudyRegistration/FormContentViews.stories.js +367 -0
  24. package/dist/dts/features/DiscoveryForms/StudyRegistration/FormContentViews.stories.js.map +1 -0
  25. package/dist/dts/features/DiscoveryForms/StudyRegistration/StudyRegistrationAccessRequestOutcome.d.ts +7 -0
  26. package/dist/dts/features/DiscoveryForms/StudyRegistration/StudyRegistrationAccessRequestOutcome.d.ts.map +1 -0
  27. package/dist/dts/features/DiscoveryForms/StudyRegistration/StudyRegistrationAccessRequestOutcome.js +14 -0
  28. package/dist/dts/features/DiscoveryForms/StudyRegistration/StudyRegistrationAccessRequestOutcome.js.map +1 -0
  29. package/dist/dts/features/DiscoveryForms/StudyRegistration/index.d.ts +8 -0
  30. package/dist/dts/features/DiscoveryForms/StudyRegistration/index.d.ts.map +1 -0
  31. package/dist/dts/features/DiscoveryForms/StudyRegistration/index.js +11 -0
  32. package/dist/dts/features/DiscoveryForms/StudyRegistration/index.js.map +1 -0
  33. package/dist/dts/features/DiscoveryForms/StudyRegistration/types.d.ts +55 -0
  34. package/dist/dts/features/DiscoveryForms/StudyRegistration/types.d.ts.map +1 -0
  35. package/dist/dts/features/DiscoveryForms/StudyRegistration/types.js +8 -0
  36. package/dist/dts/features/DiscoveryForms/StudyRegistration/types.js.map +1 -0
  37. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/getClinicalTrialMetadata.d.ts +2 -0
  38. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/getClinicalTrialMetadata.d.ts.map +1 -0
  39. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/getClinicalTrialMetadata.js +17 -0
  40. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/getClinicalTrialMetadata.js.map +1 -0
  41. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/preprocessStudyRegistrationMetadata.d.ts +10 -0
  42. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/preprocessStudyRegistrationMetadata.d.ts.map +1 -0
  43. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/preprocessStudyRegistrationMetadata.js +77 -0
  44. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/preprocessStudyRegistrationMetadata.js.map +1 -0
  45. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/useStudyRegistration.d.ts +12 -0
  46. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/useStudyRegistration.d.ts.map +1 -0
  47. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/useStudyRegistration.js +160 -0
  48. package/dist/dts/features/DiscoveryForms/StudyRegistration/useStudyRegistration/useStudyRegistration.js.map +1 -0
  49. package/dist/dts/features/DiscoveryForms/StudyRegistration/userCanRegisterStudy.d.ts +6 -0
  50. package/dist/dts/features/DiscoveryForms/StudyRegistration/userCanRegisterStudy.d.ts.map +1 -0
  51. package/dist/dts/features/DiscoveryForms/StudyRegistration/userCanRegisterStudy.js +10 -0
  52. package/dist/dts/features/DiscoveryForms/StudyRegistration/userCanRegisterStudy.js.map +1 -0
  53. package/dist/dts/features/Navigation/FixedNavPageLayout.js +1 -1
  54. package/dist/dts/features/Navigation/FixedNavPageLayout.js.map +1 -1
  55. package/dist/dts/features/Study/StudyDetails/StudyDetailsHeaderButtons.d.ts.map +1 -1
  56. package/dist/dts/features/Study/StudyDetails/StudyDetailsHeaderButtons.js +26 -8
  57. package/dist/dts/features/Study/StudyDetails/StudyDetailsHeaderButtons.js.map +1 -1
  58. package/dist/dts/pages/StudyForms/StudyRegistration/data.d.ts +4 -0
  59. package/dist/dts/pages/StudyForms/StudyRegistration/data.d.ts.map +1 -0
  60. package/dist/dts/pages/StudyForms/StudyRegistration/data.js +32 -0
  61. package/dist/dts/pages/StudyForms/StudyRegistration/data.js.map +1 -0
  62. package/dist/dts/pages/StudyForms/StudyRegistration/index.d.ts +10 -0
  63. package/dist/dts/pages/StudyForms/StudyRegistration/index.d.ts.map +1 -0
  64. package/dist/dts/pages/StudyForms/StudyRegistration/index.js +12 -0
  65. package/dist/dts/pages/StudyForms/StudyRegistration/index.js.map +1 -0
  66. package/dist/dts/pages/StudyForms/StudyRegistration/types.d.ts +28 -0
  67. package/dist/dts/pages/StudyForms/StudyRegistration/types.d.ts.map +1 -0
  68. package/dist/dts/pages/StudyForms/StudyRegistration/types.js +2 -0
  69. package/dist/dts/pages/StudyForms/StudyRegistration/types.js.map +1 -0
  70. package/dist/index/cjs/QueryPanel-DNGXxrpC.js +43 -0
  71. package/dist/index/cjs/QueryPanel-DNGXxrpC.js.map +1 -0
  72. package/dist/index/cjs/index-7sUtTikC.js +42117 -0
  73. package/dist/index/cjs/index-7sUtTikC.js.map +1 -0
  74. package/dist/index/cjs/index.js +1 -1
  75. package/dist/index/esm/QueryPanel-C3JVntIb.js +37 -0
  76. package/dist/index/esm/QueryPanel-C3JVntIb.js.map +1 -0
  77. package/dist/index/esm/index-B_0ks9Pi.js +41830 -0
  78. package/dist/index/esm/index-B_0ks9Pi.js.map +1 -0
  79. package/dist/index/esm/index.js +1 -1
  80. package/dist/index.d.ts +22 -12
  81. package/dist/pages/cjs/CohortBuilder-DircXqXL.js +576 -0
  82. package/dist/pages/cjs/CohortBuilder-DircXqXL.js.map +1 -0
  83. package/dist/pages/cjs/QueryPanel-qYWbo2Cb.js +43 -0
  84. package/dist/pages/cjs/QueryPanel-qYWbo2Cb.js.map +1 -0
  85. package/dist/pages/cjs/index-BQzYPjdE.js +32499 -0
  86. package/dist/pages/cjs/index-BQzYPjdE.js.map +1 -0
  87. package/dist/pages/cjs/index.js +1 -1
  88. package/dist/pages/esm/CohortBuilder-CI9PAFLd.js +573 -0
  89. package/dist/pages/esm/CohortBuilder-CI9PAFLd.js.map +1 -0
  90. package/dist/pages/esm/QueryPanel-BEqldpr5.js +37 -0
  91. package/dist/pages/esm/QueryPanel-BEqldpr5.js.map +1 -0
  92. package/dist/pages/esm/index-BoZwM5wd.js +32389 -0
  93. package/dist/pages/esm/index-BoZwM5wd.js.map +1 -0
  94. package/dist/pages/esm/index.js +1 -1
  95. package/dist/pages.d.ts +15 -5
  96. package/package.json +2 -2
@@ -0,0 +1,367 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { FormContentViews } from './FormContentViews';
3
+ import { FormOutcome } from './types';
4
+ const mockFormBody = [
5
+ {
6
+ type: 'markdown',
7
+ text: '## Registration Information',
8
+ },
9
+ {
10
+ type: 'Select',
11
+ label: 'Study',
12
+ initialValue: 'HDP01266',
13
+ required: true,
14
+ dropdownData: [
15
+ {
16
+ label: '1R43AR082729-01 : Ultrasound Stimulated Chondrogenic Stem Cell Therapy for Osteoarthritis : 10701506',
17
+ value: 'HDP01266',
18
+ },
19
+ {
20
+ label: '1R18EB035005-01 : Development of A Focused Ultrasound Device for Noninvasive, Peripheral Nerve Blockade to Manage Acute Pain : 10740796',
21
+ value: 'HDP01267',
22
+ },
23
+ {
24
+ label: '3U01OD033241-01S2 : Culturally-responsive community-driven substance use recovery for Black and Latinx populations : 10645536',
25
+ value: 'HDP01268',
26
+ },
27
+ ],
28
+ variable: 'study_id',
29
+ },
30
+ {
31
+ type: 'CedarUserUUID',
32
+ label: 'CEDAR User UUID',
33
+ required: true,
34
+ variable: 'cedar_uuid',
35
+ },
36
+ {
37
+ type: 'markdown',
38
+ className: 'text-sm mb-10 !mt-0',
39
+ text: [
40
+ '[Get CEDAR User UUID](https://cedar.metadatacenter.org/)',
41
+ 'A CEDAR user UUID is required in this process so the created CEDAR instances can be shared with you. We do not save this ID on the platform',
42
+ ],
43
+ },
44
+ {
45
+ type: 'ClinicalTrialID',
46
+ label: 'ClinicalTrials.gov ID',
47
+ variable: 'clinical_trials_id',
48
+ },
49
+ {
50
+ type: 'markdown',
51
+ text: '## Repository Information',
52
+ },
53
+ {
54
+ type: 'Select',
55
+ label: 'Study Data Repository',
56
+ initialValue: '',
57
+ placeholder: 'Select a data repository',
58
+ dropdownData: [
59
+ {
60
+ value: 'BioSystics-AP',
61
+ label: 'BioSystics-AP',
62
+ },
63
+ {
64
+ value: 'Database of Genotypes and Phenotypes (dbGaP)',
65
+ label: 'Database of Genotypes and Phenotypes (dbGaP)',
66
+ },
67
+ {
68
+ value: 'Dryad',
69
+ label: 'Dryad',
70
+ },
71
+ {
72
+ value: 'FaceBase',
73
+ label: 'FaceBase',
74
+ },
75
+ {
76
+ value: 'Figshare',
77
+ label: 'Figshare',
78
+ },
79
+ {
80
+ value: 'Gene Expression Omnibus (GEO)',
81
+ label: 'Gene Expression Omnibus (GEO)',
82
+ },
83
+ {
84
+ value: 'GitHub',
85
+ label: 'GitHub',
86
+ },
87
+ {
88
+ value: 'Harvard Dataverse',
89
+ label: 'Harvard Dataverse',
90
+ },
91
+ {
92
+ value: 'ICPSR',
93
+ label: 'ICPSR',
94
+ },
95
+ {
96
+ value: 'openICPSR',
97
+ label: 'openICPSR',
98
+ },
99
+ {
100
+ value: 'JCOIN',
101
+ label: 'JCOIN',
102
+ },
103
+ {
104
+ value: 'MassIVE',
105
+ label: 'MassIVE',
106
+ },
107
+ {
108
+ value: 'Mendeley Data',
109
+ label: 'Mendeley Data',
110
+ },
111
+ {
112
+ value: 'Mouse Genome Informatics (MGI)',
113
+ label: 'Mouse Genome Informatics (MGI)',
114
+ },
115
+ {
116
+ value: 'Mouse Phenome Database (MPD)',
117
+ label: 'Mouse Phenome Database (MPD)',
118
+ },
119
+ {
120
+ value: 'NAHDAP',
121
+ label: 'NAHDAP',
122
+ },
123
+ {
124
+ value: 'National Sleep Research Resource (NSRR)',
125
+ label: 'National Sleep Research Resource (NSRR)',
126
+ },
127
+ {
128
+ value: 'NICHD DASH',
129
+ label: 'NICHD DASH',
130
+ },
131
+ {
132
+ value: 'NIDA Data Share',
133
+ label: 'NIDA Data Share',
134
+ },
135
+ {
136
+ value: 'NIDDK Central Repository',
137
+ label: 'NIDDK Central Repository',
138
+ },
139
+ {
140
+ value: 'NIMH Data Archive',
141
+ label: 'NIMH Data Archive',
142
+ },
143
+ {
144
+ value: 'OpenNEURO',
145
+ label: 'OpenNEURO',
146
+ },
147
+ {
148
+ value: 'Open Science Framework',
149
+ label: 'Open Science Framework',
150
+ },
151
+ {
152
+ value: 'Pennsieve',
153
+ label: 'Pennsieve',
154
+ },
155
+ {
156
+ value: 'Protocols.io',
157
+ label: 'Protocols.io',
158
+ },
159
+ {
160
+ value: 'Qualitative Data Repository at Syracuse University',
161
+ label: 'Qualitative Data Repository at Syracuse University',
162
+ },
163
+ {
164
+ value: 'Rat Genome Database (RGD)',
165
+ label: 'Rat Genome Database (RGD)',
166
+ },
167
+ {
168
+ value: 'Sequence Read Archive (SRA)',
169
+ label: 'Sequence Read Archive (SRA)',
170
+ },
171
+ {
172
+ value: 'SPARC',
173
+ label: 'SPARC',
174
+ },
175
+ {
176
+ value: 'Vivli',
177
+ label: 'Vivli',
178
+ },
179
+ {
180
+ value: 'The Zebrafish Model Organism Database (ZFIN)',
181
+ label: 'The Zebrafish Model Organism Database (ZFIN)',
182
+ },
183
+ {
184
+ value: 'Zenodo',
185
+ label: 'Zenodo',
186
+ },
187
+ ],
188
+ variable: 'repository',
189
+ },
190
+ {
191
+ type: 'markdown',
192
+ className: 'text-sm mt-0 mb-10',
193
+ text: 'If you have already selected a data repository, indicate it here; otherwise, leave empty. If you have deposited your data and you have a unique Study ID for the data at the repository, enter it below; otherwise, leave blank.',
194
+ },
195
+ {
196
+ type: 'Tags',
197
+ label: 'Study Data ID from Repository: \nPress Enter to add a unique ID for a study within the repository',
198
+ placeholder: 'Enter the unique ID for the study within the repository',
199
+ variable: 'repository_study_ids',
200
+ },
201
+ ];
202
+ const mockConfig = {
203
+ mdsURL: 'https://qa-heal.planx-pla.net/mds',
204
+ cedarWrapperURL: 'https://qa-heal.planx-pla.net/cedar',
205
+ clinicalTrialFields: [
206
+ 'NCTId',
207
+ 'OfficialTitle',
208
+ 'BriefTitle',
209
+ 'Acronym',
210
+ 'StudyType',
211
+ 'OverallStatus',
212
+ 'StartDate',
213
+ ],
214
+ form: [
215
+ {
216
+ type: 'markdown',
217
+ text: '## Registration Information',
218
+ },
219
+ {
220
+ type: 'Select',
221
+ label: 'Study',
222
+ initialValue: '',
223
+ required: true,
224
+ data: [],
225
+ variable: 'study_id',
226
+ },
227
+ {
228
+ type: 'CedarUserUUID',
229
+ label: 'CEDAR User UUID',
230
+ required: true,
231
+ variable: 'cedar_uuid',
232
+ },
233
+ {
234
+ type: 'markdown',
235
+ className: 'text-sm mb-10 !mt-0',
236
+ text: [
237
+ '[Get CEDAR User UUID](https://cedar.metadatacenter.org/)',
238
+ 'A CEDAR user UUID is required in this process so the created CEDAR instances can be shared with you. We do not save this ID on the platform',
239
+ ],
240
+ },
241
+ {
242
+ type: 'ClinicalTrialID',
243
+ label: 'ClinicalTrials.gov ID',
244
+ variable: 'clinical_trials_id',
245
+ },
246
+ {
247
+ type: 'markdown',
248
+ text: '## Repository Information',
249
+ },
250
+ {
251
+ type: 'Select',
252
+ label: 'Study Data Repository',
253
+ initialValue: '',
254
+ placeholder: 'Select a data repository',
255
+ data: [
256
+ {
257
+ value: 'BioSystics-AP',
258
+ label: 'BioSystics-AP',
259
+ },
260
+ {
261
+ value: 'Database of Genotypes and Phenotypes (dbGaP)',
262
+ label: 'Database of Genotypes and Phenotypes (dbGaP)',
263
+ },
264
+ {
265
+ value: 'Dryad',
266
+ label: 'Dryad',
267
+ },
268
+ ],
269
+ variable: 'repository',
270
+ },
271
+ {
272
+ type: 'markdown',
273
+ className: 'text-sm mt-0 mb-10',
274
+ text: 'If you have already selected a data repository, indicate it here; otherwise, leave empty. If you have deposited your data and you have a unique Study ID for the data at the repository, enter it below; otherwise, leave blank.',
275
+ },
276
+ {
277
+ type: 'Tags',
278
+ label: 'Study Data ID from Repository: \nPress Enter to add a unique ID for a study within the repository',
279
+ placeholder: 'Enter the unique ID for the study within the repository',
280
+ variable: 'repository_study_ids',
281
+ },
282
+ ],
283
+ success: {
284
+ content: [
285
+ {
286
+ type: 'markdown',
287
+ text: [
288
+ '# Your access request has been submitted!',
289
+ 'Thank you for your submission. Requests take up to 1 business day to complete. You will be notified when approved. If you do not receive notification within 1 business day of your request, please reach out to [heal-support@gen3.org](mailto:heal-support@gen3.org).',
290
+ ],
291
+ className: 'text-center',
292
+ },
293
+ ],
294
+ buttons: [
295
+ {
296
+ variant: 'filled',
297
+ href: '/study-reg',
298
+ text: 'Register Another Study',
299
+ },
300
+ {
301
+ variant: 'outline',
302
+ href: '/Discovery',
303
+ text: 'Go to Discovery Page',
304
+ },
305
+ {
306
+ variant: 'outline',
307
+ href: 'https://cedar.metadatacenter.org/',
308
+ text: 'Go To CEDAR ',
309
+ externalLink: true,
310
+ },
311
+ ],
312
+ },
313
+ error: {
314
+ content: [
315
+ {
316
+ type: 'markdown',
317
+ text: [
318
+ '# A problem has occurred during registration',
319
+ 'If the issue continues please contact your adminsitrator.',
320
+ ],
321
+ className: 'text-center',
322
+ },
323
+ ],
324
+ },
325
+ };
326
+ const meta = {
327
+ title: 'DiscoveryForms/StudyRegistration',
328
+ component: FormContentViews,
329
+ args: {
330
+ studyUID: 'STUDY-123',
331
+ formBody: mockFormBody,
332
+ config: mockConfig,
333
+ onSubmit: async (values) => alert(`Submitted ${JSON.stringify(values)}`),
334
+ isLoading: false,
335
+ },
336
+ decorators: [
337
+ (Story) => (_jsx("div", { className: "flex justify-center items-center min-h-screen w-full box-border p-5", children: _jsx(Story, {}) })),
338
+ ],
339
+ };
340
+ export default meta;
341
+ export const PendingState = {
342
+ args: {
343
+ formOutcome: FormOutcome.pending,
344
+ },
345
+ };
346
+ export const SuccessState = {
347
+ args: {
348
+ formOutcome: FormOutcome.success,
349
+ },
350
+ };
351
+ export const LoadingState = {
352
+ args: {
353
+ isLoading: true,
354
+ },
355
+ };
356
+ export const ErrorState = {
357
+ args: {
358
+ formOutcome: FormOutcome.error,
359
+ formError: '{error: true,code: 400,message: "Example Form Error Message.", details:"Example Form Error Details"}',
360
+ },
361
+ };
362
+ export const ErrorStateNoErrorInfo = {
363
+ args: {
364
+ formOutcome: FormOutcome.error,
365
+ },
366
+ };
367
+ //# sourceMappingURL=FormContentViews.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormContentViews.stories.js","sourceRoot":"","sources":["../../../../../src/features/DiscoveryForms/StudyRegistration/FormContentViews.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAItC,MAAM,YAAY,GAAG;IACnB;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,6BAA6B;KACpC;IACD;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,OAAO;QACd,YAAY,EAAE,UAAU;QACxB,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE;YACZ;gBACE,KAAK,EACH,sGAAsG;gBACxG,KAAK,EAAE,UAAU;aAClB;YACD;gBACE,KAAK,EACH,yIAAyI;gBAC3I,KAAK,EAAE,UAAU;aAClB;YACD;gBACE,KAAK,EACH,+HAA+H;gBACjI,KAAK,EAAE,UAAU;aAClB;SACF;QACD,QAAQ,EAAE,UAAU;KACrB;IACD;QACE,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,iBAAiB;QACxB,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,YAAY;KACvB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,qBAAqB;QAChC,IAAI,EAAE;YACJ,0DAA0D;YAC1D,6IAA6I;SAC9I;KACF;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,uBAAuB;QAC9B,QAAQ,EAAE,oBAAoB;KAC/B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,2BAA2B;KAClC;IACD;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,uBAAuB;QAC9B,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,0BAA0B;QACvC,YAAY,EAAE;YACZ;gBACE,KAAK,EAAE,eAAe;gBACtB,KAAK,EAAE,eAAe;aACvB;YACD;gBACE,KAAK,EAAE,8CAA8C;gBACrD,KAAK,EAAE,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,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE;QACJ,WAAW,EAAE,WAAW,CAAC,KAAK;QAC9B,SAAS,EACP,sGAAsG;KACzG;CACF,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE;QACJ,WAAW,EAAE,WAAW,CAAC,KAAK;KAC/B;CACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { studyRegistrationAccessRequestFormOutcomeProps } from './types';
3
+ declare const StudyRegistrationAccessRequestOutcome: ({ outcomeConfig, }: {
4
+ outcomeConfig: studyRegistrationAccessRequestFormOutcomeProps;
5
+ }) => React.JSX.Element;
6
+ export default StudyRegistrationAccessRequestOutcome;
7
+ //# sourceMappingURL=StudyRegistrationAccessRequestOutcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StudyRegistrationAccessRequestOutcome.d.ts","sourceRoot":"","sources":["../../../../../src/features/DiscoveryForms/StudyRegistration/StudyRegistrationAccessRequestOutcome.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,8CAA8C,EAAE,MAAM,SAAS,CAAC;AAG9E,QAAA,MAAM,qCAAqC,GAAI,oBAE5C;IACD,aAAa,EAAE,8CAA8C,CAAC;CAC/D,sBA+BA,CAAC;AAEF,eAAe,qCAAqC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from '@mantine/core';
3
+ import TextContent from '../../../components/Content/TextContent';
4
+ import { IconExternalLink } from '@tabler/icons-react';
5
+ const StudyRegistrationAccessRequestOutcome = ({ outcomeConfig, }) => {
6
+ const { content, buttons } = outcomeConfig;
7
+ if (!content && !buttons) {
8
+ _jsxs("div", { className: "w-full max-w-xl m-auto text-center", children: [_jsx("h2", { children: "Unrecognized Error" }), _jsx("p", { children: "There was an issue processing your request" })] });
9
+ }
10
+ return (_jsxs("div", { className: "w-full max-w-xl m-auto text-center", children: [content?.map((item, index) => (_jsx(TextContent, { ...item }, index))), buttons &&
11
+ buttons.map((button, index) => (_jsx(Button, { component: "a", variant: button.variant, href: button.href, rightSection: button.externalLink && _jsx(IconExternalLink, {}), target: button.externalLink ? '_blank' : undefined, rel: button.externalLink ? 'noopener noreferrer' : undefined, className: "mt-10 mr-1", children: button.text }, index)))] }));
12
+ };
13
+ export default StudyRegistrationAccessRequestOutcome;
14
+ //# sourceMappingURL=StudyRegistrationAccessRequestOutcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StudyRegistrationAccessRequestOutcome.js","sourceRoot":"","sources":["../../../../../src/features/DiscoveryForms/StudyRegistration/StudyRegistrationAccessRequestOutcome.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,WAAW,MAAM,yCAAyC,CAAC;AAGlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,qCAAqC,GAAG,CAAC,EAC7C,aAAa,GAGd,EAAE,EAAE;IACH,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC;IAC3C,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACzB,eAAK,SAAS,EAAC,oCAAoC,aACjD,8CAA2B,EAC3B,qEAAiD,IAC7C,CAAC;IACT,CAAC;IAED,OAAO,CACL,eAAK,SAAS,EAAC,oCAAoC,aAChD,OAAO,EAAE,GAAG,CAAC,CAAC,IAAsB,EAAE,KAAa,EAAE,EAAE,CAAC,CACvD,KAAC,WAAW,OAAiB,IAAI,IAAf,KAAK,CAAc,CACtC,CAAC,EACD,OAAO;gBACN,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC7B,KAAC,MAAM,IAEL,SAAS,EAAC,GAAG,EACb,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,KAAC,gBAAgB,KAAG,EACzD,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAClD,GAAG,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EAC5D,SAAS,EAAC,YAAY,YAErB,MAAM,CAAC,IAAI,IATP,KAAK,CAUH,CACV,CAAC,IACA,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qCAAqC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { StudyRegistrationFormConfig } from '../../../pages/StudyForms/StudyRegistration/types';
3
+ interface StudyRegistrationAccessRequestFormProps {
4
+ configStudyRegistrationForm: StudyRegistrationFormConfig;
5
+ }
6
+ declare const StudyRegistrationAccessRequestForm: ({ configStudyRegistrationForm, }: StudyRegistrationAccessRequestFormProps) => React.JSX.Element;
7
+ export default StudyRegistrationAccessRequestForm;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/DiscoveryForms/StudyRegistration/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAErG,UAAU,uCAAuC;IAC/C,2BAA2B,EAAE,2BAA2B,CAAC;CAC1D;AAED,QAAA,MAAM,kCAAkC,GAAI,kCAEzC,uCAAuC,sBA4BzC,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box } from '@mantine/core';
3
+ import { useStudyRegistration } from './useStudyRegistration/useStudyRegistration';
4
+ import { FormContentViews } from './FormContentViews';
5
+ const StudyRegistrationAccessRequestForm = ({ configStudyRegistrationForm, }) => {
6
+ // Get everything needed from Hook
7
+ const { formOutcome, formError, studyUID, formBody, formOnSubmit, isLoading, } = useStudyRegistration(configStudyRegistrationForm);
8
+ return (_jsx("div", { className: "flex justify-items-center w-full", children: _jsx(Box, { className: "w-full bg-white rounded-md m-8 p-8 ", children: _jsx("div", { className: "max-w-4xl mx-auto", children: _jsx(FormContentViews, { formOutcome: formOutcome, formError: formError, studyUID: studyUID, formBody: formBody, config: configStudyRegistrationForm, onSubmit: formOnSubmit, isLoading: isLoading }) }) }) }));
9
+ };
10
+ export default StudyRegistrationAccessRequestForm;
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/features/DiscoveryForms/StudyRegistration/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAOtD,MAAM,kCAAkC,GAAG,CAAC,EAC1C,2BAA2B,GACa,EAAE,EAAE;IAC5C,kCAAkC;IAClC,MAAM,EACJ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,SAAS,GACV,GAAG,oBAAoB,CAAC,2BAA2B,CAAC,CAAC;IAEtD,OAAO,CACL,cAAK,SAAS,EAAC,kCAAkC,YAC/C,KAAC,GAAG,IAAC,SAAS,EAAC,qCAAqC,YAClD,cAAK,SAAS,EAAC,mBAAmB,YAChC,KAAC,gBAAgB,IACf,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,2BAA2B,EACnC,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,SAAS,GACpB,GACE,GACF,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { TextContentProps } from '../../../components/Content/TextContent';
2
+ import type { Gen3AppConfigData } from '../../../lib/content/types';
3
+ import type { ButtonVariant } from '@mantine/core';
4
+ export interface ConfigStudyRegistrationAccessRequestFormProps extends Gen3AppConfigData {
5
+ content?: ReadonlyArray<TextContentProps>;
6
+ }
7
+ interface button {
8
+ href: string;
9
+ variant?: ButtonVariant;
10
+ text: string;
11
+ externalLink?: boolean;
12
+ }
13
+ export interface studyRegistrationAccessRequestFormOutcomeProps extends Gen3AppConfigData {
14
+ content?: ReadonlyArray<TextContentProps>;
15
+ buttons?: button[];
16
+ }
17
+ export declare enum FormOutcome {
18
+ pending = "pending",
19
+ success = "success",
20
+ error = "error",
21
+ userNotLoggedIn = "userNotLoggedIn"
22
+ }
23
+ export interface StudyRegistrationServiceResponse extends Record<string, unknown> {
24
+ error?: string;
25
+ [key: string]: unknown;
26
+ }
27
+ export interface MinimalInfo {
28
+ study_name?: string;
29
+ [key: string]: unknown;
30
+ }
31
+ export interface MetadataLocation {
32
+ nih_application_id?: string;
33
+ [key: string]: unknown;
34
+ }
35
+ export interface StudyMetadata {
36
+ minimal_info?: MinimalInfo;
37
+ metadata_location?: MetadataLocation;
38
+ [key: string]: unknown;
39
+ }
40
+ export interface RegisterableStudy {
41
+ _hdp_uid: string;
42
+ project_number?: string;
43
+ registration_authz: string;
44
+ study_metadata?: StudyMetadata;
45
+ }
46
+ export interface UnregisteredStudiesfromMDS {
47
+ _guid_type: string;
48
+ nih_reporter: NihReporter;
49
+ gen3_discovery: RegisterableStudy;
50
+ }
51
+ export interface NihReporter {
52
+ project_title: string;
53
+ }
54
+ export {};
55
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/DiscoveryForms/StudyRegistration/types.ts"],"names":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AED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,aAAa,CAAC;CAChC;AAGD,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,WAAW,CAAC;IAC1B,cAAc,EAAE,iBAAiB,CAAC;CACnC;AAED,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,8 @@
1
+ export var FormOutcome;
2
+ (function (FormOutcome) {
3
+ FormOutcome["pending"] = "pending";
4
+ FormOutcome["success"] = "success";
5
+ FormOutcome["error"] = "error";
6
+ FormOutcome["userNotLoggedIn"] = "userNotLoggedIn";
7
+ })(FormOutcome || (FormOutcome = {}));
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/features/DiscoveryForms/StudyRegistration/types.ts"],"names":[],"mappings":"AAmBA,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,kDAAmC,CAAA;AACrC,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB"}
@@ -0,0 +1,2 @@
1
+ export declare const getClinicalTrialMetadata: (clinicalTrialFields: string[], ctID: string) => Promise<object>;
2
+ //# sourceMappingURL=getClinicalTrialMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getClinicalTrialMetadata.d.ts","sourceRoot":"","sources":["../../../../../../src/features/DiscoveryForms/StudyRegistration/useStudyRegistration/getClinicalTrialMetadata.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,GACnC,qBAAqB,MAAM,EAAE,EAC7B,MAAM,MAAM,KACX,OAAO,CAAC,MAAM,CAiBhB,CAAC"}
@@ -0,0 +1,17 @@
1
+ export const getClinicalTrialMetadata = async (clinicalTrialFields, ctID) => {
2
+ const errMsg = 'Unable to fetch study metadata from ClinicalTrials.gov';
3
+ try {
4
+ const resp = await fetch(`https://clinicaltrials.gov/api/v2/studies/${ctID}?fields=${clinicalTrialFields.join('|')}`);
5
+ if (!resp.ok) {
6
+ throw new Error('Unable to verify ClinicalTrials.gov ID');
7
+ }
8
+ return await resp.json();
9
+ }
10
+ catch (error) {
11
+ if (error instanceof Error) {
12
+ throw error;
13
+ }
14
+ throw new Error(errMsg);
15
+ }
16
+ };
17
+ //# sourceMappingURL=getClinicalTrialMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getClinicalTrialMetadata.js","sourceRoot":"","sources":["../../../../../../src/features/DiscoveryForms/StudyRegistration/useStudyRegistration/getClinicalTrialMetadata.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAC3C,mBAA6B,EAC7B,IAAY,EACK,EAAE;IACnB,MAAM,MAAM,GAAG,wDAAwD,CAAC;IACxE,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,KAAK,CACtB,6CAA6C,IAAI,WAAW,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAC5F,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;QAED,OAAO,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { StudyRegistrationFormConfig } from '../../../../pages/StudyForms/StudyRegistration/types';
2
+ interface valuesToUpdate {
3
+ repository: string;
4
+ repository_study_ids: string | never[];
5
+ clinical_trials_id: string;
6
+ clinicaltrials_gov: object | undefined;
7
+ }
8
+ export declare const preprocessStudyRegistrationMetadata: (config: StudyRegistrationFormConfig, username: string, metadataID: string, updatedValues: valuesToUpdate, GUIDType?: string) => Promise<any>;
9
+ export {};
10
+ //# sourceMappingURL=preprocessStudyRegistrationMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preprocessStudyRegistrationMetadata.d.ts","sourceRoot":"","sources":["../../../../../../src/features/DiscoveryForms/StudyRegistration/useStudyRegistration/preprocessStudyRegistrationMetadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AAKxG,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IACvC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,eAAO,MAAM,mCAAmC,GAC9C,QAAQ,2BAA2B,EACnC,UAAU,MAAM,EAChB,YAAY,MAAM,EAClB,eAAe,cAAc,EAC7B,iBAA+B,iBAiGhC,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { toString } from 'lodash';
2
+ const STUDY_DATA_FIELD = 'gen3_discovery';
3
+ const TAG_FIELD = 'tags';
4
+ export const preprocessStudyRegistrationMetadata = async (config, username, metadataID, updatedValues, GUIDType = 'discovery_metadata') => {
5
+ try {
6
+ const queryURL = `${config.mdsURL}/metadata/${metadataID}`;
7
+ const queryRes = await fetch(queryURL);
8
+ if (queryRes.status !== 200) {
9
+ throw new Error(`Request for query study data at ${queryURL} failed with status ${queryRes.status}}`);
10
+ }
11
+ const studyMetadata = await queryRes.json();
12
+ const studyRegistrationValidationField = config.studyRegistrationValidationField;
13
+ const studyRegistrationTrackingField = config.studyRegistrationTrackingField;
14
+ const metadataToUpdate = { ...studyMetadata };
15
+ metadataToUpdate._guid_type = GUIDType;
16
+ if (!Object.prototype.hasOwnProperty.call(metadataToUpdate, STUDY_DATA_FIELD)) {
17
+ // it should already be there, but avoid errors if for some reason it's not
18
+ metadataToUpdate.STUDY_DATA_FIELD = {};
19
+ }
20
+ metadataToUpdate[STUDY_DATA_FIELD][studyRegistrationValidationField] = true;
21
+ metadataToUpdate[STUDY_DATA_FIELD][studyRegistrationTrackingField] =
22
+ username;
23
+ // data_repositories related metadata setup
24
+ // check if data_repositories has already been altered before (non-empty)
25
+ if (metadataToUpdate[STUDY_DATA_FIELD]?.study_metadata?.metadata_location
26
+ ?.data_repositories &&
27
+ Array.isArray(metadataToUpdate[STUDY_DATA_FIELD].study_metadata.metadata_location
28
+ .data_repositories) &&
29
+ metadataToUpdate[STUDY_DATA_FIELD].study_metadata.metadata_location
30
+ .data_repositories.length === 0) {
31
+ // add all repository_study_ids as separate objects
32
+ let tempStudyIDObj = [];
33
+ if (updatedValues.repository_study_ids.length > 0) {
34
+ tempStudyIDObj = updatedValues.repository_study_ids.map((studyId) => ({
35
+ repository_name: updatedValues.repository,
36
+ repository_study_ID: studyId,
37
+ }));
38
+ }
39
+ else if (updatedValues.repository) {
40
+ tempStudyIDObj = [
41
+ {
42
+ repository_name: updatedValues.repository,
43
+ repository_study_ID: '',
44
+ repository_study_link: '',
45
+ repository_persistent_ID: '',
46
+ },
47
+ ];
48
+ }
49
+ metadataToUpdate[STUDY_DATA_FIELD].study_metadata.metadata_location.data_repositories = tempStudyIDObj;
50
+ if (updatedValues.repository) {
51
+ if (!metadataToUpdate[STUDY_DATA_FIELD][TAG_FIELD]) {
52
+ metadataToUpdate[STUDY_DATA_FIELD][TAG_FIELD] = [];
53
+ }
54
+ // don't push duplicated tags
55
+ if (!metadataToUpdate[STUDY_DATA_FIELD][TAG_FIELD].includes({
56
+ name: updatedValues.repository,
57
+ category: 'Data Repository',
58
+ })) {
59
+ metadataToUpdate[STUDY_DATA_FIELD][TAG_FIELD].push({
60
+ name: updatedValues.repository,
61
+ category: 'Data Repository',
62
+ });
63
+ }
64
+ }
65
+ }
66
+ metadataToUpdate[STUDY_DATA_FIELD].study_metadata.metadata_location.clinical_trials_study_ID =
67
+ updatedValues.clinical_trials_id;
68
+ if (updatedValues.clinical_trials_id) {
69
+ metadataToUpdate.clinicaltrials_gov = updatedValues.clinicaltrials_gov;
70
+ }
71
+ return metadataToUpdate;
72
+ }
73
+ catch (err) {
74
+ throw new Error(`Request for query MDS failed: ${toString(err)}`);
75
+ }
76
+ };
77
+ //# sourceMappingURL=preprocessStudyRegistrationMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preprocessStudyRegistrationMetadata.js","sourceRoot":"","sources":["../../../../../../src/features/DiscoveryForms/StudyRegistration/useStudyRegistration/preprocessStudyRegistrationMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAC1C,MAAM,SAAS,GAAG,MAAM,CAAC;AASzB,MAAM,CAAC,MAAM,mCAAmC,GAAG,KAAK,EACtD,MAAmC,EACnC,QAAgB,EAChB,UAAkB,EAClB,aAA6B,EAC7B,QAAQ,GAAG,oBAAoB,EAC/B,EAAE;IACF,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,GAAG,MAAM,CAAC,MAAM,aAAa,UAAU,EAAE,CAAC;QAC3D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CACb,mCAAmC,QAAQ,uBAAuB,QAAQ,CAAC,MAAM,GAAG,CACrF,CAAC;QACJ,CAAC;QACD,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC5C,MAAM,gCAAgC,GACp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