"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[5714],{12091(C,p,n){n.d(p,{Y:()=>f});var u=n(31638),s=n(36898);function f(e,i={}){const o=[u.sU.define({create(a){const t=a.selection.main.head;return c(e(a,t),t)},update(a,t){if(!t.docChanged&&!t.selection)return a;const d=t.state.selection.main.head;return c(e(t.state,d),d)},provide:a=>s.DK.from(a,t=>t?m(t.help,t.pos):null)}),h];return i.theme&&o.push(y(i.theme)),o}function c(e,i){return e?.signatures.length?{help:e,pos:i}:null}function m(e,i){const r=e.signatures[e.activeSignature]??e.signatures[0];return{pos:i,above:!0,strictSide:!1,create(){const o=document.createElement("div");if(o.className="cm-signature-help",o.appendChild(l(r,e.activeParameter)),r.documentation){const a=document.createElement("div");a.className="cm-signature-help-doc",a.textContent=r.documentation,o.appendChild(a)}return{dom:o}}}}function l(e,i){const r=document.createElement("div");return r.className="cm-signature-help-label",r.appendChild(document.createTextNode(`${e.name}(`)),e.parameters.forEach((o,a)=>{a>0&&r.appendChild(document.createTextNode(", "));const t=document.createElement("span");t.textContent=o.label,a===i&&(t.className="cm-signature-help-active-param"),r.appendChild(t)}),r.appendChild(document.createTextNode(")")),e.returnType&&r.appendChild(document.createTextNode(`: ${e.returnType}`)),r}const h=s.Lz.baseTheme({".cm-tooltip.cm-signature-help":{padding:"6px 10px",maxWidth:"480px",borderRadius:"2px"},".cm-signature-help-label":{fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-word"},".cm-signature-help-active-param":{fontWeight:"bold"},".cm-signature-help-doc":{marginTop:"6px",paddingTop:"6px",borderTop:"1px solid rgba(127, 127, 127, 0.3)"}});function y(e){return s.Lz.theme({".cm-tooltip.cm-signature-help":{padding:e.spacing(.75,1.25),border:`1px solid ${e.colors.border.weak}`,borderRadius:e.shape.radius.default,backgroundColor:e.colors.background.elevated,color:e.colors.text.primary,boxShadow:e.shadows.z2,fontSize:e.typography.bodySmall.fontSize},".cm-signature-help-label":{fontFamily:e.typography.fontFamilyMonospace,lineHeight:e.typography.bodySmall.lineHeight},".cm-signature-help-active-param":{color:e.colors.primary.text,fontWeight:e.typography.fontWeightBold},".cm-signature-help-doc":{marginTop:e.spacing(.75),paddingTop:e.spacing(.75),borderTop:`1px solid ${e.colors.border.weak}`,color:e.colors.text.secondary,fontSize:e.typography.bodySmall.fontSize,lineHeight:e.typography.bodySmall.lineHeight}})}},5714(C,p,n){n.r(p),n.d(p,{CodeMirrorEditor:()=>s.g,TableNG:()=>r.i,applyVariableReference:()=>c.E,attachSkeleton:()=>u.j,createVariableCompletionSource:()=>c.i,getQueryFieldConfig:()=>i,signatureHelp:()=>f.Y,skeletonAnimation:()=>u.Q});var u=n(92723),s=n(58962),f=n(12091),c=n(73294),m=n(31638),l=n(36898),h=n(68407);const y={lineNumbers:!1,foldGutter:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1,closeBrackets:!1,bracketMatching:!1,indentOnInput:!1,autocompletion:!1,drawSelection:!1};function e(o){return l.Lz.theme({"&":{width:"100%",minHeight:o.spacing(4),fontSize:o.typography.body.fontSize,fontFamily:o.typography.fontFamilyMonospace,color:o.colors.text.primary,backgroundColor:o.components.input.background,border:`1px solid ${o.components.input.borderColor}`,borderRadius:o.shape.radius.default},"&.cm-focused":(0,h.getFocusStyles)(o),".cm-scroller":{fontFamily:o.typography.fontFamilyMonospace,lineHeight:"18px"},".cm-content":{padding:o.spacing(.75,1),caretColor:o.colors.text.primary},".cm-line":{padding:0},".cm-placeholder":{color:o.colors.text.disabled}},{dark:o.isDark})}function i(o,a={}){const{onRunQuery:t,onBlur:d,placeholder:b}=a,g=[l.Lz.lineWrapping];if(t){const x=()=>(t(),!0);g.push(m.Nb.highest(l.w4.of([{key:"Shift-Enter",run:x},{key:"Ctrl-Enter",run:x}])))}return d&&g.push(l.Lz.domEventHandlers({blur:()=>(d(),!1)})),b&&g.push((0,l.qf)(b)),{theme:e(o),basicSetup:y,extensions:g}}var r=n(67294)}}]);

//# sourceMappingURL=5714.85124f61bc91c10a0ddd.js.map