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AAC,CACpE,CACF,CCzBO,MAAM,GAAS,IAAI,KAAiEN,EAAe,EACvG,gBAAgBxG,CAAY,EAC5B,eAAeuF,EAAW,C,kDCRzBlC,EAAY,SAAUR,EAAO,CAC7B,IAAIkE,KAAM,UAAOlE,CAAK,EACtB,OAAAkE,EAAI,QAAUlE,EACPkE,CACX,EACA,QAAe1D,C,iDCLX0C,EAAW,SAAUiB,EAAI,IACzB,KAAc,UAAY,CACtBA,EAAG,CACP,CAAC,CACL,EACA,QAAejB,C","sources":["webpack://grafana/./public/app/plugins/datasource/parca/QueryEditor/Stack.tsx","webpack://grafana/./public/app/plugins/datasource/parca/ConfigEditor.tsx","webpack://grafana/./public/app/plugins/datasource/parca/dataquery.gen.ts","webpack://grafana/./public/app/plugins/datasource/parca/QueryEditor/EditorRow.tsx","webpack://grafana/./public/app/plugins/datasource/parca/QueryEditor/EditorRows.tsx","webpack://grafana/./public/app/plugins/datasource/parca/lang/index.ts","webpack://grafana/./public/app/plugins/datasource/parca/lang/lang.ts","webpack://grafana/./public/app/plugins/datasource/parca/QueryEditor/autocomplete.ts","webpack://grafana/./public/app/plugins/datasource/parca/QueryEditor/LabelsEditor.tsx","webpack://grafana/./public/app/plugins/datasource/parca/QueryEditor/QueryOptions.tsx","webpack://grafana/./public/app/plugins/datasource/parca/QueryEditor/QueryEditor.tsx","webpack://grafana/./public/app/plugins/datasource/parca/datasource.ts","webpack://grafana/./public/app/plugins/datasource/parca/module.ts","webpack://grafana/./node_modules/react-use/esm/useLatest.js","webpack://grafana/./node_modules/react-use/esm/useMount.js"],"sourcesContent":["import { css } from '@emotion/css';\nimport React, { CSSProperties } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\n\ninterface StackProps {\n direction?: CSSProperties['flexDirection'];\n alignItems?: CSSProperties['alignItems'];\n wrap?: boolean;\n gap?: number;\n flexGrow?: CSSProperties['flexGrow'];\n children: React.ReactNode;\n}\n\nexport function Stack(props: StackProps) {\n const styles = useStyles2(getStyles, props);\n return
{props.children}
;\n}\n\nconst getStyles = (theme: GrafanaTheme2, props: StackProps) => ({\n root: css({\n display: 'flex',\n flexDirection: props.direction ?? 'row',\n flexWrap: props.wrap ?? true ? 'wrap' : undefined,\n alignItems: props.alignItems,\n gap: theme.spacing(props.gap ?? 2),\n flexGrow: props.flexGrow,\n }),\n});\n","import React from 'react';\n\nimport { DataSourcePluginOptionsEditorProps } from '@grafana/data';\nimport { config } from '@grafana/runtime';\nimport { DataSourceHttpSettings } from '@grafana/ui';\n\nimport { ParcaDataSourceOptions } from './types';\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\nexport const ConfigEditor = (props: Props) => {\n const { options, onOptionsChange } = props;\n\n return (\n <>\n \n \n );\n};\n","// Code generated - EDITING IS FUTILE. DO NOT EDIT.\n//\n// Generated by:\n// public/app/plugins/gen.go\n// Using jennies:\n// TSTypesJenny\n// PluginTSTypesJenny\n//\n// Run 'make gen-cue' from repository root to regenerate.\n\nimport * as common from '@grafana/schema';\n\nexport type ParcaQueryType = ('metrics' | 'profile' | 'both');\n\nexport const defaultParcaQueryType: ParcaQueryType = 'both';\n\nexport interface Parca extends common.DataQuery {\n /**\n * Specifies the query label selectors.\n */\n labelSelector: string;\n /**\n * Specifies the type of profile to query.\n */\n profileTypeId: string;\n}\n\nexport const defaultParca: Partial = {\n labelSelector: '{}',\n};\n","import { css } from '@emotion/css';\nimport React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\n\nimport { Stack } from './Stack';\n\ninterface EditorRowProps {\n children: React.ReactNode;\n stackProps?: Partial>;\n}\n\nexport const EditorRow = ({ children, stackProps }: EditorRowProps) => {\n const styles = useStyles2(getStyles);\n\n return (\n
\n \n {children}\n \n
\n );\n};\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n root: css({\n padding: theme.spacing(1),\n backgroundColor: theme.colors.background.secondary,\n borderRadius: theme.shape.radius.default,\n }),\n };\n};\n","import React from 'react';\n\nimport { Stack } from './Stack';\n\ninterface EditorRowsProps {\n children: React.ReactNode;\n}\n\nexport const EditorRows = ({ children }: EditorRowsProps) => {\n return (\n \n {children}\n \n );\n};\n","import { language, languageConfiguration } from './lang';\n\nexport const languageDefinition = {\n id: 'parca',\n extensions: ['.parca'],\n aliases: ['parca'],\n mimetypes: [],\n def: {\n language,\n languageConfiguration,\n },\n};\n","import type { languages } from 'monaco-editor';\n\nexport const languageConfiguration: languages.LanguageConfiguration = {\n // the default separators except `@$`\n wordPattern: /(-?\\d*\\.\\d\\w*)|([^`~!#%^&*()\\-=+\\[{\\]}\\\\|;:'\",.<>\\/?\\s]+)/g,\n brackets: [['{', '}']],\n autoClosingPairs: [\n { open: '{', close: '}' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n ],\n surroundingPairs: [\n { open: '{', close: '}' },\n { open: '\"', close: '\"' },\n { open: \"'\", close: \"'\" },\n ],\n folding: {},\n};\n\nexport const language: languages.IMonarchLanguage = {\n ignoreCase: false,\n defaultToken: '',\n tokenPostfix: '.fireql',\n\n keywords: [],\n operators: [],\n\n // we include these common regular expressions\n symbols: /[=>](?!@symbols)/, '@brackets'],\n [\n /@symbols/,\n {\n cases: {\n '@operators': 'delimiter',\n '@default': '',\n },\n },\n ],\n\n // numbers\n [/\\d+/, 'number'],\n [/\\d*\\d+[eE]([\\-+]?\\d+)?(@floatsuffix)/, 'number.float'],\n [/\\d*\\.\\d+([eE][\\-+]?\\d+)?(@floatsuffix)/, 'number.float'],\n [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, 'number.hex'],\n [/0[0-7']*[0-7](@integersuffix)/, 'number.octal'],\n [/0[bB][0-1']*[0-1](@integersuffix)/, 'number.binary'],\n [/\\d[\\d']*\\d(@integersuffix)/, 'number'],\n [/\\d(@integersuffix)/, 'number'],\n ],\n\n string_double: [\n [/[^\\\\\"]+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/\"/, 'string', '@pop'],\n ],\n\n string_single: [\n [/[^\\\\']+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/'/, 'string', '@pop'],\n ],\n\n clauses: [\n [/[^(,)]/, 'tag'],\n [/\\)/, 'identifier', '@pop'],\n ],\n\n whitespace: [[/[ \\t\\r\\n]+/, 'white']],\n },\n};\n","import { monacoTypes, Monaco } from '@grafana/ui';\n\n/**\n * Class that implements CompletionItemProvider interface and allows us to provide suggestion for the Monaco\n * autocomplete system.\n *\n * At this moment we just pass it all the labels/values we get from Fire backend later on we may do something a bit\n * smarter if there will be lots of labels.\n */\nexport class CompletionProvider implements monacoTypes.languages.CompletionItemProvider {\n triggerCharacters = ['{', ',', '[', '(', '=', '~', ' ', '\"'];\n\n private labels: { [label: string]: string[] } = {};\n\n constructor(\n private datasource: {\n getLabelNames: () => Promise;\n getLabelValues: (label: string) => Promise;\n },\n private monaco: Monaco,\n private editor: monacoTypes.editor.IStandaloneCodeEditor\n ) {}\n\n async init() {\n const names = await this.datasource.getLabelNames();\n this.labels = names.reduce<{ [label: string]: string[] }>((acc, name) => {\n acc[name] = [];\n return acc;\n }, {});\n }\n\n provideCompletionItems(\n model: monacoTypes.editor.ITextModel,\n position: monacoTypes.Position\n ): monacoTypes.languages.ProviderResult {\n // if the model-id does not match, then this call is from a different editor-instance,\n // not \"our instance\", so return nothing\n if (this.editor.getModel()?.id !== model.id) {\n return { suggestions: [] };\n }\n\n const { range, offset } = getRangeAndOffset(this.monaco, model, position);\n const situation = getSituation(model.getValue(), offset);\n // Cannot be async/await cause of the ProviderResult return type\n return this.getCompletions(situation).then((completionItems) => {\n // monaco by-default alphabetically orders the items.\n // to stop it, we use a number-as-string sortkey,\n // so that monaco keeps the order we use\n const maxIndexDigits = completionItems.length.toString().length;\n const suggestions: monacoTypes.languages.CompletionItem[] = completionItems.map((item, index) => ({\n kind: getMonacoCompletionItemKind(item.type, this.monaco!),\n label: item.label,\n insertText: item.insertText,\n sortText: index.toString().padStart(maxIndexDigits, '0'), // to force the order we have\n range,\n }));\n return { suggestions };\n });\n }\n\n /**\n * Get suggestion based on the situation we are in like whether we should suggest label names or values.\n * @param situation\n * @private\n */\n private async getCompletions(situation: Situation): Promise {\n if (!Object.keys(this.labels).length) {\n return [];\n }\n switch (situation.type) {\n // Not really sure what would make sense to suggest in this case so just leave it\n case 'UNKNOWN': {\n return [];\n }\n case 'EMPTY': {\n return Object.keys(this.labels).map((key) => {\n return {\n label: key,\n insertText: `{${key}=\"`,\n type: 'LABEL_NAME',\n };\n });\n }\n case 'IN_LABEL_NAME':\n return Object.keys(this.labels).map((key) => {\n return {\n label: key,\n insertText: key,\n type: 'LABEL_NAME',\n };\n });\n case 'IN_LABEL_VALUE':\n let values = [];\n if (this.labels[situation.labelName].length) {\n values = this.labels[situation.labelName];\n } else {\n values = await this.datasource.getLabelValues(situation.labelName);\n this.labels[situation.labelName] = values;\n }\n\n return values.map((val) => {\n return {\n label: val,\n insertText: situation.betweenQuotes ? val : `\"${val}\"`,\n type: 'LABEL_VALUE',\n };\n });\n default:\n throw new Error(`Unexpected situation ${situation}`);\n }\n }\n}\n\n/**\n * Get item kind which is used for icon next to the suggestion.\n * @param type\n * @param monaco\n */\nfunction getMonacoCompletionItemKind(type: CompletionType, monaco: Monaco): monacoTypes.languages.CompletionItemKind {\n switch (type) {\n case 'LABEL_NAME':\n return monaco.languages.CompletionItemKind.Enum;\n case 'LABEL_VALUE':\n return monaco.languages.CompletionItemKind.EnumMember;\n default:\n throw new Error(`Unexpected CompletionType: ${type}`);\n }\n}\n\nexport type CompletionType = 'LABEL_NAME' | 'LABEL_VALUE';\ntype Completion = {\n type: CompletionType;\n label: string;\n insertText: string;\n};\n\nexport type Label = {\n name: string;\n value: string;\n};\n\nexport type Situation =\n | {\n type: 'UNKNOWN';\n }\n | {\n type: 'EMPTY';\n }\n | {\n type: 'IN_LABEL_NAME';\n otherLabels: Label[];\n }\n | {\n type: 'IN_LABEL_VALUE';\n labelName: string;\n betweenQuotes: boolean;\n otherLabels: Label[];\n };\n\nconst labelNameRegex = /[a-zA-Z_][a-zA-Z0-9_]*/;\nconst labelValueRegex = /[^\"]*/; // anything except a double quote\nconst labelPairsRegex = new RegExp(`(${labelNameRegex.source})=\"(${labelValueRegex.source})\"`, 'g');\nconst inLabelValueRegex = new RegExp(`(${labelNameRegex.source})=(\"?)${labelValueRegex.source}$`);\nconst inLabelNameRegex = new RegExp(/[{,]\\s*[a-zA-Z0-9_]*$/);\n\n/**\n * Figure out where is the cursor and what kind of suggestions are appropriate.\n * As currently Fire handles just a simple {foo=\"bar\", baz=\"zyx\"} kind of values we can do with simple regex to figure\n * out where we are with the cursor.\n * @param text\n * @param offset\n */\nfunction getSituation(text: string, offset: number): Situation {\n if (text === '') {\n return {\n type: 'EMPTY',\n };\n }\n\n // Get all the labels so far in the query, so we can do some more filtering.\n const matches = text.matchAll(labelPairsRegex);\n const existingLabels = Array.from(matches).reduce((acc, match) => {\n const [_, name, value] = match[1];\n acc.push({ name, value });\n return acc;\n }, []);\n\n // Check if we are editing a label value right now. If so also get name of the label\n const matchLabelValue = text.substring(0, offset).match(inLabelValueRegex);\n if (matchLabelValue) {\n return {\n type: 'IN_LABEL_VALUE',\n labelName: matchLabelValue[1],\n betweenQuotes: !!matchLabelValue[2],\n otherLabels: existingLabels,\n };\n }\n\n // Check if we are editing a label name\n const matchLabelName = text.substring(0, offset).match(inLabelNameRegex);\n if (matchLabelName) {\n return {\n type: 'IN_LABEL_NAME',\n otherLabels: existingLabels,\n };\n }\n\n // Will happen only if user writes something that isn't really a label selector\n return {\n type: 'UNKNOWN',\n };\n}\n\nfunction getRangeAndOffset(monaco: Monaco, model: monacoTypes.editor.ITextModel, position: monacoTypes.Position) {\n const word = model.getWordAtPosition(position);\n const range =\n word != null\n ? monaco.Range.lift({\n startLineNumber: position.lineNumber,\n endLineNumber: position.lineNumber,\n startColumn: word.startColumn,\n endColumn: word.endColumn,\n })\n : monaco.Range.fromPositions(position);\n\n // documentation says `position` will be \"adjusted\" in `getOffsetAt` so we clone it here just for sure.\n const positionClone = {\n column: position.column,\n lineNumber: position.lineNumber,\n };\n\n const offset = model.getOffsetAt(positionClone);\n return { offset, range };\n}\n","import { css } from '@emotion/css';\nimport React, { useEffect, useRef } from 'react';\nimport { useLatest } from 'react-use';\n\nimport { CodeEditor, Monaco, useStyles2, monacoTypes } from '@grafana/ui';\n\nimport { ParcaDataSource } from '../datasource';\nimport { languageDefinition } from '../lang';\n\nimport { CompletionProvider } from './autocomplete';\n\ninterface Props {\n value: string;\n datasource: ParcaDataSource;\n onChange: (val: string) => void;\n onRunQuery: (value: string) => void;\n}\n\nexport function LabelsEditor(props: Props) {\n const setupAutocompleteFn = useAutocomplete(props.datasource);\n const styles = useStyles2(getStyles);\n\n const onRunQueryRef = useLatest(props.onRunQuery);\n const containerRef = useRef(null);\n\n return (\n \n {\n setupAutocompleteFn(editor, monaco);\n\n const updateElementHeight = () => {\n const containerDiv = containerRef.current;\n if (containerDiv !== null) {\n const pixelHeight = editor.getContentHeight();\n containerDiv.style.height = `${pixelHeight + EDITOR_HEIGHT_OFFSET}px`;\n containerDiv.style.width = '100%';\n const pixelWidth = containerDiv.clientWidth;\n editor.layout({ width: pixelWidth, height: pixelHeight });\n }\n };\n\n editor.onDidContentSizeChange(updateElementHeight);\n updateElementHeight();\n\n editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Enter, () => {\n onRunQueryRef.current(editor.getValue());\n });\n }}\n />\n \n );\n}\n\n// this number was chosen by testing various values. it might be necessary\n// because of the width of the border, not sure.\n//it needs to do 2 things:\n// 1. when the editor is single-line, it should make the editor height be visually correct\n// 2. when the editor is multi-line, the editor should not be \"scrollable\" (meaning,\n// you do a scroll-movement in the editor, and it will scroll the content by a couple pixels\n// up & down. this we want to avoid)\nconst EDITOR_HEIGHT_OFFSET = 2;\n\n/**\n * Hook that returns function that will set up monaco autocomplete for the label selector\n * @param datasource\n */\nfunction useAutocomplete(datasource: ParcaDataSource) {\n const autocompleteDisposeFun = useRef<(() => void) | null>(null);\n useEffect(() => {\n // when we unmount, we unregister the autocomplete-function, if it was registered\n return () => {\n autocompleteDisposeFun.current?.();\n };\n }, []);\n\n // This should be run in monaco onEditorDidMount\n return async (editor: monacoTypes.editor.IStandaloneCodeEditor, monaco: Monaco) => {\n const provider = new CompletionProvider(datasource, monaco, editor);\n await provider.init();\n const { dispose } = monaco.languages.registerCompletionItemProvider(langId, provider);\n autocompleteDisposeFun.current = dispose;\n };\n}\n\n// we must only run the setup code once\nlet parcaqlSetupDone = false;\nconst langId = 'parca';\n\nfunction ensureParcaQL(monaco: Monaco) {\n if (parcaqlSetupDone === false) {\n parcaqlSetupDone = true;\n const { aliases, extensions, mimetypes, def } = languageDefinition;\n monaco.languages.register({ id: langId, aliases, extensions, mimetypes });\n monaco.languages.setMonarchTokensProvider(langId, def.language);\n monaco.languages.setLanguageConfiguration(langId, def.languageConfiguration);\n }\n}\n\nconst getStyles = () => {\n return {\n queryField: css`\n flex: 1;\n // Not exactly sure but without this the editor doe not shrink after resizing (so you can make it bigger but not\n // smaller). At the same time this does not actually make the editor 100px because it has flex 1 so I assume\n // this should sort of act as a flex-basis (but flex-basis does not work for this). So yeah CSS magic.\n width: 100px;\n `,\n wrapper: css`\n display: flex;\n flex: 1;\n border: 1px solid rgba(36, 41, 46, 0.3);\n border-radius: 2px;\n `,\n };\n};\n","import { css, cx } from '@emotion/css';\nimport React from 'react';\nimport { useToggle } from 'react-use';\n\nimport { CoreApp, GrafanaTheme2 } from '@grafana/data';\nimport { Icon, useStyles2, RadioButtonGroup, Field, clearButtonStyles, Button } from '@grafana/ui';\n\nimport { Query } from '../types';\n\nimport { Stack } from './Stack';\n\nexport interface Props {\n query: Query;\n onQueryTypeChange: (val: Query['queryType']) => void;\n app?: CoreApp;\n}\n\nconst rangeOptions: Array<{ value: Query['queryType']; label: string; description: string }> = [\n { value: 'metrics', label: 'Metric', description: 'Return aggregated metrics' },\n { value: 'profile', label: 'Profile', description: 'Return profile' },\n { value: 'both', label: 'Both', description: 'Return both metric and profile data' },\n];\n\nfunction getOptions(app?: CoreApp) {\n if (app === CoreApp.Explore) {\n return rangeOptions;\n }\n return rangeOptions.filter((option) => option.value !== 'both');\n}\n\n/**\n * Base on QueryOptionGroup component from grafana/ui but that is not available yet.\n */\nexport function QueryOptions({ query, onQueryTypeChange, app }: Props) {\n const [isOpen, toggleOpen] = useToggle(false);\n const styles = useStyles2(getStyles);\n const options = getOptions(app);\n const buttonStyles = useStyles2(clearButtonStyles);\n\n return (\n \n \n {isOpen && (\n
\n \n \n \n
\n )}\n
\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => {\n return {\n switchLabel: css({\n color: theme.colors.text.secondary,\n cursor: 'pointer',\n fontSize: theme.typography.bodySmall.fontSize,\n '&:hover': {\n color: theme.colors.text.primary,\n },\n }),\n header: css({\n display: 'flex',\n cursor: 'pointer',\n alignItems: 'baseline',\n color: theme.colors.text.primary,\n '&:hover': {\n background: theme.colors.emphasize(theme.colors.background.primary, 0.03),\n },\n }),\n title: css({\n flexGrow: 1,\n overflow: 'hidden',\n fontSize: theme.typography.bodySmall.fontSize,\n fontWeight: theme.typography.fontWeightMedium,\n margin: 0,\n }),\n description: css({\n color: theme.colors.text.secondary,\n fontSize: theme.typography.bodySmall.fontSize,\n paddingLeft: theme.spacing(2),\n gap: theme.spacing(2),\n display: 'flex',\n }),\n body: css({\n display: 'flex',\n paddingTop: theme.spacing(2),\n gap: theme.spacing(2),\n flexWrap: 'wrap',\n }),\n toggle: css({\n color: theme.colors.text.secondary,\n marginRight: `${theme.spacing(1)}`,\n }),\n };\n};\n","import { defaults } from 'lodash';\nimport React, { useMemo, useState } from 'react';\nimport { useMount } from 'react-use';\n\nimport { CoreApp, QueryEditorProps } from '@grafana/data';\nimport { ButtonCascader, CascaderOption } from '@grafana/ui';\n\nimport { defaultParca, defaultParcaQueryType, Parca } from '../dataquery.gen';\nimport { ParcaDataSource } from '../datasource';\nimport { ParcaDataSourceOptions, ProfileTypeMessage, Query } from '../types';\n\nimport { EditorRow } from './EditorRow';\nimport { EditorRows } from './EditorRows';\nimport { LabelsEditor } from './LabelsEditor';\nimport { QueryOptions } from './QueryOptions';\n\nexport type Props = QueryEditorProps;\n\nexport const defaultQuery: Partial = {\n ...defaultParca,\n queryType: defaultParcaQueryType,\n};\n\nexport function QueryEditor(props: Props) {\n const [profileTypes, setProfileTypes] = useState([]);\n\n function onProfileTypeChange(value: string[], selectedOptions: CascaderOption[]) {\n if (selectedOptions.length === 0) {\n return;\n }\n const id = selectedOptions[selectedOptions.length - 1].value;\n if (typeof id !== 'string') {\n throw new Error('id is not string');\n }\n props.onChange({ ...props.query, profileTypeId: id });\n }\n\n function onLabelSelectorChange(value: string) {\n props.onChange({ ...props.query, labelSelector: value });\n }\n\n function handleRunQuery(value: string) {\n props.onChange({ ...props.query, labelSelector: value });\n props.onRunQuery();\n }\n\n useMount(async () => {\n const profileTypes = await props.datasource.getProfileTypes();\n setProfileTypes(profileTypes);\n });\n\n // Turn profileTypes into cascader options\n const cascaderOptions = useMemo(() => {\n let mainTypes = new Map();\n // Classify profile types by name then sample type.\n for (let profileType of profileTypes) {\n if (!mainTypes.has(profileType.name)) {\n mainTypes.set(profileType.name, {\n label: profileType.name,\n value: profileType.ID,\n children: [],\n });\n }\n mainTypes.get(profileType.name)?.children?.push({\n label: profileType.sample_type,\n value: profileType.ID,\n });\n }\n return Array.from(mainTypes.values());\n }, [profileTypes]);\n\n const selectedProfileName = useMemo(() => {\n if (!profileTypes) {\n return 'Loading';\n }\n const profile = profileTypes.find((type) => type.ID === props.query.profileTypeId);\n if (!profile) {\n return 'Select a profile type';\n }\n\n return profile.name + ' - ' + profile.sample_type;\n }, [props.query.profileTypeId, profileTypes]);\n\n let query = normalizeQuery(props.query, props.app);\n\n return (\n \n \n \n {selectedProfileName}\n \n \n \n \n {\n props.onChange({ ...query, queryType: val });\n }}\n app={props.app}\n />\n \n \n );\n}\n\nfunction normalizeQuery(query: Query, app?: CoreApp) {\n let normalized = defaults(query, defaultQuery);\n if (app !== CoreApp.Explore && normalized.queryType === 'both') {\n // In dashboards and other places, we can't show both types of graphs at the same time.\n // This will also be a default when having 'both' query and adding it from explore to dashboard\n normalized.queryType = 'profile';\n }\n return normalized;\n}\n","import { Observable, of } from 'rxjs';\n\nimport { DataQueryRequest, DataQueryResponse, DataSourceInstanceSettings } from '@grafana/data';\nimport { DataSourceWithBackend } from '@grafana/runtime';\n\nimport { ParcaDataSourceOptions, Query, ProfileTypeMessage } from './types';\n\nexport class ParcaDataSource extends DataSourceWithBackend {\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n }\n\n query(request: DataQueryRequest): Observable {\n if (!request.targets.every((q) => q.profileTypeId)) {\n // When changing data source in explore, firs query can be sent without filled in profileTypeId\n return of({ data: [] });\n }\n\n return super.query(request);\n }\n\n async getProfileTypes(): Promise {\n return await super.getResource('profileTypes');\n }\n\n async getLabelNames(): Promise {\n return await super.getResource('labelNames');\n }\n\n async getLabelValues(labelName: string): Promise {\n return await super.getResource('labelValues', { label: labelName });\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\n\nimport { ConfigEditor } from './ConfigEditor';\nimport { QueryEditor } from './QueryEditor/QueryEditor';\nimport { ParcaDataSource } from './datasource';\nimport { Query, ParcaDataSourceOptions } from './types';\n\nexport const plugin = new DataSourcePlugin(ParcaDataSource)\n .setConfigEditor(ConfigEditor)\n .setQueryEditor(QueryEditor);\n","import { useRef } from 'react';\nvar useLatest = function (value) {\n var ref = useRef(value);\n ref.current = value;\n return ref;\n};\nexport default useLatest;\n","import useEffectOnce from './useEffectOnce';\nvar useMount = function (fn) {\n useEffectOnce(function () {\n fn();\n });\n};\nexport default useMount;\n"],"names":["Stack","props","styles","getStyles","theme","ConfigEditor","options","onOptionsChange","DataSourceHttpSettings","config","defaultParcaQueryType","defaultParca","EditorRow","children","stackProps","EditorRows","languageDefinition","CompletionProvider","datasource","monaco","editor","names","acc","name","model","position","range","offset","getRangeAndOffset","situation","getSituation","completionItems","maxIndexDigits","item","index","getMonacoCompletionItemKind","key","values","val","type","labelNameRegex","labelValueRegex","labelPairsRegex","inLabelValueRegex","inLabelNameRegex","text","matches","existingLabels","match","_","value","matchLabelValue","word","positionClone","LabelsEditor","setupAutocompleteFn","useAutocomplete","onRunQueryRef","useLatest","containerRef","CodeEditor","langId","ensureParcaQL","updateElementHeight","containerDiv","pixelHeight","EDITOR_HEIGHT_OFFSET","pixelWidth","autocompleteDisposeFun","provider","dispose","parcaqlSetupDone","aliases","extensions","mimetypes","def","rangeOptions","getOptions","app","option","QueryOptions","query","onQueryTypeChange","isOpen","toggleOpen","useToggle","buttonStyles","Button","Icon","Field","RadioButtonGroup","defaultQuery","QueryEditor","profileTypes","setProfileTypes","onProfileTypeChange","selectedOptions","id","onLabelSelectorChange","handleRunQuery","useMount","cascaderOptions","mainTypes","profileType","selectedProfileName","profile","normalizeQuery","ButtonCascader","normalized","ParcaDataSource","DataSourceWithBackend","instanceSettings","request","q","of","labelName","ref","fn"],"sourceRoot":""}