@lvce-editor/main-process 1.10.0 → 1.11.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.
- package/dist/mainProcessMain.js +509 -2235
- package/package.json +2 -2
package/dist/mainProcessMain.js
CHANGED
|
@@ -6,15 +6,15 @@ import { spawn } from 'node:child_process';
|
|
|
6
6
|
import { createWriteStream, readFileSync } from 'node:fs';
|
|
7
7
|
import * as NodePath from 'node:path';
|
|
8
8
|
import { dirname } from 'node:path';
|
|
9
|
-
import require$$
|
|
10
|
-
import require$$1 from 'util';
|
|
11
|
-
import require$$0
|
|
9
|
+
import require$$1 from 'tty';
|
|
10
|
+
import require$$1$1 from 'util';
|
|
11
|
+
import require$$0 from 'os';
|
|
12
12
|
import { Console } from 'node:console';
|
|
13
13
|
import { tmpdir, homedir } from 'node:os';
|
|
14
14
|
import { fileURLToPath } from 'node:url';
|
|
15
15
|
import { MessageChannel } from 'node:worker_threads';
|
|
16
16
|
|
|
17
|
-
function escapeStringRegexp
|
|
17
|
+
function escapeStringRegexp(string) {
|
|
18
18
|
if (typeof string !== 'string') {
|
|
19
19
|
throw new TypeError('Expected a string');
|
|
20
20
|
}
|
|
@@ -33,7 +33,7 @@ function cleanStack$1(stack, {
|
|
|
33
33
|
basePath,
|
|
34
34
|
pathFilter
|
|
35
35
|
} = {}) {
|
|
36
|
-
const basePathRegex = basePath && new RegExp(`(file://)?${escapeStringRegexp
|
|
36
|
+
const basePathRegex = basePath && new RegExp(`(file://)?${escapeStringRegexp(basePath.replace(/\\/g, '/'))}/?`, 'g');
|
|
37
37
|
const homeDirectory = pretty ? getHomeDirectory() : '';
|
|
38
38
|
if (typeof stack !== 'string') {
|
|
39
39
|
return undefined;
|
|
@@ -739,7 +739,7 @@ const setLogsPath = value => {
|
|
|
739
739
|
};
|
|
740
740
|
|
|
741
741
|
const {
|
|
742
|
-
argv
|
|
742
|
+
argv
|
|
743
743
|
} = process;
|
|
744
744
|
|
|
745
745
|
const Success = 0;
|
|
@@ -805,2246 +805,520 @@ process.stderr.on('error', error => {
|
|
|
805
805
|
logger.error(`[main-process] stderr error: ${error.stack}`);
|
|
806
806
|
});
|
|
807
807
|
|
|
808
|
-
var lib$2 = {};
|
|
809
808
|
var lib$1 = {};
|
|
810
|
-
var jsTokens = {};
|
|
811
|
-
|
|
812
|
-
// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell
|
|
813
|
-
// License: MIT. (See LICENSE.)
|
|
814
|
-
|
|
815
|
-
Object.defineProperty(jsTokens, "__esModule", {
|
|
816
|
-
value: true
|
|
817
|
-
});
|
|
818
809
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
return !isFirst;
|
|
898
|
-
}
|
|
899
|
-
var keyword = {};
|
|
900
|
-
Object.defineProperty(keyword, "__esModule", {
|
|
901
|
-
value: true
|
|
902
|
-
});
|
|
903
|
-
keyword.isKeyword = isKeyword;
|
|
904
|
-
keyword.isReservedWord = isReservedWord;
|
|
905
|
-
keyword.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
|
|
906
|
-
keyword.isStrictBindReservedWord = isStrictBindReservedWord;
|
|
907
|
-
keyword.isStrictReservedWord = isStrictReservedWord;
|
|
908
|
-
const reservedWords = {
|
|
909
|
-
keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
|
|
910
|
-
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
|
|
911
|
-
strictBind: ["eval", "arguments"]
|
|
912
|
-
};
|
|
913
|
-
const keywords = new Set(reservedWords.keyword);
|
|
914
|
-
const reservedWordsStrictSet = new Set(reservedWords.strict);
|
|
915
|
-
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
|
916
|
-
function isReservedWord(word, inModule) {
|
|
917
|
-
return inModule && word === "await" || word === "enum";
|
|
918
|
-
}
|
|
919
|
-
function isStrictReservedWord(word, inModule) {
|
|
920
|
-
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
|
|
921
|
-
}
|
|
922
|
-
function isStrictBindOnlyReservedWord(word) {
|
|
923
|
-
return reservedWordsStrictBindSet.has(word);
|
|
924
|
-
}
|
|
925
|
-
function isStrictBindReservedWord(word, inModule) {
|
|
926
|
-
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
|
|
927
|
-
}
|
|
928
|
-
function isKeyword(word) {
|
|
929
|
-
return keywords.has(word);
|
|
930
|
-
}
|
|
931
|
-
(function (exports) {
|
|
932
|
-
Object.defineProperty(exports, "__esModule", {
|
|
933
|
-
value: true
|
|
934
|
-
});
|
|
935
|
-
Object.defineProperty(exports, "isIdentifierChar", {
|
|
936
|
-
enumerable: true,
|
|
937
|
-
get: function () {
|
|
938
|
-
return _identifier.isIdentifierChar;
|
|
939
|
-
}
|
|
940
|
-
});
|
|
941
|
-
Object.defineProperty(exports, "isIdentifierName", {
|
|
942
|
-
enumerable: true,
|
|
943
|
-
get: function () {
|
|
944
|
-
return _identifier.isIdentifierName;
|
|
945
|
-
}
|
|
946
|
-
});
|
|
947
|
-
Object.defineProperty(exports, "isIdentifierStart", {
|
|
948
|
-
enumerable: true,
|
|
949
|
-
get: function () {
|
|
950
|
-
return _identifier.isIdentifierStart;
|
|
951
|
-
}
|
|
952
|
-
});
|
|
953
|
-
Object.defineProperty(exports, "isKeyword", {
|
|
954
|
-
enumerable: true,
|
|
955
|
-
get: function () {
|
|
956
|
-
return _keyword.isKeyword;
|
|
957
|
-
}
|
|
958
|
-
});
|
|
959
|
-
Object.defineProperty(exports, "isReservedWord", {
|
|
960
|
-
enumerable: true,
|
|
961
|
-
get: function () {
|
|
962
|
-
return _keyword.isReservedWord;
|
|
963
|
-
}
|
|
964
|
-
});
|
|
965
|
-
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
|
|
966
|
-
enumerable: true,
|
|
967
|
-
get: function () {
|
|
968
|
-
return _keyword.isStrictBindOnlyReservedWord;
|
|
969
|
-
}
|
|
970
|
-
});
|
|
971
|
-
Object.defineProperty(exports, "isStrictBindReservedWord", {
|
|
972
|
-
enumerable: true,
|
|
973
|
-
get: function () {
|
|
974
|
-
return _keyword.isStrictBindReservedWord;
|
|
975
|
-
}
|
|
976
|
-
});
|
|
977
|
-
Object.defineProperty(exports, "isStrictReservedWord", {
|
|
978
|
-
enumerable: true,
|
|
979
|
-
get: function () {
|
|
980
|
-
return _keyword.isStrictReservedWord;
|
|
981
|
-
}
|
|
982
|
-
});
|
|
983
|
-
var _identifier = identifier;
|
|
984
|
-
var _keyword = keyword;
|
|
985
|
-
})(lib);
|
|
986
|
-
function commonjsRequire(path) {
|
|
987
|
-
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
988
|
-
}
|
|
989
|
-
var picocolors = {
|
|
990
|
-
exports: {}
|
|
991
|
-
};
|
|
992
|
-
let argv = process.argv || [],
|
|
993
|
-
env$2 = process.env;
|
|
994
|
-
let isColorSupported = !("NO_COLOR" in env$2 || argv.includes("--no-color")) && ("FORCE_COLOR" in env$2 || argv.includes("--color") || process.platform === "win32" || commonjsRequire != null && require$$0.isatty(1) && env$2.TERM !== "dumb" || "CI" in env$2);
|
|
995
|
-
let formatter = (open, close, replace = open) => input => {
|
|
996
|
-
let string = "" + input;
|
|
997
|
-
let index = string.indexOf(close, open.length);
|
|
998
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
999
|
-
};
|
|
1000
|
-
let replaceClose = (string, close, replace, index) => {
|
|
1001
|
-
let result = "";
|
|
1002
|
-
let cursor = 0;
|
|
1003
|
-
do {
|
|
1004
|
-
result += string.substring(cursor, index) + replace;
|
|
1005
|
-
cursor = index + close.length;
|
|
1006
|
-
index = string.indexOf(close, cursor);
|
|
1007
|
-
} while (~index);
|
|
1008
|
-
return result + string.substring(cursor);
|
|
1009
|
-
};
|
|
1010
|
-
let createColors = (enabled = isColorSupported) => {
|
|
1011
|
-
let init = enabled ? formatter : () => String;
|
|
1012
|
-
return {
|
|
1013
|
-
isColorSupported: enabled,
|
|
1014
|
-
reset: init("\x1b[0m", "\x1b[0m"),
|
|
1015
|
-
bold: init("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
1016
|
-
dim: init("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
1017
|
-
italic: init("\x1b[3m", "\x1b[23m"),
|
|
1018
|
-
underline: init("\x1b[4m", "\x1b[24m"),
|
|
1019
|
-
inverse: init("\x1b[7m", "\x1b[27m"),
|
|
1020
|
-
hidden: init("\x1b[8m", "\x1b[28m"),
|
|
1021
|
-
strikethrough: init("\x1b[9m", "\x1b[29m"),
|
|
1022
|
-
black: init("\x1b[30m", "\x1b[39m"),
|
|
1023
|
-
red: init("\x1b[31m", "\x1b[39m"),
|
|
1024
|
-
green: init("\x1b[32m", "\x1b[39m"),
|
|
1025
|
-
yellow: init("\x1b[33m", "\x1b[39m"),
|
|
1026
|
-
blue: init("\x1b[34m", "\x1b[39m"),
|
|
1027
|
-
magenta: init("\x1b[35m", "\x1b[39m"),
|
|
1028
|
-
cyan: init("\x1b[36m", "\x1b[39m"),
|
|
1029
|
-
white: init("\x1b[37m", "\x1b[39m"),
|
|
1030
|
-
gray: init("\x1b[90m", "\x1b[39m"),
|
|
1031
|
-
bgBlack: init("\x1b[40m", "\x1b[49m"),
|
|
1032
|
-
bgRed: init("\x1b[41m", "\x1b[49m"),
|
|
1033
|
-
bgGreen: init("\x1b[42m", "\x1b[49m"),
|
|
1034
|
-
bgYellow: init("\x1b[43m", "\x1b[49m"),
|
|
1035
|
-
bgBlue: init("\x1b[44m", "\x1b[49m"),
|
|
1036
|
-
bgMagenta: init("\x1b[45m", "\x1b[49m"),
|
|
1037
|
-
bgCyan: init("\x1b[46m", "\x1b[49m"),
|
|
1038
|
-
bgWhite: init("\x1b[47m", "\x1b[49m")
|
|
1039
|
-
};
|
|
1040
|
-
};
|
|
1041
|
-
picocolors.exports = createColors();
|
|
1042
|
-
picocolors.exports.createColors = createColors;
|
|
1043
|
-
var picocolorsExports = picocolors.exports;
|
|
1044
|
-
var chalk = {
|
|
1045
|
-
exports: {}
|
|
1046
|
-
};
|
|
1047
|
-
var escapeStringRegexp;
|
|
1048
|
-
var hasRequiredEscapeStringRegexp;
|
|
1049
|
-
function requireEscapeStringRegexp() {
|
|
1050
|
-
if (hasRequiredEscapeStringRegexp) return escapeStringRegexp;
|
|
1051
|
-
hasRequiredEscapeStringRegexp = 1;
|
|
1052
|
-
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
1053
|
-
escapeStringRegexp = function (str) {
|
|
1054
|
-
if (typeof str !== 'string') {
|
|
1055
|
-
throw new TypeError('Expected a string');
|
|
1056
|
-
}
|
|
1057
|
-
return str.replace(matchOperatorsRe, '\\$&');
|
|
1058
|
-
};
|
|
1059
|
-
return escapeStringRegexp;
|
|
1060
|
-
}
|
|
1061
|
-
var ansiStyles = {
|
|
1062
|
-
exports: {}
|
|
1063
|
-
};
|
|
1064
|
-
var conversions = {
|
|
1065
|
-
exports: {}
|
|
1066
|
-
};
|
|
1067
|
-
var colorName;
|
|
1068
|
-
var hasRequiredColorName;
|
|
1069
|
-
function requireColorName() {
|
|
1070
|
-
if (hasRequiredColorName) return colorName;
|
|
1071
|
-
hasRequiredColorName = 1;
|
|
1072
|
-
colorName = {
|
|
1073
|
-
"aliceblue": [240, 248, 255],
|
|
1074
|
-
"antiquewhite": [250, 235, 215],
|
|
1075
|
-
"aqua": [0, 255, 255],
|
|
1076
|
-
"aquamarine": [127, 255, 212],
|
|
1077
|
-
"azure": [240, 255, 255],
|
|
1078
|
-
"beige": [245, 245, 220],
|
|
1079
|
-
"bisque": [255, 228, 196],
|
|
1080
|
-
"black": [0, 0, 0],
|
|
1081
|
-
"blanchedalmond": [255, 235, 205],
|
|
1082
|
-
"blue": [0, 0, 255],
|
|
1083
|
-
"blueviolet": [138, 43, 226],
|
|
1084
|
-
"brown": [165, 42, 42],
|
|
1085
|
-
"burlywood": [222, 184, 135],
|
|
1086
|
-
"cadetblue": [95, 158, 160],
|
|
1087
|
-
"chartreuse": [127, 255, 0],
|
|
1088
|
-
"chocolate": [210, 105, 30],
|
|
1089
|
-
"coral": [255, 127, 80],
|
|
1090
|
-
"cornflowerblue": [100, 149, 237],
|
|
1091
|
-
"cornsilk": [255, 248, 220],
|
|
1092
|
-
"crimson": [220, 20, 60],
|
|
1093
|
-
"cyan": [0, 255, 255],
|
|
1094
|
-
"darkblue": [0, 0, 139],
|
|
1095
|
-
"darkcyan": [0, 139, 139],
|
|
1096
|
-
"darkgoldenrod": [184, 134, 11],
|
|
1097
|
-
"darkgray": [169, 169, 169],
|
|
1098
|
-
"darkgreen": [0, 100, 0],
|
|
1099
|
-
"darkgrey": [169, 169, 169],
|
|
1100
|
-
"darkkhaki": [189, 183, 107],
|
|
1101
|
-
"darkmagenta": [139, 0, 139],
|
|
1102
|
-
"darkolivegreen": [85, 107, 47],
|
|
1103
|
-
"darkorange": [255, 140, 0],
|
|
1104
|
-
"darkorchid": [153, 50, 204],
|
|
1105
|
-
"darkred": [139, 0, 0],
|
|
1106
|
-
"darksalmon": [233, 150, 122],
|
|
1107
|
-
"darkseagreen": [143, 188, 143],
|
|
1108
|
-
"darkslateblue": [72, 61, 139],
|
|
1109
|
-
"darkslategray": [47, 79, 79],
|
|
1110
|
-
"darkslategrey": [47, 79, 79],
|
|
1111
|
-
"darkturquoise": [0, 206, 209],
|
|
1112
|
-
"darkviolet": [148, 0, 211],
|
|
1113
|
-
"deeppink": [255, 20, 147],
|
|
1114
|
-
"deepskyblue": [0, 191, 255],
|
|
1115
|
-
"dimgray": [105, 105, 105],
|
|
1116
|
-
"dimgrey": [105, 105, 105],
|
|
1117
|
-
"dodgerblue": [30, 144, 255],
|
|
1118
|
-
"firebrick": [178, 34, 34],
|
|
1119
|
-
"floralwhite": [255, 250, 240],
|
|
1120
|
-
"forestgreen": [34, 139, 34],
|
|
1121
|
-
"fuchsia": [255, 0, 255],
|
|
1122
|
-
"gainsboro": [220, 220, 220],
|
|
1123
|
-
"ghostwhite": [248, 248, 255],
|
|
1124
|
-
"gold": [255, 215, 0],
|
|
1125
|
-
"goldenrod": [218, 165, 32],
|
|
1126
|
-
"gray": [128, 128, 128],
|
|
1127
|
-
"green": [0, 128, 0],
|
|
1128
|
-
"greenyellow": [173, 255, 47],
|
|
1129
|
-
"grey": [128, 128, 128],
|
|
1130
|
-
"honeydew": [240, 255, 240],
|
|
1131
|
-
"hotpink": [255, 105, 180],
|
|
1132
|
-
"indianred": [205, 92, 92],
|
|
1133
|
-
"indigo": [75, 0, 130],
|
|
1134
|
-
"ivory": [255, 255, 240],
|
|
1135
|
-
"khaki": [240, 230, 140],
|
|
1136
|
-
"lavender": [230, 230, 250],
|
|
1137
|
-
"lavenderblush": [255, 240, 245],
|
|
1138
|
-
"lawngreen": [124, 252, 0],
|
|
1139
|
-
"lemonchiffon": [255, 250, 205],
|
|
1140
|
-
"lightblue": [173, 216, 230],
|
|
1141
|
-
"lightcoral": [240, 128, 128],
|
|
1142
|
-
"lightcyan": [224, 255, 255],
|
|
1143
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
1144
|
-
"lightgray": [211, 211, 211],
|
|
1145
|
-
"lightgreen": [144, 238, 144],
|
|
1146
|
-
"lightgrey": [211, 211, 211],
|
|
1147
|
-
"lightpink": [255, 182, 193],
|
|
1148
|
-
"lightsalmon": [255, 160, 122],
|
|
1149
|
-
"lightseagreen": [32, 178, 170],
|
|
1150
|
-
"lightskyblue": [135, 206, 250],
|
|
1151
|
-
"lightslategray": [119, 136, 153],
|
|
1152
|
-
"lightslategrey": [119, 136, 153],
|
|
1153
|
-
"lightsteelblue": [176, 196, 222],
|
|
1154
|
-
"lightyellow": [255, 255, 224],
|
|
1155
|
-
"lime": [0, 255, 0],
|
|
1156
|
-
"limegreen": [50, 205, 50],
|
|
1157
|
-
"linen": [250, 240, 230],
|
|
1158
|
-
"magenta": [255, 0, 255],
|
|
1159
|
-
"maroon": [128, 0, 0],
|
|
1160
|
-
"mediumaquamarine": [102, 205, 170],
|
|
1161
|
-
"mediumblue": [0, 0, 205],
|
|
1162
|
-
"mediumorchid": [186, 85, 211],
|
|
1163
|
-
"mediumpurple": [147, 112, 219],
|
|
1164
|
-
"mediumseagreen": [60, 179, 113],
|
|
1165
|
-
"mediumslateblue": [123, 104, 238],
|
|
1166
|
-
"mediumspringgreen": [0, 250, 154],
|
|
1167
|
-
"mediumturquoise": [72, 209, 204],
|
|
1168
|
-
"mediumvioletred": [199, 21, 133],
|
|
1169
|
-
"midnightblue": [25, 25, 112],
|
|
1170
|
-
"mintcream": [245, 255, 250],
|
|
1171
|
-
"mistyrose": [255, 228, 225],
|
|
1172
|
-
"moccasin": [255, 228, 181],
|
|
1173
|
-
"navajowhite": [255, 222, 173],
|
|
1174
|
-
"navy": [0, 0, 128],
|
|
1175
|
-
"oldlace": [253, 245, 230],
|
|
1176
|
-
"olive": [128, 128, 0],
|
|
1177
|
-
"olivedrab": [107, 142, 35],
|
|
1178
|
-
"orange": [255, 165, 0],
|
|
1179
|
-
"orangered": [255, 69, 0],
|
|
1180
|
-
"orchid": [218, 112, 214],
|
|
1181
|
-
"palegoldenrod": [238, 232, 170],
|
|
1182
|
-
"palegreen": [152, 251, 152],
|
|
1183
|
-
"paleturquoise": [175, 238, 238],
|
|
1184
|
-
"palevioletred": [219, 112, 147],
|
|
1185
|
-
"papayawhip": [255, 239, 213],
|
|
1186
|
-
"peachpuff": [255, 218, 185],
|
|
1187
|
-
"peru": [205, 133, 63],
|
|
1188
|
-
"pink": [255, 192, 203],
|
|
1189
|
-
"plum": [221, 160, 221],
|
|
1190
|
-
"powderblue": [176, 224, 230],
|
|
1191
|
-
"purple": [128, 0, 128],
|
|
1192
|
-
"rebeccapurple": [102, 51, 153],
|
|
1193
|
-
"red": [255, 0, 0],
|
|
1194
|
-
"rosybrown": [188, 143, 143],
|
|
1195
|
-
"royalblue": [65, 105, 225],
|
|
1196
|
-
"saddlebrown": [139, 69, 19],
|
|
1197
|
-
"salmon": [250, 128, 114],
|
|
1198
|
-
"sandybrown": [244, 164, 96],
|
|
1199
|
-
"seagreen": [46, 139, 87],
|
|
1200
|
-
"seashell": [255, 245, 238],
|
|
1201
|
-
"sienna": [160, 82, 45],
|
|
1202
|
-
"silver": [192, 192, 192],
|
|
1203
|
-
"skyblue": [135, 206, 235],
|
|
1204
|
-
"slateblue": [106, 90, 205],
|
|
1205
|
-
"slategray": [112, 128, 144],
|
|
1206
|
-
"slategrey": [112, 128, 144],
|
|
1207
|
-
"snow": [255, 250, 250],
|
|
1208
|
-
"springgreen": [0, 255, 127],
|
|
1209
|
-
"steelblue": [70, 130, 180],
|
|
1210
|
-
"tan": [210, 180, 140],
|
|
1211
|
-
"teal": [0, 128, 128],
|
|
1212
|
-
"thistle": [216, 191, 216],
|
|
1213
|
-
"tomato": [255, 99, 71],
|
|
1214
|
-
"turquoise": [64, 224, 208],
|
|
1215
|
-
"violet": [238, 130, 238],
|
|
1216
|
-
"wheat": [245, 222, 179],
|
|
1217
|
-
"white": [255, 255, 255],
|
|
1218
|
-
"whitesmoke": [245, 245, 245],
|
|
1219
|
-
"yellow": [255, 255, 0],
|
|
1220
|
-
"yellowgreen": [154, 205, 50]
|
|
1221
|
-
};
|
|
1222
|
-
return colorName;
|
|
810
|
+
var picocolors = {exports: {}};
|
|
811
|
+
|
|
812
|
+
var hasRequiredPicocolors;
|
|
813
|
+
|
|
814
|
+
function requirePicocolors () {
|
|
815
|
+
if (hasRequiredPicocolors) return picocolors.exports;
|
|
816
|
+
hasRequiredPicocolors = 1;
|
|
817
|
+
let p = process || {},
|
|
818
|
+
argv = p.argv || [],
|
|
819
|
+
env = p.env || {};
|
|
820
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
821
|
+
let formatter = (open, close, replace = open) => input => {
|
|
822
|
+
let string = "" + input,
|
|
823
|
+
index = string.indexOf(close, open.length);
|
|
824
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
825
|
+
};
|
|
826
|
+
let replaceClose = (string, close, replace, index) => {
|
|
827
|
+
let result = "",
|
|
828
|
+
cursor = 0;
|
|
829
|
+
do {
|
|
830
|
+
result += string.substring(cursor, index) + replace;
|
|
831
|
+
cursor = index + close.length;
|
|
832
|
+
index = string.indexOf(close, cursor);
|
|
833
|
+
} while (~index);
|
|
834
|
+
return result + string.substring(cursor);
|
|
835
|
+
};
|
|
836
|
+
let createColors = (enabled = isColorSupported) => {
|
|
837
|
+
let f = enabled ? formatter : () => String;
|
|
838
|
+
return {
|
|
839
|
+
isColorSupported: enabled,
|
|
840
|
+
reset: f("\x1b[0m", "\x1b[0m"),
|
|
841
|
+
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
842
|
+
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
843
|
+
italic: f("\x1b[3m", "\x1b[23m"),
|
|
844
|
+
underline: f("\x1b[4m", "\x1b[24m"),
|
|
845
|
+
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
846
|
+
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
847
|
+
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
848
|
+
black: f("\x1b[30m", "\x1b[39m"),
|
|
849
|
+
red: f("\x1b[31m", "\x1b[39m"),
|
|
850
|
+
green: f("\x1b[32m", "\x1b[39m"),
|
|
851
|
+
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
852
|
+
blue: f("\x1b[34m", "\x1b[39m"),
|
|
853
|
+
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
854
|
+
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
855
|
+
white: f("\x1b[37m", "\x1b[39m"),
|
|
856
|
+
gray: f("\x1b[90m", "\x1b[39m"),
|
|
857
|
+
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
858
|
+
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
859
|
+
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
860
|
+
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
861
|
+
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
862
|
+
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
863
|
+
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
864
|
+
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
865
|
+
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
866
|
+
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
867
|
+
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
868
|
+
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
869
|
+
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
870
|
+
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
871
|
+
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
872
|
+
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
873
|
+
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
874
|
+
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
875
|
+
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
876
|
+
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
877
|
+
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
878
|
+
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
879
|
+
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
880
|
+
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
881
|
+
};
|
|
882
|
+
};
|
|
883
|
+
picocolors.exports = createColors();
|
|
884
|
+
picocolors.exports.createColors = createColors;
|
|
885
|
+
return picocolors.exports;
|
|
1223
886
|
}
|
|
1224
887
|
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
var hasRequiredConversions;
|
|
1228
|
-
function requireConversions() {
|
|
1229
|
-
if (hasRequiredConversions) return conversions.exports;
|
|
1230
|
-
hasRequiredConversions = 1;
|
|
1231
|
-
var cssKeywords = requireColorName();
|
|
1232
|
-
|
|
1233
|
-
// NOTE: conversions should only return primitive values (i.e. arrays, or
|
|
1234
|
-
// values that give correct `typeof` results).
|
|
1235
|
-
// do not use box values types (i.e. Number(), String(), etc.)
|
|
1236
|
-
|
|
1237
|
-
var reverseKeywords = {};
|
|
1238
|
-
for (var key in cssKeywords) {
|
|
1239
|
-
if (cssKeywords.hasOwnProperty(key)) {
|
|
1240
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
var convert = conversions.exports = {
|
|
1244
|
-
rgb: {
|
|
1245
|
-
channels: 3,
|
|
1246
|
-
labels: 'rgb'
|
|
1247
|
-
},
|
|
1248
|
-
hsl: {
|
|
1249
|
-
channels: 3,
|
|
1250
|
-
labels: 'hsl'
|
|
1251
|
-
},
|
|
1252
|
-
hsv: {
|
|
1253
|
-
channels: 3,
|
|
1254
|
-
labels: 'hsv'
|
|
1255
|
-
},
|
|
1256
|
-
hwb: {
|
|
1257
|
-
channels: 3,
|
|
1258
|
-
labels: 'hwb'
|
|
1259
|
-
},
|
|
1260
|
-
cmyk: {
|
|
1261
|
-
channels: 4,
|
|
1262
|
-
labels: 'cmyk'
|
|
1263
|
-
},
|
|
1264
|
-
xyz: {
|
|
1265
|
-
channels: 3,
|
|
1266
|
-
labels: 'xyz'
|
|
1267
|
-
},
|
|
1268
|
-
lab: {
|
|
1269
|
-
channels: 3,
|
|
1270
|
-
labels: 'lab'
|
|
1271
|
-
},
|
|
1272
|
-
lch: {
|
|
1273
|
-
channels: 3,
|
|
1274
|
-
labels: 'lch'
|
|
1275
|
-
},
|
|
1276
|
-
hex: {
|
|
1277
|
-
channels: 1,
|
|
1278
|
-
labels: ['hex']
|
|
1279
|
-
},
|
|
1280
|
-
keyword: {
|
|
1281
|
-
channels: 1,
|
|
1282
|
-
labels: ['keyword']
|
|
1283
|
-
},
|
|
1284
|
-
ansi16: {
|
|
1285
|
-
channels: 1,
|
|
1286
|
-
labels: ['ansi16']
|
|
1287
|
-
},
|
|
1288
|
-
ansi256: {
|
|
1289
|
-
channels: 1,
|
|
1290
|
-
labels: ['ansi256']
|
|
1291
|
-
},
|
|
1292
|
-
hcg: {
|
|
1293
|
-
channels: 3,
|
|
1294
|
-
labels: ['h', 'c', 'g']
|
|
1295
|
-
},
|
|
1296
|
-
apple: {
|
|
1297
|
-
channels: 3,
|
|
1298
|
-
labels: ['r16', 'g16', 'b16']
|
|
1299
|
-
},
|
|
1300
|
-
gray: {
|
|
1301
|
-
channels: 1,
|
|
1302
|
-
labels: ['gray']
|
|
1303
|
-
}
|
|
1304
|
-
};
|
|
1305
|
-
|
|
1306
|
-
// hide .channels and .labels properties
|
|
1307
|
-
for (var model in convert) {
|
|
1308
|
-
if (convert.hasOwnProperty(model)) {
|
|
1309
|
-
if (!('channels' in convert[model])) {
|
|
1310
|
-
throw new Error('missing channels property: ' + model);
|
|
1311
|
-
}
|
|
1312
|
-
if (!('labels' in convert[model])) {
|
|
1313
|
-
throw new Error('missing channel labels property: ' + model);
|
|
1314
|
-
}
|
|
1315
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
1316
|
-
throw new Error('channel and label counts mismatch: ' + model);
|
|
1317
|
-
}
|
|
1318
|
-
var channels = convert[model].channels;
|
|
1319
|
-
var labels = convert[model].labels;
|
|
1320
|
-
delete convert[model].channels;
|
|
1321
|
-
delete convert[model].labels;
|
|
1322
|
-
Object.defineProperty(convert[model], 'channels', {
|
|
1323
|
-
value: channels
|
|
1324
|
-
});
|
|
1325
|
-
Object.defineProperty(convert[model], 'labels', {
|
|
1326
|
-
value: labels
|
|
1327
|
-
});
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
convert.rgb.hsl = function (rgb) {
|
|
1331
|
-
var r = rgb[0] / 255;
|
|
1332
|
-
var g = rgb[1] / 255;
|
|
1333
|
-
var b = rgb[2] / 255;
|
|
1334
|
-
var min = Math.min(r, g, b);
|
|
1335
|
-
var max = Math.max(r, g, b);
|
|
1336
|
-
var delta = max - min;
|
|
1337
|
-
var h;
|
|
1338
|
-
var s;
|
|
1339
|
-
var l;
|
|
1340
|
-
if (max === min) {
|
|
1341
|
-
h = 0;
|
|
1342
|
-
} else if (r === max) {
|
|
1343
|
-
h = (g - b) / delta;
|
|
1344
|
-
} else if (g === max) {
|
|
1345
|
-
h = 2 + (b - r) / delta;
|
|
1346
|
-
} else if (b === max) {
|
|
1347
|
-
h = 4 + (r - g) / delta;
|
|
1348
|
-
}
|
|
1349
|
-
h = Math.min(h * 60, 360);
|
|
1350
|
-
if (h < 0) {
|
|
1351
|
-
h += 360;
|
|
1352
|
-
}
|
|
1353
|
-
l = (min + max) / 2;
|
|
1354
|
-
if (max === min) {
|
|
1355
|
-
s = 0;
|
|
1356
|
-
} else if (l <= 0.5) {
|
|
1357
|
-
s = delta / (max + min);
|
|
1358
|
-
} else {
|
|
1359
|
-
s = delta / (2 - max - min);
|
|
1360
|
-
}
|
|
1361
|
-
return [h, s * 100, l * 100];
|
|
1362
|
-
};
|
|
1363
|
-
convert.rgb.hsv = function (rgb) {
|
|
1364
|
-
var rdif;
|
|
1365
|
-
var gdif;
|
|
1366
|
-
var bdif;
|
|
1367
|
-
var h;
|
|
1368
|
-
var s;
|
|
1369
|
-
var r = rgb[0] / 255;
|
|
1370
|
-
var g = rgb[1] / 255;
|
|
1371
|
-
var b = rgb[2] / 255;
|
|
1372
|
-
var v = Math.max(r, g, b);
|
|
1373
|
-
var diff = v - Math.min(r, g, b);
|
|
1374
|
-
var diffc = function (c) {
|
|
1375
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
1376
|
-
};
|
|
1377
|
-
if (diff === 0) {
|
|
1378
|
-
h = s = 0;
|
|
1379
|
-
} else {
|
|
1380
|
-
s = diff / v;
|
|
1381
|
-
rdif = diffc(r);
|
|
1382
|
-
gdif = diffc(g);
|
|
1383
|
-
bdif = diffc(b);
|
|
1384
|
-
if (r === v) {
|
|
1385
|
-
h = bdif - gdif;
|
|
1386
|
-
} else if (g === v) {
|
|
1387
|
-
h = 1 / 3 + rdif - bdif;
|
|
1388
|
-
} else if (b === v) {
|
|
1389
|
-
h = 2 / 3 + gdif - rdif;
|
|
1390
|
-
}
|
|
1391
|
-
if (h < 0) {
|
|
1392
|
-
h += 1;
|
|
1393
|
-
} else if (h > 1) {
|
|
1394
|
-
h -= 1;
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
return [h * 360, s * 100, v * 100];
|
|
1398
|
-
};
|
|
1399
|
-
convert.rgb.hwb = function (rgb) {
|
|
1400
|
-
var r = rgb[0];
|
|
1401
|
-
var g = rgb[1];
|
|
1402
|
-
var b = rgb[2];
|
|
1403
|
-
var h = convert.rgb.hsl(rgb)[0];
|
|
1404
|
-
var w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
1405
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
1406
|
-
return [h, w * 100, b * 100];
|
|
1407
|
-
};
|
|
1408
|
-
convert.rgb.cmyk = function (rgb) {
|
|
1409
|
-
var r = rgb[0] / 255;
|
|
1410
|
-
var g = rgb[1] / 255;
|
|
1411
|
-
var b = rgb[2] / 255;
|
|
1412
|
-
var c;
|
|
1413
|
-
var m;
|
|
1414
|
-
var y;
|
|
1415
|
-
var k;
|
|
1416
|
-
k = Math.min(1 - r, 1 - g, 1 - b);
|
|
1417
|
-
c = (1 - r - k) / (1 - k) || 0;
|
|
1418
|
-
m = (1 - g - k) / (1 - k) || 0;
|
|
1419
|
-
y = (1 - b - k) / (1 - k) || 0;
|
|
1420
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
|
1421
|
-
};
|
|
888
|
+
var jsTokens = {};
|
|
1422
889
|
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
}
|
|
1450
|
-
return currentClosestKeyword;
|
|
1451
|
-
};
|
|
1452
|
-
convert.keyword.rgb = function (keyword) {
|
|
1453
|
-
return cssKeywords[keyword];
|
|
1454
|
-
};
|
|
1455
|
-
convert.rgb.xyz = function (rgb) {
|
|
1456
|
-
var r = rgb[0] / 255;
|
|
1457
|
-
var g = rgb[1] / 255;
|
|
1458
|
-
var b = rgb[2] / 255;
|
|
1459
|
-
|
|
1460
|
-
// assume sRGB
|
|
1461
|
-
r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
|
|
1462
|
-
g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
|
|
1463
|
-
b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
|
|
1464
|
-
var x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
1465
|
-
var y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
1466
|
-
var z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
1467
|
-
return [x * 100, y * 100, z * 100];
|
|
1468
|
-
};
|
|
1469
|
-
convert.rgb.lab = function (rgb) {
|
|
1470
|
-
var xyz = convert.rgb.xyz(rgb);
|
|
1471
|
-
var x = xyz[0];
|
|
1472
|
-
var y = xyz[1];
|
|
1473
|
-
var z = xyz[2];
|
|
1474
|
-
var l;
|
|
1475
|
-
var a;
|
|
1476
|
-
var b;
|
|
1477
|
-
x /= 95.047;
|
|
1478
|
-
y /= 100;
|
|
1479
|
-
z /= 108.883;
|
|
1480
|
-
x = x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
1481
|
-
y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
|
|
1482
|
-
z = z > 0.008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
|
|
1483
|
-
l = 116 * y - 16;
|
|
1484
|
-
a = 500 * (x - y);
|
|
1485
|
-
b = 200 * (y - z);
|
|
1486
|
-
return [l, a, b];
|
|
1487
|
-
};
|
|
1488
|
-
convert.hsl.rgb = function (hsl) {
|
|
1489
|
-
var h = hsl[0] / 360;
|
|
1490
|
-
var s = hsl[1] / 100;
|
|
1491
|
-
var l = hsl[2] / 100;
|
|
1492
|
-
var t1;
|
|
1493
|
-
var t2;
|
|
1494
|
-
var t3;
|
|
1495
|
-
var rgb;
|
|
1496
|
-
var val;
|
|
1497
|
-
if (s === 0) {
|
|
1498
|
-
val = l * 255;
|
|
1499
|
-
return [val, val, val];
|
|
1500
|
-
}
|
|
1501
|
-
if (l < 0.5) {
|
|
1502
|
-
t2 = l * (1 + s);
|
|
1503
|
-
} else {
|
|
1504
|
-
t2 = l + s - l * s;
|
|
1505
|
-
}
|
|
1506
|
-
t1 = 2 * l - t2;
|
|
1507
|
-
rgb = [0, 0, 0];
|
|
1508
|
-
for (var i = 0; i < 3; i++) {
|
|
1509
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
1510
|
-
if (t3 < 0) {
|
|
1511
|
-
t3++;
|
|
1512
|
-
}
|
|
1513
|
-
if (t3 > 1) {
|
|
1514
|
-
t3--;
|
|
1515
|
-
}
|
|
1516
|
-
if (6 * t3 < 1) {
|
|
1517
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
1518
|
-
} else if (2 * t3 < 1) {
|
|
1519
|
-
val = t2;
|
|
1520
|
-
} else if (3 * t3 < 2) {
|
|
1521
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
1522
|
-
} else {
|
|
1523
|
-
val = t1;
|
|
1524
|
-
}
|
|
1525
|
-
rgb[i] = val * 255;
|
|
1526
|
-
}
|
|
1527
|
-
return rgb;
|
|
1528
|
-
};
|
|
1529
|
-
convert.hsl.hsv = function (hsl) {
|
|
1530
|
-
var h = hsl[0];
|
|
1531
|
-
var s = hsl[1] / 100;
|
|
1532
|
-
var l = hsl[2] / 100;
|
|
1533
|
-
var smin = s;
|
|
1534
|
-
var lmin = Math.max(l, 0.01);
|
|
1535
|
-
var sv;
|
|
1536
|
-
var v;
|
|
1537
|
-
l *= 2;
|
|
1538
|
-
s *= l <= 1 ? l : 2 - l;
|
|
1539
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
1540
|
-
v = (l + s) / 2;
|
|
1541
|
-
sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
1542
|
-
return [h, sv * 100, v * 100];
|
|
1543
|
-
};
|
|
1544
|
-
convert.hsv.rgb = function (hsv) {
|
|
1545
|
-
var h = hsv[0] / 60;
|
|
1546
|
-
var s = hsv[1] / 100;
|
|
1547
|
-
var v = hsv[2] / 100;
|
|
1548
|
-
var hi = Math.floor(h) % 6;
|
|
1549
|
-
var f = h - Math.floor(h);
|
|
1550
|
-
var p = 255 * v * (1 - s);
|
|
1551
|
-
var q = 255 * v * (1 - s * f);
|
|
1552
|
-
var t = 255 * v * (1 - s * (1 - f));
|
|
1553
|
-
v *= 255;
|
|
1554
|
-
switch (hi) {
|
|
1555
|
-
case 0:
|
|
1556
|
-
return [v, t, p];
|
|
1557
|
-
case 1:
|
|
1558
|
-
return [q, v, p];
|
|
1559
|
-
case 2:
|
|
1560
|
-
return [p, v, t];
|
|
1561
|
-
case 3:
|
|
1562
|
-
return [p, q, v];
|
|
1563
|
-
case 4:
|
|
1564
|
-
return [t, p, v];
|
|
1565
|
-
case 5:
|
|
1566
|
-
return [v, p, q];
|
|
1567
|
-
}
|
|
1568
|
-
};
|
|
1569
|
-
convert.hsv.hsl = function (hsv) {
|
|
1570
|
-
var h = hsv[0];
|
|
1571
|
-
var s = hsv[1] / 100;
|
|
1572
|
-
var v = hsv[2] / 100;
|
|
1573
|
-
var vmin = Math.max(v, 0.01);
|
|
1574
|
-
var lmin;
|
|
1575
|
-
var sl;
|
|
1576
|
-
var l;
|
|
1577
|
-
l = (2 - s) * v;
|
|
1578
|
-
lmin = (2 - s) * vmin;
|
|
1579
|
-
sl = s * vmin;
|
|
1580
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
1581
|
-
sl = sl || 0;
|
|
1582
|
-
l /= 2;
|
|
1583
|
-
return [h, sl * 100, l * 100];
|
|
1584
|
-
};
|
|
890
|
+
var hasRequiredJsTokens;
|
|
891
|
+
|
|
892
|
+
function requireJsTokens () {
|
|
893
|
+
if (hasRequiredJsTokens) return jsTokens;
|
|
894
|
+
hasRequiredJsTokens = 1;
|
|
895
|
+
// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell
|
|
896
|
+
// License: MIT. (See LICENSE.)
|
|
897
|
+
|
|
898
|
+
Object.defineProperty(jsTokens, "__esModule", {
|
|
899
|
+
value: true
|
|
900
|
+
});
|
|
901
|
+
|
|
902
|
+
// This regex comes from regex.coffee, and is inserted here by generate-index.js
|
|
903
|
+
// (run `npm run build`).
|
|
904
|
+
jsTokens.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
|
|
905
|
+
jsTokens.matchToToken = function (match) {
|
|
906
|
+
var token = {
|
|
907
|
+
type: "invalid",
|
|
908
|
+
value: match[0],
|
|
909
|
+
closed: undefined
|
|
910
|
+
};
|
|
911
|
+
if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);else if (match[5]) token.type = "comment";else if (match[6]) token.type = "comment", token.closed = !!match[7];else if (match[8]) token.type = "regex";else if (match[9]) token.type = "number";else if (match[10]) token.type = "name";else if (match[11]) token.type = "punctuator";else if (match[12]) token.type = "whitespace";
|
|
912
|
+
return token;
|
|
913
|
+
};
|
|
914
|
+
return jsTokens;
|
|
915
|
+
}
|
|
1585
916
|
|
|
1586
|
-
|
|
1587
|
-
convert.hwb.rgb = function (hwb) {
|
|
1588
|
-
var h = hwb[0] / 360;
|
|
1589
|
-
var wh = hwb[1] / 100;
|
|
1590
|
-
var bl = hwb[2] / 100;
|
|
1591
|
-
var ratio = wh + bl;
|
|
1592
|
-
var i;
|
|
1593
|
-
var v;
|
|
1594
|
-
var f;
|
|
1595
|
-
var n;
|
|
1596
|
-
|
|
1597
|
-
// wh + bl cant be > 1
|
|
1598
|
-
if (ratio > 1) {
|
|
1599
|
-
wh /= ratio;
|
|
1600
|
-
bl /= ratio;
|
|
1601
|
-
}
|
|
1602
|
-
i = Math.floor(6 * h);
|
|
1603
|
-
v = 1 - bl;
|
|
1604
|
-
f = 6 * h - i;
|
|
1605
|
-
if ((i & 0x01) !== 0) {
|
|
1606
|
-
f = 1 - f;
|
|
1607
|
-
}
|
|
1608
|
-
n = wh + f * (v - wh); // linear interpolation
|
|
917
|
+
var lib = {};
|
|
1609
918
|
|
|
1610
|
-
|
|
1611
|
-
var g;
|
|
1612
|
-
var b;
|
|
1613
|
-
switch (i) {
|
|
1614
|
-
default:
|
|
1615
|
-
case 6:
|
|
1616
|
-
case 0:
|
|
1617
|
-
r = v;
|
|
1618
|
-
g = n;
|
|
1619
|
-
b = wh;
|
|
1620
|
-
break;
|
|
1621
|
-
case 1:
|
|
1622
|
-
r = n;
|
|
1623
|
-
g = v;
|
|
1624
|
-
b = wh;
|
|
1625
|
-
break;
|
|
1626
|
-
case 2:
|
|
1627
|
-
r = wh;
|
|
1628
|
-
g = v;
|
|
1629
|
-
b = n;
|
|
1630
|
-
break;
|
|
1631
|
-
case 3:
|
|
1632
|
-
r = wh;
|
|
1633
|
-
g = n;
|
|
1634
|
-
b = v;
|
|
1635
|
-
break;
|
|
1636
|
-
case 4:
|
|
1637
|
-
r = n;
|
|
1638
|
-
g = wh;
|
|
1639
|
-
b = v;
|
|
1640
|
-
break;
|
|
1641
|
-
case 5:
|
|
1642
|
-
r = v;
|
|
1643
|
-
g = wh;
|
|
1644
|
-
b = n;
|
|
1645
|
-
break;
|
|
1646
|
-
}
|
|
1647
|
-
return [r * 255, g * 255, b * 255];
|
|
1648
|
-
};
|
|
1649
|
-
convert.cmyk.rgb = function (cmyk) {
|
|
1650
|
-
var c = cmyk[0] / 100;
|
|
1651
|
-
var m = cmyk[1] / 100;
|
|
1652
|
-
var y = cmyk[2] / 100;
|
|
1653
|
-
var k = cmyk[3] / 100;
|
|
1654
|
-
var r;
|
|
1655
|
-
var g;
|
|
1656
|
-
var b;
|
|
1657
|
-
r = 1 - Math.min(1, c * (1 - k) + k);
|
|
1658
|
-
g = 1 - Math.min(1, m * (1 - k) + k);
|
|
1659
|
-
b = 1 - Math.min(1, y * (1 - k) + k);
|
|
1660
|
-
return [r * 255, g * 255, b * 255];
|
|
1661
|
-
};
|
|
1662
|
-
convert.xyz.rgb = function (xyz) {
|
|
1663
|
-
var x = xyz[0] / 100;
|
|
1664
|
-
var y = xyz[1] / 100;
|
|
1665
|
-
var z = xyz[2] / 100;
|
|
1666
|
-
var r;
|
|
1667
|
-
var g;
|
|
1668
|
-
var b;
|
|
1669
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
1670
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
1671
|
-
b = x * 0.0557 + y * -0.204 + z * 1.0570;
|
|
1672
|
-
|
|
1673
|
-
// assume sRGB
|
|
1674
|
-
r = r > 0.0031308 ? 1.055 * Math.pow(r, 1.0 / 2.4) - 0.055 : r * 12.92;
|
|
1675
|
-
g = g > 0.0031308 ? 1.055 * Math.pow(g, 1.0 / 2.4) - 0.055 : g * 12.92;
|
|
1676
|
-
b = b > 0.0031308 ? 1.055 * Math.pow(b, 1.0 / 2.4) - 0.055 : b * 12.92;
|
|
1677
|
-
r = Math.min(Math.max(0, r), 1);
|
|
1678
|
-
g = Math.min(Math.max(0, g), 1);
|
|
1679
|
-
b = Math.min(Math.max(0, b), 1);
|
|
1680
|
-
return [r * 255, g * 255, b * 255];
|
|
1681
|
-
};
|
|
1682
|
-
convert.xyz.lab = function (xyz) {
|
|
1683
|
-
var x = xyz[0];
|
|
1684
|
-
var y = xyz[1];
|
|
1685
|
-
var z = xyz[2];
|
|
1686
|
-
var l;
|
|
1687
|
-
var a;
|
|
1688
|
-
var b;
|
|
1689
|
-
x /= 95.047;
|
|
1690
|
-
y /= 100;
|
|
1691
|
-
z /= 108.883;
|
|
1692
|
-
x = x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
1693
|
-
y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
|
|
1694
|
-
z = z > 0.008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
|
|
1695
|
-
l = 116 * y - 16;
|
|
1696
|
-
a = 500 * (x - y);
|
|
1697
|
-
b = 200 * (y - z);
|
|
1698
|
-
return [l, a, b];
|
|
1699
|
-
};
|
|
1700
|
-
convert.lab.xyz = function (lab) {
|
|
1701
|
-
var l = lab[0];
|
|
1702
|
-
var a = lab[1];
|
|
1703
|
-
var b = lab[2];
|
|
1704
|
-
var x;
|
|
1705
|
-
var y;
|
|
1706
|
-
var z;
|
|
1707
|
-
y = (l + 16) / 116;
|
|
1708
|
-
x = a / 500 + y;
|
|
1709
|
-
z = y - b / 200;
|
|
1710
|
-
var y2 = Math.pow(y, 3);
|
|
1711
|
-
var x2 = Math.pow(x, 3);
|
|
1712
|
-
var z2 = Math.pow(z, 3);
|
|
1713
|
-
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
1714
|
-
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
1715
|
-
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
1716
|
-
x *= 95.047;
|
|
1717
|
-
y *= 100;
|
|
1718
|
-
z *= 108.883;
|
|
1719
|
-
return [x, y, z];
|
|
1720
|
-
};
|
|
1721
|
-
convert.lab.lch = function (lab) {
|
|
1722
|
-
var l = lab[0];
|
|
1723
|
-
var a = lab[1];
|
|
1724
|
-
var b = lab[2];
|
|
1725
|
-
var hr;
|
|
1726
|
-
var h;
|
|
1727
|
-
var c;
|
|
1728
|
-
hr = Math.atan2(b, a);
|
|
1729
|
-
h = hr * 360 / 2 / Math.PI;
|
|
1730
|
-
if (h < 0) {
|
|
1731
|
-
h += 360;
|
|
1732
|
-
}
|
|
1733
|
-
c = Math.sqrt(a * a + b * b);
|
|
1734
|
-
return [l, c, h];
|
|
1735
|
-
};
|
|
1736
|
-
convert.lch.lab = function (lch) {
|
|
1737
|
-
var l = lch[0];
|
|
1738
|
-
var c = lch[1];
|
|
1739
|
-
var h = lch[2];
|
|
1740
|
-
var a;
|
|
1741
|
-
var b;
|
|
1742
|
-
var hr;
|
|
1743
|
-
hr = h / 360 * 2 * Math.PI;
|
|
1744
|
-
a = c * Math.cos(hr);
|
|
1745
|
-
b = c * Math.sin(hr);
|
|
1746
|
-
return [l, a, b];
|
|
1747
|
-
};
|
|
1748
|
-
convert.rgb.ansi16 = function (args) {
|
|
1749
|
-
var r = args[0];
|
|
1750
|
-
var g = args[1];
|
|
1751
|
-
var b = args[2];
|
|
1752
|
-
var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
|
|
1753
|
-
|
|
1754
|
-
value = Math.round(value / 50);
|
|
1755
|
-
if (value === 0) {
|
|
1756
|
-
return 30;
|
|
1757
|
-
}
|
|
1758
|
-
var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
1759
|
-
if (value === 2) {
|
|
1760
|
-
ansi += 60;
|
|
1761
|
-
}
|
|
1762
|
-
return ansi;
|
|
1763
|
-
};
|
|
1764
|
-
convert.hsv.ansi16 = function (args) {
|
|
1765
|
-
// optimization here; we already know the value and don't need to get
|
|
1766
|
-
// it converted for us.
|
|
1767
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
1768
|
-
};
|
|
1769
|
-
convert.rgb.ansi256 = function (args) {
|
|
1770
|
-
var r = args[0];
|
|
1771
|
-
var g = args[1];
|
|
1772
|
-
var b = args[2];
|
|
1773
|
-
|
|
1774
|
-
// we use the extended greyscale palette here, with the exception of
|
|
1775
|
-
// black and white. normal palette only has 4 greyscale shades.
|
|
1776
|
-
if (r === g && g === b) {
|
|
1777
|
-
if (r < 8) {
|
|
1778
|
-
return 16;
|
|
1779
|
-
}
|
|
1780
|
-
if (r > 248) {
|
|
1781
|
-
return 231;
|
|
1782
|
-
}
|
|
1783
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
1784
|
-
}
|
|
1785
|
-
var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
1786
|
-
return ansi;
|
|
1787
|
-
};
|
|
1788
|
-
convert.ansi16.rgb = function (args) {
|
|
1789
|
-
var color = args % 10;
|
|
919
|
+
var identifier = {};
|
|
1790
920
|
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
hue %= 1;
|
|
1865
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
1866
|
-
};
|
|
1867
|
-
convert.hsl.hcg = function (hsl) {
|
|
1868
|
-
var s = hsl[1] / 100;
|
|
1869
|
-
var l = hsl[2] / 100;
|
|
1870
|
-
var c = 1;
|
|
1871
|
-
var f = 0;
|
|
1872
|
-
if (l < 0.5) {
|
|
1873
|
-
c = 2.0 * s * l;
|
|
1874
|
-
} else {
|
|
1875
|
-
c = 2.0 * s * (1.0 - l);
|
|
1876
|
-
}
|
|
1877
|
-
if (c < 1.0) {
|
|
1878
|
-
f = (l - 0.5 * c) / (1.0 - c);
|
|
1879
|
-
}
|
|
1880
|
-
return [hsl[0], c * 100, f * 100];
|
|
1881
|
-
};
|
|
1882
|
-
convert.hsv.hcg = function (hsv) {
|
|
1883
|
-
var s = hsv[1] / 100;
|
|
1884
|
-
var v = hsv[2] / 100;
|
|
1885
|
-
var c = s * v;
|
|
1886
|
-
var f = 0;
|
|
1887
|
-
if (c < 1.0) {
|
|
1888
|
-
f = (v - c) / (1 - c);
|
|
1889
|
-
}
|
|
1890
|
-
return [hsv[0], c * 100, f * 100];
|
|
1891
|
-
};
|
|
1892
|
-
convert.hcg.rgb = function (hcg) {
|
|
1893
|
-
var h = hcg[0] / 360;
|
|
1894
|
-
var c = hcg[1] / 100;
|
|
1895
|
-
var g = hcg[2] / 100;
|
|
1896
|
-
if (c === 0.0) {
|
|
1897
|
-
return [g * 255, g * 255, g * 255];
|
|
1898
|
-
}
|
|
1899
|
-
var pure = [0, 0, 0];
|
|
1900
|
-
var hi = h % 1 * 6;
|
|
1901
|
-
var v = hi % 1;
|
|
1902
|
-
var w = 1 - v;
|
|
1903
|
-
var mg = 0;
|
|
1904
|
-
switch (Math.floor(hi)) {
|
|
1905
|
-
case 0:
|
|
1906
|
-
pure[0] = 1;
|
|
1907
|
-
pure[1] = v;
|
|
1908
|
-
pure[2] = 0;
|
|
1909
|
-
break;
|
|
1910
|
-
case 1:
|
|
1911
|
-
pure[0] = w;
|
|
1912
|
-
pure[1] = 1;
|
|
1913
|
-
pure[2] = 0;
|
|
1914
|
-
break;
|
|
1915
|
-
case 2:
|
|
1916
|
-
pure[0] = 0;
|
|
1917
|
-
pure[1] = 1;
|
|
1918
|
-
pure[2] = v;
|
|
1919
|
-
break;
|
|
1920
|
-
case 3:
|
|
1921
|
-
pure[0] = 0;
|
|
1922
|
-
pure[1] = w;
|
|
1923
|
-
pure[2] = 1;
|
|
1924
|
-
break;
|
|
1925
|
-
case 4:
|
|
1926
|
-
pure[0] = v;
|
|
1927
|
-
pure[1] = 0;
|
|
1928
|
-
pure[2] = 1;
|
|
1929
|
-
break;
|
|
1930
|
-
default:
|
|
1931
|
-
pure[0] = 1;
|
|
1932
|
-
pure[1] = 0;
|
|
1933
|
-
pure[2] = w;
|
|
1934
|
-
}
|
|
1935
|
-
mg = (1.0 - c) * g;
|
|
1936
|
-
return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
|
|
1937
|
-
};
|
|
1938
|
-
convert.hcg.hsv = function (hcg) {
|
|
1939
|
-
var c = hcg[1] / 100;
|
|
1940
|
-
var g = hcg[2] / 100;
|
|
1941
|
-
var v = c + g * (1.0 - c);
|
|
1942
|
-
var f = 0;
|
|
1943
|
-
if (v > 0.0) {
|
|
1944
|
-
f = c / v;
|
|
1945
|
-
}
|
|
1946
|
-
return [hcg[0], f * 100, v * 100];
|
|
1947
|
-
};
|
|
1948
|
-
convert.hcg.hsl = function (hcg) {
|
|
1949
|
-
var c = hcg[1] / 100;
|
|
1950
|
-
var g = hcg[2] / 100;
|
|
1951
|
-
var l = g * (1.0 - c) + 0.5 * c;
|
|
1952
|
-
var s = 0;
|
|
1953
|
-
if (l > 0.0 && l < 0.5) {
|
|
1954
|
-
s = c / (2 * l);
|
|
1955
|
-
} else if (l >= 0.5 && l < 1.0) {
|
|
1956
|
-
s = c / (2 * (1 - l));
|
|
1957
|
-
}
|
|
1958
|
-
return [hcg[0], s * 100, l * 100];
|
|
1959
|
-
};
|
|
1960
|
-
convert.hcg.hwb = function (hcg) {
|
|
1961
|
-
var c = hcg[1] / 100;
|
|
1962
|
-
var g = hcg[2] / 100;
|
|
1963
|
-
var v = c + g * (1.0 - c);
|
|
1964
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
1965
|
-
};
|
|
1966
|
-
convert.hwb.hcg = function (hwb) {
|
|
1967
|
-
var w = hwb[1] / 100;
|
|
1968
|
-
var b = hwb[2] / 100;
|
|
1969
|
-
var v = 1 - b;
|
|
1970
|
-
var c = v - w;
|
|
1971
|
-
var g = 0;
|
|
1972
|
-
if (c < 1) {
|
|
1973
|
-
g = (v - c) / (1 - c);
|
|
1974
|
-
}
|
|
1975
|
-
return [hwb[0], c * 100, g * 100];
|
|
1976
|
-
};
|
|
1977
|
-
convert.apple.rgb = function (apple) {
|
|
1978
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
1979
|
-
};
|
|
1980
|
-
convert.rgb.apple = function (rgb) {
|
|
1981
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
1982
|
-
};
|
|
1983
|
-
convert.gray.rgb = function (args) {
|
|
1984
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
1985
|
-
};
|
|
1986
|
-
convert.gray.hsl = convert.gray.hsv = function (args) {
|
|
1987
|
-
return [0, 0, args[0]];
|
|
1988
|
-
};
|
|
1989
|
-
convert.gray.hwb = function (gray) {
|
|
1990
|
-
return [0, 100, gray[0]];
|
|
1991
|
-
};
|
|
1992
|
-
convert.gray.cmyk = function (gray) {
|
|
1993
|
-
return [0, 0, 0, gray[0]];
|
|
1994
|
-
};
|
|
1995
|
-
convert.gray.lab = function (gray) {
|
|
1996
|
-
return [gray[0], 0, 0];
|
|
1997
|
-
};
|
|
1998
|
-
convert.gray.hex = function (gray) {
|
|
1999
|
-
var val = Math.round(gray[0] / 100 * 255) & 0xFF;
|
|
2000
|
-
var integer = (val << 16) + (val << 8) + val;
|
|
2001
|
-
var string = integer.toString(16).toUpperCase();
|
|
2002
|
-
return '000000'.substring(string.length) + string;
|
|
2003
|
-
};
|
|
2004
|
-
convert.rgb.gray = function (rgb) {
|
|
2005
|
-
var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
2006
|
-
return [val / 255 * 100];
|
|
2007
|
-
};
|
|
2008
|
-
return conversions.exports;
|
|
2009
|
-
}
|
|
2010
|
-
var route;
|
|
2011
|
-
var hasRequiredRoute;
|
|
2012
|
-
function requireRoute() {
|
|
2013
|
-
if (hasRequiredRoute) return route;
|
|
2014
|
-
hasRequiredRoute = 1;
|
|
2015
|
-
var conversions = requireConversions();
|
|
2016
|
-
|
|
2017
|
-
/*
|
|
2018
|
-
this function routes a model to all other models.
|
|
2019
|
-
all functions that are routed have a property `.conversion` attached
|
|
2020
|
-
to the returned synthetic function. This property is an array
|
|
2021
|
-
of strings, each with the steps in between the 'from' and 'to'
|
|
2022
|
-
color models (inclusive).
|
|
2023
|
-
conversions that are not possible simply are not included.
|
|
2024
|
-
*/
|
|
2025
|
-
|
|
2026
|
-
function buildGraph() {
|
|
2027
|
-
var graph = {};
|
|
2028
|
-
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
|
2029
|
-
var models = Object.keys(conversions);
|
|
2030
|
-
for (var len = models.length, i = 0; i < len; i++) {
|
|
2031
|
-
graph[models[i]] = {
|
|
2032
|
-
// http://jsperf.com/1-vs-infinity
|
|
2033
|
-
// micro-opt, but this is simple.
|
|
2034
|
-
distance: -1,
|
|
2035
|
-
parent: null
|
|
2036
|
-
};
|
|
2037
|
-
}
|
|
2038
|
-
return graph;
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
// https://en.wikipedia.org/wiki/Breadth-first_search
|
|
2042
|
-
function deriveBFS(fromModel) {
|
|
2043
|
-
var graph = buildGraph();
|
|
2044
|
-
var queue = [fromModel]; // unshift -> queue -> pop
|
|
2045
|
-
|
|
2046
|
-
graph[fromModel].distance = 0;
|
|
2047
|
-
while (queue.length) {
|
|
2048
|
-
var current = queue.pop();
|
|
2049
|
-
var adjacents = Object.keys(conversions[current]);
|
|
2050
|
-
for (var len = adjacents.length, i = 0; i < len; i++) {
|
|
2051
|
-
var adjacent = adjacents[i];
|
|
2052
|
-
var node = graph[adjacent];
|
|
2053
|
-
if (node.distance === -1) {
|
|
2054
|
-
node.distance = graph[current].distance + 1;
|
|
2055
|
-
node.parent = current;
|
|
2056
|
-
queue.unshift(adjacent);
|
|
2057
|
-
}
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
return graph;
|
|
2061
|
-
}
|
|
2062
|
-
function link(from, to) {
|
|
2063
|
-
return function (args) {
|
|
2064
|
-
return to(from(args));
|
|
2065
|
-
};
|
|
2066
|
-
}
|
|
2067
|
-
function wrapConversion(toModel, graph) {
|
|
2068
|
-
var path = [graph[toModel].parent, toModel];
|
|
2069
|
-
var fn = conversions[graph[toModel].parent][toModel];
|
|
2070
|
-
var cur = graph[toModel].parent;
|
|
2071
|
-
while (graph[cur].parent) {
|
|
2072
|
-
path.unshift(graph[cur].parent);
|
|
2073
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
2074
|
-
cur = graph[cur].parent;
|
|
2075
|
-
}
|
|
2076
|
-
fn.conversion = path;
|
|
2077
|
-
return fn;
|
|
2078
|
-
}
|
|
2079
|
-
route = function (fromModel) {
|
|
2080
|
-
var graph = deriveBFS(fromModel);
|
|
2081
|
-
var conversion = {};
|
|
2082
|
-
var models = Object.keys(graph);
|
|
2083
|
-
for (var len = models.length, i = 0; i < len; i++) {
|
|
2084
|
-
var toModel = models[i];
|
|
2085
|
-
var node = graph[toModel];
|
|
2086
|
-
if (node.parent === null) {
|
|
2087
|
-
// no possible conversion, or this node is the source model.
|
|
2088
|
-
continue;
|
|
2089
|
-
}
|
|
2090
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
2091
|
-
}
|
|
2092
|
-
return conversion;
|
|
2093
|
-
};
|
|
2094
|
-
return route;
|
|
921
|
+
var hasRequiredIdentifier;
|
|
922
|
+
|
|
923
|
+
function requireIdentifier () {
|
|
924
|
+
if (hasRequiredIdentifier) return identifier;
|
|
925
|
+
hasRequiredIdentifier = 1;
|
|
926
|
+
|
|
927
|
+
Object.defineProperty(identifier, "__esModule", {
|
|
928
|
+
value: true
|
|
929
|
+
});
|
|
930
|
+
identifier.isIdentifierChar = isIdentifierChar;
|
|
931
|
+
identifier.isIdentifierName = isIdentifierName;
|
|
932
|
+
identifier.isIdentifierStart = isIdentifierStart;
|
|
933
|
+
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
|
934
|
+
let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65";
|
|
935
|
+
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
936
|
+
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
937
|
+
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
938
|
+
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
|
|
939
|
+
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
940
|
+
function isInAstralSet(code, set) {
|
|
941
|
+
let pos = 0x10000;
|
|
942
|
+
for (let i = 0, length = set.length; i < length; i += 2) {
|
|
943
|
+
pos += set[i];
|
|
944
|
+
if (pos > code) return false;
|
|
945
|
+
pos += set[i + 1];
|
|
946
|
+
if (pos >= code) return true;
|
|
947
|
+
}
|
|
948
|
+
return false;
|
|
949
|
+
}
|
|
950
|
+
function isIdentifierStart(code) {
|
|
951
|
+
if (code < 65) return code === 36;
|
|
952
|
+
if (code <= 90) return true;
|
|
953
|
+
if (code < 97) return code === 95;
|
|
954
|
+
if (code <= 122) return true;
|
|
955
|
+
if (code <= 0xffff) {
|
|
956
|
+
return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
|
|
957
|
+
}
|
|
958
|
+
return isInAstralSet(code, astralIdentifierStartCodes);
|
|
959
|
+
}
|
|
960
|
+
function isIdentifierChar(code) {
|
|
961
|
+
if (code < 48) return code === 36;
|
|
962
|
+
if (code < 58) return true;
|
|
963
|
+
if (code < 65) return false;
|
|
964
|
+
if (code <= 90) return true;
|
|
965
|
+
if (code < 97) return code === 95;
|
|
966
|
+
if (code <= 122) return true;
|
|
967
|
+
if (code <= 0xffff) {
|
|
968
|
+
return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
|
|
969
|
+
}
|
|
970
|
+
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
|
|
971
|
+
}
|
|
972
|
+
function isIdentifierName(name) {
|
|
973
|
+
let isFirst = true;
|
|
974
|
+
for (let i = 0; i < name.length; i++) {
|
|
975
|
+
let cp = name.charCodeAt(i);
|
|
976
|
+
if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
|
|
977
|
+
const trail = name.charCodeAt(++i);
|
|
978
|
+
if ((trail & 0xfc00) === 0xdc00) {
|
|
979
|
+
cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
if (isFirst) {
|
|
983
|
+
isFirst = false;
|
|
984
|
+
if (!isIdentifierStart(cp)) {
|
|
985
|
+
return false;
|
|
986
|
+
}
|
|
987
|
+
} else if (!isIdentifierChar(cp)) {
|
|
988
|
+
return false;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
return !isFirst;
|
|
992
|
+
}
|
|
993
|
+
return identifier;
|
|
2095
994
|
}
|
|
2096
|
-
var colorConvert;
|
|
2097
|
-
var hasRequiredColorConvert;
|
|
2098
|
-
function requireColorConvert() {
|
|
2099
|
-
if (hasRequiredColorConvert) return colorConvert;
|
|
2100
|
-
hasRequiredColorConvert = 1;
|
|
2101
|
-
var conversions = requireConversions();
|
|
2102
|
-
var route = requireRoute();
|
|
2103
|
-
var convert = {};
|
|
2104
|
-
var models = Object.keys(conversions);
|
|
2105
|
-
function wrapRaw(fn) {
|
|
2106
|
-
var wrappedFn = function (args) {
|
|
2107
|
-
if (args === undefined || args === null) {
|
|
2108
|
-
return args;
|
|
2109
|
-
}
|
|
2110
|
-
if (arguments.length > 1) {
|
|
2111
|
-
args = Array.prototype.slice.call(arguments);
|
|
2112
|
-
}
|
|
2113
|
-
return fn(args);
|
|
2114
|
-
};
|
|
2115
995
|
|
|
2116
|
-
|
|
2117
|
-
if ('conversion' in fn) {
|
|
2118
|
-
wrappedFn.conversion = fn.conversion;
|
|
2119
|
-
}
|
|
2120
|
-
return wrappedFn;
|
|
2121
|
-
}
|
|
2122
|
-
function wrapRounded(fn) {
|
|
2123
|
-
var wrappedFn = function (args) {
|
|
2124
|
-
if (args === undefined || args === null) {
|
|
2125
|
-
return args;
|
|
2126
|
-
}
|
|
2127
|
-
if (arguments.length > 1) {
|
|
2128
|
-
args = Array.prototype.slice.call(arguments);
|
|
2129
|
-
}
|
|
2130
|
-
var result = fn(args);
|
|
2131
|
-
|
|
2132
|
-
// we're assuming the result is an array here.
|
|
2133
|
-
// see notice in conversions.js; don't use box types
|
|
2134
|
-
// in conversion functions.
|
|
2135
|
-
if (typeof result === 'object') {
|
|
2136
|
-
for (var len = result.length, i = 0; i < len; i++) {
|
|
2137
|
-
result[i] = Math.round(result[i]);
|
|
2138
|
-
}
|
|
2139
|
-
}
|
|
2140
|
-
return result;
|
|
2141
|
-
};
|
|
996
|
+
var keyword = {};
|
|
2142
997
|
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
998
|
+
var hasRequiredKeyword;
|
|
999
|
+
|
|
1000
|
+
function requireKeyword () {
|
|
1001
|
+
if (hasRequiredKeyword) return keyword;
|
|
1002
|
+
hasRequiredKeyword = 1;
|
|
1003
|
+
|
|
1004
|
+
Object.defineProperty(keyword, "__esModule", {
|
|
1005
|
+
value: true
|
|
1006
|
+
});
|
|
1007
|
+
keyword.isKeyword = isKeyword;
|
|
1008
|
+
keyword.isReservedWord = isReservedWord;
|
|
1009
|
+
keyword.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
|
|
1010
|
+
keyword.isStrictBindReservedWord = isStrictBindReservedWord;
|
|
1011
|
+
keyword.isStrictReservedWord = isStrictReservedWord;
|
|
1012
|
+
const reservedWords = {
|
|
1013
|
+
keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
|
|
1014
|
+
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
|
|
1015
|
+
strictBind: ["eval", "arguments"]
|
|
1016
|
+
};
|
|
1017
|
+
const keywords = new Set(reservedWords.keyword);
|
|
1018
|
+
const reservedWordsStrictSet = new Set(reservedWords.strict);
|
|
1019
|
+
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
|
1020
|
+
function isReservedWord(word, inModule) {
|
|
1021
|
+
return inModule && word === "await" || word === "enum";
|
|
1022
|
+
}
|
|
1023
|
+
function isStrictReservedWord(word, inModule) {
|
|
1024
|
+
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
|
|
1025
|
+
}
|
|
1026
|
+
function isStrictBindOnlyReservedWord(word) {
|
|
1027
|
+
return reservedWordsStrictBindSet.has(word);
|
|
1028
|
+
}
|
|
1029
|
+
function isStrictBindReservedWord(word, inModule) {
|
|
1030
|
+
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
|
|
1031
|
+
}
|
|
1032
|
+
function isKeyword(word) {
|
|
1033
|
+
return keywords.has(word);
|
|
1034
|
+
}
|
|
1035
|
+
return keyword;
|
|
2167
1036
|
}
|
|
2168
|
-
var hasRequiredAnsiStyles;
|
|
2169
|
-
function requireAnsiStyles() {
|
|
2170
|
-
if (hasRequiredAnsiStyles) return ansiStyles.exports;
|
|
2171
|
-
hasRequiredAnsiStyles = 1;
|
|
2172
|
-
(function (module) {
|
|
2173
|
-
const colorConvert = requireColorConvert();
|
|
2174
|
-
const wrapAnsi16 = (fn, offset) => function () {
|
|
2175
|
-
const code = fn.apply(colorConvert, arguments);
|
|
2176
|
-
return `\u001B[${code + offset}m`;
|
|
2177
|
-
};
|
|
2178
|
-
const wrapAnsi256 = (fn, offset) => function () {
|
|
2179
|
-
const code = fn.apply(colorConvert, arguments);
|
|
2180
|
-
return `\u001B[${38 + offset};5;${code}m`;
|
|
2181
|
-
};
|
|
2182
|
-
const wrapAnsi16m = (fn, offset) => function () {
|
|
2183
|
-
const rgb = fn.apply(colorConvert, arguments);
|
|
2184
|
-
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
2185
|
-
};
|
|
2186
|
-
function assembleStyles() {
|
|
2187
|
-
const codes = new Map();
|
|
2188
|
-
const styles = {
|
|
2189
|
-
modifier: {
|
|
2190
|
-
reset: [0, 0],
|
|
2191
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
2192
|
-
bold: [1, 22],
|
|
2193
|
-
dim: [2, 22],
|
|
2194
|
-
italic: [3, 23],
|
|
2195
|
-
underline: [4, 24],
|
|
2196
|
-
inverse: [7, 27],
|
|
2197
|
-
hidden: [8, 28],
|
|
2198
|
-
strikethrough: [9, 29]
|
|
2199
|
-
},
|
|
2200
|
-
color: {
|
|
2201
|
-
black: [30, 39],
|
|
2202
|
-
red: [31, 39],
|
|
2203
|
-
green: [32, 39],
|
|
2204
|
-
yellow: [33, 39],
|
|
2205
|
-
blue: [34, 39],
|
|
2206
|
-
magenta: [35, 39],
|
|
2207
|
-
cyan: [36, 39],
|
|
2208
|
-
white: [37, 39],
|
|
2209
|
-
gray: [90, 39],
|
|
2210
|
-
// Bright color
|
|
2211
|
-
redBright: [91, 39],
|
|
2212
|
-
greenBright: [92, 39],
|
|
2213
|
-
yellowBright: [93, 39],
|
|
2214
|
-
blueBright: [94, 39],
|
|
2215
|
-
magentaBright: [95, 39],
|
|
2216
|
-
cyanBright: [96, 39],
|
|
2217
|
-
whiteBright: [97, 39]
|
|
2218
|
-
},
|
|
2219
|
-
bgColor: {
|
|
2220
|
-
bgBlack: [40, 49],
|
|
2221
|
-
bgRed: [41, 49],
|
|
2222
|
-
bgGreen: [42, 49],
|
|
2223
|
-
bgYellow: [43, 49],
|
|
2224
|
-
bgBlue: [44, 49],
|
|
2225
|
-
bgMagenta: [45, 49],
|
|
2226
|
-
bgCyan: [46, 49],
|
|
2227
|
-
bgWhite: [47, 49],
|
|
2228
|
-
// Bright color
|
|
2229
|
-
bgBlackBright: [100, 49],
|
|
2230
|
-
bgRedBright: [101, 49],
|
|
2231
|
-
bgGreenBright: [102, 49],
|
|
2232
|
-
bgYellowBright: [103, 49],
|
|
2233
|
-
bgBlueBright: [104, 49],
|
|
2234
|
-
bgMagentaBright: [105, 49],
|
|
2235
|
-
bgCyanBright: [106, 49],
|
|
2236
|
-
bgWhiteBright: [107, 49]
|
|
2237
|
-
}
|
|
2238
|
-
};
|
|
2239
1037
|
|
|
2240
|
-
|
|
2241
|
-
styles.color.grey = styles.color.gray;
|
|
2242
|
-
for (const groupName of Object.keys(styles)) {
|
|
2243
|
-
const group = styles[groupName];
|
|
2244
|
-
for (const styleName of Object.keys(group)) {
|
|
2245
|
-
const style = group[styleName];
|
|
2246
|
-
styles[styleName] = {
|
|
2247
|
-
open: `\u001B[${style[0]}m`,
|
|
2248
|
-
close: `\u001B[${style[1]}m`
|
|
2249
|
-
};
|
|
2250
|
-
group[styleName] = styles[styleName];
|
|
2251
|
-
codes.set(style[0], style[1]);
|
|
2252
|
-
}
|
|
2253
|
-
Object.defineProperty(styles, groupName, {
|
|
2254
|
-
value: group,
|
|
2255
|
-
enumerable: false
|
|
2256
|
-
});
|
|
2257
|
-
Object.defineProperty(styles, 'codes', {
|
|
2258
|
-
value: codes,
|
|
2259
|
-
enumerable: false
|
|
2260
|
-
});
|
|
2261
|
-
}
|
|
2262
|
-
const ansi2ansi = n => n;
|
|
2263
|
-
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
2264
|
-
styles.color.close = '\u001B[39m';
|
|
2265
|
-
styles.bgColor.close = '\u001B[49m';
|
|
2266
|
-
styles.color.ansi = {
|
|
2267
|
-
ansi: wrapAnsi16(ansi2ansi, 0)
|
|
2268
|
-
};
|
|
2269
|
-
styles.color.ansi256 = {
|
|
2270
|
-
ansi256: wrapAnsi256(ansi2ansi, 0)
|
|
2271
|
-
};
|
|
2272
|
-
styles.color.ansi16m = {
|
|
2273
|
-
rgb: wrapAnsi16m(rgb2rgb, 0)
|
|
2274
|
-
};
|
|
2275
|
-
styles.bgColor.ansi = {
|
|
2276
|
-
ansi: wrapAnsi16(ansi2ansi, 10)
|
|
2277
|
-
};
|
|
2278
|
-
styles.bgColor.ansi256 = {
|
|
2279
|
-
ansi256: wrapAnsi256(ansi2ansi, 10)
|
|
2280
|
-
};
|
|
2281
|
-
styles.bgColor.ansi16m = {
|
|
2282
|
-
rgb: wrapAnsi16m(rgb2rgb, 10)
|
|
2283
|
-
};
|
|
2284
|
-
for (let key of Object.keys(colorConvert)) {
|
|
2285
|
-
if (typeof colorConvert[key] !== 'object') {
|
|
2286
|
-
continue;
|
|
2287
|
-
}
|
|
2288
|
-
const suite = colorConvert[key];
|
|
2289
|
-
if (key === 'ansi16') {
|
|
2290
|
-
key = 'ansi';
|
|
2291
|
-
}
|
|
2292
|
-
if ('ansi16' in suite) {
|
|
2293
|
-
styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
|
|
2294
|
-
styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
|
|
2295
|
-
}
|
|
2296
|
-
if ('ansi256' in suite) {
|
|
2297
|
-
styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
|
|
2298
|
-
styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
|
|
2299
|
-
}
|
|
2300
|
-
if ('rgb' in suite) {
|
|
2301
|
-
styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
|
|
2302
|
-
styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
return styles;
|
|
2306
|
-
}
|
|
1038
|
+
var hasRequiredLib$1;
|
|
2307
1039
|
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
});
|
|
2313
|
-
})(ansiStyles);
|
|
2314
|
-
return ansiStyles.exports;
|
|
2315
|
-
}
|
|
2316
|
-
var hasFlag$1;
|
|
2317
|
-
var hasRequiredHasFlag$1;
|
|
2318
|
-
function requireHasFlag$1() {
|
|
2319
|
-
if (hasRequiredHasFlag$1) return hasFlag$1;
|
|
2320
|
-
hasRequiredHasFlag$1 = 1;
|
|
2321
|
-
hasFlag$1 = (flag, argv) => {
|
|
2322
|
-
argv = argv || process.argv;
|
|
2323
|
-
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
|
2324
|
-
const pos = argv.indexOf(prefix + flag);
|
|
2325
|
-
const terminatorPos = argv.indexOf('--');
|
|
2326
|
-
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
2327
|
-
};
|
|
2328
|
-
return hasFlag$1;
|
|
2329
|
-
}
|
|
2330
|
-
var supportsColor_1$1;
|
|
2331
|
-
var hasRequiredSupportsColor$1;
|
|
2332
|
-
function requireSupportsColor$1() {
|
|
2333
|
-
if (hasRequiredSupportsColor$1) return supportsColor_1$1;
|
|
2334
|
-
hasRequiredSupportsColor$1 = 1;
|
|
2335
|
-
const os = require$$0$1;
|
|
2336
|
-
const hasFlag = requireHasFlag$1();
|
|
2337
|
-
const env = process.env;
|
|
2338
|
-
let forceColor;
|
|
2339
|
-
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
|
|
2340
|
-
forceColor = false;
|
|
2341
|
-
} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) {
|
|
2342
|
-
forceColor = true;
|
|
2343
|
-
}
|
|
2344
|
-
if ('FORCE_COLOR' in env) {
|
|
2345
|
-
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
|
|
2346
|
-
}
|
|
2347
|
-
function translateLevel(level) {
|
|
2348
|
-
if (level === 0) {
|
|
2349
|
-
return false;
|
|
2350
|
-
}
|
|
2351
|
-
return {
|
|
2352
|
-
level,
|
|
2353
|
-
hasBasic: true,
|
|
2354
|
-
has256: level >= 2,
|
|
2355
|
-
has16m: level >= 3
|
|
2356
|
-
};
|
|
2357
|
-
}
|
|
2358
|
-
function supportsColor(stream) {
|
|
2359
|
-
if (forceColor === false) {
|
|
2360
|
-
return 0;
|
|
2361
|
-
}
|
|
2362
|
-
if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) {
|
|
2363
|
-
return 3;
|
|
2364
|
-
}
|
|
2365
|
-
if (hasFlag('color=256')) {
|
|
2366
|
-
return 2;
|
|
2367
|
-
}
|
|
2368
|
-
if (stream && !stream.isTTY && forceColor !== true) {
|
|
2369
|
-
return 0;
|
|
2370
|
-
}
|
|
2371
|
-
const min = forceColor ? 1 : 0;
|
|
2372
|
-
if (process.platform === 'win32') {
|
|
2373
|
-
// Node.js 7.5.0 is the first version of Node.js to include a patch to
|
|
2374
|
-
// libuv that enables 256 color output on Windows. Anything earlier and it
|
|
2375
|
-
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
|
|
2376
|
-
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
|
|
2377
|
-
// release that supports 256 colors. Windows 10 build 14931 is the first release
|
|
2378
|
-
// that supports 16m/TrueColor.
|
|
2379
|
-
const osRelease = os.release().split('.');
|
|
2380
|
-
if (Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
2381
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
2382
|
-
}
|
|
2383
|
-
return 1;
|
|
2384
|
-
}
|
|
2385
|
-
if ('CI' in env) {
|
|
2386
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
2387
|
-
return 1;
|
|
2388
|
-
}
|
|
2389
|
-
return min;
|
|
2390
|
-
}
|
|
2391
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
2392
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
2393
|
-
}
|
|
2394
|
-
if (env.COLORTERM === 'truecolor') {
|
|
2395
|
-
return 3;
|
|
2396
|
-
}
|
|
2397
|
-
if ('TERM_PROGRAM' in env) {
|
|
2398
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
2399
|
-
switch (env.TERM_PROGRAM) {
|
|
2400
|
-
case 'iTerm.app':
|
|
2401
|
-
return version >= 3 ? 3 : 2;
|
|
2402
|
-
case 'Apple_Terminal':
|
|
2403
|
-
return 2;
|
|
2404
|
-
// No default
|
|
2405
|
-
}
|
|
2406
|
-
}
|
|
2407
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
2408
|
-
return 2;
|
|
2409
|
-
}
|
|
2410
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
2411
|
-
return 1;
|
|
2412
|
-
}
|
|
2413
|
-
if ('COLORTERM' in env) {
|
|
2414
|
-
return 1;
|
|
2415
|
-
}
|
|
2416
|
-
if (env.TERM === 'dumb') {
|
|
2417
|
-
return min;
|
|
2418
|
-
}
|
|
2419
|
-
return min;
|
|
2420
|
-
}
|
|
2421
|
-
function getSupportLevel(stream) {
|
|
2422
|
-
const level = supportsColor(stream);
|
|
2423
|
-
return translateLevel(level);
|
|
2424
|
-
}
|
|
2425
|
-
supportsColor_1$1 = {
|
|
2426
|
-
supportsColor: getSupportLevel,
|
|
2427
|
-
stdout: getSupportLevel(process.stdout),
|
|
2428
|
-
stderr: getSupportLevel(process.stderr)
|
|
2429
|
-
};
|
|
2430
|
-
return supportsColor_1$1;
|
|
2431
|
-
}
|
|
2432
|
-
var templates;
|
|
2433
|
-
var hasRequiredTemplates;
|
|
2434
|
-
function requireTemplates() {
|
|
2435
|
-
if (hasRequiredTemplates) return templates;
|
|
2436
|
-
hasRequiredTemplates = 1;
|
|
2437
|
-
const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
2438
|
-
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
2439
|
-
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
2440
|
-
const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
2441
|
-
const ESCAPES = new Map([['n', '\n'], ['r', '\r'], ['t', '\t'], ['b', '\b'], ['f', '\f'], ['v', '\v'], ['0', '\0'], ['\\', '\\'], ['e', '\u001B'], ['a', '\u0007']]);
|
|
2442
|
-
function unescape(c) {
|
|
2443
|
-
if (c[0] === 'u' && c.length === 5 || c[0] === 'x' && c.length === 3) {
|
|
2444
|
-
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
2445
|
-
}
|
|
2446
|
-
return ESCAPES.get(c) || c;
|
|
2447
|
-
}
|
|
2448
|
-
function parseArguments(name, args) {
|
|
2449
|
-
const results = [];
|
|
2450
|
-
const chunks = args.trim().split(/\s*,\s*/g);
|
|
2451
|
-
let matches;
|
|
2452
|
-
for (const chunk of chunks) {
|
|
2453
|
-
if (!isNaN(chunk)) {
|
|
2454
|
-
results.push(Number(chunk));
|
|
2455
|
-
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
2456
|
-
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
|
|
2457
|
-
} else {
|
|
2458
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
2459
|
-
}
|
|
2460
|
-
}
|
|
2461
|
-
return results;
|
|
2462
|
-
}
|
|
2463
|
-
function parseStyle(style) {
|
|
2464
|
-
STYLE_REGEX.lastIndex = 0;
|
|
2465
|
-
const results = [];
|
|
2466
|
-
let matches;
|
|
2467
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
2468
|
-
const name = matches[1];
|
|
2469
|
-
if (matches[2]) {
|
|
2470
|
-
const args = parseArguments(name, matches[2]);
|
|
2471
|
-
results.push([name].concat(args));
|
|
2472
|
-
} else {
|
|
2473
|
-
results.push([name]);
|
|
2474
|
-
}
|
|
2475
|
-
}
|
|
2476
|
-
return results;
|
|
2477
|
-
}
|
|
2478
|
-
function buildStyle(chalk, styles) {
|
|
2479
|
-
const enabled = {};
|
|
2480
|
-
for (const layer of styles) {
|
|
2481
|
-
for (const style of layer.styles) {
|
|
2482
|
-
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
|
-
let current = chalk;
|
|
2486
|
-
for (const styleName of Object.keys(enabled)) {
|
|
2487
|
-
if (Array.isArray(enabled[styleName])) {
|
|
2488
|
-
if (!(styleName in current)) {
|
|
2489
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
2490
|
-
}
|
|
2491
|
-
if (enabled[styleName].length > 0) {
|
|
2492
|
-
current = current[styleName].apply(current, enabled[styleName]);
|
|
2493
|
-
} else {
|
|
2494
|
-
current = current[styleName];
|
|
2495
|
-
}
|
|
2496
|
-
}
|
|
2497
|
-
}
|
|
2498
|
-
return current;
|
|
2499
|
-
}
|
|
2500
|
-
templates = (chalk, tmp) => {
|
|
2501
|
-
const styles = [];
|
|
2502
|
-
const chunks = [];
|
|
2503
|
-
let chunk = [];
|
|
2504
|
-
|
|
2505
|
-
// eslint-disable-next-line max-params
|
|
2506
|
-
tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
|
|
2507
|
-
if (escapeChar) {
|
|
2508
|
-
chunk.push(unescape(escapeChar));
|
|
2509
|
-
} else if (style) {
|
|
2510
|
-
const str = chunk.join('');
|
|
2511
|
-
chunk = [];
|
|
2512
|
-
chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
|
|
2513
|
-
styles.push({
|
|
2514
|
-
inverse,
|
|
2515
|
-
styles: parseStyle(style)
|
|
2516
|
-
});
|
|
2517
|
-
} else if (close) {
|
|
2518
|
-
if (styles.length === 0) {
|
|
2519
|
-
throw new Error('Found extraneous } in Chalk template literal');
|
|
2520
|
-
}
|
|
2521
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join('')));
|
|
2522
|
-
chunk = [];
|
|
2523
|
-
styles.pop();
|
|
2524
|
-
} else {
|
|
2525
|
-
chunk.push(chr);
|
|
2526
|
-
}
|
|
2527
|
-
});
|
|
2528
|
-
chunks.push(chunk.join(''));
|
|
2529
|
-
if (styles.length > 0) {
|
|
2530
|
-
const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
|
|
2531
|
-
throw new Error(errMsg);
|
|
2532
|
-
}
|
|
2533
|
-
return chunks.join('');
|
|
2534
|
-
};
|
|
2535
|
-
return templates;
|
|
2536
|
-
}
|
|
2537
|
-
var hasRequiredChalk;
|
|
2538
|
-
function requireChalk() {
|
|
2539
|
-
if (hasRequiredChalk) return chalk.exports;
|
|
2540
|
-
hasRequiredChalk = 1;
|
|
2541
|
-
(function (module) {
|
|
2542
|
-
const escapeStringRegexp = requireEscapeStringRegexp();
|
|
2543
|
-
const ansiStyles = requireAnsiStyles();
|
|
2544
|
-
const stdoutColor = requireSupportsColor$1().stdout;
|
|
2545
|
-
const template = requireTemplates();
|
|
2546
|
-
const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
|
|
2547
|
-
|
|
2548
|
-
// `supportsColor.level` → `ansiStyles.color[name]` mapping
|
|
2549
|
-
const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
|
|
2550
|
-
|
|
2551
|
-
// `color-convert` models to exclude from the Chalk API due to conflicts and such
|
|
2552
|
-
const skipModels = new Set(['gray']);
|
|
2553
|
-
const styles = Object.create(null);
|
|
2554
|
-
function applyOptions(obj, options) {
|
|
2555
|
-
options = options || {};
|
|
2556
|
-
|
|
2557
|
-
// Detect level if not set manually
|
|
2558
|
-
const scLevel = stdoutColor ? stdoutColor.level : 0;
|
|
2559
|
-
obj.level = options.level === undefined ? scLevel : options.level;
|
|
2560
|
-
obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
|
|
2561
|
-
}
|
|
2562
|
-
function Chalk(options) {
|
|
2563
|
-
// We check for this.template here since calling `chalk.constructor()`
|
|
2564
|
-
// by itself will have a `this` of a previously constructed chalk object
|
|
2565
|
-
if (!this || !(this instanceof Chalk) || this.template) {
|
|
2566
|
-
const chalk = {};
|
|
2567
|
-
applyOptions(chalk, options);
|
|
2568
|
-
chalk.template = function () {
|
|
2569
|
-
const args = [].slice.call(arguments);
|
|
2570
|
-
return chalkTag.apply(null, [chalk.template].concat(args));
|
|
2571
|
-
};
|
|
2572
|
-
Object.setPrototypeOf(chalk, Chalk.prototype);
|
|
2573
|
-
Object.setPrototypeOf(chalk.template, chalk);
|
|
2574
|
-
chalk.template.constructor = Chalk;
|
|
2575
|
-
return chalk.template;
|
|
2576
|
-
}
|
|
2577
|
-
applyOptions(this, options);
|
|
2578
|
-
}
|
|
1040
|
+
function requireLib$1 () {
|
|
1041
|
+
if (hasRequiredLib$1) return lib;
|
|
1042
|
+
hasRequiredLib$1 = 1;
|
|
1043
|
+
(function (exports) {
|
|
2579
1044
|
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
}
|
|
2637
|
-
};
|
|
2638
|
-
}
|
|
2639
|
-
const proto = Object.defineProperties(() => {}, styles);
|
|
2640
|
-
function build(_styles, _empty, key) {
|
|
2641
|
-
const builder = function () {
|
|
2642
|
-
return applyStyle.apply(builder, arguments);
|
|
2643
|
-
};
|
|
2644
|
-
builder._styles = _styles;
|
|
2645
|
-
builder._empty = _empty;
|
|
2646
|
-
const self = this;
|
|
2647
|
-
Object.defineProperty(builder, 'level', {
|
|
2648
|
-
enumerable: true,
|
|
2649
|
-
get() {
|
|
2650
|
-
return self.level;
|
|
2651
|
-
},
|
|
2652
|
-
set(level) {
|
|
2653
|
-
self.level = level;
|
|
2654
|
-
}
|
|
2655
|
-
});
|
|
2656
|
-
Object.defineProperty(builder, 'enabled', {
|
|
2657
|
-
enumerable: true,
|
|
2658
|
-
get() {
|
|
2659
|
-
return self.enabled;
|
|
2660
|
-
},
|
|
2661
|
-
set(enabled) {
|
|
2662
|
-
self.enabled = enabled;
|
|
2663
|
-
}
|
|
2664
|
-
});
|
|
1045
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1046
|
+
value: true
|
|
1047
|
+
});
|
|
1048
|
+
Object.defineProperty(exports, "isIdentifierChar", {
|
|
1049
|
+
enumerable: true,
|
|
1050
|
+
get: function () {
|
|
1051
|
+
return _identifier.isIdentifierChar;
|
|
1052
|
+
}
|
|
1053
|
+
});
|
|
1054
|
+
Object.defineProperty(exports, "isIdentifierName", {
|
|
1055
|
+
enumerable: true,
|
|
1056
|
+
get: function () {
|
|
1057
|
+
return _identifier.isIdentifierName;
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
1060
|
+
Object.defineProperty(exports, "isIdentifierStart", {
|
|
1061
|
+
enumerable: true,
|
|
1062
|
+
get: function () {
|
|
1063
|
+
return _identifier.isIdentifierStart;
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
Object.defineProperty(exports, "isKeyword", {
|
|
1067
|
+
enumerable: true,
|
|
1068
|
+
get: function () {
|
|
1069
|
+
return _keyword.isKeyword;
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
Object.defineProperty(exports, "isReservedWord", {
|
|
1073
|
+
enumerable: true,
|
|
1074
|
+
get: function () {
|
|
1075
|
+
return _keyword.isReservedWord;
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
|
|
1079
|
+
enumerable: true,
|
|
1080
|
+
get: function () {
|
|
1081
|
+
return _keyword.isStrictBindOnlyReservedWord;
|
|
1082
|
+
}
|
|
1083
|
+
});
|
|
1084
|
+
Object.defineProperty(exports, "isStrictBindReservedWord", {
|
|
1085
|
+
enumerable: true,
|
|
1086
|
+
get: function () {
|
|
1087
|
+
return _keyword.isStrictBindReservedWord;
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
Object.defineProperty(exports, "isStrictReservedWord", {
|
|
1091
|
+
enumerable: true,
|
|
1092
|
+
get: function () {
|
|
1093
|
+
return _keyword.isStrictReservedWord;
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
1096
|
+
var _identifier = requireIdentifier();
|
|
1097
|
+
var _keyword = requireKeyword();
|
|
1098
|
+
} (lib));
|
|
1099
|
+
return lib;
|
|
1100
|
+
}
|
|
2665
1101
|
|
|
2666
|
-
|
|
2667
|
-
builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
|
|
1102
|
+
var hasRequiredLib;
|
|
2668
1103
|
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
1104
|
+
function requireLib () {
|
|
1105
|
+
if (hasRequiredLib) return lib$1;
|
|
1106
|
+
hasRequiredLib = 1;
|
|
2672
1107
|
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
1108
|
+
Object.defineProperty(lib$1, '__esModule', {
|
|
1109
|
+
value: true
|
|
1110
|
+
});
|
|
1111
|
+
var picocolors = /*@__PURE__*/ requirePicocolors();
|
|
1112
|
+
var jsTokens = requireJsTokens();
|
|
1113
|
+
var helperValidatorIdentifier = requireLib$1();
|
|
1114
|
+
function isColorSupported() {
|
|
1115
|
+
return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported;
|
|
1116
|
+
}
|
|
1117
|
+
const compose = (f, g) => v => f(g(v));
|
|
1118
|
+
function buildDefs(colors) {
|
|
1119
|
+
return {
|
|
1120
|
+
keyword: colors.cyan,
|
|
1121
|
+
capitalized: colors.yellow,
|
|
1122
|
+
jsxIdentifier: colors.yellow,
|
|
1123
|
+
punctuator: colors.yellow,
|
|
1124
|
+
number: colors.magenta,
|
|
1125
|
+
string: colors.green,
|
|
1126
|
+
regex: colors.magenta,
|
|
1127
|
+
comment: colors.gray,
|
|
1128
|
+
invalid: compose(compose(colors.white, colors.bgRed), colors.bold),
|
|
1129
|
+
gutter: colors.gray,
|
|
1130
|
+
marker: compose(colors.red, colors.bold),
|
|
1131
|
+
message: compose(colors.red, colors.bold),
|
|
1132
|
+
reset: colors.reset
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
const defsOn = buildDefs(picocolors.createColors(true));
|
|
1136
|
+
const defsOff = buildDefs(picocolors.createColors(false));
|
|
1137
|
+
function getDefs(enabled) {
|
|
1138
|
+
return enabled ? defsOn : defsOff;
|
|
1139
|
+
}
|
|
1140
|
+
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
|
1141
|
+
const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
|
1142
|
+
const BRACKET = /^[()[\]{}]$/;
|
|
1143
|
+
let tokenize;
|
|
1144
|
+
{
|
|
1145
|
+
const JSX_TAG = /^[a-z][\w-]*$/i;
|
|
1146
|
+
const getTokenType = function (token, offset, text) {
|
|
1147
|
+
if (token.type === "name") {
|
|
1148
|
+
if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) {
|
|
1149
|
+
return "keyword";
|
|
1150
|
+
}
|
|
1151
|
+
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
|
|
1152
|
+
return "jsxIdentifier";
|
|
1153
|
+
}
|
|
1154
|
+
if (token.value[0] !== token.value[0].toLowerCase()) {
|
|
1155
|
+
return "capitalized";
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
|
1159
|
+
return "bracket";
|
|
1160
|
+
}
|
|
1161
|
+
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
|
1162
|
+
return "punctuator";
|
|
1163
|
+
}
|
|
1164
|
+
return token.type;
|
|
1165
|
+
};
|
|
1166
|
+
tokenize = function* (text) {
|
|
1167
|
+
let match;
|
|
1168
|
+
while (match = jsTokens.default.exec(text)) {
|
|
1169
|
+
const token = jsTokens.matchToToken(match);
|
|
1170
|
+
yield {
|
|
1171
|
+
type: getTokenType(token, match.index, text),
|
|
1172
|
+
value: token.value
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
function highlight(text) {
|
|
1178
|
+
if (text === "") return "";
|
|
1179
|
+
const defs = getDefs(true);
|
|
1180
|
+
let highlighted = "";
|
|
1181
|
+
for (const {
|
|
1182
|
+
type,
|
|
1183
|
+
value
|
|
1184
|
+
} of tokenize(text)) {
|
|
1185
|
+
if (type in defs) {
|
|
1186
|
+
highlighted += value.split(NEWLINE$1).map(str => defs[type](str)).join("\n");
|
|
1187
|
+
} else {
|
|
1188
|
+
highlighted += value;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
return highlighted;
|
|
1192
|
+
}
|
|
1193
|
+
let deprecationWarningShown = false;
|
|
1194
|
+
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
1195
|
+
function getMarkerLines(loc, source, opts) {
|
|
1196
|
+
const startLoc = Object.assign({
|
|
1197
|
+
column: 0,
|
|
1198
|
+
line: -1
|
|
1199
|
+
}, loc.start);
|
|
1200
|
+
const endLoc = Object.assign({}, startLoc, loc.end);
|
|
1201
|
+
const {
|
|
1202
|
+
linesAbove = 2,
|
|
1203
|
+
linesBelow = 3
|
|
1204
|
+
} = opts || {};
|
|
1205
|
+
const startLine = startLoc.line;
|
|
1206
|
+
const startColumn = startLoc.column;
|
|
1207
|
+
const endLine = endLoc.line;
|
|
1208
|
+
const endColumn = endLoc.column;
|
|
1209
|
+
let start = Math.max(startLine - (linesAbove + 1), 0);
|
|
1210
|
+
let end = Math.min(source.length, endLine + linesBelow);
|
|
1211
|
+
if (startLine === -1) {
|
|
1212
|
+
start = 0;
|
|
1213
|
+
}
|
|
1214
|
+
if (endLine === -1) {
|
|
1215
|
+
end = source.length;
|
|
1216
|
+
}
|
|
1217
|
+
const lineDiff = endLine - startLine;
|
|
1218
|
+
const markerLines = {};
|
|
1219
|
+
if (lineDiff) {
|
|
1220
|
+
for (let i = 0; i <= lineDiff; i++) {
|
|
1221
|
+
const lineNumber = i + startLine;
|
|
1222
|
+
if (!startColumn) {
|
|
1223
|
+
markerLines[lineNumber] = true;
|
|
1224
|
+
} else if (i === 0) {
|
|
1225
|
+
const sourceLength = source[lineNumber - 1].length;
|
|
1226
|
+
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
|
1227
|
+
} else if (i === lineDiff) {
|
|
1228
|
+
markerLines[lineNumber] = [0, endColumn];
|
|
1229
|
+
} else {
|
|
1230
|
+
const sourceLength = source[lineNumber - i].length;
|
|
1231
|
+
markerLines[lineNumber] = [0, sourceLength];
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
} else {
|
|
1235
|
+
if (startColumn === endColumn) {
|
|
1236
|
+
if (startColumn) {
|
|
1237
|
+
markerLines[startLine] = [startColumn, 0];
|
|
1238
|
+
} else {
|
|
1239
|
+
markerLines[startLine] = true;
|
|
1240
|
+
}
|
|
1241
|
+
} else {
|
|
1242
|
+
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
return {
|
|
1246
|
+
start,
|
|
1247
|
+
end,
|
|
1248
|
+
markerLines
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
1252
|
+
const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
|
|
1253
|
+
const defs = getDefs(shouldHighlight);
|
|
1254
|
+
const lines = rawLines.split(NEWLINE);
|
|
1255
|
+
const {
|
|
1256
|
+
start,
|
|
1257
|
+
end,
|
|
1258
|
+
markerLines
|
|
1259
|
+
} = getMarkerLines(loc, lines, opts);
|
|
1260
|
+
const hasColumns = loc.start && typeof loc.start.column === "number";
|
|
1261
|
+
const numberMaxWidth = String(end).length;
|
|
1262
|
+
const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
|
|
1263
|
+
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {
|
|
1264
|
+
const number = start + 1 + index;
|
|
1265
|
+
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
|
1266
|
+
const gutter = ` ${paddedNumber} |`;
|
|
1267
|
+
const hasMarker = markerLines[number];
|
|
1268
|
+
const lastMarkerLine = !markerLines[number + 1];
|
|
1269
|
+
if (hasMarker) {
|
|
1270
|
+
let markerLine = "";
|
|
1271
|
+
if (Array.isArray(hasMarker)) {
|
|
1272
|
+
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
|
1273
|
+
const numberOfMarkers = hasMarker[1] || 1;
|
|
1274
|
+
markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join("");
|
|
1275
|
+
if (lastMarkerLine && opts.message) {
|
|
1276
|
+
markerLine += " " + defs.message(opts.message);
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
|
1280
|
+
} else {
|
|
1281
|
+
return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
|
1282
|
+
}
|
|
1283
|
+
}).join("\n");
|
|
1284
|
+
if (opts.message && !hasColumns) {
|
|
1285
|
+
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
|
1286
|
+
}
|
|
1287
|
+
if (shouldHighlight) {
|
|
1288
|
+
return defs.reset(frame);
|
|
1289
|
+
} else {
|
|
1290
|
+
return frame;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
function index(rawLines, lineNumber, colNumber, opts = {}) {
|
|
1294
|
+
if (!deprecationWarningShown) {
|
|
1295
|
+
deprecationWarningShown = true;
|
|
1296
|
+
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
|
1297
|
+
if (process.emitWarning) {
|
|
1298
|
+
process.emitWarning(message, "DeprecationWarning");
|
|
1299
|
+
} else {
|
|
1300
|
+
const deprecationError = new Error(message);
|
|
1301
|
+
deprecationError.name = "DeprecationWarning";
|
|
1302
|
+
console.warn(new Error(message));
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
colNumber = Math.max(colNumber, 0);
|
|
1306
|
+
const location = {
|
|
1307
|
+
start: {
|
|
1308
|
+
column: colNumber,
|
|
1309
|
+
line: lineNumber
|
|
1310
|
+
}
|
|
1311
|
+
};
|
|
1312
|
+
return codeFrameColumns(rawLines, location, opts);
|
|
1313
|
+
}
|
|
1314
|
+
lib$1.codeFrameColumns = codeFrameColumns;
|
|
1315
|
+
lib$1.default = index;
|
|
1316
|
+
lib$1.highlight = highlight;
|
|
1317
|
+
return lib$1;
|
|
1318
|
+
}
|
|
2692
1319
|
|
|
2693
|
-
|
|
2694
|
-
// see https://github.com/chalk/chalk/issues/58
|
|
2695
|
-
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
|
|
2696
|
-
const originalDim = ansiStyles.dim.open;
|
|
2697
|
-
if (isSimpleWindowsTerm && this.hasGrey) {
|
|
2698
|
-
ansiStyles.dim.open = '';
|
|
2699
|
-
}
|
|
2700
|
-
for (const code of this._styles.slice().reverse()) {
|
|
2701
|
-
// Replace any instances already present with a re-opening code
|
|
2702
|
-
// otherwise only the part of the string until said closing code
|
|
2703
|
-
// will be colored, and the rest will simply be 'plain'.
|
|
2704
|
-
str = code.open + str.replace(code.closeRe, code.open) + code.close;
|
|
2705
|
-
|
|
2706
|
-
// Close the styling before a linebreak and reopen
|
|
2707
|
-
// after next line to fix a bleed issue on macOS
|
|
2708
|
-
// https://github.com/chalk/chalk/pull/92
|
|
2709
|
-
str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
|
|
2710
|
-
}
|
|
1320
|
+
var libExports = requireLib();
|
|
2711
1321
|
|
|
2712
|
-
// Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
|
|
2713
|
-
ansiStyles.dim.open = originalDim;
|
|
2714
|
-
return str;
|
|
2715
|
-
}
|
|
2716
|
-
function chalkTag(chalk, strings) {
|
|
2717
|
-
if (!Array.isArray(strings)) {
|
|
2718
|
-
// If chalk() was called by itself or with a string,
|
|
2719
|
-
// return the string itself as a string.
|
|
2720
|
-
return [].slice.call(arguments, 1).join(' ');
|
|
2721
|
-
}
|
|
2722
|
-
const args = [].slice.call(arguments, 2);
|
|
2723
|
-
const parts = [strings.raw[0]];
|
|
2724
|
-
for (let i = 1; i < strings.length; i++) {
|
|
2725
|
-
parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
|
|
2726
|
-
parts.push(String(strings.raw[i]));
|
|
2727
|
-
}
|
|
2728
|
-
return template(chalk, parts.join(''));
|
|
2729
|
-
}
|
|
2730
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
2731
|
-
module.exports = Chalk(); // eslint-disable-line new-cap
|
|
2732
|
-
module.exports.supportsColor = stdoutColor;
|
|
2733
|
-
module.exports.default = module.exports; // For TypeScript
|
|
2734
|
-
})(chalk);
|
|
2735
|
-
return chalk.exports;
|
|
2736
|
-
}
|
|
2737
|
-
Object.defineProperty(lib$1, "__esModule", {
|
|
2738
|
-
value: true
|
|
2739
|
-
});
|
|
2740
|
-
lib$1.default = highlight;
|
|
2741
|
-
lib$1.shouldHighlight = shouldHighlight;
|
|
2742
|
-
var _jsTokens = jsTokens;
|
|
2743
|
-
var _helperValidatorIdentifier = lib;
|
|
2744
|
-
var _picocolors$1 = _interopRequireWildcard$1(picocolorsExports, true);
|
|
2745
|
-
function _getRequireWildcardCache$1(e) {
|
|
2746
|
-
if ("function" != typeof WeakMap) return null;
|
|
2747
|
-
var r = new WeakMap(),
|
|
2748
|
-
t = new WeakMap();
|
|
2749
|
-
return (_getRequireWildcardCache$1 = function (e) {
|
|
2750
|
-
return e ? t : r;
|
|
2751
|
-
})(e);
|
|
2752
|
-
}
|
|
2753
|
-
function _interopRequireWildcard$1(e, r) {
|
|
2754
|
-
if (null === e || "object" != typeof e && "function" != typeof e) return {
|
|
2755
|
-
default: e
|
|
2756
|
-
};
|
|
2757
|
-
var t = _getRequireWildcardCache$1(r);
|
|
2758
|
-
if (t && t.has(e)) return t.get(e);
|
|
2759
|
-
var n = {
|
|
2760
|
-
__proto__: null
|
|
2761
|
-
},
|
|
2762
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
2763
|
-
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
2764
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
2765
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
2766
|
-
}
|
|
2767
|
-
return n.default = e, t && t.set(e, n), n;
|
|
2768
|
-
}
|
|
2769
|
-
const colors$1 = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors$1.createColors)(false) : _picocolors$1.default;
|
|
2770
|
-
const compose$1 = (f, g) => v => f(g(v));
|
|
2771
|
-
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
|
2772
|
-
function getDefs$1(colors) {
|
|
2773
|
-
return {
|
|
2774
|
-
keyword: colors.cyan,
|
|
2775
|
-
capitalized: colors.yellow,
|
|
2776
|
-
jsxIdentifier: colors.yellow,
|
|
2777
|
-
punctuator: colors.yellow,
|
|
2778
|
-
number: colors.magenta,
|
|
2779
|
-
string: colors.green,
|
|
2780
|
-
regex: colors.magenta,
|
|
2781
|
-
comment: colors.gray,
|
|
2782
|
-
invalid: compose$1(compose$1(colors.white, colors.bgRed), colors.bold)
|
|
2783
|
-
};
|
|
2784
|
-
}
|
|
2785
|
-
const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
|
2786
|
-
const BRACKET = /^[()[\]{}]$/;
|
|
2787
|
-
let tokenize;
|
|
2788
|
-
{
|
|
2789
|
-
const JSX_TAG = /^[a-z][\w-]*$/i;
|
|
2790
|
-
const getTokenType = function (token, offset, text) {
|
|
2791
|
-
if (token.type === "name") {
|
|
2792
|
-
if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) {
|
|
2793
|
-
return "keyword";
|
|
2794
|
-
}
|
|
2795
|
-
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
|
|
2796
|
-
return "jsxIdentifier";
|
|
2797
|
-
}
|
|
2798
|
-
if (token.value[0] !== token.value[0].toLowerCase()) {
|
|
2799
|
-
return "capitalized";
|
|
2800
|
-
}
|
|
2801
|
-
}
|
|
2802
|
-
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
|
2803
|
-
return "bracket";
|
|
2804
|
-
}
|
|
2805
|
-
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
|
2806
|
-
return "punctuator";
|
|
2807
|
-
}
|
|
2808
|
-
return token.type;
|
|
2809
|
-
};
|
|
2810
|
-
tokenize = function* (text) {
|
|
2811
|
-
let match;
|
|
2812
|
-
while (match = _jsTokens.default.exec(text)) {
|
|
2813
|
-
const token = _jsTokens.matchToToken(match);
|
|
2814
|
-
yield {
|
|
2815
|
-
type: getTokenType(token, match.index, text),
|
|
2816
|
-
value: token.value
|
|
2817
|
-
};
|
|
2818
|
-
}
|
|
2819
|
-
};
|
|
2820
|
-
}
|
|
2821
|
-
function highlightTokens(defs, text) {
|
|
2822
|
-
let highlighted = "";
|
|
2823
|
-
for (const {
|
|
2824
|
-
type,
|
|
2825
|
-
value
|
|
2826
|
-
} of tokenize(text)) {
|
|
2827
|
-
const colorize = defs[type];
|
|
2828
|
-
if (colorize) {
|
|
2829
|
-
highlighted += value.split(NEWLINE$1).map(str => colorize(str)).join("\n");
|
|
2830
|
-
} else {
|
|
2831
|
-
highlighted += value;
|
|
2832
|
-
}
|
|
2833
|
-
}
|
|
2834
|
-
return highlighted;
|
|
2835
|
-
}
|
|
2836
|
-
function shouldHighlight(options) {
|
|
2837
|
-
return colors$1.isColorSupported || options.forceColor;
|
|
2838
|
-
}
|
|
2839
|
-
let pcWithForcedColor$1 = undefined;
|
|
2840
|
-
function getColors$1(forceColor) {
|
|
2841
|
-
if (forceColor) {
|
|
2842
|
-
var _pcWithForcedColor;
|
|
2843
|
-
(_pcWithForcedColor = pcWithForcedColor$1) != null ? _pcWithForcedColor : pcWithForcedColor$1 = (0, _picocolors$1.createColors)(true);
|
|
2844
|
-
return pcWithForcedColor$1;
|
|
2845
|
-
}
|
|
2846
|
-
return colors$1;
|
|
2847
|
-
}
|
|
2848
|
-
function highlight(code, options = {}) {
|
|
2849
|
-
if (code !== "" && shouldHighlight(options)) {
|
|
2850
|
-
const defs = getDefs$1(getColors$1(options.forceColor));
|
|
2851
|
-
return highlightTokens(defs, code);
|
|
2852
|
-
} else {
|
|
2853
|
-
return code;
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
{
|
|
2857
|
-
let chalk, chalkWithForcedColor;
|
|
2858
|
-
lib$1.getChalk = ({
|
|
2859
|
-
forceColor
|
|
2860
|
-
}) => {
|
|
2861
|
-
var _chalk;
|
|
2862
|
-
(_chalk = chalk) != null ? _chalk : chalk = requireChalk();
|
|
2863
|
-
if (forceColor) {
|
|
2864
|
-
var _chalkWithForcedColor;
|
|
2865
|
-
(_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk.constructor({
|
|
2866
|
-
enabled: true,
|
|
2867
|
-
level: 1
|
|
2868
|
-
});
|
|
2869
|
-
return chalkWithForcedColor;
|
|
2870
|
-
}
|
|
2871
|
-
return chalk;
|
|
2872
|
-
};
|
|
2873
|
-
}
|
|
2874
|
-
Object.defineProperty(lib$2, "__esModule", {
|
|
2875
|
-
value: true
|
|
2876
|
-
});
|
|
2877
|
-
var codeFrameColumns_1 = lib$2.codeFrameColumns = codeFrameColumns;
|
|
2878
|
-
lib$2.default = _default;
|
|
2879
|
-
var _highlight = lib$1;
|
|
2880
|
-
var _picocolors = _interopRequireWildcard(picocolorsExports, true);
|
|
2881
|
-
function _getRequireWildcardCache(e) {
|
|
2882
|
-
if ("function" != typeof WeakMap) return null;
|
|
2883
|
-
var r = new WeakMap(),
|
|
2884
|
-
t = new WeakMap();
|
|
2885
|
-
return (_getRequireWildcardCache = function (e) {
|
|
2886
|
-
return e ? t : r;
|
|
2887
|
-
})(e);
|
|
2888
|
-
}
|
|
2889
|
-
function _interopRequireWildcard(e, r) {
|
|
2890
|
-
if (null === e || "object" != typeof e && "function" != typeof e) return {
|
|
2891
|
-
default: e
|
|
2892
|
-
};
|
|
2893
|
-
var t = _getRequireWildcardCache(r);
|
|
2894
|
-
if (t && t.has(e)) return t.get(e);
|
|
2895
|
-
var n = {
|
|
2896
|
-
__proto__: null
|
|
2897
|
-
},
|
|
2898
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
2899
|
-
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
2900
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
2901
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
2902
|
-
}
|
|
2903
|
-
return n.default = e, t && t.set(e, n), n;
|
|
2904
|
-
}
|
|
2905
|
-
const colors = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors.createColors)(false) : _picocolors.default;
|
|
2906
|
-
const compose = (f, g) => v => f(g(v));
|
|
2907
|
-
let pcWithForcedColor = undefined;
|
|
2908
|
-
function getColors(forceColor) {
|
|
2909
|
-
if (forceColor) {
|
|
2910
|
-
var _pcWithForcedColor;
|
|
2911
|
-
(_pcWithForcedColor = pcWithForcedColor) != null ? _pcWithForcedColor : pcWithForcedColor = (0, _picocolors.createColors)(true);
|
|
2912
|
-
return pcWithForcedColor;
|
|
2913
|
-
}
|
|
2914
|
-
return colors;
|
|
2915
|
-
}
|
|
2916
|
-
let deprecationWarningShown = false;
|
|
2917
|
-
function getDefs(colors) {
|
|
2918
|
-
return {
|
|
2919
|
-
gutter: colors.gray,
|
|
2920
|
-
marker: compose(colors.red, colors.bold),
|
|
2921
|
-
message: compose(colors.red, colors.bold)
|
|
2922
|
-
};
|
|
2923
|
-
}
|
|
2924
|
-
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
2925
|
-
function getMarkerLines(loc, source, opts) {
|
|
2926
|
-
const startLoc = Object.assign({
|
|
2927
|
-
column: 0,
|
|
2928
|
-
line: -1
|
|
2929
|
-
}, loc.start);
|
|
2930
|
-
const endLoc = Object.assign({}, startLoc, loc.end);
|
|
2931
|
-
const {
|
|
2932
|
-
linesAbove = 2,
|
|
2933
|
-
linesBelow = 3
|
|
2934
|
-
} = opts || {};
|
|
2935
|
-
const startLine = startLoc.line;
|
|
2936
|
-
const startColumn = startLoc.column;
|
|
2937
|
-
const endLine = endLoc.line;
|
|
2938
|
-
const endColumn = endLoc.column;
|
|
2939
|
-
let start = Math.max(startLine - (linesAbove + 1), 0);
|
|
2940
|
-
let end = Math.min(source.length, endLine + linesBelow);
|
|
2941
|
-
if (startLine === -1) {
|
|
2942
|
-
start = 0;
|
|
2943
|
-
}
|
|
2944
|
-
if (endLine === -1) {
|
|
2945
|
-
end = source.length;
|
|
2946
|
-
}
|
|
2947
|
-
const lineDiff = endLine - startLine;
|
|
2948
|
-
const markerLines = {};
|
|
2949
|
-
if (lineDiff) {
|
|
2950
|
-
for (let i = 0; i <= lineDiff; i++) {
|
|
2951
|
-
const lineNumber = i + startLine;
|
|
2952
|
-
if (!startColumn) {
|
|
2953
|
-
markerLines[lineNumber] = true;
|
|
2954
|
-
} else if (i === 0) {
|
|
2955
|
-
const sourceLength = source[lineNumber - 1].length;
|
|
2956
|
-
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
|
2957
|
-
} else if (i === lineDiff) {
|
|
2958
|
-
markerLines[lineNumber] = [0, endColumn];
|
|
2959
|
-
} else {
|
|
2960
|
-
const sourceLength = source[lineNumber - i].length;
|
|
2961
|
-
markerLines[lineNumber] = [0, sourceLength];
|
|
2962
|
-
}
|
|
2963
|
-
}
|
|
2964
|
-
} else {
|
|
2965
|
-
if (startColumn === endColumn) {
|
|
2966
|
-
if (startColumn) {
|
|
2967
|
-
markerLines[startLine] = [startColumn, 0];
|
|
2968
|
-
} else {
|
|
2969
|
-
markerLines[startLine] = true;
|
|
2970
|
-
}
|
|
2971
|
-
} else {
|
|
2972
|
-
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
|
2973
|
-
}
|
|
2974
|
-
}
|
|
2975
|
-
return {
|
|
2976
|
-
start,
|
|
2977
|
-
end,
|
|
2978
|
-
markerLines
|
|
2979
|
-
};
|
|
2980
|
-
}
|
|
2981
|
-
function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
2982
|
-
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
|
2983
|
-
const colors = getColors(opts.forceColor);
|
|
2984
|
-
const defs = getDefs(colors);
|
|
2985
|
-
const maybeHighlight = (fmt, string) => {
|
|
2986
|
-
return highlighted ? fmt(string) : string;
|
|
2987
|
-
};
|
|
2988
|
-
const lines = rawLines.split(NEWLINE);
|
|
2989
|
-
const {
|
|
2990
|
-
start,
|
|
2991
|
-
end,
|
|
2992
|
-
markerLines
|
|
2993
|
-
} = getMarkerLines(loc, lines, opts);
|
|
2994
|
-
const hasColumns = loc.start && typeof loc.start.column === "number";
|
|
2995
|
-
const numberMaxWidth = String(end).length;
|
|
2996
|
-
const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
|
|
2997
|
-
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {
|
|
2998
|
-
const number = start + 1 + index;
|
|
2999
|
-
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
|
3000
|
-
const gutter = ` ${paddedNumber} |`;
|
|
3001
|
-
const hasMarker = markerLines[number];
|
|
3002
|
-
const lastMarkerLine = !markerLines[number + 1];
|
|
3003
|
-
if (hasMarker) {
|
|
3004
|
-
let markerLine = "";
|
|
3005
|
-
if (Array.isArray(hasMarker)) {
|
|
3006
|
-
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
|
3007
|
-
const numberOfMarkers = hasMarker[1] || 1;
|
|
3008
|
-
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
|
|
3009
|
-
if (lastMarkerLine && opts.message) {
|
|
3010
|
-
markerLine += " " + maybeHighlight(defs.message, opts.message);
|
|
3011
|
-
}
|
|
3012
|
-
}
|
|
3013
|
-
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
|
3014
|
-
} else {
|
|
3015
|
-
return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
|
3016
|
-
}
|
|
3017
|
-
}).join("\n");
|
|
3018
|
-
if (opts.message && !hasColumns) {
|
|
3019
|
-
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
|
3020
|
-
}
|
|
3021
|
-
if (highlighted) {
|
|
3022
|
-
return colors.reset(frame);
|
|
3023
|
-
} else {
|
|
3024
|
-
return frame;
|
|
3025
|
-
}
|
|
3026
|
-
}
|
|
3027
|
-
function _default(rawLines, lineNumber, colNumber, opts = {}) {
|
|
3028
|
-
if (!deprecationWarningShown) {
|
|
3029
|
-
deprecationWarningShown = true;
|
|
3030
|
-
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
|
3031
|
-
if (process.emitWarning) {
|
|
3032
|
-
process.emitWarning(message, "DeprecationWarning");
|
|
3033
|
-
} else {
|
|
3034
|
-
const deprecationError = new Error(message);
|
|
3035
|
-
deprecationError.name = "DeprecationWarning";
|
|
3036
|
-
console.warn(new Error(message));
|
|
3037
|
-
}
|
|
3038
|
-
}
|
|
3039
|
-
colNumber = Math.max(colNumber, 0);
|
|
3040
|
-
const location = {
|
|
3041
|
-
start: {
|
|
3042
|
-
column: colNumber,
|
|
3043
|
-
line: lineNumber
|
|
3044
|
-
}
|
|
3045
|
-
};
|
|
3046
|
-
return codeFrameColumns(rawLines, location, opts);
|
|
3047
|
-
}
|
|
3048
1322
|
const NewLine$3 = '\n';
|
|
3049
1323
|
const splitLines$2 = lines => {
|
|
3050
1324
|
return lines.split(NewLine$3);
|
|
@@ -3186,7 +1460,7 @@ const prepareModuleNotFoundError = error => {
|
|
|
3186
1460
|
column
|
|
3187
1461
|
}
|
|
3188
1462
|
};
|
|
3189
|
-
const codeFrame =
|
|
1463
|
+
const codeFrame = libExports.codeFrameColumns(rawLines, location);
|
|
3190
1464
|
const stackLines = splitLines$2(error.stack);
|
|
3191
1465
|
const newStackLines = [stackLines[0], ` at ${importedFrom}:${line}:${column}`, ...stackLines.slice(1)];
|
|
3192
1466
|
const newStack = joinLines$2(newStackLines);
|
|
@@ -3230,7 +1504,7 @@ const prepare = error => {
|
|
|
3230
1504
|
column: Number.parseInt(column)
|
|
3231
1505
|
}
|
|
3232
1506
|
};
|
|
3233
|
-
codeFrame =
|
|
1507
|
+
codeFrame = libExports.codeFrameColumns(rawLines, location);
|
|
3234
1508
|
}
|
|
3235
1509
|
}
|
|
3236
1510
|
const relevantStack = joinLines$2(lines);
|
|
@@ -6033,8 +4307,8 @@ function requireSupportsColor () {
|
|
|
6033
4307
|
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
6034
4308
|
hasRequiredSupportsColor = 1;
|
|
6035
4309
|
|
|
6036
|
-
const os = require$$0
|
|
6037
|
-
const tty = require$$
|
|
4310
|
+
const os = require$$0;
|
|
4311
|
+
const tty = require$$1;
|
|
6038
4312
|
const hasFlag = requireHasFlag();
|
|
6039
4313
|
const {
|
|
6040
4314
|
env
|
|
@@ -6146,8 +4420,8 @@ function requireNode () {
|
|
|
6146
4420
|
if (hasRequiredNode) return node.exports;
|
|
6147
4421
|
hasRequiredNode = 1;
|
|
6148
4422
|
(function (module, exports) {
|
|
6149
|
-
const tty = require$$
|
|
6150
|
-
const util = require$$1;
|
|
4423
|
+
const tty = require$$1;
|
|
4424
|
+
const util = require$$1$1;
|
|
6151
4425
|
|
|
6152
4426
|
/**
|
|
6153
4427
|
* This is the Node.js implementation of `debug()`.
|
|
@@ -6835,7 +5109,7 @@ const hydrate = async () => {
|
|
|
6835
5109
|
// before being able to test multi-window behavior
|
|
6836
5110
|
// see https://github.com/microsoft/playwright/issues/12345
|
|
6837
5111
|
|
|
6838
|
-
const parsedCliArgs = parseCliArgs(argv
|
|
5112
|
+
const parsedCliArgs = parseCliArgs(argv);
|
|
6839
5113
|
const moduleId = canHandleFastCliArgs(parsedCliArgs);
|
|
6840
5114
|
if (moduleId) {
|
|
6841
5115
|
await handleFastCliArgs(moduleId, parsedCliArgs);
|
|
@@ -6847,7 +5121,7 @@ const hydrate = async () => {
|
|
|
6847
5121
|
setCrashDumpsPath(chromeUserDataPath);
|
|
6848
5122
|
setLogsPath(chromeUserDataPath);
|
|
6849
5123
|
}
|
|
6850
|
-
const hasLock = requestSingleInstanceLock(argv
|
|
5124
|
+
const hasLock = requestSingleInstanceLock(argv);
|
|
6851
5125
|
if (!hasLock) {
|
|
6852
5126
|
debug('[info] quitting because no lock');
|
|
6853
5127
|
exit();
|
|
@@ -6856,7 +5130,7 @@ const hydrate = async () => {
|
|
|
6856
5130
|
|
|
6857
5131
|
// TODO tree shake out the .env.DEV check: reading from env variables is expensive
|
|
6858
5132
|
if (process.stdout.isTTY && !parsedCliArgs.wait && !process.env.DEV) {
|
|
6859
|
-
spawn(execPath, argv
|
|
5133
|
+
spawn(execPath, argv.slice(1), {
|
|
6860
5134
|
detached: true,
|
|
6861
5135
|
stdio: 'ignore'
|
|
6862
5136
|
});
|