(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{CaV2:function(t,e,a){"use strict";a.r(e);var r=a("mrSG"),n=a("BkRI"),i=a.n(n),u=a("bt/X"),o=a.n(u),c=a("F/XL"),s=a("0/uQ"),d=a("p0ib"),p=a("xMyE"),g=a("Obii"),f=a("t8hP"),b=a("psW0"),v=a("67Y/"),h=function(t){function e(e){return t.call(this,e)||this}return Object(r.__extends)(e,t),e.prototype.query=function(t){var e=t.targets.filter(function(t){return"-- Mixed --"!==t.datasource});if(!e.length)return Object(c.a)({data:[]});var a=o()(e,"datasource"),r=[];for(var n in a){var i=a[n],u=i[0].datasource;r.push({datasource:Object(f.getDataSourceSrv)().get(u),targets:i})}return this.batchQueries(r,t)},e.prototype.batchQueries=function(t,e){for(var a=[],n=0,u=function(u){var o=t[u];if(!o.targets||!o.targets.length)return"continue";var c=Object(s.a)(o.datasource).pipe(Object(b.a)(function(t){var a=i()(e);a.requestId="mixed-"+u+"-"+(a.requestId||""),a.targets=o.targets,n++;var c=!1;return Object(s.a)(t.query(a)).pipe(Object(p.a)(function(t){c||t.state===g.LoadingState.Streaming||t.state===g.LoadingState.Loading||(n--,c=!0)},function(){c||(c=!0,n--)}),Object(v.a)(function(t){return Object(r.__assign)(Object(r.__assign)({},t),{data:t.data||[],state:0===n?g.LoadingState.Done:g.LoadingState.Loading,key:"mixed-"+u+"-"+(t.key||"")})}))}));a.push(c)},o=0;o<t.length;o++)u(o);return d.a.apply(void 0,Object(r.__spread)(a))},e.prototype.testDatasource=function(){return Promise.resolve({})},e}(g.DataSourceApi);a.d(e,"MixedDatasource",function(){return h}),a.d(e,"Datasource",function(){return h})}}]);
//# sourceMappingURL=mixedPlugin.4d0490a94b199a11f40c.js.map