{
  "version": 3,
  "sources": ["../src/index.ts", "../src/lib/globals.ts", "../src/lib/is-electron.ts", "../src/lib/is-browser.ts", "../src/lib/get-browser.ts", "../src/utils/assert.ts"],
  "sourcesContent": ["// Extract injected version from package.json (injected by babel plugin)\n// @ts-expect-error\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'untranspiled source';\n\n// ENVIRONMENT\nexport {self, window, global, document, process, console} from './lib/globals';\nexport {isBrowser} from './lib/is-browser';\nexport {getBrowser, isMobile} from './lib/get-browser';\nexport {isElectron} from './lib/is-electron';\n\n// ENVIRONMENT'S ASSERT IS 5-15KB, SO WE PROVIDE OUR OWN\nexport {assert} from './utils/assert';\n\n// TODO - wish we could just export a constant\n// export const isBrowser = checkIfBrowser();\n", "// Do not name these variables the same as the global objects - will break bundling\nconst global_ = globalThis;\nconst window_ = globalThis as unknown as Window;\nconst document_ = globalThis.document || ({} as Document);\nconst process_ = globalThis.process || {};\nconst console_ = globalThis.console;\nconst navigator_ = globalThis.navigator || ({} as Navigator);\n\nexport {\n  global_ as global,\n  global_ as self,\n  window_ as window,\n  document_ as document,\n  process_ as process,\n  console_ as console,\n  navigator_ as navigator\n};\n", "// based on https://github.com/cheton/is-electron\n// https://github.com/electron/electron/issues/2288\n/* eslint-disable complexity */\nexport function isElectron(mockUserAgent?: string): boolean {\n  // Renderer process\n  // @ts-expect-error\n  if (typeof window !== 'undefined' && window.process?.type === 'renderer') {\n    return true;\n  }\n  // Main process\n  // eslint-disable-next-line\n  if (typeof process !== 'undefined' && Boolean(process.versions?.['electron'])) {\n    return true;\n  }\n  // Detect the user agent when the `nodeIntegration` option is set to true\n  const realUserAgent = typeof navigator !== 'undefined' && navigator.userAgent;\n  const userAgent = mockUserAgent || realUserAgent;\n  return Boolean(userAgent && userAgent.indexOf('Electron') >= 0);\n}\n", "// This function is needed in initialization stages,\n// make sure it can be imported in isolation\n\nimport {isElectron} from './is-electron';\n\n/** Check if in browser by duck-typing Node context */\nexport function isBrowser(): boolean {\n  const isNode =\n    // @ts-expect-error\n    typeof process === 'object' && String(process) === '[object process]' && !process?.browser;\n  return !isNode || isElectron();\n}\n", "// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n// This function is needed in initialization stages,\n// make sure it can be imported in isolation\n\nimport {isBrowser} from './is-browser';\nimport {isElectron} from './is-electron';\nimport {navigator} from './globals';\n\ndeclare global {\n  var chrome: boolean; // eslint-disable-line no-var\n  var safari: boolean; // eslint-disable-line no-var\n  var mozInnerScreenX: number; // eslint-disable-line no-var\n}\n\nexport function isMobile(): boolean {\n  return typeof globalThis.orientation !== 'undefined';\n}\n\n// Simple browser detection\n// `mockUserAgent` parameter allows user agent to be overridden for testing\n/* eslint-disable complexity */\nexport function getBrowser(\n  mockUserAgent?: string\n): 'Node' | 'Electron' | 'Chrome' | 'Firefox' | 'Safari' | 'Edge' | 'Unknown' {\n  if (!mockUserAgent && !isBrowser()) {\n    return 'Node';\n  }\n  if (isElectron(mockUserAgent)) {\n    return 'Electron';\n  }\n\n  const userAgent = mockUserAgent || navigator.userAgent || '';\n\n  // NOTE: Order of tests matter, as many agents list Chrome etc.\n  if (userAgent.indexOf('Edge') > -1) {\n    return 'Edge';\n  }\n  if (globalThis.chrome) {\n    return 'Chrome';\n  }\n  if (globalThis.safari) {\n    return 'Safari';\n  }\n  if (globalThis.mozInnerScreenX) {\n    return 'Firefox';\n  }\n  return 'Unknown';\n}\n", "export function assert(condition: unknown, message?: string) {\n  if (!condition) {\n    throw new Error(message || 'Assertion failed');\n  }\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;ACCA,IAAM,UAAU;AAChB,IAAM,UAAU;AAChB,IAAM,YAAY,WAAW,YAAa,CAAA;AAC1C,IAAM,WAAW,WAAW,WAAW,CAAA;AACvC,IAAM,WAAW,WAAW;AAC5B,IAAM,aAAa,WAAW,aAAc,CAAA;;;ACHtC,SAAU,WAAW,eAAsB;AAHjD;AAME,MAAI,OAAO,WAAW,iBAAe,YAAO,YAAP,mBAAgB,UAAS,YAAY;AACxE,WAAO;EACT;AAGA,MAAI,OAAO,YAAY,eAAe,SAAQ,aAAQ,aAAR,mBAAmB,WAAW,GAAG;AAC7E,WAAO;EACT;AAEA,QAAM,gBAAgB,OAAO,cAAc,eAAe,UAAU;AACpE,QAAM,YAAY,iBAAiB;AACnC,SAAO,QAAQ,aAAa,UAAU,QAAQ,UAAU,KAAK,CAAC;AAChE;;;ACZM,SAAU,YAAS;AACvB,QAAM;;IAEJ,OAAO,YAAY,YAAY,OAAO,OAAO,MAAM,sBAAsB,EAAC,mCAAS;;AACrF,SAAO,CAAC,UAAU,WAAU;AAC9B;;;ACsBM,SAAU,WAAQ;AACtB,SAAO,OAAO,WAAW,gBAAgB;AAC3C;AAKM,SAAU,WACd,eAAsB;AAEtB,MAAI,CAAC,iBAAiB,CAAC,UAAS,GAAI;AAClC,WAAO;EACT;AACA,MAAI,WAAW,aAAa,GA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