standard-log-color 12.1.2 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +6 -6
  2. package/cjs/ansi/ansiFormatter.d.ts +1 -1
  3. package/cjs/ansi/ansiFormatter.d.ts.map +1 -1
  4. package/cjs/ansi/ansiFormatter.js +1 -2
  5. package/cjs/ansi/ansiFormatter.js.map +1 -1
  6. package/cjs/ansi/wrapAnsi.js +1 -2
  7. package/cjs/ansi/wrapAnsi.js.map +1 -1
  8. package/cjs/createColorLogReporter.browser.js +6 -7
  9. package/cjs/createColorLogReporter.browser.js.map +1 -1
  10. package/cjs/createColorLogReporter.js +1 -2
  11. package/cjs/createColorLogReporter.js.map +1 -1
  12. package/cjs/css/colors.d.ts +1 -1
  13. package/cjs/css/colors.d.ts.map +1 -1
  14. package/cjs/css/colors.js.map +1 -1
  15. package/cjs/css/cssFormatter.d.ts +1 -1
  16. package/cjs/css/cssFormatter.d.ts.map +1 -1
  17. package/cjs/css/cssFormatter.js +4 -5
  18. package/cjs/css/cssFormatter.js.map +1 -1
  19. package/cjs/supportColor.js +3 -3
  20. package/cjs/supportColor.js.map +1 -1
  21. package/cjs/types.d.ts.map +1 -1
  22. package/cjs/types.js.map +1 -1
  23. package/dist/standard-log-color.esm.js +1 -1
  24. package/dist/standard-log-color.esm.js.gz +0 -0
  25. package/dist/standard-log-color.esm.js.map +1 -1
  26. package/dist/standard-log-color.esm.js.map.gz +0 -0
  27. package/dist/standard-log-color.nodenext.js +1 -1
  28. package/dist/standard-log-color.nodenext.js.gz +0 -0
  29. package/dist/standard-log-color.nodenext.js.map +1 -1
  30. package/dist/standard-log-color.nodenext.js.map.gz +0 -0
  31. package/esm/ansi/ansiFormatter.d.ts +1 -1
  32. package/esm/ansi/ansiFormatter.d.ts.map +1 -1
  33. package/esm/ansi/ansiFormatter.js.map +1 -1
  34. package/esm/createColorLogReporter.browser.js +5 -5
  35. package/esm/createColorLogReporter.browser.js.map +1 -1
  36. package/esm/css/colors.d.ts +1 -1
  37. package/esm/css/colors.d.ts.map +1 -1
  38. package/esm/css/colors.js.map +1 -1
  39. package/esm/css/cssFormatter.d.ts +1 -1
  40. package/esm/css/cssFormatter.d.ts.map +1 -1
  41. package/esm/css/cssFormatter.js +3 -3
  42. package/esm/css/cssFormatter.js.map +1 -1
  43. package/esm/supportColor.js +1 -1
  44. package/esm/supportColor.js.map +1 -1
  45. package/esm/types.d.ts.map +1 -1
  46. package/esm/types.js.map +1 -1
  47. package/package.json +23 -38
  48. package/ts/ansi/ansiFormatter.ts +3 -3
  49. package/ts/createColorLogReporter.browser.ts +5 -5
  50. package/ts/css/colors.ts +1 -1
  51. package/ts/css/cssFormatter.ts +5 -5
  52. package/ts/types.ts +8 -8
  53. package/dist/standard-log-color.es5.js +0 -2
  54. package/dist/standard-log-color.es5.js.gz +0 -0
  55. package/dist/standard-log-color.es5.js.map +0 -1
  56. package/dist/standard-log-color.es5.js.map.gz +0 -0
package/README.md CHANGED
@@ -69,15 +69,15 @@ createCssLogFormatter({ timestamp: 'iso' })
69
69
  createCssLogFormatter({ timestamp: 'elapsed' })
70
70
  ```
71
71
 
72
- [codecov-image]: https://codecov.io/gh/unional/standard-log/branch/master/graph/badge.svg
73
- [codecov-url]: https://codecov.io/gh/unional/standard-log
72
+ [codecov-image]: https://codecov.io/gh/cyberuni/standard-log/branch/main/graph/badge.svg
73
+ [codecov-url]: https://codecov.io/gh/cyberuni/standard-log
74
74
  [downloads-image]: https://img.shields.io/npm/dm/standard-log-color.svg?style=flat
75
75
  [downloads-url]: https://npmjs.org/package/standard-log-color
76
- [github-action-url]: https://github.com/unional/standard-log/actions
77
- [github-nodejs]: https://github.com/unional/standard-log/workflows/release/badge.svg
76
+ [github-action-url]: https://github.com/cyberuni/standard-log/actions
77
+ [github-nodejs]: https://github.com/cyberuni/standard-log/actions/workflows/release.yml/badge.svg
78
78
  [npm-image]: https://img.shields.io/npm/v/standard-log-color.svg?style=flat
79
79
  [npm-url]: https://www.npmjs.com/package/standard-log-color
80
80
  [vscode-image]: https://img.shields.io/badge/vscode-ready-green.svg
81
81
  [vscode-url]: https://code.visualstudio.com/
82
- [rendering-example]: https://github.com/unional/standard-log/tree/main/images/color-log.png
83
- [standard-log]: https://github.com/unional/standard-log
82
+ [rendering-example]: https://github.com/cyberuni/standard-log/tree/main/images/color-log.png
83
+ [standard-log]: https://github.com/cyberuni/standard-log
@@ -1,4 +1,4 @@
1
- import { LogEntry, TimestampFormat } from 'standard-log';
1
+ import { type LogEntry, type TimestampFormat } from 'standard-log';
2
2
  export type AnsiFormatterOptions = {
3
3
  timestamp: TimestampFormat;
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ansiFormatter.d.ts","sourceRoot":"","sources":["../../ts/ansi/ansiFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,QAAQ,EAAE,eAAe,EAAmB,MAAM,cAAc,CAAA;AAkBnG,MAAM,MAAM,oBAAoB,GAAG;IAClC,SAAS,EAAE,eAAe,CAAA;CAC1B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAA4C,WAGnD,QAAQ,WAM7C"}
1
+ {"version":3,"file":"ansiFormatter.d.ts","sourceRoot":"","sources":["../../ts/ansi/ansiFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAmB,MAAM,cAAc,CAAA;AAkB7G,MAAM,MAAM,oBAAoB,GAAG;IAClC,SAAS,EAAE,eAAe,CAAA;CAC1B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAA4C,IAG1D,OAAO,QAAQ,WAM7C"}
@@ -9,7 +9,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
9
9
  return to.concat(ar || Array.prototype.slice.call(from));
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.createAnsiFormatter = void 0;
12
+ exports.createAnsiFormatter = createAnsiFormatter;
13
13
  var standard_log_1 = require("standard-log");
14
14
  var supportColor_js_1 = require("../supportColor.js");
15
15
  var constants_js_1 = require("./constants.js");
@@ -24,7 +24,6 @@ function createAnsiFormatter(options) {
24
24
  return __spreadArray([id], args, true);
25
25
  };
26
26
  }
27
- exports.createAnsiFormatter = createAnsiFormatter;
28
27
  function formatArgs(timestampFormatter, method, entry) {
29
28
  var args = __spreadArray([], entry.args, true);
30
29
  var timestamp = timestampFormatter(entry.timestamp);
@@ -1 +1 @@
1
- {"version":3,"file":"ansiFormatter.js","sourceRoot":"","sources":["../../ts/ansi/ansiFormatter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmG;AACnG,sDAA8D;AAC9D,+CAauB;AACvB,6CAAwC;AAMxC,SAAgB,mBAAmB,CAAC,OAAqD;IAArD,wBAAA,EAAA,YAAkC,SAAS,EAAE,MAAM,EAAE;IACxF,IAAM,kBAAkB,GAAG,IAAA,uCAAwB,EAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAEtE,OAAO,SAAS,aAAa,CAAC,KAAe;QAC5C,IAAM,aAAa,GAAG,IAAA,8BAAe,EAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAClD,IAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;QAC5C,IAAM,IAAI,GAAG,UAAU,CAAC,kBAAkB,EAAE,aAAa,EAAE,KAAK,CAAC,CAAA;QACjE,sBAAQ,EAAE,GAAK,IAAI,QAAC;IACrB,CAAC,CAAA;AACF,CAAC;AATD,kDASC;AAED,SAAS,UAAU,CAClB,kBAA2D,EAC3D,MAA2C,EAC3C,KAA2C;IAE3C,IAAM,IAAI,qBAAO,KAAK,CAAC,IAAI,OAAC,CAAA;IAC5B,IAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IACrD,IAAI,SAAS,KAAK,SAAS;QAAE,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ACvB,YAAY,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AACrF,CAAC;AAED,uBAAuB;AACvB,SAAS,eAAe,CAAC,EAAU;IAClC,OAAO,gBAAgB,CAAC,EAAE,CAAC,CAAA;AAC5B,CAAC;AAED,uBAAuB;AACvB,SAAS,oBAAoB,CAAC,EAAU;IACvC,OAAO,gBAAgB,CAAC,EAAE,CAAC,CAAA;AAC5B,CAAC","sourcesContent":["import { createTimestampFormatter, LogEntry, TimestampFormat, toConsoleMethod } from 'standard-log'\nimport { ColorLevels, supportColor } from '../supportColor.js'\nimport {\n\tANSI_BACKGROUND,\n\tANSI_BLACK,\n\tANSI_BLUE,\n\tANSI_BRIGHT,\n\tANSI_CYAN,\n\tANSI_FOREGROUND,\n\tANSI_GREEN,\n\tANSI_MAGENTA,\n\tANSI_RED,\n\tANSI_UNDERSCORE,\n\tANSI_WHITE,\n\tANSI_YELLOW\n} from './constants.js'\nimport { wrapAnsi } from './wrapAnsi.js'\n\nexport type AnsiFormatterOptions = {\n\ttimestamp: TimestampFormat\n}\n\nexport function createAnsiFormatter(options: AnsiFormatterOptions = { timestamp: 'none' }) {\n\tconst timestampFormatter = createTimestampFormatter(options.timestamp)\n\n\treturn function ansiFormatter(entry: LogEntry) {\n\t\tconst consoleMethod = toConsoleMethod(entry.level)\n\t\tconst id = formatID(consoleMethod, entry.id)\n\t\tconst args = formatArgs(timestampFormatter, consoleMethod, entry)\n\t\treturn [id, ...args]\n\t}\n}\n\nfunction formatArgs(\n\ttimestampFormatter: (timestamp: Date) => string | undefined,\n\tmethod: 'error' | 'warn' | 'info' | 'debug',\n\tentry: Pick<LogEntry, 'args' | 'timestamp'>\n) {\n\tconst args = [...entry.args]\n\tconst timestamp = timestampFormatter(entry.timestamp)\n\tif (timestamp !== undefined) args.push(timestamp)\n\tconst textCodes =\n\t\tmethod === 'error'\n\t\t\t? [ANSI_RED + ANSI_FOREGROUND]\n\t\t\t: method === 'warn'\n\t\t\t? [ANSI_YELLOW + ANSI_FOREGROUND]\n\t\t\t: undefined\n\n\treturn textCodes ? args.map(x => wrapAnsi(x, textCodes)) : args\n}\n\nfunction formatID(method: 'error' | 'warn' | 'info' | 'debug', id: string) {\n\tconst colorLevels = supportColor()\n\tconst colorLevel = method === 'error' ? colorLevels.stderr : colorLevels.stdout\n\treturn toIDFormatter(colorLevel)(id)\n}\n\nfunction toIDFormatter(colorLevel: ColorLevels) {\n\t// istanbul ignore next\n\tswitch (colorLevel) {\n\t\tcase ColorLevels.DISABLED:\n\t\t\treturn (id: string) => id\n\t\tcase ColorLevels.BASIC:\n\t\t\treturn basicIDFormatter\n\t\tcase ColorLevels.ANSI:\n\t\t\treturn ansiIDFormatter\n\t\tcase ColorLevels.TRUE:\n\t\t\treturn truecolorIDFormatter\n\t}\n}\n\nfunction basicIDFormatter(id: string) {\n\tconst codes = getAnsiColor(id)\n\treturn wrapAnsi(` ${id} `, codes)\n}\n\nconst ansiColors: {\n\tcounter: number\n\tlist: Array<number[]>\n} = {\n\tcounter: 0,\n\tlist: [\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE]\n\t]\n}\nconst ansiColorMap: Record<string, number[]> = Object.create(null)\n\nfunction getAnsiColor(id: string) {\n\treturn (ansiColorMap[id] =\n\t\tansiColorMap[id] || ansiColors.list[ansiColors.counter++ % ansiColors.list.length])\n}\n\n// istanbul ignore next\nfunction ansiIDFormatter(id: string) {\n\treturn basicIDFormatter(id)\n}\n\n// istanbul ignore next\nfunction truecolorIDFormatter(id: string) {\n\treturn basicIDFormatter(id)\n}\n"]}
1
+ {"version":3,"file":"ansiFormatter.js","sourceRoot":"","sources":["../../ts/ansi/ansiFormatter.ts"],"names":[],"mappings":";;;;;;;;;;;AAsBA,kDASC;AA/BD,6CAA6G;AAC7G,sDAA8D;AAC9D,+CAauB;AACvB,6CAAwC;AAMxC,SAAgB,mBAAmB,CAAC,OAAqD;IAArD,wBAAA,EAAA,YAAkC,SAAS,EAAE,MAAM,EAAE;IACxF,IAAM,kBAAkB,GAAG,IAAA,uCAAwB,EAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAEtE,OAAO,SAAS,aAAa,CAAC,KAAe;QAC5C,IAAM,aAAa,GAAG,IAAA,8BAAe,EAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAClD,I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W,EAAE,8BAAe,CAAC;QACzF,CAAC,yBAAU,GAAG,8BAAe,EAAE,2BAAY,GAAG,8BAAe,EAAE,0BAAW,EAAE,8BAAe,CAAC;QAC5F,CAAC,yBAAU,GAAG,8BAAe,EAAE,wBAAS,GAAG,8BAAe,EAAE,0BAAW,EAAE,8BAAe,CAAC;QACzF,CAAC,yBAAU,GAAG,8BAAe,EAAE,yBAAU,GAAG,8BAAe,EAAE,0BAAW,EAAE,8BAAe,CAAC;KAC1F;CACD,CAAA;AACD,IAAM,YAAY,GAA6B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAElE,SAAS,YAAY,CAAC,EAAU;IAC/B,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACvB,YAAY,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AACrF,CAAC;AAED,uBAAuB;AACvB,SAAS,eAAe,CAAC,EAAU;IAClC,OAAO,gBAAgB,CAAC,EAAE,CAAC,CAAA;AAC5B,CAAC;AAED,uBAAuB;AACvB,SAAS,oBAAoB,CAAC,EAAU;IACvC,OAAO,gBAAgB,CAAC,EAAE,CAAC,CAAA;AAC5B,CAAC","sourcesContent":["import { createTimestampFormatter, type LogEntry, type TimestampFormat, toConsoleMethod } from 'standard-log'\nimport { ColorLevels, supportColor } from '../supportColor.js'\nimport {\n\tANSI_BACKGROUND,\n\tANSI_BLACK,\n\tANSI_BLUE,\n\tANSI_BRIGHT,\n\tANSI_CYAN,\n\tANSI_FOREGROUND,\n\tANSI_GREEN,\n\tANSI_MAGENTA,\n\tANSI_RED,\n\tANSI_UNDERSCORE,\n\tANSI_WHITE,\n\tANSI_YELLOW\n} from './constants.js'\nimport { wrapAnsi } from './wrapAnsi.js'\n\nexport type AnsiFormatterOptions = {\n\ttimestamp: TimestampFormat\n}\n\nexport function createAnsiFormatter(options: AnsiFormatterOptions = { timestamp: 'none' }) {\n\tconst timestampFormatter = createTimestampFormatter(options.timestamp)\n\n\treturn function ansiFormatter(entry: LogEntry) {\n\t\tconst consoleMethod = toConsoleMethod(entry.level)\n\t\tconst id = formatID(consoleMethod, entry.id)\n\t\tconst args = formatArgs(timestampFormatter, consoleMethod, entry)\n\t\treturn [id, ...args]\n\t}\n}\n\nfunction formatArgs(\n\ttimestampFormatter: (timestamp: Date) => string | undefined,\n\tmethod: 'error' | 'warn' | 'info' | 'debug',\n\tentry: Pick<LogEntry, 'args' | 'timestamp'>\n) {\n\tconst args = [...entry.args]\n\tconst timestamp = timestampFormatter(entry.timestamp)\n\tif (timestamp !== undefined) args.push(timestamp)\n\tconst textCodes =\n\t\tmethod === 'error'\n\t\t\t? [ANSI_RED + ANSI_FOREGROUND]\n\t\t\t: method === 'warn'\n\t\t\t\t? [ANSI_YELLOW + ANSI_FOREGROUND]\n\t\t\t\t: undefined\n\n\treturn textCodes ? args.map(x => wrapAnsi(x, textCodes)) : args\n}\n\nfunction formatID(method: 'error' | 'warn' | 'info' | 'debug', id: string) {\n\tconst colorLevels = supportColor()\n\tconst colorLevel = method === 'error' ? colorLevels.stderr : colorLevels.stdout\n\treturn toIDFormatter(colorLevel)(id)\n}\n\nfunction toIDFormatter(colorLevel: ColorLevels) {\n\t// istanbul ignore next\n\tswitch (colorLevel) {\n\t\tcase ColorLevels.DISABLED:\n\t\t\treturn (id: string) => id\n\t\tcase ColorLevels.BASIC:\n\t\t\treturn basicIDFormatter\n\t\tcase ColorLevels.ANSI:\n\t\t\treturn ansiIDFormatter\n\t\tcase ColorLevels.TRUE:\n\t\t\treturn truecolorIDFormatter\n\t}\n}\n\nfunction basicIDFormatter(id: string) {\n\tconst codes = getAnsiColor(id)\n\treturn wrapAnsi(` ${id} `, codes)\n}\n\nconst ansiColors: {\n\tcounter: number\n\tlist: Array<number[]>\n} = {\n\tcounter: 0,\n\tlist: [\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE]\n\t]\n}\nconst ansiColorMap: Record<string, number[]> = Object.create(null)\n\nfunction getAnsiColor(id: string) {\n\treturn (ansiColorMap[id] =\n\t\tansiColorMap[id] || ansiColors.list[ansiColors.counter++ % ansiColors.list.length])\n}\n\n// istanbul ignore next\nfunction ansiIDFormatter(id: string) {\n\treturn basicIDFormatter(id)\n}\n\n// istanbul ignore next\nfunction truecolorIDFormatter(id: string) {\n\treturn basicIDFormatter(id)\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wrapAnsi = void 0;
3
+ exports.wrapAnsi = wrapAnsi;
4
4
  function wrapAnsi(text, codes) {
5
5
  return "\u001B[".concat(codes.join(';'), "m").concat(text, "\u001B[0m");
6
6
  }
7
- exports.wrapAnsi = wrapAnsi;
8
7
  //# sourceMappingURL=wrapAnsi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wrapAnsi.js","sourceRoot":"","sources":["../../ts/ansi/wrapAnsi.ts"],"names":[],"mappings":";;;AAAA,SAAgB,QAAQ,CAAC,IAAY,EAAE,KAAe;IACrD,OAAO,iBAAU,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,cAAI,IAAI,cAAW,CAAA;AACpD,CAAC;AAFD,4BAEC","sourcesContent":["export function wrapAnsi(text: string, codes: number[]) {\n\treturn `\\u001B[${codes.join(';')}m${text}\\u001B[0m`\n}\n"]}
1
+ {"version":3,"file":"wrapAnsi.js","sourceRoot":"","sources":["../../ts/ansi/wrapAnsi.ts"],"names":[],"mappings":";;AAAA,4BAEC;AAFD,SAAgB,QAAQ,CAAC,IAAY,EAAE,KAAe;IACrD,OAAO,iBAAU,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,cAAI,IAAI,cAAW,CAAA;AACpD,CAAC","sourcesContent":["export function wrapAnsi(text: string, codes: number[]) {\n\treturn `\\u001B[${codes.join(';')}m${text}\\u001B[0m`\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createColorLogReporter = void 0;
3
+ exports.createColorLogReporter = createColorLogReporter;
4
4
  var standard_log_1 = require("standard-log");
5
5
  var unpartial_1 = require("unpartial");
6
6
  var index_js_1 = require("./css/index.js");
@@ -11,14 +11,13 @@ function createColorLogReporter(options) {
11
11
  : standard_log_1.consoleFormatter
12
12
  }, options));
13
13
  }
14
- exports.createColorLogReporter = createColorLogReporter;
15
14
  // istanbul ignore next
16
15
  function supportCSSColorInConsole() {
17
16
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18
17
  // NB: In an Electron preload script, document will be defined but not fully
19
18
  // initialized. Since we know we're in Chrome, we'll just detect this case
20
19
  // explicitly
21
- // @ts-ignore
20
+ // @ts-expect-error
22
21
  if (((_a = window === null || window === void 0 ? void 0 : window.process) === null || _a === void 0 ? void 0 : _a.type) === 'renderer' || ((_b = window === null || window === void 0 ? void 0 : window.process) === null || _b === void 0 ? void 0 : _b.__nwjs)) {
23
22
  return true;
24
23
  }
@@ -29,17 +28,17 @@ function supportCSSColorInConsole() {
29
28
  // Is webkit? http://stackoverflow.com/a/16459606/376773
30
29
  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
31
30
  return (
32
- // @ts-ignore
31
+ // @ts-expect-error
33
32
  ((_e = (_d = document === null || document === void 0 ? void 0 : document.documentElement) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.WebkitAppearance) ||
34
33
  (
35
34
  // Is firebug? http://stackoverflow.com/a/398120/376773
36
- // @ts-ignore
35
+ // @ts-expect-error
37
36
  (_f = window === null || window === void 0 ? void 0 : window.console) === null || _f === void 0 ? void 0 : _f.firebug) ||
38
- // @ts-ignore
37
+ // @ts-expect-error
39
38
  (((_g = window === null || window === void 0 ? void 0 : window.console) === null || _g === void 0 ? void 0 : _g.exception) && ((_h = window === null || window === void 0 ? void 0 : window.console) === null || _h === void 0 ? void 0 : _h.table)) ||
40
39
  // Is firefox >= v31?
41
40
  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
42
- (((_j = navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) === null || _j === void 0 ? void 0 : _j.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(RegExp.$1, 10) >= 31) ||
41
+ (((_j = navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) === null || _j === void 0 ? void 0 : _j.toLowerCase().match(/firefox\/(\d+)/)) && Number.parseInt(RegExp.$1, 10) >= 31) ||
43
42
  (
44
43
  // Double check webkit in userAgent just in case we are in a worker
45
44
  (_k = navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) === null || _k === void 0 ? void 0 : _k.toLowerCase().match(/applewebkit\/(\d+)/)));
@@ -1 +1 @@
1
- {"version":3,"file":"createColorLogReporter.browser.js","sourceRoot":"","sources":["../ts/createColorLogReporter.browser.ts"],"names":[],"mappings":";;;AAAA,6CAAyE;AACzE,uCAAqC;AACrC,2CAAmD;AAGnD,SAAgB,sBAAsB,CAAC,OAAiC;IACvE,OAAO,IAAA,uCAAwB,EAC9B,IAAA,qBAAS,EACR;QACC,SAAS,EAAE,wBAAwB,EAAE;YACpC,CAAC,CAAC,IAAA,6BAAkB,EAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,CAAC;YAClD,CAAC,CAAC,+BAAgB;KACnB,EACD,OAAO,CACP,CACD,CAAA;AACF,CAAC;AAXD,wDAWC;AAED,uBAAuB;AACvB,SAAS,wBAAwB;;IAChC,4EAA4E;IAC5E,0EAA0E;IAC1E,aAAa;IACb,aAAa;IACb,IAAI,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,IAAI,MAAK,UAAU,KAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,MAAM,CAAA,EAAE;QACpE,OAAO,IAAI,CAAA;KACX;IAED,oDAAoD;IACpD,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,WAAW,GAAG,KAAK,CAAC,uBAAuB,CAAC,EAAE;QACvE,OAAO,KAAK,CAAA;KACZ;IAED,wDAAwD;IACxD,4FAA4F;IAC5F,OAAO;IACN,aAAa;IACb,CAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,0CAAE,KAAK,0CAAE,gBAAgB;;QAClD,uDAAuD;QACvD,aAAa;QACb,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,OAAO,CAAA;QACxB,aAAa;QACb,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,SAAS,MAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,KAAK,CAAA,CAAC;QACtD,qBAAqB;QACrB,8EAA8E;QAC9E,CAAC,CAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,WAAW,GAAG,KAAK,CAAC,gBAAgB,CAAC,KAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;;QAC9F,mEAAmE;QACnE,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,WAAW,GAAG,KAAK,CAAC,oBAAoB,CAAC,CAAA,CAC/D,CAAA;AACF,CAAC","sourcesContent":["import { consoleFormatter, createConsoleLogReporter } from 'standard-log'\nimport { unpartial } from 'unpartial'\nimport { createCssFormatter } from './css/index.js'\nimport type { ColorLogReporterOptions } from './types.js'\n\nexport function createColorLogReporter(options?: ColorLogReporterOptions) {\n\treturn createConsoleLogReporter(\n\t\tunpartial(\n\t\t\t{\n\t\t\t\tformatter: supportCSSColorInConsole()\n\t\t\t\t\t? createCssFormatter(options?.cssFormatterOptions)\n\t\t\t\t\t: consoleFormatter\n\t\t\t},\n\t\t\toptions\n\t\t)\n\t)\n}\n\n// istanbul ignore next\nfunction supportCSSColorInConsole() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\t// @ts-ignore\n\tif (window?.process?.type === 'renderer' || window?.process?.__nwjs) {\n\t\treturn true\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (navigator?.userAgent?.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (\n\t\t// @ts-ignore\n\t\tdocument?.documentElement?.style?.WebkitAppearance ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t// @ts-ignore\n\t\twindow?.console?.firebug ||\n\t\t// @ts-ignore\n\t\t(window?.console?.exception && window?.console?.table) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(navigator?.userAgent?.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\tnavigator?.userAgent?.toLowerCase().match(/applewebkit\\/(\\d+)/)\n\t)\n}\n"]}
1
+ {"version":3,"file":"createColorLogReporter.browser.js","sourceRoot":"","sources":["../ts/createColorLogReporter.browser.ts"],"names":[],"mappings":";;AAKA,wDAWC;AAhBD,6CAAyE;AACzE,uCAAqC;AACrC,2CAAmD;AAGnD,SAAgB,sBAAsB,CAAC,OAAiC;IACvE,OAAO,IAAA,uCAAwB,EAC9B,IAAA,qBAAS,EACR;QACC,SAAS,EAAE,wBAAwB,EAAE;YACpC,CAAC,CAAC,IAAA,6BAAkB,EAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,CAAC;YAClD,CAAC,CAAC,+BAAgB;KACnB,EACD,OAAO,CACP,CACD,CAAA;AACF,CAAC;AAED,uBAAuB;AACvB,SAAS,wBAAwB;;IAChC,4EAA4E;IAC5E,0EAA0E;IAC1E,aAAa;IACb,mBAAmB;IACnB,IAAI,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,IAAI,MAAK,UAAU,KAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,MAAM,CAAA,EAAE,CAAC;QACrE,OAAO,IAAI,CAAA;IACZ,CAAC;IAED,oDAAoD;IACpD,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,WAAW,GAAG,KAAK,CAAC,uBAAuB,CAAC,EAAE,CAAC;QACxE,OAAO,KAAK,CAAA;IACb,CAAC;IAED,wDAAwD;IACxD,4FAA4F;IAC5F,OAAO;IACN,mBAAmB;IACnB,CAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,0CAAE,KAAK,0CAAE,gBAAgB;;QAClD,uDAAuD;QACvD,mBAAmB;QACnB,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,OAAO,CAAA;QACxB,mBAAmB;QACnB,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,SAAS,MAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,KAAK,CAAA,CAAC;QACtD,qBAAqB;QACrB,8EAA8E;QAC9E,CAAC,CAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,WAAW,GAAG,KAAK,CAAC,gBAAgB,CAAC,KAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;;QACrG,mEAAmE;QACnE,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,WAAW,GAAG,KAAK,CAAC,oBAAoB,CAAC,CAAA,CAC/D,CAAA;AACF,CAAC","sourcesContent":["import { consoleFormatter, createConsoleLogReporter } from 'standard-log'\nimport { unpartial } from 'unpartial'\nimport { createCssFormatter } from './css/index.js'\nimport type { ColorLogReporterOptions } from './types.js'\n\nexport function createColorLogReporter(options?: ColorLogReporterOptions) {\n\treturn createConsoleLogReporter(\n\t\tunpartial(\n\t\t\t{\n\t\t\t\tformatter: supportCSSColorInConsole()\n\t\t\t\t\t? createCssFormatter(options?.cssFormatterOptions)\n\t\t\t\t\t: consoleFormatter\n\t\t\t},\n\t\t\toptions\n\t\t)\n\t)\n}\n\n// istanbul ignore next\nfunction supportCSSColorInConsole() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\t// @ts-expect-error\n\tif (window?.process?.type === 'renderer' || window?.process?.__nwjs) {\n\t\treturn true\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (navigator?.userAgent?.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (\n\t\t// @ts-expect-error\n\t\tdocument?.documentElement?.style?.WebkitAppearance ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t// @ts-expect-error\n\t\twindow?.console?.firebug ||\n\t\t// @ts-expect-error\n\t\t(window?.console?.exception && window?.console?.table) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(navigator?.userAgent?.toLowerCase().match(/firefox\\/(\\d+)/) && Number.parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\tnavigator?.userAgent?.toLowerCase().match(/applewebkit\\/(\\d+)/)\n\t)\n}\n"]}
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createColorLogReporter = void 0;
3
+ exports.createColorLogReporter = createColorLogReporter;
4
4
  var standard_log_1 = require("standard-log");
5
5
  var unpartial_1 = require("unpartial");
6
6
  var index_js_1 = require("./ansi/index.js");
7
7
  function createColorLogReporter(options) {
8
8
  return (0, standard_log_1.createConsoleLogReporter)((0, unpartial_1.required)({ formatter: (0, index_js_1.createAnsiFormatter)() }, options));
9
9
  }
10
- exports.createColorLogReporter = createColorLogReporter;
11
10
  //# sourceMappingURL=createColorLogReporter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createColorLogReporter.js","sourceRoot":"","sources":["../ts/createColorLogReporter.ts"],"names":[],"mappings":";;;AAAA,6CAAuD;AACvD,uCAAoC;AACpC,4CAAqD;AAGrD,SAAgB,sBAAsB,CAAC,OAAiC;IACvE,OAAO,IAAA,uCAAwB,EAAC,IAAA,oBAAQ,EAAC,EAAE,SAAS,EAAE,IAAA,8BAAmB,GAAE,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;AACzF,CAAC;AAFD,wDAEC","sourcesContent":["import { createConsoleLogReporter } from 'standard-log'\nimport { required } from 'unpartial'\nimport { createAnsiFormatter } from './ansi/index.js'\nimport type { ColorLogReporterOptions } from './types.js'\n\nexport function createColorLogReporter(options?: ColorLogReporterOptions) {\n\treturn createConsoleLogReporter(required({ formatter: createAnsiFormatter() }, options))\n}\n"]}
1
+ {"version":3,"file":"createColorLogReporter.js","sourceRoot":"","sources":["../ts/createColorLogReporter.ts"],"names":[],"mappings":";;AAKA,wDAEC;AAPD,6CAAuD;AACvD,uCAAoC;AACpC,4CAAqD;AAGrD,SAAgB,sBAAsB,CAAC,OAAiC;IACvE,OAAO,IAAA,uCAAwB,EAAC,IAAA,oBAAQ,EAAC,EAAE,SAAS,EAAE,IAAA,8BAAmB,GAAE,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;AACzF,CAAC","sourcesContent":["import { createConsoleLogReporter } from 'standard-log'\nimport { required } from 'unpartial'\nimport { createAnsiFormatter } from './ansi/index.js'\nimport type { ColorLogReporterOptions } from './types.js'\n\nexport function createColorLogReporter(options?: ColorLogReporterOptions) {\n\treturn createConsoleLogReporter(required({ formatter: createAnsiFormatter() }, options))\n}\n"]}
@@ -1,3 +1,3 @@
1
- import { ColorMap } from 'color-map';
1
+ import type { ColorMap } from 'color-map';
2
2
  export declare const rainbow: ColorMap;
3
3
  //# sourceMappingURL=colors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../ts/css/colors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,eAAO,MAAM,OAAO,EAAE,QAUrB,CAAA"}
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../ts/css/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC,eAAO,MAAM,OAAO,EAAE,QAUrB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../ts/css/colors.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAa;IAChC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE;IAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE;IAClC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE;IAClC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE;IACpC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE;IACnC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE;IACpC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE;IACnC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE;IACpC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;CAC9B,CAAA","sourcesContent":["import { ColorMap } from 'color-map'\n\nexport const rainbow: ColorMap = [\n\t{ index: 0, rgb: [150, 0, 90] },\n\t{ index: 0.125, rgb: [0, 0, 200] },\n\t{ index: 0.25, rgb: [0, 25, 255] },\n\t{ index: 0.375, rgb: [0, 152, 255] },\n\t{ index: 0.5, rgb: [44, 255, 150] },\n\t{ index: 0.625, rgb: [151, 255, 0] },\n\t{ index: 0.75, rgb: [255, 234, 0] },\n\t{ index: 0.875, rgb: [255, 111, 0] },\n\t{ index: 1, rgb: [255, 0, 0] }\n]\n"]}
1
+ {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../ts/css/colors.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAa;IAChC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE;IAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE;IAClC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE;IAClC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE;IACpC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE;IACnC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE;IACpC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE;IACnC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE;IACpC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;CAC9B,CAAA","sourcesContent":["import type { ColorMap } from 'color-map'\n\nexport const rainbow: ColorMap = [\n\t{ index: 0, rgb: [150, 0, 90] },\n\t{ index: 0.125, rgb: [0, 0, 200] },\n\t{ index: 0.25, rgb: [0, 25, 255] },\n\t{ index: 0.375, rgb: [0, 152, 255] },\n\t{ index: 0.5, rgb: [44, 255, 150] },\n\t{ index: 0.625, rgb: [151, 255, 0] },\n\t{ index: 0.75, rgb: [255, 234, 0] },\n\t{ index: 0.875, rgb: [255, 111, 0] },\n\t{ index: 1, rgb: [255, 0, 0] }\n]\n"]}
@@ -1,4 +1,4 @@
1
- import { LogEntry } from 'standard-log';
1
+ import { type LogEntry } from 'standard-log';
2
2
  import type { CssFormatterOptions } from '../types.js';
3
3
  export declare function createCssFormatter(options?: CssFormatterOptions): (entry: LogEntry) => any[];
4
4
  //# sourceMappingURL=cssFormatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cssFormatter.d.ts","sourceRoot":"","sources":["../../ts/css/cssFormatter.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGtD,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,mBAAmB,WAe3B,QAAQ,WA8B5C"}
1
+ {"version":3,"file":"cssFormatter.d.ts","sourceRoot":"","sources":["../../ts/css/cssFormatter.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGtD,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,mBAAmB,IAelC,OAAO,QAAQ,WA8B5C"}
@@ -9,7 +9,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
9
9
  return to.concat(ar || Array.prototype.slice.call(from));
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.createCssFormatter = void 0;
12
+ exports.createCssFormatter = createCssFormatter;
13
13
  var color_map_1 = require("color-map");
14
14
  var standard_log_1 = require("standard-log");
15
15
  var unpartial_1 = require("unpartial");
@@ -54,7 +54,6 @@ function createCssFormatter(options) {
54
54
  return (loggerMap[id] = loggerMap[id] || colorMap[count++ & maxColor]);
55
55
  }
56
56
  }
57
- exports.createCssFormatter = createCssFormatter;
58
57
  var gammaMap = {
59
58
  rc: 0.2126,
60
59
  gc: 0.7152,
@@ -82,9 +81,9 @@ function getRelativeLuminance(rgb) {
82
81
  var rsrgb = rgb[0] / 255;
83
82
  var gsrgb = rgb[1] / 255;
84
83
  var bsrgb = rgb[2] / 255;
85
- var r = rsrgb <= 0.03928 ? rsrgb * gammaMap['lowc'] : Math.pow((rsrgb + 0.055) / 1.055, 2.4);
86
- var g = gsrgb <= 0.03928 ? gsrgb * gammaMap['lowc'] : Math.pow((gsrgb + 0.055) / 1.055, 2.4);
87
- var b = bsrgb <= 0.03928 ? bsrgb * gammaMap['lowc'] : Math.pow((bsrgb + 0.055) / 1.055, 2.4);
84
+ var r = rsrgb <= 0.03928 ? rsrgb * gammaMap['lowc'] : Math.pow(((rsrgb + 0.055) / 1.055), 2.4);
85
+ var g = gsrgb <= 0.03928 ? gsrgb * gammaMap['lowc'] : Math.pow(((gsrgb + 0.055) / 1.055), 2.4);
86
+ var b = bsrgb <= 0.03928 ? bsrgb * gammaMap['lowc'] : Math.pow(((bsrgb + 0.055) / 1.055), 2.4);
88
87
  return r * gammaMap['rc'] + g * gammaMap['gc'] + b * gammaMap['bc'];
89
88
  }
90
89
  function getComplementary(rgb) {
@@ -1 +1 @@
1
- {"version":3,"file":"cssFormatter.js","sourceRoot":"","sources":["../../ts/css/cssFormatter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAkE;AAClE,6CAAiE;AACjE,uCAAoC;AAEpC,yCAAqC;AAErC,SAAgB,kBAAkB,CAAC,OAA6B;IACzD,IAAA,KAAiC,IAAA,oBAAQ,EAC9C;QACC,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,MAAM;QACjB,KAAK,EAAE,kCAAkC;KACzC,EACD,OAAO,CACP,EAPO,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAE,KAAK,WAOjC,CAAA;IACD,IAAM,SAAS,GAAwB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC1D,IAAM,QAAQ,GAAW,IAAA,+BAAmB,EAAC,mBAAO,EAAE,QAAQ,CAAC,CAAA;IAC/D,IAAI,KAAK,GAAG,CAAC,CAAA;IAEb,IAAM,kBAAkB,GAAG,IAAA,uCAAwB,EAAC,SAAS,CAAC,CAAA;IAE9D,OAAO,SAAS,YAAY,CAAC,KAAe;QAC3C,IAAI,KAAK,GAAG,aAAM,KAAK,CAAC,EAAE,MAAG,CAAA;QAC7B,IAAI,IAAW,CAAA;QACf,IAAI,uBAAuB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YACxC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACtB,IAAI,qBAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAC,CAAA;SAC/B;aAAM;YACN,IAAI,qBAAO,KAAK,CAAC,IAAI,OAAC,CAAA;SACtB;QACD,IAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAC5B,IAAM,UAAU,GAAG,IAAA,kBAAM,EAAC,GAAG,CAAC,CAAA;QAC9B,IAAM,MAAM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AAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAA;IAC9F,IAAM,CAAC,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAA;IAC9F,IAAM,CAAC,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAA;IAE9F,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;AACpE,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAQ;IACjC,IAAM,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;IACtB,IAAM,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;IACtB,IAAM,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;IACtB,OAAO,IAAA,kBAAM,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACzB,CAAC","sourcesContent":["import { createColorsFromMap, RGB, RGBA, rgbHex } from 'color-map'\nimport { createTimestampFormatter, LogEntry } from 'standard-log'\nimport { required } from 'unpartial'\nimport type { CssFormatterOptions } from '../types.js'\nimport { rainbow } from './colors.js'\n\nexport function createCssFormatter(options?: CssFormatterOptions) {\n\tconst { maxColor, timestamp, style } = required(\n\t\t{\n\t\t\tmaxColor: 20,\n\t\t\ttimestamp: 'none',\n\t\t\tstyle: 'padding: 2px; line-height: 1rem;'\n\t\t},\n\t\toptions\n\t)\n\tconst loggerMap: Record<string, RGB> = Object.create(null)\n\tconst colorMap: RGBA[] = createColorsFromMap(rainbow, maxColor)\n\tlet count = 0\n\n\tconst timestampFormatter = createTimestampFormatter(timestamp)\n\n\treturn function cssFormatter(entry: LogEntry) {\n\t\tlet idStr = `%c ${entry.id} `\n\t\tlet args: any[]\n\t\tif (firstArgIsColorTemplate(entry.args)) {\n\t\t\tidStr += entry.args[0]\n\t\t\targs = [...entry.args.slice(1)]\n\t\t} else {\n\t\t\targs = [...entry.args]\n\t\t}\n\t\tconst rgb = getRgb(entry.id)\n\t\tconst background = rgbHex(rgb)\n\t\tconst border = rgbHex(rgb.map(x => Math.max(0, x - 32)) as RGB)\n\t\tconst color = getForegroundColor(rgb)\n\t\tconst result = [\n\t\t\tidStr,\n\t\t\t`${style}background: ${background};border: 1px solid ${border};color: ${color};`,\n\t\t\t...args\n\t\t]\n\t\tconst t = timestampFormatter(entry.timestamp)\n\t\tif (t !== undefined) result.push(t)\n\t\treturn result\n\t}\n\n\tfunction firstArgIsColorTemplate(args: any[]) {\n\t\treturn typeof args[0] === 'string' && args[0].indexOf('%c') !== -1\n\t}\n\n\tfunction getRgb(id: string) {\n\t\treturn (loggerMap[id] = loggerMap[id] || colorMap[count++ & maxColor])\n\t}\n}\n\nconst gammaMap = {\n\trc: 0.2126,\n\tgc: 0.7152,\n\tbc: 0.0722,\n\tlowc: 1 / 12.92\n}\n\nfunction getForegroundColor(background: RGB) {\n\t// Setting the contrasting color as default\n\tlet color = getComplementary(background)\n\tconst bgLuminance = getRelativeLuminance(background)\n\tconst fgLuminance =\n\t\tcolor === '#ffffff' ? getRelativeLuminance([255, 255, 255]) : getRelativeLuminance([0, 0, 0])\n\tconst relativeL =\n\t\tbgLuminance > fgLuminance\n\t\t\t? (bgLuminance + 0.05) / (fgLuminance + 0.05)\n\t\t\t: (fgLuminance + 0.05) / (bgLuminance + 0.05)\n\n\t// Can set the contrast ratio based on text size later.\n\tif (relativeL < 4.5) {\n\t\tconst avgLuminance =\n\t\t\tbackground[0] * gammaMap['rc'] + background[1] * gammaMap['gc'] + background[2] * gammaMap['bc']\n\n\t\t// If the relative contrast is lower than standard, we switch color to black/white\n\t\tcolor = avgLuminance < 220 ? '#ffffff' : '#000000'\n\t}\n\treturn color\n}\n\nfunction getRelativeLuminance(rgb: RGB) {\n\t// https://www.w3.org/TR/WCAG/#relativeluminancedef\n\tconst rsrgb = rgb[0] / 255\n\tconst gsrgb = rgb[1] / 255\n\tconst bsrgb = rgb[2] / 255\n\n\tconst r = rsrgb <= 0.03928 ? rsrgb * gammaMap['lowc'] : Math.pow((rsrgb + 0.055) / 1.055, 2.4)\n\tconst g = gsrgb <= 0.03928 ? gsrgb * gammaMap['lowc'] : Math.pow((gsrgb + 0.055) / 1.055, 2.4)\n\tconst b = bsrgb <= 0.03928 ? bsrgb * gammaMap['lowc'] : Math.pow((bsrgb + 0.055) / 1.055, 2.4)\n\n\treturn r * gammaMap['rc'] + g * gammaMap['gc'] + b * gammaMap['bc']\n}\n\nfunction getComplementary(rgb: RGB) {\n\tconst r = 255 - rgb[0]\n\tconst g = 255 - rgb[1]\n\tconst b = 255 - rgb[2]\n\treturn rgbHex([r, g, b])\n}\n"]}
1
+ {"version":3,"file":"cssFormatter.js","sourceRoot":"","sources":["../../ts/css/cssFormatter.ts"],"names":[],"mappings":";;;;;;;;;;;AAMA,gDA6CC;AAnDD,uCAA4E;AAC5E,6CAAsE;AACtE,uCAAoC;AAEpC,yCAAqC;AAErC,SAAgB,kBAAkB,CAAC,OAA6B;IACzD,IAAA,KAAiC,IAAA,oBAAQ,EAC9C;QACC,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,MAAM;QACjB,KAAK,EAAE,kCAAkC;KACzC,EACD,OAAO,CACP,EAPO,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAE,KAAK,WAOjC,CAAA;IACD,IAAM,SAAS,GAAwB,MAAM,CAAC,MAAM,CAAC,IA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GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;AACpE,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAQ;IACjC,IAAM,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;IACtB,IAAM,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;IACtB,IAAM,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;IACtB,OAAO,IAAA,kBAAM,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACzB,CAAC","sourcesContent":["import { createColorsFromMap, type RGB, type RGBA, rgbHex } from 'color-map'\nimport { createTimestampFormatter, type LogEntry } from 'standard-log'\nimport { required } from 'unpartial'\nimport type { CssFormatterOptions } from '../types.js'\nimport { rainbow } from './colors.js'\n\nexport function createCssFormatter(options?: CssFormatterOptions) {\n\tconst { maxColor, timestamp, style } = required(\n\t\t{\n\t\t\tmaxColor: 20,\n\t\t\ttimestamp: 'none',\n\t\t\tstyle: 'padding: 2px; line-height: 1rem;'\n\t\t},\n\t\toptions\n\t)\n\tconst loggerMap: Record<string, RGB> = Object.create(null)\n\tconst colorMap: RGBA[] = createColorsFromMap(rainbow, maxColor)\n\tlet count = 0\n\n\tconst timestampFormatter = createTimestampFormatter(timestamp)\n\n\treturn function cssFormatter(entry: LogEntry) {\n\t\tlet idStr = `%c ${entry.id} `\n\t\tlet args: any[]\n\t\tif (firstArgIsColorTemplate(entry.args)) {\n\t\t\tidStr += entry.args[0]\n\t\t\targs = [...entry.args.slice(1)]\n\t\t} else {\n\t\t\targs = [...entry.args]\n\t\t}\n\t\tconst rgb = getRgb(entry.id)\n\t\tconst background = rgbHex(rgb)\n\t\tconst border = rgbHex(rgb.map(x => Math.max(0, x - 32)) as RGB)\n\t\tconst color = getForegroundColor(rgb)\n\t\tconst result = [\n\t\t\tidStr,\n\t\t\t`${style}background: ${background};border: 1px solid ${border};color: ${color};`,\n\t\t\t...args\n\t\t]\n\t\tconst t = timestampFormatter(entry.timestamp)\n\t\tif (t !== undefined) result.push(t)\n\t\treturn result\n\t}\n\n\tfunction firstArgIsColorTemplate(args: any[]) {\n\t\treturn typeof args[0] === 'string' && args[0].indexOf('%c') !== -1\n\t}\n\n\tfunction getRgb(id: string) {\n\t\treturn (loggerMap[id] = loggerMap[id] || colorMap[count++ & maxColor])\n\t}\n}\n\nconst gammaMap = {\n\trc: 0.2126,\n\tgc: 0.7152,\n\tbc: 0.0722,\n\tlowc: 1 / 12.92\n}\n\nfunction getForegroundColor(background: RGB) {\n\t// Setting the contrasting color as default\n\tlet color = getComplementary(background)\n\tconst bgLuminance = getRelativeLuminance(background)\n\tconst fgLuminance =\n\t\tcolor === '#ffffff' ? getRelativeLuminance([255, 255, 255]) : getRelativeLuminance([0, 0, 0])\n\tconst relativeL =\n\t\tbgLuminance > fgLuminance\n\t\t\t? (bgLuminance + 0.05) / (fgLuminance + 0.05)\n\t\t\t: (fgLuminance + 0.05) / (bgLuminance + 0.05)\n\n\t// Can set the contrast ratio based on text size later.\n\tif (relativeL < 4.5) {\n\t\tconst avgLuminance =\n\t\t\tbackground[0] * gammaMap['rc'] + background[1] * gammaMap['gc'] + background[2] * gammaMap['bc']\n\n\t\t// If the relative contrast is lower than standard, we switch color to black/white\n\t\tcolor = avgLuminance < 220 ? '#ffffff' : '#000000'\n\t}\n\treturn color\n}\n\nfunction getRelativeLuminance(rgb: RGB) {\n\t// https://www.w3.org/TR/WCAG/#relativeluminancedef\n\tconst rsrgb = rgb[0] / 255\n\tconst gsrgb = rgb[1] / 255\n\tconst bsrgb = rgb[2] / 255\n\n\tconst r = rsrgb <= 0.03928 ? rsrgb * gammaMap['lowc'] : ((rsrgb + 0.055) / 1.055) ** 2.4\n\tconst g = gsrgb <= 0.03928 ? gsrgb * gammaMap['lowc'] : ((gsrgb + 0.055) / 1.055) ** 2.4\n\tconst b = bsrgb <= 0.03928 ? bsrgb * gammaMap['lowc'] : ((bsrgb + 0.055) / 1.055) ** 2.4\n\n\treturn r * gammaMap['rc'] + g * gammaMap['gc'] + b * gammaMap['bc']\n}\n\nfunction getComplementary(rgb: RGB) {\n\tconst r = 255 - rgb[0]\n\tconst g = 255 - rgb[1]\n\tconst b = 255 - rgb[2]\n\treturn rgbHex([r, g, b])\n}\n"]}
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.supportColor = exports.ColorLevels = void 0;
6
+ exports.ColorLevels = void 0;
7
+ exports.supportColor = supportColor;
7
8
  var supports_color_1 = __importDefault(require("supports-color"));
8
9
  /**
9
10
  * Color level.
@@ -26,7 +27,7 @@ var ColorLevels;
26
27
  * Truecolor 16 million colors (24-bits)
27
28
  */
28
29
  ColorLevels[ColorLevels["TRUE"] = 3] = "TRUE";
29
- })(ColorLevels = exports.ColorLevels || (exports.ColorLevels = {}));
30
+ })(ColorLevels || (exports.ColorLevels = ColorLevels = {}));
30
31
  var value;
31
32
  /**
32
33
  * Detects if the platform supports color.
@@ -43,5 +44,4 @@ function supportColor() {
43
44
  stdout: supports_color_1.default.stdout ? supports_color_1.default.stdout.level : ColorLevels.DISABLED
44
45
  });
45
46
  }
46
- exports.supportColor = supportColor;
47
47
  //# sourceMappingURL=supportColor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"supportColor.js","sourceRoot":"","sources":["../ts/supportColor.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA+B;AAE/B;;;;;GAKG;AACH,IAAY,WAcX;AAdD,WAAY,WAAW;IACtB,qDAAY,CAAA;IACZ;;OAEG;IACH,+CAAS,CAAA;IACT;;OAEG;IACH,6CAAQ,CAAA;IACR;;OAEG;IACH,6CAAQ,CAAA;AACT,CAAC,EAdW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QActB;AAMD,IAAI,KAA0B,CAAA;AAE9B;;;;;;;GAOG;AACH,SAAgB,YAAY;IAC3B,uBAAuB;IACvB,OAAO,CAAC,KAAK,GAAG,KAAK,IAAI;QACxB,MAAM,EAAE,wBAAE,CAAC,MAAM,CAAC,CAAC,CAAC,wBAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;QAC1D,MAAM,EAAE,wBAAE,CAAC,MAAM,CAAC,CAAC,CAAC,wBAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;KAC1D,CAAC,CAAA;AACH,CAAC;AAND,oCAMC","sourcesContent":["import sc from 'supports-color'\n\n/**\n * Color level.\n * This is the same definition as the `ColorSupportLevel` in `supports-color`.\n * Using the same definition for simplicity\n * @see https://github.com/chalk/supports-color/blob/main/index.d.ts#L19\n */\nexport enum ColorLevels {\n\tDISABLED = 0,\n\t/**\n\t * Basic 16 colors (4-bits)\n\t */\n\tBASIC = 1,\n\t/**\n\t * ANSI 256 colors (8-bits)\n\t */\n\tANSI = 2,\n\t/**\n\t * Truecolor 16 million colors (24-bits)\n\t */\n\tTRUE = 3\n}\n\nexport namespace supportColor {\n\texport type Result = { stdout: ColorLevels; stderr: ColorLevels }\n}\n\nlet value: supportColor.Result\n\n/**\n * Detects if the platform supports color.\n * For browser, the value can only be:\n * - `{ stdout: 0, stderr: 0 }` (DISABLED), or\n * - `{ stdout: 3, stderr: 3 }` (TRUE).\n * So you only need to check one case.\n * The result value is made the same so that it can be used in all platforms.\n */\nexport function supportColor(): supportColor.Result {\n\t// istanbul ignore next\n\treturn (value = value || {\n\t\tstderr: sc.stderr ? sc.stderr.level : ColorLevels.DISABLED,\n\t\tstdout: sc.stdout ? sc.stdout.level : ColorLevels.DISABLED\n\t})\n}\n"]}
1
+ {"version":3,"file":"supportColor.js","sourceRoot":"","sources":["../ts/supportColor.ts"],"names":[],"mappings":";;;;;;AAsCA,oCAMC;AA5CD,kEAA+B;AAE/B;;;;;GAKG;AACH,IAAY,WAcX;AAdD,WAAY,WAAW;IACtB,qDAAY,CAAA;IACZ;;OAEG;IACH,+CAAS,CAAA;IACT;;OAEG;IACH,6CAAQ,CAAA;IACR;;OAEG;IACH,6CAAQ,CAAA;AACT,CAAC,EAdW,WAAW,2BAAX,WAAW,QActB;AAMD,IAAI,KAA0B,CAAA;AAE9B;;;;;;;GAOG;AACH,SAAgB,YAAY;IAC3B,uBAAuB;IACvB,OAAO,CAAC,KAAK,GAAG,KAAK,IAAI;QACxB,MAAM,EAAE,wBAAE,CAAC,MAAM,CAAC,CAAC,CAAC,wBAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;QAC1D,MAAM,EAAE,wBAAE,CAAC,MAAM,CAAC,CAAC,CAAC,wBAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ;KAC1D,CAAC,CAAA;AACH,CAAC","sourcesContent":["import sc from 'supports-color'\n\n/**\n * Color level.\n * This is the same definition as the `ColorSupportLevel` in `supports-color`.\n * Using the same definition for simplicity\n * @see https://github.com/chalk/supports-color/blob/main/index.d.ts#L19\n */\nexport enum ColorLevels {\n\tDISABLED = 0,\n\t/**\n\t * Basic 16 colors (4-bits)\n\t */\n\tBASIC = 1,\n\t/**\n\t * ANSI 256 colors (8-bits)\n\t */\n\tANSI = 2,\n\t/**\n\t * Truecolor 16 million colors (24-bits)\n\t */\n\tTRUE = 3\n}\n\nexport namespace supportColor {\n\texport type Result = { stdout: ColorLevels; stderr: ColorLevels }\n}\n\nlet value: supportColor.Result\n\n/**\n * Detects if the platform supports color.\n * For browser, the value can only be:\n * - `{ stdout: 0, stderr: 0 }` (DISABLED), or\n * - `{ stdout: 3, stderr: 3 }` (TRUE).\n * So you only need to check one case.\n * The result value is made the same so that it can be used in all platforms.\n */\nexport function supportColor(): supportColor.Result {\n\t// istanbul ignore next\n\treturn (value = value || {\n\t\tstderr: sc.stderr ? sc.stderr.level : ColorLevels.DISABLED,\n\t\tstdout: sc.stdout ? sc.stdout.level : ColorLevels.DISABLED\n\t})\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../ts/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9E,MAAM,MAAM,mBAAmB,GAAG;IACjC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;OAOG;IACJ,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,yBAAyB,GAAG;IACjE;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;CACzC,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../ts/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9E,MAAM,MAAM,mBAAmB,GAAG;IACjC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,yBAAyB,GAAG;IACjE;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;CACzC,CAAA"}
package/cjs/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../ts/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ConsoleLogReporterOptions, TimestampFormat } from 'standard-log'\n\nexport type CssFormatterOptions = {\n\t/**\n\t * How many colors available.\n\t * Recommend at least 10.\n\t * Default to 20.\n\t */\n\tmaxColor?: number\n /**\n * Style of the timestamp.\n * Defaults to `none`.\n *\n * - `none`: no timestamp.\n * - `iso`: in iso format.\n * - `long`: as elapsed time.\n */\n\ttimestamp?: TimestampFormat\n\t/**\n\t * style of the id block.\n\t * Defaults to `padding: 2px; line-height: 1rem;`\n\t */\n\tstyle?: string\n}\n\nexport type ColorLogReporterOptions = ConsoleLogReporterOptions & {\n\t/**\n\t * CSS formatter options.\n\t * This can be used to specify the CSS formatter options in the browser,\n\t * If you do not specify your own `formatter`.\n\t */\n\tcssFormatterOptions?: CssFormatterOptions\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../ts/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ConsoleLogReporterOptions, TimestampFormat } from 'standard-log'\n\nexport type CssFormatterOptions = {\n\t/**\n\t * How many colors available.\n\t * Recommend at least 10.\n\t * Default to 20.\n\t */\n\tmaxColor?: number\n\t/**\n\t * Style of the timestamp.\n\t * Defaults to `none`.\n\t *\n\t * - `none`: no timestamp.\n\t * - `iso`: in iso format.\n\t * - `long`: as elapsed time.\n\t */\n\ttimestamp?: TimestampFormat\n\t/**\n\t * style of the id block.\n\t * Defaults to `padding: 2px; line-height: 1rem;`\n\t */\n\tstyle?: string\n}\n\nexport type ColorLogReporterOptions = ConsoleLogReporterOptions & {\n\t/**\n\t * CSS formatter options.\n\t * This can be used to specify the CSS formatter options in the browser,\n\t * If you do not specify your own `formatter`.\n\t */\n\tcssFormatterOptions?: CssFormatterOptions\n}\n"]}
@@ -1,2 +1,2 @@
1
- var StandardLogColor;!function(){"use strict";var n={12:function(n){const t=function(){const n=/(Chrome|Chromium)\/(?<chromeVersion>\d+)\./.exec(navigator.userAgent);if(n)return Number.parseInt(n.groups.chromeVersion,10)}()>=69&&{level:1,hasBasic:!0,has256:!1,has16m:!1};n.exports={stdout:t,stderr:t}}},t={};function o(r){var e=t[r];if(void 0!==e)return e.exports;var i=t[r]={exports:{}};return n[r](i,i.exports,o),i.exports}o.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return o.d(t,{a:t}),t},o.d=function(n,t){for(var r in t)o.o(t,r)&&!o.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},o.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var r={};!function(){o.r(r),o.d(r,{ANSI_BACKGROUND:function(){return h},ANSI_BLACK:function(){return d},ANSI_BLUE:function(){return a},ANSI_BRIGHT:function(){return m},ANSI_CYAN:function(){return v},ANSI_FOREGROUND:function(){return w},ANSI_GREEN:function(){return l},ANSI_MAGENTA:function(){return f},ANSI_RED:function(){return c},ANSI_UNDERSCORE:function(){return p},ANSI_WHITE:function(){return g},ANSI_YELLOW:function(){return s},createAnsiFormatter:function(){return S},createColorLogReporter:function(){return F},createCssFormatter:function(){return D},wrapAnsi:function(){return A}});var n,t=StandardLog,e=o(12),i=o.n(e);let u;!function(n){n[n.DISABLED=0]="DISABLED",n[n.BASIC=1]="BASIC",n[n.ANSI=2]="ANSI",n[n.TRUE=3]="TRUE"}(n||(n={}));const d=0,c=1,l=2,s=3,a=4,f=5,v=6,g=7,m=1,p=4,w=30,h=40;function A(n,t){return`[${t.join(";")}m${n}`}function S(o={timestamp:"none"}){const r=(0,t.createTimestampFormatter)(o.timestamp);return function(o){const e=(0,t.toConsoleMethod)(o.level),d=function(t,o){const r=u=u||{stderr:i().stderr?i().stderr.level:n.DISABLED,stdout:i().stdout?i().stdout.level:n.DISABLED};return function(t){switch(t){case n.DISABLED:return n=>n;case n.BASIC:return b;case n.ANSI:return N;case n.TRUE:return E}}("error"===t?r.stderr:r.stdout)(o)}(e,o.id),l=function(n,t,o){const r=[...o.args],e=n(o.timestamp);void 0!==e&&r.push(e);const i="error"===t?[c+w]:"warn"===t?[s+w]:void 0;return i?r.map((n=>A(n,i))):r}(r,e,o);return[d,...l]}}function b(n){const t=function(n){return x[n]=x[n]||I.list[I.counter++%I.list.length]}(n);return A(` ${n} `,t)}const I={counter:0,list:[[g+w,c+h],[d+w,l+h],[d+w,s+h],[g+w,a+h],[g+w,f+h],[d+w,v+h],[g+w,d+h],[g+w,c+h,m],[d+w,l+h,m],[d+w,s+h,m],[g+w,a+h,m],[g+w,f+h,m],[d+w,v+h,m],[g+w,d+h,m],[g+w,c+h,p],[d+w,l+h,p],[d+w,s+h,p],[g+w,a+h,p],[g+w,f+h,p],[d+w,v+h,p],[g+w,d+h,p],[g+w,c+h,m,p],[d+w,l+h,m,p],[d+w,s+h,m,p],[g+w,a+h,m,p],[g+w,f+h,m,p],[d+w,v+h,m,p],[g+w,d+h,m,p]]},x=Object.create(null);function N(n){return b(n)}function E(n){return b(n)}function C(n){return Object.keys(n).reduce(((t,o)=>(_(n[o])&&(t[o]=n[o]),t)),{})}function _(n){return null!=n}function L(n,t,o,r=[4===n.length?n[3]:4===t.length?t[3]:1,4===t.length?t[3]:4===n.length?n[3]:1]){const e=[...n],i=[t[0]-n[0],t[1]-n[1],t[2]-n[2],r[1]-r[0]];3===e.length&&e.push(r[0]);const u=1/Math.max(o-1,1),d=[];for(let n=0;n<o;n++){const t=[Math.round(e[0]+n*i[0]*u),Math.round(e[1]+n*i[1]*u),Math.round(e[2]+n*i[2]*u),e[3]+n*i[3]*u];d.push(t)}return d}function y(n){let t="#";for(let o=0;o<3;o++)t+=O(n[o]);return t}function O(n){const t=(+n).toString(16);return t.length<2?"0"+t:t}const R=[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}];function D(n){const{maxColor:o,timestamp:r,style:e}=(u=(n,t)=>({...n,...t}),void 0===(i=[{maxColor:20,timestamp:"none",style:"padding: 2px; line-height: 1rem;"},n,void 0])[0]||null===i[0]?i[0]:i.filter((n=>!!n)).reduce(u,{}));var i,u;const d=Object.create(null),c=function(n,t,o){if(t<n.length)throw new Error(`Requires at least ${n.length} shades.`);const r=[],e=[];for(let o=0;o<n.length;o++)e.push(Math.round(n[o].index*t));for(let t=0;t<n.length-1;t++){const o=e[t+1]-e[t],i=n[t].rgb,u=n[t+1].rgb;r.push(...L(i,u,o,undefined))}return r}(R,o);let l=0;const s=(0,t.createTimestampFormatter)(r);return function(n){let t,r=`%c ${n.id} `;!function(n){return"string"==typeof n[0]&&-1!==n[0].indexOf("%c")}(n.args)?t=[...n.args]:(r+=n.args[0],t=[...n.args.slice(1)]);const i=(u=n.id,d[u]=d[u]||c[l++&o]);var u;const a=y(i),f=y(i.map((n=>Math.max(0,n-32)))),v=function(n){let t=function(n){return y([255-n[0],255-n[1],255-n[2]])}(n);const o=j(n),r=j("#ffffff"===t?[255,255,255]:[0,0,0]);return(o>r?(o+.05)/(r+.05):(r+.05)/(o+.05))<4.5&&(t=n[0]*M+n[1]*B+n[2]*T<220?"#ffffff":"#000000"),t}(i),g=[r,`${e}background: ${a};border: 1px solid ${f};color: ${v};`,...t],m=s(n.timestamp);return void 0!==m&&g.push(m),g}}const M=.2126,B=.7152,T=.0722,$=1/12.92;function j(n){const t=n[0]/255,o=n[1]/255,r=n[2]/255,e=t<=.03928?t*$:Math.pow((t+.055)/1.055,2.4),i=o<=.03928?o*$:Math.pow((o+.055)/1.055,2.4),u=r<=.03928?r*$:Math.pow((r+.055)/1.055,2.4);return e*M+i*B+u*T}function F(n){return(0,t.createConsoleLogReporter)(null==(f={formatter:"renderer"===(null===(o=null===window||void 0===window?void 0:window.process)||void 0===o?void 0:o.type)||(null===(r=null===window||void 0===window?void 0:window.process)||void 0===r?void 0:r.__nwjs)||!(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.toLowerCase().match(/(edge|trident)\/(\d+)/))&&((null===(u=null===(i=null===document||void 0===document?void 0:document.documentElement)||void 0===i?void 0:i.style)||void 0===u?void 0:u.WebkitAppearance)||(null===(d=null===window||void 0===window?void 0:window.console)||void 0===d?void 0:d.firebug)||(null===(c=null===window||void 0===window?void 0:window.console)||void 0===c?void 0:c.exception)&&(null===(l=null===window||void 0===window?void 0:window.console)||void 0===l?void 0:l.table)||(null===(s=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===s?void 0:s.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(RegExp.$1,10)>=31||(null===(a=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===a?void 0:a.toLowerCase().match(/applewebkit\/(\d+)/)))?D(null==n?void 0:n.cssFormatterOptions):t.consoleFormatter})?f:[f,n,v].filter(_).reduce(((n,t)=>({...n,...C(t)})),{}));var o,r,e,i,u,d,c,l,s,a,f,v}}(),StandardLogColor=r}();
1
+ var StandardLogColor;!function(){"use strict";var n={d:function(t,r){for(var o in r)n.o(r,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r:function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})}},t={};n.r(t),n.d(t,{ANSI_BACKGROUND:function(){return A},ANSI_BLACK:function(){return d},ANSI_BLUE:function(){return f},ANSI_BRIGHT:function(){return w},ANSI_CYAN:function(){return g},ANSI_FOREGROUND:function(){return h},ANSI_GREEN:function(){return a},ANSI_MAGENTA:function(){return v},ANSI_RED:function(){return l},ANSI_UNDERSCORE:function(){return p},ANSI_WHITE:function(){return m},ANSI_YELLOW:function(){return s},createAnsiFormatter:function(){return S},createColorLogReporter:function(){return $},createCssFormatter:function(){return B},wrapAnsi:function(){return b}});var r=StandardLog;const o=(()=>{if(!("navigator"in globalThis))return 0;if(navigator.userAgentData){const n=navigator.userAgentData.brands.find(({brand:n})=>"Chromium"===n);if(n?.version>93)return 3}return/\b(?:Chrome|Chromium)\//.test(navigator.userAgent)?1:0})(),e=0!==o&&{level:o,hasBasic:!0,has256:o>=2,has16m:o>=3};var i,u={stdout:e,stderr:e};let c;!function(n){n[n.DISABLED=0]="DISABLED",n[n.BASIC=1]="BASIC",n[n.ANSI=2]="ANSI",n[n.TRUE=3]="TRUE"}(i||(i={}));const d=0,l=1,a=2,s=3,f=4,v=5,g=6,m=7,w=1,p=4,h=30,A=40;function b(n,t){return`[${t.join(";")}m${n}`}function S(n={timestamp:"none"}){const t=(0,r.createTimestampFormatter)(n.timestamp);return function(n){const o=(0,r.toConsoleMethod)(n.level),e=function(n,t){const r=c=c||{stderr:u.stderr?u.stderr.level:i.DISABLED,stdout:u.stdout?u.stdout.level:i.DISABLED};return function(n){switch(n){case i.DISABLED:return n=>n;case i.BASIC:return I;case i.ANSI:return E;case i.TRUE:return x}}("error"===n?r.stderr:r.stdout)(t)}(o,n.id),d=function(n,t,r){const o=[...r.args],e=n(r.timestamp);void 0!==e&&o.push(e);const i="error"===t?[l+h]:"warn"===t?[s+h]:void 0;return i?o.map(n=>b(n,i)):o}(t,o,n);return[e,...d]}}function I(n){const t=function(n){return C[n]=C[n]||N.list[N.counter++%N.list.length]}(n);return b(` ${n} `,t)}const N={counter:0,list:[[m+h,l+A],[d+h,a+A],[d+h,s+A],[m+h,f+A],[m+h,v+A],[d+h,g+A],[m+h,d+A],[m+h,l+A,w],[d+h,a+A,w],[d+h,s+A,w],[m+h,f+A,w],[m+h,v+A,w],[d+h,g+A,w],[m+h,d+A,w],[m+h,l+A,p],[d+h,a+A,p],[d+h,s+A,p],[m+h,f+A,p],[m+h,v+A,p],[d+h,g+A,p],[m+h,d+A,p],[m+h,l+A,w,p],[d+h,a+A,w,p],[d+h,s+A,w,p],[m+h,f+A,w,p],[m+h,v+A,w,p],[d+h,g+A,w,p],[m+h,d+A,w,p]]},C=Object.create(null);function E(n){return I(n)}function x(n){return I(n)}function L(n){return Object.keys(n).reduce((t,r)=>(D(n[r])&&(t[r]=n[r]),t),{})}function D(n){return null!=n}function _(n,t,r,o=[4===n.length?n[3]:4===t.length?t[3]:1,4===t.length?t[3]:4===n.length?n[3]:1]){const e=[...n],i=[t[0]-n[0],t[1]-n[1],t[2]-n[2],o[1]-o[0]];3===e.length&&e.push(o[0]);const u=1/Math.max(r-1,1),c=[];for(let n=0;n<r;n++){const t=[Math.round(e[0]+n*i[0]*u),Math.round(e[1]+n*i[1]*u),Math.round(e[2]+n*i[2]*u),e[3]+n*i[3]*u];c.push(t)}return c}function y(n){let t="#";for(let r=0;r<3;r++)t+=O(n[r]);return t}function O(n){const t=(+n).toString(16);return t.length<2?"0"+t:t}const R=[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}];function B(n){const{maxColor:t,timestamp:o,style:e}=(u=(n,t)=>({...n,...t}),void 0===(i=[{maxColor:20,timestamp:"none",style:"padding: 2px; line-height: 1rem;"},n,void 0])[0]||null===i[0]?i[0]:i.filter(n=>!!n).reduce(u,{}));var i,u;const c=Object.create(null),d=function(n,t){if(t<n.length)throw new Error(`Requires at least ${n.length} shades.`);const r=[],o=[];for(let r=0;r<n.length;r++)o.push(Math.round(n[r].index*t));for(let t=0;t<n.length-1;t++){const e=o[t+1]-o[t],i=n[t].rgb,u=n[t+1].rgb;r.push(..._(i,u,e,undefined))}return r}(R,t);let l=0;const a=(0,r.createTimestampFormatter)(o);return function(n){let r,o=`%c ${n.id} `;!function(n){return"string"==typeof n[0]&&-1!==n[0].indexOf("%c")}(n.args)?r=[...n.args]:(o+=n.args[0],r=[...n.args.slice(1)]);const i=(u=n.id,c[u]=c[u]||d[l++&t]);var u;const s=y(i),f=y(i.map(n=>Math.max(0,n-32))),v=function(n){let t=function(n){return y([255-n[0],255-n[1],255-n[2]])}(n);const r=M(n),o=M("#ffffff"===t?[255,255,255]:[0,0,0]);return(r>o?(r+.05)/(o+.05):(o+.05)/(r+.05))<4.5&&(t=n[0]*T.rc+n[1]*T.gc+n[2]*T.bc<220?"#ffffff":"#000000"),t}(i),g=[o,`${e}background: ${s};border: 1px solid ${f};color: ${v};`,...r],m=a(n.timestamp);return void 0!==m&&g.push(m),g}}const T={rc:.2126,gc:.7152,bc:.0722,lowc:1/12.92};function M(n){const t=n[0]/255,r=n[1]/255,o=n[2]/255,e=t<=.03928?t*T.lowc:((t+.055)/1.055)**2.4,i=r<=.03928?r*T.lowc:((r+.055)/1.055)**2.4,u=o<=.03928?o*T.lowc:((o+.055)/1.055)**2.4;return e*T.rc+i*T.gc+u*T.bc}function $(n){return(0,r.createConsoleLogReporter)(null==(f={formatter:"renderer"===(null===(t=null===window||void 0===window?void 0:window.process)||void 0===t?void 0:t.type)||(null===(o=null===window||void 0===window?void 0:window.process)||void 0===o?void 0:o.__nwjs)||!(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.toLowerCase().match(/(edge|trident)\/(\d+)/))&&((null===(u=null===(i=null===document||void 0===document?void 0:document.documentElement)||void 0===i?void 0:i.style)||void 0===u?void 0:u.WebkitAppearance)||(null===(c=null===window||void 0===window?void 0:window.console)||void 0===c?void 0:c.firebug)||(null===(d=null===window||void 0===window?void 0:window.console)||void 0===d?void 0:d.exception)&&(null===(l=null===window||void 0===window?void 0:window.console)||void 0===l?void 0:l.table)||(null===(a=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===a?void 0:a.toLowerCase().match(/firefox\/(\d+)/))&&Number.parseInt(RegExp.$1,10)>=31||(null===(s=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===s?void 0:s.toLowerCase().match(/applewebkit\/(\d+)/)))?B(null==n?void 0:n.cssFormatterOptions):r.consoleFormatter})?f:[f,n,v].filter(D).reduce((n,t)=>({...n,...L(t)}),{}));var t,o,e,i,u,c,d,l,a,s,f,v}StandardLogColor=t}();
2
2
  //# sourceMappingURL=standard-log-color.esm.js.map
Binary file
@@ -1 +1 @@
1
- {"version":3,"file":"standard-log-color.esm.js","mappings":"oEAaA,MAAMA,EAVN,WACC,MAAMC,EAAU,6CAA6CC,KAAKC,UAAUC,WAE5E,GAAKH,EAIL,OAAOI,OAAOC,SAASL,EAAQM,OAAOC,cAAe,GACtD,CAEqBC,IAAsB,IAAK,CAC/CC,MAAO,EACPC,UAAU,EACVC,QAAQ,EACRC,QAAQ,GAGTC,EAAOC,QAAU,CAChBC,OAAQhB,EACRiB,OAAQjB,E,GCrBLkB,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaN,QAGrB,IAAID,EAASI,EAAyBE,GAAY,CAGjDL,QAAS,CAAC,GAOX,OAHAQ,EAAoBH,GAAUN,EAAQA,EAAOC,QAASI,GAG/CL,EAAOC,OACf,CCrBAI,EAAoBK,EAAI,SAASV,GAChC,IAAIW,EAASX,GAAUA,EAAOY,WAC7B,WAAa,OAAOZ,EAAgB,OAAG,EACvC,WAAa,OAAOA,CAAQ,EAE7B,OADAK,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CACR,ECNAN,EAAoBQ,EAAI,SAASZ,EAASc,GACzC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEhB,EAASe,IAC5EE,OAAOC,eAAelB,EAASe,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAG3E,ECPAX,EAAoBY,EAAI,SAASK,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,EAAO,ECCtGlB,EAAoBsB,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EAAQ,MAAS,MAAO,KAE1F,OAAOnH,EAAI8G,EAAiBO,EAAIP,EAAiBQ,EAAIR,CACtD,CExFO,SAASS,EAAuBhG,GACtC,OAAO,IAAAiG,0BNiCAC,OAFkBA,EM7BvB,CACCC,UAe2B,cAAX,QAAf,EAAM,OAANC,aAAM,IAANA,YAAM,EAANA,OAAQC,eAAO,eAAEC,QAAsC,QAAf,EAAM,OAANF,aAAM,IAANA,YAAM,EAANA,OAAQC,eAAO,eAAEE,WAKrC,QAApB,EAAS,OAATpK,gBAAS,IAATA,eAAS,EAATA,UAAWC,iBAAS,eAAEoK,cAAcC,MAAM,6BAQb,QAAhC,EAAyB,QAAzB,EAAQ,OAARC,eAAQ,IAARA,cAAQ,EAARA,SAAUC,uBAAe,eAAE5C,aAAK,eAAE6C,oBAGnB,QAAf,EAAM,OAANR,aAAM,IAANA,YAAM,EAANA,OAAQS,eAAO,eAAEC,WAED,QAAf,EAAM,OAANV,aAAM,IAANA,YAAM,EAANA,OAAQS,eAAO,eAAEE,aAA4B,QAAf,EAAM,OAANX,aAAM,IAANA,YAAM,EAANA,OAAQS,eAAO,eAAEG,SAG3B,QAApB,EAAS,OAAT7K,gBAAS,IAATA,eAAS,EAATA,UAAWC,iBAAS,eAAEoK,cAAcC,MAAM,oBAAqBnK,SAAS2K,OAAOC,GAAI,KAAO,KAEvE,QAApB,EAAS,OAAT/K,gBAAS,IAATA,eAAS,EAATA,UAAWC,iBAAS,eAAEoK,cAAcC,MAAM,wBArCrC5C,EAAmB7D,aAAO,EAAPA,EAASmH,qBAC5B,EAAAC,mBN6BQlB,EACJ,CAACA,EM5BTlG,EN4BiBqH,GACXjD,OAAO9B,GACPH,QAAO,CAACC,EAAGqB,KAAM,IAAMrB,KAAMH,EAAawB,MAAO,CAAC,IMxB3D,I,oBNkB0ByC,EAAQmB,CMrBlC,C","sources":["webpack://StandardLogColor/../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/browser.js","webpack://StandardLogColor/webpack/bootstrap","webpack://StandardLogColor/webpack/runtime/compat get default export","webpack://StandardLogColor/webpack/runtime/define property getters","webpack://StandardLogColor/webpack/runtime/hasOwnProperty shorthand","webpack://StandardLogColor/webpack/runtime/make namespace object","webpack://StandardLogColor/external var \"StandardLog\"","webpack://StandardLogColor/./ts/supportColor.ts","webpack://StandardLogColor/./ts/ansi/constants.ts","webpack://StandardLogColor/./ts/ansi/wrapAnsi.ts","webpack://StandardLogColor/./ts/ansi/ansiFormatter.ts","webpack://StandardLogColor/../../node_modules/.pnpm/unpartial@1.0.4/node_modules/unpartial/esm/index.js","webpack://StandardLogColor/../../node_modules/.pnpm/color-map@2.0.6/node_modules/color-map/esm/createColors.js","webpack://StandardLogColor/../../node_modules/.pnpm/color-map@2.0.6/node_modules/color-map/esm/rgbHex.js","webpack://StandardLogColor/./ts/css/colors.ts","webpack://StandardLogColor/./ts/css/cssFormatter.ts","webpack://StandardLogColor/../../node_modules/.pnpm/color-map@2.0.6/node_modules/color-map/esm/createColorsFromMap.js","webpack://StandardLogColor/./ts/createColorLogReporter.browser.ts"],"sourcesContent":["/* eslint-env browser */\n'use strict';\n\nfunction getChromeVersion() {\n\tconst matches = /(Chrome|Chromium)\\/(?<chromeVersion>\\d+)\\./.exec(navigator.userAgent);\n\n\tif (!matches) {\n\t\treturn;\n\t}\n\n\treturn Number.parseInt(matches.groups.chromeVersion, 10);\n}\n\nconst colorSupport = getChromeVersion() >= 69 ? {\n\tlevel: 1,\n\thasBasic: true,\n\thas256: false,\n\thas16m: false\n} : false;\n\nmodule.exports = {\n\tstdout: colorSupport,\n\tstderr: colorSupport\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var __WEBPACK_NAMESPACE_OBJECT__ = StandardLog;","import sc from 'supports-color'\n\n/**\n * Color level.\n * This is the same definition as the `ColorSupportLevel` in `supports-color`.\n * Using the same definition for simplicity\n * @see https://github.com/chalk/supports-color/blob/main/index.d.ts#L19\n */\nexport enum ColorLevels {\n\tDISABLED = 0,\n\t/**\n\t * Basic 16 colors (4-bits)\n\t */\n\tBASIC = 1,\n\t/**\n\t * ANSI 256 colors (8-bits)\n\t */\n\tANSI = 2,\n\t/**\n\t * Truecolor 16 million colors (24-bits)\n\t */\n\tTRUE = 3\n}\n\nexport namespace supportColor {\n\texport type Result = { stdout: ColorLevels; stderr: ColorLevels }\n}\n\nlet value: supportColor.Result\n\n/**\n * Detects if the platform supports color.\n * For browser, the value can only be:\n * - `{ stdout: 0, stderr: 0 }` (DISABLED), or\n * - `{ stdout: 3, stderr: 3 }` (TRUE).\n * So you only need to check one case.\n * The result value is made the same so that it can be used in all platforms.\n */\nexport function supportColor(): supportColor.Result {\n\t// istanbul ignore next\n\treturn (value = value || {\n\t\tstderr: sc.stderr ? sc.stderr.level : ColorLevels.DISABLED,\n\t\tstdout: sc.stdout ? sc.stdout.level : ColorLevels.DISABLED\n\t})\n}\n","export type AnsiColor = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7\nexport const ANSI_BLACK = 0\nexport const ANSI_RED = 1\nexport const ANSI_GREEN = 2\nexport const ANSI_YELLOW = 3\nexport const ANSI_BLUE = 4\nexport const ANSI_MAGENTA = 5\nexport const ANSI_CYAN = 6\nexport const ANSI_WHITE = 7\n\nexport type AnsiStyle = 1 | 4\nexport const ANSI_BRIGHT = 1\nexport const ANSI_UNDERSCORE = 4\n\nexport const ANSI_FOREGROUND = 30\nexport const ANSI_BACKGROUND = 40\n","export function wrapAnsi(text: string, codes: number[]) {\n\treturn `\\u001B[${codes.join(';')}m${text}\\u001B[0m`\n}\n","import { createTimestampFormatter, LogEntry, TimestampFormat, toConsoleMethod } from 'standard-log'\nimport { ColorLevels, supportColor } from '../supportColor.js'\nimport {\n\tANSI_BACKGROUND,\n\tANSI_BLACK,\n\tANSI_BLUE,\n\tANSI_BRIGHT,\n\tANSI_CYAN,\n\tANSI_FOREGROUND,\n\tANSI_GREEN,\n\tANSI_MAGENTA,\n\tANSI_RED,\n\tANSI_UNDERSCORE,\n\tANSI_WHITE,\n\tANSI_YELLOW\n} from './constants.js'\nimport { wrapAnsi } from './wrapAnsi.js'\n\nexport type AnsiFormatterOptions = {\n\ttimestamp: TimestampFormat\n}\n\nexport function createAnsiFormatter(options: AnsiFormatterOptions = { timestamp: 'none' }) {\n\tconst timestampFormatter = createTimestampFormatter(options.timestamp)\n\n\treturn function ansiFormatter(entry: LogEntry) {\n\t\tconst consoleMethod = toConsoleMethod(entry.level)\n\t\tconst id = formatID(consoleMethod, entry.id)\n\t\tconst args = formatArgs(timestampFormatter, consoleMethod, entry)\n\t\treturn [id, ...args]\n\t}\n}\n\nfunction formatArgs(\n\ttimestampFormatter: (timestamp: Date) => string | undefined,\n\tmethod: 'error' | 'warn' | 'info' | 'debug',\n\tentry: Pick<LogEntry, 'args' | 'timestamp'>\n) {\n\tconst args = [...entry.args]\n\tconst timestamp = timestampFormatter(entry.timestamp)\n\tif (timestamp !== undefined) args.push(timestamp)\n\tconst textCodes =\n\t\tmethod === 'error'\n\t\t\t? [ANSI_RED + ANSI_FOREGROUND]\n\t\t\t: method === 'warn'\n\t\t\t? [ANSI_YELLOW + ANSI_FOREGROUND]\n\t\t\t: undefined\n\n\treturn textCodes ? args.map(x => wrapAnsi(x, textCodes)) : args\n}\n\nfunction formatID(method: 'error' | 'warn' | 'info' | 'debug', id: string) {\n\tconst colorLevels = supportColor()\n\tconst colorLevel = method === 'error' ? colorLevels.stderr : colorLevels.stdout\n\treturn toIDFormatter(colorLevel)(id)\n}\n\nfunction toIDFormatter(colorLevel: ColorLevels) {\n\t// istanbul ignore next\n\tswitch (colorLevel) {\n\t\tcase ColorLevels.DISABLED:\n\t\t\treturn (id: string) => id\n\t\tcase ColorLevels.BASIC:\n\t\t\treturn basicIDFormatter\n\t\tcase ColorLevels.ANSI:\n\t\t\treturn ansiIDFormatter\n\t\tcase ColorLevels.TRUE:\n\t\t\treturn truecolorIDFormatter\n\t}\n}\n\nfunction basicIDFormatter(id: string) {\n\tconst codes = getAnsiColor(id)\n\treturn wrapAnsi(` ${id} `, codes)\n}\n\nconst ansiColors: {\n\tcounter: number\n\tlist: Array<number[]>\n} = {\n\tcounter: 0,\n\tlist: [\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE]\n\t]\n}\nconst ansiColorMap: Record<string, number[]> = Object.create(null)\n\nfunction getAnsiColor(id: string) {\n\treturn (ansiColorMap[id] =\n\t\tansiColorMap[id] || ansiColors.list[ansiColors.counter++ % ansiColors.list.length])\n}\n\n// istanbul ignore next\nfunction ansiIDFormatter(id: string) {\n\treturn basicIDFormatter(id)\n}\n\n// istanbul ignore next\nfunction truecolorIDFormatter(id: string) {\n\treturn basicIDFormatter(id)\n}\n","export function required(source1, source2, source3) {\n return merge([source1, source2, source3], (p, e) => {\n return { ...p, ...e };\n });\n}\nexport function requiredDeep(source1, source2, source3) {\n return merge([source1, source2, source3], (p, e) => deepmerge(p, e));\n}\nfunction merge(entries, reducer) {\n if (entries[0] === undefined || entries[0] === null)\n return entries[0];\n return entries.filter(x => !!x).reduce(reducer, {});\n}\nfunction deepmerge(source1, source2) {\n if (typeof source1 !== 'object' || source1 === null)\n return source2 !== undefined ? source2 : source1;\n if (Array.isArray(source1)) {\n if (Array.isArray(source2))\n return source2;\n if (source2 === undefined)\n return [...source1];\n return [...source1, source2];\n }\n return getAllKeys(source1).concat(getAllKeys(source2)).reduce((p, k) => {\n // @ts-ignore\n p[k] = deepmerge(source1[k], source2 && source2[k]);\n return p;\n }, {});\n}\nfunction getAllKeys(subject, internal = false) {\n if (typeof subject !== 'object')\n return [];\n const propertyNames = Object.getOwnPropertyNames(subject);\n const keys = internal ? propertyNames.filter(n => n !== 'constructor') : propertyNames;\n const proto = Object.getPrototypeOf(subject);\n return proto !== Object.prototype ? keys.concat(getAllKeys(proto, true)) : keys;\n}\nexport function unpartial(s1, s2, s3) {\n // defensive check for JS\n if (s1 === undefined || s1 === null)\n return s1;\n return [s1, s2, s3]\n .filter(notNil)\n .reduce((p, s) => ({ ...p, ...trimNilProps(s) }), {});\n}\nfunction trimNilProps(value) {\n return Object.keys(value).reduce((p, k) => {\n if (notNil(value[k]))\n p[k] = value[k];\n return p;\n }, {});\n}\nfunction notNil(value) {\n return value !== null && value !== undefined;\n}\nexport function unpartialRecursively(arg1, arg2, arg3) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return requiredDeep(arg1, arg2, arg3);\n}\n//# sourceMappingURL=index.js.map","export function createColors(from, to, shades, alpha = [\n from.length === 4 ? from[3] : to.length === 4 ? to[3] : 1,\n to.length === 4 ? to[3] : from.length === 4 ? from[3] : 1\n]) {\n const start = [...from];\n const diff = [\n to[0] - from[0],\n to[1] - from[1],\n to[2] - from[2],\n alpha[1] - alpha[0]\n ];\n if (start.length === 3)\n start.push(alpha[0]);\n const inc = 1 / Math.max(shades - 1, 1);\n const rgba = [];\n for (let i = 0; i < shades; i++) {\n const color = [\n Math.round(start[0] + i * diff[0] * inc),\n Math.round(start[1] + i * diff[1] * inc),\n Math.round(start[2] + i * diff[2] * inc),\n start[3] + i * diff[3] * inc\n ];\n rgba.push(color);\n }\n return rgba;\n}\n//# sourceMappingURL=createColors.js.map","/**\n * Convert `RGB` to `#rgb`\n * JavaScript note: no check for array length, use it properly.\n */\nexport function rgbHex(rgb) {\n let hex = '#';\n for (let i = 0; i < 3; i++) {\n hex += d2h(rgb[i]);\n }\n return hex;\n}\nfunction d2h(d) {\n const s = (+d).toString(16);\n return s.length < 2 ? '0' + s : s;\n}\n//# sourceMappingURL=rgbHex.js.map","import { ColorMap } from 'color-map'\n\nexport const rainbow: ColorMap = [\n\t{ index: 0, rgb: [150, 0, 90] },\n\t{ index: 0.125, rgb: [0, 0, 200] },\n\t{ index: 0.25, rgb: [0, 25, 255] },\n\t{ index: 0.375, rgb: [0, 152, 255] },\n\t{ index: 0.5, rgb: [44, 255, 150] },\n\t{ index: 0.625, rgb: [151, 255, 0] },\n\t{ index: 0.75, rgb: [255, 234, 0] },\n\t{ index: 0.875, rgb: [255, 111, 0] },\n\t{ index: 1, rgb: [255, 0, 0] }\n]\n","import { createColorsFromMap, RGB, RGBA, rgbHex } from 'color-map'\nimport { createTimestampFormatter, LogEntry } from 'standard-log'\nimport { required } from 'unpartial'\nimport type { CssFormatterOptions } from '../types.js'\nimport { rainbow } from './colors.js'\n\nexport function createCssFormatter(options?: CssFormatterOptions) {\n\tconst { maxColor, timestamp, style } = required(\n\t\t{\n\t\t\tmaxColor: 20,\n\t\t\ttimestamp: 'none',\n\t\t\tstyle: 'padding: 2px; line-height: 1rem;'\n\t\t},\n\t\toptions\n\t)\n\tconst loggerMap: Record<string, RGB> = Object.create(null)\n\tconst colorMap: RGBA[] = createColorsFromMap(rainbow, maxColor)\n\tlet count = 0\n\n\tconst timestampFormatter = createTimestampFormatter(timestamp)\n\n\treturn function cssFormatter(entry: LogEntry) {\n\t\tlet idStr = `%c ${entry.id} `\n\t\tlet args: any[]\n\t\tif (firstArgIsColorTemplate(entry.args)) {\n\t\t\tidStr += entry.args[0]\n\t\t\targs = [...entry.args.slice(1)]\n\t\t} else {\n\t\t\targs = [...entry.args]\n\t\t}\n\t\tconst rgb = getRgb(entry.id)\n\t\tconst background = rgbHex(rgb)\n\t\tconst border = rgbHex(rgb.map(x => Math.max(0, x - 32)) as RGB)\n\t\tconst color = getForegroundColor(rgb)\n\t\tconst result = [\n\t\t\tidStr,\n\t\t\t`${style}background: ${background};border: 1px solid ${border};color: ${color};`,\n\t\t\t...args\n\t\t]\n\t\tconst t = timestampFormatter(entry.timestamp)\n\t\tif (t !== undefined) result.push(t)\n\t\treturn result\n\t}\n\n\tfunction firstArgIsColorTemplate(args: any[]) {\n\t\treturn typeof args[0] === 'string' && args[0].indexOf('%c') !== -1\n\t}\n\n\tfunction getRgb(id: string) {\n\t\treturn (loggerMap[id] = loggerMap[id] || colorMap[count++ & maxColor])\n\t}\n}\n\nconst gammaMap = {\n\trc: 0.2126,\n\tgc: 0.7152,\n\tbc: 0.0722,\n\tlowc: 1 / 12.92\n}\n\nfunction getForegroundColor(background: RGB) {\n\t// Setting the contrasting color as default\n\tlet color = getComplementary(background)\n\tconst bgLuminance = getRelativeLuminance(background)\n\tconst fgLuminance =\n\t\tcolor === '#ffffff' ? getRelativeLuminance([255, 255, 255]) : getRelativeLuminance([0, 0, 0])\n\tconst relativeL =\n\t\tbgLuminance > fgLuminance\n\t\t\t? (bgLuminance + 0.05) / (fgLuminance + 0.05)\n\t\t\t: (fgLuminance + 0.05) / (bgLuminance + 0.05)\n\n\t// Can set the contrast ratio based on text size later.\n\tif (relativeL < 4.5) {\n\t\tconst avgLuminance =\n\t\t\tbackground[0] * gammaMap['rc'] + background[1] * gammaMap['gc'] + background[2] * gammaMap['bc']\n\n\t\t// If the relative contrast is lower than standard, we switch color to black/white\n\t\tcolor = avgLuminance < 220 ? '#ffffff' : '#000000'\n\t}\n\treturn color\n}\n\nfunction getRelativeLuminance(rgb: RGB) {\n\t// https://www.w3.org/TR/WCAG/#relativeluminancedef\n\tconst rsrgb = rgb[0] / 255\n\tconst gsrgb = rgb[1] / 255\n\tconst bsrgb = rgb[2] / 255\n\n\tconst r = rsrgb <= 0.03928 ? rsrgb * gammaMap['lowc'] : Math.pow((rsrgb + 0.055) / 1.055, 2.4)\n\tconst g = gsrgb <= 0.03928 ? gsrgb * gammaMap['lowc'] : Math.pow((gsrgb + 0.055) / 1.055, 2.4)\n\tconst b = bsrgb <= 0.03928 ? bsrgb * gammaMap['lowc'] : Math.pow((bsrgb + 0.055) / 1.055, 2.4)\n\n\treturn r * gammaMap['rc'] + g * gammaMap['gc'] + b * gammaMap['bc']\n}\n\nfunction getComplementary(rgb: RGB) {\n\tconst r = 255 - rgb[0]\n\tconst g = 255 - rgb[1]\n\tconst b = 255 - rgb[2]\n\treturn rgbHex([r, g, b])\n}\n","import { createColors } from './createColors.js';\n/**\n * Create colors with specified color map.\n */\nexport function createColorsFromMap(colormap, shades, alpha) {\n if (shades < colormap.length) {\n throw new Error(`Requires at least ${colormap.length} shades.`);\n }\n const result = [];\n const steps = [];\n for (let i = 0; i < colormap.length; i++) {\n steps.push(Math.round(colormap[i].index * shades));\n }\n for (let i = 0; i < colormap.length - 1; i++) {\n const n = steps[i + 1] - steps[i];\n const from = colormap[i].rgb;\n const to = colormap[i + 1].rgb;\n result.push(...createColors(from, to, n, alpha));\n }\n return result;\n}\n//# sourceMappingURL=createColorsFromMap.js.map","import { consoleFormatter, createConsoleLogReporter } from 'standard-log'\nimport { unpartial } from 'unpartial'\nimport { createCssFormatter } from './css/index.js'\nimport type { ColorLogReporterOptions } from './types.js'\n\nexport function createColorLogReporter(options?: ColorLogReporterOptions) {\n\treturn createConsoleLogReporter(\n\t\tunpartial(\n\t\t\t{\n\t\t\t\tformatter: supportCSSColorInConsole()\n\t\t\t\t\t? createCssFormatter(options?.cssFormatterOptions)\n\t\t\t\t\t: consoleFormatter\n\t\t\t},\n\t\t\toptions\n\t\t)\n\t)\n}\n\n// istanbul ignore next\nfunction supportCSSColorInConsole() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\t// @ts-ignore\n\tif (window?.process?.type === 'renderer' || window?.process?.__nwjs) {\n\t\treturn true\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (navigator?.userAgent?.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (\n\t\t// @ts-ignore\n\t\tdocument?.documentElement?.style?.WebkitAppearance ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t// @ts-ignore\n\t\twindow?.console?.firebug ||\n\t\t// @ts-ignore\n\t\t(window?.console?.exception && window?.console?.table) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(navigator?.userAgent?.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\tnavigator?.userAgent?.toLowerCase().match(/applewebkit\\/(\\d+)/)\n\t)\n}\n"],"names":["colorSupport","matches","exec","navigator","userAgent","Number","parseInt","groups","chromeVersion","getChromeVersion","level","hasBasic","has256","has16m","module","exports","stdout","stderr","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","ColorLevels","StandardLog","ANSI_BLACK","ANSI_RED","ANSI_GREEN","ANSI_YELLOW","ANSI_BLUE","ANSI_MAGENTA","ANSI_CYAN","ANSI_WHITE","ANSI_BRIGHT","ANSI_UNDERSCORE","ANSI_FOREGROUND","ANSI_BACKGROUND","wrapAnsi","text","codes","join","createAnsiFormatter","options","timestamp","timestampFormatter","createTimestampFormatter","entry","consoleMethod","toConsoleMethod","id","method","colorLevels","DISABLED","colorLevel","BASIC","basicIDFormatter","ANSI","ansiIDFormatter","TRUE","truecolorIDFormatter","toIDFormatter","formatID","args","push","textCodes","map","x","formatArgs","ansiColorMap","ansiColors","list","counter","length","getAnsiColor","create","trimNilProps","keys","reduce","p","k","notNil","createColors","from","to","shades","alpha","start","diff","inc","Math","max","rgba","i","color","round","rgbHex","rgb","hex","d2h","s","toString","rainbow","index","createCssFormatter","maxColor","style","reducer","e","entries","source3","filter","loggerMap","colorMap","colormap","Error","result","steps","createColorsFromMap","count","idStr","indexOf","firstArgIsColorTemplate","slice","background","border","getComplementary","bgLuminance","getRelativeLuminance","fgLuminance","gammaMap","getForegroundColor","t","rsrgb","gsrgb","bsrgb","pow","g","b","createColorLogReporter","createConsoleLogReporter","s1","formatter","window","process","type","__nwjs","toLowerCase","match","document","documentElement","WebkitAppearance","console","firebug","exception","table","RegExp","$1","cssFormatterOptions","consoleFormatter","s3"],"sourceRoot":""}
1
+ {"version":3,"file":"standard-log-color.esm.js","mappings":"8CACA,IAAAA,EAAA,CCAAA,EAAA,SAAAC,EAAAC,GACA,QAAAC,KAAAD,EACAF,EAAAI,EAAAF,EAAAC,KAAAH,EAAAI,EAAAH,EAAAE,IACAE,OAAAC,eAAAL,EAAAE,EAAA,CAAyCI,YAAA,EAAAC,IAAAN,EAAAC,IAGzC,ECPAH,EAAA,SAAAS,EAAAC,GAA8C,OAAAL,OAAAM,UAAAC,eAAAC,KAAAJ,EAAAC,EAAA,ECC9CV,EAAA,SAAAC,GACA,oBAAAa,QAAAA,OAAAC,aACAV,OAAAC,eAAAL,EAAAa,OAAAC,YAAA,CAAuDC,MAAA,WAEvDX,OAAAC,eAAAL,EAAA,cAAgDe,OAAA,GAChD,kkBCNA,IAAIC,EAA4BC,YCAhC,MAAAC,EAAA,MACA,mBAAAC,YACA,SAGA,GAAAC,UAAAC,cAAA,CACA,MAAAC,EAAAF,UAAAC,cAAAE,OAAAC,KAAA,EAAsDF,WAAM,aAAAA,GAC5D,G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B3K,EAAA4K,mBN6BP9B,EACA,CAAAA,EM5BGzG,EN4BHwI,GACAlE,OAAA/B,GACAH,OAAA,CAAAC,EAAAsB,KAAA,IAA6BtB,KAAAH,EAAAyB,KAA0B,KMxBvD,wBNkBO8C,EAAA+B,CMrBP","sources":["webpack://StandardLogColor/webpack/bootstrap","webpack://StandardLogColor/webpack/runtime/define property getters","webpack://StandardLogColor/webpack/runtime/hasOwnProperty shorthand","webpack://StandardLogColor/webpack/runtime/make namespace object","webpack://StandardLogColor/external var \"StandardLog\"","webpack://StandardLogColor/javascript/node_modules/.pnpm/supports-color@11.0.0/node_modules/supports-color/browser.js","webpack://StandardLogColor/./ts/supportColor.ts","webpack://StandardLogColor/./ts/ansi/constants.ts","webpack://StandardLogColor/./ts/ansi/wrapAnsi.ts","webpack://StandardLogColor/./ts/ansi/ansiFormatter.ts","webpack://StandardLogColor/javascript/node_modules/.pnpm/unpartial@1.0.5/node_modules/unpartial/esm/index.js","webpack://StandardLogColor/javascript/node_modules/.pnpm/color-map@2.0.6/node_modules/color-map/esm/createColors.js","webpack://StandardLogColor/javascript/node_modules/.pnpm/color-map@2.0.6/node_modules/color-map/esm/rgbHex.js","webpack://StandardLogColor/./ts/css/colors.ts","webpack://StandardLogColor/./ts/css/cssFormatter.ts","webpack://StandardLogColor/javascript/node_modules/.pnpm/color-map@2.0.6/node_modules/color-map/esm/createColorsFromMap.js","webpack://StandardLogColor/./ts/createColorLogReporter.browser.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var __WEBPACK_NAMESPACE_OBJECT__ = StandardLog;","const level = (() => {\n\tif (!('navigator' in globalThis)) {\n\t\treturn 0;\n\t}\n\n\tif (navigator.userAgentData) {\n\t\tconst brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium');\n\t\tif (brand?.version > 93) {\n\t\t\treturn 3;\n\t\t}\n\t}\n\n\t// eslint-disable-next-line require-unicode-regexp -- This entry point supports browsers without Unicode Sets.\n\tif (/\\b(?:Chrome|Chromium)\\//.test(navigator.userAgent)) {\n\t\treturn 1;\n\t}\n\n\treturn 0;\n})();\n\nconst colorSupport = level !== 0 && {\n\tlevel,\n\thasBasic: true,\n\thas256: level >= 2,\n\thas16m: level >= 3,\n};\n\nconst supportsColor = {\n\tstdout: colorSupport,\n\tstderr: colorSupport,\n};\n\nexport default supportsColor;\n","import sc from 'supports-color'\n\n/**\n * Color level.\n * This is the same definition as the `ColorSupportLevel` in `supports-color`.\n * Using the same definition for simplicity\n * @see https://github.com/chalk/supports-color/blob/main/index.d.ts#L19\n */\nexport enum ColorLevels {\n\tDISABLED = 0,\n\t/**\n\t * Basic 16 colors (4-bits)\n\t */\n\tBASIC = 1,\n\t/**\n\t * ANSI 256 colors (8-bits)\n\t */\n\tANSI = 2,\n\t/**\n\t * Truecolor 16 million colors (24-bits)\n\t */\n\tTRUE = 3\n}\n\nexport namespace supportColor {\n\texport type Result = { stdout: ColorLevels; stderr: ColorLevels }\n}\n\nlet value: supportColor.Result\n\n/**\n * Detects if the platform supports color.\n * For browser, the value can only be:\n * - `{ stdout: 0, stderr: 0 }` (DISABLED), or\n * - `{ stdout: 3, stderr: 3 }` (TRUE).\n * So you only need to check one case.\n * The result value is made the same so that it can be used in all platforms.\n */\nexport function supportColor(): supportColor.Result {\n\t// istanbul ignore next\n\treturn (value = value || {\n\t\tstderr: sc.stderr ? sc.stderr.level : ColorLevels.DISABLED,\n\t\tstdout: sc.stdout ? sc.stdout.level : ColorLevels.DISABLED\n\t})\n}\n","export type AnsiColor = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7\nexport const ANSI_BLACK = 0\nexport const ANSI_RED = 1\nexport const ANSI_GREEN = 2\nexport const ANSI_YELLOW = 3\nexport const ANSI_BLUE = 4\nexport const ANSI_MAGENTA = 5\nexport const ANSI_CYAN = 6\nexport const ANSI_WHITE = 7\n\nexport type AnsiStyle = 1 | 4\nexport const ANSI_BRIGHT = 1\nexport const ANSI_UNDERSCORE = 4\n\nexport const ANSI_FOREGROUND = 30\nexport const ANSI_BACKGROUND = 40\n","export function wrapAnsi(text: string, codes: number[]) {\n\treturn `\\u001B[${codes.join(';')}m${text}\\u001B[0m`\n}\n","import { createTimestampFormatter, type LogEntry, type TimestampFormat, toConsoleMethod } from 'standard-log'\nimport { ColorLevels, supportColor } from '../supportColor.js'\nimport {\n\tANSI_BACKGROUND,\n\tANSI_BLACK,\n\tANSI_BLUE,\n\tANSI_BRIGHT,\n\tANSI_CYAN,\n\tANSI_FOREGROUND,\n\tANSI_GREEN,\n\tANSI_MAGENTA,\n\tANSI_RED,\n\tANSI_UNDERSCORE,\n\tANSI_WHITE,\n\tANSI_YELLOW\n} from './constants.js'\nimport { wrapAnsi } from './wrapAnsi.js'\n\nexport type AnsiFormatterOptions = {\n\ttimestamp: TimestampFormat\n}\n\nexport function createAnsiFormatter(options: AnsiFormatterOptions = { timestamp: 'none' }) {\n\tconst timestampFormatter = createTimestampFormatter(options.timestamp)\n\n\treturn function ansiFormatter(entry: LogEntry) {\n\t\tconst consoleMethod = toConsoleMethod(entry.level)\n\t\tconst id = formatID(consoleMethod, entry.id)\n\t\tconst args = formatArgs(timestampFormatter, consoleMethod, entry)\n\t\treturn [id, ...args]\n\t}\n}\n\nfunction formatArgs(\n\ttimestampFormatter: (timestamp: Date) => string | undefined,\n\tmethod: 'error' | 'warn' | 'info' | 'debug',\n\tentry: Pick<LogEntry, 'args' | 'timestamp'>\n) {\n\tconst args = [...entry.args]\n\tconst timestamp = timestampFormatter(entry.timestamp)\n\tif (timestamp !== undefined) args.push(timestamp)\n\tconst textCodes =\n\t\tmethod === 'error'\n\t\t\t? [ANSI_RED + ANSI_FOREGROUND]\n\t\t\t: method === 'warn'\n\t\t\t\t? [ANSI_YELLOW + ANSI_FOREGROUND]\n\t\t\t\t: undefined\n\n\treturn textCodes ? args.map(x => wrapAnsi(x, textCodes)) : args\n}\n\nfunction formatID(method: 'error' | 'warn' | 'info' | 'debug', id: string) {\n\tconst colorLevels = supportColor()\n\tconst colorLevel = method === 'error' ? colorLevels.stderr : colorLevels.stdout\n\treturn toIDFormatter(colorLevel)(id)\n}\n\nfunction toIDFormatter(colorLevel: ColorLevels) {\n\t// istanbul ignore next\n\tswitch (colorLevel) {\n\t\tcase ColorLevels.DISABLED:\n\t\t\treturn (id: string) => id\n\t\tcase ColorLevels.BASIC:\n\t\t\treturn basicIDFormatter\n\t\tcase ColorLevels.ANSI:\n\t\t\treturn ansiIDFormatter\n\t\tcase ColorLevels.TRUE:\n\t\t\treturn truecolorIDFormatter\n\t}\n}\n\nfunction basicIDFormatter(id: string) {\n\tconst codes = getAnsiColor(id)\n\treturn wrapAnsi(` ${id} `, codes)\n}\n\nconst ansiColors: {\n\tcounter: number\n\tlist: Array<number[]>\n} = {\n\tcounter: 0,\n\tlist: [\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_BRIGHT],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_RED + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_GREEN + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_YELLOW + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLUE + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_MAGENTA + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_BLACK + ANSI_FOREGROUND, ANSI_CYAN + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE],\n\t\t[ANSI_WHITE + ANSI_FOREGROUND, ANSI_BLACK + ANSI_BACKGROUND, ANSI_BRIGHT, ANSI_UNDERSCORE]\n\t]\n}\nconst ansiColorMap: Record<string, number[]> = Object.create(null)\n\nfunction getAnsiColor(id: string) {\n\treturn (ansiColorMap[id] =\n\t\tansiColorMap[id] || ansiColors.list[ansiColors.counter++ % ansiColors.list.length])\n}\n\n// istanbul ignore next\nfunction ansiIDFormatter(id: string) {\n\treturn basicIDFormatter(id)\n}\n\n// istanbul ignore next\nfunction truecolorIDFormatter(id: string) {\n\treturn basicIDFormatter(id)\n}\n","export function required(source1, source2, source3) {\n return merge([source1, source2, source3], (p, e) => {\n return { ...p, ...e };\n });\n}\nexport function requiredDeep(source1, source2, source3) {\n return merge([source1, source2, source3], (p, e) => deepmerge(p, e));\n}\nfunction merge(entries, reducer) {\n if (entries[0] === undefined || entries[0] === null)\n return entries[0];\n return entries.filter(x => !!x).reduce(reducer, {});\n}\nfunction deepmerge(source1, source2) {\n if (typeof source1 !== 'object' || source1 === null)\n return source2 !== undefined ? source2 : source1;\n if (Array.isArray(source1)) {\n if (Array.isArray(source2))\n return source2;\n if (source2 === undefined)\n return [...source1];\n return [...source1, source2];\n }\n return getAllKeys(source1).concat(getAllKeys(source2)).reduce((p, k) => {\n // @ts-ignore\n p[k] = deepmerge(source1[k], source2 && source2[k]);\n return p;\n }, {});\n}\nfunction getAllKeys(subject, internal = false) {\n if (typeof subject !== 'object')\n return [];\n const propertyNames = Object.getOwnPropertyNames(subject);\n const keys = internal ? propertyNames.filter(n => n !== 'constructor') : propertyNames;\n const proto = Object.getPrototypeOf(subject);\n return proto !== Object.prototype ? keys.concat(getAllKeys(proto, true)) : keys;\n}\nexport function unpartial(s1, s2, s3) {\n // defensive check for JS\n if (s1 === undefined || s1 === null)\n return s1;\n return [s1, s2, s3]\n .filter(notNil)\n .reduce((p, s) => ({ ...p, ...trimNilProps(s) }), {});\n}\nfunction trimNilProps(value) {\n return Object.keys(value).reduce((p, k) => {\n if (notNil(value[k]))\n p[k] = value[k];\n return p;\n }, {});\n}\nfunction notNil(value) {\n return value !== null && value !== undefined;\n}\nexport function unpartialRecursively(arg1, arg2, arg3) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return requiredDeep(arg1, arg2, arg3);\n}\n//# sourceMappingURL=index.js.map","export function createColors(from, to, shades, alpha = [\n from.length === 4 ? from[3] : to.length === 4 ? to[3] : 1,\n to.length === 4 ? to[3] : from.length === 4 ? from[3] : 1\n]) {\n const start = [...from];\n const diff = [\n to[0] - from[0],\n to[1] - from[1],\n to[2] - from[2],\n alpha[1] - alpha[0]\n ];\n if (start.length === 3)\n start.push(alpha[0]);\n const inc = 1 / Math.max(shades - 1, 1);\n const rgba = [];\n for (let i = 0; i < shades; i++) {\n const color = [\n Math.round(start[0] + i * diff[0] * inc),\n Math.round(start[1] + i * diff[1] * inc),\n Math.round(start[2] + i * diff[2] * inc),\n start[3] + i * diff[3] * inc\n ];\n rgba.push(color);\n }\n return rgba;\n}\n//# sourceMappingURL=createColors.js.map","/**\n * Convert `RGB` to `#rgb`\n * JavaScript note: no check for array length, use it properly.\n */\nexport function rgbHex(rgb) {\n let hex = '#';\n for (let i = 0; i < 3; i++) {\n hex += d2h(rgb[i]);\n }\n return hex;\n}\nfunction d2h(d) {\n const s = (+d).toString(16);\n return s.length < 2 ? '0' + s : s;\n}\n//# sourceMappingURL=rgbHex.js.map","import type { ColorMap } from 'color-map'\n\nexport const rainbow: ColorMap = [\n\t{ index: 0, rgb: [150, 0, 90] },\n\t{ index: 0.125, rgb: [0, 0, 200] },\n\t{ index: 0.25, rgb: [0, 25, 255] },\n\t{ index: 0.375, rgb: [0, 152, 255] },\n\t{ index: 0.5, rgb: [44, 255, 150] },\n\t{ index: 0.625, rgb: [151, 255, 0] },\n\t{ index: 0.75, rgb: [255, 234, 0] },\n\t{ index: 0.875, rgb: [255, 111, 0] },\n\t{ index: 1, rgb: [255, 0, 0] }\n]\n","import { createColorsFromMap, type RGB, type RGBA, rgbHex } from 'color-map'\nimport { createTimestampFormatter, type LogEntry } from 'standard-log'\nimport { required } from 'unpartial'\nimport type { CssFormatterOptions } from '../types.js'\nimport { rainbow } from './colors.js'\n\nexport function createCssFormatter(options?: CssFormatterOptions) {\n\tconst { maxColor, timestamp, style } = required(\n\t\t{\n\t\t\tmaxColor: 20,\n\t\t\ttimestamp: 'none',\n\t\t\tstyle: 'padding: 2px; line-height: 1rem;'\n\t\t},\n\t\toptions\n\t)\n\tconst loggerMap: Record<string, RGB> = Object.create(null)\n\tconst colorMap: RGBA[] = createColorsFromMap(rainbow, maxColor)\n\tlet count = 0\n\n\tconst timestampFormatter = createTimestampFormatter(timestamp)\n\n\treturn function cssFormatter(entry: LogEntry) {\n\t\tlet idStr = `%c ${entry.id} `\n\t\tlet args: any[]\n\t\tif (firstArgIsColorTemplate(entry.args)) {\n\t\t\tidStr += entry.args[0]\n\t\t\targs = [...entry.args.slice(1)]\n\t\t} else {\n\t\t\targs = [...entry.args]\n\t\t}\n\t\tconst rgb = getRgb(entry.id)\n\t\tconst background = rgbHex(rgb)\n\t\tconst border = rgbHex(rgb.map(x => Math.max(0, x - 32)) as RGB)\n\t\tconst color = getForegroundColor(rgb)\n\t\tconst result = [\n\t\t\tidStr,\n\t\t\t`${style}background: ${background};border: 1px solid ${border};color: ${color};`,\n\t\t\t...args\n\t\t]\n\t\tconst t = timestampFormatter(entry.timestamp)\n\t\tif (t !== undefined) result.push(t)\n\t\treturn result\n\t}\n\n\tfunction firstArgIsColorTemplate(args: any[]) {\n\t\treturn typeof args[0] === 'string' && args[0].indexOf('%c') !== -1\n\t}\n\n\tfunction getRgb(id: string) {\n\t\treturn (loggerMap[id] = loggerMap[id] || colorMap[count++ & maxColor])\n\t}\n}\n\nconst gammaMap = {\n\trc: 0.2126,\n\tgc: 0.7152,\n\tbc: 0.0722,\n\tlowc: 1 / 12.92\n}\n\nfunction getForegroundColor(background: RGB) {\n\t// Setting the contrasting color as default\n\tlet color = getComplementary(background)\n\tconst bgLuminance = getRelativeLuminance(background)\n\tconst fgLuminance =\n\t\tcolor === '#ffffff' ? getRelativeLuminance([255, 255, 255]) : getRelativeLuminance([0, 0, 0])\n\tconst relativeL =\n\t\tbgLuminance > fgLuminance\n\t\t\t? (bgLuminance + 0.05) / (fgLuminance + 0.05)\n\t\t\t: (fgLuminance + 0.05) / (bgLuminance + 0.05)\n\n\t// Can set the contrast ratio based on text size later.\n\tif (relativeL < 4.5) {\n\t\tconst avgLuminance =\n\t\t\tbackground[0] * gammaMap['rc'] + background[1] * gammaMap['gc'] + background[2] * gammaMap['bc']\n\n\t\t// If the relative contrast is lower than standard, we switch color to black/white\n\t\tcolor = avgLuminance < 220 ? '#ffffff' : '#000000'\n\t}\n\treturn color\n}\n\nfunction getRelativeLuminance(rgb: RGB) {\n\t// https://www.w3.org/TR/WCAG/#relativeluminancedef\n\tconst rsrgb = rgb[0] / 255\n\tconst gsrgb = rgb[1] / 255\n\tconst bsrgb = rgb[2] / 255\n\n\tconst r = rsrgb <= 0.03928 ? rsrgb * gammaMap['lowc'] : ((rsrgb + 0.055) / 1.055) ** 2.4\n\tconst g = gsrgb <= 0.03928 ? gsrgb * gammaMap['lowc'] : ((gsrgb + 0.055) / 1.055) ** 2.4\n\tconst b = bsrgb <= 0.03928 ? bsrgb * gammaMap['lowc'] : ((bsrgb + 0.055) / 1.055) ** 2.4\n\n\treturn r * gammaMap['rc'] + g * gammaMap['gc'] + b * gammaMap['bc']\n}\n\nfunction getComplementary(rgb: RGB) {\n\tconst r = 255 - rgb[0]\n\tconst g = 255 - rgb[1]\n\tconst b = 255 - rgb[2]\n\treturn rgbHex([r, g, b])\n}\n","import { createColors } from './createColors.js';\n/**\n * Create colors with specified color map.\n */\nexport function createColorsFromMap(colormap, shades, alpha) {\n if (shades < colormap.length) {\n throw new Error(`Requires at least ${colormap.length} shades.`);\n }\n const result = [];\n const steps = [];\n for (let i = 0; i < colormap.length; i++) {\n steps.push(Math.round(colormap[i].index * shades));\n }\n for (let i = 0; i < colormap.length - 1; i++) {\n const n = steps[i + 1] - steps[i];\n const from = colormap[i].rgb;\n const to = colormap[i + 1].rgb;\n result.push(...createColors(from, to, n, alpha));\n }\n return result;\n}\n//# sourceMappingURL=createColorsFromMap.js.map","import { consoleFormatter, createConsoleLogReporter } from 'standard-log'\nimport { unpartial } from 'unpartial'\nimport { createCssFormatter } from './css/index.js'\nimport type { ColorLogReporterOptions } from './types.js'\n\nexport function createColorLogReporter(options?: ColorLogReporterOptions) {\n\treturn createConsoleLogReporter(\n\t\tunpartial(\n\t\t\t{\n\t\t\t\tformatter: supportCSSColorInConsole()\n\t\t\t\t\t? createCssFormatter(options?.cssFormatterOptions)\n\t\t\t\t\t: consoleFormatter\n\t\t\t},\n\t\t\toptions\n\t\t)\n\t)\n}\n\n// istanbul ignore next\nfunction supportCSSColorInConsole() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\t// @ts-expect-error\n\tif (window?.process?.type === 'renderer' || window?.process?.__nwjs) {\n\t\treturn true\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (navigator?.userAgent?.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (\n\t\t// @ts-expect-error\n\t\tdocument?.documentElement?.style?.WebkitAppearance ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t// @ts-expect-error\n\t\twindow?.console?.firebug ||\n\t\t// @ts-expect-error\n\t\t(window?.console?.exception && window?.console?.table) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(navigator?.userAgent?.toLowerCase().match(/firefox\\/(\\d+)/) && Number.parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\tnavigator?.userAgent?.toLowerCase().match(/applewebkit\\/(\\d+)/)\n\t)\n}\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","external_StandardLog_namespaceObject","StandardLog","level","globalThis","navigator","userAgentData","brand","brands","find","version","test","userAgent","colorSupport","hasBasic","has256","has16m","ColorLevels","browser","stdout","stderr","ANSI_BLACK","ANSI_RED","ANSI_GREEN","ANSI_YELLOW","ANSI_BLUE","ANSI_MAGENTA","ANSI_CYAN","ANSI_WHITE","ANSI_BRIGHT","ANSI_UNDERSCORE","ANSI_FOREGROUND","ANSI_BACKGROUND","wrapAnsi","text","codes","join","createAnsiFormatter","options","timestamp","timestampFormatter","createTimestampFormatter","entry","consoleMethod","toConsoleMethod","id","method","colorLevels","DISABLED","colorLevel","BASIC","basicIDFormatter","ANSI","ansiIDFormatter","TRUE","truecolorIDFormatter","toIDFormatter","formatID","args","undefined","push","textCodes","map","x","formatArgs","ansiColorMap","ansiColors","list","counter","length","getAnsiColor","create","trimNilProps","keys","reduce","p","k","notNil","createColors","from","to","shades","alpha","start","diff","inc","Math","max","rgba","i","color","round","rgbHex","rgb","hex","d2h","d","s","toString","rainbow","index","createCssFormatter","maxColor","style","reducer","e","entries","source3","filter","loggerMap","colorMap","colormap","Error","result","steps","n","createColorsFromMap","count","idStr","indexOf","firstArgIsColorTemplate","slice","background","border","getComplementary","bgLuminance","getRelativeLuminance","fgLuminance","gammaMap","getForegroundColor","t","rc","gc","bc","lowc","rsrgb","gsrgb","bsrgb","r","g","b","createColorLogReporter","createConsoleLogReporter","s1","formatter","_a","window","process","type","_b","__nwjs","_c","toLowerCase","match","_e","_d","document","documentElement","WebkitAppearance","_f","console","firebug","_g","exception","_h","table","_j","Number","parseInt","RegExp","$1","_k","cssFormatterOptions","consoleFormatter","s3"],"sourceRoot":""}