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

System.register(["angular","app/core/core_module","./exporter"],function(a,b){"use strict";function c(){return{restrict:"E",templateUrl:"public/app/features/dashboard/export/export_modal.html",controller:g,bindToController:!0,controllerAs:"ctrl",scope:{dismiss:"&"}}}b&&b.id;a("dashExportDirective",c);var d,e,f,g;return{setters:[function(a){d=a},function(a){e=a},function(a){f=a}],execute:function(){g=function(){function a(a,b,c,d){var e=this;this.backendSrv=a,this.dashboardSrv=b,this.$scope=d,this.exporter=new f.DashboardExporter(c),this.exporter.makeExportable(this.dashboardSrv.getCurrent()).then(function(a){e.$scope.$apply(function(){e.dash=a})})}return a.$inject=["backendSrv","dashboardSrv","datasourceSrv","$scope"],a.prototype.save=function(){var a=new Blob([d.default.toJson(this.dash,!0)],{type:"application/json;charset=utf-8"}),b=window;b.saveAs(a,this.dash.title+"-"+(new Date).getTime()+".json")},a.prototype.saveJson=function(){var a=this.dashboardSrv.getCurrent().getSaveModelClone();this.$scope.$root.appEvent("show-json-editor",{object:a}),this.dismiss()},a}(),a("DashExportCtrl",g),e.default.directive("dashExportModal",c)}}});