text: /*! grafana - v4.2.0 - 2017-03-22
   * Copyright (c) 2017 Torkel Ödegaard; Licensed Apache-2.0 */
  
  System.register(["angular","jquery","tether-drop"],function(a,b){"use strict";var c,d,e,f,g;b&&b.id;return{setters:[function(a){c=a},function(a){d=a},function(a){e=a}],execute:function(){f=c.default.module("grafana.directives"),g='\n  <div class="panel-container">\n    <div class="panel-header">\n      <span class="panel-info-corner">\n        <i class="fa"></i>\n        <span class="panel-info-corner-inner"></span>\n      </span>\n\n      <span class="panel-loading" ng-show="ctrl.loading">\n        <i class="fa fa-spinner fa-spin"></i>\n      </span>\n\n      <div class="panel-title-container drag-handle" panel-menu></div>\n    </div>\n\n    <div class="panel-content">\n      <ng-transclude></ng-transclude>\n    </div>\n    <panel-resizer></panel-resizer>\n  </div>\n\n  <div class="panel-full-edit" ng-if="ctrl.editMode">\n    <div class="tabbed-view tabbed-view--panel-edit">\n      <div class="tabbed-view-header">\n        <h2 class="tabbed-view-title">\n          {{ctrl.pluginName}}\n        </h2>\n\n        <ul class="gf-tabs">\n          <li class="gf-tabs-item" ng-repeat="tab in ::ctrl.editorTabs">\n            <a class="gf-tabs-link" ng-click="ctrl.changeTab($index)" ng-class="{active: ctrl.editorTabIndex === $index}">\n              {{::tab.title}}\n            </a>\n          </li>\n        </ul>\n\n        <button class="tabbed-view-close-btn" ng-click="ctrl.exitFullscreen();">\n          <i class="fa fa-remove"></i>\n        </button>\n      </div>\n\n      <div class="tabbed-view-body">\n        <div ng-repeat="tab in ctrl.editorTabs" ng-if="ctrl.editorTabIndex === $index">\n          <panel-editor-tab editor-tab="tab" ctrl="ctrl" index="$index"></panel-editor-tab>\n        </div>\n      </div>\n    </div>\n  </div>\n',f.directive("grafanaPanel",["$rootScope",function(a){return{restrict:"E",template:g,transclude:!0,scope:{ctrl:"="},link:function(b,c){function d(){k.toggleClass("panel-hover-highlight",!0),m.dashboard.setPanelFocus(m.panel.id)}function f(){k.toggleClass("panel-hover-highlight",!1),m.dashboard.setPanelFocus(0)}function g(){var a=m.getInfoMode();l[0].className="panel-info-corner panel-info-corner--"+a,a&&(h&&h.destroy(),h=new e.default({target:l[0],content:function(){return m.getInfoContent({mode:"tooltip"})},position:"top center",classes:m.error?"drop-error":"drop-help",openOn:"hover",hoverOpenDelay:100,constrainToScrollParent:!1}))}var h,i,j,k=c.find(".panel-container"),l=c.find(".panel-info-corner"),m=b.ctrl,n=!1,o=!1,p=0;m.containerHeight||(m.calculatePanelHeight(),k.css({minHeight:m.containerHeight}),p=m.containerHeight),m.panel.transparent&&(n=!0,k.addClass("panel-transparent",!0)),m.events.on("render",function(){p!==m.containerHeight&&(k.css({minHeight:m.containerHeight}),p=m.containerHeight),n!==m.panel.transparent&&(k.toggleClass("panel-transparent",m.panel.transparent===!0),n=m.panel.transparent),j=void 0!==m.panel.alert,o!==j&&(k.toggleClass("panel-has-alert",j),o=j),m.alertState?(i&&k.removeClass("panel-alert-state--"+i),"ok"!==m.alertState.state&&"alerting"!==m.alertState.state||k.addClass("panel-alert-state--"+m.alertState.state),i=m.alertState.state):i&&(k.removeClass("panel-alert-state--"+i),i=null)});var q;a.onAppEvent("panel-change-view",function(a,b){q!==m.fullscreen&&(c.toggleClass("panel-fullscreen",!!m.fullscreen),q=m.fullscreen)},b),b.$watchGroup(["ctrl.error","ctrl.panel.description"],g),b.$watchCollection("ctrl.panel.links",g),l.on("click",function(){h.close(),b.$apply(m.openInspector.bind(m))}),c.on("mouseenter",d),c.on("mouseleave",f),b.$on("$destroy",function(){c.off(),l.off(),h&&h.destroy()})}}}]),f.directive("panelResizer",["$rootScope",function(a){return{restrict:"E",template:'<span class="resize-panel-handle icon-gf icon-gf-grabber"></span>',link:function(b,c){function e(a){a.preventDefault(),m=!0,i=d.default(a.target).offset(),j=parseInt(n.row.height),k=n.panel.span,l=d.default(document).width(),h=n.row.panels[n.row.panels.length-1],d.default("body").on("mousemove",f),d.default("body").on("mouseup",g)}function f(a){n.row.height=Math.round(j+(a.pageY-i.top)),n.panel.span=k+(a.pageX-i.left)/l*12,n.panel.span=Math.min(Math.max(n.panel.span,1),12),n.row.updateRowSpan();var c=n.row.span;Math.floor(c)<14&&(h===n.panel&&c>12?h.span-=c-12:h!==n.panel&&(h.span=h.span-(c-12),h.span=Math.min(Math.max(h.span,1),12))),n.row.panelSpanChanged(!0),b.$apply(function(){n.render()})}function g(){n.panel.span=Math.round(n.panel.span),h&&(h.span=Math.round(h.span)),a.$apply(function(){n.row.panelSpanChanged(),setTimeout(function(){a.$broadcast("render")})}),d.default("body").off("mousemove",f),d.default("body").off("mouseup",g)}var h,i,j,k,l,m=!1,n=b.ctrl;c.on("mousedown",e);var o=b.$on("$destroy",function(){c.off("mousedown",e),o()})}}}]),f.directive("panelHelpCorner",["$rootScope",function(a){return{restrict:"E",template:'\n      <span class="alert-error panel-error small pointer" ng-if="ctrl.error" ng-click="ctrl.openInspector()">\n        <span data-placement="top" bs-tooltip="ctrl.error">\n          <i class="fa fa-exclamation"></i><span class="panel-error-arrow"></span>\n        </span>\n      </span>\n    ',link:function(a,b){}}}])}}});