!function(e){e.getScript("https://mmonit.com/feed/feed.js",(function(){e("#feed").html(com_mmonit_feed.text),e("#announcement").show()}));var n=new function(){var n=this;n.loading=ko.observable(!0),n.deleteEventsMenu=ko.observableArray(Menu.JSONToMenu([{id:"5",name:"After 1 month",description:"1 month"},{id:"6",name:"After 3 months",description:"3 months"},{id:"7",name:"After 6 months",description:"6 months"},{id:"8",name:"After 1 year",description:"1 year"},{id:"9",name:"After 3 years",description:"3 years"},{id:"10",name:"Never",description:"never"}])),n.deleteEventsLabel=ko.computed((function(){return Menu.getSelectedNames(n.deleteEventsMenu(),null)})),n.deleteAnalyticsMenu=ko.observableArray(Menu.JSONToMenu([{id:"5",name:"After 1 month",description:"1 month"},{id:"6",name:"After 3 months",description:"3 months"},{id:"7",name:"After 6 months",description:"6 months"},{id:"8",name:"After 1 year",description:"1 year"},{id:"9",name:"After 3 years",description:"3 years"}])),n.deleteAnalyticsLabel=ko.computed((function(){return Menu.getSelectedNames(n.deleteAnalyticsMenu(),null)})),n.save=function(){n.loading()||e.ajax({url:"../../admin/general/update",data:e.param({purgeevents:Menu.getSelectedValues(n.deleteEventsMenu(),"id"),purgeanalytics:Menu.getSelectedValues(n.deleteAnalyticsMenu(),"id")},!0),type:"POST",timeout:3e4,error:MMONIT.error.json})},n.purgeEventsSelection=ko.observable(n.deleteEventsMenu().length-1),n.selectPurgeEvents=function(t){n.purgeEventsSelection(t),"11"==t.id?n.selectPurgeEventsConfirm():e("#confirmDeleteEvents").modal("show")},n.selectPurgeEventsConfirm=function(){Menu.select(n.deleteEventsMenu(),n.purgeEventsSelection().id),n.save()},n.purgeAnalyticsSelection=ko.observable(n.deleteAnalyticsMenu.length-1),n.selectPurgeAnalytics=function(t){n.purgeAnalyticsSelection(t),e("#confirmDeleteAnalytics").modal("show")},n.selectPurgeAnalyticsConfirm=function(e){Menu.select(n.deleteAnalyticsMenu(),n.purgeAnalyticsSelection().id),n.save()},e.ajax({url:"../../admin/general/get",type:"GET",dataType:"json",timeout:3e4,error:MMONIT.error.json,success:function(e){Menu.select(n.deleteEventsMenu(),e.purgeevents),Menu.select(n.deleteAnalyticsMenu(),e.purgeanalytics),n.loading(!1)}})};ko.applyBindings(n)}(jQuery);