text: define(["lodash","jquery","app/core/utils/kbn","app/core/core","moment","angular","app/core/config","app/plugins/sdk","vendor/flot/jquery.flot.js","app/core/core_module","vendor/flot/jquery.flot.time.js","vendor/flot/jquery.flot.selection.js","vendor/flot/jquery.flot.stack.js","vendor/flot/jquery.flot.stackpercent.js","vendor/flot/jquery.flot.fillbelow.js","vendor/flot/jquery.flot.crosshair.js","vendor/flot/jquery.flot.dashes.js","vendor/flot/jquery.flot.gauge.js","vendor/flot/jquery.flot.pie.js"],function(t,e,n,i,o,r,s,a,l,h,c,d,u,f,p,g,v,m,b){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=28)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e){t.exports=n},function(t,e){t.exports=i},function(t,e){t.exports=o},function(t,e){t.exports=r},function(t,e,n){"use strict";var i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(r){var s=/^\s+/,a=/\s+$/,l=0,h=r.round,c=r.min,d=r.max,u=r.random;function f(t,e){if(e=e||{},(t=t||"")instanceof f)return t;if(!(this instanceof f))return new f(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,i=null,l=null,h=null,u=!1,f=!1;"string"==typeof t&&(t=function(t){t=t.replace(s,"").replace(a,"").toLowerCase();var e,n=!1;if(L[t])t=L[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=I.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=I.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=I.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=I.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=I.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=I.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=I.hex8.exec(t))return{r:X(e[1]),g:X(e[2]),b:X(e[3]),a:N(e[4]),format:n?"name":"hex8"};if(e=I.hex6.exec(t))return{r:X(e[1]),g:X(e[2]),b:X(e[3]),format:n?"name":"hex"};if(e=I.hex4.exec(t))return{r:X(e[1]+""+e[1]),g:X(e[2]+""+e[2]),b:X(e[3]+""+e[3]),a:N(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=I.hex3.exec(t))return{r:X(e[1]+""+e[1]),g:X(e[2]+""+e[2]),b:X(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==(void 0===t?"undefined":o(t))&&($(t.r)&&$(t.g)&&$(t.b)?(p=t.r,g=t.g,v=t.b,e={r:255*Y(p,255),g:255*Y(g,255),b:255*Y(v,255)},u=!0,f="%"===String(t.r).substr(-1)?"prgb":"rgb"):$(t.h)&&$(t.s)&&$(t.v)?(i=R(t.s),l=R(t.v),e=function(t,e,n){t=6*Y(t,360),e=Y(e,100),n=Y(n,100);var i=r.floor(t),o=t-i,s=n*(1-e),a=n*(1-o*e),l=n*(1-(1-o)*e),h=i%6;return{r:255*[n,a,s,s,l,n][h],g:255*[l,n,n,a,s,s][h],b:255*[s,s,l,n,n,a][h]}}(t.h,i,l),u=!0,f="hsv"):$(t.h)&&$(t.s)&&$(t.l)&&(i=R(t.s),h=R(t.l),e=function(t,e,n){var i,o,r;function s(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=Y(t,360),e=Y(e,100),n=Y(n,100),0===e)i=o=r=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=s(l,a,t+1/3),o=s(l,a,t),r=s(l,a,t-1/3)}return{r:255*i,g:255*o,b:255*r}}(t.h,i,h),u=!0,f="hsl"),t.hasOwnProperty("a")&&(n=t.a));var p,g,v;return n=D(n),{ok:u,format:t.format||f,r:c(255,d(e.r,0)),g:c(255,d(e.g,0)),b:c(255,d(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=h(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=h(this._r)),this._g<1&&(this._g=h(this._g)),this._b<1&&(this._b=h(this._b)),this._ok=n.ok,this._tc_id=l++}function p(t,e,n){t=Y(t,255),e=Y(e,255),n=Y(n,255);var i,o,r=d(t,e,n),s=c(t,e,n),a=(r+s)/2;if(r==s)i=o=0;else{var l=r-s;switch(o=a>.5?l/(2-r-s):l/(r+s),r){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4}i/=6}return{h:i,s:o,l:a}}function g(t,e,n){t=Y(t,255),e=Y(e,255),n=Y(n,255);var i,o,r=d(t,e,n),s=c(t,e,n),a=r,l=r-s;if(o=0===r?0:l/r,r==s)i=0;else{switch(r){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4}i/=6}return{h:i,s:o,v:a}}function v(t,e,n,i){var o=[W(h(t).toString(16)),W(h(e).toString(16)),W(h(n).toString(16))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function m(t,e,n,i){return[W(F(i)),W(h(t).toString(16)),W(h(e).toString(16)),W(h(n).toString(16))].join("")}function b(t,e){e=0===e?0:e||10;var n=f(t).toHsl();return n.s-=e/100,n.s=P(n.s),f(n)}function y(t,e){e=0===e?0:e||10;var n=f(t).toHsl();return n.s+=e/100,n.s=P(n.s),f(n)}function x(t){return f(t).desaturate(100)}function w(t,e){e=0===e?0:e||10;var n=f(t).toHsl();return n.l+=e/100,n.l=P(n.l),f(n)}function _(t,e){e=0===e?0:e||10;var n=f(t).toRgb();return n.r=d(0,c(255,n.r-h(-e/100*255))),n.g=d(0,c(255,n.g-h(-e/100*255))),n.b=d(0,c(255,n.b-h(-e/100*255))),f(n)}function O(t,e){e=0===e?0:e||10;var n=f(t).toHsl();return n.l-=e/100,n.l=P(n.l),f(n)}function C(t,e){var n=f(t).toHsl(),i=(n.h+e)%360;return n.h=i<0?360+i:i,f(n)}function E(t){var e=f(t).toHsl();return e.h=(e.h+180)%360,f(e)}function S(t){var e=f(t).toHsl(),n=e.h;return[f(t),f({h:(n+120)%360,s:e.s,l:e.l}),f({h:(n+240)%360,s:e.s,l:e.l})]}function A(t){var e=f(t).toHsl(),n=e.h;return[f(t),f({h:(n+90)%360,s:e.s,l:e.l}),f({h:(n+180)%360,s:e.s,l:e.l}),f({h:(n+270)%360,s:e.s,l:e.l})]}function T(t){var e=f(t).toHsl(),n=e.h;return[f(t),f({h:(n+72)%360,s:e.s,l:e.l}),f({h:(n+216)%360,s:e.s,l:e.l})]}function k(t,e,n){e=e||6,n=n||30;var i=f(t).toHsl(),o=360/n,r=[f(t)];for(i.h=(i.h-(o*e>>1)+720)%360;--e;)i.h=(i.h+o)%360,r.push(f(i));return r}function M(t,e){e=e||6;for(var n=f(t).toHsv(),i=n.h,o=n.s,r=n.v,s=[],a=1/e;e--;)s.push(f({h:i,s:o,v:r})),r=(r+a)%1;return s}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,i=this.toRgb();return t=i.r/255,e=i.g/255,n=i.b/255,.2126*(t<=.03928?t/12.92:r.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:r.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:r.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=D(t),this._roundA=h(100*this._a)/100,this},toHsv:function(){var t=g(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=g(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),i=h(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+i+"%)":"hsva("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),i=h(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+i+"%)":"hsla("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return v(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,i,o){var r=[W(h(t).toString(16)),W(h(e).toString(16)),W(h(n).toString(16)),W(F(i))];if(o&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)&&r[3].charAt(0)==r[3].charAt(1))return r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0);return r.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:h(this._r),g:h(this._g),b:h(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+h(this._r)+", "+h(this._g)+", "+h(this._b)+")":"rgba("+h(this._r)+", "+h(this._g)+", "+h(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:h(100*Y(this._r,255))+"%",g:h(100*Y(this._g,255))+"%",b:h(100*Y(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+h(100*Y(this._r,255))+"%, "+h(100*Y(this._g,255))+"%, "+h(100*Y(this._b,255))+"%)":"rgba("+h(100*Y(this._r,255))+"%, "+h(100*Y(this._g,255))+"%, "+h(100*Y(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(H[v(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+m(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var o=f(t);n="#"+m(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0;return e||!i||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(O,arguments)},desaturate:function(){return this._applyModification(b,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(C,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(S,arguments)},tetrad:function(){return this._applyCombination(A,arguments)}},f.fromRatio=function(t,e){if("object"==(void 0===t?"undefined":o(t))){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:R(t[i]));t=n}return f(t,e)},f.equals=function(t,e){return!(!t||!e)&&f(t).toRgbString()==f(e).toRgbString()},f.random=function(){return f.fromRatio({r:u(),g:u(),b:u()})},f.mix=function(t,e,n){n=0===n?0:n||50;var i=f(t).toRgb(),o=f(e).toRgb(),r=n/100;return f({r:(o.r-i.r)*r+i.r,g:(o.g-i.g)*r+i.g,b:(o.b-i.b)*r+i.b,a:(o.a-i.a)*r+i.a})},f.readability=function(t,e){var n=f(t),i=f(e);return(r.max(n.getLuminance(),i.getLuminance())+.05)/(r.min(n.getLuminance(),i.getLuminance())+.05)},f.isReadable=function(t,e,n){var i,o,r=f.readability(t,e);switch(o=!1,(i=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+i.size){case"AAsmall":case"AAAlarge":o=r>=4.5;break;case"AAlarge":o=r>=3;break;case"AAAsmall":o=r>=7}return o},f.mostReadable=function(t,e,n){var i,o,r,s,a=null,l=0;o=(n=n||{}).includeFallbackColors,r=n.level,s=n.size;for(var h=0;h<e.length;h++)(i=f.readability(t,e[h]))>l&&(l=i,a=f(e[h]));return f.isReadable(t,a,{level:r,size:s})||!o?a:(n.includeFallbackColors=!1,f.mostReadable(t,["#fff","#000"],n))};var L=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},H=f.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(L);function D(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Y(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=c(e,d(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),r.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function P(t){return c(1,d(0,t))}function X(t){return parseInt(t,16)}function W(t){return 1==t.length?"0"+t:""+t}function R(t){return t<=1&&(t=100*t+"%"),t}function F(t){return r.round(255*parseFloat(t)).toString(16)}function N(t){return X(t)/255}var j,B,z,I=(B="[\\s|\\(]+("+(j="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",z="[\\s|\\(]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",{CSS_UNIT:new RegExp(j),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+z),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+z),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+z),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function $(t){return!!I.CSS_UNIT.exec(t)}t.exports?t.exports=f:void 0===(i=function(){return f}.call(e,n,e,t))||(t.exports=i)}(Math)},function(t,e){t.exports=s},function(t,e){t.exports=a},function(t,e){t.exports=l},function(t,e,n){"use strict";var i,o;i=[n(1),n(3)],void 0===(o=function(t,e){var n=e.appEvents;return function(e,i,o,r){var s=this,a=o.ctrl.panel,l=t('<div class="graph-tooltip">');this.destroy=function(){l.remove()},this.findHoverIndexFromDataPoints=function(t,e,n){for(var i=e.datapoints.pointsize,o=n*i,r=e.datapoints.points.length,s=o;s<r;s+=i)if(!e.lines.steps&&null!=e.datapoints.points[o]&&null==e.datapoints.points[s]||e.datapoints.points[s]>t)return Math.max(s-i,0)/i;return s/i-1},this.findHoverIndexFromData=function(t,e){for(var n,i=0,o=e.data.length-1;;){if(i>o)return Math.max(o,0);if(n=Math.floor((i+o)/2),e.data[n][0]===t)return n;e.data[n][0]<t?i=n+1:o=n-1}},this.renderAndShow=function(t,e,n,i){"time"===i&&(e='<div class="graph-tooltip-time">'+t+"</div>"+e),l.html(e).place_tt(n.pageX+20,n.pageY)},this.getMultiSeriesPlotHoverInfo=function(t,e){var n,i,o,r,s,l,h,c,d,u=[[],[],[]],f=0;for(i=0;i<t.length;i++)!(o=t[i]).data.length||a.legend.hideEmpty&&o.allIsNull?u[0].push({hidden:!0,value:0}):!o.data.length||a.legend.hideZero&&o.allIsZero?u[0].push({hidden:!0,value:0}):(r=this.findHoverIndexFromData(e.x,o),s=e.x-o.data[r][0],l=o.data[r][0],(!c||s>=0&&(s<c||c<0)||s<0&&s>c)&&(c=s,d=l),n=o.stack?"individual"===a.tooltip.value_type?o.data[r][1]:o.stack?f+=o.data[r][1]:o.data[r][1]:o.data[r][1],(o.lines.steps||o.stack)&&(r=this.findHoverIndexFromDataPoints(e.x,o,r)),h=0,o.yaxis&&(h=o.yaxis.n),u[h].push({value:n,hoverIndex:r,color:o.color,label:o.aliasEscaped,time:l,distance:s,index:i}));return(u=u[0].concat(u[1],u[2])).time=d,u},e.mouseleave(function(){if(a.tooltip.shared){var t=e.data().plot;t&&(l.detach(),t.unhighlight())}n.emit("graph-hover-clear")}),e.bind("plothover",function(t,i,o){s.show(i,o),i.panelRelY=(i.pageY-e.offset().top)/e.height(),n.emit("graph-hover",{pos:i,panel:a})}),e.bind("plotclick",function(t,e,i){n.emit("graph-click",{pos:e,panel:a,item:i})}),this.clear=function(t){l.detach(),t.clearCrosshair(),t.unhighlight()},this.show=function(n,o){var h,c,d,u,f,p,g,v,m=e.data().plot,b=m.getData(),y=m.getXAxes()[0].options.mode,x=r(),w=a.tooltip.shared;if(n.panelRelY){var _=m.pointOffset({x:n.x});if(Number.isNaN(_.left)||_.left<0||_.left>e.width())return void s.clear(m);if(n.pageX=e.offset().left+_.left,n.pageY=e.offset().top+e.height()*n.panelRelY,!(n.pageY>=t(window).scrollTop()&&n.pageY<=t(window).innerHeight()+t(window).scrollTop()))return void s.clear(m);if(m.setCrosshair(n),w=!0,i.sharedCrosshairModeOnly())return}if(0!==x.length)if(v=x[0].hasMsResolution?"YYYY-MM-DD HH:mm:ss.SSS":"YYYY-MM-DD HH:mm:ss",w){m.unhighlight();var O=s.getMultiSeriesPlotHoverInfo(b,n);for(g="",d=i.formatDate(O.time,v),2===a.tooltip.sort?O.sort(function(t,e){return e.value-t.value}):1===a.tooltip.sort&&O.sort(function(t,e){return t.value-e.value}),f=0;f<O.length;f++)if(!(u=O[f]).hidden){var C="";o&&u.index===o.seriesIndex&&(C="graph-tooltip-list-item--highlight"),c=(p=x[u.index]).formatValue(u.value),g+='<div class="graph-tooltip-list-item '+C+'"><div class="graph-tooltip-series-name">',g+='<i class="fa fa-minus" style="color:'+u.color+';"></i> '+u.label+":</div>",g+='<div class="graph-tooltip-value">'+c+"</div></div>",m.highlight(u.index,u.hoverIndex)}s.renderAndShow(d,g,n,y)}else o?(p=x[o.seriesIndex],h='<div class="graph-tooltip-list-item"><div class="graph-tooltip-series-name">',h+='<i class="fa fa-minus" style="color:'+o.series.color+';"></i> '+p.aliasEscaped+":</div>",c=a.stack&&"individual"===a.tooltip.value_type?o.datapoint[1]-o.datapoint[2]:o.datapoint[1],c=p.formatValue(c),d=i.formatDate(o.datapoint[0],v),h+='<div class="graph-tooltip-value">'+c+"</div>",s.renderAndShow(d,h,n,y)):l.detach()}}}.apply(e,i))||(t.exports=o)},function(t,e,n){"use strict";
  /*!
                                                                               * perfect-scrollbar v1.4.0
                                                                               * (c) 2018 Hyunje Jun
                                                                               * @license MIT
                                                                               */
  function i(t){return getComputedStyle(t)}function o(t,e){for(var n in e){var i=e[n];"number"==typeof i&&(i+="px"),t.style[n]=i}return t}function r(t){var e=document.createElement("div");return e.className=t,e}Object.defineProperty(e,"__esModule",{value:!0});var s="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function a(t,e){if(!s)throw new Error("No element matching method supported");return s.call(t,e)}function l(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function h(t,e){return Array.prototype.filter.call(t.children,function(t){return a(t,e)})}var c={main:"ps",element:{thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}}},d={x:null,y:null};function u(t,e){var n=t.element.classList,i=c.state.scrolling(e);n.contains(i)?clearTimeout(d[e]):n.add(i)}function f(t,e){d[e]=setTimeout(function(){return t.isAlive&&t.element.classList.remove(c.state.scrolling(e))},t.settings.scrollingThreshold)}var p=function(t){this.element=t,this.handlers={}},g={isEmpty:{configurable:!0}};p.prototype.bind=function(t,e){void 0===this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},p.prototype.unbind=function(t,e){var n=this;this.handlers[t]=this.handlers[t].filter(function(i){return!(!e||i===e)||(n.element.removeEventListener(t,i,!1),!1)})},p.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},g.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every(function(e){return 0===t.handlers[e].length})},Object.defineProperties(p.prototype,g);var v=function(){this.eventElements=[]};function m(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}v.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return e||(e=new p(t),this.eventElements.push(e)),e},v.prototype.bind=function(t,e,n){this.eventElement(t).bind(e,n)},v.prototype.unbind=function(t,e,n){var i=this.eventElement(t);i.unbind(e,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)},v.prototype.unbindAll=function(){this.eventElements.forEach(function(t){return t.unbindAll()}),this.eventElements=[]},v.prototype.once=function(t,e,n){var i=this.eventElement(t);i.bind(e,function t(o){i.unbind(e,t),n(o)})};var b=function(t,e,n,i,o){var r;if(void 0===i&&(i=!0),void 0===o&&(o=!1),"top"===e)r=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==e)throw new Error("A proper axis should be provided");r=["contentWidth","containerWidth","scrollLeft","x","left","right"]}!function(t,e,n,i,o){var r=n[0],s=n[1],a=n[2],l=n[3],h=n[4],c=n[5];void 0===i&&(i=!0);void 0===o&&(o=!1);var d=t.element;t.reach[l]=null,d[a]<1&&(t.reach[l]="start");d[a]>t[r]-t[s]-1&&(t.reach[l]="end");e&&(d.dispatchEvent(m("ps-scroll-"+l)),e<0?d.dispatchEvent(m("ps-scroll-"+h)):e>0&&d.dispatchEvent(m("ps-scroll-"+c)),i&&function(t,e){u(t,e),f(t,e)}(t,l));t.reach[l]&&(e||o)&&d.dispatchEvent(m("ps-"+l+"-reach-"+t.reach[l]))}(t,n,r,i,o)};function y(t){return parseInt(t,10)||0}var x={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)},w=function(t){var e=t.element,n=Math.floor(e.scrollTop);t.containerWidth=e.clientWidth,t.containerHeight=e.clientHeight,t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||(h(e,c.element.rail("x")).forEach(function(t){return l(t)}),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(h(e,c.element.rail("y")).forEach(function(t){return l(t)}),e.appendChild(t.scrollbarYRail)),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset<t.contentWidth?(t.scrollbarXActive=!0,t.railXWidth=t.containerWidth-t.railXMarginWidth,t.railXRatio=t.containerWidth/t.railXWidth,t.scrollbarXWidth=_(t,y(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=y((t.negativeScrollAdjustment+e.scrollLeft)*(t.railXWidth-t.scrollbarXWidth)/(t.contentWidth-t.containerWidth))):t.scrollbarXActive=!1,!t.settings.suppressScrollY&&t.containerHeight+t.settings.scrollYMarginOffset<t.contentHeight?(t.scrollbarYActive=!0,t.railYHeight=t.containerHeight-t.railYMarginHeight,t.railYRatio=t.containerHeight/t.railYHeight,t.scrollbarYHeight=_(t,y(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=y(n*(t.railYHeight-t.scrollbarYHeight)/(t.contentHeight-t.containerHeight))):t.scrollbarYActive=!1,t.scrollbarXLeft>=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),function(t,e){var n={width:e.railXWidth},i=Math.floor(t.scrollTop);e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:n.left=t.scrollLeft;e.isScrollbarXUsingBottom?n.bottom=e.scrollbarXBottom-i:n.top=e.scrollbarXTop+i;o(e.scrollbarXRail,n);var r={top:i,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?r.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth:r.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?r.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:r.left=e.scrollbarYLeft+t.scrollLeft;o(e.scrollbarYRail,r),o(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),o(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}(e,t),t.scrollbarXActive?e.classList.add(c.state.active("x")):(e.classList.remove(c.state.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=0),t.scrollbarYActive?e.classList.add(c.state.active("y")):(e.classList.remove(c.state.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)};function _(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function O(t,e){var n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],l=e[6],h=e[7],d=e[8],p=t.element,g=null,v=null,m=null;function b(e){p[l]=g+m*(e[o]-v),u(t,h),w(t),e.stopPropagation(),e.preventDefault()}function y(){f(t,h),t[d].classList.remove(c.state.clicking),t.event.unbind(t.ownerDocument,"mousemove",b)}t.event.bind(t[s],"mousedown",function(e){g=p[l],v=e[o],m=(t[i]-t[n])/(t[r]-t[a]),t.event.bind(t.ownerDocument,"mousemove",b),t.event.once(t.ownerDocument,"mouseup",y),t[d].classList.add(c.state.clicking),e.stopPropagation(),e.preventDefault()})}var C={"click-rail":function(t){t.event.bind(t.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarYRail,"mousedown",function(e){var n=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top>t.scrollbarYTop?1:-1;t.element.scrollTop+=n*t.containerHeight,w(t),e.stopPropagation()}),t.event.bind(t.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarXRail,"mousedown",function(e){var n=e.pageX-window.pageXOffset-t.scrollbarXRail.getBoundingClientRect().left>t.scrollbarXLeft?1:-1;t.element.scrollLeft+=n*t.containerWidth,w(t),e.stopPropagation()})},"drag-thumb":function(t){O(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),O(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(t){var e=t.element;t.event.bind(t.ownerDocument,"keydown",function(n){if(!(n.isDefaultPrevented&&n.isDefaultPrevented()||n.defaultPrevented)&&(a(e,":hover")||a(t.scrollbarX,":focus")||a(t.scrollbarY,":focus"))){var i,o=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(o){if("IFRAME"===o.tagName)o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(a(i=o,"input,[contenteditable]")||a(i,"select,[contenteditable]")||a(i,"textarea,[contenteditable]")||a(i,"button,[contenteditable]"))return}var r=0,s=0;switch(n.which){case 37:r=n.metaKey?-t.contentWidth:n.altKey?-t.containerWidth:-30;break;case 38:s=n.metaKey?t.contentHeight:n.altKey?t.containerHeight:30;break;case 39:r=n.metaKey?t.contentWidth:n.altKey?t.containerWidth:30;break;case 40:s=n.metaKey?-t.contentHeight:n.altKey?-t.containerHeight:-30;break;case 32:s=n.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:s=t.containerHeight;break;case 34:s=-t.containerHeight;break;case 36:s=t.contentHeight;break;case 35:s=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==r||t.settings.suppressScrollY&&0!==s||(e.scrollTop-=s,e.scrollLeft+=r,w(t),function(n,i){var o=Math.floor(e.scrollTop);if(0===n){if(!t.scrollbarYActive)return!1;if(0===o&&i>0||o>=t.contentHeight-t.containerHeight&&i<0)return!t.settings.wheelPropagation}var r=e.scrollLeft;if(0===i){if(!t.scrollbarXActive)return!1;if(0===r&&n<0||r>=t.contentWidth-t.containerWidth&&n>0)return!t.settings.wheelPropagation}return!0}(r,s)&&n.preventDefault())}})},wheel:function(t){var e=t.element;function n(n){var o=function(t){var e=t.deltaX,n=-1*t.deltaY;return void 0!==e&&void 0!==n||(e=-1*t.wheelDeltaX/6,n=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,n*=10),e!=e&&n!=n&&(e=0,n=t.wheelDelta),t.shiftKey?[-n,-e]:[e,n]}(n),r=o[0],s=o[1];if(!function(t,n,o){if(!x.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(t))return!1;for(var r=t;r&&r!==e;){if(r.classList.contains(c.element.consuming))return!0;var s=i(r);if([s.overflow,s.overflowX,s.overflowY].join("").match(/(scroll|auto)/)){var a=r.scrollHeight-r.clientHeight;if(a>0&&!(0===r.scrollTop&&o>0||r.scrollTop===a&&o<0))return!0;var l=r.scrollWidth-r.clientWidth;if(l>0&&!(0===r.scrollLeft&&n<0||r.scrollLeft===l&&n>0))return!0}r=r.parentNode}return!1}(n.target,r,s)){var a=!1;t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(s?e.scrollTop-=s*t.settings.wheelSpeed:e.scrollTop+=r*t.settings.wheelSpeed,a=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(r?e.scrollLeft+=r*t.settings.wheelSpeed:e.scrollLeft-=s*t.settings.wheelSpeed,a=!0):(e.scrollTop-=s*t.settings.wheelSpeed,e.scrollLeft+=r*t.settings.wheelSpeed),w(t),(a=a||function(n,i){var o=Math.floor(e.scrollTop),r=0===e.scrollTop,s=o+e.offsetHeight===e.scrollHeight,a=0===e.scrollLeft,l=e.scrollLeft+e.offsetWidth===e.scrollWidth;return!(Math.abs(i)>Math.abs(n)?r||s:a||l)||!t.settings.wheelPropagation}(r,s))&&!n.ctrlKey&&(n.stopPropagation(),n.preventDefault())}}void 0!==window.onwheel?t.event.bind(e,"wheel",n):void 0!==window.onmousewheel&&t.event.bind(e,"mousewheel",n)},touch:function(t){if(x.supportsTouch||x.supportsIePointer){var e=t.element,n={},o=0,r={},s=null;x.supportsTouch?(t.event.bind(e,"touchstart",d),t.event.bind(e,"touchmove",u),t.event.bind(e,"touchend",f)):x.supportsIePointer&&(window.PointerEvent?(t.event.bind(e,"pointerdown",d),t.event.bind(e,"pointermove",u),t.event.bind(e,"pointerup",f)):window.MSPointerEvent&&(t.event.bind(e,"MSPointerDown",d),t.event.bind(e,"MSPointerMove",u),t.event.bind(e,"MSPointerUp",f)))}function a(n,i){e.scrollTop-=i,e.scrollLeft-=n,w(t)}function l(t){return t.targetTouches?t.targetTouches[0]:t}function h(t){return!(t.pointerType&&"pen"===t.pointerType&&0===t.buttons||(!t.targetTouches||1!==t.targetTouches.length)&&(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE))}function d(t){if(h(t)){var e=l(t);n.pageX=e.pageX,n.pageY=e.pageY,o=(new Date).getTime(),null!==s&&clearInterval(s)}}function u(s){if(h(s)){var d=l(s),u={pageX:d.pageX,pageY:d.pageY},f=u.pageX-n.pageX,p=u.pageY-n.pageY;if(function(t,n,o){if(!e.contains(t))return!1;for(var r=t;r&&r!==e;){if(r.classList.contains(c.element.consuming))return!0;var s=i(r);if([s.overflow,s.overflowX,s.overflowY].join("").match(/(scroll|auto)/)){var a=r.scrollHeight-r.clientHeight;if(a>0&&!(0===r.scrollTop&&o>0||r.scrollTop===a&&o<0))return!0;var l=r.scrollLeft-r.clientWidth;if(l>0&&!(0===r.scrollLeft&&n<0||r.scrollLeft===l&&n>0))return!0}r=r.parentNode}return!1}(s.target,f,p))return;a(f,p),n=u;var g=(new Date).getTime(),v=g-o;v>0&&(r.x=f/v,r.y=p/v,o=g),function(n,i){var o=Math.floor(e.scrollTop),r=e.scrollLeft,s=Math.abs(n),a=Math.abs(i);if(a>s){if(i<0&&o===t.contentHeight-t.containerHeight||i>0&&0===o)return 0===window.scrollY&&i>0&&x.isChrome}else if(s>a&&(n<0&&r===t.contentWidth-t.containerWidth||n>0&&0===r))return!0;return!0}(f,p)&&s.preventDefault()}}function f(){t.settings.swipeEasing&&(clearInterval(s),s=setInterval(function(){t.isInitialized?clearInterval(s):r.x||r.y?Math.abs(r.x)<.01&&Math.abs(r.y)<.01?clearInterval(s):(a(30*r.x,30*r.y),r.x*=.8,r.y*=.8):clearInterval(s)},10))}}},E=function(t,e){var n=this;if(void 0===e&&(e={}),"string"==typeof t&&(t=document.querySelector(t)),!t||!t.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var s in this.element=t,t.classList.add(c.main),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1},e)n.settings[s]=e[s];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var a,l,h=function(){return t.classList.add(c.state.focus)},d=function(){return t.classList.remove(c.state.focus)};this.isRtl="rtl"===i(t).direction,this.isNegativeScroll=(l=t.scrollLeft,t.scrollLeft=-1,a=t.scrollLeft<0,t.scrollLeft=l,a),this.negativeScrollAdjustment=this.isNegativeScroll?t.scrollWidth-t.clientWidth:0,this.event=new v,this.ownerDocument=t.ownerDocument||document,this.scrollbarXRail=r(c.element.rail("x")),t.appendChild(this.scrollbarXRail),this.scrollbarX=r(c.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",h),this.event.bind(this.scrollbarX,"blur",d),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var u=i(this.scrollbarXRail);this.scrollbarXBottom=parseInt(u.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=y(u.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=y(u.borderLeftWidth)+y(u.borderRightWidth),o(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=y(u.marginLeft)+y(u.marginRight),o(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=r(c.element.rail("y")),t.appendChild(this.scrollbarYRail),this.scrollbarY=r(c.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",h),this.event.bind(this.scrollbarY,"blur",d),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var f=i(this.scrollbarYRail);this.scrollbarYRight=parseInt(f.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=y(f.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?function(t){var e=i(t);return y(e.width)+y(e.paddingLeft)+y(e.paddingRight)+y(e.borderLeftWidth)+y(e.borderRightWidth)}(this.scrollbarY):null,this.railBorderYWidth=y(f.borderTopWidth)+y(f.borderBottomWidth),o(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=y(f.marginTop)+y(f.marginBottom),o(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:t.scrollLeft<=0?"start":t.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:t.scrollTop<=0?"start":t.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(t){return C[t](n)}),this.lastScrollTop=Math.floor(t.scrollTop),this.lastScrollLeft=t.scrollLeft,this.event.bind(this.element,"scroll",function(t){return n.onScroll(t)}),w(this)};E.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,o(this.scrollbarXRail,{display:"block"}),o(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=y(i(this.scrollbarXRail).marginLeft)+y(i(this.scrollbarXRail).marginRight),this.railYMarginHeight=y(i(this.scrollbarYRail).marginTop)+y(i(this.scrollbarYRail).marginBottom),o(this.scrollbarXRail,{display:"none"}),o(this.scrollbarYRail,{display:"none"}),w(this),b(this,"top",0,!1,!0),b(this,"left",0,!1,!0),o(this.scrollbarXRail,{display:""}),o(this.scrollbarYRail,{display:""}))},E.prototype.onScroll=function(t){this.isAlive&&(w(this),b(this,"top",this.element.scrollTop-this.lastScrollTop),b(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},E.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),l(this.scrollbarX),l(this.scrollbarY),l(this.scrollbarXRail),l(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},E.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(t){return!t.match(/^ps([-_].+|)$/)}).join(" ")},e.default=E},function(t,e){t.exports=h},,,,function(t,e){t.exports=c},function(t,e){t.exports=d},function(t,e){t.exports=u},function(t,e){t.exports=f},function(t,e){t.exports=p},function(t,e){t.exports=g},function(t,e){t.exports=v},function(t,e){t.exports=m},function(t,e){t.exports=b},function(t,e,n){"use strict";var i,o;i=[n(1),n(0),n(5),n(26)],void 0===(o=function(t,e,n,i){function o(t,e,o){var r=n.element(document).injector(),s=document.createElement("div");s.innerHTML='<annotation-tooltip event="event" on-edit="onEdit()"></annotation-tooltip>',r.invoke(["$compile","$rootScope",function(n,r){var a=o.getOptions().events.manager,l=r.$new(!0);l.event=e,l.onEdit=function(){a.editEvent(e)},n(s)(l),l.$digest(),l.$destroy();var h=new i({target:t[0],content:s,position:"bottom center",classes:"drop-popover drop-popover--annotation",openOn:"hover",hoverCloseDelay:200,tetherOptions:{constraints:[{to:"window",pin:!0,attachment:"both"}]}});h.open(),h.on("close",function(){setTimeout(function(){h.destroy()})})}])}var r=null;function s(t,e,o){var s=o.getOptions().events.manager;s.editorOpen?r=t:(s.editorOpened(),r=t,setTimeout(function(){var t=n.element(document).injector(),o=document.createElement("div");o.innerHTML='<event-editor panel-ctrl="panelCtrl" event="event" close="close()"></event-editor>',t.invoke(["$compile","$rootScope",function(t,n){var a,l=n.$new(!0);l.event=e,l.panelCtrl=s.panelCtrl,l.close=function(){a.close()},t(o)(l),l.$digest(),(a=new i({target:r[0],content:o,position:"bottom center",classes:"drop-popover drop-popover--form",openOn:"click",tetherOptions:{constraints:[{to:"window",pin:!0,attachment:"both"}]}})).open(),s.editorOpened(),a.on("close",function(){setTimeout(function(){s.editorClosed(),l.$destroy(),a.destroy()})})}])},100))}var a=function(t,e,n,i,o,r,s,a){var l=t,h=e,c=n,d=i,u={left:o,top:r},f=s,p=a;this.width=function(){return f},this.height=function(){return p},this.position=function(){return u},this.draw=function(){h(l)},this.clear=function(){c(l)},this.getObject=function(){return l},this.moveTo=function(t){d(l,u=t)}},l=function(t,e){var n=t,i=e,o=!1;this.visual=function(){return i},this.getOptions=function(){return n},this.getParent=function(){},this.isHidden=function(){return o},this.hide=function(){o=!0},this.unhide=function(){o=!1}},h=function(n){var i=[];this._types=[],this._plot=n,this.eventsEnabled=!1,this.getEvents=function(){return i},this.setTypes=function(t){return this._types=t},this.setupEvents=function(n){var o=this,r=e.partition(n,"isRegion"),s=r[0];n=r[1],t.each(n,function(t,e){var n=new l(e,o._buildDiv(e));i.push(n)}),t.each(s,function(t,e){var n=new l(e,o._buildRegDiv(e));i.push(n)}),i.sort(function(t,e){var n=t.getOptions(),i=e.getOptions();return n.min>i.min?1:n.min<i.min?-1:0})},this.drawEvents=function(){var e=this;t.each(i,function(t,n){e._insidePlot(n.getOptions().min)&&!n.isHidden()?n.visual().draw():n.visual().getObject().hide()})},this.updateEvents=function(){var e,n,o=this,r=this._plot.getPlotOffset(),s=this._plot.getXAxes()[this._plot.getOptions().events.xaxis-1];t.each(i,function(t,i){n=r.top+o._plot.height()-i.visual().height(),e=s.p2c(i.getOptions().min)+r.left-i.visual().width()/2,i.visual().moveTo({top:n,left:e})})},this._clearEvents=function(){t.each(i,function(t,e){e.visual().clear()}),i=[]},this._buildDiv=function(e){var n,i,r,l,h,c,d,u,f=this,p=this._plot.getPlaceholder(),g=this._plot.getPlotOffset(),v=this._plot.getAxes(),m=this._plot.getXAxes()[this._plot.getOptions().events.xaxis-1];v.yaxis&&v.yaxis.used&&v.yaxis,v.yaxis2&&v.yaxis2.used&&v.yaxis2;var b=e.eventType;r=null!==this._types&&this._types[b]&&this._types[b].color?this._types[b].color:"#666",l=null!==this._types&&this._types[b]&&this._types[b].markerSize?this._types[b].markerSize:8,h=null===this._types||!this._types[b]||void 0===this._types[b].markerShow||this._types[b].markerShow,u=null===this._types||!this._types[b]||void 0===this._types[b].markerTooltip||this._types[b].markerTooltip,c=null!=this._types&&this._types[b]&&this._types[b].lineStyle?this._types[b].lineStyle.toLowerCase():"dashed",d=null!=this._types&&this._types[b]&&void 0!==this._types[b].lineWidth?this._types[b].lineWidth:1;var y=m.options.eventSectionHeight||0;y/=3,n=g.top+this._plot.height()+y,i=m.p2c(e.min)+g.left;var x=t('<div class="events_line flot-temp-elem"></div>').css({position:"absolute",opacity:.8,left:i+"px",top:8,width:d+"px",height:this._plot.height()+.8*y,"border-left-width":d+"px","border-left-style":c,"border-left-color":r,color:r}).appendTo(p);if(h){var w=t('<div class="events_marker"></div>').css({position:"absolute",left:-l-Math.round(d/2)+"px","font-size":0,"line-height":0,width:0,height:0,"border-left":l+"px solid transparent","border-right":l+"px solid transparent"});w.appendTo(x),this._types[b]&&this._types[b].position&&"BOTTOM"===this._types[b].position.toUpperCase()?w.css({top:n-l-8+"px","border-top":"none","border-bottom":l+"px solid "+r}):w.css({top:"0px","border-top":l+"px solid "+r,"border-bottom":"none"}),w.data({event:e});e.editModel&&s(w,e.editModel,f._plot);u&&(w.css({cursor:"help"}),w.hover(function(){o(w,t(this).data("event"),f._plot)},function(){f._plot.clearSelection()}))}return new a(x,function(t){t.show()},function(t){t.remove()},function(t,e){t.css({top:e.top,left:e.left})},i,n,x.width(),x.height())},this._buildRegDiv=function(n){var i,r,l,h,c,d,u,f=this,p=this._plot.getPlaceholder(),g=this._plot.getPlotOffset(),v=this._plot.getAxes(),m=this._plot.getXAxes()[this._plot.getOptions().events.xaxis-1];v.yaxis&&v.yaxis.used&&v.yaxis,v.yaxis2&&v.yaxis2.used&&v.yaxis2;var b=n.eventType;d=null!==this._types&&this._types[b]&&this._types[b].color?this._types[b].color:"#666",u=null===this._types||!this._types[b]||void 0===this._types[b].markerTooltip||this._types[b].markerTooltip,l=null!=this._types&&this._types[b]&&void 0!==this._types[b].lineWidth?this._types[b].lineWidth:1,c=null!=this._types&&this._types[b]&&this._types[b].lineStyle?this._types[b].lineStyle.toLowerCase():"dashed";i=g.top+this._plot.height()+2;var y=Math.min(n.min,n.timeEnd),x=Math.max(n.min,n.timeEnd);r=m.p2c(y)+g.left;var w=m.p2c(x)+g.left;h=w-r,e.each([r,w],function(e){t('<div class="events_line flot-temp-elem"></div>').css({position:"absolute",opacity:.8,left:e+"px",top:8,width:l+"px",height:f._plot.height()+2,"border-left-width":l+"px","border-left-style":c,"border-left-color":d,color:d}).appendTo(p)});var _=t('<div class="events_marker region_marker flot-temp-elem"></div>').css({position:"absolute",opacity:.5,left:r+"px",top:i,width:Math.round(h+l)+"px",height:"0.5rem","border-left-color":d,color:d,"background-color":d});_.appendTo(p),_.data({event:n});n.editModel&&s(_,n.editModel,f._plot);return u&&(_.css({cursor:"help"}),_.hover(function(){o(_,t(this).data("event"),f._plot)},function(){f._plot.clearSelection()})),new a(_,function(t){t.show()},function(t){t.remove()},function(t,e){t.css({top:e.top,left:e.left})},r,i,_.width(),_.height())},this._insidePlot=function(t){var e=this._plot.getXAxes()[this._plot.getOptions().events.xaxis-1],n=e.p2c(t);return n>0&&n<e.p2c(e.max)}};t.plot.plugins.push({init:function(e){var n=this,i=new h(e);e.getEvents=function(){return i._events},e.hideEvents=function(){t.each(i._events,function(t,e){e.visual().getObject().hide()})},e.showEvents=function(){e.hideEvents(),t.each(i._events,function(t,e){e.hide()}),n.eventMarkers.drawEvents()},e.setEvents=function(t){i.eventsEnabled&&i.setupEvents(t)},e.hooks.processOptions.push(function(t,e){null!=e.events.data&&(i.eventsEnabled=!0)}),e.hooks.draw.push(function(t){var e=t.getOptions();i.eventsEnabled&&(i.getEvents().length<1?(i.setTypes(e.events.types),i.setupEvents(e.events.data)):i.updateEvents()),i.drawEvents()})},options:{events:{data:null,types:null,xaxis:1,position:"BOTTOM"}},name:"events",version:"0.2.5"})}.apply(e,i))||(t.exports=o)},function(t,e,n){"use strict";var i,o,r,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};o=[n(27)],void 0===(r="function"==typeof(i=function(t){var e=Function.prototype.bind,n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{!i&&a.return&&a.return()}finally{if(o)throw r}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function(t,e,n){for(var i=!0;i;){var o=t,r=e,s=n;i=!1,null===o&&(o=Function.prototype);var a=Object.getOwnPropertyDescriptor(o,r);if(void 0!==a){if("value"in a)return a.value;var l=a.get;if(void 0===l)return;return l.call(s)}var h=Object.getPrototypeOf(o);if(null===h)return;t=h,e=r,n=s,i=!0,a=h=void 0}},r=t.Utils,a=r.extend,l=r.addClass,h=r.removeClass,c=r.hasClass,d=r.Evented;function u(t){var e=t.split(" "),i=n(e,2),o=i[0],r=i[1];if(["left","right"].indexOf(o)>=0){var s=[r,o];o=s[0],r=s[1]}return[o,r].join(" ")}function f(t,e){for(var n=void 0,i=[];-1!==(n=t.indexOf(e));)i.push(t.splice(n,1));return i}var p=["click"];"ontouchstart"in document.documentElement&&p.push("touchstart");var g={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"},v="";for(var m in g)if({}.hasOwnProperty.call(g,m)){var b=document.createElement("p");void 0!==b.style[m]&&(v=g[m])}var y={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle",center:"center"},x={},w=function n(){var r=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],g=function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return new(e.apply(b,[null].concat(n)))};a(g,{createContext:n,drops:[],defaults:{}});var m={classPrefix:"drop",defaults:{position:"bottom left",openOn:"click",beforeClose:null,constrainToScrollParent:!0,constrainToWindow:!0,classes:"",remove:!1,openDelay:0,closeDelay:50,focusDelay:null,blurDelay:null,hoverOpenDelay:null,hoverCloseDelay:null,tetherOptions:{}}};a(g,m,r),a(g.defaults,m.defaults,r.defaults),void 0===x[g.classPrefix]&&(x[g.classPrefix]=[]),g.updateBodyClasses=function(){for(var t=!1,e=x[g.classPrefix],n=e.length,i=0;i<n;++i)if(e[i].isOpened()){t=!0;break}t?l(document.body,g.classPrefix+"-open"):h(document.body,g.classPrefix+"-open")};var b=function(e){function n(t){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),o(Object.getPrototypeOf(n.prototype),"constructor",this).call(this),this.options=a({},g.defaults,t),this.target=this.options.target,void 0===this.target)throw new Error("Drop Error: You must provide a target.");var e="data-"+g.classPrefix,i=this.target.getAttribute(e);i&&null==this.options.content&&(this.options.content=i);for(var r=["position","openOn"],s=0;s<r.length;++s){var h=this.target.getAttribute(e+"-"+r[s]);h&&null==this.options[r[s]]&&(this.options[r[s]]=h)}this.options.classes&&!1!==this.options.addTargetClasses&&l(this.target,this.options.classes),g.drops.push(this),x[g.classPrefix].push(this),this._boundEvents=[],this.bindMethods(),this.setupElements(),this.setupEvents(),this.setupTether()}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":s(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,e),i(n,[{key:"_on",value:function(t,e,n){this._boundEvents.push({element:t,event:e,handler:n}),t.addEventListener(e,n)}},{key:"bindMethods",value:function(){this.transitionEndHandler=this._transitionEndHandler.bind(this)}},{key:"setupElements",value:function(){var t=this;if(this.drop=document.createElement("div"),l(this.drop,g.classPrefix),this.options.classes&&l(this.drop,this.options.classes),this.content=document.createElement("div"),l(this.content,g.classPrefix+"-content"),"function"==typeof this.options.content){var e=function(){var e=t.options.content.call(t,t);if("string"==typeof e)t.content.innerHTML=e;else{if("object"!==(void 0===e?"undefined":s(e)))throw new Error("Drop Error: Content function should return a string or HTMLElement.");t.content.innerHTML="",t.content.appendChild(e)}};e(),this.on("open",e.bind(this))}else"object"===s(this.options.content)?this.content.appendChild(this.options.content):this.content.innerHTML=this.options.content;this.drop.appendChild(this.content)}},{key:"setupTether",value:function(){var e=this.options.position.split(" ");e[0]=y[e[0]],e=e.join(" ");var n=[];this.options.constrainToScrollParent?n.push({to:"scrollParent",pin:"top, bottom",attachment:"together none"}):n.push({to:"scrollParent"}),!1!==this.options.constrainToWindow?n.push({to:"window",attachment:"together"}):n.push({to:"window"});var i={element:this.drop,target:this.target,attachment:u(e),targetAttachment:u(this.options.position),classPrefix:g.classPrefix,offset:"0 0",targetOffset:"0 0",enabled:!1,constraints:n,addTargetClasses:this.options.addTargetClasses};!1!==this.options.tetherOptions&&(this.tether=new t(a({},i,this.options.tetherOptions)))}},{key:"setupEvents",value:function(){var t=this;if(this.options.openOn)if("always"!==this.options.openOn){var e=this.options.openOn.split(" ");if(e.indexOf("click")>=0)for(var n=function(e){t.toggle(e),e.preventDefault()},i=function(e){t.isOpened()&&(e.target===t.drop||t.drop.contains(e.target)||e.target===t.target||t.target.contains(e.target)||t.close(e))},o=0;o<p.length;++o){var r=p[o];this._on(this.target,r,n),this._on(document,r,i)}var s=null,a=null,l=function(e){null!==a?clearTimeout(a):s=setTimeout(function(){t.open(e),s=null},("focus"===e.type?t.options.focusDelay:t.options.hoverOpenDelay)||t.options.openDelay)},h=function(e){null!==s?clearTimeout(s):a=setTimeout(function(){t.close(e),a=null},("blur"===e.type?t.options.blurDelay:t.options.hoverCloseDelay)||t.options.closeDelay)};e.indexOf("hover")>=0&&(this._on(this.target,"mouseover",l),this._on(this.drop,"mouseover",l),this._on(this.target,"mouseout",h),this._on(this.drop,"mouseout",h)),e.indexOf("focus")>=0&&(this._on(this.target,"focus",l),this._on(this.drop,"focus",l),this._on(this.target,"blur",h),this._on(this.drop,"blur",h))}else setTimeout(this.open.bind(this))}},{key:"isOpened",value:function(){if(this.drop)return c(this.drop,g.classPrefix+"-open")}},{key:"toggle",value:function(t){this.isOpened()?this.close(t):this.open(t)}},{key:"open",value:function(t){var e=this;this.isOpened()||(this.drop.parentNode||document.body.appendChild(this.drop),void 0!==this.tether&&this.tether.enable(),l(this.drop,g.classPrefix+"-open"),l(this.drop,g.classPrefix+"-open-transitionend"),setTimeout(function(){e.drop&&l(e.drop,g.classPrefix+"-after-open")}),void 0!==this.tether&&this.tether.position(),this.trigger("open"),g.updateBodyClasses())}},{key:"_transitionEndHandler",value:function(t){t.target===t.currentTarget&&(c(this.drop,g.classPrefix+"-open")||h(this.drop,g.classPrefix+"-open-transitionend"),this.drop.removeEventListener(v,this.transitionEndHandler))}},{key:"beforeCloseHandler",value:function(t){var e=!0;return this.isClosing||"function"!=typeof this.options.beforeClose||(this.isClosing=!0,e=!1!==this.options.beforeClose(t,this)),this.isClosing=!1,e}},{key:"close",value:function(t){this.isOpened()&&this.beforeCloseHandler(t)&&(h(this.drop,g.classPrefix+"-open"),h(this.drop,g.classPrefix+"-after-open"),this.drop.addEventListener(v,this.transitionEndHandler),this.trigger("close"),void 0!==this.tether&&this.tether.disable(),g.updateBodyClasses(),this.options.remove&&this.remove(t))}},{key:"remove",value:function(t){this.close(t),this.drop.parentNode&&this.drop.parentNode.removeChild(this.drop)}},{key:"position",value:function(){this.isOpened()&&void 0!==this.tether&&this.tether.position()}},{key:"destroy",value:function(){this.remove(),void 0!==this.tether&&this.tether.destroy();for(var t=0;t<this._boundEvents.length;++t){var e=this._boundEvents[t],n=e.element,i=e.event,o=e.handler;n.removeEventListener(i,o)}this._boundEvents=[],this.tether=null,this.drop=null,this.content=null,this.target=null,f(x[g.classPrefix],this),f(g.drops,this)}}]),n}(d);return g}();return document.addEventListener("DOMContentLoaded",function(){w.updateBodyClasses()}),w})?i.apply(e,o):i)||(t.exports=r)},function(t,e,n){"use strict";var i,o,r,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};o=[],void 0===(r="function"==typeof(i=function(){var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=void 0;void 0===n&&(n={modules:[]});var i=null;function o(t){var e=t.getBoundingClientRect(),n={};for(var i in e)n[i]=e[i];if(t.ownerDocument!==document){var r=t.ownerDocument.defaultView.frameElement;if(r){var s=o(r);n.top+=s.top,n.bottom+=s.top,n.left+=s.left,n.right+=s.left}}return n}function r(t){var e=getComputedStyle(t)||{},n=e.position,i=[];if("fixed"===n)return[t];for(var o=t;(o=o.parentNode)&&o&&1===o.nodeType;){var r=void 0;try{r=getComputedStyle(o)}catch(t){}if(null==r)return i.push(o),i;var s=r,a=s.overflow,l=s.overflowX,h=s.overflowY;/(auto|scroll|overlay)/.test(a+h+l)&&("absolute"!==n||["relative","absolute","fixed"].indexOf(r.position)>=0)&&i.push(o)}return i.push(t.ownerDocument.body),t.ownerDocument!==document&&i.push(t.ownerDocument.defaultView),i}var a,l=(a=0,function(){return++a}),h={},c=function(){var t=i;t&&document.body.contains(t)||((t=document.createElement("div")).setAttribute("data-tether-id",l()),v(t.style,{top:0,left:0,position:"absolute"}),document.body.appendChild(t),i=t);var e=t.getAttribute("data-tether-id");return void 0===h[e]&&(h[e]=o(t),C(function(){delete h[e]})),h[e]};function d(){i&&document.body.removeChild(i),i=null}function u(t){var e=void 0;t===document?(e=document,t=document.documentElement):e=t.ownerDocument;var n=e.documentElement,i=o(t),r=c();return i.top-=r.top,i.left-=r.left,void 0===i.width&&(i.width=document.body.scrollWidth-i.left-i.right),void 0===i.height&&(i.height=document.body.scrollHeight-i.top-i.bottom),i.top=i.top-n.clientTop,i.left=i.left-n.clientLeft,i.right=e.body.clientWidth-i.width-i.left,i.bottom=e.body.clientHeight-i.height-i.top,i}function f(t){return t.offsetParent||document.documentElement}var p=null;function g(){if(p)return p;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");v(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var n=t.offsetWidth;e.style.overflow="scroll";var i=t.offsetWidth;n===i&&(i=e.clientWidth),document.body.removeChild(e);var o=n-i;return p={width:o,height:o}}function v(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach(function(e){if(e)for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}),t}function m(t,e){if(void 0!==t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.remove(e)});else{var n=new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi"),i=x(t).replace(n," ");w(t,i)}}function b(t,e){if(void 0!==t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.add(e)});else{m(t,e);var n=x(t)+" "+e;w(t,n)}}function y(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=x(t);return new RegExp("(^| )"+e+"( |$)","gi").test(n)}function x(t){return t.className instanceof t.ownerDocument.defaultView.SVGAnimatedString?t.className.baseVal:t.className}function w(t,e){t.setAttribute("class",e)}function _(t,e,n){n.forEach(function(n){-1===e.indexOf(n)&&y(t,n)&&m(t,n)}),e.forEach(function(e){y(t,e)||b(t,e)})}var O=[],C=function(t){O.push(t)},E=function(){for(var t=void 0;t=O.pop();)t()},S=function(){function n(){e(this,n)}return t(n,[{key:"on",value:function(t,e,n){var i=!(arguments.length<=3||void 0===arguments[3])&&arguments[3];void 0===this.bindings&&(this.bindings={}),void 0===this.bindings[t]&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:i})}},{key:"once",value:function(t,e,n){this.on(t,e,n,!0)}},{key:"off",value:function(t,e){if(void 0!==this.bindings&&void 0!==this.bindings[t])if(void 0===e)delete this.bindings[t];else for(var n=0;n<this.bindings[t].length;)this.bindings[t][n].handler===e?this.bindings[t].splice(n,1):++n}},{key:"trigger",value:function(t){if(void 0!==this.bindings&&this.bindings[t]){for(var e=0,n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];for(;e<this.bindings[t].length;){var r=this.bindings[t][e],s=r.handler,a=r.ctx,l=r.once,h=a;void 0===h&&(h=this),s.apply(h,i),l?this.bindings[t].splice(e,1):++e}}}}]),n}();n.Utils={getActualBoundingClientRect:o,getScrollParents:r,getBounds:u,getOffsetParent:f,extend:v,addClass:b,removeClass:m,hasClass:y,updateClasses:_,defer:C,flush:E,uniqueId:l,Evented:S,getScrollBarSize:g,removeUtilElements:d};var A=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{!i&&a.return&&a.return()}finally{if(o)throw r}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},t=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),T=function(t,e,n){for(var i=!0;i;){var o=t,r=e,s=n;i=!1,null===o&&(o=Function.prototype);var a=Object.getOwnPropertyDescriptor(o,r);if(void 0!==a){if("value"in a)return a.value;var l=a.get;if(void 0===l)return;return l.call(s)}var h=Object.getPrototypeOf(o);if(null===h)return;t=h,e=r,n=s,i=!0,a=h=void 0}};function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}if(void 0===n)throw new Error("You must include the utils.js file before tether.js");var r=(K=n.Utils).getScrollParents,u=K.getBounds,f=K.getOffsetParent,v=K.extend,b=K.addClass,m=K.removeClass,_=K.updateClasses,C=K.defer,E=K.flush,g=K.getScrollBarSize,d=K.removeUtilElements;function k(t,e){var n=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return t+n>=e&&e>=t-n}var M,L,H,D,Y=function(){if("undefined"==typeof document)return"";for(var t=document.createElement("div"),e=["transform","WebkitTransform","OTransform","MozTransform","msTransform"],n=0;n<e.length;++n){var i=e[n];if(void 0!==t.style[i])return i}}(),P=[],X=function(){P.forEach(function(t){t.position(!1)}),E()};function W(){return"object"===("undefined"==typeof performance?"undefined":s(performance))&&"function"==typeof performance.now?performance.now():+new Date}M=null,L=null,H=null,D=function t(){if(void 0!==L&&L>16)return L=Math.min(L-16,250),void(H=setTimeout(t,250));void 0!==M&&W()-M<10||(null!=H&&(clearTimeout(H),H=null),M=W(),X(),L=W()-M)},"undefined"!=typeof window&&void 0!==window.addEventListener&&["resize","scroll","touchmove"].forEach(function(t){window.addEventListener(t,D)});var R={center:"center",left:"right",right:"left"},F={middle:"middle",top:"bottom",bottom:"top"},N={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},j=function(t){var e=t.left,n=t.top;return void 0!==N[t.left]&&(e=N[t.left]),void 0!==N[t.top]&&(n=N[t.top]),{left:e,top:n}};function B(){for(var t={top:0,left:0},e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return n.forEach(function(e){var n=e.top,i=e.left;"string"==typeof n&&(n=parseFloat(n,10)),"string"==typeof i&&(i=parseFloat(i,10)),t.top+=n,t.left+=i}),t}function z(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t}var I=function(t){var e=t.split(" "),n=A(e,2),i=n[0],o=n[1];return{top:i,left:o}},$=I,U=function(i){function o(t){var i=this;e(this,o),T(Object.getPrototypeOf(o.prototype),"constructor",this).call(this),this.position=this.position.bind(this),P.push(this),this.history=[],this.setOptions(t,!1),n.modules.forEach(function(t){void 0!==t.initialize&&t.initialize.call(i)}),this.position()}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":s(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,i),t(o,[{key:"getClass",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=this.options.classes;return void 0!==e&&e[t]?this.options.classes[t]:this.options.classPrefix?this.options.classPrefix+"-"+t:t}},{key:"setOptions",value:function(t){var e=this,n=arguments.length<=1||void 0===arguments[1]||arguments[1];this.options=v({offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},t);var i=this.options,o=i.element,s=i.target,a=i.targetModifier;if(this.element=o,this.target=s,this.targetModifier=a,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach(function(t){if(void 0===e[t])throw new Error("Tether Error: Both element and target must be defined");void 0!==e[t].jquery?e[t]=e[t][0]:"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),b(this.element,this.getClass("element")),!1!==this.options.addTargetClasses&&b(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=$(this.options.targetAttachment),this.attachment=$(this.options.attachment),this.offset=I(this.options.offset),this.targetOffset=I(this.options.targetOffset),void 0!==this.scrollParents&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=r(this.target),!1!==this.options.enabled&&this.enable(n)}},{key:"getTargetBounds",value:function(){if(void 0===this.targetModifier)return u(this.target);if("visible"===this.targetModifier){if(this.target===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var t=u(this.target),e={height:t.height,width:t.width,top:t.top,left:t.left};return e.height=Math.min(e.height,t.height-(pageYOffset-t.top)),e.height=Math.min(e.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),e.height=Math.min(innerHeight,e.height),e.height-=2,e.width=Math.min(e.width,t.width-(pageXOffset-t.left)),e.width=Math.min(e.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),e.width=Math.min(innerWidth,e.width),e.width-=2,e.top<pageYOffset&&(e.top=pageYOffset),e.left<pageXOffset&&(e.left=pageXOffset),e}if("scroll-handle"===this.targetModifier){var t=void 0,n=this.target;n===document.body?(n=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=u(n);var i=getComputedStyle(n),o=n.scrollWidth>n.clientWidth||[i.overflow,i.overflowX].indexOf("scroll")>=0||this.target!==document.body,r=0;o&&(r=15);var s=t.height-parseFloat(i.borderTopWidth)-parseFloat(i.borderBottomWidth)-r,e={width:15,height:.975*s*(s/n.scrollHeight),left:t.left+t.width-parseFloat(i.borderLeftWidth)-15},a=0;s<408&&this.target===document.body&&(a=-11e-5*Math.pow(s,2)-.00727*s+22.58),this.target!==document.body&&(e.height=Math.max(e.height,24));var l=this.target.scrollTop/(n.scrollHeight-s);return e.top=l*(s-e.height-a)+t.top+parseFloat(i.borderTopWidth),this.target===document.body&&(e.height=Math.max(e.height,24)),e}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(t,e){return void 0===this._cache&&(this._cache={}),void 0===this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]}},{key:"enable",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];!1!==this.options.addTargetClasses&&b(this.target,this.getClass("enabled")),b(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParents.forEach(function(e){e!==t.target.ownerDocument&&e.addEventListener("scroll",t.position)}),e&&this.position()}},{key:"disable",value:function(){var t=this;m(this.target,this.getClass("enabled")),m(this.element,this.getClass("enabled")),this.enabled=!1,void 0!==this.scrollParents&&this.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.position)})}},{key:"destroy",value:function(){var t=this;this.disable(),P.forEach(function(e,n){e===t&&P.splice(n,1)}),0===P.length&&d()}},{key:"updateAttachClasses",value:function(t,e){var n=this;t=t||this.attachment,e=e||this.targetAttachment,void 0!==this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),void 0===this._addAttachClasses&&(this._addAttachClasses=[]);var i=this._addAttachClasses;t.top&&i.push(this.getClass("element-attached")+"-"+t.top),t.left&&i.push(this.getClass("element-attached")+"-"+t.left),e.top&&i.push(this.getClass("target-attached")+"-"+e.top),e.left&&i.push(this.getClass("target-attached")+"-"+e.left);var o=[];["left","top","bottom","right","middle","center"].forEach(function(t){o.push(n.getClass("element-attached")+"-"+t),o.push(n.getClass("target-attached")+"-"+t)}),C(function(){void 0!==n._addAttachClasses&&(_(n.element,n._addAttachClasses,o),!1!==n.options.addTargetClasses&&_(n.target,n._addAttachClasses,o),delete n._addAttachClasses)})}},{key:"position",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];if(this.enabled){this.clearCache();var i=function(t,e){var n=t.left,i=t.top;return"auto"===n&&(n=R[e.left]),"auto"===i&&(i=F[e.top]),{left:n,top:i}}(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,i);var o=this.cache("element-bounds",function(){return u(t.element)}),r=o.width,a=o.height;if(0===r&&0===a&&void 0!==this.lastSize){var l=this.lastSize;r=l.width,a=l.height}else this.lastSize={width:r,height:a};var h=this.cache("target-bounds",function(){return t.getTargetBounds()}),c=h,d=z(j(this.attachment),{width:r,height:a}),p=z(j(i),c),v=z(this.offset,{width:r,height:a}),m=z(this.targetOffset,c);d=B(d,v),p=B(p,m);for(var b=h.left+p.left-d.left,y=h.top+p.top-d.top,x=0;x<n.modules.length;++x){var w=n.modules[x],_=w.position.call(this,{left:b,top:y,targetAttachment:i,targetPos:h,elementPos:o,offset:d,targetOffset:p,manualOffset:v,manualTargetOffset:m,scrollbarSize:A,attachment:this.attachment});if(!1===_)return!1;void 0!==_&&"object"===(void 0===_?"undefined":s(_))&&(y=_.top,b=_.left)}var O={page:{top:y,left:b},viewport:{top:y-pageYOffset,bottom:pageYOffset-y-a+innerHeight,left:b-pageXOffset,right:pageXOffset-b-r+innerWidth}},C=this.target.ownerDocument,S=C.defaultView,A=void 0;return S.innerHeight>C.documentElement.clientHeight&&(A=this.cache("scrollbar-size",g),O.viewport.bottom-=A.height),S.innerWidth>C.documentElement.clientWidth&&(A=this.cache("scrollbar-size",g),O.viewport.right-=A.width),-1!==["","static"].indexOf(C.body.style.position)&&-1!==["","static"].indexOf(C.body.parentElement.style.position)||(O.page.bottom=C.body.scrollHeight-y-a,O.page.right=C.body.scrollWidth-b-r),void 0!==this.options.optimizations&&!1!==this.options.optimizations.moveElement&&void 0===this.targetModifier&&function(){var e=t.cache("target-offsetparent",function(){return f(t.target)}),n=t.cache("target-offsetparent-bounds",function(){return u(e)}),i=getComputedStyle(e),o=n,r={};if(["Top","Left","Bottom","Right"].forEach(function(t){r[t.toLowerCase()]=parseFloat(i["border"+t+"Width"])}),n.right=C.body.scrollWidth-n.left-o.width+r.right,n.bottom=C.body.scrollHeight-n.top-o.height+r.bottom,O.page.top>=n.top+r.top&&O.page.bottom>=n.bottom&&O.page.left>=n.left+r.left&&O.page.right>=n.right){var s=e.scrollTop,a=e.scrollLeft;O.offset={top:O.page.top-n.top+s-r.top,left:O.page.left-n.left+a-r.left}}}(),this.move(O),this.history.unshift(O),this.history.length>3&&this.history.pop(),e&&E(),!0}}},{key:"move",value:function(t){var e,n,i=this;if(void 0!==this.element.parentNode){var o={};for(var r in t)for(var s in o[r]={},t[r]){for(var a=!1,l=0;l<this.history.length;++l){var h=this.history[l];if(void 0!==h[r]&&!k(h[r][s],t[r][s])){a=!0;break}}a||(o[r][s]=!0)}var c={top:"",left:"",right:"",bottom:""},d=function(t,e){var n=void 0!==i.options.optimizations,o=n?i.options.optimizations.gpu:null;if(!1!==o){var r=void 0,s=void 0;if(t.top?(c.top=0,r=e.top):(c.bottom=0,r=-e.bottom),t.left?(c.left=0,s=e.left):(c.right=0,s=-e.right),window.matchMedia){var a=window.matchMedia("only screen and (min-resolution: 1.3dppx)").matches||window.matchMedia("only screen and (-webkit-min-device-pixel-ratio: 1.3)").matches;a||(s=Math.round(s),r=Math.round(r))}c[Y]="translateX("+s+"px) translateY("+r+"px)","msTransform"!==Y&&(c[Y]+=" translateZ(0)")}else t.top?c.top=e.top+"px":c.bottom=e.bottom+"px",t.left?c.left=e.left+"px":c.right=e.right+"px"},u=!1;if((o.page.top||o.page.bottom)&&(o.page.left||o.page.right)?(c.position="absolute",d(o.page,t.page)):(o.viewport.top||o.viewport.bottom)&&(o.viewport.left||o.viewport.right)?(c.position="fixed",d(o.viewport,t.viewport)):void 0!==o.offset&&o.offset.top&&o.offset.left?function(){c.position="absolute";var e=i.cache("target-offsetparent",function(){return f(i.target)});f(i.element)!==e&&C(function(){i.element.parentNode.removeChild(i.element),e.appendChild(i.element)}),d(o.offset,t.offset),u=!0}():(c.position="absolute",d({top:!0,left:!0},t.page)),!u)if(this.options.bodyElement)this.element.parentNode!==this.options.bodyElement&&this.options.bodyElement.appendChild(this.element);else{for(var p=!0,g=this.element.parentNode;g&&1===g.nodeType&&"BODY"!==g.tagName&&(n=void 0,((n=(e=g).ownerDocument).fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement)!==e);){if("static"!==getComputedStyle(g).position){p=!1;break}g=g.parentNode}p||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var m={},b=!1;for(var s in c){var y=c[s],x=this.element.style[s];x!==y&&(b=!0,m[s]=y)}b&&C(function(){v(i.element.style,m),i.trigger("repositioned")})}}}]),o}(S);U.modules=[],n.position=X;var V=v(U,n),A=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{!i&&a.return&&a.return()}finally{if(o)throw r}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},u=(K=n.Utils).getBounds,v=K.extend,_=K.updateClasses,C=K.defer,q=["left","top","right","bottom"];n.modules.push({position:function(t){var e=this,n=t.top,i=t.left,o=t.targetAttachment;if(!this.options.constraints)return!0;var r=this.cache("element-bounds",function(){return u(e.element)}),s=r.height,a=r.width;if(0===a&&0===s&&void 0!==this.lastSize){var l=this.lastSize;a=l.width,s=l.height}var h=this.cache("target-bounds",function(){return e.getTargetBounds()}),c=h.height,d=h.width,f=[this.getClass("pinned"),this.getClass("out-of-bounds")];this.options.constraints.forEach(function(t){var e=t.outOfBoundsClass,n=t.pinnedClass;e&&f.push(e),n&&f.push(n)}),f.forEach(function(t){["left","top","right","bottom"].forEach(function(e){f.push(t+"-"+e)})});var p=[],g=v({},o),m=v({},this.attachment);return this.options.constraints.forEach(function(t){var r=t.to,l=t.attachment,h=t.pin;void 0===l&&(l="");var f=void 0,v=void 0;if(l.indexOf(" ")>=0){var b=l.split(" "),y=A(b,2);v=y[0],f=y[1]}else f=v=l;var x=function(t,e){return"scrollParent"===e?e=t.scrollParents[0]:"window"===e&&(e=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),e===document&&(e=e.documentElement),void 0!==e.nodeType&&function(){var t=e,n=u(e),i=n,o=getComputedStyle(e);if(e=[i.left,i.top,n.width+i.left,n.height+i.top],t.ownerDocument!==document){var r=t.ownerDocument.defaultView;e[0]+=r.pageXOffset,e[1]+=r.pageYOffset,e[2]+=r.pageXOffset,e[3]+=r.pageYOffset}q.forEach(function(t,n){"Top"===(t=t[0].toUpperCase()+t.substr(1))||"Left"===t?e[n]+=parseFloat(o["border"+t+"Width"]):e[n]-=parseFloat(o["border"+t+"Width"])})}(),e}(e,r);"target"!==v&&"both"!==v||(n<x[1]&&"top"===g.top&&(n+=c,g.top="bottom"),n+s>x[3]&&"bottom"===g.top&&(n-=c,g.top="top")),"together"===v&&("top"===g.top&&("bottom"===m.top&&n<x[1]?(n+=c,g.top="bottom",n+=s,m.top="top"):"top"===m.top&&n+s>x[3]&&n-(s-c)>=x[1]&&(n-=s-c,g.top="bottom",m.top="bottom")),"bottom"===g.top&&("top"===m.top&&n+s>x[3]?(n-=c,g.top="top",n-=s,m.top="bottom"):"bottom"===m.top&&n<x[1]&&n+(2*s-c)<=x[3]&&(n+=s-c,g.top="top",m.top="top")),"middle"===g.top&&(n+s>x[3]&&"top"===m.top?(n-=s,m.top="bottom"):n<x[1]&&"bottom"===m.top&&(n+=s,m.top="top"))),"target"!==f&&"both"!==f||(i<x[0]&&"left"===g.left&&(i+=d,g.left="right"),i+a>x[2]&&"right"===g.left&&(i-=d,g.left="left")),"together"===f&&(i<x[0]&&"left"===g.left?"right"===m.left?(i+=d,g.left="right",i+=a,m.left="left"):"left"===m.left&&(i+=d,g.left="right",i-=a,m.left="right"):i+a>x[2]&&"right"===g.left?"left"===m.left?(i-=d,g.left="left",i-=a,m.left="right"):"right"===m.left&&(i-=d,g.left="left",i+=a,m.left="left"):"center"===g.left&&(i+a>x[2]&&"left"===m.left?(i-=a,m.left="right"):i<x[0]&&"right"===m.left&&(i+=a,m.left="left"))),"element"!==v&&"both"!==v||(n<x[1]&&"bottom"===m.top&&(n+=s,m.top="top"),n+s>x[3]&&"top"===m.top&&(n-=s,m.top="bottom")),"element"!==f&&"both"!==f||(i<x[0]&&("right"===m.left?(i+=a,m.left="left"):"center"===m.left&&(i+=a/2,m.left="left")),i+a>x[2]&&("left"===m.left?(i-=a,m.left="right"):"center"===m.left&&(i-=a/2,m.left="right"))),"string"==typeof h?h=h.split(",").map(function(t){return t.trim()}):!0===h&&(h=["top","left","right","bottom"]),h=h||[];var w,_,O=[],C=[];n<x[1]&&(h.indexOf("top")>=0?(n=x[1],O.push("top")):C.push("top")),n+s>x[3]&&(h.indexOf("bottom")>=0?(n=x[3]-s,O.push("bottom")):C.push("bottom")),i<x[0]&&(h.indexOf("left")>=0?(i=x[0],O.push("left")):C.push("left")),i+a>x[2]&&(h.indexOf("right")>=0?(i=x[2]-a,O.push("right")):C.push("right")),O.length&&(w=void 0,w=void 0!==e.options.pinnedClass?e.options.pinnedClass:e.getClass("pinned"),p.push(w),O.forEach(function(t){p.push(w+"-"+t)})),C.length&&(_=void 0,_=void 0!==e.options.outOfBoundsClass?e.options.outOfBoundsClass:e.getClass("out-of-bounds"),p.push(_),C.forEach(function(t){p.push(_+"-"+t)})),(O.indexOf("left")>=0||O.indexOf("right")>=0)&&(m.left=g.left=!1),(O.indexOf("top")>=0||O.indexOf("bottom")>=0)&&(m.top=g.top=!1),g.top===o.top&&g.left===o.left&&m.top===e.attachment.top&&m.left===e.attachment.left||(e.updateAttachClasses(m,g),e.trigger("update",{attachment:m,targetAttachment:g}))}),C(function(){!1!==e.options.addTargetClasses&&_(e.target,p,f),_(e.element,p,f)}),{top:n,left:i}}});var K,u=(K=n.Utils).getBounds,_=K.updateClasses,C=K.defer;n.modules.push({position:function(t){var e=this,n=t.top,i=t.left,o=this.cache("element-bounds",function(){return u(e.element)}),r=o.height,s=o.width,a=this.getTargetBounds(),l=n+r,h=i+s,c=[];n<=a.bottom&&l>=a.top&&["left","right"].forEach(function(t){var e=a[t];e!==i&&e!==h||c.push(t)}),i<=a.right&&h>=a.left&&["top","bottom"].forEach(function(t){var e=a[t];e!==n&&e!==l||c.push(t)});var d=[],f=[];return d.push(this.getClass("abutted")),["left","top","right","bottom"].forEach(function(t){d.push(e.getClass("abutted")+"-"+t)}),c.length&&f.push(this.getClass("abutted")),c.forEach(function(t){f.push(e.getClass("abutted")+"-"+t)}),C(function(){!1!==e.options.addTargetClasses&&_(e.target,f,d),_(e.element,f,d)}),!0}});var A=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,o=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){o=!0,r=t}finally{try{!i&&a.return&&a.return()}finally{if(o)throw r}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};return n.modules.push({position:function(t){var e=t.top,n=t.left;if(this.options.shift){var i=this.options.shift;"function"==typeof this.options.shift&&(i=this.options.shift.call(this,{top:e,left:n}));var o=void 0,r=void 0;if("string"==typeof i){(i=i.split(" "))[1]=i[1]||i[0];var s=A(i,2);o=s[0],r=s[1],o=parseFloat(o,10),r=parseFloat(r,10)}else o=i.top,r=i.left;return{top:e+=o,left:n+=r}}}}),V})?i.apply(e,o):i)||(t.exports=r)},function(t,e,n){"use strict";H.$inject=["timeSrv","popoverSrv","contextSrv"],n.r(e);n(9),n(16),n(17),n(18),n(19),n(20),n(21),n(22),n(23),n(24),n(25);var i=n(0),o=n.n(i),r=n(4),s=n.n(r),a=n(6),l=n.n(a),h=function(){return function(){}}(),c=4,d="rgba(0, 211, 255, 1)",u=.09,f=["#7EB26D","#EAB839","#6ED0E0","#EF843C","#E24D42","#1F78C1","#BA43A9","#705DA0","#508642","#CCA300","#447EBC","#C15C17","#890F02","#0A437C","#6D1F62","#584477","#B7DBAB","#F4D598","#70DBED","#F9BA8F","#F29191","#82B5D8","#E5A8E2","#AEA2E0","#629E51","#E5AC0E","#64B0C8","#E0752D","#BF1B00","#0A50A1","#962D82","#614D93","#9AC48A","#F2C96D","#65C5DB","#F9934E","#EA6460","#5195CE","#D683CE","#806EB7","#3F6833","#967302","#2F575E","#99440A","#58140C","#052B51","#511749","#3F2B5B","#E0F9D7","#FCEACA","#CFFAFF","#F9E2D2","#FCE2DE","#BADFF4","#F9D9F9","#DEDAF7"];function p(t){return l()(t).toHsl()}function g(t){return l()(t).toHexString()}v=f,m=o.a.map(v,p),b=o.a.sortBy(m,["h"]),b=o.a.chunk(b,c),b=o.a.map(b,function(t){return o.a.sortBy(t,"l")}),b=o.a.flattenDeep(o.a.zip.apply(o.a,b)),o.a.map(b,g);var v,m,b,y=f,x=function(){function t(t){this.panelCtrl=t}return t.prototype.editorClosed=function(){this.event=null,this.editorOpen=!1,this.panelCtrl.render()},t.prototype.editorOpened=function(){this.editorOpen=!0},t.prototype.updateTime=function(t){this.event||(this.event=new h,this.event.dashboardId=this.panelCtrl.dashboard.id,this.event.panelId=this.panelCtrl.panel.id),this.event.time=s()(t.from),this.event.isRegion=!1,t.to&&(this.event.timeEnd=s()(t.to),this.event.isRegion=!0),this.panelCtrl.render()},t.prototype.editEvent=function(t,e){this.event=t,this.panelCtrl.render()},t.prototype.addFlotEvents=function(t,e){if(this.event||0!==t.length){var n,i={$__alerting:{color:"rgba(237, 46, 24, 1)",position:"BOTTOM",markerSize:5},$__ok:{color:"rgba(11, 237, 50, 1)",position:"BOTTOM",markerSize:5},$__no_data:{color:"rgba(150, 150, 150, 1)",position:"BOTTOM",markerSize:5},$__editing:{color:d,position:"BOTTOM",markerSize:5}};if(this.event)t=this.event.isRegion?[{isRegion:!0,min:this.event.time.valueOf(),timeEnd:this.event.timeEnd.valueOf(),text:this.event.text,eventType:"$__editing",editModel:this.event}]:[{min:this.event.time.valueOf(),text:this.event.text,editModel:this.event,eventType:"$__editing"}];else for(var r=0;r<t.length;r++){var s=t[r];s.min=s.time,s.max=s.time,s.eventType=s.source.name,s.newState?s.eventType="$__"+s.newState:i[s.source.name]||(i[s.source.name]={color:s.source.iconColor,position:"BOTTOM",markerSize:5})}!function(t,e){var n,i=e.grid.markings,r=d;o.a.each(t,function(t){var e,o,s;n=t.source&&t.source.iconColor||r,e=n,o=u,s=l()(e),n=s.isValid()?(s.setAlpha(o),s.toRgbString()):e,i.push({xaxis:{from:t.min,to:t.timeEnd},color:n})})}((n=t,o.a.filter(n,"isRegion")),e);e.grid.eventSectionHeight=7,e.xaxis.eventSectionHeight=20,e.events={levels:o.a.keys(i).length+1,data:t,types:i,manager:this}}},t}();var w=n(2),_=n.n(w);function O(t,e){var n,i,o=function(t){for(var e=null,n=null,i=0,o=t;i<o.length;i++){var r=o[i];(null===n||n<r.stats.max)&&(n=r.stats.max),(null===e||e>r.stats.min)&&(e=r.stats.min)}return{datamin:e,datamax:n}}(t),r=o.datamin,s=o.datamax,a=function(t,e,n,i){var o=+(null!=t?t:n),r=+(null!=e?e:i),s=r-o;if(0===s){var a=Math.abs(0===r?1:.25*r);null===t&&(o-=a),null!=e&&null==t||(r+=a)}else null==t&&(o-=.02*s)<0&&null!=n&&n>=0&&(o=0),null==e&&(r+=.02*s)>0&&null!=i&&i<=0&&(r=0);return{min:o,max:r}}(e.min,e.max,r,s),l=a.min,h=(a.max-l)/3,c=-Math.floor(Math.log(h)/Math.LN10),d=Math.pow(10,-c),u=h/d;return u<1.5?i=1:u<3?(i=2,u>2.25&&(i=2.5,++c)):i=u<7.5?5:10,i*=d,{tickDecimals:n=Math.max(0,c),scaledDecimals:n-Math.floor(Math.log(i)/Math.LN10)}}function C(t,e){if(!t)return!1;if("/"===t[0]){var n=_.a.stringToJsRegex(t);return null!=e.match(n)}return t===e}var E=function(){function t(t){this.datapoints=t.datapoints,this.label=t.alias,this.id=t.alias,this.alias=t.alias,this.aliasEscaped=o.a.escape(t.alias),this.color=t.color,this.valueFormater=_.a.valueFormats.none,this.stats={},this.legend=!0,this.unit=t.unit,this.hasMsResolution=this.isMsResolutionNeeded()}return t.prototype.applySeriesOverrides=function(t){this.lines={},this.dashes={dashLength:[]},this.points={},this.bars={},this.yaxis=1,this.zindex=0,this.nullPointMode=null,delete this.stack;for(var e=0;e<t.length;e++){var n=t[e];C(n.alias,this.alias)&&(void 0!==n.lines&&(this.lines.show=n.lines),void 0!==n.dashes&&(this.dashes.show=n.dashes,this.lines.lineWidth=0),void 0!==n.points&&(this.points.show=n.points),void 0!==n.bars&&(this.bars.show=n.bars),void 0!==n.fill&&(this.lines.fill=0===(i=n.fill)?.001:i/10),void 0!==n.stack&&(this.stack=n.stack),void 0!==n.linewidth&&(this.lines.lineWidth=this.dashes.show?0:n.linewidth,this.dashes.lineWidth=n.linewidth),void 0!==n.dashLength&&(this.dashes.dashLength[0]=n.dashLength),void 0!==n.spaceLength&&(this.dashes.dashLength[1]=n.spaceLength),void 0!==n.nullPointMode&&(this.nullPointMode=n.nullPointMode),void 0!==n.pointradius&&(this.points.radius=n.pointradius),void 0!==n.steppedLine&&(this.lines.steps=n.steppedLine),void 0!==n.zindex&&(this.zindex=n.zindex),void 0!==n.fillBelowTo&&(this.fillBelowTo=n.fillBelowTo),void 0!==n.color&&(this.color=n.color),void 0!==n.transform&&(this.transform=n.transform),void 0!==n.legend&&(this.legend=n.legend),void 0!==n.yaxis&&(this.yaxis=n.yaxis))}var i},t.prototype.getFlotPairs=function(t){var e=[];this.stats.total=0,this.stats.max=-Number.MAX_VALUE,this.stats.min=Number.MAX_VALUE,this.stats.logmin=Number.MAX_VALUE,this.stats.avg=null,this.stats.current=null,this.stats.first=null,this.stats.delta=0,this.stats.diff=null,this.stats.range=null,this.stats.timeStep=Number.MAX_VALUE,this.allIsNull=!0,this.allIsZero=!0;for(var n,i,r,s="connected"===t,a="null as zero"===t,l=0,h=0,c=!0,d=0;d<this.datapoints.length;d++){if(i=this.datapoints[d][0],n=this.datapoints[d][1],void 0!==r){var u=n-r;u<this.stats.timeStep&&(this.stats.timeStep=u)}if(r=n,null===i){if(s)continue;a&&(i=0)}null!==i&&(o.a.isNumber(i)&&(this.stats.total+=i,this.allIsNull=!1,l++),i>this.stats.max&&(this.stats.max=i),i<this.stats.min&&(this.stats.min=i),null===this.stats.first?this.stats.first=i:h>i?(c=!1,d===this.datapoints.length-1&&(this.stats.delta+=i)):(this.stats.delta+=c?i-h:i,c=!0),h=i,i<this.stats.logmin&&i>0&&(this.stats.logmin=i),0!==i&&(this.allIsZero=!1)),e.push([n,i])}return this.stats.max===-Number.MAX_VALUE&&(this.stats.max=null),this.stats.min===Number.MAX_VALUE&&(this.stats.min=null),e.length&&!this.allIsNull&&(this.stats.avg=this.stats.total/l,this.stats.current=e[e.length-1][1],null===this.stats.current&&e.length>1&&(this.stats.current=e[e.length-2][1])),null!==this.stats.max&&null!==this.stats.min&&(this.stats.range=this.stats.max-this.stats.min),null!==this.stats.current&&null!==this.stats.first&&(this.stats.diff=this.stats.current-this.stats.first),this.stats.count=e.length,e},t.prototype.updateLegendValues=function(t,e,n){this.valueFormater=t,this.decimals=e,this.scaledDecimals=n},t.prototype.formatValue=function(t){return o.a.isFinite(t)||(t=null),this.valueFormater(t,this.decimals,this.scaledDecimals)},t.prototype.isMsResolutionNeeded=function(){for(var t=0;t<this.datapoints.length;t++)if(null!==this.datapoints[t][1]){var e=this.datapoints[t][1].toString();if(13===e.length&&e%1e3!=0)return!0}return!1},t.prototype.hideFromLegend=function(t){return!(!t.hideEmpty||!this.allIsNull)||(!this.legend||t.hideZero&&this.allIsZero)},t}(),S=n(1),A=n(3),T=n(10),k=n.n(T),M=function(){function t(t){this.panelCtrl=t}return t.prototype.getHandleHtml=function(t,e,n){var i=e.colorMode;return"custom"===e.colorMode&&(i="critical"),'\n    <div class="alert-handle-wrapper alert-handle-wrapper--T'+t+'">\n      <div class="alert-handle-line alert-handle-line--'+i+'">\n      </div>\n      <div class="alert-handle" data-handle-index="'+t+'">\n        <i class="icon-gf icon-gf-'+i+" alert-state-"+i+'"></i>\n        <span class="alert-handle-value">'+n+'<i class="alert-handle-grip"></i></span>\n      </div>\n    </div>'},t.prototype.initDragging=function(t){var e,n=S(t.currentTarget).parents(".alert-handle-wrapper"),i=S(t.currentTarget).data("handleIndex"),o=null,r=this.plot,s=this.panelCtrl,a=this.thresholds[i];function l(t){if(null===o)o=t.clientY;else{var i=t.clientY-o;e+=i,o=t.clientY,n.css({top:e+i})}}function h(){var t=r.c2p({left:0,top:e}).y;t=parseInt(t.toFixed(0)),a.value=t,n.off("mousemove",l),n.off("mouseup",l),n.off("mouseleave",l),s.$scope.$apply(function(){s.render(),s.events.emit("threshold-changed",{threshold:a,handleIndex:i})})}o=null,e=n.position().top,n.on("mousemove",l),n.on("mouseup",h),n.on("mouseleave",h)},t.prototype.cleanUp=function(){this.placeholder.find(".alert-handle-wrapper").remove(),this.needsCleanup=!1},t.prototype.renderHandle=function(t,e){var n=this.thresholds[t],i=n.value,r=i,s=0;if(o.a.isNumber(i)){var a=this.plot.p2c({x:0,y:i});s=Math.round(Math.min(Math.max(a.top,0),this.height)-6)}else r="",s=e;var l=S(this.getHandleHtml(t,n,r));this.placeholder.append(l),l.toggleClass("alert-handle-wrapper--no-value",""===r),l.css({top:s})},t.prototype.shouldDrawHandles=function(){return!this.hasSecondYAxis&&this.panelCtrl.editingThresholds&&this.panelCtrl.panel.thresholds.length>0},t.prototype.prepare=function(t,e){this.hasSecondYAxis=!1;for(var n=0;n<e.length;n++)if(e[n].yaxis>1){this.hasSecondYAxis=!0;break}if(this.shouldDrawHandles()){var i=this.panelCtrl.panel.thresholds.length>1?"220px":"110px";t.css("margin-right",i)}else this.needsCleanup&&t.css("margin-right","0")},t.prototype.draw=function(t){this.thresholds=this.panelCtrl.panel.thresholds,this.plot=t,this.placeholder=t.getPlaceholder(),this.needsCleanup&&this.cleanUp(),this.shouldDrawHandles()&&(this.height=t.height(),this.thresholds.length>0&&this.renderHandle(0,10),this.thresholds.length>1&&this.renderHandle(1,this.height-30),this.placeholder.off("mousedown",".alert-handle"),this.placeholder.on("mousedown",".alert-handle",this.initDragging.bind(this)),this.needsCleanup=!0)},t.prototype.addFlotOptions=function(t,e){if(e.thresholds&&0!==e.thresholds.length){var n,i,r,s=1/0,a=-1/0;for(n=0;n<e.thresholds.length;n++)if(i=e.thresholds[n],o.a.isNumber(i.value)){var l,h,c;switch(i.op){case"gt":l=s,e.thresholds.length>n+1&&(r=e.thresholds[n+1]).value>i.value&&(a=l=r.value);break;case"lt":l=a,e.thresholds.length>n+1&&(r=e.thresholds[n+1]).value<i.value&&(s=l=r.value)}switch(i.colorMode){case"critical":h="rgba(234, 112, 112, 0.12)",c="rgba(237, 46, 24, 0.60)";break;case"warning":h="rgba(235, 138, 14, 0.12)",c="rgba(247, 149, 32, 0.60)";break;case"ok":h="rgba(11, 237, 50, 0.090)",c="rgba(6,163,69, 0.60)";break;case"custom":h=i.fillColor,c=i.lineColor}i.fill&&t.grid.markings.push({yaxis:{from:i.value,to:l},color:h}),i.line&&t.grid.markings.push({yaxis:{from:i.value,to:i.value},color:c})}}},t}();function L(t,e){return Math.floor(t/e)*e}function H(t,e,n){return{restrict:"A",template:"",link:function(e,i){var r,a,l,h=e.ctrl,c=h.dashboard,d=h.panel,u=[],f=0,p=new x(h),g=new M(h),v=new k.a(i,c,e,function(){return l});function m(t){d.yaxes[0].label&&d.yaxes[0].show&&S("<div class='axisLabel left-yaxis-label flot-temp-elem'></div>").text(d.yaxes[0].label).appendTo(i),d.yaxes[1].label&&d.yaxes[1].show&&S("<div class='axisLabel right-yaxis-label flot-temp-elem'></div>").text(d.yaxes[1].label).appendTo(i),h.dataWarning&&S('<div class="datapoints-warning flot-temp-elem">'+h.dataWarning.title+"</div>").appendTo(i),g.draw(t)}function b(t,e){var n=d.yaxes[0],i=d.yaxes[1];n.show&&n.label&&(e.left=20),i.show&&i.label&&(e.right=20);for(var o=t.getYAxes(),r=0;r<o.length;r++){var s=o[r],a=d.yaxes[r];s.options.max=null!==s.options.max?s.options.max:a.max,s.options.min=null!==s.options.min?s.options.min:a.min}}function y(t){for(var e=Number.MAX_VALUE,n=0;n<t.length;n++)if(t[n].stats.timeStep){if(d.bars){if(t[n].bars&&!1===t[n].bars.show)continue}else if(void 0===t[n].bars||void 0===t[n].bars.show||!t[n].bars.show)continue;t[n].stats.timeStep<e&&(e=t[n].stats.timeStep)}return e}function w(t){return d.percentage&&d.stack&&0===t?.001:t/10}function C(t){var e=f/100,n=o.a.isUndefined(h.range.from)?null:h.range.from.valueOf(),i=o.a.isUndefined(h.range.to)?null:h.range.to.valueOf();t.xaxis={timezone:c.getTimezone(),show:d.xaxis.show,mode:"time",min:n,max:i,label:"Datetime",ticks:e,timeformat:X(e,n,i)}}function E(t){var e=o.a.map(r,function(t,e){return[e+1,t.alias]});t.xaxis={timezone:c.getTimezone(),show:d.xaxis.show,mode:null,min:0,max:e.length+1,label:"Datetime",ticks:e}}function T(t,e){var n,i,s,a=f/50;if(r.length&&e){n=o.a.map(r[0].data,function(t){return t[0]}),i=o.a.min(n),s=o.a.max(n);for(var l=e,h=Math.floor((s-i)/l);h>a;)l*=2,h=Math.ceil((s-i)/l);i=Math.floor(i/l)*l,s=Math.ceil(s/l)*l,n=[];for(var u=i;u<=s;u+=l)n.push(u)}else n=a/2,i=0,s=1;t.xaxis={timezone:c.getTimezone(),show:d.xaxis.show,mode:null,min:i,max:s,label:"Histogram",ticks:n},P(t.xaxis,"short")}function H(t){var e=o.a.map(r,function(t,e){return o.a.map(t.datapoints,function(n,i){return[parseInt(e)*t.datapoints.length+i+1,n[1]]})});e=o.a.flatten(e),t.xaxis={timezone:c.getTimezone(),show:d.xaxis.show,mode:null,min:0,max:e.length+1,label:"Datetime",ticks:e}}function D(t){return null==t?null:o.a.toNumber(t)}function Y(t,e){if(1!==t.logBase){var n,i,o=0===t.min;t.min<Number.MIN_VALUE&&(t.min=null),t.max<Number.MIN_VALUE&&(t.max=null);var r=t.max,s=t.min;for(i=0;i<e.length;i++)(n=e[i]).yaxis===t.index&&((!r||r<n.stats.max)&&(r=n.stats.max),(!s||s>n.stats.logmin)&&(s=n.stats.logmin));t.transform=function(e){return e<Number.MIN_VALUE?null:Math.log(e)/Math.log(t.logBase)},t.inverseTransform=function(e){return Math.pow(t.logBase,e)},r||s?r?s||(s=r*t.inverseTransform(-4)):r=s*t.inverseTransform(4):(r=t.inverseTransform(2),s=t.inverseTransform(-2)),s=t.min?t.inverseTransform(Math.ceil(t.transform(t.min))):t.min=t.inverseTransform(Math.floor(t.transform(s))),r=t.max?t.inverseTransform(Math.floor(t.transform(t.max))):t.max=t.inverseTransform(Math.ceil(t.transform(r))),!s||s<Number.MIN_VALUE||!r||r<Number.MIN_VALUE||(Number.isFinite(s)&&Number.isFinite(r)?(o&&(t.min=.1,s=1),t.ticks=function(t,e,n){var i,o=[];for(i=t;i<=e;i*=n)o.push(i);var r=Math.ceil(h.height/25),s=o.length;if(s>r){var a=Math.ceil(s/r)*n;for(o=[],i=t;i<=e*a;i*=a)o.push(i)}return o}(s,r,t.logBase),o&&t.ticks.unshift(.1),t.ticks[t.ticks.length-1]>t.max&&(t.max=t.ticks[t.ticks.length-1])):(t.ticks=[1,2],delete t.min,delete t.max))}}function P(t,e){t.tickFormatter=function(t,n){return _.a.valueFormats[e](t,n.tickDecimals,n.scaledDecimals)}}function X(t,e,n){if(e&&n&&t){var i=n-e,o=i/t/1e3;return o<=45?"%H:%M:%S":o<=7200||i<=864e5?"%H:%M":o<=8e4?"%m/%d %H:%M":o<=2419200||i<=31536e6?"%m/%d":"%Y-%m"}return"%H:%M"}h.events.on("panel-teardown",function(){g=null,a&&(a.destroy(),a=null)}),h.events.on("render",function(t){(r=t||r)&&(u=h.annotations||[],function(t){for(var e=0;e<t.length;e++){var n=t[e];n.data=n.getFlotPairs(n.nullPointMode||d.nullPointMode),h.hiddenSeries[n.alias]&&(n.data=[],n.stack=!1)}}(r),function(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=e.yaxes,s=i.yaxis||1,a=O(t,r[s-1]),l=a.tickDecimals,h=a.scaledDecimals,c=_.a.valueFormats[e.yaxes[s-1].format];o.a.isNumber(e.decimals)?i.updateLegendValues(c,e.decimals,null):(l=(l||-1)+1,i.updateLegendValues(c,l,h+2))}}(r,d),h.events.emit("render-legend"))}),h.events.on("legend-rendering-complete",function(){!function(){if(f=i.width(),!r||0===f)return;g.prepare(i,r),d.dashes=!!d.lines&&d.dashes;var t=function(t){var e=!!t.stack||null;return{hooks:{draw:[m],processOffset:[b]},legend:{show:!1},series:{stackpercent:!!t.stack&&t.percentage,stack:t.percentage?null:e,lines:{show:t.lines,zero:!1,fill:w(t.fill),lineWidth:t.dashes?0:t.linewidth,steps:t.steppedLine},dashes:{show:t.dashes,lineWidth:t.linewidth,dashLength:[t.dashLength,t.spaceLength]},bars:{show:t.bars,fill:1,barWidth:1,zero:!1,lineWidth:0},points:{show:t.points,fill:1,fillColor:!1,radius:t.points?t.pointradius:2},shadowSize:0},yaxes:[],xaxis:{},grid:{minBorderMargin:0,markings:[],backgroundColor:null,borderWidth:0,hoverable:!0,clickable:!0,color:"#c8c8c8",margin:{left:0,right:0},labelMarginX:0},selection:{mode:"x",color:"#666"},crosshair:{mode:"x"}}}(d);(function(t,e){switch(e.xaxis.mode){case"series":t.series.bars.barWidth=.7,t.series.bars.align="center";for(var n=0;n<r.length;n++){var i=r[n];i.data=[[n+1,i.stats[e.xaxis.values[0]]]]}E(t);break;case"histogram":var s=void 0,a=function(t){for(var e=[],n=0;n<t.length;n++)for(var i=t[n].datapoints,o=0;o<i.length;o++)null!==i[o][0]&&e.push(i[o][0]);return e}(r);if(r.length&&a.length){var l=o.a.min(o.a.map(r,function(t){return t.stats.min})),h=o.a.max(o.a.map(r,function(t){return t.stats.max})),c=e.xaxis.buckets||f/50;u=l,p=h,g=c,v=Math.sqrt(50),m=Math.sqrt(10),b=Math.sqrt(2),x=Math.abs(p-u)/Math.max(0,g),w=Math.pow(10,Math.floor(Math.log(x)/Math.LN10)),(_=x/w)>=v?w*=10:_>=m?w*=5:_>=b&&(w*=2);var d=function(t,e){for(var n={},i=0;i<t.length;i++){var r=L(t[i],e);n[r]?n[r]=n[r]+1:n[r]=1}var s=o.a.map(n,function(t,e){return[Number(e),t]});return o.a.sortBy(s,function(t){return t[0]})}(a,s=p<u?-w:w);r[0].data=d,t.series.bars.barWidth=.8*s}else s=0;T(t,s);break;case"table":t.series.bars.barWidth=.7,t.series.bars.align="center",H(t);break;default:t.series.bars.barWidth=y(r)/1.5,C(t)}var u,p,g,v,m,b,x,w,_})(t,d),function(t,e){var n={position:"left",show:d.yaxes[0].show,index:1,logBase:d.yaxes[0].logBase||1,min:D(d.yaxes[0].min),max:D(d.yaxes[0].max),tickDecimals:d.yaxes[0].decimals};if(e.yaxes.push(n),o.a.find(t,{yaxis:2})){var i=o.a.clone(n);i.index=2,i.show=d.yaxes[1].show,i.logBase=d.yaxes[1].logBase||1,i.position="right",i.min=D(d.yaxes[1].min),i.max=D(d.yaxes[1].max),i.tickDecimals=d.yaxes[1].decimals,e.yaxes.push(i),Y(e.yaxes[1],t),P(e.yaxes[1],d.percentage&&d.stack?"percent":d.yaxes[1].format)}Y(e.yaxes[0],t),P(e.yaxes[0],d.percentage&&d.stack?"percent":d.yaxes[0].format)}(r,t),g.addFlotOptions(t,d),p.addFlotEvents(u,t),l=function(t,e){var n=e.legend.sort,i=e.legend.sortDesc,o=null!==n||void 0!==n,r=null!==i||void 0!==i,s=e.stack&&o&&r,a=!0===e.legend.sortDesc?-1:1;return t.sort(function(t,e){if(t.zindex>e.zindex)return 1;if(t.zindex<e.zindex)return-1;if(s){if(t.stats[n]>e.stats[n])return 1*a;if(t.stats[n]<e.stats[n])return-1*a}return 0}),t}(r,d),function(t,e){try{a=S.plot(i,l,t),h.renderError&&(delete h.error,delete h.inspector)}catch(t){console.log("flotcharts error",t),h.error=t.message||"Render Error",h.renderError=!0,h.inspector={error:t}}e&&h.renderingCompleted()}(t,!0)}()}),A.appEvents.on("graph-hover",function(t){c.sharedTooltipModeEnabled()&&a&&t.panel.id!==d.id&&!h.otherPanelInFullscreenMode()&&v.show(t.pos)},e),A.appEvents.on("graph-hover-clear",function(t,e){a&&v.clear(a)},e),i.bind("plotselected",function(i,o){"time"===d.xaxis.mode?(o.ctrlKey||o.metaKey)&&n.isEditor?setTimeout(function(){p.updateTime(o.xaxis)},100):e.$apply(function(){t.setTime({from:s.a.utc(o.xaxis.from),to:s.a.utc(o.xaxis.to)})}):a.clearSelection()}),i.bind("plotclick",function(t,e,i){"time"===d.xaxis.mode&&((e.ctrlKey||e.metaKey)&&n.isEditor&&(e.x!==e.x1||setTimeout(function(){p.updateTime({from:e.x,to:null})},100)))}),e.$on("$destroy",function(){v.destroy(),i.off(),i.remove()})}}}A.coreModule.directive("grafanaTemplateGraph",H);var D=n(5),Y=n.n(D),P=n(11),X=n.n(P);Y.a.module("grafana.directives").directive("graphTemplateLegend",["popoverSrv","$timeout",function(t,e){return{link:function(n,i){var r,s,a,l,h=!0,c=n.ctrl,d=c.panel;function u(t){return t.parents("[data-series-index]").data("series-index")}function f(n){if(!S(n.target).parents(".popover").length){var i=S(n.currentTarget).find(".fa-minus"),o=u(i),r=s[o];e(function(){t.show({element:i[0],position:"bottom left",targetAttachment:"top left",template:'<series-color-picker series="series" onToggleAxis="toggleAxis" onColorChange="colorSelected"></series-color-picker>',openOn:"hover",model:{series:r,toggleAxis:function(){c.toggleAxis(r)},colorSelected:function(t){c.changeSeriesColor(r,t)}}})})}}function p(t){var e=u(S(t.currentTarget)),n=s[e],o=S(i.children("tbody")).scrollTop();c.toggleSeries(n,t),S(i.children("tbody")).scrollTop(o)}function g(t){var e=S(t.currentTarget).data("stat");if(e!==d.legend.sort&&(d.legend.sortDesc=null),!1===d.legend.sortDesc)return d.legend.sort=null,d.legend.sortDesc=null,void c.render();d.legend.sortDesc=!d.legend.sortDesc,d.legend.sort=e,c.render()}function v(t){if(!d.legend[t])return"";var e='<th class="pointer" data-stat="'+t+'">'+t;d.legend.sort===t&&(e+=' <span class="'+(d.legend.sortDesc?"fa fa-caret-down":"fa fa-caret-up")+'"></span>');return e+"</th>"}function m(t){var e=function(){var t=[];for(a=0;a<s.length;a++){var e=s[a];if(!e.hideFromLegend(d.legend)){var n='<div class="graph-legend-series';if(2===e.yaxis&&(n+=" graph-legend-series--right-y"),c.hiddenSeries[e.alias]&&(n+=" graph-legend-series-hidden"),n+='" data-series-index="'+a+'">',n+='<div class="graph-legend-icon">',n+='<i class="fa fa-minus pointer" style="color:'+e.color+'"></i>',n+="</div>",n+='<a class="graph-legend-alias pointer" title="'+e.aliasEscaped+'">'+e.aliasEscaped+"</a>",d.legend.values){var i=e.formatValue(e.stats.avg),o=e.formatValue(e.stats.current),r=e.formatValue(e.stats.min),l=e.formatValue(e.stats.max),h=e.formatValue(e.stats.total);d.legend.min&&(n+='<div class="graph-legend-value min">'+r+"</div>"),d.legend.max&&(n+='<div class="graph-legend-value max">'+l+"</div>"),d.legend.avg&&(n+='<div class="graph-legend-value avg">'+i+"</div>"),d.legend.current&&(n+='<div class="graph-legend-value current">'+o+"</div>"),d.legend.total&&(n+='<div class="graph-legend-value total">'+h+"</div>")}n+="</div>",t.push(S(n))}}return t}();if(d.legend.alignAsTable){var n=S("<tbody></tbody>");n.append(t),n.append(e),i.append(n)}else i.append(e);d.legend.rightSide?l&&l.destroy():l?l.update():l=new X.a(i[0],{scrollYMarginOffset:2,suppressScrollX:!0})}n.$on("$destroy",function(){l&&l.destroy()}),c.events.on("render-legend",function(){(r=c.seriesList)&&function(){if(!c.panel.legend.show)return i.empty(),void(h=!0);h&&(i.on("click",".graph-legend-icon",f),i.on("click",".graph-legend-alias",p),i.on("click","th",g),h=!1);s=r,i.empty();var t,e=d.legend.rightSide&&d.legend.sideWidth?d.legend.sideWidth+"px":"";if(i.css("min-width",e),i.toggleClass("graph-legend-table",!0===d.legend.alignAsTable),d.legend.alignAsTable){var n="<tr>";n+='<th colspan="2" style="text-align:left"></th>',d.legend.values&&(n+=v("min"),n+=v("max"),n+=v("avg"),n+=v("current"),n+=v("total")),t=S(n+="</tr>")}d.legend.sort&&(s=o.a.sortBy(s,function(t){return t.stats[d.legend.sort]}),d.legend.sortDesc&&(s=s.reverse()));d.legend.rightSide||(m(t),i.empty());m(t)}(),c.events.emit("legend-rendering-complete")})}}}]);var W=function(){function t(t,e,n){t.overrideMenu=[],t.currentOverrides=[],t.override=t.override||{},t.addOverrideOption=function(e,n,i){var r={text:e,propertyName:n,index:t.overrideMenu.lenght,values:i,submenu:o.a.map(i,function(t){return{text:String(t),value:t}})};t.overrideMenu.push(r)},t.setOverride=function(e,n){"color"!==e.propertyName?(t.override[e.propertyName]=n.value,"fillBelowTo"===e.propertyName&&(t.override.lines=!1,t.ctrl.addSeriesOverride({alias:n.value,lines:!1})),t.updateCurrentOverrides(),t.ctrl.render()):t.openColorSelector(t.override.color)},t.colorSelected=function(e){t.override.color=e,t.updateCurrentOverrides(),t.ctrl.render()},t.openColorSelector=function(i){var o={color:i};n.show({element:e.find(".dropdown")[0],position:"top center",openOn:"click",template:'<series-color-picker series="series" onColorChange="colorSelected" />',model:{autoClose:!0,colorSelected:t.colorSelected,series:o},onClose:function(){t.ctrl.render()}})},t.removeOverride=function(e){delete t.override[e.propertyName],t.updateCurrentOverrides(),t.ctrl.refresh()},t.getSeriesNames=function(){return o.a.map(t.ctrl.seriesList,function(t){return t.alias})},t.updateCurrentOverrides=function(){t.currentOverrides=[],o.a.each(t.overrideMenu,function(e){var n=t.override[e.propertyName];o.a.isUndefined(n)||t.currentOverrides.push({name:e.text,propertyName:e.propertyName,value:String(n)})})},t.addOverrideOption("Bars","bars",[!0,!1]),t.addOverrideOption("Lines","lines",[!0,!1]),t.addOverrideOption("Line fill","fill",[0,1,2,3,4,5,6,7,8,9,10]),t.addOverrideOption("Line width","linewidth",[0,1,2,3,4,5,6,7,8,9,10]),t.addOverrideOption("Null point mode","nullPointMode",["connected","null","null as zero"]),t.addOverrideOption("Fill below to","fillBelowTo",t.getSeriesNames()),t.addOverrideOption("Staircase line","steppedLine",[!0,!1]),t.addOverrideOption("Dashes","dashes",[!0,!1]),t.addOverrideOption("Dash Length","dashLength",[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),t.addOverrideOption("Dash Space","spaceLength",[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),t.addOverrideOption("Points","points",[!0,!1]),t.addOverrideOption("Points Radius","pointradius",[1,2,3,4,5]),t.addOverrideOption("Stack","stack",[!0,!1,"A","B","C","D"]),t.addOverrideOption("Color","color",["change"]),t.addOverrideOption("Y-axis","yaxis",[1,2]),t.addOverrideOption("Z-index","zindex",[-3,-2,-1,0,1,2,3]),t.addOverrideOption("Transform","transform",["negative-Y"]),t.addOverrideOption("Legend","legend",[!0,!1]),t.updateCurrentOverrides()}return t.$inject=["$scope","$element","popoverSrv"],t}();Y.a.module("grafana.controllers").controller("SeriesOverridesCtrl",W);var R=n(12),F=n.n(R),N=function(){function t(t){var e=this;this.panel=this.panelCtrl.panel,this.panel.alert&&(this.disabled=!0);var n=t.$on("$destroy",function(){e.panelCtrl.editingThresholds=!1,e.panelCtrl.render(),n()});this.panelCtrl.editingThresholds=!0}return t.$inject=["$scope"],t.prototype.addThreshold=function(){this.panel.thresholds.push({value:void 0,colorMode:"critical",op:"gt",fill:!0,line:!0}),this.panelCtrl.render()},t.prototype.removeThreshold=function(t){this.panel.thresholds.splice(t,1),this.panelCtrl.render()},t.prototype.render=function(){this.panelCtrl.render()},t.prototype.onFillColorChange=function(t){var e=this;return function(n){e.panel.thresholds[t].fillColor=n,e.render()}},t.prototype.onLineColorChange=function(t){var e=this;return function(n){e.panel.thresholds[t].lineColor=n,e.render()}},t}();F.a.directive("graphPanelThresholdForm",function(){return{restrict:"E",template:'\n<div class="gf-form-group">\n  <h5>Thresholds</h5>\n  <p class="muted" ng-show="ctrl.disabled">\n    Visual thresholds options <strong>disabled.</strong>\n    Visit the Alert tab update your thresholds. <br>\n    To re-enable thresholds, the alert rule must be deleted from this panel.\n  </p>\n  <div ng-class="{\'thresholds-form-disabled\': ctrl.disabled}">\n    <div class="gf-form-inline" ng-repeat="threshold in ctrl.panel.thresholds">\n      <div class="gf-form">\n        <label class="gf-form-label">T{{$index+1}}</label>\n      </div>\n\n      <div class="gf-form">\n        <div class="gf-form-select-wrapper">\n          <select class="gf-form-input" ng-model="threshold.op"\n                  ng-options="f for f in [\'gt\', \'lt\']" ng-change="ctrl.render()" ng-disabled="ctrl.disabled"></select>\n        </div>\n        <input type="number" ng-model="threshold.value" class="gf-form-input width-8"\n               ng-change="ctrl.render()" placeholder="value" ng-disabled="ctrl.disabled">\n      </div>\n\n      <div class="gf-form">\n        <label class="gf-form-label">Color</label>\n        <div class="gf-form-select-wrapper">\n          <select class="gf-form-input" ng-model="threshold.colorMode"\n                  ng-options="f for f in [\'custom\', \'critical\', \'warning\', \'ok\']" ng-change="ctrl.render()" ng-disabled="ctrl.disabled">\n          </select>\n        </div>\n      </div>\n\n      <gf-form-switch class="gf-form" label="Fill" checked="threshold.fill"\n                      on-change="ctrl.render()" ng-disabled="ctrl.disabled"></gf-form-switch>\n\n      <div class="gf-form" ng-if="threshold.fill && threshold.colorMode === \'custom\'">\n        <label class="gf-form-label">Fill color</label>\n        <span class="gf-form-label">\n          <color-picker color="threshold.fillColor" onChange="ctrl.onFillColorChange($index)"></color-picker>\n        </span>\n      </div>\n\n      <gf-form-switch class="gf-form" label="Line" checked="threshold.line"\n                      on-change="ctrl.render()" ng-disabled="ctrl.disabled"></gf-form-switch>\n\n      <div class="gf-form" ng-if="threshold.line && threshold.colorMode === \'custom\'">\n        <label class="gf-form-label">Line color</label>\n        <span class="gf-form-label">\n          <color-picker color="threshold.lineColor" onChange="ctrl.onLineColorChange($index)"></color-picker>\n        </span>\n      </div>\n\n      <div class="gf-form">\n        <label class="gf-form-label">\n          <a class="pointer" ng-click="ctrl.removeThreshold($index)" ng-disabled="ctrl.disabled">\n            <i class="fa fa-trash"></i>\n          </a>\n        </label>\n      </div>\n    </div>\n\n    <div class="gf-form-button-row">\n      <button class="btn btn-inverse" ng-click="ctrl.addThreshold()" ng-disabled="ctrl.disabled">\n        <i class="fa fa-plus"></i>&nbsp;Add Threshold\n      </button>\n    </div>\n  </div>\n</div>\n',controller:N,bindToController:!0,controllerAs:"ctrl",scope:{panelCtrl:"="}}});var j=n(7),B=n.n(j),z=n(8),I=function(){function t(t){this.panel=t}return t.prototype.getSeriesList=function(t){var e,n=this;if(!t.dataList||0===t.dataList.length)return[];if(t.dataList&&t.dataList.length>0){e=t.dataList[0];var i=this.getAutoDetectXAxisMode(e);this.panel.xaxis.mode!==i&&(this.panel.xaxis.mode=i,this.setPanelDefaultsForNewXAxisMode())}switch(this.panel.xaxis.mode){case"series":case"time":return t.dataList.map(function(e,i){return n.timeSeriesHandler(e,i,t)});case"histogram":return[{target:"count",datapoints:o.a.concat([],o.a.flatten(o.a.map(t.dataList,"datapoints")))}].map(function(e,i){return n.timeSeriesHandler(e,i,t)});case"field":return this.customHandler(e)}},t.prototype.getAutoDetectXAxisMode=function(t){switch(t.type){case"docs":case"table":return"field";default:return"series"===this.panel.xaxis.mode?"series":"histogram"===this.panel.xaxis.mode?"histogram":"time"}},t.prototype.setPanelDefaultsForNewXAxisMode=function(){switch(this.panel.xaxis.mode){case"time":this.panel.bars=!1,this.panel.lines=!0,this.panel.points=!1,this.panel.legend.show=!0,this.panel.tooltip.shared=!0,this.panel.xaxis.values=[];break;case"series":this.panel.bars=!0,this.panel.lines=!1,this.panel.points=!1,this.panel.stack=!1,this.panel.legend.show=!1,this.panel.tooltip.shared=!1,this.panel.xaxis.values=["total"];break;case"histogram":this.panel.bars=!0,this.panel.lines=!1,this.panel.points=!1,this.panel.stack=!1,this.panel.legend.show=!1,this.panel.tooltip.shared=!1}},t.prototype.timeSeriesHandler=function(t,e,n){var i=t.datapoints||[],o=t.target,r=e%y.length,s=this.panel.aliasColors[o]||y[r],a=new E({datapoints:i,alias:o,color:s,unit:t.unit});i&&i.length>0&&(i[i.length-1][1]-n.range.from<-1e4&&(a.isOutsideRange=!0));return a},t.prototype.customHandler=function(t){if(!this.panel.xaxis.name)throw{message:"No field name specified to use for x-axis, check your axes settings"};return[]},t.prototype.validateXAxisSeriesValue=function(){switch(this.panel.xaxis.mode){case"series":if(0===this.panel.xaxis.values.length)return void(this.panel.xaxis.values=["total"]);var t=this.getXAxisValueOptions({});return void(o.a.find(t,{value:this.panel.xaxis.values[0]})||(this.panel.xaxis.values=["total"]))}},t.prototype.getDataFieldNames=function(t,e){if(0===t.length)return[];var n=[],i=t[0],r=[];if("docs"===i.type){if(0===i.datapoints.length)return[];!function t(i){o.a.forEach(i,function(i,s){if(o.a.isObject(i))r.push(s),t(i);else if(!e||o.a.isNumber(i)){var a=r.concat(s).join(".");n.push(a)}}),r.pop()}(i.datapoints[0])}return n},t.prototype.getXAxisValueOptions=function(t){switch(this.panel.xaxis.mode){case"series":return[{text:"Avg",value:"avg"},{text:"Min",value:"min"},{text:"Max",value:"max"},{text:"Total",value:"total"},{text:"Count",value:"count"}]}return[]},t.prototype.pluckDeep=function(t,e){for(var n=e.split("."),i=t,o=0;o<n.length;++o){if(!i[n[o]])return;i=i[n[o]]}return i},t}(),$=function(){function t(t,e){this.$scope=t,this.$q=e,this.panelCtrl=t.ctrl,this.panel=this.panelCtrl.panel,this.$scope.ctrl=this,this.unitFormats=_.a.getUnitFormats(),this.logScales={linear:1,"log (base 2)":2,"log (base 10)":10,"log (base 32)":32,"log (base 1024)":1024},this.xAxisModes={Time:"time",Series:"series",Histogram:"histogram"},this.xAxisStatOptions=[{text:"Avg",value:"avg"},{text:"Min",value:"min"},{text:"Max",value:"max"},{text:"Total",value:"total"},{text:"Count",value:"count"},{text:"Current",value:"current"}],"custom"===this.panel.xaxis.mode&&(this.panel.xaxis.name||(this.panel.xaxis.name="specify field"))}return t.$inject=["$scope","$q"],t.prototype.setUnitFormat=function(t,e){t.format=e.value,this.panelCtrl.render()},t.prototype.render=function(){this.panelCtrl.render()},t.prototype.xAxisModeChanged=function(){this.panelCtrl.processor.setPanelDefaultsForNewXAxisMode(),this.panelCtrl.onDataReceived(this.panelCtrl.dataList)},t.prototype.xAxisValueChanged=function(){this.panelCtrl.onDataReceived(this.panelCtrl.dataList)},t.prototype.getDataFieldNames=function(t){var e=this.panelCtrl.processor.getDataFieldNames(this.panelCtrl.dataList,t).map(function(t){return{text:t,value:t}});return this.$q.when(e)},t}();function U(){return{restrict:"E",scope:!0,templateUrl:"/public/plugins/graph-panel/partials/axes_editor.html",controller:$}}n.d(e,"GraphCtrl",function(){return K}),n.d(e,"PanelCtrl",function(){return K});var V,q=(V=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}V(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),K=function(t){function e(e,n,i){var r=t.call(this,e,n)||this;return r.annotationsSrv=i,r.hiddenSeries={},r.seriesList=[],r.dataList=[],r.annotations=[],r.colors=[],r.panelDefaults={datasource:null,renderer:"flot",yaxes:[{label:null,show:!0,logBase:1,min:null,max:null,format:"short"},{label:null,show:!0,logBase:1,min:null,max:null,format:"short"}],xaxis:{show:!0,mode:"time",name:null,values:[],buckets:null},lines:!0,fill:1,linewidth:1,dashes:!1,dashLength:10,spaceLength:10,points:!1,pointradius:5,bars:!1,stack:!1,percentage:!1,legend:{show:!0,values:!1,min:!1,max:!1,current:!1,total:!1,avg:!1},nullPointMode:"null",steppedLine:!1,tooltip:{value_type:"individual",shared:!0,sort:0},timeFrom:null,timeShift:null,targets:[{}],aliasColors:{},seriesOverrides:[],thresholds:[]},o.a.defaults(r.panel,r.panelDefaults),o.a.defaults(r.panel.tooltip,r.panelDefaults.tooltip),o.a.defaults(r.panel.legend,r.panelDefaults.legend),o.a.defaults(r.panel.xaxis,r.panelDefaults.xaxis),r.processor=new I(r.panel),r.events.on("render",r.onRender.bind(r)),r.events.on("data-received",r.onDataReceived.bind(r)),r.events.on("data-error",r.onDataError.bind(r)),r.events.on("data-snapshot-load",r.onDataSnapshotLoad.bind(r)),r.events.on("init-edit-mode",r.onInitEditMode.bind(r)),r.events.on("init-panel-actions",r.onInitPanelActions.bind(r)),r}return q(e,t),e.$inject=["$scope","$injector","annotationsSrv"],e.prototype.onInitEditMode=function(){var t=this.panelPath+"partials";this.addEditorTab("Axes",U,2),this.addEditorTab("Legend",t+"/tab_legend.html",3),this.addEditorTab("Display",t+"/tab_display.html",4),B.a.alertingEnabled&&this.addEditorTab("Alert",z.alertTab,5),this.subTabIndex=0},e.prototype.onInitPanelActions=function(t){t.push({text:"Export CSV",click:"ctrl.exportCsv()"}),t.push({text:"Toggle legend",click:"ctrl.toggleLegend()"})},e.prototype.issueQueries=function(e){return this.annotationsPromise=this.annotationsSrv.getAnnotations({dashboard:this.dashboard,panel:this.panel,range:this.range}),t.prototype.issueQueries.call(this,e)},e.prototype.zoomOut=function(t){this.publishAppEvent("zoom-out",2)},e.prototype.onDataSnapshotLoad=function(t){this.annotationsPromise=this.annotationsSrv.getAnnotations({dashboard:this.dashboard,panel:this.panel,range:this.range}),this.onDataReceived(t)},e.prototype.onDataError=function(t){this.seriesList=[],this.annotations=[],this.render([])},e.prototype.onDataReceived=function(t){var e=this;if(this.dataList=t,this.seriesList=this.processor.getSeriesList({dataList:t,range:this.range}),this.dataWarning=null,0===this.seriesList.reduce(function(t,e){return t+e.datapoints.length},0))this.dataWarning={title:"No data points",tip:"No datapoints returned from data query"};else for(var n=0,i=this.seriesList;n<i.length;n++){if(i[n].isOutsideRange){this.dataWarning={title:"Data points outside time range",tip:"Can be caused by timezone mismatch or missing time filter in query"};break}}this.annotationsPromise.then(function(t){e.loading=!1,e.alertState=t.alertState,e.annotations=t.annotations,e.render(e.seriesList)},function(){e.loading=!1,e.render(e.seriesList)})},e.prototype.onRender=function(){if(this.seriesList)for(var t=0,e=this.seriesList;t<e.length;t++){var n=e[t];n.applySeriesOverrides(this.panel.seriesOverrides),n.unit&&(this.panel.yaxes[n.yaxis-1].format=n.unit)}},e.prototype.changeSeriesColor=function(t,e){t.color=e,this.panel.aliasColors[t.alias]=t.color,this.render()},e.prototype.toggleSeries=function(t,e){e.ctrlKey||e.metaKey||e.shiftKey?this.hiddenSeries[t.alias]?delete this.hiddenSeries[t.alias]:this.hiddenSeries[t.alias]=!0:this.toggleSeriesExclusiveMode(t),this.render()},e.prototype.toggleSeriesExclusiveMode=function(t){var e=this,n=this.hiddenSeries;n[t.alias]&&delete n[t.alias],o.a.every(this.seriesList,function(e){return e.alias===t.alias||n[e.alias]})?o.a.each(this.seriesList,function(t){delete e.hiddenSeries[t.alias]}):o.a.each(this.seriesList,function(n){n.alias!==t.alias&&(e.hiddenSeries[n.alias]=!0)})},e.prototype.toggleAxis=function(t){var e=o.a.find(this.panel.seriesOverrides,{alias:t.alias});e||(e={alias:t.alias},this.panel.seriesOverrides.push(e)),this.render()},e.prototype.addSeriesOverride=function(t){this.panel.seriesOverrides.push(t||{})},e.prototype.removeSeriesOverride=function(t){this.panel.seriesOverrides=o.a.without(this.panel.seriesOverrides,t),this.render()},e.prototype.toggleLegend=function(){this.panel.legend.show=!this.panel.legend.show,this.refresh()},e.prototype.legendValuesOptionChanged=function(){var t=this.panel.legend;t.values=t.min||t.max||t.avg||t.current||t.total,this.render()},e.prototype.exportCsv=function(){var t=this.$scope.$new(!0);t.seriesList=this.seriesList,this.publishAppEvent("show-modal",{templateHtml:'<export-data-modal data="seriesList"></export-data-modal>',scope:t,modalClass:"modal--narrow"})},Object.defineProperty(e.prototype,"panelPath",{get:function(){return this.pluginId="graph-panel",void 0===this._panelPath&&(this._panelPath="/public/plugins/"+this.pluginId+"/"),this._panelPath},enumerable:!0,configurable:!0}),e.template='\n<div class="graph-panel" ng-class="{\'graph-panel--legend-right\': ctrl.panel.legend.rightSide}">\n  <div class="graph-panel__chart" grafana-template-graph ng-dblclick="ctrl.zoomOut()">\n  </div>\n\n  <div class="graph-legend" graph-template-legend></div>\n</div>\n',e}(z.MetricsPanelCtrl)}])});
  //# sourceMappingURL=module.js.map