zudoku 0.3.0-dev.21 → 0.3.0-dev.22

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 (58) hide show
  1. package/dist/config/config.d.ts +1 -1
  2. package/dist/lib/authentication/authentication.d.ts +1 -1
  3. package/dist/lib/plugins/api-keys/index.js +1 -0
  4. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  5. package/dist/lib/plugins/markdown/generateRoutes.js +1 -1
  6. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  7. package/dist/lib/plugins/openapi/OperationList.js +1 -1
  8. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  9. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +1 -1
  10. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  11. package/dist/lib/plugins/openapi/Route.d.ts +6 -0
  12. package/dist/lib/plugins/openapi/Route.js +8 -0
  13. package/dist/lib/plugins/openapi/Route.js.map +1 -0
  14. package/dist/lib/plugins/openapi/context.d.ts +5 -0
  15. package/dist/lib/plugins/openapi/context.js +11 -0
  16. package/dist/lib/plugins/openapi/context.js.map +1 -0
  17. package/dist/lib/plugins/openapi/index.d.ts +1 -19
  18. package/dist/lib/plugins/openapi/index.js +17 -18
  19. package/dist/lib/plugins/openapi/index.js.map +1 -1
  20. package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
  21. package/dist/lib/plugins/openapi/interfaces.js +2 -0
  22. package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
  23. package/lib/{util-voKLTRDG.js → AnchorLink-DIUlXlf0.js} +149 -184
  24. package/lib/DevPortalProvider-gzyAGqHT.js +1080 -0
  25. package/lib/{Markdown-5LmPZyLV.js → Markdown-BjA7peYW.js} +3 -3
  26. package/lib/{MdxComponents-DYD_QPVF.js → MdxComponents-W-fE1ISO.js} +130 -129
  27. package/lib/MdxPage-DQ7lZBzE.js +216 -0
  28. package/lib/OperationList-DuIBqFNA.js +5545 -0
  29. package/lib/Route-B98Y2MdH.js +13 -0
  30. package/lib/{Select-DR3PiqjV.js → Select-DczD5e29.js} +24 -22
  31. package/lib/{Spinner-DjQ2eBxC.js → Spinner-CSoij67T.js} +3 -3
  32. package/lib/cn-DpqTslo9.js +2341 -0
  33. package/lib/context-_fYfJFgk.js +13 -0
  34. package/lib/{hook-FCY9-FHO.js → hook-CBXxHulF.js} +1 -1
  35. package/lib/{index-By9bEW57.js → index-C7O9D7f6.js} +15 -15
  36. package/lib/index-CKvOcM7w.js +712 -0
  37. package/lib/index-Cg6lXS1z.js +709 -0
  38. package/lib/index-ClDDiRmC.js +463 -0
  39. package/lib/router-DibNxKUP.js +3008 -0
  40. package/lib/util-CaVongBq.js +40 -0
  41. package/lib/zudoku.auth-openid.js +7 -6
  42. package/lib/zudoku.components.js +73 -69
  43. package/lib/zudoku.plugin-api-keys.js +26 -23
  44. package/lib/zudoku.plugin-markdown.js +33 -237
  45. package/lib/zudoku.plugin-openapi.js +5 -6238
  46. package/lib/zudoku.plugin-redirect.js +7 -6
  47. package/package.json +1 -1
  48. package/src/lib/authentication/authentication.ts +1 -1
  49. package/src/lib/plugins/api-keys/index.tsx +1 -0
  50. package/src/lib/plugins/markdown/generateRoutes.tsx +2 -2
  51. package/src/lib/plugins/openapi/OperationList.tsx +1 -1
  52. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +1 -1
  53. package/src/lib/plugins/openapi/Route.tsx +21 -0
  54. package/src/lib/plugins/openapi/context.tsx +16 -0
  55. package/src/lib/plugins/openapi/index.tsx +19 -46
  56. package/src/lib/plugins/openapi/interfaces.ts +9 -0
  57. package/lib/DevPortalProvider-CRKuwoXc.js +0 -4123
  58. package/lib/index-PyGcnQFX.js +0 -3462
@@ -0,0 +1,712 @@
1
+ import * as s from "react";
2
+ import { forwardRef as te, createElement as W } from "react";
3
+ import * as de from "react-dom";
4
+ import { c as I, d as me, a as ne, u as M, e as j, D as re, f as he, R as pe, m as ve, g as ae, h as we, i as ye } from "./index-ClDDiRmC.js";
5
+ import { s as P, w as H, c as z, i as k, a as be, m as G, b as ge, d as Se, E as Ee } from "./router-DibNxKUP.js";
6
+ /**
7
+ * @license lucide-react v0.378.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */
12
+ const Re = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ie = (...e) => e.filter((n, t, a) => !!n && a.indexOf(n) === t).join(" ");
13
+ /**
14
+ * @license lucide-react v0.378.0 - ISC
15
+ *
16
+ * This source code is licensed under the ISC license.
17
+ * See the LICENSE file in the root directory of this source tree.
18
+ */
19
+ var Ce = {
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ width: 24,
22
+ height: 24,
23
+ viewBox: "0 0 24 24",
24
+ fill: "none",
25
+ stroke: "currentColor",
26
+ strokeWidth: 2,
27
+ strokeLinecap: "round",
28
+ strokeLinejoin: "round"
29
+ };
30
+ /**
31
+ * @license lucide-react v0.378.0 - ISC
32
+ *
33
+ * This source code is licensed under the ISC license.
34
+ * See the LICENSE file in the root directory of this source tree.
35
+ */
36
+ const _e = te(
37
+ ({
38
+ color: e = "currentColor",
39
+ size: n = 24,
40
+ strokeWidth: t = 2,
41
+ absoluteStrokeWidth: a,
42
+ className: r = "",
43
+ children: i,
44
+ iconNode: l,
45
+ ...u
46
+ }, f) => W(
47
+ "svg",
48
+ {
49
+ ref: f,
50
+ ...Ce,
51
+ width: n,
52
+ height: n,
53
+ stroke: e,
54
+ strokeWidth: a ? Number(t) * 24 / Number(n) : t,
55
+ className: ie("lucide", r),
56
+ ...u
57
+ },
58
+ [
59
+ ...l.map(([o, c]) => W(o, c)),
60
+ ...Array.isArray(i) ? i : [i]
61
+ ]
62
+ )
63
+ );
64
+ /**
65
+ * @license lucide-react v0.378.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */
70
+ const Le = (e, n) => {
71
+ const t = te(
72
+ ({ className: a, ...r }, i) => W(_e, {
73
+ ref: i,
74
+ iconNode: n,
75
+ className: ie(`lucide-${Re(e)}`, a),
76
+ ...r
77
+ })
78
+ );
79
+ return t.displayName = `${e}`, t;
80
+ };
81
+ /**
82
+ * @license lucide-react v0.378.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */
87
+ const ut = Le("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
88
+ /**
89
+ * React Router DOM v6.24.1
90
+ *
91
+ * Copyright (c) Remix Software Inc.
92
+ *
93
+ * This source code is licensed under the MIT license found in the
94
+ * LICENSE.md file in the root directory of this source tree.
95
+ *
96
+ * @license MIT
97
+ */
98
+ function T() {
99
+ return T = Object.assign ? Object.assign.bind() : function(e) {
100
+ for (var n = 1; n < arguments.length; n++) {
101
+ var t = arguments[n];
102
+ for (var a in t)
103
+ Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
104
+ }
105
+ return e;
106
+ }, T.apply(this, arguments);
107
+ }
108
+ function Y(e, n) {
109
+ if (e == null) return {};
110
+ var t = {}, a = Object.keys(e), r, i;
111
+ for (i = 0; i < a.length; i++)
112
+ r = a[i], !(n.indexOf(r) >= 0) && (t[r] = e[r]);
113
+ return t;
114
+ }
115
+ const V = "get", F = "application/x-www-form-urlencoded";
116
+ function B(e) {
117
+ return e != null && typeof e.tagName == "string";
118
+ }
119
+ function Te(e) {
120
+ return B(e) && e.tagName.toLowerCase() === "button";
121
+ }
122
+ function Ne(e) {
123
+ return B(e) && e.tagName.toLowerCase() === "form";
124
+ }
125
+ function xe(e) {
126
+ return B(e) && e.tagName.toLowerCase() === "input";
127
+ }
128
+ function Pe(e) {
129
+ return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
130
+ }
131
+ function ke(e, n) {
132
+ return e.button === 0 && // Ignore everything but left clicks
133
+ (!n || n === "_self") && // Let browser handle "target=_blank" etc.
134
+ !Pe(e);
135
+ }
136
+ function $(e) {
137
+ return e === void 0 && (e = ""), new URLSearchParams(typeof e == "string" || Array.isArray(e) || e instanceof URLSearchParams ? e : Object.keys(e).reduce((n, t) => {
138
+ let a = e[t];
139
+ return n.concat(Array.isArray(a) ? a.map((r) => [t, r]) : [[t, a]]);
140
+ }, []));
141
+ }
142
+ function De(e, n) {
143
+ let t = $(e);
144
+ return n && n.forEach((a, r) => {
145
+ t.has(r) || n.getAll(r).forEach((i) => {
146
+ t.append(r, i);
147
+ });
148
+ }), t;
149
+ }
150
+ let A = null;
151
+ function Oe() {
152
+ if (A === null)
153
+ try {
154
+ new FormData(
155
+ document.createElement("form"),
156
+ // @ts-expect-error if FormData supports the submitter parameter, this will throw
157
+ 0
158
+ ), A = !1;
159
+ } catch {
160
+ A = !0;
161
+ }
162
+ return A;
163
+ }
164
+ const Ae = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
165
+ function K(e) {
166
+ return e != null && !Ae.has(e) ? (process.env.NODE_ENV !== "production" && H(!1, '"' + e + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + F + '"')), null) : e;
167
+ }
168
+ function Ve(e, n) {
169
+ let t, a, r, i, l;
170
+ if (Ne(e)) {
171
+ let u = e.getAttribute("action");
172
+ a = u ? P(u, n) : null, t = e.getAttribute("method") || V, r = K(e.getAttribute("enctype")) || F, i = new FormData(e);
173
+ } else if (Te(e) || xe(e) && (e.type === "submit" || e.type === "image")) {
174
+ let u = e.form;
175
+ if (u == null)
176
+ throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
177
+ let f = e.getAttribute("formaction") || u.getAttribute("action");
178
+ if (a = f ? P(f, n) : null, t = e.getAttribute("formmethod") || u.getAttribute("method") || V, r = K(e.getAttribute("formenctype")) || K(u.getAttribute("enctype")) || F, i = new FormData(u, e), !Oe()) {
179
+ let {
180
+ name: o,
181
+ type: c,
182
+ value: p
183
+ } = e;
184
+ if (c === "image") {
185
+ let d = o ? o + "." : "";
186
+ i.append(d + "x", "0"), i.append(d + "y", "0");
187
+ } else o && i.append(o, p);
188
+ }
189
+ } else {
190
+ if (B(e))
191
+ throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
192
+ t = V, a = null, r = F, l = e;
193
+ }
194
+ return i && r === "text/plain" && (l = i, i = void 0), {
195
+ action: a,
196
+ method: t.toLowerCase(),
197
+ encType: r,
198
+ formData: i,
199
+ body: l
200
+ };
201
+ }
202
+ const Fe = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"], Ue = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"], Ie = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"], Me = "6";
203
+ try {
204
+ window.__reactRouterVersion = Me;
205
+ } catch {
206
+ }
207
+ function ct(e, n) {
208
+ return ge({
209
+ basename: void 0,
210
+ future: T({}, void 0, {
211
+ v7_prependBasename: !0
212
+ }),
213
+ history: Se({
214
+ window: void 0
215
+ }),
216
+ hydrationData: je(),
217
+ routes: e,
218
+ mapRouteProperties: ve,
219
+ unstable_dataStrategy: void 0,
220
+ unstable_patchRoutesOnMiss: void 0,
221
+ window: void 0
222
+ }).initialize();
223
+ }
224
+ function je() {
225
+ var e;
226
+ let n = (e = window) == null ? void 0 : e.__staticRouterHydrationData;
227
+ return n && n.errors && (n = T({}, n, {
228
+ errors: He(n.errors)
229
+ })), n;
230
+ }
231
+ function He(e) {
232
+ if (!e) return null;
233
+ let n = Object.entries(e), t = {};
234
+ for (let [a, r] of n)
235
+ if (r && r.__type === "RouteErrorResponse")
236
+ t[a] = new Ee(r.status, r.statusText, r.data, r.internal === !0);
237
+ else if (r && r.__type === "Error") {
238
+ if (r.__subType) {
239
+ let i = window[r.__subType];
240
+ if (typeof i == "function")
241
+ try {
242
+ let l = new i(r.message);
243
+ l.stack = "", t[a] = l;
244
+ } catch {
245
+ }
246
+ }
247
+ if (t[a] == null) {
248
+ let i = new Error(r.message);
249
+ i.stack = "", t[a] = i;
250
+ }
251
+ } else
252
+ t[a] = r;
253
+ return t;
254
+ }
255
+ const q = /* @__PURE__ */ s.createContext({
256
+ isTransitioning: !1
257
+ });
258
+ process.env.NODE_ENV !== "production" && (q.displayName = "ViewTransition");
259
+ const oe = /* @__PURE__ */ s.createContext(/* @__PURE__ */ new Map());
260
+ process.env.NODE_ENV !== "production" && (oe.displayName = "Fetchers");
261
+ const Be = "startTransition", X = s[Be], Ke = "flushSync", Z = de[Ke];
262
+ function We(e) {
263
+ X ? X(e) : e();
264
+ }
265
+ function O(e) {
266
+ Z ? Z(e) : e();
267
+ }
268
+ class ze {
269
+ constructor() {
270
+ this.status = "pending", this.promise = new Promise((n, t) => {
271
+ this.resolve = (a) => {
272
+ this.status === "pending" && (this.status = "resolved", n(a));
273
+ }, this.reject = (a) => {
274
+ this.status === "pending" && (this.status = "rejected", t(a));
275
+ };
276
+ });
277
+ }
278
+ }
279
+ function ft(e) {
280
+ let {
281
+ fallbackElement: n,
282
+ router: t,
283
+ future: a
284
+ } = e, [r, i] = s.useState(t.state), [l, u] = s.useState(), [f, o] = s.useState({
285
+ isTransitioning: !1
286
+ }), [c, p] = s.useState(), [d, S] = s.useState(), [y, g] = s.useState(), b = s.useRef(/* @__PURE__ */ new Map()), {
287
+ v7_startTransition: C
288
+ } = a || {}, m = s.useCallback((w) => {
289
+ C ? We(w) : w();
290
+ }, [C]), v = s.useCallback((w, R) => {
291
+ let {
292
+ deletedFetchers: E,
293
+ unstable_flushSync: x,
294
+ unstable_viewTransitionOpts: _
295
+ } = R;
296
+ E.forEach((N) => b.current.delete(N)), w.fetchers.forEach((N, fe) => {
297
+ N.data !== void 0 && b.current.set(fe, N.data);
298
+ });
299
+ let ce = t.window == null || t.window.document == null || typeof t.window.document.startViewTransition != "function";
300
+ if (!_ || ce) {
301
+ x ? O(() => i(w)) : m(() => i(w));
302
+ return;
303
+ }
304
+ if (x) {
305
+ O(() => {
306
+ d && (c && c.resolve(), d.skipTransition()), o({
307
+ isTransitioning: !0,
308
+ flushSync: !0,
309
+ currentLocation: _.currentLocation,
310
+ nextLocation: _.nextLocation
311
+ });
312
+ });
313
+ let N = t.window.document.startViewTransition(() => {
314
+ O(() => i(w));
315
+ });
316
+ N.finished.finally(() => {
317
+ O(() => {
318
+ p(void 0), S(void 0), u(void 0), o({
319
+ isTransitioning: !1
320
+ });
321
+ });
322
+ }), O(() => S(N));
323
+ return;
324
+ }
325
+ d ? (c && c.resolve(), d.skipTransition(), g({
326
+ state: w,
327
+ currentLocation: _.currentLocation,
328
+ nextLocation: _.nextLocation
329
+ })) : (u(w), o({
330
+ isTransitioning: !0,
331
+ flushSync: !1,
332
+ currentLocation: _.currentLocation,
333
+ nextLocation: _.nextLocation
334
+ }));
335
+ }, [t.window, d, c, b, m]);
336
+ s.useLayoutEffect(() => t.subscribe(v), [t, v]), s.useEffect(() => {
337
+ f.isTransitioning && !f.flushSync && p(new ze());
338
+ }, [f]), s.useEffect(() => {
339
+ if (c && l && t.window) {
340
+ let w = l, R = c.promise, E = t.window.document.startViewTransition(async () => {
341
+ m(() => i(w)), await R;
342
+ });
343
+ E.finished.finally(() => {
344
+ p(void 0), S(void 0), u(void 0), o({
345
+ isTransitioning: !1
346
+ });
347
+ }), S(E);
348
+ }
349
+ }, [m, l, c, t.window]), s.useEffect(() => {
350
+ c && l && r.location.key === l.location.key && c.resolve();
351
+ }, [c, d, r.location, l]), s.useEffect(() => {
352
+ !f.isTransitioning && y && (u(y.state), o({
353
+ isTransitioning: !0,
354
+ flushSync: !1,
355
+ currentLocation: y.currentLocation,
356
+ nextLocation: y.nextLocation
357
+ }), g(void 0));
358
+ }, [f.isTransitioning, y]), s.useEffect(() => {
359
+ process.env.NODE_ENV !== "production" && H(n == null || !t.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead");
360
+ }, []);
361
+ let h = s.useMemo(() => ({
362
+ createHref: t.createHref,
363
+ encodeLocation: t.encodeLocation,
364
+ go: (w) => t.navigate(w),
365
+ push: (w, R, E) => t.navigate(w, {
366
+ state: R,
367
+ preventScrollReset: E == null ? void 0 : E.preventScrollReset
368
+ }),
369
+ replace: (w, R, E) => t.navigate(w, {
370
+ replace: !0,
371
+ state: R,
372
+ preventScrollReset: E == null ? void 0 : E.preventScrollReset
373
+ })
374
+ }), [t]), L = t.basename || "/", D = s.useMemo(() => ({
375
+ router: t,
376
+ navigator: h,
377
+ static: !1,
378
+ basename: L
379
+ }), [t, h, L]);
380
+ return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(ae.Provider, {
381
+ value: D
382
+ }, /* @__PURE__ */ s.createElement(re.Provider, {
383
+ value: r
384
+ }, /* @__PURE__ */ s.createElement(oe.Provider, {
385
+ value: b.current
386
+ }, /* @__PURE__ */ s.createElement(q.Provider, {
387
+ value: f
388
+ }, /* @__PURE__ */ s.createElement(we, {
389
+ basename: L,
390
+ location: r.location,
391
+ navigationType: r.historyAction,
392
+ navigator: h,
393
+ future: {
394
+ v7_relativeSplatPath: t.future.v7_relativeSplatPath
395
+ }
396
+ }, r.initialized || t.future.v7_partialHydration ? /* @__PURE__ */ s.createElement($e, {
397
+ routes: t.routes,
398
+ future: t.future,
399
+ state: r
400
+ }) : n))))), null);
401
+ }
402
+ function $e(e) {
403
+ let {
404
+ routes: n,
405
+ future: t,
406
+ state: a
407
+ } = e;
408
+ return ye(n, void 0, a, t);
409
+ }
410
+ process.env.NODE_ENV;
411
+ const Ye = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", qe = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, se = /* @__PURE__ */ s.forwardRef(function(n, t) {
412
+ let {
413
+ onClick: a,
414
+ relative: r,
415
+ reloadDocument: i,
416
+ replace: l,
417
+ state: u,
418
+ target: f,
419
+ to: o,
420
+ preventScrollReset: c,
421
+ unstable_viewTransition: p
422
+ } = n, d = Y(n, Fe), {
423
+ basename: S
424
+ } = s.useContext(I), y, g = !1;
425
+ if (typeof o == "string" && qe.test(o) && (y = o, Ye))
426
+ try {
427
+ let v = new URL(window.location.href), h = o.startsWith("//") ? new URL(v.protocol + o) : new URL(o), L = P(h.pathname, S);
428
+ h.origin === v.origin && L != null ? o = L + h.search + h.hash : g = !0;
429
+ } catch {
430
+ process.env.NODE_ENV !== "production" && H(!1, '<Link to="' + o + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
431
+ }
432
+ let b = me(o, {
433
+ relative: r
434
+ }), C = Je(o, {
435
+ replace: l,
436
+ state: u,
437
+ target: f,
438
+ preventScrollReset: c,
439
+ relative: r,
440
+ unstable_viewTransition: p
441
+ });
442
+ function m(v) {
443
+ a && a(v), v.defaultPrevented || C(v);
444
+ }
445
+ return (
446
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
447
+ /* @__PURE__ */ s.createElement("a", T({}, d, {
448
+ href: y || b,
449
+ onClick: g || i ? a : m,
450
+ ref: t,
451
+ target: f
452
+ }))
453
+ );
454
+ });
455
+ process.env.NODE_ENV !== "production" && (se.displayName = "Link");
456
+ const Ge = /* @__PURE__ */ s.forwardRef(function(n, t) {
457
+ let {
458
+ "aria-current": a = "page",
459
+ caseSensitive: r = !1,
460
+ className: i = "",
461
+ end: l = !1,
462
+ style: u,
463
+ to: f,
464
+ unstable_viewTransition: o,
465
+ children: c
466
+ } = n, p = Y(n, Ue), d = j(f, {
467
+ relative: p.relative
468
+ }), S = M(), y = s.useContext(re), {
469
+ navigator: g,
470
+ basename: b
471
+ } = s.useContext(I), C = y != null && // Conditional usage is OK here because the usage of a data router is static
472
+ // eslint-disable-next-line react-hooks/rules-of-hooks
473
+ at(d) && o === !0, m = g.encodeLocation ? g.encodeLocation(d).pathname : d.pathname, v = S.pathname, h = y && y.navigation && y.navigation.location ? y.navigation.location.pathname : null;
474
+ r || (v = v.toLowerCase(), h = h ? h.toLowerCase() : null, m = m.toLowerCase()), h && b && (h = P(h, b) || h);
475
+ const L = m !== "/" && m.endsWith("/") ? m.length - 1 : m.length;
476
+ let D = v === m || !l && v.startsWith(m) && v.charAt(L) === "/", w = h != null && (h === m || !l && h.startsWith(m) && h.charAt(m.length) === "/"), R = {
477
+ isActive: D,
478
+ isPending: w,
479
+ isTransitioning: C
480
+ }, E = D ? a : void 0, x;
481
+ typeof i == "function" ? x = i(R) : x = [i, D ? "active" : null, w ? "pending" : null, C ? "transitioning" : null].filter(Boolean).join(" ");
482
+ let _ = typeof u == "function" ? u(R) : u;
483
+ return /* @__PURE__ */ s.createElement(se, T({}, p, {
484
+ "aria-current": E,
485
+ className: x,
486
+ ref: t,
487
+ style: _,
488
+ to: f,
489
+ unstable_viewTransition: o
490
+ }), typeof c == "function" ? c(R) : c);
491
+ });
492
+ process.env.NODE_ENV !== "production" && (Ge.displayName = "NavLink");
493
+ const Xe = /* @__PURE__ */ s.forwardRef((e, n) => {
494
+ let {
495
+ fetcherKey: t,
496
+ navigate: a,
497
+ reloadDocument: r,
498
+ replace: i,
499
+ state: l,
500
+ method: u = V,
501
+ action: f,
502
+ onSubmit: o,
503
+ relative: c,
504
+ preventScrollReset: p,
505
+ unstable_viewTransition: d
506
+ } = e, S = Y(e, Ie), y = nt(), g = rt(f, {
507
+ relative: c
508
+ }), b = u.toLowerCase() === "get" ? "get" : "post", C = (m) => {
509
+ if (o && o(m), m.defaultPrevented) return;
510
+ m.preventDefault();
511
+ let v = m.nativeEvent.submitter, h = (v == null ? void 0 : v.getAttribute("formmethod")) || u;
512
+ y(v || m.currentTarget, {
513
+ fetcherKey: t,
514
+ method: h,
515
+ navigate: a,
516
+ replace: i,
517
+ state: l,
518
+ relative: c,
519
+ preventScrollReset: p,
520
+ unstable_viewTransition: d
521
+ });
522
+ };
523
+ return /* @__PURE__ */ s.createElement("form", T({
524
+ ref: n,
525
+ method: b,
526
+ action: g,
527
+ onSubmit: r ? o : C
528
+ }, S));
529
+ });
530
+ process.env.NODE_ENV !== "production" && (Xe.displayName = "Form");
531
+ process.env.NODE_ENV;
532
+ var U;
533
+ (function(e) {
534
+ e.UseScrollRestoration = "useScrollRestoration", e.UseSubmit = "useSubmit", e.UseSubmitFetcher = "useSubmitFetcher", e.UseFetcher = "useFetcher", e.useViewTransitionState = "useViewTransitionState";
535
+ })(U || (U = {}));
536
+ var J;
537
+ (function(e) {
538
+ e.UseFetcher = "useFetcher", e.UseFetchers = "useFetchers", e.UseScrollRestoration = "useScrollRestoration";
539
+ })(J || (J = {}));
540
+ function Ze(e) {
541
+ return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
542
+ }
543
+ function le(e) {
544
+ let n = s.useContext(ae);
545
+ return n || (process.env.NODE_ENV !== "production" ? k(!1, Ze(e)) : k(!1)), n;
546
+ }
547
+ function Je(e, n) {
548
+ let {
549
+ target: t,
550
+ replace: a,
551
+ state: r,
552
+ preventScrollReset: i,
553
+ relative: l,
554
+ unstable_viewTransition: u
555
+ } = n === void 0 ? {} : n, f = ne(), o = M(), c = j(e, {
556
+ relative: l
557
+ });
558
+ return s.useCallback((p) => {
559
+ if (ke(p, t)) {
560
+ p.preventDefault();
561
+ let d = a !== void 0 ? a : z(o) === z(c);
562
+ f(e, {
563
+ replace: d,
564
+ state: r,
565
+ preventScrollReset: i,
566
+ relative: l,
567
+ unstable_viewTransition: u
568
+ });
569
+ }
570
+ }, [o, f, c, a, r, t, e, i, l, u]);
571
+ }
572
+ function dt(e) {
573
+ process.env.NODE_ENV !== "production" && H(typeof URLSearchParams < "u", "You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");
574
+ let n = s.useRef($(e)), t = s.useRef(!1), a = M(), r = s.useMemo(() => (
575
+ // Only merge in the defaults if we haven't yet called setSearchParams.
576
+ // Once we call that we want those to take precedence, otherwise you can't
577
+ // remove a param with setSearchParams({}) if it has an initial value
578
+ De(a.search, t.current ? null : n.current)
579
+ ), [a.search]), i = ne(), l = s.useCallback((u, f) => {
580
+ const o = $(typeof u == "function" ? u(r) : u);
581
+ t.current = !0, i("?" + o, f);
582
+ }, [i, r]);
583
+ return [r, l];
584
+ }
585
+ function Qe() {
586
+ if (typeof document > "u")
587
+ throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
588
+ }
589
+ let et = 0, tt = () => "__" + String(++et) + "__";
590
+ function nt() {
591
+ let {
592
+ router: e
593
+ } = le(U.UseSubmit), {
594
+ basename: n
595
+ } = s.useContext(I), t = he();
596
+ return s.useCallback(function(a, r) {
597
+ r === void 0 && (r = {}), Qe();
598
+ let {
599
+ action: i,
600
+ method: l,
601
+ encType: u,
602
+ formData: f,
603
+ body: o
604
+ } = Ve(a, n);
605
+ if (r.navigate === !1) {
606
+ let c = r.fetcherKey || tt();
607
+ e.fetch(c, t, r.action || i, {
608
+ preventScrollReset: r.preventScrollReset,
609
+ formData: f,
610
+ body: o,
611
+ formMethod: r.method || l,
612
+ formEncType: r.encType || u,
613
+ unstable_flushSync: r.unstable_flushSync
614
+ });
615
+ } else
616
+ e.navigate(r.action || i, {
617
+ preventScrollReset: r.preventScrollReset,
618
+ formData: f,
619
+ body: o,
620
+ formMethod: r.method || l,
621
+ formEncType: r.encType || u,
622
+ replace: r.replace,
623
+ state: r.state,
624
+ fromRouteId: t,
625
+ unstable_flushSync: r.unstable_flushSync,
626
+ unstable_viewTransition: r.unstable_viewTransition
627
+ });
628
+ }, [e, n, t]);
629
+ }
630
+ function rt(e, n) {
631
+ let {
632
+ relative: t
633
+ } = n === void 0 ? {} : n, {
634
+ basename: a
635
+ } = s.useContext(I), r = s.useContext(pe);
636
+ r || (process.env.NODE_ENV !== "production" ? k(!1, "useFormAction must be used inside a RouteContext") : k(!1));
637
+ let [i] = r.matches.slice(-1), l = T({}, j(e || ".", {
638
+ relative: t
639
+ })), u = M();
640
+ if (e == null) {
641
+ l.search = u.search;
642
+ let f = new URLSearchParams(l.search);
643
+ f.has("index") && f.get("index") === "" && (f.delete("index"), l.search = f.toString() ? "?" + f.toString() : "");
644
+ }
645
+ return (!e || e === ".") && i.route.index && (l.search = l.search ? l.search.replace(/^\?/, "?index&") : "?index"), a !== "/" && (l.pathname = l.pathname === "/" ? a : be([a, l.pathname])), z(l);
646
+ }
647
+ function at(e, n) {
648
+ n === void 0 && (n = {});
649
+ let t = s.useContext(q);
650
+ t == null && (process.env.NODE_ENV !== "production" ? k(!1, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : k(!1));
651
+ let {
652
+ basename: a
653
+ } = le(U.useViewTransitionState), r = j(e, {
654
+ relative: n.relative
655
+ });
656
+ if (!t.isTransitioning)
657
+ return !1;
658
+ let i = P(t.currentLocation.pathname, a) || t.currentLocation.pathname, l = P(t.nextLocation.pathname, a) || t.nextLocation.pathname;
659
+ return G(r.pathname, l) != null || G(r.pathname, i) != null;
660
+ }
661
+ function ue(e) {
662
+ var n, t, a = "";
663
+ if (typeof e == "string" || typeof e == "number") a += e;
664
+ else if (typeof e == "object") if (Array.isArray(e)) for (n = 0; n < e.length; n++) e[n] && (t = ue(e[n])) && (a && (a += " "), a += t);
665
+ else for (n in e) e[n] && (a && (a += " "), a += n);
666
+ return a;
667
+ }
668
+ function it() {
669
+ for (var e, n, t = 0, a = ""; t < arguments.length; ) (e = arguments[t++]) && (n = ue(e)) && (a && (a += " "), a += n);
670
+ return a;
671
+ }
672
+ const Q = (e) => typeof e == "boolean" ? "".concat(e) : e === 0 ? "0" : e, ee = it, mt = (e, n) => (t) => {
673
+ var a;
674
+ if ((n == null ? void 0 : n.variants) == null) return ee(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
675
+ const { variants: r, defaultVariants: i } = n, l = Object.keys(r).map((o) => {
676
+ const c = t == null ? void 0 : t[o], p = i == null ? void 0 : i[o];
677
+ if (c === null) return null;
678
+ const d = Q(c) || Q(p);
679
+ return r[o][d];
680
+ }), u = t && Object.entries(t).reduce((o, c) => {
681
+ let [p, d] = c;
682
+ return d === void 0 || (o[p] = d), o;
683
+ }, {}), f = n == null || (a = n.compoundVariants) === null || a === void 0 ? void 0 : a.reduce((o, c) => {
684
+ let { class: p, className: d, ...S } = c;
685
+ return Object.entries(S).every((y) => {
686
+ let [g, b] = y;
687
+ return Array.isArray(b) ? b.includes({
688
+ ...i,
689
+ ...u
690
+ }[g]) : {
691
+ ...i,
692
+ ...u
693
+ }[g] === b;
694
+ }) ? [
695
+ ...o,
696
+ p,
697
+ d
698
+ ] : o;
699
+ }, []);
700
+ return ee(e, l, f, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
701
+ };
702
+ export {
703
+ ut as C,
704
+ se as L,
705
+ Ge as N,
706
+ ft as R,
707
+ ee as a,
708
+ mt as b,
709
+ Le as c,
710
+ ct as d,
711
+ dt as u
712
+ };