@lvce-editor/main-process 1.9.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 +587 -2336
- 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,21 +739,9 @@ const setLogsPath = value => {
|
|
|
739
739
|
};
|
|
740
740
|
|
|
741
741
|
const {
|
|
742
|
-
argv
|
|
742
|
+
argv
|
|
743
743
|
} = process;
|
|
744
744
|
|
|
745
|
-
const Version = 'version';
|
|
746
|
-
const Help = 'help';
|
|
747
|
-
const Wait = 'wait';
|
|
748
|
-
const BuiltinSelfTest = 'built-in-self-test';
|
|
749
|
-
const Web = 'web';
|
|
750
|
-
const SandBox = 'sandbox';
|
|
751
|
-
const Install = 'install';
|
|
752
|
-
const List = 'list';
|
|
753
|
-
const Link = 'link';
|
|
754
|
-
const Unlink = 'unlink';
|
|
755
|
-
const Status = 'status';
|
|
756
|
-
|
|
757
745
|
const Success = 0;
|
|
758
746
|
const Error$3 = 1;
|
|
759
747
|
|
|
@@ -815,2248 +803,522 @@ process.stdout.on('error', error => {
|
|
|
815
803
|
process.stderr.on('error', error => {
|
|
816
804
|
const logger = getOrCreateLogger();
|
|
817
805
|
logger.error(`[main-process] stderr error: ${error.stack}`);
|
|
818
|
-
});
|
|
819
|
-
|
|
820
|
-
var lib$2 = {};
|
|
821
|
-
var lib$1 = {};
|
|
822
|
-
var jsTokens = {};
|
|
823
|
-
|
|
824
|
-
// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell
|
|
825
|
-
// License: MIT. (See LICENSE.)
|
|
826
|
-
|
|
827
|
-
Object.defineProperty(jsTokens, "__esModule", {
|
|
828
|
-
value: true
|
|
829
|
-
});
|
|
830
|
-
|
|
831
|
-
// This regex comes from regex.coffee, and is inserted here by generate-index.js
|
|
832
|
-
// (run `npm run build`).
|
|
833
|
-
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;
|
|
834
|
-
jsTokens.matchToToken = function (match) {
|
|
835
|
-
var token = {
|
|
836
|
-
type: "invalid",
|
|
837
|
-
value: match[0],
|
|
838
|
-
closed: undefined
|
|
839
|
-
};
|
|
840
|
-
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";
|
|
841
|
-
return token;
|
|
842
|
-
};
|
|
843
|
-
var lib = {};
|
|
844
|
-
var identifier = {};
|
|
845
|
-
Object.defineProperty(identifier, "__esModule", {
|
|
846
|
-
value: true
|
|
847
|
-
});
|
|
848
|
-
identifier.isIdentifierChar = isIdentifierChar;
|
|
849
|
-
identifier.isIdentifierName = isIdentifierName;
|
|
850
|
-
identifier.isIdentifierStart = isIdentifierStart;
|
|
851
|
-
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-\u1c88\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-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\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";
|
|
852
|
-
let nonASCIIidentifierChars = "\u200c\u200d\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\u0898-\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";
|
|
853
|
-
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
854
|
-
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
855
|
-
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
856
|
-
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, 68, 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, 349, 41, 7, 1, 79, 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, 159, 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, 264, 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, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 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, 757, 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];
|
|
857
|
-
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, 370, 1, 81, 2, 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, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 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, 406, 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, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 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, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
858
|
-
function isInAstralSet(code, set) {
|
|
859
|
-
let pos = 0x10000;
|
|
860
|
-
for (let i = 0, length = set.length; i < length; i += 2) {
|
|
861
|
-
pos += set[i];
|
|
862
|
-
if (pos > code) return false;
|
|
863
|
-
pos += set[i + 1];
|
|
864
|
-
if (pos >= code) return true;
|
|
865
|
-
}
|
|
866
|
-
return false;
|
|
867
|
-
}
|
|
868
|
-
function isIdentifierStart(code) {
|
|
869
|
-
if (code < 65) return code === 36;
|
|
870
|
-
if (code <= 90) return true;
|
|
871
|
-
if (code < 97) return code === 95;
|
|
872
|
-
if (code <= 122) return true;
|
|
873
|
-
if (code <= 0xffff) {
|
|
874
|
-
return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
|
|
875
|
-
}
|
|
876
|
-
return isInAstralSet(code, astralIdentifierStartCodes);
|
|
877
|
-
}
|
|
878
|
-
function isIdentifierChar(code) {
|
|
879
|
-
if (code < 48) return code === 36;
|
|
880
|
-
if (code < 58) return true;
|
|
881
|
-
if (code < 65) return false;
|
|
882
|
-
if (code <= 90) return true;
|
|
883
|
-
if (code < 97) return code === 95;
|
|
884
|
-
if (code <= 122) return true;
|
|
885
|
-
if (code <= 0xffff) {
|
|
886
|
-
return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
|
|
887
|
-
}
|
|
888
|
-
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
|
|
889
|
-
}
|
|
890
|
-
function isIdentifierName(name) {
|
|
891
|
-
let isFirst = true;
|
|
892
|
-
for (let i = 0; i < name.length; i++) {
|
|
893
|
-
let cp = name.charCodeAt(i);
|
|
894
|
-
if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
|
|
895
|
-
const trail = name.charCodeAt(++i);
|
|
896
|
-
if ((trail & 0xfc00) === 0xdc00) {
|
|
897
|
-
cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
if (isFirst) {
|
|
901
|
-
isFirst = false;
|
|
902
|
-
if (!isIdentifierStart(cp)) {
|
|
903
|
-
return false;
|
|
904
|
-
}
|
|
905
|
-
} else if (!isIdentifierChar(cp)) {
|
|
906
|
-
return false;
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
return !isFirst;
|
|
910
|
-
}
|
|
911
|
-
var keyword = {};
|
|
912
|
-
Object.defineProperty(keyword, "__esModule", {
|
|
913
|
-
value: true
|
|
914
|
-
});
|
|
915
|
-
keyword.isKeyword = isKeyword;
|
|
916
|
-
keyword.isReservedWord = isReservedWord;
|
|
917
|
-
keyword.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
|
|
918
|
-
keyword.isStrictBindReservedWord = isStrictBindReservedWord;
|
|
919
|
-
keyword.isStrictReservedWord = isStrictReservedWord;
|
|
920
|
-
const reservedWords = {
|
|
921
|
-
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"],
|
|
922
|
-
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
|
|
923
|
-
strictBind: ["eval", "arguments"]
|
|
924
|
-
};
|
|
925
|
-
const keywords = new Set(reservedWords.keyword);
|
|
926
|
-
const reservedWordsStrictSet = new Set(reservedWords.strict);
|
|
927
|
-
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
|
928
|
-
function isReservedWord(word, inModule) {
|
|
929
|
-
return inModule && word === "await" || word === "enum";
|
|
930
|
-
}
|
|
931
|
-
function isStrictReservedWord(word, inModule) {
|
|
932
|
-
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
|
|
933
|
-
}
|
|
934
|
-
function isStrictBindOnlyReservedWord(word) {
|
|
935
|
-
return reservedWordsStrictBindSet.has(word);
|
|
936
|
-
}
|
|
937
|
-
function isStrictBindReservedWord(word, inModule) {
|
|
938
|
-
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
|
|
939
|
-
}
|
|
940
|
-
function isKeyword(word) {
|
|
941
|
-
return keywords.has(word);
|
|
942
|
-
}
|
|
943
|
-
(function (exports) {
|
|
944
|
-
Object.defineProperty(exports, "__esModule", {
|
|
945
|
-
value: true
|
|
946
|
-
});
|
|
947
|
-
Object.defineProperty(exports, "isIdentifierChar", {
|
|
948
|
-
enumerable: true,
|
|
949
|
-
get: function () {
|
|
950
|
-
return _identifier.isIdentifierChar;
|
|
951
|
-
}
|
|
952
|
-
});
|
|
953
|
-
Object.defineProperty(exports, "isIdentifierName", {
|
|
954
|
-
enumerable: true,
|
|
955
|
-
get: function () {
|
|
956
|
-
return _identifier.isIdentifierName;
|
|
957
|
-
}
|
|
958
|
-
});
|
|
959
|
-
Object.defineProperty(exports, "isIdentifierStart", {
|
|
960
|
-
enumerable: true,
|
|
961
|
-
get: function () {
|
|
962
|
-
return _identifier.isIdentifierStart;
|
|
963
|
-
}
|
|
964
|
-
});
|
|
965
|
-
Object.defineProperty(exports, "isKeyword", {
|
|
966
|
-
enumerable: true,
|
|
967
|
-
get: function () {
|
|
968
|
-
return _keyword.isKeyword;
|
|
969
|
-
}
|
|
970
|
-
});
|
|
971
|
-
Object.defineProperty(exports, "isReservedWord", {
|
|
972
|
-
enumerable: true,
|
|
973
|
-
get: function () {
|
|
974
|
-
return _keyword.isReservedWord;
|
|
975
|
-
}
|
|
976
|
-
});
|
|
977
|
-
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
|
|
978
|
-
enumerable: true,
|
|
979
|
-
get: function () {
|
|
980
|
-
return _keyword.isStrictBindOnlyReservedWord;
|
|
981
|
-
}
|
|
982
|
-
});
|
|
983
|
-
Object.defineProperty(exports, "isStrictBindReservedWord", {
|
|
984
|
-
enumerable: true,
|
|
985
|
-
get: function () {
|
|
986
|
-
return _keyword.isStrictBindReservedWord;
|
|
987
|
-
}
|
|
988
|
-
});
|
|
989
|
-
Object.defineProperty(exports, "isStrictReservedWord", {
|
|
990
|
-
enumerable: true,
|
|
991
|
-
get: function () {
|
|
992
|
-
return _keyword.isStrictReservedWord;
|
|
993
|
-
}
|
|
994
|
-
});
|
|
995
|
-
var _identifier = identifier;
|
|
996
|
-
var _keyword = keyword;
|
|
997
|
-
})(lib);
|
|
998
|
-
function commonjsRequire(path) {
|
|
999
|
-
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.');
|
|
1000
|
-
}
|
|
1001
|
-
var picocolors = {
|
|
1002
|
-
exports: {}
|
|
1003
|
-
};
|
|
1004
|
-
let argv = process.argv || [],
|
|
1005
|
-
env$2 = process.env;
|
|
1006
|
-
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);
|
|
1007
|
-
let formatter = (open, close, replace = open) => input => {
|
|
1008
|
-
let string = "" + input;
|
|
1009
|
-
let index = string.indexOf(close, open.length);
|
|
1010
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
1011
|
-
};
|
|
1012
|
-
let replaceClose = (string, close, replace, index) => {
|
|
1013
|
-
let result = "";
|
|
1014
|
-
let cursor = 0;
|
|
1015
|
-
do {
|
|
1016
|
-
result += string.substring(cursor, index) + replace;
|
|
1017
|
-
cursor = index + close.length;
|
|
1018
|
-
index = string.indexOf(close, cursor);
|
|
1019
|
-
} while (~index);
|
|
1020
|
-
return result + string.substring(cursor);
|
|
1021
|
-
};
|
|
1022
|
-
let createColors = (enabled = isColorSupported) => {
|
|
1023
|
-
let init = enabled ? formatter : () => String;
|
|
1024
|
-
return {
|
|
1025
|
-
isColorSupported: enabled,
|
|
1026
|
-
reset: init("\x1b[0m", "\x1b[0m"),
|
|
1027
|
-
bold: init("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
1028
|
-
dim: init("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
1029
|
-
italic: init("\x1b[3m", "\x1b[23m"),
|
|
1030
|
-
underline: init("\x1b[4m", "\x1b[24m"),
|
|
1031
|
-
inverse: init("\x1b[7m", "\x1b[27m"),
|
|
1032
|
-
hidden: init("\x1b[8m", "\x1b[28m"),
|
|
1033
|
-
strikethrough: init("\x1b[9m", "\x1b[29m"),
|
|
1034
|
-
black: init("\x1b[30m", "\x1b[39m"),
|
|
1035
|
-
red: init("\x1b[31m", "\x1b[39m"),
|
|
1036
|
-
green: init("\x1b[32m", "\x1b[39m"),
|
|
1037
|
-
yellow: init("\x1b[33m", "\x1b[39m"),
|
|
1038
|
-
blue: init("\x1b[34m", "\x1b[39m"),
|
|
1039
|
-
magenta: init("\x1b[35m", "\x1b[39m"),
|
|
1040
|
-
cyan: init("\x1b[36m", "\x1b[39m"),
|
|
1041
|
-
white: init("\x1b[37m", "\x1b[39m"),
|
|
1042
|
-
gray: init("\x1b[90m", "\x1b[39m"),
|
|
1043
|
-
bgBlack: init("\x1b[40m", "\x1b[49m"),
|
|
1044
|
-
bgRed: init("\x1b[41m", "\x1b[49m"),
|
|
1045
|
-
bgGreen: init("\x1b[42m", "\x1b[49m"),
|
|
1046
|
-
bgYellow: init("\x1b[43m", "\x1b[49m"),
|
|
1047
|
-
bgBlue: init("\x1b[44m", "\x1b[49m"),
|
|
1048
|
-
bgMagenta: init("\x1b[45m", "\x1b[49m"),
|
|
1049
|
-
bgCyan: init("\x1b[46m", "\x1b[49m"),
|
|
1050
|
-
bgWhite: init("\x1b[47m", "\x1b[49m")
|
|
1051
|
-
};
|
|
1052
|
-
};
|
|
1053
|
-
picocolors.exports = createColors();
|
|
1054
|
-
picocolors.exports.createColors = createColors;
|
|
1055
|
-
var picocolorsExports = picocolors.exports;
|
|
1056
|
-
var chalk = {
|
|
1057
|
-
exports: {}
|
|
1058
|
-
};
|
|
1059
|
-
var escapeStringRegexp;
|
|
1060
|
-
var hasRequiredEscapeStringRegexp;
|
|
1061
|
-
function requireEscapeStringRegexp() {
|
|
1062
|
-
if (hasRequiredEscapeStringRegexp) return escapeStringRegexp;
|
|
1063
|
-
hasRequiredEscapeStringRegexp = 1;
|
|
1064
|
-
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
1065
|
-
escapeStringRegexp = function (str) {
|
|
1066
|
-
if (typeof str !== 'string') {
|
|
1067
|
-
throw new TypeError('Expected a string');
|
|
1068
|
-
}
|
|
1069
|
-
return str.replace(matchOperatorsRe, '\\$&');
|
|
1070
|
-
};
|
|
1071
|
-
return escapeStringRegexp;
|
|
1072
|
-
}
|
|
1073
|
-
var ansiStyles = {
|
|
1074
|
-
exports: {}
|
|
1075
|
-
};
|
|
1076
|
-
var conversions = {
|
|
1077
|
-
exports: {}
|
|
1078
|
-
};
|
|
1079
|
-
var colorName;
|
|
1080
|
-
var hasRequiredColorName;
|
|
1081
|
-
function requireColorName() {
|
|
1082
|
-
if (hasRequiredColorName) return colorName;
|
|
1083
|
-
hasRequiredColorName = 1;
|
|
1084
|
-
colorName = {
|
|
1085
|
-
"aliceblue": [240, 248, 255],
|
|
1086
|
-
"antiquewhite": [250, 235, 215],
|
|
1087
|
-
"aqua": [0, 255, 255],
|
|
1088
|
-
"aquamarine": [127, 255, 212],
|
|
1089
|
-
"azure": [240, 255, 255],
|
|
1090
|
-
"beige": [245, 245, 220],
|
|
1091
|
-
"bisque": [255, 228, 196],
|
|
1092
|
-
"black": [0, 0, 0],
|
|
1093
|
-
"blanchedalmond": [255, 235, 205],
|
|
1094
|
-
"blue": [0, 0, 255],
|
|
1095
|
-
"blueviolet": [138, 43, 226],
|
|
1096
|
-
"brown": [165, 42, 42],
|
|
1097
|
-
"burlywood": [222, 184, 135],
|
|
1098
|
-
"cadetblue": [95, 158, 160],
|
|
1099
|
-
"chartreuse": [127, 255, 0],
|
|
1100
|
-
"chocolate": [210, 105, 30],
|
|
1101
|
-
"coral": [255, 127, 80],
|
|
1102
|
-
"cornflowerblue": [100, 149, 237],
|
|
1103
|
-
"cornsilk": [255, 248, 220],
|
|
1104
|
-
"crimson": [220, 20, 60],
|
|
1105
|
-
"cyan": [0, 255, 255],
|
|
1106
|
-
"darkblue": [0, 0, 139],
|
|
1107
|
-
"darkcyan": [0, 139, 139],
|
|
1108
|
-
"darkgoldenrod": [184, 134, 11],
|
|
1109
|
-
"darkgray": [169, 169, 169],
|
|
1110
|
-
"darkgreen": [0, 100, 0],
|
|
1111
|
-
"darkgrey": [169, 169, 169],
|
|
1112
|
-
"darkkhaki": [189, 183, 107],
|
|
1113
|
-
"darkmagenta": [139, 0, 139],
|
|
1114
|
-
"darkolivegreen": [85, 107, 47],
|
|
1115
|
-
"darkorange": [255, 140, 0],
|
|
1116
|
-
"darkorchid": [153, 50, 204],
|
|
1117
|
-
"darkred": [139, 0, 0],
|
|
1118
|
-
"darksalmon": [233, 150, 122],
|
|
1119
|
-
"darkseagreen": [143, 188, 143],
|
|
1120
|
-
"darkslateblue": [72, 61, 139],
|
|
1121
|
-
"darkslategray": [47, 79, 79],
|
|
1122
|
-
"darkslategrey": [47, 79, 79],
|
|
1123
|
-
"darkturquoise": [0, 206, 209],
|
|
1124
|
-
"darkviolet": [148, 0, 211],
|
|
1125
|
-
"deeppink": [255, 20, 147],
|
|
1126
|
-
"deepskyblue": [0, 191, 255],
|
|
1127
|
-
"dimgray": [105, 105, 105],
|
|
1128
|
-
"dimgrey": [105, 105, 105],
|
|
1129
|
-
"dodgerblue": [30, 144, 255],
|
|
1130
|
-
"firebrick": [178, 34, 34],
|
|
1131
|
-
"floralwhite": [255, 250, 240],
|
|
1132
|
-
"forestgreen": [34, 139, 34],
|
|
1133
|
-
"fuchsia": [255, 0, 255],
|
|
1134
|
-
"gainsboro": [220, 220, 220],
|
|
1135
|
-
"ghostwhite": [248, 248, 255],
|
|
1136
|
-
"gold": [255, 215, 0],
|
|
1137
|
-
"goldenrod": [218, 165, 32],
|
|
1138
|
-
"gray": [128, 128, 128],
|
|
1139
|
-
"green": [0, 128, 0],
|
|
1140
|
-
"greenyellow": [173, 255, 47],
|
|
1141
|
-
"grey": [128, 128, 128],
|
|
1142
|
-
"honeydew": [240, 255, 240],
|
|
1143
|
-
"hotpink": [255, 105, 180],
|
|
1144
|
-
"indianred": [205, 92, 92],
|
|
1145
|
-
"indigo": [75, 0, 130],
|
|
1146
|
-
"ivory": [255, 255, 240],
|
|
1147
|
-
"khaki": [240, 230, 140],
|
|
1148
|
-
"lavender": [230, 230, 250],
|
|
1149
|
-
"lavenderblush": [255, 240, 245],
|
|
1150
|
-
"lawngreen": [124, 252, 0],
|
|
1151
|
-
"lemonchiffon": [255, 250, 205],
|
|
1152
|
-
"lightblue": [173, 216, 230],
|
|
1153
|
-
"lightcoral": [240, 128, 128],
|
|
1154
|
-
"lightcyan": [224, 255, 255],
|
|
1155
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
1156
|
-
"lightgray": [211, 211, 211],
|
|
1157
|
-
"lightgreen": [144, 238, 144],
|
|
1158
|
-
"lightgrey": [211, 211, 211],
|
|
1159
|
-
"lightpink": [255, 182, 193],
|
|
1160
|
-
"lightsalmon": [255, 160, 122],
|
|
1161
|
-
"lightseagreen": [32, 178, 170],
|
|
1162
|
-
"lightskyblue": [135, 206, 250],
|
|
1163
|
-
"lightslategray": [119, 136, 153],
|
|
1164
|
-
"lightslategrey": [119, 136, 153],
|
|
1165
|
-
"lightsteelblue": [176, 196, 222],
|
|
1166
|
-
"lightyellow": [255, 255, 224],
|
|
1167
|
-
"lime": [0, 255, 0],
|
|
1168
|
-
"limegreen": [50, 205, 50],
|
|
1169
|
-
"linen": [250, 240, 230],
|
|
1170
|
-
"magenta": [255, 0, 255],
|
|
1171
|
-
"maroon": [128, 0, 0],
|
|
1172
|
-
"mediumaquamarine": [102, 205, 170],
|
|
1173
|
-
"mediumblue": [0, 0, 205],
|
|
1174
|
-
"mediumorchid": [186, 85, 211],
|
|
1175
|
-
"mediumpurple": [147, 112, 219],
|
|
1176
|
-
"mediumseagreen": [60, 179, 113],
|
|
1177
|
-
"mediumslateblue": [123, 104, 238],
|
|
1178
|
-
"mediumspringgreen": [0, 250, 154],
|
|
1179
|
-
"mediumturquoise": [72, 209, 204],
|
|
1180
|
-
"mediumvioletred": [199, 21, 133],
|
|
1181
|
-
"midnightblue": [25, 25, 112],
|
|
1182
|
-
"mintcream": [245, 255, 250],
|
|
1183
|
-
"mistyrose": [255, 228, 225],
|
|
1184
|
-
"moccasin": [255, 228, 181],
|
|
1185
|
-
"navajowhite": [255, 222, 173],
|
|
1186
|
-
"navy": [0, 0, 128],
|
|
1187
|
-
"oldlace": [253, 245, 230],
|
|
1188
|
-
"olive": [128, 128, 0],
|
|
1189
|
-
"olivedrab": [107, 142, 35],
|
|
1190
|
-
"orange": [255, 165, 0],
|
|
1191
|
-
"orangered": [255, 69, 0],
|
|
1192
|
-
"orchid": [218, 112, 214],
|
|
1193
|
-
"palegoldenrod": [238, 232, 170],
|
|
1194
|
-
"palegreen": [152, 251, 152],
|
|
1195
|
-
"paleturquoise": [175, 238, 238],
|
|
1196
|
-
"palevioletred": [219, 112, 147],
|
|
1197
|
-
"papayawhip": [255, 239, 213],
|
|
1198
|
-
"peachpuff": [255, 218, 185],
|
|
1199
|
-
"peru": [205, 133, 63],
|
|
1200
|
-
"pink": [255, 192, 203],
|
|
1201
|
-
"plum": [221, 160, 221],
|
|
1202
|
-
"powderblue": [176, 224, 230],
|
|
1203
|
-
"purple": [128, 0, 128],
|
|
1204
|
-
"rebeccapurple": [102, 51, 153],
|
|
1205
|
-
"red": [255, 0, 0],
|
|
1206
|
-
"rosybrown": [188, 143, 143],
|
|
1207
|
-
"royalblue": [65, 105, 225],
|
|
1208
|
-
"saddlebrown": [139, 69, 19],
|
|
1209
|
-
"salmon": [250, 128, 114],
|
|
1210
|
-
"sandybrown": [244, 164, 96],
|
|
1211
|
-
"seagreen": [46, 139, 87],
|
|
1212
|
-
"seashell": [255, 245, 238],
|
|
1213
|
-
"sienna": [160, 82, 45],
|
|
1214
|
-
"silver": [192, 192, 192],
|
|
1215
|
-
"skyblue": [135, 206, 235],
|
|
1216
|
-
"slateblue": [106, 90, 205],
|
|
1217
|
-
"slategray": [112, 128, 144],
|
|
1218
|
-
"slategrey": [112, 128, 144],
|
|
1219
|
-
"snow": [255, 250, 250],
|
|
1220
|
-
"springgreen": [0, 255, 127],
|
|
1221
|
-
"steelblue": [70, 130, 180],
|
|
1222
|
-
"tan": [210, 180, 140],
|
|
1223
|
-
"teal": [0, 128, 128],
|
|
1224
|
-
"thistle": [216, 191, 216],
|
|
1225
|
-
"tomato": [255, 99, 71],
|
|
1226
|
-
"turquoise": [64, 224, 208],
|
|
1227
|
-
"violet": [238, 130, 238],
|
|
1228
|
-
"wheat": [245, 222, 179],
|
|
1229
|
-
"white": [255, 255, 255],
|
|
1230
|
-
"whitesmoke": [245, 245, 245],
|
|
1231
|
-
"yellow": [255, 255, 0],
|
|
1232
|
-
"yellowgreen": [154, 205, 50]
|
|
1233
|
-
};
|
|
1234
|
-
return colorName;
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
/* MIT license */
|
|
1238
|
-
|
|
1239
|
-
var hasRequiredConversions;
|
|
1240
|
-
function requireConversions() {
|
|
1241
|
-
if (hasRequiredConversions) return conversions.exports;
|
|
1242
|
-
hasRequiredConversions = 1;
|
|
1243
|
-
var cssKeywords = requireColorName();
|
|
1244
|
-
|
|
1245
|
-
// NOTE: conversions should only return primitive values (i.e. arrays, or
|
|
1246
|
-
// values that give correct `typeof` results).
|
|
1247
|
-
// do not use box values types (i.e. Number(), String(), etc.)
|
|
1248
|
-
|
|
1249
|
-
var reverseKeywords = {};
|
|
1250
|
-
for (var key in cssKeywords) {
|
|
1251
|
-
if (cssKeywords.hasOwnProperty(key)) {
|
|
1252
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
var convert = conversions.exports = {
|
|
1256
|
-
rgb: {
|
|
1257
|
-
channels: 3,
|
|
1258
|
-
labels: 'rgb'
|
|
1259
|
-
},
|
|
1260
|
-
hsl: {
|
|
1261
|
-
channels: 3,
|
|
1262
|
-
labels: 'hsl'
|
|
1263
|
-
},
|
|
1264
|
-
hsv: {
|
|
1265
|
-
channels: 3,
|
|
1266
|
-
labels: 'hsv'
|
|
1267
|
-
},
|
|
1268
|
-
hwb: {
|
|
1269
|
-
channels: 3,
|
|
1270
|
-
labels: 'hwb'
|
|
1271
|
-
},
|
|
1272
|
-
cmyk: {
|
|
1273
|
-
channels: 4,
|
|
1274
|
-
labels: 'cmyk'
|
|
1275
|
-
},
|
|
1276
|
-
xyz: {
|
|
1277
|
-
channels: 3,
|
|
1278
|
-
labels: 'xyz'
|
|
1279
|
-
},
|
|
1280
|
-
lab: {
|
|
1281
|
-
channels: 3,
|
|
1282
|
-
labels: 'lab'
|
|
1283
|
-
},
|
|
1284
|
-
lch: {
|
|
1285
|
-
channels: 3,
|
|
1286
|
-
labels: 'lch'
|
|
1287
|
-
},
|
|
1288
|
-
hex: {
|
|
1289
|
-
channels: 1,
|
|
1290
|
-
labels: ['hex']
|
|
1291
|
-
},
|
|
1292
|
-
keyword: {
|
|
1293
|
-
channels: 1,
|
|
1294
|
-
labels: ['keyword']
|
|
1295
|
-
},
|
|
1296
|
-
ansi16: {
|
|
1297
|
-
channels: 1,
|
|
1298
|
-
labels: ['ansi16']
|
|
1299
|
-
},
|
|
1300
|
-
ansi256: {
|
|
1301
|
-
channels: 1,
|
|
1302
|
-
labels: ['ansi256']
|
|
1303
|
-
},
|
|
1304
|
-
hcg: {
|
|
1305
|
-
channels: 3,
|
|
1306
|
-
labels: ['h', 'c', 'g']
|
|
1307
|
-
},
|
|
1308
|
-
apple: {
|
|
1309
|
-
channels: 3,
|
|
1310
|
-
labels: ['r16', 'g16', 'b16']
|
|
1311
|
-
},
|
|
1312
|
-
gray: {
|
|
1313
|
-
channels: 1,
|
|
1314
|
-
labels: ['gray']
|
|
1315
|
-
}
|
|
1316
|
-
};
|
|
1317
|
-
|
|
1318
|
-
// hide .channels and .labels properties
|
|
1319
|
-
for (var model in convert) {
|
|
1320
|
-
if (convert.hasOwnProperty(model)) {
|
|
1321
|
-
if (!('channels' in convert[model])) {
|
|
1322
|
-
throw new Error('missing channels property: ' + model);
|
|
1323
|
-
}
|
|
1324
|
-
if (!('labels' in convert[model])) {
|
|
1325
|
-
throw new Error('missing channel labels property: ' + model);
|
|
1326
|
-
}
|
|
1327
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
1328
|
-
throw new Error('channel and label counts mismatch: ' + model);
|
|
1329
|
-
}
|
|
1330
|
-
var channels = convert[model].channels;
|
|
1331
|
-
var labels = convert[model].labels;
|
|
1332
|
-
delete convert[model].channels;
|
|
1333
|
-
delete convert[model].labels;
|
|
1334
|
-
Object.defineProperty(convert[model], 'channels', {
|
|
1335
|
-
value: channels
|
|
1336
|
-
});
|
|
1337
|
-
Object.defineProperty(convert[model], 'labels', {
|
|
1338
|
-
value: labels
|
|
1339
|
-
});
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
convert.rgb.hsl = function (rgb) {
|
|
1343
|
-
var r = rgb[0] / 255;
|
|
1344
|
-
var g = rgb[1] / 255;
|
|
1345
|
-
var b = rgb[2] / 255;
|
|
1346
|
-
var min = Math.min(r, g, b);
|
|
1347
|
-
var max = Math.max(r, g, b);
|
|
1348
|
-
var delta = max - min;
|
|
1349
|
-
var h;
|
|
1350
|
-
var s;
|
|
1351
|
-
var l;
|
|
1352
|
-
if (max === min) {
|
|
1353
|
-
h = 0;
|
|
1354
|
-
} else if (r === max) {
|
|
1355
|
-
h = (g - b) / delta;
|
|
1356
|
-
} else if (g === max) {
|
|
1357
|
-
h = 2 + (b - r) / delta;
|
|
1358
|
-
} else if (b === max) {
|
|
1359
|
-
h = 4 + (r - g) / delta;
|
|
1360
|
-
}
|
|
1361
|
-
h = Math.min(h * 60, 360);
|
|
1362
|
-
if (h < 0) {
|
|
1363
|
-
h += 360;
|
|
1364
|
-
}
|
|
1365
|
-
l = (min + max) / 2;
|
|
1366
|
-
if (max === min) {
|
|
1367
|
-
s = 0;
|
|
1368
|
-
} else if (l <= 0.5) {
|
|
1369
|
-
s = delta / (max + min);
|
|
1370
|
-
} else {
|
|
1371
|
-
s = delta / (2 - max - min);
|
|
1372
|
-
}
|
|
1373
|
-
return [h, s * 100, l * 100];
|
|
1374
|
-
};
|
|
1375
|
-
convert.rgb.hsv = function (rgb) {
|
|
1376
|
-
var rdif;
|
|
1377
|
-
var gdif;
|
|
1378
|
-
var bdif;
|
|
1379
|
-
var h;
|
|
1380
|
-
var s;
|
|
1381
|
-
var r = rgb[0] / 255;
|
|
1382
|
-
var g = rgb[1] / 255;
|
|
1383
|
-
var b = rgb[2] / 255;
|
|
1384
|
-
var v = Math.max(r, g, b);
|
|
1385
|
-
var diff = v - Math.min(r, g, b);
|
|
1386
|
-
var diffc = function (c) {
|
|
1387
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
1388
|
-
};
|
|
1389
|
-
if (diff === 0) {
|
|
1390
|
-
h = s = 0;
|
|
1391
|
-
} else {
|
|
1392
|
-
s = diff / v;
|
|
1393
|
-
rdif = diffc(r);
|
|
1394
|
-
gdif = diffc(g);
|
|
1395
|
-
bdif = diffc(b);
|
|
1396
|
-
if (r === v) {
|
|
1397
|
-
h = bdif - gdif;
|
|
1398
|
-
} else if (g === v) {
|
|
1399
|
-
h = 1 / 3 + rdif - bdif;
|
|
1400
|
-
} else if (b === v) {
|
|
1401
|
-
h = 2 / 3 + gdif - rdif;
|
|
1402
|
-
}
|
|
1403
|
-
if (h < 0) {
|
|
1404
|
-
h += 1;
|
|
1405
|
-
} else if (h > 1) {
|
|
1406
|
-
h -= 1;
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
return [h * 360, s * 100, v * 100];
|
|
1410
|
-
};
|
|
1411
|
-
convert.rgb.hwb = function (rgb) {
|
|
1412
|
-
var r = rgb[0];
|
|
1413
|
-
var g = rgb[1];
|
|
1414
|
-
var b = rgb[2];
|
|
1415
|
-
var h = convert.rgb.hsl(rgb)[0];
|
|
1416
|
-
var w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
1417
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
1418
|
-
return [h, w * 100, b * 100];
|
|
1419
|
-
};
|
|
1420
|
-
convert.rgb.cmyk = function (rgb) {
|
|
1421
|
-
var r = rgb[0] / 255;
|
|
1422
|
-
var g = rgb[1] / 255;
|
|
1423
|
-
var b = rgb[2] / 255;
|
|
1424
|
-
var c;
|
|
1425
|
-
var m;
|
|
1426
|
-
var y;
|
|
1427
|
-
var k;
|
|
1428
|
-
k = Math.min(1 - r, 1 - g, 1 - b);
|
|
1429
|
-
c = (1 - r - k) / (1 - k) || 0;
|
|
1430
|
-
m = (1 - g - k) / (1 - k) || 0;
|
|
1431
|
-
y = (1 - b - k) / (1 - k) || 0;
|
|
1432
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
|
1433
|
-
};
|
|
1434
|
-
|
|
1435
|
-
/**
|
|
1436
|
-
* See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
|
|
1437
|
-
* */
|
|
1438
|
-
function comparativeDistance(x, y) {
|
|
1439
|
-
return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);
|
|
1440
|
-
}
|
|
1441
|
-
convert.rgb.keyword = function (rgb) {
|
|
1442
|
-
var reversed = reverseKeywords[rgb];
|
|
1443
|
-
if (reversed) {
|
|
1444
|
-
return reversed;
|
|
1445
|
-
}
|
|
1446
|
-
var currentClosestDistance = Infinity;
|
|
1447
|
-
var currentClosestKeyword;
|
|
1448
|
-
for (var keyword in cssKeywords) {
|
|
1449
|
-
if (cssKeywords.hasOwnProperty(keyword)) {
|
|
1450
|
-
var value = cssKeywords[keyword];
|
|
1451
|
-
|
|
1452
|
-
// Compute comparative distance
|
|
1453
|
-
var distance = comparativeDistance(rgb, value);
|
|
1454
|
-
|
|
1455
|
-
// Check if its less, if so set as closest
|
|
1456
|
-
if (distance < currentClosestDistance) {
|
|
1457
|
-
currentClosestDistance = distance;
|
|
1458
|
-
currentClosestKeyword = keyword;
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
return currentClosestKeyword;
|
|
1463
|
-
};
|
|
1464
|
-
convert.keyword.rgb = function (keyword) {
|
|
1465
|
-
return cssKeywords[keyword];
|
|
1466
|
-
};
|
|
1467
|
-
convert.rgb.xyz = function (rgb) {
|
|
1468
|
-
var r = rgb[0] / 255;
|
|
1469
|
-
var g = rgb[1] / 255;
|
|
1470
|
-
var b = rgb[2] / 255;
|
|
1471
|
-
|
|
1472
|
-
// assume sRGB
|
|
1473
|
-
r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
|
|
1474
|
-
g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
|
|
1475
|
-
b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
|
|
1476
|
-
var x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
1477
|
-
var y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
1478
|
-
var z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
1479
|
-
return [x * 100, y * 100, z * 100];
|
|
1480
|
-
};
|
|
1481
|
-
convert.rgb.lab = function (rgb) {
|
|
1482
|
-
var xyz = convert.rgb.xyz(rgb);
|
|
1483
|
-
var x = xyz[0];
|
|
1484
|
-
var y = xyz[1];
|
|
1485
|
-
var z = xyz[2];
|
|
1486
|
-
var l;
|
|
1487
|
-
var a;
|
|
1488
|
-
var b;
|
|
1489
|
-
x /= 95.047;
|
|
1490
|
-
y /= 100;
|
|
1491
|
-
z /= 108.883;
|
|
1492
|
-
x = x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
1493
|
-
y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
|
|
1494
|
-
z = z > 0.008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
|
|
1495
|
-
l = 116 * y - 16;
|
|
1496
|
-
a = 500 * (x - y);
|
|
1497
|
-
b = 200 * (y - z);
|
|
1498
|
-
return [l, a, b];
|
|
1499
|
-
};
|
|
1500
|
-
convert.hsl.rgb = function (hsl) {
|
|
1501
|
-
var h = hsl[0] / 360;
|
|
1502
|
-
var s = hsl[1] / 100;
|
|
1503
|
-
var l = hsl[2] / 100;
|
|
1504
|
-
var t1;
|
|
1505
|
-
var t2;
|
|
1506
|
-
var t3;
|
|
1507
|
-
var rgb;
|
|
1508
|
-
var val;
|
|
1509
|
-
if (s === 0) {
|
|
1510
|
-
val = l * 255;
|
|
1511
|
-
return [val, val, val];
|
|
1512
|
-
}
|
|
1513
|
-
if (l < 0.5) {
|
|
1514
|
-
t2 = l * (1 + s);
|
|
1515
|
-
} else {
|
|
1516
|
-
t2 = l + s - l * s;
|
|
1517
|
-
}
|
|
1518
|
-
t1 = 2 * l - t2;
|
|
1519
|
-
rgb = [0, 0, 0];
|
|
1520
|
-
for (var i = 0; i < 3; i++) {
|
|
1521
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
1522
|
-
if (t3 < 0) {
|
|
1523
|
-
t3++;
|
|
1524
|
-
}
|
|
1525
|
-
if (t3 > 1) {
|
|
1526
|
-
t3--;
|
|
1527
|
-
}
|
|
1528
|
-
if (6 * t3 < 1) {
|
|
1529
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
1530
|
-
} else if (2 * t3 < 1) {
|
|
1531
|
-
val = t2;
|
|
1532
|
-
} else if (3 * t3 < 2) {
|
|
1533
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
1534
|
-
} else {
|
|
1535
|
-
val = t1;
|
|
1536
|
-
}
|
|
1537
|
-
rgb[i] = val * 255;
|
|
1538
|
-
}
|
|
1539
|
-
return rgb;
|
|
1540
|
-
};
|
|
1541
|
-
convert.hsl.hsv = function (hsl) {
|
|
1542
|
-
var h = hsl[0];
|
|
1543
|
-
var s = hsl[1] / 100;
|
|
1544
|
-
var l = hsl[2] / 100;
|
|
1545
|
-
var smin = s;
|
|
1546
|
-
var lmin = Math.max(l, 0.01);
|
|
1547
|
-
var sv;
|
|
1548
|
-
var v;
|
|
1549
|
-
l *= 2;
|
|
1550
|
-
s *= l <= 1 ? l : 2 - l;
|
|
1551
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
1552
|
-
v = (l + s) / 2;
|
|
1553
|
-
sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
1554
|
-
return [h, sv * 100, v * 100];
|
|
1555
|
-
};
|
|
1556
|
-
convert.hsv.rgb = function (hsv) {
|
|
1557
|
-
var h = hsv[0] / 60;
|
|
1558
|
-
var s = hsv[1] / 100;
|
|
1559
|
-
var v = hsv[2] / 100;
|
|
1560
|
-
var hi = Math.floor(h) % 6;
|
|
1561
|
-
var f = h - Math.floor(h);
|
|
1562
|
-
var p = 255 * v * (1 - s);
|
|
1563
|
-
var q = 255 * v * (1 - s * f);
|
|
1564
|
-
var t = 255 * v * (1 - s * (1 - f));
|
|
1565
|
-
v *= 255;
|
|
1566
|
-
switch (hi) {
|
|
1567
|
-
case 0:
|
|
1568
|
-
return [v, t, p];
|
|
1569
|
-
case 1:
|
|
1570
|
-
return [q, v, p];
|
|
1571
|
-
case 2:
|
|
1572
|
-
return [p, v, t];
|
|
1573
|
-
case 3:
|
|
1574
|
-
return [p, q, v];
|
|
1575
|
-
case 4:
|
|
1576
|
-
return [t, p, v];
|
|
1577
|
-
case 5:
|
|
1578
|
-
return [v, p, q];
|
|
1579
|
-
}
|
|
1580
|
-
};
|
|
1581
|
-
convert.hsv.hsl = function (hsv) {
|
|
1582
|
-
var h = hsv[0];
|
|
1583
|
-
var s = hsv[1] / 100;
|
|
1584
|
-
var v = hsv[2] / 100;
|
|
1585
|
-
var vmin = Math.max(v, 0.01);
|
|
1586
|
-
var lmin;
|
|
1587
|
-
var sl;
|
|
1588
|
-
var l;
|
|
1589
|
-
l = (2 - s) * v;
|
|
1590
|
-
lmin = (2 - s) * vmin;
|
|
1591
|
-
sl = s * vmin;
|
|
1592
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
1593
|
-
sl = sl || 0;
|
|
1594
|
-
l /= 2;
|
|
1595
|
-
return [h, sl * 100, l * 100];
|
|
1596
|
-
};
|
|
1597
|
-
|
|
1598
|
-
// http://dev.w3.org/csswg/css-color/#hwb-to-rgb
|
|
1599
|
-
convert.hwb.rgb = function (hwb) {
|
|
1600
|
-
var h = hwb[0] / 360;
|
|
1601
|
-
var wh = hwb[1] / 100;
|
|
1602
|
-
var bl = hwb[2] / 100;
|
|
1603
|
-
var ratio = wh + bl;
|
|
1604
|
-
var i;
|
|
1605
|
-
var v;
|
|
1606
|
-
var f;
|
|
1607
|
-
var n;
|
|
1608
|
-
|
|
1609
|
-
// wh + bl cant be > 1
|
|
1610
|
-
if (ratio > 1) {
|
|
1611
|
-
wh /= ratio;
|
|
1612
|
-
bl /= ratio;
|
|
1613
|
-
}
|
|
1614
|
-
i = Math.floor(6 * h);
|
|
1615
|
-
v = 1 - bl;
|
|
1616
|
-
f = 6 * h - i;
|
|
1617
|
-
if ((i & 0x01) !== 0) {
|
|
1618
|
-
f = 1 - f;
|
|
1619
|
-
}
|
|
1620
|
-
n = wh + f * (v - wh); // linear interpolation
|
|
1621
|
-
|
|
1622
|
-
var r;
|
|
1623
|
-
var g;
|
|
1624
|
-
var b;
|
|
1625
|
-
switch (i) {
|
|
1626
|
-
default:
|
|
1627
|
-
case 6:
|
|
1628
|
-
case 0:
|
|
1629
|
-
r = v;
|
|
1630
|
-
g = n;
|
|
1631
|
-
b = wh;
|
|
1632
|
-
break;
|
|
1633
|
-
case 1:
|
|
1634
|
-
r = n;
|
|
1635
|
-
g = v;
|
|
1636
|
-
b = wh;
|
|
1637
|
-
break;
|
|
1638
|
-
case 2:
|
|
1639
|
-
r = wh;
|
|
1640
|
-
g = v;
|
|
1641
|
-
b = n;
|
|
1642
|
-
break;
|
|
1643
|
-
case 3:
|
|
1644
|
-
r = wh;
|
|
1645
|
-
g = n;
|
|
1646
|
-
b = v;
|
|
1647
|
-
break;
|
|
1648
|
-
case 4:
|
|
1649
|
-
r = n;
|
|
1650
|
-
g = wh;
|
|
1651
|
-
b = v;
|
|
1652
|
-
break;
|
|
1653
|
-
case 5:
|
|
1654
|
-
r = v;
|
|
1655
|
-
g = wh;
|
|
1656
|
-
b = n;
|
|
1657
|
-
break;
|
|
1658
|
-
}
|
|
1659
|
-
return [r * 255, g * 255, b * 255];
|
|
1660
|
-
};
|
|
1661
|
-
convert.cmyk.rgb = function (cmyk) {
|
|
1662
|
-
var c = cmyk[0] / 100;
|
|
1663
|
-
var m = cmyk[1] / 100;
|
|
1664
|
-
var y = cmyk[2] / 100;
|
|
1665
|
-
var k = cmyk[3] / 100;
|
|
1666
|
-
var r;
|
|
1667
|
-
var g;
|
|
1668
|
-
var b;
|
|
1669
|
-
r = 1 - Math.min(1, c * (1 - k) + k);
|
|
1670
|
-
g = 1 - Math.min(1, m * (1 - k) + k);
|
|
1671
|
-
b = 1 - Math.min(1, y * (1 - k) + k);
|
|
1672
|
-
return [r * 255, g * 255, b * 255];
|
|
1673
|
-
};
|
|
1674
|
-
convert.xyz.rgb = function (xyz) {
|
|
1675
|
-
var x = xyz[0] / 100;
|
|
1676
|
-
var y = xyz[1] / 100;
|
|
1677
|
-
var z = xyz[2] / 100;
|
|
1678
|
-
var r;
|
|
1679
|
-
var g;
|
|
1680
|
-
var b;
|
|
1681
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
1682
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
1683
|
-
b = x * 0.0557 + y * -0.204 + z * 1.0570;
|
|
1684
|
-
|
|
1685
|
-
// assume sRGB
|
|
1686
|
-
r = r > 0.0031308 ? 1.055 * Math.pow(r, 1.0 / 2.4) - 0.055 : r * 12.92;
|
|
1687
|
-
g = g > 0.0031308 ? 1.055 * Math.pow(g, 1.0 / 2.4) - 0.055 : g * 12.92;
|
|
1688
|
-
b = b > 0.0031308 ? 1.055 * Math.pow(b, 1.0 / 2.4) - 0.055 : b * 12.92;
|
|
1689
|
-
r = Math.min(Math.max(0, r), 1);
|
|
1690
|
-
g = Math.min(Math.max(0, g), 1);
|
|
1691
|
-
b = Math.min(Math.max(0, b), 1);
|
|
1692
|
-
return [r * 255, g * 255, b * 255];
|
|
1693
|
-
};
|
|
1694
|
-
convert.xyz.lab = function (xyz) {
|
|
1695
|
-
var x = xyz[0];
|
|
1696
|
-
var y = xyz[1];
|
|
1697
|
-
var z = xyz[2];
|
|
1698
|
-
var l;
|
|
1699
|
-
var a;
|
|
1700
|
-
var b;
|
|
1701
|
-
x /= 95.047;
|
|
1702
|
-
y /= 100;
|
|
1703
|
-
z /= 108.883;
|
|
1704
|
-
x = x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
1705
|
-
y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
|
|
1706
|
-
z = z > 0.008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
|
|
1707
|
-
l = 116 * y - 16;
|
|
1708
|
-
a = 500 * (x - y);
|
|
1709
|
-
b = 200 * (y - z);
|
|
1710
|
-
return [l, a, b];
|
|
1711
|
-
};
|
|
1712
|
-
convert.lab.xyz = function (lab) {
|
|
1713
|
-
var l = lab[0];
|
|
1714
|
-
var a = lab[1];
|
|
1715
|
-
var b = lab[2];
|
|
1716
|
-
var x;
|
|
1717
|
-
var y;
|
|
1718
|
-
var z;
|
|
1719
|
-
y = (l + 16) / 116;
|
|
1720
|
-
x = a / 500 + y;
|
|
1721
|
-
z = y - b / 200;
|
|
1722
|
-
var y2 = Math.pow(y, 3);
|
|
1723
|
-
var x2 = Math.pow(x, 3);
|
|
1724
|
-
var z2 = Math.pow(z, 3);
|
|
1725
|
-
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
1726
|
-
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
1727
|
-
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
1728
|
-
x *= 95.047;
|
|
1729
|
-
y *= 100;
|
|
1730
|
-
z *= 108.883;
|
|
1731
|
-
return [x, y, z];
|
|
1732
|
-
};
|
|
1733
|
-
convert.lab.lch = function (lab) {
|
|
1734
|
-
var l = lab[0];
|
|
1735
|
-
var a = lab[1];
|
|
1736
|
-
var b = lab[2];
|
|
1737
|
-
var hr;
|
|
1738
|
-
var h;
|
|
1739
|
-
var c;
|
|
1740
|
-
hr = Math.atan2(b, a);
|
|
1741
|
-
h = hr * 360 / 2 / Math.PI;
|
|
1742
|
-
if (h < 0) {
|
|
1743
|
-
h += 360;
|
|
1744
|
-
}
|
|
1745
|
-
c = Math.sqrt(a * a + b * b);
|
|
1746
|
-
return [l, c, h];
|
|
1747
|
-
};
|
|
1748
|
-
convert.lch.lab = function (lch) {
|
|
1749
|
-
var l = lch[0];
|
|
1750
|
-
var c = lch[1];
|
|
1751
|
-
var h = lch[2];
|
|
1752
|
-
var a;
|
|
1753
|
-
var b;
|
|
1754
|
-
var hr;
|
|
1755
|
-
hr = h / 360 * 2 * Math.PI;
|
|
1756
|
-
a = c * Math.cos(hr);
|
|
1757
|
-
b = c * Math.sin(hr);
|
|
1758
|
-
return [l, a, b];
|
|
1759
|
-
};
|
|
1760
|
-
convert.rgb.ansi16 = function (args) {
|
|
1761
|
-
var r = args[0];
|
|
1762
|
-
var g = args[1];
|
|
1763
|
-
var b = args[2];
|
|
1764
|
-
var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
|
|
1765
|
-
|
|
1766
|
-
value = Math.round(value / 50);
|
|
1767
|
-
if (value === 0) {
|
|
1768
|
-
return 30;
|
|
1769
|
-
}
|
|
1770
|
-
var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
1771
|
-
if (value === 2) {
|
|
1772
|
-
ansi += 60;
|
|
1773
|
-
}
|
|
1774
|
-
return ansi;
|
|
1775
|
-
};
|
|
1776
|
-
convert.hsv.ansi16 = function (args) {
|
|
1777
|
-
// optimization here; we already know the value and don't need to get
|
|
1778
|
-
// it converted for us.
|
|
1779
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
1780
|
-
};
|
|
1781
|
-
convert.rgb.ansi256 = function (args) {
|
|
1782
|
-
var r = args[0];
|
|
1783
|
-
var g = args[1];
|
|
1784
|
-
var b = args[2];
|
|
1785
|
-
|
|
1786
|
-
// we use the extended greyscale palette here, with the exception of
|
|
1787
|
-
// black and white. normal palette only has 4 greyscale shades.
|
|
1788
|
-
if (r === g && g === b) {
|
|
1789
|
-
if (r < 8) {
|
|
1790
|
-
return 16;
|
|
1791
|
-
}
|
|
1792
|
-
if (r > 248) {
|
|
1793
|
-
return 231;
|
|
1794
|
-
}
|
|
1795
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
1796
|
-
}
|
|
1797
|
-
var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
1798
|
-
return ansi;
|
|
1799
|
-
};
|
|
1800
|
-
convert.ansi16.rgb = function (args) {
|
|
1801
|
-
var color = args % 10;
|
|
1802
|
-
|
|
1803
|
-
// handle greyscale
|
|
1804
|
-
if (color === 0 || color === 7) {
|
|
1805
|
-
if (args > 50) {
|
|
1806
|
-
color += 3.5;
|
|
1807
|
-
}
|
|
1808
|
-
color = color / 10.5 * 255;
|
|
1809
|
-
return [color, color, color];
|
|
1810
|
-
}
|
|
1811
|
-
var mult = (~~(args > 50) + 1) * 0.5;
|
|
1812
|
-
var r = (color & 1) * mult * 255;
|
|
1813
|
-
var g = (color >> 1 & 1) * mult * 255;
|
|
1814
|
-
var b = (color >> 2 & 1) * mult * 255;
|
|
1815
|
-
return [r, g, b];
|
|
1816
|
-
};
|
|
1817
|
-
convert.ansi256.rgb = function (args) {
|
|
1818
|
-
// handle greyscale
|
|
1819
|
-
if (args >= 232) {
|
|
1820
|
-
var c = (args - 232) * 10 + 8;
|
|
1821
|
-
return [c, c, c];
|
|
1822
|
-
}
|
|
1823
|
-
args -= 16;
|
|
1824
|
-
var rem;
|
|
1825
|
-
var r = Math.floor(args / 36) / 5 * 255;
|
|
1826
|
-
var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
1827
|
-
var b = rem % 6 / 5 * 255;
|
|
1828
|
-
return [r, g, b];
|
|
1829
|
-
};
|
|
1830
|
-
convert.rgb.hex = function (args) {
|
|
1831
|
-
var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF);
|
|
1832
|
-
var string = integer.toString(16).toUpperCase();
|
|
1833
|
-
return '000000'.substring(string.length) + string;
|
|
1834
|
-
};
|
|
1835
|
-
convert.hex.rgb = function (args) {
|
|
1836
|
-
var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
1837
|
-
if (!match) {
|
|
1838
|
-
return [0, 0, 0];
|
|
1839
|
-
}
|
|
1840
|
-
var colorString = match[0];
|
|
1841
|
-
if (match[0].length === 3) {
|
|
1842
|
-
colorString = colorString.split('').map(function (char) {
|
|
1843
|
-
return char + char;
|
|
1844
|
-
}).join('');
|
|
1845
|
-
}
|
|
1846
|
-
var integer = parseInt(colorString, 16);
|
|
1847
|
-
var r = integer >> 16 & 0xFF;
|
|
1848
|
-
var g = integer >> 8 & 0xFF;
|
|
1849
|
-
var b = integer & 0xFF;
|
|
1850
|
-
return [r, g, b];
|
|
1851
|
-
};
|
|
1852
|
-
convert.rgb.hcg = function (rgb) {
|
|
1853
|
-
var r = rgb[0] / 255;
|
|
1854
|
-
var g = rgb[1] / 255;
|
|
1855
|
-
var b = rgb[2] / 255;
|
|
1856
|
-
var max = Math.max(Math.max(r, g), b);
|
|
1857
|
-
var min = Math.min(Math.min(r, g), b);
|
|
1858
|
-
var chroma = max - min;
|
|
1859
|
-
var grayscale;
|
|
1860
|
-
var hue;
|
|
1861
|
-
if (chroma < 1) {
|
|
1862
|
-
grayscale = min / (1 - chroma);
|
|
1863
|
-
} else {
|
|
1864
|
-
grayscale = 0;
|
|
1865
|
-
}
|
|
1866
|
-
if (chroma <= 0) {
|
|
1867
|
-
hue = 0;
|
|
1868
|
-
} else if (max === r) {
|
|
1869
|
-
hue = (g - b) / chroma % 6;
|
|
1870
|
-
} else if (max === g) {
|
|
1871
|
-
hue = 2 + (b - r) / chroma;
|
|
1872
|
-
} else {
|
|
1873
|
-
hue = 4 + (r - g) / chroma + 4;
|
|
1874
|
-
}
|
|
1875
|
-
hue /= 6;
|
|
1876
|
-
hue %= 1;
|
|
1877
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
1878
|
-
};
|
|
1879
|
-
convert.hsl.hcg = function (hsl) {
|
|
1880
|
-
var s = hsl[1] / 100;
|
|
1881
|
-
var l = hsl[2] / 100;
|
|
1882
|
-
var c = 1;
|
|
1883
|
-
var f = 0;
|
|
1884
|
-
if (l < 0.5) {
|
|
1885
|
-
c = 2.0 * s * l;
|
|
1886
|
-
} else {
|
|
1887
|
-
c = 2.0 * s * (1.0 - l);
|
|
1888
|
-
}
|
|
1889
|
-
if (c < 1.0) {
|
|
1890
|
-
f = (l - 0.5 * c) / (1.0 - c);
|
|
1891
|
-
}
|
|
1892
|
-
return [hsl[0], c * 100, f * 100];
|
|
1893
|
-
};
|
|
1894
|
-
convert.hsv.hcg = function (hsv) {
|
|
1895
|
-
var s = hsv[1] / 100;
|
|
1896
|
-
var v = hsv[2] / 100;
|
|
1897
|
-
var c = s * v;
|
|
1898
|
-
var f = 0;
|
|
1899
|
-
if (c < 1.0) {
|
|
1900
|
-
f = (v - c) / (1 - c);
|
|
1901
|
-
}
|
|
1902
|
-
return [hsv[0], c * 100, f * 100];
|
|
1903
|
-
};
|
|
1904
|
-
convert.hcg.rgb = function (hcg) {
|
|
1905
|
-
var h = hcg[0] / 360;
|
|
1906
|
-
var c = hcg[1] / 100;
|
|
1907
|
-
var g = hcg[2] / 100;
|
|
1908
|
-
if (c === 0.0) {
|
|
1909
|
-
return [g * 255, g * 255, g * 255];
|
|
1910
|
-
}
|
|
1911
|
-
var pure = [0, 0, 0];
|
|
1912
|
-
var hi = h % 1 * 6;
|
|
1913
|
-
var v = hi % 1;
|
|
1914
|
-
var w = 1 - v;
|
|
1915
|
-
var mg = 0;
|
|
1916
|
-
switch (Math.floor(hi)) {
|
|
1917
|
-
case 0:
|
|
1918
|
-
pure[0] = 1;
|
|
1919
|
-
pure[1] = v;
|
|
1920
|
-
pure[2] = 0;
|
|
1921
|
-
break;
|
|
1922
|
-
case 1:
|
|
1923
|
-
pure[0] = w;
|
|
1924
|
-
pure[1] = 1;
|
|
1925
|
-
pure[2] = 0;
|
|
1926
|
-
break;
|
|
1927
|
-
case 2:
|
|
1928
|
-
pure[0] = 0;
|
|
1929
|
-
pure[1] = 1;
|
|
1930
|
-
pure[2] = v;
|
|
1931
|
-
break;
|
|
1932
|
-
case 3:
|
|
1933
|
-
pure[0] = 0;
|
|
1934
|
-
pure[1] = w;
|
|
1935
|
-
pure[2] = 1;
|
|
1936
|
-
break;
|
|
1937
|
-
case 4:
|
|
1938
|
-
pure[0] = v;
|
|
1939
|
-
pure[1] = 0;
|
|
1940
|
-
pure[2] = 1;
|
|
1941
|
-
break;
|
|
1942
|
-
default:
|
|
1943
|
-
pure[0] = 1;
|
|
1944
|
-
pure[1] = 0;
|
|
1945
|
-
pure[2] = w;
|
|
1946
|
-
}
|
|
1947
|
-
mg = (1.0 - c) * g;
|
|
1948
|
-
return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
|
|
1949
|
-
};
|
|
1950
|
-
convert.hcg.hsv = function (hcg) {
|
|
1951
|
-
var c = hcg[1] / 100;
|
|
1952
|
-
var g = hcg[2] / 100;
|
|
1953
|
-
var v = c + g * (1.0 - c);
|
|
1954
|
-
var f = 0;
|
|
1955
|
-
if (v > 0.0) {
|
|
1956
|
-
f = c / v;
|
|
1957
|
-
}
|
|
1958
|
-
return [hcg[0], f * 100, v * 100];
|
|
1959
|
-
};
|
|
1960
|
-
convert.hcg.hsl = function (hcg) {
|
|
1961
|
-
var c = hcg[1] / 100;
|
|
1962
|
-
var g = hcg[2] / 100;
|
|
1963
|
-
var l = g * (1.0 - c) + 0.5 * c;
|
|
1964
|
-
var s = 0;
|
|
1965
|
-
if (l > 0.0 && l < 0.5) {
|
|
1966
|
-
s = c / (2 * l);
|
|
1967
|
-
} else if (l >= 0.5 && l < 1.0) {
|
|
1968
|
-
s = c / (2 * (1 - l));
|
|
1969
|
-
}
|
|
1970
|
-
return [hcg[0], s * 100, l * 100];
|
|
1971
|
-
};
|
|
1972
|
-
convert.hcg.hwb = function (hcg) {
|
|
1973
|
-
var c = hcg[1] / 100;
|
|
1974
|
-
var g = hcg[2] / 100;
|
|
1975
|
-
var v = c + g * (1.0 - c);
|
|
1976
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
1977
|
-
};
|
|
1978
|
-
convert.hwb.hcg = function (hwb) {
|
|
1979
|
-
var w = hwb[1] / 100;
|
|
1980
|
-
var b = hwb[2] / 100;
|
|
1981
|
-
var v = 1 - b;
|
|
1982
|
-
var c = v - w;
|
|
1983
|
-
var g = 0;
|
|
1984
|
-
if (c < 1) {
|
|
1985
|
-
g = (v - c) / (1 - c);
|
|
1986
|
-
}
|
|
1987
|
-
return [hwb[0], c * 100, g * 100];
|
|
1988
|
-
};
|
|
1989
|
-
convert.apple.rgb = function (apple) {
|
|
1990
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
1991
|
-
};
|
|
1992
|
-
convert.rgb.apple = function (rgb) {
|
|
1993
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
1994
|
-
};
|
|
1995
|
-
convert.gray.rgb = function (args) {
|
|
1996
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
1997
|
-
};
|
|
1998
|
-
convert.gray.hsl = convert.gray.hsv = function (args) {
|
|
1999
|
-
return [0, 0, args[0]];
|
|
2000
|
-
};
|
|
2001
|
-
convert.gray.hwb = function (gray) {
|
|
2002
|
-
return [0, 100, gray[0]];
|
|
2003
|
-
};
|
|
2004
|
-
convert.gray.cmyk = function (gray) {
|
|
2005
|
-
return [0, 0, 0, gray[0]];
|
|
2006
|
-
};
|
|
2007
|
-
convert.gray.lab = function (gray) {
|
|
2008
|
-
return [gray[0], 0, 0];
|
|
2009
|
-
};
|
|
2010
|
-
convert.gray.hex = function (gray) {
|
|
2011
|
-
var val = Math.round(gray[0] / 100 * 255) & 0xFF;
|
|
2012
|
-
var integer = (val << 16) + (val << 8) + val;
|
|
2013
|
-
var string = integer.toString(16).toUpperCase();
|
|
2014
|
-
return '000000'.substring(string.length) + string;
|
|
2015
|
-
};
|
|
2016
|
-
convert.rgb.gray = function (rgb) {
|
|
2017
|
-
var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
2018
|
-
return [val / 255 * 100];
|
|
2019
|
-
};
|
|
2020
|
-
return conversions.exports;
|
|
2021
|
-
}
|
|
2022
|
-
var route;
|
|
2023
|
-
var hasRequiredRoute;
|
|
2024
|
-
function requireRoute() {
|
|
2025
|
-
if (hasRequiredRoute) return route;
|
|
2026
|
-
hasRequiredRoute = 1;
|
|
2027
|
-
var conversions = requireConversions();
|
|
2028
|
-
|
|
2029
|
-
/*
|
|
2030
|
-
this function routes a model to all other models.
|
|
2031
|
-
all functions that are routed have a property `.conversion` attached
|
|
2032
|
-
to the returned synthetic function. This property is an array
|
|
2033
|
-
of strings, each with the steps in between the 'from' and 'to'
|
|
2034
|
-
color models (inclusive).
|
|
2035
|
-
conversions that are not possible simply are not included.
|
|
2036
|
-
*/
|
|
2037
|
-
|
|
2038
|
-
function buildGraph() {
|
|
2039
|
-
var graph = {};
|
|
2040
|
-
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
|
2041
|
-
var models = Object.keys(conversions);
|
|
2042
|
-
for (var len = models.length, i = 0; i < len; i++) {
|
|
2043
|
-
graph[models[i]] = {
|
|
2044
|
-
// http://jsperf.com/1-vs-infinity
|
|
2045
|
-
// micro-opt, but this is simple.
|
|
2046
|
-
distance: -1,
|
|
2047
|
-
parent: null
|
|
2048
|
-
};
|
|
2049
|
-
}
|
|
2050
|
-
return graph;
|
|
2051
|
-
}
|
|
2052
|
-
|
|
2053
|
-
// https://en.wikipedia.org/wiki/Breadth-first_search
|
|
2054
|
-
function deriveBFS(fromModel) {
|
|
2055
|
-
var graph = buildGraph();
|
|
2056
|
-
var queue = [fromModel]; // unshift -> queue -> pop
|
|
2057
|
-
|
|
2058
|
-
graph[fromModel].distance = 0;
|
|
2059
|
-
while (queue.length) {
|
|
2060
|
-
var current = queue.pop();
|
|
2061
|
-
var adjacents = Object.keys(conversions[current]);
|
|
2062
|
-
for (var len = adjacents.length, i = 0; i < len; i++) {
|
|
2063
|
-
var adjacent = adjacents[i];
|
|
2064
|
-
var node = graph[adjacent];
|
|
2065
|
-
if (node.distance === -1) {
|
|
2066
|
-
node.distance = graph[current].distance + 1;
|
|
2067
|
-
node.parent = current;
|
|
2068
|
-
queue.unshift(adjacent);
|
|
2069
|
-
}
|
|
2070
|
-
}
|
|
2071
|
-
}
|
|
2072
|
-
return graph;
|
|
2073
|
-
}
|
|
2074
|
-
function link(from, to) {
|
|
2075
|
-
return function (args) {
|
|
2076
|
-
return to(from(args));
|
|
2077
|
-
};
|
|
2078
|
-
}
|
|
2079
|
-
function wrapConversion(toModel, graph) {
|
|
2080
|
-
var path = [graph[toModel].parent, toModel];
|
|
2081
|
-
var fn = conversions[graph[toModel].parent][toModel];
|
|
2082
|
-
var cur = graph[toModel].parent;
|
|
2083
|
-
while (graph[cur].parent) {
|
|
2084
|
-
path.unshift(graph[cur].parent);
|
|
2085
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
2086
|
-
cur = graph[cur].parent;
|
|
2087
|
-
}
|
|
2088
|
-
fn.conversion = path;
|
|
2089
|
-
return fn;
|
|
2090
|
-
}
|
|
2091
|
-
route = function (fromModel) {
|
|
2092
|
-
var graph = deriveBFS(fromModel);
|
|
2093
|
-
var conversion = {};
|
|
2094
|
-
var models = Object.keys(graph);
|
|
2095
|
-
for (var len = models.length, i = 0; i < len; i++) {
|
|
2096
|
-
var toModel = models[i];
|
|
2097
|
-
var node = graph[toModel];
|
|
2098
|
-
if (node.parent === null) {
|
|
2099
|
-
// no possible conversion, or this node is the source model.
|
|
2100
|
-
continue;
|
|
2101
|
-
}
|
|
2102
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
2103
|
-
}
|
|
2104
|
-
return conversion;
|
|
2105
|
-
};
|
|
2106
|
-
return route;
|
|
2107
|
-
}
|
|
2108
|
-
var colorConvert;
|
|
2109
|
-
var hasRequiredColorConvert;
|
|
2110
|
-
function requireColorConvert() {
|
|
2111
|
-
if (hasRequiredColorConvert) return colorConvert;
|
|
2112
|
-
hasRequiredColorConvert = 1;
|
|
2113
|
-
var conversions = requireConversions();
|
|
2114
|
-
var route = requireRoute();
|
|
2115
|
-
var convert = {};
|
|
2116
|
-
var models = Object.keys(conversions);
|
|
2117
|
-
function wrapRaw(fn) {
|
|
2118
|
-
var wrappedFn = function (args) {
|
|
2119
|
-
if (args === undefined || args === null) {
|
|
2120
|
-
return args;
|
|
2121
|
-
}
|
|
2122
|
-
if (arguments.length > 1) {
|
|
2123
|
-
args = Array.prototype.slice.call(arguments);
|
|
2124
|
-
}
|
|
2125
|
-
return fn(args);
|
|
2126
|
-
};
|
|
2127
|
-
|
|
2128
|
-
// preserve .conversion property if there is one
|
|
2129
|
-
if ('conversion' in fn) {
|
|
2130
|
-
wrappedFn.conversion = fn.conversion;
|
|
2131
|
-
}
|
|
2132
|
-
return wrappedFn;
|
|
2133
|
-
}
|
|
2134
|
-
function wrapRounded(fn) {
|
|
2135
|
-
var wrappedFn = function (args) {
|
|
2136
|
-
if (args === undefined || args === null) {
|
|
2137
|
-
return args;
|
|
2138
|
-
}
|
|
2139
|
-
if (arguments.length > 1) {
|
|
2140
|
-
args = Array.prototype.slice.call(arguments);
|
|
2141
|
-
}
|
|
2142
|
-
var result = fn(args);
|
|
2143
|
-
|
|
2144
|
-
// we're assuming the result is an array here.
|
|
2145
|
-
// see notice in conversions.js; don't use box types
|
|
2146
|
-
// in conversion functions.
|
|
2147
|
-
if (typeof result === 'object') {
|
|
2148
|
-
for (var len = result.length, i = 0; i < len; i++) {
|
|
2149
|
-
result[i] = Math.round(result[i]);
|
|
2150
|
-
}
|
|
2151
|
-
}
|
|
2152
|
-
return result;
|
|
2153
|
-
};
|
|
2154
|
-
|
|
2155
|
-
// preserve .conversion property if there is one
|
|
2156
|
-
if ('conversion' in fn) {
|
|
2157
|
-
wrappedFn.conversion = fn.conversion;
|
|
2158
|
-
}
|
|
2159
|
-
return wrappedFn;
|
|
2160
|
-
}
|
|
2161
|
-
models.forEach(function (fromModel) {
|
|
2162
|
-
convert[fromModel] = {};
|
|
2163
|
-
Object.defineProperty(convert[fromModel], 'channels', {
|
|
2164
|
-
value: conversions[fromModel].channels
|
|
2165
|
-
});
|
|
2166
|
-
Object.defineProperty(convert[fromModel], 'labels', {
|
|
2167
|
-
value: conversions[fromModel].labels
|
|
2168
|
-
});
|
|
2169
|
-
var routes = route(fromModel);
|
|
2170
|
-
var routeModels = Object.keys(routes);
|
|
2171
|
-
routeModels.forEach(function (toModel) {
|
|
2172
|
-
var fn = routes[toModel];
|
|
2173
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
2174
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
2175
|
-
});
|
|
2176
|
-
});
|
|
2177
|
-
colorConvert = convert;
|
|
2178
|
-
return colorConvert;
|
|
2179
|
-
}
|
|
2180
|
-
var hasRequiredAnsiStyles;
|
|
2181
|
-
function requireAnsiStyles() {
|
|
2182
|
-
if (hasRequiredAnsiStyles) return ansiStyles.exports;
|
|
2183
|
-
hasRequiredAnsiStyles = 1;
|
|
2184
|
-
(function (module) {
|
|
2185
|
-
const colorConvert = requireColorConvert();
|
|
2186
|
-
const wrapAnsi16 = (fn, offset) => function () {
|
|
2187
|
-
const code = fn.apply(colorConvert, arguments);
|
|
2188
|
-
return `\u001B[${code + offset}m`;
|
|
2189
|
-
};
|
|
2190
|
-
const wrapAnsi256 = (fn, offset) => function () {
|
|
2191
|
-
const code = fn.apply(colorConvert, arguments);
|
|
2192
|
-
return `\u001B[${38 + offset};5;${code}m`;
|
|
2193
|
-
};
|
|
2194
|
-
const wrapAnsi16m = (fn, offset) => function () {
|
|
2195
|
-
const rgb = fn.apply(colorConvert, arguments);
|
|
2196
|
-
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
2197
|
-
};
|
|
2198
|
-
function assembleStyles() {
|
|
2199
|
-
const codes = new Map();
|
|
2200
|
-
const styles = {
|
|
2201
|
-
modifier: {
|
|
2202
|
-
reset: [0, 0],
|
|
2203
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
2204
|
-
bold: [1, 22],
|
|
2205
|
-
dim: [2, 22],
|
|
2206
|
-
italic: [3, 23],
|
|
2207
|
-
underline: [4, 24],
|
|
2208
|
-
inverse: [7, 27],
|
|
2209
|
-
hidden: [8, 28],
|
|
2210
|
-
strikethrough: [9, 29]
|
|
2211
|
-
},
|
|
2212
|
-
color: {
|
|
2213
|
-
black: [30, 39],
|
|
2214
|
-
red: [31, 39],
|
|
2215
|
-
green: [32, 39],
|
|
2216
|
-
yellow: [33, 39],
|
|
2217
|
-
blue: [34, 39],
|
|
2218
|
-
magenta: [35, 39],
|
|
2219
|
-
cyan: [36, 39],
|
|
2220
|
-
white: [37, 39],
|
|
2221
|
-
gray: [90, 39],
|
|
2222
|
-
// Bright color
|
|
2223
|
-
redBright: [91, 39],
|
|
2224
|
-
greenBright: [92, 39],
|
|
2225
|
-
yellowBright: [93, 39],
|
|
2226
|
-
blueBright: [94, 39],
|
|
2227
|
-
magentaBright: [95, 39],
|
|
2228
|
-
cyanBright: [96, 39],
|
|
2229
|
-
whiteBright: [97, 39]
|
|
2230
|
-
},
|
|
2231
|
-
bgColor: {
|
|
2232
|
-
bgBlack: [40, 49],
|
|
2233
|
-
bgRed: [41, 49],
|
|
2234
|
-
bgGreen: [42, 49],
|
|
2235
|
-
bgYellow: [43, 49],
|
|
2236
|
-
bgBlue: [44, 49],
|
|
2237
|
-
bgMagenta: [45, 49],
|
|
2238
|
-
bgCyan: [46, 49],
|
|
2239
|
-
bgWhite: [47, 49],
|
|
2240
|
-
// Bright color
|
|
2241
|
-
bgBlackBright: [100, 49],
|
|
2242
|
-
bgRedBright: [101, 49],
|
|
2243
|
-
bgGreenBright: [102, 49],
|
|
2244
|
-
bgYellowBright: [103, 49],
|
|
2245
|
-
bgBlueBright: [104, 49],
|
|
2246
|
-
bgMagentaBright: [105, 49],
|
|
2247
|
-
bgCyanBright: [106, 49],
|
|
2248
|
-
bgWhiteBright: [107, 49]
|
|
2249
|
-
}
|
|
2250
|
-
};
|
|
2251
|
-
|
|
2252
|
-
// Fix humans
|
|
2253
|
-
styles.color.grey = styles.color.gray;
|
|
2254
|
-
for (const groupName of Object.keys(styles)) {
|
|
2255
|
-
const group = styles[groupName];
|
|
2256
|
-
for (const styleName of Object.keys(group)) {
|
|
2257
|
-
const style = group[styleName];
|
|
2258
|
-
styles[styleName] = {
|
|
2259
|
-
open: `\u001B[${style[0]}m`,
|
|
2260
|
-
close: `\u001B[${style[1]}m`
|
|
2261
|
-
};
|
|
2262
|
-
group[styleName] = styles[styleName];
|
|
2263
|
-
codes.set(style[0], style[1]);
|
|
2264
|
-
}
|
|
2265
|
-
Object.defineProperty(styles, groupName, {
|
|
2266
|
-
value: group,
|
|
2267
|
-
enumerable: false
|
|
2268
|
-
});
|
|
2269
|
-
Object.defineProperty(styles, 'codes', {
|
|
2270
|
-
value: codes,
|
|
2271
|
-
enumerable: false
|
|
2272
|
-
});
|
|
2273
|
-
}
|
|
2274
|
-
const ansi2ansi = n => n;
|
|
2275
|
-
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
2276
|
-
styles.color.close = '\u001B[39m';
|
|
2277
|
-
styles.bgColor.close = '\u001B[49m';
|
|
2278
|
-
styles.color.ansi = {
|
|
2279
|
-
ansi: wrapAnsi16(ansi2ansi, 0)
|
|
2280
|
-
};
|
|
2281
|
-
styles.color.ansi256 = {
|
|
2282
|
-
ansi256: wrapAnsi256(ansi2ansi, 0)
|
|
2283
|
-
};
|
|
2284
|
-
styles.color.ansi16m = {
|
|
2285
|
-
rgb: wrapAnsi16m(rgb2rgb, 0)
|
|
2286
|
-
};
|
|
2287
|
-
styles.bgColor.ansi = {
|
|
2288
|
-
ansi: wrapAnsi16(ansi2ansi, 10)
|
|
2289
|
-
};
|
|
2290
|
-
styles.bgColor.ansi256 = {
|
|
2291
|
-
ansi256: wrapAnsi256(ansi2ansi, 10)
|
|
2292
|
-
};
|
|
2293
|
-
styles.bgColor.ansi16m = {
|
|
2294
|
-
rgb: wrapAnsi16m(rgb2rgb, 10)
|
|
2295
|
-
};
|
|
2296
|
-
for (let key of Object.keys(colorConvert)) {
|
|
2297
|
-
if (typeof colorConvert[key] !== 'object') {
|
|
2298
|
-
continue;
|
|
2299
|
-
}
|
|
2300
|
-
const suite = colorConvert[key];
|
|
2301
|
-
if (key === 'ansi16') {
|
|
2302
|
-
key = 'ansi';
|
|
2303
|
-
}
|
|
2304
|
-
if ('ansi16' in suite) {
|
|
2305
|
-
styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
|
|
2306
|
-
styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
|
|
2307
|
-
}
|
|
2308
|
-
if ('ansi256' in suite) {
|
|
2309
|
-
styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
|
|
2310
|
-
styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
|
|
2311
|
-
}
|
|
2312
|
-
if ('rgb' in suite) {
|
|
2313
|
-
styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
|
|
2314
|
-
styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
return styles;
|
|
2318
|
-
}
|
|
2319
|
-
|
|
2320
|
-
// Make the export immutable
|
|
2321
|
-
Object.defineProperty(module, 'exports', {
|
|
2322
|
-
enumerable: true,
|
|
2323
|
-
get: assembleStyles
|
|
2324
|
-
});
|
|
2325
|
-
})(ansiStyles);
|
|
2326
|
-
return ansiStyles.exports;
|
|
2327
|
-
}
|
|
2328
|
-
var hasFlag$1;
|
|
2329
|
-
var hasRequiredHasFlag$1;
|
|
2330
|
-
function requireHasFlag$1() {
|
|
2331
|
-
if (hasRequiredHasFlag$1) return hasFlag$1;
|
|
2332
|
-
hasRequiredHasFlag$1 = 1;
|
|
2333
|
-
hasFlag$1 = (flag, argv) => {
|
|
2334
|
-
argv = argv || process.argv;
|
|
2335
|
-
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
|
2336
|
-
const pos = argv.indexOf(prefix + flag);
|
|
2337
|
-
const terminatorPos = argv.indexOf('--');
|
|
2338
|
-
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
2339
|
-
};
|
|
2340
|
-
return hasFlag$1;
|
|
2341
|
-
}
|
|
2342
|
-
var supportsColor_1$1;
|
|
2343
|
-
var hasRequiredSupportsColor$1;
|
|
2344
|
-
function requireSupportsColor$1() {
|
|
2345
|
-
if (hasRequiredSupportsColor$1) return supportsColor_1$1;
|
|
2346
|
-
hasRequiredSupportsColor$1 = 1;
|
|
2347
|
-
const os = require$$0$1;
|
|
2348
|
-
const hasFlag = requireHasFlag$1();
|
|
2349
|
-
const env = process.env;
|
|
2350
|
-
let forceColor;
|
|
2351
|
-
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
|
|
2352
|
-
forceColor = false;
|
|
2353
|
-
} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) {
|
|
2354
|
-
forceColor = true;
|
|
2355
|
-
}
|
|
2356
|
-
if ('FORCE_COLOR' in env) {
|
|
2357
|
-
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
|
|
2358
|
-
}
|
|
2359
|
-
function translateLevel(level) {
|
|
2360
|
-
if (level === 0) {
|
|
2361
|
-
return false;
|
|
2362
|
-
}
|
|
2363
|
-
return {
|
|
2364
|
-
level,
|
|
2365
|
-
hasBasic: true,
|
|
2366
|
-
has256: level >= 2,
|
|
2367
|
-
has16m: level >= 3
|
|
2368
|
-
};
|
|
2369
|
-
}
|
|
2370
|
-
function supportsColor(stream) {
|
|
2371
|
-
if (forceColor === false) {
|
|
2372
|
-
return 0;
|
|
2373
|
-
}
|
|
2374
|
-
if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) {
|
|
2375
|
-
return 3;
|
|
2376
|
-
}
|
|
2377
|
-
if (hasFlag('color=256')) {
|
|
2378
|
-
return 2;
|
|
2379
|
-
}
|
|
2380
|
-
if (stream && !stream.isTTY && forceColor !== true) {
|
|
2381
|
-
return 0;
|
|
2382
|
-
}
|
|
2383
|
-
const min = forceColor ? 1 : 0;
|
|
2384
|
-
if (process.platform === 'win32') {
|
|
2385
|
-
// Node.js 7.5.0 is the first version of Node.js to include a patch to
|
|
2386
|
-
// libuv that enables 256 color output on Windows. Anything earlier and it
|
|
2387
|
-
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
|
|
2388
|
-
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
|
|
2389
|
-
// release that supports 256 colors. Windows 10 build 14931 is the first release
|
|
2390
|
-
// that supports 16m/TrueColor.
|
|
2391
|
-
const osRelease = os.release().split('.');
|
|
2392
|
-
if (Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
2393
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
2394
|
-
}
|
|
2395
|
-
return 1;
|
|
2396
|
-
}
|
|
2397
|
-
if ('CI' in env) {
|
|
2398
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
2399
|
-
return 1;
|
|
2400
|
-
}
|
|
2401
|
-
return min;
|
|
2402
|
-
}
|
|
2403
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
2404
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
2405
|
-
}
|
|
2406
|
-
if (env.COLORTERM === 'truecolor') {
|
|
2407
|
-
return 3;
|
|
2408
|
-
}
|
|
2409
|
-
if ('TERM_PROGRAM' in env) {
|
|
2410
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
2411
|
-
switch (env.TERM_PROGRAM) {
|
|
2412
|
-
case 'iTerm.app':
|
|
2413
|
-
return version >= 3 ? 3 : 2;
|
|
2414
|
-
case 'Apple_Terminal':
|
|
2415
|
-
return 2;
|
|
2416
|
-
// No default
|
|
2417
|
-
}
|
|
2418
|
-
}
|
|
2419
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
2420
|
-
return 2;
|
|
2421
|
-
}
|
|
2422
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
2423
|
-
return 1;
|
|
2424
|
-
}
|
|
2425
|
-
if ('COLORTERM' in env) {
|
|
2426
|
-
return 1;
|
|
2427
|
-
}
|
|
2428
|
-
if (env.TERM === 'dumb') {
|
|
2429
|
-
return min;
|
|
2430
|
-
}
|
|
2431
|
-
return min;
|
|
2432
|
-
}
|
|
2433
|
-
function getSupportLevel(stream) {
|
|
2434
|
-
const level = supportsColor(stream);
|
|
2435
|
-
return translateLevel(level);
|
|
2436
|
-
}
|
|
2437
|
-
supportsColor_1$1 = {
|
|
2438
|
-
supportsColor: getSupportLevel,
|
|
2439
|
-
stdout: getSupportLevel(process.stdout),
|
|
2440
|
-
stderr: getSupportLevel(process.stderr)
|
|
2441
|
-
};
|
|
2442
|
-
return supportsColor_1$1;
|
|
2443
|
-
}
|
|
2444
|
-
var templates;
|
|
2445
|
-
var hasRequiredTemplates;
|
|
2446
|
-
function requireTemplates() {
|
|
2447
|
-
if (hasRequiredTemplates) return templates;
|
|
2448
|
-
hasRequiredTemplates = 1;
|
|
2449
|
-
const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
2450
|
-
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
2451
|
-
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
2452
|
-
const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
2453
|
-
const ESCAPES = new Map([['n', '\n'], ['r', '\r'], ['t', '\t'], ['b', '\b'], ['f', '\f'], ['v', '\v'], ['0', '\0'], ['\\', '\\'], ['e', '\u001B'], ['a', '\u0007']]);
|
|
2454
|
-
function unescape(c) {
|
|
2455
|
-
if (c[0] === 'u' && c.length === 5 || c[0] === 'x' && c.length === 3) {
|
|
2456
|
-
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
2457
|
-
}
|
|
2458
|
-
return ESCAPES.get(c) || c;
|
|
2459
|
-
}
|
|
2460
|
-
function parseArguments(name, args) {
|
|
2461
|
-
const results = [];
|
|
2462
|
-
const chunks = args.trim().split(/\s*,\s*/g);
|
|
2463
|
-
let matches;
|
|
2464
|
-
for (const chunk of chunks) {
|
|
2465
|
-
if (!isNaN(chunk)) {
|
|
2466
|
-
results.push(Number(chunk));
|
|
2467
|
-
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
2468
|
-
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
|
|
2469
|
-
} else {
|
|
2470
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
2471
|
-
}
|
|
2472
|
-
}
|
|
2473
|
-
return results;
|
|
2474
|
-
}
|
|
2475
|
-
function parseStyle(style) {
|
|
2476
|
-
STYLE_REGEX.lastIndex = 0;
|
|
2477
|
-
const results = [];
|
|
2478
|
-
let matches;
|
|
2479
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
2480
|
-
const name = matches[1];
|
|
2481
|
-
if (matches[2]) {
|
|
2482
|
-
const args = parseArguments(name, matches[2]);
|
|
2483
|
-
results.push([name].concat(args));
|
|
2484
|
-
} else {
|
|
2485
|
-
results.push([name]);
|
|
2486
|
-
}
|
|
2487
|
-
}
|
|
2488
|
-
return results;
|
|
2489
|
-
}
|
|
2490
|
-
function buildStyle(chalk, styles) {
|
|
2491
|
-
const enabled = {};
|
|
2492
|
-
for (const layer of styles) {
|
|
2493
|
-
for (const style of layer.styles) {
|
|
2494
|
-
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
2495
|
-
}
|
|
2496
|
-
}
|
|
2497
|
-
let current = chalk;
|
|
2498
|
-
for (const styleName of Object.keys(enabled)) {
|
|
2499
|
-
if (Array.isArray(enabled[styleName])) {
|
|
2500
|
-
if (!(styleName in current)) {
|
|
2501
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
2502
|
-
}
|
|
2503
|
-
if (enabled[styleName].length > 0) {
|
|
2504
|
-
current = current[styleName].apply(current, enabled[styleName]);
|
|
2505
|
-
} else {
|
|
2506
|
-
current = current[styleName];
|
|
2507
|
-
}
|
|
2508
|
-
}
|
|
2509
|
-
}
|
|
2510
|
-
return current;
|
|
2511
|
-
}
|
|
2512
|
-
templates = (chalk, tmp) => {
|
|
2513
|
-
const styles = [];
|
|
2514
|
-
const chunks = [];
|
|
2515
|
-
let chunk = [];
|
|
2516
|
-
|
|
2517
|
-
// eslint-disable-next-line max-params
|
|
2518
|
-
tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
|
|
2519
|
-
if (escapeChar) {
|
|
2520
|
-
chunk.push(unescape(escapeChar));
|
|
2521
|
-
} else if (style) {
|
|
2522
|
-
const str = chunk.join('');
|
|
2523
|
-
chunk = [];
|
|
2524
|
-
chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
|
|
2525
|
-
styles.push({
|
|
2526
|
-
inverse,
|
|
2527
|
-
styles: parseStyle(style)
|
|
2528
|
-
});
|
|
2529
|
-
} else if (close) {
|
|
2530
|
-
if (styles.length === 0) {
|
|
2531
|
-
throw new Error('Found extraneous } in Chalk template literal');
|
|
2532
|
-
}
|
|
2533
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join('')));
|
|
2534
|
-
chunk = [];
|
|
2535
|
-
styles.pop();
|
|
2536
|
-
} else {
|
|
2537
|
-
chunk.push(chr);
|
|
2538
|
-
}
|
|
2539
|
-
});
|
|
2540
|
-
chunks.push(chunk.join(''));
|
|
2541
|
-
if (styles.length > 0) {
|
|
2542
|
-
const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
|
|
2543
|
-
throw new Error(errMsg);
|
|
2544
|
-
}
|
|
2545
|
-
return chunks.join('');
|
|
2546
|
-
};
|
|
2547
|
-
return templates;
|
|
2548
|
-
}
|
|
2549
|
-
var hasRequiredChalk;
|
|
2550
|
-
function requireChalk() {
|
|
2551
|
-
if (hasRequiredChalk) return chalk.exports;
|
|
2552
|
-
hasRequiredChalk = 1;
|
|
2553
|
-
(function (module) {
|
|
2554
|
-
const escapeStringRegexp = requireEscapeStringRegexp();
|
|
2555
|
-
const ansiStyles = requireAnsiStyles();
|
|
2556
|
-
const stdoutColor = requireSupportsColor$1().stdout;
|
|
2557
|
-
const template = requireTemplates();
|
|
2558
|
-
const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
|
|
2559
|
-
|
|
2560
|
-
// `supportsColor.level` → `ansiStyles.color[name]` mapping
|
|
2561
|
-
const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
|
|
2562
|
-
|
|
2563
|
-
// `color-convert` models to exclude from the Chalk API due to conflicts and such
|
|
2564
|
-
const skipModels = new Set(['gray']);
|
|
2565
|
-
const styles = Object.create(null);
|
|
2566
|
-
function applyOptions(obj, options) {
|
|
2567
|
-
options = options || {};
|
|
2568
|
-
|
|
2569
|
-
// Detect level if not set manually
|
|
2570
|
-
const scLevel = stdoutColor ? stdoutColor.level : 0;
|
|
2571
|
-
obj.level = options.level === undefined ? scLevel : options.level;
|
|
2572
|
-
obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
|
|
2573
|
-
}
|
|
2574
|
-
function Chalk(options) {
|
|
2575
|
-
// We check for this.template here since calling `chalk.constructor()`
|
|
2576
|
-
// by itself will have a `this` of a previously constructed chalk object
|
|
2577
|
-
if (!this || !(this instanceof Chalk) || this.template) {
|
|
2578
|
-
const chalk = {};
|
|
2579
|
-
applyOptions(chalk, options);
|
|
2580
|
-
chalk.template = function () {
|
|
2581
|
-
const args = [].slice.call(arguments);
|
|
2582
|
-
return chalkTag.apply(null, [chalk.template].concat(args));
|
|
2583
|
-
};
|
|
2584
|
-
Object.setPrototypeOf(chalk, Chalk.prototype);
|
|
2585
|
-
Object.setPrototypeOf(chalk.template, chalk);
|
|
2586
|
-
chalk.template.constructor = Chalk;
|
|
2587
|
-
return chalk.template;
|
|
2588
|
-
}
|
|
2589
|
-
applyOptions(this, options);
|
|
2590
|
-
}
|
|
2591
|
-
|
|
2592
|
-
// Use bright blue on Windows as the normal blue color is illegible
|
|
2593
|
-
if (isSimpleWindowsTerm) {
|
|
2594
|
-
ansiStyles.blue.open = '\u001B[94m';
|
|
2595
|
-
}
|
|
2596
|
-
for (const key of Object.keys(ansiStyles)) {
|
|
2597
|
-
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
|
|
2598
|
-
styles[key] = {
|
|
2599
|
-
get() {
|
|
2600
|
-
const codes = ansiStyles[key];
|
|
2601
|
-
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
|
|
2602
|
-
}
|
|
2603
|
-
};
|
|
2604
|
-
}
|
|
2605
|
-
styles.visible = {
|
|
2606
|
-
get() {
|
|
2607
|
-
return build.call(this, this._styles || [], true, 'visible');
|
|
2608
|
-
}
|
|
2609
|
-
};
|
|
2610
|
-
ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
|
|
2611
|
-
for (const model of Object.keys(ansiStyles.color.ansi)) {
|
|
2612
|
-
if (skipModels.has(model)) {
|
|
2613
|
-
continue;
|
|
2614
|
-
}
|
|
2615
|
-
styles[model] = {
|
|
2616
|
-
get() {
|
|
2617
|
-
const level = this.level;
|
|
2618
|
-
return function () {
|
|
2619
|
-
const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
|
|
2620
|
-
const codes = {
|
|
2621
|
-
open,
|
|
2622
|
-
close: ansiStyles.color.close,
|
|
2623
|
-
closeRe: ansiStyles.color.closeRe
|
|
2624
|
-
};
|
|
2625
|
-
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
|
|
2626
|
-
};
|
|
2627
|
-
}
|
|
2628
|
-
};
|
|
2629
|
-
}
|
|
2630
|
-
ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
|
|
2631
|
-
for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
|
|
2632
|
-
if (skipModels.has(model)) {
|
|
2633
|
-
continue;
|
|
2634
|
-
}
|
|
2635
|
-
const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
|
|
2636
|
-
styles[bgModel] = {
|
|
2637
|
-
get() {
|
|
2638
|
-
const level = this.level;
|
|
2639
|
-
return function () {
|
|
2640
|
-
const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
|
|
2641
|
-
const codes = {
|
|
2642
|
-
open,
|
|
2643
|
-
close: ansiStyles.bgColor.close,
|
|
2644
|
-
closeRe: ansiStyles.bgColor.closeRe
|
|
2645
|
-
};
|
|
2646
|
-
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
|
|
2647
|
-
};
|
|
2648
|
-
}
|
|
2649
|
-
};
|
|
2650
|
-
}
|
|
2651
|
-
const proto = Object.defineProperties(() => {}, styles);
|
|
2652
|
-
function build(_styles, _empty, key) {
|
|
2653
|
-
const builder = function () {
|
|
2654
|
-
return applyStyle.apply(builder, arguments);
|
|
2655
|
-
};
|
|
2656
|
-
builder._styles = _styles;
|
|
2657
|
-
builder._empty = _empty;
|
|
2658
|
-
const self = this;
|
|
2659
|
-
Object.defineProperty(builder, 'level', {
|
|
2660
|
-
enumerable: true,
|
|
2661
|
-
get() {
|
|
2662
|
-
return self.level;
|
|
2663
|
-
},
|
|
2664
|
-
set(level) {
|
|
2665
|
-
self.level = level;
|
|
2666
|
-
}
|
|
2667
|
-
});
|
|
2668
|
-
Object.defineProperty(builder, 'enabled', {
|
|
2669
|
-
enumerable: true,
|
|
2670
|
-
get() {
|
|
2671
|
-
return self.enabled;
|
|
2672
|
-
},
|
|
2673
|
-
set(enabled) {
|
|
2674
|
-
self.enabled = enabled;
|
|
2675
|
-
}
|
|
2676
|
-
});
|
|
2677
|
-
|
|
2678
|
-
// See below for fix regarding invisible grey/dim combination on Windows
|
|
2679
|
-
builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
|
|
806
|
+
});
|
|
2680
807
|
|
|
2681
|
-
|
|
2682
|
-
// no way to create a function with a different prototype
|
|
2683
|
-
builder.__proto__ = proto; // eslint-disable-line no-proto
|
|
808
|
+
var lib$1 = {};
|
|
2684
809
|
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
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;
|
|
886
|
+
}
|
|
2704
887
|
|
|
2705
|
-
|
|
2706
|
-
// see https://github.com/chalk/chalk/issues/58
|
|
2707
|
-
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
|
|
2708
|
-
const originalDim = ansiStyles.dim.open;
|
|
2709
|
-
if (isSimpleWindowsTerm && this.hasGrey) {
|
|
2710
|
-
ansiStyles.dim.open = '';
|
|
2711
|
-
}
|
|
2712
|
-
for (const code of this._styles.slice().reverse()) {
|
|
2713
|
-
// Replace any instances already present with a re-opening code
|
|
2714
|
-
// otherwise only the part of the string until said closing code
|
|
2715
|
-
// will be colored, and the rest will simply be 'plain'.
|
|
2716
|
-
str = code.open + str.replace(code.closeRe, code.open) + code.close;
|
|
2717
|
-
|
|
2718
|
-
// Close the styling before a linebreak and reopen
|
|
2719
|
-
// after next line to fix a bleed issue on macOS
|
|
2720
|
-
// https://github.com/chalk/chalk/pull/92
|
|
2721
|
-
str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
|
|
2722
|
-
}
|
|
888
|
+
var jsTokens = {};
|
|
2723
889
|
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
Object.defineProperty(lib$1, "__esModule", {
|
|
2750
|
-
value: true
|
|
2751
|
-
});
|
|
2752
|
-
lib$1.default = highlight;
|
|
2753
|
-
lib$1.shouldHighlight = shouldHighlight;
|
|
2754
|
-
var _jsTokens = jsTokens;
|
|
2755
|
-
var _helperValidatorIdentifier = lib;
|
|
2756
|
-
var _picocolors$1 = _interopRequireWildcard$1(picocolorsExports, true);
|
|
2757
|
-
function _getRequireWildcardCache$1(e) {
|
|
2758
|
-
if ("function" != typeof WeakMap) return null;
|
|
2759
|
-
var r = new WeakMap(),
|
|
2760
|
-
t = new WeakMap();
|
|
2761
|
-
return (_getRequireWildcardCache$1 = function (e) {
|
|
2762
|
-
return e ? t : r;
|
|
2763
|
-
})(e);
|
|
2764
|
-
}
|
|
2765
|
-
function _interopRequireWildcard$1(e, r) {
|
|
2766
|
-
if (null === e || "object" != typeof e && "function" != typeof e) return {
|
|
2767
|
-
default: e
|
|
2768
|
-
};
|
|
2769
|
-
var t = _getRequireWildcardCache$1(r);
|
|
2770
|
-
if (t && t.has(e)) return t.get(e);
|
|
2771
|
-
var n = {
|
|
2772
|
-
__proto__: null
|
|
2773
|
-
},
|
|
2774
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
2775
|
-
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
2776
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
2777
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
2778
|
-
}
|
|
2779
|
-
return n.default = e, t && t.set(e, n), n;
|
|
2780
|
-
}
|
|
2781
|
-
const colors$1 = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors$1.createColors)(false) : _picocolors$1.default;
|
|
2782
|
-
const compose$1 = (f, g) => v => f(g(v));
|
|
2783
|
-
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
|
2784
|
-
function getDefs$1(colors) {
|
|
2785
|
-
return {
|
|
2786
|
-
keyword: colors.cyan,
|
|
2787
|
-
capitalized: colors.yellow,
|
|
2788
|
-
jsxIdentifier: colors.yellow,
|
|
2789
|
-
punctuator: colors.yellow,
|
|
2790
|
-
number: colors.magenta,
|
|
2791
|
-
string: colors.green,
|
|
2792
|
-
regex: colors.magenta,
|
|
2793
|
-
comment: colors.gray,
|
|
2794
|
-
invalid: compose$1(compose$1(colors.white, colors.bgRed), colors.bold)
|
|
2795
|
-
};
|
|
2796
|
-
}
|
|
2797
|
-
const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
|
2798
|
-
const BRACKET = /^[()[\]{}]$/;
|
|
2799
|
-
let tokenize;
|
|
2800
|
-
{
|
|
2801
|
-
const JSX_TAG = /^[a-z][\w-]*$/i;
|
|
2802
|
-
const getTokenType = function (token, offset, text) {
|
|
2803
|
-
if (token.type === "name") {
|
|
2804
|
-
if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) {
|
|
2805
|
-
return "keyword";
|
|
2806
|
-
}
|
|
2807
|
-
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
|
|
2808
|
-
return "jsxIdentifier";
|
|
2809
|
-
}
|
|
2810
|
-
if (token.value[0] !== token.value[0].toLowerCase()) {
|
|
2811
|
-
return "capitalized";
|
|
2812
|
-
}
|
|
2813
|
-
}
|
|
2814
|
-
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
|
2815
|
-
return "bracket";
|
|
2816
|
-
}
|
|
2817
|
-
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
|
2818
|
-
return "punctuator";
|
|
2819
|
-
}
|
|
2820
|
-
return token.type;
|
|
2821
|
-
};
|
|
2822
|
-
tokenize = function* (text) {
|
|
2823
|
-
let match;
|
|
2824
|
-
while (match = _jsTokens.default.exec(text)) {
|
|
2825
|
-
const token = _jsTokens.matchToToken(match);
|
|
2826
|
-
yield {
|
|
2827
|
-
type: getTokenType(token, match.index, text),
|
|
2828
|
-
value: token.value
|
|
2829
|
-
};
|
|
2830
|
-
}
|
|
2831
|
-
};
|
|
2832
|
-
}
|
|
2833
|
-
function highlightTokens(defs, text) {
|
|
2834
|
-
let highlighted = "";
|
|
2835
|
-
for (const {
|
|
2836
|
-
type,
|
|
2837
|
-
value
|
|
2838
|
-
} of tokenize(text)) {
|
|
2839
|
-
const colorize = defs[type];
|
|
2840
|
-
if (colorize) {
|
|
2841
|
-
highlighted += value.split(NEWLINE$1).map(str => colorize(str)).join("\n");
|
|
2842
|
-
} else {
|
|
2843
|
-
highlighted += value;
|
|
2844
|
-
}
|
|
2845
|
-
}
|
|
2846
|
-
return highlighted;
|
|
2847
|
-
}
|
|
2848
|
-
function shouldHighlight(options) {
|
|
2849
|
-
return colors$1.isColorSupported || options.forceColor;
|
|
2850
|
-
}
|
|
2851
|
-
let pcWithForcedColor$1 = undefined;
|
|
2852
|
-
function getColors$1(forceColor) {
|
|
2853
|
-
if (forceColor) {
|
|
2854
|
-
var _pcWithForcedColor;
|
|
2855
|
-
(_pcWithForcedColor = pcWithForcedColor$1) != null ? _pcWithForcedColor : pcWithForcedColor$1 = (0, _picocolors$1.createColors)(true);
|
|
2856
|
-
return pcWithForcedColor$1;
|
|
2857
|
-
}
|
|
2858
|
-
return colors$1;
|
|
2859
|
-
}
|
|
2860
|
-
function highlight(code, options = {}) {
|
|
2861
|
-
if (code !== "" && shouldHighlight(options)) {
|
|
2862
|
-
const defs = getDefs$1(getColors$1(options.forceColor));
|
|
2863
|
-
return highlightTokens(defs, code);
|
|
2864
|
-
} else {
|
|
2865
|
-
return code;
|
|
2866
|
-
}
|
|
2867
|
-
}
|
|
2868
|
-
{
|
|
2869
|
-
let chalk, chalkWithForcedColor;
|
|
2870
|
-
lib$1.getChalk = ({
|
|
2871
|
-
forceColor
|
|
2872
|
-
}) => {
|
|
2873
|
-
var _chalk;
|
|
2874
|
-
(_chalk = chalk) != null ? _chalk : chalk = requireChalk();
|
|
2875
|
-
if (forceColor) {
|
|
2876
|
-
var _chalkWithForcedColor;
|
|
2877
|
-
(_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk.constructor({
|
|
2878
|
-
enabled: true,
|
|
2879
|
-
level: 1
|
|
2880
|
-
});
|
|
2881
|
-
return chalkWithForcedColor;
|
|
2882
|
-
}
|
|
2883
|
-
return chalk;
|
|
2884
|
-
};
|
|
2885
|
-
}
|
|
2886
|
-
Object.defineProperty(lib$2, "__esModule", {
|
|
2887
|
-
value: true
|
|
2888
|
-
});
|
|
2889
|
-
var codeFrameColumns_1 = lib$2.codeFrameColumns = codeFrameColumns;
|
|
2890
|
-
lib$2.default = _default;
|
|
2891
|
-
var _highlight = lib$1;
|
|
2892
|
-
var _picocolors = _interopRequireWildcard(picocolorsExports, true);
|
|
2893
|
-
function _getRequireWildcardCache(e) {
|
|
2894
|
-
if ("function" != typeof WeakMap) return null;
|
|
2895
|
-
var r = new WeakMap(),
|
|
2896
|
-
t = new WeakMap();
|
|
2897
|
-
return (_getRequireWildcardCache = function (e) {
|
|
2898
|
-
return e ? t : r;
|
|
2899
|
-
})(e);
|
|
2900
|
-
}
|
|
2901
|
-
function _interopRequireWildcard(e, r) {
|
|
2902
|
-
if (null === e || "object" != typeof e && "function" != typeof e) return {
|
|
2903
|
-
default: e
|
|
2904
|
-
};
|
|
2905
|
-
var t = _getRequireWildcardCache(r);
|
|
2906
|
-
if (t && t.has(e)) return t.get(e);
|
|
2907
|
-
var n = {
|
|
2908
|
-
__proto__: null
|
|
2909
|
-
},
|
|
2910
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
2911
|
-
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
2912
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
2913
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
2914
|
-
}
|
|
2915
|
-
return n.default = e, t && t.set(e, n), n;
|
|
2916
|
-
}
|
|
2917
|
-
const colors = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors.createColors)(false) : _picocolors.default;
|
|
2918
|
-
const compose = (f, g) => v => f(g(v));
|
|
2919
|
-
let pcWithForcedColor = undefined;
|
|
2920
|
-
function getColors(forceColor) {
|
|
2921
|
-
if (forceColor) {
|
|
2922
|
-
var _pcWithForcedColor;
|
|
2923
|
-
(_pcWithForcedColor = pcWithForcedColor) != null ? _pcWithForcedColor : pcWithForcedColor = (0, _picocolors.createColors)(true);
|
|
2924
|
-
return pcWithForcedColor;
|
|
2925
|
-
}
|
|
2926
|
-
return colors;
|
|
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;
|
|
2927
915
|
}
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
916
|
+
|
|
917
|
+
var lib = {};
|
|
918
|
+
|
|
919
|
+
var identifier = {};
|
|
920
|
+
|
|
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;
|
|
2935
994
|
}
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
if (startColumn === endColumn) {
|
|
2978
|
-
if (startColumn) {
|
|
2979
|
-
markerLines[startLine] = [startColumn, 0];
|
|
2980
|
-
} else {
|
|
2981
|
-
markerLines[startLine] = true;
|
|
2982
|
-
}
|
|
2983
|
-
} else {
|
|
2984
|
-
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
|
2985
|
-
}
|
|
2986
|
-
}
|
|
2987
|
-
return {
|
|
2988
|
-
start,
|
|
2989
|
-
end,
|
|
2990
|
-
markerLines
|
|
2991
|
-
};
|
|
995
|
+
|
|
996
|
+
var keyword = {};
|
|
997
|
+
|
|
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;
|
|
2992
1036
|
}
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
1037
|
+
|
|
1038
|
+
var hasRequiredLib$1;
|
|
1039
|
+
|
|
1040
|
+
function requireLib$1 () {
|
|
1041
|
+
if (hasRequiredLib$1) return lib;
|
|
1042
|
+
hasRequiredLib$1 = 1;
|
|
1043
|
+
(function (exports) {
|
|
1044
|
+
|
|
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;
|
|
3038
1100
|
}
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
1101
|
+
|
|
1102
|
+
var hasRequiredLib;
|
|
1103
|
+
|
|
1104
|
+
function requireLib () {
|
|
1105
|
+
if (hasRequiredLib) return lib$1;
|
|
1106
|
+
hasRequiredLib = 1;
|
|
1107
|
+
|
|
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;
|
|
3059
1318
|
}
|
|
1319
|
+
|
|
1320
|
+
var libExports = requireLib();
|
|
1321
|
+
|
|
3060
1322
|
const NewLine$3 = '\n';
|
|
3061
1323
|
const splitLines$2 = lines => {
|
|
3062
1324
|
return lines.split(NewLine$3);
|
|
@@ -3198,7 +1460,7 @@ const prepareModuleNotFoundError = error => {
|
|
|
3198
1460
|
column
|
|
3199
1461
|
}
|
|
3200
1462
|
};
|
|
3201
|
-
const codeFrame =
|
|
1463
|
+
const codeFrame = libExports.codeFrameColumns(rawLines, location);
|
|
3202
1464
|
const stackLines = splitLines$2(error.stack);
|
|
3203
1465
|
const newStackLines = [stackLines[0], ` at ${importedFrom}:${line}:${column}`, ...stackLines.slice(1)];
|
|
3204
1466
|
const newStack = joinLines$2(newStackLines);
|
|
@@ -3242,7 +1504,7 @@ const prepare = error => {
|
|
|
3242
1504
|
column: Number.parseInt(column)
|
|
3243
1505
|
}
|
|
3244
1506
|
};
|
|
3245
|
-
codeFrame =
|
|
1507
|
+
codeFrame = libExports.codeFrameColumns(rawLines, location);
|
|
3246
1508
|
}
|
|
3247
1509
|
}
|
|
3248
1510
|
const relevantStack = joinLines$2(lines);
|
|
@@ -3773,7 +2035,7 @@ class CommandNotFoundError extends Error {
|
|
|
3773
2035
|
|
|
3774
2036
|
const App = 1;
|
|
3775
2037
|
const AppWindow = 2;
|
|
3776
|
-
const Beep
|
|
2038
|
+
const Beep = 3;
|
|
3777
2039
|
const Developer = 4;
|
|
3778
2040
|
const Dialog = 5;
|
|
3779
2041
|
const ElectronWindowProcessExplorer = 6;
|
|
@@ -3792,7 +2054,7 @@ const Process = 19;
|
|
|
3792
2054
|
const ElectronNet = 20;
|
|
3793
2055
|
const ElectronBrowserViewSuggestions = 21;
|
|
3794
2056
|
const CreatePidMap = 22;
|
|
3795
|
-
const OpenExternal$
|
|
2057
|
+
const OpenExternal$1 = 23;
|
|
3796
2058
|
const Platform = 25;
|
|
3797
2059
|
const GetWindowId = 26;
|
|
3798
2060
|
const DesktopCapturer = 27;
|
|
@@ -3812,7 +2074,7 @@ const ElectronSession = 40;
|
|
|
3812
2074
|
const getPrefix = commandId => {
|
|
3813
2075
|
return commandId.slice(0, commandId.indexOf('.'));
|
|
3814
2076
|
};
|
|
3815
|
-
const getModuleId
|
|
2077
|
+
const getModuleId = commandId => {
|
|
3816
2078
|
const prefix = getPrefix(commandId);
|
|
3817
2079
|
switch (prefix) {
|
|
3818
2080
|
case 'Crash':
|
|
@@ -3821,7 +2083,7 @@ const getModuleId$1 = commandId => {
|
|
|
3821
2083
|
case 'App':
|
|
3822
2084
|
return App;
|
|
3823
2085
|
case 'Beep':
|
|
3824
|
-
return Beep
|
|
2086
|
+
return Beep;
|
|
3825
2087
|
case 'ElectronWindow':
|
|
3826
2088
|
return Window;
|
|
3827
2089
|
case 'ElectronDeveloper':
|
|
@@ -3833,7 +2095,7 @@ const getModuleId$1 = commandId => {
|
|
|
3833
2095
|
case 'ElectronDialog':
|
|
3834
2096
|
return Dialog;
|
|
3835
2097
|
case 'ElectronBeep':
|
|
3836
|
-
return Beep
|
|
2098
|
+
return Beep;
|
|
3837
2099
|
case 'ElectronShell':
|
|
3838
2100
|
return ElectronShell;
|
|
3839
2101
|
case 'ElectronPowerSaveBlocker':
|
|
@@ -3863,7 +2125,7 @@ const getModuleId$1 = commandId => {
|
|
|
3863
2125
|
case 'CreatePidMap':
|
|
3864
2126
|
return CreatePidMap;
|
|
3865
2127
|
case 'OpenExternal':
|
|
3866
|
-
return OpenExternal$
|
|
2128
|
+
return OpenExternal$1;
|
|
3867
2129
|
case 'Platform':
|
|
3868
2130
|
return Platform;
|
|
3869
2131
|
case 'GetWindowId':
|
|
@@ -3923,7 +2185,7 @@ const getOrLoadModule = moduleId => {
|
|
|
3923
2185
|
}
|
|
3924
2186
|
return state$7.pendingModules[moduleId];
|
|
3925
2187
|
};
|
|
3926
|
-
const loadCommand = command => getOrLoadModule(getModuleId
|
|
2188
|
+
const loadCommand = command => getOrLoadModule(getModuleId(command));
|
|
3927
2189
|
const register = (commandId, listener) => {
|
|
3928
2190
|
state$7.commands[commandId] = listener;
|
|
3929
2191
|
};
|
|
@@ -5305,6 +3567,9 @@ const CliForwardToSharedProcess = {
|
|
|
5305
3567
|
handleCliArgs
|
|
5306
3568
|
};
|
|
5307
3569
|
|
|
3570
|
+
const SharedProcess = 4;
|
|
3571
|
+
const None = 0;
|
|
3572
|
+
|
|
5308
3573
|
const on = (event, listener) => {
|
|
5309
3574
|
app.on(event, listener);
|
|
5310
3575
|
};
|
|
@@ -5315,34 +3580,43 @@ const appendCommandLineSwitch = (commandLineSwitch, value) => {
|
|
|
5315
3580
|
app.commandLine.appendSwitch(commandLineSwitch, value);
|
|
5316
3581
|
};
|
|
5317
3582
|
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
const
|
|
5322
|
-
|
|
5323
|
-
|
|
3583
|
+
const Version = 'version';
|
|
3584
|
+
const Help = 'help';
|
|
3585
|
+
const Wait = 'wait';
|
|
3586
|
+
const BuiltinSelfTest = 'built-in-self-test';
|
|
3587
|
+
const Web = 'web';
|
|
3588
|
+
const SandBox = 'sandbox';
|
|
3589
|
+
const Install = 'install';
|
|
3590
|
+
const List = 'list';
|
|
3591
|
+
const Link = 'link';
|
|
3592
|
+
const Unlink = 'unlink';
|
|
3593
|
+
const Status = 'status';
|
|
3594
|
+
|
|
3595
|
+
const getCliModuleId = parsedArgs => {
|
|
3596
|
+
const arg0 = parsedArgs._[0];
|
|
3597
|
+
if (arg0 === Install || arg0 === List || arg0 === Link || arg0 === Unlink || parsedArgs[Status] || parsedArgs[Version] || parsedArgs[Help] || parsedArgs[Web] || parsedArgs[BuiltinSelfTest]) {
|
|
3598
|
+
return SharedProcess;
|
|
3599
|
+
}
|
|
3600
|
+
return None;
|
|
5324
3601
|
};
|
|
3602
|
+
|
|
5325
3603
|
const getModule$1 = moduleId => {
|
|
5326
3604
|
switch (moduleId) {
|
|
5327
|
-
case
|
|
3605
|
+
case SharedProcess:
|
|
5328
3606
|
return CliForwardToSharedProcess;
|
|
5329
3607
|
default:
|
|
5330
3608
|
throw new Error('module not found');
|
|
5331
3609
|
}
|
|
5332
3610
|
};
|
|
5333
|
-
const getModuleId = parsedArgs => {
|
|
5334
|
-
const arg0 = parsedArgs._[0];
|
|
5335
|
-
if (arg0 === Install || arg0 === List || arg0 === Link || arg0 === Unlink || parsedArgs[Status] || parsedArgs[Version] || parsedArgs[Help] || parsedArgs[Web] || parsedArgs[BuiltinSelfTest]) {
|
|
5336
|
-
return ModuleId.SharedProcess;
|
|
5337
|
-
}
|
|
5338
|
-
return ModuleId.None;
|
|
5339
|
-
};
|
|
5340
3611
|
const handleArgs = (moduleId, parsedArgs) => {
|
|
5341
3612
|
const module = getModule$1(moduleId);
|
|
5342
3613
|
return module.handleCliArgs(parsedArgs);
|
|
5343
3614
|
};
|
|
5344
|
-
const
|
|
5345
|
-
const moduleId =
|
|
3615
|
+
const canHandleFastCliArgs = parsedArgs => {
|
|
3616
|
+
const moduleId = getCliModuleId(parsedArgs);
|
|
3617
|
+
return moduleId;
|
|
3618
|
+
};
|
|
3619
|
+
const handleFastCliArgs = async (moduleId, parsedArgs) => {
|
|
5346
3620
|
if (moduleId) {
|
|
5347
3621
|
await whenReady();
|
|
5348
3622
|
return handleArgs(moduleId, parsedArgs);
|
|
@@ -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()`.
|
|
@@ -6655,51 +4929,18 @@ const handleSecondInstance = async (event, commandLine, workingDirectory, additi
|
|
|
6655
4929
|
debug('[info] second instance');
|
|
6656
4930
|
const parsedArgs = parseCliArgs(additionalData);
|
|
6657
4931
|
debug('[info] second instance args', additionalData, parsedArgs);
|
|
6658
|
-
const
|
|
4932
|
+
const moduleId = canHandleFastCliArgs(parsedArgs);
|
|
4933
|
+
const handled = await handleFastCliArgs(moduleId, parsedArgs); // TODO don't like the side effect here
|
|
6659
4934
|
if (handled) {
|
|
6660
4935
|
return;
|
|
6661
4936
|
}
|
|
6662
4937
|
await handleReady(parsedArgs, workingDirectory);
|
|
6663
4938
|
};
|
|
6664
4939
|
|
|
6665
|
-
const shouldOpenExternal = url => {
|
|
6666
|
-
if (url.startsWith('http:') || url.startsWith('https:')) {
|
|
6667
|
-
return true;
|
|
6668
|
-
}
|
|
6669
|
-
return false;
|
|
6670
|
-
};
|
|
6671
|
-
|
|
6672
|
-
const openExternal$1 = async url => {
|
|
6673
|
-
if (!shouldOpenExternal(url)) {
|
|
6674
|
-
throw new VError(`only http or https urls are allowed`);
|
|
6675
|
-
}
|
|
6676
|
-
await shell.openExternal(url);
|
|
6677
|
-
};
|
|
6678
|
-
|
|
6679
|
-
const OpenExternal$1 = {
|
|
6680
|
-
__proto__: null,
|
|
6681
|
-
openExternal: openExternal$1
|
|
6682
|
-
};
|
|
6683
|
-
|
|
6684
4940
|
const showItemInFolder = fullPath => {
|
|
6685
4941
|
shell.showItemInFolder(fullPath);
|
|
6686
4942
|
};
|
|
6687
4943
|
|
|
6688
|
-
/**
|
|
6689
|
-
* @deprecated use OpenExternal.openExternal function instead
|
|
6690
|
-
*/
|
|
6691
|
-
const {
|
|
6692
|
-
openExternal
|
|
6693
|
-
} = OpenExternal$1;
|
|
6694
|
-
|
|
6695
|
-
/**
|
|
6696
|
-
* @deprecated use Beep.beep instead
|
|
6697
|
-
*/
|
|
6698
|
-
const beep$1 = async () => {
|
|
6699
|
-
const Beep$1 = await Promise.resolve().then(function () { return Beep; });
|
|
6700
|
-
Beep$1.beep();
|
|
6701
|
-
};
|
|
6702
|
-
|
|
6703
4944
|
const ContextMenu = 'context-menu';
|
|
6704
4945
|
const WillNavigate = 'will-navigate';
|
|
6705
4946
|
const DidNavigate = 'did-navigate';
|
|
@@ -6757,7 +4998,7 @@ const shouldAllowNavigation = webContentsId => {
|
|
|
6757
4998
|
const handleWebContentsWindowOpen = ({
|
|
6758
4999
|
url
|
|
6759
5000
|
}) => {
|
|
6760
|
-
void
|
|
5001
|
+
void undefined(url);
|
|
6761
5002
|
return {
|
|
6762
5003
|
action: Deny
|
|
6763
5004
|
};
|
|
@@ -6868,9 +5109,10 @@ const hydrate = async () => {
|
|
|
6868
5109
|
// before being able to test multi-window behavior
|
|
6869
5110
|
// see https://github.com/microsoft/playwright/issues/12345
|
|
6870
5111
|
|
|
6871
|
-
const parsedCliArgs = parseCliArgs(argv
|
|
6872
|
-
const
|
|
6873
|
-
if (
|
|
5112
|
+
const parsedCliArgs = parseCliArgs(argv);
|
|
5113
|
+
const moduleId = canHandleFastCliArgs(parsedCliArgs);
|
|
5114
|
+
if (moduleId) {
|
|
5115
|
+
await handleFastCliArgs(moduleId, parsedCliArgs);
|
|
6874
5116
|
return;
|
|
6875
5117
|
}
|
|
6876
5118
|
if (isLinux && chromeUserDataPath) {
|
|
@@ -6879,7 +5121,7 @@ const hydrate = async () => {
|
|
|
6879
5121
|
setCrashDumpsPath(chromeUserDataPath);
|
|
6880
5122
|
setLogsPath(chromeUserDataPath);
|
|
6881
5123
|
}
|
|
6882
|
-
const hasLock = requestSingleInstanceLock(argv
|
|
5124
|
+
const hasLock = requestSingleInstanceLock(argv);
|
|
6883
5125
|
if (!hasLock) {
|
|
6884
5126
|
debug('[info] quitting because no lock');
|
|
6885
5127
|
exit();
|
|
@@ -6888,7 +5130,7 @@ const hydrate = async () => {
|
|
|
6888
5130
|
|
|
6889
5131
|
// TODO tree shake out the .env.DEV check: reading from env variables is expensive
|
|
6890
5132
|
if (process.stdout.isTTY && !parsedCliArgs.wait && !process.env.DEV) {
|
|
6891
|
-
spawn(execPath, argv
|
|
5133
|
+
spawn(execPath, argv.slice(1), {
|
|
6892
5134
|
detached: true,
|
|
6893
5135
|
stdio: 'ignore'
|
|
6894
5136
|
});
|
|
@@ -6927,7 +5169,7 @@ const load = async moduleId => {
|
|
|
6927
5169
|
return Promise.resolve().then(function () { return App_ipc; });
|
|
6928
5170
|
case AppWindow:
|
|
6929
5171
|
return Promise.resolve().then(function () { return AppWindow_ipc; });
|
|
6930
|
-
case Beep
|
|
5172
|
+
case Beep:
|
|
6931
5173
|
return Promise.resolve().then(function () { return Beep_ipc; });
|
|
6932
5174
|
case Crash:
|
|
6933
5175
|
return Promise.resolve().then(function () { return Crash_ipc; });
|
|
@@ -6965,7 +5207,7 @@ const load = async moduleId => {
|
|
|
6965
5207
|
return Promise.resolve().then(function () { return ElectronWindowProcessExplorer_ipc; });
|
|
6966
5208
|
case IpcParent:
|
|
6967
5209
|
return Promise.resolve().then(function () { return IpcParent_ipc; });
|
|
6968
|
-
case OpenExternal$
|
|
5210
|
+
case OpenExternal$1:
|
|
6969
5211
|
return Promise.resolve().then(function () { return OpenExternal_ipc; });
|
|
6970
5212
|
case Process:
|
|
6971
5213
|
return Promise.resolve().then(function () { return Process_ipc; });
|
|
@@ -7109,15 +5351,6 @@ const IpcParentWithElectronUtilityProcess = {
|
|
|
7109
5351
|
wrap
|
|
7110
5352
|
};
|
|
7111
5353
|
|
|
7112
|
-
const beep = () => {
|
|
7113
|
-
shell.beep();
|
|
7114
|
-
};
|
|
7115
|
-
|
|
7116
|
-
const Beep = {
|
|
7117
|
-
__proto__: null,
|
|
7118
|
-
beep
|
|
7119
|
-
};
|
|
7120
|
-
|
|
7121
5354
|
const name$w = 'App';
|
|
7122
5355
|
const Commands$w = {};
|
|
7123
5356
|
|
|
@@ -7348,6 +5581,10 @@ const AppWindow_ipc = {
|
|
|
7348
5581
|
name: name$v
|
|
7349
5582
|
};
|
|
7350
5583
|
|
|
5584
|
+
const beep = () => {
|
|
5585
|
+
shell.beep();
|
|
5586
|
+
};
|
|
5587
|
+
|
|
7351
5588
|
const name$u = 'Beep';
|
|
7352
5589
|
const Commands$u = {
|
|
7353
5590
|
beep: beep
|
|
@@ -7944,9 +6181,23 @@ const ElectronSafeStorage_ipc = {
|
|
|
7944
6181
|
name: name$g
|
|
7945
6182
|
};
|
|
7946
6183
|
|
|
6184
|
+
const shouldOpenExternal = url => {
|
|
6185
|
+
if (url.startsWith('http:') || url.startsWith('https:')) {
|
|
6186
|
+
return true;
|
|
6187
|
+
}
|
|
6188
|
+
return false;
|
|
6189
|
+
};
|
|
6190
|
+
|
|
6191
|
+
const openExternal = async url => {
|
|
6192
|
+
if (!shouldOpenExternal(url)) {
|
|
6193
|
+
throw new VError(`only http or https urls are allowed`);
|
|
6194
|
+
}
|
|
6195
|
+
await shell.openExternal(url);
|
|
6196
|
+
};
|
|
6197
|
+
|
|
7947
6198
|
const name$f = 'ElectronShell';
|
|
7948
6199
|
const Commands$f = {
|
|
7949
|
-
beep: beep
|
|
6200
|
+
beep: beep,
|
|
7950
6201
|
openExternal: openExternal,
|
|
7951
6202
|
openPath: showItemInFolder,
|
|
7952
6203
|
showItemInFolder: showItemInFolder
|
|
@@ -8037,7 +6288,7 @@ const IpcParent_ipc = {
|
|
|
8037
6288
|
|
|
8038
6289
|
const name$b = 'OpenExternal';
|
|
8039
6290
|
const Commands$b = {
|
|
8040
|
-
openExternal: openExternal
|
|
6291
|
+
openExternal: openExternal
|
|
8041
6292
|
};
|
|
8042
6293
|
|
|
8043
6294
|
const OpenExternal_ipc = {
|
|
@@ -8177,8 +6428,8 @@ const getStats$1 = webContentsId => {
|
|
|
8177
6428
|
if (!contents) {
|
|
8178
6429
|
return undefined;
|
|
8179
6430
|
}
|
|
8180
|
-
const canGoBack = contents.canGoBack();
|
|
8181
|
-
const canGoForward = contents.canGoForward();
|
|
6431
|
+
const canGoBack = contents.navigationHistory.canGoBack();
|
|
6432
|
+
const canGoForward = contents.navigationHistory.canGoForward();
|
|
8182
6433
|
const url = contents.getURL();
|
|
8183
6434
|
const title = contents.getTitle();
|
|
8184
6435
|
return {
|