@geenius/docs 0.1.0 → 0.4.0

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 (158) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +53 -1
  3. package/package.json +96 -13
  4. package/packages/convex/dist/index.d.ts +503 -0
  5. package/packages/convex/dist/index.js +482 -0
  6. package/packages/convex/dist/index.js.map +1 -0
  7. package/packages/react/dist/index.d.ts +439 -0
  8. package/packages/react/dist/index.js +4954 -0
  9. package/packages/react/dist/index.js.map +1 -0
  10. package/packages/react-css/{src/styles.css → dist/index.css} +183 -223
  11. package/packages/react-css/dist/index.css.map +1 -0
  12. package/packages/react-css/dist/index.d.ts +443 -0
  13. package/packages/react-css/dist/index.js +5058 -0
  14. package/packages/react-css/dist/index.js.map +1 -0
  15. package/packages/shared/dist/index.d.ts +684 -0
  16. package/packages/shared/dist/index.js +788 -0
  17. package/packages/shared/dist/index.js.map +1 -0
  18. package/packages/solidjs/dist/index.d.ts +435 -0
  19. package/packages/solidjs/dist/index.js +4584 -0
  20. package/packages/solidjs/dist/index.js.map +1 -0
  21. package/packages/solidjs-css/{src/styles.css → dist/index.css} +183 -223
  22. package/packages/solidjs-css/dist/index.css.map +1 -0
  23. package/packages/solidjs-css/dist/index.d.ts +432 -0
  24. package/packages/solidjs-css/dist/index.js +4934 -0
  25. package/packages/solidjs-css/dist/index.js.map +1 -0
  26. package/.changeset/config.json +0 -11
  27. package/.github/CODEOWNERS +0 -1
  28. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -16
  29. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -11
  30. package/.github/PULL_REQUEST_TEMPLATE.md +0 -10
  31. package/.github/dependabot.yml +0 -11
  32. package/.github/workflows/ci.yml +0 -23
  33. package/.github/workflows/release.yml +0 -29
  34. package/.nvmrc +0 -1
  35. package/.project/ACCOUNT.yaml +0 -4
  36. package/.project/IDEAS.yaml +0 -7
  37. package/.project/PROJECT.yaml +0 -11
  38. package/.project/ROADMAP.yaml +0 -15
  39. package/CODE_OF_CONDUCT.md +0 -16
  40. package/CONTRIBUTING.md +0 -26
  41. package/SECURITY.md +0 -15
  42. package/SUPPORT.md +0 -8
  43. package/packages/convex/README.md +0 -1
  44. package/packages/convex/package.json +0 -12
  45. package/packages/convex/src/convex.config.ts +0 -3
  46. package/packages/convex/src/index.ts +0 -3
  47. package/packages/convex/src/mutations.ts +0 -270
  48. package/packages/convex/src/queries.ts +0 -175
  49. package/packages/convex/src/schema.ts +0 -55
  50. package/packages/react/README.md +0 -1
  51. package/packages/react/package.json +0 -36
  52. package/packages/react/src/DocsLayout.tsx +0 -116
  53. package/packages/react/src/DocsProvider.tsx +0 -93
  54. package/packages/react/src/RouterDocsContent.tsx +0 -148
  55. package/packages/react/src/RouterDocsLayout.tsx +0 -161
  56. package/packages/react/src/components/Breadcrumbs.tsx +0 -34
  57. package/packages/react/src/components/DocPage.tsx +0 -191
  58. package/packages/react/src/components/DocSearch.tsx +0 -140
  59. package/packages/react/src/components/DocSidebar.tsx +0 -86
  60. package/packages/react/src/components/DocsLayout.tsx +0 -62
  61. package/packages/react/src/components/EditButton.tsx +0 -26
  62. package/packages/react/src/components/PageNavigation.tsx +0 -45
  63. package/packages/react/src/components/TableOfContents.tsx +0 -46
  64. package/packages/react/src/components/VersionSelector.tsx +0 -60
  65. package/packages/react/src/components/index.ts +0 -9
  66. package/packages/react/src/hooks/index.ts +0 -8
  67. package/packages/react/src/hooks/useDocSearch.ts +0 -55
  68. package/packages/react/src/hooks/useDocs.ts +0 -57
  69. package/packages/react/src/hooks/useDocsAdmin.ts +0 -151
  70. package/packages/react/src/hooks/useTableOfContents.ts +0 -66
  71. package/packages/react/src/index.ts +0 -38
  72. package/packages/react/src/pages/DocSearchPage.tsx +0 -129
  73. package/packages/react/src/pages/DocViewPage.tsx +0 -158
  74. package/packages/react/src/pages/DocsAdminPage.tsx +0 -330
  75. package/packages/react/src/pages/DocsIndexPage.tsx +0 -172
  76. package/packages/react/src/pages/index.ts +0 -4
  77. package/packages/react/src/useDocs.ts +0 -58
  78. package/packages/react/tsup.config.ts +0 -12
  79. package/packages/react-css/README.md +0 -1
  80. package/packages/react-css/package.json +0 -37
  81. package/packages/react-css/src/DocsLayout.tsx +0 -117
  82. package/packages/react-css/src/DocsProvider.tsx +0 -93
  83. package/packages/react-css/src/RouterDocsContent.tsx +0 -60
  84. package/packages/react-css/src/RouterDocsLayout.tsx +0 -101
  85. package/packages/react-css/src/components/DocPage.tsx +0 -21
  86. package/packages/react-css/src/components/DocSearch.tsx +0 -55
  87. package/packages/react-css/src/components/DocSidebar.tsx +0 -56
  88. package/packages/react-css/src/components/DocsLayout.tsx +0 -28
  89. package/packages/react-css/src/components/common.tsx +0 -93
  90. package/packages/react-css/src/components/index.ts +0 -5
  91. package/packages/react-css/src/hooks/index.ts +0 -2
  92. package/packages/react-css/src/index.ts +0 -6
  93. package/packages/react-css/src/index.tsx +0 -3
  94. package/packages/react-css/src/pages/DocViewPage.tsx +0 -78
  95. package/packages/react-css/src/pages/DocsAdminPage.tsx +0 -101
  96. package/packages/react-css/src/pages/DocsIndexPage.tsx +0 -68
  97. package/packages/react-css/src/pages/index.ts +0 -3
  98. package/packages/react-css/src/useDocs.ts +0 -58
  99. package/packages/react-css/tsconfig.json +0 -19
  100. package/packages/react-css/tsup.config.ts +0 -10
  101. package/packages/shared/README.md +0 -1
  102. package/packages/shared/package.json +0 -31
  103. package/packages/shared/src/__tests__/docs.test.ts +0 -69
  104. package/packages/shared/src/config.ts +0 -80
  105. package/packages/shared/src/index.ts +0 -179
  106. package/packages/shared/src/providers/astro.ts +0 -94
  107. package/packages/shared/src/providers/fumadocs.ts +0 -116
  108. package/packages/shared/src/providers/internal.ts +0 -80
  109. package/packages/shared/src/types.ts +0 -73
  110. package/packages/shared/tsconfig.json +0 -18
  111. package/packages/shared/tsup.config.ts +0 -12
  112. package/packages/shared/vitest.config.ts +0 -4
  113. package/packages/solidjs/README.md +0 -1
  114. package/packages/solidjs/package.json +0 -33
  115. package/packages/solidjs/src/DocsLayout.tsx +0 -87
  116. package/packages/solidjs/src/DocsProvider.tsx +0 -95
  117. package/packages/solidjs/src/RouterDocsContent.tsx +0 -147
  118. package/packages/solidjs/src/RouterDocsLayout.tsx +0 -161
  119. package/packages/solidjs/src/components/Breadcrumbs.tsx +0 -27
  120. package/packages/solidjs/src/components/DocPage.tsx +0 -110
  121. package/packages/solidjs/src/components/DocSearch.tsx +0 -81
  122. package/packages/solidjs/src/components/DocSidebar.tsx +0 -92
  123. package/packages/solidjs/src/components/DocsLayout.tsx +0 -38
  124. package/packages/solidjs/src/components/EditButton.tsx +0 -15
  125. package/packages/solidjs/src/components/PageNavigation.tsx +0 -31
  126. package/packages/solidjs/src/components/TableOfContents.tsx +0 -41
  127. package/packages/solidjs/src/components/VersionSelector.tsx +0 -30
  128. package/packages/solidjs/src/components/index.ts +0 -9
  129. package/packages/solidjs/src/createDocs.ts +0 -62
  130. package/packages/solidjs/src/index.ts +0 -28
  131. package/packages/solidjs/src/pages/DocSearchPage.tsx +0 -72
  132. package/packages/solidjs/src/pages/DocViewPage.tsx +0 -80
  133. package/packages/solidjs/src/pages/DocsAdminPage.tsx +0 -123
  134. package/packages/solidjs/src/pages/DocsIndexPage.tsx +0 -85
  135. package/packages/solidjs/src/pages/index.ts +0 -4
  136. package/packages/solidjs/src/primitives/createDocSearch.ts +0 -42
  137. package/packages/solidjs/src/primitives/createDocs.ts +0 -35
  138. package/packages/solidjs/src/primitives/createDocsAdmin.ts +0 -63
  139. package/packages/solidjs/src/primitives/createTableOfContents.ts +0 -51
  140. package/packages/solidjs/src/primitives/index.ts +0 -4
  141. package/packages/solidjs/tsup.config.ts +0 -12
  142. package/packages/solidjs-css/README.md +0 -1
  143. package/packages/solidjs-css/package.json +0 -36
  144. package/packages/solidjs-css/src/DocsLayout.tsx +0 -106
  145. package/packages/solidjs-css/src/DocsProvider.tsx +0 -95
  146. package/packages/solidjs-css/src/RouterDocsContent.tsx +0 -54
  147. package/packages/solidjs-css/src/RouterDocsLayout.tsx +0 -104
  148. package/packages/solidjs-css/src/createDocs.ts +0 -62
  149. package/packages/solidjs-css/src/index.ts +0 -7
  150. package/packages/solidjs-css/src/index.tsx +0 -17
  151. package/packages/solidjs-css/src/pages/DocViewPage.tsx +0 -111
  152. package/packages/solidjs-css/src/pages/DocsAdminPage.tsx +0 -332
  153. package/packages/solidjs-css/src/pages/DocsIndexPage.tsx +0 -116
  154. package/packages/solidjs-css/src/pages/index.ts +0 -3
  155. package/packages/solidjs-css/src/primitives/index.ts +0 -1
  156. package/packages/solidjs-css/tsconfig.json +0 -20
  157. package/packages/solidjs-css/tsup.config.ts +0 -10
  158. package/pnpm-workspace.yaml +0 -2
@@ -0,0 +1,4584 @@
1
+ import { Show, For, createSignal, createEffect, children, onCleanup, createMemo } from 'solid-js';
2
+ import { jsx, jsxs, Fragment } from 'solid-js/h/jsx-runtime';
3
+ import remarkGfm from 'remark-gfm';
4
+ import { SolidMarkdown } from 'solid-markdown';
5
+ import { AnimatePresence, motion } from '@geenius/motion/solidjs';
6
+
7
+ var __create = Object.create;
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ var __getProtoOf = Object.getPrototypeOf;
12
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
13
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
14
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
15
+ }) : x)(function(x) {
16
+ if (typeof require !== "undefined") return require.apply(this, arguments);
17
+ throw Error('Dynamic require of "' + x + '" is not supported');
18
+ });
19
+ var __commonJS = (cb, mod) => function __require2() {
20
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
+ };
22
+ var __copyProps = (to, from, except, desc) => {
23
+ if (from && typeof from === "object" || typeof from === "function") {
24
+ for (let key of __getOwnPropNames(from))
25
+ if (!__hasOwnProp.call(to, key) && key !== except)
26
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
+ }
28
+ return to;
29
+ };
30
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
31
+ // If the importer is in node compatibility mode or this is not an ESM
32
+ // file that has been converted to a CommonJS file using a Babel-
33
+ // compatible transform (i.e. "__esModule" has not been set), then set
34
+ // "default" to the CommonJS "module.exports" for node compatibility.
35
+ __defProp(target, "default", { value: mod, enumerable: true }) ,
36
+ mod
37
+ ));
38
+
39
+ // ../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js
40
+ var require_kind_of = __commonJS({
41
+ "../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js"(exports2, module2) {
42
+ var toString = Object.prototype.toString;
43
+ module2.exports = function kindOf(val) {
44
+ if (val === void 0) return "undefined";
45
+ if (val === null) return "null";
46
+ var type = typeof val;
47
+ if (type === "boolean") return "boolean";
48
+ if (type === "string") return "string";
49
+ if (type === "number") return "number";
50
+ if (type === "symbol") return "symbol";
51
+ if (type === "function") {
52
+ return isGeneratorFn(val) ? "generatorfunction" : "function";
53
+ }
54
+ if (isArray(val)) return "array";
55
+ if (isBuffer(val)) return "buffer";
56
+ if (isArguments(val)) return "arguments";
57
+ if (isDate(val)) return "date";
58
+ if (isError(val)) return "error";
59
+ if (isRegexp(val)) return "regexp";
60
+ switch (ctorName(val)) {
61
+ case "Symbol":
62
+ return "symbol";
63
+ case "Promise":
64
+ return "promise";
65
+ // Set, Map, WeakSet, WeakMap
66
+ case "WeakMap":
67
+ return "weakmap";
68
+ case "WeakSet":
69
+ return "weakset";
70
+ case "Map":
71
+ return "map";
72
+ case "Set":
73
+ return "set";
74
+ // 8-bit typed arrays
75
+ case "Int8Array":
76
+ return "int8array";
77
+ case "Uint8Array":
78
+ return "uint8array";
79
+ case "Uint8ClampedArray":
80
+ return "uint8clampedarray";
81
+ // 16-bit typed arrays
82
+ case "Int16Array":
83
+ return "int16array";
84
+ case "Uint16Array":
85
+ return "uint16array";
86
+ // 32-bit typed arrays
87
+ case "Int32Array":
88
+ return "int32array";
89
+ case "Uint32Array":
90
+ return "uint32array";
91
+ case "Float32Array":
92
+ return "float32array";
93
+ case "Float64Array":
94
+ return "float64array";
95
+ }
96
+ if (isGeneratorObj(val)) {
97
+ return "generator";
98
+ }
99
+ type = toString.call(val);
100
+ switch (type) {
101
+ case "[object Object]":
102
+ return "object";
103
+ // iterators
104
+ case "[object Map Iterator]":
105
+ return "mapiterator";
106
+ case "[object Set Iterator]":
107
+ return "setiterator";
108
+ case "[object String Iterator]":
109
+ return "stringiterator";
110
+ case "[object Array Iterator]":
111
+ return "arrayiterator";
112
+ }
113
+ return type.slice(8, -1).toLowerCase().replace(/\s/g, "");
114
+ };
115
+ function ctorName(val) {
116
+ return typeof val.constructor === "function" ? val.constructor.name : null;
117
+ }
118
+ function isArray(val) {
119
+ if (Array.isArray) return Array.isArray(val);
120
+ return val instanceof Array;
121
+ }
122
+ function isError(val) {
123
+ return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
124
+ }
125
+ function isDate(val) {
126
+ if (val instanceof Date) return true;
127
+ return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
128
+ }
129
+ function isRegexp(val) {
130
+ if (val instanceof RegExp) return true;
131
+ return typeof val.flags === "string" && typeof val.ignoreCase === "boolean" && typeof val.multiline === "boolean" && typeof val.global === "boolean";
132
+ }
133
+ function isGeneratorFn(name, val) {
134
+ return ctorName(name) === "GeneratorFunction";
135
+ }
136
+ function isGeneratorObj(val) {
137
+ return typeof val.throw === "function" && typeof val.return === "function" && typeof val.next === "function";
138
+ }
139
+ function isArguments(val) {
140
+ try {
141
+ if (typeof val.length === "number" && typeof val.callee === "function") {
142
+ return true;
143
+ }
144
+ } catch (err) {
145
+ if (err.message.indexOf("callee") !== -1) {
146
+ return true;
147
+ }
148
+ }
149
+ return false;
150
+ }
151
+ function isBuffer(val) {
152
+ if (val.constructor && typeof val.constructor.isBuffer === "function") {
153
+ return val.constructor.isBuffer(val);
154
+ }
155
+ return false;
156
+ }
157
+ }
158
+ });
159
+
160
+ // ../../node_modules/.pnpm/is-extendable@0.1.1/node_modules/is-extendable/index.js
161
+ var require_is_extendable = __commonJS({
162
+ "../../node_modules/.pnpm/is-extendable@0.1.1/node_modules/is-extendable/index.js"(exports2, module2) {
163
+ module2.exports = function isExtendable(val) {
164
+ return typeof val !== "undefined" && val !== null && (typeof val === "object" || typeof val === "function");
165
+ };
166
+ }
167
+ });
168
+
169
+ // ../../node_modules/.pnpm/extend-shallow@2.0.1/node_modules/extend-shallow/index.js
170
+ var require_extend_shallow = __commonJS({
171
+ "../../node_modules/.pnpm/extend-shallow@2.0.1/node_modules/extend-shallow/index.js"(exports2, module2) {
172
+ var isObject = require_is_extendable();
173
+ module2.exports = function extend(o) {
174
+ if (!isObject(o)) {
175
+ o = {};
176
+ }
177
+ var len = arguments.length;
178
+ for (var i = 1; i < len; i++) {
179
+ var obj = arguments[i];
180
+ if (isObject(obj)) {
181
+ assign(o, obj);
182
+ }
183
+ }
184
+ return o;
185
+ };
186
+ function assign(a, b) {
187
+ for (var key in b) {
188
+ if (hasOwn(b, key)) {
189
+ a[key] = b[key];
190
+ }
191
+ }
192
+ }
193
+ function hasOwn(obj, key) {
194
+ return Object.prototype.hasOwnProperty.call(obj, key);
195
+ }
196
+ }
197
+ });
198
+
199
+ // ../../node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.js
200
+ var require_section_matter = __commonJS({
201
+ "../../node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.js"(exports2, module2) {
202
+ var typeOf = require_kind_of();
203
+ var extend = require_extend_shallow();
204
+ module2.exports = function(input, options2) {
205
+ if (typeof options2 === "function") {
206
+ options2 = { parse: options2 };
207
+ }
208
+ var file = toObject(input);
209
+ var defaults = { section_delimiter: "---", parse: identity };
210
+ var opts = extend({}, defaults, options2);
211
+ var delim = opts.section_delimiter;
212
+ var lines = file.content.split(/\r?\n/);
213
+ var sections = null;
214
+ var section = createSection();
215
+ var content = [];
216
+ var stack = [];
217
+ function initSections(val) {
218
+ file.content = val;
219
+ sections = [];
220
+ content = [];
221
+ }
222
+ function closeSection(val) {
223
+ if (stack.length) {
224
+ section.key = getKey(stack[0], delim);
225
+ section.content = val;
226
+ opts.parse(section, sections);
227
+ sections.push(section);
228
+ section = createSection();
229
+ content = [];
230
+ stack = [];
231
+ }
232
+ }
233
+ for (var i = 0; i < lines.length; i++) {
234
+ var line = lines[i];
235
+ var len = stack.length;
236
+ var ln = line.trim();
237
+ if (isDelimiter(ln, delim)) {
238
+ if (ln.length === 3 && i !== 0) {
239
+ if (len === 0 || len === 2) {
240
+ content.push(line);
241
+ continue;
242
+ }
243
+ stack.push(ln);
244
+ section.data = content.join("\n");
245
+ content = [];
246
+ continue;
247
+ }
248
+ if (sections === null) {
249
+ initSections(content.join("\n"));
250
+ }
251
+ if (len === 2) {
252
+ closeSection(content.join("\n"));
253
+ }
254
+ stack.push(ln);
255
+ continue;
256
+ }
257
+ content.push(line);
258
+ }
259
+ if (sections === null) {
260
+ initSections(content.join("\n"));
261
+ } else {
262
+ closeSection(content.join("\n"));
263
+ }
264
+ file.sections = sections;
265
+ return file;
266
+ };
267
+ function isDelimiter(line, delim) {
268
+ if (line.slice(0, delim.length) !== delim) {
269
+ return false;
270
+ }
271
+ if (line.charAt(delim.length + 1) === delim.slice(-1)) {
272
+ return false;
273
+ }
274
+ return true;
275
+ }
276
+ function toObject(input) {
277
+ if (typeOf(input) !== "object") {
278
+ input = { content: input };
279
+ }
280
+ if (typeof input.content !== "string" && !isBuffer(input.content)) {
281
+ throw new TypeError("expected a buffer or string");
282
+ }
283
+ input.content = input.content.toString();
284
+ input.sections = [];
285
+ return input;
286
+ }
287
+ function getKey(val, delim) {
288
+ return val ? val.slice(delim.length).trim() : "";
289
+ }
290
+ function createSection() {
291
+ return { key: "", data: "", content: "" };
292
+ }
293
+ function identity(val) {
294
+ return val;
295
+ }
296
+ function isBuffer(val) {
297
+ if (val && val.constructor && typeof val.constructor.isBuffer === "function") {
298
+ return val.constructor.isBuffer(val);
299
+ }
300
+ return false;
301
+ }
302
+ }
303
+ });
304
+
305
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/common.js
306
+ var require_common = __commonJS({
307
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/common.js"(exports2, module2) {
308
+ function isNothing(subject) {
309
+ return typeof subject === "undefined" || subject === null;
310
+ }
311
+ function isObject(subject) {
312
+ return typeof subject === "object" && subject !== null;
313
+ }
314
+ function toArray(sequence) {
315
+ if (Array.isArray(sequence)) return sequence;
316
+ else if (isNothing(sequence)) return [];
317
+ return [sequence];
318
+ }
319
+ function extend(target, source) {
320
+ var index, length, key, sourceKeys;
321
+ if (source) {
322
+ sourceKeys = Object.keys(source);
323
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
324
+ key = sourceKeys[index];
325
+ target[key] = source[key];
326
+ }
327
+ }
328
+ return target;
329
+ }
330
+ function repeat(string, count) {
331
+ var result = "", cycle;
332
+ for (cycle = 0; cycle < count; cycle += 1) {
333
+ result += string;
334
+ }
335
+ return result;
336
+ }
337
+ function isNegativeZero(number) {
338
+ return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
339
+ }
340
+ module2.exports.isNothing = isNothing;
341
+ module2.exports.isObject = isObject;
342
+ module2.exports.toArray = toArray;
343
+ module2.exports.repeat = repeat;
344
+ module2.exports.isNegativeZero = isNegativeZero;
345
+ module2.exports.extend = extend;
346
+ }
347
+ });
348
+
349
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/exception.js
350
+ var require_exception = __commonJS({
351
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/exception.js"(exports2, module2) {
352
+ function YAMLException(reason, mark) {
353
+ Error.call(this);
354
+ this.name = "YAMLException";
355
+ this.reason = reason;
356
+ this.mark = mark;
357
+ this.message = (this.reason || "(unknown reason)") + (this.mark ? " " + this.mark.toString() : "");
358
+ if (Error.captureStackTrace) {
359
+ Error.captureStackTrace(this, this.constructor);
360
+ } else {
361
+ this.stack = new Error().stack || "";
362
+ }
363
+ }
364
+ YAMLException.prototype = Object.create(Error.prototype);
365
+ YAMLException.prototype.constructor = YAMLException;
366
+ YAMLException.prototype.toString = function toString(compact) {
367
+ var result = this.name + ": ";
368
+ result += this.reason || "(unknown reason)";
369
+ if (!compact && this.mark) {
370
+ result += " " + this.mark.toString();
371
+ }
372
+ return result;
373
+ };
374
+ module2.exports = YAMLException;
375
+ }
376
+ });
377
+
378
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/mark.js
379
+ var require_mark = __commonJS({
380
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/mark.js"(exports2, module2) {
381
+ var common = require_common();
382
+ function Mark(name, buffer, position, line, column) {
383
+ this.name = name;
384
+ this.buffer = buffer;
385
+ this.position = position;
386
+ this.line = line;
387
+ this.column = column;
388
+ }
389
+ Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
390
+ var head, start, tail, end, snippet;
391
+ if (!this.buffer) return null;
392
+ indent = indent || 4;
393
+ maxLength = maxLength || 75;
394
+ head = "";
395
+ start = this.position;
396
+ while (start > 0 && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(start - 1)) === -1) {
397
+ start -= 1;
398
+ if (this.position - start > maxLength / 2 - 1) {
399
+ head = " ... ";
400
+ start += 5;
401
+ break;
402
+ }
403
+ }
404
+ tail = "";
405
+ end = this.position;
406
+ while (end < this.buffer.length && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(end)) === -1) {
407
+ end += 1;
408
+ if (end - this.position > maxLength / 2 - 1) {
409
+ tail = " ... ";
410
+ end -= 5;
411
+ break;
412
+ }
413
+ }
414
+ snippet = this.buffer.slice(start, end);
415
+ return common.repeat(" ", indent) + head + snippet + tail + "\n" + common.repeat(" ", indent + this.position - start + head.length) + "^";
416
+ };
417
+ Mark.prototype.toString = function toString(compact) {
418
+ var snippet, where = "";
419
+ if (this.name) {
420
+ where += 'in "' + this.name + '" ';
421
+ }
422
+ where += "at line " + (this.line + 1) + ", column " + (this.column + 1);
423
+ if (!compact) {
424
+ snippet = this.getSnippet();
425
+ if (snippet) {
426
+ where += ":\n" + snippet;
427
+ }
428
+ }
429
+ return where;
430
+ };
431
+ module2.exports = Mark;
432
+ }
433
+ });
434
+
435
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type.js
436
+ var require_type = __commonJS({
437
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type.js"(exports2, module2) {
438
+ var YAMLException = require_exception();
439
+ var TYPE_CONSTRUCTOR_OPTIONS = [
440
+ "kind",
441
+ "resolve",
442
+ "construct",
443
+ "instanceOf",
444
+ "predicate",
445
+ "represent",
446
+ "defaultStyle",
447
+ "styleAliases"
448
+ ];
449
+ var YAML_NODE_KINDS = [
450
+ "scalar",
451
+ "sequence",
452
+ "mapping"
453
+ ];
454
+ function compileStyleAliases(map) {
455
+ var result = {};
456
+ if (map !== null) {
457
+ Object.keys(map).forEach(function(style) {
458
+ map[style].forEach(function(alias) {
459
+ result[String(alias)] = style;
460
+ });
461
+ });
462
+ }
463
+ return result;
464
+ }
465
+ function Type(tag, options2) {
466
+ options2 = options2 || {};
467
+ Object.keys(options2).forEach(function(name) {
468
+ if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
469
+ throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
470
+ }
471
+ });
472
+ this.tag = tag;
473
+ this.kind = options2["kind"] || null;
474
+ this.resolve = options2["resolve"] || function() {
475
+ return true;
476
+ };
477
+ this.construct = options2["construct"] || function(data) {
478
+ return data;
479
+ };
480
+ this.instanceOf = options2["instanceOf"] || null;
481
+ this.predicate = options2["predicate"] || null;
482
+ this.represent = options2["represent"] || null;
483
+ this.defaultStyle = options2["defaultStyle"] || null;
484
+ this.styleAliases = compileStyleAliases(options2["styleAliases"] || null);
485
+ if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
486
+ throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
487
+ }
488
+ }
489
+ module2.exports = Type;
490
+ }
491
+ });
492
+
493
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema.js
494
+ var require_schema = __commonJS({
495
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema.js"(exports2, module2) {
496
+ var common = require_common();
497
+ var YAMLException = require_exception();
498
+ var Type = require_type();
499
+ function compileList(schema, name, result) {
500
+ var exclude = [];
501
+ schema.include.forEach(function(includedSchema) {
502
+ result = compileList(includedSchema, name, result);
503
+ });
504
+ schema[name].forEach(function(currentType) {
505
+ result.forEach(function(previousType, previousIndex) {
506
+ if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
507
+ exclude.push(previousIndex);
508
+ }
509
+ });
510
+ result.push(currentType);
511
+ });
512
+ return result.filter(function(type, index) {
513
+ return exclude.indexOf(index) === -1;
514
+ });
515
+ }
516
+ function compileMap() {
517
+ var result = {
518
+ scalar: {},
519
+ sequence: {},
520
+ mapping: {},
521
+ fallback: {}
522
+ }, index, length;
523
+ function collectType(type) {
524
+ result[type.kind][type.tag] = result["fallback"][type.tag] = type;
525
+ }
526
+ for (index = 0, length = arguments.length; index < length; index += 1) {
527
+ arguments[index].forEach(collectType);
528
+ }
529
+ return result;
530
+ }
531
+ function Schema(definition) {
532
+ this.include = definition.include || [];
533
+ this.implicit = definition.implicit || [];
534
+ this.explicit = definition.explicit || [];
535
+ this.implicit.forEach(function(type) {
536
+ if (type.loadKind && type.loadKind !== "scalar") {
537
+ throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
538
+ }
539
+ });
540
+ this.compiledImplicit = compileList(this, "implicit", []);
541
+ this.compiledExplicit = compileList(this, "explicit", []);
542
+ this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
543
+ }
544
+ Schema.DEFAULT = null;
545
+ Schema.create = function createSchema() {
546
+ var schemas, types;
547
+ switch (arguments.length) {
548
+ case 1:
549
+ schemas = Schema.DEFAULT;
550
+ types = arguments[0];
551
+ break;
552
+ case 2:
553
+ schemas = arguments[0];
554
+ types = arguments[1];
555
+ break;
556
+ default:
557
+ throw new YAMLException("Wrong number of arguments for Schema.create function");
558
+ }
559
+ schemas = common.toArray(schemas);
560
+ types = common.toArray(types);
561
+ if (!schemas.every(function(schema) {
562
+ return schema instanceof Schema;
563
+ })) {
564
+ throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
565
+ }
566
+ if (!types.every(function(type) {
567
+ return type instanceof Type;
568
+ })) {
569
+ throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
570
+ }
571
+ return new Schema({
572
+ include: schemas,
573
+ explicit: types
574
+ });
575
+ };
576
+ module2.exports = Schema;
577
+ }
578
+ });
579
+
580
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/str.js
581
+ var require_str = __commonJS({
582
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/str.js"(exports2, module2) {
583
+ var Type = require_type();
584
+ module2.exports = new Type("tag:yaml.org,2002:str", {
585
+ kind: "scalar",
586
+ construct: function(data) {
587
+ return data !== null ? data : "";
588
+ }
589
+ });
590
+ }
591
+ });
592
+
593
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/seq.js
594
+ var require_seq = __commonJS({
595
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/seq.js"(exports2, module2) {
596
+ var Type = require_type();
597
+ module2.exports = new Type("tag:yaml.org,2002:seq", {
598
+ kind: "sequence",
599
+ construct: function(data) {
600
+ return data !== null ? data : [];
601
+ }
602
+ });
603
+ }
604
+ });
605
+
606
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/map.js
607
+ var require_map = __commonJS({
608
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/map.js"(exports2, module2) {
609
+ var Type = require_type();
610
+ module2.exports = new Type("tag:yaml.org,2002:map", {
611
+ kind: "mapping",
612
+ construct: function(data) {
613
+ return data !== null ? data : {};
614
+ }
615
+ });
616
+ }
617
+ });
618
+
619
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js
620
+ var require_failsafe = __commonJS({
621
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js"(exports2, module2) {
622
+ var Schema = require_schema();
623
+ module2.exports = new Schema({
624
+ explicit: [
625
+ require_str(),
626
+ require_seq(),
627
+ require_map()
628
+ ]
629
+ });
630
+ }
631
+ });
632
+
633
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/null.js
634
+ var require_null = __commonJS({
635
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/null.js"(exports2, module2) {
636
+ var Type = require_type();
637
+ function resolveYamlNull(data) {
638
+ if (data === null) return true;
639
+ var max = data.length;
640
+ return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
641
+ }
642
+ function constructYamlNull() {
643
+ return null;
644
+ }
645
+ function isNull(object) {
646
+ return object === null;
647
+ }
648
+ module2.exports = new Type("tag:yaml.org,2002:null", {
649
+ kind: "scalar",
650
+ resolve: resolveYamlNull,
651
+ construct: constructYamlNull,
652
+ predicate: isNull,
653
+ represent: {
654
+ canonical: function() {
655
+ return "~";
656
+ },
657
+ lowercase: function() {
658
+ return "null";
659
+ },
660
+ uppercase: function() {
661
+ return "NULL";
662
+ },
663
+ camelcase: function() {
664
+ return "Null";
665
+ }
666
+ },
667
+ defaultStyle: "lowercase"
668
+ });
669
+ }
670
+ });
671
+
672
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/bool.js
673
+ var require_bool = __commonJS({
674
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/bool.js"(exports2, module2) {
675
+ var Type = require_type();
676
+ function resolveYamlBoolean(data) {
677
+ if (data === null) return false;
678
+ var max = data.length;
679
+ return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
680
+ }
681
+ function constructYamlBoolean(data) {
682
+ return data === "true" || data === "True" || data === "TRUE";
683
+ }
684
+ function isBoolean(object) {
685
+ return Object.prototype.toString.call(object) === "[object Boolean]";
686
+ }
687
+ module2.exports = new Type("tag:yaml.org,2002:bool", {
688
+ kind: "scalar",
689
+ resolve: resolveYamlBoolean,
690
+ construct: constructYamlBoolean,
691
+ predicate: isBoolean,
692
+ represent: {
693
+ lowercase: function(object) {
694
+ return object ? "true" : "false";
695
+ },
696
+ uppercase: function(object) {
697
+ return object ? "TRUE" : "FALSE";
698
+ },
699
+ camelcase: function(object) {
700
+ return object ? "True" : "False";
701
+ }
702
+ },
703
+ defaultStyle: "lowercase"
704
+ });
705
+ }
706
+ });
707
+
708
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/int.js
709
+ var require_int = __commonJS({
710
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/int.js"(exports2, module2) {
711
+ var common = require_common();
712
+ var Type = require_type();
713
+ function isHexCode(c) {
714
+ return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
715
+ }
716
+ function isOctCode(c) {
717
+ return 48 <= c && c <= 55;
718
+ }
719
+ function isDecCode(c) {
720
+ return 48 <= c && c <= 57;
721
+ }
722
+ function resolveYamlInteger(data) {
723
+ if (data === null) return false;
724
+ var max = data.length, index = 0, hasDigits = false, ch;
725
+ if (!max) return false;
726
+ ch = data[index];
727
+ if (ch === "-" || ch === "+") {
728
+ ch = data[++index];
729
+ }
730
+ if (ch === "0") {
731
+ if (index + 1 === max) return true;
732
+ ch = data[++index];
733
+ if (ch === "b") {
734
+ index++;
735
+ for (; index < max; index++) {
736
+ ch = data[index];
737
+ if (ch === "_") continue;
738
+ if (ch !== "0" && ch !== "1") return false;
739
+ hasDigits = true;
740
+ }
741
+ return hasDigits && ch !== "_";
742
+ }
743
+ if (ch === "x") {
744
+ index++;
745
+ for (; index < max; index++) {
746
+ ch = data[index];
747
+ if (ch === "_") continue;
748
+ if (!isHexCode(data.charCodeAt(index))) return false;
749
+ hasDigits = true;
750
+ }
751
+ return hasDigits && ch !== "_";
752
+ }
753
+ for (; index < max; index++) {
754
+ ch = data[index];
755
+ if (ch === "_") continue;
756
+ if (!isOctCode(data.charCodeAt(index))) return false;
757
+ hasDigits = true;
758
+ }
759
+ return hasDigits && ch !== "_";
760
+ }
761
+ if (ch === "_") return false;
762
+ for (; index < max; index++) {
763
+ ch = data[index];
764
+ if (ch === "_") continue;
765
+ if (ch === ":") break;
766
+ if (!isDecCode(data.charCodeAt(index))) {
767
+ return false;
768
+ }
769
+ hasDigits = true;
770
+ }
771
+ if (!hasDigits || ch === "_") return false;
772
+ if (ch !== ":") return true;
773
+ return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
774
+ }
775
+ function constructYamlInteger(data) {
776
+ var value = data, sign = 1, ch, base, digits = [];
777
+ if (value.indexOf("_") !== -1) {
778
+ value = value.replace(/_/g, "");
779
+ }
780
+ ch = value[0];
781
+ if (ch === "-" || ch === "+") {
782
+ if (ch === "-") sign = -1;
783
+ value = value.slice(1);
784
+ ch = value[0];
785
+ }
786
+ if (value === "0") return 0;
787
+ if (ch === "0") {
788
+ if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
789
+ if (value[1] === "x") return sign * parseInt(value, 16);
790
+ return sign * parseInt(value, 8);
791
+ }
792
+ if (value.indexOf(":") !== -1) {
793
+ value.split(":").forEach(function(v) {
794
+ digits.unshift(parseInt(v, 10));
795
+ });
796
+ value = 0;
797
+ base = 1;
798
+ digits.forEach(function(d) {
799
+ value += d * base;
800
+ base *= 60;
801
+ });
802
+ return sign * value;
803
+ }
804
+ return sign * parseInt(value, 10);
805
+ }
806
+ function isInteger(object) {
807
+ return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
808
+ }
809
+ module2.exports = new Type("tag:yaml.org,2002:int", {
810
+ kind: "scalar",
811
+ resolve: resolveYamlInteger,
812
+ construct: constructYamlInteger,
813
+ predicate: isInteger,
814
+ represent: {
815
+ binary: function(obj) {
816
+ return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
817
+ },
818
+ octal: function(obj) {
819
+ return obj >= 0 ? "0" + obj.toString(8) : "-0" + obj.toString(8).slice(1);
820
+ },
821
+ decimal: function(obj) {
822
+ return obj.toString(10);
823
+ },
824
+ /* eslint-disable max-len */
825
+ hexadecimal: function(obj) {
826
+ return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
827
+ }
828
+ },
829
+ defaultStyle: "decimal",
830
+ styleAliases: {
831
+ binary: [2, "bin"],
832
+ octal: [8, "oct"],
833
+ decimal: [10, "dec"],
834
+ hexadecimal: [16, "hex"]
835
+ }
836
+ });
837
+ }
838
+ });
839
+
840
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/float.js
841
+ var require_float = __commonJS({
842
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/float.js"(exports2, module2) {
843
+ var common = require_common();
844
+ var Type = require_type();
845
+ var YAML_FLOAT_PATTERN = new RegExp(
846
+ // 2.5e4, 2.5 and integers
847
+ "^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
848
+ );
849
+ function resolveYamlFloat(data) {
850
+ if (data === null) return false;
851
+ if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
852
+ // Probably should update regexp & check speed
853
+ data[data.length - 1] === "_") {
854
+ return false;
855
+ }
856
+ return true;
857
+ }
858
+ function constructYamlFloat(data) {
859
+ var value, sign, base, digits;
860
+ value = data.replace(/_/g, "").toLowerCase();
861
+ sign = value[0] === "-" ? -1 : 1;
862
+ digits = [];
863
+ if ("+-".indexOf(value[0]) >= 0) {
864
+ value = value.slice(1);
865
+ }
866
+ if (value === ".inf") {
867
+ return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
868
+ } else if (value === ".nan") {
869
+ return NaN;
870
+ } else if (value.indexOf(":") >= 0) {
871
+ value.split(":").forEach(function(v) {
872
+ digits.unshift(parseFloat(v, 10));
873
+ });
874
+ value = 0;
875
+ base = 1;
876
+ digits.forEach(function(d) {
877
+ value += d * base;
878
+ base *= 60;
879
+ });
880
+ return sign * value;
881
+ }
882
+ return sign * parseFloat(value, 10);
883
+ }
884
+ var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
885
+ function representYamlFloat(object, style) {
886
+ var res;
887
+ if (isNaN(object)) {
888
+ switch (style) {
889
+ case "lowercase":
890
+ return ".nan";
891
+ case "uppercase":
892
+ return ".NAN";
893
+ case "camelcase":
894
+ return ".NaN";
895
+ }
896
+ } else if (Number.POSITIVE_INFINITY === object) {
897
+ switch (style) {
898
+ case "lowercase":
899
+ return ".inf";
900
+ case "uppercase":
901
+ return ".INF";
902
+ case "camelcase":
903
+ return ".Inf";
904
+ }
905
+ } else if (Number.NEGATIVE_INFINITY === object) {
906
+ switch (style) {
907
+ case "lowercase":
908
+ return "-.inf";
909
+ case "uppercase":
910
+ return "-.INF";
911
+ case "camelcase":
912
+ return "-.Inf";
913
+ }
914
+ } else if (common.isNegativeZero(object)) {
915
+ return "-0.0";
916
+ }
917
+ res = object.toString(10);
918
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
919
+ }
920
+ function isFloat(object) {
921
+ return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
922
+ }
923
+ module2.exports = new Type("tag:yaml.org,2002:float", {
924
+ kind: "scalar",
925
+ resolve: resolveYamlFloat,
926
+ construct: constructYamlFloat,
927
+ predicate: isFloat,
928
+ represent: representYamlFloat,
929
+ defaultStyle: "lowercase"
930
+ });
931
+ }
932
+ });
933
+
934
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/json.js
935
+ var require_json = __commonJS({
936
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/json.js"(exports2, module2) {
937
+ var Schema = require_schema();
938
+ module2.exports = new Schema({
939
+ include: [
940
+ require_failsafe()
941
+ ],
942
+ implicit: [
943
+ require_null(),
944
+ require_bool(),
945
+ require_int(),
946
+ require_float()
947
+ ]
948
+ });
949
+ }
950
+ });
951
+
952
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/core.js
953
+ var require_core = __commonJS({
954
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/core.js"(exports2, module2) {
955
+ var Schema = require_schema();
956
+ module2.exports = new Schema({
957
+ include: [
958
+ require_json()
959
+ ]
960
+ });
961
+ }
962
+ });
963
+
964
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/timestamp.js
965
+ var require_timestamp = __commonJS({
966
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/timestamp.js"(exports2, module2) {
967
+ var Type = require_type();
968
+ var YAML_DATE_REGEXP = new RegExp(
969
+ "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
970
+ );
971
+ var YAML_TIMESTAMP_REGEXP = new RegExp(
972
+ "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
973
+ );
974
+ function resolveYamlTimestamp(data) {
975
+ if (data === null) return false;
976
+ if (YAML_DATE_REGEXP.exec(data) !== null) return true;
977
+ if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
978
+ return false;
979
+ }
980
+ function constructYamlTimestamp(data) {
981
+ var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
982
+ match = YAML_DATE_REGEXP.exec(data);
983
+ if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
984
+ if (match === null) throw new Error("Date resolve error");
985
+ year = +match[1];
986
+ month = +match[2] - 1;
987
+ day = +match[3];
988
+ if (!match[4]) {
989
+ return new Date(Date.UTC(year, month, day));
990
+ }
991
+ hour = +match[4];
992
+ minute = +match[5];
993
+ second = +match[6];
994
+ if (match[7]) {
995
+ fraction = match[7].slice(0, 3);
996
+ while (fraction.length < 3) {
997
+ fraction += "0";
998
+ }
999
+ fraction = +fraction;
1000
+ }
1001
+ if (match[9]) {
1002
+ tz_hour = +match[10];
1003
+ tz_minute = +(match[11] || 0);
1004
+ delta = (tz_hour * 60 + tz_minute) * 6e4;
1005
+ if (match[9] === "-") delta = -delta;
1006
+ }
1007
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
1008
+ if (delta) date.setTime(date.getTime() - delta);
1009
+ return date;
1010
+ }
1011
+ function representYamlTimestamp(object) {
1012
+ return object.toISOString();
1013
+ }
1014
+ module2.exports = new Type("tag:yaml.org,2002:timestamp", {
1015
+ kind: "scalar",
1016
+ resolve: resolveYamlTimestamp,
1017
+ construct: constructYamlTimestamp,
1018
+ instanceOf: Date,
1019
+ represent: representYamlTimestamp
1020
+ });
1021
+ }
1022
+ });
1023
+
1024
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/merge.js
1025
+ var require_merge = __commonJS({
1026
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/merge.js"(exports2, module2) {
1027
+ var Type = require_type();
1028
+ function resolveYamlMerge(data) {
1029
+ return data === "<<" || data === null;
1030
+ }
1031
+ module2.exports = new Type("tag:yaml.org,2002:merge", {
1032
+ kind: "scalar",
1033
+ resolve: resolveYamlMerge
1034
+ });
1035
+ }
1036
+ });
1037
+
1038
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/binary.js
1039
+ var require_binary = __commonJS({
1040
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/binary.js"(exports2, module2) {
1041
+ var NodeBuffer;
1042
+ try {
1043
+ _require = __require;
1044
+ NodeBuffer = _require("buffer").Buffer;
1045
+ } catch (__) {
1046
+ }
1047
+ var _require;
1048
+ var Type = require_type();
1049
+ var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
1050
+ function resolveYamlBinary(data) {
1051
+ if (data === null) return false;
1052
+ var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
1053
+ for (idx = 0; idx < max; idx++) {
1054
+ code = map.indexOf(data.charAt(idx));
1055
+ if (code > 64) continue;
1056
+ if (code < 0) return false;
1057
+ bitlen += 6;
1058
+ }
1059
+ return bitlen % 8 === 0;
1060
+ }
1061
+ function constructYamlBinary(data) {
1062
+ var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = [];
1063
+ for (idx = 0; idx < max; idx++) {
1064
+ if (idx % 4 === 0 && idx) {
1065
+ result.push(bits >> 16 & 255);
1066
+ result.push(bits >> 8 & 255);
1067
+ result.push(bits & 255);
1068
+ }
1069
+ bits = bits << 6 | map.indexOf(input.charAt(idx));
1070
+ }
1071
+ tailbits = max % 4 * 6;
1072
+ if (tailbits === 0) {
1073
+ result.push(bits >> 16 & 255);
1074
+ result.push(bits >> 8 & 255);
1075
+ result.push(bits & 255);
1076
+ } else if (tailbits === 18) {
1077
+ result.push(bits >> 10 & 255);
1078
+ result.push(bits >> 2 & 255);
1079
+ } else if (tailbits === 12) {
1080
+ result.push(bits >> 4 & 255);
1081
+ }
1082
+ if (NodeBuffer) {
1083
+ return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
1084
+ }
1085
+ return result;
1086
+ }
1087
+ function representYamlBinary(object) {
1088
+ var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
1089
+ for (idx = 0; idx < max; idx++) {
1090
+ if (idx % 3 === 0 && idx) {
1091
+ result += map[bits >> 18 & 63];
1092
+ result += map[bits >> 12 & 63];
1093
+ result += map[bits >> 6 & 63];
1094
+ result += map[bits & 63];
1095
+ }
1096
+ bits = (bits << 8) + object[idx];
1097
+ }
1098
+ tail = max % 3;
1099
+ if (tail === 0) {
1100
+ result += map[bits >> 18 & 63];
1101
+ result += map[bits >> 12 & 63];
1102
+ result += map[bits >> 6 & 63];
1103
+ result += map[bits & 63];
1104
+ } else if (tail === 2) {
1105
+ result += map[bits >> 10 & 63];
1106
+ result += map[bits >> 4 & 63];
1107
+ result += map[bits << 2 & 63];
1108
+ result += map[64];
1109
+ } else if (tail === 1) {
1110
+ result += map[bits >> 2 & 63];
1111
+ result += map[bits << 4 & 63];
1112
+ result += map[64];
1113
+ result += map[64];
1114
+ }
1115
+ return result;
1116
+ }
1117
+ function isBinary(object) {
1118
+ return NodeBuffer && NodeBuffer.isBuffer(object);
1119
+ }
1120
+ module2.exports = new Type("tag:yaml.org,2002:binary", {
1121
+ kind: "scalar",
1122
+ resolve: resolveYamlBinary,
1123
+ construct: constructYamlBinary,
1124
+ predicate: isBinary,
1125
+ represent: representYamlBinary
1126
+ });
1127
+ }
1128
+ });
1129
+
1130
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/omap.js
1131
+ var require_omap = __commonJS({
1132
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/omap.js"(exports2, module2) {
1133
+ var Type = require_type();
1134
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
1135
+ var _toString = Object.prototype.toString;
1136
+ function resolveYamlOmap(data) {
1137
+ if (data === null) return true;
1138
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
1139
+ for (index = 0, length = object.length; index < length; index += 1) {
1140
+ pair = object[index];
1141
+ pairHasKey = false;
1142
+ if (_toString.call(pair) !== "[object Object]") return false;
1143
+ for (pairKey in pair) {
1144
+ if (_hasOwnProperty.call(pair, pairKey)) {
1145
+ if (!pairHasKey) pairHasKey = true;
1146
+ else return false;
1147
+ }
1148
+ }
1149
+ if (!pairHasKey) return false;
1150
+ if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
1151
+ else return false;
1152
+ }
1153
+ return true;
1154
+ }
1155
+ function constructYamlOmap(data) {
1156
+ return data !== null ? data : [];
1157
+ }
1158
+ module2.exports = new Type("tag:yaml.org,2002:omap", {
1159
+ kind: "sequence",
1160
+ resolve: resolveYamlOmap,
1161
+ construct: constructYamlOmap
1162
+ });
1163
+ }
1164
+ });
1165
+
1166
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/pairs.js
1167
+ var require_pairs = __commonJS({
1168
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/pairs.js"(exports2, module2) {
1169
+ var Type = require_type();
1170
+ var _toString = Object.prototype.toString;
1171
+ function resolveYamlPairs(data) {
1172
+ if (data === null) return true;
1173
+ var index, length, pair, keys, result, object = data;
1174
+ result = new Array(object.length);
1175
+ for (index = 0, length = object.length; index < length; index += 1) {
1176
+ pair = object[index];
1177
+ if (_toString.call(pair) !== "[object Object]") return false;
1178
+ keys = Object.keys(pair);
1179
+ if (keys.length !== 1) return false;
1180
+ result[index] = [keys[0], pair[keys[0]]];
1181
+ }
1182
+ return true;
1183
+ }
1184
+ function constructYamlPairs(data) {
1185
+ if (data === null) return [];
1186
+ var index, length, pair, keys, result, object = data;
1187
+ result = new Array(object.length);
1188
+ for (index = 0, length = object.length; index < length; index += 1) {
1189
+ pair = object[index];
1190
+ keys = Object.keys(pair);
1191
+ result[index] = [keys[0], pair[keys[0]]];
1192
+ }
1193
+ return result;
1194
+ }
1195
+ module2.exports = new Type("tag:yaml.org,2002:pairs", {
1196
+ kind: "sequence",
1197
+ resolve: resolveYamlPairs,
1198
+ construct: constructYamlPairs
1199
+ });
1200
+ }
1201
+ });
1202
+
1203
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/set.js
1204
+ var require_set = __commonJS({
1205
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/set.js"(exports2, module2) {
1206
+ var Type = require_type();
1207
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
1208
+ function resolveYamlSet(data) {
1209
+ if (data === null) return true;
1210
+ var key, object = data;
1211
+ for (key in object) {
1212
+ if (_hasOwnProperty.call(object, key)) {
1213
+ if (object[key] !== null) return false;
1214
+ }
1215
+ }
1216
+ return true;
1217
+ }
1218
+ function constructYamlSet(data) {
1219
+ return data !== null ? data : {};
1220
+ }
1221
+ module2.exports = new Type("tag:yaml.org,2002:set", {
1222
+ kind: "mapping",
1223
+ resolve: resolveYamlSet,
1224
+ construct: constructYamlSet
1225
+ });
1226
+ }
1227
+ });
1228
+
1229
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js
1230
+ var require_default_safe = __commonJS({
1231
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js"(exports2, module2) {
1232
+ var Schema = require_schema();
1233
+ module2.exports = new Schema({
1234
+ include: [
1235
+ require_core()
1236
+ ],
1237
+ implicit: [
1238
+ require_timestamp(),
1239
+ require_merge()
1240
+ ],
1241
+ explicit: [
1242
+ require_binary(),
1243
+ require_omap(),
1244
+ require_pairs(),
1245
+ require_set()
1246
+ ]
1247
+ });
1248
+ }
1249
+ });
1250
+
1251
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js
1252
+ var require_undefined = __commonJS({
1253
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js"(exports2, module2) {
1254
+ var Type = require_type();
1255
+ function resolveJavascriptUndefined() {
1256
+ return true;
1257
+ }
1258
+ function constructJavascriptUndefined() {
1259
+ return void 0;
1260
+ }
1261
+ function representJavascriptUndefined() {
1262
+ return "";
1263
+ }
1264
+ function isUndefined(object) {
1265
+ return typeof object === "undefined";
1266
+ }
1267
+ module2.exports = new Type("tag:yaml.org,2002:js/undefined", {
1268
+ kind: "scalar",
1269
+ resolve: resolveJavascriptUndefined,
1270
+ construct: constructJavascriptUndefined,
1271
+ predicate: isUndefined,
1272
+ represent: representJavascriptUndefined
1273
+ });
1274
+ }
1275
+ });
1276
+
1277
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js
1278
+ var require_regexp = __commonJS({
1279
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js"(exports2, module2) {
1280
+ var Type = require_type();
1281
+ function resolveJavascriptRegExp(data) {
1282
+ if (data === null) return false;
1283
+ if (data.length === 0) return false;
1284
+ var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
1285
+ if (regexp[0] === "/") {
1286
+ if (tail) modifiers = tail[1];
1287
+ if (modifiers.length > 3) return false;
1288
+ if (regexp[regexp.length - modifiers.length - 1] !== "/") return false;
1289
+ }
1290
+ return true;
1291
+ }
1292
+ function constructJavascriptRegExp(data) {
1293
+ var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
1294
+ if (regexp[0] === "/") {
1295
+ if (tail) modifiers = tail[1];
1296
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
1297
+ }
1298
+ return new RegExp(regexp, modifiers);
1299
+ }
1300
+ function representJavascriptRegExp(object) {
1301
+ var result = "/" + object.source + "/";
1302
+ if (object.global) result += "g";
1303
+ if (object.multiline) result += "m";
1304
+ if (object.ignoreCase) result += "i";
1305
+ return result;
1306
+ }
1307
+ function isRegExp(object) {
1308
+ return Object.prototype.toString.call(object) === "[object RegExp]";
1309
+ }
1310
+ module2.exports = new Type("tag:yaml.org,2002:js/regexp", {
1311
+ kind: "scalar",
1312
+ resolve: resolveJavascriptRegExp,
1313
+ construct: constructJavascriptRegExp,
1314
+ predicate: isRegExp,
1315
+ represent: representJavascriptRegExp
1316
+ });
1317
+ }
1318
+ });
1319
+
1320
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/function.js
1321
+ var require_function = __commonJS({
1322
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/function.js"(exports2, module2) {
1323
+ var esprima;
1324
+ try {
1325
+ _require = __require;
1326
+ esprima = _require("esprima");
1327
+ } catch (_) {
1328
+ if (typeof window !== "undefined") esprima = window.esprima;
1329
+ }
1330
+ var _require;
1331
+ var Type = require_type();
1332
+ function resolveJavascriptFunction(data) {
1333
+ if (data === null) return false;
1334
+ try {
1335
+ var source = "(" + data + ")", ast = esprima.parse(source, { range: true });
1336
+ if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") {
1337
+ return false;
1338
+ }
1339
+ return true;
1340
+ } catch (err) {
1341
+ return false;
1342
+ }
1343
+ }
1344
+ function constructJavascriptFunction(data) {
1345
+ var source = "(" + data + ")", ast = esprima.parse(source, { range: true }), params = [], body;
1346
+ if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") {
1347
+ throw new Error("Failed to resolve function");
1348
+ }
1349
+ ast.body[0].expression.params.forEach(function(param) {
1350
+ params.push(param.name);
1351
+ });
1352
+ body = ast.body[0].expression.body.range;
1353
+ if (ast.body[0].expression.body.type === "BlockStatement") {
1354
+ return new Function(params, source.slice(body[0] + 1, body[1] - 1));
1355
+ }
1356
+ return new Function(params, "return " + source.slice(body[0], body[1]));
1357
+ }
1358
+ function representJavascriptFunction(object) {
1359
+ return object.toString();
1360
+ }
1361
+ function isFunction(object) {
1362
+ return Object.prototype.toString.call(object) === "[object Function]";
1363
+ }
1364
+ module2.exports = new Type("tag:yaml.org,2002:js/function", {
1365
+ kind: "scalar",
1366
+ resolve: resolveJavascriptFunction,
1367
+ construct: constructJavascriptFunction,
1368
+ predicate: isFunction,
1369
+ represent: representJavascriptFunction
1370
+ });
1371
+ }
1372
+ });
1373
+
1374
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_full.js
1375
+ var require_default_full = __commonJS({
1376
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_full.js"(exports2, module2) {
1377
+ var Schema = require_schema();
1378
+ module2.exports = Schema.DEFAULT = new Schema({
1379
+ include: [
1380
+ require_default_safe()
1381
+ ],
1382
+ explicit: [
1383
+ require_undefined(),
1384
+ require_regexp(),
1385
+ require_function()
1386
+ ]
1387
+ });
1388
+ }
1389
+ });
1390
+
1391
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/loader.js
1392
+ var require_loader = __commonJS({
1393
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/loader.js"(exports2, module2) {
1394
+ var common = require_common();
1395
+ var YAMLException = require_exception();
1396
+ var Mark = require_mark();
1397
+ var DEFAULT_SAFE_SCHEMA = require_default_safe();
1398
+ var DEFAULT_FULL_SCHEMA = require_default_full();
1399
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
1400
+ var CONTEXT_FLOW_IN = 1;
1401
+ var CONTEXT_FLOW_OUT = 2;
1402
+ var CONTEXT_BLOCK_IN = 3;
1403
+ var CONTEXT_BLOCK_OUT = 4;
1404
+ var CHOMPING_CLIP = 1;
1405
+ var CHOMPING_STRIP = 2;
1406
+ var CHOMPING_KEEP = 3;
1407
+ var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
1408
+ var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
1409
+ var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
1410
+ var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
1411
+ var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
1412
+ function _class(obj) {
1413
+ return Object.prototype.toString.call(obj);
1414
+ }
1415
+ function is_EOL(c) {
1416
+ return c === 10 || c === 13;
1417
+ }
1418
+ function is_WHITE_SPACE(c) {
1419
+ return c === 9 || c === 32;
1420
+ }
1421
+ function is_WS_OR_EOL(c) {
1422
+ return c === 9 || c === 32 || c === 10 || c === 13;
1423
+ }
1424
+ function is_FLOW_INDICATOR(c) {
1425
+ return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
1426
+ }
1427
+ function fromHexCode(c) {
1428
+ var lc;
1429
+ if (48 <= c && c <= 57) {
1430
+ return c - 48;
1431
+ }
1432
+ lc = c | 32;
1433
+ if (97 <= lc && lc <= 102) {
1434
+ return lc - 97 + 10;
1435
+ }
1436
+ return -1;
1437
+ }
1438
+ function escapedHexLen(c) {
1439
+ if (c === 120) {
1440
+ return 2;
1441
+ }
1442
+ if (c === 117) {
1443
+ return 4;
1444
+ }
1445
+ if (c === 85) {
1446
+ return 8;
1447
+ }
1448
+ return 0;
1449
+ }
1450
+ function fromDecimalCode(c) {
1451
+ if (48 <= c && c <= 57) {
1452
+ return c - 48;
1453
+ }
1454
+ return -1;
1455
+ }
1456
+ function simpleEscapeSequence(c) {
1457
+ return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
1458
+ }
1459
+ function charFromCodepoint(c) {
1460
+ if (c <= 65535) {
1461
+ return String.fromCharCode(c);
1462
+ }
1463
+ return String.fromCharCode(
1464
+ (c - 65536 >> 10) + 55296,
1465
+ (c - 65536 & 1023) + 56320
1466
+ );
1467
+ }
1468
+ function setProperty(object, key, value) {
1469
+ if (key === "__proto__") {
1470
+ Object.defineProperty(object, key, {
1471
+ configurable: true,
1472
+ enumerable: true,
1473
+ writable: true,
1474
+ value
1475
+ });
1476
+ } else {
1477
+ object[key] = value;
1478
+ }
1479
+ }
1480
+ var simpleEscapeCheck = new Array(256);
1481
+ var simpleEscapeMap = new Array(256);
1482
+ for (i = 0; i < 256; i++) {
1483
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
1484
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
1485
+ }
1486
+ var i;
1487
+ function State(input, options2) {
1488
+ this.input = input;
1489
+ this.filename = options2["filename"] || null;
1490
+ this.schema = options2["schema"] || DEFAULT_FULL_SCHEMA;
1491
+ this.onWarning = options2["onWarning"] || null;
1492
+ this.legacy = options2["legacy"] || false;
1493
+ this.json = options2["json"] || false;
1494
+ this.listener = options2["listener"] || null;
1495
+ this.implicitTypes = this.schema.compiledImplicit;
1496
+ this.typeMap = this.schema.compiledTypeMap;
1497
+ this.length = input.length;
1498
+ this.position = 0;
1499
+ this.line = 0;
1500
+ this.lineStart = 0;
1501
+ this.lineIndent = 0;
1502
+ this.documents = [];
1503
+ }
1504
+ function generateError(state, message) {
1505
+ return new YAMLException(
1506
+ message,
1507
+ new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart)
1508
+ );
1509
+ }
1510
+ function throwError(state, message) {
1511
+ throw generateError(state, message);
1512
+ }
1513
+ function throwWarning(state, message) {
1514
+ if (state.onWarning) {
1515
+ state.onWarning.call(null, generateError(state, message));
1516
+ }
1517
+ }
1518
+ var directiveHandlers = {
1519
+ YAML: function handleYamlDirective(state, name, args) {
1520
+ var match, major, minor;
1521
+ if (state.version !== null) {
1522
+ throwError(state, "duplication of %YAML directive");
1523
+ }
1524
+ if (args.length !== 1) {
1525
+ throwError(state, "YAML directive accepts exactly one argument");
1526
+ }
1527
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
1528
+ if (match === null) {
1529
+ throwError(state, "ill-formed argument of the YAML directive");
1530
+ }
1531
+ major = parseInt(match[1], 10);
1532
+ minor = parseInt(match[2], 10);
1533
+ if (major !== 1) {
1534
+ throwError(state, "unacceptable YAML version of the document");
1535
+ }
1536
+ state.version = args[0];
1537
+ state.checkLineBreaks = minor < 2;
1538
+ if (minor !== 1 && minor !== 2) {
1539
+ throwWarning(state, "unsupported YAML version of the document");
1540
+ }
1541
+ },
1542
+ TAG: function handleTagDirective(state, name, args) {
1543
+ var handle, prefix;
1544
+ if (args.length !== 2) {
1545
+ throwError(state, "TAG directive accepts exactly two arguments");
1546
+ }
1547
+ handle = args[0];
1548
+ prefix = args[1];
1549
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
1550
+ throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
1551
+ }
1552
+ if (_hasOwnProperty.call(state.tagMap, handle)) {
1553
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
1554
+ }
1555
+ if (!PATTERN_TAG_URI.test(prefix)) {
1556
+ throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
1557
+ }
1558
+ state.tagMap[handle] = prefix;
1559
+ }
1560
+ };
1561
+ function captureSegment(state, start, end, checkJson) {
1562
+ var _position, _length, _character, _result;
1563
+ if (start < end) {
1564
+ _result = state.input.slice(start, end);
1565
+ if (checkJson) {
1566
+ for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
1567
+ _character = _result.charCodeAt(_position);
1568
+ if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
1569
+ throwError(state, "expected valid JSON character");
1570
+ }
1571
+ }
1572
+ } else if (PATTERN_NON_PRINTABLE.test(_result)) {
1573
+ throwError(state, "the stream contains non-printable characters");
1574
+ }
1575
+ state.result += _result;
1576
+ }
1577
+ }
1578
+ function mergeMappings(state, destination, source, overridableKeys) {
1579
+ var sourceKeys, key, index, quantity;
1580
+ if (!common.isObject(source)) {
1581
+ throwError(state, "cannot merge mappings; the provided source object is unacceptable");
1582
+ }
1583
+ sourceKeys = Object.keys(source);
1584
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
1585
+ key = sourceKeys[index];
1586
+ if (!_hasOwnProperty.call(destination, key)) {
1587
+ setProperty(destination, key, source[key]);
1588
+ overridableKeys[key] = true;
1589
+ }
1590
+ }
1591
+ }
1592
+ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
1593
+ var index, quantity;
1594
+ if (Array.isArray(keyNode)) {
1595
+ keyNode = Array.prototype.slice.call(keyNode);
1596
+ for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
1597
+ if (Array.isArray(keyNode[index])) {
1598
+ throwError(state, "nested arrays are not supported inside keys");
1599
+ }
1600
+ if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
1601
+ keyNode[index] = "[object Object]";
1602
+ }
1603
+ }
1604
+ }
1605
+ if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
1606
+ keyNode = "[object Object]";
1607
+ }
1608
+ keyNode = String(keyNode);
1609
+ if (_result === null) {
1610
+ _result = {};
1611
+ }
1612
+ if (keyTag === "tag:yaml.org,2002:merge") {
1613
+ if (Array.isArray(valueNode)) {
1614
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
1615
+ mergeMappings(state, _result, valueNode[index], overridableKeys);
1616
+ }
1617
+ } else {
1618
+ mergeMappings(state, _result, valueNode, overridableKeys);
1619
+ }
1620
+ } else {
1621
+ if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
1622
+ state.line = startLine || state.line;
1623
+ state.position = startPos || state.position;
1624
+ throwError(state, "duplicated mapping key");
1625
+ }
1626
+ setProperty(_result, keyNode, valueNode);
1627
+ delete overridableKeys[keyNode];
1628
+ }
1629
+ return _result;
1630
+ }
1631
+ function readLineBreak(state) {
1632
+ var ch;
1633
+ ch = state.input.charCodeAt(state.position);
1634
+ if (ch === 10) {
1635
+ state.position++;
1636
+ } else if (ch === 13) {
1637
+ state.position++;
1638
+ if (state.input.charCodeAt(state.position) === 10) {
1639
+ state.position++;
1640
+ }
1641
+ } else {
1642
+ throwError(state, "a line break is expected");
1643
+ }
1644
+ state.line += 1;
1645
+ state.lineStart = state.position;
1646
+ }
1647
+ function skipSeparationSpace(state, allowComments, checkIndent) {
1648
+ var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
1649
+ while (ch !== 0) {
1650
+ while (is_WHITE_SPACE(ch)) {
1651
+ ch = state.input.charCodeAt(++state.position);
1652
+ }
1653
+ if (allowComments && ch === 35) {
1654
+ do {
1655
+ ch = state.input.charCodeAt(++state.position);
1656
+ } while (ch !== 10 && ch !== 13 && ch !== 0);
1657
+ }
1658
+ if (is_EOL(ch)) {
1659
+ readLineBreak(state);
1660
+ ch = state.input.charCodeAt(state.position);
1661
+ lineBreaks++;
1662
+ state.lineIndent = 0;
1663
+ while (ch === 32) {
1664
+ state.lineIndent++;
1665
+ ch = state.input.charCodeAt(++state.position);
1666
+ }
1667
+ } else {
1668
+ break;
1669
+ }
1670
+ }
1671
+ if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
1672
+ throwWarning(state, "deficient indentation");
1673
+ }
1674
+ return lineBreaks;
1675
+ }
1676
+ function testDocumentSeparator(state) {
1677
+ var _position = state.position, ch;
1678
+ ch = state.input.charCodeAt(_position);
1679
+ if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
1680
+ _position += 3;
1681
+ ch = state.input.charCodeAt(_position);
1682
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
1683
+ return true;
1684
+ }
1685
+ }
1686
+ return false;
1687
+ }
1688
+ function writeFoldedLines(state, count) {
1689
+ if (count === 1) {
1690
+ state.result += " ";
1691
+ } else if (count > 1) {
1692
+ state.result += common.repeat("\n", count - 1);
1693
+ }
1694
+ }
1695
+ function readPlainScalar(state, nodeIndent, withinFlowCollection) {
1696
+ var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
1697
+ ch = state.input.charCodeAt(state.position);
1698
+ if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
1699
+ return false;
1700
+ }
1701
+ if (ch === 63 || ch === 45) {
1702
+ following = state.input.charCodeAt(state.position + 1);
1703
+ if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
1704
+ return false;
1705
+ }
1706
+ }
1707
+ state.kind = "scalar";
1708
+ state.result = "";
1709
+ captureStart = captureEnd = state.position;
1710
+ hasPendingContent = false;
1711
+ while (ch !== 0) {
1712
+ if (ch === 58) {
1713
+ following = state.input.charCodeAt(state.position + 1);
1714
+ if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
1715
+ break;
1716
+ }
1717
+ } else if (ch === 35) {
1718
+ preceding = state.input.charCodeAt(state.position - 1);
1719
+ if (is_WS_OR_EOL(preceding)) {
1720
+ break;
1721
+ }
1722
+ } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
1723
+ break;
1724
+ } else if (is_EOL(ch)) {
1725
+ _line = state.line;
1726
+ _lineStart = state.lineStart;
1727
+ _lineIndent = state.lineIndent;
1728
+ skipSeparationSpace(state, false, -1);
1729
+ if (state.lineIndent >= nodeIndent) {
1730
+ hasPendingContent = true;
1731
+ ch = state.input.charCodeAt(state.position);
1732
+ continue;
1733
+ } else {
1734
+ state.position = captureEnd;
1735
+ state.line = _line;
1736
+ state.lineStart = _lineStart;
1737
+ state.lineIndent = _lineIndent;
1738
+ break;
1739
+ }
1740
+ }
1741
+ if (hasPendingContent) {
1742
+ captureSegment(state, captureStart, captureEnd, false);
1743
+ writeFoldedLines(state, state.line - _line);
1744
+ captureStart = captureEnd = state.position;
1745
+ hasPendingContent = false;
1746
+ }
1747
+ if (!is_WHITE_SPACE(ch)) {
1748
+ captureEnd = state.position + 1;
1749
+ }
1750
+ ch = state.input.charCodeAt(++state.position);
1751
+ }
1752
+ captureSegment(state, captureStart, captureEnd, false);
1753
+ if (state.result) {
1754
+ return true;
1755
+ }
1756
+ state.kind = _kind;
1757
+ state.result = _result;
1758
+ return false;
1759
+ }
1760
+ function readSingleQuotedScalar(state, nodeIndent) {
1761
+ var ch, captureStart, captureEnd;
1762
+ ch = state.input.charCodeAt(state.position);
1763
+ if (ch !== 39) {
1764
+ return false;
1765
+ }
1766
+ state.kind = "scalar";
1767
+ state.result = "";
1768
+ state.position++;
1769
+ captureStart = captureEnd = state.position;
1770
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
1771
+ if (ch === 39) {
1772
+ captureSegment(state, captureStart, state.position, true);
1773
+ ch = state.input.charCodeAt(++state.position);
1774
+ if (ch === 39) {
1775
+ captureStart = state.position;
1776
+ state.position++;
1777
+ captureEnd = state.position;
1778
+ } else {
1779
+ return true;
1780
+ }
1781
+ } else if (is_EOL(ch)) {
1782
+ captureSegment(state, captureStart, captureEnd, true);
1783
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
1784
+ captureStart = captureEnd = state.position;
1785
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
1786
+ throwError(state, "unexpected end of the document within a single quoted scalar");
1787
+ } else {
1788
+ state.position++;
1789
+ captureEnd = state.position;
1790
+ }
1791
+ }
1792
+ throwError(state, "unexpected end of the stream within a single quoted scalar");
1793
+ }
1794
+ function readDoubleQuotedScalar(state, nodeIndent) {
1795
+ var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
1796
+ ch = state.input.charCodeAt(state.position);
1797
+ if (ch !== 34) {
1798
+ return false;
1799
+ }
1800
+ state.kind = "scalar";
1801
+ state.result = "";
1802
+ state.position++;
1803
+ captureStart = captureEnd = state.position;
1804
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
1805
+ if (ch === 34) {
1806
+ captureSegment(state, captureStart, state.position, true);
1807
+ state.position++;
1808
+ return true;
1809
+ } else if (ch === 92) {
1810
+ captureSegment(state, captureStart, state.position, true);
1811
+ ch = state.input.charCodeAt(++state.position);
1812
+ if (is_EOL(ch)) {
1813
+ skipSeparationSpace(state, false, nodeIndent);
1814
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
1815
+ state.result += simpleEscapeMap[ch];
1816
+ state.position++;
1817
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
1818
+ hexLength = tmp;
1819
+ hexResult = 0;
1820
+ for (; hexLength > 0; hexLength--) {
1821
+ ch = state.input.charCodeAt(++state.position);
1822
+ if ((tmp = fromHexCode(ch)) >= 0) {
1823
+ hexResult = (hexResult << 4) + tmp;
1824
+ } else {
1825
+ throwError(state, "expected hexadecimal character");
1826
+ }
1827
+ }
1828
+ state.result += charFromCodepoint(hexResult);
1829
+ state.position++;
1830
+ } else {
1831
+ throwError(state, "unknown escape sequence");
1832
+ }
1833
+ captureStart = captureEnd = state.position;
1834
+ } else if (is_EOL(ch)) {
1835
+ captureSegment(state, captureStart, captureEnd, true);
1836
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
1837
+ captureStart = captureEnd = state.position;
1838
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
1839
+ throwError(state, "unexpected end of the document within a double quoted scalar");
1840
+ } else {
1841
+ state.position++;
1842
+ captureEnd = state.position;
1843
+ }
1844
+ }
1845
+ throwError(state, "unexpected end of the stream within a double quoted scalar");
1846
+ }
1847
+ function readFlowCollection(state, nodeIndent) {
1848
+ var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch;
1849
+ ch = state.input.charCodeAt(state.position);
1850
+ if (ch === 91) {
1851
+ terminator = 93;
1852
+ isMapping = false;
1853
+ _result = [];
1854
+ } else if (ch === 123) {
1855
+ terminator = 125;
1856
+ isMapping = true;
1857
+ _result = {};
1858
+ } else {
1859
+ return false;
1860
+ }
1861
+ if (state.anchor !== null) {
1862
+ state.anchorMap[state.anchor] = _result;
1863
+ }
1864
+ ch = state.input.charCodeAt(++state.position);
1865
+ while (ch !== 0) {
1866
+ skipSeparationSpace(state, true, nodeIndent);
1867
+ ch = state.input.charCodeAt(state.position);
1868
+ if (ch === terminator) {
1869
+ state.position++;
1870
+ state.tag = _tag;
1871
+ state.anchor = _anchor;
1872
+ state.kind = isMapping ? "mapping" : "sequence";
1873
+ state.result = _result;
1874
+ return true;
1875
+ } else if (!readNext) {
1876
+ throwError(state, "missed comma between flow collection entries");
1877
+ }
1878
+ keyTag = keyNode = valueNode = null;
1879
+ isPair = isExplicitPair = false;
1880
+ if (ch === 63) {
1881
+ following = state.input.charCodeAt(state.position + 1);
1882
+ if (is_WS_OR_EOL(following)) {
1883
+ isPair = isExplicitPair = true;
1884
+ state.position++;
1885
+ skipSeparationSpace(state, true, nodeIndent);
1886
+ }
1887
+ }
1888
+ _line = state.line;
1889
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
1890
+ keyTag = state.tag;
1891
+ keyNode = state.result;
1892
+ skipSeparationSpace(state, true, nodeIndent);
1893
+ ch = state.input.charCodeAt(state.position);
1894
+ if ((isExplicitPair || state.line === _line) && ch === 58) {
1895
+ isPair = true;
1896
+ ch = state.input.charCodeAt(++state.position);
1897
+ skipSeparationSpace(state, true, nodeIndent);
1898
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
1899
+ valueNode = state.result;
1900
+ }
1901
+ if (isMapping) {
1902
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
1903
+ } else if (isPair) {
1904
+ _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
1905
+ } else {
1906
+ _result.push(keyNode);
1907
+ }
1908
+ skipSeparationSpace(state, true, nodeIndent);
1909
+ ch = state.input.charCodeAt(state.position);
1910
+ if (ch === 44) {
1911
+ readNext = true;
1912
+ ch = state.input.charCodeAt(++state.position);
1913
+ } else {
1914
+ readNext = false;
1915
+ }
1916
+ }
1917
+ throwError(state, "unexpected end of the stream within a flow collection");
1918
+ }
1919
+ function readBlockScalar(state, nodeIndent) {
1920
+ var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
1921
+ ch = state.input.charCodeAt(state.position);
1922
+ if (ch === 124) {
1923
+ folding = false;
1924
+ } else if (ch === 62) {
1925
+ folding = true;
1926
+ } else {
1927
+ return false;
1928
+ }
1929
+ state.kind = "scalar";
1930
+ state.result = "";
1931
+ while (ch !== 0) {
1932
+ ch = state.input.charCodeAt(++state.position);
1933
+ if (ch === 43 || ch === 45) {
1934
+ if (CHOMPING_CLIP === chomping) {
1935
+ chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
1936
+ } else {
1937
+ throwError(state, "repeat of a chomping mode identifier");
1938
+ }
1939
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
1940
+ if (tmp === 0) {
1941
+ throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
1942
+ } else if (!detectedIndent) {
1943
+ textIndent = nodeIndent + tmp - 1;
1944
+ detectedIndent = true;
1945
+ } else {
1946
+ throwError(state, "repeat of an indentation width identifier");
1947
+ }
1948
+ } else {
1949
+ break;
1950
+ }
1951
+ }
1952
+ if (is_WHITE_SPACE(ch)) {
1953
+ do {
1954
+ ch = state.input.charCodeAt(++state.position);
1955
+ } while (is_WHITE_SPACE(ch));
1956
+ if (ch === 35) {
1957
+ do {
1958
+ ch = state.input.charCodeAt(++state.position);
1959
+ } while (!is_EOL(ch) && ch !== 0);
1960
+ }
1961
+ }
1962
+ while (ch !== 0) {
1963
+ readLineBreak(state);
1964
+ state.lineIndent = 0;
1965
+ ch = state.input.charCodeAt(state.position);
1966
+ while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
1967
+ state.lineIndent++;
1968
+ ch = state.input.charCodeAt(++state.position);
1969
+ }
1970
+ if (!detectedIndent && state.lineIndent > textIndent) {
1971
+ textIndent = state.lineIndent;
1972
+ }
1973
+ if (is_EOL(ch)) {
1974
+ emptyLines++;
1975
+ continue;
1976
+ }
1977
+ if (state.lineIndent < textIndent) {
1978
+ if (chomping === CHOMPING_KEEP) {
1979
+ state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
1980
+ } else if (chomping === CHOMPING_CLIP) {
1981
+ if (didReadContent) {
1982
+ state.result += "\n";
1983
+ }
1984
+ }
1985
+ break;
1986
+ }
1987
+ if (folding) {
1988
+ if (is_WHITE_SPACE(ch)) {
1989
+ atMoreIndented = true;
1990
+ state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
1991
+ } else if (atMoreIndented) {
1992
+ atMoreIndented = false;
1993
+ state.result += common.repeat("\n", emptyLines + 1);
1994
+ } else if (emptyLines === 0) {
1995
+ if (didReadContent) {
1996
+ state.result += " ";
1997
+ }
1998
+ } else {
1999
+ state.result += common.repeat("\n", emptyLines);
2000
+ }
2001
+ } else {
2002
+ state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
2003
+ }
2004
+ didReadContent = true;
2005
+ detectedIndent = true;
2006
+ emptyLines = 0;
2007
+ captureStart = state.position;
2008
+ while (!is_EOL(ch) && ch !== 0) {
2009
+ ch = state.input.charCodeAt(++state.position);
2010
+ }
2011
+ captureSegment(state, captureStart, state.position, false);
2012
+ }
2013
+ return true;
2014
+ }
2015
+ function readBlockSequence(state, nodeIndent) {
2016
+ var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
2017
+ if (state.anchor !== null) {
2018
+ state.anchorMap[state.anchor] = _result;
2019
+ }
2020
+ ch = state.input.charCodeAt(state.position);
2021
+ while (ch !== 0) {
2022
+ if (ch !== 45) {
2023
+ break;
2024
+ }
2025
+ following = state.input.charCodeAt(state.position + 1);
2026
+ if (!is_WS_OR_EOL(following)) {
2027
+ break;
2028
+ }
2029
+ detected = true;
2030
+ state.position++;
2031
+ if (skipSeparationSpace(state, true, -1)) {
2032
+ if (state.lineIndent <= nodeIndent) {
2033
+ _result.push(null);
2034
+ ch = state.input.charCodeAt(state.position);
2035
+ continue;
2036
+ }
2037
+ }
2038
+ _line = state.line;
2039
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
2040
+ _result.push(state.result);
2041
+ skipSeparationSpace(state, true, -1);
2042
+ ch = state.input.charCodeAt(state.position);
2043
+ if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
2044
+ throwError(state, "bad indentation of a sequence entry");
2045
+ } else if (state.lineIndent < nodeIndent) {
2046
+ break;
2047
+ }
2048
+ }
2049
+ if (detected) {
2050
+ state.tag = _tag;
2051
+ state.anchor = _anchor;
2052
+ state.kind = "sequence";
2053
+ state.result = _result;
2054
+ return true;
2055
+ }
2056
+ return false;
2057
+ }
2058
+ function readBlockMapping(state, nodeIndent, flowIndent) {
2059
+ var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
2060
+ if (state.anchor !== null) {
2061
+ state.anchorMap[state.anchor] = _result;
2062
+ }
2063
+ ch = state.input.charCodeAt(state.position);
2064
+ while (ch !== 0) {
2065
+ following = state.input.charCodeAt(state.position + 1);
2066
+ _line = state.line;
2067
+ _pos = state.position;
2068
+ if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
2069
+ if (ch === 63) {
2070
+ if (atExplicitKey) {
2071
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
2072
+ keyTag = keyNode = valueNode = null;
2073
+ }
2074
+ detected = true;
2075
+ atExplicitKey = true;
2076
+ allowCompact = true;
2077
+ } else if (atExplicitKey) {
2078
+ atExplicitKey = false;
2079
+ allowCompact = true;
2080
+ } else {
2081
+ throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
2082
+ }
2083
+ state.position += 1;
2084
+ ch = following;
2085
+ } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
2086
+ if (state.line === _line) {
2087
+ ch = state.input.charCodeAt(state.position);
2088
+ while (is_WHITE_SPACE(ch)) {
2089
+ ch = state.input.charCodeAt(++state.position);
2090
+ }
2091
+ if (ch === 58) {
2092
+ ch = state.input.charCodeAt(++state.position);
2093
+ if (!is_WS_OR_EOL(ch)) {
2094
+ throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
2095
+ }
2096
+ if (atExplicitKey) {
2097
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
2098
+ keyTag = keyNode = valueNode = null;
2099
+ }
2100
+ detected = true;
2101
+ atExplicitKey = false;
2102
+ allowCompact = false;
2103
+ keyTag = state.tag;
2104
+ keyNode = state.result;
2105
+ } else if (detected) {
2106
+ throwError(state, "can not read an implicit mapping pair; a colon is missed");
2107
+ } else {
2108
+ state.tag = _tag;
2109
+ state.anchor = _anchor;
2110
+ return true;
2111
+ }
2112
+ } else if (detected) {
2113
+ throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
2114
+ } else {
2115
+ state.tag = _tag;
2116
+ state.anchor = _anchor;
2117
+ return true;
2118
+ }
2119
+ } else {
2120
+ break;
2121
+ }
2122
+ if (state.line === _line || state.lineIndent > nodeIndent) {
2123
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
2124
+ if (atExplicitKey) {
2125
+ keyNode = state.result;
2126
+ } else {
2127
+ valueNode = state.result;
2128
+ }
2129
+ }
2130
+ if (!atExplicitKey) {
2131
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
2132
+ keyTag = keyNode = valueNode = null;
2133
+ }
2134
+ skipSeparationSpace(state, true, -1);
2135
+ ch = state.input.charCodeAt(state.position);
2136
+ }
2137
+ if (state.lineIndent > nodeIndent && ch !== 0) {
2138
+ throwError(state, "bad indentation of a mapping entry");
2139
+ } else if (state.lineIndent < nodeIndent) {
2140
+ break;
2141
+ }
2142
+ }
2143
+ if (atExplicitKey) {
2144
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
2145
+ }
2146
+ if (detected) {
2147
+ state.tag = _tag;
2148
+ state.anchor = _anchor;
2149
+ state.kind = "mapping";
2150
+ state.result = _result;
2151
+ }
2152
+ return detected;
2153
+ }
2154
+ function readTagProperty(state) {
2155
+ var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
2156
+ ch = state.input.charCodeAt(state.position);
2157
+ if (ch !== 33) return false;
2158
+ if (state.tag !== null) {
2159
+ throwError(state, "duplication of a tag property");
2160
+ }
2161
+ ch = state.input.charCodeAt(++state.position);
2162
+ if (ch === 60) {
2163
+ isVerbatim = true;
2164
+ ch = state.input.charCodeAt(++state.position);
2165
+ } else if (ch === 33) {
2166
+ isNamed = true;
2167
+ tagHandle = "!!";
2168
+ ch = state.input.charCodeAt(++state.position);
2169
+ } else {
2170
+ tagHandle = "!";
2171
+ }
2172
+ _position = state.position;
2173
+ if (isVerbatim) {
2174
+ do {
2175
+ ch = state.input.charCodeAt(++state.position);
2176
+ } while (ch !== 0 && ch !== 62);
2177
+ if (state.position < state.length) {
2178
+ tagName = state.input.slice(_position, state.position);
2179
+ ch = state.input.charCodeAt(++state.position);
2180
+ } else {
2181
+ throwError(state, "unexpected end of the stream within a verbatim tag");
2182
+ }
2183
+ } else {
2184
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
2185
+ if (ch === 33) {
2186
+ if (!isNamed) {
2187
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
2188
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
2189
+ throwError(state, "named tag handle cannot contain such characters");
2190
+ }
2191
+ isNamed = true;
2192
+ _position = state.position + 1;
2193
+ } else {
2194
+ throwError(state, "tag suffix cannot contain exclamation marks");
2195
+ }
2196
+ }
2197
+ ch = state.input.charCodeAt(++state.position);
2198
+ }
2199
+ tagName = state.input.slice(_position, state.position);
2200
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
2201
+ throwError(state, "tag suffix cannot contain flow indicator characters");
2202
+ }
2203
+ }
2204
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
2205
+ throwError(state, "tag name cannot contain such characters: " + tagName);
2206
+ }
2207
+ if (isVerbatim) {
2208
+ state.tag = tagName;
2209
+ } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
2210
+ state.tag = state.tagMap[tagHandle] + tagName;
2211
+ } else if (tagHandle === "!") {
2212
+ state.tag = "!" + tagName;
2213
+ } else if (tagHandle === "!!") {
2214
+ state.tag = "tag:yaml.org,2002:" + tagName;
2215
+ } else {
2216
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
2217
+ }
2218
+ return true;
2219
+ }
2220
+ function readAnchorProperty(state) {
2221
+ var _position, ch;
2222
+ ch = state.input.charCodeAt(state.position);
2223
+ if (ch !== 38) return false;
2224
+ if (state.anchor !== null) {
2225
+ throwError(state, "duplication of an anchor property");
2226
+ }
2227
+ ch = state.input.charCodeAt(++state.position);
2228
+ _position = state.position;
2229
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
2230
+ ch = state.input.charCodeAt(++state.position);
2231
+ }
2232
+ if (state.position === _position) {
2233
+ throwError(state, "name of an anchor node must contain at least one character");
2234
+ }
2235
+ state.anchor = state.input.slice(_position, state.position);
2236
+ return true;
2237
+ }
2238
+ function readAlias(state) {
2239
+ var _position, alias, ch;
2240
+ ch = state.input.charCodeAt(state.position);
2241
+ if (ch !== 42) return false;
2242
+ ch = state.input.charCodeAt(++state.position);
2243
+ _position = state.position;
2244
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
2245
+ ch = state.input.charCodeAt(++state.position);
2246
+ }
2247
+ if (state.position === _position) {
2248
+ throwError(state, "name of an alias node must contain at least one character");
2249
+ }
2250
+ alias = state.input.slice(_position, state.position);
2251
+ if (!_hasOwnProperty.call(state.anchorMap, alias)) {
2252
+ throwError(state, 'unidentified alias "' + alias + '"');
2253
+ }
2254
+ state.result = state.anchorMap[alias];
2255
+ skipSeparationSpace(state, true, -1);
2256
+ return true;
2257
+ }
2258
+ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
2259
+ var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type, flowIndent, blockIndent;
2260
+ if (state.listener !== null) {
2261
+ state.listener("open", state);
2262
+ }
2263
+ state.tag = null;
2264
+ state.anchor = null;
2265
+ state.kind = null;
2266
+ state.result = null;
2267
+ allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
2268
+ if (allowToSeek) {
2269
+ if (skipSeparationSpace(state, true, -1)) {
2270
+ atNewLine = true;
2271
+ if (state.lineIndent > parentIndent) {
2272
+ indentStatus = 1;
2273
+ } else if (state.lineIndent === parentIndent) {
2274
+ indentStatus = 0;
2275
+ } else if (state.lineIndent < parentIndent) {
2276
+ indentStatus = -1;
2277
+ }
2278
+ }
2279
+ }
2280
+ if (indentStatus === 1) {
2281
+ while (readTagProperty(state) || readAnchorProperty(state)) {
2282
+ if (skipSeparationSpace(state, true, -1)) {
2283
+ atNewLine = true;
2284
+ allowBlockCollections = allowBlockStyles;
2285
+ if (state.lineIndent > parentIndent) {
2286
+ indentStatus = 1;
2287
+ } else if (state.lineIndent === parentIndent) {
2288
+ indentStatus = 0;
2289
+ } else if (state.lineIndent < parentIndent) {
2290
+ indentStatus = -1;
2291
+ }
2292
+ } else {
2293
+ allowBlockCollections = false;
2294
+ }
2295
+ }
2296
+ }
2297
+ if (allowBlockCollections) {
2298
+ allowBlockCollections = atNewLine || allowCompact;
2299
+ }
2300
+ if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
2301
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
2302
+ flowIndent = parentIndent;
2303
+ } else {
2304
+ flowIndent = parentIndent + 1;
2305
+ }
2306
+ blockIndent = state.position - state.lineStart;
2307
+ if (indentStatus === 1) {
2308
+ if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
2309
+ hasContent = true;
2310
+ } else {
2311
+ if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
2312
+ hasContent = true;
2313
+ } else if (readAlias(state)) {
2314
+ hasContent = true;
2315
+ if (state.tag !== null || state.anchor !== null) {
2316
+ throwError(state, "alias node should not have any properties");
2317
+ }
2318
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
2319
+ hasContent = true;
2320
+ if (state.tag === null) {
2321
+ state.tag = "?";
2322
+ }
2323
+ }
2324
+ if (state.anchor !== null) {
2325
+ state.anchorMap[state.anchor] = state.result;
2326
+ }
2327
+ }
2328
+ } else if (indentStatus === 0) {
2329
+ hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
2330
+ }
2331
+ }
2332
+ if (state.tag !== null && state.tag !== "!") {
2333
+ if (state.tag === "?") {
2334
+ if (state.result !== null && state.kind !== "scalar") {
2335
+ throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
2336
+ }
2337
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
2338
+ type = state.implicitTypes[typeIndex];
2339
+ if (type.resolve(state.result)) {
2340
+ state.result = type.construct(state.result);
2341
+ state.tag = type.tag;
2342
+ if (state.anchor !== null) {
2343
+ state.anchorMap[state.anchor] = state.result;
2344
+ }
2345
+ break;
2346
+ }
2347
+ }
2348
+ } else if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
2349
+ type = state.typeMap[state.kind || "fallback"][state.tag];
2350
+ if (state.result !== null && type.kind !== state.kind) {
2351
+ throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
2352
+ }
2353
+ if (!type.resolve(state.result)) {
2354
+ throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
2355
+ } else {
2356
+ state.result = type.construct(state.result);
2357
+ if (state.anchor !== null) {
2358
+ state.anchorMap[state.anchor] = state.result;
2359
+ }
2360
+ }
2361
+ } else {
2362
+ throwError(state, "unknown tag !<" + state.tag + ">");
2363
+ }
2364
+ }
2365
+ if (state.listener !== null) {
2366
+ state.listener("close", state);
2367
+ }
2368
+ return state.tag !== null || state.anchor !== null || hasContent;
2369
+ }
2370
+ function readDocument(state) {
2371
+ var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
2372
+ state.version = null;
2373
+ state.checkLineBreaks = state.legacy;
2374
+ state.tagMap = {};
2375
+ state.anchorMap = {};
2376
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
2377
+ skipSeparationSpace(state, true, -1);
2378
+ ch = state.input.charCodeAt(state.position);
2379
+ if (state.lineIndent > 0 || ch !== 37) {
2380
+ break;
2381
+ }
2382
+ hasDirectives = true;
2383
+ ch = state.input.charCodeAt(++state.position);
2384
+ _position = state.position;
2385
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
2386
+ ch = state.input.charCodeAt(++state.position);
2387
+ }
2388
+ directiveName = state.input.slice(_position, state.position);
2389
+ directiveArgs = [];
2390
+ if (directiveName.length < 1) {
2391
+ throwError(state, "directive name must not be less than one character in length");
2392
+ }
2393
+ while (ch !== 0) {
2394
+ while (is_WHITE_SPACE(ch)) {
2395
+ ch = state.input.charCodeAt(++state.position);
2396
+ }
2397
+ if (ch === 35) {
2398
+ do {
2399
+ ch = state.input.charCodeAt(++state.position);
2400
+ } while (ch !== 0 && !is_EOL(ch));
2401
+ break;
2402
+ }
2403
+ if (is_EOL(ch)) break;
2404
+ _position = state.position;
2405
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
2406
+ ch = state.input.charCodeAt(++state.position);
2407
+ }
2408
+ directiveArgs.push(state.input.slice(_position, state.position));
2409
+ }
2410
+ if (ch !== 0) readLineBreak(state);
2411
+ if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
2412
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
2413
+ } else {
2414
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
2415
+ }
2416
+ }
2417
+ skipSeparationSpace(state, true, -1);
2418
+ if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
2419
+ state.position += 3;
2420
+ skipSeparationSpace(state, true, -1);
2421
+ } else if (hasDirectives) {
2422
+ throwError(state, "directives end mark is expected");
2423
+ }
2424
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
2425
+ skipSeparationSpace(state, true, -1);
2426
+ if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
2427
+ throwWarning(state, "non-ASCII line breaks are interpreted as content");
2428
+ }
2429
+ state.documents.push(state.result);
2430
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
2431
+ if (state.input.charCodeAt(state.position) === 46) {
2432
+ state.position += 3;
2433
+ skipSeparationSpace(state, true, -1);
2434
+ }
2435
+ return;
2436
+ }
2437
+ if (state.position < state.length - 1) {
2438
+ throwError(state, "end of the stream or a document separator is expected");
2439
+ } else {
2440
+ return;
2441
+ }
2442
+ }
2443
+ function loadDocuments(input, options2) {
2444
+ input = String(input);
2445
+ options2 = options2 || {};
2446
+ if (input.length !== 0) {
2447
+ if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
2448
+ input += "\n";
2449
+ }
2450
+ if (input.charCodeAt(0) === 65279) {
2451
+ input = input.slice(1);
2452
+ }
2453
+ }
2454
+ var state = new State(input, options2);
2455
+ var nullpos = input.indexOf("\0");
2456
+ if (nullpos !== -1) {
2457
+ state.position = nullpos;
2458
+ throwError(state, "null byte is not allowed in input");
2459
+ }
2460
+ state.input += "\0";
2461
+ while (state.input.charCodeAt(state.position) === 32) {
2462
+ state.lineIndent += 1;
2463
+ state.position += 1;
2464
+ }
2465
+ while (state.position < state.length - 1) {
2466
+ readDocument(state);
2467
+ }
2468
+ return state.documents;
2469
+ }
2470
+ function loadAll(input, iterator, options2) {
2471
+ if (iterator !== null && typeof iterator === "object" && typeof options2 === "undefined") {
2472
+ options2 = iterator;
2473
+ iterator = null;
2474
+ }
2475
+ var documents = loadDocuments(input, options2);
2476
+ if (typeof iterator !== "function") {
2477
+ return documents;
2478
+ }
2479
+ for (var index = 0, length = documents.length; index < length; index += 1) {
2480
+ iterator(documents[index]);
2481
+ }
2482
+ }
2483
+ function load(input, options2) {
2484
+ var documents = loadDocuments(input, options2);
2485
+ if (documents.length === 0) {
2486
+ return void 0;
2487
+ } else if (documents.length === 1) {
2488
+ return documents[0];
2489
+ }
2490
+ throw new YAMLException("expected a single document in the stream, but found more");
2491
+ }
2492
+ function safeLoadAll(input, iterator, options2) {
2493
+ if (typeof iterator === "object" && iterator !== null && typeof options2 === "undefined") {
2494
+ options2 = iterator;
2495
+ iterator = null;
2496
+ }
2497
+ return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
2498
+ }
2499
+ function safeLoad(input, options2) {
2500
+ return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
2501
+ }
2502
+ module2.exports.loadAll = loadAll;
2503
+ module2.exports.load = load;
2504
+ module2.exports.safeLoadAll = safeLoadAll;
2505
+ module2.exports.safeLoad = safeLoad;
2506
+ }
2507
+ });
2508
+
2509
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/dumper.js
2510
+ var require_dumper = __commonJS({
2511
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/dumper.js"(exports2, module2) {
2512
+ var common = require_common();
2513
+ var YAMLException = require_exception();
2514
+ var DEFAULT_FULL_SCHEMA = require_default_full();
2515
+ var DEFAULT_SAFE_SCHEMA = require_default_safe();
2516
+ var _toString = Object.prototype.toString;
2517
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
2518
+ var CHAR_TAB = 9;
2519
+ var CHAR_LINE_FEED = 10;
2520
+ var CHAR_CARRIAGE_RETURN = 13;
2521
+ var CHAR_SPACE = 32;
2522
+ var CHAR_EXCLAMATION = 33;
2523
+ var CHAR_DOUBLE_QUOTE = 34;
2524
+ var CHAR_SHARP = 35;
2525
+ var CHAR_PERCENT = 37;
2526
+ var CHAR_AMPERSAND = 38;
2527
+ var CHAR_SINGLE_QUOTE = 39;
2528
+ var CHAR_ASTERISK = 42;
2529
+ var CHAR_COMMA = 44;
2530
+ var CHAR_MINUS = 45;
2531
+ var CHAR_COLON = 58;
2532
+ var CHAR_EQUALS = 61;
2533
+ var CHAR_GREATER_THAN = 62;
2534
+ var CHAR_QUESTION = 63;
2535
+ var CHAR_COMMERCIAL_AT = 64;
2536
+ var CHAR_LEFT_SQUARE_BRACKET = 91;
2537
+ var CHAR_RIGHT_SQUARE_BRACKET = 93;
2538
+ var CHAR_GRAVE_ACCENT = 96;
2539
+ var CHAR_LEFT_CURLY_BRACKET = 123;
2540
+ var CHAR_VERTICAL_LINE = 124;
2541
+ var CHAR_RIGHT_CURLY_BRACKET = 125;
2542
+ var ESCAPE_SEQUENCES = {};
2543
+ ESCAPE_SEQUENCES[0] = "\\0";
2544
+ ESCAPE_SEQUENCES[7] = "\\a";
2545
+ ESCAPE_SEQUENCES[8] = "\\b";
2546
+ ESCAPE_SEQUENCES[9] = "\\t";
2547
+ ESCAPE_SEQUENCES[10] = "\\n";
2548
+ ESCAPE_SEQUENCES[11] = "\\v";
2549
+ ESCAPE_SEQUENCES[12] = "\\f";
2550
+ ESCAPE_SEQUENCES[13] = "\\r";
2551
+ ESCAPE_SEQUENCES[27] = "\\e";
2552
+ ESCAPE_SEQUENCES[34] = '\\"';
2553
+ ESCAPE_SEQUENCES[92] = "\\\\";
2554
+ ESCAPE_SEQUENCES[133] = "\\N";
2555
+ ESCAPE_SEQUENCES[160] = "\\_";
2556
+ ESCAPE_SEQUENCES[8232] = "\\L";
2557
+ ESCAPE_SEQUENCES[8233] = "\\P";
2558
+ var DEPRECATED_BOOLEANS_SYNTAX = [
2559
+ "y",
2560
+ "Y",
2561
+ "yes",
2562
+ "Yes",
2563
+ "YES",
2564
+ "on",
2565
+ "On",
2566
+ "ON",
2567
+ "n",
2568
+ "N",
2569
+ "no",
2570
+ "No",
2571
+ "NO",
2572
+ "off",
2573
+ "Off",
2574
+ "OFF"
2575
+ ];
2576
+ function compileStyleMap(schema, map) {
2577
+ var result, keys, index, length, tag, style, type;
2578
+ if (map === null) return {};
2579
+ result = {};
2580
+ keys = Object.keys(map);
2581
+ for (index = 0, length = keys.length; index < length; index += 1) {
2582
+ tag = keys[index];
2583
+ style = String(map[tag]);
2584
+ if (tag.slice(0, 2) === "!!") {
2585
+ tag = "tag:yaml.org,2002:" + tag.slice(2);
2586
+ }
2587
+ type = schema.compiledTypeMap["fallback"][tag];
2588
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) {
2589
+ style = type.styleAliases[style];
2590
+ }
2591
+ result[tag] = style;
2592
+ }
2593
+ return result;
2594
+ }
2595
+ function encodeHex(character) {
2596
+ var string, handle, length;
2597
+ string = character.toString(16).toUpperCase();
2598
+ if (character <= 255) {
2599
+ handle = "x";
2600
+ length = 2;
2601
+ } else if (character <= 65535) {
2602
+ handle = "u";
2603
+ length = 4;
2604
+ } else if (character <= 4294967295) {
2605
+ handle = "U";
2606
+ length = 8;
2607
+ } else {
2608
+ throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF");
2609
+ }
2610
+ return "\\" + handle + common.repeat("0", length - string.length) + string;
2611
+ }
2612
+ function State(options2) {
2613
+ this.schema = options2["schema"] || DEFAULT_FULL_SCHEMA;
2614
+ this.indent = Math.max(1, options2["indent"] || 2);
2615
+ this.noArrayIndent = options2["noArrayIndent"] || false;
2616
+ this.skipInvalid = options2["skipInvalid"] || false;
2617
+ this.flowLevel = common.isNothing(options2["flowLevel"]) ? -1 : options2["flowLevel"];
2618
+ this.styleMap = compileStyleMap(this.schema, options2["styles"] || null);
2619
+ this.sortKeys = options2["sortKeys"] || false;
2620
+ this.lineWidth = options2["lineWidth"] || 80;
2621
+ this.noRefs = options2["noRefs"] || false;
2622
+ this.noCompatMode = options2["noCompatMode"] || false;
2623
+ this.condenseFlow = options2["condenseFlow"] || false;
2624
+ this.implicitTypes = this.schema.compiledImplicit;
2625
+ this.explicitTypes = this.schema.compiledExplicit;
2626
+ this.tag = null;
2627
+ this.result = "";
2628
+ this.duplicates = [];
2629
+ this.usedDuplicates = null;
2630
+ }
2631
+ function indentString(string, spaces) {
2632
+ var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
2633
+ while (position < length) {
2634
+ next = string.indexOf("\n", position);
2635
+ if (next === -1) {
2636
+ line = string.slice(position);
2637
+ position = length;
2638
+ } else {
2639
+ line = string.slice(position, next + 1);
2640
+ position = next + 1;
2641
+ }
2642
+ if (line.length && line !== "\n") result += ind;
2643
+ result += line;
2644
+ }
2645
+ return result;
2646
+ }
2647
+ function generateNextLine(state, level) {
2648
+ return "\n" + common.repeat(" ", state.indent * level);
2649
+ }
2650
+ function testImplicitResolving(state, str2) {
2651
+ var index, length, type;
2652
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
2653
+ type = state.implicitTypes[index];
2654
+ if (type.resolve(str2)) {
2655
+ return true;
2656
+ }
2657
+ }
2658
+ return false;
2659
+ }
2660
+ function isWhitespace(c) {
2661
+ return c === CHAR_SPACE || c === CHAR_TAB;
2662
+ }
2663
+ function isPrintable(c) {
2664
+ return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== 65279 || 65536 <= c && c <= 1114111;
2665
+ }
2666
+ function isNsChar(c) {
2667
+ return isPrintable(c) && !isWhitespace(c) && c !== 65279 && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
2668
+ }
2669
+ function isPlainSafe(c, prev) {
2670
+ return isPrintable(c) && c !== 65279 && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_COLON && (c !== CHAR_SHARP || prev && isNsChar(prev));
2671
+ }
2672
+ function isPlainSafeFirst(c) {
2673
+ return isPrintable(c) && c !== 65279 && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
2674
+ }
2675
+ function needIndentIndicator(string) {
2676
+ var leadingSpaceRe = /^\n* /;
2677
+ return leadingSpaceRe.test(string);
2678
+ }
2679
+ var STYLE_PLAIN = 1;
2680
+ var STYLE_SINGLE = 2;
2681
+ var STYLE_LITERAL = 3;
2682
+ var STYLE_FOLDED = 4;
2683
+ var STYLE_DOUBLE = 5;
2684
+ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
2685
+ var i;
2686
+ var char, prev_char;
2687
+ var hasLineBreak = false;
2688
+ var hasFoldableLine = false;
2689
+ var shouldTrackWidth = lineWidth !== -1;
2690
+ var previousLineBreak = -1;
2691
+ var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1));
2692
+ if (singleLineOnly) {
2693
+ for (i = 0; i < string.length; i++) {
2694
+ char = string.charCodeAt(i);
2695
+ if (!isPrintable(char)) {
2696
+ return STYLE_DOUBLE;
2697
+ }
2698
+ prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
2699
+ plain = plain && isPlainSafe(char, prev_char);
2700
+ }
2701
+ } else {
2702
+ for (i = 0; i < string.length; i++) {
2703
+ char = string.charCodeAt(i);
2704
+ if (char === CHAR_LINE_FEED) {
2705
+ hasLineBreak = true;
2706
+ if (shouldTrackWidth) {
2707
+ hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
2708
+ i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
2709
+ previousLineBreak = i;
2710
+ }
2711
+ } else if (!isPrintable(char)) {
2712
+ return STYLE_DOUBLE;
2713
+ }
2714
+ prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
2715
+ plain = plain && isPlainSafe(char, prev_char);
2716
+ }
2717
+ hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
2718
+ }
2719
+ if (!hasLineBreak && !hasFoldableLine) {
2720
+ return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE;
2721
+ }
2722
+ if (indentPerLevel > 9 && needIndentIndicator(string)) {
2723
+ return STYLE_DOUBLE;
2724
+ }
2725
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
2726
+ }
2727
+ function writeScalar(state, string, level, iskey) {
2728
+ state.dump = (function() {
2729
+ if (string.length === 0) {
2730
+ return "''";
2731
+ }
2732
+ if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
2733
+ return "'" + string + "'";
2734
+ }
2735
+ var indent = state.indent * Math.max(1, level);
2736
+ var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
2737
+ var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
2738
+ function testAmbiguity(string2) {
2739
+ return testImplicitResolving(state, string2);
2740
+ }
2741
+ switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
2742
+ case STYLE_PLAIN:
2743
+ return string;
2744
+ case STYLE_SINGLE:
2745
+ return "'" + string.replace(/'/g, "''") + "'";
2746
+ case STYLE_LITERAL:
2747
+ return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
2748
+ case STYLE_FOLDED:
2749
+ return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
2750
+ case STYLE_DOUBLE:
2751
+ return '"' + escapeString(string) + '"';
2752
+ default:
2753
+ throw new YAMLException("impossible error: invalid scalar style");
2754
+ }
2755
+ })();
2756
+ }
2757
+ function blockHeader(string, indentPerLevel) {
2758
+ var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
2759
+ var clip = string[string.length - 1] === "\n";
2760
+ var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
2761
+ var chomp = keep ? "+" : clip ? "" : "-";
2762
+ return indentIndicator + chomp + "\n";
2763
+ }
2764
+ function dropEndingNewline(string) {
2765
+ return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
2766
+ }
2767
+ function foldString(string, width) {
2768
+ var lineRe = /(\n+)([^\n]*)/g;
2769
+ var result = (function() {
2770
+ var nextLF = string.indexOf("\n");
2771
+ nextLF = nextLF !== -1 ? nextLF : string.length;
2772
+ lineRe.lastIndex = nextLF;
2773
+ return foldLine(string.slice(0, nextLF), width);
2774
+ })();
2775
+ var prevMoreIndented = string[0] === "\n" || string[0] === " ";
2776
+ var moreIndented;
2777
+ var match;
2778
+ while (match = lineRe.exec(string)) {
2779
+ var prefix = match[1], line = match[2];
2780
+ moreIndented = line[0] === " ";
2781
+ result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
2782
+ prevMoreIndented = moreIndented;
2783
+ }
2784
+ return result;
2785
+ }
2786
+ function foldLine(line, width) {
2787
+ if (line === "" || line[0] === " ") return line;
2788
+ var breakRe = / [^ ]/g;
2789
+ var match;
2790
+ var start = 0, end, curr = 0, next = 0;
2791
+ var result = "";
2792
+ while (match = breakRe.exec(line)) {
2793
+ next = match.index;
2794
+ if (next - start > width) {
2795
+ end = curr > start ? curr : next;
2796
+ result += "\n" + line.slice(start, end);
2797
+ start = end + 1;
2798
+ }
2799
+ curr = next;
2800
+ }
2801
+ result += "\n";
2802
+ if (line.length - start > width && curr > start) {
2803
+ result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
2804
+ } else {
2805
+ result += line.slice(start);
2806
+ }
2807
+ return result.slice(1);
2808
+ }
2809
+ function escapeString(string) {
2810
+ var result = "";
2811
+ var char, nextChar;
2812
+ var escapeSeq;
2813
+ for (var i = 0; i < string.length; i++) {
2814
+ char = string.charCodeAt(i);
2815
+ if (char >= 55296 && char <= 56319) {
2816
+ nextChar = string.charCodeAt(i + 1);
2817
+ if (nextChar >= 56320 && nextChar <= 57343) {
2818
+ result += encodeHex((char - 55296) * 1024 + nextChar - 56320 + 65536);
2819
+ i++;
2820
+ continue;
2821
+ }
2822
+ }
2823
+ escapeSeq = ESCAPE_SEQUENCES[char];
2824
+ result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char);
2825
+ }
2826
+ return result;
2827
+ }
2828
+ function writeFlowSequence(state, level, object) {
2829
+ var _result = "", _tag = state.tag, index, length;
2830
+ for (index = 0, length = object.length; index < length; index += 1) {
2831
+ if (writeNode(state, level, object[index], false, false)) {
2832
+ if (index !== 0) _result += "," + (!state.condenseFlow ? " " : "");
2833
+ _result += state.dump;
2834
+ }
2835
+ }
2836
+ state.tag = _tag;
2837
+ state.dump = "[" + _result + "]";
2838
+ }
2839
+ function writeBlockSequence(state, level, object, compact) {
2840
+ var _result = "", _tag = state.tag, index, length;
2841
+ for (index = 0, length = object.length; index < length; index += 1) {
2842
+ if (writeNode(state, level + 1, object[index], true, true)) {
2843
+ if (!compact || index !== 0) {
2844
+ _result += generateNextLine(state, level);
2845
+ }
2846
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
2847
+ _result += "-";
2848
+ } else {
2849
+ _result += "- ";
2850
+ }
2851
+ _result += state.dump;
2852
+ }
2853
+ }
2854
+ state.tag = _tag;
2855
+ state.dump = _result || "[]";
2856
+ }
2857
+ function writeFlowMapping(state, level, object) {
2858
+ var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
2859
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
2860
+ pairBuffer = "";
2861
+ if (index !== 0) pairBuffer += ", ";
2862
+ if (state.condenseFlow) pairBuffer += '"';
2863
+ objectKey = objectKeyList[index];
2864
+ objectValue = object[objectKey];
2865
+ if (!writeNode(state, level, objectKey, false, false)) {
2866
+ continue;
2867
+ }
2868
+ if (state.dump.length > 1024) pairBuffer += "? ";
2869
+ pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
2870
+ if (!writeNode(state, level, objectValue, false, false)) {
2871
+ continue;
2872
+ }
2873
+ pairBuffer += state.dump;
2874
+ _result += pairBuffer;
2875
+ }
2876
+ state.tag = _tag;
2877
+ state.dump = "{" + _result + "}";
2878
+ }
2879
+ function writeBlockMapping(state, level, object, compact) {
2880
+ var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
2881
+ if (state.sortKeys === true) {
2882
+ objectKeyList.sort();
2883
+ } else if (typeof state.sortKeys === "function") {
2884
+ objectKeyList.sort(state.sortKeys);
2885
+ } else if (state.sortKeys) {
2886
+ throw new YAMLException("sortKeys must be a boolean or a function");
2887
+ }
2888
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
2889
+ pairBuffer = "";
2890
+ if (!compact || index !== 0) {
2891
+ pairBuffer += generateNextLine(state, level);
2892
+ }
2893
+ objectKey = objectKeyList[index];
2894
+ objectValue = object[objectKey];
2895
+ if (!writeNode(state, level + 1, objectKey, true, true, true)) {
2896
+ continue;
2897
+ }
2898
+ explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
2899
+ if (explicitPair) {
2900
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
2901
+ pairBuffer += "?";
2902
+ } else {
2903
+ pairBuffer += "? ";
2904
+ }
2905
+ }
2906
+ pairBuffer += state.dump;
2907
+ if (explicitPair) {
2908
+ pairBuffer += generateNextLine(state, level);
2909
+ }
2910
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
2911
+ continue;
2912
+ }
2913
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
2914
+ pairBuffer += ":";
2915
+ } else {
2916
+ pairBuffer += ": ";
2917
+ }
2918
+ pairBuffer += state.dump;
2919
+ _result += pairBuffer;
2920
+ }
2921
+ state.tag = _tag;
2922
+ state.dump = _result || "{}";
2923
+ }
2924
+ function detectType(state, object, explicit) {
2925
+ var _result, typeList, index, length, type, style;
2926
+ typeList = explicit ? state.explicitTypes : state.implicitTypes;
2927
+ for (index = 0, length = typeList.length; index < length; index += 1) {
2928
+ type = typeList[index];
2929
+ if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
2930
+ state.tag = explicit ? type.tag : "?";
2931
+ if (type.represent) {
2932
+ style = state.styleMap[type.tag] || type.defaultStyle;
2933
+ if (_toString.call(type.represent) === "[object Function]") {
2934
+ _result = type.represent(object, style);
2935
+ } else if (_hasOwnProperty.call(type.represent, style)) {
2936
+ _result = type.represent[style](object, style);
2937
+ } else {
2938
+ throw new YAMLException("!<" + type.tag + '> tag resolver accepts not "' + style + '" style');
2939
+ }
2940
+ state.dump = _result;
2941
+ }
2942
+ return true;
2943
+ }
2944
+ }
2945
+ return false;
2946
+ }
2947
+ function writeNode(state, level, object, block, compact, iskey) {
2948
+ state.tag = null;
2949
+ state.dump = object;
2950
+ if (!detectType(state, object, false)) {
2951
+ detectType(state, object, true);
2952
+ }
2953
+ var type = _toString.call(state.dump);
2954
+ if (block) {
2955
+ block = state.flowLevel < 0 || state.flowLevel > level;
2956
+ }
2957
+ var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate;
2958
+ if (objectOrArray) {
2959
+ duplicateIndex = state.duplicates.indexOf(object);
2960
+ duplicate = duplicateIndex !== -1;
2961
+ }
2962
+ if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
2963
+ compact = false;
2964
+ }
2965
+ if (duplicate && state.usedDuplicates[duplicateIndex]) {
2966
+ state.dump = "*ref_" + duplicateIndex;
2967
+ } else {
2968
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
2969
+ state.usedDuplicates[duplicateIndex] = true;
2970
+ }
2971
+ if (type === "[object Object]") {
2972
+ if (block && Object.keys(state.dump).length !== 0) {
2973
+ writeBlockMapping(state, level, state.dump, compact);
2974
+ if (duplicate) {
2975
+ state.dump = "&ref_" + duplicateIndex + state.dump;
2976
+ }
2977
+ } else {
2978
+ writeFlowMapping(state, level, state.dump);
2979
+ if (duplicate) {
2980
+ state.dump = "&ref_" + duplicateIndex + " " + state.dump;
2981
+ }
2982
+ }
2983
+ } else if (type === "[object Array]") {
2984
+ var arrayLevel = state.noArrayIndent && level > 0 ? level - 1 : level;
2985
+ if (block && state.dump.length !== 0) {
2986
+ writeBlockSequence(state, arrayLevel, state.dump, compact);
2987
+ if (duplicate) {
2988
+ state.dump = "&ref_" + duplicateIndex + state.dump;
2989
+ }
2990
+ } else {
2991
+ writeFlowSequence(state, arrayLevel, state.dump);
2992
+ if (duplicate) {
2993
+ state.dump = "&ref_" + duplicateIndex + " " + state.dump;
2994
+ }
2995
+ }
2996
+ } else if (type === "[object String]") {
2997
+ if (state.tag !== "?") {
2998
+ writeScalar(state, state.dump, level, iskey);
2999
+ }
3000
+ } else {
3001
+ if (state.skipInvalid) return false;
3002
+ throw new YAMLException("unacceptable kind of an object to dump " + type);
3003
+ }
3004
+ if (state.tag !== null && state.tag !== "?") {
3005
+ state.dump = "!<" + state.tag + "> " + state.dump;
3006
+ }
3007
+ }
3008
+ return true;
3009
+ }
3010
+ function getDuplicateReferences(object, state) {
3011
+ var objects = [], duplicatesIndexes = [], index, length;
3012
+ inspectNode(object, objects, duplicatesIndexes);
3013
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
3014
+ state.duplicates.push(objects[duplicatesIndexes[index]]);
3015
+ }
3016
+ state.usedDuplicates = new Array(length);
3017
+ }
3018
+ function inspectNode(object, objects, duplicatesIndexes) {
3019
+ var objectKeyList, index, length;
3020
+ if (object !== null && typeof object === "object") {
3021
+ index = objects.indexOf(object);
3022
+ if (index !== -1) {
3023
+ if (duplicatesIndexes.indexOf(index) === -1) {
3024
+ duplicatesIndexes.push(index);
3025
+ }
3026
+ } else {
3027
+ objects.push(object);
3028
+ if (Array.isArray(object)) {
3029
+ for (index = 0, length = object.length; index < length; index += 1) {
3030
+ inspectNode(object[index], objects, duplicatesIndexes);
3031
+ }
3032
+ } else {
3033
+ objectKeyList = Object.keys(object);
3034
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
3035
+ inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
3036
+ }
3037
+ }
3038
+ }
3039
+ }
3040
+ }
3041
+ function dump(input, options2) {
3042
+ options2 = options2 || {};
3043
+ var state = new State(options2);
3044
+ if (!state.noRefs) getDuplicateReferences(input, state);
3045
+ if (writeNode(state, 0, input, true, true)) return state.dump + "\n";
3046
+ return "";
3047
+ }
3048
+ function safeDump(input, options2) {
3049
+ return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
3050
+ }
3051
+ module2.exports.dump = dump;
3052
+ module2.exports.safeDump = safeDump;
3053
+ }
3054
+ });
3055
+
3056
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml.js
3057
+ var require_js_yaml = __commonJS({
3058
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml.js"(exports2, module2) {
3059
+ var loader = require_loader();
3060
+ var dumper = require_dumper();
3061
+ function deprecated(name) {
3062
+ return function() {
3063
+ throw new Error("Function " + name + " is deprecated and cannot be used.");
3064
+ };
3065
+ }
3066
+ module2.exports.Type = require_type();
3067
+ module2.exports.Schema = require_schema();
3068
+ module2.exports.FAILSAFE_SCHEMA = require_failsafe();
3069
+ module2.exports.JSON_SCHEMA = require_json();
3070
+ module2.exports.CORE_SCHEMA = require_core();
3071
+ module2.exports.DEFAULT_SAFE_SCHEMA = require_default_safe();
3072
+ module2.exports.DEFAULT_FULL_SCHEMA = require_default_full();
3073
+ module2.exports.load = loader.load;
3074
+ module2.exports.loadAll = loader.loadAll;
3075
+ module2.exports.safeLoad = loader.safeLoad;
3076
+ module2.exports.safeLoadAll = loader.safeLoadAll;
3077
+ module2.exports.dump = dumper.dump;
3078
+ module2.exports.safeDump = dumper.safeDump;
3079
+ module2.exports.YAMLException = require_exception();
3080
+ module2.exports.MINIMAL_SCHEMA = require_failsafe();
3081
+ module2.exports.SAFE_SCHEMA = require_default_safe();
3082
+ module2.exports.DEFAULT_SCHEMA = require_default_full();
3083
+ module2.exports.scan = deprecated("scan");
3084
+ module2.exports.parse = deprecated("parse");
3085
+ module2.exports.compose = deprecated("compose");
3086
+ module2.exports.addConstructor = deprecated("addConstructor");
3087
+ }
3088
+ });
3089
+
3090
+ // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/index.js
3091
+ var require_js_yaml2 = __commonJS({
3092
+ "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/index.js"(exports2, module2) {
3093
+ var yaml2 = require_js_yaml();
3094
+ module2.exports = yaml2;
3095
+ }
3096
+ });
3097
+
3098
+ // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engines.js
3099
+ var require_engines = __commonJS({
3100
+ "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engines.js"(exports$1, module) {
3101
+ var yaml = require_js_yaml2();
3102
+ var engines = module.exports;
3103
+ engines.yaml = {
3104
+ parse: yaml.safeLoad.bind(yaml),
3105
+ stringify: yaml.safeDump.bind(yaml)
3106
+ };
3107
+ engines.json = {
3108
+ parse: JSON.parse.bind(JSON),
3109
+ stringify: function(obj, options2) {
3110
+ const opts = Object.assign({ replacer: null, space: 2 }, options2);
3111
+ return JSON.stringify(obj, opts.replacer, opts.space);
3112
+ }
3113
+ };
3114
+ engines.javascript = {
3115
+ parse: function parse(str, options, wrap) {
3116
+ try {
3117
+ if (wrap !== false) {
3118
+ str = "(function() {\nreturn " + str.trim() + ";\n}());";
3119
+ }
3120
+ return eval(str) || {};
3121
+ } catch (err) {
3122
+ if (wrap !== false && /(unexpected|identifier)/i.test(err.message)) {
3123
+ return parse(str, options, false);
3124
+ }
3125
+ throw new SyntaxError(err);
3126
+ }
3127
+ },
3128
+ stringify: function() {
3129
+ throw new Error("stringifying JavaScript is not supported");
3130
+ }
3131
+ };
3132
+ }
3133
+ });
3134
+
3135
+ // ../../node_modules/.pnpm/strip-bom-string@1.0.0/node_modules/strip-bom-string/index.js
3136
+ var require_strip_bom_string = __commonJS({
3137
+ "../../node_modules/.pnpm/strip-bom-string@1.0.0/node_modules/strip-bom-string/index.js"(exports2, module2) {
3138
+ module2.exports = function(str2) {
3139
+ if (typeof str2 === "string" && str2.charAt(0) === "\uFEFF") {
3140
+ return str2.slice(1);
3141
+ }
3142
+ return str2;
3143
+ };
3144
+ }
3145
+ });
3146
+
3147
+ // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/utils.js
3148
+ var require_utils = __commonJS({
3149
+ "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/utils.js"(exports2) {
3150
+ var stripBom = require_strip_bom_string();
3151
+ var typeOf = require_kind_of();
3152
+ exports2.define = function(obj, key, val) {
3153
+ Reflect.defineProperty(obj, key, {
3154
+ enumerable: false,
3155
+ configurable: true,
3156
+ writable: true,
3157
+ value: val
3158
+ });
3159
+ };
3160
+ exports2.isBuffer = function(val) {
3161
+ return typeOf(val) === "buffer";
3162
+ };
3163
+ exports2.isObject = function(val) {
3164
+ return typeOf(val) === "object";
3165
+ };
3166
+ exports2.toBuffer = function(input) {
3167
+ return typeof input === "string" ? Buffer.from(input) : input;
3168
+ };
3169
+ exports2.toString = function(input) {
3170
+ if (exports2.isBuffer(input)) return stripBom(String(input));
3171
+ if (typeof input !== "string") {
3172
+ throw new TypeError("expected input to be a string or buffer");
3173
+ }
3174
+ return stripBom(input);
3175
+ };
3176
+ exports2.arrayify = function(val) {
3177
+ return val ? Array.isArray(val) ? val : [val] : [];
3178
+ };
3179
+ exports2.startsWith = function(str2, substr, len) {
3180
+ if (typeof len !== "number") len = substr.length;
3181
+ return str2.slice(0, len) === substr;
3182
+ };
3183
+ }
3184
+ });
3185
+
3186
+ // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.js
3187
+ var require_defaults = __commonJS({
3188
+ "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.js"(exports2, module2) {
3189
+ var engines2 = require_engines();
3190
+ var utils = require_utils();
3191
+ module2.exports = function(options2) {
3192
+ const opts = Object.assign({}, options2);
3193
+ opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || "---");
3194
+ if (opts.delimiters.length === 1) {
3195
+ opts.delimiters.push(opts.delimiters[0]);
3196
+ }
3197
+ opts.language = (opts.language || opts.lang || "yaml").toLowerCase();
3198
+ opts.engines = Object.assign({}, engines2, opts.parsers, opts.engines);
3199
+ return opts;
3200
+ };
3201
+ }
3202
+ });
3203
+
3204
+ // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engine.js
3205
+ var require_engine = __commonJS({
3206
+ "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engine.js"(exports2, module2) {
3207
+ module2.exports = function(name, options2) {
3208
+ let engine = options2.engines[name] || options2.engines[aliase(name)];
3209
+ if (typeof engine === "undefined") {
3210
+ throw new Error('gray-matter engine "' + name + '" is not registered');
3211
+ }
3212
+ if (typeof engine === "function") {
3213
+ engine = { parse: engine };
3214
+ }
3215
+ return engine;
3216
+ };
3217
+ function aliase(name) {
3218
+ switch (name.toLowerCase()) {
3219
+ case "js":
3220
+ case "javascript":
3221
+ return "javascript";
3222
+ case "coffee":
3223
+ case "coffeescript":
3224
+ case "cson":
3225
+ return "coffee";
3226
+ case "yaml":
3227
+ case "yml":
3228
+ return "yaml";
3229
+ default: {
3230
+ return name;
3231
+ }
3232
+ }
3233
+ }
3234
+ }
3235
+ });
3236
+
3237
+ // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.js
3238
+ var require_stringify = __commonJS({
3239
+ "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.js"(exports2, module2) {
3240
+ var typeOf = require_kind_of();
3241
+ var getEngine = require_engine();
3242
+ var defaults = require_defaults();
3243
+ module2.exports = function(file, data, options2) {
3244
+ if (data == null && options2 == null) {
3245
+ switch (typeOf(file)) {
3246
+ case "object":
3247
+ data = file.data;
3248
+ options2 = {};
3249
+ break;
3250
+ case "string":
3251
+ return file;
3252
+ default: {
3253
+ throw new TypeError("expected file to be a string or object");
3254
+ }
3255
+ }
3256
+ }
3257
+ const str2 = file.content;
3258
+ const opts = defaults(options2);
3259
+ if (data == null) {
3260
+ if (!opts.data) return file;
3261
+ data = opts.data;
3262
+ }
3263
+ const language = file.language || opts.language;
3264
+ const engine = getEngine(language, opts);
3265
+ if (typeof engine.stringify !== "function") {
3266
+ throw new TypeError('expected "' + language + '.stringify" to be a function');
3267
+ }
3268
+ data = Object.assign({}, file.data, data);
3269
+ const open = opts.delimiters[0];
3270
+ const close = opts.delimiters[1];
3271
+ const matter2 = engine.stringify(data, options2).trim();
3272
+ let buf = "";
3273
+ if (matter2 !== "{}") {
3274
+ buf = newline(open) + newline(matter2) + newline(close);
3275
+ }
3276
+ if (typeof file.excerpt === "string" && file.excerpt !== "") {
3277
+ if (str2.indexOf(file.excerpt.trim()) === -1) {
3278
+ buf += newline(file.excerpt) + newline(close);
3279
+ }
3280
+ }
3281
+ return buf + newline(str2);
3282
+ };
3283
+ function newline(str2) {
3284
+ return str2.slice(-1) !== "\n" ? str2 + "\n" : str2;
3285
+ }
3286
+ }
3287
+ });
3288
+
3289
+ // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/excerpt.js
3290
+ var require_excerpt = __commonJS({
3291
+ "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/excerpt.js"(exports2, module2) {
3292
+ var defaults = require_defaults();
3293
+ module2.exports = function(file, options2) {
3294
+ const opts = defaults(options2);
3295
+ if (file.data == null) {
3296
+ file.data = {};
3297
+ }
3298
+ if (typeof opts.excerpt === "function") {
3299
+ return opts.excerpt(file, opts);
3300
+ }
3301
+ const sep = file.data.excerpt_separator || opts.excerpt_separator;
3302
+ if (sep == null && (opts.excerpt === false || opts.excerpt == null)) {
3303
+ return file;
3304
+ }
3305
+ const delimiter = typeof opts.excerpt === "string" ? opts.excerpt : sep || opts.delimiters[0];
3306
+ const idx = file.content.indexOf(delimiter);
3307
+ if (idx !== -1) {
3308
+ file.excerpt = file.content.slice(0, idx);
3309
+ }
3310
+ return file;
3311
+ };
3312
+ }
3313
+ });
3314
+
3315
+ // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/to-file.js
3316
+ var require_to_file = __commonJS({
3317
+ "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/to-file.js"(exports2, module2) {
3318
+ var typeOf = require_kind_of();
3319
+ var stringify = require_stringify();
3320
+ var utils = require_utils();
3321
+ module2.exports = function(file) {
3322
+ if (typeOf(file) !== "object") {
3323
+ file = { content: file };
3324
+ }
3325
+ if (typeOf(file.data) !== "object") {
3326
+ file.data = {};
3327
+ }
3328
+ if (file.contents && file.content == null) {
3329
+ file.content = file.contents;
3330
+ }
3331
+ utils.define(file, "orig", utils.toBuffer(file.content));
3332
+ utils.define(file, "language", file.language || "");
3333
+ utils.define(file, "matter", file.matter || "");
3334
+ utils.define(file, "stringify", function(data, options2) {
3335
+ if (options2 && options2.language) {
3336
+ file.language = options2.language;
3337
+ }
3338
+ return stringify(file, data, options2);
3339
+ });
3340
+ file.content = utils.toString(file.content);
3341
+ file.isEmpty = false;
3342
+ file.excerpt = "";
3343
+ return file;
3344
+ };
3345
+ }
3346
+ });
3347
+
3348
+ // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.js
3349
+ var require_parse = __commonJS({
3350
+ "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.js"(exports2, module2) {
3351
+ var getEngine = require_engine();
3352
+ var defaults = require_defaults();
3353
+ module2.exports = function(language, str2, options2) {
3354
+ const opts = defaults(options2);
3355
+ const engine = getEngine(language, opts);
3356
+ if (typeof engine.parse !== "function") {
3357
+ throw new TypeError('expected "' + language + '.parse" to be a function');
3358
+ }
3359
+ return engine.parse(str2, opts);
3360
+ };
3361
+ }
3362
+ });
3363
+
3364
+ // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js
3365
+ var require_gray_matter = __commonJS({
3366
+ "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js"(exports2, module2) {
3367
+ var fs = __require("fs");
3368
+ var sections = require_section_matter();
3369
+ var defaults = require_defaults();
3370
+ var stringify = require_stringify();
3371
+ var excerpt = require_excerpt();
3372
+ var engines2 = require_engines();
3373
+ var toFile = require_to_file();
3374
+ var parse2 = require_parse();
3375
+ var utils = require_utils();
3376
+ function matter2(input, options2) {
3377
+ if (input === "") {
3378
+ return { data: {}, content: input, excerpt: "", orig: input };
3379
+ }
3380
+ let file = toFile(input);
3381
+ const cached = matter2.cache[file.content];
3382
+ if (!options2) {
3383
+ if (cached) {
3384
+ file = Object.assign({}, cached);
3385
+ file.orig = cached.orig;
3386
+ return file;
3387
+ }
3388
+ matter2.cache[file.content] = file;
3389
+ }
3390
+ return parseMatter(file, options2);
3391
+ }
3392
+ function parseMatter(file, options2) {
3393
+ const opts = defaults(options2);
3394
+ const open = opts.delimiters[0];
3395
+ const close = "\n" + opts.delimiters[1];
3396
+ let str2 = file.content;
3397
+ if (opts.language) {
3398
+ file.language = opts.language;
3399
+ }
3400
+ const openLen = open.length;
3401
+ if (!utils.startsWith(str2, open, openLen)) {
3402
+ excerpt(file, opts);
3403
+ return file;
3404
+ }
3405
+ if (str2.charAt(openLen) === open.slice(-1)) {
3406
+ return file;
3407
+ }
3408
+ str2 = str2.slice(openLen);
3409
+ const len = str2.length;
3410
+ const language = matter2.language(str2, opts);
3411
+ if (language.name) {
3412
+ file.language = language.name;
3413
+ str2 = str2.slice(language.raw.length);
3414
+ }
3415
+ let closeIndex = str2.indexOf(close);
3416
+ if (closeIndex === -1) {
3417
+ closeIndex = len;
3418
+ }
3419
+ file.matter = str2.slice(0, closeIndex);
3420
+ const block = file.matter.replace(/^\s*#[^\n]+/gm, "").trim();
3421
+ if (block === "") {
3422
+ file.isEmpty = true;
3423
+ file.empty = file.content;
3424
+ file.data = {};
3425
+ } else {
3426
+ file.data = parse2(file.language, file.matter, opts);
3427
+ }
3428
+ if (closeIndex === len) {
3429
+ file.content = "";
3430
+ } else {
3431
+ file.content = str2.slice(closeIndex + close.length);
3432
+ if (file.content[0] === "\r") {
3433
+ file.content = file.content.slice(1);
3434
+ }
3435
+ if (file.content[0] === "\n") {
3436
+ file.content = file.content.slice(1);
3437
+ }
3438
+ }
3439
+ excerpt(file, opts);
3440
+ if (opts.sections === true || typeof opts.section === "function") {
3441
+ sections(file, opts.section);
3442
+ }
3443
+ return file;
3444
+ }
3445
+ matter2.engines = engines2;
3446
+ matter2.stringify = function(file, data, options2) {
3447
+ if (typeof file === "string") file = matter2(file, options2);
3448
+ return stringify(file, data, options2);
3449
+ };
3450
+ matter2.read = function(filepath, options2) {
3451
+ const str2 = fs.readFileSync(filepath, "utf8");
3452
+ const file = matter2(str2, options2);
3453
+ file.path = filepath;
3454
+ return file;
3455
+ };
3456
+ matter2.test = function(str2, options2) {
3457
+ return utils.startsWith(str2, defaults(options2).delimiters[0]);
3458
+ };
3459
+ matter2.language = function(str2, options2) {
3460
+ const opts = defaults(options2);
3461
+ const open = opts.delimiters[0];
3462
+ if (matter2.test(str2)) {
3463
+ str2 = str2.slice(open.length);
3464
+ }
3465
+ const language = str2.slice(0, str2.search(/\r?\n/));
3466
+ return {
3467
+ raw: language,
3468
+ name: language ? language.trim() : ""
3469
+ };
3470
+ };
3471
+ matter2.cache = {};
3472
+ matter2.clearCache = function() {
3473
+ matter2.cache = {};
3474
+ };
3475
+ module2.exports = matter2;
3476
+ }
3477
+ });
3478
+ function Breadcrumbs(props) {
3479
+ return /* @__PURE__ */ jsx(Show, { when: props.items.length > 0, children: /* @__PURE__ */ jsx("nav", { class: "flex items-center gap-1.5 text-sm", "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsx(For, { each: props.items, children: (item, idx) => /* @__PURE__ */ jsxs(Fragment, { children: [
3480
+ /* @__PURE__ */ jsx(Show, { when: idx() > 0, children: /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", class: "h-3.5 w-3.5 shrink-0 text-white/20", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M6 4l4 4-4 4", stroke: "currentColor", "stroke-width": "1.5" }) }) }),
3481
+ /* @__PURE__ */ jsx(Show, { when: idx() === props.items.length - 1, fallback: /* @__PURE__ */ jsx("a", { href: item.href, class: "truncate text-white/40 transition-colors hover:text-white/70", children: item.title }), children: /* @__PURE__ */ jsx("span", { class: "truncate text-white/60", children: item.title }) })
3482
+ ] }) }) }) });
3483
+ }
3484
+
3485
+ // ../shared/dist/index.js
3486
+ __toESM(require_gray_matter());
3487
+ function toTocLevel(level) {
3488
+ if (level === 2 || level === 3 || level === 4) {
3489
+ return level;
3490
+ }
3491
+ return 4;
3492
+ }
3493
+ function extractToc(mdxContent) {
3494
+ const headingRegex = /^(#{2,4})\s+(.+)$/gm;
3495
+ const items = [];
3496
+ let match = headingRegex.exec(mdxContent);
3497
+ while (match !== null) {
3498
+ const text = match[2].trim();
3499
+ items.push({
3500
+ id: slugify(text),
3501
+ text,
3502
+ level: toTocLevel(match[1].length),
3503
+ children: []
3504
+ });
3505
+ match = headingRegex.exec(mdxContent);
3506
+ }
3507
+ const nested = [];
3508
+ let currentH2 = null;
3509
+ let currentH3 = null;
3510
+ for (const item of items) {
3511
+ if (item.level === 2) {
3512
+ currentH2 = item;
3513
+ currentH3 = null;
3514
+ nested.push(item);
3515
+ continue;
3516
+ }
3517
+ if (item.level === 3) {
3518
+ currentH3 = item;
3519
+ if (currentH2) {
3520
+ currentH2.children.push(item);
3521
+ } else {
3522
+ nested.push(item);
3523
+ }
3524
+ continue;
3525
+ }
3526
+ if (currentH3) {
3527
+ currentH3.children.push(item);
3528
+ } else if (currentH2) {
3529
+ currentH2.children.push(item);
3530
+ } else {
3531
+ nested.push(item);
3532
+ }
3533
+ }
3534
+ return nested;
3535
+ }
3536
+ function buildBreadcrumbs(sections, sectionId, slug) {
3537
+ const crumbs = [{ title: "Docs", href: "/docs" }];
3538
+ const sectionMap = new Map(sections.map((section) => [section.id, section]));
3539
+ const trail = [];
3540
+ let current = sectionMap.get(sectionId);
3541
+ while (current) {
3542
+ trail.unshift(current);
3543
+ current = current.parentId ? sectionMap.get(current.parentId) : void 0;
3544
+ }
3545
+ for (const section of trail) {
3546
+ crumbs.push({ title: section.title, href: `/docs/${section.slug}` });
3547
+ }
3548
+ if (slug) {
3549
+ const parentSlug = trail[trail.length - 1]?.slug ?? "";
3550
+ crumbs.push({ title: slug, href: `/docs/${parentSlug}/${slug}` });
3551
+ }
3552
+ return crumbs;
3553
+ }
3554
+ function buildDocsIndex(pages, sections) {
3555
+ const sectionMap = new Map(sections.map((section) => [section.id, section]));
3556
+ return pages.filter((page) => page.status === "published").map((page) => {
3557
+ const section = sectionMap.get(page.sectionId);
3558
+ return {
3559
+ pageId: page.id,
3560
+ pageTitle: page.title,
3561
+ sectionTitle: section?.title ?? "",
3562
+ sectionSlug: section?.slug ?? "",
3563
+ slug: page.slug,
3564
+ highlight: page.excerpt ?? page.content.slice(0, 160),
3565
+ score: 0,
3566
+ tags: page.tags
3567
+ };
3568
+ });
3569
+ }
3570
+ function searchDocs(query, index) {
3571
+ if (!query.trim()) {
3572
+ return [];
3573
+ }
3574
+ const terms = query.toLowerCase().split(/\s+/).filter(Boolean);
3575
+ return index.map((entry) => {
3576
+ let score = 0;
3577
+ const titleLower = entry.pageTitle.toLowerCase();
3578
+ const highlightLower = entry.highlight.toLowerCase();
3579
+ const sectionLower = entry.sectionTitle.toLowerCase();
3580
+ const tagsLower = entry.tags.map((tag) => tag.toLowerCase());
3581
+ for (const term of terms) {
3582
+ if (titleLower.includes(term)) {
3583
+ score += 10;
3584
+ }
3585
+ if (tagsLower.some((tag) => tag.includes(term))) {
3586
+ score += 5;
3587
+ }
3588
+ if (sectionLower.includes(term)) {
3589
+ score += 3;
3590
+ }
3591
+ if (highlightLower.includes(term)) {
3592
+ score += 2;
3593
+ }
3594
+ }
3595
+ return { ...entry, score };
3596
+ }).filter((entry) => entry.score > 0).sort((left, right) => right.score - left.score).slice(0, 20);
3597
+ }
3598
+ function slugify(title) {
3599
+ return title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
3600
+ }
3601
+ function highlightMatch(text, query, maxLen = 160) {
3602
+ if (!query.trim()) {
3603
+ return text.slice(0, maxLen);
3604
+ }
3605
+ const lowerText = text.toLowerCase();
3606
+ const lowerQuery = query.toLowerCase();
3607
+ const index = lowerText.indexOf(lowerQuery);
3608
+ if (index === -1) {
3609
+ return text.slice(0, maxLen);
3610
+ }
3611
+ const start = Math.max(0, index - 40);
3612
+ const end = Math.min(text.length, index + query.length + (maxLen - 80));
3613
+ let snippet = text.slice(start, end);
3614
+ if (start > 0) {
3615
+ snippet = `\u2026${snippet}`;
3616
+ }
3617
+ if (end < text.length) {
3618
+ snippet = `${snippet}\u2026`;
3619
+ }
3620
+ return snippet;
3621
+ }
3622
+ var defaultDocsConfig = {
3623
+ siteName: "Docs",
3624
+ cmdKEnabled: true,
3625
+ showReadingTime: true,
3626
+ showLastEdited: true,
3627
+ versionsEnabled: false,
3628
+ defaultAccess: "public",
3629
+ printModeEnabled: true
3630
+ };
3631
+ function getNodeText(children2) {
3632
+ if (Array.isArray(children2)) {
3633
+ return children2.map((entry) => getNodeText(entry)).join(" ");
3634
+ }
3635
+ if (typeof children2 === "string" || typeof children2 === "number") {
3636
+ return String(children2);
3637
+ }
3638
+ return "";
3639
+ }
3640
+ function createHeading(Tag, className) {
3641
+ return (props) => {
3642
+ const text = getNodeText(props.children);
3643
+ const id = slugify(text);
3644
+ return /* @__PURE__ */ jsx(Tag, { id, class: className, children: /* @__PURE__ */ jsx("a", { href: `#${id}`, class: "transition-colors hover:text-indigo-300", children: props.children }) });
3645
+ };
3646
+ }
3647
+ function DocPage(props) {
3648
+ return /* @__PURE__ */ jsx("article", { class: "prose-custom max-w-none", children: /* @__PURE__ */ jsx(
3649
+ SolidMarkdown,
3650
+ {
3651
+ remarkPlugins: [remarkGfm],
3652
+ components: {
3653
+ h1: createHeading("h1", "scroll-mt-20 mt-8 mb-4 text-3xl font-bold"),
3654
+ h2: createHeading(
3655
+ "h2",
3656
+ "scroll-mt-20 mt-8 mb-3 border-b border-white/10 pb-2 text-2xl font-bold"
3657
+ ),
3658
+ h3: createHeading("h3", "scroll-mt-20 mt-6 mb-2 text-xl font-semibold"),
3659
+ h4: createHeading("h4", "scroll-mt-20 mt-4 mb-2 text-lg font-medium"),
3660
+ p: (componentProps) => /* @__PURE__ */ jsx("p", { class: "my-3 leading-relaxed text-white/80", children: componentProps.children }),
3661
+ a: (componentProps) => /* @__PURE__ */ jsx(
3662
+ "a",
3663
+ {
3664
+ href: componentProps.href,
3665
+ target: componentProps.href?.startsWith("/") ? void 0 : "_blank",
3666
+ rel: componentProps.href?.startsWith("/") ? void 0 : "noreferrer noopener",
3667
+ class: "underline underline-offset-2 transition-colors hover:text-indigo-300",
3668
+ children: componentProps.children
3669
+ }
3670
+ ),
3671
+ code: (componentProps) => componentProps.class ? /* @__PURE__ */ jsx("code", { class: componentProps.class, children: componentProps.children }) : /* @__PURE__ */ jsx("code", { class: "rounded bg-white/10 px-1.5 py-0.5 text-sm text-indigo-300", children: componentProps.children }),
3672
+ pre: (componentProps) => /* @__PURE__ */ jsx("pre", { class: "my-4 overflow-x-auto rounded-lg bg-black/30 p-4 text-sm leading-relaxed", children: componentProps.children }),
3673
+ blockquote: (componentProps) => /* @__PURE__ */ jsx("blockquote", { class: "my-4 rounded-r-lg border-l-4 border-indigo-500/40 bg-white/5 py-3 pl-4 pr-4 text-white/70 italic", children: componentProps.children }),
3674
+ table: (componentProps) => /* @__PURE__ */ jsx("div", { class: "my-4 overflow-x-auto rounded-lg border border-white/10", children: /* @__PURE__ */ jsx("table", { class: "w-full text-sm", children: componentProps.children }) }),
3675
+ th: (componentProps) => /* @__PURE__ */ jsx("th", { class: "border-b border-white/10 bg-white/5 px-4 py-2.5 text-left font-semibold", children: componentProps.children }),
3676
+ td: (componentProps) => /* @__PURE__ */ jsx("td", { class: "border-b border-white/5 px-4 py-2 text-white/70 last:border-none", children: componentProps.children })
3677
+ },
3678
+ children: props.page.content
3679
+ }
3680
+ ) });
3681
+ }
3682
+ function DocSearch(props) {
3683
+ const [activeIndex, setActiveIndex] = createSignal(0);
3684
+ let inputRef;
3685
+ createEffect(() => {
3686
+ if (props.isOpen) {
3687
+ setActiveIndex(0);
3688
+ }
3689
+ });
3690
+ createEffect(() => {
3691
+ props.results;
3692
+ setActiveIndex(0);
3693
+ });
3694
+ const handleKeyDown = (e) => {
3695
+ if (e.key === "ArrowDown") {
3696
+ e.preventDefault();
3697
+ setActiveIndex((i) => Math.min(i + 1, props.results.length - 1));
3698
+ } else if (e.key === "ArrowUp") {
3699
+ e.preventDefault();
3700
+ setActiveIndex((i) => Math.max(i - 1, 0));
3701
+ } else if (e.key === "Enter" && props.results[activeIndex()]) {
3702
+ e.preventDefault();
3703
+ props.onSelect(props.results[activeIndex()]);
3704
+ } else if (e.key === "Escape") {
3705
+ e.preventDefault();
3706
+ props.onClose();
3707
+ }
3708
+ };
3709
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(Show, { when: props.isOpen, children: /* @__PURE__ */ jsxs("div", { class: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]", children: [
3710
+ /* @__PURE__ */ jsx(
3711
+ motion.button,
3712
+ {
3713
+ type: "button",
3714
+ "aria-label": "Close search",
3715
+ initial: { opacity: 0 },
3716
+ animate: { opacity: 1 },
3717
+ exit: { opacity: 0 },
3718
+ class: "fixed inset-0 bg-black/60 backdrop-blur-md",
3719
+ onClick: () => props.onClose()
3720
+ }
3721
+ ),
3722
+ /* @__PURE__ */ jsxs(
3723
+ motion.div,
3724
+ {
3725
+ initial: { opacity: 0, scale: 0.95, y: -20 },
3726
+ animate: { opacity: 1, scale: 1, y: 0 },
3727
+ exit: { opacity: 0, scale: 0.95, y: -20 },
3728
+ transition: { type: "spring", damping: 25, stiffness: 250 },
3729
+ class: "relative z-10 w-full max-w-xl overflow-hidden rounded-2xl border border-white/10 bg-zinc-900/40 backdrop-blur-3xl shadow-2xl ring-1 ring-white/5",
3730
+ onClick: (e) => e.stopPropagation(),
3731
+ children: [
3732
+ /* @__PURE__ */ jsxs("div", { class: "flex items-center gap-3 border-b border-white/10 px-5 py-4 bg-white/5", children: [
3733
+ /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", class: "h-5 w-5 shrink-0 text-white/40", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { "fill-rule": "evenodd", d: "M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z", "clip-rule": "evenodd" }) }),
3734
+ /* @__PURE__ */ jsx(
3735
+ "input",
3736
+ {
3737
+ ref: inputRef,
3738
+ type: "text",
3739
+ value: props.query,
3740
+ onInput: (e) => props.onQuery(e.currentTarget.value),
3741
+ onKeyDown: handleKeyDown,
3742
+ placeholder: "Search documentation\u2026",
3743
+ class: "flex-1 bg-transparent text-sm text-white placeholder-white/30 outline-none"
3744
+ }
3745
+ ),
3746
+ /* @__PURE__ */ jsx("kbd", { class: "rounded border border-white/10 bg-white/5 px-1.5 py-0.5 text-[11px] text-white/30 font-medium", children: "ESC" })
3747
+ ] }),
3748
+ /* @__PURE__ */ jsxs("div", { class: "max-h-80 overflow-y-auto p-2", children: [
3749
+ /* @__PURE__ */ jsxs(AnimatePresence, { children: [
3750
+ /* @__PURE__ */ jsx(Show, { when: props.results.length === 0 && props.query.trim(), children: /* @__PURE__ */ jsxs(
3751
+ motion.div,
3752
+ {
3753
+ initial: { opacity: 0 },
3754
+ animate: { opacity: 1 },
3755
+ exit: { opacity: 0 },
3756
+ class: "flex flex-col items-center py-10 text-center text-white/30",
3757
+ children: [
3758
+ /* @__PURE__ */ jsxs("svg", { "aria-hidden": "true", class: "mb-3 h-10 w-10 opacity-50", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: [
3759
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8", "stroke-width": "1.5" }),
3760
+ /* @__PURE__ */ jsx("path", { d: "M21 21l-4.35-4.35", "stroke-width": "1.5" })
3761
+ ] }),
3762
+ /* @__PURE__ */ jsxs("p", { class: "text-sm", children: [
3763
+ 'No results for "',
3764
+ props.query,
3765
+ '"'
3766
+ ] }),
3767
+ /* @__PURE__ */ jsx("p", { class: "mt-1 text-xs opacity-60", children: "Try different keywords" })
3768
+ ]
3769
+ }
3770
+ ) }),
3771
+ /* @__PURE__ */ jsx(Show, { when: props.results.length === 0 && !props.query.trim(), children: /* @__PURE__ */ jsx(
3772
+ motion.div,
3773
+ {
3774
+ initial: { opacity: 0 },
3775
+ animate: { opacity: 1 },
3776
+ exit: { opacity: 0 },
3777
+ class: "py-8 text-center text-sm text-white/30",
3778
+ children: "Start typing to search\u2026"
3779
+ }
3780
+ ) })
3781
+ ] }),
3782
+ /* @__PURE__ */ jsx(For, { each: props.results, children: (result, idx) => /* @__PURE__ */ jsxs(
3783
+ "button",
3784
+ {
3785
+ type: "button",
3786
+ onClick: () => props.onSelect(result),
3787
+ class: `group relative flex w-full flex-col gap-1 rounded-xl px-4 py-3 text-left transition-colors my-0.5 ${idx() === activeIndex() ? "bg-indigo-500/15 text-white ring-1 ring-indigo-500/30" : "text-white/70 hover:bg-white/5"}`,
3788
+ children: [
3789
+ /* @__PURE__ */ jsx(Show, { when: idx() === activeIndex(), children: /* @__PURE__ */ jsx(
3790
+ motion.div,
3791
+ {
3792
+ layoutId: "search-active-bg",
3793
+ class: "absolute inset-0 bg-indigo-500/10 rounded-xl",
3794
+ transition: { type: "spring", stiffness: 300, damping: 30 }
3795
+ }
3796
+ ) }),
3797
+ /* @__PURE__ */ jsxs("div", { class: "relative z-10 flex items-center gap-2", children: [
3798
+ /* @__PURE__ */ jsx("span", { class: "rounded bg-indigo-500/20 px-1.5 py-0.5 text-[10px] font-medium text-indigo-300", children: result.sectionTitle }),
3799
+ /* @__PURE__ */ jsx("span", { class: "text-sm font-medium", children: result.pageTitle })
3800
+ ] }),
3801
+ /* @__PURE__ */ jsx("p", { class: "relative z-10 truncate text-xs text-white/40", children: highlightMatch(result.highlight, props.query) }),
3802
+ /* @__PURE__ */ jsx(Show, { when: result.tags.length > 0, children: /* @__PURE__ */ jsx("div", { class: "relative z-10 flex gap-1 mt-1", children: /* @__PURE__ */ jsx(For, { each: result.tags.slice(0, 3), children: (tag) => /* @__PURE__ */ jsx("span", { class: "rounded bg-white/5 px-1.5 py-0.5 text-[10px] text-white/30 border border-white/5", children: tag }) }) }) })
3803
+ ]
3804
+ }
3805
+ ) })
3806
+ ] }),
3807
+ /* @__PURE__ */ jsxs("div", { class: "flex items-center gap-4 border-t border-white/10 px-5 py-2.5 text-[11px] text-white/30 bg-black/20", children: [
3808
+ /* @__PURE__ */ jsxs("span", { class: "flex items-center gap-1", children: [
3809
+ /* @__PURE__ */ jsx("kbd", { class: "rounded border border-white/10 bg-white/5 px-1 pb-0.5 text-[10px]", children: "\u2191" }),
3810
+ " ",
3811
+ /* @__PURE__ */ jsx("kbd", { class: "rounded border border-white/10 bg-white/5 px-1 pb-0.5 text-[10px]", children: "\u2193" }),
3812
+ " navigate"
3813
+ ] }),
3814
+ /* @__PURE__ */ jsxs("span", { class: "flex items-center gap-1", children: [
3815
+ /* @__PURE__ */ jsx("kbd", { class: "rounded border border-white/10 bg-white/5 px-1 pb-0.5 text-[10px]", children: "\u21B5" }),
3816
+ " select"
3817
+ ] }),
3818
+ /* @__PURE__ */ jsxs("span", { class: "flex items-center gap-1", children: [
3819
+ /* @__PURE__ */ jsx("kbd", { class: "rounded border border-white/10 bg-white/5 px-1 pb-0.5 text-[10px]", children: "esc" }),
3820
+ " close"
3821
+ ] })
3822
+ ] })
3823
+ ]
3824
+ }
3825
+ )
3826
+ ] }) }) });
3827
+ }
3828
+ function DocSidebar(props) {
3829
+ const [expandedIds, setExpandedIds] = createSignal(/* @__PURE__ */ new Set());
3830
+ const toggle = (id) => {
3831
+ setExpandedIds((prev) => {
3832
+ const next = new Set(prev);
3833
+ if (next.has(id)) next.delete(id);
3834
+ else next.add(id);
3835
+ return next;
3836
+ });
3837
+ };
3838
+ const topLevel = () => props.sections.filter((s) => !s.parentId);
3839
+ const childrenOf = (parentId) => props.sections.filter((s) => s.parentId === parentId);
3840
+ const renderSection = (section, depth) => {
3841
+ const children2 = () => childrenOf(section.id);
3842
+ const isExpanded = () => expandedIds().has(section.id);
3843
+ const pages = () => section.pages ?? [];
3844
+ const hasContent = () => children2().length > 0 || pages().length > 0;
3845
+ return /* @__PURE__ */ jsxs("div", { style: { "padding-left": `${depth * 12}px` }, class: "mb-1", children: [
3846
+ /* @__PURE__ */ jsxs(
3847
+ motion.button,
3848
+ {
3849
+ type: "button",
3850
+ onClick: () => toggle(section.id),
3851
+ class: "flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm font-medium transition-colors hover:bg-white/10",
3852
+ whileHover: { x: 2 },
3853
+ whileTap: { scale: 0.98 },
3854
+ children: [
3855
+ /* @__PURE__ */ jsx(Show, { when: section.icon, children: /* @__PURE__ */ jsx("span", { class: "text-base", children: section.icon }) }),
3856
+ /* @__PURE__ */ jsx("span", { class: "flex-1 truncate text-zinc-800 dark:text-zinc-200", children: section.title }),
3857
+ /* @__PURE__ */ jsx(Show, { when: section.pageCount != null, children: /* @__PURE__ */ jsx("span", { class: "text-xs tabular-nums opacity-50 dark:text-zinc-400", children: section.pageCount }) }),
3858
+ /* @__PURE__ */ jsx(Show, { when: hasContent(), children: /* @__PURE__ */ jsx(
3859
+ motion.svg,
3860
+ {
3861
+ animate: { rotate: isExpanded() ? 90 : 0 },
3862
+ class: "h-3.5 w-3.5 shrink-0 text-zinc-500",
3863
+ viewBox: "0 0 16 16",
3864
+ fill: "currentColor",
3865
+ children: /* @__PURE__ */ jsx("path", { d: "M6 4l4 4-4 4", stroke: "currentColor", "stroke-width": "2", fill: "none" })
3866
+ }
3867
+ ) })
3868
+ ]
3869
+ }
3870
+ ),
3871
+ /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(Show, { when: isExpanded(), children: /* @__PURE__ */ jsxs(
3872
+ motion.div,
3873
+ {
3874
+ initial: { height: 0, opacity: 0 },
3875
+ animate: { height: "auto", opacity: 1 },
3876
+ exit: { height: 0, opacity: 0 },
3877
+ transition: { duration: 0.2, ease: "easeInOut" },
3878
+ class: "ml-2 overflow-hidden border-l border-white/10 pl-2 dark:border-zinc-800",
3879
+ children: [
3880
+ /* @__PURE__ */ jsx(For, { each: pages(), children: (page) => /* @__PURE__ */ jsx(
3881
+ motion.button,
3882
+ {
3883
+ type: "button",
3884
+ onClick: () => props.onNavigate(page, section),
3885
+ whileHover: { x: 2 },
3886
+ whileTap: { scale: 0.98 },
3887
+ class: `flex w-full items-center gap-2 rounded-lg px-3 py-1.5 my-0.5 text-left text-sm transition-all outline-none ${props.currentPageId === page.id ? "bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 font-semibold ring-1 ring-indigo-500/20" : "text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-white hover:bg-zinc-100 dark:hover:bg-white/5"}`,
3888
+ children: /* @__PURE__ */ jsx("span", { class: "truncate", children: page.title })
3889
+ }
3890
+ ) }),
3891
+ /* @__PURE__ */ jsx(For, { each: children2(), children: (child) => renderSection(child, depth + 1) })
3892
+ ]
3893
+ }
3894
+ ) }) })
3895
+ ] });
3896
+ };
3897
+ return /* @__PURE__ */ jsxs("nav", { class: "flex flex-col gap-1 py-4", children: [
3898
+ /* @__PURE__ */ jsx("div", { class: "px-4 pb-3 text-xs font-bold uppercase tracking-widest text-zinc-400 dark:text-zinc-500", children: "Documentation" }),
3899
+ /* @__PURE__ */ jsx(For, { each: topLevel(), children: (s) => renderSection(s, 0) })
3900
+ ] });
3901
+ }
3902
+ function TocLink(props) {
3903
+ const depth = () => props.depth ?? 0;
3904
+ const isActive = () => props.activeId === props.item.id;
3905
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3906
+ /* @__PURE__ */ jsx(
3907
+ motion.a,
3908
+ {
3909
+ href: `#${props.item.id}`,
3910
+ class: `block truncate border-l-2 py-1 text-[13px] transition-all relative ${isActive() ? "border-indigo-500 text-indigo-400 font-medium" : "border-transparent text-white/40 hover:text-white/80 hover:border-white/20"}`,
3911
+ style: { "padding-left": `${12 + depth() * 12}px` },
3912
+ whileHover: { x: 2 },
3913
+ whileTap: { scale: 0.98 },
3914
+ layout: true,
3915
+ children: props.item.text
3916
+ }
3917
+ ),
3918
+ /* @__PURE__ */ jsx(For, { each: props.item.children, children: (child) => /* @__PURE__ */ jsx(TocLink, { item: child, activeId: props.activeId, depth: depth() + 1 }) })
3919
+ ] });
3920
+ }
3921
+ function TableOfContents(props) {
3922
+ return /* @__PURE__ */ jsxs("nav", { class: "sticky top-24", children: [
3923
+ /* @__PURE__ */ jsx("h4", { class: "mb-3 text-xs font-semibold uppercase tracking-widest text-white/40", children: "On this page" }),
3924
+ /* @__PURE__ */ jsx(motion.div, { class: "flex flex-col relative", layoutRoot: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(For, { each: props.toc, children: (item) => /* @__PURE__ */ jsx(motion.div, { initial: { opacity: 0, x: -10 }, animate: { opacity: 1, x: 0 }, children: /* @__PURE__ */ jsx(TocLink, { item, activeId: props.activeId }) }) }) }) })
3925
+ ] });
3926
+ }
3927
+ function DocsLayout(props) {
3928
+ const resolvedChildren = children(() => props.children);
3929
+ const breadcrumbs = () => props.breadcrumbs ?? [];
3930
+ const toc = () => props.toc ?? [];
3931
+ return /* @__PURE__ */ jsxs("div", { class: "flex min-h-screen bg-[#090a0f] text-white", children: [
3932
+ /* @__PURE__ */ jsx("aside", { class: "sticky top-0 hidden h-screen w-[260px] shrink-0 overflow-y-auto border-r border-white/5 bg-[#0b0c12] lg:block", children: /* @__PURE__ */ jsx(
3933
+ DocSidebar,
3934
+ {
3935
+ sections: props.sections,
3936
+ currentPageId: props.currentPageId,
3937
+ onNavigate: props.onNavigate
3938
+ }
3939
+ ) }),
3940
+ /* @__PURE__ */ jsx("main", { class: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxs("div", { class: "mx-auto flex max-w-6xl gap-8 px-6 py-8 lg:px-10", children: [
3941
+ /* @__PURE__ */ jsxs(
3942
+ motion.div,
3943
+ {
3944
+ class: "min-w-0 flex-1",
3945
+ initial: { opacity: 0, y: 10 },
3946
+ animate: { opacity: 1, y: 0 },
3947
+ transition: { type: "spring", delay: 0.1 },
3948
+ children: [
3949
+ /* @__PURE__ */ jsx(Show, { when: breadcrumbs().length > 0, children: /* @__PURE__ */ jsx("div", { class: "mb-6", children: /* @__PURE__ */ jsx(Breadcrumbs, { items: breadcrumbs() }) }) }),
3950
+ /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(Show, { when: props.currentPageId, children: /* @__PURE__ */ jsx(
3951
+ motion.div,
3952
+ {
3953
+ initial: { opacity: 0, x: -10 },
3954
+ animate: { opacity: 1, x: 0 },
3955
+ exit: { opacity: 0, x: 10 },
3956
+ transition: { type: "spring", damping: 25, stiffness: 200 },
3957
+ children: resolvedChildren()
3958
+ }
3959
+ ) }) })
3960
+ ]
3961
+ }
3962
+ ),
3963
+ /* @__PURE__ */ jsx(Show, { when: toc().length > 0, children: /* @__PURE__ */ jsx(
3964
+ motion.aside,
3965
+ {
3966
+ class: "hidden w-[220px] shrink-0 xl:block",
3967
+ initial: { opacity: 0, x: 10 },
3968
+ animate: { opacity: 1, x: 0 },
3969
+ transition: { delay: 0.2 },
3970
+ children: /* @__PURE__ */ jsx(TableOfContents, { toc: toc(), activeId: props.activeHeadingId })
3971
+ }
3972
+ ) })
3973
+ ] }) })
3974
+ ] });
3975
+ }
3976
+ function EditButton(props) {
3977
+ return /* @__PURE__ */ jsx(Show, { when: props.editUrl, children: /* @__PURE__ */ jsxs(
3978
+ "a",
3979
+ {
3980
+ href: `${props.editUrl?.replace(/\/$/, "")}/${props.pageSlug}.mdx`,
3981
+ target: "_blank",
3982
+ rel: "noopener noreferrer",
3983
+ class: "inline-flex items-center gap-1.5 rounded-lg border border-white/10 px-3 py-1.5 text-xs text-white/40 transition-colors hover:border-white/20 hover:text-white/60",
3984
+ children: [
3985
+ /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", class: "h-3.5 w-3.5", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M11.5 1.5l3 3-9 9H2.5v-3l9-9z", "stroke-width": "1.5", "stroke-linejoin": "round" }) }),
3986
+ "Edit this page"
3987
+ ]
3988
+ }
3989
+ ) });
3990
+ }
3991
+ function PageNavigation(props) {
3992
+ return /* @__PURE__ */ jsx(Show, { when: props.prev || props.next, children: /* @__PURE__ */ jsxs("div", { class: "mt-12 flex items-stretch gap-4 border-t border-white/10 pt-8", children: [
3993
+ /* @__PURE__ */ jsx(Show, { when: props.prev, fallback: /* @__PURE__ */ jsx("div", { class: "flex-1" }), children: (prev) => /* @__PURE__ */ jsxs("a", { href: prev().href, class: "group flex flex-1 flex-col rounded-xl border border-white/10 p-4 transition-all hover:border-indigo-500/40 hover:bg-white/5", children: [
3994
+ /* @__PURE__ */ jsx("span", { class: "text-xs text-white/40 group-hover:text-indigo-400 transition-colors", children: "\u2190 Previous" }),
3995
+ /* @__PURE__ */ jsx("span", { class: "mt-1 text-sm font-medium text-white/80 group-hover:text-white transition-colors truncate", children: prev().title })
3996
+ ] }) }),
3997
+ /* @__PURE__ */ jsx(Show, { when: props.next, fallback: /* @__PURE__ */ jsx("div", { class: "flex-1" }), children: (next) => /* @__PURE__ */ jsxs("a", { href: next().href, class: "group flex flex-1 flex-col items-end rounded-xl border border-white/10 p-4 text-right transition-all hover:border-indigo-500/40 hover:bg-white/5", children: [
3998
+ /* @__PURE__ */ jsx("span", { class: "text-xs text-white/40 group-hover:text-indigo-400 transition-colors", children: "Next \u2192" }),
3999
+ /* @__PURE__ */ jsx("span", { class: "mt-1 text-sm font-medium text-white/80 group-hover:text-white transition-colors truncate", children: next().title })
4000
+ ] }) })
4001
+ ] }) });
4002
+ }
4003
+ function VersionSelector(props) {
4004
+ const [isOpen, setIsOpen] = createSignal(false);
4005
+ return /* @__PURE__ */ jsx(Show, { when: props.versions.length > 1, children: /* @__PURE__ */ jsxs("div", { class: "relative", children: [
4006
+ /* @__PURE__ */ jsxs(
4007
+ "button",
4008
+ {
4009
+ type: "button",
4010
+ onClick: () => setIsOpen(!isOpen()),
4011
+ class: "flex items-center gap-1.5 rounded-lg border border-white/10 bg-white/5 px-3 py-1.5 text-xs font-medium text-white/60 transition-colors hover:border-indigo-500/30",
4012
+ children: [
4013
+ /* @__PURE__ */ jsxs("span", { children: [
4014
+ "v",
4015
+ props.current
4016
+ ] }),
4017
+ /* @__PURE__ */ jsx(
4018
+ "svg",
4019
+ {
4020
+ "aria-hidden": "true",
4021
+ class: `h-3 w-3 transition-transform ${isOpen() ? "rotate-180" : ""}`,
4022
+ viewBox: "0 0 16 16",
4023
+ children: /* @__PURE__ */ jsx("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", "stroke-width": "2", fill: "none" })
4024
+ }
4025
+ )
4026
+ ]
4027
+ }
4028
+ ),
4029
+ /* @__PURE__ */ jsx(Show, { when: isOpen(), children: /* @__PURE__ */ jsx("div", { class: "absolute right-0 top-full z-20 mt-1 min-w-[120px] overflow-hidden rounded-lg border border-white/10 bg-[#111218] shadow-xl", children: /* @__PURE__ */ jsx(For, { each: props.versions, children: (v) => /* @__PURE__ */ jsxs(
4030
+ "button",
4031
+ {
4032
+ type: "button",
4033
+ onClick: () => {
4034
+ props.onSelect(v);
4035
+ setIsOpen(false);
4036
+ },
4037
+ class: `flex w-full items-center px-3 py-2 text-xs transition-colors ${v === props.current ? "bg-indigo-500/15 text-indigo-300" : "text-white/60 hover:bg-white/5"}`,
4038
+ children: [
4039
+ "v",
4040
+ v,
4041
+ v === props.current && /* @__PURE__ */ jsx("span", { class: "ml-auto text-[10px]", children: "\u2713" })
4042
+ ]
4043
+ }
4044
+ ) }) }) })
4045
+ ] }) });
4046
+ }
4047
+ function createDocSearch(searchFn, debounceMs = 250) {
4048
+ const [query, setQuery] = createSignal("");
4049
+ const [results, setResults] = createSignal([]);
4050
+ const [isSearching, setIsSearching] = createSignal(false);
4051
+ createEffect(() => {
4052
+ const q = query();
4053
+ if (!q.trim()) {
4054
+ setResults([]);
4055
+ setIsSearching(false);
4056
+ return;
4057
+ }
4058
+ setIsSearching(true);
4059
+ const timer = setTimeout(async () => {
4060
+ try {
4061
+ const r = await searchFn(q);
4062
+ setResults(r);
4063
+ } catch {
4064
+ setResults([]);
4065
+ } finally {
4066
+ setIsSearching(false);
4067
+ }
4068
+ }, debounceMs);
4069
+ onCleanup(() => clearTimeout(timer));
4070
+ });
4071
+ const clearSearch = () => {
4072
+ setQuery("");
4073
+ setResults([]);
4074
+ setIsSearching(false);
4075
+ };
4076
+ return { results, isSearching, query, setQuery, clearSearch };
4077
+ }
4078
+ function DocSearchPage(props) {
4079
+ const sections = createMemo(() => props.tree() ?? []);
4080
+ const flatPages = createMemo(() => sections().flatMap((s) => s.pages ?? []));
4081
+ const searchFn = (q) => {
4082
+ const index = buildDocsIndex(flatPages(), sections());
4083
+ return searchDocs(q, index);
4084
+ };
4085
+ const { results, isSearching, query, setQuery } = createDocSearch(searchFn);
4086
+ return /* @__PURE__ */ jsx(
4087
+ Show,
4088
+ {
4089
+ when: props.tree() !== void 0,
4090
+ fallback: /* @__PURE__ */ jsx("div", { class: "min-h-screen bg-[#090a0f] px-6 py-16", children: /* @__PURE__ */ jsx("div", { class: "mx-auto max-w-2xl", children: /* @__PURE__ */ jsx("div", { class: "mb-8 h-12 animate-pulse rounded-xl bg-white/5" }) }) }),
4091
+ children: /* @__PURE__ */ jsx("div", { class: "min-h-screen bg-[#090a0f] text-white", children: /* @__PURE__ */ jsxs("div", { class: "mx-auto max-w-2xl px-6 py-16", children: [
4092
+ /* @__PURE__ */ jsx("h1", { class: "mb-8 text-2xl font-bold", children: "Search Documentation" }),
4093
+ /* @__PURE__ */ jsxs("div", { class: "relative mb-8", children: [
4094
+ /* @__PURE__ */ jsx(
4095
+ "input",
4096
+ {
4097
+ type: "text",
4098
+ value: query(),
4099
+ onInput: (e) => setQuery(e.currentTarget.value),
4100
+ placeholder: "Type to search\u2026",
4101
+ autofocus: true,
4102
+ class: "w-full rounded-xl border border-white/10 bg-white/5 py-3.5 pl-12 pr-4 text-sm text-white placeholder-white/30 outline-none focus:border-indigo-500/40"
4103
+ }
4104
+ ),
4105
+ /* @__PURE__ */ jsx(Show, { when: isSearching(), children: /* @__PURE__ */ jsx("div", { class: "absolute right-4 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsx("div", { class: "h-4 w-4 animate-spin rounded-full border-2 border-white/10 border-t-indigo-400" }) }) })
4106
+ ] }),
4107
+ /* @__PURE__ */ jsx(Show, { when: results().length > 0, children: /* @__PURE__ */ jsx("div", { class: "space-y-2", children: /* @__PURE__ */ jsx(For, { each: results(), children: (result) => {
4108
+ const section = () => sections().find((s) => s.slug === result.sectionSlug);
4109
+ const page = () => flatPages().find((p) => p.id === result.pageId);
4110
+ return /* @__PURE__ */ jsxs(
4111
+ "button",
4112
+ {
4113
+ type: "button",
4114
+ onClick: () => {
4115
+ const p = page();
4116
+ const s = section();
4117
+ if (p && s && props.onSelectPage) props.onSelectPage(p, s);
4118
+ },
4119
+ class: "flex w-full flex-col gap-1.5 rounded-xl border border-white/5 bg-white/[0.02] p-4 text-left transition-all hover:border-indigo-500/20 hover:bg-white/[0.05]",
4120
+ children: [
4121
+ /* @__PURE__ */ jsxs("div", { class: "flex items-center gap-2", children: [
4122
+ /* @__PURE__ */ jsx("span", { class: "rounded bg-indigo-500/20 px-2 py-0.5 text-[10px] font-medium text-indigo-300", children: result.sectionTitle }),
4123
+ /* @__PURE__ */ jsx("span", { class: "text-sm font-medium text-white/90", children: result.pageTitle })
4124
+ ] }),
4125
+ /* @__PURE__ */ jsx("p", { class: "text-xs leading-relaxed text-white/40", children: highlightMatch(result.highlight, query()) })
4126
+ ]
4127
+ }
4128
+ );
4129
+ } }) }) }),
4130
+ /* @__PURE__ */ jsx(Show, { when: query().trim() && results().length === 0 && !isSearching(), children: /* @__PURE__ */ jsxs("div", { class: "flex flex-col items-center py-16 text-center", children: [
4131
+ /* @__PURE__ */ jsx("div", { class: "mb-4 text-5xl opacity-30", children: "\u{1F50D}" }),
4132
+ /* @__PURE__ */ jsx("h3", { class: "text-lg font-medium text-white/60", children: "No results found" })
4133
+ ] }) }),
4134
+ /* @__PURE__ */ jsx(Show, { when: !query().trim(), children: /* @__PURE__ */ jsxs("div", { class: "flex flex-col items-center py-16 text-center", children: [
4135
+ /* @__PURE__ */ jsx("div", { class: "mb-4 text-5xl opacity-20", children: "\u{1F4D6}" }),
4136
+ /* @__PURE__ */ jsx("p", { class: "text-sm text-white/30", children: "Start typing to search across all documentation" })
4137
+ ] }) })
4138
+ ] }) })
4139
+ }
4140
+ );
4141
+ }
4142
+ function DocsAdminPage(props) {
4143
+ const sections = createMemo(() => props.tree?.() ?? []);
4144
+ const [selectedId, setSelectedId] = createSignal(null);
4145
+ const [showSF, setShowSF] = createSignal(false);
4146
+ const [showPF, setShowPF] = createSignal(false);
4147
+ const [sectionForm, setSectionForm] = createSignal({
4148
+ title: "",
4149
+ slug: "",
4150
+ description: "",
4151
+ icon: "",
4152
+ access: "team"
4153
+ });
4154
+ const [pageForm, setPageForm] = createSignal({
4155
+ title: "",
4156
+ slug: "",
4157
+ content: "",
4158
+ access: "team",
4159
+ tags: ""
4160
+ });
4161
+ const selectedSection = createMemo(() => sections().find((s) => s.id === selectedId()));
4162
+ const sectionPages = createMemo(() => {
4163
+ const sec = selectedSection();
4164
+ if (!sec) return [];
4165
+ if (props.allPages) return props.allPages.filter((p) => p.sectionId === selectedId());
4166
+ return sec.pages ?? [];
4167
+ });
4168
+ return /* @__PURE__ */ jsx(
4169
+ Show,
4170
+ {
4171
+ when: props.tree?.() !== void 0,
4172
+ fallback: /* @__PURE__ */ jsx("div", { class: "min-h-screen bg-[#090a0f] px-6 py-12", children: /* @__PURE__ */ jsx("div", { class: "mx-auto max-w-6xl", children: /* @__PURE__ */ jsx("div", { class: "mb-8 h-10 w-48 animate-pulse rounded bg-white/5" }) }) }),
4173
+ children: /* @__PURE__ */ jsx("div", { class: "min-h-screen bg-[#090a0f] text-white", children: /* @__PURE__ */ jsxs("div", { class: "mx-auto max-w-6xl px-6 py-12", children: [
4174
+ /* @__PURE__ */ jsx("h1", { class: "mb-8 text-2xl font-bold", children: "Docs Admin" }),
4175
+ /* @__PURE__ */ jsxs("div", { class: "grid gap-6 md:grid-cols-2", children: [
4176
+ /* @__PURE__ */ jsxs("div", { class: "rounded-xl border border-white/8 bg-white/[0.02] p-5", children: [
4177
+ /* @__PURE__ */ jsxs("div", { class: "mb-4 flex items-center justify-between", children: [
4178
+ /* @__PURE__ */ jsx("h2", { class: "text-lg font-semibold text-white/80", children: "Sections" }),
4179
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setShowSF(!showSF()), class: "rounded-lg bg-indigo-600 px-3 py-1.5 text-xs font-medium hover:bg-indigo-500", children: "+ Add" })
4180
+ ] }),
4181
+ /* @__PURE__ */ jsx(Show, { when: showSF(), children: /* @__PURE__ */ jsxs("div", { class: "mb-4 space-y-2 rounded-lg border border-white/10 bg-white/5 p-4", children: [
4182
+ /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Title", value: sectionForm().title, onInput: (e) => setSectionForm({ ...sectionForm(), title: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4183
+ /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Slug", value: sectionForm().slug, onInput: (e) => setSectionForm({ ...sectionForm(), slug: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4184
+ /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Icon", value: sectionForm().icon, onInput: (e) => setSectionForm({ ...sectionForm(), icon: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4185
+ /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Description", value: sectionForm().description, onInput: (e) => setSectionForm({ ...sectionForm(), description: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4186
+ /* @__PURE__ */ jsxs("select", { value: sectionForm().access, onChange: (e) => setSectionForm({ ...sectionForm(), access: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40", children: [
4187
+ /* @__PURE__ */ jsx("option", { value: "public", children: "Public" }),
4188
+ /* @__PURE__ */ jsx("option", { value: "team", children: "Team" }),
4189
+ /* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
4190
+ ] }),
4191
+ /* @__PURE__ */ jsxs("div", { class: "flex gap-2", children: [
4192
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: async () => {
4193
+ await props.admin.createSection({ ...sectionForm(), order: sections().length });
4194
+ setSectionForm({ title: "", slug: "", description: "", icon: "", access: "team" });
4195
+ setShowSF(false);
4196
+ }, class: "rounded-lg bg-indigo-600 px-4 py-2 text-xs font-medium hover:bg-indigo-500", children: "Create" }),
4197
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setShowSF(false), class: "rounded-lg border border-white/10 px-4 py-2 text-xs hover:bg-white/5", children: "Cancel" })
4198
+ ] })
4199
+ ] }) }),
4200
+ /* @__PURE__ */ jsxs("div", { class: "space-y-1", children: [
4201
+ /* @__PURE__ */ jsx(Show, { when: sections().length === 0, children: /* @__PURE__ */ jsx("p", { class: "py-8 text-center text-sm text-white/30", children: "No sections" }) }),
4202
+ /* @__PURE__ */ jsx(For, { each: sections(), children: (section) => /* @__PURE__ */ jsxs("div", { class: `group flex items-center gap-2 rounded-lg px-3 py-2.5 cursor-pointer ${selectedId() === section.id ? "bg-indigo-500/15 text-indigo-300" : "hover:bg-white/5 text-white/70"}`, children: [
4203
+ /* @__PURE__ */ jsxs(
4204
+ "button",
4205
+ {
4206
+ type: "button",
4207
+ class: "flex min-w-0 flex-1 items-center gap-2 text-left",
4208
+ onClick: () => setSelectedId(section.id),
4209
+ children: [
4210
+ /* @__PURE__ */ jsx(Show, { when: section.icon, children: /* @__PURE__ */ jsx("span", { children: section.icon }) }),
4211
+ /* @__PURE__ */ jsx("span", { class: "flex-1 text-sm font-medium truncate", children: section.title }),
4212
+ /* @__PURE__ */ jsx("span", { class: "text-[11px] tabular-nums opacity-40", children: section.pageCount ?? 0 })
4213
+ ]
4214
+ }
4215
+ ),
4216
+ /* @__PURE__ */ jsx(
4217
+ "button",
4218
+ {
4219
+ type: "button",
4220
+ onClick: (e) => {
4221
+ e.stopPropagation();
4222
+ if (confirm(`Delete "${section.title}"?`)) props.admin.deleteSection(section.id);
4223
+ },
4224
+ class: "rounded p-1 text-white/20 opacity-0 group-hover:opacity-100 hover:text-red-400",
4225
+ children: "\u2715"
4226
+ }
4227
+ )
4228
+ ] }) })
4229
+ ] })
4230
+ ] }),
4231
+ /* @__PURE__ */ jsxs("div", { class: "rounded-xl border border-white/8 bg-white/[0.02] p-5", children: [
4232
+ /* @__PURE__ */ jsxs("div", { class: "mb-4 flex items-center justify-between", children: [
4233
+ /* @__PURE__ */ jsx("h2", { class: "text-lg font-semibold text-white/80", children: selectedSection() ? `Pages \u2014 ${selectedSection()?.title}` : "Pages" }),
4234
+ /* @__PURE__ */ jsx(Show, { when: selectedSection(), children: /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setShowPF(!showPF()), class: "rounded-lg bg-indigo-600 px-3 py-1.5 text-xs font-medium hover:bg-indigo-500", children: "+ Add" }) })
4235
+ ] }),
4236
+ /* @__PURE__ */ jsx(Show, { when: !selectedSection(), children: /* @__PURE__ */ jsx("p", { class: "py-16 text-center text-sm text-white/30", children: "Select a section" }) }),
4237
+ /* @__PURE__ */ jsx(Show, { when: showPF() && selectedSection(), children: /* @__PURE__ */ jsxs("div", { class: "mb-4 space-y-2 rounded-lg border border-white/10 bg-white/5 p-4", children: [
4238
+ /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Title", value: pageForm().title, onInput: (e) => setPageForm({ ...pageForm(), title: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4239
+ /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Slug", value: pageForm().slug, onInput: (e) => setPageForm({ ...pageForm(), slug: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4240
+ /* @__PURE__ */ jsx("textarea", { placeholder: "Content (MDX)", value: pageForm().content, onInput: (e) => setPageForm({ ...pageForm(), content: e.currentTarget.value }), rows: 4, class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40 resize-y" }),
4241
+ /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Tags (comma)", value: pageForm().tags, onInput: (e) => setPageForm({ ...pageForm(), tags: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4242
+ /* @__PURE__ */ jsxs("select", { value: pageForm().access, onChange: (e) => setPageForm({ ...pageForm(), access: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40", children: [
4243
+ /* @__PURE__ */ jsx("option", { value: "public", children: "Public" }),
4244
+ /* @__PURE__ */ jsx("option", { value: "team", children: "Team" }),
4245
+ /* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
4246
+ ] }),
4247
+ /* @__PURE__ */ jsxs("div", { class: "flex gap-2", children: [
4248
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: async () => {
4249
+ const sectionId = selectedId();
4250
+ if (!sectionId) return;
4251
+ await props.admin.createPage({ title: pageForm().title, slug: pageForm().slug, content: pageForm().content, sectionId, access: pageForm().access, tags: pageForm().tags ? pageForm().tags.split(",").map((t) => t.trim()) : [], order: sectionPages().length });
4252
+ setPageForm({ title: "", slug: "", content: "", access: "team", tags: "" });
4253
+ setShowPF(false);
4254
+ }, class: "rounded-lg bg-indigo-600 px-4 py-2 text-xs font-medium hover:bg-indigo-500", children: "Create" }),
4255
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setShowPF(false), class: "rounded-lg border border-white/10 px-4 py-2 text-xs hover:bg-white/5", children: "Cancel" })
4256
+ ] })
4257
+ ] }) }),
4258
+ /* @__PURE__ */ jsx(Show, { when: selectedSection() && sectionPages().length > 0, children: /* @__PURE__ */ jsx("div", { class: "space-y-1", children: /* @__PURE__ */ jsx(For, { each: sectionPages(), children: (page) => /* @__PURE__ */ jsxs("div", { class: "group flex items-center gap-3 rounded-lg px-3 py-2.5 hover:bg-white/5", children: [
4259
+ /* @__PURE__ */ jsxs("div", { class: "flex-1 min-w-0", children: [
4260
+ /* @__PURE__ */ jsx("p", { class: "text-sm font-medium text-white/80 truncate", children: page.title }),
4261
+ /* @__PURE__ */ jsxs("p", { class: "text-[11px] text-white/30", children: [
4262
+ "/",
4263
+ page.slug
4264
+ ] })
4265
+ ] }),
4266
+ /* @__PURE__ */ jsx("span", { class: `shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${page.status === "published" ? "bg-emerald-500/15 text-emerald-400" : page.status === "archived" ? "bg-white/5 text-white/30" : "bg-amber-500/15 text-amber-400"}`, children: page.status }),
4267
+ /* @__PURE__ */ jsxs("div", { class: "flex items-center gap-1 opacity-0 group-hover:opacity-100", children: [
4268
+ /* @__PURE__ */ jsx(Show, { when: page.status === "draft", children: /* @__PURE__ */ jsx("button", { type: "button", onClick: () => props.admin.publishPage(page.id), class: "rounded px-2 py-1 text-[11px] text-emerald-400 hover:bg-emerald-500/10", children: "Publish" }) }),
4269
+ /* @__PURE__ */ jsx(Show, { when: page.status === "published", children: /* @__PURE__ */ jsx("button", { type: "button", onClick: () => props.admin.archivePage(page.id), class: "rounded px-2 py-1 text-[11px] text-amber-400 hover:bg-amber-500/10", children: "Archive" }) }),
4270
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => {
4271
+ if (confirm(`Delete "${page.title}"?`)) props.admin.deletePage(page.id);
4272
+ }, class: "rounded p-1 text-white/20 hover:text-red-400", children: "\u2715" })
4273
+ ] })
4274
+ ] }) }) }) }),
4275
+ /* @__PURE__ */ jsx(Show, { when: selectedSection() && sectionPages().length === 0 && !showPF(), children: /* @__PURE__ */ jsx("p", { class: "py-12 text-center text-sm text-white/30", children: "No pages in this section" }) })
4276
+ ] })
4277
+ ] })
4278
+ ] }) })
4279
+ }
4280
+ );
4281
+ }
4282
+ function createDocs(tree, config) {
4283
+ const [currentSection, setSection] = createSignal(null);
4284
+ const [currentPage, setPage] = createSignal(null);
4285
+ const [searchQuery, setSearchQuery] = createSignal("");
4286
+ const mergedConfig = createMemo(() => ({ ...defaultDocsConfig, ...config }));
4287
+ const sections = createMemo(() => tree() ?? []);
4288
+ const flatPages = createMemo(() => sections().flatMap((s) => s.pages ?? []));
4289
+ const isLoading = createMemo(() => tree() === void 0);
4290
+ const handleSetSection = (section) => {
4291
+ setSection(section);
4292
+ setPage(null);
4293
+ };
4294
+ return {
4295
+ sections,
4296
+ currentSection,
4297
+ setSection: handleSetSection,
4298
+ currentPage,
4299
+ setPage,
4300
+ searchQuery,
4301
+ setSearchQuery,
4302
+ isLoading,
4303
+ config: mergedConfig,
4304
+ flatPages
4305
+ };
4306
+ }
4307
+ function DocsIndexPage(props) {
4308
+ const docs = createDocs(props.tree);
4309
+ const [isSearchOpen, setIsSearchOpen] = createSignal(false);
4310
+ const searchFn = (q) => {
4311
+ const index = buildDocsIndex(docs.flatPages(), docs.sections());
4312
+ return searchDocs(q, index);
4313
+ };
4314
+ const search = createDocSearch(searchFn);
4315
+ createEffect(() => {
4316
+ const handler = (e) => {
4317
+ if ((e.metaKey || e.ctrlKey) && e.key === "k") {
4318
+ e.preventDefault();
4319
+ setIsSearchOpen(true);
4320
+ }
4321
+ };
4322
+ document.addEventListener("keydown", handler);
4323
+ onCleanup(() => document.removeEventListener("keydown", handler));
4324
+ });
4325
+ return /* @__PURE__ */ jsx(
4326
+ Show,
4327
+ {
4328
+ when: !docs.isLoading(),
4329
+ fallback: /* @__PURE__ */ jsx("div", { class: "min-h-screen bg-[#090a0f] px-6 py-16", children: /* @__PURE__ */ jsxs("div", { class: "mx-auto max-w-5xl", children: [
4330
+ /* @__PURE__ */ jsx("div", { class: "mb-10 h-10 w-64 animate-pulse rounded-lg bg-white/5" }),
4331
+ /* @__PURE__ */ jsx("div", { class: "mb-8 h-12 w-full max-w-xl animate-pulse rounded-xl bg-white/5" }),
4332
+ /* @__PURE__ */ jsx("div", { class: "grid gap-4 md:grid-cols-2 lg:grid-cols-3", children: /* @__PURE__ */ jsx(For, { each: Array(6), children: () => /* @__PURE__ */ jsx("div", { class: "h-36 animate-pulse rounded-xl bg-white/5" }) }) })
4333
+ ] }) }),
4334
+ children: /* @__PURE__ */ jsx(
4335
+ Show,
4336
+ {
4337
+ when: docs.sections().length > 0,
4338
+ fallback: /* @__PURE__ */ jsxs("div", { class: "flex min-h-screen flex-col items-center justify-center bg-[#090a0f] text-center", children: [
4339
+ /* @__PURE__ */ jsx("div", { class: "mb-4 text-6xl opacity-30", children: "\u{1F4DA}" }),
4340
+ /* @__PURE__ */ jsx("h2", { class: "mb-2 text-xl font-semibold text-white/80", children: "No documentation yet" }),
4341
+ /* @__PURE__ */ jsx("p", { class: "max-w-sm text-sm text-white/40", children: "Create your first section and pages to get started." })
4342
+ ] }),
4343
+ children: /* @__PURE__ */ jsxs("div", { class: "min-h-screen bg-[#090a0f] text-white", children: [
4344
+ /* @__PURE__ */ jsxs("div", { class: "mx-auto max-w-5xl px-6 py-16", children: [
4345
+ /* @__PURE__ */ jsx("h1", { class: "mb-2 text-4xl font-bold tracking-tight", children: "Documentation" }),
4346
+ /* @__PURE__ */ jsx("p", { class: "mb-10 text-lg text-white/50", children: "Browse guides, API references, and tutorials." }),
4347
+ /* @__PURE__ */ jsxs(
4348
+ "button",
4349
+ {
4350
+ type: "button",
4351
+ onClick: () => setIsSearchOpen(true),
4352
+ class: "mb-12 flex w-full max-w-xl items-center gap-3 rounded-xl border border-white/10 bg-white/5 px-5 py-3.5 text-left text-sm text-white/30 transition-colors hover:border-white/20",
4353
+ children: [
4354
+ /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", class: "h-4.5 w-4.5 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { "fill-rule": "evenodd", d: "M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z", "clip-rule": "evenodd" }) }),
4355
+ /* @__PURE__ */ jsx("span", { class: "flex-1", children: "Search documentation\u2026" }),
4356
+ /* @__PURE__ */ jsx("kbd", { class: "rounded border border-white/10 bg-white/5 px-2 py-0.5 text-[11px]", children: "\u2318K" })
4357
+ ]
4358
+ }
4359
+ ),
4360
+ /* @__PURE__ */ jsx("div", { class: "grid gap-4 md:grid-cols-2 lg:grid-cols-3", children: /* @__PURE__ */ jsx(For, { each: docs.sections().filter((s) => !s.parentId), children: (section) => /* @__PURE__ */ jsxs(
4361
+ "button",
4362
+ {
4363
+ type: "button",
4364
+ onClick: () => {
4365
+ const fp = section.pages?.[0];
4366
+ if (fp && props.onSelectPage) props.onSelectPage(fp, section);
4367
+ },
4368
+ class: "group flex flex-col rounded-xl border border-white/8 bg-white/[0.03] p-5 text-left transition-all hover:border-indigo-500/30 hover:bg-white/[0.06]",
4369
+ children: [
4370
+ /* @__PURE__ */ jsx(Show, { when: section.icon, children: /* @__PURE__ */ jsx("span", { class: "mb-3 text-2xl", children: section.icon }) }),
4371
+ /* @__PURE__ */ jsx("h3", { class: "mb-1.5 text-base font-semibold text-white/90 group-hover:text-white", children: section.title }),
4372
+ /* @__PURE__ */ jsx(Show, { when: section.description, children: /* @__PURE__ */ jsx("p", { class: "mb-3 flex-1 text-sm leading-relaxed text-white/40", children: section.description }) }),
4373
+ /* @__PURE__ */ jsx("div", { class: "text-xs text-white/25", children: /* @__PURE__ */ jsxs("span", { children: [
4374
+ section.pageCount ?? 0,
4375
+ " pages"
4376
+ ] }) })
4377
+ ]
4378
+ }
4379
+ ) }) })
4380
+ ] }),
4381
+ /* @__PURE__ */ jsx(
4382
+ DocSearch,
4383
+ {
4384
+ results: search.results(),
4385
+ query: search.query(),
4386
+ onQuery: search.setQuery,
4387
+ onSelect: (result) => {
4388
+ setIsSearchOpen(false);
4389
+ search.clearSearch();
4390
+ const section = docs.sections().find((s) => s.slug === result.sectionSlug);
4391
+ const page = docs.flatPages().find((p) => p.id === result.pageId);
4392
+ if (page && section && props.onSelectPage) props.onSelectPage(page, section);
4393
+ },
4394
+ isOpen: isSearchOpen(),
4395
+ onClose: () => setIsSearchOpen(false)
4396
+ }
4397
+ )
4398
+ ] })
4399
+ }
4400
+ )
4401
+ }
4402
+ );
4403
+ }
4404
+ function createTableOfContents(mdxContent) {
4405
+ const [activeId, setActiveId] = createSignal("");
4406
+ const toc = createMemo(() => {
4407
+ const content = mdxContent();
4408
+ if (!content) return [];
4409
+ return extractToc(content);
4410
+ });
4411
+ const flatIds = createMemo(() => {
4412
+ const ids = [];
4413
+ const collect = (items) => {
4414
+ for (const item of items) {
4415
+ ids.push(item.id);
4416
+ collect(item.children);
4417
+ }
4418
+ };
4419
+ collect(toc());
4420
+ return ids;
4421
+ });
4422
+ createEffect(() => {
4423
+ const ids = flatIds();
4424
+ if (ids.length === 0) return;
4425
+ const observer = new IntersectionObserver(
4426
+ (entries) => {
4427
+ for (const entry of entries) {
4428
+ if (entry.isIntersecting) {
4429
+ setActiveId(entry.target.id);
4430
+ break;
4431
+ }
4432
+ }
4433
+ },
4434
+ { rootMargin: "-80px 0px -70% 0px", threshold: 0 }
4435
+ );
4436
+ for (const id of ids) {
4437
+ const el = document.getElementById(id);
4438
+ if (el) observer.observe(el);
4439
+ }
4440
+ onCleanup(() => observer.disconnect());
4441
+ });
4442
+ return { toc, activeId, setActiveId };
4443
+ }
4444
+ function DocViewPage(props) {
4445
+ const docs = createDocs(props.tree);
4446
+ const { toc, activeId } = createTableOfContents(() => props.page()?.content);
4447
+ createEffect(() => {
4448
+ const p = props.page();
4449
+ if (p?.id && props.onIncrementView) props.onIncrementView(p.id);
4450
+ });
4451
+ const breadcrumbs = createMemo(() => {
4452
+ const p = props.page();
4453
+ if (!p) return [];
4454
+ return buildBreadcrumbs(docs.sections(), p.sectionId, p.slug);
4455
+ });
4456
+ const nav = createMemo(() => {
4457
+ const p = props.page();
4458
+ if (!p) return { prev: void 0, next: void 0 };
4459
+ const all = docs.flatPages();
4460
+ const idx = all.findIndex((pg) => pg.id === p.id);
4461
+ const section = docs.sections().find((s) => s.id === p.sectionId);
4462
+ return {
4463
+ prev: idx > 0 ? {
4464
+ title: all[idx - 1].title,
4465
+ href: `/docs/${section?.slug ?? ""}/${all[idx - 1].slug}`
4466
+ } : void 0,
4467
+ next: idx < all.length - 1 ? {
4468
+ title: all[idx + 1].title,
4469
+ href: `/docs/${section?.slug ?? ""}/${all[idx + 1].slug}`
4470
+ } : void 0
4471
+ };
4472
+ });
4473
+ return /* @__PURE__ */ jsx(
4474
+ Show,
4475
+ {
4476
+ when: !docs.isLoading() && props.page() !== void 0,
4477
+ fallback: /* @__PURE__ */ jsxs("div", { class: "flex min-h-screen bg-[#090a0f]", children: [
4478
+ /* @__PURE__ */ jsx("div", { class: "hidden w-[260px] shrink-0 border-r border-white/5 bg-[#0b0c12] lg:block", children: /* @__PURE__ */ jsx("div", { class: "space-y-3 p-4", children: Array.from({ length: 8 }).map(() => /* @__PURE__ */ jsx("div", { class: "h-8 animate-pulse rounded-lg bg-white/5" })) }) }),
4479
+ /* @__PURE__ */ jsx("div", { class: "flex-1 px-10 py-8", children: /* @__PURE__ */ jsx("div", { class: "mx-auto max-w-3xl space-y-4", children: /* @__PURE__ */ jsx("div", { class: "h-10 w-96 animate-pulse rounded bg-white/5" }) }) })
4480
+ ] }),
4481
+ children: /* @__PURE__ */ jsx(
4482
+ Show,
4483
+ {
4484
+ when: props.page(),
4485
+ fallback: /* @__PURE__ */ jsxs("div", { class: "flex min-h-screen flex-col items-center justify-center bg-[#090a0f] text-center", children: [
4486
+ /* @__PURE__ */ jsx("div", { class: "mb-4 text-6xl opacity-30", children: "\u{1F50D}" }),
4487
+ /* @__PURE__ */ jsx("h2", { class: "mb-2 text-xl font-semibold text-white/80", children: "Page not found" })
4488
+ ] }),
4489
+ children: (page) => /* @__PURE__ */ jsxs(
4490
+ DocsLayout,
4491
+ {
4492
+ sections: docs.sections(),
4493
+ toc: toc(),
4494
+ activeHeadingId: activeId(),
4495
+ breadcrumbs: breadcrumbs(),
4496
+ currentPageId: page().id,
4497
+ onNavigate: props.onNavigate,
4498
+ children: [
4499
+ /* @__PURE__ */ jsxs("div", { class: "mb-8", children: [
4500
+ /* @__PURE__ */ jsx("h1", { class: "mb-3 text-3xl font-bold tracking-tight", children: page().title }),
4501
+ /* @__PURE__ */ jsxs("div", { class: "flex flex-wrap items-center gap-4 text-sm text-white/40", children: [
4502
+ /* @__PURE__ */ jsx("span", { children: page().author.name }),
4503
+ /* @__PURE__ */ jsx(Show, { when: page().readingTime > 0, children: /* @__PURE__ */ jsxs("span", { children: [
4504
+ page().readingTime,
4505
+ " min read"
4506
+ ] }) }),
4507
+ /* @__PURE__ */ jsx(Show, { when: page().viewCount > 0, children: /* @__PURE__ */ jsxs("span", { children: [
4508
+ page().viewCount.toLocaleString(),
4509
+ " views"
4510
+ ] }) })
4511
+ ] })
4512
+ ] }),
4513
+ /* @__PURE__ */ jsx(DocPage, { page: page() }),
4514
+ /* @__PURE__ */ jsx("div", { class: "mt-10 flex items-center justify-between border-t border-white/5 pt-6", children: /* @__PURE__ */ jsx(EditButton, { pageSlug: page().slug, editUrl: props.editPageUrl }) }),
4515
+ /* @__PURE__ */ jsx(PageNavigation, { prev: nav().prev, next: nav().next })
4516
+ ]
4517
+ }
4518
+ )
4519
+ }
4520
+ )
4521
+ }
4522
+ );
4523
+ }
4524
+
4525
+ // src/primitives/createDocsAdmin.ts
4526
+ function createDocsAdmin(mutations) {
4527
+ return {
4528
+ createSection: async (data) => {
4529
+ await mutations.createSection(data);
4530
+ },
4531
+ updateSection: async (sectionId, data) => {
4532
+ await mutations.updateSection({ sectionId, ...data });
4533
+ },
4534
+ deleteSection: async (sectionId) => {
4535
+ await mutations.deleteSection({ sectionId });
4536
+ },
4537
+ reorderSections: async (sectionIds) => {
4538
+ await mutations.reorderSections({ sectionIds });
4539
+ },
4540
+ createPage: async (data) => {
4541
+ await mutations.createPage(data);
4542
+ },
4543
+ updatePage: async (pageId, data) => {
4544
+ await mutations.updatePage({ pageId, ...data });
4545
+ },
4546
+ publishPage: async (pageId) => {
4547
+ await mutations.publishPage({ pageId });
4548
+ },
4549
+ archivePage: async (pageId) => {
4550
+ await mutations.archivePage({ pageId });
4551
+ },
4552
+ deletePage: async (pageId) => {
4553
+ await mutations.deletePage({ pageId });
4554
+ },
4555
+ reorderPages: async (pageIds) => {
4556
+ await mutations.reorderPages({ pageIds });
4557
+ },
4558
+ movePage: async (pageId, newSectionId, newOrder) => {
4559
+ await mutations.movePage({ pageId, newSectionId, newOrder });
4560
+ }
4561
+ };
4562
+ }
4563
+ /*! Bundled license information:
4564
+
4565
+ is-extendable/index.js:
4566
+ (*!
4567
+ * is-extendable <https://github.com/jonschlinkert/is-extendable>
4568
+ *
4569
+ * Copyright (c) 2015, Jon Schlinkert.
4570
+ * Licensed under the MIT License.
4571
+ *)
4572
+
4573
+ strip-bom-string/index.js:
4574
+ (*!
4575
+ * strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
4576
+ *
4577
+ * Copyright (c) 2015, 2017, Jon Schlinkert.
4578
+ * Released under the MIT License.
4579
+ *)
4580
+ */
4581
+
4582
+ export { Breadcrumbs, DocPage, DocSearch, DocSearchPage, DocSidebar, DocViewPage, DocsAdminPage, DocsIndexPage, DocsLayout, EditButton, PageNavigation, TableOfContents, VersionSelector, createDocSearch, createDocs, createDocsAdmin, createTableOfContents };
4583
+ //# sourceMappingURL=index.js.map
4584
+ //# sourceMappingURL=index.js.map