@kubb/plugin-ts 3.16.1 → 3.16.3

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 (41) hide show
  1. package/dist/components-6F5RoYuJ.js +2240 -0
  2. package/dist/components-6F5RoYuJ.js.map +1 -0
  3. package/dist/components-B-Jx1kI5.cjs +2256 -0
  4. package/dist/components-B-Jx1kI5.cjs.map +1 -0
  5. package/dist/components.cjs +3 -15
  6. package/dist/components.d.cts +40 -26
  7. package/dist/components.d.ts +40 -26
  8. package/dist/components.js +3 -3
  9. package/dist/generators.cjs +4 -16
  10. package/dist/generators.d.cts +8 -9
  11. package/dist/generators.d.ts +8 -9
  12. package/dist/generators.js +4 -4
  13. package/dist/index.cjs +4 -17
  14. package/dist/index.d.cts +6 -8
  15. package/dist/index.d.ts +6 -8
  16. package/dist/index.js +3 -6
  17. package/dist/plugin-BXxI6FcR.cjs +378 -0
  18. package/dist/plugin-BXxI6FcR.cjs.map +1 -0
  19. package/dist/plugin-DXUISuTd.js +355 -0
  20. package/dist/plugin-DXUISuTd.js.map +1 -0
  21. package/dist/types-BL0qEGbB.d.cts +1223 -0
  22. package/dist/types-DFDnGwpy.d.ts +1223 -0
  23. package/package.json +23 -28
  24. package/src/generators/typeGenerator.tsx +4 -4
  25. package/src/parser.ts +1 -1
  26. package/dist/chunk-5LFEQTFW.cjs +0 -387
  27. package/dist/chunk-5LFEQTFW.cjs.map +0 -1
  28. package/dist/chunk-AUTKC2ER.js +0 -358
  29. package/dist/chunk-AUTKC2ER.js.map +0 -1
  30. package/dist/chunk-G37NJ4JQ.js +0 -2585
  31. package/dist/chunk-G37NJ4JQ.js.map +0 -1
  32. package/dist/chunk-YB6JHIAR.cjs +0 -2611
  33. package/dist/chunk-YB6JHIAR.cjs.map +0 -1
  34. package/dist/components.cjs.map +0 -1
  35. package/dist/components.js.map +0 -1
  36. package/dist/generators.cjs.map +0 -1
  37. package/dist/generators.js.map +0 -1
  38. package/dist/index.cjs.map +0 -1
  39. package/dist/index.js.map +0 -1
  40. package/dist/types-DkvPgLAK.d.cts +0 -116
  41. package/dist/types-DkvPgLAK.d.ts +0 -116
@@ -0,0 +1,2240 @@
1
+ import transformers from "@kubb/core/transformers";
2
+ import { SchemaGenerator, isKeyword, schemaKeywords } from "@kubb/plugin-oas";
3
+ import { print } from "@kubb/parser-ts";
4
+ import * as factory from "@kubb/parser-ts/factory";
5
+ import { createTypeDeclaration } from "@kubb/parser-ts/factory";
6
+ import { File, Type } from "@kubb/react";
7
+ import { Fragment, jsx, jsxs } from "@kubb/react/jsx-runtime";
8
+
9
+ //#region rolldown:runtime
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __commonJS = (cb, mod) => function() {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n$1 = keys.length, key; i < n$1; i++) {
21
+ key = keys[i];
22
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
23
+ get: ((k) => from[k]).bind(null, key),
24
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
25
+ });
26
+ }
27
+ return to;
28
+ };
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
+ value: mod,
31
+ enumerable: true
32
+ }) : target, mod));
33
+
34
+ //#endregion
35
+ //#region src/components/OasType.tsx
36
+ function OasType({ name, typeName, api }) {
37
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
38
+ /* @__PURE__ */ jsx(File.Source, {
39
+ name,
40
+ isExportable: true,
41
+ isIndexable: true,
42
+ children: `export const ${name} = ${JSON.stringify(api, void 0, 2)} as const`
43
+ }),
44
+ /* @__PURE__ */ jsx("br", {}),
45
+ /* @__PURE__ */ jsx(File.Source, {
46
+ name: typeName,
47
+ isExportable: true,
48
+ isIndexable: true,
49
+ isTypeOnly: true,
50
+ children: /* @__PURE__ */ jsx(Type, {
51
+ name: typeName,
52
+ export: true,
53
+ children: `Infer<typeof ${name}>`
54
+ })
55
+ })
56
+ ] });
57
+ }
58
+
59
+ //#endregion
60
+ //#region ../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
61
+ var require_react_production_min = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js": ((exports) => {
62
+ var l = Symbol.for("react.element"), n = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), u = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), x = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), z = Symbol.iterator;
63
+ function A(a) {
64
+ if (null === a || "object" !== typeof a) return null;
65
+ a = z && a[z] || a["@@iterator"];
66
+ return "function" === typeof a ? a : null;
67
+ }
68
+ var B = {
69
+ isMounted: function() {
70
+ return !1;
71
+ },
72
+ enqueueForceUpdate: function() {},
73
+ enqueueReplaceState: function() {},
74
+ enqueueSetState: function() {}
75
+ }, C = Object.assign, D = {};
76
+ function E(a, b, e) {
77
+ this.props = a;
78
+ this.context = b;
79
+ this.refs = D;
80
+ this.updater = e || B;
81
+ }
82
+ E.prototype.isReactComponent = {};
83
+ E.prototype.setState = function(a, b) {
84
+ if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
85
+ this.updater.enqueueSetState(this, a, b, "setState");
86
+ };
87
+ E.prototype.forceUpdate = function(a) {
88
+ this.updater.enqueueForceUpdate(this, a, "forceUpdate");
89
+ };
90
+ function F() {}
91
+ F.prototype = E.prototype;
92
+ function G(a, b, e) {
93
+ this.props = a;
94
+ this.context = b;
95
+ this.refs = D;
96
+ this.updater = e || B;
97
+ }
98
+ var H = G.prototype = new F();
99
+ H.constructor = G;
100
+ C(H, E.prototype);
101
+ H.isPureReactComponent = !0;
102
+ var I = Array.isArray, J = Object.prototype.hasOwnProperty, K = { current: null }, L = {
103
+ key: !0,
104
+ ref: !0,
105
+ __self: !0,
106
+ __source: !0
107
+ };
108
+ function M(a, b, e) {
109
+ var d, c = {}, k = null, h = null;
110
+ if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]);
111
+ var g = arguments.length - 2;
112
+ if (1 === g) c.children = e;
113
+ else if (1 < g) {
114
+ for (var f = Array(g), m = 0; m < g; m++) f[m] = arguments[m + 2];
115
+ c.children = f;
116
+ }
117
+ if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]);
118
+ return {
119
+ $$typeof: l,
120
+ type: a,
121
+ key: k,
122
+ ref: h,
123
+ props: c,
124
+ _owner: K.current
125
+ };
126
+ }
127
+ function N(a, b) {
128
+ return {
129
+ $$typeof: l,
130
+ type: a.type,
131
+ key: b,
132
+ ref: a.ref,
133
+ props: a.props,
134
+ _owner: a._owner
135
+ };
136
+ }
137
+ function O(a) {
138
+ return "object" === typeof a && null !== a && a.$$typeof === l;
139
+ }
140
+ function escape(a) {
141
+ var b = {
142
+ "=": "=0",
143
+ ":": "=2"
144
+ };
145
+ return "$" + a.replace(/[=:]/g, function(a$1) {
146
+ return b[a$1];
147
+ });
148
+ }
149
+ var P = /\/+/g;
150
+ function Q(a, b) {
151
+ return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36);
152
+ }
153
+ function R(a, b, e, d, c) {
154
+ var k = typeof a;
155
+ if ("undefined" === k || "boolean" === k) a = null;
156
+ var h = !1;
157
+ if (null === a) h = !0;
158
+ else switch (k) {
159
+ case "string":
160
+ case "number":
161
+ h = !0;
162
+ break;
163
+ case "object": switch (a.$$typeof) {
164
+ case l:
165
+ case n: h = !0;
166
+ }
167
+ }
168
+ if (h) return h = a, c = c(h), a = "" === d ? "." + Q(h, 0) : d, I(c) ? (e = "", null != a && (e = a.replace(P, "$&/") + "/"), R(c, b, e, "", function(a$1) {
169
+ return a$1;
170
+ })) : null != c && (O(c) && (c = N(c, e + (!c.key || h && h.key === c.key ? "" : ("" + c.key).replace(P, "$&/") + "/") + a)), b.push(c)), 1;
171
+ h = 0;
172
+ d = "" === d ? "." : d + ":";
173
+ if (I(a)) for (var g = 0; g < a.length; g++) {
174
+ k = a[g];
175
+ var f = d + Q(k, g);
176
+ h += R(k, b, e, f, c);
177
+ }
178
+ else if (f = A(a), "function" === typeof f) for (a = f.call(a), g = 0; !(k = a.next()).done;) k = k.value, f = d + Q(k, g++), h += R(k, b, e, f, c);
179
+ else if ("object" === k) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead.");
180
+ return h;
181
+ }
182
+ function S(a, b, e) {
183
+ if (null == a) return a;
184
+ var d = [], c = 0;
185
+ R(a, d, "", "", function(a$1) {
186
+ return b.call(e, a$1, c++);
187
+ });
188
+ return d;
189
+ }
190
+ function T(a) {
191
+ if (-1 === a._status) {
192
+ var b = a._result;
193
+ b = b();
194
+ b.then(function(b$1) {
195
+ if (0 === a._status || -1 === a._status) a._status = 1, a._result = b$1;
196
+ }, function(b$1) {
197
+ if (0 === a._status || -1 === a._status) a._status = 2, a._result = b$1;
198
+ });
199
+ -1 === a._status && (a._status = 0, a._result = b);
200
+ }
201
+ if (1 === a._status) return a._result.default;
202
+ throw a._result;
203
+ }
204
+ var U = { current: null }, V = { transition: null }, W = {
205
+ ReactCurrentDispatcher: U,
206
+ ReactCurrentBatchConfig: V,
207
+ ReactCurrentOwner: K
208
+ };
209
+ function X() {
210
+ throw Error("act(...) is not supported in production builds of React.");
211
+ }
212
+ exports.Children = {
213
+ map: S,
214
+ forEach: function(a, b, e) {
215
+ S(a, function() {
216
+ b.apply(this, arguments);
217
+ }, e);
218
+ },
219
+ count: function(a) {
220
+ var b = 0;
221
+ S(a, function() {
222
+ b++;
223
+ });
224
+ return b;
225
+ },
226
+ toArray: function(a) {
227
+ return S(a, function(a$1) {
228
+ return a$1;
229
+ }) || [];
230
+ },
231
+ only: function(a) {
232
+ if (!O(a)) throw Error("React.Children.only expected to receive a single React element child.");
233
+ return a;
234
+ }
235
+ };
236
+ exports.Component = E;
237
+ exports.Fragment = p;
238
+ exports.Profiler = r;
239
+ exports.PureComponent = G;
240
+ exports.StrictMode = q;
241
+ exports.Suspense = w;
242
+ exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
243
+ exports.act = X;
244
+ exports.cloneElement = function(a, b, e) {
245
+ if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
246
+ var d = C({}, a.props), c = a.key, k = a.ref, h = a._owner;
247
+ if (null != b) {
248
+ void 0 !== b.ref && (k = b.ref, h = K.current);
249
+ void 0 !== b.key && (c = "" + b.key);
250
+ if (a.type && a.type.defaultProps) var g = a.type.defaultProps;
251
+ for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
252
+ }
253
+ var f = arguments.length - 2;
254
+ if (1 === f) d.children = e;
255
+ else if (1 < f) {
256
+ g = Array(f);
257
+ for (var m = 0; m < f; m++) g[m] = arguments[m + 2];
258
+ d.children = g;
259
+ }
260
+ return {
261
+ $$typeof: l,
262
+ type: a.type,
263
+ key: c,
264
+ ref: k,
265
+ props: d,
266
+ _owner: h
267
+ };
268
+ };
269
+ exports.createContext = function(a) {
270
+ a = {
271
+ $$typeof: u,
272
+ _currentValue: a,
273
+ _currentValue2: a,
274
+ _threadCount: 0,
275
+ Provider: null,
276
+ Consumer: null,
277
+ _defaultValue: null,
278
+ _globalName: null
279
+ };
280
+ a.Provider = {
281
+ $$typeof: t,
282
+ _context: a
283
+ };
284
+ return a.Consumer = a;
285
+ };
286
+ exports.createElement = M;
287
+ exports.createFactory = function(a) {
288
+ var b = M.bind(null, a);
289
+ b.type = a;
290
+ return b;
291
+ };
292
+ exports.createRef = function() {
293
+ return { current: null };
294
+ };
295
+ exports.forwardRef = function(a) {
296
+ return {
297
+ $$typeof: v,
298
+ render: a
299
+ };
300
+ };
301
+ exports.isValidElement = O;
302
+ exports.lazy = function(a) {
303
+ return {
304
+ $$typeof: y,
305
+ _payload: {
306
+ _status: -1,
307
+ _result: a
308
+ },
309
+ _init: T
310
+ };
311
+ };
312
+ exports.memo = function(a, b) {
313
+ return {
314
+ $$typeof: x,
315
+ type: a,
316
+ compare: void 0 === b ? null : b
317
+ };
318
+ };
319
+ exports.startTransition = function(a) {
320
+ var b = V.transition;
321
+ V.transition = {};
322
+ try {
323
+ a();
324
+ } finally {
325
+ V.transition = b;
326
+ }
327
+ };
328
+ exports.unstable_act = X;
329
+ exports.useCallback = function(a, b) {
330
+ return U.current.useCallback(a, b);
331
+ };
332
+ exports.useContext = function(a) {
333
+ return U.current.useContext(a);
334
+ };
335
+ exports.useDebugValue = function() {};
336
+ exports.useDeferredValue = function(a) {
337
+ return U.current.useDeferredValue(a);
338
+ };
339
+ exports.useEffect = function(a, b) {
340
+ return U.current.useEffect(a, b);
341
+ };
342
+ exports.useId = function() {
343
+ return U.current.useId();
344
+ };
345
+ exports.useImperativeHandle = function(a, b, e) {
346
+ return U.current.useImperativeHandle(a, b, e);
347
+ };
348
+ exports.useInsertionEffect = function(a, b) {
349
+ return U.current.useInsertionEffect(a, b);
350
+ };
351
+ exports.useLayoutEffect = function(a, b) {
352
+ return U.current.useLayoutEffect(a, b);
353
+ };
354
+ exports.useMemo = function(a, b) {
355
+ return U.current.useMemo(a, b);
356
+ };
357
+ exports.useReducer = function(a, b, e) {
358
+ return U.current.useReducer(a, b, e);
359
+ };
360
+ exports.useRef = function(a) {
361
+ return U.current.useRef(a);
362
+ };
363
+ exports.useState = function(a) {
364
+ return U.current.useState(a);
365
+ };
366
+ exports.useSyncExternalStore = function(a, b, e) {
367
+ return U.current.useSyncExternalStore(a, b, e);
368
+ };
369
+ exports.useTransition = function() {
370
+ return U.current.useTransition();
371
+ };
372
+ exports.version = "18.3.1";
373
+ }) });
374
+
375
+ //#endregion
376
+ //#region ../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js
377
+ var require_react_development = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js": ((exports, module) => {
378
+ if (process.env.NODE_ENV !== "production") (function() {
379
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(/* @__PURE__ */ new Error());
380
+ var ReactVersion = "18.3.1";
381
+ var REACT_ELEMENT_TYPE = Symbol.for("react.element");
382
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
383
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
384
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
385
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
386
+ var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
387
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
388
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
389
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
390
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
391
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
392
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
393
+ var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
394
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
395
+ var FAUX_ITERATOR_SYMBOL = "@@iterator";
396
+ function getIteratorFn(maybeIterable) {
397
+ if (maybeIterable === null || typeof maybeIterable !== "object") return null;
398
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
399
+ if (typeof maybeIterator === "function") return maybeIterator;
400
+ return null;
401
+ }
402
+ /**
403
+ * Keeps track of the current dispatcher.
404
+ */
405
+ var ReactCurrentDispatcher = { current: null };
406
+ /**
407
+ * Keeps track of the current batch's configuration such as how long an update
408
+ * should suspend for if it needs to.
409
+ */
410
+ var ReactCurrentBatchConfig = { transition: null };
411
+ var ReactCurrentActQueue = {
412
+ current: null,
413
+ isBatchingLegacy: false,
414
+ didScheduleLegacyUpdate: false
415
+ };
416
+ /**
417
+ * Keeps track of the current owner.
418
+ *
419
+ * The current owner is the component who should own any components that are
420
+ * currently being constructed.
421
+ */
422
+ var ReactCurrentOwner = { current: null };
423
+ var ReactDebugCurrentFrame = {};
424
+ var currentExtraStackFrame = null;
425
+ function setExtraStackFrame(stack) {
426
+ currentExtraStackFrame = stack;
427
+ }
428
+ ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
429
+ currentExtraStackFrame = stack;
430
+ };
431
+ ReactDebugCurrentFrame.getCurrentStack = null;
432
+ ReactDebugCurrentFrame.getStackAddendum = function() {
433
+ var stack = "";
434
+ if (currentExtraStackFrame) stack += currentExtraStackFrame;
435
+ var impl = ReactDebugCurrentFrame.getCurrentStack;
436
+ if (impl) stack += impl() || "";
437
+ return stack;
438
+ };
439
+ var enableScopeAPI = false;
440
+ var enableCacheElement = false;
441
+ var enableTransitionTracing = false;
442
+ var enableLegacyHidden = false;
443
+ var enableDebugTracing = false;
444
+ var ReactSharedInternals = {
445
+ ReactCurrentDispatcher,
446
+ ReactCurrentBatchConfig,
447
+ ReactCurrentOwner
448
+ };
449
+ ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
450
+ ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
451
+ function warn(format) {
452
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
453
+ printWarning("warn", format, args);
454
+ }
455
+ function error(format) {
456
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
457
+ printWarning("error", format, args);
458
+ }
459
+ function printWarning(level, format, args) {
460
+ var ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
461
+ var stack = ReactDebugCurrentFrame$2.getStackAddendum();
462
+ if (stack !== "") {
463
+ format += "%s";
464
+ args = args.concat([stack]);
465
+ }
466
+ var argsWithFormat = args.map(function(item) {
467
+ return String(item);
468
+ });
469
+ argsWithFormat.unshift("Warning: " + format);
470
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
471
+ }
472
+ var didWarnStateUpdateForUnmountedComponent = {};
473
+ function warnNoop(publicInstance, callerName) {
474
+ var _constructor = publicInstance.constructor;
475
+ var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
476
+ var warningKey = componentName + "." + callerName;
477
+ if (didWarnStateUpdateForUnmountedComponent[warningKey]) return;
478
+ error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
479
+ didWarnStateUpdateForUnmountedComponent[warningKey] = true;
480
+ }
481
+ /**
482
+ * This is the abstract API for an update queue.
483
+ */
484
+ var ReactNoopUpdateQueue = {
485
+ isMounted: function(publicInstance) {
486
+ return false;
487
+ },
488
+ enqueueForceUpdate: function(publicInstance, callback, callerName) {
489
+ warnNoop(publicInstance, "forceUpdate");
490
+ },
491
+ enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
492
+ warnNoop(publicInstance, "replaceState");
493
+ },
494
+ enqueueSetState: function(publicInstance, partialState, callback, callerName) {
495
+ warnNoop(publicInstance, "setState");
496
+ }
497
+ };
498
+ var assign = Object.assign;
499
+ var emptyObject = {};
500
+ Object.freeze(emptyObject);
501
+ /**
502
+ * Base class helpers for the updating state of a component.
503
+ */
504
+ function Component(props, context, updater) {
505
+ this.props = props;
506
+ this.context = context;
507
+ this.refs = emptyObject;
508
+ this.updater = updater || ReactNoopUpdateQueue;
509
+ }
510
+ Component.prototype.isReactComponent = {};
511
+ /**
512
+ * Sets a subset of the state. Always use this to mutate
513
+ * state. You should treat `this.state` as immutable.
514
+ *
515
+ * There is no guarantee that `this.state` will be immediately updated, so
516
+ * accessing `this.state` after calling this method may return the old value.
517
+ *
518
+ * There is no guarantee that calls to `setState` will run synchronously,
519
+ * as they may eventually be batched together. You can provide an optional
520
+ * callback that will be executed when the call to setState is actually
521
+ * completed.
522
+ *
523
+ * When a function is provided to setState, it will be called at some point in
524
+ * the future (not synchronously). It will be called with the up to date
525
+ * component arguments (state, props, context). These values can be different
526
+ * from this.* because your function may be called after receiveProps but before
527
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
528
+ * assigned to this.
529
+ *
530
+ * @param {object|function} partialState Next partial state or function to
531
+ * produce next partial state to be merged with current state.
532
+ * @param {?function} callback Called after state is updated.
533
+ * @final
534
+ * @protected
535
+ */
536
+ Component.prototype.setState = function(partialState, callback) {
537
+ if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
538
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
539
+ };
540
+ /**
541
+ * Forces an update. This should only be invoked when it is known with
542
+ * certainty that we are **not** in a DOM transaction.
543
+ *
544
+ * You may want to call this when you know that some deeper aspect of the
545
+ * component's state has changed but `setState` was not called.
546
+ *
547
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
548
+ * `componentWillUpdate` and `componentDidUpdate`.
549
+ *
550
+ * @param {?function} callback Called after update is complete.
551
+ * @final
552
+ * @protected
553
+ */
554
+ Component.prototype.forceUpdate = function(callback) {
555
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
556
+ };
557
+ var deprecatedAPIs = {
558
+ isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
559
+ replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
560
+ };
561
+ var defineDeprecationWarning = function(methodName, info) {
562
+ Object.defineProperty(Component.prototype, methodName, { get: function() {
563
+ warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
564
+ return void 0;
565
+ } });
566
+ };
567
+ for (var fnName in deprecatedAPIs) if (deprecatedAPIs.hasOwnProperty(fnName)) defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
568
+ function ComponentDummy() {}
569
+ ComponentDummy.prototype = Component.prototype;
570
+ /**
571
+ * Convenience component with default shallow equality check for sCU.
572
+ */
573
+ function PureComponent(props, context, updater) {
574
+ this.props = props;
575
+ this.context = context;
576
+ this.refs = emptyObject;
577
+ this.updater = updater || ReactNoopUpdateQueue;
578
+ }
579
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
580
+ pureComponentPrototype.constructor = PureComponent;
581
+ assign(pureComponentPrototype, Component.prototype);
582
+ pureComponentPrototype.isPureReactComponent = true;
583
+ function createRef() {
584
+ var refObject = { current: null };
585
+ Object.seal(refObject);
586
+ return refObject;
587
+ }
588
+ var isArrayImpl = Array.isArray;
589
+ function isArray(a) {
590
+ return isArrayImpl(a);
591
+ }
592
+ function typeName(value) {
593
+ var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
594
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
595
+ return type;
596
+ }
597
+ function willCoercionThrow(value) {
598
+ try {
599
+ testStringCoercion(value);
600
+ return false;
601
+ } catch (e) {
602
+ return true;
603
+ }
604
+ }
605
+ function testStringCoercion(value) {
606
+ return "" + value;
607
+ }
608
+ function checkKeyStringCoercion(value) {
609
+ if (willCoercionThrow(value)) {
610
+ error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
611
+ return testStringCoercion(value);
612
+ }
613
+ }
614
+ function getWrappedName(outerType, innerType, wrapperName) {
615
+ var displayName = outerType.displayName;
616
+ if (displayName) return displayName;
617
+ var functionName = innerType.displayName || innerType.name || "";
618
+ return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
619
+ }
620
+ function getContextName(type) {
621
+ return type.displayName || "Context";
622
+ }
623
+ function getComponentNameFromType(type) {
624
+ if (type == null) return null;
625
+ if (typeof type.tag === "number") error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
626
+ if (typeof type === "function") return type.displayName || type.name || null;
627
+ if (typeof type === "string") return type;
628
+ switch (type) {
629
+ case REACT_FRAGMENT_TYPE: return "Fragment";
630
+ case REACT_PORTAL_TYPE: return "Portal";
631
+ case REACT_PROFILER_TYPE: return "Profiler";
632
+ case REACT_STRICT_MODE_TYPE: return "StrictMode";
633
+ case REACT_SUSPENSE_TYPE: return "Suspense";
634
+ case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
635
+ }
636
+ if (typeof type === "object") switch (type.$$typeof) {
637
+ case REACT_CONTEXT_TYPE:
638
+ var context = type;
639
+ return getContextName(context) + ".Consumer";
640
+ case REACT_PROVIDER_TYPE:
641
+ var provider = type;
642
+ return getContextName(provider._context) + ".Provider";
643
+ case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef");
644
+ case REACT_MEMO_TYPE:
645
+ var outerName = type.displayName || null;
646
+ if (outerName !== null) return outerName;
647
+ return getComponentNameFromType(type.type) || "Memo";
648
+ case REACT_LAZY_TYPE:
649
+ var lazyComponent = type;
650
+ var payload = lazyComponent._payload;
651
+ var init = lazyComponent._init;
652
+ try {
653
+ return getComponentNameFromType(init(payload));
654
+ } catch (x$1) {
655
+ return null;
656
+ }
657
+ }
658
+ return null;
659
+ }
660
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
661
+ var RESERVED_PROPS = {
662
+ key: true,
663
+ ref: true,
664
+ __self: true,
665
+ __source: true
666
+ };
667
+ var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
668
+ didWarnAboutStringRefs = {};
669
+ function hasValidRef(config) {
670
+ if (hasOwnProperty.call(config, "ref")) {
671
+ var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
672
+ if (getter && getter.isReactWarning) return false;
673
+ }
674
+ return config.ref !== void 0;
675
+ }
676
+ function hasValidKey(config) {
677
+ if (hasOwnProperty.call(config, "key")) {
678
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
679
+ if (getter && getter.isReactWarning) return false;
680
+ }
681
+ return config.key !== void 0;
682
+ }
683
+ function defineKeyPropWarningGetter(props, displayName) {
684
+ var warnAboutAccessingKey = function() {
685
+ if (!specialPropKeyWarningShown) {
686
+ specialPropKeyWarningShown = true;
687
+ error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
688
+ }
689
+ };
690
+ warnAboutAccessingKey.isReactWarning = true;
691
+ Object.defineProperty(props, "key", {
692
+ get: warnAboutAccessingKey,
693
+ configurable: true
694
+ });
695
+ }
696
+ function defineRefPropWarningGetter(props, displayName) {
697
+ var warnAboutAccessingRef = function() {
698
+ if (!specialPropRefWarningShown) {
699
+ specialPropRefWarningShown = true;
700
+ error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
701
+ }
702
+ };
703
+ warnAboutAccessingRef.isReactWarning = true;
704
+ Object.defineProperty(props, "ref", {
705
+ get: warnAboutAccessingRef,
706
+ configurable: true
707
+ });
708
+ }
709
+ function warnIfStringRefCannotBeAutoConverted(config) {
710
+ if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
711
+ var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
712
+ if (!didWarnAboutStringRefs[componentName]) {
713
+ error("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", componentName, config.ref);
714
+ didWarnAboutStringRefs[componentName] = true;
715
+ }
716
+ }
717
+ }
718
+ /**
719
+ * Factory method to create a new React element. This no longer adheres to
720
+ * the class pattern, so do not use new to call it. Also, instanceof check
721
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
722
+ * if something is a React Element.
723
+ *
724
+ * @param {*} type
725
+ * @param {*} props
726
+ * @param {*} key
727
+ * @param {string|object} ref
728
+ * @param {*} owner
729
+ * @param {*} self A *temporary* helper to detect places where `this` is
730
+ * different from the `owner` when React.createElement is called, so that we
731
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
732
+ * functions, and as long as `this` and owner are the same, there will be no
733
+ * change in behavior.
734
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
735
+ * indicating filename, line number, and/or other information.
736
+ * @internal
737
+ */
738
+ var ReactElement = function(type, key, ref, self, source, owner, props) {
739
+ var element = {
740
+ $$typeof: REACT_ELEMENT_TYPE,
741
+ type,
742
+ key,
743
+ ref,
744
+ props,
745
+ _owner: owner
746
+ };
747
+ element._store = {};
748
+ Object.defineProperty(element._store, "validated", {
749
+ configurable: false,
750
+ enumerable: false,
751
+ writable: true,
752
+ value: false
753
+ });
754
+ Object.defineProperty(element, "_self", {
755
+ configurable: false,
756
+ enumerable: false,
757
+ writable: false,
758
+ value: self
759
+ });
760
+ Object.defineProperty(element, "_source", {
761
+ configurable: false,
762
+ enumerable: false,
763
+ writable: false,
764
+ value: source
765
+ });
766
+ if (Object.freeze) {
767
+ Object.freeze(element.props);
768
+ Object.freeze(element);
769
+ }
770
+ return element;
771
+ };
772
+ /**
773
+ * Create and return a new ReactElement of the given type.
774
+ * See https://reactjs.org/docs/react-api.html#createelement
775
+ */
776
+ function createElement(type, config, children) {
777
+ var propName;
778
+ var props = {};
779
+ var key = null;
780
+ var ref = null;
781
+ var self = null;
782
+ var source = null;
783
+ if (config != null) {
784
+ if (hasValidRef(config)) {
785
+ ref = config.ref;
786
+ warnIfStringRefCannotBeAutoConverted(config);
787
+ }
788
+ if (hasValidKey(config)) {
789
+ checkKeyStringCoercion(config.key);
790
+ key = "" + config.key;
791
+ }
792
+ self = config.__self === void 0 ? null : config.__self;
793
+ source = config.__source === void 0 ? null : config.__source;
794
+ for (propName in config) if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) props[propName] = config[propName];
795
+ }
796
+ var childrenLength = arguments.length - 2;
797
+ if (childrenLength === 1) props.children = children;
798
+ else if (childrenLength > 1) {
799
+ var childArray = Array(childrenLength);
800
+ for (var i = 0; i < childrenLength; i++) childArray[i] = arguments[i + 2];
801
+ if (Object.freeze) Object.freeze(childArray);
802
+ props.children = childArray;
803
+ }
804
+ if (type && type.defaultProps) {
805
+ var defaultProps = type.defaultProps;
806
+ for (propName in defaultProps) if (props[propName] === void 0) props[propName] = defaultProps[propName];
807
+ }
808
+ if (key || ref) {
809
+ var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
810
+ if (key) defineKeyPropWarningGetter(props, displayName);
811
+ if (ref) defineRefPropWarningGetter(props, displayName);
812
+ }
813
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
814
+ }
815
+ function cloneAndReplaceKey(oldElement, newKey) {
816
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
817
+ return newElement;
818
+ }
819
+ /**
820
+ * Clone and return a new ReactElement using element as the starting point.
821
+ * See https://reactjs.org/docs/react-api.html#cloneelement
822
+ */
823
+ function cloneElement(element, config, children) {
824
+ if (element === null || element === void 0) throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
825
+ var propName;
826
+ var props = assign({}, element.props);
827
+ var key = element.key;
828
+ var ref = element.ref;
829
+ var self = element._self;
830
+ var source = element._source;
831
+ var owner = element._owner;
832
+ if (config != null) {
833
+ if (hasValidRef(config)) {
834
+ ref = config.ref;
835
+ owner = ReactCurrentOwner.current;
836
+ }
837
+ if (hasValidKey(config)) {
838
+ checkKeyStringCoercion(config.key);
839
+ key = "" + config.key;
840
+ }
841
+ var defaultProps;
842
+ if (element.type && element.type.defaultProps) defaultProps = element.type.defaultProps;
843
+ for (propName in config) if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) if (config[propName] === void 0 && defaultProps !== void 0) props[propName] = defaultProps[propName];
844
+ else props[propName] = config[propName];
845
+ }
846
+ var childrenLength = arguments.length - 2;
847
+ if (childrenLength === 1) props.children = children;
848
+ else if (childrenLength > 1) {
849
+ var childArray = Array(childrenLength);
850
+ for (var i = 0; i < childrenLength; i++) childArray[i] = arguments[i + 2];
851
+ props.children = childArray;
852
+ }
853
+ return ReactElement(element.type, key, ref, self, source, owner, props);
854
+ }
855
+ /**
856
+ * Verifies the object is a ReactElement.
857
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
858
+ * @param {?object} object
859
+ * @return {boolean} True if `object` is a ReactElement.
860
+ * @final
861
+ */
862
+ function isValidElement(object) {
863
+ return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
864
+ }
865
+ var SEPARATOR = ".";
866
+ var SUBSEPARATOR = ":";
867
+ /**
868
+ * Escape and wrap key so it is safe to use as a reactid
869
+ *
870
+ * @param {string} key to be escaped.
871
+ * @return {string} the escaped key.
872
+ */
873
+ function escape$1(key) {
874
+ var escapeRegex = /[=:]/g;
875
+ var escaperLookup = {
876
+ "=": "=0",
877
+ ":": "=2"
878
+ };
879
+ var escapedString = key.replace(escapeRegex, function(match) {
880
+ return escaperLookup[match];
881
+ });
882
+ return "$" + escapedString;
883
+ }
884
+ /**
885
+ * TODO: Test that a single child and an array with one item have the same key
886
+ * pattern.
887
+ */
888
+ var didWarnAboutMaps = false;
889
+ var userProvidedKeyEscapeRegex = /\/+/g;
890
+ function escapeUserProvidedKey(text) {
891
+ return text.replace(userProvidedKeyEscapeRegex, "$&/");
892
+ }
893
+ /**
894
+ * Generate a key string that identifies a element within a set.
895
+ *
896
+ * @param {*} element A element that could contain a manual key.
897
+ * @param {number} index Index that is used if a manual key is not provided.
898
+ * @return {string}
899
+ */
900
+ function getElementKey(element, index) {
901
+ if (typeof element === "object" && element !== null && element.key != null) {
902
+ checkKeyStringCoercion(element.key);
903
+ return escape$1("" + element.key);
904
+ }
905
+ return index.toString(36);
906
+ }
907
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
908
+ var type = typeof children;
909
+ if (type === "undefined" || type === "boolean") children = null;
910
+ var invokeCallback = false;
911
+ if (children === null) invokeCallback = true;
912
+ else switch (type) {
913
+ case "string":
914
+ case "number":
915
+ invokeCallback = true;
916
+ break;
917
+ case "object": switch (children.$$typeof) {
918
+ case REACT_ELEMENT_TYPE:
919
+ case REACT_PORTAL_TYPE: invokeCallback = true;
920
+ }
921
+ }
922
+ if (invokeCallback) {
923
+ var _child = children;
924
+ var mappedChild = callback(_child);
925
+ var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
926
+ if (isArray(mappedChild)) {
927
+ var escapedChildKey = "";
928
+ if (childKey != null) escapedChildKey = escapeUserProvidedKey(childKey) + "/";
929
+ mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) {
930
+ return c;
931
+ });
932
+ } else if (mappedChild != null) {
933
+ if (isValidElement(mappedChild)) {
934
+ if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) checkKeyStringCoercion(mappedChild.key);
935
+ mappedChild = cloneAndReplaceKey(mappedChild, escapedPrefix + (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? escapeUserProvidedKey("" + mappedChild.key) + "/" : "") + childKey);
936
+ }
937
+ array.push(mappedChild);
938
+ }
939
+ return 1;
940
+ }
941
+ var child;
942
+ var nextName;
943
+ var subtreeCount = 0;
944
+ var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
945
+ if (isArray(children)) for (var i = 0; i < children.length; i++) {
946
+ child = children[i];
947
+ nextName = nextNamePrefix + getElementKey(child, i);
948
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
949
+ }
950
+ else {
951
+ var iteratorFn = getIteratorFn(children);
952
+ if (typeof iteratorFn === "function") {
953
+ var iterableChildren = children;
954
+ if (iteratorFn === iterableChildren.entries) {
955
+ if (!didWarnAboutMaps) warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
956
+ didWarnAboutMaps = true;
957
+ }
958
+ var iterator = iteratorFn.call(iterableChildren);
959
+ var step;
960
+ var ii = 0;
961
+ while (!(step = iterator.next()).done) {
962
+ child = step.value;
963
+ nextName = nextNamePrefix + getElementKey(child, ii++);
964
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
965
+ }
966
+ } else if (type === "object") {
967
+ var childrenString = String(children);
968
+ throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
969
+ }
970
+ }
971
+ return subtreeCount;
972
+ }
973
+ /**
974
+ * Maps children that are typically specified as `props.children`.
975
+ *
976
+ * See https://reactjs.org/docs/react-api.html#reactchildrenmap
977
+ *
978
+ * The provided mapFunction(child, index) will be called for each
979
+ * leaf child.
980
+ *
981
+ * @param {?*} children Children tree container.
982
+ * @param {function(*, int)} func The map function.
983
+ * @param {*} context Context for mapFunction.
984
+ * @return {object} Object containing the ordered map of results.
985
+ */
986
+ function mapChildren(children, func, context) {
987
+ if (children == null) return children;
988
+ var result = [];
989
+ var count = 0;
990
+ mapIntoArray(children, result, "", "", function(child) {
991
+ return func.call(context, child, count++);
992
+ });
993
+ return result;
994
+ }
995
+ /**
996
+ * Count the number of children that are typically specified as
997
+ * `props.children`.
998
+ *
999
+ * See https://reactjs.org/docs/react-api.html#reactchildrencount
1000
+ *
1001
+ * @param {?*} children Children tree container.
1002
+ * @return {number} The number of children.
1003
+ */
1004
+ function countChildren(children) {
1005
+ var n$1 = 0;
1006
+ mapChildren(children, function() {
1007
+ n$1++;
1008
+ });
1009
+ return n$1;
1010
+ }
1011
+ /**
1012
+ * Iterates through children that are typically specified as `props.children`.
1013
+ *
1014
+ * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1015
+ *
1016
+ * The provided forEachFunc(child, index) will be called for each
1017
+ * leaf child.
1018
+ *
1019
+ * @param {?*} children Children tree container.
1020
+ * @param {function(*, int)} forEachFunc
1021
+ * @param {*} forEachContext Context for forEachContext.
1022
+ */
1023
+ function forEachChildren(children, forEachFunc, forEachContext) {
1024
+ mapChildren(children, function() {
1025
+ forEachFunc.apply(this, arguments);
1026
+ }, forEachContext);
1027
+ }
1028
+ /**
1029
+ * Flatten a children object (typically specified as `props.children`) and
1030
+ * return an array with appropriately re-keyed children.
1031
+ *
1032
+ * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1033
+ */
1034
+ function toArray(children) {
1035
+ return mapChildren(children, function(child) {
1036
+ return child;
1037
+ }) || [];
1038
+ }
1039
+ /**
1040
+ * Returns the first child in a collection of children and verifies that there
1041
+ * is only one child in the collection.
1042
+ *
1043
+ * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1044
+ *
1045
+ * The current implementation of this function assumes that a single child gets
1046
+ * passed without a wrapper, but the purpose of this helper function is to
1047
+ * abstract away the particular structure of children.
1048
+ *
1049
+ * @param {?object} children Child collection structure.
1050
+ * @return {ReactElement} The first and only `ReactElement` contained in the
1051
+ * structure.
1052
+ */
1053
+ function onlyChild(children) {
1054
+ if (!isValidElement(children)) throw new Error("React.Children.only expected to receive a single React element child.");
1055
+ return children;
1056
+ }
1057
+ function createContext(defaultValue) {
1058
+ var context = {
1059
+ $$typeof: REACT_CONTEXT_TYPE,
1060
+ _currentValue: defaultValue,
1061
+ _currentValue2: defaultValue,
1062
+ _threadCount: 0,
1063
+ Provider: null,
1064
+ Consumer: null,
1065
+ _defaultValue: null,
1066
+ _globalName: null
1067
+ };
1068
+ context.Provider = {
1069
+ $$typeof: REACT_PROVIDER_TYPE,
1070
+ _context: context
1071
+ };
1072
+ var hasWarnedAboutUsingNestedContextConsumers = false;
1073
+ var hasWarnedAboutUsingConsumerProvider = false;
1074
+ var hasWarnedAboutDisplayNameOnConsumer = false;
1075
+ var Consumer = {
1076
+ $$typeof: REACT_CONTEXT_TYPE,
1077
+ _context: context
1078
+ };
1079
+ Object.defineProperties(Consumer, {
1080
+ Provider: {
1081
+ get: function() {
1082
+ if (!hasWarnedAboutUsingConsumerProvider) {
1083
+ hasWarnedAboutUsingConsumerProvider = true;
1084
+ error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
1085
+ }
1086
+ return context.Provider;
1087
+ },
1088
+ set: function(_Provider) {
1089
+ context.Provider = _Provider;
1090
+ }
1091
+ },
1092
+ _currentValue: {
1093
+ get: function() {
1094
+ return context._currentValue;
1095
+ },
1096
+ set: function(_currentValue) {
1097
+ context._currentValue = _currentValue;
1098
+ }
1099
+ },
1100
+ _currentValue2: {
1101
+ get: function() {
1102
+ return context._currentValue2;
1103
+ },
1104
+ set: function(_currentValue2) {
1105
+ context._currentValue2 = _currentValue2;
1106
+ }
1107
+ },
1108
+ _threadCount: {
1109
+ get: function() {
1110
+ return context._threadCount;
1111
+ },
1112
+ set: function(_threadCount) {
1113
+ context._threadCount = _threadCount;
1114
+ }
1115
+ },
1116
+ Consumer: { get: function() {
1117
+ if (!hasWarnedAboutUsingNestedContextConsumers) {
1118
+ hasWarnedAboutUsingNestedContextConsumers = true;
1119
+ error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
1120
+ }
1121
+ return context.Consumer;
1122
+ } },
1123
+ displayName: {
1124
+ get: function() {
1125
+ return context.displayName;
1126
+ },
1127
+ set: function(displayName) {
1128
+ if (!hasWarnedAboutDisplayNameOnConsumer) {
1129
+ warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
1130
+ hasWarnedAboutDisplayNameOnConsumer = true;
1131
+ }
1132
+ }
1133
+ }
1134
+ });
1135
+ context.Consumer = Consumer;
1136
+ context._currentRenderer = null;
1137
+ context._currentRenderer2 = null;
1138
+ return context;
1139
+ }
1140
+ var Uninitialized = -1;
1141
+ var Pending = 0;
1142
+ var Resolved = 1;
1143
+ var Rejected = 2;
1144
+ function lazyInitializer(payload) {
1145
+ if (payload._status === Uninitialized) {
1146
+ var ctor = payload._result;
1147
+ var thenable = ctor();
1148
+ thenable.then(function(moduleObject$1) {
1149
+ if (payload._status === Pending || payload._status === Uninitialized) {
1150
+ var resolved = payload;
1151
+ resolved._status = Resolved;
1152
+ resolved._result = moduleObject$1;
1153
+ }
1154
+ }, function(error$1) {
1155
+ if (payload._status === Pending || payload._status === Uninitialized) {
1156
+ var rejected = payload;
1157
+ rejected._status = Rejected;
1158
+ rejected._result = error$1;
1159
+ }
1160
+ });
1161
+ if (payload._status === Uninitialized) {
1162
+ var pending = payload;
1163
+ pending._status = Pending;
1164
+ pending._result = thenable;
1165
+ }
1166
+ }
1167
+ if (payload._status === Resolved) {
1168
+ var moduleObject = payload._result;
1169
+ if (moduleObject === void 0) error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
1170
+ if (!("default" in moduleObject)) error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
1171
+ return moduleObject.default;
1172
+ } else throw payload._result;
1173
+ }
1174
+ function lazy(ctor) {
1175
+ var payload = {
1176
+ _status: Uninitialized,
1177
+ _result: ctor
1178
+ };
1179
+ var lazyType = {
1180
+ $$typeof: REACT_LAZY_TYPE,
1181
+ _payload: payload,
1182
+ _init: lazyInitializer
1183
+ };
1184
+ var defaultProps;
1185
+ var propTypes;
1186
+ Object.defineProperties(lazyType, {
1187
+ defaultProps: {
1188
+ configurable: true,
1189
+ get: function() {
1190
+ return defaultProps;
1191
+ },
1192
+ set: function(newDefaultProps) {
1193
+ error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
1194
+ defaultProps = newDefaultProps;
1195
+ Object.defineProperty(lazyType, "defaultProps", { enumerable: true });
1196
+ }
1197
+ },
1198
+ propTypes: {
1199
+ configurable: true,
1200
+ get: function() {
1201
+ return propTypes;
1202
+ },
1203
+ set: function(newPropTypes) {
1204
+ error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
1205
+ propTypes = newPropTypes;
1206
+ Object.defineProperty(lazyType, "propTypes", { enumerable: true });
1207
+ }
1208
+ }
1209
+ });
1210
+ return lazyType;
1211
+ }
1212
+ function forwardRef(render) {
1213
+ if (render != null && render.$$typeof === REACT_MEMO_TYPE) error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
1214
+ else if (typeof render !== "function") error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
1215
+ else if (render.length !== 0 && render.length !== 2) error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
1216
+ if (render != null) {
1217
+ if (render.defaultProps != null || render.propTypes != null) error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
1218
+ }
1219
+ var elementType = {
1220
+ $$typeof: REACT_FORWARD_REF_TYPE,
1221
+ render
1222
+ };
1223
+ var ownName;
1224
+ Object.defineProperty(elementType, "displayName", {
1225
+ enumerable: false,
1226
+ configurable: true,
1227
+ get: function() {
1228
+ return ownName;
1229
+ },
1230
+ set: function(name) {
1231
+ ownName = name;
1232
+ if (!render.name && !render.displayName) render.displayName = name;
1233
+ }
1234
+ });
1235
+ return elementType;
1236
+ }
1237
+ var REACT_MODULE_REFERENCE;
1238
+ REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
1239
+ function isValidElementType(type) {
1240
+ if (typeof type === "string" || typeof type === "function") return true;
1241
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) return true;
1242
+ if (typeof type === "object" && type !== null) {
1243
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) return true;
1244
+ }
1245
+ return false;
1246
+ }
1247
+ function memo(type, compare) {
1248
+ if (!isValidElementType(type)) error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
1249
+ var elementType = {
1250
+ $$typeof: REACT_MEMO_TYPE,
1251
+ type,
1252
+ compare: compare === void 0 ? null : compare
1253
+ };
1254
+ var ownName;
1255
+ Object.defineProperty(elementType, "displayName", {
1256
+ enumerable: false,
1257
+ configurable: true,
1258
+ get: function() {
1259
+ return ownName;
1260
+ },
1261
+ set: function(name) {
1262
+ ownName = name;
1263
+ if (!type.name && !type.displayName) type.displayName = name;
1264
+ }
1265
+ });
1266
+ return elementType;
1267
+ }
1268
+ function resolveDispatcher() {
1269
+ var dispatcher = ReactCurrentDispatcher.current;
1270
+ if (dispatcher === null) error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
1271
+ return dispatcher;
1272
+ }
1273
+ function useContext(Context) {
1274
+ var dispatcher = resolveDispatcher();
1275
+ if (Context._context !== void 0) {
1276
+ var realContext = Context._context;
1277
+ if (realContext.Consumer === Context) error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
1278
+ else if (realContext.Provider === Context) error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
1279
+ }
1280
+ return dispatcher.useContext(Context);
1281
+ }
1282
+ function useState(initialState) {
1283
+ var dispatcher = resolveDispatcher();
1284
+ return dispatcher.useState(initialState);
1285
+ }
1286
+ function useReducer(reducer, initialArg, init) {
1287
+ var dispatcher = resolveDispatcher();
1288
+ return dispatcher.useReducer(reducer, initialArg, init);
1289
+ }
1290
+ function useRef(initialValue) {
1291
+ var dispatcher = resolveDispatcher();
1292
+ return dispatcher.useRef(initialValue);
1293
+ }
1294
+ function useEffect(create, deps) {
1295
+ var dispatcher = resolveDispatcher();
1296
+ return dispatcher.useEffect(create, deps);
1297
+ }
1298
+ function useInsertionEffect(create, deps) {
1299
+ var dispatcher = resolveDispatcher();
1300
+ return dispatcher.useInsertionEffect(create, deps);
1301
+ }
1302
+ function useLayoutEffect(create, deps) {
1303
+ var dispatcher = resolveDispatcher();
1304
+ return dispatcher.useLayoutEffect(create, deps);
1305
+ }
1306
+ function useCallback(callback, deps) {
1307
+ var dispatcher = resolveDispatcher();
1308
+ return dispatcher.useCallback(callback, deps);
1309
+ }
1310
+ function useMemo(create, deps) {
1311
+ var dispatcher = resolveDispatcher();
1312
+ return dispatcher.useMemo(create, deps);
1313
+ }
1314
+ function useImperativeHandle(ref, create, deps) {
1315
+ var dispatcher = resolveDispatcher();
1316
+ return dispatcher.useImperativeHandle(ref, create, deps);
1317
+ }
1318
+ function useDebugValue(value, formatterFn) {
1319
+ var dispatcher = resolveDispatcher();
1320
+ return dispatcher.useDebugValue(value, formatterFn);
1321
+ }
1322
+ function useTransition() {
1323
+ var dispatcher = resolveDispatcher();
1324
+ return dispatcher.useTransition();
1325
+ }
1326
+ function useDeferredValue(value) {
1327
+ var dispatcher = resolveDispatcher();
1328
+ return dispatcher.useDeferredValue(value);
1329
+ }
1330
+ function useId() {
1331
+ var dispatcher = resolveDispatcher();
1332
+ return dispatcher.useId();
1333
+ }
1334
+ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
1335
+ var dispatcher = resolveDispatcher();
1336
+ return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
1337
+ }
1338
+ var disabledDepth = 0;
1339
+ var prevLog;
1340
+ var prevInfo;
1341
+ var prevWarn;
1342
+ var prevError;
1343
+ var prevGroup;
1344
+ var prevGroupCollapsed;
1345
+ var prevGroupEnd;
1346
+ function disabledLog() {}
1347
+ disabledLog.__reactDisabledLog = true;
1348
+ function disableLogs() {
1349
+ if (disabledDepth === 0) {
1350
+ prevLog = console.log;
1351
+ prevInfo = console.info;
1352
+ prevWarn = console.warn;
1353
+ prevError = console.error;
1354
+ prevGroup = console.group;
1355
+ prevGroupCollapsed = console.groupCollapsed;
1356
+ prevGroupEnd = console.groupEnd;
1357
+ var props = {
1358
+ configurable: true,
1359
+ enumerable: true,
1360
+ value: disabledLog,
1361
+ writable: true
1362
+ };
1363
+ Object.defineProperties(console, {
1364
+ info: props,
1365
+ log: props,
1366
+ warn: props,
1367
+ error: props,
1368
+ group: props,
1369
+ groupCollapsed: props,
1370
+ groupEnd: props
1371
+ });
1372
+ }
1373
+ disabledDepth++;
1374
+ }
1375
+ function reenableLogs() {
1376
+ disabledDepth--;
1377
+ if (disabledDepth === 0) {
1378
+ var props = {
1379
+ configurable: true,
1380
+ enumerable: true,
1381
+ writable: true
1382
+ };
1383
+ Object.defineProperties(console, {
1384
+ log: assign({}, props, { value: prevLog }),
1385
+ info: assign({}, props, { value: prevInfo }),
1386
+ warn: assign({}, props, { value: prevWarn }),
1387
+ error: assign({}, props, { value: prevError }),
1388
+ group: assign({}, props, { value: prevGroup }),
1389
+ groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
1390
+ groupEnd: assign({}, props, { value: prevGroupEnd })
1391
+ });
1392
+ }
1393
+ if (disabledDepth < 0) error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1394
+ }
1395
+ var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
1396
+ var prefix;
1397
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
1398
+ if (prefix === void 0) try {
1399
+ throw Error();
1400
+ } catch (x$1) {
1401
+ var match = x$1.stack.trim().match(/\n( *(at )?)/);
1402
+ prefix = match && match[1] || "";
1403
+ }
1404
+ return "\n" + prefix + name;
1405
+ }
1406
+ var reentry = false;
1407
+ var componentFrameCache;
1408
+ var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
1409
+ componentFrameCache = new PossiblyWeakMap();
1410
+ function describeNativeComponentFrame(fn, construct) {
1411
+ if (!fn || reentry) return "";
1412
+ var frame = componentFrameCache.get(fn);
1413
+ if (frame !== void 0) return frame;
1414
+ var control;
1415
+ reentry = true;
1416
+ var previousPrepareStackTrace = Error.prepareStackTrace;
1417
+ Error.prepareStackTrace = void 0;
1418
+ var previousDispatcher;
1419
+ previousDispatcher = ReactCurrentDispatcher$1.current;
1420
+ ReactCurrentDispatcher$1.current = null;
1421
+ disableLogs();
1422
+ try {
1423
+ if (construct) {
1424
+ var Fake = function() {
1425
+ throw Error();
1426
+ };
1427
+ Object.defineProperty(Fake.prototype, "props", { set: function() {
1428
+ throw Error();
1429
+ } });
1430
+ if (typeof Reflect === "object" && Reflect.construct) {
1431
+ try {
1432
+ Reflect.construct(Fake, []);
1433
+ } catch (x$1) {
1434
+ control = x$1;
1435
+ }
1436
+ Reflect.construct(fn, [], Fake);
1437
+ } else {
1438
+ try {
1439
+ Fake.call();
1440
+ } catch (x$1) {
1441
+ control = x$1;
1442
+ }
1443
+ fn.call(Fake.prototype);
1444
+ }
1445
+ } else {
1446
+ try {
1447
+ throw Error();
1448
+ } catch (x$1) {
1449
+ control = x$1;
1450
+ }
1451
+ fn();
1452
+ }
1453
+ } catch (sample) {
1454
+ if (sample && control && typeof sample.stack === "string") {
1455
+ var sampleLines = sample.stack.split("\n");
1456
+ var controlLines = control.stack.split("\n");
1457
+ var s = sampleLines.length - 1;
1458
+ var c = controlLines.length - 1;
1459
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) c--;
1460
+ for (; s >= 1 && c >= 0; s--, c--) if (sampleLines[s] !== controlLines[c]) {
1461
+ if (s !== 1 || c !== 1) do {
1462
+ s--;
1463
+ c--;
1464
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
1465
+ var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
1466
+ if (fn.displayName && _frame.includes("<anonymous>")) _frame = _frame.replace("<anonymous>", fn.displayName);
1467
+ if (typeof fn === "function") componentFrameCache.set(fn, _frame);
1468
+ return _frame;
1469
+ }
1470
+ } while (s >= 1 && c >= 0);
1471
+ break;
1472
+ }
1473
+ }
1474
+ } finally {
1475
+ reentry = false;
1476
+ ReactCurrentDispatcher$1.current = previousDispatcher;
1477
+ reenableLogs();
1478
+ Error.prepareStackTrace = previousPrepareStackTrace;
1479
+ }
1480
+ var name = fn ? fn.displayName || fn.name : "";
1481
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
1482
+ if (typeof fn === "function") componentFrameCache.set(fn, syntheticFrame);
1483
+ return syntheticFrame;
1484
+ }
1485
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
1486
+ return describeNativeComponentFrame(fn, false);
1487
+ }
1488
+ function shouldConstruct(Component$1) {
1489
+ var prototype = Component$1.prototype;
1490
+ return !!(prototype && prototype.isReactComponent);
1491
+ }
1492
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
1493
+ if (type == null) return "";
1494
+ if (typeof type === "function") return describeNativeComponentFrame(type, shouldConstruct(type));
1495
+ if (typeof type === "string") return describeBuiltInComponentFrame(type);
1496
+ switch (type) {
1497
+ case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense");
1498
+ case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList");
1499
+ }
1500
+ if (typeof type === "object") switch (type.$$typeof) {
1501
+ case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render);
1502
+ case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
1503
+ case REACT_LAZY_TYPE:
1504
+ var lazyComponent = type;
1505
+ var payload = lazyComponent._payload;
1506
+ var init = lazyComponent._init;
1507
+ try {
1508
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
1509
+ } catch (x$1) {}
1510
+ }
1511
+ return "";
1512
+ }
1513
+ var loggedTypeFailures = {};
1514
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1515
+ function setCurrentlyValidatingElement(element) {
1516
+ if (element) {
1517
+ var owner = element._owner;
1518
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1519
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
1520
+ } else ReactDebugCurrentFrame$1.setExtraStackFrame(null);
1521
+ }
1522
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
1523
+ var has = Function.call.bind(hasOwnProperty);
1524
+ for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) {
1525
+ var error$1 = void 0;
1526
+ try {
1527
+ if (typeof typeSpecs[typeSpecName] !== "function") {
1528
+ var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1529
+ err.name = "Invariant Violation";
1530
+ throw err;
1531
+ }
1532
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1533
+ } catch (ex) {
1534
+ error$1 = ex;
1535
+ }
1536
+ if (error$1 && !(error$1 instanceof Error)) {
1537
+ setCurrentlyValidatingElement(element);
1538
+ error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
1539
+ setCurrentlyValidatingElement(null);
1540
+ }
1541
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
1542
+ loggedTypeFailures[error$1.message] = true;
1543
+ setCurrentlyValidatingElement(element);
1544
+ error("Failed %s type: %s", location, error$1.message);
1545
+ setCurrentlyValidatingElement(null);
1546
+ }
1547
+ }
1548
+ }
1549
+ function setCurrentlyValidatingElement$1(element) {
1550
+ if (element) {
1551
+ var owner = element._owner;
1552
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1553
+ setExtraStackFrame(stack);
1554
+ } else setExtraStackFrame(null);
1555
+ }
1556
+ var propTypesMisspellWarningShown;
1557
+ propTypesMisspellWarningShown = false;
1558
+ function getDeclarationErrorAddendum() {
1559
+ if (ReactCurrentOwner.current) {
1560
+ var name = getComponentNameFromType(ReactCurrentOwner.current.type);
1561
+ if (name) return "\n\nCheck the render method of `" + name + "`.";
1562
+ }
1563
+ return "";
1564
+ }
1565
+ function getSourceInfoErrorAddendum(source) {
1566
+ if (source !== void 0) {
1567
+ var fileName = source.fileName.replace(/^.*[\\\/]/, "");
1568
+ var lineNumber = source.lineNumber;
1569
+ return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
1570
+ }
1571
+ return "";
1572
+ }
1573
+ function getSourceInfoErrorAddendumForProps(elementProps) {
1574
+ if (elementProps !== null && elementProps !== void 0) return getSourceInfoErrorAddendum(elementProps.__source);
1575
+ return "";
1576
+ }
1577
+ /**
1578
+ * Warn if there's no key explicitly set on dynamic arrays of children or
1579
+ * object keys are not valid. This allows us to keep track of children between
1580
+ * updates.
1581
+ */
1582
+ var ownerHasKeyUseWarning = {};
1583
+ function getCurrentComponentErrorInfo(parentType) {
1584
+ var info = getDeclarationErrorAddendum();
1585
+ if (!info) {
1586
+ var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
1587
+ if (parentName) info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1588
+ }
1589
+ return info;
1590
+ }
1591
+ /**
1592
+ * Warn if the element doesn't have an explicit key assigned to it.
1593
+ * This element is in an array. The array could grow and shrink or be
1594
+ * reordered. All children that haven't already been validated are required to
1595
+ * have a "key" property assigned to it. Error statuses are cached so a warning
1596
+ * will only be shown once.
1597
+ *
1598
+ * @internal
1599
+ * @param {ReactElement} element Element that requires a key.
1600
+ * @param {*} parentType element's parent's type.
1601
+ */
1602
+ function validateExplicitKey(element, parentType) {
1603
+ if (!element._store || element._store.validated || element.key != null) return;
1604
+ element._store.validated = true;
1605
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1606
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) return;
1607
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
1608
+ var childOwner = "";
1609
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1610
+ setCurrentlyValidatingElement$1(element);
1611
+ error("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.", currentComponentErrorInfo, childOwner);
1612
+ setCurrentlyValidatingElement$1(null);
1613
+ }
1614
+ /**
1615
+ * Ensure that every element either is passed in a static location, in an
1616
+ * array with an explicit keys property defined, or in an object literal
1617
+ * with valid key property.
1618
+ *
1619
+ * @internal
1620
+ * @param {ReactNode} node Statically passed child of any type.
1621
+ * @param {*} parentType node's parent's type.
1622
+ */
1623
+ function validateChildKeys(node, parentType) {
1624
+ if (typeof node !== "object") return;
1625
+ if (isArray(node)) for (var i = 0; i < node.length; i++) {
1626
+ var child = node[i];
1627
+ if (isValidElement(child)) validateExplicitKey(child, parentType);
1628
+ }
1629
+ else if (isValidElement(node)) {
1630
+ if (node._store) node._store.validated = true;
1631
+ } else if (node) {
1632
+ var iteratorFn = getIteratorFn(node);
1633
+ if (typeof iteratorFn === "function") {
1634
+ if (iteratorFn !== node.entries) {
1635
+ var iterator = iteratorFn.call(node);
1636
+ var step;
1637
+ while (!(step = iterator.next()).done) if (isValidElement(step.value)) validateExplicitKey(step.value, parentType);
1638
+ }
1639
+ }
1640
+ }
1641
+ }
1642
+ /**
1643
+ * Given an element, validate that its props follow the propTypes definition,
1644
+ * provided by the type.
1645
+ *
1646
+ * @param {ReactElement} element
1647
+ */
1648
+ function validatePropTypes(element) {
1649
+ var type = element.type;
1650
+ if (type === null || type === void 0 || typeof type === "string") return;
1651
+ var propTypes;
1652
+ if (typeof type === "function") propTypes = type.propTypes;
1653
+ else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) propTypes = type.propTypes;
1654
+ else return;
1655
+ if (propTypes) {
1656
+ var name = getComponentNameFromType(type);
1657
+ checkPropTypes(propTypes, element.props, "prop", name, element);
1658
+ } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
1659
+ propTypesMisspellWarningShown = true;
1660
+ var _name = getComponentNameFromType(type);
1661
+ error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
1662
+ }
1663
+ if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1664
+ }
1665
+ /**
1666
+ * Given a fragment, validate that it can only be provided with fragment props
1667
+ * @param {ReactElement} fragment
1668
+ */
1669
+ function validateFragmentProps(fragment) {
1670
+ var keys = Object.keys(fragment.props);
1671
+ for (var i = 0; i < keys.length; i++) {
1672
+ var key = keys[i];
1673
+ if (key !== "children" && key !== "key") {
1674
+ setCurrentlyValidatingElement$1(fragment);
1675
+ error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
1676
+ setCurrentlyValidatingElement$1(null);
1677
+ break;
1678
+ }
1679
+ }
1680
+ if (fragment.ref !== null) {
1681
+ setCurrentlyValidatingElement$1(fragment);
1682
+ error("Invalid attribute `ref` supplied to `React.Fragment`.");
1683
+ setCurrentlyValidatingElement$1(null);
1684
+ }
1685
+ }
1686
+ function createElementWithValidation(type, props, children) {
1687
+ var validType = isValidElementType(type);
1688
+ if (!validType) {
1689
+ var info = "";
1690
+ if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
1691
+ var sourceInfo = getSourceInfoErrorAddendumForProps(props);
1692
+ if (sourceInfo) info += sourceInfo;
1693
+ else info += getDeclarationErrorAddendum();
1694
+ var typeString;
1695
+ if (type === null) typeString = "null";
1696
+ else if (isArray(type)) typeString = "array";
1697
+ else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
1698
+ typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
1699
+ info = " Did you accidentally export a JSX literal instead of a component?";
1700
+ } else typeString = typeof type;
1701
+ error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
1702
+ }
1703
+ var element = createElement.apply(this, arguments);
1704
+ if (element == null) return element;
1705
+ if (validType) for (var i = 2; i < arguments.length; i++) validateChildKeys(arguments[i], type);
1706
+ if (type === REACT_FRAGMENT_TYPE) validateFragmentProps(element);
1707
+ else validatePropTypes(element);
1708
+ return element;
1709
+ }
1710
+ var didWarnAboutDeprecatedCreateFactory = false;
1711
+ function createFactoryWithValidation(type) {
1712
+ var validatedFactory = createElementWithValidation.bind(null, type);
1713
+ validatedFactory.type = type;
1714
+ if (!didWarnAboutDeprecatedCreateFactory) {
1715
+ didWarnAboutDeprecatedCreateFactory = true;
1716
+ warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
1717
+ }
1718
+ Object.defineProperty(validatedFactory, "type", {
1719
+ enumerable: false,
1720
+ get: function() {
1721
+ warn("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
1722
+ Object.defineProperty(this, "type", { value: type });
1723
+ return type;
1724
+ }
1725
+ });
1726
+ return validatedFactory;
1727
+ }
1728
+ function cloneElementWithValidation(element, props, children) {
1729
+ var newElement = cloneElement.apply(this, arguments);
1730
+ for (var i = 2; i < arguments.length; i++) validateChildKeys(arguments[i], newElement.type);
1731
+ validatePropTypes(newElement);
1732
+ return newElement;
1733
+ }
1734
+ function startTransition(scope, options) {
1735
+ var prevTransition = ReactCurrentBatchConfig.transition;
1736
+ ReactCurrentBatchConfig.transition = {};
1737
+ var currentTransition = ReactCurrentBatchConfig.transition;
1738
+ ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set();
1739
+ try {
1740
+ scope();
1741
+ } finally {
1742
+ ReactCurrentBatchConfig.transition = prevTransition;
1743
+ if (prevTransition === null && currentTransition._updatedFibers) {
1744
+ var updatedFibersCount = currentTransition._updatedFibers.size;
1745
+ if (updatedFibersCount > 10) warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
1746
+ currentTransition._updatedFibers.clear();
1747
+ }
1748
+ }
1749
+ }
1750
+ var didWarnAboutMessageChannel = false;
1751
+ var enqueueTaskImpl = null;
1752
+ function enqueueTask(task) {
1753
+ if (enqueueTaskImpl === null) try {
1754
+ var requireString = ("require" + Math.random()).slice(0, 7);
1755
+ var nodeRequire = module && module[requireString];
1756
+ enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate;
1757
+ } catch (_err) {
1758
+ enqueueTaskImpl = function(callback) {
1759
+ if (didWarnAboutMessageChannel === false) {
1760
+ didWarnAboutMessageChannel = true;
1761
+ if (typeof MessageChannel === "undefined") error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.");
1762
+ }
1763
+ var channel = new MessageChannel();
1764
+ channel.port1.onmessage = callback;
1765
+ channel.port2.postMessage(void 0);
1766
+ };
1767
+ }
1768
+ return enqueueTaskImpl(task);
1769
+ }
1770
+ var actScopeDepth = 0;
1771
+ var didWarnNoAwaitAct = false;
1772
+ function act(callback) {
1773
+ var prevActScopeDepth = actScopeDepth;
1774
+ actScopeDepth++;
1775
+ if (ReactCurrentActQueue.current === null) ReactCurrentActQueue.current = [];
1776
+ var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
1777
+ var result;
1778
+ try {
1779
+ ReactCurrentActQueue.isBatchingLegacy = true;
1780
+ result = callback();
1781
+ if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
1782
+ var queue = ReactCurrentActQueue.current;
1783
+ if (queue !== null) {
1784
+ ReactCurrentActQueue.didScheduleLegacyUpdate = false;
1785
+ flushActQueue(queue);
1786
+ }
1787
+ }
1788
+ } catch (error$1) {
1789
+ popActScope(prevActScopeDepth);
1790
+ throw error$1;
1791
+ } finally {
1792
+ ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
1793
+ }
1794
+ if (result !== null && typeof result === "object" && typeof result.then === "function") {
1795
+ var thenableResult = result;
1796
+ var wasAwaited = false;
1797
+ var thenable = { then: function(resolve, reject) {
1798
+ wasAwaited = true;
1799
+ thenableResult.then(function(returnValue$1) {
1800
+ popActScope(prevActScopeDepth);
1801
+ if (actScopeDepth === 0) recursivelyFlushAsyncActWork(returnValue$1, resolve, reject);
1802
+ else resolve(returnValue$1);
1803
+ }, function(error$1) {
1804
+ popActScope(prevActScopeDepth);
1805
+ reject(error$1);
1806
+ });
1807
+ } };
1808
+ if (!didWarnNoAwaitAct && typeof Promise !== "undefined") Promise.resolve().then(function() {}).then(function() {
1809
+ if (!wasAwaited) {
1810
+ didWarnNoAwaitAct = true;
1811
+ error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);");
1812
+ }
1813
+ });
1814
+ return thenable;
1815
+ } else {
1816
+ var returnValue = result;
1817
+ popActScope(prevActScopeDepth);
1818
+ if (actScopeDepth === 0) {
1819
+ var _queue = ReactCurrentActQueue.current;
1820
+ if (_queue !== null) {
1821
+ flushActQueue(_queue);
1822
+ ReactCurrentActQueue.current = null;
1823
+ }
1824
+ var _thenable = { then: function(resolve, reject) {
1825
+ if (ReactCurrentActQueue.current === null) {
1826
+ ReactCurrentActQueue.current = [];
1827
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
1828
+ } else resolve(returnValue);
1829
+ } };
1830
+ return _thenable;
1831
+ } else {
1832
+ var _thenable2 = { then: function(resolve, reject) {
1833
+ resolve(returnValue);
1834
+ } };
1835
+ return _thenable2;
1836
+ }
1837
+ }
1838
+ }
1839
+ function popActScope(prevActScopeDepth) {
1840
+ if (prevActScopeDepth !== actScopeDepth - 1) error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
1841
+ actScopeDepth = prevActScopeDepth;
1842
+ }
1843
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
1844
+ var queue = ReactCurrentActQueue.current;
1845
+ if (queue !== null) try {
1846
+ flushActQueue(queue);
1847
+ enqueueTask(function() {
1848
+ if (queue.length === 0) {
1849
+ ReactCurrentActQueue.current = null;
1850
+ resolve(returnValue);
1851
+ } else recursivelyFlushAsyncActWork(returnValue, resolve, reject);
1852
+ });
1853
+ } catch (error$1) {
1854
+ reject(error$1);
1855
+ }
1856
+ else resolve(returnValue);
1857
+ }
1858
+ var isFlushing = false;
1859
+ function flushActQueue(queue) {
1860
+ if (!isFlushing) {
1861
+ isFlushing = true;
1862
+ var i = 0;
1863
+ try {
1864
+ for (; i < queue.length; i++) {
1865
+ var callback = queue[i];
1866
+ do
1867
+ callback = callback(true);
1868
+ while (callback !== null);
1869
+ }
1870
+ queue.length = 0;
1871
+ } catch (error$1) {
1872
+ queue = queue.slice(i + 1);
1873
+ throw error$1;
1874
+ } finally {
1875
+ isFlushing = false;
1876
+ }
1877
+ }
1878
+ }
1879
+ var createElement$1 = createElementWithValidation;
1880
+ var cloneElement$1 = cloneElementWithValidation;
1881
+ var createFactory = createFactoryWithValidation;
1882
+ var Children = {
1883
+ map: mapChildren,
1884
+ forEach: forEachChildren,
1885
+ count: countChildren,
1886
+ toArray,
1887
+ only: onlyChild
1888
+ };
1889
+ exports.Children = Children;
1890
+ exports.Component = Component;
1891
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1892
+ exports.Profiler = REACT_PROFILER_TYPE;
1893
+ exports.PureComponent = PureComponent;
1894
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
1895
+ exports.Suspense = REACT_SUSPENSE_TYPE;
1896
+ exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
1897
+ exports.act = act;
1898
+ exports.cloneElement = cloneElement$1;
1899
+ exports.createContext = createContext;
1900
+ exports.createElement = createElement$1;
1901
+ exports.createFactory = createFactory;
1902
+ exports.createRef = createRef;
1903
+ exports.forwardRef = forwardRef;
1904
+ exports.isValidElement = isValidElement;
1905
+ exports.lazy = lazy;
1906
+ exports.memo = memo;
1907
+ exports.startTransition = startTransition;
1908
+ exports.unstable_act = act;
1909
+ exports.useCallback = useCallback;
1910
+ exports.useContext = useContext;
1911
+ exports.useDebugValue = useDebugValue;
1912
+ exports.useDeferredValue = useDeferredValue;
1913
+ exports.useEffect = useEffect;
1914
+ exports.useId = useId;
1915
+ exports.useImperativeHandle = useImperativeHandle;
1916
+ exports.useInsertionEffect = useInsertionEffect;
1917
+ exports.useLayoutEffect = useLayoutEffect;
1918
+ exports.useMemo = useMemo;
1919
+ exports.useReducer = useReducer;
1920
+ exports.useRef = useRef;
1921
+ exports.useState = useState;
1922
+ exports.useSyncExternalStore = useSyncExternalStore;
1923
+ exports.useTransition = useTransition;
1924
+ exports.version = ReactVersion;
1925
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(/* @__PURE__ */ new Error());
1926
+ })();
1927
+ }) });
1928
+
1929
+ //#endregion
1930
+ //#region ../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js
1931
+ var require_react = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js": ((exports, module) => {
1932
+ if (process.env.NODE_ENV === "production") module.exports = require_react_production_min();
1933
+ else module.exports = require_react_development();
1934
+ }) });
1935
+
1936
+ //#endregion
1937
+ //#region src/parser.ts
1938
+ const typeKeywordMapper = {
1939
+ any: () => factory.keywordTypeNodes.any,
1940
+ unknown: () => factory.keywordTypeNodes.unknown,
1941
+ void: () => factory.keywordTypeNodes.void,
1942
+ number: () => factory.keywordTypeNodes.number,
1943
+ integer: () => factory.keywordTypeNodes.number,
1944
+ object: (nodes) => {
1945
+ if (!nodes || !nodes.length) return factory.keywordTypeNodes.object;
1946
+ return factory.createTypeLiteralNode(nodes);
1947
+ },
1948
+ string: () => factory.keywordTypeNodes.string,
1949
+ boolean: () => factory.keywordTypeNodes.boolean,
1950
+ undefined: () => factory.keywordTypeNodes.undefined,
1951
+ nullable: void 0,
1952
+ null: () => factory.keywordTypeNodes.null,
1953
+ nullish: void 0,
1954
+ array: (nodes) => {
1955
+ if (!nodes) return void 0;
1956
+ return factory.createArrayDeclaration({ nodes });
1957
+ },
1958
+ tuple: (nodes, rest, min, max) => {
1959
+ if (!nodes) return void 0;
1960
+ if (max) {
1961
+ nodes = nodes.slice(0, max);
1962
+ if (nodes.length < max && rest) nodes = [...nodes, ...Array(max - nodes.length).fill(rest)];
1963
+ }
1964
+ if (min) nodes = nodes.map((node, index) => index >= min ? factory.createOptionalTypeNode(node) : node);
1965
+ if (typeof max === "undefined" && rest) nodes.push(factory.createRestTypeNode(factory.createArrayTypeNode(rest)));
1966
+ return factory.createTupleTypeNode(nodes);
1967
+ },
1968
+ enum: (name) => {
1969
+ if (!name) return void 0;
1970
+ return factory.createTypeReferenceNode(name, void 0);
1971
+ },
1972
+ union: (nodes) => {
1973
+ if (!nodes) return void 0;
1974
+ return factory.createUnionDeclaration({
1975
+ withParentheses: true,
1976
+ nodes
1977
+ });
1978
+ },
1979
+ const: (name, format) => {
1980
+ if (name === null || name === void 0 || name === "") return void 0;
1981
+ if (format === "boolean") {
1982
+ if (name === true) return factory.createLiteralTypeNode(factory.createTrue());
1983
+ return factory.createLiteralTypeNode(factory.createFalse());
1984
+ }
1985
+ if (format === "number" && typeof name === "number") return factory.createLiteralTypeNode(factory.createNumericLiteral(name));
1986
+ return factory.createLiteralTypeNode(factory.createStringLiteral(name.toString()));
1987
+ },
1988
+ datetime: () => factory.keywordTypeNodes.string,
1989
+ date: (type = "string") => type === "string" ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier("Date")),
1990
+ time: (type = "string") => type === "string" ? factory.keywordTypeNodes.string : factory.createTypeReferenceNode(factory.createIdentifier("Date")),
1991
+ uuid: () => factory.keywordTypeNodes.string,
1992
+ url: () => factory.keywordTypeNodes.string,
1993
+ default: void 0,
1994
+ and: (nodes) => {
1995
+ if (!nodes) return void 0;
1996
+ return factory.createIntersectionDeclaration({
1997
+ withParentheses: true,
1998
+ nodes
1999
+ });
2000
+ },
2001
+ describe: void 0,
2002
+ min: void 0,
2003
+ max: void 0,
2004
+ optional: void 0,
2005
+ matches: () => factory.keywordTypeNodes.string,
2006
+ email: () => factory.keywordTypeNodes.string,
2007
+ firstName: void 0,
2008
+ lastName: void 0,
2009
+ password: void 0,
2010
+ phone: void 0,
2011
+ readOnly: void 0,
2012
+ writeOnly: void 0,
2013
+ ref: (propertyName) => {
2014
+ if (!propertyName) return void 0;
2015
+ return factory.createTypeReferenceNode(propertyName, void 0);
2016
+ },
2017
+ blob: () => factory.createTypeReferenceNode("Blob", []),
2018
+ deprecated: void 0,
2019
+ example: void 0,
2020
+ schema: void 0,
2021
+ catchall: void 0,
2022
+ name: void 0,
2023
+ interface: void 0
2024
+ };
2025
+ /**
2026
+ * Recursively parses a schema tree node into a corresponding TypeScript AST node.
2027
+ *
2028
+ * Maps OpenAPI schema keywords to TypeScript AST nodes using the `typeKeywordMapper`, handling complex types such as unions, intersections, arrays, tuples (with optional/rest elements and length constraints), enums, constants, references, and objects with property modifiers and documentation annotations.
2029
+ *
2030
+ * @param current - The schema node to parse.
2031
+ * @param siblings - Sibling schema nodes, used for context in certain mappings.
2032
+ * @param name - The name of the schema or property being parsed.
2033
+ * @param options - Parsing options controlling output style, property handling, and custom mappers.
2034
+ * @returns The generated TypeScript AST node, or `undefined` if the schema keyword is not mapped.
2035
+ */
2036
+ function parse({ current, siblings, name }, options) {
2037
+ const value = typeKeywordMapper[current.keyword];
2038
+ if (!value) return void 0;
2039
+ if (isKeyword(current, schemaKeywords.union)) return typeKeywordMapper.union(current.args.map((schema) => parse({
2040
+ parent: current,
2041
+ name,
2042
+ current: schema,
2043
+ siblings
2044
+ }, options)).filter(Boolean));
2045
+ if (isKeyword(current, schemaKeywords.and)) return typeKeywordMapper.and(current.args.map((schema) => parse({
2046
+ parent: current,
2047
+ name,
2048
+ current: schema,
2049
+ siblings
2050
+ }, options)).filter(Boolean));
2051
+ if (isKeyword(current, schemaKeywords.array)) return typeKeywordMapper.array(current.args.items.map((schema) => parse({
2052
+ parent: current,
2053
+ name,
2054
+ current: schema,
2055
+ siblings
2056
+ }, options)).filter(Boolean));
2057
+ if (isKeyword(current, schemaKeywords.enum)) return typeKeywordMapper.enum(current.args.typeName);
2058
+ if (isKeyword(current, schemaKeywords.ref)) return typeKeywordMapper.ref(current.args.name);
2059
+ if (isKeyword(current, schemaKeywords.blob)) return value();
2060
+ if (isKeyword(current, schemaKeywords.tuple)) return typeKeywordMapper.tuple(current.args.items.map((schema) => parse({
2061
+ parent: current,
2062
+ name,
2063
+ current: schema,
2064
+ siblings
2065
+ }, options)).filter(Boolean), current.args.rest && (parse({
2066
+ parent: current,
2067
+ name,
2068
+ current: current.args.rest,
2069
+ siblings
2070
+ }, options) ?? void 0), current.args.min, current.args.max);
2071
+ if (isKeyword(current, schemaKeywords.const)) return typeKeywordMapper.const(current.args.name, current.args.format);
2072
+ if (isKeyword(current, schemaKeywords.object)) {
2073
+ const properties = Object.entries(current.args?.properties || {}).filter((item) => {
2074
+ const schemas = item[1];
2075
+ return schemas && typeof schemas.map === "function";
2076
+ }).map(([name$1, schemas]) => {
2077
+ const nameSchema = schemas.find((schema) => schema.keyword === schemaKeywords.name);
2078
+ const mappedName = nameSchema?.args || name$1;
2079
+ if (options.mapper?.[mappedName]) return options.mapper?.[mappedName];
2080
+ const isNullish = schemas.some((schema) => schema.keyword === schemaKeywords.nullish);
2081
+ const isNullable = schemas.some((schema) => schema.keyword === schemaKeywords.nullable);
2082
+ const isOptional = schemas.some((schema) => schema.keyword === schemaKeywords.optional);
2083
+ const isReadonly = schemas.some((schema) => schema.keyword === schemaKeywords.readOnly);
2084
+ const describeSchema = schemas.find((schema) => schema.keyword === schemaKeywords.describe);
2085
+ const deprecatedSchema = schemas.find((schema) => schema.keyword === schemaKeywords.deprecated);
2086
+ const defaultSchema = schemas.find((schema) => schema.keyword === schemaKeywords.default);
2087
+ const exampleSchema = schemas.find((schema) => schema.keyword === schemaKeywords.example);
2088
+ const schemaSchema = schemas.find((schema) => schema.keyword === schemaKeywords.schema);
2089
+ const minSchema = schemas.find((schema) => schema.keyword === schemaKeywords.min);
2090
+ const maxSchema = schemas.find((schema) => schema.keyword === schemaKeywords.max);
2091
+ const matchesSchema = schemas.find((schema) => schema.keyword === schemaKeywords.matches);
2092
+ let type = schemas.map((schema) => parse({
2093
+ parent: current,
2094
+ name: name$1,
2095
+ current: schema,
2096
+ siblings: schemas
2097
+ }, options)).filter(Boolean)[0];
2098
+ if (isNullable) type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] });
2099
+ if (isNullish && ["undefined", "questionTokenAndUndefined"].includes(options.optionalType)) type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] });
2100
+ if (isOptional && ["undefined", "questionTokenAndUndefined"].includes(options.optionalType)) type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] });
2101
+ const propertySignature = factory.createPropertySignature({
2102
+ questionToken: isOptional || isNullish ? ["questionToken", "questionTokenAndUndefined"].includes(options.optionalType) : false,
2103
+ name: mappedName,
2104
+ type,
2105
+ readOnly: isReadonly
2106
+ });
2107
+ return factory.appendJSDocToNode({
2108
+ node: propertySignature,
2109
+ comments: [
2110
+ describeSchema ? `@description ${transformers.jsStringEscape(describeSchema.args)}` : void 0,
2111
+ deprecatedSchema ? "@deprecated" : void 0,
2112
+ minSchema ? `@minLength ${minSchema.args}` : void 0,
2113
+ maxSchema ? `@maxLength ${maxSchema.args}` : void 0,
2114
+ matchesSchema ? `@pattern ${matchesSchema.args}` : void 0,
2115
+ defaultSchema ? `@default ${defaultSchema.args}` : void 0,
2116
+ exampleSchema ? `@example ${exampleSchema.args}` : void 0,
2117
+ schemaSchema?.args?.type || schemaSchema?.args?.format ? [`@type ${schemaSchema?.args?.type || "unknown"}${!isOptional ? "" : " | undefined"}`, schemaSchema?.args?.format].filter(Boolean).join(", ") : void 0
2118
+ ].filter(Boolean)
2119
+ });
2120
+ });
2121
+ let additionalProperties;
2122
+ if (current.args?.additionalProperties?.length) {
2123
+ additionalProperties = current.args.additionalProperties.map((schema) => parse({
2124
+ parent: current,
2125
+ name,
2126
+ current: schema,
2127
+ siblings
2128
+ }, options)).filter(Boolean).at(0);
2129
+ const isNullable = current.args?.additionalProperties.some((schema) => isKeyword(schema, schemaKeywords.nullable));
2130
+ if (isNullable) additionalProperties = factory.createUnionDeclaration({ nodes: [additionalProperties, factory.keywordTypeNodes.null] });
2131
+ additionalProperties = factory.createIndexSignature(additionalProperties);
2132
+ }
2133
+ return typeKeywordMapper.object([...properties, additionalProperties].filter(Boolean));
2134
+ }
2135
+ if (isKeyword(current, schemaKeywords.datetime)) return typeKeywordMapper.datetime();
2136
+ if (isKeyword(current, schemaKeywords.date)) return typeKeywordMapper.date(current.args.type);
2137
+ if (isKeyword(current, schemaKeywords.time)) return typeKeywordMapper.time(current.args.type);
2138
+ if (current.keyword in typeKeywordMapper) return value();
2139
+ return void 0;
2140
+ }
2141
+
2142
+ //#endregion
2143
+ //#region src/components/Type.tsx
2144
+ var import_react = /* @__PURE__ */ __toESM(require_react());
2145
+ function Type$1({ name, typedName, tree, keysToOmit, schema, optionalType, syntaxType, enumType, mapper, description }) {
2146
+ const typeNodes = [];
2147
+ if (!tree.length) return "";
2148
+ const schemaFromTree = tree.find((item) => item.keyword === schemaKeywords.schema);
2149
+ let type = tree.map((current, _index, siblings) => parse({
2150
+ parent: void 0,
2151
+ current,
2152
+ siblings
2153
+ }, {
2154
+ name,
2155
+ typedName,
2156
+ description,
2157
+ keysToOmit,
2158
+ optionalType,
2159
+ enumType,
2160
+ mapper,
2161
+ syntaxType
2162
+ })).filter(Boolean).at(0) || typeKeywordMapper.undefined();
2163
+ if (schemaFromTree && isKeyword(schemaFromTree, schemaKeywords.schema)) {
2164
+ const isNullish = tree.some((item) => item.keyword === schemaKeywords.nullish);
2165
+ const isNullable = tree.some((item) => item.keyword === schemaKeywords.nullable);
2166
+ const isOptional = tree.some((item) => item.keyword === schemaKeywords.optional);
2167
+ if (isNullable) type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] });
2168
+ if (isNullish && ["undefined", "questionTokenAndUndefined"].includes(optionalType)) type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] });
2169
+ if (isOptional && ["undefined", "questionTokenAndUndefined"].includes(optionalType)) type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] });
2170
+ }
2171
+ const useTypeGeneration = syntaxType === "type" || [factory.syntaxKind.union].includes(type.kind) || !!keysToOmit?.length;
2172
+ typeNodes.push(createTypeDeclaration({
2173
+ name,
2174
+ isExportable: true,
2175
+ type: keysToOmit?.length ? factory.createOmitDeclaration({
2176
+ keys: keysToOmit,
2177
+ type,
2178
+ nonNullable: true
2179
+ }) : type,
2180
+ syntax: useTypeGeneration ? "type" : "interface",
2181
+ comments: [
2182
+ description ? `@description ${transformers.jsStringEscape(description)}` : void 0,
2183
+ schema.deprecated ? "@deprecated" : void 0,
2184
+ schema.minLength ? `@minLength ${schema.minLength}` : void 0,
2185
+ schema.maxLength ? `@maxLength ${schema.maxLength}` : void 0,
2186
+ schema.pattern ? `@pattern ${schema.pattern}` : void 0,
2187
+ schema.default ? `@default ${schema.default}` : void 0,
2188
+ schema.example ? `@example ${schema.example}` : void 0
2189
+ ]
2190
+ }));
2191
+ const enumSchemas = SchemaGenerator.deepSearch(tree, schemaKeywords.enum);
2192
+ const enums = [...new Set(enumSchemas)].map((enumSchema) => {
2193
+ const name$1 = enumType === "asPascalConst" ? transformers.pascalCase(enumSchema.args.name) : transformers.camelCase(enumSchema.args.name);
2194
+ const typeName = enumSchema.args.typeName;
2195
+ const [nameNode, typeNode] = factory.createEnumDeclaration({
2196
+ name: name$1,
2197
+ typeName,
2198
+ enums: enumSchema.args.items.map((item) => item.value === void 0 ? void 0 : [transformers.trimQuotes(item.name?.toString()), item.value]).filter(Boolean),
2199
+ type: enumType
2200
+ });
2201
+ return {
2202
+ nameNode,
2203
+ typeNode,
2204
+ name: name$1,
2205
+ typeName
2206
+ };
2207
+ });
2208
+ return /* @__PURE__ */ jsxs(import_react.Fragment, { children: [enums.map(({ name: name$1, nameNode, typeName, typeNode }) => /* @__PURE__ */ jsxs(import_react.Fragment, { children: [nameNode && /* @__PURE__ */ jsx(File.Source, {
2209
+ name: name$1,
2210
+ isExportable: true,
2211
+ isIndexable: true,
2212
+ children: print([nameNode])
2213
+ }), /* @__PURE__ */ jsx(File.Source, {
2214
+ name: typeName,
2215
+ isIndexable: true,
2216
+ isExportable: [
2217
+ "enum",
2218
+ "asConst",
2219
+ "constEnum",
2220
+ "literal",
2221
+ void 0
2222
+ ].includes(enumType),
2223
+ isTypeOnly: [
2224
+ "asConst",
2225
+ "literal",
2226
+ void 0
2227
+ ].includes(enumType),
2228
+ children: print([typeNode])
2229
+ })] })), enums.every((item) => item.typeName !== name) && /* @__PURE__ */ jsx(File.Source, {
2230
+ name: typedName,
2231
+ isTypeOnly: true,
2232
+ isExportable: true,
2233
+ isIndexable: true,
2234
+ children: print(typeNodes)
2235
+ })] });
2236
+ }
2237
+
2238
+ //#endregion
2239
+ export { OasType, Type$1 as Type };
2240
+ //# sourceMappingURL=components-6F5RoYuJ.js.map