{"version":3,"file":"log-colors.cjs","names":[],"sources":["../../../src/browser/log/log-colors.ts"],"sourcesContent":["/* eslint-disable node/prefer-global/process */\n\n// Taken from https://github.com/visionmedia/debug/blob/master/src/browser.js#L27\n\nexport function browserSupportsColors(): boolean {\n  // NB: In an Electron preload script, document will be defined but not fully\n  // initialized. Since we know we're in Chrome, we'll just detect this case\n  // explicitly\n  if (\n    typeof window !== 'undefined'\n    && window.process\n    // @ts-expect-error xxx\n    && (window.process.type === 'renderer' || window.process.__nwjs)\n  ) {\n    return true\n  }\n\n  // Internet Explorer and Edge do not support colors.\n  if (\n    typeof navigator !== 'undefined'\n    && navigator.userAgent\n    && /(?:edge|trident)\\/\\d+/.test(navigator.userAgent.toLowerCase())\n  ) {\n    return false\n  }\n\n  // Is webkit? http://stackoverflow.com/a/16459606/376773\n  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n  return (\n    (typeof document !== 'undefined'\n      && document.documentElement\n      && document.documentElement.style\n    // @ts-expect-error xxx\n      && document.documentElement.style.WebkitAppearance)\n    // Is firebug? http://stackoverflow.com/a/398120/376773\n    || (typeof window !== 'undefined'\n      && window.console\n      // @ts-expect-error xxx\n      && (window.console.firebug\n      // @ts-expect-error xxx\n\n        || (window.console.exception && window.console.table)))\n    // Is firefox >= v31?\n    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n      || (typeof navigator !== 'undefined'\n        && navigator.userAgent\n        && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)\n      // eslint-disable-next-line regexp/no-legacy-features\n        && Number.parseInt(RegExp.$1, 10) >= 31)\n    // Double check webkit in userAgent just in case we are in a worker\n      || (typeof navigator !== 'undefined'\n        && navigator.userAgent\n        && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/))\n  )\n}\n"],"mappings":";;;AAIA,SAAgB,wBAAiC;AAI/C,KACE,OAAO,WAAW,eACf,OAAO,YAEN,OAAO,QAAQ,SAAS,cAAc,OAAO,QAAQ,QAEzD,QAAO;AAIT,KACE,OAAO,cAAc,eAClB,UAAU,aACV,wBAAwB,KAAK,UAAU,UAAU,aAAa,CAAC,CAElE,QAAO;AAKT,QACG,OAAO,aAAa,eAChB,SAAS,mBACT,SAAS,gBAAgB,SAEzB,SAAS,gBAAgB,MAAM,oBAEhC,OAAO,WAAW,eACjB,OAAO,YAEN,OAAO,QAAQ,WAGb,OAAO,QAAQ,aAAa,OAAO,QAAQ,UAG7C,OAAO,cAAc,eACpB,UAAU,aACV,UAAU,UAAU,aAAa,CAAC,MAAM,iBAAiB,IAEzD,OAAO,SAAS,OAAO,IAAI,GAAG,IAAI,MAEnC,OAAO,cAAc,eACpB,UAAU,aACV,UAAU,UAAU,aAAa,CAAC,MAAM,qBAAqB"}