@socketsecurity/cli-with-sentry 0.14.94 → 0.14.95
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.
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +2 -2
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/module-sync/cli.js +176 -156
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/shadow-bin.js +3 -14
- package/dist/module-sync/shadow-bin.js.map +1 -1
- package/dist/module-sync/shadow-npm-inject.js +68 -59
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/module-sync/shadow-npm-paths.js +16 -29
- package/dist/module-sync/shadow-npm-paths.js.map +1 -1
- package/dist/module-sync/vendor.d.ts +0 -0
- package/dist/module-sync/vendor.js +85829 -12598
- package/dist/module-sync/vendor.js.map +1 -1
- package/dist/require/cli.js +158 -137
- package/dist/require/cli.js.map +1 -1
- package/dist/require/shadow-bin.d.ts +5 -0
- package/dist/require/shadow-bin.js +108 -1
- package/dist/require/shadow-bin.js.map +1 -0
- package/dist/require/shadow-npm-inject.d.ts +1 -0
- package/dist/require/shadow-npm-inject.js +2335 -1
- package/dist/require/shadow-npm-inject.js.map +1 -0
- package/dist/require/shadow-npm-paths.d.ts +29 -0
- package/dist/require/shadow-npm-paths.js +454 -1
- package/dist/require/shadow-npm-paths.js.map +1 -0
- package/package.json +29 -29
- package/dist/blessed/lib/alias.js +0 -521
- package/dist/blessed/lib/blessed.js +0 -34
- package/dist/blessed/lib/colors.js +0 -492
- package/dist/blessed/lib/events.js +0 -197
- package/dist/blessed/lib/gpmclient.js +0 -247
- package/dist/blessed/lib/helpers.js +0 -172
- package/dist/blessed/lib/keys.js +0 -514
- package/dist/blessed/lib/program.js +0 -4532
- package/dist/blessed/lib/tput.js +0 -3113
- package/dist/blessed/lib/unicode.js +0 -914
- package/dist/blessed/lib/widget.js +0 -62
- package/dist/blessed/lib/widgets/ansiimage.js +0 -175
- package/dist/blessed/lib/widgets/bigtext.js +0 -172
- package/dist/blessed/lib/widgets/box.js +0 -36
- package/dist/blessed/lib/widgets/button.js +0 -64
- package/dist/blessed/lib/widgets/checkbox.js +0 -97
- package/dist/blessed/lib/widgets/element.js +0 -2873
- package/dist/blessed/lib/widgets/filemanager.js +0 -225
- package/dist/blessed/lib/widgets/form.js +0 -303
- package/dist/blessed/lib/widgets/image.js +0 -73
- package/dist/blessed/lib/widgets/input.js +0 -36
- package/dist/blessed/lib/widgets/layout.js +0 -251
- package/dist/blessed/lib/widgets/line.js +0 -61
- package/dist/blessed/lib/widgets/list.js +0 -654
- package/dist/blessed/lib/widgets/listbar.js +0 -454
- package/dist/blessed/lib/widgets/listtable.js +0 -267
- package/dist/blessed/lib/widgets/loading.js +0 -90
- package/dist/blessed/lib/widgets/log.js +0 -84
- package/dist/blessed/lib/widgets/message.js +0 -147
- package/dist/blessed/lib/widgets/node.js +0 -315
- package/dist/blessed/lib/widgets/overlayimage.js +0 -796
- package/dist/blessed/lib/widgets/progressbar.js +0 -168
- package/dist/blessed/lib/widgets/prompt.js +0 -129
- package/dist/blessed/lib/widgets/question.js +0 -131
- package/dist/blessed/lib/widgets/radiobutton.js +0 -64
- package/dist/blessed/lib/widgets/radioset.js +0 -38
- package/dist/blessed/lib/widgets/screen.js +0 -2487
- package/dist/blessed/lib/widgets/scrollablebox.js +0 -417
- package/dist/blessed/lib/widgets/scrollabletext.js +0 -37
- package/dist/blessed/lib/widgets/table.js +0 -385
- package/dist/blessed/lib/widgets/terminal.js +0 -454
- package/dist/blessed/lib/widgets/text.js +0 -37
- package/dist/blessed/lib/widgets/textarea.js +0 -378
- package/dist/blessed/lib/widgets/textbox.js +0 -81
- package/dist/blessed/lib/widgets/video.js +0 -132
- package/dist/blessed/usr/fonts/AUTHORS +0 -1
- package/dist/blessed/usr/fonts/LICENSE +0 -94
- package/dist/blessed/usr/fonts/README +0 -340
- package/dist/blessed/usr/fonts/ter-u14b.json +0 -17826
- package/dist/blessed/usr/fonts/ter-u14n.json +0 -17826
- package/dist/blessed/usr/linux +0 -0
- package/dist/blessed/usr/windows-ansi +0 -0
- package/dist/blessed/usr/xterm +0 -0
- package/dist/blessed/usr/xterm-256color +0 -0
- package/dist/blessed/usr/xterm.termcap +0 -243
- package/dist/blessed/usr/xterm.terminfo +0 -1977
- package/dist/blessed/vendor/tng.js +0 -1878
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* colors.js - color-related functions for blessed.
|
|
5
|
-
* Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License).
|
|
6
|
-
* https://github.com/chjj/blessed
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
exports.match = function (r1, g1, b1) {
|
|
10
|
-
if (typeof r1 === 'string') {
|
|
11
|
-
let hex = r1
|
|
12
|
-
if (hex[0] !== '#') {
|
|
13
|
-
return -1
|
|
14
|
-
}
|
|
15
|
-
hex = exports.hexToRGB(hex)
|
|
16
|
-
;(r1 = hex[0]), (g1 = hex[1]), (b1 = hex[2])
|
|
17
|
-
} else if (Array.isArray(r1)) {
|
|
18
|
-
;(b1 = r1[2]), (g1 = r1[1]), (r1 = r1[0])
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const hash = (r1 << 16) | (g1 << 8) | b1
|
|
22
|
-
|
|
23
|
-
if (exports._cache[hash] != null) {
|
|
24
|
-
return exports._cache[hash]
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let ldiff = Infinity,
|
|
28
|
-
li = -1,
|
|
29
|
-
i = 0,
|
|
30
|
-
c,
|
|
31
|
-
r2,
|
|
32
|
-
g2,
|
|
33
|
-
b2,
|
|
34
|
-
diff
|
|
35
|
-
|
|
36
|
-
for (; i < exports.vcolors.length; i++) {
|
|
37
|
-
c = exports.vcolors[i]
|
|
38
|
-
r2 = c[0]
|
|
39
|
-
g2 = c[1]
|
|
40
|
-
b2 = c[2]
|
|
41
|
-
|
|
42
|
-
diff = colorDistance(r1, g1, b1, r2, g2, b2)
|
|
43
|
-
|
|
44
|
-
if (diff === 0) {
|
|
45
|
-
li = i
|
|
46
|
-
break
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (diff < ldiff) {
|
|
50
|
-
ldiff = diff
|
|
51
|
-
li = i
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return (exports._cache[hash] = li)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
exports.RGBToHex = function (r, g, b) {
|
|
59
|
-
if (Array.isArray(r)) {
|
|
60
|
-
;(b = r[2]), (g = r[1]), (r = r[0])
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function hex(n) {
|
|
64
|
-
n = n.toString(16)
|
|
65
|
-
if (n.length < 2) {
|
|
66
|
-
n = '0' + n
|
|
67
|
-
}
|
|
68
|
-
return n
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return '#' + hex(r) + hex(g) + hex(b)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
exports.hexToRGB = function (hex) {
|
|
75
|
-
if (hex.length === 4) {
|
|
76
|
-
hex = hex[0] + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const col = parseInt(hex.substring(1), 16),
|
|
80
|
-
r = (col >> 16) & 0xff,
|
|
81
|
-
g = (col >> 8) & 0xff,
|
|
82
|
-
b = col & 0xff
|
|
83
|
-
|
|
84
|
-
return [r, g, b]
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// As it happens, comparing how similar two colors are is really hard. Here is
|
|
88
|
-
// one of the simplest solutions, which doesn't require conversion to another
|
|
89
|
-
// color space, posted on stackoverflow[1]. Maybe someone better at math can
|
|
90
|
-
// propose a superior solution.
|
|
91
|
-
// [1] http://stackoverflow.com/questions/1633828
|
|
92
|
-
|
|
93
|
-
function colorDistance(r1, g1, b1, r2, g2, b2) {
|
|
94
|
-
return (
|
|
95
|
-
Math.pow(30 * (r1 - r2), 2) +
|
|
96
|
-
Math.pow(59 * (g1 - g2), 2) +
|
|
97
|
-
Math.pow(11 * (b1 - b2), 2)
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// This might work well enough for a terminal's colors: treat RGB as XYZ in a
|
|
102
|
-
// 3-dimensional space and go midway between the two points.
|
|
103
|
-
exports.mixColors = function (c1, c2, alpha) {
|
|
104
|
-
// if (c1 === 0x1ff) return c1;
|
|
105
|
-
// if (c2 === 0x1ff) return c1;
|
|
106
|
-
if (c1 === 0x1ff) {
|
|
107
|
-
c1 = 0
|
|
108
|
-
}
|
|
109
|
-
if (c2 === 0x1ff) {
|
|
110
|
-
c2 = 0
|
|
111
|
-
}
|
|
112
|
-
if (alpha == null) {
|
|
113
|
-
alpha = 0.5
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
c1 = exports.vcolors[c1]
|
|
117
|
-
let r1 = c1[0]
|
|
118
|
-
let g1 = c1[1]
|
|
119
|
-
let b1 = c1[2]
|
|
120
|
-
|
|
121
|
-
c2 = exports.vcolors[c2]
|
|
122
|
-
const r2 = c2[0]
|
|
123
|
-
const g2 = c2[1]
|
|
124
|
-
const b2 = c2[2]
|
|
125
|
-
|
|
126
|
-
r1 += ((r2 - r1) * alpha) | 0
|
|
127
|
-
g1 += ((g2 - g1) * alpha) | 0
|
|
128
|
-
b1 += ((b2 - b1) * alpha) | 0
|
|
129
|
-
|
|
130
|
-
return exports.match([r1, g1, b1])
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
exports.blend = function blend(attr, attr2, alpha) {
|
|
134
|
-
let name, i, c, nc
|
|
135
|
-
|
|
136
|
-
let bg = attr & 0x1ff
|
|
137
|
-
if (attr2 != null) {
|
|
138
|
-
let bg2 = attr2 & 0x1ff
|
|
139
|
-
if (bg === 0x1ff) {
|
|
140
|
-
bg = 0
|
|
141
|
-
}
|
|
142
|
-
if (bg2 === 0x1ff) {
|
|
143
|
-
bg2 = 0
|
|
144
|
-
}
|
|
145
|
-
bg = exports.mixColors(bg, bg2, alpha)
|
|
146
|
-
} else {
|
|
147
|
-
if (blend._cache[bg] != null) {
|
|
148
|
-
bg = blend._cache[bg]
|
|
149
|
-
// } else if (bg < 8) {
|
|
150
|
-
// bg += 8;
|
|
151
|
-
} else if (bg >= 8 && bg <= 15) {
|
|
152
|
-
bg -= 8
|
|
153
|
-
} else {
|
|
154
|
-
name = exports.ncolors[bg]
|
|
155
|
-
if (name) {
|
|
156
|
-
for (i = 0; i < exports.ncolors.length; i++) {
|
|
157
|
-
if (name === exports.ncolors[i] && i !== bg) {
|
|
158
|
-
c = exports.vcolors[bg]
|
|
159
|
-
nc = exports.vcolors[i]
|
|
160
|
-
if (nc[0] + nc[1] + nc[2] < c[0] + c[1] + c[2]) {
|
|
161
|
-
blend._cache[bg] = i
|
|
162
|
-
bg = i
|
|
163
|
-
break
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
attr &= ~0x1ff
|
|
172
|
-
attr |= bg
|
|
173
|
-
|
|
174
|
-
let fg = (attr >> 9) & 0x1ff
|
|
175
|
-
if (attr2 != null) {
|
|
176
|
-
let fg2 = (attr2 >> 9) & 0x1ff
|
|
177
|
-
// 0, 7, 188, 231, 251
|
|
178
|
-
if (fg === 0x1ff) {
|
|
179
|
-
// XXX workaround
|
|
180
|
-
fg = 248
|
|
181
|
-
} else {
|
|
182
|
-
if (fg === 0x1ff) {
|
|
183
|
-
fg = 7
|
|
184
|
-
}
|
|
185
|
-
if (fg2 === 0x1ff) {
|
|
186
|
-
fg2 = 7
|
|
187
|
-
}
|
|
188
|
-
fg = exports.mixColors(fg, fg2, alpha)
|
|
189
|
-
}
|
|
190
|
-
} else {
|
|
191
|
-
if (blend._cache[fg] != null) {
|
|
192
|
-
fg = blend._cache[fg]
|
|
193
|
-
// } else if (fg < 8) {
|
|
194
|
-
// fg += 8;
|
|
195
|
-
} else if (fg >= 8 && fg <= 15) {
|
|
196
|
-
fg -= 8
|
|
197
|
-
} else {
|
|
198
|
-
name = exports.ncolors[fg]
|
|
199
|
-
if (name) {
|
|
200
|
-
for (i = 0; i < exports.ncolors.length; i++) {
|
|
201
|
-
if (name === exports.ncolors[i] && i !== fg) {
|
|
202
|
-
c = exports.vcolors[fg]
|
|
203
|
-
nc = exports.vcolors[i]
|
|
204
|
-
if (nc[0] + nc[1] + nc[2] < c[0] + c[1] + c[2]) {
|
|
205
|
-
blend._cache[fg] = i
|
|
206
|
-
fg = i
|
|
207
|
-
break
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
attr &= ~(0x1ff << 9)
|
|
216
|
-
attr |= fg << 9
|
|
217
|
-
|
|
218
|
-
return attr
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
exports.blend._cache = {}
|
|
222
|
-
|
|
223
|
-
exports._cache = {}
|
|
224
|
-
|
|
225
|
-
exports.reduce = function (color, total) {
|
|
226
|
-
if (color >= 16 && total <= 16) {
|
|
227
|
-
color = exports.ccolors[color]
|
|
228
|
-
} else if (color >= 8 && total <= 8) {
|
|
229
|
-
color -= 8
|
|
230
|
-
} else if (color >= 2 && total <= 2) {
|
|
231
|
-
color %= 2
|
|
232
|
-
}
|
|
233
|
-
return color
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// XTerm Colors
|
|
237
|
-
// These were actually tough to track down. The xterm source only uses color
|
|
238
|
-
// keywords. The X11 source needed to be examined to find the actual values.
|
|
239
|
-
// They then had to be mapped to rgb values and then converted to hex values.
|
|
240
|
-
exports.xterm = [
|
|
241
|
-
'#000000', // black
|
|
242
|
-
'#cd0000', // red3
|
|
243
|
-
'#00cd00', // green3
|
|
244
|
-
'#cdcd00', // yellow3
|
|
245
|
-
'#0000ee', // blue2
|
|
246
|
-
'#cd00cd', // magenta3
|
|
247
|
-
'#00cdcd', // cyan3
|
|
248
|
-
'#e5e5e5', // gray90
|
|
249
|
-
'#7f7f7f', // gray50
|
|
250
|
-
'#ff0000', // red
|
|
251
|
-
'#00ff00', // green
|
|
252
|
-
'#ffff00', // yellow
|
|
253
|
-
'#5c5cff', // rgb:5c/5c/ff
|
|
254
|
-
'#ff00ff', // magenta
|
|
255
|
-
'#00ffff', // cyan
|
|
256
|
-
'#ffffff' // white
|
|
257
|
-
]
|
|
258
|
-
|
|
259
|
-
// Seed all 256 colors. Assume xterm defaults.
|
|
260
|
-
// Ported from the xterm color generation script.
|
|
261
|
-
exports.colors = (function () {
|
|
262
|
-
let cols = (exports.colors = []),
|
|
263
|
-
_cols = (exports.vcolors = []),
|
|
264
|
-
r,
|
|
265
|
-
g,
|
|
266
|
-
b,
|
|
267
|
-
i,
|
|
268
|
-
l
|
|
269
|
-
|
|
270
|
-
function hex(n) {
|
|
271
|
-
n = n.toString(16)
|
|
272
|
-
if (n.length < 2) {
|
|
273
|
-
n = '0' + n
|
|
274
|
-
}
|
|
275
|
-
return n
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
function push(i, r, g, b) {
|
|
279
|
-
cols[i] = '#' + hex(r) + hex(g) + hex(b)
|
|
280
|
-
_cols[i] = [r, g, b]
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
// 0 - 15
|
|
284
|
-
exports.xterm.forEach(function (c, i) {
|
|
285
|
-
c = parseInt(c.substring(1), 16)
|
|
286
|
-
push(i, (c >> 16) & 0xff, (c >> 8) & 0xff, c & 0xff)
|
|
287
|
-
})
|
|
288
|
-
|
|
289
|
-
// 16 - 231
|
|
290
|
-
for (r = 0; r < 6; r++) {
|
|
291
|
-
for (g = 0; g < 6; g++) {
|
|
292
|
-
for (b = 0; b < 6; b++) {
|
|
293
|
-
i = 16 + r * 36 + g * 6 + b
|
|
294
|
-
push(i, r ? r * 40 + 55 : 0, g ? g * 40 + 55 : 0, b ? b * 40 + 55 : 0)
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// 232 - 255 are grey.
|
|
300
|
-
for (g = 0; g < 24; g++) {
|
|
301
|
-
l = g * 10 + 8
|
|
302
|
-
i = 232 + g
|
|
303
|
-
push(i, l, l, l)
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
return cols
|
|
307
|
-
})()
|
|
308
|
-
|
|
309
|
-
// Map higher colors to the first 8 colors.
|
|
310
|
-
// This allows translation of high colors to low colors on 8-color terminals.
|
|
311
|
-
exports.ccolors = (function () {
|
|
312
|
-
let _cols = exports.vcolors.slice(),
|
|
313
|
-
cols = exports.colors.slice(),
|
|
314
|
-
out
|
|
315
|
-
|
|
316
|
-
exports.vcolors = exports.vcolors.slice(0, 8)
|
|
317
|
-
exports.colors = exports.colors.slice(0, 8)
|
|
318
|
-
|
|
319
|
-
out = cols.map(exports.match)
|
|
320
|
-
|
|
321
|
-
exports.colors = cols
|
|
322
|
-
exports.vcolors = _cols
|
|
323
|
-
exports.ccolors = out
|
|
324
|
-
|
|
325
|
-
return out
|
|
326
|
-
})()
|
|
327
|
-
|
|
328
|
-
const colorNames = (exports.colorNames = {
|
|
329
|
-
// special
|
|
330
|
-
default: -1,
|
|
331
|
-
normal: -1,
|
|
332
|
-
bg: -1,
|
|
333
|
-
fg: -1,
|
|
334
|
-
// normal
|
|
335
|
-
black: 0,
|
|
336
|
-
red: 1,
|
|
337
|
-
green: 2,
|
|
338
|
-
yellow: 3,
|
|
339
|
-
blue: 4,
|
|
340
|
-
magenta: 5,
|
|
341
|
-
cyan: 6,
|
|
342
|
-
white: 7,
|
|
343
|
-
// light
|
|
344
|
-
lightblack: 8,
|
|
345
|
-
lightred: 9,
|
|
346
|
-
lightgreen: 10,
|
|
347
|
-
lightyellow: 11,
|
|
348
|
-
lightblue: 12,
|
|
349
|
-
lightmagenta: 13,
|
|
350
|
-
lightcyan: 14,
|
|
351
|
-
lightwhite: 15,
|
|
352
|
-
// bright
|
|
353
|
-
brightblack: 8,
|
|
354
|
-
brightred: 9,
|
|
355
|
-
brightgreen: 10,
|
|
356
|
-
brightyellow: 11,
|
|
357
|
-
brightblue: 12,
|
|
358
|
-
brightmagenta: 13,
|
|
359
|
-
brightcyan: 14,
|
|
360
|
-
brightwhite: 15,
|
|
361
|
-
// alternate spellings
|
|
362
|
-
grey: 8,
|
|
363
|
-
gray: 8,
|
|
364
|
-
lightgrey: 7,
|
|
365
|
-
lightgray: 7,
|
|
366
|
-
brightgrey: 7,
|
|
367
|
-
brightgray: 7
|
|
368
|
-
})
|
|
369
|
-
|
|
370
|
-
exports.convert = function (color) {
|
|
371
|
-
if (typeof color === 'number') {
|
|
372
|
-
} else if (typeof color === 'string') {
|
|
373
|
-
color = color.replace(/[- ]/g, '')
|
|
374
|
-
if (colorNames[color] != null) {
|
|
375
|
-
color = colorNames[color]
|
|
376
|
-
} else {
|
|
377
|
-
color = exports.match(color)
|
|
378
|
-
}
|
|
379
|
-
} else if (Array.isArray(color)) {
|
|
380
|
-
color = exports.match(color)
|
|
381
|
-
} else {
|
|
382
|
-
color = -1
|
|
383
|
-
}
|
|
384
|
-
return color !== -1 ? color : 0x1ff
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// Map higher colors to the first 8 colors.
|
|
388
|
-
// This allows translation of high colors to low colors on 8-color terminals.
|
|
389
|
-
// Why the hell did I do this by hand?
|
|
390
|
-
exports.ccolors = {
|
|
391
|
-
blue: [
|
|
392
|
-
4,
|
|
393
|
-
12,
|
|
394
|
-
[17, 21],
|
|
395
|
-
[24, 27],
|
|
396
|
-
[31, 33],
|
|
397
|
-
[38, 39],
|
|
398
|
-
45,
|
|
399
|
-
[54, 57],
|
|
400
|
-
[60, 63],
|
|
401
|
-
[67, 69],
|
|
402
|
-
[74, 75],
|
|
403
|
-
81,
|
|
404
|
-
[91, 93],
|
|
405
|
-
[97, 99],
|
|
406
|
-
[103, 105],
|
|
407
|
-
[110, 111],
|
|
408
|
-
117,
|
|
409
|
-
[128, 129],
|
|
410
|
-
[134, 135],
|
|
411
|
-
[140, 141],
|
|
412
|
-
[146, 147],
|
|
413
|
-
153,
|
|
414
|
-
165,
|
|
415
|
-
171,
|
|
416
|
-
177,
|
|
417
|
-
183,
|
|
418
|
-
189
|
|
419
|
-
],
|
|
420
|
-
|
|
421
|
-
green: [
|
|
422
|
-
2,
|
|
423
|
-
10,
|
|
424
|
-
22,
|
|
425
|
-
[28, 29],
|
|
426
|
-
[34, 36],
|
|
427
|
-
[40, 43],
|
|
428
|
-
[46, 50],
|
|
429
|
-
[64, 65],
|
|
430
|
-
[70, 72],
|
|
431
|
-
[76, 79],
|
|
432
|
-
[82, 86],
|
|
433
|
-
[106, 108],
|
|
434
|
-
[112, 115],
|
|
435
|
-
[118, 122],
|
|
436
|
-
[148, 151],
|
|
437
|
-
[154, 158],
|
|
438
|
-
[190, 194]
|
|
439
|
-
],
|
|
440
|
-
|
|
441
|
-
cyan: [
|
|
442
|
-
6, 14, 23, 30, 37, 44, 51, 66, 73, 80, 87, 109, 116, 123, 152, 159, 195
|
|
443
|
-
],
|
|
444
|
-
|
|
445
|
-
red: [
|
|
446
|
-
1,
|
|
447
|
-
9,
|
|
448
|
-
52,
|
|
449
|
-
[88, 89],
|
|
450
|
-
[94, 95],
|
|
451
|
-
[124, 126],
|
|
452
|
-
[130, 132],
|
|
453
|
-
[136, 138],
|
|
454
|
-
[160, 163],
|
|
455
|
-
[166, 169],
|
|
456
|
-
[172, 175],
|
|
457
|
-
[178, 181],
|
|
458
|
-
[196, 200],
|
|
459
|
-
[202, 206],
|
|
460
|
-
[208, 212],
|
|
461
|
-
[214, 218],
|
|
462
|
-
[220, 224]
|
|
463
|
-
],
|
|
464
|
-
|
|
465
|
-
magenta: [
|
|
466
|
-
5, 13, 53, 90, 96, 127, 133, 139, 164, 170, 176, 182, 201, 207, 213, 219,
|
|
467
|
-
225
|
|
468
|
-
],
|
|
469
|
-
|
|
470
|
-
yellow: [3, 11, 58, [100, 101], [142, 144], [184, 187], [226, 230]],
|
|
471
|
-
|
|
472
|
-
black: [0, 8, 16, 59, 102, [232, 243]],
|
|
473
|
-
|
|
474
|
-
white: [7, 15, 145, 188, 231, [244, 255]]
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
exports.ncolors = []
|
|
478
|
-
|
|
479
|
-
Object.keys(exports.ccolors).forEach(function (name) {
|
|
480
|
-
exports.ccolors[name].forEach(function (offset) {
|
|
481
|
-
if (typeof offset === 'number') {
|
|
482
|
-
exports.ncolors[offset] = name
|
|
483
|
-
exports.ccolors[offset] = exports.colorNames[name]
|
|
484
|
-
return
|
|
485
|
-
}
|
|
486
|
-
for (let i = offset[0], l = offset[1]; i <= l; i++) {
|
|
487
|
-
exports.ncolors[i] = name
|
|
488
|
-
exports.ccolors[i] = exports.colorNames[name]
|
|
489
|
-
}
|
|
490
|
-
})
|
|
491
|
-
delete exports.ccolors[name]
|
|
492
|
-
})
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* events.js - event emitter for blessed
|
|
5
|
-
* Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License).
|
|
6
|
-
* https://github.com/chjj/blessed
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const slice = Array.prototype.slice
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* EventEmitter
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
function EventEmitter() {
|
|
16
|
-
if (!this._events) {
|
|
17
|
-
this._events = {}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
EventEmitter.prototype.setMaxListeners = function (n) {
|
|
22
|
-
this._maxListeners = n
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
EventEmitter.prototype.addListener = function (type, listener) {
|
|
26
|
-
if (!this._events[type]) {
|
|
27
|
-
this._events[type] = listener
|
|
28
|
-
} else if (typeof this._events[type] === 'function') {
|
|
29
|
-
this._events[type] = [this._events[type], listener]
|
|
30
|
-
} else {
|
|
31
|
-
this._events[type].push(listener)
|
|
32
|
-
}
|
|
33
|
-
this._emit('newListener', [type, listener])
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
EventEmitter.prototype.on = EventEmitter.prototype.addListener
|
|
37
|
-
|
|
38
|
-
EventEmitter.prototype.removeListener = function (type, listener) {
|
|
39
|
-
const handler = this._events[type]
|
|
40
|
-
if (!handler) {
|
|
41
|
-
return
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (typeof handler === 'function' || handler.length === 1) {
|
|
45
|
-
delete this._events[type]
|
|
46
|
-
this._emit('removeListener', [type, listener])
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
for (let i = 0; i < handler.length; i++) {
|
|
51
|
-
if (handler[i] === listener || handler[i].listener === listener) {
|
|
52
|
-
handler.splice(i, 1)
|
|
53
|
-
this._emit('removeListener', [type, listener])
|
|
54
|
-
return
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
EventEmitter.prototype.off = EventEmitter.prototype.removeListener
|
|
60
|
-
|
|
61
|
-
EventEmitter.prototype.removeAllListeners = function (type) {
|
|
62
|
-
if (type) {
|
|
63
|
-
delete this._events[type]
|
|
64
|
-
} else {
|
|
65
|
-
this._events = {}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
EventEmitter.prototype.once = function (type, listener) {
|
|
70
|
-
function on() {
|
|
71
|
-
this.removeListener(type, on)
|
|
72
|
-
return listener.apply(this, arguments)
|
|
73
|
-
}
|
|
74
|
-
on.listener = listener
|
|
75
|
-
return this.on(type, on)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
EventEmitter.prototype.listeners = function (type) {
|
|
79
|
-
return typeof this._events[type] === 'function'
|
|
80
|
-
? [this._events[type]]
|
|
81
|
-
: this._events[type] || []
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
EventEmitter.prototype._emit = function (type, args) {
|
|
85
|
-
let handler = this._events[type],
|
|
86
|
-
ret
|
|
87
|
-
|
|
88
|
-
// if (type !== 'event') {
|
|
89
|
-
// this._emit('event', [type.replace(/^element /, '')].concat(args));
|
|
90
|
-
// }
|
|
91
|
-
|
|
92
|
-
if (!handler) {
|
|
93
|
-
if (type === 'error') {
|
|
94
|
-
throw new args[0]()
|
|
95
|
-
}
|
|
96
|
-
return
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (typeof handler === 'function') {
|
|
100
|
-
return handler.apply(this, args)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
for (let i = 0; i < handler.length; i++) {
|
|
104
|
-
if (handler[i].apply(this, args) === false) {
|
|
105
|
-
ret = false
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return ret !== false
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
EventEmitter.prototype.emit = function (type) {
|
|
113
|
-
let args = slice.call(arguments, 1),
|
|
114
|
-
params = slice.call(arguments),
|
|
115
|
-
el = this
|
|
116
|
-
|
|
117
|
-
this._emit('event', params)
|
|
118
|
-
|
|
119
|
-
if (this.type === 'screen') {
|
|
120
|
-
return this._emit(type, args)
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (this._emit(type, args) === false) {
|
|
124
|
-
return false
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
type = 'element ' + type
|
|
128
|
-
args.unshift(this)
|
|
129
|
-
// `element` prefix
|
|
130
|
-
// params = [type].concat(args);
|
|
131
|
-
// no `element` prefix
|
|
132
|
-
// params.splice(1, 0, this);
|
|
133
|
-
|
|
134
|
-
do {
|
|
135
|
-
// el._emit('event', params);
|
|
136
|
-
if (!el._events[type]) {
|
|
137
|
-
continue
|
|
138
|
-
}
|
|
139
|
-
if (el._emit(type, args) === false) {
|
|
140
|
-
return false
|
|
141
|
-
}
|
|
142
|
-
} while ((el = el.parent))
|
|
143
|
-
|
|
144
|
-
return true
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// For hooking into the main EventEmitter if we want to.
|
|
148
|
-
// Might be better to do things this way being that it
|
|
149
|
-
// will always be compatible with node, not to mention
|
|
150
|
-
// it gives us domain support as well.
|
|
151
|
-
// Node.prototype._emit = Node.prototype.emit;
|
|
152
|
-
// Node.prototype.emit = function(type) {
|
|
153
|
-
// var args, el;
|
|
154
|
-
//
|
|
155
|
-
// if (this.type === 'screen') {
|
|
156
|
-
// return this._emit.apply(this, arguments);
|
|
157
|
-
// }
|
|
158
|
-
//
|
|
159
|
-
// this._emit.apply(this, arguments);
|
|
160
|
-
// if (this._bubbleStopped) return false;
|
|
161
|
-
//
|
|
162
|
-
// args = slice.call(arguments, 1);
|
|
163
|
-
// el = this;
|
|
164
|
-
//
|
|
165
|
-
// args.unshift('element ' + type, this);
|
|
166
|
-
// this._bubbleStopped = false;
|
|
167
|
-
// //args.push(stopBubble);
|
|
168
|
-
//
|
|
169
|
-
// do {
|
|
170
|
-
// if (!el._events || !el._events[type]) continue;
|
|
171
|
-
// el._emit.apply(el, args);
|
|
172
|
-
// if (this._bubbleStopped) return false;
|
|
173
|
-
// } while (el = el.parent);
|
|
174
|
-
//
|
|
175
|
-
// return true;
|
|
176
|
-
// };
|
|
177
|
-
//
|
|
178
|
-
// Node.prototype._addListener = Node.prototype.addListener;
|
|
179
|
-
// Node.prototype.on =
|
|
180
|
-
// Node.prototype.addListener = function(type, listener) {
|
|
181
|
-
// function on() {
|
|
182
|
-
// if (listener.apply(this, arguments) === false) {
|
|
183
|
-
// this._bubbleStopped = true;
|
|
184
|
-
// }
|
|
185
|
-
// }
|
|
186
|
-
// on.listener = listener;
|
|
187
|
-
// return this._addListener(type, on);
|
|
188
|
-
// };
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Expose
|
|
192
|
-
*/
|
|
193
|
-
|
|
194
|
-
exports = EventEmitter
|
|
195
|
-
exports.EventEmitter = EventEmitter
|
|
196
|
-
|
|
197
|
-
module.exports = exports
|