/*! grafana - v4.5.1 - 2017-09-19
 * Copyright (c) 2017 Torkel Ödegaard; Licensed Apache-2.0 */

System.register(["app/core/config","lodash","app/core/core_module","app/core/store"],function(a,b){"use strict";var c,d,e,f,g,h,i;b&&b.id;return{setters:[function(a){c=a},function(a){d=a},function(a){e=a},function(a){f=a}],execute:function(){g=function(){function a(){c.default.bootData.user&&d.default.extend(this,c.default.bootData.user)}return a}(),a("User",g),h=function(){function a(){this.pinned=f.default.getBool("grafana.sidemenu.pinned",!1),this.pinned&&(this.sidemenu=!0),c.default.buildInfo||(c.default.buildInfo={}),c.default.bootData||(c.default.bootData={user:{},settings:{}}),this.version=c.default.buildInfo.version,this.user=new g,this.isSignedIn=this.user.isSignedIn,this.isGrafanaAdmin=this.user.isGrafanaAdmin,this.isEditor=this.hasRole("Editor")||this.hasRole("Admin")}return a.prototype.hasRole=function(a){return this.user.orgRole===a},a.prototype.setPinnedState=function(a){this.pinned=a,f.default.set("grafana.sidemenu.pinned",a)},a.prototype.isGrafanaVisible=function(){return!(void 0!==document.visibilityState&&"visible"!==document.visibilityState)},a.prototype.toggleSideMenu=function(){this.sidemenu=!this.sidemenu,this.sidemenu||this.setPinnedState(!1)},a}(),a("ContextSrv",h),i=new h,a("contextSrv",i),e.default.factory("contextSrv",function(){return i})}}});