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EAASiC,EAAQnC,YAClBt2B,KAAK+4B,WAAWC,qBACbh5B,KAAKi5B,kBAEbR,EAAQrB,aAAep3B,KAAK+4B,WAAWtE,UAAUgE,EAAQrhB,GAAIof,EAAQ,CAAEvc,KAAMwe,EAAQ9C,KAAK1b,QA+E9F,IAAIoe,EAAgB,G,0CC1OpB,MAAM2C,EAAiC,CACrCC,UAAU58B,GACDA,GAASA,aAAiB68B,EAAAA,GAGnCzH,UAAUp1B,GACR,MAAM88B,EAAMC,EAAAA,GAAc/8B,IAEpB,MAAEg9B,EAAF,MAASC,GAAU,IAAIC,eAI7B,OAFAH,EAAAA,GAAeD,EAAKE,GAEb,CAACC,EAAO,CAACA,KAGlBE,YAAYn9B,IACVA,EAAMo9B,QAECL,EAAAA,GAA0B/8B,KAGrC+8B,EAAAA,GAAAA,IAA6B,oBAAqBJ,I,gBCvB3C,SAASU,EAAmBC,EAAsBC,GAEvD,OAAOD,EAAan1B,QADD,wBACqB,CAACq1B,EAAGC,IAAQF,EAAUE,GAAMF,EAAUE,GAAMA,I","sources":["webpack://grafana/./packages/grafana-data/src/datetime/parser.ts","webpack://grafana/./packages/grafana-data/src/events/eventFactory.ts","webpack://grafana/./packages/grafana-data/src/events/types.ts","webpack://grafana/./packages/grafana-data/src/field/FieldConfigOptionsRegistry.tsx","webpack://grafana/./packages/grafana-data/src/field/fieldComparers.ts","webpack://grafana/./packages/grafana-data/src/field/fieldState.ts","webpack://grafana/./packages/grafana-data/src/text/sanitize.ts","webpack://grafana/./packages/grafana-data/src/themes/createComponents.ts","webpack://grafana/./packages/grafana-data/src/themes/createV1Theme.ts","webpack://grafana/./packages/grafana-data/src/themes/createTheme.ts","webpack://grafana/./packages/grafana-data/src/themes/palette.ts","webpack://grafana/./packages/grafana-data/src/transformations/fieldReducer.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/fieldTypeMatcher.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/ids.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/predicates.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/refIdMatcher.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/simpleFieldMatcher.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/valueMatchers/equalMatchers.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/valueMatchers/nullMatchers.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/valueMatchers/numericMatchers.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/valueMatchers/rangeMatchers.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/valueMatchers/regexMatchers.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/ensureColumns.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/filter.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/filterByName.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/filterByRefId.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/ids.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/limit.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/merge.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/noop.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/organize.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/rename.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/seriesToColumns.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/seriesToRows.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/sortBy.ts","webpack://grafana/./packages/grafana-data/src/types/dataFrame.ts","webpack://grafana/./packages/grafana-data/src/types/fieldColor.ts","webpack://grafana/./packages/grafana-data/src/types/theme.ts","webpack://grafana/./packages/grafana-data/src/types/thresholds.ts","webpack://grafana/./packages/grafana-data/src/types/valueMapping.ts","webpack://grafana/./packages/grafana-data/src/utils/Registry.ts","webpack://grafana/./packages/grafana-data/src/utils/anyToNumber.ts","webpack://grafana/./packages/grafana-data/src/utils/binaryOperators.ts","webpack://grafana/./packages/grafana-data/src/utils/fieldParser.ts","webpack://grafana/./packages/grafana-data/src/utils/makeClassES5Compatible.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/arithmeticFormatters.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/categories.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/dateTimeFormatters.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/symbolFormatters.ts","webpack://grafana/./packages/grafana-data/src/vector/ArrayVector.ts","webpack://grafana/./packages/grafana-data/src/vector/AsNumberVector.ts","webpack://grafana/./packages/grafana-data/src/vector/BinaryOperationVector.ts","webpack://grafana/./packages/grafana-data/src/vector/ConstantVector.ts","webpack://grafana/./packages/grafana-data/src/vector/RowVector.ts","webpack://grafana/./packages/grafana-data/src/vector/SortedVector.ts","webpack://grafana/./packages/grafana-data/src/vector/vectorToArray.ts","webpack://grafana/./packages/grafana-runtime/src/utils/toDataQueryError.ts","webpack://grafana/./public/app/core/utils/urlToken.ts","webpack://grafana/./public/app/features/live/centrifuge/LiveDataStream.ts","webpack://grafana/./public/app/features/live/centrifuge/channel.ts","webpack://grafana/./public/app/features/live/centrifuge/service.ts","webpack://grafana/./public/app/features/live/centrifuge/transferHandlers.ts","webpack://grafana/./public/app/plugins/datasource/prometheus/legend.ts"],"sourcesContent":["/* eslint-disable id-blacklist, no-restricted-imports, @typescript-eslint/ban-types */\nimport { lowerCase } from 'lodash';\nimport moment, { MomentInput } from 'moment-timezone';\n\nimport { DateTimeOptions, getTimeZone } from './common';\nimport { parse, isValid } from './datemath';\nimport { systemDateFormats } from './formats';\nimport { DateTimeInput, DateTime, isDateTime } from './moment_wrapper';\n\n/**\n * The type that describes options that can be passed when parsing a date and time value.\n * @public\n */\nexport interface DateTimeOptionsWhenParsing extends DateTimeOptions {\n  /**\n   * If the input is a Grafana quick date, e.g. now-6h, then you can specify this to control\n   * whether the last part of the date and time value is included or excluded.\n   *\n   * Example: now-6h and the current time is 12:20:00 if roundUp is set to true\n   * the returned DateTime value will be 06:00:00.\n   */\n  roundUp?: boolean;\n  fiscalYearStartMonth?: number;\n}\n\ntype DateTimeParser<T extends DateTimeOptions = DateTimeOptions> = (value: DateTimeInput, options?: T) => DateTime;\n\n/**\n * Helper function to parse a number, text or Date to a DateTime value. If a timeZone is supplied the incoming value\n * is parsed with that timeZone as a base. The only exception to this is if the passed value is in a UTC-based\n * format. Then it will use UTC as the base. If no format is specified the current system format will be assumed.\n *\n * It can also parse the Grafana quick date and time format, e.g. now-6h will be parsed as Date.now() - 6 hours and\n * returned as a valid DateTime value.\n *\n * If no options are supplied, then default values are used. For more details please see {@link DateTimeOptions}.\n *\n * @param value - should be a parsable date and time value\n * @param options\n *\n * @public\n */\nexport const dateTimeParse: DateTimeParser<DateTimeOptionsWhenParsing> = (value, options?): DateTime => {\n  if (isDateTime(value)) {\n    return value;\n  }\n\n  if (typeof value === 'string') {\n    return parseString(value, options);\n  }\n\n  return parseOthers(value, options);\n};\n\nconst parseString = (value: string, options?: DateTimeOptionsWhenParsing): DateTime => {\n  if (value.indexOf('now') !== -1) {\n    if (!isValid(value)) {\n      return moment() as DateTime;\n    }\n\n    const parsed = parse(value, options?.roundUp, options?.timeZone, options?.fiscalYearStartMonth);\n    return parsed || (moment() as DateTime);\n  }\n\n  const timeZone = getTimeZone(options);\n  const zone = moment.tz.zone(timeZone);\n  const format = options?.format ?? systemDateFormats.fullDate;\n\n  if (zone && zone.name) {\n    return moment.tz(value, format, zone.name) as DateTime;\n  }\n\n  switch (lowerCase(timeZone)) {\n    case 'utc':\n      return moment.utc(value, format) as DateTime;\n    default:\n      return moment(value, format) as DateTime;\n  }\n};\n\nconst parseOthers = (value: DateTimeInput, options?: DateTimeOptionsWhenParsing): DateTime => {\n  const date = value as MomentInput;\n  const timeZone = getTimeZone(options);\n  const zone = moment.tz.zone(timeZone);\n\n  if (zone && zone.name) {\n    return moment.tz(date, zone.name) as DateTime;\n  }\n\n  switch (lowerCase(timeZone)) {\n    case 'utc':\n      return moment.utc(date) as DateTime;\n    default:\n      return moment(date) as DateTime;\n  }\n};\n","import { AppEvent } from './types';\n\nconst typeList: Set<string> = new Set();\n\nexport function eventFactory<T = undefined>(name: string): AppEvent<T> {\n  if (typeList.has(name)) {\n    throw new Error(`There is already an event defined with type '${name}'`);\n  }\n\n  typeList.add(name);\n  return { name };\n}\n","import { Unsubscribable, Observable } from 'rxjs';\n\n/**\n * @alpha\n * internal interface\n */\nexport interface BusEvent {\n  readonly type: string;\n  readonly payload?: any;\n  readonly origin?: EventBus;\n}\n\n/**\n * @alpha\n * Base event type\n */\nexport abstract class BusEventBase implements BusEvent {\n  readonly type: string;\n  readonly payload?: any;\n  readonly origin?: EventBus;\n\n  constructor() {\n    //@ts-ignore\n    this.type = this.__proto__.constructor.type;\n  }\n}\n\n/**\n * @alpha\n * Base event type with payload\n */\nexport abstract class BusEventWithPayload<T> extends BusEventBase {\n  readonly payload: T;\n\n  constructor(payload: T) {\n    super();\n    this.payload = payload;\n  }\n}\n\n/*\n * Interface for an event type constructor\n */\nexport interface BusEventType<T extends BusEvent> {\n  type: string;\n  new (...args: any[]): T;\n}\n\n/**\n * @alpha\n * Event callback/handler type\n */\nexport interface BusEventHandler<T extends BusEvent> {\n  (event: T): void;\n}\n\n/**\n * @alpha\n * Main minimal interface\n */\nexport interface EventFilterOptions {\n  onlyLocal: boolean;\n}\n\n/**\n * @alpha\n * Main minimal interface\n */\nexport interface EventBus {\n  /**\n   * Publish single vent\n   */\n  publish<T extends BusEvent>(event: T): void;\n\n  /**\n   * Get observable of events\n   */\n  getStream<T extends BusEvent>(eventType: BusEventType<T>): Observable<T>;\n\n  /**\n   * Subscribe to an event stream\n   *\n   * This function is a wrapper around the `getStream(...)` function\n   */\n  subscribe<T extends BusEvent>(eventType: BusEventType<T>, handler: BusEventHandler<T>): Unsubscribable;\n\n  /**\n   * Remove all event subscriptions\n   */\n  removeAllListeners(): void;\n\n  /**\n   * Returns a new bus scoped that knows where it exists in a heiarchy\n   *\n   * @internal -- This is included for internal use only should not be used directly\n   */\n  newScopedBus(key: string, filter: EventFilterOptions): EventBus;\n}\n\n/**\n * @public\n * @deprecated event type\n */\nexport interface AppEvent<T> {\n  readonly name: string;\n  payload?: T;\n}\n\n/** @public */\nexport interface LegacyEmitter {\n  /**\n   * @deprecated use $emit\n   */\n  emit<T>(event: AppEvent<T> | string, payload?: T): void;\n\n  /**\n   * @deprecated use $on\n   */\n  on<T>(event: AppEvent<T> | string, handler: LegacyEventHandler<T>, scope?: any): void;\n\n  /**\n   * @deprecated use $on\n   */\n  off<T>(event: AppEvent<T> | string, handler: (payload?: T | any) => void): void;\n}\n\n/** @public */\nexport interface LegacyEventHandler<T> {\n  (payload: T): void;\n  wrapper?: (event: BusEvent) => void;\n}\n\n/** @alpha */\nexport interface EventBusExtended extends EventBus, LegacyEmitter {}\n","import { FieldConfigPropertyItem } from '../types/fieldOverrides';\nimport { Registry } from '../utils/Registry';\n\nexport class FieldConfigOptionsRegistry extends Registry<FieldConfigPropertyItem> {}\n","import { isNumber } from 'lodash';\n\nimport { dateTime } from '../datetime';\nimport { Field, FieldType } from '../types/dataFrame';\nimport { Vector } from '../types/vector';\n\ntype IndexComparer = (a: number, b: number) => number;\n\n/** @public */\nexport const fieldIndexComparer = (field: Field, reverse = false): IndexComparer => {\n  const values = field.values;\n\n  switch (field.type) {\n    case FieldType.number:\n      return numericIndexComparer(values, reverse);\n    case FieldType.string:\n      return stringIndexComparer(values, reverse);\n    case FieldType.boolean:\n      return booleanIndexComparer(values, reverse);\n    case FieldType.time:\n      return timeIndexComparer(values, reverse);\n    default:\n      return naturalIndexComparer(reverse);\n  }\n};\n\n/** @public */\nexport const timeComparer = (a: any, b: any): number => {\n  if (!a || !b) {\n    return falsyComparer(a, b);\n  }\n\n  if (isNumber(a) && isNumber(b)) {\n    return numericComparer(a, b);\n  }\n\n  if (dateTime(a).isBefore(b)) {\n    return -1;\n  }\n\n  if (dateTime(b).isBefore(a)) {\n    return 1;\n  }\n\n  return 0;\n};\n\n/** @public */\nexport const numericComparer = (a: number, b: number): number => {\n  return a - b;\n};\n\n/** @public */\nexport const stringComparer = (a: string, b: string): number => {\n  if (!a || !b) {\n    return falsyComparer(a, b);\n  }\n  return a.localeCompare(b);\n};\n\nexport const booleanComparer = (a: boolean, b: boolean): number => {\n  return falsyComparer(a, b);\n};\n\nconst falsyComparer = (a: any, b: any): number => {\n  if (!a && b) {\n    return 1;\n  }\n\n  if (a && !b) {\n    return -1;\n  }\n\n  return 0;\n};\n\nconst timeIndexComparer = (values: Vector<any>, reverse: boolean): IndexComparer => {\n  return (a: number, b: number): number => {\n    const vA = values.get(a);\n    const vB = values.get(b);\n    return reverse ? timeComparer(vB, vA) : timeComparer(vA, vB);\n  };\n};\n\nconst booleanIndexComparer = (values: Vector<any>, reverse: boolean): IndexComparer => {\n  return (a: number, b: number): number => {\n    const vA: boolean = values.get(a);\n    const vB: boolean = values.get(b);\n    return reverse ? booleanComparer(vB, vA) : booleanComparer(vA, vB);\n  };\n};\n\nconst numericIndexComparer = (values: Vector<any>, reverse: boolean): IndexComparer => {\n  return (a: number, b: number): number => {\n    const vA: number = values.get(a);\n    const vB: number = values.get(b);\n    return reverse ? numericComparer(vB, vA) : numericComparer(vA, vB);\n  };\n};\n\nconst stringIndexComparer = (values: Vector<any>, reverse: boolean): IndexComparer => {\n  return (a: number, b: number): number => {\n    const vA: string = values.get(a);\n    const vB: string = values.get(b);\n    return reverse ? stringComparer(vB, vA) : stringComparer(vA, vB);\n  };\n};\n\nconst naturalIndexComparer = (reverse: boolean): IndexComparer => {\n  return (a: number, b: number): number => {\n    return reverse ? numericComparer(b, a) : numericComparer(a, b);\n  };\n};\n","import { DataFrame, Field, TIME_SERIES_VALUE_FIELD_NAME, FieldType, TIME_SERIES_TIME_FIELD_NAME } from '../types';\nimport { formatLabels } from '../utils/labels';\n\n/**\n * Get an appropriate display title\n */\nexport function getFrameDisplayName(frame: DataFrame, index?: number) {\n  if (frame.name) {\n    return frame.name;\n  }\n\n  // Single field with tags\n  const valuesWithLabels: Field[] = [];\n  for (const field of frame.fields) {\n    if (field.labels && Object.keys(field.labels).length > 0) {\n      valuesWithLabels.push(field);\n    }\n  }\n\n  if (valuesWithLabels.length === 1) {\n    return formatLabels(valuesWithLabels[0].labels!);\n  }\n\n  // list all the\n  if (index === undefined) {\n    return frame.fields\n      .filter((f) => f.type !== FieldType.time)\n      .map((f) => getFieldDisplayName(f, frame))\n      .join(', ');\n  }\n\n  if (frame.refId) {\n    return `Series (${frame.refId})`;\n  }\n\n  return `Series (${index})`;\n}\n\nexport function getFieldDisplayName(field: Field, frame?: DataFrame, allFrames?: DataFrame[]): string {\n  const existingTitle = field.state?.displayName;\n  const multipleFrames = Boolean(allFrames && allFrames.length > 1);\n\n  if (existingTitle && multipleFrames === field.state?.multipleFrames) {\n    return existingTitle;\n  }\n\n  const displayName = calculateFieldDisplayName(field, frame, allFrames);\n  field.state = field.state || {};\n  field.state.displayName = displayName;\n  field.state.multipleFrames = multipleFrames;\n\n  return displayName;\n}\n\n/**\n * Get an appropriate display name. If the 'displayName' field config is set, use that.\n */\nfunction calculateFieldDisplayName(field: Field, frame?: DataFrame, allFrames?: DataFrame[]): string {\n  const hasConfigTitle = field.config?.displayName && field.config?.displayName.length;\n\n  let displayName = hasConfigTitle ? field.config!.displayName! : field.name;\n\n  if (hasConfigTitle) {\n    return displayName;\n  }\n\n  if (frame && field.config?.displayNameFromDS) {\n    return field.config.displayNameFromDS;\n  }\n\n  // This is an ugly exception for time field\n  // For time series we should normally treat time field with same name\n  // But in case it has a join source we should handle it as normal field\n  if (field.type === FieldType.time && !field.labels) {\n    return displayName ?? TIME_SERIES_TIME_FIELD_NAME;\n  }\n\n  let parts: string[] = [];\n  let frameNamesDiffer = false;\n\n  if (allFrames && allFrames.length > 1) {\n    for (let i = 1; i < allFrames.length; i++) {\n      const frame = allFrames[i];\n      if (frame.name !== allFrames[i - 1].name) {\n        frameNamesDiffer = true;\n        break;\n      }\n    }\n  }\n\n  let frameNameAdded = false;\n  let labelsAdded = false;\n\n  if (frameNamesDiffer && frame?.name) {\n    parts.push(frame.name);\n    frameNameAdded = true;\n  }\n\n  if (field.name && field.name !== TIME_SERIES_VALUE_FIELD_NAME) {\n    parts.push(field.name);\n  }\n\n  if (field.labels && frame) {\n    let singleLabelName = getSingleLabelName(allFrames ?? [frame]);\n\n    if (!singleLabelName) {\n      let allLabels = formatLabels(field.labels);\n      if (allLabels) {\n        parts.push(allLabels);\n        labelsAdded = true;\n      }\n    } else if (field.labels[singleLabelName]) {\n      parts.push(field.labels[singleLabelName]);\n      labelsAdded = true;\n    }\n  }\n\n  // if we have not added frame name and no labels, and field name = Value, we should add frame name\n  if (frame && !frameNameAdded && !labelsAdded && field.name === TIME_SERIES_VALUE_FIELD_NAME) {\n    if (frame.name && frame.name.length > 0) {\n      parts.push(frame.name);\n      frameNameAdded = true;\n    }\n  }\n\n  if (parts.length) {\n    displayName = parts.join(' ');\n  } else if (field.name) {\n    displayName = field.name;\n  } else {\n    displayName = TIME_SERIES_VALUE_FIELD_NAME;\n  }\n\n  // Ensure unique field name\n  if (displayName === field.name) {\n    displayName = getUniqueFieldName(field, frame);\n  }\n\n  return displayName;\n}\n\nfunction getUniqueFieldName(field: Field, frame?: DataFrame) {\n  let dupeCount = 0;\n  let foundSelf = false;\n\n  if (frame) {\n    for (let i = 0; i < frame.fields.length; i++) {\n      const otherField = frame.fields[i];\n\n      if (field === otherField) {\n        foundSelf = true;\n\n        if (dupeCount > 0) {\n          dupeCount++;\n          break;\n        }\n      } else if (field.name === otherField.name) {\n        dupeCount++;\n\n        if (foundSelf) {\n          break;\n        }\n      }\n    }\n  }\n\n  if (dupeCount) {\n    return `${field.name} ${dupeCount}`;\n  }\n\n  return field.name;\n}\n\n/**\n * Checks all data frames and return name of label if there is only one label name in all frames\n */\nfunction getSingleLabelName(frames: DataFrame[]): string | null {\n  let singleName: string | null = null;\n\n  for (let i = 0; i < frames.length; i++) {\n    const frame = frames[i];\n\n    for (const field of frame.fields) {\n      if (!field.labels) {\n        continue;\n      }\n\n      // yes this should be in!\n      for (const labelKey in field.labels) {\n        if (singleName === null) {\n          singleName = labelKey;\n        } else if (labelKey !== singleName) {\n          return null;\n        }\n      }\n    }\n  }\n\n  return singleName;\n}\n","import { sanitizeUrl as braintreeSanitizeUrl } from '@braintree/sanitize-url';\nimport * as xss from 'xss';\n\nconst XSSWL = Object.keys(xss.whiteList).reduce((acc, element) => {\n  acc[element] = xss.whiteList[element]?.concat(['class', 'style']);\n  return acc;\n}, {} as xss.IWhiteList);\n\nconst sanitizeXSS = new xss.FilterXSS({\n  whiteList: XSSWL,\n});\n\nconst sanitizeTextPanelWhitelist = new xss.FilterXSS({\n  whiteList: XSSWL,\n  css: {\n    whiteList: {\n      ...xss.getDefaultCSSWhiteList(),\n      'flex-direction': true,\n      'flex-wrap': true,\n      'flex-basis': true,\n      'flex-grow': true,\n      'flex-shrink': true,\n      'flex-flow': true,\n      gap: true,\n      order: true,\n      'justify-content': true,\n      'justify-items': true,\n      'justify-self': true,\n      'align-items': true,\n      'align-content': true,\n      'align-self': true,\n    },\n  },\n});\n\n/**\n * Returns string safe from XSS attacks.\n *\n * Even though we allow the style-attribute, there's still default filtering applied to it\n * Info: https://github.com/leizongmin/js-xss#customize-css-filter\n * Whitelist: https://github.com/leizongmin/js-css-filter/blob/master/lib/default.js\n */\nexport function sanitize(unsanitizedString: string): string {\n  try {\n    return sanitizeXSS.process(unsanitizedString);\n  } catch (error) {\n    console.error('String could not be sanitized', unsanitizedString);\n    return unsanitizedString;\n  }\n}\n\nexport function sanitizeTextPanelContent(unsanitizedString: string): string {\n  try {\n    return sanitizeTextPanelWhitelist.process(unsanitizedString);\n  } catch (error) {\n    console.error('String could not be sanitized', unsanitizedString);\n    return 'Text string could not be sanitized';\n  }\n}\n\nexport function sanitizeUrl(url: string): string {\n  return braintreeSanitizeUrl(url);\n}\n\nexport function hasAnsiCodes(input: string): boolean {\n  return /\\u001b\\[\\d{1,2}m/.test(input);\n}\n\nexport function escapeHtml(str: string): string {\n  return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\n}\n","import { ThemeColors } from './createColors';\nimport { ThemeShadows } from './createShadows';\n\n/** @beta */\nexport interface ThemeComponents {\n  /** Applies to normal buttons, inputs, radio buttons, etc */\n  height: {\n    sm: number;\n    md: number;\n    lg: number;\n  };\n  input: {\n    background: string;\n    borderColor: string;\n    borderHover: string;\n    text: string;\n  };\n  tooltip: {\n    text: string;\n    background: string;\n  };\n  panel: {\n    padding: number;\n    headerHeight: number;\n    borderColor: string;\n    boxShadow: string;\n    background: string;\n  };\n  dropdown: {\n    background: string;\n  };\n  overlay: {\n    background: string;\n  };\n  dashboard: {\n    background: string;\n    padding: number;\n  };\n  textHighlight: {\n    background: string;\n    text: string;\n  };\n  sidemenu: {\n    width: number;\n  };\n  menuTabs: {\n    height: number;\n  };\n  horizontalDrawer: {\n    defaultHeight: number;\n  };\n}\n\nexport function createComponents(colors: ThemeColors, shadows: ThemeShadows): ThemeComponents {\n  const panel = {\n    padding: 1,\n    headerHeight: 4,\n    background: colors.background.primary,\n    borderColor: colors.border.weak,\n    boxShadow: 'none',\n  };\n\n  const input = {\n    borderColor: colors.border.medium,\n    borderHover: colors.border.strong,\n    text: colors.text.primary,\n    background: colors.mode === 'dark' ? colors.background.canvas : colors.background.primary,\n  };\n\n  return {\n    height: {\n      sm: 3,\n      md: 4,\n      lg: 6,\n    },\n    input,\n    panel,\n    dropdown: {\n      background: input.background,\n    },\n    tooltip: {\n      background: colors.background.secondary,\n      text: colors.text.primary,\n    },\n    dashboard: {\n      background: colors.background.canvas,\n      padding: 1,\n    },\n    overlay: {\n      background: colors.mode === 'dark' ? 'rgba(63, 62, 62, 0.45)' : 'rgba(208, 209, 211, 0.24)',\n    },\n    sidemenu: {\n      width: 57,\n    },\n    menuTabs: {\n      height: 41,\n    },\n    textHighlight: {\n      text: colors.warning.contrastText,\n      background: colors.warning.main,\n    },\n    horizontalDrawer: {\n      defaultHeight: 400,\n    },\n  };\n}\n","import { GrafanaTheme, GrafanaThemeCommons, GrafanaThemeType } from '../types';\n\nimport { GrafanaTheme2 } from './types';\n\nexport function createV1Theme(theme: Omit<GrafanaTheme2, 'v1'>): GrafanaTheme {\n  const oldCommon: GrafanaThemeCommons = {\n    name: 'Grafana Default',\n    typography: {\n      fontFamily: {\n        sansSerif: theme.typography.fontFamily,\n        monospace: theme.typography.fontFamilyMonospace,\n      },\n      size: {\n        base: `${theme.typography.fontSize}px`,\n        xs: theme.typography.size.xs,\n        sm: theme.typography.size.sm,\n        md: theme.typography.size.md,\n        lg: theme.typography.size.lg,\n      },\n      heading: {\n        h1: theme.typography.h1.fontSize,\n        h2: theme.typography.h2.fontSize,\n        h3: theme.typography.h3.fontSize,\n        h4: theme.typography.h4.fontSize,\n        h5: theme.typography.h5.fontSize,\n        h6: theme.typography.h6.fontSize,\n      },\n      weight: {\n        light: theme.typography.fontWeightLight,\n        regular: theme.typography.fontWeightRegular,\n        semibold: theme.typography.fontWeightMedium,\n        bold: theme.typography.fontWeightBold,\n      },\n      lineHeight: {\n        xs: theme.typography.bodySmall.lineHeight,\n        sm: theme.typography.bodySmall.lineHeight,\n        md: theme.typography.body.lineHeight,\n        lg: theme.typography.h2.lineHeight,\n      },\n      link: {\n        decoration: 'none',\n        hoverDecoration: 'none',\n      },\n    },\n    breakpoints: {\n      xs: `${theme.breakpoints.values.xs}px`,\n      sm: `${theme.breakpoints.values.sm}px`,\n      md: `${theme.breakpoints.values.md}px`,\n      lg: `${theme.breakpoints.values.lg}px`,\n      xl: `${theme.breakpoints.values.xl}px`,\n      xxl: `${theme.breakpoints.values.xxl}px`,\n    },\n    spacing: {\n      base: theme.spacing.gridSize,\n      insetSquishMd: theme.spacing(0.5, 1),\n      d: theme.spacing(2),\n      xxs: theme.spacing(0.25),\n      xs: theme.spacing(0.5),\n      sm: theme.spacing(1),\n      md: theme.spacing(2),\n      lg: theme.spacing(3),\n      xl: theme.spacing(4),\n      gutter: theme.spacing(4),\n\n      // Next-gen forms spacing variables\n      // TODO: Move variables definition to respective components when implementing\n      formSpacingBase: theme.spacing.gridSize,\n      formMargin: `${theme.spacing.gridSize * 4}px`,\n      formFieldsetMargin: `${theme.spacing.gridSize * 2}px`,\n      formInputHeight: theme.spacing.gridSize * 4,\n      formButtonHeight: theme.spacing.gridSize * 4,\n      formInputPaddingHorizontal: `${theme.spacing.gridSize}px`,\n\n      // Used for icons do define spacing between icon and input field\n      // Applied on the right(prefix) or left(suffix)\n      formInputAffixPaddingHorizontal: `${theme.spacing.gridSize / 2}px`,\n\n      formInputMargin: `${theme.spacing.gridSize * 2}px`,\n      formLabelPadding: '0 0 0 2px',\n      formLabelMargin: `0 0 ${theme.spacing.gridSize / 2 + 'px'} 0`,\n      formValidationMessagePadding: '4px 8px',\n      formValidationMessageMargin: '4px 0 0 0',\n      inlineFormMargin: '4px',\n    },\n    border: {\n      radius: {\n        sm: theme.shape.borderRadius(1),\n        md: theme.shape.borderRadius(2),\n        lg: theme.shape.borderRadius(3),\n      },\n      width: {\n        sm: '1px',\n      },\n    },\n    height: {\n      sm: theme.spacing.gridSize * theme.components.height.sm,\n      md: theme.spacing.gridSize * theme.components.height.md,\n      lg: theme.spacing.gridSize * theme.components.height.lg,\n    },\n    panelPadding: theme.components.panel.padding * theme.spacing.gridSize,\n    panelHeaderHeight: theme.spacing.gridSize * theme.components.panel.headerHeight,\n    zIndex: theme.zIndex,\n  };\n\n  const basicColors = {\n    ...commonColorsPalette,\n    black: '#000000',\n    white: '#ffffff',\n    dark1: '#141414',\n    dark2: '#161719',\n    dark3: '#1f1f20',\n    dark4: '#212124',\n    dark5: '#222426',\n    dark6: '#262628',\n    dark7: '#292a2d',\n    dark8: '#2f2f32',\n    dark9: '#343436',\n    dark10: '#424345',\n    gray1: '#555555',\n    gray2: '#8e8e8e',\n    gray3: '#b3b3b3',\n    gray4: '#d8d9da',\n    gray5: '#ececec',\n    gray6: '#f4f5f8', // not used in dark theme\n    gray7: '#fbfbfb', // not used in dark theme\n    redBase: '#e02f44',\n    redShade: '#c4162a',\n    greenBase: '#299c46',\n    greenShade: '#23843b',\n    red: '#d44a3a',\n    yellow: '#ecbb13',\n    purple: '#9933cc',\n    variable: '#32d1df',\n    orange: '#eb7b18',\n    orangeDark: '#ff780a',\n  };\n\n  const backgrounds = {\n    bg1: theme.colors.background.primary,\n    bg2: theme.colors.background.secondary,\n    bg3: theme.colors.action.hover,\n    dashboardBg: theme.colors.background.canvas,\n    bgBlue1: theme.colors.primary.main,\n    bgBlue2: theme.colors.primary.shade,\n  };\n\n  const borders = {\n    border1: theme.colors.border.weak,\n    border2: theme.colors.border.medium,\n    border3: theme.colors.border.strong,\n  };\n\n  const textColors = {\n    textStrong: theme.colors.text.maxContrast,\n    textHeading: theme.colors.text.primary,\n    text: theme.colors.text.primary,\n    textSemiWeak: theme.colors.text.secondary,\n    textWeak: theme.colors.text.secondary,\n    textFaint: theme.colors.text.disabled,\n    textBlue: theme.colors.primary.text,\n  };\n\n  const form = {\n    // Next-gen forms functional colors\n    formLabel: theme.colors.text.primary,\n    formDescription: theme.colors.text.secondary,\n    formInputBg: theme.components.input.background,\n    formInputBgDisabled: theme.colors.action.disabledBackground,\n    formInputBorder: theme.components.input.borderColor,\n    formInputBorderHover: theme.components.input.borderHover,\n    formInputBorderActive: theme.colors.primary.border,\n    formInputBorderInvalid: theme.colors.error.border,\n    formInputPlaceholderText: theme.colors.text.disabled,\n    formInputText: theme.components.input.text,\n    formInputDisabledText: theme.colors.action.disabledText,\n    formFocusOutline: theme.colors.primary.main,\n    formValidationMessageText: theme.colors.error.contrastText,\n    formValidationMessageBg: theme.colors.error.main,\n  };\n\n  return {\n    ...oldCommon,\n    type: theme.colors.mode === 'dark' ? GrafanaThemeType.Dark : GrafanaThemeType.Light,\n    isDark: theme.isDark,\n    isLight: theme.isLight,\n    name: theme.name,\n    palette: {\n      ...basicColors,\n      brandPrimary: basicColors.orange,\n      brandSuccess: theme.colors.success.main,\n      brandWarning: theme.colors.warning.main,\n      brandDanger: theme.colors.error.main,\n      queryRed: theme.colors.error.text,\n      queryGreen: theme.colors.success.text,\n      queryPurple: '#fe85fc',\n      queryOrange: basicColors.orange,\n      online: theme.colors.success.main,\n      warn: theme.colors.success.main,\n      critical: theme.colors.success.main,\n    },\n    colors: {\n      ...backgrounds,\n      ...borders,\n      ...form,\n      ...textColors,\n\n      bodyBg: theme.colors.background.canvas,\n      panelBg: theme.components.panel.background,\n      panelBorder: theme.components.panel.borderColor,\n      pageHeaderBg: theme.colors.background.canvas,\n      pageHeaderBorder: theme.colors.background.canvas,\n\n      dropdownBg: form.formInputBg,\n      dropdownShadow: basicColors.black,\n      dropdownOptionHoverBg: backgrounds.bg2,\n\n      link: theme.colors.text.primary,\n      linkDisabled: theme.colors.text.disabled,\n      linkHover: theme.colors.text.maxContrast,\n      linkExternal: theme.colors.text.link,\n    },\n    shadows: {\n      listItem: 'none',\n    },\n    visualization: theme.visualization,\n  };\n}\n\nconst commonColorsPalette = {\n  // New greys palette used by next-gen form elements\n  gray98: '#f7f8fa',\n  gray97: '#f1f5f9',\n  gray95: '#e9edf2',\n  gray90: '#dce1e6',\n  gray85: '#c7d0d9',\n  gray70: '#9fa7b3',\n  gray60: '#7b8087',\n  gray33: '#464c54',\n  gray25: '#2c3235',\n  gray15: '#202226',\n  gray10: '#141619',\n  gray05: '#0b0c0e',\n\n  // New blues palette used by next-gen form elements\n  blue95: '#5794f2', // blue95\n  blue85: '#33a2e5', // blueText\n  blue80: '#3274d9', // blue80\n  blue77: '#1f60c4', // blue77\n\n  // New reds palette used by next-gen form elements\n  red88: '#e02f44',\n};\n","import { createBreakpoints } from './breakpoints';\nimport { createColors, ThemeColorsInput } from './createColors';\nimport { createComponents } from './createComponents';\nimport { createShadows } from './createShadows';\nimport { createShape, ThemeShapeInput } from './createShape';\nimport { createSpacing, ThemeSpacingOptions } from './createSpacing';\nimport { createTransitions } from './createTransitions';\nimport { createTypography, ThemeTypographyInput } from './createTypography';\nimport { createV1Theme } from './createV1Theme';\nimport { createVisualizationColors } from './createVisualizationColors';\nimport { GrafanaTheme2 } from './types';\nimport { zIndex } from './zIndex';\n\n/** @internal */\nexport interface NewThemeOptions {\n  name?: string;\n  colors?: ThemeColorsInput;\n  spacing?: ThemeSpacingOptions;\n  shape?: ThemeShapeInput;\n  typography?: ThemeTypographyInput;\n}\n\n/** @internal */\nexport function createTheme(options: NewThemeOptions = {}): GrafanaTheme2 {\n  const {\n    colors: colorsInput = {},\n    spacing: spacingInput = {},\n    shape: shapeInput = {},\n    typography: typographyInput = {},\n  } = options;\n\n  const colors = createColors(colorsInput);\n  const breakpoints = createBreakpoints();\n  const spacing = createSpacing(spacingInput);\n  const shape = createShape(shapeInput);\n  const typography = createTypography(colors, typographyInput);\n  const shadows = createShadows(colors);\n  const transitions = createTransitions();\n  const components = createComponents(colors, shadows);\n  const visualization = createVisualizationColors(colors);\n\n  const theme = {\n    name: colors.mode === 'dark' ? 'Dark' : 'Light',\n    isDark: colors.mode === 'dark',\n    isLight: colors.mode === 'light',\n    colors,\n    breakpoints,\n    spacing,\n    shape,\n    components,\n    typography,\n    shadows,\n    transitions,\n    visualization,\n    zIndex: {\n      ...zIndex,\n    },\n    flags: {},\n  };\n\n  return {\n    ...theme,\n    v1: createV1Theme(theme),\n  };\n}\n","export const palette = {\n  white: '#FFFFFF',\n  black: '#000000',\n\n  gray25: '#2c3235',\n  gray15: '#22252b', //'#202226',\n  gray10: '#181b1f', // old '#141619',\n  gray05: '#111217', // old '#0b0c0e',\n\n  // new from figma,\n  darkLayer0: '#18181A',\n  darkLayer1: '#212124',\n  darkLayer2: '#2a2a2f', // figma used #34343B but a bit too bright\n\n  darkBorder1: '#34343B',\n  darkBorder2: '#64646B',\n\n  // Dashboard bg / layer 0 (light theme)\n  gray90: '#F4F5F5',\n  // Card bg / layer 1\n  gray100: '#F4F5F5',\n  // divider line\n  gray80: '#D0D1D3',\n  // from figma\n  lightBorder1: '#E4E7E7',\n\n  blueDarkMain: '#3D71D9', // '#4165F5',\n  blueDarkText: '#6E9FFF', // '#58a6ff', //'#33a2e5', // '#5790FF',\n  redDarkMain: '#D10E5C',\n  redDarkText: '#FF5286',\n  greenDarkMain: '#1A7F4B',\n  greenDarkText: '#6CCF8E',\n  orangeDarkMain: '#F5B73D',\n  orangeDarkText: '#F8D06B',\n\n  blueLightMain: '#3871DC',\n  blueLightText: '#1F62E0',\n  redLightMain: '#E0226E',\n  redLightText: '#CF0E5B',\n  greenLightMain: '#1B855E',\n  greenLightText: '#0A764E',\n  orangeLightMain: '#FAD34A',\n  orangeLightText: '#8A6C00',\n};\n","// Libraries\nimport { isNumber } from 'lodash';\n\nimport { NullValueMode, Field, FieldState, FieldCalcs, FieldType } from '../types/index';\nimport { Registry, RegistryItem } from '../utils/Registry';\n\nexport enum ReducerID {\n  sum = 'sum',\n  max = 'max',\n  min = 'min',\n  logmin = 'logmin',\n  mean = 'mean',\n  variance = 'variance',\n  stdDev = 'stdDev',\n  last = 'last',\n  first = 'first',\n  count = 'count',\n  range = 'range',\n  diff = 'diff',\n  diffperc = 'diffperc',\n  delta = 'delta',\n  step = 'step',\n  firstNotNull = 'firstNotNull',\n  lastNotNull = 'lastNotNull',\n  changeCount = 'changeCount',\n  distinctCount = 'distinctCount',\n  allIsZero = 'allIsZero',\n  allIsNull = 'allIsNull',\n  allValues = 'allValues',\n  uniqueValues = 'uniqueValues',\n}\n\n// Internal function\ntype FieldReducer = (field: Field, ignoreNulls: boolean, nullAsZero: boolean) => FieldCalcs;\n\nexport interface FieldReducerInfo extends RegistryItem {\n  // Internal details\n  emptyInputResult?: any; // typically null, but some things like 'count' & 'sum' should be zero\n  standard: boolean; // The most common stats can all be calculated in a single pass\n  reduce?: FieldReducer;\n}\n\ninterface ReduceFieldOptions {\n  field: Field;\n  reducers: string[]; // The stats to calculate\n}\n\n/**\n * @returns an object with a key for each selected stat\n * NOTE: This will also modify the 'field.state' object,\n * leaving values in a cache until cleared.\n */\nexport function reduceField(options: ReduceFieldOptions): FieldCalcs {\n  const { field, reducers } = options;\n\n  if (!field || !reducers || reducers.length < 1) {\n    return {};\n  }\n\n  if (field.state?.calcs) {\n    // Find the values we need to calculate\n    const missing: string[] = [];\n    for (const s of reducers) {\n      if (!field.state.calcs.hasOwnProperty(s)) {\n        missing.push(s);\n      }\n    }\n    if (missing.length < 1) {\n      return {\n        ...field.state.calcs,\n      };\n    }\n  }\n  if (!field.state) {\n    field.state = {} as FieldState;\n  }\n\n  const queue = fieldReducers.list(reducers);\n\n  // Return early for empty series\n  // This lets the concrete implementations assume at least one row\n  const data = field.values;\n  if (data.length < 1) {\n    const calcs = { ...field.state.calcs } as FieldCalcs;\n    for (const reducer of queue) {\n      calcs[reducer.id] = reducer.emptyInputResult !== null ? reducer.emptyInputResult : null;\n    }\n    return (field.state.calcs = calcs);\n  }\n\n  const { nullValueMode } = field.config;\n  const ignoreNulls = nullValueMode === NullValueMode.Ignore;\n  const nullAsZero = nullValueMode === NullValueMode.AsZero;\n\n  // Avoid calculating all the standard stats if possible\n  if (queue.length === 1 && queue[0].reduce) {\n    const values = queue[0].reduce(field, ignoreNulls, nullAsZero);\n    field.state.calcs = {\n      ...field.state.calcs,\n      ...values,\n    };\n    return values;\n  }\n\n  // For now everything can use the standard stats\n  let values = doStandardCalcs(field, ignoreNulls, nullAsZero);\n\n  for (const reducer of queue) {\n    if (!values.hasOwnProperty(reducer.id) && reducer.reduce) {\n      values = {\n        ...values,\n        ...reducer.reduce(field, ignoreNulls, nullAsZero),\n      };\n    }\n  }\n\n  field.state.calcs = {\n    ...field.state.calcs,\n    ...values,\n  };\n  return values;\n}\n\n// ------------------------------------------------------------------------------\n//\n//  No Exported symbols below here.\n//\n// ------------------------------------------------------------------------------\n\nexport const fieldReducers = new Registry<FieldReducerInfo>(() => [\n  {\n    id: ReducerID.lastNotNull,\n    name: 'Last *',\n    description: 'Last non-null value',\n    standard: true,\n    aliasIds: ['current'],\n    reduce: calculateLastNotNull,\n  },\n  {\n    id: ReducerID.last,\n    name: 'Last',\n    description: 'Last value',\n    standard: true,\n    reduce: calculateLast,\n  },\n  {\n    id: ReducerID.firstNotNull,\n    name: 'First *',\n    description: 'First non-null value',\n    standard: true,\n    reduce: calculateFirstNotNull,\n  },\n  { id: ReducerID.first, name: 'First', description: 'First Value', standard: true, reduce: calculateFirst },\n  { id: ReducerID.min, name: 'Min', description: 'Minimum Value', standard: true },\n  { id: ReducerID.max, name: 'Max', description: 'Maximum Value', standard: true },\n  { id: ReducerID.mean, name: 'Mean', description: 'Average Value', standard: true, aliasIds: ['avg'] },\n  {\n    id: ReducerID.variance,\n    name: 'Variance',\n    description: 'Variance of all values in a field',\n    standard: false,\n    reduce: calculateStdDev,\n  },\n  {\n    id: ReducerID.stdDev,\n    name: 'StdDev',\n    description: 'Standard deviation of all values in a field',\n    standard: false,\n    reduce: calculateStdDev,\n  },\n  {\n    id: ReducerID.sum,\n    name: 'Total',\n    description: 'The sum of all values',\n    emptyInputResult: 0,\n    standard: true,\n    aliasIds: ['total'],\n  },\n  {\n    id: ReducerID.count,\n    name: 'Count',\n    description: 'Number of values in response',\n    emptyInputResult: 0,\n    standard: true,\n  },\n  {\n    id: ReducerID.range,\n    name: 'Range',\n    description: 'Difference between minimum and maximum values',\n    standard: true,\n  },\n  {\n    id: ReducerID.delta,\n    name: 'Delta',\n    description: 'Cumulative change in value',\n    standard: true,\n  },\n  {\n    id: ReducerID.step,\n    name: 'Step',\n    description: 'Minimum interval between values',\n    standard: true,\n  },\n  {\n    id: ReducerID.diff,\n    name: 'Difference',\n    description: 'Difference between first and last values',\n    standard: true,\n  },\n  {\n    id: ReducerID.logmin,\n    name: 'Min (above zero)',\n    description: 'Used for log min scale',\n    standard: true,\n  },\n  {\n    id: ReducerID.allIsZero,\n    name: 'All Zeros',\n    description: 'All values are zero',\n    emptyInputResult: false,\n    standard: true,\n  },\n  {\n    id: ReducerID.allIsNull,\n    name: 'All Nulls',\n    description: 'All values are null',\n    emptyInputResult: true,\n    standard: true,\n  },\n  {\n    id: ReducerID.changeCount,\n    name: 'Change Count',\n    description: 'Number of times the value changes',\n    standard: false,\n    reduce: calculateChangeCount,\n  },\n  {\n    id: ReducerID.distinctCount,\n    name: 'Distinct Count',\n    description: 'Number of distinct values',\n    standard: false,\n    reduce: calculateDistinctCount,\n  },\n  {\n    id: ReducerID.diffperc,\n    name: 'Difference percent',\n    description: 'Percentage difference between first and last values',\n    standard: true,\n  },\n  {\n    id: ReducerID.allValues,\n    name: 'All values',\n    description: 'Returns an array with all values',\n    standard: false,\n    reduce: (field: Field) => ({ allValues: field.values.toArray() }),\n  },\n  {\n    id: ReducerID.uniqueValues,\n    name: 'All unique values',\n    description: 'Returns an array with all unique values',\n    standard: false,\n    reduce: (field: Field) => ({\n      uniqueValues: [...new Set(field.values.toArray())],\n    }),\n  },\n]);\n\nexport function doStandardCalcs(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n  const calcs = {\n    sum: 0,\n    max: -Number.MAX_VALUE,\n    min: Number.MAX_VALUE,\n    logmin: Number.MAX_VALUE,\n    mean: null,\n    last: null,\n    first: null,\n    lastNotNull: null,\n    firstNotNull: null,\n    count: 0,\n    nonNullCount: 0,\n    allIsNull: true,\n    allIsZero: true,\n    range: null,\n    diff: null,\n    delta: 0,\n    step: Number.MAX_VALUE,\n    diffperc: 0,\n\n    // Just used for calculations -- not exposed as a stat\n    previousDeltaUp: true,\n  } as FieldCalcs;\n\n  const data = field.values;\n  calcs.count = data.length;\n\n  const isNumberField = field.type === FieldType.number || FieldType.time;\n\n  for (let i = 0; i < data.length; i++) {\n    let currentValue = data.get(i);\n\n    if (i === 0) {\n      calcs.first = currentValue;\n    }\n\n    calcs.last = currentValue;\n\n    if (currentValue === null) {\n      if (ignoreNulls) {\n        continue;\n      }\n      if (nullAsZero) {\n        currentValue = 0;\n      }\n    }\n\n    if (currentValue != null) {\n      // null || undefined\n      const isFirst = calcs.firstNotNull === null;\n      if (isFirst) {\n        calcs.firstNotNull = currentValue;\n      }\n\n      if (isNumberField) {\n        calcs.sum += currentValue;\n        calcs.allIsNull = false;\n        calcs.nonNullCount++;\n\n        if (!isFirst) {\n          const step = currentValue - calcs.lastNotNull!;\n          if (calcs.step > step) {\n            calcs.step = step; // the minimum interval\n          }\n\n          if (calcs.lastNotNull! > currentValue) {\n            // counter reset\n            calcs.previousDeltaUp = false;\n            if (i === data.length - 1) {\n              // reset on last\n              calcs.delta += currentValue;\n            }\n          } else {\n            if (calcs.previousDeltaUp) {\n              calcs.delta += step; // normal increment\n            } else {\n              calcs.delta += currentValue; // account for counter reset\n            }\n            calcs.previousDeltaUp = true;\n          }\n        }\n\n        if (currentValue > calcs.max) {\n          calcs.max = currentValue;\n        }\n\n        if (currentValue < calcs.min) {\n          calcs.min = currentValue;\n        }\n\n        if (currentValue < calcs.logmin && currentValue > 0) {\n          calcs.logmin = currentValue;\n        }\n      }\n\n      if (currentValue !== 0) {\n        calcs.allIsZero = false;\n      }\n\n      calcs.lastNotNull = currentValue;\n    }\n  }\n\n  if (calcs.max === -Number.MAX_VALUE) {\n    calcs.max = null;\n  }\n\n  if (calcs.min === Number.MAX_VALUE) {\n    calcs.min = null;\n  }\n\n  if (calcs.step === Number.MAX_VALUE) {\n    calcs.step = null;\n  }\n\n  if (calcs.nonNullCount > 0) {\n    calcs.mean = calcs.sum! / calcs.nonNullCount;\n  }\n\n  if (calcs.allIsNull) {\n    calcs.allIsZero = false;\n  }\n\n  if (calcs.max !== null && calcs.min !== null) {\n    calcs.range = calcs.max - calcs.min;\n  }\n\n  if (isNumber(calcs.firstNotNull) && isNumber(calcs.lastNotNull)) {\n    calcs.diff = calcs.lastNotNull - calcs.firstNotNull;\n  }\n\n  if (isNumber(calcs.firstNotNull) && isNumber(calcs.diff)) {\n    calcs.diffperc = calcs.diff / calcs.firstNotNull;\n  }\n  return calcs;\n}\n\nfunction calculateFirst(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n  return { first: field.values.get(0) };\n}\n\nfunction calculateFirstNotNull(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n  const data = field.values;\n  for (let idx = 0; idx < data.length; idx++) {\n    const v = data.get(idx);\n    if (v != null && v !== undefined) {\n      return { firstNotNull: v };\n    }\n  }\n  return { firstNotNull: null };\n}\n\nfunction calculateLast(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n  const data = field.values;\n  return { last: data.get(data.length - 1) };\n}\n\nfunction calculateLastNotNull(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n  const data = field.values;\n  let idx = data.length - 1;\n  while (idx >= 0) {\n    const v = data.get(idx--);\n    if (v != null && v !== undefined) {\n      return { lastNotNull: v };\n    }\n  }\n  return { lastNotNull: null };\n}\n\n/** Calculates standard deviation and variance */\nfunction calculateStdDev(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n  // Only support number fields\n  if (!(field.type === FieldType.number || field.type === FieldType.time)) {\n    return { variance: 0, stdDev: 0 };\n  }\n\n  let squareSum = 0;\n  let runningMean = 0;\n  let runningNonNullCount = 0;\n  const data = field.values;\n  for (let i = 0; i < data.length; i++) {\n    const currentValue = data.get(i);\n    if (currentValue != null) {\n      runningNonNullCount++;\n      let _oldMean = runningMean;\n      runningMean += (currentValue - _oldMean) / runningNonNullCount;\n      squareSum += (currentValue - _oldMean) * (currentValue - runningMean);\n    }\n  }\n  if (runningNonNullCount > 0) {\n    const variance = squareSum / runningNonNullCount;\n    return { variance, stdDev: Math.sqrt(variance) };\n  }\n  return { variance: 0, stdDev: 0 };\n}\n\nfunction calculateChangeCount(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n  const data = field.values;\n  let count = 0;\n  let first = true;\n  let last: any = null;\n  for (let i = 0; i < data.length; i++) {\n    let currentValue = data.get(i);\n    if (currentValue === null) {\n      if (ignoreNulls) {\n        continue;\n      }\n      if (nullAsZero) {\n        currentValue = 0;\n      }\n    }\n    if (!first && last !== currentValue) {\n      count++;\n    }\n    first = false;\n    last = currentValue;\n  }\n\n  return { changeCount: count };\n}\n\nfunction calculateDistinctCount(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n  const data = field.values;\n  const distinct = new Set<any>();\n  for (let i = 0; i < data.length; i++) {\n    let currentValue = data.get(i);\n    if (currentValue === null) {\n      if (ignoreNulls) {\n        continue;\n      }\n      if (nullAsZero) {\n        currentValue = 0;\n      }\n    }\n    distinct.add(currentValue);\n  }\n  return { distinctCount: distinct.size };\n}\n","import { Field, FieldType, DataFrame } from '../../types/dataFrame';\nimport { FieldMatcherInfo } from '../../types/transformations';\n\nimport { FieldMatcherID } from './ids';\n\n// General Field matcher\nconst fieldTypeMatcher: FieldMatcherInfo<FieldType> = {\n  id: FieldMatcherID.byType,\n  name: 'Field Type',\n  description: 'match based on the field type',\n  defaultOptions: FieldType.number,\n\n  get: (type: FieldType) => {\n    return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n      return type === field.type;\n    };\n  },\n\n  getOptionsDisplayText: (type: FieldType) => {\n    return `Field type: ${type}`;\n  },\n};\n\n// Numeric Field matcher\n// This gets its own entry so it shows up in the dropdown\nconst numericMatcher: FieldMatcherInfo = {\n  id: FieldMatcherID.numeric,\n  name: 'Numeric Fields',\n  description: 'Fields with type number',\n\n  get: () => {\n    return fieldTypeMatcher.get(FieldType.number);\n  },\n\n  getOptionsDisplayText: () => {\n    return 'Numeric Fields';\n  },\n};\n\n// Time Field matcher\nconst timeMatcher: FieldMatcherInfo = {\n  id: FieldMatcherID.time,\n  name: 'Time Fields',\n  description: 'Fields with type time',\n\n  get: () => {\n    return fieldTypeMatcher.get(FieldType.time);\n  },\n\n  getOptionsDisplayText: () => {\n    return 'Time Fields';\n  },\n};\n\n/**\n * Registry Initialization\n */\nexport function getFieldTypeMatchers(): FieldMatcherInfo[] {\n  return [fieldTypeMatcher, numericMatcher, timeMatcher];\n}\n","// This needs to be in its own file to avoid circular references\n\n// Builtin Predicates\n// not using 'any' and 'never' since they are reserved keywords\nexport enum MatcherID {\n  anyMatch = 'anyMatch', // checks children\n  allMatch = 'allMatch', // checks children\n  invertMatch = 'invertMatch', // checks child\n  alwaysMatch = 'alwaysMatch',\n  neverMatch = 'neverMatch',\n}\n\nexport enum FieldMatcherID {\n  // Specific Types\n  numeric = 'numeric',\n  time = 'time', // Can be multiple times\n  first = 'first',\n  firstTimeField = 'firstTimeField', // Only the first fime field\n\n  // With arguments\n  byType = 'byType',\n  byName = 'byName',\n  byNames = 'byNames',\n  byRegexp = 'byRegexp',\n  byRegexpOrNames = 'byRegexpOrNames',\n  byFrameRefID = 'byFrameRefID',\n  // byIndex = 'byIndex',\n  // byLabel = 'byLabel',\n}\n\n/**\n * Field name matchers\n */\nexport enum FrameMatcherID {\n  byName = 'byName',\n  byRefId = 'byRefId',\n  byIndex = 'byIndex',\n  byLabel = 'byLabel',\n}\n\n/**\n * @public\n */\nexport enum ValueMatcherID {\n  regex = 'regex',\n  isNull = 'isNull',\n  isNotNull = 'isNotNull',\n  greater = 'greater',\n  greaterOrEqual = 'greaterOrEqual',\n  lower = 'lower',\n  lowerOrEqual = 'lowerOrEqual',\n  equal = 'equal',\n  notEqual = 'notEqual',\n  between = 'between',\n}\n","import { Field, DataFrame, FieldType } from '../../types/dataFrame';\nimport { FieldMatcherInfo, MatcherConfig, FrameMatcherInfo } from '../../types/transformations';\nimport { getFieldMatcher, fieldMatchers, getFrameMatchers, frameMatchers } from '../matchers';\n\nimport { MatcherID } from './ids';\n\nconst anyFieldMatcher: FieldMatcherInfo<MatcherConfig[]> = {\n  id: MatcherID.anyMatch,\n  name: 'Any',\n  description: 'Any child matches (OR)',\n  excludeFromPicker: true,\n  defaultOptions: [], // empty array\n\n  get: (options: MatcherConfig[]) => {\n    const children = options.map((option) => {\n      return getFieldMatcher(option);\n    });\n    return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n      for (const child of children) {\n        if (child(field, frame, allFrames)) {\n          return true;\n        }\n      }\n      return false;\n    };\n  },\n\n  getOptionsDisplayText: (options: MatcherConfig[]) => {\n    let text = '';\n    for (const sub of options) {\n      if (text.length > 0) {\n        text += ' OR ';\n      }\n      const matcher = fieldMatchers.get(sub.id);\n      text += matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(sub) : matcher.name;\n    }\n    return text;\n  },\n};\n\nconst anyFrameMatcher: FrameMatcherInfo<MatcherConfig[]> = {\n  id: MatcherID.anyMatch,\n  name: 'Any',\n  description: 'Any child matches (OR)',\n  excludeFromPicker: true,\n  defaultOptions: [], // empty array\n\n  get: (options: MatcherConfig[]) => {\n    const children = options.map((option) => {\n      return getFrameMatchers(option);\n    });\n    return (frame: DataFrame) => {\n      for (const child of children) {\n        if (child(frame)) {\n          return true;\n        }\n      }\n      return false;\n    };\n  },\n\n  getOptionsDisplayText: (options: MatcherConfig[]) => {\n    let text = '';\n    for (const sub of options) {\n      if (text.length > 0) {\n        text += ' OR ';\n      }\n      const matcher = frameMatchers.get(sub.id);\n      text += matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(sub) : matcher.name;\n    }\n    return text;\n  },\n};\n\nconst allFieldsMatcher: FieldMatcherInfo<MatcherConfig[]> = {\n  id: MatcherID.allMatch,\n  name: 'All',\n  description: 'Everything matches (AND)',\n  excludeFromPicker: true,\n  defaultOptions: [], // empty array\n\n  get: (options: MatcherConfig[]) => {\n    const children = options.map((option) => {\n      return getFieldMatcher(option);\n    });\n    return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n      for (const child of children) {\n        if (!child(field, frame, allFrames)) {\n          return false;\n        }\n      }\n      return true;\n    };\n  },\n\n  getOptionsDisplayText: (options: MatcherConfig[]) => {\n    let text = '';\n    for (const sub of options) {\n      if (text.length > 0) {\n        text += ' AND ';\n      }\n      const matcher = fieldMatchers.get(sub.id); // Ugho what about frame\n      text += matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(sub) : matcher.name;\n    }\n    return text;\n  },\n};\n\nconst allFramesMatcher: FrameMatcherInfo<MatcherConfig[]> = {\n  id: MatcherID.allMatch,\n  name: 'All',\n  description: 'Everything matches (AND)',\n  excludeFromPicker: true,\n  defaultOptions: [], // empty array\n\n  get: (options: MatcherConfig[]) => {\n    const children = options.map((option) => {\n      return getFrameMatchers(option);\n    });\n    return (frame: DataFrame) => {\n      for (const child of children) {\n        if (!child(frame)) {\n          return false;\n        }\n      }\n      return true;\n    };\n  },\n\n  getOptionsDisplayText: (options: MatcherConfig[]) => {\n    let text = '';\n    for (const sub of options) {\n      if (text.length > 0) {\n        text += ' AND ';\n      }\n      const matcher = frameMatchers.get(sub.id);\n      text += matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(sub) : matcher.name;\n    }\n    return text;\n  },\n};\n\nconst notFieldMatcher: FieldMatcherInfo<MatcherConfig> = {\n  id: MatcherID.invertMatch,\n  name: 'NOT',\n  description: 'Inverts other matchers',\n  excludeFromPicker: true,\n\n  get: (option: MatcherConfig) => {\n    const check = getFieldMatcher(option);\n    return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n      return !check(field, frame, allFrames);\n    };\n  },\n\n  getOptionsDisplayText: (options: MatcherConfig) => {\n    const matcher = fieldMatchers.get(options.id);\n    const text = matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(options.options) : matcher.name;\n    return 'NOT ' + text;\n  },\n};\n\nconst notFrameMatcher: FrameMatcherInfo<MatcherConfig> = {\n  id: MatcherID.invertMatch,\n  name: 'NOT',\n  description: 'Inverts other matchers',\n  excludeFromPicker: true,\n\n  get: (option: MatcherConfig) => {\n    const check = getFrameMatchers(option);\n    return (frame: DataFrame) => {\n      return !check(frame);\n    };\n  },\n\n  getOptionsDisplayText: (options: MatcherConfig) => {\n    const matcher = frameMatchers.get(options.id);\n    const text = matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(options.options) : matcher.name;\n    return 'NOT ' + text;\n  },\n};\n\nexport const alwaysFieldMatcher = (field: Field) => {\n  return true;\n};\n\nexport const alwaysFrameMatcher = (frame: DataFrame) => {\n  return true;\n};\n\nexport const neverFieldMatcher = (field: Field) => {\n  return false;\n};\n\nexport const notTimeFieldMatcher = (field: Field) => {\n  return field.type !== FieldType.time;\n};\n\nexport const neverFrameMatcher = (frame: DataFrame) => {\n  return false;\n};\n\nconst alwaysFieldMatcherInfo: FieldMatcherInfo = {\n  id: MatcherID.alwaysMatch,\n  name: 'All Fields',\n  description: 'Always Match',\n\n  get: (option: any) => {\n    return alwaysFieldMatcher;\n  },\n\n  getOptionsDisplayText: (options: any) => {\n    return 'Always';\n  },\n};\n\nconst alwaysFrameMatcherInfo: FrameMatcherInfo = {\n  id: MatcherID.alwaysMatch,\n  name: 'All Frames',\n  description: 'Always Match',\n\n  get: (option: any) => {\n    return alwaysFrameMatcher;\n  },\n\n  getOptionsDisplayText: (options: any) => {\n    return 'Always';\n  },\n};\n\nconst neverFieldMatcherInfo: FieldMatcherInfo = {\n  id: MatcherID.neverMatch,\n  name: 'No Fields',\n  description: 'Never Match',\n  excludeFromPicker: true,\n\n  get: (option: any) => {\n    return neverFieldMatcher;\n  },\n\n  getOptionsDisplayText: (options: any) => {\n    return 'Never';\n  },\n};\n\nconst neverFrameMatcherInfo: FrameMatcherInfo = {\n  id: MatcherID.neverMatch,\n  name: 'No Frames',\n  description: 'Never Match',\n\n  get: (option: any) => {\n    return neverFrameMatcher;\n  },\n\n  getOptionsDisplayText: (options: any) => {\n    return 'Never';\n  },\n};\n\nexport function getFieldPredicateMatchers(): FieldMatcherInfo[] {\n  return [anyFieldMatcher, allFieldsMatcher, notFieldMatcher, alwaysFieldMatcherInfo, neverFieldMatcherInfo];\n}\n\nexport function getFramePredicateMatchers(): FrameMatcherInfo[] {\n  return [anyFrameMatcher, allFramesMatcher, notFrameMatcher, alwaysFrameMatcherInfo, neverFrameMatcherInfo];\n}\n","import { stringToJsRegex } from '../../text';\nimport { DataFrame } from '../../types/dataFrame';\nimport { FrameMatcherInfo } from '../../types/transformations';\n\nimport { FrameMatcherID } from './ids';\n\n// General Field matcher\nconst refIdMacher: FrameMatcherInfo<string> = {\n  id: FrameMatcherID.byRefId,\n  name: 'Query refId',\n  description: 'match the refId',\n  defaultOptions: 'A',\n\n  get: (pattern: string) => {\n    const regex = stringToJsRegex(pattern);\n    return (frame: DataFrame) => {\n      return regex.test(frame.refId || '');\n    };\n  },\n\n  getOptionsDisplayText: (pattern: string) => {\n    return `RefID: ${pattern}`;\n  },\n};\n\nexport function getRefIdMatchers(): FrameMatcherInfo[] {\n  return [refIdMacher];\n}\n","import { Field, FieldType, DataFrame } from '../../types/dataFrame';\nimport { FieldMatcherInfo } from '../../types/transformations';\n\nimport { FieldMatcherID } from './ids';\n\nconst firstFieldMatcher: FieldMatcherInfo = {\n  id: FieldMatcherID.first,\n  name: 'First Field',\n  description: 'The first field in the frame',\n\n  get: (type: FieldType) => {\n    return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n      return field === frame.fields[0];\n    };\n  },\n\n  getOptionsDisplayText: () => {\n    return `First field`;\n  },\n};\n\nconst firstTimeFieldMatcher: FieldMatcherInfo = {\n  id: FieldMatcherID.firstTimeField,\n  name: 'First time field',\n  description: 'The first field of type time in a frame',\n\n  get: (type: FieldType) => {\n    return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n      return field.type === FieldType.time && field === frame.fields.find((f) => f.type === FieldType.time);\n    };\n  },\n\n  getOptionsDisplayText: () => {\n    return `First time field`;\n  },\n};\n\n/**\n * Registry Initialization\n */\nexport function getSimpleFieldMatchers(): FieldMatcherInfo[] {\n  return [firstFieldMatcher, firstTimeFieldMatcher];\n}\n","import { Field } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\n\nimport { BasicValueMatcherOptions } from './types';\n\nconst isEqualValueMatcher: ValueMatcherInfo<BasicValueMatcherOptions> = {\n  id: ValueMatcherID.equal,\n  name: 'Is equal',\n  description: 'Match where value for given field is equal to options value.',\n  get: (options) => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values.get(valueIndex);\n      // eslint-disable-next-line eqeqeq\n      return value == options.value;\n    };\n  },\n  getOptionsDisplayText: () => {\n    return `Matches all rows where field is null.`;\n  },\n  isApplicable: () => true,\n  getDefaultOptions: () => ({ value: '' }),\n};\n\nconst isNotEqualValueMatcher: ValueMatcherInfo<BasicValueMatcherOptions> = {\n  id: ValueMatcherID.notEqual,\n  name: 'Is not equal',\n  description: 'Match where value for given field is not equal to options value.',\n  get: (options) => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values.get(valueIndex);\n      // eslint-disable-next-line eqeqeq\n      return value != options.value;\n    };\n  },\n  getOptionsDisplayText: () => {\n    return `Matches all rows where field is not null.`;\n  },\n  isApplicable: () => true,\n  getDefaultOptions: () => ({ value: '' }),\n};\n\nexport const getEqualValueMatchers = (): ValueMatcherInfo[] => [isEqualValueMatcher, isNotEqualValueMatcher];\n","import { Field } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\n\nimport { ValueMatcherOptions } from './types';\n\nconst isNullValueMatcher: ValueMatcherInfo<ValueMatcherOptions> = {\n  id: ValueMatcherID.isNull,\n  name: 'Is null',\n  description: 'Match where value for given field is null.',\n  get: () => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values.get(valueIndex);\n      return value == null;\n    };\n  },\n  getOptionsDisplayText: () => {\n    return `Matches all rows where field is null.`;\n  },\n  isApplicable: () => true,\n  getDefaultOptions: () => ({}),\n};\n\nconst isNotNullValueMatcher: ValueMatcherInfo<ValueMatcherOptions> = {\n  id: ValueMatcherID.isNotNull,\n  name: 'Is not null',\n  description: 'Match where value for given field is not null.',\n  get: () => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values.get(valueIndex);\n      return value != null;\n    };\n  },\n  getOptionsDisplayText: () => {\n    return `Matches all rows where field is not null.`;\n  },\n  isApplicable: () => true,\n  getDefaultOptions: () => ({}),\n};\n\nexport const getNullValueMatchers = (): ValueMatcherInfo[] => [isNullValueMatcher, isNotNullValueMatcher];\n","import { Field, FieldType } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\n\nimport { BasicValueMatcherOptions } from './types';\n\nconst isGreaterValueMatcher: ValueMatcherInfo<BasicValueMatcherOptions<number>> = {\n  id: ValueMatcherID.greater,\n  name: 'Is greater',\n  description: 'Match when field value is greater than option.',\n  get: (options) => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values.get(valueIndex);\n      if (isNaN(value)) {\n        return false;\n      }\n      return value > options.value;\n    };\n  },\n  getOptionsDisplayText: (options) => {\n    return `Matches all rows where field value is greater than: ${options.value}.`;\n  },\n  isApplicable: (field) => field.type === FieldType.number,\n  getDefaultOptions: () => ({ value: 0 }),\n};\n\nconst isGreaterOrEqualValueMatcher: ValueMatcherInfo<BasicValueMatcherOptions<number>> = {\n  id: ValueMatcherID.greaterOrEqual,\n  name: 'Is greater or equal',\n  description: 'Match when field value is greater than or equal to option.',\n  get: (options) => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values.get(valueIndex);\n      if (isNaN(value)) {\n        return false;\n      }\n      return value >= options.value;\n    };\n  },\n  getOptionsDisplayText: (options) => {\n    return `Matches all rows where field value is greater than or equal to: ${options.value}.`;\n  },\n  isApplicable: (field) => field.type === FieldType.number,\n  getDefaultOptions: () => ({ value: 0 }),\n};\n\nconst isLowerValueMatcher: ValueMatcherInfo<BasicValueMatcherOptions<number>> = {\n  id: ValueMatcherID.lower,\n  name: 'Is lower',\n  description: 'Match when field value is lower than option.',\n  get: (options) => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values.get(valueIndex);\n      if (isNaN(value)) {\n        return false;\n      }\n      return value < options.value;\n    };\n  },\n  getOptionsDisplayText: (options) => {\n    return `Matches all rows where field value is lower than: ${options.value}.`;\n  },\n  isApplicable: (field) => field.type === FieldType.number,\n  getDefaultOptions: () => ({ value: 0 }),\n};\n\nconst isLowerOrEqualValueMatcher: ValueMatcherInfo<BasicValueMatcherOptions<number>> = {\n  id: ValueMatcherID.lowerOrEqual,\n  name: 'Is lower or equal',\n  description: 'Match when field value is lower or equal than option.',\n  get: (options) => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values.get(valueIndex);\n      if (isNaN(value)) {\n        return false;\n      }\n      return value <= options.value;\n    };\n  },\n  getOptionsDisplayText: (options) => {\n    return `Matches all rows where field value is lower or equal than: ${options.value}.`;\n  },\n  isApplicable: (field) => field.type === FieldType.number,\n  getDefaultOptions: () => ({ value: 0 }),\n};\n\nexport const getNumericValueMatchers = (): ValueMatcherInfo[] => [\n  isGreaterValueMatcher,\n  isGreaterOrEqualValueMatcher,\n  isLowerValueMatcher,\n  isLowerOrEqualValueMatcher,\n];\n","import { Field, FieldType } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\n\nimport { RangeValueMatcherOptions } from './types';\n\nconst isBetweenValueMatcher: ValueMatcherInfo<RangeValueMatcherOptions<number>> = {\n  id: ValueMatcherID.between,\n  name: 'Is between',\n  description: 'Match when field value is between given option values.',\n  get: (options) => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values.get(valueIndex);\n      if (isNaN(value)) {\n        return false;\n      }\n      return value > options.from && value < options.to;\n    };\n  },\n  getOptionsDisplayText: (options) => {\n    return `Matches all rows where field value is between ${options.from} and ${options.to}.`;\n  },\n  isApplicable: (field) => field.type === FieldType.number,\n  getDefaultOptions: () => ({ from: 0, to: 100 }),\n};\n\nexport const getRangeValueMatchers = (): ValueMatcherInfo[] => [isBetweenValueMatcher];\n","import { Field } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\n\nimport { BasicValueMatcherOptions } from './types';\n\nconst regexValueMatcher: ValueMatcherInfo<BasicValueMatcherOptions<string>> = {\n  id: ValueMatcherID.regex,\n  name: 'Regex',\n  description: 'Match when field value is matching regex.',\n  get: (options) => {\n    const regex = new RegExp(options.value);\n\n    return (valueIndex: number, field: Field) => {\n      const value = field.values.get(valueIndex);\n      return regex.test(value);\n    };\n  },\n  getOptionsDisplayText: (options) => {\n    return `Matches all rows where field value is matching regex: ${options.value}`;\n  },\n  isApplicable: () => true,\n  getDefaultOptions: () => ({ value: '.*' }),\n};\n\nexport const getRegexValueMatcher = (): ValueMatcherInfo[] => [regexValueMatcher];\n","import { map } from 'rxjs/operators';\n\nimport { getTimeField } from '../../dataframe/processDataFrame';\nimport { DataFrame } from '../../types/dataFrame';\nimport { SynchronousDataTransformerInfo } from '../../types/transformations';\n\nimport { DataTransformerID } from './ids';\nimport { seriesToColumnsTransformer } from './seriesToColumns';\n\nexport const ensureColumnsTransformer: SynchronousDataTransformerInfo = {\n  id: DataTransformerID.ensureColumns,\n  name: 'Ensure Columns Transformer',\n  description: 'Will check if current data frames is series or columns. If in series it will convert to columns.',\n\n  operator: (options) => (source) => source.pipe(map((data) => ensureColumnsTransformer.transformer(options)(data))),\n\n  transformer: (options: any) => (frames: DataFrame[]) => {\n    // Assume timeseries should first be joined by time\n    const timeFieldName = findConsistentTimeFieldName(frames);\n\n    if (frames.length > 1 && timeFieldName) {\n      return seriesToColumnsTransformer.transformer({\n        byField: timeFieldName,\n      })(frames);\n    }\n    return frames;\n  },\n};\n\n/**\n * Find the name for the time field used in all frames (if one exists)\n */\nfunction findConsistentTimeFieldName(data: DataFrame[]): string | undefined {\n  let name: string | undefined = undefined;\n  for (const frame of data) {\n    const { timeField } = getTimeField(frame);\n    if (!timeField) {\n      return undefined; // Not timeseries\n    }\n    if (!name) {\n      name = timeField.name;\n    } else if (name !== timeField.name) {\n      // Second frame has a different time column?!\n      return undefined;\n    }\n  }\n  return name;\n}\n","import { map } from 'rxjs/operators';\n\nimport { DataFrame, Field } from '../../types/dataFrame';\nimport { DataTransformerInfo, MatcherConfig } from '../../types/transformations';\nimport { getFieldMatcher, getFrameMatchers } from '../matchers';\n\nimport { DataTransformerID } from './ids';\nimport { noopTransformer } from './noop';\n\nexport interface FilterOptions {\n  include?: MatcherConfig;\n  exclude?: MatcherConfig;\n}\n\nexport const filterFieldsTransformer: DataTransformerInfo<FilterOptions> = {\n  id: DataTransformerID.filterFields,\n  name: 'Filter Fields',\n  description: 'select a subset of fields',\n  defaultOptions: {},\n\n  /**\n   * Return a modified copy of the series.  If the transform is not or should not\n   * be applied, just return the input series\n   */\n  operator: (options: FilterOptions) => (source) => {\n    if (!options.include && !options.exclude) {\n      return source.pipe(noopTransformer.operator({}));\n    }\n\n    return source.pipe(\n      map((data) => {\n        const include = options.include ? getFieldMatcher(options.include) : null;\n        const exclude = options.exclude ? getFieldMatcher(options.exclude) : null;\n\n        const processed: DataFrame[] = [];\n        for (const series of data) {\n          // Find the matching field indexes\n          const fields: Field[] = [];\n          for (let i = 0; i < series.fields.length; i++) {\n            const field = series.fields[i];\n\n            if (exclude) {\n              if (exclude(field, series, data)) {\n                continue;\n              }\n              if (!include) {\n                fields.push(field);\n              }\n            }\n            if (include && include(field, series, data)) {\n              fields.push(field);\n            }\n          }\n\n          if (!fields.length) {\n            continue;\n          }\n          const copy = {\n            ...series, // all the other properties\n            fields, // but a different set of fields\n          };\n          processed.push(copy);\n        }\n        return processed;\n      })\n    );\n  },\n};\n\nexport const filterFramesTransformer: DataTransformerInfo<FilterOptions> = {\n  id: DataTransformerID.filterFrames,\n  name: 'Filter Frames',\n  description: 'select a subset of frames',\n  defaultOptions: {},\n\n  /**\n   * Return a modified copy of the series.  If the transform is not or should not\n   * be applied, just return the input series\n   */\n  operator: (options) => (source) => {\n    if (!options.include && !options.exclude) {\n      return source.pipe(noopTransformer.operator({}));\n    }\n\n    return source.pipe(\n      map((data) => {\n        const include = options.include ? getFrameMatchers(options.include) : null;\n        const exclude = options.exclude ? getFrameMatchers(options.exclude) : null;\n\n        const processed: DataFrame[] = [];\n        for (const series of data) {\n          if (exclude) {\n            if (exclude(series)) {\n              continue;\n            }\n            if (!include) {\n              processed.push(series);\n            }\n          }\n          if (include && include(series)) {\n            processed.push(series);\n          }\n        }\n        return processed;\n      })\n    );\n  },\n};\n","import { DataTransformerInfo, MatcherConfig } from '../../types/transformations';\nimport { FieldMatcherID } from '../matchers/ids';\nimport { RegexpOrNamesMatcherOptions } from '../matchers/nameMatcher';\n\nimport { filterFieldsTransformer } from './filter';\nimport { DataTransformerID } from './ids';\n\nexport interface FilterFieldsByNameTransformerOptions {\n  include?: RegexpOrNamesMatcherOptions;\n  exclude?: RegexpOrNamesMatcherOptions;\n}\n\nexport const filterFieldsByNameTransformer: DataTransformerInfo<FilterFieldsByNameTransformerOptions> = {\n  id: DataTransformerID.filterFieldsByName,\n  name: 'Filter fields by name',\n  description: 'select a subset of fields',\n  defaultOptions: {},\n\n  /**\n   * Return a modified copy of the series.  If the transform is not or should not\n   * be applied, just return the input series\n   */\n  operator: (options) => (source) =>\n    source.pipe(\n      filterFieldsTransformer.operator({\n        include: getMatcherConfig(options.include),\n        exclude: getMatcherConfig(options.exclude),\n      })\n    ),\n};\n\nconst getMatcherConfig = (options?: RegexpOrNamesMatcherOptions): MatcherConfig | undefined => {\n  if (!options) {\n    return undefined;\n  }\n\n  const { names, pattern } = options;\n\n  if ((!Array.isArray(names) || names.length === 0) && !pattern) {\n    return undefined;\n  }\n\n  if (!pattern) {\n    return { id: FieldMatcherID.byNames, options: { names } };\n  }\n\n  if (!Array.isArray(names) || names.length === 0) {\n    return { id: FieldMatcherID.byRegexp, options: pattern };\n  }\n\n  return { id: FieldMatcherID.byRegexpOrNames, options };\n};\n","import { DataTransformerInfo } from '../../types/transformations';\nimport { FrameMatcherID } from '../matchers/ids';\n\nimport { filterFramesTransformer, FilterOptions } from './filter';\nimport { DataTransformerID } from './ids';\n\nexport interface FilterFramesByRefIdTransformerOptions {\n  include?: string;\n  exclude?: string;\n}\n\nexport const filterFramesByRefIdTransformer: DataTransformerInfo<FilterFramesByRefIdTransformerOptions> = {\n  id: DataTransformerID.filterByRefId,\n  name: 'Filter data by query refId',\n  description: 'select a subset of results',\n  defaultOptions: {},\n\n  /**\n   * Return a modified copy of the series.  If the transform is not or should not\n   * be applied, just return the input series\n   */\n  operator: (options) => (source) => {\n    const filterOptions: FilterOptions = {};\n    if (options.include) {\n      filterOptions.include = {\n        id: FrameMatcherID.byRefId,\n        options: options.include,\n      };\n    }\n    if (options.exclude) {\n      filterOptions.exclude = {\n        id: FrameMatcherID.byRefId,\n        options: options.exclude,\n      };\n    }\n\n    return source.pipe(filterFramesTransformer.operator(filterOptions));\n  },\n};\n","export enum DataTransformerID {\n  // join = 'join', // Pick a field and merge all series based on that field\n  append = 'append',\n  //  rotate = 'rotate', // Columns to rows\n  reduce = 'reduce',\n  order = 'order',\n  organize = 'organize',\n  rename = 'rename',\n  calculateField = 'calculateField',\n  seriesToColumns = 'seriesToColumns',\n  seriesToRows = 'seriesToRows',\n  merge = 'merge',\n  concatenate = 'concatenate',\n  labelsToFields = 'labelsToFields',\n  filterFields = 'filterFields',\n  filterFieldsByName = 'filterFieldsByName',\n  filterFrames = 'filterFrames',\n  filterByRefId = 'filterByRefId',\n  renameByRegex = 'renameByRegex',\n  filterByValue = 'filterByValue',\n  noop = 'noop',\n  ensureColumns = 'ensureColumns',\n  groupBy = 'groupBy',\n  sortBy = 'sortBy',\n  histogram = 'histogram',\n  configFromData = 'configFromData',\n  rowsToFields = 'rowsToFields',\n  prepareTimeSeries = 'prepareTimeSeries',\n  convertFieldType = 'convertFieldType',\n  fieldLookup = 'fieldLookup',\n  heatmap = 'heatmap',\n  spatial = 'spatial',\n  joinByLabels = 'joinByLabels',\n  extractFields = 'extractFields',\n  groupingToMatrix = 'groupingToMatrix',\n  limit = 'limit',\n}\n","import { map } from 'rxjs/operators';\n\nimport { DataTransformerInfo } from '../../types';\nimport { ArrayVector } from '../../vector/ArrayVector';\n\nimport { DataTransformerID } from './ids';\n\nexport interface LimitTransformerOptions {\n  limitField?: number;\n}\n\nconst DEFAULT_LIMIT_FIELD = 10;\n\nexport const limitTransformer: DataTransformerInfo<LimitTransformerOptions> = {\n  id: DataTransformerID.limit,\n  name: 'Limit',\n  description: 'Limit the number of items to the top N',\n  defaultOptions: {\n    limitField: DEFAULT_LIMIT_FIELD,\n  },\n\n  operator: (options) => (source) =>\n    source.pipe(\n      map((data) => {\n        const limitFieldMatch = options.limitField || DEFAULT_LIMIT_FIELD;\n        return data.map((frame) => {\n          if (frame.length > limitFieldMatch) {\n            return {\n              ...frame,\n              fields: frame.fields.map((f) => {\n                const vals = f.values.toArray();\n                return {\n                  ...f,\n                  values: new ArrayVector(vals.slice(0, limitFieldMatch)),\n                };\n              }),\n              length: limitFieldMatch,\n            };\n          }\n\n          return frame;\n        });\n      })\n    ),\n};\n","import { omit } from 'lodash';\nimport { map } from 'rxjs/operators';\n\nimport { MutableDataFrame } from '../../dataframe';\nimport { DataFrame, Field } from '../../types/dataFrame';\nimport { DataTransformerInfo } from '../../types/transformations';\nimport { ArrayVector } from '../../vector/ArrayVector';\n\nimport { DataTransformerID } from './ids';\n\ninterface ValuePointer {\n  key: string;\n  index: number;\n}\n\nexport interface MergeTransformerOptions {}\n\nexport const mergeTransformer: DataTransformerInfo<MergeTransformerOptions> = {\n  id: DataTransformerID.merge,\n  name: 'Merge series/tables',\n  description: 'Merges multiple series/tables into a single serie/table',\n  defaultOptions: {},\n  operator: (options) => (source) =>\n    source.pipe(\n      map((dataFrames) => {\n        if (!Array.isArray(dataFrames) || dataFrames.length <= 1) {\n          return dataFrames;\n        }\n\n        const data = dataFrames.filter((frame) => frame.fields.length > 0);\n\n        if (data.length === 0) {\n          return [dataFrames[0]];\n        }\n\n        const fieldNames = new Set<string>();\n        const fieldIndexByName: Record<string, Record<number, number>> = {};\n        const fieldNamesForKey: string[] = [];\n        const dataFrame = new MutableDataFrame();\n\n        for (let frameIndex = 0; frameIndex < data.length; frameIndex++) {\n          const frame = data[frameIndex];\n\n          for (let fieldIndex = 0; fieldIndex < frame.fields.length; fieldIndex++) {\n            const field = frame.fields[fieldIndex];\n\n            if (!fieldNames.has(field.name)) {\n              dataFrame.addField(copyFieldStructure(field));\n              fieldNames.add(field.name);\n            }\n\n            fieldIndexByName[field.name] = fieldIndexByName[field.name] || {};\n            fieldIndexByName[field.name][frameIndex] = fieldIndex;\n\n            if (data.length - 1 !== frameIndex) {\n              continue;\n            }\n\n            if (fieldExistsInAllFrames(fieldIndexByName, field, data)) {\n              fieldNamesForKey.push(field.name);\n            }\n          }\n        }\n\n        if (fieldNamesForKey.length === 0) {\n          return dataFrames;\n        }\n\n        const valuesByKey: Record<string, Array<Record<string, any>>> = {};\n        const valuesInOrder: ValuePointer[] = [];\n        const keyFactory = createKeyFactory(data, fieldIndexByName, fieldNamesForKey);\n        const valueMapper = createValueMapper(data, fieldNames, fieldIndexByName);\n\n        for (let frameIndex = 0; frameIndex < data.length; frameIndex++) {\n          const frame = data[frameIndex];\n\n          for (let valueIndex = 0; valueIndex < frame.length; valueIndex++) {\n            const key = keyFactory(frameIndex, valueIndex);\n            const value = valueMapper(frameIndex, valueIndex);\n\n            if (!Array.isArray(valuesByKey[key])) {\n              valuesByKey[key] = [value];\n              valuesInOrder.push(createPointer(key, valuesByKey));\n              continue;\n            }\n\n            let valueWasMerged = false;\n\n            valuesByKey[key] = valuesByKey[key].map((existing) => {\n              if (!isMergable(existing, value)) {\n                return existing;\n              }\n              valueWasMerged = true;\n              return { ...existing, ...value };\n            });\n\n            if (!valueWasMerged) {\n              valuesByKey[key].push(value);\n              valuesInOrder.push(createPointer(key, valuesByKey));\n            }\n          }\n        }\n\n        for (const pointer of valuesInOrder) {\n          const value = valuesByKey[pointer.key][pointer.index];\n\n          if (value) {\n            dataFrame.add(value);\n          }\n        }\n\n        return [dataFrame];\n      })\n    ),\n};\n\nconst copyFieldStructure = (field: Field): Field => {\n  return {\n    ...omit(field, ['values', 'state', 'labels', 'config']),\n    values: new ArrayVector(),\n    config: {\n      ...omit(field.config, 'displayName'),\n    },\n  };\n};\n\nconst createKeyFactory = (\n  data: DataFrame[],\n  fieldPointerByName: Record<string, Record<string, number>>,\n  keyFieldNames: string[]\n) => {\n  const factoryIndex = keyFieldNames.reduce((index: Record<string, number[]>, fieldName) => {\n    return Object.keys(fieldPointerByName[fieldName]).reduce((index: Record<string, number[]>, frameIndex) => {\n      index[frameIndex] = index[frameIndex] || [];\n      index[frameIndex].push(fieldPointerByName[fieldName][frameIndex]);\n      return index;\n    }, index);\n  }, {});\n\n  return (frameIndex: number, valueIndex: number): string => {\n    return factoryIndex[frameIndex].reduce((key: string, fieldIndex: number) => {\n      return key + data[frameIndex].fields[fieldIndex].values.get(valueIndex);\n    }, '');\n  };\n};\n\nconst createValueMapper = (\n  data: DataFrame[],\n  fieldByName: Set<string>,\n  fieldIndexByName: Record<string, Record<number, number>>\n) => {\n  return (frameIndex: number, valueIndex: number) => {\n    const value: Record<string, any> = {};\n    const fieldNames = Array.from(fieldByName);\n\n    for (const fieldName of fieldNames) {\n      const fieldIndexByFrameIndex = fieldIndexByName[fieldName];\n      if (!fieldIndexByFrameIndex) {\n        continue;\n      }\n\n      const fieldIndex = fieldIndexByFrameIndex[frameIndex];\n      if (typeof fieldIndex !== 'number') {\n        continue;\n      }\n\n      const frame = data[frameIndex];\n      if (!frame || !frame.fields) {\n        continue;\n      }\n\n      const field = frame.fields[fieldIndex];\n      if (!field || !field.values) {\n        continue;\n      }\n\n      value[fieldName] = field.values.get(valueIndex);\n    }\n\n    return value;\n  };\n};\n\nconst isMergable = (existing: Record<string, any>, value: Record<string, any>): boolean => {\n  let mergable = true;\n\n  for (const prop in value) {\n    if (typeof existing[prop] === 'undefined') {\n      continue;\n    }\n\n    if (existing[prop] === null) {\n      continue;\n    }\n\n    if (existing[prop] !== value[prop]) {\n      mergable = false;\n      break;\n    }\n  }\n\n  return mergable;\n};\n\nconst fieldExistsInAllFrames = (\n  fieldIndexByName: Record<string, Record<number, number>>,\n  field: Field,\n  data: DataFrame[]\n) => {\n  return Object.keys(fieldIndexByName[field.name]).length === data.length;\n};\n\nconst createPointer = (key: string, valuesByKey: Record<string, Array<Record<string, any>>>): ValuePointer => {\n  return {\n    key,\n    index: valuesByKey[key].length - 1,\n  };\n};\n","import { DataTransformerInfo } from '../../types/transformations';\n\nimport { DataTransformerID } from './ids';\n\nexport interface NoopTransformerOptions {\n  include?: string;\n  exclude?: string;\n}\n\nexport const noopTransformer: DataTransformerInfo<NoopTransformerOptions> = {\n  id: DataTransformerID.noop,\n  name: 'noop',\n  description: 'No-operation transformer',\n  defaultOptions: {},\n\n  /**\n   * Return a modified copy of the series.  If the transform is not or should not\n   * be applied, just return the input series\n   */\n  operator: (options: NoopTransformerOptions) => (source) => source,\n};\n","import { DataTransformerInfo } from '../../types/transformations';\n\nimport { filterFieldsByNameTransformer } from './filterByName';\nimport { DataTransformerID } from './ids';\nimport { orderFieldsTransformer, OrderFieldsTransformerOptions } from './order';\nimport { renameFieldsTransformer, RenameFieldsTransformerOptions } from './rename';\n\nexport interface OrganizeFieldsTransformerOptions\n  extends OrderFieldsTransformerOptions,\n    RenameFieldsTransformerOptions {\n  excludeByName: Record<string, boolean>;\n}\n\nexport const organizeFieldsTransformer: DataTransformerInfo<OrganizeFieldsTransformerOptions> = {\n  id: DataTransformerID.organize,\n  name: 'Organize fields by name',\n  description: 'Order, filter and rename fields based on configuration given by user',\n  defaultOptions: {\n    excludeByName: {},\n    indexByName: {},\n    renameByName: {},\n  },\n\n  /**\n   * Return a modified copy of the series.  If the transform is not or should not\n   * be applied, just return the input series\n   */\n  operator: (options) => (source) =>\n    source.pipe(\n      filterFieldsByNameTransformer.operator({\n        exclude: { names: mapToExcludeArray(options.excludeByName) },\n      }),\n      orderFieldsTransformer.operator(options),\n      renameFieldsTransformer.operator(options)\n    ),\n};\n\nconst mapToExcludeArray = (excludeByName: Record<string, boolean>): string[] => {\n  if (!excludeByName) {\n    return [];\n  }\n\n  return Object.keys(excludeByName).filter((name) => excludeByName[name]);\n};\n","import { map } from 'rxjs/operators';\n\nimport { getFieldDisplayName } from '../../field/fieldState';\nimport { DataFrame, Field } from '../../types/dataFrame';\nimport { DataTransformerInfo } from '../../types/transformations';\n\nimport { DataTransformerID } from './ids';\n\nexport interface RenameFieldsTransformerOptions {\n  renameByName: Record<string, string>;\n}\n\nexport const renameFieldsTransformer: DataTransformerInfo<RenameFieldsTransformerOptions> = {\n  id: DataTransformerID.rename,\n  name: 'Rename fields by name',\n  description: 'Rename fields based on configuration given by user',\n  defaultOptions: {\n    renameByName: {},\n  },\n\n  /**\n   * Return a modified copy of the series.  If the transform is not or should not\n   * be applied, just return the input series\n   */\n  operator: (options) => (source) =>\n    source.pipe(\n      map((data) => {\n        const renamer = createRenamer(options.renameByName);\n\n        if (!Array.isArray(data) || data.length === 0) {\n          return data;\n        }\n\n        return data.map((frame) => ({\n          ...frame,\n          fields: renamer(frame),\n        }));\n      })\n    ),\n};\n\nconst createRenamer =\n  (renameByName: Record<string, string>) =>\n  (frame: DataFrame): Field[] => {\n    if (!renameByName || Object.keys(renameByName).length === 0) {\n      return frame.fields;\n    }\n\n    return frame.fields.map((field) => {\n      const displayName = getFieldDisplayName(field, frame);\n      const renameTo = renameByName[displayName];\n\n      if (typeof renameTo !== 'string' || renameTo.length === 0) {\n        return field;\n      }\n\n      return {\n        ...field,\n        config: {\n          ...field.config,\n          displayName: renameTo,\n        },\n        state: {\n          ...field.state,\n          displayName: renameTo,\n        },\n      };\n    });\n  };\n","import { map } from 'rxjs/operators';\n\nimport { DataFrame, SynchronousDataTransformerInfo, FieldMatcher } from '../../types';\nimport { fieldMatchers } from '../matchers';\nimport { FieldMatcherID } from '../matchers/ids';\n\nimport { DataTransformerID } from './ids';\nimport { outerJoinDataFrames } from './joinDataFrames';\n\nexport interface SeriesToColumnsOptions {\n  byField?: string; // empty will pick the field automatically\n}\n\nexport const seriesToColumnsTransformer: SynchronousDataTransformerInfo<SeriesToColumnsOptions> = {\n  id: DataTransformerID.seriesToColumns,\n  name: 'Series as columns', // Called 'Outer join' in the UI!\n  description: 'Groups series by field and returns values as columns',\n  defaultOptions: {\n    byField: undefined, // DEFAULT_KEY_FIELD,\n  },\n\n  operator: (options) => (source) => source.pipe(map((data) => seriesToColumnsTransformer.transformer(options)(data))),\n\n  transformer: (options: SeriesToColumnsOptions) => {\n    let joinBy: FieldMatcher | undefined = undefined;\n    return (data: DataFrame[]) => {\n      if (data.length > 1) {\n        if (options.byField && !joinBy) {\n          joinBy = fieldMatchers.get(FieldMatcherID.byName).get(options.byField);\n        }\n        const joined = outerJoinDataFrames({ frames: data, joinBy });\n        if (joined) {\n          return [joined];\n        }\n      }\n      return data;\n    };\n  },\n};\n","import { omit } from 'lodash';\nimport { map } from 'rxjs/operators';\n\nimport { MutableDataFrame, sortDataFrame } from '../../dataframe';\nimport { isTimeSeries } from '../../dataframe/utils';\nimport { getFrameDisplayName } from '../../field/fieldState';\nimport {\n  Field,\n  FieldType,\n  TIME_SERIES_METRIC_FIELD_NAME,\n  TIME_SERIES_TIME_FIELD_NAME,\n  TIME_SERIES_VALUE_FIELD_NAME,\n} from '../../types/dataFrame';\nimport { DataTransformerInfo } from '../../types/transformations';\nimport { ArrayVector } from '../../vector';\n\nimport { DataTransformerID } from './ids';\n\nexport interface SeriesToRowsTransformerOptions {}\n\nexport const seriesToRowsTransformer: DataTransformerInfo<SeriesToRowsTransformerOptions> = {\n  id: DataTransformerID.seriesToRows,\n  name: 'Series to rows',\n  description: 'Combines multiple series into a single serie and appends a column with metric name per value.',\n  defaultOptions: {},\n  operator: (options) => (source) =>\n    source.pipe(\n      map((data) => {\n        if (!Array.isArray(data) || data.length <= 1) {\n          return data;\n        }\n\n        if (!isTimeSeries(data)) {\n          return data;\n        }\n\n        const timeFieldByIndex: Record<number, number> = {};\n        const targetFields = new Set<string>();\n        const dataFrame = new MutableDataFrame();\n        const metricField: Field = {\n          name: TIME_SERIES_METRIC_FIELD_NAME,\n          values: new ArrayVector(),\n          config: {},\n          type: FieldType.string,\n        };\n\n        for (let frameIndex = 0; frameIndex < data.length; frameIndex++) {\n          const frame = data[frameIndex];\n\n          for (let fieldIndex = 0; fieldIndex < frame.fields.length; fieldIndex++) {\n            const field = frame.fields[fieldIndex];\n\n            if (field.type === FieldType.time) {\n              timeFieldByIndex[frameIndex] = fieldIndex;\n\n              if (!targetFields.has(TIME_SERIES_TIME_FIELD_NAME)) {\n                dataFrame.addField(copyFieldStructure(field, TIME_SERIES_TIME_FIELD_NAME));\n                dataFrame.addField(metricField);\n                targetFields.add(TIME_SERIES_TIME_FIELD_NAME);\n              }\n              continue;\n            }\n\n            if (!targetFields.has(TIME_SERIES_VALUE_FIELD_NAME)) {\n              dataFrame.addField(copyFieldStructure(field, TIME_SERIES_VALUE_FIELD_NAME));\n              targetFields.add(TIME_SERIES_VALUE_FIELD_NAME);\n            }\n          }\n        }\n\n        for (let frameIndex = 0; frameIndex < data.length; frameIndex++) {\n          const frame = data[frameIndex];\n\n          for (let valueIndex = 0; valueIndex < frame.length; valueIndex++) {\n            const timeFieldIndex = timeFieldByIndex[frameIndex];\n            const valueFieldIndex = timeFieldIndex === 0 ? 1 : 0;\n\n            dataFrame.add({\n              [TIME_SERIES_TIME_FIELD_NAME]: frame.fields[timeFieldIndex].values.get(valueIndex),\n              [TIME_SERIES_METRIC_FIELD_NAME]: getFrameDisplayName(frame),\n              [TIME_SERIES_VALUE_FIELD_NAME]: frame.fields[valueFieldIndex].values.get(valueIndex),\n            });\n          }\n        }\n\n        return [sortDataFrame(dataFrame, 0, true)];\n      })\n    ),\n};\n\nconst copyFieldStructure = (field: Field, name: string): Field => {\n  return {\n    ...omit(field, ['values', 'state', 'labels', 'config', 'name']),\n    name: name,\n    values: new ArrayVector(),\n    config: {\n      ...omit(field.config, ['displayName', 'displayNameFromDS']),\n    },\n  };\n};\n","import { map } from 'rxjs/operators';\n\nimport { sortDataFrame } from '../../dataframe';\nimport { getFieldDisplayName } from '../../field';\nimport { DataFrame } from '../../types';\nimport { DataTransformerInfo } from '../../types/transformations';\n\nimport { DataTransformerID } from './ids';\n\nexport interface SortByField {\n  field: string;\n  desc?: boolean;\n  index?: number;\n}\n\nexport interface SortByTransformerOptions {\n  // NOTE: this structure supports an array, however only the first entry is used\n  // future versions may support multi-sort options\n  sort: SortByField[];\n}\n\nexport const sortByTransformer: DataTransformerInfo<SortByTransformerOptions> = {\n  id: DataTransformerID.sortBy,\n  name: 'Sort by',\n  description: 'Sort fields in a frame',\n  defaultOptions: {\n    fields: {},\n  },\n\n  /**\n   * Return a modified copy of the series.  If the transform is not or should not\n   * be applied, just return the input series\n   */\n  operator: (options) => (source) =>\n    source.pipe(\n      map((data) => {\n        if (!Array.isArray(data) || data.length === 0 || !options?.sort?.length) {\n          return data;\n        }\n        return sortDataFrames(data, options.sort);\n      })\n    ),\n};\n\nexport function sortDataFrames(data: DataFrame[], sort: SortByField[]): DataFrame[] {\n  return data.map((frame) => {\n    const s = attachFieldIndex(frame, sort);\n    if (s.length && s[0].index != null) {\n      return sortDataFrame(frame, s[0].index, s[0].desc);\n    }\n    return frame;\n  });\n}\n\nfunction attachFieldIndex(frame: DataFrame, sort: SortByField[]): SortByField[] {\n  return sort.map((s) => {\n    if (s.index != null) {\n      // null or undefined\n      return s;\n    }\n    return {\n      ...s,\n      index: frame.fields.findIndex((f) => s.field === getFieldDisplayName(f, frame)),\n    };\n  });\n}\n","import { ScopedVars } from './ScopedVars';\nimport { QueryResultBase, Labels, NullValueMode } from './data';\nimport { DataLink, LinkModel } from './dataLink';\nimport { DecimalCount, DisplayProcessor, DisplayValue } from './displayValue';\nimport { FieldColor } from './fieldColor';\nimport { ThresholdsConfig } from './thresholds';\nimport { ValueMapping } from './valueMapping';\nimport { Vector } from './vector';\n\n/** @public */\nexport enum FieldType {\n  time = 'time', // or date\n  number = 'number',\n  string = 'string',\n  boolean = 'boolean',\n  // Used to detect that the value is some kind of trace data to help with the visualisation and processing.\n  trace = 'trace',\n  geo = 'geo',\n  other = 'other', // Object, Array, etc\n}\n\n/**\n * @public\n * Every property is optional\n *\n * Plugins may extend this with additional properties. Something like series overrides\n */\nexport interface FieldConfig<TOptions = any> {\n  /**\n   * The display value for this field.  This supports template variables blank is auto\n   */\n  displayName?: string;\n\n  /**\n   * This can be used by data sources that return and explicit naming structure for values and labels\n   * When this property is configured, this value is used rather than the default naming strategy.\n   */\n  displayNameFromDS?: string;\n\n  /**\n   * Human readable field metadata\n   */\n  description?: string;\n\n  /**\n   * An explict path to the field in the datasource.  When the frame meta includes a path,\n   * This will default to `${frame.meta.path}/${field.name}\n   *\n   * When defined, this value can be used as an identifier within the datasource scope, and\n   * may be used to update the results\n   */\n  path?: string;\n\n  /**\n   * True if data source can write a value to the path.  Auth/authz are supported separately\n   */\n  writeable?: boolean;\n\n  /**\n   * True if data source field supports ad-hoc filters\n   */\n  filterable?: boolean;\n\n  // Numeric Options\n  unit?: string;\n  decimals?: DecimalCount; // Significant digits (for display)\n  min?: number | null;\n  max?: number | null;\n\n  // Interval indicates the expected regular step between values in the series.\n  // When an interval exists, consumers can identify \"missing\" values when the expected value is not present.\n  // The grafana timeseries visualization will render disconnected values when missing values are found it the time field.\n  // The interval uses the same units as the values.  For time.Time, this is defined in milliseconds.\n  interval?: number | null;\n\n  // Convert input values into a display string\n  mappings?: ValueMapping[];\n\n  // Map numeric values to states\n  thresholds?: ThresholdsConfig;\n\n  // Map values to a display color\n  color?: FieldColor;\n\n  // Used when reducing field values\n  nullValueMode?: NullValueMode;\n\n  // The behavior when clicking on a result\n  links?: DataLink[];\n\n  // Alternative to empty string\n  noValue?: string;\n\n  // Panel Specific Values\n  custom?: TOptions;\n}\n\n/** @public */\nexport interface ValueLinkConfig {\n  /**\n   * Result of field reduction\n   */\n  calculatedValue?: DisplayValue;\n  /**\n   * Index of the value row within Field. Should be provided only when value is not a result of a reduction\n   */\n  valueRowIndex?: number;\n}\n\nexport interface Field<T = any, V = Vector<T>> {\n  /**\n   * Name of the field (column)\n   */\n  name: string;\n  /**\n   *  Field value type (string, number, etc)\n   */\n  type: FieldType;\n  /**\n   *  Meta info about how field and how to display it\n   */\n  config: FieldConfig;\n  values: V; // The raw field values\n  labels?: Labels;\n\n  /**\n   * Cached values with appropriate display and id values\n   */\n  state?: FieldState | null;\n\n  /**\n   * Convert a value for display\n   */\n  display?: DisplayProcessor;\n\n  /**\n   * Get value data links with variables interpolated\n   */\n  getLinks?: (config: ValueLinkConfig) => Array<LinkModel<Field>>;\n}\n\n/** @alpha */\nexport interface FieldState {\n  /**\n   * An appropriate name for the field (does not include frame info)\n   */\n  displayName?: string | null;\n\n  /**\n   * Cache of reduced values\n   */\n  calcs?: FieldCalcs;\n\n  /**\n   * The numeric range for values in this field.  This value will respect the min/max\n   * set in field config, or when set to `auto` this will have the min/max for all data\n   * in the response\n   */\n  range?: NumericRange;\n\n  /**\n   * Appropriate values for templating\n   */\n  scopedVars?: ScopedVars;\n\n  /**\n   * Series index is index for this field in a larger data set that can span multiple DataFrames\n   * Useful for assigning color to series by looking up a color in a palette using this index\n   */\n  seriesIndex?: number;\n\n  /**\n   * Location of this field within the context frames results\n   *\n   * @internal -- we will try to make this unnecessary\n   */\n  origin?: DataFrameFieldIndex;\n\n  /**\n   * Boolean value is true if field is in a larger data set with multiple frames.\n   * This is only related to the cached displayName property above.\n   */\n  multipleFrames?: boolean;\n\n  /**\n   * Boolean value is true if a null filling threshold has been applied\n   * against the frame of the field. This is used to avoid cases in which\n   * this would applied more than one time.\n   */\n  nullThresholdApplied?: boolean;\n}\n\n/** @public */\nexport interface NumericRange {\n  min?: number | null;\n  max?: number | null;\n  delta: number;\n}\n\nexport interface DataFrame extends QueryResultBase {\n  name?: string;\n  fields: Field[]; // All fields of equal length\n\n  // The number of rows\n  length: number;\n}\n\n/**\n * @public\n * Like a field, but properties are optional and values may be a simple array\n */\nexport interface FieldDTO<T = any> {\n  name: string; // The column name\n  type?: FieldType;\n  config?: FieldConfig;\n  values?: Vector<T> | T[]; // toJSON will always be T[], input could be either\n  labels?: Labels;\n}\n\n/**\n * @public\n * Like a DataFrame, but fields may be a FieldDTO\n */\nexport interface DataFrameDTO extends QueryResultBase {\n  name?: string;\n  fields: Array<FieldDTO | Field>;\n}\n\nexport interface FieldCalcs extends Record<string, any> {}\n\nexport const TIME_SERIES_VALUE_FIELD_NAME = 'Value';\nexport const TIME_SERIES_TIME_FIELD_NAME = 'Time';\nexport const TIME_SERIES_METRIC_FIELD_NAME = 'Metric';\n\n/**\n * Describes where a specific data frame field is located within a\n * dataset of type DataFrame[]\n *\n * @internal -- we will try to make this unnecessary\n */\nexport interface DataFrameFieldIndex {\n  frameIndex: number;\n  fieldIndex: number;\n}\n","/**\n * @public\n */\nexport enum FieldColorModeId {\n  Thresholds = 'thresholds',\n  PaletteClassic = 'palette-classic',\n  PaletteSaturated = 'palette-saturated',\n  ContinuousGrYlRd = 'continuous-GrYlRd',\n  Fixed = 'fixed',\n}\n\n/**\n * @public\n */\nexport interface FieldColor {\n  /** The main color scheme mode */\n  mode: FieldColorModeId | string;\n  /** Stores the fixed color value if mode is fixed */\n  fixedColor?: string;\n  /** Some visualizations need to know how to assign a series color from by value color schemes */\n  seriesBy?: FieldColorSeriesByMode;\n}\n\n/**\n * @beta\n */\nexport type FieldColorSeriesByMode = 'min' | 'max' | 'last';\n\nexport const FALLBACK_COLOR = 'gray';\n","import { ThemeVisualizationColors } from '../themes';\n\nexport enum GrafanaThemeType {\n  Light = 'light',\n  Dark = 'dark',\n}\n\nexport interface GrafanaThemeCommons {\n  name: string;\n  // TODO: not sure if should be a part of theme\n  breakpoints: {\n    xs: string;\n    sm: string;\n    md: string;\n    lg: string;\n    xl: string;\n    xxl: string;\n  };\n  typography: {\n    fontFamily: {\n      sansSerif: string;\n      monospace: string;\n    };\n    size: {\n      base: string;\n      xs: string;\n      sm: string;\n      md: string;\n      lg: string;\n    };\n    weight: {\n      light: number;\n      regular: number;\n      semibold: number;\n      bold: number;\n    };\n    lineHeight: {\n      xs: number; //1\n      sm: number; //1.1\n      md: number; // 4/3\n      lg: number; // 1.5\n    };\n    // TODO: Refactor to use size instead of custom defs\n    heading: {\n      h1: string;\n      h2: string;\n      h3: string;\n      h4: string;\n      h5: string;\n      h6: string;\n    };\n    link: {\n      decoration: string;\n      hoverDecoration: string;\n    };\n  };\n  spacing: {\n    base: number;\n    insetSquishMd: string;\n    d: string;\n    xxs: string;\n    xs: string;\n    sm: string;\n    md: string;\n    lg: string;\n    xl: string;\n    gutter: string;\n\n    // Next-gen forms spacing variables\n    // TODO: Move variables definition to respective components when implementing\n    formSpacingBase: number;\n    formMargin: string;\n    formFieldsetMargin: string;\n    formInputHeight: number;\n    formButtonHeight: number;\n    formInputPaddingHorizontal: string;\n    // Used for icons do define spacing between icon and input field\n    // Applied on the right(prefix) or left(suffix)\n    formInputAffixPaddingHorizontal: string;\n    formInputMargin: string;\n    formLabelPadding: string;\n    formLabelMargin: string;\n    formValidationMessagePadding: string;\n    formValidationMessageMargin: string;\n    inlineFormMargin: string;\n  };\n  border: {\n    radius: {\n      sm: string;\n      md: string;\n      lg: string;\n    };\n    width: {\n      sm: string;\n    };\n  };\n  height: {\n    sm: number;\n    md: number;\n    lg: number;\n  };\n  panelPadding: number;\n  panelHeaderHeight: number;\n  zIndex: {\n    dropdown: number;\n    navbarFixed: number;\n    sidemenu: number;\n    tooltip: number;\n    modalBackdrop: number;\n    modal: number;\n    portal: number;\n    typeahead: number;\n  };\n}\n\nexport interface GrafanaTheme extends GrafanaThemeCommons {\n  type: GrafanaThemeType;\n  isDark: boolean;\n  isLight: boolean;\n  palette: {\n    black: string;\n    white: string;\n    dark1: string;\n    dark2: string;\n    dark3: string;\n    dark4: string;\n    dark5: string;\n    dark6: string;\n    dark7: string;\n    dark8: string;\n    dark9: string;\n    dark10: string;\n    gray1: string;\n    gray2: string;\n    gray3: string;\n    gray4: string;\n    gray5: string;\n    gray6: string;\n    gray7: string;\n\n    // New greys palette used by next-gen form elements\n    gray98: string;\n    gray97: string;\n    gray95: string;\n    gray90: string;\n    gray85: string;\n    gray70: string;\n    gray60: string;\n    gray33: string;\n    gray25: string;\n    gray15: string;\n    gray10: string;\n    gray05: string;\n\n    // New blues palette used by next-gen form elements\n    blue95: string;\n    blue85: string;\n    blue80: string;\n    blue77: string;\n\n    // New reds palette used by next-gen form elements\n    red88: string;\n\n    // Accent colors\n    redBase: string;\n    redShade: string;\n    greenBase: string;\n    greenShade: string;\n    red: string;\n    yellow: string;\n    purple: string;\n    orange: string;\n    orangeDark: string;\n    queryRed: string;\n    queryGreen: string;\n    queryPurple: string;\n    queryOrange: string;\n    brandPrimary: string;\n    brandSuccess: string;\n    brandWarning: string;\n    brandDanger: string;\n\n    // Status colors\n    online: string;\n    warn: string;\n    critical: string;\n  };\n  colors: {\n    bg1: string;\n    bg2: string;\n    bg3: string;\n    border1: string;\n    border2: string;\n    border3: string;\n\n    bgBlue1: string;\n    bgBlue2: string;\n\n    dashboardBg: string;\n    bodyBg: string;\n    panelBg: string;\n    panelBorder: string;\n    pageHeaderBg: string;\n    pageHeaderBorder: string;\n\n    dropdownBg: string;\n    dropdownShadow: string;\n    dropdownOptionHoverBg: string;\n\n    // Link colors\n    link: string;\n    linkDisabled: string;\n    linkHover: string;\n    linkExternal: string;\n\n    // Text colors\n    textStrong: string;\n    textHeading: string;\n    text: string;\n    textSemiWeak: string;\n    textWeak: string;\n    textFaint: string;\n    textBlue: string;\n\n    // Next-gen forms functional colors\n    formLabel: string;\n    formDescription: string;\n    formInputBg: string;\n    formInputBgDisabled: string;\n    formInputBorder: string;\n    formInputBorderHover: string;\n    formInputBorderActive: string;\n    formInputBorderInvalid: string;\n    formFocusOutline: string;\n    formInputText: string;\n    formInputDisabledText: string;\n    formInputPlaceholderText: string;\n    formValidationMessageText: string;\n    formValidationMessageBg: string;\n  };\n  shadows: {\n    listItem: string;\n  };\n  visualization: ThemeVisualizationColors;\n}\n","export interface Threshold {\n  value: number;\n  color: string;\n  /**\n   *  Warning, Error, LowLow, Low, OK, High, HighHigh etc\n   */\n  state?: string;\n}\n\n/**\n *  Display mode\n */\nexport enum ThresholdsMode {\n  Absolute = 'absolute',\n  /**\n   *  between 0 and 1 (based on min/max)\n   */\n  Percentage = 'percentage',\n}\n\n/**\n *  Config that is passed to the ThresholdsEditor\n */\nexport interface ThresholdsConfig {\n  mode: ThresholdsMode;\n\n  /**\n   *  Must be sorted by 'value', first value is always -Infinity\n   */\n  steps: Threshold[];\n}\n","/**\n * @alpha\n */\nexport enum MappingType {\n  ValueToText = 'value', // was 1\n  RangeToText = 'range', // was 2\n  RegexToText = 'regex',\n  SpecialValue = 'special',\n}\n\n/**\n * @alpha\n */\nexport interface ValueMappingResult {\n  text?: string;\n  color?: string;\n  icon?: string;\n  index?: number;\n}\n\n/**\n * @alpha\n */\ninterface BaseValueMap<T> {\n  type: MappingType;\n  options: T;\n}\n\n/**\n * @alpha\n */\nexport interface ValueMap extends BaseValueMap<Record<string, ValueMappingResult>> {\n  type: MappingType.ValueToText;\n}\n\n/**\n * @alpha\n */\nexport interface RangeMapOptions {\n  from: number | null; // changed from string\n  to: number | null;\n  result: ValueMappingResult;\n}\n\n/**\n * @alpha\n */\nexport interface RangeMap extends BaseValueMap<RangeMapOptions> {\n  type: MappingType.RangeToText;\n}\n\n/**\n * @alpha\n */\nexport interface RegexMapOptions {\n  pattern: string;\n  result: ValueMappingResult;\n}\n\n/**\n * @alpha\n */\nexport interface RegexMap extends BaseValueMap<RegexMapOptions> {\n  type: MappingType.RegexToText;\n}\n\n/**\n * @alpha\n */\nexport interface SpecialValueOptions {\n  match: SpecialValueMatch;\n  result: ValueMappingResult;\n}\n\n/**\n * @alpha\n */\nexport enum SpecialValueMatch {\n  True = 'true',\n  False = 'false',\n  Null = 'null',\n  NaN = 'nan',\n  NullAndNaN = 'null+nan',\n  Empty = 'empty',\n}\n\n/**\n * @alpha\n */\nexport interface SpecialValueMap extends BaseValueMap<SpecialValueOptions> {\n  type: MappingType.SpecialValue;\n}\n\n/**\n * @alpha\n */\nexport type ValueMapping = ValueMap | RangeMap | RegexMap | SpecialValueMap;\n","import { PluginState } from '../types';\nimport { SelectableValue } from '../types/select';\n\nexport interface RegistryItem {\n  id: string; // Unique Key -- saved in configs\n  name: string; // Display Name, can change without breaking configs\n  description?: string;\n  aliasIds?: string[]; // when the ID changes, we may want backwards compatibility ('current' => 'last')\n\n  /**\n   * Some extensions should not be user selectable\n   *  like: 'all' and 'any' matchers;\n   */\n  excludeFromPicker?: boolean;\n\n  /**\n   * Optional feature state\n   */\n  state?: PluginState;\n}\n\nexport interface RegistryItemWithOptions<TOptions = any> extends RegistryItem {\n  /**\n   * Convert the options to a string\n   */\n  getOptionsDisplayText?: (options: TOptions) => string;\n\n  /**\n   * Default options used if nothing else is specified\n   */\n  defaultOptions?: TOptions;\n}\n\ninterface RegistrySelectInfo {\n  options: Array<SelectableValue<string>>;\n  current: Array<SelectableValue<string>>;\n}\n\nexport class Registry<T extends RegistryItem> {\n  private ordered: T[] = [];\n  private byId = new Map<string, T>();\n  private initialized = false;\n\n  constructor(private init?: () => T[]) {}\n\n  setInit = (init: () => T[]) => {\n    if (this.initialized) {\n      throw new Error('Registry already initialized');\n    }\n    this.init = init;\n  };\n\n  getIfExists(id: string | undefined): T | undefined {\n    if (!this.initialized) {\n      this.initialize();\n    }\n\n    if (id) {\n      return this.byId.get(id);\n    }\n\n    return undefined;\n  }\n\n  private initialize() {\n    if (this.init) {\n      for (const ext of this.init()) {\n        this.register(ext);\n      }\n    }\n    this.sort();\n    this.initialized = true;\n  }\n\n  get(id: string): T {\n    const v = this.getIfExists(id);\n    if (!v) {\n      throw new Error(`\"${id}\" not found in: ${this.list().map((v) => v.id)}`);\n    }\n    return v;\n  }\n\n  selectOptions(current?: string[], filter?: (ext: T) => boolean): RegistrySelectInfo {\n    if (!this.initialized) {\n      this.initialize();\n    }\n\n    const select = {\n      options: [],\n      current: [],\n    } as RegistrySelectInfo;\n\n    const currentOptions: Record<string, SelectableValue<string>> = {};\n    if (current) {\n      for (const id of current) {\n        currentOptions[id] = {};\n      }\n    }\n\n    for (const ext of this.ordered) {\n      if (ext.excludeFromPicker) {\n        continue;\n      }\n      if (filter && !filter(ext)) {\n        continue;\n      }\n\n      const option = {\n        value: ext.id,\n        label: ext.name,\n        description: ext.description,\n      };\n\n      if (ext.state === PluginState.alpha) {\n        option.label += ' (alpha)';\n      }\n\n      select.options.push(option);\n      if (currentOptions[ext.id]) {\n        currentOptions[ext.id] = option;\n      }\n    }\n\n    if (current) {\n      // this makes sure we preserve the order of ids\n      select.current = Object.values(currentOptions);\n    }\n\n    return select;\n  }\n\n  /**\n   * Return a list of values by ID, or all values if not specified\n   */\n  list(ids?: any[]): T[] {\n    if (!this.initialized) {\n      this.initialize();\n    }\n\n    if (ids) {\n      const found: T[] = [];\n      for (const id of ids) {\n        const v = this.getIfExists(id);\n        if (v) {\n          found.push(v);\n        }\n      }\n      return found;\n    }\n\n    return this.ordered;\n  }\n\n  isEmpty(): boolean {\n    if (!this.initialized) {\n      this.initialize();\n    }\n\n    return this.ordered.length === 0;\n  }\n\n  register(ext: T) {\n    if (this.byId.has(ext.id)) {\n      throw new Error('Duplicate Key:' + ext.id);\n    }\n\n    this.byId.set(ext.id, ext);\n    this.ordered.push(ext);\n\n    if (ext.aliasIds) {\n      for (const alias of ext.aliasIds) {\n        if (!this.byId.has(alias)) {\n          this.byId.set(alias, ext);\n        }\n      }\n    }\n\n    if (this.initialized) {\n      this.sort();\n    }\n  }\n\n  private sort() {\n    // TODO sort the list\n  }\n}\n","import { toNumber } from 'lodash';\n\n/**\n * Will return any value as a number or NaN\n *\n * @internal\n * */\nexport function anyToNumber(value: any): number {\n  if (typeof value === 'number') {\n    return value;\n  }\n\n  if (value === '' || value === null || value === undefined || Array.isArray(value)) {\n    return NaN; // lodash calls them 0\n  }\n\n  if (typeof value === 'boolean') {\n    return value ? 1 : 0;\n  }\n\n  return toNumber(value);\n}\n","import { RegistryItem, Registry } from './Registry';\n\nexport enum BinaryOperationID {\n  Add = '+',\n  Subtract = '-',\n  Divide = '/',\n  Multiply = '*',\n}\n\nexport type BinaryOperation = (left: number, right: number) => number;\n\ninterface BinaryOperatorInfo extends RegistryItem {\n  operation: BinaryOperation;\n}\n\nexport const binaryOperators = new Registry<BinaryOperatorInfo>(() => {\n  return [\n    {\n      id: BinaryOperationID.Add,\n      name: 'Add',\n      operation: (a: number, b: number) => a + b,\n    },\n    {\n      id: BinaryOperationID.Subtract,\n      name: 'Subtract',\n      operation: (a: number, b: number) => a - b,\n    },\n    {\n      id: BinaryOperationID.Multiply,\n      name: 'Multiply',\n      operation: (a: number, b: number) => a * b,\n    },\n    {\n      id: BinaryOperationID.Divide,\n      name: 'Divide',\n      operation: (a: number, b: number) => a / b,\n    },\n  ];\n});\n","import { guessFieldTypeFromValue } from '../dataframe/processDataFrame';\nimport { Field, FieldType } from '../types/dataFrame';\n\nexport function makeFieldParser(value: any, field: Field): (value: string) => any {\n  if (!field.type) {\n    if (field.name === 'time' || field.name === 'Time') {\n      field.type = FieldType.time;\n    } else {\n      field.type = guessFieldTypeFromValue(value);\n    }\n  }\n\n  if (field.type === FieldType.number) {\n    return (value: string) => {\n      return parseFloat(value);\n    };\n  }\n\n  // Will convert anything that starts with \"T\" to true\n  if (field.type === FieldType.boolean) {\n    return (value: string) => {\n      return !(value[0] === 'F' || value[0] === 'f' || value[0] === '0');\n    };\n  }\n\n  // Just pass the string back\n  return (value: string) => value;\n}\n","/**\n * @beta\n * Proxies a ES6 class so that it can be used as a base class for an ES5 class\n */\nexport function makeClassES5Compatible<T>(ES6Class: T): T {\n  return new Proxy(ES6Class as any, {\n    // ES5 code will call it like a function using super\n    apply(target, self, argumentsList) {\n      if (typeof Reflect === 'undefined' || !Reflect.construct) {\n        alert('Browser is too old');\n      }\n\n      return Reflect.construct(target, argumentsList, self.constructor);\n    },\n  }) as unknown as T;\n}\n","import { DecimalCount } from '../types/displayValue';\n\nimport { toFixed, FormattedValue } from './valueFormats';\n\nexport function toPercent(size: number, decimals: DecimalCount): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n  return { text: toFixed(size, decimals), suffix: '%' };\n}\n\nexport function toPercentUnit(size: number, decimals: DecimalCount): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n  return { text: toFixed(100 * size, decimals), suffix: '%' };\n}\n\nexport function toHex0x(value: number, decimals: DecimalCount): FormattedValue {\n  if (value == null) {\n    return { text: '' };\n  }\n  const asHex = toHex(value, decimals);\n  if (asHex.text.substring(0, 1) === '-') {\n    asHex.text = '-0x' + asHex.text.substring(1);\n  } else {\n    asHex.text = '0x' + asHex.text;\n  }\n  return asHex;\n}\n\nexport function toHex(value: number, decimals: DecimalCount): FormattedValue {\n  if (value == null) {\n    return { text: '' };\n  }\n  return {\n    text: parseFloat(toFixed(value, decimals)).toString(16).toUpperCase(),\n  };\n}\n\nexport function sci(value: number, decimals: DecimalCount): FormattedValue {\n  if (value == null) {\n    return { text: '' };\n  }\n  return { text: value.toExponential(decimals as number) };\n}\n","import { toHex, sci, toHex0x, toPercent, toPercentUnit } from './arithmeticFormatters';\nimport {\n  dateTimeAsIso,\n  dateTimeAsIsoNoDateIfToday,\n  dateTimeAsUS,\n  dateTimeAsUSNoDateIfToday,\n  getDateTimeAsLocalFormat,\n  getDateTimeAsLocalFormatNoDateIfToday,\n  dateTimeFromNow,\n  toClockMilliseconds,\n  toClockSeconds,\n  toDays,\n  toDurationInDaysHoursMinutesSeconds,\n  toDurationInHoursMinutesSeconds,\n  toDurationInMilliseconds,\n  toDurationInSeconds,\n  toHours,\n  toMicroSeconds,\n  toMilliSeconds,\n  toMinutes,\n  toNanoSeconds,\n  toSeconds,\n  toTimeTicks,\n  dateTimeSystemFormatter,\n} from './dateTimeFormatters';\nimport { binaryPrefix, currency, SIPrefix } from './symbolFormatters';\nimport {\n  locale,\n  scaledUnits,\n  simpleCountUnit,\n  toFixedUnit,\n  ValueFormatCategory,\n  stringFormater,\n  booleanValueFormatter,\n} from './valueFormats';\n\nexport const getCategories = (): ValueFormatCategory[] => [\n  {\n    name: 'Misc',\n    formats: [\n      { name: 'Number', id: 'none', fn: toFixedUnit('') },\n      { name: 'String', id: 'string', fn: stringFormater },\n      {\n        name: 'short',\n        id: 'short',\n        fn: scaledUnits(1000, ['', ' K', ' Mil', ' Bil', ' Tri', ' Quadr', ' Quint', ' Sext', ' Sept']),\n      },\n      { name: 'Percent (0-100)', id: 'percent', fn: toPercent },\n      { name: 'Percent (0.0-1.0)', id: 'percentunit', fn: toPercentUnit },\n      { name: 'Humidity (%H)', id: 'humidity', fn: toFixedUnit('%H') },\n      { name: 'Decibel', id: 'dB', fn: toFixedUnit('dB') },\n      { name: 'Hexadecimal (0x)', id: 'hex0x', fn: toHex0x },\n      { name: 'Hexadecimal', id: 'hex', fn: toHex },\n      { name: 'Scientific notation', id: 'sci', fn: sci },\n      { name: 'Locale format', id: 'locale', fn: locale },\n      { name: 'Pixels', id: 'pixel', fn: toFixedUnit('px') },\n    ],\n  },\n  {\n    name: 'Acceleration',\n    formats: [\n      { name: 'Meters/sec²', id: 'accMS2', fn: toFixedUnit('m/sec²') },\n      { name: 'Feet/sec²', id: 'accFS2', fn: toFixedUnit('f/sec²') },\n      { name: 'G unit', id: 'accG', fn: toFixedUnit('g') },\n    ],\n  },\n  {\n    name: 'Angle',\n    formats: [\n      { name: 'Degrees (°)', id: 'degree', fn: toFixedUnit('°') },\n      { name: 'Radians', id: 'radian', fn: toFixedUnit('rad') },\n      { name: 'Gradian', id: 'grad', fn: toFixedUnit('grad') },\n      { name: 'Arc Minutes', id: 'arcmin', fn: toFixedUnit('arcmin') },\n      { name: 'Arc Seconds', id: 'arcsec', fn: toFixedUnit('arcsec') },\n    ],\n  },\n  {\n    name: 'Area',\n    formats: [\n      { name: 'Square Meters (m²)', id: 'areaM2', fn: toFixedUnit('m²') },\n      { name: 'Square Feet (ft²)', id: 'areaF2', fn: toFixedUnit('ft²') },\n      { name: 'Square Miles (mi²)', id: 'areaMI2', fn: toFixedUnit('mi²') },\n    ],\n  },\n  {\n    name: 'Computation',\n    formats: [\n      { name: 'FLOP/s', id: 'flops', fn: SIPrefix('FLOPS') },\n      { name: 'MFLOP/s', id: 'mflops', fn: SIPrefix('FLOPS', 2) },\n      { name: 'GFLOP/s', id: 'gflops', fn: SIPrefix('FLOPS', 3) },\n      { name: 'TFLOP/s', id: 'tflops', fn: SIPrefix('FLOPS', 4) },\n      { name: 'PFLOP/s', id: 'pflops', fn: SIPrefix('FLOPS', 5) },\n      { name: 'EFLOP/s', id: 'eflops', fn: SIPrefix('FLOPS', 6) },\n      { name: 'ZFLOP/s', id: 'zflops', fn: SIPrefix('FLOPS', 7) },\n      { name: 'YFLOP/s', id: 'yflops', fn: SIPrefix('FLOPS', 8) },\n    ],\n  },\n  {\n    name: 'Concentration',\n    formats: [\n      { name: 'parts-per-million (ppm)', id: 'ppm', fn: toFixedUnit('ppm') },\n      { name: 'parts-per-billion (ppb)', id: 'conppb', fn: toFixedUnit('ppb') },\n      { name: 'nanogram per cubic meter (ng/m³)', id: 'conngm3', fn: toFixedUnit('ng/m³') },\n      { name: 'nanogram per normal cubic meter (ng/Nm³)', id: 'conngNm3', fn: toFixedUnit('ng/Nm³') },\n      { name: 'microgram per cubic meter (μg/m³)', id: 'conμgm3', fn: toFixedUnit('μg/m³') },\n      { name: 'microgram per normal cubic meter (μg/Nm³)', id: 'conμgNm3', fn: toFixedUnit('μg/Nm³') },\n      { name: 'milligram per cubic meter (mg/m³)', id: 'conmgm3', fn: toFixedUnit('mg/m³') },\n      { name: 'milligram per normal cubic meter (mg/Nm³)', id: 'conmgNm3', fn: toFixedUnit('mg/Nm³') },\n      { name: 'gram per cubic meter (g/m³)', id: 'congm3', fn: toFixedUnit('g/m³') },\n      { name: 'gram per normal cubic meter (g/Nm³)', id: 'congNm3', fn: toFixedUnit('g/Nm³') },\n      { name: 'milligrams per decilitre (mg/dL)', id: 'conmgdL', fn: toFixedUnit('mg/dL') },\n      { name: 'millimoles per litre (mmol/L)', id: 'conmmolL', fn: toFixedUnit('mmol/L') },\n    ],\n  },\n  {\n    name: 'Currency',\n    formats: [\n      { name: 'Dollars ($)', id: 'currencyUSD', fn: currency('$') },\n      { name: 'Pounds (£)', id: 'currencyGBP', fn: currency('£') },\n      { name: 'Euro (€)', id: 'currencyEUR', fn: currency('€') },\n      { name: 'Yen (¥)', id: 'currencyJPY', fn: currency('¥') },\n      { name: 'Rubles (₽)', id: 'currencyRUB', fn: currency('₽') },\n      { name: 'Hryvnias (₴)', id: 'currencyUAH', fn: currency('₴') },\n      { name: 'Real (R$)', id: 'currencyBRL', fn: currency('R$') },\n      { name: 'Danish Krone (kr)', id: 'currencyDKK', fn: currency('kr', true) },\n      { name: 'Icelandic Króna (kr)', id: 'currencyISK', fn: currency('kr', true) },\n      { name: 'Norwegian Krone (kr)', id: 'currencyNOK', fn: currency('kr', true) },\n      { name: 'Swedish Krona (kr)', id: 'currencySEK', fn: currency('kr', true) },\n      { name: 'Czech koruna (czk)', id: 'currencyCZK', fn: currency('czk') },\n      { name: 'Swiss franc (CHF)', id: 'currencyCHF', fn: currency('CHF') },\n      { name: 'Polish Złoty (PLN)', id: 'currencyPLN', fn: currency('PLN') },\n      { name: 'Bitcoin (฿)', id: 'currencyBTC', fn: currency('฿') },\n      { name: 'Milli Bitcoin (฿)', id: 'currencymBTC', fn: currency('mBTC') },\n      { name: 'Micro Bitcoin (฿)', id: 'currencyμBTC', fn: currency('μBTC') },\n      { name: 'South African Rand (R)', id: 'currencyZAR', fn: currency('R') },\n      { name: 'Indian Rupee (₹)', id: 'currencyINR', fn: currency('₹') },\n      { name: 'South Korean Won (₩)', id: 'currencyKRW', fn: currency('₩') },\n      { name: 'Indonesian Rupiah (Rp)', id: 'currencyIDR', fn: currency('Rp') },\n      { name: 'Philippine Peso (PHP)', id: 'currencyPHP', fn: currency('PHP') },\n      { name: 'Vietnamese Dong (VND)', id: 'currencyVND', fn: currency('đ', true) },\n    ],\n  },\n  {\n    name: 'Data',\n    formats: [\n      { name: 'bytes(IEC)', id: 'bytes', fn: binaryPrefix('B') },\n      { name: 'bytes(SI)', id: 'decbytes', fn: SIPrefix('B') },\n      { name: 'bits(IEC)', id: 'bits', fn: binaryPrefix('b') },\n      { name: 'bits(SI)', id: 'decbits', fn: SIPrefix('b') },\n      { name: 'kibibytes', id: 'kbytes', fn: binaryPrefix('B', 1) },\n      { name: 'kilobytes', id: 'deckbytes', fn: SIPrefix('B', 1) },\n      { name: 'mebibytes', id: 'mbytes', fn: binaryPrefix('B', 2) },\n      { name: 'megabytes', id: 'decmbytes', fn: SIPrefix('B', 2) },\n      { name: 'gibibytes', id: 'gbytes', fn: binaryPrefix('B', 3) },\n      { name: 'gigabytes', id: 'decgbytes', fn: SIPrefix('B', 3) },\n      { name: 'tebibytes', id: 'tbytes', fn: binaryPrefix('B', 4) },\n      { name: 'terabytes', id: 'dectbytes', fn: SIPrefix('B', 4) },\n      { name: 'pebibytes', id: 'pbytes', fn: binaryPrefix('B', 5) },\n      { name: 'petabytes', id: 'decpbytes', fn: SIPrefix('B', 5) },\n    ],\n  },\n  {\n    name: 'Data rate',\n    formats: [\n      { name: 'packets/sec', id: 'pps', fn: SIPrefix('p/s') },\n      { name: 'bytes/sec(IEC)', id: 'binBps', fn: binaryPrefix('B/s') },\n      { name: 'bytes/sec(SI)', id: 'Bps', fn: SIPrefix('B/s') },\n      { name: 'bits/sec(IEC)', id: 'binbps', fn: binaryPrefix('b/s') },\n      { name: 'bits/sec(SI)', id: 'bps', fn: SIPrefix('b/s') },\n      { name: 'kibibytes/sec', id: 'KiBs', fn: binaryPrefix('B/s', 1) },\n      { name: 'kibibits/sec', id: 'Kibits', fn: binaryPrefix('b/s', 1) },\n      { name: 'kilobytes/sec', id: 'KBs', fn: SIPrefix('B/s', 1) },\n      { name: 'kilobits/sec', id: 'Kbits', fn: SIPrefix('b/s', 1) },\n      { name: 'mebibytes/sec', id: 'MiBs', fn: binaryPrefix('B/s', 2) },\n      { name: 'mebibits/sec', id: 'Mibits', fn: binaryPrefix('b/s', 2) },\n      { name: 'megabytes/sec', id: 'MBs', fn: SIPrefix('B/s', 2) },\n      { name: 'megabits/sec', id: 'Mbits', fn: SIPrefix('b/s', 2) },\n      { name: 'gibibytes/sec', id: 'GiBs', fn: binaryPrefix('B/s', 3) },\n      { name: 'gibibits/sec', id: 'Gibits', fn: binaryPrefix('b/s', 3) },\n      { name: 'gigabytes/sec', id: 'GBs', fn: SIPrefix('B/s', 3) },\n      { name: 'gigabits/sec', id: 'Gbits', fn: SIPrefix('b/s', 3) },\n      { name: 'tebibytes/sec', id: 'TiBs', fn: binaryPrefix('B/s', 4) },\n      { name: 'tebibits/sec', id: 'Tibits', fn: binaryPrefix('b/s', 4) },\n      { name: 'terabytes/sec', id: 'TBs', fn: SIPrefix('B/s', 4) },\n      { name: 'terabits/sec', id: 'Tbits', fn: SIPrefix('b/s', 4) },\n      { name: 'pebibytes/sec', id: 'PiBs', fn: binaryPrefix('B/s', 5) },\n      { name: 'pebibits/sec', id: 'Pibits', fn: binaryPrefix('b/s', 5) },\n      { name: 'petabytes/sec', id: 'PBs', fn: SIPrefix('B/s', 5) },\n      { name: 'petabits/sec', id: 'Pbits', fn: SIPrefix('b/s', 5) },\n    ],\n  },\n  {\n    name: 'Date & time',\n    formats: [\n      { name: 'Datetime ISO', id: 'dateTimeAsIso', fn: dateTimeAsIso },\n      { name: 'Datetime ISO (No date if today)', id: 'dateTimeAsIsoNoDateIfToday', fn: dateTimeAsIsoNoDateIfToday },\n      { name: 'Datetime US', id: 'dateTimeAsUS', fn: dateTimeAsUS },\n      { name: 'Datetime US (No date if today)', id: 'dateTimeAsUSNoDateIfToday', fn: dateTimeAsUSNoDateIfToday },\n      { name: 'Datetime local', id: 'dateTimeAsLocal', fn: getDateTimeAsLocalFormat() },\n      {\n        name: 'Datetime local (No date if today)',\n        id: 'dateTimeAsLocalNoDateIfToday',\n        fn: getDateTimeAsLocalFormatNoDateIfToday(),\n      },\n      { name: 'Datetime default', id: 'dateTimeAsSystem', fn: dateTimeSystemFormatter },\n      { name: 'From Now', id: 'dateTimeFromNow', fn: dateTimeFromNow },\n    ],\n  },\n  {\n    name: 'Energy',\n    formats: [\n      { name: 'Watt (W)', id: 'watt', fn: SIPrefix('W') },\n      { name: 'Kilowatt (kW)', id: 'kwatt', fn: SIPrefix('W', 1) },\n      { name: 'Megawatt (MW)', id: 'megwatt', fn: SIPrefix('W', 2) },\n      { name: 'Gigawatt (GW)', id: 'gwatt', fn: SIPrefix('W', 3) },\n      { name: 'Milliwatt (mW)', id: 'mwatt', fn: SIPrefix('W', -1) },\n      { name: 'Watt per square meter (W/m²)', id: 'Wm2', fn: toFixedUnit('W/m²') },\n      { name: 'Volt-Ampere (VA)', id: 'voltamp', fn: SIPrefix('VA') },\n      { name: 'Kilovolt-Ampere (kVA)', id: 'kvoltamp', fn: SIPrefix('VA', 1) },\n      { name: 'Volt-Ampere reactive (VAr)', id: 'voltampreact', fn: SIPrefix('VAr') },\n      { name: 'Kilovolt-Ampere reactive (kVAr)', id: 'kvoltampreact', fn: SIPrefix('VAr', 1) },\n      { name: 'Watt-hour (Wh)', id: 'watth', fn: SIPrefix('Wh') },\n      { name: 'Watt-hour per Kilogram (Wh/kg)', id: 'watthperkg', fn: SIPrefix('Wh/kg') },\n      { name: 'Kilowatt-hour (kWh)', id: 'kwatth', fn: SIPrefix('Wh', 1) },\n      { name: 'Kilowatt-min (kWm)', id: 'kwattm', fn: SIPrefix('W-Min', 1) },\n      { name: 'Ampere-hour (Ah)', id: 'amph', fn: SIPrefix('Ah') },\n      { name: 'Kiloampere-hour (kAh)', id: 'kamph', fn: SIPrefix('Ah', 1) },\n      { name: 'Milliampere-hour (mAh)', id: 'mamph', fn: SIPrefix('Ah', -1) },\n      { name: 'Joule (J)', id: 'joule', fn: SIPrefix('J') },\n      { name: 'Electron volt (eV)', id: 'ev', fn: SIPrefix('eV') },\n      { name: 'Ampere (A)', id: 'amp', fn: SIPrefix('A') },\n      { name: 'Kiloampere (kA)', id: 'kamp', fn: SIPrefix('A', 1) },\n      { name: 'Milliampere (mA)', id: 'mamp', fn: SIPrefix('A', -1) },\n      { name: 'Volt (V)', id: 'volt', fn: SIPrefix('V') },\n      { name: 'Kilovolt (kV)', id: 'kvolt', fn: SIPrefix('V', 1) },\n      { name: 'Millivolt (mV)', id: 'mvolt', fn: SIPrefix('V', -1) },\n      { name: 'Decibel-milliwatt (dBm)', id: 'dBm', fn: SIPrefix('dBm') },\n      { name: 'Ohm (Ω)', id: 'ohm', fn: SIPrefix('Ω') },\n      { name: 'Kiloohm (kΩ)', id: 'kohm', fn: SIPrefix('Ω', 1) },\n      { name: 'Megaohm (MΩ)', id: 'Mohm', fn: SIPrefix('Ω', 2) },\n      { name: 'Farad (F)', id: 'farad', fn: SIPrefix('F') },\n      { name: 'Microfarad (µF)', id: 'µfarad', fn: SIPrefix('F', -2) },\n      { name: 'Nanofarad (nF)', id: 'nfarad', fn: SIPrefix('F', -3) },\n      { name: 'Picofarad (pF)', id: 'pfarad', fn: SIPrefix('F', -4) },\n      { name: 'Femtofarad (fF)', id: 'ffarad', fn: SIPrefix('F', -5) },\n      { name: 'Henry (H)', id: 'henry', fn: SIPrefix('H') },\n      { name: 'Millihenry (mH)', id: 'mhenry', fn: SIPrefix('H', -1) },\n      { name: 'Microhenry (µH)', id: 'µhenry', fn: SIPrefix('H', -2) },\n      { name: 'Lumens (Lm)', id: 'lumens', fn: SIPrefix('Lm') },\n    ],\n  },\n  {\n    name: 'Flow',\n    formats: [\n      { name: 'Gallons/min (gpm)', id: 'flowgpm', fn: toFixedUnit('gpm') },\n      { name: 'Cubic meters/sec (cms)', id: 'flowcms', fn: toFixedUnit('cms') },\n      { name: 'Cubic feet/sec (cfs)', id: 'flowcfs', fn: toFixedUnit('cfs') },\n      { name: 'Cubic feet/min (cfm)', id: 'flowcfm', fn: toFixedUnit('cfm') },\n      { name: 'Litre/hour', id: 'litreh', fn: toFixedUnit('L/h') },\n      { name: 'Litre/min (L/min)', id: 'flowlpm', fn: toFixedUnit('L/min') },\n      { name: 'milliLitre/min (mL/min)', id: 'flowmlpm', fn: toFixedUnit('mL/min') },\n      { name: 'Lux (lx)', id: 'lux', fn: toFixedUnit('lux') },\n    ],\n  },\n  {\n    name: 'Force',\n    formats: [\n      { name: 'Newton-meters (Nm)', id: 'forceNm', fn: SIPrefix('Nm') },\n      { name: 'Kilonewton-meters (kNm)', id: 'forcekNm', fn: SIPrefix('Nm', 1) },\n      { name: 'Newtons (N)', id: 'forceN', fn: SIPrefix('N') },\n      { name: 'Kilonewtons (kN)', id: 'forcekN', fn: SIPrefix('N', 1) },\n    ],\n  },\n  {\n    name: 'Hash rate',\n    formats: [\n      { name: 'hashes/sec', id: 'Hs', fn: SIPrefix('H/s') },\n      { name: 'kilohashes/sec', id: 'KHs', fn: SIPrefix('H/s', 1) },\n      { name: 'megahashes/sec', id: 'MHs', fn: SIPrefix('H/s', 2) },\n      { name: 'gigahashes/sec', id: 'GHs', fn: SIPrefix('H/s', 3) },\n      { name: 'terahashes/sec', id: 'THs', fn: SIPrefix('H/s', 4) },\n      { name: 'petahashes/sec', id: 'PHs', fn: SIPrefix('H/s', 5) },\n      { name: 'exahashes/sec', id: 'EHs', fn: SIPrefix('H/s', 6) },\n    ],\n  },\n  {\n    name: 'Mass',\n    formats: [\n      { name: 'milligram (mg)', id: 'massmg', fn: SIPrefix('g', -1) },\n      { name: 'gram (g)', id: 'massg', fn: SIPrefix('g') },\n      { name: 'pound (lb)', id: 'masslb', fn: toFixedUnit('lb') },\n      { name: 'kilogram (kg)', id: 'masskg', fn: SIPrefix('g', 1) },\n      { name: 'metric ton (t)', id: 'masst', fn: toFixedUnit('t') },\n    ],\n  },\n  {\n    name: 'Length',\n    formats: [\n      { name: 'millimeter (mm)', id: 'lengthmm', fn: SIPrefix('m', -1) },\n      { name: 'inch (in)', id: 'lengthin', fn: toFixedUnit('in') },\n      { name: 'feet (ft)', id: 'lengthft', fn: toFixedUnit('ft') },\n      { name: 'meter (m)', id: 'lengthm', fn: SIPrefix('m') },\n      { name: 'kilometer (km)', id: 'lengthkm', fn: SIPrefix('m', 1) },\n      { name: 'mile (mi)', id: 'lengthmi', fn: toFixedUnit('mi') },\n    ],\n  },\n  {\n    name: 'Pressure',\n    formats: [\n      { name: 'Millibars', id: 'pressurembar', fn: SIPrefix('bar', -1) },\n      { name: 'Bars', id: 'pressurebar', fn: SIPrefix('bar') },\n      { name: 'Kilobars', id: 'pressurekbar', fn: SIPrefix('bar', 1) },\n      { name: 'Pascals', id: 'pressurepa', fn: SIPrefix('Pa') },\n      { name: 'Hectopascals', id: 'pressurehpa', fn: toFixedUnit('hPa') },\n      { name: 'Kilopascals', id: 'pressurekpa', fn: toFixedUnit('kPa') },\n      { name: 'Inches of mercury', id: 'pressurehg', fn: toFixedUnit('\"Hg') },\n      { name: 'PSI', id: 'pressurepsi', fn: scaledUnits(1000, ['psi', 'ksi', 'Mpsi']) },\n    ],\n  },\n  {\n    name: 'Radiation',\n    formats: [\n      { name: 'Becquerel (Bq)', id: 'radbq', fn: SIPrefix('Bq') },\n      { name: 'curie (Ci)', id: 'radci', fn: SIPrefix('Ci') },\n      { name: 'Gray (Gy)', id: 'radgy', fn: SIPrefix('Gy') },\n      { name: 'rad', id: 'radrad', fn: SIPrefix('rad') },\n      { name: 'Sievert (Sv)', id: 'radsv', fn: SIPrefix('Sv') },\n      { name: 'milliSievert (mSv)', id: 'radmsv', fn: SIPrefix('Sv', -1) },\n      { name: 'microSievert (µSv)', id: 'radusv', fn: SIPrefix('Sv', -2) },\n      { name: 'rem', id: 'radrem', fn: SIPrefix('rem') },\n      { name: 'Exposure (C/kg)', id: 'radexpckg', fn: SIPrefix('C/kg') },\n      { name: 'roentgen (R)', id: 'radr', fn: SIPrefix('R') },\n      { name: 'Sievert/hour (Sv/h)', id: 'radsvh', fn: SIPrefix('Sv/h') },\n      { name: 'milliSievert/hour (mSv/h)', id: 'radmsvh', fn: SIPrefix('Sv/h', -1) },\n      { name: 'microSievert/hour (µSv/h)', id: 'radusvh', fn: SIPrefix('Sv/h', -2) },\n    ],\n  },\n  {\n    name: 'Rotational Speed',\n    formats: [\n      { name: 'Revolutions per minute (rpm)', id: 'rotrpm', fn: toFixedUnit('rpm') },\n      { name: 'Hertz (Hz)', id: 'rothz', fn: SIPrefix('Hz') },\n      { name: 'Radians per second (rad/s)', id: 'rotrads', fn: toFixedUnit('rad/s') },\n      { name: 'Degrees per second (°/s)', id: 'rotdegs', fn: toFixedUnit('°/s') },\n    ],\n  },\n  {\n    name: 'Temperature',\n    formats: [\n      { name: 'Celsius (°C)', id: 'celsius', fn: toFixedUnit('°C') },\n      { name: 'Fahrenheit (°F)', id: 'fahrenheit', fn: toFixedUnit('°F') },\n      { name: 'Kelvin (K)', id: 'kelvin', fn: toFixedUnit('K') },\n    ],\n  },\n  {\n    name: 'Time',\n    formats: [\n      { name: 'Hertz (1/s)', id: 'hertz', fn: SIPrefix('Hz') },\n      { name: 'nanoseconds (ns)', id: 'ns', fn: toNanoSeconds },\n      { name: 'microseconds (µs)', id: 'µs', fn: toMicroSeconds },\n      { name: 'milliseconds (ms)', id: 'ms', fn: toMilliSeconds },\n      { name: 'seconds (s)', id: 's', fn: toSeconds },\n      { name: 'minutes (m)', id: 'm', fn: toMinutes },\n      { name: 'hours (h)', id: 'h', fn: toHours },\n      { name: 'days (d)', id: 'd', fn: toDays },\n      { name: 'duration (ms)', id: 'dtdurationms', fn: toDurationInMilliseconds },\n      { name: 'duration (s)', id: 'dtdurations', fn: toDurationInSeconds },\n      { name: 'duration (hh:mm:ss)', id: 'dthms', fn: toDurationInHoursMinutesSeconds },\n      { name: 'duration (d hh:mm:ss)', id: 'dtdhms', fn: toDurationInDaysHoursMinutesSeconds },\n      { name: 'Timeticks (s/100)', id: 'timeticks', fn: toTimeTicks },\n      { name: 'clock (ms)', id: 'clockms', fn: toClockMilliseconds },\n      { name: 'clock (s)', id: 'clocks', fn: toClockSeconds },\n    ],\n  },\n  {\n    name: 'Throughput',\n    formats: [\n      { name: 'counts/sec (cps)', id: 'cps', fn: simpleCountUnit('c/s') },\n      { name: 'ops/sec (ops)', id: 'ops', fn: simpleCountUnit('ops/s') },\n      { name: 'requests/sec (rps)', id: 'reqps', fn: simpleCountUnit('req/s') },\n      { name: 'reads/sec (rps)', id: 'rps', fn: simpleCountUnit('rd/s') },\n      { name: 'writes/sec (wps)', id: 'wps', fn: simpleCountUnit('wr/s') },\n      { name: 'I/O ops/sec (iops)', id: 'iops', fn: simpleCountUnit('io/s') },\n      { name: 'counts/min (cpm)', id: 'cpm', fn: simpleCountUnit('c/m') },\n      { name: 'ops/min (opm)', id: 'opm', fn: simpleCountUnit('ops/m') },\n      { name: 'reads/min (rpm)', id: 'rpm', fn: simpleCountUnit('rd/m') },\n      { name: 'writes/min (wpm)', id: 'wpm', fn: simpleCountUnit('wr/m') },\n    ],\n  },\n  {\n    name: 'Velocity',\n    formats: [\n      { name: 'meters/second (m/s)', id: 'velocityms', fn: toFixedUnit('m/s') },\n      { name: 'kilometers/hour (km/h)', id: 'velocitykmh', fn: toFixedUnit('km/h') },\n      { name: 'miles/hour (mph)', id: 'velocitymph', fn: toFixedUnit('mph') },\n      { name: 'knot (kn)', id: 'velocityknot', fn: toFixedUnit('kn') },\n    ],\n  },\n  {\n    name: 'Volume',\n    formats: [\n      { name: 'millilitre (mL)', id: 'mlitre', fn: SIPrefix('L', -1) },\n      { name: 'litre (L)', id: 'litre', fn: SIPrefix('L') },\n      { name: 'cubic meter', id: 'm3', fn: toFixedUnit('m³') },\n      { name: 'Normal cubic meter', id: 'Nm3', fn: toFixedUnit('Nm³') },\n      { name: 'cubic decimeter', id: 'dm3', fn: toFixedUnit('dm³') },\n      { name: 'gallons', id: 'gallons', fn: toFixedUnit('gal') },\n    ],\n  },\n  {\n    name: 'Boolean',\n    formats: [\n      { name: 'True / False', id: 'bool', fn: booleanValueFormatter('True', 'False') },\n      { name: 'Yes / No', id: 'bool_yes_no', fn: booleanValueFormatter('Yes', 'No') },\n      { name: 'On / Off', id: 'bool_on_off', fn: booleanValueFormatter('On', 'Off') },\n    ],\n  },\n];\n","import { dateTimeFormat, dateTimeFormatTimeAgo, localTimeFormat, systemDateFormats } from '../datetime';\nimport { toDuration as duration, toUtc, dateTime } from '../datetime/moment_wrapper';\nimport { TimeZone } from '../types';\nimport { DecimalCount } from '../types/displayValue';\n\nimport { toFixed, toFixedScaled, FormattedValue, ValueFormatter } from './valueFormats';\n\ninterface IntervalsInSeconds {\n  [interval: string]: number;\n}\n\nexport enum Interval {\n  Year = 'year',\n  Month = 'month',\n  Week = 'week',\n  Day = 'day',\n  Hour = 'hour',\n  Minute = 'minute',\n  Second = 'second',\n  Millisecond = 'millisecond',\n}\n\nconst UNITS = [\n  Interval.Year,\n  Interval.Month,\n  Interval.Week,\n  Interval.Day,\n  Interval.Hour,\n  Interval.Minute,\n  Interval.Second,\n  Interval.Millisecond,\n];\n\nconst INTERVALS_IN_SECONDS: IntervalsInSeconds = {\n  [Interval.Year]: 31536000,\n  [Interval.Month]: 2592000,\n  [Interval.Week]: 604800,\n  [Interval.Day]: 86400,\n  [Interval.Hour]: 3600,\n  [Interval.Minute]: 60,\n  [Interval.Second]: 1,\n  [Interval.Millisecond]: 0.001,\n};\n\nexport function toNanoSeconds(size: number, decimals?: DecimalCount): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n\n  if (Math.abs(size) < 1000) {\n    return { text: toFixed(size, decimals), suffix: ' ns' };\n  } else if (Math.abs(size) < 1000000) {\n    return toFixedScaled(size / 1000, decimals, ' µs');\n  } else if (Math.abs(size) < 1000000000) {\n    return toFixedScaled(size / 1000000, decimals, ' ms');\n  } else if (Math.abs(size) < 60000000000) {\n    return toFixedScaled(size / 1000000000, decimals, ' s');\n  } else if (Math.abs(size) < 3600000000000) {\n    return toFixedScaled(size / 60000000000, decimals, ' min');\n  } else if (Math.abs(size) < 86400000000000) {\n    return toFixedScaled(size / 3600000000000, decimals, ' hour');\n  } else {\n    return toFixedScaled(size / 86400000000000, decimals, ' day');\n  }\n}\n\nexport function toMicroSeconds(size: number, decimals?: DecimalCount): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n\n  if (Math.abs(size) < 1000) {\n    return { text: toFixed(size, decimals), suffix: ' µs' };\n  } else if (Math.abs(size) < 1000000) {\n    return toFixedScaled(size / 1000, decimals, ' ms');\n  } else {\n    return toFixedScaled(size / 1000000, decimals, ' s');\n  }\n}\n\nexport function toMilliSeconds(size: number, decimals?: DecimalCount, scaledDecimals?: DecimalCount): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n\n  if (Math.abs(size) < 1000) {\n    return { text: toFixed(size, decimals), suffix: ' ms' };\n  } else if (Math.abs(size) < 60000) {\n    // Less than 1 min\n    return toFixedScaled(size / 1000, decimals, ' s');\n  } else if (Math.abs(size) < 3600000) {\n    // Less than 1 hour, divide in minutes\n    return toFixedScaled(size / 60000, decimals, ' min');\n  } else if (Math.abs(size) < 86400000) {\n    // Less than one day, divide in hours\n    return toFixedScaled(size / 3600000, decimals, ' hour');\n  } else if (Math.abs(size) < 31536000000) {\n    // Less than one year, divide in days\n    return toFixedScaled(size / 86400000, decimals, ' day');\n  }\n\n  return toFixedScaled(size / 31536000000, decimals, ' year');\n}\n\nexport function trySubstract(value1: DecimalCount, value2: DecimalCount): DecimalCount {\n  if (value1 !== null && value1 !== undefined && value2 !== null && value2 !== undefined) {\n    return value1 - value2;\n  }\n  return undefined;\n}\n\nexport function toSeconds(size: number, decimals?: DecimalCount): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n\n  // If 0, use s unit instead of ns\n  if (size === 0) {\n    return { text: '0', suffix: ' s' };\n  }\n\n  // Less than 1 µs, divide in ns\n  if (Math.abs(size) < 0.000001) {\n    return toFixedScaled(size * 1e9, decimals, ' ns');\n  }\n  // Less than 1 ms, divide in µs\n  if (Math.abs(size) < 0.001) {\n    return toFixedScaled(size * 1e6, decimals, ' µs');\n  }\n  // Less than 1 second, divide in ms\n  if (Math.abs(size) < 1) {\n    return toFixedScaled(size * 1e3, decimals, ' ms');\n  }\n\n  if (Math.abs(size) < 60) {\n    return { text: toFixed(size, decimals), suffix: ' s' };\n  } else if (Math.abs(size) < 3600) {\n    // Less than 1 hour, divide in minutes\n    return toFixedScaled(size / 60, decimals, ' min');\n  } else if (Math.abs(size) < 86400) {\n    // Less than one day, divide in hours\n    return toFixedScaled(size / 3600, decimals, ' hour');\n  } else if (Math.abs(size) < 604800) {\n    // Less than one week, divide in days\n    return toFixedScaled(size / 86400, decimals, ' day');\n  } else if (Math.abs(size) < 31536000) {\n    // Less than one year, divide in week\n    return toFixedScaled(size / 604800, decimals, ' week');\n  }\n\n  return toFixedScaled(size / 3.15569e7, decimals, ' year');\n}\n\nexport function toMinutes(size: number, decimals?: DecimalCount): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n\n  if (Math.abs(size) < 60) {\n    return { text: toFixed(size, decimals), suffix: ' min' };\n  } else if (Math.abs(size) < 1440) {\n    return toFixedScaled(size / 60, decimals, ' hour');\n  } else if (Math.abs(size) < 10080) {\n    return toFixedScaled(size / 1440, decimals, ' day');\n  } else if (Math.abs(size) < 604800) {\n    return toFixedScaled(size / 10080, decimals, ' week');\n  } else {\n    return toFixedScaled(size / 5.25948e5, decimals, ' year');\n  }\n}\n\nexport function toHours(size: number, decimals?: DecimalCount): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n\n  if (Math.abs(size) < 24) {\n    return { text: toFixed(size, decimals), suffix: ' hour' };\n  } else if (Math.abs(size) < 168) {\n    return toFixedScaled(size / 24, decimals, ' day');\n  } else if (Math.abs(size) < 8760) {\n    return toFixedScaled(size / 168, decimals, ' week');\n  } else {\n    return toFixedScaled(size / 8760, decimals, ' year');\n  }\n}\n\nexport function toDays(size: number, decimals?: DecimalCount): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n\n  if (Math.abs(size) < 7) {\n    return { text: toFixed(size, decimals), suffix: ' day' };\n  } else if (Math.abs(size) < 365) {\n    return toFixedScaled(size / 7, decimals, ' week');\n  } else {\n    return toFixedScaled(size / 365, decimals, ' year');\n  }\n}\n\nexport function toDuration(size: number, decimals: DecimalCount, timeScale: Interval): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n\n  if (size === 0) {\n    return { text: '0', suffix: ' ' + timeScale + 's' };\n  }\n\n  if (size < 0) {\n    const v = toDuration(-size, decimals, timeScale);\n    if (!v.suffix) {\n      v.suffix = '';\n    }\n    v.suffix += ' ago';\n    return v;\n  }\n\n  // convert $size to milliseconds\n  // intervals_in_seconds uses seconds (duh), convert them to milliseconds here to minimize floating point errors\n  size *= INTERVALS_IN_SECONDS[timeScale] * 1000;\n\n  const strings = [];\n\n  // after first value >= 1 print only $decimals more\n  let decrementDecimals = false;\n  let decimalsCount = 0;\n\n  if (decimals !== null && decimals !== undefined) {\n    decimalsCount = decimals as number;\n  }\n\n  for (let i = 0; i < UNITS.length && decimalsCount >= 0; i++) {\n    const interval = INTERVALS_IN_SECONDS[UNITS[i]] * 1000;\n    const value = size / interval;\n    if (value >= 1 || decrementDecimals) {\n      decrementDecimals = true;\n      const floor = Math.floor(value);\n      const unit = UNITS[i] + (floor !== 1 ? 's' : '');\n      strings.push(floor + ' ' + unit);\n      size = size % interval;\n      decimalsCount--;\n    }\n  }\n\n  return { text: strings.join(', ') };\n}\n\nexport function toClock(size: number, decimals?: DecimalCount): FormattedValue {\n  if (size === null) {\n    return { text: '' };\n  }\n\n  // < 1 second\n  if (size < 1000) {\n    return {\n      text: toUtc(size).format('SSS\\\\m\\\\s'),\n    };\n  }\n\n  // < 1 minute\n  if (size < 60000) {\n    let format = 'ss\\\\s:SSS\\\\m\\\\s';\n    if (decimals === 0) {\n      format = 'ss\\\\s';\n    }\n    return { text: toUtc(size).format(format) };\n  }\n\n  // < 1 hour\n  if (size < 3600000) {\n    let format = 'mm\\\\m:ss\\\\s:SSS\\\\m\\\\s';\n    if (decimals === 0) {\n      format = 'mm\\\\m';\n    } else if (decimals === 1) {\n      format = 'mm\\\\m:ss\\\\s';\n    }\n    return { text: toUtc(size).format(format) };\n  }\n\n  let format = 'mm\\\\m:ss\\\\s:SSS\\\\m\\\\s';\n\n  const hours = `${('0' + Math.floor(duration(size, 'milliseconds').asHours())).slice(-2)}h`;\n\n  if (decimals === 0) {\n    format = '';\n  } else if (decimals === 1) {\n    format = 'mm\\\\m';\n  } else if (decimals === 2) {\n    format = 'mm\\\\m:ss\\\\s';\n  }\n\n  const text = format ? `${hours}:${toUtc(size).format(format)}` : hours;\n  return { text };\n}\n\nexport function toDurationInMilliseconds(size: number, decimals: DecimalCount): FormattedValue {\n  return toDuration(size, decimals, Interval.Millisecond);\n}\n\nexport function toDurationInSeconds(size: number, decimals: DecimalCount): FormattedValue {\n  return toDuration(size, decimals, Interval.Second);\n}\n\nexport function toDurationInHoursMinutesSeconds(size: number): FormattedValue {\n  if (size < 0) {\n    const v = toDurationInHoursMinutesSeconds(-size);\n    if (!v.suffix) {\n      v.suffix = '';\n    }\n    v.suffix += ' ago';\n    return v;\n  }\n  const strings = [];\n  const numHours = Math.floor(size / 3600);\n  const numMinutes = Math.floor((size % 3600) / 60);\n  const numSeconds = Math.floor((size % 3600) % 60);\n  numHours > 9 ? strings.push('' + numHours) : strings.push('0' + numHours);\n  numMinutes > 9 ? strings.push('' + numMinutes) : strings.push('0' + numMinutes);\n  numSeconds > 9 ? strings.push('' + numSeconds) : strings.push('0' + numSeconds);\n  return { text: strings.join(':') };\n}\n\nexport function toDurationInDaysHoursMinutesSeconds(size: number): FormattedValue {\n  if (size < 0) {\n    const v = toDurationInDaysHoursMinutesSeconds(-size);\n    if (!v.suffix) {\n      v.suffix = '';\n    }\n    v.suffix += ' ago';\n    return v;\n  }\n  let dayString = '';\n  const numDays = Math.floor(size / (24 * 3600));\n  if (numDays > 0) {\n    dayString = numDays + ' d ';\n  }\n  const hmsString = toDurationInHoursMinutesSeconds(size - numDays * 24 * 3600);\n  return { text: dayString + hmsString.text };\n}\n\nexport function toTimeTicks(size: number, decimals: DecimalCount): FormattedValue {\n  return toSeconds(size / 100, decimals);\n}\n\nexport function toClockMilliseconds(size: number, decimals: DecimalCount): FormattedValue {\n  return toClock(size, decimals);\n}\n\nexport function toClockSeconds(size: number, decimals: DecimalCount): FormattedValue {\n  return toClock(size * 1000, decimals);\n}\n\nexport function toDateTimeValueFormatter(pattern: string, todayPattern?: string): ValueFormatter {\n  return (value: number, decimals: DecimalCount, scaledDecimals: DecimalCount, timeZone?: TimeZone): FormattedValue => {\n    if (todayPattern) {\n      if (dateTime().isSame(value, 'day')) {\n        return {\n          text: dateTimeFormat(value, { format: todayPattern, timeZone }),\n        };\n      }\n    }\n    return { text: dateTimeFormat(value, { format: pattern, timeZone }) };\n  };\n}\n\nexport const dateTimeAsIso = toDateTimeValueFormatter('YYYY-MM-DD HH:mm:ss');\nexport const dateTimeAsIsoNoDateIfToday = toDateTimeValueFormatter('YYYY-MM-DD HH:mm:ss', 'HH:mm:ss');\nexport const dateTimeAsUS = toDateTimeValueFormatter('MM/DD/YYYY h:mm:ss a');\nexport const dateTimeAsUSNoDateIfToday = toDateTimeValueFormatter('MM/DD/YYYY h:mm:ss a', 'h:mm:ss a');\n\nexport function getDateTimeAsLocalFormat() {\n  return toDateTimeValueFormatter(\n    localTimeFormat({\n      year: 'numeric',\n      month: '2-digit',\n      day: '2-digit',\n      hour: '2-digit',\n      minute: '2-digit',\n      second: '2-digit',\n    })\n  );\n}\n\nexport function getDateTimeAsLocalFormatNoDateIfToday() {\n  return toDateTimeValueFormatter(\n    localTimeFormat({\n      year: 'numeric',\n      month: '2-digit',\n      day: '2-digit',\n      hour: '2-digit',\n      minute: '2-digit',\n      second: '2-digit',\n    }),\n    localTimeFormat({\n      hour: '2-digit',\n      minute: '2-digit',\n      second: '2-digit',\n    })\n  );\n}\n\nexport function dateTimeSystemFormatter(\n  value: number,\n  decimals: DecimalCount,\n  scaledDecimals: DecimalCount,\n  timeZone?: TimeZone,\n  showMs?: boolean\n): FormattedValue {\n  return {\n    text: dateTimeFormat(value, {\n      format: showMs ? systemDateFormats.fullDateMS : systemDateFormats.fullDate,\n      timeZone,\n    }),\n  };\n}\n\nexport function dateTimeFromNow(\n  value: number,\n  decimals: DecimalCount,\n  scaledDecimals: DecimalCount,\n  timeZone?: TimeZone\n): FormattedValue {\n  return { text: dateTimeFormatTimeAgo(value, { timeZone }) };\n}\n","import { DecimalCount } from '../types/displayValue';\n\nimport { scaledUnits, ValueFormatter } from './valueFormats';\n\nexport function currency(symbol: string, asSuffix?: boolean): ValueFormatter {\n  const units = ['', 'K', 'M', 'B', 'T'];\n  const scaler = scaledUnits(1000, units);\n  return (size: number, decimals?: DecimalCount, scaledDecimals?: DecimalCount) => {\n    if (size === null) {\n      return { text: '' };\n    }\n    const scaled = scaler(size, decimals, scaledDecimals);\n    if (asSuffix) {\n      scaled.suffix = scaled.suffix !== undefined ? `${scaled.suffix}${symbol}` : undefined;\n    } else {\n      scaled.prefix = symbol;\n    }\n    return scaled;\n  };\n}\n\nconst SI_PREFIXES = ['f', 'p', 'n', 'µ', 'm', '', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];\nconst SI_BASE_INDEX = SI_PREFIXES.indexOf('');\n\nexport function getOffsetFromSIPrefix(c: string): number {\n  const charIndex = SI_PREFIXES.findIndex((prefix) => prefix.normalize('NFKD') === c.normalize('NFKD'));\n  return charIndex < 0 ? 0 : charIndex - SI_BASE_INDEX;\n}\n\nconst BIN_PREFIXES = ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'];\n\nexport function binaryPrefix(unit: string, offset = 0): ValueFormatter {\n  const units = BIN_PREFIXES.map((p) => ' ' + p + unit);\n  return scaledUnits(1024, units, offset);\n}\n\nexport function SIPrefix(unit: string, offset = 0): ValueFormatter {\n  const units = SI_PREFIXES.map((p) => ' ' + p + unit);\n  return scaledUnits(1000, units, SI_BASE_INDEX + offset);\n}\n","import { MutableVector } from '../types/vector';\n\nimport { FunctionalVector } from './FunctionalVector';\n\n/**\n * @public\n */\nexport class ArrayVector<T = any> extends FunctionalVector<T> implements MutableVector<T> {\n  buffer: T[];\n\n  constructor(buffer?: T[]) {\n    super();\n    this.buffer = buffer ? buffer : [];\n  }\n\n  get length() {\n    return this.buffer.length;\n  }\n\n  add(value: T) {\n    this.buffer.push(value);\n  }\n\n  get(index: number): T {\n    return this.buffer[index];\n  }\n\n  set(index: number, value: T) {\n    this.buffer[index] = value;\n  }\n\n  reverse() {\n    this.buffer.reverse();\n  }\n\n  toArray(): T[] {\n    return this.buffer;\n  }\n\n  toJSON(): T[] {\n    return this.buffer;\n  }\n}\n","import { Vector } from '../types';\n\nimport { FunctionalVector } from './FunctionalVector';\n\n/**\n * This will force all values to be numbers\n *\n * @public\n */\nexport class AsNumberVector extends FunctionalVector<number> {\n  constructor(private field: Vector) {\n    super();\n  }\n\n  get length() {\n    return this.field.length;\n  }\n\n  get(index: number) {\n    return +this.field.get(index);\n  }\n}\n","import { Vector } from '../types/vector';\nimport { BinaryOperation } from '../utils/binaryOperators';\n\nimport { vectorToArray } from './vectorToArray';\n\n/**\n * @public\n */\nexport class BinaryOperationVector implements Vector<number> {\n  constructor(private left: Vector<number>, private right: Vector<number>, private operation: BinaryOperation) {}\n\n  get length(): number {\n    return this.left.length;\n  }\n\n  get(index: number): number {\n    return this.operation(this.left.get(index), this.right.get(index));\n  }\n\n  toArray(): number[] {\n    return vectorToArray(this);\n  }\n\n  toJSON(): number[] {\n    return vectorToArray(this);\n  }\n}\n","import { Vector } from '../types/vector';\n\n/**\n * @public\n */\nexport class ConstantVector<T = any> implements Vector<T> {\n  constructor(private value: T, private len: number) {}\n\n  get length() {\n    return this.len;\n  }\n\n  get(index: number): T {\n    return this.value;\n  }\n\n  toArray(): T[] {\n    const arr = new Array<T>(this.length);\n    return arr.fill(this.value);\n  }\n\n  toJSON(): T[] {\n    return this.toArray();\n  }\n}\n","import { Vector } from '../types';\n\nimport { vectorToArray } from './vectorToArray';\n\n/**\n * RowVector makes the row values look like a vector\n * @internal\n */\nexport class RowVector implements Vector {\n  constructor(private columns: Vector[]) {}\n\n  rowIndex = 0;\n\n  get length(): number {\n    return this.columns.length;\n  }\n\n  get(index: number): number {\n    return this.columns[index].get(this.rowIndex);\n  }\n\n  toArray(): number[] {\n    return vectorToArray(this);\n  }\n\n  toJSON(): number[] {\n    return vectorToArray(this);\n  }\n}\n","import { Vector } from '../types/vector';\n\nimport { vectorToArray } from './vectorToArray';\n\n/**\n * Values are returned in the order defined by the input parameter\n */\nexport class SortedVector<T = any> implements Vector<T> {\n  constructor(private source: Vector<T>, private order: number[]) {}\n\n  get length(): number {\n    return this.source.length;\n  }\n\n  get(index: number): T {\n    return this.source.get(this.order[index]);\n  }\n\n  toArray(): T[] {\n    return vectorToArray(this);\n  }\n\n  toJSON(): T[] {\n    return vectorToArray(this);\n  }\n}\n","import { Vector } from '../types/vector';\n\nexport function vectorToArray<T>(v: Vector<T>): T[] {\n  const arr: T[] = Array(v.length);\n  for (let i = 0; i < v.length; i++) {\n    arr[i] = v.get(i);\n  }\n  return arr;\n}\n","import { DataQueryError } from '@grafana/data';\n\n/**\n * Convert an object into a DataQueryError -- if this is an HTTP response,\n * it will put the correct values in the error field\n *\n * @public\n */\nexport function toDataQueryError(err: DataQueryError | string | Object): DataQueryError {\n  const error = (err || {}) as DataQueryError;\n\n  if (!error.message) {\n    if (typeof err === 'string' || err instanceof String) {\n      return { message: err } as DataQueryError;\n    }\n\n    let message = 'Query error';\n    if (error.message) {\n      message = error.message;\n    } else if (error.data && error.data.message && error.data?.message !== 'Query data error') {\n      message = error.data.message;\n    } else if (error?.data?.message === 'Query data error' && error?.data?.error) {\n      message = error.data.error;\n    } else if (error.data && error.data.error) {\n      message = error.data.error;\n    } else if (error.status) {\n      message = `Query error: ${error.status} ${error.statusText}`;\n    }\n    error.message = message;\n  }\n\n  return error;\n}\n","let cachedToken = '';\n\nexport const loadUrlToken = (): string | null => {\n  const params = new URLSearchParams(window.location.search);\n\n  const token = params.get('auth_token');\n  if (token !== null && token !== '') {\n    cachedToken = token;\n    return token;\n  }\n\n  return cachedToken;\n};\n","import { map, Observable, ReplaySubject, Subject, Subscriber, Subscription } from 'rxjs';\n\nimport {\n  DataFrameJSON,\n  DataQueryError,\n  Field,\n  isLiveChannelMessageEvent,\n  isLiveChannelStatusEvent,\n  LiveChannelConnectionState,\n  LiveChannelEvent,\n  LiveChannelId,\n  LoadingState,\n} from '@grafana/data';\nimport { LiveDataStreamOptions, StreamingFrameAction, StreamingFrameOptions } from '@grafana/runtime/src/services/live';\nimport { toDataQueryError } from '@grafana/runtime/src/utils/toDataQueryError';\n\nimport { getStreamingFrameOptions, StreamingDataFrame } from '../data/StreamingDataFrame';\nimport { StreamingResponseDataType } from '../data/utils';\n\nimport { DataStreamSubscriptionKey, StreamingDataQueryResponse } from './service';\n\nconst bufferIfNot =\n  (canEmitObservable: Observable<boolean>) =>\n  <T>(source: Observable<T>): Observable<T[]> => {\n    return new Observable((subscriber: Subscriber<T[]>) => {\n      let buffer: T[] = [];\n      let canEmit = true;\n\n      const emitBuffer = () => {\n        subscriber.next(buffer);\n        buffer = [];\n      };\n\n      const canEmitSub = canEmitObservable.subscribe({\n        next: (val) => {\n          canEmit = val;\n\n          if (canEmit && buffer.length) {\n            emitBuffer();\n          }\n        },\n      });\n\n      const sourceSub = source.subscribe({\n        next(value) {\n          if (canEmit) {\n            if (!buffer.length) {\n              subscriber.next([value]);\n            } else {\n              emitBuffer();\n            }\n          } else {\n            buffer.push(value);\n          }\n        },\n        error(error) {\n          subscriber.error(error);\n        },\n        complete() {\n          subscriber.complete();\n        },\n      });\n\n      return () => {\n        sourceSub.unsubscribe();\n        canEmitSub.unsubscribe();\n      };\n    });\n  };\n\nexport type DataStreamHandlerDeps<T> = {\n  channelId: LiveChannelId;\n  liveEventsObservable: Observable<LiveChannelEvent<T>>;\n  onShutdown: () => void;\n  subscriberReadiness: Observable<boolean>;\n  defaultStreamingFrameOptions: Readonly<StreamingFrameOptions>;\n  shutdownDelayInMs: number;\n};\n\nenum InternalStreamMessageType {\n  Error,\n  NewValuesSameSchema,\n  ChangedSchema,\n}\n\ntype InternalStreamMessageTypeToData = {\n  [InternalStreamMessageType.Error]: {\n    error: DataQueryError;\n  };\n  [InternalStreamMessageType.ChangedSchema]: {};\n  [InternalStreamMessageType.NewValuesSameSchema]: {\n    values: unknown[][];\n  };\n};\n\ntype InternalStreamMessage<T = InternalStreamMessageType> = T extends InternalStreamMessageType\n  ? {\n      type: T;\n    } & InternalStreamMessageTypeToData[T]\n  : never;\n\nconst reduceNewValuesSameSchemaMessages = (\n  packets: Array<InternalStreamMessage<InternalStreamMessageType.NewValuesSameSchema>>\n) => ({\n  values: packets.reduce((acc, { values }) => {\n    for (let i = 0; i < values.length; i++) {\n      if (!acc[i]) {\n        acc[i] = [];\n      }\n      for (let j = 0; j < values[i].length; j++) {\n        acc[i].push(values[i][j]);\n      }\n    }\n    return acc;\n  }, [] as unknown[][]),\n  type: InternalStreamMessageType.NewValuesSameSchema,\n});\n\nconst filterMessages = <T extends InternalStreamMessageType>(\n  packets: InternalStreamMessage[],\n  type: T\n): Array<InternalStreamMessage<T>> => packets.filter((p) => p.type === type) as Array<InternalStreamMessage<T>>;\n\nexport class LiveDataStream<T = unknown> {\n  private frameBuffer: StreamingDataFrame;\n  private liveEventsSubscription: Subscription;\n  private stream: Subject<InternalStreamMessage> = new ReplaySubject(1);\n  private shutdownTimeoutId: ReturnType<typeof setTimeout> | undefined;\n\n  constructor(private deps: DataStreamHandlerDeps<T>) {\n    this.frameBuffer = StreamingDataFrame.empty(deps.defaultStreamingFrameOptions);\n    this.liveEventsSubscription = deps.liveEventsObservable.subscribe({\n      error: this.onError,\n      complete: this.onComplete,\n      next: this.onNext,\n    });\n  }\n\n  private shutdown = () => {\n    this.stream.complete();\n    this.liveEventsSubscription.unsubscribe();\n    this.deps.onShutdown();\n  };\n\n  private shutdownIfNoSubscribers = () => {\n    if (!this.stream.observed) {\n      this.shutdown();\n    }\n  };\n\n  private onError = (err: any) => {\n    console.log('LiveQuery [error]', { err }, this.deps.channelId);\n    this.stream.next({\n      type: InternalStreamMessageType.Error,\n      error: toDataQueryError(err),\n    });\n    this.shutdown();\n  };\n\n  private onComplete = () => {\n    console.log('LiveQuery [complete]', this.deps.channelId);\n    this.shutdown();\n  };\n\n  private onNext = (evt: LiveChannelEvent) => {\n    if (isLiveChannelMessageEvent(evt)) {\n      this.process(evt.message);\n      return;\n    }\n\n    const liveChannelStatusEvent = isLiveChannelStatusEvent(evt);\n    if (liveChannelStatusEvent && evt.error) {\n      this.stream.next({\n        type: InternalStreamMessageType.Error,\n        error: {\n          ...toDataQueryError(evt.error),\n          message: `Streaming channel error: ${evt.error.message}`,\n        },\n      });\n      return;\n    }\n\n    if (\n      liveChannelStatusEvent &&\n      (evt.state === LiveChannelConnectionState.Connected || evt.state === LiveChannelConnectionState.Pending) &&\n      evt.message\n    ) {\n      this.process(evt.message);\n    }\n  };\n\n  private process = (msg: DataFrameJSON) => {\n    const packetInfo = this.frameBuffer.push(msg);\n\n    if (packetInfo.schemaChanged) {\n      this.stream.next({\n        type: InternalStreamMessageType.ChangedSchema,\n      });\n    } else {\n      this.stream.next({\n        type: InternalStreamMessageType.NewValuesSameSchema,\n        values: this.frameBuffer.getValuesFromLastPacket(),\n      });\n    }\n  };\n\n  private resizeBuffer = (bufferOptions: StreamingFrameOptions) => {\n    if (bufferOptions && this.frameBuffer.needsResizing(bufferOptions)) {\n      this.frameBuffer.resize(bufferOptions);\n    }\n  };\n\n  private prepareInternalStreamForNewSubscription = (options: LiveDataStreamOptions): void => {\n    if (!this.frameBuffer.hasAtLeastOnePacket() && options.frame) {\n      // will skip initial frames from subsequent subscribers\n      this.process(options.frame);\n    }\n  };\n\n  private clearShutdownTimeout = () => {\n    if (this.shutdownTimeoutId) {\n      clearTimeout(this.shutdownTimeoutId);\n      this.shutdownTimeoutId = undefined;\n    }\n  };\n\n  get = (options: LiveDataStreamOptions, subKey: DataStreamSubscriptionKey): Observable<StreamingDataQueryResponse> => {\n    this.clearShutdownTimeout();\n    const buffer = getStreamingFrameOptions(options.buffer);\n\n    this.resizeBuffer(buffer);\n    this.prepareInternalStreamForNewSubscription(options);\n\n    const shouldSendLastPacketOnly = options?.buffer?.action === StreamingFrameAction.Replace;\n    const fieldsNamesFilter = options.filter?.fields;\n    const dataNeedsFiltering = fieldsNamesFilter?.length;\n    const fieldFilterPredicate = dataNeedsFiltering ? ({ name }: Field) => fieldsNamesFilter.includes(name) : undefined;\n    let matchingFieldIndexes: number[] | undefined = undefined;\n\n    const getFullFrameResponseData = <T>(\n      messages: InternalStreamMessage[],\n      error?: DataQueryError\n    ): StreamingDataQueryResponse => {\n      matchingFieldIndexes = fieldFilterPredicate\n        ? this.frameBuffer.getMatchingFieldIndexes(fieldFilterPredicate)\n        : undefined;\n\n      if (!shouldSendLastPacketOnly) {\n        return {\n          key: subKey,\n          state: error ? LoadingState.Error : LoadingState.Streaming,\n          data: [\n            {\n              type: StreamingResponseDataType.FullFrame,\n              frame: this.frameBuffer.serialize(fieldFilterPredicate, buffer),\n            },\n          ],\n          error,\n        };\n      }\n\n      if (error) {\n        // send empty frame with error\n        return {\n          key: subKey,\n          state: LoadingState.Error,\n          data: [\n            {\n              type: StreamingResponseDataType.FullFrame,\n              frame: this.frameBuffer.serialize(fieldFilterPredicate, buffer, { maxLength: 0 }),\n            },\n          ],\n          error,\n        };\n      }\n\n      if (!messages.length) {\n        console.warn(`expected to find at least one non error message ${messages.map(({ type }) => type)}`);\n        // send empty frame\n        return {\n          key: subKey,\n          state: LoadingState.Streaming,\n          data: [\n            {\n              type: StreamingResponseDataType.FullFrame,\n              frame: this.frameBuffer.serialize(fieldFilterPredicate, buffer, { maxLength: 0 }),\n            },\n          ],\n          error,\n        };\n      }\n\n      return {\n        key: subKey,\n        state: LoadingState.Streaming,\n        data: [\n          {\n            type: StreamingResponseDataType.FullFrame,\n            frame: this.frameBuffer.serialize(fieldFilterPredicate, buffer, {\n              maxLength: this.frameBuffer.packetInfo.length,\n            }),\n          },\n        ],\n        error,\n      };\n    };\n\n    const getNewValuesSameSchemaResponseData = (\n      messages: Array<InternalStreamMessage<InternalStreamMessageType.NewValuesSameSchema>>\n    ): StreamingDataQueryResponse => {\n      const lastMessage = messages.length ? messages[messages.length - 1] : undefined;\n      const values =\n        shouldSendLastPacketOnly && lastMessage\n          ? lastMessage.values\n          : reduceNewValuesSameSchemaMessages(messages).values;\n\n      const filteredValues = matchingFieldIndexes\n        ? values.filter((v, i) => (matchingFieldIndexes as number[]).includes(i))\n        : values;\n\n      return {\n        key: subKey,\n        state: LoadingState.Streaming,\n        data: [\n          {\n            type: StreamingResponseDataType.NewValuesSameSchema,\n            values: filteredValues,\n          },\n        ],\n      };\n    };\n\n    let shouldSendFullFrame = true;\n    const transformedInternalStream = this.stream.pipe(\n      bufferIfNot(this.deps.subscriberReadiness),\n      map((messages, i) => {\n        const errors = filterMessages(messages, InternalStreamMessageType.Error);\n        const lastError = errors.length ? errors[errors.length - 1].error : undefined;\n\n        if (shouldSendFullFrame) {\n          shouldSendFullFrame = false;\n          return getFullFrameResponseData(messages, lastError);\n        }\n\n        if (errors.length) {\n          // send the latest frame with the last error, discard everything else\n          return getFullFrameResponseData(messages, lastError);\n        }\n\n        const schemaChanged = messages.some((n) => n.type === InternalStreamMessageType.ChangedSchema);\n        if (schemaChanged) {\n          // send the latest frame, discard intermediate appends\n          return getFullFrameResponseData(messages, undefined);\n        }\n\n        const newValueSameSchemaMessages = filterMessages(messages, InternalStreamMessageType.NewValuesSameSchema);\n        if (newValueSameSchemaMessages.length !== messages.length) {\n          console.warn(`unsupported message type ${messages.map(({ type }) => type)}`);\n        }\n\n        return getNewValuesSameSchemaResponseData(newValueSameSchemaMessages);\n      })\n    );\n\n    return new Observable<StreamingDataQueryResponse>((subscriber) => {\n      const sub = transformedInternalStream.subscribe({\n        next: (n) => {\n          subscriber.next(n);\n        },\n        error: (err) => {\n          subscriber.error(err);\n        },\n        complete: () => {\n          subscriber.complete();\n        },\n      });\n\n      return () => {\n        // TODO: potentially resize (downsize) the buffer on unsubscribe\n        sub.unsubscribe();\n        if (!this.stream.observed) {\n          this.clearShutdownTimeout();\n          this.shutdownTimeoutId = setTimeout(this.shutdownIfNoSubscribers, this.deps.shutdownDelayInMs);\n        }\n      };\n    });\n  };\n}\n","import Centrifuge, {\n  JoinLeaveContext,\n  PublicationContext,\n  SubscribeErrorContext,\n  SubscribeSuccessContext,\n  SubscriptionEvents,\n  UnsubscribeContext,\n} from 'centrifuge/dist/centrifuge';\nimport { Subject, of, Observable } from 'rxjs';\n\nimport {\n  LiveChannelStatusEvent,\n  LiveChannelEvent,\n  LiveChannelEventType,\n  LiveChannelConnectionState,\n  LiveChannelPresenceStatus,\n  LiveChannelAddress,\n  DataFrameJSON,\n  isValidLiveChannelAddress,\n} from '@grafana/data';\n\n/**\n * Internal class that maps Centrifuge support to GrafanaLive\n */\nexport class CentrifugeLiveChannel<T = any> {\n  readonly currentStatus: LiveChannelStatusEvent;\n\n  readonly opened = Date.now();\n  readonly id: string;\n  readonly addr: LiveChannelAddress;\n\n  readonly stream = new Subject<LiveChannelEvent<T>>();\n\n  // Hold on to the last header with schema\n  lastMessageWithSchema?: DataFrameJSON;\n\n  subscription?: Centrifuge.Subscription;\n  shutdownCallback?: () => void;\n  initalized?: boolean;\n\n  constructor(id: string, addr: LiveChannelAddress) {\n    this.id = id;\n    this.addr = addr;\n    this.currentStatus = {\n      type: LiveChannelEventType.Status,\n      id,\n      timestamp: this.opened,\n      state: LiveChannelConnectionState.Pending,\n    };\n    if (!isValidLiveChannelAddress(addr)) {\n      this.currentStatus.state = LiveChannelConnectionState.Invalid;\n      this.currentStatus.error = 'invalid channel address';\n    }\n  }\n\n  // This should only be called when centrifuge is connected\n  initalize(): SubscriptionEvents {\n    if (this.initalized) {\n      throw new Error('Channel already initalized: ' + this.id);\n    }\n    this.initalized = true;\n\n    const events: SubscriptionEvents = {\n      // Called when a message is received from the socket\n      publish: (ctx: PublicationContext) => {\n        try {\n          if (ctx.data) {\n            if (ctx.data.schema) {\n              this.lastMessageWithSchema = ctx.data as DataFrameJSON;\n            }\n\n            this.stream.next({\n              type: LiveChannelEventType.Message,\n              message: ctx.data,\n            });\n          }\n\n          // Clear any error messages\n          if (this.currentStatus.error) {\n            this.currentStatus.timestamp = Date.now();\n            delete this.currentStatus.error;\n            this.sendStatus();\n          }\n        } catch (err) {\n          console.log('publish error', this.addr, err);\n          this.currentStatus.error = err;\n          this.currentStatus.timestamp = Date.now();\n          this.sendStatus();\n        }\n      },\n      error: (ctx: SubscribeErrorContext) => {\n        this.currentStatus.timestamp = Date.now();\n        this.currentStatus.error = ctx.message;\n        this.sendStatus();\n      },\n      subscribe: (ctx: SubscribeSuccessContext) => {\n        this.currentStatus.timestamp = Date.now();\n        this.currentStatus.state = LiveChannelConnectionState.Connected;\n        delete this.currentStatus.error;\n\n        if (ctx.data?.schema) {\n          this.lastMessageWithSchema = ctx.data as DataFrameJSON;\n        }\n\n        this.sendStatus(ctx.data);\n      },\n      unsubscribe: (ctx: UnsubscribeContext) => {\n        this.currentStatus.timestamp = Date.now();\n        this.currentStatus.state = LiveChannelConnectionState.Disconnected;\n        this.sendStatus();\n      },\n    };\n\n    events.join = (ctx: JoinLeaveContext) => {\n      this.stream.next({ type: LiveChannelEventType.Join, user: ctx.info.user });\n    };\n    events.leave = (ctx: JoinLeaveContext) => {\n      this.stream.next({ type: LiveChannelEventType.Leave, user: ctx.info.user });\n    };\n    return events;\n  }\n\n  private sendStatus(message?: any) {\n    const copy = { ...this.currentStatus };\n    if (message) {\n      copy.message = message;\n    }\n    this.stream.next(copy);\n  }\n\n  disconnectIfNoListeners = () => {\n    const count = this.stream.observers.length;\n    if (count === 0) {\n      this.disconnect();\n    }\n  };\n\n  /**\n   * Get the stream of events and\n   */\n  getStream() {\n    return new Observable((subscriber) => {\n      const initialMessage = { ...this.currentStatus };\n      if (this.lastMessageWithSchema?.schema) {\n        // send just schema instead of schema+data to avoid having data gaps\n        initialMessage.message = { schema: this.lastMessageWithSchema?.schema };\n      }\n\n      subscriber.next({ ...this.currentStatus, message: this.lastMessageWithSchema });\n\n      const sub = this.stream.subscribe(subscriber);\n      return () => {\n        sub.unsubscribe();\n        const count = this.stream.observers.length;\n\n        // Wait 1/4 second to fully disconnect\n        if (count === 0) {\n          setTimeout(this.disconnectIfNoListeners, 250);\n        }\n      };\n    }) as Observable<LiveChannelEvent<T>>;\n  }\n\n  /**\n   * This is configured by the server when the config supports presence\n   */\n  async getPresence(): Promise<LiveChannelPresenceStatus> {\n    if (!this.subscription) {\n      return Promise.reject('not subscribed');\n    }\n\n    return this.subscription!.presence().then((v) => {\n      return {\n        users: Object.keys(v.presence),\n      };\n    });\n  }\n\n  /**\n   * This will close and terminate all streams for this channel\n   */\n  disconnect() {\n    this.currentStatus.state = LiveChannelConnectionState.Shutdown;\n    this.currentStatus.timestamp = Date.now();\n\n    if (this.subscription) {\n      this.subscription.unsubscribe();\n      this.subscription.removeAllListeners(); // they keep all listeners attached after unsubscribe\n      this.subscription = undefined;\n    }\n\n    this.stream.complete();\n\n    this.stream.next({ ...this.currentStatus });\n    this.stream.complete();\n\n    if (this.shutdownCallback) {\n      this.shutdownCallback();\n    }\n  }\n\n  shutdownWithError(err: string) {\n    this.currentStatus.error = err;\n    this.sendStatus();\n    this.disconnect();\n  }\n}\n\nexport function getErrorChannel<TMessage>(msg: string, id: string, addr: LiveChannelAddress) {\n  return {\n    id,\n    opened: Date.now(),\n    addr,\n\n    // return an error\n    getStream: () =>\n      of({\n        type: LiveChannelEventType.Status,\n        id,\n        timestamp: Date.now(),\n        state: LiveChannelConnectionState.Invalid,\n        error: msg,\n      }),\n\n    // already disconnected\n    disconnect: () => {},\n  };\n}\n","import Centrifuge from 'centrifuge/dist/centrifuge';\nimport { BehaviorSubject, Observable, share, startWith } from 'rxjs';\n\nimport {\n  DataQueryError,\n  DataQueryResponse,\n  LiveChannelAddress,\n  LiveChannelConnectionState,\n  LiveChannelId,\n  toLiveChannelId,\n} from '@grafana/data';\nimport { FetchResponse } from '@grafana/runtime/src/services/backendSrv';\nimport {\n  GrafanaLiveSrv,\n  LiveDataStreamOptions,\n  LiveQueryDataOptions,\n  StreamingFrameAction,\n  StreamingFrameOptions,\n} from '@grafana/runtime/src/services/live';\nimport { BackendDataSourceResponse } from '@grafana/runtime/src/utils/queryResponse';\nimport { loadUrlToken } from 'app/core/utils/urlToken';\n\nimport { StreamingResponseData } from '../data/utils';\n\nimport { LiveDataStream } from './LiveDataStream';\nimport { CentrifugeLiveChannel } from './channel';\n\nexport type CentrifugeSrvDeps = {\n  appUrl: string;\n  orgId: number;\n  orgRole: string;\n  sessionId: string;\n  liveEnabled: boolean;\n  dataStreamSubscriberReadiness: Observable<boolean>;\n};\n\nexport type StreamingDataQueryResponse = Omit<DataQueryResponse, 'data'> & { data: [StreamingResponseData] };\n\nexport type CentrifugeSrv = Omit<GrafanaLiveSrv, 'publish' | 'getDataStream' | 'getQueryData'> & {\n  getDataStream: (options: LiveDataStreamOptions) => Observable<StreamingDataQueryResponse>;\n  getQueryData: (\n    options: LiveQueryDataOptions\n  ) => Promise<\n    | { data: BackendDataSourceResponse | undefined }\n    | FetchResponse<BackendDataSourceResponse | undefined>\n    | DataQueryError\n  >;\n};\n\nexport type DataStreamSubscriptionKey = string;\n\nconst defaultStreamingFrameOptions: Readonly<StreamingFrameOptions> = {\n  maxLength: 100,\n  maxDelta: Infinity,\n  action: StreamingFrameAction.Append,\n};\n\nconst dataStreamShutdownDelayInMs = 5000;\n\nexport class CentrifugeService implements CentrifugeSrv {\n  readonly open = new Map<string, CentrifugeLiveChannel>();\n  private readonly liveDataStreamByChannelId: Record<LiveChannelId, LiveDataStream> = {};\n  readonly centrifuge: Centrifuge;\n  readonly connectionState: BehaviorSubject<boolean>;\n  readonly connectionBlocker: Promise<void>;\n  private readonly dataStreamSubscriberReadiness: Observable<boolean>;\n\n  constructor(private deps: CentrifugeSrvDeps) {\n    this.dataStreamSubscriberReadiness = deps.dataStreamSubscriberReadiness.pipe(share(), startWith(true));\n\n    let liveUrl = `${deps.appUrl.replace(/^http/, 'ws')}/api/live/ws`;\n\n    const token = loadUrlToken();\n    if (token !== null && token !== '') {\n      liveUrl += '?auth_token=' + token;\n    }\n\n    this.centrifuge = new Centrifuge(liveUrl, {\n      timeout: 30000,\n    });\n    this.centrifuge.setConnectData({\n      sessionId: deps.sessionId,\n      orgId: deps.orgId,\n    });\n    // orgRole is set when logged in *or* anonomus users can use grafana\n    if (deps.liveEnabled && deps.orgRole !== '') {\n      this.centrifuge.connect(); // do connection\n    }\n    this.connectionState = new BehaviorSubject<boolean>(this.centrifuge.isConnected());\n    this.connectionBlocker = new Promise<void>((resolve) => {\n      if (this.centrifuge.isConnected()) {\n        return resolve();\n      }\n      const connectListener = () => {\n        resolve();\n        this.centrifuge.removeListener('connect', connectListener);\n      };\n      this.centrifuge.addListener('connect', connectListener);\n    });\n\n    // Register global listeners\n    this.centrifuge.on('connect', this.onConnect);\n    this.centrifuge.on('disconnect', this.onDisconnect);\n    this.centrifuge.on('publish', this.onServerSideMessage);\n  }\n\n  //----------------------------------------------------------\n  // Internal functions\n  //----------------------------------------------------------\n\n  private onConnect = (context: any) => {\n    this.connectionState.next(true);\n  };\n\n  private onDisconnect = (context: any) => {\n    this.connectionState.next(false);\n  };\n\n  private onServerSideMessage = (context: any) => {\n    console.log('Publication from server-side channel', context);\n  };\n\n  /**\n   * Get a channel.  If the scope, namespace, or path is invalid, a shutdown\n   * channel will be returned with an error state indicated in its status\n   */\n  private getChannel<TMessage>(addr: LiveChannelAddress): CentrifugeLiveChannel<TMessage> {\n    const id = `${this.deps.orgId}/${addr.scope}/${addr.namespace}/${addr.path}`;\n    let channel = this.open.get(id);\n    if (channel != null) {\n      return channel;\n    }\n\n    channel = new CentrifugeLiveChannel(id, addr);\n    if (channel.currentStatus.state === LiveChannelConnectionState.Invalid) {\n      return channel;\n    }\n    channel.shutdownCallback = () => {\n      this.open.delete(id); // remove it from the list of open channels\n    };\n    this.open.set(id, channel);\n\n    // Initialize the channel in the background\n    this.initChannel(channel).catch((err) => {\n      if (channel) {\n        channel.currentStatus.state = LiveChannelConnectionState.Invalid;\n        channel.shutdownWithError(err);\n      }\n      this.open.delete(id);\n    });\n\n    // return the not-yet initialized channel\n    return channel;\n  }\n\n  private async initChannel(channel: CentrifugeLiveChannel): Promise<void> {\n    const events = channel.initalize();\n    if (!this.centrifuge.isConnected()) {\n      await this.connectionBlocker;\n    }\n    channel.subscription = this.centrifuge.subscribe(channel.id, events, { data: channel.addr.data });\n    return;\n  }\n\n  //----------------------------------------------------------\n  // Exported functions\n  //----------------------------------------------------------\n\n  /**\n   * Listen for changes to the connection state\n   */\n  getConnectionState = () => {\n    return this.connectionState.asObservable();\n  };\n\n  /**\n   * Watch for messages in a channel\n   */\n  getStream: CentrifugeSrv['getStream'] = <T>(address: LiveChannelAddress) => {\n    return this.getChannel<T>(address).getStream();\n  };\n\n  private createSubscriptionKey = (options: LiveDataStreamOptions): DataStreamSubscriptionKey =>\n    options.key ?? `xstr/${streamCounter++}`;\n\n  private getLiveDataStream = (options: LiveDataStreamOptions): LiveDataStream => {\n    const channelId = toLiveChannelId(options.addr);\n    const existingStream = this.liveDataStreamByChannelId[channelId];\n\n    if (existingStream) {\n      return existingStream;\n    }\n\n    const channel = this.getChannel(options.addr);\n    this.liveDataStreamByChannelId[channelId] = new LiveDataStream({\n      channelId,\n      onShutdown: () => {\n        delete this.liveDataStreamByChannelId[channelId];\n      },\n      liveEventsObservable: channel.getStream(),\n      subscriberReadiness: this.dataStreamSubscriberReadiness,\n      defaultStreamingFrameOptions,\n      shutdownDelayInMs: dataStreamShutdownDelayInMs,\n    });\n    return this.liveDataStreamByChannelId[channelId];\n  };\n  /**\n   * Connect to a channel and return results as DataFrames\n   */\n  getDataStream: CentrifugeSrv['getDataStream'] = (options) => {\n    const subscriptionKey = this.createSubscriptionKey(options);\n\n    const stream = this.getLiveDataStream(options);\n    return stream.get(options, subscriptionKey);\n  };\n\n  /**\n   * Executes a query over the live websocket. Query response can contain live channels we can subscribe to for further updates\n   *\n   * Since the initial request and subscription are on the same socket, this will support HA setups\n   */\n  getQueryData: CentrifugeSrv['getQueryData'] = async (options) => {\n    if (!this.centrifuge.isConnected()) {\n      await this.connectionBlocker;\n    }\n    return this.centrifuge.namedRPC('grafana.query', options.body);\n  };\n\n  /**\n   * For channels that support presence, this will request the current state from the server.\n   *\n   * Join and leave messages will be sent to the open stream\n   */\n  getPresence: CentrifugeSrv['getPresence'] = (address) => {\n    return this.getChannel(address).getPresence();\n  };\n}\n\n// This is used to give a unique key for each stream.  The actual value does not matter\nlet streamCounter = 0;\n","import * as comlink from 'comlink';\nimport { Subscriber } from 'rxjs';\n\n// Observers, ie. functions passed to `observable.subscribe(...)`, are converted to a subclass of `Subscriber` before they are sent to the source Observable.\n// The conversion happens internally in the RxJS library - this transfer handler is catches them and wraps them with a proxy\nconst subscriberTransferHandler: any = {\n  canHandle(value: any): boolean {\n    return value && value instanceof Subscriber;\n  },\n\n  serialize(value: Function): [MessagePort, Transferable[]] {\n    const obj = comlink.proxy(value);\n\n    const { port1, port2 } = new MessageChannel();\n\n    comlink.expose(obj, port1);\n\n    return [port2, [port2]];\n  },\n\n  deserialize(value: MessagePort): comlink.Remote<MessagePort> {\n    value.start();\n\n    return comlink.wrap<MessagePort>(value);\n  },\n};\ncomlink.transferHandlers.set('SubscriberHandler', subscriberTransferHandler);\n","import { Labels } from '@grafana/data';\n\n/** replace labels in a string.  Used for loki+prometheus legend formats */\nexport function renderLegendFormat(aliasPattern: string, aliasData: Labels): string {\n  const aliasRegex = /\\{\\{\\s*(.+?)\\s*\\}\\}/g;\n  return aliasPattern.replace(aliasRegex, (_, g1) => (aliasData[g1] ? aliasData[g1] : g1));\n}\n"],"names":["dateTimeParse","value","options","isDateTime","parseString","parseOthers","indexOf","isValid","moment","parse","roundUp","timeZone","fiscalYearStartMonth","getTimeZone","zone","format","systemDateFormats","name","lowerCase","date","typeList","Set","eventFactory","has","Error","add","BusEventBase","constructor","this","type","__proto__","BusEventWithPayload","payload","super","FieldConfigOptionsRegistry","Registry","fieldIndexComparer","field","reverse","values","FieldType","numericIndexComparer","stringIndexComparer","booleanIndexComparer","timeIndexComparer","naturalIndexComparer","timeComparer","a","b","isNumber","numericComparer","dateTime","isBefore","falsyComparer","stringComparer","localeCompare","booleanComparer","vA","get","vB","getFrameDisplayName","frame","index","valuesWithLabels","fields","labels","Object","keys","length","push","formatLabels","undefined","filter","f","map","getFieldDisplayName","join","refId","allFrames","existingTitle","state","displayName","multipleFrames","Boolean","hasConfigTitle","config","displayNameFromDS","TIME_SERIES_TIME_FIELD_NAME","parts","frameNamesDiffer","i","frameNameAdded","labelsAdded","TIME_SERIES_VALUE_FIELD_NAME","singleLabelName","frames","singleName","labelKey","getSingleLabelName","allLabels","dupeCount","foundSelf","otherField","getUniqueFieldName","calculateFieldDisplayName","XSSWL","xss","reduce","acc","element","concat","sanitizeXSS","whiteList","sanitizeTextPanelWhitelist","css","gap","order","sanitize","unsanitizedString","process","error","console","sanitizeTextPanelContent","sanitizeUrl","url","braintreeSanitizeUrl","hasAnsiCodes","input","test","escapeHtml","str","String","replace","createComponents","colors","shadows","panel","padding","headerHeight","background","primary","borderColor","border","weak","boxShadow","medium","borderHover","strong","text","mode","canvas","height","sm","md","lg","dropdown","tooltip","secondary","dashboard","overlay","sidemenu","width","menuTabs","textHighlight","warning","contrastText","main","horizontalDrawer","defaultHeight","createV1Theme","theme","oldCommon","typography","fontFamily","sansSerif","monospace","fontFamilyMonospace","size","base","fontSize","xs","heading","h1","h2","h3","h4","h5","h6","weight","light","fontWeightLight","regular","fontWeightRegular","semibold","fontWeightMedium","bold","fontWeightBold","lineHeight","bodySmall","body","link","decoration","hoverDecoration","breakpoints","xl","xxl","spacing","gridSize","insetSquishMd","d","xxs","gutter","formSpacingBase","formMargin","formFieldsetMargin","formInputHeight","formButtonHeight","formInputPaddingHorizontal","formInputAffixPaddingHorizontal","formInputMargin","formLabelPadding","formLabelMargin","formValidationMessagePadding","formValidationMessageMargin","inlineFormMargin","radius","shape","borderRadius","components","panelPadding","panelHeaderHeight","zIndex","basicColors","commonColorsPalette","black","white","dark1","dark2","dark3","dark4","dark5","dark6","dark7","dark8","dark9","dark10","gray1","gray2","gray3","gray4","gray5","gray6","gray7","redBase","redShade","greenBase","greenShade","red","yellow","purple","variable","orange","orangeDark","backgrounds","bg1","bg2","bg3","action","hover","dashboardBg","bgBlue1","bgBlue2","shade","borders","border1","border2","border3","textColors","textStrong","maxContrast","textHeading","textSemiWeak","textWeak","textFaint","disabled","textBlue","form","formLabel","formDescription","formInputBg","formInputBgDisabled","disabledBackground","formInputBorder","formInputBorderHover","formInputBorderActive","formInputBorderInvalid","formInputPlaceholderText","formInputText","formInputDisabledText","disabledText","formFocusOutline","formValidationMessageText","formValidationMessageBg","GrafanaThemeType","isDark","isLight","palette","brandPrimary","brandSuccess","success","brandWarning","brandDanger","queryRed","queryGreen","queryPurple","queryOrange","online","warn","critical","bodyBg","panelBg","panelBorder","pageHeaderBg","pageHeaderBorder","dropdownBg","dropdownShadow","dropdownOptionHoverBg","linkDisabled","linkHover","linkExternal","listItem","visualization","gray98","gray97","gray95","gray90","gray85","gray70","gray60","gray33","gray25","gray15","gray10","gray05","blue95","blue85","blue80","blue77","red88","createTheme","colorsInput","spacingInput","shapeInput","typographyInput","createColors","createBreakpoints","createSpacing","createShape","createTypography","createShadows","transitions","createTransitions","createVisualizationColors","flags","v1","darkLayer0","darkLayer1","darkLayer2","darkBorder1","darkBorder2","gray100","gray80","lightBorder1","blueDarkMain","blueDarkText","redDarkMain","redDarkText","greenDarkMain","greenDarkText","orangeDarkMain","orangeDarkText","blueLightMain","blueLightText","redLightMain","redLightText","greenLightMain","greenLightText","orangeLightMain","orangeLightText","ReducerID","reduceField","reducers","calcs","missing","s","hasOwnProperty","queue","fieldReducers","list","reducer","id","emptyInputResult","nullValueMode","ignoreNulls","NullValueMode","nullAsZero","doStandardCalcs","lastNotNull","description","standard","aliasIds","calculateLastNotNull","last","calculateLast","firstNotNull","calculateFirstNotNull","first","calculateFirst","min","max","mean","variance","calculateStdDev","stdDev","sum","count","range","delta","step","diff","logmin","allIsZero","allIsNull","changeCount","calculateChangeCount","distinctCount","calculateDistinctCount","diffperc","allValues","toArray","uniqueValues","Number","MAX_VALUE","nonNullCount","previousDeltaUp","data","isNumberField","currentValue","isFirst","idx","v","squareSum","runningMean","runningNonNullCount","_oldMean","Math","sqrt","distinct","fieldTypeMatcher","FieldMatcherID","defaultOptions","getOptionsDisplayText","numericMatcher","timeMatcher","getFieldTypeMatchers","MatcherID","FrameMatcherID","ValueMatcherID","anyFieldMatcher","excludeFromPicker","children","option","getFieldMatcher","child","sub","matcher","fieldMatchers","anyFrameMatcher","getFrameMatchers","frameMatchers","allFieldsMatcher","allFramesMatcher","notFieldMatcher","check","notFrameMatcher","alwaysFieldMatcher","alwaysFrameMatcher","neverFieldMatcher","notTimeFieldMatcher","neverFrameMatcher","alwaysFieldMatcherInfo","alwaysFrameMatcherInfo","neverFieldMatcherInfo","neverFrameMatcherInfo","getFieldPredicateMatchers","getFramePredicateMatchers","refIdMacher","pattern","regex","stringToJsRegex","getRefIdMatchers","firstFieldMatcher","firstTimeFieldMatcher","find","getSimpleFieldMatchers","isEqualValueMatcher","valueIndex","isApplicable","getDefaultOptions","isNotEqualValueMatcher","getEqualValueMatchers","isNullValueMatcher","isNotNullValueMatcher","getNullValueMatchers","isGreaterValueMatcher","isNaN","isGreaterOrEqualValueMatcher","isLowerValueMatcher","isLowerOrEqualValueMatcher","getNumericValueMatchers","isBetweenValueMatcher","from","to","getRangeValueMatchers","regexValueMatcher","RegExp","getRegexValueMatcher","ensureColumnsTransformer","DataTransformerID","operator","source","pipe","transformer","timeFieldName","timeField","getTimeField","findConsistentTimeFieldName","seriesToColumnsTransformer","byField","filterFieldsTransformer","include","exclude","processed","series","copy","noopTransformer","filterFramesTransformer","filterFieldsByNameTransformer","getMatcherConfig","names","Array","isArray","filterFramesByRefIdTransformer","filterOptions","limitTransformer","limitField","limitFieldMatch","vals","ArrayVector","slice","mergeTransformer","dataFrames","fieldNames","fieldIndexByName","fieldNamesForKey","dataFrame","MutableDataFrame","frameIndex","fieldIndex","addField","copyFieldStructure","fieldExistsInAllFrames","valuesByKey","valuesInOrder","keyFactory","createKeyFactory","valueMapper","createValueMapper","key","createPointer","valueWasMerged","existing","isMergable","pointer","omit","fieldPointerByName","keyFieldNames","factoryIndex","fieldName","fieldByName","fieldIndexByFrameIndex","mergable","prop","organizeFieldsTransformer","excludeByName","indexByName","renameByName","mapToExcludeArray","orderFieldsTransformer","renameFieldsTransformer","renamer","createRenamer","renameTo","joinBy","joined","outerJoinDataFrames","seriesToRowsTransformer","isTimeSeries","timeFieldByIndex","targetFields","metricField","TIME_SERIES_METRIC_FIELD_NAME","timeFieldIndex","valueFieldIndex","sortDataFrame","sortByTransformer","sort","findIndex","attachFieldIndex","desc","sortDataFrames","FieldColorModeId","FALLBACK_COLOR","ThresholdsMode","MappingType","SpecialValueMatch","init","Map","initialized","getIfExists","initialize","byId","ext","register","selectOptions","current","select","currentOptions","ordered","label","PluginState","ids","found","isEmpty","set","alias","anyToNumber","NaN","toNumber","BinaryOperationID","binaryOperators","Add","operation","Subtract","Multiply","Divide","makeFieldParser","guessFieldTypeFromValue","parseFloat","makeClassES5Compatible","ES6Class","Proxy","apply","target","self","argumentsList","Reflect","construct","alert","toPercent","decimals","toFixed","suffix","toPercentUnit","toHex0x","asHex","toHex","substring","toString","toUpperCase","sci","toExponential","getCategories","formats","fn","toFixedUnit","stringFormater","scaledUnits","locale","SIPrefix","currency","binaryPrefix","dateTimeAsIso","dateTimeAsIsoNoDateIfToday","dateTimeAsUS","dateTimeAsUSNoDateIfToday","getDateTimeAsLocalFormat","getDateTimeAsLocalFormatNoDateIfToday","dateTimeSystemFormatter","dateTimeFromNow","toNanoSeconds","toMicroSeconds","toMilliSeconds","toSeconds","toMinutes","toHours","toDays","toDurationInMilliseconds","toDurationInSeconds","toDurationInHoursMinutesSeconds","toDurationInDaysHoursMinutesSeconds","toTimeTicks","toClockMilliseconds","toClockSeconds","simpleCountUnit","booleanValueFormatter","Interval","UNITS","Year","Month","Week","Day","Hour","Minute","Second","Millisecond","INTERVALS_IN_SECONDS","abs","toFixedScaled","scaledDecimals","toDuration","timeScale","strings","decrementDecimals","decimalsCount","interval","floor","unit","toClock","toUtc","hours","duration","asHours","numHours","numMinutes","numSeconds","dayString","numDays","toDateTimeValueFormatter","todayPattern","isSame","dateTimeFormat","localTimeFormat","year","month","day","hour","minute","second","showMs","dateTimeFormatTimeAgo","symbol","asSuffix","scaler","scaled","prefix","SI_PREFIXES","SI_BASE_INDEX","getOffsetFromSIPrefix","c","charIndex","normalize","BIN_PREFIXES","offset","units","p","FunctionalVector","buffer","toJSON","AsNumberVector","BinaryOperationVector","left","right","vectorToArray","ConstantVector","len","fill","RowVector","columns","rowIndex","SortedVector","arr","toDataQueryError","err","message","status","statusText","cachedToken","loadUrlToken","token","URLSearchParams","window","location","search","InternalStreamMessageType","filterMessages","packets","LiveDataStream","deps","ReplaySubject","stream","complete","liveEventsSubscription","unsubscribe","onShutdown","observed","shutdown","log","channelId","next","evt","isLiveChannelMessageEvent","liveChannelStatusEvent","isLiveChannelStatusEvent","LiveChannelConnectionState","msg","frameBuffer","schemaChanged","ChangedSchema","NewValuesSameSchema","getValuesFromLastPacket","bufferOptions","needsResizing","resize","hasAtLeastOnePacket","shutdownTimeoutId","clearTimeout","subKey","clearShutdownTimeout","getStreamingFrameOptions","resizeBuffer","prepareInternalStreamForNewSubscription","shouldSendLastPacketOnly","StreamingFrameAction","fieldsNamesFilter","fieldFilterPredicate","includes","matchingFieldIndexes","getFullFrameResponseData","messages","getMatchingFieldIndexes","LoadingState","StreamingResponseDataType","serialize","maxLength","packetInfo","getNewValuesSameSchemaResponseData","lastMessage","j","filteredValues","shouldSendFullFrame","transformedInternalStream","canEmitObservable","subscriberReadiness","Observable","subscriber","canEmit","emitBuffer","canEmitSub","subscribe","val","sourceSub","errors","lastError","some","n","newValueSameSchemaMessages","setTimeout","shutdownIfNoSubscribers","shutdownDelayInMs","StreamingDataFrame","defaultStreamingFrameOptions","liveEventsObservable","onError","onComplete","onNext","CentrifugeLiveChannel","addr","Date","now","Subject","observers","disconnect","currentStatus","LiveChannelEventType","timestamp","opened","isValidLiveChannelAddress","initalize","initalized","events","publish","ctx","schema","lastMessageWithSchema","sendStatus","user","info","leave","getStream","initialMessage","disconnectIfNoListeners","subscription","presence","then","users","Promise","reject","removeAllListeners","shutdownCallback","shutdownWithError","maxDelta","Infinity","CentrifugeService","context","connectionState","asObservable","address","getChannel","streamCounter","toLiveChannelId","existingStream","liveDataStreamByChannelId","channel","dataStreamSubscriberReadiness","subscriptionKey","createSubscriptionKey","getLiveDataStream","async","centrifuge","isConnected","connectionBlocker","namedRPC","getPresence","share","startWith","liveUrl","appUrl","Centrifuge","timeout","setConnectData","sessionId","orgId","liveEnabled","orgRole","connect","BehaviorSubject","resolve","connectListener","removeListener","addListener","on","onConnect","onDisconnect","onServerSideMessage","scope","namespace","path","open","delete","initChannel","catch","subscriberTransferHandler","canHandle","Subscriber","obj","comlink","port1","port2","MessageChannel","deserialize","start","renderLegendFormat","aliasPattern","aliasData","_","g1"],"sourceRoot":""}