!function(t){let o=new function(){let o=this;o.width=ko.observable(t("#main").outerWidth()),o.showCheckUpdatesWarning=ko.observable(!1),o.checkUpdatesStatus=ko.observable(),o.loading=ko.observable(!0),o.setVersionCheckStatus=function(t){o.checkUpdatesStatus(t),o.welcome.newMonitNotification()||o.welcome.newMMonitNotification()?""==t?(o.checkUpdatesStatus("Initializing"),o.showCheckUpdatesWarning(!1)):"Success"!=t?o.showCheckUpdatesWarning(!0):o.showCheckUpdatesWarning(!1):o.showCheckUpdatesWarning(!1)},o.error=function(t,e,i){o.setVersionCheckStatus(i)},o.welcome={newMMonitNotification:ko.observable(!1),newMonitNotification:ko.observable(!1),toggleNewMMonitNotification:function(e,i){i.stopPropagation(),o.welcome.newMMonitNotification(!o.welcome.newMMonitNotification()),o.loading()||t.ajax({url:"../welcome/setmmonit",data:{newmmonitnotification:o.welcome.newMMonitNotification()},type:"POST",timeout:3e4,error:o.error,success:function(e,i,n){let a=t.parseJSON(e);o.setVersionCheckStatus(a.description)}})},toggleNewMonitNotification:function(e,i){i.stopPropagation(),o.welcome.newMonitNotification(!o.welcome.newMonitNotification()),o.loading()||t.ajax({url:"../welcome/setmonit",data:{newmonitnotification:o.welcome.newMonitNotification()},type:"POST",timeout:3e4,error:o.error,success:function(e,i,n){let a=t.parseJSON(e);o.setVersionCheckStatus(a.description)}})}},o.displayCheckUpdatesWarning=function(o,e){e.stopPropagation(),t(e.currentTarget).tooltip("show")},o.hideCheckUpdatesWarning=function(o,e){e.stopPropagation(),t(e.currentTarget).tooltip("hide")},t.ajax({url:"../../admin/settings/get",type:"GET",dataType:"json",timeout:3e4,error:o.error,success:function(t){o.welcome.newMonitNotification(t.versioncheck.monit),o.welcome.newMMonitNotification(t.versioncheck.mmonit),o.setVersionCheckStatus(t.versioncheck.status),o.loading(!1)}})};ko.applyBindings(o),t(window).on("resize orientationchange",(function(e){o.width(t("#main").outerWidth())}))}(jQuery);