@shell-shock/plugin-completions 0.2.24 → 0.3.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 (117) hide show
  1. package/README.md +1 -1
  2. package/dist/components/bash-config-command.cjs +132 -0
  3. package/dist/components/bash-config-command.d.cts +10 -0
  4. package/dist/components/bash-config-command.d.cts.map +1 -0
  5. package/dist/components/bash-config-command.d.mts +10 -0
  6. package/dist/components/bash-config-command.d.mts.map +1 -0
  7. package/dist/components/bash-config-command.mjs +132 -0
  8. package/dist/components/bash-config-command.mjs.map +1 -0
  9. package/dist/components/bash-script-command.cjs +106 -0
  10. package/dist/components/bash-script-command.d.cts +10 -0
  11. package/dist/components/bash-script-command.d.cts.map +1 -0
  12. package/dist/components/bash-script-command.d.mts +10 -0
  13. package/dist/components/bash-script-command.d.mts.map +1 -0
  14. package/dist/components/bash-script-command.mjs +106 -0
  15. package/dist/components/bash-script-command.mjs.map +1 -0
  16. package/dist/components/bash-shared.cjs +172 -0
  17. package/dist/components/bash-shared.d.cts +10 -0
  18. package/dist/components/bash-shared.d.cts.map +1 -0
  19. package/dist/components/bash-shared.d.mts +10 -0
  20. package/dist/components/bash-shared.d.mts.map +1 -0
  21. package/dist/components/bash-shared.mjs +172 -0
  22. package/dist/components/bash-shared.mjs.map +1 -0
  23. package/dist/components/fish-config-command.cjs +132 -0
  24. package/dist/components/fish-config-command.d.cts +10 -0
  25. package/dist/components/fish-config-command.d.cts.map +1 -0
  26. package/dist/components/fish-config-command.d.mts +10 -0
  27. package/dist/components/fish-config-command.d.mts.map +1 -0
  28. package/dist/components/fish-config-command.mjs +132 -0
  29. package/dist/components/fish-config-command.mjs.map +1 -0
  30. package/dist/components/fish-script-command.cjs +106 -0
  31. package/dist/components/fish-script-command.d.cts +10 -0
  32. package/dist/components/fish-script-command.d.cts.map +1 -0
  33. package/dist/components/fish-script-command.d.mts +10 -0
  34. package/dist/components/fish-script-command.d.mts.map +1 -0
  35. package/dist/components/fish-script-command.mjs +106 -0
  36. package/dist/components/fish-script-command.mjs.map +1 -0
  37. package/dist/components/{fish-command.cjs → fish-shared.cjs} +40 -144
  38. package/dist/components/fish-shared.d.cts +10 -0
  39. package/dist/components/fish-shared.d.cts.map +1 -0
  40. package/dist/components/fish-shared.d.mts +10 -0
  41. package/dist/components/fish-shared.d.mts.map +1 -0
  42. package/dist/components/{fish-command.mjs → fish-shared.mjs} +45 -149
  43. package/dist/components/fish-shared.mjs.map +1 -0
  44. package/dist/components/index.cjs +24 -8
  45. package/dist/components/index.d.cts +13 -5
  46. package/dist/components/index.d.mts +13 -5
  47. package/dist/components/index.mjs +13 -5
  48. package/dist/components/powershell-config-command.cjs +128 -0
  49. package/dist/components/powershell-config-command.d.cts +7 -0
  50. package/dist/components/powershell-config-command.d.cts.map +1 -0
  51. package/dist/components/powershell-config-command.d.mts +7 -0
  52. package/dist/components/powershell-config-command.d.mts.map +1 -0
  53. package/dist/components/powershell-config-command.mjs +128 -0
  54. package/dist/components/powershell-config-command.mjs.map +1 -0
  55. package/dist/components/powershell-script-command.cjs +106 -0
  56. package/dist/components/powershell-script-command.d.cts +10 -0
  57. package/dist/components/powershell-script-command.d.cts.map +1 -0
  58. package/dist/components/powershell-script-command.d.mts +10 -0
  59. package/dist/components/powershell-script-command.d.mts.map +1 -0
  60. package/dist/components/powershell-script-command.mjs +106 -0
  61. package/dist/components/powershell-script-command.mjs.map +1 -0
  62. package/dist/components/{powershell-command.cjs → powershell-shared.cjs} +40 -146
  63. package/dist/components/powershell-shared.d.cts +10 -0
  64. package/dist/components/powershell-shared.d.cts.map +1 -0
  65. package/dist/components/powershell-shared.d.mts +10 -0
  66. package/dist/components/powershell-shared.d.mts.map +1 -0
  67. package/dist/components/{powershell-command.mjs → powershell-shared.mjs} +44 -150
  68. package/dist/components/powershell-shared.mjs.map +1 -0
  69. package/dist/components/zsh-config-command.cjs +132 -0
  70. package/dist/components/zsh-config-command.d.cts +10 -0
  71. package/dist/components/zsh-config-command.d.cts.map +1 -0
  72. package/dist/components/zsh-config-command.d.mts +10 -0
  73. package/dist/components/zsh-config-command.d.mts.map +1 -0
  74. package/dist/components/zsh-config-command.mjs +132 -0
  75. package/dist/components/zsh-config-command.mjs.map +1 -0
  76. package/dist/components/zsh-script-command.cjs +111 -0
  77. package/dist/components/zsh-script-command.d.cts +10 -0
  78. package/dist/components/zsh-script-command.d.cts.map +1 -0
  79. package/dist/components/zsh-script-command.d.mts +10 -0
  80. package/dist/components/zsh-script-command.d.mts.map +1 -0
  81. package/dist/components/zsh-script-command.mjs +111 -0
  82. package/dist/components/zsh-script-command.mjs.map +1 -0
  83. package/dist/components/{zsh-command.cjs → zsh-shared.cjs} +41 -147
  84. package/dist/components/zsh-shared.d.cts +10 -0
  85. package/dist/components/zsh-shared.d.cts.map +1 -0
  86. package/dist/components/zsh-shared.d.mts +10 -0
  87. package/dist/components/zsh-shared.d.mts.map +1 -0
  88. package/dist/components/{zsh-command.mjs → zsh-shared.mjs} +45 -151
  89. package/dist/components/zsh-shared.mjs.map +1 -0
  90. package/dist/index.cjs +232 -68
  91. package/dist/index.d.cts.map +1 -1
  92. package/dist/index.d.mts.map +1 -1
  93. package/dist/index.mjs +232 -68
  94. package/dist/index.mjs.map +1 -1
  95. package/package.json +148 -36
  96. package/dist/components/bash-command.cjs +0 -276
  97. package/dist/components/bash-command.d.cts +0 -10
  98. package/dist/components/bash-command.d.cts.map +0 -1
  99. package/dist/components/bash-command.d.mts +0 -10
  100. package/dist/components/bash-command.d.mts.map +0 -1
  101. package/dist/components/bash-command.mjs +0 -276
  102. package/dist/components/bash-command.mjs.map +0 -1
  103. package/dist/components/fish-command.d.cts +0 -10
  104. package/dist/components/fish-command.d.cts.map +0 -1
  105. package/dist/components/fish-command.d.mts +0 -10
  106. package/dist/components/fish-command.d.mts.map +0 -1
  107. package/dist/components/fish-command.mjs.map +0 -1
  108. package/dist/components/powershell-command.d.cts +0 -10
  109. package/dist/components/powershell-command.d.cts.map +0 -1
  110. package/dist/components/powershell-command.d.mts +0 -10
  111. package/dist/components/powershell-command.d.mts.map +0 -1
  112. package/dist/components/powershell-command.mjs.map +0 -1
  113. package/dist/components/zsh-command.d.cts +0 -10
  114. package/dist/components/zsh-command.d.cts.map +0 -1
  115. package/dist/components/zsh-command.d.mts +0 -10
  116. package/dist/components/zsh-command.d.mts.map +0 -1
  117. package/dist/components/zsh-command.mjs.map +0 -1
@@ -1,112 +1,39 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_helpers_complete_command = require('../helpers/complete-command.cjs');
3
3
  const require_helpers_completion_directive_constants = require('../helpers/completion-directive-constants.cjs');
4
+ require('../helpers/index.cjs');
4
5
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
6
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
6
7
  let _alloy_js_core = require("@alloy-js/core");
7
8
  let _alloy_js_typescript = require("@alloy-js/typescript");
8
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
9
9
  let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
10
10
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
11
11
  let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
12
- let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
13
12
  let _stryke_path = require("@stryke/path");
14
- let _stryke_string_format = require("@stryke/string-format");
13
+ let _stryke_string_format_snake_case = require("@stryke/string-format/snake-case");
15
14
 
16
- //#region src/components/zsh-command.tsx
15
+ //#region src/components/zsh-shared.tsx
17
16
  /**
18
- * The Zsh Completions commands' handler wrapper for the Shell Shock project.
17
+ * The Zsh Completions generation for the Shell Shock project.
19
18
  */
20
- function ZshCompletionsCommand() {
19
+ function ZshCompletionsShared() {
21
20
  const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
22
21
  const bin = (0, _alloy_js_core.computed)(() => (0, _shell_shock_core_plugin_utils.getAppBin)(context));
23
- const name = (0, _alloy_js_core.computed)(() => (0, _stryke_string_format.snakeCase)(bin.value));
22
+ const name = (0, _alloy_js_core.computed)(() => (0, _stryke_string_format_snake_case.snakeCase)(bin.value));
24
23
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
25
24
  get path() {
26
- return (0, _stryke_path.joinPaths)(context.entryPath, "completions", "zsh", "command.ts");
25
+ return (0, _stryke_path.joinPaths)(context.entryPath, "completions", "zsh", "shared.ts");
27
26
  },
28
- imports: {
29
- "node:os": "os",
30
- "node:path": ["join"],
31
- "node:fs/promises": ["readFile", "writeFile"]
32
- },
33
- builtinImports: { "shell-shock:console": [
34
- "colors",
35
- "writeLine",
36
- "success",
37
- "warn",
38
- "stripAnsi"
39
- ] },
27
+ builtinImports: { console: ["colors"] },
40
28
  get children() {
41
29
  return [
42
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Zsh completions command." }),
43
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
44
- "export": true,
45
- name: "ZshCompletionsOptions",
46
- get children() {
47
- return [
48
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
49
- heading: "The path to write the completion script to.",
50
- get children() {
51
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `If no extension is provided, the \`.zsh\` extension will be used.` }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
52
- get type() {
53
- return _powerlines_deepkit_vendor_type.ReflectionKind.string;
54
- },
55
- get defaultValue() {
56
- return `${bin.value}-completions.zsh`;
57
- }
58
- })];
59
- }
60
- }),
61
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
62
- name: "script",
63
- optional: true,
64
- type: "string | true"
65
- }),
66
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
67
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
68
- heading: "The Zsh configuration file to append the completion script to.",
69
- get children() {
70
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The generated completion script will be appended to the specified configuration file. Possible values for the Zsh configuration file include: \\n- \`~/.zshrc\` \\n- \`~/.zprofile\`` }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
71
- get type() {
72
- return _powerlines_deepkit_vendor_type.ReflectionKind.string;
73
- },
74
- defaultValue: "~/.zshrc"
75
- })];
76
- }
77
- }),
78
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
79
- name: "config",
80
- optional: true,
81
- type: "string | true"
82
- })
83
- ];
84
- }
85
- }),
86
30
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
87
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Handler logic for the \\`completions zsh\\` command." }),
88
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
31
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
32
+ "const": true,
89
33
  "export": true,
90
- "default": true,
91
- async: true,
92
- name: "handler",
93
- parameters: [{
94
- name: "options",
95
- type: "ZshCompletionsOptions"
96
- }],
97
- get children() {
98
- return [
99
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
100
- "const": true,
101
- name: "completions",
102
- type: "string",
103
- get initializer() {
104
- return _alloy_js_core.code` \`#compdef ${bin.value}
105
- compdef _${name.value} ${bin.value}
106
-
107
- # zsh completion for ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} -*- shell-script -*-
108
-
109
- __${name.value}_debug() {
34
+ name: "SHELL_COMPLETIONS",
35
+ get initializer() {
36
+ return _alloy_js_core.code` \`__${name.value}_debug() {
110
37
  local file="$BASH_COMP_DEBUG_FILE"
111
38
  if [[ -n \\\${file} ]]; then
112
39
  echo "$*" >> "\\\${file}"
@@ -315,68 +242,35 @@ if [ "\\\${funcstack[1]}" = "_${name.value}" ]; then
315
242
  _${name.value}
316
243
  fi
317
244
  \`; `;
318
- }
319
- }),
320
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
321
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
322
- condition: _alloy_js_core.code`options.config`,
323
- get children() {
324
- return [
325
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
326
- "let": true,
327
- name: "configFilePath",
328
- type: "string",
329
- initializer: _alloy_js_core.code`options.config === true ? "~/.zshrc" : options.config`
330
- }),
331
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
332
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
333
- condition: _alloy_js_core.code`configFilePath.startsWith("~")`,
334
- children: _alloy_js_core.code`configFilePath = join(os.homedir(), configFilePath.replace("~", "")); `
335
- }),
336
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
337
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
338
- "let": true,
339
- name: "configFileContent",
340
- type: "string",
341
- initializer: _alloy_js_core.code`"";`
342
- }),
343
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
344
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`try {
345
- configFileContent = await readFile(configFilePath, "utf8");
346
- } catch (error) {
347
- if (Error.isError(error) && error.code === "ENOENT") {
348
- // If the file doesn't exist, we can create it later when writing the completion script.
349
- warn(\`Configuration file \${colors.bold(configFilePath)} does not exist. It will be created when the completion script is written.\`);
350
- } else {
351
- return { error };
352
- }
245
+ }
246
+ }),
247
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
248
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
249
+ "export": true,
250
+ "const": true,
251
+ name: "SHELL_COMPLETIONS_DISPLAY",
252
+ initializer: _alloy_js_core.code` SHELL_COMPLETIONS.split("\\n").map(line => {
253
+ if (!line.trim()) {
254
+ return "";
255
+ }
256
+ if (line.trim().startsWith("#")) {
257
+ return \`\${colors.dim(line)}\`;
353
258
  }
354
259
 
355
- await writeFile(configFilePath, \`\${configFileContent}\\n\\n\${stripAnsi(completions)}\`);
356
-
357
- success(\`${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} Zsh completion script has been generated and appended to \${colors.bold(configFilePath)}. Please restart your terminal or run \`source \${configFilePath}\` to apply the changes.\`); `)
358
- ];
359
- }
360
- }),
361
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
362
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
363
- condition: _alloy_js_core.code`options.script`,
364
- get children() {
365
- return _alloy_js_core.code`const outputPath = options.script === true ? "${name.value}-completions.zsh" : options.script;
366
- await writeFile(outputPath, stripAnsi(completions));
367
-
368
- success(\`${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} Zsh completion script has been generated at \${colors.bold(outputPath)}.\`);`;
369
- }
370
- }),
371
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
372
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
373
- condition: _alloy_js_core.code`!options.config && !options.script`,
374
- children: _alloy_js_core.code`writeLine(" ------------------------------------------------- ");
375
- writeLine(completions);
376
- writeLine(" ------------------------------------------------- ");`
377
- })
378
- ];
379
- }
260
+ return colors.white(line).replaceAll(/(?<=\\\$(\\{|\\()).*(?=(\\}\\)))/g, colors.green("$&"))
261
+ .replaceAll(/\\".*\\"/g, colors.cyan("$&"))
262
+ .replaceAll(/(\\[|\\]|\\(|\\)|\\||<|>|\\$\\(|\\$?\\{|\\}|\\+|=|;|:)/g, colors.bold(colors.gray("$&")))
263
+ .replaceAll(/(readonly|complete)\\s+/g, colors.green("$&"))
264
+ .replaceAll(/(?<=(readonly|complete)\\s+)\\w/g, colors.bold(colors.greenBright("$&")))
265
+ .replaceAll(/local\\s+/g, colors.red("$&"))
266
+ .replaceAll(/(?<=local\\s+)\\w/g, colors.bold(colors.redBright("$&")))
267
+ .replaceAll(/(for|while)\\s+/g, colors.cyan("$&"))
268
+ .replaceAll(/(?<=for|while\\s+)\\w/g, colors.bold(colors.cyanBright("$&")))
269
+ .replaceAll(/(return|if|fi|else|elif|then|done)\\s+/g, colors.green("$&"))
270
+ .replaceAll(/__\\w/g, colors.bold(colors.magentaBright("$&")))
271
+ .replaceAll(/(?<=\\s)(-\\w|--\\w[\\w-]*)(?=\\s|$)/g, colors.bold(colors.magenta("$&")));
272
+
273
+ }).join("\\n"); `
380
274
  })
381
275
  ];
382
276
  }
@@ -384,4 +278,4 @@ fi
384
278
  }
385
279
 
386
280
  //#endregion
387
- exports.ZshCompletionsCommand = ZshCompletionsCommand;
281
+ exports.ZshCompletionsShared = ZshCompletionsShared;
@@ -0,0 +1,10 @@
1
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
2
+
3
+ //#region src/components/zsh-shared.d.ts
4
+ /**
5
+ * The Zsh Completions generation for the Shell Shock project.
6
+ */
7
+ declare function ZshCompletionsShared(): _$_alloy_js_core0.Children;
8
+ //#endregion
9
+ export { ZshCompletionsShared };
10
+ //# sourceMappingURL=zsh-shared.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zsh-shared.d.cts","names":[],"sources":["../../src/components/zsh-shared.tsx"],"mappings":";;;;;;iBAiCgB,oBAAA,CAAA,GAAoB,iBAAA,CAAA,QAAA"}
@@ -0,0 +1,10 @@
1
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
2
+
3
+ //#region src/components/zsh-shared.d.ts
4
+ /**
5
+ * The Zsh Completions generation for the Shell Shock project.
6
+ */
7
+ declare function ZshCompletionsShared(): _$_alloy_js_core0.Children;
8
+ //#endregion
9
+ export { ZshCompletionsShared };
10
+ //# sourceMappingURL=zsh-shared.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zsh-shared.d.mts","names":[],"sources":["../../src/components/zsh-shared.tsx"],"mappings":";;;;;;iBAiCgB,oBAAA,CAAA,GAAoB,iBAAA,CAAA,QAAA"}
@@ -1,111 +1,38 @@
1
1
  import { EXEC_COMMAND } from "../helpers/complete-command.mjs";
2
2
  import { CompletionDirective } from "../helpers/completion-directive-constants.mjs";
3
- import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
4
- import { getAppBin, getAppTitle } from "@shell-shock/core/plugin-utils";
3
+ import "../helpers/index.mjs";
4
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
5
+ import { getAppBin } from "@shell-shock/core/plugin-utils";
5
6
  import { code, computed } from "@alloy-js/core";
6
- import { FunctionDeclaration, IfStatement, InterfaceDeclaration, VarDeclaration } from "@alloy-js/typescript";
7
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
7
+ import { VarDeclaration } from "@alloy-js/typescript";
8
8
  import { Spacing } from "@powerlines/plugin-alloy/core";
9
9
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
10
- import { InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
11
- import { TSDoc, TSDocDefaultValue, TSDocRemarks } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
10
+ import { TypescriptFile } from "@powerlines/plugin-alloy/typescript";
12
11
  import { joinPaths } from "@stryke/path";
13
- import { snakeCase } from "@stryke/string-format";
12
+ import { snakeCase } from "@stryke/string-format/snake-case";
14
13
 
15
- //#region src/components/zsh-command.tsx
14
+ //#region src/components/zsh-shared.tsx
16
15
  /**
17
- * The Zsh Completions commands' handler wrapper for the Shell Shock project.
16
+ * The Zsh Completions generation for the Shell Shock project.
18
17
  */
19
- function ZshCompletionsCommand() {
18
+ function ZshCompletionsShared() {
20
19
  const context = usePowerlines();
21
20
  const bin = computed(() => getAppBin(context));
22
21
  const name = computed(() => snakeCase(bin.value));
23
22
  return createComponent(TypescriptFile, {
24
23
  get path() {
25
- return joinPaths(context.entryPath, "completions", "zsh", "command.ts");
24
+ return joinPaths(context.entryPath, "completions", "zsh", "shared.ts");
26
25
  },
27
- imports: {
28
- "node:os": "os",
29
- "node:path": ["join"],
30
- "node:fs/promises": ["readFile", "writeFile"]
31
- },
32
- builtinImports: { "shell-shock:console": [
33
- "colors",
34
- "writeLine",
35
- "success",
36
- "warn",
37
- "stripAnsi"
38
- ] },
26
+ builtinImports: { console: ["colors"] },
39
27
  get children() {
40
28
  return [
41
- createComponent(TSDoc, { heading: "Options for the Zsh completions command." }),
42
- createComponent(InterfaceDeclaration, {
43
- "export": true,
44
- name: "ZshCompletionsOptions",
45
- get children() {
46
- return [
47
- createComponent(TSDoc, {
48
- heading: "The path to write the completion script to.",
49
- get children() {
50
- return [createComponent(TSDocRemarks, { children: `If no extension is provided, the \`.zsh\` extension will be used.` }), createComponent(TSDocDefaultValue, {
51
- get type() {
52
- return ReflectionKind.string;
53
- },
54
- get defaultValue() {
55
- return `${bin.value}-completions.zsh`;
56
- }
57
- })];
58
- }
59
- }),
60
- createComponent(InterfaceMember, {
61
- name: "script",
62
- optional: true,
63
- type: "string | true"
64
- }),
65
- createComponent(Spacing, {}),
66
- createComponent(TSDoc, {
67
- heading: "The Zsh configuration file to append the completion script to.",
68
- get children() {
69
- return [createComponent(TSDocRemarks, { children: `The generated completion script will be appended to the specified configuration file. Possible values for the Zsh configuration file include: \\n- \`~/.zshrc\` \\n- \`~/.zprofile\`` }), createComponent(TSDocDefaultValue, {
70
- get type() {
71
- return ReflectionKind.string;
72
- },
73
- defaultValue: "~/.zshrc"
74
- })];
75
- }
76
- }),
77
- createComponent(InterfaceMember, {
78
- name: "config",
79
- optional: true,
80
- type: "string | true"
81
- })
82
- ];
83
- }
84
- }),
85
29
  createComponent(Spacing, {}),
86
- createComponent(TSDoc, { heading: "Handler logic for the \\`completions zsh\\` command." }),
87
- createComponent(FunctionDeclaration, {
30
+ createComponent(VarDeclaration, {
31
+ "const": true,
88
32
  "export": true,
89
- "default": true,
90
- async: true,
91
- name: "handler",
92
- parameters: [{
93
- name: "options",
94
- type: "ZshCompletionsOptions"
95
- }],
96
- get children() {
97
- return [
98
- createComponent(VarDeclaration, {
99
- "const": true,
100
- name: "completions",
101
- type: "string",
102
- get initializer() {
103
- return code` \`#compdef ${bin.value}
104
- compdef _${name.value} ${bin.value}
105
-
106
- # zsh completion for ${getAppTitle(context)} -*- shell-script -*-
107
-
108
- __${name.value}_debug() {
33
+ name: "SHELL_COMPLETIONS",
34
+ get initializer() {
35
+ return code` \`__${name.value}_debug() {
109
36
  local file="$BASH_COMP_DEBUG_FILE"
110
37
  if [[ -n \\\${file} ]]; then
111
38
  echo "$*" >> "\\\${file}"
@@ -314,68 +241,35 @@ if [ "\\\${funcstack[1]}" = "_${name.value}" ]; then
314
241
  _${name.value}
315
242
  fi
316
243
  \`; `;
317
- }
318
- }),
319
- createComponent(Spacing, {}),
320
- createComponent(IfStatement, {
321
- condition: code`options.config`,
322
- get children() {
323
- return [
324
- createComponent(VarDeclaration, {
325
- "let": true,
326
- name: "configFilePath",
327
- type: "string",
328
- initializer: code`options.config === true ? "~/.zshrc" : options.config`
329
- }),
330
- createComponent(Spacing, {}),
331
- createComponent(IfStatement, {
332
- condition: code`configFilePath.startsWith("~")`,
333
- children: code`configFilePath = join(os.homedir(), configFilePath.replace("~", "")); `
334
- }),
335
- createComponent(Spacing, {}),
336
- createComponent(VarDeclaration, {
337
- "let": true,
338
- name: "configFileContent",
339
- type: "string",
340
- initializer: code`"";`
341
- }),
342
- createComponent(Spacing, {}),
343
- memo(() => code`try {
344
- configFileContent = await readFile(configFilePath, "utf8");
345
- } catch (error) {
346
- if (Error.isError(error) && error.code === "ENOENT") {
347
- // If the file doesn't exist, we can create it later when writing the completion script.
348
- warn(\`Configuration file \${colors.bold(configFilePath)} does not exist. It will be created when the completion script is written.\`);
349
- } else {
350
- return { error };
351
- }
244
+ }
245
+ }),
246
+ createComponent(Spacing, {}),
247
+ createComponent(VarDeclaration, {
248
+ "export": true,
249
+ "const": true,
250
+ name: "SHELL_COMPLETIONS_DISPLAY",
251
+ initializer: code` SHELL_COMPLETIONS.split("\\n").map(line => {
252
+ if (!line.trim()) {
253
+ return "";
254
+ }
255
+ if (line.trim().startsWith("#")) {
256
+ return \`\${colors.dim(line)}\`;
352
257
  }
353
258
 
354
- await writeFile(configFilePath, \`\${configFileContent}\\n\\n\${stripAnsi(completions)}\`);
355
-
356
- success(\`${getAppTitle(context)} Zsh completion script has been generated and appended to \${colors.bold(configFilePath)}. Please restart your terminal or run \`source \${configFilePath}\` to apply the changes.\`); `)
357
- ];
358
- }
359
- }),
360
- createComponent(Spacing, {}),
361
- createComponent(IfStatement, {
362
- condition: code`options.script`,
363
- get children() {
364
- return code`const outputPath = options.script === true ? "${name.value}-completions.zsh" : options.script;
365
- await writeFile(outputPath, stripAnsi(completions));
366
-
367
- success(\`${getAppTitle(context)} Zsh completion script has been generated at \${colors.bold(outputPath)}.\`);`;
368
- }
369
- }),
370
- createComponent(Spacing, {}),
371
- createComponent(IfStatement, {
372
- condition: code`!options.config && !options.script`,
373
- children: code`writeLine(" ------------------------------------------------- ");
374
- writeLine(completions);
375
- writeLine(" ------------------------------------------------- ");`
376
- })
377
- ];
378
- }
259
+ return colors.white(line).replaceAll(/(?<=\\\$(\\{|\\()).*(?=(\\}\\)))/g, colors.green("$&"))
260
+ .replaceAll(/\\".*\\"/g, colors.cyan("$&"))
261
+ .replaceAll(/(\\[|\\]|\\(|\\)|\\||<|>|\\$\\(|\\$?\\{|\\}|\\+|=|;|:)/g, colors.bold(colors.gray("$&")))
262
+ .replaceAll(/(readonly|complete)\\s+/g, colors.green("$&"))
263
+ .replaceAll(/(?<=(readonly|complete)\\s+)\\w/g, colors.bold(colors.greenBright("$&")))
264
+ .replaceAll(/local\\s+/g, colors.red("$&"))
265
+ .replaceAll(/(?<=local\\s+)\\w/g, colors.bold(colors.redBright("$&")))
266
+ .replaceAll(/(for|while)\\s+/g, colors.cyan("$&"))
267
+ .replaceAll(/(?<=for|while\\s+)\\w/g, colors.bold(colors.cyanBright("$&")))
268
+ .replaceAll(/(return|if|fi|else|elif|then|done)\\s+/g, colors.green("$&"))
269
+ .replaceAll(/__\\w/g, colors.bold(colors.magentaBright("$&")))
270
+ .replaceAll(/(?<=\\s)(-\\w|--\\w[\\w-]*)(?=\\s|$)/g, colors.bold(colors.magenta("$&")));
271
+
272
+ }).join("\\n"); `
379
273
  })
380
274
  ];
381
275
  }
@@ -383,5 +277,5 @@ fi
383
277
  }
384
278
 
385
279
  //#endregion
386
- export { ZshCompletionsCommand };
387
- //# sourceMappingURL=zsh-command.mjs.map
280
+ export { ZshCompletionsShared };
281
+ //# sourceMappingURL=zsh-shared.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zsh-shared.mjs","names":[],"sources":["../../src/components/zsh-shared.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript\";\nimport { getAppBin } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport { snakeCase } from \"@stryke/string-format/snake-case\";\nimport { CompletionDirective } from \"../helpers\";\nimport { EXEC_COMMAND } from \"../helpers/complete-command\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The Zsh Completions generation for the Shell Shock project.\n */\nexport function ZshCompletionsShared() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n const bin = computed(() => getAppBin(context));\n const name = computed(() => snakeCase(bin.value));\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"completions\", \"zsh\", \"shared.ts\")}\n builtinImports={{\n console: [\"colors\"]\n }}>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"SHELL_COMPLETIONS\"\n initializer={code` \\`__${name.value}_debug() {\n local file=\"$BASH_COMP_DEBUG_FILE\"\n if [[ -n \\\\\\${file} ]]; then\n echo \"$*\" >> \"\\\\\\${file}\"\n fi\n}\n\n_${name.value}() {\n local shellCompDirectiveError=${\n CompletionDirective.CompletionDirectiveError\n }\n local shellCompDirectiveNoSpace=${\n CompletionDirective.CompletionDirectiveNoSpace\n }\n local shellCompDirectiveNoFileComp=${\n CompletionDirective.CompletionDirectiveNoFileComp\n }\n local shellCompDirectiveFilterFileExt=${\n CompletionDirective.CompletionDirectiveFilterFileExt\n }\n local shellCompDirectiveFilterDirs=${\n CompletionDirective.CompletionDirectiveFilterDirs\n }\n local shellCompDirectiveKeepOrder=${\n CompletionDirective.CompletionDirectiveKeepOrder\n }\n\n local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder\n local -a completions\n\n __${name.value}_debug \"\\\\n========= starting completion logic ==========\"\n __${name.value}_debug \"CURRENT: \\\\\\${CURRENT}, words[*]: \\\\\\${words[*]}\"\n\n # The user could have moved the cursor backwards on the command-line.\n # We need to trigger completion from the $CURRENT location, so we need\n # to truncate the command-line ($words) up to the $CURRENT location.\n # (We cannot use $CURSOR as its value does not work when a command is an alias.)\n words=( \"\\\\\\${=words[1,CURRENT]}\" )\n __${name.value}_debug \"Truncated words[*]: \\\\\\${words[*]},\"\n\n lastParam=\\\\\\${words[-1]}\n lastChar=\\\\\\${lastParam[-1]}\n __${name.value}_debug \"lastParam: \\\\\\${lastParam}, lastChar: \\\\\\${lastChar}\"\n # For zsh, when completing a flag with an = (e.g., ${bin.value} -n=<TAB>)\n # completions must be prefixed with the flag\n setopt local_options BASH_REMATCH\n if [[ \"\\\\\\${lastParam}\" =~ '-.*=' ]]; then\n # We are dealing with a flag with an =\n flagPrefix=\"-P \\\\\\${BASH_REMATCH}\"\n fi\n\n # Prepare the command to obtain completions, ensuring arguments are quoted for eval\n local -a args_to_quote=(\"\\\\\\${(@)words[2,-1]}\")\n if [ \"\\\\\\${lastChar}\" = \"\" ]; then\n # If the last parameter is complete (there is a space following it)\n # We add an extra empty parameter so we can indicate this to the go completion code.\n __${name.value}_debug \"Adding extra empty parameter\"\n args_to_quote+=(\"\")\n fi\n\n # Use Zsh's (q) flag to quote each argument safely for eval\n local quoted_args=(\"\\\\\\${(@q)args_to_quote}\")\n\n # Join the main command and the quoted arguments into a single string for eval\n requestComp=\"${EXEC_COMMAND} complete -- \\\\\\${quoted_args[*]}\"\n\n __${name.value}_debug \"About to call: eval \\\\\\${requestComp}\"\n\n # Use eval to handle any environment variables and such\n out=$(eval \\\\\\${requestComp} 2>/dev/null)\n __${name.value}_debug \"completion output: \\\\\\${out}\"\n\n # Extract the directive integer following a : from the last line\n local lastLine\n while IFS='\\n' read -r line; do\n lastLine=\\\\\\${line}\n done < <(printf \"%s\\n\" \"\\\\\\${out[@]}\")\n __${name.value}_debug \"last line: \\\\\\${lastLine}\"\n\n if [ \"\\\\\\${lastLine[1]}\" = : ]; then\n directive=\\\\\\${lastLine[2,-1]}\n # Remove the directive including the : and the newline\n local suffix\n (( suffix=\\\\\\${#lastLine}+2))\n out=\\\\\\${out[1,-$suffix]}\n else\n # There is no directive specified. Leave $out as is.\n __${name.value}_debug \"No directive found. Setting to default\"\n directive=0\n fi\n\n __${name.value}_debug \"directive: \\\\\\${directive}\"\n __${name.value}_debug \"completions: \\\\\\${out}\"\n __${name.value}_debug \"flagPrefix: \\\\\\${flagPrefix}\"\n\n if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then\n __${name.value}_debug \"Completion received error. Ignoring completions.\"\n return\n fi\n\n local activeHelpMarker=\"%\"\n local endIndex=\\\\\\${#activeHelpMarker}\n local startIndex=$((\\\\\\${#activeHelpMarker}+1))\n local hasActiveHelp=0\n while IFS='\\n' read -r comp; do\n # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)\n if [ \"\\\\\\${comp[1,$endIndex]}\" = \"$activeHelpMarker\" ];then\n __${name.value}_debug \"ActiveHelp found: $comp\"\n comp=\"\\\\\\${comp[$startIndex,-1]}\"\n if [ -n \"$comp\" ]; then\n compadd -x \"\\\\\\${comp}\"\n __${name.value}_debug \"ActiveHelp will need delimiter\"\n hasActiveHelp=1\n fi\n continue\n fi\n\n if [ -n \"$comp\" ]; then\n # If requested, completions are returned with a description.\n # The description is preceded by a TAB character.\n # For zsh's _describe, we need to use a : instead of a TAB.\n # We first need to escape any : as part of the completion itself.\n comp=\\\\\\${comp//:/\\\\:}\n\n local tab=\"$(printf '\\\\t')\"\n comp=\\\\\\${comp//$tab/:}\n\n __${name.value}_debug \"Adding completion: \\\\\\${comp}\"\n completions+=\\\\\\${comp}\n lastComp=$comp\n fi\n done < <(printf \"%s\\n\" \"\\\\\\${out[@]}\")\n\n # Add a delimiter after the activeHelp statements, but only if:\n # - there are completions following the activeHelp statements, or\n # - file completion will be performed (so there will be choices after the activeHelp)\n if [ $hasActiveHelp -eq 1 ]; then\n if [ \\\\\\${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then\n __${name.value}_debug \"Adding activeHelp delimiter\"\n compadd -x \"--\"\n hasActiveHelp=0\n fi\n fi\n\n if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then\n __${name.value}_debug \"Activating nospace.\"\n noSpace=\"-S ''\"\n fi\n\n if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then\n __${name.value}_debug \"Activating keep order.\"\n keepOrder=\"-V\"\n fi\n\n if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then\n # File extension filtering\n local filteringCmd\n filteringCmd='_files'\n for filter in \\\\\\${completions[@]}; do\n if [ \\\\\\${filter[1]} != '*' ]; then\n # zsh requires a glob pattern to do file filtering\n filter=\"\\\\*.$filter\"\n fi\n filteringCmd+=\" -g $filter\"\n done\n filteringCmd+=\" \\\\\\${flagPrefix}\"\n\n __${name.value}_debug \"File filtering command: $filteringCmd\"\n _arguments '*:filename:'\"$filteringCmd\"\n elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then\n # File completion for directories only\n local subdir\n subdir=\"\\\\\\${completions[1]}\"\n if [ -n \"$subdir\" ]; then\n __${name.value}_debug \"Listing directories in $subdir\"\n pushd \"\\\\\\${subdir}\" >/dev/null 2>&1\n else\n __${name.value}_debug \"Listing directories in .\"\n fi\n\n local result\n _arguments '*:dirname:_files -/'\" \\\\\\${flagPrefix}\"\n result=$?\n if [ -n \"$subdir\" ]; then\n popd >/dev/null 2>&1\n fi\n return $result\n else\n __${name.value}_debug \"Calling _describe\"\n if eval _describe $keepOrder \"completions\" completions -Q \\\\\\${flagPrefix} \\\\\\${noSpace}; then\n __${name.value}_debug \"_describe found some completions\"\n\n # Return the success of having called _describe\n return 0\n else\n __${name.value}_debug \"_describe did not find completions.\"\n __${name.value}_debug \"Checking if we should do file completion.\"\n if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then\n __${name.value}_debug \"deactivating file completion\"\n\n # Return 0 to indicate completion is finished and prevent zsh from\n # trying other completion algorithms (which could cause hanging).\n # We use NoFileComp directive to explicitly disable file completion.\n return 0\n else\n # Perform file completion\n __${name.value}_debug \"Activating file completion\"\n\n # We must return the result of this command, so it must be the\n # last command, or else we must store its result to return it.\n _arguments '*:filename:_files'\" \\\\\\${flagPrefix}\"\n fi\n fi\n fi\n}\n\n# don't run the completion function when being sourced or eval-ed\nif [ \"\\\\\\${funcstack[1]}\" = \"_${name.value}\" ]; then\n _${name.value}\nfi\n\\`; `}\n />\n <Spacing />\n <VarDeclaration\n export\n const\n name=\"SHELL_COMPLETIONS_DISPLAY\"\n initializer={code` SHELL_COMPLETIONS.split(\"\\\\n\").map(line => {\n if (!line.trim()) {\n return \"\";\n }\n if (line.trim().startsWith(\"#\")) {\n return \\`\\${colors.dim(line)}\\`;\n }\n\n return colors.white(line).replaceAll(/(?<=\\\\\\$(\\\\{|\\\\()).*(?=(\\\\}\\\\)))/g, colors.green(\"$&\"))\n .replaceAll(/\\\\\".*\\\\\"/g, colors.cyan(\"$&\"))\n .replaceAll(/(\\\\[|\\\\]|\\\\(|\\\\)|\\\\||<|>|\\\\$\\\\(|\\\\$?\\\\{|\\\\}|\\\\+|=|;|:)/g, colors.bold(colors.gray(\"$&\")))\n .replaceAll(/(readonly|complete)\\\\s+/g, colors.green(\"$&\"))\n .replaceAll(/(?<=(readonly|complete)\\\\s+)\\\\w/g, colors.bold(colors.greenBright(\"$&\")))\n .replaceAll(/local\\\\s+/g, colors.red(\"$&\"))\n .replaceAll(/(?<=local\\\\s+)\\\\w/g, colors.bold(colors.redBright(\"$&\")))\n .replaceAll(/(for|while)\\\\s+/g, colors.cyan(\"$&\"))\n .replaceAll(/(?<=for|while\\\\s+)\\\\w/g, colors.bold(colors.cyanBright(\"$&\")))\n .replaceAll(/(return|if|fi|else|elif|then|done)\\\\s+/g, colors.green(\"$&\"))\n .replaceAll(/__\\\\w/g, colors.bold(colors.magentaBright(\"$&\")))\n .replaceAll(/(?<=\\\\s)(-\\\\w|--\\\\w[\\\\w-]*)(?=\\\\s|$)/g, colors.bold(colors.magenta(\"$&\")));\n\n }).join(\"\\\\n\"); `}\n />\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,SAAgB,uBAAgB;;CAE9B,MAAM,MAAM,eAAe,UAAU,QAAQ,CAAC;CAC9C,MAAM,OAAO,eAAe,UAAU,IAAI,MAAM,CAAC;;EAEjD,IAAM,OAAC;AACJ,UAAA,UAAA,QAAA,WAAA,eAAA,OAAA,YAAA;;EAED,gBAAgB,EACd,SAAS,CAAC,SAAS,EACpB;EACD,IAAG,WAAS;AACV,UAAC;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,gBAAA;KACC,SAAA;KACA,UAAA;KACA,MAAM;KACN,IAAA,cAAkB;AAChB,aAAO,IAAA,QAAA,KAAA,MAAoB;;;;;;;GAOlC,KAAC,MAAM;oCACgB,oBAAA,yBAAA;sCACtB,oBAAA,2BAAA;yCACiC,oBAAA,8BAAA;4CACX,oBAAA,iCAAA;yCACtB,oBAAA,8BAAA;wCACoC,oBAAA,6BAAA;;;;;QAKpC,KAAA,MAAA;QACA,KAAM,MAAA;;;;;;;QAON,KAAM,MAAS;;;;QAIX,KAAK,MAAM;;;;;;;;;;;;;;YAcR,KAAA,MAAA;;;;;;;;mBAQI,aAAiB;;QAExB,KAAK,MAAM;;;;;;;;;;;QAWX,KAAK,MAAM;;;;;;;;;;YAUP,KAAC,MAAU;;;;QAIf,KAAA,MAAW;QACX,KAAE,MAAO;QACT,KAAK,MAAC;;;YAGV,KAAA,MAAA;;;;;;;;;;;gBAWY,KAAC,MAAM;;;;oBAIb,KAAA,MAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA2Bb,KAAK,MAAM;;;;;;;YAOnB,KAAS,MAAC;;;;;YAKN,KAAA,MAAW;;;;;;;;;;;;;;;;;YAiBf,KAAM,MAAA;;;;;;;gBAOF,KAAA,MAAe;;;;;;;;;;;;;;YAcf,KAAI,MAAK;;;;;;;gBAOL,KAAG,MAAQ;gBACnB,KAAA,MAAA;;oBAEJ,KAAA,MAAA;;;;;;;;oBAQgB,KAAC,MAAM;;;;;;;;;;;gCAWI,KAAM,MAAE;;;;;KAKhC,CAAC;IAAE,gBAAE,SAAA,EAAA,CAAA;IAAA,gBAAA,gBAAA;KACJ,UAAA;KACJ,SAAA;KACJ,MAAA;;;;;;;;;;;;;;;;;;;;;;;KAuBO,CAAC;IAAC;;EAEN,CAAC"}