(self.webpackChunk=self.webpackChunk||[]).push([[3744,9425],{38319:function(t,e,n){"use strict";n.r(e),n.d(e,{authorize:function(){return a},activate:function(){return u}});var i=n(53754),c=n(38440),r=n(76543),a=function(t){var e=ApiClient.getUrl("/QuickConnect/Authorize?Code="+t);return ApiClient.ajax({type:"POST",url:e},!0).then((function(){(0,c.Z)(i.ZP.translate("QuickConnectAuthorizeSuccess"))})).catch((function(){(0,c.Z)(i.ZP.translate("QuickConnectAuthorizeFail"))})),!1},u=function(){var t=ApiClient.getUrl("/QuickConnect/Activate");return ApiClient.ajax({type:"POST",url:t}).then((function(){return(0,c.Z)(i.ZP.translate("QuickConnectActivationSuccessful")),!0})).catch((function(t){throw console.error("Error activating quick connect. Error:",t),r.ZP.alert({title:i.ZP.translate("HeaderError"),message:i.ZP.translate("DefaultErrorMessage")}),t}))}},20642:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return a}});var i=n(38319),c=n(53754),r=n(38440);function a(t){function e(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ApiClient.getQuickConnect("Status").then((function(n){var i=t.querySelector("#btnQuickConnectActivate"),r=t.querySelector(".quickConnectSettingsContainer");return r.style.display="none","Unavailable"===n?(i.textContent=c.ZP.translate("QuickConnectNotAvailable"),i.disabled=!0,i.classList.remove("button-submit"),i.classList.add("button")):("Active"===n||e)&&(r.style.display="",i.style.display="none"),!0})).catch((function(t){throw t}))}t.addEventListener("viewshow",(function(){var n=t.querySelector("#txtQuickConnectCode");t.querySelector("#btnQuickConnectActivate").addEventListener("click",(function(){(0,i.activate)().then((function(){e()}))})),t.querySelector("#btnQuickConnectAuthorize").addEventListener("click",(function(){if(n.validity.valid){var t=n.value;(0,i.authorize)(t)}else(0,r.Z)(c.ZP.translate("QuickConnectInvalidCode"))})),t.querySelector(".quickConnectSettingsContainer").addEventListener("submit",(function(t){t.preventDefault()})),e()}))}}}]);