@cccsaurora/clue-ui 1.2.3-dev.266 → 1.2.3-patch.269

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 (186) hide show
  1. package/ActionForm-Ch0DGVGr.js +4462 -0
  2. package/AnnotationDetails-C8E_Xvaf.js +160 -0
  3. package/AnnotationPreview-CLCms-Fm.js +140 -0
  4. package/ClueEnrichContext-KqRuuWNS.js +418 -0
  5. package/FlexOne-BXWFOd1T.js +6 -0
  6. package/_MapCache-BiTi0iqu.js +180 -0
  7. package/_Uint8Array-BQNOM9Rr.js +101 -0
  8. package/_baseAssignValue-CNMLQZco.js +20 -0
  9. package/_baseClone-BnT-6pyM.js +207 -0
  10. package/_baseExtremum-Ca2EHgy2.js +16 -0
  11. package/_baseFlatten-Bfr_Molw.js +72 -0
  12. package/_baseGet-DSZygzyq.js +79 -0
  13. package/_baseIsEqual-VgvaAFZG.js +147 -0
  14. package/_baseIteratee-Dbfsw5z8.js +95 -0
  15. package/_baseSlice-M5RKzt1A.js +10 -0
  16. package/_baseSum-wEbgNeUs.js +10 -0
  17. package/_baseUniq-BJcj69PL.js +79 -0
  18. package/_commonjsHelpers-DaMA6jEr.js +8 -0
  19. package/_createAggregator-k3TuAnxT.js +53 -0
  20. package/_getPrototype-Cr1Mk7BC.js +5 -0
  21. package/_getTag-CK2Sffaq.js +90 -0
  22. package/_isIterateeCall-DkJP7Rbx.js +13 -0
  23. package/_setToArray-C7yMOeww.js +29 -0
  24. package/cloneDeep-CF8TtLHr.js +8 -0
  25. package/components/AnnotationBody.js +35 -49
  26. package/components/AnnotationDetailPopover.js +30 -36
  27. package/components/AnnotationDetails.js +7 -7
  28. package/components/AnnotationEntry.js +35 -35
  29. package/components/AnnotationPreview.js +5 -5
  30. package/components/ClassificationChip.js +23 -44
  31. package/components/CountBadge.js +26 -31
  32. package/components/EnrichedCard.js +97 -110
  33. package/components/EnrichedChip.js +105 -130
  34. package/components/EnrichedTypography.js +107 -133
  35. package/components/ErrorBoundary.js +24 -28
  36. package/components/RetryFailedEnrichments.js +9 -10
  37. package/components/SourcePicker.js +49 -57
  38. package/components/actions/ActionForm.js +4 -4
  39. package/components/actions/ExecutePopover.js +59 -75
  40. package/components/actions/ResultModal.js +4 -4
  41. package/components/actions/form/schemaAdapter.js +23 -39
  42. package/components/actions/formats/FileResult.js +59 -86
  43. package/components/actions/formats/index.js +10 -21
  44. package/components/display/graph/ExpandMoreButton.js +10 -10
  45. package/components/display/graph/elements/NodeCard.js +91 -111
  46. package/components/display/graph/elements/NodeTag.js +13 -15
  47. package/components/display/graph/index.js +202 -261
  48. package/components/display/graph/visualizations/Leaf.js +69 -88
  49. package/components/display/graph/visualizations/cloud/index.js +81 -98
  50. package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
  51. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  53. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  55. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  56. package/components/display/graph/visualizations/icons/index.js +13 -14
  57. package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
  58. package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
  59. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  60. package/components/display/graph/visualizations/tree/index.js +306 -408
  61. package/components/display/icons/Iconified.js +12 -27
  62. package/components/display/json/index.js +4 -4
  63. package/components/display/markdown/index.js +5770 -8678
  64. package/components/enrichment/EnrichPopover.js +46 -54
  65. package/components/fetchers/Fetcher.js +119 -158
  66. package/components/fetchers/PreviewModal.js +17 -20
  67. package/components/fetchers/StatusChip.js +17 -21
  68. package/components/group/Entry.js +11 -13
  69. package/components/group/Group.js +10 -13
  70. package/components/group/GroupControl.js +65 -76
  71. package/components/stats/QueryStatus.js +33 -43
  72. package/countBy-CdYegFSu.js +8 -0
  73. package/data/event.js +4 -6
  74. package/database/index.js +2 -2
  75. package/debounce-DryYcbJ4.js +56 -0
  76. package/get-CH7kz5Ix.js +8 -0
  77. package/groupBy-br8xmD2R.js +8 -0
  78. package/hooks/ClueActionContext.js +6 -6
  79. package/hooks/ClueComponentContext.js +23 -29
  80. package/hooks/ClueConfigProvider.js +12 -14
  81. package/hooks/ClueDatabaseContext.js +13 -19
  82. package/hooks/ClueEnrichContext.js +8 -8
  83. package/hooks/ClueFetcherContext.js +56 -83
  84. package/hooks/ClueGroupContext.js +14 -17
  85. package/hooks/CluePopupContext.js +5 -5
  86. package/hooks/ClueProvider.js +10 -12
  87. package/hooks/selectors.js +7 -7
  88. package/hooks/useActionResult.d.ts +1 -0
  89. package/hooks/useActionResult.js +2 -2
  90. package/hooks/useAnnotations.js +31 -47
  91. package/hooks/useClue.js +4 -6
  92. package/hooks/useClueActions.js +3 -3
  93. package/hooks/useClueConfig.js +4 -6
  94. package/hooks/useClueTypeConfig.js +3 -3
  95. package/hooks/useComparator.js +435 -722
  96. package/hooks/useErrors.js +18 -22
  97. package/hooks/useFetcherResult.d.ts +1 -0
  98. package/hooks/useFetcherResult.js +24 -33
  99. package/hooks/useMyHighlights.js +36 -66
  100. package/hooks/useMyLocalStorage.js +37 -66
  101. package/iconify-BBckr5AQ.js +1263 -0
  102. package/icons/Action.js +49 -66
  103. package/icons/Assessment.js +69 -85
  104. package/icons/Context.js +63 -77
  105. package/icons/Opinion.js +60 -76
  106. package/icons/iconMap.js +2 -2
  107. package/identity-ByMq8VxU.js +6 -0
  108. package/index-BHAe_V9n.js +12768 -0
  109. package/index-BK-zfYhR.js +358 -0
  110. package/index-CA5CUNZO.js +975 -0
  111. package/index-Dj5C04IX.js +568 -0
  112. package/index-p5_wX7q1.js +11729 -0
  113. package/isNil-CjWwlQS3.js +6 -0
  114. package/isObject-B53jY8Qg.js +7 -0
  115. package/isObjectLike-BatpeCIi.js +29 -0
  116. package/isSymbol-C3_SC0Qp.js +8 -0
  117. package/last-7CdUxN0r.js +7 -0
  118. package/main.js +60 -60
  119. package/maxBy-Bc0dYHcO.js +8 -0
  120. package/package.json +1 -1
  121. package/sortBy-DY2JBf9n.js +75 -0
  122. package/sumBy-DuMASLPd.js +8 -0
  123. package/text/Frequency.js +23 -42
  124. package/toFinite-BMy6GObD.js +14 -0
  125. package/toNumber-YVhnnJv4.js +31 -0
  126. package/types/WithActionData.d.ts +2 -1
  127. package/useClueTypeConfig-Ct9Ygter.js +2292 -0
  128. package/utils/chain.js +65 -92
  129. package/utils/classificationParser.js +256 -519
  130. package/utils/constants.js +10 -35
  131. package/utils/graph.js +45 -72
  132. package/utils/hashUtil.js +7 -7
  133. package/utils/line.js +81 -131
  134. package/utils/loggerUtil.js +3 -5
  135. package/utils/sessionStorage.js +27 -41
  136. package/utils/time.js +423 -423
  137. package/utils/utils.js +9 -9
  138. package/utils/window.js +10 -21
  139. package/utils-DmwSUrum.js +129 -0
  140. package/ActionForm-uDp92tN2.js +0 -5941
  141. package/AnnotationDetails-DGYfOiWm.js +0 -175
  142. package/AnnotationPreview-bHObsb3P.js +0 -188
  143. package/ClueEnrichContext-CJEJxrgs.js +0 -541
  144. package/FlexOne-BSYAhhtG.js +0 -9
  145. package/_MapCache-WmuDdwuH.js +0 -222
  146. package/_Uint8Array-B7JqpgFX.js +0 -128
  147. package/_baseAssignValue-CGTuELqU.js +0 -25
  148. package/_baseClone-CkNrTyhm.js +0 -283
  149. package/_baseExtremum-kob8QXyt.js +0 -18
  150. package/_baseFlatten-jIR_sN_-.js +0 -92
  151. package/_baseGet-Bx3A4Qfp.js +0 -108
  152. package/_baseIsEqual-C5OTWzTk.js +0 -208
  153. package/_baseIteratee-avi7MX2o.js +0 -126
  154. package/_baseSlice-GAv_YFTT.js +0 -20
  155. package/_baseSum-D0WC1dN0.js +0 -13
  156. package/_baseUniq-BI9GIHMF.js +0 -115
  157. package/_commonjsHelpers-DWwsNxpa.js +0 -8
  158. package/_createAggregator-QD8MzKwe.js +0 -63
  159. package/_getPrototype-CU0j_POw.js +0 -5
  160. package/_getTag-Ckxxfr88.js +0 -126
  161. package/_isIterateeCall-Ds3sw2SF.js +0 -17
  162. package/_setToArray-CaPKQhcz.js +0 -33
  163. package/cloneDeep-DJrLSw8W.js +0 -8
  164. package/countBy-c6S3dvSW.js +0 -14
  165. package/debounce-bV0h5FC5.js +0 -92
  166. package/get-DSsNkRQs.js +0 -8
  167. package/groupBy-xqz-n0Vd.js +0 -14
  168. package/iconify-CXMreGTg.js +0 -1782
  169. package/identity-CPGTqrE4.js +0 -6
  170. package/index-AMfoEg_6.js +0 -696
  171. package/index-B6C2a_Lg.js +0 -1172
  172. package/index-C12gPw2W.js +0 -17698
  173. package/index-DCKkHTvx.js +0 -15750
  174. package/index-JcKyZeoY.js +0 -465
  175. package/isNil-CIubwp4T.js +0 -6
  176. package/isObject-FTY-5JQX.js +0 -7
  177. package/isObjectLike-OAgjjZye.js +0 -48
  178. package/isSymbol-Xd2FsJyp.js +0 -8
  179. package/last-CUCl67Im.js +0 -7
  180. package/maxBy-IKHzFrCS.js +0 -8
  181. package/sortBy-DfSj8IoJ.js +0 -96
  182. package/sumBy-D-hb_NY-.js +0 -8
  183. package/toFinite-Bc55msYj.js +0 -16
  184. package/toNumber-DPxy1FBy.js +0 -39
  185. package/useClueTypeConfig-Z1LFp01b.js +0 -3289
  186. package/utils-HmNPuoDB.js +0 -199
@@ -0,0 +1,4462 @@
1
+ import { jsx as V, jsxs as W } from "react/jsx-runtime";
2
+ import { materialRenderers as En, materialCells as Sn } from "@jsonforms/material-renderers";
3
+ import { JsonForms as Pn } from "@jsonforms/react";
4
+ import { Modal as bs, Paper as Es, Stack as se, Typography as Pe, Divider as Dt, LinearProgress as kn, Button as st, IconButton as Nn, Box as xe, CircularProgress as Cn, Collapse as jn } from "@mui/material";
5
+ import Ss from "./components/display/icons/Iconified.js";
6
+ import { J as Rn } from "./index-BK-zfYhR.js";
7
+ import { ClueComponentContext as Ct } from "./hooks/ClueComponentContext.js";
8
+ import { g as On } from "./_commonjsHelpers-DaMA6jEr.js";
9
+ import { x as Tn, y as Ps, z as In } from "./index-BHAe_V9n.js";
10
+ import { a as Ht } from "./useClueTypeConfig-Ct9Ygter.js";
11
+ import { d as ks } from "./_baseGet-DSZygzyq.js";
12
+ import { b as Mn } from "./_baseSlice-M5RKzt1A.js";
13
+ import { i as Vn } from "./utils-DmwSUrum.js";
14
+ import { useState as de, useRef as Fn, useMemo as ke, useEffect as Wt, memo as Ns, useCallback as je } from "react";
15
+ import { u as Ve, c as Kn, a as An } from "./index-Dj5C04IX.js";
16
+ import lt from "./components/ErrorBoundary.js";
17
+ import { adaptSchema as qn } from "./components/actions/form/schemaAdapter.js";
18
+ import { I as zn } from "./iconify-BBckr5AQ.js";
19
+ import { C as Un } from "./ClueEnrichContext-KqRuuWNS.js";
20
+ import { ClueFetcherContext as Ln } from "./hooks/ClueFetcherContext.js";
21
+ import Gn from "./components/ClassificationChip.js";
22
+ import Jn from "./components/actions/formats/index.js";
23
+ import { SNACKBAR_EVENT_ID as ht } from "./data/event.js";
24
+ import { dayjs as Hn } from "./utils/time.js";
25
+ import { safeDispatchEvent as pt } from "./utils/window.js";
26
+ import Bn from "./hooks/useClue.js";
27
+ import { i as Qn } from "./isNil-CjWwlQS3.js";
28
+ function Xn(e, t, r) {
29
+ var s = e.length;
30
+ return r = r === void 0 ? s : r, !t && r >= s ? e : Mn(e, t, r);
31
+ }
32
+ var Yn = "\\ud800-\\udfff", Zn = "\\u0300-\\u036f", Dn = "\\ufe20-\\ufe2f", Wn = "\\u20d0-\\u20ff", xn = Zn + Dn + Wn, eo = "\\ufe0e\\ufe0f", to = "\\u200d", ro = RegExp("[" + to + Yn + xn + eo + "]");
33
+ function Cs(e) {
34
+ return ro.test(e);
35
+ }
36
+ function so(e) {
37
+ return e.split("");
38
+ }
39
+ var js = "\\ud800-\\udfff", no = "\\u0300-\\u036f", oo = "\\ufe20-\\ufe2f", ao = "\\u20d0-\\u20ff", io = no + oo + ao, co = "\\ufe0e\\ufe0f", lo = "[" + js + "]", xt = "[" + io + "]", er = "\\ud83c[\\udffb-\\udfff]", uo = "(?:" + xt + "|" + er + ")", Rs = "[^" + js + "]", Os = "(?:\\ud83c[\\udde6-\\uddff]){2}", Ts = "[\\ud800-\\udbff][\\udc00-\\udfff]", fo = "\\u200d", Is = uo + "?", Ms = "[" + co + "]?", mo = "(?:" + fo + "(?:" + [Rs, Os, Ts].join("|") + ")" + Ms + Is + ")*", ho = Ms + Is + mo, po = "(?:" + [Rs + xt + "?", xt, Os, Ts, lo].join("|") + ")", yo = RegExp(er + "(?=" + er + ")|" + po + ho, "g");
40
+ function _o(e) {
41
+ return e.match(yo) || [];
42
+ }
43
+ function vo(e) {
44
+ return Cs(e) ? _o(e) : so(e);
45
+ }
46
+ function $o(e) {
47
+ return function(t) {
48
+ t = ks(t);
49
+ var r = Cs(t) ? vo(t) : void 0, s = r ? r[0] : t.charAt(0), n = r ? Xn(r, 1).join("") : t.slice(1);
50
+ return s[e]() + n;
51
+ };
52
+ }
53
+ var go = $o("toUpperCase");
54
+ function wo(e) {
55
+ return go(ks(e).toLowerCase());
56
+ }
57
+ var tr = { exports: {} }, Vs = {}, fe = {}, Be = {}, ut = {}, A = {}, dt = {};
58
+ (function(e) {
59
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0;
60
+ class t {
61
+ }
62
+ e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
63
+ class r extends t {
64
+ constructor($) {
65
+ if (super(), !e.IDENTIFIER.test($))
66
+ throw new Error("CodeGen: name must be a valid identifier");
67
+ this.str = $;
68
+ }
69
+ toString() {
70
+ return this.str;
71
+ }
72
+ emptyStr() {
73
+ return !1;
74
+ }
75
+ get names() {
76
+ return { [this.str]: 1 };
77
+ }
78
+ }
79
+ e.Name = r;
80
+ class s extends t {
81
+ constructor($) {
82
+ super(), this._items = typeof $ == "string" ? [$] : $;
83
+ }
84
+ toString() {
85
+ return this.str;
86
+ }
87
+ emptyStr() {
88
+ if (this._items.length > 1)
89
+ return !1;
90
+ const $ = this._items[0];
91
+ return $ === "" || $ === '""';
92
+ }
93
+ get str() {
94
+ var $;
95
+ return ($ = this._str) !== null && $ !== void 0 ? $ : this._str = this._items.reduce((P, j) => `${P}${j}`, "");
96
+ }
97
+ get names() {
98
+ var $;
99
+ return ($ = this._names) !== null && $ !== void 0 ? $ : this._names = this._items.reduce((P, j) => (j instanceof r && (P[j.str] = (P[j.str] || 0) + 1), P), {});
100
+ }
101
+ }
102
+ e._Code = s, e.nil = new s("");
103
+ function n(f, ...$) {
104
+ const P = [f[0]];
105
+ let j = 0;
106
+ for (; j < $.length; )
107
+ d(P, $[j]), P.push(f[++j]);
108
+ return new s(P);
109
+ }
110
+ e._ = n;
111
+ const a = new s("+");
112
+ function i(f, ...$) {
113
+ const P = [E(f[0])];
114
+ let j = 0;
115
+ for (; j < $.length; )
116
+ P.push(a), d(P, $[j]), P.push(a, E(f[++j]));
117
+ return u(P), new s(P);
118
+ }
119
+ e.str = i;
120
+ function d(f, $) {
121
+ $ instanceof s ? f.push(...$._items) : $ instanceof r ? f.push($) : f.push(y($));
122
+ }
123
+ e.addCodeArg = d;
124
+ function u(f) {
125
+ let $ = 1;
126
+ for (; $ < f.length - 1; ) {
127
+ if (f[$] === a) {
128
+ const P = l(f[$ - 1], f[$ + 1]);
129
+ if (P !== void 0) {
130
+ f.splice($ - 1, 3, P);
131
+ continue;
132
+ }
133
+ f[$++] = "+";
134
+ }
135
+ $++;
136
+ }
137
+ }
138
+ function l(f, $) {
139
+ if ($ === '""')
140
+ return f;
141
+ if (f === '""')
142
+ return $;
143
+ if (typeof f == "string")
144
+ return $ instanceof r || f[f.length - 1] !== '"' ? void 0 : typeof $ != "string" ? `${f.slice(0, -1)}${$}"` : $[0] === '"' ? f.slice(0, -1) + $.slice(1) : void 0;
145
+ if (typeof $ == "string" && $[0] === '"' && !(f instanceof r))
146
+ return `"${f}${$.slice(1)}`;
147
+ }
148
+ function m(f, $) {
149
+ return $.emptyStr() ? f : f.emptyStr() ? $ : i`${f}${$}`;
150
+ }
151
+ e.strConcat = m;
152
+ function y(f) {
153
+ return typeof f == "number" || typeof f == "boolean" || f === null ? f : E(Array.isArray(f) ? f.join(",") : f);
154
+ }
155
+ function b(f) {
156
+ return new s(E(f));
157
+ }
158
+ e.stringify = b;
159
+ function E(f) {
160
+ return JSON.stringify(f).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
161
+ }
162
+ e.safeStringify = E;
163
+ function g(f) {
164
+ return typeof f == "string" && e.IDENTIFIER.test(f) ? new s(`.${f}`) : n`[${f}]`;
165
+ }
166
+ e.getProperty = g;
167
+ function v(f) {
168
+ if (typeof f == "string" && e.IDENTIFIER.test(f))
169
+ return new s(`${f}`);
170
+ throw new Error(`CodeGen: invalid export name: ${f}, use explicit $id name mapping`);
171
+ }
172
+ e.getEsmExportName = v;
173
+ function h(f) {
174
+ return new s(f.toString());
175
+ }
176
+ e.regexpCode = h;
177
+ })(dt);
178
+ var rr = {};
179
+ (function(e) {
180
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0;
181
+ const t = dt;
182
+ class r extends Error {
183
+ constructor(l) {
184
+ super(`CodeGen: "code" for ${l} not defined`), this.value = l.value;
185
+ }
186
+ }
187
+ var s;
188
+ (function(u) {
189
+ u[u.Started = 0] = "Started", u[u.Completed = 1] = "Completed";
190
+ })(s || (e.UsedValueState = s = {})), e.varKinds = {
191
+ const: new t.Name("const"),
192
+ let: new t.Name("let"),
193
+ var: new t.Name("var")
194
+ };
195
+ class n {
196
+ constructor({ prefixes: l, parent: m } = {}) {
197
+ this._names = {}, this._prefixes = l, this._parent = m;
198
+ }
199
+ toName(l) {
200
+ return l instanceof t.Name ? l : this.name(l);
201
+ }
202
+ name(l) {
203
+ return new t.Name(this._newName(l));
204
+ }
205
+ _newName(l) {
206
+ const m = this._names[l] || this._nameGroup(l);
207
+ return `${l}${m.index++}`;
208
+ }
209
+ _nameGroup(l) {
210
+ var m, y;
211
+ if (!((y = (m = this._parent) === null || m === void 0 ? void 0 : m._prefixes) === null || y === void 0) && y.has(l) || this._prefixes && !this._prefixes.has(l))
212
+ throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);
213
+ return this._names[l] = { prefix: l, index: 0 };
214
+ }
215
+ }
216
+ e.Scope = n;
217
+ class a extends t.Name {
218
+ constructor(l, m) {
219
+ super(m), this.prefix = l;
220
+ }
221
+ setValue(l, { property: m, itemIndex: y }) {
222
+ this.value = l, this.scopePath = (0, t._)`.${new t.Name(m)}[${y}]`;
223
+ }
224
+ }
225
+ e.ValueScopeName = a;
226
+ const i = (0, t._)`\n`;
227
+ class d extends n {
228
+ constructor(l) {
229
+ super(l), this._values = {}, this._scope = l.scope, this.opts = { ...l, _n: l.lines ? i : t.nil };
230
+ }
231
+ get() {
232
+ return this._scope;
233
+ }
234
+ name(l) {
235
+ return new a(l, this._newName(l));
236
+ }
237
+ value(l, m) {
238
+ var y;
239
+ if (m.ref === void 0)
240
+ throw new Error("CodeGen: ref must be passed in value");
241
+ const b = this.toName(l), { prefix: E } = b, g = (y = m.key) !== null && y !== void 0 ? y : m.ref;
242
+ let v = this._values[E];
243
+ if (v) {
244
+ const $ = v.get(g);
245
+ if ($)
246
+ return $;
247
+ } else
248
+ v = this._values[E] = /* @__PURE__ */ new Map();
249
+ v.set(g, b);
250
+ const h = this._scope[E] || (this._scope[E] = []), f = h.length;
251
+ return h[f] = m.ref, b.setValue(m, { property: E, itemIndex: f }), b;
252
+ }
253
+ getValue(l, m) {
254
+ const y = this._values[l];
255
+ if (y)
256
+ return y.get(m);
257
+ }
258
+ scopeRefs(l, m = this._values) {
259
+ return this._reduceValues(m, (y) => {
260
+ if (y.scopePath === void 0)
261
+ throw new Error(`CodeGen: name "${y}" has no value`);
262
+ return (0, t._)`${l}${y.scopePath}`;
263
+ });
264
+ }
265
+ scopeCode(l = this._values, m, y) {
266
+ return this._reduceValues(l, (b) => {
267
+ if (b.value === void 0)
268
+ throw new Error(`CodeGen: name "${b}" has no value`);
269
+ return b.value.code;
270
+ }, m, y);
271
+ }
272
+ _reduceValues(l, m, y = {}, b) {
273
+ let E = t.nil;
274
+ for (const g in l) {
275
+ const v = l[g];
276
+ if (!v)
277
+ continue;
278
+ const h = y[g] = y[g] || /* @__PURE__ */ new Map();
279
+ v.forEach((f) => {
280
+ if (h.has(f))
281
+ return;
282
+ h.set(f, s.Started);
283
+ let $ = m(f);
284
+ if ($) {
285
+ const P = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
286
+ E = (0, t._)`${E}${P} ${f} = ${$};${this.opts._n}`;
287
+ } else if ($ = b == null ? void 0 : b(f))
288
+ E = (0, t._)`${E}${$}${this.opts._n}`;
289
+ else
290
+ throw new r(f);
291
+ h.set(f, s.Completed);
292
+ });
293
+ }
294
+ return E;
295
+ }
296
+ }
297
+ e.ValueScope = d;
298
+ })(rr);
299
+ (function(e) {
300
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0;
301
+ const t = dt, r = rr;
302
+ var s = dt;
303
+ Object.defineProperty(e, "_", { enumerable: !0, get: function() {
304
+ return s._;
305
+ } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
306
+ return s.str;
307
+ } }), Object.defineProperty(e, "strConcat", { enumerable: !0, get: function() {
308
+ return s.strConcat;
309
+ } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() {
310
+ return s.nil;
311
+ } }), Object.defineProperty(e, "getProperty", { enumerable: !0, get: function() {
312
+ return s.getProperty;
313
+ } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() {
314
+ return s.stringify;
315
+ } }), Object.defineProperty(e, "regexpCode", { enumerable: !0, get: function() {
316
+ return s.regexpCode;
317
+ } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
318
+ return s.Name;
319
+ } });
320
+ var n = rr;
321
+ Object.defineProperty(e, "Scope", { enumerable: !0, get: function() {
322
+ return n.Scope;
323
+ } }), Object.defineProperty(e, "ValueScope", { enumerable: !0, get: function() {
324
+ return n.ValueScope;
325
+ } }), Object.defineProperty(e, "ValueScopeName", { enumerable: !0, get: function() {
326
+ return n.ValueScopeName;
327
+ } }), Object.defineProperty(e, "varKinds", { enumerable: !0, get: function() {
328
+ return n.varKinds;
329
+ } }), e.operators = {
330
+ GT: new t._Code(">"),
331
+ GTE: new t._Code(">="),
332
+ LT: new t._Code("<"),
333
+ LTE: new t._Code("<="),
334
+ EQ: new t._Code("==="),
335
+ NEQ: new t._Code("!=="),
336
+ NOT: new t._Code("!"),
337
+ OR: new t._Code("||"),
338
+ AND: new t._Code("&&"),
339
+ ADD: new t._Code("+")
340
+ };
341
+ class a {
342
+ optimizeNodes() {
343
+ return this;
344
+ }
345
+ optimizeNames(o, c) {
346
+ return this;
347
+ }
348
+ }
349
+ class i extends a {
350
+ constructor(o, c, w) {
351
+ super(), this.varKind = o, this.name = c, this.rhs = w;
352
+ }
353
+ render({ es5: o, _n: c }) {
354
+ const w = o ? r.varKinds.var : this.varKind, R = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
355
+ return `${w} ${this.name}${R};` + c;
356
+ }
357
+ optimizeNames(o, c) {
358
+ if (o[this.name.str])
359
+ return this.rhs && (this.rhs = H(this.rhs, o, c)), this;
360
+ }
361
+ get names() {
362
+ return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
363
+ }
364
+ }
365
+ class d extends a {
366
+ constructor(o, c, w) {
367
+ super(), this.lhs = o, this.rhs = c, this.sideEffects = w;
368
+ }
369
+ render({ _n: o }) {
370
+ return `${this.lhs} = ${this.rhs};` + o;
371
+ }
372
+ optimizeNames(o, c) {
373
+ if (!(this.lhs instanceof t.Name && !o[this.lhs.str] && !this.sideEffects))
374
+ return this.rhs = H(this.rhs, o, c), this;
375
+ }
376
+ get names() {
377
+ const o = this.lhs instanceof t.Name ? {} : { ...this.lhs.names };
378
+ return z(o, this.rhs);
379
+ }
380
+ }
381
+ class u extends d {
382
+ constructor(o, c, w, R) {
383
+ super(o, w, R), this.op = c;
384
+ }
385
+ render({ _n: o }) {
386
+ return `${this.lhs} ${this.op}= ${this.rhs};` + o;
387
+ }
388
+ }
389
+ class l extends a {
390
+ constructor(o) {
391
+ super(), this.label = o, this.names = {};
392
+ }
393
+ render({ _n: o }) {
394
+ return `${this.label}:` + o;
395
+ }
396
+ }
397
+ class m extends a {
398
+ constructor(o) {
399
+ super(), this.label = o, this.names = {};
400
+ }
401
+ render({ _n: o }) {
402
+ return `break${this.label ? ` ${this.label}` : ""};` + o;
403
+ }
404
+ }
405
+ class y extends a {
406
+ constructor(o) {
407
+ super(), this.error = o;
408
+ }
409
+ render({ _n: o }) {
410
+ return `throw ${this.error};` + o;
411
+ }
412
+ get names() {
413
+ return this.error.names;
414
+ }
415
+ }
416
+ class b extends a {
417
+ constructor(o) {
418
+ super(), this.code = o;
419
+ }
420
+ render({ _n: o }) {
421
+ return `${this.code};` + o;
422
+ }
423
+ optimizeNodes() {
424
+ return `${this.code}` ? this : void 0;
425
+ }
426
+ optimizeNames(o, c) {
427
+ return this.code = H(this.code, o, c), this;
428
+ }
429
+ get names() {
430
+ return this.code instanceof t._CodeOrName ? this.code.names : {};
431
+ }
432
+ }
433
+ class E extends a {
434
+ constructor(o = []) {
435
+ super(), this.nodes = o;
436
+ }
437
+ render(o) {
438
+ return this.nodes.reduce((c, w) => c + w.render(o), "");
439
+ }
440
+ optimizeNodes() {
441
+ const { nodes: o } = this;
442
+ let c = o.length;
443
+ for (; c--; ) {
444
+ const w = o[c].optimizeNodes();
445
+ Array.isArray(w) ? o.splice(c, 1, ...w) : w ? o[c] = w : o.splice(c, 1);
446
+ }
447
+ return o.length > 0 ? this : void 0;
448
+ }
449
+ optimizeNames(o, c) {
450
+ const { nodes: w } = this;
451
+ let R = w.length;
452
+ for (; R--; ) {
453
+ const O = w[R];
454
+ O.optimizeNames(o, c) || (x(o, O.names), w.splice(R, 1));
455
+ }
456
+ return w.length > 0 ? this : void 0;
457
+ }
458
+ get names() {
459
+ return this.nodes.reduce((o, c) => ie(o, c.names), {});
460
+ }
461
+ }
462
+ class g extends E {
463
+ render(o) {
464
+ return "{" + o._n + super.render(o) + "}" + o._n;
465
+ }
466
+ }
467
+ class v extends E {
468
+ }
469
+ class h extends g {
470
+ }
471
+ h.kind = "else";
472
+ class f extends g {
473
+ constructor(o, c) {
474
+ super(c), this.condition = o;
475
+ }
476
+ render(o) {
477
+ let c = `if(${this.condition})` + super.render(o);
478
+ return this.else && (c += "else " + this.else.render(o)), c;
479
+ }
480
+ optimizeNodes() {
481
+ super.optimizeNodes();
482
+ const o = this.condition;
483
+ if (o === !0)
484
+ return this.nodes;
485
+ let c = this.else;
486
+ if (c) {
487
+ const w = c.optimizeNodes();
488
+ c = this.else = Array.isArray(w) ? new h(w) : w;
489
+ }
490
+ if (c)
491
+ return o === !1 ? c instanceof f ? c : c.nodes : this.nodes.length ? this : new f(Fe(o), c instanceof f ? [c] : c.nodes);
492
+ if (!(o === !1 || !this.nodes.length))
493
+ return this;
494
+ }
495
+ optimizeNames(o, c) {
496
+ var w;
497
+ if (this.else = (w = this.else) === null || w === void 0 ? void 0 : w.optimizeNames(o, c), !!(super.optimizeNames(o, c) || this.else))
498
+ return this.condition = H(this.condition, o, c), this;
499
+ }
500
+ get names() {
501
+ const o = super.names;
502
+ return z(o, this.condition), this.else && ie(o, this.else.names), o;
503
+ }
504
+ }
505
+ f.kind = "if";
506
+ class $ extends g {
507
+ }
508
+ $.kind = "for";
509
+ class P extends $ {
510
+ constructor(o) {
511
+ super(), this.iteration = o;
512
+ }
513
+ render(o) {
514
+ return `for(${this.iteration})` + super.render(o);
515
+ }
516
+ optimizeNames(o, c) {
517
+ if (super.optimizeNames(o, c))
518
+ return this.iteration = H(this.iteration, o, c), this;
519
+ }
520
+ get names() {
521
+ return ie(super.names, this.iteration.names);
522
+ }
523
+ }
524
+ class j extends $ {
525
+ constructor(o, c, w, R) {
526
+ super(), this.varKind = o, this.name = c, this.from = w, this.to = R;
527
+ }
528
+ render(o) {
529
+ const c = o.es5 ? r.varKinds.var : this.varKind, { name: w, from: R, to: O } = this;
530
+ return `for(${c} ${w}=${R}; ${w}<${O}; ${w}++)` + super.render(o);
531
+ }
532
+ get names() {
533
+ const o = z(super.names, this.from);
534
+ return z(o, this.to);
535
+ }
536
+ }
537
+ class C extends $ {
538
+ constructor(o, c, w, R) {
539
+ super(), this.loop = o, this.varKind = c, this.name = w, this.iterable = R;
540
+ }
541
+ render(o) {
542
+ return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(o);
543
+ }
544
+ optimizeNames(o, c) {
545
+ if (super.optimizeNames(o, c))
546
+ return this.iterable = H(this.iterable, o, c), this;
547
+ }
548
+ get names() {
549
+ return ie(super.names, this.iterable.names);
550
+ }
551
+ }
552
+ class U extends g {
553
+ constructor(o, c, w) {
554
+ super(), this.name = o, this.args = c, this.async = w;
555
+ }
556
+ render(o) {
557
+ return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(o);
558
+ }
559
+ }
560
+ U.kind = "func";
561
+ class J extends E {
562
+ render(o) {
563
+ return "return " + super.render(o);
564
+ }
565
+ }
566
+ J.kind = "return";
567
+ class ne extends g {
568
+ render(o) {
569
+ let c = "try" + super.render(o);
570
+ return this.catch && (c += this.catch.render(o)), this.finally && (c += this.finally.render(o)), c;
571
+ }
572
+ optimizeNodes() {
573
+ var o, c;
574
+ return super.optimizeNodes(), (o = this.catch) === null || o === void 0 || o.optimizeNodes(), (c = this.finally) === null || c === void 0 || c.optimizeNodes(), this;
575
+ }
576
+ optimizeNames(o, c) {
577
+ var w, R;
578
+ return super.optimizeNames(o, c), (w = this.catch) === null || w === void 0 || w.optimizeNames(o, c), (R = this.finally) === null || R === void 0 || R.optimizeNames(o, c), this;
579
+ }
580
+ get names() {
581
+ const o = super.names;
582
+ return this.catch && ie(o, this.catch.names), this.finally && ie(o, this.finally.names), o;
583
+ }
584
+ }
585
+ class ae extends g {
586
+ constructor(o) {
587
+ super(), this.error = o;
588
+ }
589
+ render(o) {
590
+ return `catch(${this.error})` + super.render(o);
591
+ }
592
+ }
593
+ ae.kind = "catch";
594
+ class me extends g {
595
+ render(o) {
596
+ return "finally" + super.render(o);
597
+ }
598
+ }
599
+ me.kind = "finally";
600
+ class be {
601
+ constructor(o, c = {}) {
602
+ this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...c, _n: c.lines ? `
603
+ ` : "" }, this._extScope = o, this._scope = new r.Scope({ parent: o }), this._nodes = [new v()];
604
+ }
605
+ toString() {
606
+ return this._root.render(this.opts);
607
+ }
608
+ // returns unique name in the internal scope
609
+ name(o) {
610
+ return this._scope.name(o);
611
+ }
612
+ // reserves unique name in the external scope
613
+ scopeName(o) {
614
+ return this._extScope.name(o);
615
+ }
616
+ // reserves unique name in the external scope and assigns value to it
617
+ scopeValue(o, c) {
618
+ const w = this._extScope.value(o, c);
619
+ return (this._values[w.prefix] || (this._values[w.prefix] = /* @__PURE__ */ new Set())).add(w), w;
620
+ }
621
+ getScopeValue(o, c) {
622
+ return this._extScope.getValue(o, c);
623
+ }
624
+ // return code that assigns values in the external scope to the names that are used internally
625
+ // (same names that were returned by gen.scopeName or gen.scopeValue)
626
+ scopeRefs(o) {
627
+ return this._extScope.scopeRefs(o, this._values);
628
+ }
629
+ scopeCode() {
630
+ return this._extScope.scopeCode(this._values);
631
+ }
632
+ _def(o, c, w, R) {
633
+ const O = this._scope.toName(c);
634
+ return w !== void 0 && R && (this._constants[O.str] = w), this._leafNode(new i(o, O, w)), O;
635
+ }
636
+ // `const` declaration (`var` in es5 mode)
637
+ const(o, c, w) {
638
+ return this._def(r.varKinds.const, o, c, w);
639
+ }
640
+ // `let` declaration with optional assignment (`var` in es5 mode)
641
+ let(o, c, w) {
642
+ return this._def(r.varKinds.let, o, c, w);
643
+ }
644
+ // `var` declaration with optional assignment
645
+ var(o, c, w) {
646
+ return this._def(r.varKinds.var, o, c, w);
647
+ }
648
+ // assignment code
649
+ assign(o, c, w) {
650
+ return this._leafNode(new d(o, c, w));
651
+ }
652
+ // `+=` code
653
+ add(o, c) {
654
+ return this._leafNode(new u(o, e.operators.ADD, c));
655
+ }
656
+ // appends passed SafeExpr to code or executes Block
657
+ code(o) {
658
+ return typeof o == "function" ? o() : o !== t.nil && this._leafNode(new b(o)), this;
659
+ }
660
+ // returns code for object literal for the passed argument list of key-value pairs
661
+ object(...o) {
662
+ const c = ["{"];
663
+ for (const [w, R] of o)
664
+ c.length > 1 && c.push(","), c.push(w), (w !== R || this.opts.es5) && (c.push(":"), (0, t.addCodeArg)(c, R));
665
+ return c.push("}"), new t._Code(c);
666
+ }
667
+ // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
668
+ if(o, c, w) {
669
+ if (this._blockNode(new f(o)), c && w)
670
+ this.code(c).else().code(w).endIf();
671
+ else if (c)
672
+ this.code(c).endIf();
673
+ else if (w)
674
+ throw new Error('CodeGen: "else" body without "then" body');
675
+ return this;
676
+ }
677
+ // `else if` clause - invalid without `if` or after `else` clauses
678
+ elseIf(o) {
679
+ return this._elseNode(new f(o));
680
+ }
681
+ // `else` clause - only valid after `if` or `else if` clauses
682
+ else() {
683
+ return this._elseNode(new h());
684
+ }
685
+ // end `if` statement (needed if gen.if was used only with condition)
686
+ endIf() {
687
+ return this._endBlockNode(f, h);
688
+ }
689
+ _for(o, c) {
690
+ return this._blockNode(o), c && this.code(c).endFor(), this;
691
+ }
692
+ // a generic `for` clause (or statement if `forBody` is passed)
693
+ for(o, c) {
694
+ return this._for(new P(o), c);
695
+ }
696
+ // `for` statement for a range of values
697
+ forRange(o, c, w, R, O = this.opts.es5 ? r.varKinds.var : r.varKinds.let) {
698
+ const q = this._scope.toName(o);
699
+ return this._for(new j(O, q, c, w), () => R(q));
700
+ }
701
+ // `for-of` statement (in es5 mode replace with a normal for loop)
702
+ forOf(o, c, w, R = r.varKinds.const) {
703
+ const O = this._scope.toName(o);
704
+ if (this.opts.es5) {
705
+ const q = c instanceof t.Name ? c : this.var("_arr", c);
706
+ return this.forRange("_i", 0, (0, t._)`${q}.length`, (I) => {
707
+ this.var(O, (0, t._)`${q}[${I}]`), w(O);
708
+ });
709
+ }
710
+ return this._for(new C("of", R, O, c), () => w(O));
711
+ }
712
+ // `for-in` statement.
713
+ // With option `ownProperties` replaced with a `for-of` loop for object keys
714
+ forIn(o, c, w, R = this.opts.es5 ? r.varKinds.var : r.varKinds.const) {
715
+ if (this.opts.ownProperties)
716
+ return this.forOf(o, (0, t._)`Object.keys(${c})`, w);
717
+ const O = this._scope.toName(o);
718
+ return this._for(new C("in", R, O, c), () => w(O));
719
+ }
720
+ // end `for` loop
721
+ endFor() {
722
+ return this._endBlockNode($);
723
+ }
724
+ // `label` statement
725
+ label(o) {
726
+ return this._leafNode(new l(o));
727
+ }
728
+ // `break` statement
729
+ break(o) {
730
+ return this._leafNode(new m(o));
731
+ }
732
+ // `return` statement
733
+ return(o) {
734
+ const c = new J();
735
+ if (this._blockNode(c), this.code(o), c.nodes.length !== 1)
736
+ throw new Error('CodeGen: "return" should have one node');
737
+ return this._endBlockNode(J);
738
+ }
739
+ // `try` statement
740
+ try(o, c, w) {
741
+ if (!c && !w)
742
+ throw new Error('CodeGen: "try" without "catch" and "finally"');
743
+ const R = new ne();
744
+ if (this._blockNode(R), this.code(o), c) {
745
+ const O = this.name("e");
746
+ this._currNode = R.catch = new ae(O), c(O);
747
+ }
748
+ return w && (this._currNode = R.finally = new me(), this.code(w)), this._endBlockNode(ae, me);
749
+ }
750
+ // `throw` statement
751
+ throw(o) {
752
+ return this._leafNode(new y(o));
753
+ }
754
+ // start self-balancing block
755
+ block(o, c) {
756
+ return this._blockStarts.push(this._nodes.length), o && this.code(o).endBlock(c), this;
757
+ }
758
+ // end the current self-balancing block
759
+ endBlock(o) {
760
+ const c = this._blockStarts.pop();
761
+ if (c === void 0)
762
+ throw new Error("CodeGen: not in self-balancing block");
763
+ const w = this._nodes.length - c;
764
+ if (w < 0 || o !== void 0 && w !== o)
765
+ throw new Error(`CodeGen: wrong number of nodes: ${w} vs ${o} expected`);
766
+ return this._nodes.length = c, this;
767
+ }
768
+ // `function` heading (or definition if funcBody is passed)
769
+ func(o, c = t.nil, w, R) {
770
+ return this._blockNode(new U(o, c, w)), R && this.code(R).endFunc(), this;
771
+ }
772
+ // end function definition
773
+ endFunc() {
774
+ return this._endBlockNode(U);
775
+ }
776
+ optimize(o = 1) {
777
+ for (; o-- > 0; )
778
+ this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants);
779
+ }
780
+ _leafNode(o) {
781
+ return this._currNode.nodes.push(o), this;
782
+ }
783
+ _blockNode(o) {
784
+ this._currNode.nodes.push(o), this._nodes.push(o);
785
+ }
786
+ _endBlockNode(o, c) {
787
+ const w = this._currNode;
788
+ if (w instanceof o || c && w instanceof c)
789
+ return this._nodes.pop(), this;
790
+ throw new Error(`CodeGen: not in block "${c ? `${o.kind}/${c.kind}` : o.kind}"`);
791
+ }
792
+ _elseNode(o) {
793
+ const c = this._currNode;
794
+ if (!(c instanceof f))
795
+ throw new Error('CodeGen: "else" without "if"');
796
+ return this._currNode = c.else = o, this;
797
+ }
798
+ get _root() {
799
+ return this._nodes[0];
800
+ }
801
+ get _currNode() {
802
+ const o = this._nodes;
803
+ return o[o.length - 1];
804
+ }
805
+ set _currNode(o) {
806
+ const c = this._nodes;
807
+ c[c.length - 1] = o;
808
+ }
809
+ }
810
+ e.CodeGen = be;
811
+ function ie(_, o) {
812
+ for (const c in o)
813
+ _[c] = (_[c] || 0) + (o[c] || 0);
814
+ return _;
815
+ }
816
+ function z(_, o) {
817
+ return o instanceof t._CodeOrName ? ie(_, o.names) : _;
818
+ }
819
+ function H(_, o, c) {
820
+ if (_ instanceof t.Name)
821
+ return w(_);
822
+ if (!R(_))
823
+ return _;
824
+ return new t._Code(_._items.reduce((O, q) => (q instanceof t.Name && (q = w(q)), q instanceof t._Code ? O.push(...q._items) : O.push(q), O), []));
825
+ function w(O) {
826
+ const q = c[O.str];
827
+ return q === void 0 || o[O.str] !== 1 ? O : (delete o[O.str], q);
828
+ }
829
+ function R(O) {
830
+ return O instanceof t._Code && O._items.some((q) => q instanceof t.Name && o[q.str] === 1 && c[q.str] !== void 0);
831
+ }
832
+ }
833
+ function x(_, o) {
834
+ for (const c in o)
835
+ _[c] = (_[c] || 0) - (o[c] || 0);
836
+ }
837
+ function Fe(_) {
838
+ return typeof _ == "boolean" || typeof _ == "number" || _ === null ? !_ : (0, t._)`!${S(_)}`;
839
+ }
840
+ e.not = Fe;
841
+ const Ke = p(e.operators.AND);
842
+ function _e(..._) {
843
+ return _.reduce(Ke);
844
+ }
845
+ e.and = _e;
846
+ const Ae = p(e.operators.OR);
847
+ function k(..._) {
848
+ return _.reduce(Ae);
849
+ }
850
+ e.or = k;
851
+ function p(_) {
852
+ return (o, c) => o === t.nil ? c : c === t.nil ? o : (0, t._)`${S(o)} ${_} ${S(c)}`;
853
+ }
854
+ function S(_) {
855
+ return _ instanceof t.Name ? _ : (0, t._)`(${_})`;
856
+ }
857
+ })(A);
858
+ var N = {};
859
+ Object.defineProperty(N, "__esModule", { value: !0 });
860
+ N.checkStrictMode = N.getErrorPath = N.Type = N.useFunc = N.setEvaluated = N.evaluatedPropsToName = N.mergeEvaluated = N.eachItem = N.unescapeJsonPointer = N.escapeJsonPointer = N.escapeFragment = N.unescapeFragment = N.schemaRefOrVal = N.schemaHasRulesButRef = N.schemaHasRules = N.checkUnknownRules = N.alwaysValidSchema = N.toHash = void 0;
861
+ const L = A, bo = dt;
862
+ function Eo(e) {
863
+ const t = {};
864
+ for (const r of e)
865
+ t[r] = !0;
866
+ return t;
867
+ }
868
+ N.toHash = Eo;
869
+ function So(e, t) {
870
+ return typeof t == "boolean" ? t : Object.keys(t).length === 0 ? !0 : (Fs(e, t), !Ks(t, e.self.RULES.all));
871
+ }
872
+ N.alwaysValidSchema = So;
873
+ function Fs(e, t = e.schema) {
874
+ const { opts: r, self: s } = e;
875
+ if (!r.strictSchema || typeof t == "boolean")
876
+ return;
877
+ const n = s.RULES.keywords;
878
+ for (const a in t)
879
+ n[a] || zs(e, `unknown keyword: "${a}"`);
880
+ }
881
+ N.checkUnknownRules = Fs;
882
+ function Ks(e, t) {
883
+ if (typeof e == "boolean")
884
+ return !e;
885
+ for (const r in e)
886
+ if (t[r])
887
+ return !0;
888
+ return !1;
889
+ }
890
+ N.schemaHasRules = Ks;
891
+ function Po(e, t) {
892
+ if (typeof e == "boolean")
893
+ return !e;
894
+ for (const r in e)
895
+ if (r !== "$ref" && t.all[r])
896
+ return !0;
897
+ return !1;
898
+ }
899
+ N.schemaHasRulesButRef = Po;
900
+ function ko({ topSchemaRef: e, schemaPath: t }, r, s, n) {
901
+ if (!n) {
902
+ if (typeof r == "number" || typeof r == "boolean")
903
+ return r;
904
+ if (typeof r == "string")
905
+ return (0, L._)`${r}`;
906
+ }
907
+ return (0, L._)`${e}${t}${(0, L.getProperty)(s)}`;
908
+ }
909
+ N.schemaRefOrVal = ko;
910
+ function No(e) {
911
+ return As(decodeURIComponent(e));
912
+ }
913
+ N.unescapeFragment = No;
914
+ function Co(e) {
915
+ return encodeURIComponent(lr(e));
916
+ }
917
+ N.escapeFragment = Co;
918
+ function lr(e) {
919
+ return typeof e == "number" ? `${e}` : e.replace(/~/g, "~0").replace(/\//g, "~1");
920
+ }
921
+ N.escapeJsonPointer = lr;
922
+ function As(e) {
923
+ return e.replace(/~1/g, "/").replace(/~0/g, "~");
924
+ }
925
+ N.unescapeJsonPointer = As;
926
+ function jo(e, t) {
927
+ if (Array.isArray(e))
928
+ for (const r of e)
929
+ t(r);
930
+ else
931
+ t(e);
932
+ }
933
+ N.eachItem = jo;
934
+ function es({ mergeNames: e, mergeToName: t, mergeValues: r, resultToName: s }) {
935
+ return (n, a, i, d) => {
936
+ const u = i === void 0 ? a : i instanceof L.Name ? (a instanceof L.Name ? e(n, a, i) : t(n, a, i), i) : a instanceof L.Name ? (t(n, i, a), a) : r(a, i);
937
+ return d === L.Name && !(u instanceof L.Name) ? s(n, u) : u;
938
+ };
939
+ }
940
+ N.mergeEvaluated = {
941
+ props: es({
942
+ mergeNames: (e, t, r) => e.if((0, L._)`${r} !== true && ${t} !== undefined`, () => {
943
+ e.if((0, L._)`${t} === true`, () => e.assign(r, !0), () => e.assign(r, (0, L._)`${r} || {}`).code((0, L._)`Object.assign(${r}, ${t})`));
944
+ }),
945
+ mergeToName: (e, t, r) => e.if((0, L._)`${r} !== true`, () => {
946
+ t === !0 ? e.assign(r, !0) : (e.assign(r, (0, L._)`${r} || {}`), dr(e, r, t));
947
+ }),
948
+ mergeValues: (e, t) => e === !0 ? !0 : { ...e, ...t },
949
+ resultToName: qs
950
+ }),
951
+ items: es({
952
+ mergeNames: (e, t, r) => e.if((0, L._)`${r} !== true && ${t} !== undefined`, () => e.assign(r, (0, L._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),
953
+ mergeToName: (e, t, r) => e.if((0, L._)`${r} !== true`, () => e.assign(r, t === !0 ? !0 : (0, L._)`${r} > ${t} ? ${r} : ${t}`)),
954
+ mergeValues: (e, t) => e === !0 ? !0 : Math.max(e, t),
955
+ resultToName: (e, t) => e.var("items", t)
956
+ })
957
+ };
958
+ function qs(e, t) {
959
+ if (t === !0)
960
+ return e.var("props", !0);
961
+ const r = e.var("props", (0, L._)`{}`);
962
+ return t !== void 0 && dr(e, r, t), r;
963
+ }
964
+ N.evaluatedPropsToName = qs;
965
+ function dr(e, t, r) {
966
+ Object.keys(r).forEach((s) => e.assign((0, L._)`${t}${(0, L.getProperty)(s)}`, !0));
967
+ }
968
+ N.setEvaluated = dr;
969
+ const ts = {};
970
+ function Ro(e, t) {
971
+ return e.scopeValue("func", {
972
+ ref: t,
973
+ code: ts[t.code] || (ts[t.code] = new bo._Code(t.code))
974
+ });
975
+ }
976
+ N.useFunc = Ro;
977
+ var sr;
978
+ (function(e) {
979
+ e[e.Num = 0] = "Num", e[e.Str = 1] = "Str";
980
+ })(sr || (N.Type = sr = {}));
981
+ function Oo(e, t, r) {
982
+ if (e instanceof L.Name) {
983
+ const s = t === sr.Num;
984
+ return r ? s ? (0, L._)`"[" + ${e} + "]"` : (0, L._)`"['" + ${e} + "']"` : s ? (0, L._)`"/" + ${e}` : (0, L._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
985
+ }
986
+ return r ? (0, L.getProperty)(e).toString() : "/" + lr(e);
987
+ }
988
+ N.getErrorPath = Oo;
989
+ function zs(e, t, r = e.opts.strictSchema) {
990
+ if (r) {
991
+ if (t = `strict mode: ${t}`, r === !0)
992
+ throw new Error(t);
993
+ e.self.logger.warn(t);
994
+ }
995
+ }
996
+ N.checkStrictMode = zs;
997
+ var ye = {};
998
+ Object.defineProperty(ye, "__esModule", { value: !0 });
999
+ const D = A, To = {
1000
+ // validation function arguments
1001
+ data: new D.Name("data"),
1002
+ // data passed to validation function
1003
+ // args passed from referencing schema
1004
+ valCxt: new D.Name("valCxt"),
1005
+ // validation/data context - should not be used directly, it is destructured to the names below
1006
+ instancePath: new D.Name("instancePath"),
1007
+ parentData: new D.Name("parentData"),
1008
+ parentDataProperty: new D.Name("parentDataProperty"),
1009
+ rootData: new D.Name("rootData"),
1010
+ // root data - same as the data passed to the first/top validation function
1011
+ dynamicAnchors: new D.Name("dynamicAnchors"),
1012
+ // used to support recursiveRef and dynamicRef
1013
+ // function scoped variables
1014
+ vErrors: new D.Name("vErrors"),
1015
+ // null or array of validation errors
1016
+ errors: new D.Name("errors"),
1017
+ // counter of validation errors
1018
+ this: new D.Name("this"),
1019
+ // "globals"
1020
+ self: new D.Name("self"),
1021
+ scope: new D.Name("scope"),
1022
+ // JTD serialize/parse name for JSON string and position
1023
+ json: new D.Name("json"),
1024
+ jsonPos: new D.Name("jsonPos"),
1025
+ jsonLen: new D.Name("jsonLen"),
1026
+ jsonPart: new D.Name("jsonPart")
1027
+ };
1028
+ ye.default = To;
1029
+ (function(e) {
1030
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
1031
+ const t = A, r = N, s = ye;
1032
+ e.keywordError = {
1033
+ message: ({ keyword: h }) => (0, t.str)`must pass "${h}" keyword validation`
1034
+ }, e.keyword$DataError = {
1035
+ message: ({ keyword: h, schemaType: f }) => f ? (0, t.str)`"${h}" keyword must be ${f} ($data)` : (0, t.str)`"${h}" keyword is invalid ($data)`
1036
+ };
1037
+ function n(h, f = e.keywordError, $, P) {
1038
+ const { it: j } = h, { gen: C, compositeRule: U, allErrors: J } = j, ne = y(h, f, $);
1039
+ P ?? (U || J) ? u(C, ne) : l(j, (0, t._)`[${ne}]`);
1040
+ }
1041
+ e.reportError = n;
1042
+ function a(h, f = e.keywordError, $) {
1043
+ const { it: P } = h, { gen: j, compositeRule: C, allErrors: U } = P, J = y(h, f, $);
1044
+ u(j, J), C || U || l(P, s.default.vErrors);
1045
+ }
1046
+ e.reportExtraError = a;
1047
+ function i(h, f) {
1048
+ h.assign(s.default.errors, f), h.if((0, t._)`${s.default.vErrors} !== null`, () => h.if(f, () => h.assign((0, t._)`${s.default.vErrors}.length`, f), () => h.assign(s.default.vErrors, null)));
1049
+ }
1050
+ e.resetErrorsCount = i;
1051
+ function d({ gen: h, keyword: f, schemaValue: $, data: P, errsCount: j, it: C }) {
1052
+ if (j === void 0)
1053
+ throw new Error("ajv implementation error");
1054
+ const U = h.name("err");
1055
+ h.forRange("i", j, s.default.errors, (J) => {
1056
+ h.const(U, (0, t._)`${s.default.vErrors}[${J}]`), h.if((0, t._)`${U}.instancePath === undefined`, () => h.assign((0, t._)`${U}.instancePath`, (0, t.strConcat)(s.default.instancePath, C.errorPath))), h.assign((0, t._)`${U}.schemaPath`, (0, t.str)`${C.errSchemaPath}/${f}`), C.opts.verbose && (h.assign((0, t._)`${U}.schema`, $), h.assign((0, t._)`${U}.data`, P));
1057
+ });
1058
+ }
1059
+ e.extendErrors = d;
1060
+ function u(h, f) {
1061
+ const $ = h.const("err", f);
1062
+ h.if((0, t._)`${s.default.vErrors} === null`, () => h.assign(s.default.vErrors, (0, t._)`[${$}]`), (0, t._)`${s.default.vErrors}.push(${$})`), h.code((0, t._)`${s.default.errors}++`);
1063
+ }
1064
+ function l(h, f) {
1065
+ const { gen: $, validateName: P, schemaEnv: j } = h;
1066
+ j.$async ? $.throw((0, t._)`new ${h.ValidationError}(${f})`) : ($.assign((0, t._)`${P}.errors`, f), $.return(!1));
1067
+ }
1068
+ const m = {
1069
+ keyword: new t.Name("keyword"),
1070
+ schemaPath: new t.Name("schemaPath"),
1071
+ // also used in JTD errors
1072
+ params: new t.Name("params"),
1073
+ propertyName: new t.Name("propertyName"),
1074
+ message: new t.Name("message"),
1075
+ schema: new t.Name("schema"),
1076
+ parentSchema: new t.Name("parentSchema")
1077
+ };
1078
+ function y(h, f, $) {
1079
+ const { createErrors: P } = h.it;
1080
+ return P === !1 ? (0, t._)`{}` : b(h, f, $);
1081
+ }
1082
+ function b(h, f, $ = {}) {
1083
+ const { gen: P, it: j } = h, C = [
1084
+ E(j, $),
1085
+ g(h, $)
1086
+ ];
1087
+ return v(h, f, C), P.object(...C);
1088
+ }
1089
+ function E({ errorPath: h }, { instancePath: f }) {
1090
+ const $ = f ? (0, t.str)`${h}${(0, r.getErrorPath)(f, r.Type.Str)}` : h;
1091
+ return [s.default.instancePath, (0, t.strConcat)(s.default.instancePath, $)];
1092
+ }
1093
+ function g({ keyword: h, it: { errSchemaPath: f } }, { schemaPath: $, parentSchema: P }) {
1094
+ let j = P ? f : (0, t.str)`${f}/${h}`;
1095
+ return $ && (j = (0, t.str)`${j}${(0, r.getErrorPath)($, r.Type.Str)}`), [m.schemaPath, j];
1096
+ }
1097
+ function v(h, { params: f, message: $ }, P) {
1098
+ const { keyword: j, data: C, schemaValue: U, it: J } = h, { opts: ne, propertyName: ae, topSchemaRef: me, schemaPath: be } = J;
1099
+ P.push([m.keyword, j], [m.params, typeof f == "function" ? f(h) : f || (0, t._)`{}`]), ne.messages && P.push([m.message, typeof $ == "function" ? $(h) : $]), ne.verbose && P.push([m.schema, U], [m.parentSchema, (0, t._)`${me}${be}`], [s.default.data, C]), ae && P.push([m.propertyName, ae]);
1100
+ }
1101
+ })(ut);
1102
+ Object.defineProperty(Be, "__esModule", { value: !0 });
1103
+ Be.boolOrEmptySchema = Be.topBoolOrEmptySchema = void 0;
1104
+ const Io = ut, Mo = A, Vo = ye, Fo = {
1105
+ message: "boolean schema is false"
1106
+ };
1107
+ function Ko(e) {
1108
+ const { gen: t, schema: r, validateName: s } = e;
1109
+ r === !1 ? Us(e, !1) : typeof r == "object" && r.$async === !0 ? t.return(Vo.default.data) : (t.assign((0, Mo._)`${s}.errors`, null), t.return(!0));
1110
+ }
1111
+ Be.topBoolOrEmptySchema = Ko;
1112
+ function Ao(e, t) {
1113
+ const { gen: r, schema: s } = e;
1114
+ s === !1 ? (r.var(t, !1), Us(e)) : r.var(t, !0);
1115
+ }
1116
+ Be.boolOrEmptySchema = Ao;
1117
+ function Us(e, t) {
1118
+ const { gen: r, data: s } = e, n = {
1119
+ gen: r,
1120
+ keyword: "false schema",
1121
+ data: s,
1122
+ schema: !1,
1123
+ schemaCode: !1,
1124
+ schemaValue: !1,
1125
+ params: {},
1126
+ it: e
1127
+ };
1128
+ (0, Io.reportError)(n, Fo, void 0, t);
1129
+ }
1130
+ var X = {}, Ie = {};
1131
+ Object.defineProperty(Ie, "__esModule", { value: !0 });
1132
+ Ie.getRules = Ie.isJSONType = void 0;
1133
+ const qo = ["string", "number", "integer", "boolean", "null", "object", "array"], zo = new Set(qo);
1134
+ function Uo(e) {
1135
+ return typeof e == "string" && zo.has(e);
1136
+ }
1137
+ Ie.isJSONType = Uo;
1138
+ function Lo() {
1139
+ const e = {
1140
+ number: { type: "number", rules: [] },
1141
+ string: { type: "string", rules: [] },
1142
+ array: { type: "array", rules: [] },
1143
+ object: { type: "object", rules: [] }
1144
+ };
1145
+ return {
1146
+ types: { ...e, integer: !0, boolean: !0, null: !0 },
1147
+ rules: [{ rules: [] }, e.number, e.string, e.array, e.object],
1148
+ post: { rules: [] },
1149
+ all: {},
1150
+ keywords: {}
1151
+ };
1152
+ }
1153
+ Ie.getRules = Lo;
1154
+ var ge = {};
1155
+ Object.defineProperty(ge, "__esModule", { value: !0 });
1156
+ ge.shouldUseRule = ge.shouldUseGroup = ge.schemaHasRulesForType = void 0;
1157
+ function Go({ schema: e, self: t }, r) {
1158
+ const s = t.RULES.types[r];
1159
+ return s && s !== !0 && Ls(e, s);
1160
+ }
1161
+ ge.schemaHasRulesForType = Go;
1162
+ function Ls(e, t) {
1163
+ return t.rules.some((r) => Gs(e, r));
1164
+ }
1165
+ ge.shouldUseGroup = Ls;
1166
+ function Gs(e, t) {
1167
+ var r;
1168
+ return e[t.keyword] !== void 0 || ((r = t.definition.implements) === null || r === void 0 ? void 0 : r.some((s) => e[s] !== void 0));
1169
+ }
1170
+ ge.shouldUseRule = Gs;
1171
+ Object.defineProperty(X, "__esModule", { value: !0 });
1172
+ X.reportTypeError = X.checkDataTypes = X.checkDataType = X.coerceAndCheckDataType = X.getJSONTypes = X.getSchemaTypes = X.DataType = void 0;
1173
+ const Jo = Ie, Ho = ge, Bo = ut, F = A, Js = N;
1174
+ var Je;
1175
+ (function(e) {
1176
+ e[e.Correct = 0] = "Correct", e[e.Wrong = 1] = "Wrong";
1177
+ })(Je || (X.DataType = Je = {}));
1178
+ function Qo(e) {
1179
+ const t = Hs(e.type);
1180
+ if (t.includes("null")) {
1181
+ if (e.nullable === !1)
1182
+ throw new Error("type: null contradicts nullable: false");
1183
+ } else {
1184
+ if (!t.length && e.nullable !== void 0)
1185
+ throw new Error('"nullable" cannot be used without "type"');
1186
+ e.nullable === !0 && t.push("null");
1187
+ }
1188
+ return t;
1189
+ }
1190
+ X.getSchemaTypes = Qo;
1191
+ function Hs(e) {
1192
+ const t = Array.isArray(e) ? e : e ? [e] : [];
1193
+ if (t.every(Jo.isJSONType))
1194
+ return t;
1195
+ throw new Error("type must be JSONType or JSONType[]: " + t.join(","));
1196
+ }
1197
+ X.getJSONTypes = Hs;
1198
+ function Xo(e, t) {
1199
+ const { gen: r, data: s, opts: n } = e, a = Yo(t, n.coerceTypes), i = t.length > 0 && !(a.length === 0 && t.length === 1 && (0, Ho.schemaHasRulesForType)(e, t[0]));
1200
+ if (i) {
1201
+ const d = ur(t, s, n.strictNumbers, Je.Wrong);
1202
+ r.if(d, () => {
1203
+ a.length ? Zo(e, t, a) : fr(e);
1204
+ });
1205
+ }
1206
+ return i;
1207
+ }
1208
+ X.coerceAndCheckDataType = Xo;
1209
+ const Bs = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
1210
+ function Yo(e, t) {
1211
+ return t ? e.filter((r) => Bs.has(r) || t === "array" && r === "array") : [];
1212
+ }
1213
+ function Zo(e, t, r) {
1214
+ const { gen: s, data: n, opts: a } = e, i = s.let("dataType", (0, F._)`typeof ${n}`), d = s.let("coerced", (0, F._)`undefined`);
1215
+ a.coerceTypes === "array" && s.if((0, F._)`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`, () => s.assign(n, (0, F._)`${n}[0]`).assign(i, (0, F._)`typeof ${n}`).if(ur(t, n, a.strictNumbers), () => s.assign(d, n))), s.if((0, F._)`${d} !== undefined`);
1216
+ for (const l of r)
1217
+ (Bs.has(l) || l === "array" && a.coerceTypes === "array") && u(l);
1218
+ s.else(), fr(e), s.endIf(), s.if((0, F._)`${d} !== undefined`, () => {
1219
+ s.assign(n, d), Do(e, d);
1220
+ });
1221
+ function u(l) {
1222
+ switch (l) {
1223
+ case "string":
1224
+ s.elseIf((0, F._)`${i} == "number" || ${i} == "boolean"`).assign(d, (0, F._)`"" + ${n}`).elseIf((0, F._)`${n} === null`).assign(d, (0, F._)`""`);
1225
+ return;
1226
+ case "number":
1227
+ s.elseIf((0, F._)`${i} == "boolean" || ${n} === null
1228
+ || (${i} == "string" && ${n} && ${n} == +${n})`).assign(d, (0, F._)`+${n}`);
1229
+ return;
1230
+ case "integer":
1231
+ s.elseIf((0, F._)`${i} === "boolean" || ${n} === null
1232
+ || (${i} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(d, (0, F._)`+${n}`);
1233
+ return;
1234
+ case "boolean":
1235
+ s.elseIf((0, F._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(d, !1).elseIf((0, F._)`${n} === "true" || ${n} === 1`).assign(d, !0);
1236
+ return;
1237
+ case "null":
1238
+ s.elseIf((0, F._)`${n} === "" || ${n} === 0 || ${n} === false`), s.assign(d, null);
1239
+ return;
1240
+ case "array":
1241
+ s.elseIf((0, F._)`${i} === "string" || ${i} === "number"
1242
+ || ${i} === "boolean" || ${n} === null`).assign(d, (0, F._)`[${n}]`);
1243
+ }
1244
+ }
1245
+ }
1246
+ function Do({ gen: e, parentData: t, parentDataProperty: r }, s) {
1247
+ e.if((0, F._)`${t} !== undefined`, () => e.assign((0, F._)`${t}[${r}]`, s));
1248
+ }
1249
+ function nr(e, t, r, s = Je.Correct) {
1250
+ const n = s === Je.Correct ? F.operators.EQ : F.operators.NEQ;
1251
+ let a;
1252
+ switch (e) {
1253
+ case "null":
1254
+ return (0, F._)`${t} ${n} null`;
1255
+ case "array":
1256
+ a = (0, F._)`Array.isArray(${t})`;
1257
+ break;
1258
+ case "object":
1259
+ a = (0, F._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;
1260
+ break;
1261
+ case "integer":
1262
+ a = i((0, F._)`!(${t} % 1) && !isNaN(${t})`);
1263
+ break;
1264
+ case "number":
1265
+ a = i();
1266
+ break;
1267
+ default:
1268
+ return (0, F._)`typeof ${t} ${n} ${e}`;
1269
+ }
1270
+ return s === Je.Correct ? a : (0, F.not)(a);
1271
+ function i(d = F.nil) {
1272
+ return (0, F.and)((0, F._)`typeof ${t} == "number"`, d, r ? (0, F._)`isFinite(${t})` : F.nil);
1273
+ }
1274
+ }
1275
+ X.checkDataType = nr;
1276
+ function ur(e, t, r, s) {
1277
+ if (e.length === 1)
1278
+ return nr(e[0], t, r, s);
1279
+ let n;
1280
+ const a = (0, Js.toHash)(e);
1281
+ if (a.array && a.object) {
1282
+ const i = (0, F._)`typeof ${t} != "object"`;
1283
+ n = a.null ? i : (0, F._)`!${t} || ${i}`, delete a.null, delete a.array, delete a.object;
1284
+ } else
1285
+ n = F.nil;
1286
+ a.number && delete a.integer;
1287
+ for (const i in a)
1288
+ n = (0, F.and)(n, nr(i, t, r, s));
1289
+ return n;
1290
+ }
1291
+ X.checkDataTypes = ur;
1292
+ const Wo = {
1293
+ message: ({ schema: e }) => `must be ${e}`,
1294
+ params: ({ schema: e, schemaValue: t }) => typeof e == "string" ? (0, F._)`{type: ${e}}` : (0, F._)`{type: ${t}}`
1295
+ };
1296
+ function fr(e) {
1297
+ const t = xo(e);
1298
+ (0, Bo.reportError)(t, Wo);
1299
+ }
1300
+ X.reportTypeError = fr;
1301
+ function xo(e) {
1302
+ const { gen: t, data: r, schema: s } = e, n = (0, Js.schemaRefOrVal)(e, s, "type");
1303
+ return {
1304
+ gen: t,
1305
+ keyword: "type",
1306
+ data: r,
1307
+ schema: s.type,
1308
+ schemaCode: n,
1309
+ schemaValue: n,
1310
+ parentSchema: s,
1311
+ params: {},
1312
+ it: e
1313
+ };
1314
+ }
1315
+ var jt = {};
1316
+ Object.defineProperty(jt, "__esModule", { value: !0 });
1317
+ jt.assignDefaults = void 0;
1318
+ const ze = A, ea = N;
1319
+ function ta(e, t) {
1320
+ const { properties: r, items: s } = e.schema;
1321
+ if (t === "object" && r)
1322
+ for (const n in r)
1323
+ rs(e, n, r[n].default);
1324
+ else t === "array" && Array.isArray(s) && s.forEach((n, a) => rs(e, a, n.default));
1325
+ }
1326
+ jt.assignDefaults = ta;
1327
+ function rs(e, t, r) {
1328
+ const { gen: s, compositeRule: n, data: a, opts: i } = e;
1329
+ if (r === void 0)
1330
+ return;
1331
+ const d = (0, ze._)`${a}${(0, ze.getProperty)(t)}`;
1332
+ if (n) {
1333
+ (0, ea.checkStrictMode)(e, `default is ignored for: ${d}`);
1334
+ return;
1335
+ }
1336
+ let u = (0, ze._)`${d} === undefined`;
1337
+ i.useDefaults === "empty" && (u = (0, ze._)`${u} || ${d} === null || ${d} === ""`), s.if(u, (0, ze._)`${d} = ${(0, ze.stringify)(r)}`);
1338
+ }
1339
+ var pe = {}, K = {};
1340
+ Object.defineProperty(K, "__esModule", { value: !0 });
1341
+ K.validateUnion = K.validateArray = K.usePattern = K.callValidateCode = K.schemaProperties = K.allSchemaProperties = K.noPropertyInData = K.propertyInData = K.isOwnProperty = K.hasPropFunc = K.reportMissingProp = K.checkMissingProp = K.checkReportMissingProp = void 0;
1342
+ const G = A, mr = N, Ee = ye, ra = N;
1343
+ function sa(e, t) {
1344
+ const { gen: r, data: s, it: n } = e;
1345
+ r.if(pr(r, s, t, n.opts.ownProperties), () => {
1346
+ e.setParams({ missingProperty: (0, G._)`${t}` }, !0), e.error();
1347
+ });
1348
+ }
1349
+ K.checkReportMissingProp = sa;
1350
+ function na({ gen: e, data: t, it: { opts: r } }, s, n) {
1351
+ return (0, G.or)(...s.map((a) => (0, G.and)(pr(e, t, a, r.ownProperties), (0, G._)`${n} = ${a}`)));
1352
+ }
1353
+ K.checkMissingProp = na;
1354
+ function oa(e, t) {
1355
+ e.setParams({ missingProperty: t }, !0), e.error();
1356
+ }
1357
+ K.reportMissingProp = oa;
1358
+ function Qs(e) {
1359
+ return e.scopeValue("func", {
1360
+ // eslint-disable-next-line @typescript-eslint/unbound-method
1361
+ ref: Object.prototype.hasOwnProperty,
1362
+ code: (0, G._)`Object.prototype.hasOwnProperty`
1363
+ });
1364
+ }
1365
+ K.hasPropFunc = Qs;
1366
+ function hr(e, t, r) {
1367
+ return (0, G._)`${Qs(e)}.call(${t}, ${r})`;
1368
+ }
1369
+ K.isOwnProperty = hr;
1370
+ function aa(e, t, r, s) {
1371
+ const n = (0, G._)`${t}${(0, G.getProperty)(r)} !== undefined`;
1372
+ return s ? (0, G._)`${n} && ${hr(e, t, r)}` : n;
1373
+ }
1374
+ K.propertyInData = aa;
1375
+ function pr(e, t, r, s) {
1376
+ const n = (0, G._)`${t}${(0, G.getProperty)(r)} === undefined`;
1377
+ return s ? (0, G.or)(n, (0, G.not)(hr(e, t, r))) : n;
1378
+ }
1379
+ K.noPropertyInData = pr;
1380
+ function Xs(e) {
1381
+ return e ? Object.keys(e).filter((t) => t !== "__proto__") : [];
1382
+ }
1383
+ K.allSchemaProperties = Xs;
1384
+ function ia(e, t) {
1385
+ return Xs(t).filter((r) => !(0, mr.alwaysValidSchema)(e, t[r]));
1386
+ }
1387
+ K.schemaProperties = ia;
1388
+ function ca({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: s, schemaPath: n, errorPath: a }, it: i }, d, u, l) {
1389
+ const m = l ? (0, G._)`${e}, ${t}, ${s}${n}` : t, y = [
1390
+ [Ee.default.instancePath, (0, G.strConcat)(Ee.default.instancePath, a)],
1391
+ [Ee.default.parentData, i.parentData],
1392
+ [Ee.default.parentDataProperty, i.parentDataProperty],
1393
+ [Ee.default.rootData, Ee.default.rootData]
1394
+ ];
1395
+ i.opts.dynamicRef && y.push([Ee.default.dynamicAnchors, Ee.default.dynamicAnchors]);
1396
+ const b = (0, G._)`${m}, ${r.object(...y)}`;
1397
+ return u !== G.nil ? (0, G._)`${d}.call(${u}, ${b})` : (0, G._)`${d}(${b})`;
1398
+ }
1399
+ K.callValidateCode = ca;
1400
+ const la = (0, G._)`new RegExp`;
1401
+ function da({ gen: e, it: { opts: t } }, r) {
1402
+ const s = t.unicodeRegExp ? "u" : "", { regExp: n } = t.code, a = n(r, s);
1403
+ return e.scopeValue("pattern", {
1404
+ key: a.toString(),
1405
+ ref: a,
1406
+ code: (0, G._)`${n.code === "new RegExp" ? la : (0, ra.useFunc)(e, n)}(${r}, ${s})`
1407
+ });
1408
+ }
1409
+ K.usePattern = da;
1410
+ function ua(e) {
1411
+ const { gen: t, data: r, keyword: s, it: n } = e, a = t.name("valid");
1412
+ if (n.allErrors) {
1413
+ const d = t.let("valid", !0);
1414
+ return i(() => t.assign(d, !1)), d;
1415
+ }
1416
+ return t.var(a, !0), i(() => t.break()), a;
1417
+ function i(d) {
1418
+ const u = t.const("len", (0, G._)`${r}.length`);
1419
+ t.forRange("i", 0, u, (l) => {
1420
+ e.subschema({
1421
+ keyword: s,
1422
+ dataProp: l,
1423
+ dataPropType: mr.Type.Num
1424
+ }, a), t.if((0, G.not)(a), d);
1425
+ });
1426
+ }
1427
+ }
1428
+ K.validateArray = ua;
1429
+ function fa(e) {
1430
+ const { gen: t, schema: r, keyword: s, it: n } = e;
1431
+ if (!Array.isArray(r))
1432
+ throw new Error("ajv implementation error");
1433
+ if (r.some((u) => (0, mr.alwaysValidSchema)(n, u)) && !n.opts.unevaluated)
1434
+ return;
1435
+ const i = t.let("valid", !1), d = t.name("_valid");
1436
+ t.block(() => r.forEach((u, l) => {
1437
+ const m = e.subschema({
1438
+ keyword: s,
1439
+ schemaProp: l,
1440
+ compositeRule: !0
1441
+ }, d);
1442
+ t.assign(i, (0, G._)`${i} || ${d}`), e.mergeValidEvaluated(m, d) || t.if((0, G.not)(i));
1443
+ })), e.result(i, () => e.reset(), () => e.error(!0));
1444
+ }
1445
+ K.validateUnion = fa;
1446
+ Object.defineProperty(pe, "__esModule", { value: !0 });
1447
+ pe.validateKeywordUsage = pe.validSchemaType = pe.funcKeywordCode = pe.macroKeywordCode = void 0;
1448
+ const ee = A, Re = ye, ma = K, ha = ut;
1449
+ function pa(e, t) {
1450
+ const { gen: r, keyword: s, schema: n, parentSchema: a, it: i } = e, d = t.macro.call(i.self, n, a, i), u = Ys(r, s, d);
1451
+ i.opts.validateSchema !== !1 && i.self.validateSchema(d, !0);
1452
+ const l = r.name("valid");
1453
+ e.subschema({
1454
+ schema: d,
1455
+ schemaPath: ee.nil,
1456
+ errSchemaPath: `${i.errSchemaPath}/${s}`,
1457
+ topSchemaRef: u,
1458
+ compositeRule: !0
1459
+ }, l), e.pass(l, () => e.error(!0));
1460
+ }
1461
+ pe.macroKeywordCode = pa;
1462
+ function ya(e, t) {
1463
+ var r;
1464
+ const { gen: s, keyword: n, schema: a, parentSchema: i, $data: d, it: u } = e;
1465
+ va(u, t);
1466
+ const l = !d && t.compile ? t.compile.call(u.self, a, i, u) : t.validate, m = Ys(s, n, l), y = s.let("valid");
1467
+ e.block$data(y, b), e.ok((r = t.valid) !== null && r !== void 0 ? r : y);
1468
+ function b() {
1469
+ if (t.errors === !1)
1470
+ v(), t.modifying && ss(e), h(() => e.error());
1471
+ else {
1472
+ const f = t.async ? E() : g();
1473
+ t.modifying && ss(e), h(() => _a(e, f));
1474
+ }
1475
+ }
1476
+ function E() {
1477
+ const f = s.let("ruleErrs", null);
1478
+ return s.try(() => v((0, ee._)`await `), ($) => s.assign(y, !1).if((0, ee._)`${$} instanceof ${u.ValidationError}`, () => s.assign(f, (0, ee._)`${$}.errors`), () => s.throw($))), f;
1479
+ }
1480
+ function g() {
1481
+ const f = (0, ee._)`${m}.errors`;
1482
+ return s.assign(f, null), v(ee.nil), f;
1483
+ }
1484
+ function v(f = t.async ? (0, ee._)`await ` : ee.nil) {
1485
+ const $ = u.opts.passContext ? Re.default.this : Re.default.self, P = !("compile" in t && !d || t.schema === !1);
1486
+ s.assign(y, (0, ee._)`${f}${(0, ma.callValidateCode)(e, m, $, P)}`, t.modifying);
1487
+ }
1488
+ function h(f) {
1489
+ var $;
1490
+ s.if((0, ee.not)(($ = t.valid) !== null && $ !== void 0 ? $ : y), f);
1491
+ }
1492
+ }
1493
+ pe.funcKeywordCode = ya;
1494
+ function ss(e) {
1495
+ const { gen: t, data: r, it: s } = e;
1496
+ t.if(s.parentData, () => t.assign(r, (0, ee._)`${s.parentData}[${s.parentDataProperty}]`));
1497
+ }
1498
+ function _a(e, t) {
1499
+ const { gen: r } = e;
1500
+ r.if((0, ee._)`Array.isArray(${t})`, () => {
1501
+ r.assign(Re.default.vErrors, (0, ee._)`${Re.default.vErrors} === null ? ${t} : ${Re.default.vErrors}.concat(${t})`).assign(Re.default.errors, (0, ee._)`${Re.default.vErrors}.length`), (0, ha.extendErrors)(e);
1502
+ }, () => e.error());
1503
+ }
1504
+ function va({ schemaEnv: e }, t) {
1505
+ if (t.async && !e.$async)
1506
+ throw new Error("async keyword in sync schema");
1507
+ }
1508
+ function Ys(e, t, r) {
1509
+ if (r === void 0)
1510
+ throw new Error(`keyword "${t}" failed to compile`);
1511
+ return e.scopeValue("keyword", typeof r == "function" ? { ref: r } : { ref: r, code: (0, ee.stringify)(r) });
1512
+ }
1513
+ function $a(e, t, r = !1) {
1514
+ return !t.length || t.some((s) => s === "array" ? Array.isArray(e) : s === "object" ? e && typeof e == "object" && !Array.isArray(e) : typeof e == s || r && typeof e > "u");
1515
+ }
1516
+ pe.validSchemaType = $a;
1517
+ function ga({ schema: e, opts: t, self: r, errSchemaPath: s }, n, a) {
1518
+ if (Array.isArray(n.keyword) ? !n.keyword.includes(a) : n.keyword !== a)
1519
+ throw new Error("ajv implementation error");
1520
+ const i = n.dependencies;
1521
+ if (i != null && i.some((d) => !Object.prototype.hasOwnProperty.call(e, d)))
1522
+ throw new Error(`parent schema must have dependencies of ${a}: ${i.join(",")}`);
1523
+ if (n.validateSchema && !n.validateSchema(e[a])) {
1524
+ const u = `keyword "${a}" value is invalid at path "${s}": ` + r.errorsText(n.validateSchema.errors);
1525
+ if (t.validateSchema === "log")
1526
+ r.logger.error(u);
1527
+ else
1528
+ throw new Error(u);
1529
+ }
1530
+ }
1531
+ pe.validateKeywordUsage = ga;
1532
+ var Ne = {};
1533
+ Object.defineProperty(Ne, "__esModule", { value: !0 });
1534
+ Ne.extendSubschemaMode = Ne.extendSubschemaData = Ne.getSubschema = void 0;
1535
+ const he = A, Zs = N;
1536
+ function wa(e, { keyword: t, schemaProp: r, schema: s, schemaPath: n, errSchemaPath: a, topSchemaRef: i }) {
1537
+ if (t !== void 0 && s !== void 0)
1538
+ throw new Error('both "keyword" and "schema" passed, only one allowed');
1539
+ if (t !== void 0) {
1540
+ const d = e.schema[t];
1541
+ return r === void 0 ? {
1542
+ schema: d,
1543
+ schemaPath: (0, he._)`${e.schemaPath}${(0, he.getProperty)(t)}`,
1544
+ errSchemaPath: `${e.errSchemaPath}/${t}`
1545
+ } : {
1546
+ schema: d[r],
1547
+ schemaPath: (0, he._)`${e.schemaPath}${(0, he.getProperty)(t)}${(0, he.getProperty)(r)}`,
1548
+ errSchemaPath: `${e.errSchemaPath}/${t}/${(0, Zs.escapeFragment)(r)}`
1549
+ };
1550
+ }
1551
+ if (s !== void 0) {
1552
+ if (n === void 0 || a === void 0 || i === void 0)
1553
+ throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
1554
+ return {
1555
+ schema: s,
1556
+ schemaPath: n,
1557
+ topSchemaRef: i,
1558
+ errSchemaPath: a
1559
+ };
1560
+ }
1561
+ throw new Error('either "keyword" or "schema" must be passed');
1562
+ }
1563
+ Ne.getSubschema = wa;
1564
+ function ba(e, t, { dataProp: r, dataPropType: s, data: n, dataTypes: a, propertyName: i }) {
1565
+ if (n !== void 0 && r !== void 0)
1566
+ throw new Error('both "data" and "dataProp" passed, only one allowed');
1567
+ const { gen: d } = t;
1568
+ if (r !== void 0) {
1569
+ const { errorPath: l, dataPathArr: m, opts: y } = t, b = d.let("data", (0, he._)`${t.data}${(0, he.getProperty)(r)}`, !0);
1570
+ u(b), e.errorPath = (0, he.str)`${l}${(0, Zs.getErrorPath)(r, s, y.jsPropertySyntax)}`, e.parentDataProperty = (0, he._)`${r}`, e.dataPathArr = [...m, e.parentDataProperty];
1571
+ }
1572
+ if (n !== void 0) {
1573
+ const l = n instanceof he.Name ? n : d.let("data", n, !0);
1574
+ u(l), i !== void 0 && (e.propertyName = i);
1575
+ }
1576
+ a && (e.dataTypes = a);
1577
+ function u(l) {
1578
+ e.data = l, e.dataLevel = t.dataLevel + 1, e.dataTypes = [], t.definedProperties = /* @__PURE__ */ new Set(), e.parentData = t.data, e.dataNames = [...t.dataNames, l];
1579
+ }
1580
+ }
1581
+ Ne.extendSubschemaData = ba;
1582
+ function Ea(e, { jtdDiscriminator: t, jtdMetadata: r, compositeRule: s, createErrors: n, allErrors: a }) {
1583
+ s !== void 0 && (e.compositeRule = s), n !== void 0 && (e.createErrors = n), a !== void 0 && (e.allErrors = a), e.jtdDiscriminator = t, e.jtdMetadata = r;
1584
+ }
1585
+ Ne.extendSubschemaMode = Ea;
1586
+ var Z = {};
1587
+ Object.defineProperty(Z, "__esModule", { value: !0 });
1588
+ Z.getSchemaRefs = Z.resolveUrl = Z.normalizeId = Z._getFullPath = Z.getFullPath = Z.inlineRef = void 0;
1589
+ const Sa = N, Pa = Ps, ka = Tn, Na = /* @__PURE__ */ new Set([
1590
+ "type",
1591
+ "format",
1592
+ "pattern",
1593
+ "maxLength",
1594
+ "minLength",
1595
+ "maxProperties",
1596
+ "minProperties",
1597
+ "maxItems",
1598
+ "minItems",
1599
+ "maximum",
1600
+ "minimum",
1601
+ "uniqueItems",
1602
+ "multipleOf",
1603
+ "required",
1604
+ "enum",
1605
+ "const"
1606
+ ]);
1607
+ function Ca(e, t = !0) {
1608
+ return typeof e == "boolean" ? !0 : t === !0 ? !or(e) : t ? Ds(e) <= t : !1;
1609
+ }
1610
+ Z.inlineRef = Ca;
1611
+ const ja = /* @__PURE__ */ new Set([
1612
+ "$ref",
1613
+ "$recursiveRef",
1614
+ "$recursiveAnchor",
1615
+ "$dynamicRef",
1616
+ "$dynamicAnchor"
1617
+ ]);
1618
+ function or(e) {
1619
+ for (const t in e) {
1620
+ if (ja.has(t))
1621
+ return !0;
1622
+ const r = e[t];
1623
+ if (Array.isArray(r) && r.some(or) || typeof r == "object" && or(r))
1624
+ return !0;
1625
+ }
1626
+ return !1;
1627
+ }
1628
+ function Ds(e) {
1629
+ let t = 0;
1630
+ for (const r in e) {
1631
+ if (r === "$ref")
1632
+ return 1 / 0;
1633
+ if (t++, !Na.has(r) && (typeof e[r] == "object" && (0, Sa.eachItem)(e[r], (s) => t += Ds(s)), t === 1 / 0))
1634
+ return 1 / 0;
1635
+ }
1636
+ return t;
1637
+ }
1638
+ function Ws(e, t = "", r) {
1639
+ r !== !1 && (t = He(t));
1640
+ const s = e.parse(t);
1641
+ return xs(e, s);
1642
+ }
1643
+ Z.getFullPath = Ws;
1644
+ function xs(e, t) {
1645
+ return e.serialize(t).split("#")[0] + "#";
1646
+ }
1647
+ Z._getFullPath = xs;
1648
+ const Ra = /#\/?$/;
1649
+ function He(e) {
1650
+ return e ? e.replace(Ra, "") : "";
1651
+ }
1652
+ Z.normalizeId = He;
1653
+ function Oa(e, t, r) {
1654
+ return r = He(r), e.resolve(t, r);
1655
+ }
1656
+ Z.resolveUrl = Oa;
1657
+ const Ta = /^[a-z_][-a-z0-9._]*$/i;
1658
+ function Ia(e, t) {
1659
+ if (typeof e == "boolean")
1660
+ return {};
1661
+ const { schemaId: r, uriResolver: s } = this.opts, n = He(e[r] || t), a = { "": n }, i = Ws(s, n, !1), d = {}, u = /* @__PURE__ */ new Set();
1662
+ return ka(e, { allKeys: !0 }, (y, b, E, g) => {
1663
+ if (g === void 0)
1664
+ return;
1665
+ const v = i + b;
1666
+ let h = a[g];
1667
+ typeof y[r] == "string" && (h = f.call(this, y[r])), $.call(this, y.$anchor), $.call(this, y.$dynamicAnchor), a[b] = h;
1668
+ function f(P) {
1669
+ const j = this.opts.uriResolver.resolve;
1670
+ if (P = He(h ? j(h, P) : P), u.has(P))
1671
+ throw m(P);
1672
+ u.add(P);
1673
+ let C = this.refs[P];
1674
+ return typeof C == "string" && (C = this.refs[C]), typeof C == "object" ? l(y, C.schema, P) : P !== He(v) && (P[0] === "#" ? (l(y, d[P], P), d[P] = y) : this.refs[P] = v), P;
1675
+ }
1676
+ function $(P) {
1677
+ if (typeof P == "string") {
1678
+ if (!Ta.test(P))
1679
+ throw new Error(`invalid anchor "${P}"`);
1680
+ f.call(this, `#${P}`);
1681
+ }
1682
+ }
1683
+ }), d;
1684
+ function l(y, b, E) {
1685
+ if (b !== void 0 && !Pa(y, b))
1686
+ throw m(E);
1687
+ }
1688
+ function m(y) {
1689
+ return new Error(`reference "${y}" resolves to more than one schema`);
1690
+ }
1691
+ }
1692
+ Z.getSchemaRefs = Ia;
1693
+ Object.defineProperty(fe, "__esModule", { value: !0 });
1694
+ fe.getData = fe.KeywordCxt = fe.validateFunctionCode = void 0;
1695
+ const en = Be, ns = X, yr = ge, St = X, Ma = jt, nt = pe, Bt = Ne, T = A, M = ye, Va = Z, we = N, et = ut;
1696
+ function Fa(e) {
1697
+ if (sn(e) && (nn(e), rn(e))) {
1698
+ qa(e);
1699
+ return;
1700
+ }
1701
+ tn(e, () => (0, en.topBoolOrEmptySchema)(e));
1702
+ }
1703
+ fe.validateFunctionCode = Fa;
1704
+ function tn({ gen: e, validateName: t, schema: r, schemaEnv: s, opts: n }, a) {
1705
+ n.code.es5 ? e.func(t, (0, T._)`${M.default.data}, ${M.default.valCxt}`, s.$async, () => {
1706
+ e.code((0, T._)`"use strict"; ${os(r, n)}`), Aa(e, n), e.code(a);
1707
+ }) : e.func(t, (0, T._)`${M.default.data}, ${Ka(n)}`, s.$async, () => e.code(os(r, n)).code(a));
1708
+ }
1709
+ function Ka(e) {
1710
+ return (0, T._)`{${M.default.instancePath}="", ${M.default.parentData}, ${M.default.parentDataProperty}, ${M.default.rootData}=${M.default.data}${e.dynamicRef ? (0, T._)`, ${M.default.dynamicAnchors}={}` : T.nil}}={}`;
1711
+ }
1712
+ function Aa(e, t) {
1713
+ e.if(M.default.valCxt, () => {
1714
+ e.var(M.default.instancePath, (0, T._)`${M.default.valCxt}.${M.default.instancePath}`), e.var(M.default.parentData, (0, T._)`${M.default.valCxt}.${M.default.parentData}`), e.var(M.default.parentDataProperty, (0, T._)`${M.default.valCxt}.${M.default.parentDataProperty}`), e.var(M.default.rootData, (0, T._)`${M.default.valCxt}.${M.default.rootData}`), t.dynamicRef && e.var(M.default.dynamicAnchors, (0, T._)`${M.default.valCxt}.${M.default.dynamicAnchors}`);
1715
+ }, () => {
1716
+ e.var(M.default.instancePath, (0, T._)`""`), e.var(M.default.parentData, (0, T._)`undefined`), e.var(M.default.parentDataProperty, (0, T._)`undefined`), e.var(M.default.rootData, M.default.data), t.dynamicRef && e.var(M.default.dynamicAnchors, (0, T._)`{}`);
1717
+ });
1718
+ }
1719
+ function qa(e) {
1720
+ const { schema: t, opts: r, gen: s } = e;
1721
+ tn(e, () => {
1722
+ r.$comment && t.$comment && an(e), Ja(e), s.let(M.default.vErrors, null), s.let(M.default.errors, 0), r.unevaluated && za(e), on(e), Qa(e);
1723
+ });
1724
+ }
1725
+ function za(e) {
1726
+ const { gen: t, validateName: r } = e;
1727
+ e.evaluated = t.const("evaluated", (0, T._)`${r}.evaluated`), t.if((0, T._)`${e.evaluated}.dynamicProps`, () => t.assign((0, T._)`${e.evaluated}.props`, (0, T._)`undefined`)), t.if((0, T._)`${e.evaluated}.dynamicItems`, () => t.assign((0, T._)`${e.evaluated}.items`, (0, T._)`undefined`));
1728
+ }
1729
+ function os(e, t) {
1730
+ const r = typeof e == "object" && e[t.schemaId];
1731
+ return r && (t.code.source || t.code.process) ? (0, T._)`/*# sourceURL=${r} */` : T.nil;
1732
+ }
1733
+ function Ua(e, t) {
1734
+ if (sn(e) && (nn(e), rn(e))) {
1735
+ La(e, t);
1736
+ return;
1737
+ }
1738
+ (0, en.boolOrEmptySchema)(e, t);
1739
+ }
1740
+ function rn({ schema: e, self: t }) {
1741
+ if (typeof e == "boolean")
1742
+ return !e;
1743
+ for (const r in e)
1744
+ if (t.RULES.all[r])
1745
+ return !0;
1746
+ return !1;
1747
+ }
1748
+ function sn(e) {
1749
+ return typeof e.schema != "boolean";
1750
+ }
1751
+ function La(e, t) {
1752
+ const { schema: r, gen: s, opts: n } = e;
1753
+ n.$comment && r.$comment && an(e), Ha(e), Ba(e);
1754
+ const a = s.const("_errs", M.default.errors);
1755
+ on(e, a), s.var(t, (0, T._)`${a} === ${M.default.errors}`);
1756
+ }
1757
+ function nn(e) {
1758
+ (0, we.checkUnknownRules)(e), Ga(e);
1759
+ }
1760
+ function on(e, t) {
1761
+ if (e.opts.jtd)
1762
+ return as(e, [], !1, t);
1763
+ const r = (0, ns.getSchemaTypes)(e.schema), s = (0, ns.coerceAndCheckDataType)(e, r);
1764
+ as(e, r, !s, t);
1765
+ }
1766
+ function Ga(e) {
1767
+ const { schema: t, errSchemaPath: r, opts: s, self: n } = e;
1768
+ t.$ref && s.ignoreKeywordsWithRef && (0, we.schemaHasRulesButRef)(t, n.RULES) && n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`);
1769
+ }
1770
+ function Ja(e) {
1771
+ const { schema: t, opts: r } = e;
1772
+ t.default !== void 0 && r.useDefaults && r.strictSchema && (0, we.checkStrictMode)(e, "default is ignored in the schema root");
1773
+ }
1774
+ function Ha(e) {
1775
+ const t = e.schema[e.opts.schemaId];
1776
+ t && (e.baseId = (0, Va.resolveUrl)(e.opts.uriResolver, e.baseId, t));
1777
+ }
1778
+ function Ba(e) {
1779
+ if (e.schema.$async && !e.schemaEnv.$async)
1780
+ throw new Error("async schema in sync schema");
1781
+ }
1782
+ function an({ gen: e, schemaEnv: t, schema: r, errSchemaPath: s, opts: n }) {
1783
+ const a = r.$comment;
1784
+ if (n.$comment === !0)
1785
+ e.code((0, T._)`${M.default.self}.logger.log(${a})`);
1786
+ else if (typeof n.$comment == "function") {
1787
+ const i = (0, T.str)`${s}/$comment`, d = e.scopeValue("root", { ref: t.root });
1788
+ e.code((0, T._)`${M.default.self}.opts.$comment(${a}, ${i}, ${d}.schema)`);
1789
+ }
1790
+ }
1791
+ function Qa(e) {
1792
+ const { gen: t, schemaEnv: r, validateName: s, ValidationError: n, opts: a } = e;
1793
+ r.$async ? t.if((0, T._)`${M.default.errors} === 0`, () => t.return(M.default.data), () => t.throw((0, T._)`new ${n}(${M.default.vErrors})`)) : (t.assign((0, T._)`${s}.errors`, M.default.vErrors), a.unevaluated && Xa(e), t.return((0, T._)`${M.default.errors} === 0`));
1794
+ }
1795
+ function Xa({ gen: e, evaluated: t, props: r, items: s }) {
1796
+ r instanceof T.Name && e.assign((0, T._)`${t}.props`, r), s instanceof T.Name && e.assign((0, T._)`${t}.items`, s);
1797
+ }
1798
+ function as(e, t, r, s) {
1799
+ const { gen: n, schema: a, data: i, allErrors: d, opts: u, self: l } = e, { RULES: m } = l;
1800
+ if (a.$ref && (u.ignoreKeywordsWithRef || !(0, we.schemaHasRulesButRef)(a, m))) {
1801
+ n.block(() => dn(e, "$ref", m.all.$ref.definition));
1802
+ return;
1803
+ }
1804
+ u.jtd || Ya(e, t), n.block(() => {
1805
+ for (const b of m.rules)
1806
+ y(b);
1807
+ y(m.post);
1808
+ });
1809
+ function y(b) {
1810
+ (0, yr.shouldUseGroup)(a, b) && (b.type ? (n.if((0, St.checkDataType)(b.type, i, u.strictNumbers)), is(e, b), t.length === 1 && t[0] === b.type && r && (n.else(), (0, St.reportTypeError)(e)), n.endIf()) : is(e, b), d || n.if((0, T._)`${M.default.errors} === ${s || 0}`));
1811
+ }
1812
+ }
1813
+ function is(e, t) {
1814
+ const { gen: r, schema: s, opts: { useDefaults: n } } = e;
1815
+ n && (0, Ma.assignDefaults)(e, t.type), r.block(() => {
1816
+ for (const a of t.rules)
1817
+ (0, yr.shouldUseRule)(s, a) && dn(e, a.keyword, a.definition, t.type);
1818
+ });
1819
+ }
1820
+ function Ya(e, t) {
1821
+ e.schemaEnv.meta || !e.opts.strictTypes || (Za(e, t), e.opts.allowUnionTypes || Da(e, t), Wa(e, e.dataTypes));
1822
+ }
1823
+ function Za(e, t) {
1824
+ if (t.length) {
1825
+ if (!e.dataTypes.length) {
1826
+ e.dataTypes = t;
1827
+ return;
1828
+ }
1829
+ t.forEach((r) => {
1830
+ cn(e.dataTypes, r) || _r(e, `type "${r}" not allowed by context "${e.dataTypes.join(",")}"`);
1831
+ }), ei(e, t);
1832
+ }
1833
+ }
1834
+ function Da(e, t) {
1835
+ t.length > 1 && !(t.length === 2 && t.includes("null")) && _r(e, "use allowUnionTypes to allow union type keyword");
1836
+ }
1837
+ function Wa(e, t) {
1838
+ const r = e.self.RULES.all;
1839
+ for (const s in r) {
1840
+ const n = r[s];
1841
+ if (typeof n == "object" && (0, yr.shouldUseRule)(e.schema, n)) {
1842
+ const { type: a } = n.definition;
1843
+ a.length && !a.some((i) => xa(t, i)) && _r(e, `missing type "${a.join(",")}" for keyword "${s}"`);
1844
+ }
1845
+ }
1846
+ }
1847
+ function xa(e, t) {
1848
+ return e.includes(t) || t === "number" && e.includes("integer");
1849
+ }
1850
+ function cn(e, t) {
1851
+ return e.includes(t) || t === "integer" && e.includes("number");
1852
+ }
1853
+ function ei(e, t) {
1854
+ const r = [];
1855
+ for (const s of e.dataTypes)
1856
+ cn(t, s) ? r.push(s) : t.includes("integer") && s === "number" && r.push("integer");
1857
+ e.dataTypes = r;
1858
+ }
1859
+ function _r(e, t) {
1860
+ const r = e.schemaEnv.baseId + e.errSchemaPath;
1861
+ t += ` at "${r}" (strictTypes)`, (0, we.checkStrictMode)(e, t, e.opts.strictTypes);
1862
+ }
1863
+ class ln {
1864
+ constructor(t, r, s) {
1865
+ if ((0, nt.validateKeywordUsage)(t, r, s), this.gen = t.gen, this.allErrors = t.allErrors, this.keyword = s, this.data = t.data, this.schema = t.schema[s], this.$data = r.$data && t.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, we.schemaRefOrVal)(t, this.schema, s, this.$data), this.schemaType = r.schemaType, this.parentSchema = t.schema, this.params = {}, this.it = t, this.def = r, this.$data)
1866
+ this.schemaCode = t.gen.const("vSchema", un(this.$data, t));
1867
+ else if (this.schemaCode = this.schemaValue, !(0, nt.validSchemaType)(this.schema, r.schemaType, r.allowUndefined))
1868
+ throw new Error(`${s} value must be ${JSON.stringify(r.schemaType)}`);
1869
+ ("code" in r ? r.trackErrors : r.errors !== !1) && (this.errsCount = t.gen.const("_errs", M.default.errors));
1870
+ }
1871
+ result(t, r, s) {
1872
+ this.failResult((0, T.not)(t), r, s);
1873
+ }
1874
+ failResult(t, r, s) {
1875
+ this.gen.if(t), s ? s() : this.error(), r ? (this.gen.else(), r(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else();
1876
+ }
1877
+ pass(t, r) {
1878
+ this.failResult((0, T.not)(t), void 0, r);
1879
+ }
1880
+ fail(t) {
1881
+ if (t === void 0) {
1882
+ this.error(), this.allErrors || this.gen.if(!1);
1883
+ return;
1884
+ }
1885
+ this.gen.if(t), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else();
1886
+ }
1887
+ fail$data(t) {
1888
+ if (!this.$data)
1889
+ return this.fail(t);
1890
+ const { schemaCode: r } = this;
1891
+ this.fail((0, T._)`${r} !== undefined && (${(0, T.or)(this.invalid$data(), t)})`);
1892
+ }
1893
+ error(t, r, s) {
1894
+ if (r) {
1895
+ this.setParams(r), this._error(t, s), this.setParams({});
1896
+ return;
1897
+ }
1898
+ this._error(t, s);
1899
+ }
1900
+ _error(t, r) {
1901
+ (t ? et.reportExtraError : et.reportError)(this, this.def.error, r);
1902
+ }
1903
+ $dataError() {
1904
+ (0, et.reportError)(this, this.def.$dataError || et.keyword$DataError);
1905
+ }
1906
+ reset() {
1907
+ if (this.errsCount === void 0)
1908
+ throw new Error('add "trackErrors" to keyword definition');
1909
+ (0, et.resetErrorsCount)(this.gen, this.errsCount);
1910
+ }
1911
+ ok(t) {
1912
+ this.allErrors || this.gen.if(t);
1913
+ }
1914
+ setParams(t, r) {
1915
+ r ? Object.assign(this.params, t) : this.params = t;
1916
+ }
1917
+ block$data(t, r, s = T.nil) {
1918
+ this.gen.block(() => {
1919
+ this.check$data(t, s), r();
1920
+ });
1921
+ }
1922
+ check$data(t = T.nil, r = T.nil) {
1923
+ if (!this.$data)
1924
+ return;
1925
+ const { gen: s, schemaCode: n, schemaType: a, def: i } = this;
1926
+ s.if((0, T.or)((0, T._)`${n} === undefined`, r)), t !== T.nil && s.assign(t, !0), (a.length || i.validateSchema) && (s.elseIf(this.invalid$data()), this.$dataError(), t !== T.nil && s.assign(t, !1)), s.else();
1927
+ }
1928
+ invalid$data() {
1929
+ const { gen: t, schemaCode: r, schemaType: s, def: n, it: a } = this;
1930
+ return (0, T.or)(i(), d());
1931
+ function i() {
1932
+ if (s.length) {
1933
+ if (!(r instanceof T.Name))
1934
+ throw new Error("ajv implementation error");
1935
+ const u = Array.isArray(s) ? s : [s];
1936
+ return (0, T._)`${(0, St.checkDataTypes)(u, r, a.opts.strictNumbers, St.DataType.Wrong)}`;
1937
+ }
1938
+ return T.nil;
1939
+ }
1940
+ function d() {
1941
+ if (n.validateSchema) {
1942
+ const u = t.scopeValue("validate$data", { ref: n.validateSchema });
1943
+ return (0, T._)`!${u}(${r})`;
1944
+ }
1945
+ return T.nil;
1946
+ }
1947
+ }
1948
+ subschema(t, r) {
1949
+ const s = (0, Bt.getSubschema)(this.it, t);
1950
+ (0, Bt.extendSubschemaData)(s, this.it, t), (0, Bt.extendSubschemaMode)(s, t);
1951
+ const n = { ...this.it, ...s, items: void 0, props: void 0 };
1952
+ return Ua(n, r), n;
1953
+ }
1954
+ mergeEvaluated(t, r) {
1955
+ const { it: s, gen: n } = this;
1956
+ s.opts.unevaluated && (s.props !== !0 && t.props !== void 0 && (s.props = we.mergeEvaluated.props(n, t.props, s.props, r)), s.items !== !0 && t.items !== void 0 && (s.items = we.mergeEvaluated.items(n, t.items, s.items, r)));
1957
+ }
1958
+ mergeValidEvaluated(t, r) {
1959
+ const { it: s, gen: n } = this;
1960
+ if (s.opts.unevaluated && (s.props !== !0 || s.items !== !0))
1961
+ return n.if(r, () => this.mergeEvaluated(t, T.Name)), !0;
1962
+ }
1963
+ }
1964
+ fe.KeywordCxt = ln;
1965
+ function dn(e, t, r, s) {
1966
+ const n = new ln(e, r, t);
1967
+ "code" in r ? r.code(n, s) : n.$data && r.validate ? (0, nt.funcKeywordCode)(n, r) : "macro" in r ? (0, nt.macroKeywordCode)(n, r) : (r.compile || r.validate) && (0, nt.funcKeywordCode)(n, r);
1968
+ }
1969
+ const ti = /^\/(?:[^~]|~0|~1)*$/, ri = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
1970
+ function un(e, { dataLevel: t, dataNames: r, dataPathArr: s }) {
1971
+ let n, a;
1972
+ if (e === "")
1973
+ return M.default.rootData;
1974
+ if (e[0] === "/") {
1975
+ if (!ti.test(e))
1976
+ throw new Error(`Invalid JSON-pointer: ${e}`);
1977
+ n = e, a = M.default.rootData;
1978
+ } else {
1979
+ const l = ri.exec(e);
1980
+ if (!l)
1981
+ throw new Error(`Invalid JSON-pointer: ${e}`);
1982
+ const m = +l[1];
1983
+ if (n = l[2], n === "#") {
1984
+ if (m >= t)
1985
+ throw new Error(u("property/index", m));
1986
+ return s[t - m];
1987
+ }
1988
+ if (m > t)
1989
+ throw new Error(u("data", m));
1990
+ if (a = r[t - m], !n)
1991
+ return a;
1992
+ }
1993
+ let i = a;
1994
+ const d = n.split("/");
1995
+ for (const l of d)
1996
+ l && (a = (0, T._)`${a}${(0, T.getProperty)((0, we.unescapeJsonPointer)(l))}`, i = (0, T._)`${i} && ${a}`);
1997
+ return i;
1998
+ function u(l, m) {
1999
+ return `Cannot access ${l} ${m} levels up, current level is ${t}`;
2000
+ }
2001
+ }
2002
+ fe.getData = un;
2003
+ var ft = {};
2004
+ Object.defineProperty(ft, "__esModule", { value: !0 });
2005
+ class si extends Error {
2006
+ constructor(t) {
2007
+ super("validation failed"), this.errors = t, this.ajv = this.validation = !0;
2008
+ }
2009
+ }
2010
+ ft.default = si;
2011
+ var Xe = {};
2012
+ Object.defineProperty(Xe, "__esModule", { value: !0 });
2013
+ const Qt = Z;
2014
+ class ni extends Error {
2015
+ constructor(t, r, s, n) {
2016
+ super(n || `can't resolve reference ${s} from id ${r}`), this.missingRef = (0, Qt.resolveUrl)(t, r, s), this.missingSchema = (0, Qt.normalizeId)((0, Qt.getFullPath)(t, this.missingRef));
2017
+ }
2018
+ }
2019
+ Xe.default = ni;
2020
+ var re = {};
2021
+ Object.defineProperty(re, "__esModule", { value: !0 });
2022
+ re.resolveSchema = re.getCompilingSchema = re.resolveRef = re.compileSchema = re.SchemaEnv = void 0;
2023
+ const ce = A, oi = ft, Ce = ye, ue = Z, cs = N, ai = fe;
2024
+ class Rt {
2025
+ constructor(t) {
2026
+ var r;
2027
+ this.refs = {}, this.dynamicAnchors = {};
2028
+ let s;
2029
+ typeof t.schema == "object" && (s = t.schema), this.schema = t.schema, this.schemaId = t.schemaId, this.root = t.root || this, this.baseId = (r = t.baseId) !== null && r !== void 0 ? r : (0, ue.normalizeId)(s == null ? void 0 : s[t.schemaId || "$id"]), this.schemaPath = t.schemaPath, this.localRefs = t.localRefs, this.meta = t.meta, this.$async = s == null ? void 0 : s.$async, this.refs = {};
2030
+ }
2031
+ }
2032
+ re.SchemaEnv = Rt;
2033
+ function vr(e) {
2034
+ const t = fn.call(this, e);
2035
+ if (t)
2036
+ return t;
2037
+ const r = (0, ue.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: s, lines: n } = this.opts.code, { ownProperties: a } = this.opts, i = new ce.CodeGen(this.scope, { es5: s, lines: n, ownProperties: a });
2038
+ let d;
2039
+ e.$async && (d = i.scopeValue("Error", {
2040
+ ref: oi.default,
2041
+ code: (0, ce._)`require("ajv/dist/runtime/validation_error").default`
2042
+ }));
2043
+ const u = i.scopeName("validate");
2044
+ e.validateName = u;
2045
+ const l = {
2046
+ gen: i,
2047
+ allErrors: this.opts.allErrors,
2048
+ data: Ce.default.data,
2049
+ parentData: Ce.default.parentData,
2050
+ parentDataProperty: Ce.default.parentDataProperty,
2051
+ dataNames: [Ce.default.data],
2052
+ dataPathArr: [ce.nil],
2053
+ // TODO can its length be used as dataLevel if nil is removed?
2054
+ dataLevel: 0,
2055
+ dataTypes: [],
2056
+ definedProperties: /* @__PURE__ */ new Set(),
2057
+ topSchemaRef: i.scopeValue("schema", this.opts.code.source === !0 ? { ref: e.schema, code: (0, ce.stringify)(e.schema) } : { ref: e.schema }),
2058
+ validateName: u,
2059
+ ValidationError: d,
2060
+ schema: e.schema,
2061
+ schemaEnv: e,
2062
+ rootId: r,
2063
+ baseId: e.baseId || r,
2064
+ schemaPath: ce.nil,
2065
+ errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"),
2066
+ errorPath: (0, ce._)`""`,
2067
+ opts: this.opts,
2068
+ self: this
2069
+ };
2070
+ let m;
2071
+ try {
2072
+ this._compilations.add(e), (0, ai.validateFunctionCode)(l), i.optimize(this.opts.code.optimize);
2073
+ const y = i.toString();
2074
+ m = `${i.scopeRefs(Ce.default.scope)}return ${y}`, this.opts.code.process && (m = this.opts.code.process(m, e));
2075
+ const E = new Function(`${Ce.default.self}`, `${Ce.default.scope}`, m)(this, this.scope.get());
2076
+ if (this.scope.value(u, { ref: E }), E.errors = null, E.schema = e.schema, E.schemaEnv = e, e.$async && (E.$async = !0), this.opts.code.source === !0 && (E.source = { validateName: u, validateCode: y, scopeValues: i._values }), this.opts.unevaluated) {
2077
+ const { props: g, items: v } = l;
2078
+ E.evaluated = {
2079
+ props: g instanceof ce.Name ? void 0 : g,
2080
+ items: v instanceof ce.Name ? void 0 : v,
2081
+ dynamicProps: g instanceof ce.Name,
2082
+ dynamicItems: v instanceof ce.Name
2083
+ }, E.source && (E.source.evaluated = (0, ce.stringify)(E.evaluated));
2084
+ }
2085
+ return e.validate = E, e;
2086
+ } catch (y) {
2087
+ throw delete e.validate, delete e.validateName, m && this.logger.error("Error compiling schema, function code:", m), y;
2088
+ } finally {
2089
+ this._compilations.delete(e);
2090
+ }
2091
+ }
2092
+ re.compileSchema = vr;
2093
+ function ii(e, t, r) {
2094
+ var s;
2095
+ r = (0, ue.resolveUrl)(this.opts.uriResolver, t, r);
2096
+ const n = e.refs[r];
2097
+ if (n)
2098
+ return n;
2099
+ let a = di.call(this, e, r);
2100
+ if (a === void 0) {
2101
+ const i = (s = e.localRefs) === null || s === void 0 ? void 0 : s[r], { schemaId: d } = this.opts;
2102
+ i && (a = new Rt({ schema: i, schemaId: d, root: e, baseId: t }));
2103
+ }
2104
+ if (a !== void 0)
2105
+ return e.refs[r] = ci.call(this, a);
2106
+ }
2107
+ re.resolveRef = ii;
2108
+ function ci(e) {
2109
+ return (0, ue.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : vr.call(this, e);
2110
+ }
2111
+ function fn(e) {
2112
+ for (const t of this._compilations)
2113
+ if (li(t, e))
2114
+ return t;
2115
+ }
2116
+ re.getCompilingSchema = fn;
2117
+ function li(e, t) {
2118
+ return e.schema === t.schema && e.root === t.root && e.baseId === t.baseId;
2119
+ }
2120
+ function di(e, t) {
2121
+ let r;
2122
+ for (; typeof (r = this.refs[t]) == "string"; )
2123
+ t = r;
2124
+ return r || this.schemas[t] || Ot.call(this, e, t);
2125
+ }
2126
+ function Ot(e, t) {
2127
+ const r = this.opts.uriResolver.parse(t), s = (0, ue._getFullPath)(this.opts.uriResolver, r);
2128
+ let n = (0, ue.getFullPath)(this.opts.uriResolver, e.baseId, void 0);
2129
+ if (Object.keys(e.schema).length > 0 && s === n)
2130
+ return Xt.call(this, r, e);
2131
+ const a = (0, ue.normalizeId)(s), i = this.refs[a] || this.schemas[a];
2132
+ if (typeof i == "string") {
2133
+ const d = Ot.call(this, e, i);
2134
+ return typeof (d == null ? void 0 : d.schema) != "object" ? void 0 : Xt.call(this, r, d);
2135
+ }
2136
+ if (typeof (i == null ? void 0 : i.schema) == "object") {
2137
+ if (i.validate || vr.call(this, i), a === (0, ue.normalizeId)(t)) {
2138
+ const { schema: d } = i, { schemaId: u } = this.opts, l = d[u];
2139
+ return l && (n = (0, ue.resolveUrl)(this.opts.uriResolver, n, l)), new Rt({ schema: d, schemaId: u, root: e, baseId: n });
2140
+ }
2141
+ return Xt.call(this, r, i);
2142
+ }
2143
+ }
2144
+ re.resolveSchema = Ot;
2145
+ const ui = /* @__PURE__ */ new Set([
2146
+ "properties",
2147
+ "patternProperties",
2148
+ "enum",
2149
+ "dependencies",
2150
+ "definitions"
2151
+ ]);
2152
+ function Xt(e, { baseId: t, schema: r, root: s }) {
2153
+ var n;
2154
+ if (((n = e.fragment) === null || n === void 0 ? void 0 : n[0]) !== "/")
2155
+ return;
2156
+ for (const d of e.fragment.slice(1).split("/")) {
2157
+ if (typeof r == "boolean")
2158
+ return;
2159
+ const u = r[(0, cs.unescapeFragment)(d)];
2160
+ if (u === void 0)
2161
+ return;
2162
+ r = u;
2163
+ const l = typeof r == "object" && r[this.opts.schemaId];
2164
+ !ui.has(d) && l && (t = (0, ue.resolveUrl)(this.opts.uriResolver, t, l));
2165
+ }
2166
+ let a;
2167
+ if (typeof r != "boolean" && r.$ref && !(0, cs.schemaHasRulesButRef)(r, this.RULES)) {
2168
+ const d = (0, ue.resolveUrl)(this.opts.uriResolver, t, r.$ref);
2169
+ a = Ot.call(this, s, d);
2170
+ }
2171
+ const { schemaId: i } = this.opts;
2172
+ if (a = a || new Rt({ schema: r, schemaId: i, root: s, baseId: t }), a.schema !== a.root.schema)
2173
+ return a;
2174
+ }
2175
+ const fi = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", mi = "Meta-schema for $data reference (JSON AnySchema extension proposal)", hi = "object", pi = [
2176
+ "$data"
2177
+ ], yi = {
2178
+ $data: {
2179
+ type: "string",
2180
+ anyOf: [
2181
+ {
2182
+ format: "relative-json-pointer"
2183
+ },
2184
+ {
2185
+ format: "json-pointer"
2186
+ }
2187
+ ]
2188
+ }
2189
+ }, _i = !1, vi = {
2190
+ $id: fi,
2191
+ description: mi,
2192
+ type: hi,
2193
+ required: pi,
2194
+ properties: yi,
2195
+ additionalProperties: _i
2196
+ };
2197
+ var $r = {};
2198
+ Object.defineProperty($r, "__esModule", { value: !0 });
2199
+ const mn = In;
2200
+ mn.code = 'require("ajv/dist/runtime/uri").default';
2201
+ $r.default = mn;
2202
+ (function(e) {
2203
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
2204
+ var t = fe;
2205
+ Object.defineProperty(e, "KeywordCxt", { enumerable: !0, get: function() {
2206
+ return t.KeywordCxt;
2207
+ } });
2208
+ var r = A;
2209
+ Object.defineProperty(e, "_", { enumerable: !0, get: function() {
2210
+ return r._;
2211
+ } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
2212
+ return r.str;
2213
+ } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() {
2214
+ return r.stringify;
2215
+ } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() {
2216
+ return r.nil;
2217
+ } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
2218
+ return r.Name;
2219
+ } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
2220
+ return r.CodeGen;
2221
+ } });
2222
+ const s = ft, n = Xe, a = Ie, i = re, d = A, u = Z, l = X, m = N, y = vi, b = $r, E = (k, p) => new RegExp(k, p);
2223
+ E.code = "new RegExp";
2224
+ const g = ["removeAdditional", "useDefaults", "coerceTypes"], v = /* @__PURE__ */ new Set([
2225
+ "validate",
2226
+ "serialize",
2227
+ "parse",
2228
+ "wrapper",
2229
+ "root",
2230
+ "schema",
2231
+ "keyword",
2232
+ "pattern",
2233
+ "formats",
2234
+ "validate$data",
2235
+ "func",
2236
+ "obj",
2237
+ "Error"
2238
+ ]), h = {
2239
+ errorDataPath: "",
2240
+ format: "`validateFormats: false` can be used instead.",
2241
+ nullable: '"nullable" keyword is supported by default.',
2242
+ jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
2243
+ extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
2244
+ missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
2245
+ processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
2246
+ sourceCode: "Use option `code: {source: true}`",
2247
+ strictDefaults: "It is default now, see option `strict`.",
2248
+ strictKeywords: "It is default now, see option `strict`.",
2249
+ uniqueItems: '"uniqueItems" keyword is always validated.',
2250
+ unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
2251
+ cache: "Map is used as cache, schema object as key.",
2252
+ serialize: "Map is used as cache, schema object as key.",
2253
+ ajvErrors: "It is default now."
2254
+ }, f = {
2255
+ ignoreKeywordsWithRef: "",
2256
+ jsPropertySyntax: "",
2257
+ unicode: '"minLength"/"maxLength" account for unicode characters by default.'
2258
+ }, $ = 200;
2259
+ function P(k) {
2260
+ var p, S, _, o, c, w, R, O, q, I, B, ve, De, $e, qe, Mt, Vt, Ft, Kt, At, qt, zt, Ut, Lt, Gt;
2261
+ const We = k.strict, Jt = (p = k.code) === null || p === void 0 ? void 0 : p.optimize, Wr = Jt === !0 || Jt === void 0 ? 1 : Jt || 0, xr = (_ = (S = k.code) === null || S === void 0 ? void 0 : S.regExp) !== null && _ !== void 0 ? _ : E, bn = (o = k.uriResolver) !== null && o !== void 0 ? o : b.default;
2262
+ return {
2263
+ strictSchema: (w = (c = k.strictSchema) !== null && c !== void 0 ? c : We) !== null && w !== void 0 ? w : !0,
2264
+ strictNumbers: (O = (R = k.strictNumbers) !== null && R !== void 0 ? R : We) !== null && O !== void 0 ? O : !0,
2265
+ strictTypes: (I = (q = k.strictTypes) !== null && q !== void 0 ? q : We) !== null && I !== void 0 ? I : "log",
2266
+ strictTuples: (ve = (B = k.strictTuples) !== null && B !== void 0 ? B : We) !== null && ve !== void 0 ? ve : "log",
2267
+ strictRequired: ($e = (De = k.strictRequired) !== null && De !== void 0 ? De : We) !== null && $e !== void 0 ? $e : !1,
2268
+ code: k.code ? { ...k.code, optimize: Wr, regExp: xr } : { optimize: Wr, regExp: xr },
2269
+ loopRequired: (qe = k.loopRequired) !== null && qe !== void 0 ? qe : $,
2270
+ loopEnum: (Mt = k.loopEnum) !== null && Mt !== void 0 ? Mt : $,
2271
+ meta: (Vt = k.meta) !== null && Vt !== void 0 ? Vt : !0,
2272
+ messages: (Ft = k.messages) !== null && Ft !== void 0 ? Ft : !0,
2273
+ inlineRefs: (Kt = k.inlineRefs) !== null && Kt !== void 0 ? Kt : !0,
2274
+ schemaId: (At = k.schemaId) !== null && At !== void 0 ? At : "$id",
2275
+ addUsedSchema: (qt = k.addUsedSchema) !== null && qt !== void 0 ? qt : !0,
2276
+ validateSchema: (zt = k.validateSchema) !== null && zt !== void 0 ? zt : !0,
2277
+ validateFormats: (Ut = k.validateFormats) !== null && Ut !== void 0 ? Ut : !0,
2278
+ unicodeRegExp: (Lt = k.unicodeRegExp) !== null && Lt !== void 0 ? Lt : !0,
2279
+ int32range: (Gt = k.int32range) !== null && Gt !== void 0 ? Gt : !0,
2280
+ uriResolver: bn
2281
+ };
2282
+ }
2283
+ class j {
2284
+ constructor(p = {}) {
2285
+ this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), p = this.opts = { ...p, ...P(p) };
2286
+ const { es5: S, lines: _ } = this.opts.code;
2287
+ this.scope = new d.ValueScope({ scope: {}, prefixes: v, es5: S, lines: _ }), this.logger = ie(p.logger);
2288
+ const o = p.validateFormats;
2289
+ p.validateFormats = !1, this.RULES = (0, a.getRules)(), C.call(this, h, p, "NOT SUPPORTED"), C.call(this, f, p, "DEPRECATED", "warn"), this._metaOpts = me.call(this), p.formats && ne.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), p.keywords && ae.call(this, p.keywords), typeof p.meta == "object" && this.addMetaSchema(p.meta), J.call(this), p.validateFormats = o;
2290
+ }
2291
+ _addVocabularies() {
2292
+ this.addKeyword("$async");
2293
+ }
2294
+ _addDefaultMetaSchema() {
2295
+ const { $data: p, meta: S, schemaId: _ } = this.opts;
2296
+ let o = y;
2297
+ _ === "id" && (o = { ...y }, o.id = o.$id, delete o.$id), S && p && this.addMetaSchema(o, o[_], !1);
2298
+ }
2299
+ defaultMeta() {
2300
+ const { meta: p, schemaId: S } = this.opts;
2301
+ return this.opts.defaultMeta = typeof p == "object" ? p[S] || p : void 0;
2302
+ }
2303
+ validate(p, S) {
2304
+ let _;
2305
+ if (typeof p == "string") {
2306
+ if (_ = this.getSchema(p), !_)
2307
+ throw new Error(`no schema with key or ref "${p}"`);
2308
+ } else
2309
+ _ = this.compile(p);
2310
+ const o = _(S);
2311
+ return "$async" in _ || (this.errors = _.errors), o;
2312
+ }
2313
+ compile(p, S) {
2314
+ const _ = this._addSchema(p, S);
2315
+ return _.validate || this._compileSchemaEnv(_);
2316
+ }
2317
+ compileAsync(p, S) {
2318
+ if (typeof this.opts.loadSchema != "function")
2319
+ throw new Error("options.loadSchema should be a function");
2320
+ const { loadSchema: _ } = this.opts;
2321
+ return o.call(this, p, S);
2322
+ async function o(I, B) {
2323
+ await c.call(this, I.$schema);
2324
+ const ve = this._addSchema(I, B);
2325
+ return ve.validate || w.call(this, ve);
2326
+ }
2327
+ async function c(I) {
2328
+ I && !this.getSchema(I) && await o.call(this, { $ref: I }, !0);
2329
+ }
2330
+ async function w(I) {
2331
+ try {
2332
+ return this._compileSchemaEnv(I);
2333
+ } catch (B) {
2334
+ if (!(B instanceof n.default))
2335
+ throw B;
2336
+ return R.call(this, B), await O.call(this, B.missingSchema), w.call(this, I);
2337
+ }
2338
+ }
2339
+ function R({ missingSchema: I, missingRef: B }) {
2340
+ if (this.refs[I])
2341
+ throw new Error(`AnySchema ${I} is loaded but ${B} cannot be resolved`);
2342
+ }
2343
+ async function O(I) {
2344
+ const B = await q.call(this, I);
2345
+ this.refs[I] || await c.call(this, B.$schema), this.refs[I] || this.addSchema(B, I, S);
2346
+ }
2347
+ async function q(I) {
2348
+ const B = this._loading[I];
2349
+ if (B)
2350
+ return B;
2351
+ try {
2352
+ return await (this._loading[I] = _(I));
2353
+ } finally {
2354
+ delete this._loading[I];
2355
+ }
2356
+ }
2357
+ }
2358
+ // Adds schema to the instance
2359
+ addSchema(p, S, _, o = this.opts.validateSchema) {
2360
+ if (Array.isArray(p)) {
2361
+ for (const w of p)
2362
+ this.addSchema(w, void 0, _, o);
2363
+ return this;
2364
+ }
2365
+ let c;
2366
+ if (typeof p == "object") {
2367
+ const { schemaId: w } = this.opts;
2368
+ if (c = p[w], c !== void 0 && typeof c != "string")
2369
+ throw new Error(`schema ${w} must be string`);
2370
+ }
2371
+ return S = (0, u.normalizeId)(S || c), this._checkUnique(S), this.schemas[S] = this._addSchema(p, _, S, o, !0), this;
2372
+ }
2373
+ // Add schema that will be used to validate other schemas
2374
+ // options in META_IGNORE_OPTIONS are alway set to false
2375
+ addMetaSchema(p, S, _ = this.opts.validateSchema) {
2376
+ return this.addSchema(p, S, !0, _), this;
2377
+ }
2378
+ // Validate schema against its meta-schema
2379
+ validateSchema(p, S) {
2380
+ if (typeof p == "boolean")
2381
+ return !0;
2382
+ let _;
2383
+ if (_ = p.$schema, _ !== void 0 && typeof _ != "string")
2384
+ throw new Error("$schema must be a string");
2385
+ if (_ = _ || this.opts.defaultMeta || this.defaultMeta(), !_)
2386
+ return this.logger.warn("meta-schema not available"), this.errors = null, !0;
2387
+ const o = this.validate(_, p);
2388
+ if (!o && S) {
2389
+ const c = "schema is invalid: " + this.errorsText();
2390
+ if (this.opts.validateSchema === "log")
2391
+ this.logger.error(c);
2392
+ else
2393
+ throw new Error(c);
2394
+ }
2395
+ return o;
2396
+ }
2397
+ // Get compiled schema by `key` or `ref`.
2398
+ // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
2399
+ getSchema(p) {
2400
+ let S;
2401
+ for (; typeof (S = U.call(this, p)) == "string"; )
2402
+ p = S;
2403
+ if (S === void 0) {
2404
+ const { schemaId: _ } = this.opts, o = new i.SchemaEnv({ schema: {}, schemaId: _ });
2405
+ if (S = i.resolveSchema.call(this, o, p), !S)
2406
+ return;
2407
+ this.refs[p] = S;
2408
+ }
2409
+ return S.validate || this._compileSchemaEnv(S);
2410
+ }
2411
+ // Remove cached schema(s).
2412
+ // If no parameter is passed all schemas but meta-schemas are removed.
2413
+ // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
2414
+ // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
2415
+ removeSchema(p) {
2416
+ if (p instanceof RegExp)
2417
+ return this._removeAllSchemas(this.schemas, p), this._removeAllSchemas(this.refs, p), this;
2418
+ switch (typeof p) {
2419
+ case "undefined":
2420
+ return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
2421
+ case "string": {
2422
+ const S = U.call(this, p);
2423
+ return typeof S == "object" && this._cache.delete(S.schema), delete this.schemas[p], delete this.refs[p], this;
2424
+ }
2425
+ case "object": {
2426
+ const S = p;
2427
+ this._cache.delete(S);
2428
+ let _ = p[this.opts.schemaId];
2429
+ return _ && (_ = (0, u.normalizeId)(_), delete this.schemas[_], delete this.refs[_]), this;
2430
+ }
2431
+ default:
2432
+ throw new Error("ajv.removeSchema: invalid parameter");
2433
+ }
2434
+ }
2435
+ // add "vocabulary" - a collection of keywords
2436
+ addVocabulary(p) {
2437
+ for (const S of p)
2438
+ this.addKeyword(S);
2439
+ return this;
2440
+ }
2441
+ addKeyword(p, S) {
2442
+ let _;
2443
+ if (typeof p == "string")
2444
+ _ = p, typeof S == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), S.keyword = _);
2445
+ else if (typeof p == "object" && S === void 0) {
2446
+ if (S = p, _ = S.keyword, Array.isArray(_) && !_.length)
2447
+ throw new Error("addKeywords: keyword must be string or non-empty array");
2448
+ } else
2449
+ throw new Error("invalid addKeywords parameters");
2450
+ if (H.call(this, _, S), !S)
2451
+ return (0, m.eachItem)(_, (c) => x.call(this, c)), this;
2452
+ Ke.call(this, S);
2453
+ const o = {
2454
+ ...S,
2455
+ type: (0, l.getJSONTypes)(S.type),
2456
+ schemaType: (0, l.getJSONTypes)(S.schemaType)
2457
+ };
2458
+ return (0, m.eachItem)(_, o.type.length === 0 ? (c) => x.call(this, c, o) : (c) => o.type.forEach((w) => x.call(this, c, o, w))), this;
2459
+ }
2460
+ getKeyword(p) {
2461
+ const S = this.RULES.all[p];
2462
+ return typeof S == "object" ? S.definition : !!S;
2463
+ }
2464
+ // Remove keyword
2465
+ removeKeyword(p) {
2466
+ const { RULES: S } = this;
2467
+ delete S.keywords[p], delete S.all[p];
2468
+ for (const _ of S.rules) {
2469
+ const o = _.rules.findIndex((c) => c.keyword === p);
2470
+ o >= 0 && _.rules.splice(o, 1);
2471
+ }
2472
+ return this;
2473
+ }
2474
+ // Add format
2475
+ addFormat(p, S) {
2476
+ return typeof S == "string" && (S = new RegExp(S)), this.formats[p] = S, this;
2477
+ }
2478
+ errorsText(p = this.errors, { separator: S = ", ", dataVar: _ = "data" } = {}) {
2479
+ return !p || p.length === 0 ? "No errors" : p.map((o) => `${_}${o.instancePath} ${o.message}`).reduce((o, c) => o + S + c);
2480
+ }
2481
+ $dataMetaSchema(p, S) {
2482
+ const _ = this.RULES.all;
2483
+ p = JSON.parse(JSON.stringify(p));
2484
+ for (const o of S) {
2485
+ const c = o.split("/").slice(1);
2486
+ let w = p;
2487
+ for (const R of c)
2488
+ w = w[R];
2489
+ for (const R in _) {
2490
+ const O = _[R];
2491
+ if (typeof O != "object")
2492
+ continue;
2493
+ const { $data: q } = O.definition, I = w[R];
2494
+ q && I && (w[R] = Ae(I));
2495
+ }
2496
+ }
2497
+ return p;
2498
+ }
2499
+ _removeAllSchemas(p, S) {
2500
+ for (const _ in p) {
2501
+ const o = p[_];
2502
+ (!S || S.test(_)) && (typeof o == "string" ? delete p[_] : o && !o.meta && (this._cache.delete(o.schema), delete p[_]));
2503
+ }
2504
+ }
2505
+ _addSchema(p, S, _, o = this.opts.validateSchema, c = this.opts.addUsedSchema) {
2506
+ let w;
2507
+ const { schemaId: R } = this.opts;
2508
+ if (typeof p == "object")
2509
+ w = p[R];
2510
+ else {
2511
+ if (this.opts.jtd)
2512
+ throw new Error("schema must be object");
2513
+ if (typeof p != "boolean")
2514
+ throw new Error("schema must be object or boolean");
2515
+ }
2516
+ let O = this._cache.get(p);
2517
+ if (O !== void 0)
2518
+ return O;
2519
+ _ = (0, u.normalizeId)(w || _);
2520
+ const q = u.getSchemaRefs.call(this, p, _);
2521
+ return O = new i.SchemaEnv({ schema: p, schemaId: R, meta: S, baseId: _, localRefs: q }), this._cache.set(O.schema, O), c && !_.startsWith("#") && (_ && this._checkUnique(_), this.refs[_] = O), o && this.validateSchema(p, !0), O;
2522
+ }
2523
+ _checkUnique(p) {
2524
+ if (this.schemas[p] || this.refs[p])
2525
+ throw new Error(`schema with key or id "${p}" already exists`);
2526
+ }
2527
+ _compileSchemaEnv(p) {
2528
+ if (p.meta ? this._compileMetaSchema(p) : i.compileSchema.call(this, p), !p.validate)
2529
+ throw new Error("ajv implementation error");
2530
+ return p.validate;
2531
+ }
2532
+ _compileMetaSchema(p) {
2533
+ const S = this.opts;
2534
+ this.opts = this._metaOpts;
2535
+ try {
2536
+ i.compileSchema.call(this, p);
2537
+ } finally {
2538
+ this.opts = S;
2539
+ }
2540
+ }
2541
+ }
2542
+ j.ValidationError = s.default, j.MissingRefError = n.default, e.default = j;
2543
+ function C(k, p, S, _ = "error") {
2544
+ for (const o in k) {
2545
+ const c = o;
2546
+ c in p && this.logger[_](`${S}: option ${o}. ${k[c]}`);
2547
+ }
2548
+ }
2549
+ function U(k) {
2550
+ return k = (0, u.normalizeId)(k), this.schemas[k] || this.refs[k];
2551
+ }
2552
+ function J() {
2553
+ const k = this.opts.schemas;
2554
+ if (k)
2555
+ if (Array.isArray(k))
2556
+ this.addSchema(k);
2557
+ else
2558
+ for (const p in k)
2559
+ this.addSchema(k[p], p);
2560
+ }
2561
+ function ne() {
2562
+ for (const k in this.opts.formats) {
2563
+ const p = this.opts.formats[k];
2564
+ p && this.addFormat(k, p);
2565
+ }
2566
+ }
2567
+ function ae(k) {
2568
+ if (Array.isArray(k)) {
2569
+ this.addVocabulary(k);
2570
+ return;
2571
+ }
2572
+ this.logger.warn("keywords option as map is deprecated, pass array");
2573
+ for (const p in k) {
2574
+ const S = k[p];
2575
+ S.keyword || (S.keyword = p), this.addKeyword(S);
2576
+ }
2577
+ }
2578
+ function me() {
2579
+ const k = { ...this.opts };
2580
+ for (const p of g)
2581
+ delete k[p];
2582
+ return k;
2583
+ }
2584
+ const be = { log() {
2585
+ }, warn() {
2586
+ }, error() {
2587
+ } };
2588
+ function ie(k) {
2589
+ if (k === !1)
2590
+ return be;
2591
+ if (k === void 0)
2592
+ return console;
2593
+ if (k.log && k.warn && k.error)
2594
+ return k;
2595
+ throw new Error("logger must implement log, warn and error methods");
2596
+ }
2597
+ const z = /^[a-z_$][a-z0-9_$:-]*$/i;
2598
+ function H(k, p) {
2599
+ const { RULES: S } = this;
2600
+ if ((0, m.eachItem)(k, (_) => {
2601
+ if (S.keywords[_])
2602
+ throw new Error(`Keyword ${_} is already defined`);
2603
+ if (!z.test(_))
2604
+ throw new Error(`Keyword ${_} has invalid name`);
2605
+ }), !!p && p.$data && !("code" in p || "validate" in p))
2606
+ throw new Error('$data keyword must have "code" or "validate" function');
2607
+ }
2608
+ function x(k, p, S) {
2609
+ var _;
2610
+ const o = p == null ? void 0 : p.post;
2611
+ if (S && o)
2612
+ throw new Error('keyword with "post" flag cannot have "type"');
2613
+ const { RULES: c } = this;
2614
+ let w = o ? c.post : c.rules.find(({ type: O }) => O === S);
2615
+ if (w || (w = { type: S, rules: [] }, c.rules.push(w)), c.keywords[k] = !0, !p)
2616
+ return;
2617
+ const R = {
2618
+ keyword: k,
2619
+ definition: {
2620
+ ...p,
2621
+ type: (0, l.getJSONTypes)(p.type),
2622
+ schemaType: (0, l.getJSONTypes)(p.schemaType)
2623
+ }
2624
+ };
2625
+ p.before ? Fe.call(this, w, R, p.before) : w.rules.push(R), c.all[k] = R, (_ = p.implements) === null || _ === void 0 || _.forEach((O) => this.addKeyword(O));
2626
+ }
2627
+ function Fe(k, p, S) {
2628
+ const _ = k.rules.findIndex((o) => o.keyword === S);
2629
+ _ >= 0 ? k.rules.splice(_, 0, p) : (k.rules.push(p), this.logger.warn(`rule ${S} is not defined`));
2630
+ }
2631
+ function Ke(k) {
2632
+ let { metaSchema: p } = k;
2633
+ p !== void 0 && (k.$data && this.opts.$data && (p = Ae(p)), k.validateSchema = this.compile(p, !0));
2634
+ }
2635
+ const _e = {
2636
+ $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
2637
+ };
2638
+ function Ae(k) {
2639
+ return { anyOf: [k, _e] };
2640
+ }
2641
+ })(Vs);
2642
+ var gr = {}, wr = {}, br = {};
2643
+ Object.defineProperty(br, "__esModule", { value: !0 });
2644
+ const $i = {
2645
+ keyword: "id",
2646
+ code() {
2647
+ throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
2648
+ }
2649
+ };
2650
+ br.default = $i;
2651
+ var Me = {};
2652
+ Object.defineProperty(Me, "__esModule", { value: !0 });
2653
+ Me.callRef = Me.getValidate = void 0;
2654
+ const gi = Xe, ls = K, te = A, Ue = ye, ds = re, yt = N, wi = {
2655
+ keyword: "$ref",
2656
+ schemaType: "string",
2657
+ code(e) {
2658
+ const { gen: t, schema: r, it: s } = e, { baseId: n, schemaEnv: a, validateName: i, opts: d, self: u } = s, { root: l } = a;
2659
+ if ((r === "#" || r === "#/") && n === l.baseId)
2660
+ return y();
2661
+ const m = ds.resolveRef.call(u, l, n, r);
2662
+ if (m === void 0)
2663
+ throw new gi.default(s.opts.uriResolver, n, r);
2664
+ if (m instanceof ds.SchemaEnv)
2665
+ return b(m);
2666
+ return E(m);
2667
+ function y() {
2668
+ if (a === l)
2669
+ return wt(e, i, a, a.$async);
2670
+ const g = t.scopeValue("root", { ref: l });
2671
+ return wt(e, (0, te._)`${g}.validate`, l, l.$async);
2672
+ }
2673
+ function b(g) {
2674
+ const v = hn(e, g);
2675
+ wt(e, v, g, g.$async);
2676
+ }
2677
+ function E(g) {
2678
+ const v = t.scopeValue("schema", d.code.source === !0 ? { ref: g, code: (0, te.stringify)(g) } : { ref: g }), h = t.name("valid"), f = e.subschema({
2679
+ schema: g,
2680
+ dataTypes: [],
2681
+ schemaPath: te.nil,
2682
+ topSchemaRef: v,
2683
+ errSchemaPath: r
2684
+ }, h);
2685
+ e.mergeEvaluated(f), e.ok(h);
2686
+ }
2687
+ }
2688
+ };
2689
+ function hn(e, t) {
2690
+ const { gen: r } = e;
2691
+ return t.validate ? r.scopeValue("validate", { ref: t.validate }) : (0, te._)`${r.scopeValue("wrapper", { ref: t })}.validate`;
2692
+ }
2693
+ Me.getValidate = hn;
2694
+ function wt(e, t, r, s) {
2695
+ const { gen: n, it: a } = e, { allErrors: i, schemaEnv: d, opts: u } = a, l = u.passContext ? Ue.default.this : te.nil;
2696
+ s ? m() : y();
2697
+ function m() {
2698
+ if (!d.$async)
2699
+ throw new Error("async schema referenced by sync schema");
2700
+ const g = n.let("valid");
2701
+ n.try(() => {
2702
+ n.code((0, te._)`await ${(0, ls.callValidateCode)(e, t, l)}`), E(t), i || n.assign(g, !0);
2703
+ }, (v) => {
2704
+ n.if((0, te._)`!(${v} instanceof ${a.ValidationError})`, () => n.throw(v)), b(v), i || n.assign(g, !1);
2705
+ }), e.ok(g);
2706
+ }
2707
+ function y() {
2708
+ e.result((0, ls.callValidateCode)(e, t, l), () => E(t), () => b(t));
2709
+ }
2710
+ function b(g) {
2711
+ const v = (0, te._)`${g}.errors`;
2712
+ n.assign(Ue.default.vErrors, (0, te._)`${Ue.default.vErrors} === null ? ${v} : ${Ue.default.vErrors}.concat(${v})`), n.assign(Ue.default.errors, (0, te._)`${Ue.default.vErrors}.length`);
2713
+ }
2714
+ function E(g) {
2715
+ var v;
2716
+ if (!a.opts.unevaluated)
2717
+ return;
2718
+ const h = (v = r == null ? void 0 : r.validate) === null || v === void 0 ? void 0 : v.evaluated;
2719
+ if (a.props !== !0)
2720
+ if (h && !h.dynamicProps)
2721
+ h.props !== void 0 && (a.props = yt.mergeEvaluated.props(n, h.props, a.props));
2722
+ else {
2723
+ const f = n.var("props", (0, te._)`${g}.evaluated.props`);
2724
+ a.props = yt.mergeEvaluated.props(n, f, a.props, te.Name);
2725
+ }
2726
+ if (a.items !== !0)
2727
+ if (h && !h.dynamicItems)
2728
+ h.items !== void 0 && (a.items = yt.mergeEvaluated.items(n, h.items, a.items));
2729
+ else {
2730
+ const f = n.var("items", (0, te._)`${g}.evaluated.items`);
2731
+ a.items = yt.mergeEvaluated.items(n, f, a.items, te.Name);
2732
+ }
2733
+ }
2734
+ }
2735
+ Me.callRef = wt;
2736
+ Me.default = wi;
2737
+ Object.defineProperty(wr, "__esModule", { value: !0 });
2738
+ const bi = br, Ei = Me, Si = [
2739
+ "$schema",
2740
+ "$id",
2741
+ "$defs",
2742
+ "$vocabulary",
2743
+ { keyword: "$comment" },
2744
+ "definitions",
2745
+ bi.default,
2746
+ Ei.default
2747
+ ];
2748
+ wr.default = Si;
2749
+ var Er = {}, Sr = {};
2750
+ Object.defineProperty(Sr, "__esModule", { value: !0 });
2751
+ const Pt = A, Se = Pt.operators, kt = {
2752
+ maximum: { okStr: "<=", ok: Se.LTE, fail: Se.GT },
2753
+ minimum: { okStr: ">=", ok: Se.GTE, fail: Se.LT },
2754
+ exclusiveMaximum: { okStr: "<", ok: Se.LT, fail: Se.GTE },
2755
+ exclusiveMinimum: { okStr: ">", ok: Se.GT, fail: Se.LTE }
2756
+ }, Pi = {
2757
+ message: ({ keyword: e, schemaCode: t }) => (0, Pt.str)`must be ${kt[e].okStr} ${t}`,
2758
+ params: ({ keyword: e, schemaCode: t }) => (0, Pt._)`{comparison: ${kt[e].okStr}, limit: ${t}}`
2759
+ }, ki = {
2760
+ keyword: Object.keys(kt),
2761
+ type: "number",
2762
+ schemaType: "number",
2763
+ $data: !0,
2764
+ error: Pi,
2765
+ code(e) {
2766
+ const { keyword: t, data: r, schemaCode: s } = e;
2767
+ e.fail$data((0, Pt._)`${r} ${kt[t].fail} ${s} || isNaN(${r})`);
2768
+ }
2769
+ };
2770
+ Sr.default = ki;
2771
+ var Pr = {};
2772
+ Object.defineProperty(Pr, "__esModule", { value: !0 });
2773
+ const ot = A, Ni = {
2774
+ message: ({ schemaCode: e }) => (0, ot.str)`must be multiple of ${e}`,
2775
+ params: ({ schemaCode: e }) => (0, ot._)`{multipleOf: ${e}}`
2776
+ }, Ci = {
2777
+ keyword: "multipleOf",
2778
+ type: "number",
2779
+ schemaType: "number",
2780
+ $data: !0,
2781
+ error: Ni,
2782
+ code(e) {
2783
+ const { gen: t, data: r, schemaCode: s, it: n } = e, a = n.opts.multipleOfPrecision, i = t.let("res"), d = a ? (0, ot._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${a}` : (0, ot._)`${i} !== parseInt(${i})`;
2784
+ e.fail$data((0, ot._)`(${s} === 0 || (${i} = ${r}/${s}, ${d}))`);
2785
+ }
2786
+ };
2787
+ Pr.default = Ci;
2788
+ var kr = {}, Nr = {};
2789
+ Object.defineProperty(Nr, "__esModule", { value: !0 });
2790
+ function pn(e) {
2791
+ const t = e.length;
2792
+ let r = 0, s = 0, n;
2793
+ for (; s < t; )
2794
+ r++, n = e.charCodeAt(s++), n >= 55296 && n <= 56319 && s < t && (n = e.charCodeAt(s), (n & 64512) === 56320 && s++);
2795
+ return r;
2796
+ }
2797
+ Nr.default = pn;
2798
+ pn.code = 'require("ajv/dist/runtime/ucs2length").default';
2799
+ Object.defineProperty(kr, "__esModule", { value: !0 });
2800
+ const Oe = A, ji = N, Ri = Nr, Oi = {
2801
+ message({ keyword: e, schemaCode: t }) {
2802
+ const r = e === "maxLength" ? "more" : "fewer";
2803
+ return (0, Oe.str)`must NOT have ${r} than ${t} characters`;
2804
+ },
2805
+ params: ({ schemaCode: e }) => (0, Oe._)`{limit: ${e}}`
2806
+ }, Ti = {
2807
+ keyword: ["maxLength", "minLength"],
2808
+ type: "string",
2809
+ schemaType: "number",
2810
+ $data: !0,
2811
+ error: Oi,
2812
+ code(e) {
2813
+ const { keyword: t, data: r, schemaCode: s, it: n } = e, a = t === "maxLength" ? Oe.operators.GT : Oe.operators.LT, i = n.opts.unicode === !1 ? (0, Oe._)`${r}.length` : (0, Oe._)`${(0, ji.useFunc)(e.gen, Ri.default)}(${r})`;
2814
+ e.fail$data((0, Oe._)`${i} ${a} ${s}`);
2815
+ }
2816
+ };
2817
+ kr.default = Ti;
2818
+ var Cr = {};
2819
+ Object.defineProperty(Cr, "__esModule", { value: !0 });
2820
+ const Ii = K, Mi = N, Ge = A, Vi = {
2821
+ message: ({ schemaCode: e }) => (0, Ge.str)`must match pattern "${e}"`,
2822
+ params: ({ schemaCode: e }) => (0, Ge._)`{pattern: ${e}}`
2823
+ }, Fi = {
2824
+ keyword: "pattern",
2825
+ type: "string",
2826
+ schemaType: "string",
2827
+ $data: !0,
2828
+ error: Vi,
2829
+ code(e) {
2830
+ const { gen: t, data: r, $data: s, schema: n, schemaCode: a, it: i } = e, d = i.opts.unicodeRegExp ? "u" : "";
2831
+ if (s) {
2832
+ const { regExp: u } = i.opts.code, l = u.code === "new RegExp" ? (0, Ge._)`new RegExp` : (0, Mi.useFunc)(t, u), m = t.let("valid");
2833
+ t.try(() => t.assign(m, (0, Ge._)`${l}(${a}, ${d}).test(${r})`), () => t.assign(m, !1)), e.fail$data((0, Ge._)`!${m}`);
2834
+ } else {
2835
+ const u = (0, Ii.usePattern)(e, n);
2836
+ e.fail$data((0, Ge._)`!${u}.test(${r})`);
2837
+ }
2838
+ }
2839
+ };
2840
+ Cr.default = Fi;
2841
+ var jr = {};
2842
+ Object.defineProperty(jr, "__esModule", { value: !0 });
2843
+ const at = A, Ki = {
2844
+ message({ keyword: e, schemaCode: t }) {
2845
+ const r = e === "maxProperties" ? "more" : "fewer";
2846
+ return (0, at.str)`must NOT have ${r} than ${t} properties`;
2847
+ },
2848
+ params: ({ schemaCode: e }) => (0, at._)`{limit: ${e}}`
2849
+ }, Ai = {
2850
+ keyword: ["maxProperties", "minProperties"],
2851
+ type: "object",
2852
+ schemaType: "number",
2853
+ $data: !0,
2854
+ error: Ki,
2855
+ code(e) {
2856
+ const { keyword: t, data: r, schemaCode: s } = e, n = t === "maxProperties" ? at.operators.GT : at.operators.LT;
2857
+ e.fail$data((0, at._)`Object.keys(${r}).length ${n} ${s}`);
2858
+ }
2859
+ };
2860
+ jr.default = Ai;
2861
+ var Rr = {};
2862
+ Object.defineProperty(Rr, "__esModule", { value: !0 });
2863
+ const tt = K, it = A, qi = N, zi = {
2864
+ message: ({ params: { missingProperty: e } }) => (0, it.str)`must have required property '${e}'`,
2865
+ params: ({ params: { missingProperty: e } }) => (0, it._)`{missingProperty: ${e}}`
2866
+ }, Ui = {
2867
+ keyword: "required",
2868
+ type: "object",
2869
+ schemaType: "array",
2870
+ $data: !0,
2871
+ error: zi,
2872
+ code(e) {
2873
+ const { gen: t, schema: r, schemaCode: s, data: n, $data: a, it: i } = e, { opts: d } = i;
2874
+ if (!a && r.length === 0)
2875
+ return;
2876
+ const u = r.length >= d.loopRequired;
2877
+ if (i.allErrors ? l() : m(), d.strictRequired) {
2878
+ const E = e.parentSchema.properties, { definedProperties: g } = e.it;
2879
+ for (const v of r)
2880
+ if ((E == null ? void 0 : E[v]) === void 0 && !g.has(v)) {
2881
+ const h = i.schemaEnv.baseId + i.errSchemaPath, f = `required property "${v}" is not defined at "${h}" (strictRequired)`;
2882
+ (0, qi.checkStrictMode)(i, f, i.opts.strictRequired);
2883
+ }
2884
+ }
2885
+ function l() {
2886
+ if (u || a)
2887
+ e.block$data(it.nil, y);
2888
+ else
2889
+ for (const E of r)
2890
+ (0, tt.checkReportMissingProp)(e, E);
2891
+ }
2892
+ function m() {
2893
+ const E = t.let("missing");
2894
+ if (u || a) {
2895
+ const g = t.let("valid", !0);
2896
+ e.block$data(g, () => b(E, g)), e.ok(g);
2897
+ } else
2898
+ t.if((0, tt.checkMissingProp)(e, r, E)), (0, tt.reportMissingProp)(e, E), t.else();
2899
+ }
2900
+ function y() {
2901
+ t.forOf("prop", s, (E) => {
2902
+ e.setParams({ missingProperty: E }), t.if((0, tt.noPropertyInData)(t, n, E, d.ownProperties), () => e.error());
2903
+ });
2904
+ }
2905
+ function b(E, g) {
2906
+ e.setParams({ missingProperty: E }), t.forOf(E, s, () => {
2907
+ t.assign(g, (0, tt.propertyInData)(t, n, E, d.ownProperties)), t.if((0, it.not)(g), () => {
2908
+ e.error(), t.break();
2909
+ });
2910
+ }, it.nil);
2911
+ }
2912
+ }
2913
+ };
2914
+ Rr.default = Ui;
2915
+ var Or = {};
2916
+ Object.defineProperty(Or, "__esModule", { value: !0 });
2917
+ const ct = A, Li = {
2918
+ message({ keyword: e, schemaCode: t }) {
2919
+ const r = e === "maxItems" ? "more" : "fewer";
2920
+ return (0, ct.str)`must NOT have ${r} than ${t} items`;
2921
+ },
2922
+ params: ({ schemaCode: e }) => (0, ct._)`{limit: ${e}}`
2923
+ }, Gi = {
2924
+ keyword: ["maxItems", "minItems"],
2925
+ type: "array",
2926
+ schemaType: "number",
2927
+ $data: !0,
2928
+ error: Li,
2929
+ code(e) {
2930
+ const { keyword: t, data: r, schemaCode: s } = e, n = t === "maxItems" ? ct.operators.GT : ct.operators.LT;
2931
+ e.fail$data((0, ct._)`${r}.length ${n} ${s}`);
2932
+ }
2933
+ };
2934
+ Or.default = Gi;
2935
+ var Tr = {}, mt = {};
2936
+ Object.defineProperty(mt, "__esModule", { value: !0 });
2937
+ const yn = Ps;
2938
+ yn.code = 'require("ajv/dist/runtime/equal").default';
2939
+ mt.default = yn;
2940
+ Object.defineProperty(Tr, "__esModule", { value: !0 });
2941
+ const Yt = X, Y = A, Ji = N, Hi = mt, Bi = {
2942
+ message: ({ params: { i: e, j: t } }) => (0, Y.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,
2943
+ params: ({ params: { i: e, j: t } }) => (0, Y._)`{i: ${e}, j: ${t}}`
2944
+ }, Qi = {
2945
+ keyword: "uniqueItems",
2946
+ type: "array",
2947
+ schemaType: "boolean",
2948
+ $data: !0,
2949
+ error: Bi,
2950
+ code(e) {
2951
+ const { gen: t, data: r, $data: s, schema: n, parentSchema: a, schemaCode: i, it: d } = e;
2952
+ if (!s && !n)
2953
+ return;
2954
+ const u = t.let("valid"), l = a.items ? (0, Yt.getSchemaTypes)(a.items) : [];
2955
+ e.block$data(u, m, (0, Y._)`${i} === false`), e.ok(u);
2956
+ function m() {
2957
+ const g = t.let("i", (0, Y._)`${r}.length`), v = t.let("j");
2958
+ e.setParams({ i: g, j: v }), t.assign(u, !0), t.if((0, Y._)`${g} > 1`, () => (y() ? b : E)(g, v));
2959
+ }
2960
+ function y() {
2961
+ return l.length > 0 && !l.some((g) => g === "object" || g === "array");
2962
+ }
2963
+ function b(g, v) {
2964
+ const h = t.name("item"), f = (0, Yt.checkDataTypes)(l, h, d.opts.strictNumbers, Yt.DataType.Wrong), $ = t.const("indices", (0, Y._)`{}`);
2965
+ t.for((0, Y._)`;${g}--;`, () => {
2966
+ t.let(h, (0, Y._)`${r}[${g}]`), t.if(f, (0, Y._)`continue`), l.length > 1 && t.if((0, Y._)`typeof ${h} == "string"`, (0, Y._)`${h} += "_"`), t.if((0, Y._)`typeof ${$}[${h}] == "number"`, () => {
2967
+ t.assign(v, (0, Y._)`${$}[${h}]`), e.error(), t.assign(u, !1).break();
2968
+ }).code((0, Y._)`${$}[${h}] = ${g}`);
2969
+ });
2970
+ }
2971
+ function E(g, v) {
2972
+ const h = (0, Ji.useFunc)(t, Hi.default), f = t.name("outer");
2973
+ t.label(f).for((0, Y._)`;${g}--;`, () => t.for((0, Y._)`${v} = ${g}; ${v}--;`, () => t.if((0, Y._)`${h}(${r}[${g}], ${r}[${v}])`, () => {
2974
+ e.error(), t.assign(u, !1).break(f);
2975
+ })));
2976
+ }
2977
+ }
2978
+ };
2979
+ Tr.default = Qi;
2980
+ var Ir = {};
2981
+ Object.defineProperty(Ir, "__esModule", { value: !0 });
2982
+ const ar = A, Xi = N, Yi = mt, Zi = {
2983
+ message: "must be equal to constant",
2984
+ params: ({ schemaCode: e }) => (0, ar._)`{allowedValue: ${e}}`
2985
+ }, Di = {
2986
+ keyword: "const",
2987
+ $data: !0,
2988
+ error: Zi,
2989
+ code(e) {
2990
+ const { gen: t, data: r, $data: s, schemaCode: n, schema: a } = e;
2991
+ s || a && typeof a == "object" ? e.fail$data((0, ar._)`!${(0, Xi.useFunc)(t, Yi.default)}(${r}, ${n})`) : e.fail((0, ar._)`${a} !== ${r}`);
2992
+ }
2993
+ };
2994
+ Ir.default = Di;
2995
+ var Mr = {};
2996
+ Object.defineProperty(Mr, "__esModule", { value: !0 });
2997
+ const rt = A, Wi = N, xi = mt, ec = {
2998
+ message: "must be equal to one of the allowed values",
2999
+ params: ({ schemaCode: e }) => (0, rt._)`{allowedValues: ${e}}`
3000
+ }, tc = {
3001
+ keyword: "enum",
3002
+ schemaType: "array",
3003
+ $data: !0,
3004
+ error: ec,
3005
+ code(e) {
3006
+ const { gen: t, data: r, $data: s, schema: n, schemaCode: a, it: i } = e;
3007
+ if (!s && n.length === 0)
3008
+ throw new Error("enum must have non-empty array");
3009
+ const d = n.length >= i.opts.loopEnum;
3010
+ let u;
3011
+ const l = () => u ?? (u = (0, Wi.useFunc)(t, xi.default));
3012
+ let m;
3013
+ if (d || s)
3014
+ m = t.let("valid"), e.block$data(m, y);
3015
+ else {
3016
+ if (!Array.isArray(n))
3017
+ throw new Error("ajv implementation error");
3018
+ const E = t.const("vSchema", a);
3019
+ m = (0, rt.or)(...n.map((g, v) => b(E, v)));
3020
+ }
3021
+ e.pass(m);
3022
+ function y() {
3023
+ t.assign(m, !1), t.forOf("v", a, (E) => t.if((0, rt._)`${l()}(${r}, ${E})`, () => t.assign(m, !0).break()));
3024
+ }
3025
+ function b(E, g) {
3026
+ const v = n[g];
3027
+ return typeof v == "object" && v !== null ? (0, rt._)`${l()}(${r}, ${E}[${g}])` : (0, rt._)`${r} === ${v}`;
3028
+ }
3029
+ }
3030
+ };
3031
+ Mr.default = tc;
3032
+ Object.defineProperty(Er, "__esModule", { value: !0 });
3033
+ const rc = Sr, sc = Pr, nc = kr, oc = Cr, ac = jr, ic = Rr, cc = Or, lc = Tr, dc = Ir, uc = Mr, fc = [
3034
+ // number
3035
+ rc.default,
3036
+ sc.default,
3037
+ // string
3038
+ nc.default,
3039
+ oc.default,
3040
+ // object
3041
+ ac.default,
3042
+ ic.default,
3043
+ // array
3044
+ cc.default,
3045
+ lc.default,
3046
+ // any
3047
+ { keyword: "type", schemaType: ["string", "array"] },
3048
+ { keyword: "nullable", schemaType: "boolean" },
3049
+ dc.default,
3050
+ uc.default
3051
+ ];
3052
+ Er.default = fc;
3053
+ var Vr = {}, Ye = {};
3054
+ Object.defineProperty(Ye, "__esModule", { value: !0 });
3055
+ Ye.validateAdditionalItems = void 0;
3056
+ const Te = A, ir = N, mc = {
3057
+ message: ({ params: { len: e } }) => (0, Te.str)`must NOT have more than ${e} items`,
3058
+ params: ({ params: { len: e } }) => (0, Te._)`{limit: ${e}}`
3059
+ }, hc = {
3060
+ keyword: "additionalItems",
3061
+ type: "array",
3062
+ schemaType: ["boolean", "object"],
3063
+ before: "uniqueItems",
3064
+ error: mc,
3065
+ code(e) {
3066
+ const { parentSchema: t, it: r } = e, { items: s } = t;
3067
+ if (!Array.isArray(s)) {
3068
+ (0, ir.checkStrictMode)(r, '"additionalItems" is ignored when "items" is not an array of schemas');
3069
+ return;
3070
+ }
3071
+ _n(e, s);
3072
+ }
3073
+ };
3074
+ function _n(e, t) {
3075
+ const { gen: r, schema: s, data: n, keyword: a, it: i } = e;
3076
+ i.items = !0;
3077
+ const d = r.const("len", (0, Te._)`${n}.length`);
3078
+ if (s === !1)
3079
+ e.setParams({ len: t.length }), e.pass((0, Te._)`${d} <= ${t.length}`);
3080
+ else if (typeof s == "object" && !(0, ir.alwaysValidSchema)(i, s)) {
3081
+ const l = r.var("valid", (0, Te._)`${d} <= ${t.length}`);
3082
+ r.if((0, Te.not)(l), () => u(l)), e.ok(l);
3083
+ }
3084
+ function u(l) {
3085
+ r.forRange("i", t.length, d, (m) => {
3086
+ e.subschema({ keyword: a, dataProp: m, dataPropType: ir.Type.Num }, l), i.allErrors || r.if((0, Te.not)(l), () => r.break());
3087
+ });
3088
+ }
3089
+ }
3090
+ Ye.validateAdditionalItems = _n;
3091
+ Ye.default = hc;
3092
+ var Fr = {}, Ze = {};
3093
+ Object.defineProperty(Ze, "__esModule", { value: !0 });
3094
+ Ze.validateTuple = void 0;
3095
+ const us = A, bt = N, pc = K, yc = {
3096
+ keyword: "items",
3097
+ type: "array",
3098
+ schemaType: ["object", "array", "boolean"],
3099
+ before: "uniqueItems",
3100
+ code(e) {
3101
+ const { schema: t, it: r } = e;
3102
+ if (Array.isArray(t))
3103
+ return vn(e, "additionalItems", t);
3104
+ r.items = !0, !(0, bt.alwaysValidSchema)(r, t) && e.ok((0, pc.validateArray)(e));
3105
+ }
3106
+ };
3107
+ function vn(e, t, r = e.schema) {
3108
+ const { gen: s, parentSchema: n, data: a, keyword: i, it: d } = e;
3109
+ m(n), d.opts.unevaluated && r.length && d.items !== !0 && (d.items = bt.mergeEvaluated.items(s, r.length, d.items));
3110
+ const u = s.name("valid"), l = s.const("len", (0, us._)`${a}.length`);
3111
+ r.forEach((y, b) => {
3112
+ (0, bt.alwaysValidSchema)(d, y) || (s.if((0, us._)`${l} > ${b}`, () => e.subschema({
3113
+ keyword: i,
3114
+ schemaProp: b,
3115
+ dataProp: b
3116
+ }, u)), e.ok(u));
3117
+ });
3118
+ function m(y) {
3119
+ const { opts: b, errSchemaPath: E } = d, g = r.length, v = g === y.minItems && (g === y.maxItems || y[t] === !1);
3120
+ if (b.strictTuples && !v) {
3121
+ const h = `"${i}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${E}"`;
3122
+ (0, bt.checkStrictMode)(d, h, b.strictTuples);
3123
+ }
3124
+ }
3125
+ }
3126
+ Ze.validateTuple = vn;
3127
+ Ze.default = yc;
3128
+ Object.defineProperty(Fr, "__esModule", { value: !0 });
3129
+ const _c = Ze, vc = {
3130
+ keyword: "prefixItems",
3131
+ type: "array",
3132
+ schemaType: ["array"],
3133
+ before: "uniqueItems",
3134
+ code: (e) => (0, _c.validateTuple)(e, "items")
3135
+ };
3136
+ Fr.default = vc;
3137
+ var Kr = {};
3138
+ Object.defineProperty(Kr, "__esModule", { value: !0 });
3139
+ const fs = A, $c = N, gc = K, wc = Ye, bc = {
3140
+ message: ({ params: { len: e } }) => (0, fs.str)`must NOT have more than ${e} items`,
3141
+ params: ({ params: { len: e } }) => (0, fs._)`{limit: ${e}}`
3142
+ }, Ec = {
3143
+ keyword: "items",
3144
+ type: "array",
3145
+ schemaType: ["object", "boolean"],
3146
+ before: "uniqueItems",
3147
+ error: bc,
3148
+ code(e) {
3149
+ const { schema: t, parentSchema: r, it: s } = e, { prefixItems: n } = r;
3150
+ s.items = !0, !(0, $c.alwaysValidSchema)(s, t) && (n ? (0, wc.validateAdditionalItems)(e, n) : e.ok((0, gc.validateArray)(e)));
3151
+ }
3152
+ };
3153
+ Kr.default = Ec;
3154
+ var Ar = {};
3155
+ Object.defineProperty(Ar, "__esModule", { value: !0 });
3156
+ const oe = A, _t = N, Sc = {
3157
+ message: ({ params: { min: e, max: t } }) => t === void 0 ? (0, oe.str)`must contain at least ${e} valid item(s)` : (0, oe.str)`must contain at least ${e} and no more than ${t} valid item(s)`,
3158
+ params: ({ params: { min: e, max: t } }) => t === void 0 ? (0, oe._)`{minContains: ${e}}` : (0, oe._)`{minContains: ${e}, maxContains: ${t}}`
3159
+ }, Pc = {
3160
+ keyword: "contains",
3161
+ type: "array",
3162
+ schemaType: ["object", "boolean"],
3163
+ before: "uniqueItems",
3164
+ trackErrors: !0,
3165
+ error: Sc,
3166
+ code(e) {
3167
+ const { gen: t, schema: r, parentSchema: s, data: n, it: a } = e;
3168
+ let i, d;
3169
+ const { minContains: u, maxContains: l } = s;
3170
+ a.opts.next ? (i = u === void 0 ? 1 : u, d = l) : i = 1;
3171
+ const m = t.const("len", (0, oe._)`${n}.length`);
3172
+ if (e.setParams({ min: i, max: d }), d === void 0 && i === 0) {
3173
+ (0, _t.checkStrictMode)(a, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
3174
+ return;
3175
+ }
3176
+ if (d !== void 0 && i > d) {
3177
+ (0, _t.checkStrictMode)(a, '"minContains" > "maxContains" is always invalid'), e.fail();
3178
+ return;
3179
+ }
3180
+ if ((0, _t.alwaysValidSchema)(a, r)) {
3181
+ let v = (0, oe._)`${m} >= ${i}`;
3182
+ d !== void 0 && (v = (0, oe._)`${v} && ${m} <= ${d}`), e.pass(v);
3183
+ return;
3184
+ }
3185
+ a.items = !0;
3186
+ const y = t.name("valid");
3187
+ d === void 0 && i === 1 ? E(y, () => t.if(y, () => t.break())) : i === 0 ? (t.let(y, !0), d !== void 0 && t.if((0, oe._)`${n}.length > 0`, b)) : (t.let(y, !1), b()), e.result(y, () => e.reset());
3188
+ function b() {
3189
+ const v = t.name("_valid"), h = t.let("count", 0);
3190
+ E(v, () => t.if(v, () => g(h)));
3191
+ }
3192
+ function E(v, h) {
3193
+ t.forRange("i", 0, m, (f) => {
3194
+ e.subschema({
3195
+ keyword: "contains",
3196
+ dataProp: f,
3197
+ dataPropType: _t.Type.Num,
3198
+ compositeRule: !0
3199
+ }, v), h();
3200
+ });
3201
+ }
3202
+ function g(v) {
3203
+ t.code((0, oe._)`${v}++`), d === void 0 ? t.if((0, oe._)`${v} >= ${i}`, () => t.assign(y, !0).break()) : (t.if((0, oe._)`${v} > ${d}`, () => t.assign(y, !1).break()), i === 1 ? t.assign(y, !0) : t.if((0, oe._)`${v} >= ${i}`, () => t.assign(y, !0)));
3204
+ }
3205
+ }
3206
+ };
3207
+ Ar.default = Pc;
3208
+ var $n = {};
3209
+ (function(e) {
3210
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
3211
+ const t = A, r = N, s = K;
3212
+ e.error = {
3213
+ message: ({ params: { property: u, depsCount: l, deps: m } }) => {
3214
+ const y = l === 1 ? "property" : "properties";
3215
+ return (0, t.str)`must have ${y} ${m} when property ${u} is present`;
3216
+ },
3217
+ params: ({ params: { property: u, depsCount: l, deps: m, missingProperty: y } }) => (0, t._)`{property: ${u},
3218
+ missingProperty: ${y},
3219
+ depsCount: ${l},
3220
+ deps: ${m}}`
3221
+ // TODO change to reference
3222
+ };
3223
+ const n = {
3224
+ keyword: "dependencies",
3225
+ type: "object",
3226
+ schemaType: "object",
3227
+ error: e.error,
3228
+ code(u) {
3229
+ const [l, m] = a(u);
3230
+ i(u, l), d(u, m);
3231
+ }
3232
+ };
3233
+ function a({ schema: u }) {
3234
+ const l = {}, m = {};
3235
+ for (const y in u) {
3236
+ if (y === "__proto__")
3237
+ continue;
3238
+ const b = Array.isArray(u[y]) ? l : m;
3239
+ b[y] = u[y];
3240
+ }
3241
+ return [l, m];
3242
+ }
3243
+ function i(u, l = u.schema) {
3244
+ const { gen: m, data: y, it: b } = u;
3245
+ if (Object.keys(l).length === 0)
3246
+ return;
3247
+ const E = m.let("missing");
3248
+ for (const g in l) {
3249
+ const v = l[g];
3250
+ if (v.length === 0)
3251
+ continue;
3252
+ const h = (0, s.propertyInData)(m, y, g, b.opts.ownProperties);
3253
+ u.setParams({
3254
+ property: g,
3255
+ depsCount: v.length,
3256
+ deps: v.join(", ")
3257
+ }), b.allErrors ? m.if(h, () => {
3258
+ for (const f of v)
3259
+ (0, s.checkReportMissingProp)(u, f);
3260
+ }) : (m.if((0, t._)`${h} && (${(0, s.checkMissingProp)(u, v, E)})`), (0, s.reportMissingProp)(u, E), m.else());
3261
+ }
3262
+ }
3263
+ e.validatePropertyDeps = i;
3264
+ function d(u, l = u.schema) {
3265
+ const { gen: m, data: y, keyword: b, it: E } = u, g = m.name("valid");
3266
+ for (const v in l)
3267
+ (0, r.alwaysValidSchema)(E, l[v]) || (m.if(
3268
+ (0, s.propertyInData)(m, y, v, E.opts.ownProperties),
3269
+ () => {
3270
+ const h = u.subschema({ keyword: b, schemaProp: v }, g);
3271
+ u.mergeValidEvaluated(h, g);
3272
+ },
3273
+ () => m.var(g, !0)
3274
+ // TODO var
3275
+ ), u.ok(g));
3276
+ }
3277
+ e.validateSchemaDeps = d, e.default = n;
3278
+ })($n);
3279
+ var qr = {};
3280
+ Object.defineProperty(qr, "__esModule", { value: !0 });
3281
+ const gn = A, kc = N, Nc = {
3282
+ message: "property name must be valid",
3283
+ params: ({ params: e }) => (0, gn._)`{propertyName: ${e.propertyName}}`
3284
+ }, Cc = {
3285
+ keyword: "propertyNames",
3286
+ type: "object",
3287
+ schemaType: ["object", "boolean"],
3288
+ error: Nc,
3289
+ code(e) {
3290
+ const { gen: t, schema: r, data: s, it: n } = e;
3291
+ if ((0, kc.alwaysValidSchema)(n, r))
3292
+ return;
3293
+ const a = t.name("valid");
3294
+ t.forIn("key", s, (i) => {
3295
+ e.setParams({ propertyName: i }), e.subschema({
3296
+ keyword: "propertyNames",
3297
+ data: i,
3298
+ dataTypes: ["string"],
3299
+ propertyName: i,
3300
+ compositeRule: !0
3301
+ }, a), t.if((0, gn.not)(a), () => {
3302
+ e.error(!0), n.allErrors || t.break();
3303
+ });
3304
+ }), e.ok(a);
3305
+ }
3306
+ };
3307
+ qr.default = Cc;
3308
+ var Tt = {};
3309
+ Object.defineProperty(Tt, "__esModule", { value: !0 });
3310
+ const vt = K, le = A, jc = ye, $t = N, Rc = {
3311
+ message: "must NOT have additional properties",
3312
+ params: ({ params: e }) => (0, le._)`{additionalProperty: ${e.additionalProperty}}`
3313
+ }, Oc = {
3314
+ keyword: "additionalProperties",
3315
+ type: ["object"],
3316
+ schemaType: ["boolean", "object"],
3317
+ allowUndefined: !0,
3318
+ trackErrors: !0,
3319
+ error: Rc,
3320
+ code(e) {
3321
+ const { gen: t, schema: r, parentSchema: s, data: n, errsCount: a, it: i } = e;
3322
+ if (!a)
3323
+ throw new Error("ajv implementation error");
3324
+ const { allErrors: d, opts: u } = i;
3325
+ if (i.props = !0, u.removeAdditional !== "all" && (0, $t.alwaysValidSchema)(i, r))
3326
+ return;
3327
+ const l = (0, vt.allSchemaProperties)(s.properties), m = (0, vt.allSchemaProperties)(s.patternProperties);
3328
+ y(), e.ok((0, le._)`${a} === ${jc.default.errors}`);
3329
+ function y() {
3330
+ t.forIn("key", n, (h) => {
3331
+ !l.length && !m.length ? g(h) : t.if(b(h), () => g(h));
3332
+ });
3333
+ }
3334
+ function b(h) {
3335
+ let f;
3336
+ if (l.length > 8) {
3337
+ const $ = (0, $t.schemaRefOrVal)(i, s.properties, "properties");
3338
+ f = (0, vt.isOwnProperty)(t, $, h);
3339
+ } else l.length ? f = (0, le.or)(...l.map(($) => (0, le._)`${h} === ${$}`)) : f = le.nil;
3340
+ return m.length && (f = (0, le.or)(f, ...m.map(($) => (0, le._)`${(0, vt.usePattern)(e, $)}.test(${h})`))), (0, le.not)(f);
3341
+ }
3342
+ function E(h) {
3343
+ t.code((0, le._)`delete ${n}[${h}]`);
3344
+ }
3345
+ function g(h) {
3346
+ if (u.removeAdditional === "all" || u.removeAdditional && r === !1) {
3347
+ E(h);
3348
+ return;
3349
+ }
3350
+ if (r === !1) {
3351
+ e.setParams({ additionalProperty: h }), e.error(), d || t.break();
3352
+ return;
3353
+ }
3354
+ if (typeof r == "object" && !(0, $t.alwaysValidSchema)(i, r)) {
3355
+ const f = t.name("valid");
3356
+ u.removeAdditional === "failing" ? (v(h, f, !1), t.if((0, le.not)(f), () => {
3357
+ e.reset(), E(h);
3358
+ })) : (v(h, f), d || t.if((0, le.not)(f), () => t.break()));
3359
+ }
3360
+ }
3361
+ function v(h, f, $) {
3362
+ const P = {
3363
+ keyword: "additionalProperties",
3364
+ dataProp: h,
3365
+ dataPropType: $t.Type.Str
3366
+ };
3367
+ $ === !1 && Object.assign(P, {
3368
+ compositeRule: !0,
3369
+ createErrors: !1,
3370
+ allErrors: !1
3371
+ }), e.subschema(P, f);
3372
+ }
3373
+ }
3374
+ };
3375
+ Tt.default = Oc;
3376
+ var zr = {};
3377
+ Object.defineProperty(zr, "__esModule", { value: !0 });
3378
+ const Tc = fe, ms = K, Zt = N, hs = Tt, Ic = {
3379
+ keyword: "properties",
3380
+ type: "object",
3381
+ schemaType: "object",
3382
+ code(e) {
3383
+ const { gen: t, schema: r, parentSchema: s, data: n, it: a } = e;
3384
+ a.opts.removeAdditional === "all" && s.additionalProperties === void 0 && hs.default.code(new Tc.KeywordCxt(a, hs.default, "additionalProperties"));
3385
+ const i = (0, ms.allSchemaProperties)(r);
3386
+ for (const y of i)
3387
+ a.definedProperties.add(y);
3388
+ a.opts.unevaluated && i.length && a.props !== !0 && (a.props = Zt.mergeEvaluated.props(t, (0, Zt.toHash)(i), a.props));
3389
+ const d = i.filter((y) => !(0, Zt.alwaysValidSchema)(a, r[y]));
3390
+ if (d.length === 0)
3391
+ return;
3392
+ const u = t.name("valid");
3393
+ for (const y of d)
3394
+ l(y) ? m(y) : (t.if((0, ms.propertyInData)(t, n, y, a.opts.ownProperties)), m(y), a.allErrors || t.else().var(u, !0), t.endIf()), e.it.definedProperties.add(y), e.ok(u);
3395
+ function l(y) {
3396
+ return a.opts.useDefaults && !a.compositeRule && r[y].default !== void 0;
3397
+ }
3398
+ function m(y) {
3399
+ e.subschema({
3400
+ keyword: "properties",
3401
+ schemaProp: y,
3402
+ dataProp: y
3403
+ }, u);
3404
+ }
3405
+ }
3406
+ };
3407
+ zr.default = Ic;
3408
+ var Ur = {};
3409
+ Object.defineProperty(Ur, "__esModule", { value: !0 });
3410
+ const ps = K, gt = A, ys = N, _s = N, Mc = {
3411
+ keyword: "patternProperties",
3412
+ type: "object",
3413
+ schemaType: "object",
3414
+ code(e) {
3415
+ const { gen: t, schema: r, data: s, parentSchema: n, it: a } = e, { opts: i } = a, d = (0, ps.allSchemaProperties)(r), u = d.filter((v) => (0, ys.alwaysValidSchema)(a, r[v]));
3416
+ if (d.length === 0 || u.length === d.length && (!a.opts.unevaluated || a.props === !0))
3417
+ return;
3418
+ const l = i.strictSchema && !i.allowMatchingProperties && n.properties, m = t.name("valid");
3419
+ a.props !== !0 && !(a.props instanceof gt.Name) && (a.props = (0, _s.evaluatedPropsToName)(t, a.props));
3420
+ const { props: y } = a;
3421
+ b();
3422
+ function b() {
3423
+ for (const v of d)
3424
+ l && E(v), a.allErrors ? g(v) : (t.var(m, !0), g(v), t.if(m));
3425
+ }
3426
+ function E(v) {
3427
+ for (const h in l)
3428
+ new RegExp(v).test(h) && (0, ys.checkStrictMode)(a, `property ${h} matches pattern ${v} (use allowMatchingProperties)`);
3429
+ }
3430
+ function g(v) {
3431
+ t.forIn("key", s, (h) => {
3432
+ t.if((0, gt._)`${(0, ps.usePattern)(e, v)}.test(${h})`, () => {
3433
+ const f = u.includes(v);
3434
+ f || e.subschema({
3435
+ keyword: "patternProperties",
3436
+ schemaProp: v,
3437
+ dataProp: h,
3438
+ dataPropType: _s.Type.Str
3439
+ }, m), a.opts.unevaluated && y !== !0 ? t.assign((0, gt._)`${y}[${h}]`, !0) : !f && !a.allErrors && t.if((0, gt.not)(m), () => t.break());
3440
+ });
3441
+ });
3442
+ }
3443
+ }
3444
+ };
3445
+ Ur.default = Mc;
3446
+ var Lr = {};
3447
+ Object.defineProperty(Lr, "__esModule", { value: !0 });
3448
+ const Vc = N, Fc = {
3449
+ keyword: "not",
3450
+ schemaType: ["object", "boolean"],
3451
+ trackErrors: !0,
3452
+ code(e) {
3453
+ const { gen: t, schema: r, it: s } = e;
3454
+ if ((0, Vc.alwaysValidSchema)(s, r)) {
3455
+ e.fail();
3456
+ return;
3457
+ }
3458
+ const n = t.name("valid");
3459
+ e.subschema({
3460
+ keyword: "not",
3461
+ compositeRule: !0,
3462
+ createErrors: !1,
3463
+ allErrors: !1
3464
+ }, n), e.failResult(n, () => e.reset(), () => e.error());
3465
+ },
3466
+ error: { message: "must NOT be valid" }
3467
+ };
3468
+ Lr.default = Fc;
3469
+ var Gr = {};
3470
+ Object.defineProperty(Gr, "__esModule", { value: !0 });
3471
+ const Kc = K, Ac = {
3472
+ keyword: "anyOf",
3473
+ schemaType: "array",
3474
+ trackErrors: !0,
3475
+ code: Kc.validateUnion,
3476
+ error: { message: "must match a schema in anyOf" }
3477
+ };
3478
+ Gr.default = Ac;
3479
+ var Jr = {};
3480
+ Object.defineProperty(Jr, "__esModule", { value: !0 });
3481
+ const Et = A, qc = N, zc = {
3482
+ message: "must match exactly one schema in oneOf",
3483
+ params: ({ params: e }) => (0, Et._)`{passingSchemas: ${e.passing}}`
3484
+ }, Uc = {
3485
+ keyword: "oneOf",
3486
+ schemaType: "array",
3487
+ trackErrors: !0,
3488
+ error: zc,
3489
+ code(e) {
3490
+ const { gen: t, schema: r, parentSchema: s, it: n } = e;
3491
+ if (!Array.isArray(r))
3492
+ throw new Error("ajv implementation error");
3493
+ if (n.opts.discriminator && s.discriminator)
3494
+ return;
3495
+ const a = r, i = t.let("valid", !1), d = t.let("passing", null), u = t.name("_valid");
3496
+ e.setParams({ passing: d }), t.block(l), e.result(i, () => e.reset(), () => e.error(!0));
3497
+ function l() {
3498
+ a.forEach((m, y) => {
3499
+ let b;
3500
+ (0, qc.alwaysValidSchema)(n, m) ? t.var(u, !0) : b = e.subschema({
3501
+ keyword: "oneOf",
3502
+ schemaProp: y,
3503
+ compositeRule: !0
3504
+ }, u), y > 0 && t.if((0, Et._)`${u} && ${i}`).assign(i, !1).assign(d, (0, Et._)`[${d}, ${y}]`).else(), t.if(u, () => {
3505
+ t.assign(i, !0), t.assign(d, y), b && e.mergeEvaluated(b, Et.Name);
3506
+ });
3507
+ });
3508
+ }
3509
+ }
3510
+ };
3511
+ Jr.default = Uc;
3512
+ var Hr = {};
3513
+ Object.defineProperty(Hr, "__esModule", { value: !0 });
3514
+ const Lc = N, Gc = {
3515
+ keyword: "allOf",
3516
+ schemaType: "array",
3517
+ code(e) {
3518
+ const { gen: t, schema: r, it: s } = e;
3519
+ if (!Array.isArray(r))
3520
+ throw new Error("ajv implementation error");
3521
+ const n = t.name("valid");
3522
+ r.forEach((a, i) => {
3523
+ if ((0, Lc.alwaysValidSchema)(s, a))
3524
+ return;
3525
+ const d = e.subschema({ keyword: "allOf", schemaProp: i }, n);
3526
+ e.ok(n), e.mergeEvaluated(d);
3527
+ });
3528
+ }
3529
+ };
3530
+ Hr.default = Gc;
3531
+ var Br = {};
3532
+ Object.defineProperty(Br, "__esModule", { value: !0 });
3533
+ const Nt = A, wn = N, Jc = {
3534
+ message: ({ params: e }) => (0, Nt.str)`must match "${e.ifClause}" schema`,
3535
+ params: ({ params: e }) => (0, Nt._)`{failingKeyword: ${e.ifClause}}`
3536
+ }, Hc = {
3537
+ keyword: "if",
3538
+ schemaType: ["object", "boolean"],
3539
+ trackErrors: !0,
3540
+ error: Jc,
3541
+ code(e) {
3542
+ const { gen: t, parentSchema: r, it: s } = e;
3543
+ r.then === void 0 && r.else === void 0 && (0, wn.checkStrictMode)(s, '"if" without "then" and "else" is ignored');
3544
+ const n = vs(s, "then"), a = vs(s, "else");
3545
+ if (!n && !a)
3546
+ return;
3547
+ const i = t.let("valid", !0), d = t.name("_valid");
3548
+ if (u(), e.reset(), n && a) {
3549
+ const m = t.let("ifClause");
3550
+ e.setParams({ ifClause: m }), t.if(d, l("then", m), l("else", m));
3551
+ } else n ? t.if(d, l("then")) : t.if((0, Nt.not)(d), l("else"));
3552
+ e.pass(i, () => e.error(!0));
3553
+ function u() {
3554
+ const m = e.subschema({
3555
+ keyword: "if",
3556
+ compositeRule: !0,
3557
+ createErrors: !1,
3558
+ allErrors: !1
3559
+ }, d);
3560
+ e.mergeEvaluated(m);
3561
+ }
3562
+ function l(m, y) {
3563
+ return () => {
3564
+ const b = e.subschema({ keyword: m }, d);
3565
+ t.assign(i, d), e.mergeValidEvaluated(b, i), y ? t.assign(y, (0, Nt._)`${m}`) : e.setParams({ ifClause: m });
3566
+ };
3567
+ }
3568
+ }
3569
+ };
3570
+ function vs(e, t) {
3571
+ const r = e.schema[t];
3572
+ return r !== void 0 && !(0, wn.alwaysValidSchema)(e, r);
3573
+ }
3574
+ Br.default = Hc;
3575
+ var Qr = {};
3576
+ Object.defineProperty(Qr, "__esModule", { value: !0 });
3577
+ const Bc = N, Qc = {
3578
+ keyword: ["then", "else"],
3579
+ schemaType: ["object", "boolean"],
3580
+ code({ keyword: e, parentSchema: t, it: r }) {
3581
+ t.if === void 0 && (0, Bc.checkStrictMode)(r, `"${e}" without "if" is ignored`);
3582
+ }
3583
+ };
3584
+ Qr.default = Qc;
3585
+ Object.defineProperty(Vr, "__esModule", { value: !0 });
3586
+ const Xc = Ye, Yc = Fr, Zc = Ze, Dc = Kr, Wc = Ar, xc = $n, el = qr, tl = Tt, rl = zr, sl = Ur, nl = Lr, ol = Gr, al = Jr, il = Hr, cl = Br, ll = Qr;
3587
+ function dl(e = !1) {
3588
+ const t = [
3589
+ // any
3590
+ nl.default,
3591
+ ol.default,
3592
+ al.default,
3593
+ il.default,
3594
+ cl.default,
3595
+ ll.default,
3596
+ // object
3597
+ el.default,
3598
+ tl.default,
3599
+ xc.default,
3600
+ rl.default,
3601
+ sl.default
3602
+ ];
3603
+ return e ? t.push(Yc.default, Dc.default) : t.push(Xc.default, Zc.default), t.push(Wc.default), t;
3604
+ }
3605
+ Vr.default = dl;
3606
+ var Xr = {}, Yr = {};
3607
+ Object.defineProperty(Yr, "__esModule", { value: !0 });
3608
+ const Q = A, ul = {
3609
+ message: ({ schemaCode: e }) => (0, Q.str)`must match format "${e}"`,
3610
+ params: ({ schemaCode: e }) => (0, Q._)`{format: ${e}}`
3611
+ }, fl = {
3612
+ keyword: "format",
3613
+ type: ["number", "string"],
3614
+ schemaType: "string",
3615
+ $data: !0,
3616
+ error: ul,
3617
+ code(e, t) {
3618
+ const { gen: r, data: s, $data: n, schema: a, schemaCode: i, it: d } = e, { opts: u, errSchemaPath: l, schemaEnv: m, self: y } = d;
3619
+ if (!u.validateFormats)
3620
+ return;
3621
+ n ? b() : E();
3622
+ function b() {
3623
+ const g = r.scopeValue("formats", {
3624
+ ref: y.formats,
3625
+ code: u.code.formats
3626
+ }), v = r.const("fDef", (0, Q._)`${g}[${i}]`), h = r.let("fType"), f = r.let("format");
3627
+ r.if((0, Q._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`, () => r.assign(h, (0, Q._)`${v}.type || "string"`).assign(f, (0, Q._)`${v}.validate`), () => r.assign(h, (0, Q._)`"string"`).assign(f, v)), e.fail$data((0, Q.or)($(), P()));
3628
+ function $() {
3629
+ return u.strictSchema === !1 ? Q.nil : (0, Q._)`${i} && !${f}`;
3630
+ }
3631
+ function P() {
3632
+ const j = m.$async ? (0, Q._)`(${v}.async ? await ${f}(${s}) : ${f}(${s}))` : (0, Q._)`${f}(${s})`, C = (0, Q._)`(typeof ${f} == "function" ? ${j} : ${f}.test(${s}))`;
3633
+ return (0, Q._)`${f} && ${f} !== true && ${h} === ${t} && !${C}`;
3634
+ }
3635
+ }
3636
+ function E() {
3637
+ const g = y.formats[a];
3638
+ if (!g) {
3639
+ $();
3640
+ return;
3641
+ }
3642
+ if (g === !0)
3643
+ return;
3644
+ const [v, h, f] = P(g);
3645
+ v === t && e.pass(j());
3646
+ function $() {
3647
+ if (u.strictSchema === !1) {
3648
+ y.logger.warn(C());
3649
+ return;
3650
+ }
3651
+ throw new Error(C());
3652
+ function C() {
3653
+ return `unknown format "${a}" ignored in schema at path "${l}"`;
3654
+ }
3655
+ }
3656
+ function P(C) {
3657
+ const U = C instanceof RegExp ? (0, Q.regexpCode)(C) : u.code.formats ? (0, Q._)`${u.code.formats}${(0, Q.getProperty)(a)}` : void 0, J = r.scopeValue("formats", { key: a, ref: C, code: U });
3658
+ return typeof C == "object" && !(C instanceof RegExp) ? [C.type || "string", C.validate, (0, Q._)`${J}.validate`] : ["string", C, J];
3659
+ }
3660
+ function j() {
3661
+ if (typeof g == "object" && !(g instanceof RegExp) && g.async) {
3662
+ if (!m.$async)
3663
+ throw new Error("async format in sync schema");
3664
+ return (0, Q._)`await ${f}(${s})`;
3665
+ }
3666
+ return typeof h == "function" ? (0, Q._)`${f}(${s})` : (0, Q._)`${f}.test(${s})`;
3667
+ }
3668
+ }
3669
+ }
3670
+ };
3671
+ Yr.default = fl;
3672
+ Object.defineProperty(Xr, "__esModule", { value: !0 });
3673
+ const ml = Yr, hl = [ml.default];
3674
+ Xr.default = hl;
3675
+ var Qe = {};
3676
+ Object.defineProperty(Qe, "__esModule", { value: !0 });
3677
+ Qe.contentVocabulary = Qe.metadataVocabulary = void 0;
3678
+ Qe.metadataVocabulary = [
3679
+ "title",
3680
+ "description",
3681
+ "default",
3682
+ "deprecated",
3683
+ "readOnly",
3684
+ "writeOnly",
3685
+ "examples"
3686
+ ];
3687
+ Qe.contentVocabulary = [
3688
+ "contentMediaType",
3689
+ "contentEncoding",
3690
+ "contentSchema"
3691
+ ];
3692
+ Object.defineProperty(gr, "__esModule", { value: !0 });
3693
+ const pl = wr, yl = Er, _l = Vr, vl = Xr, $s = Qe, $l = [
3694
+ pl.default,
3695
+ yl.default,
3696
+ (0, _l.default)(),
3697
+ vl.default,
3698
+ $s.metadataVocabulary,
3699
+ $s.contentVocabulary
3700
+ ];
3701
+ gr.default = $l;
3702
+ var Zr = {}, It = {};
3703
+ Object.defineProperty(It, "__esModule", { value: !0 });
3704
+ It.DiscrError = void 0;
3705
+ var gs;
3706
+ (function(e) {
3707
+ e.Tag = "tag", e.Mapping = "mapping";
3708
+ })(gs || (It.DiscrError = gs = {}));
3709
+ Object.defineProperty(Zr, "__esModule", { value: !0 });
3710
+ const Le = A, cr = It, ws = re, gl = Xe, wl = N, bl = {
3711
+ message: ({ params: { discrError: e, tagName: t } }) => e === cr.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`,
3712
+ params: ({ params: { discrError: e, tag: t, tagName: r } }) => (0, Le._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`
3713
+ }, El = {
3714
+ keyword: "discriminator",
3715
+ type: "object",
3716
+ schemaType: "object",
3717
+ error: bl,
3718
+ code(e) {
3719
+ const { gen: t, data: r, schema: s, parentSchema: n, it: a } = e, { oneOf: i } = n;
3720
+ if (!a.opts.discriminator)
3721
+ throw new Error("discriminator: requires discriminator option");
3722
+ const d = s.propertyName;
3723
+ if (typeof d != "string")
3724
+ throw new Error("discriminator: requires propertyName");
3725
+ if (s.mapping)
3726
+ throw new Error("discriminator: mapping is not supported");
3727
+ if (!i)
3728
+ throw new Error("discriminator: requires oneOf keyword");
3729
+ const u = t.let("valid", !1), l = t.const("tag", (0, Le._)`${r}${(0, Le.getProperty)(d)}`);
3730
+ t.if((0, Le._)`typeof ${l} == "string"`, () => m(), () => e.error(!1, { discrError: cr.DiscrError.Tag, tag: l, tagName: d })), e.ok(u);
3731
+ function m() {
3732
+ const E = b();
3733
+ t.if(!1);
3734
+ for (const g in E)
3735
+ t.elseIf((0, Le._)`${l} === ${g}`), t.assign(u, y(E[g]));
3736
+ t.else(), e.error(!1, { discrError: cr.DiscrError.Mapping, tag: l, tagName: d }), t.endIf();
3737
+ }
3738
+ function y(E) {
3739
+ const g = t.name("valid"), v = e.subschema({ keyword: "oneOf", schemaProp: E }, g);
3740
+ return e.mergeEvaluated(v, Le.Name), g;
3741
+ }
3742
+ function b() {
3743
+ var E;
3744
+ const g = {}, v = f(n);
3745
+ let h = !0;
3746
+ for (let j = 0; j < i.length; j++) {
3747
+ let C = i[j];
3748
+ if (C != null && C.$ref && !(0, wl.schemaHasRulesButRef)(C, a.self.RULES)) {
3749
+ const J = C.$ref;
3750
+ if (C = ws.resolveRef.call(a.self, a.schemaEnv.root, a.baseId, J), C instanceof ws.SchemaEnv && (C = C.schema), C === void 0)
3751
+ throw new gl.default(a.opts.uriResolver, a.baseId, J);
3752
+ }
3753
+ const U = (E = C == null ? void 0 : C.properties) === null || E === void 0 ? void 0 : E[d];
3754
+ if (typeof U != "object")
3755
+ throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);
3756
+ h = h && (v || f(C)), $(U, j);
3757
+ }
3758
+ if (!h)
3759
+ throw new Error(`discriminator: "${d}" must be required`);
3760
+ return g;
3761
+ function f({ required: j }) {
3762
+ return Array.isArray(j) && j.includes(d);
3763
+ }
3764
+ function $(j, C) {
3765
+ if (j.const)
3766
+ P(j.const, C);
3767
+ else if (j.enum)
3768
+ for (const U of j.enum)
3769
+ P(U, C);
3770
+ else
3771
+ throw new Error(`discriminator: "properties/${d}" must have "const" or "enum"`);
3772
+ }
3773
+ function P(j, C) {
3774
+ if (typeof j != "string" || j in g)
3775
+ throw new Error(`discriminator: "${d}" values must be unique strings`);
3776
+ g[j] = C;
3777
+ }
3778
+ }
3779
+ }
3780
+ };
3781
+ Zr.default = El;
3782
+ const Sl = "http://json-schema.org/draft-07/schema#", Pl = "http://json-schema.org/draft-07/schema#", kl = "Core schema meta-schema", Nl = {
3783
+ schemaArray: {
3784
+ type: "array",
3785
+ minItems: 1,
3786
+ items: {
3787
+ $ref: "#"
3788
+ }
3789
+ },
3790
+ nonNegativeInteger: {
3791
+ type: "integer",
3792
+ minimum: 0
3793
+ },
3794
+ nonNegativeIntegerDefault0: {
3795
+ allOf: [
3796
+ {
3797
+ $ref: "#/definitions/nonNegativeInteger"
3798
+ },
3799
+ {
3800
+ default: 0
3801
+ }
3802
+ ]
3803
+ },
3804
+ simpleTypes: {
3805
+ enum: [
3806
+ "array",
3807
+ "boolean",
3808
+ "integer",
3809
+ "null",
3810
+ "number",
3811
+ "object",
3812
+ "string"
3813
+ ]
3814
+ },
3815
+ stringArray: {
3816
+ type: "array",
3817
+ items: {
3818
+ type: "string"
3819
+ },
3820
+ uniqueItems: !0,
3821
+ default: []
3822
+ }
3823
+ }, Cl = [
3824
+ "object",
3825
+ "boolean"
3826
+ ], jl = {
3827
+ $id: {
3828
+ type: "string",
3829
+ format: "uri-reference"
3830
+ },
3831
+ $schema: {
3832
+ type: "string",
3833
+ format: "uri"
3834
+ },
3835
+ $ref: {
3836
+ type: "string",
3837
+ format: "uri-reference"
3838
+ },
3839
+ $comment: {
3840
+ type: "string"
3841
+ },
3842
+ title: {
3843
+ type: "string"
3844
+ },
3845
+ description: {
3846
+ type: "string"
3847
+ },
3848
+ default: !0,
3849
+ readOnly: {
3850
+ type: "boolean",
3851
+ default: !1
3852
+ },
3853
+ examples: {
3854
+ type: "array",
3855
+ items: !0
3856
+ },
3857
+ multipleOf: {
3858
+ type: "number",
3859
+ exclusiveMinimum: 0
3860
+ },
3861
+ maximum: {
3862
+ type: "number"
3863
+ },
3864
+ exclusiveMaximum: {
3865
+ type: "number"
3866
+ },
3867
+ minimum: {
3868
+ type: "number"
3869
+ },
3870
+ exclusiveMinimum: {
3871
+ type: "number"
3872
+ },
3873
+ maxLength: {
3874
+ $ref: "#/definitions/nonNegativeInteger"
3875
+ },
3876
+ minLength: {
3877
+ $ref: "#/definitions/nonNegativeIntegerDefault0"
3878
+ },
3879
+ pattern: {
3880
+ type: "string",
3881
+ format: "regex"
3882
+ },
3883
+ additionalItems: {
3884
+ $ref: "#"
3885
+ },
3886
+ items: {
3887
+ anyOf: [
3888
+ {
3889
+ $ref: "#"
3890
+ },
3891
+ {
3892
+ $ref: "#/definitions/schemaArray"
3893
+ }
3894
+ ],
3895
+ default: !0
3896
+ },
3897
+ maxItems: {
3898
+ $ref: "#/definitions/nonNegativeInteger"
3899
+ },
3900
+ minItems: {
3901
+ $ref: "#/definitions/nonNegativeIntegerDefault0"
3902
+ },
3903
+ uniqueItems: {
3904
+ type: "boolean",
3905
+ default: !1
3906
+ },
3907
+ contains: {
3908
+ $ref: "#"
3909
+ },
3910
+ maxProperties: {
3911
+ $ref: "#/definitions/nonNegativeInteger"
3912
+ },
3913
+ minProperties: {
3914
+ $ref: "#/definitions/nonNegativeIntegerDefault0"
3915
+ },
3916
+ required: {
3917
+ $ref: "#/definitions/stringArray"
3918
+ },
3919
+ additionalProperties: {
3920
+ $ref: "#"
3921
+ },
3922
+ definitions: {
3923
+ type: "object",
3924
+ additionalProperties: {
3925
+ $ref: "#"
3926
+ },
3927
+ default: {}
3928
+ },
3929
+ properties: {
3930
+ type: "object",
3931
+ additionalProperties: {
3932
+ $ref: "#"
3933
+ },
3934
+ default: {}
3935
+ },
3936
+ patternProperties: {
3937
+ type: "object",
3938
+ additionalProperties: {
3939
+ $ref: "#"
3940
+ },
3941
+ propertyNames: {
3942
+ format: "regex"
3943
+ },
3944
+ default: {}
3945
+ },
3946
+ dependencies: {
3947
+ type: "object",
3948
+ additionalProperties: {
3949
+ anyOf: [
3950
+ {
3951
+ $ref: "#"
3952
+ },
3953
+ {
3954
+ $ref: "#/definitions/stringArray"
3955
+ }
3956
+ ]
3957
+ }
3958
+ },
3959
+ propertyNames: {
3960
+ $ref: "#"
3961
+ },
3962
+ const: !0,
3963
+ enum: {
3964
+ type: "array",
3965
+ items: !0,
3966
+ minItems: 1,
3967
+ uniqueItems: !0
3968
+ },
3969
+ type: {
3970
+ anyOf: [
3971
+ {
3972
+ $ref: "#/definitions/simpleTypes"
3973
+ },
3974
+ {
3975
+ type: "array",
3976
+ items: {
3977
+ $ref: "#/definitions/simpleTypes"
3978
+ },
3979
+ minItems: 1,
3980
+ uniqueItems: !0
3981
+ }
3982
+ ]
3983
+ },
3984
+ format: {
3985
+ type: "string"
3986
+ },
3987
+ contentMediaType: {
3988
+ type: "string"
3989
+ },
3990
+ contentEncoding: {
3991
+ type: "string"
3992
+ },
3993
+ if: {
3994
+ $ref: "#"
3995
+ },
3996
+ then: {
3997
+ $ref: "#"
3998
+ },
3999
+ else: {
4000
+ $ref: "#"
4001
+ },
4002
+ allOf: {
4003
+ $ref: "#/definitions/schemaArray"
4004
+ },
4005
+ anyOf: {
4006
+ $ref: "#/definitions/schemaArray"
4007
+ },
4008
+ oneOf: {
4009
+ $ref: "#/definitions/schemaArray"
4010
+ },
4011
+ not: {
4012
+ $ref: "#"
4013
+ }
4014
+ }, Rl = {
4015
+ $schema: Sl,
4016
+ $id: Pl,
4017
+ title: kl,
4018
+ definitions: Nl,
4019
+ type: Cl,
4020
+ properties: jl,
4021
+ default: !0
4022
+ };
4023
+ (function(e, t) {
4024
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = t.Ajv = void 0;
4025
+ const r = Vs, s = gr, n = Zr, a = Rl, i = ["/properties"], d = "http://json-schema.org/draft-07/schema";
4026
+ class u extends r.default {
4027
+ _addVocabularies() {
4028
+ super._addVocabularies(), s.default.forEach((g) => this.addVocabulary(g)), this.opts.discriminator && this.addKeyword(n.default);
4029
+ }
4030
+ _addDefaultMetaSchema() {
4031
+ if (super._addDefaultMetaSchema(), !this.opts.meta)
4032
+ return;
4033
+ const g = this.opts.$data ? this.$dataMetaSchema(a, i) : a;
4034
+ this.addMetaSchema(g, d, !1), this.refs["http://json-schema.org/schema"] = d;
4035
+ }
4036
+ defaultMeta() {
4037
+ return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(d) ? d : void 0);
4038
+ }
4039
+ }
4040
+ t.Ajv = u, e.exports = t = u, e.exports.Ajv = u, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = u;
4041
+ var l = fe;
4042
+ Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
4043
+ return l.KeywordCxt;
4044
+ } });
4045
+ var m = A;
4046
+ Object.defineProperty(t, "_", { enumerable: !0, get: function() {
4047
+ return m._;
4048
+ } }), Object.defineProperty(t, "str", { enumerable: !0, get: function() {
4049
+ return m.str;
4050
+ } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() {
4051
+ return m.stringify;
4052
+ } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() {
4053
+ return m.nil;
4054
+ } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() {
4055
+ return m.Name;
4056
+ } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
4057
+ return m.CodeGen;
4058
+ } });
4059
+ var y = ft;
4060
+ Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
4061
+ return y.default;
4062
+ } });
4063
+ var b = Xe;
4064
+ Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
4065
+ return b.default;
4066
+ } });
4067
+ })(tr, tr.exports);
4068
+ var Ol = tr.exports;
4069
+ const Tl = /* @__PURE__ */ On(Ol), pd = (e) => Ve(Ln, e), Il = (e) => Ve(Dr, e), yd = (e) => Ve(Un, e), _d = (e) => Ve(Ct, e), Ml = (e, t = 2e3) => {
4070
+ const [r, s] = de(e), n = Fn(null), a = Il((u) => u.getActionStatus), i = ke(() => e == null ? void 0 : e.task_id, [e == null ? void 0 : e.task_id]), d = ke(() => e == null ? void 0 : e.actionId, [e == null ? void 0 : e.actionId]);
4071
+ return Wt(() => {
4072
+ if ((e == null ? void 0 : e.outcome) !== "pending" || !i) return;
4073
+ let u = !1;
4074
+ const l = async () => {
4075
+ var y;
4076
+ const m = await a(d, i);
4077
+ if (!m)
4078
+ s({ outcome: "failure", done: !0 });
4079
+ else if (m.outcome === "success" || m.outcome === "failure") {
4080
+ const b = { ...m, done: !0 };
4081
+ s(b), (y = e == null ? void 0 : e.onComplete) == null || y.call(e, { ...e, ...b });
4082
+ } else {
4083
+ if (u) return;
4084
+ s({ ...m }), n.current = setTimeout(l, t);
4085
+ }
4086
+ };
4087
+ return l(), () => {
4088
+ u = !0, n.current && clearTimeout(n.current);
4089
+ };
4090
+ }, [d, a, t, e, e == null ? void 0 : e.outcome, i]), Wt(() => {
4091
+ s(e);
4092
+ }, [e]), ke(
4093
+ () => e || r ? { ...e, ...r } : void 0,
4094
+ [e, r]
4095
+ );
4096
+ }, Vl = ({ result: e, onClose: t, show: r = !1 }) => {
4097
+ var i, d;
4098
+ const { t: s } = Ve(Ct, (u) => u.i18next), n = Ml(e), a = ke(
4099
+ () => (n == null ? void 0 : n.outcome) === "success" || (n == null ? void 0 : n.outcome) === "failure" || (n == null ? void 0 : n.done),
4100
+ [n == null ? void 0 : n.done, n == null ? void 0 : n.outcome]
4101
+ );
4102
+ return n ? /* @__PURE__ */ V(bs, { open: r, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose: t, children: /* @__PURE__ */ V(Es, { sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", p: 2, minWidth: "750px" }, children: /* @__PURE__ */ V(lt, { children: /* @__PURE__ */ W(se, { spacing: 1, height: "100%", children: [
4103
+ /* @__PURE__ */ W(se, { direction: "row", spacing: 1, alignItems: "center", children: [
4104
+ n.action.action_icon && /* @__PURE__ */ V(zn, { height: "1.5rem", icon: n.action.action_icon }),
4105
+ /* @__PURE__ */ V(Pe, { variant: "h5", children: n.action.name }),
4106
+ n.action.supported_types && /* @__PURE__ */ V(Pe, { variant: "caption", color: "text.secondary", children: n.action.supported_types.map((u) => u.toUpperCase()).join(", ") }),
4107
+ /* @__PURE__ */ V("div", { style: { flex: 1 } }),
4108
+ /* @__PURE__ */ V(Gn, { size: "small", classification: n.action.classification })
4109
+ ] }),
4110
+ /* @__PURE__ */ V(Pe, { variant: "body1", children: n.action.summary }),
4111
+ /* @__PURE__ */ V(Dt, { flexItem: !0 }),
4112
+ a ? /* @__PURE__ */ V(lt, { children: /* @__PURE__ */ V(Jn, { result: n }) }) : /* @__PURE__ */ W(se, { flex: 1, sx: { pt: 2, alignItems: "center" }, spacing: 1, children: [
4113
+ n.summary && /* @__PURE__ */ V(Pe, { variant: "caption", children: n.summary }),
4114
+ /* @__PURE__ */ V(
4115
+ kn,
4116
+ {
4117
+ variant: (i = n.output) != null && i.progress ? "determinate" : "indeterminate",
4118
+ value: ((d = n.output) == null ? void 0 : d.progress) * 100,
4119
+ sx: { maxWidth: 500, width: "100%", borderRadius: (u) => u.shape.borderRadius }
4120
+ }
4121
+ )
4122
+ ] }),
4123
+ /* @__PURE__ */ V("div", { style: { flex: 1 } }),
4124
+ /* @__PURE__ */ W(se, { direction: "row", spacing: 1, children: [
4125
+ /* @__PURE__ */ V("div", { style: { flex: 1 } }),
4126
+ n.link && /* @__PURE__ */ V(st, { variant: "outlined", component: "a", target: "_blank", href: n.link, children: s("details.open") }),
4127
+ /* @__PURE__ */ V(st, { variant: "outlined", color: "error", onClick: t, children: s("close") })
4128
+ ] })
4129
+ ] }) }) }) }) : null;
4130
+ }, Fl = Ns(Vl), Kl = new Tl({ removeAdditional: !0, coerceTypes: !0, strict: !1 }), Dr = Kn(null), vd = ({
4131
+ baseURL: e,
4132
+ children: t,
4133
+ classification: r,
4134
+ includeContext: s,
4135
+ getToken: n,
4136
+ onNetworkCall: a
4137
+ }) => {
4138
+ const { t: i, i18n: d } = Ve(Ct, (z) => z.i18next), { ready: u } = Bn(), [l, m] = de(null), [y, b] = de({}), [E, g] = de(!1), [v, h] = de(null), [f, $] = de(!1), [P, j] = de({}), C = ke(() => {
4139
+ const z = {}, H = n == null ? void 0 : n();
4140
+ return H && (z.Authorization = `Bearer ${H}`), a ? a({ baseURL: e, headers: z }) : { baseURL: e, headers: z };
4141
+ }, [e, n, a]), U = je(async () => {
4142
+ if (!u)
4143
+ return;
4144
+ const z = await Ht.actions.get(C);
4145
+ return z && j(z), z;
4146
+ }, [u, C]);
4147
+ Wt(() => {
4148
+ U();
4149
+ }, [e, u]);
4150
+ const J = je(
4151
+ (z, H, x) => JSON.stringify({ type: z, value: H, classification: x ?? r }),
4152
+ [r]
4153
+ ), ne = je(
4154
+ async (z, H, x, Fe) => {
4155
+ const { forceMenu: Ke, onComplete: _e, onCancel: Ae, skipMenu: k, skipResultModal: p, timeout: S, includeContext: _, extraContext: o } = {
4156
+ forceMenu: !1,
4157
+ skipResultModal: !1,
4158
+ skipMenu: !1,
4159
+ onComplete: null,
4160
+ onCancel: null,
4161
+ timeout: null,
4162
+ includeContext: s ?? !1,
4163
+ extraContext: null,
4164
+ ...Fe
4165
+ };
4166
+ if (!Object.keys(P).includes(z))
4167
+ throw new Error("Invalid action id");
4168
+ const c = H.map(
4169
+ (I) => I.type === "telemetry" ? { ...I, value: JSON.stringify(I.value) } : I
4170
+ ), w = P[z], R = Kl.compile(w.params), O = { selectors: c, ...x };
4171
+ let q = null;
4172
+ if (_ && (q = {
4173
+ timestamp: Hn().toISOString(),
4174
+ url: window.location,
4175
+ language: (d == null ? void 0 : d.language) ?? "en"
4176
+ }), Qn(o) || (q = {
4177
+ ...q ?? {},
4178
+ ...o
4179
+ }), $(!0), !R(O) || Ke) {
4180
+ if (k && !Ke)
4181
+ throw console.error(`Form is not valid (${R.errors.length} errors)`), new Error("Form is not completed");
4182
+ (l == null ? void 0 : l.id) === z && (console.error(`Form is not valid (${R.errors.length} errors)`), pt(
4183
+ new CustomEvent(ht, {
4184
+ detail: {
4185
+ message: i("action.error.validation"),
4186
+ level: "error"
4187
+ }
4188
+ })
4189
+ )), m({
4190
+ id: z,
4191
+ action: w,
4192
+ selectors: H,
4193
+ params: O ?? {},
4194
+ skipResultModal: p,
4195
+ context: q,
4196
+ onComplete: _e,
4197
+ onCancel: Ae,
4198
+ timeout: S
4199
+ });
4200
+ return;
4201
+ }
4202
+ try {
4203
+ const I = await Ht.actions.post(
4204
+ z,
4205
+ c,
4206
+ O ?? {},
4207
+ q,
4208
+ { timeout: S },
4209
+ C
4210
+ ), B = { ...I, actionId: z, action: w, params: O };
4211
+ I.outcome !== "pending" && (_e == null || _e(B)), b((ve) => {
4212
+ const De = H.map(($e) => J($e.type, $e.value, $e.classification));
4213
+ return {
4214
+ ...ve,
4215
+ ...De.reduce(
4216
+ ($e, qe) => ({
4217
+ ...$e,
4218
+ [qe]: [...ve[qe] ?? [], B]
4219
+ }),
4220
+ {}
4221
+ )
4222
+ };
4223
+ }), pt(
4224
+ new CustomEvent(ht, {
4225
+ detail: {
4226
+ message: /* @__PURE__ */ W(se, { direction: "row", alignItems: "center", spacing: 0.5, width: "100%", children: [
4227
+ /* @__PURE__ */ V(Pe, { children: I.summary }),
4228
+ I.link && /* @__PURE__ */ V(Nn, { component: "a", href: I.link, size: "small", target: "_blank", children: /* @__PURE__ */ V(Ss, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
4229
+ ] }),
4230
+ timeout: I.link ? null : 5e3,
4231
+ level: I.outcome === "success" ? "success" : I.outcome === "pending" ? "info" : "error",
4232
+ options: {
4233
+ style: {
4234
+ minWidth: 0
4235
+ },
4236
+ SnackbarProps: {
4237
+ style: {
4238
+ minWidth: 0
4239
+ }
4240
+ }
4241
+ }
4242
+ }
4243
+ })
4244
+ ), I.outcome === "success" && m(null), I.outcome === "pending" && (h({ ...I, actionId: z, action: w, onComplete: _e }), p || g(!0), m(null)), I.format && (h({ ...I, actionId: z, action: w }), I.format !== "pivot" && !p ? g(!0) : window.open(I.output, "_blank", "noreferrer"));
4245
+ } catch (I) {
4246
+ pt(
4247
+ new CustomEvent(ht, {
4248
+ detail: {
4249
+ message: I.toString(),
4250
+ level: "error"
4251
+ }
4252
+ })
4253
+ );
4254
+ } finally {
4255
+ $(!1);
4256
+ }
4257
+ },
4258
+ [P, s, J, d == null ? void 0 : d.language, C, l == null ? void 0 : l.id, i]
4259
+ ), ae = je(
4260
+ async (z, H) => {
4261
+ try {
4262
+ return await Ht.actions.status.get(z, H, {}, C);
4263
+ } catch (x) {
4264
+ pt(
4265
+ new CustomEvent(ht, {
4266
+ detail: {
4267
+ message: x.toString(),
4268
+ level: "error"
4269
+ }
4270
+ })
4271
+ );
4272
+ }
4273
+ },
4274
+ [C]
4275
+ ), me = je(() => {
4276
+ var z;
4277
+ (z = l == null ? void 0 : l.onCancel) == null || z.call(l), m(null), $(!1);
4278
+ }, [l == null ? void 0 : l.onCancel]), be = je(
4279
+ (z, H, x) => y[J(z, H, x)] ?? [],
4280
+ [y, J]
4281
+ ), ie = ke(
4282
+ () => ({
4283
+ availableActions: P,
4284
+ executeAction: ne,
4285
+ cancelAction: me,
4286
+ getActionStatus: ae,
4287
+ getActionResults: be,
4288
+ loading: f,
4289
+ refreshActions: U
4290
+ }),
4291
+ [P, me, ne, be, ae, f, U]
4292
+ );
4293
+ return /* @__PURE__ */ W(Dr.Provider, { value: ie, children: [
4294
+ t,
4295
+ /* @__PURE__ */ W(lt, { children: [
4296
+ l && /* @__PURE__ */ V(Ul, { runningActionData: l }),
4297
+ /* @__PURE__ */ V(
4298
+ Fl,
4299
+ {
4300
+ show: E && !!v,
4301
+ result: v,
4302
+ onClose: () => g(!1)
4303
+ }
4304
+ )
4305
+ ] })
4306
+ ] });
4307
+ }, Al = () => An(Dr), ql = En.map((e) => ({
4308
+ ...e,
4309
+ renderer: ({ ...t }) => /* @__PURE__ */ V(lt, { children: /* @__PURE__ */ V(e.renderer, { ...t }) })
4310
+ })), zl = ({ runningActionData: e }) => {
4311
+ const { executeAction: t, cancelAction: r } = Al(), { t: s } = Ve(Ct, (v) => v.i18next), [n, a] = de(!1), [i, d] = de(null), [u, l] = de(e == null ? void 0 : e.params), [m, y] = de(!1), b = ke(
4312
+ () => e != null && e.action ? { ...qn(e.action.params), ...e.action.extra_schema ?? {} } : null,
4313
+ [e == null ? void 0 : e.action]
4314
+ ), E = ke(
4315
+ () => ({
4316
+ type: "VerticalLayout",
4317
+ elements: Object.entries((b == null ? void 0 : b.properties) ?? {}).sort(([v, h], [f, $]) => h.order || $.order ? h.order - $.order : +(b == null ? void 0 : b.required.includes(v)) - +(b == null ? void 0 : b.required.includes(f))).map(([v, h]) => {
4318
+ var f;
4319
+ return {
4320
+ type: "Control",
4321
+ scope: `#/properties/${v}`,
4322
+ options: {
4323
+ autocomplete: !!h.enum || ((f = h.options) == null ? void 0 : f.autocomplete),
4324
+ showUnfocusedDescription: !0,
4325
+ ...h.options
4326
+ },
4327
+ rule: h.rule
4328
+ };
4329
+ })
4330
+ }),
4331
+ [b == null ? void 0 : b.properties, b == null ? void 0 : b.required]
4332
+ ), g = je(async () => {
4333
+ try {
4334
+ a(!0);
4335
+ const v = {};
4336
+ e != null && e.onComplete && (v.onComplete = e == null ? void 0 : e.onComplete), e != null && e.timeout && (v.timeout = e == null ? void 0 : e.timeout), e != null && e.skipResultModal && (v.skipResultModal = e == null ? void 0 : e.skipResultModal), await t(e == null ? void 0 : e.id, e == null ? void 0 : e.selectors, u, v);
4337
+ } catch (v) {
4338
+ console.error(v);
4339
+ } finally {
4340
+ a(!1);
4341
+ }
4342
+ }, [
4343
+ t,
4344
+ e == null ? void 0 : e.id,
4345
+ e == null ? void 0 : e.selectors,
4346
+ e == null ? void 0 : e.onComplete,
4347
+ e == null ? void 0 : e.timeout,
4348
+ e == null ? void 0 : e.skipResultModal,
4349
+ u
4350
+ ]);
4351
+ if (e != null && e.action)
4352
+ try {
4353
+ return /* @__PURE__ */ V(bs, { open: !0, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose: r, children: /* @__PURE__ */ V(
4354
+ Es,
4355
+ {
4356
+ sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", px: 2, pt: 2, minWidth: "750px", overflow: "auto" },
4357
+ children: /* @__PURE__ */ W(
4358
+ se,
4359
+ {
4360
+ spacing: 1,
4361
+ height: "100%",
4362
+ sx: {
4363
+ ".MuiFormHelperText-root": {
4364
+ marginLeft: "0 !important",
4365
+ "&:last-of-type": { mb: 3 }
4366
+ }
4367
+ },
4368
+ children: [
4369
+ /* @__PURE__ */ W(se, { direction: "row", spacing: 1, children: [
4370
+ /* @__PURE__ */ W(se, { direction: "column", spacing: 1, children: [
4371
+ /* @__PURE__ */ W(Pe, { variant: "h5", children: [
4372
+ s("actions.executing"),
4373
+ " ",
4374
+ e == null ? void 0 : e.action.id.replace(/_/g, " ").split(" ").map(wo).join(" ")
4375
+ ] }),
4376
+ (e == null ? void 0 : e.action.summary) && /* @__PURE__ */ V(Pe, { variant: "body1", color: "text.secondary", sx: { pb: 1.5 }, children: e == null ? void 0 : e.action.summary })
4377
+ ] }),
4378
+ /* @__PURE__ */ V(xe, { flex: 1 }),
4379
+ /* @__PURE__ */ V(xe, { alignContent: "end", children: /* @__PURE__ */ V(
4380
+ st,
4381
+ {
4382
+ variant: "outlined",
4383
+ onClick: () => y((v) => !v),
4384
+ startIcon: /* @__PURE__ */ V(
4385
+ xe,
4386
+ {
4387
+ component: "span",
4388
+ sx: (v) => ({
4389
+ transition: v.transitions.create("transform"),
4390
+ transform: m ? "rotate(180deg)" : "rotate(0deg)"
4391
+ }),
4392
+ children: /* @__PURE__ */ V(Ss, { icon: "ic:baseline-keyboard-double-arrow-right" })
4393
+ }
4394
+ ),
4395
+ children: s(m ? "actions.json.hide" : "actions.json.show")
4396
+ }
4397
+ ) })
4398
+ ] }),
4399
+ /* @__PURE__ */ V(Dt, { orientation: "horizontal", variant: "middle" }),
4400
+ /* @__PURE__ */ V(xe, { pt: 1.5 }),
4401
+ /* @__PURE__ */ W(se, { flexGrow: 1, direction: "row", spacing: 1, children: [
4402
+ /* @__PURE__ */ W(se, { direction: "column", flexGrow: 1, children: [
4403
+ /* @__PURE__ */ V(lt, { children: /* @__PURE__ */ V(
4404
+ Pn,
4405
+ {
4406
+ schema: b,
4407
+ uischema: E,
4408
+ renderers: ql,
4409
+ cells: Sn,
4410
+ data: u,
4411
+ onChange: ({ data: v, errors: h }) => {
4412
+ Vn(v, u) || l(v), d(h);
4413
+ },
4414
+ config: {}
4415
+ }
4416
+ ) }),
4417
+ /* @__PURE__ */ W(se, { direction: "row", spacing: 1, pb: 1, children: [
4418
+ /* @__PURE__ */ V("div", { style: { flex: 1 } }),
4419
+ /* @__PURE__ */ V(st, { color: "error", variant: "outlined", onClick: r, children: s("cancel") }),
4420
+ /* @__PURE__ */ V(
4421
+ st,
4422
+ {
4423
+ color: "success",
4424
+ variant: "outlined",
4425
+ disabled: n || (i == null ? void 0 : i.length) > 0,
4426
+ onClick: g,
4427
+ endIcon: n && /* @__PURE__ */ V(Cn, { color: "inherit", size: 18 }),
4428
+ children: s("actions.execute")
4429
+ }
4430
+ )
4431
+ ] })
4432
+ ] }),
4433
+ /* @__PURE__ */ V(jn, { orientation: "horizontal", in: m, unmountOnExit: !0, mountOnEnter: !0, children: /* @__PURE__ */ W(se, { direction: "row", height: "100%", spacing: 1, children: [
4434
+ /* @__PURE__ */ V(Dt, { orientation: "vertical" }),
4435
+ /* @__PURE__ */ W(se, { children: [
4436
+ /* @__PURE__ */ V(Pe, { variant: "h5", children: s("action.data") }),
4437
+ /* @__PURE__ */ V(xe, { width: 600, height: "100%", children: /* @__PURE__ */ V(Rn, { data: u, slotProps: { stack: { height: "100%" }, json: { name: !1 } } }) })
4438
+ ] })
4439
+ ] }) })
4440
+ ] })
4441
+ ]
4442
+ }
4443
+ )
4444
+ }
4445
+ ) });
4446
+ } catch (v) {
4447
+ return console.warn(v), null;
4448
+ }
4449
+ }, Ul = Ns(zl);
4450
+ export {
4451
+ Ul as A,
4452
+ vd as C,
4453
+ Fl as R,
4454
+ Il as a,
4455
+ yd as b,
4456
+ pd as c,
4457
+ _d as d,
4458
+ wo as e,
4459
+ Ml as f,
4460
+ Dr as g,
4461
+ Al as u
4462
+ };