@shell-shock/preset-script 0.1.1

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 (76) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +264 -0
  3. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  4. package/dist/components/builtin/console.cjs +1232 -0
  5. package/dist/components/builtin/console.cjs.map +1 -0
  6. package/dist/components/builtin/console.d.cts +37 -0
  7. package/dist/components/builtin/console.d.mts +37 -0
  8. package/dist/components/builtin/console.mjs +1225 -0
  9. package/dist/components/builtin/console.mjs.map +1 -0
  10. package/dist/components/builtin/index.cjs +9 -0
  11. package/dist/components/builtin/index.d.cts +2 -0
  12. package/dist/components/builtin/index.d.mts +2 -0
  13. package/dist/components/builtin/index.mjs +3 -0
  14. package/dist/components/command-router.cjs +103 -0
  15. package/dist/components/command-router.cjs.map +1 -0
  16. package/dist/components/command-router.d.cts +8 -0
  17. package/dist/components/command-router.d.mts +8 -0
  18. package/dist/components/command-router.mjs +101 -0
  19. package/dist/components/command-router.mjs.map +1 -0
  20. package/dist/components/entry/bin.cjs +92 -0
  21. package/dist/components/entry/bin.cjs.map +1 -0
  22. package/dist/components/entry/bin.d.cts +15 -0
  23. package/dist/components/entry/bin.d.mts +15 -0
  24. package/dist/components/entry/bin.mjs +91 -0
  25. package/dist/components/entry/bin.mjs.map +1 -0
  26. package/dist/components/entry/command.cjs +54 -0
  27. package/dist/components/entry/command.cjs.map +1 -0
  28. package/dist/components/entry/command.d.cts +15 -0
  29. package/dist/components/entry/command.d.mts +15 -0
  30. package/dist/components/entry/command.mjs +53 -0
  31. package/dist/components/entry/command.mjs.map +1 -0
  32. package/dist/components/entry/index.cjs +3 -0
  33. package/dist/components/entry/index.d.cts +2 -0
  34. package/dist/components/entry/index.d.mts +2 -0
  35. package/dist/components/entry/index.mjs +3 -0
  36. package/dist/components/index.cjs +19 -0
  37. package/dist/components/index.d.cts +7 -0
  38. package/dist/components/index.d.mts +7 -0
  39. package/dist/components/index.mjs +8 -0
  40. package/dist/components/shutdown.cjs +93 -0
  41. package/dist/components/shutdown.cjs.map +1 -0
  42. package/dist/components/shutdown.d.cts +14 -0
  43. package/dist/components/shutdown.d.mts +14 -0
  44. package/dist/components/shutdown.mjs +91 -0
  45. package/dist/components/shutdown.mjs.map +1 -0
  46. package/dist/contexts/command.cjs +21 -0
  47. package/dist/contexts/command.cjs.map +1 -0
  48. package/dist/contexts/command.mjs +19 -0
  49. package/dist/contexts/command.mjs.map +1 -0
  50. package/dist/contexts/theme.cjs +29 -0
  51. package/dist/contexts/theme.cjs.map +1 -0
  52. package/dist/contexts/theme.mjs +27 -0
  53. package/dist/contexts/theme.mjs.map +1 -0
  54. package/dist/helpers/ansi-utils.cjs +484 -0
  55. package/dist/helpers/ansi-utils.cjs.map +1 -0
  56. package/dist/helpers/ansi-utils.mjs +483 -0
  57. package/dist/helpers/ansi-utils.mjs.map +1 -0
  58. package/dist/helpers/get-default-options.cjs +57 -0
  59. package/dist/helpers/get-default-options.cjs.map +1 -0
  60. package/dist/helpers/get-default-options.mjs +56 -0
  61. package/dist/helpers/get-default-options.mjs.map +1 -0
  62. package/dist/index.cjs +65 -0
  63. package/dist/index.cjs.map +1 -0
  64. package/dist/index.d.cts +12 -0
  65. package/dist/index.d.mts +12 -0
  66. package/dist/index.mjs +59 -0
  67. package/dist/index.mjs.map +1 -0
  68. package/dist/types/index.cjs +0 -0
  69. package/dist/types/index.d.cts +2 -0
  70. package/dist/types/index.d.mts +2 -0
  71. package/dist/types/index.mjs +1 -0
  72. package/dist/types/plugin.cjs +0 -0
  73. package/dist/types/plugin.d.cts +32 -0
  74. package/dist/types/plugin.d.mts +32 -0
  75. package/dist/types/plugin.mjs +1 -0
  76. package/package.json +181 -0
@@ -0,0 +1,29 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_ansi_utils = require('../helpers/ansi-utils.cjs');
3
+ let __alloy_js_core = require("@alloy-js/core");
4
+ let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
5
+
6
+ //#region src/contexts/theme.ts
7
+ /**
8
+ * Hook to access the current application's theme configuration.
9
+ *
10
+ * @returns The resolved theme configuration.
11
+ */
12
+ function useTheme() {
13
+ const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
14
+ return (0, __alloy_js_core.computed)(() => context.theme).value;
15
+ }
16
+ /**
17
+ * Hook to access the current application's ANSI colors/styles.
18
+ *
19
+ * @returns The ANSI colors/styles.
20
+ */
21
+ function useColors() {
22
+ const theme = useTheme();
23
+ return (0, __alloy_js_core.computed)(() => require_ansi_utils.getAnsiStyles(theme.colors)).value;
24
+ }
25
+
26
+ //#endregion
27
+ exports.useColors = useColors;
28
+ exports.useTheme = useTheme;
29
+ //# sourceMappingURL=theme.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.cjs","names":["computed","usePowerlines","getAnsiStyles","useTheme","context","theme","value","useColors","colors"],"sources":["../../src/contexts/theme.ts"],"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 { computed } from \"@alloy-js/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { ThemeResolvedConfig } from \"@shell-shock/plugin-theme/types/theme\";\nimport type { AnsiStyles } from \"../helpers/ansi-utils\";\nimport { getAnsiStyles } from \"../helpers/ansi-utils\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\n\n/**\n * Hook to access the current application's theme configuration.\n *\n * @returns The resolved theme configuration.\n */\nexport function useTheme(): ThemeResolvedConfig {\n const context = usePowerlines<ScriptPresetContext>();\n const theme = computed(() => context.theme);\n\n return theme.value;\n}\n\n/**\n * Hook to access the current application's ANSI colors/styles.\n *\n * @returns The ANSI colors/styles.\n */\nexport function useColors(): AnsiStyles {\n const theme = useTheme();\n const colors = computed(() => getAnsiStyles(theme.colors));\n\n return colors.value;\n}\n"],"mappings":";;;;;;;;;;;AA8BA,SAAgBG,WAAgC;CAC9C,MAAMC,8EAA8C;AAGpD,4CAF6BA,QAAQC,MAAM,CAE9BC;;;;;;;AAQf,SAAgBC,YAAwB;CACtC,MAAMF,QAAQF,UAAU;AAGxB,4CAF8BD,iCAAcG,MAAMG,OAAO,CAAC,CAE5CF"}
@@ -0,0 +1,27 @@
1
+ import { getAnsiStyles } from "../helpers/ansi-utils.mjs";
2
+ import { computed } from "@alloy-js/core";
3
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
4
+
5
+ //#region src/contexts/theme.ts
6
+ /**
7
+ * Hook to access the current application's theme configuration.
8
+ *
9
+ * @returns The resolved theme configuration.
10
+ */
11
+ function useTheme() {
12
+ const context = usePowerlines();
13
+ return computed(() => context.theme).value;
14
+ }
15
+ /**
16
+ * Hook to access the current application's ANSI colors/styles.
17
+ *
18
+ * @returns The ANSI colors/styles.
19
+ */
20
+ function useColors() {
21
+ const theme = useTheme();
22
+ return computed(() => getAnsiStyles(theme.colors)).value;
23
+ }
24
+
25
+ //#endregion
26
+ export { useColors, useTheme };
27
+ //# sourceMappingURL=theme.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.mjs","names":["computed","usePowerlines","getAnsiStyles","useTheme","context","theme","value","useColors","colors"],"sources":["../../src/contexts/theme.ts"],"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 { computed } from \"@alloy-js/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { ThemeResolvedConfig } from \"@shell-shock/plugin-theme/types/theme\";\nimport type { AnsiStyles } from \"../helpers/ansi-utils\";\nimport { getAnsiStyles } from \"../helpers/ansi-utils\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\n\n/**\n * Hook to access the current application's theme configuration.\n *\n * @returns The resolved theme configuration.\n */\nexport function useTheme(): ThemeResolvedConfig {\n const context = usePowerlines<ScriptPresetContext>();\n const theme = computed(() => context.theme);\n\n return theme.value;\n}\n\n/**\n * Hook to access the current application's ANSI colors/styles.\n *\n * @returns The ANSI colors/styles.\n */\nexport function useColors(): AnsiStyles {\n const theme = useTheme();\n const colors = computed(() => getAnsiStyles(theme.colors));\n\n return colors.value;\n}\n"],"mappings":";;;;;;;;;;AA8BA,SAAgBG,WAAgC;CAC9C,MAAMC,UAAUH,eAAoC;AAGpD,QAFcD,eAAeI,QAAQC,MAAM,CAE9BC;;;;;;;AAQf,SAAgBC,YAAwB;CACtC,MAAMF,QAAQF,UAAU;AAGxB,QAFeH,eAAeE,cAAcG,MAAMG,OAAO,CAAC,CAE5CF"}
@@ -0,0 +1,484 @@
1
+
2
+ //#region src/helpers/ansi-utils.ts
3
+ const ANSI_BACKGROUND_OFFSET = 10;
4
+ const modifiers = {
5
+ reset: [0, 0],
6
+ bold: [1, 22],
7
+ dim: [2, 22],
8
+ italic: [3, 23],
9
+ underline: [4, 24],
10
+ overline: [53, 55],
11
+ inverse: [7, 27],
12
+ hidden: [8, 28],
13
+ strikethrough: [9, 29]
14
+ };
15
+ const colors = {
16
+ black: [30, 39],
17
+ red: [31, 39],
18
+ green: [32, 39],
19
+ yellow: [33, 39],
20
+ blue: [34, 39],
21
+ magenta: [35, 39],
22
+ cyan: [36, 39],
23
+ white: [37, 39],
24
+ blackBright: [90, 39],
25
+ gray: [90, 39],
26
+ grey: [90, 39],
27
+ redBright: [91, 39],
28
+ greenBright: [92, 39],
29
+ yellowBright: [93, 39],
30
+ blueBright: [94, 39],
31
+ magentaBright: [95, 39],
32
+ cyanBright: [96, 39],
33
+ whiteBright: [97, 39]
34
+ };
35
+ const bgColors = {
36
+ bgBlack: [40, 49],
37
+ bgRed: [41, 49],
38
+ bgGreen: [42, 49],
39
+ bgYellow: [43, 49],
40
+ bgBlue: [44, 49],
41
+ bgMagenta: [45, 49],
42
+ bgCyan: [46, 49],
43
+ bgWhite: [47, 49],
44
+ bgBlackBright: [100, 49],
45
+ bgGray: [100, 49],
46
+ bgGrey: [100, 49],
47
+ bgRedBright: [101, 49],
48
+ bgGreenBright: [102, 49],
49
+ bgYellowBright: [103, 49],
50
+ bgBlueBright: [104, 49],
51
+ bgMagentaBright: [105, 49],
52
+ bgCyanBright: [106, 49],
53
+ bgWhiteBright: [107, 49]
54
+ };
55
+ const wrapAnsi16 = (offset = 0) => (code) => `\\u001b[${code + offset}m`;
56
+ const wrapAnsi256 = (offset = 0) => (code) => `\\u001b[${38 + offset};5;${code}m`;
57
+ const wrapAnsi16m = (offset = 0) => (code) => {
58
+ const [red, green, blue] = hexToRgb(code);
59
+ return `\\u001b[${38 + offset};2;${red};${green};${blue}m`;
60
+ };
61
+ function rgbToAnsi256(red, green, blue) {
62
+ if (red === green && green === blue) {
63
+ if (red < 8) return 16;
64
+ if (red > 248) return 231;
65
+ return Math.round((red - 8) / 247 * 24) + 232;
66
+ }
67
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
68
+ }
69
+ function hexToRgb(hex) {
70
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
71
+ if (!matches) return [
72
+ 0,
73
+ 0,
74
+ 0
75
+ ];
76
+ let [colorString] = matches;
77
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
78
+ const integer = Number.parseInt(colorString, 16);
79
+ return [
80
+ integer >> 16 & 255,
81
+ integer >> 8 & 255,
82
+ integer & 255
83
+ ];
84
+ }
85
+ function hexToAnsi256(hex) {
86
+ return rgbToAnsi256(...hexToRgb(hex));
87
+ }
88
+ function ansi256ToAnsi(code) {
89
+ if (code < 8) return 30 + code;
90
+ if (code < 16) return 90 + (code - 8);
91
+ let red;
92
+ let green;
93
+ let blue;
94
+ if (code >= 232) {
95
+ red = ((code - 232) * 10 + 8) / 255;
96
+ green = red;
97
+ blue = red;
98
+ } else {
99
+ code -= 16;
100
+ const remainder = code % 36;
101
+ red = Math.floor(code / 36) / 5;
102
+ green = Math.floor(remainder / 6) / 5;
103
+ blue = remainder % 6 / 5;
104
+ }
105
+ const value = Math.max(red, green, blue) * 2;
106
+ if (value === 0) return 30;
107
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
108
+ if (value === 2) result += 60;
109
+ return result;
110
+ }
111
+ function hexToAnsi(hex) {
112
+ return ansi256ToAnsi(hexToAnsi256(hex));
113
+ }
114
+ function buildThemeAnsiStyles(theme, wrapFn, convertFn) {
115
+ return {
116
+ text: {
117
+ banner: {
118
+ title: {
119
+ open: wrapFn()(convertFn(theme.text.banner.title)),
120
+ close: wrapAnsi16()(39)
121
+ },
122
+ command: {
123
+ open: wrapFn()(convertFn(theme.text.banner.command)),
124
+ close: wrapAnsi16()(39)
125
+ },
126
+ description: {
127
+ open: wrapFn()(convertFn(theme.text.banner.description)),
128
+ close: wrapAnsi16()(39)
129
+ },
130
+ header: {
131
+ open: wrapFn()(convertFn(theme.text.banner.header)),
132
+ close: wrapAnsi16()(39)
133
+ },
134
+ footer: {
135
+ open: wrapFn()(convertFn(theme.text.banner.footer)),
136
+ close: wrapAnsi16()(39)
137
+ }
138
+ },
139
+ heading: {
140
+ primary: {
141
+ open: wrapFn()(convertFn(theme.text.heading.primary)),
142
+ close: wrapAnsi16()(39)
143
+ },
144
+ secondary: {
145
+ open: wrapFn()(convertFn(theme.text.heading.secondary)),
146
+ close: wrapAnsi16()(39)
147
+ },
148
+ tertiary: {
149
+ open: wrapFn()(convertFn(theme.text.heading.tertiary)),
150
+ close: wrapAnsi16()(39)
151
+ }
152
+ },
153
+ body: {
154
+ primary: {
155
+ open: wrapFn()(convertFn(theme.text.body.primary)),
156
+ close: wrapAnsi16()(39)
157
+ },
158
+ secondary: {
159
+ open: wrapFn()(convertFn(theme.text.body.secondary)),
160
+ close: wrapAnsi16()(39)
161
+ },
162
+ tertiary: {
163
+ open: wrapFn()(convertFn(theme.text.body.tertiary)),
164
+ close: wrapAnsi16()(39)
165
+ },
166
+ link: {
167
+ open: wrapFn()(convertFn(theme.text.body.link)),
168
+ close: wrapAnsi16()(39)
169
+ }
170
+ },
171
+ message: {
172
+ description: {
173
+ help: {
174
+ open: wrapFn()(convertFn(theme.text.message.description.help)),
175
+ close: wrapAnsi16()(39)
176
+ },
177
+ success: {
178
+ open: wrapFn()(convertFn(theme.text.message.description.success)),
179
+ close: wrapAnsi16()(39)
180
+ },
181
+ info: {
182
+ open: wrapFn()(convertFn(theme.text.message.description.info)),
183
+ close: wrapAnsi16()(39)
184
+ },
185
+ warning: {
186
+ open: wrapFn()(convertFn(theme.text.message.description.warning)),
187
+ close: wrapAnsi16()(39)
188
+ },
189
+ danger: {
190
+ open: wrapFn()(convertFn(theme.text.message.description.danger)),
191
+ close: wrapAnsi16()(39)
192
+ },
193
+ error: {
194
+ open: wrapFn()(convertFn(theme.text.message.description.error)),
195
+ close: wrapAnsi16()(39)
196
+ }
197
+ },
198
+ link: {
199
+ help: {
200
+ open: wrapFn()(convertFn(theme.text.message.link.help)),
201
+ close: wrapAnsi16()(39)
202
+ },
203
+ success: {
204
+ open: wrapFn()(convertFn(theme.text.message.link.success)),
205
+ close: wrapAnsi16()(39)
206
+ },
207
+ info: {
208
+ open: wrapFn()(convertFn(theme.text.message.link.info)),
209
+ close: wrapAnsi16()(39)
210
+ },
211
+ warning: {
212
+ open: wrapFn()(convertFn(theme.text.message.link.warning)),
213
+ close: wrapAnsi16()(39)
214
+ },
215
+ danger: {
216
+ open: wrapFn()(convertFn(theme.text.message.link.danger)),
217
+ close: wrapAnsi16()(39)
218
+ },
219
+ error: {
220
+ open: wrapFn()(convertFn(theme.text.message.link.error)),
221
+ close: wrapAnsi16()(39)
222
+ }
223
+ },
224
+ header: {
225
+ help: {
226
+ open: wrapFn()(convertFn(theme.text.message.header.help)),
227
+ close: wrapAnsi16()(39)
228
+ },
229
+ success: {
230
+ open: wrapFn()(convertFn(theme.text.message.header.success)),
231
+ close: wrapAnsi16()(39)
232
+ },
233
+ info: {
234
+ open: wrapFn()(convertFn(theme.text.message.header.info)),
235
+ close: wrapAnsi16()(39)
236
+ },
237
+ warning: {
238
+ open: wrapFn()(convertFn(theme.text.message.header.warning)),
239
+ close: wrapAnsi16()(39)
240
+ },
241
+ danger: {
242
+ open: wrapFn()(convertFn(theme.text.message.header.danger)),
243
+ close: wrapAnsi16()(39)
244
+ },
245
+ error: {
246
+ open: wrapFn()(convertFn(theme.text.message.header.error)),
247
+ close: wrapAnsi16()(39)
248
+ }
249
+ },
250
+ footer: {
251
+ help: {
252
+ open: wrapFn()(convertFn(theme.text.message.footer.help)),
253
+ close: wrapAnsi16()(39)
254
+ },
255
+ success: {
256
+ open: wrapFn()(convertFn(theme.text.message.footer.success)),
257
+ close: wrapAnsi16()(39)
258
+ },
259
+ info: {
260
+ open: wrapFn()(convertFn(theme.text.message.footer.info)),
261
+ close: wrapAnsi16()(39)
262
+ },
263
+ warning: {
264
+ open: wrapFn()(convertFn(theme.text.message.footer.warning)),
265
+ close: wrapAnsi16()(39)
266
+ },
267
+ danger: {
268
+ open: wrapFn()(convertFn(theme.text.message.footer.danger)),
269
+ close: wrapAnsi16()(39)
270
+ },
271
+ error: {
272
+ open: wrapFn()(convertFn(theme.text.message.footer.error)),
273
+ close: wrapAnsi16()(39)
274
+ }
275
+ }
276
+ },
277
+ usage: {
278
+ bin: {
279
+ open: wrapFn()(convertFn(theme.text.usage.bin)),
280
+ close: wrapAnsi16()(39)
281
+ },
282
+ command: {
283
+ open: wrapFn()(convertFn(theme.text.usage.command)),
284
+ close: wrapAnsi16()(39)
285
+ },
286
+ subcommand: {
287
+ open: wrapFn()(convertFn(theme.text.usage.subcommand)),
288
+ close: wrapAnsi16()(39)
289
+ },
290
+ options: {
291
+ open: wrapFn()(convertFn(theme.text.usage.options)),
292
+ close: wrapAnsi16()(39)
293
+ },
294
+ params: {
295
+ open: wrapFn()(convertFn(theme.text.usage.params)),
296
+ close: wrapAnsi16()(39)
297
+ },
298
+ description: {
299
+ open: wrapFn()(convertFn(theme.text.usage.description)),
300
+ close: wrapAnsi16()(39)
301
+ }
302
+ }
303
+ },
304
+ border: {
305
+ banner: {
306
+ divider: {
307
+ primary: {
308
+ open: wrapFn()(convertFn(theme.border.banner.divider.primary)),
309
+ close: wrapAnsi16()(39)
310
+ },
311
+ secondary: {
312
+ open: wrapFn()(convertFn(theme.border.banner.divider.secondary)),
313
+ close: wrapAnsi16()(39)
314
+ },
315
+ tertiary: {
316
+ open: wrapFn()(convertFn(theme.border.banner.divider.tertiary)),
317
+ close: wrapAnsi16()(39)
318
+ }
319
+ },
320
+ outline: {
321
+ primary: {
322
+ open: wrapFn()(convertFn(theme.border.banner.outline.primary)),
323
+ close: wrapAnsi16()(39)
324
+ },
325
+ secondary: {
326
+ open: wrapFn()(convertFn(theme.border.banner.outline.secondary)),
327
+ close: wrapAnsi16()(39)
328
+ },
329
+ tertiary: {
330
+ open: wrapFn()(convertFn(theme.border.banner.outline.tertiary)),
331
+ close: wrapAnsi16()(39)
332
+ }
333
+ }
334
+ },
335
+ app: {
336
+ divider: {
337
+ primary: {
338
+ open: wrapFn()(convertFn(theme.border.app.divider.primary)),
339
+ close: wrapAnsi16()(39)
340
+ },
341
+ secondary: {
342
+ open: wrapFn()(convertFn(theme.border.app.divider.secondary)),
343
+ close: wrapAnsi16()(39)
344
+ },
345
+ tertiary: {
346
+ open: wrapFn()(convertFn(theme.border.app.divider.tertiary)),
347
+ close: wrapAnsi16()(39)
348
+ }
349
+ },
350
+ outline: {
351
+ primary: {
352
+ open: wrapFn()(convertFn(theme.border.app.outline.primary)),
353
+ close: wrapAnsi16()(39)
354
+ },
355
+ secondary: {
356
+ open: wrapFn()(convertFn(theme.border.app.outline.secondary)),
357
+ close: wrapAnsi16()(39)
358
+ },
359
+ tertiary: {
360
+ open: wrapFn()(convertFn(theme.border.app.outline.tertiary)),
361
+ close: wrapAnsi16()(39)
362
+ }
363
+ }
364
+ },
365
+ message: {
366
+ divider: {
367
+ help: {
368
+ open: wrapFn()(convertFn(theme.border.message.divider.help)),
369
+ close: wrapAnsi16()(39)
370
+ },
371
+ success: {
372
+ open: wrapFn()(convertFn(theme.border.message.divider.success)),
373
+ close: wrapAnsi16()(39)
374
+ },
375
+ info: {
376
+ open: wrapFn()(convertFn(theme.border.message.divider.info)),
377
+ close: wrapAnsi16()(39)
378
+ },
379
+ warning: {
380
+ open: wrapFn()(convertFn(theme.border.message.divider.warning)),
381
+ close: wrapAnsi16()(39)
382
+ },
383
+ danger: {
384
+ open: wrapFn()(convertFn(theme.border.message.divider.danger)),
385
+ close: wrapAnsi16()(39)
386
+ },
387
+ error: {
388
+ open: wrapFn()(convertFn(theme.border.message.divider.error)),
389
+ close: wrapAnsi16()(39)
390
+ }
391
+ },
392
+ outline: {
393
+ help: {
394
+ open: wrapFn()(convertFn(theme.border.message.outline.help)),
395
+ close: wrapAnsi16()(39)
396
+ },
397
+ success: {
398
+ open: wrapFn()(convertFn(theme.border.message.outline.success)),
399
+ close: wrapAnsi16()(39)
400
+ },
401
+ info: {
402
+ open: wrapFn()(convertFn(theme.border.message.outline.info)),
403
+ close: wrapAnsi16()(39)
404
+ },
405
+ warning: {
406
+ open: wrapFn()(convertFn(theme.border.message.outline.warning)),
407
+ close: wrapAnsi16()(39)
408
+ },
409
+ danger: {
410
+ open: wrapFn()(convertFn(theme.border.message.outline.danger)),
411
+ close: wrapAnsi16()(39)
412
+ },
413
+ error: {
414
+ open: wrapFn()(convertFn(theme.border.message.outline.error)),
415
+ close: wrapAnsi16()(39)
416
+ }
417
+ }
418
+ }
419
+ }
420
+ };
421
+ }
422
+ /**
423
+ * Generates ANSI styles based on the provided context.
424
+ *
425
+ * @param theme - The theme colors configuration.
426
+ * @returns The generated ANSI styles.
427
+ */
428
+ function getAnsiStyles(theme) {
429
+ const output = {
430
+ ansi16: {},
431
+ ansi256: {},
432
+ ansi16m: {}
433
+ };
434
+ for (const [key, value] of Object.entries(modifiers)) {
435
+ output.ansi16[key] = {
436
+ open: wrapAnsi16()(value[0]),
437
+ close: wrapAnsi16()(value[1])
438
+ };
439
+ output.ansi256[key] = {
440
+ open: wrapAnsi16()(value[0]),
441
+ close: wrapAnsi16()(value[1])
442
+ };
443
+ output.ansi16m[key] = {
444
+ open: wrapAnsi16()(value[0]),
445
+ close: wrapAnsi16()(value[1])
446
+ };
447
+ }
448
+ for (const [key, value] of Object.entries(colors)) {
449
+ output.ansi16[key] = {
450
+ open: wrapAnsi16()(value[0]),
451
+ close: wrapAnsi16()(value[1])
452
+ };
453
+ output.ansi256[key] = {
454
+ open: wrapAnsi16()(value[0]),
455
+ close: wrapAnsi16()(value[1])
456
+ };
457
+ output.ansi16m[key] = {
458
+ open: wrapAnsi16()(value[0]),
459
+ close: wrapAnsi16()(value[1])
460
+ };
461
+ }
462
+ for (const [key, value] of Object.entries(bgColors)) {
463
+ output.ansi16[key] = {
464
+ open: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[0]),
465
+ close: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[1])
466
+ };
467
+ output.ansi256[key] = {
468
+ open: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[0]),
469
+ close: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[1])
470
+ };
471
+ output.ansi16m[key] = {
472
+ open: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[0]),
473
+ close: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[1])
474
+ };
475
+ }
476
+ output.ansi16.theme = buildThemeAnsiStyles(theme, wrapAnsi16, hexToAnsi);
477
+ output.ansi256.theme = buildThemeAnsiStyles(theme, wrapAnsi256, hexToAnsi256);
478
+ output.ansi16m.theme = buildThemeAnsiStyles(theme, wrapAnsi16m, (code) => code);
479
+ return output;
480
+ }
481
+
482
+ //#endregion
483
+ exports.getAnsiStyles = getAnsiStyles;
484
+ //# sourceMappingURL=ansi-utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ansi-utils.cjs","names":["ANSI_BACKGROUND_OFFSET","modifiers","reset","bold","dim","italic","underline","overline","inverse","hidden","strikethrough","colors","black","red","green","yellow","blue","magenta","cyan","white","blackBright","gray","grey","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright","bgColors","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgBlackBright","bgGray","bgGrey","bgRedBright","bgGreenBright","bgYellowBright","bgBlueBright","bgMagentaBright","bgCyanBright","bgWhiteBright","wrapAnsi16","offset","code","wrapAnsi256","wrapAnsi16m","hexToRgb","rgbToAnsi256","Math","round","hex","matches","exec","toString","colorString","length","map","character","join","integer","Number","parseInt","hexToAnsi256","ansi256ToAnsi","remainder","floor","value","max","result","hexToAnsi","buildThemeAnsiStyles","theme","wrapFn","convertFn","text","banner","title","open","close","command","description","header","footer","heading","primary","secondary","tertiary","body","link","message","help","success","info","warning","danger","error","usage","bin","subcommand","options","params","border","divider","outline","app","getAnsiStyles","output","ansi16","ansi256","ansi16m","key","Object","entries"],"sources":["../../src/helpers/ansi-utils.ts"],"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 type { ThemeColorsResolvedConfig } from \"@shell-shock/plugin-theme/types/theme\";\n\nconst ANSI_BACKGROUND_OFFSET = 10;\n\nexport const modifiers = {\n reset: [0, 0],\n bold: [1, 22],\n dim: [2, 22],\n italic: [3, 23],\n underline: [4, 24],\n overline: [53, 55],\n inverse: [7, 27],\n hidden: [8, 28],\n strikethrough: [9, 29]\n};\n\nexport const colors = {\n black: [30, 39],\n red: [31, 39],\n green: [32, 39],\n yellow: [33, 39],\n blue: [34, 39],\n magenta: [35, 39],\n cyan: [36, 39],\n white: [37, 39],\n\n // Bright color\n blackBright: [90, 39],\n gray: [90, 39],\n grey: [90, 39],\n redBright: [91, 39],\n greenBright: [92, 39],\n yellowBright: [93, 39],\n blueBright: [94, 39],\n magentaBright: [95, 39],\n cyanBright: [96, 39],\n whiteBright: [97, 39]\n};\n\nexport const bgColors = {\n bgBlack: [40, 49],\n bgRed: [41, 49],\n bgGreen: [42, 49],\n bgYellow: [43, 49],\n bgBlue: [44, 49],\n bgMagenta: [45, 49],\n bgCyan: [46, 49],\n bgWhite: [47, 49],\n\n // Bright color\n bgBlackBright: [100, 49],\n bgGray: [100, 49],\n bgGrey: [100, 49],\n bgRedBright: [101, 49],\n bgGreenBright: [102, 49],\n bgYellowBright: [103, 49],\n bgBlueBright: [104, 49],\n bgMagentaBright: [105, 49],\n bgCyanBright: [106, 49],\n bgWhiteBright: [107, 49]\n};\n\nexport interface AnsiWrappers {\n open: string;\n close: string;\n}\n\ntype WrapAnsiFn = (offset?: number) => (code: number) => string;\ntype WrapAnsi16mFn = (offset?: number) => (code: string) => string;\n\nconst wrapAnsi16: WrapAnsiFn =\n (offset = 0) =>\n (code: number) =>\n `\\\\u001b[${code + offset}m`;\n\nconst wrapAnsi256: WrapAnsiFn =\n (offset = 0) =>\n (code: number) =>\n `\\\\u001b[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m: WrapAnsi16mFn =\n (offset = 0) =>\n (code: string) => {\n const [red, green, blue] = hexToRgb(code);\n\n return `\\\\u001b[${38 + offset};2;${red};${green};${blue}m`;\n };\n\nexport type BaseAnsiStylesKeys =\n | keyof typeof modifiers\n | keyof typeof colors\n | keyof typeof bgColors;\n\nexport type BaseAnsiStyles = Record<\n \"ansi16\" | \"ansi256\" | \"ansi16m\",\n Record<BaseAnsiStylesKeys, AnsiWrappers>\n>;\n\ntype ThemeAnsiStylesFormat<T> = T extends object\n ? {\n [K in keyof T]: ThemeAnsiStylesFormat<T[K]>;\n }\n : AnsiWrappers;\n\nexport type ThemeAnsiStyles = Record<\n \"ansi16\" | \"ansi256\" | \"ansi16m\",\n { theme: ThemeAnsiStylesFormat<ThemeColorsResolvedConfig> }\n>;\n\nexport type AnsiStyles = BaseAnsiStyles & ThemeAnsiStyles;\n\nfunction rgbToAnsi256(red: number, green: number, blue: number): number {\n if (red === green && green === blue) {\n if (red < 8) {\n return 16;\n }\n\n if (red > 248) {\n return 231;\n }\n\n return Math.round(((red - 8) / 247) * 24) + 232;\n }\n\n return (\n 16 +\n 36 * Math.round((red / 255) * 5) +\n 6 * Math.round((green / 255) * 5) +\n Math.round((blue / 255) * 5)\n );\n}\n\nfunction hexToRgb(hex: string | number): [number, number, number] {\n const matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n if (!matches) {\n return [0, 0, 0];\n }\n\n let [colorString] = matches;\n\n if (colorString.length === 3) {\n colorString = [...colorString]\n .map(character => character + character)\n .join(\"\");\n }\n\n const integer = Number.parseInt(colorString, 16);\n\n return [(integer >> 16) & 0xff, (integer >> 8) & 0xff, integer & 0xff];\n}\n\nfunction hexToAnsi256(hex: string | number): number {\n return rgbToAnsi256(...hexToRgb(hex));\n}\n\nfunction ansi256ToAnsi(code: number): number {\n if (code < 8) {\n return 30 + code;\n }\n\n if (code < 16) {\n return 90 + (code - 8);\n }\n\n let red;\n let green;\n let blue;\n\n if (code >= 232) {\n red = ((code - 232) * 10 + 8) / 255;\n green = red;\n blue = red;\n } else {\n code -= 16;\n\n const remainder = code % 36;\n\n red = Math.floor(code / 36) / 5;\n green = Math.floor(remainder / 6) / 5;\n blue = (remainder % 6) / 5;\n }\n\n const value = Math.max(red, green, blue) * 2;\n\n if (value === 0) {\n return 30;\n }\n\n let result =\n 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n if (value === 2) {\n result += 60;\n }\n\n return result;\n}\n\n// function rgbToAnsi(red: number, green: number, blue: number): number {\n// return ansi256ToAnsi(rgbToAnsi256(red, green, blue));\n// }\n\nfunction hexToAnsi(hex: string | number): number {\n return ansi256ToAnsi(hexToAnsi256(hex));\n}\n\nfunction buildThemeAnsiStyles(\n theme: ThemeColorsResolvedConfig,\n wrapFn: (offset?: number) => (code: any) => string,\n convertFn: (code: string) => any\n): ThemeAnsiStylesFormat<ThemeColorsResolvedConfig> {\n return {\n text: {\n banner: {\n title: {\n open: wrapFn()(convertFn(theme.text.banner.title)),\n close: wrapAnsi16()(39)\n },\n command: {\n open: wrapFn()(convertFn(theme.text.banner.command)),\n close: wrapAnsi16()(39)\n },\n description: {\n open: wrapFn()(convertFn(theme.text.banner.description)),\n close: wrapAnsi16()(39)\n },\n header: {\n open: wrapFn()(convertFn(theme.text.banner.header)),\n close: wrapAnsi16()(39)\n },\n footer: {\n open: wrapFn()(convertFn(theme.text.banner.footer)),\n close: wrapAnsi16()(39)\n }\n },\n heading: {\n primary: {\n open: wrapFn()(convertFn(theme.text.heading.primary)),\n close: wrapAnsi16()(39)\n },\n secondary: {\n open: wrapFn()(convertFn(theme.text.heading.secondary)),\n close: wrapAnsi16()(39)\n },\n tertiary: {\n open: wrapFn()(convertFn(theme.text.heading.tertiary)),\n close: wrapAnsi16()(39)\n }\n },\n body: {\n primary: {\n open: wrapFn()(convertFn(theme.text.body.primary)),\n close: wrapAnsi16()(39)\n },\n secondary: {\n open: wrapFn()(convertFn(theme.text.body.secondary)),\n close: wrapAnsi16()(39)\n },\n tertiary: {\n open: wrapFn()(convertFn(theme.text.body.tertiary)),\n close: wrapAnsi16()(39)\n },\n link: {\n open: wrapFn()(convertFn(theme.text.body.link)),\n close: wrapAnsi16()(39)\n }\n },\n message: {\n description: {\n help: {\n open: wrapFn()(convertFn(theme.text.message.description.help)),\n close: wrapAnsi16()(39)\n },\n success: {\n open: wrapFn()(convertFn(theme.text.message.description.success)),\n close: wrapAnsi16()(39)\n },\n info: {\n open: wrapFn()(convertFn(theme.text.message.description.info)),\n close: wrapAnsi16()(39)\n },\n warning: {\n open: wrapFn()(convertFn(theme.text.message.description.warning)),\n close: wrapAnsi16()(39)\n },\n danger: {\n open: wrapFn()(convertFn(theme.text.message.description.danger)),\n close: wrapAnsi16()(39)\n },\n error: {\n open: wrapFn()(convertFn(theme.text.message.description.error)),\n close: wrapAnsi16()(39)\n }\n },\n link: {\n help: {\n open: wrapFn()(convertFn(theme.text.message.link.help)),\n close: wrapAnsi16()(39)\n },\n success: {\n open: wrapFn()(convertFn(theme.text.message.link.success)),\n close: wrapAnsi16()(39)\n },\n info: {\n open: wrapFn()(convertFn(theme.text.message.link.info)),\n close: wrapAnsi16()(39)\n },\n warning: {\n open: wrapFn()(convertFn(theme.text.message.link.warning)),\n close: wrapAnsi16()(39)\n },\n danger: {\n open: wrapFn()(convertFn(theme.text.message.link.danger)),\n close: wrapAnsi16()(39)\n },\n error: {\n open: wrapFn()(convertFn(theme.text.message.link.error)),\n close: wrapAnsi16()(39)\n }\n },\n header: {\n help: {\n open: wrapFn()(convertFn(theme.text.message.header.help)),\n close: wrapAnsi16()(39)\n },\n success: {\n open: wrapFn()(convertFn(theme.text.message.header.success)),\n close: wrapAnsi16()(39)\n },\n info: {\n open: wrapFn()(convertFn(theme.text.message.header.info)),\n close: wrapAnsi16()(39)\n },\n warning: {\n open: wrapFn()(convertFn(theme.text.message.header.warning)),\n close: wrapAnsi16()(39)\n },\n danger: {\n open: wrapFn()(convertFn(theme.text.message.header.danger)),\n close: wrapAnsi16()(39)\n },\n error: {\n open: wrapFn()(convertFn(theme.text.message.header.error)),\n close: wrapAnsi16()(39)\n }\n },\n footer: {\n help: {\n open: wrapFn()(convertFn(theme.text.message.footer.help)),\n close: wrapAnsi16()(39)\n },\n success: {\n open: wrapFn()(convertFn(theme.text.message.footer.success)),\n close: wrapAnsi16()(39)\n },\n info: {\n open: wrapFn()(convertFn(theme.text.message.footer.info)),\n close: wrapAnsi16()(39)\n },\n warning: {\n open: wrapFn()(convertFn(theme.text.message.footer.warning)),\n close: wrapAnsi16()(39)\n },\n danger: {\n open: wrapFn()(convertFn(theme.text.message.footer.danger)),\n close: wrapAnsi16()(39)\n },\n error: {\n open: wrapFn()(convertFn(theme.text.message.footer.error)),\n close: wrapAnsi16()(39)\n }\n }\n },\n usage: {\n bin: {\n open: wrapFn()(convertFn(theme.text.usage.bin)),\n close: wrapAnsi16()(39)\n },\n command: {\n open: wrapFn()(convertFn(theme.text.usage.command)),\n close: wrapAnsi16()(39)\n },\n subcommand: {\n open: wrapFn()(convertFn(theme.text.usage.subcommand)),\n close: wrapAnsi16()(39)\n },\n options: {\n open: wrapFn()(convertFn(theme.text.usage.options)),\n close: wrapAnsi16()(39)\n },\n params: {\n open: wrapFn()(convertFn(theme.text.usage.params)),\n close: wrapAnsi16()(39)\n },\n description: {\n open: wrapFn()(convertFn(theme.text.usage.description)),\n close: wrapAnsi16()(39)\n }\n }\n },\n border: {\n banner: {\n divider: {\n primary: {\n open: wrapFn()(convertFn(theme.border.banner.divider.primary)),\n close: wrapAnsi16()(39)\n },\n secondary: {\n open: wrapFn()(convertFn(theme.border.banner.divider.secondary)),\n close: wrapAnsi16()(39)\n },\n tertiary: {\n open: wrapFn()(convertFn(theme.border.banner.divider.tertiary)),\n close: wrapAnsi16()(39)\n }\n },\n outline: {\n primary: {\n open: wrapFn()(convertFn(theme.border.banner.outline.primary)),\n close: wrapAnsi16()(39)\n },\n secondary: {\n open: wrapFn()(convertFn(theme.border.banner.outline.secondary)),\n close: wrapAnsi16()(39)\n },\n tertiary: {\n open: wrapFn()(convertFn(theme.border.banner.outline.tertiary)),\n close: wrapAnsi16()(39)\n }\n }\n },\n app: {\n divider: {\n primary: {\n open: wrapFn()(convertFn(theme.border.app.divider.primary)),\n close: wrapAnsi16()(39)\n },\n secondary: {\n open: wrapFn()(convertFn(theme.border.app.divider.secondary)),\n close: wrapAnsi16()(39)\n },\n tertiary: {\n open: wrapFn()(convertFn(theme.border.app.divider.tertiary)),\n close: wrapAnsi16()(39)\n }\n },\n outline: {\n primary: {\n open: wrapFn()(convertFn(theme.border.app.outline.primary)),\n close: wrapAnsi16()(39)\n },\n secondary: {\n open: wrapFn()(convertFn(theme.border.app.outline.secondary)),\n close: wrapAnsi16()(39)\n },\n tertiary: {\n open: wrapFn()(convertFn(theme.border.app.outline.tertiary)),\n close: wrapAnsi16()(39)\n }\n }\n },\n message: {\n divider: {\n help: {\n open: wrapFn()(convertFn(theme.border.message.divider.help)),\n close: wrapAnsi16()(39)\n },\n success: {\n open: wrapFn()(convertFn(theme.border.message.divider.success)),\n close: wrapAnsi16()(39)\n },\n info: {\n open: wrapFn()(convertFn(theme.border.message.divider.info)),\n close: wrapAnsi16()(39)\n },\n warning: {\n open: wrapFn()(convertFn(theme.border.message.divider.warning)),\n close: wrapAnsi16()(39)\n },\n danger: {\n open: wrapFn()(convertFn(theme.border.message.divider.danger)),\n close: wrapAnsi16()(39)\n },\n error: {\n open: wrapFn()(convertFn(theme.border.message.divider.error)),\n close: wrapAnsi16()(39)\n }\n },\n outline: {\n help: {\n open: wrapFn()(convertFn(theme.border.message.outline.help)),\n close: wrapAnsi16()(39)\n },\n success: {\n open: wrapFn()(convertFn(theme.border.message.outline.success)),\n close: wrapAnsi16()(39)\n },\n info: {\n open: wrapFn()(convertFn(theme.border.message.outline.info)),\n close: wrapAnsi16()(39)\n },\n warning: {\n open: wrapFn()(convertFn(theme.border.message.outline.warning)),\n close: wrapAnsi16()(39)\n },\n danger: {\n open: wrapFn()(convertFn(theme.border.message.outline.danger)),\n close: wrapAnsi16()(39)\n },\n error: {\n open: wrapFn()(convertFn(theme.border.message.outline.error)),\n close: wrapAnsi16()(39)\n }\n }\n }\n }\n };\n}\n\n/**\n * Generates ANSI styles based on the provided context.\n *\n * @param theme - The theme colors configuration.\n * @returns The generated ANSI styles.\n */\nexport function getAnsiStyles(theme: ThemeColorsResolvedConfig): AnsiStyles {\n const output = { ansi16: {}, ansi256: {}, ansi16m: {} } as AnsiStyles;\n\n for (const [key, value] of Object.entries(modifiers) as [\n BaseAnsiStylesKeys,\n [number, number]\n ][]) {\n output.ansi16[key] = {\n open: wrapAnsi16()(value[0]),\n close: wrapAnsi16()(value[1])\n };\n\n output.ansi256[key] = {\n open: wrapAnsi16()(value[0]),\n close: wrapAnsi16()(value[1])\n };\n\n output.ansi16m[key] = {\n open: wrapAnsi16()(value[0]),\n close: wrapAnsi16()(value[1])\n };\n }\n\n for (const [key, value] of Object.entries(colors) as [\n BaseAnsiStylesKeys,\n [number, number]\n ][]) {\n output.ansi16[key] = {\n open: wrapAnsi16()(value[0]),\n close: wrapAnsi16()(value[1])\n };\n\n output.ansi256[key] = {\n open: wrapAnsi16()(value[0]),\n close: wrapAnsi16()(value[1])\n };\n\n output.ansi16m[key] = {\n open: wrapAnsi16()(value[0]),\n close: wrapAnsi16()(value[1])\n };\n }\n\n for (const [key, value] of Object.entries(bgColors) as [\n BaseAnsiStylesKeys,\n [number, number]\n ][]) {\n output.ansi16[key] = {\n open: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[0]),\n close: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[1])\n };\n\n output.ansi256[key] = {\n open: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[0]),\n close: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[1])\n };\n\n output.ansi16m[key] = {\n open: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[0]),\n close: wrapAnsi16(ANSI_BACKGROUND_OFFSET)(value[1])\n };\n }\n\n output.ansi16.theme = buildThemeAnsiStyles(theme, wrapAnsi16, hexToAnsi);\n output.ansi256.theme = buildThemeAnsiStyles(theme, wrapAnsi256, hexToAnsi256);\n output.ansi16m.theme = buildThemeAnsiStyles(\n theme,\n wrapAnsi16m,\n (code: string) => code\n );\n\n return output;\n}\n"],"mappings":";;AAoBA,MAAMA,yBAAyB;AAE/B,MAAaC,YAAY;CACvBC,OAAO,CAAC,GAAG,EAAE;CACbC,MAAM,CAAC,GAAG,GAAG;CACbC,KAAK,CAAC,GAAG,GAAG;CACZC,QAAQ,CAAC,GAAG,GAAG;CACfC,WAAW,CAAC,GAAG,GAAG;CAClBC,UAAU,CAAC,IAAI,GAAG;CAClBC,SAAS,CAAC,GAAG,GAAG;CAChBC,QAAQ,CAAC,GAAG,GAAG;CACfC,eAAe,CAAC,GAAG,GAAE;CACtB;AAED,MAAaC,SAAS;CACpBC,OAAO,CAAC,IAAI,GAAG;CACfC,KAAK,CAAC,IAAI,GAAG;CACbC,OAAO,CAAC,IAAI,GAAG;CACfC,QAAQ,CAAC,IAAI,GAAG;CAChBC,MAAM,CAAC,IAAI,GAAG;CACdC,SAAS,CAAC,IAAI,GAAG;CACjBC,MAAM,CAAC,IAAI,GAAG;CACdC,OAAO,CAAC,IAAI,GAAG;CAGfC,aAAa,CAAC,IAAI,GAAG;CACrBC,MAAM,CAAC,IAAI,GAAG;CACdC,MAAM,CAAC,IAAI,GAAG;CACdC,WAAW,CAAC,IAAI,GAAG;CACnBC,aAAa,CAAC,IAAI,GAAG;CACrBC,cAAc,CAAC,IAAI,GAA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