refira-cli 0.1.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 (2) hide show
  1. package/dist/index.js +3952 -0
  2. package/package.json +27 -0
package/dist/index.js ADDED
@@ -0,0 +1,3952 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from "node:module";
3
+ var __defProp = Object.defineProperty;
4
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
5
+ var __exportCjs = (target, getters, setters) => {
6
+ for (var name in getters)
7
+ __defProp(target, name, {
8
+ get: getters[name],
9
+ set: setters[name],
10
+ enumerable: true,
11
+ configurable: true
12
+ });
13
+ };
14
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
15
+
16
+ // ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/error.js
17
+ var require_error = __commonJS(function(exports) {
18
+ class CommanderError extends Error {
19
+ constructor(exitCode, code, message) {
20
+ super(message);
21
+ Error.captureStackTrace(this, this.constructor);
22
+ this.name = this.constructor.name;
23
+ this.code = code;
24
+ this.exitCode = exitCode;
25
+ this.nestedError = undefined;
26
+ }
27
+ }
28
+
29
+ class InvalidArgumentError extends CommanderError {
30
+ constructor(message) {
31
+ super(1, "commander.invalidArgument", message);
32
+ Error.captureStackTrace(this, this.constructor);
33
+ this.name = this.constructor.name;
34
+ }
35
+ }
36
+ exports.CommanderError = CommanderError;
37
+ exports.InvalidArgumentError = InvalidArgumentError;
38
+ });
39
+
40
+ // ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/argument.js
41
+ var require_argument = __commonJS(function(exports) {
42
+ var { InvalidArgumentError } = require_error();
43
+
44
+ class Argument {
45
+ constructor(name, description) {
46
+ this.description = description || "";
47
+ this.variadic = false;
48
+ this.parseArg = undefined;
49
+ this.defaultValue = undefined;
50
+ this.defaultValueDescription = undefined;
51
+ this.argChoices = undefined;
52
+ switch (name[0]) {
53
+ case "<":
54
+ this.required = true;
55
+ this._name = name.slice(1, -1);
56
+ break;
57
+ case "[":
58
+ this.required = false;
59
+ this._name = name.slice(1, -1);
60
+ break;
61
+ default:
62
+ this.required = true;
63
+ this._name = name;
64
+ break;
65
+ }
66
+ if (this._name.length > 3 && this._name.slice(-3) === "...") {
67
+ this.variadic = true;
68
+ this._name = this._name.slice(0, -3);
69
+ }
70
+ }
71
+ name() {
72
+ return this._name;
73
+ }
74
+ _concatValue(value, previous) {
75
+ if (previous === this.defaultValue || !Array.isArray(previous)) {
76
+ return [value];
77
+ }
78
+ return previous.concat(value);
79
+ }
80
+ default(value, description) {
81
+ this.defaultValue = value;
82
+ this.defaultValueDescription = description;
83
+ return this;
84
+ }
85
+ argParser(fn) {
86
+ this.parseArg = fn;
87
+ return this;
88
+ }
89
+ choices(values) {
90
+ this.argChoices = values.slice();
91
+ this.parseArg = (arg, previous) => {
92
+ if (!this.argChoices.includes(arg)) {
93
+ throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
94
+ }
95
+ if (this.variadic) {
96
+ return this._concatValue(arg, previous);
97
+ }
98
+ return arg;
99
+ };
100
+ return this;
101
+ }
102
+ argRequired() {
103
+ this.required = true;
104
+ return this;
105
+ }
106
+ argOptional() {
107
+ this.required = false;
108
+ return this;
109
+ }
110
+ }
111
+ function humanReadableArgName(arg) {
112
+ const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
113
+ return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
114
+ }
115
+ exports.Argument = Argument;
116
+ exports.humanReadableArgName = humanReadableArgName;
117
+ });
118
+
119
+ // ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/help.js
120
+ var require_help = __commonJS(function(exports) {
121
+ var { humanReadableArgName } = require_argument();
122
+
123
+ class Help {
124
+ constructor() {
125
+ this.helpWidth = undefined;
126
+ this.sortSubcommands = false;
127
+ this.sortOptions = false;
128
+ this.showGlobalOptions = false;
129
+ }
130
+ visibleCommands(cmd) {
131
+ const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
132
+ const helpCommand = cmd._getHelpCommand();
133
+ if (helpCommand && !helpCommand._hidden) {
134
+ visibleCommands.push(helpCommand);
135
+ }
136
+ if (this.sortSubcommands) {
137
+ visibleCommands.sort((a, b) => {
138
+ return a.name().localeCompare(b.name());
139
+ });
140
+ }
141
+ return visibleCommands;
142
+ }
143
+ compareOptions(a, b) {
144
+ const getSortKey = (option) => {
145
+ return option.short ? option.short.replace(/^-/, "") : option.long.replace(/^--/, "");
146
+ };
147
+ return getSortKey(a).localeCompare(getSortKey(b));
148
+ }
149
+ visibleOptions(cmd) {
150
+ const visibleOptions = cmd.options.filter((option) => !option.hidden);
151
+ const helpOption = cmd._getHelpOption();
152
+ if (helpOption && !helpOption.hidden) {
153
+ const removeShort = helpOption.short && cmd._findOption(helpOption.short);
154
+ const removeLong = helpOption.long && cmd._findOption(helpOption.long);
155
+ if (!removeShort && !removeLong) {
156
+ visibleOptions.push(helpOption);
157
+ } else if (helpOption.long && !removeLong) {
158
+ visibleOptions.push(cmd.createOption(helpOption.long, helpOption.description));
159
+ } else if (helpOption.short && !removeShort) {
160
+ visibleOptions.push(cmd.createOption(helpOption.short, helpOption.description));
161
+ }
162
+ }
163
+ if (this.sortOptions) {
164
+ visibleOptions.sort(this.compareOptions);
165
+ }
166
+ return visibleOptions;
167
+ }
168
+ visibleGlobalOptions(cmd) {
169
+ if (!this.showGlobalOptions)
170
+ return [];
171
+ const globalOptions = [];
172
+ for (let ancestorCmd = cmd.parent;ancestorCmd; ancestorCmd = ancestorCmd.parent) {
173
+ const visibleOptions = ancestorCmd.options.filter((option) => !option.hidden);
174
+ globalOptions.push(...visibleOptions);
175
+ }
176
+ if (this.sortOptions) {
177
+ globalOptions.sort(this.compareOptions);
178
+ }
179
+ return globalOptions;
180
+ }
181
+ visibleArguments(cmd) {
182
+ if (cmd._argsDescription) {
183
+ cmd.registeredArguments.forEach((argument) => {
184
+ argument.description = argument.description || cmd._argsDescription[argument.name()] || "";
185
+ });
186
+ }
187
+ if (cmd.registeredArguments.find((argument) => argument.description)) {
188
+ return cmd.registeredArguments;
189
+ }
190
+ return [];
191
+ }
192
+ subcommandTerm(cmd) {
193
+ const args = cmd.registeredArguments.map((arg) => humanReadableArgName(arg)).join(" ");
194
+ return cmd._name + (cmd._aliases[0] ? "|" + cmd._aliases[0] : "") + (cmd.options.length ? " [options]" : "") + (args ? " " + args : "");
195
+ }
196
+ optionTerm(option) {
197
+ return option.flags;
198
+ }
199
+ argumentTerm(argument) {
200
+ return argument.name();
201
+ }
202
+ longestSubcommandTermLength(cmd, helper) {
203
+ return helper.visibleCommands(cmd).reduce((max, command) => {
204
+ return Math.max(max, helper.subcommandTerm(command).length);
205
+ }, 0);
206
+ }
207
+ longestOptionTermLength(cmd, helper) {
208
+ return helper.visibleOptions(cmd).reduce((max, option) => {
209
+ return Math.max(max, helper.optionTerm(option).length);
210
+ }, 0);
211
+ }
212
+ longestGlobalOptionTermLength(cmd, helper) {
213
+ return helper.visibleGlobalOptions(cmd).reduce((max, option) => {
214
+ return Math.max(max, helper.optionTerm(option).length);
215
+ }, 0);
216
+ }
217
+ longestArgumentTermLength(cmd, helper) {
218
+ return helper.visibleArguments(cmd).reduce((max, argument) => {
219
+ return Math.max(max, helper.argumentTerm(argument).length);
220
+ }, 0);
221
+ }
222
+ commandUsage(cmd) {
223
+ let cmdName = cmd._name;
224
+ if (cmd._aliases[0]) {
225
+ cmdName = cmdName + "|" + cmd._aliases[0];
226
+ }
227
+ let ancestorCmdNames = "";
228
+ for (let ancestorCmd = cmd.parent;ancestorCmd; ancestorCmd = ancestorCmd.parent) {
229
+ ancestorCmdNames = ancestorCmd.name() + " " + ancestorCmdNames;
230
+ }
231
+ return ancestorCmdNames + cmdName + " " + cmd.usage();
232
+ }
233
+ commandDescription(cmd) {
234
+ return cmd.description();
235
+ }
236
+ subcommandDescription(cmd) {
237
+ return cmd.summary() || cmd.description();
238
+ }
239
+ optionDescription(option) {
240
+ const extraInfo = [];
241
+ if (option.argChoices) {
242
+ extraInfo.push(`choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(", ")}`);
243
+ }
244
+ if (option.defaultValue !== undefined) {
245
+ const showDefault = option.required || option.optional || option.isBoolean() && typeof option.defaultValue === "boolean";
246
+ if (showDefault) {
247
+ extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`);
248
+ }
249
+ }
250
+ if (option.presetArg !== undefined && option.optional) {
251
+ extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);
252
+ }
253
+ if (option.envVar !== undefined) {
254
+ extraInfo.push(`env: ${option.envVar}`);
255
+ }
256
+ if (extraInfo.length > 0) {
257
+ return `${option.description} (${extraInfo.join(", ")})`;
258
+ }
259
+ return option.description;
260
+ }
261
+ argumentDescription(argument) {
262
+ const extraInfo = [];
263
+ if (argument.argChoices) {
264
+ extraInfo.push(`choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(", ")}`);
265
+ }
266
+ if (argument.defaultValue !== undefined) {
267
+ extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`);
268
+ }
269
+ if (extraInfo.length > 0) {
270
+ const extraDescripton = `(${extraInfo.join(", ")})`;
271
+ if (argument.description) {
272
+ return `${argument.description} ${extraDescripton}`;
273
+ }
274
+ return extraDescripton;
275
+ }
276
+ return argument.description;
277
+ }
278
+ formatHelp(cmd, helper) {
279
+ const termWidth = helper.padWidth(cmd, helper);
280
+ const helpWidth = helper.helpWidth || 80;
281
+ const itemIndentWidth = 2;
282
+ const itemSeparatorWidth = 2;
283
+ function formatItem(term, description) {
284
+ if (description) {
285
+ const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;
286
+ return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);
287
+ }
288
+ return term;
289
+ }
290
+ function formatList(textArray) {
291
+ return textArray.join(`
292
+ `).replace(/^/gm, " ".repeat(itemIndentWidth));
293
+ }
294
+ let output = [`Usage: ${helper.commandUsage(cmd)}`, ""];
295
+ const commandDescription = helper.commandDescription(cmd);
296
+ if (commandDescription.length > 0) {
297
+ output = output.concat([
298
+ helper.wrap(commandDescription, helpWidth, 0),
299
+ ""
300
+ ]);
301
+ }
302
+ const argumentList = helper.visibleArguments(cmd).map((argument) => {
303
+ return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));
304
+ });
305
+ if (argumentList.length > 0) {
306
+ output = output.concat(["Arguments:", formatList(argumentList), ""]);
307
+ }
308
+ const optionList = helper.visibleOptions(cmd).map((option) => {
309
+ return formatItem(helper.optionTerm(option), helper.optionDescription(option));
310
+ });
311
+ if (optionList.length > 0) {
312
+ output = output.concat(["Options:", formatList(optionList), ""]);
313
+ }
314
+ if (this.showGlobalOptions) {
315
+ const globalOptionList = helper.visibleGlobalOptions(cmd).map((option) => {
316
+ return formatItem(helper.optionTerm(option), helper.optionDescription(option));
317
+ });
318
+ if (globalOptionList.length > 0) {
319
+ output = output.concat([
320
+ "Global Options:",
321
+ formatList(globalOptionList),
322
+ ""
323
+ ]);
324
+ }
325
+ }
326
+ const commandList = helper.visibleCommands(cmd).map((cmd) => {
327
+ return formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd));
328
+ });
329
+ if (commandList.length > 0) {
330
+ output = output.concat(["Commands:", formatList(commandList), ""]);
331
+ }
332
+ return output.join(`
333
+ `);
334
+ }
335
+ padWidth(cmd, helper) {
336
+ return Math.max(helper.longestOptionTermLength(cmd, helper), helper.longestGlobalOptionTermLength(cmd, helper), helper.longestSubcommandTermLength(cmd, helper), helper.longestArgumentTermLength(cmd, helper));
337
+ }
338
+ wrap(str, width, indent, minColumnWidth = 40) {
339
+ const indents = " \\f\\t\\v   -    \uFEFF";
340
+ const manualIndent = new RegExp(`[\\n][${indents}]+`);
341
+ if (str.match(manualIndent))
342
+ return str;
343
+ const columnWidth = width - indent;
344
+ if (columnWidth < minColumnWidth)
345
+ return str;
346
+ const leadingStr = str.slice(0, indent);
347
+ const columnText = str.slice(indent).replace(`\r
348
+ `, `
349
+ `);
350
+ const indentString = " ".repeat(indent);
351
+ const zeroWidthSpace = "​";
352
+ const breaks = `\\s${zeroWidthSpace}`;
353
+ const regex = new RegExp(`
354
+ |.{1,${columnWidth - 1}}([${breaks}]|$)|[^${breaks}]+?([${breaks}]|$)`, "g");
355
+ const lines = columnText.match(regex) || [];
356
+ return leadingStr + lines.map((line, i) => {
357
+ if (line === `
358
+ `)
359
+ return "";
360
+ return (i > 0 ? indentString : "") + line.trimEnd();
361
+ }).join(`
362
+ `);
363
+ }
364
+ }
365
+ exports.Help = Help;
366
+ });
367
+
368
+ // ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/option.js
369
+ var require_option = __commonJS(function(exports) {
370
+ var { InvalidArgumentError } = require_error();
371
+
372
+ class Option {
373
+ constructor(flags, description) {
374
+ this.flags = flags;
375
+ this.description = description || "";
376
+ this.required = flags.includes("<");
377
+ this.optional = flags.includes("[");
378
+ this.variadic = /\w\.\.\.[>\]]$/.test(flags);
379
+ this.mandatory = false;
380
+ const optionFlags = splitOptionFlags(flags);
381
+ this.short = optionFlags.shortFlag;
382
+ this.long = optionFlags.longFlag;
383
+ this.negate = false;
384
+ if (this.long) {
385
+ this.negate = this.long.startsWith("--no-");
386
+ }
387
+ this.defaultValue = undefined;
388
+ this.defaultValueDescription = undefined;
389
+ this.presetArg = undefined;
390
+ this.envVar = undefined;
391
+ this.parseArg = undefined;
392
+ this.hidden = false;
393
+ this.argChoices = undefined;
394
+ this.conflictsWith = [];
395
+ this.implied = undefined;
396
+ }
397
+ default(value, description) {
398
+ this.defaultValue = value;
399
+ this.defaultValueDescription = description;
400
+ return this;
401
+ }
402
+ preset(arg) {
403
+ this.presetArg = arg;
404
+ return this;
405
+ }
406
+ conflicts(names) {
407
+ this.conflictsWith = this.conflictsWith.concat(names);
408
+ return this;
409
+ }
410
+ implies(impliedOptionValues) {
411
+ let newImplied = impliedOptionValues;
412
+ if (typeof impliedOptionValues === "string") {
413
+ newImplied = { [impliedOptionValues]: true };
414
+ }
415
+ this.implied = Object.assign(this.implied || {}, newImplied);
416
+ return this;
417
+ }
418
+ env(name) {
419
+ this.envVar = name;
420
+ return this;
421
+ }
422
+ argParser(fn) {
423
+ this.parseArg = fn;
424
+ return this;
425
+ }
426
+ makeOptionMandatory(mandatory = true) {
427
+ this.mandatory = !!mandatory;
428
+ return this;
429
+ }
430
+ hideHelp(hide = true) {
431
+ this.hidden = !!hide;
432
+ return this;
433
+ }
434
+ _concatValue(value, previous) {
435
+ if (previous === this.defaultValue || !Array.isArray(previous)) {
436
+ return [value];
437
+ }
438
+ return previous.concat(value);
439
+ }
440
+ choices(values) {
441
+ this.argChoices = values.slice();
442
+ this.parseArg = (arg, previous) => {
443
+ if (!this.argChoices.includes(arg)) {
444
+ throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
445
+ }
446
+ if (this.variadic) {
447
+ return this._concatValue(arg, previous);
448
+ }
449
+ return arg;
450
+ };
451
+ return this;
452
+ }
453
+ name() {
454
+ if (this.long) {
455
+ return this.long.replace(/^--/, "");
456
+ }
457
+ return this.short.replace(/^-/, "");
458
+ }
459
+ attributeName() {
460
+ return camelcase(this.name().replace(/^no-/, ""));
461
+ }
462
+ is(arg) {
463
+ return this.short === arg || this.long === arg;
464
+ }
465
+ isBoolean() {
466
+ return !this.required && !this.optional && !this.negate;
467
+ }
468
+ }
469
+
470
+ class DualOptions {
471
+ constructor(options) {
472
+ this.positiveOptions = new Map;
473
+ this.negativeOptions = new Map;
474
+ this.dualOptions = new Set;
475
+ options.forEach((option) => {
476
+ if (option.negate) {
477
+ this.negativeOptions.set(option.attributeName(), option);
478
+ } else {
479
+ this.positiveOptions.set(option.attributeName(), option);
480
+ }
481
+ });
482
+ this.negativeOptions.forEach((value, key) => {
483
+ if (this.positiveOptions.has(key)) {
484
+ this.dualOptions.add(key);
485
+ }
486
+ });
487
+ }
488
+ valueFromOption(value, option) {
489
+ const optionKey = option.attributeName();
490
+ if (!this.dualOptions.has(optionKey))
491
+ return true;
492
+ const preset = this.negativeOptions.get(optionKey).presetArg;
493
+ const negativeValue = preset !== undefined ? preset : false;
494
+ return option.negate === (negativeValue === value);
495
+ }
496
+ }
497
+ function camelcase(str) {
498
+ return str.split("-").reduce((str, word) => {
499
+ return str + word[0].toUpperCase() + word.slice(1);
500
+ });
501
+ }
502
+ function splitOptionFlags(flags) {
503
+ let shortFlag;
504
+ let longFlag;
505
+ const flagParts = flags.split(/[ |,]+/);
506
+ if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1]))
507
+ shortFlag = flagParts.shift();
508
+ longFlag = flagParts.shift();
509
+ if (!shortFlag && /^-[^-]$/.test(longFlag)) {
510
+ shortFlag = longFlag;
511
+ longFlag = undefined;
512
+ }
513
+ return { shortFlag, longFlag };
514
+ }
515
+ exports.Option = Option;
516
+ exports.DualOptions = DualOptions;
517
+ });
518
+
519
+ // ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js
520
+ var require_suggestSimilar = __commonJS(function(exports) {
521
+ var maxDistance = 3;
522
+ function editDistance(a, b) {
523
+ if (Math.abs(a.length - b.length) > maxDistance)
524
+ return Math.max(a.length, b.length);
525
+ const d = [];
526
+ for (let i = 0;i <= a.length; i++) {
527
+ d[i] = [i];
528
+ }
529
+ for (let j = 0;j <= b.length; j++) {
530
+ d[0][j] = j;
531
+ }
532
+ for (let j = 1;j <= b.length; j++) {
533
+ for (let i = 1;i <= a.length; i++) {
534
+ let cost = 1;
535
+ if (a[i - 1] === b[j - 1]) {
536
+ cost = 0;
537
+ } else {
538
+ cost = 1;
539
+ }
540
+ d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
541
+ if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
542
+ d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
543
+ }
544
+ }
545
+ }
546
+ return d[a.length][b.length];
547
+ }
548
+ function suggestSimilar(word, candidates) {
549
+ if (!candidates || candidates.length === 0)
550
+ return "";
551
+ candidates = Array.from(new Set(candidates));
552
+ const searchingOptions = word.startsWith("--");
553
+ if (searchingOptions) {
554
+ word = word.slice(2);
555
+ candidates = candidates.map((candidate) => candidate.slice(2));
556
+ }
557
+ let similar = [];
558
+ let bestDistance = maxDistance;
559
+ const minSimilarity = 0.4;
560
+ candidates.forEach((candidate) => {
561
+ if (candidate.length <= 1)
562
+ return;
563
+ const distance = editDistance(word, candidate);
564
+ const length = Math.max(word.length, candidate.length);
565
+ const similarity = (length - distance) / length;
566
+ if (similarity > minSimilarity) {
567
+ if (distance < bestDistance) {
568
+ bestDistance = distance;
569
+ similar = [candidate];
570
+ } else if (distance === bestDistance) {
571
+ similar.push(candidate);
572
+ }
573
+ }
574
+ });
575
+ similar.sort((a, b) => a.localeCompare(b));
576
+ if (searchingOptions) {
577
+ similar = similar.map((candidate) => `--${candidate}`);
578
+ }
579
+ if (similar.length > 1) {
580
+ return `
581
+ (Did you mean one of ${similar.join(", ")}?)`;
582
+ }
583
+ if (similar.length === 1) {
584
+ return `
585
+ (Did you mean ${similar[0]}?)`;
586
+ }
587
+ return "";
588
+ }
589
+ exports.suggestSimilar = suggestSimilar;
590
+ });
591
+
592
+ // ../../node_modules/.bun/commander@12.1.0/node_modules/commander/lib/command.js
593
+ var require_command = __commonJS(function(exports) {
594
+ var EventEmitter = __require("node:events").EventEmitter;
595
+ var childProcess = __require("node:child_process");
596
+ var path = __require("node:path");
597
+ var fs = __require("node:fs");
598
+ var process2 = __require("node:process");
599
+ var { Argument, humanReadableArgName } = require_argument();
600
+ var { CommanderError } = require_error();
601
+ var { Help } = require_help();
602
+ var { Option, DualOptions } = require_option();
603
+ var { suggestSimilar } = require_suggestSimilar();
604
+
605
+ class Command extends EventEmitter {
606
+ constructor(name) {
607
+ super();
608
+ this.commands = [];
609
+ this.options = [];
610
+ this.parent = null;
611
+ this._allowUnknownOption = false;
612
+ this._allowExcessArguments = true;
613
+ this.registeredArguments = [];
614
+ this._args = this.registeredArguments;
615
+ this.args = [];
616
+ this.rawArgs = [];
617
+ this.processedArgs = [];
618
+ this._scriptPath = null;
619
+ this._name = name || "";
620
+ this._optionValues = {};
621
+ this._optionValueSources = {};
622
+ this._storeOptionsAsProperties = false;
623
+ this._actionHandler = null;
624
+ this._executableHandler = false;
625
+ this._executableFile = null;
626
+ this._executableDir = null;
627
+ this._defaultCommandName = null;
628
+ this._exitCallback = null;
629
+ this._aliases = [];
630
+ this._combineFlagAndOptionalValue = true;
631
+ this._description = "";
632
+ this._summary = "";
633
+ this._argsDescription = undefined;
634
+ this._enablePositionalOptions = false;
635
+ this._passThroughOptions = false;
636
+ this._lifeCycleHooks = {};
637
+ this._showHelpAfterError = false;
638
+ this._showSuggestionAfterError = true;
639
+ this._outputConfiguration = {
640
+ writeOut: (str) => process2.stdout.write(str),
641
+ writeErr: (str) => process2.stderr.write(str),
642
+ getOutHelpWidth: () => process2.stdout.isTTY ? process2.stdout.columns : undefined,
643
+ getErrHelpWidth: () => process2.stderr.isTTY ? process2.stderr.columns : undefined,
644
+ outputError: (str, write) => write(str)
645
+ };
646
+ this._hidden = false;
647
+ this._helpOption = undefined;
648
+ this._addImplicitHelpCommand = undefined;
649
+ this._helpCommand = undefined;
650
+ this._helpConfiguration = {};
651
+ }
652
+ copyInheritedSettings(sourceCommand) {
653
+ this._outputConfiguration = sourceCommand._outputConfiguration;
654
+ this._helpOption = sourceCommand._helpOption;
655
+ this._helpCommand = sourceCommand._helpCommand;
656
+ this._helpConfiguration = sourceCommand._helpConfiguration;
657
+ this._exitCallback = sourceCommand._exitCallback;
658
+ this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;
659
+ this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue;
660
+ this._allowExcessArguments = sourceCommand._allowExcessArguments;
661
+ this._enablePositionalOptions = sourceCommand._enablePositionalOptions;
662
+ this._showHelpAfterError = sourceCommand._showHelpAfterError;
663
+ this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;
664
+ return this;
665
+ }
666
+ _getCommandAndAncestors() {
667
+ const result = [];
668
+ for (let command = this;command; command = command.parent) {
669
+ result.push(command);
670
+ }
671
+ return result;
672
+ }
673
+ command(nameAndArgs, actionOptsOrExecDesc, execOpts) {
674
+ let desc = actionOptsOrExecDesc;
675
+ let opts = execOpts;
676
+ if (typeof desc === "object" && desc !== null) {
677
+ opts = desc;
678
+ desc = null;
679
+ }
680
+ opts = opts || {};
681
+ const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);
682
+ const cmd = this.createCommand(name);
683
+ if (desc) {
684
+ cmd.description(desc);
685
+ cmd._executableHandler = true;
686
+ }
687
+ if (opts.isDefault)
688
+ this._defaultCommandName = cmd._name;
689
+ cmd._hidden = !!(opts.noHelp || opts.hidden);
690
+ cmd._executableFile = opts.executableFile || null;
691
+ if (args)
692
+ cmd.arguments(args);
693
+ this._registerCommand(cmd);
694
+ cmd.parent = this;
695
+ cmd.copyInheritedSettings(this);
696
+ if (desc)
697
+ return this;
698
+ return cmd;
699
+ }
700
+ createCommand(name) {
701
+ return new Command(name);
702
+ }
703
+ createHelp() {
704
+ return Object.assign(new Help, this.configureHelp());
705
+ }
706
+ configureHelp(configuration) {
707
+ if (configuration === undefined)
708
+ return this._helpConfiguration;
709
+ this._helpConfiguration = configuration;
710
+ return this;
711
+ }
712
+ configureOutput(configuration) {
713
+ if (configuration === undefined)
714
+ return this._outputConfiguration;
715
+ Object.assign(this._outputConfiguration, configuration);
716
+ return this;
717
+ }
718
+ showHelpAfterError(displayHelp = true) {
719
+ if (typeof displayHelp !== "string")
720
+ displayHelp = !!displayHelp;
721
+ this._showHelpAfterError = displayHelp;
722
+ return this;
723
+ }
724
+ showSuggestionAfterError(displaySuggestion = true) {
725
+ this._showSuggestionAfterError = !!displaySuggestion;
726
+ return this;
727
+ }
728
+ addCommand(cmd, opts) {
729
+ if (!cmd._name) {
730
+ throw new Error(`Command passed to .addCommand() must have a name
731
+ - specify the name in Command constructor or using .name()`);
732
+ }
733
+ opts = opts || {};
734
+ if (opts.isDefault)
735
+ this._defaultCommandName = cmd._name;
736
+ if (opts.noHelp || opts.hidden)
737
+ cmd._hidden = true;
738
+ this._registerCommand(cmd);
739
+ cmd.parent = this;
740
+ cmd._checkForBrokenPassThrough();
741
+ return this;
742
+ }
743
+ createArgument(name, description) {
744
+ return new Argument(name, description);
745
+ }
746
+ argument(name, description, fn, defaultValue) {
747
+ const argument = this.createArgument(name, description);
748
+ if (typeof fn === "function") {
749
+ argument.default(defaultValue).argParser(fn);
750
+ } else {
751
+ argument.default(fn);
752
+ }
753
+ this.addArgument(argument);
754
+ return this;
755
+ }
756
+ arguments(names) {
757
+ names.trim().split(/ +/).forEach((detail) => {
758
+ this.argument(detail);
759
+ });
760
+ return this;
761
+ }
762
+ addArgument(argument) {
763
+ const previousArgument = this.registeredArguments.slice(-1)[0];
764
+ if (previousArgument && previousArgument.variadic) {
765
+ throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
766
+ }
767
+ if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
768
+ throw new Error(`a default value for a required argument is never used: '${argument.name()}'`);
769
+ }
770
+ this.registeredArguments.push(argument);
771
+ return this;
772
+ }
773
+ helpCommand(enableOrNameAndArgs, description) {
774
+ if (typeof enableOrNameAndArgs === "boolean") {
775
+ this._addImplicitHelpCommand = enableOrNameAndArgs;
776
+ return this;
777
+ }
778
+ enableOrNameAndArgs = enableOrNameAndArgs ?? "help [command]";
779
+ const [, helpName, helpArgs] = enableOrNameAndArgs.match(/([^ ]+) *(.*)/);
780
+ const helpDescription = description ?? "display help for command";
781
+ const helpCommand = this.createCommand(helpName);
782
+ helpCommand.helpOption(false);
783
+ if (helpArgs)
784
+ helpCommand.arguments(helpArgs);
785
+ if (helpDescription)
786
+ helpCommand.description(helpDescription);
787
+ this._addImplicitHelpCommand = true;
788
+ this._helpCommand = helpCommand;
789
+ return this;
790
+ }
791
+ addHelpCommand(helpCommand, deprecatedDescription) {
792
+ if (typeof helpCommand !== "object") {
793
+ this.helpCommand(helpCommand, deprecatedDescription);
794
+ return this;
795
+ }
796
+ this._addImplicitHelpCommand = true;
797
+ this._helpCommand = helpCommand;
798
+ return this;
799
+ }
800
+ _getHelpCommand() {
801
+ const hasImplicitHelpCommand = this._addImplicitHelpCommand ?? (this.commands.length && !this._actionHandler && !this._findCommand("help"));
802
+ if (hasImplicitHelpCommand) {
803
+ if (this._helpCommand === undefined) {
804
+ this.helpCommand(undefined, undefined);
805
+ }
806
+ return this._helpCommand;
807
+ }
808
+ return null;
809
+ }
810
+ hook(event, listener) {
811
+ const allowedValues = ["preSubcommand", "preAction", "postAction"];
812
+ if (!allowedValues.includes(event)) {
813
+ throw new Error(`Unexpected value for event passed to hook : '${event}'.
814
+ Expecting one of '${allowedValues.join("', '")}'`);
815
+ }
816
+ if (this._lifeCycleHooks[event]) {
817
+ this._lifeCycleHooks[event].push(listener);
818
+ } else {
819
+ this._lifeCycleHooks[event] = [listener];
820
+ }
821
+ return this;
822
+ }
823
+ exitOverride(fn) {
824
+ if (fn) {
825
+ this._exitCallback = fn;
826
+ } else {
827
+ this._exitCallback = (err) => {
828
+ if (err.code !== "commander.executeSubCommandAsync") {
829
+ throw err;
830
+ }
831
+ };
832
+ }
833
+ return this;
834
+ }
835
+ _exit(exitCode, code, message) {
836
+ if (this._exitCallback) {
837
+ this._exitCallback(new CommanderError(exitCode, code, message));
838
+ }
839
+ process2.exit(exitCode);
840
+ }
841
+ action(fn) {
842
+ const listener = (args) => {
843
+ const expectedArgsCount = this.registeredArguments.length;
844
+ const actionArgs = args.slice(0, expectedArgsCount);
845
+ if (this._storeOptionsAsProperties) {
846
+ actionArgs[expectedArgsCount] = this;
847
+ } else {
848
+ actionArgs[expectedArgsCount] = this.opts();
849
+ }
850
+ actionArgs.push(this);
851
+ return fn.apply(this, actionArgs);
852
+ };
853
+ this._actionHandler = listener;
854
+ return this;
855
+ }
856
+ createOption(flags, description) {
857
+ return new Option(flags, description);
858
+ }
859
+ _callParseArg(target, value, previous, invalidArgumentMessage) {
860
+ try {
861
+ return target.parseArg(value, previous);
862
+ } catch (err) {
863
+ if (err.code === "commander.invalidArgument") {
864
+ const message = `${invalidArgumentMessage} ${err.message}`;
865
+ this.error(message, { exitCode: err.exitCode, code: err.code });
866
+ }
867
+ throw err;
868
+ }
869
+ }
870
+ _registerOption(option) {
871
+ const matchingOption = option.short && this._findOption(option.short) || option.long && this._findOption(option.long);
872
+ if (matchingOption) {
873
+ const matchingFlag = option.long && this._findOption(option.long) ? option.long : option.short;
874
+ throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'
875
+ - already used by option '${matchingOption.flags}'`);
876
+ }
877
+ this.options.push(option);
878
+ }
879
+ _registerCommand(command) {
880
+ const knownBy = (cmd) => {
881
+ return [cmd.name()].concat(cmd.aliases());
882
+ };
883
+ const alreadyUsed = knownBy(command).find((name) => this._findCommand(name));
884
+ if (alreadyUsed) {
885
+ const existingCmd = knownBy(this._findCommand(alreadyUsed)).join("|");
886
+ const newCmd = knownBy(command).join("|");
887
+ throw new Error(`cannot add command '${newCmd}' as already have command '${existingCmd}'`);
888
+ }
889
+ this.commands.push(command);
890
+ }
891
+ addOption(option) {
892
+ this._registerOption(option);
893
+ const oname = option.name();
894
+ const name = option.attributeName();
895
+ if (option.negate) {
896
+ const positiveLongFlag = option.long.replace(/^--no-/, "--");
897
+ if (!this._findOption(positiveLongFlag)) {
898
+ this.setOptionValueWithSource(name, option.defaultValue === undefined ? true : option.defaultValue, "default");
899
+ }
900
+ } else if (option.defaultValue !== undefined) {
901
+ this.setOptionValueWithSource(name, option.defaultValue, "default");
902
+ }
903
+ const handleOptionValue = (val, invalidValueMessage, valueSource) => {
904
+ if (val == null && option.presetArg !== undefined) {
905
+ val = option.presetArg;
906
+ }
907
+ const oldValue = this.getOptionValue(name);
908
+ if (val !== null && option.parseArg) {
909
+ val = this._callParseArg(option, val, oldValue, invalidValueMessage);
910
+ } else if (val !== null && option.variadic) {
911
+ val = option._concatValue(val, oldValue);
912
+ }
913
+ if (val == null) {
914
+ if (option.negate) {
915
+ val = false;
916
+ } else if (option.isBoolean() || option.optional) {
917
+ val = true;
918
+ } else {
919
+ val = "";
920
+ }
921
+ }
922
+ this.setOptionValueWithSource(name, val, valueSource);
923
+ };
924
+ this.on("option:" + oname, (val) => {
925
+ const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;
926
+ handleOptionValue(val, invalidValueMessage, "cli");
927
+ });
928
+ if (option.envVar) {
929
+ this.on("optionEnv:" + oname, (val) => {
930
+ const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;
931
+ handleOptionValue(val, invalidValueMessage, "env");
932
+ });
933
+ }
934
+ return this;
935
+ }
936
+ _optionEx(config, flags, description, fn, defaultValue) {
937
+ if (typeof flags === "object" && flags instanceof Option) {
938
+ throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");
939
+ }
940
+ const option = this.createOption(flags, description);
941
+ option.makeOptionMandatory(!!config.mandatory);
942
+ if (typeof fn === "function") {
943
+ option.default(defaultValue).argParser(fn);
944
+ } else if (fn instanceof RegExp) {
945
+ const regex = fn;
946
+ fn = (val, def) => {
947
+ const m = regex.exec(val);
948
+ return m ? m[0] : def;
949
+ };
950
+ option.default(defaultValue).argParser(fn);
951
+ } else {
952
+ option.default(fn);
953
+ }
954
+ return this.addOption(option);
955
+ }
956
+ option(flags, description, parseArg, defaultValue) {
957
+ return this._optionEx({}, flags, description, parseArg, defaultValue);
958
+ }
959
+ requiredOption(flags, description, parseArg, defaultValue) {
960
+ return this._optionEx({ mandatory: true }, flags, description, parseArg, defaultValue);
961
+ }
962
+ combineFlagAndOptionalValue(combine = true) {
963
+ this._combineFlagAndOptionalValue = !!combine;
964
+ return this;
965
+ }
966
+ allowUnknownOption(allowUnknown = true) {
967
+ this._allowUnknownOption = !!allowUnknown;
968
+ return this;
969
+ }
970
+ allowExcessArguments(allowExcess = true) {
971
+ this._allowExcessArguments = !!allowExcess;
972
+ return this;
973
+ }
974
+ enablePositionalOptions(positional = true) {
975
+ this._enablePositionalOptions = !!positional;
976
+ return this;
977
+ }
978
+ passThroughOptions(passThrough = true) {
979
+ this._passThroughOptions = !!passThrough;
980
+ this._checkForBrokenPassThrough();
981
+ return this;
982
+ }
983
+ _checkForBrokenPassThrough() {
984
+ if (this.parent && this._passThroughOptions && !this.parent._enablePositionalOptions) {
985
+ throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`);
986
+ }
987
+ }
988
+ storeOptionsAsProperties(storeAsProperties = true) {
989
+ if (this.options.length) {
990
+ throw new Error("call .storeOptionsAsProperties() before adding options");
991
+ }
992
+ if (Object.keys(this._optionValues).length) {
993
+ throw new Error("call .storeOptionsAsProperties() before setting option values");
994
+ }
995
+ this._storeOptionsAsProperties = !!storeAsProperties;
996
+ return this;
997
+ }
998
+ getOptionValue(key) {
999
+ if (this._storeOptionsAsProperties) {
1000
+ return this[key];
1001
+ }
1002
+ return this._optionValues[key];
1003
+ }
1004
+ setOptionValue(key, value) {
1005
+ return this.setOptionValueWithSource(key, value, undefined);
1006
+ }
1007
+ setOptionValueWithSource(key, value, source) {
1008
+ if (this._storeOptionsAsProperties) {
1009
+ this[key] = value;
1010
+ } else {
1011
+ this._optionValues[key] = value;
1012
+ }
1013
+ this._optionValueSources[key] = source;
1014
+ return this;
1015
+ }
1016
+ getOptionValueSource(key) {
1017
+ return this._optionValueSources[key];
1018
+ }
1019
+ getOptionValueSourceWithGlobals(key) {
1020
+ let source;
1021
+ this._getCommandAndAncestors().forEach((cmd) => {
1022
+ if (cmd.getOptionValueSource(key) !== undefined) {
1023
+ source = cmd.getOptionValueSource(key);
1024
+ }
1025
+ });
1026
+ return source;
1027
+ }
1028
+ _prepareUserArgs(argv2, parseOptions) {
1029
+ if (argv2 !== undefined && !Array.isArray(argv2)) {
1030
+ throw new Error("first parameter to parse must be array or undefined");
1031
+ }
1032
+ parseOptions = parseOptions || {};
1033
+ if (argv2 === undefined && parseOptions.from === undefined) {
1034
+ if (process2.versions?.electron) {
1035
+ parseOptions.from = "electron";
1036
+ }
1037
+ const execArgv2 = process2.execArgv ?? [];
1038
+ if (execArgv2.includes("-e") || execArgv2.includes("--eval") || execArgv2.includes("-p") || execArgv2.includes("--print")) {
1039
+ parseOptions.from = "eval";
1040
+ }
1041
+ }
1042
+ if (argv2 === undefined) {
1043
+ argv2 = process2.argv;
1044
+ }
1045
+ this.rawArgs = argv2.slice();
1046
+ let userArgs;
1047
+ switch (parseOptions.from) {
1048
+ case undefined:
1049
+ case "node":
1050
+ this._scriptPath = argv2[1];
1051
+ userArgs = argv2.slice(2);
1052
+ break;
1053
+ case "electron":
1054
+ if (process2.defaultApp) {
1055
+ this._scriptPath = argv2[1];
1056
+ userArgs = argv2.slice(2);
1057
+ } else {
1058
+ userArgs = argv2.slice(1);
1059
+ }
1060
+ break;
1061
+ case "user":
1062
+ userArgs = argv2.slice(0);
1063
+ break;
1064
+ case "eval":
1065
+ userArgs = argv2.slice(1);
1066
+ break;
1067
+ default:
1068
+ throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
1069
+ }
1070
+ if (!this._name && this._scriptPath)
1071
+ this.nameFromFilename(this._scriptPath);
1072
+ this._name = this._name || "program";
1073
+ return userArgs;
1074
+ }
1075
+ parse(argv, parseOptions) {
1076
+ const userArgs = this._prepareUserArgs(argv, parseOptions);
1077
+ this._parseCommand([], userArgs);
1078
+ return this;
1079
+ }
1080
+ async parseAsync(argv, parseOptions) {
1081
+ const userArgs = this._prepareUserArgs(argv, parseOptions);
1082
+ await this._parseCommand([], userArgs);
1083
+ return this;
1084
+ }
1085
+ _executeSubCommand(subcommand, args) {
1086
+ args = args.slice();
1087
+ let launchWithNode = false;
1088
+ const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
1089
+ function findFile(baseDir, baseName) {
1090
+ const localBin = path.resolve(baseDir, baseName);
1091
+ if (fs.existsSync(localBin))
1092
+ return localBin;
1093
+ if (sourceExt.includes(path.extname(baseName)))
1094
+ return;
1095
+ const foundExt = sourceExt.find((ext) => fs.existsSync(`${localBin}${ext}`));
1096
+ if (foundExt)
1097
+ return `${localBin}${foundExt}`;
1098
+ return;
1099
+ }
1100
+ this._checkForMissingMandatoryOptions();
1101
+ this._checkForConflictingOptions();
1102
+ let executableFile = subcommand._executableFile || `${this._name}-${subcommand._name}`;
1103
+ let executableDir = this._executableDir || "";
1104
+ if (this._scriptPath) {
1105
+ let resolvedScriptPath;
1106
+ try {
1107
+ resolvedScriptPath = fs.realpathSync(this._scriptPath);
1108
+ } catch (err) {
1109
+ resolvedScriptPath = this._scriptPath;
1110
+ }
1111
+ executableDir = path.resolve(path.dirname(resolvedScriptPath), executableDir);
1112
+ }
1113
+ if (executableDir) {
1114
+ let localFile = findFile(executableDir, executableFile);
1115
+ if (!localFile && !subcommand._executableFile && this._scriptPath) {
1116
+ const legacyName = path.basename(this._scriptPath, path.extname(this._scriptPath));
1117
+ if (legacyName !== this._name) {
1118
+ localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
1119
+ }
1120
+ }
1121
+ executableFile = localFile || executableFile;
1122
+ }
1123
+ launchWithNode = sourceExt.includes(path.extname(executableFile));
1124
+ let proc;
1125
+ if (process2.platform !== "win32") {
1126
+ if (launchWithNode) {
1127
+ args.unshift(executableFile);
1128
+ args = incrementNodeInspectorPort(process2.execArgv).concat(args);
1129
+ proc = childProcess.spawn(process2.argv[0], args, { stdio: "inherit" });
1130
+ } else {
1131
+ proc = childProcess.spawn(executableFile, args, { stdio: "inherit" });
1132
+ }
1133
+ } else {
1134
+ args.unshift(executableFile);
1135
+ args = incrementNodeInspectorPort(process2.execArgv).concat(args);
1136
+ proc = childProcess.spawn(process2.execPath, args, { stdio: "inherit" });
1137
+ }
1138
+ if (!proc.killed) {
1139
+ const signals = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
1140
+ signals.forEach((signal) => {
1141
+ process2.on(signal, () => {
1142
+ if (proc.killed === false && proc.exitCode === null) {
1143
+ proc.kill(signal);
1144
+ }
1145
+ });
1146
+ });
1147
+ }
1148
+ const exitCallback = this._exitCallback;
1149
+ proc.on("close", (code) => {
1150
+ code = code ?? 1;
1151
+ if (!exitCallback) {
1152
+ process2.exit(code);
1153
+ } else {
1154
+ exitCallback(new CommanderError(code, "commander.executeSubCommandAsync", "(close)"));
1155
+ }
1156
+ });
1157
+ proc.on("error", (err) => {
1158
+ if (err.code === "ENOENT") {
1159
+ const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
1160
+ const executableMissing = `'${executableFile}' does not exist
1161
+ - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
1162
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
1163
+ - ${executableDirMessage}`;
1164
+ throw new Error(executableMissing);
1165
+ } else if (err.code === "EACCES") {
1166
+ throw new Error(`'${executableFile}' not executable`);
1167
+ }
1168
+ if (!exitCallback) {
1169
+ process2.exit(1);
1170
+ } else {
1171
+ const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
1172
+ wrappedError.nestedError = err;
1173
+ exitCallback(wrappedError);
1174
+ }
1175
+ });
1176
+ this.runningCommand = proc;
1177
+ }
1178
+ _dispatchSubcommand(commandName, operands, unknown) {
1179
+ const subCommand = this._findCommand(commandName);
1180
+ if (!subCommand)
1181
+ this.help({ error: true });
1182
+ let promiseChain;
1183
+ promiseChain = this._chainOrCallSubCommandHook(promiseChain, subCommand, "preSubcommand");
1184
+ promiseChain = this._chainOrCall(promiseChain, () => {
1185
+ if (subCommand._executableHandler) {
1186
+ this._executeSubCommand(subCommand, operands.concat(unknown));
1187
+ } else {
1188
+ return subCommand._parseCommand(operands, unknown);
1189
+ }
1190
+ });
1191
+ return promiseChain;
1192
+ }
1193
+ _dispatchHelpCommand(subcommandName) {
1194
+ if (!subcommandName) {
1195
+ this.help();
1196
+ }
1197
+ const subCommand = this._findCommand(subcommandName);
1198
+ if (subCommand && !subCommand._executableHandler) {
1199
+ subCommand.help();
1200
+ }
1201
+ return this._dispatchSubcommand(subcommandName, [], [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? "--help"]);
1202
+ }
1203
+ _checkNumberOfArguments() {
1204
+ this.registeredArguments.forEach((arg, i) => {
1205
+ if (arg.required && this.args[i] == null) {
1206
+ this.missingArgument(arg.name());
1207
+ }
1208
+ });
1209
+ if (this.registeredArguments.length > 0 && this.registeredArguments[this.registeredArguments.length - 1].variadic) {
1210
+ return;
1211
+ }
1212
+ if (this.args.length > this.registeredArguments.length) {
1213
+ this._excessArguments(this.args);
1214
+ }
1215
+ }
1216
+ _processArguments() {
1217
+ const myParseArg = (argument, value, previous) => {
1218
+ let parsedValue = value;
1219
+ if (value !== null && argument.parseArg) {
1220
+ const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;
1221
+ parsedValue = this._callParseArg(argument, value, previous, invalidValueMessage);
1222
+ }
1223
+ return parsedValue;
1224
+ };
1225
+ this._checkNumberOfArguments();
1226
+ const processedArgs = [];
1227
+ this.registeredArguments.forEach((declaredArg, index) => {
1228
+ let value = declaredArg.defaultValue;
1229
+ if (declaredArg.variadic) {
1230
+ if (index < this.args.length) {
1231
+ value = this.args.slice(index);
1232
+ if (declaredArg.parseArg) {
1233
+ value = value.reduce((processed, v) => {
1234
+ return myParseArg(declaredArg, v, processed);
1235
+ }, declaredArg.defaultValue);
1236
+ }
1237
+ } else if (value === undefined) {
1238
+ value = [];
1239
+ }
1240
+ } else if (index < this.args.length) {
1241
+ value = this.args[index];
1242
+ if (declaredArg.parseArg) {
1243
+ value = myParseArg(declaredArg, value, declaredArg.defaultValue);
1244
+ }
1245
+ }
1246
+ processedArgs[index] = value;
1247
+ });
1248
+ this.processedArgs = processedArgs;
1249
+ }
1250
+ _chainOrCall(promise, fn) {
1251
+ if (promise && promise.then && typeof promise.then === "function") {
1252
+ return promise.then(() => fn());
1253
+ }
1254
+ return fn();
1255
+ }
1256
+ _chainOrCallHooks(promise, event) {
1257
+ let result = promise;
1258
+ const hooks = [];
1259
+ this._getCommandAndAncestors().reverse().filter((cmd) => cmd._lifeCycleHooks[event] !== undefined).forEach((hookedCommand) => {
1260
+ hookedCommand._lifeCycleHooks[event].forEach((callback) => {
1261
+ hooks.push({ hookedCommand, callback });
1262
+ });
1263
+ });
1264
+ if (event === "postAction") {
1265
+ hooks.reverse();
1266
+ }
1267
+ hooks.forEach((hookDetail) => {
1268
+ result = this._chainOrCall(result, () => {
1269
+ return hookDetail.callback(hookDetail.hookedCommand, this);
1270
+ });
1271
+ });
1272
+ return result;
1273
+ }
1274
+ _chainOrCallSubCommandHook(promise, subCommand, event) {
1275
+ let result = promise;
1276
+ if (this._lifeCycleHooks[event] !== undefined) {
1277
+ this._lifeCycleHooks[event].forEach((hook) => {
1278
+ result = this._chainOrCall(result, () => {
1279
+ return hook(this, subCommand);
1280
+ });
1281
+ });
1282
+ }
1283
+ return result;
1284
+ }
1285
+ _parseCommand(operands, unknown) {
1286
+ const parsed = this.parseOptions(unknown);
1287
+ this._parseOptionsEnv();
1288
+ this._parseOptionsImplied();
1289
+ operands = operands.concat(parsed.operands);
1290
+ unknown = parsed.unknown;
1291
+ this.args = operands.concat(unknown);
1292
+ if (operands && this._findCommand(operands[0])) {
1293
+ return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);
1294
+ }
1295
+ if (this._getHelpCommand() && operands[0] === this._getHelpCommand().name()) {
1296
+ return this._dispatchHelpCommand(operands[1]);
1297
+ }
1298
+ if (this._defaultCommandName) {
1299
+ this._outputHelpIfRequested(unknown);
1300
+ return this._dispatchSubcommand(this._defaultCommandName, operands, unknown);
1301
+ }
1302
+ if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
1303
+ this.help({ error: true });
1304
+ }
1305
+ this._outputHelpIfRequested(parsed.unknown);
1306
+ this._checkForMissingMandatoryOptions();
1307
+ this._checkForConflictingOptions();
1308
+ const checkForUnknownOptions = () => {
1309
+ if (parsed.unknown.length > 0) {
1310
+ this.unknownOption(parsed.unknown[0]);
1311
+ }
1312
+ };
1313
+ const commandEvent = `command:${this.name()}`;
1314
+ if (this._actionHandler) {
1315
+ checkForUnknownOptions();
1316
+ this._processArguments();
1317
+ let promiseChain;
1318
+ promiseChain = this._chainOrCallHooks(promiseChain, "preAction");
1319
+ promiseChain = this._chainOrCall(promiseChain, () => this._actionHandler(this.processedArgs));
1320
+ if (this.parent) {
1321
+ promiseChain = this._chainOrCall(promiseChain, () => {
1322
+ this.parent.emit(commandEvent, operands, unknown);
1323
+ });
1324
+ }
1325
+ promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
1326
+ return promiseChain;
1327
+ }
1328
+ if (this.parent && this.parent.listenerCount(commandEvent)) {
1329
+ checkForUnknownOptions();
1330
+ this._processArguments();
1331
+ this.parent.emit(commandEvent, operands, unknown);
1332
+ } else if (operands.length) {
1333
+ if (this._findCommand("*")) {
1334
+ return this._dispatchSubcommand("*", operands, unknown);
1335
+ }
1336
+ if (this.listenerCount("command:*")) {
1337
+ this.emit("command:*", operands, unknown);
1338
+ } else if (this.commands.length) {
1339
+ this.unknownCommand();
1340
+ } else {
1341
+ checkForUnknownOptions();
1342
+ this._processArguments();
1343
+ }
1344
+ } else if (this.commands.length) {
1345
+ checkForUnknownOptions();
1346
+ this.help({ error: true });
1347
+ } else {
1348
+ checkForUnknownOptions();
1349
+ this._processArguments();
1350
+ }
1351
+ }
1352
+ _findCommand(name) {
1353
+ if (!name)
1354
+ return;
1355
+ return this.commands.find((cmd) => cmd._name === name || cmd._aliases.includes(name));
1356
+ }
1357
+ _findOption(arg) {
1358
+ return this.options.find((option) => option.is(arg));
1359
+ }
1360
+ _checkForMissingMandatoryOptions() {
1361
+ this._getCommandAndAncestors().forEach((cmd) => {
1362
+ cmd.options.forEach((anOption) => {
1363
+ if (anOption.mandatory && cmd.getOptionValue(anOption.attributeName()) === undefined) {
1364
+ cmd.missingMandatoryOptionValue(anOption);
1365
+ }
1366
+ });
1367
+ });
1368
+ }
1369
+ _checkForConflictingLocalOptions() {
1370
+ const definedNonDefaultOptions = this.options.filter((option) => {
1371
+ const optionKey = option.attributeName();
1372
+ if (this.getOptionValue(optionKey) === undefined) {
1373
+ return false;
1374
+ }
1375
+ return this.getOptionValueSource(optionKey) !== "default";
1376
+ });
1377
+ const optionsWithConflicting = definedNonDefaultOptions.filter((option) => option.conflictsWith.length > 0);
1378
+ optionsWithConflicting.forEach((option) => {
1379
+ const conflictingAndDefined = definedNonDefaultOptions.find((defined) => option.conflictsWith.includes(defined.attributeName()));
1380
+ if (conflictingAndDefined) {
1381
+ this._conflictingOption(option, conflictingAndDefined);
1382
+ }
1383
+ });
1384
+ }
1385
+ _checkForConflictingOptions() {
1386
+ this._getCommandAndAncestors().forEach((cmd) => {
1387
+ cmd._checkForConflictingLocalOptions();
1388
+ });
1389
+ }
1390
+ parseOptions(argv) {
1391
+ const operands = [];
1392
+ const unknown = [];
1393
+ let dest = operands;
1394
+ const args = argv.slice();
1395
+ function maybeOption(arg) {
1396
+ return arg.length > 1 && arg[0] === "-";
1397
+ }
1398
+ let activeVariadicOption = null;
1399
+ while (args.length) {
1400
+ const arg = args.shift();
1401
+ if (arg === "--") {
1402
+ if (dest === unknown)
1403
+ dest.push(arg);
1404
+ dest.push(...args);
1405
+ break;
1406
+ }
1407
+ if (activeVariadicOption && !maybeOption(arg)) {
1408
+ this.emit(`option:${activeVariadicOption.name()}`, arg);
1409
+ continue;
1410
+ }
1411
+ activeVariadicOption = null;
1412
+ if (maybeOption(arg)) {
1413
+ const option = this._findOption(arg);
1414
+ if (option) {
1415
+ if (option.required) {
1416
+ const value = args.shift();
1417
+ if (value === undefined)
1418
+ this.optionMissingArgument(option);
1419
+ this.emit(`option:${option.name()}`, value);
1420
+ } else if (option.optional) {
1421
+ let value = null;
1422
+ if (args.length > 0 && !maybeOption(args[0])) {
1423
+ value = args.shift();
1424
+ }
1425
+ this.emit(`option:${option.name()}`, value);
1426
+ } else {
1427
+ this.emit(`option:${option.name()}`);
1428
+ }
1429
+ activeVariadicOption = option.variadic ? option : null;
1430
+ continue;
1431
+ }
1432
+ }
1433
+ if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-") {
1434
+ const option = this._findOption(`-${arg[1]}`);
1435
+ if (option) {
1436
+ if (option.required || option.optional && this._combineFlagAndOptionalValue) {
1437
+ this.emit(`option:${option.name()}`, arg.slice(2));
1438
+ } else {
1439
+ this.emit(`option:${option.name()}`);
1440
+ args.unshift(`-${arg.slice(2)}`);
1441
+ }
1442
+ continue;
1443
+ }
1444
+ }
1445
+ if (/^--[^=]+=/.test(arg)) {
1446
+ const index = arg.indexOf("=");
1447
+ const option = this._findOption(arg.slice(0, index));
1448
+ if (option && (option.required || option.optional)) {
1449
+ this.emit(`option:${option.name()}`, arg.slice(index + 1));
1450
+ continue;
1451
+ }
1452
+ }
1453
+ if (maybeOption(arg)) {
1454
+ dest = unknown;
1455
+ }
1456
+ if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
1457
+ if (this._findCommand(arg)) {
1458
+ operands.push(arg);
1459
+ if (args.length > 0)
1460
+ unknown.push(...args);
1461
+ break;
1462
+ } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
1463
+ operands.push(arg);
1464
+ if (args.length > 0)
1465
+ operands.push(...args);
1466
+ break;
1467
+ } else if (this._defaultCommandName) {
1468
+ unknown.push(arg);
1469
+ if (args.length > 0)
1470
+ unknown.push(...args);
1471
+ break;
1472
+ }
1473
+ }
1474
+ if (this._passThroughOptions) {
1475
+ dest.push(arg);
1476
+ if (args.length > 0)
1477
+ dest.push(...args);
1478
+ break;
1479
+ }
1480
+ dest.push(arg);
1481
+ }
1482
+ return { operands, unknown };
1483
+ }
1484
+ opts() {
1485
+ if (this._storeOptionsAsProperties) {
1486
+ const result = {};
1487
+ const len = this.options.length;
1488
+ for (let i = 0;i < len; i++) {
1489
+ const key = this.options[i].attributeName();
1490
+ result[key] = key === this._versionOptionName ? this._version : this[key];
1491
+ }
1492
+ return result;
1493
+ }
1494
+ return this._optionValues;
1495
+ }
1496
+ optsWithGlobals() {
1497
+ return this._getCommandAndAncestors().reduce((combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()), {});
1498
+ }
1499
+ error(message, errorOptions) {
1500
+ this._outputConfiguration.outputError(`${message}
1501
+ `, this._outputConfiguration.writeErr);
1502
+ if (typeof this._showHelpAfterError === "string") {
1503
+ this._outputConfiguration.writeErr(`${this._showHelpAfterError}
1504
+ `);
1505
+ } else if (this._showHelpAfterError) {
1506
+ this._outputConfiguration.writeErr(`
1507
+ `);
1508
+ this.outputHelp({ error: true });
1509
+ }
1510
+ const config = errorOptions || {};
1511
+ const exitCode = config.exitCode || 1;
1512
+ const code = config.code || "commander.error";
1513
+ this._exit(exitCode, code, message);
1514
+ }
1515
+ _parseOptionsEnv() {
1516
+ this.options.forEach((option) => {
1517
+ if (option.envVar && option.envVar in process2.env) {
1518
+ const optionKey = option.attributeName();
1519
+ if (this.getOptionValue(optionKey) === undefined || ["default", "config", "env"].includes(this.getOptionValueSource(optionKey))) {
1520
+ if (option.required || option.optional) {
1521
+ this.emit(`optionEnv:${option.name()}`, process2.env[option.envVar]);
1522
+ } else {
1523
+ this.emit(`optionEnv:${option.name()}`);
1524
+ }
1525
+ }
1526
+ }
1527
+ });
1528
+ }
1529
+ _parseOptionsImplied() {
1530
+ const dualHelper = new DualOptions(this.options);
1531
+ const hasCustomOptionValue = (optionKey) => {
1532
+ return this.getOptionValue(optionKey) !== undefined && !["default", "implied"].includes(this.getOptionValueSource(optionKey));
1533
+ };
1534
+ this.options.filter((option) => option.implied !== undefined && hasCustomOptionValue(option.attributeName()) && dualHelper.valueFromOption(this.getOptionValue(option.attributeName()), option)).forEach((option) => {
1535
+ Object.keys(option.implied).filter((impliedKey) => !hasCustomOptionValue(impliedKey)).forEach((impliedKey) => {
1536
+ this.setOptionValueWithSource(impliedKey, option.implied[impliedKey], "implied");
1537
+ });
1538
+ });
1539
+ }
1540
+ missingArgument(name) {
1541
+ const message = `error: missing required argument '${name}'`;
1542
+ this.error(message, { code: "commander.missingArgument" });
1543
+ }
1544
+ optionMissingArgument(option) {
1545
+ const message = `error: option '${option.flags}' argument missing`;
1546
+ this.error(message, { code: "commander.optionMissingArgument" });
1547
+ }
1548
+ missingMandatoryOptionValue(option) {
1549
+ const message = `error: required option '${option.flags}' not specified`;
1550
+ this.error(message, { code: "commander.missingMandatoryOptionValue" });
1551
+ }
1552
+ _conflictingOption(option, conflictingOption) {
1553
+ const findBestOptionFromValue = (option) => {
1554
+ const optionKey = option.attributeName();
1555
+ const optionValue = this.getOptionValue(optionKey);
1556
+ const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
1557
+ const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
1558
+ if (negativeOption && (negativeOption.presetArg === undefined && optionValue === false || negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)) {
1559
+ return negativeOption;
1560
+ }
1561
+ return positiveOption || option;
1562
+ };
1563
+ const getErrorMessage = (option) => {
1564
+ const bestOption = findBestOptionFromValue(option);
1565
+ const optionKey = bestOption.attributeName();
1566
+ const source = this.getOptionValueSource(optionKey);
1567
+ if (source === "env") {
1568
+ return `environment variable '${bestOption.envVar}'`;
1569
+ }
1570
+ return `option '${bestOption.flags}'`;
1571
+ };
1572
+ const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;
1573
+ this.error(message, { code: "commander.conflictingOption" });
1574
+ }
1575
+ unknownOption(flag) {
1576
+ if (this._allowUnknownOption)
1577
+ return;
1578
+ let suggestion = "";
1579
+ if (flag.startsWith("--") && this._showSuggestionAfterError) {
1580
+ let candidateFlags = [];
1581
+ let command = this;
1582
+ do {
1583
+ const moreFlags = command.createHelp().visibleOptions(command).filter((option) => option.long).map((option) => option.long);
1584
+ candidateFlags = candidateFlags.concat(moreFlags);
1585
+ command = command.parent;
1586
+ } while (command && !command._enablePositionalOptions);
1587
+ suggestion = suggestSimilar(flag, candidateFlags);
1588
+ }
1589
+ const message = `error: unknown option '${flag}'${suggestion}`;
1590
+ this.error(message, { code: "commander.unknownOption" });
1591
+ }
1592
+ _excessArguments(receivedArgs) {
1593
+ if (this._allowExcessArguments)
1594
+ return;
1595
+ const expected = this.registeredArguments.length;
1596
+ const s = expected === 1 ? "" : "s";
1597
+ const forSubcommand = this.parent ? ` for '${this.name()}'` : "";
1598
+ const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;
1599
+ this.error(message, { code: "commander.excessArguments" });
1600
+ }
1601
+ unknownCommand() {
1602
+ const unknownName = this.args[0];
1603
+ let suggestion = "";
1604
+ if (this._showSuggestionAfterError) {
1605
+ const candidateNames = [];
1606
+ this.createHelp().visibleCommands(this).forEach((command) => {
1607
+ candidateNames.push(command.name());
1608
+ if (command.alias())
1609
+ candidateNames.push(command.alias());
1610
+ });
1611
+ suggestion = suggestSimilar(unknownName, candidateNames);
1612
+ }
1613
+ const message = `error: unknown command '${unknownName}'${suggestion}`;
1614
+ this.error(message, { code: "commander.unknownCommand" });
1615
+ }
1616
+ version(str, flags, description) {
1617
+ if (str === undefined)
1618
+ return this._version;
1619
+ this._version = str;
1620
+ flags = flags || "-V, --version";
1621
+ description = description || "output the version number";
1622
+ const versionOption = this.createOption(flags, description);
1623
+ this._versionOptionName = versionOption.attributeName();
1624
+ this._registerOption(versionOption);
1625
+ this.on("option:" + versionOption.name(), () => {
1626
+ this._outputConfiguration.writeOut(`${str}
1627
+ `);
1628
+ this._exit(0, "commander.version", str);
1629
+ });
1630
+ return this;
1631
+ }
1632
+ description(str, argsDescription) {
1633
+ if (str === undefined && argsDescription === undefined)
1634
+ return this._description;
1635
+ this._description = str;
1636
+ if (argsDescription) {
1637
+ this._argsDescription = argsDescription;
1638
+ }
1639
+ return this;
1640
+ }
1641
+ summary(str) {
1642
+ if (str === undefined)
1643
+ return this._summary;
1644
+ this._summary = str;
1645
+ return this;
1646
+ }
1647
+ alias(alias) {
1648
+ if (alias === undefined)
1649
+ return this._aliases[0];
1650
+ let command = this;
1651
+ if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {
1652
+ command = this.commands[this.commands.length - 1];
1653
+ }
1654
+ if (alias === command._name)
1655
+ throw new Error("Command alias can't be the same as its name");
1656
+ const matchingCommand = this.parent?._findCommand(alias);
1657
+ if (matchingCommand) {
1658
+ const existingCmd = [matchingCommand.name()].concat(matchingCommand.aliases()).join("|");
1659
+ throw new Error(`cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`);
1660
+ }
1661
+ command._aliases.push(alias);
1662
+ return this;
1663
+ }
1664
+ aliases(aliases) {
1665
+ if (aliases === undefined)
1666
+ return this._aliases;
1667
+ aliases.forEach((alias) => this.alias(alias));
1668
+ return this;
1669
+ }
1670
+ usage(str) {
1671
+ if (str === undefined) {
1672
+ if (this._usage)
1673
+ return this._usage;
1674
+ const args = this.registeredArguments.map((arg) => {
1675
+ return humanReadableArgName(arg);
1676
+ });
1677
+ return [].concat(this.options.length || this._helpOption !== null ? "[options]" : [], this.commands.length ? "[command]" : [], this.registeredArguments.length ? args : []).join(" ");
1678
+ }
1679
+ this._usage = str;
1680
+ return this;
1681
+ }
1682
+ name(str) {
1683
+ if (str === undefined)
1684
+ return this._name;
1685
+ this._name = str;
1686
+ return this;
1687
+ }
1688
+ nameFromFilename(filename) {
1689
+ this._name = path.basename(filename, path.extname(filename));
1690
+ return this;
1691
+ }
1692
+ executableDir(path) {
1693
+ if (path === undefined)
1694
+ return this._executableDir;
1695
+ this._executableDir = path;
1696
+ return this;
1697
+ }
1698
+ helpInformation(contextOptions) {
1699
+ const helper = this.createHelp();
1700
+ if (helper.helpWidth === undefined) {
1701
+ helper.helpWidth = contextOptions && contextOptions.error ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth();
1702
+ }
1703
+ return helper.formatHelp(this, helper);
1704
+ }
1705
+ _getHelpContext(contextOptions) {
1706
+ contextOptions = contextOptions || {};
1707
+ const context = { error: !!contextOptions.error };
1708
+ let write;
1709
+ if (context.error) {
1710
+ write = (arg) => this._outputConfiguration.writeErr(arg);
1711
+ } else {
1712
+ write = (arg) => this._outputConfiguration.writeOut(arg);
1713
+ }
1714
+ context.write = contextOptions.write || write;
1715
+ context.command = this;
1716
+ return context;
1717
+ }
1718
+ outputHelp(contextOptions) {
1719
+ let deprecatedCallback;
1720
+ if (typeof contextOptions === "function") {
1721
+ deprecatedCallback = contextOptions;
1722
+ contextOptions = undefined;
1723
+ }
1724
+ const context = this._getHelpContext(contextOptions);
1725
+ this._getCommandAndAncestors().reverse().forEach((command) => command.emit("beforeAllHelp", context));
1726
+ this.emit("beforeHelp", context);
1727
+ let helpInformation = this.helpInformation(context);
1728
+ if (deprecatedCallback) {
1729
+ helpInformation = deprecatedCallback(helpInformation);
1730
+ if (typeof helpInformation !== "string" && !Buffer.isBuffer(helpInformation)) {
1731
+ throw new Error("outputHelp callback must return a string or a Buffer");
1732
+ }
1733
+ }
1734
+ context.write(helpInformation);
1735
+ if (this._getHelpOption()?.long) {
1736
+ this.emit(this._getHelpOption().long);
1737
+ }
1738
+ this.emit("afterHelp", context);
1739
+ this._getCommandAndAncestors().forEach((command) => command.emit("afterAllHelp", context));
1740
+ }
1741
+ helpOption(flags, description) {
1742
+ if (typeof flags === "boolean") {
1743
+ if (flags) {
1744
+ this._helpOption = this._helpOption ?? undefined;
1745
+ } else {
1746
+ this._helpOption = null;
1747
+ }
1748
+ return this;
1749
+ }
1750
+ flags = flags ?? "-h, --help";
1751
+ description = description ?? "display help for command";
1752
+ this._helpOption = this.createOption(flags, description);
1753
+ return this;
1754
+ }
1755
+ _getHelpOption() {
1756
+ if (this._helpOption === undefined) {
1757
+ this.helpOption(undefined, undefined);
1758
+ }
1759
+ return this._helpOption;
1760
+ }
1761
+ addHelpOption(option) {
1762
+ this._helpOption = option;
1763
+ return this;
1764
+ }
1765
+ help(contextOptions) {
1766
+ this.outputHelp(contextOptions);
1767
+ let exitCode2 = process2.exitCode || 0;
1768
+ if (exitCode2 === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
1769
+ exitCode2 = 1;
1770
+ }
1771
+ this._exit(exitCode2, "commander.help", "(outputHelp)");
1772
+ }
1773
+ addHelpText(position, text) {
1774
+ const allowedValues = ["beforeAll", "before", "after", "afterAll"];
1775
+ if (!allowedValues.includes(position)) {
1776
+ throw new Error(`Unexpected value for position to addHelpText.
1777
+ Expecting one of '${allowedValues.join("', '")}'`);
1778
+ }
1779
+ const helpEvent = `${position}Help`;
1780
+ this.on(helpEvent, (context) => {
1781
+ let helpStr;
1782
+ if (typeof text === "function") {
1783
+ helpStr = text({ error: context.error, command: context.command });
1784
+ } else {
1785
+ helpStr = text;
1786
+ }
1787
+ if (helpStr) {
1788
+ context.write(`${helpStr}
1789
+ `);
1790
+ }
1791
+ });
1792
+ return this;
1793
+ }
1794
+ _outputHelpIfRequested(args) {
1795
+ const helpOption = this._getHelpOption();
1796
+ const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));
1797
+ if (helpRequested) {
1798
+ this.outputHelp();
1799
+ this._exit(0, "commander.helpDisplayed", "(outputHelp)");
1800
+ }
1801
+ }
1802
+ }
1803
+ function incrementNodeInspectorPort(args) {
1804
+ return args.map((arg) => {
1805
+ if (!arg.startsWith("--inspect")) {
1806
+ return arg;
1807
+ }
1808
+ let debugOption;
1809
+ let debugHost = "127.0.0.1";
1810
+ let debugPort = "9229";
1811
+ let match;
1812
+ if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
1813
+ debugOption = match[1];
1814
+ } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
1815
+ debugOption = match[1];
1816
+ if (/^\d+$/.test(match[3])) {
1817
+ debugPort = match[3];
1818
+ } else {
1819
+ debugHost = match[3];
1820
+ }
1821
+ } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
1822
+ debugOption = match[1];
1823
+ debugHost = match[3];
1824
+ debugPort = match[4];
1825
+ }
1826
+ if (debugOption && debugPort !== "0") {
1827
+ return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
1828
+ }
1829
+ return arg;
1830
+ });
1831
+ }
1832
+ exports.Command = Command;
1833
+ });
1834
+
1835
+ // ../../node_modules/.bun/commander@12.1.0/node_modules/commander/index.js
1836
+ var exports_commander = {};
1837
+ __exportCjs(exports_commander, {
1838
+ program: () => $program,
1839
+ createCommand: () => $createCommand,
1840
+ createOption: () => $createOption,
1841
+ createArgument: () => $createArgument,
1842
+ Command: () => $Command,
1843
+ Option: () => $Option,
1844
+ Argument: () => $Argument,
1845
+ Help: () => $Help,
1846
+ CommanderError: () => $CommanderError,
1847
+ InvalidArgumentError: () => $InvalidArgumentError,
1848
+ InvalidOptionArgumentError: () => $InvalidOptionArgumentError
1849
+ }, {
1850
+ program: (value) => $program = value,
1851
+ createCommand: (value) => $createCommand = value,
1852
+ createOption: (value) => $createOption = value,
1853
+ createArgument: (value) => $createArgument = value,
1854
+ Command: (value) => $Command = value,
1855
+ Option: (value) => $Option = value,
1856
+ Argument: (value) => $Argument = value,
1857
+ Help: (value) => $Help = value,
1858
+ CommanderError: (value) => $CommanderError = value,
1859
+ InvalidArgumentError: (value) => $InvalidArgumentError = value,
1860
+ InvalidOptionArgumentError: (value) => $InvalidOptionArgumentError = value
1861
+ });
1862
+ var { Argument } = require_argument();
1863
+ var { Command } = require_command();
1864
+ var { CommanderError, InvalidArgumentError } = require_error();
1865
+ var { Help } = require_help();
1866
+ var { Option } = require_option();
1867
+ var $program = new Command;
1868
+ var $createCommand = (name) => new Command(name);
1869
+ var $createOption = (flags, description) => new Option(flags, description);
1870
+ var $createArgument = (name, description) => new Argument(name, description);
1871
+ var $Command = Command;
1872
+ var $Option = Option;
1873
+ var $Argument = Argument;
1874
+ var $Help = Help;
1875
+ var $CommanderError = CommanderError;
1876
+ var $InvalidArgumentError = InvalidArgumentError;
1877
+ var $InvalidOptionArgumentError = InvalidArgumentError;
1878
+
1879
+ // ../../node_modules/.bun/commander@12.1.0/node_modules/commander/esm.mjs
1880
+ var {
1881
+ program,
1882
+ createCommand,
1883
+ createArgument,
1884
+ createOption,
1885
+ CommanderError: CommanderError2,
1886
+ InvalidArgumentError: InvalidArgumentError2,
1887
+ InvalidOptionArgumentError,
1888
+ Command: Command2,
1889
+ Argument: Argument2,
1890
+ Option: Option2,
1891
+ Help: Help2
1892
+ } = exports_commander;
1893
+
1894
+ // src/api-client.ts
1895
+ class CliApiClient {
1896
+ apiUrl;
1897
+ apiKey;
1898
+ constructor(apiUrl, apiKey) {
1899
+ this.apiUrl = apiUrl;
1900
+ this.apiKey = apiKey;
1901
+ }
1902
+ getHeaders() {
1903
+ const headers = {
1904
+ "Content-Type": "application/json"
1905
+ };
1906
+ if (this.apiKey) {
1907
+ headers.Authorization = `Bearer ${this.apiKey}`;
1908
+ }
1909
+ return headers;
1910
+ }
1911
+ async verifyAuth() {
1912
+ const url = `${this.apiUrl}/api/cli/auth/verify`;
1913
+ const res = await fetch(url, {
1914
+ method: "POST",
1915
+ headers: this.getHeaders()
1916
+ });
1917
+ if (!res.ok) {
1918
+ const err = await res.text();
1919
+ throw new Error(`Authentication failed (${res.status}): ${err}`);
1920
+ }
1921
+ const body = await res.json();
1922
+ return body.data;
1923
+ }
1924
+ async getProjectContext(projectId) {
1925
+ const url = `${this.apiUrl}/api/cli/projects/${projectId}/context`;
1926
+ const res = await fetch(url, {
1927
+ headers: this.getHeaders()
1928
+ });
1929
+ if (!res.ok) {
1930
+ const err = await res.text();
1931
+ throw new Error(`Failed to fetch project context (${res.status}): ${err}`);
1932
+ }
1933
+ const body = await res.json();
1934
+ return body.data;
1935
+ }
1936
+ async pushPreview(projectId, pageIdentifier, html) {
1937
+ const url = `${this.apiUrl}/api/cli/projects/${projectId}/pages/${pageIdentifier}/preview`;
1938
+ const res = await fetch(url, {
1939
+ method: "POST",
1940
+ headers: this.getHeaders(),
1941
+ body: JSON.stringify({ html })
1942
+ });
1943
+ if (!res.ok) {
1944
+ const err = await res.text();
1945
+ throw new Error(`Failed to push preview (${res.status}): ${err}`);
1946
+ }
1947
+ const body = await res.json();
1948
+ return body.data;
1949
+ }
1950
+ }
1951
+
1952
+ // src/config.ts
1953
+ import fs from "node:fs";
1954
+ import os from "node:os";
1955
+ import path from "node:path";
1956
+ var LOCAL_CONFIG_FILE = ".refirarc";
1957
+ var GLOBAL_CONFIG_FILE = path.join(os.homedir(), ".refirarc");
1958
+ function loadConfig() {
1959
+ let config = {
1960
+ apiUrl: process.env.REFIRA_API_URL ?? "http://localhost:3001",
1961
+ apiKey: process.env.REFIRA_API_KEY,
1962
+ projectId: process.env.REFIRA_PROJECT_ID
1963
+ };
1964
+ if (fs.existsSync(LOCAL_CONFIG_FILE)) {
1965
+ try {
1966
+ const raw = fs.readFileSync(LOCAL_CONFIG_FILE, "utf-8");
1967
+ const parsed = JSON.parse(raw);
1968
+ config = { ...config, ...parsed };
1969
+ } catch {}
1970
+ } else if (fs.existsSync(GLOBAL_CONFIG_FILE)) {
1971
+ try {
1972
+ const raw = fs.readFileSync(GLOBAL_CONFIG_FILE, "utf-8");
1973
+ const parsed = JSON.parse(raw);
1974
+ config = { ...config, ...parsed };
1975
+ } catch {}
1976
+ }
1977
+ return config;
1978
+ }
1979
+ function saveConfig(updates, isGlobal = false) {
1980
+ const targetPath = isGlobal ? GLOBAL_CONFIG_FILE : LOCAL_CONFIG_FILE;
1981
+ let current = {};
1982
+ if (fs.existsSync(targetPath)) {
1983
+ try {
1984
+ current = JSON.parse(fs.readFileSync(targetPath, "utf-8"));
1985
+ } catch {
1986
+ current = {};
1987
+ }
1988
+ }
1989
+ const merged = { ...current, ...updates };
1990
+ fs.writeFileSync(targetPath, JSON.stringify(merged, null, 2), "utf-8");
1991
+ }
1992
+
1993
+ // src/commands/auth.ts
1994
+ async function loginCommand(opts) {
1995
+ const current = loadConfig();
1996
+ const apiUrl = opts.apiUrl ?? current.apiUrl ?? "http://localhost:3001";
1997
+ const apiKey = opts.apiKey ?? current.apiKey;
1998
+ if (!apiKey) {
1999
+ console.error("❌ Error: API key is required. Provide --api-key <rfr_...>");
2000
+ process.exit(1);
2001
+ }
2002
+ console.log(`Verifying authentication with ${apiUrl}...`);
2003
+ const client = new CliApiClient(apiUrl, apiKey);
2004
+ try {
2005
+ const result = await client.verifyAuth();
2006
+ saveConfig({ apiUrl, apiKey, projectId: result.project_id }, opts.global ?? false);
2007
+ console.log("✅ Authentication successful!");
2008
+ console.log(` Project ID: ${result.project_id}`);
2009
+ console.log(` User ID: ${result.user_id}`);
2010
+ } catch (err) {
2011
+ const msg = err instanceof Error ? err.message : String(err);
2012
+ console.error(`❌ Authentication failed: ${msg}`);
2013
+ process.exit(1);
2014
+ }
2015
+ }
2016
+ async function statusCommand() {
2017
+ const config = loadConfig();
2018
+ if (!config.apiKey) {
2019
+ console.log("⚠️ No active Refira session found. Run `refira auth login --api-key <key>` to connect.");
2020
+ return;
2021
+ }
2022
+ const client = new CliApiClient(config.apiUrl, config.apiKey);
2023
+ try {
2024
+ const result = await client.verifyAuth();
2025
+ console.log("✅ Active Refira Session:");
2026
+ console.log(` API Endpoint: ${config.apiUrl}`);
2027
+ console.log(` Project ID: ${result.project_id}`);
2028
+ console.log(` User ID: ${result.user_id}`);
2029
+ } catch (err) {
2030
+ const msg = err instanceof Error ? err.message : String(err);
2031
+ console.error(`❌ Session invalid or expired: ${msg}`);
2032
+ }
2033
+ }
2034
+
2035
+ // src/commands/context.ts
2036
+ async function contextCommand(opts) {
2037
+ const config = loadConfig();
2038
+ const projectId = opts.projectId ?? config.projectId;
2039
+ if (!config.apiKey) {
2040
+ console.error("❌ Error: API key required. Run `refira auth login --api-key <key>`.");
2041
+ process.exit(1);
2042
+ }
2043
+ if (!projectId) {
2044
+ console.error("❌ Error: Project ID required. Run `refira init --project-id <id>` or pass --project-id.");
2045
+ process.exit(1);
2046
+ }
2047
+ const client = new CliApiClient(config.apiUrl, config.apiKey);
2048
+ try {
2049
+ const data = await client.getProjectContext(projectId);
2050
+ console.log(`
2051
+ ======================================================================`);
2052
+ console.log(`\uD83D\uDCE6 REFIRA DESIGN CONTEXT: ${data.context.project.name} (${data.context.project.id})`);
2053
+ console.log("======================================================================");
2054
+ const font = data.context.tokens?.typography?.font_family || data.context.project.fontFamily || "Inter";
2055
+ console.log(`
2056
+ \uD83D\uDD24 Primary Typography: Google Fonts "${font}"`);
2057
+ if (data.context.tokens?.color) {
2058
+ console.log(`
2059
+ \uD83C\uDFA8 Design Color Tokens:`);
2060
+ for (const [tokenName, tokenVal] of Object.entries(data.context.tokens.color)) {
2061
+ console.log(` --${tokenName}: ${tokenVal}`);
2062
+ }
2063
+ }
2064
+ console.log(`
2065
+ \uD83D\uDCC4 Existing Pages (${data.pages.length}):`);
2066
+ if (data.pages.length === 0) {
2067
+ console.log(" (No pages generated yet)");
2068
+ } else {
2069
+ data.pages.forEach((p, idx) => {
2070
+ console.log(` ${idx + 1}. ${p.name} [slug: ${p.slug}] (status: ${p.status})`);
2071
+ });
2072
+ }
2073
+ console.log(`======================================================================
2074
+ `);
2075
+ } catch (err) {
2076
+ const msg = err instanceof Error ? err.message : String(err);
2077
+ console.error(`❌ Failed to retrieve design context: ${msg}`);
2078
+ process.exit(1);
2079
+ }
2080
+ }
2081
+
2082
+ // src/commands/init.ts
2083
+ import fs2 from "node:fs";
2084
+ import path2 from "node:path";
2085
+
2086
+ // src/templates/agents-guide-template.ts
2087
+ function generateAgentsGuide(opts) {
2088
+ return `# Refira Project Instructions
2089
+
2090
+ **Project Name:** ${opts.projectName}
2091
+ **Project ID:** \`${opts.projectId}\`
2092
+ **API URL:** \`${opts.apiUrl}\`
2093
+ **Primary Font:** Google Fonts "${opts.fontFamily}"
2094
+
2095
+ ---
2096
+
2097
+ ## 1. Core Architecture Invariants
2098
+ 1. **Output Format:** Standalone HTML5 + Tailwind CSS CDN only.
2099
+ 2. **Typography:** Load and use Google Fonts "${opts.fontFamily}".
2100
+ 3. **No UI Frameworks:** Prohibited from using React, Vue, Svelte, Angular, Solid, or JSX syntax (\`className=\`, \`onClick={...}\`, \`<Component />\`).
2101
+ 4. **No Inter-Page Navigation:** Prohibited from using \`<a href="/path">\` or external links. Use in-page section hashes (e.g., \`href="#pricing"\`) or \`href="#"\`.
2102
+ 5. **No Raw Emojis:** Do not include raw emojis (e.g. \uD83D\uDE80, \uD83D\uDCA1, \uD83D\uDD25) in HTML markup. Use SVG icon libraries (Lucide Icons or Heroicons).
2103
+ 6. **Permitted Graphics:** Three.js, GSAP, Spline Viewer, and Lucide Icons via CDN are explicitly allowed.
2104
+
2105
+ ---
2106
+
2107
+ ## 2. Refira CLI Command Surface
2108
+ - \`refira context\`: Inspect project design tokens, colors, typography, and existing pages.
2109
+ - \`refira scaffold --page <slug>\`: Create a clean HTML5 starter template with tokens pre-configured.
2110
+ - \`refira preview <file.html> --page <slug>\`: Run the deterministic harness check and stream updates to Refira Canvas.
2111
+ - \`refira skill install [-g]\`: Re-install the Refira design craftsmanship skill.
2112
+
2113
+ ---
2114
+
2115
+ ## 3. Mandatory Execution Workflow
2116
+ 1. Run \`refira context\` to understand the project theme and existing pages.
2117
+ 2. Run \`refira scaffold --page <page-name>\` to generate the file.
2118
+ 3. Write your UI layout within the specified body slot using Tailwind utility classes.
2119
+ 4. Execute \`refira preview <page-name>.html --page <page-name>\`.
2120
+ 5. If the CLI exits with code 1, address every listed violation and retry until exit code 0.
2121
+ `;
2122
+ }
2123
+
2124
+ // src/templates/skill-template.ts
2125
+ function generateRefiraSkill() {
2126
+ return `---
2127
+ name: refira
2128
+ description: Visual design craftsmanship and prototype building guide for Refira projects, focusing on high-aesthetic UI execution without AI slop.
2129
+ ---
2130
+
2131
+ # Refira Design Craftsmanship & Anti-AI-Slop Guide
2132
+
2133
+ Use this skill when designing UI layouts, pages, and interactive components for Refira prototypes. This guide governs visual aesthetics, spatial rhythm, and product polish.
2134
+
2135
+ ---
2136
+
2137
+ ## 1. Eliminate "AI Slop" Visual Clichés
2138
+
2139
+ AI-generated interfaces often look unmistakably generic and uninspired. Avoid these recognizable patterns:
2140
+
2141
+ | Cliché Pattern | Why It Fails | What to Do Instead |
2142
+ |---|---|---|
2143
+ | **The 3-Card Symmetrical Grid** | Every AI outputs identical 3 feature boxes with centered icons. | Use asymmetric layouts: bento grids, 60/40 splits, or progressive disclosure lists. |
2144
+ | **Harsh Purple / Blue Neon Gradients** | Saturated linear gradients screaming generic AI template. | Use subtle radial ambient glows (\`bg-radial\`), muted neutral backgrounds, and high-contrast intentional accents. |
2145
+ | **Vague, Meaningless Copy** | "Revolutionize your workflow with next-gen intelligence". | Write concrete, domain-specific copy: "Deploy schema migrations in 240ms with zero downtime". |
2146
+ | **Centered Everything** | Defaulting to text-center for entire sections causes visual fatigue. | Anchor body copy and headers to left-align (\`text-left\`) with disciplined margins. |
2147
+ | **Uniform Spacing** | Applying the same \`gap-4\` and \`p-6\` to every single container. | Create clear hierarchical breathing room: large section gaps (\`py-20\`), snug content groups (\`space-y-3\`). |
2148
+
2149
+ ---
2150
+
2151
+ ## 2. Visual Hierarchy & Typography Discipline
2152
+
2153
+ - **Scale Contrast:** Never make subtitle text close in size to the heading. Pair bold, tight display titles (\`text-4xl md:text-5xl font-bold tracking-tight\`) with quiet, readable body copy (\`text-base text-slate-600 leading-relaxed\`).
2154
+ - **Font Weights:** Limit yourself to 2–3 font weights per view (e.g., \`font-normal\`, \`font-medium\`, \`font-semibold\`). Avoid scattering ultra-bold and ultra-thin variants arbitrarily.
2155
+ - **Labeling & Eyebrows:** Use tasteful uppercase badges or pill tags (\`text-xs font-semibold uppercase tracking-wider text-primary px-2.5 py-1 rounded-full bg-primary/10\`) to introduce section themes.
2156
+
2157
+ ---
2158
+
2159
+ ## 3. Surface Treatment & Micro-Details
2160
+
2161
+ - **Subtle Borders over Drop Shadows:** Heavy blur shadows look dated. Instead, use crisp hairline borders (\`border border-slate-200/80\` or in dark mode \`border-white/10\`).
2162
+ - **Layered Elevation:** When elevation is needed, combine a hairline border with a soft, diffused shadow (\`shadow-sm shadow-slate-900/5\`).
2163
+ - **Active State Feedback:** Every interactive button and link must have clear hover and transition states (\`transition-all duration-150 active:scale-[0.98]\`).
2164
+ - **Icon Sizing:** Keep icons proportional to adjacent typography. For 14px–16px text, use 16px–18px icons (\`w-4 h-4\` or \`w-5 h-5\`) with consistent 1.5px to 2px stroke widths.
2165
+
2166
+ ---
2167
+
2168
+ ## 4. Bento Grid & Asymmetric Layout Patterns
2169
+
2170
+ When presenting features, data, or product capabilities:
2171
+ - Create a primary hero card spanning 2 columns with a high-fidelity visual or interactive mini-preview.
2172
+ - Accompany it with compact metric cards, interactive toggle previews, or activity tickers.
2173
+ - Keep border radii cohesive across cards (e.g., all \`rounded-2xl\` with inner elements \`rounded-xl\`).
2174
+
2175
+ ---
2176
+
2177
+ ## 5. Prototype Workflow in Refira
2178
+
2179
+ 1. Check current tokens: \`refira context\`
2180
+ 2. Generate base page: \`refira scaffold --page <slug>\`
2181
+ 3. Fill layout using Tailwind classes applying the aesthetic principles above.
2182
+ 4. Preview on canvas: \`refira preview <slug>.html --page <slug>\`
2183
+ `;
2184
+ }
2185
+
2186
+ // src/commands/init.ts
2187
+ async function initCommand(opts) {
2188
+ const config = loadConfig();
2189
+ const apiUrl = opts.apiUrl ?? config.apiUrl;
2190
+ const apiKey = opts.apiKey ?? config.apiKey;
2191
+ const projectId = opts.projectId ?? config.projectId;
2192
+ if (!apiKey) {
2193
+ console.error("❌ Error: API key is required. Run `refira auth login --api-key <key>` or pass --api-key.");
2194
+ process.exit(1);
2195
+ }
2196
+ if (!projectId) {
2197
+ console.error("❌ Error: Project ID is required. Pass --project-id <uuid>");
2198
+ process.exit(1);
2199
+ }
2200
+ console.log(`Initializing Refira workspace for project ${projectId}...`);
2201
+ const client = new CliApiClient(apiUrl, apiKey);
2202
+ try {
2203
+ const data = await client.getProjectContext(projectId);
2204
+ const projectName = data.context.project.name || "Refira Project";
2205
+ const fontFamily = data.context.tokens?.typography?.font_family || data.context.project.fontFamily || "Inter";
2206
+ const agentsGuide = generateAgentsGuide({
2207
+ projectName,
2208
+ projectId,
2209
+ fontFamily,
2210
+ apiUrl
2211
+ });
2212
+ fs2.writeFileSync("AGENTS.md", agentsGuide, "utf-8");
2213
+ console.log(" Created AGENTS.md");
2214
+ fs2.writeFileSync(".cursorrules", agentsGuide, "utf-8");
2215
+ console.log(" Created .cursorrules");
2216
+ const skillDir = path2.join(".agents", "skills", "refira");
2217
+ fs2.mkdirSync(skillDir, { recursive: true });
2218
+ const skillContent = generateRefiraSkill();
2219
+ fs2.writeFileSync(path2.join(skillDir, "SKILL.md"), skillContent, "utf-8");
2220
+ console.log(" Created .agents/skills/refira/SKILL.md");
2221
+ saveConfig({ apiUrl, apiKey, projectId }, false);
2222
+ console.log(" Saved project configuration to .refirarc");
2223
+ console.log(`
2224
+ Refira workspace initialized successfully!`);
2225
+ console.log(" Run `refira context` to inspect design tokens.");
2226
+ console.log(" Run `refira scaffold --page <name>` to create your first page.");
2227
+ } catch (err) {
2228
+ const msg = err instanceof Error ? err.message : String(err);
2229
+ console.error(`❌ Initialization failed: ${msg}`);
2230
+ process.exit(1);
2231
+ }
2232
+ }
2233
+
2234
+ // src/commands/preview.ts
2235
+ import fs3 from "node:fs";
2236
+
2237
+ // ../../node_modules/.bun/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-html.js
2238
+ var decode_data_html_default = new Uint16Array("ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\x00\x00\x00\x00\x00\x00ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀\uD835\uDD04rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀\uD835\uDD38plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀\uD835\uDC9Cign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀\uD835\uDD05pf;쀀\uD835\uDD39eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀\uD835\uDC9EpĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀\uD835\uDD07Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\x00\x00\x00͔͂\x00Ѕf;쀀\uD835\uDD3Bƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\x00\x00ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\x00\x00ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\x00ц\x00ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\x00ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀\uD835\uDC9Frok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀\uD835\uDD08rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\x00\x00ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀\uD835\uDD3Csilon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀\uD835\uDD09lledɓ֗\x00\x00֣mallSquare;旼erySmallSquare;斪Ͱֺ\x00ֿ\x00\x00ׄf;쀀\uD835\uDD3DAll;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀\uD835\uDD0A;拙pf;쀀\uD835\uDD3Eeater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀\uD835\uDCA2;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\x00ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\x00ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀\uD835\uDD40a;䎙cr;愐ilde;䄨ǫޚ\x00ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀\uD835\uDD0Dpf;쀀\uD835\uDD41ǣ߇\x00ߌr;쀀\uD835\uDCA5rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀\uD835\uDD0Epf;쀀\uD835\uDD42cr;쀀\uD835\uDCA6րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\x00ࣃbleBracket;柦nǔࣈ\x00࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀\uD835\uDD0FĀ;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀\uD835\uDD43erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀\uD835\uDD10nusPlus;戓pf;쀀\uD835\uDD44cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀\uD835\uDD11ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀\uD835\uDCA9ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀\uD835\uDD12rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀\uD835\uDD46enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀\uD835\uDCAAash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀\uD835\uDD13i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀\uD835\uDCAB;䎨ȀUfos༑༖༛༟OT耻\"䀢r;쀀\uD835\uDD14pf;愚cr;쀀\uD835\uDCAC؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\x00စbleBracket;柧nǔည\x00နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀\uD835\uDD16ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀\uD835\uDD4Aɲᅭ\x00\x00ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀\uD835\uDCAEar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀\uD835\uDD17Āeiቻ኉Dzኀ\x00ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀\uD835\uDD4BipleDot;惛Āctዖዛr;쀀\uD835\uDCAFrok;䅦ૡዷጎጚጦ\x00ጬጱ\x00\x00\x00\x00\x00ጸጽ፷ᎅ\x00᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\x00጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀\uD835\uDD18rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀\uD835\uDD4CЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀\uD835\uDCB0ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀\uD835\uDD19pf;쀀\uD835\uDD4Dcr;쀀\uD835\uDCB1dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀\uD835\uDD1Apf;쀀\uD835\uDD4Ecr;쀀\uD835\uDCB2Ȁfiosᓋᓐᓒᓘr;쀀\uD835\uDD1B;䎞pf;쀀\uD835\uDD4Fcr;쀀\uD835\uDCB3ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀\uD835\uDD1Cpf;쀀\uD835\uDD50cr;쀀\uD835\uDCB4ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\x00ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀\uD835\uDCB5௡ᖃᖊᖐ\x00ᖰᖶᖿ\x00\x00\x00\x00ᗆᗛᗫᙟ᙭\x00ᚕ᚛ᚲᚹ\x00ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀\uD835\uDD1Erave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\x00\x00ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀\uD835\uDD52΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀\uD835\uDCB6;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀\uD835\uDD1Fg΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\x00\x00ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\x00ᠳƲᠯ\x00ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀\uD835\uDD53Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀\uD835\uDCB7mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\x00᧨ᨑᨕᨲ\x00ᨷᩐ\x00\x00᪴\x00\x00᫁\x00\x00ᬡᬮ᭍᭒\x00᯽\x00ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\x00᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀\uD835\uDD20ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\x00\x00᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\x00ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\x00\x00᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\x00ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀\uD835\uDD54oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀\uD835\uDCB8Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\x00\x00᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\x00\x00ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀\uD835\uDD21arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\x00\x00ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀\uD835\uDD55ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\x00\x00ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀\uD835\uDCB9;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀\uD835\uDD22ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀\uD835\uDD56ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\x00\x00ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\x00ᾞ\x00ᾡᾧ\x00\x00ῆῌ\x00ΐ\x00ῦῪ \x00 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\x00\x00᾽g;耀ffig;耀ffl;쀀\uD835\uDD23lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\x00ῳf;쀀\uD835\uDD57ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\x00⁐β•‥‧‪‬\x00‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\x00‶;慔;慖ʴ‾⁁\x00\x00⁃耻¾䂾;慗;慜5;慘ƶ⁌\x00⁎;慚;慝8;慞l;恄wn;挢cr;쀀\uD835\uDCBBࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀\uD835\uDD24Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀\uD835\uDD58Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\x00↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀\uD835\uDD25sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀\uD835\uDD59bar;怕ƀclt≯≴≸r;쀀\uD835\uDCBDasè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\x00⊪\x00⊸⋅⋎\x00⋕⋳\x00\x00⋸⌢⍧⍢⍿\x00⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀\uD835\uDD26rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀\uD835\uDD5Aa;䎹uest耻¿䂿Āci⎊⎏r;쀀\uD835\uDCBEnʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\x00⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀\uD835\uDD27ath;䈷pf;쀀\uD835\uDD5Bǣ⏬\x00⏱r;쀀\uD835\uDCBFrcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀\uD835\uDD28reen;䄸cy;䑅cy;䑜pf;쀀\uD835\uDD5Ccr;쀀\uD835\uDCC0஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\x00⒪\x00⒱\x00\x00\x00\x00\x00⒵Ⓔ\x00ⓆⓈⓍ\x00⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀\uD835\uDD29Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀\uD835\uDD5Dus;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀\uD835\uDCC1mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀\uD835\uDD2Ao;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀\uD835\uDD5EĀct⣸⣽r;쀀\uD835\uDCC2pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\x00⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\x00⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀\uD835\uDD2BȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀\uD835\uDD5F膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀\uD835\uDCC3ortɭ⬅\x00\x00⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00ⴭ\x00ⴸⵈⵠⵥ⵲ⶄᬇ\x00\x00ⶍⶫ\x00ⷈⷎ\x00ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀\uD835\uDD2Cͯ⵹\x00\x00⵼\x00ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀\uD835\uDD60ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\x00⹽\x00⺀⺝\x00⺢⺹\x00\x00⻋ຜ\x00⼓\x00\x00⼫⾼\x00⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\x00\x00⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀\uD835\uDD2Dƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀\uD835\uDD61nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀\uD835\uDCC5;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀\uD835\uDD2Epf;쀀\uD835\uDD62rime;恗cr;쀀\uD835\uDCC6ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀\uD835\uDD2FĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀\uD835\uDD63us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀\uD835\uDCC7Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\x00㍺㎤\x00\x00㏬㏰\x00㐨㑈㑚㒭㒱㓊㓱\x00㘖\x00\x00㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\x00㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀\uD835\uDD30Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\x00\x00㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀\uD835\uDD64aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀\uD835\uDCC8tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\x00㙾㛂\x00\x00\x00\x00\x00㛛㜃\x00㜉㝬\x00\x00\x00㞇ɲ㙖\x00\x00㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀\uD835\uDD31Ȁeiko㚆㚝㚵㚼Dz㚋\x00㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀\uD835\uDD65rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀\uD835\uDCC9;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\x00㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀\uD835\uDD32rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\x00\x00㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀\uD835\uDD66̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\x00\x00㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀\uD835\uDCCAƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀\uD835\uDD33tré㦮suĀbp㧯㧱»ജ»൙pf;쀀\uD835\uDD67roð໻tré㦴Ācu㨆㨋r;쀀\uD835\uDCCBĀbp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀\uD835\uDD34pf;쀀\uD835\uDD68Ā;eᑹ㩦atèᑹcr;쀀\uD835\uDCCCૣណ㪇\x00㪋\x00㪐㪛\x00\x00㪝㪨㪫㪯\x00\x00㫃㫎\x00㫘ៜ៟tré៑r;쀀\uD835\uDD35ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀\uD835\uDD69imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀\uD835\uDCCDĀpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀\uD835\uDD36cy;䑗pf;쀀\uD835\uDD6Acr;쀀\uD835\uDCCEĀcm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀\uD835\uDD37cy;䐶grarr;懝pf;쀀\uD835\uDD6Bcr;쀀\uD835\uDCCFĀjn㮅㮇;怍j;怌".split("").map((c) => c.charCodeAt(0)));
2239
+
2240
+ // ../../node_modules/.bun/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-xml.js
2241
+ var decode_data_xml_default = new Uint16Array("Ȁaglq\t\x15\x18\x1Bɭ\x0F\x00\x00\x12p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((c) => c.charCodeAt(0)));
2242
+
2243
+ // ../../node_modules/.bun/entities@4.5.0/node_modules/entities/lib/esm/decode_codepoint.js
2244
+ var _a;
2245
+ var decodeMap = new Map([
2246
+ [0, 65533],
2247
+ [128, 8364],
2248
+ [130, 8218],
2249
+ [131, 402],
2250
+ [132, 8222],
2251
+ [133, 8230],
2252
+ [134, 8224],
2253
+ [135, 8225],
2254
+ [136, 710],
2255
+ [137, 8240],
2256
+ [138, 352],
2257
+ [139, 8249],
2258
+ [140, 338],
2259
+ [142, 381],
2260
+ [145, 8216],
2261
+ [146, 8217],
2262
+ [147, 8220],
2263
+ [148, 8221],
2264
+ [149, 8226],
2265
+ [150, 8211],
2266
+ [151, 8212],
2267
+ [152, 732],
2268
+ [153, 8482],
2269
+ [154, 353],
2270
+ [155, 8250],
2271
+ [156, 339],
2272
+ [158, 382],
2273
+ [159, 376]
2274
+ ]);
2275
+ var fromCodePoint = (_a = String.fromCodePoint) !== null && _a !== undefined ? _a : function(codePoint) {
2276
+ let output = "";
2277
+ if (codePoint > 65535) {
2278
+ codePoint -= 65536;
2279
+ output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);
2280
+ codePoint = 56320 | codePoint & 1023;
2281
+ }
2282
+ output += String.fromCharCode(codePoint);
2283
+ return output;
2284
+ };
2285
+ function replaceCodePoint(codePoint) {
2286
+ var _a;
2287
+ if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
2288
+ return 65533;
2289
+ }
2290
+ return (_a = decodeMap.get(codePoint)) !== null && _a !== undefined ? _a : codePoint;
2291
+ }
2292
+ // ../../node_modules/.bun/entities@4.5.0/node_modules/entities/lib/esm/decode.js
2293
+ var CharCodes;
2294
+ (function(CharCodes) {
2295
+ CharCodes[CharCodes["NUM"] = 35] = "NUM";
2296
+ CharCodes[CharCodes["SEMI"] = 59] = "SEMI";
2297
+ CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS";
2298
+ CharCodes[CharCodes["ZERO"] = 48] = "ZERO";
2299
+ CharCodes[CharCodes["NINE"] = 57] = "NINE";
2300
+ CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A";
2301
+ CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F";
2302
+ CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X";
2303
+ CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z";
2304
+ CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A";
2305
+ CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F";
2306
+ CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z";
2307
+ })(CharCodes || (CharCodes = {}));
2308
+ var TO_LOWER_BIT = 32;
2309
+ var BinTrieFlags;
2310
+ (function(BinTrieFlags) {
2311
+ BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
2312
+ BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH";
2313
+ BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE";
2314
+ })(BinTrieFlags || (BinTrieFlags = {}));
2315
+ function isNumber(code) {
2316
+ return code >= CharCodes.ZERO && code <= CharCodes.NINE;
2317
+ }
2318
+ function isHexadecimalCharacter(code) {
2319
+ return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F;
2320
+ }
2321
+ function isAsciiAlphaNumeric(code) {
2322
+ return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code);
2323
+ }
2324
+ function isEntityInAttributeInvalidEnd(code) {
2325
+ return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
2326
+ }
2327
+ var EntityDecoderState;
2328
+ (function(EntityDecoderState) {
2329
+ EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart";
2330
+ EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart";
2331
+ EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal";
2332
+ EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex";
2333
+ EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity";
2334
+ })(EntityDecoderState || (EntityDecoderState = {}));
2335
+ var DecodingMode;
2336
+ (function(DecodingMode) {
2337
+ DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy";
2338
+ DecodingMode[DecodingMode["Strict"] = 1] = "Strict";
2339
+ DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute";
2340
+ })(DecodingMode || (DecodingMode = {}));
2341
+
2342
+ class EntityDecoder {
2343
+ constructor(decodeTree, emitCodePoint, errors) {
2344
+ this.decodeTree = decodeTree;
2345
+ this.emitCodePoint = emitCodePoint;
2346
+ this.errors = errors;
2347
+ this.state = EntityDecoderState.EntityStart;
2348
+ this.consumed = 1;
2349
+ this.result = 0;
2350
+ this.treeIndex = 0;
2351
+ this.excess = 1;
2352
+ this.decodeMode = DecodingMode.Strict;
2353
+ }
2354
+ startEntity(decodeMode) {
2355
+ this.decodeMode = decodeMode;
2356
+ this.state = EntityDecoderState.EntityStart;
2357
+ this.result = 0;
2358
+ this.treeIndex = 0;
2359
+ this.excess = 1;
2360
+ this.consumed = 1;
2361
+ }
2362
+ write(str, offset) {
2363
+ switch (this.state) {
2364
+ case EntityDecoderState.EntityStart: {
2365
+ if (str.charCodeAt(offset) === CharCodes.NUM) {
2366
+ this.state = EntityDecoderState.NumericStart;
2367
+ this.consumed += 1;
2368
+ return this.stateNumericStart(str, offset + 1);
2369
+ }
2370
+ this.state = EntityDecoderState.NamedEntity;
2371
+ return this.stateNamedEntity(str, offset);
2372
+ }
2373
+ case EntityDecoderState.NumericStart: {
2374
+ return this.stateNumericStart(str, offset);
2375
+ }
2376
+ case EntityDecoderState.NumericDecimal: {
2377
+ return this.stateNumericDecimal(str, offset);
2378
+ }
2379
+ case EntityDecoderState.NumericHex: {
2380
+ return this.stateNumericHex(str, offset);
2381
+ }
2382
+ case EntityDecoderState.NamedEntity: {
2383
+ return this.stateNamedEntity(str, offset);
2384
+ }
2385
+ }
2386
+ }
2387
+ stateNumericStart(str, offset) {
2388
+ if (offset >= str.length) {
2389
+ return -1;
2390
+ }
2391
+ if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
2392
+ this.state = EntityDecoderState.NumericHex;
2393
+ this.consumed += 1;
2394
+ return this.stateNumericHex(str, offset + 1);
2395
+ }
2396
+ this.state = EntityDecoderState.NumericDecimal;
2397
+ return this.stateNumericDecimal(str, offset);
2398
+ }
2399
+ addToNumericResult(str, start, end, base) {
2400
+ if (start !== end) {
2401
+ const digitCount = end - start;
2402
+ this.result = this.result * Math.pow(base, digitCount) + parseInt(str.substr(start, digitCount), base);
2403
+ this.consumed += digitCount;
2404
+ }
2405
+ }
2406
+ stateNumericHex(str, offset) {
2407
+ const startIdx = offset;
2408
+ while (offset < str.length) {
2409
+ const char = str.charCodeAt(offset);
2410
+ if (isNumber(char) || isHexadecimalCharacter(char)) {
2411
+ offset += 1;
2412
+ } else {
2413
+ this.addToNumericResult(str, startIdx, offset, 16);
2414
+ return this.emitNumericEntity(char, 3);
2415
+ }
2416
+ }
2417
+ this.addToNumericResult(str, startIdx, offset, 16);
2418
+ return -1;
2419
+ }
2420
+ stateNumericDecimal(str, offset) {
2421
+ const startIdx = offset;
2422
+ while (offset < str.length) {
2423
+ const char = str.charCodeAt(offset);
2424
+ if (isNumber(char)) {
2425
+ offset += 1;
2426
+ } else {
2427
+ this.addToNumericResult(str, startIdx, offset, 10);
2428
+ return this.emitNumericEntity(char, 2);
2429
+ }
2430
+ }
2431
+ this.addToNumericResult(str, startIdx, offset, 10);
2432
+ return -1;
2433
+ }
2434
+ emitNumericEntity(lastCp, expectedLength) {
2435
+ var _a;
2436
+ if (this.consumed <= expectedLength) {
2437
+ (_a = this.errors) === null || _a === undefined || _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
2438
+ return 0;
2439
+ }
2440
+ if (lastCp === CharCodes.SEMI) {
2441
+ this.consumed += 1;
2442
+ } else if (this.decodeMode === DecodingMode.Strict) {
2443
+ return 0;
2444
+ }
2445
+ this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
2446
+ if (this.errors) {
2447
+ if (lastCp !== CharCodes.SEMI) {
2448
+ this.errors.missingSemicolonAfterCharacterReference();
2449
+ }
2450
+ this.errors.validateNumericCharacterReference(this.result);
2451
+ }
2452
+ return this.consumed;
2453
+ }
2454
+ stateNamedEntity(str, offset) {
2455
+ const { decodeTree } = this;
2456
+ let current = decodeTree[this.treeIndex];
2457
+ let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
2458
+ for (;offset < str.length; offset++, this.excess++) {
2459
+ const char = str.charCodeAt(offset);
2460
+ this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
2461
+ if (this.treeIndex < 0) {
2462
+ return this.result === 0 || this.decodeMode === DecodingMode.Attribute && (valueLength === 0 || isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();
2463
+ }
2464
+ current = decodeTree[this.treeIndex];
2465
+ valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
2466
+ if (valueLength !== 0) {
2467
+ if (char === CharCodes.SEMI) {
2468
+ return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
2469
+ }
2470
+ if (this.decodeMode !== DecodingMode.Strict) {
2471
+ this.result = this.treeIndex;
2472
+ this.consumed += this.excess;
2473
+ this.excess = 0;
2474
+ }
2475
+ }
2476
+ }
2477
+ return -1;
2478
+ }
2479
+ emitNotTerminatedNamedEntity() {
2480
+ var _a;
2481
+ const { result, decodeTree } = this;
2482
+ const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
2483
+ this.emitNamedEntityData(result, valueLength, this.consumed);
2484
+ (_a = this.errors) === null || _a === undefined || _a.missingSemicolonAfterCharacterReference();
2485
+ return this.consumed;
2486
+ }
2487
+ emitNamedEntityData(result, valueLength, consumed) {
2488
+ const { decodeTree } = this;
2489
+ this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed);
2490
+ if (valueLength === 3) {
2491
+ this.emitCodePoint(decodeTree[result + 2], consumed);
2492
+ }
2493
+ return consumed;
2494
+ }
2495
+ end() {
2496
+ var _a;
2497
+ switch (this.state) {
2498
+ case EntityDecoderState.NamedEntity: {
2499
+ return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
2500
+ }
2501
+ case EntityDecoderState.NumericDecimal: {
2502
+ return this.emitNumericEntity(0, 2);
2503
+ }
2504
+ case EntityDecoderState.NumericHex: {
2505
+ return this.emitNumericEntity(0, 3);
2506
+ }
2507
+ case EntityDecoderState.NumericStart: {
2508
+ (_a = this.errors) === null || _a === undefined || _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
2509
+ return 0;
2510
+ }
2511
+ case EntityDecoderState.EntityStart: {
2512
+ return 0;
2513
+ }
2514
+ }
2515
+ }
2516
+ }
2517
+ function getDecoder(decodeTree) {
2518
+ let ret = "";
2519
+ const decoder = new EntityDecoder(decodeTree, (str) => ret += fromCodePoint(str));
2520
+ return function decodeWithTrie(str, decodeMode) {
2521
+ let lastIndex = 0;
2522
+ let offset = 0;
2523
+ while ((offset = str.indexOf("&", offset)) >= 0) {
2524
+ ret += str.slice(lastIndex, offset);
2525
+ decoder.startEntity(decodeMode);
2526
+ const len = decoder.write(str, offset + 1);
2527
+ if (len < 0) {
2528
+ lastIndex = offset + decoder.end();
2529
+ break;
2530
+ }
2531
+ lastIndex = offset + len;
2532
+ offset = len === 0 ? lastIndex + 1 : lastIndex;
2533
+ }
2534
+ const result = ret + str.slice(lastIndex);
2535
+ ret = "";
2536
+ return result;
2537
+ };
2538
+ }
2539
+ function determineBranch(decodeTree, current, nodeIdx, char) {
2540
+ const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
2541
+ const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
2542
+ if (branchCount === 0) {
2543
+ return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;
2544
+ }
2545
+ if (jumpOffset) {
2546
+ const value = char - jumpOffset;
2547
+ return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIdx + value] - 1;
2548
+ }
2549
+ let lo = nodeIdx;
2550
+ let hi = lo + branchCount - 1;
2551
+ while (lo <= hi) {
2552
+ const mid = lo + hi >>> 1;
2553
+ const midVal = decodeTree[mid];
2554
+ if (midVal < char) {
2555
+ lo = mid + 1;
2556
+ } else if (midVal > char) {
2557
+ hi = mid - 1;
2558
+ } else {
2559
+ return decodeTree[mid + branchCount];
2560
+ }
2561
+ }
2562
+ return -1;
2563
+ }
2564
+ var htmlDecoder = getDecoder(decode_data_html_default);
2565
+ var xmlDecoder = getDecoder(decode_data_xml_default);
2566
+
2567
+ // ../../node_modules/.bun/htmlparser2@9.1.0/node_modules/htmlparser2/lib/esm/Tokenizer.js
2568
+ var CharCodes2;
2569
+ (function(CharCodes) {
2570
+ CharCodes[CharCodes["Tab"] = 9] = "Tab";
2571
+ CharCodes[CharCodes["NewLine"] = 10] = "NewLine";
2572
+ CharCodes[CharCodes["FormFeed"] = 12] = "FormFeed";
2573
+ CharCodes[CharCodes["CarriageReturn"] = 13] = "CarriageReturn";
2574
+ CharCodes[CharCodes["Space"] = 32] = "Space";
2575
+ CharCodes[CharCodes["ExclamationMark"] = 33] = "ExclamationMark";
2576
+ CharCodes[CharCodes["Number"] = 35] = "Number";
2577
+ CharCodes[CharCodes["Amp"] = 38] = "Amp";
2578
+ CharCodes[CharCodes["SingleQuote"] = 39] = "SingleQuote";
2579
+ CharCodes[CharCodes["DoubleQuote"] = 34] = "DoubleQuote";
2580
+ CharCodes[CharCodes["Dash"] = 45] = "Dash";
2581
+ CharCodes[CharCodes["Slash"] = 47] = "Slash";
2582
+ CharCodes[CharCodes["Zero"] = 48] = "Zero";
2583
+ CharCodes[CharCodes["Nine"] = 57] = "Nine";
2584
+ CharCodes[CharCodes["Semi"] = 59] = "Semi";
2585
+ CharCodes[CharCodes["Lt"] = 60] = "Lt";
2586
+ CharCodes[CharCodes["Eq"] = 61] = "Eq";
2587
+ CharCodes[CharCodes["Gt"] = 62] = "Gt";
2588
+ CharCodes[CharCodes["Questionmark"] = 63] = "Questionmark";
2589
+ CharCodes[CharCodes["UpperA"] = 65] = "UpperA";
2590
+ CharCodes[CharCodes["LowerA"] = 97] = "LowerA";
2591
+ CharCodes[CharCodes["UpperF"] = 70] = "UpperF";
2592
+ CharCodes[CharCodes["LowerF"] = 102] = "LowerF";
2593
+ CharCodes[CharCodes["UpperZ"] = 90] = "UpperZ";
2594
+ CharCodes[CharCodes["LowerZ"] = 122] = "LowerZ";
2595
+ CharCodes[CharCodes["LowerX"] = 120] = "LowerX";
2596
+ CharCodes[CharCodes["OpeningSquareBracket"] = 91] = "OpeningSquareBracket";
2597
+ })(CharCodes2 || (CharCodes2 = {}));
2598
+ var State;
2599
+ (function(State) {
2600
+ State[State["Text"] = 1] = "Text";
2601
+ State[State["BeforeTagName"] = 2] = "BeforeTagName";
2602
+ State[State["InTagName"] = 3] = "InTagName";
2603
+ State[State["InSelfClosingTag"] = 4] = "InSelfClosingTag";
2604
+ State[State["BeforeClosingTagName"] = 5] = "BeforeClosingTagName";
2605
+ State[State["InClosingTagName"] = 6] = "InClosingTagName";
2606
+ State[State["AfterClosingTagName"] = 7] = "AfterClosingTagName";
2607
+ State[State["BeforeAttributeName"] = 8] = "BeforeAttributeName";
2608
+ State[State["InAttributeName"] = 9] = "InAttributeName";
2609
+ State[State["AfterAttributeName"] = 10] = "AfterAttributeName";
2610
+ State[State["BeforeAttributeValue"] = 11] = "BeforeAttributeValue";
2611
+ State[State["InAttributeValueDq"] = 12] = "InAttributeValueDq";
2612
+ State[State["InAttributeValueSq"] = 13] = "InAttributeValueSq";
2613
+ State[State["InAttributeValueNq"] = 14] = "InAttributeValueNq";
2614
+ State[State["BeforeDeclaration"] = 15] = "BeforeDeclaration";
2615
+ State[State["InDeclaration"] = 16] = "InDeclaration";
2616
+ State[State["InProcessingInstruction"] = 17] = "InProcessingInstruction";
2617
+ State[State["BeforeComment"] = 18] = "BeforeComment";
2618
+ State[State["CDATASequence"] = 19] = "CDATASequence";
2619
+ State[State["InSpecialComment"] = 20] = "InSpecialComment";
2620
+ State[State["InCommentLike"] = 21] = "InCommentLike";
2621
+ State[State["BeforeSpecialS"] = 22] = "BeforeSpecialS";
2622
+ State[State["BeforeSpecialT"] = 23] = "BeforeSpecialT";
2623
+ State[State["SpecialStartSequence"] = 24] = "SpecialStartSequence";
2624
+ State[State["InSpecialTag"] = 25] = "InSpecialTag";
2625
+ State[State["InEntity"] = 26] = "InEntity";
2626
+ })(State || (State = {}));
2627
+ function isWhitespace(c) {
2628
+ return c === CharCodes2.Space || c === CharCodes2.NewLine || c === CharCodes2.Tab || c === CharCodes2.FormFeed || c === CharCodes2.CarriageReturn;
2629
+ }
2630
+ function isEndOfTagSection(c) {
2631
+ return c === CharCodes2.Slash || c === CharCodes2.Gt || isWhitespace(c);
2632
+ }
2633
+ function isASCIIAlpha(c) {
2634
+ return c >= CharCodes2.LowerA && c <= CharCodes2.LowerZ || c >= CharCodes2.UpperA && c <= CharCodes2.UpperZ;
2635
+ }
2636
+ var QuoteType;
2637
+ (function(QuoteType) {
2638
+ QuoteType[QuoteType["NoValue"] = 0] = "NoValue";
2639
+ QuoteType[QuoteType["Unquoted"] = 1] = "Unquoted";
2640
+ QuoteType[QuoteType["Single"] = 2] = "Single";
2641
+ QuoteType[QuoteType["Double"] = 3] = "Double";
2642
+ })(QuoteType || (QuoteType = {}));
2643
+ var Sequences = {
2644
+ Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
2645
+ CdataEnd: new Uint8Array([93, 93, 62]),
2646
+ CommentEnd: new Uint8Array([45, 45, 62]),
2647
+ ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
2648
+ StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
2649
+ TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]),
2650
+ TextareaEnd: new Uint8Array([
2651
+ 60,
2652
+ 47,
2653
+ 116,
2654
+ 101,
2655
+ 120,
2656
+ 116,
2657
+ 97,
2658
+ 114,
2659
+ 101,
2660
+ 97
2661
+ ])
2662
+ };
2663
+
2664
+ class Tokenizer {
2665
+ constructor({ xmlMode = false, decodeEntities = true }, cbs) {
2666
+ this.cbs = cbs;
2667
+ this.state = State.Text;
2668
+ this.buffer = "";
2669
+ this.sectionStart = 0;
2670
+ this.index = 0;
2671
+ this.entityStart = 0;
2672
+ this.baseState = State.Text;
2673
+ this.isSpecial = false;
2674
+ this.running = true;
2675
+ this.offset = 0;
2676
+ this.currentSequence = undefined;
2677
+ this.sequenceIndex = 0;
2678
+ this.xmlMode = xmlMode;
2679
+ this.decodeEntities = decodeEntities;
2680
+ this.entityDecoder = new EntityDecoder(xmlMode ? decode_data_xml_default : decode_data_html_default, (cp, consumed) => this.emitCodePoint(cp, consumed));
2681
+ }
2682
+ reset() {
2683
+ this.state = State.Text;
2684
+ this.buffer = "";
2685
+ this.sectionStart = 0;
2686
+ this.index = 0;
2687
+ this.baseState = State.Text;
2688
+ this.currentSequence = undefined;
2689
+ this.running = true;
2690
+ this.offset = 0;
2691
+ }
2692
+ write(chunk) {
2693
+ this.offset += this.buffer.length;
2694
+ this.buffer = chunk;
2695
+ this.parse();
2696
+ }
2697
+ end() {
2698
+ if (this.running)
2699
+ this.finish();
2700
+ }
2701
+ pause() {
2702
+ this.running = false;
2703
+ }
2704
+ resume() {
2705
+ this.running = true;
2706
+ if (this.index < this.buffer.length + this.offset) {
2707
+ this.parse();
2708
+ }
2709
+ }
2710
+ stateText(c) {
2711
+ if (c === CharCodes2.Lt || !this.decodeEntities && this.fastForwardTo(CharCodes2.Lt)) {
2712
+ if (this.index > this.sectionStart) {
2713
+ this.cbs.ontext(this.sectionStart, this.index);
2714
+ }
2715
+ this.state = State.BeforeTagName;
2716
+ this.sectionStart = this.index;
2717
+ } else if (this.decodeEntities && c === CharCodes2.Amp) {
2718
+ this.startEntity();
2719
+ }
2720
+ }
2721
+ stateSpecialStartSequence(c) {
2722
+ const isEnd = this.sequenceIndex === this.currentSequence.length;
2723
+ const isMatch = isEnd ? isEndOfTagSection(c) : (c | 32) === this.currentSequence[this.sequenceIndex];
2724
+ if (!isMatch) {
2725
+ this.isSpecial = false;
2726
+ } else if (!isEnd) {
2727
+ this.sequenceIndex++;
2728
+ return;
2729
+ }
2730
+ this.sequenceIndex = 0;
2731
+ this.state = State.InTagName;
2732
+ this.stateInTagName(c);
2733
+ }
2734
+ stateInSpecialTag(c) {
2735
+ if (this.sequenceIndex === this.currentSequence.length) {
2736
+ if (c === CharCodes2.Gt || isWhitespace(c)) {
2737
+ const endOfText = this.index - this.currentSequence.length;
2738
+ if (this.sectionStart < endOfText) {
2739
+ const actualIndex = this.index;
2740
+ this.index = endOfText;
2741
+ this.cbs.ontext(this.sectionStart, endOfText);
2742
+ this.index = actualIndex;
2743
+ }
2744
+ this.isSpecial = false;
2745
+ this.sectionStart = endOfText + 2;
2746
+ this.stateInClosingTagName(c);
2747
+ return;
2748
+ }
2749
+ this.sequenceIndex = 0;
2750
+ }
2751
+ if ((c | 32) === this.currentSequence[this.sequenceIndex]) {
2752
+ this.sequenceIndex += 1;
2753
+ } else if (this.sequenceIndex === 0) {
2754
+ if (this.currentSequence === Sequences.TitleEnd) {
2755
+ if (this.decodeEntities && c === CharCodes2.Amp) {
2756
+ this.startEntity();
2757
+ }
2758
+ } else if (this.fastForwardTo(CharCodes2.Lt)) {
2759
+ this.sequenceIndex = 1;
2760
+ }
2761
+ } else {
2762
+ this.sequenceIndex = Number(c === CharCodes2.Lt);
2763
+ }
2764
+ }
2765
+ stateCDATASequence(c) {
2766
+ if (c === Sequences.Cdata[this.sequenceIndex]) {
2767
+ if (++this.sequenceIndex === Sequences.Cdata.length) {
2768
+ this.state = State.InCommentLike;
2769
+ this.currentSequence = Sequences.CdataEnd;
2770
+ this.sequenceIndex = 0;
2771
+ this.sectionStart = this.index + 1;
2772
+ }
2773
+ } else {
2774
+ this.sequenceIndex = 0;
2775
+ this.state = State.InDeclaration;
2776
+ this.stateInDeclaration(c);
2777
+ }
2778
+ }
2779
+ fastForwardTo(c) {
2780
+ while (++this.index < this.buffer.length + this.offset) {
2781
+ if (this.buffer.charCodeAt(this.index - this.offset) === c) {
2782
+ return true;
2783
+ }
2784
+ }
2785
+ this.index = this.buffer.length + this.offset - 1;
2786
+ return false;
2787
+ }
2788
+ stateInCommentLike(c) {
2789
+ if (c === this.currentSequence[this.sequenceIndex]) {
2790
+ if (++this.sequenceIndex === this.currentSequence.length) {
2791
+ if (this.currentSequence === Sequences.CdataEnd) {
2792
+ this.cbs.oncdata(this.sectionStart, this.index, 2);
2793
+ } else {
2794
+ this.cbs.oncomment(this.sectionStart, this.index, 2);
2795
+ }
2796
+ this.sequenceIndex = 0;
2797
+ this.sectionStart = this.index + 1;
2798
+ this.state = State.Text;
2799
+ }
2800
+ } else if (this.sequenceIndex === 0) {
2801
+ if (this.fastForwardTo(this.currentSequence[0])) {
2802
+ this.sequenceIndex = 1;
2803
+ }
2804
+ } else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
2805
+ this.sequenceIndex = 0;
2806
+ }
2807
+ }
2808
+ isTagStartChar(c) {
2809
+ return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);
2810
+ }
2811
+ startSpecial(sequence, offset) {
2812
+ this.isSpecial = true;
2813
+ this.currentSequence = sequence;
2814
+ this.sequenceIndex = offset;
2815
+ this.state = State.SpecialStartSequence;
2816
+ }
2817
+ stateBeforeTagName(c) {
2818
+ if (c === CharCodes2.ExclamationMark) {
2819
+ this.state = State.BeforeDeclaration;
2820
+ this.sectionStart = this.index + 1;
2821
+ } else if (c === CharCodes2.Questionmark) {
2822
+ this.state = State.InProcessingInstruction;
2823
+ this.sectionStart = this.index + 1;
2824
+ } else if (this.isTagStartChar(c)) {
2825
+ const lower = c | 32;
2826
+ this.sectionStart = this.index;
2827
+ if (this.xmlMode) {
2828
+ this.state = State.InTagName;
2829
+ } else if (lower === Sequences.ScriptEnd[2]) {
2830
+ this.state = State.BeforeSpecialS;
2831
+ } else if (lower === Sequences.TitleEnd[2]) {
2832
+ this.state = State.BeforeSpecialT;
2833
+ } else {
2834
+ this.state = State.InTagName;
2835
+ }
2836
+ } else if (c === CharCodes2.Slash) {
2837
+ this.state = State.BeforeClosingTagName;
2838
+ } else {
2839
+ this.state = State.Text;
2840
+ this.stateText(c);
2841
+ }
2842
+ }
2843
+ stateInTagName(c) {
2844
+ if (isEndOfTagSection(c)) {
2845
+ this.cbs.onopentagname(this.sectionStart, this.index);
2846
+ this.sectionStart = -1;
2847
+ this.state = State.BeforeAttributeName;
2848
+ this.stateBeforeAttributeName(c);
2849
+ }
2850
+ }
2851
+ stateBeforeClosingTagName(c) {
2852
+ if (isWhitespace(c)) {} else if (c === CharCodes2.Gt) {
2853
+ this.state = State.Text;
2854
+ } else {
2855
+ this.state = this.isTagStartChar(c) ? State.InClosingTagName : State.InSpecialComment;
2856
+ this.sectionStart = this.index;
2857
+ }
2858
+ }
2859
+ stateInClosingTagName(c) {
2860
+ if (c === CharCodes2.Gt || isWhitespace(c)) {
2861
+ this.cbs.onclosetag(this.sectionStart, this.index);
2862
+ this.sectionStart = -1;
2863
+ this.state = State.AfterClosingTagName;
2864
+ this.stateAfterClosingTagName(c);
2865
+ }
2866
+ }
2867
+ stateAfterClosingTagName(c) {
2868
+ if (c === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) {
2869
+ this.state = State.Text;
2870
+ this.sectionStart = this.index + 1;
2871
+ }
2872
+ }
2873
+ stateBeforeAttributeName(c) {
2874
+ if (c === CharCodes2.Gt) {
2875
+ this.cbs.onopentagend(this.index);
2876
+ if (this.isSpecial) {
2877
+ this.state = State.InSpecialTag;
2878
+ this.sequenceIndex = 0;
2879
+ } else {
2880
+ this.state = State.Text;
2881
+ }
2882
+ this.sectionStart = this.index + 1;
2883
+ } else if (c === CharCodes2.Slash) {
2884
+ this.state = State.InSelfClosingTag;
2885
+ } else if (!isWhitespace(c)) {
2886
+ this.state = State.InAttributeName;
2887
+ this.sectionStart = this.index;
2888
+ }
2889
+ }
2890
+ stateInSelfClosingTag(c) {
2891
+ if (c === CharCodes2.Gt) {
2892
+ this.cbs.onselfclosingtag(this.index);
2893
+ this.state = State.Text;
2894
+ this.sectionStart = this.index + 1;
2895
+ this.isSpecial = false;
2896
+ } else if (!isWhitespace(c)) {
2897
+ this.state = State.BeforeAttributeName;
2898
+ this.stateBeforeAttributeName(c);
2899
+ }
2900
+ }
2901
+ stateInAttributeName(c) {
2902
+ if (c === CharCodes2.Eq || isEndOfTagSection(c)) {
2903
+ this.cbs.onattribname(this.sectionStart, this.index);
2904
+ this.sectionStart = this.index;
2905
+ this.state = State.AfterAttributeName;
2906
+ this.stateAfterAttributeName(c);
2907
+ }
2908
+ }
2909
+ stateAfterAttributeName(c) {
2910
+ if (c === CharCodes2.Eq) {
2911
+ this.state = State.BeforeAttributeValue;
2912
+ } else if (c === CharCodes2.Slash || c === CharCodes2.Gt) {
2913
+ this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);
2914
+ this.sectionStart = -1;
2915
+ this.state = State.BeforeAttributeName;
2916
+ this.stateBeforeAttributeName(c);
2917
+ } else if (!isWhitespace(c)) {
2918
+ this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);
2919
+ this.state = State.InAttributeName;
2920
+ this.sectionStart = this.index;
2921
+ }
2922
+ }
2923
+ stateBeforeAttributeValue(c) {
2924
+ if (c === CharCodes2.DoubleQuote) {
2925
+ this.state = State.InAttributeValueDq;
2926
+ this.sectionStart = this.index + 1;
2927
+ } else if (c === CharCodes2.SingleQuote) {
2928
+ this.state = State.InAttributeValueSq;
2929
+ this.sectionStart = this.index + 1;
2930
+ } else if (!isWhitespace(c)) {
2931
+ this.sectionStart = this.index;
2932
+ this.state = State.InAttributeValueNq;
2933
+ this.stateInAttributeValueNoQuotes(c);
2934
+ }
2935
+ }
2936
+ handleInAttributeValue(c, quote) {
2937
+ if (c === quote || !this.decodeEntities && this.fastForwardTo(quote)) {
2938
+ this.cbs.onattribdata(this.sectionStart, this.index);
2939
+ this.sectionStart = -1;
2940
+ this.cbs.onattribend(quote === CharCodes2.DoubleQuote ? QuoteType.Double : QuoteType.Single, this.index + 1);
2941
+ this.state = State.BeforeAttributeName;
2942
+ } else if (this.decodeEntities && c === CharCodes2.Amp) {
2943
+ this.startEntity();
2944
+ }
2945
+ }
2946
+ stateInAttributeValueDoubleQuotes(c) {
2947
+ this.handleInAttributeValue(c, CharCodes2.DoubleQuote);
2948
+ }
2949
+ stateInAttributeValueSingleQuotes(c) {
2950
+ this.handleInAttributeValue(c, CharCodes2.SingleQuote);
2951
+ }
2952
+ stateInAttributeValueNoQuotes(c) {
2953
+ if (isWhitespace(c) || c === CharCodes2.Gt) {
2954
+ this.cbs.onattribdata(this.sectionStart, this.index);
2955
+ this.sectionStart = -1;
2956
+ this.cbs.onattribend(QuoteType.Unquoted, this.index);
2957
+ this.state = State.BeforeAttributeName;
2958
+ this.stateBeforeAttributeName(c);
2959
+ } else if (this.decodeEntities && c === CharCodes2.Amp) {
2960
+ this.startEntity();
2961
+ }
2962
+ }
2963
+ stateBeforeDeclaration(c) {
2964
+ if (c === CharCodes2.OpeningSquareBracket) {
2965
+ this.state = State.CDATASequence;
2966
+ this.sequenceIndex = 0;
2967
+ } else {
2968
+ this.state = c === CharCodes2.Dash ? State.BeforeComment : State.InDeclaration;
2969
+ }
2970
+ }
2971
+ stateInDeclaration(c) {
2972
+ if (c === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) {
2973
+ this.cbs.ondeclaration(this.sectionStart, this.index);
2974
+ this.state = State.Text;
2975
+ this.sectionStart = this.index + 1;
2976
+ }
2977
+ }
2978
+ stateInProcessingInstruction(c) {
2979
+ if (c === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) {
2980
+ this.cbs.onprocessinginstruction(this.sectionStart, this.index);
2981
+ this.state = State.Text;
2982
+ this.sectionStart = this.index + 1;
2983
+ }
2984
+ }
2985
+ stateBeforeComment(c) {
2986
+ if (c === CharCodes2.Dash) {
2987
+ this.state = State.InCommentLike;
2988
+ this.currentSequence = Sequences.CommentEnd;
2989
+ this.sequenceIndex = 2;
2990
+ this.sectionStart = this.index + 1;
2991
+ } else {
2992
+ this.state = State.InDeclaration;
2993
+ }
2994
+ }
2995
+ stateInSpecialComment(c) {
2996
+ if (c === CharCodes2.Gt || this.fastForwardTo(CharCodes2.Gt)) {
2997
+ this.cbs.oncomment(this.sectionStart, this.index, 0);
2998
+ this.state = State.Text;
2999
+ this.sectionStart = this.index + 1;
3000
+ }
3001
+ }
3002
+ stateBeforeSpecialS(c) {
3003
+ const lower = c | 32;
3004
+ if (lower === Sequences.ScriptEnd[3]) {
3005
+ this.startSpecial(Sequences.ScriptEnd, 4);
3006
+ } else if (lower === Sequences.StyleEnd[3]) {
3007
+ this.startSpecial(Sequences.StyleEnd, 4);
3008
+ } else {
3009
+ this.state = State.InTagName;
3010
+ this.stateInTagName(c);
3011
+ }
3012
+ }
3013
+ stateBeforeSpecialT(c) {
3014
+ const lower = c | 32;
3015
+ if (lower === Sequences.TitleEnd[3]) {
3016
+ this.startSpecial(Sequences.TitleEnd, 4);
3017
+ } else if (lower === Sequences.TextareaEnd[3]) {
3018
+ this.startSpecial(Sequences.TextareaEnd, 4);
3019
+ } else {
3020
+ this.state = State.InTagName;
3021
+ this.stateInTagName(c);
3022
+ }
3023
+ }
3024
+ startEntity() {
3025
+ this.baseState = this.state;
3026
+ this.state = State.InEntity;
3027
+ this.entityStart = this.index;
3028
+ this.entityDecoder.startEntity(this.xmlMode ? DecodingMode.Strict : this.baseState === State.Text || this.baseState === State.InSpecialTag ? DecodingMode.Legacy : DecodingMode.Attribute);
3029
+ }
3030
+ stateInEntity() {
3031
+ const length = this.entityDecoder.write(this.buffer, this.index - this.offset);
3032
+ if (length >= 0) {
3033
+ this.state = this.baseState;
3034
+ if (length === 0) {
3035
+ this.index = this.entityStart;
3036
+ }
3037
+ } else {
3038
+ this.index = this.offset + this.buffer.length - 1;
3039
+ }
3040
+ }
3041
+ cleanup() {
3042
+ if (this.running && this.sectionStart !== this.index) {
3043
+ if (this.state === State.Text || this.state === State.InSpecialTag && this.sequenceIndex === 0) {
3044
+ this.cbs.ontext(this.sectionStart, this.index);
3045
+ this.sectionStart = this.index;
3046
+ } else if (this.state === State.InAttributeValueDq || this.state === State.InAttributeValueSq || this.state === State.InAttributeValueNq) {
3047
+ this.cbs.onattribdata(this.sectionStart, this.index);
3048
+ this.sectionStart = this.index;
3049
+ }
3050
+ }
3051
+ }
3052
+ shouldContinue() {
3053
+ return this.index < this.buffer.length + this.offset && this.running;
3054
+ }
3055
+ parse() {
3056
+ while (this.shouldContinue()) {
3057
+ const c = this.buffer.charCodeAt(this.index - this.offset);
3058
+ switch (this.state) {
3059
+ case State.Text: {
3060
+ this.stateText(c);
3061
+ break;
3062
+ }
3063
+ case State.SpecialStartSequence: {
3064
+ this.stateSpecialStartSequence(c);
3065
+ break;
3066
+ }
3067
+ case State.InSpecialTag: {
3068
+ this.stateInSpecialTag(c);
3069
+ break;
3070
+ }
3071
+ case State.CDATASequence: {
3072
+ this.stateCDATASequence(c);
3073
+ break;
3074
+ }
3075
+ case State.InAttributeValueDq: {
3076
+ this.stateInAttributeValueDoubleQuotes(c);
3077
+ break;
3078
+ }
3079
+ case State.InAttributeName: {
3080
+ this.stateInAttributeName(c);
3081
+ break;
3082
+ }
3083
+ case State.InCommentLike: {
3084
+ this.stateInCommentLike(c);
3085
+ break;
3086
+ }
3087
+ case State.InSpecialComment: {
3088
+ this.stateInSpecialComment(c);
3089
+ break;
3090
+ }
3091
+ case State.BeforeAttributeName: {
3092
+ this.stateBeforeAttributeName(c);
3093
+ break;
3094
+ }
3095
+ case State.InTagName: {
3096
+ this.stateInTagName(c);
3097
+ break;
3098
+ }
3099
+ case State.InClosingTagName: {
3100
+ this.stateInClosingTagName(c);
3101
+ break;
3102
+ }
3103
+ case State.BeforeTagName: {
3104
+ this.stateBeforeTagName(c);
3105
+ break;
3106
+ }
3107
+ case State.AfterAttributeName: {
3108
+ this.stateAfterAttributeName(c);
3109
+ break;
3110
+ }
3111
+ case State.InAttributeValueSq: {
3112
+ this.stateInAttributeValueSingleQuotes(c);
3113
+ break;
3114
+ }
3115
+ case State.BeforeAttributeValue: {
3116
+ this.stateBeforeAttributeValue(c);
3117
+ break;
3118
+ }
3119
+ case State.BeforeClosingTagName: {
3120
+ this.stateBeforeClosingTagName(c);
3121
+ break;
3122
+ }
3123
+ case State.AfterClosingTagName: {
3124
+ this.stateAfterClosingTagName(c);
3125
+ break;
3126
+ }
3127
+ case State.BeforeSpecialS: {
3128
+ this.stateBeforeSpecialS(c);
3129
+ break;
3130
+ }
3131
+ case State.BeforeSpecialT: {
3132
+ this.stateBeforeSpecialT(c);
3133
+ break;
3134
+ }
3135
+ case State.InAttributeValueNq: {
3136
+ this.stateInAttributeValueNoQuotes(c);
3137
+ break;
3138
+ }
3139
+ case State.InSelfClosingTag: {
3140
+ this.stateInSelfClosingTag(c);
3141
+ break;
3142
+ }
3143
+ case State.InDeclaration: {
3144
+ this.stateInDeclaration(c);
3145
+ break;
3146
+ }
3147
+ case State.BeforeDeclaration: {
3148
+ this.stateBeforeDeclaration(c);
3149
+ break;
3150
+ }
3151
+ case State.BeforeComment: {
3152
+ this.stateBeforeComment(c);
3153
+ break;
3154
+ }
3155
+ case State.InProcessingInstruction: {
3156
+ this.stateInProcessingInstruction(c);
3157
+ break;
3158
+ }
3159
+ case State.InEntity: {
3160
+ this.stateInEntity();
3161
+ break;
3162
+ }
3163
+ }
3164
+ this.index++;
3165
+ }
3166
+ this.cleanup();
3167
+ }
3168
+ finish() {
3169
+ if (this.state === State.InEntity) {
3170
+ this.entityDecoder.end();
3171
+ this.state = this.baseState;
3172
+ }
3173
+ this.handleTrailingData();
3174
+ this.cbs.onend();
3175
+ }
3176
+ handleTrailingData() {
3177
+ const endIndex = this.buffer.length + this.offset;
3178
+ if (this.sectionStart >= endIndex) {
3179
+ return;
3180
+ }
3181
+ if (this.state === State.InCommentLike) {
3182
+ if (this.currentSequence === Sequences.CdataEnd) {
3183
+ this.cbs.oncdata(this.sectionStart, endIndex, 0);
3184
+ } else {
3185
+ this.cbs.oncomment(this.sectionStart, endIndex, 0);
3186
+ }
3187
+ } else if (this.state === State.InTagName || this.state === State.BeforeAttributeName || this.state === State.BeforeAttributeValue || this.state === State.AfterAttributeName || this.state === State.InAttributeName || this.state === State.InAttributeValueSq || this.state === State.InAttributeValueDq || this.state === State.InAttributeValueNq || this.state === State.InClosingTagName) {} else {
3188
+ this.cbs.ontext(this.sectionStart, endIndex);
3189
+ }
3190
+ }
3191
+ emitCodePoint(cp, consumed) {
3192
+ if (this.baseState !== State.Text && this.baseState !== State.InSpecialTag) {
3193
+ if (this.sectionStart < this.entityStart) {
3194
+ this.cbs.onattribdata(this.sectionStart, this.entityStart);
3195
+ }
3196
+ this.sectionStart = this.entityStart + consumed;
3197
+ this.index = this.sectionStart - 1;
3198
+ this.cbs.onattribentity(cp);
3199
+ } else {
3200
+ if (this.sectionStart < this.entityStart) {
3201
+ this.cbs.ontext(this.sectionStart, this.entityStart);
3202
+ }
3203
+ this.sectionStart = this.entityStart + consumed;
3204
+ this.index = this.sectionStart - 1;
3205
+ this.cbs.ontextentity(cp, this.sectionStart);
3206
+ }
3207
+ }
3208
+ }
3209
+
3210
+ // ../../node_modules/.bun/htmlparser2@9.1.0/node_modules/htmlparser2/lib/esm/Parser.js
3211
+ var formTags = new Set([
3212
+ "input",
3213
+ "option",
3214
+ "optgroup",
3215
+ "select",
3216
+ "button",
3217
+ "datalist",
3218
+ "textarea"
3219
+ ]);
3220
+ var pTag = new Set(["p"]);
3221
+ var tableSectionTags = new Set(["thead", "tbody"]);
3222
+ var ddtTags = new Set(["dd", "dt"]);
3223
+ var rtpTags = new Set(["rt", "rp"]);
3224
+ var openImpliesClose = new Map([
3225
+ ["tr", new Set(["tr", "th", "td"])],
3226
+ ["th", new Set(["th"])],
3227
+ ["td", new Set(["thead", "th", "td"])],
3228
+ ["body", new Set(["head", "link", "script"])],
3229
+ ["li", new Set(["li"])],
3230
+ ["p", pTag],
3231
+ ["h1", pTag],
3232
+ ["h2", pTag],
3233
+ ["h3", pTag],
3234
+ ["h4", pTag],
3235
+ ["h5", pTag],
3236
+ ["h6", pTag],
3237
+ ["select", formTags],
3238
+ ["input", formTags],
3239
+ ["output", formTags],
3240
+ ["button", formTags],
3241
+ ["datalist", formTags],
3242
+ ["textarea", formTags],
3243
+ ["option", new Set(["option"])],
3244
+ ["optgroup", new Set(["optgroup", "option"])],
3245
+ ["dd", ddtTags],
3246
+ ["dt", ddtTags],
3247
+ ["address", pTag],
3248
+ ["article", pTag],
3249
+ ["aside", pTag],
3250
+ ["blockquote", pTag],
3251
+ ["details", pTag],
3252
+ ["div", pTag],
3253
+ ["dl", pTag],
3254
+ ["fieldset", pTag],
3255
+ ["figcaption", pTag],
3256
+ ["figure", pTag],
3257
+ ["footer", pTag],
3258
+ ["form", pTag],
3259
+ ["header", pTag],
3260
+ ["hr", pTag],
3261
+ ["main", pTag],
3262
+ ["nav", pTag],
3263
+ ["ol", pTag],
3264
+ ["pre", pTag],
3265
+ ["section", pTag],
3266
+ ["table", pTag],
3267
+ ["ul", pTag],
3268
+ ["rt", rtpTags],
3269
+ ["rp", rtpTags],
3270
+ ["tbody", tableSectionTags],
3271
+ ["tfoot", tableSectionTags]
3272
+ ]);
3273
+ var voidElements = new Set([
3274
+ "area",
3275
+ "base",
3276
+ "basefont",
3277
+ "br",
3278
+ "col",
3279
+ "command",
3280
+ "embed",
3281
+ "frame",
3282
+ "hr",
3283
+ "img",
3284
+ "input",
3285
+ "isindex",
3286
+ "keygen",
3287
+ "link",
3288
+ "meta",
3289
+ "param",
3290
+ "source",
3291
+ "track",
3292
+ "wbr"
3293
+ ]);
3294
+ var foreignContextElements = new Set(["math", "svg"]);
3295
+ var htmlIntegrationElements = new Set([
3296
+ "mi",
3297
+ "mo",
3298
+ "mn",
3299
+ "ms",
3300
+ "mtext",
3301
+ "annotation-xml",
3302
+ "foreignobject",
3303
+ "desc",
3304
+ "title"
3305
+ ]);
3306
+ var reNameEnd = /\s|\//;
3307
+
3308
+ class Parser {
3309
+ constructor(cbs, options = {}) {
3310
+ var _a, _b, _c, _d, _e, _f;
3311
+ this.options = options;
3312
+ this.startIndex = 0;
3313
+ this.endIndex = 0;
3314
+ this.openTagStart = 0;
3315
+ this.tagname = "";
3316
+ this.attribname = "";
3317
+ this.attribvalue = "";
3318
+ this.attribs = null;
3319
+ this.stack = [];
3320
+ this.buffers = [];
3321
+ this.bufferOffset = 0;
3322
+ this.writeIndex = 0;
3323
+ this.ended = false;
3324
+ this.cbs = cbs !== null && cbs !== undefined ? cbs : {};
3325
+ this.htmlMode = !this.options.xmlMode;
3326
+ this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== undefined ? _a : this.htmlMode;
3327
+ this.lowerCaseAttributeNames = (_b = options.lowerCaseAttributeNames) !== null && _b !== undefined ? _b : this.htmlMode;
3328
+ this.recognizeSelfClosing = (_c = options.recognizeSelfClosing) !== null && _c !== undefined ? _c : !this.htmlMode;
3329
+ this.tokenizer = new ((_d = options.Tokenizer) !== null && _d !== undefined ? _d : Tokenizer)(this.options, this);
3330
+ this.foreignContext = [!this.htmlMode];
3331
+ (_f = (_e = this.cbs).onparserinit) === null || _f === undefined || _f.call(_e, this);
3332
+ }
3333
+ ontext(start, endIndex) {
3334
+ var _a, _b;
3335
+ const data = this.getSlice(start, endIndex);
3336
+ this.endIndex = endIndex - 1;
3337
+ (_b = (_a = this.cbs).ontext) === null || _b === undefined || _b.call(_a, data);
3338
+ this.startIndex = endIndex;
3339
+ }
3340
+ ontextentity(cp, endIndex) {
3341
+ var _a, _b;
3342
+ this.endIndex = endIndex - 1;
3343
+ (_b = (_a = this.cbs).ontext) === null || _b === undefined || _b.call(_a, fromCodePoint(cp));
3344
+ this.startIndex = endIndex;
3345
+ }
3346
+ isVoidElement(name) {
3347
+ return this.htmlMode && voidElements.has(name);
3348
+ }
3349
+ onopentagname(start, endIndex) {
3350
+ this.endIndex = endIndex;
3351
+ let name = this.getSlice(start, endIndex);
3352
+ if (this.lowerCaseTagNames) {
3353
+ name = name.toLowerCase();
3354
+ }
3355
+ this.emitOpenTag(name);
3356
+ }
3357
+ emitOpenTag(name) {
3358
+ var _a, _b, _c, _d;
3359
+ this.openTagStart = this.startIndex;
3360
+ this.tagname = name;
3361
+ const impliesClose = this.htmlMode && openImpliesClose.get(name);
3362
+ if (impliesClose) {
3363
+ while (this.stack.length > 0 && impliesClose.has(this.stack[0])) {
3364
+ const element = this.stack.shift();
3365
+ (_b = (_a = this.cbs).onclosetag) === null || _b === undefined || _b.call(_a, element, true);
3366
+ }
3367
+ }
3368
+ if (!this.isVoidElement(name)) {
3369
+ this.stack.unshift(name);
3370
+ if (this.htmlMode) {
3371
+ if (foreignContextElements.has(name)) {
3372
+ this.foreignContext.unshift(true);
3373
+ } else if (htmlIntegrationElements.has(name)) {
3374
+ this.foreignContext.unshift(false);
3375
+ }
3376
+ }
3377
+ }
3378
+ (_d = (_c = this.cbs).onopentagname) === null || _d === undefined || _d.call(_c, name);
3379
+ if (this.cbs.onopentag)
3380
+ this.attribs = {};
3381
+ }
3382
+ endOpenTag(isImplied) {
3383
+ var _a, _b;
3384
+ this.startIndex = this.openTagStart;
3385
+ if (this.attribs) {
3386
+ (_b = (_a = this.cbs).onopentag) === null || _b === undefined || _b.call(_a, this.tagname, this.attribs, isImplied);
3387
+ this.attribs = null;
3388
+ }
3389
+ if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {
3390
+ this.cbs.onclosetag(this.tagname, true);
3391
+ }
3392
+ this.tagname = "";
3393
+ }
3394
+ onopentagend(endIndex) {
3395
+ this.endIndex = endIndex;
3396
+ this.endOpenTag(false);
3397
+ this.startIndex = endIndex + 1;
3398
+ }
3399
+ onclosetag(start, endIndex) {
3400
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3401
+ this.endIndex = endIndex;
3402
+ let name = this.getSlice(start, endIndex);
3403
+ if (this.lowerCaseTagNames) {
3404
+ name = name.toLowerCase();
3405
+ }
3406
+ if (this.htmlMode && (foreignContextElements.has(name) || htmlIntegrationElements.has(name))) {
3407
+ this.foreignContext.shift();
3408
+ }
3409
+ if (!this.isVoidElement(name)) {
3410
+ const pos = this.stack.indexOf(name);
3411
+ if (pos !== -1) {
3412
+ for (let index = 0;index <= pos; index++) {
3413
+ const element = this.stack.shift();
3414
+ (_b = (_a = this.cbs).onclosetag) === null || _b === undefined || _b.call(_a, element, index !== pos);
3415
+ }
3416
+ } else if (this.htmlMode && name === "p") {
3417
+ this.emitOpenTag("p");
3418
+ this.closeCurrentTag(true);
3419
+ }
3420
+ } else if (this.htmlMode && name === "br") {
3421
+ (_d = (_c = this.cbs).onopentagname) === null || _d === undefined || _d.call(_c, "br");
3422
+ (_f = (_e = this.cbs).onopentag) === null || _f === undefined || _f.call(_e, "br", {}, true);
3423
+ (_h = (_g = this.cbs).onclosetag) === null || _h === undefined || _h.call(_g, "br", false);
3424
+ }
3425
+ this.startIndex = endIndex + 1;
3426
+ }
3427
+ onselfclosingtag(endIndex) {
3428
+ this.endIndex = endIndex;
3429
+ if (this.recognizeSelfClosing || this.foreignContext[0]) {
3430
+ this.closeCurrentTag(false);
3431
+ this.startIndex = endIndex + 1;
3432
+ } else {
3433
+ this.onopentagend(endIndex);
3434
+ }
3435
+ }
3436
+ closeCurrentTag(isOpenImplied) {
3437
+ var _a, _b;
3438
+ const name = this.tagname;
3439
+ this.endOpenTag(isOpenImplied);
3440
+ if (this.stack[0] === name) {
3441
+ (_b = (_a = this.cbs).onclosetag) === null || _b === undefined || _b.call(_a, name, !isOpenImplied);
3442
+ this.stack.shift();
3443
+ }
3444
+ }
3445
+ onattribname(start, endIndex) {
3446
+ this.startIndex = start;
3447
+ const name = this.getSlice(start, endIndex);
3448
+ this.attribname = this.lowerCaseAttributeNames ? name.toLowerCase() : name;
3449
+ }
3450
+ onattribdata(start, endIndex) {
3451
+ this.attribvalue += this.getSlice(start, endIndex);
3452
+ }
3453
+ onattribentity(cp) {
3454
+ this.attribvalue += fromCodePoint(cp);
3455
+ }
3456
+ onattribend(quote, endIndex) {
3457
+ var _a, _b;
3458
+ this.endIndex = endIndex;
3459
+ (_b = (_a = this.cbs).onattribute) === null || _b === undefined || _b.call(_a, this.attribname, this.attribvalue, quote === QuoteType.Double ? '"' : quote === QuoteType.Single ? "'" : quote === QuoteType.NoValue ? undefined : null);
3460
+ if (this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {
3461
+ this.attribs[this.attribname] = this.attribvalue;
3462
+ }
3463
+ this.attribvalue = "";
3464
+ }
3465
+ getInstructionName(value) {
3466
+ const index = value.search(reNameEnd);
3467
+ let name = index < 0 ? value : value.substr(0, index);
3468
+ if (this.lowerCaseTagNames) {
3469
+ name = name.toLowerCase();
3470
+ }
3471
+ return name;
3472
+ }
3473
+ ondeclaration(start, endIndex) {
3474
+ this.endIndex = endIndex;
3475
+ const value = this.getSlice(start, endIndex);
3476
+ if (this.cbs.onprocessinginstruction) {
3477
+ const name = this.getInstructionName(value);
3478
+ this.cbs.onprocessinginstruction(`!${name}`, `!${value}`);
3479
+ }
3480
+ this.startIndex = endIndex + 1;
3481
+ }
3482
+ onprocessinginstruction(start, endIndex) {
3483
+ this.endIndex = endIndex;
3484
+ const value = this.getSlice(start, endIndex);
3485
+ if (this.cbs.onprocessinginstruction) {
3486
+ const name = this.getInstructionName(value);
3487
+ this.cbs.onprocessinginstruction(`?${name}`, `?${value}`);
3488
+ }
3489
+ this.startIndex = endIndex + 1;
3490
+ }
3491
+ oncomment(start, endIndex, offset) {
3492
+ var _a, _b, _c, _d;
3493
+ this.endIndex = endIndex;
3494
+ (_b = (_a = this.cbs).oncomment) === null || _b === undefined || _b.call(_a, this.getSlice(start, endIndex - offset));
3495
+ (_d = (_c = this.cbs).oncommentend) === null || _d === undefined || _d.call(_c);
3496
+ this.startIndex = endIndex + 1;
3497
+ }
3498
+ oncdata(start, endIndex, offset) {
3499
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
3500
+ this.endIndex = endIndex;
3501
+ const value = this.getSlice(start, endIndex - offset);
3502
+ if (!this.htmlMode || this.options.recognizeCDATA) {
3503
+ (_b = (_a = this.cbs).oncdatastart) === null || _b === undefined || _b.call(_a);
3504
+ (_d = (_c = this.cbs).ontext) === null || _d === undefined || _d.call(_c, value);
3505
+ (_f = (_e = this.cbs).oncdataend) === null || _f === undefined || _f.call(_e);
3506
+ } else {
3507
+ (_h = (_g = this.cbs).oncomment) === null || _h === undefined || _h.call(_g, `[CDATA[${value}]]`);
3508
+ (_k = (_j = this.cbs).oncommentend) === null || _k === undefined || _k.call(_j);
3509
+ }
3510
+ this.startIndex = endIndex + 1;
3511
+ }
3512
+ onend() {
3513
+ var _a, _b;
3514
+ if (this.cbs.onclosetag) {
3515
+ this.endIndex = this.startIndex;
3516
+ for (let index = 0;index < this.stack.length; index++) {
3517
+ this.cbs.onclosetag(this.stack[index], true);
3518
+ }
3519
+ }
3520
+ (_b = (_a = this.cbs).onend) === null || _b === undefined || _b.call(_a);
3521
+ }
3522
+ reset() {
3523
+ var _a, _b, _c, _d;
3524
+ (_b = (_a = this.cbs).onreset) === null || _b === undefined || _b.call(_a);
3525
+ this.tokenizer.reset();
3526
+ this.tagname = "";
3527
+ this.attribname = "";
3528
+ this.attribs = null;
3529
+ this.stack.length = 0;
3530
+ this.startIndex = 0;
3531
+ this.endIndex = 0;
3532
+ (_d = (_c = this.cbs).onparserinit) === null || _d === undefined || _d.call(_c, this);
3533
+ this.buffers.length = 0;
3534
+ this.foreignContext.length = 0;
3535
+ this.foreignContext.unshift(!this.htmlMode);
3536
+ this.bufferOffset = 0;
3537
+ this.writeIndex = 0;
3538
+ this.ended = false;
3539
+ }
3540
+ parseComplete(data) {
3541
+ this.reset();
3542
+ this.end(data);
3543
+ }
3544
+ getSlice(start, end) {
3545
+ while (start - this.bufferOffset >= this.buffers[0].length) {
3546
+ this.shiftBuffer();
3547
+ }
3548
+ let slice = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset);
3549
+ while (end - this.bufferOffset > this.buffers[0].length) {
3550
+ this.shiftBuffer();
3551
+ slice += this.buffers[0].slice(0, end - this.bufferOffset);
3552
+ }
3553
+ return slice;
3554
+ }
3555
+ shiftBuffer() {
3556
+ this.bufferOffset += this.buffers[0].length;
3557
+ this.writeIndex--;
3558
+ this.buffers.shift();
3559
+ }
3560
+ write(chunk) {
3561
+ var _a, _b;
3562
+ if (this.ended) {
3563
+ (_b = (_a = this.cbs).onerror) === null || _b === undefined || _b.call(_a, new Error(".write() after done!"));
3564
+ return;
3565
+ }
3566
+ this.buffers.push(chunk);
3567
+ if (this.tokenizer.running) {
3568
+ this.tokenizer.write(chunk);
3569
+ this.writeIndex++;
3570
+ }
3571
+ }
3572
+ end(chunk) {
3573
+ var _a, _b;
3574
+ if (this.ended) {
3575
+ (_b = (_a = this.cbs).onerror) === null || _b === undefined || _b.call(_a, new Error(".end() after done!"));
3576
+ return;
3577
+ }
3578
+ if (chunk)
3579
+ this.write(chunk);
3580
+ this.ended = true;
3581
+ this.tokenizer.end();
3582
+ }
3583
+ pause() {
3584
+ this.tokenizer.pause();
3585
+ }
3586
+ resume() {
3587
+ this.tokenizer.resume();
3588
+ while (this.tokenizer.running && this.writeIndex < this.buffers.length) {
3589
+ this.tokenizer.write(this.buffers[this.writeIndex++]);
3590
+ }
3591
+ if (this.ended)
3592
+ this.tokenizer.end();
3593
+ }
3594
+ parseChunk(chunk) {
3595
+ this.write(chunk);
3596
+ }
3597
+ done(chunk) {
3598
+ this.end(chunk);
3599
+ }
3600
+ }
3601
+ // src/harness/linter.ts
3602
+ var EMOJI_REGEX = /\p{Extended_Pictographic}/u;
3603
+ function checkTagName(name, violations) {
3604
+ if (/^[A-Z]/.test(name)) {
3605
+ violations.push({
3606
+ type: "FRAMEWORK_COMPONENT",
3607
+ target: `<${name}>`,
3608
+ message: `Prohibited framework component tag '<${name}>' detected.`,
3609
+ remediation: `Replace '<${name}>' with a standard lowercase HTML5 element (e.g., <div>, <button>, <section>) styled with Tailwind utility classes.`
3610
+ });
3611
+ }
3612
+ }
3613
+ function checkAttributes(name, attribs, violations) {
3614
+ for (const [attrKey, attrVal] of Object.entries(attribs)) {
3615
+ if (attrKey === "className") {
3616
+ violations.push({
3617
+ type: "JSX_ATTRIBUTE",
3618
+ target: "className",
3619
+ message: `Prohibited JSX attribute 'className' detected on <${name}>.`,
3620
+ remediation: `Change 'className' to the standard HTML 'class' attribute.`
3621
+ });
3622
+ }
3623
+ if (/^on[A-Z]/.test(attrKey) || attrKey.startsWith("@") || attrKey.startsWith("v-") || attrKey.startsWith("*")) {
3624
+ violations.push({
3625
+ type: "JSX_ATTRIBUTE",
3626
+ target: attrKey,
3627
+ message: `Prohibited framework event/directive attribute '${attrKey}' detected on <${name}>.`,
3628
+ remediation: "Remove framework event bindings. Use vanilla HTML and minimal vanilla JavaScript if needed."
3629
+ });
3630
+ }
3631
+ if (attrKey === "href" && name.toLowerCase() === "a") {
3632
+ const trimmed = attrVal.trim();
3633
+ const isInternal = trimmed.startsWith("#") || trimmed.startsWith("javascript:");
3634
+ if (!isInternal && trimmed.length > 0) {
3635
+ violations.push({
3636
+ type: "NAVIGATION_PROHIBITED",
3637
+ target: `href="${attrVal}"`,
3638
+ message: `Cross-page or external navigation '<a href="${attrVal}">' is prohibited.`,
3639
+ remediation: `Refira prototypes run in a sandboxed iframe. Replace with in-page anchor (e.g. href="#features") or placeholder (href="#").`
3640
+ });
3641
+ }
3642
+ }
3643
+ if (EMOJI_REGEX.test(attrVal)) {
3644
+ violations.push({
3645
+ type: "EMOJI_PROHIBITED",
3646
+ target: attrVal,
3647
+ message: `Raw unicode emoji character detected inside attribute '${attrKey}'.`,
3648
+ remediation: "Remove emoji characters from HTML markup. Use standard SVG icons (e.g., Lucide Icons or Heroicons) instead."
3649
+ });
3650
+ }
3651
+ }
3652
+ }
3653
+ function checkScriptTag(attribs, violations) {
3654
+ const src = attribs.src?.toLowerCase() ?? "";
3655
+ if (src.includes("react") || src.includes("vue") || src.includes("angular") || src.includes("svelte")) {
3656
+ violations.push({
3657
+ type: "FRAMEWORK_IMPORT",
3658
+ target: src,
3659
+ message: `Prohibited framework script import '${src}' detected.`,
3660
+ remediation: "Remove framework script tags. Refira prototypes must be standalone HTML5 with Tailwind CSS."
3661
+ });
3662
+ }
3663
+ return src.includes("tailwindcss.com");
3664
+ }
3665
+ function validateHtmlMarkup(htmlContent) {
3666
+ const violations = [];
3667
+ let hasTailwind = false;
3668
+ let inScriptTag = false;
3669
+ const parser = new Parser({
3670
+ onopentag(name, attribs) {
3671
+ checkTagName(name, violations);
3672
+ checkAttributes(name, attribs, violations);
3673
+ if (name.toLowerCase() === "script") {
3674
+ inScriptTag = true;
3675
+ if (checkScriptTag(attribs, violations)) {
3676
+ hasTailwind = true;
3677
+ }
3678
+ }
3679
+ },
3680
+ ontext(text) {
3681
+ if (inScriptTag) {
3682
+ if (/import\s+.*from\s+['"](react|vue|svelte|angular)['"]/.test(text)) {
3683
+ violations.push({
3684
+ type: "FRAMEWORK_IMPORT",
3685
+ message: "Prohibited framework JS import detected in inline script.",
3686
+ remediation: "Remove framework imports. Use pure vanilla JavaScript without framework dependencies."
3687
+ });
3688
+ }
3689
+ return;
3690
+ }
3691
+ if (EMOJI_REGEX.test(text)) {
3692
+ violations.push({
3693
+ type: "EMOJI_PROHIBITED",
3694
+ target: text.trim().slice(0, 30),
3695
+ message: `Raw unicode emoji character detected in text node: "${text.trim().slice(0, 30)}"`,
3696
+ remediation: 'Remove emojis from HTML content. Use Lucide Icons CDN (<i data-lucide="...">) or inline SVG icons.'
3697
+ });
3698
+ }
3699
+ },
3700
+ onclosetag(name) {
3701
+ if (name.toLowerCase() === "script") {
3702
+ inScriptTag = false;
3703
+ }
3704
+ }
3705
+ }, {
3706
+ lowerCaseTags: false,
3707
+ lowerCaseAttributeNames: false
3708
+ });
3709
+ parser.write(htmlContent);
3710
+ parser.end();
3711
+ if (!hasTailwind && !htmlContent.includes("tailwindcss.com")) {
3712
+ violations.push({
3713
+ type: "MISSING_TAILWIND",
3714
+ message: "Tailwind CSS CDN script tag is missing in <head>.",
3715
+ remediation: 'Add <script src="https://cdn.tailwindcss.com"></script> in the document <head>.'
3716
+ });
3717
+ }
3718
+ return {
3719
+ valid: violations.length === 0,
3720
+ violations
3721
+ };
3722
+ }
3723
+
3724
+ // src/harness/reporter.ts
3725
+ function formatHarnessErrorReport(violations, filePath) {
3726
+ const lines = [
3727
+ "",
3728
+ "======================================================================",
3729
+ "❌ [REFIRA HARNESS] VALIDATION FAILED — EXIT CODE 1",
3730
+ "======================================================================",
3731
+ `Target File: ${filePath}`,
3732
+ `Total Violations Found: ${violations.length}`,
3733
+ "",
3734
+ "Violations:"
3735
+ ];
3736
+ violations.forEach((v, index) => {
3737
+ lines.push(` ${index + 1}. [${v.type}]`);
3738
+ if (v.target) {
3739
+ lines.push(` Target: ${v.target}`);
3740
+ }
3741
+ lines.push(` Problem: ${v.message}`);
3742
+ lines.push(` Remediation: ${v.remediation}`);
3743
+ lines.push("");
3744
+ });
3745
+ lines.push("======================================================================");
3746
+ lines.push("\uD83D\uDC49 ACTION REQUIRED FOR AI AGENT:");
3747
+ lines.push("1. Review the remediation instructions above for each violation.");
3748
+ lines.push("2. Edit the HTML file to eliminate prohibited framework syntax, emojis, or external links.");
3749
+ lines.push("3. Re-run `refira preview <file.html> --page <page>` until validation succeeds.");
3750
+ lines.push("======================================================================");
3751
+ lines.push("");
3752
+ return lines.join(`
3753
+ `);
3754
+ }
3755
+ function formatHarnessSuccessReport(pageSlug, previewUrl) {
3756
+ const lines = [
3757
+ "",
3758
+ "======================================================================",
3759
+ "✅ [REFIRA HARNESS] VALIDATION PASSED — EXIT CODE 0",
3760
+ "======================================================================",
3761
+ `Page '${pageSlug}' markup conforms to Refira HTML5 + Tailwind invariants.`
3762
+ ];
3763
+ if (previewUrl) {
3764
+ lines.push(`\uD83D\uDE80 Live Preview Updated: ${previewUrl}`);
3765
+ }
3766
+ lines.push("======================================================================");
3767
+ lines.push("");
3768
+ return lines.join(`
3769
+ `);
3770
+ }
3771
+
3772
+ // src/commands/preview.ts
3773
+ async function previewCommand(filePath, opts) {
3774
+ const pageSlug = opts.page?.trim().toLowerCase();
3775
+ if (!pageSlug) {
3776
+ console.error("❌ Error: --page <slug> is required. Example: refira preview index.html --page home");
3777
+ process.exit(1);
3778
+ }
3779
+ if (!fs3.existsSync(filePath)) {
3780
+ console.error(`❌ Error: File '${filePath}' does not exist.`);
3781
+ process.exit(1);
3782
+ }
3783
+ const content = fs3.readFileSync(filePath, "utf-8");
3784
+ console.log(`\uD83D\uDD0D Inspecting '${filePath}' with Refira Agent Harness...`);
3785
+ const validation = validateHtmlMarkup(content);
3786
+ if (!validation.valid) {
3787
+ const errorReport = formatHarnessErrorReport(validation.violations, filePath);
3788
+ console.error(errorReport);
3789
+ process.exit(1);
3790
+ }
3791
+ const config = loadConfig();
3792
+ if (!config.apiKey || !config.projectId) {
3793
+ console.log(formatHarnessSuccessReport(pageSlug));
3794
+ console.log("⚠️ Offline mode: Markup is valid. To stream live preview to Canvas, run `refira auth login`.");
3795
+ process.exit(0);
3796
+ }
3797
+ console.log(`\uD83D\uDE80 Harness passed! Streaming '${pageSlug}' to Refira Canvas...`);
3798
+ const client = new CliApiClient(config.apiUrl, config.apiKey);
3799
+ try {
3800
+ const result = await client.pushPreview(config.projectId, pageSlug, content);
3801
+ console.log(formatHarnessSuccessReport(pageSlug, result.preview_url));
3802
+ process.exit(0);
3803
+ } catch (err) {
3804
+ const msg = err instanceof Error ? err.message : String(err);
3805
+ console.error(`❌ Failed to stream preview to Refira: ${msg}`);
3806
+ process.exit(1);
3807
+ }
3808
+ }
3809
+
3810
+ // src/commands/scaffold.ts
3811
+ import fs4 from "node:fs";
3812
+
3813
+ // src/templates/scaffold-template.ts
3814
+ function generateScaffoldHtml(opts) {
3815
+ const fontSlug = opts.fontFamily.replace(/\s+/g, "+");
3816
+ const tailwindColorConfig = opts.colorTokens ? `colors: ${JSON.stringify(opts.colorTokens, null, 2)},` : "";
3817
+ return `<!DOCTYPE html>
3818
+ <html lang="en">
3819
+ <head>
3820
+ <meta charset="UTF-8">
3821
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
3822
+ <title>${opts.pageName} — ${opts.projectName}</title>
3823
+
3824
+ <!-- Google Fonts: ${opts.fontFamily} -->
3825
+ <link rel="preconnect" href="https://fonts.googleapis.com">
3826
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3827
+ <link href="https://fonts.googleapis.com/css2?family=${fontSlug}:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
3828
+
3829
+ <!-- Tailwind CSS CDN -->
3830
+ <script src="https://cdn.tailwindcss.com"></script>
3831
+ <script>
3832
+ tailwind.config = {
3833
+ theme: {
3834
+ extend: {
3835
+ fontFamily: {
3836
+ sans: ['"${opts.fontFamily}"', 'ui-sans-serif', 'system-ui', 'sans-serif'],
3837
+ },
3838
+ ${tailwindColorConfig}
3839
+ }
3840
+ }
3841
+ }
3842
+ </script>
3843
+
3844
+ <!-- Lucide Icons CDN -->
3845
+ <script src="https://unpkg.com/lucide@latest"></script>
3846
+ </head>
3847
+ <body class="bg-slate-50 font-sans text-slate-900 min-h-screen antialiased">
3848
+ <!-- ====================================================================== -->
3849
+ <!-- [REFIRA CANVAS SLOT: START] -->
3850
+ <!-- AI Agent: Write your standalone HTML5 + Tailwind CSS layout here. -->
3851
+ <!-- Guidelines: -->
3852
+ <!-- - Use standard HTML5 tags (e.g. <header>, <main>, <section>, <button>) -->
3853
+ <!-- - No React/Vue/JSX (do NOT use className or onClick={...}) -->
3854
+ <!-- - No raw unicode emojis; use Lucide icons (<i data-lucide="..."></i>) -->
3855
+ <!-- - In-page links only (e.g. href="#pricing"); no external navigations -->
3856
+ <!-- ====================================================================== -->
3857
+
3858
+ <main class="container mx-auto px-4 py-12 max-w-6xl">
3859
+ <div class="text-center space-y-4 py-16">
3860
+ <div class="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-blue-50 border border-blue-200 text-blue-700 text-xs font-semibold tracking-wide uppercase">
3861
+ <i data-lucide="sparkles" class="w-3.5 h-3.5"></i>
3862
+ <span>${opts.projectName}</span>
3863
+ </div>
3864
+ <h1 class="text-4xl md:text-5xl font-bold tracking-tight text-slate-900">
3865
+ ${opts.pageName}
3866
+ </h1>
3867
+ <p class="text-slate-600 max-w-2xl mx-auto text-lg leading-relaxed">
3868
+ Start crafting your prototype layout using Tailwind utility classes.
3869
+ </p>
3870
+ </div>
3871
+ </main>
3872
+
3873
+ <!-- ====================================================================== -->
3874
+ <!-- [REFIRA CANVAS SLOT: END] -->
3875
+ <!-- ====================================================================== -->
3876
+
3877
+ <script>
3878
+ // Initialize Lucide Icons automatically
3879
+ lucide.createIcons();
3880
+ </script>
3881
+ </body>
3882
+ </html>
3883
+ `;
3884
+ }
3885
+
3886
+ // src/commands/scaffold.ts
3887
+ async function scaffoldCommand(opts) {
3888
+ const pageSlug = opts.page.trim().toLowerCase();
3889
+ if (!pageSlug) {
3890
+ console.error("❌ Error: --page <slug> is required.");
3891
+ process.exit(1);
3892
+ }
3893
+ const config = loadConfig();
3894
+ let projectName = "Refira Project";
3895
+ let fontFamily = "Inter";
3896
+ let colorTokens;
3897
+ if (config.apiKey && config.projectId) {
3898
+ try {
3899
+ const client = new CliApiClient(config.apiUrl, config.apiKey);
3900
+ const data = await client.getProjectContext(config.projectId);
3901
+ projectName = data.context.project.name || projectName;
3902
+ fontFamily = data.context.tokens?.typography?.font_family || data.context.project.fontFamily || fontFamily;
3903
+ colorTokens = data.context.tokens?.color;
3904
+ } catch {}
3905
+ }
3906
+ const pageName = pageSlug.replace(/-/g, " ").replace(/\b\w/g, (char) => char.toUpperCase());
3907
+ const html = generateScaffoldHtml({
3908
+ pageName,
3909
+ projectName,
3910
+ fontFamily,
3911
+ colorTokens
3912
+ });
3913
+ const targetPath = opts.output ?? `${pageSlug}.html`;
3914
+ fs4.writeFileSync(targetPath, html, "utf-8");
3915
+ console.log(`✅ Scaffolded starter page '${targetPath}' successfully!`);
3916
+ console.log(` Font: ${fontFamily}`);
3917
+ console.log(" Slot: <!-- [REFIRA CANVAS SLOT: START] -->");
3918
+ console.log(`
3919
+ Next step: Edit '${targetPath}', then execute:`);
3920
+ console.log(` refira preview ${targetPath} --page ${pageSlug}`);
3921
+ }
3922
+
3923
+ // src/commands/skill.ts
3924
+ import fs5 from "node:fs";
3925
+ import os2 from "node:os";
3926
+ import path3 from "node:path";
3927
+ async function skillInstallCommand(opts) {
3928
+ const baseDir = opts.global ? path3.join(os2.homedir(), ".agents", "skills", "refira") : path3.join(process.cwd(), ".agents", "skills", "refira");
3929
+ fs5.mkdirSync(baseDir, { recursive: true });
3930
+ const targetFile = path3.join(baseDir, "SKILL.md");
3931
+ const content = generateRefiraSkill();
3932
+ fs5.writeFileSync(targetFile, content, "utf-8");
3933
+ console.log("✅ Refira Design Craftsmanship Skill installed successfully!");
3934
+ console.log(` Location: ${targetFile}`);
3935
+ console.log(` Scope: ${opts.global ? "Global (~/.agents/skills/refira)" : "Local (.agents/skills/refira)"}`);
3936
+ console.log(`
3937
+ AI coding agents will automatically recognize this skill for high-aesthetic prototype design.`);
3938
+ }
3939
+
3940
+ // src/index.ts
3941
+ var program2 = new Command2;
3942
+ program2.name("refira").description("Refira CLI tool and AI Agent Harness for deterministic prototype generation").version("0.1.0");
3943
+ var auth = program2.command("auth").description("Manage Refira API authentication and sessions");
3944
+ auth.command("login").description("Login to Refira using an API key").option("--api-url <url>", "Refira backend API base URL", "http://localhost:3001").option("--api-key <key>", "Project API key (rfr_...)").option("-g, --global", "Save credentials globally in user home directory", false).action(loginCommand);
3945
+ auth.command("status").description("Verify and display current Refira authentication session").action(statusCommand);
3946
+ program2.command("init").description("Initialize a Refira project workspace, generating AGENTS.md, .cursorrules, and skills").requiredOption("--project-id <id>", "Target project UUID").option("--api-url <url>", "Refira backend API base URL").option("--api-key <key>", "Project API key (rfr_...)").action(initCommand);
3947
+ program2.command("context").description("Inspect design tokens, color palette, typography, and page roster").option("--project-id <id>", "Project UUID").action(contextCommand);
3948
+ program2.command("scaffold").description("Generate a clean HTML5 + Tailwind starter template for a page").requiredOption("--page <slug>", "Page slug (e.g. checkout, dashboard, landing)").option("--output <path>", "Destination file path").action(scaffoldCommand);
3949
+ program2.command("preview").description("Inspect HTML markup with Agent Harness and stream to Refira Canvas").argument("<file>", "Path to HTML file to preview").requiredOption("--page <slug>", "Target page slug").action(previewCommand);
3950
+ var skill = program2.command("skill").description("Manage Refira Agent Skills");
3951
+ skill.command("install").description("Install the Refira design craftsmanship skill (.agents/skills/refira/SKILL.md)").option("-g, --global", "Install globally into user home directory (~/.agents/skills/refira)", false).action(skillInstallCommand);
3952
+ program2.parse();