(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{DRNK:function(e,t,n){"use strict";n.r(t),n.d(t,"SelectOrgPage",(function(){return d}));var r=n("q1tI"),a=n.n(r),o=n("ZGyg"),i=n("t8hP"),u=n("Y8YH"),c=n("kDLi");function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(e,t,n,r,a,o,i){try{var u=e[o](i),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,a)}function f(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){l(o,r,a,i,u,"next",e)}function u(e){l(o,r,a,i,u,"throw",e)}i(void 0)}))}}var p={main:{icon:"grafana",subTitle:"Preferences",text:"Select active organization"},node:{text:"Select active organization"}},g=function(){var e=f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(i.getBackendSrv)().get("/api/user/orgs");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),v=function(){var e=f(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(i.getBackendSrv)().post("/api/user/using/"+t.orgId).then((function(){window.location.href=i.config.appSubUrl+"/"}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=s(Object(r.useState)(),2),t=e[0],n=e[1];return Object(u.a)(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=n,e.next=3,g();case 3:e.t1=e.sent,(0,e.t0)(e.t1);case 5:case"end":return e.stop()}}),e)}))),[]),a.a.createElement(o.a,{navModel:p},a.a.createElement(o.a.Contents,null,a.a.createElement("div",null,a.a.createElement("p",null,"You have been added to another Organization due to an open invitation! Please select which organization you want to use right now (you can change this later at any time)."),a.a.createElement(c.HorizontalGroup,{wrap:!0},t&&t.map((function(e){return a.a.createElement(c.Button,{key:e.orgId,icon:"signin",onClick:function(){return v(e)}},e.name)}))))))};t.default=d}}]);
//# sourceMappingURL=SelectOrgPage.280e50dbf9c55707f8c1.js.map