zudoku 0.3.0-dev.79 → 0.3.0-dev.80

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 (45) hide show
  1. package/dist/lib/plugins/openapi/Sidecar.d.ts +4 -0
  2. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  3. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  4. package/dist/lib/plugins/openapi/index.js +25 -5
  5. package/dist/lib/plugins/openapi/index.js.map +1 -1
  6. package/lib/{AuthenticationPlugin-CngUn5DP.js → AuthenticationPlugin-XS0DoAhE.js} +2 -2
  7. package/lib/{AuthenticationPlugin-CngUn5DP.js.map → AuthenticationPlugin-XS0DoAhE.js.map} +1 -1
  8. package/lib/{Combination-CS4rK8IJ.js → Combination-C442XfGG.js} +368 -347
  9. package/lib/Combination-C442XfGG.js.map +1 -0
  10. package/lib/{DevPortalProvider-BTFqdAEL.js → DevPortalProvider-BWeAysxF.js} +6 -5
  11. package/lib/{DevPortalProvider-BTFqdAEL.js.map → DevPortalProvider-BWeAysxF.js.map} +1 -1
  12. package/lib/{Input-GFpPXs5b.js → Input-3IEt27jb.js} +3 -3
  13. package/lib/{Input-GFpPXs5b.js.map → Input-3IEt27jb.js.map} +1 -1
  14. package/lib/{MdxPage-V4FCB0C_.js → MdxPage-CA1WmW14.js} +2 -2
  15. package/lib/{MdxPage-V4FCB0C_.js.map → MdxPage-CA1WmW14.js.map} +1 -1
  16. package/lib/OperationList-rv6Z3wD3.js +431 -0
  17. package/lib/OperationList-rv6Z3wD3.js.map +1 -0
  18. package/lib/{Route-CogU1ofM.js → Route-Clw81GSR.js} +2 -2
  19. package/lib/{Route-CogU1ofM.js.map → Route-Clw81GSR.js.map} +1 -1
  20. package/lib/{SlotletProvider-D_Vz-7c_.js → SlotletProvider-B71hNEUL.js} +24 -45
  21. package/lib/SlotletProvider-B71hNEUL.js.map +1 -0
  22. package/lib/{Spinner-oNQQyp-I.js → Spinner-Coi7ORUV.js} +2 -2
  23. package/lib/{Spinner-oNQQyp-I.js.map → Spinner-Coi7ORUV.js.map} +1 -1
  24. package/lib/{index-D4bOMg7f.js → index-BH-Ub36F.js} +5 -5
  25. package/lib/{index-D4bOMg7f.js.map → index-BH-Ub36F.js.map} +1 -1
  26. package/lib/index-CLkuJSxj.js +5950 -0
  27. package/lib/index-CLkuJSxj.js.map +1 -0
  28. package/lib/zudoku.auth-clerk.js +1 -1
  29. package/lib/zudoku.auth-openid.js +1 -1
  30. package/lib/zudoku.components.js +25 -25
  31. package/lib/zudoku.plugin-api-keys.js +12 -12
  32. package/lib/zudoku.plugin-markdown.js +2 -2
  33. package/lib/zudoku.plugin-openapi.js +4 -3
  34. package/lib/zudoku.plugin-openapi.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  37. package/src/lib/plugins/openapi/index.tsx +52 -16
  38. package/lib/Combination-CS4rK8IJ.js.map +0 -1
  39. package/lib/OperationList-C-M33Hxu.js +0 -4368
  40. package/lib/OperationList-C-M33Hxu.js.map +0 -1
  41. package/lib/SlotletProvider-D_Vz-7c_.js.map +0 -1
  42. package/lib/context-_fYfJFgk.js +0 -14
  43. package/lib/context-_fYfJFgk.js.map +0 -1
  44. package/lib/index-Uqja2h2M.js +0 -1960
  45. package/lib/index-Uqja2h2M.js.map +0 -1
@@ -1,1960 +0,0 @@
1
- import { j as e, e as cn } from "./jsx-runtime-CJBdjYYx.js";
2
- import { c as L, a as g, P as mn, H as un, u as pn, g as vn, S as pe } from "./Markdown-QsZ-PHET.js";
3
- import { C as gn, c as fn, f as hn } from "./urql-DrBfkb92.js";
4
- import { createClient as xn } from "zudoku/openapi-worker";
5
- import { L as kn } from "./index-Dt-pU7Vu.js";
6
- import { C as Nn } from "./CategoryHeading-DCmchnA1.js";
7
- import { a as ve, u as K, P as b, d as S, R as yn, S as ge, h as bn, e as jn, F as Sn, D as Fn, p as Cn, m as Tn, o as fe, n as V, k as wn, B as I } from "./Combination-CS4rK8IJ.js";
8
- import { g as X, h as de, C as F, I as he, i as Dn, u as Pn, a as Rn, F as _n, S as En, b as In, c as An, d as On, f as ce, V as $n } from "./Input-GFpPXs5b.js";
9
- import * as c from "react";
10
- import { useRef as xe, useEffect as ke, useState as Ne, Fragment as B } from "react";
11
- import { P as z, c as ye, R as Mn, I as Vn, S as me } from "./Spinner-oNQQyp-I.js";
12
- import { A as qn } from "./DevPortalProvider-BTFqdAEL.js";
13
- import { m as Ln } from "./router-BiRCp01d.js";
14
- /**
15
- * @license lucide-react v0.378.0 - ISC
16
- *
17
- * This source code is licensed under the ISC license.
18
- * See the LICENSE file in the root directory of this source tree.
19
- */
20
- const zn = L("ChevronsUpDown", [
21
- ["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
22
- ["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
23
- ]);
24
- /**
25
- * @license lucide-react v0.378.0 - ISC
26
- *
27
- * This source code is licensed under the ISC license.
28
- * See the LICENSE file in the root directory of this source tree.
29
- */
30
- const be = L("CirclePlay", [
31
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
32
- ["polygon", { points: "10 8 16 12 10 16 10 8", key: "1cimsy" }]
33
- ]);
34
- /**
35
- * @license lucide-react v0.378.0 - ISC
36
- *
37
- * This source code is licensed under the ISC license.
38
- * See the LICENSE file in the root directory of this source tree.
39
- */
40
- const je = L("Eraser", [
41
- [
42
- "path",
43
- {
44
- d: "m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",
45
- key: "182aya"
46
- }
47
- ],
48
- ["path", { d: "M22 21H7", key: "t4ddhn" }],
49
- ["path", { d: "m5 11 9 9", key: "1mo9qw" }]
50
- ]);
51
- /**
52
- * @license lucide-react v0.378.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */
57
- const Se = L("X", [
58
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
59
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
60
- ]), Za = {
61
- get: "text-green-600",
62
- post: "text-sky-600",
63
- put: "text-yellow-600",
64
- delete: "text-red-600",
65
- patch: "text-purple-600",
66
- options: "text-indigo-600",
67
- head: "text-gray-600",
68
- trace: "text-gray-600"
69
- }, Gn = {
70
- get: "bg-green-400 dark:bg-green-800",
71
- post: "bg-sky-400 dark:bg-sky-800",
72
- put: "bg-yellow-400 dark:bg-yellow-800",
73
- delete: "bg-red-400 dark:bg-red-800",
74
- patch: "bg-purple-400 dark:bg-purple-600",
75
- options: "bg-indigo-400 dark:bg-indigo-600",
76
- head: "bg-gray-400 dark:bg-gray-600",
77
- trace: "bg-gray-400 dark:bg-gray-600"
78
- }, Bn = ({ method: n }) => /* @__PURE__ */ e.jsx(
79
- "span",
80
- {
81
- className: g(
82
- "mt-0.5 flex items-center duration-200 transition-opacity text-center uppercase font-mono text-[0.65rem] font-bold rounded text-background dark:text-zinc-50 h-4 px-1",
83
- Gn[n]
84
- ),
85
- children: n
86
- }
87
- ), Hn = {
88
- kind: "Document",
89
- definitions: [
90
- {
91
- kind: "FragmentDefinition",
92
- name: { kind: "Name", value: "OperationsFragment" },
93
- typeCondition: {
94
- kind: "NamedType",
95
- name: { kind: "Name", value: "OperationItem" }
96
- },
97
- selectionSet: {
98
- kind: "SelectionSet",
99
- selections: [
100
- { kind: "Field", name: { kind: "Name", value: "slug" } },
101
- { kind: "Field", name: { kind: "Name", value: "summary" } },
102
- { kind: "Field", name: { kind: "Name", value: "method" } },
103
- { kind: "Field", name: { kind: "Name", value: "description" } },
104
- { kind: "Field", name: { kind: "Name", value: "operationId" } },
105
- { kind: "Field", name: { kind: "Name", value: "contentTypes" } },
106
- { kind: "Field", name: { kind: "Name", value: "path" } },
107
- {
108
- kind: "Field",
109
- name: { kind: "Name", value: "parameters" },
110
- selectionSet: {
111
- kind: "SelectionSet",
112
- selections: [
113
- { kind: "Field", name: { kind: "Name", value: "name" } },
114
- { kind: "Field", name: { kind: "Name", value: "in" } },
115
- { kind: "Field", name: { kind: "Name", value: "description" } },
116
- { kind: "Field", name: { kind: "Name", value: "required" } },
117
- { kind: "Field", name: { kind: "Name", value: "schema" } },
118
- { kind: "Field", name: { kind: "Name", value: "style" } },
119
- {
120
- kind: "Field",
121
- name: { kind: "Name", value: "examples" },
122
- selectionSet: {
123
- kind: "SelectionSet",
124
- selections: [
125
- { kind: "Field", name: { kind: "Name", value: "name" } },
126
- {
127
- kind: "Field",
128
- name: { kind: "Name", value: "description" }
129
- },
130
- {
131
- kind: "Field",
132
- name: { kind: "Name", value: "externalValue" }
133
- },
134
- { kind: "Field", name: { kind: "Name", value: "value" } },
135
- {
136
- kind: "Field",
137
- name: { kind: "Name", value: "summary" }
138
- }
139
- ]
140
- }
141
- }
142
- ]
143
- }
144
- },
145
- {
146
- kind: "Field",
147
- name: { kind: "Name", value: "requestBody" },
148
- selectionSet: {
149
- kind: "SelectionSet",
150
- selections: [
151
- {
152
- kind: "Field",
153
- name: { kind: "Name", value: "content" },
154
- selectionSet: {
155
- kind: "SelectionSet",
156
- selections: [
157
- {
158
- kind: "Field",
159
- name: { kind: "Name", value: "mediaType" }
160
- },
161
- {
162
- kind: "Field",
163
- name: { kind: "Name", value: "encoding" },
164
- selectionSet: {
165
- kind: "SelectionSet",
166
- selections: [
167
- {
168
- kind: "Field",
169
- name: { kind: "Name", value: "name" }
170
- }
171
- ]
172
- }
173
- },
174
- {
175
- kind: "Field",
176
- name: { kind: "Name", value: "schema" }
177
- }
178
- ]
179
- }
180
- },
181
- { kind: "Field", name: { kind: "Name", value: "description" } },
182
- { kind: "Field", name: { kind: "Name", value: "required" } }
183
- ]
184
- }
185
- },
186
- {
187
- kind: "Field",
188
- name: { kind: "Name", value: "responses" },
189
- selectionSet: {
190
- kind: "SelectionSet",
191
- selections: [
192
- { kind: "Field", name: { kind: "Name", value: "statusCode" } },
193
- { kind: "Field", name: { kind: "Name", value: "links" } },
194
- { kind: "Field", name: { kind: "Name", value: "description" } },
195
- {
196
- kind: "Field",
197
- name: { kind: "Name", value: "content" },
198
- selectionSet: {
199
- kind: "SelectionSet",
200
- selections: [
201
- {
202
- kind: "Field",
203
- name: { kind: "Name", value: "mediaType" }
204
- },
205
- {
206
- kind: "Field",
207
- name: { kind: "Name", value: "encoding" },
208
- selectionSet: {
209
- kind: "SelectionSet",
210
- selections: [
211
- {
212
- kind: "Field",
213
- name: { kind: "Name", value: "name" }
214
- }
215
- ]
216
- }
217
- },
218
- {
219
- kind: "Field",
220
- name: { kind: "Name", value: "schema" }
221
- }
222
- ]
223
- }
224
- }
225
- ]
226
- }
227
- }
228
- ]
229
- }
230
- }
231
- ]
232
- }, Wn = {
233
- kind: "Document",
234
- definitions: [
235
- {
236
- kind: "OperationDefinition",
237
- operation: "query",
238
- name: { kind: "Name", value: "AllOperations" },
239
- variableDefinitions: [
240
- {
241
- kind: "VariableDefinition",
242
- variable: {
243
- kind: "Variable",
244
- name: { kind: "Name", value: "input" }
245
- },
246
- type: {
247
- kind: "NonNullType",
248
- type: { kind: "NamedType", name: { kind: "Name", value: "JSON" } }
249
- }
250
- },
251
- {
252
- kind: "VariableDefinition",
253
- variable: { kind: "Variable", name: { kind: "Name", value: "type" } },
254
- type: {
255
- kind: "NonNullType",
256
- type: {
257
- kind: "NamedType",
258
- name: { kind: "Name", value: "SchemaType" }
259
- }
260
- }
261
- }
262
- ],
263
- selectionSet: {
264
- kind: "SelectionSet",
265
- selections: [
266
- {
267
- kind: "Field",
268
- name: { kind: "Name", value: "schema" },
269
- arguments: [
270
- {
271
- kind: "Argument",
272
- name: { kind: "Name", value: "input" },
273
- value: {
274
- kind: "Variable",
275
- name: { kind: "Name", value: "input" }
276
- }
277
- },
278
- {
279
- kind: "Argument",
280
- name: { kind: "Name", value: "type" },
281
- value: {
282
- kind: "Variable",
283
- name: { kind: "Name", value: "type" }
284
- }
285
- }
286
- ],
287
- selectionSet: {
288
- kind: "SelectionSet",
289
- selections: [
290
- { kind: "Field", name: { kind: "Name", value: "description" } },
291
- { kind: "Field", name: { kind: "Name", value: "title" } },
292
- { kind: "Field", name: { kind: "Name", value: "url" } },
293
- { kind: "Field", name: { kind: "Name", value: "version" } },
294
- {
295
- kind: "Field",
296
- name: { kind: "Name", value: "tags" },
297
- selectionSet: {
298
- kind: "SelectionSet",
299
- selections: [
300
- { kind: "Field", name: { kind: "Name", value: "name" } },
301
- {
302
- kind: "Field",
303
- name: { kind: "Name", value: "description" }
304
- },
305
- {
306
- kind: "Field",
307
- name: { kind: "Name", value: "operations" },
308
- selectionSet: {
309
- kind: "SelectionSet",
310
- selections: [
311
- {
312
- kind: "Field",
313
- name: { kind: "Name", value: "slug" }
314
- },
315
- {
316
- kind: "FragmentSpread",
317
- name: {
318
- kind: "Name",
319
- value: "OperationsFragment"
320
- }
321
- }
322
- ]
323
- }
324
- }
325
- ]
326
- }
327
- }
328
- ]
329
- }
330
- }
331
- ]
332
- }
333
- },
334
- {
335
- kind: "FragmentDefinition",
336
- name: { kind: "Name", value: "OperationsFragment" },
337
- typeCondition: {
338
- kind: "NamedType",
339
- name: { kind: "Name", value: "OperationItem" }
340
- },
341
- selectionSet: {
342
- kind: "SelectionSet",
343
- selections: [
344
- { kind: "Field", name: { kind: "Name", value: "slug" } },
345
- { kind: "Field", name: { kind: "Name", value: "summary" } },
346
- { kind: "Field", name: { kind: "Name", value: "method" } },
347
- { kind: "Field", name: { kind: "Name", value: "description" } },
348
- { kind: "Field", name: { kind: "Name", value: "operationId" } },
349
- { kind: "Field", name: { kind: "Name", value: "contentTypes" } },
350
- { kind: "Field", name: { kind: "Name", value: "path" } },
351
- {
352
- kind: "Field",
353
- name: { kind: "Name", value: "parameters" },
354
- selectionSet: {
355
- kind: "SelectionSet",
356
- selections: [
357
- { kind: "Field", name: { kind: "Name", value: "name" } },
358
- { kind: "Field", name: { kind: "Name", value: "in" } },
359
- { kind: "Field", name: { kind: "Name", value: "description" } },
360
- { kind: "Field", name: { kind: "Name", value: "required" } },
361
- { kind: "Field", name: { kind: "Name", value: "schema" } },
362
- { kind: "Field", name: { kind: "Name", value: "style" } },
363
- {
364
- kind: "Field",
365
- name: { kind: "Name", value: "examples" },
366
- selectionSet: {
367
- kind: "SelectionSet",
368
- selections: [
369
- { kind: "Field", name: { kind: "Name", value: "name" } },
370
- {
371
- kind: "Field",
372
- name: { kind: "Name", value: "description" }
373
- },
374
- {
375
- kind: "Field",
376
- name: { kind: "Name", value: "externalValue" }
377
- },
378
- { kind: "Field", name: { kind: "Name", value: "value" } },
379
- {
380
- kind: "Field",
381
- name: { kind: "Name", value: "summary" }
382
- }
383
- ]
384
- }
385
- }
386
- ]
387
- }
388
- },
389
- {
390
- kind: "Field",
391
- name: { kind: "Name", value: "requestBody" },
392
- selectionSet: {
393
- kind: "SelectionSet",
394
- selections: [
395
- {
396
- kind: "Field",
397
- name: { kind: "Name", value: "content" },
398
- selectionSet: {
399
- kind: "SelectionSet",
400
- selections: [
401
- {
402
- kind: "Field",
403
- name: { kind: "Name", value: "mediaType" }
404
- },
405
- {
406
- kind: "Field",
407
- name: { kind: "Name", value: "encoding" },
408
- selectionSet: {
409
- kind: "SelectionSet",
410
- selections: [
411
- {
412
- kind: "Field",
413
- name: { kind: "Name", value: "name" }
414
- }
415
- ]
416
- }
417
- },
418
- {
419
- kind: "Field",
420
- name: { kind: "Name", value: "schema" }
421
- }
422
- ]
423
- }
424
- },
425
- { kind: "Field", name: { kind: "Name", value: "description" } },
426
- { kind: "Field", name: { kind: "Name", value: "required" } }
427
- ]
428
- }
429
- },
430
- {
431
- kind: "Field",
432
- name: { kind: "Name", value: "responses" },
433
- selectionSet: {
434
- kind: "SelectionSet",
435
- selections: [
436
- { kind: "Field", name: { kind: "Name", value: "statusCode" } },
437
- { kind: "Field", name: { kind: "Name", value: "links" } },
438
- { kind: "Field", name: { kind: "Name", value: "description" } },
439
- {
440
- kind: "Field",
441
- name: { kind: "Name", value: "content" },
442
- selectionSet: {
443
- kind: "SelectionSet",
444
- selections: [
445
- {
446
- kind: "Field",
447
- name: { kind: "Name", value: "mediaType" }
448
- },
449
- {
450
- kind: "Field",
451
- name: { kind: "Name", value: "encoding" },
452
- selectionSet: {
453
- kind: "SelectionSet",
454
- selections: [
455
- {
456
- kind: "Field",
457
- name: { kind: "Name", value: "name" }
458
- }
459
- ]
460
- }
461
- },
462
- {
463
- kind: "Field",
464
- name: { kind: "Name", value: "schema" }
465
- }
466
- ]
467
- }
468
- }
469
- ]
470
- }
471
- }
472
- ]
473
- }
474
- }
475
- ]
476
- }, Un = {
477
- kind: "Document",
478
- definitions: [
479
- {
480
- kind: "OperationDefinition",
481
- operation: "query",
482
- name: { kind: "Name", value: "getServerQuery" },
483
- variableDefinitions: [
484
- {
485
- kind: "VariableDefinition",
486
- variable: {
487
- kind: "Variable",
488
- name: { kind: "Name", value: "input" }
489
- },
490
- type: {
491
- kind: "NonNullType",
492
- type: { kind: "NamedType", name: { kind: "Name", value: "JSON" } }
493
- }
494
- },
495
- {
496
- kind: "VariableDefinition",
497
- variable: { kind: "Variable", name: { kind: "Name", value: "type" } },
498
- type: {
499
- kind: "NonNullType",
500
- type: {
501
- kind: "NamedType",
502
- name: { kind: "Name", value: "SchemaType" }
503
- }
504
- }
505
- }
506
- ],
507
- selectionSet: {
508
- kind: "SelectionSet",
509
- selections: [
510
- {
511
- kind: "Field",
512
- name: { kind: "Name", value: "schema" },
513
- arguments: [
514
- {
515
- kind: "Argument",
516
- name: { kind: "Name", value: "input" },
517
- value: {
518
- kind: "Variable",
519
- name: { kind: "Name", value: "input" }
520
- }
521
- },
522
- {
523
- kind: "Argument",
524
- name: { kind: "Name", value: "type" },
525
- value: {
526
- kind: "Variable",
527
- name: { kind: "Name", value: "type" }
528
- }
529
- }
530
- ],
531
- selectionSet: {
532
- kind: "SelectionSet",
533
- selections: [
534
- { kind: "Field", name: { kind: "Name", value: "url" } }
535
- ]
536
- }
537
- }
538
- ]
539
- }
540
- }
541
- ]
542
- }, Jn = {
543
- kind: "Document",
544
- definitions: [
545
- {
546
- kind: "OperationDefinition",
547
- operation: "query",
548
- name: { kind: "Name", value: "GetCategories" },
549
- variableDefinitions: [
550
- {
551
- kind: "VariableDefinition",
552
- variable: {
553
- kind: "Variable",
554
- name: { kind: "Name", value: "input" }
555
- },
556
- type: {
557
- kind: "NonNullType",
558
- type: { kind: "NamedType", name: { kind: "Name", value: "JSON" } }
559
- }
560
- },
561
- {
562
- kind: "VariableDefinition",
563
- variable: { kind: "Variable", name: { kind: "Name", value: "type" } },
564
- type: {
565
- kind: "NonNullType",
566
- type: {
567
- kind: "NamedType",
568
- name: { kind: "Name", value: "SchemaType" }
569
- }
570
- }
571
- }
572
- ],
573
- selectionSet: {
574
- kind: "SelectionSet",
575
- selections: [
576
- {
577
- kind: "Field",
578
- name: { kind: "Name", value: "schema" },
579
- arguments: [
580
- {
581
- kind: "Argument",
582
- name: { kind: "Name", value: "input" },
583
- value: {
584
- kind: "Variable",
585
- name: { kind: "Name", value: "input" }
586
- }
587
- },
588
- {
589
- kind: "Argument",
590
- name: { kind: "Name", value: "type" },
591
- value: {
592
- kind: "Variable",
593
- name: { kind: "Name", value: "type" }
594
- }
595
- }
596
- ],
597
- selectionSet: {
598
- kind: "SelectionSet",
599
- selections: [
600
- {
601
- kind: "Field",
602
- name: { kind: "Name", value: "tags" },
603
- selectionSet: {
604
- kind: "SelectionSet",
605
- selections: [
606
- {
607
- kind: "Field",
608
- name: { kind: "Name", value: "__typename" }
609
- },
610
- { kind: "Field", name: { kind: "Name", value: "name" } },
611
- {
612
- kind: "Field",
613
- name: { kind: "Name", value: "operations" },
614
- selectionSet: {
615
- kind: "SelectionSet",
616
- selections: [
617
- {
618
- kind: "Field",
619
- name: { kind: "Name", value: "__typename" }
620
- },
621
- {
622
- kind: "Field",
623
- name: { kind: "Name", value: "slug" }
624
- },
625
- {
626
- kind: "Field",
627
- name: { kind: "Name", value: "deprecated" }
628
- },
629
- {
630
- kind: "Field",
631
- name: { kind: "Name", value: "method" }
632
- },
633
- {
634
- kind: "Field",
635
- name: { kind: "Name", value: "summary" }
636
- },
637
- {
638
- kind: "Field",
639
- name: { kind: "Name", value: "operationId" }
640
- },
641
- {
642
- kind: "Field",
643
- name: { kind: "Name", value: "path" }
644
- }
645
- ]
646
- }
647
- }
648
- ]
649
- }
650
- }
651
- ]
652
- }
653
- }
654
- ]
655
- }
656
- }
657
- ]
658
- }, Qn = {
659
- "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n": Hn,
660
- "\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n": Wn,
661
- "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n": Un,
662
- "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n": Jn
663
- };
664
- function Kn(n) {
665
- return Qn[n] ?? {};
666
- }
667
- const Xn = ({
668
- title: n = "An error occurred",
669
- message: a,
670
- category: t
671
- }) => /* @__PURE__ */ e.jsxs("div", { className: mn + " h-full pt-[--padding-content-top]", children: [
672
- t && /* @__PURE__ */ e.jsx(Nn, { children: t }),
673
- n && /* @__PURE__ */ e.jsx(un, { level: 1, className: "flex gap-3.5 items-center", children: n }),
674
- /* @__PURE__ */ e.jsx("p", { children: a }),
675
- /* @__PURE__ */ e.jsx(kn, { to: "/", children: "Go back home" })
676
- ] });
677
- var Y = "Dialog", [Fe, et] = ve(Y), [Yn, k] = Fe(Y), Ce = (n) => {
678
- const {
679
- __scopeDialog: a,
680
- children: t,
681
- open: i,
682
- defaultOpen: s,
683
- onOpenChange: r,
684
- modal: l = !0
685
- } = n, o = c.useRef(null), u = c.useRef(null), [m = !1, p] = fe({
686
- prop: i,
687
- defaultProp: s,
688
- onChange: r
689
- });
690
- return /* @__PURE__ */ e.jsx(
691
- Yn,
692
- {
693
- scope: a,
694
- triggerRef: o,
695
- contentRef: u,
696
- contentId: V(),
697
- titleId: V(),
698
- descriptionId: V(),
699
- open: m,
700
- onOpenChange: p,
701
- onOpenToggle: c.useCallback(() => p((v) => !v), [p]),
702
- modal: l,
703
- children: t
704
- }
705
- );
706
- };
707
- Ce.displayName = Y;
708
- var Te = "DialogTrigger", we = c.forwardRef(
709
- (n, a) => {
710
- const { __scopeDialog: t, ...i } = n, s = k(Te, t), r = K(a, s.triggerRef);
711
- return /* @__PURE__ */ e.jsx(
712
- b.button,
713
- {
714
- type: "button",
715
- "aria-haspopup": "dialog",
716
- "aria-expanded": s.open,
717
- "aria-controls": s.contentId,
718
- "data-state": ne(s.open),
719
- ...i,
720
- ref: r,
721
- onClick: S(n.onClick, s.onOpenToggle)
722
- }
723
- );
724
- }
725
- );
726
- we.displayName = Te;
727
- var Z = "DialogPortal", [Zn, De] = Fe(Z, {
728
- forceMount: void 0
729
- }), Pe = (n) => {
730
- const { __scopeDialog: a, forceMount: t, children: i, container: s } = n, r = k(Z, a);
731
- return /* @__PURE__ */ e.jsx(Zn, { scope: a, forceMount: t, children: c.Children.map(i, (l) => /* @__PURE__ */ e.jsx(z, { present: t || r.open, children: /* @__PURE__ */ e.jsx(Tn, { asChild: !0, container: s, children: l }) })) });
732
- };
733
- Pe.displayName = Z;
734
- var q = "DialogOverlay", Re = c.forwardRef(
735
- (n, a) => {
736
- const t = De(q, n.__scopeDialog), { forceMount: i = t.forceMount, ...s } = n, r = k(q, n.__scopeDialog);
737
- return r.modal ? /* @__PURE__ */ e.jsx(z, { present: i || r.open, children: /* @__PURE__ */ e.jsx(ea, { ...s, ref: a }) }) : null;
738
- }
739
- );
740
- Re.displayName = q;
741
- var ea = c.forwardRef(
742
- (n, a) => {
743
- const { __scopeDialog: t, ...i } = n, s = k(q, t);
744
- return (
745
- // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
746
- // ie. when `Overlay` and `Content` are siblings
747
- /* @__PURE__ */ e.jsx(yn, { as: ge, allowPinchZoom: !0, shards: [s.contentRef], children: /* @__PURE__ */ e.jsx(
748
- b.div,
749
- {
750
- "data-state": ne(s.open),
751
- ...i,
752
- ref: a,
753
- style: { pointerEvents: "auto", ...i.style }
754
- }
755
- ) })
756
- );
757
- }
758
- ), C = "DialogContent", _e = c.forwardRef(
759
- (n, a) => {
760
- const t = De(C, n.__scopeDialog), { forceMount: i = t.forceMount, ...s } = n, r = k(C, n.__scopeDialog);
761
- return /* @__PURE__ */ e.jsx(z, { present: i || r.open, children: r.modal ? /* @__PURE__ */ e.jsx(na, { ...s, ref: a }) : /* @__PURE__ */ e.jsx(aa, { ...s, ref: a }) });
762
- }
763
- );
764
- _e.displayName = C;
765
- var na = c.forwardRef(
766
- (n, a) => {
767
- const t = k(C, n.__scopeDialog), i = c.useRef(null), s = K(a, t.contentRef, i);
768
- return c.useEffect(() => {
769
- const r = i.current;
770
- if (r) return bn(r);
771
- }, []), /* @__PURE__ */ e.jsx(
772
- Ee,
773
- {
774
- ...n,
775
- ref: s,
776
- trapFocus: t.open,
777
- disableOutsidePointerEvents: !0,
778
- onCloseAutoFocus: S(n.onCloseAutoFocus, (r) => {
779
- var l;
780
- r.preventDefault(), (l = t.triggerRef.current) == null || l.focus();
781
- }),
782
- onPointerDownOutside: S(n.onPointerDownOutside, (r) => {
783
- const l = r.detail.originalEvent, o = l.button === 0 && l.ctrlKey === !0;
784
- (l.button === 2 || o) && r.preventDefault();
785
- }),
786
- onFocusOutside: S(
787
- n.onFocusOutside,
788
- (r) => r.preventDefault()
789
- )
790
- }
791
- );
792
- }
793
- ), aa = c.forwardRef(
794
- (n, a) => {
795
- const t = k(C, n.__scopeDialog), i = c.useRef(!1), s = c.useRef(!1);
796
- return /* @__PURE__ */ e.jsx(
797
- Ee,
798
- {
799
- ...n,
800
- ref: a,
801
- trapFocus: !1,
802
- disableOutsidePointerEvents: !1,
803
- onCloseAutoFocus: (r) => {
804
- var l, o;
805
- (l = n.onCloseAutoFocus) == null || l.call(n, r), r.defaultPrevented || (i.current || (o = t.triggerRef.current) == null || o.focus(), r.preventDefault()), i.current = !1, s.current = !1;
806
- },
807
- onInteractOutside: (r) => {
808
- var u, m;
809
- (u = n.onInteractOutside) == null || u.call(n, r), r.defaultPrevented || (i.current = !0, r.detail.originalEvent.type === "pointerdown" && (s.current = !0));
810
- const l = r.target;
811
- ((m = t.triggerRef.current) == null ? void 0 : m.contains(l)) && r.preventDefault(), r.detail.originalEvent.type === "focusin" && s.current && r.preventDefault();
812
- }
813
- }
814
- );
815
- }
816
- ), Ee = c.forwardRef(
817
- (n, a) => {
818
- const { __scopeDialog: t, trapFocus: i, onOpenAutoFocus: s, onCloseAutoFocus: r, ...l } = n, o = k(C, t), u = c.useRef(null), m = K(a, u);
819
- return jn(), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
820
- /* @__PURE__ */ e.jsx(
821
- Sn,
822
- {
823
- asChild: !0,
824
- loop: !0,
825
- trapped: i,
826
- onMountAutoFocus: s,
827
- onUnmountAutoFocus: r,
828
- children: /* @__PURE__ */ e.jsx(
829
- Fn,
830
- {
831
- role: "dialog",
832
- id: o.contentId,
833
- "aria-describedby": o.descriptionId,
834
- "aria-labelledby": o.titleId,
835
- "data-state": ne(o.open),
836
- ...l,
837
- ref: m,
838
- onDismiss: () => o.onOpenChange(!1)
839
- }
840
- )
841
- }
842
- ),
843
- /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
844
- /* @__PURE__ */ e.jsx(ta, { titleId: o.titleId }),
845
- /* @__PURE__ */ e.jsx(sa, { contentRef: u, descriptionId: o.descriptionId })
846
- ] })
847
- ] });
848
- }
849
- ), ee = "DialogTitle", Ie = c.forwardRef(
850
- (n, a) => {
851
- const { __scopeDialog: t, ...i } = n, s = k(ee, t);
852
- return /* @__PURE__ */ e.jsx(b.h2, { id: s.titleId, ...i, ref: a });
853
- }
854
- );
855
- Ie.displayName = ee;
856
- var Ae = "DialogDescription", Oe = c.forwardRef(
857
- (n, a) => {
858
- const { __scopeDialog: t, ...i } = n, s = k(Ae, t);
859
- return /* @__PURE__ */ e.jsx(b.p, { id: s.descriptionId, ...i, ref: a });
860
- }
861
- );
862
- Oe.displayName = Ae;
863
- var $e = "DialogClose", Me = c.forwardRef(
864
- (n, a) => {
865
- const { __scopeDialog: t, ...i } = n, s = k($e, t);
866
- return /* @__PURE__ */ e.jsx(
867
- b.button,
868
- {
869
- type: "button",
870
- ...i,
871
- ref: a,
872
- onClick: S(n.onClick, () => s.onOpenChange(!1))
873
- }
874
- );
875
- }
876
- );
877
- Me.displayName = $e;
878
- function ne(n) {
879
- return n ? "open" : "closed";
880
- }
881
- var Ve = "DialogTitleWarning", [nt, qe] = Cn(Ve, {
882
- contentName: C,
883
- titleName: ee,
884
- docsSlug: "dialog"
885
- }), ta = ({ titleId: n }) => {
886
- const a = qe(Ve), t = `\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
887
-
888
- If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
889
-
890
- For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;
891
- return c.useEffect(() => {
892
- n && (document.getElementById(n) || console.error(t));
893
- }, [t, n]), null;
894
- }, ia = "DialogDescriptionWarning", sa = ({ contentRef: n, descriptionId: a }) => {
895
- const i = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qe(ia).contentName}}.`;
896
- return c.useEffect(() => {
897
- var r;
898
- const s = (r = n.current) == null ? void 0 : r.getAttribute("aria-describedby");
899
- a && s && (document.getElementById(a) || console.warn(i));
900
- }, [i, n, a]), null;
901
- }, ra = Ce, oa = we, la = Pe, Le = Re, ze = _e, Ge = Ie, Be = Oe, da = Me;
902
- const ca = ra, ma = oa, ua = la, He = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
903
- Le,
904
- {
905
- ref: t,
906
- className: g(
907
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
908
- n
909
- ),
910
- ...a
911
- }
912
- ));
913
- He.displayName = Le.displayName;
914
- const We = c.forwardRef(({ className: n, children: a, ...t }, i) => /* @__PURE__ */ e.jsxs(ua, { children: [
915
- /* @__PURE__ */ e.jsx(He, {}),
916
- /* @__PURE__ */ e.jsxs(
917
- ze,
918
- {
919
- ref: i,
920
- className: g(
921
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg border-border",
922
- n
923
- ),
924
- ...t,
925
- children: [
926
- a,
927
- /* @__PURE__ */ e.jsxs(da, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
928
- /* @__PURE__ */ e.jsx(Se, { className: "h-4 w-4" }),
929
- /* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Close" })
930
- ] })
931
- ]
932
- }
933
- )
934
- ] }));
935
- We.displayName = ze.displayName;
936
- const Ue = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
937
- Ge,
938
- {
939
- ref: t,
940
- className: g(
941
- "text-lg font-semibold leading-none tracking-tight",
942
- n
943
- ),
944
- ...a
945
- }
946
- ));
947
- Ue.displayName = Ge.displayName;
948
- const pa = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
949
- Be,
950
- {
951
- ref: t,
952
- className: g("text-sm text-muted-foreground", n),
953
- ...a
954
- }
955
- ));
956
- pa.displayName = Be.displayName;
957
- const ae = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
958
- "div",
959
- {
960
- ref: t,
961
- className: g(
962
- "rounded-xl border bg-card text-card-foreground shadow",
963
- n
964
- ),
965
- ...a
966
- }
967
- ));
968
- ae.displayName = "Card";
969
- const va = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
970
- "div",
971
- {
972
- ref: t,
973
- className: g("flex flex-col space-y-1.5 p-6", n),
974
- ...a
975
- }
976
- ));
977
- va.displayName = "CardHeader";
978
- const ga = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
979
- "h3",
980
- {
981
- ref: t,
982
- className: g("font-semibold leading-none tracking-tight", n),
983
- ...a
984
- }
985
- ));
986
- ga.displayName = "CardTitle";
987
- const fa = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
988
- "p",
989
- {
990
- ref: t,
991
- className: g("text-sm text-muted-foreground", n),
992
- ...a
993
- }
994
- ));
995
- fa.displayName = "CardDescription";
996
- const ha = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx("div", { ref: t, className: g("p-6 pt-0", n), ...a }));
997
- ha.displayName = "CardContent";
998
- const xa = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
999
- "div",
1000
- {
1001
- ref: t,
1002
- className: g("flex items-center p-6 pt-0", n),
1003
- ...a
1004
- }
1005
- ));
1006
- xa.displayName = "CardFooter";
1007
- var te = "Tabs", [ka, at] = ve(te, [
1008
- ye
1009
- ]), Je = ye(), [Na, ie] = ka(te), Qe = c.forwardRef(
1010
- (n, a) => {
1011
- const {
1012
- __scopeTabs: t,
1013
- value: i,
1014
- onValueChange: s,
1015
- defaultValue: r,
1016
- orientation: l = "horizontal",
1017
- dir: o,
1018
- activationMode: u = "automatic",
1019
- ...m
1020
- } = n, p = wn(o), [v, N] = fe({
1021
- prop: i,
1022
- onChange: s,
1023
- defaultProp: r
1024
- });
1025
- return /* @__PURE__ */ e.jsx(
1026
- Na,
1027
- {
1028
- scope: t,
1029
- baseId: V(),
1030
- value: v,
1031
- onValueChange: N,
1032
- orientation: l,
1033
- dir: p,
1034
- activationMode: u,
1035
- children: /* @__PURE__ */ e.jsx(
1036
- b.div,
1037
- {
1038
- dir: p,
1039
- "data-orientation": l,
1040
- ...m,
1041
- ref: a
1042
- }
1043
- )
1044
- }
1045
- );
1046
- }
1047
- );
1048
- Qe.displayName = te;
1049
- var Ke = "TabsList", Xe = c.forwardRef(
1050
- (n, a) => {
1051
- const { __scopeTabs: t, loop: i = !0, ...s } = n, r = ie(Ke, t), l = Je(t);
1052
- return /* @__PURE__ */ e.jsx(
1053
- Mn,
1054
- {
1055
- asChild: !0,
1056
- ...l,
1057
- orientation: r.orientation,
1058
- dir: r.dir,
1059
- loop: i,
1060
- children: /* @__PURE__ */ e.jsx(
1061
- b.div,
1062
- {
1063
- role: "tablist",
1064
- "aria-orientation": r.orientation,
1065
- ...s,
1066
- ref: a
1067
- }
1068
- )
1069
- }
1070
- );
1071
- }
1072
- );
1073
- Xe.displayName = Ke;
1074
- var Ye = "TabsTrigger", Ze = c.forwardRef(
1075
- (n, a) => {
1076
- const { __scopeTabs: t, value: i, disabled: s = !1, ...r } = n, l = ie(Ye, t), o = Je(t), u = an(l.baseId, i), m = tn(l.baseId, i), p = i === l.value;
1077
- return /* @__PURE__ */ e.jsx(
1078
- Vn,
1079
- {
1080
- asChild: !0,
1081
- ...o,
1082
- focusable: !s,
1083
- active: p,
1084
- children: /* @__PURE__ */ e.jsx(
1085
- b.button,
1086
- {
1087
- type: "button",
1088
- role: "tab",
1089
- "aria-selected": p,
1090
- "aria-controls": m,
1091
- "data-state": p ? "active" : "inactive",
1092
- "data-disabled": s ? "" : void 0,
1093
- disabled: s,
1094
- id: u,
1095
- ...r,
1096
- ref: a,
1097
- onMouseDown: S(n.onMouseDown, (v) => {
1098
- !s && v.button === 0 && v.ctrlKey === !1 ? l.onValueChange(i) : v.preventDefault();
1099
- }),
1100
- onKeyDown: S(n.onKeyDown, (v) => {
1101
- [" ", "Enter"].includes(v.key) && l.onValueChange(i);
1102
- }),
1103
- onFocus: S(n.onFocus, () => {
1104
- const v = l.activationMode !== "manual";
1105
- !p && !s && v && l.onValueChange(i);
1106
- })
1107
- }
1108
- )
1109
- }
1110
- );
1111
- }
1112
- );
1113
- Ze.displayName = Ye;
1114
- var en = "TabsContent", nn = c.forwardRef(
1115
- (n, a) => {
1116
- const { __scopeTabs: t, value: i, forceMount: s, children: r, ...l } = n, o = ie(en, t), u = an(o.baseId, i), m = tn(o.baseId, i), p = i === o.value, v = c.useRef(p);
1117
- return c.useEffect(() => {
1118
- const N = requestAnimationFrame(() => v.current = !1);
1119
- return () => cancelAnimationFrame(N);
1120
- }, []), /* @__PURE__ */ e.jsx(z, { present: s || p, children: ({ present: N }) => /* @__PURE__ */ e.jsx(
1121
- b.div,
1122
- {
1123
- "data-state": p ? "active" : "inactive",
1124
- "data-orientation": o.orientation,
1125
- role: "tabpanel",
1126
- "aria-labelledby": u,
1127
- hidden: !N,
1128
- id: m,
1129
- tabIndex: 0,
1130
- ...l,
1131
- ref: a,
1132
- style: {
1133
- ...n.style,
1134
- animationDuration: v.current ? "0s" : void 0
1135
- },
1136
- children: N && r
1137
- }
1138
- ) });
1139
- }
1140
- );
1141
- nn.displayName = en;
1142
- function an(n, a) {
1143
- return `${n}-trigger-${a}`;
1144
- }
1145
- function tn(n, a) {
1146
- return `${n}-content-${a}`;
1147
- }
1148
- var ya = Qe, sn = Xe, rn = Ze, on = nn;
1149
- const ue = ya, J = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
1150
- sn,
1151
- {
1152
- ref: t,
1153
- className: g(
1154
- "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
1155
- n
1156
- ),
1157
- ...a
1158
- }
1159
- ));
1160
- J.displayName = sn.displayName;
1161
- const D = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
1162
- rn,
1163
- {
1164
- ref: t,
1165
- className: g(
1166
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
1167
- n
1168
- ),
1169
- ...a
1170
- }
1171
- ));
1172
- D.displayName = rn.displayName;
1173
- const P = c.forwardRef(({ className: n, ...a }, t) => /* @__PURE__ */ e.jsx(
1174
- on,
1175
- {
1176
- ref: t,
1177
- className: g(
1178
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1179
- n
1180
- ),
1181
- ...a
1182
- }
1183
- ));
1184
- P.displayName = on.displayName;
1185
- const ba = async (n, a, t = 5e3) => {
1186
- const i = new AbortController(), s = i.signal, r = fetch(n, { ...a, signal: s }), l = new Promise((o, u) => {
1187
- const m = setTimeout(() => {
1188
- i.abort("Request timed out"), u(new Error("Request timed out"));
1189
- }, t);
1190
- r.finally(() => clearTimeout(m));
1191
- });
1192
- return Promise.race([r, l]);
1193
- }, H = (n) => Math.abs(
1194
- isNaN(parseInt(n)) ? n.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(n)) ? 0 : parseInt(n)
1195
- ), W = (n) => n.length > 1 ? parseInt(n.split("").reduce((a, t) => `${H(a) + H(t)}`)) : H(n), ja = (n, a = {}) => {
1196
- const t = (3 * W(n) + 2 * W(n) + W(n)) % 360, { saturation: i = 75, lightness: s = 60 } = a;
1197
- return `${t}deg ${i}% ${s}%`;
1198
- }, U = "data-linked-param", Sa = (n) => {
1199
- const [a] = pn();
1200
- return ja(
1201
- n,
1202
- a ? void 0 : { saturation: 85, lightness: 50 }
1203
- );
1204
- }, ln = ({
1205
- name: n,
1206
- className: a,
1207
- backgroundOpacity: t = "100%",
1208
- borderOpacity: i = "100%",
1209
- slug: s,
1210
- children: r,
1211
- onClick: l
1212
- }) => {
1213
- const o = xe(null), u = n.replace(/[{}]/g, ""), m = s == null ? void 0 : s.replace(/[{}]/g, ""), p = Sa(u), v = `hsl(${p} / ${i})`, N = `hsl(${p} / ${t})`;
1214
- return ke(() => {
1215
- if (!m || !o.current) return;
1216
- const y = () => {
1217
- document.querySelectorAll(`[${U}="${m}"]`).forEach((h) => {
1218
- h instanceof HTMLElement && (h.dataset.active = "true");
1219
- });
1220
- }, j = () => {
1221
- document.querySelectorAll(`[${U}="${m}"]`).forEach((h) => {
1222
- h instanceof HTMLElement && (h.dataset.active = "false");
1223
- });
1224
- };
1225
- return o.current.addEventListener("mouseenter", y), o.current.addEventListener("mouseleave", j), () => {
1226
- var h, f;
1227
- (h = o.current) == null || h.removeEventListener("mouseenter", y), (f = o.current) == null || f.removeEventListener("mouseleave", j);
1228
- };
1229
- }, [m]), /* @__PURE__ */ e.jsxs(
1230
- "span",
1231
- {
1232
- className: g("inline-flex relative rounded group", a),
1233
- [U]: m,
1234
- ref: o,
1235
- onClick: l,
1236
- children: [
1237
- /* @__PURE__ */ e.jsx(
1238
- "span",
1239
- {
1240
- className: "absolute inset-0 border-b-2 transition-opacity duration-200 opacity-30 group-data-[active=true]:opacity-100",
1241
- style: { borderColor: v, backgroundColor: N }
1242
- }
1243
- ),
1244
- /* @__PURE__ */ e.jsx("span", { className: "relative", children: r ?? n })
1245
- ]
1246
- }
1247
- );
1248
- }, Fa = (n, a, t) => {
1249
- const i = a.replace(
1250
- /\{(\w+)}/g,
1251
- (r, l) => {
1252
- var o;
1253
- return ((o = t.pathParams.find((u) => u.name === l)) == null ? void 0 : o.value) || `{${l}}`;
1254
- }
1255
- ), s = new URL(i, n);
1256
- return t.queryParams.filter((r) => r.active).forEach((r) => {
1257
- s.searchParams.set(r.name, r.value);
1258
- }), s;
1259
- }, Ca = (n, a) => {
1260
- const t = c.forwardRef(({ className: i, asChild: s, ...r }, l) => {
1261
- const o = s ? ge : n;
1262
- return c.createElement(o, {
1263
- ...r,
1264
- ref: l,
1265
- className: g(a, i)
1266
- });
1267
- });
1268
- return t.displayName = `VariantComponent(${n})`, t;
1269
- }, Q = Ca(
1270
- "input",
1271
- "px-2 bg-transparent h-6 font-mono text-xs m-2"
1272
- ), Ta = ({
1273
- control: n,
1274
- register: a
1275
- }) => {
1276
- const { fields: t, append: i, remove: s } = X({
1277
- control: n,
1278
- name: "headers"
1279
- }), r = de({ name: "identity", control: n }), l = de({ name: "headers", control: n }), o = r !== E;
1280
- return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-[1fr_1fr_auto]", children: [
1281
- t.map((u, m) => {
1282
- var v;
1283
- const p = o && ((v = l.at(m)) == null ? void 0 : v.name) === "Authorization";
1284
- return /* @__PURE__ */ e.jsxs(
1285
- "div",
1286
- {
1287
- className: g(
1288
- "grid-cols-subgrid col-span-full grid items-center gap-x-2 has-[:focus]:bg-muted hover:bg-muted rounded overflow-hidden group",
1289
- p && "line-through"
1290
- ),
1291
- title: p ? "This header is disabled because authentication was selected" : void 0,
1292
- children: [
1293
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
1294
- /* @__PURE__ */ e.jsx(
1295
- Q,
1296
- {
1297
- ...a(`headers.${m}.name`),
1298
- placeholder: "Name",
1299
- className: "peer",
1300
- autoComplete: "off"
1301
- }
1302
- ),
1303
- p && /* @__PURE__ */ e.jsx(vn, { size: 16, className: "text-amber-500" })
1304
- ] }),
1305
- /* @__PURE__ */ e.jsx(
1306
- Q,
1307
- {
1308
- placeholder: "Value",
1309
- className: "peer",
1310
- ...a(`headers.${m}.value`),
1311
- autoComplete: "off"
1312
- }
1313
- ),
1314
- /* @__PURE__ */ e.jsx(
1315
- "button",
1316
- {
1317
- className: "hover:bg-black/5 p-1 rounded mr-2 text-muted-foreground invisible group-hover:visible peer-focus:visible",
1318
- onClick: () => {
1319
- s(m);
1320
- },
1321
- type: "button",
1322
- children: /* @__PURE__ */ e.jsx(Se, { size: 16 })
1323
- }
1324
- ),
1325
- /* @__PURE__ */ e.jsx("div", { className: "col-span-full border-b border-border" })
1326
- ]
1327
- },
1328
- u.id
1329
- );
1330
- }),
1331
- /* @__PURE__ */ e.jsx(
1332
- I,
1333
- {
1334
- className: "col-span-full mt-4",
1335
- onClick: () => i({ name: "", value: "" }),
1336
- type: "button",
1337
- children: "Add header"
1338
- }
1339
- )
1340
- ] });
1341
- }, wa = ({
1342
- control: n
1343
- }) => {
1344
- const { fields: a } = X({
1345
- control: n,
1346
- name: "pathParams"
1347
- });
1348
- return /* @__PURE__ */ e.jsx("table", { className: "w-full table-auto [&_td]:border [&_td]:py-1 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: a.map((t, i) => /* @__PURE__ */ e.jsxs("tr", { className: "hover:bg-accent/40", children: [
1349
- /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsx(
1350
- F,
1351
- {
1352
- control: n,
1353
- name: `pathParams.${i}.value`,
1354
- render: ({ field: s }) => /* @__PURE__ */ e.jsxs("div", { children: [
1355
- /* @__PURE__ */ e.jsx(
1356
- ln,
1357
- {
1358
- slug: t.name,
1359
- name: t.name,
1360
- backgroundOpacity: "25%",
1361
- borderOpacity: s.value ? "100%" : "0",
1362
- className: g(
1363
- "font-mono text-xs m-2",
1364
- !s.value && "opacity-60"
1365
- )
1366
- }
1367
- ),
1368
- "*"
1369
- ] })
1370
- }
1371
- ) }),
1372
- /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
1373
- /* @__PURE__ */ e.jsx(
1374
- F,
1375
- {
1376
- control: n,
1377
- name: `pathParams.${i}.value`,
1378
- render: ({ field: s }) => /* @__PURE__ */ e.jsx(
1379
- he,
1380
- {
1381
- ...s,
1382
- placeholder: "Enter value",
1383
- className: g(
1384
- "border-0 shadow-none ring-0 font-mono text-xs"
1385
- )
1386
- }
1387
- )
1388
- }
1389
- ),
1390
- /* @__PURE__ */ e.jsx(
1391
- F,
1392
- {
1393
- control: n,
1394
- name: `pathParams.${i}.value`,
1395
- render: ({ field: s }) => /* @__PURE__ */ e.jsx(
1396
- I,
1397
- {
1398
- size: "icon",
1399
- type: "button",
1400
- variant: "ghost",
1401
- "aria-label": "Clear value",
1402
- className: g(
1403
- "ms-2",
1404
- s.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
1405
- ),
1406
- title: "Clear value",
1407
- onClick: () => s.onChange(""),
1408
- children: /* @__PURE__ */ e.jsx(je, { size: 16 })
1409
- }
1410
- )
1411
- }
1412
- )
1413
- ] }) })
1414
- ] }, t.id)) }) });
1415
- }, Da = ({
1416
- control: n,
1417
- queryParams: a
1418
- }) => {
1419
- const { fields: t } = X({
1420
- control: n,
1421
- name: "queryParams"
1422
- }), i = Dn(), s = a.map((o) => !!o.isRequired), l = i.watch("identity") !== E;
1423
- return /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: t.filter(
1424
- // TODO remove this hack for Accu or make it more generic
1425
- (o) => !(l && o.name === "apikey")
1426
- ).map((o, u) => /* @__PURE__ */ e.jsxs("tr", { className: "hover:bg-accent/40", children: [
1427
- /* @__PURE__ */ e.jsx("td", { className: "text-center", children: /* @__PURE__ */ e.jsx(
1428
- F,
1429
- {
1430
- control: n,
1431
- name: `queryParams.${u}.active`,
1432
- render: ({ field: m }) => /* @__PURE__ */ e.jsx(
1433
- "input",
1434
- {
1435
- type: "checkbox",
1436
- id: `queryParams.${u}.active`,
1437
- checked: m.value,
1438
- onChange: m.onChange
1439
- }
1440
- )
1441
- }
1442
- ) }),
1443
- /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsx(
1444
- F,
1445
- {
1446
- control: n,
1447
- render: ({ field: m }) => /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1448
- "label",
1449
- {
1450
- className: "flex items-center cursor-pointer",
1451
- htmlFor: `queryParams.${u}.active`,
1452
- title: s[u] ? "Required field" : void 0,
1453
- children: [
1454
- m.value,
1455
- s[u] && /* @__PURE__ */ e.jsx("sup", { children: " *" })
1456
- ]
1457
- }
1458
- ) }),
1459
- name: `queryParams.${u}.name`
1460
- }
1461
- ) }),
1462
- /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
1463
- /* @__PURE__ */ e.jsx(
1464
- F,
1465
- {
1466
- control: n,
1467
- render: ({ field: m }) => /* @__PURE__ */ e.jsx(
1468
- he,
1469
- {
1470
- ...m,
1471
- onChange: (p) => {
1472
- m.onChange(p.target.value), p.target.value.length > 0 && i.setValue(`queryParams.${u}.active`, !0);
1473
- },
1474
- placeholder: "Enter value",
1475
- className: "w-full border-0 shadow-none text-xs font-mono"
1476
- }
1477
- ),
1478
- name: `queryParams.${u}.value`
1479
- }
1480
- ),
1481
- /* @__PURE__ */ e.jsx(
1482
- F,
1483
- {
1484
- control: n,
1485
- render: ({ field: m }) => /* @__PURE__ */ e.jsx(
1486
- I,
1487
- {
1488
- size: "icon",
1489
- type: "button",
1490
- variant: "ghost",
1491
- "aria-label": "Clear value",
1492
- className: g(
1493
- "ms-2",
1494
- m.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
1495
- ),
1496
- title: "Clear value",
1497
- onClick: () => m.onChange(""),
1498
- children: /* @__PURE__ */ e.jsx(je, { size: 16 })
1499
- }
1500
- ),
1501
- name: `queryParams.${u}.value`
1502
- }
1503
- )
1504
- ] }) })
1505
- ] }, o.id)) }) }) });
1506
- }, Pa = ({
1507
- value: n,
1508
- onChange: a,
1509
- className: t,
1510
- options: i
1511
- }) => /* @__PURE__ */ e.jsxs("div", { className: g("grid", t), children: [
1512
- /* @__PURE__ */ e.jsx(
1513
- "select",
1514
- {
1515
- className: g(
1516
- "row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
1517
- "rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75"
1518
- ),
1519
- value: n,
1520
- onChange: a,
1521
- children: i.map((s) => /* @__PURE__ */ e.jsx("option", { value: s.value, children: s.label }, s.value))
1522
- }
1523
- ),
1524
- /* @__PURE__ */ e.jsx("div", { className: "row-start-1 col-start-1 self-center justify-self-end relative end-2 pointer-events-none", children: /* @__PURE__ */ e.jsx(zn, { size: 14 }) })
1525
- ] }), Ra = (n) => {
1526
- var t;
1527
- return (t = Object.entries({
1528
- "application/json": "json",
1529
- "text/json": "json",
1530
- "text/html": "html",
1531
- "text/css": "css",
1532
- "text/javascript": "javascript",
1533
- "application/xml": "xml",
1534
- "application/xhtml+xml": "xhtml"
1535
- }).find(
1536
- ([i]) => n.includes(i)
1537
- )) == null ? void 0 : t[1];
1538
- }, _a = (n) => {
1539
- const a = n.get("Content-Type") || "";
1540
- return Ra(a);
1541
- }, Ea = (n) => {
1542
- try {
1543
- return JSON.stringify(JSON.parse(n), null, 2);
1544
- } catch {
1545
- return null;
1546
- }
1547
- }, Ia = ({
1548
- body: n = "",
1549
- headers: a
1550
- }) => {
1551
- const t = _a(a), i = Ea(n), s = i || n, [r, l] = Ne(
1552
- i ? "formatted" : "raw"
1553
- );
1554
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1555
- /* @__PURE__ */ e.jsx(ae, { className: "shadow-none", children: /* @__PURE__ */ e.jsx(
1556
- pe,
1557
- {
1558
- language: r === "raw" ? i ? "plain" : t : "json",
1559
- noBackground: !0,
1560
- showLanguageIndicator: !0,
1561
- className: "overflow-x-auto p-4 text-xs",
1562
- code: r === "raw" ? n : s
1563
- }
1564
- ) }),
1565
- i && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
1566
- Pa,
1567
- {
1568
- value: r,
1569
- onChange: (o) => l(o.target.value),
1570
- options: [
1571
- { value: "formatted", label: "Formatted" },
1572
- { value: "raw", label: "Raw" }
1573
- ]
1574
- }
1575
- ) })
1576
- ] });
1577
- }, E = "__none";
1578
- function Aa(n) {
1579
- var t;
1580
- return (t = Object.entries({
1581
- "application/json": "json",
1582
- "text/json": "json",
1583
- "text/html": "html",
1584
- "text/css": "css",
1585
- "text/javascript": "javascript",
1586
- "application/xml": "xml",
1587
- "application/xhtml+xml": "xhtml",
1588
- "text/plain": "plain"
1589
- }).find(
1590
- ([i]) => n.includes(i)
1591
- )) == null ? void 0 : t[1];
1592
- }
1593
- const Oa = {
1594
- 200: "OK",
1595
- 201: "Created",
1596
- 202: "Accepted",
1597
- 204: "No Content",
1598
- 400: "Bad Request",
1599
- 401: "Unauthorized",
1600
- 403: "Forbidden",
1601
- 404: "Not Found",
1602
- 405: "Method Not Allowed",
1603
- 500: "Internal Server Error"
1604
- }, $a = ({
1605
- server: n,
1606
- url: a,
1607
- method: t,
1608
- headers: i = [],
1609
- queryParams: s = [],
1610
- pathParams: r = [],
1611
- defaultBody: l = ""
1612
- }) => {
1613
- var re, oe, le;
1614
- const { register: o, control: u, handleSubmit: m, watch: p, setValue: v, ...N } = Pn({
1615
- defaultValues: {
1616
- body: l,
1617
- queryParams: s.map((d) => ({
1618
- name: d.name,
1619
- value: d.defaultValue ?? "",
1620
- active: d.defaultActive ?? !1
1621
- })),
1622
- pathParams: r.map((d) => ({
1623
- name: d.name,
1624
- value: d.defaultValue ?? ""
1625
- })),
1626
- headers: i.map((d) => ({
1627
- name: d.name,
1628
- value: d.defaultValue ?? ""
1629
- })),
1630
- identity: E
1631
- }
1632
- }), y = p(), j = qn(), h = xe(!1);
1633
- ke(() => {
1634
- var x;
1635
- if (h.current) return;
1636
- const d = (x = j.data) == null ? void 0 : x.at(0);
1637
- d && (v("identity", d.id), h.current = !0);
1638
- }, [v, j.data]);
1639
- const f = Rn({
1640
- mutationFn: async (d) => {
1641
- var _, M;
1642
- const x = Fa(n, a, d), R = performance.now(), A = new Request(x, {
1643
- method: t.toUpperCase(),
1644
- headers: Object.fromEntries(
1645
- d.headers.filter((w) => w.name).map((w) => [w.name, w.value])
1646
- )
1647
- });
1648
- d.identity !== E && ((M = (_ = j.data) == null ? void 0 : _.find((w) => w.id === d.identity)) == null || M.authorizeRequest(A));
1649
- const T = await ba(A), O = performance.now() - R, $ = await T.text();
1650
- return {
1651
- status: T.status,
1652
- headers: T.headers,
1653
- size: $.length,
1654
- body: $,
1655
- time: O
1656
- };
1657
- }
1658
- }), dn = a.split("/").map((d, x, R) => {
1659
- var _;
1660
- const A = d.startsWith("{") && d.endsWith("}"), T = d.replace(/[{}]/g, ""), O = (_ = y.pathParams.find((M) => M.name === T)) == null ? void 0 : _.value, $ = O ? /* @__PURE__ */ e.jsx(ln, { backgroundOpacity: "25%", name: d, slug: d, children: encodeURIComponent(O) }) : /* @__PURE__ */ e.jsx(
1661
- "span",
1662
- {
1663
- className: "underline decoration-wavy decoration-red-500",
1664
- title: `Missing value for path parameter \`${T}\``,
1665
- children: d
1666
- }
1667
- );
1668
- return (
1669
- // eslint-disable-next-line react/no-array-index-key
1670
- /* @__PURE__ */ e.jsxs(B, { children: [
1671
- A ? $ : d,
1672
- x < R.length - 1 && "/",
1673
- /* @__PURE__ */ e.jsx("wbr", {})
1674
- ] }, d + x)
1675
- );
1676
- });
1677
- Aa(
1678
- ((re = f.data) == null ? void 0 : re.headers.get("Content-Type")) ?? ""
1679
- );
1680
- const G = Array.from(((oe = f.data) == null ? void 0 : oe.headers.entries()) ?? []), se = y.queryParams.filter((d) => d.active).map((d, x, R) => /* @__PURE__ */ e.jsxs(B, { children: [
1681
- d.name,
1682
- "=",
1683
- encodeURIComponent(d.value).replaceAll("%20", "+"),
1684
- x < R.length - 1 && "&",
1685
- /* @__PURE__ */ e.jsx("wbr", {})
1686
- ] }, d.name));
1687
- return /* @__PURE__ */ e.jsx(
1688
- _n,
1689
- {
1690
- register: o,
1691
- control: u,
1692
- handleSubmit: m,
1693
- watch: p,
1694
- setValue: v,
1695
- ...N,
1696
- children: /* @__PURE__ */ e.jsx("form", { onSubmit: m((d) => f.mutateAsync(d)), children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 text-sm h-full", children: [
1697
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 p-8 bg-muted/50 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto", children: [
1698
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-stretch", children: [
1699
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md border-border", children: [
1700
- /* @__PURE__ */ e.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono", children: t.toUpperCase() }),
1701
- /* @__PURE__ */ e.jsxs("div", { className: "p-2 font-mono text-xs", children: [
1702
- dn,
1703
- se.length > 0 ? "?" : "",
1704
- se
1705
- ] })
1706
- ] }),
1707
- /* @__PURE__ */ e.jsx(I, { type: "submit", className: "h-auto flex gap-1", children: "Send" })
1708
- ] }),
1709
- /* @__PURE__ */ e.jsxs(
1710
- ue,
1711
- {
1712
- defaultValue: r.length > 0 ? "parameters" : "headers",
1713
- children: [
1714
- /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between", children: [
1715
- /* @__PURE__ */ e.jsxs(J, { children: [
1716
- r.length > 0 && /* @__PURE__ */ e.jsx(D, { value: "parameters", children: "Parameters" }),
1717
- /* @__PURE__ */ e.jsxs(D, { value: "headers", children: [
1718
- "Headers",
1719
- " ",
1720
- y.headers.length > 0 && `(${y.headers.length})`
1721
- ] }),
1722
- /* @__PURE__ */ e.jsx(
1723
- D,
1724
- {
1725
- value: "body",
1726
- disabled: !["POST", "PUT", "PATCH", "DELETE"].includes(
1727
- t.toUpperCase()
1728
- ),
1729
- children: "Body"
1730
- }
1731
- )
1732
- ] }),
1733
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
1734
- "Auth:",
1735
- /* @__PURE__ */ e.jsxs(
1736
- En,
1737
- {
1738
- onValueChange: (d) => v("identity", d),
1739
- value: y.identity,
1740
- defaultValue: y.identity,
1741
- children: [
1742
- /* @__PURE__ */ e.jsx(In, { className: "w-[180px] flex", children: j.isPending ? /* @__PURE__ */ e.jsx(me, {}) : /* @__PURE__ */ e.jsx(An, {}) }),
1743
- /* @__PURE__ */ e.jsxs(On, { align: "center", children: [
1744
- /* @__PURE__ */ e.jsx(ce, { value: E, children: "None" }),
1745
- (le = j.data) == null ? void 0 : le.map((d) => /* @__PURE__ */ e.jsx(ce, { value: d.id, children: d.label }, d.id))
1746
- ] })
1747
- ]
1748
- }
1749
- )
1750
- ] })
1751
- ] }),
1752
- /* @__PURE__ */ e.jsx(P, { value: "headers", children: /* @__PURE__ */ e.jsx(Ta, { control: u, register: o }) }),
1753
- /* @__PURE__ */ e.jsxs(P, { value: "parameters", children: [
1754
- r.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1755
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Path Parameters" }),
1756
- /* @__PURE__ */ e.jsx(wa, { control: u })
1757
- ] }),
1758
- s.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1759
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Query Parameters" }),
1760
- /* @__PURE__ */ e.jsx(Da, { control: u, queryParams: s })
1761
- ] })
1762
- ] }),
1763
- /* @__PURE__ */ e.jsx(P, { value: "body", children: /* @__PURE__ */ e.jsx(
1764
- "textarea",
1765
- {
1766
- ...o("body"),
1767
- className: "border w-full rounded p-2 bg-muted h-40"
1768
- }
1769
- ) })
1770
- ]
1771
- }
1772
- )
1773
- ] }),
1774
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-4 p-8 bg-muted/70", children: f.error ? /* @__PURE__ */ e.jsxs("div", { children: [
1775
- "Error:",
1776
- " ",
1777
- f.error.message || String(f.error) || "Unexpected error"
1778
- ] }) : f.data ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1779
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex text-xs gap-6", children: [
1780
- /* @__PURE__ */ e.jsxs("div", { children: [
1781
- "Status: ",
1782
- f.data.status,
1783
- " ",
1784
- Oa[f.data.status] ?? ""
1785
- ] }),
1786
- /* @__PURE__ */ e.jsxs("div", { children: [
1787
- "Time: ",
1788
- f.data.time.toFixed(0),
1789
- "ms"
1790
- ] }),
1791
- /* @__PURE__ */ e.jsxs("div", { children: [
1792
- "Size: ",
1793
- f.data.size,
1794
- " B"
1795
- ] })
1796
- ] }) }),
1797
- /* @__PURE__ */ e.jsxs(ue, { defaultValue: "response", children: [
1798
- /* @__PURE__ */ e.jsxs(J, { children: [
1799
- /* @__PURE__ */ e.jsx(D, { value: "response", children: "Response" }),
1800
- /* @__PURE__ */ e.jsx(D, { value: "headers", children: G.length ? `Headers (${G.length})` : "No headers" })
1801
- ] }),
1802
- /* @__PURE__ */ e.jsx(P, { value: "response", children: /* @__PURE__ */ e.jsx(
1803
- Ia,
1804
- {
1805
- headers: f.data.headers,
1806
- body: f.data.body
1807
- }
1808
- ) }),
1809
- /* @__PURE__ */ e.jsx(P, { value: "headers", children: /* @__PURE__ */ e.jsxs(ae, { className: "grid grid-cols-2 w-full gap-2.5 font-mono text-xs shadow-none p-4", children: [
1810
- /* @__PURE__ */ e.jsx("div", { className: "font-semibold", children: "Key" }),
1811
- /* @__PURE__ */ e.jsx("div", { className: "font-semibold", children: "Value" }),
1812
- G.map(([d, x]) => /* @__PURE__ */ e.jsxs(B, { children: [
1813
- /* @__PURE__ */ e.jsx("div", { children: d }),
1814
- /* @__PURE__ */ e.jsx("div", { className: "break-words", children: x })
1815
- ] }, d))
1816
- ] }) })
1817
- ] })
1818
- ] }) : /* @__PURE__ */ e.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ e.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: f.isPending ? /* @__PURE__ */ e.jsx(me, {}) : "Send a request first to see the response here" }) }) })
1819
- ] }) })
1820
- }
1821
- );
1822
- }, Ma = (n) => {
1823
- const [a, t] = Ne(!1);
1824
- return /* @__PURE__ */ e.jsxs(ca, { onOpenChange: (i) => t(i), children: [
1825
- /* @__PURE__ */ e.jsx(ma, { asChild: !0, children: n.children ?? /* @__PURE__ */ e.jsx(
1826
- be,
1827
- {
1828
- className: "cursor-pointer text-primary hover:text-primary/80",
1829
- size: 16
1830
- }
1831
- ) }),
1832
- /* @__PURE__ */ e.jsxs(
1833
- We,
1834
- {
1835
- className: "max-w-screen-xl w-full h-5/6 overflow-auto p-0",
1836
- "aria-describedby": void 0,
1837
- children: [
1838
- /* @__PURE__ */ e.jsx($n, { children: /* @__PURE__ */ e.jsx(Ue, { children: "Playground" }) }),
1839
- a && /* @__PURE__ */ e.jsx($a, { ...n })
1840
- ]
1841
- }
1842
- )
1843
- ] });
1844
- }, Va = Kn(`
1845
- query GetCategories($input: JSON!, $type: SchemaType!) {
1846
- schema(input: $input, type: $type) {
1847
- tags {
1848
- __typename
1849
- name
1850
- operations {
1851
- __typename
1852
- slug
1853
- deprecated
1854
- method
1855
- summary
1856
- operationId
1857
- path
1858
- }
1859
- }
1860
- }
1861
- }
1862
- `), qa = () => {
1863
- const n = cn(), a = n instanceof Error ? /* @__PURE__ */ e.jsx(pe, { code: n.message }) : "An unknown error occurred";
1864
- return /* @__PURE__ */ e.jsx(Xn, { category: "Error", title: "An error occurred", message: a });
1865
- }, tt = (n) => {
1866
- const a = n.path ?? "/reference", t = n.server ? new gn({
1867
- url: n.server,
1868
- exchanges: [fn, hn]
1869
- }) : xn({ useMemoryClient: n.inMemory ?? !1 });
1870
- return {
1871
- getHead: () => {
1872
- if (n.type === "url")
1873
- return /* @__PURE__ */ e.jsx(
1874
- "link",
1875
- {
1876
- rel: "preload",
1877
- href: n.input,
1878
- as: "fetch",
1879
- crossOrigin: "anonymous"
1880
- }
1881
- );
1882
- if (n.server)
1883
- return /* @__PURE__ */ e.jsx("link", { rel: "preconnect", href: n.server });
1884
- },
1885
- getMdxComponents: () => ({
1886
- OpenPlaygroundButton: (i) => /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(Ma, { ...i, children: /* @__PURE__ */ e.jsx(I, { className: "gap-2 items-center", variant: "outline", children: i.children ?? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1887
- "Open in Playground ",
1888
- /* @__PURE__ */ e.jsx(be, { size: 16 })
1889
- ] }) }) }) })
1890
- }),
1891
- getNavigation: async (i) => {
1892
- if (!Ln({ path: a, end: !1 }, i))
1893
- return [];
1894
- const { data: s } = await t.query(Va, {
1895
- input: n.input,
1896
- type: n.type
1897
- });
1898
- if (!s) return [];
1899
- const r = s.schema.tags.filter((l) => l.operations.length > 0).map((l) => ({
1900
- path: i,
1901
- label: l.name ?? "",
1902
- collapsible: !1,
1903
- children: l.operations.map((o) => ({
1904
- path: `#${o.slug}`,
1905
- muted: !!o.deprecated,
1906
- title: o.summary ?? o.path,
1907
- label: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 min-w-0 justify-between gap-2", children: [
1908
- /* @__PURE__ */ e.jsx("span", { className: "truncate", children: o.summary ?? o.path }),
1909
- /* @__PURE__ */ e.jsx(Bn, { method: o.method })
1910
- ] })
1911
- }))
1912
- }));
1913
- return r.unshift({
1914
- path: i,
1915
- label: "Overview",
1916
- collapsible: !1,
1917
- children: [{ path: "#description", label: "Description" }]
1918
- }), r;
1919
- },
1920
- getRoutes: () => [
1921
- {
1922
- async lazy() {
1923
- const { OpenApiRoute: i } = await import("./Route-CogU1ofM.js");
1924
- return {
1925
- element: /* @__PURE__ */ e.jsx(i, { client: t, config: n })
1926
- };
1927
- },
1928
- errorElement: /* @__PURE__ */ e.jsx(qa, {}),
1929
- children: [
1930
- {
1931
- path: a,
1932
- children: [
1933
- {
1934
- index: !0,
1935
- async lazy() {
1936
- const { OperationList: i } = await import("./OperationList-C-M33Hxu.js");
1937
- return { element: /* @__PURE__ */ e.jsx(i, {}) };
1938
- }
1939
- }
1940
- ]
1941
- }
1942
- ]
1943
- }
1944
- ]
1945
- };
1946
- };
1947
- export {
1948
- ln as C,
1949
- Xn as E,
1950
- Za as M,
1951
- Ma as P,
1952
- Pa as S,
1953
- ue as T,
1954
- J as a,
1955
- D as b,
1956
- P as c,
1957
- Kn as g,
1958
- tt as o
1959
- };
1960
- //# sourceMappingURL=index-Uqja2h2M.js.map