(obj, path, fallback)\n}\n","import {createBrowserHistory} from 'history'\nimport {getBrowserBasepath} from 'src/utils/basepath'\n\nconst basepath = getBrowserBasepath()\n// Older method used for pre-IE 11 compatibility\nwindow.basepath = basepath\n\nexport const history = createBrowserHistory({basename: basepath})\n","// Libraries\nimport React from 'react'\n\n// Types\nimport {ErrorMessageComponent} from 'src/types'\n\nconst DefaultErrorMessage: ErrorMessageComponent = () => {\n return (\n \n An InfluxDB error has occurred. Please report the issue \n \n here\n \n .\n
\n )\n}\n\nexport default DefaultErrorMessage\n","import {AppState} from 'src/types'\nimport {FlagMap} from 'src/shared/reducers/flags'\nimport {CLOUD, CLOUD_BILLING_VISIBLE} from 'src/shared/constants'\n\nexport const OSS_FLAGS = {\n cursorAtEOF: false,\n customCheckQuery: false,\n deleteWithPredicate: false,\n demodata: false,\n downloadCellCSV: false,\n fluxParser: false,\n matchingNotificationRules: false,\n flows: false,\n streamEvents: false,\n 'flow-move-cells': false,\n 'flow-panel--spotify': false,\n 'flow-panel--youtube': false,\n 'flow-panel--test-flux': false,\n 'flow-panel--downsample': true,\n 'flow-panel--markdown': true,\n 'flow-panel--query-builder': true,\n 'flow-panel--raw-flux': true,\n 'flow-panel--to-bucket': true,\n disableDefaultTableSort: false,\n 'load-data-client-libraries': true,\n 'load-data-telegraf-plugins': true,\n 'load-data-dev-tools': false,\n 'load-data-flux-sources': false,\n 'load-data-integrations': false,\n 'notification-endpoint-telegram': false,\n 'molly-first': false,\n 'managed-functions': false,\n 'simple-table': false,\n}\n\nexport const CLOUD_FLAGS = {\n cloudBilling: CLOUD_BILLING_VISIBLE, // should be visible in dev and acceptance, but not in cloud\n cursorAtEOF: false,\n customCheckQuery: false,\n deleteWithPredicate: false,\n demodata: true,\n downloadCellCSV: false,\n fluxParser: false,\n matchingNotificationRules: false,\n flows: false,\n streamEvents: false,\n 'flow-move-cells': false,\n 'flow-panel--spotify': false,\n 'flow-panel--youtube': false,\n 'flow-panel--test-flux': false,\n 'flow-panel--downsample': true,\n 'flow-panel--markdown': true,\n 'flow-panel--query-builder': true,\n 'flow-panel--raw-flux': true,\n 'flow-panel--to-bucket': true,\n disableDefaultTableSort: false,\n 'load-data-client-libraries': true,\n 'load-data-telegraf-plugins': true,\n 'load-data-dev-tools': false,\n 'load-data-flux-sources': false,\n 'load-data-integrations': false,\n 'notification-endpoint-telegram': false,\n unity: false,\n 'molly-first': false,\n 'managed-functions': false,\n 'simple-table': false,\n}\n\nexport const activeFlags = (state: AppState): FlagMap => {\n const localState = CLOUD ? CLOUD_FLAGS : OSS_FLAGS\n const networkState = state.flags.original || {}\n const override = state.flags.override || {}\n\n return {\n ...localState,\n ...networkState,\n ...override,\n }\n}\n","import {OPTION_NAME} from 'src/variables/constants/index'\nimport {formatExpression} from 'src/variables/utils/formatExpression'\nimport {VariableAssignment} from 'src/types/ast'\n\nexport const formatVarsOption = (variables: VariableAssignment[]): string => {\n if (!variables.length) {\n return ''\n }\n\n const lines = variables.map(v => `${v.id.name}: ${formatExpression(v.init)}`)\n\n const option = `option ${OPTION_NAME} = {\n ${lines.join(',\\n ')}\n}`\n\n return option\n}\n","class Deferred {\n public promise: Promise\n public resolve: (...rest: T[]) => void\n public reject: (error: Error) => void\n\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve\n this.reject = reject\n })\n }\n}\n\nexport default Deferred\n","module.exports = __webpack_public_path__ + \"ef38e44f38.svg\";","// Libraries\nimport {get} from 'lodash'\nimport moment from 'moment'\n\n// Types\nimport {\n AppState,\n Check,\n Dashboard,\n TimeRange,\n TimeZone,\n View,\n ViewType,\n} from 'src/types'\n\n// Utility\nimport {currentContext} from 'src/shared/selectors/currentContext'\nimport {getTimezoneOffset} from 'src/dashboards/utils/getTimezoneOffset'\n\n// Constants\nimport {DEFAULT_TIME_RANGE} from 'src/shared/constants/timeRanges'\n\nexport const getTimeRange = (state: AppState): TimeRange => {\n const contextID = currentContext(state)\n if (!state.ranges || !state.ranges.hasOwnProperty(contextID)) {\n return DEFAULT_TIME_RANGE\n }\n\n return state.ranges[contextID] || DEFAULT_TIME_RANGE\n}\n\nexport const getTimeRangeWithTimezone = (state: AppState): TimeRange => {\n const timeRange = getTimeRange(state)\n const timeZone = getTimeZone(state)\n\n const newTimeRange = {...timeRange}\n if (timeRange.type === 'custom' && timeZone === 'UTC') {\n // conforms dates to account to UTC with proper offset if needed\n newTimeRange.lower = setTimeToUTC(newTimeRange.lower)\n newTimeRange.upper = setTimeToUTC(newTimeRange.upper)\n }\n return newTimeRange\n}\n\nexport const sortDashboardByName = (dashboards: Dashboard[]): Dashboard[] =>\n dashboards.sort((a, b) =>\n a.name.toLowerCase() > b.name.toLowerCase() ? 1 : -1\n )\n\n/**\n * We are currently using this to track whether the dashboard is active\n * in order to conditionally check the QueryCache in dashboard cells\n * in the TimeSeries.tsx file, since TimeSeries.tsx is used in Dashboard Cells and Check Alerts History\n **/\nexport const isCurrentPageDashboard = (state: AppState): boolean =>\n state.currentPage === 'dashboard'\n\n// The purpose of this function is to set a user's custom time range selection\n// from the local time to the same time in UTC if UTC is selected from the\n// timezone dropdown. This is feature was original requested here:\n// https://github.com/influxdata/influxdb/issues/17877\n// and finalized across the dashboards & the data explorer here:\n// https://github.com/influxdata/influxdb/pull/19146\n// Example: user selected 10-11:00am and sets the dropdown to UTC\n// Query should run against 10-11:00am UTC rather than querying\n// 10-11:00am local time (offset depending on timezone)\nexport const setTimeToUTC = (date: string): string =>\n moment\n .utc(date)\n .subtract(getTimezoneOffset(), 'minutes')\n .format()\n\nexport const getTimeZone = (state: AppState): TimeZone => {\n return state.app.persisted.timeZone || 'Local'\n}\n\nexport const getCheckForView = (\n state: AppState,\n view: View\n): Partial => {\n const viewType: ViewType = get(view, 'properties.type')\n const checkID = get(view, 'properties.checkID')\n\n return viewType === 'check' ? state.resources.checks.byID[checkID] : null\n}\n\nexport const getAllDashboards = (state: AppState): Dashboard[] =>\n Object.values(state.resources.dashboards.byID)\n\nexport const hasNoDashboards = (state: AppState): boolean =>\n state.resources.dashboards.allIDs.length === 0\n","/**\n * This files has been created as a way to effectively test\n * the getTimeRangeWithTimezone function since current system (circleCI, Jenkins)\n * and JS Date limitations prevent us from fully testing out its dependent functions\n *\n * It should be noted that the native getTimezoneOffset function returns a number\n * that represents the number of minutes (not hours) the \"local\" timezone is offset\n * where locations West of UTC are positive (+420) and locations East of UTC are negative (-120):\n *\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset\n **/\n\nexport const getTimezoneOffset = (): number => new Date().getTimezoneOffset()\n","import {ErrorInfo} from 'react'\nimport HoneyBadger from 'honeybadger-js'\nimport {\n CLOUD,\n GIT_SHA,\n HONEYBADGER_KEY,\n HONEYBADGER_ENV,\n} from 'src/shared/constants'\n\nimport {getUserFlags} from 'src/shared/utils/featureFlag'\nimport {event} from 'src/cloud/utils/reporting'\n\nif (CLOUD) {\n HoneyBadger.configure({\n apiKey: HONEYBADGER_KEY,\n revision: GIT_SHA,\n environment: HONEYBADGER_ENV,\n })\n}\n\n// See https://docs.honeybadger.io/lib/javascript/guides/reporting-errors.html#additional-options\ninterface HoneyBadgerAdditionalOptions {\n component?: string\n context?: {[key: string]: any}\n cookies?: {[key: string]: any}\n name?: string\n params?: {[key: string]: any}\n}\n\nexport const reportErrorThroughHoneyBadger = (\n error: Error,\n additionalOptions?: HoneyBadgerAdditionalOptions\n): void => {\n let additionalContext = {}\n if (additionalOptions && additionalOptions.context) {\n additionalContext = {...additionalOptions.context}\n }\n\n const context = {\n ...additionalContext,\n ...getUserFlags(),\n }\n\n let options: HoneyBadgerAdditionalOptions = {}\n if (additionalOptions) {\n options = {...additionalOptions}\n\n delete options.context // already included in the above context object\n }\n\n if (CLOUD) {\n HoneyBadger.notify(error, {context, ...options})\n\n let errorType = 'generic (untagged) error'\n if (options.name) {\n errorType = options.name\n } else if (options.component) {\n errorType = options.component\n }\n\n event('ui error', {error: errorType}, {errorCount: 1})\n } else {\n console.error(error)\n }\n}\n\n/*\n Parse React's error boundary info message to provide the name of the\n component an error occured in.\n\n For example, given the following info message:\n\n The above error occurred in the component:\n in MePage (created by ErrorBoundary(MePage))\n in ErrorBoundary (created by ErrorBoundary(MePage))\n in ErrorBoundary(MePage) (created by Connect(ErrorBoundary(MePage)))\n in Connect(ErrorBoundary(MePage)) (created by RouterContext)\n in SpinnerContainer (created by SetOrg)\n ...\n\n We will extract \"MePage\" as the component name.\n*/\nexport const parseComponentName = (errorInfo: ErrorInfo): string => {\n const componentName = errorInfo.componentStack\n .trim()\n .split('\\n')\n .map(s => s.split(' ')[1])[0]\n\n return componentName\n}\n","import {orderBy, get, toLower} from 'lodash'\n\nexport enum SortTypes {\n String = 'string',\n Date = 'date',\n Float = 'float',\n}\n\nfunction orderByType(data, type) {\n switch (type) {\n case SortTypes.String:\n return toLower(data)\n case SortTypes.Date:\n return Date.parse(data)\n case SortTypes.Float:\n return parseFloat(data)\n default:\n return data\n }\n}\n\nexport function getSortedResources(\n resourceList: T[],\n sortKey: string,\n sortDirection: string,\n sortType: string\n): T[] {\n if (sortKey && sortDirection) {\n return orderBy(\n resourceList,\n r => orderByType(get(r, sortKey), sortType),\n [sortDirection]\n )\n }\n return resourceList\n}\n","// Libraries\nimport {get} from 'lodash'\n\n// Types\nimport {AppState, ResourceType, RemoteDataState, Label, Task} from 'src/types'\n\nexport const getStatus = (\n {resources}: AppState,\n resource: ResourceType\n): RemoteDataState => {\n return resources[resource].status\n}\n\nexport const getAll = (\n {resources}: AppState,\n resource: ResourceType\n): R[] => {\n const allIDs: string[] = resources[resource].allIDs\n const byID: {[uuid: string]: R} = resources[resource].byID\n return (allIDs ?? []).map(id => byID[id])\n}\n\nexport const getAllTasks = (state: AppState): Task[] =>\n getAll(state, ResourceType.Tasks) || []\n\nexport const hasNoTasks = (state: AppState): boolean =>\n getAll(state, ResourceType.Tasks).length === 0\n\nexport const getToken = (state: AppState): string =>\n get(state, 'dataLoading.dataLoaders.token', '') || ''\n\nexport const getByID = (\n {resources}: AppState,\n type: ResourceType,\n id: string\n): R => {\n const byID = get(resources, `${type}.byID`)\n\n if (!byID) {\n throw new Error(`\"${type}\" resource has yet not been set`)\n }\n\n const resource = get(byID, `${id}`, null)\n\n return resource\n}\n\nexport const getLabels = (state: AppState, labelIDs: string[]): Label[] => {\n return labelIDs\n .map(labelID => getByID