(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{196:function(e,t,n){"use strict";n.r(t);var r=n(23),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function a(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function r(o,a){try{var i=t[o](a),u=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(u).then(function(e){r("next",e)},function(e){r("throw",e)});e(u)}("next")})}}if(!window.externalApp&&!window.webkit)throw new Error("External auth requires either externalApp or webkit defined on Window object.");var i=function(e){function t(e){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.data={hassUrl:e,access_token:"",expires:0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.a),o(t,[{key:"refreshAccessToken",value:(i=a(regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Promise(function(e,t){window.externalAuthSetToken=function(n,r){return n?e(r):t(r)}}),e.next=3,0;case 3:return n={callback:"externalAuthSetToken"},window.externalApp?window.externalApp.getExternalAuth(n):window.webkit.messageHandlers.getExternalAuth.postMessage(n),e.next=7,t;case 7:r=e.sent,this.data.access_token=r.access_token,this.data.expires=1e3*r.expires_in+Date.now();case 10:case"end":return e.stop()}},e,this)})),function(){return i.apply(this,arguments)})},{key:"revoke",value:(n=a(regeneratorRuntime.mark(function e(){var t,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Promise(function(e,t){window.externalAuthRevokeToken=function(n,r){return n?e(r):t(r)}}),e.next=3,0;case 3:return n={callback:"externalAuthRevokeToken"},window.externalApp?window.externalApp.revokeExternalAuth(n):window.webkit.messageHandlers.revokeExternalAuth.postMessage(n),e.next=7,t;case 7:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})}]),t;var n,i}();t.default=i}}]);
//# sourceMappingURL=590acb08f971266813cb.chunk.js.map