(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9978],{74526:()=>{(function(){"use strict";/**
 * Bindonce - Zero watches binding for AngularJs
 * @version v0.3.1
 * @link https://github.com/Pasvaz/bindonce
 * @author Pasquale Vazzana <pasqualevazzana@gmail.com>
 * @license MIT License, http://www.opensource.org/licenses/MIT
 */var u=angular.module("pasvaz.bindonce",[]);u.directive("bindonce",function(){var A=function(l){if(l&&l.length!==0){var m=angular.lowercase(""+l);l=!(m==="f"||m==="0"||m==="false"||m==="no"||m==="n"||m==="[]")}else l=!1;return l},a=parseInt((/msie (\d+)/.exec(angular.lowercase(navigator.userAgent))||[])[1],10);isNaN(a)&&(a=parseInt((/trident\/.*; rv:(\d+)/.exec(angular.lowercase(navigator.userAgent))||[])[1],10));var s={restrict:"AM",controller:["$scope","$element","$attrs","$interpolate",function(l,m,g,C){var o=function(p,S,I){var ne=S==="show"?"":"none",ie=S==="hide"?"":"none";p.css("display",A(I)?ne:ie)},h=function(p,S){if(angular.isObject(S)&&!angular.isArray(S)){var I=[];angular.forEach(S,function(ne,ie){ne&&I.push(ie)}),S=I}S&&p.addClass(angular.isArray(S)?S.join(" "):S)},E={watcherRemover:void 0,binders:[],group:g.boName,element:m,ran:!1,addBinder:function(p){this.binders.push(p),this.ran&&this.runBinders()},setupWatcher:function(p){var S=this;this.watcherRemover=l.$watch(p,function(I){I!==void 0&&(S.removeWatcher(),S.runBinders())},!0)},removeWatcher:function(){this.watcherRemover!==void 0&&(this.watcherRemover(),this.watcherRemover=void 0)},runBinders:function(){for(;this.binders.length>0;){var p=this.binders.shift();if(!(this.group&&this.group!=p.group)){var S=p.scope.$eval(p.interpolate?C(p.value):p.value);switch(p.attr){case"boIf":A(S)&&p.transclude(p.scope.$new(),function(Z){var ee=p.element.parent(),B=p.element&&p.element[p.element.length-1],K=ee&&ee[0]||B&&B.parentNode,T=B&&B.nextSibling||null;angular.forEach(Z,function(ae){K.insertBefore(ae,T)})});break;case"boSwitch":var I,ne=p.controller[0];(I=ne.cases["!"+S]||ne.cases["?"])&&(p.scope.$eval(p.attrs.change),angular.forEach(I,function(Z){Z.transclude(p.scope.$new(),function(ee){var B=Z.element.parent(),K=Z.element&&Z.element[Z.element.length-1],T=B&&B[0]||K&&K.parentNode,ae=K&&K.nextSibling||null;angular.forEach(ee,function(ge){T.insertBefore(ge,ae)})})}));break;case"boSwitchWhen":var ie=p.controller[0];ie.cases["!"+p.attrs.boSwitchWhen]=ie.cases["!"+p.attrs.boSwitchWhen]||[],ie.cases["!"+p.attrs.boSwitchWhen].push({transclude:p.transclude,element:p.element});break;case"boSwitchDefault":var ie=p.controller[0];ie.cases["?"]=ie.cases["?"]||[],ie.cases["?"].push({transclude:p.transclude,element:p.element});break;case"hide":case"show":o(p.element,p.attr,S);break;case"class":h(p.element,S);break;case"text":p.element.text(S);break;case"html":p.element.html(S);break;case"style":p.element.css(S);break;case"src":p.element.attr(p.attr,S),a&&p.element.prop("src",S);break;case"attr":angular.forEach(p.attrs,function(Z,ee){var B,K;ee.match(/^boAttr./)&&p.attrs[ee]&&(B=ee.replace(/^boAttr/,"").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),K=p.scope.$eval(p.attrs[ee]),p.element.attr(B,K))});break;case"href":case"alt":case"title":case"id":case"value":p.element.attr(p.attr,S);break}}}this.ran=!0}};return E}],link:function(l,m,g,C){var o=g.bindonce?l.$eval(g.bindonce):!0;o!==void 0?C.runBinders():(C.setupWatcher(g.bindonce),m.bind("$destroy",C.removeWatcher))}};return s}),angular.forEach([{directiveName:"boShow",attribute:"show"},{directiveName:"boHide",attribute:"hide"},{directiveName:"boClass",attribute:"class"},{directiveName:"boText",attribute:"text"},{directiveName:"boBind",attribute:"text"},{directiveName:"boHtml",attribute:"html"},{directiveName:"boSrcI",attribute:"src",interpolate:!0},{directiveName:"boSrc",attribute:"src"},{directiveName:"boHrefI",attribute:"href",interpolate:!0},{directiveName:"boHref",attribute:"href"},{directiveName:"boAlt",attribute:"alt"},{directiveName:"boTitle",attribute:"title"},{directiveName:"boId",attribute:"id"},{directiveName:"boStyle",attribute:"style"},{directiveName:"boValue",attribute:"value"},{directiveName:"boAttr",attribute:"attr"},{directiveName:"boIf",transclude:"element",terminal:!0,priority:1e3},{directiveName:"boSwitch",require:"boSwitch",controller:function(){this.cases={}}},{directiveName:"boSwitchWhen",transclude:"element",priority:800,require:"^boSwitch"},{directiveName:"boSwitchDefault",transclude:"element",priority:800,require:"^boSwitch"}],function(A){var a=200;return u.directive(A.directiveName,function(){var s={priority:A.priority||a,transclude:A.transclude||!1,terminal:A.terminal||!1,require:["^bindonce"].concat(A.require||[]),controller:A.controller,compile:function(l,m,g){return function(C,o,h,E){var p=E[0],S=h.boParent;if(S&&p.group!==S){var I=p.element.parent();p=void 0;for(var ne;I[0].nodeType!==9&&I.length;){if((ne=I.data("$bindonceController"))&&ne.group===S){p=ne;break}I=I.parent()}if(!p)throw new Error("No bindonce controller: "+S)}p.addBinder({element:o,attr:A.attribute||A.directiveName,attrs:h,value:h[A.directiveName],interpolate:A.interpolate,group:S,transclude:g,controller:E.slice(1),scope:C})}}};return s})})})()},32747:()=>{/**
 * @license AngularJS v1.8.3
 * (c) 2010-2020 Google LLC. http://angularjs.org
 * License: MIT
 */(function(u,A){"use strict";function a(Z,ee){if(l(Z)){ee=ee||[];for(var B=0,K=Z.length;B<K;B++)ee[B]=Z[B]}else if(m(Z)){ee=ee||{};for(var T in Z)T.charAt(0)==="$"&&T.charAt(1)==="$"||(ee[T]=Z[T])}return ee||Z}function s(Z,ee){var B=[],K=Z.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[?*])?/g,function(T,ae,ge,X){var ce=X==="?"||X==="*?",pe=X==="*"||X==="*?";return B.push({name:ge,optional:ce}),ae=ae||"",(ce?"(?:"+ae:ae+"(?:")+(pe?"(.+?)":"([^/]+)")+(ce?"?)?":")")}).replace(/([/$*])/g,"\\$1");return ee.ignoreTrailingSlashes&&(K=K.replace(/\/+$/,"")+"/*"),{keys:B,regexp:new RegExp("^"+K+"(?:[?#]|$)",ee.caseInsensitiveMatch?"i":"")}}var l,m,g,C,o=A.module("ngRoute",[]).info({angularVersion:"1.8.3"}).provider("$route",p).run(S),h=A.$$minErr("ngRoute"),E;function p(){l=A.isArray,m=A.isObject,g=A.isDefined,C=A.noop;function Z(B,K){return A.extend(Object.create(B),K)}var ee={};this.when=function(B,K){var T=a(K);if(A.isUndefined(T.reloadOnUrl)&&(T.reloadOnUrl=!0),A.isUndefined(T.reloadOnSearch)&&(T.reloadOnSearch=!0),A.isUndefined(T.caseInsensitiveMatch)&&(T.caseInsensitiveMatch=this.caseInsensitiveMatch),ee[B]=A.extend(T,{originalPath:B},B&&s(B,T)),B){var ae=B[B.length-1]==="/"?B.substr(0,B.length-1):B+"/";ee[ae]=A.extend({originalPath:B,redirectTo:B},s(ae,T))}return this},this.caseInsensitiveMatch=!1,this.otherwise=function(B){return typeof B=="string"&&(B={redirectTo:B}),this.when(null,B),this},E=!0,this.eagerInstantiationEnabled=function(K){return g(K)?(E=K,this):E},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce","$browser",function(B,K,T,ae,ge,X,ce,pe){var D=!1,ue,F,me={routes:ee,reload:function(){D=!0;var V={defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0,D=!1}};B.$evalAsync(function(){le(V),V.defaultPrevented||re()})},updateParams:function(V){if(this.current&&this.current.$$route)V=A.extend({},this.current.params,V),K.path(ke(this.current.$$route.originalPath,V)),K.search(V);else throw h("norout","Tried updating route with no current route")}};return B.$on("$locationChangeStart",le),B.$on("$locationChangeSuccess",re),me;function O(V,z){var P=z.keys,H={};if(!z.regexp)return null;var J=z.regexp.exec(V);if(!J)return null;for(var se=1,te=J.length;se<te;++se){var be=P[se-1],R=J[se];be&&R&&(H[be.name]=R)}return H}function le(V){var z=me.current;ue=Ne(),F=De(ue,z),!F&&(z||ue)&&B.$broadcast("$routeChangeStart",ue,z).defaultPrevented&&V&&V.preventDefault()}function re(){var V=me.current,z=ue;if(F)V.params=z.params,A.copy(V.params,T),B.$broadcast("$routeUpdate",V);else if(z||V){D=!1,me.current=z;var P=ae.resolve(z);pe.$$incOutstandingRequestCount("$route"),P.then(W).then(q).then(function(H){return H&&P.then(Ce).then(function(J){z===me.current&&(z&&(z.locals=J,A.copy(z.params,T)),B.$broadcast("$routeChangeSuccess",z,V))})}).catch(function(H){z===me.current&&B.$broadcast("$routeChangeError",z,V,H)}).finally(function(){pe.$$completeOutstandingRequest(C,"$route")})}}function W(V){var z={route:V,hasRedirection:!1};if(V){if(V.redirectTo)if(A.isString(V.redirectTo))z.path=ke(V.redirectTo,V.params),z.search=V.params,z.hasRedirection=!0;else{var P=K.path(),H=K.search(),J=V.redirectTo(V.pathParams,P,H);A.isDefined(J)&&(z.url=J,z.hasRedirection=!0)}else if(V.resolveRedirectTo)return ae.resolve(ge.invoke(V.resolveRedirectTo)).then(function(se){return A.isDefined(se)&&(z.url=se,z.hasRedirection=!0),z})}return z}function q(V){var z=!0;if(V.route!==me.current)z=!1;else if(V.hasRedirection){var P=K.url(),H=V.url;H?K.url(H).replace():H=K.path(V.path).search(V.search).replace().url(),H!==P&&(z=!1)}return z}function Ce(V){if(V){var z=A.extend({},V.resolve);A.forEach(z,function(H,J){z[J]=A.isString(H)?ge.get(H):ge.invoke(H,null,null,J)});var P=ve(V);return A.isDefined(P)&&(z.$template=P),ae.all(z)}}function ve(V){var z,P;return A.isDefined(z=V.template)?A.isFunction(z)&&(z=z(V.params)):A.isDefined(P=V.templateUrl)&&(A.isFunction(P)&&(P=P(V.params)),A.isDefined(P)&&(V.loadedTemplateUrl=ce.valueOf(P),z=X(P))),z}function Ne(){var V,z;return A.forEach(ee,function(P,H){!z&&(V=O(K.path(),P))&&(z=Z(P,{params:A.extend({},K.search(),V),pathParams:V}),z.$$route=P)}),z||ee[null]&&Z(ee[null],{params:{},pathParams:{}})}function De(V,z){return!D&&V&&z&&V.$$route===z.$$route&&(!V.reloadOnUrl||!V.reloadOnSearch&&A.equals(V.pathParams,z.pathParams))}function ke(V,z){var P=[];return A.forEach((V||"").split(":"),function(H,J){if(J===0)P.push(H);else{var se=H.match(/(\w+)(?:[?*])?(.*)/),te=se[1];P.push(z[te]),P.push(se[2]||""),delete z[te]}}),P.join("")}}]}S.$inject=["$injector"];function S(Z){E&&Z.get("$route")}o.provider("$routeParams",I);function I(){this.$get=function(){return{}}}o.directive("ngView",ne),o.directive("ngView",ie),ne.$inject=["$route","$anchorScroll","$animate"];function ne(Z,ee,B){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(K,T,ae,ge,X){var ce,pe,D,ue=ae.autoscroll,F=ae.onload||"";K.$on("$routeChangeSuccess",O),O();function me(){D&&(B.cancel(D),D=null),ce&&(ce.$destroy(),ce=null),pe&&(D=B.leave(pe),D.done(function(le){le!==!1&&(D=null)}),pe=null)}function O(){var le=Z.current&&Z.current.locals,re=le&&le.$template;if(A.isDefined(re)){var W=K.$new(),q=Z.current,Ce=X(W,function(ve){B.enter(ve,null,pe||T).done(function(De){De!==!1&&A.isDefined(ue)&&(!ue||K.$eval(ue))&&ee()}),me()});pe=Ce,ce=q.scope=W,ce.$emit("$viewContentLoaded"),ce.$eval(F)}else me()}}}}ie.$inject=["$compile","$controller","$route"];function ie(Z,ee,B){return{restrict:"ECA",priority:-400,link:function(K,T){var ae=B.current,ge=ae.locals;T.html(ge.$template);var X=Z(T.contents());if(ae.controller){ge.$scope=K;var ce=ee(ae.controller,ge);ae.controllerAs&&(K[ae.controllerAs]=ce),T.data("$ngControllerController",ce),T.children().data("$ngControllerController",ce)}K[ae.resolveAs||"$resolve"]=ge,X(K)}}}})(window,window.angular)},23345:(u,A,a)=>{a(32747),u.exports="ngRoute"},81221:()=>{/**
 * @license AngularJS v1.8.3
 * (c) 2010-2020 Google LLC. http://angularjs.org
 * License: MIT
 */(function(u,A){"use strict";var a=A.$$minErr("$sanitize"),s,l,m,g,C,o,h,E,p,S;function I(){var ie=!1,Z=!1;this.$get=["$$sanitizeUri",function(P){return ie=!0,Z&&l(ue,pe),function(H){var J=[];return p(H,S(J,function(se,te){return!/^unsafe:/.test(P(se,te))})),J.join("")}}],this.enableSvg=function(P){return C(P)?(Z=P,this):Z},this.addValidElements=function(P){return ie||(g(P)&&(P={htmlElements:P}),q(pe,P.svgElements),q(K,P.htmlVoidElements),q(ue,P.htmlVoidElements),q(ue,P.htmlElements)),this},this.addValidAttrs=function(P){return ie||l(le,W(P,!0)),this},s=A.bind,l=A.extend,m=A.forEach,g=A.isArray,C=A.isDefined,o=A.$$lowercase,h=A.noop,p=ve,S=ke,E=u.Node.prototype.contains||function(P){return!!(this.compareDocumentPosition(P)&16)};var ee=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,B=/([^#-~ |!])/g,K=re("area,br,col,hr,img,wbr"),T=re("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),ae=re("rp,rt"),ge=l({},ae,T),X=l({},T,re("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),ce=l({},ae,re("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),pe=re("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),D=re("script,style"),ue=l({},K,X,ce,ge),F=re("background,cite,href,longdesc,src,xlink:href,xml:base"),me=re("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),O=re("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),le=l({},F,O,me);function re(P,H){return W(P.split(","),H)}function W(P,H){var J={},se;for(se=0;se<P.length;se++)J[H?o(P[se]):P[se]]=!0;return J}function q(P,H){H&&H.length&&l(P,W(H))}var Ce=function(P,H){if(te())return be;if(!H||!H.implementation)throw a("noinert","Can't create an inert html document");var J=H.implementation.createHTMLDocument("inert"),se=(J.documentElement||J.getDocumentElement()).querySelector("body");return R;function te(){try{return!!be("")}catch{return!1}}function be(he){he="<remove></remove>"+he;try{var U=new P.DOMParser().parseFromString(he,"text/html").body;return U.firstChild.remove(),U}catch{return}}function R(he){return se.innerHTML=he,H.documentMode&&V(se),se}}(u,u.document);function ve(P,H){P==null?P="":typeof P!="string"&&(P=""+P);var J=Ce(P);if(!J)return"";var se=5;do{if(se===0)throw a("uinput","Failed to sanitize html because the input is unstable");se--,P=J.innerHTML,J=Ce(P)}while(P!==J.innerHTML);for(var te=J.firstChild;te;){switch(te.nodeType){case 1:H.start(te.nodeName.toLowerCase(),Ne(te.attributes));break;case 3:H.chars(te.textContent);break}var be;if(!(be=te.firstChild)&&(te.nodeType===1&&H.end(te.nodeName.toLowerCase()),be=z("nextSibling",te),!be))for(;be==null&&(te=z("parentNode",te),te!==J);)be=z("nextSibling",te),te.nodeType===1&&H.end(te.nodeName.toLowerCase());te=be}for(;te=J.firstChild;)J.removeChild(te)}function Ne(P){for(var H={},J=0,se=P.length;J<se;J++){var te=P[J];H[te.name]=te.value}return H}function De(P){return P.replace(/&/g,"&amp;").replace(ee,function(H){var J=H.charCodeAt(0),se=H.charCodeAt(1);return"&#"+((J-55296)*1024+(se-56320)+65536)+";"}).replace(B,function(H){return"&#"+H.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ke(P,H){var J=!1,se=s(P,P.push);return{start:function(te,be){te=o(te),!J&&D[te]&&(J=te),!J&&ue[te]===!0&&(se("<"),se(te),m(be,function(R,he){var U=o(he),Ue=te==="img"&&U==="src"||U==="background";le[U]===!0&&(F[U]!==!0||H(R,Ue))&&(se(" "),se(he),se('="'),se(De(R)),se('"'))}),se(">"))},end:function(te){te=o(te),!J&&ue[te]===!0&&K[te]!==!0&&(se("</"),se(te),se(">")),te==J&&(J=!1)},chars:function(te){J||se(De(te))}}}function V(P){for(;P;){if(P.nodeType===u.Node.ELEMENT_NODE)for(var H=P.attributes,J=0,se=H.length;J<se;J++){var te=H[J],be=te.name.toLowerCase();(be==="xmlns:ns1"||be.lastIndexOf("ns1:",0)===0)&&(P.removeAttributeNode(te),J--,se--)}var R=P.firstChild;R&&V(R),P=z("nextSibling",P)}}function z(P,H){var J=H[P];if(J&&E.call(H,J))throw a("elclob","Failed to sanitize html because the element is clobbered: {0}",H.outerHTML||H.outerText);return J}}function ne(ie){var Z=[],ee=S(Z,h);return ee.chars(ie),Z.join("")}A.module("ngSanitize",[]).provider("$sanitize",I).info({angularVersion:"1.8.3"}),A.module("ngSanitize").filter("linky",["$sanitize",function(ie){var Z=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,ee=/^mailto:/i,B=A.$$minErr("linky"),K=A.isDefined,T=A.isFunction,ae=A.isObject,ge=A.isString;return function(X,ce,pe){if(X==null||X==="")return X;if(!ge(X))throw B("notstring","Expected string but received: {0}",X);for(var D=T(pe)?pe:ae(pe)?function(){return pe}:function(){return{}},ue,F=X,me=[],O,le;ue=F.match(Z);)O=ue[0],!ue[2]&&!ue[4]&&(O=(ue[3]?"http://":"mailto:")+O),le=ue.index,re(F.substr(0,le)),W(O,ue[0].replace(ee,"")),F=F.substring(le+ue[0].length);return re(F),ie(me.join(""));function re(q){q&&me.push(ne(q))}function W(q,Ce){var ve,Ne=D(q);me.push("<a ");for(ve in Ne)me.push(ve+'="'+Ne[ve]+'" ');K(ce)&&!("target"in Ne)&&me.push('target="',ce,'" '),me.push('href="',q.replace(/"/g,"&quot;"),'">'),re(Ce),me.push("</a>")}}}])})(window,window.angular)},26415:(u,A,a)=>{a(81221),u.exports="ngSanitize"},12582:u=>{"use strict";function A(a){var s=this,l;if(this._au)return;function m(){s.root[s.origin.offset]?C():g()}function g(){l||(l=setInterval(function(){s.root[s.origin.offset]&&(C(),s.update())},300))}function C(){clearInterval(l),l=null}var o=s._debounce(function(){s.update()},300);this._observer=new a(function(){m(),s.update(),o()}),this.on("init",function(){s._observer.observe(s.root,{childList:!0,subtree:!0,characterData:!0}),m()}),this.on("dispose",function(){s._observer.disconnect(),C(),delete s._observer}),this._au=!0}u.exports=function(s){var l=s.MutationObserver||s.WebKitMutationObserver||s.MozMutationObserver||null;return function(){return l?(A.call(this,l),this):this}}},69786:(u,A,a)=>{"use strict";var s=a(69079).qs;u.exports=function(m){var g,C,o,h,E=this,p;h=m.screen||.9,m.forward&&(g=s(m.forward,this.clipper),p={element:g,handler:function(){var S=E.pos()+(m.delta||30);E.pos(S)},type:"click"},this._eventHandlers.push(p),this.event(p.element,p.type,p.handler,"on")),m.backward&&(C=s(m.backward,this.clipper),p={element:C,handler:function(){var S=E.pos()-(m.delta||30);E.pos(S)},type:"click"},this._eventHandlers.push(p),this.event(p.element,p.type,p.handler,"on")),m.track&&(m.track===!0?o=this.track:o=s(m.track,this.clipper),o&&(p={element:o,handler:function(S){if(S.target==o){var I=S["offset"+E.origin.x],ne=E.bar[E.origin.offsetPos],ie=0;I<ne?ie=-1:I>ne+E.bar[E.origin.offset]&&(ie=1);var Z=E.pos()+ie*h*E.scroller[E.origin.client];E.pos(Z)}},type:"mousedown"},this._eventHandlers.push(p),this.event(p.element,p.type,p.handler,"on")))}},92747:(u,A,a)=>{"use strict";var s=function(){return this||(0,eval)("this")}(),l=s&&s.window||s,m=a(69079).f0,g=a(69079).AH,C=a(69079).WQ,o=a(69079).zy,h=a(69079).rm,E=a(69079).o8,p=a(69079).qs,S=X,I=["left","top","right","bottom","width","height"],ne=[],ie={v:{x:"Y",pos:I[1],oppos:I[3],crossPos:I[0],crossOpPos:I[2],size:I[5],crossSize:I[4],crossMinSize:"min-"+I[4],crossMaxSize:"max-"+I[4],client:"clientHeight",crossClient:"clientWidth",scrollEdge:"scrollLeft",offset:"offsetHeight",crossOffset:"offsetWidth",offsetPos:"offsetTop",scroll:"scrollTop",scrollSize:"scrollHeight"},h:{x:"X",pos:I[0],oppos:I[2],crossPos:I[1],crossOpPos:I[3],size:I[4],crossSize:I[5],crossMinSize:"min-"+I[5],crossMaxSize:"max-"+I[5],client:"clientWidth",crossClient:"clientHeight",scrollEdge:"scrollTop",offset:"offsetWidth",crossOffset:"offsetHeight",offsetPos:"offsetLeft",scroll:"scrollLeft",scrollSize:"scrollWidth"}},Z=17,ee=15,B=/[\s\S]*Macintosh[\s\S]*\) Gecko[\s\S]*/,K=B.test(l.navigator&&l.navigator.userAgent),T,ae,ge;function X(O){var le=!!O,re=O&&O[0]||O,W=typeof O=="string"||re instanceof HTMLElement,q=W?{root:O}:E(O),Ce,ve,Ne={direction:"v",barOnCls:"_scrollbar",resizeDebounce:0,event:m,cssGuru:!1,impact:"scroller",position:"static"};q=q||{};for(var De in Ne)q[De]==null&&(q[De]=Ne[De]);Ce=this&&this instanceof l.jQuery,q._chain?ve=q.root:Ce?q.root=ve=this[0]:ve=p(q.root||q.scroller);var ke=ue(ve,q.direction),V=+ke;if(q.index=V,V==V&&ke!==null&&ne[V])return ne[V];q.root&&q.scroller?q.scroller=p(q.scroller,ve):q.scroller=ve,q.root=ve;var z=F(q);return z.autoUpdate&&z.autoUpdate(),z}function ce(O,le){var re=0,W=O;for((W.length===void 0||W===l)&&(W=[W]);W[re];)le.call(this,W[re],re),re++}function pe(){return new Date().getTime()}function D(O,le,re){O._eventHandlers=O._eventHandlers||[{element:O.scroller,handler:function(W){O.scroll(W)},type:"scroll"},{element:O.root,handler:function(){O.update()},type:"transitionend animationend"},{element:O.scroller,handler:function(){O.update()},type:"keyup"},{element:O.bar,handler:function(W){W.preventDefault(),O.selection(),O.drag.now=1,O.draggingCls&&C(O.root,O.draggingCls)},type:"touchstart mousedown"},{element:document,handler:function(){O.selection(1),O.drag.now=0,O.draggingCls&&h(O.root,O.draggingCls)},type:"mouseup blur touchend"},{element:document,handler:function(W){W.button!=2&&O._pos0(W)},type:"touchstart mousedown"},{element:document,handler:function(W){O.drag.now&&O.drag(W)},type:"mousemove touchmove"},{element:l,handler:function(){O.update()},type:"resize"},{element:O.root,handler:function(){O.update()},type:"sizeChange"},{element:O.clipper,handler:function(){O.clipperOnScroll()},type:"scroll"}],ce(O._eventHandlers,function(W){if(W.element)if(W.element.length&&W.element!==l)for(var q=0;q<W.element.length;q++)le(W.element[q],W.type,W.handler,re);else le(W.element,W.type,W.handler,re)})}function ue(O,le,re,W){var q="data-baron-"+le+"-id";return re=="on"?O.setAttribute(q,W):re=="off"&&O.removeAttribute(q),O.getAttribute(q)}function F(O){var le=new X.prototype.constructor(O);return D(le,O.event,"on"),ue(le.root,O.direction,"on",ne.length),ne.push(le),le.update(),le}function me(O){if(this.events&&this.events[O])for(var le=0;le<this.events[O].length;le++){var re=Array.prototype.slice.call(arguments,1);this.events[O][le].apply(this,re)}}X.prototype={_debounce:function(O,le){var re=this,W,q,Ce=function(){if(re._disposed){clearTimeout(W),W=re=null;return}var ve=pe()-q;ve<le&&ve>=0?W=setTimeout(Ce,le-ve):(W=null,O())};return function(){q=pe(),W||(W=setTimeout(Ce,le))}},constructor:function(O){var le,re,W,q,Ce,ve,Ne;ve=pe(),this.params=O,this.event=O.event,this.events={},this.root=O.root,this.scroller=p(O.scroller),this.bar=p(O.bar,this.root),W=this.track=p(O.track,this.root),!this.track&&this.bar&&(W=this.bar.parentNode),this.clipper=this.scroller.parentNode,this.direction=O.direction,this.rtl=O.rtl,this.origin=ie[this.direction],this.barOnCls=O.barOnCls,this.scrollingCls=O.scrollingCls,this.draggingCls=O.draggingCls,this.impact=O.impact,this.position=O.position,this.rtl=O.rtl,this.barTopLimit=0,this.resizeDebounce=O.resizeDebounce;function De(R){var he=this.barMinSize||20,U=R;U>0&&U<he&&(U=he),this.bar&&g(this.bar,this.origin.size,parseInt(U,10)+"px")}function ke(R){if(this.bar){var he=g(this.bar,this.origin.pos),U=+R+"px";U&&U!=he&&g(this.bar,this.origin.pos,U)}}function V(){return W[this.origin.client]-this.barTopLimit-this.bar[this.origin.offset]}function z(R){return R*V.call(this)+this.barTopLimit}function P(R){return(R-this.barTopLimit)/V.call(this)}this.cursor=function(R){return R["client"+this.origin.x]||(((R.originalEvent||R).touches||{})[0]||{})["page"+this.origin.x]};function H(){return!1}if(this.pos=function(R){var he="page"+this.origin.x+"Offset",U=this.scroller[he]?he:this.origin.scroll;return R!==void 0&&(this.scroller[U]=R),this.scroller[U]},this.rpos=function(R){var he=this.scroller[this.origin.scrollSize]-this.scroller[this.origin.client],U;return R?U=this.pos(R*he):U=this.pos(),U/(he||1)},this.barOn=function(R){if(this.barOnCls){var he=this.scroller[this.origin.client]>=this.scroller[this.origin.scrollSize];R||he?o(this.root,this.barOnCls)&&h(this.root,this.barOnCls):o(this.root,this.barOnCls)||C(this.root,this.barOnCls)}},this._pos0=function(R){re=this.cursor(R)-le},this.drag=function(R){var he=P.call(this,this.cursor(R)-re),U=this.scroller[this.origin.scrollSize]-this.scroller[this.origin.client];this.scroller[this.origin.scroll]=he*U},this.selection=function(R){this.event(document,"selectpos selectstart",H,R?"off":"on")},this.resize=function(){var R=this,he=R.resizeDebounce===void 0?300:R.resizeDebounce,U=0;pe()-ve<he&&(clearTimeout(q),U=he);function Ue(){var Ge=R.scroller[R.origin.crossOffset],Se=R.scroller[R.origin.crossClient],et=0,He,Fe;if(K?et=ee:Se>0&&Ge===0&&(Ge=Se+Z),Ge)if(R.barOn(),R.impact=="scroller"){var tt=Ge-Se+et;if(R.position=="static")He=g(R.scroller,R.origin.crossSize),Fe=R.clipper[R.origin.crossClient]+tt+"px",He!=Fe&&R._setCrossSizes(R.scroller,Fe);else{var nt={},it=R.rtl?"Left":"Right";R.direction=="h"&&(it="Bottom"),nt["padding"+it]=tt+"px",g(R.scroller,nt)}}else He=g(R.clipper,R.origin.crossSize),Fe=Se+"px",He!=Fe&&R._setCrossSizes(R.clipper,Fe);Array.prototype.unshift.call(arguments,"resize"),me.apply(R,arguments),ve=pe()}U?q=setTimeout(Ue,U):Ue()},this.updatePositions=function(R){var he,U=this;U.bar&&(he=(W[U.origin.client]-U.barTopLimit)*U.scroller[U.origin.client]/U.scroller[U.origin.scrollSize],(R||parseInt(Ne,10)!=parseInt(he,10))&&(De.call(U,he),Ne=he),le=z.call(U,U.rpos()),ke.call(U,le)),Array.prototype.unshift.call(arguments,"scroll"),me.apply(U,arguments)},this.scroll=function(){var R=this;R.updatePositions(),R.scrollingCls&&(Ce||C(R.root,R.scrollingCls),clearTimeout(Ce),Ce=setTimeout(function(){h(R.root,R.scrollingCls),Ce=void 0},300))},this.clipperOnScroll=function(){this.rtl?this.clipper[this.origin.scrollEdge]=this.clipper[this.origin.scrollSize]:this.clipper[this.origin.scrollEdge]=0},this._setCrossSizes=function(R,he){var U={};U[this.origin.crossSize]=he,U[this.origin.crossMinSize]=he,U[this.origin.crossMaxSize]=he,g(R,U)},this._dumbCss=function(R){if(!O.cssGuru){var he=R?"hidden":null,U=R?"none":null;g(this.clipper,{overflow:he,msOverflowStyle:U,position:this.position=="static"?"":"relative"});var Ue=R?"scroll":null,Ge=this.direction=="v"?"y":"x",Se={};Se["overflow-"+Ge]=Ue,Se["box-sizing"]="border-box",Se.margin="0",Se.border="0",this.position=="absolute"&&(Se.position="absolute",Se.top="0",this.direction=="h"?Se.left=Se.right="0":(Se.bottom="0",Se.right=this.rtl?"0":"",Se.left=this.rtl?"":"0")),g(this.scroller,Se)}},this._dumbCss(!0),K){var J="paddingRight",se={},te=l.getComputedStyle(this.scroller)[[J]];O.direction=="h"?J="paddingBottom":O.rtl&&(J="paddingLeft");var be=parseInt(te,10);be!=be&&(be=0),se[J]=ee+be+"px",g(this.scroller,se)}return this},update:function(O){return me.call(this,"upd",O),this.resize(1),this.updatePositions(1),this},dispose:function(){D(this,this.event,"off"),ue(this.root,this.params.direction,"off"),this.params.direction=="v"?this._setCrossSizes(this.scroller,""):this._setCrossSizes(this.clipper,""),this._dumbCss(!1),this.barOn(!0),me.call(this,"dispose"),ne[this.params.index]=null,this.params=null,this._disposed=!0},on:function(O,le,re){for(var W=O.split(" "),q=0;q<W.length;q++)W[q]=="init"?le.call(this,re):(this.events[W[q]]=this.events[W[q]]||[],this.events[W[q]].push(function(Ce){le.call(this,Ce||re)}))},baron:function(O){return O.root=this.params.root,O.scroller=this.params.scroller,O.direction=this.params.direction=="v"?"h":"v",O._chain=!0,X(O)}},X.prototype.constructor.prototype=X.prototype,X.noConflict=function(){return l.baron=S,X},X.version="3.0.1",X.prototype.autoUpdate=a(12582)(l),X.prototype.fix=a(41197),X.prototype.controls=a(69786),u.exports=X},41197:(u,A,a)=>{"use strict";var s=a(37420),l=a(69079).AH,m=a(69079).WQ,g=a(69079).rm;u.exports=function(o){var h,E,p={outside:"",inside:"",before:"",after:"",past:"",future:"",radius:0,minView:0},S=[],I=[],ne=[],ie=this.scroller,Z=this.event,ee=this;function B(X,ce,pe){var D=ce,ue=pe==1?"pos":"oppos";E<(p.minView||0)&&(D=void 0),l(h[X],this.origin.pos,""),l(h[X],this.origin.oppos,""),g(h[X],p.outside),D!==void 0&&(D+="px",l(h[X],this.origin[ue],D),m(h[X],p.outside))}function K(X){try{var ce=document.createEvent("WheelEvent");ce.initWebKitWheelEvent(X.originalEvent.wheelDeltaX,X.originalEvent.wheelDeltaY),ie.dispatchEvent(ce),X.preventDefault()}catch{}}function T(X){var ce;for(var pe in X)p[pe]=X[pe];if(p.elements instanceof HTMLElement?h=[p.elements]:typeof p.elements=="string"?h=this.scroller.querySelectorAll(p.elements):p.elements&&p.elements[0]instanceof HTMLElement&&(h=p.elements),h){E=this.scroller[this.origin.client];for(var D=0;D<h.length;D++)ce={},ce[this.origin.size]=h[D][this.origin.offset]+"px",h[D].parentNode!==this.scroller&&l(h[D].parentNode,ce),ce={},ce[this.origin.crossSize]=h[D].parentNode[this.origin.crossClient]+"px",l(h[D],ce),E-=h[D][this.origin.offset],ne[D]=h[D].parentNode[this.origin.offsetPos],S[D]=S[D-1]||0,I[D]=I[D-1]||Math.min(ne[D],0),h[D-1]&&(S[D]+=h[D-1][this.origin.offset],I[D]+=h[D-1][this.origin.offset]),D==0&&ne[D]==0||(this.event(h[D],"mousewheel",K,"off"),this.event(h[D],"mousewheel",K));p.limiter&&h[0]&&(this.track&&this.track!=this.scroller?(ce={},ce[this.origin.pos]=h[0].parentNode[this.origin.offset]+"px",l(this.track,ce)):this.barTopLimit=h[0].parentNode[this.origin.offset],this.scroll()),p.limiter===!1&&(this.barTopLimit=0)}var ue={element:h,handler:function(){for(var me=this.parentNode,O=me.offsetTop,le,re=0;re<h.length;re++)h[re]===this&&(le=re);var W=O-S[le];p.scroll?p.scroll({x1:ee.scroller.scrollTop,x2:W}):ee.scroller.scrollTop=W},type:"click"};if(p.clickable){this._eventHandlers.push(ue);for(var F=0;F<ue.element.length;F++)Z(ue.element[F],ue.type,ue.handler,"on")}}this.on("init",T,o);var ae=[],ge=[];return this.on("init scroll",function(){var X,ce,pe,D;if(h){var ue;for(D=0;D<h.length;D++)X=0,ne[D]-this.pos()<I[D]+p.radius?(X=1,ce=S[D]):ne[D]-this.pos()>I[D]+E-p.radius?(X=2,ce=this.scroller[this.origin.client]-h[D][this.origin.offset]-S[D]-E):(X=3,ce=void 0),pe=!1,(ne[D]-this.pos()<I[D]||ne[D]-this.pos()>I[D]+E)&&(pe=!0),(X!=ae[D]||pe!=ge[D])&&(B.call(this,D,ce,X),ae[D]=X,ge[D]=pe,ue=!0);if(ue)for(D=0;D<h.length;D++)ae[D]==1&&p.past&&(m(h[D],p.past),g(h[D],p.future)),ae[D]==2&&p.future&&(m(h[D],p.future),g(h[D],p.past)),ae[D]==3&&(g(h[D],p.past),g(h[D],p.future),m(h[D],p.inside)),ae[D]!=ae[D+1]&&ae[D]==1?(m(h[D],p.before),g(h[D],p.after)):ae[D]!=ae[D-1]&&ae[D]==2?(m(h[D],p.after),g(h[D],p.before)):(g(h[D],p.before),g(h[D],p.after)),p.grad&&(ge[D]?m(h[D],p.grad):g(h[D],p.grad))}}),this.on("resize upd",function(X){T.call(this,X&&X.fix)}),this}},37420:u=>{u.exports=function(a,s,l){var m=console[a]||console.log,g=["Baron: "+s,l];Function.prototype.apply.call(m,console,g)}},69079:u=>{"use strict";var A,a=!1;try{var s=Object.defineProperty({},"passive",{get:function(){a=!0}});window.addEventListener("test",null,s)}catch{}u.exports.f0=function(g,C,o,h){var E=C.split(" "),p=h=="on"?"add":"remove";E.forEach(function(S){var I=!1;["scroll","touchstart","touchmove"].indexOf(S)!=-1&&a&&(I={passive:!0}),g[p+"EventListener"](S,o,I)})};function l(m,g){for(var C in m)m.hasOwnProperty(C)&&g(C,m[C])}u.exports.AH=function(g,C,o){var h;if(o===void 0){if(typeof C=="string")return g.style[C];h=C}else h={},h[C]=o;l(h,function(E,p){g.style[E]=p})},u.exports.WQ=function(g,C){C&&g.classList.add(C)},u.exports.rm=function(g,C){C&&g.classList.remove(C)},u.exports.zy=function(g,C){return C?g.classList.contains(C):!1},u.exports.o8=function(g){var C={},o=g||{};return l(o,function(h,E){C[h]=E}),C},u.exports.qs=function(g,C){if(g instanceof HTMLElement)return g;var o=C||document;return o.querySelector(g)},A=l},29978:(u,A,a)=>{"use strict";a.d(A,{AngularApp:()=>Zr});var s=a(92747),l=a.n(s),m=a(64423),g=a(52718),C=a(86833),o=a(66308),h=a(91830);const E=`
  <ng-transclude class="panel-height-helper"></ng-transclude>
`;o.m7.directive("grafanaPanel",["$timeout",t=>({restrict:"E",template:E,transclude:!0,scope:{ctrl:"="},link:(e,i)=>{const n=e.ctrl,r=e.ctrl.panel,c=new m.yU;let d;function f(){d&&d.update()}n.events.on(g.ee.componentDidMount,()=>{if(n.__proto__.constructor.scrollable){const b="baron baron__root baron__clipper panel-content--scrollable",N="baron__scroller",v=`
            <div class="baron__track">
              <div class="baron__bar"></div>
            </div>
          `,M=i,L=i.find(":first").find(":first");M.addClass(b),$(v).appendTo(M),L.addClass(N),d=l()({root:M[0],scroller:L[0],bar:".baron__bar",barOnCls:"_scrollbar",scrollingCls:"_scrolling"}),d.scroll()}});function y(){n.height=e.$parent.$parent.size.height,n.width=e.$parent.$parent.size.width}y(),c.add(r.events.subscribe(C._,()=>{y(),n.events.emit("refresh")})),c.add(r.events.subscribe(h.XM,b=>{b.payload?.fromAngular||(y(),t(()=>{f(),n.events.emit("render")}))})),c.add(n.events.subscribe(h.XM,b=>{b.payload&&(b.payload.fromAngular=!0,r.events.publish(b))})),e.$on("$destroy",()=>{i.off(),c.unsubscribe(),n.events.emit(g.ee.panelTeardown),n.events.removeAllListeners(),d&&d.dispose()}),r.events.publish(h.vk)}})]);var p=a(34757),S=a(7025),I=a.n(S);const ne=I().module("grafana.directives"),ie={};ne.directive("panelEditorTab",["dynamicDirectiveSrv",Z]);function Z(t){return t.create({scope:{ctrl:"=",editorTab:"="},directive:e=>{const i=e.ctrl.pluginId,n=e.editorTab.title.toLowerCase().replace(" ","-").replace("&","").replace(" ","").replace(" ","-");if(ie[i]){if(ie[i][n])return ie[i][n]}else ie[i]=[];const r={fn:()=>e.editorTab.directiveFn(),name:`panel-editor-tab-${i}${n}`};return ie[i][n]=r,r}})}class ee{constructor(){this.hasTextEditMode=!1}$onInit(){this.panelCtrl=this.queryCtrl.panelCtrl,this.target=this.queryCtrl.target,this.panel=this.panelCtrl.panel,this.hasTextEditMode&&this.queryCtrl.toggleEditorMode&&(this.panelCtrl.toggleEditorMode=this.queryCtrl.toggleEditorMode.bind(this.queryCtrl)),this.queryCtrl.getCollapsedText&&(this.panelCtrl.getCollapsedText=this.queryCtrl.getCollapsedText.bind(this.queryCtrl))}}o.m7.directive("queryEditorRow",B);function B(){return{restrict:"E",controller:ee,bindToController:!0,controllerAs:"ctrl",templateUrl:"public/app/angular/panel/partials/query_editor_row.html",transclude:!0,scope:{queryCtrl:"=",canCollapse:"=",hasTextEditMode:"="}}}var K=a(96320),T=a(2543),ae=a.n(T),ge=a(3202),X=a(84395);o.Ay.filter("stringSort",()=>t=>t.sort()),o.Ay.filter("slice",()=>(t,e,i)=>(0,T.isUndefined)(t)?t:t.slice(e,i)),o.Ay.filter("stringify",()=>t=>(0,T.isObject)(t)&&!(0,T.isArray)(t)?I().toJson(t):(0,T.isNull)(t)?null:t.toString()),o.Ay.filter("moment",()=>(t,e)=>{switch(e){case"ago":return(0,ge.KQ)(t).fromNow()}return(0,ge.KQ)(t).fromNow()});function ce(t=(0,X.w)()){const e=(i,n)=>{let r;return n.ctrl?r=(n.ctrl.panel||n.ctrl.row).scopedVars:r=n.row.scopedVars,t.replaceWithText(i,r)};return e.$stateful=!0,e}o.Ay.filter("interpolateTemplateVars",ce);const pe={};class D{constructor(){}set(){console.warn("old deprecated alert srv being used")}}o.Ay.service("alertSrv",D);class ue{constructor(e){this.$compile=e}static{this.$inject=["$compile"]}addDirective(e,i,n){const r=I().element(document.createElement(i));this.$compile(r)(n),e.empty(),e.append(r)}link(e,i,n,r){const c=r.directive(e);if(!c||!c.fn){i.empty();return}c.fn.registered||(o.Ay.directive(n.$normalize(c.name),c.fn),c.fn.registered=!0),this.addDirective(i,c.name,e)}create(e){return{restrict:"E",scope:e.scope,link:(n,r,c)=>{if(e.watchPath){let d=null;n.$watch(e.watchPath,()=>{d&&d.$destroy(),d=n.$new(),this.link(d,r,c,e)})}else this.link(n,r,c,e)}}}}o.Ay.service("dynamicDirectiveSrv",ue);var F=a(96540),me=a(5338);function O(t,e){if(I().isFunction(t))return t;if(!t)throw new Error("ReactComponent name attribute must be specified");let i;try{i=e.get(t)}catch{}if(!i)try{i=t.split(".").reduce((n,r)=>n[r],window)}catch{}if(!i)throw Error("Cannot find react component "+t);return i}function le(t,e){if(t.wrappedInApply)return t;const i=function(){const n=arguments,r=e.$root.$$phase;return r==="$apply"||r==="$digest"?t.apply(null,n):e.$apply(()=>t.apply(null,n))};return i.wrappedInApply=!0,i}function re(t,e,i){return Object.keys(t||{}).reduce((n,r)=>{const c=t[r],d=(i||{})[r]||{};return n[r]=I().isFunction(c)&&d.wrapApply!==!1?le(c,e):c,n},{})}function W(t,e,i,n){const r=I().isFunction(e.$watchCollection),c=I().isFunction(e.$watchGroup),d=[];for(const f of i){const y=Ne(f),b=ke(t,f);!y||y.match(/\(.*\)/)||b==="one-time"||(b==="collection"&&r?e.$watchCollection(y,n):b==="reference"&&c?d.push(y):e.$watch(y,n,b!=="reference"))}t==="one-time"&&n(),d.length&&e.$watchGroup(d,n)}function q(t,e,i,n){i.$evalAsync(()=>{n.render(F.createElement(t,e))})}function Ce(t){return Array.isArray(t)?t[0]:t}function ve(t){return Array.isArray(t)?t[1]:{}}function Ne(t){return Array.isArray(t)?t[0]:t}function De(t,e){const i=Object.keys(t).find(n=>n.toLowerCase()===e.toLowerCase()||(0,T.kebabCase)(n)===(0,T.kebabCase)(e));return t[i]}function ke(t,e){return Array.isArray(e)&&I().isObject(e[1])&&e[1].watchDepth||t}const V=t=>({restrict:"E",replace:!0,link:function(e,i,n){const r=O(n.name,t),c=(0,me.H)(i[0]),d=()=>{const f=e.$eval(n.props),y=re(f,e);q(r,y,e,c)};n.props?W(n.watchDepth,e,[n.props],d):d(),e.$on("$destroy",()=>{n.onScopeDestroy?e.$eval(n.onScopeDestroy,{unmountComponent:c.unmount.bind(this)}):c.unmount()})}}),z=t=>(e,i,n,r)=>{const c={restrict:"E",replace:!0,link:function(d,f,y){const b=O(e,t),N=(0,me.H)(f[0]);i=i||Object.keys(b.propTypes||{});const v=()=>{let L={};const G={};i.forEach(de=>{const k=Ce(de);L[k]=d.$eval(De(y,k)),G[k]=ve(de)}),L=re(L,d,G),L=I().extend({},L,r),q(b,L,d,N)},M=i.map(L=>Array.isArray(L)?[De(y,L[0]),ve(L)]:De(y,L));i.length?W(y.watchDepth,d,M,v):v(),d.$on("$destroy",()=>{y.onScopeDestroy?d.$eval(y.onScopeDestroy,{unmountComponent:N.unmount.bind(this)}):N.unmount()})}};return I().extend(c,n)},P=I().module("react",[]);P.directive("reactComponent",["$injector",V]),P.factory("reactDirective",["$injector",z]),o.Ay.service("uiSegmentSrv",["$sce","templateSrv",H]);function H(t,e){const i=this;class n{constructor(c){if(c==="*"||c.value==="*"){this.value="*",this.html=t.trustAsHtml('<i class="fa fa-asterisk"><i>'),this.type=c.type,this.expandable=!0;return}if((0,T.isString)(c)){this.value=c,this.html=t.trustAsHtml(e.highlightVariablesAsHtml(this.value));return}this.text=c.value,this.cssClass=c.cssClass,this.custom=c.custom,this.type=c.type,this.fake=c.fake,this.value=c.value,this.selectMode=c.selectMode,this.expandable=c.expandable,this.html=c.html||t.trustAsHtml(e.highlightVariablesAsHtml(this.value))}}this.getSegmentForValue=function(r,c){return r?this.newSegment(r):this.newSegment({value:c,fake:!0})},this.newSelectMeasurement=()=>new n({value:"select measurement",fake:!0}),this.newFake=(r,c,d)=>new n({value:r,fake:!0,type:c,cssClass:d}),this.newSegment=r=>new n(r),this.newKey=r=>new n({value:r,type:"key",cssClass:"query-segment-key"}),this.newKeyValue=r=>new n({value:r,type:"value",cssClass:"query-segment-value"}),this.newCondition=r=>new n({value:r,type:"condition",cssClass:"query-keyword"}),this.newOperator=r=>new n({value:r,type:"operator",cssClass:"query-segment-operator"}),this.newOperators=r=>(0,T.map)(r,c=>new n({value:c,type:"operator",cssClass:"query-segment-operator"})),this.transformToSegments=(r,c)=>d=>{const f=(0,T.map)(d,y=>i.newSegment({value:y.text,expandable:y.expandable}));return r&&(0,T.each)(e.getVariables(),y=>{(c===void 0||c===y.type)&&f.unshift(i.newSegment({type:"value",value:"$"+y.name,expandable:!0}))}),f},this.newSelectMetric=()=>new n({value:"select metric",fake:!0}),this.newPlusButton=()=>new n({fake:!0,html:'<i class="fa fa-plus "></i>',type:"plus-button",cssClass:"query-part"})}var J=a(66899),se=a.n(J);o.Ay.service("popoverSrv",["$compile","$rootScope","$timeout",te]);function te(t,e,i){let n=null;this.close=()=>{n&&n.close()},this.show=r=>{n&&(n.close(),n=null);const c=(0,T.extend)(e.$new(!0),r.model);let d;const f=()=>{setTimeout(()=>{c.$destroy(),d.tether&&d.destroy(),r.onClose&&r.onClose()}),n=null};c.dismiss=()=>{d.close()};const y=document.createElement("div");return y.innerHTML=r.template,t(y)(c),i(()=>{d=new(se())({target:r.element,content:y,position:r.position,classes:r.classNames||"drop-popover",openOn:r.openOn,hoverCloseDelay:200,tetherOptions:{constraints:[{to:"scrollParent",attachment:"together"}]}}),d.on("close",()=>{f()}),n=d,n.open()},100),()=>{d&&d.close()}}}class be{constructor(e){this.$timeout=e,this.timers=[]}static{this.$inject=["$timeout"]}register(e){return this.timers.push(e),e}cancel(e){this.timers=(0,T.without)(this.timers,e),this.$timeout.cancel(e)}cancelAll(){(0,T.each)(this.timers,e=>{this.$timeout.cancel(e)}),this.timers=[]}}o.Ay.service("timer",be);class R{constructor(e,i){this.$compile=e,this.$rootScope=i}static{this.$inject=["$compile","$rootScope"]}load(e,i,n){const r=this.$rootScope.$new();(0,T.assign)(r,i);const c=this.$compile(n)(r);return I().element(e).append(c),{destroy:()=>{r.$destroy(),c.remove()},digest:()=>{r.$$phase||r.$digest()},getScope:()=>r}}}o.Ay.service("angularLoader",R);var he=a(34796),U=a.n(he);const Ue=U()(window);U().fn.place_tt=(()=>{const t={offset:5};return function(e,i,n){return n=U().extend(!0,{},t,n),this.each(()=>{const r=U()(this);let c,d;r.addClass("grafana-tooltip"),U()("#tooltip").remove(),r.appendTo(document.body),n.compile&&I().element(document).injector().invoke(["$compile","$rootScope",(b,N)=>{const v=N.$new(!0);(0,T.extend)(v,n.scopeData),b(r)(v),v.$digest(),v.$destroy()}]),c=r.outerWidth(!0),d=r.outerHeight(!0);const f=e+n.offset+c>Ue.width()?e-n.offset-c:e+n.offset,y=i+n.offset+d>Ue.height()?i-n.offset-d:i+n.offset;r.css("left",f>0?f:0),r.css("top",y>0?y:0)})}})();function Ge(t){const e='<input type="text" class="gf-form-input input-medium tight-form-input" spellcheck="false" style="display:none"></input>',i='<a class="gf-form-label tight-form-func dropdown-toggle" tabindex="1" gf-dropdown="menuItems" data-toggle="dropdown" ><i class="fa fa-plus"></i></a>';return{scope:{menuItems:"=dropdownTypeahead",dropdownTypeaheadOnSelect:"&dropdownTypeaheadOnSelect",model:"=ngModel"},link:(n,r,c)=>{const d=U()(e),f=U()(i);d.appendTo(r),f.appendTo(r),c.linkText&&f.html(c.linkText),c.ngModel&&n.$watch("model",N=>{(0,T.each)(n.menuItems,v=>{(0,T.each)(v.submenu,M=>{M.value===N&&f.html(M.text)})})});const y=(0,T.reduce)(n.menuItems,(N,v,M)=>(v.submenu?(0,T.each)(v.submenu,(L,G)=>{L.click="menuItemSelected("+M+","+G+")",N.push(v.text+" "+L.text)}):(v.click="menuItemSelected("+M+")",N.push(v.text)),N),[]),b=()=>{d.hide(),d.val(""),f.show(),f.focus(),r.removeClass("open")};n.menuItemSelected=(N,v)=>{const M=n.menuItems[N],L={$item:M};M.submenu&&v!==void 0&&(L.$subItem=M.submenu[v]),n.dropdownTypeaheadOnSelect(L),b()},d.attr("data-provide","typeahead"),d.typeahead({source:y,minLength:1,items:10,updater:N=>{const v={};return(0,T.each)(n.menuItems,M=>{(0,T.each)(M.submenu,L=>{N===M.text+" "+L.text&&(v.$subItem=L,v.$item=M)})}),v.$item&&n.$apply(()=>{n.dropdownTypeaheadOnSelect(v)}),d.trigger("blur"),""}}),f.click(()=>{f.hide(),d.show(),d.focus()}),d.keyup(()=>{r.toggleClass("open",d.val()==="")}),r.mousedown(N=>{N.preventDefault()}),d.blur(()=>{d.hide(),d.val(""),f.show(),f.focus(),setTimeout(()=>{r.removeClass("open")},200)}),t(r.contents())(n)}}}function Se(t){const e='<input type="text" class="gf-form-input" spellcheck="false" style="display:none"></input>',i='<a class="{{buttonTemplateClass}} dropdown-toggle" tabindex="1" gf-dropdown="menuItems" data-toggle="dropdown" ><i class="fa fa-plus"></i></a>';return{scope:{menuItems:"=dropdownTypeahead2",dropdownTypeaheadOnSelect:"&dropdownTypeaheadOnSelect",model:"=ngModel",buttonTemplateClass:"@"},link:(n,r,c)=>{const d=U()(e);n.buttonTemplateClass||(n.buttonTemplateClass="gf-form-input");const f=U()(i),y={blur:null};d.appendTo(r),f.appendTo(r),c.linkText&&f.html(c.linkText),c.ngModel&&n.$watch("model",v=>{(0,T.each)(n.menuItems,M=>{(0,T.each)(M.submenu,L=>{L.value===v&&f.html(L.text)})})});const b=(0,T.reduce)(n.menuItems,(v,M,L)=>(M.submenu?(0,T.each)(M.submenu,(G,de)=>{G.click="menuItemSelected("+L+","+de+")",v.push(M.text+" "+G.text)}):(M.click="menuItemSelected("+L+")",v.push(M.text)),v),[]),N=()=>{d.hide(),d.val(""),f.show(),f.focus(),r.removeClass("open")};n.menuItemSelected=(v,M)=>{const L=n.menuItems[v],G={$item:L};L.submenu&&M!==void 0&&(G.$subItem=L.submenu[M]),n.dropdownTypeaheadOnSelect(G),N()},d.attr("data-provide","typeahead"),d.typeahead({source:b,minLength:1,items:10,updater:v=>{const M={};return(0,T.each)(n.menuItems,L=>{(0,T.each)(L.submenu,G=>{v===L.text+" "+G.text&&(M.$subItem=G,M.$item=L)})}),M.$item&&n.$apply(()=>{n.dropdownTypeaheadOnSelect(M)}),d.trigger("blur"),""}}),f.click(()=>{f.hide(),d.show(),d.focus()}),d.keyup(()=>{r.toggleClass("open",d.val()==="")}),r.mousedown(v=>{v.preventDefault(),y.blur=null}),d.blur(()=>{y.blur=setTimeout(()=>{N()},1)}),t(r.contents())(n)}}}o.Ay.directive("dropdownTypeahead",["$compile",Ge]),o.Ay.directive("dropdownTypeahead2",["$compile",Se]);function et(t){return{link:(e,i)=>{const n=i[0],r=()=>{const d=new Event("change");return n.dispatchEvent(d)},c=({animationName:d})=>{switch(d){case"onAutoFillStart":return r();case"onAutoFillCancel":return r()}return null};n.addEventListener("animationstart",c),e.$on("$destroy",()=>{n.removeEventListener("animationstart",c)})}}}o.Ay.directive("autofillEventFix",["$compile",et]);function He(t,e,i){const n='<input type="text" data-provide="typeahead"  class="gf-form-input input-medium" spellcheck="false" style="display:none"></input>',r='<a class="gf-form-label" ng-class="segment.cssClass" tabindex="1" give-focus="segment.focus" ng-bind-html="segment.html"></a>',c='<a class="gf-form-input gf-form-input--dropdown" ng-class="segment.cssClass" tabindex="1" give-focus="segment.focus" ng-bind-html="segment.html"></a>';return{scope:{segment:"=",getOptions:"&",onChange:"&",debounce:"@"},link:(d,f)=>{const y=U()(n),b=d.segment,N=U()(b.selectMode?c:r);let v=null,M=null,L=!0;const G=d.debounce;y.appendTo(f),N.appendTo(f),d.updateVariableValue=k=>{k===""||b.value===k||d.$apply(()=>{const Q=(0,T.find)(d.altSegments,{value:k});Q?(b.value=Q.value,b.html=Q.html||e.trustAsHtml(i.highlightVariablesAsHtml(Q.value)),b.fake=!1,b.expandable=Q.expandable,Q.type&&(b.type=Q.type)):b.custom!=="false"&&(b.value=k,b.html=e.trustAsHtml(i.highlightVariablesAsHtml(k)),b.expandable=!0,b.fake=!1),d.onChange()})},d.switchToLink=k=>{L&&!k||(clearTimeout(M),M=null,L=!0,y.hide(),N.show(),d.updateVariableValue(y.val()))},d.inputBlur=()=>{M=setTimeout(d.switchToLink,200)},d.source=(k,Q)=>{d.$apply(()=>{d.getOptions({$query:k}).then(Y=>{d.altSegments=Y,v=(0,T.map)(d.altSegments,_=>(0,T.escape)(_.value)),b.custom!=="false"&&!b.fake&&(0,T.indexOf)(v,b.value)===-1&&v.unshift((0,T.escape)(b.value)),Q(v)})})},d.updater=k=>(k=(0,T.unescape)(k),k===b.value?(clearTimeout(M),y.focus(),k):(y.val(k),d.switchToLink(!0),k)),d.matcher=function(k){if(L)return!1;let Q=this.query;Q[0]==="/"&&(Q=Q.substring(1)),Q[Q.length-1]==="/"&&(Q=Q.substring(0,Q.length-1));try{return k.toLowerCase().match(Q.toLowerCase())}catch{return!1}},y.attr("data-provide","typeahead"),y.typeahead({source:d.source,minLength:0,items:1e4,updater:d.updater,matcher:d.matcher});const de=y.data("typeahead");de.lookup=function(){this.query=this.$element.val()||"";const k=this.source(this.query,U().proxy(this.process,this));return k&&this.process(k)},G&&(de.lookup=(0,T.debounce)(de.lookup,500,{leading:!0})),N.keydown(k=>{(k.keyCode===40||k.keyCode===13)&&N.click()}),N.click(()=>{v=null,y.css("width",Math.max(N.width(),80)+16+"px"),N.hide(),y.show(),y.focus(),L=!1;const k=y.data("typeahead");k&&(y.val(""),k.lookup())}),y.blur(d.inputBlur),t(f.contents())(d)}}}function Fe(t){return{template:'<metric-segment segment="segment" get-options="getOptionsInternal()" on-change="onSegmentChange()"></metric-segment>',restrict:"E",scope:{property:"=",options:"=",getOptions:"&",onChange:"&"},link:{pre:function(i,n,r){let c;i.valueToSegment=d=>{const f=(0,T.find)(i.options,{value:d}),y={cssClass:r.cssClass,custom:r.custom,value:f?f.text:d,selectMode:r.selectMode};return t.newSegment(y)},i.getOptionsInternal=()=>i.options?(c=i.options,Promise.resolve((0,T.map)(i.options,d=>({value:d.text})))):i.getOptions().then(d=>(c=d,(0,T.map)(d,f=>f.html?f:{value:f.text}))),i.onSegmentChange=()=>{if(c){const d=(0,T.find)(c,{text:i.segment.value});d&&d.value!==i.property?i.property=d.value:r.custom!=="false"&&(i.property=i.segment.value)}else i.property=i.segment.value;i.$$postDigest(()=>{i.$apply(()=>{i.onChange()})})},i.segment=i.valueToSegment(i.property)}}}}o.Ay.directive("metricSegment",["$compile","$sce","templateSrv",He]),o.Ay.directive("metricSegmentModel",["uiSegmentSrv",Fe]),o.Ay.directive("tip",["$compile",tt]);function tt(t){return{restrict:"E",link:(e,i,n)=>{let r='<i class="grafana-tip fa fa-'+(n.icon||"question-circle")+`" bs-tooltip="'`+i.text().replace(/[\'\"\\{}<>&]/g,c=>"&amp;#"+c.charCodeAt(0)+";")+`'"></i>`;i.replaceWith(t(I().element(r))(e))}}}o.Ay.directive("compile",["$compile",nt]);function nt(t){return{restrict:"A",link:(e,i,n)=>{e.$watch(r=>r.$eval(n.compile),r=>{i.html(r),t(i.contents())(e)})}}}o.Ay.directive("watchChange",it);function it(){return{scope:{onchange:"&watchChange"},link:(t,e)=>{e.on("input",()=>{t.$apply(()=>{t.onchange({inputValue:e.val()})})})}}}o.Ay.directive("editorOptBool",["$compile",Ht]);function Ht(t){return{restrict:"E",link:(e,i,n)=>{const r=n.change?' ng-change="'+n.change+'"':"",c=n.tip?" <tip>"+n.tip+"</tip>":"",f='<div class="editor-option gf-form-checkbox text-center"'+(n.showIf?' ng-show="'+n.showIf+'" ':"")+'> <label for="'+n.model+'" class="small">'+n.text+c+'</label><input class="cr1" id="'+n.model+'" type="checkbox"        ng-model="'+n.model+'"'+r+'       ng-checked="'+n.model+'"></input> <label for="'+n.model+'" class="cr1"></label>';i.replaceWith(t(I().element(f))(e))}}}o.Ay.directive("editorCheckbox",["$compile, $interpolate",Qt]);function Qt(t,e){return{restrict:"E",link:(i,n,r)=>{const c=e(r.text)(i),d=e(r.model)(i),f=r.change?' ng-change="'+r.change+'"':"",y=r.tip?" <tip>"+r.tip+"</tip>":"",b='<label for="'+i.$id+d+'" class="checkbox-label">'+c+y+"</label>";let N='<input class="cr1" id="'+i.$id+d+'" type="checkbox"        ng-model="'+d+'"'+f+'       ng-checked="'+d+'"></input> <label for="'+i.$id+d+'" class="cr1"></label>';N=N+b,n.addClass("gf-form-checkbox"),n.html(t(I().element(N))(i))}}}o.Ay.directive("gfDropdown",["$parse","$compile","$timeout",Yt]);function Yt(t,e,i){function n(r,c){const f=['<ul class="dropdown-menu '+(c==="top"?"dropup":"")+'" role="menu" aria-labelledby="drop1">',"</ul>"];for(let y=0;y<r.length;y++){const b=r[y];if(b.divider){f.splice(y+1,0,'<li class="divider"></li>');continue}let N="<li"+(b.submenu&&b.submenu.length?' class="dropdown-submenu"':"")+'><a tabindex="-1" ng-href="'+(b.href||"")+'"'+(b.click?' ng-click="'+b.click+'"':"")+(b.target?' target="'+b.target+'"':"")+(b.method?' data-method="'+b.method+'"':"")+">"+(b.text||"")+"</a>";b.submenu&&b.submenu.length&&(N+=n(b.submenu).join(`
`)),N+="</li>",f.splice(y+1,0,N)}return f}return{restrict:"EA",scope:!0,link:function(c,d,f){const y=t(f.gfDropdown),b=y(c);i(()=>{const N=d.data("placement");I().element(n(b,N).join("")).insertAfter(d),e(d.next("ul.dropdown-menu"))(c)}),d.addClass("dropdown-toggle").attr("data-toggle","dropdown")}}}o.Ay.directive("bsTooltip",["$parse","$compile",function(t,e){return{restrict:"A",scope:!0,link:function(n,r,c){let d=t(c.bsTooltip),f=d(n);n.$watch(c.bsTooltip,function(b,N){b!==N&&(f=b)}),r.on("show",function(b){U()(".tooltip.in").each(function(){const N=U()(this),v=N.data("tooltip");v&&!v.$element.is(r)&&N.tooltip("hide")})}),r.tooltip({title:function(){return I().isFunction(f)?f.apply(null,arguments):f},html:!0,container:"body"});const y=r.data("tooltip");y.show=function(){const b=U().fn.tooltip.Constructor.prototype.show.apply(this,arguments);return this.tip().data("tooltip",this),b},n._tooltip=function(b){r.tooltip(b)},n.hide=function(){r.tooltip("hide")},n.show=function(){r.tooltip("show")},n.dismiss=n.hide}}}]),o.Ay.directive("bsTypeahead",["$parse",function(t){return{restrict:"A",require:"?ngModel",link:function(i,n,r,c){let d=t(r.bsTypeahead),f=d(i);i.$watch(r.bsTypeahead,function(b,N){b!==N&&(f=b)}),n.attr("data-provide","typeahead"),n.typeahead({source:function(){return I().isFunction(f)?f.apply(null,arguments):f},minLength:r.minLength||1,items:r.item,updater:function(b){return c&&i.$apply(function(){c.$setViewValue(b)}),i.$emit("typeahead-updated",b),b}});const y=n.data("typeahead");y.lookup=function(){let b;return this.query=this.$element.val()||"",this.query.length<this.options.minLength?this.shown?this.hide():this:(b=(0,T.isFunction)(this.source)?this.source(this.query,U().proxy(this.process,this)):this.source,b?this.process(b):this)},r.matchAll&&(y.matcher=function(){return!0}),r.minLength==="0"&&setTimeout(function(){n.on("focus",function(){n.val().length===0&&setTimeout(n.typeahead.bind(n,"lookup"),200)})})}}}]);var Et=a(59577);function Xt(){return{restrict:"A",priority:1,require:"ngModel",link:(t,e,i,n)=>{i.type==="radio"||i.type==="checkbox"||(e.off("input keydown change"),e.bind("blur",()=>{t.$apply(()=>{n.$setViewValue(e.val())})}))}}}function Jt(){return{restrict:"A",require:"ngModel",link:(t,e,i,n)=>{n.$parsers.push(r=>r===""?null:r)}}}function Zt(){return{require:"ngModel",link:(t,e,i,n)=>{n.$validators.integer=(r,c)=>n.$isEmpty(r)||c.indexOf("$")===0||c.indexOf("+$")===0?!0:Et.describeTextRange(c).invalid!==!0}}}o.Ay.directive("ngModelOnblur",Xt),o.Ay.directive("emptyToNull",Jt),o.Ay.directive("validTimeSpan",Zt);var qt=a(27671),ns=a(42346);function bt(t,e){const{color:i,borderColor:n}=(0,qt.MC)(t);e.css("background-color",i),e.css("border-color",n)}function _t(){return{scope:{tagColorFromName:"="},link:(t,e)=>{bt(t.tagColorFromName,e)}}}function en(){function t(e,i){if(i)return I().isFunction(e.$parent[i])?e.$parent[i]:n=>n[i]}return{restrict:"EA",scope:{model:"=ngModel",onTagsUpdated:"&"},template:"<select multiple></select>",replace:!1,link:function(e,i,n){I().isArray(e.model)||(e.model=[]);const r=U()("select",i);n.placeholder&&r.attr("placeholder",n.placeholder),r.tagsinput({typeahead:{source:I().isFunction(e.$parent[n.typeaheadSource])?e.$parent[n.typeaheadSource]:null},widthClass:n.widthClass,itemValue:t(e,n.itemvalue),itemText:t(e,n.itemtext),tagClass:I().isFunction(e.$parent[n.tagclass])?e.$parent[n.tagclass]:()=>n.tagclass}),r.on("itemAdded",c=>{e.model.indexOf(c.item)===-1&&(e.model.push(c.item),e.onTagsUpdated&&e.onTagsUpdated());const d=r.next().children("span").filter(()=>U()(this).text()===c.item);bt(c.item,d)}),r.on("itemRemoved",c=>{const d=e.model.indexOf(c.item);d!==-1&&(e.model.splice(d,1),e.onTagsUpdated&&e.onTagsUpdated())}),e.$watch("model",()=>{I().isArray(e.model)||(e.model=[]),r.tagsinput("removeAll");for(let c=0;c<e.model.length;c++)r.tagsinput("add",e.model[c])},!0)}}}o.Ay.directive("tagColorFromName",_t),o.Ay.directive("bootstrapTagsinput",en);function tn(t){let e=t[0];const i=t[t.length-1];let n;e=e.nextSibling;for(let r=1;e!==i&&e;r++)(n||t[r]!==e)&&(n||(n=U()([].slice.call(t,0,r))),n.push(e)),e=e.nextSibling;return n||t}o.Ay.directive("rebuildOnChange",["$animate",nn]);function nn(t){return{multiElement:!0,terminal:!0,transclude:!0,priority:600,restrict:"E",link:(e,i,n,r,c)=>{let d,f,y;function b(){y&&(y.remove(),y=null),f&&(f.$destroy(),f=null),d&&(y=tn(d.clone),t.leave(y).then(()=>{y=null}),d=null)}e.$watch(n.property,function(v,M){f&&v!==M&&b(),!f&&(v||n.showNull)?c((L,G)=>{f=G,L[L.length++]=document.createComment(" end rebuild on change "),d={clone:L},t.enter(L,i.parent(),i)}):b()})}}}o.Ay.directive("giveFocus",()=>(t,e,i)=>{e.click(n=>{n.stopPropagation()}),t.$watch(i.giveFocus,n=>{n&&setTimeout(()=>{e.focus();const r=e[0];if(r.setSelectionRange){const c=e.val().length*2;r.setSelectionRange(c,c)}},200)},!0)});const is={};class rn{constructor(){const e=()=>{};this.observer=new MutationObserver(e);const i={attributes:!0,attributeFilter:["class"],characterData:!1,childList:!0,subtree:!1};this.observer.observe(I().element(".delta-html")[0],i)}$onDestroy(){this.observer.disconnect()}}function sn(){return{controller:rn,replace:!1,restrict:"A"}}o.Ay.directive("diffDelta",sn);class on{constructor(e,i,n){this.$scope=e,this.$rootScope=i,this.$anchorScroll=n}static{this.$inject=["$scope","$rootScope","$anchorScroll"]}goToLine(e){let i;const n=()=>{this.$anchorScroll(`l${e}`),i()};this.$scope.switchView().then(()=>{i=this.$rootScope.$on("json-diff-ready",n.bind(this))})}}function an(){return{controller:on,controllerAs:"ctrl",replace:!0,restrict:"E",scope:{line:"@lineDisplay",link:"@lineLink",switchView:"&"},template:'<a class="diff-linenum btn btn-inverse btn-small" ng-click="ctrl.goToLine(link)">Line {{ line }}</a>'}}o.Ay.directive("diffLinkJson",an);function ln(){"use strict";return{restrict:"A",require:"ngModel",link:(t,e,i,n)=>{function r(d){return(d||"").split(",")}function c(d){return(0,T.isArray)(d)?(d||"").join(","):d}n.$parsers.push(r),n.$formatters.push(c)}}}o.Ay.directive("arrayJoin",ln);var cn=a(64778),Je=a(79784),un=a(20968),dn=a(57836),hn=a(30446),pn=a(69942),fn=a(30665),mn=a(99153),gn=a(98378),vn=a(93604),yn=a(32370),En=a(77188);function we(t,e,i){o.Ay.directive(t,["reactDirective",n=>n((0,En.e)(e,yn.$.theme2),i)])}var bn=a(96843),xn=a(15832),x=a(74848),Cn=a(32017),Tn=a.n(Cn),ut=a(35095),An=a(55801),xt=a(1667),Sn=a(65164);const Ze={components:{queryEditor:{container:"data-testid cloud-monitoring-query-editor",header:{select:"data-testid cloud-monitoring-header"},visualMetricsQueryEditor:{container:{input:"data-testid cloud-monitoring-visual-metrics-query-editor"}},mqlMetricsQueryEditor:{container:{input:"data-testid cloud-monitoring-mql-query-editor"}},sloQueryEditor:{container:{input:"data-testid cloud-monitoring-slo-query-editor"}},promQlQueryEditor:{container:{input:"data-testid cloud-monitoring-prom-ql-query-editor"}}}}};var Ae=(t=>(t.ANNOTATION="annotation",t.PROMQL="promQL",t.SLO="slo",t.TIME_SERIES_LIST="timeSeriesList",t.TIME_SERIES_QUERY="timeSeriesQuery",t))(Ae||{});const ss={filters:[],groupBys:[],secondaryGroupBys:[]};var Ve=(t=>(t.Delta="delta",t.None="none",t.Rate="rate",t))(Ve||{});const os={filters:[],groupBys:[]};var j=(t=>(t.CUMULATIVE="CUMULATIVE",t.DELTA="DELTA",t.GAUGE="GAUGE",t.METRIC_KIND_UNSPECIFIED="METRIC_KIND_UNSPECIFIED",t))(j||{}),w=(t=>(t.BOOL="BOOL",t.DISTRIBUTION="DISTRIBUTION",t.DOUBLE="DOUBLE",t.INT64="INT64",t.MONEY="MONEY",t.STRING="STRING",t.VALUE_TYPE_UNSPECIFIED="VALUE_TYPE_UNSPECIFIED",t))(w||{}),qe=(t=>(t.ALIGN_COUNT="ALIGN_COUNT",t.ALIGN_COUNT_FALSE="ALIGN_COUNT_FALSE",t.ALIGN_COUNT_TRUE="ALIGN_COUNT_TRUE",t.ALIGN_DELTA="ALIGN_DELTA",t.ALIGN_FRACTION_TRUE="ALIGN_FRACTION_TRUE",t.ALIGN_INTERPOLATE="ALIGN_INTERPOLATE",t.ALIGN_MAX="ALIGN_MAX",t.ALIGN_MEAN="ALIGN_MEAN",t.ALIGN_MIN="ALIGN_MIN",t.ALIGN_NEXT_OLDER="ALIGN_NEXT_OLDER",t.ALIGN_NONE="ALIGN_NONE",t.ALIGN_PERCENTILE_05="ALIGN_PERCENTILE_05",t.ALIGN_PERCENTILE_50="ALIGN_PERCENTILE_50",t.ALIGN_PERCENTILE_95="ALIGN_PERCENTILE_95",t.ALIGN_PERCENTILE_99="ALIGN_PERCENTILE_99",t.ALIGN_PERCENT_CHANGE="ALIGN_PERCENT_CHANGE",t.ALIGN_RATE="ALIGN_RATE",t.ALIGN_STDDEV="ALIGN_STDDEV",t.ALIGN_SUM="ALIGN_SUM",t))(qe||{});const as={filters:[]};var wn=(t=>(t.Aggregations="aggregations",t.Aligners="aligners",t.AlignmentPeriods="alignmentPeriods",t.DefaultProject="defaultProject",t.LabelKeys="labelKeys",t.LabelValues="labelValues",t.MetricTypes="metricTypes",t.Projects="projects",t.ResourceTypes="resourceTypes",t.SLO="slo",t.SLOServices="sloServices",t.Selectors="selectors",t.Services="services",t))(wn||{}),In=a(48583),Ie=a(30048),Ct=a(34128);const dt=({refId:t,value:e="",onChange:i})=>{const[n,r]=(0,F.useState)(e??""),c=(0,T.debounce)(i,1e3),d=f=>{r(f.currentTarget.value),c(f.currentTarget.value)};return(0,x.jsx)(Ie.c,{label:"Alias by",children:(0,x.jsx)(Ct.p,{id:`${t}-alias-by`,value:n,onChange:d})})};var Qe=a(32300),Tt=a(19550),Ln=a(29010);const ls=71,cs=19,us=14,ds=28,At=[{text:"none",value:"ALIGN_NONE",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION,w.STRING,w.VALUE_TYPE_UNSPECIFIED,w.BOOL],metricKinds:[j.GAUGE]},{text:"delta",value:"ALIGN_DELTA",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION],metricKinds:[j.CUMULATIVE,j.DELTA]},{text:"rate",value:"ALIGN_RATE",valueTypes:[w.INT64,w.DOUBLE,w.MONEY],metricKinds:[j.CUMULATIVE,j.DELTA]},{text:"interpolate",value:"ALIGN_INTERPOLATE",valueTypes:[w.INT64,w.DOUBLE,w.MONEY],metricKinds:[j.GAUGE]},{text:"next older",value:"ALIGN_NEXT_OLDER",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION,w.STRING,w.VALUE_TYPE_UNSPECIFIED,w.BOOL],metricKinds:[j.GAUGE]},{text:"min",value:"ALIGN_MIN",valueTypes:[w.INT64,w.DOUBLE,w.MONEY],metricKinds:[j.GAUGE,j.DELTA]},{text:"max",value:"ALIGN_MAX",valueTypes:[w.INT64,w.DOUBLE,w.MONEY],metricKinds:[j.GAUGE,j.DELTA]},{text:"mean",value:"ALIGN_MEAN",valueTypes:[w.INT64,w.DOUBLE,w.MONEY],metricKinds:[j.GAUGE,j.DELTA]},{text:"count",value:"ALIGN_COUNT",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.BOOL],metricKinds:[j.GAUGE,j.DELTA]},{text:"sum",value:"ALIGN_SUM",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA]},{text:"stddev",value:"ALIGN_STDDEV",valueTypes:[w.INT64,w.DOUBLE,w.MONEY],metricKinds:[j.GAUGE,j.DELTA]},{text:"count true",value:"ALIGN_COUNT_TRUE",valueTypes:[w.BOOL],metricKinds:[j.GAUGE]},{text:"count false",value:"ALIGN_COUNT_FALSE",valueTypes:[w.BOOL],metricKinds:[j.GAUGE]},{text:"fraction true",value:"ALIGN_FRACTION_TRUE",valueTypes:[w.BOOL],metricKinds:[j.GAUGE]},{text:"percentile 99",value:"ALIGN_PERCENTILE_99",valueTypes:[w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA]},{text:"percentile 95",value:"ALIGN_PERCENTILE_95",valueTypes:[w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA]},{text:"percentile 50",value:"ALIGN_PERCENTILE_50",valueTypes:[w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA]},{text:"percentile 05",value:"ALIGN_PERCENTILE_05",valueTypes:[w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA]},{text:"percent change",value:"ALIGN_PERCENT_CHANGE",valueTypes:[w.INT64,w.DOUBLE,w.MONEY],metricKinds:[j.GAUGE,j.DELTA]}],Nn=[{text:"none",value:"REDUCE_NONE",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION,w.BOOL,w.STRING],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE,j.METRIC_KIND_UNSPECIFIED]},{text:"mean",value:"REDUCE_MEAN",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE]},{text:"min",value:"REDUCE_MIN",valueTypes:[w.INT64,w.DOUBLE,w.MONEY],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE,j.METRIC_KIND_UNSPECIFIED]},{text:"max",value:"REDUCE_MAX",valueTypes:[w.INT64,w.DOUBLE,w.MONEY],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE,j.METRIC_KIND_UNSPECIFIED]},{text:"sum",value:"REDUCE_SUM",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE,j.METRIC_KIND_UNSPECIFIED]},{text:"std. dev.",value:"REDUCE_STDDEV",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE,j.METRIC_KIND_UNSPECIFIED]},{text:"count",value:"REDUCE_COUNT",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION,w.BOOL,w.STRING],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE]},{text:"count true",value:"REDUCE_COUNT_TRUE",valueTypes:[w.BOOL],metricKinds:[j.GAUGE,j.DELTA]},{text:"count false",value:"REDUCE_COUNT_FALSE",valueTypes:[w.BOOL],metricKinds:[j.GAUGE,j.DELTA]},{text:"99th percentile",value:"REDUCE_PERCENTILE_99",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE]},{text:"95th percentile",value:"REDUCE_PERCENTILE_95",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE]},{text:"50th percentile",value:"REDUCE_PERCENTILE_50",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE]},{text:"5th percentile",value:"REDUCE_PERCENTILE_05",valueTypes:[w.INT64,w.DOUBLE,w.MONEY,w.DISTRIBUTION],metricKinds:[j.GAUGE,j.DELTA,j.CUMULATIVE]}],St=[{text:"grafana auto",value:"grafana-auto"},{text:"stackdriver auto",value:"stackdriver-auto",hidden:!0},{text:"cloud monitoring auto",value:"cloud-monitoring-auto"},{text:"1m",value:"+60s"},{text:"2m",value:"+120s"},{text:"5m",value:"+300s"},{text:"10m",value:"+600s"},{text:"30m",value:"+1800s"},{text:"1h",value:"+3600s"},{text:"3h",value:"+7200s"},{text:"6h",value:"+21600s"},{text:"1d",value:"+86400s"},{text:"3d",value:"+259200s"},{text:"1w",value:"+604800s"}],Dn=[{text:"auto",value:"auto"},{text:"1m",value:"1m"},{text:"2m",value:"2m"},{text:"5m",value:"5m"},{text:"10m",value:"10m"},{text:"30m",value:"30m"},{text:"1h",value:"1h"},{text:"3h",value:"3h"},{text:"6h",value:"6h"},{text:"1d",value:"1d"},{text:"3d",value:"3d"},{text:"1w",value:"1w"}],On=[{text:"1m",value:"1m"},{text:"2m",value:"2m"},{text:"5m",value:"5m"},{text:"10m",value:"10m"},{text:"30m",value:"30m"},{text:"1h",value:"1h"},{text:"3h",value:"3h"},{text:"6h",value:"6h"},{text:"24h",value:"24h"},{text:"72h",value:"72h"}],Mn=["metadata.system_labels.cloud_account","metadata.system_labels.name","metadata.system_labels.region","metadata.system_labels.state","metadata.system_labels.instance_group","metadata.system_labels.node_name","metadata.system_labels.service_name","metadata.system_labels.top_level_controller_type","metadata.system_labels.top_level_controller_name","metadata.system_labels.container_image"],wt="select_slo_burn_rate",It=[{label:"SLI Value",value:"select_slo_health"},{label:"SLO Compliance",value:"select_slo_compliance"},{label:"SLO Error Budget Remaining",value:"select_slo_budget_fraction"},{label:"SLO Burn Rate",value:wt}],Pn=[{label:"Builder",value:Ae.TIME_SERIES_LIST},{label:"MQL",value:Ae.TIME_SERIES_QUERY},{label:"Service Level Objectives (SLO)",value:Ae.SLO},{label:"PromQL",value:Ae.PROMQL}];var Oe=a(44826);function rt({refId:t,projectName:e,datasource:i,onChange:n,templateVariableOptions:r}){const[c,d]=(0,F.useState)([]);(0,F.useEffect)(()=>{i.getProjects().then(y=>d(y))},[i]);const f=(0,F.useMemo)(()=>[{label:"Template Variables",options:r},...c],[c,r]);return(0,x.jsx)(Ie.c,{label:"Project",children:(0,x.jsx)(Oe.l6,{width:"auto",allowCustomValue:!0,formatCreateLabel:y=>`Use project: ${y}`,onChange:({value:y})=>n(y),options:f,value:{value:e,label:e},placeholder:"Select Project",inputId:`${t}-project`})})}var st=a(75349),Lt=a(39736);const hs=t=>uniqBy(t,"service"),kn=(t,e)=>t.filter(i=>i.service===e),ps=(t,e,i,n)=>{const r=kn(t,n).map(y=>({value:y.type,name:y.displayName})),c=r.some(y=>y.value===i),d=r.length?r[0].value:"";return{metricTypes:r,selectedMetricType:c?e:d}},Un=(t,e,i)=>(i&&i===Ve.Rate&&(e=j.GAUGE),t?At.filter(n=>n.valueTypes.indexOf(t)!==-1&&n.metricKinds.indexOf(e)!==-1):[]),jn=(t,e)=>e?Nn.filter(i=>i.valueTypes.indexOf(t)!==-1&&i.metricKinds.indexOf(e)!==-1):[],fs=async(t,e,i)=>{const r=await t.getLabels(e,"handleLabelKeysQuery",i);return[...Object.keys(r),...SYSTEM_LABELS]},ht=(t=w.DOUBLE,e=j.GAUGE,i=qe.ALIGN_MEAN,n)=>{const r=(0,Lt.w)(),c=Un(t,e,n).map(d=>({...d,label:d.text}));return c.some(d=>d.value===r.replace(i))||(i=c.length>0?c[0].value:qe.ALIGN_MEAN),{alignOptions:c,perSeriesAligner:i}},Nt=t=>{const e=t.reduce((i,n)=>{const r=n.split(".").map(T.startCase),c=(r.length===2?r:(0,T.initial)(r)).join(" "),d={value:n,label:n};return i[c]?i[c]=[...i[c],d]:i[c]=[d],i},{});return Object.entries(e).map(([i,n])=>({label:i,options:n,expanded:!0}),[])},Rn=t=>(0,T.chunk)(t,4).map(([e,i,n,r="AND"])=>({key:e,operator:i,value:n,condition:r})),Dt=(t,e)=>{const{perSeriesAligner:i,alignmentPeriod:n}=t;if(!n||!i)return"";const r=At.find(f=>f.value===e.templateSrv.replace(i)),c=parseInt(n,10);return`${Et.secondsToHms(c)} interval (${r?.text??""})`},$n=t=>{const e=t?.filters?.findIndex(n=>n==="metric.type");return t?.filters?.[e+2]||""},Bn=(t,e)=>{if(!t.filters)return t.filters=["metric.type","=",e],t;const i=t?.filters?.findIndex(n=>n==="metric.type");return i===-1?t.filters.push("metric.type","=",e):t.filters[i+2]=e,t},Gn=t=>{const e=Fn(t),i=Vn(e,t);return(0,x.jsx)(Ie.c,{label:"Group by function","data-testid":"cloud-monitoring-aggregation",tooltip:"Aggregation function used on the metric data. Defaults to none for scalar data and mean for distribution data. Not applying an aggregation to distribution data may lead to performance issues.",children:(0,x.jsx)(Oe.l6,{width:"auto",onChange:({value:n})=>t.onChange(n),value:i,options:[{label:"Template Variables",options:t.templateVariableOptions},{label:"Aggregations",expanded:!0,options:e}],placeholder:"Select Reducer",inputId:`${t.refId}-group-by-function`,menuPlacement:"top"})})},Fn=({metricDescriptor:t})=>{const e=t?.valueType,i=t?.metricKind;return(0,F.useMemo)(()=>!e||!i?[]:jn(e,i).map(n=>({...n,label:n.text})),[e,i])},Vn=(t,e)=>(0,F.useMemo)(()=>[...t,...e.templateVariableOptions].find(n=>n.value===e.crossSeriesReducer),[t,e.crossSeriesReducer,e.templateVariableOptions]),zn=({refId:t,labels:e=[],query:i,onChange:n,variableOptionGroup:r,metricDescriptor:c})=>{const d=(0,F.useMemo)(()=>[r,...Nt([...e,...Mn])],[e,r]);return(0,x.jsxs)(st.B,{children:[(0,x.jsx)(Ie.c,{label:"Group by",tooltip:"You can reduce the amount of data returned for a metric by combining different time series. To combine multiple time series, you can specify a grouping and a function. Grouping is done on the basis of labels. The grouping function is used to combine the time series in the group into a single time series.",children:(0,x.jsx)(Oe.KF,{allowCustomValue:!0,inputId:`${t}-group-by`,width:"auto",placeholder:"Choose label",options:d,value:i.groupBys??[],onChange:f=>{n({...i,groupBys:f.map(y=>y.value)})},menuPlacement:"top"})}),(0,x.jsx)(Gn,{metricDescriptor:c,templateVariableOptions:r.options,crossSeriesReducer:i.crossSeriesReducer,groupBys:i.groupBys??[],onChange:f=>n({...i,crossSeriesReducer:f}),refId:t})]})},Wn=({inputId:t,query:e,templateVariableOptions:i,onChange:n,metricDescriptor:r,preprocessor:c})=>{const{perSeriesAligner:d}=e;let{valueType:f,metricKind:y}=r||{};const{perSeriesAligner:b,alignOptions:N}=(0,F.useMemo)(()=>ht(f,y,d,c),[f,y,d,c]);return(0,x.jsx)(Oe.l6,{onChange:({value:v})=>n({...e,perSeriesAligner:v}),value:[...N,...i].find(v=>v.value===b),options:[{label:"Template Variables",options:i},{label:"Alignment options",expanded:!0,options:N}],placeholder:"Select Alignment",inputId:t,menuPlacement:"top"})};function pt({inputId:t,templateVariableOptions:e,onChange:i,current:n,disabled:r,aligmentPeriods:c}){const d=(0,F.useMemo)(()=>c.map(y=>({...y,label:y.text})),[c]),f=(0,F.useMemo)(()=>d.filter(y=>!y.hidden),[d]);return(0,x.jsx)(Oe.l6,{width:"auto",onChange:({value:y})=>i(y),value:[...d,...e].find(y=>y.value===n),options:[{label:"Template Variables",options:e},{label:"Aggregations",expanded:!0,options:f}],placeholder:"Select Period",inputId:t,disabled:r,allowCustomValue:!0,menuPlacement:"top"})}const Kn=({refId:t,templateVariableOptions:e,onChange:i,query:n,customMetaData:r,datasource:c,metricDescriptor:d,preprocessor:f})=>{const y=(0,F.useMemo)(()=>Dt(r,c),[r,c]);return(0,x.jsxs)(st.B,{children:[(0,x.jsx)(Ie.c,{label:"Alignment function",tooltip:"The process of alignment consists of collecting all data points received in a fixed length of time, applying a function to combine those data points, and assigning a timestamp to the result.",children:(0,x.jsx)(Wn,{inputId:`${t}-alignment-function`,templateVariableOptions:e,query:n,onChange:b=>i({...n,...b}),metricDescriptor:d,preprocessor:f})}),(0,x.jsx)(Ie.c,{label:"Alignment period",tooltip:y,children:(0,x.jsx)(pt,{inputId:`${t}-alignment-period`,templateVariableOptions:e,current:n.alignmentPeriod,onChange:b=>i({...n,alignmentPeriod:b}),aligmentPeriods:St})})]})};var Hn=a(20301),Qn=a(26774);const ft="=",Ot="AND",Yn=t=>t.flatMap(({key:e,operator:i,value:n,condition:r})=>[e,i,n,r]).slice(0,-1),Xn=["=","!=","=~","!=~"].map(ut.z),Mt=["metric.type"],Jn=({labels:t={},filters:e,onChange:i,variableOptionGroup:n})=>{const r=Rn(e),c=r.filter(({key:v})=>!Mt.includes(v)),d=r.filter(({key:v})=>Mt.includes(v)),f=(0,F.useMemo)(()=>[n,...Nt(Object.keys(t))],[t,n]),y=({key:v="",value:M=""})=>{f.some(k=>k.options?f.some(Q=>Q.label===v):k.label===v)||f.push({label:v,value:v});const G=t.hasOwnProperty(v)?[n,...t[v].map(ut.z)]:[n];return G.some(k=>k.label===M)||G.push({label:M,value:M}),{options:f,valueOptions:G}},b=v=>{const M=v.concat(d).map(({key:L,operator:G,value:de,condition:k})=>({key:L||"",operator:G||ft,value:de||"",condition:k||Ot}));i(Yn(M))},N=(v,M,L)=>{const{key:G="",operator:de=ft,value:k="",condition:Q=Ot}=v,{options:Y,valueOptions:_}=y(v);return(0,x.jsxs)(Tt.Gy,{spacing:"xs",width:"auto",children:[(0,x.jsx)(Oe.l6,{"aria-label":"Filter label key",formatCreateLabel:oe=>`Use label key: ${oe}`,allowCustomValue:!0,value:G,options:Y,onChange:({value:oe=""})=>M({key:oe,operator:de,value:k,condition:Q})}),(0,x.jsx)(Oe.l6,{value:de,options:Xn,onChange:({value:oe=ft})=>M({key:G,operator:oe,value:k,condition:Q})}),(0,x.jsx)(Oe.l6,{"aria-label":"Filter label value",placeholder:"add filter value",formatCreateLabel:oe=>`Use label value: ${oe}`,allowCustomValue:!0,value:k,options:_,onChange:({value:oe=""})=>M({key:G,operator:de,value:oe,condition:Q})}),(0,x.jsx)(Hn.Z,{"aria-label":"Remove",icon:"times",variant:"secondary",onClick:L,type:"button"})]})};return(0,x.jsx)(Qe.U,{children:(0,x.jsx)(Ie.c,{label:"Filter",tooltip:"To reduce the amount of data charted, apply a filter. A filter has three components: a label, a comparison, and a value. The comparison can be an equality, inequality, or regular expression.",children:(0,x.jsx)(Qn.o,{items:c,renderItem:N,onChange:b})})})},ms=()=>jsx(Alert,{severity:"info",title:"Annotation Query Format",children:jsxs("div",{children:[jsxs("p",{children:["An annotation is an event that is overlaid on top of graphs. Annotation rendering is expensive so it is important to limit the number of rows returned."," "]}),jsx("p",{children:"The Title and Text fields support templating and can use data returned from the query. For example, the Title field could have the following text:"}),jsxs("code",{children:["{{metric.type}}"," has value: ","{{metric.value}}"]}),jsxs("p",{children:["Example Result: ",jsx("code",{children:"monitoring.googleapis.com/uptime_check/http_status has this value: 502"})]}),jsx("span",{children:"Patterns:"}),jsxs("p",{children:[jsx("code",{children:"{{metric.value}}"})," = value of the metric/point"]}),jsxs("p",{children:[jsx("code",{children:"{{metric.type}}"})," = metric type e.g. compute.googleapis.com/instance/cpu/usage_time"]}),jsxs("p",{children:[jsx("code",{children:"{{metric.name}}"})," = name part of metric e.g. instance/cpu/usage_time"]}),jsxs("p",{children:[jsx("code",{children:"{{metric.service}}"})," = service part of metric e.g. compute"]}),jsxs("p",{children:[jsx("code",{children:"{{metric.label.label_name}}"})," = Metric label metadata e.g. metric.label.instance_name"]}),jsxs("p",{children:[jsx("code",{children:"{{resource.label.label_name}}"})," = Resource label metadata e.g. resource.label.zone"]})]})}),Zn=({refId:t,current:e,templateVariableOptions:i,onChange:n})=>{const r=On.map(d=>({...d,label:d.text}));e&&!r.find(d=>d.value===e)&&r.push({label:e,text:e,value:e,hidden:!1});const c=r.filter(d=>!d.hidden);return(0,x.jsx)(Ie.c,{label:"Lookback period",htmlFor:`${t}-lookback-period`,children:(0,x.jsx)(Oe.l6,{inputId:`${t}-lookback-period`,width:"auto",allowCustomValue:!0,value:[...r,...i].find(d=>d.value===e),options:[{label:"Template Variables",options:i},{label:"Predefined periods",expanded:!0,options:c}],onChange:({value:d})=>n(d)})})},qn=({refId:t,query:e,templateVariableOptions:i,onChange:n,datasource:r})=>{const[c,d]=(0,F.useState)([]),{projectName:f,serviceId:y}=e;return(0,F.useEffect)(()=>{!f||!y||r.getServiceLevelObjectives(f,y).then(b=>{d([{label:"Template Variables",options:i},...b])})},[r,f,y,i]),(0,x.jsx)(Ie.c,{label:"SLO",children:(0,x.jsx)(Oe.l6,{inputId:`${t}-slo`,width:"auto",allowCustomValue:!0,value:e?.sloId&&{value:e?.sloId,label:e?.sloName||e?.sloId},placeholder:"Select SLO",options:c,onChange:async({value:b="",label:N=""})=>{const M=(await r.getServiceLevelObjectives(f,y)).find(({value:L})=>L===r.templateSrv.replace(b));n({...e,sloId:b,sloName:N,goal:M?.goal})}})})},_n=({refId:t,query:e,templateVariableOptions:i,onChange:n,datasource:r})=>(0,x.jsx)(Ie.c,{label:"Selector",htmlFor:`${t}-slo-selector`,children:(0,x.jsx)(Oe.l6,{inputId:`${t}-slo-selector`,width:"auto",allowCustomValue:!0,value:[...It,...i].find(c=>c.value===e?.selectorName),options:[{label:"Template Variables",options:i},...It],onChange:({value:c})=>n({...e,selectorName:c??""})})}),ei=({refId:t,query:e,templateVariableOptions:i,onChange:n,datasource:r})=>{const[c,d]=(0,F.useState)([]),{projectName:f}=e;return(0,F.useEffect)(()=>{f&&r.getSLOServices(f).then(y=>{d([{label:"Template Variables",options:i},...y])})},[r,f,i]),(0,x.jsx)(Ie.c,{label:"Service",children:(0,x.jsx)(Oe.l6,{inputId:`${t}-slo-service`,width:"auto",allowCustomValue:!0,value:e?.serviceId&&{value:e?.serviceId,label:e?.serviceName||e?.serviceId},placeholder:"Select service",options:c,onChange:({value:y="",label:b=""})=>n({...e,serviceId:y,serviceName:b,sloId:""})})})},ti=t=>({projectName:t.getDefaultProject(),alignmentPeriod:"cloud-monitoring-auto",perSeriesAligner:qe.ALIGN_MEAN,aliasBy:"",selectorName:"select_slo_health",serviceId:"",serviceName:"",sloId:"",sloName:"",lookbackPeriod:""});function ni({refId:t,query:e,datasource:i,onChange:n,variableOptionGroup:r,customMetaData:c,aliasBy:d,onChangeAliasBy:f}){const y=(0,F.useMemo)(()=>Dt(c,i),[c,i]);return(0,x.jsx)("span",{"data-testid":Ze.components.queryEditor.sloQueryEditor.container.input,children:(0,x.jsxs)(Qe.U,{children:[(0,x.jsx)(rt,{refId:t,templateVariableOptions:r.options,projectName:e.projectName,datasource:i,onChange:b=>n({...e,projectName:b})}),(0,x.jsx)(ei,{refId:t,datasource:i,templateVariableOptions:r.options,query:e,onChange:n}),(0,x.jsx)(qn,{refId:t,datasource:i,templateVariableOptions:r.options,query:e,onChange:n}),(0,x.jsx)(_n,{refId:t,datasource:i,templateVariableOptions:r.options,query:e,onChange:n}),e.selectorName===wt&&(0,x.jsx)(Zn,{refId:t,onChange:b=>n({...e,lookbackPeriod:b}),current:e.lookbackPeriod,templateVariableOptions:r.options}),(0,x.jsx)(st.B,{children:(0,x.jsx)(Ie.c,{label:"Alignment period",tooltip:y,children:(0,x.jsx)(pt,{inputId:`${t}-alignment-period`,templateVariableOptions:r.options,current:e.alignmentPeriod,onChange:b=>n({...e,alignmentPeriod:b}),aligmentPeriods:St})})}),(0,x.jsx)(dt,{refId:t,value:d,onChange:f})]})})}var Pt=a(50926);function ii({query:t,onChange:e,onRunQuery:i}){const n=r=>{r.key==="Enter"&&(r.shiftKey||r.ctrlKey)&&(r.preventDefault(),i())};return(0,x.jsx)("span",{"data-testid":Ze.components.queryEditor.mqlMetricsQueryEditor.container.input,children:(0,x.jsx)(Pt.f,{name:"Query",className:"slate-query-field",value:t,rows:10,placeholder:"Enter a Cloud Monitoring MQL query (Run with Shift+Enter)",onBlur:i,onChange:r=>e(r.currentTarget.value),onKeyDown:n})})}const gs=({label:t,onChange:e,value:i,options:n,allowCustomValue:r=!1})=>jsx(Field,{label:t,children:jsx(Select,{width:25,allowCustomValue:r,value:i,onChange:({value:c})=>e(c),options:n})});var Be=a(22803),ri=a(76459),si=a.n(ri),oi=a(56276),ot=a(29675),ai=a(74162),li=a(60641);const kt={label:"None",value:Ve.None},ci=({query:t,metricDescriptor:e,onChange:i})=>{const n=ui(e);return(0,x.jsx)(Ie.c,{label:"Pre-processing",tooltip:"Preprocessing options are displayed when the selected metric has a metric kind of delta or cumulative. The specific options available are determined by the metric's value type. If you select 'Rate', data points are aligned and converted to a rate per time series. If you select 'Delta', data points are aligned by their delta (difference) per time series",children:(0,x.jsx)(li.z,{onChange:r=>{const{perSeriesAligner:c}=t,{valueType:d,metricKind:f}=e??{},{perSeriesAligner:y}=ht(d,f,c,r);i({...t,preprocessor:r,perSeriesAligner:y})},value:t.preprocessor??Ve.None,options:n})})},ui=t=>{const e=t?.metricKind,i=t?.valueType;return(0,F.useMemo)(()=>{if(!e||e===j.GAUGE||i===w.DISTRIBUTION)return[kt];const n=[kt,{label:"Rate",value:Ve.Rate,description:"Data points are aligned and converted to a rate per time series"}];return e===j.CUMULATIVE?[...n,{label:"Delta",value:Ve.Delta,description:"Data points are aligned by their delta (difference) per time series"}]:n},[e,i])};function di({refId:t,onChange:e,datasource:i,query:n,variableOptionGroup:r,customMetaData:c,aliasBy:d,onChangeAliasBy:f,range:y}){const[b,N]=(0,F.useState)({}),[v,M]=(0,F.useState)([]),[L,G]=(0,F.useState)(),[de,k]=(0,F.useState)([]),[Q,Y]=(0,F.useState)([]),[_,oe]=(0,F.useState)(""),[Ee,fe]=(0,F.useState)({...y});(ye=>{Ee!==null&&(Ee.raw.from.toString()!==ye.raw.from.toString()||Ee.raw.to.toString()!==ye.raw.to.toString())&&fe({...ye})})(y);const We=(0,ot.$j)(),Me=(0,ai.J)(We),Re=(0,ot.of)(hi),{projectName:$e,groupBys:zt,crossSeriesReducer:Wt}=n,ze=$n(n),{templateSrv:at}=i,lt=(0,F.useCallback)((ye,Te)=>ye.find(xe=>xe.type===at.replace(Te)),[at]);(0,F.useEffect)(()=>{$e&&ze&&i.getLabels(ze,t,$e,{groupBys:zt,crossSeriesReducer:Wt},Ee).then(ye=>N(ye))},[i,zt,ze,$e,t,Wt,Ee]),(0,F.useEffect)(()=>{(async()=>{if($e){const Te=await i.getMetricTypes($e);(0,oi.rR)("cloud-monitoring-metric-descriptors-loaded",{count:Te.length});const xe=_r(Te);M(Te),Y(xe)}})()},[i,$e,Re,Me.optionDescription]),(0,F.useEffect)(()=>{const Te=(Xe=>{const ct=lt(Xe,ze);return ct?Xe.filter(Ke=>Ke.service===ct.service).map(Ke=>({service:Ke.service,value:Ke.type,label:Ke.displayName,component:function(){return(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:Re,children:Ke.type}),(0,x.jsx)("div",{className:Me.optionDescription,children:Ke.description})]})}})):[]})(v),xe=Te.length>0?Te[0].service:"",Pe=lt(v,ze);G(Pe),k(Te),oe(xe)},[v,lt,ze,Re,Me.optionDescription]);const qr=({value:ye})=>{const Te=v.filter(xe=>xe.service===at.replace(ye)).map(xe=>({service:xe.service,value:xe.type,label:xe.displayName,description:xe.description}));n.filters=[],Te.length>0&&!Te.some(xe=>xe.value===at.replace(ze))?(Kt(Te[0]),oe(ye),k(Te)):(oe(ye),k(Te))},_r=ye=>{const Te=ye.map(xe=>({value:xe.service,label:(0,T.startCase)(xe.serviceShortName)}));return Te.length>0?(0,T.uniqBy)(Te,xe=>xe.value):[]},es=async ye=>{const xe=(await i.filterMetricsByType($e,_)).filter(Pe=>Pe.type.includes(ye.toLowerCase())).map(Pe=>({value:Pe.type,label:Pe.displayName,component:function(){return(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:Re,children:Pe.type}),(0,x.jsx)("div",{className:Me.optionDescription,children:Pe.description})]})}}));return[{label:"Template Variables",options:r.options},...xe]},ts=si()(es,400),Kt=({value:ye})=>{const Te=lt(v,ye);G(Te);const{metricKind:xe,valueType:Pe}=Te,Xe=xe===j.GAUGE||Pe===w.DISTRIBUTION?Ve.None:Ve.Rate,{perSeriesAligner:ct}=ht(Pe,xe,n.perSeriesAligner,Xe);Object.assign(n,{...mt(i),crossSeriesReducer:Pe===w.DISTRIBUTION?"REDUCE_MEAN":"REDUCE_NONE",projectName:n.projectName,filters:n.filters}),e({...Bn({...n,perSeriesAligner:ct},ye),preprocessor:Xe})};return(0,x.jsxs)("span",{"data-testid":Ze.components.queryEditor.visualMetricsQueryEditor.container.input,children:[(0,x.jsx)(Qe.U,{children:(0,x.jsxs)(st.B,{children:[(0,x.jsx)(rt,{refId:t,templateVariableOptions:r.options,projectName:$e,datasource:i,onChange:ye=>{e({...n,projectName:ye})}}),(0,x.jsx)(Ie.c,{label:"Service",width:"auto",children:(0,x.jsx)(Oe.l6,{width:"auto",onChange:qr,isLoading:Q.length===0,value:[...Q,...r.options].find(ye=>ye.value===_),options:[{label:"Template Variables",options:r.options},...Q],placeholder:"Select Services",inputId:`${t}-service`})}),(0,x.jsx)(Ie.c,{label:"Metric name",width:"auto",htmlFor:`${t}-select-metric`,children:(0,x.jsx)("span",{title:_===""?"Select a service first":"Type to search metrics",children:(0,x.jsx)(Oe.DW,{width:"auto",onChange:Kt,value:[...de,...r.options].find(ye=>ye.value===ze),loadOptions:ts,defaultOptions:[{label:"Template Variables",options:r.options},...de.slice(0,100)],placeholder:"Select Metric",inputId:`${t}-select-metric`,disabled:_===""})})})]})}),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Jn,{labels:b,filters:n.filters,onChange:ye=>e({...n,filters:ye}),variableOptionGroup:r}),(0,x.jsxs)(Qe.U,{children:[(0,x.jsx)(ci,{metricDescriptor:L,query:n,onChange:e}),(0,x.jsx)(zn,{refId:t,labels:Object.keys(b),query:n,onChange:e,variableOptionGroup:r,metricDescriptor:L}),(0,x.jsx)(Kn,{refId:t,datasource:i,templateVariableOptions:r.options,query:n,customMetaData:c,onChange:e,metricDescriptor:L,preprocessor:n.preprocessor}),(0,x.jsx)(dt,{refId:t,value:d,onChange:f})]})]})]})}const hi=t=>(0,Be.css)({label:"grafana-select-option-description",fontWeight:"normal",fontStyle:"italic",color:t.colors.text.secondary}),pi=F.memo(di),fi=({refId:t,onChange:e,graphPeriod:i,variableOptionGroup:n})=>(0,x.jsx)(Qe.U,{children:(0,x.jsx)(Ie.c,{label:"Graph period",htmlFor:`${t}-graph-period`,tooltip:(0,x.jsxs)(x.Fragment,{children:["Set ",(0,x.jsx)("code",{children:"graph_period"})," which forces a preferred period between points. Automatically set to the current interval if left blank."]}),children:(0,x.jsxs)(Tt.Gy,{children:[(0,x.jsx)(Ln.d,{"data-testid":`${t}-switch-graph-period`,value:i!=="disabled",onChange:r=>e(r.currentTarget.checked?"":"disabled")}),(0,x.jsx)(pt,{inputId:`${t}-graph-period`,templateVariableOptions:n.options,current:i,onChange:e,disabled:i==="disabled",aligmentPeriods:Dn})]})})}),mt=t=>({projectName:t.getDefaultProject(),crossSeriesReducer:"REDUCE_NONE",alignmentPeriod:"cloud-monitoring-auto",perSeriesAligner:qe.ALIGN_MEAN,groupBys:[],filters:[]}),Ut=t=>({projectName:t.getDefaultProject(),query:""});function mi({refId:t,query:e,datasource:i,onChange:n,onRunQuery:r,customMetaData:c,variableOptionGroup:d,range:f}){const y=(0,F.useCallback)(N=>{let v=!0;if(N?.filters&&N.filters.length>0){for(const M of N.filters)if(M===""){v=!1;break}}n({...e,timeSeriesList:N}),v&&r()},[n,r,e]),b=(0,F.useCallback)(N=>{n({...e,timeSeriesQuery:N}),r()},[n,r,e]);return(0,F.useEffect)(()=>{e.queryType===Ae.TIME_SERIES_LIST&&!e.timeSeriesList&&n({refId:e.refId,datasource:e.datasource,queryType:Ae.TIME_SERIES_LIST,timeSeriesList:mt(i),aliasBy:e.aliasBy}),e.queryType===Ae.TIME_SERIES_QUERY&&!e.timeSeriesQuery&&n({refId:e.refId,datasource:e.datasource,queryType:Ae.TIME_SERIES_QUERY,timeSeriesQuery:Ut(i),aliasBy:e.aliasBy})},[n,e,i]),(0,x.jsxs)(xt.D,{children:[(e.queryType===Ae.ANNOTATION||e.queryType===Ae.TIME_SERIES_LIST)&&e.timeSeriesList&&(0,x.jsx)(pi,{refId:t,variableOptionGroup:d,customMetaData:c,onChange:y,datasource:i,query:e.timeSeriesList,aliasBy:e.aliasBy,onChangeAliasBy:N=>n({...e,aliasBy:N}),range:f}),e.queryType===Ae.TIME_SERIES_QUERY&&e.timeSeriesQuery&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(In.B,{gap:1,direction:"row",children:[(0,x.jsx)(rt,{refId:t,datasource:i,onChange:N=>b({...e.timeSeriesQuery,projectName:N}),templateVariableOptions:d.options,projectName:e.timeSeriesQuery.projectName}),(0,x.jsx)(dt,{refId:t,value:e.aliasBy,onChange:N=>n({...e,aliasBy:N})})]}),(0,x.jsx)(ii,{onChange:N=>b({...e.timeSeriesQuery,query:N}),onRunQuery:r,query:e.timeSeriesQuery.query}),(0,x.jsx)(fi,{onChange:N=>b({...e.timeSeriesQuery,graphPeriod:N}),graphPeriod:e.timeSeriesQuery.graphPeriod,refId:t,variableOptionGroup:d})]})]})}const gi=F.memo(mi),vs=t=>({projectName:t.getDefaultProject(),expr:"",step:"10s"});function vi({refId:t,query:e,datasource:i,onChange:n,variableOptionGroup:r,onRunQuery:c}){function d(f){f.key==="Enter"&&f.shiftKey&&(c(),f.preventDefault(),f.stopPropagation())}return(0,x.jsx)("span",{"data-testid":Ze.components.queryEditor.promQlQueryEditor.container.input,children:(0,x.jsxs)(Qe.U,{children:[(0,x.jsx)(rt,{refId:t,templateVariableOptions:r.options,projectName:e.projectName,datasource:i,onChange:f=>n({...e,projectName:f})}),(0,x.jsx)(Pt.f,{name:"Query",className:"slate-query-field",value:e.expr,rows:10,placeholder:"Enter a Cloud Monitoring Prometheus query (Run with Shift+Enter)",onBlur:c,onKeyDown:d,onChange:f=>n({...e,expr:f.currentTarget.value})}),(0,x.jsx)(Ie.c,{label:"Min step",tooltip:"Time units and built-in variables can be used here, for example: $__interval, $__rate_interval, 5s, 1m, 3h, 1d, 1y (Default if no unit is specified: 10s)",children:(0,x.jsx)(Ct.p,{type:"string",placeholder:"auto",onChange:f=>n({...e,step:f.currentTarget.value}),onKeyDown:d,value:e.step??""})})]})})}var yi=a(84523),Ei=a(75686),bi=a(40263);const xi=t=>{const{query:e,onChange:i,onRunQuery:n}=t,{queryType:r}=e;return(0,x.jsxs)(yi.X,{children:[(0,x.jsx)(Ei.W,{label:"Query type",options:Pn,value:r,onChange:({value:c})=>{i({...e,queryType:c}),n()}}),(0,x.jsx)(bi.Z,{grow:1})]})},Ci=t=>{const{datasource:e,query:i,onRunQuery:n,onChange:r,range:c}=t,[d,f]=(0,F.useState)(!1);(0,F.useEffect)(()=>{const fe=e.migrateQuery(i);Tn()(fe,i)||r({...fe})},[i,e,r]);const[y,b]=(0,F.useState)(i),[N,v]=(0,F.useState)(!1),M={...ti(e),...i.sloQuery},L=fe=>{r({...i,sloQuery:fe}),n()},G={projectName:e.getDefaultProject(),expr:"",step:"10s",...i.promQLQuery},de=fe=>{r({...i,promQLQuery:fe})},k=fe=>{(fe.queryType===Ae.TIME_SERIES_LIST&&!(0,T.isEqual)(fe.timeSeriesList,mt(e))||fe.queryType===Ae.TIME_SERIES_QUERY&&!(0,T.isEqual)(fe.timeSeriesQuery,Ut(e)))&&v(!0),r(fe)},Y=(t.data?.series.length?t.data?.series[0].meta:{})?.custom??{},_={label:"Template Variables",expanded:!1,options:e.getVariables().map(ut.z)};(0,F.useEffect)(()=>{(!i.queryType||!Object.values(Ae).includes(i.queryType))&&r({...i,queryType:Ae.TIME_SERIES_LIST})});const oe=i.queryType,Ee=fe=>{N&&(y.queryType===Ae.TIME_SERIES_LIST||y.queryType===Ae.TIME_SERIES_QUERY)?y.queryType!==fe.queryType&&f(!0):r(fe),b(fe)};return(0,x.jsx)("span",{"data-testid":Ze.components.queryEditor.container,children:(0,x.jsxs)(xt.D,{children:[(0,x.jsx)(Sn.u,{"data-testid":"switch-query-type-modal",title:"Warning",body:"By switching your query type, your current query will be lost.",isOpen:d,onConfirm:()=>{f(!1),r(y),v(!1)},confirmText:"Confirm",onDismiss:()=>{f(!1),b(i)}}),(0,x.jsx)(xi,{query:i,onChange:Ee,onRunQuery:n}),oe===Ae.PROMQL&&(0,x.jsx)(vi,{refId:i.refId,variableOptionGroup:_,onChange:de,onRunQuery:n,datasource:e,query:G}),oe!==Ae.SLO&&(0,x.jsx)(gi,{refId:i.refId,variableOptionGroup:_,customMetaData:Y,onChange:k,onRunQuery:n,datasource:e,query:i,range:c||(0,An.E2)()}),oe===Ae.SLO&&(0,x.jsx)(ni,{refId:i.refId,variableOptionGroup:_,customMetaData:Y,onChange:L,onRunQuery:n,datasource:e,query:M,aliasBy:i.aliasBy,onChangeAliasBy:fe=>r({...i,aliasBy:fe})})]})})};var Ti=a(88159),Ai=a(50363);const Si=t=>{const{value:e,placeholder:i,className:n,isSearchable:r,onChange:c}=t,d=wi(t),f=Ii(d,e),y=(0,F.useCallback)(b=>c(b.value),[c]);return(0,x.jsx)(Oe.l6,{className:n,isMulti:!1,isClearable:!1,backspaceRemovesValue:!1,onChange:y,options:d,isSearchable:r,maxMenuHeight:500,placeholder:i,noOptionsMessage:"No options found",value:f})},wi=({variables:t=[],options:e})=>(0,F.useMemo)(()=>!Array.isArray(t)||t.length===0?e:[{label:"Template Variables",options:t.map(({name:i})=>({label:`$${i}`,value:`$${i}`}))},...e],[t,e]),Ii=(t,e)=>(0,F.useMemo)(()=>(t.every(n=>n.options)?(0,T.flatten)(t.map(n=>n.options)):t).find(n=>n.value===e),[t,e]);var Li=a(96601),Ni=a(74064),Di=a(10247),Oi=a(88849),jt=a(5005),Mi=a(18899),Pi=a(76917),Rt=a(58779);const ki=t=>{const[e,i]=(0,F.useState)(null),n=t.type==="submenu",r=(0,ot.of)(ji),c=t.iconClassName?(0,jt.Uo)(t.iconClassName):void 0;switch(t.type){case"divider":return(0,x.jsx)("li",{className:"divider"});case"group":return(0,x.jsx)("li",{children:(0,x.jsx)("span",{className:r.groupLabel,children:t.text})});default:return(0,x.jsxs)("li",{className:n?`dropdown-submenu ${Ui(e)}`:void 0,ref:i,"data-testid":Rt.Tp.components.Panels.Panel.menuItems(t.text),children:[(0,x.jsxs)("a",{onClick:t.onClick,href:t.href,role:"menuitem",children:[c&&(0,x.jsx)(Je.I,{name:c,className:r.menuIconClassName}),(0,x.jsxs)("span",{className:"dropdown-item-text","data-testid":Rt.Tp.components.Panels.Panel.headerItems(t.text),children:[t.text,n&&(0,x.jsx)(Je.I,{name:"angle-right",className:r.shortcutIconClassName})]}),t.shortcut&&(0,x.jsxs)("span",{className:"dropdown-menu-item-shortcut",children:[(0,x.jsx)(Je.I,{name:"keyboard",className:r.menuIconClassName})," ",t.shortcut]})]}),t.children]})}};function Ui(t){if(!t)return"invisible";const e=t.parentElement.getBoundingClientRect(),i=t.getBoundingClientRect();return i.width===0?"invisible":e.right+i.width+10>window.innerWidth?"pull-left":"pull-right"}function ji(t){return{menuIconClassName:(0,Be.css)({marginRight:t.spacing(1),"a::after":{display:"none"}}),shortcutIconClassName:(0,Be.css)({position:"absolute",top:"7px",right:t.spacing(.5),color:t.colors.text.secondary}),groupLabel:(0,Be.css)({color:t.colors.text.secondary,fontSize:t.typography.size.sm,padding:t.spacing(.5,1)})}}const Ri=({children:t,customCss:e})=>{if(!t||t.length===0)return null;const i=t.find(n=>n.active===!0);return(0,x.jsx)("div",{className:`gf-form-select-wrapper width-20 ${e}`,children:(0,x.jsxs)("div",{className:"dropdown",children:[(0,x.jsx)("button",{type:"button",className:"gf-form-input dropdown-toggle","data-toggle":"dropdown",style:{textAlign:"left"},children:i?.text}),(0,x.jsx)("ul",{role:"menu",className:"dropdown-menu dropdown-menu--menu",children:t.map(n=>n.hideFromTabs?null:(0,x.jsx)(ki,{iconClassName:n.icon,text:n.text,href:n.url},n.url))})]})})},$i=({children:t})=>!t||t.length===0?null:(0,x.jsxs)("nav",{children:[(0,x.jsx)(Ri,{customCss:"page-header__select-nav",children:t}),(0,x.jsx)(Di.U,{className:"page-header__tabs",hideBorder:!0,children:t.map((e,i)=>!e.hideFromTabs&&(0,x.jsx)(Oi.o,{label:e.text,active:e.active,icon:e.icon,href:e.url,suffix:e.tabSuffix},`${e.url}-${i}`))})]}),Bi=({navItem:t,renderTitle:e,actions:i,info:n,subTitle:r})=>{const c=(0,ot.of)(Fi);if(!t)return null;const d=f=>{const y=f.icon==="grafana"?12:14,b=f.icon&&(0,jt.Uo)(f.icon),N=r??f.subTitle;return(0,x.jsxs)("div",{className:"page-header__inner",children:[(0,x.jsxs)("span",{className:"page-header__logo",children:[b&&(0,x.jsx)(Je.I,{name:b,size:"xxxl",style:{marginTop:y}}),f.img&&(0,x.jsx)("img",{className:"page-header__img",src:f.img,alt:""})]}),(0,x.jsxs)("div",{className:(0,Be.cx)("page-header__info-block",c.headerText),children:[e?e(f.text):Gi(f.text,f.highlightText),n&&(0,x.jsx)(Mi.Q,{info:n}),N&&(0,x.jsx)("div",{className:"page-header__sub-title",children:N}),i&&(0,x.jsx)("div",{className:c.actions,children:i})]})]})};return(0,x.jsx)("div",{className:c.headerCanvas,children:(0,x.jsx)("div",{className:"page-container",children:(0,x.jsxs)("div",{className:"page-header",children:[d(t),t.children&&t.children.length>0&&(0,x.jsx)($i,{children:t.children})]})})})};function Gi(t,e){return t?(0,x.jsxs)("h1",{className:"page-header__title",children:[t,e&&(0,x.jsx)(Pi.J,{text:e,className:(0,Be.css)({verticalAlign:"middle"})})]}):null}const Fi=t=>({actions:(0,Be.css)({display:"flex",flexDirection:"row",gap:t.spacing(1)}),headerText:(0,Be.css)({display:"flex",flexDirection:"column",gap:t.spacing(1)}),headerCanvas:(0,Be.css)({background:t.colors.background.canvas})}),{SecretFormField:Vi}=cn.rRI;function zi(){we("footer",Ai.wi,[]),we("icon",Je.I,["name","size","type",["onClick",{watchDepth:"reference",wrapApply:!0}]]),we("spinner",un.y,["inline"]),we("helpModal",Ni.N,[]),we("pageHeader",Bi,["model","noTabs"]),we("emptyListCta",Ti.A,["title","buttonIcon","buttonLink","buttonTitle",["onClick",{watchDepth:"reference",wrapApply:!0}],"proTip","proTipLink","proTipLinkTitle","proTipTarget","infoBox","infoBoxTitle"]),we("tagFilter",Li.$,["tags",["onChange",{watchDepth:"reference"}],["tagOptions",{watchDepth:"reference"}]]),we("colorPicker",dn.sk,["color",["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("seriesColorPickerPopover",hn.t,["color","series","onColorChange","onToggleAxis"]),we("unitPicker",pn.p,["value","width",["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("metricSelect",Si,["options","onChange","value","isSearchable","className","placeholder",["variables",{watchDepth:"reference"}]]),we("cloudMonitoringQueryEditor",Ci,["target","onQueryChange","onExecuteQuery",["events",{watchDepth:"reference"}],["datasource",{watchDepth:"reference"}],["templateSrv",{watchDepth:"reference"}]]),we("secretFormField",Vi,["value","isConfigured","inputWidth","labelWidth","aria-label",["onReset",{watchDepth:"reference",wrapApply:!0}],["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("graphContextMenu",fn.H,["x","y","itemsGroup",["onClose",{watchDepth:"reference",wrapApply:!0}],["getContextMenuSource",{watchDepth:"reference",wrapApply:!0}],["timeZone",{watchDepth:"reference",wrapApply:!0}]]),we("drilldownLinksEditor",mn.e,["value","links","suggestions",["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("datasourceHttpSettingsNext",gn.t,["defaultUrl","showAccessOptions","dataSourceConfig","showForwardOAuthIdentityOption",["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("folderPicker",bn.sR,["labelClass","rootName","enableCreateNew","enableReset","initialTitle","initialFolderId","dashboardId","onCreateFolder",["enterFolderCreation",{watchDepth:"reference",wrapApply:!0}],["exitFolderCreation",{watchDepth:"reference",wrapApply:!0}],["onLoad",{watchDepth:"reference",wrapApply:!0}],["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("timePickerSettings",xn.p,["renderCount","refreshIntervals","timePickerHidden","nowDelay","timezone",["onTimeZoneChange",{watchDepth:"reference",wrapApply:!0}],["onRefreshIntervalChange",{watchDepth:"reference",wrapApply:!0}],["onNowDelayChange",{watchDepth:"reference",wrapApply:!0}],["onHideTimePickerChange",{watchDepth:"reference",wrapApply:!0}]]),we("clipboardButton",vn.b,[["getText",{watchDepth:"reference",wrapApply:!0}]])}const gt=t=>e=>e.finally(t.$evalAsync),Wi=`
<div class="dropdown cascade-open">
<a ng-click="showActionsMenu()" class="query-part-name pointer dropdown-toggle" data-toggle="dropdown">{{part.def.type}}</a>
<span>(</span><span class="query-part-parameters"></span><span>)</span>
<ul class="dropdown-menu">
  <li ng-repeat="action in partActions">
    <a ng-click="triggerPartAction(action)">{{action.text}}</a>
  </li>
</ul>
`;o.Ay.directive("queryPartEditor",["templateSrv",Ki]);function Ki(t){const e='<input type="text" class="hide input-mini tight-form-func-param"></input>';return{restrict:"E",template:Wi,scope:{part:"=",handleEvent:"&",debounce:"@"},link:function(n,r){const c=n.part,d=c.def,f=r.find(".query-part-parameters"),y=n.debounce;n.partActions=[];function b(k){const Q=U()(this),Y=Q.next();Y.val(c.params[k]),Y.css("width",Q.width()+16+"px"),Q.hide(),Y.show(),Y.focus(),Y.select();const _=Y.data("typeahead");_&&(Y.val(""),_.lookup())}function N(k){const Q=U()(this),Y=Q.prev(),_=Q.val();(_!==""||c.def.params[k].optional)&&(Y.html(t.highlightVariablesAsHtml(_)),c.updateParam(Q.val(),k),n.$apply(()=>{n.handleEvent({$event:{name:"part-param-changed"}})})),Q.hide(),Y.show()}function v(k,Q){Q.which===13&&N.call(this,k)}function M(){this.style.width=(3+this.value.length)*8+"px"}function L(k,Q,Y){if(!Q.options&&!Q.dynamicLookup)return;const _=(Ee,fe)=>{if(Q.options){let Le=Q.options;return Q.type==="int"&&(Le=(0,T.map)(Le,We=>We.toString())),Le}n.$apply(()=>{n.handleEvent({$event:{name:"get-param-options"}}).then(Le=>{const We=(0,T.map)(Le,Me=>(0,T.escape)(Me.value));fe(We)})})};k.attr("data-provide","typeahead"),k.typeahead({source:_,minLength:0,items:1e3,updater:Ee=>(Ee=(0,T.unescape)(Ee),setTimeout(()=>{N.call(k[0],Y)},0),Ee)});const oe=k.data("typeahead");oe.lookup=function(){this.query=this.$element.val()||"";const Ee=this.source(this.query,U().proxy(this.process,this));return Ee&&this.process(Ee)},y&&(oe.lookup=(0,T.debounce)(oe.lookup,500,{leading:!0}))}n.showActionsMenu=()=>{gt(n)(n.handleEvent({$event:{name:"get-part-actions"}}).then(k=>{n.partActions=k}))},n.triggerPartAction=k=>{n.handleEvent({$event:{name:"action",action:k}})};function G(){(0,T.each)(d.params,(k,Q)=>{if(k.optional&&c.params.length<=Q)return;Q>0&&U()("<span>, </span>").appendTo(f);const Y=t.highlightVariablesAsHtml(c.params[Q]),_=U()('<a class="graphite-func-param-link pointer">'+Y+"</a>"),oe=U()(e);_.appendTo(f),oe.appendTo(f),oe.blur((0,T.partial)(N,Q)),oe.keyup(M),oe.keypress((0,T.partial)(v,Q)),_.click((0,T.partial)(b,Q)),L(oe,k,Q)})}function de(){f.empty(),G()}de()}}}function Hi(t){let e=this.query;return e===""?!0:(e[0]==="/"&&(e=e.substring(1)),e[e.length-1]==="/"&&(e=e.substring(0,e.length-1)),t.toLowerCase().match(e.toLowerCase()))}class Qi{constructor(e,i,n,r){this.$scope=e,this.$sce=n,this.templateSrv=r,this.inputElement=i.find("input").first(),this.linkElement=i.find("a").first(),this.linkMode=!0,this.cancelBlur=null,this.labelMode=!1,this.lookupText=!1,this.debounce=!1,e.$watch("ctrl.model",this.modelChanged.bind(this))}static{this.$inject=["$scope","$element","$sce","templateSrv"]}$onInit(){this.labelMode?this.cssClasses="gf-form-label "+this.cssClass:this.cssClasses="gf-form-input gf-form-input--dropdown "+this.cssClass,this.placeholder&&this.inputElement.attr("placeholder",this.placeholder),this.inputElement.attr("data-provide","typeahead"),this.inputElement.typeahead({source:this.typeaheadSource.bind(this),minLength:0,items:1e4,updater:this.typeaheadUpdater.bind(this),matcher:Hi});const e=this.inputElement.data("typeahead");e.lookup=function(){this.query=this.$element.val()||"",this.source(this.query,this.process.bind(this))},this.debounce&&(e.lookup=(0,T.debounce)(e.lookup,500,{leading:!0})),this.linkElement.keydown(i=>{(i.keyCode===40||i.keyCode===13)&&this.linkElement.click()}),this.inputElement.keydown(i=>{i.keyCode===13&&setTimeout(()=>{this.inputElement.blur()},300)}),this.inputElement.blur(this.inputBlur.bind(this)),this.startOpen&&setTimeout(this.open.bind(this),0)}getOptionsInternal(e){return gt(this.$scope)(Promise.resolve(this.getOptions({$query:e})))}isPromiseLike(e){return e&&typeof e.then=="function"}modelChanged(){(0,T.isObject)(this.model)?this.updateDisplay(this.model.text):this.lookupText?this.getOptionsInternal("").then(e=>{const i=(0,T.find)(e,{value:this.model});this.updateDisplay(i?i.text:this.model)}):this.updateDisplay(this.model)}typeaheadSource(e,i){this.getOptionsInternal(e).then(n=>{this.optionCache=n;const r=(0,T.map)(n,c=>(0,T.escape)(c.text));this.allowCustom&&this.text!==""&&(0,T.indexOf)(r,this.text)===-1&&r.unshift(this.text),i(r)})}typeaheadUpdater(e){return e===this.text?(clearTimeout(this.cancelBlur),this.inputElement.focus(),e):(this.inputElement.val(e),this.switchToLink(!0),e)}switchToLink(e){this.linkMode&&!e||(clearTimeout(this.cancelBlur),this.cancelBlur=null,this.linkMode=!0,this.inputElement.hide(),this.linkElement.show(),this.updateValue(this.inputElement.val()))}inputBlur(){this.cancelBlur=setTimeout(this.switchToLink.bind(this),200)}updateValue(e){e=(0,T.unescape)(e),!(e===""||this.text===e)&&this.$scope.$apply(()=>{const i=(0,T.find)(this.optionCache,{text:e});i?((0,T.isObject)(this.model)?this.model=i:this.model=i.value,this.text=i.text):this.allowCustom&&((0,T.isObject)(this.model)?this.model.text=this.model.value=e:this.model=e,this.text=e),this.$scope.$$postDigest(()=>{this.$scope.$apply(()=>{this.onChange({$option:i})})})})}updateDisplay(e){this.text=e,this.display=this.$sce.trustAsHtml(this.templateSrv.highlightVariablesAsHtml(e))}open(){this.inputElement.css("width",Math.max(this.linkElement.width(),80)+16+"px"),this.inputElement.show(),this.inputElement.focus(),this.linkElement.hide(),this.linkMode=!1;const e=this.inputElement.data("typeahead");e&&(this.inputElement.val(""),e.lookup())}}const Yi=`
<input type="text"
  data-provide="typeahead"
  class="gf-form-input"
  spellcheck="false"
  style="display:none">
</input>
<a ng-class="ctrl.cssClasses"
   tabindex="1"
   ng-click="ctrl.open()"
   give-focus="ctrl.focus"
   ng-bind-html="ctrl.display || '&nbsp;'">
</a>
`;function Xi(){return{restrict:"E",template:Yi,controller:Qi,bindToController:!0,controllerAs:"ctrl",scope:{model:"=",getOptions:"&",onChange:"&",cssClass:"@",allowCustom:"@",labelMode:"@",lookupText:"@",placeholder:"@",startOpen:"@",debounce:"@"}}}o.Ay.directive("gfFormDropdown",Xi);const Ji=`
<div class="baron__track">
  <div class="baron__bar"></div>
</div>
`,Zi="baron baron__root",qi="baron__scroller";function _i(){return{restrict:"A",link:(t,e,i)=>{let n=e.parent();const r=e;i.grafanaScrollbar&&i.grafanaScrollbar==="scrollonroot"&&(n=r),n.addClass(Zi),U()(Ji).appendTo(n),e.addClass(qi);const c={root:n[0],scroller:r[0],bar:".baron__bar",barOnCls:"_scrollbar",scrollingCls:"_scrolling",track:".baron__track",direction:"v"},d=l()(c);t.$on("$destroy",()=>{d.dispose()})}}}o.Ay.directive("grafanaScrollbar",_i);var er=a(16703);o.Ay.directive("jsonTree",[function(){return{restrict:"E",scope:{object:"=",startExpanded:"@",rootName:"@"},link:(e,i)=>{let n=e.startExpanded;e.startExpanded==="true"?n=2:e.startExpanded==="false"&&(n=1);const r={[e.rootName]:e.object},d=new er.O(r,n,{animateOpen:!0}).render(!0);i.append(d)}}}]);const tr=`
<label for="check-{{ctrl.id}}" class="gf-form-switch-container">
  <div class="gf-form-label {{ctrl.labelClass}}" ng-show="ctrl.label">
    {{ctrl.label}}
    <info-popover mode="right-normal" ng-if="ctrl.tooltip" position="top center">
      {{ctrl.tooltip}}
    </info-popover>
  </div>
  <div class="gf-form-switch {{ctrl.switchClass}}" ng-if="ctrl.show">
    <input id="check-{{ctrl.id}}" type="checkbox" ng-model="ctrl.checked" ng-change="ctrl.internalOnChange()">
    <span class="gf-form-switch__slider"></span>
  </div>
</label>
`,nr=`
<label for="check-{{ctrl.id}}" class="gf-form-switch-container">
   <div class="gf-form-label {{ctrl.labelClass}}" ng-show="ctrl.label">
    {{ctrl.label}}
    <info-popover mode="right-normal" ng-if="ctrl.tooltip" position="top center">
      {{ctrl.tooltip}}
    </info-popover>
  </div>
  <div class="gf-form-checkbox {{ctrl.switchClass}}" ng-if="ctrl.show">
    <input id="check-{{ctrl.id}}" type="checkbox" ng-model="ctrl.checked" ng-change="ctrl.internalOnChange()">
    <span class="gf-form-switch__checkbox"></span>
  </div>
</label>
`;class $t{constructor(e,i){this.$timeout=i,this.show=!0,this.id=e.$id}static{this.$inject=["$scope","$timeout"]}internalOnChange(){return this.$timeout(()=>this.onChange())}}function ir(){return{restrict:"E",controller:$t,controllerAs:"ctrl",bindToController:!0,scope:{checked:"=",label:"@",labelClass:"@",tooltip:"@",switchClass:"@",onChange:"&"},template:tr}}function rr(){return{restrict:"E",controller:$t,controllerAs:"ctrl",bindToController:!0,scope:{checked:"=",label:"@",labelClass:"@",tooltip:"@",switchClass:"@",onChange:"&"},template:nr}}o.Ay.directive("gfFormSwitch",ir),o.Ay.directive("gfFormCheckbox",rr);function sr(){return{restrict:"E",template:`<icon name="'info-circle'" style="margin-left: 10px;" size="'xs'"></icon>`,transclude:!0,link:(t,e,i,n,r)=>{const c=i.offset||"0 -10px",d=i.position||"right middle";let f="drop-help drop-hide-out-of-bounds";const y="hover";e.addClass("gf-form-help-icon"),i.wide&&(f+=" drop-wide"),i.mode&&e.addClass("gf-form-help-icon--"+i.mode),r((b,N)=>{const v=document.createElement("div");v.className="markdown-html",(0,T.each)(b,L=>{v.appendChild(L)});const M={target:e[0],content:v,position:d,classes:f,openOn:y,hoverOpenDelay:400,tetherOptions:{offset:c,constraints:[{to:"window",attachment:"together",pin:!0}]}};t.$applyAsync(()=>{const L=new(se())(M),G=t.$on("$destroy",()=>{L.destroy(),G()})})})}}}o.Ay.directive("infoPopover",sr),o.Ay.directive("spectrumPicker",or);function or(){return{restrict:"E",require:"ngModel",scope:!0,replace:!0,template:'<color-picker color="ngModel.$viewValue" on-change="onColorChange"></color-picker>',link:(t,e,i,n)=>{t.ngModel=n,t.onColorChange=r=>{n.$setViewValue(r)}}}}var Ye=a(88023);const ar="ace/theme/grafana-dark",lr="ace/theme/textmate",cr="text",ur=10,dr=2,hr=!0,pr=!0,fr="<div></div>";async function mr(t,e,i){const n=i.mode||cr,r=i.maxLines||ur,c=i.showGutter!==void 0,d=i.tabSize||dr,f=i.behavioursEnabled?i.behavioursEnabled==="true":hr,y=i.snippetsEnabled?i.snippetsEnabled==="true":pr,b=e.get(0),{default:N}=await a.e(3832).then(a.t.bind(a,47496,23));await a.e(6464).then(a.t.bind(a,6464,23)),await a.e(2694).then(a.t.bind(a,52694,23)),await a.e(7391).then(a.t.bind(a,57391,23)),await a.e(2228).then(a.t.bind(a,32228,23)),await a.e(2514).then(a.t.bind(a,32514,23)),await a.e(7515).then(a.t.bind(a,17515,23)),await a.e(4289).then(a.t.bind(a,54289,23)),await a.e(1708).then(a.t.bind(a,11708,23)),await a.e(7613).then(a.t.bind(a,7613,23)),await a.e(8730).then(a.t.bind(a,98730,23)),await a.e(9118).then(a.t.bind(a,59118,23)),await a.e(5277).then(a.t.bind(a,45277,23)),await a.e(9384).then(a.t.bind(a,47003,23));const v=N.edit(b),M=v.getSession(),L={maxLines:r,showGutter:c,tabSize:d,behavioursEnabled:f,highlightActiveLine:!1,showPrintMargin:!1,autoScrollEditorIntoView:!0};v.setOptions(L),v.$blockScrolling=1/0,v.renderer.setScrollMargin(10,10),v.renderer.setPadding(10),k(),de(n),Q(t.content),e.addClass("gf-code-editor");const G=e.find("textarea");G.addClass("gf-form-input"),G.attr("aria-label",i.textareaLabel),t.codeEditorFocus&&setTimeout(()=>{G.focus();const Y=G[0];if(Y.setSelectionRange){const _=G.val().length*2;Y.setSelectionRange(_,_)}},100),M.on("change",Y=>{t.$apply(()=>{const _=v.getValue();t.content=_})}),t.$watch("content",(Y,_)=>{const oe=v.getValue();Y!==oe&&Y!==_&&t.$$postDigest(()=>{Q(Y)})}),v.on("blur",()=>{t.onChange()}),t.$on("$destroy",()=>{v.destroy()}),v.commands.addCommand({name:"executeQuery",bindKey:{win:"Ctrl-Enter",mac:"Command-Enter"},exec:()=>{t.onChange()}});function de(Y){if(N.acequire("ace/ext/language_tools"),v.setOptions({enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:y}),t.getCompleter()){const oe=v;oe.completers=oe.completers.slice(),oe.completers.push(t.getCompleter())}const _=`ace/mode/${Y}`;M.setMode(_)}function k(){let Y=ar;Ye.Ay.bootData.user.lightTheme&&(Y=lr),v.setTheme(Y)}function Q(Y){v.setValue(Y),v.clearSelection()}}function gr(){return{restrict:"E",template:fr,scope:{content:"=",datasource:"=",codeEditorFocus:"<",onChange:"&",getCompleter:"&"},link:mr}}o.Ay.directive("codeEditor",gr);const vr=`
<div class="dropdown cascade-open">
<a ng-click="showActionsMenu()" class="query-part-name pointer dropdown-toggle" data-toggle="dropdown">{{part.label}}</a>
<span>{{part.def.wrapOpen}}</span><span class="query-part-parameters"></span><span>{{part.def.wrapClose}}</span>
<ul class="dropdown-menu">
  <li ng-repeat="action in partActions">
    <a ng-click="triggerPartAction(action)">{{action.text}}</a>
  </li>
</ul>
`;o.Ay.directive("sqlPartEditor",["templateSrv",yr]);function yr(t){const e='<input type="text" class="hide input-mini"></input>';return{restrict:"E",template:vr,scope:{part:"=",handleEvent:"&",debounce:"@"},link:function(n,r){const c=n.part,d=c.def,f=r.find(".query-part-parameters"),y=n.debounce;let b=null;n.partActions=[];function N(Y){const _=U()(this),oe=_.next();oe.val(c.params[Y]),oe.css("width",_.width()+16+"px"),_.hide(),oe.show(),oe.focus(),oe.select();const Ee=oe.data("typeahead");Ee&&(oe.val(""),Ee.lookup())}function v(Y,_){b=setTimeout(()=>{M(Y,_)},200)}function M(Y,_){const oe=Y.prev(),Ee=Y.val();(Ee!==""||c.def.params[_].optional)&&(oe.html(t.highlightVariablesAsHtml(Ee)),c.updateParam(Y.val(),_),n.$apply(()=>{n.handleEvent({$event:{name:"part-param-changed"}})})),Y.hide(),oe.show()}function L(Y,_){_.which===13&&M(U()(this),Y)}function G(){this.style.width=(3+this.value.length)*8+"px"}function de(Y,_,oe){if(!_.options&&!_.dynamicLookup)return;const Ee=(Le,We)=>{if(_.options){let Me=_.options;return _.type==="int"&&(Me=(0,T.map)(Me,Re=>Re.toString())),Me}n.$apply(()=>{n.handleEvent({$event:{name:"get-param-options",param:_}}).then(Me=>{const Re=(0,T.map)(Me,$e=>(0,T.escape)($e.value));(0,T.indexOf)(Re,c.params[oe])===-1&&Re.unshift((0,T.escape)(c.params[oe])),We(Re)})})};Y.attr("data-provide","typeahead"),Y.typeahead({source:Ee,minLength:0,items:1e3,updater:Le=>(Le=(0,T.unescape)(Le),Le===c.params[oe]&&(clearTimeout(b),Y.focus()),Le)});const fe=Y.data("typeahead");fe.lookup=function(){this.query=this.$element.val()||"";const Le=this.source(this.query,U().proxy(this.process,this));return Le&&this.process(Le)},y&&(fe.lookup=(0,T.debounce)(fe.lookup,500,{leading:!0}))}n.showActionsMenu=()=>{n.handleEvent({$event:{name:"get-part-actions"}}).then(Y=>{n.partActions=Y})},n.triggerPartAction=Y=>{n.handleEvent({$event:{name:"action",action:Y}})};function k(){(0,T.each)(d.params,(Y,_)=>{if(Y.optional&&c.params.length<=_)return;_>0&&U()("<span>"+d.separator+"</span>").appendTo(f);const oe=t.highlightVariablesAsHtml(c.params[_]),Ee=U()('<a class="query-part__link">'+oe+"</a>"),fe=U()(e);Ee.appendTo(f),fe.appendTo(f),fe.blur((0,T.partial)(v,fe,_)),fe.keyup(G),fe.keypress((0,T.partial)(L,_)),Ee.click((0,T.partial)(N,_)),de(fe,Y,_)})}function Q(){f.empty(),k()}Q()}}}o.m7.directive("datasourceHttpSettings",()=>({scope:{current:"=",suggestUrl:"@",noDirectAccess:"@",showForwardOAuthIdentityOption:"@"},templateUrl:"public/app/angular/partials/http_settings_next.html",link:{pre:t=>{t.showAccessOption=t.noDirectAccess!=="true",t.onChange=e=>{t.current=e}}}})),o.m7.directive("datasourceTlsAuthSettings",()=>({scope:{current:"="},templateUrl:"public/app/angular/partials/tls_auth_settings.html"}));var Bt=a(43956),vt=a(28205);o.Ay.directive("pluginComponent",["$compile","$http","$templateCache","$location",Er]);function Er(t,e,i,n){function r(v){if(v.template)return Promise.resolve(v.template);const M=i.get(v.templateUrl);return M?Promise.resolve(M):e.get(v.templateUrl).then(L=>L.data)}function c(v,M){if(v)return v.indexOf("public")===0?v:M+"/"+v}function d(v){return v.Component.templateUrl=c(v.Component.templateUrl,v.baseUrl),()=>({templateUrl:v.Component.templateUrl,template:v.Component.template,restrict:"E",controller:v.Component,controllerAs:"ctrl",bindToController:!0,scope:v.bindings,link:(M,L,G,de)=>{de.link&&de.link(M,L,G,de),de.init&&de.init()}})}function f(v,M){const L={name:"panel-plugin-"+v.panel.type,bindings:{dashboard:"=",panel:"=",row:"="},attrs:{dashboard:"dashboard",panel:"panel",class:"panel-height-helper"}},G=Ye.Ay.panels[v.panel.type];return(0,Bt.TV)(G.id).then(de=>{const k=de.angularPanelCtrl;return L.Component=k,!k||k.registered?L:k.templatePromise?k.templatePromise.then(Q=>L):(G&&(k.templateUrl=c(k.templateUrl,G.baseUrl)),k.templatePromise=r(k).then(Q=>(k.templateUrl=null,k.template=`<grafana-panel ctrl="ctrl" class="panel-height-helper">${Q}</grafana-panel>`,{...L,baseUrl:G.baseUrl})),k.templatePromise)})}function y(v,M){switch(M.type){case"query-ctrl":{const L=v.ctrl.datasource;return Promise.resolve({baseUrl:L.meta.baseUrl,name:"query-ctrl-"+L.meta.id,bindings:{target:"=",panelCtrl:"=",datasource:"="},attrs:{target:"ctrl.target","panel-ctrl":"ctrl",datasource:"ctrl.datasource"},Component:L.components.QueryCtrl})}case"annotations-query-ctrl":{const L=v.ctrl.currentDatasource.meta.baseUrl,G=v.ctrl.currentDatasource.meta.id;return(0,vt.cS)(v.ctrl.currentDatasource.meta).then(de=>({baseUrl:L,name:"annotations-query-ctrl-"+G,bindings:{annotation:"=",datasource:"="},attrs:{annotation:"ctrl.currentAnnotation",datasource:"ctrl.currentDatasource"},Component:de.components.AnnotationsQueryCtrl}))}case"datasource-config-ctrl":{const L=v.ctrl.datasourceMeta,G=n.url();return(0,vt.cS)(L).then(de=>(v.$watch("ctrl.current",()=>{G===n.url()&&v.onModelChanged(v.ctrl.current)},!0),{baseUrl:L.baseUrl,name:"ds-config-"+L.id,bindings:{meta:"=",current:"="},attrs:{meta:"ctrl.datasourceMeta",current:"ctrl.current"},Component:de.angularConfigCtrl}))}case"app-config-ctrl":{const L=v.ctrl.model;return(0,vt.ui)(L).then(G=>({baseUrl:L.baseUrl,name:"app-config-"+L.id,bindings:{appModel:"=",appEditCtrl:"="},attrs:{"app-model":"ctrl.model","app-edit-ctrl":"ctrl"},Component:G.angularConfigCtrl}))}case"panel":return f(v,M);default:return Promise.reject({message:"Could not find component type: "+M.type})}}function b(v,M,L){const G=I().element(document.createElement(L.name));(0,T.each)(L.attrs,(de,k)=>{G.attr(k,de)}),t(G)(v),M.empty(),setTimeout(()=>{v.$applyAsync(()=>{M.append(G),setTimeout(()=>{v.$applyAsync(()=>{v.$broadcast(g.ee.componentDidMount.name)})})})})}function N(v,M,L,G){if(G.notFound){M.empty();return}if(!G.Component)throw{message:"Failed to find exported plugin component for "+G.name};if(!G.Component.registered){const de=L.$normalize(G.name),k=d(G);o.Ay.directive(de,k),G.Component.registered=!0}b(v,M,G)}return{restrict:"E",link:(v,M,L)=>{y(v,L).then(G=>{N(v,M,L,G)}).catch(G=>{console.error("Plugin component error",G)})}}}var Gt=a(4050),br=a(94888),xr=a(41090),_e=a(22492);class Cr{static{this.$inject=["$scope","utilSrv","$rootScope","contextSrv","angularLoader","$injector"]}constructor(e,i,n,r,c,d){(0,Gt.w)(c),(0,br.j)(d),e.init=()=>{e.contextSrv=r,e.appSubUrl=Ye.Ay.appSubUrl,e._=ae(),i.init()},n.colors=xr.Tj,n.onAppEvent=function(f,y,b){let N;typeof f=="string"?N=n.$on(f,y):N=n.$on(f.name,y);let v=this;v.$id===1&&!b&&console.warn("warning rootScope onAppEvent called without localscope"),b&&(v=b),v.$on("$destroy",N)},n.appEvent=(f,y)=>{typeof f=="string"?(n.$emit(f,y),_e.A.emit(f,y)):(n.$emit(f.name,y),_e.A.emit(f,y))},e.init()}}function Tr(){return{restrict:"E",controller:Cr,link:(t,e)=>{const i=U()("body");U().fn.modal.Constructor.prototype.enforceFocus=()=>{};let n=new Date().getTime(),r=!0;const c=60*5e3;function d(){r&&i.hasClass("page-dashboard")&&new Date().getTime()-n>c&&(r=!1,i.addClass("view-mode--inactive"))}function f(){n=new Date().getTime(),r||(r=!0,i.removeClass("view-mode--inactive"))}i.mousemove(f),i.keydown(f),document.addEventListener("wheel",f,{capture:!0,passive:!0}),document.addEventListener("visibilitychange",f),setInterval(d,2e3),i.click(y=>{const b=U()(y.target);if(b.parents().length===0)return;i.find(".dropdown-menu-open").removeClass("dropdown-menu-open");const N=b.closest("[data-click-hide]");if(N.length){const M=N.parent();N.detach(),setTimeout(()=>{M.append(N)},100)}const v=e.find(".popover");v.length>0&&b.parents(".graph-legend").length===0&&v.hide()})}}}o.Ay.directive("grafanaApp",Tr);var ys=a(23345),Es=a(26415),bs=a(74526),xs=a(13609),Ar=a(61351),Sr=a(55227),wr=a(80757),Ir=a(70092),Lr=a(25713),Nr=a(64570),Ft=a(53027);class Dr{constructor(){this.$get=()=>{},(0,Ft.Lc)("Patch angular",!1,"RouteParamsProvider")}}class Or{constructor(){(0,Ft.Lc)("Patch angular",!1,"RouteProvider")}$get(){return this}}var Mr=a(85050);const Pr=()=>{o.m7.config(["$provide",t=>{t.decorator("$browser",["$delegate",e=>(e.onUrlChange=()=>{},e.url=()=>"",e)])}])},kr=()=>{o.m7.config(["$provide",t=>{t.decorator("$location",["$delegate",e=>(e=new Mr.b,e)])}]),o.m7.provider("$route",Or),o.m7.provider("$routeParams",Dr)};function Ur(){Pr(),kr()}function jr(t){t.oldInvoke=t.invoke,t.invoke=(e,i,n,r)=>{const c=n?.$scope?.$parent;return c&&(c.panel&&(i.panel=c.panel),c.dashboard&&(i.dashboard=c.dashboard),c.ctrl?.target&&(i.panelCtrl=c.ctrl,i.datasource=c.ctrl.datasource,i.target=c.ctrl.target),c.ctrl?.datasourceMeta&&(i.meta=c.ctrl.datasourceMeta,i.current=c.ctrl.current),c.ctrl?.currentAnnotation&&(i.annotation=c.ctrl.currentAnnotation,i.datasource=c.ctrl.currentDatasource),c.isAppConfigCtrl&&(i.appEditCtrl=c.ctrl,i.appModel=c.ctrl.model),c.$parent?.$parent?.ctrl?.appModel&&(i.appModel=c.$parent?.$parent?.ctrl?.appModel)),t.oldInvoke(e,i,n,r)}}var Rr=a(39741),$r=a(10112),Vt=a(16910);function Br(t){return function(i){const n=(0,F.useRef)(null),r=(0,F.useRef)(),c=(0,F.useRef)();return(0,F.useEffect)(()=>{if(!n.current)return;const d=(0,Gt.E)(),f='<plugin-component type="panel" class="panel-height-helper"></plugin-component>',y=new Fr,b=new Gr(t,i,y);r.current={panel:b,dashboard:(0,Vt.UA)().getCurrent(),size:{width:i.width,height:i.height},queryRunner:y},c.current=d.load(n.current,r.current,f)},[]),(0,F.useEffect)(()=>{c.current&&(r.current.size.height=i.height,r.current.size.width=i.width,r.current.panel.events.publish(new h.XM))},[i.width,i.height]),(0,F.useEffect)(()=>{r.current?.panel&&r.current.queryRunner.forwardNewData(i.data)},[i.data]),(0,x.jsx)("div",{ref:n,className:"panel-height-helper"})}}class Gr{constructor(e,i,n){i.options.angularOptions&&Object.assign(this,i.options.angularOptions),this.id=i.id,this.type=e.meta.id,this.title=i.title,this.fieldConfig=i.fieldConfig,this.options=i.options,this.plugin=e,this.events=new $r.o,this.queryRunner=n}refresh(){this.events.publish(new C._)}render(){this.events.publish(new h.XM)}getQueryRunner(){return this.queryRunner}}class Fr{constructor(){this.subject=new Rr.m(1)}getData(e){return this.subject}forwardNewData(e){this.subject.next(e)}run(){}}var Vr=a(28082),zr=a(98437),Wr=a(87638),Kr=a(3142),Hr=a(89146),je=a(33262);class Qr{constructor(){}init(){_e.l.subscribe(h.Ps,e=>this.showModal(e.payload)),_e.l.subscribe(h.aP,this.hideModal.bind(this))}hideModal(){(0,je.l)("UtilSrv","hideModal",""),this.modalScope&&this.modalScope.dismiss&&this.modalScope.dismiss()}showModal(e){(0,je.l)("UtilSrv","showModal","publish ShowModalReactEvent")}}var yt=a(65596);class Yr{clearPromiseCaches(){(0,je.l)("annotations_srv.ts","clearPromiseCaches","DashboardQueryRunner")}getAnnotations(e){return(0,je.l)("annotations_srv.ts","getAnnotations","DashboardQueryRunner.getResult"),Promise.resolve({annotations:[],alertState:void 0})}getAlertStates(e){return(0,je.l)("annotations_srv.ts","getAlertStates","DashboardQueryRunner.getResult"),Promise.resolve(void 0)}getGlobalAnnotations(e){return(0,je.l)("annotations_srv.ts","getGlobalAnnotations","DashboardQueryRunner.getResult"),Promise.resolve([])}saveAnnotationEvent(e){return(0,je.l)("annotations_srv.ts","saveAnnotationEvent","api/saveAnnotation"),(0,yt.vJ)(e)}updateAnnotationEvent(e){return(0,je.l)("annotations_srv.ts","updateAnnotationEvent","api/updateAnnotation"),(0,yt.rJ)(e)}deleteAnnotationEvent(e){return(0,je.l)("annotations_srv.ts","deleteAnnotationEvent","api/deleteAnnotation"),(0,yt.Xm)(e)}translateQueryResult(e,i){(0,je.l)("annotations_srv.ts","translateQueryResult","DashboardQueryRunner/utils/translateQueryResult"),e.snapshotData&&(e=(0,T.cloneDeep)(e),delete e.snapshotData);for(const n of i)n.source=e,n.color=e.iconColor,n.type=e.name,n.isRegion=n.timeEnd&&n.time!==n.timeEnd;return i}}function Xr(){o.Ay.factory("backendSrv",()=>(0,Vr.AI)()),o.Ay.factory("contextSrv",()=>Wr.TP),o.Ay.factory("dashboardSrv",()=>(0,Vt.UA)()),o.Ay.factory("datasourceSrv",()=>(0,zr.l)()),o.Ay.factory("linkSrv",()=>(0,Hr.mQ)()),o.Ay.factory("validationSrv",()=>Kr.P),o.Ay.service("annotationsSrv",Yr),o.Ay.service("utilSrv",Qr)}const Jr={angular:{...I(),default:I()},"app/core/core_module":{default:o.m7,__useDefault:!0},"app/core/core":{appEvents:_e.A,contextSrv:Ar.TP,coreModule:o.m7},"app/plugins/sdk":Nr,"app/core/utils/promiseToDigest":{promiseToDigest:gt}};class Zr{constructor(){this.preBootModules=[],this.ngModuleDependencies=[],this.registerFunctions={}}init(){const e=I().module("grafana",[]);(0,Bt.f7)(Br),e.config(["$controllerProvider","$compileProvider","$filterProvider","$httpProvider","$provide","$sceDelegateProvider",(n,r,c,d,f,y)=>{Ye.$W.buildInfo.env!=="development"&&r.debugInfoEnabled(!1),d.useApplyAsync(!0),Ye.$W.pluginsCDNBaseURL&&y.trustedResourceUrlList(["self",`${Ye.$W.pluginsCDNBaseURL}/**`]),this.registerFunctions.controller=n.register,this.registerFunctions.directive=r.directive,this.registerFunctions.factory=f.factory,this.registerFunctions.service=f.service,this.registerFunctions.filter=c.register,f.decorator("$http",["$delegate","$templateCache",(b,N)=>{const v=b.get;return b.get=(M,L)=>(M.match(/\.html$/)&&(N.get(M)||(M+="?v="+new Date().getTime())),v(M,L)),b}])}]),this.ngModuleDependencies=["grafana.core","ngSanitize","grafana","pasvaz.bindonce","react"],o.yF.forEach(n=>{this.useModule(n)}),I().module("grafana.services").service("dashboardLoaderSrv",Sr.Fu),o.m7.factory("timeSrv",()=>(0,wr.jG)()),o.m7.factory("templateSrv",()=>(0,Lt.w)()),zi(),Xr(),Ur();const i=(0,Lr.kB)(Jr);Ir.z.addImportMap({imports:i}),$.fn.tooltip.defaults.animation=!1}useModule(e){return this.preBootModules?this.preBootModules.push(e):(0,T.extend)(e,this.registerFunctions),this.ngModuleDependencies.push(e.name),e}bootstrap(){const e=I().bootstrap(document.getElementById("ngRoot"),this.ngModuleDependencies);return jr(e),e.invoke(()=>(this.preBootModules.forEach(i=>{(0,T.extend)(i,this.registerFunctions)}),()=>{})),e}}},34757:(u,A,a)=>{"use strict";a.d(A,{a:()=>m});var s=a(2543),l=a.n(s);class m{constructor(C,o){this.$scope=C,this.$injector=o,this.panelCtrl=this.panelCtrl??C.ctrl.panelCtrl,this.target=this.target??C.ctrl.target,this.datasource=this.datasource??C.ctrl.datasource,this.panel=this.panelCtrl?.panel??C.ctrl.panelCtrl.panel,this.isLastQuery=(0,s.indexOf)(this.panel.targets,this.target)===this.panel.targets.length-1}refresh(){this.panelCtrl.refresh()}}},96320:(u,A,a)=>{"use strict";let s=a(12631);s.keys().forEach(l=>{s(l)})},88159:(u,A,a)=>{"use strict";a.d(A,{A:()=>ne});var s=a(74848),l=a(22803),m=a(58779),g=a(79784),C=a(37e3),o=a(54594),h=a(78464),E=a(11817);const p=(0,l.css)({textAlign:"center"}),S=(0,l.css)({maxWidth:"700px",margin:"0 auto"}),ne=({title:ie,buttonIcon:Z,buttonLink:ee,buttonTitle:B,buttonDisabled:K,onClick:T,proTip:ae,proTipLink:ge,proTipLinkTitle:X,proTipTarget:ce,infoBox:pe,infoBoxTitle:D})=>{const ue=()=>(0,s.jsxs)(s.Fragment,{children:[ae?(0,s.jsxs)("span",{children:[(0,s.jsx)(g.I,{name:"rocket"}),(0,s.jsxs)(E.x6,{i18nKey:"empty-list-cta.pro-tip",children:["ProTip: ",{proTip:ae}]}),ge&&(0,s.jsx)("a",{href:ge,target:ce,className:"text-link",children:X})]},"proTipFooter"):"",pe?(0,s.jsx)(C.F,{severity:"info",title:D??"",className:S,children:(0,s.jsx)("div",{dangerouslySetInnerHTML:pe})}):""]}),F=ue()?"":(0,l.css)({marginBottom:"20px"}),me=ee?o.z9:o.$n,O=(0,s.jsx)(me,{size:"lg",onClick:T,href:ee,icon:Z,className:F,"data-testid":m.Tp.components.CallToActionCard.buttonV2(B),disabled:K,children:B});return(0,s.jsx)(h.c,{className:p,message:ie,footer:ue(),callToActionElement:O})}},64570:(u,A,a)=>{"use strict";a.r(A),a.d(A,{MetricsPanelCtrl:()=>h,PanelCtrl:()=>o,QueryCtrl:()=>E,loadPluginCss:()=>l.PL});var s=a(26023),l=a(5885),m=a(8069),g=a(80759),C=a(34757);const o=(0,s.Y)(g.y),h=(0,s.Y)(m.F),E=(0,s.Y)(C.a)},13609:()=>{(function(u){"use strict";u(function(){u.support.transition=function(){var A=function(){var a=document.createElement("bootstrap"),s={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},l;for(l in s)if(a.style[l]!==void 0)return s[l]}();return A&&{end:A}}()})})(window.jQuery),function(u){"use strict";var A="[data-toggle=dropdown]",a=function(g){var C=u(g).on("click.dropdown.data-api",this.toggle);u("html").on("click.dropdown.data-api",function(){C.parent().removeClass("open")})};a.prototype={constructor:a,toggle:function(g){var C=u(this),o,h;if(!C.is(".disabled, :disabled"))return o=l(C),h=o.hasClass("open"),s(),h||("ontouchstart"in document.documentElement&&u('<div class="dropdown-backdrop"/>').insertBefore(u(this)).on("click",s),o.toggleClass("open")),C.focus(),!1},keydown:function(g){var C,o,h,E,p,S;if(/(38|40|27)/.test(g.keyCode)&&(C=u(this),g.preventDefault(),g.stopPropagation(),!C.is(".disabled, :disabled"))){if(E=l(C),p=E.hasClass("open"),!p||p&&g.keyCode==27)return g.which==27&&E.find(A).focus(),C.click();o=u("[role=menu] li:not(.divider):visible a",E),o.length&&(S=o.index(o.filter(":focus")),g.keyCode==38&&S>0&&S--,g.keyCode==40&&S<o.length-1&&S++,~S||(S=0),o.eq(S).focus())}}};function s(){u(".dropdown-backdrop").remove(),u(A).each(function(){l(u(this)).removeClass("open")})}function l(g){var C=g.attr("data-target"),o;return C||(C=g.attr("href"),C=C&&/#[A-Za-z]/.test(C)&&C.replace(/.*(?=#[^\s]*$)/,"")),o=C&&u.find(C),(!o||!o.length)&&(o=g.parent()),o}var m=u.fn.dropdown;u.fn.dropdown=function(g){return this.each(function(){var C=u(this),o=C.data("dropdown");o||C.data("dropdown",o=new a(this)),typeof g=="string"&&o[g].call(C)})},u.fn.dropdown.Constructor=a,u.fn.dropdown.noConflict=function(){return u.fn.dropdown=m,this},u(document).on("click.dropdown.data-api",s).on("click.dropdown.data-api",".dropdown form",function(g){g.stopPropagation()}).on("click.dropdown.data-api",A,a.prototype.toggle).on("keydown.dropdown.data-api",A+", [role=menu]",a.prototype.keydown)}(window.jQuery),function(u){"use strict";var A=function(s,l){this.options=l,this.$element=u(s).delegate('[data-dismiss="modal"]',"click.dismiss.modal",u.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};A.prototype={constructor:A,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var s=this,l=u.Event("show");this.$element.trigger(l),!(this.isShown||l.isDefaultPrevented())&&(this.isShown=!0,this.escape(),this.backdrop(function(){var m=u.support.transition&&s.$element.hasClass("fade");s.$element.parent().length||s.$element.appendTo(document.body),s.$element.show(),m&&s.$element[0].offsetWidth,s.$element.addClass("in").attr("aria-hidden",!1),s.enforceFocus(),m?s.$element.one(u.support.transition.end,function(){s.$element.focus().trigger("shown")}):s.$element.focus().trigger("shown")}))},hide:function(s){s&&s.preventDefault();var l=this;s=u.Event("hide"),this.$element.trigger(s),!(!this.isShown||s.isDefaultPrevented())&&(this.isShown=!1,this.escape(),u(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),u.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var s=this;u(document).on("focusin.modal",function(l){s.$element[0]!==l.target&&!s.$element.has(l.target).length&&s.$element.focus()})},escape:function(){var s=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(l){l.which==27&&s.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var s=this,l=setTimeout(function(){s.$element.off(u.support.transition.end),s.hideModal()},500);this.$element.one(u.support.transition.end,function(){clearTimeout(l),s.hideModal()})},hideModal:function(){var s=this;this.$element.hide(),this.backdrop(function(){s.removeBackdrop(),s.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(s){var l=this,m=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var g=u.support.transition&&m;if(this.$backdrop=u('<div class="modal-backdrop '+m+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?u.proxy(this.$element[0].focus,this.$element[0]):u.proxy(this.hide,this)),g&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!s)return;g?this.$backdrop.one(u.support.transition.end,s):s()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),u.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(u.support.transition.end,s):s()):s&&s()}};var a=u.fn.modal;u.fn.modal=function(s){return this.each(function(){var l=u(this),m=l.data("modal"),g=u.extend({},u.fn.modal.defaults,l.data(),typeof s=="object"&&s);m||l.data("modal",m=new A(this,g)),typeof s=="string"?m[s]():g.show&&m.show()})},u.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},u.fn.modal.Constructor=A,u.fn.modal.noConflict=function(){return u.fn.modal=a,this},u(document).on("click.modal.data-api",'[data-toggle="modal"]',function(s){var l=u(this),m=l.attr("href"),g=u.find(l.attr("data-target")||m&&m.replace(/.*(?=#[^\s]+$)/,"")),C=g.data("modal")?"toggle":u.extend({remote:!/#/.test(m)&&m},g.data(),l.data());s.preventDefault(),g.modal(C).one("hide",function(){l.focus()})})}(window.jQuery),function(u){"use strict";var A=function(s,l){this.init("tooltip",s,l)};A.prototype={constructor:A,init:function(s,l,m){var g,C,o,h,E;for(this.type=s,this.$element=u(l),this.options=this.getOptions(m),this.enabled=!0,o=this.options.trigger.split(" "),E=o.length;E--;)h=o[E],h=="click"?this.$element.on("click."+this.type,this.options.selector,u.proxy(this.toggle,this)):h!="manual"&&(g=h=="hover"?"mouseenter":"focus",C=h=="hover"?"mouseleave":"blur",this.$element.on(g+"."+this.type,this.options.selector,u.proxy(this.enter,this)),this.$element.on(C+"."+this.type,this.options.selector,u.proxy(this.leave,this)));this.options.selector?this._options=u.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(s){return s=u.extend({},u.fn[this.type].defaults,this.$element.data(),s),s.delay&&typeof s.delay=="number"&&(s.delay={show:s.delay,hide:s.delay}),s},enter:function(s){var l=u.fn[this.type].defaults,m={},g;if(this._options&&u.each(this._options,function(C,o){l[C]!=o&&(m[C]=o)},this),g=u(s.currentTarget)[this.type](m).data(this.type),!g.options.delay||!g.options.delay.show)return g.show();clearTimeout(this.timeout),g.hoverState="in",this.timeout=setTimeout(function(){g.hoverState=="in"&&g.show()},g.options.delay.show)},leave:function(s){var l=u(s.currentTarget)[this.type](this._options).data(this.type);if(this.timeout&&clearTimeout(this.timeout),!l.options.delay||!l.options.delay.hide)return l.hide();l.hoverState="out",this.timeout=setTimeout(function(){l.hoverState=="out"&&l.hide()},l.options.delay.hide)},show:function(){var s,l,m,g,C,o,h=u.Event("show");if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),h.isDefaultPrevented())return;switch(s=this.tip(),this.setContent(),this.options.animation&&s.addClass("fade"),C=typeof this.options.placement=="function"?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,s.detach().css({top:0,left:0,display:"block"}),this.options.container?s.appendTo(u.find(this.options.container)):s.insertAfter(this.$element),l=this.getPosition(),m=s[0].offsetWidth,g=s[0].offsetHeight,C){case"bottom":o={top:l.top+l.height,left:l.left+l.width/2-m/2};break;case"top":o={top:l.top-g,left:l.left+l.width/2-m/2};break;case"left":o={top:l.top+l.height/2-g/2,left:l.left-m};break;case"right":o={top:l.top+l.height/2-g/2,left:l.left+l.width};break;case"topLeft":o={top:l.top-g,left:l.left+l.width/2-m*.1};break;case"topRight":o={top:l.top-g,left:l.left+l.width/2-m*.9};break;case"rightTop":o={top:l.top+l.height/2-g*.1,left:l.left+l.width};break;case"rightBottom":o={top:l.top+l.height/2-g*.9,left:l.left+l.width};break;case"bottomLeft":o={top:l.top+l.height,left:l.left+l.width/2-m*.1};break;case"bottomRight":o={top:l.top+l.height,left:l.left+l.width/2-m*.9};break;case"leftTop":o={top:l.top+l.height/2-g*.1,left:l.left-m};break;case"leftBottom":o={top:l.top+l.height/2-g*.9,left:l.left-m};break}this.applyPlacement(o,C),this.$element.trigger("shown")}},applyPlacement:function(s,l){var m=this.tip(),g=m[0].offsetWidth,C=m[0].offsetHeight,o,h,E,p;m.offset(s).addClass(l).addClass("in"),o=m[0].offsetWidth,h=m[0].offsetHeight,l=="top"&&h!=C&&(s.top=s.top+C-h,p=!0),l=="bottom"||l=="top"?(E=0,s.left<0&&(E=s.left*-2,s.left=0,m.offset(s),o=m[0].offsetWidth,h=m[0].offsetHeight),this.replaceArrow(E-g+o,o,"left")):this.replaceArrow(h-C,h,"top"),p&&m.offset(s)},replaceArrow:function(s,l,m){this.arrow().css(m,s?50*(1-s/l)+"%":"")},setContent:function(){var s=this.tip(),l=this.getTitle();s.find(".tooltip-inner").text(l),s.removeClass("fade in top bottom left right")},hide:function(){var s=this,l=this.tip(),m=u.Event("hide");if(this.$element.trigger(m),m.isDefaultPrevented())return;l.removeClass("in");function g(){var C=setTimeout(function(){l.off(u.support.transition.end).detach()},500);l.one(u.support.transition.end,function(){clearTimeout(C),l.detach()})}return u.support.transition&&this.$tip.hasClass("fade")?g():l.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var s=this.$element;(s.attr("title")||typeof s.attr("data-original-title")!="string")&&s.attr("data-original-title",s.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var s=this.$element[0];return u.extend({},typeof s.getBoundingClientRect=="function"?s.getBoundingClientRect():{width:s.offsetWidth,height:s.offsetHeight},this.$element.offset())},getTitle:function(){var s,l=this.$element,m=this.options;return s=l.attr("data-original-title")||(typeof m.title=="function"?m.title.call(l[0]):m.title),s},tip:function(){return this.$tip=this.$tip||u(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(s){var l=s?u(s.currentTarget)[this.type](this._options).data(this.type):this;l.tip().hasClass("in")?l.hide():l.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var a=u.fn.tooltip;u.fn.tooltip=function(s){return this.each(function(){var l=u(this),m=l.data("tooltip"),g=typeof s=="object"&&s;m||l.data("tooltip",m=new A(this,g)),typeof s=="string"&&m[s]()})},u.fn.tooltip.Constructor=A,u.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},u.fn.tooltip.noConflict=function(){return u.fn.tooltip=a,this}}(window.jQuery),function(u){"use strict";var A=function(s){this.element=u(s)};A.prototype={constructor:A,show:function(){var s=this.element,l=s.closest("ul:not(.dropdown-menu)"),m=s.attr("data-target"),g,C,o;m||(m=s.attr("href"),m=m&&m.replace(/.*(?=#[^\s]*$)/,"")),!s.parent("li").hasClass("active")&&(g=l.find(".active:last a")[0],o=u.Event("show",{relatedTarget:g}),s.trigger(o),!o.isDefaultPrevented()&&(C=u.find(m),this.activate(s.parent("li"),l),this.activate(C,C.parent(),function(){s.trigger({type:"shown",relatedTarget:g})})))},activate:function(s,l,m){var g=l.find("> .active"),C=m&&u.support.transition&&g.hasClass("fade");function o(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),s.addClass("active"),C?(s[0].offsetWidth,s.addClass("in")):s.removeClass("fade"),s.parent(".dropdown-menu")&&s.closest("li.dropdown").addClass("active"),m&&m()}C?g.one(u.support.transition.end,o):o(),g.removeClass("in")}};var a=u.fn.tab;u.fn.tab=function(s){return this.each(function(){var l=u(this),m=l.data("tab");m||l.data("tab",m=new A(this)),typeof s=="string"&&m[s]()})},u.fn.tab.Constructor=A,u.fn.tab.noConflict=function(){return u.fn.tab=a,this},u(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(s){s.preventDefault(),u(this).tab("show")})}(window.jQuery),function(u){"use strict";var A=function(s,l){this.$element=u(s),this.options=u.extend({},u.fn.typeahead.defaults,l),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=u(this.options.menu),this.shown=!1,this.listen()};A.prototype={constructor:A,select:function(){var s=this.$menu.find(".active").attr("data-value")||this.$element.val();return this.$element.val(this.updater(s)).change(),this.hide()},updater:function(s){return s},show:function(){var s=u.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:s.top+s.height,left:s.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(s){var l;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(l=u.isFunction(this.source)?this.source(this.query,u.proxy(this.process,this)):this.source,l?this.process(l):this)},process:function(s){var l=this;return s=u.grep(s,function(m){return l.matcher(m)}),s=this.sorter(s),s.length?this.render(s.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(s){return~s.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(s){for(var l=[],m=[],g=[],C;C=s.shift();)C.toLowerCase().indexOf(this.query.toLowerCase())?~C.indexOf(this.query)?m.push(C):g.push(C):l.push(C);return l.concat(m,g)},highlighter:function(s){var l=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return l?s.replace(new RegExp("("+l+")","ig"),function(m,g){return"<strong>"+g+"</strong>"}):s},render:function(s){var l=this;return s=u(s).map(function(m,g){return m=u(l.options.item).attr("data-value",g),m.find("a").html(l.highlighter(g)),m[0]}),this.$menu.html(s),this},next:function(s){var l=this.$menu.find(".active").removeClass("active"),m=l.next();m.length||(m=u(this.$menu.find("li")[0])),m.addClass("active")},prev:function(s){var l=this.$menu.find(".active").removeClass("active"),m=l.prev();m.length||(m=this.$menu.find("li").last()),m.addClass("active")},listen:function(){this.$element.on("focus",u.proxy(this.focus,this)).on("blur",u.proxy(this.blur,this)).on("keypress",u.proxy(this.keypress,this)).on("keyup",u.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",u.proxy(this.keydown,this)),this.$menu.on("click",u.proxy(this.click,this)).on("mouseenter","li",u.proxy(this.mouseenter,this)).on("mouseleave","li",u.proxy(this.mouseleave,this))},destroy:function(){this.$element.off().removeData("typeahead"),this.$menu.off()},eventSupported:function(s){var l=s in this.$element;return l||(this.$element.setAttribute(s,"return;"),l=typeof this.$element[s]=="function"),l},move:function(s){if(this.shown&&!(s.shiftKey&&s.keyCode===40)){switch(s.keyCode){case 9:case 13:case 27:s.preventDefault();break;case 38:s.preventDefault(),this.prev();break;case 40:s.preventDefault(),this.next();break}s.stopPropagation()}},keydown:function(s){this.suppressKeyPressRepeat=~u.inArray(s.keyCode,[40,38,9,13,27,57]),this.move(s)},keypress:function(s){this.suppressKeyPressRepeat||this.move(s)},keyup:function(s){switch(s.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}s.keyCode===13&&typeof this.$menu.find(".active").attr("data-value")>"u"?this.$element.submit():(s.stopPropagation(),s.preventDefault())},focus:function(s){this.focused=!0},blur:function(s){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(s){s.stopPropagation(),s.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(s){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),u(s.currentTarget).addClass("active")},mouseleave:function(s){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var a=u.fn.typeahead;u.fn.typeahead=function(s){return this.each(function(){var l=u(this),m=l.data("typeahead"),g=typeof s=="object"&&s;m||l.data("typeahead",m=new A(this,g)),typeof s=="string"&&m[s]()})},u.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},u.fn.typeahead.Constructor=A,u.fn.typeahead.noConflict=function(){return u.fn.typeahead=a,this},u(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(s){var l=u(this);l.data("typeahead")||l.typeahead(l.data())})}(window.jQuery),function(u){"use strict";var A=function(s,l){this.options=u.extend({},u.fn.affix.defaults,l),this.$window=u(window).on("scroll.affix.data-api",u.proxy(this.checkPosition,this)).on("click.affix.data-api",u.proxy(function(){setTimeout(u.proxy(this.checkPosition,this),1)},this)),this.$element=u(s),this.checkPosition()};A.prototype.checkPosition=function(){if(this.$element.is(":visible")){var s=u(document).height(),l=this.$window.scrollTop(),m=this.$element.offset(),g=this.options.offset,C=g.bottom,o=g.top,h="affix affix-top affix-bottom",E;typeof g!="object"&&(C=o=g),typeof o=="function"&&(o=g.top()),typeof C=="function"&&(C=g.bottom()),E=this.unpin!=null&&l+this.unpin<=m.top?!1:C!=null&&m.top+this.$element.height()>=s-C?"bottom":o!=null&&l<=o?"top":!1,this.affixed!==E&&(this.affixed=E,this.unpin=E=="bottom"?m.top-l:null,this.$element.removeClass(h).addClass("affix"+(E?"-"+E:"")))}};var a=u.fn.affix;u.fn.affix=function(s){return this.each(function(){var l=u(this),m=l.data("affix"),g=typeof s=="object"&&s;m||l.data("affix",m=new A(this,g)),typeof s=="string"&&m[s]()})},u.fn.affix.Constructor=A,u.fn.affix.defaults={offset:0},u.fn.affix.noConflict=function(){return u.fn.affix=a,this},u(window).on("load",function(){u('[data-spy="affix"]').each(function(){var s=u(this),l=s.data();l.offset=l.offset||{},l.offsetBottom&&(l.offset.bottom=l.offsetBottom),l.offsetTop&&(l.offset.top=l.offsetTop),s.affix(l)})})}(window.jQuery)},42346:()=>{(function(u){"use strict";var A={tagClass:function(o){return"label label-info"},itemValue:function(o){return o&&o.toString()},itemText:function(o){return this.itemValue(o)},freeInput:!0,maxTags:void 0,confirmKeys:[13],onTagExists:function(o,h){h.hide().fadeIn()}};function a(o,h){this.itemsArray=[],this.$element=u(o),this.$element.hide(),this.widthClass=h.widthClass||"width-9",this.isSelect=o.tagName==="SELECT",this.multiple=this.isSelect&&o.hasAttribute("multiple"),this.objectItems=h&&h.itemValue,this.placeholderText=o.hasAttribute("placeholder")?this.$element.attr("placeholder"):"",this.$container=u('<div class="bootstrap-tagsinput"></div>'),this.$input=u('<input class="gf-form-input '+this.widthClass+'" type="text" placeholder="'+this.placeholderText+'"/>').appendTo(this.$container),this.$element.after(this.$container),this.build(h)}a.prototype={constructor:a,add:function(o,h){var E=this;if(!(E.options.maxTags&&E.itemsArray.length>=E.options.maxTags)&&!(o!==!1&&!o)){if(typeof o=="object"&&!E.objectItems)throw"Can't add objects when itemValue option is not set";if(!o.toString().match(/^\s*$/)){if(E.isSelect&&!E.multiple&&E.itemsArray.length>0&&E.remove(E.itemsArray[0]),typeof o=="string"&&this.$element[0].tagName==="INPUT"){var p=o.split(",");if(p.length>1){for(var S=0;S<p.length;S++)this.add(p[S],!0);h||E.pushVal();return}}var I=E.options.itemValue(o),ne=E.options.itemText(o),ie=E.options.tagClass(o),Z=u.grep(E.itemsArray,function(T){return E.options.itemValue(T)===I})[0];if(Z){if(E.options.onTagExists){var ee=u(".tag",E.$container).filter(function(){return u(this).data("item")===Z});E.options.onTagExists(o,ee)}return}E.itemsArray.push(o);var B=u('<span class="tag '+g(ie)+'">'+g(ne)+'<span data-role="remove"></span></span>');if(B.data("item",o),E.findInputWrapper().before(B),B.after(" "),E.isSelect&&!u('option[value="'+escape(I)+'"]',E.$element)[0]){var K=u("<option selected>"+g(ne)+"</option>");K.data("item",o),K.attr("value",I),E.$element.append(K)}h||E.pushVal(),E.options.maxTags===E.itemsArray.length&&E.$container.addClass("bootstrap-tagsinput-max"),E.$element.trigger(u.Event("itemAdded",{item:o}))}}},remove:function(o,h){var E=this;E.objectItems&&(typeof o=="object"?o=u.grep(E.itemsArray,function(p){return E.options.itemValue(p)==E.options.itemValue(o)})[0]:o=u.grep(E.itemsArray,function(p){return E.options.itemValue(p)==o})[0]),o&&(u(".tag",E.$container).filter(function(){return u(this).data("item")===o}).remove(),u("option",E.$element).filter(function(){return u(this).data("item")===o}).remove(),E.itemsArray.splice(u.inArray(o,E.itemsArray),1)),h||E.pushVal(),E.options.maxTags>E.itemsArray.length&&E.$container.removeClass("bootstrap-tagsinput-max"),E.$element.trigger(u.Event("itemRemoved",{item:o}))},removeAll:function(){var o=this;for(u(".tag",o.$container).remove(),u("option",o.$element).remove();o.itemsArray.length>0;)o.itemsArray.pop();o.pushVal(),o.options.maxTags&&!this.isEnabled()&&this.enable()},refresh:function(){var o=this;u(".tag",o.$container).each(function(){var h=u(this),E=h.data("item"),p=o.options.itemValue(E),S=o.options.itemText(E),I=o.options.tagClass(E);if(h.attr("class",null),h.addClass("tag "+g(I)),h.contents().filter(function(){return this.nodeType==3})[0].nodeValue=g(S),o.isSelect){var ne=u("option",o.$element).filter(function(){return u(this).data("item")===E});ne.attr("value",p)}})},items:function(){return this.itemsArray},pushVal:function(){var o=this,h=u.map(o.items(),function(E){return o.options.itemValue(E).toString()});o.$element.val(h,!0).trigger("change")},build:function(o){var h=this;h.options=u.extend({},A,o);var E=h.options.typeahead||{};h.objectItems&&(h.options.freeInput=!1),s(h.options,"itemValue"),s(h.options,"itemText"),s(h.options,"tagClass"),h.options.source&&(E.source=h.options.source),E.source&&u.fn.typeahead&&(l(E,"source"),h.$input.typeahead({source:function(p,S){function I(Z){for(var ee=[],B=0;B<Z.length;B++){var K=h.options.itemText(Z[B]);ne[K]=Z[B],ee.push(K)}S(ee)}this.map={};var ne=this.map,ie=E.source(p);u.isFunction(ie.success)?ie.success(I):u.when(ie).then(I)},updater:function(p){h.add(this.map[p])},matcher:function(p){return p.toLowerCase().indexOf(this.query.trim().toLowerCase())!==-1},sorter:function(p){return p.sort()},highlighter:function(p){var S=new RegExp("("+this.query+")","gi");return p.replace(S,"<strong>$1</strong>")}})),h.$container.on("click",u.proxy(function(p){h.$input.focus()},h)),h.$container.on("blur","input",u.proxy(function(p){var S=u(p.target);h.add(S.val()),S.val(""),p.preventDefault()},h)),h.$container.on("keydown","input",u.proxy(function(p){var S=u(p.target),I=h.findInputWrapper();switch(p.which){case 8:if(C(S[0])===0){var ne=I.prev();ne&&h.remove(ne.data("item"))}break;case 46:if(C(S[0])===0){var ie=I.next();ie&&h.remove(ie.data("item"))}break;case 37:var Z=I.prev();S.val().length===0&&Z[0]&&(Z.before(I),S.focus());break;case 39:var ee=I.next();S.val().length===0&&ee[0]&&(ee.after(I),S.focus());break;default:h.options.freeInput&&u.inArray(p.which,h.options.confirmKeys)>=0&&(h.add(S.val()),S.val(""),p.preventDefault())}S.attr("size",Math.max(this.inputSize,S.val().length))},h)),h.$container.on("click","[data-role=remove]",u.proxy(function(p){h.remove(u(p.target).closest(".tag").data("item")),p.stopPropagation()},h)),h.options.itemValue===A.itemValue&&(h.$element[0].tagName==="INPUT"?h.add(h.$element.val()):u("option",h.$element).each(function(){h.add(u(this).attr("value"),!0)}))},destroy:function(){var o=this;o.$container.off("keypress","input"),o.$container.off("click","[role=remove]"),o.$container.remove(),o.$element.removeData("tagsinput"),o.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findInputWrapper:function(){for(var o=this.$input[0],h=this.$container[0];o&&o.parentNode!==h;)o=o.parentNode;return u(o)}},u.fn.tagsinput=function(o,h){var E=[];return this.each(function(){var p=u(this).data("tagsinput");if(!p)p=new a(this,o),u(this).data("tagsinput",p),E.push(p),this.tagName==="SELECT"&&u("option",u(this)).attr("selected","selected"),u(this).val(u(this).val());else{var S=p[o](h);S!==void 0&&E.push(S)}}),typeof o=="string"?E.length>1?E:E[0]:E},u.fn.tagsinput.Constructor=a;function s(o,h){if(typeof o[h]!="function"){var E=o[h];o[h]=function(p){return p[E]}}}function l(o,h){if(typeof o[h]!="function"){var E=o[h];o[h]=function(){return E}}}var m=u("<div />");function g(o){return o?m.text(o).html():""}function C(o){var h=0;if(document.selection){o.focus();var E=document.selection.createRange();E.moveStart("character",-o.value.length),h=E.text.length}else(o.selectionStart||o.selectionStart=="0")&&(h=o.selectionStart);return h}u(function(){u("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})})(window.jQuery)},84523:(u,A,a)=>{"use strict";a.d(A,{X:()=>g});var s=a(22803),l=a(96540),m=a(29675);const g=({children:o})=>{const h=(0,m.of)(C);return l.createElement("div",{className:h.root},o)},C=o=>({root:(0,s.css)({display:"flex",flexWrap:"wrap",alignItems:"center",gap:o.spacing(3),minHeight:o.spacing(4)})})},40263:(u,A,a)=>{"use strict";a.d(A,{Z:()=>l});var s=a(96540);const l=({grow:m,shrink:g})=>s.createElement("div",{style:{display:"block",flexGrow:m,flexShrink:g}})},75686:(u,A,a)=>{"use strict";a.d(A,{W:()=>o});var s=a(22803),l=a(96540),m=a(29675),g=a(44826),C=a(69145);function o({label:S,...I}){const[ne]=(0,l.useState)(()=>Math.random().toString(16).slice(2)),ie=(0,m.of)(p),Z={SelectContainer:h,ValueContainer:E,SingleValue:E};return l.createElement("div",{className:ie.root},S&&l.createElement("label",{className:ie.label,htmlFor:ne},S,":","\xA0"),l.createElement(g.l6,{openMenuOnFocus:!0,inputId:ne,...I,components:Z}))}const h=S=>{const{children:I}=S,ne=(0,m.of)(p);return l.createElement(C.K,{...S,className:(0,s.cx)(S.className,ne.container)},I)},E=S=>{const{className:I,children:ne}=S,ie=(0,m.of)(p);return l.createElement("div",{className:(0,s.cx)(I,ie.valueContainer)},ne)},p=S=>({root:(0,s.css)({display:"flex",fontSize:12,alignItems:"center"}),label:(0,s.css)({color:S.colors.text.secondary,whiteSpace:"nowrap"}),container:(0,s.css)({background:"none",borderColor:"transparent"}),valueContainer:(0,s.css)({display:"flex",alignItems:"center",flex:"initial",color:S.colors.text.secondary,fontSize:12})})}}]);

//# sourceMappingURL=9978.507127aad5c8f9a1e166.js.map