@kong-ui-public/entities-plugins 9.215.0 → 9.215.2

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 (90) hide show
  1. package/dist/entities-plugins.es.js +14007 -13883
  2. package/dist/entities-plugins.umd.js +163 -163
  3. package/dist/filler/cypress/index.js +1 -1
  4. package/dist/filler/field-walker-DWTkzht2.js +4883 -0
  5. package/dist/filler/playwright/index.js +1 -1
  6. package/dist/types/components/CustomPluginForm.vue.d.ts.map +1 -1
  7. package/dist/types/components/PluginCatalog.vue.d.ts.map +1 -1
  8. package/dist/types/components/PluginConfigCard.vue.d.ts.map +1 -1
  9. package/dist/types/components/PluginEntityForm.vue.d.ts.map +1 -1
  10. package/dist/types/components/PluginForm.vue.d.ts.map +1 -1
  11. package/dist/types/components/PluginList.vue.d.ts.map +1 -1
  12. package/dist/types/components/PluginSelect.vue.d.ts.map +1 -1
  13. package/dist/types/components/custom-plugins/DeleteCustomPluginSchemaModal.vue.d.ts.map +1 -1
  14. package/dist/types/components/custom-plugins/PluginCustomGrid.vue.d.ts.map +1 -1
  15. package/dist/types/components/fields/key-auth-identity-realms/Base.vue.d.ts.map +1 -1
  16. package/dist/types/components/fields/kong-identity/ConfigFormContent.vue.d.ts.map +1 -1
  17. package/dist/types/components/fields/kong-identity/KongIdentityField.vue.d.ts.map +1 -1
  18. package/dist/types/components/free-form/plugins/acl/ACLModeCard.vue.d.ts.map +1 -1
  19. package/dist/types/components/free-form/plugins/datakit/CodeEditor.vue.d.ts.map +1 -1
  20. package/dist/types/components/free-form/plugins/datakit/DatakitForm.vue.d.ts.map +1 -1
  21. package/dist/types/components/free-form/plugins/datakit/flow-editor/FlowCanvas.vue.d.ts.map +1 -1
  22. package/dist/types/components/free-form/plugins/datakit/flow-editor/FlowEditor.vue.d.ts.map +1 -1
  23. package/dist/types/components/free-form/plugins/datakit/flow-editor/FlowPanels.vue.d.ts.map +1 -1
  24. package/dist/types/components/free-form/plugins/datakit/flow-editor/VaultSecretPicker.vue.d.ts.map +1 -1
  25. package/dist/types/components/free-form/plugins/datakit/flow-editor/modal/ConflictModal.vue.d.ts.map +1 -1
  26. package/dist/types/components/free-form/plugins/datakit/flow-editor/modal/EditorContent.vue.d.ts.map +1 -1
  27. package/dist/types/components/free-form/plugins/datakit/flow-editor/modal/EditorMain.vue.d.ts.map +1 -1
  28. package/dist/types/components/free-form/plugins/datakit/flow-editor/modal/EditorModal.vue.d.ts.map +1 -1
  29. package/dist/types/components/free-form/plugins/datakit/flow-editor/modal/EditorNav.vue.d.ts.map +1 -1
  30. package/dist/types/components/free-form/plugins/datakit/flow-editor/node/FlowNode.vue.d.ts.map +1 -1
  31. package/dist/types/components/free-form/plugins/datakit/flow-editor/node/NodePropertiesPanel.vue.d.ts.map +1 -1
  32. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/InputsField.vue.d.ts.map +1 -1
  33. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/InputsMapField.vue.d.ts.map +1 -1
  34. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/InputsRecordField.vue.d.ts.map +1 -1
  35. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NameField.vue.d.ts.map +1 -1
  36. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormBranch.vue.d.ts.map +1 -1
  37. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormCache.vue.d.ts.map +1 -1
  38. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormCall.vue.d.ts.map +1 -1
  39. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormExit.vue.d.ts.map +1 -1
  40. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormJq.vue.d.ts.map +1 -1
  41. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormJsonToXml.vue.d.ts.map +1 -1
  42. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormJwtDecode.vue.d.ts.map +1 -1
  43. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormJwtSign.vue.d.ts.map +1 -1
  44. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormJwtVerify.vue.d.ts.map +1 -1
  45. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormProperty.vue.d.ts.map +1 -1
  46. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormResponse.vue.d.ts.map +1 -1
  47. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormServiceRequest.vue.d.ts.map +1 -1
  48. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormStatic.vue.d.ts.map +1 -1
  49. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/NodeFormXmlToJson.vue.d.ts.map +1 -1
  50. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/OutputValueField.vue.d.ts.map +1 -1
  51. package/dist/types/components/free-form/plugins/datakit/flow-editor/node-forms/PropertiesField.vue.d.ts.map +1 -1
  52. package/dist/types/components/free-form/plugins/datakit/flow-editor/side-panel/CacheField.vue.d.ts.map +1 -1
  53. package/dist/types/components/free-form/plugins/datakit/flow-editor/side-panel/NodePanel.vue.d.ts.map +1 -1
  54. package/dist/types/components/free-form/plugins/datakit/flow-editor/side-panel/ResourcesPanel.vue.d.ts.map +1 -1
  55. package/dist/types/components/free-form/plugins/datakit/flow-editor/side-panel/VaultField.vue.d.ts.map +1 -1
  56. package/dist/types/components/free-form/plugins/datakit/flow-editor/store/flow.d.ts +1 -1
  57. package/dist/types/components/free-form/plugins/datakit/flow-editor/store/flow.d.ts.map +1 -1
  58. package/dist/types/components/free-form/plugins/rate-limiting-advanced/RequestLimitsForm.vue.d.ts.map +1 -1
  59. package/dist/types/components/free-form/plugins/request-callout/CalloutsForm.vue.d.ts.map +1 -1
  60. package/dist/types/components/free-form/plugins/service-protection/RequestLimitsForm.vue.d.ts.map +1 -1
  61. package/dist/types/components/free-form/shared/ArrayField.vue.d.ts.map +1 -1
  62. package/dist/types/components/free-form/shared/BooleanField.vue.d.ts.map +1 -1
  63. package/dist/types/components/free-form/shared/CodeEditor.vue.d.ts.map +1 -1
  64. package/dist/types/components/free-form/shared/EnhancedInput.vue.d.ts.map +1 -1
  65. package/dist/types/components/free-form/shared/EnumField.vue.d.ts.map +1 -1
  66. package/dist/types/components/free-form/shared/Field.vue.d.ts.map +1 -1
  67. package/dist/types/components/free-form/shared/ForeignField.vue.d.ts.map +1 -1
  68. package/dist/types/components/free-form/shared/Form.vue.d.ts.map +1 -1
  69. package/dist/types/components/free-form/shared/JsonField.vue.d.ts.map +1 -1
  70. package/dist/types/components/free-form/shared/MapField.vue.d.ts.map +1 -1
  71. package/dist/types/components/free-form/shared/NumberField.vue.d.ts.map +1 -1
  72. package/dist/types/components/free-form/shared/ObjectField.vue.d.ts.map +1 -1
  73. package/dist/types/components/free-form/shared/RadioField.vue.d.ts.map +1 -1
  74. package/dist/types/components/free-form/shared/RedisSelector.vue.d.ts.map +1 -1
  75. package/dist/types/components/free-form/shared/ScopeEntityField.vue.d.ts.map +1 -1
  76. package/dist/types/components/free-form/shared/SlideTransition.vue.d.ts.map +1 -1
  77. package/dist/types/components/free-form/shared/StringArrayField.vue.d.ts.map +1 -1
  78. package/dist/types/components/free-form/shared/StringField.vue.d.ts.map +1 -1
  79. package/dist/types/components/free-form/shared/SwitchField.vue.d.ts.map +1 -1
  80. package/dist/types/components/free-form/shared/layout/PluginConfigurationForm.vue.d.ts.map +1 -1
  81. package/dist/types/components/free-form/shared/layout/StandardLayout.vue.d.ts.map +1 -1
  82. package/dist/types/components/select/PluginCatalogCard.vue.d.ts.map +1 -1
  83. package/dist/types/components/select/PluginCatalogGrid.vue.d.ts.map +1 -1
  84. package/dist/types/components/select/PluginCatalogGroup.vue.d.ts.map +1 -1
  85. package/dist/types/components/select/PluginCatalogListView.vue.d.ts.map +1 -1
  86. package/dist/types/components/select/PluginSelectCard.vue.d.ts.map +1 -1
  87. package/dist/types/components/select/PluginSelectGrid.vue.d.ts.map +1 -1
  88. package/dist/types/components/select/PluginSelectGroup.vue.d.ts.map +1 -1
  89. package/package.json +26 -26
  90. package/dist/filler/field-walker-BWTqU3dI.js +0 -3008
@@ -1,3008 +0,0 @@
1
- var Kr = Object.defineProperty;
2
- var Qr = (t, e, n) => e in t ? Kr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var x = (t, e, n) => Qr(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { get as Jr } from "lodash-es";
5
- const oo = {
6
- // Common
7
- field: (t) => `[data-testid="ff-${t}"]`,
8
- label: (t) => `[data-testid="ff-label-${t}"]`,
9
- // EnumField
10
- selectTrigger: (t) => `[data-testid="ff-enum-${t}-items"]`,
11
- multiSelectItem: (t) => `[data-testid="multiselect-item-${t}"]`,
12
- selectItem: (t) => `[data-testid="select-item-${t}"]`,
13
- // ArrayField
14
- array: (t) => `[data-testid="ff-array-${t}"]`,
15
- arrayTabContainer: (t) => `[data-appearance="tabs"][data-testid="ff-array-${t}"]`,
16
- arrayBasicContainer: (t) => `[data-testid="ff-array-${t}"]:not([data-appearance="tabs"])`,
17
- arrayTabs: (t) => `[data-testid="ff-array-tabs-${t}"]`,
18
- arrayItem: (t, e) => `[data-testid="ff-array-item-${t}.${e}"]`,
19
- arrayAddBtn: (t) => `[data-testid="ff-add-item-btn-${t}"]`,
20
- arrayRemoveBtns: (t) => `[data-testid^="ff-array-remove-item-btn-${t}"]`,
21
- arrayRemoveBtn: (t, e) => `[data-testid="ff-array-remove-item-btn-${t}.${e}"]`,
22
- // ObjectField
23
- object: (t) => `[data-testid="ff-object-${t}"]`,
24
- objectToggleBtn: (t) => `[data-testid="ff-object-toggle-btn-${t}"]`,
25
- objectSwitch: (t) => `[data-testid="ff-object-switch-${t}"]`,
26
- objectContent: (t) => `[data-testid="ff-object-content-${t}"]`,
27
- // MapField
28
- map: (t) => `[data-testid="ff-map-${t}"]`,
29
- mapContainer: (t, e) => `[data-testid="ff-map-container-${t}.${e}"]`,
30
- mapKey: (t, e) => `[data-testid="ff-map-key-${t}.${e}"]`,
31
- mapRemoveBtns: (t) => `[data-testid^="ff-map-remove-btn-${t}"]`,
32
- mapRemoveBtn: (t, e) => `[data-testid="ff-map-remove-btn-${t}.${e}"]`,
33
- mapAddBtn: (t) => `[data-testid="ff-map-add-btn-${t}"]`,
34
- // StringArrayField
35
- tag: (t) => `[data-testid="ff-tag-${t}"]`,
36
- tagInput: (t) => `[data-testid="ff-tag-${t}"] input`,
37
- // JsonField
38
- json: (t) => `[data-testid="ff-json-${t}"]`
39
- };
40
- /**
41
- * @vue/shared v3.5.35
42
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
43
- * @license MIT
44
- **/
45
- const Wt = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
46
- process.env.NODE_ENV !== "production" && Object.freeze([]);
47
- const nr = () => {
48
- }, es = (t) => t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && // uppercase letter
49
- (t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97), ts = (t) => t.startsWith("onUpdate:"), dt = Object.assign, J = Array.isArray, le = (t) => typeof t == "function", ie = (t) => typeof t == "string", ns = (t) => typeof t == "symbol", pe = (t) => t !== null && typeof t == "object";
50
- let Pn;
51
- const mt = () => Pn || (Pn = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
52
- function Jt(t) {
53
- if (J(t)) {
54
- const e = {};
55
- for (let n = 0; n < t.length; n++) {
56
- const r = t[n], s = ie(r) ? os(r) : Jt(r);
57
- if (s)
58
- for (const i in s)
59
- e[i] = s[i];
60
- }
61
- return e;
62
- } else if (ie(t) || pe(t))
63
- return t;
64
- }
65
- const rs = /;(?![^(]*\))/g, ss = /:([^]+)/, is = /\/\*[^]*?\*\//g;
66
- function os(t) {
67
- const e = {};
68
- return t.replace(is, "").split(rs).forEach((n) => {
69
- if (n) {
70
- const r = n.split(ss);
71
- r.length > 1 && (e[r[0].trim()] = r[1].trim());
72
- }
73
- }), e;
74
- }
75
- function en(t) {
76
- let e = "";
77
- if (ie(t))
78
- e = t;
79
- else if (J(t))
80
- for (let n = 0; n < t.length; n++) {
81
- const r = en(t[n]);
82
- r && (e += r + " ");
83
- }
84
- else if (pe(t))
85
- for (const n in t)
86
- t[n] && (e += n + " ");
87
- return e.trim();
88
- }
89
- /**
90
- * @vue/reactivity v3.5.35
91
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
92
- * @license MIT
93
- **/
94
- process.env.NODE_ENV;
95
- process.env.NODE_ENV;
96
- process.env.NODE_ENV;
97
- new Set(
98
- /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((t) => t !== "arguments" && t !== "caller").map((t) => Symbol[t]).filter(ns)
99
- );
100
- // @__NO_SIDE_EFFECTS__
101
- function rr(t) {
102
- return /* @__PURE__ */ qt(t) ? /* @__PURE__ */ rr(t.__v_raw) : !!(t && t.__v_isReactive);
103
- }
104
- // @__NO_SIDE_EFFECTS__
105
- function qt(t) {
106
- return !!(t && t.__v_isReadonly);
107
- }
108
- // @__NO_SIDE_EFFECTS__
109
- function vt(t) {
110
- return !!(t && t.__v_isShallow);
111
- }
112
- // @__NO_SIDE_EFFECTS__
113
- function Yt(t) {
114
- return t ? !!t.__v_raw : !1;
115
- }
116
- // @__NO_SIDE_EFFECTS__
117
- function he(t) {
118
- const e = t && t.__v_raw;
119
- return e ? /* @__PURE__ */ he(e) : t;
120
- }
121
- // @__NO_SIDE_EFFECTS__
122
- function gt(t) {
123
- return t ? t.__v_isRef === !0 : !1;
124
- }
125
- function ls(t) {
126
- return /* @__PURE__ */ gt(t) ? t.value : t;
127
- }
128
- function as(t) {
129
- return le(t) ? t() : ls(t);
130
- }
131
- /**
132
- * @vue/runtime-core v3.5.35
133
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
134
- * @license MIT
135
- **/
136
- const de = [];
137
- function cs(t) {
138
- de.push(t);
139
- }
140
- function us() {
141
- de.pop();
142
- }
143
- let zt = !1;
144
- function Ne(t, ...e) {
145
- if (zt) return;
146
- zt = !0;
147
- const n = de.length ? de[de.length - 1].component : null, r = n && n.appContext.config.warnHandler, s = fs();
148
- if (r)
149
- tn(
150
- r,
151
- n,
152
- 11,
153
- [
154
- // eslint-disable-next-line no-restricted-syntax
155
- t + e.map((i) => {
156
- var o, a;
157
- return (a = (o = i.toString) == null ? void 0 : o.call(i)) != null ? a : JSON.stringify(i);
158
- }).join(""),
159
- n && n.proxy,
160
- s.map(
161
- ({ vnode: i }) => `at <${yr(n, i.type)}>`
162
- ).join(`
163
- `),
164
- s
165
- ]
166
- );
167
- else {
168
- const i = [`[Vue warn]: ${t}`, ...e];
169
- s.length && i.push(`
170
- `, ...ps(s)), console.warn(...i);
171
- }
172
- zt = !1;
173
- }
174
- function fs() {
175
- let t = de[de.length - 1];
176
- if (!t)
177
- return [];
178
- const e = [];
179
- for (; t; ) {
180
- const n = e[0];
181
- n && n.vnode === t ? n.recurseCount++ : e.push({
182
- vnode: t,
183
- recurseCount: 0
184
- });
185
- const r = t.component && t.component.parent;
186
- t = r && r.vnode;
187
- }
188
- return e;
189
- }
190
- function ps(t) {
191
- const e = [];
192
- return t.forEach((n, r) => {
193
- e.push(...r === 0 ? [] : [`
194
- `], ...hs(n));
195
- }), e;
196
- }
197
- function hs({ vnode: t, recurseCount: e }) {
198
- const n = e > 0 ? `... (${e} recursive calls)` : "", r = t.component ? t.component.parent == null : !1, s = ` at <${yr(
199
- t.component,
200
- t.type,
201
- r
202
- )}`, i = ">" + n;
203
- return t.props ? [s, ...ds(t.props), i] : [s + i];
204
- }
205
- function ds(t) {
206
- const e = [], n = Object.keys(t);
207
- return n.slice(0, 3).forEach((r) => {
208
- e.push(...sr(r, t[r]));
209
- }), n.length > 3 && e.push(" ..."), e;
210
- }
211
- function sr(t, e, n) {
212
- return ie(e) ? (e = JSON.stringify(e), n ? e : [`${t}=${e}`]) : typeof e == "number" || typeof e == "boolean" || e == null ? n ? e : [`${t}=${e}`] : /* @__PURE__ */ gt(e) ? (e = sr(t, /* @__PURE__ */ he(e.value), !0), n ? e : [`${t}=Ref<`, e, ">"]) : le(e) ? [`${t}=fn${e.name ? `<${e.name}>` : ""}`] : (e = /* @__PURE__ */ he(e), n ? e : [`${t}=`, e]);
213
- }
214
- const ir = {
215
- sp: "serverPrefetch hook",
216
- bc: "beforeCreate hook",
217
- c: "created hook",
218
- bm: "beforeMount hook",
219
- m: "mounted hook",
220
- bu: "beforeUpdate hook",
221
- u: "updated",
222
- bum: "beforeUnmount hook",
223
- um: "unmounted hook",
224
- a: "activated hook",
225
- da: "deactivated hook",
226
- ec: "errorCaptured hook",
227
- rtc: "renderTracked hook",
228
- rtg: "renderTriggered hook",
229
- 0: "setup function",
230
- 1: "render function",
231
- 2: "watcher getter",
232
- 3: "watcher callback",
233
- 4: "watcher cleanup function",
234
- 5: "native event handler",
235
- 6: "component event handler",
236
- 7: "vnode hook",
237
- 8: "directive hook",
238
- 9: "transition hook",
239
- 10: "app errorHandler",
240
- 11: "app warnHandler",
241
- 12: "ref function",
242
- 13: "async component loader",
243
- 14: "scheduler flush",
244
- 15: "component update",
245
- 16: "app unmount cleanup function"
246
- };
247
- function tn(t, e, n, r) {
248
- try {
249
- return r ? t(...r) : t();
250
- } catch (s) {
251
- or(s, e, n);
252
- }
253
- }
254
- function or(t, e, n, r = !0) {
255
- const s = e ? e.vnode : null, { errorHandler: i, throwUnhandledErrorInProduction: o } = e && e.appContext.config || Wt;
256
- if (e) {
257
- let a = e.parent;
258
- const c = e.proxy, h = process.env.NODE_ENV !== "production" ? ir[n] : `https://vuejs.org/error-reference/#runtime-${n}`;
259
- for (; a; ) {
260
- const p = a.ec;
261
- if (p) {
262
- for (let f = 0; f < p.length; f++)
263
- if (p[f](t, c, h) === !1)
264
- return;
265
- }
266
- a = a.parent;
267
- }
268
- if (i) {
269
- tn(i, null, 10, [
270
- t,
271
- c,
272
- h
273
- ]);
274
- return;
275
- }
276
- }
277
- ms(t, n, s, r, o);
278
- }
279
- function ms(t, e, n, r = !0, s = !1) {
280
- if (process.env.NODE_ENV !== "production") {
281
- const i = ir[e];
282
- if (n && cs(n), Ne(`Unhandled error${i ? ` during execution of ${i}` : ""}`), n && us(), r)
283
- throw t;
284
- console.error(t);
285
- } else {
286
- if (s)
287
- throw t;
288
- console.error(t);
289
- }
290
- }
291
- const V = [];
292
- let ne = -1;
293
- const Ie = [];
294
- let se = null, Ae = 0;
295
- const gs = /* @__PURE__ */ Promise.resolve();
296
- let Zt = null;
297
- const bs = 100;
298
- function ys(t) {
299
- let e = ne + 1, n = V.length;
300
- for (; e < n; ) {
301
- const r = e + n >>> 1, s = V[r], i = Be(s);
302
- i < t || i === t && s.flags & 2 ? e = r + 1 : n = r;
303
- }
304
- return e;
305
- }
306
- function _s(t) {
307
- if (!(t.flags & 1)) {
308
- const e = Be(t), n = V[V.length - 1];
309
- !n || // fast path when the job id is larger than the tail
310
- !(t.flags & 2) && e >= Be(n) ? V.push(t) : V.splice(ys(e), 0, t), t.flags |= 1, lr();
311
- }
312
- }
313
- function lr() {
314
- Zt || (Zt = gs.then(ar));
315
- }
316
- function ks(t) {
317
- J(t) ? Ie.push(...t) : se && t.id === -1 ? se.splice(Ae + 1, 0, t) : t.flags & 1 || (Ie.push(t), t.flags |= 1), lr();
318
- }
319
- function Ts(t) {
320
- if (Ie.length) {
321
- const e = [...new Set(Ie)].sort(
322
- (n, r) => Be(n) - Be(r)
323
- );
324
- if (Ie.length = 0, se) {
325
- se.push(...e);
326
- return;
327
- }
328
- for (se = e, process.env.NODE_ENV !== "production" && (t = t || /* @__PURE__ */ new Map()), Ae = 0; Ae < se.length; Ae++) {
329
- const n = se[Ae];
330
- process.env.NODE_ENV !== "production" && cr(t, n) || (n.flags & 4 && (n.flags &= -2), n.flags & 8 || n(), n.flags &= -2);
331
- }
332
- se = null, Ae = 0;
333
- }
334
- }
335
- const Be = (t) => t.id == null ? t.flags & 2 ? -1 : 1 / 0 : t.id;
336
- function ar(t) {
337
- process.env.NODE_ENV !== "production" && (t = t || /* @__PURE__ */ new Map());
338
- const e = process.env.NODE_ENV !== "production" ? (n) => cr(t, n) : nr;
339
- try {
340
- for (ne = 0; ne < V.length; ne++) {
341
- const n = V[ne];
342
- if (n && !(n.flags & 8)) {
343
- if (process.env.NODE_ENV !== "production" && e(n))
344
- continue;
345
- n.flags & 4 && (n.flags &= -2), tn(
346
- n,
347
- n.i,
348
- n.i ? 15 : 14
349
- ), n.flags & 4 || (n.flags &= -2);
350
- }
351
- }
352
- } finally {
353
- for (; ne < V.length; ne++) {
354
- const n = V[ne];
355
- n && (n.flags &= -2);
356
- }
357
- ne = -1, V.length = 0, Ts(t), Zt = null, (V.length || Ie.length) && ar(t);
358
- }
359
- }
360
- function cr(t, e) {
361
- const n = t.get(e) || 0;
362
- if (n > bs) {
363
- const r = e.i, s = r && br(r.type);
364
- return or(
365
- `Maximum recursive updates exceeded${s ? ` in component <${s}>` : ""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
366
- null,
367
- 10
368
- ), !0;
369
- }
370
- return t.set(e, n + 1), !1;
371
- }
372
- const Ft = /* @__PURE__ */ new Map();
373
- process.env.NODE_ENV !== "production" && (mt().__VUE_HMR_RUNTIME__ = {
374
- createRecord: Ut(ws),
375
- rerender: Ut(xs),
376
- reload: Ut(Es)
377
- });
378
- const lt = /* @__PURE__ */ new Map();
379
- function ws(t, e) {
380
- return lt.has(t) ? !1 : (lt.set(t, {
381
- initialDef: at(e),
382
- instances: /* @__PURE__ */ new Set()
383
- }), !0);
384
- }
385
- function at(t) {
386
- return _r(t) ? t.__vccOpts : t;
387
- }
388
- function xs(t, e) {
389
- const n = lt.get(t);
390
- n && (n.initialDef.render = e, [...n.instances].forEach((r) => {
391
- e && (r.render = e, at(r.type).render = e), r.renderCache = [], r.job.flags & 8 || r.update();
392
- }));
393
- }
394
- function Es(t, e) {
395
- const n = lt.get(t);
396
- if (!n) return;
397
- e = at(e), vn(n.initialDef, e);
398
- const r = [...n.instances];
399
- for (let s = 0; s < r.length; s++) {
400
- const i = r[s], o = at(i.type);
401
- let a = Ft.get(o);
402
- a || (o !== n.initialDef && vn(o, e), Ft.set(o, a = /* @__PURE__ */ new Set())), a.add(i), i.appContext.propsCache.delete(i.type), i.appContext.emitsCache.delete(i.type), i.appContext.optionsCache.delete(i.type), i.ceReload ? (a.add(i), i.ceReload(e.styles), a.delete(i)) : i.parent ? _s(() => {
403
- i.job.flags & 8 || (i.parent.update(), a.delete(i));
404
- }) : i.appContext.reload ? i.appContext.reload() : typeof window < "u" ? window.location.reload() : console.warn(
405
- "[HMR] Root or manually mounted instance modified. Full reload required."
406
- ), i.root.ce && i !== i.root && i.root.ce._removeChildStyle(o);
407
- }
408
- ks(() => {
409
- Ft.clear();
410
- });
411
- }
412
- function vn(t, e) {
413
- dt(t, e);
414
- for (const n in t)
415
- n !== "__file" && !(n in e) && delete t[n];
416
- }
417
- function Ut(t) {
418
- return (e, n) => {
419
- try {
420
- return t(e, n);
421
- } catch (r) {
422
- console.error(r), console.warn(
423
- "[HMR] Something went wrong during Vue component hot-reload. Full reload required."
424
- );
425
- }
426
- };
427
- }
428
- let Se, nt = [];
429
- function ur(t, e) {
430
- var n, r;
431
- Se = t, Se ? (Se.enabled = !0, nt.forEach(({ event: s, args: i }) => Se.emit(s, ...i)), nt = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
432
- window.HTMLElement && // also exclude jsdom
433
- // eslint-disable-next-line no-restricted-syntax
434
- !((r = (n = window.navigator) == null ? void 0 : n.userAgent) != null && r.includes("jsdom")) ? ((e.__VUE_DEVTOOLS_HOOK_REPLAY__ = e.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((i) => {
435
- ur(i, e);
436
- }), setTimeout(() => {
437
- Se || (e.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, nt = []);
438
- }, 3e3)) : nt = [];
439
- }
440
- let ct = null, As = null;
441
- const Ss = (t) => t.__isTeleport;
442
- function fr(t, e) {
443
- t.shapeFlag & 6 && t.component ? (t.transition = e, fr(t.component.subTree, e)) : t.shapeFlag & 128 ? (t.ssContent.transition = e.clone(t.ssContent), t.ssFallback.transition = e.clone(t.ssFallback)) : t.transition = e;
444
- }
445
- mt().requestIdleCallback;
446
- mt().cancelIdleCallback;
447
- const Rs = /* @__PURE__ */ Symbol.for("v-ndc"), Os = {};
448
- process.env.NODE_ENV !== "production" && (Os.ownKeys = (t) => (Ne(
449
- "Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
450
- ), Reflect.ownKeys(t)));
451
- const Is = {}, pr = (t) => Object.getPrototypeOf(t) === Is, Ns = (t) => t.__isSuspense, hr = /* @__PURE__ */ Symbol.for("v-fgt"), Ds = /* @__PURE__ */ Symbol.for("v-txt"), Cs = /* @__PURE__ */ Symbol.for("v-cmt");
452
- function Ls(t) {
453
- return t ? t.__v_isVNode === !0 : !1;
454
- }
455
- const Ms = (...t) => mr(
456
- ...t
457
- ), dr = ({ key: t }) => t ?? null, ot = ({
458
- ref: t,
459
- ref_key: e,
460
- ref_for: n
461
- }) => (typeof t == "number" && (t = "" + t), t != null ? ie(t) || /* @__PURE__ */ gt(t) || le(t) ? { i: ct, r: t, k: e, f: !!n } : t : null);
462
- function $s(t, e = null, n = null, r = 0, s = null, i = t === hr ? 0 : 1, o = !1, a = !1) {
463
- const c = {
464
- __v_isVNode: !0,
465
- __v_skip: !0,
466
- type: t,
467
- props: e,
468
- key: e && dr(e),
469
- ref: e && ot(e),
470
- scopeId: As,
471
- slotScopeIds: null,
472
- children: n,
473
- component: null,
474
- suspense: null,
475
- ssContent: null,
476
- ssFallback: null,
477
- dirs: null,
478
- transition: null,
479
- el: null,
480
- anchor: null,
481
- target: null,
482
- targetStart: null,
483
- targetAnchor: null,
484
- staticCount: 0,
485
- shapeFlag: i,
486
- patchFlag: r,
487
- dynamicProps: s,
488
- dynamicChildren: null,
489
- appContext: null,
490
- ctx: ct
491
- };
492
- return a ? (nn(c, n), i & 128 && t.normalize(c)) : n && (c.shapeFlag |= ie(n) ? 8 : 16), process.env.NODE_ENV !== "production" && c.key !== c.key && Ne("VNode created with invalid key (NaN). VNode type:", c.type), c;
493
- }
494
- const Ps = process.env.NODE_ENV !== "production" ? Ms : mr;
495
- function mr(t, e = null, n = null, r = 0, s = null, i = !1) {
496
- if ((!t || t === Rs) && (process.env.NODE_ENV !== "production" && !t && Ne(`Invalid vnode type when creating vnode: ${t}.`), t = Cs), Ls(t)) {
497
- const a = ut(
498
- t,
499
- e,
500
- !0
501
- /* mergeRef: true */
502
- );
503
- return n && nn(a, n), a.patchFlag = -2, a;
504
- }
505
- if (_r(t) && (t = t.__vccOpts), e) {
506
- e = vs(e);
507
- let { class: a, style: c } = e;
508
- a && !ie(a) && (e.class = en(a)), pe(c) && (/* @__PURE__ */ Yt(c) && !J(c) && (c = dt({}, c)), e.style = Jt(c));
509
- }
510
- const o = ie(t) ? 1 : Ns(t) ? 128 : Ss(t) ? 64 : pe(t) ? 4 : le(t) ? 2 : 0;
511
- return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */ Yt(t) && (t = /* @__PURE__ */ he(t), Ne(
512
- "Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",
513
- `
514
- Component that was made reactive: `,
515
- t
516
- )), $s(
517
- t,
518
- e,
519
- n,
520
- r,
521
- s,
522
- o,
523
- i,
524
- !0
525
- );
526
- }
527
- function vs(t) {
528
- return t ? /* @__PURE__ */ Yt(t) || pr(t) ? dt({}, t) : t : null;
529
- }
530
- function ut(t, e, n = !1, r = !1) {
531
- const { props: s, ref: i, patchFlag: o, children: a, transition: c } = t, h = e ? Fs(s || {}, e) : s, p = {
532
- __v_isVNode: !0,
533
- __v_skip: !0,
534
- type: t.type,
535
- props: h,
536
- key: h && dr(h),
537
- ref: e && e.ref ? (
538
- // #2078 in the case of <component :is="vnode" ref="extra"/>
539
- // if the vnode itself already has a ref, cloneVNode will need to merge
540
- // the refs so the single vnode can be set on multiple refs
541
- n && i ? J(i) ? i.concat(ot(e)) : [i, ot(e)] : ot(e)
542
- ) : i,
543
- scopeId: t.scopeId,
544
- slotScopeIds: t.slotScopeIds,
545
- children: process.env.NODE_ENV !== "production" && o === -1 && J(a) ? a.map(gr) : a,
546
- target: t.target,
547
- targetStart: t.targetStart,
548
- targetAnchor: t.targetAnchor,
549
- staticCount: t.staticCount,
550
- shapeFlag: t.shapeFlag,
551
- // if the vnode is cloned with extra props, we can no longer assume its
552
- // existing patch flag to be reliable and need to add the FULL_PROPS flag.
553
- // note: preserve flag for fragments since they use the flag for children
554
- // fast paths only.
555
- patchFlag: e && t.type !== hr ? o === -1 ? 16 : o | 16 : o,
556
- dynamicProps: t.dynamicProps,
557
- dynamicChildren: t.dynamicChildren,
558
- appContext: t.appContext,
559
- dirs: t.dirs,
560
- transition: c,
561
- // These should technically only be non-null on mounted VNodes. However,
562
- // they *should* be copied for kept-alive vnodes. So we just always copy
563
- // them since them being non-null during a mount doesn't affect the logic as
564
- // they will simply be overwritten.
565
- component: t.component,
566
- suspense: t.suspense,
567
- ssContent: t.ssContent && ut(t.ssContent),
568
- ssFallback: t.ssFallback && ut(t.ssFallback),
569
- placeholder: t.placeholder,
570
- el: t.el,
571
- anchor: t.anchor,
572
- ctx: t.ctx,
573
- ce: t.ce
574
- };
575
- return c && r && fr(
576
- p,
577
- c.clone(p)
578
- ), p;
579
- }
580
- function gr(t) {
581
- const e = ut(t);
582
- return J(t.children) && (e.children = t.children.map(gr)), e;
583
- }
584
- function zs(t = " ", e = 0) {
585
- return Ps(Ds, null, t, e);
586
- }
587
- function nn(t, e) {
588
- let n = 0;
589
- const { shapeFlag: r } = t;
590
- if (e == null)
591
- e = null;
592
- else if (J(e))
593
- n = 16;
594
- else if (typeof e == "object")
595
- if (r & 65) {
596
- const s = e.default;
597
- s && (s._c && (s._d = !1), nn(t, s()), s._c && (s._d = !0));
598
- return;
599
- } else
600
- n = 32, !e._ && !pr(e) && (e._ctx = ct);
601
- else le(e) ? (e = { default: e, _ctx: ct }, n = 32) : (e = String(e), r & 64 ? (n = 16, e = [zs(e)]) : n = 8);
602
- t.children = e, t.shapeFlag |= n;
603
- }
604
- function Fs(...t) {
605
- const e = {};
606
- for (let n = 0; n < t.length; n++) {
607
- const r = t[n];
608
- for (const s in r)
609
- if (s === "class")
610
- e.class !== r.class && (e.class = en([e.class, r.class]));
611
- else if (s === "style")
612
- e.style = Jt([e.style, r.style]);
613
- else if (es(s)) {
614
- const i = e[s], o = r[s];
615
- o && i !== o && !(J(i) && i.includes(o)) ? e[s] = i ? [].concat(i, o) : o : o == null && i == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
616
- // the model listener.
617
- !ts(s) && (e[s] = o);
618
- } else s !== "" && (e[s] = r[s]);
619
- }
620
- return e;
621
- }
622
- {
623
- const t = mt(), e = (n, r) => {
624
- let s;
625
- return (s = t[n]) || (s = t[n] = []), s.push(r), (i) => {
626
- s.length > 1 ? s.forEach((o) => o(i)) : s[0](i);
627
- };
628
- };
629
- e(
630
- "__VUE_INSTANCE_SETTERS__",
631
- (n) => n
632
- ), e(
633
- "__VUE_SSR_SETTERS__",
634
- (n) => n
635
- );
636
- }
637
- process.env.NODE_ENV;
638
- const Us = /(?:^|[-_])\w/g, Hs = (t) => t.replace(Us, (e) => e.toUpperCase()).replace(/[-_]/g, "");
639
- function br(t, e = !0) {
640
- return le(t) ? t.displayName || t.name : t.name || e && t.__name;
641
- }
642
- function yr(t, e, n = !1) {
643
- let r = br(e);
644
- if (!r && e.__file) {
645
- const s = e.__file.match(/([^/\\]+)\.\w+$/);
646
- s && (r = s[1]);
647
- }
648
- if (!r && t) {
649
- const s = (i) => {
650
- for (const o in i)
651
- if (i[o] === e)
652
- return o;
653
- };
654
- r = s(t.components) || t.parent && s(
655
- t.parent.type.components
656
- ) || s(t.appContext.components);
657
- }
658
- return r ? Hs(r) : n ? "App" : "Anonymous";
659
- }
660
- function _r(t) {
661
- return le(t) && "__vccOpts" in t;
662
- }
663
- function Bs() {
664
- if (process.env.NODE_ENV === "production" || typeof window > "u")
665
- return;
666
- const t = { style: "color:#3ba776" }, e = { style: "color:#1677ff" }, n = { style: "color:#f5222d" }, r = { style: "color:#eb2f96" }, s = {
667
- __vue_custom_formatter: !0,
668
- header(f) {
669
- if (!pe(f))
670
- return null;
671
- if (f.__isVue)
672
- return ["div", t, "VueInstance"];
673
- if (/* @__PURE__ */ gt(f)) {
674
- const m = f.value;
675
- return [
676
- "div",
677
- {},
678
- ["span", t, p(f)],
679
- "<",
680
- a(m),
681
- ">"
682
- ];
683
- } else {
684
- if (/* @__PURE__ */ rr(f))
685
- return [
686
- "div",
687
- {},
688
- ["span", t, /* @__PURE__ */ vt(f) ? "ShallowReactive" : "Reactive"],
689
- "<",
690
- a(f),
691
- `>${/* @__PURE__ */ qt(f) ? " (readonly)" : ""}`
692
- ];
693
- if (/* @__PURE__ */ qt(f))
694
- return [
695
- "div",
696
- {},
697
- ["span", t, /* @__PURE__ */ vt(f) ? "ShallowReadonly" : "Readonly"],
698
- "<",
699
- a(f),
700
- ">"
701
- ];
702
- }
703
- return null;
704
- },
705
- hasBody(f) {
706
- return f && f.__isVue;
707
- },
708
- body(f) {
709
- if (f && f.__isVue)
710
- return [
711
- "div",
712
- {},
713
- ...i(f.$)
714
- ];
715
- }
716
- };
717
- function i(f) {
718
- const m = [];
719
- f.type.props && f.props && m.push(o("props", /* @__PURE__ */ he(f.props))), f.setupState !== Wt && m.push(o("setup", f.setupState)), f.data !== Wt && m.push(o("data", /* @__PURE__ */ he(f.data)));
720
- const _ = c(f, "computed");
721
- _ && m.push(o("computed", _));
722
- const b = c(f, "inject");
723
- return b && m.push(o("injected", b)), m.push([
724
- "div",
725
- {},
726
- [
727
- "span",
728
- {
729
- style: r.style + ";opacity:0.66"
730
- },
731
- "$ (internal): "
732
- ],
733
- ["object", { object: f }]
734
- ]), m;
735
- }
736
- function o(f, m) {
737
- return m = dt({}, m), Object.keys(m).length ? [
738
- "div",
739
- { style: "line-height:1.25em;margin-bottom:0.6em" },
740
- [
741
- "div",
742
- {
743
- style: "color:#476582"
744
- },
745
- f
746
- ],
747
- [
748
- "div",
749
- {
750
- style: "padding-left:1.25em"
751
- },
752
- ...Object.keys(m).map((_) => [
753
- "div",
754
- {},
755
- ["span", r, _ + ": "],
756
- a(m[_], !1)
757
- ])
758
- ]
759
- ] : ["span", {}];
760
- }
761
- function a(f, m = !0) {
762
- return typeof f == "number" ? ["span", e, f] : typeof f == "string" ? ["span", n, JSON.stringify(f)] : typeof f == "boolean" ? ["span", r, f] : pe(f) ? ["object", { object: m ? /* @__PURE__ */ he(f) : f }] : ["span", n, String(f)];
763
- }
764
- function c(f, m) {
765
- const _ = f.type;
766
- if (le(_))
767
- return;
768
- const b = {};
769
- for (const E in f.ctx)
770
- h(_, E, m) && (b[E] = f.ctx[E]);
771
- return b;
772
- }
773
- function h(f, m, _) {
774
- const b = f[_];
775
- if (J(b) && b.includes(m) || pe(b) && m in b || f.extends && h(f.extends, m, _) || f.mixins && f.mixins.some((E) => h(E, m, _)))
776
- return !0;
777
- }
778
- function p(f) {
779
- return /* @__PURE__ */ vt(f) ? "ShallowRef" : f.effect ? "ComputedRef" : "Ref";
780
- }
781
- window.devtoolsFormatters ? window.devtoolsFormatters.push(s) : window.devtoolsFormatters = [s];
782
- }
783
- process.env.NODE_ENV;
784
- process.env.NODE_ENV;
785
- process.env.NODE_ENV;
786
- /**
787
- * vue v3.5.35
788
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
789
- * @license MIT
790
- **/
791
- function js() {
792
- Bs();
793
- }
794
- process.env.NODE_ENV !== "production" && js();
795
- const kr = "*", Tr = "#", wr = ".";
796
- function oe(...t) {
797
- return t.join(wr);
798
- }
799
- function Vs(t) {
800
- return t.split(wr).filter((e) => e !== "");
801
- }
802
- function Gs(t) {
803
- const e = as(t);
804
- return e ? e.type === "set" && e.elements.type === "string" && !e.elements.one_of : !1;
805
- }
806
- function Ws(t) {
807
- return "one_of" in t && Array.isArray(t.one_of);
808
- }
809
- function lo(t) {
810
- return t.type === "set" && "elements" in t && "one_of" in t.elements;
811
- }
812
- function rn() {
813
- return {
814
- async: !1,
815
- breaks: !1,
816
- extensions: null,
817
- gfm: !0,
818
- hooks: null,
819
- pedantic: !1,
820
- renderer: null,
821
- silent: !1,
822
- tokenizer: null,
823
- walkTokens: null
824
- };
825
- }
826
- let ge = rn();
827
- function xr(t) {
828
- ge = t;
829
- }
830
- const Er = /[&<>"']/, qs = new RegExp(Er.source, "g"), Ar = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Ys = new RegExp(Ar.source, "g"), Zs = {
831
- "&": "&amp;",
832
- "<": "&lt;",
833
- ">": "&gt;",
834
- '"': "&quot;",
835
- "'": "&#39;"
836
- }, zn = (t) => Zs[t];
837
- function H(t, e) {
838
- if (e) {
839
- if (Er.test(t))
840
- return t.replace(qs, zn);
841
- } else if (Ar.test(t))
842
- return t.replace(Ys, zn);
843
- return t;
844
- }
845
- const Xs = /(^|[^\[])\^/g;
846
- function w(t, e) {
847
- let n = typeof t == "string" ? t : t.source;
848
- e = e || "";
849
- const r = {
850
- replace: (s, i) => {
851
- let o = typeof i == "string" ? i : i.source;
852
- return o = o.replace(Xs, "$1"), n = n.replace(s, o), r;
853
- },
854
- getRegex: () => new RegExp(n, e)
855
- };
856
- return r;
857
- }
858
- function Fn(t) {
859
- try {
860
- t = encodeURI(t).replace(/%25/g, "%");
861
- } catch {
862
- return null;
863
- }
864
- return t;
865
- }
866
- const Ue = { exec: () => null };
867
- function Un(t, e) {
868
- const n = t.replace(/\|/g, (i, o, a) => {
869
- let c = !1, h = o;
870
- for (; --h >= 0 && a[h] === "\\"; )
871
- c = !c;
872
- return c ? "|" : " |";
873
- }), r = n.split(/ \|/);
874
- let s = 0;
875
- if (r[0].trim() || r.shift(), r.length > 0 && !r[r.length - 1].trim() && r.pop(), e)
876
- if (r.length > e)
877
- r.splice(e);
878
- else
879
- for (; r.length < e; )
880
- r.push("");
881
- for (; s < r.length; s++)
882
- r[s] = r[s].trim().replace(/\\\|/g, "|");
883
- return r;
884
- }
885
- function Pe(t, e, n) {
886
- const r = t.length;
887
- if (r === 0)
888
- return "";
889
- let s = 0;
890
- for (; s < r && t.charAt(r - s - 1) === e; )
891
- s++;
892
- return t.slice(0, r - s);
893
- }
894
- function Ks(t, e) {
895
- if (t.indexOf(e[1]) === -1)
896
- return -1;
897
- let n = 0;
898
- for (let r = 0; r < t.length; r++)
899
- if (t[r] === "\\")
900
- r++;
901
- else if (t[r] === e[0])
902
- n++;
903
- else if (t[r] === e[1] && (n--, n < 0))
904
- return r;
905
- return -1;
906
- }
907
- function Hn(t, e, n, r) {
908
- const s = e.href, i = e.title ? H(e.title) : null, o = t[1].replace(/\\([\[\]])/g, "$1");
909
- if (t[0].charAt(0) !== "!") {
910
- r.state.inLink = !0;
911
- const a = {
912
- type: "link",
913
- raw: n,
914
- href: s,
915
- title: i,
916
- text: o,
917
- tokens: r.inlineTokens(o)
918
- };
919
- return r.state.inLink = !1, a;
920
- }
921
- return {
922
- type: "image",
923
- raw: n,
924
- href: s,
925
- title: i,
926
- text: H(o)
927
- };
928
- }
929
- function Qs(t, e) {
930
- const n = t.match(/^(\s+)(?:```)/);
931
- if (n === null)
932
- return e;
933
- const r = n[1];
934
- return e.split(`
935
- `).map((s) => {
936
- const i = s.match(/^\s+/);
937
- if (i === null)
938
- return s;
939
- const [o] = i;
940
- return o.length >= r.length ? s.slice(r.length) : s;
941
- }).join(`
942
- `);
943
- }
944
- class ft {
945
- // set by the lexer
946
- constructor(e) {
947
- x(this, "options");
948
- x(this, "rules");
949
- // set by the lexer
950
- x(this, "lexer");
951
- this.options = e || ge;
952
- }
953
- space(e) {
954
- const n = this.rules.block.newline.exec(e);
955
- if (n && n[0].length > 0)
956
- return {
957
- type: "space",
958
- raw: n[0]
959
- };
960
- }
961
- code(e) {
962
- const n = this.rules.block.code.exec(e);
963
- if (n) {
964
- const r = n[0].replace(/^(?: {1,4}| {0,3}\t)/gm, "");
965
- return {
966
- type: "code",
967
- raw: n[0],
968
- codeBlockStyle: "indented",
969
- text: this.options.pedantic ? r : Pe(r, `
970
- `)
971
- };
972
- }
973
- }
974
- fences(e) {
975
- const n = this.rules.block.fences.exec(e);
976
- if (n) {
977
- const r = n[0], s = Qs(r, n[3] || "");
978
- return {
979
- type: "code",
980
- raw: r,
981
- lang: n[2] ? n[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : n[2],
982
- text: s
983
- };
984
- }
985
- }
986
- heading(e) {
987
- const n = this.rules.block.heading.exec(e);
988
- if (n) {
989
- let r = n[2].trim();
990
- if (/#$/.test(r)) {
991
- const s = Pe(r, "#");
992
- (this.options.pedantic || !s || / $/.test(s)) && (r = s.trim());
993
- }
994
- return {
995
- type: "heading",
996
- raw: n[0],
997
- depth: n[1].length,
998
- text: r,
999
- tokens: this.lexer.inline(r)
1000
- };
1001
- }
1002
- }
1003
- hr(e) {
1004
- const n = this.rules.block.hr.exec(e);
1005
- if (n)
1006
- return {
1007
- type: "hr",
1008
- raw: Pe(n[0], `
1009
- `)
1010
- };
1011
- }
1012
- blockquote(e) {
1013
- const n = this.rules.block.blockquote.exec(e);
1014
- if (n) {
1015
- let r = Pe(n[0], `
1016
- `).split(`
1017
- `), s = "", i = "";
1018
- const o = [];
1019
- for (; r.length > 0; ) {
1020
- let a = !1;
1021
- const c = [];
1022
- let h;
1023
- for (h = 0; h < r.length; h++)
1024
- if (/^ {0,3}>/.test(r[h]))
1025
- c.push(r[h]), a = !0;
1026
- else if (!a)
1027
- c.push(r[h]);
1028
- else
1029
- break;
1030
- r = r.slice(h);
1031
- const p = c.join(`
1032
- `), f = p.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
1033
- $1`).replace(/^ {0,3}>[ \t]?/gm, "");
1034
- s = s ? `${s}
1035
- ${p}` : p, i = i ? `${i}
1036
- ${f}` : f;
1037
- const m = this.lexer.state.top;
1038
- if (this.lexer.state.top = !0, this.lexer.blockTokens(f, o, !0), this.lexer.state.top = m, r.length === 0)
1039
- break;
1040
- const _ = o[o.length - 1];
1041
- if ((_ == null ? void 0 : _.type) === "code")
1042
- break;
1043
- if ((_ == null ? void 0 : _.type) === "blockquote") {
1044
- const b = _, E = b.raw + `
1045
- ` + r.join(`
1046
- `), B = this.blockquote(E);
1047
- o[o.length - 1] = B, s = s.substring(0, s.length - b.raw.length) + B.raw, i = i.substring(0, i.length - b.text.length) + B.text;
1048
- break;
1049
- } else if ((_ == null ? void 0 : _.type) === "list") {
1050
- const b = _, E = b.raw + `
1051
- ` + r.join(`
1052
- `), B = this.list(E);
1053
- o[o.length - 1] = B, s = s.substring(0, s.length - _.raw.length) + B.raw, i = i.substring(0, i.length - b.raw.length) + B.raw, r = E.substring(o[o.length - 1].raw.length).split(`
1054
- `);
1055
- continue;
1056
- }
1057
- }
1058
- return {
1059
- type: "blockquote",
1060
- raw: s,
1061
- tokens: o,
1062
- text: i
1063
- };
1064
- }
1065
- }
1066
- list(e) {
1067
- let n = this.rules.block.list.exec(e);
1068
- if (n) {
1069
- let r = n[1].trim();
1070
- const s = r.length > 1, i = {
1071
- type: "list",
1072
- raw: "",
1073
- ordered: s,
1074
- start: s ? +r.slice(0, -1) : "",
1075
- loose: !1,
1076
- items: []
1077
- };
1078
- r = s ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = s ? r : "[*+-]");
1079
- const o = new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);
1080
- let a = !1;
1081
- for (; e; ) {
1082
- let c = !1, h = "", p = "";
1083
- if (!(n = o.exec(e)) || this.rules.block.hr.test(e))
1084
- break;
1085
- h = n[0], e = e.substring(h.length);
1086
- let f = n[2].split(`
1087
- `, 1)[0].replace(/^\t+/, (De) => " ".repeat(3 * De.length)), m = e.split(`
1088
- `, 1)[0], _ = !f.trim(), b = 0;
1089
- if (this.options.pedantic ? (b = 2, p = f.trimStart()) : _ ? b = n[1].length + 1 : (b = n[2].search(/[^ ]/), b = b > 4 ? 1 : b, p = f.slice(b), b += n[1].length), _ && /^[ \t]*$/.test(m) && (h += m + `
1090
- `, e = e.substring(m.length + 1), c = !0), !c) {
1091
- const De = new RegExp(`^ {0,${Math.min(3, b - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), Ge = new RegExp(`^ {0,${Math.min(3, b - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), We = new RegExp(`^ {0,${Math.min(3, b - 1)}}(?:\`\`\`|~~~)`), ae = new RegExp(`^ {0,${Math.min(3, b - 1)}}#`), L = new RegExp(`^ {0,${Math.min(3, b - 1)}}<(?:[a-z].*>|!--)`, "i");
1092
- for (; e; ) {
1093
- const ee = e.split(`
1094
- `, 1)[0];
1095
- let X;
1096
- if (m = ee, this.options.pedantic ? (m = m.replace(/^ {1,4}(?=( {4})*[^ ])/g, " "), X = m) : X = m.replace(/\t/g, " "), We.test(m) || ae.test(m) || L.test(m) || De.test(m) || Ge.test(m))
1097
- break;
1098
- if (X.search(/[^ ]/) >= b || !m.trim())
1099
- p += `
1100
- ` + X.slice(b);
1101
- else {
1102
- if (_ || f.replace(/\t/g, " ").search(/[^ ]/) >= 4 || We.test(f) || ae.test(f) || Ge.test(f))
1103
- break;
1104
- p += `
1105
- ` + m;
1106
- }
1107
- !_ && !m.trim() && (_ = !0), h += ee + `
1108
- `, e = e.substring(ee.length + 1), f = X.slice(b);
1109
- }
1110
- }
1111
- i.loose || (a ? i.loose = !0 : /\n[ \t]*\n[ \t]*$/.test(h) && (a = !0));
1112
- let E = null, B;
1113
- this.options.gfm && (E = /^\[[ xX]\] /.exec(p), E && (B = E[0] !== "[ ] ", p = p.replace(/^\[[ xX]\] +/, ""))), i.items.push({
1114
- type: "list_item",
1115
- raw: h,
1116
- task: !!E,
1117
- checked: B,
1118
- loose: !1,
1119
- text: p,
1120
- tokens: []
1121
- }), i.raw += h;
1122
- }
1123
- i.items[i.items.length - 1].raw = i.items[i.items.length - 1].raw.trimEnd(), i.items[i.items.length - 1].text = i.items[i.items.length - 1].text.trimEnd(), i.raw = i.raw.trimEnd();
1124
- for (let c = 0; c < i.items.length; c++)
1125
- if (this.lexer.state.top = !1, i.items[c].tokens = this.lexer.blockTokens(i.items[c].text, []), !i.loose) {
1126
- const h = i.items[c].tokens.filter((f) => f.type === "space"), p = h.length > 0 && h.some((f) => /\n.*\n/.test(f.raw));
1127
- i.loose = p;
1128
- }
1129
- if (i.loose)
1130
- for (let c = 0; c < i.items.length; c++)
1131
- i.items[c].loose = !0;
1132
- return i;
1133
- }
1134
- }
1135
- html(e) {
1136
- const n = this.rules.block.html.exec(e);
1137
- if (n)
1138
- return {
1139
- type: "html",
1140
- block: !0,
1141
- raw: n[0],
1142
- pre: n[1] === "pre" || n[1] === "script" || n[1] === "style",
1143
- text: n[0]
1144
- };
1145
- }
1146
- def(e) {
1147
- const n = this.rules.block.def.exec(e);
1148
- if (n) {
1149
- const r = n[1].toLowerCase().replace(/\s+/g, " "), s = n[2] ? n[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = n[3] ? n[3].substring(1, n[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : n[3];
1150
- return {
1151
- type: "def",
1152
- tag: r,
1153
- raw: n[0],
1154
- href: s,
1155
- title: i
1156
- };
1157
- }
1158
- }
1159
- table(e) {
1160
- const n = this.rules.block.table.exec(e);
1161
- if (!n || !/[:|]/.test(n[2]))
1162
- return;
1163
- const r = Un(n[1]), s = n[2].replace(/^\||\| *$/g, "").split("|"), i = n[3] && n[3].trim() ? n[3].replace(/\n[ \t]*$/, "").split(`
1164
- `) : [], o = {
1165
- type: "table",
1166
- raw: n[0],
1167
- header: [],
1168
- align: [],
1169
- rows: []
1170
- };
1171
- if (r.length === s.length) {
1172
- for (const a of s)
1173
- /^ *-+: *$/.test(a) ? o.align.push("right") : /^ *:-+: *$/.test(a) ? o.align.push("center") : /^ *:-+ *$/.test(a) ? o.align.push("left") : o.align.push(null);
1174
- for (let a = 0; a < r.length; a++)
1175
- o.header.push({
1176
- text: r[a],
1177
- tokens: this.lexer.inline(r[a]),
1178
- header: !0,
1179
- align: o.align[a]
1180
- });
1181
- for (const a of i)
1182
- o.rows.push(Un(a, o.header.length).map((c, h) => ({
1183
- text: c,
1184
- tokens: this.lexer.inline(c),
1185
- header: !1,
1186
- align: o.align[h]
1187
- })));
1188
- return o;
1189
- }
1190
- }
1191
- lheading(e) {
1192
- const n = this.rules.block.lheading.exec(e);
1193
- if (n)
1194
- return {
1195
- type: "heading",
1196
- raw: n[0],
1197
- depth: n[2].charAt(0) === "=" ? 1 : 2,
1198
- text: n[1],
1199
- tokens: this.lexer.inline(n[1])
1200
- };
1201
- }
1202
- paragraph(e) {
1203
- const n = this.rules.block.paragraph.exec(e);
1204
- if (n) {
1205
- const r = n[1].charAt(n[1].length - 1) === `
1206
- ` ? n[1].slice(0, -1) : n[1];
1207
- return {
1208
- type: "paragraph",
1209
- raw: n[0],
1210
- text: r,
1211
- tokens: this.lexer.inline(r)
1212
- };
1213
- }
1214
- }
1215
- text(e) {
1216
- const n = this.rules.block.text.exec(e);
1217
- if (n)
1218
- return {
1219
- type: "text",
1220
- raw: n[0],
1221
- text: n[0],
1222
- tokens: this.lexer.inline(n[0])
1223
- };
1224
- }
1225
- escape(e) {
1226
- const n = this.rules.inline.escape.exec(e);
1227
- if (n)
1228
- return {
1229
- type: "escape",
1230
- raw: n[0],
1231
- text: H(n[1])
1232
- };
1233
- }
1234
- tag(e) {
1235
- const n = this.rules.inline.tag.exec(e);
1236
- if (n)
1237
- return !this.lexer.state.inLink && /^<a /i.test(n[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(n[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(n[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0]) && (this.lexer.state.inRawBlock = !1), {
1238
- type: "html",
1239
- raw: n[0],
1240
- inLink: this.lexer.state.inLink,
1241
- inRawBlock: this.lexer.state.inRawBlock,
1242
- block: !1,
1243
- text: n[0]
1244
- };
1245
- }
1246
- link(e) {
1247
- const n = this.rules.inline.link.exec(e);
1248
- if (n) {
1249
- const r = n[2].trim();
1250
- if (!this.options.pedantic && /^</.test(r)) {
1251
- if (!/>$/.test(r))
1252
- return;
1253
- const o = Pe(r.slice(0, -1), "\\");
1254
- if ((r.length - o.length) % 2 === 0)
1255
- return;
1256
- } else {
1257
- const o = Ks(n[2], "()");
1258
- if (o > -1) {
1259
- const c = (n[0].indexOf("!") === 0 ? 5 : 4) + n[1].length + o;
1260
- n[2] = n[2].substring(0, o), n[0] = n[0].substring(0, c).trim(), n[3] = "";
1261
- }
1262
- }
1263
- let s = n[2], i = "";
1264
- if (this.options.pedantic) {
1265
- const o = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);
1266
- o && (s = o[1], i = o[3]);
1267
- } else
1268
- i = n[3] ? n[3].slice(1, -1) : "";
1269
- return s = s.trim(), /^</.test(s) && (this.options.pedantic && !/>$/.test(r) ? s = s.slice(1) : s = s.slice(1, -1)), Hn(n, {
1270
- href: s && s.replace(this.rules.inline.anyPunctuation, "$1"),
1271
- title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
1272
- }, n[0], this.lexer);
1273
- }
1274
- }
1275
- reflink(e, n) {
1276
- let r;
1277
- if ((r = this.rules.inline.reflink.exec(e)) || (r = this.rules.inline.nolink.exec(e))) {
1278
- const s = (r[2] || r[1]).replace(/\s+/g, " "), i = n[s.toLowerCase()];
1279
- if (!i) {
1280
- const o = r[0].charAt(0);
1281
- return {
1282
- type: "text",
1283
- raw: o,
1284
- text: o
1285
- };
1286
- }
1287
- return Hn(r, i, r[0], this.lexer);
1288
- }
1289
- }
1290
- emStrong(e, n, r = "") {
1291
- let s = this.rules.inline.emStrongLDelim.exec(e);
1292
- if (!s || s[3] && r.match(/[\p{L}\p{N}]/u))
1293
- return;
1294
- if (!(s[1] || s[2] || "") || !r || this.rules.inline.punctuation.exec(r)) {
1295
- const o = [...s[0]].length - 1;
1296
- let a, c, h = o, p = 0;
1297
- const f = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1298
- for (f.lastIndex = 0, n = n.slice(-1 * e.length + o); (s = f.exec(n)) != null; ) {
1299
- if (a = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !a)
1300
- continue;
1301
- if (c = [...a].length, s[3] || s[4]) {
1302
- h += c;
1303
- continue;
1304
- } else if ((s[5] || s[6]) && o % 3 && !((o + c) % 3)) {
1305
- p += c;
1306
- continue;
1307
- }
1308
- if (h -= c, h > 0)
1309
- continue;
1310
- c = Math.min(c, c + h + p);
1311
- const m = [...s[0]][0].length, _ = e.slice(0, o + s.index + m + c);
1312
- if (Math.min(o, c) % 2) {
1313
- const E = _.slice(1, -1);
1314
- return {
1315
- type: "em",
1316
- raw: _,
1317
- text: E,
1318
- tokens: this.lexer.inlineTokens(E)
1319
- };
1320
- }
1321
- const b = _.slice(2, -2);
1322
- return {
1323
- type: "strong",
1324
- raw: _,
1325
- text: b,
1326
- tokens: this.lexer.inlineTokens(b)
1327
- };
1328
- }
1329
- }
1330
- }
1331
- codespan(e) {
1332
- const n = this.rules.inline.code.exec(e);
1333
- if (n) {
1334
- let r = n[2].replace(/\n/g, " ");
1335
- const s = /[^ ]/.test(r), i = /^ /.test(r) && / $/.test(r);
1336
- return s && i && (r = r.substring(1, r.length - 1)), r = H(r, !0), {
1337
- type: "codespan",
1338
- raw: n[0],
1339
- text: r
1340
- };
1341
- }
1342
- }
1343
- br(e) {
1344
- const n = this.rules.inline.br.exec(e);
1345
- if (n)
1346
- return {
1347
- type: "br",
1348
- raw: n[0]
1349
- };
1350
- }
1351
- del(e) {
1352
- const n = this.rules.inline.del.exec(e);
1353
- if (n)
1354
- return {
1355
- type: "del",
1356
- raw: n[0],
1357
- text: n[2],
1358
- tokens: this.lexer.inlineTokens(n[2])
1359
- };
1360
- }
1361
- autolink(e) {
1362
- const n = this.rules.inline.autolink.exec(e);
1363
- if (n) {
1364
- let r, s;
1365
- return n[2] === "@" ? (r = H(n[1]), s = "mailto:" + r) : (r = H(n[1]), s = r), {
1366
- type: "link",
1367
- raw: n[0],
1368
- text: r,
1369
- href: s,
1370
- tokens: [
1371
- {
1372
- type: "text",
1373
- raw: r,
1374
- text: r
1375
- }
1376
- ]
1377
- };
1378
- }
1379
- }
1380
- url(e) {
1381
- var r;
1382
- let n;
1383
- if (n = this.rules.inline.url.exec(e)) {
1384
- let s, i;
1385
- if (n[2] === "@")
1386
- s = H(n[0]), i = "mailto:" + s;
1387
- else {
1388
- let o;
1389
- do
1390
- o = n[0], n[0] = ((r = this.rules.inline._backpedal.exec(n[0])) == null ? void 0 : r[0]) ?? "";
1391
- while (o !== n[0]);
1392
- s = H(n[0]), n[1] === "www." ? i = "http://" + n[0] : i = n[0];
1393
- }
1394
- return {
1395
- type: "link",
1396
- raw: n[0],
1397
- text: s,
1398
- href: i,
1399
- tokens: [
1400
- {
1401
- type: "text",
1402
- raw: s,
1403
- text: s
1404
- }
1405
- ]
1406
- };
1407
- }
1408
- }
1409
- inlineText(e) {
1410
- const n = this.rules.inline.text.exec(e);
1411
- if (n) {
1412
- let r;
1413
- return this.lexer.state.inRawBlock ? r = n[0] : r = H(n[0]), {
1414
- type: "text",
1415
- raw: n[0],
1416
- text: r
1417
- };
1418
- }
1419
- }
1420
- }
1421
- const Js = /^(?:[ \t]*(?:\n|$))+/, ei = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ti = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, je = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ni = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Sr = /(?:[*+-]|\d{1,9}[.)])/, Rr = w(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, Sr).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), sn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ri = /^[^\n]+/, on = /(?!\s*\])(?:\\.|[^\[\]\\])+/, si = w(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", on).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ii = w(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Sr).getRegex(), bt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", ln = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, oi = w("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ln).replace("tag", bt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Or = w(sn).replace("hr", je).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", bt).getRegex(), li = w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Or).getRegex(), an = {
1422
- blockquote: li,
1423
- code: ei,
1424
- def: si,
1425
- fences: ti,
1426
- heading: ni,
1427
- hr: je,
1428
- html: oi,
1429
- lheading: Rr,
1430
- list: ii,
1431
- newline: Js,
1432
- paragraph: Or,
1433
- table: Ue,
1434
- text: ri
1435
- }, Bn = w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", je).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", bt).getRegex(), ai = {
1436
- ...an,
1437
- table: Bn,
1438
- paragraph: w(sn).replace("hr", je).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Bn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", bt).getRegex()
1439
- }, ci = {
1440
- ...an,
1441
- html: w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ln).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
1442
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
1443
- heading: /^(#{1,6})(.*)(?:\n+|$)/,
1444
- fences: Ue,
1445
- // fences not supported
1446
- lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
1447
- paragraph: w(sn).replace("hr", je).replace("heading", ` *#{1,6} *[^
1448
- ]`).replace("lheading", Rr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
1449
- }, Ir = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ui = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Nr = /^( {2,}|\\)\n(?!\s*$)/, fi = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ve = "\\p{P}\\p{S}", pi = w(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, Ve).getRegex(), hi = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, di = w(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, Ve).getRegex(), mi = w("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, Ve).getRegex(), gi = w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, Ve).getRegex(), bi = w(/\\([punct])/, "gu").replace(/punct/g, Ve).getRegex(), yi = w(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), _i = w(ln).replace("(?:-->|$)", "-->").getRegex(), ki = w("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", _i).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), pt = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Ti = w(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", pt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Dr = w(/^!?\[(label)\]\[(ref)\]/).replace("label", pt).replace("ref", on).getRegex(), Cr = w(/^!?\[(ref)\](?:\[\])?/).replace("ref", on).getRegex(), wi = w("reflink|nolink(?!\\()", "g").replace("reflink", Dr).replace("nolink", Cr).getRegex(), cn = {
1450
- _backpedal: Ue,
1451
- // only used for GFM url
1452
- anyPunctuation: bi,
1453
- autolink: yi,
1454
- blockSkip: hi,
1455
- br: Nr,
1456
- code: ui,
1457
- del: Ue,
1458
- emStrongLDelim: di,
1459
- emStrongRDelimAst: mi,
1460
- emStrongRDelimUnd: gi,
1461
- escape: Ir,
1462
- link: Ti,
1463
- nolink: Cr,
1464
- punctuation: pi,
1465
- reflink: Dr,
1466
- reflinkSearch: wi,
1467
- tag: ki,
1468
- text: fi,
1469
- url: Ue
1470
- }, xi = {
1471
- ...cn,
1472
- link: w(/^!?\[(label)\]\((.*?)\)/).replace("label", pt).getRegex(),
1473
- reflink: w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", pt).getRegex()
1474
- }, Xt = {
1475
- ...cn,
1476
- escape: w(Ir).replace("])", "~|])").getRegex(),
1477
- url: w(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
1478
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
1479
- del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
1480
- text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
1481
- }, Ei = {
1482
- ...Xt,
1483
- br: w(Nr).replace("{2,}", "*").getRegex(),
1484
- text: w(Xt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
1485
- }, rt = {
1486
- normal: an,
1487
- gfm: ai,
1488
- pedantic: ci
1489
- }, ve = {
1490
- normal: cn,
1491
- gfm: Xt,
1492
- breaks: Ei,
1493
- pedantic: xi
1494
- };
1495
- class G {
1496
- constructor(e) {
1497
- x(this, "tokens");
1498
- x(this, "options");
1499
- x(this, "state");
1500
- x(this, "tokenizer");
1501
- x(this, "inlineQueue");
1502
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || ge, this.options.tokenizer = this.options.tokenizer || new ft(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1503
- inLink: !1,
1504
- inRawBlock: !1,
1505
- top: !0
1506
- };
1507
- const n = {
1508
- block: rt.normal,
1509
- inline: ve.normal
1510
- };
1511
- this.options.pedantic ? (n.block = rt.pedantic, n.inline = ve.pedantic) : this.options.gfm && (n.block = rt.gfm, this.options.breaks ? n.inline = ve.breaks : n.inline = ve.gfm), this.tokenizer.rules = n;
1512
- }
1513
- /**
1514
- * Expose Rules
1515
- */
1516
- static get rules() {
1517
- return {
1518
- block: rt,
1519
- inline: ve
1520
- };
1521
- }
1522
- /**
1523
- * Static Lex Method
1524
- */
1525
- static lex(e, n) {
1526
- return new G(n).lex(e);
1527
- }
1528
- /**
1529
- * Static Lex Inline Method
1530
- */
1531
- static lexInline(e, n) {
1532
- return new G(n).inlineTokens(e);
1533
- }
1534
- /**
1535
- * Preprocessing
1536
- */
1537
- lex(e) {
1538
- e = e.replace(/\r\n|\r/g, `
1539
- `), this.blockTokens(e, this.tokens);
1540
- for (let n = 0; n < this.inlineQueue.length; n++) {
1541
- const r = this.inlineQueue[n];
1542
- this.inlineTokens(r.src, r.tokens);
1543
- }
1544
- return this.inlineQueue = [], this.tokens;
1545
- }
1546
- blockTokens(e, n = [], r = !1) {
1547
- this.options.pedantic && (e = e.replace(/\t/g, " ").replace(/^ +$/gm, ""));
1548
- let s, i, o;
1549
- for (; e; )
1550
- if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((a) => (s = a.call({ lexer: this }, e, n)) ? (e = e.substring(s.raw.length), n.push(s), !0) : !1))) {
1551
- if (s = this.tokenizer.space(e)) {
1552
- e = e.substring(s.raw.length), s.raw.length === 1 && n.length > 0 ? n[n.length - 1].raw += `
1553
- ` : n.push(s);
1554
- continue;
1555
- }
1556
- if (s = this.tokenizer.code(e)) {
1557
- e = e.substring(s.raw.length), i = n[n.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
1558
- ` + s.raw, i.text += `
1559
- ` + s.text, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(s);
1560
- continue;
1561
- }
1562
- if (s = this.tokenizer.fences(e)) {
1563
- e = e.substring(s.raw.length), n.push(s);
1564
- continue;
1565
- }
1566
- if (s = this.tokenizer.heading(e)) {
1567
- e = e.substring(s.raw.length), n.push(s);
1568
- continue;
1569
- }
1570
- if (s = this.tokenizer.hr(e)) {
1571
- e = e.substring(s.raw.length), n.push(s);
1572
- continue;
1573
- }
1574
- if (s = this.tokenizer.blockquote(e)) {
1575
- e = e.substring(s.raw.length), n.push(s);
1576
- continue;
1577
- }
1578
- if (s = this.tokenizer.list(e)) {
1579
- e = e.substring(s.raw.length), n.push(s);
1580
- continue;
1581
- }
1582
- if (s = this.tokenizer.html(e)) {
1583
- e = e.substring(s.raw.length), n.push(s);
1584
- continue;
1585
- }
1586
- if (s = this.tokenizer.def(e)) {
1587
- e = e.substring(s.raw.length), i = n[n.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
1588
- ` + s.raw, i.text += `
1589
- ` + s.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : this.tokens.links[s.tag] || (this.tokens.links[s.tag] = {
1590
- href: s.href,
1591
- title: s.title
1592
- });
1593
- continue;
1594
- }
1595
- if (s = this.tokenizer.table(e)) {
1596
- e = e.substring(s.raw.length), n.push(s);
1597
- continue;
1598
- }
1599
- if (s = this.tokenizer.lheading(e)) {
1600
- e = e.substring(s.raw.length), n.push(s);
1601
- continue;
1602
- }
1603
- if (o = e, this.options.extensions && this.options.extensions.startBlock) {
1604
- let a = 1 / 0;
1605
- const c = e.slice(1);
1606
- let h;
1607
- this.options.extensions.startBlock.forEach((p) => {
1608
- h = p.call({ lexer: this }, c), typeof h == "number" && h >= 0 && (a = Math.min(a, h));
1609
- }), a < 1 / 0 && a >= 0 && (o = e.substring(0, a + 1));
1610
- }
1611
- if (this.state.top && (s = this.tokenizer.paragraph(o))) {
1612
- i = n[n.length - 1], r && (i == null ? void 0 : i.type) === "paragraph" ? (i.raw += `
1613
- ` + s.raw, i.text += `
1614
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(s), r = o.length !== e.length, e = e.substring(s.raw.length);
1615
- continue;
1616
- }
1617
- if (s = this.tokenizer.text(e)) {
1618
- e = e.substring(s.raw.length), i = n[n.length - 1], i && i.type === "text" ? (i.raw += `
1619
- ` + s.raw, i.text += `
1620
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(s);
1621
- continue;
1622
- }
1623
- if (e) {
1624
- const a = "Infinite loop on byte: " + e.charCodeAt(0);
1625
- if (this.options.silent) {
1626
- console.error(a);
1627
- break;
1628
- } else
1629
- throw new Error(a);
1630
- }
1631
- }
1632
- return this.state.top = !0, n;
1633
- }
1634
- inline(e, n = []) {
1635
- return this.inlineQueue.push({ src: e, tokens: n }), n;
1636
- }
1637
- /**
1638
- * Lexing/Compiling
1639
- */
1640
- inlineTokens(e, n = []) {
1641
- let r, s, i, o = e, a, c, h;
1642
- if (this.tokens.links) {
1643
- const p = Object.keys(this.tokens.links);
1644
- if (p.length > 0)
1645
- for (; (a = this.tokenizer.rules.inline.reflinkSearch.exec(o)) != null; )
1646
- p.includes(a[0].slice(a[0].lastIndexOf("[") + 1, -1)) && (o = o.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1647
- }
1648
- for (; (a = this.tokenizer.rules.inline.blockSkip.exec(o)) != null; )
1649
- o = o.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1650
- for (; (a = this.tokenizer.rules.inline.anyPunctuation.exec(o)) != null; )
1651
- o = o.slice(0, a.index) + "++" + o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1652
- for (; e; )
1653
- if (c || (h = ""), c = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((p) => (r = p.call({ lexer: this }, e, n)) ? (e = e.substring(r.raw.length), n.push(r), !0) : !1))) {
1654
- if (r = this.tokenizer.escape(e)) {
1655
- e = e.substring(r.raw.length), n.push(r);
1656
- continue;
1657
- }
1658
- if (r = this.tokenizer.tag(e)) {
1659
- e = e.substring(r.raw.length), s = n[n.length - 1], s && r.type === "text" && s.type === "text" ? (s.raw += r.raw, s.text += r.text) : n.push(r);
1660
- continue;
1661
- }
1662
- if (r = this.tokenizer.link(e)) {
1663
- e = e.substring(r.raw.length), n.push(r);
1664
- continue;
1665
- }
1666
- if (r = this.tokenizer.reflink(e, this.tokens.links)) {
1667
- e = e.substring(r.raw.length), s = n[n.length - 1], s && r.type === "text" && s.type === "text" ? (s.raw += r.raw, s.text += r.text) : n.push(r);
1668
- continue;
1669
- }
1670
- if (r = this.tokenizer.emStrong(e, o, h)) {
1671
- e = e.substring(r.raw.length), n.push(r);
1672
- continue;
1673
- }
1674
- if (r = this.tokenizer.codespan(e)) {
1675
- e = e.substring(r.raw.length), n.push(r);
1676
- continue;
1677
- }
1678
- if (r = this.tokenizer.br(e)) {
1679
- e = e.substring(r.raw.length), n.push(r);
1680
- continue;
1681
- }
1682
- if (r = this.tokenizer.del(e)) {
1683
- e = e.substring(r.raw.length), n.push(r);
1684
- continue;
1685
- }
1686
- if (r = this.tokenizer.autolink(e)) {
1687
- e = e.substring(r.raw.length), n.push(r);
1688
- continue;
1689
- }
1690
- if (!this.state.inLink && (r = this.tokenizer.url(e))) {
1691
- e = e.substring(r.raw.length), n.push(r);
1692
- continue;
1693
- }
1694
- if (i = e, this.options.extensions && this.options.extensions.startInline) {
1695
- let p = 1 / 0;
1696
- const f = e.slice(1);
1697
- let m;
1698
- this.options.extensions.startInline.forEach((_) => {
1699
- m = _.call({ lexer: this }, f), typeof m == "number" && m >= 0 && (p = Math.min(p, m));
1700
- }), p < 1 / 0 && p >= 0 && (i = e.substring(0, p + 1));
1701
- }
1702
- if (r = this.tokenizer.inlineText(i)) {
1703
- e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (h = r.raw.slice(-1)), c = !0, s = n[n.length - 1], s && s.type === "text" ? (s.raw += r.raw, s.text += r.text) : n.push(r);
1704
- continue;
1705
- }
1706
- if (e) {
1707
- const p = "Infinite loop on byte: " + e.charCodeAt(0);
1708
- if (this.options.silent) {
1709
- console.error(p);
1710
- break;
1711
- } else
1712
- throw new Error(p);
1713
- }
1714
- }
1715
- return n;
1716
- }
1717
- }
1718
- class ht {
1719
- // set by the parser
1720
- constructor(e) {
1721
- x(this, "options");
1722
- x(this, "parser");
1723
- this.options = e || ge;
1724
- }
1725
- space(e) {
1726
- return "";
1727
- }
1728
- code({ text: e, lang: n, escaped: r }) {
1729
- var o;
1730
- const s = (o = (n || "").match(/^\S*/)) == null ? void 0 : o[0], i = e.replace(/\n$/, "") + `
1731
- `;
1732
- return s ? '<pre><code class="language-' + H(s) + '">' + (r ? i : H(i, !0)) + `</code></pre>
1733
- ` : "<pre><code>" + (r ? i : H(i, !0)) + `</code></pre>
1734
- `;
1735
- }
1736
- blockquote({ tokens: e }) {
1737
- return `<blockquote>
1738
- ${this.parser.parse(e)}</blockquote>
1739
- `;
1740
- }
1741
- html({ text: e }) {
1742
- return e;
1743
- }
1744
- heading({ tokens: e, depth: n }) {
1745
- return `<h${n}>${this.parser.parseInline(e)}</h${n}>
1746
- `;
1747
- }
1748
- hr(e) {
1749
- return `<hr>
1750
- `;
1751
- }
1752
- list(e) {
1753
- const n = e.ordered, r = e.start;
1754
- let s = "";
1755
- for (let a = 0; a < e.items.length; a++) {
1756
- const c = e.items[a];
1757
- s += this.listitem(c);
1758
- }
1759
- const i = n ? "ol" : "ul", o = n && r !== 1 ? ' start="' + r + '"' : "";
1760
- return "<" + i + o + `>
1761
- ` + s + "</" + i + `>
1762
- `;
1763
- }
1764
- listitem(e) {
1765
- let n = "";
1766
- if (e.task) {
1767
- const r = this.checkbox({ checked: !!e.checked });
1768
- e.loose ? e.tokens.length > 0 && e.tokens[0].type === "paragraph" ? (e.tokens[0].text = r + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = r + " " + e.tokens[0].tokens[0].text)) : e.tokens.unshift({
1769
- type: "text",
1770
- raw: r + " ",
1771
- text: r + " "
1772
- }) : n += r + " ";
1773
- }
1774
- return n += this.parser.parse(e.tokens, !!e.loose), `<li>${n}</li>
1775
- `;
1776
- }
1777
- checkbox({ checked: e }) {
1778
- return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
1779
- }
1780
- paragraph({ tokens: e }) {
1781
- return `<p>${this.parser.parseInline(e)}</p>
1782
- `;
1783
- }
1784
- table(e) {
1785
- let n = "", r = "";
1786
- for (let i = 0; i < e.header.length; i++)
1787
- r += this.tablecell(e.header[i]);
1788
- n += this.tablerow({ text: r });
1789
- let s = "";
1790
- for (let i = 0; i < e.rows.length; i++) {
1791
- const o = e.rows[i];
1792
- r = "";
1793
- for (let a = 0; a < o.length; a++)
1794
- r += this.tablecell(o[a]);
1795
- s += this.tablerow({ text: r });
1796
- }
1797
- return s && (s = `<tbody>${s}</tbody>`), `<table>
1798
- <thead>
1799
- ` + n + `</thead>
1800
- ` + s + `</table>
1801
- `;
1802
- }
1803
- tablerow({ text: e }) {
1804
- return `<tr>
1805
- ${e}</tr>
1806
- `;
1807
- }
1808
- tablecell(e) {
1809
- const n = this.parser.parseInline(e.tokens), r = e.header ? "th" : "td";
1810
- return (e.align ? `<${r} align="${e.align}">` : `<${r}>`) + n + `</${r}>
1811
- `;
1812
- }
1813
- /**
1814
- * span level renderer
1815
- */
1816
- strong({ tokens: e }) {
1817
- return `<strong>${this.parser.parseInline(e)}</strong>`;
1818
- }
1819
- em({ tokens: e }) {
1820
- return `<em>${this.parser.parseInline(e)}</em>`;
1821
- }
1822
- codespan({ text: e }) {
1823
- return `<code>${e}</code>`;
1824
- }
1825
- br(e) {
1826
- return "<br>";
1827
- }
1828
- del({ tokens: e }) {
1829
- return `<del>${this.parser.parseInline(e)}</del>`;
1830
- }
1831
- link({ href: e, title: n, tokens: r }) {
1832
- const s = this.parser.parseInline(r), i = Fn(e);
1833
- if (i === null)
1834
- return s;
1835
- e = i;
1836
- let o = '<a href="' + e + '"';
1837
- return n && (o += ' title="' + n + '"'), o += ">" + s + "</a>", o;
1838
- }
1839
- image({ href: e, title: n, text: r }) {
1840
- const s = Fn(e);
1841
- if (s === null)
1842
- return r;
1843
- e = s;
1844
- let i = `<img src="${e}" alt="${r}"`;
1845
- return n && (i += ` title="${n}"`), i += ">", i;
1846
- }
1847
- text(e) {
1848
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : e.text;
1849
- }
1850
- }
1851
- class un {
1852
- // no need for block level renderers
1853
- strong({ text: e }) {
1854
- return e;
1855
- }
1856
- em({ text: e }) {
1857
- return e;
1858
- }
1859
- codespan({ text: e }) {
1860
- return e;
1861
- }
1862
- del({ text: e }) {
1863
- return e;
1864
- }
1865
- html({ text: e }) {
1866
- return e;
1867
- }
1868
- text({ text: e }) {
1869
- return e;
1870
- }
1871
- link({ text: e }) {
1872
- return "" + e;
1873
- }
1874
- image({ text: e }) {
1875
- return "" + e;
1876
- }
1877
- br() {
1878
- return "";
1879
- }
1880
- }
1881
- class W {
1882
- constructor(e) {
1883
- x(this, "options");
1884
- x(this, "renderer");
1885
- x(this, "textRenderer");
1886
- this.options = e || ge, this.options.renderer = this.options.renderer || new ht(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new un();
1887
- }
1888
- /**
1889
- * Static Parse Method
1890
- */
1891
- static parse(e, n) {
1892
- return new W(n).parse(e);
1893
- }
1894
- /**
1895
- * Static Parse Inline Method
1896
- */
1897
- static parseInline(e, n) {
1898
- return new W(n).parseInline(e);
1899
- }
1900
- /**
1901
- * Parse Loop
1902
- */
1903
- parse(e, n = !0) {
1904
- let r = "";
1905
- for (let s = 0; s < e.length; s++) {
1906
- const i = e[s];
1907
- if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i.type]) {
1908
- const a = i, c = this.options.extensions.renderers[a.type].call({ parser: this }, a);
1909
- if (c !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(a.type)) {
1910
- r += c || "";
1911
- continue;
1912
- }
1913
- }
1914
- const o = i;
1915
- switch (o.type) {
1916
- case "space": {
1917
- r += this.renderer.space(o);
1918
- continue;
1919
- }
1920
- case "hr": {
1921
- r += this.renderer.hr(o);
1922
- continue;
1923
- }
1924
- case "heading": {
1925
- r += this.renderer.heading(o);
1926
- continue;
1927
- }
1928
- case "code": {
1929
- r += this.renderer.code(o);
1930
- continue;
1931
- }
1932
- case "table": {
1933
- r += this.renderer.table(o);
1934
- continue;
1935
- }
1936
- case "blockquote": {
1937
- r += this.renderer.blockquote(o);
1938
- continue;
1939
- }
1940
- case "list": {
1941
- r += this.renderer.list(o);
1942
- continue;
1943
- }
1944
- case "html": {
1945
- r += this.renderer.html(o);
1946
- continue;
1947
- }
1948
- case "paragraph": {
1949
- r += this.renderer.paragraph(o);
1950
- continue;
1951
- }
1952
- case "text": {
1953
- let a = o, c = this.renderer.text(a);
1954
- for (; s + 1 < e.length && e[s + 1].type === "text"; )
1955
- a = e[++s], c += `
1956
- ` + this.renderer.text(a);
1957
- n ? r += this.renderer.paragraph({
1958
- type: "paragraph",
1959
- raw: c,
1960
- text: c,
1961
- tokens: [{ type: "text", raw: c, text: c }]
1962
- }) : r += c;
1963
- continue;
1964
- }
1965
- default: {
1966
- const a = 'Token with "' + o.type + '" type was not found.';
1967
- if (this.options.silent)
1968
- return console.error(a), "";
1969
- throw new Error(a);
1970
- }
1971
- }
1972
- }
1973
- return r;
1974
- }
1975
- /**
1976
- * Parse Inline Tokens
1977
- */
1978
- parseInline(e, n) {
1979
- n = n || this.renderer;
1980
- let r = "";
1981
- for (let s = 0; s < e.length; s++) {
1982
- const i = e[s];
1983
- if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i.type]) {
1984
- const a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1985
- if (a !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
1986
- r += a || "";
1987
- continue;
1988
- }
1989
- }
1990
- const o = i;
1991
- switch (o.type) {
1992
- case "escape": {
1993
- r += n.text(o);
1994
- break;
1995
- }
1996
- case "html": {
1997
- r += n.html(o);
1998
- break;
1999
- }
2000
- case "link": {
2001
- r += n.link(o);
2002
- break;
2003
- }
2004
- case "image": {
2005
- r += n.image(o);
2006
- break;
2007
- }
2008
- case "strong": {
2009
- r += n.strong(o);
2010
- break;
2011
- }
2012
- case "em": {
2013
- r += n.em(o);
2014
- break;
2015
- }
2016
- case "codespan": {
2017
- r += n.codespan(o);
2018
- break;
2019
- }
2020
- case "br": {
2021
- r += n.br(o);
2022
- break;
2023
- }
2024
- case "del": {
2025
- r += n.del(o);
2026
- break;
2027
- }
2028
- case "text": {
2029
- r += n.text(o);
2030
- break;
2031
- }
2032
- default: {
2033
- const a = 'Token with "' + o.type + '" type was not found.';
2034
- if (this.options.silent)
2035
- return console.error(a), "";
2036
- throw new Error(a);
2037
- }
2038
- }
2039
- }
2040
- return r;
2041
- }
2042
- }
2043
- class He {
2044
- constructor(e) {
2045
- x(this, "options");
2046
- x(this, "block");
2047
- this.options = e || ge;
2048
- }
2049
- /**
2050
- * Process markdown before marked
2051
- */
2052
- preprocess(e) {
2053
- return e;
2054
- }
2055
- /**
2056
- * Process HTML after marked is finished
2057
- */
2058
- postprocess(e) {
2059
- return e;
2060
- }
2061
- /**
2062
- * Process all tokens before walk tokens
2063
- */
2064
- processAllTokens(e) {
2065
- return e;
2066
- }
2067
- /**
2068
- * Provide function to tokenize markdown
2069
- */
2070
- provideLexer() {
2071
- return this.block ? G.lex : G.lexInline;
2072
- }
2073
- /**
2074
- * Provide function to parse tokens
2075
- */
2076
- provideParser() {
2077
- return this.block ? W.parse : W.parseInline;
2078
- }
2079
- }
2080
- x(He, "passThroughHooks", /* @__PURE__ */ new Set([
2081
- "preprocess",
2082
- "postprocess",
2083
- "processAllTokens"
2084
- ]));
2085
- class Ai {
2086
- constructor(...e) {
2087
- x(this, "defaults", rn());
2088
- x(this, "options", this.setOptions);
2089
- x(this, "parse", this.parseMarkdown(!0));
2090
- x(this, "parseInline", this.parseMarkdown(!1));
2091
- x(this, "Parser", W);
2092
- x(this, "Renderer", ht);
2093
- x(this, "TextRenderer", un);
2094
- x(this, "Lexer", G);
2095
- x(this, "Tokenizer", ft);
2096
- x(this, "Hooks", He);
2097
- this.use(...e);
2098
- }
2099
- /**
2100
- * Run callback for every token
2101
- */
2102
- walkTokens(e, n) {
2103
- var s, i;
2104
- let r = [];
2105
- for (const o of e)
2106
- switch (r = r.concat(n.call(this, o)), o.type) {
2107
- case "table": {
2108
- const a = o;
2109
- for (const c of a.header)
2110
- r = r.concat(this.walkTokens(c.tokens, n));
2111
- for (const c of a.rows)
2112
- for (const h of c)
2113
- r = r.concat(this.walkTokens(h.tokens, n));
2114
- break;
2115
- }
2116
- case "list": {
2117
- const a = o;
2118
- r = r.concat(this.walkTokens(a.items, n));
2119
- break;
2120
- }
2121
- default: {
2122
- const a = o;
2123
- (i = (s = this.defaults.extensions) == null ? void 0 : s.childTokens) != null && i[a.type] ? this.defaults.extensions.childTokens[a.type].forEach((c) => {
2124
- const h = a[c].flat(1 / 0);
2125
- r = r.concat(this.walkTokens(h, n));
2126
- }) : a.tokens && (r = r.concat(this.walkTokens(a.tokens, n)));
2127
- }
2128
- }
2129
- return r;
2130
- }
2131
- use(...e) {
2132
- const n = this.defaults.extensions || { renderers: {}, childTokens: {} };
2133
- return e.forEach((r) => {
2134
- const s = { ...r };
2135
- if (s.async = this.defaults.async || s.async || !1, r.extensions && (r.extensions.forEach((i) => {
2136
- if (!i.name)
2137
- throw new Error("extension name required");
2138
- if ("renderer" in i) {
2139
- const o = n.renderers[i.name];
2140
- o ? n.renderers[i.name] = function(...a) {
2141
- let c = i.renderer.apply(this, a);
2142
- return c === !1 && (c = o.apply(this, a)), c;
2143
- } : n.renderers[i.name] = i.renderer;
2144
- }
2145
- if ("tokenizer" in i) {
2146
- if (!i.level || i.level !== "block" && i.level !== "inline")
2147
- throw new Error("extension level must be 'block' or 'inline'");
2148
- const o = n[i.level];
2149
- o ? o.unshift(i.tokenizer) : n[i.level] = [i.tokenizer], i.start && (i.level === "block" ? n.startBlock ? n.startBlock.push(i.start) : n.startBlock = [i.start] : i.level === "inline" && (n.startInline ? n.startInline.push(i.start) : n.startInline = [i.start]));
2150
- }
2151
- "childTokens" in i && i.childTokens && (n.childTokens[i.name] = i.childTokens);
2152
- }), s.extensions = n), r.renderer) {
2153
- const i = this.defaults.renderer || new ht(this.defaults);
2154
- for (const o in r.renderer) {
2155
- if (!(o in i))
2156
- throw new Error(`renderer '${o}' does not exist`);
2157
- if (["options", "parser"].includes(o))
2158
- continue;
2159
- const a = o, c = r.renderer[a], h = i[a];
2160
- i[a] = (...p) => {
2161
- let f = c.apply(i, p);
2162
- return f === !1 && (f = h.apply(i, p)), f || "";
2163
- };
2164
- }
2165
- s.renderer = i;
2166
- }
2167
- if (r.tokenizer) {
2168
- const i = this.defaults.tokenizer || new ft(this.defaults);
2169
- for (const o in r.tokenizer) {
2170
- if (!(o in i))
2171
- throw new Error(`tokenizer '${o}' does not exist`);
2172
- if (["options", "rules", "lexer"].includes(o))
2173
- continue;
2174
- const a = o, c = r.tokenizer[a], h = i[a];
2175
- i[a] = (...p) => {
2176
- let f = c.apply(i, p);
2177
- return f === !1 && (f = h.apply(i, p)), f;
2178
- };
2179
- }
2180
- s.tokenizer = i;
2181
- }
2182
- if (r.hooks) {
2183
- const i = this.defaults.hooks || new He();
2184
- for (const o in r.hooks) {
2185
- if (!(o in i))
2186
- throw new Error(`hook '${o}' does not exist`);
2187
- if (["options", "block"].includes(o))
2188
- continue;
2189
- const a = o, c = r.hooks[a], h = i[a];
2190
- He.passThroughHooks.has(o) ? i[a] = (p) => {
2191
- if (this.defaults.async)
2192
- return Promise.resolve(c.call(i, p)).then((m) => h.call(i, m));
2193
- const f = c.call(i, p);
2194
- return h.call(i, f);
2195
- } : i[a] = (...p) => {
2196
- let f = c.apply(i, p);
2197
- return f === !1 && (f = h.apply(i, p)), f;
2198
- };
2199
- }
2200
- s.hooks = i;
2201
- }
2202
- if (r.walkTokens) {
2203
- const i = this.defaults.walkTokens, o = r.walkTokens;
2204
- s.walkTokens = function(a) {
2205
- let c = [];
2206
- return c.push(o.call(this, a)), i && (c = c.concat(i.call(this, a))), c;
2207
- };
2208
- }
2209
- this.defaults = { ...this.defaults, ...s };
2210
- }), this;
2211
- }
2212
- setOptions(e) {
2213
- return this.defaults = { ...this.defaults, ...e }, this;
2214
- }
2215
- lexer(e, n) {
2216
- return G.lex(e, n ?? this.defaults);
2217
- }
2218
- parser(e, n) {
2219
- return W.parse(e, n ?? this.defaults);
2220
- }
2221
- parseMarkdown(e) {
2222
- return (r, s) => {
2223
- const i = { ...s }, o = { ...this.defaults, ...i }, a = this.onError(!!o.silent, !!o.async);
2224
- if (this.defaults.async === !0 && i.async === !1)
2225
- return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2226
- if (typeof r > "u" || r === null)
2227
- return a(new Error("marked(): input parameter is undefined or null"));
2228
- if (typeof r != "string")
2229
- return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(r) + ", string expected"));
2230
- o.hooks && (o.hooks.options = o, o.hooks.block = e);
2231
- const c = o.hooks ? o.hooks.provideLexer() : e ? G.lex : G.lexInline, h = o.hooks ? o.hooks.provideParser() : e ? W.parse : W.parseInline;
2232
- if (o.async)
2233
- return Promise.resolve(o.hooks ? o.hooks.preprocess(r) : r).then((p) => c(p, o)).then((p) => o.hooks ? o.hooks.processAllTokens(p) : p).then((p) => o.walkTokens ? Promise.all(this.walkTokens(p, o.walkTokens)).then(() => p) : p).then((p) => h(p, o)).then((p) => o.hooks ? o.hooks.postprocess(p) : p).catch(a);
2234
- try {
2235
- o.hooks && (r = o.hooks.preprocess(r));
2236
- let p = c(r, o);
2237
- o.hooks && (p = o.hooks.processAllTokens(p)), o.walkTokens && this.walkTokens(p, o.walkTokens);
2238
- let f = h(p, o);
2239
- return o.hooks && (f = o.hooks.postprocess(f)), f;
2240
- } catch (p) {
2241
- return a(p);
2242
- }
2243
- };
2244
- }
2245
- onError(e, n) {
2246
- return (r) => {
2247
- if (r.message += `
2248
- Please report this to https://github.com/markedjs/marked.`, e) {
2249
- const s = "<p>An error occurred:</p><pre>" + H(r.message + "", !0) + "</pre>";
2250
- return n ? Promise.resolve(s) : s;
2251
- }
2252
- if (n)
2253
- return Promise.reject(r);
2254
- throw r;
2255
- };
2256
- }
2257
- }
2258
- const me = new Ai();
2259
- function T(t, e) {
2260
- return me.parse(t, e);
2261
- }
2262
- T.options = T.setOptions = function(t) {
2263
- return me.setOptions(t), T.defaults = me.defaults, xr(T.defaults), T;
2264
- };
2265
- T.getDefaults = rn;
2266
- T.defaults = ge;
2267
- T.use = function(...t) {
2268
- return me.use(...t), T.defaults = me.defaults, xr(T.defaults), T;
2269
- };
2270
- T.walkTokens = function(t, e) {
2271
- return me.walkTokens(t, e);
2272
- };
2273
- T.parseInline = me.parseInline;
2274
- T.Parser = W;
2275
- T.parser = W.parse;
2276
- T.Renderer = ht;
2277
- T.TextRenderer = un;
2278
- T.Lexer = G;
2279
- T.lexer = G.lex;
2280
- T.Tokenizer = ft;
2281
- T.Hooks = He;
2282
- T.parse = T;
2283
- T.options;
2284
- T.setOptions;
2285
- T.use;
2286
- T.walkTokens;
2287
- T.parseInline;
2288
- W.parse;
2289
- G.lex;
2290
- /*! @license DOMPurify 3.4.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.3/LICENSE */
2291
- function jn(t, e) {
2292
- (e == null || e > t.length) && (e = t.length);
2293
- for (var n = 0, r = Array(e); n < e; n++) r[n] = t[n];
2294
- return r;
2295
- }
2296
- function Si(t) {
2297
- if (Array.isArray(t)) return t;
2298
- }
2299
- function Ri(t, e) {
2300
- var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
2301
- if (n != null) {
2302
- var r, s, i, o, a = [], c = !0, h = !1;
2303
- try {
2304
- if (i = (n = n.call(t)).next, e !== 0) for (; !(c = (r = i.call(n)).done) && (a.push(r.value), a.length !== e); c = !0) ;
2305
- } catch (p) {
2306
- h = !0, s = p;
2307
- } finally {
2308
- try {
2309
- if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
2310
- } finally {
2311
- if (h) throw s;
2312
- }
2313
- }
2314
- return a;
2315
- }
2316
- }
2317
- function Oi() {
2318
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2319
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
2320
- }
2321
- function Ii(t, e) {
2322
- return Si(t) || Ri(t, e) || Ni(t, e) || Oi();
2323
- }
2324
- function Ni(t, e) {
2325
- if (t) {
2326
- if (typeof t == "string") return jn(t, e);
2327
- var n = {}.toString.call(t).slice(8, -1);
2328
- return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? jn(t, e) : void 0;
2329
- }
2330
- }
2331
- const Lr = Object.entries, Vn = Object.setPrototypeOf, Di = Object.isFrozen, Ci = Object.getPrototypeOf, Li = Object.getOwnPropertyDescriptor;
2332
- let z = Object.freeze, q = Object.seal, Re = Object.create, Mr = typeof Reflect < "u" && Reflect, Kt = Mr.apply, Qt = Mr.construct;
2333
- z || (z = function(e) {
2334
- return e;
2335
- });
2336
- q || (q = function(e) {
2337
- return e;
2338
- });
2339
- Kt || (Kt = function(e, n) {
2340
- for (var r = arguments.length, s = new Array(r > 2 ? r - 2 : 0), i = 2; i < r; i++)
2341
- s[i - 2] = arguments[i];
2342
- return e.apply(n, s);
2343
- });
2344
- Qt || (Qt = function(e) {
2345
- for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), s = 1; s < n; s++)
2346
- r[s - 1] = arguments[s];
2347
- return new e(...r);
2348
- });
2349
- const Te = O(Array.prototype.forEach), Mi = O(Array.prototype.lastIndexOf), Gn = O(Array.prototype.pop), we = O(Array.prototype.push), $i = O(Array.prototype.splice), v = Array.isArray, Fe = O(String.prototype.toLowerCase), Ht = O(String.prototype.toString), Wn = O(String.prototype.match), xe = O(String.prototype.replace), qn = O(String.prototype.indexOf), Pi = O(String.prototype.trim), vi = O(Number.prototype.toString), zi = O(Boolean.prototype.toString), Yn = typeof BigInt > "u" ? null : O(BigInt.prototype.toString), Zn = typeof Symbol > "u" ? null : O(Symbol.prototype.toString), A = O(Object.prototype.hasOwnProperty), ze = O(Object.prototype.toString), $ = O(RegExp.prototype.test), st = Fi(TypeError);
2350
- function O(t) {
2351
- return function(e) {
2352
- e instanceof RegExp && (e.lastIndex = 0);
2353
- for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), s = 1; s < n; s++)
2354
- r[s - 1] = arguments[s];
2355
- return Kt(t, e, r);
2356
- };
2357
- }
2358
- function Fi(t) {
2359
- return function() {
2360
- for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
2361
- n[r] = arguments[r];
2362
- return Qt(t, n);
2363
- };
2364
- }
2365
- function y(t, e) {
2366
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Fe;
2367
- if (Vn && Vn(t, null), !v(e))
2368
- return t;
2369
- let r = e.length;
2370
- for (; r--; ) {
2371
- let s = e[r];
2372
- if (typeof s == "string") {
2373
- const i = n(s);
2374
- i !== s && (Di(e) || (e[r] = i), s = i);
2375
- }
2376
- t[s] = !0;
2377
- }
2378
- return t;
2379
- }
2380
- function Ui(t) {
2381
- for (let e = 0; e < t.length; e++)
2382
- A(t, e) || (t[e] = null);
2383
- return t;
2384
- }
2385
- function U(t) {
2386
- const e = Re(null);
2387
- for (const r of Lr(t)) {
2388
- var n = Ii(r, 2);
2389
- const s = n[0], i = n[1];
2390
- A(t, s) && (v(i) ? e[s] = Ui(i) : i && typeof i == "object" && i.constructor === Object ? e[s] = U(i) : e[s] = i);
2391
- }
2392
- return e;
2393
- }
2394
- function Hi(t) {
2395
- switch (typeof t) {
2396
- case "string":
2397
- return t;
2398
- case "number":
2399
- return vi(t);
2400
- case "boolean":
2401
- return zi(t);
2402
- case "bigint":
2403
- return Yn ? Yn(t) : "0";
2404
- case "symbol":
2405
- return Zn ? Zn(t) : "Symbol()";
2406
- case "undefined":
2407
- return ze(t);
2408
- case "function":
2409
- case "object": {
2410
- if (t === null)
2411
- return ze(t);
2412
- const e = t, n = Oe(e, "toString");
2413
- if (typeof n == "function") {
2414
- const r = n(e);
2415
- return typeof r == "string" ? r : ze(r);
2416
- }
2417
- return ze(t);
2418
- }
2419
- default:
2420
- return ze(t);
2421
- }
2422
- }
2423
- function Oe(t, e) {
2424
- for (; t !== null; ) {
2425
- const r = Li(t, e);
2426
- if (r) {
2427
- if (r.get)
2428
- return O(r.get);
2429
- if (typeof r.value == "function")
2430
- return O(r.value);
2431
- }
2432
- t = Ci(t);
2433
- }
2434
- function n() {
2435
- return null;
2436
- }
2437
- return n;
2438
- }
2439
- function Bi(t) {
2440
- try {
2441
- return $(t, ""), !0;
2442
- } catch {
2443
- return !1;
2444
- }
2445
- }
2446
- const Xn = z(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Bt = z(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), jt = z(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), ji = z(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Vt = z(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Vi = z(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Kn = z(["#text"]), Qn = z(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), Gt = z(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Jn = z(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), it = z(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Gi = q(/{{[\w\W]*|^[\w\W]*}}/g), Wi = q(/<%[\w\W]*|^[\w\W]*%>/g), qi = q(/\${[\w\W]*/g), Yi = q(/^data-[\-\w.\u00B7-\uFFFF]+$/), Zi = q(/^aria-[\-\w]+$/), er = q(
2447
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
2448
- // eslint-disable-line no-useless-escape
2449
- ), Xi = q(/^(?:\w+script|data):/i), Ki = q(
2450
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
2451
- // eslint-disable-line no-control-regex
2452
- ), Qi = q(/^html$/i), Ji = q(/^[a-z][.\w]*(-[.\w]+)+$/i), Ee = {
2453
- element: 1,
2454
- text: 3,
2455
- // Deprecated
2456
- progressingInstruction: 7,
2457
- comment: 8,
2458
- document: 9
2459
- }, eo = function() {
2460
- return typeof window > "u" ? null : window;
2461
- }, to = function(e, n) {
2462
- if (typeof e != "object" || typeof e.createPolicy != "function")
2463
- return null;
2464
- let r = null;
2465
- const s = "data-tt-policy-suffix";
2466
- n && n.hasAttribute(s) && (r = n.getAttribute(s));
2467
- const i = "dompurify" + (r ? "#" + r : "");
2468
- try {
2469
- return e.createPolicy(i, {
2470
- createHTML(o) {
2471
- return o;
2472
- },
2473
- createScriptURL(o) {
2474
- return o;
2475
- }
2476
- });
2477
- } catch {
2478
- return console.warn("TrustedTypes policy " + i + " could not be created."), null;
2479
- }
2480
- }, tr = function() {
2481
- return {
2482
- afterSanitizeAttributes: [],
2483
- afterSanitizeElements: [],
2484
- afterSanitizeShadowDOM: [],
2485
- beforeSanitizeAttributes: [],
2486
- beforeSanitizeElements: [],
2487
- beforeSanitizeShadowDOM: [],
2488
- uponSanitizeAttribute: [],
2489
- uponSanitizeElement: [],
2490
- uponSanitizeShadowNode: []
2491
- };
2492
- };
2493
- function $r() {
2494
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : eo();
2495
- const e = (g) => $r(g);
2496
- if (e.version = "3.4.3", e.removed = [], !t || !t.document || t.document.nodeType !== Ee.document || !t.Element)
2497
- return e.isSupported = !1, e;
2498
- let n = t.document;
2499
- const r = n, s = r.currentScript, i = t.DocumentFragment, o = t.HTMLTemplateElement, a = t.Node, c = t.Element, h = t.NodeFilter, p = t.NamedNodeMap, f = p === void 0 ? t.NamedNodeMap || t.MozNamedAttrMap : p, m = t.HTMLFormElement, _ = t.DOMParser, b = t.trustedTypes, E = c.prototype, B = Oe(E, "cloneNode"), De = Oe(E, "remove"), Ge = Oe(E, "nextSibling"), We = Oe(E, "childNodes"), ae = Oe(E, "parentNode");
2500
- if (typeof o == "function") {
2501
- const g = n.createElement("template");
2502
- g.content && g.content.ownerDocument && (n = g.content.ownerDocument);
2503
- }
2504
- let L, ee = "";
2505
- const X = n, Tt = X.implementation, Pr = X.createNodeIterator, vr = X.createDocumentFragment, zr = X.getElementsByTagName, Fr = r.importNode;
2506
- let P = tr();
2507
- e.isSupported = typeof Lr == "function" && typeof ae == "function" && Tt && Tt.createHTMLDocument !== void 0;
2508
- const qe = Gi, Ye = Wi, Ze = qi, Ur = Yi, Hr = Zi, Br = Xi, pn = Ki, jr = Ji;
2509
- let hn = er, N = null;
2510
- const dn = y({}, [...Xn, ...Bt, ...jt, ...Vt, ...Kn]);
2511
- let M = null;
2512
- const mn = y({}, [...Qn, ...Gt, ...Jn, ...it]);
2513
- let S = Object.seal(Re(null, {
2514
- tagNameCheck: {
2515
- writable: !0,
2516
- configurable: !1,
2517
- enumerable: !0,
2518
- value: null
2519
- },
2520
- attributeNameCheck: {
2521
- writable: !0,
2522
- configurable: !1,
2523
- enumerable: !0,
2524
- value: null
2525
- },
2526
- allowCustomizedBuiltInElements: {
2527
- writable: !0,
2528
- configurable: !1,
2529
- enumerable: !0,
2530
- value: !1
2531
- }
2532
- })), Ce = null, Xe = null;
2533
- const re = Object.seal(Re(null, {
2534
- tagCheck: {
2535
- writable: !0,
2536
- configurable: !1,
2537
- enumerable: !0,
2538
- value: null
2539
- },
2540
- attributeCheck: {
2541
- writable: !0,
2542
- configurable: !1,
2543
- enumerable: !0,
2544
- value: null
2545
- }
2546
- }));
2547
- let gn = !0, wt = !0, bn = !1, yn = !0, ce = !1, Le = !0, ue = !1, xt = !1, Et = !1, be = !1, Ke = !1, Qe = !1, _n = !0, kn = !1;
2548
- const Tn = "user-content-";
2549
- let At = !0, Me = !1, ye = {}, K = null;
2550
- const St = y({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
2551
- let wn = null;
2552
- const xn = y({}, ["audio", "video", "img", "source", "image", "track"]);
2553
- let Rt = null;
2554
- const En = y({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Je = "http://www.w3.org/1998/Math/MathML", et = "http://www.w3.org/2000/svg", Q = "http://www.w3.org/1999/xhtml";
2555
- let _e = Q, Ot = !1, It = null;
2556
- const Vr = y({}, [Je, et, Q], Ht);
2557
- let Nt = y({}, ["mi", "mo", "mn", "ms", "mtext"]), Dt = y({}, ["annotation-xml"]);
2558
- const Gr = y({}, ["title", "style", "font", "a", "script"]);
2559
- let $e = null;
2560
- const Wr = ["application/xhtml+xml", "text/html"], qr = "text/html";
2561
- let I = null, ke = null;
2562
- const Yr = n.createElement("form"), An = function(l) {
2563
- return l instanceof RegExp || l instanceof Function;
2564
- }, Ct = function() {
2565
- let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2566
- if (ke && ke === l)
2567
- return;
2568
- (!l || typeof l != "object") && (l = {}), l = U(l), $e = // eslint-disable-next-line unicorn/prefer-includes
2569
- Wr.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? qr : l.PARSER_MEDIA_TYPE, I = $e === "application/xhtml+xml" ? Ht : Fe, N = A(l, "ALLOWED_TAGS") && v(l.ALLOWED_TAGS) ? y({}, l.ALLOWED_TAGS, I) : dn, M = A(l, "ALLOWED_ATTR") && v(l.ALLOWED_ATTR) ? y({}, l.ALLOWED_ATTR, I) : mn, It = A(l, "ALLOWED_NAMESPACES") && v(l.ALLOWED_NAMESPACES) ? y({}, l.ALLOWED_NAMESPACES, Ht) : Vr, Rt = A(l, "ADD_URI_SAFE_ATTR") && v(l.ADD_URI_SAFE_ATTR) ? y(U(En), l.ADD_URI_SAFE_ATTR, I) : En, wn = A(l, "ADD_DATA_URI_TAGS") && v(l.ADD_DATA_URI_TAGS) ? y(U(xn), l.ADD_DATA_URI_TAGS, I) : xn, K = A(l, "FORBID_CONTENTS") && v(l.FORBID_CONTENTS) ? y({}, l.FORBID_CONTENTS, I) : St, Ce = A(l, "FORBID_TAGS") && v(l.FORBID_TAGS) ? y({}, l.FORBID_TAGS, I) : U({}), Xe = A(l, "FORBID_ATTR") && v(l.FORBID_ATTR) ? y({}, l.FORBID_ATTR, I) : U({}), ye = A(l, "USE_PROFILES") ? l.USE_PROFILES && typeof l.USE_PROFILES == "object" ? U(l.USE_PROFILES) : l.USE_PROFILES : !1, gn = l.ALLOW_ARIA_ATTR !== !1, wt = l.ALLOW_DATA_ATTR !== !1, bn = l.ALLOW_UNKNOWN_PROTOCOLS || !1, yn = l.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ce = l.SAFE_FOR_TEMPLATES || !1, Le = l.SAFE_FOR_XML !== !1, ue = l.WHOLE_DOCUMENT || !1, be = l.RETURN_DOM || !1, Ke = l.RETURN_DOM_FRAGMENT || !1, Qe = l.RETURN_TRUSTED_TYPE || !1, Et = l.FORCE_BODY || !1, _n = l.SANITIZE_DOM !== !1, kn = l.SANITIZE_NAMED_PROPS || !1, At = l.KEEP_CONTENT !== !1, Me = l.IN_PLACE || !1, hn = Bi(l.ALLOWED_URI_REGEXP) ? l.ALLOWED_URI_REGEXP : er, _e = typeof l.NAMESPACE == "string" ? l.NAMESPACE : Q, Nt = A(l, "MATHML_TEXT_INTEGRATION_POINTS") && l.MATHML_TEXT_INTEGRATION_POINTS && typeof l.MATHML_TEXT_INTEGRATION_POINTS == "object" ? U(l.MATHML_TEXT_INTEGRATION_POINTS) : y({}, ["mi", "mo", "mn", "ms", "mtext"]), Dt = A(l, "HTML_INTEGRATION_POINTS") && l.HTML_INTEGRATION_POINTS && typeof l.HTML_INTEGRATION_POINTS == "object" ? U(l.HTML_INTEGRATION_POINTS) : y({}, ["annotation-xml"]);
2570
- const u = A(l, "CUSTOM_ELEMENT_HANDLING") && l.CUSTOM_ELEMENT_HANDLING && typeof l.CUSTOM_ELEMENT_HANDLING == "object" ? U(l.CUSTOM_ELEMENT_HANDLING) : Re(null);
2571
- if (S = Re(null), A(u, "tagNameCheck") && An(u.tagNameCheck) && (S.tagNameCheck = u.tagNameCheck), A(u, "attributeNameCheck") && An(u.attributeNameCheck) && (S.attributeNameCheck = u.attributeNameCheck), A(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (S.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), ce && (wt = !1), Ke && (be = !0), ye && (N = y({}, Kn), M = Re(null), ye.html === !0 && (y(N, Xn), y(M, Qn)), ye.svg === !0 && (y(N, Bt), y(M, Gt), y(M, it)), ye.svgFilters === !0 && (y(N, jt), y(M, Gt), y(M, it)), ye.mathMl === !0 && (y(N, Vt), y(M, Jn), y(M, it))), re.tagCheck = null, re.attributeCheck = null, A(l, "ADD_TAGS") && (typeof l.ADD_TAGS == "function" ? re.tagCheck = l.ADD_TAGS : v(l.ADD_TAGS) && (N === dn && (N = U(N)), y(N, l.ADD_TAGS, I))), A(l, "ADD_ATTR") && (typeof l.ADD_ATTR == "function" ? re.attributeCheck = l.ADD_ATTR : v(l.ADD_ATTR) && (M === mn && (M = U(M)), y(M, l.ADD_ATTR, I))), A(l, "ADD_URI_SAFE_ATTR") && v(l.ADD_URI_SAFE_ATTR) && y(Rt, l.ADD_URI_SAFE_ATTR, I), A(l, "FORBID_CONTENTS") && v(l.FORBID_CONTENTS) && (K === St && (K = U(K)), y(K, l.FORBID_CONTENTS, I)), A(l, "ADD_FORBID_CONTENTS") && v(l.ADD_FORBID_CONTENTS) && (K === St && (K = U(K)), y(K, l.ADD_FORBID_CONTENTS, I)), At && (N["#text"] = !0), ue && y(N, ["html", "head", "body"]), N.table && (y(N, ["tbody"]), delete Ce.tbody), l.TRUSTED_TYPES_POLICY) {
2572
- if (typeof l.TRUSTED_TYPES_POLICY.createHTML != "function")
2573
- throw st('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2574
- if (typeof l.TRUSTED_TYPES_POLICY.createScriptURL != "function")
2575
- throw st('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2576
- L = l.TRUSTED_TYPES_POLICY, ee = L.createHTML("");
2577
- } else
2578
- L === void 0 && (L = to(b, s)), L !== null && typeof ee == "string" && (ee = L.createHTML(""));
2579
- z && z(l), ke = l;
2580
- }, Sn = y({}, [...Bt, ...jt, ...ji]), Rn = y({}, [...Vt, ...Vi]), Zr = function(l) {
2581
- let u = ae(l);
2582
- (!u || !u.tagName) && (u = {
2583
- namespaceURI: _e,
2584
- tagName: "template"
2585
- });
2586
- const d = Fe(l.tagName), k = Fe(u.tagName);
2587
- return It[l.namespaceURI] ? l.namespaceURI === et ? u.namespaceURI === Q ? d === "svg" : u.namespaceURI === Je ? d === "svg" && (k === "annotation-xml" || Nt[k]) : !!Sn[d] : l.namespaceURI === Je ? u.namespaceURI === Q ? d === "math" : u.namespaceURI === et ? d === "math" && Dt[k] : !!Rn[d] : l.namespaceURI === Q ? u.namespaceURI === et && !Dt[k] || u.namespaceURI === Je && !Nt[k] ? !1 : !Rn[d] && (Gr[d] || !Sn[d]) : !!($e === "application/xhtml+xml" && It[l.namespaceURI]) : !1;
2588
- }, Y = function(l) {
2589
- we(e.removed, {
2590
- element: l
2591
- });
2592
- try {
2593
- ae(l).removeChild(l);
2594
- } catch {
2595
- De(l);
2596
- }
2597
- }, fe = function(l, u) {
2598
- try {
2599
- we(e.removed, {
2600
- attribute: u.getAttributeNode(l),
2601
- from: u
2602
- });
2603
- } catch {
2604
- we(e.removed, {
2605
- attribute: null,
2606
- from: u
2607
- });
2608
- }
2609
- if (u.removeAttribute(l), l === "is")
2610
- if (be || Ke)
2611
- try {
2612
- Y(u);
2613
- } catch {
2614
- }
2615
- else
2616
- try {
2617
- u.setAttribute(l, "");
2618
- } catch {
2619
- }
2620
- }, On = function(l) {
2621
- let u = null, d = null;
2622
- if (Et)
2623
- l = "<remove></remove>" + l;
2624
- else {
2625
- const R = Wn(l, /^[\r\n\t ]+/);
2626
- d = R && R[0];
2627
- }
2628
- $e === "application/xhtml+xml" && _e === Q && (l = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + l + "</body></html>");
2629
- const k = L ? L.createHTML(l) : l;
2630
- if (_e === Q)
2631
- try {
2632
- u = new _().parseFromString(k, $e);
2633
- } catch {
2634
- }
2635
- if (!u || !u.documentElement) {
2636
- u = Tt.createDocument(_e, "template", null);
2637
- try {
2638
- u.documentElement.innerHTML = Ot ? ee : k;
2639
- } catch {
2640
- }
2641
- }
2642
- const D = u.body || u.documentElement;
2643
- return l && d && D.insertBefore(n.createTextNode(d), D.childNodes[0] || null), _e === Q ? zr.call(u, ue ? "html" : "body")[0] : ue ? u.documentElement : D;
2644
- }, In = function(l) {
2645
- return Pr.call(
2646
- l.ownerDocument || l,
2647
- l,
2648
- // eslint-disable-next-line no-bitwise
2649
- h.SHOW_ELEMENT | h.SHOW_COMMENT | h.SHOW_TEXT | h.SHOW_PROCESSING_INSTRUCTION | h.SHOW_CDATA_SECTION,
2650
- null
2651
- );
2652
- }, Lt = function(l) {
2653
- return l instanceof m && (typeof l.nodeName != "string" || typeof l.textContent != "string" || typeof l.removeChild != "function" || !(l.attributes instanceof f) || typeof l.removeAttribute != "function" || typeof l.setAttribute != "function" || typeof l.namespaceURI != "string" || typeof l.insertBefore != "function" || typeof l.hasChildNodes != "function");
2654
- }, Mt = function(l) {
2655
- return typeof a == "function" && l instanceof a;
2656
- };
2657
- function te(g, l, u) {
2658
- Te(g, (d) => {
2659
- d.call(e, l, u, ke);
2660
- });
2661
- }
2662
- const Nn = function(l) {
2663
- let u = null;
2664
- if (te(P.beforeSanitizeElements, l, null), Lt(l))
2665
- return Y(l), !0;
2666
- const d = I(l.nodeName);
2667
- if (te(P.uponSanitizeElement, l, {
2668
- tagName: d,
2669
- allowedTags: N
2670
- }), Le && l.hasChildNodes() && !Mt(l.firstElementChild) && $(/<[/\w!]/g, l.innerHTML) && $(/<[/\w!]/g, l.textContent) || Le && l.namespaceURI === Q && d === "style" && Mt(l.firstElementChild) || l.nodeType === Ee.progressingInstruction || Le && l.nodeType === Ee.comment && $(/<[/\w]/g, l.data))
2671
- return Y(l), !0;
2672
- if (Ce[d] || !(re.tagCheck instanceof Function && re.tagCheck(d)) && !N[d]) {
2673
- if (!Ce[d] && Cn(d) && (S.tagNameCheck instanceof RegExp && $(S.tagNameCheck, d) || S.tagNameCheck instanceof Function && S.tagNameCheck(d)))
2674
- return !1;
2675
- if (At && !K[d]) {
2676
- const k = ae(l) || l.parentNode, D = We(l) || l.childNodes;
2677
- if (D && k) {
2678
- const R = D.length;
2679
- for (let F = R - 1; F >= 0; --F) {
2680
- const j = B(D[F], !0);
2681
- k.insertBefore(j, Ge(l));
2682
- }
2683
- }
2684
- }
2685
- return Y(l), !0;
2686
- }
2687
- return l instanceof c && !Zr(l) || (d === "noscript" || d === "noembed" || d === "noframes") && $(/<\/no(script|embed|frames)/i, l.innerHTML) ? (Y(l), !0) : (ce && l.nodeType === Ee.text && (u = l.textContent, Te([qe, Ye, Ze], (k) => {
2688
- u = xe(u, k, " ");
2689
- }), l.textContent !== u && (we(e.removed, {
2690
- element: l.cloneNode()
2691
- }), l.textContent = u)), te(P.afterSanitizeElements, l, null), !1);
2692
- }, Dn = function(l, u, d) {
2693
- if (Xe[u] || _n && (u === "id" || u === "name") && (d in n || d in Yr))
2694
- return !1;
2695
- const k = M[u] || re.attributeCheck instanceof Function && re.attributeCheck(u, l);
2696
- if (!(wt && !Xe[u] && $(Ur, u))) {
2697
- if (!(gn && $(Hr, u))) {
2698
- if (!k || Xe[u]) {
2699
- if (
2700
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
2701
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
2702
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
2703
- !(Cn(l) && (S.tagNameCheck instanceof RegExp && $(S.tagNameCheck, l) || S.tagNameCheck instanceof Function && S.tagNameCheck(l)) && (S.attributeNameCheck instanceof RegExp && $(S.attributeNameCheck, u) || S.attributeNameCheck instanceof Function && S.attributeNameCheck(u, l)) || // Alternative, second condition checks if it's an `is`-attribute, AND
2704
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
2705
- u === "is" && S.allowCustomizedBuiltInElements && (S.tagNameCheck instanceof RegExp && $(S.tagNameCheck, d) || S.tagNameCheck instanceof Function && S.tagNameCheck(d)))
2706
- ) return !1;
2707
- } else if (!Rt[u]) {
2708
- if (!$(hn, xe(d, pn, ""))) {
2709
- if (!((u === "src" || u === "xlink:href" || u === "href") && l !== "script" && qn(d, "data:") === 0 && wn[l])) {
2710
- if (!(bn && !$(Br, xe(d, pn, "")))) {
2711
- if (d)
2712
- return !1;
2713
- }
2714
- }
2715
- }
2716
- }
2717
- }
2718
- }
2719
- return !0;
2720
- }, Xr = y({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Cn = function(l) {
2721
- return !Xr[Fe(l)] && $(jr, l);
2722
- }, Ln = function(l) {
2723
- te(P.beforeSanitizeAttributes, l, null);
2724
- const u = l.attributes;
2725
- if (!u || Lt(l))
2726
- return;
2727
- const d = {
2728
- attrName: "",
2729
- attrValue: "",
2730
- keepAttr: !0,
2731
- allowedAttributes: M,
2732
- forceKeepAttr: void 0
2733
- };
2734
- let k = u.length;
2735
- for (; k--; ) {
2736
- const D = u[k], R = D.name, F = D.namespaceURI, j = D.value, Z = I(R), Pt = j;
2737
- let C = R === "value" ? Pt : Pi(Pt);
2738
- if (d.attrName = Z, d.attrValue = C, d.keepAttr = !0, d.forceKeepAttr = void 0, te(P.uponSanitizeAttribute, l, d), C = d.attrValue, kn && (Z === "id" || Z === "name") && qn(C, Tn) !== 0 && (fe(R, l), C = Tn + C), Le && $(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, C)) {
2739
- fe(R, l);
2740
- continue;
2741
- }
2742
- if (Z === "attributename" && Wn(C, "href")) {
2743
- fe(R, l);
2744
- continue;
2745
- }
2746
- if (d.forceKeepAttr)
2747
- continue;
2748
- if (!d.keepAttr) {
2749
- fe(R, l);
2750
- continue;
2751
- }
2752
- if (!yn && $(/\/>/i, C)) {
2753
- fe(R, l);
2754
- continue;
2755
- }
2756
- ce && Te([qe, Ye, Ze], ($n) => {
2757
- C = xe(C, $n, " ");
2758
- });
2759
- const Mn = I(l.nodeName);
2760
- if (!Dn(Mn, Z, C)) {
2761
- fe(R, l);
2762
- continue;
2763
- }
2764
- if (L && typeof b == "object" && typeof b.getAttributeType == "function" && !F)
2765
- switch (b.getAttributeType(Mn, Z)) {
2766
- case "TrustedHTML": {
2767
- C = L.createHTML(C);
2768
- break;
2769
- }
2770
- case "TrustedScriptURL": {
2771
- C = L.createScriptURL(C);
2772
- break;
2773
- }
2774
- }
2775
- if (C !== Pt)
2776
- try {
2777
- F ? l.setAttributeNS(F, R, C) : l.setAttribute(R, C), Lt(l) ? Y(l) : Gn(e.removed);
2778
- } catch {
2779
- fe(R, l);
2780
- }
2781
- }
2782
- te(P.afterSanitizeAttributes, l, null);
2783
- }, $t = function(l) {
2784
- let u = null;
2785
- const d = In(l);
2786
- for (te(P.beforeSanitizeShadowDOM, l, null); u = d.nextNode(); )
2787
- te(P.uponSanitizeShadowNode, u, null), Nn(u), Ln(u), u.content instanceof i && $t(u.content);
2788
- te(P.afterSanitizeShadowDOM, l, null);
2789
- }, tt = function(l) {
2790
- if (l.nodeType === Ee.element && l.shadowRoot instanceof i) {
2791
- const k = l.shadowRoot;
2792
- tt(k), $t(k);
2793
- }
2794
- const u = l.childNodes;
2795
- if (!u)
2796
- return;
2797
- const d = [];
2798
- Te(u, (k) => {
2799
- we(d, k);
2800
- });
2801
- for (const k of d)
2802
- tt(k);
2803
- };
2804
- return e.sanitize = function(g) {
2805
- let l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, d = null, k = null, D = null;
2806
- if (Ot = !g, Ot && (g = "<!-->"), typeof g != "string" && !Mt(g) && (g = Hi(g), typeof g != "string"))
2807
- throw st("dirty is not a string, aborting");
2808
- if (!e.isSupported)
2809
- return g;
2810
- if (xt || Ct(l), e.removed = [], typeof g == "string" && (Me = !1), Me) {
2811
- const j = g.nodeName;
2812
- if (typeof j == "string") {
2813
- const Z = I(j);
2814
- if (!N[Z] || Ce[Z])
2815
- throw st("root node is forbidden and cannot be sanitized in-place");
2816
- }
2817
- tt(g);
2818
- } else if (g instanceof a)
2819
- u = On("<!---->"), d = u.ownerDocument.importNode(g, !0), d.nodeType === Ee.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? u = d : u.appendChild(d), tt(d);
2820
- else {
2821
- if (!be && !ce && !ue && // eslint-disable-next-line unicorn/prefer-includes
2822
- g.indexOf("<") === -1)
2823
- return L && Qe ? L.createHTML(g) : g;
2824
- if (u = On(g), !u)
2825
- return be ? null : Qe ? ee : "";
2826
- }
2827
- u && Et && Y(u.firstChild);
2828
- const R = In(Me ? g : u);
2829
- for (; k = R.nextNode(); )
2830
- Nn(k), Ln(k), k.content instanceof i && $t(k.content);
2831
- if (Me)
2832
- return g;
2833
- if (be) {
2834
- if (ce) {
2835
- u.normalize();
2836
- let j = u.innerHTML;
2837
- Te([qe, Ye, Ze], (Z) => {
2838
- j = xe(j, Z, " ");
2839
- }), u.innerHTML = j;
2840
- }
2841
- if (Ke)
2842
- for (D = vr.call(u.ownerDocument); u.firstChild; )
2843
- D.appendChild(u.firstChild);
2844
- else
2845
- D = u;
2846
- return (M.shadowroot || M.shadowrootmode) && (D = Fr.call(r, D, !0)), D;
2847
- }
2848
- let F = ue ? u.outerHTML : u.innerHTML;
2849
- return ue && N["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && $(Qi, u.ownerDocument.doctype.name) && (F = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
2850
- ` + F), ce && Te([qe, Ye, Ze], (j) => {
2851
- F = xe(F, j, " ");
2852
- }), L && Qe ? L.createHTML(F) : F;
2853
- }, e.setConfig = function() {
2854
- let g = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2855
- Ct(g), xt = !0;
2856
- }, e.clearConfig = function() {
2857
- ke = null, xt = !1;
2858
- }, e.isValidAttribute = function(g, l, u) {
2859
- ke || Ct({});
2860
- const d = I(g), k = I(l);
2861
- return Dn(d, k, u);
2862
- }, e.addHook = function(g, l) {
2863
- typeof l == "function" && we(P[g], l);
2864
- }, e.removeHook = function(g, l) {
2865
- if (l !== void 0) {
2866
- const u = Mi(P[g], l);
2867
- return u === -1 ? void 0 : $i(P[g], u, 1)[0];
2868
- }
2869
- return Gn(P[g]);
2870
- }, e.removeHooks = function(g) {
2871
- P[g] = [];
2872
- }, e.removeAllHooks = function() {
2873
- P = tr();
2874
- }, e;
2875
- }
2876
- $r();
2877
- function no(t, e = "") {
2878
- const n = {}, r = t;
2879
- return Array.isArray(r.fields) ? Object.assign(n, yt(r, e)) : t.type === "array" && t.elements ? Object.assign(n, _t(t, e)) : t.type === "map" && t.values && Object.assign(n, kt(t, e)), n;
2880
- }
2881
- function yt(t, e = "") {
2882
- const n = {};
2883
- if (Array.isArray(t.fields))
2884
- for (const r of t.fields) {
2885
- const s = Object.keys(r)[0], i = r[s], o = e ? oe(e, s) : s;
2886
- if (n[o] = i, i.type === "record" && Array.isArray(i.fields)) {
2887
- const a = yt(i, o);
2888
- Object.assign(n, a);
2889
- } else if (i.type === "array" && i.elements) {
2890
- const a = _t(i, o);
2891
- Object.assign(n, a);
2892
- } else if (i.type === "map" && i.values) {
2893
- const a = kt(i, o);
2894
- Object.assign(n, a);
2895
- }
2896
- }
2897
- return n;
2898
- }
2899
- function _t(t, e = "") {
2900
- const n = {};
2901
- if (t.elements) {
2902
- const r = t.elements, s = oe(e, kr);
2903
- if (n[s] = r, r.type === "record" && Array.isArray(r.fields)) {
2904
- const i = yt(r, s);
2905
- Object.assign(n, i);
2906
- } else if (r.type === "array" && r.elements) {
2907
- const i = _t(r, s);
2908
- Object.assign(n, i);
2909
- } else if (r.type === "map" && r.values) {
2910
- const i = kt(r, s);
2911
- Object.assign(n, i);
2912
- }
2913
- }
2914
- return n;
2915
- }
2916
- function kt(t, e = "") {
2917
- const n = {}, r = oe(e, Tr);
2918
- if (n[r] = t.values, t.values.type === "record" && Array.isArray(t.values.fields)) {
2919
- const s = yt(t.values, r);
2920
- Object.assign(n, s);
2921
- } else if ((t.values.type === "array" || t.values.type === "set") && t.values.elements) {
2922
- const s = _t(t.values, r);
2923
- Object.assign(n, s);
2924
- } else if (t.values.type === "map" && t.values.values) {
2925
- const s = kt(t.values, r);
2926
- Object.assign(n, s);
2927
- }
2928
- return n;
2929
- }
2930
- function fn(t, e) {
2931
- const n = Vs(t), r = [];
2932
- for (let s = 0; s < n.length; s++) {
2933
- const i = n[s], o = r.length > 0 ? oe(...r) : "", a = o ? e[o] : void 0;
2934
- (a == null ? void 0 : a.type) === "map" ? r.push(Tr) : (a == null ? void 0 : a.type) === "array" ? r.push(kr) : r.push(i);
2935
- }
2936
- return oe(...r);
2937
- }
2938
- function ro(t) {
2939
- if (Ws(t)) return "enum";
2940
- switch (t.type) {
2941
- case "string":
2942
- return "string";
2943
- case "number":
2944
- case "integer":
2945
- return "number";
2946
- case "boolean":
2947
- return "boolean";
2948
- case "set":
2949
- return Gs(t) ? "tag" : "enum";
2950
- case "array":
2951
- return "array";
2952
- case "record":
2953
- return "record";
2954
- case "map":
2955
- return "map";
2956
- case "json":
2957
- return "json";
2958
- case "foreign":
2959
- return "foreign";
2960
- default:
2961
- throw new Error(`Unknown field type: ${t.type}`);
2962
- }
2963
- }
2964
- function* ao(t, e, n, r = "") {
2965
- for (const s of t) {
2966
- const i = Object.keys(s)[0], o = r ? oe(r, i) : i, a = Jr(e, i);
2967
- if (a === void 0) continue;
2968
- const c = fn(o, n.schemaMap), h = n.schemaMap[c];
2969
- if (!h)
2970
- throw new Error(`Field schema for "${o}" not found in schema map`);
2971
- yield {
2972
- handlerType: ro(h),
2973
- fieldKey: o,
2974
- fieldSchema: h,
2975
- value: a
2976
- };
2977
- }
2978
- }
2979
- function co(t, e, n) {
2980
- const r = oe(t, String(e)), s = fn(r, n.schemaMap), i = n.schemaMap[s];
2981
- if (!i)
2982
- throw new Error(`Item schema for "${r}" not found in schema map`);
2983
- return { itemKey: r, itemSchema: i };
2984
- }
2985
- function uo(t, e, n) {
2986
- const r = oe(t, e), s = fn(r, n.schemaMap), i = n.schemaMap[s];
2987
- if (!i)
2988
- throw new Error(`Map entry schema for "${r}" not found in schema map`);
2989
- return { entryKey: r, entrySchema: i };
2990
- }
2991
- function fo(t) {
2992
- return t.type === "record" && Array.isArray(t.fields);
2993
- }
2994
- function po(t) {
2995
- return {
2996
- schemaMap: no(t)
2997
- };
2998
- }
2999
- export {
3000
- co as a,
3001
- fo as b,
3002
- po as c,
3003
- uo as d,
3004
- ro as g,
3005
- lo as i,
3006
- oo as s,
3007
- ao as w
3008
- };