@grafana/scenes 5.11.0--canary.868.10595103501.0 → 5.11.0--canary.868.10613389161.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +12 -0
- package/dist/esm/components/SceneRefreshPicker.js +17 -1
- package/dist/esm/components/SceneRefreshPicker.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFilterRenderer.js +21 -13
- package/dist/esm/variables/adhoc/AdHocFilterRenderer.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +38 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/SceneApp/utils.ts","../src/components/VizPanel/registerRuntimePanelPlugin.ts","../src/core/SceneComponentWrapper.tsx","../src/core/events.ts","../src/core/SceneObjectRef.ts","../src/core/SceneObjectBase.tsx","../src/core/sceneGraph/utils.ts","../src/querying/RuntimeDataSource.ts","../src/variables/lookupVariable.ts","../src/core/SceneDataNode.ts","../src/services/SceneObjectUrlSyncConfig.ts","../src/utils/parseUrlParam.ts","../src/utils/evaluateTimeRange.ts","../src/core/SceneTimeRange.tsx","../src/variables/interpolation/defaults.ts","../src/core/sceneGraph/getTimeRange.ts","../src/variables/types.ts","../src/variables/interpolation/fieldAccessorCache.ts","../src/variables/interpolation/ScopedVarsVariable.ts","../src/variables/constants.ts","../src/variables/interpolation/formatRegistry.ts","../src/variables/macros/types.ts","../src/variables/macros/timeMacros.ts","../src/variables/macros/AllVariablesMacro.ts","../src/variables/macros/templateProxies.ts","../src/variables/macros/dataMacros.ts","../src/variables/macros/urlMacros.ts","../src/variables/macros/contextMacros.ts","../src/variables/macros/index.ts","../src/variables/interpolation/sceneInterpolator.ts","../src/core/types.ts","../src/behaviors/SceneQueryController.ts","../src/utils/writeSceneLog.ts","../src/utils/getDataSource.ts","../src/variables/VariableValueRecorder.ts","../src/querying/ExtraQueryProvider.ts","../src/querying/extraQueryProcessingOperator.ts","../src/querying/layers/annotations/filterAnnotations.ts","../src/querying/getEnrichedDataRequest.ts","../src/variables/adhoc/patchGetAdhocFilters.ts","../src/querying/registerQueryWithController.ts","../src/variables/groupby/findActiveGroupByVariablesByUid.ts","../src/utils/utils.ts","../src/variables/variants/MultiValueVariable.ts","../src/variables/components/getOptionSearcher.ts","../src/variables/components/VariableValueSelect.tsx","../src/variables/groupby/GroupByVariableUrlSyncHandler.ts","../src/variables/getEnrichedFiltersRequest.ts","../src/utils/SafeSerializableSceneObject.ts","../src/utils/wrapInSafeSerializableSceneObject.ts","../src/variables/groupby/GroupByVariable.tsx","../src/utils/LoadingIndicator.tsx","../src/utils/ControlsLabel.tsx","../src/variables/adhoc/getAdhocOptionSearcher.ts","../src/variables/adhoc/AdHocFilterRenderer.tsx","../src/variables/adhoc/AdHocFilterBuilder.tsx","../src/variables/adhoc/AdHocFiltersVariableUrlSyncHandler.ts","../src/variables/adhoc/AdHocFiltersVariable.tsx","../src/querying/DataLayersMerger.ts","../src/querying/SceneQueryRunner.ts","../src/variables/utils.ts","../src/variables/VariableDependencyConfig.ts","../src/variables/variants/query/guards.ts","../src/variables/variants/query/createQueryVariableRunner.ts","../src/variables/variants/query/utils.ts","../src/variables/variants/query/toMetricFindValues.ts","../src/variables/variants/query/QueryVariable.tsx","../src/core/sceneGraph/sceneGraph.ts","../src/core/sceneGraph/index.ts","../src/services/UniqueUrlKeyMapper.ts","../src/services/utils.ts","../src/variables/variants/guards.ts","../src/behaviors/ActWhenVariableChanged.ts","../src/behaviors/CursorSync.ts","../src/components/VizPanel/VizPanelRenderer.tsx","../src/components/VizPanel/seriesVisibilityConfigFactory.ts","../src/components/VizPanel/colorSeriesConfigFactory.ts","../src/components/VizPanel/VizPanel.tsx","../src/behaviors/LiveNowTimer.ts","../src/utils/getMessageFromError.ts","../src/querying/layers/SceneDataLayerBase.ts","../src/querying/layers/SceneDataLayerControls.tsx","../src/querying/layers/annotations/standardAnnotationsSupport.ts","../src/querying/layers/annotations/standardAnnotationQuery.ts","../src/querying/layers/annotations/utils.ts","../src/querying/layers/annotations/AnnotationsDataLayer.tsx","../src/core/SceneTimeRangeTransformerBase.tsx","../src/core/SceneTimeZoneOverride.tsx","../src/querying/SceneDataLayerSet.tsx","../src/querying/SceneDataTransformer.ts","../src/variables/components/VariableValueSelectors.tsx","../src/variables/components/VariableValueControl.tsx","../src/variables/sets/SceneVariableSet.ts","../src/variables/variants/ConstantVariable.ts","../src/variables/variants/CustomVariable.tsx","../src/variables/variants/DataSourceVariable.tsx","../src/utils/metricTree.ts","../src/variables/variants/TestVariable.tsx","../src/variables/components/VariableValueInput.tsx","../src/variables/variants/TextBoxVariable.tsx","../src/variables/variants/LocalValueVariable.ts","../src/variables/variants/IntervalVariable.tsx","../src/services/UrlSyncManager.ts","../src/services/useUrlSync.ts","../src/services/UrlSyncContextProvider.ts","../src/utils/compatibility/setWindowGrafanaSceneContext.ts","../src/components/EmbeddedScene.tsx","../src/components/VizPanel/VizPanelMenu.tsx","../src/components/layout/grid/constants.ts","../src/components/layout/grid/SceneGridItem.tsx","../src/components/layout/LazyLoader.tsx","../src/components/layout/grid/SceneGridLayoutRenderer.tsx","../src/components/layout/grid/utils.ts","../src/components/layout/grid/SceneGridLayout.tsx","../src/components/layout/grid/SceneGridRow.tsx","../src/components/NestedScene.tsx","../src/components/SceneCanvasText.tsx","../src/components/SceneToolbarButton.tsx","../src/components/SceneTimePicker.tsx","../src/components/SceneRefreshPicker.tsx","../src/utils/getCompareSeriesRefId.ts","../src/components/SceneTimeRangeCompare.tsx","../src/components/SceneByFrameRepeater.tsx","../src/components/SceneByVariableRepeater.tsx","../src/components/SceneControlsSpacer.tsx","../src/components/layout/SceneFlexLayout.tsx","../src/components/layout/CSSGrid/SceneCSSGridLayout.tsx","../src/components/layout/split/Splitter.tsx","../src/components/layout/split/SplitLayoutRenderer.tsx","../src/components/layout/split/SplitLayout.ts","../src/components/SceneApp/SceneApp.tsx","../src/components/SceneReactObject.tsx","../src/components/SceneDebugger/DebugDetails.tsx","../src/components/SceneDebugger/DebugTreeNode.tsx","../src/components/SceneDebugger/SceneDebugger.tsx","../src/components/SceneApp/SceneAppPageView.tsx","../src/components/SceneApp/SceneAppPage.tsx","../src/core/PanelBuilders/StandardFieldConfigBuilders.ts","../src/core/PanelBuilders/FieldConfigOverridesBuilder.ts","../src/core/PanelBuilders/FieldConfigBuilder.ts","../src/core/PanelBuilders/PanelOptionsBuilder.ts","../src/core/PanelBuilders/VizPanelBuilder.ts","../src/core/PanelBuilders/PanelOptionsBuilders.ts","../src/core/PanelBuilders/FieldConfigBuilders.ts","../src/core/PanelBuilders/index.ts","../src/core/PanelBuilders/VizConfigBuilder.ts","../src/core/PanelBuilders/VizConfigBuilders.ts","../src/index.ts"],"sourcesContent":["import React from 'react';\nimport { RouteComponentProps, useLocation } from 'react-router-dom';\nimport { UrlQueryMap, locationUtil, urlUtil } from '@grafana/data';\nimport { locationSearchToObject, locationService } from '@grafana/runtime';\nimport { SceneObject } from '../../core/types';\n\nexport function useAppQueryParams(): UrlQueryMap {\n const location = useLocation();\n return locationSearchToObject(location.search || '');\n}\n\n/**\n *\n * @param path Url to append query params to\n * @param preserveParams Query params to preserve\n * @returns Url with query params\n */\nexport function getUrlWithAppState(path: string, preserveParams?: string[]): string {\n // make a copy of params as the renderUrl function mutates the object\n const paramsCopy = { ...locationService.getSearchObject() };\n\n if (preserveParams) {\n for (const key of Object.keys(paramsCopy)) {\n // if param is not in preserveParams, remove it\n if (!preserveParams.includes(key)) {\n delete paramsCopy[key];\n }\n }\n }\n\n return urlUtil.renderUrl(locationUtil.assureBaseUrl(path), paramsCopy);\n}\n\nexport function renderSceneComponentWithRouteProps(sceneObject: SceneObject, routeProps: RouteComponentProps) {\n // @ts-ignore\n return React.createElement(sceneObject.Component, { model: sceneObject, routeProps: routeProps });\n}\n","import { PanelPlugin, PluginMetaInfo } from '@grafana/data';\nimport { getPluginImportUtils } from '@grafana/runtime';\n\nexport const runtimePanelPlugins = new Map<string, PanelPlugin>();\n\nexport interface RuntimePanelPluginOptions {\n /**\n * Please specify a pluginId that is unlikely to collide with other plugins.\n */\n pluginId: string;\n plugin: PanelPlugin;\n}\n\n/**\n * Provides a way to register runtime panel plugins.\n * Please use a pluginId that is unlikely to collide with other plugins.\n */\nexport function registerRuntimePanelPlugin({ pluginId, plugin }: RuntimePanelPluginOptions) {\n if (runtimePanelPlugins.has(pluginId)) {\n throw new Error(`A runtime panel plugin with id ${pluginId} has already been registered`);\n }\n\n plugin.meta = {\n ...plugin.meta,\n id: pluginId,\n name: pluginId,\n module: 'runtime plugin',\n baseUrl: 'runtime plugin',\n info: {\n author: {\n name: 'Runtime plugin ' + pluginId,\n },\n description: '',\n links: [],\n logos: {\n large: '',\n small: '',\n },\n screenshots: [],\n updated: '',\n version: '',\n } as PluginMetaInfo,\n };\n\n runtimePanelPlugins.set(pluginId, plugin);\n}\n\nexport function loadPanelPluginSync(pluginId: string) {\n const { getPanelPluginFromCache } = getPluginImportUtils();\n\n return getPanelPluginFromCache(pluginId) ?? runtimePanelPlugins.get(pluginId);\n}\n","import React, { useEffect, useState } from 'react';\n\nimport { SceneComponentProps, SceneObject } from './types';\n\nfunction SceneComponentWrapperWithoutMemo<T extends SceneObject>({ model, ...otherProps }: SceneComponentProps<T>) {\n const Component = (model as any).constructor['Component'] ?? EmptyRenderer;\n const [_, setValue] = useState(0);\n\n useEffect(() => {\n const unsub = model.activate();\n setValue((prevState) => prevState + 1);\n return unsub;\n }, [model]);\n\n // By not rendering the component until the model is actiavted we make sure that parent models get activated before child models\n // Otherwise child models would be activated before parents as that is the order of React mount effects.\n // This also enables static logic to happen inside activate that can change state before the first render.\n if (!model.isActive) {\n return null;\n }\n\n return <Component {...otherProps} model={model} />;\n}\n\nexport const SceneComponentWrapper = React.memo(SceneComponentWrapperWithoutMemo);\n\nfunction EmptyRenderer<T>(_: SceneComponentProps<T>): React.ReactElement | null {\n return null;\n}\n","import { BusEventWithPayload } from '@grafana/data';\n\nimport { SceneObject, SceneObjectState } from './types';\n\nexport interface SceneObjectStateChangedPayload<TState extends SceneObjectState = SceneObjectState> {\n prevState: TState;\n newState: TState;\n partialUpdate: Partial<TState>;\n changedObject: SceneObject<TState>;\n}\n\nexport class SceneObjectStateChangedEvent extends BusEventWithPayload<SceneObjectStateChangedPayload> {\n public static readonly type = 'scene-object-state-change';\n}\n\ntype UserActionEventType =\n | 'panel-description-shown'\n | 'panel-status-message-clicked'\n | 'panel-cancel-query-clicked'\n | 'panel-menu-shown';\n\ninterface UserActionEventPayload {\n origin: SceneObject;\n interaction: UserActionEventType;\n}\nexport class UserActionEvent extends BusEventWithPayload<UserActionEventPayload> {\n public static readonly type = 'scene-object-user-action';\n}\n","export class SceneObjectRef<T> {\n #ref: T;\n\n public constructor(ref: T) {\n this.#ref = ref;\n }\n\n public resolve(): T {\n return this.#ref;\n }\n}\n","import { useEffect, useState } from 'react';\nimport { Subscription, Unsubscribable } from 'rxjs';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { BusEvent, BusEventHandler, BusEventType, EventBus, EventBusSrv } from '@grafana/data';\nimport {\n SceneObject,\n SceneComponent,\n SceneObjectUrlSyncHandler,\n SceneStateChangedHandler,\n SceneActivationHandler,\n SceneDeactivationHandler,\n CancelActivationHandler,\n SceneObjectState,\n UseStateHookOptions,\n SceneStatelessBehavior,\n} from './types';\n\nimport { SceneComponentWrapper } from './SceneComponentWrapper';\nimport { SceneObjectStateChangedEvent } from './events';\nimport { cloneSceneObject } from './sceneGraph/utils';\nimport { SceneVariableDependencyConfigLike } from '../variables/types';\nimport { SceneObjectRef } from './SceneObjectRef';\n\nexport abstract class SceneObjectBase<TState extends SceneObjectState = SceneObjectState>\n implements SceneObject<TState>\n{\n private _isActive = false;\n private _state: TState;\n private _activationHandlers: SceneActivationHandler[] = [];\n private _deactivationHandlers = new Map<object, SceneDeactivationHandler>();\n private _ref?: SceneObjectRef<this>;\n\n protected _events?: EventBus;\n protected _parent?: SceneObject;\n protected _subs = new Subscription();\n protected _refCount = 0;\n\n protected _variableDependency: SceneVariableDependencyConfigLike | undefined;\n protected _urlSync: SceneObjectUrlSyncHandler | undefined;\n\n public constructor(state: TState) {\n if (!state.key) {\n state.key = uuidv4();\n }\n\n this._events = new EventBusSrv();\n\n this._state = Object.freeze(state);\n this._setParent(this._state);\n }\n\n /** Current state */\n public get state(): TState {\n return this._state;\n }\n\n /** True if currently being active (ie displayed for visual objects) */\n public get isActive(): boolean {\n return this._isActive;\n }\n\n /** Returns the parent, undefined for root object */\n public get parent(): SceneObject | undefined {\n return this._parent;\n }\n\n /** Returns variable dependency config */\n public get variableDependency(): SceneVariableDependencyConfigLike | undefined {\n return this._variableDependency;\n }\n\n /** Returns url sync config */\n public get urlSync(): SceneObjectUrlSyncHandler | undefined {\n return this._urlSync;\n }\n\n /**\n * Used in render functions when rendering a SceneObject.\n * Wraps the component in an EditWrapper that handles edit mode\n */\n public get Component(): SceneComponent<this> {\n return SceneComponentWrapper as SceneComponent<this>;\n }\n\n private _setParent(state: Partial<TState>) {\n forEachChild(state, (child) => {\n // If we already have a parent and it's not this, then we likely have a bug\n if (child._parent && child._parent !== this) {\n console.warn(\n 'SceneObject already has a parent set that is different from the new parent. You cannot share the same SceneObject instance in multiple scenes or in multiple different places of the same scene graph. Use SceneObject.clone() to duplicate a SceneObject or store a state key reference and use sceneGraph.findObject to locate it.',\n child,\n this\n );\n }\n child._parent = this;\n });\n }\n\n /**\n * Subscribe to the scene state subject\n **/\n public subscribeToState(handler: SceneStateChangedHandler<TState>): Unsubscribable {\n return this._events!.subscribe(SceneObjectStateChangedEvent, (event) => {\n if (event.payload.changedObject === this) {\n handler(event.payload.newState as TState, event.payload.prevState as TState);\n }\n });\n }\n\n /**\n * Subscribe to the scene event\n **/\n public subscribeToEvent<T extends BusEvent>(eventType: BusEventType<T>, handler: BusEventHandler<T>): Unsubscribable {\n return this._events!.subscribe(eventType, handler);\n }\n\n public setState(update: Partial<TState>) {\n const prevState = this._state;\n const newState: TState = {\n ...this._state,\n ...update,\n };\n\n this._state = Object.freeze(newState);\n this._setParent(update);\n\n // Handles cases when $data, $timeRange, or $variables are changed\n this._handleActivationOfChangedStateProps(prevState, newState);\n\n // Bubble state change event. This is event is subscribed to by UrlSyncManager and UndoManager\n this.publishEvent(\n new SceneObjectStateChangedEvent({\n prevState,\n newState,\n partialUpdate: update,\n changedObject: this,\n }),\n true\n );\n }\n\n /**\n * This handles activation and deactivation of $data, $timeRange and $variables when they change\n * during the active phase of the scene object.\n */\n private _handleActivationOfChangedStateProps(prevState: TState, newState: TState) {\n if (!this.isActive) {\n return;\n }\n\n if (prevState.$behaviors !== newState.$behaviors) {\n this._handleChangedBehaviors(prevState.$behaviors, newState.$behaviors);\n }\n\n if (prevState.$data !== newState.$data) {\n this._handleChangedStateActivation(prevState.$data, newState.$data);\n }\n\n if (prevState.$variables !== newState.$variables) {\n this._handleChangedStateActivation(prevState.$variables, newState.$variables);\n }\n\n if (prevState.$timeRange !== newState.$timeRange) {\n this._handleChangedStateActivation(prevState.$timeRange, newState.$timeRange);\n }\n }\n\n private _handleChangedStateActivation(oldValue: SceneObject | undefined, newValue: SceneObject | undefined) {\n if (oldValue) {\n const deactivationHandler = this._deactivationHandlers.get(oldValue);\n if (deactivationHandler) {\n deactivationHandler();\n this._deactivationHandlers.delete(oldValue);\n }\n }\n\n if (newValue) {\n this._deactivationHandlers.set(newValue, newValue.activate());\n }\n }\n\n private _handleChangedBehaviors(\n oldValue: Array<SceneObject | SceneStatelessBehavior> | undefined,\n newValue: Array<SceneObject | SceneStatelessBehavior> | undefined\n ) {\n // Handle removed behaviors\n if (oldValue) {\n for (const oldBehavior of oldValue) {\n if (!newValue || !newValue.includes(oldBehavior)) {\n const deactivationHandler = this._deactivationHandlers.get(oldBehavior);\n if (deactivationHandler) {\n deactivationHandler();\n this._deactivationHandlers.delete(oldBehavior);\n }\n }\n }\n }\n\n // Handle new behaviors\n if (newValue) {\n for (const newBehavior of newValue) {\n if (!oldValue || !oldValue.includes(newBehavior)) {\n this._activateBehavior(newBehavior);\n }\n }\n }\n }\n\n /*\n * Publish an event and optionally bubble it up the scene\n **/\n public publishEvent(event: BusEvent, bubble?: boolean) {\n this._events!.publish(event);\n\n if (bubble && this.parent) {\n this.parent.publishEvent(event, bubble);\n }\n }\n\n public getRoot(): SceneObject {\n return !this._parent ? this : this._parent.getRoot();\n }\n\n private _internalActivate() {\n this._isActive = true;\n\n const { $data, $variables, $timeRange, $behaviors } = this.state;\n\n this._activationHandlers.forEach((handler) => {\n const result = handler();\n if (result) {\n this._deactivationHandlers.set(result, result);\n }\n });\n\n if ($timeRange && !$timeRange.isActive) {\n this._deactivationHandlers.set($timeRange, $timeRange.activate());\n }\n\n if ($variables && !$variables.isActive) {\n this._deactivationHandlers.set($variables, $variables.activate());\n }\n\n if ($data && !$data.isActive) {\n this._deactivationHandlers.set($data, $data.activate());\n }\n\n if ($behaviors) {\n for (const behavior of $behaviors) {\n this._activateBehavior(behavior);\n }\n }\n }\n\n private _activateBehavior(behavior: SceneObject | SceneStatelessBehavior): SceneDeactivationHandler | void {\n if (behavior instanceof SceneObjectBase) {\n this._deactivationHandlers.set(behavior, behavior.activate());\n } else if (typeof behavior === 'function') {\n const deactivate = behavior(this);\n if (deactivate) {\n this._deactivationHandlers.set(behavior, deactivate);\n }\n }\n }\n\n /**\n * This is primarily called from SceneComponentWrapper when the SceneObject's Component is mounted.\n * But in some scenarios this can also be called directly from another scene object. When called manually from another scene object\n * make sure to call the returned function when the source scene object is deactivated.\n */\n public activate(): CancelActivationHandler {\n if (!this.isActive) {\n this._internalActivate();\n }\n\n this._refCount++;\n\n let called = false;\n\n return () => {\n this._refCount--;\n\n if (called) {\n const msg = `SceneObject cancelation handler returned by activate() called a second time`;\n throw new Error(msg);\n }\n\n called = true;\n\n if (this._refCount === 0) {\n this._internalDeactivate();\n }\n };\n }\n\n /**\n * Called by the SceneComponentWrapper when the react component is unmounted.\n * Don't override this, instead use addActivationHandler. The activation handler can return a deactivation handler.\n */\n private _internalDeactivate(): void {\n this._isActive = false;\n\n for (let handler of this._deactivationHandlers.values()) {\n handler();\n }\n\n this._deactivationHandlers.clear();\n\n // Clear subscriptions and listeners\n this._events!.removeAllListeners();\n this._subs.unsubscribe();\n this._subs = new Subscription();\n }\n\n /**\n * Utility hook to get and subscribe to state\n */\n public useState(): TState {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useSceneObjectState(this);\n }\n\n /** Force a re-render, should only be needed when variable values change */\n public forceRender(): void {\n this.setState({});\n }\n\n /**\n * Will create new SceneObject with shallow-cloned state, but all state items of type SceneObject are deep cloned\n */\n public clone(withState?: Partial<TState>): this {\n return cloneSceneObject(this, withState);\n }\n\n /**\n * Allows external code to register code that is executed on activate and deactivate. This allow you\n * to wire up scene objects that need to respond to state changes in other objects from the outside.\n **/\n public addActivationHandler(handler: SceneActivationHandler) {\n this._activationHandlers.push(handler);\n }\n\n /**\n * Loop through state and call callback for each direct child scene object.\n * Checks 1 level deep properties and arrays. So a scene object hidden in a nested plain object will not be detected.\n */\n public forEachChild(callback: (child: SceneObjectBase) => void) {\n forEachChild(this.state, callback);\n }\n\n /** Returns a SceneObjectRef that will resolve to this object */\n public getRef(): SceneObjectRef<this> {\n if (!this._ref) {\n this._ref = new SceneObjectRef(this);\n }\n\n return this._ref;\n }\n}\n\n/**\n * This hook is always returning model.state instead of a useState that remembers the last state emitted on the subject\n * The reason for this is so that if the model instance change this function will always return the latest state.\n */\nexport function useSceneObjectState<TState extends SceneObjectState>(\n model: SceneObject<TState>,\n options?: UseStateHookOptions\n): TState {\n const [_, setState] = useState<TState>(model.state);\n const stateAtFirstRender = model.state;\n const shouldActivateOrKeepAlive = options?.shouldActivateOrKeepAlive ?? false;\n\n useEffect(() => {\n let unactivate: CancelActivationHandler | undefined;\n\n if (shouldActivateOrKeepAlive) {\n unactivate = model.activate();\n }\n\n const s = model.subscribeToState((state) => {\n setState(state);\n });\n\n // Re-render component if the state changed between first render and useEffect (mount)\n if (model.state !== stateAtFirstRender) {\n setState(model.state);\n }\n\n return () => {\n s.unsubscribe();\n\n if (unactivate) {\n unactivate();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [model, shouldActivateOrKeepAlive]);\n\n return model.state;\n}\n\nfunction forEachChild<T extends object>(state: T, callback: (child: SceneObjectBase) => void) {\n for (const propValue of Object.values(state)) {\n if (propValue instanceof SceneObjectBase) {\n callback(propValue);\n }\n\n if (Array.isArray(propValue)) {\n for (const child of propValue) {\n if (child instanceof SceneObjectBase) {\n callback(child);\n }\n }\n }\n }\n}\n","import { SceneObject, SceneObjectState } from '../types';\n\nimport { SceneObjectBase } from '../SceneObjectBase';\nimport { SceneObjectRef } from '../SceneObjectRef';\n\n/**\n * Will create new SceneItem with shalled cloned state, but all states items of type SceneObject are deep cloned\n */\nexport function cloneSceneObject<T extends SceneObjectBase<TState>, TState extends SceneObjectState>(\n sceneObject: SceneObjectBase<TState>,\n withState?: Partial<TState>\n): T {\n const clonedState = cloneSceneObjectState(sceneObject.state, withState);\n return new (sceneObject.constructor as any)(clonedState);\n}\n\nexport function cloneSceneObjectState<TState extends SceneObjectState>(\n sceneState: TState,\n withState?: Partial<TState>\n): TState {\n const clonedState = { ...sceneState };\n\n // Clone any SceneItems in state\n for (const key in clonedState) {\n const propValue = clonedState[key];\n if (propValue instanceof SceneObjectBase) {\n clonedState[key] = propValue.clone();\n }\n\n if (propValue instanceof SceneObjectRef) {\n throw new Error('Cannot clone a SceneObject with a SceneObjectRef in state');\n }\n\n // Clone scene objects in arrays\n if (Array.isArray(propValue)) {\n const newArray: any = [];\n for (const child of propValue) {\n if (child instanceof SceneObjectBase) {\n newArray.push(child.clone());\n } else {\n newArray.push(child);\n }\n }\n clonedState[key] = newArray;\n }\n }\n\n Object.assign(clonedState, withState);\n\n return clonedState;\n}\n\n/** Walks up the scene graph, returning the first non-undefined result of `extract` */\nexport function getClosest<T>(sceneObject: SceneObject, extract: (s: SceneObject) => T | undefined): T | undefined {\n let curSceneObject: SceneObject | undefined = sceneObject;\n let extracted: T | undefined = undefined;\n\n while (curSceneObject && !extracted) {\n extracted = extract(curSceneObject);\n curSceneObject = curSceneObject.parent;\n }\n\n return extracted;\n}\n","import { DataQuery, DataSourceApi, PluginType } from '@grafana/data';\n\nexport abstract class RuntimeDataSource<TQuery extends DataQuery = DataQuery> extends DataSourceApi<TQuery> {\n public constructor(pluginId: string, uid: string) {\n super({\n name: 'RuntimeDataSource-' + pluginId,\n uid: uid,\n type: pluginId,\n id: 1,\n readOnly: true,\n jsonData: {},\n access: 'direct',\n meta: {\n id: pluginId,\n name: 'RuntimeDataSource-' + pluginId,\n type: PluginType.datasource,\n info: {\n author: {\n name: '',\n },\n description: '',\n links: [],\n logos: {\n large: '',\n small: '',\n },\n screenshots: [],\n updated: '',\n version: '',\n },\n module: '',\n baseUrl: '',\n },\n });\n }\n\n public testDatasource(): Promise<any> {\n return Promise.resolve({});\n }\n}\n\nexport const runtimeDataSources = new Map<string, RuntimeDataSource>();\n\nexport interface RuntimeDataSourceOptions {\n dataSource: RuntimeDataSource;\n}\n\n/**\n * Provides a way to register runtime panel plugins.\n * Please use a pluginId that is unlikely to collide with other plugins.\n */\nexport function registerRuntimeDataSource({ dataSource }: RuntimeDataSourceOptions) {\n if (runtimeDataSources.has(dataSource.uid)) {\n throw new Error(`A runtime data source with uid ${dataSource.uid} has already been registered`);\n }\n\n runtimeDataSources.set(dataSource.uid, dataSource);\n}\n","import { SceneObject } from '../core/types';\nimport { SceneVariable } from './types';\n\n/**\n * Will walk the scene object graph up to the root looking for the first variable with the specified name\n */\nexport function lookupVariable(name: string, sceneObject: SceneObject): SceneVariable | null {\n const variables = sceneObject.state.$variables;\n if (!variables) {\n if (sceneObject.parent) {\n return lookupVariable(name, sceneObject.parent);\n } else {\n return null;\n }\n }\n\n const found = variables.getByName(name);\n if (found) {\n return found;\n } else if (sceneObject.parent) {\n return lookupVariable(name, sceneObject.parent);\n }\n\n return null;\n}\n","import { getDefaultTimeRange, PanelData } from '@grafana/data';\nimport { LoadingState } from '@grafana/schema';\nimport { of } from 'rxjs';\n\nimport { SceneObjectBase } from './SceneObjectBase';\nimport { SceneDataProvider, SceneDataProviderResult, SceneDataState } from './types';\n\nexport interface SceneDataNodeState extends SceneDataState {\n data: PanelData;\n}\n\nexport class SceneDataNode extends SceneObjectBase<SceneDataNodeState> implements SceneDataProvider {\n public constructor(state?: Partial<SceneDataNodeState>) {\n super({\n data: emptyPanelData,\n ...state,\n });\n }\n\n public getResultsStream() {\n const result: SceneDataProviderResult = {\n origin: this,\n data: this.state.data,\n };\n\n return of(result);\n }\n}\n\nexport const emptyPanelData: PanelData = {\n state: LoadingState.Done,\n series: [],\n timeRange: getDefaultTimeRange(),\n};\n","import { SceneObjectUrlSyncHandler, SceneObjectWithUrlSync, SceneObjectUrlValues } from '../core/types';\n\ninterface SceneObjectUrlSyncConfigOptions {\n keys: string[] | (() => string[]);\n}\n\nexport class SceneObjectUrlSyncConfig implements SceneObjectUrlSyncHandler {\n private _keys: string[] | (() => string[]);\n\n public constructor(private _sceneObject: SceneObjectWithUrlSync, _options: SceneObjectUrlSyncConfigOptions) {\n this._keys = _options.keys;\n }\n\n public getKeys(): string[] {\n if (typeof this._keys === 'function') {\n return this._keys();\n }\n\n return this._keys;\n }\n\n public getUrlState(): SceneObjectUrlValues {\n return this._sceneObject.getUrlState();\n }\n\n public updateFromUrl(values: SceneObjectUrlValues): void {\n this._sceneObject.updateFromUrl(values);\n }\n}\n","import { toUtc } from '@grafana/data';\nimport { SceneObjectUrlValue } from '../core/types';\n\nconst INTERVAL_STRING_REGEX = /^\\d+[yYmMsSwWhHdD]$/;\n\nexport function parseUrlParam(value: SceneObjectUrlValue): string | null {\n if (typeof value !== 'string') {\n return null;\n }\n\n if (value.indexOf('now') !== -1) {\n return value;\n }\n\n if (INTERVAL_STRING_REGEX.test(value)) {\n return value;\n }\n\n if (value.length === 8) {\n const utcValue = toUtc(value, 'YYYYMMDD');\n if (utcValue.isValid()) {\n return utcValue.toISOString();\n }\n } else if (value.length === 15) {\n const utcValue = toUtc(value, 'YYYYMMDDTHHmmss');\n if (utcValue.isValid()) {\n return utcValue.toISOString();\n }\n } else if (value.length === 24) {\n const utcValue = toUtc(value);\n return utcValue.toISOString();\n }\n\n const epoch = parseInt(value, 10);\n if (!isNaN(epoch)) {\n return toUtc(epoch).toISOString();\n }\n\n return null;\n}\n","import { dateMath, DateTime, TimeRange } from '@grafana/data';\nimport { TimeZone } from '@grafana/schema';\n\nexport function evaluateTimeRange(\n from: string | DateTime,\n to: string | DateTime,\n timeZone: TimeZone,\n fiscalYearStartMonth?: number,\n delay?: string\n): TimeRange {\n const hasDelay = delay && to === 'now';\n\n return {\n from: dateMath.parse(from, false, timeZone, fiscalYearStartMonth)!,\n to: dateMath.parse(hasDelay ? 'now-' + delay : to, true, timeZone, fiscalYearStartMonth)!,\n raw: {\n from: from,\n to: to,\n },\n };\n}\n","import { getTimeZone, rangeUtil, setWeekStart, TimeRange } from '@grafana/data';\nimport { TimeZone } from '@grafana/schema';\n\nimport { SceneObjectUrlSyncConfig } from '../services/SceneObjectUrlSyncConfig';\n\nimport { SceneObjectBase } from './SceneObjectBase';\nimport { SceneTimeRangeLike, SceneTimeRangeState, SceneObjectUrlValues } from './types';\nimport { getClosest } from './sceneGraph/utils';\nimport { parseUrlParam } from '../utils/parseUrlParam';\nimport { evaluateTimeRange } from '../utils/evaluateTimeRange';\nimport { config, RefreshEvent } from '@grafana/runtime';\n\nexport class SceneTimeRange extends SceneObjectBase<SceneTimeRangeState> implements SceneTimeRangeLike {\n protected _urlSync = new SceneObjectUrlSyncConfig(this, { keys: ['from', 'to', 'timezone'] });\n\n public constructor(state: Partial<SceneTimeRangeState> = {}) {\n const from = state.from ?? 'now-6h';\n const to = state.to ?? 'now';\n const timeZone = state.timeZone;\n const value = evaluateTimeRange(\n from,\n to,\n timeZone || getTimeZone(),\n state.fiscalYearStartMonth,\n state.UNSAFE_nowDelay\n );\n const refreshOnActivate = state.refreshOnActivate ?? { percent: 10 };\n super({ from, to, timeZone, value, refreshOnActivate, ...state });\n\n this.addActivationHandler(this._onActivate.bind(this));\n }\n\n private _onActivate() {\n // When SceneTimeRange has no time zone provided, find closest source of time zone and subscribe to it\n if (!this.state.timeZone) {\n const timeZoneSource = this.getTimeZoneSource();\n if (timeZoneSource !== this) {\n this._subs.add(\n timeZoneSource.subscribeToState((n, p) => {\n if (n.timeZone !== undefined && n.timeZone !== p.timeZone) {\n this.setState({\n value: evaluateTimeRange(\n this.state.from,\n this.state.to,\n timeZoneSource.getTimeZone(),\n this.state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n ),\n });\n }\n })\n );\n }\n }\n\n if (this.state.weekStart) {\n setWeekStart(this.state.weekStart);\n }\n\n if (rangeUtil.isRelativeTimeRange(this.state.value.raw)) {\n this.refreshIfStale();\n }\n\n // Deactivation handler that restore weekStart if it was changed\n return () => {\n if (this.state.weekStart) {\n setWeekStart(config.bootData.user.weekStart);\n }\n };\n }\n\n private refreshIfStale() {\n let ms;\n if (this.state?.refreshOnActivate?.percent !== undefined) {\n ms = this.calculatePercentOfInterval(this.state.refreshOnActivate.percent);\n }\n if (this.state?.refreshOnActivate?.afterMs !== undefined) {\n ms = Math.min(this.state.refreshOnActivate.afterMs, ms ?? Infinity);\n }\n if (ms !== undefined) {\n this.refreshRange(ms);\n }\n }\n\n /**\n * Will traverse up the scene graph to find the closest SceneTimeRangeLike with time zone set\n */\n private getTimeZoneSource() {\n if (!this.parent || !this.parent.parent) {\n return this;\n }\n // Find the closest source of time zone\n const source = getClosest<SceneTimeRangeLike>(this.parent.parent, (o) => {\n if (o.state.$timeRange && o.state.$timeRange.state.timeZone) {\n return o.state.$timeRange;\n }\n return undefined;\n });\n\n if (!source) {\n return this;\n }\n\n return source;\n }\n\n /**\n * Refreshes time range if it is older than the invalidation interval\n * @param refreshAfterMs invalidation interval (milliseconds)\n * @private\n */\n private refreshRange(refreshAfterMs: number) {\n const value = evaluateTimeRange(\n this.state.from,\n this.state.to,\n this.state.timeZone ?? getTimeZone(),\n this.state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n );\n\n const diff = value.to.diff(this.state.value.to, 'milliseconds');\n if (diff >= refreshAfterMs) {\n this.setState({\n value,\n });\n }\n }\n\n private calculatePercentOfInterval(percent: number): number {\n const intervalMs = this.state.value.to.diff(this.state.value.from, 'milliseconds');\n return Math.ceil(intervalMs / percent);\n }\n\n public getTimeZone(): TimeZone {\n // Return local time zone if provided\n if (this.state.timeZone) {\n return this.state.timeZone;\n }\n\n // Resolve higher level time zone source\n const timeZoneSource = this.getTimeZoneSource();\n if (timeZoneSource !== this) {\n return timeZoneSource.state.timeZone!;\n }\n\n // Return default time zone\n return getTimeZone();\n }\n\n public onTimeRangeChange = (timeRange: TimeRange) => {\n const update: Partial<SceneTimeRangeState> = {};\n const updateToEval: Partial<SceneTimeRangeState> = {};\n\n if (typeof timeRange.raw.from === 'string') {\n update.from = timeRange.raw.from;\n updateToEval.from = timeRange.raw.from;\n } else {\n update.from = timeRange.raw.from.toISOString();\n updateToEval.from = timeRange.raw.from.toISOString(true);\n }\n\n if (typeof timeRange.raw.to === 'string') {\n update.to = timeRange.raw.to;\n updateToEval.to = timeRange.raw.to;\n } else {\n update.to = timeRange.raw.to.toISOString();\n updateToEval.to = timeRange.raw.to.toISOString(true);\n }\n\n update.value = evaluateTimeRange(\n updateToEval.from,\n updateToEval.to,\n this.getTimeZone(),\n this.state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n );\n\n // Only update if time range actually changed\n if (update.from !== this.state.from || update.to !== this.state.to) {\n this.setState(update);\n }\n };\n\n public onTimeZoneChange = (timeZone: TimeZone) => {\n this.setState({ timeZone });\n };\n\n public onRefresh = () => {\n this.setState({\n value: evaluateTimeRange(\n this.state.from,\n this.state.to,\n this.getTimeZone(),\n this.state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n ),\n });\n\n this.publishEvent(new RefreshEvent(), true);\n };\n\n public getUrlState() {\n const urlValues: SceneObjectUrlValues = { from: this.state.from, to: this.state.to };\n if (this.state.timeZone) {\n urlValues.timezone = this.state.timeZone;\n }\n\n return urlValues;\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n // ignore if both are missing\n if (!values.to && !values.from) {\n return;\n }\n\n const update: Partial<SceneTimeRangeState> = {};\n const from = parseUrlParam(values.from);\n\n if (from) {\n update.from = from;\n }\n\n const to = parseUrlParam(values.to);\n if (to) {\n update.to = to;\n }\n\n if (typeof values.timezone === 'string') {\n update.timeZone = values.timezone !== '' ? values.timezone : undefined;\n }\n\n update.value = evaluateTimeRange(\n update.from ?? this.state.from,\n update.to ?? this.state.to,\n update.timeZone ?? this.getTimeZone(),\n this.state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n );\n\n this.setState(update);\n }\n}\n","import { SceneDataNode } from '../../core/SceneDataNode';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneTimeRange } from '../../core/SceneTimeRange';\nimport { SceneVariable, SceneVariables, SceneVariableSetState, SceneVariableState } from '../types';\n\nexport const EmptyDataNode = new SceneDataNode();\nexport const DefaultTimeRange = new SceneTimeRange();\n\n/**\n * Since this is used from sceneGraph.getVariables we cannot reference SceneVariableSet here as it would create a circular reference\n */\nexport class EmptyVariableSetImpl extends SceneObjectBase<SceneVariableSetState> implements SceneVariables {\n public constructor() {\n super({ variables: [] });\n }\n\n public getByName(name: string): SceneVariable<SceneVariableState> | undefined {\n return undefined;\n }\n\n public isVariableLoadingOrWaitingToUpdate(variable: SceneVariable<SceneVariableState>): boolean {\n return false;\n }\n}\n\nexport const EmptyVariableSet = new EmptyVariableSetImpl();\n","import { DefaultTimeRange } from '../../variables/interpolation/defaults';\nimport { SceneObject, SceneTimeRangeLike } from '../types';\nimport { getClosest } from './utils';\n\n/**\n * Will walk up the scene object graph to the closest $timeRange scene object\n */\nexport function getTimeRange(sceneObject: SceneObject): SceneTimeRangeLike {\n return getClosest(sceneObject, (s) => s.state.$timeRange) ?? DefaultTimeRange;\n}\n","import { Observable } from 'rxjs';\n\nimport { BusEventWithPayload } from '@grafana/data';\nimport { VariableType, VariableHide } from '@grafana/schema';\n\nimport { SceneObject, SceneObjectState } from '../core/types';\n\nexport interface SceneVariableState extends SceneObjectState {\n type: VariableType;\n name: string;\n label?: string;\n hide?: VariableHide;\n skipUrlSync?: boolean;\n loading?: boolean;\n error?: any | null;\n description?: string | null;\n}\n\nexport interface SceneVariable<TState extends SceneVariableState = SceneVariableState> extends SceneObject<TState> {\n /**\n * This function is called on activation or when a dependency changes.\n */\n validateAndUpdate?(): Observable<ValidateAndUpdateResult>;\n\n /**\n * Should return the value for the given field path\n */\n getValue(fieldPath?: string): VariableValue | undefined | null;\n\n /**\n * Should return the value display text, used by the \"text\" formatter\n * Example: ${podId:text}\n * Useful for variables that have non user friendly values but friendly display text names.\n */\n getValueText?(fieldPath?: string): string;\n\n /**\n * For special edge case senarios. For example local function that locally scoped variables can implement.\n **/\n isAncestorLoading?(): boolean;\n\n /**\n * Allows cancelling variable execution.\n */\n onCancel?(): void;\n\n /**\n * @experimental\n * Indicates that a variable loads values lazily when user interacts with the variable dropdown.\n */\n isLazy?: boolean;\n}\n\nexport type VariableValue = VariableValueSingle | VariableValueSingle[];\n\nexport type VariableValueSingle = string | boolean | number | CustomVariableValue;\n\n/**\n * This is for edge case values like the custom \"allValue\" that should not be escaped/formatted like other values\n * The custom all value usually contain wildcards that should not be escaped.\n */\nexport interface CustomVariableValue {\n /**\n * The format name or function used in the expression\n */\n formatter(formatNameOrFn?: string | VariableCustomFormatterFn): string;\n}\n\nexport interface ValidateAndUpdateResult {}\nexport interface VariableValueOption {\n label: string;\n value: VariableValueSingle;\n group?: string;\n}\n\nexport interface SceneVariableSetState extends SceneObjectState {\n variables: SceneVariable[];\n}\n\nexport interface SceneVariables extends SceneObject<SceneVariableSetState> {\n /**\n * Will look for and return variable matching name\n */\n getByName(name: string): SceneVariable | undefined;\n /**\n * Will return true if the variable is loading or waiting for an update to complete.\n */\n isVariableLoadingOrWaitingToUpdate(variable: SceneVariable): boolean;\n}\n\nexport class SceneVariableValueChangedEvent extends BusEventWithPayload<SceneVariable> {\n public static type = 'scene-variable-changed-value';\n}\n\nexport interface SceneVariableDependencyConfigLike {\n /** Return all variable names this object depend on */\n getNames(): Set<string>;\n\n /** Used to check for dependency on a specific variable */\n hasDependencyOn(name: string): boolean;\n\n /**\n * Will be called when the VariableSet have completed an update process or when a variable has changed value.\n **/\n variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void;\n}\n\n/**\n * Used in CustomFormatterFn\n */\nexport interface CustomFormatterVariable {\n name: string;\n type: VariableType;\n multi?: boolean;\n includeAll?: boolean;\n}\n\nexport type VariableCustomFormatterFn = (\n value: unknown,\n legacyVariableModel: Partial<CustomFormatterVariable>,\n legacyDefaultFormatter?: VariableCustomFormatterFn\n) => string;\n\nexport type InterpolationFormatParameter = string | VariableCustomFormatterFn | undefined;\n\nexport function isCustomVariableValue(value: VariableValue): value is CustomVariableValue {\n return typeof value === 'object' && 'formatter' in value;\n}\n","import { property } from 'lodash';\n\ninterface FieldAccessorCache {\n [key: string]: (obj: object) => any;\n}\n\nlet fieldAccessorCache: FieldAccessorCache = {};\n\nexport function getFieldAccessor(fieldPath: string) {\n const accessor = fieldAccessorCache[fieldPath];\n if (accessor) {\n return accessor;\n }\n\n return (fieldAccessorCache[fieldPath] = property(fieldPath));\n}\n","import { ScopedVar } from '@grafana/data';\n\nimport { VariableValue } from '../types';\n\nimport { FormatVariable } from './formatRegistry';\nimport { getFieldAccessor } from './fieldAccessorCache';\n\nexport class ScopedVarsVariable implements FormatVariable {\n public state: { name: string; value: ScopedVar; type: string };\n\n public constructor(name: string, value: ScopedVar) {\n this.state = { name, value, type: 'scopedvar' };\n }\n\n public getValue(fieldPath: string): VariableValue {\n let { value } = this.state;\n let realValue = value.value;\n\n if (fieldPath) {\n realValue = getFieldAccessor(fieldPath)(value.value);\n } else {\n realValue = value.value;\n }\n\n if (realValue === 'string' || realValue === 'number' || realValue === 'boolean') {\n return realValue;\n }\n\n return String(realValue);\n }\n\n public getValueText(): string {\n const { value } = this.state;\n\n if (value.text != null) {\n return String(value.text);\n }\n\n return String(value);\n }\n}\n\nlet scopedVarsVariable: ScopedVarsVariable | undefined;\n\n/**\n * Reuses a single instance to avoid unnecessary memory allocations\n */\nexport function getSceneVariableForScopedVar(name: string, value: ScopedVar): FormatVariable {\n if (!scopedVarsVariable) {\n scopedVarsVariable = new ScopedVarsVariable(name, value);\n } else {\n scopedVarsVariable.state.name = name;\n scopedVarsVariable.state.value = value;\n }\n\n return scopedVarsVariable;\n}\n","export const ALL_VARIABLE_TEXT = 'All';\nexport const ALL_VARIABLE_VALUE = '$__all';\nexport const NONE_VARIABLE_TEXT = 'None';\nexport const NONE_VARIABLE_VALUE = '';\nexport const AUTO_VARIABLE_TEXT = 'Auto';\nexport const AUTO_VARIABLE_VALUE = '$__auto';\n\n// Grafana core source: https://github.com/grafana/grafana/blob/main/public/app/features/variables/utils.ts#L23\n/*\n * This regex matches 3 types of variable reference with an optional format specifier\n * \\$(\\w+) $var1\n * \\[\\[(\\w+?)(?::(\\w+))?\\]\\] [[var2]] or [[var2:fmt2]]\n * \\${(\\w+)(?::(\\w+))?} ${var3} or ${var3:fmt3}\n */\nexport const VARIABLE_REGEX = /\\$(\\w+)|\\[\\[(\\w+?)(?::(\\w+))?\\]\\]|\\${(\\w+)(?:\\.([^:^\\}]+))?(?::([^\\}]+))?}/g;\nexport const SEARCH_FILTER_VARIABLE = '__searchFilter';\n","import { isArray, map, replace } from 'lodash';\n\nimport { dateTime, Registry, RegistryItem, textUtil, escapeRegex } from '@grafana/data';\nimport { VariableType, VariableFormatID } from '@grafana/schema';\n\nimport { VariableValue, VariableValueSingle } from '../types';\nimport { ALL_VARIABLE_VALUE } from '../constants';\n\nexport interface FormatRegistryItem extends RegistryItem {\n formatter(value: VariableValue, args: string[], variable: FormatVariable): string;\n}\n\n/**\n * Slimmed down version of the SceneVariable interface so that it only contains what the formatters actually use.\n * This is useful as we have some implementations of this interface that does not need to be full scene objects.\n * For example ScopedVarsVariable and LegacyVariableWrapper.\n */\nexport interface FormatVariable {\n state: {\n name: string;\n type: VariableType | string;\n isMulti?: boolean;\n includeAll?: boolean;\n };\n\n getValue(fieldPath?: string): VariableValue | undefined | null;\n getValueText?(fieldPath?: string): string;\n}\n\nexport const formatRegistry = new Registry<FormatRegistryItem>(() => {\n const formats: FormatRegistryItem[] = [\n {\n id: VariableFormatID.Lucene,\n name: 'Lucene',\n description: 'Values are lucene escaped and multi-valued variables generate an OR expression',\n formatter: (value) => {\n if (typeof value === 'string') {\n return luceneEscape(value);\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '__empty__';\n }\n const quotedValues = map(value, (val: string) => {\n return '\"' + luceneEscape(val) + '\"';\n });\n return '(' + quotedValues.join(' OR ') + ')';\n } else {\n return luceneEscape(`${value}`);\n }\n },\n },\n {\n id: VariableFormatID.Raw,\n name: 'raw',\n description: 'Keep value as is',\n formatter: (value) => String(value),\n },\n {\n id: VariableFormatID.Regex,\n name: 'Regex',\n description: 'Values are regex escaped and multi-valued variables generate a (<value>|<value>) expression',\n formatter: (value) => {\n if (typeof value === 'string') {\n return escapeRegex(value);\n }\n\n if (Array.isArray(value)) {\n const escapedValues = value.map((item) => {\n if (typeof item === 'string') {\n return escapeRegex(item);\n } else {\n return escapeRegex(String(item));\n }\n });\n\n if (escapedValues.length === 1) {\n return escapedValues[0];\n }\n\n return '(' + escapedValues.join('|') + ')';\n }\n\n return escapeRegex(`${value}`);\n },\n },\n {\n id: VariableFormatID.Pipe,\n name: 'Pipe',\n description: 'Values are separated by | character',\n formatter: (value) => {\n if (typeof value === 'string') {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.join('|');\n }\n\n return `${value}`;\n },\n },\n {\n id: VariableFormatID.Distributed,\n name: 'Distributed',\n description: 'Multiple values are formatted like variable=value',\n formatter: (value, args, variable) => {\n if (typeof value === 'string') {\n return value;\n }\n\n if (Array.isArray(value)) {\n value = map(value, (val: string, index: number) => {\n if (index !== 0) {\n return variable.state.name + '=' + val;\n } else {\n return val;\n }\n });\n\n return value.join(',');\n }\n\n return `${value}`;\n },\n },\n {\n id: VariableFormatID.CSV,\n name: 'Csv',\n description: 'Comma-separated values',\n formatter: (value) => {\n if (typeof value === 'string') {\n return value;\n }\n\n if (isArray(value)) {\n return value.join(',');\n }\n\n return String(value);\n },\n },\n {\n id: VariableFormatID.HTML,\n name: 'HTML',\n description: 'HTML escaping of values',\n formatter: (value) => {\n if (typeof value === 'string') {\n return textUtil.escapeHtml(value);\n }\n\n if (isArray(value)) {\n return textUtil.escapeHtml(value.join(', '));\n }\n\n return textUtil.escapeHtml(String(value));\n },\n },\n {\n id: VariableFormatID.JSON,\n name: 'JSON',\n description: 'JSON stringify value',\n formatter: (value) => {\n if (typeof value === 'string') {\n return value;\n }\n return JSON.stringify(value);\n },\n },\n {\n id: VariableFormatID.PercentEncode,\n name: 'Percent encode',\n description: 'Useful for URL escaping values',\n formatter: (value) => {\n // like glob, but url escaped\n if (isArray(value)) {\n return encodeURIComponentStrict('{' + value.join(',') + '}');\n }\n\n return encodeURIComponentStrict(value);\n },\n },\n {\n id: VariableFormatID.SingleQuote,\n name: 'Single quote',\n description: 'Single quoted values',\n formatter: (value) => {\n // escape single quotes with backslash\n const regExp = new RegExp(`'`, 'g');\n\n if (isArray(value)) {\n return map(value, (v: string) => `'${replace(v, regExp, `\\\\'`)}'`).join(',');\n }\n\n let strVal = typeof value === 'string' ? value : String(value);\n return `'${replace(strVal, regExp, `\\\\'`)}'`;\n },\n },\n {\n id: VariableFormatID.DoubleQuote,\n name: 'Double quote',\n description: 'Double quoted values',\n formatter: (value) => {\n // escape double quotes with backslash\n const regExp = new RegExp('\"', 'g');\n if (isArray(value)) {\n return map(value, (v: string) => `\"${replace(v, regExp, '\\\\\"')}\"`).join(',');\n }\n\n let strVal = typeof value === 'string' ? value : String(value);\n return `\"${replace(strVal, regExp, '\\\\\"')}\"`;\n },\n },\n {\n id: VariableFormatID.SQLString,\n name: 'SQL string',\n description: 'SQL string quoting and commas for use in IN statements and other scenarios',\n formatter: sqlStringFormatter,\n },\n {\n id: VariableFormatID.Date,\n name: 'Date',\n description: 'Format date in different ways',\n formatter: (value, args) => {\n let nrValue = NaN;\n\n if (typeof value === 'number') {\n nrValue = value;\n } else if (typeof value === 'string') {\n nrValue = parseInt(value, 10);\n }\n\n if (isNaN(nrValue)) {\n return 'NaN';\n }\n\n const arg = args[0] ?? 'iso';\n switch (arg) {\n case 'ms':\n return String(value);\n case 'seconds':\n return `${Math.round(nrValue! / 1000)}`;\n case 'iso':\n return dateTime(nrValue).toISOString();\n default:\n if ((args || []).length > 1) {\n return dateTime(nrValue).format(args.join(':'));\n }\n return dateTime(nrValue).format(arg);\n }\n },\n },\n {\n id: VariableFormatID.Glob,\n name: 'Glob',\n description: 'Format multi-valued variables using glob syntax, example {value1,value2}',\n formatter: (value) => {\n if (isArray(value) && value.length > 1) {\n return '{' + value.join(',') + '}';\n }\n return String(value);\n },\n },\n {\n id: VariableFormatID.Text,\n name: 'Text',\n description: 'Format variables in their text representation. Example in multi-variable scenario A + B + C.',\n formatter: (value, _args, variable) => {\n if (variable.getValueText) {\n return variable.getValueText();\n }\n\n return String(value);\n },\n },\n {\n id: VariableFormatID.QueryParam,\n name: 'Query parameter',\n description:\n 'Format variables as URL parameters. Example in multi-variable scenario A + B + C => var-foo=A&var-foo=B&var-foo=C.',\n formatter: (value, _args, variable) => {\n if (Array.isArray(value)) {\n return value.map((v) => formatQueryParameter(variable.state.name, v)).join('&');\n }\n return formatQueryParameter(variable.state.name, value);\n },\n },\n {\n id: VariableFormatID.UriEncode,\n name: 'Percent encode as URI',\n description: 'Useful for URL escaping values, taking into URI syntax characters',\n formatter: (value: VariableValue) => {\n if (isArray(value)) {\n return encodeURIStrict('{' + value.join(',') + '}');\n }\n\n return encodeURIStrict(value);\n },\n },\n ];\n\n return formats;\n});\n\nfunction luceneEscape(value: string) {\n if (isNaN(+value) === false) {\n return value;\n }\n\n return value.replace(/([\\!\\*\\+\\-\\=<>\\s\\&\\|\\(\\)\\[\\]\\{\\}\\^\\~\\?\\:\\\\/\"])/g, '\\\\$1');\n}\n\n/**\n * encode string according to RFC 3986; in contrast to encodeURIComponent()\n * also the sub-delims \"!\", \"'\", \"(\", \")\" and \"*\" are encoded;\n * unicode handling uses UTF-8 as in ECMA-262.\n */\nfunction encodeURIComponentStrict(str: VariableValueSingle) {\n if (typeof str === 'object') {\n str = String(str);\n }\n\n return replaceSpecialCharactersToASCII(encodeURIComponent(str));\n}\n\nconst encodeURIStrict = (str: VariableValueSingle): string => replaceSpecialCharactersToASCII(encodeURI(String(str)));\n\nconst replaceSpecialCharactersToASCII = (value: string): string =>\n value.replace(/[!'()*]/g, (c) => {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase();\n });\n\nfunction formatQueryParameter(name: string, value: VariableValueSingle): string {\n return `var-${name}=${encodeURIComponentStrict(value)}`;\n}\n\nexport function isAllValue(value: VariableValueSingle) {\n return value === ALL_VARIABLE_VALUE || (Array.isArray(value) && value[0] === ALL_VARIABLE_VALUE);\n}\n\nconst SQL_ESCAPE_MAP: Record<string, string> = {\n \"'\": \"''\",\n '\"': '\\\\\"',\n};\n\nfunction sqlStringFormatter(value: VariableValue) {\n // escape single quotes by pairing them\n const regExp = new RegExp(`'|\"`, 'g');\n\n if (isArray(value)) {\n return map(value, (v: string) => `'${replace(v, regExp, (match) => SQL_ESCAPE_MAP[match] ?? '')}'`).join(',');\n }\n\n let strVal = typeof value === 'string' ? value : String(value);\n return `'${replace(strVal, regExp, (match) => SQL_ESCAPE_MAP[match] ?? '')}'`;\n}\n","import { ScopedVars } from '@grafana/data';\nimport { SceneObject } from '../../core/types';\nimport { FormatVariable } from '../interpolation/formatRegistry';\nimport { CustomVariableValue } from '../types';\n\nexport interface MacroVariableConstructor {\n new (name: string, sceneObject: SceneObject, fullMatch: string, scopedVars?: ScopedVars): FormatVariable;\n}\n\n/**\n * The sceneInterpolator will detect if getValue returns VariableValueCustom and will skip the normal formatting\n * This is useful as otherwise we would url encode macros like $__all_variables twice.\n */\nexport class SkipFormattingValue implements CustomVariableValue {\n public constructor(private _value: string) {}\n\n public formatter(): string {\n return this._value;\n }\n}\n","import { dateTimeFormat, urlUtil } from '@grafana/data';\nimport { getTimeRange } from '../../core/sceneGraph/getTimeRange';\nimport { getData } from '../../core/sceneGraph/sceneGraph';\nimport { SceneObject } from '../../core/types';\nimport { FormatVariable } from '../interpolation/formatRegistry';\nimport { SkipFormattingValue } from './types';\n\n/**\n * Handles expressions like $__url_time_range.\n */\nexport class UrlTimeRangeMacro implements FormatVariable {\n public state: { name: string; type: string };\n private _sceneObject: SceneObject;\n\n public constructor(name: string, sceneObject: SceneObject) {\n this.state = { name: name, type: 'url_variable' };\n this._sceneObject = sceneObject;\n }\n\n public getValue(): SkipFormattingValue {\n const timeRange = getTimeRange(this._sceneObject);\n const urlState = timeRange.urlSync?.getUrlState();\n return new SkipFormattingValue(urlUtil.toUrlParams(urlState));\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\n/**\n * Handles expressions like $__from and $__to.\n */\nexport class TimeFromAndToMacro implements FormatVariable {\n public state: { name: string; type: string };\n private _sceneObject: SceneObject;\n\n public constructor(name: string, sceneObject: SceneObject) {\n this.state = { name: name, type: 'time_macro' };\n this._sceneObject = sceneObject;\n }\n\n public getValue() {\n const timeRange = getTimeRange(this._sceneObject);\n if (this.state.name === '__from') {\n return timeRange.state.value.from.valueOf();\n } else {\n return timeRange.state.value.to.valueOf();\n }\n }\n\n public getValueText?(): string {\n const timeRange = getTimeRange(this._sceneObject);\n if (this.state.name === '__from') {\n return dateTimeFormat(timeRange.state.value.from, { timeZone: timeRange.getTimeZone() });\n } else {\n return dateTimeFormat(timeRange.state.value.to, { timeZone: timeRange.getTimeZone() });\n }\n }\n}\n\n/**\n * Handles $__timezone expression.\n */\nexport class TimezoneMacro implements FormatVariable {\n public state: { name: string; type: string };\n private _sceneObject: SceneObject;\n\n public constructor(name: string, sceneObject: SceneObject) {\n this.state = { name: name, type: 'time_macro' };\n this._sceneObject = sceneObject;\n }\n\n public getValue() {\n const timeRange = getTimeRange(this._sceneObject);\n const timeZone = timeRange.getTimeZone();\n\n if (timeZone === 'browser') {\n return Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n return timeZone;\n }\n\n public getValueText?(): string {\n return this.getValue();\n }\n}\n\n/**\n * Handles $__interval and $__intervalMs expression.\n */\nexport class IntervalMacro implements FormatVariable {\n public state: { name: string; type: string; match: string };\n private _sceneObject: SceneObject;\n\n public constructor(name: string, sceneObject: SceneObject, match: string) {\n this.state = { name: name, type: 'time_macro', match: match };\n this._sceneObject = sceneObject;\n }\n\n public getValue() {\n const data = getData(this._sceneObject);\n\n if (data) {\n const request = data.state.data?.request;\n if (!request) {\n return this.state.match;\n }\n if (this.state.name === '__interval_ms') {\n return request.intervalMs;\n }\n return request.interval;\n }\n\n return this.state.match;\n }\n}\n","import { SceneObject } from '../../core/types';\nimport { isCustomVariableValue, SceneVariable } from '../types';\nimport { formatRegistry, FormatVariable } from '../interpolation/formatRegistry';\nimport { SkipFormattingValue } from './types';\nimport { VariableFormatID } from '@grafana/schema';\n\nexport class AllVariablesMacro implements FormatVariable {\n public state: { name: string; type: string };\n private _sceneObject: SceneObject;\n\n public constructor(name: string, sceneObject: SceneObject) {\n this.state = { name, type: 'url_variable' };\n this._sceneObject = sceneObject;\n }\n\n public getValue(): SkipFormattingValue {\n const allVars = collectAllVariables(this._sceneObject);\n const format = formatRegistry.get(VariableFormatID.QueryParam);\n const params: string[] = [];\n\n for (const name of Object.keys(allVars)) {\n const variable = allVars[name];\n const value = variable.getValue();\n\n if (!value) {\n continue;\n }\n\n if (isCustomVariableValue(value)) {\n params.push(value.formatter(VariableFormatID.QueryParam));\n } else {\n params.push(format.formatter(value, [], variable));\n }\n }\n\n return new SkipFormattingValue(params.join('&'));\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\nfunction collectAllVariables(\n sceneObject: SceneObject,\n record: Record<string, SceneVariable> = {}\n): Record<string, SceneVariable> {\n if (sceneObject.state.$variables) {\n for (const variable of sceneObject.state.$variables.state.variables) {\n if (variable.state.skipUrlSync) {\n continue;\n }\n\n if (!record[variable.state.name]) {\n record[variable.state.name] = variable;\n }\n }\n }\n\n if (sceneObject.parent) {\n collectAllVariables(sceneObject.parent, record);\n }\n\n return record;\n}\n","import { Field, DataFrame, getFieldDisplayName, formatLabels } from '@grafana/data';\n\n/**\n * This object is created often, and only used when tmplates exist. Using a proxy lets us delay\n * calculations of the more complex structures (label names) until they are actually used\n */\nexport function getTemplateProxyForField(field: Field, frame?: DataFrame, frames?: DataFrame[]): any {\n return new Proxy(\n {}, // This object shows up in test snapshots\n {\n get: (obj, key) => {\n if (key === 'name') {\n return field.name;\n }\n\n if (key === 'displayName') {\n return getFieldDisplayName(field, frame, frames);\n }\n\n if (key === 'labels' || key === 'formattedLabels') {\n // formattedLabels deprecated\n if (!field.labels) {\n return '';\n }\n return {\n ...field.labels,\n __values: Object.values(field.labels).sort().join(', '),\n toString: () => {\n return formatLabels(field.labels!, '', true);\n },\n };\n }\n return undefined;\n },\n }\n );\n}\n","import {\n FieldType,\n formattedValueToString,\n getDisplayProcessor,\n ScopedVars,\n DataContextScopedVar,\n getFieldDisplayValuesProxy,\n getFrameDisplayName,\n} from '@grafana/data';\nimport { SceneObject } from '../../core/types';\nimport { getFieldAccessor } from '../interpolation/fieldAccessorCache';\nimport { FormatVariable } from '../interpolation/formatRegistry';\nimport { VariableValue } from '../types';\nimport { getTemplateProxyForField } from './templateProxies';\n\n/**\n * This macro handles the ${__value.*} interpolation\n * match represents the regex match and is the full expression, example `${varname.fieldpath}`\n * Macros can return the match when they identify that there required data context is not provided.\n * This leaves the expression intact so that it can be interpolated later when the data context is available.\n */\nexport class ValueMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, sceneObject: SceneObject, private _match: string, private _scopedVars?: ScopedVars) {\n this.state = { name, type: '__value' };\n }\n\n public getValue(fieldPath?: string): VariableValue {\n const dataContext: DataContextScopedVar | undefined = this._scopedVars?.__dataContext;\n if (!dataContext) {\n return this._match;\n }\n\n const { frame, rowIndex, field, calculatedValue } = dataContext.value;\n\n if (calculatedValue) {\n switch (fieldPath) {\n case 'numeric':\n return calculatedValue.numeric;\n case 'raw':\n return calculatedValue.numeric;\n case 'time':\n return '';\n case 'text':\n default:\n return formattedValueToString(calculatedValue);\n }\n }\n\n if (rowIndex == null) {\n return this._match;\n }\n\n if (fieldPath === 'time') {\n const timeField = frame.fields.find((f) => f.type === FieldType.time);\n return timeField ? timeField.values.get(rowIndex) : undefined;\n }\n\n if (!field) {\n return this._match;\n }\n\n const value = field.values.get(rowIndex);\n if (fieldPath === 'raw') {\n return value;\n }\n\n const displayProcessor = field.display ?? fallbackDisplayProcessor;\n const result = displayProcessor(value);\n\n switch (fieldPath) {\n case 'numeric':\n return result.numeric;\n case 'text':\n default:\n return formattedValueToString(result);\n }\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\nconst fallbackDisplayProcessor = getDisplayProcessor();\n\n/**\n * This macro handles the ${__data.*} interpolation. This is a bit poorly named as most of the\n * expressions that this macro evaluates are really \"row\" based values enabling you to access\n * values in other fields on the same row.\n */\nexport class DataMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, sceneObject: SceneObject, private _match: string, private _scopedVars?: ScopedVars) {\n this.state = { name, type: '__data' };\n }\n\n public getValue(fieldPath?: string): VariableValue {\n const dataContext = this._scopedVars?.__dataContext;\n if (!dataContext || !fieldPath) {\n return this._match;\n }\n\n const { frame, rowIndex } = dataContext.value;\n\n if (rowIndex === undefined || fieldPath === undefined) {\n return this._match;\n }\n\n const obj = {\n name: frame.name,\n refId: frame.refId,\n fields: getFieldDisplayValuesProxy({ frame, rowIndex }),\n };\n\n return getFieldAccessor(fieldPath)(obj) ?? '';\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\n/**\n * This macro handles the ${__series.name} interpolation.\n */\nexport class SeriesMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, sceneObject: SceneObject, private _match: string, private _scopedVars?: ScopedVars) {\n this.state = { name, type: '__series' };\n }\n\n public getValue(fieldPath?: string): VariableValue {\n const dataContext = this._scopedVars?.__dataContext;\n if (!dataContext || !fieldPath) {\n return this._match;\n }\n\n if (fieldPath !== 'name') {\n return this._match;\n }\n\n const { frame, frameIndex } = dataContext.value;\n return getFrameDisplayName(frame, frameIndex);\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\n/**\n * This macro handles the ${__field.*} interpolation. These do not require a data context.\n * And can be easily used in field config options like displayName.\n */\nexport class FieldMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, sceneObject: SceneObject, private _match: string, private _scopedVars?: ScopedVars) {\n this.state = { name, type: '__field' };\n }\n\n public getValue(fieldPath?: string): VariableValue {\n const dataContext = this._scopedVars?.__dataContext;\n if (!dataContext || !fieldPath) {\n return this._match;\n }\n\n if (fieldPath === undefined || fieldPath === '') {\n return this._match;\n }\n\n const { frame, field, data } = dataContext.value;\n const obj = getTemplateProxyForField(field, frame, data);\n\n return getFieldAccessor(fieldPath)(obj) ?? '';\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n","import { config, locationService } from '@grafana/runtime';\nimport { SceneObject } from '../../core/types';\nimport { FormatVariable } from '../interpolation/formatRegistry';\nimport { CustomVariableValue } from '../types';\n\nexport class UrlMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, _: SceneObject) {\n this.state = { name: name, type: 'url_macro' };\n }\n\n public getValue(fieldPath?: string) {\n const location = locationService.getLocation();\n const subUrl = config.appSubUrl ?? '';\n\n switch (fieldPath ?? '') {\n case 'params':\n return new UrlStateFormatter(location.search);\n case 'path':\n return subUrl + location.pathname;\n case '':\n default:\n return subUrl + location.pathname + location.search;\n }\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\nclass UrlStateFormatter implements CustomVariableValue {\n public constructor(private _urlQueryParams: string) {}\n\n public formatter(options: string): string {\n if (!options) {\n return this._urlQueryParams;\n }\n\n const params = options.split(':');\n if (params[0] === 'exclude' && params.length > 1) {\n const allParams = new URLSearchParams(this._urlQueryParams);\n for (const param of params[1].split(',')) {\n allParams.delete(param);\n }\n\n return `?${allParams}`;\n }\n\n if (params[0] === 'include' && params.length > 1) {\n const allParams = new URLSearchParams(this._urlQueryParams);\n const includeOnly = params[1].split(',');\n\n for (const param of allParams.keys()) {\n if (!includeOnly.includes(param)) {\n allParams.delete(param);\n }\n }\n\n return `?${allParams}`;\n }\n\n return this._urlQueryParams;\n }\n}\n","import { SceneObject } from '../../core/types';\nimport { FormatVariable } from '../interpolation/formatRegistry';\nimport { config } from '@grafana/runtime';\n\n/**\n * Handles expressions like ${__user.login}\n */\nexport class UserMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, _: SceneObject) {\n this.state = { name: name, type: 'user_macro' };\n }\n\n public getValue(fieldPath?: string): string {\n const user = config.bootData.user;\n\n switch (fieldPath) {\n case 'login':\n return user.login;\n case 'email':\n return user.email;\n case 'id':\n default:\n return String(user.id);\n }\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\n/**\n * Handles expressions like ${__org.name}\n */\nexport class OrgMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, _: SceneObject) {\n this.state = { name: name, type: 'org_macro' };\n }\n\n public getValue(fieldPath?: string): string {\n const user = config.bootData.user;\n\n switch (fieldPath) {\n case 'name':\n return user.orgName;\n case 'id':\n default:\n return String(user.orgId);\n }\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n","import { DataLinkBuiltInVars } from '@grafana/data';\nimport { MacroVariableConstructor } from './types';\nimport { IntervalMacro, TimeFromAndToMacro, TimezoneMacro, UrlTimeRangeMacro } from './timeMacros';\nimport { AllVariablesMacro } from './AllVariablesMacro';\nimport { DataMacro, FieldMacro, SeriesMacro, ValueMacro } from './dataMacros';\nimport { UrlMacro } from './urlMacros';\nimport { OrgMacro, UserMacro } from './contextMacros';\n\nexport const macrosIndex = new Map<string, MacroVariableConstructor>([\n [DataLinkBuiltInVars.includeVars, AllVariablesMacro],\n [DataLinkBuiltInVars.keepTime, UrlTimeRangeMacro],\n ['__value', ValueMacro],\n ['__data', DataMacro],\n ['__series', SeriesMacro],\n ['__field', FieldMacro],\n ['__url', UrlMacro],\n ['__from', TimeFromAndToMacro],\n ['__to', TimeFromAndToMacro],\n ['__timezone', TimezoneMacro],\n ['__user', UserMacro],\n ['__org', OrgMacro],\n ['__interval', IntervalMacro],\n ['__interval_ms', IntervalMacro],\n]);\n\n/**\n * Allows you to register a variable expression macro that can then be used in strings with syntax ${<macro_name>.<fieldPath>}\n * Call this on app activation and unregister the macro on deactivation.\n * @returns a function that unregisters the macro\n */\nexport function registerVariableMacro(name: string, macro: MacroVariableConstructor): () => void {\n if (macrosIndex.get(name)) {\n throw new Error(`Macro already registered ${name}`);\n }\n\n macrosIndex.set(name, macro);\n\n return () => {\n macrosIndex.delete(name);\n };\n}\n","import { ScopedVars } from '@grafana/data';\nimport { VariableInterpolation } from '@grafana/runtime';\nimport { VariableType, VariableFormatID } from '@grafana/schema';\n\nimport { SceneObject } from '../../core/types';\nimport { InterpolationFormatParameter, isCustomVariableValue, VariableValue } from '../types';\n\nimport { getSceneVariableForScopedVar } from './ScopedVarsVariable';\nimport { formatRegistry, FormatVariable } from './formatRegistry';\nimport { VARIABLE_REGEX } from '../constants';\nimport { lookupVariable } from '../lookupVariable';\nimport { macrosIndex } from '../macros';\n\n/**\n * This function will try to parse and replace any variable expression found in the target string. The sceneObject will be used as the source of variables. It will\n * use the scene graph and walk up the parent tree until it finds the closest variable.\n *\n * ScopedVars should not really be needed much in the new scene architecture as they can be added to the local scene node instead of passed in interpolate function.\n * It is supported here for backward compatibility and some edge cases where adding scoped vars to local scene node is not practical.\n */\nexport function sceneInterpolator(\n sceneObject: SceneObject,\n target: string | undefined | null,\n scopedVars?: ScopedVars,\n format?: InterpolationFormatParameter,\n interpolations?: VariableInterpolation[]\n): string {\n if (!target || typeof target !== 'string') {\n return target ?? '';\n }\n\n VARIABLE_REGEX.lastIndex = 0;\n\n return target.replace(VARIABLE_REGEX, (match, var1, var2, fmt2, var3, fieldPath, fmt3) => {\n const variableName = var1 || var2 || var3;\n const fmt = fmt2 || fmt3 || format;\n const variable = lookupFormatVariable(variableName, match, scopedVars, sceneObject);\n\n if (!variable) {\n if (interpolations) {\n // Set `value` equal to `match` as documented in the `VariableInterpolation` interface.\n interpolations.push({ match, variableName, fieldPath, format: fmt, value: match, found: false });\n }\n return match;\n }\n\n const value = formatValue(sceneObject, variable, variable.getValue(fieldPath), fmt);\n\n if (interpolations) {\n interpolations.push({ match, variableName, fieldPath, format: fmt, value, found: value !== match });\n }\n\n return value;\n });\n}\n\nfunction lookupFormatVariable(\n name: string,\n match: string,\n scopedVars: ScopedVars | undefined,\n sceneObject: SceneObject\n): FormatVariable | null {\n if (scopedVars && scopedVars.hasOwnProperty(name)) {\n const scopedVar = scopedVars[name];\n\n if (scopedVar) {\n return getSceneVariableForScopedVar(name, scopedVar);\n }\n }\n\n const variable = lookupVariable(name, sceneObject);\n if (variable) {\n return variable;\n }\n\n const Macro = macrosIndex.get(name);\n if (Macro) {\n return new Macro(name, sceneObject, match, scopedVars);\n }\n\n return null;\n}\n\nfunction formatValue(\n context: SceneObject,\n variable: FormatVariable,\n value: VariableValue | undefined | null,\n formatNameOrFn?: InterpolationFormatParameter\n): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n // Variable can return a custom value that handles formatting\n // This is useful for customAllValue and macros that return values that are already formatted or need special formatting\n if (isCustomVariableValue(value)) {\n return sceneInterpolator(context, value.formatter(formatNameOrFn));\n }\n\n // if it's an object transform value to string\n if (!Array.isArray(value) && typeof value === 'object') {\n value = `${value}`;\n }\n\n if (typeof formatNameOrFn === 'function') {\n return formatNameOrFn(value, {\n name: variable.state.name,\n type: variable.state.type as VariableType,\n multi: variable.state.isMulti,\n includeAll: variable.state.includeAll,\n });\n }\n\n let args: string[] = [];\n\n if (!formatNameOrFn) {\n formatNameOrFn = VariableFormatID.Glob;\n } else {\n // some formats have arguments that come after ':' character\n args = formatNameOrFn.split(':');\n if (args.length > 1) {\n formatNameOrFn = args[0];\n args = args.slice(1);\n } else {\n args = [];\n }\n }\n\n let formatter = formatRegistry.getIfExists(formatNameOrFn);\n\n if (!formatter) {\n console.error(`Variable format ${formatNameOrFn} not found. Using glob format as fallback.`);\n formatter = formatRegistry.get(VariableFormatID.Glob);\n }\n\n return formatter.formatter(value, args, variable);\n}\n","import React from 'react';\nimport { MonoTypeOperatorFunction, Observable, Unsubscribable } from 'rxjs';\n\nimport {\n BusEvent,\n BusEventHandler,\n BusEventType,\n DataFrame,\n DataQueryRequest,\n DataSourceGetTagKeysOptions,\n DataSourceGetTagValuesOptions,\n DataTransformContext,\n PanelData,\n TimeRange,\n} from '@grafana/data';\nimport { DataQuery, DataTopic, TimeZone } from '@grafana/schema';\n\nimport { SceneVariableDependencyConfigLike, SceneVariables } from '../variables/types';\nimport { SceneObjectRef } from './SceneObjectRef';\n\nexport interface SceneObjectState {\n key?: string;\n $timeRange?: SceneTimeRangeLike;\n $data?: SceneDataProvider;\n $variables?: SceneVariables;\n /**\n * @experimental\n * Can be used to add extra behaviors to a scene object.\n * These are activated when the their parent scene object is activated.\n */\n $behaviors?: Array<SceneObject | SceneStatelessBehavior>;\n}\n\nexport interface SceneLayoutChildOptions {\n width?: number | string;\n height?: number | string;\n xSizing?: 'fill' | 'content';\n ySizing?: 'fill' | 'content';\n x?: number;\n y?: number;\n minWidth?: number | string;\n minHeight?: number | string;\n isDraggable?: boolean;\n isResizable?: boolean;\n}\n\nexport interface SceneComponentProps<T> {\n model: T;\n}\n\nexport type SceneComponent<TModel> = (props: SceneComponentProps<TModel>) => React.ReactElement | null;\n\nexport interface SceneDataState extends SceneObjectState {\n data?: PanelData;\n}\n\nexport interface SceneObject<TState extends SceneObjectState = SceneObjectState> {\n /** The current state */\n readonly state: TState;\n\n /** True when there is a React component mounted for this Object */\n readonly isActive: boolean;\n\n /** SceneObject parent */\n readonly parent?: SceneObject;\n\n /** This abtractions declares what variables the scene object depends on and how to handle when they change value. **/\n readonly variableDependency?: SceneVariableDependencyConfigLike;\n\n /** This abstraction declares URL sync dependencies of a scene object. **/\n readonly urlSync?: SceneObjectUrlSyncHandler;\n\n /** Subscribe to state changes */\n subscribeToState(handler: SceneStateChangedHandler<TState>): Unsubscribable;\n\n /** Subscribe to a scene event */\n subscribeToEvent<T extends BusEvent>(typeFilter: BusEventType<T>, handler: BusEventHandler<T>): Unsubscribable;\n\n /** Publish an event and optionally bubble it up the scene */\n publishEvent(event: BusEvent, bubble?: boolean): void;\n\n /** Utility hook that wraps useObservable. Used by React components to subscribes to state changes */\n useState(): TState;\n\n /** How to modify state */\n setState(state: Partial<TState>): void;\n\n /**\n * Called when the Component is mounted. This will also activate any $data, $variables or $timeRange scene object on this level.\n * Don't override this in your custom SceneObjects, instead use addActivationHandler from the constructor.\n **/\n activate(): CancelActivationHandler;\n\n /** Get the scene root */\n getRoot(): SceneObject;\n\n /** Returns a deep clone this object and all its children */\n clone(state?: Partial<TState>): this;\n\n /** A React component to use for rendering the object */\n Component(props: SceneComponentProps<SceneObject<TState>>): React.ReactElement | null;\n\n /** Force a re-render, should only be needed when variable values change */\n forceRender(): void;\n\n /** Returns a SceneObjectRef that will resolve to this object */\n getRef(): SceneObjectRef<this>;\n\n /**\n * Allows external code to register code that is executed on activate and deactivate. This allow you\n * to wire up scene objects that need to respond to state changes in other objects from the outside.\n **/\n addActivationHandler(handler: SceneActivationHandler): void;\n\n /**\n * Loop through state and call callback for each direct child scene object.\n * Checks 1 level deep properties and arrays. So a scene object hidden in a nested plain object will not be detected.\n */\n forEachChild(callback: (child: SceneObject) => void): void;\n}\n\nexport type SceneActivationHandler = () => SceneDeactivationHandler | void;\nexport type SceneDeactivationHandler = () => void;\n\n/**\n * Function returned by activate() that when called will deactivate the object if it's the last activator\n **/\nexport type CancelActivationHandler = () => void;\n\nexport interface SceneLayoutState extends SceneObjectState {\n children: SceneObject[];\n}\n\nexport interface SceneLayout<T extends SceneLayoutState = SceneLayoutState> extends SceneObject<T> {\n isDraggable(): boolean;\n getDragClass?(): string;\n getDragClassCancel?(): string;\n}\n\nexport interface SceneTimeRangeState extends SceneObjectState {\n from: string;\n to: string;\n fiscalYearStartMonth?: number;\n value: TimeRange;\n timeZone?: TimeZone;\n /** weekStart will change the global date locale so having multiple different weekStart values is not supported */\n weekStart?: string;\n /**\n * @internal\n * To enable feature parity with the old time range picker, not sure if it will be kept.\n * Override the now time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values.\n * */\n UNSAFE_nowDelay?: string;\n\n refreshOnActivate?: {\n /**\n * When set, the time range will invalidate relative ranges after the specified interval has elapsed\n */\n afterMs?: number\n /**\n * When set, the time range will invalidate relative ranges after the specified percentage of the current interval has elapsed.\n * If both invalidate values are set, the smaller value will be used for the given interval.\n */\n percent?: number\n }\n}\n\nexport interface SceneTimeRangeLike extends SceneObject<SceneTimeRangeState> {\n onTimeZoneChange(timeZone: TimeZone): void;\n onTimeRangeChange(timeRange: TimeRange): void;\n onRefresh(): void;\n getTimeZone(): TimeZone;\n}\n\nexport function isSceneObject(obj: any): obj is SceneObject {\n return obj.useState !== undefined;\n}\n\nexport interface SceneObjectWithUrlSync extends SceneObject {\n getUrlState(): SceneObjectUrlValues;\n updateFromUrl(values: SceneObjectUrlValues): void;\n}\n\nexport interface SceneObjectUrlSyncHandler {\n getKeys(): string[];\n getUrlState(): SceneObjectUrlValues;\n updateFromUrl(values: SceneObjectUrlValues): void;\n}\n\nexport interface DataRequestEnricher {\n // Return partial data query request that will be merged with the original request provided by SceneQueryRunner\n enrichDataRequest(source: SceneObject): Partial<DataQueryRequest> | null;\n}\n\nexport interface FiltersRequestEnricher {\n // Return partial getTagKeys or getTagValues query request that will be merged with the original request provided by ad hoc or group by variable\n enrichFiltersRequest(\n source: SceneObject\n ): Partial<DataSourceGetTagKeysOptions | DataSourceGetTagValuesOptions> | null;\n}\n\nexport function isDataRequestEnricher(obj: any): obj is DataRequestEnricher {\n return 'enrichDataRequest' in obj;\n}\n\nexport function isFiltersRequestEnricher(obj: any): obj is FiltersRequestEnricher {\n return 'enrichFiltersRequest' in obj;\n}\n\nexport type SceneObjectUrlValue = string | string[] | undefined | null;\nexport type SceneObjectUrlValues = Record<string, SceneObjectUrlValue>;\n\nexport type CustomTransformOperator = (context: DataTransformContext) => MonoTypeOperatorFunction<DataFrame[]>;\nexport type CustomTransformerDefinition =\n | { operator: CustomTransformOperator; topic: DataTopic }\n | CustomTransformOperator;\nexport type SceneStateChangedHandler<TState> = (newState: TState, prevState: TState) => void;\n\nexport type DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\nexport interface SceneDataProviderResult {\n data: PanelData;\n origin: SceneDataProvider;\n}\n\nexport interface SceneDataProvider<T extends SceneObjectState = SceneDataState> extends SceneObject<T> {\n setContainerWidth?: (width: number) => void;\n isDataReadyToDisplay?: () => boolean;\n cancelQuery?: () => void;\n getResultsStream(): Observable<SceneDataProviderResult>;\n}\n\nexport interface SceneDataLayerProviderState extends SceneDataState {\n name: string;\n description?: string;\n isEnabled?: boolean;\n isHidden?: boolean;\n}\n\nexport interface SceneDataLayerProvider extends SceneDataProvider<SceneDataLayerProviderState> {\n isDataLayer: true;\n}\n\nexport function isDataLayer(obj: SceneObject): obj is SceneDataLayerProvider {\n return 'isDataLayer' in obj;\n}\n\nexport interface DataLayerFilter {\n panelId: number;\n}\n\nexport interface SceneStatelessBehavior<T extends SceneObject = any> {\n (sceneObject: T): CancelActivationHandler | void;\n}\n\nexport type ControlsLayout = 'horizontal' | 'vertical';\n\nexport interface UseStateHookOptions {\n /**\n * For some edge cases other scene objects want to subscribe to scene object state for objects\n * that are not active, or whose main React Component can be un-mounted. Set this to true\n * to keep the scene object active even if the React component is unmounted.\n *\n * Normally you would not need this but this can be useful in some edge cases.\n *\n * @experimental\n */\n shouldActivateOrKeepAlive?: boolean;\n}\n\nexport interface SceneDataQuery extends DataQuery {\n [key: string]: any;\n\n // Opt this query out of time window comparison\n timeRangeCompare?: boolean;\n}\n","import { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneObject, SceneObjectState, SceneStatelessBehavior } from '../core/types';\nimport { DataQueryRequest } from '@grafana/data';\nimport { LoadingState } from '@grafana/schema';\n\nexport interface SceneQueryStateControllerState extends SceneObjectState {\n isRunning: boolean;\n}\n\nexport interface SceneQueryControllerLike extends SceneObject<SceneQueryStateControllerState> {\n isQueryController: true;\n cancelAll(): void;\n\n queryStarted(entry: SceneQueryControllerEntry): void;\n queryCompleted(entry: SceneQueryControllerEntry): void;\n}\n\nexport function isQueryController(s: SceneObject | SceneStatelessBehavior): s is SceneQueryControllerLike {\n return 'isQueryController' in s;\n}\n\nexport interface QueryResultWithState {\n state: LoadingState;\n}\n\nexport interface SceneQueryControllerEntry {\n request?: DataQueryRequest;\n type: SceneQueryControllerEntryType;\n origin: SceneObject;\n cancel?: () => void;\n}\n\nexport type SceneQueryControllerEntryType = 'data' | 'annotations' | 'variable' | 'alerts';\n\nexport class SceneQueryController\n extends SceneObjectBase<SceneQueryStateControllerState>\n implements SceneQueryControllerLike\n{\n public isQueryController: true = true;\n\n #running = new Set<SceneQueryControllerEntry>();\n\n public constructor() {\n super({ isRunning: false });\n\n // Clear running state on deactivate\n this.addActivationHandler(() => {\n return () => this.#running.clear();\n });\n }\n\n public queryStarted(entry: SceneQueryControllerEntry) {\n this.#running.add(entry);\n\n this.changeRunningQueryCount(1);\n\n if (!this.state.isRunning) {\n this.setState({ isRunning: true });\n }\n }\n\n public queryCompleted(entry: SceneQueryControllerEntry) {\n if (!this.#running.has(entry)) {\n return;\n }\n\n this.#running.delete(entry);\n\n this.changeRunningQueryCount(-1);\n\n if (this.#running.size === 0) {\n this.setState({ isRunning: false });\n }\n }\n\n private changeRunningQueryCount(dir: 1 | -1) {\n /**\n * Used by grafana-image-renderer to know when all queries are completed.\n */\n (window as any).__grafanaRunningQueryCount = ((window as any).__grafanaRunningQueryCount ?? 0) + dir;\n }\n\n public cancelAll() {\n for (const entry of this.#running.values()) {\n entry.cancel?.();\n }\n }\n}\n","export function writeSceneLog(logger: string, message: string, ...rest: unknown[]) {\n let loggingEnabled = false;\n\n if (typeof window !== 'undefined') {\n loggingEnabled = localStorage.getItem('grafana.debug.scenes') === 'true';\n }\n\n if (loggingEnabled) {\n console.log(`${logger}: `, message, ...rest);\n }\n}\n","import { DataSourceApi, ScopedVars } from '@grafana/data';\nimport { getDataSourceSrv } from '@grafana/runtime';\nimport { DataSourceRef } from '@grafana/schema';\nimport { runtimeDataSources } from '../querying/RuntimeDataSource';\n\nexport async function getDataSource(\n datasource: DataSourceRef | undefined | null,\n scopedVars: ScopedVars\n): Promise<DataSourceApi> {\n if (datasource?.uid) {\n const runtimeDataSource = runtimeDataSources.get(datasource.uid);\n if (runtimeDataSource) {\n return runtimeDataSource;\n }\n }\n\n if (datasource && (datasource as any).query) {\n return datasource as DataSourceApi;\n }\n\n return await getDataSourceSrv().get(datasource as string, scopedVars);\n}\n","import { sceneGraph } from '../core/sceneGraph';\nimport { SceneObject } from '../core/types';\nimport { SceneVariable, VariableValue } from './types';\nimport { isVariableValueEqual } from './utils';\n\n/**\n * Useful for remembering variable values to know if they have changed\n **/\nexport class VariableValueRecorder {\n private _values = new Map<string, VariableValue | undefined | null>();\n\n public recordCurrentDependencyValuesForSceneObject(sceneObject: SceneObject) {\n this.clearValues();\n\n if (!sceneObject.variableDependency) {\n return;\n }\n\n for (const variableName of sceneObject.variableDependency.getNames()) {\n const variable = sceneGraph.lookupVariable(variableName, sceneObject);\n if (variable) {\n this._values.set(variable.state.name, variable.getValue());\n }\n }\n }\n\n public cloneAndRecordCurrentValuesForSceneObject(sceneObject: SceneObject) {\n const clone = new VariableValueRecorder();\n clone.recordCurrentDependencyValuesForSceneObject(sceneObject);\n return clone;\n }\n\n public clearValues() {\n this._values.clear();\n }\n\n public hasValues(): boolean {\n return !!this._values;\n }\n\n public recordCurrentValue(variable: SceneVariable) {\n this._values.set(variable.state.name, variable.getValue());\n }\n\n public hasRecordedValue(variable: SceneVariable): boolean {\n return this._values.has(variable.state.name);\n }\n\n public hasValueChanged(variable: SceneVariable): boolean {\n if (this._values.has(variable.state.name)) {\n const value = this._values.get(variable.state.name);\n if (!isVariableValueEqual(value, variable.getValue())) {\n return true;\n }\n }\n\n return false;\n }\n\n public hasDependenciesChanged(sceneObject: SceneObject): boolean {\n if (!this._values) {\n return false;\n }\n\n if (!sceneObject.variableDependency) {\n return false;\n }\n\n for (const variableName of sceneObject.variableDependency.getNames()) {\n const variable = sceneGraph.lookupVariable(variableName, sceneObject);\n if (!variable) {\n continue;\n }\n\n const name = variable.state.name;\n\n if (variable && this._values.has(name)) {\n const value = this._values.get(name);\n if (!isVariableValueEqual(value, variable.getValue())) {\n return true;\n }\n }\n }\n\n return false;\n }\n}\n","import { DataQueryRequest, PanelData } from '@grafana/data';\nimport { Observable } from 'rxjs';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneDataQuery, SceneObjectState } from '../core/types';\n\n// A processor function called by the query runner with responses\n// to any extra requests.\n//\n// A processor function should accept two arguments: the data returned by the\n// _primary_ query, and the data returned by the `ExtraQueryProvider`'s\n// _secondary_ query. It should return a new `PanelData` representing the processed output.\n// It should _not_ modify the primary PanelData.\n//\n// Examples of valid processing include alignment of data between primary and secondary\n// (see the `timeShiftAlignmentProcessor` returned by `SceneTimeRangeCompare`), or doing\n// some more advanced processing such as fitting a time series model on the secondary data.\n//\n// See the docs for `extraQueryProcessingOperator` for more information.\nexport type ExtraQueryDataProcessor = (primary: PanelData, secondary: PanelData) => Observable<PanelData>;\n\n// An extra request that should be run by a query runner, and an optional\n// processor that should be called with the response data.\nexport interface ExtraQueryDescriptor {\n // The extra request to add.\n req: DataQueryRequest;\n // An optional function used to process the data before passing it\n // to any transformations or visualizations.\n processor?: ExtraQueryDataProcessor;\n}\n\n// Indicates that this type wants to add extra requests, along with\n// optional processing functions, to a query runner.\nexport interface ExtraQueryProvider<T extends SceneObjectState> extends SceneObjectBase<T> {\n // Get any extra requests and their required processors.\n getExtraQueries(request: DataQueryRequest): ExtraQueryDescriptor[];\n // Determine whether a query should be rerun.\n //\n // When the provider's state changes this function will be passed both the previous and the\n // next state. The implementation can use this to determine whether the change should trigger\n // a rerun of the query or not.\n shouldRerun(prev: T, next: T, queries: SceneDataQuery[]): boolean;\n}\n\nexport function isExtraQueryProvider(obj: any): obj is ExtraQueryProvider<any> {\n return typeof obj === 'object' && 'getExtraQueries' in obj;\n}\n","import { PanelData } from '@grafana/data';\nimport { forkJoin, of, map, mergeMap, Observable } from 'rxjs';\nimport { ExtraQueryDataProcessor } from './ExtraQueryProvider';\n\n// Passthrough processor for use with ExtraQuerys.\nexport const passthroughProcessor: ExtraQueryDataProcessor = (_, secondary) => of(secondary);\n\n// Factory function which takes a map from request ID to processor functions and\n// returns an rxjs operator which operates on an array of panel data responses.\n//\n// Each secondary response is transformed according to the processor function\n// identified by it's request ID. The processor function is passed the primary\n// response and the secondary response to be processed.\n//\n// The output is a single frame with the primary series and all processed\n// secondary series combined.\nexport const extraQueryProcessingOperator = (processors: Map<string, ExtraQueryDataProcessor>) =>\n (data: Observable<[PanelData, ...PanelData[]]>) => {\n return data.pipe(\n mergeMap(([primary, ...secondaries]) => {\n const processedSecondaries = secondaries.flatMap((s) => {\n return processors.get(s.request!.requestId)?.(primary, s) ?? of(s);\n });\n return forkJoin([of(primary), ...processedSecondaries]);\n }),\n map(([primary, ...processedSecondaries]) => ({\n ...primary,\n series: [...primary.series, ...processedSecondaries.flatMap((s) => s.series)],\n annotations: [...(primary.annotations ?? []), ...processedSecondaries.flatMap((s) => s.annotations ?? [])],\n }))\n );\n }\n","import { DataFrame, Field } from '@grafana/data';\nimport { DataLayerFilter } from '../../../core/types';\n\n// Provided SceneDataLayerProviderResult is an array of DataFrames.\nexport function filterAnnotations(data: DataFrame[], filters: DataLayerFilter) {\n if (!Array.isArray(data) || data.length === 0) {\n return data;\n }\n\n const rows = Array.from({ length: data.length }, () => new Set<number>());\n\n let frameIdx = 0;\n for (const frame of data) {\n for (let index = 0; index < frame.length; index++) {\n if (rows[frameIdx].has(index)) {\n continue;\n }\n let matching = true;\n\n // Let's call those standard fields that annotations data frame has.\n // panelId is a standard field, but it's not always present. It's added to annotations that were added to a particular panel.\n const panelIdField = frame.fields.find((f) => f.name === 'panelId');\n // Source field contains annotation definition, with type and filters included.\n const sourceField = frame.fields.find((f) => f.name === 'source');\n\n if (sourceField) {\n // Here we are filtering Grafana annotations that were added to a particular panel.\n if (panelIdField && sourceField.values[index].type === 'dashboard') {\n matching = panelIdField.values[index] === filters.panelId;\n }\n\n const sourceFilter = sourceField.values[index].filter;\n\n // Here we are filtering based on annotation filter definition.\n // Those fitlers are: Show annotation in selected panels, Exclude annotation from selected panels.\n if (sourceFilter) {\n const includes = (sourceFilter.ids ?? []).includes(filters.panelId);\n if (sourceFilter.exclude) {\n if (includes) {\n matching = false;\n }\n } else if (!includes) {\n matching = false;\n }\n }\n }\n\n if (matching) {\n rows[frameIdx].add(index);\n }\n }\n frameIdx++;\n }\n\n const processed: DataFrame[] = [];\n\n frameIdx = 0;\n for (const frame of data) {\n const frameLength = rows[frameIdx].size;\n const fields: Field[] = [];\n\n for (const field of frame.fields) {\n const buffer = [];\n\n for (let index = 0; index < frame.length; index++) {\n if (rows[frameIdx].has(index)) {\n buffer.push(field.values[index]);\n continue;\n }\n }\n\n fields.push({\n ...field,\n values: buffer,\n });\n }\n\n processed.push({\n ...frame,\n fields: fields,\n length: frameLength,\n });\n frameIdx++;\n }\n return processed;\n}\n","import { DataQueryRequest } from '@grafana/data';\nimport { isDataRequestEnricher, SceneObject } from '../core/types';\n\nexport function getEnrichedDataRequest(sourceRunner: SceneObject): Partial<DataQueryRequest> | null {\n const root = sourceRunner.getRoot();\n\n if (isDataRequestEnricher(root)) {\n return root.enrichDataRequest(sourceRunner);\n }\n\n return null;\n}\n","import { getDataSourceSrv, getTemplateSrv } from '@grafana/runtime';\nimport { AdHocVariableFilter } from '@grafana/data';\nimport { AdHocFiltersVariable } from './AdHocFiltersVariable';\n\nlet originalGetAdhocFilters: any = undefined;\nlet allActiveFilterSets = new Set<AdHocFiltersVariable>();\n\nexport function patchGetAdhocFilters(filterVar: AdHocFiltersVariable) {\n filterVar.addActivationHandler(() => {\n allActiveFilterSets.add(filterVar);\n return () => allActiveFilterSets.delete(filterVar);\n });\n\n if (originalGetAdhocFilters) {\n return;\n }\n\n const templateSrv: any = getTemplateSrv();\n if (!templateSrv?.getAdhocFilters) {\n console.log('Failed to patch getAdhocFilters');\n return;\n }\n\n originalGetAdhocFilters = templateSrv.getAdhocFilters;\n\n templateSrv.getAdhocFilters = function getAdhocFiltersScenePatch(dsName: string): AdHocVariableFilter[] {\n if (allActiveFilterSets.size === 0) {\n return originalGetAdhocFilters.call(templateSrv);\n }\n\n const ds = getDataSourceSrv().getInstanceSettings(dsName);\n if (!ds) {\n return [];\n }\n\n for (const filter of allActiveFilterSets.values()) {\n if (filter.state.datasource?.uid === ds.uid) {\n return filter.state.filters;\n }\n }\n\n return [];\n }.bind(templateSrv);\n}\n\nexport function findActiveAdHocFilterVariableByUid(dsUid: string | undefined): AdHocFiltersVariable | undefined {\n for (const filter of allActiveFilterSets.values()) {\n if (filter.state.datasource?.uid === dsUid) {\n return filter;\n }\n }\n\n return undefined;\n}\n","import { Observable } from 'rxjs';\nimport { LoadingState } from '@grafana/schema';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { QueryResultWithState, SceneQueryControllerEntry } from '../behaviors/SceneQueryController';\n\n/**\n * Will look for a scene object with a behavior that is a SceneQueryController and register the query with it.\n */\nexport function registerQueryWithController<T extends QueryResultWithState>(entry: SceneQueryControllerEntry) {\n return (queryStream: Observable<T>) => {\n const queryControler = sceneGraph.getQueryController(entry.origin);\n if (!queryControler) {\n return queryStream;\n }\n\n return new Observable<T>((observer) => {\n if (!entry.cancel) {\n entry.cancel = () => observer.complete();\n }\n\n queryControler.queryStarted(entry);\n let markedAsCompleted = false;\n\n const sub = queryStream.subscribe({\n next: (v) => {\n if (!markedAsCompleted && v.state !== LoadingState.Loading) {\n markedAsCompleted = true;\n queryControler.queryCompleted(entry);\n }\n\n observer.next(v);\n },\n error: (e) => observer.error(e),\n complete: () => {\n observer.complete();\n },\n });\n\n return () => {\n sub.unsubscribe();\n\n if (!markedAsCompleted) {\n queryControler.queryCompleted(entry);\n }\n };\n });\n };\n}\n","import { GroupByVariable } from './GroupByVariable';\n\nexport const allActiveGroupByVariables = new Set<GroupByVariable>();\n\nexport function findActiveGroupByVariablesByUid(dsUid: string | undefined): GroupByVariable | undefined {\n for (const groupByVariable of allActiveGroupByVariables.values()) {\n if (groupByVariable.state.datasource?.uid === dsUid) {\n return groupByVariable;\n }\n }\n\n return undefined;\n}\n","import { SceneObject, SceneObjectState } from '../core/types';\n\n/**\n * This function works around the problem of Contravariance of the SceneObject.setState function\n * Contravariance is not enforce by interfaces and here we use the SceneObject interface to access the setState function\n */\nexport function setBaseClassState<T extends SceneObjectState>(sceneObject: SceneObject<T>, newState: Partial<T>) {\n sceneObject.setState(newState);\n}\n","import { isArray, isEqual } from 'lodash';\nimport { map, Observable } from 'rxjs';\n\nimport { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from '../constants';\n\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneObjectUrlSyncHandler, SceneObjectUrlValues } from '../../core/types';\nimport {\n SceneVariable,\n SceneVariableValueChangedEvent,\n SceneVariableState,\n ValidateAndUpdateResult,\n VariableValue,\n VariableValueOption,\n VariableValueSingle,\n CustomVariableValue,\n VariableCustomFormatterFn,\n} from '../types';\nimport { formatRegistry } from '../interpolation/formatRegistry';\nimport { VariableFormatID } from '@grafana/schema';\nimport { SceneVariableSet } from '../sets/SceneVariableSet';\nimport { setBaseClassState } from '../../utils/utils';\n\nexport interface MultiValueVariableState extends SceneVariableState {\n value: VariableValue; // old current.text\n text: VariableValue; // old current.value\n options: VariableValueOption[];\n isMulti?: boolean;\n includeAll?: boolean;\n defaultToAll?: boolean;\n allValue?: string;\n placeholder?: string;\n /**\n * For multi value variables, this option controls how many values to show before they are collapsed into +N.\n * Defaults to 5\n */\n maxVisibleValues?: number;\n noValueOnClear?: boolean;\n isReadOnly?: boolean;\n}\n\nexport interface VariableGetOptionsArgs {\n searchFilter?: string;\n}\n\nexport abstract class MultiValueVariable<TState extends MultiValueVariableState = MultiValueVariableState>\n extends SceneObjectBase<TState>\n implements SceneVariable<TState>\n{\n protected _urlSync: SceneObjectUrlSyncHandler = new MultiValueUrlSyncHandler(this);\n\n /**\n * Set to true to skip next value validation to maintain the current value even it it's not among the options (ie valid values)\n */\n public skipNextValidation?: boolean;\n\n /**\n * The source of value options.\n */\n public abstract getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]>;\n\n /**\n * This function is called on when SceneVariableSet is activated or when a dependency changes.\n */\n public validateAndUpdate(): Observable<ValidateAndUpdateResult> {\n return this.getValueOptions({}).pipe(\n map((options) => {\n this.updateValueGivenNewOptions(options);\n return {};\n })\n );\n }\n\n public onCancel(): void {\n this.setStateHelper({ loading: false });\n const sceneVarSet = this.parent as SceneVariableSet;\n sceneVarSet?.cancel(this);\n }\n\n /**\n * Check if current value is valid given new options. If not update the value.\n */\n private updateValueGivenNewOptions(options: VariableValueOption[]) {\n // Remember current value and text\n const { value: currentValue, text: currentText } = this.state;\n\n const stateUpdate = this.getStateUpdateGivenNewOptions(options, currentValue, currentText);\n\n this.interceptStateUpdateAfterValidation(stateUpdate);\n\n // Perform state change\n this.setStateHelper(stateUpdate);\n\n // Publish value changed event only if value changed\n if (stateUpdate.value !== currentValue || stateUpdate.text !== currentText || this.hasAllValue()) {\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n }\n }\n\n private getStateUpdateGivenNewOptions(\n options: VariableValueOption[],\n currentValue: VariableValue,\n currentText: VariableValue\n ): Partial<MultiValueVariableState> {\n const stateUpdate: Partial<MultiValueVariableState> = {\n options,\n loading: false,\n value: currentValue,\n text: currentText,\n };\n\n if (options.length === 0) {\n if (this.state.defaultToAll || this.state.includeAll) {\n stateUpdate.value = ALL_VARIABLE_VALUE;\n stateUpdate.text = ALL_VARIABLE_TEXT;\n } else if (this.state.isMulti) {\n stateUpdate.value = [];\n stateUpdate.text = [];\n } else {\n stateUpdate.value = '';\n stateUpdate.text = '';\n }\n\n return stateUpdate;\n }\n\n if (this.hasAllValue()) {\n if (!this.state.includeAll) {\n stateUpdate.value = options[0].value;\n stateUpdate.text = options[0].label;\n // If multi switch to arrays\n if (this.state.isMulti) {\n stateUpdate.value = [stateUpdate.value];\n stateUpdate.text = [stateUpdate.text];\n }\n }\n return stateUpdate;\n }\n\n if (this.state.isMulti) {\n // If we are a multi valued variable validate the current values are among the options\n const currentValues = Array.isArray(currentValue) ? currentValue : [currentValue];\n const validValues = currentValues.filter((v) => options.find((o) => o.value === v));\n const validTexts = validValues.map((v) => options.find((o) => o.value === v)!.label);\n\n // If no valid values pick the first option\n if (validValues.length === 0) {\n const defaultState = this.getDefaultMultiState(options);\n stateUpdate.value = defaultState.value;\n stateUpdate.text = defaultState.text;\n } else {\n // We have valid values, if it's different from current valid values update current values\n if (!isEqual(validValues, currentValue)) {\n stateUpdate.value = validValues;\n }\n if (!isEqual(validTexts, currentText)) {\n stateUpdate.text = validTexts;\n }\n }\n return stateUpdate;\n }\n\n // Single value variable validation\n\n // Try find by value then text\n let matchingOption = findOptionMatchingCurrent(currentValue, currentText, options);\n if (matchingOption) {\n // When updating the initial state from URL the text property is set the same as value\n // Here we can correct the text value state\n stateUpdate.text = matchingOption.label;\n stateUpdate.value = matchingOption.value;\n } else {\n // Current value is found in options\n if (this.state.defaultToAll) {\n stateUpdate.value = ALL_VARIABLE_VALUE;\n stateUpdate.text = ALL_VARIABLE_TEXT;\n } else {\n // Current value is not valid. Set to first of the available options\n stateUpdate.value = options[0].value;\n stateUpdate.text = options[0].label;\n }\n }\n\n return stateUpdate;\n }\n\n /**\n * Values set by initial URL sync needs to survive the next validation and update.\n * This function can intercept and make sure those values are preserved.\n */\n protected interceptStateUpdateAfterValidation(stateUpdate: Partial<MultiValueVariableState>): void {\n // If the validation wants to fix the all value (All ==> $__all) then we should let that pass\n const isAllValueFix = stateUpdate.value === ALL_VARIABLE_VALUE && this.state.text === ALL_VARIABLE_TEXT;\n\n if (this.skipNextValidation && stateUpdate.value !== this.state.value && stateUpdate.text !== this.state.text && !isAllValueFix) {\n stateUpdate.value = this.state.value;\n stateUpdate.text = this.state.text;\n }\n\n this.skipNextValidation = false;\n }\n\n public getValue(): VariableValue {\n if (this.hasAllValue()) {\n if (this.state.allValue) {\n return new CustomAllValue(this.state.allValue, this);\n }\n\n return this.state.options.map((x) => x.value);\n }\n\n return this.state.value;\n }\n\n public getValueText(): string {\n if (this.hasAllValue()) {\n return ALL_VARIABLE_TEXT;\n }\n\n if (Array.isArray(this.state.text)) {\n return this.state.text.join(' + ');\n }\n\n return String(this.state.text);\n }\n\n public hasAllValue() {\n const value = this.state.value;\n return value === ALL_VARIABLE_VALUE || (Array.isArray(value) && value[0] === ALL_VARIABLE_VALUE);\n }\n\n public getDefaultMultiState(options: VariableValueOption[]) {\n if (this.state.defaultToAll) {\n return { value: [ALL_VARIABLE_VALUE], text: [ALL_VARIABLE_TEXT] };\n } else if (options.length > 0) {\n return { value: [options[0].value], text: [options[0].label] };\n } else {\n return { value: [], text: [] };\n }\n }\n\n /**\n * Change the value and publish SceneVariableValueChangedEvent event.\n */\n public changeValueTo(value: VariableValue, text?: VariableValue) {\n // Ignore if there is no change\n if (value === this.state.value && text === this.state.text) {\n return;\n }\n\n if (!text) {\n if (Array.isArray(value)) {\n text = value.map((v) => this.findLabelTextForValue(v));\n } else {\n text = this.findLabelTextForValue(value);\n }\n }\n\n if (Array.isArray(value)) {\n // If we are a multi valued variable is cleared (empty array) we need to set the default empty state\n if (value.length === 0) {\n const state = this.getDefaultMultiState(this.state.options);\n value = state.value;\n text = state.text;\n }\n\n // If last value is the All value then replace all with it\n if (value[value.length - 1] === ALL_VARIABLE_VALUE) {\n value = [ALL_VARIABLE_VALUE];\n text = [ALL_VARIABLE_TEXT];\n }\n // If the first value is the ALL value and we have other values, then remove the All value\n else if (value[0] === ALL_VARIABLE_VALUE && value.length > 1) {\n value.shift();\n if (Array.isArray(text)) {\n text.shift();\n }\n }\n }\n\n // Do nothing if value and text are the same\n if (isEqual(value, this.state.value) && isEqual(text, this.state.text)) {\n return;\n }\n\n this.setStateHelper({ value, text, loading: false });\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n }\n\n private findLabelTextForValue(value: VariableValueSingle): VariableValueSingle {\n if (value === ALL_VARIABLE_VALUE) {\n return ALL_VARIABLE_TEXT;\n }\n\n const option = this.state.options.find((x) => x.value === value);\n if (option) {\n return option.label;\n }\n\n const optionByLabel = this.state.options.find((x) => x.label === value);\n if (optionByLabel) {\n return optionByLabel.label;\n }\n\n return value;\n }\n\n /**\n * This helper function is to counter the contravariance of setState\n */\n private setStateHelper(state: Partial<MultiValueVariableState>) {\n setBaseClassState<MultiValueVariableState>(this, state);\n }\n\n public getOptionsForSelect(): VariableValueOption[] {\n let options = this.state.options;\n\n if (this.state.includeAll) {\n options = [{ value: ALL_VARIABLE_VALUE, label: ALL_VARIABLE_TEXT }, ...options];\n }\n\n if (!Array.isArray(this.state.value)) {\n const current = options.find((x) => x.value === this.state.value);\n if (!current) {\n options = [{ value: this.state.value, label: String(this.state.text) }, ...options];\n }\n }\n\n return options;\n }\n\n public refreshOptions() {\n this.getValueOptions({}).subscribe((options) => {\n this.updateValueGivenNewOptions(options);\n });\n }\n\n /**\n * Can be used by subclasses to do custom handling of option search based on search input\n */\n public onSearchChange?(searchFilter: string): void;\n}\n\n/**\n * Looks for matching option, first by value but as a fallback by text (label).\n */\nfunction findOptionMatchingCurrent(\n currentValue: VariableValue,\n currentText: VariableValue,\n options: VariableValueOption[]\n) {\n let textMatch: VariableValueOption | undefined;\n\n for (const item of options) {\n if (item.value === currentValue) {\n return item;\n }\n\n // No early return here as want to continue to look a value match\n if (item.label === currentText) {\n textMatch = item;\n }\n }\n\n return textMatch;\n}\n\nexport class MultiValueUrlSyncHandler<TState extends MultiValueVariableState = MultiValueVariableState>\n implements SceneObjectUrlSyncHandler\n{\n public constructor(private _sceneObject: MultiValueVariable<TState>) {}\n\n private getKey(): string {\n return `var-${this._sceneObject.state.name}`;\n }\n\n public getKeys(): string[] {\n if (this._sceneObject.state.skipUrlSync) {\n return [];\n }\n\n return [this.getKey()];\n }\n\n public getUrlState(): SceneObjectUrlValues {\n if (this._sceneObject.state.skipUrlSync) {\n return {};\n }\n\n let urlValue: string | string[] | null = null;\n let value = this._sceneObject.state.value;\n\n if (Array.isArray(value)) {\n urlValue = value.map(String);\n } else if ((this, this._sceneObject.state.isMulti)) {\n // If we are inMulti mode we must return an array here as otherwise UrlSyncManager will not pass all values (in an array) in updateFromUrl\n urlValue = [String(value)];\n } else {\n urlValue = String(value);\n }\n\n return { [this.getKey()]: urlValue };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues): void {\n let urlValue = values[this.getKey()];\n\n if (urlValue != null) {\n // This is to be backwards compatible with old url all value\n if (this._sceneObject.state.includeAll) {\n urlValue = handleLegacyUrlAllValue(urlValue);\n }\n\n // For edge cases where data links include variables with custom all value.\n // We want the variable to maintain the \"All\" meta value not the actual custom vall value. (Fixes https://github.com/grafana/grafana/issues/28635)\n if (this._sceneObject.state.allValue && this._sceneObject.state.allValue === urlValue) {\n urlValue = ALL_VARIABLE_VALUE;\n }\n\n /**\n * Initial URL Sync happens before scene objects are activated.\n * We need to skip validation in this case to make sure values set via URL are maintained.\n */\n if (!this._sceneObject.isActive) {\n this._sceneObject.skipNextValidation = true;\n }\n\n this._sceneObject.changeValueTo(urlValue);\n }\n }\n}\n\nfunction handleLegacyUrlAllValue(value: string | string[]) {\n if (isArray(value) && value[0] === ALL_VARIABLE_TEXT) {\n return [ALL_VARIABLE_VALUE];\n } else if (value === ALL_VARIABLE_TEXT) {\n return ALL_VARIABLE_VALUE;\n }\n\n return value;\n}\n\n/**\n * Variable getValue can return this to skip any subsequent formatting.\n * This is useful for custom all values that should not be escaped/formatted.\n */\nexport class CustomAllValue implements CustomVariableValue {\n public constructor(private _value: string, private _variable: SceneVariable) {}\n\n public formatter(formatNameOrFn?: string | VariableCustomFormatterFn): string {\n if (formatNameOrFn === VariableFormatID.Text) {\n return ALL_VARIABLE_TEXT;\n }\n\n if (formatNameOrFn === VariableFormatID.PercentEncode) {\n return formatRegistry.get(VariableFormatID.PercentEncode).formatter(this._value, [], this._variable);\n }\n\n if (formatNameOrFn === VariableFormatID.QueryParam) {\n return formatRegistry.get(VariableFormatID.QueryParam).formatter(ALL_VARIABLE_TEXT, [], this._variable);\n }\n\n return this._value;\n }\n}\n","import { VariableValueOption } from '../types';\nimport uFuzzy from '@leeoniya/ufuzzy';\nimport { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from '../constants';\n\nexport function getOptionSearcher(\n options: VariableValueOption[],\n includeAll: boolean | undefined,\n) {\n const ufuzzy = new uFuzzy();\n let allOptions = options;\n const haystack: string[] = [];\n const limit = 10000;\n\n if (includeAll) {\n allOptions = [{ value: ALL_VARIABLE_VALUE, label: ALL_VARIABLE_TEXT }, ...allOptions];\n }\n\n return (search: string) => {\n if (search === '') {\n if (allOptions.length > limit) {\n return allOptions.slice(0, limit);\n } else {\n return allOptions;\n }\n }\n\n if (haystack.length === 0) {\n for (let i = 0; i < allOptions.length; i++) {\n haystack.push(allOptions[i].label);\n }\n }\n\n const idxs = ufuzzy.filter(haystack, search);\n const filteredOptions: VariableValueOption[] = [];\n\n if (idxs) {\n for (let i = 0; i < idxs.length; i++) {\n filteredOptions.push(allOptions[idxs[i]]);\n\n if (filteredOptions.length > limit) {\n return filteredOptions;\n }\n }\n\n return filteredOptions;\n }\n\n if (allOptions.length > limit) {\n return allOptions.slice(0, limit);\n }\n\n return allOptions;\n };\n}\n","import { isArray } from 'lodash';\nimport React, { RefCallback, useEffect, useMemo, useState } from 'react';\n\nimport { Checkbox, InputActionMeta, MultiSelect, Select, getSelectStyles, useStyles2, useTheme2 } from '@grafana/ui';\n\nimport { SceneComponentProps } from '../../core/types';\nimport { MultiValueVariable } from '../variants/MultiValueVariable';\nimport { VariableValue, VariableValueSingle } from '../types';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { css, cx } from '@emotion/css';\nimport { getOptionSearcher } from './getOptionSearcher';\n\nconst filterNoOp = () => true;\n\nexport function toSelectableValue<T>(value: T, label?: string): SelectableValue<T> {\n return {\n value,\n label: label ?? String(value),\n };\n}\n\nexport function VariableValueSelect({ model }: SceneComponentProps<MultiValueVariable>) {\n const { value, text, key, options, includeAll, isReadOnly } = model.useState();\n const [inputValue, setInputValue] = useState('');\n const [hasCustomValue, setHasCustomValue] = useState(false);\n const selectValue = toSelectableValue(value, String(text));\n\n const optionSearcher = useMemo(() => getOptionSearcher(options, includeAll), [options, includeAll]);\n\n const onInputChange = (value: string, { action }: InputActionMeta) => {\n if (action === 'input-change') {\n setInputValue(value);\n if (model.onSearchChange) {\n model.onSearchChange!(value);\n }\n return value;\n }\n\n return value;\n };\n\n const filteredOptions = optionSearcher(inputValue);\n\n const onOpenMenu = () => {\n if (hasCustomValue) {\n setInputValue(String(text));\n }\n };\n\n const onCloseMenu = () => {\n setInputValue('');\n };\n\n return (\n <Select<VariableValue>\n id={key}\n isValidNewOption={(inputValue) => inputValue.trim().length > 0}\n placeholder=\"Select value\"\n width=\"auto\"\n disabled={isReadOnly}\n value={selectValue}\n inputValue={inputValue}\n allowCustomValue\n virtualized\n filterOption={filterNoOp}\n tabSelectsValue={false}\n onInputChange={onInputChange}\n onOpenMenu={onOpenMenu}\n onCloseMenu={onCloseMenu}\n options={filteredOptions}\n data-testid={selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${value}`)}\n onChange={(newValue) => {\n model.changeValueTo(newValue.value!, newValue.label!);\n\n if (hasCustomValue !== newValue.__isNew__) {\n setHasCustomValue(newValue.__isNew__);\n }\n }}\n />\n );\n}\n\nexport function VariableValueSelectMulti({ model }: SceneComponentProps<MultiValueVariable>) {\n const { value, options, key, maxVisibleValues, noValueOnClear, includeAll, isReadOnly } = model.useState();\n const arrayValue = useMemo(() => (isArray(value) ? value : [value]), [value]);\n // To not trigger queries on every selection we store this state locally here and only update the variable onBlur\n const [uncommittedValue, setUncommittedValue] = useState(arrayValue);\n const [inputValue, setInputValue] = useState('');\n\n const optionSearcher = useMemo(() => getOptionSearcher(options, includeAll), [options, includeAll]);\n\n // Detect value changes outside\n useEffect(() => {\n setUncommittedValue(arrayValue);\n }, [arrayValue]);\n\n const onInputChange = (value: string, { action }: InputActionMeta) => {\n if (action === 'input-change') {\n setInputValue(value);\n if (model.onSearchChange) {\n model.onSearchChange!(value);\n }\n return value;\n }\n\n if (action === 'input-blur') {\n setInputValue('');\n return '';\n }\n\n return inputValue;\n };\n\n const placeholder = options.length > 0 ? 'Select value' : '';\n const filteredOptions = optionSearcher(inputValue);\n\n return (\n <MultiSelect<VariableValueSingle>\n id={key}\n placeholder={placeholder}\n width=\"auto\"\n inputValue={inputValue}\n disabled={isReadOnly}\n value={uncommittedValue}\n noMultiValueWrap={true}\n maxVisibleValues={maxVisibleValues ?? 5}\n tabSelectsValue={false}\n virtualized\n allowCustomValue\n options={filteredOptions}\n closeMenuOnSelect={false}\n components={{ Option: OptionWithCheckbox }}\n isClearable={true}\n hideSelectedOptions={false}\n onInputChange={onInputChange}\n onBlur={() => {\n model.changeValueTo(uncommittedValue);\n }}\n filterOption={filterNoOp}\n data-testid={selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${uncommittedValue}`)}\n onChange={(newValue, action) => {\n if (action.action === 'clear' && noValueOnClear) {\n model.changeValueTo([]);\n }\n setUncommittedValue(newValue.map((x) => x.value!));\n }}\n />\n );\n}\n\ninterface SelectMenuOptionProps<T> {\n isDisabled: boolean;\n isFocused: boolean;\n isSelected: boolean;\n innerProps: JSX.IntrinsicElements['div'];\n innerRef: RefCallback<HTMLDivElement>;\n renderOptionLabel?: (value: SelectableValue<T>) => JSX.Element;\n data: SelectableValue<T>;\n}\n\nexport const OptionWithCheckbox = ({\n children,\n data,\n innerProps,\n innerRef,\n isFocused,\n isSelected,\n renderOptionLabel,\n}: React.PropsWithChildren<SelectMenuOptionProps<unknown>>) => {\n // We are removing onMouseMove and onMouseOver from innerProps because they cause the whole\n // list to re-render everytime the user hovers over an option. This is a performance issue.\n // See https://github.com/JedWatson/react-select/issues/3128#issuecomment-451936743\n const { onMouseMove, onMouseOver, ...rest } = innerProps;\n const theme = useTheme2();\n const selectStyles = getSelectStyles(theme);\n const optionStyles = useStyles2(getOptionStyles);\n\n return (\n <div\n ref={innerRef}\n className={cx(selectStyles.option, isFocused && selectStyles.optionFocused)}\n {...rest}\n // TODO: use below selector once we update grafana dependencies to ^11.1.0\n // data-testid={selectors.components.Select.option}\n data-testid=\"data-testid Select option\"\n title={data.title}\n >\n <div className={optionStyles.checkbox}>\n <Checkbox value={isSelected} />\n </div>\n <div\n className={selectStyles.optionBody}\n data-testid={selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(\n data.label ?? String(data.value)\n )}\n >\n <span>{children}</span>\n </div>\n </div>\n );\n};\n\nOptionWithCheckbox.displayName = 'SelectMenuOptions';\n\nconst getOptionStyles = (theme: GrafanaTheme2) => ({\n checkbox: css({\n marginRight: theme.spacing(2),\n }),\n});\n\nexport function renderSelectForVariable(model: MultiValueVariable) {\n if (model.state.isMulti) {\n return <VariableValueSelectMulti model={model} />;\n } else {\n return <VariableValueSelect model={model} />;\n }\n}\n","import { SceneObjectUrlSyncHandler, SceneObjectUrlValues } from '../../core/types';\nimport { GroupByVariable } from './GroupByVariable';\nimport { toUrlCommaDelimitedString, unescapeUrlDelimiters } from '../utils';\nimport { VariableValue } from '../types';\n\nexport class GroupByVariableUrlSyncHandler implements SceneObjectUrlSyncHandler {\n public constructor(private _sceneObject: GroupByVariable) {}\n\n private getKey(): string {\n return `var-${this._sceneObject.state.name}`;\n }\n\n public getKeys(): string[] {\n if (this._sceneObject.state.skipUrlSync) {\n return [];\n }\n\n return [this.getKey()];\n }\n\n public getUrlState(): SceneObjectUrlValues {\n if (this._sceneObject.state.skipUrlSync) {\n return {};\n }\n\n return { [this.getKey()]: toUrlValues(this._sceneObject.state.value, this._sceneObject.state.text) };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues): void {\n let urlValue = values[this.getKey()];\n\n if (urlValue != null) {\n /**\n * Initial URL Sync happens before scene objects are activated.\n * We need to skip validation in this case to make sure values set via URL are maintained.\n */\n if (!this._sceneObject.isActive) {\n this._sceneObject.skipNextValidation = true;\n }\n\n const { values, texts } = fromUrlValues(urlValue);\n\n this._sceneObject.changeValueTo(values, texts);\n }\n }\n}\n\nfunction toUrlValues(values: VariableValue, texts: VariableValue): string[] {\n values = Array.isArray(values) ? values : [values];\n texts = Array.isArray(texts) ? texts : [texts];\n\n return values.map((value, idx) => {\n if (value === undefined || value === null) {\n return '';\n }\n\n value = String(value);\n\n let text = texts[idx];\n text = text === undefined || text === null ? value : String(text);\n\n return toUrlCommaDelimitedString(value, text);\n });\n}\n\nfunction fromUrlValues(urlValues: string | string[]): { values: string[]; texts: string[] } {\n urlValues = Array.isArray(urlValues) ? urlValues : [urlValues];\n\n return urlValues.reduce<{ values: string[]; texts: string[] }>(\n (acc, urlValue) => {\n const [value, label] = (urlValue ?? '').split(',');\n\n acc.values.push(unescapeUrlDelimiters(value));\n acc.texts.push(unescapeUrlDelimiters(label ?? value));\n\n return acc;\n },\n {\n values: [],\n texts: [],\n }\n );\n}\n","import { DataSourceGetTagKeysOptions, DataSourceGetTagValuesOptions } from '@grafana/data';\nimport { isFiltersRequestEnricher, SceneObject } from '../core/types';\n\nexport function getEnrichedFiltersRequest(\n sourceRunner: SceneObject\n): Partial<DataSourceGetTagKeysOptions | DataSourceGetTagValuesOptions> | null {\n const root = sourceRunner.getRoot();\n\n if (isFiltersRequestEnricher(root)) {\n return root.enrichFiltersRequest(sourceRunner);\n }\n\n return null;\n}\n","import { ScopedVar } from '@grafana/data';\nimport { SceneObject } from '../core/types';\n\nexport class SafeSerializableSceneObject implements ScopedVar {\n #value: SceneObject;\n\n public text = '__sceneObject';\n\n public constructor(value: SceneObject) {\n this.#value = value;\n }\n\n public toString() {\n return undefined;\n }\n\n public valueOf = () => {\n return this.#value;\n };\n\n public get value() {\n return this;\n }\n}\n","import { config } from '@grafana/runtime';\nimport { SceneObject } from '../core/types';\nimport { SafeSerializableSceneObject } from './SafeSerializableSceneObject';\nimport { ScopedVar } from '@grafana/data';\n\nexport function shouldWrapInSafeSerializableSceneObject(grafanaVersion: string): boolean {\n const pattern = /^(\\d+)\\.(\\d+)\\.(\\d+)/;\n const match = grafanaVersion.match(pattern);\n\n if (!match) {\n return false;\n }\n\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n\n if (major === 11) {\n return (minor === 0 && patch >= 4) || (minor === 1 && patch >= 2) || minor > 1;\n }\n\n if (major === 10) {\n return (minor === 4 && patch >= 8) || minor >= 5;\n }\n\n return major > 11; // Assuming versions greater than 11 are also supported.\n}\n\nexport function wrapInSafeSerializableSceneObject(sceneObject: SceneObject): ScopedVar {\n const version = config.buildInfo.version;\n\n if (shouldWrapInSafeSerializableSceneObject(version)) {\n return new SafeSerializableSceneObject(sceneObject);\n }\n\n return { value: sceneObject, text: '__sceneObject' };\n}\n","import React, { useEffect, useMemo, useState } from 'react';\n// @ts-expect-error Remove when 11.1.x is released\nimport { AdHocVariableFilter, DataSourceApi, GetTagResponse, MetricFindValue, SelectableValue } from '@grafana/data';\nimport { allActiveGroupByVariables } from './findActiveGroupByVariablesByUid';\nimport { DataSourceRef, VariableType } from '@grafana/schema';\nimport { SceneComponentProps, ControlsLayout, SceneObjectUrlSyncHandler } from '../../core/types';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { ValidateAndUpdateResult, VariableValueOption, VariableValueSingle } from '../types';\nimport { MultiValueVariable, MultiValueVariableState, VariableGetOptionsArgs } from '../variants/MultiValueVariable';\nimport { from, lastValueFrom, map, mergeMap, Observable, of, take, tap } from 'rxjs';\nimport { getDataSource } from '../../utils/getDataSource';\nimport { InputActionMeta, MultiSelect } from '@grafana/ui';\nimport { isArray } from 'lodash';\nimport { dataFromResponse, getQueriesForVariables, handleOptionGroups, responseHasError } from '../utils';\nimport { OptionWithCheckbox } from '../components/VariableValueSelect';\nimport { GroupByVariableUrlSyncHandler } from './GroupByVariableUrlSyncHandler';\nimport { getOptionSearcher } from '../components/getOptionSearcher';\nimport { getEnrichedFiltersRequest } from '../getEnrichedFiltersRequest';\nimport { wrapInSafeSerializableSceneObject } from '../../utils/wrapInSafeSerializableSceneObject';\n\nexport interface GroupByVariableState extends MultiValueVariableState {\n /** Defaults to \"Group\" */\n name: string;\n /** The visible keys to group on */\n // TODO review this type and name (naming is hard)\n defaultOptions?: MetricFindValue[];\n /** Base filters to always apply when looking up keys */\n baseFilters?: AdHocVariableFilter[];\n /** Datasource to use for getTagKeys and also controls which scene queries the group by should apply to */\n datasource: DataSourceRef | null;\n /** Controls if the group by can be changed */\n readOnly?: boolean;\n /**\n * @experimental\n * Controls the layout and design of the label.\n * Vertical layout does not yet support operator selector.\n */\n layout?: ControlsLayout;\n /**\n * Defaults to same-datasource which means group by will automatically be applied to all queries with the same data source as this GroupBySet.\n * In manual mode no queries are re-run on changes, and you have to manually apply the filter to whatever queries you want.\n */\n applyMode?: 'auto' | 'manual';\n /**\n * Filter out the keys that do not match the regex.\n */\n tagKeyRegexFilter?: RegExp;\n /**\n * Extension hook for customizing the key lookup.\n * Return replace: true if you want to override the default lookup\n * Return replace: false if you want to combine the results with the default lookup\n */\n getTagKeysProvider?: getTagKeysProvider;\n}\n\nexport type getTagKeysProvider = (\n set: GroupByVariable,\n currentKey: string | null\n) => Promise<{ replace?: boolean; values: MetricFindValue[] | GetTagResponse }>;\n\nexport class GroupByVariable extends MultiValueVariable<GroupByVariableState> {\n static Component = GroupByVariableRenderer;\n isLazy = true;\n\n protected _urlSync: SceneObjectUrlSyncHandler = new GroupByVariableUrlSyncHandler(this);\n\n public validateAndUpdate(): Observable<ValidateAndUpdateResult> {\n return this.getValueOptions({}).pipe(\n map((options) => {\n this._updateValueGivenNewOptions(options);\n return {};\n })\n );\n }\n\n private _updateValueGivenNewOptions(options: VariableValueOption[]) {\n const { value: currentValue, text: currentText } = this.state;\n\n const stateUpdate: Partial<MultiValueVariableState> = {\n options,\n loading: false,\n value: currentValue ?? [],\n text: currentText ?? [],\n };\n\n this.setState(stateUpdate);\n }\n\n public getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]> {\n // When default dimensions are provided, return the static list\n if (this.state.defaultOptions) {\n return of(\n this.state.defaultOptions.map((o) => ({\n label: o.text,\n value: String(o.value),\n // @ts-expect-error Remove when we update to @grafana/data > 11.1.0\n group: o.group,\n }))\n );\n }\n\n this.setState({ loading: true, error: null });\n\n return from(\n getDataSource(this.state.datasource, {\n __sceneObject: wrapInSafeSerializableSceneObject(this),\n })\n ).pipe(\n mergeMap((ds) => {\n return from(this._getKeys(ds)).pipe(\n tap((response) => {\n if (responseHasError(response)) {\n this.setState({ error: response.error.message });\n }\n }),\n map((response) => dataFromResponse(response)),\n take(1),\n mergeMap((data) => {\n // @ts-expect-error Remove when 11.1.x is released\n const a: VariableValueOption[] = data.map((i) => {\n return {\n label: i.text,\n value: i.value ? String(i.value) : i.text,\n group: i.group,\n };\n });\n return of(a);\n })\n );\n })\n );\n }\n\n public constructor(initialState: Partial<GroupByVariableState>) {\n super({\n isMulti: true,\n name: '',\n value: [],\n text: [],\n options: [],\n datasource: null,\n baseFilters: [],\n applyMode: 'auto',\n layout: 'horizontal',\n type: 'groupby' as VariableType,\n ...initialState,\n noValueOnClear: true,\n });\n\n this.addActivationHandler(() => {\n allActiveGroupByVariables.add(this);\n\n return () => allActiveGroupByVariables.delete(this);\n });\n }\n\n /**\n * Get possible keys given current filters. Do not call from plugins directly\n */\n public _getKeys = async (ds: DataSourceApi) => {\n // TODO: provide current dimensions?\n const override = await this.state.getTagKeysProvider?.(this, null);\n\n if (override && override.replace) {\n return override.values;\n }\n\n if (this.state.defaultOptions) {\n return this.state.defaultOptions.concat(dataFromResponse(override?.values ?? []));\n }\n\n if (!ds.getTagKeys) {\n return [];\n }\n\n const queries = getQueriesForVariables(this);\n\n const otherFilters = this.state.baseFilters || [];\n const timeRange = sceneGraph.getTimeRange(this).state.value;\n const response = await ds.getTagKeys({\n filters: otherFilters,\n queries,\n timeRange,\n ...getEnrichedFiltersRequest(this),\n });\n if (responseHasError(response)) {\n // @ts-expect-error Remove when 11.1.x is released\n this.setState({ error: response.error.message });\n }\n\n let keys = dataFromResponse(response);\n if (override) {\n keys = keys.concat(dataFromResponse(override.values));\n }\n\n const tagKeyRegexFilter = this.state.tagKeyRegexFilter;\n if (tagKeyRegexFilter) {\n // @ts-expect-error Remove when 11.1.x is released\n keys = keys.filter((f) => f.text.match(tagKeyRegexFilter));\n }\n\n return keys;\n };\n\n /**\n * Allows clearing the value of the variable to an empty value. Overrides default behavior of a MultiValueVariable\n */\n public getDefaultMultiState(options: VariableValueOption[]): { value: VariableValueSingle[]; text: string[] } {\n return { value: [], text: [] };\n }\n}\nexport function GroupByVariableRenderer({ model }: SceneComponentProps<MultiValueVariable>) {\n const { value, text, key, maxVisibleValues, noValueOnClear, options, includeAll } = model.useState();\n\n const values = useMemo<Array<SelectableValue<VariableValueSingle>>>(() => {\n const arrayValue = isArray(value) ? value : [value];\n const arrayText = isArray(text) ? text : [text];\n\n return arrayValue.map((value, idx) => ({\n value,\n label: String(arrayText[idx] ?? value),\n }));\n }, [value, text]);\n\n const [isFetchingOptions, setIsFetchingOptions] = useState(false);\n const [isOptionsOpen, setIsOptionsOpen] = useState(false);\n const [inputValue, setInputValue] = useState('');\n\n // To not trigger queries on every selection we store this state locally here and only update the variable onBlur\n const [uncommittedValue, setUncommittedValue] = useState(values);\n\n const optionSearcher = useMemo(() => getOptionSearcher(options, includeAll), [options, includeAll]);\n\n // Detect value changes outside\n useEffect(() => {\n setUncommittedValue(values);\n }, [values]);\n\n const onInputChange = (value: string, { action }: InputActionMeta) => {\n if (action === 'input-change') {\n setInputValue(value);\n if (model.onSearchChange) {\n model.onSearchChange!(value);\n }\n return value;\n }\n\n if (action === 'input-blur') {\n setInputValue('');\n return '';\n }\n\n return inputValue;\n };\n\n const filteredOptions = useMemo(\n () => handleOptionGroups(optionSearcher(inputValue).map(toSelectableValue)),\n [optionSearcher, inputValue]\n );\n\n return (\n <MultiSelect<VariableValueSingle>\n data-testid={`GroupBySelect-${key}`}\n id={key}\n placeholder={'Select value'}\n width=\"auto\"\n inputValue={inputValue}\n value={uncommittedValue}\n noMultiValueWrap={true}\n maxVisibleValues={maxVisibleValues ?? 5}\n tabSelectsValue={false}\n virtualized\n options={filteredOptions}\n filterOption={filterNoOp}\n closeMenuOnSelect={false}\n isOpen={isOptionsOpen}\n isClearable={true}\n hideSelectedOptions={false}\n isLoading={isFetchingOptions}\n components={{ Option: OptionWithCheckbox }}\n onInputChange={onInputChange}\n onBlur={() => {\n model.changeValueTo(\n uncommittedValue.map((x) => x.value!),\n uncommittedValue.map((x) => x.label!)\n );\n }}\n onChange={(newValue, action) => {\n if (action.action === 'clear' && noValueOnClear) {\n model.changeValueTo([]);\n }\n setUncommittedValue(newValue);\n }}\n onOpenMenu={async () => {\n setIsFetchingOptions(true);\n await lastValueFrom(model.validateAndUpdate());\n setIsFetchingOptions(false);\n setIsOptionsOpen(true);\n }}\n onCloseMenu={() => {\n setIsOptionsOpen(false);\n }}\n />\n );\n}\n\nconst filterNoOp = () => true;\n\nfunction toSelectableValue(input: VariableValueOption): SelectableValue<VariableValueSingle> {\n const { label, value, group } = input;\n const result: SelectableValue<VariableValueSingle> = {\n label,\n value,\n };\n\n if (group) {\n result.group = group;\n }\n\n return result;\n}\n","import { Icon, Tooltip } from '@grafana/ui';\nimport React, { useCallback } from 'react';\nimport { LoadingIndicatorProps as SelectLoadingIndicatorProps } from 'react-select';\n\nexport const SelectLoadingIndicator = ({\n innerProps,\n ...props\n}: SelectLoadingIndicatorProps & { selectProps: { onCancel: () => void } }) => {\n const { onCancel } = props.selectProps;\n const onMouseDown = useCallback(\n (event: React.MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n onCancel();\n },\n [onCancel]\n );\n\n return <LoadingIndicator onCancel={onMouseDown} />;\n};\n\ninterface LoadingIndicatorProps {\n onCancel: (event: React.MouseEvent) => void;\n}\n\nexport function LoadingIndicator(props: LoadingIndicatorProps) {\n return (\n <Tooltip content=\"Cancel query\">\n <Icon\n className=\"spin-clockwise\"\n name=\"sync\"\n size=\"xs\"\n role=\"button\"\n onMouseDown={(e) => {\n props.onCancel(e);\n }}\n />\n </Tooltip>\n );\n}\n","import React from 'react';\nimport { Icon, IconButton, Tooltip, useStyles2, useTheme2 } from '@grafana/ui';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { GrafanaTheme2, IconName } from '@grafana/data';\nimport { css } from '@emotion/css';\nimport { LoadingIndicator } from './LoadingIndicator';\nimport { ControlsLayout } from '../core/types';\n\ninterface ControlsLabelProps {\n label: string;\n htmlFor?: string;\n description?: string;\n isLoading?: boolean;\n error?: string;\n icon?: IconName;\n layout?: ControlsLayout;\n onCancel?: () => void;\n onRemove?: () => void;\n}\n\nexport function ControlsLabel(props: ControlsLabelProps) {\n const styles = useStyles2(getStyles);\n const theme = useTheme2();\n const isVertical = props.layout === 'vertical';\n\n const loadingIndicator = Boolean(props.isLoading) ? (\n <div\n style={{ marginLeft: theme.spacing(1), marginTop: '-1px' }}\n aria-label={selectors.components.LoadingIndicator.icon}\n >\n <LoadingIndicator\n onCancel={(e) => {\n e.preventDefault();\n e.stopPropagation();\n props.onCancel?.();\n }}\n />\n </div>\n ) : null;\n\n let errorIndicator = null;\n if (props.error) {\n errorIndicator = (\n <Tooltip content={props.error} placement={'bottom'}>\n <Icon className={styles.errorIcon} name=\"exclamation-triangle\" />\n </Tooltip>\n );\n }\n\n let descriptionIndicator = null;\n if (props.description) {\n descriptionIndicator = (\n <Tooltip content={props.description} placement={isVertical ? 'top' : 'bottom'}>\n <Icon className={styles.normalIcon} name=\"info-circle\" />\n </Tooltip>\n );\n }\n\n const testId =\n typeof props.label === 'string' ? selectors.pages.Dashboard.SubMenu.submenuItemLabels(props.label) : '';\n let labelElement: JSX.Element;\n\n // The vertical layout has different css class and order of elements (label always first)\n\n if (isVertical) {\n labelElement = (\n <label className={styles.verticalLabel} data-testid={testId} htmlFor={props.htmlFor}>\n {props.label}\n {descriptionIndicator}\n {errorIndicator}\n {props.icon && <Icon name={props.icon} className={styles.normalIcon} />}\n {loadingIndicator}\n {props.onRemove && (\n <IconButton variant=\"secondary\" size=\"xs\" name=\"times\" onClick={props.onRemove} tooltip={'Remove'} />\n )}\n </label>\n );\n } else {\n labelElement = (\n <label className={styles.horizontalLabel} data-testid={testId} htmlFor={props.htmlFor}>\n {errorIndicator}\n {props.icon && <Icon name={props.icon} className={styles.normalIcon} />}\n {props.label}\n {descriptionIndicator}\n {loadingIndicator}\n </label>\n );\n }\n\n return labelElement;\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n horizontalLabel: css({\n background: theme.isDark ? theme.colors.background.primary : theme.colors.background.secondary,\n display: `flex`,\n alignItems: 'center',\n padding: theme.spacing(0, 1),\n fontWeight: theme.typography.fontWeightMedium,\n fontSize: theme.typography.bodySmall.fontSize,\n height: theme.spacing(theme.components.height.md),\n lineHeight: theme.spacing(theme.components.height.md),\n borderRadius: theme.shape.borderRadius(1),\n border: `1px solid ${theme.components.input.borderColor}`,\n position: 'relative',\n // To make the border line up with the input border\n right: -1,\n whiteSpace: 'nowrap',\n gap: theme.spacing(0.5),\n }),\n verticalLabel: css({\n display: `flex`,\n alignItems: 'center',\n fontWeight: theme.typography.fontWeightMedium,\n fontSize: theme.typography.bodySmall.fontSize,\n lineHeight: theme.typography.bodySmall.lineHeight,\n whiteSpace: 'nowrap',\n marginBottom: theme.spacing(0.5),\n gap: theme.spacing(1),\n }),\n errorIcon: css({\n color: theme.colors.error.text,\n }),\n normalIcon: css({\n color: theme.colors.text.secondary,\n }),\n});\n","import uFuzzy from '@leeoniya/ufuzzy';\nimport { SelectableValue } from '@grafana/data';\n\nexport function getAdhocOptionSearcher(\n options: SelectableValue[],\n) {\n const ufuzzy = new uFuzzy();\n const haystack: string[] = [];\n const limit = 10000;\n\n return (search: string) => {\n if (search === '') {\n if (options.length > limit) {\n return options.slice(0, limit);\n } else {\n return options;\n }\n }\n\n if (haystack.length === 0) {\n for (let i = 0; i < options.length; i++) {\n haystack.push(options[i].label ?? String(options[i].value));\n }\n }\n\n const idxs = ufuzzy.filter(haystack, search);\n const filteredOptions: SelectableValue[] = [];\n\n if (idxs) {\n for (let i = 0; i < idxs.length; i++) {\n filteredOptions.push(options[idxs[i]]);\n\n if (filteredOptions.length > limit) {\n return filteredOptions;\n }\n }\n\n return filteredOptions;\n }\n\n if (options.length > limit) {\n return options.slice(0, limit);\n }\n\n return options;\n };\n}\n","import React, { useMemo, useState } from 'react';\n\nimport { AdHocFiltersVariable, AdHocFilterWithLabels, isMultiValueOperator } from './AdHocFiltersVariable';\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { Button, Field, InputActionMeta, Select, useStyles2 } from '@grafana/ui';\nimport { css, cx } from '@emotion/css';\nimport { ControlsLabel } from '../../utils/ControlsLabel';\nimport { getAdhocOptionSearcher } from './getAdhocOptionSearcher';\nimport { handleOptionGroups } from '../utils';\nimport { OptionWithCheckbox } from '../components/VariableValueSelect';\n\ninterface Props {\n filter: AdHocFilterWithLabels;\n model: AdHocFiltersVariable;\n}\n\nfunction keyLabelToOption(key: string, label?: string): SelectableValue | null {\n return key !== ''\n ? {\n value: key,\n label: label || key,\n }\n : null;\n}\n\nconst filterNoOp = () => true;\n\nexport function AdHocFilterRenderer({ filter, model }: Props) {\n const styles = useStyles2(getStyles);\n\n const [keys, setKeys] = useState<SelectableValue[]>([]);\n const [values, setValues] = useState<SelectableValue[]>([]);\n const [isKeysLoading, setIsKeysLoading] = useState(false);\n const [isValuesLoading, setIsValuesLoading] = useState(false);\n const [isKeysOpen, setIsKeysOpen] = useState(false);\n const [isValuesOpen, setIsValuesOpen] = useState(false);\n const [isOperatorOpen, setIsOperatorOpen] = useState(false);\n const [valueInputValue, setValueInputValue] = useState('');\n const [valueHasCustomValue, setValueHasCustomValue] = useState(false);\n // To not trigger queries on every selection we store this state locally here and only update the variable onBlur\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n const [uncommittedValue, setUncommittedValue] = useState(filter.values ? filter.values.map((value, index) => keyLabelToOption(value, filter.valueLabels?.[index])) : []);\n const isMultiValue = isMultiValueOperator(filter.operator);\n\n const keyValue = keyLabelToOption(filter.key, filter.keyLabel);\n const valueValue = keyLabelToOption(filter.value, filter.valueLabels?.[0]);\n\n const optionSearcher = useMemo(() => getAdhocOptionSearcher(values), [values]);\n\n const onValueInputChange = (value: string, { action }: InputActionMeta) => {\n if (action === 'input-change') {\n setValueInputValue(value);\n }\n return value;\n };\n\n const onOperatorChange = (v: SelectableValue) => {\n const existingOperator = filter.operator;\n const newOperator = v.value;\n\n const update: Partial<AdHocFilterWithLabels> = { operator: newOperator };\n // clear value if operator has changed from multi to single\n if (!isMultiValueOperator(newOperator) && isMultiValueOperator(existingOperator)) {\n update.value = '';\n update.valueLabels = [''];\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n update.values = undefined;\n setUncommittedValue(null);\n // set values if operator has changed from single to multi\n } else if (isMultiValueOperator(newOperator) && !isMultiValueOperator(existingOperator) && filter.value) {\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n update.values = [filter.value];\n setUncommittedValue([filter.value]);\n }\n model._updateFilter(filter, update);\n }\n\n const filteredValueOptions = useMemo(\n () => handleOptionGroups(optionSearcher(valueInputValue)),\n [optionSearcher, valueInputValue]\n );\n\n const multiValueProps = {\n isMulti: true,\n value: uncommittedValue,\n components: {\n Option: OptionWithCheckbox,\n },\n closeMenuOnSelect: false,\n openMenuOnFocus: false,\n onChange: (v: SelectableValue) => {\n setUncommittedValue(v);\n // clear input value when creating a new custom multi value\n if (v.some((value: SelectableValue) => value.__isNew__)) {\n setValueInputValue('');\n }\n },\n onBlur: () => {\n model._updateFilter(filter, {\n value: uncommittedValue[0] ?? '',\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n values: uncommittedValue.map((option: SelectableValue<string>) => option.value),\n valueLabels: uncommittedValue.map((option: SelectableValue<string>) => option.label),\n });\n }\n }\n\n const valueSelect = (\n <Select\n virtualized\n allowCustomValue\n isValidNewOption={(inputValue) => inputValue.trim().length > 0}\n allowCreateWhileLoading\n formatCreateLabel={(inputValue) => `Use custom value: ${inputValue}`}\n disabled={model.state.readOnly}\n className={cx(styles.value, isValuesOpen ? styles.widthWhenOpen : undefined)}\n width=\"auto\"\n value={valueValue}\n filterOption={filterNoOp}\n hideSelectedOptions={false}\n placeholder={'Select value'}\n options={filteredValueOptions}\n inputValue={valueInputValue}\n onInputChange={onValueInputChange}\n onChange={(v) => {\n model._updateFilter(filter, {\n value: v.value,\n valueLabels: v.label ? [v.label] : [v.value]\n });\n\n if (valueHasCustomValue !== v.__isNew__) {\n setValueHasCustomValue(v.__isNew__);\n }\n }}\n // there's a bug in react-select where the menu doesn't recalculate its position when the options are loaded asynchronously\n // see https://github.com/grafana/grafana/issues/63558\n // instead, we explicitly control the menu visibility and prevent showing it until the options have fully loaded\n isOpen={isValuesOpen && !isValuesLoading}\n isLoading={isValuesLoading}\n openMenuOnFocus={true}\n onOpenMenu={async () => {\n setIsValuesLoading(true);\n setIsValuesOpen(true);\n const values = await model._getValuesFor(filter);\n setIsValuesLoading(false);\n setValues(values);\n if (valueHasCustomValue) {\n setValueInputValue(valueValue?.label ?? '');\n }\n }}\n onCloseMenu={() => {\n setIsValuesOpen(false);\n setValueInputValue('');\n }}\n {...(isMultiValue && multiValueProps)}\n />\n );\n\n const keySelect = (\n <Select\n // By changing the key, we reset the Select component,\n // to ensure that the loaded values are shown after they are loaded\n key={`${isValuesLoading ? 'loading' : 'loaded'}`}\n disabled={model.state.readOnly}\n className={cx(styles.key, isKeysOpen ? styles.widthWhenOpen : undefined)}\n width=\"auto\"\n allowCustomValue={true}\n value={keyValue}\n placeholder={'Select label'}\n options={handleOptionGroups(keys)}\n onChange={(v) => model._updateFilter(filter, {\n key: v.value,\n keyLabel: v.label,\n // clear value if key has changed\n value: '',\n valueLabels: ['']\n })}\n autoFocus={filter.key === ''}\n // there's a bug in react-select where the menu doesn't recalculate its position when the options are loaded asynchronously\n // see https://github.com/grafana/grafana/issues/63558\n // instead, we explicitly control the menu visibility and prevent showing it until the options have fully loaded\n isOpen={isKeysOpen && !isKeysLoading}\n isLoading={isKeysLoading}\n onOpenMenu={async () => {\n setIsKeysOpen(true);\n setIsKeysLoading(true);\n const keys = await model._getKeys(filter.key);\n setIsKeysLoading(false);\n setKeys(keys);\n }}\n onCloseMenu={() => {\n setIsKeysOpen(false);\n }}\n onBlur={() => {\n if (filter.key === '') {\n model._removeFilter(filter);\n }\n }}\n openMenuOnFocus={true}\n />\n );\n\n const operatorSelect = (\n <Select\n className={cx(styles.operator, {\n [styles.widthWhenOpen]: isOperatorOpen,\n })}\n value={filter.operator}\n disabled={model.state.readOnly}\n options={model._getOperators()}\n onChange={onOperatorChange}\n onOpenMenu={() => {\n setIsOperatorOpen(true)\n }}\n onCloseMenu={() => {\n setIsOperatorOpen(false)\n }}\n />\n );\n\n if (model.state.layout === 'vertical') {\n if (filter.key) {\n const label = (\n <ControlsLabel layout=\"vertical\" label={filter.key ?? ''} onRemove={() => model._removeFilter(filter)} />\n );\n\n return (\n <Field label={label} data-testid={`AdHocFilter-${filter.key}`} className={styles.field}>\n <div className={styles.wrapper}>\n {operatorSelect}\n {valueSelect}\n </div>\n </Field>\n );\n } else {\n return (\n <Field label={'Select label'} data-testid={`AdHocFilter-${filter.key}`} className={styles.field}>\n {keySelect}\n </Field>\n );\n }\n }\n\n return (\n <div className={styles.wrapper} data-testid={`AdHocFilter-${filter.key}`}>\n {keySelect}\n {operatorSelect}\n {valueSelect}\n <Button\n variant=\"secondary\"\n aria-label=\"Remove filter\"\n title=\"Remove filter\"\n className={styles.removeButton}\n icon=\"times\"\n data-testid={`AdHocFilter-remove-${filter.key ?? ''}`}\n onClick={() => model._removeFilter(filter)}\n />\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n field: css({\n marginBottom: 0,\n }),\n wrapper: css({\n display: 'flex',\n '> *': {\n '&:not(:first-child)': {\n // Negative margin hides the double-border on adjacent selects\n marginLeft: -1,\n },\n\n '&:first-child': {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n\n '&:last-child': {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n\n '&:not(:first-child):not(:last-child)': {\n borderRadius: 0,\n },\n\n // Fix focus state zIndex issues\n position: 'relative',\n zIndex: 0,\n\n // Adjacent borders are overlapping, so raise children up when hovering etc\n // so all that child's borders are visible.\n '&:hover': {\n zIndex: 1,\n },\n\n '&:focus-within': {\n zIndex: 2,\n },\n },\n }),\n widthWhenOpen: css({\n minWidth: theme.spacing(16),\n }),\n value: css({\n flexBasis: 'content',\n flexShrink: 1,\n minWidth: '90px',\n }),\n key: css({\n flexBasis: 'content',\n minWidth: '90px',\n flexShrink: 1,\n }),\n operator: css({\n flexShrink: 0,\n flexBasis: 'content',\n }),\n removeButton: css({\n paddingLeft: theme.spacing(3 / 2),\n paddingRight: theme.spacing(3 / 2),\n borderLeft: 'none',\n width: theme.spacing(3),\n marginRight: theme.spacing(1),\n boxSizing: 'border-box',\n // To not have button background and last select border intersect\n position: 'relative',\n left: '1px',\n }),\n});\n","import React from 'react';\n\nimport { AdHocFilterRenderer } from './AdHocFilterRenderer';\nimport { AdHocFiltersVariable } from './AdHocFiltersVariable';\nimport { Button } from '@grafana/ui';\n\ninterface Props {\n model: AdHocFiltersVariable;\n addFilterButtonText?: string;\n}\n\nexport function AdHocFilterBuilder({ model, addFilterButtonText }: Props) {\n const { _wip } = model.useState();\n\n if (!_wip) {\n return (\n <Button\n variant=\"secondary\"\n icon=\"plus\"\n title={'Add filter'}\n aria-label=\"Add filter\"\n data-testid={`AdHocFilter-add`}\n onClick={() => model._addWip()}\n >{addFilterButtonText}</Button>\n );\n }\n\n return <AdHocFilterRenderer filter={_wip} model={model} />;\n}\n","import { SceneObjectUrlSyncHandler, SceneObjectUrlValue, SceneObjectUrlValues } from '../../core/types';\nimport { AdHocFiltersVariable, AdHocFilterWithLabels, isFilterComplete, isMultiValueOperator } from './AdHocFiltersVariable';\nimport { escapeUrlPipeDelimiters, toUrlCommaDelimitedString, unescapeUrlDelimiters } from '../utils';\n\nexport class AdHocFiltersVariableUrlSyncHandler implements SceneObjectUrlSyncHandler {\n public constructor(private _variable: AdHocFiltersVariable) {}\n\n private getKey(): string {\n return `var-${this._variable.state.name}`;\n }\n\n public getKeys(): string[] {\n return [this.getKey()];\n }\n\n public getUrlState(): SceneObjectUrlValues {\n const filters = this._variable.state.filters;\n\n if (filters.length === 0) {\n return { [this.getKey()]: [''] };\n }\n\n const value = filters.filter(isFilterComplete).map((filter) => toArray(filter).map(escapeUrlPipeDelimiters).join('|'));\n return { [this.getKey()]: value };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues): void {\n const urlValue = values[this.getKey()];\n\n if (urlValue == null) {\n return;\n }\n\n const filters = deserializeUrlToFilters(urlValue);\n this._variable.setState({ filters });\n }\n}\n\nfunction deserializeUrlToFilters(value: SceneObjectUrlValue): AdHocFilterWithLabels[] {\n if (Array.isArray(value)) {\n const values = value;\n return values.map(toFilter).filter(isFilter);\n }\n\n const filter = toFilter(value);\n return filter === null ? [] : [filter];\n}\n\nfunction toArray(filter: AdHocFilterWithLabels): string[] {\n const result = [\n toUrlCommaDelimitedString(filter.key, filter.keyLabel),\n filter.operator,\n ];\n if (isMultiValueOperator(filter.operator)) {\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n filter.values.forEach((value, index) => {\n result.push(toUrlCommaDelimitedString(value, filter.valueLabels?.[index]));\n });\n } else {\n result.push(toUrlCommaDelimitedString(filter.value, filter.valueLabels?.[0]));\n }\n return result;\n}\n\nfunction toFilter(urlValue: string | number | boolean | undefined | null): AdHocFilterWithLabels | null {\n if (typeof urlValue !== 'string' || urlValue.length === 0) {\n return null;\n }\n\n const [key, keyLabel, operator, _operatorLabel, ...values] = urlValue\n .split('|')\n .reduce<string[]>((acc, v) => {\n const [key, label] = v.split(',');\n\n acc.push(key, label ?? key);\n\n return acc;\n }, [])\n .map(unescapeUrlDelimiters);\n\n return {\n key,\n keyLabel,\n operator,\n value: values[0],\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n values: isMultiValueOperator(operator) ? values.filter((_, index) => index % 2 === 0) : undefined,\n valueLabels: values.filter((_, index) => index % 2 === 1),\n condition: '',\n };\n}\n\nfunction isFilter(filter: AdHocFilterWithLabels | null): filter is AdHocFilterWithLabels {\n return filter !== null && typeof filter.key === 'string' && typeof filter.value === 'string';\n}\n","import React from 'react';\n// @ts-expect-error Remove when 11.1.x is released\nimport { AdHocVariableFilter, GetTagResponse, GrafanaTheme2, MetricFindValue, SelectableValue } from '@grafana/data';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneVariable, SceneVariableState, SceneVariableValueChangedEvent, VariableValue } from '../types';\nimport { ControlsLayout, SceneComponentProps } from '../../core/types';\nimport { DataSourceRef } from '@grafana/schema';\nimport { dataFromResponse, getQueriesForVariables, renderPrometheusLabelFilters, responseHasError } from '../utils';\nimport { patchGetAdhocFilters } from './patchGetAdhocFilters';\nimport { useStyles2 } from '@grafana/ui';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { AdHocFilterBuilder } from './AdHocFilterBuilder';\nimport { AdHocFilterRenderer } from './AdHocFilterRenderer';\nimport { getDataSourceSrv } from '@grafana/runtime';\nimport { AdHocFiltersVariableUrlSyncHandler } from './AdHocFiltersVariableUrlSyncHandler';\nimport { css } from '@emotion/css';\nimport { getEnrichedFiltersRequest } from '../getEnrichedFiltersRequest';\nimport { wrapInSafeSerializableSceneObject } from '../../utils/wrapInSafeSerializableSceneObject';\n\nexport interface AdHocFilterWithLabels extends AdHocVariableFilter {\n keyLabel?: string;\n valueLabels?: string[];\n}\nexport interface AdHocFiltersVariableState extends SceneVariableState {\n /** Optional text to display on the 'add filter' button */\n addFilterButtonText?: string;\n /** The visible filters */\n filters: AdHocFilterWithLabels[];\n /** Base filters to always apply when looking up keys*/\n baseFilters?: AdHocFilterWithLabels[];\n /** Datasource to use for getTagKeys and getTagValues and also controls which scene queries the filters should apply to */\n datasource: DataSourceRef | null;\n /** Controls if the filters can be changed */\n readOnly?: boolean;\n /**\n * @experimental\n * Controls the layout and design of the label.\n */\n layout?: ControlsLayout;\n /**\n * Defaults to automatic which means filters will automatically be applied to all queries with the same data source as this AdHocFilterSet.\n * In manual mode you either have to use the filters programmatically or as a variable inside query expressions.\n */\n applyMode: 'auto' | 'manual';\n /**\n * Filter out the keys that do not match the regex.\n */\n tagKeyRegexFilter?: RegExp;\n /**\n * Extension hook for customizing the key lookup.\n * Return replace: true if you want to override the default lookup\n * Return replace: false if you want to combine the results with the default lookup\n */\n getTagKeysProvider?: getTagKeysProvider;\n /**\n * Extension hook for customizing the value lookup.\n * Return replace: true if you want to override the default lookup.\n * Return replace: false if you want to combine the results with the default lookup\n */\n getTagValuesProvider?: getTagValuesProvider;\n\n /**\n * Optionally provide an array of static keys that override getTagKeys\n */\n defaultKeys?: MetricFindValue[];\n\n /**\n * This is the expression that the filters resulted in. Defaults to\n * Prometheus / Loki compatible label filter expression\n */\n filterExpression?: string;\n\n /**\n * The default builder creates a Prometheus/Loki compatible filter expression,\n * this can be overridden to create a different expression based on the current filters.\n */\n expressionBuilder?: AdHocVariableExpressionBuilderFn;\n\n /**\n * Whether the filter supports new multi-value operators like =| and !=|\n */\n supportsMultiValueOperators?: boolean;\n\n /**\n * When querying the datasource for label names and values to determine keys and values\n * for this ad hoc filter, consider the queries in the scene and use them as a filter.\n * This queries filter can be used to ensure that only ad hoc filter options that would\n * impact the current queries are presented to the user.\n */\n useQueriesAsFilterForOptions?: boolean;\n\n /**\n * @internal state of the new filter being added\n */\n _wip?: AdHocFilterWithLabels;\n}\n\nexport type AdHocVariableExpressionBuilderFn = (filters: AdHocFilterWithLabels[]) => string;\n\nexport type getTagKeysProvider = (\n variable: AdHocFiltersVariable,\n currentKey: string | null\n) => Promise<{ replace?: boolean; values: GetTagResponse | MetricFindValue[] }>;\n\nexport type getTagValuesProvider = (\n variable: AdHocFiltersVariable,\n filter: AdHocFilterWithLabels\n) => Promise<{ replace?: boolean; values: GetTagResponse | MetricFindValue[] }>;\n\nexport type AdHocFiltersVariableCreateHelperArgs = AdHocFiltersVariableState;\n\nexport type OperatorDefinition = {\n value: string;\n description?: string;\n isMulti?: Boolean;\n};\n\nconst OPERATORS: OperatorDefinition[] = [{\n value: '=',\n}, {\n value: '!='\n}, {\n value: '=|',\n description: 'Is one of. Use to filter on multiple values.',\n isMulti: true,\n}, {\n value: '!=|',\n description: 'Is not one of. Use to exclude multiple values.',\n isMulti: true\n}, {\n value: '=~',\n description: 'Matches regex',\n}, {\n value: '!~',\n description: 'Does not match regex',\n}, {\n value: '<'\n}, {\n value: '>'\n}];\n\nexport class AdHocFiltersVariable\n extends SceneObjectBase<AdHocFiltersVariableState>\n implements SceneVariable<AdHocFiltersVariableState>\n{\n static Component = AdHocFiltersVariableRenderer;\n\n private _scopedVars = { __sceneObject: wrapInSafeSerializableSceneObject(this) };\n private _dataSourceSrv = getDataSourceSrv();\n\n protected _urlSync = new AdHocFiltersVariableUrlSyncHandler(this);\n\n public constructor(state: Partial<AdHocFiltersVariableState>) {\n super({\n type: 'adhoc',\n name: state.name ?? 'Filters',\n filters: [],\n datasource: null,\n applyMode: 'auto',\n filterExpression: state.filterExpression ?? renderExpression(state.expressionBuilder, state.filters),\n ...state,\n });\n\n if (this.state.applyMode === 'auto') {\n patchGetAdhocFilters(this);\n }\n }\n\n public setState(update: Partial<AdHocFiltersVariableState>): void {\n let filterExpressionChanged = false;\n\n if (update.filters && update.filters !== this.state.filters && !update.filterExpression) {\n update.filterExpression = renderExpression(this.state.expressionBuilder, update.filters);\n filterExpressionChanged = update.filterExpression !== this.state.filterExpression;\n }\n\n super.setState(update);\n\n if (filterExpressionChanged) {\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n }\n }\n\n public getValue(): VariableValue | undefined {\n return this.state.filterExpression;\n }\n\n public _updateFilter(\n filter: AdHocFilterWithLabels,\n update: Partial<AdHocFilterWithLabels>\n ) {\n const { filters, _wip } = this.state;\n\n if (filter === _wip) {\n // If we set value we are done with this \"work in progress\" filter and we can add it\n if ('value' in update && update['value'] !== '') {\n this.setState({ filters: [...filters, { ..._wip, ...update }], _wip: undefined });\n } else {\n this.setState({ _wip: { ...filter, ...update } });\n }\n return;\n }\n\n const updatedFilters = this.state.filters.map((f) => {\n return f === filter ? { ...f, ...update } : f;\n });\n\n this.setState({ filters: updatedFilters });\n }\n\n public _removeFilter(filter: AdHocFilterWithLabels) {\n if (filter === this.state._wip) {\n this.setState({ _wip: undefined });\n return;\n }\n\n this.setState({ filters: this.state.filters.filter((f) => f !== filter) });\n }\n\n /**\n * Get possible keys given current filters. Do not call from plugins directly\n */\n public async _getKeys(currentKey: string | null): Promise<Array<SelectableValue<string>>> {\n const override = await this.state.getTagKeysProvider?.(this, currentKey);\n\n if (override && override.replace) {\n return dataFromResponse(override.values).map(toSelectableValue);\n }\n\n if (this.state.defaultKeys) {\n return this.state.defaultKeys.map(toSelectableValue);\n }\n\n const ds = await this._dataSourceSrv.get(this.state.datasource, this._scopedVars);\n if (!ds || !ds.getTagKeys) {\n return [];\n }\n\n const otherFilters = this.state.filters.filter((f) => f.key !== currentKey).concat(this.state.baseFilters ?? []);\n const timeRange = sceneGraph.getTimeRange(this).state.value;\n const queries = this.state.useQueriesAsFilterForOptions ? getQueriesForVariables(this) : undefined;\n const response = await ds.getTagKeys({\n filters: otherFilters,\n queries,\n timeRange,\n ...getEnrichedFiltersRequest(this),\n });\n\n if (responseHasError(response)) {\n // @ts-expect-error Remove when 11.1.x is released\n this.setState({ error: response.error.message });\n }\n\n let keys = dataFromResponse(response);\n if (override) {\n keys = keys.concat(dataFromResponse(override.values));\n }\n\n const tagKeyRegexFilter = this.state.tagKeyRegexFilter;\n if (tagKeyRegexFilter) {\n // @ts-expect-error Remove when 11.1.x is released\n keys = keys.filter((f) => f.text.match(tagKeyRegexFilter));\n }\n\n return keys.map(toSelectableValue);\n }\n\n /**\n * Get possible key values for a specific key given current filters. Do not call from plugins directly\n */\n public async _getValuesFor(filter: AdHocFilterWithLabels): Promise<Array<SelectableValue<string>>> {\n const override = await this.state.getTagValuesProvider?.(this, filter);\n\n if (override && override.replace) {\n return dataFromResponse(override.values).map(toSelectableValue);\n }\n\n const ds = await this._dataSourceSrv.get(this.state.datasource, this._scopedVars);\n\n if (!ds || !ds.getTagValues) {\n return [];\n }\n\n // Filter out the current filter key from the list of all filters\n const otherFilters = this.state.filters.filter((f) => f.key !== filter.key).concat(this.state.baseFilters ?? []);\n\n const timeRange = sceneGraph.getTimeRange(this).state.value;\n const queries = this.state.useQueriesAsFilterForOptions ? getQueriesForVariables(this) : undefined;\n\n const response = await ds.getTagValues({\n key: filter.key,\n filters: otherFilters,\n timeRange, // @ts-expect-error TODO: remove this once 11.1.x is released\n queries,\n ...getEnrichedFiltersRequest(this),\n });\n\n if (responseHasError(response)) {\n // @ts-expect-error Remove when 11.1.x is released\n this.setState({ error: response.error.message });\n }\n\n let values = dataFromResponse(response);\n if (override) {\n values = values.concat(dataFromResponse(override.values));\n }\n\n return values.map(toSelectableValue);\n }\n\n public _addWip() {\n this.setState({\n _wip: { key: '', value: '', operator: '=', condition: '' },\n });\n }\n\n public _getOperators() {\n const filteredOperators = this.state.supportsMultiValueOperators ? OPERATORS : OPERATORS.filter((operator) => !operator.isMulti);\n return filteredOperators.map<SelectableValue<string>>(({ value, description }) => ({\n label: value,\n value,\n description,\n }));\n }\n}\n\nfunction renderExpression(\n builder: AdHocVariableExpressionBuilderFn | undefined,\n filters: AdHocFilterWithLabels[] | undefined\n) {\n return (builder ?? renderPrometheusLabelFilters)(filters ?? []);\n}\n\nexport function AdHocFiltersVariableRenderer({ model }: SceneComponentProps<AdHocFiltersVariable>) {\n const { filters, readOnly, addFilterButtonText } = model.useState();\n const styles = useStyles2(getStyles);\n\n return (\n <div className={styles.wrapper}>\n {filters.map((filter, index) => (\n <React.Fragment key={index}>\n <AdHocFilterRenderer filter={filter} model={model} />\n </React.Fragment>\n ))}\n\n {!readOnly && <AdHocFilterBuilder model={model} key=\"'builder\" addFilterButtonText={addFilterButtonText} />}\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n wrapper: css({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'flex-end',\n columnGap: theme.spacing(2),\n rowGap: theme.spacing(1),\n }),\n filterIcon: css({\n color: theme.colors.text.secondary,\n paddingRight: theme.spacing(0.5),\n }),\n});\n\nexport function toSelectableValue(input: MetricFindValue): SelectableValue<string> {\n const { text, value } = input;\n const result: SelectableValue<string> = {\n label: text,\n value: String(value ?? text),\n };\n\n if ('group' in input) {\n result.group = input.group;\n }\n\n return result;\n}\n\nexport function isFilterComplete(filter: AdHocFilterWithLabels): boolean {\n return filter.key !== '' && filter.operator !== '' && filter.value !== '';\n}\n\nexport function isMultiValueOperator(operatorValue: string): boolean {\n const operator = OPERATORS.find((o) => o.value === operatorValue);\n if (!operator) {\n throw new Error('Unknown operator');\n }\n return Boolean(operator.isMulti);\n}\n","import { filter, finalize, map, merge, mergeAll } from 'rxjs';\nimport { CancelActivationHandler, SceneDataLayerProvider, SceneDataProviderResult } from '../core/types';\n\nexport class DataLayersMerger {\n private _resultsMap: Map<string, SceneDataProviderResult> = new Map();\n private _prevLayers: SceneDataLayerProvider[] = [];\n\n public getMergedStream(layers: SceneDataLayerProvider[]) {\n if (areDifferentLayers(layers, this._prevLayers)) {\n this._resultsMap = new Map();\n this._prevLayers = layers;\n }\n\n const resultStreams = layers.map((l) => l.getResultsStream());\n const deactivationHandlers: CancelActivationHandler[] = [];\n\n for (const layer of layers) {\n deactivationHandlers.push(layer.activate());\n }\n\n return merge(resultStreams).pipe(\n mergeAll(),\n filter((v) => {\n return this._resultsMap.get(v.origin.state.key!) !== v;\n }),\n map((v) => {\n // Is there a better, rxjs only way to combine multiple same-data-topic observables?\n // Indexing by origin state key is to make sure we do not duplicate/overwrite data from the different origins\n this._resultsMap.set(v.origin.state.key!, v);\n return this._resultsMap.values();\n }),\n finalize(() => {\n deactivationHandlers.forEach((handler) => handler());\n })\n );\n }\n}\n\nfunction areDifferentLayers(a: SceneDataLayerProvider[], b: SceneDataLayerProvider[]) {\n if (a.length !== b.length) {\n return true;\n }\n\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return true;\n }\n }\n\n return false;\n}\n","import { cloneDeep, isEqual } from 'lodash';\nimport { forkJoin, ReplaySubject, Unsubscribable } from 'rxjs';\n\nimport { DataQuery, DataSourceRef, LoadingState } from '@grafana/schema';\n\nimport {\n AlertStateInfo,\n DataFrame,\n DataFrameView,\n DataQueryRequest,\n DataSourceApi,\n DataTopic,\n PanelData,\n preProcessPanelData,\n rangeUtil,\n} from '@grafana/data';\n\n// TODO: Remove this ignore annotation when the grafana runtime dependency has been updated\n// @ts-ignore\nimport { getRunRequest, toDataQueryError, isExpressionReference, config } from '@grafana/runtime';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport {\n DataLayerFilter,\n SceneDataProvider,\n SceneDataProviderResult,\n SceneDataQuery,\n SceneObjectState,\n SceneTimeRangeLike,\n} from '../core/types';\nimport { getDataSource } from '../utils/getDataSource';\nimport { VariableDependencyConfig } from '../variables/VariableDependencyConfig';\nimport { writeSceneLog } from '../utils/writeSceneLog';\nimport { VariableValueRecorder } from '../variables/VariableValueRecorder';\nimport { emptyPanelData } from '../core/SceneDataNode';\nimport { getClosest } from '../core/sceneGraph/utils';\nimport { isExtraQueryProvider, ExtraQueryDataProcessor, ExtraQueryProvider } from './ExtraQueryProvider';\nimport { passthroughProcessor, extraQueryProcessingOperator } from './extraQueryProcessingOperator';\nimport { filterAnnotations } from './layers/annotations/filterAnnotations';\nimport { getEnrichedDataRequest } from './getEnrichedDataRequest';\nimport { findActiveAdHocFilterVariableByUid } from '../variables/adhoc/patchGetAdhocFilters';\nimport { registerQueryWithController } from './registerQueryWithController';\nimport { findActiveGroupByVariablesByUid } from '../variables/groupby/findActiveGroupByVariablesByUid';\nimport { GroupByVariable } from '../variables/groupby/GroupByVariable';\nimport { AdHocFiltersVariable, isFilterComplete } from '../variables/adhoc/AdHocFiltersVariable';\nimport { SceneVariable } from '../variables/types';\nimport { DataLayersMerger } from './DataLayersMerger';\nimport { interpolate } from '../core/sceneGraph/sceneGraph';\nimport { wrapInSafeSerializableSceneObject } from '../utils/wrapInSafeSerializableSceneObject';\n\nlet counter = 100;\n\nexport function getNextRequestId() {\n return 'SQR' + counter++;\n}\n\nexport interface QueryRunnerState extends SceneObjectState {\n data?: PanelData;\n queries: SceneDataQuery[];\n datasource?: DataSourceRef;\n minInterval?: string;\n maxDataPoints?: number;\n liveStreaming?: boolean;\n maxDataPointsFromWidth?: boolean;\n cacheTimeout?: DataQueryRequest['cacheTimeout'];\n queryCachingTTL?: DataQueryRequest['queryCachingTTL'];\n /**\n * When set to auto (the default) query runner will issue queries on activate (when variable dependencies are ready) or when time range change.\n * Set to manual to have full manual control over when queries are issued. Try not to set this. This is mainly useful for unit tests, or special edge case workflows.\n */\n runQueriesMode?: 'auto' | 'manual';\n // Filters to be applied to data layer results before combining them with SQR results\n dataLayerFilter?: DataLayerFilter;\n // Private runtime state\n _hasFetchedData?: boolean;\n}\n\nexport interface DataQueryExtended extends DataQuery {\n [key: string]: any;\n\n // Opt this query out of time window comparison\n timeRangeCompare?: boolean;\n}\n\n// The requests that will be run by the query runner.\n//\n// Generally the query runner will run a single primary request.\n// If the scene graph contains implementations of\n// `ExtraQueryProvider`, the requests created by these\n// implementations will be added to the list of secondary requests,\n// and these will be executed at the same time as the primary request.\n//\n// The results of each secondary request will be passed to an associated\n// processor function (along with the results of the primary request),\n// which can transform the results as desired.\ninterface PreparedRequests {\n // The primary request to run.\n primary: DataQueryRequest;\n // A possibly empty list of secondary requests to run alongside\n // the primary request.\n secondaries: DataQueryRequest[];\n // A map from `requestId` of secondary requests to processors\n // for those requests. Provided by the `ExtraQueryProvider`.\n processors: Map<string, ExtraQueryDataProcessor>;\n}\n\nexport class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> implements SceneDataProvider {\n private _querySub?: Unsubscribable;\n private _dataLayersSub?: Unsubscribable;\n private _dataLayersMerger = new DataLayersMerger();\n private _timeSub?: Unsubscribable;\n private _timeSubRange?: SceneTimeRangeLike;\n private _containerWidth?: number;\n private _variableValueRecorder = new VariableValueRecorder();\n private _results = new ReplaySubject<SceneDataProviderResult>(1);\n private _scopedVars = { __sceneObject: wrapInSafeSerializableSceneObject(this) };\n private _layerAnnotations?: DataFrame[];\n private _resultAnnotations?: DataFrame[];\n\n private _adhocFiltersVar?: AdHocFiltersVariable;\n private _groupByVar?: GroupByVariable;\n\n public getResultsStream() {\n return this._results;\n }\n\n protected _variableDependency: VariableDependencyConfig<QueryRunnerState> = new VariableDependencyConfig(this, {\n statePaths: ['queries', 'datasource'],\n onVariableUpdateCompleted: this.onVariableUpdatesCompleted.bind(this),\n onAnyVariableChanged: this.onAnyVariableChanged.bind(this),\n });\n\n public constructor(initialState: QueryRunnerState) {\n super(initialState);\n\n this.addActivationHandler(() => this._onActivate());\n }\n\n private _onActivate() {\n if (this.isQueryModeAuto()) {\n const timeRange = sceneGraph.getTimeRange(this);\n\n // Add subscriptions to any extra providers so that they rerun queries\n // when their state changes and they should rerun.\n const providers = this.getClosestExtraQueryProviders();\n for (const provider of providers) {\n this._subs.add(\n provider.subscribeToState((n, p) => {\n if (provider.shouldRerun(p, n, this.state.queries)) {\n this.runQueries();\n }\n }),\n );\n }\n\n this.subscribeToTimeRangeChanges(\n timeRange,\n );\n\n if (this.shouldRunQueriesOnActivate()) {\n this.runQueries();\n }\n }\n\n if (!this._dataLayersSub) {\n this._handleDataLayers();\n }\n\n return () => this._onDeactivate();\n }\n\n // This method subscribes to all SceneDataLayers up until the root, and combines the results into data provided from SceneQueryRunner\n private _handleDataLayers() {\n const dataLayers = sceneGraph.getDataLayers(this);\n\n if (dataLayers.length === 0) {\n return;\n }\n\n this._dataLayersSub = this._dataLayersMerger\n .getMergedStream(dataLayers)\n .subscribe(this._onLayersReceived.bind(this));\n }\n\n private _onLayersReceived(results: Iterable<SceneDataProviderResult>) {\n const timeRange = sceneGraph.getTimeRange(this);\n const { dataLayerFilter } = this.state;\n\n let annotations: DataFrame[] = [];\n let alertStates: DataFrame[] = [];\n let alertState: AlertStateInfo | undefined;\n\n for (const result of results) {\n for (let frame of result.data.series) {\n if (frame.meta?.dataTopic === DataTopic.Annotations) {\n annotations = annotations.concat(frame);\n }\n if (frame.meta?.dataTopic === DataTopic.AlertStates) {\n alertStates = alertStates.concat(frame);\n }\n }\n }\n\n if (dataLayerFilter?.panelId) {\n if (annotations.length > 0) {\n annotations = filterAnnotations(annotations, dataLayerFilter);\n }\n\n if (alertStates.length > 0) {\n for (const frame of alertStates) {\n const frameView = new DataFrameView<AlertStateInfo>(frame);\n\n for (const row of frameView) {\n if (row.panelId === dataLayerFilter.panelId) {\n alertState = row;\n break;\n }\n }\n }\n }\n }\n\n // Skip unnessary state updates\n if (\n allFramesEmpty(annotations) &&\n allFramesEmpty(this._layerAnnotations) &&\n isEqual(alertState, this.state.data?.alertState)\n ) {\n return;\n }\n\n this._layerAnnotations = annotations;\n\n const baseStateUpdate = this.state.data ? this.state.data : { ...emptyPanelData, timeRange: timeRange.state.value };\n\n this.setState({\n data: {\n ...baseStateUpdate,\n annotations: [...(this._resultAnnotations ?? []), ...annotations],\n alertState: alertState ?? this.state.data?.alertState,\n },\n });\n }\n\n /**\n * This tries to start a new query whenever a variable completes or is changed.\n *\n * We care about variable update completions even when the variable has not changed and even when it is not a direct dependency.\n * Example: Variables A and B (B depends on A). A update depends on time range. So when time change query runner will\n * find that variable A is loading which is a dependency on of variable B so will set _isWaitingForVariables to true and\n * not issue any query.\n *\n * When A completes it's loading (with no value change, so B never updates) it will cause a call of this function letting\n * the query runner know that A has completed, and in case _isWaitingForVariables we try to run the query. The query will\n * only run if all variables are in a non loading state so in other scenarios where a query depends on many variables this will\n * be called many times until all dependencies are in a non loading state. *\n */\n private onVariableUpdatesCompleted() {\n if(this.isQueryModeAuto()){\n this.runQueries();\n }\n }\n\n /**\n * Check if value changed is a adhoc filter o group by variable that did not exist when we issued the last query\n */\n private onAnyVariableChanged(variable: SceneVariable) {\n // If this variable has already been detected this variable as a dependency onVariableUpdatesCompleted above will handle value changes\n if (this._adhocFiltersVar === variable || this._groupByVar === variable || !this.isQueryModeAuto()) {\n return;\n }\n\n if (variable instanceof AdHocFiltersVariable && this._isRelevantAutoVariable(variable)) {\n this.runQueries();\n }\n\n if (variable instanceof GroupByVariable && this._isRelevantAutoVariable(variable)) {\n this.runQueries();\n }\n }\n\n private _isRelevantAutoVariable(variable: AdHocFiltersVariable | GroupByVariable) {\n const datasource = this.state.datasource ?? findFirstDatasource(this.state.queries);\n return variable.state.applyMode === 'auto' && datasource?.uid === variable.state.datasource?.uid;\n }\n\n private shouldRunQueriesOnActivate() {\n if (this._variableValueRecorder.hasDependenciesChanged(this)) {\n writeSceneLog(\n 'SceneQueryRunner',\n 'Variable dependency changed while inactive, shouldRunQueriesOnActivate returns true'\n );\n return true;\n }\n\n // If we don't have any data we should run queries\n if (!this.state.data) {\n return true;\n }\n\n // If time range is stale / different we should run queries\n if (this._isDataTimeRangeStale(this.state.data)) {\n return true;\n }\n\n return false;\n }\n\n private _isDataTimeRangeStale(data: PanelData) {\n const timeRange = sceneGraph.getTimeRange(this);\n\n const stateTimeRange = timeRange.state.value;\n const dataTimeRange = data.timeRange;\n\n if (\n stateTimeRange.from.unix() === dataTimeRange.from.unix() &&\n stateTimeRange.to.unix() === dataTimeRange.to.unix()\n ) {\n return false;\n }\n writeSceneLog('SceneQueryRunner', 'Data time range is stale');\n return true;\n }\n\n private _onDeactivate(): void {\n if (this._querySub) {\n this._querySub.unsubscribe();\n this._querySub = undefined;\n }\n\n if (this._dataLayersSub) {\n this._dataLayersSub.unsubscribe();\n this._dataLayersSub = undefined;\n }\n\n this._timeSub?.unsubscribe();\n this._timeSub = undefined;\n this._timeSubRange = undefined;\n this._adhocFiltersVar = undefined;\n this._groupByVar = undefined;\n this._variableValueRecorder.recordCurrentDependencyValuesForSceneObject(this);\n }\n\n public setContainerWidth(width: number) {\n // If we don't have a width we should run queries\n if (!this._containerWidth && width > 0) {\n this._containerWidth = width;\n\n // If we don't have maxDataPoints specifically set and maxDataPointsFromWidth is true\n if (this.state.maxDataPointsFromWidth && !this.state.maxDataPoints) {\n // As this is called from render path we need to wait for next tick before running queries\n setTimeout(() => {\n if (this.isActive && !this.state._hasFetchedData) {\n this.runQueries();\n }\n }, 0);\n }\n } else {\n // if the updated container width is bigger than 0 let's remember the width until next query issue\n if (width > 0) {\n this._containerWidth = width;\n }\n }\n }\n\n public isDataReadyToDisplay() {\n return Boolean(this.state._hasFetchedData);\n }\n\n private subscribeToTimeRangeChanges(timeRange: SceneTimeRangeLike) {\n if (this._timeSubRange === timeRange) {\n // Nothing to do, already subscribed\n return;\n }\n\n if (this._timeSub) {\n this._timeSub.unsubscribe();\n }\n\n this._timeSubRange = timeRange;\n this._timeSub = timeRange.subscribeToState(() => {\n this.runWithTimeRange(timeRange);\n });\n }\n\n public runQueries() {\n const timeRange = sceneGraph.getTimeRange(this);\n if(this.isQueryModeAuto()){\n this.subscribeToTimeRangeChanges(timeRange);\n }\n\n this.runWithTimeRange(timeRange);\n }\n\n private getMaxDataPoints() {\n if (this.state.maxDataPoints) {\n return this.state.maxDataPoints;\n }\n\n return this.state.maxDataPointsFromWidth ? this._containerWidth ?? 500 : 500;\n }\n\n public cancelQuery() {\n this._querySub?.unsubscribe();\n\n if (this._dataLayersSub) {\n this._dataLayersSub.unsubscribe();\n this._dataLayersSub = undefined;\n }\n\n this.setState({\n data: { ...this.state.data!, state: LoadingState.Done },\n });\n }\n\n private async runWithTimeRange(timeRange: SceneTimeRangeLike) {\n // If no maxDataPoints specified we might need to wait for container width to be set from the outside\n if (!this.state.maxDataPoints && this.state.maxDataPointsFromWidth && !this._containerWidth) {\n return;\n }\n\n // If data layers subscription doesn't exist, create one\n if (!this._dataLayersSub) {\n this._handleDataLayers();\n }\n\n // Cancel any running queries\n this._querySub?.unsubscribe();\n\n // Skip executing queries if variable dependency is in loading state\n if (this._variableDependency.hasDependencyInLoadingState()) {\n writeSceneLog('SceneQueryRunner', 'Variable dependency is in loading state, skipping query execution');\n this.setState({ data: { ...(this.state.data ?? emptyPanelData), state: LoadingState.Loading } });\n return;\n }\n\n const { queries } = this.state;\n\n // Simple path when no queries exist\n if (!queries?.length) {\n this._setNoDataState();\n return;\n }\n\n try {\n const datasource = this.state.datasource ?? findFirstDatasource(queries);\n const ds = await getDataSource(datasource, this._scopedVars);\n\n this.findAndSubscribeToAdHocFilters(datasource?.uid);\n\n const runRequest = getRunRequest();\n const { primary, secondaries, processors } = this.prepareRequests(timeRange, ds);\n\n writeSceneLog('SceneQueryRunner', 'Starting runRequest', this.state.key);\n\n let stream = runRequest(ds, primary);\n\n if (secondaries.length > 0) {\n // Submit all secondary requests in parallel.\n const secondaryStreams = secondaries.map((r) => runRequest(ds, r));\n // Create the rxjs operator which will combine the primary and secondary responses\n // by calling the correct processor functions provided by the\n // extra request providers.\n const op = extraQueryProcessingOperator(processors);\n // Combine the primary and secondary streams into a single stream, and apply the operator.\n stream = forkJoin([stream, ...secondaryStreams]).pipe(op);\n }\n\n stream = stream.pipe(\n registerQueryWithController({\n type: 'data',\n request: primary,\n origin: this,\n cancel: () => this.cancelQuery(),\n })\n );\n\n this._querySub = stream.subscribe(this.onDataReceived);\n } catch (err) {\n console.error('PanelQueryRunner Error', err);\n\n this.onDataReceived({\n ...emptyPanelData,\n ...this.state.data,\n state: LoadingState.Error,\n errors: [toDataQueryError(err)],\n });\n }\n }\n\n public clone(withState?: Partial<QueryRunnerState>) {\n const clone = super.clone(withState);\n\n if (this._resultAnnotations) {\n clone['_resultAnnotations'] = this._resultAnnotations.map((frame) => ({ ...frame }));\n }\n\n if (this._layerAnnotations) {\n clone['_layerAnnotations'] = this._layerAnnotations.map((frame) => ({ ...frame }));\n }\n\n clone['_variableValueRecorder'] = this._variableValueRecorder.cloneAndRecordCurrentValuesForSceneObject(this);\n clone['_containerWidth'] = this._containerWidth;\n clone['_results'].next({ origin: this, data: this.state.data ?? emptyPanelData });\n\n return clone;\n }\n\n private prepareRequests(timeRange: SceneTimeRangeLike, ds: DataSourceApi): PreparedRequests {\n const { minInterval, queries } = this.state;\n\n let request: DataQueryRequest<DataQueryExtended> = {\n app: 'scenes',\n requestId: getNextRequestId(),\n timezone: timeRange.getTimeZone(),\n range: timeRange.state.value,\n interval: '1s',\n intervalMs: 1000,\n targets: cloneDeep(queries),\n maxDataPoints: this.getMaxDataPoints(),\n scopedVars: this._scopedVars,\n startTime: Date.now(),\n liveStreaming: this.state.liveStreaming,\n rangeRaw: {\n from: timeRange.state.from,\n to: timeRange.state.to,\n },\n cacheTimeout: this.state.cacheTimeout,\n queryCachingTTL: this.state.queryCachingTTL,\n // This asks the scene root to provide context properties like app, panel and dashboardUID\n ...getEnrichedDataRequest(this),\n };\n\n if (this._adhocFiltersVar) {\n // only pass filters that have both key and value\n // @ts-ignore (Temporary ignore until we update @grafana/data)\n request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);\n }\n\n if (this._groupByVar) {\n // @ts-ignore (Temporary ignore until we update @grafana/data)\n request.groupByKeys = this._groupByVar.state.value;\n }\n\n request.targets = request.targets.map((query) => {\n if (\n !query.datasource ||\n (query.datasource.uid !== ds.uid &&\n !ds.meta?.mixed &&\n isExpressionReference /* TODO: Remove this check when isExpressionReference is properly exported from grafan runtime */ &&\n !isExpressionReference(query.datasource))\n ) {\n query.datasource = ds.getRef();\n }\n return query;\n });\n\n const lowerIntervalLimit = minInterval ? interpolate(this, minInterval) : ds.interval;\n const norm = rangeUtil.calculateInterval(timeRange.state.value, request.maxDataPoints!, lowerIntervalLimit);\n\n // make shallow copy of scoped vars,\n // and add built in variables interval and interval_ms\n request.scopedVars = Object.assign({}, request.scopedVars, {\n __interval: { text: norm.interval, value: norm.interval },\n __interval_ms: { text: norm.intervalMs.toString(), value: norm.intervalMs },\n });\n\n request.interval = norm.interval;\n request.intervalMs = norm.intervalMs;\n\n // If there are any extra request providers, we need to add a new request for each\n // and map the request's ID to the processor function given by the provider, to ensure that\n // the processor is called with the correct response data.\n const primaryTimeRange = timeRange.state.value;\n let secondaryRequests: DataQueryRequest[] = [];\n let secondaryProcessors = new Map();\n for (const provider of this.getClosestExtraQueryProviders() ?? []) {\n for (const { req, processor } of provider.getExtraQueries(request)) {\n const requestId = getNextRequestId();\n secondaryRequests.push({ ...req, requestId });\n secondaryProcessors.set(requestId, processor ?? passthroughProcessor);\n }\n }\n request.range = primaryTimeRange;\n return { primary: request, secondaries: secondaryRequests, processors: secondaryProcessors };\n }\n\n private onDataReceived = (data: PanelData) => {\n // Will combine annotations from SQR queries (frames with meta.dataTopic === DataTopic.Annotations)\n const preProcessedData = preProcessPanelData(data, this.state.data);\n\n // Save query annotations\n this._resultAnnotations = data.annotations;\n\n // Will combine annotations & alert state from data layer providers\n const dataWithLayersApplied = this._combineDataLayers(preProcessedData);\n\n let hasFetchedData = this.state._hasFetchedData;\n\n if (!hasFetchedData && preProcessedData.state !== LoadingState.Loading) {\n hasFetchedData = true;\n }\n\n this.setState({ data: dataWithLayersApplied, _hasFetchedData: hasFetchedData });\n this._results.next({ origin: this, data: dataWithLayersApplied });\n };\n\n private _combineDataLayers(data: PanelData) {\n if (this._layerAnnotations && this._layerAnnotations.length > 0) {\n data.annotations = (data.annotations || []).concat(this._layerAnnotations);\n }\n\n if (this.state.data && this.state.data.alertState) {\n data.alertState = this.state.data.alertState;\n }\n\n return data;\n }\n\n private _setNoDataState() {\n if (this.state.data !== emptyPanelData) {\n this.setState({ data: emptyPanelData });\n }\n }\n\n /**\n * Walk up the scene graph and find any ExtraQueryProviders.\n *\n * This will return an array of the closest provider of each type.\n */\n private getClosestExtraQueryProviders(): Array<ExtraQueryProvider<any>> {\n // Maintain a map from provider constructor to provider object. The constructor\n // is used as a unique key for each class, to ensure we have no more than one\n // type of each type of provider.\n const found = new Map();\n if (!this.parent) {\n return [];\n }\n getClosest(this.parent, (s) => {\n if (isExtraQueryProvider(s) && !found.has(s.constructor)) {\n found.set(s.constructor, s);\n }\n s.forEachChild((child) => {\n if (isExtraQueryProvider(child) && !found.has(child.constructor)) {\n found.set(child.constructor, child);\n }\n });\n // Always return null so that the search continues to the top of\n // the scene graph.\n return null;\n });\n return Array.from(found.values());\n }\n\n /**\n * Walk up scene graph and find the closest filterset with matching data source\n */\n private findAndSubscribeToAdHocFilters(uid: string | undefined) {\n const filtersVar = findActiveAdHocFilterVariableByUid(uid);\n\n if (this._adhocFiltersVar !== filtersVar) {\n this._adhocFiltersVar = filtersVar;\n this._updateExplicitVariableDependencies();\n }\n\n const groupByVar = findActiveGroupByVariablesByUid(uid);\n if (this._groupByVar !== groupByVar) {\n this._groupByVar = groupByVar;\n this._updateExplicitVariableDependencies();\n }\n }\n\n private _updateExplicitVariableDependencies() {\n const explicitDependencies: string[] = [];\n\n if (this._adhocFiltersVar) {\n explicitDependencies.push(this._adhocFiltersVar.state.name);\n }\n\n if (this._groupByVar) {\n explicitDependencies.push(this._groupByVar.state.name);\n }\n\n this._variableDependency.setVariableNames(explicitDependencies);\n }\n\n private isQueryModeAuto(): boolean {\n return (this.state.runQueriesMode ?? 'auto') === 'auto'\n }\n}\n\nexport function findFirstDatasource(targets: DataQuery[]): DataSourceRef | undefined {\n return targets.find((t) => t.datasource !== null)?.datasource ?? undefined;\n}\n\nfunction allFramesEmpty(frames?: DataFrame[]) {\n if (!frames) {\n return true;\n }\n\n for (let i = 0; i < frames.length; i++) {\n if (frames[i].length > 0) {\n return false;\n }\n }\n\n return true;\n}\n","import { isEqual } from 'lodash';\nimport { VariableValue } from './types';\n// @ts-expect-error Remove when 11.1.x is released\nimport { AdHocVariableFilter, DataQueryError, GetTagResponse, MetricFindValue, SelectableValue } from '@grafana/data';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneDataQuery, SceneObject, SceneObjectState } from '../core/types';\nimport { SceneQueryRunner } from '../querying/SceneQueryRunner';\nimport { DataSourceRef } from '@grafana/schema';\n\nexport function isVariableValueEqual(a: VariableValue | null | undefined, b: VariableValue | null | undefined) {\n if (a === b) {\n return true;\n }\n\n return isEqual(a, b);\n}\n\nexport function safeStringifyValue(value: unknown) {\n // Avoid circular references ignoring those references\n const getCircularReplacer = () => {\n const seen = new WeakSet();\n return (_: string, value: object | null) => {\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return;\n }\n seen.add(value);\n }\n return value;\n };\n };\n\n try {\n return JSON.stringify(value, getCircularReplacer());\n } catch (error) {\n console.error(error);\n }\n\n return '';\n}\n\nexport function renderPrometheusLabelFilters(filters: AdHocVariableFilter[]) {\n return filters.map((filter) => renderFilter(filter)).join(',');\n}\n\nfunction renderFilter(filter: AdHocVariableFilter) {\n let value = '';\n let operator = filter.operator;\n\n // map \"one of\" operator to regex\n if (operator === '=|') {\n operator = '=~'\n // TODO remove when we're on the latest version of @grafana/data\n // @ts-expect-error\n value = filter.values?.map(escapeLabelValueInRegexSelector).join('|');\n } else if (operator === '!=|') {\n operator = '!~'\n // TODO remove when we're on the latest version of @grafana/data\n // @ts-expect-error\n value = filter.values?.map(escapeLabelValueInRegexSelector).join('|');\n } else if (operator === '=~' || operator === '!~') {\n value = escapeLabelValueInRegexSelector(filter.value);\n } else {\n value = escapeLabelValueInExactSelector(filter.value);\n }\n\n return `${filter.key}${operator}\"${value}\"`;\n}\n\n// based on the openmetrics-documentation, the 3 symbols we have to handle are:\n// - \\n ... the newline character\n// - \\ ... the backslash character\n// - \" ... the double-quote character\nexport function escapeLabelValueInExactSelector(labelValue: string): string {\n return labelValue.replace(/\\\\/g, '\\\\\\\\').replace(/\\n/g, '\\\\n').replace(/\"/g, '\\\\\"');\n}\n\nexport function escapeLabelValueInRegexSelector(labelValue: string): string {\n return escapeLabelValueInExactSelector(escapeLokiRegexp(labelValue));\n}\n\nexport function isRegexSelector(selector?: string) {\n if (selector && (selector.includes('=~') || selector.includes('!~'))) {\n return true;\n }\n return false;\n}\n\n// Loki regular-expressions use the RE2 syntax (https://github.com/google/re2/wiki/Syntax),\n// so every character that matches something in that list has to be escaped.\n// the list of meta characters is: *+?()|\\.[]{}^$\n// we make a javascript regular expression that matches those characters:\nconst RE2_METACHARACTERS = /[*+?()|\\\\.\\[\\]{}^$]/g;\nfunction escapeLokiRegexp(value: string): string {\n return value.replace(RE2_METACHARACTERS, '\\\\$&');\n}\n\n/**\n * Get all queries in the scene that have the same datasource as provided source object\n */\nexport function getQueriesForVariables(\n sourceObject: SceneObject<SceneObjectState & { datasource: DataSourceRef | null }>\n) {\n const runners = sceneGraph.findAllObjects(\n sourceObject.getRoot(),\n (o) => o instanceof SceneQueryRunner\n ) as SceneQueryRunner[];\n\n const applicableRunners = filterOutInactiveRunnerDuplicates(runners).filter((r) => {\n return r.state.datasource?.uid === sourceObject.state.datasource?.uid;\n });\n\n if (applicableRunners.length === 0) {\n return [];\n }\n\n const result: SceneDataQuery[] = [];\n applicableRunners.forEach((r) => {\n result.push(...r.state.queries);\n });\n\n return result;\n}\n\n// Filters out inactive runner duplicates, keeping only the ones that are currently active.\n// This is needed for scnearios whan a query runner is cloned and the original is not removed but de-activated.\n// Can happen i.e. when editing a panel in Grafana Core dashboards.\nfunction filterOutInactiveRunnerDuplicates(runners: SceneQueryRunner[]) {\n // Group items by key\n const groupedItems: { [key: string]: SceneQueryRunner[] } = {};\n\n for (const item of runners) {\n if (item.state.key) {\n if (!(item.state.key in groupedItems)) {\n groupedItems[item.state.key] = [];\n }\n groupedItems[item.state.key].push(item);\n }\n }\n\n // Filter out inactive items and concatenate active items\n return Object.values(groupedItems).flatMap((group) => {\n const activeItems = group.filter((item) => item.isActive);\n // Keep inactive items if there's only one item with the key\n if (activeItems.length === 0 && group.length === 1) {\n return group;\n }\n return activeItems;\n });\n}\n\nexport function escapeUrlPipeDelimiters(value: string | undefined): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n // Replace the pipe due to using it as a filter separator\n return (value = /\\|/g[Symbol.replace](value, '__gfp__'));\n}\n\nexport function escapeUrlCommaDelimiters(value: string | undefined): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n // Replace the comma due to using it as a value/label separator\n return /,/g[Symbol.replace](value, '__gfc__');\n}\n\nexport function unescapeUrlDelimiters(value: string | undefined): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n value = /__gfp__/g[Symbol.replace](value, '|');\n value = /__gfc__/g[Symbol.replace](value, ',');\n\n return value;\n}\n\nexport function toUrlCommaDelimitedString(key: string, label?: string): string {\n // Omit for identical key/label or when label is not set at all\n if (!label || key === label) {\n return escapeUrlCommaDelimiters(key);\n }\n\n return [key, label].map(escapeUrlCommaDelimiters).join(',');\n}\n\nexport function dataFromResponse(response: GetTagResponse | MetricFindValue[]) {\n return Array.isArray(response) ? response : response.data;\n}\n\nexport function responseHasError(response: GetTagResponse | MetricFindValue[]): response is GetTagResponse & { error: DataQueryError } {\n return !Array.isArray(response) && Boolean(response.error);\n}\n\n// Collect a flat list of SelectableValues with a `group` property into a hierarchical list with groups\nexport function handleOptionGroups(values: SelectableValue[]): Array<SelectableValue<string>> {\n const result: Array<SelectableValue<string>> = [];\n const groupedResults = new Map<string, Array<SelectableValue<string>>>();\n\n for (const value of values) {\n const groupLabel = value.group;\n if (groupLabel) {\n let group = groupedResults.get(groupLabel);\n\n if (!group) {\n group = [];\n groupedResults.set(groupLabel, group);\n result.push({ label: groupLabel, options: group });\n }\n\n group.push(value);\n } else {\n result.push(value);\n }\n }\n\n return result;\n}\n","import { DataLinkBuiltInVars } from '@grafana/data';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneObject, SceneObjectState } from '../core/types';\nimport { writeSceneLog } from '../utils/writeSceneLog';\nimport { VARIABLE_REGEX } from './constants';\n\nimport { SceneVariable, SceneVariableDependencyConfigLike } from './types';\nimport { safeStringifyValue } from './utils';\n\ninterface VariableDependencyConfigOptions<TState extends SceneObjectState> {\n /**\n * State paths to scan / extract variable dependencies from. Leave empty to scan all paths.\n */\n statePaths?: Array<keyof TState | '*'>;\n\n /**\n * Explicit list of variable names to depend on. Leave empty to scan state for dependencies.\n */\n variableNames?: string[];\n\n /**\n * Optional way to customize how to handle when a dependent variable changes\n * If not specified the default behavior is to trigger a re-render\n */\n onReferencedVariableValueChanged?: (variable: SceneVariable) => void;\n\n /**\n * Two scenarios trigger this callback to be called.\n * 1. When any direct dependency changed value\n * 2. In case hasDependencyInLoadingState was called and returned true we really care about any variable update. So in this scenario this callback is called\n * after any variable update completes. This is to cover scenarios where an object is waiting for indirect dependencies to complete.\n */\n onVariableUpdateCompleted?: () => void;\n\n /**\n * Optional way to subscribe to all variable value changes, even to variables that are not dependencies.\n */\n onAnyVariableChanged?: (variable: SceneVariable) => void;\n}\n\nexport class VariableDependencyConfig<TState extends SceneObjectState> implements SceneVariableDependencyConfigLike {\n private _state: TState | undefined;\n private _dependencies = new Set<string>();\n private _statePaths?: Array<keyof TState | '*'>;\n private _isWaitingForVariables = false;\n\n public scanCount = 0;\n\n public constructor(\n private _sceneObject: SceneObject<TState>,\n private _options: VariableDependencyConfigOptions<TState>\n ) {\n this._statePaths = _options.statePaths;\n }\n\n /**\n * Used to check for dependency on a specific variable\n */\n public hasDependencyOn(name: string): boolean {\n return this.getNames().has(name);\n }\n\n /**\n * This is called whenever any set of variables have new values. It is up to this implementation to check if it's relevant given the current dependencies.\n */\n public variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean) {\n const deps = this.getNames();\n let dependencyChanged = false;\n\n if ((deps.has(variable.state.name) || deps.has(DataLinkBuiltInVars.includeVars)) && hasChanged) {\n dependencyChanged = true;\n }\n\n writeSceneLog(\n 'VariableDependencyConfig',\n 'variableUpdateCompleted',\n variable.state.name,\n dependencyChanged,\n this._isWaitingForVariables\n );\n\n if (this._options.onAnyVariableChanged) {\n this._options.onAnyVariableChanged(variable);\n }\n\n // If custom handler called when dependency is changed or when we are waiting for variables\n if (this._options.onVariableUpdateCompleted && (this._isWaitingForVariables || dependencyChanged)) {\n this._options.onVariableUpdateCompleted();\n }\n\n if (dependencyChanged) {\n if (this._options.onReferencedVariableValueChanged) {\n this._options.onReferencedVariableValueChanged(variable);\n }\n\n // if no callbacks are specified then just do a forceRender\n if (!this._options.onReferencedVariableValueChanged && !this._options.onVariableUpdateCompleted) {\n this._sceneObject.forceRender();\n }\n }\n }\n\n public hasDependencyInLoadingState() {\n if (sceneGraph.hasVariableDependencyInLoadingState(this._sceneObject)) {\n this._isWaitingForVariables = true;\n return true;\n }\n\n this._isWaitingForVariables = false;\n return false;\n }\n\n public getNames(): Set<string> {\n const prevState = this._state;\n const newState = (this._state = this._sceneObject.state);\n\n if (!prevState) {\n // First time we always scan for dependencies\n this.scanStateForDependencies(this._state);\n return this._dependencies;\n }\n\n // Second time we only scan if state is a different and if any specific state path has changed\n if (newState !== prevState) {\n if (this._statePaths) {\n for (const path of this._statePaths) {\n if (path === '*' || newState[path] !== prevState[path]) {\n this.scanStateForDependencies(newState);\n break;\n }\n }\n } else {\n this.scanStateForDependencies(newState);\n }\n }\n\n return this._dependencies;\n }\n\n /**\n * Update variableNames\n */\n public setVariableNames(varNames: string[]) {\n this._options.variableNames = varNames;\n this.scanStateForDependencies(this._state!);\n }\n\n public setPaths(paths: Array<keyof TState | '*'>) {\n this._statePaths = paths;\n }\n\n private scanStateForDependencies(state: TState) {\n this._dependencies.clear();\n this.scanCount += 1;\n\n if (this._options.variableNames) {\n for (const name of this._options.variableNames) {\n this._dependencies.add(name);\n }\n }\n\n if (this._statePaths) {\n for (const path of this._statePaths) {\n if (path === '*') {\n this.extractVariablesFrom(state);\n break;\n } else {\n const value = state[path];\n if (value) {\n this.extractVariablesFrom(value);\n }\n }\n }\n }\n }\n\n private extractVariablesFrom(value: unknown) {\n VARIABLE_REGEX.lastIndex = 0;\n\n const stringToCheck = typeof value !== 'string' ? safeStringifyValue(value) : value;\n\n const matches = stringToCheck.matchAll(VARIABLE_REGEX);\n if (!matches) {\n return;\n }\n\n for (const match of matches) {\n const [, var1, var2, , var3] = match;\n const variableName = var1 || var2 || var3;\n this._dependencies.add(variableName);\n }\n }\n}\n","import {\n DataQuery,\n DataSourceJsonData,\n DataSourceApi,\n MetricFindValue,\n VariableSupportType,\n StandardVariableQuery,\n DataQueryRequest,\n DataQueryResponse,\n QueryEditorProps,\n} from '@grafana/data';\nimport { TemplateSrv } from '@grafana/runtime';\nimport { ComponentType } from 'react';\n\nimport { Observable } from 'rxjs';\n\n/**\n * Interfaces and guards below are copied from core.\n * Not exposing via grafana/data as these are not intended to be used in context other than variables.\n */\n\ninterface DataSourceWithLegacyVariableSupport<\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n> extends DataSourceApi<TQuery, TOptions> {\n metricFindQuery(query: any, options?: any): Promise<MetricFindValue[]>;\n variables: undefined;\n}\n\ninterface DataSourceWithStandardVariableSupport<\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n> extends DataSourceApi<TQuery, TOptions> {\n variables: {\n getType(): VariableSupportType;\n toDataQuery(query: StandardVariableQuery): TQuery;\n query(request: DataQueryRequest<TQuery>): Observable<DataQueryResponse>;\n };\n}\n\ninterface DataSourceWithCustomVariableSupport<\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n> extends DataSourceApi<TQuery, TOptions> {\n variables: {\n getType(): VariableSupportType;\n editor: VariableQueryEditorType;\n query(request: DataQueryRequest<TQuery>): Observable<DataQueryResponse>;\n };\n}\n\ninterface VariableQueryEditorProps {\n query: any;\n onChange: (query: any, definition: string) => void;\n datasource: any;\n templateSrv: TemplateSrv;\n}\n\ntype VariableQueryEditorType<\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n> = ComponentType<VariableQueryEditorProps> | ComponentType<QueryEditorProps<any, TQuery, TOptions, any>> | null;\n\nexport const hasLegacyVariableSupport = <\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n>(\n datasource: DataSourceApi<TQuery, TOptions>\n): datasource is DataSourceWithLegacyVariableSupport<TQuery, TOptions> => {\n return Boolean(datasource.metricFindQuery) && !Boolean(datasource.variables);\n};\n\nexport const hasStandardVariableSupport = <\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n>(\n datasource: DataSourceApi<TQuery, TOptions>\n): datasource is DataSourceWithStandardVariableSupport<TQuery, TOptions> => {\n if (!datasource.variables) {\n return false;\n }\n\n if (datasource.variables.getType() !== VariableSupportType.Standard) {\n return false;\n }\n\n const variableSupport = datasource.variables;\n return 'toDataQuery' in variableSupport && Boolean(variableSupport.toDataQuery);\n};\n\nexport const hasCustomVariableSupport = <\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n>(\n datasource: DataSourceApi<TQuery, TOptions>\n): datasource is DataSourceWithCustomVariableSupport<TQuery, TOptions> => {\n if (!datasource.variables) {\n return false;\n }\n\n if (datasource.variables.getType() !== VariableSupportType.Custom) {\n return false;\n }\n\n const variableSupport = datasource.variables;\n return (\n 'query' in variableSupport &&\n 'editor' in variableSupport &&\n Boolean(variableSupport.query) &&\n Boolean(variableSupport.editor)\n );\n};\n","import { from, mergeMap, Observable, of } from 'rxjs';\n\nimport {\n DataQueryRequest,\n DataSourceApi,\n getDefaultTimeRange,\n LoadingState,\n PanelData,\n StandardVariableQuery,\n} from '@grafana/data';\nimport { getRunRequest } from '@grafana/runtime';\n\nimport { hasCustomVariableSupport, hasLegacyVariableSupport, hasStandardVariableSupport } from './guards';\n\nimport { QueryVariable } from './QueryVariable';\nimport { DataQuery } from '@grafana/schema';\n\nexport interface RunnerArgs {\n searchFilter?: string;\n variable: QueryVariable;\n}\n\nexport interface QueryRunner {\n getTarget: (variable: QueryVariable) => DataQuery | string;\n runRequest: (args: RunnerArgs, request: DataQueryRequest) => Observable<PanelData>;\n}\n\nclass StandardQueryRunner implements QueryRunner {\n public constructor(private datasource: DataSourceApi, private _runRequest = getRunRequest()) {}\n\n public getTarget(variable: QueryVariable) {\n if (hasStandardVariableSupport(this.datasource)) {\n return this.datasource.variables.toDataQuery(ensureVariableQueryModelIsADataQuery(variable));\n }\n\n throw new Error(\"Couldn't create a target with supplied arguments.\");\n }\n\n public runRequest(_: RunnerArgs, request: DataQueryRequest) {\n if (!hasStandardVariableSupport(this.datasource)) {\n return getEmptyMetricFindValueObservable();\n }\n\n if (!this.datasource.variables.query) {\n return this._runRequest(this.datasource, request);\n }\n\n return this._runRequest(this.datasource, request, this.datasource.variables.query.bind(this.datasource.variables));\n }\n}\n\nclass LegacyQueryRunner implements QueryRunner {\n public constructor(private datasource: DataSourceApi) {}\n\n public getTarget(variable: QueryVariable) {\n if (hasLegacyVariableSupport(this.datasource)) {\n return variable.state.query;\n }\n\n throw new Error(\"Couldn't create a target with supplied arguments.\");\n }\n\n public runRequest({ variable, searchFilter }: RunnerArgs, request: DataQueryRequest) {\n if (!hasLegacyVariableSupport(this.datasource)) {\n return getEmptyMetricFindValueObservable();\n }\n\n return from(\n this.datasource.metricFindQuery(variable.state.query, {\n ...request,\n // variable is used by SQL common data source\n variable: {\n name: variable.state.name,\n type: variable.state.type,\n },\n searchFilter,\n })\n ).pipe(\n mergeMap((values) => {\n if (!values || !values.length) {\n return getEmptyMetricFindValueObservable();\n }\n\n const series: any = values;\n return of({ series, state: LoadingState.Done, timeRange: request.range });\n })\n );\n }\n}\n\nclass CustomQueryRunner implements QueryRunner {\n public constructor(private datasource: DataSourceApi, private _runRequest = getRunRequest()) {}\n\n public getTarget(variable: QueryVariable) {\n if (hasCustomVariableSupport(this.datasource)) {\n return variable.state.query;\n }\n\n throw new Error(\"Couldn't create a target with supplied arguments.\");\n }\n\n public runRequest(_: RunnerArgs, request: DataQueryRequest) {\n if (!hasCustomVariableSupport(this.datasource)) {\n return getEmptyMetricFindValueObservable();\n }\n\n if (!this.datasource.variables.query) {\n return this._runRequest(this.datasource, request);\n }\n return this._runRequest(this.datasource, request, this.datasource.variables.query.bind(this.datasource.variables));\n }\n}\n\nfunction getEmptyMetricFindValueObservable(): Observable<PanelData> {\n return of({ state: LoadingState.Done, series: [], timeRange: getDefaultTimeRange() });\n}\n\nfunction createQueryVariableRunnerFactory(datasource: DataSourceApi): QueryRunner {\n if (hasStandardVariableSupport(datasource)) {\n return new StandardQueryRunner(datasource, getRunRequest());\n }\n\n if (hasLegacyVariableSupport(datasource)) {\n return new LegacyQueryRunner(datasource);\n }\n\n if (hasCustomVariableSupport(datasource)) {\n return new CustomQueryRunner(datasource);\n }\n\n throw new Error(`Couldn't create a query runner for datasource ${datasource.type}`);\n}\n\nexport let createQueryVariableRunner = createQueryVariableRunnerFactory;\n\n/**\n * Use only in tests\n */\nexport function setCreateQueryVariableRunnerFactory(fn: (datasource: DataSourceApi) => QueryRunner) {\n createQueryVariableRunner = fn;\n}\n\n/**\n * Fixes old legacy query string models and adds refId if missing\n */\nfunction ensureVariableQueryModelIsADataQuery(variable: QueryVariable): StandardVariableQuery {\n const query = variable.state.query ?? '';\n\n // Turn into query object if it's just a string\n if (typeof query === 'string') {\n return { query, refId: `variable-${variable.state.name}` };\n }\n\n // Add potentially missing refId\n if (query.refId == null) {\n return { ...query, refId: `variable-${variable.state.name}` } as StandardVariableQuery;\n }\n\n return variable.state.query as StandardVariableQuery;\n}\n","import { isNumber, sortBy, toLower, uniqBy } from 'lodash';\n\nimport { stringToJsRegex, VariableSort } from '@grafana/data';\n\nimport { VariableValueOption } from '../../types';\n\nexport const metricNamesToVariableValues = (variableRegEx: string, sort: VariableSort, metricNames: any[]) => {\n let regex;\n let options: VariableValueOption[] = [];\n\n if (variableRegEx) {\n regex = stringToJsRegex(variableRegEx);\n }\n\n for (let i = 0; i < metricNames.length; i++) {\n const item = metricNames[i];\n let text = item.text === undefined || item.text === null ? item.value : item.text;\n let value = item.value === undefined || item.value === null ? item.text : item.value;\n\n if (isNumber(value)) {\n value = value.toString();\n }\n\n if (isNumber(text)) {\n text = text.toString();\n }\n\n if (regex) {\n const matches = getAllMatches(value, regex);\n if (!matches.length) {\n continue;\n }\n\n const valueGroup = matches.find((m) => m.groups && m.groups.value);\n const textGroup = matches.find((m) => m.groups && m.groups.text);\n const firstMatch = matches.find((m) => m.length > 1);\n const manyMatches = matches.length > 1 && firstMatch;\n\n if (valueGroup || textGroup) {\n value = valueGroup?.groups?.value ?? textGroup?.groups?.text;\n text = textGroup?.groups?.text ?? valueGroup?.groups?.value;\n } else if (manyMatches) {\n for (let j = 0; j < matches.length; j++) {\n const match = matches[j];\n options.push({ label: match[1], value: match[1] });\n }\n continue;\n } else if (firstMatch) {\n text = firstMatch[1];\n value = firstMatch[1];\n }\n }\n\n options.push({ label: text, value: value });\n }\n\n options = uniqBy(options, 'value');\n return sortVariableValues(options, sort);\n};\n\nconst getAllMatches = (str: string, regex: RegExp): RegExpExecArray[] => {\n const results: RegExpExecArray[] = [];\n let matches = null;\n\n regex.lastIndex = 0;\n\n do {\n matches = regex.exec(str);\n if (matches) {\n results.push(matches);\n }\n } while (regex.global && matches && matches[0] !== '' && matches[0] !== undefined);\n\n return results;\n};\n\nexport const sortVariableValues = (options: any[], sortOrder: VariableSort) => {\n if (sortOrder === VariableSort.disabled) {\n return options;\n }\n\n // @ts-ignore\n const sortByNumeric = (opt) => {\n if (!opt.text) {\n return -1;\n }\n const matches = opt.text.match(/.*?(\\d+).*/);\n if (!matches || matches.length < 2) {\n return -1;\n } else {\n return parseInt(matches[1], 10);\n }\n };\n\n // @ts-ignore\n const sortByNaturalSort = (options) => {\n //@ts-ignore\n return options.sort((a, b) => {\n if (!a.text) {\n return -1;\n }\n\n if (!b.text) {\n return 1;\n }\n\n return a.text.localeCompare(b.text, undefined, { numeric: true });\n });\n };\n\n switch (sortOrder) {\n case VariableSort.alphabeticalAsc:\n options = sortBy(options, 'label');\n break;\n case VariableSort.alphabeticalDesc:\n options = sortBy(options, 'label').reverse();\n break;\n case VariableSort.numericalAsc:\n options = sortBy(options, sortByNumeric);\n break;\n case VariableSort.numericalDesc:\n options = sortBy(options, sortByNumeric);\n options = options.reverse();\n break;\n case VariableSort.alphabeticalCaseInsensitiveAsc:\n options = sortBy(options, (opt) => {\n return toLower(opt.label);\n });\n break;\n case VariableSort.alphabeticalCaseInsensitiveDesc:\n options = sortBy(options, (opt) => {\n return toLower(opt.label);\n });\n options = options.reverse();\n break;\n case VariableSort.naturalAsc || 7:\n // Sort by natural sort\n options = sortByNaturalSort(options);\n break;\n case VariableSort.naturalDesc || 8:\n options = sortByNaturalSort(options);\n options = options.reverse();\n break;\n default:\n break;\n }\n return options;\n};\n","import {\n FieldType,\n getFieldDisplayName,\n isDataFrame,\n MetricFindValue,\n PanelData,\n getProcessedDataFrames,\n} from '@grafana/data';\nimport { map, OperatorFunction } from 'rxjs';\n\nexport function toMetricFindValues(): OperatorFunction<PanelData, MetricFindValue[]> {\n return (source) =>\n source.pipe(\n map((panelData) => {\n const frames = panelData.series;\n if (!frames || !frames.length) {\n return [];\n }\n\n if (areMetricFindValues(frames)) {\n return frames;\n }\n\n if (frames[0].fields.length === 0) {\n return [];\n }\n\n const processedDataFrames = getProcessedDataFrames(frames);\n const metrics: MetricFindValue[] = [];\n\n let valueIndex = -1;\n let textIndex = -1;\n let stringIndex = -1;\n let expandableIndex = -1;\n\n for (const frame of processedDataFrames) {\n for (let index = 0; index < frame.fields.length; index++) {\n const field = frame.fields[index];\n const fieldName = getFieldDisplayName(field, frame, frames).toLowerCase();\n\n if (field.type === FieldType.string && stringIndex === -1) {\n stringIndex = index;\n }\n\n if (fieldName === 'text' && field.type === FieldType.string && textIndex === -1) {\n textIndex = index;\n }\n\n if (fieldName === 'value' && field.type === FieldType.string && valueIndex === -1) {\n valueIndex = index;\n }\n\n if (\n fieldName === 'expandable' &&\n (field.type === FieldType.boolean || field.type === FieldType.number) &&\n expandableIndex === -1\n ) {\n expandableIndex = index;\n }\n }\n }\n\n if (stringIndex === -1) {\n throw new Error(\"Couldn't find any field of type string in the results.\");\n }\n\n for (const frame of frames) {\n for (let index = 0; index < frame.length; index++) {\n const expandable = expandableIndex !== -1 ? frame.fields[expandableIndex].values.get(index) : undefined;\n const string = frame.fields[stringIndex].values.get(index);\n const text = textIndex !== -1 ? frame.fields[textIndex].values.get(index) : null;\n const value = valueIndex !== -1 ? frame.fields[valueIndex].values.get(index) : null;\n\n if (valueIndex === -1 && textIndex === -1) {\n metrics.push({ text: string, value: string, expandable });\n continue;\n }\n\n if (valueIndex === -1 && textIndex !== -1) {\n metrics.push({ text, value: text, expandable });\n continue;\n }\n\n if (valueIndex !== -1 && textIndex === -1) {\n metrics.push({ text: value, value, expandable });\n continue;\n }\n\n metrics.push({ text, value, expandable });\n }\n }\n\n return metrics;\n })\n );\n}\n\nfunction areMetricFindValues(data: any[]): data is MetricFindValue[] {\n if (!data) {\n return false;\n }\n\n if (!data.length) {\n return true;\n }\n\n const firstValue: any = data[0];\n\n if (isDataFrame(firstValue)) {\n return false;\n }\n\n for (const firstValueKey in firstValue) {\n if (!firstValue.hasOwnProperty(firstValueKey)) {\n continue;\n }\n\n if (\n firstValue[firstValueKey] !== null &&\n typeof firstValue[firstValueKey] !== 'string' &&\n typeof firstValue[firstValueKey] !== 'number'\n ) {\n continue;\n }\n\n const key = firstValueKey.toLowerCase();\n\n if (key === 'text' || key === 'value') {\n return true;\n }\n }\n\n return false;\n}\n","import { Observable, of, filter, take, mergeMap, catchError, throwError, from, lastValueFrom } from 'rxjs';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport {\n CoreApp,\n DataQueryRequest,\n LoadingState,\n PanelData,\n ScopedVars,\n VariableRefresh,\n VariableSort,\n} from '@grafana/data';\n\nimport { sceneGraph } from '../../../core/sceneGraph';\nimport { SceneComponentProps, SceneDataQuery } from '../../../core/types';\nimport { VariableDependencyConfig } from '../../VariableDependencyConfig';\nimport { renderSelectForVariable } from '../../components/VariableValueSelect';\nimport { VariableValueOption } from '../../types';\nimport { MultiValueVariable, MultiValueVariableState, VariableGetOptionsArgs } from '../MultiValueVariable';\n\nimport { createQueryVariableRunner } from './createQueryVariableRunner';\nimport { metricNamesToVariableValues } from './utils';\nimport { toMetricFindValues } from './toMetricFindValues';\nimport { getDataSource } from '../../../utils/getDataSource';\nimport { safeStringifyValue } from '../../utils';\nimport { DataQuery, DataSourceRef } from '@grafana/schema';\nimport { SEARCH_FILTER_VARIABLE } from '../../constants';\nimport { debounce } from 'lodash';\nimport { registerQueryWithController } from '../../../querying/registerQueryWithController';\nimport { wrapInSafeSerializableSceneObject } from '../../../utils/wrapInSafeSerializableSceneObject';\n\nexport interface QueryVariableState extends MultiValueVariableState {\n type: 'query';\n datasource: DataSourceRef | null;\n query: string | SceneDataQuery;\n regex: string;\n refresh: VariableRefresh;\n sort: VariableSort;\n /** @internal Only for use inside core dashboards */\n definition?: string;\n}\n\nexport class QueryVariable extends MultiValueVariable<QueryVariableState> {\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['regex', 'query', 'datasource'],\n });\n\n public constructor(initialState: Partial<QueryVariableState>) {\n super({\n type: 'query',\n name: '',\n value: '',\n text: '',\n options: [],\n datasource: null,\n regex: '',\n query: '',\n refresh: VariableRefresh.onDashboardLoad,\n sort: VariableSort.disabled,\n ...initialState,\n });\n }\n\n public getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]> {\n if (!this.state.query) {\n return of([]);\n }\n\n this.setState({ loading: true, error: null });\n\n return from(\n getDataSource(this.state.datasource, {\n __sceneObject: wrapInSafeSerializableSceneObject(this),\n })\n ).pipe(\n mergeMap((ds) => {\n const runner = createQueryVariableRunner(ds);\n const target = runner.getTarget(this);\n const request = this.getRequest(target, args.searchFilter);\n\n return runner.runRequest({ variable: this, searchFilter: args.searchFilter }, request).pipe(\n registerQueryWithController({\n type: 'variable',\n request: request,\n origin: this,\n }),\n filter((data) => data.state === LoadingState.Done || data.state === LoadingState.Error), // we only care about done or error for now\n take(1), // take the first result, using first caused a bug where it in some situations throw an uncaught error because of no results had been received yet\n mergeMap((data: PanelData) => {\n if (data.state === LoadingState.Error) {\n return throwError(() => data.error);\n }\n return of(data);\n }),\n toMetricFindValues(),\n mergeMap((values) => {\n let regex = '';\n if (this.state.regex) {\n regex = sceneGraph.interpolate(this, this.state.regex, undefined, 'regex');\n }\n return of(metricNamesToVariableValues(regex, this.state.sort, values));\n }),\n catchError((error) => {\n if (error.cancelled) {\n return of([]);\n }\n return throwError(() => error);\n })\n );\n })\n );\n }\n\n private getRequest(target: DataQuery | string, searchFilter?: string) {\n const scopedVars: ScopedVars = {\n __sceneObject: wrapInSafeSerializableSceneObject(this),\n };\n\n if (searchFilter) {\n scopedVars.__searchFilter = { value: searchFilter, text: searchFilter };\n }\n\n const range = sceneGraph.getTimeRange(this).state.value;\n\n const request: DataQueryRequest = {\n app: CoreApp.Dashboard,\n requestId: uuidv4(),\n timezone: '',\n range,\n interval: '',\n intervalMs: 0,\n // @ts-ignore\n targets: [target],\n scopedVars,\n startTime: Date.now(),\n };\n\n return request;\n }\n\n onSearchChange = (searchFilter: string) => {\n if (!containsSearchFilter(this.state.query)) {\n return;\n }\n\n this._updateOptionsBasedOnSearchFilter(searchFilter);\n };\n\n private _updateOptionsBasedOnSearchFilter = debounce(async (searchFilter: string) => {\n const result = await lastValueFrom(this.getValueOptions({ searchFilter }));\n this.setState({ options: result, loading: false });\n }, 400);\n\n public static Component = ({ model }: SceneComponentProps<MultiValueVariable>) => {\n return renderSelectForVariable(model);\n };\n}\n\nfunction containsSearchFilter(query: string | DataQuery) {\n const str = safeStringifyValue(query);\n return str.indexOf(SEARCH_FILTER_VARIABLE) > -1;\n}\n","import { ScopedVars } from '@grafana/data';\nimport { EmptyDataNode, EmptyVariableSet } from '../../variables/interpolation/defaults';\n\nimport { sceneInterpolator } from '../../variables/interpolation/sceneInterpolator';\nimport { VariableCustomFormatterFn, SceneVariables } from '../../variables/types';\n\nimport { isDataLayer, SceneDataLayerProvider, SceneDataProvider, SceneLayout, SceneObject } from '../types';\nimport { lookupVariable } from '../../variables/lookupVariable';\nimport { getClosest } from './utils';\nimport { SceneQueryControllerLike, isQueryController } from '../../behaviors/SceneQueryController';\nimport { VariableInterpolation } from '@grafana/runtime';\nimport { QueryVariable } from '../../variables/variants/query/QueryVariable';\n\n/**\n * Get the closest node with variables\n */\nexport function getVariables(sceneObject: SceneObject): SceneVariables {\n return getClosest(sceneObject, (s) => s.state.$variables) ?? EmptyVariableSet;\n}\n\n/**\n * Will walk up the scene object graph to the closest $data scene object\n */\nexport function getData(sceneObject: SceneObject): SceneDataProvider {\n return getClosest(sceneObject, (s) => s.state.$data) ?? EmptyDataNode;\n}\n\nfunction isSceneLayout(s: SceneObject): s is SceneLayout {\n return 'isDraggable' in s;\n}\n\n/**\n * Will walk up the scene object graph to the closest $layout scene object\n */\nexport function getLayout(scene: SceneObject): SceneLayout | null {\n const parent = getClosest(scene, (s) => (isSceneLayout(s) ? s : undefined));\n if (parent) {\n return parent;\n }\n\n return null;\n}\n\n/**\n * Interpolates the given string using the current scene object as context. *\n *\n * Note: the interpolations array will be mutated by adding information about variables that\n * have been interpolated during replacement. Variables that were specified in the target but not found in\n * the list of available variables are also added to the array. See {@link VariableInterpolation} for more details.\n *\n * @param {VariableInterpolation[]} interpolations an optional array that is updated with interpolated variables.\n */\nexport function interpolate(\n sceneObject: SceneObject,\n value: string | undefined | null,\n scopedVars?: ScopedVars,\n format?: string | VariableCustomFormatterFn,\n interpolations?: VariableInterpolation[]\n): string {\n if (value === '' || value == null) {\n return '';\n }\n\n return sceneInterpolator(sceneObject, value, scopedVars, format, interpolations);\n}\n\n/**\n * Checks if the variable is currently loading or waiting to update.\n * It also returns true if a dependency of the variable is loading.\n *\n * For example if C depends on variable B which depends on variable A and A is loading this returns true for variable C and B.\n */\nexport function hasVariableDependencyInLoadingState(sceneObject: SceneObject) {\n if (!sceneObject.variableDependency) {\n return false;\n }\n\n for (const name of sceneObject.variableDependency.getNames()) {\n // This is for backwards compability. In the old architecture query variables could reference itself in a query without breaking.\n if (sceneObject instanceof QueryVariable && sceneObject.state.name === name) {\n console.warn('Query variable is referencing itself');\n continue;\n }\n\n const variable = lookupVariable(name, sceneObject);\n if (!variable) {\n continue;\n }\n\n const set = variable.parent as SceneVariables;\n if (set.isVariableLoadingOrWaitingToUpdate(variable)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction findObjectInternal(\n scene: SceneObject,\n check: (obj: SceneObject) => boolean,\n alreadySearchedChild?: SceneObject,\n shouldSearchUp?: boolean\n): SceneObject | null {\n if (check(scene)) {\n return scene;\n }\n\n let found: SceneObject | null = null;\n\n scene.forEachChild((child) => {\n if (child === alreadySearchedChild) {\n return;\n }\n\n let maybe = findObjectInternal(child, check);\n if (maybe) {\n found = maybe;\n }\n });\n\n if (found) {\n return found;\n }\n\n if (shouldSearchUp && scene.parent) {\n return findObjectInternal(scene.parent, check, scene, true);\n }\n\n return null;\n}\n\n/**\n * Returns a scene object from the scene graph with the requested key.\n *\n * Throws error if no key-matching scene object found.\n */\nexport function findByKey(sceneObject: SceneObject, key: string) {\n const found = findObject(sceneObject, (sceneToCheck) => {\n return sceneToCheck.state.key === key;\n });\n if (!found) {\n throw new Error('Unable to find scene with key ' + key);\n }\n return found;\n}\n\n/**\n * Returns a scene object from the scene graph with the requested key and type.\n *\n * Throws error if no key-matching scene object found.\n * Throws error if the given type does not match.\n */\nexport function findByKeyAndType<TargetType extends SceneObject>(\n sceneObject: SceneObject,\n key: string,\n targetType: { new (...args: never[]): TargetType }\n) {\n const found = findObject(sceneObject, (sceneToCheck) => {\n return sceneToCheck.state.key === key;\n });\n if (!found) {\n throw new Error('Unable to find scene with key ' + key);\n }\n if (!(found instanceof targetType)) {\n throw new Error(`Found scene object with key ${key} does not match type ${targetType.name}`);\n }\n return found;\n}\n\n/**\n * This will search the full scene graph, starting with the scene node passed in, then walking up the parent chain. *\n */\nexport function findObject(scene: SceneObject, check: (obj: SceneObject) => boolean): SceneObject | null {\n return findObjectInternal(scene, check, undefined, true);\n}\n\n/**\n * This will search down the full scene graph, looking for objects that match the provided predicate.\n */\nexport function findAllObjects(scene: SceneObject, check: (obj: SceneObject) => boolean): SceneObject[] {\n const found: SceneObject[] = [];\n\n scene.forEachChild((child) => {\n if (check(child)) {\n found.push(child);\n }\n\n found.push(...findAllObjects(child, check));\n });\n\n return found;\n}\n\n/**\n * Will walk up the scene object graph up until the root and collect all SceneDataLayerProvider objects.\n * When localOnly set to true, it will only collect the closest layers.\n */\nexport function getDataLayers(sceneObject: SceneObject, localOnly = false): SceneDataLayerProvider[] {\n let currentLevel: SceneObject | undefined = sceneObject;\n let collected: SceneDataLayerProvider[] = [];\n\n while (currentLevel) {\n const dataProvider = currentLevel.state.$data;\n if (!dataProvider) {\n currentLevel = currentLevel.parent;\n continue;\n }\n\n // Check if data layer exists nested inside another data provider\n if (isDataLayer(dataProvider)) {\n collected = collected.concat(dataProvider);\n } else {\n if (dataProvider.state.$data && isDataLayer(dataProvider.state.$data)) {\n collected = collected.concat(dataProvider.state.$data);\n }\n }\n\n if (localOnly && collected.length > 0) {\n break;\n }\n\n currentLevel = currentLevel.parent;\n }\n\n return collected;\n}\n\n/**\n * A utility function to find the closest ancestor of a given type. This function expects\n * to find it and will throw an error if it does not.\n */\nexport function getAncestor<ParentType>(\n sceneObject: SceneObject,\n ancestorType: { new (...args: never[]): ParentType }\n): ParentType {\n let parent: SceneObject | undefined = sceneObject;\n\n while (parent) {\n if (parent instanceof ancestorType) {\n return parent;\n }\n parent = parent.parent;\n }\n\n if (!parent) {\n throw new Error('Unable to find parent of type ' + ancestorType.name);\n }\n\n return parent as ParentType;\n}\n\n/**\n * Returns the closest query controller undefined if none found\n */\nexport function getQueryController(sceneObject: SceneObject): SceneQueryControllerLike | undefined {\n let parent: SceneObject | undefined = sceneObject;\n\n while (parent) {\n if (parent.state.$behaviors) {\n for (const behavior of parent.state.$behaviors) {\n if (isQueryController(behavior)) {\n return behavior;\n }\n }\n }\n parent = parent.parent;\n }\n\n return undefined;\n}\n","import { lookupVariable } from '../../variables/lookupVariable';\nimport { getTimeRange } from './getTimeRange';\nimport {\n findByKey,\n findByKeyAndType,\n findObject,\n findAllObjects,\n getData,\n getLayout,\n getVariables,\n getDataLayers,\n hasVariableDependencyInLoadingState,\n interpolate,\n getAncestor,\n getQueryController,\n} from './sceneGraph';\n\nexport const sceneGraph = {\n getVariables,\n getData,\n getTimeRange,\n getLayout,\n getDataLayers,\n interpolate,\n lookupVariable,\n hasVariableDependencyInLoadingState,\n findByKey,\n findByKeyAndType,\n findObject,\n findAllObjects,\n getAncestor,\n getQueryController,\n};\n","import { sceneGraph } from '../core/sceneGraph';\nimport { SceneObject } from '../core/types';\n\nexport interface SceneObjectWithDepth {\n sceneObject: SceneObject;\n depth: number;\n}\n\nexport class UniqueUrlKeyMapper {\n private index = new Map<string, SceneObject[]>();\n\n public getUniqueKey(key: string, obj: SceneObject) {\n const objectsWithKey = this.index.get(key);\n\n if (!objectsWithKey) {\n this.index.set(key, [obj]);\n return key;\n }\n\n let address = objectsWithKey.findIndex((o) => o === obj);\n if (address === -1) {\n filterOutOrphanedObjects(objectsWithKey);\n objectsWithKey.push(obj);\n\n address = objectsWithKey.length - 1;\n }\n\n if (address > 0) {\n return `${key}-${address + 1}`;\n }\n\n return key;\n }\n\n public clear() {\n this.index.clear();\n }\n}\n\nfunction filterOutOrphanedObjects(sceneObjects: SceneObject[]) {\n for (const obj of sceneObjects) {\n if (isOrphanOrInActive(obj)) {\n const index = sceneObjects.indexOf(obj);\n sceneObjects.splice(index, 1);\n }\n }\n}\n\nfunction isOrphanOrInActive(obj: SceneObject) {\n const root = obj.getRoot();\n\n // If we cannot find it from the root it's an orphan\n if (!sceneGraph.findObject(root, (child) => child === obj)) {\n return true;\n }\n\n return false;\n}\n","import { isEqual } from 'lodash';\n\nimport { SceneObject, SceneObjectUrlValue, SceneObjectUrlValues } from '../core/types';\nimport { UniqueUrlKeyMapper } from './UniqueUrlKeyMapper';\n\n/**\n * @param root\n * @returns the full scene url state as a object with keys and values\n */\nexport function getUrlState(root: SceneObject): SceneObjectUrlValues {\n const urlKeyMapper = new UniqueUrlKeyMapper();\n const result: SceneObjectUrlValues = {};\n\n const visitNode = (obj: SceneObject) => {\n if (obj.urlSync) {\n const newUrlState = obj.urlSync.getUrlState();\n\n for (const [key, value] of Object.entries(newUrlState)) {\n if (value != null) {\n const uniqueKey = urlKeyMapper.getUniqueKey(key, obj);\n result[uniqueKey] = value;\n }\n }\n }\n\n obj.forEachChild(visitNode);\n };\n\n visitNode(root);\n return result;\n}\n\n/**\n * Exported util function to sync state from an initial url state.\n * Useful for initializing an embedded scenes with a url state string.\n */\nexport function syncStateFromSearchParams(root: SceneObject, urlParams: URLSearchParams) {\n const urlKeyMapper = new UniqueUrlKeyMapper();\n syncStateFromUrl(root, urlParams, urlKeyMapper);\n}\n\nexport function syncStateFromUrl(\n root: SceneObject,\n urlParams: URLSearchParams,\n urlKeyMapper: UniqueUrlKeyMapper,\n onlyChildren?: boolean\n) {\n if (!onlyChildren) {\n syncUrlStateToObject(root, urlParams, urlKeyMapper);\n }\n\n // These two forEachChild loops might look strange but it's to make sure we walk through the scene graph one level at a time as url key conflicts depend depth in the scene tree\n root.forEachChild((child) => {\n syncUrlStateToObject(child, urlParams, urlKeyMapper);\n });\n\n root.forEachChild((child) => syncStateFromUrl(child, urlParams, urlKeyMapper, true));\n}\n\nfunction syncUrlStateToObject(sceneObject: SceneObject, urlParams: URLSearchParams, urlKeyMapper: UniqueUrlKeyMapper) {\n if (sceneObject.urlSync) {\n const urlState: SceneObjectUrlValues = {};\n const currentState = sceneObject.urlSync.getUrlState();\n\n for (const key of sceneObject.urlSync.getKeys()) {\n const uniqueKey = urlKeyMapper.getUniqueKey(key, sceneObject);\n const newValue = urlParams.getAll(uniqueKey);\n const currentValue = currentState[key];\n\n if (isUrlValueEqual(newValue, currentValue)) {\n continue;\n }\n\n if (newValue.length > 0) {\n if (Array.isArray(currentValue)) {\n urlState[key] = newValue;\n } else {\n urlState[key] = newValue[0];\n }\n } else {\n // mark this key as having no url state\n urlState[key] = null;\n }\n }\n\n if (Object.keys(urlState).length > 0) {\n sceneObject.urlSync.updateFromUrl(urlState);\n }\n }\n}\n\nexport function isUrlValueEqual(currentUrlValue: string[], newUrlValue: SceneObjectUrlValue): boolean {\n if (currentUrlValue.length === 0 && newUrlValue == null) {\n return true;\n }\n\n if (!Array.isArray(newUrlValue) && currentUrlValue?.length === 1) {\n return newUrlValue === currentUrlValue[0];\n }\n\n if (newUrlValue?.length === 0 && currentUrlValue === null) {\n return true;\n }\n\n // We have two arrays, lets compare them\n return isEqual(currentUrlValue, newUrlValue);\n}\n","import { AdHocFiltersVariable } from '../adhoc/AdHocFiltersVariable';\nimport { SceneVariable } from '../types';\nimport { ConstantVariable } from './ConstantVariable';\nimport { CustomVariable } from './CustomVariable';\nimport { DataSourceVariable } from './DataSourceVariable';\nimport { IntervalVariable } from './IntervalVariable';\nimport { TextBoxVariable } from './TextBoxVariable';\nimport { QueryVariable } from './query/QueryVariable';\nimport { GroupByVariable } from '../groupby/GroupByVariable';\n\nexport function isAdHocVariable(variable: SceneVariable): variable is AdHocFiltersVariable {\n return variable.state.type === 'adhoc';\n}\n\nexport function isConstantVariable(variable: SceneVariable): variable is ConstantVariable {\n return variable.state.type === 'constant';\n}\n\nexport function isCustomVariable(variable: SceneVariable): variable is CustomVariable {\n return variable.state.type === 'custom';\n}\n\nexport function isDataSourceVariable(variable: SceneVariable): variable is DataSourceVariable {\n return variable.state.type === 'datasource';\n}\n\nexport function isIntervalVariable(variable: SceneVariable): variable is IntervalVariable {\n return variable.state.type === 'interval';\n}\n\nexport function isQueryVariable(variable: SceneVariable): variable is QueryVariable {\n return variable.state.type === 'query';\n}\n\nexport function isTextBoxVariable(variable: SceneVariable): variable is TextBoxVariable {\n return variable.state.type === 'textbox';\n}\n\nexport function isGroupByVariable(variable: SceneVariable): variable is GroupByVariable {\n return variable.state.type === 'groupby';\n}\n","import { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneObjectState } from '../core/types';\nimport { SceneVariable } from '../variables/types';\nimport { VariableDependencyConfig } from '../variables/VariableDependencyConfig';\n\ninterface ActWhenVariableChangedState extends SceneObjectState {\n // The name of the variable to subscribe to changes to.\n variableName: string;\n /**\n * The handler to run when a variable changes.\n * @param variable The variable that changed\n * @param behavior The behavior instance where this onChange handler added to.\n * You can use this to access the parent SceneObject where this behavior exists.\n * You can also use this with the sceneGraph util functions to find objects from this scene graph location.\n * @returns Return a cancellation function if you do anything async like issue a query.\n */\n onChange: (variable: SceneVariable, behavior: ActWhenVariableChanged) => (() => void) | void;\n}\n\n/**\n * This behavior will run an effect function when specified variables change\n */\n\nexport class ActWhenVariableChanged extends SceneObjectBase<ActWhenVariableChangedState> {\n private _runningEffect: null | (() => void) = null;\n\n protected _variableDependency = new VariableDependencyConfig(this, {\n variableNames: [this.state.variableName],\n onReferencedVariableValueChanged: this._onVariableChanged.bind(this),\n });\n\n private _onVariableChanged(variable: SceneVariable): void {\n const effect = this.state.onChange;\n\n if (this._runningEffect) {\n this._runningEffect();\n this._runningEffect = null;\n }\n\n const cancellation = effect(variable, this);\n if (cancellation) {\n this._runningEffect = cancellation;\n }\n }\n}\n","import { BusEvent, BusEventHandler, BusEventType, EventBus, EventFilterOptions } from '@grafana/data';\nimport { DashboardCursorSync } from '@grafana/schema';\nimport { Observable, Unsubscribable } from 'rxjs';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneObject, SceneObjectState } from '../core/types';\n\ninterface CursorSyncState extends SceneObjectState {\n sync: DashboardCursorSync;\n}\n\n/**\n * This behavior will provide a cursor sync context within a scene.\n */\n\nexport class CursorSync extends SceneObjectBase<CursorSyncState> {\n public constructor(state: Partial<CursorSyncState>) {\n super({\n ...state,\n sync: state.sync || DashboardCursorSync.Off,\n });\n }\n\n public getEventsBus = (panel: SceneObject) => {\n if (!this.parent) {\n throw new Error('EnableCursorSync cannot be used as a standalone scene object');\n }\n // Since EnableCursorSync is a behavior, it is not a parent to any object in the scene graph.\n // We need to get it's parent in order to provide correct EventBus context to the children.\n return new PanelContextEventBus(this.parent, panel);\n };\n\n public getEventsScope() {\n if (!this.parent) {\n throw new Error('EnableCursorSync cannot be used as a standalone scene object');\n }\n\n // Since EnableCursorSync is a behavior, it is not a parent to any object in the scene graph.\n // We need to get it's parent in order to provide correct EventBus context to the children.\n return this.state.key!;\n }\n}\n\n// This serves as a shared EventsBus that is shared by children or CursorSync behavior.\nclass PanelContextEventBus implements EventBus {\n public constructor(private _source: SceneObject, private _eventsOrigin: SceneObject) {}\n\n public publish<T extends BusEvent>(event: T): void {\n (event as any).origin = this;\n this._eventsOrigin.publishEvent(event, true);\n }\n\n public getStream<T extends BusEvent>(eventType: BusEventType<T>): Observable<T> {\n return new Observable<T>((observer) => {\n const handler = (event: T) => {\n observer.next(event);\n };\n\n const sub = this._source.subscribeToEvent(eventType, handler);\n\n return () => sub.unsubscribe();\n });\n }\n\n public subscribe<T extends BusEvent>(eventType: BusEventType<T>, handler: BusEventHandler<T>): Unsubscribable {\n return this.getStream(eventType).pipe().subscribe(handler);\n }\n\n public removeAllListeners(): void {}\n\n public newScopedBus(key: string, filter: EventFilterOptions): EventBus {\n throw new Error('For internal use only');\n }\n}\n\nexport function getCursorSyncScope(sceneObject: SceneObject): CursorSync | null {\n return sceneGraph.findObject(sceneObject, (o) => o instanceof CursorSync) as CursorSync;\n}\n","import React, { RefCallback, useCallback, useMemo } from 'react';\nimport { useMeasure } from 'react-use';\n\n// @ts-ignore\nimport { AlertState, GrafanaTheme2, PanelData, PluginContextProvider, SetPanelAttentionEvent } from '@grafana/data';\n\nimport { getAppEvents } from '@grafana/runtime';\nimport { PanelChrome, ErrorBoundaryAlert, PanelContextProvider, Tooltip, useStyles2, Icon } from '@grafana/ui';\n\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { isSceneObject, SceneComponentProps, SceneLayout, SceneObject } from '../../core/types';\n\nimport { VizPanel } from './VizPanel';\nimport { css, cx } from '@emotion/css';\nimport { debounce } from 'lodash';\n\nexport function VizPanelRenderer({ model }: SceneComponentProps<VizPanel>) {\n const {\n title,\n options,\n fieldConfig,\n _pluginLoadError,\n displayMode,\n hoverHeader,\n hoverHeaderOffset,\n menu,\n headerActions,\n titleItems,\n description,\n } = model.useState();\n const [ref, { width, height }] = useMeasure();\n const appEvents = useMemo(() => getAppEvents(), []);\n\n const setPanelAttention = useCallback(() => {\n appEvents.publish(new SetPanelAttentionEvent({ panelId: model.state.key }));\n }, [model.state.key, appEvents]);\n const debouncedMouseMove = useMemo(\n () => debounce(setPanelAttention, 100, { leading: true, trailing: false }),\n [setPanelAttention]\n );\n\n const plugin = model.getPlugin();\n\n const { dragClass, dragClassCancel } = getDragClasses(model);\n const dataObject = sceneGraph.getData(model);\n\n const rawData = dataObject.useState();\n const dataWithFieldConfig = model.applyFieldConfig(rawData.data!);\n const sceneTimeRange = sceneGraph.getTimeRange(model);\n const timeZone = sceneTimeRange.getTimeZone();\n const timeRange = model.getTimeRange(dataWithFieldConfig);\n\n // Interpolate title\n const titleInterpolated = model.interpolate(title, undefined, 'text');\n\n const alertStateStyles = useStyles2(getAlertStateStyles);\n\n if (!plugin) {\n return <div>Loading plugin panel...</div>;\n }\n\n if (!plugin.panel) {\n return <div>Panel plugin has no panel component</div>;\n }\n\n const PanelComponent = plugin.panel;\n\n // If we have a query runner on our level inform it of the container width (used to set auto max data points)\n if (dataObject && dataObject.setContainerWidth) {\n dataObject.setContainerWidth(Math.round(width));\n }\n\n let titleItemsElement: React.ReactNode[] = [];\n\n if (titleItems) {\n if (Array.isArray(titleItems)) {\n titleItemsElement = titleItemsElement.concat(\n titleItems.map((titleItem) => {\n return <titleItem.Component model={titleItem} key={`${titleItem.state.key}`} />;\n })\n );\n } else if (isSceneObject(titleItems)) {\n titleItemsElement.push(<titleItems.Component model={titleItems} />);\n } else {\n titleItemsElement.push(titleItems);\n }\n }\n\n // If we have local time range show that in panel header\n if (model.state.$timeRange) {\n titleItemsElement.push(<model.state.$timeRange.Component model={model.state.$timeRange} key={model.state.key} />);\n }\n\n if (dataWithFieldConfig.alertState) {\n titleItemsElement.push(\n <Tooltip content={dataWithFieldConfig.alertState.state ?? 'unknown'} key={`alert-states-icon-${model.state.key}`}>\n <PanelChrome.TitleItem\n className={cx({\n [alertStateStyles.ok]: dataWithFieldConfig.alertState.state === AlertState.OK,\n [alertStateStyles.pending]: dataWithFieldConfig.alertState.state === AlertState.Pending,\n [alertStateStyles.alerting]: dataWithFieldConfig.alertState.state === AlertState.Alerting,\n })}\n >\n <Icon\n name={dataWithFieldConfig.alertState.state === 'alerting' ? 'heart-break' : 'heart'}\n className=\"panel-alert-icon\"\n size=\"md\"\n />\n </PanelChrome.TitleItem>\n </Tooltip>\n );\n }\n\n let panelMenu;\n if (menu) {\n panelMenu = <menu.Component model={menu} />;\n }\n\n let actionsElement: React.ReactNode | undefined;\n\n if (headerActions) {\n if (Array.isArray(headerActions)) {\n actionsElement = (\n <>\n {headerActions.map((action) => {\n return <action.Component model={action} key={`${action.state.key}`} />;\n })}\n </>\n );\n } else if (isSceneObject(headerActions)) {\n actionsElement = <headerActions.Component model={headerActions} />;\n } else {\n actionsElement = headerActions;\n }\n }\n\n // Data is always returned. For non-data panels, empty PanelData is returned.\n const data = dataWithFieldConfig!;\n\n const isReadyToRender = dataObject.isDataReadyToDisplay ? dataObject.isDataReadyToDisplay() : true;\n\n const context = model.getPanelContext();\n const panelId = model.getLegacyPanelId();\n\n return (\n <div className={relativeWrapper}>\n <div ref={ref as RefCallback<HTMLDivElement>} className={absoluteWrapper} data-viz-panel-key={model.state.key}>\n {width > 0 && height > 0 && (\n <PanelChrome\n title={titleInterpolated}\n description={description?.trim() ? model.getDescription : undefined}\n loadingState={data.state}\n statusMessage={getChromeStatusMessage(data, _pluginLoadError)}\n statusMessageOnClick={model.onStatusMessageClick}\n width={width}\n height={height}\n displayMode={displayMode}\n hoverHeader={hoverHeader}\n hoverHeaderOffset={hoverHeaderOffset}\n titleItems={titleItemsElement}\n dragClass={dragClass}\n actions={actionsElement}\n dragClassCancel={dragClassCancel}\n padding={plugin.noPadding ? 'none' : 'md'}\n menu={panelMenu}\n onCancelQuery={model.onCancelQuery}\n // @ts-ignore\n onFocus={setPanelAttention}\n onMouseEnter={setPanelAttention}\n onMouseMove={debouncedMouseMove}\n >\n {(innerWidth, innerHeight) => (\n <>\n <ErrorBoundaryAlert dependencies={[plugin, data]}>\n <PluginContextProvider meta={plugin.meta}>\n <PanelContextProvider value={context}>\n {isReadyToRender && (\n <PanelComponent\n id={panelId}\n data={data}\n title={title}\n timeRange={timeRange}\n timeZone={timeZone}\n options={options}\n fieldConfig={fieldConfig}\n transparent={false}\n width={innerWidth}\n height={innerHeight}\n renderCounter={0}\n replaceVariables={model.interpolate}\n onOptionsChange={model.onOptionsChange}\n onFieldConfigChange={model.onFieldConfigChange}\n onChangeTimeRange={model.onTimeRangeChange}\n eventBus={context.eventBus}\n />\n )}\n </PanelContextProvider>\n </PluginContextProvider>\n </ErrorBoundaryAlert>\n </>\n )}\n </PanelChrome>\n )}\n </div>\n </div>\n );\n}\n\nfunction getDragClasses(panel: VizPanel) {\n const parentLayout = sceneGraph.getLayout(panel);\n const isDraggable = parentLayout?.isDraggable();\n\n if (!parentLayout || !isDraggable || itemDraggingDisabled(panel, parentLayout)) {\n return { dragClass: '', dragClassCancel: '' };\n }\n\n return { dragClass: parentLayout.getDragClass?.(), dragClassCancel: parentLayout?.getDragClassCancel?.() };\n}\n\n/**\n * Walks up the parent chain until it hits the layout object, trying to find the closest SceneGridItemLike ancestor.\n * It is not always the direct parent, because the VizPanel can be wrapped in other objects.\n */\nfunction itemDraggingDisabled(item: SceneObject, layout: SceneLayout) {\n let ancestor = item.parent;\n\n while (ancestor && ancestor !== layout) {\n if ('isDraggable' in ancestor.state && ancestor.state.isDraggable === false) {\n return true;\n }\n\n ancestor = ancestor.parent;\n }\n\n return false;\n}\n\nfunction getChromeStatusMessage(data: PanelData, pluginLoadingError: string | undefined) {\n if (pluginLoadingError) {\n return pluginLoadingError;\n }\n\n let message = data.error ? data.error.message : undefined;\n\n // Handling multiple errors with a single string until we integrate VizPanel with inspector\n if (data.errors) {\n message = data.errors.map((e) => e.message).join(', ');\n }\n return message;\n}\n\nconst relativeWrapper = css({\n position: 'relative',\n width: '100%',\n height: '100%',\n});\n\n/**\n * Sadly this this absolute wrapper is needed for the panel to adopt smaller sizes.\n * The combo of useMeasure and PanelChrome makes the panel take up the width it get's but that makes it impossible to\n * Then adapt to smaller space (say resizing the browser window or undocking menu).\n */\nconst absoluteWrapper = css({\n position: 'absolute',\n width: '100%',\n height: '100%',\n});\n\nconst getAlertStateStyles = (theme: GrafanaTheme2) => {\n return {\n ok: css({\n color: theme.colors.success.text,\n }),\n pending: css({\n color: theme.colors.warning.text,\n }),\n alerting: css({\n color: theme.colors.error.text,\n }),\n };\n};\n","import {\n ByNamesMatcherMode,\n ConfigOverrideRule,\n DataFrame,\n DynamicConfigValue,\n FieldConfigSource,\n FieldMatcherID,\n fieldMatchers,\n FieldType,\n getFieldDisplayName,\n isSystemOverrideWithRef,\n SystemConfigOverrideRule,\n} from '@grafana/data';\nimport { SeriesVisibilityChangeMode } from '@grafana/ui';\n\nconst displayOverrideRef = 'hideSeriesFrom';\nconst isHideSeriesOverride = isSystemOverrideWithRef(displayOverrideRef);\n\nexport function seriesVisibilityConfigFactory(\n label: string,\n mode: SeriesVisibilityChangeMode,\n fieldConfig: FieldConfigSource,\n data: DataFrame[]\n): FieldConfigSource {\n const { overrides } = fieldConfig;\n\n const displayName = label;\n const currentIndex = overrides.findIndex(isHideSeriesOverride);\n\n if (currentIndex < 0) {\n if (mode === SeriesVisibilityChangeMode.ToggleSelection) {\n const override = createOverride([displayName, ...getNamesOfHiddenFields(overrides, data)]);\n\n return {\n ...fieldConfig,\n overrides: [...fieldConfig.overrides, override],\n };\n }\n\n const displayNames = getDisplayNames(data, displayName);\n const override = createOverride(displayNames);\n\n return {\n ...fieldConfig,\n overrides: [...fieldConfig.overrides, override],\n };\n }\n\n const overridesCopy = Array.from(overrides);\n const [current] = overridesCopy.splice(currentIndex, 1) as SystemConfigOverrideRule[];\n\n if (mode === SeriesVisibilityChangeMode.ToggleSelection) {\n let existing = getExistingDisplayNames(current);\n const nameOfHiddenFields = getNamesOfHiddenFields(overridesCopy, data);\n\n if (nameOfHiddenFields.length > 0) {\n existing = existing.filter((el) => nameOfHiddenFields.indexOf(el) < 0);\n }\n\n if (existing[0] === displayName && existing.length === 1) {\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n }\n\n const override = createOverride([displayName, ...nameOfHiddenFields]);\n\n return {\n ...fieldConfig,\n overrides: [...overridesCopy, override],\n };\n }\n\n const override = createExtendedOverride(current, displayName);\n\n if (allFieldsAreExcluded(override, data)) {\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n }\n\n return {\n ...fieldConfig,\n overrides: [...overridesCopy, override],\n };\n}\n\nfunction createOverride(\n names: string[],\n mode = ByNamesMatcherMode.exclude,\n property?: DynamicConfigValue\n): SystemConfigOverrideRule {\n property = property ?? {\n id: 'custom.hideFrom',\n value: {\n viz: true,\n legend: false,\n tooltip: false,\n },\n };\n\n return {\n __systemRef: displayOverrideRef,\n matcher: {\n id: FieldMatcherID.byNames,\n options: {\n mode: mode,\n names: names,\n prefix: mode === ByNamesMatcherMode.exclude ? 'All except:' : undefined,\n readOnly: true,\n },\n },\n properties: [\n {\n ...property,\n value: {\n viz: true,\n legend: false,\n tooltip: false,\n },\n },\n ],\n };\n}\n\nconst createExtendedOverride = (\n current: SystemConfigOverrideRule,\n displayName: string,\n mode = ByNamesMatcherMode.exclude\n): SystemConfigOverrideRule => {\n const property = current.properties.find((p) => p.id === 'custom.hideFrom');\n const existing = getExistingDisplayNames(current);\n const index = existing.findIndex((name) => name === displayName);\n\n if (index < 0) {\n existing.push(displayName);\n } else {\n existing.splice(index, 1);\n }\n\n return createOverride(existing, mode, property);\n};\n\nconst getExistingDisplayNames = (rule: SystemConfigOverrideRule): string[] => {\n const names = rule.matcher.options?.names;\n if (!Array.isArray(names)) {\n return [];\n }\n return [...names];\n};\n\nconst allFieldsAreExcluded = (override: SystemConfigOverrideRule, data: DataFrame[]): boolean => {\n return getExistingDisplayNames(override).length === getDisplayNames(data).length;\n};\n\nconst getDisplayNames = (data: DataFrame[], excludeName?: string): string[] => {\n const unique = new Set<string>();\n\n for (const frame of data) {\n for (const field of frame.fields) {\n if (field.type !== FieldType.number) {\n continue;\n }\n\n const name = getFieldDisplayName(field, frame, data);\n\n if (name === excludeName) {\n continue;\n }\n\n unique.add(name);\n }\n }\n\n return Array.from(unique);\n};\n\nconst getNamesOfHiddenFields = (overrides: ConfigOverrideRule[], data: DataFrame[]): string[] => {\n let names: string[] = [];\n\n for (const override of overrides) {\n const property = override.properties.find((p) => p.id === 'custom.hideFrom');\n\n if (property !== undefined && property.value?.legend === true) {\n const info = fieldMatchers.get(override.matcher.id);\n const matcher = info.get(override.matcher.options);\n\n for (const frame of data) {\n for (const field of frame.fields) {\n if (field.type !== FieldType.number) {\n continue;\n }\n\n const name = getFieldDisplayName(field, frame, data);\n\n if (matcher(field, frame, data)) {\n names.push(name);\n }\n }\n }\n }\n }\n\n return names;\n};\n","import {\n ConfigOverrideRule,\n DynamicConfigValue,\n FieldColorModeId,\n FieldConfigSource,\n FieldMatcherID,\n} from '@grafana/data';\n\nexport const changeSeriesColorConfigFactory = (\n label: string,\n color: string,\n fieldConfig: FieldConfigSource\n): FieldConfigSource => {\n const { overrides } = fieldConfig;\n const currentIndex = fieldConfig.overrides.findIndex((override) => {\n return override.matcher.id === FieldMatcherID.byName && override.matcher.options === label;\n });\n\n if (currentIndex < 0) {\n return {\n ...fieldConfig,\n overrides: [...fieldConfig.overrides, createOverride(label, color)],\n };\n }\n\n const overridesCopy = Array.from(overrides);\n const existing = overridesCopy[currentIndex];\n const propertyIndex = existing.properties.findIndex((p) => p.id === 'color');\n\n if (propertyIndex < 0) {\n overridesCopy[currentIndex] = {\n ...existing,\n properties: [...existing.properties, createProperty(color)],\n };\n\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n }\n\n const propertiesCopy = Array.from(existing.properties);\n propertiesCopy[propertyIndex] = createProperty(color);\n\n overridesCopy[currentIndex] = {\n ...existing,\n properties: propertiesCopy,\n };\n\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n};\n\nconst createOverride = (label: string, color: string): ConfigOverrideRule => {\n return {\n matcher: {\n id: FieldMatcherID.byName,\n options: label,\n },\n properties: [createProperty(color)],\n };\n};\n\nconst createProperty = (color: string): DynamicConfigValue => {\n return {\n id: 'color',\n value: {\n mode: FieldColorModeId.Fixed,\n fixedColor: color,\n },\n };\n};\n","import {\n AbsoluteTimeRange,\n FieldConfigSource,\n PanelModel,\n PanelPlugin,\n toUtc,\n getPanelOptionsWithDefaults,\n ScopedVars,\n InterpolateFunction,\n CoreApp,\n DashboardCursorSync,\n PanelData,\n compareArrayValues,\n compareDataFrameStructures,\n applyFieldOverrides,\n PluginType,\n renderMarkdown,\n PanelPluginDataSupport,\n} from '@grafana/data';\nimport { PanelContext, SeriesVisibilityChangeMode, VizLegendOptions } from '@grafana/ui';\nimport { config, getAppEvents, getPluginImportUtils } from '@grafana/runtime';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { DeepPartial, SceneObject, SceneObjectState } from '../../core/types';\n\nimport { VizPanelRenderer } from './VizPanelRenderer';\nimport { VizPanelMenu } from './VizPanelMenu';\nimport { VariableDependencyConfig } from '../../variables/VariableDependencyConfig';\nimport { VariableCustomFormatterFn } from '../../variables/types';\nimport { seriesVisibilityConfigFactory } from './seriesVisibilityConfigFactory';\nimport { emptyPanelData } from '../../core/SceneDataNode';\nimport { changeSeriesColorConfigFactory } from './colorSeriesConfigFactory';\nimport { loadPanelPluginSync } from './registerRuntimePanelPlugin';\nimport { getCursorSyncScope } from '../../behaviors/CursorSync';\nimport { cloneDeep, isArray, isEmpty, merge, mergeWith } from 'lodash';\nimport { UserActionEvent } from '../../core/events';\nimport { evaluateTimeRange } from '../../utils/evaluateTimeRange';\nimport { LiveNowTimer } from '../../behaviors/LiveNowTimer';\n\nexport interface VizPanelState<TOptions = {}, TFieldConfig = {}> extends SceneObjectState {\n /**\n * This is usually a plugin id that references a core plugin or an external plugin. But this can also reference a\n * runtime registered PanelPlugin registered via function registerScenePanelPlugin.\n */\n pluginId: string;\n title: string;\n description?: string;\n options: DeepPartial<TOptions>;\n fieldConfig: FieldConfigSource<DeepPartial<TFieldConfig>>;\n pluginVersion?: string;\n displayMode?: 'default' | 'transparent';\n /**\n * Only shows header on hover, absolutly positioned above the panel.\n */\n hoverHeader?: boolean;\n /**\n * Offset hoverHeader position on the y axis\n */\n hoverHeaderOffset?: number;\n /**\n * Defines a menu in the top right of the panel. The menu object is only activated when the dropdown menu itself is shown.\n * So the best way to add dynamic menu actions and links is by adding them in a behavior attached to the menu.\n */\n menu?: VizPanelMenu;\n /**\n * Defines a menu that renders panel link.\n **/\n titleItems?: React.ReactNode | SceneObject | SceneObject[];\n /**\n * Add action to the top right panel header\n */\n headerActions?: React.ReactNode | SceneObject | SceneObject[];\n /**\n * Mainly for advanced use cases that need custom handling of PanelContext callbacks.\n */\n extendPanelContext?: (vizPanel: VizPanel, context: PanelContext) => void;\n /**\n * @internal\n * Only for use from core to handle migration from old angular panels\n **/\n _UNSAFE_customMigrationHandler?: (panel: PanelModel, plugin: PanelPlugin) => void;\n /** Internal */\n _pluginLoadError?: string;\n /** Internal */\n _pluginInstanceState?: any;\n}\n\nexport class VizPanel<TOptions = {}, TFieldConfig extends {} = {}> extends SceneObjectBase<\n VizPanelState<TOptions, TFieldConfig>\n> {\n public static Component = VizPanelRenderer;\n\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['title', 'options', 'fieldConfig'],\n });\n\n // Not part of state as this is not serializable\n protected _panelContext?: PanelContext;\n private _plugin?: PanelPlugin;\n private _prevData?: PanelData;\n private _dataWithFieldConfig?: PanelData;\n private _structureRev: number = 0;\n\n public constructor(state: Partial<VizPanelState<TOptions, TFieldConfig>>) {\n super({\n options: {} as TOptions,\n fieldConfig: { defaults: {}, overrides: [] },\n title: 'Title',\n pluginId: 'timeseries',\n ...state,\n });\n\n this.addActivationHandler(() => {\n this._onActivate();\n });\n\n state.menu?.addActivationHandler(() => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-menu-shown' }), true);\n });\n }\n\n private _onActivate() {\n if (!this._plugin) {\n this._loadPlugin(this.state.pluginId);\n }\n }\n\n private async _loadPlugin(pluginId: string, overwriteOptions?: DeepPartial<{}>, overwriteFieldConfig?: FieldConfigSource, isAfterPluginChange?: boolean) {\n const plugin = loadPanelPluginSync(pluginId);\n\n if (plugin) {\n this._pluginLoaded(plugin, overwriteOptions, overwriteFieldConfig, isAfterPluginChange);\n } else {\n const { importPanelPlugin } = getPluginImportUtils();\n\n try {\n const result = await importPanelPlugin(pluginId);\n this._pluginLoaded(result, overwriteOptions, overwriteFieldConfig, isAfterPluginChange);\n } catch (err: unknown) {\n this._pluginLoaded(getPanelPluginNotFound(pluginId));\n\n if (err instanceof Error) {\n this.setState({ _pluginLoadError: err.message });\n }\n }\n }\n }\n\n public getLegacyPanelId() {\n const panelId = parseInt(this.state.key!.replace('panel-', ''), 10);\n if (isNaN(panelId)) {\n return 0;\n }\n\n return panelId;\n }\n\n private async _pluginLoaded(plugin: PanelPlugin, overwriteOptions?: DeepPartial<{}>, overwriteFieldConfig?: FieldConfigSource, isAfterPluginChange?: boolean) {\n const { options, fieldConfig, title, pluginVersion, _UNSAFE_customMigrationHandler } = this.state;\n\n const panel: PanelModel = {\n title,\n options,\n fieldConfig,\n id: this.getLegacyPanelId(),\n type: plugin.meta.id,\n pluginVersion: pluginVersion,\n };\n\n if (overwriteOptions) {\n panel.options = overwriteOptions;\n }\n\n if (overwriteFieldConfig) {\n panel.fieldConfig = overwriteFieldConfig;\n }\n\n const currentVersion = this._getPluginVersion(plugin);\n\n _UNSAFE_customMigrationHandler?.(panel, plugin);\n\n if (plugin.onPanelMigration && currentVersion !== this.state.pluginVersion) {\n // These migration handlers also mutate panel.fieldConfig to migrate fieldConfig\n panel.options = await plugin.onPanelMigration(panel);\n }\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin,\n currentOptions: panel.options,\n currentFieldConfig: panel.fieldConfig,\n isAfterPluginChange: isAfterPluginChange ?? false,\n });\n\n this._plugin = plugin;\n\n this.setState({\n options: withDefaults.options as DeepPartial<TOptions>,\n fieldConfig: withDefaults.fieldConfig,\n pluginVersion: currentVersion,\n pluginId: plugin.meta.id,\n });\n\n // Non data panels needs to be re-rendered when time range change\n if (plugin.meta.skipDataQuery) {\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n this._subs.add(sceneTimeRange.subscribeToState(() => this.forceRender()));\n }\n }\n\n private _getPluginVersion(plugin: PanelPlugin): string {\n return plugin && plugin.meta.info.version ? plugin.meta.info.version : config.buildInfo.version;\n }\n\n public getPlugin(): PanelPlugin | undefined {\n return this._plugin;\n }\n\n public getPanelContext(): PanelContext {\n this._panelContext ??= this.buildPanelContext();\n\n return this._panelContext!;\n }\n\n public onTimeRangeChange = (timeRange: AbsoluteTimeRange) => {\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n sceneTimeRange.onTimeRangeChange({\n raw: {\n from: toUtc(timeRange.from),\n to: toUtc(timeRange.to),\n },\n from: toUtc(timeRange.from),\n to: toUtc(timeRange.to),\n });\n };\n\n public getTimeRange = (data?: PanelData) => {\n const liveNowTimer = sceneGraph.findObject(this, (o) => o instanceof LiveNowTimer);\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n if (liveNowTimer instanceof LiveNowTimer && liveNowTimer.isEnabled) {\n return evaluateTimeRange(\n sceneTimeRange.state.from,\n sceneTimeRange.state.to,\n sceneTimeRange.getTimeZone(),\n sceneTimeRange.state.fiscalYearStartMonth,\n sceneTimeRange.state.UNSAFE_nowDelay\n );\n }\n\n const plugin = this.getPlugin();\n if (plugin && !plugin.meta.skipDataQuery && data && data.timeRange) {\n return data.timeRange;\n }\n\n return sceneTimeRange.state.value;\n };\n\n public async changePluginType(pluginId: string, newOptions?: DeepPartial<{}>, newFieldConfig?: FieldConfigSource) {\n const {\n options: prevOptions,\n fieldConfig: prevFieldConfig,\n pluginId: prevPluginId,\n } = this.state;\n\n //clear field config cache to update it later\n this._dataWithFieldConfig = undefined;\n\n await this._loadPlugin(pluginId, newOptions ?? {}, newFieldConfig, true);\n\n const panel: PanelModel = {\n title: this.state.title,\n options: this.state.options,\n fieldConfig: this.state.fieldConfig,\n id: 1,\n type: pluginId,\n };\n\n // onPanelTypeChanged is mainly used by plugins to migrate from Angular to React. \n // For example, this will migrate options from 'graph' to 'timeseries' if the previous and new plugin ID matches. \n const updatedOptions = this._plugin?.onPanelTypeChanged?.(panel, prevPluginId, prevOptions, prevFieldConfig);\n\n if (updatedOptions && !isEmpty(updatedOptions)) {\n this.onOptionsChange(updatedOptions, true, true);\n }\n }\n\n public onTitleChange = (title: string) => {\n this.setState({ title });\n };\n\n public onDescriptionChange = (description: string) => {\n this.setState({ description });\n };\n\n public onDisplayModeChange = (displayMode: 'default' | 'transparent') => {\n this.setState({ displayMode });\n };\n\n public onOptionsChange = (optionsUpdate: DeepPartial<TOptions>, replace = false, isAfterPluginChange = false) => {\n const { fieldConfig, options } = this.state;\n\n // When replace is true, we want to replace the entire options object. Default will be applied.\n const nextOptions = replace\n ? optionsUpdate\n : mergeWith(cloneDeep(options), optionsUpdate, (objValue, srcValue, key, obj) => {\n if (isArray(srcValue)) {\n return srcValue;\n }\n // If customizer returns undefined, merging is handled by the method instead\n // so we need to override the value in the object instead\n if (objValue !== srcValue && typeof srcValue === 'undefined') {\n obj[key] = srcValue;\n return;\n }\n return;\n });\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin: this._plugin!,\n currentOptions: nextOptions,\n currentFieldConfig: fieldConfig,\n isAfterPluginChange: isAfterPluginChange,\n });\n\n this.setState({\n options: withDefaults.options as DeepPartial<TOptions>,\n });\n };\n\n public onFieldConfigChange = (fieldConfigUpdate: FieldConfigSource<DeepPartial<TFieldConfig>>, replace?: boolean) => {\n const { fieldConfig, options } = this.state;\n\n // When replace is true, we want to replace the entire field config. Default will be applied.\n const nextFieldConfig = replace ? fieldConfigUpdate : merge(cloneDeep(fieldConfig), fieldConfigUpdate);\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin: this._plugin!,\n currentOptions: options,\n currentFieldConfig: nextFieldConfig,\n isAfterPluginChange: false,\n });\n\n this._dataWithFieldConfig = undefined;\n this.setState({ fieldConfig: withDefaults.fieldConfig });\n };\n\n public interpolate = ((value: string, scoped?: ScopedVars, format?: string | VariableCustomFormatterFn) => {\n return sceneGraph.interpolate(this, value, scoped, format);\n }) as InterpolateFunction;\n\n public getDescription = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-description-shown' }), true);\n\n const { description } = this.state;\n if (description) {\n const markdown = this.interpolate(description);\n return renderMarkdown(markdown);\n }\n return '';\n };\n\n public clearFieldConfigCache() {\n this._dataWithFieldConfig = undefined;\n }\n\n /**\n * Called from the react render path to apply the field config to the data provided by the data provider\n */\n public applyFieldConfig(rawData?: PanelData): PanelData {\n const plugin = this._plugin;\n\n if (!plugin || plugin.meta.skipDataQuery || !rawData) {\n // TODO setup time range subscription instead\n return emptyPanelData;\n }\n\n // If the data is the same as last time, we can skip the field config apply step and just return same result as last time\n if (this._prevData === rawData && this._dataWithFieldConfig) {\n return this._dataWithFieldConfig;\n }\n\n const pluginDataSupport: PanelPluginDataSupport = plugin.dataSupport || { alertStates: false, annotations: false };\n\n const fieldConfigRegistry = plugin.fieldConfigRegistry;\n const prevFrames = this._dataWithFieldConfig?.series ?? [];\n const newFrames = applyFieldOverrides({\n data: rawData.series,\n fieldConfig: this.state.fieldConfig,\n fieldConfigRegistry,\n replaceVariables: this.interpolate,\n theme: config.theme2,\n timeZone: rawData.request?.timezone,\n });\n\n if (!compareArrayValues(newFrames, prevFrames, compareDataFrameStructures)) {\n this._structureRev++;\n }\n\n this._dataWithFieldConfig = {\n ...rawData,\n structureRev: this._structureRev,\n series: newFrames,\n };\n\n if (this._dataWithFieldConfig.annotations) {\n this._dataWithFieldConfig.annotations = applyFieldOverrides({\n data: this._dataWithFieldConfig.annotations,\n fieldConfig: {\n defaults: {},\n overrides: [],\n },\n fieldConfigRegistry,\n replaceVariables: this.interpolate,\n theme: config.theme2,\n timeZone: rawData.request?.timezone,\n });\n }\n\n if (!pluginDataSupport.alertStates) {\n this._dataWithFieldConfig.alertState = undefined;\n }\n\n if (!pluginDataSupport.annotations) {\n this._dataWithFieldConfig.annotations = undefined;\n }\n\n this._prevData = rawData;\n return this._dataWithFieldConfig;\n }\n\n public onCancelQuery = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-cancel-query-clicked' }), true);\n const data = sceneGraph.getData(this);\n data.cancelQuery?.();\n };\n\n public onStatusMessageClick = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-status-message-clicked' }), true);\n };\n\n /**\n * Panel context functions\n */\n private _onSeriesColorChange = (label: string, color: string) => {\n this.onFieldConfigChange(changeSeriesColorConfigFactory(label, color, this.state.fieldConfig));\n };\n\n private _onSeriesVisibilityChange = (label: string, mode: SeriesVisibilityChangeMode) => {\n if (!this._dataWithFieldConfig) {\n return;\n }\n\n this.onFieldConfigChange(\n seriesVisibilityConfigFactory(label, mode, this.state.fieldConfig, this._dataWithFieldConfig.series),\n true\n );\n };\n\n private _onInstanceStateChange = (state: any) => {\n if (this._panelContext) {\n this._panelContext = {\n ...this._panelContext,\n instanceState: state,\n };\n }\n\n this.setState({ _pluginInstanceState: state });\n };\n\n private _onToggleLegendSort = (sortKey: string) => {\n const legendOptions: VizLegendOptions = (this.state.options as any).legend;\n\n // We don't want to do anything when legend options are not available\n if (!legendOptions) {\n return;\n }\n\n let sortDesc = legendOptions.sortDesc;\n let sortBy = legendOptions.sortBy;\n if (sortKey !== sortBy) {\n sortDesc = undefined;\n }\n\n // if already sort ascending, disable sorting\n if (sortDesc === false) {\n sortBy = undefined;\n sortDesc = undefined;\n } else {\n sortDesc = !sortDesc;\n sortBy = sortKey;\n }\n\n this.onOptionsChange(\n {\n ...this.state.options,\n legend: { ...legendOptions, sortBy, sortDesc },\n } as TOptions,\n true\n );\n };\n\n private buildPanelContext(): PanelContext {\n const sync = getCursorSyncScope(this);\n\n const context = {\n eventsScope: sync ? sync.getEventsScope() : '__global_',\n eventBus: sync ? sync.getEventsBus(this) : getAppEvents(),\n app: CoreApp.Unknown,\n sync: () => {\n if (sync) {\n return sync.state.sync;\n }\n return DashboardCursorSync.Off;\n },\n onSeriesColorChange: this._onSeriesColorChange,\n onToggleSeriesVisibility: this._onSeriesVisibilityChange,\n onToggleLegendSort: this._onToggleLegendSort,\n onInstanceStateChange: this._onInstanceStateChange,\n };\n\n if (this.state.extendPanelContext) {\n this.state.extendPanelContext(this, context);\n }\n\n return context;\n }\n}\n\nfunction getPanelPluginNotFound(id: string): PanelPlugin {\n const plugin = new PanelPlugin(() => null);\n\n plugin.meta = {\n id: id,\n name: id,\n sort: 100,\n type: PluginType.panel,\n module: '',\n baseUrl: '',\n info: {\n author: {\n name: '',\n },\n description: '',\n links: [],\n logos: {\n large: '',\n small: 'public/img/grafana_icon.svg',\n },\n screenshots: [],\n updated: '',\n version: '',\n },\n };\n\n return plugin;\n}\n","import { VizPanel } from '../components/VizPanel/VizPanel';\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneObjectState } from '../core/types';\n\ninterface LiveNowTimerState extends SceneObjectState {\n enabled: boolean;\n}\n\nexport class LiveNowTimer extends SceneObjectBase<LiveNowTimerState> {\n private timerId: number | undefined = undefined;\n private static REFRESH_RATE = 100; // ms\n\n public constructor({ enabled = false }) {\n super({ enabled });\n this.addActivationHandler(this._activationHandler);\n }\n\n private _activationHandler = () => {\n if (this.state.enabled) {\n this.enable();\n }\n\n return () => {\n window.clearInterval(this.timerId);\n this.timerId = undefined;\n };\n };\n\n public enable() {\n window.clearInterval(this.timerId);\n this.timerId = undefined;\n this.timerId = window.setInterval(() => {\n const panels = sceneGraph.findAllObjects(this.getRoot(), (obj) => obj instanceof VizPanel) as VizPanel[];\n for (const panel of panels) {\n panel.forceRender();\n }\n }, LiveNowTimer.REFRESH_RATE);\n this.setState({ enabled: true });\n }\n\n public disable() {\n window.clearInterval(this.timerId);\n this.timerId = undefined;\n this.setState({ enabled: false });\n }\n\n public get isEnabled() {\n return this.state.enabled;\n }\n}\n","import { isFetchError } from '@grafana/runtime';\n\nexport function getMessageFromError(err: unknown): string {\n if (typeof err === 'string') {\n return err;\n }\n\n if (err) {\n if (err instanceof Error) {\n return err.message;\n } else if (isFetchError(err)) {\n if (err.data && err.data.message) {\n return err.data.message;\n } else if (err.statusText) {\n return err.statusText;\n }\n } else if (err.hasOwnProperty('message')) {\n // @ts-expect-error\n return err.message;\n }\n }\n\n return JSON.stringify(err);\n}\n","import { PanelData } from '@grafana/data';\nimport { ReplaySubject, Unsubscribable } from 'rxjs';\nimport { emptyPanelData } from '../../core/SceneDataNode';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport {\n CancelActivationHandler,\n SceneDataLayerProvider,\n SceneDataProviderResult,\n SceneDataLayerProviderState,\n} from '../../core/types';\nimport { setBaseClassState } from '../../utils/utils';\nimport { writeSceneLog } from '../../utils/writeSceneLog';\nimport { VariableDependencyConfig } from '../../variables/VariableDependencyConfig';\nimport { VariableValueRecorder } from '../../variables/VariableValueRecorder';\n\n/**\n * Base class for data layer. Handles common implementation including enabling/disabling layer and publishing results.\n */\nexport abstract class SceneDataLayerBase<T extends SceneDataLayerProviderState>\n extends SceneObjectBase<T>\n implements SceneDataLayerProvider\n{\n /**\n * Subscription to query results. Should be set when layer runs a query.\n */\n protected querySub?: Unsubscribable;\n\n /**\n * Subject to emit results to.\n */\n private _results = new ReplaySubject<SceneDataProviderResult>(1);\n\n /**\n * Implement logic for enabling the layer. This is called when layer is enabled or when layer is enabled when activated.\n * Use i.e. to setup subscriptions that will trigger layer updates.\n */\n public abstract onEnable(): void;\n\n /**\n * Implement logic for disabling the layer. This is called when layer is disabled.\n * Use i.e. to unsubscribe from subscriptions that trigger layer updates.\n */\n public abstract onDisable(): void;\n\n /**\n * Implement logic running the layer and setting up the querySub subscription.\n */\n protected abstract runLayer(): void;\n\n /**\n * Mark data provider as data layer\n */\n public isDataLayer: true = true;\n\n private _variableValueRecorder = new VariableValueRecorder();\n\n protected _variableDependency: VariableDependencyConfig<T> = new VariableDependencyConfig(this, {\n onVariableUpdateCompleted: this.onVariableUpdateCompleted.bind(this),\n });\n\n /**\n * For variables support in data layer provide variableDependencyStatePaths with keys of the state to be scanned for variables.\n */\n public constructor(initialState: T, variableDependencyStatePaths: Array<keyof T> = []) {\n super({\n isEnabled: true,\n ...initialState,\n });\n\n this._variableDependency.setPaths(variableDependencyStatePaths);\n this.addActivationHandler(() => this.onActivate());\n }\n\n protected onActivate(): CancelActivationHandler {\n if (this.state.isEnabled) {\n this.onEnable();\n }\n\n if (this.shouldRunLayerOnActivate()) {\n this.runLayer();\n }\n\n // Subscribe to layer state changes and enable/disable layer accordingly.\n this.subscribeToState((n, p) => {\n if (!n.isEnabled && this.querySub) {\n // When layer disabled, cancel query and call onDisable that should publish empty results.\n this.querySub.unsubscribe();\n this.querySub = undefined;\n this.onDisable();\n\n // Manually publishing the results to state and results stream as publishPublish results has a guard for the layer to be enabled.\n this._results.next({ origin: this, data: emptyPanelData });\n\n this.setStateHelper({ data: emptyPanelData });\n }\n\n if (n.isEnabled && !p.isEnabled) {\n // When layer enabled, run queries.\n this.onEnable();\n this.runLayer();\n }\n });\n\n return () => {\n this.onDeactivate();\n };\n }\n\n protected onDeactivate(): void {\n if (this.querySub) {\n this.querySub.unsubscribe();\n this.querySub = undefined;\n }\n\n this.onDisable();\n\n this._variableValueRecorder.recordCurrentDependencyValuesForSceneObject(this);\n }\n\n protected onVariableUpdateCompleted(): void {\n this.runLayer();\n }\n\n public cancelQuery() {\n if (this.querySub) {\n this.querySub.unsubscribe();\n this.querySub = undefined;\n\n this.publishResults(emptyPanelData);\n }\n }\n\n protected publishResults(data: PanelData) {\n if (this.state.isEnabled) {\n this._results.next({ origin: this, data });\n this.setStateHelper({ data });\n }\n }\n\n public getResultsStream() {\n return this._results;\n }\n\n private shouldRunLayerOnActivate() {\n if (!this.state.isEnabled) {\n return false;\n }\n\n if (this._variableValueRecorder.hasDependenciesChanged(this)) {\n writeSceneLog(\n 'SceneDataLayerBase',\n 'Variable dependency changed while inactive, shouldRunLayerOnActivate returns true'\n );\n return true;\n }\n\n if (!this.state.data) {\n return true;\n }\n\n return false;\n }\n\n /**\n * This helper function is to counter the contravariance of setState\n */\n private setStateHelper(state: Partial<SceneDataLayerProviderState>) {\n setBaseClassState<SceneDataLayerProviderState>(this, state);\n }\n}\n","import { css } from '@emotion/css';\nimport { LoadingState } from '@grafana/schema';\nimport { InlineSwitch } from '@grafana/ui';\nimport React from 'react';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneDataLayerProvider, SceneObjectState } from '../../core/types';\nimport { ControlsLabel } from '../../utils/ControlsLabel';\n\ninterface SceneDataLayerControlsState extends SceneObjectState {}\n\nexport class SceneDataLayerControls extends SceneObjectBase<SceneDataLayerControlsState> {\n public static Component = SceneDataLayerControlsRenderer;\n\n public constructor() {\n super({});\n }\n}\n\nfunction SceneDataLayerControlsRenderer({ model }: SceneComponentProps<SceneDataLayerControls>) {\n const layers = sceneGraph.getDataLayers(model, true);\n\n if (layers.length === 0) {\n return null;\n }\n\n return (\n <>\n {layers.map((layer) => (\n <layer.Component model={layer} key={layer.state.key} />\n ))}\n </>\n );\n}\n\ninterface SceneDataLayerControlProps {\n layer: SceneDataLayerProvider;\n}\n\nexport function DataLayerControlSwitch({ layer }: SceneDataLayerControlProps) {\n const elementId = `data-layer-${layer.state.key}`;\n const { data, isEnabled } = layer.useState();\n const showLoading = Boolean(data && data.state === LoadingState.Loading);\n\n return (\n <div className={containerStyle}>\n <ControlsLabel\n htmlFor={elementId}\n isLoading={showLoading}\n onCancel={() => layer.cancelQuery?.()}\n label={layer.state.name}\n description={layer.state.description}\n error={layer.state.data?.errors?.[0].message}\n />\n <InlineSwitch id={elementId} value={isEnabled} onChange={() => layer.setState({ isEnabled: !isEnabled })} />\n </div>\n );\n}\n\nconst containerStyle = css({ display: 'flex' });\n","import { isString } from 'lodash';\nimport { Observable, of, OperatorFunction } from 'rxjs';\nimport { map, mergeMap } from 'rxjs/operators';\n\nimport {\n AnnotationEvent,\n AnnotationEventFieldSource,\n AnnotationEventMappings,\n AnnotationQuery,\n AnnotationSupport,\n DataFrame,\n DataSourceApi,\n DataTransformContext,\n Field,\n FieldType,\n getFieldDisplayName,\n KeyValue,\n standardTransformers,\n} from '@grafana/data';\nimport { config } from '@grafana/runtime';\n\nexport const standardAnnotationSupport: AnnotationSupport = {\n /**\n * Assume the stored value is standard model.\n */\n prepareAnnotation: (json: any) => {\n if (isString(json?.query)) {\n const { query, ...rest } = json;\n return {\n ...rest,\n target: {\n refId: 'annotation_query',\n query,\n },\n mappings: {},\n };\n }\n return json as AnnotationQuery;\n },\n\n /**\n * Default will just return target from the annotation.\n */\n prepareQuery: (anno: AnnotationQuery) => anno.target,\n\n /**\n * Provides default processing from dataFrame to annotation events.\n */\n processEvents: (anno: AnnotationQuery, data: DataFrame[]) => {\n return getAnnotationsFromData(data, anno.mappings);\n },\n};\n\n/**\n * Flatten all frames into a single frame with mergeTransformer.\n */\n\nexport function singleFrameFromPanelData(): OperatorFunction<DataFrame[], DataFrame | undefined> {\n return (source) =>\n source.pipe(\n mergeMap((data) => {\n if (!data?.length) {\n return of(undefined);\n }\n\n if (data.length === 1) {\n return of(data[0]);\n }\n\n const ctx: DataTransformContext = {\n interpolate: (v: string) => v,\n };\n\n return of(data).pipe(\n standardTransformers.mergeTransformer.operator({}, ctx),\n map((d) => d[0])\n );\n })\n );\n}\n\ninterface AnnotationEventFieldSetter {\n key: keyof AnnotationEvent;\n field?: Field;\n text?: string;\n regex?: RegExp;\n split?: string; // for tags\n}\n\nexport interface AnnotationFieldInfo {\n key: keyof AnnotationEvent;\n\n split?: string;\n field?: (frame: DataFrame) => Field | undefined;\n placeholder?: string;\n help?: string;\n}\n\n// These fields get added to the standard UI\nexport const annotationEventNames: AnnotationFieldInfo[] = [\n {\n key: 'time',\n field: (frame: DataFrame) => frame.fields.find((f) => f.type === FieldType.time),\n placeholder: 'time, or the first time field',\n },\n { key: 'timeEnd', help: 'When this field is defined, the annotation will be treated as a range' },\n {\n key: 'title',\n },\n {\n key: 'text',\n field: (frame: DataFrame) => frame.fields.find((f) => f.type === FieldType.string),\n placeholder: 'text, or the first text field',\n },\n { key: 'tags', split: ',', help: 'The results will be split on comma (,)' },\n {\n key: 'id',\n },\n];\n\nexport const publicDashboardEventNames: AnnotationFieldInfo[] = [\n {\n key: 'color',\n },\n {\n key: 'isRegion',\n },\n {\n key: 'source',\n },\n];\n\n// Given legacy infrastructure, alert events are passed though the same annotation\n// pipeline, but include fields that should not be exposed generally\nconst alertEventAndAnnotationFields: AnnotationFieldInfo[] = [\n ...(config.publicDashboardAccessToken ? publicDashboardEventNames : []),\n ...annotationEventNames,\n { key: 'userId' },\n { key: 'login' },\n { key: 'email' },\n { key: 'prevState' },\n { key: 'newState' },\n { key: 'data' as any },\n { key: 'panelId' },\n { key: 'alertId' },\n { key: 'dashboardId' },\n { key: 'dashboardUID' },\n];\n\nexport function getAnnotationsFromData(\n data: DataFrame[],\n options?: AnnotationEventMappings\n): Observable<AnnotationEvent[]> {\n return of(data).pipe(\n singleFrameFromPanelData(),\n map((frame) => {\n if (!frame?.length) {\n return [];\n }\n\n let hasTime = false;\n let hasText = false;\n const byName: KeyValue<Field> = {};\n\n for (const f of frame.fields) {\n const name = getFieldDisplayName(f, frame);\n byName[name.toLowerCase()] = f;\n }\n\n if (!options) {\n options = {};\n }\n\n const fields: AnnotationEventFieldSetter[] = [];\n\n for (const evts of alertEventAndAnnotationFields) {\n const opt = options[evts.key] || {}; //AnnotationEventFieldMapping\n\n if (opt.source === AnnotationEventFieldSource.Skip) {\n continue;\n }\n\n const setter: AnnotationEventFieldSetter = { key: evts.key, split: evts.split };\n\n if (opt.source === AnnotationEventFieldSource.Text) {\n setter.text = opt.value;\n } else {\n const lower = (opt.value || evts.key).toLowerCase();\n setter.field = byName[lower];\n\n if (!setter.field && evts.field) {\n setter.field = evts.field(frame);\n }\n }\n\n if (setter.field || setter.text) {\n fields.push(setter);\n if (setter.key === 'time') {\n hasTime = true;\n } else if (setter.key === 'text') {\n hasText = true;\n }\n }\n }\n\n if (!hasTime || !hasText) {\n console.error('Cannot process annotation fields. No time or text present.');\n return [];\n }\n\n // Add each value to the string\n const events: AnnotationEvent[] = [];\n\n for (let i = 0; i < frame.length; i++) {\n const anno: AnnotationEvent = {\n type: 'default',\n color: 'red',\n };\n\n for (const f of fields) {\n let v: any = undefined;\n\n if (f.text) {\n v = f.text; // TODO support templates!\n } else if (f.field) {\n v = f.field.values.get(i);\n if (v !== undefined && f.regex) {\n const match = f.regex.exec(v);\n if (match) {\n v = match[1] ? match[1] : match[0];\n }\n }\n }\n\n if (v !== null && v !== undefined) {\n if (f.split && typeof v === 'string') {\n v = v.split(',');\n }\n (anno as any)[f.key] = v;\n }\n }\n\n events.push(anno);\n }\n return events;\n })\n );\n}\n\n// These opt outs are here only for quicker and easier migration to react based annotations editors and because\n// annotation support API needs some work to support less \"standard\" editors like prometheus and here it is not\n// polluting public API.\n\nconst legacyRunner = [\n 'prometheus',\n 'loki',\n 'elasticsearch',\n 'grafana-opensearch-datasource', // external\n];\n\n/**\n * Use legacy runner. Used only as an escape hatch for easier transition to React based annotation editor.\n */\nexport function shouldUseLegacyRunner(datasource: DataSourceApi): boolean {\n const { type } = datasource;\n return !datasource.annotations || legacyRunner.includes(type);\n}\n","import { from, Observable, of } from 'rxjs';\nimport { map, mergeMap } from 'rxjs/operators';\n\nimport {\n AnnotationEvent,\n AnnotationQuery,\n CoreApp,\n DataQueryRequest,\n DataSourceApi,\n DataTopic,\n PanelModel,\n rangeUtil,\n ScopedVars,\n} from '@grafana/data';\n\nimport { getRunRequest } from '@grafana/runtime';\nimport { shouldUseLegacyRunner, standardAnnotationSupport } from './standardAnnotationsSupport';\nimport { Dashboard, LoadingState } from '@grafana/schema';\nimport { SceneObject, SceneTimeRangeLike } from '../../../core/types';\nimport { getEnrichedDataRequest } from '../../getEnrichedDataRequest';\nimport { wrapInSafeSerializableSceneObject } from '../../../utils/wrapInSafeSerializableSceneObject';\n\nlet counter = 100;\nfunction getNextRequestId() {\n return 'AQ' + counter++;\n}\n\nexport interface AnnotationQueryOptions {\n dashboard: Dashboard;\n panel: PanelModel;\n}\n\nexport interface AnnotationQueryResults {\n state: LoadingState;\n events: AnnotationEvent[];\n}\n\nexport function executeAnnotationQuery(\n datasource: DataSourceApi,\n timeRange: SceneTimeRangeLike,\n query: AnnotationQuery,\n layer: SceneObject\n): Observable<AnnotationQueryResults> {\n // Check if we should use the old annotationQuery method\n if (datasource.annotationQuery && shouldUseLegacyRunner(datasource)) {\n console.warn('Using deprecated annotationQuery method, please upgrade your datasource');\n return from(\n datasource.annotationQuery({\n range: timeRange.state.value,\n rangeRaw: timeRange.state.value.raw,\n annotation: query,\n dashboard: {},\n })\n ).pipe(\n map((events) => ({\n state: LoadingState.Done,\n events,\n }))\n );\n }\n\n // Standard API for annotations support. Spread in datasource annotations support overrides\n const processor = {\n ...standardAnnotationSupport,\n ...datasource.annotations,\n };\n\n const annotationWithDefaults = {\n // Default query provided by a data source\n ...processor.getDefaultQuery?.(),\n ...query,\n };\n\n // Data source query migrations\n const annotation = processor.prepareAnnotation!(annotationWithDefaults);\n if (!annotation) {\n return of({\n state: LoadingState.Done,\n events: [],\n });\n }\n\n const processedQuery = processor.prepareQuery!(annotation);\n if (!processedQuery) {\n return of({\n state: LoadingState.Done,\n events: [],\n });\n }\n\n // No more points than pixels\n const maxDataPoints = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n\n // Add interval to annotation queries\n const interval = rangeUtil.calculateInterval(timeRange.state.value, maxDataPoints, datasource.interval);\n\n const scopedVars: ScopedVars = {\n __interval: { text: interval.interval, value: interval.interval },\n __interval_ms: { text: interval.intervalMs.toString(), value: interval.intervalMs },\n __annotation: { text: annotation.name, value: annotation },\n __sceneObject: wrapInSafeSerializableSceneObject(layer),\n };\n\n const queryRequest: DataQueryRequest = {\n startTime: Date.now(),\n requestId: getNextRequestId(),\n range: timeRange.state.value,\n maxDataPoints,\n scopedVars,\n ...interval,\n app: CoreApp.Dashboard,\n timezone: timeRange.getTimeZone(),\n targets: [\n {\n ...processedQuery,\n refId: 'Anno',\n },\n ],\n ...getEnrichedDataRequest(layer),\n };\n\n const runRequest = getRunRequest();\n\n return runRequest(datasource, queryRequest).pipe(\n mergeMap((panelData) => {\n // Some annotations set the topic already\n const data = panelData?.series.length ? panelData.series : panelData.annotations;\n\n if (!data?.length) {\n return of({\n state: panelData.state,\n events: [],\n });\n }\n\n // Add data topic to each frame\n data.forEach((frame) => {\n // If data topic has not been provided by the data source, make sure it's set correctly\n if (!frame.meta?.dataTopic) {\n frame.meta = { ...(frame.meta || {}), dataTopic: DataTopic.Annotations };\n }\n });\n\n return processor.processEvents!(annotation, data).pipe(\n map((events) => {\n return {\n state: panelData.state,\n events: events || [],\n };\n })\n );\n })\n );\n}\n","// These opt outs are here only for quicker and easier migration to react based annotations editors and because\n// annotation support API needs some work to support less \"standard\" editors like prometheus and here it is not\n// polluting public API.\n\nimport { AnnotationEvent, AnnotationQuery, DataSourceApi } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { cloneDeep, concat, every, find, groupBy, head, map, partition } from 'lodash';\n\nconst legacyRunner = [\n 'prometheus',\n 'loki',\n 'elasticsearch',\n 'grafana-opensearch-datasource', // external\n];\n\n/**\n * Use legacy runner. Used only as an escape hatch for easier transition to React based annotation editor.\n */\nexport function shouldUseLegacyRunner(datasource: DataSourceApi): boolean {\n const { type } = datasource;\n return !datasource.annotations || legacyRunner.includes(type);\n}\n\nexport function postProcessQueryResult(annotation: AnnotationQuery, results: AnnotationEvent[]): AnnotationEvent[] {\n // if annotation has snapshotData\n // make clone and remove it\n if (annotation.snapshotData) {\n annotation = cloneDeep(annotation);\n delete annotation.snapshotData;\n }\n\n //\n const processed = results.map((item) => {\n const processedItem = { ...item };\n\n processedItem.source = annotation;\n processedItem.color = config.theme2.visualization.getColorByName(annotation.iconColor);\n processedItem.type = annotation.name;\n processedItem.isRegion = Boolean(processedItem.timeEnd && processedItem.time !== processedItem.timeEnd);\n\n switch (processedItem.newState?.toLowerCase()) {\n case 'pending':\n processedItem.color = 'yellow';\n break;\n case 'alerting':\n processedItem.color = 'red';\n break;\n case 'ok':\n processedItem.color = 'green';\n break;\n case 'normal': // ngalert (\"normal\" instead of \"ok\")\n processedItem.color = 'green';\n break;\n case 'no_data':\n processedItem.color = 'gray';\n break;\n case 'nodata': // ngalert\n processedItem.color = 'gray';\n break;\n }\n\n return processedItem;\n });\n\n return processed;\n}\n\nexport function dedupAnnotations(annotations: any) {\n let dedup = [];\n\n // Split events by annotationId property existence\n const events = partition(annotations, 'id');\n\n const eventsById = groupBy(events[0], 'id');\n dedup = map(eventsById, (eventGroup) => {\n if (eventGroup.length > 1 && !every(eventGroup, isPanelAlert)) {\n // Get first non-panel alert\n return find(eventGroup, (event) => {\n return event.eventType !== 'panel-alert';\n });\n } else {\n return head(eventGroup);\n }\n });\n\n dedup = concat(dedup, events[1]);\n return dedup;\n}\n\nfunction isPanelAlert(event: { eventType: string }) {\n return event.eventType === 'panel-alert';\n}\n","import { arrayToDataFrame, DataTopic, AnnotationQuery, ScopedVars, PanelData } from '@grafana/data';\nimport { LoadingState } from '@grafana/schema';\nimport React from 'react';\nimport { map, Unsubscribable } from 'rxjs';\nimport { emptyPanelData } from '../../../core/SceneDataNode';\nimport { sceneGraph } from '../../../core/sceneGraph';\nimport {\n SceneComponentProps,\n SceneDataLayerProvider,\n SceneDataLayerProviderState,\n SceneTimeRangeLike,\n} from '../../../core/types';\nimport { getDataSource } from '../../../utils/getDataSource';\nimport { getMessageFromError } from '../../../utils/getMessageFromError';\nimport { writeSceneLog } from '../../../utils/writeSceneLog';\nimport { registerQueryWithController } from '../../registerQueryWithController';\nimport { SceneDataLayerBase } from '../SceneDataLayerBase';\nimport { DataLayerControlSwitch } from '../SceneDataLayerControls';\nimport { AnnotationQueryResults, executeAnnotationQuery } from './standardAnnotationQuery';\nimport { dedupAnnotations, postProcessQueryResult } from './utils';\nimport { wrapInSafeSerializableSceneObject } from '../../../utils/wrapInSafeSerializableSceneObject';\n\ninterface AnnotationsDataLayerState extends SceneDataLayerProviderState {\n query: AnnotationQuery;\n}\n\nexport class AnnotationsDataLayer\n extends SceneDataLayerBase<AnnotationsDataLayerState>\n implements SceneDataLayerProvider\n{\n static Component = AnnotationsDataLayerRenderer;\n\n private _scopedVars: ScopedVars = {\n __sceneObject: wrapInSafeSerializableSceneObject(this),\n };\n private _timeRangeSub: Unsubscribable | undefined;\n\n public constructor(initialState: AnnotationsDataLayerState) {\n super(\n {\n isEnabled: true,\n ...initialState,\n },\n ['query']\n );\n }\n\n public onEnable(): void {\n const timeRange = sceneGraph.getTimeRange(this);\n\n this._timeRangeSub = timeRange.subscribeToState(() => {\n this.runWithTimeRange(timeRange);\n });\n }\n\n public onDisable(): void {\n this._timeRangeSub?.unsubscribe();\n }\n\n public runLayer() {\n writeSceneLog('AnnotationsDataLayer', 'run layer');\n const timeRange = sceneGraph.getTimeRange(this);\n this.runWithTimeRange(timeRange);\n }\n\n private async runWithTimeRange(timeRange: SceneTimeRangeLike) {\n const { query } = this.state;\n\n if (this.querySub) {\n this.querySub.unsubscribe();\n }\n\n if (this._variableDependency.hasDependencyInLoadingState()) {\n writeSceneLog('AnnotationsDataLayer', 'Variable dependency is in loading state, skipping query execution');\n return;\n }\n\n try {\n const ds = await this.resolveDataSource(query);\n\n let stream = executeAnnotationQuery(ds, timeRange, query, this).pipe(\n registerQueryWithController({\n type: 'annotations',\n origin: this,\n cancel: () => this.cancelQuery(),\n }),\n map((events) => {\n const stateUpdate = this.processEvents(query, events);\n return stateUpdate;\n })\n );\n\n this.querySub = stream.subscribe((stateUpdate) => {\n this.publishResults(stateUpdate);\n });\n } catch (e) {\n this.publishResults({\n ...emptyPanelData,\n state: LoadingState.Error,\n errors: [\n {\n message: getMessageFromError(e),\n },\n ],\n });\n console.error('AnnotationsDataLayer error', e);\n }\n }\n\n protected async resolveDataSource(query: AnnotationQuery) {\n return await getDataSource(query.datasource || undefined, this._scopedVars);\n }\n\n protected processEvents(query: AnnotationQuery, events: AnnotationQueryResults): PanelData {\n let processedEvents = postProcessQueryResult(query, events.events || []);\n processedEvents = dedupAnnotations(processedEvents);\n\n const stateUpdate = { ...emptyPanelData, state: events.state };\n const df = arrayToDataFrame(processedEvents);\n\n df.meta = {\n ...df.meta,\n dataTopic: DataTopic.Annotations,\n };\n\n stateUpdate.series = [df];\n\n return stateUpdate;\n }\n}\n\nfunction AnnotationsDataLayerRenderer({ model }: SceneComponentProps<AnnotationsDataLayer>) {\n const { isHidden } = model.useState();\n\n if (isHidden) {\n return null;\n }\n\n return <DataLayerControlSwitch layer={model} />;\n}\n","import { TimeRange } from '@grafana/data';\nimport { TimeZone } from '@grafana/schema';\nimport { sceneGraph } from './sceneGraph';\nimport { SceneObjectBase } from './SceneObjectBase';\nimport { SceneTimeRangeLike, SceneTimeRangeState } from './types';\n\n/**\n * @internal\n * Used by SceneTimeZoneOverride and main repo PanelTimeRange.\n * Not recommened to be used by plugins directly.\n */\nexport abstract class SceneTimeRangeTransformerBase<T extends SceneTimeRangeState>\n extends SceneObjectBase<T>\n implements SceneTimeRangeLike\n{\n public constructor(state: T) {\n super(state);\n\n this.addActivationHandler(this._activationHandler);\n }\n\n protected getAncestorTimeRange() {\n if (!this.parent || !this.parent.parent) {\n throw new Error(typeof this + ' must be used within $timeRange scope');\n }\n\n return sceneGraph.getTimeRange(this.parent.parent);\n }\n\n private _activationHandler = () => {\n const ancestorTimeRange = this.getAncestorTimeRange();\n\n this.ancestorTimeRangeChanged(ancestorTimeRange.state);\n\n this._subs.add(ancestorTimeRange.subscribeToState((s) => this.ancestorTimeRangeChanged(s)));\n };\n\n protected abstract ancestorTimeRangeChanged(timeRange: SceneTimeRangeState): void;\n\n public getTimeZone(): TimeZone {\n return this.getAncestorTimeRange().getTimeZone();\n }\n\n public onTimeRangeChange(timeRange: TimeRange): void {\n this.getAncestorTimeRange().onTimeRangeChange(timeRange);\n }\n\n public onTimeZoneChange(timeZone: string): void {\n this.getAncestorTimeRange().onTimeZoneChange(timeZone);\n }\n\n public onRefresh(): void {\n this.getAncestorTimeRange().onRefresh();\n }\n}\n","import { TimeZone } from '@grafana/schema';\nimport { SceneTimeRangeLike, SceneTimeRangeState } from './types';\nimport { SceneTimeRangeTransformerBase } from './SceneTimeRangeTransformerBase';\nimport { getDefaultTimeRange } from '@grafana/data';\nimport { evaluateTimeRange } from '../utils/evaluateTimeRange';\n\ninterface SceneTimeZoneOverrideState extends SceneTimeRangeState {\n timeZone: TimeZone;\n}\n\nexport class SceneTimeZoneOverride\n extends SceneTimeRangeTransformerBase<SceneTimeZoneOverrideState>\n implements SceneTimeRangeLike\n{\n public constructor(state: Omit<SceneTimeZoneOverrideState, 'from' | 'to' | 'value'>) {\n super({\n ...state,\n timeZone: state.timeZone,\n // We set a default time range here. It will be overwritten on activation based on ancestor time range.\n from: 'now-6h',\n to: 'now',\n value: getDefaultTimeRange(),\n });\n }\n\n protected ancestorTimeRangeChanged(timeRange: SceneTimeRangeState): void {\n this.setState({\n ...timeRange,\n timeZone: this.state.timeZone,\n value: evaluateTimeRange(\n timeRange.from,\n timeRange.to,\n this.state.timeZone,\n timeRange.fiscalYearStartMonth,\n timeRange.UNSAFE_nowDelay\n ),\n });\n }\n\n public getTimeZone(): TimeZone {\n return this.state.timeZone;\n }\n\n public onTimeZoneChange(timeZone: string): void {\n this.setState({\n timeZone,\n value: evaluateTimeRange(\n this.state.from,\n this.state.to,\n this.state.timeZone,\n this.getAncestorTimeRange().state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n ),\n });\n }\n}\n","import React from 'react';\nimport { DataFrame } from '@grafana/data';\nimport { Observable, ReplaySubject, Unsubscribable } from 'rxjs';\nimport { emptyPanelData } from '../core/SceneDataNode';\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport {\n SceneComponentProps,\n SceneDataLayerProvider,\n SceneDataLayerProviderState,\n SceneDataProviderResult,\n} from '../core/types';\nimport { DataLayersMerger } from './DataLayersMerger';\nimport { setBaseClassState } from '../utils/utils';\n\nexport abstract class SceneDataLayerSetBase<T extends SceneDataLayerProviderState>\n extends SceneObjectBase<T>\n implements SceneDataLayerProvider\n{\n /** Mark it as a data layer */\n public isDataLayer: true = true;\n\n /**\n * Subscription to query results. Should be set when layer runs a query.\n */\n protected querySub?: Unsubscribable;\n\n /**\n * Subject to emit results to.\n */\n private _results = new ReplaySubject<SceneDataProviderResult>(1);\n private _dataLayersMerger = new DataLayersMerger();\n\n protected subscribeToAllLayers(layers: SceneDataLayerProvider[]) {\n if (layers.length > 0) {\n this.querySub = this._dataLayersMerger.getMergedStream(layers).subscribe(this._onLayerUpdateReceived.bind(this));\n } else {\n this._results.next({ origin: this, data: emptyPanelData });\n this.setStateHelper({ data: emptyPanelData });\n }\n }\n\n private _onLayerUpdateReceived(results: Iterable<SceneDataProviderResult>) {\n let series: DataFrame[] = [];\n\n for (const result of results) {\n if (result.data?.series) {\n series = series.concat(result.data.series);\n }\n }\n\n const combinedData = { ...emptyPanelData, series: series };\n\n this._results.next({ origin: this, data: combinedData });\n this.setStateHelper({ data: combinedData });\n }\n\n public getResultsStream(): Observable<SceneDataProviderResult> {\n return this._results;\n }\n\n public cancelQuery() {\n this.querySub?.unsubscribe();\n }\n\n /**\n * This helper function is to counter the contravariance of setState\n */\n private setStateHelper(state: Partial<SceneDataLayerProviderState>) {\n setBaseClassState<SceneDataLayerProviderState>(this, state);\n }\n}\n\nexport interface SceneDataLayersSetState extends SceneDataLayerProviderState {\n layers: SceneDataLayerProvider[];\n}\n\nexport class SceneDataLayerSet\n extends SceneDataLayerSetBase<SceneDataLayersSetState>\n implements SceneDataLayerProvider\n{\n public constructor(state: Partial<SceneDataLayersSetState>) {\n super({\n name: state.name ?? 'Data layers',\n layers: state.layers ?? [],\n });\n\n this.addActivationHandler(() => this._onActivate());\n }\n\n private _onActivate() {\n this._subs.add(\n this.subscribeToState((newState, oldState) => {\n if (newState.layers !== oldState.layers) {\n this.querySub?.unsubscribe();\n this.subscribeToAllLayers(newState.layers);\n }\n })\n );\n\n this.subscribeToAllLayers(this.state.layers);\n\n return () => {\n this.querySub?.unsubscribe();\n };\n }\n\n public static Component = ({ model }: SceneComponentProps<SceneDataLayerSet>) => {\n const { layers } = model.useState();\n\n return (\n <>\n {layers.map((layer) => (\n <layer.Component model={layer} key={layer.state.key} />\n ))}\n </>\n );\n };\n}\n","import { DataTopic, DataTransformerConfig, LoadingState, PanelData, transformDataFrame } from '@grafana/data';\nimport { toDataQueryError } from '@grafana/runtime';\nimport { catchError, forkJoin, map, of, ReplaySubject, Unsubscribable } from 'rxjs';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { CustomTransformerDefinition, SceneDataProvider, SceneDataProviderResult, SceneDataState } from '../core/types';\nimport { VariableDependencyConfig } from '../variables/VariableDependencyConfig';\nimport { SceneDataLayerSet } from './SceneDataLayerSet';\n\nexport interface SceneDataTransformerState extends SceneDataState {\n /**\n * Array of standard transformation configs and custom transform operators\n */\n transformations: Array<DataTransformerConfig | CustomTransformerDefinition>;\n}\n\n/**\n * You can use this as a $data object. It can either transform an inner $data DataProvider or if that is not set it will\n * subscribe to a DataProvider higher up in the scene graph and transform its data.\n *\n * The transformations array supports custom (runtime defined) transformation as well as declarative core transformations.\n * You can manually re-process the transformations by calling reprocessTransformations(). This is useful if you have\n * transformations that depend on other scene object states.\n */\nexport class SceneDataTransformer extends SceneObjectBase<SceneDataTransformerState> implements SceneDataProvider {\n private _transformSub?: Unsubscribable;\n private _results = new ReplaySubject<SceneDataProviderResult>(1);\n private _prevDataFromSource?: PanelData;\n\n /**\n * Scan transformations for variable usage and re-process transforms when a variable values change\n */\n protected _variableDependency: VariableDependencyConfig<SceneDataTransformerState> = new VariableDependencyConfig(\n this,\n {\n statePaths: ['transformations'],\n onReferencedVariableValueChanged: () => this.reprocessTransformations(),\n }\n );\n\n public constructor(state: SceneDataTransformerState) {\n super(state);\n\n this.addActivationHandler(() => this.activationHandler());\n }\n\n private activationHandler() {\n const sourceData = this.getSourceData();\n\n this._subs.add(sourceData.subscribeToState((state) => this.transform(state.data)));\n\n if (sourceData.state.data) {\n this.transform(sourceData.state.data);\n }\n\n return () => {\n if (this._transformSub) {\n this._transformSub.unsubscribe();\n }\n };\n }\n\n private getSourceData(): SceneDataProvider {\n if (this.state.$data) {\n if (this.state.$data instanceof SceneDataLayerSet) {\n throw new Error('SceneDataLayerSet can not be used as data provider for SceneDataTransformer.');\n }\n return this.state.$data;\n }\n\n if (!this.parent || !this.parent.parent) {\n throw new Error('SceneDataTransformer must either have $data set on it or have a parent.parent with $data');\n }\n\n return sceneGraph.getData(this.parent.parent);\n }\n\n public setContainerWidth(width: number) {\n if (this.state.$data && this.state.$data.setContainerWidth) {\n this.state.$data.setContainerWidth(width);\n }\n }\n\n public isDataReadyToDisplay() {\n const dataObject = this.getSourceData();\n if (dataObject.isDataReadyToDisplay) {\n return dataObject.isDataReadyToDisplay();\n }\n\n return true;\n }\n\n public reprocessTransformations() {\n this.transform(this.getSourceData().state.data, true);\n }\n\n public cancelQuery() {\n this.getSourceData().cancelQuery?.();\n }\n\n public getResultsStream() {\n return this._results;\n }\n\n public clone(withState?: Partial<SceneDataTransformerState>) {\n const clone = super.clone(withState);\n\n if (this._prevDataFromSource) {\n clone['_prevDataFromSource'] = this._prevDataFromSource;\n }\n\n return clone;\n }\n\n private haveAlreadyTransformedData(data: PanelData) {\n if (!this._prevDataFromSource) {\n return false;\n }\n\n if (data === this._prevDataFromSource) {\n return true;\n }\n\n const { series, annotations } = this._prevDataFromSource;\n\n if (data.series === series && data.annotations === annotations) {\n if (this.state.data && data.state !== this.state.data.state) {\n this.setState({ data: { ...this.state.data, state: data.state } });\n }\n return true;\n }\n\n return false;\n }\n\n private transform(data: PanelData | undefined, force = false) {\n if (this.state.transformations.length === 0 || !data) {\n this._prevDataFromSource = data;\n this.setState({ data });\n\n if (data) {\n this._results.next({ origin: this, data });\n }\n return;\n }\n\n // Skip transform step if we have already transformed this data\n if (!force && this.haveAlreadyTransformedData(data)) {\n return;\n }\n\n const seriesTransformations = this.state.transformations\n .filter((transformation) => {\n if ('options' in transformation || 'topic' in transformation) {\n return transformation.topic == null || transformation.topic === DataTopic.Series;\n }\n\n return true;\n })\n .map((transformation) => ('operator' in transformation ? transformation.operator : transformation));\n\n const annotationsTransformations = this.state.transformations\n .filter((transformation) => {\n if ('options' in transformation || 'topic' in transformation) {\n return transformation.topic === DataTopic.Annotations;\n }\n\n return false;\n })\n .map((transformation) => ('operator' in transformation ? transformation.operator : transformation));\n\n if (this._transformSub) {\n this._transformSub.unsubscribe();\n }\n\n const ctx = {\n interpolate: (value: string) => {\n return sceneGraph.interpolate(this, value, data.request?.scopedVars);\n },\n };\n\n let streams = [transformDataFrame(seriesTransformations, data.series, ctx)];\n\n if (data.annotations && data.annotations.length > 0 && annotationsTransformations.length > 0) {\n streams.push(transformDataFrame(annotationsTransformations, data.annotations ?? []));\n }\n\n this._transformSub = forkJoin(streams)\n .pipe(\n map((values) => {\n const transformedSeries = values[0];\n const transformedAnnotations = values[1];\n\n return {\n ...data,\n series: transformedSeries,\n annotations: transformedAnnotations ?? data.annotations,\n };\n }),\n catchError((err) => {\n console.error('Error transforming data: ', err);\n const sourceErr = this.getSourceData().state.data?.errors || [];\n\n const transformationError = toDataQueryError(err);\n transformationError.message = `Error transforming data: ${transformationError.message}`;\n\n const result: PanelData = {\n ...data,\n state: LoadingState.Error,\n // Combine transformation error with upstream errors\n errors: [...sourceErr, transformationError],\n };\n\n return of(result);\n })\n )\n .subscribe((transformedData) => {\n this.setState({ data: transformedData });\n this._results.next({ origin: this, data: transformedData });\n this._prevDataFromSource = data;\n });\n }\n}\n","import React from 'react';\n\nimport { VariableHide } from '@grafana/data';\n\nimport { SceneObjectBase, useSceneObjectState } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { ControlsLayout, SceneComponentProps, SceneObjectState } from '../../core/types';\nimport { SceneVariable, SceneVariableState } from '../types';\nimport { ControlsLabel } from '../../utils/ControlsLabel';\nimport { css } from '@emotion/css';\nimport { selectors } from '@grafana/e2e-selectors';\n\nexport interface VariableValueSelectorsState extends SceneObjectState {\n layout?: ControlsLayout;\n}\n\nexport class VariableValueSelectors extends SceneObjectBase<VariableValueSelectorsState> {\n public static Component = VariableValueSelectorsRenderer;\n}\n\nfunction VariableValueSelectorsRenderer({ model }: SceneComponentProps<VariableValueSelectors>) {\n const variables = sceneGraph.getVariables(model)!.useState();\n\n return (\n <>\n {variables.variables.map((variable) => (\n <VariableValueSelectWrapper key={variable.state.key} variable={variable} layout={model.state.layout} />\n ))}\n </>\n );\n}\n\ninterface VariableSelectProps {\n layout?: ControlsLayout;\n variable: SceneVariable;\n /** To override hide from VariableValueSelectByName */\n showAlways?: boolean;\n /** To provide an option to hide the label in the variable value selector */\n hideLabel?: boolean;\n}\n\nexport function VariableValueSelectWrapper({ variable, layout, showAlways, hideLabel }: VariableSelectProps) {\n const state = useSceneObjectState<SceneVariableState>(variable, { shouldActivateOrKeepAlive: true });\n\n if (state.hide === VariableHide.hideVariable && !showAlways) {\n return null;\n }\n\n if (layout === 'vertical') {\n return (\n <div className={verticalContainer} data-testid={selectors.pages.Dashboard.SubMenu.submenuItem}>\n <VariableLabel variable={variable} layout={layout} hideLabel={hideLabel} />\n <variable.Component model={variable} />\n </div>\n );\n }\n\n return (\n <div className={containerStyle} data-testid={selectors.pages.Dashboard.SubMenu.submenuItem}>\n <VariableLabel variable={variable} hideLabel={hideLabel} />\n <variable.Component model={variable} />\n </div>\n );\n}\n\nfunction VariableLabel({ variable, layout, hideLabel }: VariableSelectProps) {\n const { state } = variable;\n\n if (variable.state.hide === VariableHide.hideLabel || hideLabel) {\n return null;\n }\n\n const elementId = `var-${state.key}`;\n const labelOrName = state.label ?? state.name;\n\n return (\n <ControlsLabel\n htmlFor={elementId}\n isLoading={state.loading}\n onCancel={() => variable.onCancel?.()}\n label={labelOrName}\n error={state.error}\n layout={layout}\n description={state.description ?? undefined}\n />\n );\n}\n\nconst containerStyle = css({ display: 'flex' });\nconst verticalContainer = css({ display: 'flex', flexDirection: 'column' });\n","import React from 'react';\n\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { ControlsLayout, SceneComponentProps, SceneObjectState } from '../../core/types';\nimport { VariableValueSelectWrapper } from './VariableValueSelectors';\n\nexport interface VariableValueControlState extends SceneObjectState {\n layout?: ControlsLayout;\n /** Render the specific select control for a variable */\n variableName: string;\n /** Hide the label in the variable value controller */\n hideLabel?: boolean;\n}\n\nexport class VariableValueControl extends SceneObjectBase<VariableValueControlState> {\n public static Component = VariableValueControlRenderer;\n}\n\nfunction VariableValueControlRenderer({ model }: SceneComponentProps<VariableValueControl>) {\n const variable = sceneGraph.lookupVariable(model.state.variableName, model);\n if (!variable) {\n return null;\n }\n\n return (\n <VariableValueSelectWrapper\n key={variable.state.key}\n variable={variable}\n layout={model.state.layout}\n showAlways={true}\n />\n );\n}\n","import { VariableRefresh } from '@grafana/data';\nimport { Unsubscribable } from 'rxjs';\nimport { sceneGraph } from '../../core/sceneGraph';\n\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneObject } from '../../core/types';\nimport { writeSceneLog } from '../../utils/writeSceneLog';\nimport {\n SceneVariable,\n SceneVariableDependencyConfigLike,\n SceneVariables,\n SceneVariableSetState,\n SceneVariableValueChangedEvent,\n} from '../types';\nimport { VariableValueRecorder } from '../VariableValueRecorder';\n\nexport class SceneVariableSet extends SceneObjectBase<SceneVariableSetState> implements SceneVariables {\n /** Variables that have changed in since the activation or since the first manual value change */\n private _variablesThatHaveChanged = new Set<SceneVariable>();\n\n /** Variables that are scheduled to be validated and updated */\n private _variablesToUpdate = new Set<SceneVariable>();\n\n /** Variables currently updating */\n private _updating = new Map<SceneVariable, VariableUpdateInProgress>();\n\n private _variableValueRecorder = new VariableValueRecorder();\n\n /**\n * This makes sure SceneVariableSet's higher up in the chain notify us when parent level variables complete update batches.\n **/\n protected _variableDependency = new SceneVariableSetVariableDependencyHandler(\n this._handleParentVariableUpdatesCompleted.bind(this)\n );\n\n public getByName(name: string): SceneVariable | undefined {\n // TODO: Replace with index\n return this.state.variables.find((x) => x.state.name === name);\n }\n\n public constructor(state: SceneVariableSetState) {\n super(state);\n\n this.addActivationHandler(this._onActivate);\n }\n\n /**\n * Subscribes to child variable value changes, and starts the variable value validation process\n */\n private _onActivate = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n // Subscribe to changes to child variables\n this._subs.add(\n this.subscribeToEvent(SceneVariableValueChangedEvent, (event) => this._handleVariableValueChanged(event.payload))\n );\n\n this._subs.add(\n timeRange.subscribeToState(() => {\n this._refreshTimeRangeBasedVariables();\n })\n );\n\n // Subscribe to state changes\n this._subs.add(this.subscribeToState(this._onStateChanged));\n\n this._checkForVariablesThatChangedWhileInactive();\n\n // Add all variables that need updating to queue\n for (const variable of this.state.variables) {\n if (this._variableNeedsUpdate(variable)) {\n this._variablesToUpdate.add(variable);\n }\n }\n\n this._updateNextBatch();\n\n // Return deactivation handler;\n return this._onDeactivate;\n };\n\n /**\n * Add all variables that depend on the changed variable to the update queue\n */\n private _refreshTimeRangeBasedVariables() {\n for (const variable of this.state.variables) {\n if ('refresh' in variable.state && variable.state.refresh === VariableRefresh.onTimeRangeChanged) {\n this._variablesToUpdate.add(variable);\n }\n }\n\n this._updateNextBatch();\n }\n\n /**\n * Cancel all currently running updates\n */\n private _onDeactivate = () => {\n for (const update of this._updating.values()) {\n update.subscription?.unsubscribe();\n }\n\n // Remember current variable values\n for (const variable of this.state.variables) {\n // if the current variable is not in queue to update and validate and not being actively updated then the value is ok\n if (!this._variablesToUpdate.has(variable) && !this._updating.has(variable)) {\n this._variableValueRecorder.recordCurrentValue(variable);\n }\n }\n\n this._variablesToUpdate.clear();\n this._updating.clear();\n };\n\n /**\n * Look for new variables that need to be initialized\n */\n private _onStateChanged = (newState: SceneVariableSetState, oldState: SceneVariableSetState) => {\n const variablesToUpdateCountStart = this._variablesToUpdate.size;\n\n // Check for removed variables\n for (const variable of oldState.variables) {\n if (!newState.variables.includes(variable)) {\n const updating = this._updating.get(variable);\n if (updating?.subscription) {\n updating.subscription.unsubscribe();\n }\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n }\n }\n\n // Check for new variables\n for (const variable of newState.variables) {\n if (!oldState.variables.includes(variable)) {\n if (this._variableNeedsUpdate(variable)) {\n this._variablesToUpdate.add(variable);\n }\n }\n }\n\n // Only start a new batch if there was no batch already running\n if (variablesToUpdateCountStart === 0 && this._variablesToUpdate.size > 0) {\n this._updateNextBatch();\n }\n };\n\n /**\n * If variables changed while in in-active state we don't get any change events, so we need to check for that here.\n */\n private _checkForVariablesThatChangedWhileInactive() {\n if (!this._variableValueRecorder.hasValues()) {\n return;\n }\n\n for (const variable of this.state.variables) {\n if (this._variableValueRecorder.hasValueChanged(variable)) {\n writeVariableTraceLog(variable, 'Changed while in-active');\n this._addDependentVariablesToUpdateQueue(variable);\n }\n }\n }\n\n private _variableNeedsUpdate(variable: SceneVariable): boolean {\n if (variable.isLazy) {\n return false;\n }\n\n if (!variable.validateAndUpdate) {\n return false;\n }\n\n // If we have recorded valid value (even if it has changed since we do not need to re-validate this variable)\n if (this._variableValueRecorder.hasRecordedValue(variable)) {\n writeVariableTraceLog(variable, 'Skipping updateAndValidate current value valid');\n return false;\n }\n\n return true;\n }\n\n /**\n * This loops through variablesToUpdate and update all that can.\n * If one has a dependency that is currently in variablesToUpdate it will be skipped for now.\n */\n private _updateNextBatch() {\n for (const variable of this._variablesToUpdate) {\n if (!variable.validateAndUpdate) {\n throw new Error('Variable added to variablesToUpdate but does not have validateAndUpdate');\n }\n\n // Ignore it if it's already started\n if (this._updating.has(variable)) {\n continue;\n }\n\n // Wait for variables that has dependencies that also needs updates\n if (sceneGraph.hasVariableDependencyInLoadingState(variable)) {\n continue;\n }\n\n const variableToUpdate: VariableUpdateInProgress = {\n variable,\n };\n\n this._updating.set(variable, variableToUpdate);\n writeVariableTraceLog(variable, 'updateAndValidate started');\n\n variableToUpdate.subscription = variable.validateAndUpdate().subscribe({\n next: () => this._validateAndUpdateCompleted(variable),\n complete: () => this._validateAndUpdateCompleted(variable),\n error: (err) => this._handleVariableError(variable, err),\n });\n }\n }\n\n /**\n * A variable has completed its update process. This could mean that variables that depend on it can now be updated in turn.\n */\n private _validateAndUpdateCompleted(variable: SceneVariable) {\n if (!this._updating.has(variable)) {\n return;\n }\n\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n\n writeVariableTraceLog(variable, 'updateAndValidate completed');\n\n this._notifyDependentSceneObjects(variable);\n this._updateNextBatch();\n }\n\n public cancel(variable: SceneVariable) {\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n }\n\n private _handleVariableError(variable: SceneVariable, err: Error) {\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n\n variable.setState({ loading: false, error: err.message });\n\n console.error('SceneVariableSet updateAndValidate error', err);\n\n writeVariableTraceLog(variable, 'updateAndValidate error', err);\n\n this._notifyDependentSceneObjects(variable);\n this._updateNextBatch();\n }\n\n private _handleVariableValueChanged(variableThatChanged: SceneVariable) {\n this._variablesThatHaveChanged.add(variableThatChanged);\n this._addDependentVariablesToUpdateQueue(variableThatChanged);\n\n // Ignore this change if it is currently updating\n if (!this._updating.has(variableThatChanged)) {\n this._updateNextBatch();\n this._notifyDependentSceneObjects(variableThatChanged);\n }\n }\n\n /**\n * This is called by any parent level variable set to notify scene that an update batch is completed.\n * This is the main mechanism lower level variable set's react to changes on higher levels.\n */\n private _handleParentVariableUpdatesCompleted(variable: SceneVariable, hasChanged: boolean) {\n // First loop through changed variables and add any of our variables that depend on the higher level variable to the update queue\n if (hasChanged) {\n this._addDependentVariablesToUpdateQueue(variable);\n }\n\n // If we have variables to update but none are currently updating kick of a new update batch\n if (this._variablesToUpdate.size > 0 && this._updating.size === 0) {\n this._updateNextBatch();\n }\n }\n\n private _addDependentVariablesToUpdateQueue(variableThatChanged: SceneVariable) {\n for (const otherVariable of this.state.variables) {\n if (otherVariable.variableDependency) {\n if (otherVariable.variableDependency.hasDependencyOn(variableThatChanged.state.name)) {\n writeVariableTraceLog(otherVariable, 'Added to update queue, dependant variable value changed');\n\n if (this._updating.has(otherVariable) && otherVariable.onCancel) {\n otherVariable.onCancel();\n }\n\n this._variablesToUpdate.add(otherVariable);\n }\n }\n }\n }\n\n /**\n * Walk scene object graph and update all objects that depend on variables that have changed\n */\n private _notifyDependentSceneObjects(variable: SceneVariable) {\n if (!this.parent) {\n return;\n }\n\n this._traverseSceneAndNotify(this.parent, variable, this._variablesThatHaveChanged.has(variable));\n this._variablesThatHaveChanged.delete(variable);\n }\n\n /**\n * Recursivly walk the full scene object graph and notify all objects with dependencies that include any of changed variables\n */\n private _traverseSceneAndNotify(sceneObject: SceneObject, variable: SceneVariable, hasChanged: boolean) {\n // No need to notify variables under this SceneVariableSet\n if (this === sceneObject) {\n return;\n }\n\n // Skip non active scene objects\n if (!sceneObject.isActive) {\n return;\n }\n\n // If we find a nested SceneVariableSet that has a variable with the same name we stop the traversal\n if (sceneObject.state.$variables && sceneObject.state.$variables !== this) {\n const localVar = sceneObject.state.$variables.getByName(variable.state.name);\n if (localVar) {\n return;\n }\n }\n\n if (sceneObject.variableDependency) {\n sceneObject.variableDependency.variableUpdateCompleted(variable, hasChanged);\n }\n\n sceneObject.forEachChild((child) => this._traverseSceneAndNotify(child, variable, hasChanged));\n }\n\n /**\n * Return true if variable is waiting to update or currently updating.\n * It also returns true if a dependency of the variable is loading.\n *\n * For example if C depends on variable B which depends on variable A and A is loading this returns true for variable C and B.\n */\n public isVariableLoadingOrWaitingToUpdate(variable: SceneVariable) {\n if (variable.isAncestorLoading && variable.isAncestorLoading()) {\n return true;\n }\n\n if (this._variablesToUpdate.has(variable) || this._updating.has(variable)) {\n return true;\n }\n\n // Last scenario is to check the variable's own dependencies as well\n return sceneGraph.hasVariableDependencyInLoadingState(variable);\n }\n}\n\nexport interface VariableUpdateInProgress {\n variable: SceneVariable;\n subscription?: Unsubscribable;\n}\n\nfunction writeVariableTraceLog(variable: SceneVariable, message: string, err?: Error) {\n if (err) {\n writeSceneLog('SceneVariableSet', `Variable[${variable.state.name}]: ${message}`, err);\n } else {\n writeSceneLog('SceneVariableSet', `Variable[${variable.state.name}]: ${message}`);\n }\n}\n\nclass SceneVariableSetVariableDependencyHandler implements SceneVariableDependencyConfigLike {\n public constructor(private _variableUpdatesCompleted: (variable: SceneVariable, hasChanged: boolean) => void) {}\n\n private _emptySet = new Set<string>();\n\n public getNames(): Set<string> {\n return this._emptySet;\n }\n\n public hasDependencyOn(name: string): boolean {\n return false;\n }\n\n public variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void {\n this._variableUpdatesCompleted(variable, hasChanged);\n }\n}\n","import { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneVariable, SceneVariableState, VariableValue } from '../types';\n\nexport interface ConstantVariableState extends SceneVariableState {\n value: VariableValue;\n}\n\nexport class ConstantVariable\n extends SceneObjectBase<ConstantVariableState>\n implements SceneVariable<ConstantVariableState>\n{\n public constructor(initialState: Partial<ConstantVariableState>) {\n super({\n type: 'constant',\n value: '',\n name: '',\n ...initialState,\n skipUrlSync: true,\n });\n }\n\n public getValue(): VariableValue {\n return this.state.value;\n }\n}\n","import { Observable, of } from 'rxjs';\n\nimport { SceneComponentProps } from '../../core/types';\nimport { VariableDependencyConfig } from '../VariableDependencyConfig';\nimport { renderSelectForVariable } from '../components/VariableValueSelect';\nimport { VariableValueOption } from '../types';\n\nimport { MultiValueVariable, MultiValueVariableState, VariableGetOptionsArgs } from './MultiValueVariable';\nimport { sceneGraph } from '../../core/sceneGraph';\n\nexport interface CustomVariableState extends MultiValueVariableState {\n query: string;\n}\n\nexport class CustomVariable extends MultiValueVariable<CustomVariableState> {\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['query'],\n });\n\n public constructor(initialState: Partial<CustomVariableState>) {\n super({\n type: 'custom',\n query: '',\n value: '',\n text: '',\n options: [],\n name: '',\n ...initialState,\n });\n }\n\n public getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]> {\n const interpolated = sceneGraph.interpolate(this, this.state.query);\n const match = interpolated.match(/(?:\\\\,|[^,])+/g) ?? [];\n\n const options = match.map((text) => {\n text = text.replace(/\\\\,/g, ',');\n const textMatch = /^(.+)\\s:\\s(.+)$/g.exec(text) ?? [];\n if (textMatch.length === 3) {\n const [, key, value] = textMatch;\n return { label: key.trim(), value: value.trim() };\n } else {\n return { label: text.trim(), value: text.trim() };\n }\n });\n\n return of(options);\n }\n\n public static Component = ({ model }: SceneComponentProps<MultiValueVariable>) => {\n return renderSelectForVariable(model);\n };\n}\n","import { Observable, of } from 'rxjs';\n\nimport { stringToJsRegex, DataSourceInstanceSettings } from '@grafana/data';\nimport { getDataSourceSrv } from '@grafana/runtime';\n\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneComponentProps } from '../../core/types';\nimport { VariableDependencyConfig } from '../VariableDependencyConfig';\nimport { renderSelectForVariable } from '../components/VariableValueSelect';\nimport { VariableValueOption } from '../types';\n\nimport { MultiValueVariable, MultiValueVariableState, VariableGetOptionsArgs } from './MultiValueVariable';\n\nexport interface DataSourceVariableState extends MultiValueVariableState {\n /**\n * Include all data source instances with this plugin id\n */\n pluginId: string;\n /**\n * Filter data source instances based on name\n */\n regex: string;\n /**\n * For backwards compatability with old dashboards, will likely be removed\n */\n defaultOptionEnabled?: boolean;\n}\n\nexport class DataSourceVariable extends MultiValueVariable<DataSourceVariableState> {\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['regex'],\n });\n\n public constructor(initialState: Partial<DataSourceVariableState>) {\n super({\n type: 'datasource',\n value: '',\n text: '',\n options: [],\n name: '',\n regex: '',\n pluginId: '',\n ...initialState,\n });\n }\n\n public getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]> {\n if (!this.state.pluginId) {\n return of([]);\n }\n\n const dataSources = getDataSourceSrv().getList({ metrics: true, variables: false, pluginId: this.state.pluginId });\n\n let regex;\n if (this.state.regex) {\n const interpolated = sceneGraph.interpolate(this, this.state.regex, undefined, 'regex');\n regex = stringToJsRegex(interpolated);\n }\n\n const options: VariableValueOption[] = [];\n\n for (let i = 0; i < dataSources.length; i++) {\n const source = dataSources[i];\n\n if (isValid(source, regex)) {\n options.push({ label: source.name, value: source.uid });\n }\n\n if (this.state.defaultOptionEnabled && isDefault(source, regex)) {\n options.push({ label: 'default', value: 'default' });\n }\n }\n\n if (options.length === 0) {\n this.setState({ error: 'No data sources found' });\n } else if (this.state.error) {\n this.setState({ error: null });\n }\n\n return of(options);\n }\n\n public static Component = ({ model }: SceneComponentProps<MultiValueVariable>) => {\n return renderSelectForVariable(model);\n };\n}\n\nfunction isValid(source: DataSourceInstanceSettings, regex?: RegExp) {\n if (!regex) {\n return true;\n }\n\n return regex.exec(source.name);\n}\n\nfunction isDefault(source: DataSourceInstanceSettings, regex?: RegExp) {\n if (!source.isDefault) {\n return false;\n }\n\n if (!regex) {\n return true;\n }\n\n return regex.exec('default');\n}\n","export interface TreeNode {\n name: string;\n children: TreeNode[];\n}\n\n/*\n * Builds a nested tree like\n * [\n * {\n * name: 'A',\n * children: [\n * { name: 'AA', children: [] },\n * { name: 'AB', children: [] },\n * ]\n * }\n * ]\n */\nfunction buildMetricTree(parent: string, depth: number): TreeNode[] {\n const chars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];\n const children: TreeNode[] = [];\n\n if (depth > 5) {\n return [];\n }\n\n for (const letter of chars) {\n const nodeName = `${parent}${letter}`;\n children.push({\n name: nodeName,\n children: buildMetricTree(nodeName, depth + 1),\n });\n }\n\n return children;\n}\n\nfunction queryTree(children: TreeNode[], query: string[], queryIndex: number): TreeNode[] {\n if (queryIndex >= query.length) {\n return children;\n }\n\n if (query[queryIndex] === '*') {\n return children;\n }\n\n const nodeQuery = query[queryIndex];\n let result: TreeNode[] = [];\n let namesToMatch = [nodeQuery];\n\n // handle glob queries\n if (nodeQuery.startsWith('{')) {\n namesToMatch = nodeQuery.replace(/\\{|\\}/g, '').split(',');\n }\n\n for (const node of children) {\n for (const nameToMatch of namesToMatch) {\n if (nameToMatch.indexOf('*') !== -1) {\n const pattern = nameToMatch.replace('*', '');\n const regex = new RegExp(`^${pattern}.*`, 'gi');\n if (regex.test(node.name)) {\n result = result.concat(queryTree([node], query, queryIndex + 1));\n }\n } else if (node.name === nameToMatch) {\n result = result.concat(queryTree(node.children, query, queryIndex + 1));\n }\n }\n }\n\n return result;\n}\n\nexport function queryMetricTree(query: string): TreeNode[] {\n if (query.indexOf('value') === 0) {\n return [{ name: query, children: [] }];\n }\n\n const children = buildMetricTree('', 0);\n return queryTree(children, query.split('.'), 0);\n}\n","import { Observable, Subject } from 'rxjs';\n\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneComponentProps } from '../../core/types';\nimport { queryMetricTree } from '../../utils/metricTree';\nimport { VariableDependencyConfig } from '../VariableDependencyConfig';\nimport { renderSelectForVariable } from '../components/VariableValueSelect';\nimport { VariableValueOption } from '../types';\n\nimport { MultiValueVariable, MultiValueVariableState, VariableGetOptionsArgs } from './MultiValueVariable';\nimport { VariableRefresh } from '@grafana/data';\nimport { getClosest } from '../../core/sceneGraph/utils';\nimport { SceneVariableSet } from '../sets/SceneVariableSet';\nimport { SceneQueryControllerEntry } from '../../behaviors/SceneQueryController';\n\nexport interface TestVariableState extends MultiValueVariableState {\n query: string;\n delayMs?: number;\n issuedQuery?: string;\n refresh?: VariableRefresh;\n throwError?: string;\n optionsToReturn?: VariableValueOption[];\n}\n\n/**\n * This variable is only designed for unit tests and potentially e2e tests.\n */\nexport class TestVariable extends MultiValueVariable<TestVariableState> {\n private completeUpdate = new Subject<number>();\n public isGettingValues = true;\n public getValueOptionsCount = 0;\n isLazy = false;\n\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['query'],\n });\n\n public constructor(initialState: Partial<TestVariableState>, isLazy = false) {\n super({\n type: 'custom',\n name: 'Test',\n value: 'Value',\n text: 'Text',\n query: 'Query',\n options: [],\n refresh: VariableRefresh.onDashboardLoad,\n ...initialState,\n });\n this.isLazy = isLazy;\n }\n\n public getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]> {\n const { delayMs } = this.state;\n\n this.getValueOptionsCount += 1;\n\n const queryController = sceneGraph.getQueryController(this);\n\n return new Observable<VariableValueOption[]>((observer) => {\n const queryEntry: SceneQueryControllerEntry = {\n type: 'variable',\n origin: this,\n cancel: () => observer.complete(),\n };\n\n if (queryController) {\n queryController.queryStarted(queryEntry);\n }\n\n this.setState({ loading: true });\n\n if (this.state.throwError) {\n throw new Error(this.state.throwError);\n }\n\n const interpolatedQuery = sceneGraph.interpolate(this, this.state.query);\n const options = this.getOptions(interpolatedQuery);\n\n const sub = this.completeUpdate.subscribe({\n next: () => {\n this.setState({ issuedQuery: interpolatedQuery, options, loading: false });\n observer.next(options);\n observer.complete();\n },\n });\n\n let timeout: number | undefined;\n if (delayMs) {\n timeout = window.setTimeout(() => this.signalUpdateCompleted(), delayMs);\n } else if (delayMs === 0) {\n this.signalUpdateCompleted();\n }\n\n this.isGettingValues = true;\n\n return () => {\n sub.unsubscribe();\n window.clearTimeout(timeout);\n this.isGettingValues = false;\n\n if (this.state.loading) {\n this.setState({ loading: false });\n }\n\n if (queryController) {\n queryController.queryCompleted(queryEntry);\n }\n };\n });\n }\n\n public cancel() {\n const sceneVarSet = getClosest(this, (s) => (s instanceof SceneVariableSet ? s : undefined));\n sceneVarSet?.cancel(this);\n }\n\n private getOptions(interpolatedQuery: string) {\n if (this.state.optionsToReturn) {\n return this.state.optionsToReturn;\n }\n\n return queryMetricTree(interpolatedQuery).map((x) => ({ label: x.name, value: x.name }));\n }\n\n /** Useful from tests */\n public signalUpdateCompleted() {\n this.completeUpdate.next(1);\n }\n\n public static Component = ({ model }: SceneComponentProps<MultiValueVariable>) => {\n return renderSelectForVariable(model);\n };\n}\n","import React, { useCallback } from 'react';\n\nimport { AutoSizeInput } from '@grafana/ui';\n\nimport { SceneComponentProps } from '../../core/types';\nimport { TextBoxVariable } from '../variants/TextBoxVariable';\n\nexport function VariableValueInput({ model }: SceneComponentProps<TextBoxVariable>) {\n const { value, key, loading } = model.useState();\n\n const onBlur = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n model.setValue(e.currentTarget.value);\n },\n [model]\n );\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n model.setValue(e.currentTarget.value);\n }\n },\n [model]\n );\n\n return (\n <AutoSizeInput\n id={key}\n placeholder=\"Enter value\"\n minWidth={15}\n defaultValue={value}\n loading={loading}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n />\n );\n}\n","import React from 'react';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectUrlValues } from '../../core/types';\nimport { SceneObjectUrlSyncConfig } from '../../services/SceneObjectUrlSyncConfig';\nimport { VariableValueInput } from '../components/VariableValueInput';\nimport { SceneVariable, SceneVariableState, SceneVariableValueChangedEvent, VariableValue } from '../types';\n\nexport interface TextBoxVariableState extends SceneVariableState {\n value: string;\n}\n\nexport class TextBoxVariable\n extends SceneObjectBase<TextBoxVariableState>\n implements SceneVariable<TextBoxVariableState>\n{\n public constructor(initialState: Partial<TextBoxVariableState>) {\n super({\n type: 'textbox',\n value: '',\n name: '',\n ...initialState,\n });\n\n this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: () => [this.getKey()] });\n }\n\n public getValue(): VariableValue {\n return this.state.value;\n }\n\n public setValue(newValue: string) {\n if (newValue !== this.state.value) {\n this.setState({ value: newValue });\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n }\n }\n\n private getKey(): string {\n return `var-${this.state.name}`;\n }\n\n public getUrlState() {\n return { [this.getKey()]: this.state.value };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n const update: Partial<TextBoxVariableState> = {};\n const val = values[this.getKey()];\n if (typeof val === 'string') {\n update.value = val;\n }\n\n this.setState(update);\n }\n\n public static Component = ({ model }: SceneComponentProps<TextBoxVariable>) => {\n return <VariableValueInput model={model} />;\n };\n}\n","import { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneVariable, SceneVariableState, VariableValue } from '../types';\n\nexport interface LocalValueVariableState extends SceneVariableState {\n value: VariableValue;\n text: VariableValue;\n\n // Indicate whether or not this variable is sourced from a multi-value variable.\n // Introduces for a backwards compatibility with the old variable system, to properly support interpolation in SQL data sources.\n isMulti?: boolean;\n includeAll?: boolean;\n}\n\n/**\n * This is a special type of variable that is used for repeating panels and layouts to create a local scoped value for a variable\n * that exists in a ancestor SceneVariableSet.\n */\nexport class LocalValueVariable\n extends SceneObjectBase<LocalValueVariableState>\n implements SceneVariable<LocalValueVariableState>\n{\n public constructor(initialState: Omit<Partial<LocalValueVariableState>, 'isMulti' | 'includeAll'>) {\n super({\n type: 'system',\n value: '',\n text: '',\n name: '',\n isMulti: true,\n includeAll: true,\n ...initialState,\n skipUrlSync: true,\n });\n }\n\n public getValue(): VariableValue {\n return this.state.value;\n }\n\n public getValueText(): string {\n return this.state.text.toString();\n }\n\n /**\n * Checks the ancestor of our parent SceneVariableSet for loading state of a variable with the same name\n * This function is unit tested from SceneVariableSet tests.\n */\n public isAncestorLoading(): boolean {\n // Parent (SceneVariableSet) -> Parent (The object that has our parent set) -> Parent (scope we need to access our sets ancestor)\n const ancestorScope = this.parent?.parent?.parent;\n if (!ancestorScope) {\n throw new Error('LocalValueVariable requires a parent SceneVariableSet that has an ancestor SceneVariableSet');\n }\n\n const set = sceneGraph.getVariables(ancestorScope);\n const parentVar = sceneGraph.lookupVariable(this.state.name, ancestorScope);\n if (set && parentVar) {\n return set.isVariableLoadingOrWaitingToUpdate(parentVar);\n }\n\n return false;\n }\n}\n","import { rangeUtil, SelectableValue } from '@grafana/data';\nimport { VariableRefresh } from '@grafana/schema';\nimport { Select } from '@grafana/ui';\nimport React from 'react';\nimport { Observable, of } from 'rxjs';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectUrlValues } from '../../core/types';\nimport { SceneObjectUrlSyncConfig } from '../../services/SceneObjectUrlSyncConfig';\nimport { AUTO_VARIABLE_TEXT, AUTO_VARIABLE_VALUE } from '../constants';\nimport {\n SceneVariable,\n SceneVariableState,\n SceneVariableValueChangedEvent,\n ValidateAndUpdateResult,\n VariableValue,\n} from '../types';\n\nexport interface IntervalVariableState extends SceneVariableState {\n intervals: string[];\n value: string;\n autoEnabled: boolean;\n autoMinInterval: string;\n autoStepCount: number;\n refresh: VariableRefresh;\n}\n\nexport class IntervalVariable\n extends SceneObjectBase<IntervalVariableState>\n implements SceneVariable<IntervalVariableState>\n{\n public constructor(initialState: Partial<IntervalVariableState>) {\n super({\n type: 'interval',\n value: '',\n intervals: ['1m', '10m', '30m', '1h', '6h', '12h', '1d', '7d', '14d', '30d'],\n name: '',\n autoStepCount: 30,\n autoMinInterval: '10s',\n autoEnabled: false,\n refresh: VariableRefresh.onTimeRangeChanged,\n ...initialState,\n });\n\n this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: () => [this.getKey()] });\n }\n\n private getKey(): string {\n return `var-${this.state.name}`;\n }\n\n public getUrlState() {\n return { [this.getKey()]: this.state.value };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n const update: Partial<IntervalVariableState> = {};\n const val = values[this.getKey()];\n if (typeof val === 'string') {\n // support old auto interval url value\n if (val.startsWith('$__auto_interval_')) {\n update.value = AUTO_VARIABLE_VALUE;\n } else {\n update.value = val;\n }\n }\n this.setState(update);\n }\n\n public getOptionsForSelect(): Array<SelectableValue<string>> {\n const { value: currentValue, intervals, autoEnabled } = this.state;\n\n let options = intervals.map((interval) => ({ value: interval, label: interval }));\n\n if (autoEnabled) {\n options = [{ value: AUTO_VARIABLE_VALUE, label: AUTO_VARIABLE_TEXT }, ...options];\n }\n\n // If the current value is not in the list of intervals, add it to the list\n if (currentValue && !options.some((option) => option.value === currentValue)) {\n options.push({ value: currentValue, label: currentValue });\n }\n\n return options;\n }\n\n public getValue(): VariableValue {\n const { value, autoStepCount, autoMinInterval } = this.state;\n if (value === AUTO_VARIABLE_VALUE) {\n return this.getAutoRefreshInteval(autoStepCount, autoMinInterval);\n }\n\n return value;\n }\n\n private getAutoRefreshInteval(autoStepCount: number, minRefreshInterval: string) {\n const timeRange = sceneGraph.getTimeRange(this).state.value;\n const intervalObject = rangeUtil.calculateInterval(timeRange, autoStepCount, minRefreshInterval);\n return intervalObject.interval;\n }\n\n public _onChange = (value: SelectableValue<string>) => {\n this.setState({ value: value.value! });\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n };\n\n public validateAndUpdate(): Observable<ValidateAndUpdateResult> {\n const { value, intervals } = this.state;\n let shouldPublish = false;\n\n if (value === AUTO_VARIABLE_VALUE) {\n shouldPublish = true;\n } else if (!value && intervals.length > 0) {\n const firstOption = intervals[0];\n this.setState({ value: firstOption });\n shouldPublish = true;\n }\n\n if (shouldPublish) {\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n }\n\n return of({});\n }\n\n public static Component = ({ model }: SceneComponentProps<IntervalVariable>) => {\n const { key, value } = model.useState();\n return (\n <Select\n id={key}\n placeholder=\"Select value\"\n width=\"auto\"\n value={value}\n tabSelectsValue={false}\n options={model.getOptionsForSelect()}\n onChange={model._onChange}\n />\n );\n };\n}\n","import { Location } from 'history';\n\nimport { locationService } from '@grafana/runtime';\n\nimport { SceneObjectStateChangedEvent } from '../core/events';\nimport { SceneObject, SceneObjectUrlValues } from '../core/types';\nimport { writeSceneLog } from '../utils/writeSceneLog';\nimport { Unsubscribable } from 'rxjs';\nimport { UniqueUrlKeyMapper } from './UniqueUrlKeyMapper';\nimport { getUrlState, isUrlValueEqual, syncStateFromUrl } from './utils';\n\nexport interface UrlSyncManagerLike {\n initSync(root: SceneObject): void;\n cleanUp(root: SceneObject): void;\n getUrlState(root: SceneObject): SceneObjectUrlValues;\n handleNewLocation(location: Location): void;\n handleNewObject(sceneObj: SceneObject): void;\n}\n\nexport class UrlSyncManager implements UrlSyncManagerLike {\n private _urlKeyMapper = new UniqueUrlKeyMapper();\n private _sceneRoot?: SceneObject;\n private _stateSub: Unsubscribable | null = null;\n private _lastLocation: Location | undefined;\n private _paramsCache = new UrlParamsCache();\n\n /**\n * Updates the current scene state to match URL state.\n */\n public initSync(root: SceneObject) {\n if (this._stateSub) {\n writeSceneLog('UrlSyncManager', 'Unregister previous scene state subscription', this._sceneRoot?.state.key);\n this._stateSub.unsubscribe();\n }\n\n writeSceneLog('UrlSyncManager', 'init', root.state.key);\n\n this._sceneRoot = root;\n this._stateSub = root.subscribeToEvent(SceneObjectStateChangedEvent, this.#onStateChanged);\n\n this._urlKeyMapper.clear();\n this._lastLocation = locationService.getLocation();\n\n this.handleNewObject(this._sceneRoot);\n }\n\n public cleanUp(root: SceneObject) {\n // Ignore this if we have a new or different root\n if (this._sceneRoot !== root) {\n return;\n }\n\n writeSceneLog('UrlSyncManager', 'Clean up');\n\n if (this._stateSub) {\n this._stateSub.unsubscribe();\n this._stateSub = null;\n writeSceneLog(\n 'UrlSyncManager',\n 'Root deactived, unsub to state',\n 'same key',\n this._sceneRoot.state.key === root.state.key\n );\n }\n\n this._sceneRoot = undefined;\n this._lastLocation = undefined;\n }\n\n public handleNewLocation(location: Location) {\n if (!this._sceneRoot || this._lastLocation === location) {\n return;\n }\n\n writeSceneLog('UrlSyncManager', 'handleNewLocation');\n\n this._lastLocation = location;\n\n // Sync scene state tree from url\n syncStateFromUrl(this._sceneRoot!, this._paramsCache.getParams(), this._urlKeyMapper);\n }\n\n public handleNewObject(sceneObj: SceneObject) {\n if (!this._sceneRoot) {\n return;\n }\n\n syncStateFromUrl(sceneObj, this._paramsCache.getParams(), this._urlKeyMapper);\n }\n\n #onStateChanged = ({ payload }: SceneObjectStateChangedEvent) => {\n const changedObject = payload.changedObject;\n\n if (changedObject.urlSync) {\n const newUrlState = changedObject.urlSync.getUrlState();\n\n const searchParams = locationService.getSearch();\n const mappedUpdated: SceneObjectUrlValues = {};\n\n for (const [key, newUrlValue] of Object.entries(newUrlState)) {\n const uniqueKey = this._urlKeyMapper.getUniqueKey(key, changedObject);\n const currentUrlValue = searchParams.getAll(uniqueKey);\n\n if (!isUrlValueEqual(currentUrlValue, newUrlValue)) {\n mappedUpdated[uniqueKey] = newUrlValue;\n }\n }\n\n if (Object.keys(mappedUpdated).length > 0) {\n writeSceneLog('UrlSyncManager', 'onStateChange updating URL');\n locationService.partial(mappedUpdated, true);\n\n /// Mark the location already handled\n this._lastLocation = locationService.getLocation();\n }\n }\n };\n\n public getUrlState(root: SceneObject): SceneObjectUrlValues {\n return getUrlState(root);\n }\n}\n\nclass UrlParamsCache {\n #cache: URLSearchParams | undefined;\n #location: Location | undefined;\n\n public getParams(): URLSearchParams {\n const location = locationService.getLocation();\n\n if (this.#location === location) {\n return this.#cache!;\n }\n\n this.#location = location;\n this.#cache = new URLSearchParams(location.search);\n\n return this.#cache;\n }\n}\n\nlet urlSyncManager: UrlSyncManagerLike | undefined;\n\nexport function getUrlSyncManager(): UrlSyncManagerLike {\n if (!urlSyncManager) {\n urlSyncManager = new UrlSyncManager();\n }\n\n return urlSyncManager;\n}\n","import { SceneObject } from '../core/types';\nimport { useEffect, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { getUrlSyncManager } from './UrlSyncManager';\nimport { locationService } from '@grafana/runtime';\nimport { writeSceneLog } from '../utils/writeSceneLog';\n\nexport function useUrlSync(sceneRoot: SceneObject): boolean {\n const urlSyncManager = getUrlSyncManager();\n const location = useLocation();\n const [isInitialized, setIsInitialized] = useState(false);\n\n useEffect(() => {\n urlSyncManager.initSync(sceneRoot);\n setIsInitialized(true);\n return () => urlSyncManager.cleanUp(sceneRoot);\n }, [sceneRoot, urlSyncManager]);\n\n useEffect(() => {\n // Use latest location, as by the time this effect runs, the location might have changed again\n const latestLocation = locationService.getLocation();\n const locationToHandle = latestLocation !== location ? latestLocation : location;\n\n if (latestLocation !== location) {\n writeSceneLog('useUrlSync', 'latestLocation different from location')\n }\n\n urlSyncManager.handleNewLocation(locationToHandle);\n }, [sceneRoot, urlSyncManager, location]);\n\n return isInitialized;\n}\n\nexport interface UrlSyncContextProviderProps {\n scene: SceneObject;\n children: React.ReactNode;\n}\n","import { SceneObject } from '../core/types';\nimport { useUrlSync } from './useUrlSync';\n\nexport interface UrlSyncContextProviderProps {\n scene: SceneObject;\n children: React.ReactNode;\n}\n\n/**\n * Right now this is actually not defining a context, but think it might in the future (with UrlSyncManager as the context value)\n */\n\nexport function UrlSyncContextProvider({ children, scene }: UrlSyncContextProviderProps) {\n const isInitialized = useUrlSync(scene);\n\n if (!isInitialized) {\n return null;\n }\n\n return children;\n}\n","import { SceneObject } from '../../core/types';\nimport { writeSceneLog } from '../writeSceneLog';\n\n/**\n * Adds the scene object to the global window state so that templateSrv in core can interpolate strings using the scene interpolation engine with the scene as scope.\n * This is needed for old datasources that call templateSrv.replace without passing scopedVars. For example in DataSourceAPI.metricFindQuery.\n *\n * This is also used from TimeSrv to access scene time range.\n */\nexport function setWindowGrafanaSceneContext(activeScene: SceneObject) {\n const prevScene = (window as any).__grafanaSceneContext;\n\n writeSceneLog('setWindowGrafanaScene', 'set window.__grafanaSceneContext', activeScene);\n (window as any).__grafanaSceneContext = activeScene;\n\n return () => {\n if ((window as any).__grafanaSceneContext === activeScene) {\n writeSceneLog('setWindowGrafanaScene', 'restore window.__grafanaSceneContext', prevScene);\n (window as any).__grafanaSceneContext = prevScene;\n }\n };\n}\n","import { css } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\nimport React from 'react';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectState, SceneObject } from '../core/types';\nimport { setWindowGrafanaSceneContext } from '../utils/compatibility/setWindowGrafanaSceneContext';\n\nexport interface EmbeddedSceneState extends SceneObjectState {\n /**\n * The main content of the scene (usually a SceneFlexLayout)\n */\n body: SceneObject;\n /**\n * Top row of variable selectors, filters, time pickers and custom actions.\n */\n controls?: SceneObject[];\n /**\n * For interoperability (used from EmbeddedSceneWithContext)\n */\n context?: SceneObject;\n}\n\nexport class EmbeddedScene extends SceneObjectBase<EmbeddedSceneState> {\n public static Component = EmbeddedSceneRenderer;\n\n public constructor(state: EmbeddedSceneState) {\n super(state);\n\n this.addActivationHandler(() => {\n // This function is setting window.__grafanaSceneContext which is used from Grafana core in the old services TimeSrv and TemplateSrv.\n // This works as a backward compatability method to support accessing scene time range and variables from those old services.\n const unsetGlobalScene = setWindowGrafanaSceneContext(this);\n return () => {\n unsetGlobalScene();\n };\n });\n }\n}\n\nfunction EmbeddedSceneRenderer({ model }: SceneComponentProps<EmbeddedScene>) {\n const { body, controls } = model.useState();\n const styles = useStyles2(getStyles);\n\n return (\n <div className={styles.container}>\n {controls && (\n <div className={styles.controls}>\n {controls.map((control) => (\n <control.Component key={control.state.key} model={control} />\n ))}\n </div>\n )}\n <div className={styles.body}>\n <body.Component model={body} />\n </div>\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n container: css({\n flexGrow: 1,\n display: 'flex',\n gap: theme.spacing(2),\n minHeight: '100%',\n flexDirection: 'column',\n }),\n body: css({\n flexGrow: 1,\n display: 'flex',\n gap: theme.spacing(1),\n }),\n controls: css({\n display: 'flex',\n gap: theme.spacing(2),\n alignItems: 'flex-end',\n flexWrap: 'wrap',\n }),\n };\n};\n","import React, { useEffect } from 'react';\nimport { PanelMenuItem } from '@grafana/data';\nimport { Menu } from '@grafana/ui';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectState } from '../../core/types';\nimport { selectors } from '@grafana/e2e-selectors';\n\ninterface VizPanelMenuState extends SceneObjectState {\n items?: PanelMenuItem[];\n}\n\nexport class VizPanelMenu extends SceneObjectBase<VizPanelMenuState> {\n static Component = VizPanelMenuRenderer;\n\n // Allows adding menu items dynamically\n public addItem(item: PanelMenuItem) {\n this.setState({\n items: this.state.items ? [...this.state.items, item] : [item],\n });\n }\n\n // Allows replacing all menu items\n public setItems(items: PanelMenuItem[]) {\n this.setState({\n items,\n });\n }\n}\n\nfunction VizPanelMenuRenderer({ model }: SceneComponentProps<VizPanelMenu>) {\n const { items = [] } = model.useState();\n const ref = React.useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (ref.current) {\n ref.current.focus();\n }\n }, []);\n\n const renderItems = (items: PanelMenuItem[]) => {\n return items.map((item) => {\n switch (item.type) {\n case 'divider':\n return <Menu.Divider key={item.text} />;\n case 'group':\n return (\n <Menu.Group key={item.text} label={item.text}>\n {item.subMenu ? renderItems(item.subMenu) : undefined}\n </Menu.Group>\n );\n default:\n return (\n <Menu.Item\n key={item.text}\n label={item.text}\n icon={item.iconClassName}\n childItems={item.subMenu ? renderItems(item.subMenu) : undefined}\n url={item.href}\n onClick={item.onClick}\n shortcut={item.shortcut}\n testId={selectors.components.Panels.Panel.menuItems(item.text)}\n />\n );\n }\n });\n };\n\n return <Menu ref={ref}>{renderItems(items)}</Menu>;\n}\n","export const DEFAULT_PANEL_SPAN = 4;\nexport const GRID_CELL_HEIGHT = 30;\nexport const GRID_CELL_VMARGIN = 8;\nexport const GRID_COLUMN_COUNT = 24;\n","import React from 'react';\nimport { SceneObjectBase } from '../../../core/SceneObjectBase';\nimport { SceneObject, SceneComponentProps } from '../../../core/types';\nimport { SceneGridLayout } from './SceneGridLayout';\nimport { SceneGridRow } from './SceneGridRow';\nimport { SceneGridItemStateLike, SceneGridItemLike } from './types';\n\ninterface SceneGridItemState extends SceneGridItemStateLike {\n body: SceneObject | undefined;\n}\nexport class SceneGridItem extends SceneObjectBase<SceneGridItemState> implements SceneGridItemLike {\n static Component = SceneGridItemRenderer;\n}\n\nfunction SceneGridItemRenderer({ model }: SceneComponentProps<SceneGridItem>) {\n const { body } = model.useState();\n const parent = model.parent;\n\n if (parent && !isSceneGridLayout(parent) && !isSceneGridRow(parent)) {\n throw new Error('SceneGridItem must be a child of SceneGridLayout or SceneGridRow');\n }\n\n if (!body) {\n return null;\n }\n\n return <body.Component model={body} />;\n}\n\nexport function isSceneGridRow(child: SceneObject): child is SceneGridRow {\n return child instanceof SceneGridRow;\n}\n\nfunction isSceneGridLayout(child: SceneObject): child is SceneGridLayout {\n return child instanceof SceneGridLayout;\n}\n","import React, { ForwardRefExoticComponent, useImperativeHandle, useRef, useState } from 'react';\nimport { useEffectOnce } from 'react-use';\n\nimport { uniqueId } from 'lodash';\nimport { css } from '@emotion/css';\nimport { useStyles2 } from '@grafana/ui';\n\nexport function useUniqueId(): string {\n const idRefLazy = useRef<string | undefined>(undefined);\n idRefLazy.current ??= uniqueId();\n return idRefLazy.current;\n}\n\nexport interface Props extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange' | 'children'> {\n children: React.ReactNode | (({ isInView }: { isInView: boolean }) => React.ReactNode);\n key: string;\n onLoad?: () => void;\n onChange?: (isInView: boolean) => void;\n}\n\nexport interface LazyLoaderType extends ForwardRefExoticComponent<Props> {\n addCallback: (id: string, c: (e: IntersectionObserverEntry) => void) => void;\n callbacks: Record<string, (e: IntersectionObserverEntry) => void>;\n observer: IntersectionObserver;\n}\n\nexport const LazyLoader: LazyLoaderType = React.forwardRef<HTMLDivElement, Props>(\n ({ children, onLoad, onChange, className, ...rest }, ref) => {\n const id = useUniqueId();\n const { hideEmpty } = useStyles2(getStyles);\n const [loaded, setLoaded] = useState(false);\n const [isInView, setIsInView] = useState(false);\n const innerRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => innerRef.current!);\n\n useEffectOnce(() => {\n LazyLoader.addCallback(id, (entry) => {\n if (!loaded && entry.isIntersecting) {\n setLoaded(true);\n onLoad?.();\n }\n\n setIsInView(entry.isIntersecting);\n onChange?.(entry.isIntersecting);\n });\n\n const wrapperEl = innerRef.current;\n\n if (wrapperEl) {\n LazyLoader.observer.observe(wrapperEl);\n }\n\n return () => {\n wrapperEl && LazyLoader.observer.unobserve(wrapperEl);\n delete LazyLoader.callbacks[id];\n if (Object.keys(LazyLoader.callbacks).length === 0) {\n LazyLoader.observer.disconnect();\n }\n };\n });\n\n // If the element was loaded, we add the `hideEmpty` class to potentially\n // hide the LazyLoader if it does not have any children. This is the case\n // when children have the `isHidden` property set.\n // We always include the `className` class, as this is coming from the\n // caller of the `LazyLoader` component.\n const classes = `${loaded ? hideEmpty : ''} ${className}`;\n return (\n <div id={id} ref={innerRef} className={classes} {...rest}>\n {loaded && (typeof children === 'function' ? children({ isInView }) : children)}\n </div>\n );\n }\n) as LazyLoaderType;\n\nfunction getStyles() {\n return {\n hideEmpty: css({\n '&:empty': {\n display: 'none',\n },\n }),\n };\n}\n\nLazyLoader.displayName = 'LazyLoader';\nLazyLoader.callbacks = {} as Record<string, (e: IntersectionObserverEntry) => void>;\nLazyLoader.addCallback = (id: string, c: (e: IntersectionObserverEntry) => void) => (LazyLoader.callbacks[id] = c);\nLazyLoader.observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (typeof LazyLoader.callbacks[entry.target.id] === 'function') {\n LazyLoader.callbacks[entry.target.id](entry);\n }\n }\n },\n { rootMargin: '100px' }\n);\n","import React, { RefCallback, useEffect, useRef } from 'react';\nimport ReactGridLayout from 'react-grid-layout';\nimport { SceneComponentProps } from '../../../core/types';\nimport { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN, GRID_COLUMN_COUNT } from './constants';\nimport { LazyLoader } from '../LazyLoader';\nimport { SceneGridLayout } from './SceneGridLayout';\nimport { SceneGridItemLike } from './types';\nimport { useStyles2 } from '@grafana/ui';\nimport { css, cx } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useMeasure } from 'react-use';\n\nexport function SceneGridLayoutRenderer({ model }: SceneComponentProps<SceneGridLayout>) {\n const { children, isLazy, isDraggable, isResizable } = model.useState();\n const [outerDivRef, { width, height }] = useMeasure();\n const ref = useRef<HTMLDivElement | null>(null);\n\n /**\n * The class that enables drag animations needs to be added after mount otherwise panels move on mount to their set positions which is annoying\n */\n useEffect(() => {\n updateAnimationClass(ref, !!isDraggable);\n }, [isDraggable]);\n\n validateChildrenSize(children);\n\n const renderGrid = (width: number, height: number) => {\n if (!width || !height) {\n return null;\n }\n\n const layout = model.buildGridLayout(width, height);\n\n return (\n /**\n * The children is using a width of 100% so we need to guarantee that it is wrapped\n * in an element that has the calculated size given by the AutoSizer. The AutoSizer\n * has a width of 0 and will let its content overflow its div.\n */\n <div ref={ref} style={{ width: `${width}px`, height: '100%' }} className=\"react-grid-layout\">\n <ReactGridLayout\n width={width}\n /**\n Disable draggable if mobile device, solving an issue with unintentionally\n moving panels. https://github.com/grafana/grafana/issues/18497\n theme.breakpoints.md = 769\n */\n isDraggable={isDraggable && width > 768}\n isResizable={isResizable ?? false}\n containerPadding={[0, 0]}\n useCSSTransforms={true}\n margin={[GRID_CELL_VMARGIN, GRID_CELL_VMARGIN]}\n cols={GRID_COLUMN_COUNT}\n rowHeight={GRID_CELL_HEIGHT}\n draggableHandle={`.grid-drag-handle-${model.state.key}`}\n draggableCancel=\".grid-drag-cancel\"\n layout={layout}\n onDragStart={model.onDragStart}\n onDragStop={model.onDragStop}\n onResizeStop={model.onResizeStop}\n onLayoutChange={model.onLayoutChange}\n isBounded={false}\n resizeHandle={<ResizeHandle />}\n >\n {layout.map((gridItem, index) => (\n <GridItemWrapper\n key={gridItem.i}\n grid={model}\n layoutItem={gridItem}\n index={index}\n isLazy={isLazy}\n totalCount={layout.length}\n />\n ))}\n </ReactGridLayout>\n </div>\n );\n };\n\n return (\n <div\n ref={outerDivRef as RefCallback<HTMLDivElement>}\n style={{ flex: '1 1 auto', position: 'relative', zIndex: 1, width: '100%' }}\n >\n {renderGrid(width, height)}\n </div>\n );\n}\n\ninterface GridItemWrapperProps extends React.HTMLAttributes<HTMLDivElement> {\n grid: SceneGridLayout;\n layoutItem: ReactGridLayout.Layout;\n index: number;\n totalCount: number;\n isLazy?: boolean;\n}\n\nconst GridItemWrapper = React.forwardRef<HTMLDivElement, GridItemWrapperProps>((props, ref) => {\n const { grid, layoutItem, index, totalCount, isLazy, style, onLoad, onChange, children, ...divProps } = props;\n const sceneChild = grid.getSceneLayoutChild(layoutItem.i)!;\n const className = sceneChild.getClassName?.();\n\n const innerContent = <sceneChild.Component model={sceneChild} key={sceneChild.state.key} />;\n\n if (isLazy) {\n return (\n <LazyLoader\n {...divProps}\n key={sceneChild.state.key!}\n data-griditem-key={sceneChild.state.key}\n className={cx(className, props.className)}\n style={style}\n ref={ref}\n >\n {innerContent}\n {children}\n </LazyLoader>\n );\n }\n\n return (\n <div\n {...divProps}\n ref={ref}\n key={sceneChild.state.key}\n data-griditem-key={sceneChild.state.key}\n className={cx(className, props.className)}\n style={style}\n >\n {innerContent}\n {children}\n </div>\n );\n});\n\nGridItemWrapper.displayName = 'GridItemWrapper';\n\nfunction validateChildrenSize(children: SceneGridItemLike[]) {\n if (\n children.some(\n (c) =>\n c.state.height === undefined ||\n c.state.width === undefined ||\n c.state.x === undefined ||\n c.state.y === undefined\n )\n ) {\n throw new Error('All children must have a size specified');\n }\n}\n\nfunction updateAnimationClass(\n ref: React.MutableRefObject<HTMLDivElement | null>,\n isDraggable: boolean,\n retry?: boolean\n) {\n if (ref.current) {\n if (isDraggable) {\n ref.current.classList.add('react-grid-layout--enable-move-animations');\n } else {\n ref.current.classList.remove('react-grid-layout--enable-move-animations');\n }\n } else if (!retry) {\n setTimeout(() => updateAnimationClass(ref, isDraggable, true), 50);\n }\n}\n\ninterface ResizeHandleProps extends React.HTMLAttributes<HTMLDivElement> {\n handleAxis?: string;\n}\n\nconst ResizeHandle = React.forwardRef<HTMLDivElement, ResizeHandleProps>(({ handleAxis, ...divProps }, ref) => {\n const customCssClass = useStyles2(getResizeHandleStyles);\n\n return (\n <div ref={ref} {...divProps} className={`${customCssClass} scene-resize-handle`}>\n <svg width=\"16px\" height=\"16px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M21 15L15 21M21 8L8 21\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n );\n});\n\nResizeHandle.displayName = 'ResizeHandle';\n\nfunction getResizeHandleStyles(theme: GrafanaTheme2) {\n return css({\n position: 'absolute',\n bottom: 0,\n right: 0,\n zIndex: 999,\n padding: theme.spacing(1.5, 0, 0, 1.5),\n color: theme.colors.border.strong,\n cursor: 'se-resize',\n '&:hover': {\n color: theme.colors.text.link,\n },\n svg: {\n display: 'block',\n },\n '.react-resizable-hide &': {\n display: 'none',\n },\n });\n}\n","import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN } from './constants';\n\nexport function fitPanelsInHeight(cells: ReactGridLayout.Layout[], height: number) {\n // Take into account cell margint top + cell margin bottom + adding some marging at the bottom\n const visibleHeight = height - GRID_CELL_VMARGIN * 4;\n const currentGridHeight = Math.max(...cells.map((cell) => cell.h + cell.y));\n\n const visibleGridHeight = Math.floor(visibleHeight / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN));\n const scaleFactor = currentGridHeight / visibleGridHeight;\n\n return cells.map((cell) => {\n return {\n ...cell,\n y: Math.round(cell.y / scaleFactor) || 0,\n h: Math.round(cell.h / scaleFactor) || 1,\n };\n });\n}\n","import ReactGridLayout from 'react-grid-layout';\n\nimport { SceneObjectBase } from '../../../core/SceneObjectBase';\nimport { SceneLayout, SceneObjectState } from '../../../core/types';\nimport { DEFAULT_PANEL_SPAN } from './constants';\nimport { isSceneGridRow } from './SceneGridItem';\nimport { SceneGridLayoutRenderer } from './SceneGridLayoutRenderer';\n\nimport { SceneGridRow } from './SceneGridRow';\nimport { SceneGridItemLike, SceneGridItemPlacement } from './types';\nimport { fitPanelsInHeight } from './utils';\n\ninterface SceneGridLayoutState extends SceneObjectState {\n /**\n * Turn on or off dragging for all items. Individual items can still disabled via isDraggable property\n **/\n isDraggable?: boolean;\n /** Enable or disable item resizing */\n isResizable?: boolean;\n isLazy?: boolean;\n /**\n * Fit panels to height of the grid. This will scale down the panels vertically to fit available height.\n * The row height is not changed, only the y position and height of the panels.\n * UNSAFE: This feature is experimental and it might change in the future.\n */\n UNSAFE_fitPanels?: boolean;\n children: SceneGridItemLike[];\n}\n\nexport class SceneGridLayout extends SceneObjectBase<SceneGridLayoutState> implements SceneLayout {\n public static Component = SceneGridLayoutRenderer;\n\n private _skipOnLayoutChange = false;\n private _oldLayout: ReactGridLayout.Layout[] = [];\n private _loadOldLayout = false;\n\n public constructor(state: SceneGridLayoutState) {\n super({\n ...state,\n children: sortChildrenByPosition(state.children),\n });\n }\n\n /**\n * SceneLayout interface. Used for example by VizPanelRenderer\n */\n public isDraggable(): boolean {\n return this.state.isDraggable ?? false;\n }\n\n public getDragClass() {\n return `grid-drag-handle-${this.state.key}`;\n }\n\n public getDragClassCancel() {\n return `grid-drag-cancel`;\n }\n\n public toggleRow(row: SceneGridRow) {\n const isCollapsed = row.state.isCollapsed;\n\n if (!isCollapsed) {\n row.setState({ isCollapsed: true });\n // To force re-render\n this.setState({});\n return;\n }\n\n const rowChildren = row.state.children;\n\n if (rowChildren.length === 0) {\n row.setState({ isCollapsed: false });\n this.setState({});\n return;\n }\n\n // Ok we are expanding row. We need to update row children y pos (incase they are incorrect) and push items below down\n // Code copied from DashboardModel toggleRow()\n\n const rowY = row.state.y!;\n const firstPanelYPos = rowChildren[0].state.y ?? rowY;\n const yDiff = firstPanelYPos - (rowY + 1);\n\n // y max will represent the bottom y pos after all panels have been added\n // needed to know home much panels below should be pushed down\n let yMax = rowY;\n\n for (const panel of rowChildren) {\n // set the y gridPos if it wasn't already set\n const newSize = { ...panel.state };\n newSize.y = newSize.y ?? rowY;\n // make sure y is adjusted (in case row moved while collapsed)\n newSize.y -= yDiff;\n\n if (newSize.y! !== panel.state.y!) {\n panel.setState(newSize);\n }\n\n // update insert post and y max\n yMax = Math.max(yMax, Number(newSize.y!) + Number(newSize.height!));\n }\n\n const pushDownAmount = yMax - rowY - 1;\n\n // push panels below down\n for (const child of this.state.children) {\n if (child.state.y! > rowY) {\n this.pushChildDown(child, pushDownAmount);\n }\n\n if (isSceneGridRow(child) && child !== row) {\n for (const rowChild of child.state.children) {\n if (rowChild.state.y! > rowY) {\n this.pushChildDown(rowChild, pushDownAmount);\n }\n }\n }\n }\n\n row.setState({ isCollapsed: false });\n // Trigger re-render\n this.setState({});\n }\n\n public ignoreLayoutChange(shouldIgnore: boolean) {\n this._skipOnLayoutChange = shouldIgnore;\n }\n\n public onLayoutChange = (layout: ReactGridLayout.Layout[]) => {\n if (this._skipOnLayoutChange) {\n // Layout has been updated by other RTL handler already\n this._skipOnLayoutChange = false;\n return;\n }\n\n // We replace with the old layout only if the current state is invalid\n if (this._loadOldLayout) {\n layout = [...this._oldLayout];\n this._loadOldLayout = false;\n }\n\n for (const item of layout) {\n const child = this.getSceneLayoutChild(item.i);\n\n const nextSize: SceneGridItemPlacement = {\n x: item.x,\n y: item.y,\n width: item.w,\n height: item.h,\n };\n\n if (!isItemSizeEqual(child.state, nextSize)) {\n child.setState({\n ...nextSize,\n });\n }\n }\n\n this.setState({ children: sortChildrenByPosition(this.state.children) });\n };\n\n /**\n * Will also scan row children and return child of the row\n */\n public getSceneLayoutChild(key: string): SceneGridItemLike {\n for (const child of this.state.children) {\n if (child.state.key === key) {\n return child;\n }\n\n if (child instanceof SceneGridRow) {\n for (const rowChild of child.state.children) {\n if (rowChild.state.key === key) {\n return rowChild;\n }\n }\n }\n }\n\n throw new Error('Scene layout child not found for GridItem');\n }\n\n public onResizeStop: ReactGridLayout.ItemCallback = (_, o, n) => {\n const child = this.getSceneLayoutChild(n.i);\n child.setState({\n width: n.w,\n height: n.h,\n });\n };\n\n private pushChildDown(child: SceneGridItemLike, amount: number) {\n child.setState({\n y: child.state.y! + amount,\n });\n }\n\n /**\n * We assume the layout array is sorted according to y pos, and walk upwards until we find a row.\n * If it is collapsed there is no row to add it to. The default is then to return the SceneGridLayout itself\n */\n private findGridItemSceneParent(layout: ReactGridLayout.Layout[], startAt: number): SceneGridRow | SceneGridLayout {\n for (let i = startAt; i >= 0; i--) {\n const gridItem = layout[i];\n const sceneChild = this.getSceneLayoutChild(gridItem.i);\n\n if (sceneChild instanceof SceneGridRow) {\n // the closest row is collapsed return null\n if (sceneChild.state.isCollapsed) {\n return this;\n }\n\n return sceneChild;\n }\n }\n\n return this;\n }\n\n /**\n * Helper func to check if we are dropping a row in between panels of another row\n */\n private isRowDropValid(\n gridLayout: ReactGridLayout.Layout[],\n updatedItem: ReactGridLayout.Layout,\n indexOfUpdatedItem: number\n ): boolean {\n // if the row is dropped at the end of the dashboard grid layout, we accept this valid state\n if (gridLayout[gridLayout.length - 1].i === updatedItem.i) {\n return true;\n }\n\n // if the next child after the updated item is a scene grid row, then we are either at the top\n // of the dashboard, or between rows\n // if it's not a grid row, but it's parent is the layout, it means we are not in between a\n // rows children, so also valid state\n const nextSceneChild = this.getSceneLayoutChild(gridLayout[indexOfUpdatedItem + 1].i);\n if (nextSceneChild instanceof SceneGridRow) {\n return true;\n } else if (nextSceneChild.parent instanceof SceneGridLayout) {\n return true;\n }\n\n return false;\n }\n\n /**\n * This likely needs a slightly different approach. Where we clone or deactivate or and re-activate the moved child\n */\n public moveChildTo(child: SceneGridItemLike, target: SceneGridLayout | SceneGridRow) {\n const currentParent = child.parent!;\n let rootChildren = this.state.children;\n\n const newChild = child.clone({ key: child.state.key });\n\n // Remove from current parent row\n if (currentParent instanceof SceneGridRow) {\n const newRow = currentParent.clone();\n newRow.setState({\n children: newRow.state.children.filter((c) => c.state.key !== child.state.key),\n });\n\n // new children with new row\n rootChildren = rootChildren.map((c) => (c === currentParent ? newRow : c));\n\n // if target is also a row\n if (target instanceof SceneGridRow) {\n const targetRow = target.clone();\n targetRow.setState({ children: [...targetRow.state.children, newChild] });\n rootChildren = rootChildren.map((c) => (c === target ? targetRow : c));\n } else {\n // target is the main grid\n rootChildren = [...rootChildren, newChild];\n }\n } else {\n if (!(target instanceof SceneGridLayout)) {\n // current parent is the main grid remove it from there\n rootChildren = rootChildren.filter((c) => c.state.key !== child.state.key);\n // Clone the target row and add the child\n const targetRow = target.clone();\n targetRow.setState({ children: [...targetRow.state.children, newChild] });\n // Replace row with new row\n rootChildren = rootChildren.map((c) => (c === target ? targetRow : c));\n }\n }\n\n return rootChildren;\n }\n\n public onDragStart: ReactGridLayout.ItemCallback = (gridLayout) => {\n this._oldLayout = [...gridLayout];\n };\n\n public onDragStop: ReactGridLayout.ItemCallback = (gridLayout, o, updatedItem) => {\n const sceneChild = this.getSceneLayoutChild(updatedItem.i)!;\n\n // Need to resort the grid layout based on new position (needed to find the new parent)\n gridLayout = sortGridLayout(gridLayout);\n\n // Update children positions if they have changed\n for (let i = 0; i < gridLayout.length; i++) {\n const gridItem = gridLayout[i];\n const child = this.getSceneLayoutChild(gridItem.i)!;\n const childSize = child.state;\n\n if (childSize?.x !== gridItem.x || childSize?.y !== gridItem.y) {\n child.setState({\n x: gridItem.x,\n y: gridItem.y,\n });\n }\n }\n\n // Update the parent if the child if it has moved to a row or back to the grid\n const indexOfUpdatedItem = gridLayout.findIndex((item) => item.i === updatedItem.i);\n let newParent = this.findGridItemSceneParent(gridLayout, indexOfUpdatedItem - 1);\n let newChildren = this.state.children;\n\n // if the child is a row and we are moving it under an uncollapsed row, keep the scene grid layout as parent\n // and set the old layout flag if the state is invalid. We allow setting the children in an invalid state,\n // as the layout will be updated in onLayoutChange and avoid flickering\n if (sceneChild instanceof SceneGridRow && newParent instanceof SceneGridRow) {\n if (!this.isRowDropValid(gridLayout, updatedItem, indexOfUpdatedItem)) {\n this._loadOldLayout = true;\n }\n\n newParent = this;\n }\n\n if (newParent !== sceneChild.parent) {\n newChildren = this.moveChildTo(sceneChild, newParent);\n }\n\n this.setState({ children: sortChildrenByPosition(newChildren) });\n this._skipOnLayoutChange = true;\n };\n\n private toGridCell(child: SceneGridItemLike): ReactGridLayout.Layout {\n const size = child.state;\n\n let x = size.x ?? 0;\n let y = size.y ?? 0;\n const w = Number.isInteger(Number(size.width)) ? Number(size.width) : DEFAULT_PANEL_SPAN;\n const h = Number.isInteger(Number(size.height)) ? Number(size.height) : DEFAULT_PANEL_SPAN;\n\n let isDraggable = child.state.isDraggable;\n let isResizable = child.state.isResizable;\n\n if (child instanceof SceneGridRow) {\n isDraggable = child.state.isCollapsed ? true : false;\n isResizable = false;\n }\n\n return { i: child.state.key!, x, y, h, w, isResizable, isDraggable };\n }\n\n public buildGridLayout(width: number, height: number): ReactGridLayout.Layout[] {\n let cells: ReactGridLayout.Layout[] = [];\n\n for (const child of this.state.children) {\n cells.push(this.toGridCell(child));\n\n if (child instanceof SceneGridRow && !child.state.isCollapsed) {\n for (const rowChild of child.state.children) {\n cells.push(this.toGridCell(rowChild));\n }\n }\n }\n\n // Sort by position\n cells = sortGridLayout(cells);\n\n if (this.state.UNSAFE_fitPanels) {\n cells = fitPanelsInHeight(cells, height);\n }\n\n if (width < 768) {\n // We should not persist the mobile layout\n this._skipOnLayoutChange = true;\n return cells.map((cell) => ({ ...cell, w: 24 }));\n }\n\n this._skipOnLayoutChange = false;\n\n return cells;\n }\n}\n\nfunction isItemSizeEqual(a: SceneGridItemPlacement, b: SceneGridItemPlacement) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\nfunction sortChildrenByPosition(children: SceneGridItemLike[]) {\n children.forEach((child) => {\n if (child instanceof SceneGridRow) {\n child.setState({ children: sortChildrenByPosition(child.state.children) });\n }\n });\n\n return [...children].sort((a, b) => {\n return a.state.y! - b.state.y! || a.state.x! - b.state.x!;\n });\n}\n\nfunction sortGridLayout(layout: ReactGridLayout.Layout[]) {\n return [...layout].sort((a, b) => a.y - b.y || a.x! - b.x);\n}\n","import { css, cx } from '@emotion/css';\nimport React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { Icon, useStyles2 } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObject, SceneObjectUrlValues } from '../../../core/types';\n\nimport { SceneGridLayout } from './SceneGridLayout';\nimport { GRID_COLUMN_COUNT } from './constants';\nimport { SceneGridItemLike, SceneGridItemStateLike } from './types';\nimport { sceneGraph } from '../../../core/sceneGraph';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { VariableDependencyConfig } from '../../../variables/VariableDependencyConfig';\n\nexport interface SceneGridRowState extends SceneGridItemStateLike {\n title: string;\n isCollapsible?: boolean;\n isCollapsed?: boolean;\n actions?: SceneObject;\n children: SceneGridItemLike[];\n}\n\nexport class SceneGridRow extends SceneObjectBase<SceneGridRowState> {\n public static Component = SceneGridRowRenderer;\n\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['title'],\n });\n\n public constructor(state: Partial<SceneGridRowState>) {\n super({\n children: state.children || [],\n isCollapsible: state.isCollapsible || true,\n title: state.title || '',\n ...state,\n x: 0,\n height: 1,\n width: GRID_COLUMN_COUNT,\n });\n }\n\n public getGridLayout(): SceneGridLayout {\n const layout = this.parent;\n\n if (!layout || !(layout instanceof SceneGridLayout)) {\n throw new Error('SceneGridRow must be a child of SceneGridLayout');\n }\n\n return layout;\n }\n\n public onCollapseToggle = () => {\n if (!this.state.isCollapsible) {\n return;\n }\n\n this.getGridLayout().toggleRow(this);\n };\n\n public getUrlState() {\n return { rowc: this.state.isCollapsed ? '1' : '0' };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n if (values.rowc == null) {\n return;\n }\n\n if (values.rowc !== this.getUrlState().rowc) {\n this.onCollapseToggle();\n }\n }\n}\n\nexport function SceneGridRowRenderer({ model }: SceneComponentProps<SceneGridRow>) {\n const styles = useStyles2(getSceneGridRowStyles);\n const { isCollapsible, isCollapsed, title, actions, children } = model.useState();\n const layout = model.getGridLayout();\n const layoutDragClass = layout.getDragClass();\n const isDraggable = layout.isDraggable();\n\n const count = children ? children.length : 0;\n const panels = count === 1 ? 'panel' : 'panels';\n\n return (\n <div className={cx(styles.row, isCollapsed && styles.rowCollapsed)}>\n <div className={styles.rowTitleAndActionsGroup}>\n <button\n onClick={model.onCollapseToggle}\n className={styles.rowTitleButton}\n aria-label={isCollapsed ? 'Expand row' : 'Collapse row'}\n data-testid={selectors.components.DashboardRow.title(sceneGraph.interpolate(model, title, undefined, 'text'))}\n >\n {isCollapsible && <Icon name={isCollapsed ? 'angle-right' : 'angle-down'} />}\n <span className={styles.rowTitle} role=\"heading\">\n {sceneGraph.interpolate(model, title, undefined, 'text')}\n </span>\n </button>\n <span className={cx(styles.panelCount, isCollapsed && styles.panelCountCollapsed)}>\n ({count} {panels})\n </span>\n {actions && (\n <div className={styles.rowActions}>\n <actions.Component model={actions} />\n </div>\n )}\n </div>\n {isDraggable && isCollapsed && (\n <div className={cx(styles.dragHandle, layoutDragClass)}>\n <Icon name=\"draggabledots\" />\n </div>\n )}\n </div>\n );\n}\n\nexport const getSceneGridRowStyles = (theme: GrafanaTheme2) => {\n return {\n row: css({\n width: '100%',\n height: '30px',\n display: 'flex',\n justifyContent: 'space-between',\n gap: theme.spacing(1),\n }),\n rowTitleButton: css({\n display: 'flex',\n alignItems: 'center',\n cursor: 'pointer',\n background: 'transparent',\n border: 'none',\n gap: theme.spacing(1),\n }),\n rowCollapsed: css({\n borderBottom: `1px solid ${theme.colors.border.weak}`,\n }),\n rowTitle: css({\n fontSize: theme.typography.h5.fontSize,\n fontWeight: theme.typography.fontWeightMedium,\n }),\n collapsedInfo: css({\n fontSize: theme.typography.bodySmall.fontSize,\n color: theme.colors.text.secondary,\n display: 'flex',\n alignItems: 'center',\n flexGrow: 1,\n }),\n rowTitleAndActionsGroup: css({\n display: 'flex',\n\n '&:hover, &:focus-within': {\n '& > div': {\n opacity: 1,\n },\n },\n }),\n rowActions: css({\n display: 'flex',\n opacity: 0,\n transition: '200ms opacity ease-in 200ms',\n\n '&:hover, &:focus-within': {\n opacity: 1,\n },\n }),\n dragHandle: css({\n display: 'flex',\n padding: theme.spacing(0, 1),\n alignItems: 'center',\n justifyContent: 'flex-end',\n cursor: 'move',\n color: theme.colors.text.secondary,\n '&:hover': {\n color: theme.colors.text.primary,\n },\n }),\n panelCount: css({\n paddingLeft: theme.spacing(2),\n color: theme.colors.text.secondary,\n fontStyle: 'italic',\n fontSize: theme.typography.size.sm,\n fontWeight: 'normal',\n display: 'none',\n lineHeight: '30px',\n }),\n panelCountCollapsed: css({\n display: 'inline-block',\n }),\n };\n};\n","import { css, cx } from '@emotion/css';\nimport React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { Icon, ToolbarButton, useStyles2 } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneObject, SceneComponentProps, SceneLayout, SceneObjectState } from '../core/types';\nimport { getSceneGridRowStyles } from './layout/grid/SceneGridRow';\nimport { sceneGraph } from '../core/sceneGraph';\n\ninterface NestedSceneState extends SceneObjectState {\n title: string;\n isCollapsed?: boolean;\n canCollapse?: boolean;\n canRemove?: boolean;\n body: SceneLayout;\n controls?: SceneObject[];\n}\n\n/**\n * @internal\n * POC status, don't use this yet\n */\nexport class NestedScene extends SceneObjectBase<NestedSceneState> {\n public static Component = NestedSceneRenderer;\n\n public onToggle = () => {\n this.setState({\n isCollapsed: !this.state.isCollapsed,\n });\n };\n\n /** Removes itself from its parent's children array */\n public onRemove = () => {\n const parent = this.parent!;\n\n if (isSceneLayoutItem(parent)) {\n parent.setState({\n body: undefined,\n });\n }\n };\n}\n\nexport function NestedSceneRenderer({ model }: SceneComponentProps<NestedScene>) {\n const { title, isCollapsed, canCollapse, canRemove, body, controls } = model.useState();\n const gridRow = useStyles2(getSceneGridRowStyles);\n const styles = useStyles2(getStyles);\n\n const toolbarControls = (controls ?? []).map((action) => <action.Component key={action.state.key} model={action} />);\n\n if (canRemove) {\n toolbarControls.push(\n <ToolbarButton\n icon=\"times\"\n variant={'default'}\n onClick={model.onRemove}\n key=\"remove-button\"\n aria-label=\"Remove scene\"\n />\n );\n }\n\n return (\n <div className={styles.wrapper}>\n <div className={cx(styles.row, isCollapsed && styles.rowCollapsed)}>\n <button\n onClick={model.onToggle}\n className={gridRow.rowTitleButton}\n aria-label={isCollapsed ? 'Expand scene' : 'Collapse scene'}\n >\n {canCollapse && <Icon name={isCollapsed ? 'angle-right' : 'angle-down'} />}\n <span className={gridRow.rowTitle} role=\"heading\">\n {sceneGraph.interpolate(model, title, undefined, 'text')}\n </span>\n </button>\n <div className={styles.actions}>{toolbarControls}</div>\n </div>\n {!isCollapsed && <body.Component model={body} />}\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n wrapper: css({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n gap: theme.spacing(1),\n }),\n row: css({\n width: '100%',\n display: 'flex',\n justifyContent: 'space-between',\n gap: theme.spacing(1),\n }),\n rowCollapsed: css({\n borderBottom: `1px solid ${theme.colors.border.weak}`,\n paddingBottom: theme.spacing(1),\n }),\n actions: css({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n justifyContent: 'flex-end',\n flexGrow: 1,\n }),\n});\n\nfunction isSceneLayoutItem(x: SceneObject): x is SceneObject<SceneObjectState & { body: SceneObject | undefined }> {\n return 'body' in x.state;\n}\n","import React from 'react';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneObjectState } from '../core/types';\nimport { VariableDependencyConfig } from '../variables/VariableDependencyConfig';\nimport { useTheme2 } from '@grafana/ui';\nimport { css } from '@emotion/css';\n\nexport interface SceneCanvasTextState extends SceneObjectState {\n text: string;\n fontSize?: number;\n align?: 'left' | 'center' | 'right';\n spacing?: number;\n}\n\n/**\n * Not a really useful component, just an example of how to create one\n * @internal\n */\nexport class SceneCanvasText extends SceneObjectBase<SceneCanvasTextState> {\n protected _variableDependency = new VariableDependencyConfig(this, { statePaths: ['text'] });\n\n public static Component = ({ model }: SceneComponentProps<SceneCanvasText>) => {\n const { text, fontSize = 20, align = 'left', key, spacing } = model.useState();\n const theme = useTheme2();\n\n const style = css({\n fontSize: fontSize,\n display: 'flex',\n flexGrow: 1,\n alignItems: 'center',\n padding: spacing ? theme.spacing(spacing, 0) : undefined,\n justifyContent: align,\n });\n\n return (\n <div className={style} data-testid={key}>\n {sceneGraph.interpolate(model, text)}\n </div>\n );\n };\n}\n","import React from 'react';\n\nimport { IconName, Input, ToolbarButton } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectState } from '../core/types';\nimport { ControlsLabel } from '../utils/ControlsLabel';\n\nexport interface ToolbarButtonState extends SceneObjectState {\n icon: IconName;\n onClick: () => void;\n}\n\nexport class SceneToolbarButton extends SceneObjectBase<ToolbarButtonState> {\n public static Component = ({ model }: SceneComponentProps<SceneToolbarButton>) => {\n const state = model.useState();\n\n return <ToolbarButton onClick={state.onClick} icon={state.icon} />;\n };\n}\n\nexport interface SceneToolbarInputState extends SceneObjectState {\n value?: string;\n label?: string;\n onChange: (value: number) => void;\n}\n\nexport class SceneToolbarInput extends SceneObjectBase<SceneToolbarInputState> {\n public static Component = ({ model }: SceneComponentProps<SceneToolbarInput>) => {\n const state = model.useState();\n\n return (\n <div style={{ display: 'flex' }}>\n {state.label && <ControlsLabel label={state.label} />}\n <Input\n defaultValue={state.value}\n width={8}\n onBlur={(evt) => {\n model.state.onChange(parseInt(evt.currentTarget.value, 10));\n }}\n />\n </div>\n );\n };\n}\n","import React from 'react';\n\nimport { TimeRangePicker } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneObjectState } from '../core/types';\nimport { TimeRange, toUtc } from '@grafana/data';\n\nexport interface SceneTimePickerState extends SceneObjectState {\n hidePicker?: boolean;\n isOnCanvas?: boolean;\n}\n\nexport class SceneTimePicker extends SceneObjectBase<SceneTimePickerState> {\n public static Component = SceneTimePickerRenderer;\n\n public onZoom = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const zoomedTimeRange = getZoomedTimeRange(timeRange.state.value, 2);\n timeRange.onTimeRangeChange(zoomedTimeRange);\n };\n\n public onChangeFiscalYearStartMonth = (month: number) => {\n const timeRange = sceneGraph.getTimeRange(this);\n timeRange.setState({ fiscalYearStartMonth: month });\n };\n\n public toAbsolute = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const timeRangeVal = timeRange.state.value;\n const from = toUtc(timeRangeVal.from);\n const to = toUtc(timeRangeVal.to);\n timeRange.onTimeRangeChange({ from, to, raw: { from, to } });\n };\n\n public onMoveBackward = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const {\n state: { value: range },\n } = timeRange;\n\n timeRange.onTimeRangeChange(getShiftedTimeRange(TimeRangeDirection.Backward, range, Date.now()));\n };\n\n public onMoveForward = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const {\n state: { value: range },\n } = timeRange;\n\n timeRange.onTimeRangeChange(getShiftedTimeRange(TimeRangeDirection.Forward, range, Date.now()));\n };\n}\n\nfunction SceneTimePickerRenderer({ model }: SceneComponentProps<SceneTimePicker>) {\n const { hidePicker, isOnCanvas } = model.useState();\n const timeRange = sceneGraph.getTimeRange(model);\n const timeZone = timeRange.getTimeZone();\n const timeRangeState = timeRange.useState();\n\n if (hidePicker) {\n return null;\n }\n\n return (\n <TimeRangePicker\n isOnCanvas={isOnCanvas ?? true}\n value={timeRangeState.value}\n onChange={timeRange.onTimeRangeChange}\n timeZone={timeZone}\n fiscalYearStartMonth={timeRangeState.fiscalYearStartMonth}\n onMoveBackward={model.onMoveBackward}\n onMoveForward={model.onMoveForward}\n onZoom={model.onZoom}\n onChangeTimeZone={timeRange.onTimeZoneChange}\n onChangeFiscalYearStartMonth={model.onChangeFiscalYearStartMonth}\n />\n );\n}\n\nexport function getZoomedTimeRange(timeRange: TimeRange, factor: number): TimeRange {\n const timespan = timeRange.to.valueOf() - timeRange.from.valueOf();\n const center = timeRange.to.valueOf() - timespan / 2;\n // If the timepsan is 0, zooming out would do nothing, so we force a zoom out to 30s\n const newTimespan = timespan === 0 ? 30000 : timespan * factor;\n\n const to = center + newTimespan / 2;\n const from = center - newTimespan / 2;\n\n return { from: toUtc(from), to: toUtc(to), raw: { from: toUtc(from), to: toUtc(to) } };\n}\n\nexport enum TimeRangeDirection {\n Backward,\n Forward,\n}\n\nexport function getShiftedTimeRange(dir: TimeRangeDirection, timeRange: TimeRange, upperLimit: number): TimeRange {\n const oldTo = timeRange.to.valueOf();\n const oldFrom = timeRange.from.valueOf();\n const halfSpan = (oldTo - oldFrom) / 2;\n\n let fromRaw: number;\n let toRaw: number;\n if (dir === TimeRangeDirection.Backward) {\n fromRaw = oldFrom - halfSpan;\n toRaw = oldTo - halfSpan;\n } else {\n fromRaw = oldFrom + halfSpan;\n toRaw = oldTo + halfSpan;\n\n if (toRaw > upperLimit && oldTo < upperLimit) {\n toRaw = upperLimit;\n fromRaw = oldFrom;\n }\n }\n\n const from = toUtc(fromRaw);\n const to = toUtc(toRaw);\n return {\n from,\n to,\n raw: { from, to },\n };\n}\n","import React from 'react';\nimport { Unsubscribable } from 'rxjs';\nimport { rangeUtil } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { RefreshPicker } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneObject, SceneObjectState, SceneObjectUrlValues } from '../core/types';\nimport { SceneObjectUrlSyncConfig } from '../services/SceneObjectUrlSyncConfig';\n\nexport const DEFAULT_INTERVALS = ['5s', '10s', '30s', '1m', '5m', '15m', '30m', '1h', '2h', '1d'];\n\nexport interface SceneRefreshPickerState extends SceneObjectState {\n // Refresh interval, e.g. 5s, 1m, 2h\n refresh: string;\n autoEnabled?: boolean;\n autoMinInterval?: string;\n autoValue?: string;\n // List of allowed refresh intervals, e.g. ['5s', '1m']\n intervals?: string[];\n isOnCanvas?: boolean;\n primary?: boolean;\n withText?: boolean;\n}\n\nexport class SceneRefreshPicker extends SceneObjectBase<SceneRefreshPickerState> {\n public static Component = SceneRefreshPickerRenderer;\n protected _urlSync = new SceneObjectUrlSyncConfig(this, { keys: ['refresh'] });\n private _intervalTimer: ReturnType<typeof setInterval> | undefined;\n private _autoTimeRangeListener: Unsubscribable | undefined;\n\n public constructor(state: Partial<SceneRefreshPickerState>) {\n super({\n refresh: '',\n ...state,\n autoValue: undefined,\n autoEnabled: state.autoEnabled ?? true,\n autoMinInterval: state.autoMinInterval ?? config.minRefreshInterval,\n intervals: state.intervals ?? DEFAULT_INTERVALS,\n });\n\n this.addActivationHandler(() => {\n this.setupIntervalTimer();\n\n return () => {\n if (this._intervalTimer) {\n clearInterval(this._intervalTimer);\n }\n\n this._autoTimeRangeListener?.unsubscribe();\n };\n });\n }\n\n public onRefresh = () => {\n const queryController = sceneGraph.getQueryController(this);\n if (queryController?.state.isRunning) {\n queryController.cancelAll();\n return;\n }\n\n const timeRange = sceneGraph.getTimeRange(this);\n\n if (this._intervalTimer) {\n clearInterval(this._intervalTimer);\n }\n\n timeRange.onRefresh();\n this.setupIntervalTimer();\n };\n\n public onIntervalChanged = (interval: string) => {\n this.setState({ refresh: interval });\n this.setupIntervalTimer();\n };\n\n public getUrlState() {\n return {\n refresh: this.state.refresh,\n };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n const refresh = values.refresh;\n\n if (refresh && typeof refresh === 'string') {\n this.setState({\n refresh,\n });\n }\n }\n\n private setupAutoTimeRangeListener = () => {\n // If the time range has changed, we need to recalculate the auto interval but prevent unnecessary processing\n return sceneGraph.getTimeRange(this).subscribeToState((newState, prevState) => {\n if (newState.from !== prevState.from || newState.to !== prevState.to) {\n this.setupIntervalTimer();\n }\n });\n };\n\n private calculateAutoRefreshInterval = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const resolution = window?.innerWidth ?? 2000;\n return rangeUtil.calculateInterval(timeRange.state.value, resolution, this.state.autoMinInterval);\n };\n\n private setupIntervalTimer = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const { refresh, intervals } = this.state;\n\n if (this._intervalTimer || refresh === '') {\n clearInterval(this._intervalTimer);\n }\n\n if (refresh === '') {\n return;\n }\n\n // If the provided interval is not allowed\n if (refresh !== RefreshPicker.autoOption.value && intervals && !intervals.includes(refresh)) {\n return;\n }\n\n let intervalMs: number;\n\n // Unsubscribe from previous listener no matter what\n this._autoTimeRangeListener?.unsubscribe();\n\n if (refresh === RefreshPicker.autoOption.value) {\n const autoRefreshInterval = this.calculateAutoRefreshInterval();\n\n intervalMs = autoRefreshInterval.intervalMs;\n\n this._autoTimeRangeListener = this.setupAutoTimeRangeListener();\n\n if (autoRefreshInterval.interval !== this.state.autoValue) {\n this.setState({ autoValue: autoRefreshInterval.interval });\n }\n } else {\n intervalMs = rangeUtil.intervalToMs(refresh);\n }\n\n this._intervalTimer = setInterval(() => {\n timeRange.onRefresh();\n }, intervalMs);\n };\n}\n\nexport function SceneRefreshPickerRenderer({ model }: SceneComponentProps<SceneRefreshPicker>) {\n const { refresh, intervals, autoEnabled, autoValue, isOnCanvas, primary, withText } = model.useState();\n const isRunning = useQueryControllerState(model);\n\n let text = refresh === RefreshPicker.autoOption?.value ? autoValue : withText ? 'Refresh' : undefined;\n let tooltip: string | undefined;\n let width: string | undefined;\n\n if (isRunning) {\n tooltip = 'Cancel all queries';\n\n if (withText) {\n text = 'Cancel';\n }\n }\n\n if (withText) {\n width = '96px';\n }\n\n return (\n <RefreshPicker\n showAutoInterval={autoEnabled}\n value={refresh}\n intervals={intervals}\n tooltip={tooltip}\n width={width}\n text={text}\n onRefresh={model.onRefresh}\n primary={primary}\n onIntervalChanged={model.onIntervalChanged}\n isLoading={isRunning}\n isOnCanvas={isOnCanvas ?? true}\n />\n );\n}\n\nfunction useQueryControllerState(model: SceneObject): boolean {\n const queryController = sceneGraph.getQueryController(model);\n if (!queryController) {\n return false;\n }\n\n return queryController.useState().isRunning;\n}\n","export const getCompareSeriesRefId = (refId: string) => `${refId}-compare`;\n","import { DataQueryRequest, DateTime, dateTime, FieldType, GrafanaTheme2, rangeUtil, TimeRange } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { ButtonGroup, ButtonSelect, Checkbox, ToolbarButton, useStyles2 } from '@grafana/ui';\nimport React from 'react';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneComponentProps, SceneDataQuery, SceneObjectState, SceneObjectUrlValues } from '../core/types';\nimport { DataQueryExtended } from '../querying/SceneQueryRunner';\nimport { ExtraQueryDescriptor, ExtraQueryDataProcessor, ExtraQueryProvider } from '../querying/ExtraQueryProvider';\nimport { SceneObjectUrlSyncConfig } from '../services/SceneObjectUrlSyncConfig';\nimport { getCompareSeriesRefId } from '../utils/getCompareSeriesRefId';\nimport { parseUrlParam } from '../utils/parseUrlParam';\nimport { css } from '@emotion/css';\nimport { of } from 'rxjs';\n\ninterface SceneTimeRangeCompareState extends SceneObjectState {\n compareWith?: string;\n compareOptions: Array<{ label: string; value: string }>;\n}\n\nconst PREVIOUS_PERIOD_VALUE = '__previousPeriod';\nconst NO_PERIOD_VALUE = '__noPeriod';\n\nexport const PREVIOUS_PERIOD_COMPARE_OPTION = {\n label: 'Previous period',\n value: PREVIOUS_PERIOD_VALUE,\n};\n\nexport const NO_COMPARE_OPTION = {\n label: 'No comparison',\n value: NO_PERIOD_VALUE,\n};\n\nexport const DEFAULT_COMPARE_OPTIONS = [\n { label: 'Day before', value: '24h' },\n { label: 'Week before', value: '1w' },\n { label: 'Month before', value: '1M' },\n];\n\nexport class SceneTimeRangeCompare\n extends SceneObjectBase<SceneTimeRangeCompareState>\n implements ExtraQueryProvider<SceneTimeRangeCompareState>\n{\n static Component = SceneTimeRangeCompareRenderer;\n protected _urlSync = new SceneObjectUrlSyncConfig(this, { keys: ['compareWith'] });\n\n public constructor(state: Partial<SceneTimeRangeCompareState>) {\n super({ compareOptions: DEFAULT_COMPARE_OPTIONS, ...state });\n this.addActivationHandler(this._onActivate);\n }\n\n private _onActivate = () => {\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n this.setState({ compareOptions: this.getCompareOptions(sceneTimeRange.state.value) });\n\n this._subs.add(\n sceneTimeRange.subscribeToState((timeRange) => {\n const compareOptions = this.getCompareOptions(timeRange.value);\n const stateUpdate: Partial<SceneTimeRangeCompareState> = { compareOptions };\n\n // if current compareWith is not applicable to the new time range, set it to previous period comparison\n if (Boolean(this.state.compareWith) && !compareOptions.find(({ value }) => value === this.state.compareWith)) {\n stateUpdate.compareWith = PREVIOUS_PERIOD_VALUE;\n }\n\n this.setState(stateUpdate);\n })\n );\n };\n\n public getCompareOptions = (timeRange: TimeRange) => {\n const diffDays = Math.ceil(timeRange.to.diff(timeRange.from));\n\n const matchIndex = DEFAULT_COMPARE_OPTIONS.findIndex(({ value }) => {\n const intervalInMs = rangeUtil.intervalToMs(value);\n return intervalInMs >= diffDays;\n });\n\n return [\n NO_COMPARE_OPTION,\n PREVIOUS_PERIOD_COMPARE_OPTION,\n ...DEFAULT_COMPARE_OPTIONS.slice(matchIndex).map(({ label, value }) => ({ label, value })),\n ];\n };\n\n public onCompareWithChanged = (compareWith: string) => {\n if (compareWith === NO_PERIOD_VALUE) {\n this.onClearCompare();\n } else {\n this.setState({ compareWith });\n }\n };\n\n public onClearCompare = () => {\n this.setState({ compareWith: undefined });\n };\n\n // Get a time shifted request to compare with the primary request.\n public getExtraQueries(request: DataQueryRequest): ExtraQueryDescriptor[] {\n const extraQueries: ExtraQueryDescriptor[] = [];\n const compareRange = this.getCompareTimeRange(request.range);\n if (!compareRange) {\n return extraQueries;\n }\n\n const targets = request.targets.filter((query: DataQueryExtended) => query.timeRangeCompare !== false);\n if (targets.length) {\n extraQueries.push({\n req: {\n ...request,\n targets,\n range: compareRange,\n },\n processor: timeShiftAlignmentProcessor,\n });\n }\n return extraQueries;\n }\n\n // The query runner should rerun the comparison query if the compareWith value has changed and there are queries that haven't opted out of TWC\n public shouldRerun(\n prev: SceneTimeRangeCompareState,\n next: SceneTimeRangeCompareState,\n queries: SceneDataQuery[]\n ): boolean {\n return (\n prev.compareWith !== next.compareWith && queries.find((query) => query.timeRangeCompare !== false) !== undefined\n );\n }\n\n public getCompareTimeRange(timeRange: TimeRange): TimeRange | undefined {\n let compareFrom: DateTime;\n let compareTo: DateTime;\n\n if (this.state.compareWith) {\n if (this.state.compareWith === PREVIOUS_PERIOD_VALUE) {\n const diffMs = timeRange.to.diff(timeRange.from);\n compareFrom = dateTime(timeRange.from!).subtract(diffMs);\n compareTo = dateTime(timeRange.to!).subtract(diffMs);\n } else {\n compareFrom = dateTime(timeRange.from!).subtract(rangeUtil.intervalToMs(this.state.compareWith));\n compareTo = dateTime(timeRange.to!).subtract(rangeUtil.intervalToMs(this.state.compareWith));\n }\n return {\n from: compareFrom,\n to: compareTo,\n raw: {\n from: compareFrom,\n to: compareTo,\n },\n };\n }\n\n return undefined;\n }\n\n public getUrlState(): SceneObjectUrlValues {\n return {\n compareWith: this.state.compareWith,\n };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n if (!values.compareWith) {\n return;\n }\n\n const compareWith = parseUrlParam(values.compareWith);\n\n if (compareWith) {\n const compareOptions = this.getCompareOptions(sceneGraph.getTimeRange(this).state.value);\n\n if (compareOptions.find(({ value }) => value === compareWith)) {\n this.setState({\n compareWith,\n });\n } else {\n this.setState({\n compareWith: '__previousPeriod',\n });\n }\n }\n }\n}\n\n// Processor function for use with time shifted comparison series.\n// This aligns the secondary series with the primary and adds custom\n// metadata and config to the secondary series' fields so that it is\n// rendered appropriately.\nconst timeShiftAlignmentProcessor: ExtraQueryDataProcessor = (primary, secondary) => {\n const diff = secondary.timeRange.from.diff(primary.timeRange.from);\n secondary.series.forEach((series) => {\n series.refId = getCompareSeriesRefId(series.refId || '');\n series.meta = {\n ...series.meta,\n // @ts-ignore Remove when https://github.com/grafana/grafana/pull/71129 is released\n timeCompare: {\n diffMs: diff,\n isTimeShiftQuery: true,\n },\n };\n series.fields.forEach((field) => {\n // Align compare series time stamps with reference series\n if (field.type === FieldType.time) {\n field.values = field.values.map((v) => {\n return diff < 0 ? v - diff : v + diff;\n });\n }\n\n field.config = {\n ...field.config,\n color: {\n mode: 'fixed',\n fixedColor: config.theme.palette.gray60,\n },\n };\n return field;\n });\n });\n return of(secondary);\n};\n\nfunction SceneTimeRangeCompareRenderer({ model }: SceneComponentProps<SceneTimeRangeCompare>) {\n const styles = useStyles2(getStyles);\n const { compareWith, compareOptions } = model.useState();\n\n const [previousCompare, setPreviousCompare] = React.useState(compareWith);\n const previousValue = compareOptions.find(({ value }) => value === previousCompare) ?? PREVIOUS_PERIOD_COMPARE_OPTION;\n\n const value = compareOptions.find(({ value }) => value === compareWith);\n const enabled = Boolean(value);\n\n const onClick = () => {\n if (enabled) {\n setPreviousCompare(compareWith);\n model.onClearCompare();\n } else if (!enabled) {\n model.onCompareWithChanged(previousValue.value);\n }\n };\n\n return (\n <ButtonGroup>\n <ToolbarButton\n variant=\"canvas\"\n tooltip=\"Enable time frame comparison\"\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n onClick();\n }}\n >\n <Checkbox label=\" \" value={enabled} onClick={onClick} />\n Comparison\n </ToolbarButton>\n\n {enabled ? (\n <ButtonSelect\n variant=\"canvas\"\n value={value}\n options={compareOptions}\n onChange={(v) => {\n model.onCompareWithChanged(v.value!);\n }}\n />\n ) : (\n <ToolbarButton className={styles.previewButton} disabled variant=\"canvas\" isOpen={false}>\n {previousValue.label}\n </ToolbarButton>\n )}\n </ButtonGroup>\n );\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n previewButton: css({\n '&:disabled': {\n border: `1px solid ${theme.colors.secondary.border}`,\n color: theme.colors.text.disabled,\n opacity: 1,\n },\n }),\n };\n}\n","import React from 'react';\n\nimport { LoadingState, PanelData, DataFrame } from '@grafana/data';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneLayout, SceneObject, SceneObjectState } from '../core/types';\n\ninterface SceneByFrameRepeaterState extends SceneObjectState {\n body: SceneLayout;\n getLayoutChild(data: PanelData, frame: DataFrame, frameIndex: number): SceneObject;\n}\n\nexport class SceneByFrameRepeater extends SceneObjectBase<SceneByFrameRepeaterState> {\n public constructor(state: SceneByFrameRepeaterState) {\n super(state);\n\n this.addActivationHandler(() => {\n const dataProvider = sceneGraph.getData(this);\n\n this._subs.add(\n dataProvider.subscribeToState((data) => {\n if (data.data?.state === LoadingState.Done) {\n this.performRepeat(data.data);\n }\n })\n );\n\n if (dataProvider.state.data) {\n this.performRepeat(dataProvider.state.data);\n }\n });\n }\n\n private performRepeat(data: PanelData) {\n const newChildren: SceneObject[] = [];\n\n for (let seriesIndex = 0; seriesIndex < data.series.length; seriesIndex++) {\n const layoutChild = this.state.getLayoutChild(data, data.series[seriesIndex], seriesIndex);\n newChildren.push(layoutChild);\n }\n\n this.state.body.setState({ children: newChildren });\n }\n\n public static Component = ({ model }: SceneComponentProps<SceneByFrameRepeater>) => {\n const { body } = model.useState();\n return <body.Component model={body} />;\n };\n}\n","import React from 'react';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneLayout, SceneObject, SceneObjectState } from '../core/types';\nimport { VariableDependencyConfig } from '../variables/VariableDependencyConfig';\nimport { VariableValueOption } from '../variables/types';\nimport { MultiValueVariable } from '../variables/variants/MultiValueVariable';\n\ninterface SceneByVariableRepeaterState extends SceneObjectState {\n body: SceneLayout;\n variableName: string;\n getLayoutChild(option: VariableValueOption): SceneObject;\n}\n\nexport class SceneByVariableRepeater extends SceneObjectBase<SceneByVariableRepeaterState> {\n protected _variableDependency: VariableDependencyConfig<SceneByVariableRepeaterState> = new VariableDependencyConfig(\n this,\n {\n variableNames: [this.state.variableName],\n onVariableUpdateCompleted: () => this.performRepeat(),\n }\n );\n\n public constructor(state: SceneByVariableRepeaterState) {\n super(state);\n\n this.addActivationHandler(() => this.performRepeat());\n }\n\n private performRepeat() {\n if (this._variableDependency.hasDependencyInLoadingState()) {\n return;\n }\n\n const variable = sceneGraph.lookupVariable(this.state.variableName, this);\n if (!(variable instanceof MultiValueVariable)) {\n console.error('SceneByVariableRepeater: variable is not a MultiValueVariable');\n return;\n }\n\n const values = getMultiVariableValues(variable);\n const newChildren: SceneObject[] = [];\n\n for (const option of values) {\n const layoutChild = this.state.getLayoutChild(option);\n newChildren.push(layoutChild);\n }\n\n this.state.body.setState({ children: newChildren });\n }\n\n public static Component = ({ model }: SceneComponentProps<SceneByVariableRepeater>) => {\n const { body } = model.useState();\n return <body.Component model={body} />;\n };\n}\n\nexport function getMultiVariableValues(variable: MultiValueVariable): VariableValueOption[] {\n const { value, text, options } = variable.state;\n\n if (variable.hasAllValue()) {\n return options;\n }\n\n if (Array.isArray(value) && Array.isArray(text)) {\n return value.map((v, i) => ({ value: v, label: text[i] as string }));\n }\n\n return [{ value: value as string, label: text as string }];\n}\n","import React from 'react';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneComponentProps } from '../core/types';\n\nexport class SceneControlsSpacer extends SceneObjectBase {\n public constructor() {\n super({});\n }\n\n public get Component() {\n // Skipping wrapper component for this scene object so that it renders right away\n return SceneControlsSpacer.Component;\n }\n\n public static Component = (_props: SceneComponentProps<SceneControlsSpacer>) => {\n return <div style={{ flexGrow: 1 }} />;\n };\n}\n","import { css, CSSObject } from '@emotion/css';\nimport { config } from '@grafana/runtime';\nimport React, { ComponentType, CSSProperties, useMemo } from 'react';\n\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneLayout, SceneObjectState, SceneObject } from '../../core/types';\n\nexport interface SceneFlexItemStateLike extends SceneFlexItemPlacement, SceneObjectState {}\n\nexport interface SceneFlexItemLike extends SceneObject<SceneFlexItemStateLike> {}\n\ninterface SceneFlexLayoutState extends SceneObjectState, SceneFlexItemPlacement {\n children: SceneFlexItemLike[];\n}\n\nexport class SceneFlexLayout extends SceneObjectBase<SceneFlexLayoutState> implements SceneLayout {\n public static Component = SceneFlexLayoutRenderer;\n\n public toggleDirection() {\n this.setState({\n direction: this.state.direction === 'row' ? 'column' : 'row',\n });\n }\n\n public isDraggable(): boolean {\n return false;\n }\n}\n\nfunction SceneFlexLayoutRenderer({ model, parentState }: SceneFlexItemRenderProps<SceneFlexLayout>) {\n const { children, isHidden } = model.useState();\n const style = useLayoutStyle(model.state, parentState);\n\n if (isHidden) {\n return null;\n }\n\n return (\n <div className={style}>\n {children.map((item) => {\n const Component = item.Component as ComponentType<SceneFlexItemRenderProps<SceneObject>>;\n return <Component key={item.state.key} model={item} parentState={model.state} />;\n })}\n </div>\n );\n}\n\nexport interface SceneFlexItemPlacement {\n wrap?: CSSProperties['flexWrap'];\n direction?: CSSProperties['flexDirection'];\n width?: CSSProperties['width'];\n height?: CSSProperties['height'];\n minWidth?: CSSProperties['minWidth'];\n minHeight?: CSSProperties['minHeight'];\n maxWidth?: CSSProperties['maxWidth'];\n maxHeight?: CSSProperties['maxHeight'];\n xSizing?: 'fill' | 'content';\n ySizing?: 'fill' | 'content';\n /**\n * True when the item should rendered but not visible.\n * Useful for conditional display of layout items\n */\n isHidden?: boolean;\n\n /**\n * Set direction for smaller screens. This defaults to column.\n * This equals media query theme.breakpoints.down('md')\n */\n md?: SceneFlexItemPlacement;\n}\n\nexport interface SceneFlexItemState extends SceneFlexItemPlacement, SceneObjectState {\n body: SceneObject | undefined;\n}\n\ninterface SceneFlexItemRenderProps<T> extends SceneComponentProps<T> {\n parentState?: SceneFlexItemPlacement;\n}\n\nexport class SceneFlexItem extends SceneObjectBase<SceneFlexItemState> {\n public static Component = SceneFlexItemRenderer;\n}\n\nfunction SceneFlexItemRenderer({ model, parentState }: SceneFlexItemRenderProps<SceneFlexItem>) {\n if (!parentState) {\n throw new Error('SceneFlexItem must be a child of SceneFlexLayout');\n }\n\n const { body, isHidden } = model.useState();\n const style = useLayoutItemStyle(model.state, parentState);\n\n if (!body || isHidden) {\n return null;\n }\n\n return (\n <div className={style}>\n <body.Component model={body} />\n </div>\n );\n}\nfunction applyItemStyles(style: CSSObject, state: SceneFlexItemPlacement, parentState: SceneFlexItemPlacement) {\n const parentDirection = parentState.direction ?? 'row';\n const { xSizing = 'fill', ySizing = 'fill' } = state;\n\n style.display = 'flex';\n style.position = 'relative';\n style.flexDirection = parentDirection;\n\n if (parentDirection === 'column') {\n if (state.height) {\n style.height = state.height;\n } else {\n style.flexGrow = ySizing === 'fill' ? 1 : 0;\n }\n\n if (state.width) {\n style.width = state.width;\n } else {\n style.alignSelf = xSizing === 'fill' ? 'stretch' : 'flex-start';\n }\n } else {\n if (state.height) {\n style.height = state.height;\n } else {\n style.alignSelf = ySizing === 'fill' ? 'stretch' : 'flex-start';\n }\n\n if (state.width) {\n style.width = state.width;\n } else {\n style.flexGrow = xSizing === 'fill' ? 1 : 0;\n }\n }\n\n style.minWidth = state.minWidth;\n style.maxWidth = state.maxWidth;\n style.maxHeight = state.maxHeight;\n\n // For responsive layouts to work we default use the minHeight or height of the parent\n style.minHeight = state.minHeight ?? parentState.minHeight;\n style.height = state.height ?? parentState.height;\n\n return style;\n}\n\nfunction useLayoutItemStyle(state: SceneFlexItemState, parentState: SceneFlexItemPlacement) {\n return useMemo(() => {\n const theme = config.theme2;\n const style = applyItemStyles({}, state, parentState);\n\n // Unset maxWidth for small screens by default\n style[theme.breakpoints.down('md')] = {\n maxWidth: state.md?.maxWidth ?? 'unset',\n maxHeight: state.md?.maxHeight ?? 'unset',\n height: state.md?.height ?? parentState.md?.height,\n width: state.md?.width ?? parentState.md?.width,\n };\n\n return css(style);\n }, [state, parentState]);\n}\n\nfunction useLayoutStyle(state: SceneFlexLayoutState, parentState?: SceneFlexItemPlacement) {\n return useMemo(() => {\n const { direction = 'row', wrap } = state;\n // only need breakpoints so accessing theme from config instead of context is ok\n const theme = config.theme2;\n\n const style: CSSObject = {};\n\n if (parentState) {\n applyItemStyles(style, state, parentState);\n } else {\n style.display = 'flex';\n style.flexGrow = 1;\n style.minWidth = state.minWidth;\n style.minHeight = state.minHeight;\n }\n\n style.flexDirection = direction;\n style.gap = '8px';\n style.flexWrap = wrap || 'nowrap';\n style.alignContent = 'baseline';\n style.minWidth = style.minWidth || 0;\n style.minHeight = style.minHeight || 0;\n\n style[theme.breakpoints.down('md')] = {\n flexDirection: state.md?.direction ?? 'column',\n maxWidth: state.md?.maxWidth ?? 'unset',\n maxHeight: state.md?.maxHeight ?? 'unset',\n height: state.md?.height ?? 'unset',\n width: state.md?.width ?? 'unset',\n };\n\n return css(style);\n }, [parentState, state]);\n}\n","import { css, CSSObject } from '@emotion/css';\nimport React, { ComponentType, CSSProperties, useMemo } from 'react';\n\nimport { SceneObjectBase } from '../../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneLayout, SceneObjectState, SceneObject } from '../../../core/types';\nimport { config } from '@grafana/runtime';\nimport { LazyLoader } from '../LazyLoader';\n\nexport interface SceneCSSGridLayoutState extends SceneObjectState, SceneCSSGridLayoutOptions {\n children: Array<SceneCSSGridItem | SceneObject>;\n /**\n * True when the item should rendered but not visible.\n * Useful for conditional display of layout items\n */\n isHidden?: boolean;\n /**\n * For media query for sceens smaller than md breakpoint\n */\n md?: SceneCSSGridLayoutOptions;\n /** True when the items should be lazy loaded */\n isLazy?: boolean;\n}\n\nexport interface SceneCSSGridLayoutOptions {\n /**\n * Useful for setting a height on items without specifying how many rows there will be.\n * Defaults to 320px\n */\n autoRows?: CSSProperties['gridAutoRows'];\n /**\n * This overrides the autoRows with a specific row template.\n */\n templateRows?: CSSProperties['gridTemplateRows'];\n /**\n * Defaults to repeat(auto-fit, minmax(400px, 1fr)). This pattern us useful for equally sized items with a min width of 400px\n * and dynamic max width split equally among columns.\n */\n templateColumns: CSSProperties['gridTemplateColumns'];\n /** In Grafana design system grid units (8px) */\n rowGap: number;\n /** In Grafana design system grid units (8px) */\n columnGap: number;\n justifyItems?: CSSProperties['justifyItems'];\n alignItems?: CSSProperties['alignItems'];\n justifyContent?: CSSProperties['justifyContent'];\n}\n\nexport class SceneCSSGridLayout extends SceneObjectBase<SceneCSSGridLayoutState> implements SceneLayout {\n public static Component = SceneCSSGridLayoutRenderer;\n\n public constructor(state: Partial<SceneCSSGridLayoutState>) {\n super({\n rowGap: 1,\n columnGap: 1,\n templateColumns: 'repeat(auto-fit, minmax(400px, 1fr))',\n autoRows: state.autoRows ?? `320px`,\n children: state.children ?? [],\n ...state,\n });\n }\n\n public isDraggable(): boolean {\n return false;\n }\n}\n\nfunction SceneCSSGridLayoutRenderer({ model }: SceneCSSGridItemRenderProps<SceneCSSGridLayout>) {\n const { children, isHidden, isLazy } = model.useState();\n const style = useLayoutStyle(model.state);\n\n if (isHidden) {\n return null;\n }\n\n return (\n <div className={style}>\n {children.map((item) => {\n const Component = item.Component as ComponentType<SceneCSSGridItemRenderProps<SceneObject>>;\n \n if (isLazy) {\n return (\n <LazyLoader key={item.state.key!} className={style}>\n <Component key={item.state.key} model={item} parentState={model.state} />\n </LazyLoader>\n );\n }\n return <Component key={item.state.key} model={item} parentState={model.state} />;\n })}\n </div>\n );\n}\n\nexport interface SceneCSSGridItemPlacement {\n /**\n * True when the item should rendered but not visible.\n * Useful for conditional display of layout items\n */\n isHidden?: boolean;\n /**\n * Useful for making content span across multiple rows or columns\n */\n gridColumn?: CSSProperties['gridColumn'];\n gridRow?: CSSProperties['gridRow'];\n}\n\nexport interface SceneCSSGridItemState extends SceneCSSGridItemPlacement, SceneObjectState {\n body: SceneObject | undefined;\n}\n\ninterface SceneCSSGridItemRenderProps<T> extends SceneComponentProps<T> {\n parentState?: SceneCSSGridItemPlacement;\n}\n\nexport class SceneCSSGridItem extends SceneObjectBase<SceneCSSGridItemState> {\n public static Component = SceneCSSGridItemRenderer;\n}\n\nfunction SceneCSSGridItemRenderer({ model, parentState }: SceneCSSGridItemRenderProps<SceneCSSGridItem>) {\n if (!parentState) {\n throw new Error('SceneCSSGridItem must be a child of SceneCSSGridLayout');\n }\n\n const { body, isHidden } = model.useState();\n const style = useItemStyle(model.state);\n\n if (!body || isHidden) {\n return null;\n }\n\n return (\n <div className={style}>\n <body.Component model={body} />\n </div>\n );\n}\n\nfunction useLayoutStyle(state: SceneCSSGridLayoutState) {\n return useMemo(() => {\n const {} = state;\n // only need breakpoints so accessing theme from config instead of context is ok\n const style: CSSObject = {};\n const theme = config.theme2;\n\n style.display = 'grid';\n style.gridTemplateColumns = state.templateColumns;\n style.gridTemplateRows = state.templateRows || 'unset';\n style.gridAutoRows = state.autoRows || 'unset';\n style.rowGap = theme.spacing(state.rowGap ?? 1);\n style.columnGap = theme.spacing(state.columnGap ?? 1);\n style.justifyItems = state.justifyItems || 'unset';\n style.alignItems = state.alignItems || 'unset';\n style.justifyContent = state.justifyContent || 'unset';\n style.flexGrow = 1;\n\n if (state.md) {\n style[theme.breakpoints.down('md')] = {\n gridTemplateRows: state.md?.templateRows,\n gridTemplateColumns: state.md?.templateColumns,\n rowGap: state.md.rowGap ? theme.spacing(state.md?.rowGap ?? 1) : undefined,\n columnGap: state.md.columnGap ? theme.spacing(state.md?.rowGap ?? 1) : undefined,\n justifyItems: state.md?.justifyItems,\n alignItems: state.md?.alignItems,\n justifyContent: state.md?.justifyContent,\n };\n }\n\n return css(style);\n }, [state]);\n}\n\nfunction useItemStyle(state: SceneCSSGridItemState) {\n return useMemo(() => {\n const style: CSSObject = {};\n\n style.gridColumn = state.gridColumn || 'unset';\n style.gridRow = state.gridRow || 'unset';\n // Needed for VizPanel\n style.position = 'relative';\n\n return css(style);\n }, [state]);\n}\n","import { css, cx } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\nimport { clamp, throttle } from 'lodash';\nimport React, { useCallback, useLayoutEffect, useRef } from 'react';\nimport { useUniqueId } from '../LazyLoader';\n\ninterface Props {\n handleSize?: number;\n initialSize?: number | 'auto';\n direction?: 'row' | 'column';\n primary?: 'first' | 'second';\n collapsedDefault?: boolean;\n primaryPaneStyles?: React.CSSProperties;\n secondaryPaneStyles?: React.CSSProperties;\n onDragFinished?: (size: number) => void;\n children: [React.ReactNode, React.ReactNode];\n}\n\nconst PIXELS_PER_MS = 0.3 as const;\nconst VERTICAL_KEYS = new Set(['ArrowUp', 'ArrowDown']);\nconst HORIZONTAL_KEYS = new Set(['ArrowLeft', 'ArrowRight']);\n\nconst propsForDirection = {\n row: {\n dim: 'width',\n axis: 'clientX',\n min: 'minWidth',\n max: 'maxWidth',\n },\n column: {\n dim: 'height',\n axis: 'clientY',\n min: 'minHeight',\n max: 'maxHeight',\n },\n} as const;\n\nexport function Splitter({\n direction = 'row',\n handleSize = 32,\n initialSize = 'auto',\n primaryPaneStyles,\n secondaryPaneStyles,\n onDragFinished,\n children,\n}: Props) {\n const kids = React.Children.toArray(children);\n\n const splitterRef = useRef<HTMLDivElement | null>(null);\n const firstPaneRef = useRef<HTMLDivElement | null>(null);\n const secondPaneRef = useRef<HTMLDivElement | null>(null);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const containerSize = useRef<number | null>(null);\n const primarySizeRef = useRef<'1fr' | number>('1fr');\n\n const firstPaneMeasurements = useRef<ReturnType<typeof measureElement>>(undefined);\n const savedPos = useRef<string | undefined>(undefined);\n\n const measurementProp = propsForDirection[direction].dim;\n const clientAxis = propsForDirection[direction].axis;\n const minDimProp = propsForDirection[direction].min;\n const maxDimProp = propsForDirection[direction].max;\n\n // Using a resize observer here, as with content or screen based width/height the ratio between panes might\n // change after a window resize, so ariaValueNow needs to be updated accordingly\n useResizeObserver(\n containerRef.current!,\n (entries) => {\n for (const entry of entries) {\n if (!entry.target.isSameNode(containerRef.current)) {\n return;\n }\n\n const curSize = firstPaneRef.current!.getBoundingClientRect()[measurementProp];\n const newDims = measureElement(firstPaneRef.current!);\n splitterRef.current!.ariaValueNow = `${clamp(\n ((curSize - newDims[minDimProp]) / (newDims[maxDimProp] - newDims[minDimProp])) * 100,\n 0,\n 100\n )}`;\n }\n },\n 500,\n [maxDimProp, minDimProp, direction, measurementProp]\n );\n\n const dragStart = useRef<number | null>(null);\n const onPointerDown = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n // measure left-side width\n primarySizeRef.current = firstPaneRef.current!.getBoundingClientRect()[measurementProp];\n containerSize.current = containerRef.current!.getBoundingClientRect()[measurementProp];\n\n // set position at start of drag\n dragStart.current = e[clientAxis];\n splitterRef.current!.setPointerCapture(e.pointerId);\n firstPaneMeasurements.current = measureElement(firstPaneRef.current!);\n\n savedPos.current = undefined;\n },\n [measurementProp, clientAxis]\n );\n\n const onPointerMove = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n if (dragStart.current !== null && primarySizeRef.current !== '1fr') {\n const diff = e[clientAxis] - dragStart.current;\n const dims = firstPaneMeasurements.current!;\n const newSize = clamp(primarySizeRef.current + diff, dims[minDimProp], dims[maxDimProp]);\n const newFlex = newSize / (containerSize.current! - handleSize);\n firstPaneRef.current!.style.flexGrow = `${newFlex}`;\n secondPaneRef.current!.style.flexGrow = `${1 - newFlex}`;\n const ariaValueNow = clamp(\n ((newSize - dims[minDimProp]) / (dims[maxDimProp] - dims[minDimProp])) * 100,\n 0,\n 100\n );\n\n splitterRef.current!.ariaValueNow = `${ariaValueNow}`;\n }\n },\n [handleSize, clientAxis, minDimProp, maxDimProp]\n );\n\n const onPointerUp = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n splitterRef.current!.releasePointerCapture(e.pointerId);\n dragStart.current = null;\n onDragFinished?.(parseFloat(firstPaneRef.current!.style.flexGrow));\n },\n [onDragFinished]\n );\n\n const pressedKeys = useRef(new Set<string>());\n const keysLastHandledAt = useRef<number | null>(null);\n const handlePressedKeys = useCallback(\n (time: number) => {\n const nothingPressed = pressedKeys.current.size === 0;\n if (nothingPressed) {\n keysLastHandledAt.current = null;\n return;\n } else if (primarySizeRef.current === '1fr') {\n return;\n }\n\n const dt = time - (keysLastHandledAt.current ?? time);\n const dx = dt * PIXELS_PER_MS;\n let sizeChange = 0;\n\n if (direction === 'row') {\n if (pressedKeys.current.has('ArrowLeft')) {\n sizeChange -= dx;\n }\n if (pressedKeys.current.has('ArrowRight')) {\n sizeChange += dx;\n }\n } else {\n if (pressedKeys.current.has('ArrowUp')) {\n sizeChange -= dx;\n }\n if (pressedKeys.current.has('ArrowDown')) {\n sizeChange += dx;\n }\n }\n\n const firstPaneDims = firstPaneMeasurements.current!;\n const curSize = firstPaneRef.current!.getBoundingClientRect()[measurementProp];\n const newSize = clamp(curSize + sizeChange, firstPaneDims[minDimProp], firstPaneDims[maxDimProp]);\n\n const newFlex = newSize / (containerSize.current! - handleSize);\n\n firstPaneRef.current!.style.flexGrow = `${newFlex}`;\n secondPaneRef.current!.style.flexGrow = `${1 - newFlex}`;\n const ariaValueNow =\n ((newSize - firstPaneDims[minDimProp]) / (firstPaneDims[maxDimProp] - firstPaneDims[minDimProp])) * 100;\n splitterRef.current!.ariaValueNow = `${clamp(ariaValueNow, 0, 100)}`;\n\n keysLastHandledAt.current = time;\n window.requestAnimationFrame(handlePressedKeys);\n },\n [direction, handleSize, minDimProp, maxDimProp, measurementProp]\n );\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Enter') {\n if (savedPos.current === undefined) {\n savedPos.current = firstPaneRef.current!.style.flexGrow;\n firstPaneRef.current!.style.flexGrow = '0';\n secondPaneRef.current!.style.flexGrow = '1';\n } else {\n firstPaneRef.current!.style.flexGrow = savedPos.current;\n secondPaneRef.current!.style.flexGrow = `${1 - parseFloat(savedPos.current)}`;\n savedPos.current = undefined;\n }\n return;\n } else if (e.key === 'Home') {\n firstPaneMeasurements.current = measureElement(firstPaneRef.current!);\n containerSize.current = containerRef.current!.getBoundingClientRect()[measurementProp];\n const newFlex = firstPaneMeasurements.current[minDimProp] / (containerSize.current! - handleSize);\n firstPaneRef.current!.style.flexGrow = `${newFlex}`;\n secondPaneRef.current!.style.flexGrow = `${1 - newFlex}`;\n splitterRef.current!.ariaValueNow = '0';\n return;\n } else if (e.key === 'End') {\n firstPaneMeasurements.current = measureElement(firstPaneRef.current!);\n containerSize.current = containerRef.current!.getBoundingClientRect()[measurementProp];\n const newFlex = firstPaneMeasurements.current[maxDimProp] / (containerSize.current! - handleSize);\n firstPaneRef.current!.style.flexGrow = `${newFlex}`;\n secondPaneRef.current!.style.flexGrow = `${1 - newFlex}`;\n splitterRef.current!.ariaValueNow = '100';\n return;\n }\n\n if (\n !(\n (direction === 'column' && VERTICAL_KEYS.has(e.key)) ||\n (direction === 'row' && HORIZONTAL_KEYS.has(e.key))\n ) ||\n pressedKeys.current.has(e.key)\n ) {\n return;\n }\n\n savedPos.current = undefined;\n e.preventDefault();\n e.stopPropagation();\n primarySizeRef.current = firstPaneRef.current!.getBoundingClientRect()[measurementProp];\n containerSize.current = containerRef.current!.getBoundingClientRect()[measurementProp];\n firstPaneMeasurements.current = measureElement(firstPaneRef.current!);\n const newKey = !pressedKeys.current.has(e.key);\n\n if (newKey) {\n const initiateAnimationLoop = pressedKeys.current.size === 0;\n pressedKeys.current.add(e.key);\n\n if (initiateAnimationLoop) {\n window.requestAnimationFrame(handlePressedKeys);\n }\n }\n },\n [direction, handlePressedKeys, handleSize, maxDimProp, measurementProp, minDimProp]\n );\n\n const onKeyUp = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (\n (direction === 'row' && !HORIZONTAL_KEYS.has(e.key)) ||\n (direction === 'column' && !VERTICAL_KEYS.has(e.key))\n ) {\n return;\n }\n\n pressedKeys.current.delete(e.key);\n onDragFinished?.(parseFloat(firstPaneRef.current!.style.flexGrow));\n },\n [direction, onDragFinished]\n );\n\n const onDoubleClick = useCallback(() => {\n firstPaneRef.current!.style.flexGrow = '0.5';\n secondPaneRef.current!.style.flexGrow = '0.5';\n const dim = measureElement(firstPaneRef.current!);\n firstPaneMeasurements.current = dim;\n primarySizeRef.current = firstPaneRef.current!.getBoundingClientRect()[measurementProp];\n splitterRef.current!.ariaValueNow = `${\n ((primarySizeRef.current - dim[minDimProp]) / (dim[maxDimProp] - dim[minDimProp])) * 100\n }`;\n }, [maxDimProp, measurementProp, minDimProp]);\n\n const onBlur = useCallback(() => {\n // If focus is lost while keys are held, stop changing panel sizes\n if (pressedKeys.current.size > 0) {\n pressedKeys.current.clear();\n dragStart.current = null;\n onDragFinished?.(parseFloat(firstPaneRef.current!.style.flexGrow));\n }\n }, [onDragFinished]);\n\n const styles = useStyles2(getStyles);\n const id = useUniqueId();\n\n const secondAvailable = kids.length === 2;\n const visibilitySecond = secondAvailable ? 'visible' : 'hidden';\n\n return (\n <div\n ref={containerRef}\n className={styles.container}\n style={{\n flexDirection: direction,\n }}\n >\n <div\n ref={firstPaneRef}\n className={styles.panel}\n style={{\n flexGrow: initialSize === 'auto' ? 0.5 : clamp(initialSize, 0, 1),\n [minDimProp]: 'min-content',\n ...primaryPaneStyles,\n }}\n id={`start-panel-${id}`}\n >\n {kids[0]}\n </div>\n\n {kids[1] && (\n <>\n <div\n ref={splitterRef}\n style={{ [measurementProp]: `${handleSize}px` }}\n className={cx(styles.handle, { [styles.handleHorizontal]: direction === 'column' })}\n onPointerUp={onPointerUp}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n onDoubleClick={onDoubleClick}\n onBlur={onBlur}\n role=\"separator\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={50}\n aria-controls={`start-panel-${id}`}\n aria-label=\"Pane resize widget\"\n tabIndex={0}\n ></div>\n\n <div\n ref={secondPaneRef}\n className={styles.panel}\n style={{\n flexGrow: initialSize === 'auto' ? 0.5 : clamp(1 - initialSize, 0, 1),\n [minDimProp]: 'min-content',\n visibility: `${visibilitySecond}`,\n ...secondaryPaneStyles,\n }}\n id={`end-panel-${id}`}\n >\n {kids[1]}\n </div>\n </>\n )}\n </div>\n );\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n handle: css({\n cursor: 'col-resize',\n position: 'relative',\n flexShrink: 0,\n userSelect: 'none',\n\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n backgroundColor: theme.colors.primary.main,\n left: '50%',\n transform: 'translate(-50%)',\n top: 0,\n height: '100%',\n width: '1px',\n opacity: 0,\n transition: 'opacity ease-in-out 0.2s',\n },\n\n '&::after': {\n content: '\"\"',\n width: '4px',\n borderRadius: '4px',\n backgroundColor: theme.colors.border.weak,\n transition: 'background-color ease-in-out 0.2s',\n height: '50%',\n top: 'calc(50% - (50%) / 2)',\n transform: 'translateX(-50%)',\n position: 'absolute',\n left: '50%',\n },\n\n '&:hover, &:focus-visible': {\n outline: 'none',\n '&::before': {\n opacity: 1,\n },\n\n '&::after': {\n backgroundColor: theme.colors.primary.main,\n },\n },\n }),\n handleHorizontal: css({\n cursor: 'row-resize',\n\n '&::before': {\n left: 'inherit',\n transform: 'translateY(-50%)',\n top: '50%',\n height: '1px',\n width: '100%',\n },\n\n '&::after': {\n width: '50%',\n height: '4px',\n top: '50%',\n transform: 'translateY(-50%)',\n left: 'calc(50% - (50%) / 2)',\n },\n }),\n container: css({\n display: 'flex',\n width: '100%',\n flexGrow: 1,\n overflow: 'hidden',\n }),\n panel: css({ display: 'flex', position: 'relative', flexBasis: 0 }),\n };\n}\n\ntype MeasureR<T> = T extends HTMLElement\n ? { minWidth: number; maxWidth: number; minHeight: number; maxHeight: number }\n : T extends null\n ? undefined\n : never;\ntype HTMLElementOrNull = HTMLElement | null;\n\nfunction measureElement<T extends HTMLElementOrNull>(ref: T): MeasureR<T> {\n if (ref === null) {\n return undefined as MeasureR<T>;\n }\n\n const savedBodyOverflow = document.body.style.overflow;\n const savedWidth = ref.style.width;\n const savedHeight = ref.style.height;\n const savedFlex = ref.style.flexGrow;\n document.body.style.overflow = 'hidden';\n ref.style.flexGrow = '0';\n const { width: minWidth, height: minHeight } = ref.getBoundingClientRect();\n\n ref.style.flexGrow = '100';\n const { width: maxWidth, height: maxHeight } = ref.getBoundingClientRect();\n\n document.body.style.overflow = savedBodyOverflow;\n ref.style.width = savedWidth;\n ref.style.height = savedHeight;\n ref.style.flexGrow = savedFlex;\n\n return { minWidth, maxWidth, minHeight, maxHeight } as MeasureR<T>;\n}\n\nfunction useResizeObserver(\n target: Element,\n cb: (entries: ResizeObserverEntry[]) => void,\n throttleWait = 0,\n deps?: React.DependencyList\n) {\n const throttledCallback = throttle(cb, throttleWait);\n\n useLayoutEffect(() => {\n if (!target) {\n return;\n }\n\n const resizeObserver = new ResizeObserver(throttledCallback);\n\n resizeObserver.observe(target, { box: 'device-pixel-content-box' });\n return () => resizeObserver.disconnect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n}\n","import React, { ComponentType } from 'react';\n\nimport { SceneComponentProps, SceneObjectState, SceneObject } from '../../../core/types';\nimport { SceneFlexItemPlacement } from '../SceneFlexLayout';\nimport { SplitLayout } from './SplitLayout';\nimport { Splitter } from './Splitter';\n\nexport function SplitLayoutRenderer({ model }: SceneFlexItemRenderProps<SplitLayout>) {\n const { primary, secondary, direction, isHidden, initialSize, primaryPaneStyles, secondaryPaneStyles } =\n model.useState();\n\n if (isHidden) {\n return null;\n }\n\n const Prim = primary.Component as ComponentType<SceneFlexItemRenderProps<SceneObject>>;\n const Sec = secondary?.Component as ComponentType<SceneFlexItemRenderProps<SceneObject>>;\n let startSize = secondary ? initialSize : 1;\n\n return (\n <Splitter\n direction={direction}\n initialSize={startSize ?? 0.5}\n primaryPaneStyles={primaryPaneStyles}\n secondaryPaneStyles={secondaryPaneStyles}\n >\n <Prim key={primary.state.key} model={primary} parentState={model.state} />\n {Sec && secondary && <Sec key={secondary.state.key} model={secondary} parentState={model.state} />}\n </Splitter>\n );\n}\n\nexport interface SceneFlexItemState extends SceneFlexItemPlacement, SceneObjectState {\n body: SceneObject | undefined;\n}\n\ninterface SceneFlexItemRenderProps<T> extends SceneComponentProps<T> {\n parentState?: SceneFlexItemPlacement;\n}\n","import { CSSProperties } from 'react';\nimport { SceneObjectBase } from '../../../core/SceneObjectBase';\nimport { SceneObjectState } from '../../../core/types';\nimport { SceneFlexItemPlacement, SceneFlexItemLike } from '../SceneFlexLayout';\nimport { SplitLayoutRenderer } from './SplitLayoutRenderer';\n\ninterface SplitLayoutState extends SceneObjectState, SceneFlexItemPlacement {\n primary: SceneFlexItemLike;\n secondary?: SceneFlexItemLike;\n direction: 'row' | 'column';\n initialSize?: number;\n primaryPaneStyles?: CSSProperties;\n secondaryPaneStyles?: CSSProperties;\n}\n\nexport class SplitLayout extends SceneObjectBase<SplitLayoutState> {\n public static Component = SplitLayoutRenderer;\n\n public toggleDirection() {\n this.setState({\n direction: this.state.direction === 'row' ? 'column' : 'row',\n });\n }\n\n public isDraggable(): boolean {\n return false;\n }\n}\n","import React from 'react';\nimport { Route, Switch } from 'react-router-dom';\n\nimport { DataRequestEnricher, SceneComponentProps } from '../../core/types';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneAppState } from './types';\nimport { renderSceneComponentWithRouteProps } from './utils';\n\n/**\n * Responsible for top level pages routing\n */\nexport class SceneApp extends SceneObjectBase<SceneAppState> implements DataRequestEnricher {\n public enrichDataRequest() {\n return {\n app: this.state.name || 'app',\n };\n }\n\n public static Component = ({ model }: SceneComponentProps<SceneApp>) => {\n const { pages } = model.useState();\n\n return (\n <Switch>\n {pages.map((page) => (\n <Route\n key={page.state.url}\n exact={false}\n path={page.state.url}\n render={(props) => renderSceneComponentWithRouteProps(page, props)}\n ></Route>\n ))}\n </Switch>\n );\n };\n}\n\nconst sceneAppCache = new Map<object, SceneApp>();\n\n/**\n * Caches the the resulting SceneApp returned by the factory function so that it's only called once during the lifetime of the browser tab\n */\nexport function useSceneApp(factory: () => SceneApp) {\n const cachedApp = sceneAppCache.get(factory);\n\n if (cachedApp) {\n return cachedApp;\n }\n\n const newApp = factory();\n sceneAppCache.set(factory, newApp);\n\n return newApp;\n}\n","import React from 'react';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectState } from '../core/types';\n\nexport interface SceneReactObjectState<TProps = {}> extends SceneObjectState {\n /**\n * React component to render\n */\n component?: React.ComponentType<TProps>;\n /**\n * Props to pass to the component\n */\n props?: TProps;\n /**\n * Alternative to component and props is just to pass a React node\n */\n reactNode?: React.ReactNode;\n}\n\n/**\n * A utility object that can be used to render any React component or ReactNode\n */\nexport class SceneReactObject<TProps = {}> extends SceneObjectBase<SceneReactObjectState<TProps>> {\n public static Component = ({ model }: SceneComponentProps<SceneReactObject>) => {\n const { component: Component, props, reactNode } = model.useState();\n\n if (Component) {\n return <Component {...props} />;\n }\n\n if (reactNode) {\n return reactNode;\n }\n\n return null;\n };\n}\n","import { css } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { Input, JSONFormatter, useStyles2 } from '@grafana/ui';\nimport { isArray, isPlainObject } from 'lodash';\nimport React from 'react';\nimport { isSceneObject, SceneObject } from '../../core/types';\n\nexport interface Props {\n node: SceneObject;\n}\n\nexport function DebugDetails({ node }: Props) {\n const state = node.useState();\n const styles = useStyles2(getStyles);\n\n return (\n <div className={styles.container}>\n {Object.keys(state).map((key) => (\n <div className={styles.row} key={key}>\n <div className={styles.keyName}>{key}</div>\n <div className={styles.value}>{renderValue(key, (state as any)[key], node)}</div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction renderValue(key: string, value: any, node: SceneObject) {\n if (value === null) {\n return 'null';\n }\n\n switch (typeof value) {\n case 'number':\n return (\n <Input\n type=\"number\"\n defaultValue={value}\n onBlur={(evt) => node.setState({ [key]: evt.currentTarget.valueAsNumber })}\n />\n );\n case 'string':\n return (\n <Input type=\"text\" defaultValue={value} onBlur={(evt) => node.setState({ [key]: evt.currentTarget.value })} />\n );\n case 'object':\n if (isSceneObject(value)) {\n return value.constructor.name;\n }\n if (isPlainObject(value) || isArray(value)) {\n return <JSONFormatter json={value} open={0} />;\n }\n return String(value);\n default:\n return typeof value;\n }\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n container: css({\n flexGrow: 1,\n display: 'flex',\n gap: theme.spacing(0.5),\n flexDirection: 'column',\n }),\n row: css({\n display: 'flex',\n gap: theme.spacing(2),\n }),\n keyName: css({\n display: 'flex',\n flexGrow: '0',\n width: 120,\n alignItems: 'center',\n height: theme.spacing(theme.components.height.md),\n }),\n value: css({\n flexGrow: 1,\n minHeight: theme.spacing(theme.components.height.md),\n display: 'flex',\n alignItems: 'center',\n }),\n };\n}\n","import { css, cx } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\nimport React, { ReactNode } from 'react';\nimport { SceneObject } from '../../core/types';\n\nexport interface Props {\n node: SceneObject;\n selectedObject?: SceneObject;\n onSelect: (node: SceneObject) => void;\n}\n\nexport function DebugTreeNode({ node, selectedObject, onSelect }: Props) {\n const styles = useStyles2(getStyles);\n const children: ReactNode[] = [];\n const isSelected = node === selectedObject;\n\n node.forEachChild((child) => {\n children.push(\n <DebugTreeNode node={child} key={child.state.key} selectedObject={selectedObject} onSelect={onSelect} />\n );\n });\n\n return (\n <div className={styles.container}>\n <div className={cx(styles.name, isSelected && styles.selected)} onClick={() => onSelect(node)}>\n {node.constructor.name}\n </div>\n <div className={styles.children}>{children}</div>\n </div>\n );\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n container: css({\n flexGrow: 1,\n display: 'flex',\n gap: theme.spacing(0.5),\n flexDirection: 'column',\n }),\n name: css({\n flexGrow: 1,\n display: 'flex',\n gap: theme.spacing(1),\n fontSize: theme.typography.bodySmall.fontSize,\n cursor: 'pointer',\n padding: theme.spacing(0, 1),\n borderRadius: theme.shape.borderRadius(2),\n position: 'relative',\n '&:hover': {\n background: theme.colors.background.secondary,\n },\n }),\n selected: css({\n '&::before': {\n display: 'block',\n content: \"' '\",\n position: 'absolute',\n left: 0,\n width: 4,\n bottom: 2,\n top: 2,\n borderRadius: theme.shape.radius.default,\n backgroundImage: theme.colors.gradients.brandVertical,\n },\n }),\n children: css({\n flexGrow: 1,\n display: 'flex',\n flexDirection: 'column',\n paddingLeft: theme.spacing(1),\n }),\n };\n}\n","import { css } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { CustomScrollbar, Drawer, ToolbarButton, useStyles2 } from '@grafana/ui';\nimport React, { useState } from 'react';\n\nimport { SceneObject } from '../../core/types';\nimport { DebugDetails } from './DebugDetails';\nimport { DebugTreeNode } from './DebugTreeNode';\n\nexport interface Props {\n scene: SceneObject;\n}\n\n/**\n * @internal\n * Please don't use from plugins directly.\n * This is already exposed via SceneAppPage and the ?scene-debugger query parameter.\n *\n * This is only exported so that core dashboards can use it.\n */\nexport function SceneDebugger({ scene }: Props) {\n const styles = useStyles2(getStyles);\n const [isOpen, setIsOpen] = useState(false);\n const [selectedObject, setSelectedObject] = useState<SceneObject>();\n\n return (\n <>\n <ToolbarButton variant=\"canvas\" icon=\"bug\" onClick={() => setIsOpen(true)} />\n {isOpen && (\n <Drawer title=\"Scene debugger\" onClose={() => setIsOpen(false)} size=\"lg\">\n <div className={styles.panes}>\n <div className={styles.pane1}>\n <div className={styles.paneHeading}>Scene graph</div>\n <CustomScrollbar autoHeightMin={'100%'}>\n <div className={styles.treeWrapper}>\n <DebugTreeNode node={scene} selectedObject={selectedObject} onSelect={setSelectedObject} />\n </div>\n </CustomScrollbar>\n </div>\n <div className={styles.pane2}>\n <div className={styles.paneHeading}>Object details</div>\n {selectedObject && <DebugDetails node={selectedObject} />}\n </div>\n </div>\n </Drawer>\n )}\n </>\n );\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n panes: css({\n flexGrow: 1,\n display: 'flex',\n height: '100%',\n flexDirection: 'row',\n marginTop: theme.spacing(-2),\n }),\n pane1: css({\n flexGrow: 0,\n display: 'flex',\n height: '100%',\n flexDirection: 'column',\n borderRight: `1px solid ${theme.colors.border.weak}`,\n }),\n pane2: css({\n flexGrow: 1,\n display: 'flex',\n minHeight: '100%',\n flexDirection: 'column',\n paddingLeft: theme.spacing(2),\n }),\n treeWrapper: css({\n paddingRight: theme.spacing(2),\n height: '100%',\n marginLeft: theme.spacing(-1),\n }),\n paneHeading: css({\n padding: theme.spacing(1, 0),\n fontWeight: theme.typography.fontWeightMedium,\n }),\n };\n}\n","import { NavModelItem, UrlQueryMap } from '@grafana/data';\nimport { PluginPage } from '@grafana/runtime';\nimport React, { useEffect, useLayoutEffect } from 'react';\n\nimport { RouteComponentProps } from 'react-router-dom';\nimport { SceneObject } from '../../core/types';\nimport { SceneDebugger } from '../SceneDebugger/SceneDebugger';\nimport { SceneAppPage } from './SceneAppPage';\nimport { SceneAppDrilldownView, SceneAppPageLike } from './types';\nimport { getUrlWithAppState, renderSceneComponentWithRouteProps, useAppQueryParams } from './utils';\nimport { useUrlSync } from '../../services/useUrlSync';\n\nexport interface Props {\n page: SceneAppPageLike;\n // activeTab?: SceneAppPageLike;\n routeProps: RouteComponentProps;\n}\n\nexport function SceneAppPageView({ page, routeProps }: Props) {\n const containerPage = getParentPageIfTab(page);\n const containerState = containerPage.useState();\n const params = useAppQueryParams();\n const scene = page.getScene(routeProps.match);\n const isInitialized = containerState.initializedScene === scene;\n const {layout} = page.state;\n\n useLayoutEffect(() => {\n // Before rendering scene components, we are making sure the URL sync is enabled for.\n if (!isInitialized) {\n containerPage.initializeScene(scene);\n }\n }, [scene, containerPage, isInitialized]);\n\n useEffect(() => {\n // Clear initializedScene when unmounting\n return () => containerPage.setState({ initializedScene: undefined });\n }, [containerPage]);\n\n const urlSyncInitialized = useUrlSync(containerPage);\n\n if (!isInitialized && !urlSyncInitialized) {\n return null;\n }\n\n const pageNav: NavModelItem = {\n text: containerState.title,\n img: containerState.titleImg,\n icon: containerState.titleIcon,\n url: getUrlWithAppState(containerState.url, containerState.preserveUrlKeys),\n hideFromBreadcrumbs: containerState.hideFromBreadcrumbs,\n parentItem: getParentBreadcrumbs(\n containerState.getParentPage ? containerState.getParentPage() : containerPage.parent,\n params\n ),\n };\n\n if (containerState.tabs) {\n pageNav.children = containerState.tabs.map((tab) => {\n return {\n text: tab.state.title,\n icon: tab.state.titleIcon,\n tabSuffix: tab.state.tabSuffix,\n active: page === tab,\n url: getUrlWithAppState(tab.state.url, tab.state.preserveUrlKeys),\n parentItem: pageNav,\n };\n });\n }\n\n let pageActions: React.ReactNode[] = [];\n if (containerState.controls) {\n pageActions = containerState.controls.map((control) => (\n <control.Component model={control} key={control.state.key} />\n ));\n }\n\n if (params['scene-debugger']) {\n pageActions.push(<SceneDebugger scene={containerPage} key={'scene-debugger'} />);\n }\n\n return (\n <PluginPage\n layout={layout}\n pageNav={pageNav}\n actions={pageActions}\n renderTitle={containerState.renderTitle}\n subTitle={containerState.subTitle}\n >\n <scene.Component model={scene} />\n </PluginPage>\n );\n}\n\n/**\n * For pages that are \"tabs\" this will return the parent page\n */\nfunction getParentPageIfTab(page: SceneAppPageLike) {\n if (page.parent instanceof SceneAppPage) {\n return page.parent;\n }\n\n return page;\n}\n\nfunction getParentBreadcrumbs(parent: SceneObject | undefined, params: UrlQueryMap): NavModelItem | undefined {\n if (parent instanceof SceneAppPage) {\n return {\n text: parent.state.title,\n url: getUrlWithAppState(parent.state.url, parent.state.preserveUrlKeys),\n hideFromBreadcrumbs: parent.state.hideFromBreadcrumbs,\n parentItem: getParentBreadcrumbs(\n parent.state.getParentPage ? parent.state.getParentPage() : parent.parent,\n params\n ),\n };\n }\n\n return undefined;\n}\n\nexport interface SceneAppDrilldownViewRenderProps {\n drilldown: SceneAppDrilldownView;\n parent: SceneAppPageLike;\n routeProps: RouteComponentProps;\n}\n\nexport function SceneAppDrilldownViewRender({ drilldown, parent, routeProps }: SceneAppDrilldownViewRenderProps) {\n return renderSceneComponentWithRouteProps(parent.getDrilldownPage(drilldown, routeProps.match), routeProps);\n}\n","import React from 'react';\nimport { Route, RouteComponentProps, Switch } from 'react-router-dom';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObject, isDataRequestEnricher } from '../../core/types';\nimport { EmbeddedScene } from '../EmbeddedScene';\nimport { SceneFlexItem, SceneFlexLayout } from '../layout/SceneFlexLayout';\nimport { SceneReactObject } from '../SceneReactObject';\nimport { SceneAppDrilldownViewRender, SceneAppPageView } from './SceneAppPageView';\nimport { SceneAppDrilldownView, SceneAppPageLike, SceneAppPageState, SceneRouteMatch } from './types';\nimport { renderSceneComponentWithRouteProps } from './utils';\n\n/**\n * Responsible for page's drilldown & tabs routing\n */\nexport class SceneAppPage extends SceneObjectBase<SceneAppPageState> implements SceneAppPageLike {\n public static Component = SceneAppPageRenderer;\n private _sceneCache = new Map<string, EmbeddedScene>();\n private _drilldownCache = new Map<string, SceneAppPageLike>();\n\n public constructor(state: SceneAppPageState) {\n super(state);\n }\n\n public initializeScene(scene: EmbeddedScene) {\n this.setState({ initializedScene: scene });\n }\n\n public getScene(routeMatch: SceneRouteMatch): EmbeddedScene {\n let scene = this._sceneCache.get(routeMatch.url);\n\n if (scene) {\n return scene;\n }\n\n if (!this.state.getScene) {\n throw new Error('Missing getScene on SceneAppPage ' + this.state.title);\n }\n\n scene = this.state.getScene(routeMatch);\n this._sceneCache.set(routeMatch.url, scene);\n\n return scene;\n }\n\n public getDrilldownPage(drilldown: SceneAppDrilldownView, routeMatch: SceneRouteMatch<{}>): SceneAppPageLike {\n let page = this._drilldownCache.get(routeMatch!.url);\n if (page) {\n return page;\n }\n\n page = drilldown.getPage(routeMatch, this);\n this._drilldownCache.set(routeMatch!.url, page);\n\n return page;\n }\n\n public enrichDataRequest(source: SceneObject) {\n if (this.state.getParentPage) {\n return this.state.getParentPage().enrichDataRequest(source);\n }\n\n if (!this.parent) {\n return null;\n }\n\n const root = this.getRoot();\n\n if (isDataRequestEnricher(root)) {\n return root.enrichDataRequest(source);\n }\n\n return null;\n }\n}\n\nexport interface SceneAppPageRendererProps extends SceneComponentProps<SceneAppPage> {\n routeProps: RouteComponentProps;\n}\n\nfunction SceneAppPageRenderer({ model, routeProps }: SceneAppPageRendererProps) {\n const { tabs, drilldowns } = model.useState();\n const routes: React.ReactNode[] = [];\n\n if (tabs && tabs.length > 0) {\n for (let tabIndex = 0; tabIndex < tabs.length; tabIndex++) {\n const tab = tabs[tabIndex];\n\n // Add first tab as a default route, this makes it possible for the first tab to render with the url of the parent page\n if (tabIndex === 0) {\n routes.push(\n <Route\n exact={true}\n key={model.state.url}\n path={model.state.routePath ?? model.state.url}\n render={(props) => renderSceneComponentWithRouteProps(tab, props)}\n ></Route>\n );\n }\n\n routes.push(\n <Route\n exact={true}\n key={tab.state.url}\n path={tab.state.routePath ?? tab.state.url}\n render={(props) => renderSceneComponentWithRouteProps(tab, props)}\n ></Route>\n );\n\n if (tab.state.drilldowns) {\n for (const drilldown of tab.state.drilldowns) {\n routes.push(\n <Route\n exact={false}\n key={drilldown.routePath}\n path={drilldown.routePath}\n render={(props) => <SceneAppDrilldownViewRender drilldown={drilldown} parent={tab} routeProps={props} />}\n ></Route>\n );\n }\n }\n }\n }\n\n if (drilldowns) {\n for (const drilldown of drilldowns) {\n routes.push(\n <Route\n key={drilldown.routePath}\n exact={false}\n path={drilldown.routePath}\n render={(props) => <SceneAppDrilldownViewRender drilldown={drilldown} parent={model} routeProps={props} />}\n ></Route>\n );\n }\n }\n\n if (!tabs && isCurrentPageRouteMatch(model, routeProps.match)) {\n return <SceneAppPageView page={model} routeProps={routeProps} />;\n }\n\n routes.push(getFallbackRoute(model, routeProps));\n\n return <Switch>{routes}</Switch>;\n}\n\nfunction getFallbackRoute(page: SceneAppPage, routeProps: RouteComponentProps) {\n return (\n <Route\n key={'fallback route'}\n render={(props) => {\n const fallbackPage = page.state.getFallbackPage?.() ?? getDefaultFallbackPage();\n return <SceneAppPageView page={fallbackPage} routeProps={routeProps} />;\n }}\n ></Route>\n );\n}\n\nfunction isCurrentPageRouteMatch(page: SceneAppPage, match: SceneRouteMatch) {\n if (!match.isExact) {\n return false;\n }\n\n // current page matches the route url\n if (match.url === page.state.url) {\n return true;\n }\n\n // check if we are a tab and the first tab, then we should also render on the parent url\n if (\n page.parent instanceof SceneAppPage &&\n page.parent.state.tabs![0] === page &&\n page.parent.state.url === match.url\n ) {\n return true;\n }\n\n return false;\n}\n\nfunction getDefaultFallbackPage() {\n return new SceneAppPage({\n url: '',\n title: 'Not found',\n subTitle: 'The url did not match any page',\n getScene: () => {\n return new EmbeddedScene({\n body: new SceneFlexLayout({\n direction: 'column',\n children: [\n new SceneFlexItem({\n body: new SceneReactObject({\n component: () => {\n return (\n <div data-testid=\"default-fallback-content\">\n If you found your way here using a link then there might be a bug in this application.\n </div>\n );\n },\n }),\n }),\n ],\n }),\n });\n },\n });\n}\n","import { MatcherConfig } from '@grafana/schema';\nimport { StandardFieldConfig, StandardFieldConfigInterface } from './types';\n\n// Base class for standard field config overrides builder methods\nexport class StandardFieldConfigOverridesBuilder<T extends StandardFieldConfigOverridesBuilder<T>>\n implements StandardFieldConfigInterface<StandardFieldConfig, T, 'override'>\n{\n protected _overrides: Array<{ matcher: MatcherConfig; properties: Array<{ id: string; value: unknown }> }> = [];\n\n public overrideColor(value: StandardFieldConfig['color']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'color', value });\n return this as unknown as T;\n }\n\n public overrideDecimals(value: StandardFieldConfig['decimals']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'decimals', value });\n return this as unknown as T;\n }\n\n public overrideDisplayName(value: StandardFieldConfig['displayName']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'displayName', value });\n return this as unknown as T;\n }\n\n public overrideFilterable(value: StandardFieldConfig['filterable']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'filterable', value });\n return this as unknown as T;\n }\n\n public overrideLinks(value: StandardFieldConfig['links']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'links', value });\n return this as unknown as T;\n }\n\n public overrideMappings(value: StandardFieldConfig['mappings']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'mappings', value });\n return this as unknown as T;\n }\n\n public overrideMax(value: StandardFieldConfig['max']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'max', value });\n return this as unknown as T;\n }\n\n public overrideMin(value: StandardFieldConfig['min']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'min', value });\n return this as unknown as T;\n }\n\n public overrideNoValue(value: StandardFieldConfig['noValue']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'noValue', value });\n return this as unknown as T;\n }\n\n public overrideThresholds(value: StandardFieldConfig['thresholds']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'thresholds', value });\n return this as unknown as T;\n }\n\n public overrideUnit(value: StandardFieldConfig['unit']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'unit', value });\n return this as unknown as T;\n }\n}\n","import { FieldMatcherID, FieldType, FieldValueMatcherConfig } from '@grafana/data';\nimport { MatcherConfig } from '@grafana/schema';\nimport { getCompareSeriesRefId } from '../../utils/getCompareSeriesRefId';\nimport { StandardFieldConfigOverridesBuilder } from './StandardFieldConfigBuilders';\n\nexport class FieldConfigOverridesBuilder<TFieldConfig> extends StandardFieldConfigOverridesBuilder<\n FieldConfigOverridesBuilder<TFieldConfig>\n> {\n public match(matcher: MatcherConfig): this {\n this._overrides.push({ matcher, properties: [] });\n return this;\n }\n\n public matchFieldsWithName(name: string): this {\n this._overrides.push({\n matcher: {\n id: FieldMatcherID.byName,\n\n options: name,\n },\n properties: [],\n });\n return this;\n }\n\n public matchFieldsWithNameByRegex(regex: string): this {\n this._overrides.push({\n matcher: {\n id: FieldMatcherID.byRegexp,\n options: regex,\n },\n properties: [],\n });\n return this;\n }\n\n public matchFieldsByType(fieldType: FieldType): this {\n this._overrides.push({\n matcher: {\n id: FieldMatcherID.byType,\n options: fieldType,\n },\n properties: [],\n });\n return this;\n }\n\n public matchFieldsByQuery(refId: string): this {\n this._overrides.push({\n matcher: {\n id: FieldMatcherID.byFrameRefID,\n options: refId,\n },\n properties: [],\n });\n return this;\n }\n\n public matchFieldsByValue(options: FieldValueMatcherConfig): this {\n this._overrides.push({\n matcher: {\n id: FieldMatcherID.byValue,\n options,\n },\n properties: [],\n });\n return this;\n }\n\n public matchComparisonQuery(refId: string): this {\n return this.matchFieldsByQuery(getCompareSeriesRefId(refId));\n }\n\n public overrideCustomFieldConfig<T extends TFieldConfig, K extends keyof T>(id: K, value: T[K]): this {\n const _id = `custom.${String(id)}`;\n const last = this._overrides[this._overrides.length - 1];\n last.properties.push({ id: _id, value });\n return this;\n }\n\n public build() {\n return this._overrides;\n }\n}\n","import { FieldConfigSource } from '@grafana/data';\nimport { cloneDeep, merge } from 'lodash';\nimport { DeepPartial } from '../types';\nimport { FieldConfigOverridesBuilder } from './FieldConfigOverridesBuilder';\nimport { StandardFieldConfig, StandardFieldConfigInterface } from './types';\n\nexport class FieldConfigBuilder<TFieldConfig extends {}>\n implements StandardFieldConfigInterface<StandardFieldConfig, FieldConfigBuilder<TFieldConfig>, 'set'>\n{\n private _fieldConfig: FieldConfigSource<DeepPartial<TFieldConfig>> = {\n defaults: {},\n overrides: [],\n };\n private _overridesBuilder = new FieldConfigOverridesBuilder<TFieldConfig>();\n\n public constructor(private defaultFieldConfig?: () => TFieldConfig) {\n this.setDefaults();\n }\n\n private setDefaults() {\n const fieldConfig: FieldConfigSource<TFieldConfig> = {\n defaults: {\n custom: this.defaultFieldConfig ? cloneDeep(this.defaultFieldConfig()) : ({} as TFieldConfig),\n }, // use field config factory that will provide default field config\n overrides: [],\n };\n\n this._fieldConfig = fieldConfig;\n }\n /**\n * Set color.\n */\n public setColor(color: StandardFieldConfig['color']): this {\n return this.setFieldConfigDefaults('color', color);\n }\n\n /**\n * Set number of decimals to show.\n */\n public setDecimals(decimals: StandardFieldConfig['decimals']): this {\n return this.setFieldConfigDefaults('decimals', decimals);\n }\n\n /**\n * Set field display name.\n */\n public setDisplayName(displayName: StandardFieldConfig['displayName']): this {\n return this.setFieldConfigDefaults('displayName', displayName);\n }\n\n /**\n * Set the standard field config property filterable.\n */\n public setFilterable(filterable: StandardFieldConfig['filterable']): this {\n return this.setFieldConfigDefaults('filterable', filterable);\n }\n\n /**\n * Set data links.\n */\n public setLinks(links: StandardFieldConfig['links']): this {\n return this.setFieldConfigDefaults('links', links);\n }\n\n /**\n * Set value mappings.\n */\n public setMappings(mappings: StandardFieldConfig['mappings']): this {\n return this.setFieldConfigDefaults('mappings', mappings);\n }\n\n /**\n * Set the standard field config property max.\n */\n public setMax(max: StandardFieldConfig['max']): this {\n return this.setFieldConfigDefaults('max', max);\n }\n\n /**\n * Set the standard field config property min.\n */\n public setMin(min: StandardFieldConfig['min']): this {\n return this.setFieldConfigDefaults('min', min);\n }\n\n /**\n * Set the standard field config property noValue.\n */\n public setNoValue(noValue: StandardFieldConfig['noValue']): this {\n return this.setFieldConfigDefaults('noValue', noValue);\n }\n\n /**\n * Set the standard field config property thresholds.\n */\n public setThresholds(thresholds: StandardFieldConfig['thresholds']): this {\n return this.setFieldConfigDefaults('thresholds', thresholds);\n }\n\n /**\n * Set the standard field config property unit.\n */\n public setUnit(unit: StandardFieldConfig['unit']): this {\n return this.setFieldConfigDefaults('unit', unit);\n }\n\n /**\n * Set an individual custom field config value. This will merge the value with the existing custom field config.\n */\n public setCustomFieldConfig<T extends TFieldConfig, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._fieldConfig.defaults = {\n ...this._fieldConfig.defaults,\n custom: merge(this._fieldConfig.defaults.custom, { [id]: value }),\n };\n\n return this;\n }\n\n /**\n * Configure overrides for the field config. This will merge the overrides with the existing overrides.\n */\n public setOverrides(builder: (b: FieldConfigOverridesBuilder<TFieldConfig>) => void): this {\n builder(this._overridesBuilder);\n return this;\n }\n\n public setFieldConfigDefaults<T extends keyof StandardFieldConfig>(key: T, value: StandardFieldConfig[T]) {\n this._fieldConfig.defaults = {\n ...this._fieldConfig.defaults,\n [key]: value,\n };\n return this;\n }\n\n public build() {\n return {\n defaults: this._fieldConfig.defaults,\n overrides: this._overridesBuilder.build(),\n };\n }\n}\n","import { cloneDeep, merge } from 'lodash';\nimport { DeepPartial } from '../types';\n\nexport class PanelOptionsBuilder<TOptions extends {} = {}> {\n private _options: DeepPartial<TOptions> = {};\n\n public constructor(private defaultOptions?: () => Partial<TOptions>) {\n this.setDefaults();\n }\n\n private setDefaults() {\n this._options = this.defaultOptions ? cloneDeep(this.defaultOptions()) : ({} as TOptions);\n }\n\n /**\n * Set an individual panel option. This will merge the value with the existing options.\n */\n public setOption<T extends TOptions, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._options = merge(this._options, { [id]: value });\n return this;\n }\n\n public build() {\n return this._options;\n }\n}\n","import { VizPanel, VizPanelState } from '../../components/VizPanel/VizPanel';\nimport { DeepPartial } from '../types';\nimport { FieldConfigBuilder } from './FieldConfigBuilder';\nimport { FieldConfigOverridesBuilder } from './FieldConfigOverridesBuilder';\nimport { PanelOptionsBuilder } from './PanelOptionsBuilder';\nimport { StandardFieldConfig, StandardFieldConfigInterface } from './types';\n\nexport class VizPanelBuilder<TOptions extends {}, TFieldConfig extends {}>\n implements StandardFieldConfigInterface<StandardFieldConfig, VizPanelBuilder<TOptions, TFieldConfig>, 'set'>\n{\n private _state: VizPanelState<TOptions, TFieldConfig> = {} as VizPanelState<TOptions, TFieldConfig>;\n private _fieldConfigBuilder: FieldConfigBuilder<TFieldConfig>;\n private _panelOptionsBuilder: PanelOptionsBuilder<TOptions>;\n\n public constructor(\n pluginId: string,\n pluginVersion: string,\n defaultOptions?: () => Partial<TOptions>,\n defaultFieldConfig?: () => TFieldConfig\n ) {\n this._state.title = '';\n this._state.description = '';\n this._state.displayMode = 'default';\n this._state.hoverHeader = false;\n this._state.pluginId = pluginId;\n this._state.pluginVersion = pluginVersion;\n\n this._fieldConfigBuilder = new FieldConfigBuilder(defaultFieldConfig);\n this._panelOptionsBuilder = new PanelOptionsBuilder(defaultOptions);\n }\n\n /**\n * Set panel title.\n */\n public setTitle(title: VizPanelState['title']): this {\n this._state.title = title;\n return this;\n }\n\n /**\n * Set panel description.\n */\n public setDescription(description: VizPanelState['description']): this {\n this._state.description = description;\n return this;\n }\n\n /**\n * Set panel display mode.\n */\n public setDisplayMode(displayMode: VizPanelState['displayMode']): this {\n this._state.displayMode = displayMode;\n return this;\n }\n\n /**\n * Set if panel header should be shown on hover.\n */\n public setHoverHeader(hoverHeader: VizPanelState['hoverHeader']): this {\n this._state.hoverHeader = hoverHeader;\n return this;\n }\n\n /**\n * Set panel menu scene object.\n */\n public setMenu(menu: VizPanelState['menu']): this {\n this._state.menu = menu;\n return this;\n }\n\n /**\n * Set scene object or react component to use as panel header actions.\n */\n public setHeaderActions(headerActions: VizPanelState['headerActions']): this {\n this._state.headerActions = headerActions;\n return this;\n }\n\n /**\n * Set color.\n */\n public setColor(color: StandardFieldConfig['color']): this {\n this._fieldConfigBuilder.setColor(color);\n return this;\n }\n\n /**\n * Set number of decimals to show.\n */\n public setDecimals(decimals: StandardFieldConfig['decimals']): this {\n this._fieldConfigBuilder.setDecimals(decimals);\n return this;\n }\n\n /**\n * Set field display name.\n */\n public setDisplayName(displayName: StandardFieldConfig['displayName']): this {\n this._fieldConfigBuilder.setDisplayName(displayName);\n return this;\n }\n\n /**\n * Set the standard field config property filterable.\n */\n public setFilterable(filterable: StandardFieldConfig['filterable']): this {\n this._fieldConfigBuilder.setFilterable(filterable);\n return this;\n }\n\n /**\n * Set data links.\n */\n public setLinks(links: StandardFieldConfig['links']): this {\n this._fieldConfigBuilder.setLinks(links);\n return this;\n }\n\n /**\n * Set value mappings.\n */\n public setMappings(mappings: StandardFieldConfig['mappings']): this {\n this._fieldConfigBuilder.setMappings(mappings);\n return this;\n }\n\n /**\n * Set the standard field config property max.\n */\n public setMax(max: StandardFieldConfig['max']): this {\n this._fieldConfigBuilder.setMax(max);\n return this;\n }\n\n /**\n * Set the standard field config property min.\n */\n public setMin(min: StandardFieldConfig['min']): this {\n this._fieldConfigBuilder.setMin(min);\n return this;\n }\n\n /**\n * Set the standard field config property noValue.\n */\n public setNoValue(noValue: StandardFieldConfig['noValue']): this {\n this._fieldConfigBuilder.setNoValue(noValue);\n return this;\n }\n\n /**\n * Set the standard field config property thresholds.\n */\n public setThresholds(thresholds: StandardFieldConfig['thresholds']): this {\n this._fieldConfigBuilder.setThresholds(thresholds);\n return this;\n }\n\n /**\n * Set the standard field config property unit.\n */\n public setUnit(unit: StandardFieldConfig['unit']): this {\n this._fieldConfigBuilder.setUnit(unit);\n return this;\n }\n\n public setCustomFieldConfig<T extends TFieldConfig, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._fieldConfigBuilder.setCustomFieldConfig(id, value);\n return this;\n }\n\n public setOverrides(builder: (b: FieldConfigOverridesBuilder<TFieldConfig>) => void): this {\n this._fieldConfigBuilder.setOverrides(builder);\n return this;\n }\n\n /**\n * Set an individual panel option. This will merge the value with the existing options.\n */\n public setOption<T extends TOptions, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._panelOptionsBuilder.setOption(id, value);\n return this;\n }\n\n /**\n * Set data provider for the panel.\n */\n public setData(data: VizPanelState['$data']): this {\n this._state.$data = data;\n return this;\n }\n\n /**\n * Set time range for the panel.\n */\n public setTimeRange(timeRange: VizPanelState['$timeRange']): this {\n this._state.$timeRange = timeRange;\n return this;\n }\n\n /**\n * Set variables for the panel.\n */\n public setVariables(variables: VizPanelState['$variables']): this {\n this._state.$variables = variables;\n return this;\n }\n\n /**\n * Set behaviors for the panel.\n */\n public setBehaviors(behaviors: VizPanelState['$behaviors']): this {\n this._state.$behaviors = behaviors;\n return this;\n }\n\n /**\n * Build the panel.\n */\n public build() {\n const panel = new VizPanel<TOptions, TFieldConfig>({\n ...this._state,\n options: this._panelOptionsBuilder.build(),\n fieldConfig: this._fieldConfigBuilder.build(),\n });\n\n return panel;\n }\n}\n","import {\n Options as BarChartOptions,\n defaultOptions as defaultBarChartOptions,\n} from '@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen';\nimport {\n Options as BarGaugeOptions,\n defaultOptions as defaultBarGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/bargauge/panelcfg/x/BarGaugePanelCfg_types.gen';\nimport {\n Options as DataGridOptions,\n defaultOptions as defaultDataGridOptions,\n} from '@grafana/schema/dist/esm/raw/composable/datagrid/panelcfg/x/DatagridPanelCfg_types.gen';\nimport {\n Options as GaugeOptions,\n defaultOptions as defaultGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/gauge/panelcfg/x/GaugePanelCfg_types.gen';\nimport {\n Options as GeomapOptions,\n defaultOptions as defaultGeomapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/geomap/panelcfg/x/GeomapPanelCfg_types.gen';\nimport {\n Options as HeatmapOptions,\n defaultOptions as defaultHeatmapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/heatmap/panelcfg/x/HeatmapPanelCfg_types.gen';\nimport {\n Options as HistogramOptions,\n defaultOptions as defaultHistogramOptions,\n} from '@grafana/schema/dist/esm/raw/composable/histogram/panelcfg/x/HistogramPanelCfg_types.gen';\nimport { Options as LogsOptions } from '@grafana/schema/dist/esm/raw/composable/logs/panelcfg/x/LogsPanelCfg_types.gen';\nimport {\n Options as NewsOptions,\n defaultOptions as defaultNewsOptions,\n} from '@grafana/schema/dist/esm/raw/composable/news/panelcfg/x/NewsPanelCfg_types.gen';\nimport { Options as NodeGraphOptions } from '@grafana/schema/dist/esm/raw/composable/nodegraph/panelcfg/x/NodeGraphPanelCfg_types.gen';\nimport {\n Options as PieChartOptions,\n defaultOptions as defaultPieChartOptions,\n} from '@grafana/schema/dist/esm/raw/composable/piechart/panelcfg/x/PieChartPanelCfg_types.gen';\nimport {\n Options as StatOptions,\n defaultOptions as defaultStatOptions,\n} from '@grafana/schema/dist/esm/raw/composable/stat/panelcfg/x/StatPanelCfg_types.gen';\nimport {\n Options as StateTimelineOptions,\n defaultOptions as defaultStateTimelineOptions,\n} from '@grafana/schema/dist/esm/raw/composable/statetimeline/panelcfg/x/StateTimelinePanelCfg_types.gen';\nimport {\n Options as StatusHistoryOptions,\n defaultOptions as defaultStatusHistoryOptions,\n} from '@grafana/schema/dist/esm/raw/composable/statushistory/panelcfg/x/StatusHistoryPanelCfg_types.gen';\nimport {\n Options as TableOptions,\n defaultOptions as defaultTableOptions,\n} from '@grafana/schema/dist/esm/raw/composable/table/panelcfg/x/TablePanelCfg_types.gen';\nimport {\n Options as TextOptions,\n defaultOptions as defaultTextOptions,\n} from '@grafana/schema/dist/esm/raw/composable/text/panelcfg/x/TextPanelCfg_types.gen';\nimport { Options as TimeSeriesOptions } from '@grafana/schema/dist/esm/raw/composable/timeseries/panelcfg/x/TimeSeriesPanelCfg_types.gen';\nimport { Options as TrendOptions } from '@grafana/schema/dist/esm/raw/composable/trend/panelcfg/x/TrendPanelCfg_types.gen';\nimport {\n Options as XYChartOptions,\n defaultOptions as defaultXYChartOptions,\n} from '@grafana/schema/dist/esm/raw/composable/xychart/panelcfg/x/XYChartPanelCfg_types.gen';\n\nimport { PanelOptionsBuilder } from './PanelOptionsBuilder';\n\nexport const PanelOptionsBuilders = {\n barchart() {\n return new PanelOptionsBuilder<BarChartOptions>(() => defaultBarChartOptions);\n },\n bargauge() {\n return new PanelOptionsBuilder<BarGaugeOptions>(() => defaultBarGaugeOptions);\n },\n datagrid() {\n return new PanelOptionsBuilder<DataGridOptions>(() => defaultDataGridOptions);\n },\n flamegraph() {\n return new PanelOptionsBuilder<{}>();\n },\n gauge() {\n return new PanelOptionsBuilder<GaugeOptions>(() => defaultGaugeOptions);\n },\n geomap() {\n return new PanelOptionsBuilder<GeomapOptions>(() => defaultGeomapOptions);\n },\n heatmap() {\n return new PanelOptionsBuilder<HeatmapOptions>(() => defaultHeatmapOptions);\n },\n histogram() {\n return new PanelOptionsBuilder<HistogramOptions>(() => defaultHistogramOptions);\n },\n logs() {\n return new PanelOptionsBuilder<LogsOptions>();\n },\n news() {\n return new PanelOptionsBuilder<NewsOptions>(() => defaultNewsOptions);\n },\n nodegraph() {\n return new PanelOptionsBuilder<NodeGraphOptions>();\n },\n piechart() {\n return new PanelOptionsBuilder<PieChartOptions>(() => defaultPieChartOptions);\n },\n stat() {\n return new PanelOptionsBuilder<StatOptions>(() => defaultStatOptions);\n },\n statetimeline() {\n return new PanelOptionsBuilder<StateTimelineOptions>(() => defaultStateTimelineOptions);\n },\n statushistory() {\n return new PanelOptionsBuilder<StatusHistoryOptions>(() => defaultStatusHistoryOptions);\n },\n table() {\n return new PanelOptionsBuilder<TableOptions>(() => defaultTableOptions);\n },\n text() {\n return new PanelOptionsBuilder<TextOptions>(() => defaultTextOptions);\n },\n timeseries() {\n return new PanelOptionsBuilder<TimeSeriesOptions>();\n },\n trend() {\n return new PanelOptionsBuilder<{}>();\n },\n traces() {\n return new PanelOptionsBuilder<TrendOptions>();\n },\n xychart() {\n return new PanelOptionsBuilder<XYChartOptions>(() => defaultXYChartOptions);\n },\n};\n","import { TableFieldOptions as TableFieldConfig } from '@grafana/schema';\n\nimport {\n FieldConfig as BarChartFieldConfig,\n defaultFieldConfig as defaultBarChartFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen';\nimport { FieldConfig as HeatmapFieldConfig } from '@grafana/schema/dist/esm/raw/composable/heatmap/panelcfg/x/HeatmapPanelCfg_types.gen';\nimport {\n FieldConfig as HistogramFieldConfig,\n defaultFieldConfig as defaultHistogramFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/histogram/panelcfg/x/HistogramPanelCfg_types.gen';\nimport { FieldConfig as PieChartFieldConfig } from '@grafana/schema/dist/esm/raw/composable/piechart/panelcfg/x/PieChartPanelCfg_types.gen';\nimport {\n FieldConfig as StateTimelineFieldConfig,\n defaultFieldConfig as defaultStateTimelineFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statetimeline/panelcfg/x/StateTimelinePanelCfg_types.gen';\nimport {\n FieldConfig as StatusHistoryFieldConfig,\n defaultFieldConfig as defaultStatusHistoryFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statushistory/panelcfg/x/StatusHistoryPanelCfg_types.gen';\nimport { FieldConfig as TimeSeriesFieldConfig } from '@grafana/schema/dist/esm/raw/composable/timeseries/panelcfg/x/TimeSeriesPanelCfg_types.gen';\nimport { FieldConfig as TrendFieldConfig } from '@grafana/schema/dist/esm/raw/composable/trend/panelcfg/x/TrendPanelCfg_types.gen';\nimport { defaultFieldConfig as defaultXYChartFieldConfig } from '@grafana/schema/dist/esm/raw/composable/xychart/panelcfg/x/XYChartPanelCfg_types.gen';\nimport { FieldConfigBuilder } from './FieldConfigBuilder';\n\nexport const FieldConfigBuilders = {\n barchart() {\n return new FieldConfigBuilder<BarChartFieldConfig>(() => defaultBarChartFieldConfig);\n },\n bargauge() {\n return new FieldConfigBuilder<{}>();\n },\n datagrid() {\n return new FieldConfigBuilder<{}>();\n },\n flamegraph() {\n return new FieldConfigBuilder<{}>();\n },\n gauge() {\n return new FieldConfigBuilder<{}>();\n },\n geomap() {\n return new FieldConfigBuilder<{}>();\n },\n heatmap() {\n return new FieldConfigBuilder<HeatmapFieldConfig>();\n },\n histogram() {\n return new FieldConfigBuilder<HistogramFieldConfig>(() => defaultHistogramFieldConfig);\n },\n logs() {\n return new FieldConfigBuilder<{}>();\n },\n news() {\n return new FieldConfigBuilder<{}>();\n },\n nodegraph() {\n return new FieldConfigBuilder<{}>();\n },\n piechart() {\n return new FieldConfigBuilder<PieChartFieldConfig>();\n },\n stat() {\n return new FieldConfigBuilder<{}>();\n },\n statetimeline() {\n return new FieldConfigBuilder<StateTimelineFieldConfig>(() => defaultStateTimelineFieldConfig);\n },\n statushistory() {\n return new FieldConfigBuilder<StatusHistoryFieldConfig>(() => defaultStatusHistoryFieldConfig);\n },\n table() {\n return new FieldConfigBuilder<TableFieldConfig>();\n },\n text() {\n return new FieldConfigBuilder<{}>();\n },\n timeseries() {\n return new FieldConfigBuilder<TimeSeriesFieldConfig>();\n },\n trend() {\n return new FieldConfigBuilder<{}>();\n },\n traces() {\n return new FieldConfigBuilder<TrendFieldConfig>();\n },\n xychart() {\n return new FieldConfigBuilder<{}>(() => defaultXYChartFieldConfig);\n },\n};\n","import { TableFieldOptions as TableFieldConfig } from '@grafana/schema';\n\nimport {\n Options as BarChartOptions,\n FieldConfig as BarChartFieldConfig,\n defaultOptions as defaultBarChartOptions,\n defaultFieldConfig as defaultBarChartFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen';\nimport {\n Options as BarGaugeOptions,\n defaultOptions as defaultBarGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/bargauge/panelcfg/x/BarGaugePanelCfg_types.gen';\nimport {\n Options as DataGridOptions,\n defaultOptions as defaultDataGridOptions,\n} from '@grafana/schema/dist/esm/raw/composable/datagrid/panelcfg/x/DatagridPanelCfg_types.gen';\nimport {\n Options as GaugeOptions,\n defaultOptions as defaultGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/gauge/panelcfg/x/GaugePanelCfg_types.gen';\nimport {\n Options as GeomapOptions,\n defaultOptions as defaultGeomapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/geomap/panelcfg/x/GeomapPanelCfg_types.gen';\nimport {\n Options as HeatmapOptions,\n FieldConfig as HeatmapFieldConfig,\n defaultOptions as defaultHeatmapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/heatmap/panelcfg/x/HeatmapPanelCfg_types.gen';\nimport {\n Options as HistogramOptions,\n FieldConfig as HistogramFieldConfig,\n defaultOptions as defaultHistogramOptions,\n defaultFieldConfig as defaultHistogramFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/histogram/panelcfg/x/HistogramPanelCfg_types.gen';\nimport { Options as LogsOptions } from '@grafana/schema/dist/esm/raw/composable/logs/panelcfg/x/LogsPanelCfg_types.gen';\nimport {\n Options as NewsOptions,\n defaultOptions as defaultNewsOptions,\n} from '@grafana/schema/dist/esm/raw/composable/news/panelcfg/x/NewsPanelCfg_types.gen';\nimport { Options as NodeGraphOptions } from '@grafana/schema/dist/esm/raw/composable/nodegraph/panelcfg/x/NodeGraphPanelCfg_types.gen';\nimport {\n Options as PieChartOptions,\n FieldConfig as PieChartFieldConfig,\n defaultOptions as defaultPieChartOptions,\n} from '@grafana/schema/dist/esm/raw/composable/piechart/panelcfg/x/PieChartPanelCfg_types.gen';\nimport {\n Options as StatOptions,\n defaultOptions as defaultStatOptions,\n} from '@grafana/schema/dist/esm/raw/composable/stat/panelcfg/x/StatPanelCfg_types.gen';\nimport {\n Options as StateTimelineOptions,\n FieldConfig as StateTimelineFieldConfig,\n defaultOptions as defaultStateTimelineOptions,\n defaultFieldConfig as defaultStateTimelineFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statetimeline/panelcfg/x/StateTimelinePanelCfg_types.gen';\nimport {\n Options as StatusHistoryOptions,\n FieldConfig as StatusHistoryFieldConfig,\n defaultOptions as defaultStatusHistoryOptions,\n defaultFieldConfig as defaultStatusHistoryFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statushistory/panelcfg/x/StatusHistoryPanelCfg_types.gen';\nimport {\n Options as TableOptions,\n defaultOptions as defaultTableOptions,\n} from '@grafana/schema/dist/esm/raw/composable/table/panelcfg/x/TablePanelCfg_types.gen';\nimport {\n Options as TextOptions,\n defaultOptions as defaultTextOptions,\n} from '@grafana/schema/dist/esm/raw/composable/text/panelcfg/x/TextPanelCfg_types.gen';\nimport {\n Options as TimeSeriesOptions,\n FieldConfig as TimeSeriesFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/timeseries/panelcfg/x/TimeSeriesPanelCfg_types.gen';\nimport {\n Options as TrendOptions,\n FieldConfig as TrendFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/trend/panelcfg/x/TrendPanelCfg_types.gen';\nimport {\n Options as XYChartOptions,\n defaultOptions as defaultXYChartOptions,\n defaultFieldConfig as defaultXYChartFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/xychart/panelcfg/x/XYChartPanelCfg_types.gen';\n\nimport { VizPanelBuilder } from './VizPanelBuilder';\n\nexport const PanelBuilders = {\n barchart() {\n return new VizPanelBuilder<BarChartOptions, BarChartFieldConfig>(\n 'barchart',\n '10.0.0',\n () => defaultBarChartOptions,\n () => defaultBarChartFieldConfig\n );\n },\n bargauge() {\n return new VizPanelBuilder<BarGaugeOptions, {}>('bargauge', '10.0.0', () => defaultBarGaugeOptions);\n },\n datagrid() {\n return new VizPanelBuilder<DataGridOptions, {}>('datagrid', '10.0.0', () => defaultDataGridOptions);\n },\n flamegraph() {\n return new VizPanelBuilder<{}, {}>('flamegraph', '10.0.0');\n },\n gauge() {\n return new VizPanelBuilder<GaugeOptions, {}>('gauge', '10.0.0', () => defaultGaugeOptions);\n },\n geomap() {\n return new VizPanelBuilder<GeomapOptions, {}>('geomap', '10.0.0', () => defaultGeomapOptions);\n },\n heatmap() {\n return new VizPanelBuilder<HeatmapOptions, HeatmapFieldConfig>('heatmap', '10.0.0', () => defaultHeatmapOptions);\n },\n histogram() {\n return new VizPanelBuilder<HistogramOptions, HistogramFieldConfig>(\n 'histogram',\n '10.0.0',\n () => defaultHistogramOptions,\n () => defaultHistogramFieldConfig\n );\n },\n logs() {\n return new VizPanelBuilder<LogsOptions, {}>('logs', '10.0.0');\n },\n news() {\n return new VizPanelBuilder<NewsOptions, {}>('news', '10.0.0', () => defaultNewsOptions);\n },\n nodegraph() {\n return new VizPanelBuilder<NodeGraphOptions, {}>('nodeGraph', '10.0.0');\n },\n piechart() {\n return new VizPanelBuilder<PieChartOptions, PieChartFieldConfig>(\n 'piechart',\n '10.0.0',\n () => defaultPieChartOptions\n );\n },\n stat() {\n return new VizPanelBuilder<StatOptions, {}>('stat', '10.0.0', () => defaultStatOptions);\n },\n statetimeline() {\n return new VizPanelBuilder<StateTimelineOptions, StateTimelineFieldConfig>(\n 'state-timeline',\n '10.0.0',\n () => defaultStateTimelineOptions,\n () => defaultStateTimelineFieldConfig\n );\n },\n statushistory() {\n return new VizPanelBuilder<StatusHistoryOptions, StatusHistoryFieldConfig>(\n 'status-history',\n '10.0.0',\n () => defaultStatusHistoryOptions,\n () => defaultStatusHistoryFieldConfig\n );\n },\n table() {\n return new VizPanelBuilder<TableOptions, TableFieldConfig>('table', '10.0.0', () => defaultTableOptions);\n },\n text() {\n return new VizPanelBuilder<TextOptions, {}>('text', '10.0.0', () => defaultTextOptions);\n },\n timeseries() {\n return new VizPanelBuilder<TimeSeriesOptions, TimeSeriesFieldConfig>('timeseries', '10.0.0');\n },\n trend() {\n return new VizPanelBuilder<{}, {}>('trend', '10.0.0');\n },\n traces() {\n return new VizPanelBuilder<TrendOptions, TrendFieldConfig>('traces', '10.0.0');\n },\n xychart() {\n return new VizPanelBuilder<XYChartOptions, {}>(\n 'xychart',\n '10.0.0',\n () => defaultXYChartOptions,\n () => defaultXYChartFieldConfig\n );\n },\n};\n\nexport { PanelOptionsBuilders } from './PanelOptionsBuilders';\nexport { FieldConfigBuilders } from './FieldConfigBuilders';\nexport { FieldConfigOverridesBuilder } from './FieldConfigOverridesBuilder';\n","import { DeepPartial } from '../types';\nimport { FieldConfigBuilder } from './FieldConfigBuilder';\nimport { FieldConfigOverridesBuilder } from './FieldConfigOverridesBuilder';\nimport { PanelOptionsBuilder } from './PanelOptionsBuilder';\nimport { StandardFieldConfig, StandardFieldConfigInterface, VizConfig } from './types';\n\nexport class VizConfigBuilder<TOptions extends {}, TFieldConfig extends {}>\n implements StandardFieldConfigInterface<StandardFieldConfig, VizConfigBuilder<TOptions, TFieldConfig>, 'set'>\n{\n private _fieldConfigBuilder: FieldConfigBuilder<TFieldConfig>;\n private _panelOptionsBuilder: PanelOptionsBuilder<TOptions>;\n private _pluginId: string;\n private _pluginVersion: string;\n\n public constructor(\n pluginId: string,\n pluginVersion: string,\n defaultOptions?: () => Partial<TOptions>,\n defaultFieldConfig?: () => TFieldConfig\n ) {\n this._pluginId = pluginId;\n this._pluginVersion = pluginVersion;\n this._fieldConfigBuilder = new FieldConfigBuilder(defaultFieldConfig);\n this._panelOptionsBuilder = new PanelOptionsBuilder(defaultOptions);\n }\n\n /**\n * Set color.\n */\n public setColor(color: StandardFieldConfig['color']): this {\n this._fieldConfigBuilder.setColor(color);\n return this;\n }\n\n /**\n * Set number of decimals to show.\n */\n public setDecimals(decimals: StandardFieldConfig['decimals']): this {\n this._fieldConfigBuilder.setDecimals(decimals);\n return this;\n }\n\n /**\n * Set field display name.\n */\n public setDisplayName(displayName: StandardFieldConfig['displayName']): this {\n this._fieldConfigBuilder.setDisplayName(displayName);\n return this;\n }\n\n /**\n * Set the standard field config property filterable.\n */\n public setFilterable(filterable: StandardFieldConfig['filterable']): this {\n this._fieldConfigBuilder.setFilterable(filterable);\n return this;\n }\n\n /**\n * Set data links.\n */\n public setLinks(links: StandardFieldConfig['links']): this {\n this._fieldConfigBuilder.setLinks(links);\n return this;\n }\n\n /**\n * Set value mappings.\n */\n public setMappings(mappings: StandardFieldConfig['mappings']): this {\n this._fieldConfigBuilder.setMappings(mappings);\n return this;\n }\n\n /**\n * Set the standard field config property max.\n */\n public setMax(max: StandardFieldConfig['max']): this {\n this._fieldConfigBuilder.setMax(max);\n return this;\n }\n\n /**\n * Set the standard field config property min.\n */\n public setMin(min: StandardFieldConfig['min']): this {\n this._fieldConfigBuilder.setMin(min);\n return this;\n }\n\n /**\n * Set the standard field config property noValue.\n */\n public setNoValue(noValue: StandardFieldConfig['noValue']): this {\n this._fieldConfigBuilder.setNoValue(noValue);\n return this;\n }\n\n /**\n * Set the standard field config property thresholds.\n */\n public setThresholds(thresholds: StandardFieldConfig['thresholds']): this {\n this._fieldConfigBuilder.setThresholds(thresholds);\n return this;\n }\n\n /**\n * Set the standard field config property unit.\n */\n public setUnit(unit: StandardFieldConfig['unit']): this {\n this._fieldConfigBuilder.setUnit(unit);\n return this;\n }\n\n public setCustomFieldConfig<T extends TFieldConfig, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._fieldConfigBuilder.setCustomFieldConfig(id, value);\n return this;\n }\n\n public setOverrides(builder: (b: FieldConfigOverridesBuilder<TFieldConfig>) => void): this {\n this._fieldConfigBuilder.setOverrides(builder);\n return this;\n }\n\n /**\n * Set an individual panel option. This will merge the value with the existing options.\n */\n public setOption<T extends TOptions, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._panelOptionsBuilder.setOption(id, value);\n return this;\n }\n\n /**\n * Build the panel.\n */\n public build(): VizConfig<TOptions, TFieldConfig> {\n return {\n pluginId: this._pluginId,\n pluginVersion: this._pluginVersion,\n options: this._panelOptionsBuilder.build(),\n fieldConfig: this._fieldConfigBuilder.build(),\n };\n }\n}\n","import { TableFieldOptions as TableFieldConfig } from '@grafana/schema';\n\nimport {\n Options as BarChartOptions,\n FieldConfig as BarChartFieldConfig,\n defaultOptions as defaultBarChartOptions,\n defaultFieldConfig as defaultBarChartFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen';\nimport {\n Options as BarGaugeOptions,\n defaultOptions as defaultBarGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/bargauge/panelcfg/x/BarGaugePanelCfg_types.gen';\nimport {\n Options as DataGridOptions,\n defaultOptions as defaultDataGridOptions,\n} from '@grafana/schema/dist/esm/raw/composable/datagrid/panelcfg/x/DatagridPanelCfg_types.gen';\nimport {\n Options as GaugeOptions,\n defaultOptions as defaultGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/gauge/panelcfg/x/GaugePanelCfg_types.gen';\nimport {\n Options as GeomapOptions,\n defaultOptions as defaultGeomapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/geomap/panelcfg/x/GeomapPanelCfg_types.gen';\nimport {\n Options as HeatmapOptions,\n FieldConfig as HeatmapFieldConfig,\n defaultOptions as defaultHeatmapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/heatmap/panelcfg/x/HeatmapPanelCfg_types.gen';\nimport {\n Options as HistogramOptions,\n FieldConfig as HistogramFieldConfig,\n defaultOptions as defaultHistogramOptions,\n defaultFieldConfig as defaultHistogramFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/histogram/panelcfg/x/HistogramPanelCfg_types.gen';\nimport { Options as LogsOptions } from '@grafana/schema/dist/esm/raw/composable/logs/panelcfg/x/LogsPanelCfg_types.gen';\nimport {\n Options as NewsOptions,\n defaultOptions as defaultNewsOptions,\n} from '@grafana/schema/dist/esm/raw/composable/news/panelcfg/x/NewsPanelCfg_types.gen';\nimport { Options as NodeGraphOptions } from '@grafana/schema/dist/esm/raw/composable/nodegraph/panelcfg/x/NodeGraphPanelCfg_types.gen';\nimport {\n Options as PieChartOptions,\n FieldConfig as PieChartFieldConfig,\n defaultOptions as defaultPieChartOptions,\n} from '@grafana/schema/dist/esm/raw/composable/piechart/panelcfg/x/PieChartPanelCfg_types.gen';\nimport {\n Options as StatOptions,\n defaultOptions as defaultStatOptions,\n} from '@grafana/schema/dist/esm/raw/composable/stat/panelcfg/x/StatPanelCfg_types.gen';\nimport {\n Options as StateTimelineOptions,\n FieldConfig as StateTimelineFieldConfig,\n defaultOptions as defaultStateTimelineOptions,\n defaultFieldConfig as defaultStateTimelineFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statetimeline/panelcfg/x/StateTimelinePanelCfg_types.gen';\nimport {\n Options as StatusHistoryOptions,\n FieldConfig as StatusHistoryFieldConfig,\n defaultOptions as defaultStatusHistoryOptions,\n defaultFieldConfig as defaultStatusHistoryFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statushistory/panelcfg/x/StatusHistoryPanelCfg_types.gen';\nimport {\n Options as TableOptions,\n defaultOptions as defaultTableOptions,\n} from '@grafana/schema/dist/esm/raw/composable/table/panelcfg/x/TablePanelCfg_types.gen';\nimport {\n Options as TextOptions,\n defaultOptions as defaultTextOptions,\n} from '@grafana/schema/dist/esm/raw/composable/text/panelcfg/x/TextPanelCfg_types.gen';\nimport {\n Options as TimeSeriesOptions,\n FieldConfig as TimeSeriesFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/timeseries/panelcfg/x/TimeSeriesPanelCfg_types.gen';\nimport {\n Options as TrendOptions,\n FieldConfig as TrendFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/trend/panelcfg/x/TrendPanelCfg_types.gen';\nimport {\n Options as XYChartOptions,\n defaultOptions as defaultXYChartOptions,\n defaultFieldConfig as defaultXYChartFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/xychart/panelcfg/x/XYChartPanelCfg_types.gen';\n\nimport { VizConfigBuilder } from './VizConfigBuilder';\n\nexport const VizConfigBuilders = {\n barchart() {\n return new VizConfigBuilder<BarChartOptions, BarChartFieldConfig>(\n 'barchart',\n '10.0.0',\n () => defaultBarChartOptions,\n () => defaultBarChartFieldConfig\n );\n },\n bargauge() {\n return new VizConfigBuilder<BarGaugeOptions, {}>('bargauge', '10.0.0', () => defaultBarGaugeOptions);\n },\n datagrid() {\n return new VizConfigBuilder<DataGridOptions, {}>('datagrid', '10.0.0', () => defaultDataGridOptions);\n },\n flamegraph() {\n return new VizConfigBuilder<{}, {}>('flamegraph', '10.0.0');\n },\n gauge() {\n return new VizConfigBuilder<GaugeOptions, {}>('gauge', '10.0.0', () => defaultGaugeOptions);\n },\n geomap() {\n return new VizConfigBuilder<GeomapOptions, {}>('geomap', '10.0.0', () => defaultGeomapOptions);\n },\n heatmap() {\n return new VizConfigBuilder<HeatmapOptions, HeatmapFieldConfig>('heatmap', '10.0.0', () => defaultHeatmapOptions);\n },\n histogram() {\n return new VizConfigBuilder<HistogramOptions, HistogramFieldConfig>(\n 'histogram',\n '10.0.0',\n () => defaultHistogramOptions,\n () => defaultHistogramFieldConfig\n );\n },\n logs() {\n return new VizConfigBuilder<LogsOptions, {}>('logs', '10.0.0');\n },\n news() {\n return new VizConfigBuilder<NewsOptions, {}>('news', '10.0.0', () => defaultNewsOptions);\n },\n nodegraph() {\n return new VizConfigBuilder<NodeGraphOptions, {}>('nodeGraph', '10.0.0');\n },\n piechart() {\n return new VizConfigBuilder<PieChartOptions, PieChartFieldConfig>(\n 'piechart',\n '10.0.0',\n () => defaultPieChartOptions\n );\n },\n stat() {\n return new VizConfigBuilder<StatOptions, {}>('stat', '10.0.0', () => defaultStatOptions);\n },\n statetimeline() {\n return new VizConfigBuilder<StateTimelineOptions, StateTimelineFieldConfig>(\n 'state-timeline',\n '10.0.0',\n () => defaultStateTimelineOptions,\n () => defaultStateTimelineFieldConfig\n );\n },\n statushistory() {\n return new VizConfigBuilder<StatusHistoryOptions, StatusHistoryFieldConfig>(\n 'status-history',\n '10.0.0',\n () => defaultStatusHistoryOptions,\n () => defaultStatusHistoryFieldConfig\n );\n },\n table() {\n return new VizConfigBuilder<TableOptions, TableFieldConfig>('table', '10.0.0', () => defaultTableOptions);\n },\n text() {\n return new VizConfigBuilder<TextOptions, {}>('text', '10.0.0', () => defaultTextOptions);\n },\n timeseries() {\n return new VizConfigBuilder<TimeSeriesOptions, TimeSeriesFieldConfig>('timeseries', '10.0.0');\n },\n trend() {\n return new VizConfigBuilder<{}, {}>('trend', '10.0.0');\n },\n traces() {\n return new VizConfigBuilder<TrendOptions, TrendFieldConfig>('traces', '10.0.0');\n },\n xychart() {\n return new VizConfigBuilder<XYChartOptions, {}>(\n 'xychart',\n '10.0.0',\n () => defaultXYChartOptions,\n () => defaultXYChartFieldConfig\n );\n },\n};\n","import { getUrlWithAppState } from './components/SceneApp/utils';\nimport { registerRuntimePanelPlugin } from './components/VizPanel/registerRuntimePanelPlugin';\nimport { cloneSceneObjectState } from './core/sceneGraph/utils';\nimport { registerRuntimeDataSource } from './querying/RuntimeDataSource';\nimport { getUrlState, syncStateFromSearchParams } from './services/utils';\n\nimport { registerVariableMacro } from './variables/macros';\nimport { renderPrometheusLabelFilters } from './variables/utils';\nimport {\n isAdHocVariable,\n isQueryVariable,\n isTextBoxVariable,\n isCustomVariable,\n isDataSourceVariable,\n isConstantVariable,\n isIntervalVariable,\n isGroupByVariable,\n} from './variables/variants/guards';\n\nexport * from './core/types';\nexport * from './core/events';\nexport { sceneGraph } from './core/sceneGraph';\nexport * as behaviors from './behaviors';\nexport * as dataLayers from './querying/layers';\n\nexport { SceneObjectBase, useSceneObjectState } from './core/SceneObjectBase';\nexport { SceneDataNode } from './core/SceneDataNode';\nexport { SceneTimeRange } from './core/SceneTimeRange';\nexport { SceneTimeZoneOverride } from './core/SceneTimeZoneOverride';\n\nexport { SceneQueryRunner, type QueryRunnerState } from './querying/SceneQueryRunner';\nexport {\n type ExtraQueryDescriptor,\n type ExtraQueryProvider,\n type ExtraQueryDataProcessor,\n} from './querying/ExtraQueryProvider';\nexport { SceneDataLayerSet, SceneDataLayerSetBase } from './querying/SceneDataLayerSet';\nexport { SceneDataLayerBase } from './querying/layers/SceneDataLayerBase';\nexport { SceneDataLayerControls } from './querying/layers/SceneDataLayerControls';\nexport { SceneDataTransformer } from './querying/SceneDataTransformer';\nexport { registerQueryWithController } from './querying/registerQueryWithController';\nexport { registerRuntimeDataSource, RuntimeDataSource } from './querying/RuntimeDataSource';\nexport type {\n SceneQueryControllerLike,\n SceneQueryControllerEntryType,\n SceneQueryControllerEntry,\n} from './behaviors/SceneQueryController';\n\nexport * from './variables/types';\nexport { VariableDependencyConfig } from './variables/VariableDependencyConfig';\nexport { formatRegistry, type FormatVariable } from './variables/interpolation/formatRegistry';\nexport { VariableValueSelectors } from './variables/components/VariableValueSelectors';\nexport { VariableValueControl } from './variables/components/VariableValueControl';\nexport { SceneVariableSet } from './variables/sets/SceneVariableSet';\nexport { ConstantVariable } from './variables/variants/ConstantVariable';\nexport { CustomVariable } from './variables/variants/CustomVariable';\nexport { DataSourceVariable } from './variables/variants/DataSourceVariable';\nexport { QueryVariable } from './variables/variants/query/QueryVariable';\nexport { TestVariable } from './variables/variants/TestVariable';\nexport { TextBoxVariable } from './variables/variants/TextBoxVariable';\nexport {\n MultiValueVariable,\n type MultiValueVariableState,\n type VariableGetOptionsArgs,\n} from './variables/variants/MultiValueVariable';\nexport { LocalValueVariable } from './variables/variants/LocalValueVariable';\nexport { IntervalVariable } from './variables/variants/IntervalVariable';\nexport { AdHocFiltersVariable } from './variables/adhoc/AdHocFiltersVariable';\nexport { GroupByVariable } from './variables/groupby/GroupByVariable';\nexport { type MacroVariableConstructor } from './variables/macros/types';\n\nexport { type UrlSyncManagerLike, UrlSyncManager, getUrlSyncManager } from './services/UrlSyncManager';\nexport { useUrlSync } from './services/useUrlSync';\nexport { UrlSyncContextProvider } from './services/UrlSyncContextProvider';\nexport { SceneObjectUrlSyncConfig } from './services/SceneObjectUrlSyncConfig';\n\nexport { EmbeddedScene, type EmbeddedSceneState } from './components/EmbeddedScene';\nexport { VizPanel, type VizPanelState } from './components/VizPanel/VizPanel';\nexport { VizPanelMenu } from './components/VizPanel/VizPanelMenu';\nexport { NestedScene } from './components/NestedScene';\nexport { SceneCanvasText } from './components/SceneCanvasText';\nexport { SceneToolbarButton, SceneToolbarInput } from './components/SceneToolbarButton';\nexport { SceneTimePicker } from './components/SceneTimePicker';\nexport { SceneRefreshPicker, type SceneRefreshPickerState } from './components/SceneRefreshPicker';\nexport { SceneTimeRangeTransformerBase } from './core/SceneTimeRangeTransformerBase';\nexport { SceneTimeRangeCompare } from './components/SceneTimeRangeCompare';\nexport { SceneByFrameRepeater } from './components/SceneByFrameRepeater';\nexport { SceneByVariableRepeater } from './components/SceneByVariableRepeater';\nexport { SceneControlsSpacer } from './components/SceneControlsSpacer';\nexport {\n SceneFlexLayout,\n SceneFlexItem,\n type SceneFlexItemState,\n type SceneFlexItemLike,\n} from './components/layout/SceneFlexLayout';\nexport { SceneCSSGridLayout, SceneCSSGridItem } from './components/layout/CSSGrid/SceneCSSGridLayout';\nexport { SceneGridLayout } from './components/layout/grid/SceneGridLayout';\nexport { SceneGridItem } from './components/layout/grid/SceneGridItem';\nexport { SceneGridRow } from './components/layout/grid/SceneGridRow';\nexport { type SceneGridItemStateLike, type SceneGridItemLike } from './components/layout/grid/types';\nexport { SplitLayout } from './components/layout/split/SplitLayout';\nexport {\n type SceneAppPageLike,\n type SceneRouteMatch,\n type SceneAppPageState,\n type SceneAppDrilldownView,\n type SceneAppRoute,\n} from './components/SceneApp/types';\nexport { SceneApp, useSceneApp } from './components/SceneApp/SceneApp';\nexport { SceneAppPage } from './components/SceneApp/SceneAppPage';\nexport { SceneReactObject } from './components/SceneReactObject';\nexport { SceneObjectRef } from './core/SceneObjectRef';\nexport {\n PanelBuilders,\n PanelOptionsBuilders,\n FieldConfigBuilders,\n FieldConfigOverridesBuilder,\n} from './core/PanelBuilders';\nexport { FieldConfigBuilder } from './core/PanelBuilders/FieldConfigBuilder';\nexport { VizPanelBuilder } from './core/PanelBuilders/VizPanelBuilder';\nexport { SceneDebugger } from './components/SceneDebugger/SceneDebugger';\nexport { VariableValueSelectWrapper } from './variables/components/VariableValueSelectors';\nexport { renderSelectForVariable } from './variables/components/VariableValueSelect';\nexport { VizConfigBuilder } from './core/PanelBuilders/VizConfigBuilder';\nexport { VizConfigBuilders } from './core/PanelBuilders/VizConfigBuilders';\nexport { type VizConfig } from './core/PanelBuilders/types';\n\nexport const sceneUtils = {\n getUrlWithAppState,\n registerRuntimePanelPlugin,\n registerRuntimeDataSource,\n registerVariableMacro,\n cloneSceneObjectState,\n syncStateFromSearchParams,\n getUrlState,\n renderPrometheusLabelFilters,\n\n // Variable guards\n isAdHocVariable,\n isConstantVariable,\n isCustomVariable,\n isDataSourceVariable,\n isIntervalVariable,\n isQueryVariable,\n isTextBoxVariable,\n isGroupByVariable,\n};\n\nexport { SafeSerializableSceneObject } from './utils/SafeSerializableSceneObject';\n"],"names":["useLocation","locationSearchToObject","__spreadValues","locationService","urlUtil","locationUtil","React","__spreadProps","getPluginImportUtils","__objRest","_a","useState","useEffect","BusEventWithPayload","__privateAdd","__privateSet","__privateGet","Subscription","uuidv4","EventBusSrv","DataSourceApi","PluginType","of","LoadingState","getDefaultTimeRange","toUtc","dateMath","getTimeZone","RefreshEvent","setWeekStart","rangeUtil","config","property","Registry","VariableFormatID","map","escapeRegex","isArray","textUtil","replace","dateTime","dateTimeFormat","getFieldDisplayName","formatLabels","formattedValueToString","FieldType","getDisplayProcessor","getFieldDisplayValuesProxy","getFrameDisplayName","DataLinkBuiltInVars","getDataSourceSrv","mergeMap","forkJoin","getTemplateSrv","Observable","isEqual","uFuzzy","filterNoOp","toSelectableValue","useMemo","value","Select","inputValue","selectors","MultiSelect","useTheme2","getSelectStyles","useStyles2","cx","Checkbox","css","values","from","tap","take","lastValueFrom","Tooltip","Icon","getStyles","IconButton","keys","Field","Button","key","merge","mergeAll","filter","finalize","counter","getNextRequestId","ReplaySubject","data","preProcessPanelData","DataTopic","DataFrameView","getRunRequest","toDataQueryError","cloneDeep","isExpressionReference","VariableSupportType","stringToJsRegex","isNumber","uniqBy","VariableSort","options","sortBy","toLower","getProcessedDataFrames","isDataFrame","VariableRefresh","debounce","throwError","catchError","CoreApp","DashboardCursorSync","useMeasure","getAppEvents","useCallback","SetPanelAttentionEvent","PanelChrome","AlertState","ErrorBoundaryAlert","PluginContextProvider","PanelContextProvider","isSystemOverrideWithRef","SeriesVisibilityChangeMode","override","createOverride","ByNamesMatcherMode","FieldMatcherID","fieldMatchers","FieldColorModeId","mergeWith","getPanelOptionsWithDefaults","renderMarkdown","isEmpty","applyFieldOverrides","compareArrayValues","compareDataFrameStructures","PanelPlugin","isFetchError","containerStyle","InlineSwitch","isString","standardTransformers","AnnotationEventFieldSource","partition","groupBy","every","find","head","concat","arrayToDataFrame","transformDataFrame","VariableHide","Subject","AutoSizeInput","items","Menu","useRef","uniqueId","useImperativeHandle","useEffectOnce","width","height","ReactGridLayout","ToolbarButton","Input","TimeRangePicker","TimeRangeDirection","RefreshPicker","ButtonGroup","ButtonSelect","useLayoutStyle","clamp","throttle","useLayoutEffect","Switch","Route","isPlainObject","JSONFormatter","Drawer","CustomScrollbar","PluginPage","defaultBarChartOptions","defaultBarGaugeOptions","defaultDataGridOptions","defaultGaugeOptions","defaultGeomapOptions","defaultHeatmapOptions","defaultHistogramOptions","defaultNewsOptions","defaultPieChartOptions","defaultStatOptions","defaultStateTimelineOptions","defaultStatusHistoryOptions","defaultTableOptions","defaultTextOptions","defaultXYChartOptions","defaultBarChartFieldConfig","defaultHistogramFieldConfig","defaultStateTimelineFieldConfig","defaultStatusHistoryFieldConfig","defaultXYChartFieldConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,SAAS,iBAAiC,GAAA;AAC/C,EAAA,MAAM,WAAWA,0BAAY,EAAA,CAAA;AAC7B,EAAO,OAAAC,8BAAA,CAAuB,QAAS,CAAA,MAAA,IAAU,EAAE,CAAA,CAAA;AACrD,CAAA;AAQgB,SAAA,kBAAA,CAAmB,MAAc,cAAmC,EAAA;AAElF,EAAM,MAAA,UAAA,GAAaC,gBAAK,CAAA,EAAA,EAAAC,uBAAA,CAAgB,eAAgB,EAAA,CAAA,CAAA;AAExD,EAAA,IAAI,cAAgB,EAAA;AAClB,IAAA,KAAA,MAAW,GAAO,IAAA,MAAA,CAAO,IAAK,CAAA,UAAU,CAAG,EAAA;AAEzC,MAAA,IAAI,CAAC,cAAA,CAAe,QAAS,CAAA,GAAG,CAAG,EAAA;AACjC,QAAA,OAAO,UAAW,CAAA,GAAA,CAAA,CAAA;AAAA,OACpB;AAAA,KACF;AAAA,GACF;AAEA,EAAA,OAAOC,aAAQ,SAAU,CAAAC,iBAAA,CAAa,aAAc,CAAA,IAAI,GAAG,UAAU,CAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/SceneApp/utils.ts","../src/components/VizPanel/registerRuntimePanelPlugin.ts","../src/core/SceneComponentWrapper.tsx","../src/core/events.ts","../src/core/SceneObjectRef.ts","../src/core/SceneObjectBase.tsx","../src/core/sceneGraph/utils.ts","../src/querying/RuntimeDataSource.ts","../src/variables/lookupVariable.ts","../src/core/SceneDataNode.ts","../src/services/SceneObjectUrlSyncConfig.ts","../src/utils/parseUrlParam.ts","../src/utils/evaluateTimeRange.ts","../src/core/SceneTimeRange.tsx","../src/variables/interpolation/defaults.ts","../src/core/sceneGraph/getTimeRange.ts","../src/variables/types.ts","../src/variables/interpolation/fieldAccessorCache.ts","../src/variables/interpolation/ScopedVarsVariable.ts","../src/variables/constants.ts","../src/variables/interpolation/formatRegistry.ts","../src/variables/macros/types.ts","../src/variables/macros/timeMacros.ts","../src/variables/macros/AllVariablesMacro.ts","../src/variables/macros/templateProxies.ts","../src/variables/macros/dataMacros.ts","../src/variables/macros/urlMacros.ts","../src/variables/macros/contextMacros.ts","../src/variables/macros/index.ts","../src/variables/interpolation/sceneInterpolator.ts","../src/core/types.ts","../src/behaviors/SceneQueryController.ts","../src/utils/writeSceneLog.ts","../src/utils/getDataSource.ts","../src/variables/VariableValueRecorder.ts","../src/querying/ExtraQueryProvider.ts","../src/querying/extraQueryProcessingOperator.ts","../src/querying/layers/annotations/filterAnnotations.ts","../src/querying/getEnrichedDataRequest.ts","../src/variables/adhoc/patchGetAdhocFilters.ts","../src/querying/registerQueryWithController.ts","../src/variables/groupby/findActiveGroupByVariablesByUid.ts","../src/utils/utils.ts","../src/variables/variants/MultiValueVariable.ts","../src/variables/components/getOptionSearcher.ts","../src/variables/components/VariableValueSelect.tsx","../src/variables/groupby/GroupByVariableUrlSyncHandler.ts","../src/variables/getEnrichedFiltersRequest.ts","../src/utils/SafeSerializableSceneObject.ts","../src/utils/wrapInSafeSerializableSceneObject.ts","../src/variables/groupby/GroupByVariable.tsx","../src/utils/LoadingIndicator.tsx","../src/utils/ControlsLabel.tsx","../src/variables/adhoc/getAdhocOptionSearcher.ts","../src/variables/adhoc/AdHocFilterRenderer.tsx","../src/variables/adhoc/AdHocFilterBuilder.tsx","../src/variables/adhoc/AdHocFiltersVariableUrlSyncHandler.ts","../src/variables/adhoc/AdHocFiltersVariable.tsx","../src/querying/DataLayersMerger.ts","../src/querying/SceneQueryRunner.ts","../src/variables/utils.ts","../src/variables/VariableDependencyConfig.ts","../src/variables/variants/query/guards.ts","../src/variables/variants/query/createQueryVariableRunner.ts","../src/variables/variants/query/utils.ts","../src/variables/variants/query/toMetricFindValues.ts","../src/variables/variants/query/QueryVariable.tsx","../src/core/sceneGraph/sceneGraph.ts","../src/core/sceneGraph/index.ts","../src/services/UniqueUrlKeyMapper.ts","../src/services/utils.ts","../src/variables/variants/guards.ts","../src/behaviors/ActWhenVariableChanged.ts","../src/behaviors/CursorSync.ts","../src/components/VizPanel/VizPanelRenderer.tsx","../src/components/VizPanel/seriesVisibilityConfigFactory.ts","../src/components/VizPanel/colorSeriesConfigFactory.ts","../src/components/VizPanel/VizPanel.tsx","../src/behaviors/LiveNowTimer.ts","../src/utils/getMessageFromError.ts","../src/querying/layers/SceneDataLayerBase.ts","../src/querying/layers/SceneDataLayerControls.tsx","../src/querying/layers/annotations/standardAnnotationsSupport.ts","../src/querying/layers/annotations/standardAnnotationQuery.ts","../src/querying/layers/annotations/utils.ts","../src/querying/layers/annotations/AnnotationsDataLayer.tsx","../src/core/SceneTimeRangeTransformerBase.tsx","../src/core/SceneTimeZoneOverride.tsx","../src/querying/SceneDataLayerSet.tsx","../src/querying/SceneDataTransformer.ts","../src/variables/components/VariableValueSelectors.tsx","../src/variables/components/VariableValueControl.tsx","../src/variables/sets/SceneVariableSet.ts","../src/variables/variants/ConstantVariable.ts","../src/variables/variants/CustomVariable.tsx","../src/variables/variants/DataSourceVariable.tsx","../src/utils/metricTree.ts","../src/variables/variants/TestVariable.tsx","../src/variables/components/VariableValueInput.tsx","../src/variables/variants/TextBoxVariable.tsx","../src/variables/variants/LocalValueVariable.ts","../src/variables/variants/IntervalVariable.tsx","../src/services/UrlSyncManager.ts","../src/services/useUrlSync.ts","../src/services/UrlSyncContextProvider.ts","../src/utils/compatibility/setWindowGrafanaSceneContext.ts","../src/components/EmbeddedScene.tsx","../src/components/VizPanel/VizPanelMenu.tsx","../src/components/layout/grid/constants.ts","../src/components/layout/grid/SceneGridItem.tsx","../src/components/layout/LazyLoader.tsx","../src/components/layout/grid/SceneGridLayoutRenderer.tsx","../src/components/layout/grid/utils.ts","../src/components/layout/grid/SceneGridLayout.tsx","../src/components/layout/grid/SceneGridRow.tsx","../src/components/NestedScene.tsx","../src/components/SceneCanvasText.tsx","../src/components/SceneToolbarButton.tsx","../src/components/SceneTimePicker.tsx","../src/components/SceneRefreshPicker.tsx","../src/utils/getCompareSeriesRefId.ts","../src/components/SceneTimeRangeCompare.tsx","../src/components/SceneByFrameRepeater.tsx","../src/components/SceneByVariableRepeater.tsx","../src/components/SceneControlsSpacer.tsx","../src/components/layout/SceneFlexLayout.tsx","../src/components/layout/CSSGrid/SceneCSSGridLayout.tsx","../src/components/layout/split/Splitter.tsx","../src/components/layout/split/SplitLayoutRenderer.tsx","../src/components/layout/split/SplitLayout.ts","../src/components/SceneApp/SceneApp.tsx","../src/components/SceneReactObject.tsx","../src/components/SceneDebugger/DebugDetails.tsx","../src/components/SceneDebugger/DebugTreeNode.tsx","../src/components/SceneDebugger/SceneDebugger.tsx","../src/components/SceneApp/SceneAppPageView.tsx","../src/components/SceneApp/SceneAppPage.tsx","../src/core/PanelBuilders/StandardFieldConfigBuilders.ts","../src/core/PanelBuilders/FieldConfigOverridesBuilder.ts","../src/core/PanelBuilders/FieldConfigBuilder.ts","../src/core/PanelBuilders/PanelOptionsBuilder.ts","../src/core/PanelBuilders/VizPanelBuilder.ts","../src/core/PanelBuilders/PanelOptionsBuilders.ts","../src/core/PanelBuilders/FieldConfigBuilders.ts","../src/core/PanelBuilders/index.ts","../src/core/PanelBuilders/VizConfigBuilder.ts","../src/core/PanelBuilders/VizConfigBuilders.ts","../src/index.ts"],"sourcesContent":["import React from 'react';\nimport { RouteComponentProps, useLocation } from 'react-router-dom';\nimport { UrlQueryMap, locationUtil, urlUtil } from '@grafana/data';\nimport { locationSearchToObject, locationService } from '@grafana/runtime';\nimport { SceneObject } from '../../core/types';\n\nexport function useAppQueryParams(): UrlQueryMap {\n const location = useLocation();\n return locationSearchToObject(location.search || '');\n}\n\n/**\n *\n * @param path Url to append query params to\n * @param preserveParams Query params to preserve\n * @returns Url with query params\n */\nexport function getUrlWithAppState(path: string, preserveParams?: string[]): string {\n // make a copy of params as the renderUrl function mutates the object\n const paramsCopy = { ...locationService.getSearchObject() };\n\n if (preserveParams) {\n for (const key of Object.keys(paramsCopy)) {\n // if param is not in preserveParams, remove it\n if (!preserveParams.includes(key)) {\n delete paramsCopy[key];\n }\n }\n }\n\n return urlUtil.renderUrl(locationUtil.assureBaseUrl(path), paramsCopy);\n}\n\nexport function renderSceneComponentWithRouteProps(sceneObject: SceneObject, routeProps: RouteComponentProps) {\n // @ts-ignore\n return React.createElement(sceneObject.Component, { model: sceneObject, routeProps: routeProps });\n}\n","import { PanelPlugin, PluginMetaInfo } from '@grafana/data';\nimport { getPluginImportUtils } from '@grafana/runtime';\n\nexport const runtimePanelPlugins = new Map<string, PanelPlugin>();\n\nexport interface RuntimePanelPluginOptions {\n /**\n * Please specify a pluginId that is unlikely to collide with other plugins.\n */\n pluginId: string;\n plugin: PanelPlugin;\n}\n\n/**\n * Provides a way to register runtime panel plugins.\n * Please use a pluginId that is unlikely to collide with other plugins.\n */\nexport function registerRuntimePanelPlugin({ pluginId, plugin }: RuntimePanelPluginOptions) {\n if (runtimePanelPlugins.has(pluginId)) {\n throw new Error(`A runtime panel plugin with id ${pluginId} has already been registered`);\n }\n\n plugin.meta = {\n ...plugin.meta,\n id: pluginId,\n name: pluginId,\n module: 'runtime plugin',\n baseUrl: 'runtime plugin',\n info: {\n author: {\n name: 'Runtime plugin ' + pluginId,\n },\n description: '',\n links: [],\n logos: {\n large: '',\n small: '',\n },\n screenshots: [],\n updated: '',\n version: '',\n } as PluginMetaInfo,\n };\n\n runtimePanelPlugins.set(pluginId, plugin);\n}\n\nexport function loadPanelPluginSync(pluginId: string) {\n const { getPanelPluginFromCache } = getPluginImportUtils();\n\n return getPanelPluginFromCache(pluginId) ?? runtimePanelPlugins.get(pluginId);\n}\n","import React, { useEffect, useState } from 'react';\n\nimport { SceneComponentProps, SceneObject } from './types';\n\nfunction SceneComponentWrapperWithoutMemo<T extends SceneObject>({ model, ...otherProps }: SceneComponentProps<T>) {\n const Component = (model as any).constructor['Component'] ?? EmptyRenderer;\n const [_, setValue] = useState(0);\n\n useEffect(() => {\n const unsub = model.activate();\n setValue((prevState) => prevState + 1);\n return unsub;\n }, [model]);\n\n // By not rendering the component until the model is actiavted we make sure that parent models get activated before child models\n // Otherwise child models would be activated before parents as that is the order of React mount effects.\n // This also enables static logic to happen inside activate that can change state before the first render.\n if (!model.isActive) {\n return null;\n }\n\n return <Component {...otherProps} model={model} />;\n}\n\nexport const SceneComponentWrapper = React.memo(SceneComponentWrapperWithoutMemo);\n\nfunction EmptyRenderer<T>(_: SceneComponentProps<T>): React.ReactElement | null {\n return null;\n}\n","import { BusEventWithPayload } from '@grafana/data';\n\nimport { SceneObject, SceneObjectState } from './types';\n\nexport interface SceneObjectStateChangedPayload<TState extends SceneObjectState = SceneObjectState> {\n prevState: TState;\n newState: TState;\n partialUpdate: Partial<TState>;\n changedObject: SceneObject<TState>;\n}\n\nexport class SceneObjectStateChangedEvent extends BusEventWithPayload<SceneObjectStateChangedPayload> {\n public static readonly type = 'scene-object-state-change';\n}\n\ntype UserActionEventType =\n | 'panel-description-shown'\n | 'panel-status-message-clicked'\n | 'panel-cancel-query-clicked'\n | 'panel-menu-shown';\n\ninterface UserActionEventPayload {\n origin: SceneObject;\n interaction: UserActionEventType;\n}\nexport class UserActionEvent extends BusEventWithPayload<UserActionEventPayload> {\n public static readonly type = 'scene-object-user-action';\n}\n","export class SceneObjectRef<T> {\n #ref: T;\n\n public constructor(ref: T) {\n this.#ref = ref;\n }\n\n public resolve(): T {\n return this.#ref;\n }\n}\n","import { useEffect, useState } from 'react';\nimport { Subscription, Unsubscribable } from 'rxjs';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { BusEvent, BusEventHandler, BusEventType, EventBus, EventBusSrv } from '@grafana/data';\nimport {\n SceneObject,\n SceneComponent,\n SceneObjectUrlSyncHandler,\n SceneStateChangedHandler,\n SceneActivationHandler,\n SceneDeactivationHandler,\n CancelActivationHandler,\n SceneObjectState,\n UseStateHookOptions,\n SceneStatelessBehavior,\n} from './types';\n\nimport { SceneComponentWrapper } from './SceneComponentWrapper';\nimport { SceneObjectStateChangedEvent } from './events';\nimport { cloneSceneObject } from './sceneGraph/utils';\nimport { SceneVariableDependencyConfigLike } from '../variables/types';\nimport { SceneObjectRef } from './SceneObjectRef';\n\nexport abstract class SceneObjectBase<TState extends SceneObjectState = SceneObjectState>\n implements SceneObject<TState>\n{\n private _isActive = false;\n private _state: TState;\n private _activationHandlers: SceneActivationHandler[] = [];\n private _deactivationHandlers = new Map<object, SceneDeactivationHandler>();\n private _ref?: SceneObjectRef<this>;\n\n protected _events?: EventBus;\n protected _parent?: SceneObject;\n protected _subs = new Subscription();\n protected _refCount = 0;\n\n protected _variableDependency: SceneVariableDependencyConfigLike | undefined;\n protected _urlSync: SceneObjectUrlSyncHandler | undefined;\n\n public constructor(state: TState) {\n if (!state.key) {\n state.key = uuidv4();\n }\n\n this._events = new EventBusSrv();\n\n this._state = Object.freeze(state);\n this._setParent(this._state);\n }\n\n /** Current state */\n public get state(): TState {\n return this._state;\n }\n\n /** True if currently being active (ie displayed for visual objects) */\n public get isActive(): boolean {\n return this._isActive;\n }\n\n /** Returns the parent, undefined for root object */\n public get parent(): SceneObject | undefined {\n return this._parent;\n }\n\n /** Returns variable dependency config */\n public get variableDependency(): SceneVariableDependencyConfigLike | undefined {\n return this._variableDependency;\n }\n\n /** Returns url sync config */\n public get urlSync(): SceneObjectUrlSyncHandler | undefined {\n return this._urlSync;\n }\n\n /**\n * Used in render functions when rendering a SceneObject.\n * Wraps the component in an EditWrapper that handles edit mode\n */\n public get Component(): SceneComponent<this> {\n return SceneComponentWrapper as SceneComponent<this>;\n }\n\n private _setParent(state: Partial<TState>) {\n forEachChild(state, (child) => {\n // If we already have a parent and it's not this, then we likely have a bug\n if (child._parent && child._parent !== this) {\n console.warn(\n 'SceneObject already has a parent set that is different from the new parent. You cannot share the same SceneObject instance in multiple scenes or in multiple different places of the same scene graph. Use SceneObject.clone() to duplicate a SceneObject or store a state key reference and use sceneGraph.findObject to locate it.',\n child,\n this\n );\n }\n child._parent = this;\n });\n }\n\n /**\n * Subscribe to the scene state subject\n **/\n public subscribeToState(handler: SceneStateChangedHandler<TState>): Unsubscribable {\n return this._events!.subscribe(SceneObjectStateChangedEvent, (event) => {\n if (event.payload.changedObject === this) {\n handler(event.payload.newState as TState, event.payload.prevState as TState);\n }\n });\n }\n\n /**\n * Subscribe to the scene event\n **/\n public subscribeToEvent<T extends BusEvent>(eventType: BusEventType<T>, handler: BusEventHandler<T>): Unsubscribable {\n return this._events!.subscribe(eventType, handler);\n }\n\n public setState(update: Partial<TState>) {\n const prevState = this._state;\n const newState: TState = {\n ...this._state,\n ...update,\n };\n\n this._state = Object.freeze(newState);\n this._setParent(update);\n\n // Handles cases when $data, $timeRange, or $variables are changed\n this._handleActivationOfChangedStateProps(prevState, newState);\n\n // Bubble state change event. This is event is subscribed to by UrlSyncManager and UndoManager\n this.publishEvent(\n new SceneObjectStateChangedEvent({\n prevState,\n newState,\n partialUpdate: update,\n changedObject: this,\n }),\n true\n );\n }\n\n /**\n * This handles activation and deactivation of $data, $timeRange and $variables when they change\n * during the active phase of the scene object.\n */\n private _handleActivationOfChangedStateProps(prevState: TState, newState: TState) {\n if (!this.isActive) {\n return;\n }\n\n if (prevState.$behaviors !== newState.$behaviors) {\n this._handleChangedBehaviors(prevState.$behaviors, newState.$behaviors);\n }\n\n if (prevState.$data !== newState.$data) {\n this._handleChangedStateActivation(prevState.$data, newState.$data);\n }\n\n if (prevState.$variables !== newState.$variables) {\n this._handleChangedStateActivation(prevState.$variables, newState.$variables);\n }\n\n if (prevState.$timeRange !== newState.$timeRange) {\n this._handleChangedStateActivation(prevState.$timeRange, newState.$timeRange);\n }\n }\n\n private _handleChangedStateActivation(oldValue: SceneObject | undefined, newValue: SceneObject | undefined) {\n if (oldValue) {\n const deactivationHandler = this._deactivationHandlers.get(oldValue);\n if (deactivationHandler) {\n deactivationHandler();\n this._deactivationHandlers.delete(oldValue);\n }\n }\n\n if (newValue) {\n this._deactivationHandlers.set(newValue, newValue.activate());\n }\n }\n\n private _handleChangedBehaviors(\n oldValue: Array<SceneObject | SceneStatelessBehavior> | undefined,\n newValue: Array<SceneObject | SceneStatelessBehavior> | undefined\n ) {\n // Handle removed behaviors\n if (oldValue) {\n for (const oldBehavior of oldValue) {\n if (!newValue || !newValue.includes(oldBehavior)) {\n const deactivationHandler = this._deactivationHandlers.get(oldBehavior);\n if (deactivationHandler) {\n deactivationHandler();\n this._deactivationHandlers.delete(oldBehavior);\n }\n }\n }\n }\n\n // Handle new behaviors\n if (newValue) {\n for (const newBehavior of newValue) {\n if (!oldValue || !oldValue.includes(newBehavior)) {\n this._activateBehavior(newBehavior);\n }\n }\n }\n }\n\n /*\n * Publish an event and optionally bubble it up the scene\n **/\n public publishEvent(event: BusEvent, bubble?: boolean) {\n this._events!.publish(event);\n\n if (bubble && this.parent) {\n this.parent.publishEvent(event, bubble);\n }\n }\n\n public getRoot(): SceneObject {\n return !this._parent ? this : this._parent.getRoot();\n }\n\n private _internalActivate() {\n this._isActive = true;\n\n const { $data, $variables, $timeRange, $behaviors } = this.state;\n\n this._activationHandlers.forEach((handler) => {\n const result = handler();\n if (result) {\n this._deactivationHandlers.set(result, result);\n }\n });\n\n if ($timeRange && !$timeRange.isActive) {\n this._deactivationHandlers.set($timeRange, $timeRange.activate());\n }\n\n if ($variables && !$variables.isActive) {\n this._deactivationHandlers.set($variables, $variables.activate());\n }\n\n if ($data && !$data.isActive) {\n this._deactivationHandlers.set($data, $data.activate());\n }\n\n if ($behaviors) {\n for (const behavior of $behaviors) {\n this._activateBehavior(behavior);\n }\n }\n }\n\n private _activateBehavior(behavior: SceneObject | SceneStatelessBehavior): SceneDeactivationHandler | void {\n if (behavior instanceof SceneObjectBase) {\n this._deactivationHandlers.set(behavior, behavior.activate());\n } else if (typeof behavior === 'function') {\n const deactivate = behavior(this);\n if (deactivate) {\n this._deactivationHandlers.set(behavior, deactivate);\n }\n }\n }\n\n /**\n * This is primarily called from SceneComponentWrapper when the SceneObject's Component is mounted.\n * But in some scenarios this can also be called directly from another scene object. When called manually from another scene object\n * make sure to call the returned function when the source scene object is deactivated.\n */\n public activate(): CancelActivationHandler {\n if (!this.isActive) {\n this._internalActivate();\n }\n\n this._refCount++;\n\n let called = false;\n\n return () => {\n this._refCount--;\n\n if (called) {\n const msg = `SceneObject cancelation handler returned by activate() called a second time`;\n throw new Error(msg);\n }\n\n called = true;\n\n if (this._refCount === 0) {\n this._internalDeactivate();\n }\n };\n }\n\n /**\n * Called by the SceneComponentWrapper when the react component is unmounted.\n * Don't override this, instead use addActivationHandler. The activation handler can return a deactivation handler.\n */\n private _internalDeactivate(): void {\n this._isActive = false;\n\n for (let handler of this._deactivationHandlers.values()) {\n handler();\n }\n\n this._deactivationHandlers.clear();\n\n // Clear subscriptions and listeners\n this._events!.removeAllListeners();\n this._subs.unsubscribe();\n this._subs = new Subscription();\n }\n\n /**\n * Utility hook to get and subscribe to state\n */\n public useState(): TState {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useSceneObjectState(this);\n }\n\n /** Force a re-render, should only be needed when variable values change */\n public forceRender(): void {\n this.setState({});\n }\n\n /**\n * Will create new SceneObject with shallow-cloned state, but all state items of type SceneObject are deep cloned\n */\n public clone(withState?: Partial<TState>): this {\n return cloneSceneObject(this, withState);\n }\n\n /**\n * Allows external code to register code that is executed on activate and deactivate. This allow you\n * to wire up scene objects that need to respond to state changes in other objects from the outside.\n **/\n public addActivationHandler(handler: SceneActivationHandler) {\n this._activationHandlers.push(handler);\n }\n\n /**\n * Loop through state and call callback for each direct child scene object.\n * Checks 1 level deep properties and arrays. So a scene object hidden in a nested plain object will not be detected.\n */\n public forEachChild(callback: (child: SceneObjectBase) => void) {\n forEachChild(this.state, callback);\n }\n\n /** Returns a SceneObjectRef that will resolve to this object */\n public getRef(): SceneObjectRef<this> {\n if (!this._ref) {\n this._ref = new SceneObjectRef(this);\n }\n\n return this._ref;\n }\n}\n\n/**\n * This hook is always returning model.state instead of a useState that remembers the last state emitted on the subject\n * The reason for this is so that if the model instance change this function will always return the latest state.\n */\nexport function useSceneObjectState<TState extends SceneObjectState>(\n model: SceneObject<TState>,\n options?: UseStateHookOptions\n): TState {\n const [_, setState] = useState<TState>(model.state);\n const stateAtFirstRender = model.state;\n const shouldActivateOrKeepAlive = options?.shouldActivateOrKeepAlive ?? false;\n\n useEffect(() => {\n let unactivate: CancelActivationHandler | undefined;\n\n if (shouldActivateOrKeepAlive) {\n unactivate = model.activate();\n }\n\n const s = model.subscribeToState((state) => {\n setState(state);\n });\n\n // Re-render component if the state changed between first render and useEffect (mount)\n if (model.state !== stateAtFirstRender) {\n setState(model.state);\n }\n\n return () => {\n s.unsubscribe();\n\n if (unactivate) {\n unactivate();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [model, shouldActivateOrKeepAlive]);\n\n return model.state;\n}\n\nfunction forEachChild<T extends object>(state: T, callback: (child: SceneObjectBase) => void) {\n for (const propValue of Object.values(state)) {\n if (propValue instanceof SceneObjectBase) {\n callback(propValue);\n }\n\n if (Array.isArray(propValue)) {\n for (const child of propValue) {\n if (child instanceof SceneObjectBase) {\n callback(child);\n }\n }\n }\n }\n}\n","import { SceneObject, SceneObjectState } from '../types';\n\nimport { SceneObjectBase } from '../SceneObjectBase';\nimport { SceneObjectRef } from '../SceneObjectRef';\n\n/**\n * Will create new SceneItem with shalled cloned state, but all states items of type SceneObject are deep cloned\n */\nexport function cloneSceneObject<T extends SceneObjectBase<TState>, TState extends SceneObjectState>(\n sceneObject: SceneObjectBase<TState>,\n withState?: Partial<TState>\n): T {\n const clonedState = cloneSceneObjectState(sceneObject.state, withState);\n return new (sceneObject.constructor as any)(clonedState);\n}\n\nexport function cloneSceneObjectState<TState extends SceneObjectState>(\n sceneState: TState,\n withState?: Partial<TState>\n): TState {\n const clonedState = { ...sceneState };\n\n // Clone any SceneItems in state\n for (const key in clonedState) {\n const propValue = clonedState[key];\n if (propValue instanceof SceneObjectBase) {\n clonedState[key] = propValue.clone();\n }\n\n if (propValue instanceof SceneObjectRef) {\n throw new Error('Cannot clone a SceneObject with a SceneObjectRef in state');\n }\n\n // Clone scene objects in arrays\n if (Array.isArray(propValue)) {\n const newArray: any = [];\n for (const child of propValue) {\n if (child instanceof SceneObjectBase) {\n newArray.push(child.clone());\n } else {\n newArray.push(child);\n }\n }\n clonedState[key] = newArray;\n }\n }\n\n Object.assign(clonedState, withState);\n\n return clonedState;\n}\n\n/** Walks up the scene graph, returning the first non-undefined result of `extract` */\nexport function getClosest<T>(sceneObject: SceneObject, extract: (s: SceneObject) => T | undefined): T | undefined {\n let curSceneObject: SceneObject | undefined = sceneObject;\n let extracted: T | undefined = undefined;\n\n while (curSceneObject && !extracted) {\n extracted = extract(curSceneObject);\n curSceneObject = curSceneObject.parent;\n }\n\n return extracted;\n}\n","import { DataQuery, DataSourceApi, PluginType } from '@grafana/data';\n\nexport abstract class RuntimeDataSource<TQuery extends DataQuery = DataQuery> extends DataSourceApi<TQuery> {\n public constructor(pluginId: string, uid: string) {\n super({\n name: 'RuntimeDataSource-' + pluginId,\n uid: uid,\n type: pluginId,\n id: 1,\n readOnly: true,\n jsonData: {},\n access: 'direct',\n meta: {\n id: pluginId,\n name: 'RuntimeDataSource-' + pluginId,\n type: PluginType.datasource,\n info: {\n author: {\n name: '',\n },\n description: '',\n links: [],\n logos: {\n large: '',\n small: '',\n },\n screenshots: [],\n updated: '',\n version: '',\n },\n module: '',\n baseUrl: '',\n },\n });\n }\n\n public testDatasource(): Promise<any> {\n return Promise.resolve({});\n }\n}\n\nexport const runtimeDataSources = new Map<string, RuntimeDataSource>();\n\nexport interface RuntimeDataSourceOptions {\n dataSource: RuntimeDataSource;\n}\n\n/**\n * Provides a way to register runtime panel plugins.\n * Please use a pluginId that is unlikely to collide with other plugins.\n */\nexport function registerRuntimeDataSource({ dataSource }: RuntimeDataSourceOptions) {\n if (runtimeDataSources.has(dataSource.uid)) {\n throw new Error(`A runtime data source with uid ${dataSource.uid} has already been registered`);\n }\n\n runtimeDataSources.set(dataSource.uid, dataSource);\n}\n","import { SceneObject } from '../core/types';\nimport { SceneVariable } from './types';\n\n/**\n * Will walk the scene object graph up to the root looking for the first variable with the specified name\n */\nexport function lookupVariable(name: string, sceneObject: SceneObject): SceneVariable | null {\n const variables = sceneObject.state.$variables;\n if (!variables) {\n if (sceneObject.parent) {\n return lookupVariable(name, sceneObject.parent);\n } else {\n return null;\n }\n }\n\n const found = variables.getByName(name);\n if (found) {\n return found;\n } else if (sceneObject.parent) {\n return lookupVariable(name, sceneObject.parent);\n }\n\n return null;\n}\n","import { getDefaultTimeRange, PanelData } from '@grafana/data';\nimport { LoadingState } from '@grafana/schema';\nimport { of } from 'rxjs';\n\nimport { SceneObjectBase } from './SceneObjectBase';\nimport { SceneDataProvider, SceneDataProviderResult, SceneDataState } from './types';\n\nexport interface SceneDataNodeState extends SceneDataState {\n data: PanelData;\n}\n\nexport class SceneDataNode extends SceneObjectBase<SceneDataNodeState> implements SceneDataProvider {\n public constructor(state?: Partial<SceneDataNodeState>) {\n super({\n data: emptyPanelData,\n ...state,\n });\n }\n\n public getResultsStream() {\n const result: SceneDataProviderResult = {\n origin: this,\n data: this.state.data,\n };\n\n return of(result);\n }\n}\n\nexport const emptyPanelData: PanelData = {\n state: LoadingState.Done,\n series: [],\n timeRange: getDefaultTimeRange(),\n};\n","import { SceneObjectUrlSyncHandler, SceneObjectWithUrlSync, SceneObjectUrlValues } from '../core/types';\n\ninterface SceneObjectUrlSyncConfigOptions {\n keys: string[] | (() => string[]);\n}\n\nexport class SceneObjectUrlSyncConfig implements SceneObjectUrlSyncHandler {\n private _keys: string[] | (() => string[]);\n\n public constructor(private _sceneObject: SceneObjectWithUrlSync, _options: SceneObjectUrlSyncConfigOptions) {\n this._keys = _options.keys;\n }\n\n public getKeys(): string[] {\n if (typeof this._keys === 'function') {\n return this._keys();\n }\n\n return this._keys;\n }\n\n public getUrlState(): SceneObjectUrlValues {\n return this._sceneObject.getUrlState();\n }\n\n public updateFromUrl(values: SceneObjectUrlValues): void {\n this._sceneObject.updateFromUrl(values);\n }\n}\n","import { toUtc } from '@grafana/data';\nimport { SceneObjectUrlValue } from '../core/types';\n\nconst INTERVAL_STRING_REGEX = /^\\d+[yYmMsSwWhHdD]$/;\n\nexport function parseUrlParam(value: SceneObjectUrlValue): string | null {\n if (typeof value !== 'string') {\n return null;\n }\n\n if (value.indexOf('now') !== -1) {\n return value;\n }\n\n if (INTERVAL_STRING_REGEX.test(value)) {\n return value;\n }\n\n if (value.length === 8) {\n const utcValue = toUtc(value, 'YYYYMMDD');\n if (utcValue.isValid()) {\n return utcValue.toISOString();\n }\n } else if (value.length === 15) {\n const utcValue = toUtc(value, 'YYYYMMDDTHHmmss');\n if (utcValue.isValid()) {\n return utcValue.toISOString();\n }\n } else if (value.length === 24) {\n const utcValue = toUtc(value);\n return utcValue.toISOString();\n }\n\n const epoch = parseInt(value, 10);\n if (!isNaN(epoch)) {\n return toUtc(epoch).toISOString();\n }\n\n return null;\n}\n","import { dateMath, DateTime, TimeRange } from '@grafana/data';\nimport { TimeZone } from '@grafana/schema';\n\nexport function evaluateTimeRange(\n from: string | DateTime,\n to: string | DateTime,\n timeZone: TimeZone,\n fiscalYearStartMonth?: number,\n delay?: string\n): TimeRange {\n const hasDelay = delay && to === 'now';\n\n return {\n from: dateMath.parse(from, false, timeZone, fiscalYearStartMonth)!,\n to: dateMath.parse(hasDelay ? 'now-' + delay : to, true, timeZone, fiscalYearStartMonth)!,\n raw: {\n from: from,\n to: to,\n },\n };\n}\n","import { getTimeZone, rangeUtil, setWeekStart, TimeRange } from '@grafana/data';\nimport { TimeZone } from '@grafana/schema';\n\nimport { SceneObjectUrlSyncConfig } from '../services/SceneObjectUrlSyncConfig';\n\nimport { SceneObjectBase } from './SceneObjectBase';\nimport { SceneTimeRangeLike, SceneTimeRangeState, SceneObjectUrlValues } from './types';\nimport { getClosest } from './sceneGraph/utils';\nimport { parseUrlParam } from '../utils/parseUrlParam';\nimport { evaluateTimeRange } from '../utils/evaluateTimeRange';\nimport { config, RefreshEvent } from '@grafana/runtime';\n\nexport class SceneTimeRange extends SceneObjectBase<SceneTimeRangeState> implements SceneTimeRangeLike {\n protected _urlSync = new SceneObjectUrlSyncConfig(this, { keys: ['from', 'to', 'timezone'] });\n\n public constructor(state: Partial<SceneTimeRangeState> = {}) {\n const from = state.from ?? 'now-6h';\n const to = state.to ?? 'now';\n const timeZone = state.timeZone;\n const value = evaluateTimeRange(\n from,\n to,\n timeZone || getTimeZone(),\n state.fiscalYearStartMonth,\n state.UNSAFE_nowDelay\n );\n const refreshOnActivate = state.refreshOnActivate ?? { percent: 10 };\n super({ from, to, timeZone, value, refreshOnActivate, ...state });\n\n this.addActivationHandler(this._onActivate.bind(this));\n }\n\n private _onActivate() {\n // When SceneTimeRange has no time zone provided, find closest source of time zone and subscribe to it\n if (!this.state.timeZone) {\n const timeZoneSource = this.getTimeZoneSource();\n if (timeZoneSource !== this) {\n this._subs.add(\n timeZoneSource.subscribeToState((n, p) => {\n if (n.timeZone !== undefined && n.timeZone !== p.timeZone) {\n this.setState({\n value: evaluateTimeRange(\n this.state.from,\n this.state.to,\n timeZoneSource.getTimeZone(),\n this.state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n ),\n });\n }\n })\n );\n }\n }\n\n if (this.state.weekStart) {\n setWeekStart(this.state.weekStart);\n }\n\n if (rangeUtil.isRelativeTimeRange(this.state.value.raw)) {\n this.refreshIfStale();\n }\n\n // Deactivation handler that restore weekStart if it was changed\n return () => {\n if (this.state.weekStart) {\n setWeekStart(config.bootData.user.weekStart);\n }\n };\n }\n\n private refreshIfStale() {\n let ms;\n if (this.state?.refreshOnActivate?.percent !== undefined) {\n ms = this.calculatePercentOfInterval(this.state.refreshOnActivate.percent);\n }\n if (this.state?.refreshOnActivate?.afterMs !== undefined) {\n ms = Math.min(this.state.refreshOnActivate.afterMs, ms ?? Infinity);\n }\n if (ms !== undefined) {\n this.refreshRange(ms);\n }\n }\n\n /**\n * Will traverse up the scene graph to find the closest SceneTimeRangeLike with time zone set\n */\n private getTimeZoneSource() {\n if (!this.parent || !this.parent.parent) {\n return this;\n }\n // Find the closest source of time zone\n const source = getClosest<SceneTimeRangeLike>(this.parent.parent, (o) => {\n if (o.state.$timeRange && o.state.$timeRange.state.timeZone) {\n return o.state.$timeRange;\n }\n return undefined;\n });\n\n if (!source) {\n return this;\n }\n\n return source;\n }\n\n /**\n * Refreshes time range if it is older than the invalidation interval\n * @param refreshAfterMs invalidation interval (milliseconds)\n * @private\n */\n private refreshRange(refreshAfterMs: number) {\n const value = evaluateTimeRange(\n this.state.from,\n this.state.to,\n this.state.timeZone ?? getTimeZone(),\n this.state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n );\n\n const diff = value.to.diff(this.state.value.to, 'milliseconds');\n if (diff >= refreshAfterMs) {\n this.setState({\n value,\n });\n }\n }\n\n private calculatePercentOfInterval(percent: number): number {\n const intervalMs = this.state.value.to.diff(this.state.value.from, 'milliseconds');\n return Math.ceil(intervalMs / percent);\n }\n\n public getTimeZone(): TimeZone {\n // Return local time zone if provided\n if (this.state.timeZone) {\n return this.state.timeZone;\n }\n\n // Resolve higher level time zone source\n const timeZoneSource = this.getTimeZoneSource();\n if (timeZoneSource !== this) {\n return timeZoneSource.state.timeZone!;\n }\n\n // Return default time zone\n return getTimeZone();\n }\n\n public onTimeRangeChange = (timeRange: TimeRange) => {\n const update: Partial<SceneTimeRangeState> = {};\n const updateToEval: Partial<SceneTimeRangeState> = {};\n\n if (typeof timeRange.raw.from === 'string') {\n update.from = timeRange.raw.from;\n updateToEval.from = timeRange.raw.from;\n } else {\n update.from = timeRange.raw.from.toISOString();\n updateToEval.from = timeRange.raw.from.toISOString(true);\n }\n\n if (typeof timeRange.raw.to === 'string') {\n update.to = timeRange.raw.to;\n updateToEval.to = timeRange.raw.to;\n } else {\n update.to = timeRange.raw.to.toISOString();\n updateToEval.to = timeRange.raw.to.toISOString(true);\n }\n\n update.value = evaluateTimeRange(\n updateToEval.from,\n updateToEval.to,\n this.getTimeZone(),\n this.state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n );\n\n // Only update if time range actually changed\n if (update.from !== this.state.from || update.to !== this.state.to) {\n this.setState(update);\n }\n };\n\n public onTimeZoneChange = (timeZone: TimeZone) => {\n this.setState({ timeZone });\n };\n\n public onRefresh = () => {\n this.setState({\n value: evaluateTimeRange(\n this.state.from,\n this.state.to,\n this.getTimeZone(),\n this.state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n ),\n });\n\n this.publishEvent(new RefreshEvent(), true);\n };\n\n public getUrlState() {\n const urlValues: SceneObjectUrlValues = { from: this.state.from, to: this.state.to };\n if (this.state.timeZone) {\n urlValues.timezone = this.state.timeZone;\n }\n\n return urlValues;\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n // ignore if both are missing\n if (!values.to && !values.from) {\n return;\n }\n\n const update: Partial<SceneTimeRangeState> = {};\n const from = parseUrlParam(values.from);\n\n if (from) {\n update.from = from;\n }\n\n const to = parseUrlParam(values.to);\n if (to) {\n update.to = to;\n }\n\n if (typeof values.timezone === 'string') {\n update.timeZone = values.timezone !== '' ? values.timezone : undefined;\n }\n\n update.value = evaluateTimeRange(\n update.from ?? this.state.from,\n update.to ?? this.state.to,\n update.timeZone ?? this.getTimeZone(),\n this.state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n );\n\n this.setState(update);\n }\n}\n","import { SceneDataNode } from '../../core/SceneDataNode';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneTimeRange } from '../../core/SceneTimeRange';\nimport { SceneVariable, SceneVariables, SceneVariableSetState, SceneVariableState } from '../types';\n\nexport const EmptyDataNode = new SceneDataNode();\nexport const DefaultTimeRange = new SceneTimeRange();\n\n/**\n * Since this is used from sceneGraph.getVariables we cannot reference SceneVariableSet here as it would create a circular reference\n */\nexport class EmptyVariableSetImpl extends SceneObjectBase<SceneVariableSetState> implements SceneVariables {\n public constructor() {\n super({ variables: [] });\n }\n\n public getByName(name: string): SceneVariable<SceneVariableState> | undefined {\n return undefined;\n }\n\n public isVariableLoadingOrWaitingToUpdate(variable: SceneVariable<SceneVariableState>): boolean {\n return false;\n }\n}\n\nexport const EmptyVariableSet = new EmptyVariableSetImpl();\n","import { DefaultTimeRange } from '../../variables/interpolation/defaults';\nimport { SceneObject, SceneTimeRangeLike } from '../types';\nimport { getClosest } from './utils';\n\n/**\n * Will walk up the scene object graph to the closest $timeRange scene object\n */\nexport function getTimeRange(sceneObject: SceneObject): SceneTimeRangeLike {\n return getClosest(sceneObject, (s) => s.state.$timeRange) ?? DefaultTimeRange;\n}\n","import { Observable } from 'rxjs';\n\nimport { BusEventWithPayload } from '@grafana/data';\nimport { VariableType, VariableHide } from '@grafana/schema';\n\nimport { SceneObject, SceneObjectState } from '../core/types';\n\nexport interface SceneVariableState extends SceneObjectState {\n type: VariableType;\n name: string;\n label?: string;\n hide?: VariableHide;\n skipUrlSync?: boolean;\n loading?: boolean;\n error?: any | null;\n description?: string | null;\n}\n\nexport interface SceneVariable<TState extends SceneVariableState = SceneVariableState> extends SceneObject<TState> {\n /**\n * This function is called on activation or when a dependency changes.\n */\n validateAndUpdate?(): Observable<ValidateAndUpdateResult>;\n\n /**\n * Should return the value for the given field path\n */\n getValue(fieldPath?: string): VariableValue | undefined | null;\n\n /**\n * Should return the value display text, used by the \"text\" formatter\n * Example: ${podId:text}\n * Useful for variables that have non user friendly values but friendly display text names.\n */\n getValueText?(fieldPath?: string): string;\n\n /**\n * For special edge case senarios. For example local function that locally scoped variables can implement.\n **/\n isAncestorLoading?(): boolean;\n\n /**\n * Allows cancelling variable execution.\n */\n onCancel?(): void;\n\n /**\n * @experimental\n * Indicates that a variable loads values lazily when user interacts with the variable dropdown.\n */\n isLazy?: boolean;\n}\n\nexport type VariableValue = VariableValueSingle | VariableValueSingle[];\n\nexport type VariableValueSingle = string | boolean | number | CustomVariableValue;\n\n/**\n * This is for edge case values like the custom \"allValue\" that should not be escaped/formatted like other values\n * The custom all value usually contain wildcards that should not be escaped.\n */\nexport interface CustomVariableValue {\n /**\n * The format name or function used in the expression\n */\n formatter(formatNameOrFn?: string | VariableCustomFormatterFn): string;\n}\n\nexport interface ValidateAndUpdateResult {}\nexport interface VariableValueOption {\n label: string;\n value: VariableValueSingle;\n group?: string;\n}\n\nexport interface SceneVariableSetState extends SceneObjectState {\n variables: SceneVariable[];\n}\n\nexport interface SceneVariables extends SceneObject<SceneVariableSetState> {\n /**\n * Will look for and return variable matching name\n */\n getByName(name: string): SceneVariable | undefined;\n /**\n * Will return true if the variable is loading or waiting for an update to complete.\n */\n isVariableLoadingOrWaitingToUpdate(variable: SceneVariable): boolean;\n}\n\nexport class SceneVariableValueChangedEvent extends BusEventWithPayload<SceneVariable> {\n public static type = 'scene-variable-changed-value';\n}\n\nexport interface SceneVariableDependencyConfigLike {\n /** Return all variable names this object depend on */\n getNames(): Set<string>;\n\n /** Used to check for dependency on a specific variable */\n hasDependencyOn(name: string): boolean;\n\n /**\n * Will be called when the VariableSet have completed an update process or when a variable has changed value.\n **/\n variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void;\n}\n\n/**\n * Used in CustomFormatterFn\n */\nexport interface CustomFormatterVariable {\n name: string;\n type: VariableType;\n multi?: boolean;\n includeAll?: boolean;\n}\n\nexport type VariableCustomFormatterFn = (\n value: unknown,\n legacyVariableModel: Partial<CustomFormatterVariable>,\n legacyDefaultFormatter?: VariableCustomFormatterFn\n) => string;\n\nexport type InterpolationFormatParameter = string | VariableCustomFormatterFn | undefined;\n\nexport function isCustomVariableValue(value: VariableValue): value is CustomVariableValue {\n return typeof value === 'object' && 'formatter' in value;\n}\n","import { property } from 'lodash';\n\ninterface FieldAccessorCache {\n [key: string]: (obj: object) => any;\n}\n\nlet fieldAccessorCache: FieldAccessorCache = {};\n\nexport function getFieldAccessor(fieldPath: string) {\n const accessor = fieldAccessorCache[fieldPath];\n if (accessor) {\n return accessor;\n }\n\n return (fieldAccessorCache[fieldPath] = property(fieldPath));\n}\n","import { ScopedVar } from '@grafana/data';\n\nimport { VariableValue } from '../types';\n\nimport { FormatVariable } from './formatRegistry';\nimport { getFieldAccessor } from './fieldAccessorCache';\n\nexport class ScopedVarsVariable implements FormatVariable {\n public state: { name: string; value: ScopedVar; type: string };\n\n public constructor(name: string, value: ScopedVar) {\n this.state = { name, value, type: 'scopedvar' };\n }\n\n public getValue(fieldPath: string): VariableValue {\n let { value } = this.state;\n let realValue = value.value;\n\n if (fieldPath) {\n realValue = getFieldAccessor(fieldPath)(value.value);\n } else {\n realValue = value.value;\n }\n\n if (realValue === 'string' || realValue === 'number' || realValue === 'boolean') {\n return realValue;\n }\n\n return String(realValue);\n }\n\n public getValueText(): string {\n const { value } = this.state;\n\n if (value.text != null) {\n return String(value.text);\n }\n\n return String(value);\n }\n}\n\nlet scopedVarsVariable: ScopedVarsVariable | undefined;\n\n/**\n * Reuses a single instance to avoid unnecessary memory allocations\n */\nexport function getSceneVariableForScopedVar(name: string, value: ScopedVar): FormatVariable {\n if (!scopedVarsVariable) {\n scopedVarsVariable = new ScopedVarsVariable(name, value);\n } else {\n scopedVarsVariable.state.name = name;\n scopedVarsVariable.state.value = value;\n }\n\n return scopedVarsVariable;\n}\n","export const ALL_VARIABLE_TEXT = 'All';\nexport const ALL_VARIABLE_VALUE = '$__all';\nexport const NONE_VARIABLE_TEXT = 'None';\nexport const NONE_VARIABLE_VALUE = '';\nexport const AUTO_VARIABLE_TEXT = 'Auto';\nexport const AUTO_VARIABLE_VALUE = '$__auto';\n\n// Grafana core source: https://github.com/grafana/grafana/blob/main/public/app/features/variables/utils.ts#L23\n/*\n * This regex matches 3 types of variable reference with an optional format specifier\n * \\$(\\w+) $var1\n * \\[\\[(\\w+?)(?::(\\w+))?\\]\\] [[var2]] or [[var2:fmt2]]\n * \\${(\\w+)(?::(\\w+))?} ${var3} or ${var3:fmt3}\n */\nexport const VARIABLE_REGEX = /\\$(\\w+)|\\[\\[(\\w+?)(?::(\\w+))?\\]\\]|\\${(\\w+)(?:\\.([^:^\\}]+))?(?::([^\\}]+))?}/g;\nexport const SEARCH_FILTER_VARIABLE = '__searchFilter';\n","import { isArray, map, replace } from 'lodash';\n\nimport { dateTime, Registry, RegistryItem, textUtil, escapeRegex } from '@grafana/data';\nimport { VariableType, VariableFormatID } from '@grafana/schema';\n\nimport { VariableValue, VariableValueSingle } from '../types';\nimport { ALL_VARIABLE_VALUE } from '../constants';\n\nexport interface FormatRegistryItem extends RegistryItem {\n formatter(value: VariableValue, args: string[], variable: FormatVariable): string;\n}\n\n/**\n * Slimmed down version of the SceneVariable interface so that it only contains what the formatters actually use.\n * This is useful as we have some implementations of this interface that does not need to be full scene objects.\n * For example ScopedVarsVariable and LegacyVariableWrapper.\n */\nexport interface FormatVariable {\n state: {\n name: string;\n type: VariableType | string;\n isMulti?: boolean;\n includeAll?: boolean;\n };\n\n getValue(fieldPath?: string): VariableValue | undefined | null;\n getValueText?(fieldPath?: string): string;\n}\n\nexport const formatRegistry = new Registry<FormatRegistryItem>(() => {\n const formats: FormatRegistryItem[] = [\n {\n id: VariableFormatID.Lucene,\n name: 'Lucene',\n description: 'Values are lucene escaped and multi-valued variables generate an OR expression',\n formatter: (value) => {\n if (typeof value === 'string') {\n return luceneEscape(value);\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '__empty__';\n }\n const quotedValues = map(value, (val: string) => {\n return '\"' + luceneEscape(val) + '\"';\n });\n return '(' + quotedValues.join(' OR ') + ')';\n } else {\n return luceneEscape(`${value}`);\n }\n },\n },\n {\n id: VariableFormatID.Raw,\n name: 'raw',\n description: 'Keep value as is',\n formatter: (value) => String(value),\n },\n {\n id: VariableFormatID.Regex,\n name: 'Regex',\n description: 'Values are regex escaped and multi-valued variables generate a (<value>|<value>) expression',\n formatter: (value) => {\n if (typeof value === 'string') {\n return escapeRegex(value);\n }\n\n if (Array.isArray(value)) {\n const escapedValues = value.map((item) => {\n if (typeof item === 'string') {\n return escapeRegex(item);\n } else {\n return escapeRegex(String(item));\n }\n });\n\n if (escapedValues.length === 1) {\n return escapedValues[0];\n }\n\n return '(' + escapedValues.join('|') + ')';\n }\n\n return escapeRegex(`${value}`);\n },\n },\n {\n id: VariableFormatID.Pipe,\n name: 'Pipe',\n description: 'Values are separated by | character',\n formatter: (value) => {\n if (typeof value === 'string') {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.join('|');\n }\n\n return `${value}`;\n },\n },\n {\n id: VariableFormatID.Distributed,\n name: 'Distributed',\n description: 'Multiple values are formatted like variable=value',\n formatter: (value, args, variable) => {\n if (typeof value === 'string') {\n return value;\n }\n\n if (Array.isArray(value)) {\n value = map(value, (val: string, index: number) => {\n if (index !== 0) {\n return variable.state.name + '=' + val;\n } else {\n return val;\n }\n });\n\n return value.join(',');\n }\n\n return `${value}`;\n },\n },\n {\n id: VariableFormatID.CSV,\n name: 'Csv',\n description: 'Comma-separated values',\n formatter: (value) => {\n if (typeof value === 'string') {\n return value;\n }\n\n if (isArray(value)) {\n return value.join(',');\n }\n\n return String(value);\n },\n },\n {\n id: VariableFormatID.HTML,\n name: 'HTML',\n description: 'HTML escaping of values',\n formatter: (value) => {\n if (typeof value === 'string') {\n return textUtil.escapeHtml(value);\n }\n\n if (isArray(value)) {\n return textUtil.escapeHtml(value.join(', '));\n }\n\n return textUtil.escapeHtml(String(value));\n },\n },\n {\n id: VariableFormatID.JSON,\n name: 'JSON',\n description: 'JSON stringify value',\n formatter: (value) => {\n if (typeof value === 'string') {\n return value;\n }\n return JSON.stringify(value);\n },\n },\n {\n id: VariableFormatID.PercentEncode,\n name: 'Percent encode',\n description: 'Useful for URL escaping values',\n formatter: (value) => {\n // like glob, but url escaped\n if (isArray(value)) {\n return encodeURIComponentStrict('{' + value.join(',') + '}');\n }\n\n return encodeURIComponentStrict(value);\n },\n },\n {\n id: VariableFormatID.SingleQuote,\n name: 'Single quote',\n description: 'Single quoted values',\n formatter: (value) => {\n // escape single quotes with backslash\n const regExp = new RegExp(`'`, 'g');\n\n if (isArray(value)) {\n return map(value, (v: string) => `'${replace(v, regExp, `\\\\'`)}'`).join(',');\n }\n\n let strVal = typeof value === 'string' ? value : String(value);\n return `'${replace(strVal, regExp, `\\\\'`)}'`;\n },\n },\n {\n id: VariableFormatID.DoubleQuote,\n name: 'Double quote',\n description: 'Double quoted values',\n formatter: (value) => {\n // escape double quotes with backslash\n const regExp = new RegExp('\"', 'g');\n if (isArray(value)) {\n return map(value, (v: string) => `\"${replace(v, regExp, '\\\\\"')}\"`).join(',');\n }\n\n let strVal = typeof value === 'string' ? value : String(value);\n return `\"${replace(strVal, regExp, '\\\\\"')}\"`;\n },\n },\n {\n id: VariableFormatID.SQLString,\n name: 'SQL string',\n description: 'SQL string quoting and commas for use in IN statements and other scenarios',\n formatter: sqlStringFormatter,\n },\n {\n id: VariableFormatID.Date,\n name: 'Date',\n description: 'Format date in different ways',\n formatter: (value, args) => {\n let nrValue = NaN;\n\n if (typeof value === 'number') {\n nrValue = value;\n } else if (typeof value === 'string') {\n nrValue = parseInt(value, 10);\n }\n\n if (isNaN(nrValue)) {\n return 'NaN';\n }\n\n const arg = args[0] ?? 'iso';\n switch (arg) {\n case 'ms':\n return String(value);\n case 'seconds':\n return `${Math.round(nrValue! / 1000)}`;\n case 'iso':\n return dateTime(nrValue).toISOString();\n default:\n if ((args || []).length > 1) {\n return dateTime(nrValue).format(args.join(':'));\n }\n return dateTime(nrValue).format(arg);\n }\n },\n },\n {\n id: VariableFormatID.Glob,\n name: 'Glob',\n description: 'Format multi-valued variables using glob syntax, example {value1,value2}',\n formatter: (value) => {\n if (isArray(value) && value.length > 1) {\n return '{' + value.join(',') + '}';\n }\n return String(value);\n },\n },\n {\n id: VariableFormatID.Text,\n name: 'Text',\n description: 'Format variables in their text representation. Example in multi-variable scenario A + B + C.',\n formatter: (value, _args, variable) => {\n if (variable.getValueText) {\n return variable.getValueText();\n }\n\n return String(value);\n },\n },\n {\n id: VariableFormatID.QueryParam,\n name: 'Query parameter',\n description:\n 'Format variables as URL parameters. Example in multi-variable scenario A + B + C => var-foo=A&var-foo=B&var-foo=C.',\n formatter: (value, _args, variable) => {\n if (Array.isArray(value)) {\n return value.map((v) => formatQueryParameter(variable.state.name, v)).join('&');\n }\n return formatQueryParameter(variable.state.name, value);\n },\n },\n {\n id: VariableFormatID.UriEncode,\n name: 'Percent encode as URI',\n description: 'Useful for URL escaping values, taking into URI syntax characters',\n formatter: (value: VariableValue) => {\n if (isArray(value)) {\n return encodeURIStrict('{' + value.join(',') + '}');\n }\n\n return encodeURIStrict(value);\n },\n },\n ];\n\n return formats;\n});\n\nfunction luceneEscape(value: string) {\n if (isNaN(+value) === false) {\n return value;\n }\n\n return value.replace(/([\\!\\*\\+\\-\\=<>\\s\\&\\|\\(\\)\\[\\]\\{\\}\\^\\~\\?\\:\\\\/\"])/g, '\\\\$1');\n}\n\n/**\n * encode string according to RFC 3986; in contrast to encodeURIComponent()\n * also the sub-delims \"!\", \"'\", \"(\", \")\" and \"*\" are encoded;\n * unicode handling uses UTF-8 as in ECMA-262.\n */\nfunction encodeURIComponentStrict(str: VariableValueSingle) {\n if (typeof str === 'object') {\n str = String(str);\n }\n\n return replaceSpecialCharactersToASCII(encodeURIComponent(str));\n}\n\nconst encodeURIStrict = (str: VariableValueSingle): string => replaceSpecialCharactersToASCII(encodeURI(String(str)));\n\nconst replaceSpecialCharactersToASCII = (value: string): string =>\n value.replace(/[!'()*]/g, (c) => {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase();\n });\n\nfunction formatQueryParameter(name: string, value: VariableValueSingle): string {\n return `var-${name}=${encodeURIComponentStrict(value)}`;\n}\n\nexport function isAllValue(value: VariableValueSingle) {\n return value === ALL_VARIABLE_VALUE || (Array.isArray(value) && value[0] === ALL_VARIABLE_VALUE);\n}\n\nconst SQL_ESCAPE_MAP: Record<string, string> = {\n \"'\": \"''\",\n '\"': '\\\\\"',\n};\n\nfunction sqlStringFormatter(value: VariableValue) {\n // escape single quotes by pairing them\n const regExp = new RegExp(`'|\"`, 'g');\n\n if (isArray(value)) {\n return map(value, (v: string) => `'${replace(v, regExp, (match) => SQL_ESCAPE_MAP[match] ?? '')}'`).join(',');\n }\n\n let strVal = typeof value === 'string' ? value : String(value);\n return `'${replace(strVal, regExp, (match) => SQL_ESCAPE_MAP[match] ?? '')}'`;\n}\n","import { ScopedVars } from '@grafana/data';\nimport { SceneObject } from '../../core/types';\nimport { FormatVariable } from '../interpolation/formatRegistry';\nimport { CustomVariableValue } from '../types';\n\nexport interface MacroVariableConstructor {\n new (name: string, sceneObject: SceneObject, fullMatch: string, scopedVars?: ScopedVars): FormatVariable;\n}\n\n/**\n * The sceneInterpolator will detect if getValue returns VariableValueCustom and will skip the normal formatting\n * This is useful as otherwise we would url encode macros like $__all_variables twice.\n */\nexport class SkipFormattingValue implements CustomVariableValue {\n public constructor(private _value: string) {}\n\n public formatter(): string {\n return this._value;\n }\n}\n","import { dateTimeFormat, urlUtil } from '@grafana/data';\nimport { getTimeRange } from '../../core/sceneGraph/getTimeRange';\nimport { getData } from '../../core/sceneGraph/sceneGraph';\nimport { SceneObject } from '../../core/types';\nimport { FormatVariable } from '../interpolation/formatRegistry';\nimport { SkipFormattingValue } from './types';\n\n/**\n * Handles expressions like $__url_time_range.\n */\nexport class UrlTimeRangeMacro implements FormatVariable {\n public state: { name: string; type: string };\n private _sceneObject: SceneObject;\n\n public constructor(name: string, sceneObject: SceneObject) {\n this.state = { name: name, type: 'url_variable' };\n this._sceneObject = sceneObject;\n }\n\n public getValue(): SkipFormattingValue {\n const timeRange = getTimeRange(this._sceneObject);\n const urlState = timeRange.urlSync?.getUrlState();\n return new SkipFormattingValue(urlUtil.toUrlParams(urlState));\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\n/**\n * Handles expressions like $__from and $__to.\n */\nexport class TimeFromAndToMacro implements FormatVariable {\n public state: { name: string; type: string };\n private _sceneObject: SceneObject;\n\n public constructor(name: string, sceneObject: SceneObject) {\n this.state = { name: name, type: 'time_macro' };\n this._sceneObject = sceneObject;\n }\n\n public getValue() {\n const timeRange = getTimeRange(this._sceneObject);\n if (this.state.name === '__from') {\n return timeRange.state.value.from.valueOf();\n } else {\n return timeRange.state.value.to.valueOf();\n }\n }\n\n public getValueText?(): string {\n const timeRange = getTimeRange(this._sceneObject);\n if (this.state.name === '__from') {\n return dateTimeFormat(timeRange.state.value.from, { timeZone: timeRange.getTimeZone() });\n } else {\n return dateTimeFormat(timeRange.state.value.to, { timeZone: timeRange.getTimeZone() });\n }\n }\n}\n\n/**\n * Handles $__timezone expression.\n */\nexport class TimezoneMacro implements FormatVariable {\n public state: { name: string; type: string };\n private _sceneObject: SceneObject;\n\n public constructor(name: string, sceneObject: SceneObject) {\n this.state = { name: name, type: 'time_macro' };\n this._sceneObject = sceneObject;\n }\n\n public getValue() {\n const timeRange = getTimeRange(this._sceneObject);\n const timeZone = timeRange.getTimeZone();\n\n if (timeZone === 'browser') {\n return Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n return timeZone;\n }\n\n public getValueText?(): string {\n return this.getValue();\n }\n}\n\n/**\n * Handles $__interval and $__intervalMs expression.\n */\nexport class IntervalMacro implements FormatVariable {\n public state: { name: string; type: string; match: string };\n private _sceneObject: SceneObject;\n\n public constructor(name: string, sceneObject: SceneObject, match: string) {\n this.state = { name: name, type: 'time_macro', match: match };\n this._sceneObject = sceneObject;\n }\n\n public getValue() {\n const data = getData(this._sceneObject);\n\n if (data) {\n const request = data.state.data?.request;\n if (!request) {\n return this.state.match;\n }\n if (this.state.name === '__interval_ms') {\n return request.intervalMs;\n }\n return request.interval;\n }\n\n return this.state.match;\n }\n}\n","import { SceneObject } from '../../core/types';\nimport { isCustomVariableValue, SceneVariable } from '../types';\nimport { formatRegistry, FormatVariable } from '../interpolation/formatRegistry';\nimport { SkipFormattingValue } from './types';\nimport { VariableFormatID } from '@grafana/schema';\n\nexport class AllVariablesMacro implements FormatVariable {\n public state: { name: string; type: string };\n private _sceneObject: SceneObject;\n\n public constructor(name: string, sceneObject: SceneObject) {\n this.state = { name, type: 'url_variable' };\n this._sceneObject = sceneObject;\n }\n\n public getValue(): SkipFormattingValue {\n const allVars = collectAllVariables(this._sceneObject);\n const format = formatRegistry.get(VariableFormatID.QueryParam);\n const params: string[] = [];\n\n for (const name of Object.keys(allVars)) {\n const variable = allVars[name];\n const value = variable.getValue();\n\n if (!value) {\n continue;\n }\n\n if (isCustomVariableValue(value)) {\n params.push(value.formatter(VariableFormatID.QueryParam));\n } else {\n params.push(format.formatter(value, [], variable));\n }\n }\n\n return new SkipFormattingValue(params.join('&'));\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\nfunction collectAllVariables(\n sceneObject: SceneObject,\n record: Record<string, SceneVariable> = {}\n): Record<string, SceneVariable> {\n if (sceneObject.state.$variables) {\n for (const variable of sceneObject.state.$variables.state.variables) {\n if (variable.state.skipUrlSync) {\n continue;\n }\n\n if (!record[variable.state.name]) {\n record[variable.state.name] = variable;\n }\n }\n }\n\n if (sceneObject.parent) {\n collectAllVariables(sceneObject.parent, record);\n }\n\n return record;\n}\n","import { Field, DataFrame, getFieldDisplayName, formatLabels } from '@grafana/data';\n\n/**\n * This object is created often, and only used when tmplates exist. Using a proxy lets us delay\n * calculations of the more complex structures (label names) until they are actually used\n */\nexport function getTemplateProxyForField(field: Field, frame?: DataFrame, frames?: DataFrame[]): any {\n return new Proxy(\n {}, // This object shows up in test snapshots\n {\n get: (obj, key) => {\n if (key === 'name') {\n return field.name;\n }\n\n if (key === 'displayName') {\n return getFieldDisplayName(field, frame, frames);\n }\n\n if (key === 'labels' || key === 'formattedLabels') {\n // formattedLabels deprecated\n if (!field.labels) {\n return '';\n }\n return {\n ...field.labels,\n __values: Object.values(field.labels).sort().join(', '),\n toString: () => {\n return formatLabels(field.labels!, '', true);\n },\n };\n }\n return undefined;\n },\n }\n );\n}\n","import {\n FieldType,\n formattedValueToString,\n getDisplayProcessor,\n ScopedVars,\n DataContextScopedVar,\n getFieldDisplayValuesProxy,\n getFrameDisplayName,\n} from '@grafana/data';\nimport { SceneObject } from '../../core/types';\nimport { getFieldAccessor } from '../interpolation/fieldAccessorCache';\nimport { FormatVariable } from '../interpolation/formatRegistry';\nimport { VariableValue } from '../types';\nimport { getTemplateProxyForField } from './templateProxies';\n\n/**\n * This macro handles the ${__value.*} interpolation\n * match represents the regex match and is the full expression, example `${varname.fieldpath}`\n * Macros can return the match when they identify that there required data context is not provided.\n * This leaves the expression intact so that it can be interpolated later when the data context is available.\n */\nexport class ValueMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, sceneObject: SceneObject, private _match: string, private _scopedVars?: ScopedVars) {\n this.state = { name, type: '__value' };\n }\n\n public getValue(fieldPath?: string): VariableValue {\n const dataContext: DataContextScopedVar | undefined = this._scopedVars?.__dataContext;\n if (!dataContext) {\n return this._match;\n }\n\n const { frame, rowIndex, field, calculatedValue } = dataContext.value;\n\n if (calculatedValue) {\n switch (fieldPath) {\n case 'numeric':\n return calculatedValue.numeric;\n case 'raw':\n return calculatedValue.numeric;\n case 'time':\n return '';\n case 'text':\n default:\n return formattedValueToString(calculatedValue);\n }\n }\n\n if (rowIndex == null) {\n return this._match;\n }\n\n if (fieldPath === 'time') {\n const timeField = frame.fields.find((f) => f.type === FieldType.time);\n return timeField ? timeField.values.get(rowIndex) : undefined;\n }\n\n if (!field) {\n return this._match;\n }\n\n const value = field.values.get(rowIndex);\n if (fieldPath === 'raw') {\n return value;\n }\n\n const displayProcessor = field.display ?? fallbackDisplayProcessor;\n const result = displayProcessor(value);\n\n switch (fieldPath) {\n case 'numeric':\n return result.numeric;\n case 'text':\n default:\n return formattedValueToString(result);\n }\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\nconst fallbackDisplayProcessor = getDisplayProcessor();\n\n/**\n * This macro handles the ${__data.*} interpolation. This is a bit poorly named as most of the\n * expressions that this macro evaluates are really \"row\" based values enabling you to access\n * values in other fields on the same row.\n */\nexport class DataMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, sceneObject: SceneObject, private _match: string, private _scopedVars?: ScopedVars) {\n this.state = { name, type: '__data' };\n }\n\n public getValue(fieldPath?: string): VariableValue {\n const dataContext = this._scopedVars?.__dataContext;\n if (!dataContext || !fieldPath) {\n return this._match;\n }\n\n const { frame, rowIndex } = dataContext.value;\n\n if (rowIndex === undefined || fieldPath === undefined) {\n return this._match;\n }\n\n const obj = {\n name: frame.name,\n refId: frame.refId,\n fields: getFieldDisplayValuesProxy({ frame, rowIndex }),\n };\n\n return getFieldAccessor(fieldPath)(obj) ?? '';\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\n/**\n * This macro handles the ${__series.name} interpolation.\n */\nexport class SeriesMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, sceneObject: SceneObject, private _match: string, private _scopedVars?: ScopedVars) {\n this.state = { name, type: '__series' };\n }\n\n public getValue(fieldPath?: string): VariableValue {\n const dataContext = this._scopedVars?.__dataContext;\n if (!dataContext || !fieldPath) {\n return this._match;\n }\n\n if (fieldPath !== 'name') {\n return this._match;\n }\n\n const { frame, frameIndex } = dataContext.value;\n return getFrameDisplayName(frame, frameIndex);\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\n/**\n * This macro handles the ${__field.*} interpolation. These do not require a data context.\n * And can be easily used in field config options like displayName.\n */\nexport class FieldMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, sceneObject: SceneObject, private _match: string, private _scopedVars?: ScopedVars) {\n this.state = { name, type: '__field' };\n }\n\n public getValue(fieldPath?: string): VariableValue {\n const dataContext = this._scopedVars?.__dataContext;\n if (!dataContext || !fieldPath) {\n return this._match;\n }\n\n if (fieldPath === undefined || fieldPath === '') {\n return this._match;\n }\n\n const { frame, field, data } = dataContext.value;\n const obj = getTemplateProxyForField(field, frame, data);\n\n return getFieldAccessor(fieldPath)(obj) ?? '';\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n","import { config, locationService } from '@grafana/runtime';\nimport { SceneObject } from '../../core/types';\nimport { FormatVariable } from '../interpolation/formatRegistry';\nimport { CustomVariableValue } from '../types';\n\nexport class UrlMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, _: SceneObject) {\n this.state = { name: name, type: 'url_macro' };\n }\n\n public getValue(fieldPath?: string) {\n const location = locationService.getLocation();\n const subUrl = config.appSubUrl ?? '';\n\n switch (fieldPath ?? '') {\n case 'params':\n return new UrlStateFormatter(location.search);\n case 'path':\n return subUrl + location.pathname;\n case '':\n default:\n return subUrl + location.pathname + location.search;\n }\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\nclass UrlStateFormatter implements CustomVariableValue {\n public constructor(private _urlQueryParams: string) {}\n\n public formatter(options: string): string {\n if (!options) {\n return this._urlQueryParams;\n }\n\n const params = options.split(':');\n if (params[0] === 'exclude' && params.length > 1) {\n const allParams = new URLSearchParams(this._urlQueryParams);\n for (const param of params[1].split(',')) {\n allParams.delete(param);\n }\n\n return `?${allParams}`;\n }\n\n if (params[0] === 'include' && params.length > 1) {\n const allParams = new URLSearchParams(this._urlQueryParams);\n const includeOnly = params[1].split(',');\n\n for (const param of allParams.keys()) {\n if (!includeOnly.includes(param)) {\n allParams.delete(param);\n }\n }\n\n return `?${allParams}`;\n }\n\n return this._urlQueryParams;\n }\n}\n","import { SceneObject } from '../../core/types';\nimport { FormatVariable } from '../interpolation/formatRegistry';\nimport { config } from '@grafana/runtime';\n\n/**\n * Handles expressions like ${__user.login}\n */\nexport class UserMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, _: SceneObject) {\n this.state = { name: name, type: 'user_macro' };\n }\n\n public getValue(fieldPath?: string): string {\n const user = config.bootData.user;\n\n switch (fieldPath) {\n case 'login':\n return user.login;\n case 'email':\n return user.email;\n case 'id':\n default:\n return String(user.id);\n }\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n\n/**\n * Handles expressions like ${__org.name}\n */\nexport class OrgMacro implements FormatVariable {\n public state: { name: string; type: string };\n\n public constructor(name: string, _: SceneObject) {\n this.state = { name: name, type: 'org_macro' };\n }\n\n public getValue(fieldPath?: string): string {\n const user = config.bootData.user;\n\n switch (fieldPath) {\n case 'name':\n return user.orgName;\n case 'id':\n default:\n return String(user.orgId);\n }\n }\n\n public getValueText?(): string {\n return '';\n }\n}\n","import { DataLinkBuiltInVars } from '@grafana/data';\nimport { MacroVariableConstructor } from './types';\nimport { IntervalMacro, TimeFromAndToMacro, TimezoneMacro, UrlTimeRangeMacro } from './timeMacros';\nimport { AllVariablesMacro } from './AllVariablesMacro';\nimport { DataMacro, FieldMacro, SeriesMacro, ValueMacro } from './dataMacros';\nimport { UrlMacro } from './urlMacros';\nimport { OrgMacro, UserMacro } from './contextMacros';\n\nexport const macrosIndex = new Map<string, MacroVariableConstructor>([\n [DataLinkBuiltInVars.includeVars, AllVariablesMacro],\n [DataLinkBuiltInVars.keepTime, UrlTimeRangeMacro],\n ['__value', ValueMacro],\n ['__data', DataMacro],\n ['__series', SeriesMacro],\n ['__field', FieldMacro],\n ['__url', UrlMacro],\n ['__from', TimeFromAndToMacro],\n ['__to', TimeFromAndToMacro],\n ['__timezone', TimezoneMacro],\n ['__user', UserMacro],\n ['__org', OrgMacro],\n ['__interval', IntervalMacro],\n ['__interval_ms', IntervalMacro],\n]);\n\n/**\n * Allows you to register a variable expression macro that can then be used in strings with syntax ${<macro_name>.<fieldPath>}\n * Call this on app activation and unregister the macro on deactivation.\n * @returns a function that unregisters the macro\n */\nexport function registerVariableMacro(name: string, macro: MacroVariableConstructor): () => void {\n if (macrosIndex.get(name)) {\n throw new Error(`Macro already registered ${name}`);\n }\n\n macrosIndex.set(name, macro);\n\n return () => {\n macrosIndex.delete(name);\n };\n}\n","import { ScopedVars } from '@grafana/data';\nimport { VariableInterpolation } from '@grafana/runtime';\nimport { VariableType, VariableFormatID } from '@grafana/schema';\n\nimport { SceneObject } from '../../core/types';\nimport { InterpolationFormatParameter, isCustomVariableValue, VariableValue } from '../types';\n\nimport { getSceneVariableForScopedVar } from './ScopedVarsVariable';\nimport { formatRegistry, FormatVariable } from './formatRegistry';\nimport { VARIABLE_REGEX } from '../constants';\nimport { lookupVariable } from '../lookupVariable';\nimport { macrosIndex } from '../macros';\n\n/**\n * This function will try to parse and replace any variable expression found in the target string. The sceneObject will be used as the source of variables. It will\n * use the scene graph and walk up the parent tree until it finds the closest variable.\n *\n * ScopedVars should not really be needed much in the new scene architecture as they can be added to the local scene node instead of passed in interpolate function.\n * It is supported here for backward compatibility and some edge cases where adding scoped vars to local scene node is not practical.\n */\nexport function sceneInterpolator(\n sceneObject: SceneObject,\n target: string | undefined | null,\n scopedVars?: ScopedVars,\n format?: InterpolationFormatParameter,\n interpolations?: VariableInterpolation[]\n): string {\n if (!target || typeof target !== 'string') {\n return target ?? '';\n }\n\n VARIABLE_REGEX.lastIndex = 0;\n\n return target.replace(VARIABLE_REGEX, (match, var1, var2, fmt2, var3, fieldPath, fmt3) => {\n const variableName = var1 || var2 || var3;\n const fmt = fmt2 || fmt3 || format;\n const variable = lookupFormatVariable(variableName, match, scopedVars, sceneObject);\n\n if (!variable) {\n if (interpolations) {\n // Set `value` equal to `match` as documented in the `VariableInterpolation` interface.\n interpolations.push({ match, variableName, fieldPath, format: fmt, value: match, found: false });\n }\n return match;\n }\n\n const value = formatValue(sceneObject, variable, variable.getValue(fieldPath), fmt);\n\n if (interpolations) {\n interpolations.push({ match, variableName, fieldPath, format: fmt, value, found: value !== match });\n }\n\n return value;\n });\n}\n\nfunction lookupFormatVariable(\n name: string,\n match: string,\n scopedVars: ScopedVars | undefined,\n sceneObject: SceneObject\n): FormatVariable | null {\n if (scopedVars && scopedVars.hasOwnProperty(name)) {\n const scopedVar = scopedVars[name];\n\n if (scopedVar) {\n return getSceneVariableForScopedVar(name, scopedVar);\n }\n }\n\n const variable = lookupVariable(name, sceneObject);\n if (variable) {\n return variable;\n }\n\n const Macro = macrosIndex.get(name);\n if (Macro) {\n return new Macro(name, sceneObject, match, scopedVars);\n }\n\n return null;\n}\n\nfunction formatValue(\n context: SceneObject,\n variable: FormatVariable,\n value: VariableValue | undefined | null,\n formatNameOrFn?: InterpolationFormatParameter\n): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n // Variable can return a custom value that handles formatting\n // This is useful for customAllValue and macros that return values that are already formatted or need special formatting\n if (isCustomVariableValue(value)) {\n return sceneInterpolator(context, value.formatter(formatNameOrFn));\n }\n\n // if it's an object transform value to string\n if (!Array.isArray(value) && typeof value === 'object') {\n value = `${value}`;\n }\n\n if (typeof formatNameOrFn === 'function') {\n return formatNameOrFn(value, {\n name: variable.state.name,\n type: variable.state.type as VariableType,\n multi: variable.state.isMulti,\n includeAll: variable.state.includeAll,\n });\n }\n\n let args: string[] = [];\n\n if (!formatNameOrFn) {\n formatNameOrFn = VariableFormatID.Glob;\n } else {\n // some formats have arguments that come after ':' character\n args = formatNameOrFn.split(':');\n if (args.length > 1) {\n formatNameOrFn = args[0];\n args = args.slice(1);\n } else {\n args = [];\n }\n }\n\n let formatter = formatRegistry.getIfExists(formatNameOrFn);\n\n if (!formatter) {\n console.error(`Variable format ${formatNameOrFn} not found. Using glob format as fallback.`);\n formatter = formatRegistry.get(VariableFormatID.Glob);\n }\n\n return formatter.formatter(value, args, variable);\n}\n","import React from 'react';\nimport { MonoTypeOperatorFunction, Observable, Unsubscribable } from 'rxjs';\n\nimport {\n BusEvent,\n BusEventHandler,\n BusEventType,\n DataFrame,\n DataQueryRequest,\n DataSourceGetTagKeysOptions,\n DataSourceGetTagValuesOptions,\n DataTransformContext,\n PanelData,\n TimeRange,\n} from '@grafana/data';\nimport { DataQuery, DataTopic, TimeZone } from '@grafana/schema';\n\nimport { SceneVariableDependencyConfigLike, SceneVariables } from '../variables/types';\nimport { SceneObjectRef } from './SceneObjectRef';\n\nexport interface SceneObjectState {\n key?: string;\n $timeRange?: SceneTimeRangeLike;\n $data?: SceneDataProvider;\n $variables?: SceneVariables;\n /**\n * @experimental\n * Can be used to add extra behaviors to a scene object.\n * These are activated when the their parent scene object is activated.\n */\n $behaviors?: Array<SceneObject | SceneStatelessBehavior>;\n}\n\nexport interface SceneLayoutChildOptions {\n width?: number | string;\n height?: number | string;\n xSizing?: 'fill' | 'content';\n ySizing?: 'fill' | 'content';\n x?: number;\n y?: number;\n minWidth?: number | string;\n minHeight?: number | string;\n isDraggable?: boolean;\n isResizable?: boolean;\n}\n\nexport interface SceneComponentProps<T> {\n model: T;\n}\n\nexport type SceneComponent<TModel> = (props: SceneComponentProps<TModel>) => React.ReactElement | null;\n\nexport interface SceneDataState extends SceneObjectState {\n data?: PanelData;\n}\n\nexport interface SceneObject<TState extends SceneObjectState = SceneObjectState> {\n /** The current state */\n readonly state: TState;\n\n /** True when there is a React component mounted for this Object */\n readonly isActive: boolean;\n\n /** SceneObject parent */\n readonly parent?: SceneObject;\n\n /** This abtractions declares what variables the scene object depends on and how to handle when they change value. **/\n readonly variableDependency?: SceneVariableDependencyConfigLike;\n\n /** This abstraction declares URL sync dependencies of a scene object. **/\n readonly urlSync?: SceneObjectUrlSyncHandler;\n\n /** Subscribe to state changes */\n subscribeToState(handler: SceneStateChangedHandler<TState>): Unsubscribable;\n\n /** Subscribe to a scene event */\n subscribeToEvent<T extends BusEvent>(typeFilter: BusEventType<T>, handler: BusEventHandler<T>): Unsubscribable;\n\n /** Publish an event and optionally bubble it up the scene */\n publishEvent(event: BusEvent, bubble?: boolean): void;\n\n /** Utility hook that wraps useObservable. Used by React components to subscribes to state changes */\n useState(): TState;\n\n /** How to modify state */\n setState(state: Partial<TState>): void;\n\n /**\n * Called when the Component is mounted. This will also activate any $data, $variables or $timeRange scene object on this level.\n * Don't override this in your custom SceneObjects, instead use addActivationHandler from the constructor.\n **/\n activate(): CancelActivationHandler;\n\n /** Get the scene root */\n getRoot(): SceneObject;\n\n /** Returns a deep clone this object and all its children */\n clone(state?: Partial<TState>): this;\n\n /** A React component to use for rendering the object */\n Component(props: SceneComponentProps<SceneObject<TState>>): React.ReactElement | null;\n\n /** Force a re-render, should only be needed when variable values change */\n forceRender(): void;\n\n /** Returns a SceneObjectRef that will resolve to this object */\n getRef(): SceneObjectRef<this>;\n\n /**\n * Allows external code to register code that is executed on activate and deactivate. This allow you\n * to wire up scene objects that need to respond to state changes in other objects from the outside.\n **/\n addActivationHandler(handler: SceneActivationHandler): void;\n\n /**\n * Loop through state and call callback for each direct child scene object.\n * Checks 1 level deep properties and arrays. So a scene object hidden in a nested plain object will not be detected.\n */\n forEachChild(callback: (child: SceneObject) => void): void;\n}\n\nexport type SceneActivationHandler = () => SceneDeactivationHandler | void;\nexport type SceneDeactivationHandler = () => void;\n\n/**\n * Function returned by activate() that when called will deactivate the object if it's the last activator\n **/\nexport type CancelActivationHandler = () => void;\n\nexport interface SceneLayoutState extends SceneObjectState {\n children: SceneObject[];\n}\n\nexport interface SceneLayout<T extends SceneLayoutState = SceneLayoutState> extends SceneObject<T> {\n isDraggable(): boolean;\n getDragClass?(): string;\n getDragClassCancel?(): string;\n}\n\nexport interface SceneTimeRangeState extends SceneObjectState {\n from: string;\n to: string;\n fiscalYearStartMonth?: number;\n value: TimeRange;\n timeZone?: TimeZone;\n /** weekStart will change the global date locale so having multiple different weekStart values is not supported */\n weekStart?: string;\n /**\n * @internal\n * To enable feature parity with the old time range picker, not sure if it will be kept.\n * Override the now time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values.\n * */\n UNSAFE_nowDelay?: string;\n\n refreshOnActivate?: {\n /**\n * When set, the time range will invalidate relative ranges after the specified interval has elapsed\n */\n afterMs?: number\n /**\n * When set, the time range will invalidate relative ranges after the specified percentage of the current interval has elapsed.\n * If both invalidate values are set, the smaller value will be used for the given interval.\n */\n percent?: number\n }\n}\n\nexport interface SceneTimeRangeLike extends SceneObject<SceneTimeRangeState> {\n onTimeZoneChange(timeZone: TimeZone): void;\n onTimeRangeChange(timeRange: TimeRange): void;\n onRefresh(): void;\n getTimeZone(): TimeZone;\n}\n\nexport function isSceneObject(obj: any): obj is SceneObject {\n return obj.useState !== undefined;\n}\n\nexport interface SceneObjectWithUrlSync extends SceneObject {\n getUrlState(): SceneObjectUrlValues;\n updateFromUrl(values: SceneObjectUrlValues): void;\n}\n\nexport interface SceneObjectUrlSyncHandler {\n getKeys(): string[];\n getUrlState(): SceneObjectUrlValues;\n updateFromUrl(values: SceneObjectUrlValues): void;\n}\n\nexport interface DataRequestEnricher {\n // Return partial data query request that will be merged with the original request provided by SceneQueryRunner\n enrichDataRequest(source: SceneObject): Partial<DataQueryRequest> | null;\n}\n\nexport interface FiltersRequestEnricher {\n // Return partial getTagKeys or getTagValues query request that will be merged with the original request provided by ad hoc or group by variable\n enrichFiltersRequest(\n source: SceneObject\n ): Partial<DataSourceGetTagKeysOptions | DataSourceGetTagValuesOptions> | null;\n}\n\nexport function isDataRequestEnricher(obj: any): obj is DataRequestEnricher {\n return 'enrichDataRequest' in obj;\n}\n\nexport function isFiltersRequestEnricher(obj: any): obj is FiltersRequestEnricher {\n return 'enrichFiltersRequest' in obj;\n}\n\nexport type SceneObjectUrlValue = string | string[] | undefined | null;\nexport type SceneObjectUrlValues = Record<string, SceneObjectUrlValue>;\n\nexport type CustomTransformOperator = (context: DataTransformContext) => MonoTypeOperatorFunction<DataFrame[]>;\nexport type CustomTransformerDefinition =\n | { operator: CustomTransformOperator; topic: DataTopic }\n | CustomTransformOperator;\nexport type SceneStateChangedHandler<TState> = (newState: TState, prevState: TState) => void;\n\nexport type DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\nexport interface SceneDataProviderResult {\n data: PanelData;\n origin: SceneDataProvider;\n}\n\nexport interface SceneDataProvider<T extends SceneObjectState = SceneDataState> extends SceneObject<T> {\n setContainerWidth?: (width: number) => void;\n isDataReadyToDisplay?: () => boolean;\n cancelQuery?: () => void;\n getResultsStream(): Observable<SceneDataProviderResult>;\n}\n\nexport interface SceneDataLayerProviderState extends SceneDataState {\n name: string;\n description?: string;\n isEnabled?: boolean;\n isHidden?: boolean;\n}\n\nexport interface SceneDataLayerProvider extends SceneDataProvider<SceneDataLayerProviderState> {\n isDataLayer: true;\n}\n\nexport function isDataLayer(obj: SceneObject): obj is SceneDataLayerProvider {\n return 'isDataLayer' in obj;\n}\n\nexport interface DataLayerFilter {\n panelId: number;\n}\n\nexport interface SceneStatelessBehavior<T extends SceneObject = any> {\n (sceneObject: T): CancelActivationHandler | void;\n}\n\nexport type ControlsLayout = 'horizontal' | 'vertical';\n\nexport interface UseStateHookOptions {\n /**\n * For some edge cases other scene objects want to subscribe to scene object state for objects\n * that are not active, or whose main React Component can be un-mounted. Set this to true\n * to keep the scene object active even if the React component is unmounted.\n *\n * Normally you would not need this but this can be useful in some edge cases.\n *\n * @experimental\n */\n shouldActivateOrKeepAlive?: boolean;\n}\n\nexport interface SceneDataQuery extends DataQuery {\n [key: string]: any;\n\n // Opt this query out of time window comparison\n timeRangeCompare?: boolean;\n}\n","import { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneObject, SceneObjectState, SceneStatelessBehavior } from '../core/types';\nimport { DataQueryRequest } from '@grafana/data';\nimport { LoadingState } from '@grafana/schema';\n\nexport interface SceneQueryStateControllerState extends SceneObjectState {\n isRunning: boolean;\n}\n\nexport interface SceneQueryControllerLike extends SceneObject<SceneQueryStateControllerState> {\n isQueryController: true;\n cancelAll(): void;\n\n queryStarted(entry: SceneQueryControllerEntry): void;\n queryCompleted(entry: SceneQueryControllerEntry): void;\n}\n\nexport function isQueryController(s: SceneObject | SceneStatelessBehavior): s is SceneQueryControllerLike {\n return 'isQueryController' in s;\n}\n\nexport interface QueryResultWithState {\n state: LoadingState;\n}\n\nexport interface SceneQueryControllerEntry {\n request?: DataQueryRequest;\n type: SceneQueryControllerEntryType;\n origin: SceneObject;\n cancel?: () => void;\n}\n\nexport type SceneQueryControllerEntryType = 'data' | 'annotations' | 'variable' | 'alerts';\n\nexport class SceneQueryController\n extends SceneObjectBase<SceneQueryStateControllerState>\n implements SceneQueryControllerLike\n{\n public isQueryController: true = true;\n\n #running = new Set<SceneQueryControllerEntry>();\n\n public constructor() {\n super({ isRunning: false });\n\n // Clear running state on deactivate\n this.addActivationHandler(() => {\n return () => this.#running.clear();\n });\n }\n\n public queryStarted(entry: SceneQueryControllerEntry) {\n this.#running.add(entry);\n\n this.changeRunningQueryCount(1);\n\n if (!this.state.isRunning) {\n this.setState({ isRunning: true });\n }\n }\n\n public queryCompleted(entry: SceneQueryControllerEntry) {\n if (!this.#running.has(entry)) {\n return;\n }\n\n this.#running.delete(entry);\n\n this.changeRunningQueryCount(-1);\n\n if (this.#running.size === 0) {\n this.setState({ isRunning: false });\n }\n }\n\n private changeRunningQueryCount(dir: 1 | -1) {\n /**\n * Used by grafana-image-renderer to know when all queries are completed.\n */\n (window as any).__grafanaRunningQueryCount = ((window as any).__grafanaRunningQueryCount ?? 0) + dir;\n }\n\n public cancelAll() {\n for (const entry of this.#running.values()) {\n entry.cancel?.();\n }\n }\n}\n","export function writeSceneLog(logger: string, message: string, ...rest: unknown[]) {\n let loggingEnabled = false;\n\n if (typeof window !== 'undefined') {\n loggingEnabled = localStorage.getItem('grafana.debug.scenes') === 'true';\n }\n\n if (loggingEnabled) {\n console.log(`${logger}: `, message, ...rest);\n }\n}\n","import { DataSourceApi, ScopedVars } from '@grafana/data';\nimport { getDataSourceSrv } from '@grafana/runtime';\nimport { DataSourceRef } from '@grafana/schema';\nimport { runtimeDataSources } from '../querying/RuntimeDataSource';\n\nexport async function getDataSource(\n datasource: DataSourceRef | undefined | null,\n scopedVars: ScopedVars\n): Promise<DataSourceApi> {\n if (datasource?.uid) {\n const runtimeDataSource = runtimeDataSources.get(datasource.uid);\n if (runtimeDataSource) {\n return runtimeDataSource;\n }\n }\n\n if (datasource && (datasource as any).query) {\n return datasource as DataSourceApi;\n }\n\n return await getDataSourceSrv().get(datasource as string, scopedVars);\n}\n","import { sceneGraph } from '../core/sceneGraph';\nimport { SceneObject } from '../core/types';\nimport { SceneVariable, VariableValue } from './types';\nimport { isVariableValueEqual } from './utils';\n\n/**\n * Useful for remembering variable values to know if they have changed\n **/\nexport class VariableValueRecorder {\n private _values = new Map<string, VariableValue | undefined | null>();\n\n public recordCurrentDependencyValuesForSceneObject(sceneObject: SceneObject) {\n this.clearValues();\n\n if (!sceneObject.variableDependency) {\n return;\n }\n\n for (const variableName of sceneObject.variableDependency.getNames()) {\n const variable = sceneGraph.lookupVariable(variableName, sceneObject);\n if (variable) {\n this._values.set(variable.state.name, variable.getValue());\n }\n }\n }\n\n public cloneAndRecordCurrentValuesForSceneObject(sceneObject: SceneObject) {\n const clone = new VariableValueRecorder();\n clone.recordCurrentDependencyValuesForSceneObject(sceneObject);\n return clone;\n }\n\n public clearValues() {\n this._values.clear();\n }\n\n public hasValues(): boolean {\n return !!this._values;\n }\n\n public recordCurrentValue(variable: SceneVariable) {\n this._values.set(variable.state.name, variable.getValue());\n }\n\n public hasRecordedValue(variable: SceneVariable): boolean {\n return this._values.has(variable.state.name);\n }\n\n public hasValueChanged(variable: SceneVariable): boolean {\n if (this._values.has(variable.state.name)) {\n const value = this._values.get(variable.state.name);\n if (!isVariableValueEqual(value, variable.getValue())) {\n return true;\n }\n }\n\n return false;\n }\n\n public hasDependenciesChanged(sceneObject: SceneObject): boolean {\n if (!this._values) {\n return false;\n }\n\n if (!sceneObject.variableDependency) {\n return false;\n }\n\n for (const variableName of sceneObject.variableDependency.getNames()) {\n const variable = sceneGraph.lookupVariable(variableName, sceneObject);\n if (!variable) {\n continue;\n }\n\n const name = variable.state.name;\n\n if (variable && this._values.has(name)) {\n const value = this._values.get(name);\n if (!isVariableValueEqual(value, variable.getValue())) {\n return true;\n }\n }\n }\n\n return false;\n }\n}\n","import { DataQueryRequest, PanelData } from '@grafana/data';\nimport { Observable } from 'rxjs';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneDataQuery, SceneObjectState } from '../core/types';\n\n// A processor function called by the query runner with responses\n// to any extra requests.\n//\n// A processor function should accept two arguments: the data returned by the\n// _primary_ query, and the data returned by the `ExtraQueryProvider`'s\n// _secondary_ query. It should return a new `PanelData` representing the processed output.\n// It should _not_ modify the primary PanelData.\n//\n// Examples of valid processing include alignment of data between primary and secondary\n// (see the `timeShiftAlignmentProcessor` returned by `SceneTimeRangeCompare`), or doing\n// some more advanced processing such as fitting a time series model on the secondary data.\n//\n// See the docs for `extraQueryProcessingOperator` for more information.\nexport type ExtraQueryDataProcessor = (primary: PanelData, secondary: PanelData) => Observable<PanelData>;\n\n// An extra request that should be run by a query runner, and an optional\n// processor that should be called with the response data.\nexport interface ExtraQueryDescriptor {\n // The extra request to add.\n req: DataQueryRequest;\n // An optional function used to process the data before passing it\n // to any transformations or visualizations.\n processor?: ExtraQueryDataProcessor;\n}\n\n// Indicates that this type wants to add extra requests, along with\n// optional processing functions, to a query runner.\nexport interface ExtraQueryProvider<T extends SceneObjectState> extends SceneObjectBase<T> {\n // Get any extra requests and their required processors.\n getExtraQueries(request: DataQueryRequest): ExtraQueryDescriptor[];\n // Determine whether a query should be rerun.\n //\n // When the provider's state changes this function will be passed both the previous and the\n // next state. The implementation can use this to determine whether the change should trigger\n // a rerun of the query or not.\n shouldRerun(prev: T, next: T, queries: SceneDataQuery[]): boolean;\n}\n\nexport function isExtraQueryProvider(obj: any): obj is ExtraQueryProvider<any> {\n return typeof obj === 'object' && 'getExtraQueries' in obj;\n}\n","import { PanelData } from '@grafana/data';\nimport { forkJoin, of, map, mergeMap, Observable } from 'rxjs';\nimport { ExtraQueryDataProcessor } from './ExtraQueryProvider';\n\n// Passthrough processor for use with ExtraQuerys.\nexport const passthroughProcessor: ExtraQueryDataProcessor = (_, secondary) => of(secondary);\n\n// Factory function which takes a map from request ID to processor functions and\n// returns an rxjs operator which operates on an array of panel data responses.\n//\n// Each secondary response is transformed according to the processor function\n// identified by it's request ID. The processor function is passed the primary\n// response and the secondary response to be processed.\n//\n// The output is a single frame with the primary series and all processed\n// secondary series combined.\nexport const extraQueryProcessingOperator = (processors: Map<string, ExtraQueryDataProcessor>) =>\n (data: Observable<[PanelData, ...PanelData[]]>) => {\n return data.pipe(\n mergeMap(([primary, ...secondaries]) => {\n const processedSecondaries = secondaries.flatMap((s) => {\n return processors.get(s.request!.requestId)?.(primary, s) ?? of(s);\n });\n return forkJoin([of(primary), ...processedSecondaries]);\n }),\n map(([primary, ...processedSecondaries]) => ({\n ...primary,\n series: [...primary.series, ...processedSecondaries.flatMap((s) => s.series)],\n annotations: [...(primary.annotations ?? []), ...processedSecondaries.flatMap((s) => s.annotations ?? [])],\n }))\n );\n }\n","import { DataFrame, Field } from '@grafana/data';\nimport { DataLayerFilter } from '../../../core/types';\n\n// Provided SceneDataLayerProviderResult is an array of DataFrames.\nexport function filterAnnotations(data: DataFrame[], filters: DataLayerFilter) {\n if (!Array.isArray(data) || data.length === 0) {\n return data;\n }\n\n const rows = Array.from({ length: data.length }, () => new Set<number>());\n\n let frameIdx = 0;\n for (const frame of data) {\n for (let index = 0; index < frame.length; index++) {\n if (rows[frameIdx].has(index)) {\n continue;\n }\n let matching = true;\n\n // Let's call those standard fields that annotations data frame has.\n // panelId is a standard field, but it's not always present. It's added to annotations that were added to a particular panel.\n const panelIdField = frame.fields.find((f) => f.name === 'panelId');\n // Source field contains annotation definition, with type and filters included.\n const sourceField = frame.fields.find((f) => f.name === 'source');\n\n if (sourceField) {\n // Here we are filtering Grafana annotations that were added to a particular panel.\n if (panelIdField && sourceField.values[index].type === 'dashboard') {\n matching = panelIdField.values[index] === filters.panelId;\n }\n\n const sourceFilter = sourceField.values[index].filter;\n\n // Here we are filtering based on annotation filter definition.\n // Those fitlers are: Show annotation in selected panels, Exclude annotation from selected panels.\n if (sourceFilter) {\n const includes = (sourceFilter.ids ?? []).includes(filters.panelId);\n if (sourceFilter.exclude) {\n if (includes) {\n matching = false;\n }\n } else if (!includes) {\n matching = false;\n }\n }\n }\n\n if (matching) {\n rows[frameIdx].add(index);\n }\n }\n frameIdx++;\n }\n\n const processed: DataFrame[] = [];\n\n frameIdx = 0;\n for (const frame of data) {\n const frameLength = rows[frameIdx].size;\n const fields: Field[] = [];\n\n for (const field of frame.fields) {\n const buffer = [];\n\n for (let index = 0; index < frame.length; index++) {\n if (rows[frameIdx].has(index)) {\n buffer.push(field.values[index]);\n continue;\n }\n }\n\n fields.push({\n ...field,\n values: buffer,\n });\n }\n\n processed.push({\n ...frame,\n fields: fields,\n length: frameLength,\n });\n frameIdx++;\n }\n return processed;\n}\n","import { DataQueryRequest } from '@grafana/data';\nimport { isDataRequestEnricher, SceneObject } from '../core/types';\n\nexport function getEnrichedDataRequest(sourceRunner: SceneObject): Partial<DataQueryRequest> | null {\n const root = sourceRunner.getRoot();\n\n if (isDataRequestEnricher(root)) {\n return root.enrichDataRequest(sourceRunner);\n }\n\n return null;\n}\n","import { getDataSourceSrv, getTemplateSrv } from '@grafana/runtime';\nimport { AdHocVariableFilter } from '@grafana/data';\nimport { AdHocFiltersVariable } from './AdHocFiltersVariable';\n\nlet originalGetAdhocFilters: any = undefined;\nlet allActiveFilterSets = new Set<AdHocFiltersVariable>();\n\nexport function patchGetAdhocFilters(filterVar: AdHocFiltersVariable) {\n filterVar.addActivationHandler(() => {\n allActiveFilterSets.add(filterVar);\n return () => allActiveFilterSets.delete(filterVar);\n });\n\n if (originalGetAdhocFilters) {\n return;\n }\n\n const templateSrv: any = getTemplateSrv();\n if (!templateSrv?.getAdhocFilters) {\n console.log('Failed to patch getAdhocFilters');\n return;\n }\n\n originalGetAdhocFilters = templateSrv.getAdhocFilters;\n\n templateSrv.getAdhocFilters = function getAdhocFiltersScenePatch(dsName: string): AdHocVariableFilter[] {\n if (allActiveFilterSets.size === 0) {\n return originalGetAdhocFilters.call(templateSrv);\n }\n\n const ds = getDataSourceSrv().getInstanceSettings(dsName);\n if (!ds) {\n return [];\n }\n\n for (const filter of allActiveFilterSets.values()) {\n if (filter.state.datasource?.uid === ds.uid) {\n return filter.state.filters;\n }\n }\n\n return [];\n }.bind(templateSrv);\n}\n\nexport function findActiveAdHocFilterVariableByUid(dsUid: string | undefined): AdHocFiltersVariable | undefined {\n for (const filter of allActiveFilterSets.values()) {\n if (filter.state.datasource?.uid === dsUid) {\n return filter;\n }\n }\n\n return undefined;\n}\n","import { Observable } from 'rxjs';\nimport { LoadingState } from '@grafana/schema';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { QueryResultWithState, SceneQueryControllerEntry } from '../behaviors/SceneQueryController';\n\n/**\n * Will look for a scene object with a behavior that is a SceneQueryController and register the query with it.\n */\nexport function registerQueryWithController<T extends QueryResultWithState>(entry: SceneQueryControllerEntry) {\n return (queryStream: Observable<T>) => {\n const queryControler = sceneGraph.getQueryController(entry.origin);\n if (!queryControler) {\n return queryStream;\n }\n\n return new Observable<T>((observer) => {\n if (!entry.cancel) {\n entry.cancel = () => observer.complete();\n }\n\n queryControler.queryStarted(entry);\n let markedAsCompleted = false;\n\n const sub = queryStream.subscribe({\n next: (v) => {\n if (!markedAsCompleted && v.state !== LoadingState.Loading) {\n markedAsCompleted = true;\n queryControler.queryCompleted(entry);\n }\n\n observer.next(v);\n },\n error: (e) => observer.error(e),\n complete: () => {\n observer.complete();\n },\n });\n\n return () => {\n sub.unsubscribe();\n\n if (!markedAsCompleted) {\n queryControler.queryCompleted(entry);\n }\n };\n });\n };\n}\n","import { GroupByVariable } from './GroupByVariable';\n\nexport const allActiveGroupByVariables = new Set<GroupByVariable>();\n\nexport function findActiveGroupByVariablesByUid(dsUid: string | undefined): GroupByVariable | undefined {\n for (const groupByVariable of allActiveGroupByVariables.values()) {\n if (groupByVariable.state.datasource?.uid === dsUid) {\n return groupByVariable;\n }\n }\n\n return undefined;\n}\n","import { SceneObject, SceneObjectState } from '../core/types';\n\n/**\n * This function works around the problem of Contravariance of the SceneObject.setState function\n * Contravariance is not enforce by interfaces and here we use the SceneObject interface to access the setState function\n */\nexport function setBaseClassState<T extends SceneObjectState>(sceneObject: SceneObject<T>, newState: Partial<T>) {\n sceneObject.setState(newState);\n}\n","import { isArray, isEqual } from 'lodash';\nimport { map, Observable } from 'rxjs';\n\nimport { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from '../constants';\n\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneObjectUrlSyncHandler, SceneObjectUrlValues } from '../../core/types';\nimport {\n SceneVariable,\n SceneVariableValueChangedEvent,\n SceneVariableState,\n ValidateAndUpdateResult,\n VariableValue,\n VariableValueOption,\n VariableValueSingle,\n CustomVariableValue,\n VariableCustomFormatterFn,\n} from '../types';\nimport { formatRegistry } from '../interpolation/formatRegistry';\nimport { VariableFormatID } from '@grafana/schema';\nimport { SceneVariableSet } from '../sets/SceneVariableSet';\nimport { setBaseClassState } from '../../utils/utils';\n\nexport interface MultiValueVariableState extends SceneVariableState {\n value: VariableValue; // old current.text\n text: VariableValue; // old current.value\n options: VariableValueOption[];\n isMulti?: boolean;\n includeAll?: boolean;\n defaultToAll?: boolean;\n allValue?: string;\n placeholder?: string;\n /**\n * For multi value variables, this option controls how many values to show before they are collapsed into +N.\n * Defaults to 5\n */\n maxVisibleValues?: number;\n noValueOnClear?: boolean;\n isReadOnly?: boolean;\n}\n\nexport interface VariableGetOptionsArgs {\n searchFilter?: string;\n}\n\nexport abstract class MultiValueVariable<TState extends MultiValueVariableState = MultiValueVariableState>\n extends SceneObjectBase<TState>\n implements SceneVariable<TState>\n{\n protected _urlSync: SceneObjectUrlSyncHandler = new MultiValueUrlSyncHandler(this);\n\n /**\n * Set to true to skip next value validation to maintain the current value even it it's not among the options (ie valid values)\n */\n public skipNextValidation?: boolean;\n\n /**\n * The source of value options.\n */\n public abstract getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]>;\n\n /**\n * This function is called on when SceneVariableSet is activated or when a dependency changes.\n */\n public validateAndUpdate(): Observable<ValidateAndUpdateResult> {\n return this.getValueOptions({}).pipe(\n map((options) => {\n this.updateValueGivenNewOptions(options);\n return {};\n })\n );\n }\n\n public onCancel(): void {\n this.setStateHelper({ loading: false });\n const sceneVarSet = this.parent as SceneVariableSet;\n sceneVarSet?.cancel(this);\n }\n\n /**\n * Check if current value is valid given new options. If not update the value.\n */\n private updateValueGivenNewOptions(options: VariableValueOption[]) {\n // Remember current value and text\n const { value: currentValue, text: currentText } = this.state;\n\n const stateUpdate = this.getStateUpdateGivenNewOptions(options, currentValue, currentText);\n\n this.interceptStateUpdateAfterValidation(stateUpdate);\n\n // Perform state change\n this.setStateHelper(stateUpdate);\n\n // Publish value changed event only if value changed\n if (stateUpdate.value !== currentValue || stateUpdate.text !== currentText || this.hasAllValue()) {\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n }\n }\n\n private getStateUpdateGivenNewOptions(\n options: VariableValueOption[],\n currentValue: VariableValue,\n currentText: VariableValue\n ): Partial<MultiValueVariableState> {\n const stateUpdate: Partial<MultiValueVariableState> = {\n options,\n loading: false,\n value: currentValue,\n text: currentText,\n };\n\n if (options.length === 0) {\n if (this.state.defaultToAll || this.state.includeAll) {\n stateUpdate.value = ALL_VARIABLE_VALUE;\n stateUpdate.text = ALL_VARIABLE_TEXT;\n } else if (this.state.isMulti) {\n stateUpdate.value = [];\n stateUpdate.text = [];\n } else {\n stateUpdate.value = '';\n stateUpdate.text = '';\n }\n\n return stateUpdate;\n }\n\n if (this.hasAllValue()) {\n if (!this.state.includeAll) {\n stateUpdate.value = options[0].value;\n stateUpdate.text = options[0].label;\n // If multi switch to arrays\n if (this.state.isMulti) {\n stateUpdate.value = [stateUpdate.value];\n stateUpdate.text = [stateUpdate.text];\n }\n }\n return stateUpdate;\n }\n\n if (this.state.isMulti) {\n // If we are a multi valued variable validate the current values are among the options\n const currentValues = Array.isArray(currentValue) ? currentValue : [currentValue];\n const validValues = currentValues.filter((v) => options.find((o) => o.value === v));\n const validTexts = validValues.map((v) => options.find((o) => o.value === v)!.label);\n\n // If no valid values pick the first option\n if (validValues.length === 0) {\n const defaultState = this.getDefaultMultiState(options);\n stateUpdate.value = defaultState.value;\n stateUpdate.text = defaultState.text;\n } else {\n // We have valid values, if it's different from current valid values update current values\n if (!isEqual(validValues, currentValue)) {\n stateUpdate.value = validValues;\n }\n if (!isEqual(validTexts, currentText)) {\n stateUpdate.text = validTexts;\n }\n }\n return stateUpdate;\n }\n\n // Single value variable validation\n\n // Try find by value then text\n let matchingOption = findOptionMatchingCurrent(currentValue, currentText, options);\n if (matchingOption) {\n // When updating the initial state from URL the text property is set the same as value\n // Here we can correct the text value state\n stateUpdate.text = matchingOption.label;\n stateUpdate.value = matchingOption.value;\n } else {\n // Current value is found in options\n if (this.state.defaultToAll) {\n stateUpdate.value = ALL_VARIABLE_VALUE;\n stateUpdate.text = ALL_VARIABLE_TEXT;\n } else {\n // Current value is not valid. Set to first of the available options\n stateUpdate.value = options[0].value;\n stateUpdate.text = options[0].label;\n }\n }\n\n return stateUpdate;\n }\n\n /**\n * Values set by initial URL sync needs to survive the next validation and update.\n * This function can intercept and make sure those values are preserved.\n */\n protected interceptStateUpdateAfterValidation(stateUpdate: Partial<MultiValueVariableState>): void {\n // If the validation wants to fix the all value (All ==> $__all) then we should let that pass\n const isAllValueFix = stateUpdate.value === ALL_VARIABLE_VALUE && this.state.text === ALL_VARIABLE_TEXT;\n\n if (this.skipNextValidation && stateUpdate.value !== this.state.value && stateUpdate.text !== this.state.text && !isAllValueFix) {\n stateUpdate.value = this.state.value;\n stateUpdate.text = this.state.text;\n }\n\n this.skipNextValidation = false;\n }\n\n public getValue(): VariableValue {\n if (this.hasAllValue()) {\n if (this.state.allValue) {\n return new CustomAllValue(this.state.allValue, this);\n }\n\n return this.state.options.map((x) => x.value);\n }\n\n return this.state.value;\n }\n\n public getValueText(): string {\n if (this.hasAllValue()) {\n return ALL_VARIABLE_TEXT;\n }\n\n if (Array.isArray(this.state.text)) {\n return this.state.text.join(' + ');\n }\n\n return String(this.state.text);\n }\n\n public hasAllValue() {\n const value = this.state.value;\n return value === ALL_VARIABLE_VALUE || (Array.isArray(value) && value[0] === ALL_VARIABLE_VALUE);\n }\n\n public getDefaultMultiState(options: VariableValueOption[]) {\n if (this.state.defaultToAll) {\n return { value: [ALL_VARIABLE_VALUE], text: [ALL_VARIABLE_TEXT] };\n } else if (options.length > 0) {\n return { value: [options[0].value], text: [options[0].label] };\n } else {\n return { value: [], text: [] };\n }\n }\n\n /**\n * Change the value and publish SceneVariableValueChangedEvent event.\n */\n public changeValueTo(value: VariableValue, text?: VariableValue) {\n // Ignore if there is no change\n if (value === this.state.value && text === this.state.text) {\n return;\n }\n\n if (!text) {\n if (Array.isArray(value)) {\n text = value.map((v) => this.findLabelTextForValue(v));\n } else {\n text = this.findLabelTextForValue(value);\n }\n }\n\n if (Array.isArray(value)) {\n // If we are a multi valued variable is cleared (empty array) we need to set the default empty state\n if (value.length === 0) {\n const state = this.getDefaultMultiState(this.state.options);\n value = state.value;\n text = state.text;\n }\n\n // If last value is the All value then replace all with it\n if (value[value.length - 1] === ALL_VARIABLE_VALUE) {\n value = [ALL_VARIABLE_VALUE];\n text = [ALL_VARIABLE_TEXT];\n }\n // If the first value is the ALL value and we have other values, then remove the All value\n else if (value[0] === ALL_VARIABLE_VALUE && value.length > 1) {\n value.shift();\n if (Array.isArray(text)) {\n text.shift();\n }\n }\n }\n\n // Do nothing if value and text are the same\n if (isEqual(value, this.state.value) && isEqual(text, this.state.text)) {\n return;\n }\n\n this.setStateHelper({ value, text, loading: false });\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n }\n\n private findLabelTextForValue(value: VariableValueSingle): VariableValueSingle {\n if (value === ALL_VARIABLE_VALUE) {\n return ALL_VARIABLE_TEXT;\n }\n\n const option = this.state.options.find((x) => x.value === value);\n if (option) {\n return option.label;\n }\n\n const optionByLabel = this.state.options.find((x) => x.label === value);\n if (optionByLabel) {\n return optionByLabel.label;\n }\n\n return value;\n }\n\n /**\n * This helper function is to counter the contravariance of setState\n */\n private setStateHelper(state: Partial<MultiValueVariableState>) {\n setBaseClassState<MultiValueVariableState>(this, state);\n }\n\n public getOptionsForSelect(): VariableValueOption[] {\n let options = this.state.options;\n\n if (this.state.includeAll) {\n options = [{ value: ALL_VARIABLE_VALUE, label: ALL_VARIABLE_TEXT }, ...options];\n }\n\n if (!Array.isArray(this.state.value)) {\n const current = options.find((x) => x.value === this.state.value);\n if (!current) {\n options = [{ value: this.state.value, label: String(this.state.text) }, ...options];\n }\n }\n\n return options;\n }\n\n public refreshOptions() {\n this.getValueOptions({}).subscribe((options) => {\n this.updateValueGivenNewOptions(options);\n });\n }\n\n /**\n * Can be used by subclasses to do custom handling of option search based on search input\n */\n public onSearchChange?(searchFilter: string): void;\n}\n\n/**\n * Looks for matching option, first by value but as a fallback by text (label).\n */\nfunction findOptionMatchingCurrent(\n currentValue: VariableValue,\n currentText: VariableValue,\n options: VariableValueOption[]\n) {\n let textMatch: VariableValueOption | undefined;\n\n for (const item of options) {\n if (item.value === currentValue) {\n return item;\n }\n\n // No early return here as want to continue to look a value match\n if (item.label === currentText) {\n textMatch = item;\n }\n }\n\n return textMatch;\n}\n\nexport class MultiValueUrlSyncHandler<TState extends MultiValueVariableState = MultiValueVariableState>\n implements SceneObjectUrlSyncHandler\n{\n public constructor(private _sceneObject: MultiValueVariable<TState>) {}\n\n private getKey(): string {\n return `var-${this._sceneObject.state.name}`;\n }\n\n public getKeys(): string[] {\n if (this._sceneObject.state.skipUrlSync) {\n return [];\n }\n\n return [this.getKey()];\n }\n\n public getUrlState(): SceneObjectUrlValues {\n if (this._sceneObject.state.skipUrlSync) {\n return {};\n }\n\n let urlValue: string | string[] | null = null;\n let value = this._sceneObject.state.value;\n\n if (Array.isArray(value)) {\n urlValue = value.map(String);\n } else if ((this, this._sceneObject.state.isMulti)) {\n // If we are inMulti mode we must return an array here as otherwise UrlSyncManager will not pass all values (in an array) in updateFromUrl\n urlValue = [String(value)];\n } else {\n urlValue = String(value);\n }\n\n return { [this.getKey()]: urlValue };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues): void {\n let urlValue = values[this.getKey()];\n\n if (urlValue != null) {\n // This is to be backwards compatible with old url all value\n if (this._sceneObject.state.includeAll) {\n urlValue = handleLegacyUrlAllValue(urlValue);\n }\n\n // For edge cases where data links include variables with custom all value.\n // We want the variable to maintain the \"All\" meta value not the actual custom vall value. (Fixes https://github.com/grafana/grafana/issues/28635)\n if (this._sceneObject.state.allValue && this._sceneObject.state.allValue === urlValue) {\n urlValue = ALL_VARIABLE_VALUE;\n }\n\n /**\n * Initial URL Sync happens before scene objects are activated.\n * We need to skip validation in this case to make sure values set via URL are maintained.\n */\n if (!this._sceneObject.isActive) {\n this._sceneObject.skipNextValidation = true;\n }\n\n this._sceneObject.changeValueTo(urlValue);\n }\n }\n}\n\nfunction handleLegacyUrlAllValue(value: string | string[]) {\n if (isArray(value) && value[0] === ALL_VARIABLE_TEXT) {\n return [ALL_VARIABLE_VALUE];\n } else if (value === ALL_VARIABLE_TEXT) {\n return ALL_VARIABLE_VALUE;\n }\n\n return value;\n}\n\n/**\n * Variable getValue can return this to skip any subsequent formatting.\n * This is useful for custom all values that should not be escaped/formatted.\n */\nexport class CustomAllValue implements CustomVariableValue {\n public constructor(private _value: string, private _variable: SceneVariable) {}\n\n public formatter(formatNameOrFn?: string | VariableCustomFormatterFn): string {\n if (formatNameOrFn === VariableFormatID.Text) {\n return ALL_VARIABLE_TEXT;\n }\n\n if (formatNameOrFn === VariableFormatID.PercentEncode) {\n return formatRegistry.get(VariableFormatID.PercentEncode).formatter(this._value, [], this._variable);\n }\n\n if (formatNameOrFn === VariableFormatID.QueryParam) {\n return formatRegistry.get(VariableFormatID.QueryParam).formatter(ALL_VARIABLE_TEXT, [], this._variable);\n }\n\n return this._value;\n }\n}\n","import { VariableValueOption } from '../types';\nimport uFuzzy from '@leeoniya/ufuzzy';\nimport { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from '../constants';\n\nexport function getOptionSearcher(\n options: VariableValueOption[],\n includeAll: boolean | undefined,\n) {\n const ufuzzy = new uFuzzy();\n let allOptions = options;\n const haystack: string[] = [];\n const limit = 10000;\n\n if (includeAll) {\n allOptions = [{ value: ALL_VARIABLE_VALUE, label: ALL_VARIABLE_TEXT }, ...allOptions];\n }\n\n return (search: string) => {\n if (search === '') {\n if (allOptions.length > limit) {\n return allOptions.slice(0, limit);\n } else {\n return allOptions;\n }\n }\n\n if (haystack.length === 0) {\n for (let i = 0; i < allOptions.length; i++) {\n haystack.push(allOptions[i].label);\n }\n }\n\n const idxs = ufuzzy.filter(haystack, search);\n const filteredOptions: VariableValueOption[] = [];\n\n if (idxs) {\n for (let i = 0; i < idxs.length; i++) {\n filteredOptions.push(allOptions[idxs[i]]);\n\n if (filteredOptions.length > limit) {\n return filteredOptions;\n }\n }\n\n return filteredOptions;\n }\n\n if (allOptions.length > limit) {\n return allOptions.slice(0, limit);\n }\n\n return allOptions;\n };\n}\n","import { isArray } from 'lodash';\nimport React, { RefCallback, useEffect, useMemo, useState } from 'react';\n\nimport { Checkbox, InputActionMeta, MultiSelect, Select, getSelectStyles, useStyles2, useTheme2 } from '@grafana/ui';\n\nimport { SceneComponentProps } from '../../core/types';\nimport { MultiValueVariable } from '../variants/MultiValueVariable';\nimport { VariableValue, VariableValueSingle } from '../types';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { css, cx } from '@emotion/css';\nimport { getOptionSearcher } from './getOptionSearcher';\n\nconst filterNoOp = () => true;\n\nexport function toSelectableValue<T>(value: T, label?: string): SelectableValue<T> {\n return {\n value,\n label: label ?? String(value),\n };\n}\n\nexport function VariableValueSelect({ model }: SceneComponentProps<MultiValueVariable>) {\n const { value, text, key, options, includeAll, isReadOnly } = model.useState();\n const [inputValue, setInputValue] = useState('');\n const [hasCustomValue, setHasCustomValue] = useState(false);\n const selectValue = toSelectableValue(value, String(text));\n\n const optionSearcher = useMemo(() => getOptionSearcher(options, includeAll), [options, includeAll]);\n\n const onInputChange = (value: string, { action }: InputActionMeta) => {\n if (action === 'input-change') {\n setInputValue(value);\n if (model.onSearchChange) {\n model.onSearchChange!(value);\n }\n return value;\n }\n\n return value;\n };\n\n const filteredOptions = optionSearcher(inputValue);\n\n const onOpenMenu = () => {\n if (hasCustomValue) {\n setInputValue(String(text));\n }\n };\n\n const onCloseMenu = () => {\n setInputValue('');\n };\n\n return (\n <Select<VariableValue>\n id={key}\n isValidNewOption={(inputValue) => inputValue.trim().length > 0}\n placeholder=\"Select value\"\n width=\"auto\"\n disabled={isReadOnly}\n value={selectValue}\n inputValue={inputValue}\n allowCustomValue\n virtualized\n filterOption={filterNoOp}\n tabSelectsValue={false}\n onInputChange={onInputChange}\n onOpenMenu={onOpenMenu}\n onCloseMenu={onCloseMenu}\n options={filteredOptions}\n data-testid={selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${value}`)}\n onChange={(newValue) => {\n model.changeValueTo(newValue.value!, newValue.label!);\n\n if (hasCustomValue !== newValue.__isNew__) {\n setHasCustomValue(newValue.__isNew__);\n }\n }}\n />\n );\n}\n\nexport function VariableValueSelectMulti({ model }: SceneComponentProps<MultiValueVariable>) {\n const { value, options, key, maxVisibleValues, noValueOnClear, includeAll, isReadOnly } = model.useState();\n const arrayValue = useMemo(() => (isArray(value) ? value : [value]), [value]);\n // To not trigger queries on every selection we store this state locally here and only update the variable onBlur\n const [uncommittedValue, setUncommittedValue] = useState(arrayValue);\n const [inputValue, setInputValue] = useState('');\n\n const optionSearcher = useMemo(() => getOptionSearcher(options, includeAll), [options, includeAll]);\n\n // Detect value changes outside\n useEffect(() => {\n setUncommittedValue(arrayValue);\n }, [arrayValue]);\n\n const onInputChange = (value: string, { action }: InputActionMeta) => {\n if (action === 'input-change') {\n setInputValue(value);\n if (model.onSearchChange) {\n model.onSearchChange!(value);\n }\n return value;\n }\n\n if (action === 'input-blur') {\n setInputValue('');\n return '';\n }\n\n return inputValue;\n };\n\n const placeholder = options.length > 0 ? 'Select value' : '';\n const filteredOptions = optionSearcher(inputValue);\n\n return (\n <MultiSelect<VariableValueSingle>\n id={key}\n placeholder={placeholder}\n width=\"auto\"\n inputValue={inputValue}\n disabled={isReadOnly}\n value={uncommittedValue}\n noMultiValueWrap={true}\n maxVisibleValues={maxVisibleValues ?? 5}\n tabSelectsValue={false}\n virtualized\n allowCustomValue\n options={filteredOptions}\n closeMenuOnSelect={false}\n components={{ Option: OptionWithCheckbox }}\n isClearable={true}\n hideSelectedOptions={false}\n onInputChange={onInputChange}\n onBlur={() => {\n model.changeValueTo(uncommittedValue);\n }}\n filterOption={filterNoOp}\n data-testid={selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${uncommittedValue}`)}\n onChange={(newValue, action) => {\n if (action.action === 'clear' && noValueOnClear) {\n model.changeValueTo([]);\n }\n setUncommittedValue(newValue.map((x) => x.value!));\n }}\n />\n );\n}\n\ninterface SelectMenuOptionProps<T> {\n isDisabled: boolean;\n isFocused: boolean;\n isSelected: boolean;\n innerProps: JSX.IntrinsicElements['div'];\n innerRef: RefCallback<HTMLDivElement>;\n renderOptionLabel?: (value: SelectableValue<T>) => JSX.Element;\n data: SelectableValue<T>;\n}\n\nexport const OptionWithCheckbox = ({\n children,\n data,\n innerProps,\n innerRef,\n isFocused,\n isSelected,\n renderOptionLabel,\n}: React.PropsWithChildren<SelectMenuOptionProps<unknown>>) => {\n // We are removing onMouseMove and onMouseOver from innerProps because they cause the whole\n // list to re-render everytime the user hovers over an option. This is a performance issue.\n // See https://github.com/JedWatson/react-select/issues/3128#issuecomment-451936743\n const { onMouseMove, onMouseOver, ...rest } = innerProps;\n const theme = useTheme2();\n const selectStyles = getSelectStyles(theme);\n const optionStyles = useStyles2(getOptionStyles);\n\n return (\n <div\n ref={innerRef}\n className={cx(selectStyles.option, isFocused && selectStyles.optionFocused)}\n {...rest}\n // TODO: use below selector once we update grafana dependencies to ^11.1.0\n // data-testid={selectors.components.Select.option}\n data-testid=\"data-testid Select option\"\n title={data.title}\n >\n <div className={optionStyles.checkbox}>\n <Checkbox value={isSelected} />\n </div>\n <div\n className={selectStyles.optionBody}\n data-testid={selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(\n data.label ?? String(data.value)\n )}\n >\n <span>{children}</span>\n </div>\n </div>\n );\n};\n\nOptionWithCheckbox.displayName = 'SelectMenuOptions';\n\nconst getOptionStyles = (theme: GrafanaTheme2) => ({\n checkbox: css({\n marginRight: theme.spacing(2),\n }),\n});\n\nexport function renderSelectForVariable(model: MultiValueVariable) {\n if (model.state.isMulti) {\n return <VariableValueSelectMulti model={model} />;\n } else {\n return <VariableValueSelect model={model} />;\n }\n}\n","import { SceneObjectUrlSyncHandler, SceneObjectUrlValues } from '../../core/types';\nimport { GroupByVariable } from './GroupByVariable';\nimport { toUrlCommaDelimitedString, unescapeUrlDelimiters } from '../utils';\nimport { VariableValue } from '../types';\n\nexport class GroupByVariableUrlSyncHandler implements SceneObjectUrlSyncHandler {\n public constructor(private _sceneObject: GroupByVariable) {}\n\n private getKey(): string {\n return `var-${this._sceneObject.state.name}`;\n }\n\n public getKeys(): string[] {\n if (this._sceneObject.state.skipUrlSync) {\n return [];\n }\n\n return [this.getKey()];\n }\n\n public getUrlState(): SceneObjectUrlValues {\n if (this._sceneObject.state.skipUrlSync) {\n return {};\n }\n\n return { [this.getKey()]: toUrlValues(this._sceneObject.state.value, this._sceneObject.state.text) };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues): void {\n let urlValue = values[this.getKey()];\n\n if (urlValue != null) {\n /**\n * Initial URL Sync happens before scene objects are activated.\n * We need to skip validation in this case to make sure values set via URL are maintained.\n */\n if (!this._sceneObject.isActive) {\n this._sceneObject.skipNextValidation = true;\n }\n\n const { values, texts } = fromUrlValues(urlValue);\n\n this._sceneObject.changeValueTo(values, texts);\n }\n }\n}\n\nfunction toUrlValues(values: VariableValue, texts: VariableValue): string[] {\n values = Array.isArray(values) ? values : [values];\n texts = Array.isArray(texts) ? texts : [texts];\n\n return values.map((value, idx) => {\n if (value === undefined || value === null) {\n return '';\n }\n\n value = String(value);\n\n let text = texts[idx];\n text = text === undefined || text === null ? value : String(text);\n\n return toUrlCommaDelimitedString(value, text);\n });\n}\n\nfunction fromUrlValues(urlValues: string | string[]): { values: string[]; texts: string[] } {\n urlValues = Array.isArray(urlValues) ? urlValues : [urlValues];\n\n return urlValues.reduce<{ values: string[]; texts: string[] }>(\n (acc, urlValue) => {\n const [value, label] = (urlValue ?? '').split(',');\n\n acc.values.push(unescapeUrlDelimiters(value));\n acc.texts.push(unescapeUrlDelimiters(label ?? value));\n\n return acc;\n },\n {\n values: [],\n texts: [],\n }\n );\n}\n","import { DataSourceGetTagKeysOptions, DataSourceGetTagValuesOptions } from '@grafana/data';\nimport { isFiltersRequestEnricher, SceneObject } from '../core/types';\n\nexport function getEnrichedFiltersRequest(\n sourceRunner: SceneObject\n): Partial<DataSourceGetTagKeysOptions | DataSourceGetTagValuesOptions> | null {\n const root = sourceRunner.getRoot();\n\n if (isFiltersRequestEnricher(root)) {\n return root.enrichFiltersRequest(sourceRunner);\n }\n\n return null;\n}\n","import { ScopedVar } from '@grafana/data';\nimport { SceneObject } from '../core/types';\n\nexport class SafeSerializableSceneObject implements ScopedVar {\n #value: SceneObject;\n\n public text = '__sceneObject';\n\n public constructor(value: SceneObject) {\n this.#value = value;\n }\n\n public toString() {\n return undefined;\n }\n\n public valueOf = () => {\n return this.#value;\n };\n\n public get value() {\n return this;\n }\n}\n","import { config } from '@grafana/runtime';\nimport { SceneObject } from '../core/types';\nimport { SafeSerializableSceneObject } from './SafeSerializableSceneObject';\nimport { ScopedVar } from '@grafana/data';\n\nexport function shouldWrapInSafeSerializableSceneObject(grafanaVersion: string): boolean {\n const pattern = /^(\\d+)\\.(\\d+)\\.(\\d+)/;\n const match = grafanaVersion.match(pattern);\n\n if (!match) {\n return false;\n }\n\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n\n if (major === 11) {\n return (minor === 0 && patch >= 4) || (minor === 1 && patch >= 2) || minor > 1;\n }\n\n if (major === 10) {\n return (minor === 4 && patch >= 8) || minor >= 5;\n }\n\n return major > 11; // Assuming versions greater than 11 are also supported.\n}\n\nexport function wrapInSafeSerializableSceneObject(sceneObject: SceneObject): ScopedVar {\n const version = config.buildInfo.version;\n\n if (shouldWrapInSafeSerializableSceneObject(version)) {\n return new SafeSerializableSceneObject(sceneObject);\n }\n\n return { value: sceneObject, text: '__sceneObject' };\n}\n","import React, { useEffect, useMemo, useState } from 'react';\n// @ts-expect-error Remove when 11.1.x is released\nimport { AdHocVariableFilter, DataSourceApi, GetTagResponse, MetricFindValue, SelectableValue } from '@grafana/data';\nimport { allActiveGroupByVariables } from './findActiveGroupByVariablesByUid';\nimport { DataSourceRef, VariableType } from '@grafana/schema';\nimport { SceneComponentProps, ControlsLayout, SceneObjectUrlSyncHandler } from '../../core/types';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { ValidateAndUpdateResult, VariableValueOption, VariableValueSingle } from '../types';\nimport { MultiValueVariable, MultiValueVariableState, VariableGetOptionsArgs } from '../variants/MultiValueVariable';\nimport { from, lastValueFrom, map, mergeMap, Observable, of, take, tap } from 'rxjs';\nimport { getDataSource } from '../../utils/getDataSource';\nimport { InputActionMeta, MultiSelect } from '@grafana/ui';\nimport { isArray } from 'lodash';\nimport { dataFromResponse, getQueriesForVariables, handleOptionGroups, responseHasError } from '../utils';\nimport { OptionWithCheckbox } from '../components/VariableValueSelect';\nimport { GroupByVariableUrlSyncHandler } from './GroupByVariableUrlSyncHandler';\nimport { getOptionSearcher } from '../components/getOptionSearcher';\nimport { getEnrichedFiltersRequest } from '../getEnrichedFiltersRequest';\nimport { wrapInSafeSerializableSceneObject } from '../../utils/wrapInSafeSerializableSceneObject';\n\nexport interface GroupByVariableState extends MultiValueVariableState {\n /** Defaults to \"Group\" */\n name: string;\n /** The visible keys to group on */\n // TODO review this type and name (naming is hard)\n defaultOptions?: MetricFindValue[];\n /** Base filters to always apply when looking up keys */\n baseFilters?: AdHocVariableFilter[];\n /** Datasource to use for getTagKeys and also controls which scene queries the group by should apply to */\n datasource: DataSourceRef | null;\n /** Controls if the group by can be changed */\n readOnly?: boolean;\n /**\n * @experimental\n * Controls the layout and design of the label.\n * Vertical layout does not yet support operator selector.\n */\n layout?: ControlsLayout;\n /**\n * Defaults to same-datasource which means group by will automatically be applied to all queries with the same data source as this GroupBySet.\n * In manual mode no queries are re-run on changes, and you have to manually apply the filter to whatever queries you want.\n */\n applyMode?: 'auto' | 'manual';\n /**\n * Filter out the keys that do not match the regex.\n */\n tagKeyRegexFilter?: RegExp;\n /**\n * Extension hook for customizing the key lookup.\n * Return replace: true if you want to override the default lookup\n * Return replace: false if you want to combine the results with the default lookup\n */\n getTagKeysProvider?: getTagKeysProvider;\n}\n\nexport type getTagKeysProvider = (\n set: GroupByVariable,\n currentKey: string | null\n) => Promise<{ replace?: boolean; values: MetricFindValue[] | GetTagResponse }>;\n\nexport class GroupByVariable extends MultiValueVariable<GroupByVariableState> {\n static Component = GroupByVariableRenderer;\n isLazy = true;\n\n protected _urlSync: SceneObjectUrlSyncHandler = new GroupByVariableUrlSyncHandler(this);\n\n public validateAndUpdate(): Observable<ValidateAndUpdateResult> {\n return this.getValueOptions({}).pipe(\n map((options) => {\n this._updateValueGivenNewOptions(options);\n return {};\n })\n );\n }\n\n private _updateValueGivenNewOptions(options: VariableValueOption[]) {\n const { value: currentValue, text: currentText } = this.state;\n\n const stateUpdate: Partial<MultiValueVariableState> = {\n options,\n loading: false,\n value: currentValue ?? [],\n text: currentText ?? [],\n };\n\n this.setState(stateUpdate);\n }\n\n public getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]> {\n // When default dimensions are provided, return the static list\n if (this.state.defaultOptions) {\n return of(\n this.state.defaultOptions.map((o) => ({\n label: o.text,\n value: String(o.value),\n // @ts-expect-error Remove when we update to @grafana/data > 11.1.0\n group: o.group,\n }))\n );\n }\n\n this.setState({ loading: true, error: null });\n\n return from(\n getDataSource(this.state.datasource, {\n __sceneObject: wrapInSafeSerializableSceneObject(this),\n })\n ).pipe(\n mergeMap((ds) => {\n return from(this._getKeys(ds)).pipe(\n tap((response) => {\n if (responseHasError(response)) {\n this.setState({ error: response.error.message });\n }\n }),\n map((response) => dataFromResponse(response)),\n take(1),\n mergeMap((data) => {\n // @ts-expect-error Remove when 11.1.x is released\n const a: VariableValueOption[] = data.map((i) => {\n return {\n label: i.text,\n value: i.value ? String(i.value) : i.text,\n group: i.group,\n };\n });\n return of(a);\n })\n );\n })\n );\n }\n\n public constructor(initialState: Partial<GroupByVariableState>) {\n super({\n isMulti: true,\n name: '',\n value: [],\n text: [],\n options: [],\n datasource: null,\n baseFilters: [],\n applyMode: 'auto',\n layout: 'horizontal',\n type: 'groupby' as VariableType,\n ...initialState,\n noValueOnClear: true,\n });\n\n this.addActivationHandler(() => {\n allActiveGroupByVariables.add(this);\n\n return () => allActiveGroupByVariables.delete(this);\n });\n }\n\n /**\n * Get possible keys given current filters. Do not call from plugins directly\n */\n public _getKeys = async (ds: DataSourceApi) => {\n // TODO: provide current dimensions?\n const override = await this.state.getTagKeysProvider?.(this, null);\n\n if (override && override.replace) {\n return override.values;\n }\n\n if (this.state.defaultOptions) {\n return this.state.defaultOptions.concat(dataFromResponse(override?.values ?? []));\n }\n\n if (!ds.getTagKeys) {\n return [];\n }\n\n const queries = getQueriesForVariables(this);\n\n const otherFilters = this.state.baseFilters || [];\n const timeRange = sceneGraph.getTimeRange(this).state.value;\n const response = await ds.getTagKeys({\n filters: otherFilters,\n queries,\n timeRange,\n ...getEnrichedFiltersRequest(this),\n });\n if (responseHasError(response)) {\n // @ts-expect-error Remove when 11.1.x is released\n this.setState({ error: response.error.message });\n }\n\n let keys = dataFromResponse(response);\n if (override) {\n keys = keys.concat(dataFromResponse(override.values));\n }\n\n const tagKeyRegexFilter = this.state.tagKeyRegexFilter;\n if (tagKeyRegexFilter) {\n // @ts-expect-error Remove when 11.1.x is released\n keys = keys.filter((f) => f.text.match(tagKeyRegexFilter));\n }\n\n return keys;\n };\n\n /**\n * Allows clearing the value of the variable to an empty value. Overrides default behavior of a MultiValueVariable\n */\n public getDefaultMultiState(options: VariableValueOption[]): { value: VariableValueSingle[]; text: string[] } {\n return { value: [], text: [] };\n }\n}\nexport function GroupByVariableRenderer({ model }: SceneComponentProps<MultiValueVariable>) {\n const { value, text, key, maxVisibleValues, noValueOnClear, options, includeAll } = model.useState();\n\n const values = useMemo<Array<SelectableValue<VariableValueSingle>>>(() => {\n const arrayValue = isArray(value) ? value : [value];\n const arrayText = isArray(text) ? text : [text];\n\n return arrayValue.map((value, idx) => ({\n value,\n label: String(arrayText[idx] ?? value),\n }));\n }, [value, text]);\n\n const [isFetchingOptions, setIsFetchingOptions] = useState(false);\n const [isOptionsOpen, setIsOptionsOpen] = useState(false);\n const [inputValue, setInputValue] = useState('');\n\n // To not trigger queries on every selection we store this state locally here and only update the variable onBlur\n const [uncommittedValue, setUncommittedValue] = useState(values);\n\n const optionSearcher = useMemo(() => getOptionSearcher(options, includeAll), [options, includeAll]);\n\n // Detect value changes outside\n useEffect(() => {\n setUncommittedValue(values);\n }, [values]);\n\n const onInputChange = (value: string, { action }: InputActionMeta) => {\n if (action === 'input-change') {\n setInputValue(value);\n if (model.onSearchChange) {\n model.onSearchChange!(value);\n }\n return value;\n }\n\n if (action === 'input-blur') {\n setInputValue('');\n return '';\n }\n\n return inputValue;\n };\n\n const filteredOptions = useMemo(\n () => handleOptionGroups(optionSearcher(inputValue).map(toSelectableValue)),\n [optionSearcher, inputValue]\n );\n\n return (\n <MultiSelect<VariableValueSingle>\n data-testid={`GroupBySelect-${key}`}\n id={key}\n placeholder={'Select value'}\n width=\"auto\"\n inputValue={inputValue}\n value={uncommittedValue}\n noMultiValueWrap={true}\n maxVisibleValues={maxVisibleValues ?? 5}\n tabSelectsValue={false}\n virtualized\n options={filteredOptions}\n filterOption={filterNoOp}\n closeMenuOnSelect={false}\n isOpen={isOptionsOpen}\n isClearable={true}\n hideSelectedOptions={false}\n isLoading={isFetchingOptions}\n components={{ Option: OptionWithCheckbox }}\n onInputChange={onInputChange}\n onBlur={() => {\n model.changeValueTo(\n uncommittedValue.map((x) => x.value!),\n uncommittedValue.map((x) => x.label!)\n );\n }}\n onChange={(newValue, action) => {\n if (action.action === 'clear' && noValueOnClear) {\n model.changeValueTo([]);\n }\n setUncommittedValue(newValue);\n }}\n onOpenMenu={async () => {\n setIsFetchingOptions(true);\n await lastValueFrom(model.validateAndUpdate());\n setIsFetchingOptions(false);\n setIsOptionsOpen(true);\n }}\n onCloseMenu={() => {\n setIsOptionsOpen(false);\n }}\n />\n );\n}\n\nconst filterNoOp = () => true;\n\nfunction toSelectableValue(input: VariableValueOption): SelectableValue<VariableValueSingle> {\n const { label, value, group } = input;\n const result: SelectableValue<VariableValueSingle> = {\n label,\n value,\n };\n\n if (group) {\n result.group = group;\n }\n\n return result;\n}\n","import { Icon, Tooltip } from '@grafana/ui';\nimport React, { useCallback } from 'react';\nimport { LoadingIndicatorProps as SelectLoadingIndicatorProps } from 'react-select';\n\nexport const SelectLoadingIndicator = ({\n innerProps,\n ...props\n}: SelectLoadingIndicatorProps & { selectProps: { onCancel: () => void } }) => {\n const { onCancel } = props.selectProps;\n const onMouseDown = useCallback(\n (event: React.MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n onCancel();\n },\n [onCancel]\n );\n\n return <LoadingIndicator onCancel={onMouseDown} />;\n};\n\ninterface LoadingIndicatorProps {\n onCancel: (event: React.MouseEvent) => void;\n}\n\nexport function LoadingIndicator(props: LoadingIndicatorProps) {\n return (\n <Tooltip content=\"Cancel query\">\n <Icon\n className=\"spin-clockwise\"\n name=\"sync\"\n size=\"xs\"\n role=\"button\"\n onMouseDown={(e) => {\n props.onCancel(e);\n }}\n />\n </Tooltip>\n );\n}\n","import React from 'react';\nimport { Icon, IconButton, Tooltip, useStyles2, useTheme2 } from '@grafana/ui';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { GrafanaTheme2, IconName } from '@grafana/data';\nimport { css } from '@emotion/css';\nimport { LoadingIndicator } from './LoadingIndicator';\nimport { ControlsLayout } from '../core/types';\n\ninterface ControlsLabelProps {\n label: string;\n htmlFor?: string;\n description?: string;\n isLoading?: boolean;\n error?: string;\n icon?: IconName;\n layout?: ControlsLayout;\n onCancel?: () => void;\n onRemove?: () => void;\n}\n\nexport function ControlsLabel(props: ControlsLabelProps) {\n const styles = useStyles2(getStyles);\n const theme = useTheme2();\n const isVertical = props.layout === 'vertical';\n\n const loadingIndicator = Boolean(props.isLoading) ? (\n <div\n style={{ marginLeft: theme.spacing(1), marginTop: '-1px' }}\n aria-label={selectors.components.LoadingIndicator.icon}\n >\n <LoadingIndicator\n onCancel={(e) => {\n e.preventDefault();\n e.stopPropagation();\n props.onCancel?.();\n }}\n />\n </div>\n ) : null;\n\n let errorIndicator = null;\n if (props.error) {\n errorIndicator = (\n <Tooltip content={props.error} placement={'bottom'}>\n <Icon className={styles.errorIcon} name=\"exclamation-triangle\" />\n </Tooltip>\n );\n }\n\n let descriptionIndicator = null;\n if (props.description) {\n descriptionIndicator = (\n <Tooltip content={props.description} placement={isVertical ? 'top' : 'bottom'}>\n <Icon className={styles.normalIcon} name=\"info-circle\" />\n </Tooltip>\n );\n }\n\n const testId =\n typeof props.label === 'string' ? selectors.pages.Dashboard.SubMenu.submenuItemLabels(props.label) : '';\n let labelElement: JSX.Element;\n\n // The vertical layout has different css class and order of elements (label always first)\n\n if (isVertical) {\n labelElement = (\n <label className={styles.verticalLabel} data-testid={testId} htmlFor={props.htmlFor}>\n {props.label}\n {descriptionIndicator}\n {errorIndicator}\n {props.icon && <Icon name={props.icon} className={styles.normalIcon} />}\n {loadingIndicator}\n {props.onRemove && (\n <IconButton variant=\"secondary\" size=\"xs\" name=\"times\" onClick={props.onRemove} tooltip={'Remove'} />\n )}\n </label>\n );\n } else {\n labelElement = (\n <label className={styles.horizontalLabel} data-testid={testId} htmlFor={props.htmlFor}>\n {errorIndicator}\n {props.icon && <Icon name={props.icon} className={styles.normalIcon} />}\n {props.label}\n {descriptionIndicator}\n {loadingIndicator}\n </label>\n );\n }\n\n return labelElement;\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n horizontalLabel: css({\n background: theme.isDark ? theme.colors.background.primary : theme.colors.background.secondary,\n display: `flex`,\n alignItems: 'center',\n padding: theme.spacing(0, 1),\n fontWeight: theme.typography.fontWeightMedium,\n fontSize: theme.typography.bodySmall.fontSize,\n height: theme.spacing(theme.components.height.md),\n lineHeight: theme.spacing(theme.components.height.md),\n borderRadius: theme.shape.borderRadius(1),\n border: `1px solid ${theme.components.input.borderColor}`,\n position: 'relative',\n // To make the border line up with the input border\n right: -1,\n whiteSpace: 'nowrap',\n gap: theme.spacing(0.5),\n }),\n verticalLabel: css({\n display: `flex`,\n alignItems: 'center',\n fontWeight: theme.typography.fontWeightMedium,\n fontSize: theme.typography.bodySmall.fontSize,\n lineHeight: theme.typography.bodySmall.lineHeight,\n whiteSpace: 'nowrap',\n marginBottom: theme.spacing(0.5),\n gap: theme.spacing(1),\n }),\n errorIcon: css({\n color: theme.colors.error.text,\n }),\n normalIcon: css({\n color: theme.colors.text.secondary,\n }),\n});\n","import uFuzzy from '@leeoniya/ufuzzy';\nimport { SelectableValue } from '@grafana/data';\n\nexport function getAdhocOptionSearcher(\n options: SelectableValue[],\n) {\n const ufuzzy = new uFuzzy();\n const haystack: string[] = [];\n const limit = 10000;\n\n return (search: string) => {\n if (search === '') {\n if (options.length > limit) {\n return options.slice(0, limit);\n } else {\n return options;\n }\n }\n\n if (haystack.length === 0) {\n for (let i = 0; i < options.length; i++) {\n haystack.push(options[i].label ?? String(options[i].value));\n }\n }\n\n const idxs = ufuzzy.filter(haystack, search);\n const filteredOptions: SelectableValue[] = [];\n\n if (idxs) {\n for (let i = 0; i < idxs.length; i++) {\n filteredOptions.push(options[idxs[i]]);\n\n if (filteredOptions.length > limit) {\n return filteredOptions;\n }\n }\n\n return filteredOptions;\n }\n\n if (options.length > limit) {\n return options.slice(0, limit);\n }\n\n return options;\n };\n}\n","import React, { useMemo, useState } from 'react';\n\nimport { AdHocFiltersVariable, AdHocFilterWithLabels, isMultiValueOperator } from './AdHocFiltersVariable';\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { Button, Field, InputActionMeta, Select, useStyles2 } from '@grafana/ui';\nimport { css, cx } from '@emotion/css';\nimport { ControlsLabel } from '../../utils/ControlsLabel';\nimport { getAdhocOptionSearcher } from './getAdhocOptionSearcher';\nimport { handleOptionGroups } from '../utils';\nimport { OptionWithCheckbox } from '../components/VariableValueSelect';\n\ninterface Props {\n filter: AdHocFilterWithLabels;\n model: AdHocFiltersVariable;\n}\n\nfunction keyLabelToOption(key: string, label?: string): SelectableValue | null {\n return key !== ''\n ? {\n value: key,\n label: label || key,\n }\n : null;\n}\n\nconst filterNoOp = () => true;\n\nexport function AdHocFilterRenderer({ filter, model }: Props) {\n const styles = useStyles2(getStyles);\n\n const [keys, setKeys] = useState<SelectableValue[]>([]);\n const [values, setValues] = useState<SelectableValue[]>([]);\n const [isKeysLoading, setIsKeysLoading] = useState(false);\n const [isValuesLoading, setIsValuesLoading] = useState(false);\n const [isKeysOpen, setIsKeysOpen] = useState(false);\n const [isValuesOpen, setIsValuesOpen] = useState(false);\n const [isOperatorOpen, setIsOperatorOpen] = useState(false);\n const [valueInputValue, setValueInputValue] = useState('');\n const [valueHasCustomValue, setValueHasCustomValue] = useState(false);\n // To not trigger queries on every selection we store this state locally here and only update the variable onBlur\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n const [uncommittedValue, setUncommittedValue] = useState<SelectableValue>(filter.values ? filter.values.map((value, index) => keyLabelToOption(value, filter.valueLabels?.[index])) : []);\n const isMultiValue = isMultiValueOperator(filter.operator);\n\n const keyValue = keyLabelToOption(filter.key, filter.keyLabel);\n const valueValue = keyLabelToOption(filter.value, filter.valueLabels?.[0]);\n\n const optionSearcher = useMemo(() => getAdhocOptionSearcher(values), [values]);\n\n const onValueInputChange = (value: string, { action }: InputActionMeta) => {\n if (action === 'input-change') {\n setValueInputValue(value);\n }\n return value;\n };\n\n const onOperatorChange = (v: SelectableValue) => {\n const existingOperator = filter.operator;\n const newOperator = v.value;\n\n const update: Partial<AdHocFilterWithLabels> = { operator: newOperator };\n // clear value if operator has changed from multi to single\n if (isMultiValueOperator(existingOperator) && !isMultiValueOperator(newOperator)) {\n update.value = '';\n update.valueLabels = [''];\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n update.values = undefined;\n setUncommittedValue([]);\n // set values if operator has changed from single to multi\n } else if (!isMultiValueOperator(existingOperator) && isMultiValueOperator(newOperator) && filter.value) {\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n update.values = [filter.value];\n setUncommittedValue([{\n value: filter.value,\n label: filter.valueLabels?.[0] ?? filter.value,\n }]);\n }\n model._updateFilter(filter, update);\n }\n\n const filteredValueOptions = useMemo(\n () => handleOptionGroups(optionSearcher(valueInputValue)),\n [optionSearcher, valueInputValue]\n );\n\n const multiValueProps = {\n isMulti: true,\n value: uncommittedValue,\n components: {\n Option: OptionWithCheckbox,\n },\n hideSelectedOptions: false,\n closeMenuOnSelect: false,\n openMenuOnFocus: false,\n onChange: (v: SelectableValue) => {\n setUncommittedValue(v);\n // clear input value when creating a new custom multi value\n if (v.some((value: SelectableValue) => value.__isNew__)) {\n setValueInputValue('');\n }\n },\n onBlur: () => {\n model._updateFilter(filter, {\n value: uncommittedValue[0]?.value ?? '',\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n values: uncommittedValue.map((option: SelectableValue<string>) => option.value),\n valueLabels: uncommittedValue.map((option: SelectableValue<string>) => option.label),\n });\n }\n }\n\n const valueSelect = (\n <Select\n virtualized\n allowCustomValue\n isValidNewOption={(inputValue) => inputValue.trim().length > 0}\n allowCreateWhileLoading\n formatCreateLabel={(inputValue) => `Use custom value: ${inputValue}`}\n disabled={model.state.readOnly}\n className={cx(styles.value, isValuesOpen ? styles.widthWhenOpen : undefined)}\n width=\"auto\"\n value={valueValue}\n filterOption={filterNoOp}\n placeholder={'Select value'}\n options={filteredValueOptions}\n inputValue={valueInputValue}\n onInputChange={onValueInputChange}\n onChange={(v) => {\n model._updateFilter(filter, {\n value: v.value,\n valueLabels: v.label ? [v.label] : [v.value]\n });\n\n if (valueHasCustomValue !== v.__isNew__) {\n setValueHasCustomValue(v.__isNew__);\n }\n }}\n // there's a bug in react-select where the menu doesn't recalculate its position when the options are loaded asynchronously\n // see https://github.com/grafana/grafana/issues/63558\n // instead, we explicitly control the menu visibility and prevent showing it until the options have fully loaded\n isOpen={isValuesOpen && !isValuesLoading}\n isLoading={isValuesLoading}\n openMenuOnFocus={true}\n onOpenMenu={async () => {\n setIsValuesLoading(true);\n setIsValuesOpen(true);\n const values = await model._getValuesFor(filter);\n setIsValuesLoading(false);\n setValues(values);\n if (valueHasCustomValue) {\n setValueInputValue(valueValue?.label ?? '');\n }\n }}\n onCloseMenu={() => {\n setIsValuesOpen(false);\n setValueInputValue('');\n }}\n {...(isMultiValue && multiValueProps)}\n />\n );\n\n const keySelect = (\n <Select\n // By changing the key, we reset the Select component,\n // to ensure that the loaded values are shown after they are loaded\n key={`${isValuesLoading ? 'loading' : 'loaded'}`}\n disabled={model.state.readOnly}\n className={cx(styles.key, isKeysOpen ? styles.widthWhenOpen : undefined)}\n width=\"auto\"\n allowCustomValue={true}\n value={keyValue}\n placeholder={'Select label'}\n options={handleOptionGroups(keys)}\n onChange={(v) => {\n model._updateFilter(filter, {\n key: v.value,\n keyLabel: v.label,\n // clear value if key has changed\n value: '',\n valueLabels: [''],\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n values: undefined\n })\n setUncommittedValue([]);\n }}\n autoFocus={filter.key === ''}\n // there's a bug in react-select where the menu doesn't recalculate its position when the options are loaded asynchronously\n // see https://github.com/grafana/grafana/issues/63558\n // instead, we explicitly control the menu visibility and prevent showing it until the options have fully loaded\n isOpen={isKeysOpen && !isKeysLoading}\n isLoading={isKeysLoading}\n onOpenMenu={async () => {\n setIsKeysOpen(true);\n setIsKeysLoading(true);\n const keys = await model._getKeys(filter.key);\n setIsKeysLoading(false);\n setKeys(keys);\n }}\n onCloseMenu={() => {\n setIsKeysOpen(false);\n }}\n onBlur={() => {\n if (filter.key === '') {\n model._removeFilter(filter);\n }\n }}\n openMenuOnFocus={true}\n />\n );\n\n const operatorSelect = (\n <Select\n className={cx(styles.operator, {\n [styles.widthWhenOpen]: isOperatorOpen,\n })}\n value={filter.operator}\n disabled={model.state.readOnly}\n options={model._getOperators()}\n onChange={onOperatorChange}\n onOpenMenu={() => {\n setIsOperatorOpen(true)\n }}\n onCloseMenu={() => {\n setIsOperatorOpen(false)\n }}\n />\n );\n\n if (model.state.layout === 'vertical') {\n if (filter.key) {\n const label = (\n <ControlsLabel layout=\"vertical\" label={filter.key ?? ''} onRemove={() => model._removeFilter(filter)} />\n );\n\n return (\n <Field label={label} data-testid={`AdHocFilter-${filter.key}`} className={styles.field}>\n <div className={styles.wrapper}>\n {operatorSelect}\n {valueSelect}\n </div>\n </Field>\n );\n } else {\n return (\n <Field label={'Select label'} data-testid={`AdHocFilter-${filter.key}`} className={styles.field}>\n {keySelect}\n </Field>\n );\n }\n }\n\n return (\n <div className={styles.wrapper} data-testid={`AdHocFilter-${filter.key}`}>\n {keySelect}\n {operatorSelect}\n {valueSelect}\n <Button\n variant=\"secondary\"\n aria-label=\"Remove filter\"\n title=\"Remove filter\"\n className={styles.removeButton}\n icon=\"times\"\n data-testid={`AdHocFilter-remove-${filter.key ?? ''}`}\n onClick={() => model._removeFilter(filter)}\n />\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n field: css({\n marginBottom: 0,\n }),\n wrapper: css({\n display: 'flex',\n '> *': {\n '&:not(:first-child)': {\n // Negative margin hides the double-border on adjacent selects\n marginLeft: -1,\n },\n\n '&:first-child': {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n\n '&:last-child': {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n\n '&:not(:first-child):not(:last-child)': {\n borderRadius: 0,\n },\n\n // Fix focus state zIndex issues\n position: 'relative',\n zIndex: 0,\n\n // Adjacent borders are overlapping, so raise children up when hovering etc\n // so all that child's borders are visible.\n '&:hover': {\n zIndex: 1,\n },\n\n '&:focus-within': {\n zIndex: 2,\n },\n },\n }),\n widthWhenOpen: css({\n minWidth: theme.spacing(16),\n }),\n value: css({\n flexBasis: 'content',\n flexShrink: 1,\n minWidth: '90px',\n }),\n key: css({\n flexBasis: 'content',\n minWidth: '90px',\n flexShrink: 1,\n }),\n operator: css({\n flexShrink: 0,\n flexBasis: 'content',\n }),\n removeButton: css({\n paddingLeft: theme.spacing(3 / 2),\n paddingRight: theme.spacing(3 / 2),\n borderLeft: 'none',\n width: theme.spacing(3),\n marginRight: theme.spacing(1),\n boxSizing: 'border-box',\n // To not have button background and last select border intersect\n position: 'relative',\n left: '1px',\n }),\n});\n","import React from 'react';\n\nimport { AdHocFilterRenderer } from './AdHocFilterRenderer';\nimport { AdHocFiltersVariable } from './AdHocFiltersVariable';\nimport { Button } from '@grafana/ui';\n\ninterface Props {\n model: AdHocFiltersVariable;\n addFilterButtonText?: string;\n}\n\nexport function AdHocFilterBuilder({ model, addFilterButtonText }: Props) {\n const { _wip } = model.useState();\n\n if (!_wip) {\n return (\n <Button\n variant=\"secondary\"\n icon=\"plus\"\n title={'Add filter'}\n aria-label=\"Add filter\"\n data-testid={`AdHocFilter-add`}\n onClick={() => model._addWip()}\n >{addFilterButtonText}</Button>\n );\n }\n\n return <AdHocFilterRenderer filter={_wip} model={model} />;\n}\n","import { SceneObjectUrlSyncHandler, SceneObjectUrlValue, SceneObjectUrlValues } from '../../core/types';\nimport { AdHocFiltersVariable, AdHocFilterWithLabels, isFilterComplete, isMultiValueOperator } from './AdHocFiltersVariable';\nimport { escapeUrlPipeDelimiters, toUrlCommaDelimitedString, unescapeUrlDelimiters } from '../utils';\n\nexport class AdHocFiltersVariableUrlSyncHandler implements SceneObjectUrlSyncHandler {\n public constructor(private _variable: AdHocFiltersVariable) {}\n\n private getKey(): string {\n return `var-${this._variable.state.name}`;\n }\n\n public getKeys(): string[] {\n return [this.getKey()];\n }\n\n public getUrlState(): SceneObjectUrlValues {\n const filters = this._variable.state.filters;\n\n if (filters.length === 0) {\n return { [this.getKey()]: [''] };\n }\n\n const value = filters.filter(isFilterComplete).map((filter) => toArray(filter).map(escapeUrlPipeDelimiters).join('|'));\n return { [this.getKey()]: value };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues): void {\n const urlValue = values[this.getKey()];\n\n if (urlValue == null) {\n return;\n }\n\n const filters = deserializeUrlToFilters(urlValue);\n this._variable.setState({ filters });\n }\n}\n\nfunction deserializeUrlToFilters(value: SceneObjectUrlValue): AdHocFilterWithLabels[] {\n if (Array.isArray(value)) {\n const values = value;\n return values.map(toFilter).filter(isFilter);\n }\n\n const filter = toFilter(value);\n return filter === null ? [] : [filter];\n}\n\nfunction toArray(filter: AdHocFilterWithLabels): string[] {\n const result = [\n toUrlCommaDelimitedString(filter.key, filter.keyLabel),\n filter.operator,\n ];\n if (isMultiValueOperator(filter.operator)) {\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n filter.values.forEach((value, index) => {\n result.push(toUrlCommaDelimitedString(value, filter.valueLabels?.[index]));\n });\n } else {\n result.push(toUrlCommaDelimitedString(filter.value, filter.valueLabels?.[0]));\n }\n return result;\n}\n\nfunction toFilter(urlValue: string | number | boolean | undefined | null): AdHocFilterWithLabels | null {\n if (typeof urlValue !== 'string' || urlValue.length === 0) {\n return null;\n }\n\n const [key, keyLabel, operator, _operatorLabel, ...values] = urlValue\n .split('|')\n .reduce<string[]>((acc, v) => {\n const [key, label] = v.split(',');\n\n acc.push(key, label ?? key);\n\n return acc;\n }, [])\n .map(unescapeUrlDelimiters);\n\n return {\n key,\n keyLabel,\n operator,\n value: values[0],\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n values: isMultiValueOperator(operator) ? values.filter((_, index) => index % 2 === 0) : undefined,\n valueLabels: values.filter((_, index) => index % 2 === 1),\n condition: '',\n };\n}\n\nfunction isFilter(filter: AdHocFilterWithLabels | null): filter is AdHocFilterWithLabels {\n return filter !== null && typeof filter.key === 'string' && typeof filter.value === 'string';\n}\n","import React from 'react';\n// @ts-expect-error Remove when 11.1.x is released\nimport { AdHocVariableFilter, GetTagResponse, GrafanaTheme2, MetricFindValue, SelectableValue } from '@grafana/data';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneVariable, SceneVariableState, SceneVariableValueChangedEvent, VariableValue } from '../types';\nimport { ControlsLayout, SceneComponentProps } from '../../core/types';\nimport { DataSourceRef } from '@grafana/schema';\nimport { dataFromResponse, getQueriesForVariables, renderPrometheusLabelFilters, responseHasError } from '../utils';\nimport { patchGetAdhocFilters } from './patchGetAdhocFilters';\nimport { useStyles2 } from '@grafana/ui';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { AdHocFilterBuilder } from './AdHocFilterBuilder';\nimport { AdHocFilterRenderer } from './AdHocFilterRenderer';\nimport { getDataSourceSrv } from '@grafana/runtime';\nimport { AdHocFiltersVariableUrlSyncHandler } from './AdHocFiltersVariableUrlSyncHandler';\nimport { css } from '@emotion/css';\nimport { getEnrichedFiltersRequest } from '../getEnrichedFiltersRequest';\nimport { wrapInSafeSerializableSceneObject } from '../../utils/wrapInSafeSerializableSceneObject';\n\nexport interface AdHocFilterWithLabels extends AdHocVariableFilter {\n keyLabel?: string;\n valueLabels?: string[];\n}\nexport interface AdHocFiltersVariableState extends SceneVariableState {\n /** Optional text to display on the 'add filter' button */\n addFilterButtonText?: string;\n /** The visible filters */\n filters: AdHocFilterWithLabels[];\n /** Base filters to always apply when looking up keys*/\n baseFilters?: AdHocFilterWithLabels[];\n /** Datasource to use for getTagKeys and getTagValues and also controls which scene queries the filters should apply to */\n datasource: DataSourceRef | null;\n /** Controls if the filters can be changed */\n readOnly?: boolean;\n /**\n * @experimental\n * Controls the layout and design of the label.\n */\n layout?: ControlsLayout;\n /**\n * Defaults to automatic which means filters will automatically be applied to all queries with the same data source as this AdHocFilterSet.\n * In manual mode you either have to use the filters programmatically or as a variable inside query expressions.\n */\n applyMode: 'auto' | 'manual';\n /**\n * Filter out the keys that do not match the regex.\n */\n tagKeyRegexFilter?: RegExp;\n /**\n * Extension hook for customizing the key lookup.\n * Return replace: true if you want to override the default lookup\n * Return replace: false if you want to combine the results with the default lookup\n */\n getTagKeysProvider?: getTagKeysProvider;\n /**\n * Extension hook for customizing the value lookup.\n * Return replace: true if you want to override the default lookup.\n * Return replace: false if you want to combine the results with the default lookup\n */\n getTagValuesProvider?: getTagValuesProvider;\n\n /**\n * Optionally provide an array of static keys that override getTagKeys\n */\n defaultKeys?: MetricFindValue[];\n\n /**\n * This is the expression that the filters resulted in. Defaults to\n * Prometheus / Loki compatible label filter expression\n */\n filterExpression?: string;\n\n /**\n * The default builder creates a Prometheus/Loki compatible filter expression,\n * this can be overridden to create a different expression based on the current filters.\n */\n expressionBuilder?: AdHocVariableExpressionBuilderFn;\n\n /**\n * Whether the filter supports new multi-value operators like =| and !=|\n */\n supportsMultiValueOperators?: boolean;\n\n /**\n * When querying the datasource for label names and values to determine keys and values\n * for this ad hoc filter, consider the queries in the scene and use them as a filter.\n * This queries filter can be used to ensure that only ad hoc filter options that would\n * impact the current queries are presented to the user.\n */\n useQueriesAsFilterForOptions?: boolean;\n\n /**\n * @internal state of the new filter being added\n */\n _wip?: AdHocFilterWithLabels;\n}\n\nexport type AdHocVariableExpressionBuilderFn = (filters: AdHocFilterWithLabels[]) => string;\n\nexport type getTagKeysProvider = (\n variable: AdHocFiltersVariable,\n currentKey: string | null\n) => Promise<{ replace?: boolean; values: GetTagResponse | MetricFindValue[] }>;\n\nexport type getTagValuesProvider = (\n variable: AdHocFiltersVariable,\n filter: AdHocFilterWithLabels\n) => Promise<{ replace?: boolean; values: GetTagResponse | MetricFindValue[] }>;\n\nexport type AdHocFiltersVariableCreateHelperArgs = AdHocFiltersVariableState;\n\nexport type OperatorDefinition = {\n value: string;\n description?: string;\n isMulti?: Boolean;\n};\n\nconst OPERATORS: OperatorDefinition[] = [{\n value: '=',\n}, {\n value: '!='\n}, {\n value: '=|',\n description: 'Is one of. Use to filter on multiple values.',\n isMulti: true,\n}, {\n value: '!=|',\n description: 'Is not one of. Use to exclude multiple values.',\n isMulti: true\n}, {\n value: '=~',\n description: 'Matches regex',\n}, {\n value: '!~',\n description: 'Does not match regex',\n}, {\n value: '<'\n}, {\n value: '>'\n}];\n\nexport class AdHocFiltersVariable\n extends SceneObjectBase<AdHocFiltersVariableState>\n implements SceneVariable<AdHocFiltersVariableState>\n{\n static Component = AdHocFiltersVariableRenderer;\n\n private _scopedVars = { __sceneObject: wrapInSafeSerializableSceneObject(this) };\n private _dataSourceSrv = getDataSourceSrv();\n\n protected _urlSync = new AdHocFiltersVariableUrlSyncHandler(this);\n\n public constructor(state: Partial<AdHocFiltersVariableState>) {\n super({\n type: 'adhoc',\n name: state.name ?? 'Filters',\n filters: [],\n datasource: null,\n applyMode: 'auto',\n filterExpression: state.filterExpression ?? renderExpression(state.expressionBuilder, state.filters),\n ...state,\n });\n\n if (this.state.applyMode === 'auto') {\n patchGetAdhocFilters(this);\n }\n }\n\n public setState(update: Partial<AdHocFiltersVariableState>): void {\n let filterExpressionChanged = false;\n\n if (update.filters && update.filters !== this.state.filters && !update.filterExpression) {\n update.filterExpression = renderExpression(this.state.expressionBuilder, update.filters);\n filterExpressionChanged = update.filterExpression !== this.state.filterExpression;\n }\n\n super.setState(update);\n\n if (filterExpressionChanged) {\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n }\n }\n\n public getValue(): VariableValue | undefined {\n return this.state.filterExpression;\n }\n\n public _updateFilter(\n filter: AdHocFilterWithLabels,\n update: Partial<AdHocFilterWithLabels>\n ) {\n const { filters, _wip } = this.state;\n\n if (filter === _wip) {\n // If we set value we are done with this \"work in progress\" filter and we can add it\n if ('value' in update && update['value'] !== '') {\n this.setState({ filters: [...filters, { ..._wip, ...update }], _wip: undefined });\n } else {\n this.setState({ _wip: { ...filter, ...update } });\n }\n return;\n }\n\n const updatedFilters = this.state.filters.map((f) => {\n return f === filter ? { ...f, ...update } : f;\n });\n\n this.setState({ filters: updatedFilters });\n }\n\n public _removeFilter(filter: AdHocFilterWithLabels) {\n if (filter === this.state._wip) {\n this.setState({ _wip: undefined });\n return;\n }\n\n this.setState({ filters: this.state.filters.filter((f) => f !== filter) });\n }\n\n /**\n * Get possible keys given current filters. Do not call from plugins directly\n */\n public async _getKeys(currentKey: string | null): Promise<Array<SelectableValue<string>>> {\n const override = await this.state.getTagKeysProvider?.(this, currentKey);\n\n if (override && override.replace) {\n return dataFromResponse(override.values).map(toSelectableValue);\n }\n\n if (this.state.defaultKeys) {\n return this.state.defaultKeys.map(toSelectableValue);\n }\n\n const ds = await this._dataSourceSrv.get(this.state.datasource, this._scopedVars);\n if (!ds || !ds.getTagKeys) {\n return [];\n }\n\n const otherFilters = this.state.filters.filter((f) => f.key !== currentKey).concat(this.state.baseFilters ?? []);\n const timeRange = sceneGraph.getTimeRange(this).state.value;\n const queries = this.state.useQueriesAsFilterForOptions ? getQueriesForVariables(this) : undefined;\n const response = await ds.getTagKeys({\n filters: otherFilters,\n queries,\n timeRange,\n ...getEnrichedFiltersRequest(this),\n });\n\n if (responseHasError(response)) {\n // @ts-expect-error Remove when 11.1.x is released\n this.setState({ error: response.error.message });\n }\n\n let keys = dataFromResponse(response);\n if (override) {\n keys = keys.concat(dataFromResponse(override.values));\n }\n\n const tagKeyRegexFilter = this.state.tagKeyRegexFilter;\n if (tagKeyRegexFilter) {\n // @ts-expect-error Remove when 11.1.x is released\n keys = keys.filter((f) => f.text.match(tagKeyRegexFilter));\n }\n\n return keys.map(toSelectableValue);\n }\n\n /**\n * Get possible key values for a specific key given current filters. Do not call from plugins directly\n */\n public async _getValuesFor(filter: AdHocFilterWithLabels): Promise<Array<SelectableValue<string>>> {\n const override = await this.state.getTagValuesProvider?.(this, filter);\n\n if (override && override.replace) {\n return dataFromResponse(override.values).map(toSelectableValue);\n }\n\n const ds = await this._dataSourceSrv.get(this.state.datasource, this._scopedVars);\n\n if (!ds || !ds.getTagValues) {\n return [];\n }\n\n // Filter out the current filter key from the list of all filters\n const otherFilters = this.state.filters.filter((f) => f.key !== filter.key).concat(this.state.baseFilters ?? []);\n\n const timeRange = sceneGraph.getTimeRange(this).state.value;\n const queries = this.state.useQueriesAsFilterForOptions ? getQueriesForVariables(this) : undefined;\n\n const response = await ds.getTagValues({\n key: filter.key,\n filters: otherFilters,\n timeRange, // @ts-expect-error TODO: remove this once 11.1.x is released\n queries,\n ...getEnrichedFiltersRequest(this),\n });\n\n if (responseHasError(response)) {\n // @ts-expect-error Remove when 11.1.x is released\n this.setState({ error: response.error.message });\n }\n\n let values = dataFromResponse(response);\n if (override) {\n values = values.concat(dataFromResponse(override.values));\n }\n\n return values.map(toSelectableValue);\n }\n\n public _addWip() {\n this.setState({\n _wip: { key: '', value: '', operator: '=', condition: '' },\n });\n }\n\n public _getOperators() {\n const filteredOperators = this.state.supportsMultiValueOperators ? OPERATORS : OPERATORS.filter((operator) => !operator.isMulti);\n return filteredOperators.map<SelectableValue<string>>(({ value, description }) => ({\n label: value,\n value,\n description,\n }));\n }\n}\n\nfunction renderExpression(\n builder: AdHocVariableExpressionBuilderFn | undefined,\n filters: AdHocFilterWithLabels[] | undefined\n) {\n return (builder ?? renderPrometheusLabelFilters)(filters ?? []);\n}\n\nexport function AdHocFiltersVariableRenderer({ model }: SceneComponentProps<AdHocFiltersVariable>) {\n const { filters, readOnly, addFilterButtonText } = model.useState();\n const styles = useStyles2(getStyles);\n\n return (\n <div className={styles.wrapper}>\n {filters.map((filter, index) => (\n <React.Fragment key={index}>\n <AdHocFilterRenderer filter={filter} model={model} />\n </React.Fragment>\n ))}\n\n {!readOnly && <AdHocFilterBuilder model={model} key=\"'builder\" addFilterButtonText={addFilterButtonText} />}\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n wrapper: css({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'flex-end',\n columnGap: theme.spacing(2),\n rowGap: theme.spacing(1),\n }),\n filterIcon: css({\n color: theme.colors.text.secondary,\n paddingRight: theme.spacing(0.5),\n }),\n});\n\nexport function toSelectableValue(input: MetricFindValue): SelectableValue<string> {\n const { text, value } = input;\n const result: SelectableValue<string> = {\n label: text,\n value: String(value ?? text),\n };\n\n if ('group' in input) {\n result.group = input.group;\n }\n\n return result;\n}\n\nexport function isFilterComplete(filter: AdHocFilterWithLabels): boolean {\n return filter.key !== '' && filter.operator !== '' && filter.value !== '';\n}\n\nexport function isMultiValueOperator(operatorValue: string): boolean {\n const operator = OPERATORS.find((o) => o.value === operatorValue);\n if (!operator) {\n throw new Error('Unknown operator');\n }\n return Boolean(operator.isMulti);\n}\n","import { filter, finalize, map, merge, mergeAll } from 'rxjs';\nimport { CancelActivationHandler, SceneDataLayerProvider, SceneDataProviderResult } from '../core/types';\n\nexport class DataLayersMerger {\n private _resultsMap: Map<string, SceneDataProviderResult> = new Map();\n private _prevLayers: SceneDataLayerProvider[] = [];\n\n public getMergedStream(layers: SceneDataLayerProvider[]) {\n if (areDifferentLayers(layers, this._prevLayers)) {\n this._resultsMap = new Map();\n this._prevLayers = layers;\n }\n\n const resultStreams = layers.map((l) => l.getResultsStream());\n const deactivationHandlers: CancelActivationHandler[] = [];\n\n for (const layer of layers) {\n deactivationHandlers.push(layer.activate());\n }\n\n return merge(resultStreams).pipe(\n mergeAll(),\n filter((v) => {\n return this._resultsMap.get(v.origin.state.key!) !== v;\n }),\n map((v) => {\n // Is there a better, rxjs only way to combine multiple same-data-topic observables?\n // Indexing by origin state key is to make sure we do not duplicate/overwrite data from the different origins\n this._resultsMap.set(v.origin.state.key!, v);\n return this._resultsMap.values();\n }),\n finalize(() => {\n deactivationHandlers.forEach((handler) => handler());\n })\n );\n }\n}\n\nfunction areDifferentLayers(a: SceneDataLayerProvider[], b: SceneDataLayerProvider[]) {\n if (a.length !== b.length) {\n return true;\n }\n\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return true;\n }\n }\n\n return false;\n}\n","import { cloneDeep, isEqual } from 'lodash';\nimport { forkJoin, ReplaySubject, Unsubscribable } from 'rxjs';\n\nimport { DataQuery, DataSourceRef, LoadingState } from '@grafana/schema';\n\nimport {\n AlertStateInfo,\n DataFrame,\n DataFrameView,\n DataQueryRequest,\n DataSourceApi,\n DataTopic,\n PanelData,\n preProcessPanelData,\n rangeUtil,\n} from '@grafana/data';\n\n// TODO: Remove this ignore annotation when the grafana runtime dependency has been updated\n// @ts-ignore\nimport { getRunRequest, toDataQueryError, isExpressionReference, config } from '@grafana/runtime';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport {\n DataLayerFilter,\n SceneDataProvider,\n SceneDataProviderResult,\n SceneDataQuery,\n SceneObjectState,\n SceneTimeRangeLike,\n} from '../core/types';\nimport { getDataSource } from '../utils/getDataSource';\nimport { VariableDependencyConfig } from '../variables/VariableDependencyConfig';\nimport { writeSceneLog } from '../utils/writeSceneLog';\nimport { VariableValueRecorder } from '../variables/VariableValueRecorder';\nimport { emptyPanelData } from '../core/SceneDataNode';\nimport { getClosest } from '../core/sceneGraph/utils';\nimport { isExtraQueryProvider, ExtraQueryDataProcessor, ExtraQueryProvider } from './ExtraQueryProvider';\nimport { passthroughProcessor, extraQueryProcessingOperator } from './extraQueryProcessingOperator';\nimport { filterAnnotations } from './layers/annotations/filterAnnotations';\nimport { getEnrichedDataRequest } from './getEnrichedDataRequest';\nimport { findActiveAdHocFilterVariableByUid } from '../variables/adhoc/patchGetAdhocFilters';\nimport { registerQueryWithController } from './registerQueryWithController';\nimport { findActiveGroupByVariablesByUid } from '../variables/groupby/findActiveGroupByVariablesByUid';\nimport { GroupByVariable } from '../variables/groupby/GroupByVariable';\nimport { AdHocFiltersVariable, isFilterComplete } from '../variables/adhoc/AdHocFiltersVariable';\nimport { SceneVariable } from '../variables/types';\nimport { DataLayersMerger } from './DataLayersMerger';\nimport { interpolate } from '../core/sceneGraph/sceneGraph';\nimport { wrapInSafeSerializableSceneObject } from '../utils/wrapInSafeSerializableSceneObject';\n\nlet counter = 100;\n\nexport function getNextRequestId() {\n return 'SQR' + counter++;\n}\n\nexport interface QueryRunnerState extends SceneObjectState {\n data?: PanelData;\n queries: SceneDataQuery[];\n datasource?: DataSourceRef;\n minInterval?: string;\n maxDataPoints?: number;\n liveStreaming?: boolean;\n maxDataPointsFromWidth?: boolean;\n cacheTimeout?: DataQueryRequest['cacheTimeout'];\n queryCachingTTL?: DataQueryRequest['queryCachingTTL'];\n /**\n * When set to auto (the default) query runner will issue queries on activate (when variable dependencies are ready) or when time range change.\n * Set to manual to have full manual control over when queries are issued. Try not to set this. This is mainly useful for unit tests, or special edge case workflows.\n */\n runQueriesMode?: 'auto' | 'manual';\n // Filters to be applied to data layer results before combining them with SQR results\n dataLayerFilter?: DataLayerFilter;\n // Private runtime state\n _hasFetchedData?: boolean;\n}\n\nexport interface DataQueryExtended extends DataQuery {\n [key: string]: any;\n\n // Opt this query out of time window comparison\n timeRangeCompare?: boolean;\n}\n\n// The requests that will be run by the query runner.\n//\n// Generally the query runner will run a single primary request.\n// If the scene graph contains implementations of\n// `ExtraQueryProvider`, the requests created by these\n// implementations will be added to the list of secondary requests,\n// and these will be executed at the same time as the primary request.\n//\n// The results of each secondary request will be passed to an associated\n// processor function (along with the results of the primary request),\n// which can transform the results as desired.\ninterface PreparedRequests {\n // The primary request to run.\n primary: DataQueryRequest;\n // A possibly empty list of secondary requests to run alongside\n // the primary request.\n secondaries: DataQueryRequest[];\n // A map from `requestId` of secondary requests to processors\n // for those requests. Provided by the `ExtraQueryProvider`.\n processors: Map<string, ExtraQueryDataProcessor>;\n}\n\nexport class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> implements SceneDataProvider {\n private _querySub?: Unsubscribable;\n private _dataLayersSub?: Unsubscribable;\n private _dataLayersMerger = new DataLayersMerger();\n private _timeSub?: Unsubscribable;\n private _timeSubRange?: SceneTimeRangeLike;\n private _containerWidth?: number;\n private _variableValueRecorder = new VariableValueRecorder();\n private _results = new ReplaySubject<SceneDataProviderResult>(1);\n private _scopedVars = { __sceneObject: wrapInSafeSerializableSceneObject(this) };\n private _layerAnnotations?: DataFrame[];\n private _resultAnnotations?: DataFrame[];\n\n private _adhocFiltersVar?: AdHocFiltersVariable;\n private _groupByVar?: GroupByVariable;\n\n public getResultsStream() {\n return this._results;\n }\n\n protected _variableDependency: VariableDependencyConfig<QueryRunnerState> = new VariableDependencyConfig(this, {\n statePaths: ['queries', 'datasource'],\n onVariableUpdateCompleted: this.onVariableUpdatesCompleted.bind(this),\n onAnyVariableChanged: this.onAnyVariableChanged.bind(this),\n });\n\n public constructor(initialState: QueryRunnerState) {\n super(initialState);\n\n this.addActivationHandler(() => this._onActivate());\n }\n\n private _onActivate() {\n if (this.isQueryModeAuto()) {\n const timeRange = sceneGraph.getTimeRange(this);\n\n // Add subscriptions to any extra providers so that they rerun queries\n // when their state changes and they should rerun.\n const providers = this.getClosestExtraQueryProviders();\n for (const provider of providers) {\n this._subs.add(\n provider.subscribeToState((n, p) => {\n if (provider.shouldRerun(p, n, this.state.queries)) {\n this.runQueries();\n }\n }),\n );\n }\n\n this.subscribeToTimeRangeChanges(\n timeRange,\n );\n\n if (this.shouldRunQueriesOnActivate()) {\n this.runQueries();\n }\n }\n\n if (!this._dataLayersSub) {\n this._handleDataLayers();\n }\n\n return () => this._onDeactivate();\n }\n\n // This method subscribes to all SceneDataLayers up until the root, and combines the results into data provided from SceneQueryRunner\n private _handleDataLayers() {\n const dataLayers = sceneGraph.getDataLayers(this);\n\n if (dataLayers.length === 0) {\n return;\n }\n\n this._dataLayersSub = this._dataLayersMerger\n .getMergedStream(dataLayers)\n .subscribe(this._onLayersReceived.bind(this));\n }\n\n private _onLayersReceived(results: Iterable<SceneDataProviderResult>) {\n const timeRange = sceneGraph.getTimeRange(this);\n const { dataLayerFilter } = this.state;\n\n let annotations: DataFrame[] = [];\n let alertStates: DataFrame[] = [];\n let alertState: AlertStateInfo | undefined;\n\n for (const result of results) {\n for (let frame of result.data.series) {\n if (frame.meta?.dataTopic === DataTopic.Annotations) {\n annotations = annotations.concat(frame);\n }\n if (frame.meta?.dataTopic === DataTopic.AlertStates) {\n alertStates = alertStates.concat(frame);\n }\n }\n }\n\n if (dataLayerFilter?.panelId) {\n if (annotations.length > 0) {\n annotations = filterAnnotations(annotations, dataLayerFilter);\n }\n\n if (alertStates.length > 0) {\n for (const frame of alertStates) {\n const frameView = new DataFrameView<AlertStateInfo>(frame);\n\n for (const row of frameView) {\n if (row.panelId === dataLayerFilter.panelId) {\n alertState = row;\n break;\n }\n }\n }\n }\n }\n\n // Skip unnessary state updates\n if (\n allFramesEmpty(annotations) &&\n allFramesEmpty(this._layerAnnotations) &&\n isEqual(alertState, this.state.data?.alertState)\n ) {\n return;\n }\n\n this._layerAnnotations = annotations;\n\n const baseStateUpdate = this.state.data ? this.state.data : { ...emptyPanelData, timeRange: timeRange.state.value };\n\n this.setState({\n data: {\n ...baseStateUpdate,\n annotations: [...(this._resultAnnotations ?? []), ...annotations],\n alertState: alertState ?? this.state.data?.alertState,\n },\n });\n }\n\n /**\n * This tries to start a new query whenever a variable completes or is changed.\n *\n * We care about variable update completions even when the variable has not changed and even when it is not a direct dependency.\n * Example: Variables A and B (B depends on A). A update depends on time range. So when time change query runner will\n * find that variable A is loading which is a dependency on of variable B so will set _isWaitingForVariables to true and\n * not issue any query.\n *\n * When A completes it's loading (with no value change, so B never updates) it will cause a call of this function letting\n * the query runner know that A has completed, and in case _isWaitingForVariables we try to run the query. The query will\n * only run if all variables are in a non loading state so in other scenarios where a query depends on many variables this will\n * be called many times until all dependencies are in a non loading state. *\n */\n private onVariableUpdatesCompleted() {\n if(this.isQueryModeAuto()){\n this.runQueries();\n }\n }\n\n /**\n * Check if value changed is a adhoc filter o group by variable that did not exist when we issued the last query\n */\n private onAnyVariableChanged(variable: SceneVariable) {\n // If this variable has already been detected this variable as a dependency onVariableUpdatesCompleted above will handle value changes\n if (this._adhocFiltersVar === variable || this._groupByVar === variable || !this.isQueryModeAuto()) {\n return;\n }\n\n if (variable instanceof AdHocFiltersVariable && this._isRelevantAutoVariable(variable)) {\n this.runQueries();\n }\n\n if (variable instanceof GroupByVariable && this._isRelevantAutoVariable(variable)) {\n this.runQueries();\n }\n }\n\n private _isRelevantAutoVariable(variable: AdHocFiltersVariable | GroupByVariable) {\n const datasource = this.state.datasource ?? findFirstDatasource(this.state.queries);\n return variable.state.applyMode === 'auto' && datasource?.uid === variable.state.datasource?.uid;\n }\n\n private shouldRunQueriesOnActivate() {\n if (this._variableValueRecorder.hasDependenciesChanged(this)) {\n writeSceneLog(\n 'SceneQueryRunner',\n 'Variable dependency changed while inactive, shouldRunQueriesOnActivate returns true'\n );\n return true;\n }\n\n // If we don't have any data we should run queries\n if (!this.state.data) {\n return true;\n }\n\n // If time range is stale / different we should run queries\n if (this._isDataTimeRangeStale(this.state.data)) {\n return true;\n }\n\n return false;\n }\n\n private _isDataTimeRangeStale(data: PanelData) {\n const timeRange = sceneGraph.getTimeRange(this);\n\n const stateTimeRange = timeRange.state.value;\n const dataTimeRange = data.timeRange;\n\n if (\n stateTimeRange.from.unix() === dataTimeRange.from.unix() &&\n stateTimeRange.to.unix() === dataTimeRange.to.unix()\n ) {\n return false;\n }\n writeSceneLog('SceneQueryRunner', 'Data time range is stale');\n return true;\n }\n\n private _onDeactivate(): void {\n if (this._querySub) {\n this._querySub.unsubscribe();\n this._querySub = undefined;\n }\n\n if (this._dataLayersSub) {\n this._dataLayersSub.unsubscribe();\n this._dataLayersSub = undefined;\n }\n\n this._timeSub?.unsubscribe();\n this._timeSub = undefined;\n this._timeSubRange = undefined;\n this._adhocFiltersVar = undefined;\n this._groupByVar = undefined;\n this._variableValueRecorder.recordCurrentDependencyValuesForSceneObject(this);\n }\n\n public setContainerWidth(width: number) {\n // If we don't have a width we should run queries\n if (!this._containerWidth && width > 0) {\n this._containerWidth = width;\n\n // If we don't have maxDataPoints specifically set and maxDataPointsFromWidth is true\n if (this.state.maxDataPointsFromWidth && !this.state.maxDataPoints) {\n // As this is called from render path we need to wait for next tick before running queries\n setTimeout(() => {\n if (this.isActive && !this.state._hasFetchedData) {\n this.runQueries();\n }\n }, 0);\n }\n } else {\n // if the updated container width is bigger than 0 let's remember the width until next query issue\n if (width > 0) {\n this._containerWidth = width;\n }\n }\n }\n\n public isDataReadyToDisplay() {\n return Boolean(this.state._hasFetchedData);\n }\n\n private subscribeToTimeRangeChanges(timeRange: SceneTimeRangeLike) {\n if (this._timeSubRange === timeRange) {\n // Nothing to do, already subscribed\n return;\n }\n\n if (this._timeSub) {\n this._timeSub.unsubscribe();\n }\n\n this._timeSubRange = timeRange;\n this._timeSub = timeRange.subscribeToState(() => {\n this.runWithTimeRange(timeRange);\n });\n }\n\n public runQueries() {\n const timeRange = sceneGraph.getTimeRange(this);\n if(this.isQueryModeAuto()){\n this.subscribeToTimeRangeChanges(timeRange);\n }\n\n this.runWithTimeRange(timeRange);\n }\n\n private getMaxDataPoints() {\n if (this.state.maxDataPoints) {\n return this.state.maxDataPoints;\n }\n\n return this.state.maxDataPointsFromWidth ? this._containerWidth ?? 500 : 500;\n }\n\n public cancelQuery() {\n this._querySub?.unsubscribe();\n\n if (this._dataLayersSub) {\n this._dataLayersSub.unsubscribe();\n this._dataLayersSub = undefined;\n }\n\n this.setState({\n data: { ...this.state.data!, state: LoadingState.Done },\n });\n }\n\n private async runWithTimeRange(timeRange: SceneTimeRangeLike) {\n // If no maxDataPoints specified we might need to wait for container width to be set from the outside\n if (!this.state.maxDataPoints && this.state.maxDataPointsFromWidth && !this._containerWidth) {\n return;\n }\n\n // If data layers subscription doesn't exist, create one\n if (!this._dataLayersSub) {\n this._handleDataLayers();\n }\n\n // Cancel any running queries\n this._querySub?.unsubscribe();\n\n // Skip executing queries if variable dependency is in loading state\n if (this._variableDependency.hasDependencyInLoadingState()) {\n writeSceneLog('SceneQueryRunner', 'Variable dependency is in loading state, skipping query execution');\n this.setState({ data: { ...(this.state.data ?? emptyPanelData), state: LoadingState.Loading } });\n return;\n }\n\n const { queries } = this.state;\n\n // Simple path when no queries exist\n if (!queries?.length) {\n this._setNoDataState();\n return;\n }\n\n try {\n const datasource = this.state.datasource ?? findFirstDatasource(queries);\n const ds = await getDataSource(datasource, this._scopedVars);\n\n this.findAndSubscribeToAdHocFilters(datasource?.uid);\n\n const runRequest = getRunRequest();\n const { primary, secondaries, processors } = this.prepareRequests(timeRange, ds);\n\n writeSceneLog('SceneQueryRunner', 'Starting runRequest', this.state.key);\n\n let stream = runRequest(ds, primary);\n\n if (secondaries.length > 0) {\n // Submit all secondary requests in parallel.\n const secondaryStreams = secondaries.map((r) => runRequest(ds, r));\n // Create the rxjs operator which will combine the primary and secondary responses\n // by calling the correct processor functions provided by the\n // extra request providers.\n const op = extraQueryProcessingOperator(processors);\n // Combine the primary and secondary streams into a single stream, and apply the operator.\n stream = forkJoin([stream, ...secondaryStreams]).pipe(op);\n }\n\n stream = stream.pipe(\n registerQueryWithController({\n type: 'data',\n request: primary,\n origin: this,\n cancel: () => this.cancelQuery(),\n })\n );\n\n this._querySub = stream.subscribe(this.onDataReceived);\n } catch (err) {\n console.error('PanelQueryRunner Error', err);\n\n this.onDataReceived({\n ...emptyPanelData,\n ...this.state.data,\n state: LoadingState.Error,\n errors: [toDataQueryError(err)],\n });\n }\n }\n\n public clone(withState?: Partial<QueryRunnerState>) {\n const clone = super.clone(withState);\n\n if (this._resultAnnotations) {\n clone['_resultAnnotations'] = this._resultAnnotations.map((frame) => ({ ...frame }));\n }\n\n if (this._layerAnnotations) {\n clone['_layerAnnotations'] = this._layerAnnotations.map((frame) => ({ ...frame }));\n }\n\n clone['_variableValueRecorder'] = this._variableValueRecorder.cloneAndRecordCurrentValuesForSceneObject(this);\n clone['_containerWidth'] = this._containerWidth;\n clone['_results'].next({ origin: this, data: this.state.data ?? emptyPanelData });\n\n return clone;\n }\n\n private prepareRequests(timeRange: SceneTimeRangeLike, ds: DataSourceApi): PreparedRequests {\n const { minInterval, queries } = this.state;\n\n let request: DataQueryRequest<DataQueryExtended> = {\n app: 'scenes',\n requestId: getNextRequestId(),\n timezone: timeRange.getTimeZone(),\n range: timeRange.state.value,\n interval: '1s',\n intervalMs: 1000,\n targets: cloneDeep(queries),\n maxDataPoints: this.getMaxDataPoints(),\n scopedVars: this._scopedVars,\n startTime: Date.now(),\n liveStreaming: this.state.liveStreaming,\n rangeRaw: {\n from: timeRange.state.from,\n to: timeRange.state.to,\n },\n cacheTimeout: this.state.cacheTimeout,\n queryCachingTTL: this.state.queryCachingTTL,\n // This asks the scene root to provide context properties like app, panel and dashboardUID\n ...getEnrichedDataRequest(this),\n };\n\n if (this._adhocFiltersVar) {\n // only pass filters that have both key and value\n // @ts-ignore (Temporary ignore until we update @grafana/data)\n request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);\n }\n\n if (this._groupByVar) {\n // @ts-ignore (Temporary ignore until we update @grafana/data)\n request.groupByKeys = this._groupByVar.state.value;\n }\n\n request.targets = request.targets.map((query) => {\n if (\n !query.datasource ||\n (query.datasource.uid !== ds.uid &&\n !ds.meta?.mixed &&\n isExpressionReference /* TODO: Remove this check when isExpressionReference is properly exported from grafan runtime */ &&\n !isExpressionReference(query.datasource))\n ) {\n query.datasource = ds.getRef();\n }\n return query;\n });\n\n const lowerIntervalLimit = minInterval ? interpolate(this, minInterval) : ds.interval;\n const norm = rangeUtil.calculateInterval(timeRange.state.value, request.maxDataPoints!, lowerIntervalLimit);\n\n // make shallow copy of scoped vars,\n // and add built in variables interval and interval_ms\n request.scopedVars = Object.assign({}, request.scopedVars, {\n __interval: { text: norm.interval, value: norm.interval },\n __interval_ms: { text: norm.intervalMs.toString(), value: norm.intervalMs },\n });\n\n request.interval = norm.interval;\n request.intervalMs = norm.intervalMs;\n\n // If there are any extra request providers, we need to add a new request for each\n // and map the request's ID to the processor function given by the provider, to ensure that\n // the processor is called with the correct response data.\n const primaryTimeRange = timeRange.state.value;\n let secondaryRequests: DataQueryRequest[] = [];\n let secondaryProcessors = new Map();\n for (const provider of this.getClosestExtraQueryProviders() ?? []) {\n for (const { req, processor } of provider.getExtraQueries(request)) {\n const requestId = getNextRequestId();\n secondaryRequests.push({ ...req, requestId });\n secondaryProcessors.set(requestId, processor ?? passthroughProcessor);\n }\n }\n request.range = primaryTimeRange;\n return { primary: request, secondaries: secondaryRequests, processors: secondaryProcessors };\n }\n\n private onDataReceived = (data: PanelData) => {\n // Will combine annotations from SQR queries (frames with meta.dataTopic === DataTopic.Annotations)\n const preProcessedData = preProcessPanelData(data, this.state.data);\n\n // Save query annotations\n this._resultAnnotations = data.annotations;\n\n // Will combine annotations & alert state from data layer providers\n const dataWithLayersApplied = this._combineDataLayers(preProcessedData);\n\n let hasFetchedData = this.state._hasFetchedData;\n\n if (!hasFetchedData && preProcessedData.state !== LoadingState.Loading) {\n hasFetchedData = true;\n }\n\n this.setState({ data: dataWithLayersApplied, _hasFetchedData: hasFetchedData });\n this._results.next({ origin: this, data: dataWithLayersApplied });\n };\n\n private _combineDataLayers(data: PanelData) {\n if (this._layerAnnotations && this._layerAnnotations.length > 0) {\n data.annotations = (data.annotations || []).concat(this._layerAnnotations);\n }\n\n if (this.state.data && this.state.data.alertState) {\n data.alertState = this.state.data.alertState;\n }\n\n return data;\n }\n\n private _setNoDataState() {\n if (this.state.data !== emptyPanelData) {\n this.setState({ data: emptyPanelData });\n }\n }\n\n /**\n * Walk up the scene graph and find any ExtraQueryProviders.\n *\n * This will return an array of the closest provider of each type.\n */\n private getClosestExtraQueryProviders(): Array<ExtraQueryProvider<any>> {\n // Maintain a map from provider constructor to provider object. The constructor\n // is used as a unique key for each class, to ensure we have no more than one\n // type of each type of provider.\n const found = new Map();\n if (!this.parent) {\n return [];\n }\n getClosest(this.parent, (s) => {\n if (isExtraQueryProvider(s) && !found.has(s.constructor)) {\n found.set(s.constructor, s);\n }\n s.forEachChild((child) => {\n if (isExtraQueryProvider(child) && !found.has(child.constructor)) {\n found.set(child.constructor, child);\n }\n });\n // Always return null so that the search continues to the top of\n // the scene graph.\n return null;\n });\n return Array.from(found.values());\n }\n\n /**\n * Walk up scene graph and find the closest filterset with matching data source\n */\n private findAndSubscribeToAdHocFilters(uid: string | undefined) {\n const filtersVar = findActiveAdHocFilterVariableByUid(uid);\n\n if (this._adhocFiltersVar !== filtersVar) {\n this._adhocFiltersVar = filtersVar;\n this._updateExplicitVariableDependencies();\n }\n\n const groupByVar = findActiveGroupByVariablesByUid(uid);\n if (this._groupByVar !== groupByVar) {\n this._groupByVar = groupByVar;\n this._updateExplicitVariableDependencies();\n }\n }\n\n private _updateExplicitVariableDependencies() {\n const explicitDependencies: string[] = [];\n\n if (this._adhocFiltersVar) {\n explicitDependencies.push(this._adhocFiltersVar.state.name);\n }\n\n if (this._groupByVar) {\n explicitDependencies.push(this._groupByVar.state.name);\n }\n\n this._variableDependency.setVariableNames(explicitDependencies);\n }\n\n private isQueryModeAuto(): boolean {\n return (this.state.runQueriesMode ?? 'auto') === 'auto'\n }\n}\n\nexport function findFirstDatasource(targets: DataQuery[]): DataSourceRef | undefined {\n return targets.find((t) => t.datasource !== null)?.datasource ?? undefined;\n}\n\nfunction allFramesEmpty(frames?: DataFrame[]) {\n if (!frames) {\n return true;\n }\n\n for (let i = 0; i < frames.length; i++) {\n if (frames[i].length > 0) {\n return false;\n }\n }\n\n return true;\n}\n","import { isEqual } from 'lodash';\nimport { VariableValue } from './types';\n// @ts-expect-error Remove when 11.1.x is released\nimport { AdHocVariableFilter, DataQueryError, GetTagResponse, MetricFindValue, SelectableValue } from '@grafana/data';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneDataQuery, SceneObject, SceneObjectState } from '../core/types';\nimport { SceneQueryRunner } from '../querying/SceneQueryRunner';\nimport { DataSourceRef } from '@grafana/schema';\n\nexport function isVariableValueEqual(a: VariableValue | null | undefined, b: VariableValue | null | undefined) {\n if (a === b) {\n return true;\n }\n\n return isEqual(a, b);\n}\n\nexport function safeStringifyValue(value: unknown) {\n // Avoid circular references ignoring those references\n const getCircularReplacer = () => {\n const seen = new WeakSet();\n return (_: string, value: object | null) => {\n if (typeof value === 'object' && value !== null) {\n if (seen.has(value)) {\n return;\n }\n seen.add(value);\n }\n return value;\n };\n };\n\n try {\n return JSON.stringify(value, getCircularReplacer());\n } catch (error) {\n console.error(error);\n }\n\n return '';\n}\n\nexport function renderPrometheusLabelFilters(filters: AdHocVariableFilter[]) {\n return filters.map((filter) => renderFilter(filter)).join(',');\n}\n\nfunction renderFilter(filter: AdHocVariableFilter) {\n let value = '';\n let operator = filter.operator;\n\n // map \"one of\" operator to regex\n if (operator === '=|') {\n operator = '=~'\n // TODO remove when we're on the latest version of @grafana/data\n // @ts-expect-error\n value = filter.values?.map(escapeLabelValueInRegexSelector).join('|');\n } else if (operator === '!=|') {\n operator = '!~'\n // TODO remove when we're on the latest version of @grafana/data\n // @ts-expect-error\n value = filter.values?.map(escapeLabelValueInRegexSelector).join('|');\n } else if (operator === '=~' || operator === '!~') {\n value = escapeLabelValueInRegexSelector(filter.value);\n } else {\n value = escapeLabelValueInExactSelector(filter.value);\n }\n\n return `${filter.key}${operator}\"${value}\"`;\n}\n\n// based on the openmetrics-documentation, the 3 symbols we have to handle are:\n// - \\n ... the newline character\n// - \\ ... the backslash character\n// - \" ... the double-quote character\nexport function escapeLabelValueInExactSelector(labelValue: string): string {\n return labelValue.replace(/\\\\/g, '\\\\\\\\').replace(/\\n/g, '\\\\n').replace(/\"/g, '\\\\\"');\n}\n\nexport function escapeLabelValueInRegexSelector(labelValue: string): string {\n return escapeLabelValueInExactSelector(escapeLokiRegexp(labelValue));\n}\n\nexport function isRegexSelector(selector?: string) {\n if (selector && (selector.includes('=~') || selector.includes('!~'))) {\n return true;\n }\n return false;\n}\n\n// Loki regular-expressions use the RE2 syntax (https://github.com/google/re2/wiki/Syntax),\n// so every character that matches something in that list has to be escaped.\n// the list of meta characters is: *+?()|\\.[]{}^$\n// we make a javascript regular expression that matches those characters:\nconst RE2_METACHARACTERS = /[*+?()|\\\\.\\[\\]{}^$]/g;\nfunction escapeLokiRegexp(value: string): string {\n return value.replace(RE2_METACHARACTERS, '\\\\$&');\n}\n\n/**\n * Get all queries in the scene that have the same datasource as provided source object\n */\nexport function getQueriesForVariables(\n sourceObject: SceneObject<SceneObjectState & { datasource: DataSourceRef | null }>\n) {\n const runners = sceneGraph.findAllObjects(\n sourceObject.getRoot(),\n (o) => o instanceof SceneQueryRunner\n ) as SceneQueryRunner[];\n\n const applicableRunners = filterOutInactiveRunnerDuplicates(runners).filter((r) => {\n return r.state.datasource?.uid === sourceObject.state.datasource?.uid;\n });\n\n if (applicableRunners.length === 0) {\n return [];\n }\n\n const result: SceneDataQuery[] = [];\n applicableRunners.forEach((r) => {\n result.push(...r.state.queries);\n });\n\n return result;\n}\n\n// Filters out inactive runner duplicates, keeping only the ones that are currently active.\n// This is needed for scnearios whan a query runner is cloned and the original is not removed but de-activated.\n// Can happen i.e. when editing a panel in Grafana Core dashboards.\nfunction filterOutInactiveRunnerDuplicates(runners: SceneQueryRunner[]) {\n // Group items by key\n const groupedItems: { [key: string]: SceneQueryRunner[] } = {};\n\n for (const item of runners) {\n if (item.state.key) {\n if (!(item.state.key in groupedItems)) {\n groupedItems[item.state.key] = [];\n }\n groupedItems[item.state.key].push(item);\n }\n }\n\n // Filter out inactive items and concatenate active items\n return Object.values(groupedItems).flatMap((group) => {\n const activeItems = group.filter((item) => item.isActive);\n // Keep inactive items if there's only one item with the key\n if (activeItems.length === 0 && group.length === 1) {\n return group;\n }\n return activeItems;\n });\n}\n\nexport function escapeUrlPipeDelimiters(value: string | undefined): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n // Replace the pipe due to using it as a filter separator\n return (value = /\\|/g[Symbol.replace](value, '__gfp__'));\n}\n\nexport function escapeUrlCommaDelimiters(value: string | undefined): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n // Replace the comma due to using it as a value/label separator\n return /,/g[Symbol.replace](value, '__gfc__');\n}\n\nexport function unescapeUrlDelimiters(value: string | undefined): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n value = /__gfp__/g[Symbol.replace](value, '|');\n value = /__gfc__/g[Symbol.replace](value, ',');\n\n return value;\n}\n\nexport function toUrlCommaDelimitedString(key: string, label?: string): string {\n // Omit for identical key/label or when label is not set at all\n if (!label || key === label) {\n return escapeUrlCommaDelimiters(key);\n }\n\n return [key, label].map(escapeUrlCommaDelimiters).join(',');\n}\n\nexport function dataFromResponse(response: GetTagResponse | MetricFindValue[]) {\n return Array.isArray(response) ? response : response.data;\n}\n\nexport function responseHasError(response: GetTagResponse | MetricFindValue[]): response is GetTagResponse & { error: DataQueryError } {\n return !Array.isArray(response) && Boolean(response.error);\n}\n\n// Collect a flat list of SelectableValues with a `group` property into a hierarchical list with groups\nexport function handleOptionGroups(values: SelectableValue[]): Array<SelectableValue<string>> {\n const result: Array<SelectableValue<string>> = [];\n const groupedResults = new Map<string, Array<SelectableValue<string>>>();\n\n for (const value of values) {\n const groupLabel = value.group;\n if (groupLabel) {\n let group = groupedResults.get(groupLabel);\n\n if (!group) {\n group = [];\n groupedResults.set(groupLabel, group);\n result.push({ label: groupLabel, options: group });\n }\n\n group.push(value);\n } else {\n result.push(value);\n }\n }\n\n return result;\n}\n","import { DataLinkBuiltInVars } from '@grafana/data';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneObject, SceneObjectState } from '../core/types';\nimport { writeSceneLog } from '../utils/writeSceneLog';\nimport { VARIABLE_REGEX } from './constants';\n\nimport { SceneVariable, SceneVariableDependencyConfigLike } from './types';\nimport { safeStringifyValue } from './utils';\n\ninterface VariableDependencyConfigOptions<TState extends SceneObjectState> {\n /**\n * State paths to scan / extract variable dependencies from. Leave empty to scan all paths.\n */\n statePaths?: Array<keyof TState | '*'>;\n\n /**\n * Explicit list of variable names to depend on. Leave empty to scan state for dependencies.\n */\n variableNames?: string[];\n\n /**\n * Optional way to customize how to handle when a dependent variable changes\n * If not specified the default behavior is to trigger a re-render\n */\n onReferencedVariableValueChanged?: (variable: SceneVariable) => void;\n\n /**\n * Two scenarios trigger this callback to be called.\n * 1. When any direct dependency changed value\n * 2. In case hasDependencyInLoadingState was called and returned true we really care about any variable update. So in this scenario this callback is called\n * after any variable update completes. This is to cover scenarios where an object is waiting for indirect dependencies to complete.\n */\n onVariableUpdateCompleted?: () => void;\n\n /**\n * Optional way to subscribe to all variable value changes, even to variables that are not dependencies.\n */\n onAnyVariableChanged?: (variable: SceneVariable) => void;\n}\n\nexport class VariableDependencyConfig<TState extends SceneObjectState> implements SceneVariableDependencyConfigLike {\n private _state: TState | undefined;\n private _dependencies = new Set<string>();\n private _statePaths?: Array<keyof TState | '*'>;\n private _isWaitingForVariables = false;\n\n public scanCount = 0;\n\n public constructor(\n private _sceneObject: SceneObject<TState>,\n private _options: VariableDependencyConfigOptions<TState>\n ) {\n this._statePaths = _options.statePaths;\n }\n\n /**\n * Used to check for dependency on a specific variable\n */\n public hasDependencyOn(name: string): boolean {\n return this.getNames().has(name);\n }\n\n /**\n * This is called whenever any set of variables have new values. It is up to this implementation to check if it's relevant given the current dependencies.\n */\n public variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean) {\n const deps = this.getNames();\n let dependencyChanged = false;\n\n if ((deps.has(variable.state.name) || deps.has(DataLinkBuiltInVars.includeVars)) && hasChanged) {\n dependencyChanged = true;\n }\n\n writeSceneLog(\n 'VariableDependencyConfig',\n 'variableUpdateCompleted',\n variable.state.name,\n dependencyChanged,\n this._isWaitingForVariables\n );\n\n if (this._options.onAnyVariableChanged) {\n this._options.onAnyVariableChanged(variable);\n }\n\n // If custom handler called when dependency is changed or when we are waiting for variables\n if (this._options.onVariableUpdateCompleted && (this._isWaitingForVariables || dependencyChanged)) {\n this._options.onVariableUpdateCompleted();\n }\n\n if (dependencyChanged) {\n if (this._options.onReferencedVariableValueChanged) {\n this._options.onReferencedVariableValueChanged(variable);\n }\n\n // if no callbacks are specified then just do a forceRender\n if (!this._options.onReferencedVariableValueChanged && !this._options.onVariableUpdateCompleted) {\n this._sceneObject.forceRender();\n }\n }\n }\n\n public hasDependencyInLoadingState() {\n if (sceneGraph.hasVariableDependencyInLoadingState(this._sceneObject)) {\n this._isWaitingForVariables = true;\n return true;\n }\n\n this._isWaitingForVariables = false;\n return false;\n }\n\n public getNames(): Set<string> {\n const prevState = this._state;\n const newState = (this._state = this._sceneObject.state);\n\n if (!prevState) {\n // First time we always scan for dependencies\n this.scanStateForDependencies(this._state);\n return this._dependencies;\n }\n\n // Second time we only scan if state is a different and if any specific state path has changed\n if (newState !== prevState) {\n if (this._statePaths) {\n for (const path of this._statePaths) {\n if (path === '*' || newState[path] !== prevState[path]) {\n this.scanStateForDependencies(newState);\n break;\n }\n }\n } else {\n this.scanStateForDependencies(newState);\n }\n }\n\n return this._dependencies;\n }\n\n /**\n * Update variableNames\n */\n public setVariableNames(varNames: string[]) {\n this._options.variableNames = varNames;\n this.scanStateForDependencies(this._state!);\n }\n\n public setPaths(paths: Array<keyof TState | '*'>) {\n this._statePaths = paths;\n }\n\n private scanStateForDependencies(state: TState) {\n this._dependencies.clear();\n this.scanCount += 1;\n\n if (this._options.variableNames) {\n for (const name of this._options.variableNames) {\n this._dependencies.add(name);\n }\n }\n\n if (this._statePaths) {\n for (const path of this._statePaths) {\n if (path === '*') {\n this.extractVariablesFrom(state);\n break;\n } else {\n const value = state[path];\n if (value) {\n this.extractVariablesFrom(value);\n }\n }\n }\n }\n }\n\n private extractVariablesFrom(value: unknown) {\n VARIABLE_REGEX.lastIndex = 0;\n\n const stringToCheck = typeof value !== 'string' ? safeStringifyValue(value) : value;\n\n const matches = stringToCheck.matchAll(VARIABLE_REGEX);\n if (!matches) {\n return;\n }\n\n for (const match of matches) {\n const [, var1, var2, , var3] = match;\n const variableName = var1 || var2 || var3;\n this._dependencies.add(variableName);\n }\n }\n}\n","import {\n DataQuery,\n DataSourceJsonData,\n DataSourceApi,\n MetricFindValue,\n VariableSupportType,\n StandardVariableQuery,\n DataQueryRequest,\n DataQueryResponse,\n QueryEditorProps,\n} from '@grafana/data';\nimport { TemplateSrv } from '@grafana/runtime';\nimport { ComponentType } from 'react';\n\nimport { Observable } from 'rxjs';\n\n/**\n * Interfaces and guards below are copied from core.\n * Not exposing via grafana/data as these are not intended to be used in context other than variables.\n */\n\ninterface DataSourceWithLegacyVariableSupport<\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n> extends DataSourceApi<TQuery, TOptions> {\n metricFindQuery(query: any, options?: any): Promise<MetricFindValue[]>;\n variables: undefined;\n}\n\ninterface DataSourceWithStandardVariableSupport<\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n> extends DataSourceApi<TQuery, TOptions> {\n variables: {\n getType(): VariableSupportType;\n toDataQuery(query: StandardVariableQuery): TQuery;\n query(request: DataQueryRequest<TQuery>): Observable<DataQueryResponse>;\n };\n}\n\ninterface DataSourceWithCustomVariableSupport<\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n> extends DataSourceApi<TQuery, TOptions> {\n variables: {\n getType(): VariableSupportType;\n editor: VariableQueryEditorType;\n query(request: DataQueryRequest<TQuery>): Observable<DataQueryResponse>;\n };\n}\n\ninterface VariableQueryEditorProps {\n query: any;\n onChange: (query: any, definition: string) => void;\n datasource: any;\n templateSrv: TemplateSrv;\n}\n\ntype VariableQueryEditorType<\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n> = ComponentType<VariableQueryEditorProps> | ComponentType<QueryEditorProps<any, TQuery, TOptions, any>> | null;\n\nexport const hasLegacyVariableSupport = <\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n>(\n datasource: DataSourceApi<TQuery, TOptions>\n): datasource is DataSourceWithLegacyVariableSupport<TQuery, TOptions> => {\n return Boolean(datasource.metricFindQuery) && !Boolean(datasource.variables);\n};\n\nexport const hasStandardVariableSupport = <\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n>(\n datasource: DataSourceApi<TQuery, TOptions>\n): datasource is DataSourceWithStandardVariableSupport<TQuery, TOptions> => {\n if (!datasource.variables) {\n return false;\n }\n\n if (datasource.variables.getType() !== VariableSupportType.Standard) {\n return false;\n }\n\n const variableSupport = datasource.variables;\n return 'toDataQuery' in variableSupport && Boolean(variableSupport.toDataQuery);\n};\n\nexport const hasCustomVariableSupport = <\n TQuery extends DataQuery = DataQuery,\n TOptions extends DataSourceJsonData = DataSourceJsonData\n>(\n datasource: DataSourceApi<TQuery, TOptions>\n): datasource is DataSourceWithCustomVariableSupport<TQuery, TOptions> => {\n if (!datasource.variables) {\n return false;\n }\n\n if (datasource.variables.getType() !== VariableSupportType.Custom) {\n return false;\n }\n\n const variableSupport = datasource.variables;\n return (\n 'query' in variableSupport &&\n 'editor' in variableSupport &&\n Boolean(variableSupport.query) &&\n Boolean(variableSupport.editor)\n );\n};\n","import { from, mergeMap, Observable, of } from 'rxjs';\n\nimport {\n DataQueryRequest,\n DataSourceApi,\n getDefaultTimeRange,\n LoadingState,\n PanelData,\n StandardVariableQuery,\n} from '@grafana/data';\nimport { getRunRequest } from '@grafana/runtime';\n\nimport { hasCustomVariableSupport, hasLegacyVariableSupport, hasStandardVariableSupport } from './guards';\n\nimport { QueryVariable } from './QueryVariable';\nimport { DataQuery } from '@grafana/schema';\n\nexport interface RunnerArgs {\n searchFilter?: string;\n variable: QueryVariable;\n}\n\nexport interface QueryRunner {\n getTarget: (variable: QueryVariable) => DataQuery | string;\n runRequest: (args: RunnerArgs, request: DataQueryRequest) => Observable<PanelData>;\n}\n\nclass StandardQueryRunner implements QueryRunner {\n public constructor(private datasource: DataSourceApi, private _runRequest = getRunRequest()) {}\n\n public getTarget(variable: QueryVariable) {\n if (hasStandardVariableSupport(this.datasource)) {\n return this.datasource.variables.toDataQuery(ensureVariableQueryModelIsADataQuery(variable));\n }\n\n throw new Error(\"Couldn't create a target with supplied arguments.\");\n }\n\n public runRequest(_: RunnerArgs, request: DataQueryRequest) {\n if (!hasStandardVariableSupport(this.datasource)) {\n return getEmptyMetricFindValueObservable();\n }\n\n if (!this.datasource.variables.query) {\n return this._runRequest(this.datasource, request);\n }\n\n return this._runRequest(this.datasource, request, this.datasource.variables.query.bind(this.datasource.variables));\n }\n}\n\nclass LegacyQueryRunner implements QueryRunner {\n public constructor(private datasource: DataSourceApi) {}\n\n public getTarget(variable: QueryVariable) {\n if (hasLegacyVariableSupport(this.datasource)) {\n return variable.state.query;\n }\n\n throw new Error(\"Couldn't create a target with supplied arguments.\");\n }\n\n public runRequest({ variable, searchFilter }: RunnerArgs, request: DataQueryRequest) {\n if (!hasLegacyVariableSupport(this.datasource)) {\n return getEmptyMetricFindValueObservable();\n }\n\n return from(\n this.datasource.metricFindQuery(variable.state.query, {\n ...request,\n // variable is used by SQL common data source\n variable: {\n name: variable.state.name,\n type: variable.state.type,\n },\n searchFilter,\n })\n ).pipe(\n mergeMap((values) => {\n if (!values || !values.length) {\n return getEmptyMetricFindValueObservable();\n }\n\n const series: any = values;\n return of({ series, state: LoadingState.Done, timeRange: request.range });\n })\n );\n }\n}\n\nclass CustomQueryRunner implements QueryRunner {\n public constructor(private datasource: DataSourceApi, private _runRequest = getRunRequest()) {}\n\n public getTarget(variable: QueryVariable) {\n if (hasCustomVariableSupport(this.datasource)) {\n return variable.state.query;\n }\n\n throw new Error(\"Couldn't create a target with supplied arguments.\");\n }\n\n public runRequest(_: RunnerArgs, request: DataQueryRequest) {\n if (!hasCustomVariableSupport(this.datasource)) {\n return getEmptyMetricFindValueObservable();\n }\n\n if (!this.datasource.variables.query) {\n return this._runRequest(this.datasource, request);\n }\n return this._runRequest(this.datasource, request, this.datasource.variables.query.bind(this.datasource.variables));\n }\n}\n\nfunction getEmptyMetricFindValueObservable(): Observable<PanelData> {\n return of({ state: LoadingState.Done, series: [], timeRange: getDefaultTimeRange() });\n}\n\nfunction createQueryVariableRunnerFactory(datasource: DataSourceApi): QueryRunner {\n if (hasStandardVariableSupport(datasource)) {\n return new StandardQueryRunner(datasource, getRunRequest());\n }\n\n if (hasLegacyVariableSupport(datasource)) {\n return new LegacyQueryRunner(datasource);\n }\n\n if (hasCustomVariableSupport(datasource)) {\n return new CustomQueryRunner(datasource);\n }\n\n throw new Error(`Couldn't create a query runner for datasource ${datasource.type}`);\n}\n\nexport let createQueryVariableRunner = createQueryVariableRunnerFactory;\n\n/**\n * Use only in tests\n */\nexport function setCreateQueryVariableRunnerFactory(fn: (datasource: DataSourceApi) => QueryRunner) {\n createQueryVariableRunner = fn;\n}\n\n/**\n * Fixes old legacy query string models and adds refId if missing\n */\nfunction ensureVariableQueryModelIsADataQuery(variable: QueryVariable): StandardVariableQuery {\n const query = variable.state.query ?? '';\n\n // Turn into query object if it's just a string\n if (typeof query === 'string') {\n return { query, refId: `variable-${variable.state.name}` };\n }\n\n // Add potentially missing refId\n if (query.refId == null) {\n return { ...query, refId: `variable-${variable.state.name}` } as StandardVariableQuery;\n }\n\n return variable.state.query as StandardVariableQuery;\n}\n","import { isNumber, sortBy, toLower, uniqBy } from 'lodash';\n\nimport { stringToJsRegex, VariableSort } from '@grafana/data';\n\nimport { VariableValueOption } from '../../types';\n\nexport const metricNamesToVariableValues = (variableRegEx: string, sort: VariableSort, metricNames: any[]) => {\n let regex;\n let options: VariableValueOption[] = [];\n\n if (variableRegEx) {\n regex = stringToJsRegex(variableRegEx);\n }\n\n for (let i = 0; i < metricNames.length; i++) {\n const item = metricNames[i];\n let text = item.text === undefined || item.text === null ? item.value : item.text;\n let value = item.value === undefined || item.value === null ? item.text : item.value;\n\n if (isNumber(value)) {\n value = value.toString();\n }\n\n if (isNumber(text)) {\n text = text.toString();\n }\n\n if (regex) {\n const matches = getAllMatches(value, regex);\n if (!matches.length) {\n continue;\n }\n\n const valueGroup = matches.find((m) => m.groups && m.groups.value);\n const textGroup = matches.find((m) => m.groups && m.groups.text);\n const firstMatch = matches.find((m) => m.length > 1);\n const manyMatches = matches.length > 1 && firstMatch;\n\n if (valueGroup || textGroup) {\n value = valueGroup?.groups?.value ?? textGroup?.groups?.text;\n text = textGroup?.groups?.text ?? valueGroup?.groups?.value;\n } else if (manyMatches) {\n for (let j = 0; j < matches.length; j++) {\n const match = matches[j];\n options.push({ label: match[1], value: match[1] });\n }\n continue;\n } else if (firstMatch) {\n text = firstMatch[1];\n value = firstMatch[1];\n }\n }\n\n options.push({ label: text, value: value });\n }\n\n options = uniqBy(options, 'value');\n return sortVariableValues(options, sort);\n};\n\nconst getAllMatches = (str: string, regex: RegExp): RegExpExecArray[] => {\n const results: RegExpExecArray[] = [];\n let matches = null;\n\n regex.lastIndex = 0;\n\n do {\n matches = regex.exec(str);\n if (matches) {\n results.push(matches);\n }\n } while (regex.global && matches && matches[0] !== '' && matches[0] !== undefined);\n\n return results;\n};\n\nexport const sortVariableValues = (options: any[], sortOrder: VariableSort) => {\n if (sortOrder === VariableSort.disabled) {\n return options;\n }\n\n // @ts-ignore\n const sortByNumeric = (opt) => {\n if (!opt.text) {\n return -1;\n }\n const matches = opt.text.match(/.*?(\\d+).*/);\n if (!matches || matches.length < 2) {\n return -1;\n } else {\n return parseInt(matches[1], 10);\n }\n };\n\n // @ts-ignore\n const sortByNaturalSort = (options) => {\n //@ts-ignore\n return options.sort((a, b) => {\n if (!a.text) {\n return -1;\n }\n\n if (!b.text) {\n return 1;\n }\n\n return a.text.localeCompare(b.text, undefined, { numeric: true });\n });\n };\n\n switch (sortOrder) {\n case VariableSort.alphabeticalAsc:\n options = sortBy(options, 'label');\n break;\n case VariableSort.alphabeticalDesc:\n options = sortBy(options, 'label').reverse();\n break;\n case VariableSort.numericalAsc:\n options = sortBy(options, sortByNumeric);\n break;\n case VariableSort.numericalDesc:\n options = sortBy(options, sortByNumeric);\n options = options.reverse();\n break;\n case VariableSort.alphabeticalCaseInsensitiveAsc:\n options = sortBy(options, (opt) => {\n return toLower(opt.label);\n });\n break;\n case VariableSort.alphabeticalCaseInsensitiveDesc:\n options = sortBy(options, (opt) => {\n return toLower(opt.label);\n });\n options = options.reverse();\n break;\n case VariableSort.naturalAsc || 7:\n // Sort by natural sort\n options = sortByNaturalSort(options);\n break;\n case VariableSort.naturalDesc || 8:\n options = sortByNaturalSort(options);\n options = options.reverse();\n break;\n default:\n break;\n }\n return options;\n};\n","import {\n FieldType,\n getFieldDisplayName,\n isDataFrame,\n MetricFindValue,\n PanelData,\n getProcessedDataFrames,\n} from '@grafana/data';\nimport { map, OperatorFunction } from 'rxjs';\n\nexport function toMetricFindValues(): OperatorFunction<PanelData, MetricFindValue[]> {\n return (source) =>\n source.pipe(\n map((panelData) => {\n const frames = panelData.series;\n if (!frames || !frames.length) {\n return [];\n }\n\n if (areMetricFindValues(frames)) {\n return frames;\n }\n\n if (frames[0].fields.length === 0) {\n return [];\n }\n\n const processedDataFrames = getProcessedDataFrames(frames);\n const metrics: MetricFindValue[] = [];\n\n let valueIndex = -1;\n let textIndex = -1;\n let stringIndex = -1;\n let expandableIndex = -1;\n\n for (const frame of processedDataFrames) {\n for (let index = 0; index < frame.fields.length; index++) {\n const field = frame.fields[index];\n const fieldName = getFieldDisplayName(field, frame, frames).toLowerCase();\n\n if (field.type === FieldType.string && stringIndex === -1) {\n stringIndex = index;\n }\n\n if (fieldName === 'text' && field.type === FieldType.string && textIndex === -1) {\n textIndex = index;\n }\n\n if (fieldName === 'value' && field.type === FieldType.string && valueIndex === -1) {\n valueIndex = index;\n }\n\n if (\n fieldName === 'expandable' &&\n (field.type === FieldType.boolean || field.type === FieldType.number) &&\n expandableIndex === -1\n ) {\n expandableIndex = index;\n }\n }\n }\n\n if (stringIndex === -1) {\n throw new Error(\"Couldn't find any field of type string in the results.\");\n }\n\n for (const frame of frames) {\n for (let index = 0; index < frame.length; index++) {\n const expandable = expandableIndex !== -1 ? frame.fields[expandableIndex].values.get(index) : undefined;\n const string = frame.fields[stringIndex].values.get(index);\n const text = textIndex !== -1 ? frame.fields[textIndex].values.get(index) : null;\n const value = valueIndex !== -1 ? frame.fields[valueIndex].values.get(index) : null;\n\n if (valueIndex === -1 && textIndex === -1) {\n metrics.push({ text: string, value: string, expandable });\n continue;\n }\n\n if (valueIndex === -1 && textIndex !== -1) {\n metrics.push({ text, value: text, expandable });\n continue;\n }\n\n if (valueIndex !== -1 && textIndex === -1) {\n metrics.push({ text: value, value, expandable });\n continue;\n }\n\n metrics.push({ text, value, expandable });\n }\n }\n\n return metrics;\n })\n );\n}\n\nfunction areMetricFindValues(data: any[]): data is MetricFindValue[] {\n if (!data) {\n return false;\n }\n\n if (!data.length) {\n return true;\n }\n\n const firstValue: any = data[0];\n\n if (isDataFrame(firstValue)) {\n return false;\n }\n\n for (const firstValueKey in firstValue) {\n if (!firstValue.hasOwnProperty(firstValueKey)) {\n continue;\n }\n\n if (\n firstValue[firstValueKey] !== null &&\n typeof firstValue[firstValueKey] !== 'string' &&\n typeof firstValue[firstValueKey] !== 'number'\n ) {\n continue;\n }\n\n const key = firstValueKey.toLowerCase();\n\n if (key === 'text' || key === 'value') {\n return true;\n }\n }\n\n return false;\n}\n","import { Observable, of, filter, take, mergeMap, catchError, throwError, from, lastValueFrom } from 'rxjs';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport {\n CoreApp,\n DataQueryRequest,\n LoadingState,\n PanelData,\n ScopedVars,\n VariableRefresh,\n VariableSort,\n} from '@grafana/data';\n\nimport { sceneGraph } from '../../../core/sceneGraph';\nimport { SceneComponentProps, SceneDataQuery } from '../../../core/types';\nimport { VariableDependencyConfig } from '../../VariableDependencyConfig';\nimport { renderSelectForVariable } from '../../components/VariableValueSelect';\nimport { VariableValueOption } from '../../types';\nimport { MultiValueVariable, MultiValueVariableState, VariableGetOptionsArgs } from '../MultiValueVariable';\n\nimport { createQueryVariableRunner } from './createQueryVariableRunner';\nimport { metricNamesToVariableValues } from './utils';\nimport { toMetricFindValues } from './toMetricFindValues';\nimport { getDataSource } from '../../../utils/getDataSource';\nimport { safeStringifyValue } from '../../utils';\nimport { DataQuery, DataSourceRef } from '@grafana/schema';\nimport { SEARCH_FILTER_VARIABLE } from '../../constants';\nimport { debounce } from 'lodash';\nimport { registerQueryWithController } from '../../../querying/registerQueryWithController';\nimport { wrapInSafeSerializableSceneObject } from '../../../utils/wrapInSafeSerializableSceneObject';\n\nexport interface QueryVariableState extends MultiValueVariableState {\n type: 'query';\n datasource: DataSourceRef | null;\n query: string | SceneDataQuery;\n regex: string;\n refresh: VariableRefresh;\n sort: VariableSort;\n /** @internal Only for use inside core dashboards */\n definition?: string;\n}\n\nexport class QueryVariable extends MultiValueVariable<QueryVariableState> {\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['regex', 'query', 'datasource'],\n });\n\n public constructor(initialState: Partial<QueryVariableState>) {\n super({\n type: 'query',\n name: '',\n value: '',\n text: '',\n options: [],\n datasource: null,\n regex: '',\n query: '',\n refresh: VariableRefresh.onDashboardLoad,\n sort: VariableSort.disabled,\n ...initialState,\n });\n }\n\n public getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]> {\n if (!this.state.query) {\n return of([]);\n }\n\n this.setState({ loading: true, error: null });\n\n return from(\n getDataSource(this.state.datasource, {\n __sceneObject: wrapInSafeSerializableSceneObject(this),\n })\n ).pipe(\n mergeMap((ds) => {\n const runner = createQueryVariableRunner(ds);\n const target = runner.getTarget(this);\n const request = this.getRequest(target, args.searchFilter);\n\n return runner.runRequest({ variable: this, searchFilter: args.searchFilter }, request).pipe(\n registerQueryWithController({\n type: 'variable',\n request: request,\n origin: this,\n }),\n filter((data) => data.state === LoadingState.Done || data.state === LoadingState.Error), // we only care about done or error for now\n take(1), // take the first result, using first caused a bug where it in some situations throw an uncaught error because of no results had been received yet\n mergeMap((data: PanelData) => {\n if (data.state === LoadingState.Error) {\n return throwError(() => data.error);\n }\n return of(data);\n }),\n toMetricFindValues(),\n mergeMap((values) => {\n let regex = '';\n if (this.state.regex) {\n regex = sceneGraph.interpolate(this, this.state.regex, undefined, 'regex');\n }\n return of(metricNamesToVariableValues(regex, this.state.sort, values));\n }),\n catchError((error) => {\n if (error.cancelled) {\n return of([]);\n }\n return throwError(() => error);\n })\n );\n })\n );\n }\n\n private getRequest(target: DataQuery | string, searchFilter?: string) {\n const scopedVars: ScopedVars = {\n __sceneObject: wrapInSafeSerializableSceneObject(this),\n };\n\n if (searchFilter) {\n scopedVars.__searchFilter = { value: searchFilter, text: searchFilter };\n }\n\n const range = sceneGraph.getTimeRange(this).state.value;\n\n const request: DataQueryRequest = {\n app: CoreApp.Dashboard,\n requestId: uuidv4(),\n timezone: '',\n range,\n interval: '',\n intervalMs: 0,\n // @ts-ignore\n targets: [target],\n scopedVars,\n startTime: Date.now(),\n };\n\n return request;\n }\n\n onSearchChange = (searchFilter: string) => {\n if (!containsSearchFilter(this.state.query)) {\n return;\n }\n\n this._updateOptionsBasedOnSearchFilter(searchFilter);\n };\n\n private _updateOptionsBasedOnSearchFilter = debounce(async (searchFilter: string) => {\n const result = await lastValueFrom(this.getValueOptions({ searchFilter }));\n this.setState({ options: result, loading: false });\n }, 400);\n\n public static Component = ({ model }: SceneComponentProps<MultiValueVariable>) => {\n return renderSelectForVariable(model);\n };\n}\n\nfunction containsSearchFilter(query: string | DataQuery) {\n const str = safeStringifyValue(query);\n return str.indexOf(SEARCH_FILTER_VARIABLE) > -1;\n}\n","import { ScopedVars } from '@grafana/data';\nimport { EmptyDataNode, EmptyVariableSet } from '../../variables/interpolation/defaults';\n\nimport { sceneInterpolator } from '../../variables/interpolation/sceneInterpolator';\nimport { VariableCustomFormatterFn, SceneVariables } from '../../variables/types';\n\nimport { isDataLayer, SceneDataLayerProvider, SceneDataProvider, SceneLayout, SceneObject } from '../types';\nimport { lookupVariable } from '../../variables/lookupVariable';\nimport { getClosest } from './utils';\nimport { SceneQueryControllerLike, isQueryController } from '../../behaviors/SceneQueryController';\nimport { VariableInterpolation } from '@grafana/runtime';\nimport { QueryVariable } from '../../variables/variants/query/QueryVariable';\n\n/**\n * Get the closest node with variables\n */\nexport function getVariables(sceneObject: SceneObject): SceneVariables {\n return getClosest(sceneObject, (s) => s.state.$variables) ?? EmptyVariableSet;\n}\n\n/**\n * Will walk up the scene object graph to the closest $data scene object\n */\nexport function getData(sceneObject: SceneObject): SceneDataProvider {\n return getClosest(sceneObject, (s) => s.state.$data) ?? EmptyDataNode;\n}\n\nfunction isSceneLayout(s: SceneObject): s is SceneLayout {\n return 'isDraggable' in s;\n}\n\n/**\n * Will walk up the scene object graph to the closest $layout scene object\n */\nexport function getLayout(scene: SceneObject): SceneLayout | null {\n const parent = getClosest(scene, (s) => (isSceneLayout(s) ? s : undefined));\n if (parent) {\n return parent;\n }\n\n return null;\n}\n\n/**\n * Interpolates the given string using the current scene object as context. *\n *\n * Note: the interpolations array will be mutated by adding information about variables that\n * have been interpolated during replacement. Variables that were specified in the target but not found in\n * the list of available variables are also added to the array. See {@link VariableInterpolation} for more details.\n *\n * @param {VariableInterpolation[]} interpolations an optional array that is updated with interpolated variables.\n */\nexport function interpolate(\n sceneObject: SceneObject,\n value: string | undefined | null,\n scopedVars?: ScopedVars,\n format?: string | VariableCustomFormatterFn,\n interpolations?: VariableInterpolation[]\n): string {\n if (value === '' || value == null) {\n return '';\n }\n\n return sceneInterpolator(sceneObject, value, scopedVars, format, interpolations);\n}\n\n/**\n * Checks if the variable is currently loading or waiting to update.\n * It also returns true if a dependency of the variable is loading.\n *\n * For example if C depends on variable B which depends on variable A and A is loading this returns true for variable C and B.\n */\nexport function hasVariableDependencyInLoadingState(sceneObject: SceneObject) {\n if (!sceneObject.variableDependency) {\n return false;\n }\n\n for (const name of sceneObject.variableDependency.getNames()) {\n // This is for backwards compability. In the old architecture query variables could reference itself in a query without breaking.\n if (sceneObject instanceof QueryVariable && sceneObject.state.name === name) {\n console.warn('Query variable is referencing itself');\n continue;\n }\n\n const variable = lookupVariable(name, sceneObject);\n if (!variable) {\n continue;\n }\n\n const set = variable.parent as SceneVariables;\n if (set.isVariableLoadingOrWaitingToUpdate(variable)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction findObjectInternal(\n scene: SceneObject,\n check: (obj: SceneObject) => boolean,\n alreadySearchedChild?: SceneObject,\n shouldSearchUp?: boolean\n): SceneObject | null {\n if (check(scene)) {\n return scene;\n }\n\n let found: SceneObject | null = null;\n\n scene.forEachChild((child) => {\n if (child === alreadySearchedChild) {\n return;\n }\n\n let maybe = findObjectInternal(child, check);\n if (maybe) {\n found = maybe;\n }\n });\n\n if (found) {\n return found;\n }\n\n if (shouldSearchUp && scene.parent) {\n return findObjectInternal(scene.parent, check, scene, true);\n }\n\n return null;\n}\n\n/**\n * Returns a scene object from the scene graph with the requested key.\n *\n * Throws error if no key-matching scene object found.\n */\nexport function findByKey(sceneObject: SceneObject, key: string) {\n const found = findObject(sceneObject, (sceneToCheck) => {\n return sceneToCheck.state.key === key;\n });\n if (!found) {\n throw new Error('Unable to find scene with key ' + key);\n }\n return found;\n}\n\n/**\n * Returns a scene object from the scene graph with the requested key and type.\n *\n * Throws error if no key-matching scene object found.\n * Throws error if the given type does not match.\n */\nexport function findByKeyAndType<TargetType extends SceneObject>(\n sceneObject: SceneObject,\n key: string,\n targetType: { new (...args: never[]): TargetType }\n) {\n const found = findObject(sceneObject, (sceneToCheck) => {\n return sceneToCheck.state.key === key;\n });\n if (!found) {\n throw new Error('Unable to find scene with key ' + key);\n }\n if (!(found instanceof targetType)) {\n throw new Error(`Found scene object with key ${key} does not match type ${targetType.name}`);\n }\n return found;\n}\n\n/**\n * This will search the full scene graph, starting with the scene node passed in, then walking up the parent chain. *\n */\nexport function findObject(scene: SceneObject, check: (obj: SceneObject) => boolean): SceneObject | null {\n return findObjectInternal(scene, check, undefined, true);\n}\n\n/**\n * This will search down the full scene graph, looking for objects that match the provided predicate.\n */\nexport function findAllObjects(scene: SceneObject, check: (obj: SceneObject) => boolean): SceneObject[] {\n const found: SceneObject[] = [];\n\n scene.forEachChild((child) => {\n if (check(child)) {\n found.push(child);\n }\n\n found.push(...findAllObjects(child, check));\n });\n\n return found;\n}\n\n/**\n * Will walk up the scene object graph up until the root and collect all SceneDataLayerProvider objects.\n * When localOnly set to true, it will only collect the closest layers.\n */\nexport function getDataLayers(sceneObject: SceneObject, localOnly = false): SceneDataLayerProvider[] {\n let currentLevel: SceneObject | undefined = sceneObject;\n let collected: SceneDataLayerProvider[] = [];\n\n while (currentLevel) {\n const dataProvider = currentLevel.state.$data;\n if (!dataProvider) {\n currentLevel = currentLevel.parent;\n continue;\n }\n\n // Check if data layer exists nested inside another data provider\n if (isDataLayer(dataProvider)) {\n collected = collected.concat(dataProvider);\n } else {\n if (dataProvider.state.$data && isDataLayer(dataProvider.state.$data)) {\n collected = collected.concat(dataProvider.state.$data);\n }\n }\n\n if (localOnly && collected.length > 0) {\n break;\n }\n\n currentLevel = currentLevel.parent;\n }\n\n return collected;\n}\n\n/**\n * A utility function to find the closest ancestor of a given type. This function expects\n * to find it and will throw an error if it does not.\n */\nexport function getAncestor<ParentType>(\n sceneObject: SceneObject,\n ancestorType: { new (...args: never[]): ParentType }\n): ParentType {\n let parent: SceneObject | undefined = sceneObject;\n\n while (parent) {\n if (parent instanceof ancestorType) {\n return parent;\n }\n parent = parent.parent;\n }\n\n if (!parent) {\n throw new Error('Unable to find parent of type ' + ancestorType.name);\n }\n\n return parent as ParentType;\n}\n\n/**\n * Returns the closest query controller undefined if none found\n */\nexport function getQueryController(sceneObject: SceneObject): SceneQueryControllerLike | undefined {\n let parent: SceneObject | undefined = sceneObject;\n\n while (parent) {\n if (parent.state.$behaviors) {\n for (const behavior of parent.state.$behaviors) {\n if (isQueryController(behavior)) {\n return behavior;\n }\n }\n }\n parent = parent.parent;\n }\n\n return undefined;\n}\n","import { lookupVariable } from '../../variables/lookupVariable';\nimport { getTimeRange } from './getTimeRange';\nimport {\n findByKey,\n findByKeyAndType,\n findObject,\n findAllObjects,\n getData,\n getLayout,\n getVariables,\n getDataLayers,\n hasVariableDependencyInLoadingState,\n interpolate,\n getAncestor,\n getQueryController,\n} from './sceneGraph';\n\nexport const sceneGraph = {\n getVariables,\n getData,\n getTimeRange,\n getLayout,\n getDataLayers,\n interpolate,\n lookupVariable,\n hasVariableDependencyInLoadingState,\n findByKey,\n findByKeyAndType,\n findObject,\n findAllObjects,\n getAncestor,\n getQueryController,\n};\n","import { sceneGraph } from '../core/sceneGraph';\nimport { SceneObject } from '../core/types';\n\nexport interface SceneObjectWithDepth {\n sceneObject: SceneObject;\n depth: number;\n}\n\nexport class UniqueUrlKeyMapper {\n private index = new Map<string, SceneObject[]>();\n\n public getUniqueKey(key: string, obj: SceneObject) {\n const objectsWithKey = this.index.get(key);\n\n if (!objectsWithKey) {\n this.index.set(key, [obj]);\n return key;\n }\n\n let address = objectsWithKey.findIndex((o) => o === obj);\n if (address === -1) {\n filterOutOrphanedObjects(objectsWithKey);\n objectsWithKey.push(obj);\n\n address = objectsWithKey.length - 1;\n }\n\n if (address > 0) {\n return `${key}-${address + 1}`;\n }\n\n return key;\n }\n\n public clear() {\n this.index.clear();\n }\n}\n\nfunction filterOutOrphanedObjects(sceneObjects: SceneObject[]) {\n for (const obj of sceneObjects) {\n if (isOrphanOrInActive(obj)) {\n const index = sceneObjects.indexOf(obj);\n sceneObjects.splice(index, 1);\n }\n }\n}\n\nfunction isOrphanOrInActive(obj: SceneObject) {\n const root = obj.getRoot();\n\n // If we cannot find it from the root it's an orphan\n if (!sceneGraph.findObject(root, (child) => child === obj)) {\n return true;\n }\n\n return false;\n}\n","import { isEqual } from 'lodash';\n\nimport { SceneObject, SceneObjectUrlValue, SceneObjectUrlValues } from '../core/types';\nimport { UniqueUrlKeyMapper } from './UniqueUrlKeyMapper';\n\n/**\n * @param root\n * @returns the full scene url state as a object with keys and values\n */\nexport function getUrlState(root: SceneObject): SceneObjectUrlValues {\n const urlKeyMapper = new UniqueUrlKeyMapper();\n const result: SceneObjectUrlValues = {};\n\n const visitNode = (obj: SceneObject) => {\n if (obj.urlSync) {\n const newUrlState = obj.urlSync.getUrlState();\n\n for (const [key, value] of Object.entries(newUrlState)) {\n if (value != null) {\n const uniqueKey = urlKeyMapper.getUniqueKey(key, obj);\n result[uniqueKey] = value;\n }\n }\n }\n\n obj.forEachChild(visitNode);\n };\n\n visitNode(root);\n return result;\n}\n\n/**\n * Exported util function to sync state from an initial url state.\n * Useful for initializing an embedded scenes with a url state string.\n */\nexport function syncStateFromSearchParams(root: SceneObject, urlParams: URLSearchParams) {\n const urlKeyMapper = new UniqueUrlKeyMapper();\n syncStateFromUrl(root, urlParams, urlKeyMapper);\n}\n\nexport function syncStateFromUrl(\n root: SceneObject,\n urlParams: URLSearchParams,\n urlKeyMapper: UniqueUrlKeyMapper,\n onlyChildren?: boolean\n) {\n if (!onlyChildren) {\n syncUrlStateToObject(root, urlParams, urlKeyMapper);\n }\n\n // These two forEachChild loops might look strange but it's to make sure we walk through the scene graph one level at a time as url key conflicts depend depth in the scene tree\n root.forEachChild((child) => {\n syncUrlStateToObject(child, urlParams, urlKeyMapper);\n });\n\n root.forEachChild((child) => syncStateFromUrl(child, urlParams, urlKeyMapper, true));\n}\n\nfunction syncUrlStateToObject(sceneObject: SceneObject, urlParams: URLSearchParams, urlKeyMapper: UniqueUrlKeyMapper) {\n if (sceneObject.urlSync) {\n const urlState: SceneObjectUrlValues = {};\n const currentState = sceneObject.urlSync.getUrlState();\n\n for (const key of sceneObject.urlSync.getKeys()) {\n const uniqueKey = urlKeyMapper.getUniqueKey(key, sceneObject);\n const newValue = urlParams.getAll(uniqueKey);\n const currentValue = currentState[key];\n\n if (isUrlValueEqual(newValue, currentValue)) {\n continue;\n }\n\n if (newValue.length > 0) {\n if (Array.isArray(currentValue)) {\n urlState[key] = newValue;\n } else {\n urlState[key] = newValue[0];\n }\n } else {\n // mark this key as having no url state\n urlState[key] = null;\n }\n }\n\n if (Object.keys(urlState).length > 0) {\n sceneObject.urlSync.updateFromUrl(urlState);\n }\n }\n}\n\nexport function isUrlValueEqual(currentUrlValue: string[], newUrlValue: SceneObjectUrlValue): boolean {\n if (currentUrlValue.length === 0 && newUrlValue == null) {\n return true;\n }\n\n if (!Array.isArray(newUrlValue) && currentUrlValue?.length === 1) {\n return newUrlValue === currentUrlValue[0];\n }\n\n if (newUrlValue?.length === 0 && currentUrlValue === null) {\n return true;\n }\n\n // We have two arrays, lets compare them\n return isEqual(currentUrlValue, newUrlValue);\n}\n","import { AdHocFiltersVariable } from '../adhoc/AdHocFiltersVariable';\nimport { SceneVariable } from '../types';\nimport { ConstantVariable } from './ConstantVariable';\nimport { CustomVariable } from './CustomVariable';\nimport { DataSourceVariable } from './DataSourceVariable';\nimport { IntervalVariable } from './IntervalVariable';\nimport { TextBoxVariable } from './TextBoxVariable';\nimport { QueryVariable } from './query/QueryVariable';\nimport { GroupByVariable } from '../groupby/GroupByVariable';\n\nexport function isAdHocVariable(variable: SceneVariable): variable is AdHocFiltersVariable {\n return variable.state.type === 'adhoc';\n}\n\nexport function isConstantVariable(variable: SceneVariable): variable is ConstantVariable {\n return variable.state.type === 'constant';\n}\n\nexport function isCustomVariable(variable: SceneVariable): variable is CustomVariable {\n return variable.state.type === 'custom';\n}\n\nexport function isDataSourceVariable(variable: SceneVariable): variable is DataSourceVariable {\n return variable.state.type === 'datasource';\n}\n\nexport function isIntervalVariable(variable: SceneVariable): variable is IntervalVariable {\n return variable.state.type === 'interval';\n}\n\nexport function isQueryVariable(variable: SceneVariable): variable is QueryVariable {\n return variable.state.type === 'query';\n}\n\nexport function isTextBoxVariable(variable: SceneVariable): variable is TextBoxVariable {\n return variable.state.type === 'textbox';\n}\n\nexport function isGroupByVariable(variable: SceneVariable): variable is GroupByVariable {\n return variable.state.type === 'groupby';\n}\n","import { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneObjectState } from '../core/types';\nimport { SceneVariable } from '../variables/types';\nimport { VariableDependencyConfig } from '../variables/VariableDependencyConfig';\n\ninterface ActWhenVariableChangedState extends SceneObjectState {\n // The name of the variable to subscribe to changes to.\n variableName: string;\n /**\n * The handler to run when a variable changes.\n * @param variable The variable that changed\n * @param behavior The behavior instance where this onChange handler added to.\n * You can use this to access the parent SceneObject where this behavior exists.\n * You can also use this with the sceneGraph util functions to find objects from this scene graph location.\n * @returns Return a cancellation function if you do anything async like issue a query.\n */\n onChange: (variable: SceneVariable, behavior: ActWhenVariableChanged) => (() => void) | void;\n}\n\n/**\n * This behavior will run an effect function when specified variables change\n */\n\nexport class ActWhenVariableChanged extends SceneObjectBase<ActWhenVariableChangedState> {\n private _runningEffect: null | (() => void) = null;\n\n protected _variableDependency = new VariableDependencyConfig(this, {\n variableNames: [this.state.variableName],\n onReferencedVariableValueChanged: this._onVariableChanged.bind(this),\n });\n\n private _onVariableChanged(variable: SceneVariable): void {\n const effect = this.state.onChange;\n\n if (this._runningEffect) {\n this._runningEffect();\n this._runningEffect = null;\n }\n\n const cancellation = effect(variable, this);\n if (cancellation) {\n this._runningEffect = cancellation;\n }\n }\n}\n","import { BusEvent, BusEventHandler, BusEventType, EventBus, EventFilterOptions } from '@grafana/data';\nimport { DashboardCursorSync } from '@grafana/schema';\nimport { Observable, Unsubscribable } from 'rxjs';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneObject, SceneObjectState } from '../core/types';\n\ninterface CursorSyncState extends SceneObjectState {\n sync: DashboardCursorSync;\n}\n\n/**\n * This behavior will provide a cursor sync context within a scene.\n */\n\nexport class CursorSync extends SceneObjectBase<CursorSyncState> {\n public constructor(state: Partial<CursorSyncState>) {\n super({\n ...state,\n sync: state.sync || DashboardCursorSync.Off,\n });\n }\n\n public getEventsBus = (panel: SceneObject) => {\n if (!this.parent) {\n throw new Error('EnableCursorSync cannot be used as a standalone scene object');\n }\n // Since EnableCursorSync is a behavior, it is not a parent to any object in the scene graph.\n // We need to get it's parent in order to provide correct EventBus context to the children.\n return new PanelContextEventBus(this.parent, panel);\n };\n\n public getEventsScope() {\n if (!this.parent) {\n throw new Error('EnableCursorSync cannot be used as a standalone scene object');\n }\n\n // Since EnableCursorSync is a behavior, it is not a parent to any object in the scene graph.\n // We need to get it's parent in order to provide correct EventBus context to the children.\n return this.state.key!;\n }\n}\n\n// This serves as a shared EventsBus that is shared by children or CursorSync behavior.\nclass PanelContextEventBus implements EventBus {\n public constructor(private _source: SceneObject, private _eventsOrigin: SceneObject) {}\n\n public publish<T extends BusEvent>(event: T): void {\n (event as any).origin = this;\n this._eventsOrigin.publishEvent(event, true);\n }\n\n public getStream<T extends BusEvent>(eventType: BusEventType<T>): Observable<T> {\n return new Observable<T>((observer) => {\n const handler = (event: T) => {\n observer.next(event);\n };\n\n const sub = this._source.subscribeToEvent(eventType, handler);\n\n return () => sub.unsubscribe();\n });\n }\n\n public subscribe<T extends BusEvent>(eventType: BusEventType<T>, handler: BusEventHandler<T>): Unsubscribable {\n return this.getStream(eventType).pipe().subscribe(handler);\n }\n\n public removeAllListeners(): void {}\n\n public newScopedBus(key: string, filter: EventFilterOptions): EventBus {\n throw new Error('For internal use only');\n }\n}\n\nexport function getCursorSyncScope(sceneObject: SceneObject): CursorSync | null {\n return sceneGraph.findObject(sceneObject, (o) => o instanceof CursorSync) as CursorSync;\n}\n","import React, { RefCallback, useCallback, useMemo } from 'react';\nimport { useMeasure } from 'react-use';\n\n// @ts-ignore\nimport { AlertState, GrafanaTheme2, PanelData, PluginContextProvider, SetPanelAttentionEvent } from '@grafana/data';\n\nimport { getAppEvents } from '@grafana/runtime';\nimport { PanelChrome, ErrorBoundaryAlert, PanelContextProvider, Tooltip, useStyles2, Icon } from '@grafana/ui';\n\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { isSceneObject, SceneComponentProps, SceneLayout, SceneObject } from '../../core/types';\n\nimport { VizPanel } from './VizPanel';\nimport { css, cx } from '@emotion/css';\nimport { debounce } from 'lodash';\n\nexport function VizPanelRenderer({ model }: SceneComponentProps<VizPanel>) {\n const {\n title,\n options,\n fieldConfig,\n _pluginLoadError,\n displayMode,\n hoverHeader,\n hoverHeaderOffset,\n menu,\n headerActions,\n titleItems,\n description,\n } = model.useState();\n const [ref, { width, height }] = useMeasure();\n const appEvents = useMemo(() => getAppEvents(), []);\n\n const setPanelAttention = useCallback(() => {\n appEvents.publish(new SetPanelAttentionEvent({ panelId: model.state.key }));\n }, [model.state.key, appEvents]);\n const debouncedMouseMove = useMemo(\n () => debounce(setPanelAttention, 100, { leading: true, trailing: false }),\n [setPanelAttention]\n );\n\n const plugin = model.getPlugin();\n\n const { dragClass, dragClassCancel } = getDragClasses(model);\n const dataObject = sceneGraph.getData(model);\n\n const rawData = dataObject.useState();\n const dataWithFieldConfig = model.applyFieldConfig(rawData.data!);\n const sceneTimeRange = sceneGraph.getTimeRange(model);\n const timeZone = sceneTimeRange.getTimeZone();\n const timeRange = model.getTimeRange(dataWithFieldConfig);\n\n // Interpolate title\n const titleInterpolated = model.interpolate(title, undefined, 'text');\n\n const alertStateStyles = useStyles2(getAlertStateStyles);\n\n if (!plugin) {\n return <div>Loading plugin panel...</div>;\n }\n\n if (!plugin.panel) {\n return <div>Panel plugin has no panel component</div>;\n }\n\n const PanelComponent = plugin.panel;\n\n // If we have a query runner on our level inform it of the container width (used to set auto max data points)\n if (dataObject && dataObject.setContainerWidth) {\n dataObject.setContainerWidth(Math.round(width));\n }\n\n let titleItemsElement: React.ReactNode[] = [];\n\n if (titleItems) {\n if (Array.isArray(titleItems)) {\n titleItemsElement = titleItemsElement.concat(\n titleItems.map((titleItem) => {\n return <titleItem.Component model={titleItem} key={`${titleItem.state.key}`} />;\n })\n );\n } else if (isSceneObject(titleItems)) {\n titleItemsElement.push(<titleItems.Component model={titleItems} />);\n } else {\n titleItemsElement.push(titleItems);\n }\n }\n\n // If we have local time range show that in panel header\n if (model.state.$timeRange) {\n titleItemsElement.push(<model.state.$timeRange.Component model={model.state.$timeRange} key={model.state.key} />);\n }\n\n if (dataWithFieldConfig.alertState) {\n titleItemsElement.push(\n <Tooltip content={dataWithFieldConfig.alertState.state ?? 'unknown'} key={`alert-states-icon-${model.state.key}`}>\n <PanelChrome.TitleItem\n className={cx({\n [alertStateStyles.ok]: dataWithFieldConfig.alertState.state === AlertState.OK,\n [alertStateStyles.pending]: dataWithFieldConfig.alertState.state === AlertState.Pending,\n [alertStateStyles.alerting]: dataWithFieldConfig.alertState.state === AlertState.Alerting,\n })}\n >\n <Icon\n name={dataWithFieldConfig.alertState.state === 'alerting' ? 'heart-break' : 'heart'}\n className=\"panel-alert-icon\"\n size=\"md\"\n />\n </PanelChrome.TitleItem>\n </Tooltip>\n );\n }\n\n let panelMenu;\n if (menu) {\n panelMenu = <menu.Component model={menu} />;\n }\n\n let actionsElement: React.ReactNode | undefined;\n\n if (headerActions) {\n if (Array.isArray(headerActions)) {\n actionsElement = (\n <>\n {headerActions.map((action) => {\n return <action.Component model={action} key={`${action.state.key}`} />;\n })}\n </>\n );\n } else if (isSceneObject(headerActions)) {\n actionsElement = <headerActions.Component model={headerActions} />;\n } else {\n actionsElement = headerActions;\n }\n }\n\n // Data is always returned. For non-data panels, empty PanelData is returned.\n const data = dataWithFieldConfig!;\n\n const isReadyToRender = dataObject.isDataReadyToDisplay ? dataObject.isDataReadyToDisplay() : true;\n\n const context = model.getPanelContext();\n const panelId = model.getLegacyPanelId();\n\n return (\n <div className={relativeWrapper}>\n <div ref={ref as RefCallback<HTMLDivElement>} className={absoluteWrapper} data-viz-panel-key={model.state.key}>\n {width > 0 && height > 0 && (\n <PanelChrome\n title={titleInterpolated}\n description={description?.trim() ? model.getDescription : undefined}\n loadingState={data.state}\n statusMessage={getChromeStatusMessage(data, _pluginLoadError)}\n statusMessageOnClick={model.onStatusMessageClick}\n width={width}\n height={height}\n displayMode={displayMode}\n hoverHeader={hoverHeader}\n hoverHeaderOffset={hoverHeaderOffset}\n titleItems={titleItemsElement}\n dragClass={dragClass}\n actions={actionsElement}\n dragClassCancel={dragClassCancel}\n padding={plugin.noPadding ? 'none' : 'md'}\n menu={panelMenu}\n onCancelQuery={model.onCancelQuery}\n // @ts-ignore\n onFocus={setPanelAttention}\n onMouseEnter={setPanelAttention}\n onMouseMove={debouncedMouseMove}\n >\n {(innerWidth, innerHeight) => (\n <>\n <ErrorBoundaryAlert dependencies={[plugin, data]}>\n <PluginContextProvider meta={plugin.meta}>\n <PanelContextProvider value={context}>\n {isReadyToRender && (\n <PanelComponent\n id={panelId}\n data={data}\n title={title}\n timeRange={timeRange}\n timeZone={timeZone}\n options={options}\n fieldConfig={fieldConfig}\n transparent={false}\n width={innerWidth}\n height={innerHeight}\n renderCounter={0}\n replaceVariables={model.interpolate}\n onOptionsChange={model.onOptionsChange}\n onFieldConfigChange={model.onFieldConfigChange}\n onChangeTimeRange={model.onTimeRangeChange}\n eventBus={context.eventBus}\n />\n )}\n </PanelContextProvider>\n </PluginContextProvider>\n </ErrorBoundaryAlert>\n </>\n )}\n </PanelChrome>\n )}\n </div>\n </div>\n );\n}\n\nfunction getDragClasses(panel: VizPanel) {\n const parentLayout = sceneGraph.getLayout(panel);\n const isDraggable = parentLayout?.isDraggable();\n\n if (!parentLayout || !isDraggable || itemDraggingDisabled(panel, parentLayout)) {\n return { dragClass: '', dragClassCancel: '' };\n }\n\n return { dragClass: parentLayout.getDragClass?.(), dragClassCancel: parentLayout?.getDragClassCancel?.() };\n}\n\n/**\n * Walks up the parent chain until it hits the layout object, trying to find the closest SceneGridItemLike ancestor.\n * It is not always the direct parent, because the VizPanel can be wrapped in other objects.\n */\nfunction itemDraggingDisabled(item: SceneObject, layout: SceneLayout) {\n let ancestor = item.parent;\n\n while (ancestor && ancestor !== layout) {\n if ('isDraggable' in ancestor.state && ancestor.state.isDraggable === false) {\n return true;\n }\n\n ancestor = ancestor.parent;\n }\n\n return false;\n}\n\nfunction getChromeStatusMessage(data: PanelData, pluginLoadingError: string | undefined) {\n if (pluginLoadingError) {\n return pluginLoadingError;\n }\n\n let message = data.error ? data.error.message : undefined;\n\n // Handling multiple errors with a single string until we integrate VizPanel with inspector\n if (data.errors) {\n message = data.errors.map((e) => e.message).join(', ');\n }\n return message;\n}\n\nconst relativeWrapper = css({\n position: 'relative',\n width: '100%',\n height: '100%',\n});\n\n/**\n * Sadly this this absolute wrapper is needed for the panel to adopt smaller sizes.\n * The combo of useMeasure and PanelChrome makes the panel take up the width it get's but that makes it impossible to\n * Then adapt to smaller space (say resizing the browser window or undocking menu).\n */\nconst absoluteWrapper = css({\n position: 'absolute',\n width: '100%',\n height: '100%',\n});\n\nconst getAlertStateStyles = (theme: GrafanaTheme2) => {\n return {\n ok: css({\n color: theme.colors.success.text,\n }),\n pending: css({\n color: theme.colors.warning.text,\n }),\n alerting: css({\n color: theme.colors.error.text,\n }),\n };\n};\n","import {\n ByNamesMatcherMode,\n ConfigOverrideRule,\n DataFrame,\n DynamicConfigValue,\n FieldConfigSource,\n FieldMatcherID,\n fieldMatchers,\n FieldType,\n getFieldDisplayName,\n isSystemOverrideWithRef,\n SystemConfigOverrideRule,\n} from '@grafana/data';\nimport { SeriesVisibilityChangeMode } from '@grafana/ui';\n\nconst displayOverrideRef = 'hideSeriesFrom';\nconst isHideSeriesOverride = isSystemOverrideWithRef(displayOverrideRef);\n\nexport function seriesVisibilityConfigFactory(\n label: string,\n mode: SeriesVisibilityChangeMode,\n fieldConfig: FieldConfigSource,\n data: DataFrame[]\n): FieldConfigSource {\n const { overrides } = fieldConfig;\n\n const displayName = label;\n const currentIndex = overrides.findIndex(isHideSeriesOverride);\n\n if (currentIndex < 0) {\n if (mode === SeriesVisibilityChangeMode.ToggleSelection) {\n const override = createOverride([displayName, ...getNamesOfHiddenFields(overrides, data)]);\n\n return {\n ...fieldConfig,\n overrides: [...fieldConfig.overrides, override],\n };\n }\n\n const displayNames = getDisplayNames(data, displayName);\n const override = createOverride(displayNames);\n\n return {\n ...fieldConfig,\n overrides: [...fieldConfig.overrides, override],\n };\n }\n\n const overridesCopy = Array.from(overrides);\n const [current] = overridesCopy.splice(currentIndex, 1) as SystemConfigOverrideRule[];\n\n if (mode === SeriesVisibilityChangeMode.ToggleSelection) {\n let existing = getExistingDisplayNames(current);\n const nameOfHiddenFields = getNamesOfHiddenFields(overridesCopy, data);\n\n if (nameOfHiddenFields.length > 0) {\n existing = existing.filter((el) => nameOfHiddenFields.indexOf(el) < 0);\n }\n\n if (existing[0] === displayName && existing.length === 1) {\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n }\n\n const override = createOverride([displayName, ...nameOfHiddenFields]);\n\n return {\n ...fieldConfig,\n overrides: [...overridesCopy, override],\n };\n }\n\n const override = createExtendedOverride(current, displayName);\n\n if (allFieldsAreExcluded(override, data)) {\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n }\n\n return {\n ...fieldConfig,\n overrides: [...overridesCopy, override],\n };\n}\n\nfunction createOverride(\n names: string[],\n mode = ByNamesMatcherMode.exclude,\n property?: DynamicConfigValue\n): SystemConfigOverrideRule {\n property = property ?? {\n id: 'custom.hideFrom',\n value: {\n viz: true,\n legend: false,\n tooltip: false,\n },\n };\n\n return {\n __systemRef: displayOverrideRef,\n matcher: {\n id: FieldMatcherID.byNames,\n options: {\n mode: mode,\n names: names,\n prefix: mode === ByNamesMatcherMode.exclude ? 'All except:' : undefined,\n readOnly: true,\n },\n },\n properties: [\n {\n ...property,\n value: {\n viz: true,\n legend: false,\n tooltip: false,\n },\n },\n ],\n };\n}\n\nconst createExtendedOverride = (\n current: SystemConfigOverrideRule,\n displayName: string,\n mode = ByNamesMatcherMode.exclude\n): SystemConfigOverrideRule => {\n const property = current.properties.find((p) => p.id === 'custom.hideFrom');\n const existing = getExistingDisplayNames(current);\n const index = existing.findIndex((name) => name === displayName);\n\n if (index < 0) {\n existing.push(displayName);\n } else {\n existing.splice(index, 1);\n }\n\n return createOverride(existing, mode, property);\n};\n\nconst getExistingDisplayNames = (rule: SystemConfigOverrideRule): string[] => {\n const names = rule.matcher.options?.names;\n if (!Array.isArray(names)) {\n return [];\n }\n return [...names];\n};\n\nconst allFieldsAreExcluded = (override: SystemConfigOverrideRule, data: DataFrame[]): boolean => {\n return getExistingDisplayNames(override).length === getDisplayNames(data).length;\n};\n\nconst getDisplayNames = (data: DataFrame[], excludeName?: string): string[] => {\n const unique = new Set<string>();\n\n for (const frame of data) {\n for (const field of frame.fields) {\n if (field.type !== FieldType.number) {\n continue;\n }\n\n const name = getFieldDisplayName(field, frame, data);\n\n if (name === excludeName) {\n continue;\n }\n\n unique.add(name);\n }\n }\n\n return Array.from(unique);\n};\n\nconst getNamesOfHiddenFields = (overrides: ConfigOverrideRule[], data: DataFrame[]): string[] => {\n let names: string[] = [];\n\n for (const override of overrides) {\n const property = override.properties.find((p) => p.id === 'custom.hideFrom');\n\n if (property !== undefined && property.value?.legend === true) {\n const info = fieldMatchers.get(override.matcher.id);\n const matcher = info.get(override.matcher.options);\n\n for (const frame of data) {\n for (const field of frame.fields) {\n if (field.type !== FieldType.number) {\n continue;\n }\n\n const name = getFieldDisplayName(field, frame, data);\n\n if (matcher(field, frame, data)) {\n names.push(name);\n }\n }\n }\n }\n }\n\n return names;\n};\n","import {\n ConfigOverrideRule,\n DynamicConfigValue,\n FieldColorModeId,\n FieldConfigSource,\n FieldMatcherID,\n} from '@grafana/data';\n\nexport const changeSeriesColorConfigFactory = (\n label: string,\n color: string,\n fieldConfig: FieldConfigSource\n): FieldConfigSource => {\n const { overrides } = fieldConfig;\n const currentIndex = fieldConfig.overrides.findIndex((override) => {\n return override.matcher.id === FieldMatcherID.byName && override.matcher.options === label;\n });\n\n if (currentIndex < 0) {\n return {\n ...fieldConfig,\n overrides: [...fieldConfig.overrides, createOverride(label, color)],\n };\n }\n\n const overridesCopy = Array.from(overrides);\n const existing = overridesCopy[currentIndex];\n const propertyIndex = existing.properties.findIndex((p) => p.id === 'color');\n\n if (propertyIndex < 0) {\n overridesCopy[currentIndex] = {\n ...existing,\n properties: [...existing.properties, createProperty(color)],\n };\n\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n }\n\n const propertiesCopy = Array.from(existing.properties);\n propertiesCopy[propertyIndex] = createProperty(color);\n\n overridesCopy[currentIndex] = {\n ...existing,\n properties: propertiesCopy,\n };\n\n return {\n ...fieldConfig,\n overrides: overridesCopy,\n };\n};\n\nconst createOverride = (label: string, color: string): ConfigOverrideRule => {\n return {\n matcher: {\n id: FieldMatcherID.byName,\n options: label,\n },\n properties: [createProperty(color)],\n };\n};\n\nconst createProperty = (color: string): DynamicConfigValue => {\n return {\n id: 'color',\n value: {\n mode: FieldColorModeId.Fixed,\n fixedColor: color,\n },\n };\n};\n","import {\n AbsoluteTimeRange,\n FieldConfigSource,\n PanelModel,\n PanelPlugin,\n toUtc,\n getPanelOptionsWithDefaults,\n ScopedVars,\n InterpolateFunction,\n CoreApp,\n DashboardCursorSync,\n PanelData,\n compareArrayValues,\n compareDataFrameStructures,\n applyFieldOverrides,\n PluginType,\n renderMarkdown,\n PanelPluginDataSupport,\n} from '@grafana/data';\nimport { PanelContext, SeriesVisibilityChangeMode, VizLegendOptions } from '@grafana/ui';\nimport { config, getAppEvents, getPluginImportUtils } from '@grafana/runtime';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { DeepPartial, SceneObject, SceneObjectState } from '../../core/types';\n\nimport { VizPanelRenderer } from './VizPanelRenderer';\nimport { VizPanelMenu } from './VizPanelMenu';\nimport { VariableDependencyConfig } from '../../variables/VariableDependencyConfig';\nimport { VariableCustomFormatterFn } from '../../variables/types';\nimport { seriesVisibilityConfigFactory } from './seriesVisibilityConfigFactory';\nimport { emptyPanelData } from '../../core/SceneDataNode';\nimport { changeSeriesColorConfigFactory } from './colorSeriesConfigFactory';\nimport { loadPanelPluginSync } from './registerRuntimePanelPlugin';\nimport { getCursorSyncScope } from '../../behaviors/CursorSync';\nimport { cloneDeep, isArray, isEmpty, merge, mergeWith } from 'lodash';\nimport { UserActionEvent } from '../../core/events';\nimport { evaluateTimeRange } from '../../utils/evaluateTimeRange';\nimport { LiveNowTimer } from '../../behaviors/LiveNowTimer';\n\nexport interface VizPanelState<TOptions = {}, TFieldConfig = {}> extends SceneObjectState {\n /**\n * This is usually a plugin id that references a core plugin or an external plugin. But this can also reference a\n * runtime registered PanelPlugin registered via function registerScenePanelPlugin.\n */\n pluginId: string;\n title: string;\n description?: string;\n options: DeepPartial<TOptions>;\n fieldConfig: FieldConfigSource<DeepPartial<TFieldConfig>>;\n pluginVersion?: string;\n displayMode?: 'default' | 'transparent';\n /**\n * Only shows header on hover, absolutly positioned above the panel.\n */\n hoverHeader?: boolean;\n /**\n * Offset hoverHeader position on the y axis\n */\n hoverHeaderOffset?: number;\n /**\n * Defines a menu in the top right of the panel. The menu object is only activated when the dropdown menu itself is shown.\n * So the best way to add dynamic menu actions and links is by adding them in a behavior attached to the menu.\n */\n menu?: VizPanelMenu;\n /**\n * Defines a menu that renders panel link.\n **/\n titleItems?: React.ReactNode | SceneObject | SceneObject[];\n /**\n * Add action to the top right panel header\n */\n headerActions?: React.ReactNode | SceneObject | SceneObject[];\n /**\n * Mainly for advanced use cases that need custom handling of PanelContext callbacks.\n */\n extendPanelContext?: (vizPanel: VizPanel, context: PanelContext) => void;\n /**\n * @internal\n * Only for use from core to handle migration from old angular panels\n **/\n _UNSAFE_customMigrationHandler?: (panel: PanelModel, plugin: PanelPlugin) => void;\n /** Internal */\n _pluginLoadError?: string;\n /** Internal */\n _pluginInstanceState?: any;\n}\n\nexport class VizPanel<TOptions = {}, TFieldConfig extends {} = {}> extends SceneObjectBase<\n VizPanelState<TOptions, TFieldConfig>\n> {\n public static Component = VizPanelRenderer;\n\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['title', 'options', 'fieldConfig'],\n });\n\n // Not part of state as this is not serializable\n protected _panelContext?: PanelContext;\n private _plugin?: PanelPlugin;\n private _prevData?: PanelData;\n private _dataWithFieldConfig?: PanelData;\n private _structureRev: number = 0;\n\n public constructor(state: Partial<VizPanelState<TOptions, TFieldConfig>>) {\n super({\n options: {} as TOptions,\n fieldConfig: { defaults: {}, overrides: [] },\n title: 'Title',\n pluginId: 'timeseries',\n ...state,\n });\n\n this.addActivationHandler(() => {\n this._onActivate();\n });\n\n state.menu?.addActivationHandler(() => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-menu-shown' }), true);\n });\n }\n\n private _onActivate() {\n if (!this._plugin) {\n this._loadPlugin(this.state.pluginId);\n }\n }\n\n private async _loadPlugin(pluginId: string, overwriteOptions?: DeepPartial<{}>, overwriteFieldConfig?: FieldConfigSource, isAfterPluginChange?: boolean) {\n const plugin = loadPanelPluginSync(pluginId);\n\n if (plugin) {\n this._pluginLoaded(plugin, overwriteOptions, overwriteFieldConfig, isAfterPluginChange);\n } else {\n const { importPanelPlugin } = getPluginImportUtils();\n\n try {\n const result = await importPanelPlugin(pluginId);\n this._pluginLoaded(result, overwriteOptions, overwriteFieldConfig, isAfterPluginChange);\n } catch (err: unknown) {\n this._pluginLoaded(getPanelPluginNotFound(pluginId));\n\n if (err instanceof Error) {\n this.setState({ _pluginLoadError: err.message });\n }\n }\n }\n }\n\n public getLegacyPanelId() {\n const panelId = parseInt(this.state.key!.replace('panel-', ''), 10);\n if (isNaN(panelId)) {\n return 0;\n }\n\n return panelId;\n }\n\n private async _pluginLoaded(plugin: PanelPlugin, overwriteOptions?: DeepPartial<{}>, overwriteFieldConfig?: FieldConfigSource, isAfterPluginChange?: boolean) {\n const { options, fieldConfig, title, pluginVersion, _UNSAFE_customMigrationHandler } = this.state;\n\n const panel: PanelModel = {\n title,\n options,\n fieldConfig,\n id: this.getLegacyPanelId(),\n type: plugin.meta.id,\n pluginVersion: pluginVersion,\n };\n\n if (overwriteOptions) {\n panel.options = overwriteOptions;\n }\n\n if (overwriteFieldConfig) {\n panel.fieldConfig = overwriteFieldConfig;\n }\n\n const currentVersion = this._getPluginVersion(plugin);\n\n _UNSAFE_customMigrationHandler?.(panel, plugin);\n\n if (plugin.onPanelMigration && currentVersion !== this.state.pluginVersion) {\n // These migration handlers also mutate panel.fieldConfig to migrate fieldConfig\n panel.options = await plugin.onPanelMigration(panel);\n }\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin,\n currentOptions: panel.options,\n currentFieldConfig: panel.fieldConfig,\n isAfterPluginChange: isAfterPluginChange ?? false,\n });\n\n this._plugin = plugin;\n\n this.setState({\n options: withDefaults.options as DeepPartial<TOptions>,\n fieldConfig: withDefaults.fieldConfig,\n pluginVersion: currentVersion,\n pluginId: plugin.meta.id,\n });\n\n // Non data panels needs to be re-rendered when time range change\n if (plugin.meta.skipDataQuery) {\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n this._subs.add(sceneTimeRange.subscribeToState(() => this.forceRender()));\n }\n }\n\n private _getPluginVersion(plugin: PanelPlugin): string {\n return plugin && plugin.meta.info.version ? plugin.meta.info.version : config.buildInfo.version;\n }\n\n public getPlugin(): PanelPlugin | undefined {\n return this._plugin;\n }\n\n public getPanelContext(): PanelContext {\n this._panelContext ??= this.buildPanelContext();\n\n return this._panelContext!;\n }\n\n public onTimeRangeChange = (timeRange: AbsoluteTimeRange) => {\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n sceneTimeRange.onTimeRangeChange({\n raw: {\n from: toUtc(timeRange.from),\n to: toUtc(timeRange.to),\n },\n from: toUtc(timeRange.from),\n to: toUtc(timeRange.to),\n });\n };\n\n public getTimeRange = (data?: PanelData) => {\n const liveNowTimer = sceneGraph.findObject(this, (o) => o instanceof LiveNowTimer);\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n if (liveNowTimer instanceof LiveNowTimer && liveNowTimer.isEnabled) {\n return evaluateTimeRange(\n sceneTimeRange.state.from,\n sceneTimeRange.state.to,\n sceneTimeRange.getTimeZone(),\n sceneTimeRange.state.fiscalYearStartMonth,\n sceneTimeRange.state.UNSAFE_nowDelay\n );\n }\n\n const plugin = this.getPlugin();\n if (plugin && !plugin.meta.skipDataQuery && data && data.timeRange) {\n return data.timeRange;\n }\n\n return sceneTimeRange.state.value;\n };\n\n public async changePluginType(pluginId: string, newOptions?: DeepPartial<{}>, newFieldConfig?: FieldConfigSource) {\n const {\n options: prevOptions,\n fieldConfig: prevFieldConfig,\n pluginId: prevPluginId,\n } = this.state;\n\n //clear field config cache to update it later\n this._dataWithFieldConfig = undefined;\n\n await this._loadPlugin(pluginId, newOptions ?? {}, newFieldConfig, true);\n\n const panel: PanelModel = {\n title: this.state.title,\n options: this.state.options,\n fieldConfig: this.state.fieldConfig,\n id: 1,\n type: pluginId,\n };\n\n // onPanelTypeChanged is mainly used by plugins to migrate from Angular to React. \n // For example, this will migrate options from 'graph' to 'timeseries' if the previous and new plugin ID matches. \n const updatedOptions = this._plugin?.onPanelTypeChanged?.(panel, prevPluginId, prevOptions, prevFieldConfig);\n\n if (updatedOptions && !isEmpty(updatedOptions)) {\n this.onOptionsChange(updatedOptions, true, true);\n }\n }\n\n public onTitleChange = (title: string) => {\n this.setState({ title });\n };\n\n public onDescriptionChange = (description: string) => {\n this.setState({ description });\n };\n\n public onDisplayModeChange = (displayMode: 'default' | 'transparent') => {\n this.setState({ displayMode });\n };\n\n public onOptionsChange = (optionsUpdate: DeepPartial<TOptions>, replace = false, isAfterPluginChange = false) => {\n const { fieldConfig, options } = this.state;\n\n // When replace is true, we want to replace the entire options object. Default will be applied.\n const nextOptions = replace\n ? optionsUpdate\n : mergeWith(cloneDeep(options), optionsUpdate, (objValue, srcValue, key, obj) => {\n if (isArray(srcValue)) {\n return srcValue;\n }\n // If customizer returns undefined, merging is handled by the method instead\n // so we need to override the value in the object instead\n if (objValue !== srcValue && typeof srcValue === 'undefined') {\n obj[key] = srcValue;\n return;\n }\n return;\n });\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin: this._plugin!,\n currentOptions: nextOptions,\n currentFieldConfig: fieldConfig,\n isAfterPluginChange: isAfterPluginChange,\n });\n\n this.setState({\n options: withDefaults.options as DeepPartial<TOptions>,\n });\n };\n\n public onFieldConfigChange = (fieldConfigUpdate: FieldConfigSource<DeepPartial<TFieldConfig>>, replace?: boolean) => {\n const { fieldConfig, options } = this.state;\n\n // When replace is true, we want to replace the entire field config. Default will be applied.\n const nextFieldConfig = replace ? fieldConfigUpdate : merge(cloneDeep(fieldConfig), fieldConfigUpdate);\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin: this._plugin!,\n currentOptions: options,\n currentFieldConfig: nextFieldConfig,\n isAfterPluginChange: false,\n });\n\n this._dataWithFieldConfig = undefined;\n this.setState({ fieldConfig: withDefaults.fieldConfig });\n };\n\n public interpolate = ((value: string, scoped?: ScopedVars, format?: string | VariableCustomFormatterFn) => {\n return sceneGraph.interpolate(this, value, scoped, format);\n }) as InterpolateFunction;\n\n public getDescription = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-description-shown' }), true);\n\n const { description } = this.state;\n if (description) {\n const markdown = this.interpolate(description);\n return renderMarkdown(markdown);\n }\n return '';\n };\n\n public clearFieldConfigCache() {\n this._dataWithFieldConfig = undefined;\n }\n\n /**\n * Called from the react render path to apply the field config to the data provided by the data provider\n */\n public applyFieldConfig(rawData?: PanelData): PanelData {\n const plugin = this._plugin;\n\n if (!plugin || plugin.meta.skipDataQuery || !rawData) {\n // TODO setup time range subscription instead\n return emptyPanelData;\n }\n\n // If the data is the same as last time, we can skip the field config apply step and just return same result as last time\n if (this._prevData === rawData && this._dataWithFieldConfig) {\n return this._dataWithFieldConfig;\n }\n\n const pluginDataSupport: PanelPluginDataSupport = plugin.dataSupport || { alertStates: false, annotations: false };\n\n const fieldConfigRegistry = plugin.fieldConfigRegistry;\n const prevFrames = this._dataWithFieldConfig?.series ?? [];\n const newFrames = applyFieldOverrides({\n data: rawData.series,\n fieldConfig: this.state.fieldConfig,\n fieldConfigRegistry,\n replaceVariables: this.interpolate,\n theme: config.theme2,\n timeZone: rawData.request?.timezone,\n });\n\n if (!compareArrayValues(newFrames, prevFrames, compareDataFrameStructures)) {\n this._structureRev++;\n }\n\n this._dataWithFieldConfig = {\n ...rawData,\n structureRev: this._structureRev,\n series: newFrames,\n };\n\n if (this._dataWithFieldConfig.annotations) {\n this._dataWithFieldConfig.annotations = applyFieldOverrides({\n data: this._dataWithFieldConfig.annotations,\n fieldConfig: {\n defaults: {},\n overrides: [],\n },\n fieldConfigRegistry,\n replaceVariables: this.interpolate,\n theme: config.theme2,\n timeZone: rawData.request?.timezone,\n });\n }\n\n if (!pluginDataSupport.alertStates) {\n this._dataWithFieldConfig.alertState = undefined;\n }\n\n if (!pluginDataSupport.annotations) {\n this._dataWithFieldConfig.annotations = undefined;\n }\n\n this._prevData = rawData;\n return this._dataWithFieldConfig;\n }\n\n public onCancelQuery = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-cancel-query-clicked' }), true);\n const data = sceneGraph.getData(this);\n data.cancelQuery?.();\n };\n\n public onStatusMessageClick = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-status-message-clicked' }), true);\n };\n\n /**\n * Panel context functions\n */\n private _onSeriesColorChange = (label: string, color: string) => {\n this.onFieldConfigChange(changeSeriesColorConfigFactory(label, color, this.state.fieldConfig));\n };\n\n private _onSeriesVisibilityChange = (label: string, mode: SeriesVisibilityChangeMode) => {\n if (!this._dataWithFieldConfig) {\n return;\n }\n\n this.onFieldConfigChange(\n seriesVisibilityConfigFactory(label, mode, this.state.fieldConfig, this._dataWithFieldConfig.series),\n true\n );\n };\n\n private _onInstanceStateChange = (state: any) => {\n if (this._panelContext) {\n this._panelContext = {\n ...this._panelContext,\n instanceState: state,\n };\n }\n\n this.setState({ _pluginInstanceState: state });\n };\n\n private _onToggleLegendSort = (sortKey: string) => {\n const legendOptions: VizLegendOptions = (this.state.options as any).legend;\n\n // We don't want to do anything when legend options are not available\n if (!legendOptions) {\n return;\n }\n\n let sortDesc = legendOptions.sortDesc;\n let sortBy = legendOptions.sortBy;\n if (sortKey !== sortBy) {\n sortDesc = undefined;\n }\n\n // if already sort ascending, disable sorting\n if (sortDesc === false) {\n sortBy = undefined;\n sortDesc = undefined;\n } else {\n sortDesc = !sortDesc;\n sortBy = sortKey;\n }\n\n this.onOptionsChange(\n {\n ...this.state.options,\n legend: { ...legendOptions, sortBy, sortDesc },\n } as TOptions,\n true\n );\n };\n\n private buildPanelContext(): PanelContext {\n const sync = getCursorSyncScope(this);\n\n const context = {\n eventsScope: sync ? sync.getEventsScope() : '__global_',\n eventBus: sync ? sync.getEventsBus(this) : getAppEvents(),\n app: CoreApp.Unknown,\n sync: () => {\n if (sync) {\n return sync.state.sync;\n }\n return DashboardCursorSync.Off;\n },\n onSeriesColorChange: this._onSeriesColorChange,\n onToggleSeriesVisibility: this._onSeriesVisibilityChange,\n onToggleLegendSort: this._onToggleLegendSort,\n onInstanceStateChange: this._onInstanceStateChange,\n };\n\n if (this.state.extendPanelContext) {\n this.state.extendPanelContext(this, context);\n }\n\n return context;\n }\n}\n\nfunction getPanelPluginNotFound(id: string): PanelPlugin {\n const plugin = new PanelPlugin(() => null);\n\n plugin.meta = {\n id: id,\n name: id,\n sort: 100,\n type: PluginType.panel,\n module: '',\n baseUrl: '',\n info: {\n author: {\n name: '',\n },\n description: '',\n links: [],\n logos: {\n large: '',\n small: 'public/img/grafana_icon.svg',\n },\n screenshots: [],\n updated: '',\n version: '',\n },\n };\n\n return plugin;\n}\n","import { VizPanel } from '../components/VizPanel/VizPanel';\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneObjectState } from '../core/types';\n\ninterface LiveNowTimerState extends SceneObjectState {\n enabled: boolean;\n}\n\nexport class LiveNowTimer extends SceneObjectBase<LiveNowTimerState> {\n private timerId: number | undefined = undefined;\n private static REFRESH_RATE = 100; // ms\n\n public constructor({ enabled = false }) {\n super({ enabled });\n this.addActivationHandler(this._activationHandler);\n }\n\n private _activationHandler = () => {\n if (this.state.enabled) {\n this.enable();\n }\n\n return () => {\n window.clearInterval(this.timerId);\n this.timerId = undefined;\n };\n };\n\n public enable() {\n window.clearInterval(this.timerId);\n this.timerId = undefined;\n this.timerId = window.setInterval(() => {\n const panels = sceneGraph.findAllObjects(this.getRoot(), (obj) => obj instanceof VizPanel) as VizPanel[];\n for (const panel of panels) {\n panel.forceRender();\n }\n }, LiveNowTimer.REFRESH_RATE);\n this.setState({ enabled: true });\n }\n\n public disable() {\n window.clearInterval(this.timerId);\n this.timerId = undefined;\n this.setState({ enabled: false });\n }\n\n public get isEnabled() {\n return this.state.enabled;\n }\n}\n","import { isFetchError } from '@grafana/runtime';\n\nexport function getMessageFromError(err: unknown): string {\n if (typeof err === 'string') {\n return err;\n }\n\n if (err) {\n if (err instanceof Error) {\n return err.message;\n } else if (isFetchError(err)) {\n if (err.data && err.data.message) {\n return err.data.message;\n } else if (err.statusText) {\n return err.statusText;\n }\n } else if (err.hasOwnProperty('message')) {\n // @ts-expect-error\n return err.message;\n }\n }\n\n return JSON.stringify(err);\n}\n","import { PanelData } from '@grafana/data';\nimport { ReplaySubject, Unsubscribable } from 'rxjs';\nimport { emptyPanelData } from '../../core/SceneDataNode';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport {\n CancelActivationHandler,\n SceneDataLayerProvider,\n SceneDataProviderResult,\n SceneDataLayerProviderState,\n} from '../../core/types';\nimport { setBaseClassState } from '../../utils/utils';\nimport { writeSceneLog } from '../../utils/writeSceneLog';\nimport { VariableDependencyConfig } from '../../variables/VariableDependencyConfig';\nimport { VariableValueRecorder } from '../../variables/VariableValueRecorder';\n\n/**\n * Base class for data layer. Handles common implementation including enabling/disabling layer and publishing results.\n */\nexport abstract class SceneDataLayerBase<T extends SceneDataLayerProviderState>\n extends SceneObjectBase<T>\n implements SceneDataLayerProvider\n{\n /**\n * Subscription to query results. Should be set when layer runs a query.\n */\n protected querySub?: Unsubscribable;\n\n /**\n * Subject to emit results to.\n */\n private _results = new ReplaySubject<SceneDataProviderResult>(1);\n\n /**\n * Implement logic for enabling the layer. This is called when layer is enabled or when layer is enabled when activated.\n * Use i.e. to setup subscriptions that will trigger layer updates.\n */\n public abstract onEnable(): void;\n\n /**\n * Implement logic for disabling the layer. This is called when layer is disabled.\n * Use i.e. to unsubscribe from subscriptions that trigger layer updates.\n */\n public abstract onDisable(): void;\n\n /**\n * Implement logic running the layer and setting up the querySub subscription.\n */\n protected abstract runLayer(): void;\n\n /**\n * Mark data provider as data layer\n */\n public isDataLayer: true = true;\n\n private _variableValueRecorder = new VariableValueRecorder();\n\n protected _variableDependency: VariableDependencyConfig<T> = new VariableDependencyConfig(this, {\n onVariableUpdateCompleted: this.onVariableUpdateCompleted.bind(this),\n });\n\n /**\n * For variables support in data layer provide variableDependencyStatePaths with keys of the state to be scanned for variables.\n */\n public constructor(initialState: T, variableDependencyStatePaths: Array<keyof T> = []) {\n super({\n isEnabled: true,\n ...initialState,\n });\n\n this._variableDependency.setPaths(variableDependencyStatePaths);\n this.addActivationHandler(() => this.onActivate());\n }\n\n protected onActivate(): CancelActivationHandler {\n if (this.state.isEnabled) {\n this.onEnable();\n }\n\n if (this.shouldRunLayerOnActivate()) {\n this.runLayer();\n }\n\n // Subscribe to layer state changes and enable/disable layer accordingly.\n this.subscribeToState((n, p) => {\n if (!n.isEnabled && this.querySub) {\n // When layer disabled, cancel query and call onDisable that should publish empty results.\n this.querySub.unsubscribe();\n this.querySub = undefined;\n this.onDisable();\n\n // Manually publishing the results to state and results stream as publishPublish results has a guard for the layer to be enabled.\n this._results.next({ origin: this, data: emptyPanelData });\n\n this.setStateHelper({ data: emptyPanelData });\n }\n\n if (n.isEnabled && !p.isEnabled) {\n // When layer enabled, run queries.\n this.onEnable();\n this.runLayer();\n }\n });\n\n return () => {\n this.onDeactivate();\n };\n }\n\n protected onDeactivate(): void {\n if (this.querySub) {\n this.querySub.unsubscribe();\n this.querySub = undefined;\n }\n\n this.onDisable();\n\n this._variableValueRecorder.recordCurrentDependencyValuesForSceneObject(this);\n }\n\n protected onVariableUpdateCompleted(): void {\n this.runLayer();\n }\n\n public cancelQuery() {\n if (this.querySub) {\n this.querySub.unsubscribe();\n this.querySub = undefined;\n\n this.publishResults(emptyPanelData);\n }\n }\n\n protected publishResults(data: PanelData) {\n if (this.state.isEnabled) {\n this._results.next({ origin: this, data });\n this.setStateHelper({ data });\n }\n }\n\n public getResultsStream() {\n return this._results;\n }\n\n private shouldRunLayerOnActivate() {\n if (!this.state.isEnabled) {\n return false;\n }\n\n if (this._variableValueRecorder.hasDependenciesChanged(this)) {\n writeSceneLog(\n 'SceneDataLayerBase',\n 'Variable dependency changed while inactive, shouldRunLayerOnActivate returns true'\n );\n return true;\n }\n\n if (!this.state.data) {\n return true;\n }\n\n return false;\n }\n\n /**\n * This helper function is to counter the contravariance of setState\n */\n private setStateHelper(state: Partial<SceneDataLayerProviderState>) {\n setBaseClassState<SceneDataLayerProviderState>(this, state);\n }\n}\n","import { css } from '@emotion/css';\nimport { LoadingState } from '@grafana/schema';\nimport { InlineSwitch } from '@grafana/ui';\nimport React from 'react';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneDataLayerProvider, SceneObjectState } from '../../core/types';\nimport { ControlsLabel } from '../../utils/ControlsLabel';\n\ninterface SceneDataLayerControlsState extends SceneObjectState {}\n\nexport class SceneDataLayerControls extends SceneObjectBase<SceneDataLayerControlsState> {\n public static Component = SceneDataLayerControlsRenderer;\n\n public constructor() {\n super({});\n }\n}\n\nfunction SceneDataLayerControlsRenderer({ model }: SceneComponentProps<SceneDataLayerControls>) {\n const layers = sceneGraph.getDataLayers(model, true);\n\n if (layers.length === 0) {\n return null;\n }\n\n return (\n <>\n {layers.map((layer) => (\n <layer.Component model={layer} key={layer.state.key} />\n ))}\n </>\n );\n}\n\ninterface SceneDataLayerControlProps {\n layer: SceneDataLayerProvider;\n}\n\nexport function DataLayerControlSwitch({ layer }: SceneDataLayerControlProps) {\n const elementId = `data-layer-${layer.state.key}`;\n const { data, isEnabled } = layer.useState();\n const showLoading = Boolean(data && data.state === LoadingState.Loading);\n\n return (\n <div className={containerStyle}>\n <ControlsLabel\n htmlFor={elementId}\n isLoading={showLoading}\n onCancel={() => layer.cancelQuery?.()}\n label={layer.state.name}\n description={layer.state.description}\n error={layer.state.data?.errors?.[0].message}\n />\n <InlineSwitch id={elementId} value={isEnabled} onChange={() => layer.setState({ isEnabled: !isEnabled })} />\n </div>\n );\n}\n\nconst containerStyle = css({ display: 'flex' });\n","import { isString } from 'lodash';\nimport { Observable, of, OperatorFunction } from 'rxjs';\nimport { map, mergeMap } from 'rxjs/operators';\n\nimport {\n AnnotationEvent,\n AnnotationEventFieldSource,\n AnnotationEventMappings,\n AnnotationQuery,\n AnnotationSupport,\n DataFrame,\n DataSourceApi,\n DataTransformContext,\n Field,\n FieldType,\n getFieldDisplayName,\n KeyValue,\n standardTransformers,\n} from '@grafana/data';\nimport { config } from '@grafana/runtime';\n\nexport const standardAnnotationSupport: AnnotationSupport = {\n /**\n * Assume the stored value is standard model.\n */\n prepareAnnotation: (json: any) => {\n if (isString(json?.query)) {\n const { query, ...rest } = json;\n return {\n ...rest,\n target: {\n refId: 'annotation_query',\n query,\n },\n mappings: {},\n };\n }\n return json as AnnotationQuery;\n },\n\n /**\n * Default will just return target from the annotation.\n */\n prepareQuery: (anno: AnnotationQuery) => anno.target,\n\n /**\n * Provides default processing from dataFrame to annotation events.\n */\n processEvents: (anno: AnnotationQuery, data: DataFrame[]) => {\n return getAnnotationsFromData(data, anno.mappings);\n },\n};\n\n/**\n * Flatten all frames into a single frame with mergeTransformer.\n */\n\nexport function singleFrameFromPanelData(): OperatorFunction<DataFrame[], DataFrame | undefined> {\n return (source) =>\n source.pipe(\n mergeMap((data) => {\n if (!data?.length) {\n return of(undefined);\n }\n\n if (data.length === 1) {\n return of(data[0]);\n }\n\n const ctx: DataTransformContext = {\n interpolate: (v: string) => v,\n };\n\n return of(data).pipe(\n standardTransformers.mergeTransformer.operator({}, ctx),\n map((d) => d[0])\n );\n })\n );\n}\n\ninterface AnnotationEventFieldSetter {\n key: keyof AnnotationEvent;\n field?: Field;\n text?: string;\n regex?: RegExp;\n split?: string; // for tags\n}\n\nexport interface AnnotationFieldInfo {\n key: keyof AnnotationEvent;\n\n split?: string;\n field?: (frame: DataFrame) => Field | undefined;\n placeholder?: string;\n help?: string;\n}\n\n// These fields get added to the standard UI\nexport const annotationEventNames: AnnotationFieldInfo[] = [\n {\n key: 'time',\n field: (frame: DataFrame) => frame.fields.find((f) => f.type === FieldType.time),\n placeholder: 'time, or the first time field',\n },\n { key: 'timeEnd', help: 'When this field is defined, the annotation will be treated as a range' },\n {\n key: 'title',\n },\n {\n key: 'text',\n field: (frame: DataFrame) => frame.fields.find((f) => f.type === FieldType.string),\n placeholder: 'text, or the first text field',\n },\n { key: 'tags', split: ',', help: 'The results will be split on comma (,)' },\n {\n key: 'id',\n },\n];\n\nexport const publicDashboardEventNames: AnnotationFieldInfo[] = [\n {\n key: 'color',\n },\n {\n key: 'isRegion',\n },\n {\n key: 'source',\n },\n];\n\n// Given legacy infrastructure, alert events are passed though the same annotation\n// pipeline, but include fields that should not be exposed generally\nconst alertEventAndAnnotationFields: AnnotationFieldInfo[] = [\n ...(config.publicDashboardAccessToken ? publicDashboardEventNames : []),\n ...annotationEventNames,\n { key: 'userId' },\n { key: 'login' },\n { key: 'email' },\n { key: 'prevState' },\n { key: 'newState' },\n { key: 'data' as any },\n { key: 'panelId' },\n { key: 'alertId' },\n { key: 'dashboardId' },\n { key: 'dashboardUID' },\n];\n\nexport function getAnnotationsFromData(\n data: DataFrame[],\n options?: AnnotationEventMappings\n): Observable<AnnotationEvent[]> {\n return of(data).pipe(\n singleFrameFromPanelData(),\n map((frame) => {\n if (!frame?.length) {\n return [];\n }\n\n let hasTime = false;\n let hasText = false;\n const byName: KeyValue<Field> = {};\n\n for (const f of frame.fields) {\n const name = getFieldDisplayName(f, frame);\n byName[name.toLowerCase()] = f;\n }\n\n if (!options) {\n options = {};\n }\n\n const fields: AnnotationEventFieldSetter[] = [];\n\n for (const evts of alertEventAndAnnotationFields) {\n const opt = options[evts.key] || {}; //AnnotationEventFieldMapping\n\n if (opt.source === AnnotationEventFieldSource.Skip) {\n continue;\n }\n\n const setter: AnnotationEventFieldSetter = { key: evts.key, split: evts.split };\n\n if (opt.source === AnnotationEventFieldSource.Text) {\n setter.text = opt.value;\n } else {\n const lower = (opt.value || evts.key).toLowerCase();\n setter.field = byName[lower];\n\n if (!setter.field && evts.field) {\n setter.field = evts.field(frame);\n }\n }\n\n if (setter.field || setter.text) {\n fields.push(setter);\n if (setter.key === 'time') {\n hasTime = true;\n } else if (setter.key === 'text') {\n hasText = true;\n }\n }\n }\n\n if (!hasTime || !hasText) {\n console.error('Cannot process annotation fields. No time or text present.');\n return [];\n }\n\n // Add each value to the string\n const events: AnnotationEvent[] = [];\n\n for (let i = 0; i < frame.length; i++) {\n const anno: AnnotationEvent = {\n type: 'default',\n color: 'red',\n };\n\n for (const f of fields) {\n let v: any = undefined;\n\n if (f.text) {\n v = f.text; // TODO support templates!\n } else if (f.field) {\n v = f.field.values.get(i);\n if (v !== undefined && f.regex) {\n const match = f.regex.exec(v);\n if (match) {\n v = match[1] ? match[1] : match[0];\n }\n }\n }\n\n if (v !== null && v !== undefined) {\n if (f.split && typeof v === 'string') {\n v = v.split(',');\n }\n (anno as any)[f.key] = v;\n }\n }\n\n events.push(anno);\n }\n return events;\n })\n );\n}\n\n// These opt outs are here only for quicker and easier migration to react based annotations editors and because\n// annotation support API needs some work to support less \"standard\" editors like prometheus and here it is not\n// polluting public API.\n\nconst legacyRunner = [\n 'prometheus',\n 'loki',\n 'elasticsearch',\n 'grafana-opensearch-datasource', // external\n];\n\n/**\n * Use legacy runner. Used only as an escape hatch for easier transition to React based annotation editor.\n */\nexport function shouldUseLegacyRunner(datasource: DataSourceApi): boolean {\n const { type } = datasource;\n return !datasource.annotations || legacyRunner.includes(type);\n}\n","import { from, Observable, of } from 'rxjs';\nimport { map, mergeMap } from 'rxjs/operators';\n\nimport {\n AnnotationEvent,\n AnnotationQuery,\n CoreApp,\n DataQueryRequest,\n DataSourceApi,\n DataTopic,\n PanelModel,\n rangeUtil,\n ScopedVars,\n} from '@grafana/data';\n\nimport { getRunRequest } from '@grafana/runtime';\nimport { shouldUseLegacyRunner, standardAnnotationSupport } from './standardAnnotationsSupport';\nimport { Dashboard, LoadingState } from '@grafana/schema';\nimport { SceneObject, SceneTimeRangeLike } from '../../../core/types';\nimport { getEnrichedDataRequest } from '../../getEnrichedDataRequest';\nimport { wrapInSafeSerializableSceneObject } from '../../../utils/wrapInSafeSerializableSceneObject';\n\nlet counter = 100;\nfunction getNextRequestId() {\n return 'AQ' + counter++;\n}\n\nexport interface AnnotationQueryOptions {\n dashboard: Dashboard;\n panel: PanelModel;\n}\n\nexport interface AnnotationQueryResults {\n state: LoadingState;\n events: AnnotationEvent[];\n}\n\nexport function executeAnnotationQuery(\n datasource: DataSourceApi,\n timeRange: SceneTimeRangeLike,\n query: AnnotationQuery,\n layer: SceneObject\n): Observable<AnnotationQueryResults> {\n // Check if we should use the old annotationQuery method\n if (datasource.annotationQuery && shouldUseLegacyRunner(datasource)) {\n console.warn('Using deprecated annotationQuery method, please upgrade your datasource');\n return from(\n datasource.annotationQuery({\n range: timeRange.state.value,\n rangeRaw: timeRange.state.value.raw,\n annotation: query,\n dashboard: {},\n })\n ).pipe(\n map((events) => ({\n state: LoadingState.Done,\n events,\n }))\n );\n }\n\n // Standard API for annotations support. Spread in datasource annotations support overrides\n const processor = {\n ...standardAnnotationSupport,\n ...datasource.annotations,\n };\n\n const annotationWithDefaults = {\n // Default query provided by a data source\n ...processor.getDefaultQuery?.(),\n ...query,\n };\n\n // Data source query migrations\n const annotation = processor.prepareAnnotation!(annotationWithDefaults);\n if (!annotation) {\n return of({\n state: LoadingState.Done,\n events: [],\n });\n }\n\n const processedQuery = processor.prepareQuery!(annotation);\n if (!processedQuery) {\n return of({\n state: LoadingState.Done,\n events: [],\n });\n }\n\n // No more points than pixels\n const maxDataPoints = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n\n // Add interval to annotation queries\n const interval = rangeUtil.calculateInterval(timeRange.state.value, maxDataPoints, datasource.interval);\n\n const scopedVars: ScopedVars = {\n __interval: { text: interval.interval, value: interval.interval },\n __interval_ms: { text: interval.intervalMs.toString(), value: interval.intervalMs },\n __annotation: { text: annotation.name, value: annotation },\n __sceneObject: wrapInSafeSerializableSceneObject(layer),\n };\n\n const queryRequest: DataQueryRequest = {\n startTime: Date.now(),\n requestId: getNextRequestId(),\n range: timeRange.state.value,\n maxDataPoints,\n scopedVars,\n ...interval,\n app: CoreApp.Dashboard,\n timezone: timeRange.getTimeZone(),\n targets: [\n {\n ...processedQuery,\n refId: 'Anno',\n },\n ],\n ...getEnrichedDataRequest(layer),\n };\n\n const runRequest = getRunRequest();\n\n return runRequest(datasource, queryRequest).pipe(\n mergeMap((panelData) => {\n // Some annotations set the topic already\n const data = panelData?.series.length ? panelData.series : panelData.annotations;\n\n if (!data?.length) {\n return of({\n state: panelData.state,\n events: [],\n });\n }\n\n // Add data topic to each frame\n data.forEach((frame) => {\n // If data topic has not been provided by the data source, make sure it's set correctly\n if (!frame.meta?.dataTopic) {\n frame.meta = { ...(frame.meta || {}), dataTopic: DataTopic.Annotations };\n }\n });\n\n return processor.processEvents!(annotation, data).pipe(\n map((events) => {\n return {\n state: panelData.state,\n events: events || [],\n };\n })\n );\n })\n );\n}\n","// These opt outs are here only for quicker and easier migration to react based annotations editors and because\n// annotation support API needs some work to support less \"standard\" editors like prometheus and here it is not\n// polluting public API.\n\nimport { AnnotationEvent, AnnotationQuery, DataSourceApi } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { cloneDeep, concat, every, find, groupBy, head, map, partition } from 'lodash';\n\nconst legacyRunner = [\n 'prometheus',\n 'loki',\n 'elasticsearch',\n 'grafana-opensearch-datasource', // external\n];\n\n/**\n * Use legacy runner. Used only as an escape hatch for easier transition to React based annotation editor.\n */\nexport function shouldUseLegacyRunner(datasource: DataSourceApi): boolean {\n const { type } = datasource;\n return !datasource.annotations || legacyRunner.includes(type);\n}\n\nexport function postProcessQueryResult(annotation: AnnotationQuery, results: AnnotationEvent[]): AnnotationEvent[] {\n // if annotation has snapshotData\n // make clone and remove it\n if (annotation.snapshotData) {\n annotation = cloneDeep(annotation);\n delete annotation.snapshotData;\n }\n\n //\n const processed = results.map((item) => {\n const processedItem = { ...item };\n\n processedItem.source = annotation;\n processedItem.color = config.theme2.visualization.getColorByName(annotation.iconColor);\n processedItem.type = annotation.name;\n processedItem.isRegion = Boolean(processedItem.timeEnd && processedItem.time !== processedItem.timeEnd);\n\n switch (processedItem.newState?.toLowerCase()) {\n case 'pending':\n processedItem.color = 'yellow';\n break;\n case 'alerting':\n processedItem.color = 'red';\n break;\n case 'ok':\n processedItem.color = 'green';\n break;\n case 'normal': // ngalert (\"normal\" instead of \"ok\")\n processedItem.color = 'green';\n break;\n case 'no_data':\n processedItem.color = 'gray';\n break;\n case 'nodata': // ngalert\n processedItem.color = 'gray';\n break;\n }\n\n return processedItem;\n });\n\n return processed;\n}\n\nexport function dedupAnnotations(annotations: any) {\n let dedup = [];\n\n // Split events by annotationId property existence\n const events = partition(annotations, 'id');\n\n const eventsById = groupBy(events[0], 'id');\n dedup = map(eventsById, (eventGroup) => {\n if (eventGroup.length > 1 && !every(eventGroup, isPanelAlert)) {\n // Get first non-panel alert\n return find(eventGroup, (event) => {\n return event.eventType !== 'panel-alert';\n });\n } else {\n return head(eventGroup);\n }\n });\n\n dedup = concat(dedup, events[1]);\n return dedup;\n}\n\nfunction isPanelAlert(event: { eventType: string }) {\n return event.eventType === 'panel-alert';\n}\n","import { arrayToDataFrame, DataTopic, AnnotationQuery, ScopedVars, PanelData } from '@grafana/data';\nimport { LoadingState } from '@grafana/schema';\nimport React from 'react';\nimport { map, Unsubscribable } from 'rxjs';\nimport { emptyPanelData } from '../../../core/SceneDataNode';\nimport { sceneGraph } from '../../../core/sceneGraph';\nimport {\n SceneComponentProps,\n SceneDataLayerProvider,\n SceneDataLayerProviderState,\n SceneTimeRangeLike,\n} from '../../../core/types';\nimport { getDataSource } from '../../../utils/getDataSource';\nimport { getMessageFromError } from '../../../utils/getMessageFromError';\nimport { writeSceneLog } from '../../../utils/writeSceneLog';\nimport { registerQueryWithController } from '../../registerQueryWithController';\nimport { SceneDataLayerBase } from '../SceneDataLayerBase';\nimport { DataLayerControlSwitch } from '../SceneDataLayerControls';\nimport { AnnotationQueryResults, executeAnnotationQuery } from './standardAnnotationQuery';\nimport { dedupAnnotations, postProcessQueryResult } from './utils';\nimport { wrapInSafeSerializableSceneObject } from '../../../utils/wrapInSafeSerializableSceneObject';\n\ninterface AnnotationsDataLayerState extends SceneDataLayerProviderState {\n query: AnnotationQuery;\n}\n\nexport class AnnotationsDataLayer\n extends SceneDataLayerBase<AnnotationsDataLayerState>\n implements SceneDataLayerProvider\n{\n static Component = AnnotationsDataLayerRenderer;\n\n private _scopedVars: ScopedVars = {\n __sceneObject: wrapInSafeSerializableSceneObject(this),\n };\n private _timeRangeSub: Unsubscribable | undefined;\n\n public constructor(initialState: AnnotationsDataLayerState) {\n super(\n {\n isEnabled: true,\n ...initialState,\n },\n ['query']\n );\n }\n\n public onEnable(): void {\n const timeRange = sceneGraph.getTimeRange(this);\n\n this._timeRangeSub = timeRange.subscribeToState(() => {\n this.runWithTimeRange(timeRange);\n });\n }\n\n public onDisable(): void {\n this._timeRangeSub?.unsubscribe();\n }\n\n public runLayer() {\n writeSceneLog('AnnotationsDataLayer', 'run layer');\n const timeRange = sceneGraph.getTimeRange(this);\n this.runWithTimeRange(timeRange);\n }\n\n private async runWithTimeRange(timeRange: SceneTimeRangeLike) {\n const { query } = this.state;\n\n if (this.querySub) {\n this.querySub.unsubscribe();\n }\n\n if (this._variableDependency.hasDependencyInLoadingState()) {\n writeSceneLog('AnnotationsDataLayer', 'Variable dependency is in loading state, skipping query execution');\n return;\n }\n\n try {\n const ds = await this.resolveDataSource(query);\n\n let stream = executeAnnotationQuery(ds, timeRange, query, this).pipe(\n registerQueryWithController({\n type: 'annotations',\n origin: this,\n cancel: () => this.cancelQuery(),\n }),\n map((events) => {\n const stateUpdate = this.processEvents(query, events);\n return stateUpdate;\n })\n );\n\n this.querySub = stream.subscribe((stateUpdate) => {\n this.publishResults(stateUpdate);\n });\n } catch (e) {\n this.publishResults({\n ...emptyPanelData,\n state: LoadingState.Error,\n errors: [\n {\n message: getMessageFromError(e),\n },\n ],\n });\n console.error('AnnotationsDataLayer error', e);\n }\n }\n\n protected async resolveDataSource(query: AnnotationQuery) {\n return await getDataSource(query.datasource || undefined, this._scopedVars);\n }\n\n protected processEvents(query: AnnotationQuery, events: AnnotationQueryResults): PanelData {\n let processedEvents = postProcessQueryResult(query, events.events || []);\n processedEvents = dedupAnnotations(processedEvents);\n\n const stateUpdate = { ...emptyPanelData, state: events.state };\n const df = arrayToDataFrame(processedEvents);\n\n df.meta = {\n ...df.meta,\n dataTopic: DataTopic.Annotations,\n };\n\n stateUpdate.series = [df];\n\n return stateUpdate;\n }\n}\n\nfunction AnnotationsDataLayerRenderer({ model }: SceneComponentProps<AnnotationsDataLayer>) {\n const { isHidden } = model.useState();\n\n if (isHidden) {\n return null;\n }\n\n return <DataLayerControlSwitch layer={model} />;\n}\n","import { TimeRange } from '@grafana/data';\nimport { TimeZone } from '@grafana/schema';\nimport { sceneGraph } from './sceneGraph';\nimport { SceneObjectBase } from './SceneObjectBase';\nimport { SceneTimeRangeLike, SceneTimeRangeState } from './types';\n\n/**\n * @internal\n * Used by SceneTimeZoneOverride and main repo PanelTimeRange.\n * Not recommened to be used by plugins directly.\n */\nexport abstract class SceneTimeRangeTransformerBase<T extends SceneTimeRangeState>\n extends SceneObjectBase<T>\n implements SceneTimeRangeLike\n{\n public constructor(state: T) {\n super(state);\n\n this.addActivationHandler(this._activationHandler);\n }\n\n protected getAncestorTimeRange() {\n if (!this.parent || !this.parent.parent) {\n throw new Error(typeof this + ' must be used within $timeRange scope');\n }\n\n return sceneGraph.getTimeRange(this.parent.parent);\n }\n\n private _activationHandler = () => {\n const ancestorTimeRange = this.getAncestorTimeRange();\n\n this.ancestorTimeRangeChanged(ancestorTimeRange.state);\n\n this._subs.add(ancestorTimeRange.subscribeToState((s) => this.ancestorTimeRangeChanged(s)));\n };\n\n protected abstract ancestorTimeRangeChanged(timeRange: SceneTimeRangeState): void;\n\n public getTimeZone(): TimeZone {\n return this.getAncestorTimeRange().getTimeZone();\n }\n\n public onTimeRangeChange(timeRange: TimeRange): void {\n this.getAncestorTimeRange().onTimeRangeChange(timeRange);\n }\n\n public onTimeZoneChange(timeZone: string): void {\n this.getAncestorTimeRange().onTimeZoneChange(timeZone);\n }\n\n public onRefresh(): void {\n this.getAncestorTimeRange().onRefresh();\n }\n}\n","import { TimeZone } from '@grafana/schema';\nimport { SceneTimeRangeLike, SceneTimeRangeState } from './types';\nimport { SceneTimeRangeTransformerBase } from './SceneTimeRangeTransformerBase';\nimport { getDefaultTimeRange } from '@grafana/data';\nimport { evaluateTimeRange } from '../utils/evaluateTimeRange';\n\ninterface SceneTimeZoneOverrideState extends SceneTimeRangeState {\n timeZone: TimeZone;\n}\n\nexport class SceneTimeZoneOverride\n extends SceneTimeRangeTransformerBase<SceneTimeZoneOverrideState>\n implements SceneTimeRangeLike\n{\n public constructor(state: Omit<SceneTimeZoneOverrideState, 'from' | 'to' | 'value'>) {\n super({\n ...state,\n timeZone: state.timeZone,\n // We set a default time range here. It will be overwritten on activation based on ancestor time range.\n from: 'now-6h',\n to: 'now',\n value: getDefaultTimeRange(),\n });\n }\n\n protected ancestorTimeRangeChanged(timeRange: SceneTimeRangeState): void {\n this.setState({\n ...timeRange,\n timeZone: this.state.timeZone,\n value: evaluateTimeRange(\n timeRange.from,\n timeRange.to,\n this.state.timeZone,\n timeRange.fiscalYearStartMonth,\n timeRange.UNSAFE_nowDelay\n ),\n });\n }\n\n public getTimeZone(): TimeZone {\n return this.state.timeZone;\n }\n\n public onTimeZoneChange(timeZone: string): void {\n this.setState({\n timeZone,\n value: evaluateTimeRange(\n this.state.from,\n this.state.to,\n this.state.timeZone,\n this.getAncestorTimeRange().state.fiscalYearStartMonth,\n this.state.UNSAFE_nowDelay\n ),\n });\n }\n}\n","import React from 'react';\nimport { DataFrame } from '@grafana/data';\nimport { Observable, ReplaySubject, Unsubscribable } from 'rxjs';\nimport { emptyPanelData } from '../core/SceneDataNode';\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport {\n SceneComponentProps,\n SceneDataLayerProvider,\n SceneDataLayerProviderState,\n SceneDataProviderResult,\n} from '../core/types';\nimport { DataLayersMerger } from './DataLayersMerger';\nimport { setBaseClassState } from '../utils/utils';\n\nexport abstract class SceneDataLayerSetBase<T extends SceneDataLayerProviderState>\n extends SceneObjectBase<T>\n implements SceneDataLayerProvider\n{\n /** Mark it as a data layer */\n public isDataLayer: true = true;\n\n /**\n * Subscription to query results. Should be set when layer runs a query.\n */\n protected querySub?: Unsubscribable;\n\n /**\n * Subject to emit results to.\n */\n private _results = new ReplaySubject<SceneDataProviderResult>(1);\n private _dataLayersMerger = new DataLayersMerger();\n\n protected subscribeToAllLayers(layers: SceneDataLayerProvider[]) {\n if (layers.length > 0) {\n this.querySub = this._dataLayersMerger.getMergedStream(layers).subscribe(this._onLayerUpdateReceived.bind(this));\n } else {\n this._results.next({ origin: this, data: emptyPanelData });\n this.setStateHelper({ data: emptyPanelData });\n }\n }\n\n private _onLayerUpdateReceived(results: Iterable<SceneDataProviderResult>) {\n let series: DataFrame[] = [];\n\n for (const result of results) {\n if (result.data?.series) {\n series = series.concat(result.data.series);\n }\n }\n\n const combinedData = { ...emptyPanelData, series: series };\n\n this._results.next({ origin: this, data: combinedData });\n this.setStateHelper({ data: combinedData });\n }\n\n public getResultsStream(): Observable<SceneDataProviderResult> {\n return this._results;\n }\n\n public cancelQuery() {\n this.querySub?.unsubscribe();\n }\n\n /**\n * This helper function is to counter the contravariance of setState\n */\n private setStateHelper(state: Partial<SceneDataLayerProviderState>) {\n setBaseClassState<SceneDataLayerProviderState>(this, state);\n }\n}\n\nexport interface SceneDataLayersSetState extends SceneDataLayerProviderState {\n layers: SceneDataLayerProvider[];\n}\n\nexport class SceneDataLayerSet\n extends SceneDataLayerSetBase<SceneDataLayersSetState>\n implements SceneDataLayerProvider\n{\n public constructor(state: Partial<SceneDataLayersSetState>) {\n super({\n name: state.name ?? 'Data layers',\n layers: state.layers ?? [],\n });\n\n this.addActivationHandler(() => this._onActivate());\n }\n\n private _onActivate() {\n this._subs.add(\n this.subscribeToState((newState, oldState) => {\n if (newState.layers !== oldState.layers) {\n this.querySub?.unsubscribe();\n this.subscribeToAllLayers(newState.layers);\n }\n })\n );\n\n this.subscribeToAllLayers(this.state.layers);\n\n return () => {\n this.querySub?.unsubscribe();\n };\n }\n\n public static Component = ({ model }: SceneComponentProps<SceneDataLayerSet>) => {\n const { layers } = model.useState();\n\n return (\n <>\n {layers.map((layer) => (\n <layer.Component model={layer} key={layer.state.key} />\n ))}\n </>\n );\n };\n}\n","import { DataTopic, DataTransformerConfig, LoadingState, PanelData, transformDataFrame } from '@grafana/data';\nimport { toDataQueryError } from '@grafana/runtime';\nimport { catchError, forkJoin, map, of, ReplaySubject, Unsubscribable } from 'rxjs';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { CustomTransformerDefinition, SceneDataProvider, SceneDataProviderResult, SceneDataState } from '../core/types';\nimport { VariableDependencyConfig } from '../variables/VariableDependencyConfig';\nimport { SceneDataLayerSet } from './SceneDataLayerSet';\n\nexport interface SceneDataTransformerState extends SceneDataState {\n /**\n * Array of standard transformation configs and custom transform operators\n */\n transformations: Array<DataTransformerConfig | CustomTransformerDefinition>;\n}\n\n/**\n * You can use this as a $data object. It can either transform an inner $data DataProvider or if that is not set it will\n * subscribe to a DataProvider higher up in the scene graph and transform its data.\n *\n * The transformations array supports custom (runtime defined) transformation as well as declarative core transformations.\n * You can manually re-process the transformations by calling reprocessTransformations(). This is useful if you have\n * transformations that depend on other scene object states.\n */\nexport class SceneDataTransformer extends SceneObjectBase<SceneDataTransformerState> implements SceneDataProvider {\n private _transformSub?: Unsubscribable;\n private _results = new ReplaySubject<SceneDataProviderResult>(1);\n private _prevDataFromSource?: PanelData;\n\n /**\n * Scan transformations for variable usage and re-process transforms when a variable values change\n */\n protected _variableDependency: VariableDependencyConfig<SceneDataTransformerState> = new VariableDependencyConfig(\n this,\n {\n statePaths: ['transformations'],\n onReferencedVariableValueChanged: () => this.reprocessTransformations(),\n }\n );\n\n public constructor(state: SceneDataTransformerState) {\n super(state);\n\n this.addActivationHandler(() => this.activationHandler());\n }\n\n private activationHandler() {\n const sourceData = this.getSourceData();\n\n this._subs.add(sourceData.subscribeToState((state) => this.transform(state.data)));\n\n if (sourceData.state.data) {\n this.transform(sourceData.state.data);\n }\n\n return () => {\n if (this._transformSub) {\n this._transformSub.unsubscribe();\n }\n };\n }\n\n private getSourceData(): SceneDataProvider {\n if (this.state.$data) {\n if (this.state.$data instanceof SceneDataLayerSet) {\n throw new Error('SceneDataLayerSet can not be used as data provider for SceneDataTransformer.');\n }\n return this.state.$data;\n }\n\n if (!this.parent || !this.parent.parent) {\n throw new Error('SceneDataTransformer must either have $data set on it or have a parent.parent with $data');\n }\n\n return sceneGraph.getData(this.parent.parent);\n }\n\n public setContainerWidth(width: number) {\n if (this.state.$data && this.state.$data.setContainerWidth) {\n this.state.$data.setContainerWidth(width);\n }\n }\n\n public isDataReadyToDisplay() {\n const dataObject = this.getSourceData();\n if (dataObject.isDataReadyToDisplay) {\n return dataObject.isDataReadyToDisplay();\n }\n\n return true;\n }\n\n public reprocessTransformations() {\n this.transform(this.getSourceData().state.data, true);\n }\n\n public cancelQuery() {\n this.getSourceData().cancelQuery?.();\n }\n\n public getResultsStream() {\n return this._results;\n }\n\n public clone(withState?: Partial<SceneDataTransformerState>) {\n const clone = super.clone(withState);\n\n if (this._prevDataFromSource) {\n clone['_prevDataFromSource'] = this._prevDataFromSource;\n }\n\n return clone;\n }\n\n private haveAlreadyTransformedData(data: PanelData) {\n if (!this._prevDataFromSource) {\n return false;\n }\n\n if (data === this._prevDataFromSource) {\n return true;\n }\n\n const { series, annotations } = this._prevDataFromSource;\n\n if (data.series === series && data.annotations === annotations) {\n if (this.state.data && data.state !== this.state.data.state) {\n this.setState({ data: { ...this.state.data, state: data.state } });\n }\n return true;\n }\n\n return false;\n }\n\n private transform(data: PanelData | undefined, force = false) {\n if (this.state.transformations.length === 0 || !data) {\n this._prevDataFromSource = data;\n this.setState({ data });\n\n if (data) {\n this._results.next({ origin: this, data });\n }\n return;\n }\n\n // Skip transform step if we have already transformed this data\n if (!force && this.haveAlreadyTransformedData(data)) {\n return;\n }\n\n const seriesTransformations = this.state.transformations\n .filter((transformation) => {\n if ('options' in transformation || 'topic' in transformation) {\n return transformation.topic == null || transformation.topic === DataTopic.Series;\n }\n\n return true;\n })\n .map((transformation) => ('operator' in transformation ? transformation.operator : transformation));\n\n const annotationsTransformations = this.state.transformations\n .filter((transformation) => {\n if ('options' in transformation || 'topic' in transformation) {\n return transformation.topic === DataTopic.Annotations;\n }\n\n return false;\n })\n .map((transformation) => ('operator' in transformation ? transformation.operator : transformation));\n\n if (this._transformSub) {\n this._transformSub.unsubscribe();\n }\n\n const ctx = {\n interpolate: (value: string) => {\n return sceneGraph.interpolate(this, value, data.request?.scopedVars);\n },\n };\n\n let streams = [transformDataFrame(seriesTransformations, data.series, ctx)];\n\n if (data.annotations && data.annotations.length > 0 && annotationsTransformations.length > 0) {\n streams.push(transformDataFrame(annotationsTransformations, data.annotations ?? []));\n }\n\n this._transformSub = forkJoin(streams)\n .pipe(\n map((values) => {\n const transformedSeries = values[0];\n const transformedAnnotations = values[1];\n\n return {\n ...data,\n series: transformedSeries,\n annotations: transformedAnnotations ?? data.annotations,\n };\n }),\n catchError((err) => {\n console.error('Error transforming data: ', err);\n const sourceErr = this.getSourceData().state.data?.errors || [];\n\n const transformationError = toDataQueryError(err);\n transformationError.message = `Error transforming data: ${transformationError.message}`;\n\n const result: PanelData = {\n ...data,\n state: LoadingState.Error,\n // Combine transformation error with upstream errors\n errors: [...sourceErr, transformationError],\n };\n\n return of(result);\n })\n )\n .subscribe((transformedData) => {\n this.setState({ data: transformedData });\n this._results.next({ origin: this, data: transformedData });\n this._prevDataFromSource = data;\n });\n }\n}\n","import React from 'react';\n\nimport { VariableHide } from '@grafana/data';\n\nimport { SceneObjectBase, useSceneObjectState } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { ControlsLayout, SceneComponentProps, SceneObjectState } from '../../core/types';\nimport { SceneVariable, SceneVariableState } from '../types';\nimport { ControlsLabel } from '../../utils/ControlsLabel';\nimport { css } from '@emotion/css';\nimport { selectors } from '@grafana/e2e-selectors';\n\nexport interface VariableValueSelectorsState extends SceneObjectState {\n layout?: ControlsLayout;\n}\n\nexport class VariableValueSelectors extends SceneObjectBase<VariableValueSelectorsState> {\n public static Component = VariableValueSelectorsRenderer;\n}\n\nfunction VariableValueSelectorsRenderer({ model }: SceneComponentProps<VariableValueSelectors>) {\n const variables = sceneGraph.getVariables(model)!.useState();\n\n return (\n <>\n {variables.variables.map((variable) => (\n <VariableValueSelectWrapper key={variable.state.key} variable={variable} layout={model.state.layout} />\n ))}\n </>\n );\n}\n\ninterface VariableSelectProps {\n layout?: ControlsLayout;\n variable: SceneVariable;\n /** To override hide from VariableValueSelectByName */\n showAlways?: boolean;\n /** To provide an option to hide the label in the variable value selector */\n hideLabel?: boolean;\n}\n\nexport function VariableValueSelectWrapper({ variable, layout, showAlways, hideLabel }: VariableSelectProps) {\n const state = useSceneObjectState<SceneVariableState>(variable, { shouldActivateOrKeepAlive: true });\n\n if (state.hide === VariableHide.hideVariable && !showAlways) {\n return null;\n }\n\n if (layout === 'vertical') {\n return (\n <div className={verticalContainer} data-testid={selectors.pages.Dashboard.SubMenu.submenuItem}>\n <VariableLabel variable={variable} layout={layout} hideLabel={hideLabel} />\n <variable.Component model={variable} />\n </div>\n );\n }\n\n return (\n <div className={containerStyle} data-testid={selectors.pages.Dashboard.SubMenu.submenuItem}>\n <VariableLabel variable={variable} hideLabel={hideLabel} />\n <variable.Component model={variable} />\n </div>\n );\n}\n\nfunction VariableLabel({ variable, layout, hideLabel }: VariableSelectProps) {\n const { state } = variable;\n\n if (variable.state.hide === VariableHide.hideLabel || hideLabel) {\n return null;\n }\n\n const elementId = `var-${state.key}`;\n const labelOrName = state.label ?? state.name;\n\n return (\n <ControlsLabel\n htmlFor={elementId}\n isLoading={state.loading}\n onCancel={() => variable.onCancel?.()}\n label={labelOrName}\n error={state.error}\n layout={layout}\n description={state.description ?? undefined}\n />\n );\n}\n\nconst containerStyle = css({ display: 'flex' });\nconst verticalContainer = css({ display: 'flex', flexDirection: 'column' });\n","import React from 'react';\n\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { ControlsLayout, SceneComponentProps, SceneObjectState } from '../../core/types';\nimport { VariableValueSelectWrapper } from './VariableValueSelectors';\n\nexport interface VariableValueControlState extends SceneObjectState {\n layout?: ControlsLayout;\n /** Render the specific select control for a variable */\n variableName: string;\n /** Hide the label in the variable value controller */\n hideLabel?: boolean;\n}\n\nexport class VariableValueControl extends SceneObjectBase<VariableValueControlState> {\n public static Component = VariableValueControlRenderer;\n}\n\nfunction VariableValueControlRenderer({ model }: SceneComponentProps<VariableValueControl>) {\n const variable = sceneGraph.lookupVariable(model.state.variableName, model);\n if (!variable) {\n return null;\n }\n\n return (\n <VariableValueSelectWrapper\n key={variable.state.key}\n variable={variable}\n layout={model.state.layout}\n showAlways={true}\n />\n );\n}\n","import { VariableRefresh } from '@grafana/data';\nimport { Unsubscribable } from 'rxjs';\nimport { sceneGraph } from '../../core/sceneGraph';\n\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneObject } from '../../core/types';\nimport { writeSceneLog } from '../../utils/writeSceneLog';\nimport {\n SceneVariable,\n SceneVariableDependencyConfigLike,\n SceneVariables,\n SceneVariableSetState,\n SceneVariableValueChangedEvent,\n} from '../types';\nimport { VariableValueRecorder } from '../VariableValueRecorder';\n\nexport class SceneVariableSet extends SceneObjectBase<SceneVariableSetState> implements SceneVariables {\n /** Variables that have changed in since the activation or since the first manual value change */\n private _variablesThatHaveChanged = new Set<SceneVariable>();\n\n /** Variables that are scheduled to be validated and updated */\n private _variablesToUpdate = new Set<SceneVariable>();\n\n /** Variables currently updating */\n private _updating = new Map<SceneVariable, VariableUpdateInProgress>();\n\n private _variableValueRecorder = new VariableValueRecorder();\n\n /**\n * This makes sure SceneVariableSet's higher up in the chain notify us when parent level variables complete update batches.\n **/\n protected _variableDependency = new SceneVariableSetVariableDependencyHandler(\n this._handleParentVariableUpdatesCompleted.bind(this)\n );\n\n public getByName(name: string): SceneVariable | undefined {\n // TODO: Replace with index\n return this.state.variables.find((x) => x.state.name === name);\n }\n\n public constructor(state: SceneVariableSetState) {\n super(state);\n\n this.addActivationHandler(this._onActivate);\n }\n\n /**\n * Subscribes to child variable value changes, and starts the variable value validation process\n */\n private _onActivate = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n // Subscribe to changes to child variables\n this._subs.add(\n this.subscribeToEvent(SceneVariableValueChangedEvent, (event) => this._handleVariableValueChanged(event.payload))\n );\n\n this._subs.add(\n timeRange.subscribeToState(() => {\n this._refreshTimeRangeBasedVariables();\n })\n );\n\n // Subscribe to state changes\n this._subs.add(this.subscribeToState(this._onStateChanged));\n\n this._checkForVariablesThatChangedWhileInactive();\n\n // Add all variables that need updating to queue\n for (const variable of this.state.variables) {\n if (this._variableNeedsUpdate(variable)) {\n this._variablesToUpdate.add(variable);\n }\n }\n\n this._updateNextBatch();\n\n // Return deactivation handler;\n return this._onDeactivate;\n };\n\n /**\n * Add all variables that depend on the changed variable to the update queue\n */\n private _refreshTimeRangeBasedVariables() {\n for (const variable of this.state.variables) {\n if ('refresh' in variable.state && variable.state.refresh === VariableRefresh.onTimeRangeChanged) {\n this._variablesToUpdate.add(variable);\n }\n }\n\n this._updateNextBatch();\n }\n\n /**\n * Cancel all currently running updates\n */\n private _onDeactivate = () => {\n for (const update of this._updating.values()) {\n update.subscription?.unsubscribe();\n }\n\n // Remember current variable values\n for (const variable of this.state.variables) {\n // if the current variable is not in queue to update and validate and not being actively updated then the value is ok\n if (!this._variablesToUpdate.has(variable) && !this._updating.has(variable)) {\n this._variableValueRecorder.recordCurrentValue(variable);\n }\n }\n\n this._variablesToUpdate.clear();\n this._updating.clear();\n };\n\n /**\n * Look for new variables that need to be initialized\n */\n private _onStateChanged = (newState: SceneVariableSetState, oldState: SceneVariableSetState) => {\n const variablesToUpdateCountStart = this._variablesToUpdate.size;\n\n // Check for removed variables\n for (const variable of oldState.variables) {\n if (!newState.variables.includes(variable)) {\n const updating = this._updating.get(variable);\n if (updating?.subscription) {\n updating.subscription.unsubscribe();\n }\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n }\n }\n\n // Check for new variables\n for (const variable of newState.variables) {\n if (!oldState.variables.includes(variable)) {\n if (this._variableNeedsUpdate(variable)) {\n this._variablesToUpdate.add(variable);\n }\n }\n }\n\n // Only start a new batch if there was no batch already running\n if (variablesToUpdateCountStart === 0 && this._variablesToUpdate.size > 0) {\n this._updateNextBatch();\n }\n };\n\n /**\n * If variables changed while in in-active state we don't get any change events, so we need to check for that here.\n */\n private _checkForVariablesThatChangedWhileInactive() {\n if (!this._variableValueRecorder.hasValues()) {\n return;\n }\n\n for (const variable of this.state.variables) {\n if (this._variableValueRecorder.hasValueChanged(variable)) {\n writeVariableTraceLog(variable, 'Changed while in-active');\n this._addDependentVariablesToUpdateQueue(variable);\n }\n }\n }\n\n private _variableNeedsUpdate(variable: SceneVariable): boolean {\n if (variable.isLazy) {\n return false;\n }\n\n if (!variable.validateAndUpdate) {\n return false;\n }\n\n // If we have recorded valid value (even if it has changed since we do not need to re-validate this variable)\n if (this._variableValueRecorder.hasRecordedValue(variable)) {\n writeVariableTraceLog(variable, 'Skipping updateAndValidate current value valid');\n return false;\n }\n\n return true;\n }\n\n /**\n * This loops through variablesToUpdate and update all that can.\n * If one has a dependency that is currently in variablesToUpdate it will be skipped for now.\n */\n private _updateNextBatch() {\n for (const variable of this._variablesToUpdate) {\n if (!variable.validateAndUpdate) {\n throw new Error('Variable added to variablesToUpdate but does not have validateAndUpdate');\n }\n\n // Ignore it if it's already started\n if (this._updating.has(variable)) {\n continue;\n }\n\n // Wait for variables that has dependencies that also needs updates\n if (sceneGraph.hasVariableDependencyInLoadingState(variable)) {\n continue;\n }\n\n const variableToUpdate: VariableUpdateInProgress = {\n variable,\n };\n\n this._updating.set(variable, variableToUpdate);\n writeVariableTraceLog(variable, 'updateAndValidate started');\n\n variableToUpdate.subscription = variable.validateAndUpdate().subscribe({\n next: () => this._validateAndUpdateCompleted(variable),\n complete: () => this._validateAndUpdateCompleted(variable),\n error: (err) => this._handleVariableError(variable, err),\n });\n }\n }\n\n /**\n * A variable has completed its update process. This could mean that variables that depend on it can now be updated in turn.\n */\n private _validateAndUpdateCompleted(variable: SceneVariable) {\n if (!this._updating.has(variable)) {\n return;\n }\n\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n\n writeVariableTraceLog(variable, 'updateAndValidate completed');\n\n this._notifyDependentSceneObjects(variable);\n this._updateNextBatch();\n }\n\n public cancel(variable: SceneVariable) {\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n }\n\n private _handleVariableError(variable: SceneVariable, err: Error) {\n const update = this._updating.get(variable);\n update?.subscription?.unsubscribe();\n\n this._updating.delete(variable);\n this._variablesToUpdate.delete(variable);\n\n variable.setState({ loading: false, error: err.message });\n\n console.error('SceneVariableSet updateAndValidate error', err);\n\n writeVariableTraceLog(variable, 'updateAndValidate error', err);\n\n this._notifyDependentSceneObjects(variable);\n this._updateNextBatch();\n }\n\n private _handleVariableValueChanged(variableThatChanged: SceneVariable) {\n this._variablesThatHaveChanged.add(variableThatChanged);\n this._addDependentVariablesToUpdateQueue(variableThatChanged);\n\n // Ignore this change if it is currently updating\n if (!this._updating.has(variableThatChanged)) {\n this._updateNextBatch();\n this._notifyDependentSceneObjects(variableThatChanged);\n }\n }\n\n /**\n * This is called by any parent level variable set to notify scene that an update batch is completed.\n * This is the main mechanism lower level variable set's react to changes on higher levels.\n */\n private _handleParentVariableUpdatesCompleted(variable: SceneVariable, hasChanged: boolean) {\n // First loop through changed variables and add any of our variables that depend on the higher level variable to the update queue\n if (hasChanged) {\n this._addDependentVariablesToUpdateQueue(variable);\n }\n\n // If we have variables to update but none are currently updating kick of a new update batch\n if (this._variablesToUpdate.size > 0 && this._updating.size === 0) {\n this._updateNextBatch();\n }\n }\n\n private _addDependentVariablesToUpdateQueue(variableThatChanged: SceneVariable) {\n for (const otherVariable of this.state.variables) {\n if (otherVariable.variableDependency) {\n if (otherVariable.variableDependency.hasDependencyOn(variableThatChanged.state.name)) {\n writeVariableTraceLog(otherVariable, 'Added to update queue, dependant variable value changed');\n\n if (this._updating.has(otherVariable) && otherVariable.onCancel) {\n otherVariable.onCancel();\n }\n\n this._variablesToUpdate.add(otherVariable);\n }\n }\n }\n }\n\n /**\n * Walk scene object graph and update all objects that depend on variables that have changed\n */\n private _notifyDependentSceneObjects(variable: SceneVariable) {\n if (!this.parent) {\n return;\n }\n\n this._traverseSceneAndNotify(this.parent, variable, this._variablesThatHaveChanged.has(variable));\n this._variablesThatHaveChanged.delete(variable);\n }\n\n /**\n * Recursivly walk the full scene object graph and notify all objects with dependencies that include any of changed variables\n */\n private _traverseSceneAndNotify(sceneObject: SceneObject, variable: SceneVariable, hasChanged: boolean) {\n // No need to notify variables under this SceneVariableSet\n if (this === sceneObject) {\n return;\n }\n\n // Skip non active scene objects\n if (!sceneObject.isActive) {\n return;\n }\n\n // If we find a nested SceneVariableSet that has a variable with the same name we stop the traversal\n if (sceneObject.state.$variables && sceneObject.state.$variables !== this) {\n const localVar = sceneObject.state.$variables.getByName(variable.state.name);\n if (localVar) {\n return;\n }\n }\n\n if (sceneObject.variableDependency) {\n sceneObject.variableDependency.variableUpdateCompleted(variable, hasChanged);\n }\n\n sceneObject.forEachChild((child) => this._traverseSceneAndNotify(child, variable, hasChanged));\n }\n\n /**\n * Return true if variable is waiting to update or currently updating.\n * It also returns true if a dependency of the variable is loading.\n *\n * For example if C depends on variable B which depends on variable A and A is loading this returns true for variable C and B.\n */\n public isVariableLoadingOrWaitingToUpdate(variable: SceneVariable) {\n if (variable.isAncestorLoading && variable.isAncestorLoading()) {\n return true;\n }\n\n if (this._variablesToUpdate.has(variable) || this._updating.has(variable)) {\n return true;\n }\n\n // Last scenario is to check the variable's own dependencies as well\n return sceneGraph.hasVariableDependencyInLoadingState(variable);\n }\n}\n\nexport interface VariableUpdateInProgress {\n variable: SceneVariable;\n subscription?: Unsubscribable;\n}\n\nfunction writeVariableTraceLog(variable: SceneVariable, message: string, err?: Error) {\n if (err) {\n writeSceneLog('SceneVariableSet', `Variable[${variable.state.name}]: ${message}`, err);\n } else {\n writeSceneLog('SceneVariableSet', `Variable[${variable.state.name}]: ${message}`);\n }\n}\n\nclass SceneVariableSetVariableDependencyHandler implements SceneVariableDependencyConfigLike {\n public constructor(private _variableUpdatesCompleted: (variable: SceneVariable, hasChanged: boolean) => void) {}\n\n private _emptySet = new Set<string>();\n\n public getNames(): Set<string> {\n return this._emptySet;\n }\n\n public hasDependencyOn(name: string): boolean {\n return false;\n }\n\n public variableUpdateCompleted(variable: SceneVariable, hasChanged: boolean): void {\n this._variableUpdatesCompleted(variable, hasChanged);\n }\n}\n","import { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneVariable, SceneVariableState, VariableValue } from '../types';\n\nexport interface ConstantVariableState extends SceneVariableState {\n value: VariableValue;\n}\n\nexport class ConstantVariable\n extends SceneObjectBase<ConstantVariableState>\n implements SceneVariable<ConstantVariableState>\n{\n public constructor(initialState: Partial<ConstantVariableState>) {\n super({\n type: 'constant',\n value: '',\n name: '',\n ...initialState,\n skipUrlSync: true,\n });\n }\n\n public getValue(): VariableValue {\n return this.state.value;\n }\n}\n","import { Observable, of } from 'rxjs';\n\nimport { SceneComponentProps } from '../../core/types';\nimport { VariableDependencyConfig } from '../VariableDependencyConfig';\nimport { renderSelectForVariable } from '../components/VariableValueSelect';\nimport { VariableValueOption } from '../types';\n\nimport { MultiValueVariable, MultiValueVariableState, VariableGetOptionsArgs } from './MultiValueVariable';\nimport { sceneGraph } from '../../core/sceneGraph';\n\nexport interface CustomVariableState extends MultiValueVariableState {\n query: string;\n}\n\nexport class CustomVariable extends MultiValueVariable<CustomVariableState> {\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['query'],\n });\n\n public constructor(initialState: Partial<CustomVariableState>) {\n super({\n type: 'custom',\n query: '',\n value: '',\n text: '',\n options: [],\n name: '',\n ...initialState,\n });\n }\n\n public getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]> {\n const interpolated = sceneGraph.interpolate(this, this.state.query);\n const match = interpolated.match(/(?:\\\\,|[^,])+/g) ?? [];\n\n const options = match.map((text) => {\n text = text.replace(/\\\\,/g, ',');\n const textMatch = /^(.+)\\s:\\s(.+)$/g.exec(text) ?? [];\n if (textMatch.length === 3) {\n const [, key, value] = textMatch;\n return { label: key.trim(), value: value.trim() };\n } else {\n return { label: text.trim(), value: text.trim() };\n }\n });\n\n return of(options);\n }\n\n public static Component = ({ model }: SceneComponentProps<MultiValueVariable>) => {\n return renderSelectForVariable(model);\n };\n}\n","import { Observable, of } from 'rxjs';\n\nimport { stringToJsRegex, DataSourceInstanceSettings } from '@grafana/data';\nimport { getDataSourceSrv } from '@grafana/runtime';\n\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneComponentProps } from '../../core/types';\nimport { VariableDependencyConfig } from '../VariableDependencyConfig';\nimport { renderSelectForVariable } from '../components/VariableValueSelect';\nimport { VariableValueOption } from '../types';\n\nimport { MultiValueVariable, MultiValueVariableState, VariableGetOptionsArgs } from './MultiValueVariable';\n\nexport interface DataSourceVariableState extends MultiValueVariableState {\n /**\n * Include all data source instances with this plugin id\n */\n pluginId: string;\n /**\n * Filter data source instances based on name\n */\n regex: string;\n /**\n * For backwards compatability with old dashboards, will likely be removed\n */\n defaultOptionEnabled?: boolean;\n}\n\nexport class DataSourceVariable extends MultiValueVariable<DataSourceVariableState> {\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['regex'],\n });\n\n public constructor(initialState: Partial<DataSourceVariableState>) {\n super({\n type: 'datasource',\n value: '',\n text: '',\n options: [],\n name: '',\n regex: '',\n pluginId: '',\n ...initialState,\n });\n }\n\n public getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]> {\n if (!this.state.pluginId) {\n return of([]);\n }\n\n const dataSources = getDataSourceSrv().getList({ metrics: true, variables: false, pluginId: this.state.pluginId });\n\n let regex;\n if (this.state.regex) {\n const interpolated = sceneGraph.interpolate(this, this.state.regex, undefined, 'regex');\n regex = stringToJsRegex(interpolated);\n }\n\n const options: VariableValueOption[] = [];\n\n for (let i = 0; i < dataSources.length; i++) {\n const source = dataSources[i];\n\n if (isValid(source, regex)) {\n options.push({ label: source.name, value: source.uid });\n }\n\n if (this.state.defaultOptionEnabled && isDefault(source, regex)) {\n options.push({ label: 'default', value: 'default' });\n }\n }\n\n if (options.length === 0) {\n this.setState({ error: 'No data sources found' });\n } else if (this.state.error) {\n this.setState({ error: null });\n }\n\n return of(options);\n }\n\n public static Component = ({ model }: SceneComponentProps<MultiValueVariable>) => {\n return renderSelectForVariable(model);\n };\n}\n\nfunction isValid(source: DataSourceInstanceSettings, regex?: RegExp) {\n if (!regex) {\n return true;\n }\n\n return regex.exec(source.name);\n}\n\nfunction isDefault(source: DataSourceInstanceSettings, regex?: RegExp) {\n if (!source.isDefault) {\n return false;\n }\n\n if (!regex) {\n return true;\n }\n\n return regex.exec('default');\n}\n","export interface TreeNode {\n name: string;\n children: TreeNode[];\n}\n\n/*\n * Builds a nested tree like\n * [\n * {\n * name: 'A',\n * children: [\n * { name: 'AA', children: [] },\n * { name: 'AB', children: [] },\n * ]\n * }\n * ]\n */\nfunction buildMetricTree(parent: string, depth: number): TreeNode[] {\n const chars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];\n const children: TreeNode[] = [];\n\n if (depth > 5) {\n return [];\n }\n\n for (const letter of chars) {\n const nodeName = `${parent}${letter}`;\n children.push({\n name: nodeName,\n children: buildMetricTree(nodeName, depth + 1),\n });\n }\n\n return children;\n}\n\nfunction queryTree(children: TreeNode[], query: string[], queryIndex: number): TreeNode[] {\n if (queryIndex >= query.length) {\n return children;\n }\n\n if (query[queryIndex] === '*') {\n return children;\n }\n\n const nodeQuery = query[queryIndex];\n let result: TreeNode[] = [];\n let namesToMatch = [nodeQuery];\n\n // handle glob queries\n if (nodeQuery.startsWith('{')) {\n namesToMatch = nodeQuery.replace(/\\{|\\}/g, '').split(',');\n }\n\n for (const node of children) {\n for (const nameToMatch of namesToMatch) {\n if (nameToMatch.indexOf('*') !== -1) {\n const pattern = nameToMatch.replace('*', '');\n const regex = new RegExp(`^${pattern}.*`, 'gi');\n if (regex.test(node.name)) {\n result = result.concat(queryTree([node], query, queryIndex + 1));\n }\n } else if (node.name === nameToMatch) {\n result = result.concat(queryTree(node.children, query, queryIndex + 1));\n }\n }\n }\n\n return result;\n}\n\nexport function queryMetricTree(query: string): TreeNode[] {\n if (query.indexOf('value') === 0) {\n return [{ name: query, children: [] }];\n }\n\n const children = buildMetricTree('', 0);\n return queryTree(children, query.split('.'), 0);\n}\n","import { Observable, Subject } from 'rxjs';\n\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneComponentProps } from '../../core/types';\nimport { queryMetricTree } from '../../utils/metricTree';\nimport { VariableDependencyConfig } from '../VariableDependencyConfig';\nimport { renderSelectForVariable } from '../components/VariableValueSelect';\nimport { VariableValueOption } from '../types';\n\nimport { MultiValueVariable, MultiValueVariableState, VariableGetOptionsArgs } from './MultiValueVariable';\nimport { VariableRefresh } from '@grafana/data';\nimport { getClosest } from '../../core/sceneGraph/utils';\nimport { SceneVariableSet } from '../sets/SceneVariableSet';\nimport { SceneQueryControllerEntry } from '../../behaviors/SceneQueryController';\n\nexport interface TestVariableState extends MultiValueVariableState {\n query: string;\n delayMs?: number;\n issuedQuery?: string;\n refresh?: VariableRefresh;\n throwError?: string;\n optionsToReturn?: VariableValueOption[];\n}\n\n/**\n * This variable is only designed for unit tests and potentially e2e tests.\n */\nexport class TestVariable extends MultiValueVariable<TestVariableState> {\n private completeUpdate = new Subject<number>();\n public isGettingValues = true;\n public getValueOptionsCount = 0;\n isLazy = false;\n\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['query'],\n });\n\n public constructor(initialState: Partial<TestVariableState>, isLazy = false) {\n super({\n type: 'custom',\n name: 'Test',\n value: 'Value',\n text: 'Text',\n query: 'Query',\n options: [],\n refresh: VariableRefresh.onDashboardLoad,\n ...initialState,\n });\n this.isLazy = isLazy;\n }\n\n public getValueOptions(args: VariableGetOptionsArgs): Observable<VariableValueOption[]> {\n const { delayMs } = this.state;\n\n this.getValueOptionsCount += 1;\n\n const queryController = sceneGraph.getQueryController(this);\n\n return new Observable<VariableValueOption[]>((observer) => {\n const queryEntry: SceneQueryControllerEntry = {\n type: 'variable',\n origin: this,\n cancel: () => observer.complete(),\n };\n\n if (queryController) {\n queryController.queryStarted(queryEntry);\n }\n\n this.setState({ loading: true });\n\n if (this.state.throwError) {\n throw new Error(this.state.throwError);\n }\n\n const interpolatedQuery = sceneGraph.interpolate(this, this.state.query);\n const options = this.getOptions(interpolatedQuery);\n\n const sub = this.completeUpdate.subscribe({\n next: () => {\n this.setState({ issuedQuery: interpolatedQuery, options, loading: false });\n observer.next(options);\n observer.complete();\n },\n });\n\n let timeout: number | undefined;\n if (delayMs) {\n timeout = window.setTimeout(() => this.signalUpdateCompleted(), delayMs);\n } else if (delayMs === 0) {\n this.signalUpdateCompleted();\n }\n\n this.isGettingValues = true;\n\n return () => {\n sub.unsubscribe();\n window.clearTimeout(timeout);\n this.isGettingValues = false;\n\n if (this.state.loading) {\n this.setState({ loading: false });\n }\n\n if (queryController) {\n queryController.queryCompleted(queryEntry);\n }\n };\n });\n }\n\n public cancel() {\n const sceneVarSet = getClosest(this, (s) => (s instanceof SceneVariableSet ? s : undefined));\n sceneVarSet?.cancel(this);\n }\n\n private getOptions(interpolatedQuery: string) {\n if (this.state.optionsToReturn) {\n return this.state.optionsToReturn;\n }\n\n return queryMetricTree(interpolatedQuery).map((x) => ({ label: x.name, value: x.name }));\n }\n\n /** Useful from tests */\n public signalUpdateCompleted() {\n this.completeUpdate.next(1);\n }\n\n public static Component = ({ model }: SceneComponentProps<MultiValueVariable>) => {\n return renderSelectForVariable(model);\n };\n}\n","import React, { useCallback } from 'react';\n\nimport { AutoSizeInput } from '@grafana/ui';\n\nimport { SceneComponentProps } from '../../core/types';\nimport { TextBoxVariable } from '../variants/TextBoxVariable';\n\nexport function VariableValueInput({ model }: SceneComponentProps<TextBoxVariable>) {\n const { value, key, loading } = model.useState();\n\n const onBlur = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n model.setValue(e.currentTarget.value);\n },\n [model]\n );\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n model.setValue(e.currentTarget.value);\n }\n },\n [model]\n );\n\n return (\n <AutoSizeInput\n id={key}\n placeholder=\"Enter value\"\n minWidth={15}\n defaultValue={value}\n loading={loading}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n />\n );\n}\n","import React from 'react';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectUrlValues } from '../../core/types';\nimport { SceneObjectUrlSyncConfig } from '../../services/SceneObjectUrlSyncConfig';\nimport { VariableValueInput } from '../components/VariableValueInput';\nimport { SceneVariable, SceneVariableState, SceneVariableValueChangedEvent, VariableValue } from '../types';\n\nexport interface TextBoxVariableState extends SceneVariableState {\n value: string;\n}\n\nexport class TextBoxVariable\n extends SceneObjectBase<TextBoxVariableState>\n implements SceneVariable<TextBoxVariableState>\n{\n public constructor(initialState: Partial<TextBoxVariableState>) {\n super({\n type: 'textbox',\n value: '',\n name: '',\n ...initialState,\n });\n\n this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: () => [this.getKey()] });\n }\n\n public getValue(): VariableValue {\n return this.state.value;\n }\n\n public setValue(newValue: string) {\n if (newValue !== this.state.value) {\n this.setState({ value: newValue });\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n }\n }\n\n private getKey(): string {\n return `var-${this.state.name}`;\n }\n\n public getUrlState() {\n return { [this.getKey()]: this.state.value };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n const update: Partial<TextBoxVariableState> = {};\n const val = values[this.getKey()];\n if (typeof val === 'string') {\n update.value = val;\n }\n\n this.setState(update);\n }\n\n public static Component = ({ model }: SceneComponentProps<TextBoxVariable>) => {\n return <VariableValueInput model={model} />;\n };\n}\n","import { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneVariable, SceneVariableState, VariableValue } from '../types';\n\nexport interface LocalValueVariableState extends SceneVariableState {\n value: VariableValue;\n text: VariableValue;\n\n // Indicate whether or not this variable is sourced from a multi-value variable.\n // Introduces for a backwards compatibility with the old variable system, to properly support interpolation in SQL data sources.\n isMulti?: boolean;\n includeAll?: boolean;\n}\n\n/**\n * This is a special type of variable that is used for repeating panels and layouts to create a local scoped value for a variable\n * that exists in a ancestor SceneVariableSet.\n */\nexport class LocalValueVariable\n extends SceneObjectBase<LocalValueVariableState>\n implements SceneVariable<LocalValueVariableState>\n{\n public constructor(initialState: Omit<Partial<LocalValueVariableState>, 'isMulti' | 'includeAll'>) {\n super({\n type: 'system',\n value: '',\n text: '',\n name: '',\n isMulti: true,\n includeAll: true,\n ...initialState,\n skipUrlSync: true,\n });\n }\n\n public getValue(): VariableValue {\n return this.state.value;\n }\n\n public getValueText(): string {\n return this.state.text.toString();\n }\n\n /**\n * Checks the ancestor of our parent SceneVariableSet for loading state of a variable with the same name\n * This function is unit tested from SceneVariableSet tests.\n */\n public isAncestorLoading(): boolean {\n // Parent (SceneVariableSet) -> Parent (The object that has our parent set) -> Parent (scope we need to access our sets ancestor)\n const ancestorScope = this.parent?.parent?.parent;\n if (!ancestorScope) {\n throw new Error('LocalValueVariable requires a parent SceneVariableSet that has an ancestor SceneVariableSet');\n }\n\n const set = sceneGraph.getVariables(ancestorScope);\n const parentVar = sceneGraph.lookupVariable(this.state.name, ancestorScope);\n if (set && parentVar) {\n return set.isVariableLoadingOrWaitingToUpdate(parentVar);\n }\n\n return false;\n }\n}\n","import { rangeUtil, SelectableValue } from '@grafana/data';\nimport { VariableRefresh } from '@grafana/schema';\nimport { Select } from '@grafana/ui';\nimport React from 'react';\nimport { Observable, of } from 'rxjs';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectUrlValues } from '../../core/types';\nimport { SceneObjectUrlSyncConfig } from '../../services/SceneObjectUrlSyncConfig';\nimport { AUTO_VARIABLE_TEXT, AUTO_VARIABLE_VALUE } from '../constants';\nimport {\n SceneVariable,\n SceneVariableState,\n SceneVariableValueChangedEvent,\n ValidateAndUpdateResult,\n VariableValue,\n} from '../types';\n\nexport interface IntervalVariableState extends SceneVariableState {\n intervals: string[];\n value: string;\n autoEnabled: boolean;\n autoMinInterval: string;\n autoStepCount: number;\n refresh: VariableRefresh;\n}\n\nexport class IntervalVariable\n extends SceneObjectBase<IntervalVariableState>\n implements SceneVariable<IntervalVariableState>\n{\n public constructor(initialState: Partial<IntervalVariableState>) {\n super({\n type: 'interval',\n value: '',\n intervals: ['1m', '10m', '30m', '1h', '6h', '12h', '1d', '7d', '14d', '30d'],\n name: '',\n autoStepCount: 30,\n autoMinInterval: '10s',\n autoEnabled: false,\n refresh: VariableRefresh.onTimeRangeChanged,\n ...initialState,\n });\n\n this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: () => [this.getKey()] });\n }\n\n private getKey(): string {\n return `var-${this.state.name}`;\n }\n\n public getUrlState() {\n return { [this.getKey()]: this.state.value };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n const update: Partial<IntervalVariableState> = {};\n const val = values[this.getKey()];\n if (typeof val === 'string') {\n // support old auto interval url value\n if (val.startsWith('$__auto_interval_')) {\n update.value = AUTO_VARIABLE_VALUE;\n } else {\n update.value = val;\n }\n }\n this.setState(update);\n }\n\n public getOptionsForSelect(): Array<SelectableValue<string>> {\n const { value: currentValue, intervals, autoEnabled } = this.state;\n\n let options = intervals.map((interval) => ({ value: interval, label: interval }));\n\n if (autoEnabled) {\n options = [{ value: AUTO_VARIABLE_VALUE, label: AUTO_VARIABLE_TEXT }, ...options];\n }\n\n // If the current value is not in the list of intervals, add it to the list\n if (currentValue && !options.some((option) => option.value === currentValue)) {\n options.push({ value: currentValue, label: currentValue });\n }\n\n return options;\n }\n\n public getValue(): VariableValue {\n const { value, autoStepCount, autoMinInterval } = this.state;\n if (value === AUTO_VARIABLE_VALUE) {\n return this.getAutoRefreshInteval(autoStepCount, autoMinInterval);\n }\n\n return value;\n }\n\n private getAutoRefreshInteval(autoStepCount: number, minRefreshInterval: string) {\n const timeRange = sceneGraph.getTimeRange(this).state.value;\n const intervalObject = rangeUtil.calculateInterval(timeRange, autoStepCount, minRefreshInterval);\n return intervalObject.interval;\n }\n\n public _onChange = (value: SelectableValue<string>) => {\n this.setState({ value: value.value! });\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n };\n\n public validateAndUpdate(): Observable<ValidateAndUpdateResult> {\n const { value, intervals } = this.state;\n let shouldPublish = false;\n\n if (value === AUTO_VARIABLE_VALUE) {\n shouldPublish = true;\n } else if (!value && intervals.length > 0) {\n const firstOption = intervals[0];\n this.setState({ value: firstOption });\n shouldPublish = true;\n }\n\n if (shouldPublish) {\n this.publishEvent(new SceneVariableValueChangedEvent(this), true);\n }\n\n return of({});\n }\n\n public static Component = ({ model }: SceneComponentProps<IntervalVariable>) => {\n const { key, value } = model.useState();\n return (\n <Select\n id={key}\n placeholder=\"Select value\"\n width=\"auto\"\n value={value}\n tabSelectsValue={false}\n options={model.getOptionsForSelect()}\n onChange={model._onChange}\n />\n );\n };\n}\n","import { Location } from 'history';\n\nimport { locationService } from '@grafana/runtime';\n\nimport { SceneObjectStateChangedEvent } from '../core/events';\nimport { SceneObject, SceneObjectUrlValues } from '../core/types';\nimport { writeSceneLog } from '../utils/writeSceneLog';\nimport { Unsubscribable } from 'rxjs';\nimport { UniqueUrlKeyMapper } from './UniqueUrlKeyMapper';\nimport { getUrlState, isUrlValueEqual, syncStateFromUrl } from './utils';\n\nexport interface UrlSyncManagerLike {\n initSync(root: SceneObject): void;\n cleanUp(root: SceneObject): void;\n getUrlState(root: SceneObject): SceneObjectUrlValues;\n handleNewLocation(location: Location): void;\n handleNewObject(sceneObj: SceneObject): void;\n}\n\nexport class UrlSyncManager implements UrlSyncManagerLike {\n private _urlKeyMapper = new UniqueUrlKeyMapper();\n private _sceneRoot?: SceneObject;\n private _stateSub: Unsubscribable | null = null;\n private _lastLocation: Location | undefined;\n private _paramsCache = new UrlParamsCache();\n\n /**\n * Updates the current scene state to match URL state.\n */\n public initSync(root: SceneObject) {\n if (this._stateSub) {\n writeSceneLog('UrlSyncManager', 'Unregister previous scene state subscription', this._sceneRoot?.state.key);\n this._stateSub.unsubscribe();\n }\n\n writeSceneLog('UrlSyncManager', 'init', root.state.key);\n\n this._sceneRoot = root;\n this._stateSub = root.subscribeToEvent(SceneObjectStateChangedEvent, this.#onStateChanged);\n\n this._urlKeyMapper.clear();\n this._lastLocation = locationService.getLocation();\n\n this.handleNewObject(this._sceneRoot);\n }\n\n public cleanUp(root: SceneObject) {\n // Ignore this if we have a new or different root\n if (this._sceneRoot !== root) {\n return;\n }\n\n writeSceneLog('UrlSyncManager', 'Clean up');\n\n if (this._stateSub) {\n this._stateSub.unsubscribe();\n this._stateSub = null;\n writeSceneLog(\n 'UrlSyncManager',\n 'Root deactived, unsub to state',\n 'same key',\n this._sceneRoot.state.key === root.state.key\n );\n }\n\n this._sceneRoot = undefined;\n this._lastLocation = undefined;\n }\n\n public handleNewLocation(location: Location) {\n if (!this._sceneRoot || this._lastLocation === location) {\n return;\n }\n\n writeSceneLog('UrlSyncManager', 'handleNewLocation');\n\n this._lastLocation = location;\n\n // Sync scene state tree from url\n syncStateFromUrl(this._sceneRoot!, this._paramsCache.getParams(), this._urlKeyMapper);\n }\n\n public handleNewObject(sceneObj: SceneObject) {\n if (!this._sceneRoot) {\n return;\n }\n\n syncStateFromUrl(sceneObj, this._paramsCache.getParams(), this._urlKeyMapper);\n }\n\n #onStateChanged = ({ payload }: SceneObjectStateChangedEvent) => {\n const changedObject = payload.changedObject;\n\n if (changedObject.urlSync) {\n const newUrlState = changedObject.urlSync.getUrlState();\n\n const searchParams = locationService.getSearch();\n const mappedUpdated: SceneObjectUrlValues = {};\n\n for (const [key, newUrlValue] of Object.entries(newUrlState)) {\n const uniqueKey = this._urlKeyMapper.getUniqueKey(key, changedObject);\n const currentUrlValue = searchParams.getAll(uniqueKey);\n\n if (!isUrlValueEqual(currentUrlValue, newUrlValue)) {\n mappedUpdated[uniqueKey] = newUrlValue;\n }\n }\n\n if (Object.keys(mappedUpdated).length > 0) {\n writeSceneLog('UrlSyncManager', 'onStateChange updating URL');\n locationService.partial(mappedUpdated, true);\n\n /// Mark the location already handled\n this._lastLocation = locationService.getLocation();\n }\n }\n };\n\n public getUrlState(root: SceneObject): SceneObjectUrlValues {\n return getUrlState(root);\n }\n}\n\nclass UrlParamsCache {\n #cache: URLSearchParams | undefined;\n #location: Location | undefined;\n\n public getParams(): URLSearchParams {\n const location = locationService.getLocation();\n\n if (this.#location === location) {\n return this.#cache!;\n }\n\n this.#location = location;\n this.#cache = new URLSearchParams(location.search);\n\n return this.#cache;\n }\n}\n\nlet urlSyncManager: UrlSyncManagerLike | undefined;\n\nexport function getUrlSyncManager(): UrlSyncManagerLike {\n if (!urlSyncManager) {\n urlSyncManager = new UrlSyncManager();\n }\n\n return urlSyncManager;\n}\n","import { SceneObject } from '../core/types';\nimport { useEffect, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { getUrlSyncManager } from './UrlSyncManager';\nimport { locationService } from '@grafana/runtime';\nimport { writeSceneLog } from '../utils/writeSceneLog';\n\nexport function useUrlSync(sceneRoot: SceneObject): boolean {\n const urlSyncManager = getUrlSyncManager();\n const location = useLocation();\n const [isInitialized, setIsInitialized] = useState(false);\n\n useEffect(() => {\n urlSyncManager.initSync(sceneRoot);\n setIsInitialized(true);\n return () => urlSyncManager.cleanUp(sceneRoot);\n }, [sceneRoot, urlSyncManager]);\n\n useEffect(() => {\n // Use latest location, as by the time this effect runs, the location might have changed again\n const latestLocation = locationService.getLocation();\n const locationToHandle = latestLocation !== location ? latestLocation : location;\n\n if (latestLocation !== location) {\n writeSceneLog('useUrlSync', 'latestLocation different from location')\n }\n\n urlSyncManager.handleNewLocation(locationToHandle);\n }, [sceneRoot, urlSyncManager, location]);\n\n return isInitialized;\n}\n\nexport interface UrlSyncContextProviderProps {\n scene: SceneObject;\n children: React.ReactNode;\n}\n","import { SceneObject } from '../core/types';\nimport { useUrlSync } from './useUrlSync';\n\nexport interface UrlSyncContextProviderProps {\n scene: SceneObject;\n children: React.ReactNode;\n}\n\n/**\n * Right now this is actually not defining a context, but think it might in the future (with UrlSyncManager as the context value)\n */\n\nexport function UrlSyncContextProvider({ children, scene }: UrlSyncContextProviderProps) {\n const isInitialized = useUrlSync(scene);\n\n if (!isInitialized) {\n return null;\n }\n\n return children;\n}\n","import { SceneObject } from '../../core/types';\nimport { writeSceneLog } from '../writeSceneLog';\n\n/**\n * Adds the scene object to the global window state so that templateSrv in core can interpolate strings using the scene interpolation engine with the scene as scope.\n * This is needed for old datasources that call templateSrv.replace without passing scopedVars. For example in DataSourceAPI.metricFindQuery.\n *\n * This is also used from TimeSrv to access scene time range.\n */\nexport function setWindowGrafanaSceneContext(activeScene: SceneObject) {\n const prevScene = (window as any).__grafanaSceneContext;\n\n writeSceneLog('setWindowGrafanaScene', 'set window.__grafanaSceneContext', activeScene);\n (window as any).__grafanaSceneContext = activeScene;\n\n return () => {\n if ((window as any).__grafanaSceneContext === activeScene) {\n writeSceneLog('setWindowGrafanaScene', 'restore window.__grafanaSceneContext', prevScene);\n (window as any).__grafanaSceneContext = prevScene;\n }\n };\n}\n","import { css } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\nimport React from 'react';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectState, SceneObject } from '../core/types';\nimport { setWindowGrafanaSceneContext } from '../utils/compatibility/setWindowGrafanaSceneContext';\n\nexport interface EmbeddedSceneState extends SceneObjectState {\n /**\n * The main content of the scene (usually a SceneFlexLayout)\n */\n body: SceneObject;\n /**\n * Top row of variable selectors, filters, time pickers and custom actions.\n */\n controls?: SceneObject[];\n /**\n * For interoperability (used from EmbeddedSceneWithContext)\n */\n context?: SceneObject;\n}\n\nexport class EmbeddedScene extends SceneObjectBase<EmbeddedSceneState> {\n public static Component = EmbeddedSceneRenderer;\n\n public constructor(state: EmbeddedSceneState) {\n super(state);\n\n this.addActivationHandler(() => {\n // This function is setting window.__grafanaSceneContext which is used from Grafana core in the old services TimeSrv and TemplateSrv.\n // This works as a backward compatability method to support accessing scene time range and variables from those old services.\n const unsetGlobalScene = setWindowGrafanaSceneContext(this);\n return () => {\n unsetGlobalScene();\n };\n });\n }\n}\n\nfunction EmbeddedSceneRenderer({ model }: SceneComponentProps<EmbeddedScene>) {\n const { body, controls } = model.useState();\n const styles = useStyles2(getStyles);\n\n return (\n <div className={styles.container}>\n {controls && (\n <div className={styles.controls}>\n {controls.map((control) => (\n <control.Component key={control.state.key} model={control} />\n ))}\n </div>\n )}\n <div className={styles.body}>\n <body.Component model={body} />\n </div>\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n container: css({\n flexGrow: 1,\n display: 'flex',\n gap: theme.spacing(2),\n minHeight: '100%',\n flexDirection: 'column',\n }),\n body: css({\n flexGrow: 1,\n display: 'flex',\n gap: theme.spacing(1),\n }),\n controls: css({\n display: 'flex',\n gap: theme.spacing(2),\n alignItems: 'flex-end',\n flexWrap: 'wrap',\n }),\n };\n};\n","import React, { useEffect } from 'react';\nimport { PanelMenuItem } from '@grafana/data';\nimport { Menu } from '@grafana/ui';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectState } from '../../core/types';\nimport { selectors } from '@grafana/e2e-selectors';\n\ninterface VizPanelMenuState extends SceneObjectState {\n items?: PanelMenuItem[];\n}\n\nexport class VizPanelMenu extends SceneObjectBase<VizPanelMenuState> {\n static Component = VizPanelMenuRenderer;\n\n // Allows adding menu items dynamically\n public addItem(item: PanelMenuItem) {\n this.setState({\n items: this.state.items ? [...this.state.items, item] : [item],\n });\n }\n\n // Allows replacing all menu items\n public setItems(items: PanelMenuItem[]) {\n this.setState({\n items,\n });\n }\n}\n\nfunction VizPanelMenuRenderer({ model }: SceneComponentProps<VizPanelMenu>) {\n const { items = [] } = model.useState();\n const ref = React.useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (ref.current) {\n ref.current.focus();\n }\n }, []);\n\n const renderItems = (items: PanelMenuItem[]) => {\n return items.map((item) => {\n switch (item.type) {\n case 'divider':\n return <Menu.Divider key={item.text} />;\n case 'group':\n return (\n <Menu.Group key={item.text} label={item.text}>\n {item.subMenu ? renderItems(item.subMenu) : undefined}\n </Menu.Group>\n );\n default:\n return (\n <Menu.Item\n key={item.text}\n label={item.text}\n icon={item.iconClassName}\n childItems={item.subMenu ? renderItems(item.subMenu) : undefined}\n url={item.href}\n onClick={item.onClick}\n shortcut={item.shortcut}\n testId={selectors.components.Panels.Panel.menuItems(item.text)}\n />\n );\n }\n });\n };\n\n return <Menu ref={ref}>{renderItems(items)}</Menu>;\n}\n","export const DEFAULT_PANEL_SPAN = 4;\nexport const GRID_CELL_HEIGHT = 30;\nexport const GRID_CELL_VMARGIN = 8;\nexport const GRID_COLUMN_COUNT = 24;\n","import React from 'react';\nimport { SceneObjectBase } from '../../../core/SceneObjectBase';\nimport { SceneObject, SceneComponentProps } from '../../../core/types';\nimport { SceneGridLayout } from './SceneGridLayout';\nimport { SceneGridRow } from './SceneGridRow';\nimport { SceneGridItemStateLike, SceneGridItemLike } from './types';\n\ninterface SceneGridItemState extends SceneGridItemStateLike {\n body: SceneObject | undefined;\n}\nexport class SceneGridItem extends SceneObjectBase<SceneGridItemState> implements SceneGridItemLike {\n static Component = SceneGridItemRenderer;\n}\n\nfunction SceneGridItemRenderer({ model }: SceneComponentProps<SceneGridItem>) {\n const { body } = model.useState();\n const parent = model.parent;\n\n if (parent && !isSceneGridLayout(parent) && !isSceneGridRow(parent)) {\n throw new Error('SceneGridItem must be a child of SceneGridLayout or SceneGridRow');\n }\n\n if (!body) {\n return null;\n }\n\n return <body.Component model={body} />;\n}\n\nexport function isSceneGridRow(child: SceneObject): child is SceneGridRow {\n return child instanceof SceneGridRow;\n}\n\nfunction isSceneGridLayout(child: SceneObject): child is SceneGridLayout {\n return child instanceof SceneGridLayout;\n}\n","import React, { ForwardRefExoticComponent, useImperativeHandle, useRef, useState } from 'react';\nimport { useEffectOnce } from 'react-use';\n\nimport { uniqueId } from 'lodash';\nimport { css } from '@emotion/css';\nimport { useStyles2 } from '@grafana/ui';\n\nexport function useUniqueId(): string {\n const idRefLazy = useRef<string | undefined>(undefined);\n idRefLazy.current ??= uniqueId();\n return idRefLazy.current;\n}\n\nexport interface Props extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange' | 'children'> {\n children: React.ReactNode | (({ isInView }: { isInView: boolean }) => React.ReactNode);\n key: string;\n onLoad?: () => void;\n onChange?: (isInView: boolean) => void;\n}\n\nexport interface LazyLoaderType extends ForwardRefExoticComponent<Props> {\n addCallback: (id: string, c: (e: IntersectionObserverEntry) => void) => void;\n callbacks: Record<string, (e: IntersectionObserverEntry) => void>;\n observer: IntersectionObserver;\n}\n\nexport const LazyLoader: LazyLoaderType = React.forwardRef<HTMLDivElement, Props>(\n ({ children, onLoad, onChange, className, ...rest }, ref) => {\n const id = useUniqueId();\n const { hideEmpty } = useStyles2(getStyles);\n const [loaded, setLoaded] = useState(false);\n const [isInView, setIsInView] = useState(false);\n const innerRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => innerRef.current!);\n\n useEffectOnce(() => {\n LazyLoader.addCallback(id, (entry) => {\n if (!loaded && entry.isIntersecting) {\n setLoaded(true);\n onLoad?.();\n }\n\n setIsInView(entry.isIntersecting);\n onChange?.(entry.isIntersecting);\n });\n\n const wrapperEl = innerRef.current;\n\n if (wrapperEl) {\n LazyLoader.observer.observe(wrapperEl);\n }\n\n return () => {\n wrapperEl && LazyLoader.observer.unobserve(wrapperEl);\n delete LazyLoader.callbacks[id];\n if (Object.keys(LazyLoader.callbacks).length === 0) {\n LazyLoader.observer.disconnect();\n }\n };\n });\n\n // If the element was loaded, we add the `hideEmpty` class to potentially\n // hide the LazyLoader if it does not have any children. This is the case\n // when children have the `isHidden` property set.\n // We always include the `className` class, as this is coming from the\n // caller of the `LazyLoader` component.\n const classes = `${loaded ? hideEmpty : ''} ${className}`;\n return (\n <div id={id} ref={innerRef} className={classes} {...rest}>\n {loaded && (typeof children === 'function' ? children({ isInView }) : children)}\n </div>\n );\n }\n) as LazyLoaderType;\n\nfunction getStyles() {\n return {\n hideEmpty: css({\n '&:empty': {\n display: 'none',\n },\n }),\n };\n}\n\nLazyLoader.displayName = 'LazyLoader';\nLazyLoader.callbacks = {} as Record<string, (e: IntersectionObserverEntry) => void>;\nLazyLoader.addCallback = (id: string, c: (e: IntersectionObserverEntry) => void) => (LazyLoader.callbacks[id] = c);\nLazyLoader.observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (typeof LazyLoader.callbacks[entry.target.id] === 'function') {\n LazyLoader.callbacks[entry.target.id](entry);\n }\n }\n },\n { rootMargin: '100px' }\n);\n","import React, { RefCallback, useEffect, useRef } from 'react';\nimport ReactGridLayout from 'react-grid-layout';\nimport { SceneComponentProps } from '../../../core/types';\nimport { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN, GRID_COLUMN_COUNT } from './constants';\nimport { LazyLoader } from '../LazyLoader';\nimport { SceneGridLayout } from './SceneGridLayout';\nimport { SceneGridItemLike } from './types';\nimport { useStyles2 } from '@grafana/ui';\nimport { css, cx } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useMeasure } from 'react-use';\n\nexport function SceneGridLayoutRenderer({ model }: SceneComponentProps<SceneGridLayout>) {\n const { children, isLazy, isDraggable, isResizable } = model.useState();\n const [outerDivRef, { width, height }] = useMeasure();\n const ref = useRef<HTMLDivElement | null>(null);\n\n /**\n * The class that enables drag animations needs to be added after mount otherwise panels move on mount to their set positions which is annoying\n */\n useEffect(() => {\n updateAnimationClass(ref, !!isDraggable);\n }, [isDraggable]);\n\n validateChildrenSize(children);\n\n const renderGrid = (width: number, height: number) => {\n if (!width || !height) {\n return null;\n }\n\n const layout = model.buildGridLayout(width, height);\n\n return (\n /**\n * The children is using a width of 100% so we need to guarantee that it is wrapped\n * in an element that has the calculated size given by the AutoSizer. The AutoSizer\n * has a width of 0 and will let its content overflow its div.\n */\n <div ref={ref} style={{ width: `${width}px`, height: '100%' }} className=\"react-grid-layout\">\n <ReactGridLayout\n width={width}\n /**\n Disable draggable if mobile device, solving an issue with unintentionally\n moving panels. https://github.com/grafana/grafana/issues/18497\n theme.breakpoints.md = 769\n */\n isDraggable={isDraggable && width > 768}\n isResizable={isResizable ?? false}\n containerPadding={[0, 0]}\n useCSSTransforms={true}\n margin={[GRID_CELL_VMARGIN, GRID_CELL_VMARGIN]}\n cols={GRID_COLUMN_COUNT}\n rowHeight={GRID_CELL_HEIGHT}\n draggableHandle={`.grid-drag-handle-${model.state.key}`}\n draggableCancel=\".grid-drag-cancel\"\n layout={layout}\n onDragStart={model.onDragStart}\n onDragStop={model.onDragStop}\n onResizeStop={model.onResizeStop}\n onLayoutChange={model.onLayoutChange}\n isBounded={false}\n resizeHandle={<ResizeHandle />}\n >\n {layout.map((gridItem, index) => (\n <GridItemWrapper\n key={gridItem.i}\n grid={model}\n layoutItem={gridItem}\n index={index}\n isLazy={isLazy}\n totalCount={layout.length}\n />\n ))}\n </ReactGridLayout>\n </div>\n );\n };\n\n return (\n <div\n ref={outerDivRef as RefCallback<HTMLDivElement>}\n style={{ flex: '1 1 auto', position: 'relative', zIndex: 1, width: '100%' }}\n >\n {renderGrid(width, height)}\n </div>\n );\n}\n\ninterface GridItemWrapperProps extends React.HTMLAttributes<HTMLDivElement> {\n grid: SceneGridLayout;\n layoutItem: ReactGridLayout.Layout;\n index: number;\n totalCount: number;\n isLazy?: boolean;\n}\n\nconst GridItemWrapper = React.forwardRef<HTMLDivElement, GridItemWrapperProps>((props, ref) => {\n const { grid, layoutItem, index, totalCount, isLazy, style, onLoad, onChange, children, ...divProps } = props;\n const sceneChild = grid.getSceneLayoutChild(layoutItem.i)!;\n const className = sceneChild.getClassName?.();\n\n const innerContent = <sceneChild.Component model={sceneChild} key={sceneChild.state.key} />;\n\n if (isLazy) {\n return (\n <LazyLoader\n {...divProps}\n key={sceneChild.state.key!}\n data-griditem-key={sceneChild.state.key}\n className={cx(className, props.className)}\n style={style}\n ref={ref}\n >\n {innerContent}\n {children}\n </LazyLoader>\n );\n }\n\n return (\n <div\n {...divProps}\n ref={ref}\n key={sceneChild.state.key}\n data-griditem-key={sceneChild.state.key}\n className={cx(className, props.className)}\n style={style}\n >\n {innerContent}\n {children}\n </div>\n );\n});\n\nGridItemWrapper.displayName = 'GridItemWrapper';\n\nfunction validateChildrenSize(children: SceneGridItemLike[]) {\n if (\n children.some(\n (c) =>\n c.state.height === undefined ||\n c.state.width === undefined ||\n c.state.x === undefined ||\n c.state.y === undefined\n )\n ) {\n throw new Error('All children must have a size specified');\n }\n}\n\nfunction updateAnimationClass(\n ref: React.MutableRefObject<HTMLDivElement | null>,\n isDraggable: boolean,\n retry?: boolean\n) {\n if (ref.current) {\n if (isDraggable) {\n ref.current.classList.add('react-grid-layout--enable-move-animations');\n } else {\n ref.current.classList.remove('react-grid-layout--enable-move-animations');\n }\n } else if (!retry) {\n setTimeout(() => updateAnimationClass(ref, isDraggable, true), 50);\n }\n}\n\ninterface ResizeHandleProps extends React.HTMLAttributes<HTMLDivElement> {\n handleAxis?: string;\n}\n\nconst ResizeHandle = React.forwardRef<HTMLDivElement, ResizeHandleProps>(({ handleAxis, ...divProps }, ref) => {\n const customCssClass = useStyles2(getResizeHandleStyles);\n\n return (\n <div ref={ref} {...divProps} className={`${customCssClass} scene-resize-handle`}>\n <svg width=\"16px\" height=\"16px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M21 15L15 21M21 8L8 21\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n );\n});\n\nResizeHandle.displayName = 'ResizeHandle';\n\nfunction getResizeHandleStyles(theme: GrafanaTheme2) {\n return css({\n position: 'absolute',\n bottom: 0,\n right: 0,\n zIndex: 999,\n padding: theme.spacing(1.5, 0, 0, 1.5),\n color: theme.colors.border.strong,\n cursor: 'se-resize',\n '&:hover': {\n color: theme.colors.text.link,\n },\n svg: {\n display: 'block',\n },\n '.react-resizable-hide &': {\n display: 'none',\n },\n });\n}\n","import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN } from './constants';\n\nexport function fitPanelsInHeight(cells: ReactGridLayout.Layout[], height: number) {\n // Take into account cell margint top + cell margin bottom + adding some marging at the bottom\n const visibleHeight = height - GRID_CELL_VMARGIN * 4;\n const currentGridHeight = Math.max(...cells.map((cell) => cell.h + cell.y));\n\n const visibleGridHeight = Math.floor(visibleHeight / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN));\n const scaleFactor = currentGridHeight / visibleGridHeight;\n\n return cells.map((cell) => {\n return {\n ...cell,\n y: Math.round(cell.y / scaleFactor) || 0,\n h: Math.round(cell.h / scaleFactor) || 1,\n };\n });\n}\n","import ReactGridLayout from 'react-grid-layout';\n\nimport { SceneObjectBase } from '../../../core/SceneObjectBase';\nimport { SceneLayout, SceneObjectState } from '../../../core/types';\nimport { DEFAULT_PANEL_SPAN } from './constants';\nimport { isSceneGridRow } from './SceneGridItem';\nimport { SceneGridLayoutRenderer } from './SceneGridLayoutRenderer';\n\nimport { SceneGridRow } from './SceneGridRow';\nimport { SceneGridItemLike, SceneGridItemPlacement } from './types';\nimport { fitPanelsInHeight } from './utils';\n\ninterface SceneGridLayoutState extends SceneObjectState {\n /**\n * Turn on or off dragging for all items. Individual items can still disabled via isDraggable property\n **/\n isDraggable?: boolean;\n /** Enable or disable item resizing */\n isResizable?: boolean;\n isLazy?: boolean;\n /**\n * Fit panels to height of the grid. This will scale down the panels vertically to fit available height.\n * The row height is not changed, only the y position and height of the panels.\n * UNSAFE: This feature is experimental and it might change in the future.\n */\n UNSAFE_fitPanels?: boolean;\n children: SceneGridItemLike[];\n}\n\nexport class SceneGridLayout extends SceneObjectBase<SceneGridLayoutState> implements SceneLayout {\n public static Component = SceneGridLayoutRenderer;\n\n private _skipOnLayoutChange = false;\n private _oldLayout: ReactGridLayout.Layout[] = [];\n private _loadOldLayout = false;\n\n public constructor(state: SceneGridLayoutState) {\n super({\n ...state,\n children: sortChildrenByPosition(state.children),\n });\n }\n\n /**\n * SceneLayout interface. Used for example by VizPanelRenderer\n */\n public isDraggable(): boolean {\n return this.state.isDraggable ?? false;\n }\n\n public getDragClass() {\n return `grid-drag-handle-${this.state.key}`;\n }\n\n public getDragClassCancel() {\n return `grid-drag-cancel`;\n }\n\n public toggleRow(row: SceneGridRow) {\n const isCollapsed = row.state.isCollapsed;\n\n if (!isCollapsed) {\n row.setState({ isCollapsed: true });\n // To force re-render\n this.setState({});\n return;\n }\n\n const rowChildren = row.state.children;\n\n if (rowChildren.length === 0) {\n row.setState({ isCollapsed: false });\n this.setState({});\n return;\n }\n\n // Ok we are expanding row. We need to update row children y pos (incase they are incorrect) and push items below down\n // Code copied from DashboardModel toggleRow()\n\n const rowY = row.state.y!;\n const firstPanelYPos = rowChildren[0].state.y ?? rowY;\n const yDiff = firstPanelYPos - (rowY + 1);\n\n // y max will represent the bottom y pos after all panels have been added\n // needed to know home much panels below should be pushed down\n let yMax = rowY;\n\n for (const panel of rowChildren) {\n // set the y gridPos if it wasn't already set\n const newSize = { ...panel.state };\n newSize.y = newSize.y ?? rowY;\n // make sure y is adjusted (in case row moved while collapsed)\n newSize.y -= yDiff;\n\n if (newSize.y! !== panel.state.y!) {\n panel.setState(newSize);\n }\n\n // update insert post and y max\n yMax = Math.max(yMax, Number(newSize.y!) + Number(newSize.height!));\n }\n\n const pushDownAmount = yMax - rowY - 1;\n\n // push panels below down\n for (const child of this.state.children) {\n if (child.state.y! > rowY) {\n this.pushChildDown(child, pushDownAmount);\n }\n\n if (isSceneGridRow(child) && child !== row) {\n for (const rowChild of child.state.children) {\n if (rowChild.state.y! > rowY) {\n this.pushChildDown(rowChild, pushDownAmount);\n }\n }\n }\n }\n\n row.setState({ isCollapsed: false });\n // Trigger re-render\n this.setState({});\n }\n\n public ignoreLayoutChange(shouldIgnore: boolean) {\n this._skipOnLayoutChange = shouldIgnore;\n }\n\n public onLayoutChange = (layout: ReactGridLayout.Layout[]) => {\n if (this._skipOnLayoutChange) {\n // Layout has been updated by other RTL handler already\n this._skipOnLayoutChange = false;\n return;\n }\n\n // We replace with the old layout only if the current state is invalid\n if (this._loadOldLayout) {\n layout = [...this._oldLayout];\n this._loadOldLayout = false;\n }\n\n for (const item of layout) {\n const child = this.getSceneLayoutChild(item.i);\n\n const nextSize: SceneGridItemPlacement = {\n x: item.x,\n y: item.y,\n width: item.w,\n height: item.h,\n };\n\n if (!isItemSizeEqual(child.state, nextSize)) {\n child.setState({\n ...nextSize,\n });\n }\n }\n\n this.setState({ children: sortChildrenByPosition(this.state.children) });\n };\n\n /**\n * Will also scan row children and return child of the row\n */\n public getSceneLayoutChild(key: string): SceneGridItemLike {\n for (const child of this.state.children) {\n if (child.state.key === key) {\n return child;\n }\n\n if (child instanceof SceneGridRow) {\n for (const rowChild of child.state.children) {\n if (rowChild.state.key === key) {\n return rowChild;\n }\n }\n }\n }\n\n throw new Error('Scene layout child not found for GridItem');\n }\n\n public onResizeStop: ReactGridLayout.ItemCallback = (_, o, n) => {\n const child = this.getSceneLayoutChild(n.i);\n child.setState({\n width: n.w,\n height: n.h,\n });\n };\n\n private pushChildDown(child: SceneGridItemLike, amount: number) {\n child.setState({\n y: child.state.y! + amount,\n });\n }\n\n /**\n * We assume the layout array is sorted according to y pos, and walk upwards until we find a row.\n * If it is collapsed there is no row to add it to. The default is then to return the SceneGridLayout itself\n */\n private findGridItemSceneParent(layout: ReactGridLayout.Layout[], startAt: number): SceneGridRow | SceneGridLayout {\n for (let i = startAt; i >= 0; i--) {\n const gridItem = layout[i];\n const sceneChild = this.getSceneLayoutChild(gridItem.i);\n\n if (sceneChild instanceof SceneGridRow) {\n // the closest row is collapsed return null\n if (sceneChild.state.isCollapsed) {\n return this;\n }\n\n return sceneChild;\n }\n }\n\n return this;\n }\n\n /**\n * Helper func to check if we are dropping a row in between panels of another row\n */\n private isRowDropValid(\n gridLayout: ReactGridLayout.Layout[],\n updatedItem: ReactGridLayout.Layout,\n indexOfUpdatedItem: number\n ): boolean {\n // if the row is dropped at the end of the dashboard grid layout, we accept this valid state\n if (gridLayout[gridLayout.length - 1].i === updatedItem.i) {\n return true;\n }\n\n // if the next child after the updated item is a scene grid row, then we are either at the top\n // of the dashboard, or between rows\n // if it's not a grid row, but it's parent is the layout, it means we are not in between a\n // rows children, so also valid state\n const nextSceneChild = this.getSceneLayoutChild(gridLayout[indexOfUpdatedItem + 1].i);\n if (nextSceneChild instanceof SceneGridRow) {\n return true;\n } else if (nextSceneChild.parent instanceof SceneGridLayout) {\n return true;\n }\n\n return false;\n }\n\n /**\n * This likely needs a slightly different approach. Where we clone or deactivate or and re-activate the moved child\n */\n public moveChildTo(child: SceneGridItemLike, target: SceneGridLayout | SceneGridRow) {\n const currentParent = child.parent!;\n let rootChildren = this.state.children;\n\n const newChild = child.clone({ key: child.state.key });\n\n // Remove from current parent row\n if (currentParent instanceof SceneGridRow) {\n const newRow = currentParent.clone();\n newRow.setState({\n children: newRow.state.children.filter((c) => c.state.key !== child.state.key),\n });\n\n // new children with new row\n rootChildren = rootChildren.map((c) => (c === currentParent ? newRow : c));\n\n // if target is also a row\n if (target instanceof SceneGridRow) {\n const targetRow = target.clone();\n targetRow.setState({ children: [...targetRow.state.children, newChild] });\n rootChildren = rootChildren.map((c) => (c === target ? targetRow : c));\n } else {\n // target is the main grid\n rootChildren = [...rootChildren, newChild];\n }\n } else {\n if (!(target instanceof SceneGridLayout)) {\n // current parent is the main grid remove it from there\n rootChildren = rootChildren.filter((c) => c.state.key !== child.state.key);\n // Clone the target row and add the child\n const targetRow = target.clone();\n targetRow.setState({ children: [...targetRow.state.children, newChild] });\n // Replace row with new row\n rootChildren = rootChildren.map((c) => (c === target ? targetRow : c));\n }\n }\n\n return rootChildren;\n }\n\n public onDragStart: ReactGridLayout.ItemCallback = (gridLayout) => {\n this._oldLayout = [...gridLayout];\n };\n\n public onDragStop: ReactGridLayout.ItemCallback = (gridLayout, o, updatedItem) => {\n const sceneChild = this.getSceneLayoutChild(updatedItem.i)!;\n\n // Need to resort the grid layout based on new position (needed to find the new parent)\n gridLayout = sortGridLayout(gridLayout);\n\n // Update children positions if they have changed\n for (let i = 0; i < gridLayout.length; i++) {\n const gridItem = gridLayout[i];\n const child = this.getSceneLayoutChild(gridItem.i)!;\n const childSize = child.state;\n\n if (childSize?.x !== gridItem.x || childSize?.y !== gridItem.y) {\n child.setState({\n x: gridItem.x,\n y: gridItem.y,\n });\n }\n }\n\n // Update the parent if the child if it has moved to a row or back to the grid\n const indexOfUpdatedItem = gridLayout.findIndex((item) => item.i === updatedItem.i);\n let newParent = this.findGridItemSceneParent(gridLayout, indexOfUpdatedItem - 1);\n let newChildren = this.state.children;\n\n // if the child is a row and we are moving it under an uncollapsed row, keep the scene grid layout as parent\n // and set the old layout flag if the state is invalid. We allow setting the children in an invalid state,\n // as the layout will be updated in onLayoutChange and avoid flickering\n if (sceneChild instanceof SceneGridRow && newParent instanceof SceneGridRow) {\n if (!this.isRowDropValid(gridLayout, updatedItem, indexOfUpdatedItem)) {\n this._loadOldLayout = true;\n }\n\n newParent = this;\n }\n\n if (newParent !== sceneChild.parent) {\n newChildren = this.moveChildTo(sceneChild, newParent);\n }\n\n this.setState({ children: sortChildrenByPosition(newChildren) });\n this._skipOnLayoutChange = true;\n };\n\n private toGridCell(child: SceneGridItemLike): ReactGridLayout.Layout {\n const size = child.state;\n\n let x = size.x ?? 0;\n let y = size.y ?? 0;\n const w = Number.isInteger(Number(size.width)) ? Number(size.width) : DEFAULT_PANEL_SPAN;\n const h = Number.isInteger(Number(size.height)) ? Number(size.height) : DEFAULT_PANEL_SPAN;\n\n let isDraggable = child.state.isDraggable;\n let isResizable = child.state.isResizable;\n\n if (child instanceof SceneGridRow) {\n isDraggable = child.state.isCollapsed ? true : false;\n isResizable = false;\n }\n\n return { i: child.state.key!, x, y, h, w, isResizable, isDraggable };\n }\n\n public buildGridLayout(width: number, height: number): ReactGridLayout.Layout[] {\n let cells: ReactGridLayout.Layout[] = [];\n\n for (const child of this.state.children) {\n cells.push(this.toGridCell(child));\n\n if (child instanceof SceneGridRow && !child.state.isCollapsed) {\n for (const rowChild of child.state.children) {\n cells.push(this.toGridCell(rowChild));\n }\n }\n }\n\n // Sort by position\n cells = sortGridLayout(cells);\n\n if (this.state.UNSAFE_fitPanels) {\n cells = fitPanelsInHeight(cells, height);\n }\n\n if (width < 768) {\n // We should not persist the mobile layout\n this._skipOnLayoutChange = true;\n return cells.map((cell) => ({ ...cell, w: 24 }));\n }\n\n this._skipOnLayoutChange = false;\n\n return cells;\n }\n}\n\nfunction isItemSizeEqual(a: SceneGridItemPlacement, b: SceneGridItemPlacement) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\nfunction sortChildrenByPosition(children: SceneGridItemLike[]) {\n children.forEach((child) => {\n if (child instanceof SceneGridRow) {\n child.setState({ children: sortChildrenByPosition(child.state.children) });\n }\n });\n\n return [...children].sort((a, b) => {\n return a.state.y! - b.state.y! || a.state.x! - b.state.x!;\n });\n}\n\nfunction sortGridLayout(layout: ReactGridLayout.Layout[]) {\n return [...layout].sort((a, b) => a.y - b.y || a.x! - b.x);\n}\n","import { css, cx } from '@emotion/css';\nimport React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { Icon, useStyles2 } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObject, SceneObjectUrlValues } from '../../../core/types';\n\nimport { SceneGridLayout } from './SceneGridLayout';\nimport { GRID_COLUMN_COUNT } from './constants';\nimport { SceneGridItemLike, SceneGridItemStateLike } from './types';\nimport { sceneGraph } from '../../../core/sceneGraph';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { VariableDependencyConfig } from '../../../variables/VariableDependencyConfig';\n\nexport interface SceneGridRowState extends SceneGridItemStateLike {\n title: string;\n isCollapsible?: boolean;\n isCollapsed?: boolean;\n actions?: SceneObject;\n children: SceneGridItemLike[];\n}\n\nexport class SceneGridRow extends SceneObjectBase<SceneGridRowState> {\n public static Component = SceneGridRowRenderer;\n\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['title'],\n });\n\n public constructor(state: Partial<SceneGridRowState>) {\n super({\n children: state.children || [],\n isCollapsible: state.isCollapsible || true,\n title: state.title || '',\n ...state,\n x: 0,\n height: 1,\n width: GRID_COLUMN_COUNT,\n });\n }\n\n public getGridLayout(): SceneGridLayout {\n const layout = this.parent;\n\n if (!layout || !(layout instanceof SceneGridLayout)) {\n throw new Error('SceneGridRow must be a child of SceneGridLayout');\n }\n\n return layout;\n }\n\n public onCollapseToggle = () => {\n if (!this.state.isCollapsible) {\n return;\n }\n\n this.getGridLayout().toggleRow(this);\n };\n\n public getUrlState() {\n return { rowc: this.state.isCollapsed ? '1' : '0' };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n if (values.rowc == null) {\n return;\n }\n\n if (values.rowc !== this.getUrlState().rowc) {\n this.onCollapseToggle();\n }\n }\n}\n\nexport function SceneGridRowRenderer({ model }: SceneComponentProps<SceneGridRow>) {\n const styles = useStyles2(getSceneGridRowStyles);\n const { isCollapsible, isCollapsed, title, actions, children } = model.useState();\n const layout = model.getGridLayout();\n const layoutDragClass = layout.getDragClass();\n const isDraggable = layout.isDraggable();\n\n const count = children ? children.length : 0;\n const panels = count === 1 ? 'panel' : 'panels';\n\n return (\n <div className={cx(styles.row, isCollapsed && styles.rowCollapsed)}>\n <div className={styles.rowTitleAndActionsGroup}>\n <button\n onClick={model.onCollapseToggle}\n className={styles.rowTitleButton}\n aria-label={isCollapsed ? 'Expand row' : 'Collapse row'}\n data-testid={selectors.components.DashboardRow.title(sceneGraph.interpolate(model, title, undefined, 'text'))}\n >\n {isCollapsible && <Icon name={isCollapsed ? 'angle-right' : 'angle-down'} />}\n <span className={styles.rowTitle} role=\"heading\">\n {sceneGraph.interpolate(model, title, undefined, 'text')}\n </span>\n </button>\n <span className={cx(styles.panelCount, isCollapsed && styles.panelCountCollapsed)}>\n ({count} {panels})\n </span>\n {actions && (\n <div className={styles.rowActions}>\n <actions.Component model={actions} />\n </div>\n )}\n </div>\n {isDraggable && isCollapsed && (\n <div className={cx(styles.dragHandle, layoutDragClass)}>\n <Icon name=\"draggabledots\" />\n </div>\n )}\n </div>\n );\n}\n\nexport const getSceneGridRowStyles = (theme: GrafanaTheme2) => {\n return {\n row: css({\n width: '100%',\n height: '30px',\n display: 'flex',\n justifyContent: 'space-between',\n gap: theme.spacing(1),\n }),\n rowTitleButton: css({\n display: 'flex',\n alignItems: 'center',\n cursor: 'pointer',\n background: 'transparent',\n border: 'none',\n gap: theme.spacing(1),\n }),\n rowCollapsed: css({\n borderBottom: `1px solid ${theme.colors.border.weak}`,\n }),\n rowTitle: css({\n fontSize: theme.typography.h5.fontSize,\n fontWeight: theme.typography.fontWeightMedium,\n }),\n collapsedInfo: css({\n fontSize: theme.typography.bodySmall.fontSize,\n color: theme.colors.text.secondary,\n display: 'flex',\n alignItems: 'center',\n flexGrow: 1,\n }),\n rowTitleAndActionsGroup: css({\n display: 'flex',\n\n '&:hover, &:focus-within': {\n '& > div': {\n opacity: 1,\n },\n },\n }),\n rowActions: css({\n display: 'flex',\n opacity: 0,\n transition: '200ms opacity ease-in 200ms',\n\n '&:hover, &:focus-within': {\n opacity: 1,\n },\n }),\n dragHandle: css({\n display: 'flex',\n padding: theme.spacing(0, 1),\n alignItems: 'center',\n justifyContent: 'flex-end',\n cursor: 'move',\n color: theme.colors.text.secondary,\n '&:hover': {\n color: theme.colors.text.primary,\n },\n }),\n panelCount: css({\n paddingLeft: theme.spacing(2),\n color: theme.colors.text.secondary,\n fontStyle: 'italic',\n fontSize: theme.typography.size.sm,\n fontWeight: 'normal',\n display: 'none',\n lineHeight: '30px',\n }),\n panelCountCollapsed: css({\n display: 'inline-block',\n }),\n };\n};\n","import { css, cx } from '@emotion/css';\nimport React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { Icon, ToolbarButton, useStyles2 } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneObject, SceneComponentProps, SceneLayout, SceneObjectState } from '../core/types';\nimport { getSceneGridRowStyles } from './layout/grid/SceneGridRow';\nimport { sceneGraph } from '../core/sceneGraph';\n\ninterface NestedSceneState extends SceneObjectState {\n title: string;\n isCollapsed?: boolean;\n canCollapse?: boolean;\n canRemove?: boolean;\n body: SceneLayout;\n controls?: SceneObject[];\n}\n\n/**\n * @internal\n * POC status, don't use this yet\n */\nexport class NestedScene extends SceneObjectBase<NestedSceneState> {\n public static Component = NestedSceneRenderer;\n\n public onToggle = () => {\n this.setState({\n isCollapsed: !this.state.isCollapsed,\n });\n };\n\n /** Removes itself from its parent's children array */\n public onRemove = () => {\n const parent = this.parent!;\n\n if (isSceneLayoutItem(parent)) {\n parent.setState({\n body: undefined,\n });\n }\n };\n}\n\nexport function NestedSceneRenderer({ model }: SceneComponentProps<NestedScene>) {\n const { title, isCollapsed, canCollapse, canRemove, body, controls } = model.useState();\n const gridRow = useStyles2(getSceneGridRowStyles);\n const styles = useStyles2(getStyles);\n\n const toolbarControls = (controls ?? []).map((action) => <action.Component key={action.state.key} model={action} />);\n\n if (canRemove) {\n toolbarControls.push(\n <ToolbarButton\n icon=\"times\"\n variant={'default'}\n onClick={model.onRemove}\n key=\"remove-button\"\n aria-label=\"Remove scene\"\n />\n );\n }\n\n return (\n <div className={styles.wrapper}>\n <div className={cx(styles.row, isCollapsed && styles.rowCollapsed)}>\n <button\n onClick={model.onToggle}\n className={gridRow.rowTitleButton}\n aria-label={isCollapsed ? 'Expand scene' : 'Collapse scene'}\n >\n {canCollapse && <Icon name={isCollapsed ? 'angle-right' : 'angle-down'} />}\n <span className={gridRow.rowTitle} role=\"heading\">\n {sceneGraph.interpolate(model, title, undefined, 'text')}\n </span>\n </button>\n <div className={styles.actions}>{toolbarControls}</div>\n </div>\n {!isCollapsed && <body.Component model={body} />}\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n wrapper: css({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n gap: theme.spacing(1),\n }),\n row: css({\n width: '100%',\n display: 'flex',\n justifyContent: 'space-between',\n gap: theme.spacing(1),\n }),\n rowCollapsed: css({\n borderBottom: `1px solid ${theme.colors.border.weak}`,\n paddingBottom: theme.spacing(1),\n }),\n actions: css({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n justifyContent: 'flex-end',\n flexGrow: 1,\n }),\n});\n\nfunction isSceneLayoutItem(x: SceneObject): x is SceneObject<SceneObjectState & { body: SceneObject | undefined }> {\n return 'body' in x.state;\n}\n","import React from 'react';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneObjectState } from '../core/types';\nimport { VariableDependencyConfig } from '../variables/VariableDependencyConfig';\nimport { useTheme2 } from '@grafana/ui';\nimport { css } from '@emotion/css';\n\nexport interface SceneCanvasTextState extends SceneObjectState {\n text: string;\n fontSize?: number;\n align?: 'left' | 'center' | 'right';\n spacing?: number;\n}\n\n/**\n * Not a really useful component, just an example of how to create one\n * @internal\n */\nexport class SceneCanvasText extends SceneObjectBase<SceneCanvasTextState> {\n protected _variableDependency = new VariableDependencyConfig(this, { statePaths: ['text'] });\n\n public static Component = ({ model }: SceneComponentProps<SceneCanvasText>) => {\n const { text, fontSize = 20, align = 'left', key, spacing } = model.useState();\n const theme = useTheme2();\n\n const style = css({\n fontSize: fontSize,\n display: 'flex',\n flexGrow: 1,\n alignItems: 'center',\n padding: spacing ? theme.spacing(spacing, 0) : undefined,\n justifyContent: align,\n });\n\n return (\n <div className={style} data-testid={key}>\n {sceneGraph.interpolate(model, text)}\n </div>\n );\n };\n}\n","import React from 'react';\n\nimport { IconName, Input, ToolbarButton } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectState } from '../core/types';\nimport { ControlsLabel } from '../utils/ControlsLabel';\n\nexport interface ToolbarButtonState extends SceneObjectState {\n icon: IconName;\n onClick: () => void;\n}\n\nexport class SceneToolbarButton extends SceneObjectBase<ToolbarButtonState> {\n public static Component = ({ model }: SceneComponentProps<SceneToolbarButton>) => {\n const state = model.useState();\n\n return <ToolbarButton onClick={state.onClick} icon={state.icon} />;\n };\n}\n\nexport interface SceneToolbarInputState extends SceneObjectState {\n value?: string;\n label?: string;\n onChange: (value: number) => void;\n}\n\nexport class SceneToolbarInput extends SceneObjectBase<SceneToolbarInputState> {\n public static Component = ({ model }: SceneComponentProps<SceneToolbarInput>) => {\n const state = model.useState();\n\n return (\n <div style={{ display: 'flex' }}>\n {state.label && <ControlsLabel label={state.label} />}\n <Input\n defaultValue={state.value}\n width={8}\n onBlur={(evt) => {\n model.state.onChange(parseInt(evt.currentTarget.value, 10));\n }}\n />\n </div>\n );\n };\n}\n","import React from 'react';\n\nimport { TimeRangePicker } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneObjectState } from '../core/types';\nimport { TimeRange, toUtc } from '@grafana/data';\n\nexport interface SceneTimePickerState extends SceneObjectState {\n hidePicker?: boolean;\n isOnCanvas?: boolean;\n}\n\nexport class SceneTimePicker extends SceneObjectBase<SceneTimePickerState> {\n public static Component = SceneTimePickerRenderer;\n\n public onZoom = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const zoomedTimeRange = getZoomedTimeRange(timeRange.state.value, 2);\n timeRange.onTimeRangeChange(zoomedTimeRange);\n };\n\n public onChangeFiscalYearStartMonth = (month: number) => {\n const timeRange = sceneGraph.getTimeRange(this);\n timeRange.setState({ fiscalYearStartMonth: month });\n };\n\n public toAbsolute = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const timeRangeVal = timeRange.state.value;\n const from = toUtc(timeRangeVal.from);\n const to = toUtc(timeRangeVal.to);\n timeRange.onTimeRangeChange({ from, to, raw: { from, to } });\n };\n\n public onMoveBackward = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const {\n state: { value: range },\n } = timeRange;\n\n timeRange.onTimeRangeChange(getShiftedTimeRange(TimeRangeDirection.Backward, range, Date.now()));\n };\n\n public onMoveForward = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const {\n state: { value: range },\n } = timeRange;\n\n timeRange.onTimeRangeChange(getShiftedTimeRange(TimeRangeDirection.Forward, range, Date.now()));\n };\n}\n\nfunction SceneTimePickerRenderer({ model }: SceneComponentProps<SceneTimePicker>) {\n const { hidePicker, isOnCanvas } = model.useState();\n const timeRange = sceneGraph.getTimeRange(model);\n const timeZone = timeRange.getTimeZone();\n const timeRangeState = timeRange.useState();\n\n if (hidePicker) {\n return null;\n }\n\n return (\n <TimeRangePicker\n isOnCanvas={isOnCanvas ?? true}\n value={timeRangeState.value}\n onChange={timeRange.onTimeRangeChange}\n timeZone={timeZone}\n fiscalYearStartMonth={timeRangeState.fiscalYearStartMonth}\n onMoveBackward={model.onMoveBackward}\n onMoveForward={model.onMoveForward}\n onZoom={model.onZoom}\n onChangeTimeZone={timeRange.onTimeZoneChange}\n onChangeFiscalYearStartMonth={model.onChangeFiscalYearStartMonth}\n />\n );\n}\n\nexport function getZoomedTimeRange(timeRange: TimeRange, factor: number): TimeRange {\n const timespan = timeRange.to.valueOf() - timeRange.from.valueOf();\n const center = timeRange.to.valueOf() - timespan / 2;\n // If the timepsan is 0, zooming out would do nothing, so we force a zoom out to 30s\n const newTimespan = timespan === 0 ? 30000 : timespan * factor;\n\n const to = center + newTimespan / 2;\n const from = center - newTimespan / 2;\n\n return { from: toUtc(from), to: toUtc(to), raw: { from: toUtc(from), to: toUtc(to) } };\n}\n\nexport enum TimeRangeDirection {\n Backward,\n Forward,\n}\n\nexport function getShiftedTimeRange(dir: TimeRangeDirection, timeRange: TimeRange, upperLimit: number): TimeRange {\n const oldTo = timeRange.to.valueOf();\n const oldFrom = timeRange.from.valueOf();\n const halfSpan = (oldTo - oldFrom) / 2;\n\n let fromRaw: number;\n let toRaw: number;\n if (dir === TimeRangeDirection.Backward) {\n fromRaw = oldFrom - halfSpan;\n toRaw = oldTo - halfSpan;\n } else {\n fromRaw = oldFrom + halfSpan;\n toRaw = oldTo + halfSpan;\n\n if (toRaw > upperLimit && oldTo < upperLimit) {\n toRaw = upperLimit;\n fromRaw = oldFrom;\n }\n }\n\n const from = toUtc(fromRaw);\n const to = toUtc(toRaw);\n return {\n from,\n to,\n raw: { from, to },\n };\n}\n","import React from 'react';\nimport { Unsubscribable } from 'rxjs';\nimport { rangeUtil } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { RefreshPicker } from '@grafana/ui';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneObject, SceneObjectState, SceneObjectUrlValues } from '../core/types';\nimport { SceneObjectUrlSyncConfig } from '../services/SceneObjectUrlSyncConfig';\n\nexport const DEFAULT_INTERVALS = ['5s', '10s', '30s', '1m', '5m', '15m', '30m', '1h', '2h', '1d'];\n\nexport interface SceneRefreshPickerState extends SceneObjectState {\n // Refresh interval, e.g. 5s, 1m, 2h\n refresh: string;\n autoEnabled?: boolean;\n autoMinInterval?: string;\n autoValue?: string;\n // List of allowed refresh intervals, e.g. ['5s', '1m']\n intervals?: string[];\n isOnCanvas?: boolean;\n primary?: boolean;\n withText?: boolean;\n}\n\nexport class SceneRefreshPicker extends SceneObjectBase<SceneRefreshPickerState> {\n public static Component = SceneRefreshPickerRenderer;\n protected _urlSync = new SceneObjectUrlSyncConfig(this, { keys: ['refresh'] });\n private _intervalTimer: ReturnType<typeof setInterval> | undefined;\n private _autoTimeRangeListener: Unsubscribable | undefined;\n private _autoRefreshBlocked: boolean = false;\n\n public constructor(state: Partial<SceneRefreshPickerState>) {\n super({\n refresh: '',\n ...state,\n autoValue: undefined,\n autoEnabled: state.autoEnabled ?? true,\n autoMinInterval: state.autoMinInterval ?? config.minRefreshInterval,\n intervals: state.intervals ?? DEFAULT_INTERVALS,\n });\n\n this.addActivationHandler(() => {\n this.setupIntervalTimer();\n\n const onVisibilityChange = () => {\n if (this._autoRefreshBlocked && document.visibilityState === 'visible') {\n this._autoRefreshBlocked = false;\n this.onRefresh();\n }\n }\n\n document.addEventListener('visibilitychange', onVisibilityChange);\n\n return () => {\n if (this._intervalTimer) {\n clearInterval(this._intervalTimer);\n }\n\n document.removeEventListener('visibilitychange', onVisibilityChange);\n this._autoTimeRangeListener?.unsubscribe();\n };\n });\n }\n\n public onRefresh = () => {\n const queryController = sceneGraph.getQueryController(this);\n if (queryController?.state.isRunning) {\n queryController.cancelAll();\n return;\n }\n\n const timeRange = sceneGraph.getTimeRange(this);\n\n if (this._intervalTimer) {\n clearInterval(this._intervalTimer);\n }\n\n timeRange.onRefresh();\n this.setupIntervalTimer();\n };\n\n public onIntervalChanged = (interval: string) => {\n this.setState({ refresh: interval });\n this.setupIntervalTimer();\n };\n\n public getUrlState() {\n return {\n refresh: this.state.refresh,\n };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n const refresh = values.refresh;\n\n if (refresh && typeof refresh === 'string') {\n this.setState({\n refresh,\n });\n }\n }\n\n private setupAutoTimeRangeListener = () => {\n // If the time range has changed, we need to recalculate the auto interval but prevent unnecessary processing\n return sceneGraph.getTimeRange(this).subscribeToState((newState, prevState) => {\n if (newState.from !== prevState.from || newState.to !== prevState.to) {\n this.setupIntervalTimer();\n }\n });\n };\n\n private calculateAutoRefreshInterval = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const resolution = window?.innerWidth ?? 2000;\n return rangeUtil.calculateInterval(timeRange.state.value, resolution, this.state.autoMinInterval);\n };\n\n private isTabVisible() {\n return document.visibilityState === undefined || document.visibilityState === 'visible';\n }\n\n private setupIntervalTimer = () => {\n const timeRange = sceneGraph.getTimeRange(this);\n const { refresh, intervals } = this.state;\n\n if (this._intervalTimer || refresh === '') {\n clearInterval(this._intervalTimer);\n }\n\n if (refresh === '') {\n return;\n }\n\n // If the provided interval is not allowed\n if (refresh !== RefreshPicker.autoOption.value && intervals && !intervals.includes(refresh)) {\n return;\n }\n\n let intervalMs: number;\n\n // Unsubscribe from previous listener no matter what\n this._autoTimeRangeListener?.unsubscribe();\n\n if (refresh === RefreshPicker.autoOption.value) {\n const autoRefreshInterval = this.calculateAutoRefreshInterval();\n\n intervalMs = autoRefreshInterval.intervalMs;\n\n this._autoTimeRangeListener = this.setupAutoTimeRangeListener();\n\n if (autoRefreshInterval.interval !== this.state.autoValue) {\n this.setState({ autoValue: autoRefreshInterval.interval });\n }\n } else {\n intervalMs = rangeUtil.intervalToMs(refresh);\n }\n\n this._intervalTimer = setInterval(() => {\n if (this.isTabVisible()) {\n timeRange.onRefresh();\n } else {\n this._autoRefreshBlocked = true;\n }\n }, intervalMs);\n };\n}\n\nexport function SceneRefreshPickerRenderer({ model }: SceneComponentProps<SceneRefreshPicker>) {\n const { refresh, intervals, autoEnabled, autoValue, isOnCanvas, primary, withText } = model.useState();\n const isRunning = useQueryControllerState(model);\n\n let text = refresh === RefreshPicker.autoOption?.value ? autoValue : withText ? 'Refresh' : undefined;\n let tooltip: string | undefined;\n let width: string | undefined;\n\n if (isRunning) {\n tooltip = 'Cancel all queries';\n\n if (withText) {\n text = 'Cancel';\n }\n }\n\n if (withText) {\n width = '96px';\n }\n\n return (\n <RefreshPicker\n showAutoInterval={autoEnabled}\n value={refresh}\n intervals={intervals}\n tooltip={tooltip}\n width={width}\n text={text}\n onRefresh={model.onRefresh}\n primary={primary}\n onIntervalChanged={model.onIntervalChanged}\n isLoading={isRunning}\n isOnCanvas={isOnCanvas ?? true}\n />\n );\n}\n\nfunction useQueryControllerState(model: SceneObject): boolean {\n const queryController = sceneGraph.getQueryController(model);\n if (!queryController) {\n return false;\n }\n\n return queryController.useState().isRunning;\n}\n","export const getCompareSeriesRefId = (refId: string) => `${refId}-compare`;\n","import { DataQueryRequest, DateTime, dateTime, FieldType, GrafanaTheme2, rangeUtil, TimeRange } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { ButtonGroup, ButtonSelect, Checkbox, ToolbarButton, useStyles2 } from '@grafana/ui';\nimport React from 'react';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneComponentProps, SceneDataQuery, SceneObjectState, SceneObjectUrlValues } from '../core/types';\nimport { DataQueryExtended } from '../querying/SceneQueryRunner';\nimport { ExtraQueryDescriptor, ExtraQueryDataProcessor, ExtraQueryProvider } from '../querying/ExtraQueryProvider';\nimport { SceneObjectUrlSyncConfig } from '../services/SceneObjectUrlSyncConfig';\nimport { getCompareSeriesRefId } from '../utils/getCompareSeriesRefId';\nimport { parseUrlParam } from '../utils/parseUrlParam';\nimport { css } from '@emotion/css';\nimport { of } from 'rxjs';\n\ninterface SceneTimeRangeCompareState extends SceneObjectState {\n compareWith?: string;\n compareOptions: Array<{ label: string; value: string }>;\n}\n\nconst PREVIOUS_PERIOD_VALUE = '__previousPeriod';\nconst NO_PERIOD_VALUE = '__noPeriod';\n\nexport const PREVIOUS_PERIOD_COMPARE_OPTION = {\n label: 'Previous period',\n value: PREVIOUS_PERIOD_VALUE,\n};\n\nexport const NO_COMPARE_OPTION = {\n label: 'No comparison',\n value: NO_PERIOD_VALUE,\n};\n\nexport const DEFAULT_COMPARE_OPTIONS = [\n { label: 'Day before', value: '24h' },\n { label: 'Week before', value: '1w' },\n { label: 'Month before', value: '1M' },\n];\n\nexport class SceneTimeRangeCompare\n extends SceneObjectBase<SceneTimeRangeCompareState>\n implements ExtraQueryProvider<SceneTimeRangeCompareState>\n{\n static Component = SceneTimeRangeCompareRenderer;\n protected _urlSync = new SceneObjectUrlSyncConfig(this, { keys: ['compareWith'] });\n\n public constructor(state: Partial<SceneTimeRangeCompareState>) {\n super({ compareOptions: DEFAULT_COMPARE_OPTIONS, ...state });\n this.addActivationHandler(this._onActivate);\n }\n\n private _onActivate = () => {\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n this.setState({ compareOptions: this.getCompareOptions(sceneTimeRange.state.value) });\n\n this._subs.add(\n sceneTimeRange.subscribeToState((timeRange) => {\n const compareOptions = this.getCompareOptions(timeRange.value);\n const stateUpdate: Partial<SceneTimeRangeCompareState> = { compareOptions };\n\n // if current compareWith is not applicable to the new time range, set it to previous period comparison\n if (Boolean(this.state.compareWith) && !compareOptions.find(({ value }) => value === this.state.compareWith)) {\n stateUpdate.compareWith = PREVIOUS_PERIOD_VALUE;\n }\n\n this.setState(stateUpdate);\n })\n );\n };\n\n public getCompareOptions = (timeRange: TimeRange) => {\n const diffDays = Math.ceil(timeRange.to.diff(timeRange.from));\n\n const matchIndex = DEFAULT_COMPARE_OPTIONS.findIndex(({ value }) => {\n const intervalInMs = rangeUtil.intervalToMs(value);\n return intervalInMs >= diffDays;\n });\n\n return [\n NO_COMPARE_OPTION,\n PREVIOUS_PERIOD_COMPARE_OPTION,\n ...DEFAULT_COMPARE_OPTIONS.slice(matchIndex).map(({ label, value }) => ({ label, value })),\n ];\n };\n\n public onCompareWithChanged = (compareWith: string) => {\n if (compareWith === NO_PERIOD_VALUE) {\n this.onClearCompare();\n } else {\n this.setState({ compareWith });\n }\n };\n\n public onClearCompare = () => {\n this.setState({ compareWith: undefined });\n };\n\n // Get a time shifted request to compare with the primary request.\n public getExtraQueries(request: DataQueryRequest): ExtraQueryDescriptor[] {\n const extraQueries: ExtraQueryDescriptor[] = [];\n const compareRange = this.getCompareTimeRange(request.range);\n if (!compareRange) {\n return extraQueries;\n }\n\n const targets = request.targets.filter((query: DataQueryExtended) => query.timeRangeCompare !== false);\n if (targets.length) {\n extraQueries.push({\n req: {\n ...request,\n targets,\n range: compareRange,\n },\n processor: timeShiftAlignmentProcessor,\n });\n }\n return extraQueries;\n }\n\n // The query runner should rerun the comparison query if the compareWith value has changed and there are queries that haven't opted out of TWC\n public shouldRerun(\n prev: SceneTimeRangeCompareState,\n next: SceneTimeRangeCompareState,\n queries: SceneDataQuery[]\n ): boolean {\n return (\n prev.compareWith !== next.compareWith && queries.find((query) => query.timeRangeCompare !== false) !== undefined\n );\n }\n\n public getCompareTimeRange(timeRange: TimeRange): TimeRange | undefined {\n let compareFrom: DateTime;\n let compareTo: DateTime;\n\n if (this.state.compareWith) {\n if (this.state.compareWith === PREVIOUS_PERIOD_VALUE) {\n const diffMs = timeRange.to.diff(timeRange.from);\n compareFrom = dateTime(timeRange.from!).subtract(diffMs);\n compareTo = dateTime(timeRange.to!).subtract(diffMs);\n } else {\n compareFrom = dateTime(timeRange.from!).subtract(rangeUtil.intervalToMs(this.state.compareWith));\n compareTo = dateTime(timeRange.to!).subtract(rangeUtil.intervalToMs(this.state.compareWith));\n }\n return {\n from: compareFrom,\n to: compareTo,\n raw: {\n from: compareFrom,\n to: compareTo,\n },\n };\n }\n\n return undefined;\n }\n\n public getUrlState(): SceneObjectUrlValues {\n return {\n compareWith: this.state.compareWith,\n };\n }\n\n public updateFromUrl(values: SceneObjectUrlValues) {\n if (!values.compareWith) {\n return;\n }\n\n const compareWith = parseUrlParam(values.compareWith);\n\n if (compareWith) {\n const compareOptions = this.getCompareOptions(sceneGraph.getTimeRange(this).state.value);\n\n if (compareOptions.find(({ value }) => value === compareWith)) {\n this.setState({\n compareWith,\n });\n } else {\n this.setState({\n compareWith: '__previousPeriod',\n });\n }\n }\n }\n}\n\n// Processor function for use with time shifted comparison series.\n// This aligns the secondary series with the primary and adds custom\n// metadata and config to the secondary series' fields so that it is\n// rendered appropriately.\nconst timeShiftAlignmentProcessor: ExtraQueryDataProcessor = (primary, secondary) => {\n const diff = secondary.timeRange.from.diff(primary.timeRange.from);\n secondary.series.forEach((series) => {\n series.refId = getCompareSeriesRefId(series.refId || '');\n series.meta = {\n ...series.meta,\n // @ts-ignore Remove when https://github.com/grafana/grafana/pull/71129 is released\n timeCompare: {\n diffMs: diff,\n isTimeShiftQuery: true,\n },\n };\n series.fields.forEach((field) => {\n // Align compare series time stamps with reference series\n if (field.type === FieldType.time) {\n field.values = field.values.map((v) => {\n return diff < 0 ? v - diff : v + diff;\n });\n }\n\n field.config = {\n ...field.config,\n color: {\n mode: 'fixed',\n fixedColor: config.theme.palette.gray60,\n },\n };\n return field;\n });\n });\n return of(secondary);\n};\n\nfunction SceneTimeRangeCompareRenderer({ model }: SceneComponentProps<SceneTimeRangeCompare>) {\n const styles = useStyles2(getStyles);\n const { compareWith, compareOptions } = model.useState();\n\n const [previousCompare, setPreviousCompare] = React.useState(compareWith);\n const previousValue = compareOptions.find(({ value }) => value === previousCompare) ?? PREVIOUS_PERIOD_COMPARE_OPTION;\n\n const value = compareOptions.find(({ value }) => value === compareWith);\n const enabled = Boolean(value);\n\n const onClick = () => {\n if (enabled) {\n setPreviousCompare(compareWith);\n model.onClearCompare();\n } else if (!enabled) {\n model.onCompareWithChanged(previousValue.value);\n }\n };\n\n return (\n <ButtonGroup>\n <ToolbarButton\n variant=\"canvas\"\n tooltip=\"Enable time frame comparison\"\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n onClick();\n }}\n >\n <Checkbox label=\" \" value={enabled} onClick={onClick} />\n Comparison\n </ToolbarButton>\n\n {enabled ? (\n <ButtonSelect\n variant=\"canvas\"\n value={value}\n options={compareOptions}\n onChange={(v) => {\n model.onCompareWithChanged(v.value!);\n }}\n />\n ) : (\n <ToolbarButton className={styles.previewButton} disabled variant=\"canvas\" isOpen={false}>\n {previousValue.label}\n </ToolbarButton>\n )}\n </ButtonGroup>\n );\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n previewButton: css({\n '&:disabled': {\n border: `1px solid ${theme.colors.secondary.border}`,\n color: theme.colors.text.disabled,\n opacity: 1,\n },\n }),\n };\n}\n","import React from 'react';\n\nimport { LoadingState, PanelData, DataFrame } from '@grafana/data';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneLayout, SceneObject, SceneObjectState } from '../core/types';\n\ninterface SceneByFrameRepeaterState extends SceneObjectState {\n body: SceneLayout;\n getLayoutChild(data: PanelData, frame: DataFrame, frameIndex: number): SceneObject;\n}\n\nexport class SceneByFrameRepeater extends SceneObjectBase<SceneByFrameRepeaterState> {\n public constructor(state: SceneByFrameRepeaterState) {\n super(state);\n\n this.addActivationHandler(() => {\n const dataProvider = sceneGraph.getData(this);\n\n this._subs.add(\n dataProvider.subscribeToState((data) => {\n if (data.data?.state === LoadingState.Done) {\n this.performRepeat(data.data);\n }\n })\n );\n\n if (dataProvider.state.data) {\n this.performRepeat(dataProvider.state.data);\n }\n });\n }\n\n private performRepeat(data: PanelData) {\n const newChildren: SceneObject[] = [];\n\n for (let seriesIndex = 0; seriesIndex < data.series.length; seriesIndex++) {\n const layoutChild = this.state.getLayoutChild(data, data.series[seriesIndex], seriesIndex);\n newChildren.push(layoutChild);\n }\n\n this.state.body.setState({ children: newChildren });\n }\n\n public static Component = ({ model }: SceneComponentProps<SceneByFrameRepeater>) => {\n const { body } = model.useState();\n return <body.Component model={body} />;\n };\n}\n","import React from 'react';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { sceneGraph } from '../core/sceneGraph';\nimport { SceneComponentProps, SceneLayout, SceneObject, SceneObjectState } from '../core/types';\nimport { VariableDependencyConfig } from '../variables/VariableDependencyConfig';\nimport { VariableValueOption } from '../variables/types';\nimport { MultiValueVariable } from '../variables/variants/MultiValueVariable';\n\ninterface SceneByVariableRepeaterState extends SceneObjectState {\n body: SceneLayout;\n variableName: string;\n getLayoutChild(option: VariableValueOption): SceneObject;\n}\n\nexport class SceneByVariableRepeater extends SceneObjectBase<SceneByVariableRepeaterState> {\n protected _variableDependency: VariableDependencyConfig<SceneByVariableRepeaterState> = new VariableDependencyConfig(\n this,\n {\n variableNames: [this.state.variableName],\n onVariableUpdateCompleted: () => this.performRepeat(),\n }\n );\n\n public constructor(state: SceneByVariableRepeaterState) {\n super(state);\n\n this.addActivationHandler(() => this.performRepeat());\n }\n\n private performRepeat() {\n if (this._variableDependency.hasDependencyInLoadingState()) {\n return;\n }\n\n const variable = sceneGraph.lookupVariable(this.state.variableName, this);\n if (!(variable instanceof MultiValueVariable)) {\n console.error('SceneByVariableRepeater: variable is not a MultiValueVariable');\n return;\n }\n\n const values = getMultiVariableValues(variable);\n const newChildren: SceneObject[] = [];\n\n for (const option of values) {\n const layoutChild = this.state.getLayoutChild(option);\n newChildren.push(layoutChild);\n }\n\n this.state.body.setState({ children: newChildren });\n }\n\n public static Component = ({ model }: SceneComponentProps<SceneByVariableRepeater>) => {\n const { body } = model.useState();\n return <body.Component model={body} />;\n };\n}\n\nexport function getMultiVariableValues(variable: MultiValueVariable): VariableValueOption[] {\n const { value, text, options } = variable.state;\n\n if (variable.hasAllValue()) {\n return options;\n }\n\n if (Array.isArray(value) && Array.isArray(text)) {\n return value.map((v, i) => ({ value: v, label: text[i] as string }));\n }\n\n return [{ value: value as string, label: text as string }];\n}\n","import React from 'react';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneComponentProps } from '../core/types';\n\nexport class SceneControlsSpacer extends SceneObjectBase {\n public constructor() {\n super({});\n }\n\n public get Component() {\n // Skipping wrapper component for this scene object so that it renders right away\n return SceneControlsSpacer.Component;\n }\n\n public static Component = (_props: SceneComponentProps<SceneControlsSpacer>) => {\n return <div style={{ flexGrow: 1 }} />;\n };\n}\n","import { css, CSSObject } from '@emotion/css';\nimport { config } from '@grafana/runtime';\nimport React, { ComponentType, CSSProperties, useMemo } from 'react';\n\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneLayout, SceneObjectState, SceneObject } from '../../core/types';\n\nexport interface SceneFlexItemStateLike extends SceneFlexItemPlacement, SceneObjectState {}\n\nexport interface SceneFlexItemLike extends SceneObject<SceneFlexItemStateLike> {}\n\ninterface SceneFlexLayoutState extends SceneObjectState, SceneFlexItemPlacement {\n children: SceneFlexItemLike[];\n}\n\nexport class SceneFlexLayout extends SceneObjectBase<SceneFlexLayoutState> implements SceneLayout {\n public static Component = SceneFlexLayoutRenderer;\n\n public toggleDirection() {\n this.setState({\n direction: this.state.direction === 'row' ? 'column' : 'row',\n });\n }\n\n public isDraggable(): boolean {\n return false;\n }\n}\n\nfunction SceneFlexLayoutRenderer({ model, parentState }: SceneFlexItemRenderProps<SceneFlexLayout>) {\n const { children, isHidden } = model.useState();\n const style = useLayoutStyle(model.state, parentState);\n\n if (isHidden) {\n return null;\n }\n\n return (\n <div className={style}>\n {children.map((item) => {\n const Component = item.Component as ComponentType<SceneFlexItemRenderProps<SceneObject>>;\n return <Component key={item.state.key} model={item} parentState={model.state} />;\n })}\n </div>\n );\n}\n\nexport interface SceneFlexItemPlacement {\n wrap?: CSSProperties['flexWrap'];\n direction?: CSSProperties['flexDirection'];\n width?: CSSProperties['width'];\n height?: CSSProperties['height'];\n minWidth?: CSSProperties['minWidth'];\n minHeight?: CSSProperties['minHeight'];\n maxWidth?: CSSProperties['maxWidth'];\n maxHeight?: CSSProperties['maxHeight'];\n xSizing?: 'fill' | 'content';\n ySizing?: 'fill' | 'content';\n /**\n * True when the item should rendered but not visible.\n * Useful for conditional display of layout items\n */\n isHidden?: boolean;\n\n /**\n * Set direction for smaller screens. This defaults to column.\n * This equals media query theme.breakpoints.down('md')\n */\n md?: SceneFlexItemPlacement;\n}\n\nexport interface SceneFlexItemState extends SceneFlexItemPlacement, SceneObjectState {\n body: SceneObject | undefined;\n}\n\ninterface SceneFlexItemRenderProps<T> extends SceneComponentProps<T> {\n parentState?: SceneFlexItemPlacement;\n}\n\nexport class SceneFlexItem extends SceneObjectBase<SceneFlexItemState> {\n public static Component = SceneFlexItemRenderer;\n}\n\nfunction SceneFlexItemRenderer({ model, parentState }: SceneFlexItemRenderProps<SceneFlexItem>) {\n if (!parentState) {\n throw new Error('SceneFlexItem must be a child of SceneFlexLayout');\n }\n\n const { body, isHidden } = model.useState();\n const style = useLayoutItemStyle(model.state, parentState);\n\n if (!body || isHidden) {\n return null;\n }\n\n return (\n <div className={style}>\n <body.Component model={body} />\n </div>\n );\n}\nfunction applyItemStyles(style: CSSObject, state: SceneFlexItemPlacement, parentState: SceneFlexItemPlacement) {\n const parentDirection = parentState.direction ?? 'row';\n const { xSizing = 'fill', ySizing = 'fill' } = state;\n\n style.display = 'flex';\n style.position = 'relative';\n style.flexDirection = parentDirection;\n\n if (parentDirection === 'column') {\n if (state.height) {\n style.height = state.height;\n } else {\n style.flexGrow = ySizing === 'fill' ? 1 : 0;\n }\n\n if (state.width) {\n style.width = state.width;\n } else {\n style.alignSelf = xSizing === 'fill' ? 'stretch' : 'flex-start';\n }\n } else {\n if (state.height) {\n style.height = state.height;\n } else {\n style.alignSelf = ySizing === 'fill' ? 'stretch' : 'flex-start';\n }\n\n if (state.width) {\n style.width = state.width;\n } else {\n style.flexGrow = xSizing === 'fill' ? 1 : 0;\n }\n }\n\n style.minWidth = state.minWidth;\n style.maxWidth = state.maxWidth;\n style.maxHeight = state.maxHeight;\n\n // For responsive layouts to work we default use the minHeight or height of the parent\n style.minHeight = state.minHeight ?? parentState.minHeight;\n style.height = state.height ?? parentState.height;\n\n return style;\n}\n\nfunction useLayoutItemStyle(state: SceneFlexItemState, parentState: SceneFlexItemPlacement) {\n return useMemo(() => {\n const theme = config.theme2;\n const style = applyItemStyles({}, state, parentState);\n\n // Unset maxWidth for small screens by default\n style[theme.breakpoints.down('md')] = {\n maxWidth: state.md?.maxWidth ?? 'unset',\n maxHeight: state.md?.maxHeight ?? 'unset',\n height: state.md?.height ?? parentState.md?.height,\n width: state.md?.width ?? parentState.md?.width,\n };\n\n return css(style);\n }, [state, parentState]);\n}\n\nfunction useLayoutStyle(state: SceneFlexLayoutState, parentState?: SceneFlexItemPlacement) {\n return useMemo(() => {\n const { direction = 'row', wrap } = state;\n // only need breakpoints so accessing theme from config instead of context is ok\n const theme = config.theme2;\n\n const style: CSSObject = {};\n\n if (parentState) {\n applyItemStyles(style, state, parentState);\n } else {\n style.display = 'flex';\n style.flexGrow = 1;\n style.minWidth = state.minWidth;\n style.minHeight = state.minHeight;\n }\n\n style.flexDirection = direction;\n style.gap = '8px';\n style.flexWrap = wrap || 'nowrap';\n style.alignContent = 'baseline';\n style.minWidth = style.minWidth || 0;\n style.minHeight = style.minHeight || 0;\n\n style[theme.breakpoints.down('md')] = {\n flexDirection: state.md?.direction ?? 'column',\n maxWidth: state.md?.maxWidth ?? 'unset',\n maxHeight: state.md?.maxHeight ?? 'unset',\n height: state.md?.height ?? 'unset',\n width: state.md?.width ?? 'unset',\n };\n\n return css(style);\n }, [parentState, state]);\n}\n","import { css, CSSObject } from '@emotion/css';\nimport React, { ComponentType, CSSProperties, useMemo } from 'react';\n\nimport { SceneObjectBase } from '../../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneLayout, SceneObjectState, SceneObject } from '../../../core/types';\nimport { config } from '@grafana/runtime';\nimport { LazyLoader } from '../LazyLoader';\n\nexport interface SceneCSSGridLayoutState extends SceneObjectState, SceneCSSGridLayoutOptions {\n children: Array<SceneCSSGridItem | SceneObject>;\n /**\n * True when the item should rendered but not visible.\n * Useful for conditional display of layout items\n */\n isHidden?: boolean;\n /**\n * For media query for sceens smaller than md breakpoint\n */\n md?: SceneCSSGridLayoutOptions;\n /** True when the items should be lazy loaded */\n isLazy?: boolean;\n}\n\nexport interface SceneCSSGridLayoutOptions {\n /**\n * Useful for setting a height on items without specifying how many rows there will be.\n * Defaults to 320px\n */\n autoRows?: CSSProperties['gridAutoRows'];\n /**\n * This overrides the autoRows with a specific row template.\n */\n templateRows?: CSSProperties['gridTemplateRows'];\n /**\n * Defaults to repeat(auto-fit, minmax(400px, 1fr)). This pattern us useful for equally sized items with a min width of 400px\n * and dynamic max width split equally among columns.\n */\n templateColumns: CSSProperties['gridTemplateColumns'];\n /** In Grafana design system grid units (8px) */\n rowGap: number;\n /** In Grafana design system grid units (8px) */\n columnGap: number;\n justifyItems?: CSSProperties['justifyItems'];\n alignItems?: CSSProperties['alignItems'];\n justifyContent?: CSSProperties['justifyContent'];\n}\n\nexport class SceneCSSGridLayout extends SceneObjectBase<SceneCSSGridLayoutState> implements SceneLayout {\n public static Component = SceneCSSGridLayoutRenderer;\n\n public constructor(state: Partial<SceneCSSGridLayoutState>) {\n super({\n rowGap: 1,\n columnGap: 1,\n templateColumns: 'repeat(auto-fit, minmax(400px, 1fr))',\n autoRows: state.autoRows ?? `320px`,\n children: state.children ?? [],\n ...state,\n });\n }\n\n public isDraggable(): boolean {\n return false;\n }\n}\n\nfunction SceneCSSGridLayoutRenderer({ model }: SceneCSSGridItemRenderProps<SceneCSSGridLayout>) {\n const { children, isHidden, isLazy } = model.useState();\n const style = useLayoutStyle(model.state);\n\n if (isHidden) {\n return null;\n }\n\n return (\n <div className={style}>\n {children.map((item) => {\n const Component = item.Component as ComponentType<SceneCSSGridItemRenderProps<SceneObject>>;\n \n if (isLazy) {\n return (\n <LazyLoader key={item.state.key!} className={style}>\n <Component key={item.state.key} model={item} parentState={model.state} />\n </LazyLoader>\n );\n }\n return <Component key={item.state.key} model={item} parentState={model.state} />;\n })}\n </div>\n );\n}\n\nexport interface SceneCSSGridItemPlacement {\n /**\n * True when the item should rendered but not visible.\n * Useful for conditional display of layout items\n */\n isHidden?: boolean;\n /**\n * Useful for making content span across multiple rows or columns\n */\n gridColumn?: CSSProperties['gridColumn'];\n gridRow?: CSSProperties['gridRow'];\n}\n\nexport interface SceneCSSGridItemState extends SceneCSSGridItemPlacement, SceneObjectState {\n body: SceneObject | undefined;\n}\n\ninterface SceneCSSGridItemRenderProps<T> extends SceneComponentProps<T> {\n parentState?: SceneCSSGridItemPlacement;\n}\n\nexport class SceneCSSGridItem extends SceneObjectBase<SceneCSSGridItemState> {\n public static Component = SceneCSSGridItemRenderer;\n}\n\nfunction SceneCSSGridItemRenderer({ model, parentState }: SceneCSSGridItemRenderProps<SceneCSSGridItem>) {\n if (!parentState) {\n throw new Error('SceneCSSGridItem must be a child of SceneCSSGridLayout');\n }\n\n const { body, isHidden } = model.useState();\n const style = useItemStyle(model.state);\n\n if (!body || isHidden) {\n return null;\n }\n\n return (\n <div className={style}>\n <body.Component model={body} />\n </div>\n );\n}\n\nfunction useLayoutStyle(state: SceneCSSGridLayoutState) {\n return useMemo(() => {\n const {} = state;\n // only need breakpoints so accessing theme from config instead of context is ok\n const style: CSSObject = {};\n const theme = config.theme2;\n\n style.display = 'grid';\n style.gridTemplateColumns = state.templateColumns;\n style.gridTemplateRows = state.templateRows || 'unset';\n style.gridAutoRows = state.autoRows || 'unset';\n style.rowGap = theme.spacing(state.rowGap ?? 1);\n style.columnGap = theme.spacing(state.columnGap ?? 1);\n style.justifyItems = state.justifyItems || 'unset';\n style.alignItems = state.alignItems || 'unset';\n style.justifyContent = state.justifyContent || 'unset';\n style.flexGrow = 1;\n\n if (state.md) {\n style[theme.breakpoints.down('md')] = {\n gridTemplateRows: state.md?.templateRows,\n gridTemplateColumns: state.md?.templateColumns,\n rowGap: state.md.rowGap ? theme.spacing(state.md?.rowGap ?? 1) : undefined,\n columnGap: state.md.columnGap ? theme.spacing(state.md?.rowGap ?? 1) : undefined,\n justifyItems: state.md?.justifyItems,\n alignItems: state.md?.alignItems,\n justifyContent: state.md?.justifyContent,\n };\n }\n\n return css(style);\n }, [state]);\n}\n\nfunction useItemStyle(state: SceneCSSGridItemState) {\n return useMemo(() => {\n const style: CSSObject = {};\n\n style.gridColumn = state.gridColumn || 'unset';\n style.gridRow = state.gridRow || 'unset';\n // Needed for VizPanel\n style.position = 'relative';\n\n return css(style);\n }, [state]);\n}\n","import { css, cx } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\nimport { clamp, throttle } from 'lodash';\nimport React, { useCallback, useLayoutEffect, useRef } from 'react';\nimport { useUniqueId } from '../LazyLoader';\n\ninterface Props {\n handleSize?: number;\n initialSize?: number | 'auto';\n direction?: 'row' | 'column';\n primary?: 'first' | 'second';\n collapsedDefault?: boolean;\n primaryPaneStyles?: React.CSSProperties;\n secondaryPaneStyles?: React.CSSProperties;\n onDragFinished?: (size: number) => void;\n children: [React.ReactNode, React.ReactNode];\n}\n\nconst PIXELS_PER_MS = 0.3 as const;\nconst VERTICAL_KEYS = new Set(['ArrowUp', 'ArrowDown']);\nconst HORIZONTAL_KEYS = new Set(['ArrowLeft', 'ArrowRight']);\n\nconst propsForDirection = {\n row: {\n dim: 'width',\n axis: 'clientX',\n min: 'minWidth',\n max: 'maxWidth',\n },\n column: {\n dim: 'height',\n axis: 'clientY',\n min: 'minHeight',\n max: 'maxHeight',\n },\n} as const;\n\nexport function Splitter({\n direction = 'row',\n handleSize = 32,\n initialSize = 'auto',\n primaryPaneStyles,\n secondaryPaneStyles,\n onDragFinished,\n children,\n}: Props) {\n const kids = React.Children.toArray(children);\n\n const splitterRef = useRef<HTMLDivElement | null>(null);\n const firstPaneRef = useRef<HTMLDivElement | null>(null);\n const secondPaneRef = useRef<HTMLDivElement | null>(null);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const containerSize = useRef<number | null>(null);\n const primarySizeRef = useRef<'1fr' | number>('1fr');\n\n const firstPaneMeasurements = useRef<ReturnType<typeof measureElement>>(undefined);\n const savedPos = useRef<string | undefined>(undefined);\n\n const measurementProp = propsForDirection[direction].dim;\n const clientAxis = propsForDirection[direction].axis;\n const minDimProp = propsForDirection[direction].min;\n const maxDimProp = propsForDirection[direction].max;\n\n // Using a resize observer here, as with content or screen based width/height the ratio between panes might\n // change after a window resize, so ariaValueNow needs to be updated accordingly\n useResizeObserver(\n containerRef.current!,\n (entries) => {\n for (const entry of entries) {\n if (!entry.target.isSameNode(containerRef.current)) {\n return;\n }\n\n const curSize = firstPaneRef.current!.getBoundingClientRect()[measurementProp];\n const newDims = measureElement(firstPaneRef.current!);\n splitterRef.current!.ariaValueNow = `${clamp(\n ((curSize - newDims[minDimProp]) / (newDims[maxDimProp] - newDims[minDimProp])) * 100,\n 0,\n 100\n )}`;\n }\n },\n 500,\n [maxDimProp, minDimProp, direction, measurementProp]\n );\n\n const dragStart = useRef<number | null>(null);\n const onPointerDown = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n // measure left-side width\n primarySizeRef.current = firstPaneRef.current!.getBoundingClientRect()[measurementProp];\n containerSize.current = containerRef.current!.getBoundingClientRect()[measurementProp];\n\n // set position at start of drag\n dragStart.current = e[clientAxis];\n splitterRef.current!.setPointerCapture(e.pointerId);\n firstPaneMeasurements.current = measureElement(firstPaneRef.current!);\n\n savedPos.current = undefined;\n },\n [measurementProp, clientAxis]\n );\n\n const onPointerMove = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n if (dragStart.current !== null && primarySizeRef.current !== '1fr') {\n const diff = e[clientAxis] - dragStart.current;\n const dims = firstPaneMeasurements.current!;\n const newSize = clamp(primarySizeRef.current + diff, dims[minDimProp], dims[maxDimProp]);\n const newFlex = newSize / (containerSize.current! - handleSize);\n firstPaneRef.current!.style.flexGrow = `${newFlex}`;\n secondPaneRef.current!.style.flexGrow = `${1 - newFlex}`;\n const ariaValueNow = clamp(\n ((newSize - dims[minDimProp]) / (dims[maxDimProp] - dims[minDimProp])) * 100,\n 0,\n 100\n );\n\n splitterRef.current!.ariaValueNow = `${ariaValueNow}`;\n }\n },\n [handleSize, clientAxis, minDimProp, maxDimProp]\n );\n\n const onPointerUp = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n e.preventDefault();\n e.stopPropagation();\n splitterRef.current!.releasePointerCapture(e.pointerId);\n dragStart.current = null;\n onDragFinished?.(parseFloat(firstPaneRef.current!.style.flexGrow));\n },\n [onDragFinished]\n );\n\n const pressedKeys = useRef(new Set<string>());\n const keysLastHandledAt = useRef<number | null>(null);\n const handlePressedKeys = useCallback(\n (time: number) => {\n const nothingPressed = pressedKeys.current.size === 0;\n if (nothingPressed) {\n keysLastHandledAt.current = null;\n return;\n } else if (primarySizeRef.current === '1fr') {\n return;\n }\n\n const dt = time - (keysLastHandledAt.current ?? time);\n const dx = dt * PIXELS_PER_MS;\n let sizeChange = 0;\n\n if (direction === 'row') {\n if (pressedKeys.current.has('ArrowLeft')) {\n sizeChange -= dx;\n }\n if (pressedKeys.current.has('ArrowRight')) {\n sizeChange += dx;\n }\n } else {\n if (pressedKeys.current.has('ArrowUp')) {\n sizeChange -= dx;\n }\n if (pressedKeys.current.has('ArrowDown')) {\n sizeChange += dx;\n }\n }\n\n const firstPaneDims = firstPaneMeasurements.current!;\n const curSize = firstPaneRef.current!.getBoundingClientRect()[measurementProp];\n const newSize = clamp(curSize + sizeChange, firstPaneDims[minDimProp], firstPaneDims[maxDimProp]);\n\n const newFlex = newSize / (containerSize.current! - handleSize);\n\n firstPaneRef.current!.style.flexGrow = `${newFlex}`;\n secondPaneRef.current!.style.flexGrow = `${1 - newFlex}`;\n const ariaValueNow =\n ((newSize - firstPaneDims[minDimProp]) / (firstPaneDims[maxDimProp] - firstPaneDims[minDimProp])) * 100;\n splitterRef.current!.ariaValueNow = `${clamp(ariaValueNow, 0, 100)}`;\n\n keysLastHandledAt.current = time;\n window.requestAnimationFrame(handlePressedKeys);\n },\n [direction, handleSize, minDimProp, maxDimProp, measurementProp]\n );\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Enter') {\n if (savedPos.current === undefined) {\n savedPos.current = firstPaneRef.current!.style.flexGrow;\n firstPaneRef.current!.style.flexGrow = '0';\n secondPaneRef.current!.style.flexGrow = '1';\n } else {\n firstPaneRef.current!.style.flexGrow = savedPos.current;\n secondPaneRef.current!.style.flexGrow = `${1 - parseFloat(savedPos.current)}`;\n savedPos.current = undefined;\n }\n return;\n } else if (e.key === 'Home') {\n firstPaneMeasurements.current = measureElement(firstPaneRef.current!);\n containerSize.current = containerRef.current!.getBoundingClientRect()[measurementProp];\n const newFlex = firstPaneMeasurements.current[minDimProp] / (containerSize.current! - handleSize);\n firstPaneRef.current!.style.flexGrow = `${newFlex}`;\n secondPaneRef.current!.style.flexGrow = `${1 - newFlex}`;\n splitterRef.current!.ariaValueNow = '0';\n return;\n } else if (e.key === 'End') {\n firstPaneMeasurements.current = measureElement(firstPaneRef.current!);\n containerSize.current = containerRef.current!.getBoundingClientRect()[measurementProp];\n const newFlex = firstPaneMeasurements.current[maxDimProp] / (containerSize.current! - handleSize);\n firstPaneRef.current!.style.flexGrow = `${newFlex}`;\n secondPaneRef.current!.style.flexGrow = `${1 - newFlex}`;\n splitterRef.current!.ariaValueNow = '100';\n return;\n }\n\n if (\n !(\n (direction === 'column' && VERTICAL_KEYS.has(e.key)) ||\n (direction === 'row' && HORIZONTAL_KEYS.has(e.key))\n ) ||\n pressedKeys.current.has(e.key)\n ) {\n return;\n }\n\n savedPos.current = undefined;\n e.preventDefault();\n e.stopPropagation();\n primarySizeRef.current = firstPaneRef.current!.getBoundingClientRect()[measurementProp];\n containerSize.current = containerRef.current!.getBoundingClientRect()[measurementProp];\n firstPaneMeasurements.current = measureElement(firstPaneRef.current!);\n const newKey = !pressedKeys.current.has(e.key);\n\n if (newKey) {\n const initiateAnimationLoop = pressedKeys.current.size === 0;\n pressedKeys.current.add(e.key);\n\n if (initiateAnimationLoop) {\n window.requestAnimationFrame(handlePressedKeys);\n }\n }\n },\n [direction, handlePressedKeys, handleSize, maxDimProp, measurementProp, minDimProp]\n );\n\n const onKeyUp = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (\n (direction === 'row' && !HORIZONTAL_KEYS.has(e.key)) ||\n (direction === 'column' && !VERTICAL_KEYS.has(e.key))\n ) {\n return;\n }\n\n pressedKeys.current.delete(e.key);\n onDragFinished?.(parseFloat(firstPaneRef.current!.style.flexGrow));\n },\n [direction, onDragFinished]\n );\n\n const onDoubleClick = useCallback(() => {\n firstPaneRef.current!.style.flexGrow = '0.5';\n secondPaneRef.current!.style.flexGrow = '0.5';\n const dim = measureElement(firstPaneRef.current!);\n firstPaneMeasurements.current = dim;\n primarySizeRef.current = firstPaneRef.current!.getBoundingClientRect()[measurementProp];\n splitterRef.current!.ariaValueNow = `${\n ((primarySizeRef.current - dim[minDimProp]) / (dim[maxDimProp] - dim[minDimProp])) * 100\n }`;\n }, [maxDimProp, measurementProp, minDimProp]);\n\n const onBlur = useCallback(() => {\n // If focus is lost while keys are held, stop changing panel sizes\n if (pressedKeys.current.size > 0) {\n pressedKeys.current.clear();\n dragStart.current = null;\n onDragFinished?.(parseFloat(firstPaneRef.current!.style.flexGrow));\n }\n }, [onDragFinished]);\n\n const styles = useStyles2(getStyles);\n const id = useUniqueId();\n\n const secondAvailable = kids.length === 2;\n const visibilitySecond = secondAvailable ? 'visible' : 'hidden';\n\n return (\n <div\n ref={containerRef}\n className={styles.container}\n style={{\n flexDirection: direction,\n }}\n >\n <div\n ref={firstPaneRef}\n className={styles.panel}\n style={{\n flexGrow: initialSize === 'auto' ? 0.5 : clamp(initialSize, 0, 1),\n [minDimProp]: 'min-content',\n ...primaryPaneStyles,\n }}\n id={`start-panel-${id}`}\n >\n {kids[0]}\n </div>\n\n {kids[1] && (\n <>\n <div\n ref={splitterRef}\n style={{ [measurementProp]: `${handleSize}px` }}\n className={cx(styles.handle, { [styles.handleHorizontal]: direction === 'column' })}\n onPointerUp={onPointerUp}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n onDoubleClick={onDoubleClick}\n onBlur={onBlur}\n role=\"separator\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={50}\n aria-controls={`start-panel-${id}`}\n aria-label=\"Pane resize widget\"\n tabIndex={0}\n ></div>\n\n <div\n ref={secondPaneRef}\n className={styles.panel}\n style={{\n flexGrow: initialSize === 'auto' ? 0.5 : clamp(1 - initialSize, 0, 1),\n [minDimProp]: 'min-content',\n visibility: `${visibilitySecond}`,\n ...secondaryPaneStyles,\n }}\n id={`end-panel-${id}`}\n >\n {kids[1]}\n </div>\n </>\n )}\n </div>\n );\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n handle: css({\n cursor: 'col-resize',\n position: 'relative',\n flexShrink: 0,\n userSelect: 'none',\n\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n backgroundColor: theme.colors.primary.main,\n left: '50%',\n transform: 'translate(-50%)',\n top: 0,\n height: '100%',\n width: '1px',\n opacity: 0,\n transition: 'opacity ease-in-out 0.2s',\n },\n\n '&::after': {\n content: '\"\"',\n width: '4px',\n borderRadius: '4px',\n backgroundColor: theme.colors.border.weak,\n transition: 'background-color ease-in-out 0.2s',\n height: '50%',\n top: 'calc(50% - (50%) / 2)',\n transform: 'translateX(-50%)',\n position: 'absolute',\n left: '50%',\n },\n\n '&:hover, &:focus-visible': {\n outline: 'none',\n '&::before': {\n opacity: 1,\n },\n\n '&::after': {\n backgroundColor: theme.colors.primary.main,\n },\n },\n }),\n handleHorizontal: css({\n cursor: 'row-resize',\n\n '&::before': {\n left: 'inherit',\n transform: 'translateY(-50%)',\n top: '50%',\n height: '1px',\n width: '100%',\n },\n\n '&::after': {\n width: '50%',\n height: '4px',\n top: '50%',\n transform: 'translateY(-50%)',\n left: 'calc(50% - (50%) / 2)',\n },\n }),\n container: css({\n display: 'flex',\n width: '100%',\n flexGrow: 1,\n overflow: 'hidden',\n }),\n panel: css({ display: 'flex', position: 'relative', flexBasis: 0 }),\n };\n}\n\ntype MeasureR<T> = T extends HTMLElement\n ? { minWidth: number; maxWidth: number; minHeight: number; maxHeight: number }\n : T extends null\n ? undefined\n : never;\ntype HTMLElementOrNull = HTMLElement | null;\n\nfunction measureElement<T extends HTMLElementOrNull>(ref: T): MeasureR<T> {\n if (ref === null) {\n return undefined as MeasureR<T>;\n }\n\n const savedBodyOverflow = document.body.style.overflow;\n const savedWidth = ref.style.width;\n const savedHeight = ref.style.height;\n const savedFlex = ref.style.flexGrow;\n document.body.style.overflow = 'hidden';\n ref.style.flexGrow = '0';\n const { width: minWidth, height: minHeight } = ref.getBoundingClientRect();\n\n ref.style.flexGrow = '100';\n const { width: maxWidth, height: maxHeight } = ref.getBoundingClientRect();\n\n document.body.style.overflow = savedBodyOverflow;\n ref.style.width = savedWidth;\n ref.style.height = savedHeight;\n ref.style.flexGrow = savedFlex;\n\n return { minWidth, maxWidth, minHeight, maxHeight } as MeasureR<T>;\n}\n\nfunction useResizeObserver(\n target: Element,\n cb: (entries: ResizeObserverEntry[]) => void,\n throttleWait = 0,\n deps?: React.DependencyList\n) {\n const throttledCallback = throttle(cb, throttleWait);\n\n useLayoutEffect(() => {\n if (!target) {\n return;\n }\n\n const resizeObserver = new ResizeObserver(throttledCallback);\n\n resizeObserver.observe(target, { box: 'device-pixel-content-box' });\n return () => resizeObserver.disconnect();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n}\n","import React, { ComponentType } from 'react';\n\nimport { SceneComponentProps, SceneObjectState, SceneObject } from '../../../core/types';\nimport { SceneFlexItemPlacement } from '../SceneFlexLayout';\nimport { SplitLayout } from './SplitLayout';\nimport { Splitter } from './Splitter';\n\nexport function SplitLayoutRenderer({ model }: SceneFlexItemRenderProps<SplitLayout>) {\n const { primary, secondary, direction, isHidden, initialSize, primaryPaneStyles, secondaryPaneStyles } =\n model.useState();\n\n if (isHidden) {\n return null;\n }\n\n const Prim = primary.Component as ComponentType<SceneFlexItemRenderProps<SceneObject>>;\n const Sec = secondary?.Component as ComponentType<SceneFlexItemRenderProps<SceneObject>>;\n let startSize = secondary ? initialSize : 1;\n\n return (\n <Splitter\n direction={direction}\n initialSize={startSize ?? 0.5}\n primaryPaneStyles={primaryPaneStyles}\n secondaryPaneStyles={secondaryPaneStyles}\n >\n <Prim key={primary.state.key} model={primary} parentState={model.state} />\n {Sec && secondary && <Sec key={secondary.state.key} model={secondary} parentState={model.state} />}\n </Splitter>\n );\n}\n\nexport interface SceneFlexItemState extends SceneFlexItemPlacement, SceneObjectState {\n body: SceneObject | undefined;\n}\n\ninterface SceneFlexItemRenderProps<T> extends SceneComponentProps<T> {\n parentState?: SceneFlexItemPlacement;\n}\n","import { CSSProperties } from 'react';\nimport { SceneObjectBase } from '../../../core/SceneObjectBase';\nimport { SceneObjectState } from '../../../core/types';\nimport { SceneFlexItemPlacement, SceneFlexItemLike } from '../SceneFlexLayout';\nimport { SplitLayoutRenderer } from './SplitLayoutRenderer';\n\ninterface SplitLayoutState extends SceneObjectState, SceneFlexItemPlacement {\n primary: SceneFlexItemLike;\n secondary?: SceneFlexItemLike;\n direction: 'row' | 'column';\n initialSize?: number;\n primaryPaneStyles?: CSSProperties;\n secondaryPaneStyles?: CSSProperties;\n}\n\nexport class SplitLayout extends SceneObjectBase<SplitLayoutState> {\n public static Component = SplitLayoutRenderer;\n\n public toggleDirection() {\n this.setState({\n direction: this.state.direction === 'row' ? 'column' : 'row',\n });\n }\n\n public isDraggable(): boolean {\n return false;\n }\n}\n","import React from 'react';\nimport { Route, Switch } from 'react-router-dom';\n\nimport { DataRequestEnricher, SceneComponentProps } from '../../core/types';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneAppState } from './types';\nimport { renderSceneComponentWithRouteProps } from './utils';\n\n/**\n * Responsible for top level pages routing\n */\nexport class SceneApp extends SceneObjectBase<SceneAppState> implements DataRequestEnricher {\n public enrichDataRequest() {\n return {\n app: this.state.name || 'app',\n };\n }\n\n public static Component = ({ model }: SceneComponentProps<SceneApp>) => {\n const { pages } = model.useState();\n\n return (\n <Switch>\n {pages.map((page) => (\n <Route\n key={page.state.url}\n exact={false}\n path={page.state.url}\n render={(props) => renderSceneComponentWithRouteProps(page, props)}\n ></Route>\n ))}\n </Switch>\n );\n };\n}\n\nconst sceneAppCache = new Map<object, SceneApp>();\n\n/**\n * Caches the the resulting SceneApp returned by the factory function so that it's only called once during the lifetime of the browser tab\n */\nexport function useSceneApp(factory: () => SceneApp) {\n const cachedApp = sceneAppCache.get(factory);\n\n if (cachedApp) {\n return cachedApp;\n }\n\n const newApp = factory();\n sceneAppCache.set(factory, newApp);\n\n return newApp;\n}\n","import React from 'react';\n\nimport { SceneObjectBase } from '../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObjectState } from '../core/types';\n\nexport interface SceneReactObjectState<TProps = {}> extends SceneObjectState {\n /**\n * React component to render\n */\n component?: React.ComponentType<TProps>;\n /**\n * Props to pass to the component\n */\n props?: TProps;\n /**\n * Alternative to component and props is just to pass a React node\n */\n reactNode?: React.ReactNode;\n}\n\n/**\n * A utility object that can be used to render any React component or ReactNode\n */\nexport class SceneReactObject<TProps = {}> extends SceneObjectBase<SceneReactObjectState<TProps>> {\n public static Component = ({ model }: SceneComponentProps<SceneReactObject>) => {\n const { component: Component, props, reactNode } = model.useState();\n\n if (Component) {\n return <Component {...props} />;\n }\n\n if (reactNode) {\n return reactNode;\n }\n\n return null;\n };\n}\n","import { css } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { Input, JSONFormatter, useStyles2 } from '@grafana/ui';\nimport { isArray, isPlainObject } from 'lodash';\nimport React from 'react';\nimport { isSceneObject, SceneObject } from '../../core/types';\n\nexport interface Props {\n node: SceneObject;\n}\n\nexport function DebugDetails({ node }: Props) {\n const state = node.useState();\n const styles = useStyles2(getStyles);\n\n return (\n <div className={styles.container}>\n {Object.keys(state).map((key) => (\n <div className={styles.row} key={key}>\n <div className={styles.keyName}>{key}</div>\n <div className={styles.value}>{renderValue(key, (state as any)[key], node)}</div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction renderValue(key: string, value: any, node: SceneObject) {\n if (value === null) {\n return 'null';\n }\n\n switch (typeof value) {\n case 'number':\n return (\n <Input\n type=\"number\"\n defaultValue={value}\n onBlur={(evt) => node.setState({ [key]: evt.currentTarget.valueAsNumber })}\n />\n );\n case 'string':\n return (\n <Input type=\"text\" defaultValue={value} onBlur={(evt) => node.setState({ [key]: evt.currentTarget.value })} />\n );\n case 'object':\n if (isSceneObject(value)) {\n return value.constructor.name;\n }\n if (isPlainObject(value) || isArray(value)) {\n return <JSONFormatter json={value} open={0} />;\n }\n return String(value);\n default:\n return typeof value;\n }\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n container: css({\n flexGrow: 1,\n display: 'flex',\n gap: theme.spacing(0.5),\n flexDirection: 'column',\n }),\n row: css({\n display: 'flex',\n gap: theme.spacing(2),\n }),\n keyName: css({\n display: 'flex',\n flexGrow: '0',\n width: 120,\n alignItems: 'center',\n height: theme.spacing(theme.components.height.md),\n }),\n value: css({\n flexGrow: 1,\n minHeight: theme.spacing(theme.components.height.md),\n display: 'flex',\n alignItems: 'center',\n }),\n };\n}\n","import { css, cx } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\nimport React, { ReactNode } from 'react';\nimport { SceneObject } from '../../core/types';\n\nexport interface Props {\n node: SceneObject;\n selectedObject?: SceneObject;\n onSelect: (node: SceneObject) => void;\n}\n\nexport function DebugTreeNode({ node, selectedObject, onSelect }: Props) {\n const styles = useStyles2(getStyles);\n const children: ReactNode[] = [];\n const isSelected = node === selectedObject;\n\n node.forEachChild((child) => {\n children.push(\n <DebugTreeNode node={child} key={child.state.key} selectedObject={selectedObject} onSelect={onSelect} />\n );\n });\n\n return (\n <div className={styles.container}>\n <div className={cx(styles.name, isSelected && styles.selected)} onClick={() => onSelect(node)}>\n {node.constructor.name}\n </div>\n <div className={styles.children}>{children}</div>\n </div>\n );\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n container: css({\n flexGrow: 1,\n display: 'flex',\n gap: theme.spacing(0.5),\n flexDirection: 'column',\n }),\n name: css({\n flexGrow: 1,\n display: 'flex',\n gap: theme.spacing(1),\n fontSize: theme.typography.bodySmall.fontSize,\n cursor: 'pointer',\n padding: theme.spacing(0, 1),\n borderRadius: theme.shape.borderRadius(2),\n position: 'relative',\n '&:hover': {\n background: theme.colors.background.secondary,\n },\n }),\n selected: css({\n '&::before': {\n display: 'block',\n content: \"' '\",\n position: 'absolute',\n left: 0,\n width: 4,\n bottom: 2,\n top: 2,\n borderRadius: theme.shape.radius.default,\n backgroundImage: theme.colors.gradients.brandVertical,\n },\n }),\n children: css({\n flexGrow: 1,\n display: 'flex',\n flexDirection: 'column',\n paddingLeft: theme.spacing(1),\n }),\n };\n}\n","import { css } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { CustomScrollbar, Drawer, ToolbarButton, useStyles2 } from '@grafana/ui';\nimport React, { useState } from 'react';\n\nimport { SceneObject } from '../../core/types';\nimport { DebugDetails } from './DebugDetails';\nimport { DebugTreeNode } from './DebugTreeNode';\n\nexport interface Props {\n scene: SceneObject;\n}\n\n/**\n * @internal\n * Please don't use from plugins directly.\n * This is already exposed via SceneAppPage and the ?scene-debugger query parameter.\n *\n * This is only exported so that core dashboards can use it.\n */\nexport function SceneDebugger({ scene }: Props) {\n const styles = useStyles2(getStyles);\n const [isOpen, setIsOpen] = useState(false);\n const [selectedObject, setSelectedObject] = useState<SceneObject>();\n\n return (\n <>\n <ToolbarButton variant=\"canvas\" icon=\"bug\" onClick={() => setIsOpen(true)} />\n {isOpen && (\n <Drawer title=\"Scene debugger\" onClose={() => setIsOpen(false)} size=\"lg\">\n <div className={styles.panes}>\n <div className={styles.pane1}>\n <div className={styles.paneHeading}>Scene graph</div>\n <CustomScrollbar autoHeightMin={'100%'}>\n <div className={styles.treeWrapper}>\n <DebugTreeNode node={scene} selectedObject={selectedObject} onSelect={setSelectedObject} />\n </div>\n </CustomScrollbar>\n </div>\n <div className={styles.pane2}>\n <div className={styles.paneHeading}>Object details</div>\n {selectedObject && <DebugDetails node={selectedObject} />}\n </div>\n </div>\n </Drawer>\n )}\n </>\n );\n}\n\nfunction getStyles(theme: GrafanaTheme2) {\n return {\n panes: css({\n flexGrow: 1,\n display: 'flex',\n height: '100%',\n flexDirection: 'row',\n marginTop: theme.spacing(-2),\n }),\n pane1: css({\n flexGrow: 0,\n display: 'flex',\n height: '100%',\n flexDirection: 'column',\n borderRight: `1px solid ${theme.colors.border.weak}`,\n }),\n pane2: css({\n flexGrow: 1,\n display: 'flex',\n minHeight: '100%',\n flexDirection: 'column',\n paddingLeft: theme.spacing(2),\n }),\n treeWrapper: css({\n paddingRight: theme.spacing(2),\n height: '100%',\n marginLeft: theme.spacing(-1),\n }),\n paneHeading: css({\n padding: theme.spacing(1, 0),\n fontWeight: theme.typography.fontWeightMedium,\n }),\n };\n}\n","import { NavModelItem, UrlQueryMap } from '@grafana/data';\nimport { PluginPage } from '@grafana/runtime';\nimport React, { useEffect, useLayoutEffect } from 'react';\n\nimport { RouteComponentProps } from 'react-router-dom';\nimport { SceneObject } from '../../core/types';\nimport { SceneDebugger } from '../SceneDebugger/SceneDebugger';\nimport { SceneAppPage } from './SceneAppPage';\nimport { SceneAppDrilldownView, SceneAppPageLike } from './types';\nimport { getUrlWithAppState, renderSceneComponentWithRouteProps, useAppQueryParams } from './utils';\nimport { useUrlSync } from '../../services/useUrlSync';\n\nexport interface Props {\n page: SceneAppPageLike;\n // activeTab?: SceneAppPageLike;\n routeProps: RouteComponentProps;\n}\n\nexport function SceneAppPageView({ page, routeProps }: Props) {\n const containerPage = getParentPageIfTab(page);\n const containerState = containerPage.useState();\n const params = useAppQueryParams();\n const scene = page.getScene(routeProps.match);\n const isInitialized = containerState.initializedScene === scene;\n const {layout} = page.state;\n\n useLayoutEffect(() => {\n // Before rendering scene components, we are making sure the URL sync is enabled for.\n if (!isInitialized) {\n containerPage.initializeScene(scene);\n }\n }, [scene, containerPage, isInitialized]);\n\n useEffect(() => {\n // Clear initializedScene when unmounting\n return () => containerPage.setState({ initializedScene: undefined });\n }, [containerPage]);\n\n const urlSyncInitialized = useUrlSync(containerPage);\n\n if (!isInitialized && !urlSyncInitialized) {\n return null;\n }\n\n const pageNav: NavModelItem = {\n text: containerState.title,\n img: containerState.titleImg,\n icon: containerState.titleIcon,\n url: getUrlWithAppState(containerState.url, containerState.preserveUrlKeys),\n hideFromBreadcrumbs: containerState.hideFromBreadcrumbs,\n parentItem: getParentBreadcrumbs(\n containerState.getParentPage ? containerState.getParentPage() : containerPage.parent,\n params\n ),\n };\n\n if (containerState.tabs) {\n pageNav.children = containerState.tabs.map((tab) => {\n return {\n text: tab.state.title,\n icon: tab.state.titleIcon,\n tabSuffix: tab.state.tabSuffix,\n active: page === tab,\n url: getUrlWithAppState(tab.state.url, tab.state.preserveUrlKeys),\n parentItem: pageNav,\n };\n });\n }\n\n let pageActions: React.ReactNode[] = [];\n if (containerState.controls) {\n pageActions = containerState.controls.map((control) => (\n <control.Component model={control} key={control.state.key} />\n ));\n }\n\n if (params['scene-debugger']) {\n pageActions.push(<SceneDebugger scene={containerPage} key={'scene-debugger'} />);\n }\n\n return (\n <PluginPage\n layout={layout}\n pageNav={pageNav}\n actions={pageActions}\n renderTitle={containerState.renderTitle}\n subTitle={containerState.subTitle}\n >\n <scene.Component model={scene} />\n </PluginPage>\n );\n}\n\n/**\n * For pages that are \"tabs\" this will return the parent page\n */\nfunction getParentPageIfTab(page: SceneAppPageLike) {\n if (page.parent instanceof SceneAppPage) {\n return page.parent;\n }\n\n return page;\n}\n\nfunction getParentBreadcrumbs(parent: SceneObject | undefined, params: UrlQueryMap): NavModelItem | undefined {\n if (parent instanceof SceneAppPage) {\n return {\n text: parent.state.title,\n url: getUrlWithAppState(parent.state.url, parent.state.preserveUrlKeys),\n hideFromBreadcrumbs: parent.state.hideFromBreadcrumbs,\n parentItem: getParentBreadcrumbs(\n parent.state.getParentPage ? parent.state.getParentPage() : parent.parent,\n params\n ),\n };\n }\n\n return undefined;\n}\n\nexport interface SceneAppDrilldownViewRenderProps {\n drilldown: SceneAppDrilldownView;\n parent: SceneAppPageLike;\n routeProps: RouteComponentProps;\n}\n\nexport function SceneAppDrilldownViewRender({ drilldown, parent, routeProps }: SceneAppDrilldownViewRenderProps) {\n return renderSceneComponentWithRouteProps(parent.getDrilldownPage(drilldown, routeProps.match), routeProps);\n}\n","import React from 'react';\nimport { Route, RouteComponentProps, Switch } from 'react-router-dom';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { SceneComponentProps, SceneObject, isDataRequestEnricher } from '../../core/types';\nimport { EmbeddedScene } from '../EmbeddedScene';\nimport { SceneFlexItem, SceneFlexLayout } from '../layout/SceneFlexLayout';\nimport { SceneReactObject } from '../SceneReactObject';\nimport { SceneAppDrilldownViewRender, SceneAppPageView } from './SceneAppPageView';\nimport { SceneAppDrilldownView, SceneAppPageLike, SceneAppPageState, SceneRouteMatch } from './types';\nimport { renderSceneComponentWithRouteProps } from './utils';\n\n/**\n * Responsible for page's drilldown & tabs routing\n */\nexport class SceneAppPage extends SceneObjectBase<SceneAppPageState> implements SceneAppPageLike {\n public static Component = SceneAppPageRenderer;\n private _sceneCache = new Map<string, EmbeddedScene>();\n private _drilldownCache = new Map<string, SceneAppPageLike>();\n\n public constructor(state: SceneAppPageState) {\n super(state);\n }\n\n public initializeScene(scene: EmbeddedScene) {\n this.setState({ initializedScene: scene });\n }\n\n public getScene(routeMatch: SceneRouteMatch): EmbeddedScene {\n let scene = this._sceneCache.get(routeMatch.url);\n\n if (scene) {\n return scene;\n }\n\n if (!this.state.getScene) {\n throw new Error('Missing getScene on SceneAppPage ' + this.state.title);\n }\n\n scene = this.state.getScene(routeMatch);\n this._sceneCache.set(routeMatch.url, scene);\n\n return scene;\n }\n\n public getDrilldownPage(drilldown: SceneAppDrilldownView, routeMatch: SceneRouteMatch<{}>): SceneAppPageLike {\n let page = this._drilldownCache.get(routeMatch!.url);\n if (page) {\n return page;\n }\n\n page = drilldown.getPage(routeMatch, this);\n this._drilldownCache.set(routeMatch!.url, page);\n\n return page;\n }\n\n public enrichDataRequest(source: SceneObject) {\n if (this.state.getParentPage) {\n return this.state.getParentPage().enrichDataRequest(source);\n }\n\n if (!this.parent) {\n return null;\n }\n\n const root = this.getRoot();\n\n if (isDataRequestEnricher(root)) {\n return root.enrichDataRequest(source);\n }\n\n return null;\n }\n}\n\nexport interface SceneAppPageRendererProps extends SceneComponentProps<SceneAppPage> {\n routeProps: RouteComponentProps;\n}\n\nfunction SceneAppPageRenderer({ model, routeProps }: SceneAppPageRendererProps) {\n const { tabs, drilldowns } = model.useState();\n const routes: React.ReactNode[] = [];\n\n if (tabs && tabs.length > 0) {\n for (let tabIndex = 0; tabIndex < tabs.length; tabIndex++) {\n const tab = tabs[tabIndex];\n\n // Add first tab as a default route, this makes it possible for the first tab to render with the url of the parent page\n if (tabIndex === 0) {\n routes.push(\n <Route\n exact={true}\n key={model.state.url}\n path={model.state.routePath ?? model.state.url}\n render={(props) => renderSceneComponentWithRouteProps(tab, props)}\n ></Route>\n );\n }\n\n routes.push(\n <Route\n exact={true}\n key={tab.state.url}\n path={tab.state.routePath ?? tab.state.url}\n render={(props) => renderSceneComponentWithRouteProps(tab, props)}\n ></Route>\n );\n\n if (tab.state.drilldowns) {\n for (const drilldown of tab.state.drilldowns) {\n routes.push(\n <Route\n exact={false}\n key={drilldown.routePath}\n path={drilldown.routePath}\n render={(props) => <SceneAppDrilldownViewRender drilldown={drilldown} parent={tab} routeProps={props} />}\n ></Route>\n );\n }\n }\n }\n }\n\n if (drilldowns) {\n for (const drilldown of drilldowns) {\n routes.push(\n <Route\n key={drilldown.routePath}\n exact={false}\n path={drilldown.routePath}\n render={(props) => <SceneAppDrilldownViewRender drilldown={drilldown} parent={model} routeProps={props} />}\n ></Route>\n );\n }\n }\n\n if (!tabs && isCurrentPageRouteMatch(model, routeProps.match)) {\n return <SceneAppPageView page={model} routeProps={routeProps} />;\n }\n\n routes.push(getFallbackRoute(model, routeProps));\n\n return <Switch>{routes}</Switch>;\n}\n\nfunction getFallbackRoute(page: SceneAppPage, routeProps: RouteComponentProps) {\n return (\n <Route\n key={'fallback route'}\n render={(props) => {\n const fallbackPage = page.state.getFallbackPage?.() ?? getDefaultFallbackPage();\n return <SceneAppPageView page={fallbackPage} routeProps={routeProps} />;\n }}\n ></Route>\n );\n}\n\nfunction isCurrentPageRouteMatch(page: SceneAppPage, match: SceneRouteMatch) {\n if (!match.isExact) {\n return false;\n }\n\n // current page matches the route url\n if (match.url === page.state.url) {\n return true;\n }\n\n // check if we are a tab and the first tab, then we should also render on the parent url\n if (\n page.parent instanceof SceneAppPage &&\n page.parent.state.tabs![0] === page &&\n page.parent.state.url === match.url\n ) {\n return true;\n }\n\n return false;\n}\n\nfunction getDefaultFallbackPage() {\n return new SceneAppPage({\n url: '',\n title: 'Not found',\n subTitle: 'The url did not match any page',\n getScene: () => {\n return new EmbeddedScene({\n body: new SceneFlexLayout({\n direction: 'column',\n children: [\n new SceneFlexItem({\n body: new SceneReactObject({\n component: () => {\n return (\n <div data-testid=\"default-fallback-content\">\n If you found your way here using a link then there might be a bug in this application.\n </div>\n );\n },\n }),\n }),\n ],\n }),\n });\n },\n });\n}\n","import { MatcherConfig } from '@grafana/schema';\nimport { StandardFieldConfig, StandardFieldConfigInterface } from './types';\n\n// Base class for standard field config overrides builder methods\nexport class StandardFieldConfigOverridesBuilder<T extends StandardFieldConfigOverridesBuilder<T>>\n implements StandardFieldConfigInterface<StandardFieldConfig, T, 'override'>\n{\n protected _overrides: Array<{ matcher: MatcherConfig; properties: Array<{ id: string; value: unknown }> }> = [];\n\n public overrideColor(value: StandardFieldConfig['color']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'color', value });\n return this as unknown as T;\n }\n\n public overrideDecimals(value: StandardFieldConfig['decimals']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'decimals', value });\n return this as unknown as T;\n }\n\n public overrideDisplayName(value: StandardFieldConfig['displayName']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'displayName', value });\n return this as unknown as T;\n }\n\n public overrideFilterable(value: StandardFieldConfig['filterable']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'filterable', value });\n return this as unknown as T;\n }\n\n public overrideLinks(value: StandardFieldConfig['links']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'links', value });\n return this as unknown as T;\n }\n\n public overrideMappings(value: StandardFieldConfig['mappings']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'mappings', value });\n return this as unknown as T;\n }\n\n public overrideMax(value: StandardFieldConfig['max']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'max', value });\n return this as unknown as T;\n }\n\n public overrideMin(value: StandardFieldConfig['min']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'min', value });\n return this as unknown as T;\n }\n\n public overrideNoValue(value: StandardFieldConfig['noValue']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'noValue', value });\n return this as unknown as T;\n }\n\n public overrideThresholds(value: StandardFieldConfig['thresholds']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'thresholds', value });\n return this as unknown as T;\n }\n\n public overrideUnit(value: StandardFieldConfig['unit']): T {\n this._overrides[this._overrides.length - 1].properties.push({ id: 'unit', value });\n return this as unknown as T;\n }\n}\n","import { FieldMatcherID, FieldType, FieldValueMatcherConfig } from '@grafana/data';\nimport { MatcherConfig } from '@grafana/schema';\nimport { getCompareSeriesRefId } from '../../utils/getCompareSeriesRefId';\nimport { StandardFieldConfigOverridesBuilder } from './StandardFieldConfigBuilders';\n\nexport class FieldConfigOverridesBuilder<TFieldConfig> extends StandardFieldConfigOverridesBuilder<\n FieldConfigOverridesBuilder<TFieldConfig>\n> {\n public match(matcher: MatcherConfig): this {\n this._overrides.push({ matcher, properties: [] });\n return this;\n }\n\n public matchFieldsWithName(name: string): this {\n this._overrides.push({\n matcher: {\n id: FieldMatcherID.byName,\n\n options: name,\n },\n properties: [],\n });\n return this;\n }\n\n public matchFieldsWithNameByRegex(regex: string): this {\n this._overrides.push({\n matcher: {\n id: FieldMatcherID.byRegexp,\n options: regex,\n },\n properties: [],\n });\n return this;\n }\n\n public matchFieldsByType(fieldType: FieldType): this {\n this._overrides.push({\n matcher: {\n id: FieldMatcherID.byType,\n options: fieldType,\n },\n properties: [],\n });\n return this;\n }\n\n public matchFieldsByQuery(refId: string): this {\n this._overrides.push({\n matcher: {\n id: FieldMatcherID.byFrameRefID,\n options: refId,\n },\n properties: [],\n });\n return this;\n }\n\n public matchFieldsByValue(options: FieldValueMatcherConfig): this {\n this._overrides.push({\n matcher: {\n id: FieldMatcherID.byValue,\n options,\n },\n properties: [],\n });\n return this;\n }\n\n public matchComparisonQuery(refId: string): this {\n return this.matchFieldsByQuery(getCompareSeriesRefId(refId));\n }\n\n public overrideCustomFieldConfig<T extends TFieldConfig, K extends keyof T>(id: K, value: T[K]): this {\n const _id = `custom.${String(id)}`;\n const last = this._overrides[this._overrides.length - 1];\n last.properties.push({ id: _id, value });\n return this;\n }\n\n public build() {\n return this._overrides;\n }\n}\n","import { FieldConfigSource } from '@grafana/data';\nimport { cloneDeep, merge } from 'lodash';\nimport { DeepPartial } from '../types';\nimport { FieldConfigOverridesBuilder } from './FieldConfigOverridesBuilder';\nimport { StandardFieldConfig, StandardFieldConfigInterface } from './types';\n\nexport class FieldConfigBuilder<TFieldConfig extends {}>\n implements StandardFieldConfigInterface<StandardFieldConfig, FieldConfigBuilder<TFieldConfig>, 'set'>\n{\n private _fieldConfig: FieldConfigSource<DeepPartial<TFieldConfig>> = {\n defaults: {},\n overrides: [],\n };\n private _overridesBuilder = new FieldConfigOverridesBuilder<TFieldConfig>();\n\n public constructor(private defaultFieldConfig?: () => TFieldConfig) {\n this.setDefaults();\n }\n\n private setDefaults() {\n const fieldConfig: FieldConfigSource<TFieldConfig> = {\n defaults: {\n custom: this.defaultFieldConfig ? cloneDeep(this.defaultFieldConfig()) : ({} as TFieldConfig),\n }, // use field config factory that will provide default field config\n overrides: [],\n };\n\n this._fieldConfig = fieldConfig;\n }\n /**\n * Set color.\n */\n public setColor(color: StandardFieldConfig['color']): this {\n return this.setFieldConfigDefaults('color', color);\n }\n\n /**\n * Set number of decimals to show.\n */\n public setDecimals(decimals: StandardFieldConfig['decimals']): this {\n return this.setFieldConfigDefaults('decimals', decimals);\n }\n\n /**\n * Set field display name.\n */\n public setDisplayName(displayName: StandardFieldConfig['displayName']): this {\n return this.setFieldConfigDefaults('displayName', displayName);\n }\n\n /**\n * Set the standard field config property filterable.\n */\n public setFilterable(filterable: StandardFieldConfig['filterable']): this {\n return this.setFieldConfigDefaults('filterable', filterable);\n }\n\n /**\n * Set data links.\n */\n public setLinks(links: StandardFieldConfig['links']): this {\n return this.setFieldConfigDefaults('links', links);\n }\n\n /**\n * Set value mappings.\n */\n public setMappings(mappings: StandardFieldConfig['mappings']): this {\n return this.setFieldConfigDefaults('mappings', mappings);\n }\n\n /**\n * Set the standard field config property max.\n */\n public setMax(max: StandardFieldConfig['max']): this {\n return this.setFieldConfigDefaults('max', max);\n }\n\n /**\n * Set the standard field config property min.\n */\n public setMin(min: StandardFieldConfig['min']): this {\n return this.setFieldConfigDefaults('min', min);\n }\n\n /**\n * Set the standard field config property noValue.\n */\n public setNoValue(noValue: StandardFieldConfig['noValue']): this {\n return this.setFieldConfigDefaults('noValue', noValue);\n }\n\n /**\n * Set the standard field config property thresholds.\n */\n public setThresholds(thresholds: StandardFieldConfig['thresholds']): this {\n return this.setFieldConfigDefaults('thresholds', thresholds);\n }\n\n /**\n * Set the standard field config property unit.\n */\n public setUnit(unit: StandardFieldConfig['unit']): this {\n return this.setFieldConfigDefaults('unit', unit);\n }\n\n /**\n * Set an individual custom field config value. This will merge the value with the existing custom field config.\n */\n public setCustomFieldConfig<T extends TFieldConfig, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._fieldConfig.defaults = {\n ...this._fieldConfig.defaults,\n custom: merge(this._fieldConfig.defaults.custom, { [id]: value }),\n };\n\n return this;\n }\n\n /**\n * Configure overrides for the field config. This will merge the overrides with the existing overrides.\n */\n public setOverrides(builder: (b: FieldConfigOverridesBuilder<TFieldConfig>) => void): this {\n builder(this._overridesBuilder);\n return this;\n }\n\n public setFieldConfigDefaults<T extends keyof StandardFieldConfig>(key: T, value: StandardFieldConfig[T]) {\n this._fieldConfig.defaults = {\n ...this._fieldConfig.defaults,\n [key]: value,\n };\n return this;\n }\n\n public build() {\n return {\n defaults: this._fieldConfig.defaults,\n overrides: this._overridesBuilder.build(),\n };\n }\n}\n","import { cloneDeep, merge } from 'lodash';\nimport { DeepPartial } from '../types';\n\nexport class PanelOptionsBuilder<TOptions extends {} = {}> {\n private _options: DeepPartial<TOptions> = {};\n\n public constructor(private defaultOptions?: () => Partial<TOptions>) {\n this.setDefaults();\n }\n\n private setDefaults() {\n this._options = this.defaultOptions ? cloneDeep(this.defaultOptions()) : ({} as TOptions);\n }\n\n /**\n * Set an individual panel option. This will merge the value with the existing options.\n */\n public setOption<T extends TOptions, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._options = merge(this._options, { [id]: value });\n return this;\n }\n\n public build() {\n return this._options;\n }\n}\n","import { VizPanel, VizPanelState } from '../../components/VizPanel/VizPanel';\nimport { DeepPartial } from '../types';\nimport { FieldConfigBuilder } from './FieldConfigBuilder';\nimport { FieldConfigOverridesBuilder } from './FieldConfigOverridesBuilder';\nimport { PanelOptionsBuilder } from './PanelOptionsBuilder';\nimport { StandardFieldConfig, StandardFieldConfigInterface } from './types';\n\nexport class VizPanelBuilder<TOptions extends {}, TFieldConfig extends {}>\n implements StandardFieldConfigInterface<StandardFieldConfig, VizPanelBuilder<TOptions, TFieldConfig>, 'set'>\n{\n private _state: VizPanelState<TOptions, TFieldConfig> = {} as VizPanelState<TOptions, TFieldConfig>;\n private _fieldConfigBuilder: FieldConfigBuilder<TFieldConfig>;\n private _panelOptionsBuilder: PanelOptionsBuilder<TOptions>;\n\n public constructor(\n pluginId: string,\n pluginVersion: string,\n defaultOptions?: () => Partial<TOptions>,\n defaultFieldConfig?: () => TFieldConfig\n ) {\n this._state.title = '';\n this._state.description = '';\n this._state.displayMode = 'default';\n this._state.hoverHeader = false;\n this._state.pluginId = pluginId;\n this._state.pluginVersion = pluginVersion;\n\n this._fieldConfigBuilder = new FieldConfigBuilder(defaultFieldConfig);\n this._panelOptionsBuilder = new PanelOptionsBuilder(defaultOptions);\n }\n\n /**\n * Set panel title.\n */\n public setTitle(title: VizPanelState['title']): this {\n this._state.title = title;\n return this;\n }\n\n /**\n * Set panel description.\n */\n public setDescription(description: VizPanelState['description']): this {\n this._state.description = description;\n return this;\n }\n\n /**\n * Set panel display mode.\n */\n public setDisplayMode(displayMode: VizPanelState['displayMode']): this {\n this._state.displayMode = displayMode;\n return this;\n }\n\n /**\n * Set if panel header should be shown on hover.\n */\n public setHoverHeader(hoverHeader: VizPanelState['hoverHeader']): this {\n this._state.hoverHeader = hoverHeader;\n return this;\n }\n\n /**\n * Set panel menu scene object.\n */\n public setMenu(menu: VizPanelState['menu']): this {\n this._state.menu = menu;\n return this;\n }\n\n /**\n * Set scene object or react component to use as panel header actions.\n */\n public setHeaderActions(headerActions: VizPanelState['headerActions']): this {\n this._state.headerActions = headerActions;\n return this;\n }\n\n /**\n * Set color.\n */\n public setColor(color: StandardFieldConfig['color']): this {\n this._fieldConfigBuilder.setColor(color);\n return this;\n }\n\n /**\n * Set number of decimals to show.\n */\n public setDecimals(decimals: StandardFieldConfig['decimals']): this {\n this._fieldConfigBuilder.setDecimals(decimals);\n return this;\n }\n\n /**\n * Set field display name.\n */\n public setDisplayName(displayName: StandardFieldConfig['displayName']): this {\n this._fieldConfigBuilder.setDisplayName(displayName);\n return this;\n }\n\n /**\n * Set the standard field config property filterable.\n */\n public setFilterable(filterable: StandardFieldConfig['filterable']): this {\n this._fieldConfigBuilder.setFilterable(filterable);\n return this;\n }\n\n /**\n * Set data links.\n */\n public setLinks(links: StandardFieldConfig['links']): this {\n this._fieldConfigBuilder.setLinks(links);\n return this;\n }\n\n /**\n * Set value mappings.\n */\n public setMappings(mappings: StandardFieldConfig['mappings']): this {\n this._fieldConfigBuilder.setMappings(mappings);\n return this;\n }\n\n /**\n * Set the standard field config property max.\n */\n public setMax(max: StandardFieldConfig['max']): this {\n this._fieldConfigBuilder.setMax(max);\n return this;\n }\n\n /**\n * Set the standard field config property min.\n */\n public setMin(min: StandardFieldConfig['min']): this {\n this._fieldConfigBuilder.setMin(min);\n return this;\n }\n\n /**\n * Set the standard field config property noValue.\n */\n public setNoValue(noValue: StandardFieldConfig['noValue']): this {\n this._fieldConfigBuilder.setNoValue(noValue);\n return this;\n }\n\n /**\n * Set the standard field config property thresholds.\n */\n public setThresholds(thresholds: StandardFieldConfig['thresholds']): this {\n this._fieldConfigBuilder.setThresholds(thresholds);\n return this;\n }\n\n /**\n * Set the standard field config property unit.\n */\n public setUnit(unit: StandardFieldConfig['unit']): this {\n this._fieldConfigBuilder.setUnit(unit);\n return this;\n }\n\n public setCustomFieldConfig<T extends TFieldConfig, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._fieldConfigBuilder.setCustomFieldConfig(id, value);\n return this;\n }\n\n public setOverrides(builder: (b: FieldConfigOverridesBuilder<TFieldConfig>) => void): this {\n this._fieldConfigBuilder.setOverrides(builder);\n return this;\n }\n\n /**\n * Set an individual panel option. This will merge the value with the existing options.\n */\n public setOption<T extends TOptions, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._panelOptionsBuilder.setOption(id, value);\n return this;\n }\n\n /**\n * Set data provider for the panel.\n */\n public setData(data: VizPanelState['$data']): this {\n this._state.$data = data;\n return this;\n }\n\n /**\n * Set time range for the panel.\n */\n public setTimeRange(timeRange: VizPanelState['$timeRange']): this {\n this._state.$timeRange = timeRange;\n return this;\n }\n\n /**\n * Set variables for the panel.\n */\n public setVariables(variables: VizPanelState['$variables']): this {\n this._state.$variables = variables;\n return this;\n }\n\n /**\n * Set behaviors for the panel.\n */\n public setBehaviors(behaviors: VizPanelState['$behaviors']): this {\n this._state.$behaviors = behaviors;\n return this;\n }\n\n /**\n * Build the panel.\n */\n public build() {\n const panel = new VizPanel<TOptions, TFieldConfig>({\n ...this._state,\n options: this._panelOptionsBuilder.build(),\n fieldConfig: this._fieldConfigBuilder.build(),\n });\n\n return panel;\n }\n}\n","import {\n Options as BarChartOptions,\n defaultOptions as defaultBarChartOptions,\n} from '@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen';\nimport {\n Options as BarGaugeOptions,\n defaultOptions as defaultBarGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/bargauge/panelcfg/x/BarGaugePanelCfg_types.gen';\nimport {\n Options as DataGridOptions,\n defaultOptions as defaultDataGridOptions,\n} from '@grafana/schema/dist/esm/raw/composable/datagrid/panelcfg/x/DatagridPanelCfg_types.gen';\nimport {\n Options as GaugeOptions,\n defaultOptions as defaultGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/gauge/panelcfg/x/GaugePanelCfg_types.gen';\nimport {\n Options as GeomapOptions,\n defaultOptions as defaultGeomapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/geomap/panelcfg/x/GeomapPanelCfg_types.gen';\nimport {\n Options as HeatmapOptions,\n defaultOptions as defaultHeatmapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/heatmap/panelcfg/x/HeatmapPanelCfg_types.gen';\nimport {\n Options as HistogramOptions,\n defaultOptions as defaultHistogramOptions,\n} from '@grafana/schema/dist/esm/raw/composable/histogram/panelcfg/x/HistogramPanelCfg_types.gen';\nimport { Options as LogsOptions } from '@grafana/schema/dist/esm/raw/composable/logs/panelcfg/x/LogsPanelCfg_types.gen';\nimport {\n Options as NewsOptions,\n defaultOptions as defaultNewsOptions,\n} from '@grafana/schema/dist/esm/raw/composable/news/panelcfg/x/NewsPanelCfg_types.gen';\nimport { Options as NodeGraphOptions } from '@grafana/schema/dist/esm/raw/composable/nodegraph/panelcfg/x/NodeGraphPanelCfg_types.gen';\nimport {\n Options as PieChartOptions,\n defaultOptions as defaultPieChartOptions,\n} from '@grafana/schema/dist/esm/raw/composable/piechart/panelcfg/x/PieChartPanelCfg_types.gen';\nimport {\n Options as StatOptions,\n defaultOptions as defaultStatOptions,\n} from '@grafana/schema/dist/esm/raw/composable/stat/panelcfg/x/StatPanelCfg_types.gen';\nimport {\n Options as StateTimelineOptions,\n defaultOptions as defaultStateTimelineOptions,\n} from '@grafana/schema/dist/esm/raw/composable/statetimeline/panelcfg/x/StateTimelinePanelCfg_types.gen';\nimport {\n Options as StatusHistoryOptions,\n defaultOptions as defaultStatusHistoryOptions,\n} from '@grafana/schema/dist/esm/raw/composable/statushistory/panelcfg/x/StatusHistoryPanelCfg_types.gen';\nimport {\n Options as TableOptions,\n defaultOptions as defaultTableOptions,\n} from '@grafana/schema/dist/esm/raw/composable/table/panelcfg/x/TablePanelCfg_types.gen';\nimport {\n Options as TextOptions,\n defaultOptions as defaultTextOptions,\n} from '@grafana/schema/dist/esm/raw/composable/text/panelcfg/x/TextPanelCfg_types.gen';\nimport { Options as TimeSeriesOptions } from '@grafana/schema/dist/esm/raw/composable/timeseries/panelcfg/x/TimeSeriesPanelCfg_types.gen';\nimport { Options as TrendOptions } from '@grafana/schema/dist/esm/raw/composable/trend/panelcfg/x/TrendPanelCfg_types.gen';\nimport {\n Options as XYChartOptions,\n defaultOptions as defaultXYChartOptions,\n} from '@grafana/schema/dist/esm/raw/composable/xychart/panelcfg/x/XYChartPanelCfg_types.gen';\n\nimport { PanelOptionsBuilder } from './PanelOptionsBuilder';\n\nexport const PanelOptionsBuilders = {\n barchart() {\n return new PanelOptionsBuilder<BarChartOptions>(() => defaultBarChartOptions);\n },\n bargauge() {\n return new PanelOptionsBuilder<BarGaugeOptions>(() => defaultBarGaugeOptions);\n },\n datagrid() {\n return new PanelOptionsBuilder<DataGridOptions>(() => defaultDataGridOptions);\n },\n flamegraph() {\n return new PanelOptionsBuilder<{}>();\n },\n gauge() {\n return new PanelOptionsBuilder<GaugeOptions>(() => defaultGaugeOptions);\n },\n geomap() {\n return new PanelOptionsBuilder<GeomapOptions>(() => defaultGeomapOptions);\n },\n heatmap() {\n return new PanelOptionsBuilder<HeatmapOptions>(() => defaultHeatmapOptions);\n },\n histogram() {\n return new PanelOptionsBuilder<HistogramOptions>(() => defaultHistogramOptions);\n },\n logs() {\n return new PanelOptionsBuilder<LogsOptions>();\n },\n news() {\n return new PanelOptionsBuilder<NewsOptions>(() => defaultNewsOptions);\n },\n nodegraph() {\n return new PanelOptionsBuilder<NodeGraphOptions>();\n },\n piechart() {\n return new PanelOptionsBuilder<PieChartOptions>(() => defaultPieChartOptions);\n },\n stat() {\n return new PanelOptionsBuilder<StatOptions>(() => defaultStatOptions);\n },\n statetimeline() {\n return new PanelOptionsBuilder<StateTimelineOptions>(() => defaultStateTimelineOptions);\n },\n statushistory() {\n return new PanelOptionsBuilder<StatusHistoryOptions>(() => defaultStatusHistoryOptions);\n },\n table() {\n return new PanelOptionsBuilder<TableOptions>(() => defaultTableOptions);\n },\n text() {\n return new PanelOptionsBuilder<TextOptions>(() => defaultTextOptions);\n },\n timeseries() {\n return new PanelOptionsBuilder<TimeSeriesOptions>();\n },\n trend() {\n return new PanelOptionsBuilder<{}>();\n },\n traces() {\n return new PanelOptionsBuilder<TrendOptions>();\n },\n xychart() {\n return new PanelOptionsBuilder<XYChartOptions>(() => defaultXYChartOptions);\n },\n};\n","import { TableFieldOptions as TableFieldConfig } from '@grafana/schema';\n\nimport {\n FieldConfig as BarChartFieldConfig,\n defaultFieldConfig as defaultBarChartFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen';\nimport { FieldConfig as HeatmapFieldConfig } from '@grafana/schema/dist/esm/raw/composable/heatmap/panelcfg/x/HeatmapPanelCfg_types.gen';\nimport {\n FieldConfig as HistogramFieldConfig,\n defaultFieldConfig as defaultHistogramFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/histogram/panelcfg/x/HistogramPanelCfg_types.gen';\nimport { FieldConfig as PieChartFieldConfig } from '@grafana/schema/dist/esm/raw/composable/piechart/panelcfg/x/PieChartPanelCfg_types.gen';\nimport {\n FieldConfig as StateTimelineFieldConfig,\n defaultFieldConfig as defaultStateTimelineFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statetimeline/panelcfg/x/StateTimelinePanelCfg_types.gen';\nimport {\n FieldConfig as StatusHistoryFieldConfig,\n defaultFieldConfig as defaultStatusHistoryFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statushistory/panelcfg/x/StatusHistoryPanelCfg_types.gen';\nimport { FieldConfig as TimeSeriesFieldConfig } from '@grafana/schema/dist/esm/raw/composable/timeseries/panelcfg/x/TimeSeriesPanelCfg_types.gen';\nimport { FieldConfig as TrendFieldConfig } from '@grafana/schema/dist/esm/raw/composable/trend/panelcfg/x/TrendPanelCfg_types.gen';\nimport { defaultFieldConfig as defaultXYChartFieldConfig } from '@grafana/schema/dist/esm/raw/composable/xychart/panelcfg/x/XYChartPanelCfg_types.gen';\nimport { FieldConfigBuilder } from './FieldConfigBuilder';\n\nexport const FieldConfigBuilders = {\n barchart() {\n return new FieldConfigBuilder<BarChartFieldConfig>(() => defaultBarChartFieldConfig);\n },\n bargauge() {\n return new FieldConfigBuilder<{}>();\n },\n datagrid() {\n return new FieldConfigBuilder<{}>();\n },\n flamegraph() {\n return new FieldConfigBuilder<{}>();\n },\n gauge() {\n return new FieldConfigBuilder<{}>();\n },\n geomap() {\n return new FieldConfigBuilder<{}>();\n },\n heatmap() {\n return new FieldConfigBuilder<HeatmapFieldConfig>();\n },\n histogram() {\n return new FieldConfigBuilder<HistogramFieldConfig>(() => defaultHistogramFieldConfig);\n },\n logs() {\n return new FieldConfigBuilder<{}>();\n },\n news() {\n return new FieldConfigBuilder<{}>();\n },\n nodegraph() {\n return new FieldConfigBuilder<{}>();\n },\n piechart() {\n return new FieldConfigBuilder<PieChartFieldConfig>();\n },\n stat() {\n return new FieldConfigBuilder<{}>();\n },\n statetimeline() {\n return new FieldConfigBuilder<StateTimelineFieldConfig>(() => defaultStateTimelineFieldConfig);\n },\n statushistory() {\n return new FieldConfigBuilder<StatusHistoryFieldConfig>(() => defaultStatusHistoryFieldConfig);\n },\n table() {\n return new FieldConfigBuilder<TableFieldConfig>();\n },\n text() {\n return new FieldConfigBuilder<{}>();\n },\n timeseries() {\n return new FieldConfigBuilder<TimeSeriesFieldConfig>();\n },\n trend() {\n return new FieldConfigBuilder<{}>();\n },\n traces() {\n return new FieldConfigBuilder<TrendFieldConfig>();\n },\n xychart() {\n return new FieldConfigBuilder<{}>(() => defaultXYChartFieldConfig);\n },\n};\n","import { TableFieldOptions as TableFieldConfig } from '@grafana/schema';\n\nimport {\n Options as BarChartOptions,\n FieldConfig as BarChartFieldConfig,\n defaultOptions as defaultBarChartOptions,\n defaultFieldConfig as defaultBarChartFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen';\nimport {\n Options as BarGaugeOptions,\n defaultOptions as defaultBarGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/bargauge/panelcfg/x/BarGaugePanelCfg_types.gen';\nimport {\n Options as DataGridOptions,\n defaultOptions as defaultDataGridOptions,\n} from '@grafana/schema/dist/esm/raw/composable/datagrid/panelcfg/x/DatagridPanelCfg_types.gen';\nimport {\n Options as GaugeOptions,\n defaultOptions as defaultGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/gauge/panelcfg/x/GaugePanelCfg_types.gen';\nimport {\n Options as GeomapOptions,\n defaultOptions as defaultGeomapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/geomap/panelcfg/x/GeomapPanelCfg_types.gen';\nimport {\n Options as HeatmapOptions,\n FieldConfig as HeatmapFieldConfig,\n defaultOptions as defaultHeatmapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/heatmap/panelcfg/x/HeatmapPanelCfg_types.gen';\nimport {\n Options as HistogramOptions,\n FieldConfig as HistogramFieldConfig,\n defaultOptions as defaultHistogramOptions,\n defaultFieldConfig as defaultHistogramFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/histogram/panelcfg/x/HistogramPanelCfg_types.gen';\nimport { Options as LogsOptions } from '@grafana/schema/dist/esm/raw/composable/logs/panelcfg/x/LogsPanelCfg_types.gen';\nimport {\n Options as NewsOptions,\n defaultOptions as defaultNewsOptions,\n} from '@grafana/schema/dist/esm/raw/composable/news/panelcfg/x/NewsPanelCfg_types.gen';\nimport { Options as NodeGraphOptions } from '@grafana/schema/dist/esm/raw/composable/nodegraph/panelcfg/x/NodeGraphPanelCfg_types.gen';\nimport {\n Options as PieChartOptions,\n FieldConfig as PieChartFieldConfig,\n defaultOptions as defaultPieChartOptions,\n} from '@grafana/schema/dist/esm/raw/composable/piechart/panelcfg/x/PieChartPanelCfg_types.gen';\nimport {\n Options as StatOptions,\n defaultOptions as defaultStatOptions,\n} from '@grafana/schema/dist/esm/raw/composable/stat/panelcfg/x/StatPanelCfg_types.gen';\nimport {\n Options as StateTimelineOptions,\n FieldConfig as StateTimelineFieldConfig,\n defaultOptions as defaultStateTimelineOptions,\n defaultFieldConfig as defaultStateTimelineFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statetimeline/panelcfg/x/StateTimelinePanelCfg_types.gen';\nimport {\n Options as StatusHistoryOptions,\n FieldConfig as StatusHistoryFieldConfig,\n defaultOptions as defaultStatusHistoryOptions,\n defaultFieldConfig as defaultStatusHistoryFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statushistory/panelcfg/x/StatusHistoryPanelCfg_types.gen';\nimport {\n Options as TableOptions,\n defaultOptions as defaultTableOptions,\n} from '@grafana/schema/dist/esm/raw/composable/table/panelcfg/x/TablePanelCfg_types.gen';\nimport {\n Options as TextOptions,\n defaultOptions as defaultTextOptions,\n} from '@grafana/schema/dist/esm/raw/composable/text/panelcfg/x/TextPanelCfg_types.gen';\nimport {\n Options as TimeSeriesOptions,\n FieldConfig as TimeSeriesFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/timeseries/panelcfg/x/TimeSeriesPanelCfg_types.gen';\nimport {\n Options as TrendOptions,\n FieldConfig as TrendFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/trend/panelcfg/x/TrendPanelCfg_types.gen';\nimport {\n Options as XYChartOptions,\n defaultOptions as defaultXYChartOptions,\n defaultFieldConfig as defaultXYChartFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/xychart/panelcfg/x/XYChartPanelCfg_types.gen';\n\nimport { VizPanelBuilder } from './VizPanelBuilder';\n\nexport const PanelBuilders = {\n barchart() {\n return new VizPanelBuilder<BarChartOptions, BarChartFieldConfig>(\n 'barchart',\n '10.0.0',\n () => defaultBarChartOptions,\n () => defaultBarChartFieldConfig\n );\n },\n bargauge() {\n return new VizPanelBuilder<BarGaugeOptions, {}>('bargauge', '10.0.0', () => defaultBarGaugeOptions);\n },\n datagrid() {\n return new VizPanelBuilder<DataGridOptions, {}>('datagrid', '10.0.0', () => defaultDataGridOptions);\n },\n flamegraph() {\n return new VizPanelBuilder<{}, {}>('flamegraph', '10.0.0');\n },\n gauge() {\n return new VizPanelBuilder<GaugeOptions, {}>('gauge', '10.0.0', () => defaultGaugeOptions);\n },\n geomap() {\n return new VizPanelBuilder<GeomapOptions, {}>('geomap', '10.0.0', () => defaultGeomapOptions);\n },\n heatmap() {\n return new VizPanelBuilder<HeatmapOptions, HeatmapFieldConfig>('heatmap', '10.0.0', () => defaultHeatmapOptions);\n },\n histogram() {\n return new VizPanelBuilder<HistogramOptions, HistogramFieldConfig>(\n 'histogram',\n '10.0.0',\n () => defaultHistogramOptions,\n () => defaultHistogramFieldConfig\n );\n },\n logs() {\n return new VizPanelBuilder<LogsOptions, {}>('logs', '10.0.0');\n },\n news() {\n return new VizPanelBuilder<NewsOptions, {}>('news', '10.0.0', () => defaultNewsOptions);\n },\n nodegraph() {\n return new VizPanelBuilder<NodeGraphOptions, {}>('nodeGraph', '10.0.0');\n },\n piechart() {\n return new VizPanelBuilder<PieChartOptions, PieChartFieldConfig>(\n 'piechart',\n '10.0.0',\n () => defaultPieChartOptions\n );\n },\n stat() {\n return new VizPanelBuilder<StatOptions, {}>('stat', '10.0.0', () => defaultStatOptions);\n },\n statetimeline() {\n return new VizPanelBuilder<StateTimelineOptions, StateTimelineFieldConfig>(\n 'state-timeline',\n '10.0.0',\n () => defaultStateTimelineOptions,\n () => defaultStateTimelineFieldConfig\n );\n },\n statushistory() {\n return new VizPanelBuilder<StatusHistoryOptions, StatusHistoryFieldConfig>(\n 'status-history',\n '10.0.0',\n () => defaultStatusHistoryOptions,\n () => defaultStatusHistoryFieldConfig\n );\n },\n table() {\n return new VizPanelBuilder<TableOptions, TableFieldConfig>('table', '10.0.0', () => defaultTableOptions);\n },\n text() {\n return new VizPanelBuilder<TextOptions, {}>('text', '10.0.0', () => defaultTextOptions);\n },\n timeseries() {\n return new VizPanelBuilder<TimeSeriesOptions, TimeSeriesFieldConfig>('timeseries', '10.0.0');\n },\n trend() {\n return new VizPanelBuilder<{}, {}>('trend', '10.0.0');\n },\n traces() {\n return new VizPanelBuilder<TrendOptions, TrendFieldConfig>('traces', '10.0.0');\n },\n xychart() {\n return new VizPanelBuilder<XYChartOptions, {}>(\n 'xychart',\n '10.0.0',\n () => defaultXYChartOptions,\n () => defaultXYChartFieldConfig\n );\n },\n};\n\nexport { PanelOptionsBuilders } from './PanelOptionsBuilders';\nexport { FieldConfigBuilders } from './FieldConfigBuilders';\nexport { FieldConfigOverridesBuilder } from './FieldConfigOverridesBuilder';\n","import { DeepPartial } from '../types';\nimport { FieldConfigBuilder } from './FieldConfigBuilder';\nimport { FieldConfigOverridesBuilder } from './FieldConfigOverridesBuilder';\nimport { PanelOptionsBuilder } from './PanelOptionsBuilder';\nimport { StandardFieldConfig, StandardFieldConfigInterface, VizConfig } from './types';\n\nexport class VizConfigBuilder<TOptions extends {}, TFieldConfig extends {}>\n implements StandardFieldConfigInterface<StandardFieldConfig, VizConfigBuilder<TOptions, TFieldConfig>, 'set'>\n{\n private _fieldConfigBuilder: FieldConfigBuilder<TFieldConfig>;\n private _panelOptionsBuilder: PanelOptionsBuilder<TOptions>;\n private _pluginId: string;\n private _pluginVersion: string;\n\n public constructor(\n pluginId: string,\n pluginVersion: string,\n defaultOptions?: () => Partial<TOptions>,\n defaultFieldConfig?: () => TFieldConfig\n ) {\n this._pluginId = pluginId;\n this._pluginVersion = pluginVersion;\n this._fieldConfigBuilder = new FieldConfigBuilder(defaultFieldConfig);\n this._panelOptionsBuilder = new PanelOptionsBuilder(defaultOptions);\n }\n\n /**\n * Set color.\n */\n public setColor(color: StandardFieldConfig['color']): this {\n this._fieldConfigBuilder.setColor(color);\n return this;\n }\n\n /**\n * Set number of decimals to show.\n */\n public setDecimals(decimals: StandardFieldConfig['decimals']): this {\n this._fieldConfigBuilder.setDecimals(decimals);\n return this;\n }\n\n /**\n * Set field display name.\n */\n public setDisplayName(displayName: StandardFieldConfig['displayName']): this {\n this._fieldConfigBuilder.setDisplayName(displayName);\n return this;\n }\n\n /**\n * Set the standard field config property filterable.\n */\n public setFilterable(filterable: StandardFieldConfig['filterable']): this {\n this._fieldConfigBuilder.setFilterable(filterable);\n return this;\n }\n\n /**\n * Set data links.\n */\n public setLinks(links: StandardFieldConfig['links']): this {\n this._fieldConfigBuilder.setLinks(links);\n return this;\n }\n\n /**\n * Set value mappings.\n */\n public setMappings(mappings: StandardFieldConfig['mappings']): this {\n this._fieldConfigBuilder.setMappings(mappings);\n return this;\n }\n\n /**\n * Set the standard field config property max.\n */\n public setMax(max: StandardFieldConfig['max']): this {\n this._fieldConfigBuilder.setMax(max);\n return this;\n }\n\n /**\n * Set the standard field config property min.\n */\n public setMin(min: StandardFieldConfig['min']): this {\n this._fieldConfigBuilder.setMin(min);\n return this;\n }\n\n /**\n * Set the standard field config property noValue.\n */\n public setNoValue(noValue: StandardFieldConfig['noValue']): this {\n this._fieldConfigBuilder.setNoValue(noValue);\n return this;\n }\n\n /**\n * Set the standard field config property thresholds.\n */\n public setThresholds(thresholds: StandardFieldConfig['thresholds']): this {\n this._fieldConfigBuilder.setThresholds(thresholds);\n return this;\n }\n\n /**\n * Set the standard field config property unit.\n */\n public setUnit(unit: StandardFieldConfig['unit']): this {\n this._fieldConfigBuilder.setUnit(unit);\n return this;\n }\n\n public setCustomFieldConfig<T extends TFieldConfig, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._fieldConfigBuilder.setCustomFieldConfig(id, value);\n return this;\n }\n\n public setOverrides(builder: (b: FieldConfigOverridesBuilder<TFieldConfig>) => void): this {\n this._fieldConfigBuilder.setOverrides(builder);\n return this;\n }\n\n /**\n * Set an individual panel option. This will merge the value with the existing options.\n */\n public setOption<T extends TOptions, K extends keyof T>(id: K, value: DeepPartial<T[K]>): this {\n this._panelOptionsBuilder.setOption(id, value);\n return this;\n }\n\n /**\n * Build the panel.\n */\n public build(): VizConfig<TOptions, TFieldConfig> {\n return {\n pluginId: this._pluginId,\n pluginVersion: this._pluginVersion,\n options: this._panelOptionsBuilder.build(),\n fieldConfig: this._fieldConfigBuilder.build(),\n };\n }\n}\n","import { TableFieldOptions as TableFieldConfig } from '@grafana/schema';\n\nimport {\n Options as BarChartOptions,\n FieldConfig as BarChartFieldConfig,\n defaultOptions as defaultBarChartOptions,\n defaultFieldConfig as defaultBarChartFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen';\nimport {\n Options as BarGaugeOptions,\n defaultOptions as defaultBarGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/bargauge/panelcfg/x/BarGaugePanelCfg_types.gen';\nimport {\n Options as DataGridOptions,\n defaultOptions as defaultDataGridOptions,\n} from '@grafana/schema/dist/esm/raw/composable/datagrid/panelcfg/x/DatagridPanelCfg_types.gen';\nimport {\n Options as GaugeOptions,\n defaultOptions as defaultGaugeOptions,\n} from '@grafana/schema/dist/esm/raw/composable/gauge/panelcfg/x/GaugePanelCfg_types.gen';\nimport {\n Options as GeomapOptions,\n defaultOptions as defaultGeomapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/geomap/panelcfg/x/GeomapPanelCfg_types.gen';\nimport {\n Options as HeatmapOptions,\n FieldConfig as HeatmapFieldConfig,\n defaultOptions as defaultHeatmapOptions,\n} from '@grafana/schema/dist/esm/raw/composable/heatmap/panelcfg/x/HeatmapPanelCfg_types.gen';\nimport {\n Options as HistogramOptions,\n FieldConfig as HistogramFieldConfig,\n defaultOptions as defaultHistogramOptions,\n defaultFieldConfig as defaultHistogramFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/histogram/panelcfg/x/HistogramPanelCfg_types.gen';\nimport { Options as LogsOptions } from '@grafana/schema/dist/esm/raw/composable/logs/panelcfg/x/LogsPanelCfg_types.gen';\nimport {\n Options as NewsOptions,\n defaultOptions as defaultNewsOptions,\n} from '@grafana/schema/dist/esm/raw/composable/news/panelcfg/x/NewsPanelCfg_types.gen';\nimport { Options as NodeGraphOptions } from '@grafana/schema/dist/esm/raw/composable/nodegraph/panelcfg/x/NodeGraphPanelCfg_types.gen';\nimport {\n Options as PieChartOptions,\n FieldConfig as PieChartFieldConfig,\n defaultOptions as defaultPieChartOptions,\n} from '@grafana/schema/dist/esm/raw/composable/piechart/panelcfg/x/PieChartPanelCfg_types.gen';\nimport {\n Options as StatOptions,\n defaultOptions as defaultStatOptions,\n} from '@grafana/schema/dist/esm/raw/composable/stat/panelcfg/x/StatPanelCfg_types.gen';\nimport {\n Options as StateTimelineOptions,\n FieldConfig as StateTimelineFieldConfig,\n defaultOptions as defaultStateTimelineOptions,\n defaultFieldConfig as defaultStateTimelineFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statetimeline/panelcfg/x/StateTimelinePanelCfg_types.gen';\nimport {\n Options as StatusHistoryOptions,\n FieldConfig as StatusHistoryFieldConfig,\n defaultOptions as defaultStatusHistoryOptions,\n defaultFieldConfig as defaultStatusHistoryFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/statushistory/panelcfg/x/StatusHistoryPanelCfg_types.gen';\nimport {\n Options as TableOptions,\n defaultOptions as defaultTableOptions,\n} from '@grafana/schema/dist/esm/raw/composable/table/panelcfg/x/TablePanelCfg_types.gen';\nimport {\n Options as TextOptions,\n defaultOptions as defaultTextOptions,\n} from '@grafana/schema/dist/esm/raw/composable/text/panelcfg/x/TextPanelCfg_types.gen';\nimport {\n Options as TimeSeriesOptions,\n FieldConfig as TimeSeriesFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/timeseries/panelcfg/x/TimeSeriesPanelCfg_types.gen';\nimport {\n Options as TrendOptions,\n FieldConfig as TrendFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/trend/panelcfg/x/TrendPanelCfg_types.gen';\nimport {\n Options as XYChartOptions,\n defaultOptions as defaultXYChartOptions,\n defaultFieldConfig as defaultXYChartFieldConfig,\n} from '@grafana/schema/dist/esm/raw/composable/xychart/panelcfg/x/XYChartPanelCfg_types.gen';\n\nimport { VizConfigBuilder } from './VizConfigBuilder';\n\nexport const VizConfigBuilders = {\n barchart() {\n return new VizConfigBuilder<BarChartOptions, BarChartFieldConfig>(\n 'barchart',\n '10.0.0',\n () => defaultBarChartOptions,\n () => defaultBarChartFieldConfig\n );\n },\n bargauge() {\n return new VizConfigBuilder<BarGaugeOptions, {}>('bargauge', '10.0.0', () => defaultBarGaugeOptions);\n },\n datagrid() {\n return new VizConfigBuilder<DataGridOptions, {}>('datagrid', '10.0.0', () => defaultDataGridOptions);\n },\n flamegraph() {\n return new VizConfigBuilder<{}, {}>('flamegraph', '10.0.0');\n },\n gauge() {\n return new VizConfigBuilder<GaugeOptions, {}>('gauge', '10.0.0', () => defaultGaugeOptions);\n },\n geomap() {\n return new VizConfigBuilder<GeomapOptions, {}>('geomap', '10.0.0', () => defaultGeomapOptions);\n },\n heatmap() {\n return new VizConfigBuilder<HeatmapOptions, HeatmapFieldConfig>('heatmap', '10.0.0', () => defaultHeatmapOptions);\n },\n histogram() {\n return new VizConfigBuilder<HistogramOptions, HistogramFieldConfig>(\n 'histogram',\n '10.0.0',\n () => defaultHistogramOptions,\n () => defaultHistogramFieldConfig\n );\n },\n logs() {\n return new VizConfigBuilder<LogsOptions, {}>('logs', '10.0.0');\n },\n news() {\n return new VizConfigBuilder<NewsOptions, {}>('news', '10.0.0', () => defaultNewsOptions);\n },\n nodegraph() {\n return new VizConfigBuilder<NodeGraphOptions, {}>('nodeGraph', '10.0.0');\n },\n piechart() {\n return new VizConfigBuilder<PieChartOptions, PieChartFieldConfig>(\n 'piechart',\n '10.0.0',\n () => defaultPieChartOptions\n );\n },\n stat() {\n return new VizConfigBuilder<StatOptions, {}>('stat', '10.0.0', () => defaultStatOptions);\n },\n statetimeline() {\n return new VizConfigBuilder<StateTimelineOptions, StateTimelineFieldConfig>(\n 'state-timeline',\n '10.0.0',\n () => defaultStateTimelineOptions,\n () => defaultStateTimelineFieldConfig\n );\n },\n statushistory() {\n return new VizConfigBuilder<StatusHistoryOptions, StatusHistoryFieldConfig>(\n 'status-history',\n '10.0.0',\n () => defaultStatusHistoryOptions,\n () => defaultStatusHistoryFieldConfig\n );\n },\n table() {\n return new VizConfigBuilder<TableOptions, TableFieldConfig>('table', '10.0.0', () => defaultTableOptions);\n },\n text() {\n return new VizConfigBuilder<TextOptions, {}>('text', '10.0.0', () => defaultTextOptions);\n },\n timeseries() {\n return new VizConfigBuilder<TimeSeriesOptions, TimeSeriesFieldConfig>('timeseries', '10.0.0');\n },\n trend() {\n return new VizConfigBuilder<{}, {}>('trend', '10.0.0');\n },\n traces() {\n return new VizConfigBuilder<TrendOptions, TrendFieldConfig>('traces', '10.0.0');\n },\n xychart() {\n return new VizConfigBuilder<XYChartOptions, {}>(\n 'xychart',\n '10.0.0',\n () => defaultXYChartOptions,\n () => defaultXYChartFieldConfig\n );\n },\n};\n","import { getUrlWithAppState } from './components/SceneApp/utils';\nimport { registerRuntimePanelPlugin } from './components/VizPanel/registerRuntimePanelPlugin';\nimport { cloneSceneObjectState } from './core/sceneGraph/utils';\nimport { registerRuntimeDataSource } from './querying/RuntimeDataSource';\nimport { getUrlState, syncStateFromSearchParams } from './services/utils';\n\nimport { registerVariableMacro } from './variables/macros';\nimport { renderPrometheusLabelFilters } from './variables/utils';\nimport {\n isAdHocVariable,\n isQueryVariable,\n isTextBoxVariable,\n isCustomVariable,\n isDataSourceVariable,\n isConstantVariable,\n isIntervalVariable,\n isGroupByVariable,\n} from './variables/variants/guards';\n\nexport * from './core/types';\nexport * from './core/events';\nexport { sceneGraph } from './core/sceneGraph';\nexport * as behaviors from './behaviors';\nexport * as dataLayers from './querying/layers';\n\nexport { SceneObjectBase, useSceneObjectState } from './core/SceneObjectBase';\nexport { SceneDataNode } from './core/SceneDataNode';\nexport { SceneTimeRange } from './core/SceneTimeRange';\nexport { SceneTimeZoneOverride } from './core/SceneTimeZoneOverride';\n\nexport { SceneQueryRunner, type QueryRunnerState } from './querying/SceneQueryRunner';\nexport {\n type ExtraQueryDescriptor,\n type ExtraQueryProvider,\n type ExtraQueryDataProcessor,\n} from './querying/ExtraQueryProvider';\nexport { SceneDataLayerSet, SceneDataLayerSetBase } from './querying/SceneDataLayerSet';\nexport { SceneDataLayerBase } from './querying/layers/SceneDataLayerBase';\nexport { SceneDataLayerControls } from './querying/layers/SceneDataLayerControls';\nexport { SceneDataTransformer } from './querying/SceneDataTransformer';\nexport { registerQueryWithController } from './querying/registerQueryWithController';\nexport { registerRuntimeDataSource, RuntimeDataSource } from './querying/RuntimeDataSource';\nexport type {\n SceneQueryControllerLike,\n SceneQueryControllerEntryType,\n SceneQueryControllerEntry,\n} from './behaviors/SceneQueryController';\n\nexport * from './variables/types';\nexport { VariableDependencyConfig } from './variables/VariableDependencyConfig';\nexport { formatRegistry, type FormatVariable } from './variables/interpolation/formatRegistry';\nexport { VariableValueSelectors } from './variables/components/VariableValueSelectors';\nexport { VariableValueControl } from './variables/components/VariableValueControl';\nexport { SceneVariableSet } from './variables/sets/SceneVariableSet';\nexport { ConstantVariable } from './variables/variants/ConstantVariable';\nexport { CustomVariable } from './variables/variants/CustomVariable';\nexport { DataSourceVariable } from './variables/variants/DataSourceVariable';\nexport { QueryVariable } from './variables/variants/query/QueryVariable';\nexport { TestVariable } from './variables/variants/TestVariable';\nexport { TextBoxVariable } from './variables/variants/TextBoxVariable';\nexport {\n MultiValueVariable,\n type MultiValueVariableState,\n type VariableGetOptionsArgs,\n} from './variables/variants/MultiValueVariable';\nexport { LocalValueVariable } from './variables/variants/LocalValueVariable';\nexport { IntervalVariable } from './variables/variants/IntervalVariable';\nexport { AdHocFiltersVariable } from './variables/adhoc/AdHocFiltersVariable';\nexport { GroupByVariable } from './variables/groupby/GroupByVariable';\nexport { type MacroVariableConstructor } from './variables/macros/types';\n\nexport { type UrlSyncManagerLike, UrlSyncManager, getUrlSyncManager } from './services/UrlSyncManager';\nexport { useUrlSync } from './services/useUrlSync';\nexport { UrlSyncContextProvider } from './services/UrlSyncContextProvider';\nexport { SceneObjectUrlSyncConfig } from './services/SceneObjectUrlSyncConfig';\n\nexport { EmbeddedScene, type EmbeddedSceneState } from './components/EmbeddedScene';\nexport { VizPanel, type VizPanelState } from './components/VizPanel/VizPanel';\nexport { VizPanelMenu } from './components/VizPanel/VizPanelMenu';\nexport { NestedScene } from './components/NestedScene';\nexport { SceneCanvasText } from './components/SceneCanvasText';\nexport { SceneToolbarButton, SceneToolbarInput } from './components/SceneToolbarButton';\nexport { SceneTimePicker } from './components/SceneTimePicker';\nexport { SceneRefreshPicker, type SceneRefreshPickerState } from './components/SceneRefreshPicker';\nexport { SceneTimeRangeTransformerBase } from './core/SceneTimeRangeTransformerBase';\nexport { SceneTimeRangeCompare } from './components/SceneTimeRangeCompare';\nexport { SceneByFrameRepeater } from './components/SceneByFrameRepeater';\nexport { SceneByVariableRepeater } from './components/SceneByVariableRepeater';\nexport { SceneControlsSpacer } from './components/SceneControlsSpacer';\nexport {\n SceneFlexLayout,\n SceneFlexItem,\n type SceneFlexItemState,\n type SceneFlexItemLike,\n} from './components/layout/SceneFlexLayout';\nexport { SceneCSSGridLayout, SceneCSSGridItem } from './components/layout/CSSGrid/SceneCSSGridLayout';\nexport { SceneGridLayout } from './components/layout/grid/SceneGridLayout';\nexport { SceneGridItem } from './components/layout/grid/SceneGridItem';\nexport { SceneGridRow } from './components/layout/grid/SceneGridRow';\nexport { type SceneGridItemStateLike, type SceneGridItemLike } from './components/layout/grid/types';\nexport { SplitLayout } from './components/layout/split/SplitLayout';\nexport {\n type SceneAppPageLike,\n type SceneRouteMatch,\n type SceneAppPageState,\n type SceneAppDrilldownView,\n type SceneAppRoute,\n} from './components/SceneApp/types';\nexport { SceneApp, useSceneApp } from './components/SceneApp/SceneApp';\nexport { SceneAppPage } from './components/SceneApp/SceneAppPage';\nexport { SceneReactObject } from './components/SceneReactObject';\nexport { SceneObjectRef } from './core/SceneObjectRef';\nexport {\n PanelBuilders,\n PanelOptionsBuilders,\n FieldConfigBuilders,\n FieldConfigOverridesBuilder,\n} from './core/PanelBuilders';\nexport { FieldConfigBuilder } from './core/PanelBuilders/FieldConfigBuilder';\nexport { VizPanelBuilder } from './core/PanelBuilders/VizPanelBuilder';\nexport { SceneDebugger } from './components/SceneDebugger/SceneDebugger';\nexport { VariableValueSelectWrapper } from './variables/components/VariableValueSelectors';\nexport { renderSelectForVariable } from './variables/components/VariableValueSelect';\nexport { VizConfigBuilder } from './core/PanelBuilders/VizConfigBuilder';\nexport { VizConfigBuilders } from './core/PanelBuilders/VizConfigBuilders';\nexport { type VizConfig } from './core/PanelBuilders/types';\n\nexport const sceneUtils = {\n getUrlWithAppState,\n registerRuntimePanelPlugin,\n registerRuntimeDataSource,\n registerVariableMacro,\n cloneSceneObjectState,\n syncStateFromSearchParams,\n getUrlState,\n renderPrometheusLabelFilters,\n\n // Variable guards\n isAdHocVariable,\n isConstantVariable,\n isCustomVariable,\n isDataSourceVariable,\n isIntervalVariable,\n isQueryVariable,\n isTextBoxVariable,\n isGroupByVariable,\n};\n\nexport { SafeSerializableSceneObject } from './utils/SafeSerializableSceneObject';\n"],"names":["useLocation","locationSearchToObject","__spreadValues","locationService","urlUtil","locationUtil","React","__spreadProps","getPluginImportUtils","__objRest","_a","useState","useEffect","BusEventWithPayload","__privateAdd","__privateSet","__privateGet","Subscription","uuidv4","EventBusSrv","DataSourceApi","PluginType","of","LoadingState","getDefaultTimeRange","toUtc","dateMath","getTimeZone","RefreshEvent","setWeekStart","rangeUtil","config","property","Registry","VariableFormatID","map","escapeRegex","isArray","textUtil","replace","dateTime","dateTimeFormat","getFieldDisplayName","formatLabels","formattedValueToString","FieldType","getDisplayProcessor","getFieldDisplayValuesProxy","getFrameDisplayName","DataLinkBuiltInVars","getDataSourceSrv","mergeMap","forkJoin","getTemplateSrv","Observable","isEqual","uFuzzy","filterNoOp","toSelectableValue","useMemo","value","Select","inputValue","selectors","MultiSelect","useTheme2","getSelectStyles","useStyles2","cx","Checkbox","css","values","from","tap","take","lastValueFrom","Tooltip","Icon","getStyles","IconButton","_b","keys","Field","Button","key","merge","mergeAll","filter","finalize","counter","getNextRequestId","ReplaySubject","data","preProcessPanelData","DataTopic","DataFrameView","getRunRequest","toDataQueryError","cloneDeep","isExpressionReference","VariableSupportType","stringToJsRegex","isNumber","uniqBy","VariableSort","options","sortBy","toLower","getProcessedDataFrames","isDataFrame","VariableRefresh","debounce","throwError","catchError","CoreApp","DashboardCursorSync","useMeasure","getAppEvents","useCallback","SetPanelAttentionEvent","PanelChrome","AlertState","ErrorBoundaryAlert","PluginContextProvider","PanelContextProvider","isSystemOverrideWithRef","SeriesVisibilityChangeMode","override","createOverride","ByNamesMatcherMode","FieldMatcherID","fieldMatchers","FieldColorModeId","mergeWith","getPanelOptionsWithDefaults","renderMarkdown","isEmpty","applyFieldOverrides","compareArrayValues","compareDataFrameStructures","PanelPlugin","isFetchError","containerStyle","InlineSwitch","isString","standardTransformers","AnnotationEventFieldSource","partition","groupBy","every","find","head","concat","arrayToDataFrame","transformDataFrame","VariableHide","Subject","AutoSizeInput","items","Menu","useRef","uniqueId","useImperativeHandle","useEffectOnce","width","height","ReactGridLayout","ToolbarButton","Input","TimeRangePicker","TimeRangeDirection","RefreshPicker","ButtonGroup","ButtonSelect","useLayoutStyle","clamp","throttle","useLayoutEffect","Switch","Route","isPlainObject","JSONFormatter","Drawer","CustomScrollbar","PluginPage","defaultBarChartOptions","defaultBarGaugeOptions","defaultDataGridOptions","defaultGaugeOptions","defaultGeomapOptions","defaultHeatmapOptions","defaultHistogramOptions","defaultNewsOptions","defaultPieChartOptions","defaultStatOptions","defaultStateTimelineOptions","defaultStatusHistoryOptions","defaultTableOptions","defaultTextOptions","defaultXYChartOptions","defaultBarChartFieldConfig","defaultHistogramFieldConfig","defaultStateTimelineFieldConfig","defaultStatusHistoryFieldConfig","defaultXYChartFieldConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,SAAS,iBAAiC,GAAA;AAC/C,EAAA,MAAM,WAAWA,0BAAY,EAAA,CAAA;AAC7B,EAAO,OAAAC,8BAAA,CAAuB,QAAS,CAAA,MAAA,IAAU,EAAE,CAAA,CAAA;AACrD,CAAA;AAQgB,SAAA,kBAAA,CAAmB,MAAc,cAAmC,EAAA;AAElF,EAAM,MAAA,UAAA,GAAaC,gBAAK,CAAA,EAAA,EAAAC,uBAAA,CAAgB,eAAgB,EAAA,CAAA,CAAA;AAExD,EAAA,IAAI,cAAgB,EAAA;AAClB,IAAA,KAAA,MAAW,GAAO,IAAA,MAAA,CAAO,IAAK,CAAA,UAAU,CAAG,EAAA;AAEzC,MAAA,IAAI,CAAC,cAAA,CAAe,QAAS,CAAA,GAAG,CAAG,EAAA;AACjC,QAAA,OAAO,UAAW,CAAA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