{ "version": 3, "sources": ["index.js", "log.js", "utils/local-storage.js", "utils/formatters.js", "utils/color.js", "utils/autobind.js", "utils/assert.js", "utils/hi-res-timestamp.js", "init.js"], "sourcesContent": ["import { Log } from \"./log.js\";\n// DEFAULT EXPORT IS A LOG INSTANCE\nexport default new Log({ id: '@probe.gl/log' });\n// LOGGING\nexport { Log } from \"./log.js\";\nexport { COLOR } from \"./utils/color.js\";\n// UTILITIES\nexport { addColor } from \"./utils/color.js\";\nexport { leftPad, rightPad } from \"./utils/formatters.js\";\nexport { autobind } from \"./utils/autobind.js\";\nexport { LocalStorage } from \"./utils/local-storage.js\";\nexport { getHiResTimestamp } from \"./utils/hi-res-timestamp.js\";\nimport \"./init.js\";\n", "// probe.gl, MIT license\n/* eslint-disable no-console */\nimport { VERSION, isBrowser } from '@probe.gl/env';\nimport { LocalStorage } from \"./utils/local-storage.js\";\nimport { formatTime, leftPad } from \"./utils/formatters.js\";\nimport { addColor } from \"./utils/color.js\";\nimport { autobind } from \"./utils/autobind.js\";\nimport assert from \"./utils/assert.js\";\nimport { getHiResTimestamp } from \"./utils/hi-res-timestamp.js\";\n// Instrumentation in other packages may override console methods, so preserve them here\nconst originalConsole = {\n debug: isBrowser() ? console.debug || console.log : console.log,\n log: console.log,\n info: console.info,\n warn: console.warn,\n error: console.error\n};\nconst DEFAULT_LOG_CONFIGURATION = {\n enabled: true,\n level: 0\n};\nfunction noop() { } // eslint-disable-line @typescript-eslint/no-empty-function\nconst cache = {};\nconst ONCE = { once: true };\n/** A console wrapper */\nexport class Log {\n constructor({ id } = { id: '' }) {\n this.VERSION = VERSION;\n this._startTs = getHiResTimestamp();\n this._deltaTs = getHiResTimestamp();\n this.userData = {};\n // TODO - fix support from throttling groups\n this.LOG_THROTTLE_TIMEOUT = 0; // Time before throttled messages are logged again\n this.id = id;\n this.userData = {};\n this._storage = new LocalStorage(`__probe-${this.id}__`, DEFAULT_LOG_CONFIGURATION);\n this.timeStamp(`${this.id} started`);\n autobind(this);\n Object.seal(this);\n }\n set level(newLevel) {\n this.setLevel(newLevel);\n }\n get level() {\n return this.getLevel();\n }\n isEnabled() {\n return this._storage.config.enabled;\n }\n getLevel() {\n return this._storage.config.level;\n }\n /** @return milliseconds, with fractions */\n getTotal() {\n return Number((getHiResTimestamp() - this._startTs).toPrecision(10));\n }\n /** @return milliseconds, with fractions */\n getDelta() {\n return Number((getHiResTimestamp() - this._deltaTs).toPrecision(10));\n }\n /** @deprecated use logLevel */\n set priority(newPriority) {\n this.level = newPriority;\n }\n /** @deprecated use logLevel */\n get priority() {\n return this.level;\n }\n /** @deprecated use logLevel */\n getPriority() {\n return this.level;\n }\n // Configure\n enable(enabled = true) {\n this._storage.setConfiguration({ enabled });\n return this;\n }\n setLevel(level) {\n this._storage.setConfiguration({ level });\n return this;\n }\n /** return the current status of the setting */\n get(setting) {\n return this._storage.config[setting];\n }\n // update the status of the setting\n set(setting, value) {\n this._storage.setConfiguration({ [setting]: value });\n }\n /** Logs the current settings as a table */\n settings() {\n if (console.table) {\n console.table(this._storage.config);\n }\n else {\n console.log(this._storage.config);\n }\n }\n // Unconditional logging\n assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n }\n warn(message) {\n return this._getLogFunction(0, message, originalConsole.warn, arguments, ONCE);\n }\n error(message) {\n return this._getLogFunction(0, message, originalConsole.error, arguments);\n }\n /** Print a deprecation warning */\n deprecated(oldUsage, newUsage) {\n return this.warn(`\\`${oldUsage}\\` is deprecated and will be removed \\\nin a later version. Use \\`${newUsage}\\` instead`);\n }\n /** Print a removal warning */\n removed(oldUsage, newUsage) {\n return this.error(`\\`${oldUsage}\\` has been removed. Use \\`${newUsage}\\` instead`);\n }\n probe(logLevel, message) {\n return this._getLogFunction(logLevel, message, originalConsole.log, arguments, {\n time: true,\n once: true\n });\n }\n log(logLevel, message) {\n return this._getLogFunction(logLevel, message, originalConsole.debug, arguments);\n }\n info(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.info, arguments);\n }\n once(logLevel, message) {\n return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);\n }\n /** Logs an object as a table */\n table(logLevel, table, columns) {\n if (table) {\n return this._getLogFunction(logLevel, table, console.table || noop, (columns && [columns]), {\n tag: getTableHeader(table)\n });\n }\n return noop;\n }\n time(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);\n }\n timeEnd(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);\n }\n timeStamp(logLevel, message) {\n return this._getLogFunction(logLevel, message, console.timeStamp || noop);\n }\n group(logLevel, message, opts = { collapsed: false }) {\n const options = normalizeArguments({ logLevel, message, opts });\n const { collapsed } = opts;\n // @ts-expect-error\n options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;\n return this._getLogFunction(options);\n }\n groupCollapsed(logLevel, message, opts = {}) {\n return this.group(logLevel, message, Object.assign({}, opts, { collapsed: true }));\n }\n groupEnd(logLevel) {\n return this._getLogFunction(logLevel, '', console.groupEnd || noop);\n }\n // EXPERIMENTAL\n withGroup(logLevel, message, func) {\n this.group(logLevel, message)();\n try {\n func();\n }\n finally {\n this.groupEnd(logLevel)();\n }\n }\n trace() {\n if (console.trace) {\n console.trace();\n }\n }\n // PRIVATE METHODS\n /** Deduces log level from a variety of arguments */\n _shouldLog(logLevel) {\n return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);\n }\n _getLogFunction(logLevel, message, method, args, opts) {\n if (this._shouldLog(logLevel)) {\n // normalized opts + timings\n opts = normalizeArguments({ logLevel, message, args, opts });\n method = method || opts.method;\n assert(method);\n opts.total = this.getTotal();\n opts.delta = this.getDelta();\n // reset delta timer\n this._deltaTs = getHiResTimestamp();\n const tag = opts.tag || opts.message;\n if (opts.once && tag) {\n if (!cache[tag]) {\n cache[tag] = getHiResTimestamp();\n }\n else {\n return noop;\n }\n }\n // TODO - Make throttling work with groups\n // if (opts.nothrottle || !throttle(tag, this.LOG_THROTTLE_TIMEOUT)) {\n // return noop;\n // }\n message = decorateMessage(this.id, opts.message, opts);\n // Bind console function so that it can be called after being returned\n return method.bind(console, message, ...opts.args);\n }\n return noop;\n }\n}\nLog.VERSION = VERSION;\n/**\n * Get logLevel from first argument:\n * - log(logLevel, message, args) => logLevel\n * - log(message, args) => 0\n * - log({logLevel, ...}, message, args) => logLevel\n * - log({logLevel, message, args}) => logLevel\n */\nfunction normalizeLogLevel(logLevel) {\n if (!logLevel) {\n return 0;\n }\n let resolvedLevel;\n switch (typeof logLevel) {\n case 'number':\n resolvedLevel = logLevel;\n break;\n case 'object':\n // Backward compatibility\n // TODO - deprecate `priority`\n // @ts-expect-error\n resolvedLevel = logLevel.logLevel || logLevel.priority || 0;\n break;\n default:\n return 0;\n }\n // 'log level must be a number'\n assert(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);\n return resolvedLevel;\n}\n/**\n * \"Normalizes\" the various argument patterns into an object with known types\n * - log(logLevel, message, args) => {logLevel, message, args}\n * - log(message, args) => {logLevel: 0, message, args}\n * - log({logLevel, ...}, message, args) => {logLevel, message, args}\n * - log({logLevel, message, args}) => {logLevel, message, args}\n */\nexport function normalizeArguments(opts) {\n const { logLevel, message } = opts;\n opts.logLevel = normalizeLogLevel(logLevel);\n // We use `arguments` instead of rest parameters (...args) because IE\n // does not support the syntax. Rest parameters is transpiled to code with\n // perf impact. Doing it here instead avoids constructing args when logging is\n // disabled.\n // TODO - remove when/if IE support is dropped\n const args = opts.args ? Array.from(opts.args) : [];\n // args should only contain arguments that appear after `message`\n // eslint-disable-next-line no-empty\n while (args.length && args.shift() !== message) { }\n switch (typeof logLevel) {\n case 'string':\n case 'function':\n if (message !== undefined) {\n args.unshift(message);\n }\n opts.message = logLevel;\n break;\n case 'object':\n Object.assign(opts, logLevel);\n break;\n default:\n }\n // Resolve functions into strings by calling them\n if (typeof opts.message === 'function') {\n opts.message = opts.message();\n }\n const messageType = typeof opts.message;\n // 'log message must be a string' or object\n assert(messageType === 'string' || messageType === 'object');\n // original opts + normalized opts + opts arg + fixed up message\n return Object.assign(opts, { args }, opts.opts);\n}\nfunction decorateMessage(id, message, opts) {\n if (typeof message === 'string') {\n const time = opts.time ? leftPad(formatTime(opts.total)) : '';\n message = opts.time ? `${id}: ${time} ${message}` : `${id}: ${message}`;\n message = addColor(message, opts.color, opts.background);\n }\n return message;\n}\nfunction getTableHeader(table) {\n for (const key in table) {\n for (const title in table[key]) {\n return title || 'untitled';\n }\n }\n return 'empty';\n}\n", "// probe.gl, MIT license\nfunction getStorage(type) {\n try {\n const storage = window[type];\n const x = '__storage_test__';\n storage.setItem(x, x);\n storage.removeItem(x);\n return storage;\n }\n catch (e) {\n return null;\n }\n}\n// Store keys in local storage via simple interface\nexport class LocalStorage {\n constructor(id, defaultConfig, type = 'sessionStorage') {\n this.storage = getStorage(type);\n this.id = id;\n this.config = defaultConfig;\n this._loadConfiguration();\n }\n getConfiguration() {\n return this.config;\n }\n setConfiguration(configuration) {\n Object.assign(this.config, configuration);\n if (this.storage) {\n const serialized = JSON.stringify(this.config);\n this.storage.setItem(this.id, serialized);\n }\n }\n // Get config from persistent store, if available\n _loadConfiguration() {\n let configuration = {};\n if (this.storage) {\n const serializedConfiguration = this.storage.getItem(this.id);\n configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};\n }\n Object.assign(this.config, configuration);\n return this;\n }\n}\n", "// probe.gl, MIT license\n/**\n * Format time\n */\nexport function formatTime(ms) {\n let formatted;\n if (ms < 10) {\n formatted = `${ms.toFixed(2)}ms`;\n }\n else if (ms < 100) {\n formatted = `${ms.toFixed(1)}ms`;\n }\n else if (ms < 1000) {\n formatted = `${ms.toFixed(0)}ms`;\n }\n else {\n formatted = `${(ms / 1000).toFixed(2)}s`;\n }\n return formatted;\n}\nexport function leftPad(string, length = 8) {\n const padLength = Math.max(length - string.length, 0);\n return `${' '.repeat(padLength)}${string}`;\n}\nexport function rightPad(string, length = 8) {\n const padLength = Math.max(length - string.length, 0);\n return `${string}${' '.repeat(padLength)}`;\n}\nexport function formatValue(v, options = {}) {\n const EPSILON = 1e-16;\n const { isInteger = false } = options;\n if (Array.isArray(v) || ArrayBuffer.isView(v)) {\n return formatArrayValue(v, options);\n }\n if (!Number.isFinite(v)) {\n return String(v);\n }\n // @ts-expect-error\n if (Math.abs(v) < EPSILON) {\n return isInteger ? '0' : '0.';\n }\n if (isInteger) {\n // @ts-expect-error\n return v.toFixed(0);\n }\n // @ts-expect-error\n if (Math.abs(v) > 100 && Math.abs(v) < 10000) {\n // @ts-expect-error\n return v.toFixed(0);\n }\n // @ts-expect-error\n const string = v.toPrecision(2);\n const decimal = string.indexOf('.0');\n return decimal === string.length - 2 ? string.slice(0, -1) : string;\n}\n/** Helper to formatValue */\nfunction formatArrayValue(v, options) {\n const { maxElts = 16, size = 1 } = options;\n let string = '[';\n for (let i = 0; i < v.length && i < maxElts; ++i) {\n if (i > 0) {\n string += `,${i % size === 0 ? ' ' : ''}`;\n }\n string += formatValue(v[i], options);\n }\n const terminator = v.length > maxElts ? '...' : ']';\n return `${string}${terminator}`;\n}\n", "import { isBrowser } from '@probe.gl/env';\nexport var COLOR;\n(function (COLOR) {\n COLOR[COLOR[\"BLACK\"] = 30] = \"BLACK\";\n COLOR[COLOR[\"RED\"] = 31] = \"RED\";\n COLOR[COLOR[\"GREEN\"] = 32] = \"GREEN\";\n COLOR[COLOR[\"YELLOW\"] = 33] = \"YELLOW\";\n COLOR[COLOR[\"BLUE\"] = 34] = \"BLUE\";\n COLOR[COLOR[\"MAGENTA\"] = 35] = \"MAGENTA\";\n COLOR[COLOR[\"CYAN\"] = 36] = \"CYAN\";\n COLOR[COLOR[\"WHITE\"] = 37] = \"WHITE\";\n COLOR[COLOR[\"BRIGHT_BLACK\"] = 90] = \"BRIGHT_BLACK\";\n COLOR[COLOR[\"BRIGHT_RED\"] = 91] = \"BRIGHT_RED\";\n COLOR[COLOR[\"BRIGHT_GREEN\"] = 92] = \"BRIGHT_GREEN\";\n COLOR[COLOR[\"BRIGHT_YELLOW\"] = 93] = \"BRIGHT_YELLOW\";\n COLOR[COLOR[\"BRIGHT_BLUE\"] = 94] = \"BRIGHT_BLUE\";\n COLOR[COLOR[\"BRIGHT_MAGENTA\"] = 95] = \"BRIGHT_MAGENTA\";\n COLOR[COLOR[\"BRIGHT_CYAN\"] = 96] = \"BRIGHT_CYAN\";\n COLOR[COLOR[\"BRIGHT_WHITE\"] = 97] = \"BRIGHT_WHITE\";\n})(COLOR || (COLOR = {}));\nconst BACKGROUND_INCREMENT = 10;\nfunction getColor(color) {\n if (typeof color !== 'string') {\n return color;\n }\n color = color.toUpperCase();\n return COLOR[color] || COLOR.WHITE;\n}\nexport function addColor(string, color, background) {\n if (!isBrowser && typeof string === 'string') {\n if (color) {\n const colorCode = getColor(color);\n string = `\\u001b[${colorCode}m${string}\\u001b[39m`;\n }\n if (background) {\n // background colors values are +10\n const colorCode = getColor(background);\n string = `\\u001b[${colorCode + BACKGROUND_INCREMENT}m${string}\\u001b[49m`;\n }\n }\n return string;\n}\n", "// Copyright (c) 2015 - 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 * Binds the \"this\" argument of all functions on a class instance to the instance\n * @param obj - class instance (typically a react component)\n */\nexport function autobind(obj, predefined = ['constructor']) {\n const proto = Object.getPrototypeOf(obj);\n const propNames = Object.getOwnPropertyNames(proto);\n const object = obj;\n for (const key of propNames) {\n const value = object[key];\n if (typeof value === 'function') {\n if (!predefined.find(name => key === name)) {\n object[key] = value.bind(obj);\n }\n }\n }\n}\n", "export default function assert(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n", "// probe.gl, MIT license\nimport { window, process, isBrowser } from '@probe.gl/env';\n/** Get best timer available. */\nexport function getHiResTimestamp() {\n let timestamp;\n if (isBrowser() && window.performance) {\n timestamp = window?.performance?.now?.();\n }\n else if ('hrtime' in process) {\n // @ts-ignore\n const timeParts = process?.hrtime?.();\n timestamp = timeParts[0] * 1000 + timeParts[1] / 1e6;\n }\n else {\n timestamp = Date.now();\n }\n return timestamp;\n}\n", "// @ts-nocheck\n/* eslint-disable */\nglobalThis.probe = {};\n"], "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,IAAAA,cAAmC;;;ACDnC,SAAS,WAAW,MAAM;AACtB,MAAI;AACA,UAAM,UAAU,OAAO,IAAI;AAC3B,UAAM,IAAI;AACV,YAAQ,QAAQ,GAAG,CAAC;AACpB,YAAQ,WAAW,CAAC;AACpB,WAAO;AAAA,EACX,SACO,GAAP;AACI,WAAO;AAAA,EACX;AACJ;AAEO,IAAM,eAAN,MAAmB;AAAA,EACtB,YAAY,IAAI,eAAe,OAAO,kBAAkB;AACpD,SAAK,UAAU,WAAW,IAAI;AAC9B,SAAK,KAAK;AACV,SAAK,SAAS;AACd,SAAK,mBAAmB;AAAA,EAC5B;AAAA,EACA,m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