/*! grafana - v4.2.0 - 2017-03-24
 * Copyright (c) 2017 Torkel Ödegaard; Licensed Apache-2.0 */

System.register(["lodash","app/plugins/sdk"],function(a,b){"use strict";var c,d,e,f=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)};b&&b.id;return{setters:[function(a){c=a},function(a){d=a}],execute:function(){e=function(a){function b(b,c,d){var e=a.call(this,b,c)||this;return e.backendSrv=d,e.target.scenarioId=e.target.scenarioId||"random_walk",e.scenarioList=[],e}return f(b,a),b.$inject=["$scope","$injector","backendSrv"],b.prototype.$onInit=function(){var a=this;return this.backendSrv.get("/api/tsdb/testdata/scenarios").then(function(b){a.scenarioList=b,a.scenario=c.default.find(a.scenarioList,{id:a.target.scenarioId})})},b.prototype.scenarioChanged=function(){this.scenario=c.default.find(this.scenarioList,{id:this.target.scenarioId}),this.target.stringInput=this.scenario.stringInput,this.refresh()},b}(d.QueryCtrl),e.templateUrl="partials/query.editor.html",a("TestDataQueryCtrl",e)}}});