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EAAA,EAAe,CAACC,cAAc,OAAOC,kBAAmB9M,KAAK+M,aAAa,UACzE,iBAAKxN,UAAW4D,EAAO6J,aAAa,UACjChN,KAAK0K,iBAAiBvH,GACtBoD,IACC,iCACE,gBAAKhH,UAAW4D,EAAO8J,eAAe,SAAEjN,KAAK0L,cAAcnF,KAC1DvG,KAAKsM,kBAAkB/F,EAAYpD,GACnC+C,IACC,SAACgH,EAAA,EAAK,CAACnJ,MAAM,mBAAmBvC,QAAQ,EAAM2L,UAAWnN,KAAKoN,YAAY,UACxE,SAAC1O,EAAU,CAACC,SAAU4H,EAAW5E,KAAKkC,cAQtD,EAGF,MAAMF,IAAYqB,EAAAA,EAAAA,IAAc,KAC9B,MAAM,MAAEC,GAAUC,EAAAA,GAElB,MAAO,CACL8H,aAAc7H,EAAAA,GAAI;;;iBAGLF,EAAMG,QAAQC;MAE3BuF,cAAezF,EAAAA,GAAI;;uBAEAF,EAAMG,QAAQC;MAEjCyF,kBAAmB3F,EAAAA,GAAI;sBACLF,EAAMG,QAAQiI;MAEhC9B,yBAA0BpG,EAAAA,GAAI;;sBAEZF,EAAMG,QAAQiI;MAEhCJ,eAAgB9H,EAAAA,GAAI;;MAGpBmI,kBAAmBnI,EAAAA,GAAI,GACvBwH,iBAAkBxH,EAAAA,GAAI;sBACJF,EAAMG,QAAQI;MAEjC,G","sources":["webpack://grafana/./public/app/core/components/PluginHelp/PluginHelp.tsx","webpack://grafana/./public/app/features/query/components/QueryGroupOptions.tsx","webpack://grafana/./public/app/features/query/components/QueryGroup.tsx","webpack://grafana/./public/app/features/query/state/updateQueries.ts"],"sourcesContent":["import React from 'react';\nimport { useAsync } from 'react-use';\n\nimport { renderMarkdown } from '@grafana/data';\nimport { getBackendSrv } from '@grafana/runtime';\nimport { LoadingPlaceholder } from '@grafana/ui';\n\ninterface Props {\n pluginId: string;\n}\n\nexport function PluginHelp({ pluginId }: Props) {\n const { value, loading, error } = useAsync(async () => {\n return getBackendSrv().get(`/api/plugins/${pluginId}/markdown/query_help`);\n }, []);\n\n const renderedMarkdown = renderMarkdown(value);\n\n if (loading) {\n return <LoadingPlaceholder text=\"Loading help...\" />;\n }\n\n if (error) {\n return <h3>An error occurred when loading help.</h3>;\n }\n\n if (value === '') {\n return <h3>No query help could be found.</h3>;\n }\n\n return <div className=\"markdown-html\" dangerouslySetInnerHTML={{ __html: renderedMarkdown }} />;\n}\n","import { css } from '@emotion/css';\nimport React, { PureComponent, ChangeEvent, FocusEvent } from 'react';\n\nimport { rangeUtil, PanelData, DataSourceApi } from '@grafana/data';\nimport { Switch, Input, InlineField, InlineFormLabel, stylesFactory } from '@grafana/ui';\nimport { QueryOperationRow } from 'app/core/components/QueryOperationRow/QueryOperationRow';\nimport { config } from 'app/core/config';\nimport { QueryGroupOptions } from 'app/types';\n\ninterface Props {\n options: QueryGroupOptions;\n dataSource: DataSourceApi;\n data: PanelData;\n onChange: (options: QueryGroupOptions) => void;\n}\n\ninterface State {\n timeRangeFrom: string;\n timeRangeShift: string;\n timeRangeHide: boolean;\n isOpen: boolean;\n relativeTimeIsValid: boolean;\n timeShiftIsValid: boolean;\n}\n\nexport class QueryGroupOptionsEditor extends PureComponent<Props, State> {\n constructor(props: Props) {\n super(props);\n\n const { options } = props;\n\n this.state = {\n timeRangeFrom: options.timeRange?.from || '',\n timeRangeShift: options.timeRange?.shift || '',\n timeRangeHide: options.timeRange?.hide ?? false,\n isOpen: false,\n relativeTimeIsValid: true,\n timeShiftIsValid: true,\n };\n }\n\n onRelativeTimeChange = (event: ChangeEvent<HTMLInputElement>) => {\n this.setState({\n timeRangeFrom: event.target.value,\n });\n };\n\n onTimeShiftChange = (event: ChangeEvent<HTMLInputElement>) => {\n this.setState({\n timeRangeShift: event.target.value,\n });\n };\n\n onOverrideTime = (event: FocusEvent<HTMLInputElement>) => {\n const { options, onChange } = this.props;\n\n const newValue = emptyToNull(event.target.value);\n const isValid = timeRangeValidation(newValue);\n\n if (isValid && options.timeRange?.from !== newValue) {\n onChange({\n ...options,\n timeRange: {\n ...(options.timeRange ?? {}),\n from: newValue,\n },\n });\n }\n\n this.setState({ relativeTimeIsValid: isValid });\n };\n\n onTimeShift = (event: FocusEvent<HTMLInputElement>) => {\n const { options, onChange } = this.props;\n\n const newValue = emptyToNull(event.target.value);\n const isValid = timeRangeValidation(newValue);\n\n if (isValid && options.timeRange?.shift !== newValue) {\n onChange({\n ...options,\n timeRange: {\n ...(options.timeRange ?? {}),\n shift: newValue,\n },\n });\n }\n\n this.setState({ timeShiftIsValid: isValid });\n };\n\n onToggleTimeOverride = () => {\n const { onChange, options } = this.props;\n\n this.setState({ timeRangeHide: !this.state.timeRangeHide }, () => {\n onChange({\n ...options,\n timeRange: {\n ...(options.timeRange ?? {}),\n hide: this.state.timeRangeHide,\n },\n });\n });\n };\n\n onCacheTimeoutBlur = (event: ChangeEvent<HTMLInputElement>) => {\n const { options, onChange } = this.props;\n onChange({\n ...options,\n cacheTimeout: emptyToNull(event.target.value),\n });\n };\n\n onMaxDataPointsBlur = (event: ChangeEvent<HTMLInputElement>) => {\n const { options, onChange } = this.props;\n\n let maxDataPoints: number | null = parseInt(event.target.value as string, 10);\n\n if (isNaN(maxDataPoints) || maxDataPoints === 0) {\n maxDataPoints = null;\n }\n\n if (maxDataPoints !== options.maxDataPoints) {\n onChange({\n ...options,\n maxDataPoints,\n });\n }\n };\n\n onMinIntervalBlur = (event: ChangeEvent<HTMLInputElement>) => {\n const { options, onChange } = this.props;\n const minInterval = emptyToNull(event.target.value);\n if (minInterval !== options.minInterval) {\n onChange({\n ...options,\n minInterval,\n });\n }\n };\n\n renderCacheTimeoutOption() {\n const { dataSource, options } = this.props;\n\n const tooltip = `If your time series store has a query cache this option can override the default cache timeout. Specify a\n numeric value in seconds.`;\n\n if (!dataSource.meta.queryOptions?.cacheTimeout) {\n return null;\n }\n\n return (\n <div className=\"gf-form-inline\">\n <div className=\"gf-form\">\n <InlineFormLabel width={9} tooltip={tooltip}>\n Cache timeout\n </InlineFormLabel>\n <Input\n type=\"text\"\n className=\"width-6\"\n placeholder=\"60\"\n spellCheck={false}\n onBlur={this.onCacheTimeoutBlur}\n defaultValue={options.cacheTimeout ?? ''}\n />\n </div>\n </div>\n );\n }\n\n renderMaxDataPointsOption() {\n const { data, options } = this.props;\n const realMd = data.request?.maxDataPoints;\n const value = options.maxDataPoints ?? '';\n const isAuto = value === '';\n\n return (\n <div className=\"gf-form-inline\">\n <div className=\"gf-form\">\n <InlineFormLabel\n width={9}\n tooltip={\n <>\n The maximum data points per series. Used directly by some data sources and used in calculation of auto\n interval. With streaming data this value is used for the rolling buffer.\n </>\n }\n >\n Max data points\n </InlineFormLabel>\n <Input\n type=\"number\"\n className=\"width-6\"\n placeholder={`${realMd}`}\n spellCheck={false}\n onBlur={this.onMaxDataPointsBlur}\n defaultValue={value}\n />\n {isAuto && (\n <>\n <div className=\"gf-form-label query-segment-operator\">=</div>\n <div className=\"gf-form-label\">Width of panel</div>\n </>\n )}\n </div>\n </div>\n );\n }\n\n renderIntervalOption() {\n const { data, dataSource, options } = this.props;\n const realInterval = data.request?.interval;\n const minIntervalOnDs = dataSource.interval ?? 'No limit';\n\n return (\n <>\n <div className=\"gf-form-inline\">\n <div className=\"gf-form\">\n <InlineFormLabel\n width={9}\n tooltip={\n <>\n A lower limit for the interval. Recommended to be set to write frequency, for example <code>1m</code>{' '}\n if your data is written every minute. Default value can be set in data source settings for most data\n sources.\n </>\n }\n >\n Min interval\n </InlineFormLabel>\n <Input\n type=\"text\"\n className=\"width-6\"\n placeholder={`${minIntervalOnDs}`}\n spellCheck={false}\n onBlur={this.onMinIntervalBlur}\n defaultValue={options.minInterval ?? ''}\n />\n </div>\n </div>\n <div className=\"gf-form-inline\">\n <div className=\"gf-form\">\n <InlineFormLabel\n width={9}\n tooltip={\n <>\n The evaluated interval that is sent to data source and is used in <code>$__interval</code> and{' '}\n <code>$__interval_ms</code>\n </>\n }\n >\n Interval\n </InlineFormLabel>\n <InlineFormLabel width={6}>{realInterval}</InlineFormLabel>\n <div className=\"gf-form-label query-segment-operator\">=</div>\n <div className=\"gf-form-label\">Time range / max data points</div>\n </div>\n </div>\n </>\n );\n }\n\n onOpenOptions = () => {\n this.setState({ isOpen: true });\n };\n\n onCloseOptions = () => {\n this.setState({ isOpen: false });\n };\n\n renderCollapsedText(styles: StylesType): React.ReactNode | undefined {\n const { data, options } = this.props;\n const { isOpen } = this.state;\n\n if (isOpen) {\n return undefined;\n }\n\n let mdDesc = options.maxDataPoints ?? '';\n if (mdDesc === '' && data.request) {\n mdDesc = `auto = ${data.request.maxDataPoints}`;\n }\n\n let intervalDesc = options.minInterval;\n if (data.request) {\n intervalDesc = `${data.request.interval}`;\n }\n\n return (\n <>\n {<div className={styles.collapsedText}>MD = {mdDesc}</div>}\n {<div className={styles.collapsedText}>Interval = {intervalDesc}</div>}\n </>\n );\n }\n\n render() {\n const { timeRangeHide: hideTimeOverride, relativeTimeIsValid, timeShiftIsValid } = this.state;\n const { timeRangeFrom: relativeTime, timeRangeShift: timeShift, isOpen } = this.state;\n const styles = getStyles();\n\n return (\n <QueryOperationRow\n id=\"Query options\"\n index={0}\n title=\"Query options\"\n headerElement={this.renderCollapsedText(styles)}\n isOpen={isOpen}\n onOpen={this.onOpenOptions}\n onClose={this.onCloseOptions}\n >\n {this.renderMaxDataPointsOption()}\n {this.renderIntervalOption()}\n {this.renderCacheTimeoutOption()}\n\n <div className=\"gf-form\">\n <InlineFormLabel width={9}>Relative time</InlineFormLabel>\n <Input\n type=\"text\"\n className=\"width-6\"\n placeholder=\"1h\"\n onChange={this.onRelativeTimeChange}\n onBlur={this.onOverrideTime}\n invalid={!relativeTimeIsValid}\n value={relativeTime}\n />\n </div>\n\n <div className=\"gf-form\">\n <span className=\"gf-form-label width-9\">Time shift</span>\n <Input\n type=\"text\"\n className=\"width-6\"\n placeholder=\"1h\"\n onChange={this.onTimeShiftChange}\n onBlur={this.onTimeShift}\n invalid={!timeShiftIsValid}\n value={timeShift}\n />\n </div>\n {(timeShift || relativeTime) && (\n <div className=\"gf-form-inline\">\n <InlineField label=\"Hide time info\" labelWidth={18}>\n <Switch value={hideTimeOverride} onChange={this.onToggleTimeOverride} />\n </InlineField>\n </div>\n )}\n </QueryOperationRow>\n );\n }\n}\n\nconst timeRangeValidation = (value: string | null) => {\n if (!value) {\n return true;\n }\n\n return rangeUtil.isValidTimeSpan(value);\n};\n\nconst emptyToNull = (value: string) => {\n return value === '' ? null : value;\n};\n\nconst getStyles = stylesFactory(() => {\n const { theme } = config;\n\n return {\n collapsedText: css`\n margin-left: ${theme.spacing.md};\n font-size: ${theme.typography.size.sm};\n color: ${theme.colors.textWeak};\n `,\n };\n});\n\ntype StylesType = ReturnType<typeof getStyles>;\n","import { css } from '@emotion/css';\nimport React, { PureComponent } from 'react';\nimport { Unsubscribable } from 'rxjs';\n\nimport {\n CoreApp,\n DataQuery,\n DataSourceApi,\n DataSourceInstanceSettings,\n getDefaultTimeRange,\n LoadingState,\n PanelData,\n} from '@grafana/data';\nimport { selectors } from '@grafana/e2e-selectors';\nimport { DataSourcePicker, getDataSourceSrv } from '@grafana/runtime';\nimport { Button, CustomScrollbar, HorizontalGroup, InlineFormLabel, Modal, stylesFactory } from '@grafana/ui';\nimport { PluginHelp } from 'app/core/components/PluginHelp/PluginHelp';\nimport config from 'app/core/config';\nimport { backendSrv } from 'app/core/services/backend_srv';\nimport { addQuery, queryIsEmpty } from 'app/core/utils/query';\nimport { dataSource as expressionDatasource } from 'app/features/expressions/ExpressionDatasource';\nimport { DashboardQueryEditor, isSharedDashboardQuery } from 'app/plugins/datasource/dashboard';\nimport { QueryGroupOptions } from 'app/types';\n\nimport { PanelQueryRunner } from '../state/PanelQueryRunner';\nimport { updateQueries } from '../state/updateQueries';\n\nimport { GroupActionComponents } from './QueryActionComponent';\nimport { QueryEditorRows } from './QueryEditorRows';\nimport { QueryGroupOptionsEditor } from './QueryGroupOptions';\n\ninterface Props {\n queryRunner: PanelQueryRunner;\n options: QueryGroupOptions;\n onOpenQueryInspector?: () => void;\n onRunQueries: () => void;\n onOptionsChange: (options: QueryGroupOptions) => void;\n}\n\ninterface State {\n dataSource?: DataSourceApi;\n dsSettings?: DataSourceInstanceSettings;\n queries: DataQuery[];\n helpContent: React.ReactNode;\n isLoadingHelp: boolean;\n isPickerOpen: boolean;\n isAddingMixed: boolean;\n data: PanelData;\n isHelpOpen: boolean;\n defaultDataSource?: DataSourceApi;\n scrollElement?: HTMLDivElement;\n}\n\nexport class QueryGroup extends PureComponent<Props, State> {\n backendSrv = backendSrv;\n dataSourceSrv = getDataSourceSrv();\n querySubscription: Unsubscribable | null = null;\n\n state: State = {\n isLoadingHelp: false,\n helpContent: null,\n isPickerOpen: false,\n isAddingMixed: false,\n isHelpOpen: false,\n queries: [],\n data: {\n state: LoadingState.NotStarted,\n series: [],\n timeRange: getDefaultTimeRange(),\n },\n };\n\n async componentDidMount() {\n const { queryRunner, options } = this.props;\n\n this.querySubscription = queryRunner.getData({ withTransforms: false, withFieldConfig: false }).subscribe({\n next: (data: PanelData) => this.onPanelDataUpdate(data),\n });\n\n try {\n const ds = await this.dataSourceSrv.get(options.dataSource);\n const dsSettings = this.dataSourceSrv.getInstanceSettings(options.dataSource);\n const defaultDataSource = await this.dataSourceSrv.get();\n const datasource = ds.getRef();\n const queries = options.queries.map((q) => ({\n ...(queryIsEmpty(q) && ds?.getDefaultQuery?.(CoreApp.PanelEditor)),\n datasource,\n ...q,\n }));\n this.setState({ queries, dataSource: ds, dsSettings, defaultDataSource });\n } catch (error) {\n console.log('failed to load data source', error);\n }\n }\n\n componentWillUnmount() {\n if (this.querySubscription) {\n this.querySubscription.unsubscribe();\n this.querySubscription = null;\n }\n }\n\n onPanelDataUpdate(data: PanelData) {\n this.setState({ data });\n }\n\n onChangeDataSource = async (newSettings: DataSourceInstanceSettings) => {\n const { dsSettings } = this.state;\n const currentDS = dsSettings ? await getDataSourceSrv().get(dsSettings.uid) : undefined;\n const nextDS = await getDataSourceSrv().get(newSettings.uid);\n\n // We need to pass in newSettings.uid as well here as that can be a variable expression and we want to store that in the query model not the current ds variable value\n const queries = await updateQueries(nextDS, newSettings.uid, this.state.queries, currentDS);\n\n const dataSource = await this.dataSourceSrv.get(newSettings.name);\n this.onChange({\n queries,\n dataSource: {\n name: newSettings.name,\n uid: newSettings.uid,\n type: newSettings.meta.id,\n default: newSettings.isDefault,\n },\n });\n\n this.setState({\n queries,\n dataSource: dataSource,\n dsSettings: newSettings,\n });\n };\n\n onAddQueryClick = () => {\n const { queries } = this.state;\n this.onQueriesChange(addQuery(queries, this.newQuery()));\n this.onScrollBottom();\n };\n\n newQuery(): Partial<DataQuery> {\n const { dsSettings, defaultDataSource } = this.state;\n\n const ds = !dsSettings?.meta.mixed ? dsSettings : defaultDataSource;\n\n return {\n ...this.state.dataSource?.getDefaultQuery?.(CoreApp.PanelEditor),\n datasource: { uid: ds?.uid, type: ds?.type },\n };\n }\n\n onChange(changedProps: Partial<QueryGroupOptions>) {\n this.props.onOptionsChange({\n ...this.props.options,\n ...changedProps,\n });\n }\n\n onAddExpressionClick = () => {\n this.onQueriesChange(addQuery(this.state.queries, expressionDatasource.newQuery()));\n this.onScrollBottom();\n };\n\n onScrollBottom = () => {\n setTimeout(() => {\n if (this.state.scrollElement) {\n this.state.scrollElement.scrollTo({ top: 10000 });\n }\n }, 20);\n };\n\n onUpdateAndRun = (options: QueryGroupOptions) => {\n this.props.onOptionsChange(options);\n this.props.onRunQueries();\n };\n\n renderTopSection(styles: QueriesTabStyles) {\n const { onOpenQueryInspector, options } = this.props;\n const { dataSource, data } = this.state;\n\n return (\n <div>\n <div className={styles.dataSourceRow}>\n <InlineFormLabel htmlFor=\"data-source-picker\" width={'auto'}>\n Data source\n </InlineFormLabel>\n <div className={styles.dataSourceRowItem}>\n <DataSourcePicker\n onChange={this.onChangeDataSource}\n current={options.dataSource}\n metrics={true}\n mixed={true}\n dashboard={true}\n variables={true}\n />\n </div>\n {dataSource && (\n <>\n <div className={styles.dataSourceRowItem}>\n <Button\n variant=\"secondary\"\n icon=\"question-circle\"\n title=\"Open data source help\"\n onClick={this.onOpenHelp}\n />\n </div>\n <div className={styles.dataSourceRowItemOptions}>\n <QueryGroupOptionsEditor\n options={options}\n dataSource={dataSource}\n data={data}\n onChange={this.onUpdateAndRun}\n />\n </div>\n {onOpenQueryInspector && (\n <div className={styles.dataSourceRowItem}>\n <Button\n variant=\"secondary\"\n onClick={onOpenQueryInspector}\n aria-label={selectors.components.QueryTab.queryInspectorButton}\n >\n Query inspector\n </Button>\n </div>\n )}\n </>\n )}\n </div>\n </div>\n );\n }\n\n onOpenHelp = () => {\n this.setState({ isHelpOpen: true });\n };\n\n onCloseHelp = () => {\n this.setState({ isHelpOpen: false });\n };\n\n renderMixedPicker = () => {\n return (\n <DataSourcePicker\n mixed={false}\n onChange={this.onAddMixedQuery}\n current={null}\n autoFocus={true}\n variables={true}\n onBlur={this.onMixedPickerBlur}\n openMenuOnFocus={true}\n />\n );\n };\n\n onAddMixedQuery = (datasource: any) => {\n this.onAddQuery({ datasource: datasource.name });\n this.setState({ isAddingMixed: false });\n };\n\n onMixedPickerBlur = () => {\n this.setState({ isAddingMixed: false });\n };\n\n onAddQuery = (query: Partial<DataQuery>) => {\n const { dsSettings, queries } = this.state;\n this.onQueriesChange(addQuery(queries, query, { type: dsSettings?.type, uid: dsSettings?.uid }));\n this.onScrollBottom();\n };\n\n onQueriesChange = (queries: DataQuery[]) => {\n this.onChange({ queries });\n this.setState({ queries });\n };\n\n renderQueries(dsSettings: DataSourceInstanceSettings) {\n const { onRunQueries } = this.props;\n const { data, queries } = this.state;\n\n if (isSharedDashboardQuery(dsSettings.name)) {\n return (\n <DashboardQueryEditor\n queries={queries}\n panelData={data}\n onChange={this.onQueriesChange}\n onRunQueries={onRunQueries}\n />\n );\n }\n\n return (\n <div aria-label={selectors.components.QueryTab.content}>\n <QueryEditorRows\n queries={queries}\n dsSettings={dsSettings}\n onQueriesChange={this.onQueriesChange}\n onAddQuery={this.onAddQuery}\n onRunQueries={onRunQueries}\n data={data}\n />\n </div>\n );\n }\n\n isExpressionsSupported(dsSettings: DataSourceInstanceSettings): boolean {\n return (dsSettings.meta.alerting || dsSettings.meta.mixed) === true;\n }\n\n renderExtraActions() {\n return GroupActionComponents.getAllExtraRenderAction()\n .map((action, index) =>\n action({\n onAddQuery: this.onAddQuery,\n onChangeDataSource: this.onChangeDataSource,\n key: index,\n })\n )\n .filter(Boolean);\n }\n\n renderAddQueryRow(dsSettings: DataSourceInstanceSettings, styles: QueriesTabStyles) {\n const { isAddingMixed } = this.state;\n const showAddButton = !(isAddingMixed || isSharedDashboardQuery(dsSettings.name));\n\n return (\n <HorizontalGroup spacing=\"md\" align=\"flex-start\">\n {showAddButton && (\n <Button\n icon=\"plus\"\n onClick={this.onAddQueryClick}\n variant=\"secondary\"\n aria-label={selectors.components.QueryTab.addQuery}\n >\n Query\n </Button>\n )}\n {config.expressionsEnabled && this.isExpressionsSupported(dsSettings) && (\n <Button\n icon=\"plus\"\n onClick={this.onAddExpressionClick}\n variant=\"secondary\"\n className={styles.expressionButton}\n >\n <span>Expression </span>\n </Button>\n )}\n {this.renderExtraActions()}\n </HorizontalGroup>\n );\n }\n\n setScrollRef = (scrollElement: HTMLDivElement): void => {\n this.setState({ scrollElement });\n };\n\n render() {\n const { isHelpOpen, dsSettings } = this.state;\n const styles = getStyles();\n\n return (\n <CustomScrollbar autoHeightMin=\"100%\" scrollRefCallback={this.setScrollRef}>\n <div className={styles.innerWrapper}>\n {this.renderTopSection(styles)}\n {dsSettings && (\n <>\n <div className={styles.queriesWrapper}>{this.renderQueries(dsSettings)}</div>\n {this.renderAddQueryRow(dsSettings, styles)}\n {isHelpOpen && (\n <Modal title=\"Data source help\" isOpen={true} onDismiss={this.onCloseHelp}>\n <PluginHelp pluginId={dsSettings.meta.id} />\n </Modal>\n )}\n </>\n )}\n </div>\n </CustomScrollbar>\n );\n }\n}\n\nconst getStyles = stylesFactory(() => {\n const { theme } = config;\n\n return {\n innerWrapper: css`\n display: flex;\n flex-direction: column;\n padding: ${theme.spacing.md};\n `,\n dataSourceRow: css`\n display: flex;\n margin-bottom: ${theme.spacing.md};\n `,\n dataSourceRowItem: css`\n margin-right: ${theme.spacing.inlineFormMargin};\n `,\n dataSourceRowItemOptions: css`\n flex-grow: 1;\n margin-right: ${theme.spacing.inlineFormMargin};\n `,\n queriesWrapper: css`\n padding-bottom: 16px;\n `,\n expressionWrapper: css``,\n expressionButton: css`\n margin-right: ${theme.spacing.sm};\n `,\n };\n});\n\ntype QueriesTabStyles = ReturnType<typeof getStyles>;\n","import { CoreApp, DataQuery, DataSourceApi, hasQueryExportSupport, hasQueryImportSupport } from '@grafana/data';\nimport { isExpressionReference } from '@grafana/runtime/src/utils/DataSourceWithBackend';\n\nexport async function updateQueries(\n nextDS: DataSourceApi,\n nextDSUidOrVariableExpression: string,\n queries: DataQuery[],\n currentDS?: DataSourceApi\n): Promise<DataQuery[]> {\n let nextQueries = queries;\n const datasource = { type: nextDS.type, uid: nextDSUidOrVariableExpression };\n const DEFAULT_QUERY = { ...nextDS?.getDefaultQuery?.(CoreApp.PanelEditor), datasource, refId: 'A' };\n\n // we are changing data source type\n if (currentDS?.meta.id !== nextDS.meta.id) {\n // If changing to mixed do nothing\n if (nextDS.meta.mixed) {\n return queries;\n }\n // when both data sources support abstract queries\n else if (hasQueryExportSupport(currentDS) && hasQueryImportSupport(nextDS)) {\n const abstractQueries = await currentDS.exportToAbstractQueries(queries);\n nextQueries = await nextDS.importFromAbstractQueries(abstractQueries);\n }\n // when datasource supports query import\n else if (currentDS && nextDS.importQueries) {\n nextQueries = await nextDS.importQueries(queries, currentDS);\n }\n // Otherwise clear queries\n else {\n return [DEFAULT_QUERY];\n }\n }\n\n if (nextQueries.length === 0) {\n return [DEFAULT_QUERY];\n }\n\n // Set data source on all queries except expression queries\n return nextQueries.map((query) => {\n if (!isExpressionReference(query.datasource) && !nextDS.meta.mixed) {\n query.datasource = datasource;\n }\n return query;\n });\n}\n"],"names":["PluginHelp","pluginId","value","loading","error","useAsync","async","getBackendSrv","get","renderedMarkdown","renderMarkdown","LoadingPlaceholder","text","className","dangerouslySetInnerHTML","__html","QueryGroupOptionsEditor","PureComponent","constructor","props","super","event","this","setState","timeRangeFrom","target","timeRangeShift","options","onChange","newValue","emptyToNull","isValid","timeRangeValidation","timeRange","from","relativeTimeIsValid","shift","timeShiftIsValid","timeRangeHide","state","hide","cacheTimeout","maxDataPoints","parseInt","isNaN","minInterval","isOpen","renderCacheTimeoutOption","dataSource","meta","queryOptions","width","tooltip","Input","I","type","placeholder","spellCheck","onBlur","onCacheTimeoutBlur","defaultValue","renderMaxDataPointsOption","data","realMd","request","isAuto","onMaxDataPointsBlur","renderIntervalOption","realInterval","interval","minIntervalOnDs","onMinIntervalBlur","renderCollapsedText","styles","mdDesc","intervalDesc","collapsedText","render","hideTimeOverride","relativeTime","timeShift","getStyles","QueryOperationRow","id","index","title","headerElement","onOpen","onOpenOptions","onClose","onCloseOptions","onRelativeTimeChange","onOverrideTime","invalid","onTimeShiftChange","onTimeShift","InlineField","label","labelWidth","Switch","onToggleTimeOverride","rangeUtil","stylesFactory","theme","config","css","spacing","md","typography","size","sm","colors","textWeak","QueryGroup","backendSrv","getDataSourceSrv","isLoadingHelp","helpContent","isPickerOpen","isAddingMixed","isHelpOpen","queries","LoadingState","series","getDefaultTimeRange","dsSettings","currentDS","uid","undefined","nextDS","newSettings","nextDSUidOrVariableExpression","nextQueries","datasource","DEFAULT_QUERY","getDefaultQuery","CoreApp","refId","mixed","hasQueryExportSupport","hasQueryImportSupport","abstractQueries","exportToAbstractQueries","importFromAbstractQueries","importQueries","length","map","query","isExpressionReference","updateQueries","dataSourceSrv","name","default","isDefault","onQueriesChange","addQuery","newQuery","onScrollBottom","expressionDatasource","setTimeout","scrollElement","scrollTo","top","onOptionsChange","onRunQueries","DataSourcePicker","onAddMixedQuery","current","autoFocus","variables","onMixedPickerBlur","openMenuOnFocus","onAddQuery","queryRunner","querySubscription","getData","withTransforms","withFieldConfig","subscribe","next","onPanelDataUpdate","ds","getInstanceSettings","defaultDataSource","getRef","q","queryIsEmpty","console","log","componentWillUnmount","unsubscribe","changedProps","renderTopSection","onOpenQueryInspector","dataSourceRow","htmlFor","dataSourceRowItem","onChangeDataSource","metrics","dashboard","Button","variant","icon","onClick","onOpenHelp","dataSourceRowItemOptions","onUpdateAndRun","selectors","renderQueries","isSharedDashboardQuery","panelData","QueryEditorRows","isExpressionsSupported","alerting","renderExtraActions","GroupActionComponents","action","key","filter","Boolean","renderAddQueryRow","showAddButton","align","onAddQueryClick","onAddExpressionClick","expressionButton","CustomScrollbar","autoHeightMin","scrollRefCallback","setScrollRef","innerWrapper","queriesWrapper","Modal","onDismiss","onCloseHelp","inlineFormMargin","expressionWrapper"],"sourceRoot":""}